@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/pack.ts
CHANGED
|
@@ -1,66 +1,71 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
fileResultOf,
|
|
14
|
-
findResultOf,
|
|
15
|
-
joinSkillPages,
|
|
16
|
-
type MountSummary,
|
|
17
|
-
mountSummaryOf,
|
|
2
|
+
type BrowseQuery,
|
|
3
|
+
type CodePage,
|
|
4
|
+
type DataQuery,
|
|
5
|
+
type FileQuery,
|
|
6
|
+
type FindQuery,
|
|
7
|
+
type Pack,
|
|
8
|
+
PackError,
|
|
9
|
+
type RowsPage,
|
|
10
|
+
} from "@skillcdn/cli";
|
|
11
|
+
import {
|
|
12
|
+
isReadmePath,
|
|
18
13
|
parseAddress,
|
|
19
14
|
parseRepoPath,
|
|
20
15
|
parseSkillUri,
|
|
21
16
|
type RestBrowse,
|
|
22
17
|
type RestFile,
|
|
18
|
+
type RestFind,
|
|
23
19
|
type RestMount,
|
|
24
|
-
type RestSkill,
|
|
25
|
-
renderBrowseResult,
|
|
26
|
-
renderDirectoryResult,
|
|
27
|
-
renderFileResult,
|
|
28
|
-
renderFindResult,
|
|
29
|
-
renderInstructions,
|
|
30
|
-
renderSkillResult,
|
|
31
|
-
type SkillResult,
|
|
32
|
-
skillOutcome,
|
|
33
|
-
skillResultOf,
|
|
20
|
+
type RestSkill as RestSkillPage,
|
|
34
21
|
type ToolWords,
|
|
35
22
|
} from "@skillcdn/core";
|
|
36
|
-
import type {
|
|
37
|
-
|
|
38
|
-
RestSkillFile,
|
|
39
|
-
RestSkillFind,
|
|
40
|
-
RestSkillLoad,
|
|
41
|
-
RestSkills,
|
|
42
|
-
} from "../schemas.js";
|
|
23
|
+
import type { PackClient } from "../client.js";
|
|
24
|
+
import type { RestSkills } from "../schemas.js";
|
|
43
25
|
import type { SkillsStatus } from "../vocabulary.js";
|
|
26
|
+
import { commandLine, NO_LINE_TO_RUN } from "./command-words.js";
|
|
44
27
|
|
|
45
|
-
// The pack of the project, as the command prints it (ADR-0028, ADR-0031): the console
|
|
46
|
-
// what the pack's REST API answered, in the shapes of @skillcdn/core, and the command
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
28
|
+
// The pack of the project, as the command prints it (ADR-0028, ADR-0031, ADR-0124): the console
|
|
29
|
+
// answers what the pack's REST API answered, in the shapes of @skillcdn/core, and the command
|
|
30
|
+
// hands those answers, as a pack, to the reads the skillcdn command itself prints with
|
|
31
|
+
// (`readPack` of @skillcdn/cli), naming the reads as its own commands. So an agent reads here
|
|
32
|
+
// what it would read over MCP, or with the skillcdn command, and a change of that command's text
|
|
33
|
+
// comes with its next version. What is here is the console's own: the pack made of the console's
|
|
34
|
+
// answers, the lines around a listing, and the words of a pack the console could not read,
|
|
35
|
+
// which is a project's or the organization's and whose token is the console's to hold.
|
|
50
36
|
|
|
51
|
-
/** How the results name the four reads
|
|
52
|
-
export const
|
|
53
|
-
browse:
|
|
54
|
-
search:
|
|
55
|
-
load:
|
|
56
|
-
read:
|
|
57
|
-
};
|
|
37
|
+
/** How the results name the four reads of a pack read with `skills` and `skill`, so that an agent is told the command and not a tool. */
|
|
38
|
+
export const packWords = (skills: string, skill: string): ToolWords => ({
|
|
39
|
+
browse: `${skills} <folder>`,
|
|
40
|
+
search: `${skills} --search`,
|
|
41
|
+
load: skill,
|
|
42
|
+
read: `${skill} --file`,
|
|
43
|
+
});
|
|
58
44
|
|
|
59
|
-
/**
|
|
60
|
-
export
|
|
45
|
+
/** The words of the project's pack, and the organization's: `console skills` and `console skill`. */
|
|
46
|
+
export const CONSOLE_WORDS: ToolWords = packWords("console skills", "console skill");
|
|
61
47
|
|
|
62
48
|
export const NO_ADDRESS = "No skills address: neither this project nor the console names one.";
|
|
63
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Whose pack a read is of, for the words of a read that did not happen: a project's, or the
|
|
52
|
+
* organization's, which is what a command reads where no project is named (ADR-0113).
|
|
53
|
+
*/
|
|
54
|
+
export type PackOwner = "project" | "organization";
|
|
55
|
+
|
|
56
|
+
const NO_ORGANIZATION_ADDRESS =
|
|
57
|
+
"No skills address: the console names none for the organization's skills, and no project is named here.";
|
|
58
|
+
|
|
59
|
+
const noAddress = (owner: PackOwner): string =>
|
|
60
|
+
owner === "organization" ? NO_ORGANIZATION_ADDRESS : NO_ADDRESS;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* What a read of the organization's pack begins with: whose pack it is, since the command
|
|
64
|
+
* would otherwise read as if a project had been named, and how a project's own is read.
|
|
65
|
+
*/
|
|
66
|
+
export const ORGANIZATION_PACK_LINE =
|
|
67
|
+
"The organization's pack, since no project is named here: --project <key>, or a directory bound with console use <key>, reads a project's own.";
|
|
68
|
+
|
|
64
69
|
/** The words of a read that did not happen, by status, with what to do about it. */
|
|
65
70
|
const SKILLS_WORDS: Readonly<Record<Exclude<SkillsStatus, "none" | "ready">, string>> = {
|
|
66
71
|
indexing: "The pack is still being indexed; ask again in a moment.",
|
|
@@ -73,20 +78,63 @@ const SKILLS_WORDS: Readonly<Record<Exclude<SkillsStatus, "none" | "ready">, str
|
|
|
73
78
|
unavailable: "The pack could not be reached; ask again later.",
|
|
74
79
|
};
|
|
75
80
|
|
|
76
|
-
|
|
81
|
+
/** The same, where the pack is the organization's: the token is the workspace's, an administrator's to set. */
|
|
82
|
+
const ORGANIZATION_WORDS: Readonly<Record<"not_found" | "token_invalid", string>> = {
|
|
83
|
+
not_found:
|
|
84
|
+
"Nothing is served to the console at this address or path: it is not there, or the organization's pack is private and the workspace holds no SkillCDN token for it (console workspace pack-token --connect, for an administrator).",
|
|
85
|
+
token_invalid:
|
|
86
|
+
"The SkillCDN token the workspace holds no longer works at the deployment: an administrator sets a new one (console workspace pack-token --connect).",
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/** What every answer of the console about a pack says first: where it is, and how the read went. */
|
|
90
|
+
export type PackEnvelope = Pick<RestSkills, "address" | "source" | "page" | "status" | "refusal">;
|
|
91
|
+
|
|
92
|
+
/** One answer of the console to a read of a pack: the envelope, and the pack's own answer in it. */
|
|
93
|
+
export type PackAnswer = PackEnvelope & { readonly read: unknown };
|
|
77
94
|
|
|
78
95
|
/** The first line of an answer about the pack: what was read, where the pack is, and how it went. */
|
|
79
|
-
function head(what: string, answer:
|
|
96
|
+
function head(what: string, answer: PackEnvelope): string {
|
|
80
97
|
const where =
|
|
81
98
|
answer.source === null ? "read from the console's machine" : `served by ${answer.source}`;
|
|
82
99
|
return `${what} at ${answer.address}, ${where}: ${answer.status}`;
|
|
83
100
|
}
|
|
84
101
|
|
|
85
|
-
/**
|
|
86
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Whether a refusal is the pack's answer to one read: a path with nothing at it, a read asked
|
|
104
|
+
* wrong, a file it will not carry, in the pack's own code and words. The pack answered, so no
|
|
105
|
+
* token is what is missing, and saying so would send an agent to mend a pack that is served.
|
|
106
|
+
* Every other refusal is of the pack as a whole: nothing is served to the console at the
|
|
107
|
+
* address, the token is no good there, the index is not there to read, or it was not reached.
|
|
108
|
+
*/
|
|
109
|
+
const ofOneRead = (answer: PackEnvelope): boolean =>
|
|
110
|
+
answer.refusal !== null &&
|
|
111
|
+
(answer.status === "not_found" || answer.status === "failed") &&
|
|
112
|
+
!/^(mount|auth|index)\./.test(answer.refusal.code);
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* A read the console could not make, of the pack as a whole, as the command says it on standard
|
|
116
|
+
* error: that no address is named; or where the pack is and how it stands, the words of that
|
|
117
|
+
* standing with whose token is missing, and the pack's own refusal when it gave one. `what` is
|
|
118
|
+
* the read in a word: `skills`, `folder`, `search`, `skill`, `file`, `tables`, `code blocks`.
|
|
119
|
+
*/
|
|
120
|
+
export function refusalWords(
|
|
121
|
+
what: string,
|
|
122
|
+
answer: PackEnvelope,
|
|
123
|
+
owner: PackOwner = "project",
|
|
124
|
+
): string {
|
|
125
|
+
if (answer.status === "none" || answer.address === null) {
|
|
126
|
+
return noAddress(owner);
|
|
127
|
+
}
|
|
87
128
|
const lines = [head(what, answer)];
|
|
88
|
-
if (answer.status
|
|
89
|
-
lines.push(
|
|
129
|
+
if (answer.status === "ready") {
|
|
130
|
+
lines.push("Nothing was read.");
|
|
131
|
+
} else {
|
|
132
|
+
lines.push(
|
|
133
|
+
owner === "organization" &&
|
|
134
|
+
(answer.status === "not_found" || answer.status === "token_invalid")
|
|
135
|
+
? ORGANIZATION_WORDS[answer.status]
|
|
136
|
+
: SKILLS_WORDS[answer.status],
|
|
137
|
+
);
|
|
90
138
|
}
|
|
91
139
|
if (answer.refusal !== null) {
|
|
92
140
|
lines.push(answer.refusal.message);
|
|
@@ -94,97 +142,269 @@ function refused(what: string, answer: Envelope): string {
|
|
|
94
142
|
return lines.join("\n");
|
|
95
143
|
}
|
|
96
144
|
|
|
97
|
-
/**
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
145
|
+
/**
|
|
146
|
+
* A read of the pack as a whole that the console could not make: thrown by the pack made of the
|
|
147
|
+
* console's answers, for the command to say in the console's words ({@link refusalWords}). A
|
|
148
|
+
* refusal of one read, in the pack's own code and words, is a `PackError` instead, as the
|
|
149
|
+
* skillcdn command's own pack throws one.
|
|
150
|
+
*/
|
|
151
|
+
export class PackRefusal extends Error {
|
|
152
|
+
/** The read in a word, as the first line of the refusal names it. */
|
|
153
|
+
readonly what: string;
|
|
154
|
+
/** What the console answered. */
|
|
155
|
+
readonly answer: PackAnswer;
|
|
101
156
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
157
|
+
constructor(what: string, answer: PackAnswer) {
|
|
158
|
+
super(`${what}: ${answer.status}`);
|
|
159
|
+
this.name = "PackRefusal";
|
|
160
|
+
this.what = what;
|
|
161
|
+
this.answer = answer;
|
|
106
162
|
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
type Ready<T> = Extract<T, { readonly status: "ready" }>;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Every skill and document the address serves, as a search without words answers them, made
|
|
169
|
+
* from what the pack says of itself in the one answer the console already has (ADR-0118, point
|
|
170
|
+
* 5): the console's API takes no search without words, and a listing asked page by page through
|
|
171
|
+
* a console that may be far would be several requests for the answer one gives. A folder's
|
|
172
|
+
* README is marked as its overview by the rule @skillcdn/core exports.
|
|
173
|
+
*/
|
|
174
|
+
function listingOf(mount: RestMount): Ready<RestFind> {
|
|
107
175
|
const { index } = mount;
|
|
108
|
-
|
|
176
|
+
if (index.status !== "ready") {
|
|
177
|
+
throw new PackError(503, `index.${index.status}`, "The pack is not ready to read.");
|
|
178
|
+
}
|
|
179
|
+
const items: Ready<RestFind>["items"] = [];
|
|
109
180
|
for (const skill of index.skills) {
|
|
110
|
-
const directory = parseRepoPath(skill.directory);
|
|
111
|
-
if (!directory.ok) {
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
const path = parseRepoPath(
|
|
115
|
-
skill.path ?? (skill.directory === "" ? "SKILL.md" : `${skill.directory}/SKILL.md`),
|
|
116
|
-
);
|
|
117
181
|
items.push({
|
|
118
182
|
kind: "skill",
|
|
119
|
-
|
|
183
|
+
path: skill.path ?? (skill.directory === "" ? "SKILL.md" : `${skill.directory}/SKILL.md`),
|
|
120
184
|
name: skill.name,
|
|
121
|
-
directory: directory
|
|
185
|
+
directory: skill.directory,
|
|
122
186
|
description: skill.description,
|
|
187
|
+
translations: skill.translations,
|
|
123
188
|
files: [],
|
|
124
189
|
moreFiles: 0,
|
|
125
|
-
// For people, and not rendered for a model.
|
|
126
|
-
translations: {},
|
|
127
190
|
});
|
|
128
191
|
}
|
|
129
192
|
for (const document of index.documents) {
|
|
130
193
|
const path = parseRepoPath(document.path);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
194
|
+
items.push({
|
|
195
|
+
kind: "document",
|
|
196
|
+
path: document.path,
|
|
197
|
+
title: document.title,
|
|
198
|
+
summary: document.summary,
|
|
199
|
+
skillDirectory: null,
|
|
200
|
+
...(path.ok && isReadmePath(path.value) ? { overview: true } : {}),
|
|
201
|
+
});
|
|
140
202
|
}
|
|
141
|
-
const state = catalogStateOf(mount);
|
|
142
203
|
return {
|
|
143
|
-
|
|
144
|
-
query:
|
|
204
|
+
status: "ready",
|
|
205
|
+
query: null,
|
|
206
|
+
commit: mount.commit,
|
|
145
207
|
items,
|
|
208
|
+
diagnostics: index.diagnostics,
|
|
146
209
|
// The counts stand in the instructions above; without totals here, nothing suggests a cursor.
|
|
147
|
-
totals:
|
|
148
|
-
|
|
210
|
+
totals: null,
|
|
211
|
+
nextCursor: null,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* A document's outline with the reads of its tables and its code blocks named as commands
|
|
217
|
+
* (ADR-0100): where the console said an address of its own for one, the command that reads it,
|
|
218
|
+
* `command` being the one the pack is read with, so that an agent is told what to run. Where the
|
|
219
|
+
* path has no spelling both shells take whole, what to run is said in words, with why.
|
|
220
|
+
*/
|
|
221
|
+
function withDataCommands(read: Ready<RestBrowse>, command: string): Ready<RestBrowse> {
|
|
222
|
+
const outline = read.outline;
|
|
223
|
+
if (outline?.data === undefined) {
|
|
224
|
+
return read;
|
|
225
|
+
}
|
|
226
|
+
const line = (flag: string): string =>
|
|
227
|
+
commandLine(command, [flag, outline.path]) ??
|
|
228
|
+
`${command} ${flag} with this file's path, quoted for your shell. ${NO_LINE_TO_RUN}`;
|
|
229
|
+
return {
|
|
230
|
+
...read,
|
|
231
|
+
outline: {
|
|
232
|
+
...outline,
|
|
233
|
+
data: {
|
|
234
|
+
...(outline.data.rows === undefined ? {} : { rows: line("--rows") }),
|
|
235
|
+
...(outline.data.code === undefined ? {} : { code: line("--code") }),
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* How many pages of a skill, of tables or of code blocks one command follows before it stops:
|
|
243
|
+
* far above what a pack holds, and the end of a read that would otherwise go round a console
|
|
244
|
+
* that names the same cursor again.
|
|
245
|
+
*/
|
|
246
|
+
const MAX_PAGES = 64;
|
|
247
|
+
|
|
248
|
+
/** A pack made of the console's answers, which says what the console answered last. */
|
|
249
|
+
export interface ConsolePack extends Pack {
|
|
250
|
+
/** The console's answer to the last read made of the pack: what `--json` prints around the pack's own answer, and what a refusal is said from. */
|
|
251
|
+
answered(): PackAnswer | undefined;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* The pack `reader` reads, as the reads of the skillcdn command take one (ADR-0124): each read
|
|
256
|
+
* asked of the console, and the pack's own answer taken out of the console's. `listing` is the
|
|
257
|
+
* console's answer about the pack as a whole, which the command asks first; nothing is made of
|
|
258
|
+
* one that does not answer a pack, and the command says that as it stands. `url` is the console's
|
|
259
|
+
* origin, where a pack with no deployment of its own is read. With `dataCommand`, the outline of
|
|
260
|
+
* a document names the commands that read its tables and its code blocks, `dataCommand` being
|
|
261
|
+
* the one the pack is read with; without it, the console's addresses stay, as `--json` has them.
|
|
262
|
+
*/
|
|
263
|
+
export function consolePack(
|
|
264
|
+
reader: PackClient,
|
|
265
|
+
listing: RestSkills,
|
|
266
|
+
options: { readonly url: string; readonly dataCommand?: string | undefined },
|
|
267
|
+
): ConsolePack | undefined {
|
|
268
|
+
const { mount } = listing;
|
|
269
|
+
const address = listing.address === null ? undefined : parseAddress(listing.address);
|
|
270
|
+
if (listing.status !== "ready" || mount === null || address === undefined || !address.ok) {
|
|
271
|
+
return undefined;
|
|
272
|
+
}
|
|
273
|
+
let last: PackAnswer | undefined;
|
|
274
|
+
let pages = 0;
|
|
275
|
+
/** One more page of a read the command joins, within what one command follows. */
|
|
276
|
+
const another = (what: string, path: string | undefined): void => {
|
|
277
|
+
pages += 1;
|
|
278
|
+
if (pages > MAX_PAGES) {
|
|
279
|
+
throw new PackError(
|
|
280
|
+
0,
|
|
281
|
+
"invalid_response",
|
|
282
|
+
`The ${what} under ${path ?? "the pack"} are more than the command reads at once (${MAX_PAGES} pages): name a folder or a file under it.`,
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
/** The pack's own answer in the console's: a refusal of the one read as the pack's, any other as the console's. */
|
|
287
|
+
const taken = <R>(what: string, answer: PackEnvelope & { readonly read: R | null }): R => {
|
|
288
|
+
last = answer;
|
|
289
|
+
if (answer.status === "ready" && answer.read !== null) {
|
|
290
|
+
return answer.read;
|
|
291
|
+
}
|
|
292
|
+
if (answer.refusal !== null && ofOneRead(answer)) {
|
|
293
|
+
throw new PackError(
|
|
294
|
+
answer.status === "failed" ? 415 : 404,
|
|
295
|
+
answer.refusal.code,
|
|
296
|
+
answer.refusal.message,
|
|
297
|
+
{
|
|
298
|
+
directories: answer.refusal.directories,
|
|
299
|
+
sourceUrl: answer.refusal.sourceUrl ?? undefined,
|
|
300
|
+
},
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
throw new PackRefusal(what, answer);
|
|
304
|
+
};
|
|
305
|
+
/** The same, of a read the pack answers with its own standing: ready, or the console says how it stands. */
|
|
306
|
+
const ready = <R extends { readonly status: string }>(
|
|
307
|
+
what: string,
|
|
308
|
+
answer: PackEnvelope & { readonly read: R | null },
|
|
309
|
+
): Ready<R> => {
|
|
310
|
+
const read = taken(what, answer);
|
|
311
|
+
if (read.status !== "ready") {
|
|
312
|
+
throw new PackRefusal(what, answer);
|
|
313
|
+
}
|
|
314
|
+
return read as Ready<R>;
|
|
315
|
+
};
|
|
316
|
+
return {
|
|
317
|
+
address: address.value,
|
|
318
|
+
source: { kind: "deployment", url: listing.source ?? options.url },
|
|
319
|
+
answered: () => last,
|
|
320
|
+
mount: async () => mount,
|
|
321
|
+
browse: async (query: BrowseQuery): Promise<RestBrowse> => {
|
|
322
|
+
const read = ready("folder", await reader.skillBrowse(query));
|
|
323
|
+
return options.dataCommand === undefined ? read : withDataCommands(read, options.dataCommand);
|
|
324
|
+
},
|
|
325
|
+
find: async (query: FindQuery): Promise<RestFind> =>
|
|
326
|
+
query.query === undefined
|
|
327
|
+
? listingOf(mount)
|
|
328
|
+
: ready(
|
|
329
|
+
"search",
|
|
330
|
+
await reader.skillFind(query.query, {
|
|
331
|
+
path: query.path,
|
|
332
|
+
cursor: query.cursor,
|
|
333
|
+
limit: query.limit,
|
|
334
|
+
}),
|
|
335
|
+
),
|
|
336
|
+
skill: async (path: string, cursor?: string): Promise<RestSkillPage> => {
|
|
337
|
+
pages += 1;
|
|
338
|
+
if (pages > MAX_PAGES) {
|
|
339
|
+
throw new PackError(
|
|
340
|
+
0,
|
|
341
|
+
"invalid_response",
|
|
342
|
+
"The pack answers more pages of a skill than one read takes.",
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
return ready("skill", await reader.skill(path, cursor));
|
|
346
|
+
},
|
|
347
|
+
file: async (query: FileQuery): Promise<RestFile> =>
|
|
348
|
+
taken(
|
|
349
|
+
"file",
|
|
350
|
+
await reader.skillFile(query.path, { offset: query.offset, limit: query.limit }),
|
|
351
|
+
),
|
|
352
|
+
rows: async (query: DataQuery): Promise<RowsPage> => {
|
|
353
|
+
another("tables", query.path);
|
|
354
|
+
return ready("tables", await reader.skillRows(query));
|
|
355
|
+
},
|
|
356
|
+
code: async (query: DataQuery): Promise<CodePage> => {
|
|
357
|
+
another("code blocks", query.path);
|
|
358
|
+
return ready("code blocks", await reader.skillCode(query));
|
|
359
|
+
},
|
|
149
360
|
};
|
|
150
361
|
}
|
|
151
362
|
|
|
152
363
|
/**
|
|
153
|
-
* The
|
|
154
|
-
*
|
|
155
|
-
*
|
|
364
|
+
* The listing of a pack as the command prints it. Where the pack answered, `text` is what the
|
|
365
|
+
* skillcdn command prints for it, what a client is told on connect and then every skill and
|
|
366
|
+
* document, between the lines of the console's own: where the pack is and how it answered,
|
|
367
|
+
* where a person connects an agent of their own, and where the console's own skills are on this
|
|
368
|
+
* machine. Where it did not, why, with that last line still.
|
|
156
369
|
*/
|
|
157
|
-
export function formatSkills(
|
|
370
|
+
export function formatSkills(
|
|
371
|
+
skills: RestSkills,
|
|
372
|
+
text: string | undefined,
|
|
373
|
+
ownSkills?: string,
|
|
374
|
+
owner: PackOwner = "project",
|
|
375
|
+
words: ToolWords = CONSOLE_WORDS,
|
|
376
|
+
): string {
|
|
158
377
|
const own =
|
|
159
378
|
ownSkills === undefined
|
|
160
379
|
? []
|
|
161
|
-
: ["", `The console's own skills, for working the board: ${ownSkills}`];
|
|
162
|
-
if (
|
|
163
|
-
return [
|
|
164
|
-
}
|
|
165
|
-
const summary = summaryOf(skills);
|
|
166
|
-
if (skills.status !== "ready" || skills.mount === null || summary === undefined) {
|
|
167
|
-
return [refused("skills", skills), ...own].join("\n");
|
|
168
|
-
}
|
|
169
|
-
const lines = [
|
|
170
|
-
head("skills", skills),
|
|
171
|
-
"",
|
|
172
|
-
renderInstructions(catalogStateOf(skills.mount), CONSOLE_WORDS),
|
|
173
|
-
];
|
|
174
|
-
const listing = listingOf(skills.mount, summary);
|
|
175
|
-
if (listing !== undefined) {
|
|
176
|
-
lines.push("", renderFindResult(listing, CONSOLE_WORDS));
|
|
380
|
+
: ["", `The console's own skills, for working the board and keeping a desk: ${ownSkills}`];
|
|
381
|
+
if (text === undefined || skills.status !== "ready") {
|
|
382
|
+
return [refusalWords("skills", skills, owner), ...own].join("\n");
|
|
177
383
|
}
|
|
384
|
+
const lines = [head("skills", skills), "", text];
|
|
178
385
|
if (skills.page !== null) {
|
|
179
386
|
lines.push(
|
|
180
387
|
"",
|
|
181
|
-
`A host with a SkillCDN connection of its own loads a skill by its URI, which a person makes at ${skills.page}; through the console, ${
|
|
388
|
+
`A host with a SkillCDN connection of its own loads a skill by its URI, which a person makes at ${skills.page}; through the console, ${words.load} takes the URI too. --json adds the page of each skill, for a person.`,
|
|
182
389
|
);
|
|
183
390
|
}
|
|
184
391
|
lines.push(...own);
|
|
185
392
|
return lines.join("\n");
|
|
186
393
|
}
|
|
187
394
|
|
|
395
|
+
/**
|
|
396
|
+
* The `SKILL.md` a path names: the path itself where it names one, else the one in the folder
|
|
397
|
+
* it names, since a skill is its folder and a listing cut short shows the folder alone; the
|
|
398
|
+
* root's own for the dot, as the root is everywhere.
|
|
399
|
+
*/
|
|
400
|
+
function skillFileOf(given: string): string {
|
|
401
|
+
const path = given.replace(/\/+$/, "");
|
|
402
|
+
if (path === "" || path === ".") {
|
|
403
|
+
return "SKILL.md";
|
|
404
|
+
}
|
|
405
|
+
return path === "SKILL.md" || path.endsWith("/SKILL.md") ? path : `${path}/SKILL.md`;
|
|
406
|
+
}
|
|
407
|
+
|
|
188
408
|
/**
|
|
189
409
|
* A skill's path as given, or taken out of the URI the listing names it by
|
|
190
410
|
* (`skill://<host>/<owner>/<name>/<path>`); a URI of another pack would read this pack's skill
|
|
@@ -200,7 +420,7 @@ export function skillPathIn(
|
|
|
200
420
|
? {
|
|
201
421
|
error: `Not a skill's URI the console knows: ${given}. Say the path of its SKILL.md from the repository's root, or the URI console skills lists.`,
|
|
202
422
|
}
|
|
203
|
-
: { path: given };
|
|
423
|
+
: { path: skillFileOf(given) };
|
|
204
424
|
}
|
|
205
425
|
const pack = packAddress === null ? undefined : parseAddress(packAddress);
|
|
206
426
|
if (
|
|
@@ -216,157 +436,6 @@ export function skillPathIn(
|
|
|
216
436
|
return { path: uri.path };
|
|
217
437
|
}
|
|
218
438
|
|
|
219
|
-
/**
|
|
220
|
-
export
|
|
221
|
-
|
|
222
|
-
summary: PackSummary,
|
|
223
|
-
): SkillResult | undefined {
|
|
224
|
-
return joinSkillPages(
|
|
225
|
-
pages.flatMap((page) =>
|
|
226
|
-
page.read?.status === "ready" ? (skillResultOf(page.read, summary) ?? []) : [],
|
|
227
|
-
),
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/** The skill whole, as the REST API answers one, for `--json`. */
|
|
232
|
-
export function bodyOfSkill(skill: SkillResult): RestSkill {
|
|
233
|
-
const outcome = skillOutcome({ status: "ready", lookup: { kind: "found", skill } });
|
|
234
|
-
if ("failure" in outcome) {
|
|
235
|
-
throw new Error("a skill that was found has a body");
|
|
236
|
-
}
|
|
237
|
-
return outcome.body;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/** One skill as `load_skill` lays it out for a model: the rules, the body, the included files, its files and references. */
|
|
241
|
-
export function formatSkillLoad(loaded: RestSkillLoad, whole: SkillResult | undefined): string {
|
|
242
|
-
if (loaded.status === "none" || loaded.address === null) {
|
|
243
|
-
return NO_ADDRESS;
|
|
244
|
-
}
|
|
245
|
-
if (loaded.status !== "ready") {
|
|
246
|
-
return refused("skill", loaded);
|
|
247
|
-
}
|
|
248
|
-
if (whole === undefined) {
|
|
249
|
-
return `${head("skill", loaded)}\nNothing was read.`;
|
|
250
|
-
}
|
|
251
|
-
return renderSkillResult(whole, CONSOLE_WORDS);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/** The pages of a folder, as the console answered them, as the one listing they were cut from. */
|
|
255
|
-
export function joinFolder(
|
|
256
|
-
pages: readonly RestSkillBrowse[],
|
|
257
|
-
summary: PackSummary,
|
|
258
|
-
): BrowseResult | undefined {
|
|
259
|
-
const results = pages.flatMap((page) =>
|
|
260
|
-
page.read?.status === "ready" ? (browseResultOf(page.read, summary) ?? []) : [],
|
|
261
|
-
);
|
|
262
|
-
const first = results[0];
|
|
263
|
-
const last = results[results.length - 1];
|
|
264
|
-
if (first === undefined || last === undefined) {
|
|
265
|
-
return undefined;
|
|
266
|
-
}
|
|
267
|
-
// A file's path answers its outline (SkillCDN 0.4), its headings paged as a folder's entries are.
|
|
268
|
-
const outline =
|
|
269
|
-
first.outline === undefined
|
|
270
|
-
? undefined
|
|
271
|
-
: {
|
|
272
|
-
...first.outline,
|
|
273
|
-
headings: results.flatMap((result) => result.outline?.headings ?? []),
|
|
274
|
-
};
|
|
275
|
-
return {
|
|
276
|
-
...first,
|
|
277
|
-
mount: last.mount,
|
|
278
|
-
entries: results.flatMap((result) => result.entries),
|
|
279
|
-
nextCursor: last.nextCursor,
|
|
280
|
-
...(outline === undefined ? {} : { outline }),
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/** A folder whole, as the REST API answers one page, for `--json`. */
|
|
285
|
-
export const bodyOfFolder = (result: BrowseResult): RestBrowse =>
|
|
286
|
-
browseBody({ status: "ready", result });
|
|
287
|
-
|
|
288
|
-
/** What a folder holds, as `browse_repo` lays it out for a model. */
|
|
289
|
-
export function formatSkillBrowse(
|
|
290
|
-
browsed: RestSkillBrowse,
|
|
291
|
-
whole: BrowseResult | undefined,
|
|
292
|
-
): string {
|
|
293
|
-
if (browsed.status === "none" || browsed.address === null) {
|
|
294
|
-
return NO_ADDRESS;
|
|
295
|
-
}
|
|
296
|
-
if (browsed.status !== "ready") {
|
|
297
|
-
return refused("folder", browsed);
|
|
298
|
-
}
|
|
299
|
-
if (whole === undefined) {
|
|
300
|
-
return `${head("folder", browsed)}\nNothing was read.`;
|
|
301
|
-
}
|
|
302
|
-
return renderBrowseResult(whole, CONSOLE_WORDS);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
/** What words found, as `search_repo` lays it out for a model, one page of it. */
|
|
306
|
-
export function formatSkillFind(found: RestSkillFind, summary: PackSummary | undefined): string {
|
|
307
|
-
if (found.status === "none" || found.address === null) {
|
|
308
|
-
return NO_ADDRESS;
|
|
309
|
-
}
|
|
310
|
-
if (found.status !== "ready" || found.read?.status !== "ready" || summary === undefined) {
|
|
311
|
-
return refused("search", found);
|
|
312
|
-
}
|
|
313
|
-
return renderFindResult(findResultOf(found.read, summary), CONSOLE_WORDS);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* The pages of a file, as the console answered them, as the file whole; or the folder the path
|
|
318
|
-
* named. With `requested`, the one page is a section read as asked (`--offset`, `--limit`): the
|
|
319
|
-
* result carries the length asked for, so that the renderer says where the file continues rather
|
|
320
|
-
* than asking for the rest.
|
|
321
|
-
*/
|
|
322
|
-
export function joinFile(
|
|
323
|
-
pages: readonly RestSkillFile[],
|
|
324
|
-
summary: PackSummary,
|
|
325
|
-
requested?: number,
|
|
326
|
-
): FileResult | DirectoryResult | undefined {
|
|
327
|
-
const reads = pages.flatMap((page) => (page.read === null ? [] : [page.read]));
|
|
328
|
-
const first = reads[0];
|
|
329
|
-
if (first === undefined) {
|
|
330
|
-
return undefined;
|
|
331
|
-
}
|
|
332
|
-
if (first.kind === "directory") {
|
|
333
|
-
return directoryResultOf(first, summary);
|
|
334
|
-
}
|
|
335
|
-
const files = reads.flatMap((read) =>
|
|
336
|
-
read.kind === "file" ? (fileResultOf(read, summary) ?? []) : [],
|
|
337
|
-
);
|
|
338
|
-
const opening = files[0];
|
|
339
|
-
const closing = files[files.length - 1];
|
|
340
|
-
if (opening === undefined || closing === undefined) {
|
|
341
|
-
return undefined;
|
|
342
|
-
}
|
|
343
|
-
return {
|
|
344
|
-
...opening,
|
|
345
|
-
mount: closing.mount,
|
|
346
|
-
content: files.map((file) => file.content).join(""),
|
|
347
|
-
nextOffset: closing.nextOffset,
|
|
348
|
-
totalLength: closing.totalLength,
|
|
349
|
-
...(requested === undefined ? {} : { requestedLength: requested }),
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/** A file whole, or a folder, as the REST API answers it, for `--json`. */
|
|
354
|
-
export const bodyOfFile = (result: FileResult | DirectoryResult): RestFile =>
|
|
355
|
-
"entries" in result ? directoryBody(result) : fileBody(result);
|
|
356
|
-
|
|
357
|
-
/** A file as `read_repo_file` lays it out for a model, whole; or what the folder holds. */
|
|
358
|
-
export function formatSkillFile(
|
|
359
|
-
read: RestSkillFile,
|
|
360
|
-
whole: FileResult | DirectoryResult | undefined,
|
|
361
|
-
): string {
|
|
362
|
-
if (read.status === "none" || read.address === null) {
|
|
363
|
-
return NO_ADDRESS;
|
|
364
|
-
}
|
|
365
|
-
if (read.status !== "ready") {
|
|
366
|
-
return refused("file", read);
|
|
367
|
-
}
|
|
368
|
-
if (whole === undefined) {
|
|
369
|
-
return `${head("file", read)}\nNothing was read.`;
|
|
370
|
-
}
|
|
371
|
-
return "entries" in whole ? renderDirectoryResult(whole) : renderFileResult(whole, CONSOLE_WORDS);
|
|
372
|
-
}
|
|
439
|
+
/** Whether a read of data held nothing, by what the read says it holds: no table, or no code block. */
|
|
440
|
+
export const holdsNothing = (holds: string | undefined): boolean =>
|
|
441
|
+
holds !== undefined && /(^| )0 (tables|code blocks)$/.test(holds);
|