@skillcdn/console 0.4.7 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -14
- package/SKILLCDN.md +5 -3
- package/dist/agent-page.d.ts +44 -0
- package/dist/agent-page.d.ts.map +1 -0
- package/dist/agent-page.js +415 -0
- package/dist/agent-page.js.map +1 -0
- package/dist/agent-stream.d.ts +52 -0
- package/dist/agent-stream.d.ts.map +1 -0
- package/dist/agent-stream.js +155 -0
- package/dist/agent-stream.js.map +1 -0
- package/dist/api.d.ts +12 -6
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +11 -5
- package/dist/api.js.map +1 -1
- package/dist/avatar.d.ts +137 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/avatar.js +1216 -0
- package/dist/avatar.js.map +1 -0
- package/dist/charts.d.ts +103 -0
- package/dist/charts.d.ts.map +1 -0
- package/dist/charts.js +182 -0
- package/dist/charts.js.map +1 -0
- package/dist/cli/cli.d.ts +39 -1
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +2424 -296
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/command-words.d.ts +20 -0
- package/dist/cli/command-words.d.ts.map +1 -0
- package/dist/cli/command-words.js +51 -0
- package/dist/cli/command-words.js.map +1 -0
- package/dist/cli/credentials.d.ts +59 -5
- package/dist/cli/credentials.d.ts.map +1 -1
- package/dist/cli/credentials.js +128 -16
- package/dist/cli/credentials.js.map +1 -1
- package/dist/cli/directory.d.ts +19 -4
- package/dist/cli/directory.d.ts.map +1 -1
- package/dist/cli/directory.js +16 -8
- package/dist/cli/directory.js.map +1 -1
- package/dist/cli/format.d.ts +91 -8
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +386 -57
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts +13 -4
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +202 -62
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/main.js +94 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/pack.d.ts +69 -36
- package/dist/cli/pack.d.ts.map +1 -1
- package/dist/cli/pack.js +241 -188
- package/dist/cli/pack.js.map +1 -1
- package/dist/cli/plugin-check.d.ts +42 -0
- package/dist/cli/plugin-check.d.ts.map +1 -1
- package/dist/cli/plugin-check.js +221 -36
- package/dist/cli/plugin-check.js.map +1 -1
- package/dist/cli/plugin-cli.d.ts +6 -1
- package/dist/cli/plugin-cli.d.ts.map +1 -1
- package/dist/cli/plugin-cli.js +21 -4
- package/dist/cli/plugin-cli.js.map +1 -1
- package/dist/cli/plugin-main.js +1 -0
- package/dist/cli/plugin-main.js.map +1 -1
- package/dist/cli/runner-host.d.ts +36 -0
- package/dist/cli/runner-host.d.ts.map +1 -0
- package/dist/cli/runner-host.js +154 -0
- package/dist/cli/runner-host.js.map +1 -0
- package/dist/cli/serve.d.ts +33 -1
- package/dist/cli/serve.d.ts.map +1 -1
- package/dist/cli/serve.js +275 -6
- package/dist/cli/serve.js.map +1 -1
- package/dist/cli/setup-machine.d.ts +36 -0
- package/dist/cli/setup-machine.d.ts.map +1 -0
- package/dist/cli/setup-machine.js +109 -0
- package/dist/cli/setup-machine.js.map +1 -0
- package/dist/client.d.ts +189 -10
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +192 -57
- package/dist/client.js.map +1 -1
- package/dist/compat.d.ts +1 -1
- package/dist/compat.js +2 -2
- package/dist/components/agent-page.d.ts +384 -0
- package/dist/components/agent-page.d.ts.map +1 -0
- package/dist/components/agent-page.js +985 -0
- package/dist/components/agent-page.js.map +1 -0
- package/dist/components/agents.d.ts +102 -0
- package/dist/components/agents.d.ts.map +1 -0
- package/dist/components/agents.js +246 -0
- package/dist/components/agents.js.map +1 -0
- package/dist/components/calendar.d.ts +17 -17
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/calendar.js +7 -2
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/charts.d.ts +157 -0
- package/dist/components/charts.d.ts.map +1 -0
- package/dist/components/charts.js +182 -0
- package/dist/components/charts.js.map +1 -0
- package/dist/components/comments.d.ts +2 -0
- package/dist/components/comments.d.ts.map +1 -1
- package/dist/components/comments.js +1 -1
- package/dist/components/comments.js.map +1 -1
- package/dist/components/connect.d.ts.map +1 -1
- package/dist/components/connect.js +7 -2
- package/dist/components/connect.js.map +1 -1
- package/dist/components/decision-form.d.ts +21 -0
- package/dist/components/decision-form.d.ts.map +1 -1
- package/dist/components/decision-form.js +20 -6
- package/dist/components/decision-form.js.map +1 -1
- package/dist/components/decision-list.d.ts +24 -0
- package/dist/components/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +54 -5
- package/dist/components/decision-list.js.map +1 -1
- package/dist/components/desk-records.d.ts +102 -0
- package/dist/components/desk-records.d.ts.map +1 -0
- package/dist/components/desk-records.js +221 -0
- package/dist/components/desk-records.js.map +1 -0
- package/dist/components/desk.d.ts +85 -0
- package/dist/components/desk.d.ts.map +1 -0
- package/dist/components/desk.js +135 -0
- package/dist/components/desk.js.map +1 -0
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +26 -1
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/home.d.ts +12 -1
- package/dist/components/home.d.ts.map +1 -1
- package/dist/components/home.js +175 -16
- package/dist/components/home.js.map +1 -1
- package/dist/components/my-decisions.d.ts +5 -0
- package/dist/components/my-decisions.d.ts.map +1 -1
- package/dist/components/my-decisions.js +3 -3
- package/dist/components/my-decisions.js.map +1 -1
- package/dist/components/people.d.ts +17 -0
- package/dist/components/people.d.ts.map +1 -1
- package/dist/components/people.js +55 -19
- package/dist/components/people.js.map +1 -1
- package/dist/components/picker.d.ts +2 -0
- package/dist/components/picker.d.ts.map +1 -1
- package/dist/components/picker.js +1 -1
- package/dist/components/picker.js.map +1 -1
- package/dist/components/pictures.d.ts +38 -10
- package/dist/components/pictures.d.ts.map +1 -1
- package/dist/components/pictures.js +195 -40
- package/dist/components/pictures.js.map +1 -1
- package/dist/components/plugin-events.d.ts +29 -0
- package/dist/components/plugin-events.d.ts.map +1 -0
- package/dist/components/plugin-events.js +139 -0
- package/dist/components/plugin-events.js.map +1 -0
- package/dist/components/plugin-frame.d.ts.map +1 -1
- package/dist/components/plugin-frame.js +14 -37
- package/dist/components/plugin-frame.js.map +1 -1
- package/dist/components/plugin-settings.d.ts.map +1 -1
- package/dist/components/plugin-settings.js +58 -7
- package/dist/components/plugin-settings.js.map +1 -1
- package/dist/components/projects.d.ts.map +1 -1
- package/dist/components/projects.js +30 -10
- package/dist/components/projects.js.map +1 -1
- package/dist/components/rules.d.ts +8 -10
- package/dist/components/rules.d.ts.map +1 -1
- package/dist/components/rules.js +36 -14
- package/dist/components/rules.js.map +1 -1
- package/dist/components/sessions.d.ts.map +1 -1
- package/dist/components/sessions.js +8 -4
- package/dist/components/sessions.js.map +1 -1
- package/dist/components/setup.d.ts +59 -0
- package/dist/components/setup.d.ts.map +1 -0
- package/dist/components/setup.js +93 -0
- package/dist/components/setup.js.map +1 -0
- package/dist/components/sign-in.js +1 -1
- package/dist/components/sign-in.js.map +1 -1
- package/dist/components/task-form.d.ts.map +1 -1
- package/dist/components/task-form.js +2 -2
- package/dist/components/task-form.js.map +1 -1
- package/dist/components/task-list.d.ts +7 -6
- package/dist/components/task-list.d.ts.map +1 -1
- package/dist/components/task-list.js.map +1 -1
- package/dist/components/task-view.d.ts +3 -0
- package/dist/components/task-view.d.ts.map +1 -1
- package/dist/components/task-view.js +1 -1
- package/dist/components/task-view.js.map +1 -1
- package/dist/components/ui.d.ts +78 -8
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +88 -9
- package/dist/components/ui.js.map +1 -1
- package/dist/components/work.d.ts +5 -5
- package/dist/components/work.d.ts.map +1 -1
- package/dist/components/work.js.map +1 -1
- package/dist/components/workspace.d.ts +17 -0
- package/dist/components/workspace.d.ts.map +1 -1
- package/dist/components/workspace.js +129 -2
- package/dist/components/workspace.js.map +1 -1
- package/dist/connect-page.d.ts.map +1 -1
- package/dist/connect-page.js +5 -2
- package/dist/connect-page.js.map +1 -1
- package/dist/console.css +7551 -4580
- package/dist/console.d.ts +20 -0
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +331 -57
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +22 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +62 -34
- package/dist/data.js.map +1 -1
- package/dist/desk-page.d.ts +38 -0
- package/dist/desk-page.d.ts.map +1 -0
- package/dist/desk-page.js +184 -0
- package/dist/desk-page.js.map +1 -0
- package/dist/desk-records-page.d.ts +18 -0
- package/dist/desk-records-page.d.ts.map +1 -0
- package/dist/desk-records-page.js +130 -0
- package/dist/desk-records-page.js.map +1 -0
- package/dist/desk-records.d.ts +247 -0
- package/dist/desk-records.d.ts.map +1 -0
- package/dist/desk-records.js +543 -0
- package/dist/desk-records.js.map +1 -0
- package/dist/desk.d.ts +122 -0
- package/dist/desk.d.ts.map +1 -0
- package/dist/desk.js +211 -0
- package/dist/desk.js.map +1 -0
- package/dist/feed-stream.d.ts +39 -0
- package/dist/feed-stream.d.ts.map +1 -0
- package/dist/feed-stream.js +117 -0
- package/dist/feed-stream.js.map +1 -0
- package/dist/glances.d.ts +39 -0
- package/dist/glances.d.ts.map +1 -0
- package/dist/glances.js +94 -0
- package/dist/glances.js.map +1 -0
- package/dist/home-tiles.d.ts +69 -5
- package/dist/home-tiles.d.ts.map +1 -1
- package/dist/home-tiles.js +347 -9
- package/dist/home-tiles.js.map +1 -1
- package/dist/i18n/en.d.ts +773 -3
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +770 -9
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +736 -9
- package/dist/i18n/ko.js.map +1 -1
- package/dist/index.d.ts +19 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +67 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +67 -0
- package/dist/limits.js.map +1 -1
- package/dist/onboarding.d.ts +21 -0
- package/dist/onboarding.d.ts.map +1 -0
- package/dist/onboarding.js +43 -0
- package/dist/onboarding.js.map +1 -0
- package/dist/persona.d.ts +34 -0
- package/dist/persona.d.ts.map +1 -0
- package/dist/persona.js +71 -0
- package/dist/persona.js.map +1 -0
- package/dist/plugin/context.d.ts +42 -11
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/limits.d.ts +2 -0
- package/dist/plugin/limits.d.ts.map +1 -1
- package/dist/plugin/limits.js +2 -0
- package/dist/plugin/limits.js.map +1 -1
- package/dist/plugin/manifest.d.ts +13 -0
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +34 -4
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +56 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +42 -0
- package/dist/plugin/rest-schemas.js.map +1 -1
- package/dist/plugin/sandbox.d.ts.map +1 -1
- package/dist/plugin/sandbox.js +4 -1
- package/dist/plugin/sandbox.js.map +1 -1
- package/dist/plugin/testing.d.ts +6 -2
- package/dist/plugin/testing.d.ts.map +1 -1
- package/dist/plugin/testing.js +52 -10
- package/dist/plugin/testing.js.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/records.d.ts +283 -0
- package/dist/records.d.ts.map +1 -0
- package/dist/records.js +543 -0
- package/dist/records.js.map +1 -0
- package/dist/router.d.ts +50 -3
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +78 -7
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +12 -2
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +14 -1
- package/dist/routes.js.map +1 -1
- package/dist/rules.d.ts +30 -11
- package/dist/rules.d.ts.map +1 -1
- package/dist/rules.js +99 -42
- package/dist/rules.js.map +1 -1
- package/dist/runner/acp.d.ts +20 -0
- package/dist/runner/acp.d.ts.map +1 -0
- package/dist/runner/acp.js +1132 -0
- package/dist/runner/acp.js.map +1 -0
- package/dist/runner/claude.d.ts +13 -0
- package/dist/runner/claude.d.ts.map +1 -0
- package/dist/runner/claude.js +615 -0
- package/dist/runner/claude.js.map +1 -0
- package/dist/runner/codex.d.ts +19 -0
- package/dist/runner/codex.d.ts.map +1 -0
- package/dist/runner/codex.js +597 -0
- package/dist/runner/codex.js.map +1 -0
- package/dist/runner/config.d.ts +35 -0
- package/dist/runner/config.d.ts.map +1 -0
- package/dist/runner/config.js +74 -0
- package/dist/runner/config.js.map +1 -0
- package/dist/runner/desk.d.ts +81 -0
- package/dist/runner/desk.d.ts.map +1 -0
- package/dist/runner/desk.js +303 -0
- package/dist/runner/desk.js.map +1 -0
- package/dist/runner/launchd.d.ts +7 -0
- package/dist/runner/launchd.d.ts.map +1 -0
- package/dist/runner/launchd.js +78 -0
- package/dist/runner/launchd.js.map +1 -0
- package/dist/runner/message.d.ts +66 -0
- package/dist/runner/message.d.ts.map +1 -0
- package/dist/runner/message.js +181 -0
- package/dist/runner/message.js.map +1 -0
- package/dist/runner/modules.d.ts +13 -0
- package/dist/runner/modules.d.ts.map +1 -0
- package/dist/runner/modules.js +30 -0
- package/dist/runner/modules.js.map +1 -0
- package/dist/runner/process.d.ts +7 -0
- package/dist/runner/process.d.ts.map +1 -0
- package/dist/runner/process.js +65 -0
- package/dist/runner/process.js.map +1 -0
- package/dist/runner/redact.d.ts +48 -0
- package/dist/runner/redact.d.ts.map +1 -0
- package/dist/runner/redact.js +214 -0
- package/dist/runner/redact.js.map +1 -0
- package/dist/runner/registry.d.ts +37 -0
- package/dist/runner/registry.d.ts.map +1 -0
- package/dist/runner/registry.js +26 -0
- package/dist/runner/registry.js.map +1 -0
- package/dist/runner/runner.d.ts +130 -0
- package/dist/runner/runner.d.ts.map +1 -0
- package/dist/runner/runner.js +1551 -0
- package/dist/runner/runner.js.map +1 -0
- package/dist/runner/slack.d.ts +16 -0
- package/dist/runner/slack.d.ts.map +1 -0
- package/dist/runner/slack.js +157 -0
- package/dist/runner/slack.js.map +1 -0
- package/dist/runner/systemd-user.d.ts +7 -0
- package/dist/runner/systemd-user.d.ts.map +1 -0
- package/dist/runner/systemd-user.js +93 -0
- package/dist/runner/systemd-user.js.map +1 -0
- package/dist/runner/task-scheduler.d.ts +38 -0
- package/dist/runner/task-scheduler.d.ts.map +1 -0
- package/dist/runner/task-scheduler.js +216 -0
- package/dist/runner/task-scheduler.js.map +1 -0
- package/dist/runner/types.d.ts +315 -0
- package/dist/runner/types.d.ts.map +1 -0
- package/dist/runner/types.js +24 -0
- package/dist/runner/types.js.map +1 -0
- package/dist/runner.d.ts +18 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +20 -0
- package/dist/runner.js.map +1 -0
- package/dist/schemas.d.ts +6082 -1295
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +930 -31
- package/dist/schemas.js.map +1 -1
- package/dist/services.d.ts +110 -0
- package/dist/services.d.ts.map +1 -0
- package/dist/services.js +305 -0
- package/dist/services.js.map +1 -0
- package/dist/setup-guide.d.ts +64 -0
- package/dist/setup-guide.d.ts.map +1 -0
- package/dist/setup-guide.js +256 -0
- package/dist/setup-guide.js.map +1 -0
- package/dist/setup-page.d.ts +6 -0
- package/dist/setup-page.d.ts.map +1 -0
- package/dist/setup-page.js +29 -0
- package/dist/setup-page.js.map +1 -0
- package/dist/sse.d.ts +15 -0
- package/dist/sse.d.ts.map +1 -0
- package/dist/sse.js +73 -0
- package/dist/sse.js.map +1 -0
- package/dist/tab-title.d.ts +6 -0
- package/dist/tab-title.d.ts.map +1 -0
- package/dist/tab-title.js +22 -0
- package/dist/tab-title.js.map +1 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +3 -0
- package/dist/tokens.js.map +1 -1
- package/dist/use-action.d.ts +5 -2
- package/dist/use-action.d.ts.map +1 -1
- package/dist/use-action.js +6 -1
- package/dist/use-action.js.map +1 -1
- package/dist/vocabulary.d.ts +84 -4
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +115 -3
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +147 -41
- package/docs/specs/plugins.md +37 -27
- package/docs/specs/records.md +113 -0
- package/docs/specs/rest.md +155 -20
- package/docs/specs/runner.md +347 -0
- package/package.json +12 -3
- package/skills/building-a-console/SKILL.md +4 -4
- package/skills/building-a-console/references/configuring.md +1 -0
- package/skills/building-a-plugin/SKILL.md +7 -7
- package/skills/deploying-a-console/SKILL.md +4 -4
- package/skills/deploying-a-console/references/resources.md +48 -8
- package/skills/deploying-a-console/references/running-it-again.md +3 -2
- package/skills/keeping-a-desk/SKILL.md +133 -0
- package/skills/keeping-a-desk/collections.md +96 -0
- package/skills/planning-the-board/SKILL.md +14 -18
- package/skills/planning-the-board/references/a-task.md +2 -2
- package/skills/planning-the-board/references/project-rules.md +13 -14
- package/skills/planning-the-board/references/setting-up.md +22 -9
- package/skills/running-an-agent/SKILL.md +107 -0
- package/skills/running-an-agent/references/slack-app.md +61 -0
- package/skills/working-the-board/SKILL.md +66 -39
- package/skills/working-the-board/references/terms.md +9 -5
- package/skills/working-the-board/references/the-pack.md +14 -9
- package/skills/working-the-board/references/the-sentence.md +2 -2
- package/src/agent-page.tsx +1039 -0
- package/src/agent-stream.ts +199 -0
- package/src/api.ts +317 -2
- package/src/avatar.ts +1506 -0
- package/src/charts.ts +250 -0
- package/src/cli/cli.ts +3210 -503
- package/src/cli/command-words.ts +56 -0
- package/src/cli/credentials.ts +188 -16
- package/src/cli/directory.ts +28 -10
- package/src/cli/format.ts +470 -67
- package/src/cli/help.ts +233 -61
- package/src/cli/main.ts +89 -0
- package/src/cli/pack.ts +332 -263
- package/src/cli/plugin-check.ts +275 -34
- package/src/cli/plugin-cli.ts +28 -4
- package/src/cli/plugin-main.ts +1 -0
- package/src/cli/runner-host.ts +188 -0
- package/src/cli/serve.ts +320 -5
- package/src/cli/setup-machine.ts +153 -0
- package/src/client.ts +711 -126
- package/src/compat.ts +2 -2
- package/src/components/agent-page.tsx +1946 -0
- package/src/components/agents.tsx +638 -0
- package/src/components/calendar.tsx +74 -53
- package/src/components/charts.tsx +680 -0
- package/src/components/comments.tsx +3 -0
- package/src/components/connect.tsx +37 -2
- package/src/components/decision-form.tsx +89 -51
- package/src/components/decision-list.tsx +140 -4
- package/src/components/desk-records.tsx +724 -0
- package/src/components/desk.tsx +471 -0
- package/src/components/event-feed.tsx +30 -1
- package/src/components/home.tsx +353 -12
- package/src/components/my-decisions.tsx +8 -2
- package/src/components/people.tsx +300 -203
- package/src/components/picker.tsx +3 -1
- package/src/components/pictures.tsx +256 -44
- package/src/components/plugin-events.ts +159 -0
- package/src/components/plugin-frame.tsx +14 -38
- package/src/components/plugin-settings.tsx +178 -22
- package/src/components/projects.tsx +33 -15
- package/src/components/rules.tsx +96 -36
- package/src/components/sessions.tsx +7 -4
- package/src/components/setup.tsx +252 -0
- package/src/components/sign-in.tsx +1 -1
- package/src/components/task-form.tsx +11 -2
- package/src/components/task-list.tsx +7 -6
- package/src/components/task-view.tsx +4 -0
- package/src/components/ui.tsx +169 -25
- package/src/components/work.tsx +9 -9
- package/src/components/workspace.tsx +345 -4
- package/src/connect-page.tsx +15 -2
- package/src/console.tsx +657 -83
- package/src/data.ts +109 -43
- package/src/desk-page.tsx +332 -0
- package/src/desk-records-page.tsx +256 -0
- package/src/desk-records.ts +808 -0
- package/src/desk.ts +329 -0
- package/src/feed-stream.ts +144 -0
- package/src/glances.ts +132 -0
- package/src/home-tiles.ts +411 -9
- package/src/i18n/en.ts +828 -10
- package/src/i18n/ko.ts +792 -10
- package/src/index.ts +172 -3
- package/src/limits.ts +67 -0
- package/src/onboarding.ts +84 -0
- package/src/persona.ts +100 -0
- package/src/plugin/context.ts +55 -12
- package/src/plugin/limits.ts +2 -0
- package/src/plugin/manifest.ts +42 -3
- package/src/plugin/rest-schemas.ts +46 -0
- package/src/plugin/sandbox.ts +4 -1
- package/src/plugin/testing.ts +63 -12
- package/src/plugin.ts +2 -0
- package/src/records.ts +702 -0
- package/src/router.ts +120 -10
- package/src/routes.ts +17 -1
- package/src/rules.ts +109 -44
- package/src/runner/acp.ts +1267 -0
- package/src/runner/claude.ts +695 -0
- package/src/runner/codex.ts +691 -0
- package/src/runner/config.ts +97 -0
- package/src/runner/desk.ts +377 -0
- package/src/runner/launchd.ts +86 -0
- package/src/runner/message.ts +232 -0
- package/src/runner/modules.ts +30 -0
- package/src/runner/process.ts +72 -0
- package/src/runner/redact.ts +242 -0
- package/src/runner/registry.ts +67 -0
- package/src/runner/runner.ts +1879 -0
- package/src/runner/slack.ts +180 -0
- package/src/runner/systemd-user.ts +103 -0
- package/src/runner/task-scheduler.ts +236 -0
- package/src/runner/types.ts +334 -0
- package/src/runner.ts +110 -0
- package/src/schemas.ts +1183 -30
- package/src/services.ts +424 -0
- package/src/setup-guide.ts +336 -0
- package/src/setup-page.tsx +46 -0
- package/src/sse.ts +84 -0
- package/src/styles/README.md +111 -0
- package/src/styles/base.css +130 -0
- package/src/styles/console.css +85 -7095
- package/src/styles/drawn-by-pages.json +256 -0
- package/src/styles/pages/agents.css +1195 -0
- package/src/styles/pages/board.css +380 -0
- package/src/styles/pages/calendar.css +214 -0
- package/src/styles/pages/connect.css +182 -0
- package/src/styles/pages/decisions.css +370 -0
- package/src/styles/pages/desk.css +126 -0
- package/src/styles/pages/documents.css +273 -0
- package/src/styles/pages/feed.css +118 -0
- package/src/styles/pages/home.css +718 -0
- package/src/styles/pages/people.css +90 -0
- package/src/styles/pages/plugins.css +212 -0
- package/src/styles/pages/roadmap.css +377 -0
- package/src/styles/pages/settings.css +171 -0
- package/src/styles/pages/shell.css +208 -0
- package/src/styles/pages/sign-in.css +178 -0
- package/src/styles/pages/task.css +108 -0
- package/src/styles/pages/thread.css +331 -0
- package/src/styles/pages/work.css +68 -0
- package/src/styles/parts/avatar.css +82 -0
- package/src/styles/parts/badge.css +227 -0
- package/src/styles/parts/bars.css +80 -0
- package/src/styles/parts/button.css +99 -0
- package/src/styles/parts/calendar.css +547 -0
- package/src/styles/parts/callout.css +41 -0
- package/src/styles/parts/category.css +8 -0
- package/src/styles/parts/chart.css +173 -0
- package/src/styles/parts/chip.css +90 -0
- package/src/styles/parts/code.css +48 -0
- package/src/styles/parts/count.css +27 -0
- package/src/styles/parts/crumbs.css +61 -0
- package/src/styles/parts/detail.css +110 -0
- package/src/styles/parts/empty.css +21 -0
- package/src/styles/parts/eyebrow.css +9 -0
- package/src/styles/parts/facts.css +147 -0
- package/src/styles/parts/figures.css +65 -0
- package/src/styles/parts/files.css +38 -0
- package/src/styles/parts/filters.css +42 -0
- package/src/styles/parts/form.css +109 -0
- package/src/styles/parts/frame.css +45 -0
- package/src/styles/parts/input.css +243 -0
- package/src/styles/parts/legend.css +48 -0
- package/src/styles/parts/links.css +37 -0
- package/src/styles/parts/mark.css +79 -0
- package/src/styles/parts/menu.css +147 -0
- package/src/styles/parts/page.css +174 -0
- package/src/styles/parts/pager.css +19 -0
- package/src/styles/parts/panel.css +33 -0
- package/src/styles/parts/person.css +257 -0
- package/src/styles/parts/picker.css +185 -0
- package/src/styles/parts/progress.css +25 -0
- package/src/styles/parts/prose.css +128 -0
- package/src/styles/parts/rows.css +63 -0
- package/src/styles/parts/series.css +32 -0
- package/src/styles/parts/settings.css +101 -0
- package/src/styles/parts/share.css +25 -0
- package/src/styles/parts/spark.css +23 -0
- package/src/styles/parts/spinner.css +29 -0
- package/src/styles/parts/stat.css +69 -0
- package/src/styles/parts/steps.css +68 -0
- package/src/styles/parts/tabs.css +175 -0
- package/src/styles/parts/text.css +61 -0
- package/src/styles/parts/toggle.css +71 -0
- package/src/styles/parts/workers.css +37 -0
- package/src/styles/tokens.css +295 -0
- package/src/tab-title.ts +25 -0
- package/src/tokens.ts +3 -0
- package/src/use-action.ts +7 -2
- package/src/vocabulary.ts +151 -3
- package/template/desk-web/README.md +8 -0
- package/template/desk-web/index.html +13 -0
- package/template/desk-web/package.json +25 -0
- package/template/desk-web/src/main.tsx +24 -0
- package/template/desk-web/src/page.tsx +51 -0
- package/template/desk-web/tsconfig.json +16 -0
- package/template/desk-web/vite.config.ts +15 -0
package/src/cli/plugin-check.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// `console-plugin check` (docs/specs/plugins.md, "Authoring"): reads a plugin's package as the
|
|
2
2
|
// console would and names everything a console, or a store, would refuse it for: the manifest,
|
|
3
3
|
// the package's own manifest, the server module under the host's hardening and against the
|
|
4
|
-
// manifest, the web bundle's self-containment and its classes, the
|
|
4
|
+
// manifest, the web bundle's self-containment and its classes, held to the console's parts, the
|
|
5
|
+
// skills, the migrations.
|
|
5
6
|
import { readdir, readFile, stat } from "node:fs/promises";
|
|
6
|
-
import { join, posix } from "node:path";
|
|
7
|
+
import { join, posix, relative, sep } from "node:path";
|
|
7
8
|
import { descriptionProblems, type PluginDescription } from "../plugin/define.js";
|
|
8
9
|
import type { ServerLoad } from "../plugin/load.js";
|
|
9
10
|
import {
|
|
@@ -81,14 +82,96 @@ export function coveredByFiles(files: readonly string[], path: string): boolean
|
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
|
|
85
|
+
/**
|
|
86
|
+
* The most the check reads of one file of a plugin's package, in bytes: 4 MiB. A file is read
|
|
87
|
+
* whole, into memory and through every reader here, and a plugin's files are a fraction of
|
|
88
|
+
* that: the example's server module, with everything it bundles, is under 1 MiB, the script of
|
|
89
|
+
* its pages a few dozen KiB. One beyond the bound is refused by its size and not read. The
|
|
90
|
+
* readers themselves take a time that grows with a file's size, whatever it holds: a bound on
|
|
91
|
+
* the size bounds nothing where a reader tries again from every place it could have begun.
|
|
92
|
+
*/
|
|
93
|
+
export const MAX_CHECKED_FILE_BYTES = 4 * 1024 * 1024;
|
|
94
|
+
|
|
95
|
+
/** What is said of a file beyond the bound, in the words of a problem. */
|
|
96
|
+
const tooLarge = (file: string, bytes: number): string =>
|
|
97
|
+
`${file} is ${bytes} bytes: the check reads a file of up to ${MAX_CHECKED_FILE_BYTES / (1024 * 1024)} MiB (${MAX_CHECKED_FILE_BYTES} bytes) whole, and did not read this one`;
|
|
98
|
+
|
|
99
|
+
/** A file of the package as text; or nothing of one that is not there, and its size of one too large to read whole. */
|
|
100
|
+
async function readWhole(
|
|
101
|
+
path: string,
|
|
102
|
+
): Promise<{ readonly text: string } | { readonly bytes: number } | null> {
|
|
103
|
+
try {
|
|
104
|
+
const found = await stat(path);
|
|
105
|
+
if (!found.isFile()) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
if (found.size > MAX_CHECKED_FILE_BYTES) {
|
|
109
|
+
return { bytes: found.size };
|
|
110
|
+
}
|
|
111
|
+
return { text: await readFile(path, "utf8") };
|
|
112
|
+
} catch {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** A file of the package as one check reads it: its text, or that it is not there, or that it was refused by its size. */
|
|
118
|
+
type PackageFile = { readonly text: string } | "missing" | "refused";
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The reader of one check: a file of the package by its path under the root, as the manifest
|
|
122
|
+
* writes it and a problem names it. A file beyond the bound is a problem said once, however
|
|
123
|
+
* often the check comes to it, and is not read.
|
|
124
|
+
*/
|
|
125
|
+
function packageReader(root: string, errors: string[]): (file: string) => Promise<PackageFile> {
|
|
126
|
+
const refused = new Set<string>();
|
|
127
|
+
return async (file) => {
|
|
128
|
+
const read = await readWhole(join(root, file));
|
|
129
|
+
if (read === null) {
|
|
130
|
+
return "missing";
|
|
131
|
+
}
|
|
132
|
+
if ("bytes" in read) {
|
|
133
|
+
if (!refused.has(file)) {
|
|
134
|
+
refused.add(file);
|
|
135
|
+
errors.push(tooLarge(file, read.bytes));
|
|
136
|
+
}
|
|
137
|
+
return "refused";
|
|
138
|
+
}
|
|
139
|
+
return read;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
84
143
|
/** A class selector: a dot not after a digit or another dot (0.5em is a number), then a name. */
|
|
85
144
|
const CLASS_SELECTOR = /(?<![\d.])\.(-?[A-Za-z_][\w-]*)/g;
|
|
86
145
|
|
|
146
|
+
/**
|
|
147
|
+
* A stylesheet without its comments, read from one end to the other once: a comment opened and
|
|
148
|
+
* never closed takes the rest of the sheet with it, as a browser reads it. An expression that
|
|
149
|
+
* looks for the closing of each would look to the end of the sheet again for every one opened.
|
|
150
|
+
*/
|
|
151
|
+
function withoutComments(css: string): string {
|
|
152
|
+
const kept: string[] = [];
|
|
153
|
+
let at = 0;
|
|
154
|
+
for (;;) {
|
|
155
|
+
const open = css.indexOf("/*", at);
|
|
156
|
+
if (open < 0) {
|
|
157
|
+
kept.push(css.slice(at));
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
kept.push(css.slice(at, open));
|
|
161
|
+
const close = css.indexOf("*/", open + 2);
|
|
162
|
+
if (close < 0) {
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
at = close + 2;
|
|
166
|
+
}
|
|
167
|
+
return kept.join("");
|
|
168
|
+
}
|
|
169
|
+
|
|
87
170
|
/** The classes a stylesheet styles, each once; comments and quoted strings are not read. */
|
|
88
171
|
export function classesIn(css: string): string[] {
|
|
89
|
-
const
|
|
172
|
+
const bare = withoutComments(css).replace(/"[^"]*"|'[^']*'/g, '""');
|
|
90
173
|
const found = new Set<string>();
|
|
91
|
-
for (const match of
|
|
174
|
+
for (const match of bare.matchAll(CLASS_SELECTOR)) {
|
|
92
175
|
if (match[1] !== undefined && !/^\d/.test(match[1])) {
|
|
93
176
|
found.add(match[1]);
|
|
94
177
|
}
|
|
@@ -96,7 +179,116 @@ export function classesIn(css: string): string[] {
|
|
|
96
179
|
return [...found];
|
|
97
180
|
}
|
|
98
181
|
|
|
99
|
-
|
|
182
|
+
/**
|
|
183
|
+
* The classes of the console's stylesheet, as the package ships its sources (ADR-0106): the
|
|
184
|
+
* parts, which a plugin's pages are built from as the console's own are, and the classes of the
|
|
185
|
+
* console's own pages, which lay one page out and are that page's alone. The list is the
|
|
186
|
+
* catalogue itself, `src/styles/README.md` of the package, and the pages' files beside it:
|
|
187
|
+
* nothing is copied, so that a part added to the catalogue is one a plugin may use at once.
|
|
188
|
+
*/
|
|
189
|
+
export interface ConsoleClasses {
|
|
190
|
+
/** Whether a row of the catalogue names the class: `sc-button*` is `sc-button` and every `sc-button-...`. */
|
|
191
|
+
isPart(name: string): boolean;
|
|
192
|
+
/** Whether a part's class begins so, for a name a bundle finishes itself: `sc-badge-` and a tone. */
|
|
193
|
+
beginsPart(stem: string): boolean;
|
|
194
|
+
/** Whether the class is one of the console's own pages', which no part is. */
|
|
195
|
+
isPagesOwn(name: string): boolean;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** Reads the catalogue's rows and the pages' stylesheets into the classes a plugin is held to. */
|
|
199
|
+
export function consoleClassesOf(catalogue: string, pageSheets: readonly string[]): ConsoleClasses {
|
|
200
|
+
const exact = new Set<string>();
|
|
201
|
+
const stems: string[] = [];
|
|
202
|
+
const lines = catalogue.split(/\r?\n/);
|
|
203
|
+
const from = lines.findIndex((line) => line.trim() === "## The catalogue");
|
|
204
|
+
const after = lines.findIndex((line, index) => index > from && line.startsWith("## "));
|
|
205
|
+
for (const line of from < 0 ? [] : lines.slice(from + 1, after < 0 ? undefined : after)) {
|
|
206
|
+
// A row of the table: the part, its classes, what renders it, what it is for.
|
|
207
|
+
const cells = line.startsWith("|") ? line.split("|") : [];
|
|
208
|
+
for (const match of (cells[2] ?? "").matchAll(/`(sc-[a-z0-9-]+)(\*?)`/g)) {
|
|
209
|
+
if (match[2] === "*") {
|
|
210
|
+
stems.push(match[1] ?? "");
|
|
211
|
+
} else {
|
|
212
|
+
exact.add(match[1] ?? "");
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const isPart = (name: string): boolean =>
|
|
217
|
+
exact.has(name) || stems.some((stem) => name === stem || name.startsWith(`${stem}-`));
|
|
218
|
+
const ofPages = new Set(pageSheets.flatMap((css) => classesIn(css)));
|
|
219
|
+
return {
|
|
220
|
+
isPart,
|
|
221
|
+
beginsPart: (stem) =>
|
|
222
|
+
[...exact].some((name) => name.startsWith(stem)) ||
|
|
223
|
+
stems.some((part) => `${part}-`.startsWith(stem) || stem.startsWith(`${part}-`)),
|
|
224
|
+
isPagesOwn: (name) => ofPages.has(name) && !isPart(name),
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** The catalogue and the pages' files of the package whose styles are in `stylesDir`. */
|
|
229
|
+
export async function readConsoleClasses(stylesDir: string): Promise<ConsoleClasses> {
|
|
230
|
+
const catalogue = await readFile(join(stylesDir, "README.md"), "utf8");
|
|
231
|
+
const pages = (await readdir(join(stylesDir, "pages"))).filter((name) => name.endsWith(".css"));
|
|
232
|
+
return consoleClassesOf(
|
|
233
|
+
catalogue,
|
|
234
|
+
await Promise.all(pages.map((name) => readFile(join(stylesDir, "pages", name), "utf8"))),
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* A name in the console's own prefix, as a script holds one: `sc-` not inside a longer word nor
|
|
240
|
+
* a custom property (`--sc-color-text` is a token), then the name, with the hyphen it ends on
|
|
241
|
+
* where the script finishes it itself (`sc-badge-` and a tone). The expression takes the run of
|
|
242
|
+
* letters, digits and hyphens whole, and the name ends in it at the first hyphen doubled: an
|
|
243
|
+
* expression that takes it a word and a hyphen at a time keeps a place for each, and a name of
|
|
244
|
+
* some megabytes was more places than it has.
|
|
245
|
+
*/
|
|
246
|
+
const CONSOLE_NAME = /(?<![\w-])sc-[a-z][a-z0-9-]*/g;
|
|
247
|
+
|
|
248
|
+
/** The names in the console's prefix a script holds, each once. */
|
|
249
|
+
export function consoleNamesIn(script: string): string[] {
|
|
250
|
+
const found = new Set<string>();
|
|
251
|
+
for (const [run] of script.matchAll(CONSOLE_NAME)) {
|
|
252
|
+
const doubled = run.indexOf("--");
|
|
253
|
+
found.add(doubled < 0 ? run : run.slice(0, doubled + 1));
|
|
254
|
+
}
|
|
255
|
+
return [...found];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* What a file of a web bundle uses of the console's classes that is not a part (ADR-0106): a
|
|
260
|
+
* class of one of the console's own pages, which is that page's layout and changes with it, is
|
|
261
|
+
* an error; a name nothing of the console styles is said, since it draws nothing. A stylesheet
|
|
262
|
+
* is read by its selectors, a script by the names it holds.
|
|
263
|
+
*/
|
|
264
|
+
export function strayConsoleClasses(
|
|
265
|
+
file: string,
|
|
266
|
+
text: string,
|
|
267
|
+
classes: ConsoleClasses,
|
|
268
|
+
): { readonly pagesOwn: string[]; readonly unknown: string[] } {
|
|
269
|
+
const names = file.endsWith(".css")
|
|
270
|
+
? classesIn(text).filter((name) => name.startsWith("sc-"))
|
|
271
|
+
: consoleNamesIn(text);
|
|
272
|
+
const pagesOwn: string[] = [];
|
|
273
|
+
const unknown: string[] = [];
|
|
274
|
+
for (const name of names) {
|
|
275
|
+
if (name.endsWith("-") ? classes.beginsPart(name) : classes.isPart(name)) {
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
(classes.isPagesOwn(name) ? pagesOwn : unknown).push(name);
|
|
279
|
+
}
|
|
280
|
+
return { pagesOwn: pagesOwn.sort(), unknown: unknown.sort() };
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** A few of a list, in a line, with a word where there are more. */
|
|
284
|
+
const some = (names: readonly string[], most = 8): string =>
|
|
285
|
+
`${names.slice(0, most).join(", ")}${names.length > most ? `, and ${names.length - most} more` : ""}`;
|
|
286
|
+
|
|
287
|
+
// The blanks around an import's bracket are taken in one way only, `\s*(?:\(\s*)?`: written as
|
|
288
|
+
// `\s*\(?\s*`, a run of blanks with no bracket in it is divided between the two in every way
|
|
289
|
+
// before the expression gives up, which is the square of its length.
|
|
290
|
+
const WEB_IMPORT =
|
|
291
|
+
/(?:\bfrom\s*|\bimport\s*(?:\(\s*)?|\bexport\s+\*\s+from\s*)["'`]([^"'`]+)["'`]/g;
|
|
100
292
|
const WEB_FORBIDDEN =
|
|
101
293
|
/\b(fetch|XMLHttpRequest|WebSocket|EventSource|importScripts|sendBeacon)\s*\(|document\.cookie|\bnavigator\.serviceWorker\b/g;
|
|
102
294
|
|
|
@@ -130,18 +322,23 @@ async function exists(path: string): Promise<"file" | "directory" | null> {
|
|
|
130
322
|
}
|
|
131
323
|
}
|
|
132
324
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
325
|
+
/** A JSON file at the package's root, by its name, which is what a problem with it is said by. */
|
|
326
|
+
async function readJson(
|
|
327
|
+
root: string,
|
|
328
|
+
name: string,
|
|
329
|
+
): Promise<{ value: unknown } | { problem: string }> {
|
|
330
|
+
const read = await readWhole(join(root, name));
|
|
331
|
+
if (read === null) {
|
|
332
|
+
return { problem: `${name} is missing` };
|
|
333
|
+
}
|
|
334
|
+
if ("bytes" in read) {
|
|
335
|
+
return { problem: tooLarge(name, read.bytes) };
|
|
139
336
|
}
|
|
140
337
|
try {
|
|
141
|
-
return { value: JSON.parse(text) as unknown };
|
|
338
|
+
return { value: JSON.parse(read.text) as unknown };
|
|
142
339
|
} catch (error) {
|
|
143
340
|
return {
|
|
144
|
-
problem: `${
|
|
341
|
+
problem: `${name} is not JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
145
342
|
};
|
|
146
343
|
}
|
|
147
344
|
}
|
|
@@ -171,15 +368,15 @@ async function checkSkills(
|
|
|
171
368
|
skillsDir: string,
|
|
172
369
|
errors: string[],
|
|
173
370
|
warnings: string[],
|
|
371
|
+
read: (file: string) => Promise<PackageFile>,
|
|
174
372
|
): Promise<number> {
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
if (manifestText === null) {
|
|
373
|
+
const manifest = await read("SKILLCDN.md");
|
|
374
|
+
if (manifest === "missing") {
|
|
178
375
|
errors.push(
|
|
179
376
|
"SKILLCDN.md is missing at the package root: a plugin with skills has their manifest there",
|
|
180
377
|
);
|
|
181
|
-
} else {
|
|
182
|
-
const matter = frontMatter(
|
|
378
|
+
} else if (manifest !== "refused") {
|
|
379
|
+
const matter = frontMatter(manifest.text);
|
|
183
380
|
if (matter === null || !matter.scalars.name || !matter.scalars.description) {
|
|
184
381
|
errors.push("SKILLCDN.md has no front-matter with name and description");
|
|
185
382
|
}
|
|
@@ -195,13 +392,16 @@ async function checkSkills(
|
|
|
195
392
|
continue;
|
|
196
393
|
}
|
|
197
394
|
const file = posix.join(skillsDir, entry.name, "SKILL.md");
|
|
198
|
-
const
|
|
199
|
-
if (
|
|
395
|
+
const skill = await read(file);
|
|
396
|
+
if (skill === "missing") {
|
|
200
397
|
errors.push(`${file} is missing: a skill directory holds a SKILL.md`);
|
|
201
398
|
continue;
|
|
202
399
|
}
|
|
203
400
|
count += 1;
|
|
204
|
-
|
|
401
|
+
if (skill === "refused") {
|
|
402
|
+
continue;
|
|
403
|
+
}
|
|
404
|
+
const matter = frontMatter(skill.text);
|
|
205
405
|
if (matter === null) {
|
|
206
406
|
errors.push(`${file} has no front-matter`);
|
|
207
407
|
continue;
|
|
@@ -251,28 +451,40 @@ async function checkMigrations(
|
|
|
251
451
|
}
|
|
252
452
|
}
|
|
253
453
|
|
|
454
|
+
/** The scripts and stylesheets of a bundle, by their paths under it: its entry, its chunks, its styles. */
|
|
455
|
+
async function bundleFiles(dir: string): Promise<string[]> {
|
|
456
|
+
const entries = await readdir(dir, { withFileTypes: true, recursive: true });
|
|
457
|
+
return entries
|
|
458
|
+
.filter((entry) => entry.isFile() && /\.(?:js|mjs|css)$/.test(entry.name))
|
|
459
|
+
.map((entry) => posix.join(relative(dir, entry.parentPath).split(sep).join("/"), entry.name))
|
|
460
|
+
.sort();
|
|
461
|
+
}
|
|
462
|
+
|
|
254
463
|
async function checkWeb(
|
|
255
464
|
root: string,
|
|
256
465
|
manifest: PluginManifest,
|
|
257
466
|
webDir: string,
|
|
258
467
|
errors: string[],
|
|
259
468
|
warnings: string[],
|
|
469
|
+
classes: ConsoleClasses | undefined,
|
|
470
|
+
read: (file: string) => Promise<PackageFile>,
|
|
260
471
|
): Promise<void> {
|
|
261
472
|
const dir = join(root, webDir);
|
|
262
473
|
if ((await exists(dir)) !== "directory") {
|
|
263
474
|
errors.push(`web names ${webDir}, which is not a directory: build the bundle first`);
|
|
264
475
|
return;
|
|
265
476
|
}
|
|
266
|
-
const script = await
|
|
267
|
-
if (script ===
|
|
477
|
+
const script = await read(`${webDir}/index.js`);
|
|
478
|
+
if (script === "missing") {
|
|
268
479
|
errors.push(`${webDir}/index.js is missing: the frame loads the bundle from there`);
|
|
269
|
-
} else {
|
|
270
|
-
for (const problem of webBundleProblems(script)) {
|
|
480
|
+
} else if (script !== "refused") {
|
|
481
|
+
for (const problem of webBundleProblems(script.text)) {
|
|
271
482
|
errors.push(`${webDir}/index.js ${problem}`);
|
|
272
483
|
}
|
|
273
484
|
}
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
485
|
+
const sheet = await read(`${webDir}/index.css`);
|
|
486
|
+
if (sheet !== "missing" && sheet !== "refused") {
|
|
487
|
+
const css = sheet.text;
|
|
276
488
|
if (
|
|
277
489
|
/@import\s+(?:url\()?["']?(?:https?:)?\/\//.test(css) ||
|
|
278
490
|
/url\(\s*["']?(?:https?:)?\/\//.test(css)
|
|
@@ -289,6 +501,30 @@ async function checkWeb(
|
|
|
289
501
|
);
|
|
290
502
|
}
|
|
291
503
|
}
|
|
504
|
+
if (classes === undefined) {
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
// A plugin's pages are built from the console's parts, as the console's own are (ADR-0106):
|
|
508
|
+
// every file of the bundle is read for the classes of the console it uses.
|
|
509
|
+
for (const file of await bundleFiles(dir)) {
|
|
510
|
+
const found = await read(`${webDir}/${file}`);
|
|
511
|
+
if (found === "missing" || found === "refused") {
|
|
512
|
+
continue;
|
|
513
|
+
}
|
|
514
|
+
const stray = strayConsoleClasses(file, found.text, classes);
|
|
515
|
+
if (stray.pagesOwn.length > 0) {
|
|
516
|
+
const one = stray.pagesOwn.length === 1;
|
|
517
|
+
errors.push(
|
|
518
|
+
`${webDir}/${file} uses ${some(stray.pagesOwn)}: ${one ? "a class" : "classes"} of the console's own pages, not ${one ? "a part" : "parts"}; a plugin's page is built from the parts, which src/styles/README.md of @skillcdn/console lists`,
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
if (stray.unknown.length > 0) {
|
|
522
|
+
const one = stray.unknown.length === 1;
|
|
523
|
+
warnings.push(
|
|
524
|
+
`${webDir}/${file} names ${some(stray.unknown)}: no part of the console has ${one ? "that class" : "those classes"}, and nothing styles ${one ? "it" : "them"}; a plugin's own classes begin with pl-${manifest.key}-`,
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
292
528
|
}
|
|
293
529
|
|
|
294
530
|
function describeCounts(manifest: PluginManifest, description: PluginDescription | null): string {
|
|
@@ -335,6 +571,8 @@ export function sameAsEnglish(value: unknown, at = ""): string[] {
|
|
|
335
571
|
export interface CheckOptions {
|
|
336
572
|
/** The version of the console this command belongs to, held against the manifest's `console`; left out, not compared. */
|
|
337
573
|
readonly consoleVersion?: string | undefined;
|
|
574
|
+
/** The classes of the console this command belongs to, which the web bundle's are held to; left out, not held. */
|
|
575
|
+
readonly consoleClasses?: ConsoleClasses | undefined;
|
|
338
576
|
}
|
|
339
577
|
|
|
340
578
|
/** Reads the plugin at `root` as a console would, and says what it would refuse. */
|
|
@@ -349,7 +587,7 @@ export async function checkPlugin(
|
|
|
349
587
|
return { ok: false, errors: [`${root} is not a directory`], warnings, summary: null };
|
|
350
588
|
}
|
|
351
589
|
|
|
352
|
-
const manifestRead = await readJson(
|
|
590
|
+
const manifestRead = await readJson(root, "console-plugin.json");
|
|
353
591
|
if ("problem" in manifestRead) {
|
|
354
592
|
return { ok: false, errors: [manifestRead.problem], warnings, summary: null };
|
|
355
593
|
}
|
|
@@ -383,7 +621,7 @@ export async function checkPlugin(
|
|
|
383
621
|
);
|
|
384
622
|
}
|
|
385
623
|
|
|
386
|
-
const packageRead = await readJson(
|
|
624
|
+
const packageRead = await readJson(root, "package.json");
|
|
387
625
|
let version = "0.0.0";
|
|
388
626
|
if ("problem" in packageRead) {
|
|
389
627
|
errors.push(packageRead.problem);
|
|
@@ -461,12 +699,15 @@ export async function checkPlugin(
|
|
|
461
699
|
}
|
|
462
700
|
}
|
|
463
701
|
|
|
702
|
+
const read = packageReader(root, errors);
|
|
464
703
|
let description: PluginDescription | null = null;
|
|
465
704
|
const serverPath = join(root, manifest.server);
|
|
466
|
-
|
|
705
|
+
const server = await read(manifest.server);
|
|
706
|
+
if (server === "missing") {
|
|
467
707
|
errors.push(`server names ${manifest.server}, which is missing: build the server module first`);
|
|
468
|
-
} else {
|
|
469
|
-
|
|
708
|
+
} else if (server !== "refused") {
|
|
709
|
+
// A module beyond the bound is neither read nor loaded: what it is was not looked at.
|
|
710
|
+
const source = server.text;
|
|
470
711
|
for (const specifier of forbiddenImportsIn(source)) {
|
|
471
712
|
errors.push(`${manifest.server} imports ${specifier}, which the host refuses`);
|
|
472
713
|
}
|
|
@@ -511,11 +752,11 @@ export async function checkPlugin(
|
|
|
511
752
|
}
|
|
512
753
|
|
|
513
754
|
if (manifest.web !== undefined) {
|
|
514
|
-
await checkWeb(root, manifest, manifest.web, errors, warnings);
|
|
755
|
+
await checkWeb(root, manifest, manifest.web, errors, warnings, options.consoleClasses, read);
|
|
515
756
|
}
|
|
516
757
|
let skills = 0;
|
|
517
758
|
if (manifest.skills !== undefined) {
|
|
518
|
-
skills = await checkSkills(root, manifest.skills, errors, warnings);
|
|
759
|
+
skills = await checkSkills(root, manifest.skills, errors, warnings, read);
|
|
519
760
|
} else {
|
|
520
761
|
warnings.push(
|
|
521
762
|
"console-plugin.json: names no skills; an agent learns the plugin from its command's help alone",
|
package/src/cli/plugin-cli.ts
CHANGED
|
@@ -6,7 +6,8 @@ import { parseArgs } from "node:util";
|
|
|
6
6
|
import type { ServerLoad } from "../plugin/load.js";
|
|
7
7
|
import { isPluginKey, RESERVED_PLUGIN_KEYS } from "../plugin/manifest.js";
|
|
8
8
|
import { lineRangeFrom, versionOfDependency } from "../plugin/semver.js";
|
|
9
|
-
import {
|
|
9
|
+
import { commandWord, NO_LINE_TO_RUN } from "./command-words.js";
|
|
10
|
+
import { checkPlugin, MAX_CHECKED_FILE_BYTES, readConsoleClasses } from "./plugin-check.js";
|
|
10
11
|
import { LANGUAGE_TAG, nameFromKey, PACKAGE_NAME, writePluginFromTemplate } from "./plugin-init.js";
|
|
11
12
|
|
|
12
13
|
export interface PluginCliIo {
|
|
@@ -18,6 +19,11 @@ export interface PluginCliIo {
|
|
|
18
19
|
readonly version: string | undefined;
|
|
19
20
|
/** Loads a server module in a hardened thread and describes it. */
|
|
20
21
|
loadServer(file: string): Promise<ServerLoad>;
|
|
22
|
+
/**
|
|
23
|
+
* The sources of the console's stylesheet the package ships, `src/styles` beside `dist/`: the
|
|
24
|
+
* catalogue of the parts a plugin's web bundle is held to (ADR-0106). Left out, not held.
|
|
25
|
+
*/
|
|
26
|
+
readonly stylesDir?: string | undefined;
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
/** The exit codes: done; refused or failed; not understood. */
|
|
@@ -46,6 +52,7 @@ export const PLUGIN_USAGE = `console-plugin: writes and checks a plugin of the S
|
|
|
46
52
|
the manifest, package.json (a permissive license, no install scripts, files that ship
|
|
47
53
|
what runs), the server module loaded under the host's hardening and held to the manifest,
|
|
48
54
|
the web bundle self-contained and its classes prefixed, the skills, the migrations.
|
|
55
|
+
A file is read whole, up to ${MAX_CHECKED_FILE_BYTES / (1024 * 1024)} MiB: a larger one is a problem, and is not read.
|
|
49
56
|
Exits 0 with a summary, 1 with every problem found.
|
|
50
57
|
|
|
51
58
|
console-plugin help | --version
|
|
@@ -197,8 +204,11 @@ async function init(args: readonly string[], io: PluginCliIo): Promise<number> {
|
|
|
197
204
|
languages,
|
|
198
205
|
});
|
|
199
206
|
io.stdout(`Wrote the plugin ${key} into ${target}: ${written.length} files.\n`);
|
|
207
|
+
// The folder as bash and PowerShell both take it whole; where it has no such spelling, it is
|
|
208
|
+
// named above, and no line is printed to run.
|
|
209
|
+
const into = commandWord(dir);
|
|
200
210
|
io.stdout(
|
|
201
|
-
`Next: cd ${
|
|
211
|
+
`Next: ${into === undefined ? "go into that folder" : `cd ${into}`}, install the dependencies (npm install), build (npm run build), run the tests (npm test), and check it as a console would (npm run check). The contract is docs/specs/plugins.md in node_modules/@skillcdn/console/.${into === undefined ? ` ${NO_LINE_TO_RUN}` : ""}\n`,
|
|
202
212
|
);
|
|
203
213
|
return PLUGIN_EXIT.ok;
|
|
204
214
|
} catch (error) {
|
|
@@ -227,15 +237,29 @@ async function check(args: readonly string[], io: PluginCliIo): Promise<number>
|
|
|
227
237
|
return PLUGIN_EXIT.usage;
|
|
228
238
|
}
|
|
229
239
|
const root = resolve(io.cwd, dir ?? ".");
|
|
240
|
+
// The catalogue of the parts, read from the package this command is of. A package without
|
|
241
|
+
// it is not this one as it is published: said, and the classes are then not held.
|
|
242
|
+
const classes =
|
|
243
|
+
io.stylesDir === undefined
|
|
244
|
+
? undefined
|
|
245
|
+
: await readConsoleClasses(io.stylesDir).catch(() => null);
|
|
230
246
|
const report = await checkPlugin(root, (file) => io.loadServer(file), {
|
|
231
247
|
consoleVersion: io.version,
|
|
248
|
+
consoleClasses: classes ?? undefined,
|
|
232
249
|
});
|
|
233
250
|
io.stdout(`console-plugin check ${root}\n`);
|
|
251
|
+
const warnings =
|
|
252
|
+
classes === null
|
|
253
|
+
? [
|
|
254
|
+
...report.warnings,
|
|
255
|
+
`the catalogue of the console's parts was not found in ${io.stylesDir}: the web bundle's classes were not held to it`,
|
|
256
|
+
]
|
|
257
|
+
: report.warnings;
|
|
234
258
|
io.stdout(wordsOf(report.errors, "error"));
|
|
235
|
-
io.stdout(wordsOf(
|
|
259
|
+
io.stdout(wordsOf(warnings, "warning"));
|
|
236
260
|
if (report.ok) {
|
|
237
261
|
io.stdout(
|
|
238
|
-
`ok: ${report.summary ?? "a plugin"}${
|
|
262
|
+
`ok: ${report.summary ?? "a plugin"}${warnings.length > 0 ? `; ${warnings.length} warning${warnings.length === 1 ? "" : "s"}` : ""}\n`,
|
|
239
263
|
);
|
|
240
264
|
return PLUGIN_EXIT.ok;
|
|
241
265
|
}
|
package/src/cli/plugin-main.ts
CHANGED
|
@@ -25,6 +25,7 @@ process.exitCode = await runPluginCli(process.argv.slice(2), {
|
|
|
25
25
|
},
|
|
26
26
|
cwd: process.cwd(),
|
|
27
27
|
templateDir: join(packageDir, "template", "plugin"),
|
|
28
|
+
stylesDir: join(packageDir, "src", "styles"),
|
|
28
29
|
version: manifest.success ? manifest.data.version : undefined,
|
|
29
30
|
loadServer: (file) => loadServerModule(file),
|
|
30
31
|
});
|