manifest, schema, router and two panels. the editor is hosted and saving; the last step is not finished and the readme says so. designs are rows scoped per user, with userId in every WHERE rather than checked after the read — another person's design is 'not found', so the id space cannot be probed. the Doc is stored whole as jsonb because upstream adds fields to it constantly and none of them should be a migration here. the handoff is the reason the plugin exists and it is the part that does not work: /api/chat has NO session-creation route, a session is constructed by the browser opening a websocket, so a plugin has nothing to POST to. onExport returns false and the clipboard still runs, which is upstream's own behaviour — degraded, not broken. docs/handoff.md names the one platform change that would finish it, and argues it should be generic rather than ours. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
52 lines
2.3 KiB
TypeScript
52 lines
2.3 KiB
TypeScript
import type { PluginManifest } from '@@/plugins/manifest';
|
|
|
|
// Sketch a Material 3 screen, and hand the prompt to the agent.
|
|
//
|
|
// ── What this is, and what it is not ──
|
|
//
|
|
// The editor is [M3E Canvas](https://github.com/lnkiai/m3e-canvas), MIT, vendored under `web/vendor/`
|
|
// and re-copied by `scripts/vendor.sh`. Officer contributes none of the drawing, none of the Material
|
|
// 3 vocabulary and none of the prompt wording — that is upstream's work and there is no wish to fork
|
|
// its direction.
|
|
//
|
|
// What Officer contributes is the last step. Upstream's export button writes the prompt to the
|
|
// clipboard for you to paste into a coding tool. Here it opens a chat session with the prompt already
|
|
// in it, pointed at a directory on this machine, and the agent writes the app. That is the whole
|
|
// reason this plugin exists; everything else is hosting.
|
|
//
|
|
// ── Why the permission is grantable ──
|
|
//
|
|
// A design is a document, like a note or a dashboard. There is no credential involved, nothing here
|
|
// reaches another machine, and a member sketching a screen is exactly the case this should serve. So
|
|
// it is grantable, and documents are scoped per user by the schema rather than by a filter someone
|
|
// has to remember.
|
|
//
|
|
// The one owner-only corner is `/_handoff`, which starts an agent session. Spawning an agent runs as
|
|
// the owner and can write to the owner's disk, so it is not a thing to hand out with a drawing tool.
|
|
export const manifest: PluginManifest = {
|
|
publisher: 'officerdev',
|
|
version: '0.1.0',
|
|
platform: '>=1.0.0',
|
|
|
|
label: 'Canvas',
|
|
summary: 'Sketch a Material 3 screen, and hand the prompt to the agent',
|
|
icon: 'PenTool',
|
|
color: '#6750A4', // Material 3's own primary, since the whole editor is drawn in that vocabulary
|
|
|
|
permissions: [
|
|
{
|
|
key: 'm3e-canvas',
|
|
label: 'Canvas',
|
|
description: 'Sketch Material 3 screens and turn them into prompts',
|
|
ownerOnly: ['/_handoff'],
|
|
},
|
|
],
|
|
|
|
// `motion` is the only thing the platform does not already have — `html-to-image` is present at the
|
|
// same version upstream asks for, and React is React. These are INTERSECTED across every installed
|
|
// plugin into one `plugins/node_modules/`, so the range is upstream's own rather than tightened.
|
|
npmDependencies: {
|
|
motion: '^13.1.1',
|
|
},
|
|
};
|