@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
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
// A secret is taken out of an event before it leaves the machine (ADR-0086, point 5): every
|
|
2
|
+
// value of the account's store, as it is and in the encodings a value is commonly carried in,
|
|
3
|
+
// whether the runner handed it to the session or the agent read it itself. The forms are those
|
|
4
|
+
// the console takes out of a plugin's answers (ADR-0079): spelled as JSON, a URL's part or a
|
|
5
|
+
// form spell it, and in base64, whole or inside a longer run of it.
|
|
6
|
+
/** What stands in an event where a secret was. */
|
|
7
|
+
export const WITHHELD = "[withheld]";
|
|
8
|
+
/** The fewest characters a value is looked for by: a shorter one is in any text by chance. */
|
|
9
|
+
const MIN_LENGTH = 4;
|
|
10
|
+
/** The fewest bytes a value is looked for in base64 by: a shorter one's letters turn up in any base64 by chance. */
|
|
11
|
+
const MIN_BASE64_BYTES = 8;
|
|
12
|
+
/** A percent-encoding with its hex digits small, as some spell it. */
|
|
13
|
+
const smallHex = (encoded) => encoded.replace(/%[0-9A-F]{2}/g, (sequence) => sequence.toLowerCase());
|
|
14
|
+
/** Base64 in the alphabet of a URL. */
|
|
15
|
+
const urlAlphabet = (base64) => base64.replaceAll("+", "-").replaceAll("/", "_");
|
|
16
|
+
/** A value as a query or a form encodes it. */
|
|
17
|
+
const formEncoded = (text) => new URLSearchParams([["", text]]).toString().slice(1);
|
|
18
|
+
/** A value as JSON spells it between its quotes. */
|
|
19
|
+
const jsonEscaped = (text) => JSON.stringify(text).slice(1, -1);
|
|
20
|
+
function spelledForms(text) {
|
|
21
|
+
const part = encodeURIComponent(text.toWellFormed());
|
|
22
|
+
const query = formEncoded(text);
|
|
23
|
+
return [text, jsonEscaped(text), part, query, smallHex(part), smallHex(query)];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A value in base64, in a header's alphabet and in a URL's: whole, padded or not, and inside a
|
|
27
|
+
* longer run of base64 at each of the three places its first byte may fall, without the letters
|
|
28
|
+
* it shares with what is around it.
|
|
29
|
+
*/
|
|
30
|
+
function base64Forms(text) {
|
|
31
|
+
const bytes = Buffer.from(text.toWellFormed(), "utf8");
|
|
32
|
+
if (bytes.byteLength < MIN_BASE64_BYTES) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
const whole = bytes.toString("base64");
|
|
36
|
+
const forms = [whole, whole.replace(/=+$/, ""), bytes.toString("base64url")];
|
|
37
|
+
for (const offset of [0, 1, 2]) {
|
|
38
|
+
const shifted = Buffer.concat([Buffer.alloc(offset), bytes]).toString("base64");
|
|
39
|
+
const inside = shifted.slice(Math.ceil((offset * 8) / 6), Math.floor(((offset + bytes.byteLength) * 8) / 6));
|
|
40
|
+
forms.push(inside, urlAlphabet(inside));
|
|
41
|
+
}
|
|
42
|
+
return forms;
|
|
43
|
+
}
|
|
44
|
+
/** What a driver ends a text with that it cut: a tool's input is shown to a length, and no further. */
|
|
45
|
+
const CUT_MARK = "\u2026";
|
|
46
|
+
/** For each place in a form, how long the longest beginning of the form is that also ends there. */
|
|
47
|
+
function bordersOf(form) {
|
|
48
|
+
const borders = new Int32Array(form.length);
|
|
49
|
+
let matched = 0;
|
|
50
|
+
for (let at = 1; at < form.length; at += 1) {
|
|
51
|
+
while (matched > 0 && form[at] !== form[matched]) {
|
|
52
|
+
matched = borders[matched - 1] ?? 0;
|
|
53
|
+
}
|
|
54
|
+
if (form[at] === form[matched]) {
|
|
55
|
+
matched += 1;
|
|
56
|
+
}
|
|
57
|
+
borders[at] = matched;
|
|
58
|
+
}
|
|
59
|
+
return borders;
|
|
60
|
+
}
|
|
61
|
+
/** How many characters at the end of a text are the beginning of a form, the whole form never among them. */
|
|
62
|
+
function beginningAtEnd(text, form, borders) {
|
|
63
|
+
const tail = text.slice(-(form.length - 1));
|
|
64
|
+
let matched = 0;
|
|
65
|
+
for (let at = 0; at < tail.length; at += 1) {
|
|
66
|
+
while (matched > 0 && (matched === form.length || tail[at] !== form[matched])) {
|
|
67
|
+
matched = borders[matched - 1] ?? 0;
|
|
68
|
+
}
|
|
69
|
+
if (tail[at] === form[matched]) {
|
|
70
|
+
matched += 1;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return matched;
|
|
74
|
+
}
|
|
75
|
+
/** The forms one value may be in, the longest first, so that a shorter form never tears a longer one. */
|
|
76
|
+
export function formsOf(value) {
|
|
77
|
+
if (value.length < MIN_LENGTH) {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
const forms = [...spelledForms(value), ...base64Forms(value)];
|
|
81
|
+
const escaped = forms.flatMap((form) => form.includes("/") ? [form, form.replaceAll("/", "\\/")] : [form]);
|
|
82
|
+
return [...new Set(escaped)].filter((form) => form.length >= MIN_LENGTH);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* What takes the values out of a text: each form of each value replaced by `[withheld]`. A value
|
|
86
|
+
* of several lines is looked for whole and a line at a time, since a tool prints a key a line at
|
|
87
|
+
* a time. A text cut by anything else than `cutShown` may end inside a value: the beginning of
|
|
88
|
+
* one that it ends in, of four characters or more, is taken out as well. With no value to look
|
|
89
|
+
* for, the text comes through as it is.
|
|
90
|
+
*/
|
|
91
|
+
export function redactorOf(values) {
|
|
92
|
+
const forms = new Set();
|
|
93
|
+
for (const value of values) {
|
|
94
|
+
const whole = value.trim();
|
|
95
|
+
for (const form of formsOf(whole)) {
|
|
96
|
+
forms.add(form);
|
|
97
|
+
}
|
|
98
|
+
const lines = whole.split(/\r?\n/).map((line) => line.trim());
|
|
99
|
+
if (lines.length > 1) {
|
|
100
|
+
// The lines of a key that say nothing of it, its first and its last, stay.
|
|
101
|
+
for (const line of lines) {
|
|
102
|
+
if (line.length >= 16 && !/^-{3,}.*-{3,}$/.test(line)) {
|
|
103
|
+
for (const form of formsOf(line)) {
|
|
104
|
+
forms.add(form);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const ordered = [...forms].sort((a, b) => b.length - a.length);
|
|
111
|
+
if (ordered.length === 0) {
|
|
112
|
+
return Object.assign((text) => text, { longest: 0 });
|
|
113
|
+
}
|
|
114
|
+
const borders = ordered.map(bordersOf);
|
|
115
|
+
const redact = (text) => {
|
|
116
|
+
let out = text;
|
|
117
|
+
for (const form of ordered) {
|
|
118
|
+
if (out.includes(form)) {
|
|
119
|
+
out = out.replaceAll(form, WITHHELD);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (out.endsWith(CUT_MARK)) {
|
|
123
|
+
const body = out.slice(0, -CUT_MARK.length);
|
|
124
|
+
let most = 0;
|
|
125
|
+
ordered.forEach((form, index) => {
|
|
126
|
+
const held = borders[index];
|
|
127
|
+
if (held !== undefined) {
|
|
128
|
+
most = Math.max(most, beginningAtEnd(body, form, held));
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
if (most >= MIN_LENGTH) {
|
|
132
|
+
out = `${body.slice(0, body.length - most)}${WITHHELD}${CUT_MARK}`;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return out;
|
|
136
|
+
};
|
|
137
|
+
return Object.assign(redact, { longest: ordered[0]?.length ?? 0 });
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The most of a text that is looked through for one cut: a text that is values from end to end
|
|
141
|
+
* is cut short of what it could show, and no megabyte is read for a line of four thousand.
|
|
142
|
+
*/
|
|
143
|
+
export const MAX_CUT_WINDOW = 512 * 1024;
|
|
144
|
+
/**
|
|
145
|
+
* A text within `most` characters as a transcript shows it, ended by the mark of a cut where it
|
|
146
|
+
* was longer: the values are taken out first and the text is cut after, so that no part of a
|
|
147
|
+
* value stands at the cut, however short the part and whatever the value's shape. What is
|
|
148
|
+
* looked through is the beginning of the text, as far as the cut and one form beyond it, and
|
|
149
|
+
* further only where taking values out left less than `most` to show: never the whole of a
|
|
150
|
+
* long text. The last characters looked through may be the beginning of a value whose end was
|
|
151
|
+
* not read, so nothing of them is shown; so it is with the end of a text that is itself the
|
|
152
|
+
* beginning of a longer one, kept to a bound by whoever hands it over, which `more` says. A
|
|
153
|
+
* text within `most` that is whole comes through as it is: taking its values out is the caller's.
|
|
154
|
+
*/
|
|
155
|
+
export function cutShown(redact, text, most, more = false) {
|
|
156
|
+
if (text.length <= most && !more) {
|
|
157
|
+
return text;
|
|
158
|
+
}
|
|
159
|
+
const beyond = Math.max(0, redact.longest - 1);
|
|
160
|
+
let window = Math.min(text.length, most + beyond);
|
|
161
|
+
for (;;) {
|
|
162
|
+
const out = redact(text.slice(0, window));
|
|
163
|
+
// Read to its end and whole: nothing follows what was looked through.
|
|
164
|
+
const whole = window >= text.length && !more;
|
|
165
|
+
const safe = whole ? out.length : out.length - beyond;
|
|
166
|
+
if (safe >= most) {
|
|
167
|
+
return whole && out.length <= most ? out : `${out.slice(0, most)}${CUT_MARK}`;
|
|
168
|
+
}
|
|
169
|
+
if (whole) {
|
|
170
|
+
// Within the length once its values are out: shown whole.
|
|
171
|
+
return out;
|
|
172
|
+
}
|
|
173
|
+
if (window >= text.length || window >= MAX_CUT_WINDOW) {
|
|
174
|
+
return `${out.slice(0, Math.max(0, safe))}${CUT_MARK}`;
|
|
175
|
+
}
|
|
176
|
+
window = Math.min(text.length, MAX_CUT_WINDOW, window * 2);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The end of a text within `most` characters as a transcript shows it, begun by the mark of a
|
|
181
|
+
* cut where it was longer: what a process wrote last, which says why it ended. As `cutShown`,
|
|
182
|
+
* from the other side: the values are taken out of the end of the text first, as far back as
|
|
183
|
+
* the cut and one form before it, and the text is cut after, so that no part of a value stands
|
|
184
|
+
* at the cut. The first characters looked through may be the end of a value whose beginning
|
|
185
|
+
* was not read, so nothing of them is shown; so it is with the beginning of a text that is
|
|
186
|
+
* itself the end of a longer one, kept to a bound by whoever hands it over, which `more` says.
|
|
187
|
+
* A text within `most` that is whole comes through as it is: taking its values out is the
|
|
188
|
+
* caller's.
|
|
189
|
+
*/
|
|
190
|
+
export function cutShownEnd(redact, text, most, more = false) {
|
|
191
|
+
if (text.length <= most && !more) {
|
|
192
|
+
return text;
|
|
193
|
+
}
|
|
194
|
+
const beyond = Math.max(0, redact.longest - 1);
|
|
195
|
+
let window = Math.min(text.length, most + beyond);
|
|
196
|
+
for (;;) {
|
|
197
|
+
const out = redact(text.slice(text.length - window));
|
|
198
|
+
// Read from its beginning and whole: nothing comes before what was looked through.
|
|
199
|
+
const whole = window >= text.length && !more;
|
|
200
|
+
const safe = whole ? out.length : out.length - beyond;
|
|
201
|
+
if (safe >= most) {
|
|
202
|
+
return whole && out.length <= most ? out : `${CUT_MARK}${out.slice(out.length - most)}`;
|
|
203
|
+
}
|
|
204
|
+
if (whole) {
|
|
205
|
+
// Within the length once its values are out: shown whole.
|
|
206
|
+
return out;
|
|
207
|
+
}
|
|
208
|
+
if (window >= text.length || window >= MAX_CUT_WINDOW) {
|
|
209
|
+
return `${CUT_MARK}${out.slice(out.length - Math.max(0, safe))}`;
|
|
210
|
+
}
|
|
211
|
+
window = Math.min(text.length, MAX_CUT_WINDOW, window * 2);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=redact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.js","sourceRoot":"","sources":["../../src/runner/redact.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,8FAA8F;AAC9F,+FAA+F;AAC/F,6FAA6F;AAC7F,oEAAoE;AAEpE,kDAAkD;AAClD,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAErC,8FAA8F;AAC9F,MAAM,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G,MAAM,CAAC,CAAC;IAClD,SAAS,CAAC;QACR,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;QACrD,mFAAmF;QACnF,MAAM,KAAK,GAAG,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC;QAC7C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;QACtD,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACjB,OAAO,KAAK,IAAI,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;QAC1F,CAAC;QACD,IAAI,KAAK,EAAE,CAAC;YACV,0DAA0D;YAC1D,OAAO,GAAG,CAAC;QACb,CAAC;QACD,IAAI,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM,IAAI,cAAc,EAAE,CAAC;YACtD,OAAO,GAAG,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;QACnE,CAAC;QACD,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Boundary, Driver, Service, Spawn, WakeSource } from "./types.js";
|
|
2
|
+
/** The modules of one kind, by name. */
|
|
3
|
+
export interface Registry<T> {
|
|
4
|
+
/** Adds a module under its name; a name taken already is an error of whoever registers. */
|
|
5
|
+
register(name: string, module: T): void;
|
|
6
|
+
get(name: string): T | undefined;
|
|
7
|
+
/** The names registered, in order of the alphabet. */
|
|
8
|
+
names(): readonly string[];
|
|
9
|
+
}
|
|
10
|
+
export declare function createRegistry<T>(kind: string): Registry<T>;
|
|
11
|
+
/** What a driver is made with: how it starts its product's process. */
|
|
12
|
+
export interface DriverHost {
|
|
13
|
+
readonly spawn: Spawn;
|
|
14
|
+
/** The desk: where the product is asked what it is, and where it works. */
|
|
15
|
+
readonly cwd: string;
|
|
16
|
+
/** The product's binary, where the desk names another than the driver's own. */
|
|
17
|
+
readonly command?: string | undefined;
|
|
18
|
+
/** The words the product's command is started with, for a driver that has none of its own. */
|
|
19
|
+
readonly args?: readonly string[] | undefined;
|
|
20
|
+
/** The version of the command the runner is, for a driver that says to the product what it is spoken to by. */
|
|
21
|
+
readonly version?: string | undefined;
|
|
22
|
+
/** The ids a driver writes its messages under, where a test wants to know them; random otherwise. */
|
|
23
|
+
readonly uuid?: (() => string) | undefined;
|
|
24
|
+
/** The durations a driver waits, for a test to shorten. */
|
|
25
|
+
readonly timing?: {
|
|
26
|
+
readonly setMs?: number | undefined;
|
|
27
|
+
} | undefined;
|
|
28
|
+
}
|
|
29
|
+
export interface RunnerModules {
|
|
30
|
+
readonly drivers: Registry<(host: DriverHost) => Driver>;
|
|
31
|
+
readonly wakeSources: Registry<WakeSource>;
|
|
32
|
+
readonly services: Registry<Service>;
|
|
33
|
+
readonly boundaries: Registry<Boundary>;
|
|
34
|
+
}
|
|
35
|
+
/** Four empty registries, for whoever fills them: the package's own, or a console of one's own. */
|
|
36
|
+
export declare function createRunnerModules(): RunnerModules;
|
|
37
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/runner/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAA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,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;CACzC;AAED,mGAAmG;AACnG,wBAAgB,mBAAmB,IAAI,aAAa,CAOnD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function createRegistry(kind) {
|
|
2
|
+
const modules = new Map();
|
|
3
|
+
return {
|
|
4
|
+
register(name, module) {
|
|
5
|
+
if (!/^[a-z][a-z0-9-]{0,39}$/.test(name)) {
|
|
6
|
+
throw new Error(`a ${kind} is registered under a name in small letters, digits and hyphens`);
|
|
7
|
+
}
|
|
8
|
+
if (modules.has(name)) {
|
|
9
|
+
throw new Error(`a ${kind} called ${name} is registered already`);
|
|
10
|
+
}
|
|
11
|
+
modules.set(name, module);
|
|
12
|
+
},
|
|
13
|
+
get: (name) => modules.get(name),
|
|
14
|
+
names: () => [...modules.keys()].sort(),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Four empty registries, for whoever fills them: the package's own, or a console of one's own. */
|
|
18
|
+
export function createRunnerModules() {
|
|
19
|
+
return {
|
|
20
|
+
drivers: createRegistry("driver"),
|
|
21
|
+
wakeSources: createRegistry("wake source"),
|
|
22
|
+
services: createRegistry("service"),
|
|
23
|
+
boundaries: createRegistry("boundary"),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/runner/registry.ts"],"names":[],"mappings":"AAeA,MAAM,UAAU,cAAc,CAAI,IAAY;IAC5C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAa,CAAC;IACrC,OAAO;QACL,QAAQ,CAAC,IAAI,EAAE,MAAM;YACnB,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACzC,MAAM,IAAI,KAAK,CACb,KAAK,IAAI,kEAAkE,CAC5E,CAAC;YACJ,CAAC;YACD,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,KAAK,IAAI,WAAW,IAAI,wBAAwB,CAAC,CAAC;YACpE,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC5B,CAAC;QACD,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QAChC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;KACxC,CAAC;AACJ,CAAC;AA0BD,mGAAmG;AACnG,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,OAAO,EAAE,cAAc,CAAC,QAAQ,CAAC;QACjC,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC;QAC1C,QAAQ,EAAE,cAAc,CAAC,SAAS,CAAC;QACnC,UAAU,EAAE,cAAc,CAAC,UAAU,CAAC;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { type ConsoleClient } from "../client.js";
|
|
2
|
+
import type { RunnerConfig } from "./config.js";
|
|
3
|
+
import type { Driver, WakeHost, WakeSource } from "./types.js";
|
|
4
|
+
/** How often the runner says it is there. */
|
|
5
|
+
export declare const HEARTBEAT_MS = 30000;
|
|
6
|
+
/** How often what the product did is sent, while there is something to send. */
|
|
7
|
+
export declare const BATCH_MS = 1000;
|
|
8
|
+
/** How long what arrives by itself waits after the agent could not go on: at first, and at most, twice as long after each try that ends the same way. */
|
|
9
|
+
export declare const COOL_DOWN_MS: number;
|
|
10
|
+
export declare const MAX_COOL_DOWN_MS: number;
|
|
11
|
+
/** How long the runner waits before it asks for its stream of signals again. */
|
|
12
|
+
export declare const RECONNECT_MS = 5000;
|
|
13
|
+
/** What an autosave's commit says: the runner's, and never the agent's own words. */
|
|
14
|
+
export declare const AUTOSAVE_MESSAGE = "Autosave at the end of a session";
|
|
15
|
+
/**
|
|
16
|
+
* How long the runner holds back what the console refused as more than an hour takes
|
|
17
|
+
* (ADR-0132), the events of a session and the wakes of its wake sources: a minute at first,
|
|
18
|
+
* twice as long after each refusal that follows, a quarter of an hour at most.
|
|
19
|
+
*/
|
|
20
|
+
export declare const HOLD_MS = 60000;
|
|
21
|
+
export declare const MAX_HOLD_MS: number;
|
|
22
|
+
/** The longest the runner waits before it starts a wake source again that keeps ending at once. */
|
|
23
|
+
export declare const MAX_SOURCE_PAUSE_MS: number;
|
|
24
|
+
export declare const MAX_OUTBOX_BYTES: number;
|
|
25
|
+
/** The name of the secret an account keeps its git host's token under (ADR-0088): what the autosave's push is handed. */
|
|
26
|
+
export declare const GIT_TOKEN_SECRET = "git.token";
|
|
27
|
+
/** What of the console the runner asks: the account's own routes, on its command's session. */
|
|
28
|
+
export type RunnerClient = Pick<ConsoleClient, "runnerHeartbeat" | "signalStream" | "beginAgentSession" | "sendTranscript" | "uploadTranscriptFile" | "endAgentSession" | "agentSession" | "secrets" | "secret" | "readSignalFile" | "raiseWake">;
|
|
29
|
+
/** What the runner keeps between its own restarts. No secret is in it. */
|
|
30
|
+
export interface RunnerState {
|
|
31
|
+
/**
|
|
32
|
+
* The number of the last signal that is delivered, every one before it too (ADR-0131): the
|
|
33
|
+
* product said it took it, or the record says it was never read or was let go, or the runner
|
|
34
|
+
* acted on it itself. One handed to a product that has not said so is not delivered yet, and
|
|
35
|
+
* is sent again to a runner started after.
|
|
36
|
+
*/
|
|
37
|
+
readonly delivered: number;
|
|
38
|
+
/** The conversation the next session goes on with, where the product resumes one. */
|
|
39
|
+
readonly conversation: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* The driver the conversation was begun under. A conversation is a product's own: a desk whose
|
|
42
|
+
* `runner.json` names another product since begins a new one. Kept by a runner that did not
|
|
43
|
+
* say, it is taken as this driver's.
|
|
44
|
+
*/
|
|
45
|
+
readonly driver?: string | undefined;
|
|
46
|
+
}
|
|
47
|
+
export interface RunnerOptions {
|
|
48
|
+
readonly client: RunnerClient;
|
|
49
|
+
readonly driver: Driver;
|
|
50
|
+
readonly config: RunnerConfig;
|
|
51
|
+
/** The desk: the directory the runner was started in. */
|
|
52
|
+
readonly cwd: string;
|
|
53
|
+
readonly machine: {
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly os: string;
|
|
56
|
+
readonly user: string;
|
|
57
|
+
};
|
|
58
|
+
/** The version of the package the runner runs from. */
|
|
59
|
+
readonly version: string;
|
|
60
|
+
/**
|
|
61
|
+
* The version of that package as it stands on the machine now, read again from where the
|
|
62
|
+
* runner runs from; nothing where it cannot be read. Left out, the runner never ends for an
|
|
63
|
+
* update (ADR-0101).
|
|
64
|
+
*/
|
|
65
|
+
readonly installed?: (() => Promise<string | undefined>) | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The command that installs the console's version of the package where the runner runs from,
|
|
68
|
+
* for an agent whose runner the console refuses as too old; nothing where it cannot be said.
|
|
69
|
+
*/
|
|
70
|
+
readonly updateCommand?: (() => string | undefined) | undefined;
|
|
71
|
+
readonly now: () => number;
|
|
72
|
+
readonly random: () => number;
|
|
73
|
+
/** A moment as a header says it: the hour and the minute in the workspace's zone. */
|
|
74
|
+
readonly time: (iso: string) => string;
|
|
75
|
+
/**
|
|
76
|
+
* Files under the desk's ignored `work/`, written for their owner alone: what a session is
|
|
77
|
+
* handed of the account's store, removed at its end, and what came with a signal, under
|
|
78
|
+
* `inbox/<number>/`, which is the agent's to keep or to remove.
|
|
79
|
+
*/
|
|
80
|
+
readonly files: {
|
|
81
|
+
write(path: string, value: string | Uint8Array): Promise<void>;
|
|
82
|
+
remove(path: string): Promise<void>;
|
|
83
|
+
};
|
|
84
|
+
readonly state: {
|
|
85
|
+
load(): Promise<RunnerState | undefined>;
|
|
86
|
+
save(state: RunnerState): Promise<void>;
|
|
87
|
+
};
|
|
88
|
+
/** A line for whoever reads the runner's own output: ids, numbers and codes, never what a signal or an event says. */
|
|
89
|
+
readonly log: (line: string) => void;
|
|
90
|
+
/**
|
|
91
|
+
* Runs git in the desk to its end and answers how it ended, for the autosave (ADR-0088); left
|
|
92
|
+
* out, the runner saves nothing. It asks nobody at a terminal, and what it prints is not kept.
|
|
93
|
+
* A step that reaches the git host is handed the token the account's store keeps for it,
|
|
94
|
+
* where it keeps one: for that command alone, on no command line and in no file.
|
|
95
|
+
*/
|
|
96
|
+
readonly git?: ((args: readonly string[], handed?: {
|
|
97
|
+
readonly token?: string | undefined;
|
|
98
|
+
}) => Promise<number | null>) | undefined;
|
|
99
|
+
/** The wake sources `runner.json` names beside the console's own, and what they need of the machine. */
|
|
100
|
+
readonly wakes?: {
|
|
101
|
+
readonly sources: readonly WakeSource[];
|
|
102
|
+
readonly fetch: WakeHost["fetch"];
|
|
103
|
+
readonly socket: WakeHost["socket"];
|
|
104
|
+
} | undefined;
|
|
105
|
+
/** The durations, for a test to shorten. */
|
|
106
|
+
readonly timing?: Partial<{
|
|
107
|
+
heartbeatMs: number;
|
|
108
|
+
batchMs: number;
|
|
109
|
+
groupWindowMs: number;
|
|
110
|
+
coolDownMs: number;
|
|
111
|
+
maxCoolDownMs: number;
|
|
112
|
+
reconnectMs: number;
|
|
113
|
+
holdMs: number;
|
|
114
|
+
maxHoldMs: number;
|
|
115
|
+
}>;
|
|
116
|
+
/** The bounds, for a test to lower. */
|
|
117
|
+
readonly bounds?: Partial<{
|
|
118
|
+
outboxBytes: number;
|
|
119
|
+
}>;
|
|
120
|
+
}
|
|
121
|
+
/** How a runner ended: stopped by whoever runs it, or by itself for an update of the command it runs from. */
|
|
122
|
+
export type RunnerEnd = "stopped" | "updated";
|
|
123
|
+
export interface Runner {
|
|
124
|
+
/** Runs until it ends: resolves, with how, when the open session is ended and nothing is left to send. */
|
|
125
|
+
run(): Promise<RunnerEnd>;
|
|
126
|
+
/** Stops the runner: the session open is ended as exited. */
|
|
127
|
+
stop(): void;
|
|
128
|
+
}
|
|
129
|
+
export declare function createRunner(options: RunnerOptions): Runner;
|
|
130
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/runner/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAe5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAUhD,OAAO,KAAK,EACV,MAAM,EAMN,QAAQ,EACR,UAAU,EACX,MAAM,YAAY,CAAC;AAcpB,6CAA6C;AAC7C,eAAO,MAAM,YAAY,QAAS,CAAC;AACnC,gFAAgF;AAChF,eAAO,MAAM,QAAQ,OAAO,CAAC;AAC7B,yJAAyJ;AACzJ,eAAO,MAAM,YAAY,QAAc,CAAC;AACxC,eAAO,MAAM,gBAAgB,QAAkB,CAAC;AAChD,gFAAgF;AAChF,eAAO,MAAM,YAAY,OAAO,CAAC;AACjC,qFAAqF;AACrF,eAAO,MAAM,gBAAgB,qCAAqC,CAAC;AACnE;;;;GAIG;AACH,eAAO,MAAM,OAAO,QAAS,CAAC;AAC9B,eAAO,MAAM,WAAW,QAAc,CAAC;AACvC,mGAAmG;AACnG,eAAO,MAAM,mBAAmB,QAAa,CAAC;AAiB9C,eAAO,MAAM,gBAAgB,QAAmB,CAAC;AAOjD,yHAAyH;AACzH,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAE5C,+FAA+F;AAC/F,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,aAAa,EACX,iBAAiB,GACjB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,sBAAsB,GACtB,iBAAiB,GACjB,cAAc,GACd,SAAS,GACT,QAAQ,GACR,gBAAgB,GAChB,WAAW,CACd,CAAC;AAEF,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B;;;;;OAKG;IACH,QAAQ,CA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