@skillcdn/console 0.5.0 → 0.5.2
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 +87 -12
- package/SKILLCDN.md +3 -3
- package/dist/agent-page.d.ts.map +1 -1
- package/dist/agent-page.js +7 -6
- package/dist/agent-page.js.map +1 -1
- package/dist/api.d.ts +9 -7
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +8 -6
- package/dist/api.js.map +1 -1
- 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 +58 -2
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +1742 -472
- 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 +54 -5
- package/dist/cli/credentials.d.ts.map +1 -1
- package/dist/cli/credentials.js +126 -20
- 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 +70 -9
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +267 -40
- 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 +101 -58
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/machine-check.d.ts +36 -0
- package/dist/cli/machine-check.d.ts.map +1 -0
- package/dist/cli/machine-check.js +151 -0
- package/dist/cli/machine-check.js.map +1 -0
- package/dist/cli/main.js +76 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/pack.d.ts +69 -60
- package/dist/cli/pack.d.ts.map +1 -1
- package/dist/cli/pack.js +241 -270
- 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 +7 -0
- package/dist/cli/runner-host.d.ts.map +1 -1
- package/dist/cli/runner-host.js +2 -0
- package/dist/cli/runner-host.js.map +1 -1
- package/dist/cli/secret-notes.d.ts +8 -0
- package/dist/cli/secret-notes.d.ts.map +1 -0
- package/dist/cli/secret-notes.js +48 -0
- package/dist/cli/secret-notes.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 +252 -3
- package/dist/cli/serve.js.map +1 -1
- package/dist/client.d.ts +54 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +77 -80
- package/dist/client.js.map +1 -1
- package/dist/components/agent-page.d.ts +164 -8
- package/dist/components/agent-page.d.ts.map +1 -1
- package/dist/components/agent-page.js +588 -151
- package/dist/components/agent-page.js.map +1 -1
- package/dist/components/agents.d.ts.map +1 -1
- package/dist/components/agents.js +1 -1
- package/dist/components/agents.js.map +1 -1
- package/dist/components/board.d.ts.map +1 -1
- package/dist/components/board.js +3 -2
- package/dist/components/board.js.map +1 -1
- package/dist/components/categories.js +1 -1
- package/dist/components/categories.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/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +1 -1
- 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 +7 -3
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/goals.d.ts +2 -0
- package/dist/components/goals.d.ts.map +1 -1
- package/dist/components/goals.js +1 -1
- package/dist/components/goals.js.map +1 -1
- package/dist/components/home.d.ts.map +1 -1
- package/dist/components/home.js +14 -6
- package/dist/components/home.js.map +1 -1
- package/dist/components/icon.d.ts +31 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/icon.js +169 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/markdown.d.ts +6 -0
- package/dist/components/markdown.d.ts.map +1 -1
- package/dist/components/markdown.js +10 -2
- package/dist/components/markdown.js.map +1 -1
- package/dist/components/people.js +1 -1
- package/dist/components/people.js.map +1 -1
- package/dist/components/plugin-frame.d.ts.map +1 -1
- package/dist/components/plugin-frame.js +7 -0
- 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 +54 -3
- package/dist/components/plugin-settings.js.map +1 -1
- package/dist/components/projects.d.ts +17 -4
- package/dist/components/projects.d.ts.map +1 -1
- package/dist/components/projects.js +51 -12
- 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 +35 -13
- package/dist/components/rules.js.map +1 -1
- package/dist/components/sessions.d.ts.map +1 -1
- package/dist/components/sessions.js +3 -2
- package/dist/components/sessions.js.map +1 -1
- package/dist/components/setup.d.ts +9 -3
- package/dist/components/setup.d.ts.map +1 -1
- package/dist/components/setup.js +12 -6
- package/dist/components/setup.js.map +1 -1
- package/dist/components/shell.d.ts.map +1 -1
- package/dist/components/shell.js +3 -2
- package/dist/components/shell.js.map +1 -1
- package/dist/components/tokens.js +1 -1
- package/dist/components/tokens.js.map +1 -1
- package/dist/components/ui.d.ts +5 -2
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +10 -7
- package/dist/components/ui.js.map +1 -1
- package/dist/connect-page.js +1 -1
- package/dist/connect-page.js.map +1 -1
- package/dist/console.css +1172 -106
- package/dist/console.d.ts +5 -0
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +52 -39
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +32 -33
- 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/home-tiles.d.ts +19 -3
- package/dist/home-tiles.d.ts.map +1 -1
- package/dist/home-tiles.js +147 -42
- package/dist/home-tiles.js.map +1 -1
- package/dist/i18n/en.d.ts +228 -6
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +309 -9
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +366 -85
- package/dist/i18n/ko.js.map +1 -1
- package/dist/i18n/particles.d.ts +7 -0
- package/dist/i18n/particles.d.ts.map +1 -0
- package/dist/i18n/particles.js +72 -0
- package/dist/i18n/particles.js.map +1 -0
- package/dist/icons/glyphs.d.ts +605 -0
- package/dist/icons/glyphs.d.ts.map +1 -0
- package/dist/icons/glyphs.js +104 -0
- package/dist/icons/glyphs.js.map +1 -0
- package/dist/icons/index.d.ts +59 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +157 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +20 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +20 -0
- package/dist/limits.js.map +1 -1
- package/dist/marks.d.ts +9 -0
- package/dist/marks.d.ts.map +1 -1
- package/dist/marks.js +9 -0
- package/dist/marks.js.map +1 -1
- package/dist/onboarding.d.ts +6 -0
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +5 -5
- package/dist/onboarding.js.map +1 -1
- 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 +30 -3
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +55 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +37 -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/web.d.ts +3 -0
- package/dist/plugin/web.d.ts.map +1 -1
- package/dist/plugin/web.js +5 -1
- package/dist/plugin/web.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/routes.d.ts +3 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +3 -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 +98 -45
- package/dist/rules.js.map +1 -1
- package/dist/runner/acp.d.ts +1 -1
- package/dist/runner/acp.d.ts.map +1 -1
- package/dist/runner/acp.js +32 -21
- package/dist/runner/acp.js.map +1 -1
- package/dist/runner/awake.d.ts +35 -0
- package/dist/runner/awake.d.ts.map +1 -0
- package/dist/runner/awake.js +95 -0
- package/dist/runner/awake.js.map +1 -0
- package/dist/runner/claude.d.ts +1 -1
- package/dist/runner/claude.d.ts.map +1 -1
- package/dist/runner/claude.js +100 -18
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/codex.d.ts +1 -1
- package/dist/runner/codex.d.ts.map +1 -1
- package/dist/runner/codex.js +20 -17
- package/dist/runner/codex.js.map +1 -1
- package/dist/runner/config.d.ts +5 -0
- package/dist/runner/config.d.ts.map +1 -1
- package/dist/runner/config.js +9 -0
- package/dist/runner/config.js.map +1 -1
- package/dist/runner/desk.d.ts +43 -2
- package/dist/runner/desk.d.ts.map +1 -1
- package/dist/runner/desk.js +168 -13
- package/dist/runner/desk.js.map +1 -1
- package/dist/runner/process.d.ts.map +1 -1
- package/dist/runner/process.js +11 -4
- package/dist/runner/process.js.map +1 -1
- package/dist/runner/redact.d.ts +39 -4
- package/dist/runner/redact.d.ts.map +1 -1
- package/dist/runner/redact.js +81 -5
- package/dist/runner/redact.js.map +1 -1
- package/dist/runner/runner.d.ts +28 -3
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/runner.js +371 -54
- package/dist/runner/runner.js.map +1 -1
- package/dist/runner/slack.d.ts.map +1 -1
- package/dist/runner/slack.js +10 -4
- package/dist/runner/slack.js.map +1 -1
- package/dist/runner/task-scheduler.d.ts +20 -0
- package/dist/runner/task-scheduler.d.ts.map +1 -1
- package/dist/runner/task-scheduler.js +34 -4
- package/dist/runner/task-scheduler.js.map +1 -1
- package/dist/runner/types.d.ts +51 -1
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/types.js +26 -0
- package/dist/runner/types.js.map +1 -1
- package/dist/runner.d.ts +6 -6
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +5 -5
- package/dist/runner.js.map +1 -1
- package/dist/schemas.d.ts +603 -6
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +156 -20
- package/dist/schemas.js.map +1 -1
- package/dist/services.d.ts +22 -5
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +41 -17
- package/dist/services.js.map +1 -1
- package/dist/setup-guide.d.ts +17 -4
- package/dist/setup-guide.d.ts.map +1 -1
- package/dist/setup-guide.js +48 -41
- package/dist/setup-guide.js.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +5 -1
- package/dist/tokens.js.map +1 -1
- package/dist/vocabulary.d.ts +21 -3
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +19 -3
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +73 -44
- package/docs/specs/plugins.md +40 -22
- package/docs/specs/records.md +113 -0
- package/docs/specs/rest.md +30 -21
- package/docs/specs/runner.md +46 -22
- package/package.json +11 -2
- package/skills/building-a-console/SKILL.md +4 -4
- package/skills/building-a-plugin/SKILL.md +6 -6
- package/skills/deploying-a-console/SKILL.md +4 -4
- package/skills/deploying-a-console/references/resources.md +41 -4
- 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 +15 -13
- package/skills/running-an-agent/SKILL.md +47 -56
- package/skills/working-the-board/SKILL.md +63 -44
- package/skills/working-the-board/references/terms.md +9 -5
- package/skills/working-the-board/references/the-pack.md +12 -10
- package/skills/working-the-board/references/the-sentence.md +2 -2
- package/src/agent-page.tsx +16 -2
- package/src/api.ts +109 -3
- package/src/charts.ts +250 -0
- package/src/cli/cli.ts +2226 -580
- package/src/cli/command-words.ts +56 -0
- package/src/cli/credentials.ts +181 -20
- package/src/cli/directory.ts +28 -10
- package/src/cli/format.ts +332 -49
- package/src/cli/help.ts +113 -57
- package/src/cli/machine-check.ts +223 -0
- package/src/cli/main.ts +72 -2
- package/src/cli/pack.ts +333 -372
- 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 +8 -0
- package/src/cli/secret-notes.ts +63 -0
- package/src/cli/serve.ts +295 -2
- package/src/client.ts +215 -177
- package/src/components/agent-page.tsx +1044 -281
- package/src/components/agents.tsx +9 -5
- package/src/components/board.tsx +3 -15
- package/src/components/categories.tsx +2 -2
- package/src/components/charts.tsx +680 -0
- package/src/components/decision-list.tsx +11 -7
- package/src/components/desk-records.tsx +724 -0
- package/src/components/desk.tsx +471 -0
- package/src/components/event-feed.tsx +12 -3
- package/src/components/goals.tsx +33 -25
- package/src/components/home.tsx +42 -6
- package/src/components/icon.tsx +337 -0
- package/src/components/markdown.tsx +22 -2
- package/src/components/people.tsx +1 -1
- package/src/components/plugin-frame.tsx +7 -0
- package/src/components/plugin-settings.tsx +171 -12
- package/src/components/projects.tsx +68 -17
- package/src/components/rules.tsx +94 -34
- package/src/components/sessions.tsx +2 -13
- package/src/components/setup.tsx +20 -5
- package/src/components/shell.tsx +3 -20
- package/src/components/tokens.tsx +1 -1
- package/src/components/ui.tsx +16 -8
- package/src/connect-page.tsx +1 -1
- package/src/console.tsx +104 -62
- package/src/data.ts +37 -34
- 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/home-tiles.ts +170 -46
- package/src/i18n/en.ts +323 -11
- package/src/i18n/ko.ts +378 -87
- package/src/i18n/particles.ts +79 -0
- package/src/icons/glyphs.ts +112 -0
- package/src/icons/index.ts +195 -0
- package/src/index.ts +125 -0
- package/src/limits.ts +20 -0
- package/src/marks.ts +12 -0
- package/src/onboarding.ts +14 -6
- package/src/plugin/context.ts +55 -12
- package/src/plugin/limits.ts +2 -0
- package/src/plugin/manifest.ts +38 -2
- package/src/plugin/rest-schemas.ts +41 -0
- package/src/plugin/sandbox.ts +4 -1
- package/src/plugin/testing.ts +63 -12
- package/src/plugin/web.ts +9 -2
- package/src/plugin.ts +2 -0
- package/src/records.ts +702 -0
- package/src/routes.ts +3 -1
- package/src/rules.ts +108 -47
- package/src/runner/acp.ts +49 -30
- package/src/runner/awake.ts +135 -0
- package/src/runner/claude.ts +131 -26
- package/src/runner/codex.ts +37 -26
- package/src/runner/config.ts +9 -0
- package/src/runner/desk.ts +200 -15
- package/src/runner/process.ts +11 -4
- package/src/runner/redact.ts +92 -6
- package/src/runner/runner.ts +457 -56
- package/src/runner/slack.ts +10 -4
- package/src/runner/task-scheduler.ts +36 -4
- package/src/runner/types.ts +67 -1
- package/src/runner.ts +27 -2
- package/src/schemas.ts +177 -18
- package/src/services.ts +55 -16
- package/src/setup-guide.ts +49 -40
- package/src/styles/README.md +16 -5
- package/src/styles/base.css +17 -0
- package/src/styles/console.css +10 -0
- package/src/styles/drawn-by-pages.json +1 -1
- package/src/styles/pages/agents.css +103 -1
- package/src/styles/pages/board.css +0 -10
- package/src/styles/pages/calendar.css +1 -1
- package/src/styles/pages/connect.css +0 -10
- package/src/styles/pages/decisions.css +3 -1
- package/src/styles/pages/desk.css +126 -0
- package/src/styles/pages/documents.css +5 -0
- package/src/styles/pages/feed.css +5 -2
- package/src/styles/pages/home.css +5 -0
- package/src/styles/pages/roadmap.css +2 -2
- package/src/styles/pages/settings.css +11 -0
- package/src/styles/pages/task.css +0 -20
- package/src/styles/pages/thread.css +1 -1
- package/src/styles/parts/bars.css +80 -0
- package/src/styles/parts/calendar.css +1 -1
- package/src/styles/parts/callout.css +1 -0
- package/src/styles/parts/chart.css +173 -0
- package/src/styles/parts/detail.css +22 -0
- package/src/styles/parts/empty.css +2 -0
- package/src/styles/parts/eyebrow.css +1 -1
- package/src/styles/parts/facts.css +1 -1
- package/src/styles/parts/figures.css +65 -0
- package/src/styles/parts/form.css +2 -1
- package/src/styles/parts/icon.css +191 -0
- package/src/styles/parts/input.css +14 -4
- package/src/styles/parts/legend.css +48 -0
- package/src/styles/parts/mark.css +36 -0
- package/src/styles/parts/menu.css +1 -7
- package/src/styles/parts/page.css +1 -1
- package/src/styles/parts/panel.css +10 -0
- package/src/styles/parts/person.css +5 -2
- package/src/styles/parts/progress.css +5 -2
- package/src/styles/parts/rows.css +1 -0
- package/src/styles/parts/series.css +32 -0
- package/src/styles/parts/settings.css +5 -0
- package/src/styles/parts/share.css +25 -0
- package/src/styles/parts/spark.css +23 -0
- package/src/styles/parts/stat.css +69 -0
- package/src/styles/tokens.css +31 -10
- package/src/tokens.ts +5 -1
- package/src/vocabulary.ts +25 -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/runner/slack.ts
CHANGED
|
@@ -99,10 +99,14 @@ export function slackWakeOf(payload: unknown): RaisedWake | undefined {
|
|
|
99
99
|
}
|
|
100
100
|
const thread = event.thread_ts ?? event.ts;
|
|
101
101
|
const cut = words.length > MAX_WAKE_TEXT ? `${words.slice(0, MAX_WAKE_TEXT)}…` : words;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
// A direct message outside any thread is said as one: named a thread, it is answered in one,
|
|
103
|
+
// where whoever wrote it reads the conversation itself.
|
|
104
|
+
const where = !direct
|
|
105
|
+
? `A mention in the channel ${event.channel} at Slack, from the member ${event.user}, in the thread ${thread}`
|
|
106
|
+
: event.thread_ts === undefined
|
|
107
|
+
? `A direct message at Slack, from the member ${event.user}, in the conversation ${event.channel}`
|
|
108
|
+
: `A direct message at Slack, from the member ${event.user}, in the thread ${thread} of the conversation ${event.channel}`;
|
|
109
|
+
return { key: `slack:${event.channel}:${thread}`, text: `${where}:\n${cut}` };
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
export const slack: WakeSource = {
|
|
@@ -111,6 +115,7 @@ export const slack: WakeSource = {
|
|
|
111
115
|
const token = await host.secret(SLACK_APP_TOKEN);
|
|
112
116
|
if (token === undefined) {
|
|
113
117
|
host.log(`the slack wake source finds no ${SLACK_APP_TOKEN} in the account's store`);
|
|
118
|
+
host.stands("waiting", `no ${SLACK_APP_TOKEN} in the account's store`);
|
|
114
119
|
await host.wait(NO_TOKEN_WAIT_MS, signal);
|
|
115
120
|
return;
|
|
116
121
|
}
|
|
@@ -140,6 +145,7 @@ export const slack: WakeSource = {
|
|
|
140
145
|
signal.addEventListener("abort", closing, { once: true });
|
|
141
146
|
try {
|
|
142
147
|
host.log("the slack wake source is connected");
|
|
148
|
+
host.stands("connected");
|
|
143
149
|
for await (const text of socket.messages) {
|
|
144
150
|
let json: unknown;
|
|
145
151
|
try {
|
|
@@ -8,8 +8,9 @@ import { KEEPER_VARIABLE, type Service, type ServiceCommand, type ServiceInput }
|
|
|
8
8
|
// The system starts a task once and in a window, gives it the account's environment and not the
|
|
9
9
|
// one the machine was set up in, keeps none of its words, and ends it by ending the one process
|
|
10
10
|
// it started: so what the task starts is a few lines of the system's own shell, in no window,
|
|
11
|
-
// which start the runner with the setup's `PATH`, keep its lines
|
|
12
|
-
// and tell it which process keeps it. Written from
|
|
11
|
+
// which start the runner with the setup's `PATH`, keep its lines in a log that is put aside
|
|
12
|
+
// when it is full, start it again when it ends and tell it which process keeps it. Written from
|
|
13
|
+
// the system's own documentation, the Task
|
|
13
14
|
// Scheduler's schema and schtasks, and run on Windows 11; the module says what to write and what
|
|
14
15
|
// to run, and whoever sets the machine up does it.
|
|
15
16
|
|
|
@@ -22,6 +23,14 @@ const RESTART_SECONDS = 10;
|
|
|
22
23
|
/** The most a task's command line carries, with room left for the shell's own path. */
|
|
23
24
|
const MAX_COMMAND = 30_000;
|
|
24
25
|
|
|
26
|
+
/**
|
|
27
|
+
* How large the log is before it is put aside, in bytes, and how many logs put aside are kept:
|
|
28
|
+
* the runner's lines hold a few megabytes at most, on a machine that runs for years. The other
|
|
29
|
+
* services leave it to the system, whose journal keeps to a size of its own.
|
|
30
|
+
*/
|
|
31
|
+
export const MAX_LOG_BYTES = 4 * 1024 * 1024;
|
|
32
|
+
export const KEPT_LOGS = 3;
|
|
33
|
+
|
|
25
34
|
/** What a task's name, and so the name of an OS account in it, cannot hold. */
|
|
26
35
|
const UNNAMEABLE = /[\\/:*?"<>|]/;
|
|
27
36
|
|
|
@@ -76,6 +85,29 @@ const word = (text: string): string => {
|
|
|
76
85
|
return parts.length === 1 ? (parts[0] ?? "''") : `(${parts.join(" + [char]37 + ")})`;
|
|
77
86
|
};
|
|
78
87
|
|
|
88
|
+
/**
|
|
89
|
+
* What keeps a line in the log, as a function of the shell's, `Keep`: the log is put aside
|
|
90
|
+
* first where it is full, as `<log>.1`, the ones put aside before each moved one on and the
|
|
91
|
+
* oldest let go, and the line is added and the log let go of, so that it is read while the
|
|
92
|
+
* runner runs. Whoever writes the log bounds it: a runner that cannot start writes lines too.
|
|
93
|
+
* The log itself is moved first, to a spare name, `<log>.0`, and the ones put aside are
|
|
94
|
+
* touched only once that worked: a log that cannot be moved, read by something that holds it
|
|
95
|
+
* say, is added to as it is and put aside at a later line, and costs none of them, where
|
|
96
|
+
* letting the oldest go first lost one at every line. A spare name left by a step after it
|
|
97
|
+
* that did not work is gone on from, the log after it added to meanwhile. The log is `$log`;
|
|
98
|
+
* no quote and no percent sign is written, as nothing of the task's line may hold one.
|
|
99
|
+
*/
|
|
100
|
+
export function logKeeper(maxBytes: number = MAX_LOG_BYTES, kept: number = KEPT_LOGS): string {
|
|
101
|
+
const aside = [
|
|
102
|
+
"$spare = $log + '.0'",
|
|
103
|
+
"if (-not [IO.File]::Exists($spare)) { [IO.File]::Move($log, $spare) }",
|
|
104
|
+
`$last = $log + '.${kept}'`,
|
|
105
|
+
"if ([IO.File]::Exists($last)) { [IO.File]::Delete($last) }",
|
|
106
|
+
`for ($i = ${kept - 1}; $i -ge 0; $i--) { $from = $log + '.' + $i; if ([IO.File]::Exists($from)) { [IO.File]::Move($from, $log + '.' + ($i + 1)) } }`,
|
|
107
|
+
].join("; ");
|
|
108
|
+
return `function Keep($line) { try { $now = [IO.FileInfo]$log; if ($now.Exists -and $now.Length -ge ${maxBytes}) { ${aside} } } catch { }; [IO.File]::AppendAllText($log, [string]$line + [Environment]::NewLine) }`;
|
|
109
|
+
}
|
|
110
|
+
|
|
79
111
|
/**
|
|
80
112
|
* What the task starts, in the system's own shell and on one line: the runner in the desk with
|
|
81
113
|
* the `PATH` the machine was set up with, its lines added to the log as they come, and the
|
|
@@ -86,13 +118,13 @@ const word = (text: string): string => {
|
|
|
86
118
|
*/
|
|
87
119
|
export function taskScript(input: ServiceInput, log: string): string {
|
|
88
120
|
const [runner = "", ...words] = input.program;
|
|
89
|
-
|
|
90
|
-
const kept = "[IO.File]::AppendAllText($log, [string]$_ + [Environment]::NewLine)";
|
|
121
|
+
const kept = "Keep $_";
|
|
91
122
|
return [
|
|
92
123
|
// A line the runner writes of an error is a line, and what it writes is read as it wrote it.
|
|
93
124
|
"$ErrorActionPreference = 'Continue'",
|
|
94
125
|
"[Console]::OutputEncoding = [Text.Encoding]::UTF8",
|
|
95
126
|
`$log = ${word(log)}`,
|
|
127
|
+
logKeeper(),
|
|
96
128
|
`$runner = ${word(runner)}`,
|
|
97
129
|
`$words = @(${words.map(word).join(", ")})`,
|
|
98
130
|
// A runner left behind is the same program, started with the same words to their end as
|
package/src/runner/types.ts
CHANGED
|
@@ -101,6 +101,64 @@ export interface StartOptions {
|
|
|
101
101
|
* names it; the driver's own for a run nobody attends where nothing names one.
|
|
102
102
|
*/
|
|
103
103
|
readonly permissions?: string | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* The browser the product's browser tool works in, as `runner.json` names it; a driver whose
|
|
106
|
+
* product has no such tool to turn on takes nothing of it.
|
|
107
|
+
*/
|
|
108
|
+
readonly browser?: string | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* What cuts a text to what the transcript shows of it. A driver cuts whatever it shows a
|
|
111
|
+
* part of through this, and never by itself first; left out, a text is cut as it is.
|
|
112
|
+
*/
|
|
113
|
+
readonly cut?: Cut | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* What keeps the end of a text to what the transcript shows of it, the secrets out first: the
|
|
116
|
+
* end of what the product wrote on its standard error, which says why it ended. A driver shows
|
|
117
|
+
* that through this (`errorsShown`); left out, a text is cut as it is.
|
|
118
|
+
*/
|
|
119
|
+
readonly cutEnd?: Cut | undefined;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* A text within `most` characters as the transcript shows it, ended by the mark of a cut where
|
|
124
|
+
* it was longer: the account's secrets are taken out first and the text is cut after, so that
|
|
125
|
+
* no part of one stands at the cut. `more` says that the text is itself the beginning of a
|
|
126
|
+
* longer one, which the driver kept to a bound: its last characters may begin a secret, and
|
|
127
|
+
* are not shown.
|
|
128
|
+
*/
|
|
129
|
+
export type Cut = (text: string, most: number, more?: boolean) => string;
|
|
130
|
+
|
|
131
|
+
/** A text cut as it is, with the mark of a cut: what a driver cuts with where it was handed nothing to cut with. */
|
|
132
|
+
export const plainCut: Cut = (text, most) =>
|
|
133
|
+
text.length > most ? `${text.slice(0, most)}…` : text;
|
|
134
|
+
|
|
135
|
+
/** The end of a text kept as it is, begun by the mark of a cut: what a driver keeps the end of a text with where it was handed nothing to. */
|
|
136
|
+
export const plainCutEnd: Cut = (text, most, more = false) =>
|
|
137
|
+
text.length > most || more ? `…${text.slice(Math.max(0, text.length - most))}` : text;
|
|
138
|
+
|
|
139
|
+
/** How much of the end of what a product wrote on its standard error an event shows. */
|
|
140
|
+
export const MAX_ERRORS_SHOWN = 4000;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* What a product wrote on its standard error as an event shows it: its end, within
|
|
144
|
+
* `MAX_ERRORS_SHOWN`, kept through `cutEnd`, so that the secrets are out before it is cut. A
|
|
145
|
+
* text whose beginning the child let go begins with the mark of a cut (`Child.errors`), and its
|
|
146
|
+
* first characters may be the end of a secret: they are not shown.
|
|
147
|
+
*/
|
|
148
|
+
export function errorsShown(errors: string, cutEnd: Cut): string {
|
|
149
|
+
const text = errors.trim();
|
|
150
|
+
const more = text.startsWith("…");
|
|
151
|
+
return cutEnd(more ? text.slice(1) : text, MAX_ERRORS_SHOWN, more);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Why a product's process never started, as an event says it: that its command is not there, in
|
|
156
|
+
* words that say where it is looked for, or what the system said of it.
|
|
157
|
+
*/
|
|
158
|
+
export function notStarted(error: string, command?: string): string {
|
|
159
|
+
return /\bENOENT\b/.test(error)
|
|
160
|
+
? `The product could not be started: its command${command === undefined ? "" : ` ${command}`} was not found where the runner looks for programs. Install it, or put its folder on the PATH the runner is started with.`
|
|
161
|
+
: `The product could not be started: ${error}`;
|
|
104
162
|
}
|
|
105
163
|
|
|
106
164
|
/** What the installed product is and offers, asked without starting a session. */
|
|
@@ -149,7 +207,10 @@ export interface Child {
|
|
|
149
207
|
end(): void;
|
|
150
208
|
/** Its standard output, a line at a time, until it closes. Read once. */
|
|
151
209
|
readonly lines: AsyncIterable<string>;
|
|
152
|
-
/**
|
|
210
|
+
/**
|
|
211
|
+
* The end of what it wrote on its standard error, bounded: where its beginning was let go, it
|
|
212
|
+
* begins with the mark of a cut (`…`), since what it begins with may be the end of a secret.
|
|
213
|
+
*/
|
|
153
214
|
errors(): string;
|
|
154
215
|
kill(signal: "SIGINT" | "SIGTERM" | "SIGKILL"): void;
|
|
155
216
|
/** How it ended: its exit code, or the signal that ended it; or why it never started. Never rejects. */
|
|
@@ -183,6 +244,11 @@ export interface WakeHost {
|
|
|
183
244
|
raise(wake: { readonly key: string; readonly text: string }): Promise<void>;
|
|
184
245
|
/** A line for whoever reads the runner's own output: never what a message says. */
|
|
185
246
|
log(line: string): void;
|
|
247
|
+
/**
|
|
248
|
+
* Says how the source stands, which the account's page shows (ADR-0144): listening, or not
|
|
249
|
+
* yet, with why in a few words of the source's own. Never what a message says.
|
|
250
|
+
*/
|
|
251
|
+
stands(state: "connected" | "waiting", why?: string): void;
|
|
186
252
|
fetch(
|
|
187
253
|
url: string,
|
|
188
254
|
init: {
|
package/src/runner.ts
CHANGED
|
@@ -12,10 +12,15 @@ export {
|
|
|
12
12
|
runnerConfigSchema,
|
|
13
13
|
} from "./runner/config.js";
|
|
14
14
|
export {
|
|
15
|
+
DESK_FOLDER,
|
|
15
16
|
DESK_SECTIONS,
|
|
16
17
|
type DeskInput,
|
|
17
18
|
deskFiles,
|
|
18
19
|
deskServicesOf,
|
|
20
|
+
deskWebTitleOf,
|
|
21
|
+
PERSON_DESK_SECTIONS,
|
|
22
|
+
type PersonDeskInput,
|
|
23
|
+
personDeskFiles,
|
|
19
24
|
} from "./runner/desk.js";
|
|
20
25
|
export { LAUNCHD_LABEL, launchd, launchdUnit } from "./runner/launchd.js";
|
|
21
26
|
export {
|
|
@@ -33,7 +38,15 @@ export {
|
|
|
33
38
|
} from "./runner/message.js";
|
|
34
39
|
export { ownRunnerModules } from "./runner/modules.js";
|
|
35
40
|
export { createSpawn } from "./runner/process.js";
|
|
36
|
-
export {
|
|
41
|
+
export {
|
|
42
|
+
cutShown,
|
|
43
|
+
cutShownEnd,
|
|
44
|
+
formsOf,
|
|
45
|
+
MAX_CUT_WINDOW,
|
|
46
|
+
type Redactor,
|
|
47
|
+
redactorOf,
|
|
48
|
+
WITHHELD,
|
|
49
|
+
} from "./runner/redact.js";
|
|
37
50
|
export {
|
|
38
51
|
createRegistry,
|
|
39
52
|
createRunnerModules,
|
|
@@ -47,7 +60,9 @@ export {
|
|
|
47
60
|
COOL_DOWN_MS,
|
|
48
61
|
createRunner,
|
|
49
62
|
HEARTBEAT_MS,
|
|
63
|
+
HOLD_MS,
|
|
50
64
|
MAX_COOL_DOWN_MS,
|
|
65
|
+
MAX_HOLD_MS,
|
|
51
66
|
type Runner,
|
|
52
67
|
type RunnerClient,
|
|
53
68
|
type RunnerOptions,
|
|
@@ -56,6 +71,9 @@ export {
|
|
|
56
71
|
export { SLACK_APP_TOKEN, slack, slackWakeOf } from "./runner/slack.js";
|
|
57
72
|
export { SYSTEMD_UNIT, systemdUnit, systemdUser } from "./runner/systemd-user.js";
|
|
58
73
|
export {
|
|
74
|
+
KEPT_LOGS,
|
|
75
|
+
logKeeper,
|
|
76
|
+
MAX_LOG_BYTES,
|
|
59
77
|
TASK_NAME,
|
|
60
78
|
taskDefinition,
|
|
61
79
|
taskNameOf,
|
|
@@ -65,6 +83,7 @@ export {
|
|
|
65
83
|
export type {
|
|
66
84
|
Boundary,
|
|
67
85
|
Child,
|
|
86
|
+
Cut,
|
|
68
87
|
Driver,
|
|
69
88
|
DriverEvent,
|
|
70
89
|
DriverMessage,
|
|
@@ -82,4 +101,10 @@ export type {
|
|
|
82
101
|
WakeSocket,
|
|
83
102
|
WakeSource,
|
|
84
103
|
} from "./runner/types.js";
|
|
85
|
-
export {
|
|
104
|
+
export {
|
|
105
|
+
errorsShown,
|
|
106
|
+
KEEPER_VARIABLE,
|
|
107
|
+
MAX_ERRORS_SHOWN,
|
|
108
|
+
plainCut,
|
|
109
|
+
plainCutEnd,
|
|
110
|
+
} from "./runner/types.js";
|
package/src/schemas.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
} from "@skillcdn/core";
|
|
14
14
|
import * as z from "zod/mini";
|
|
15
15
|
import { isDocumentPath } from "./documents.js";
|
|
16
|
+
import { isIconName } from "./icons/index.js";
|
|
16
17
|
import {
|
|
17
18
|
MAX_AGENT_ELSEWHERE,
|
|
18
19
|
MAX_AGENT_LENGTH,
|
|
@@ -46,6 +47,7 @@ import {
|
|
|
46
47
|
MAX_RULES_LENGTH,
|
|
47
48
|
MAX_RUNNER_LINE_LENGTH,
|
|
48
49
|
MAX_RUNNER_OFFERS,
|
|
50
|
+
MAX_RUNNER_SOURCES,
|
|
49
51
|
MAX_SEAL_REASON_LENGTH,
|
|
50
52
|
MAX_SECRET_LENGTH,
|
|
51
53
|
MAX_SERVICE_PARAMETERS,
|
|
@@ -80,6 +82,7 @@ import {
|
|
|
80
82
|
COLOR_NAMES,
|
|
81
83
|
CONSOLE_LANGUAGES,
|
|
82
84
|
EVENT_KINDS,
|
|
85
|
+
FIRST_SIGN_INS,
|
|
83
86
|
GOAL_STATES,
|
|
84
87
|
LINK_SOURCES,
|
|
85
88
|
MEMBERSHIP_SOURCES,
|
|
@@ -108,6 +111,7 @@ import {
|
|
|
108
111
|
TASK_PRIORITIES,
|
|
109
112
|
TASK_STATES,
|
|
110
113
|
TRANSCRIPT_KINDS,
|
|
114
|
+
WAKE_SOURCE_STATES,
|
|
111
115
|
WEEK_STARTS,
|
|
112
116
|
} from "./vocabulary.js";
|
|
113
117
|
|
|
@@ -653,7 +657,9 @@ export type RestWorkspacePatch = z.infer<typeof restWorkspacePatchSchema>;
|
|
|
653
657
|
/**
|
|
654
658
|
* `GET /api/v1/me`: the workspace, who the session cookie says is signed in (or `null`), the
|
|
655
659
|
* language they chose (or `null`), and the identity providers people sign in through, none
|
|
656
|
-
* where nobody can.
|
|
660
|
+
* where nobody can. Nobody signed in is told the workspace's name and its language alone: the
|
|
661
|
+
* most days of a token is `null` then, the skills' source is empty and their address `null`,
|
|
662
|
+
* and everything read as optional is left out.
|
|
657
663
|
*/
|
|
658
664
|
export const restMeSchema = z.object({
|
|
659
665
|
workspace: restWorkspaceSchema,
|
|
@@ -810,6 +816,17 @@ const runnerProduct = z.object({
|
|
|
810
816
|
version: z.nullable(runnerLine),
|
|
811
817
|
tried: z.boolean(),
|
|
812
818
|
});
|
|
819
|
+
/** A wake source as its runner says it stands: by its module's name, since when, and why where it does not listen. */
|
|
820
|
+
const runnerSource = z.object({
|
|
821
|
+
name: z.string().check(z.regex(/^[a-z][a-z0-9-]{0,39}$/)),
|
|
822
|
+
state: z.enum(WAKE_SOURCE_STATES),
|
|
823
|
+
since: instant,
|
|
824
|
+
why: z.optional(runnerLine),
|
|
825
|
+
});
|
|
826
|
+
/** What an account's own wake to come is called: a short name of lowercase letters, digits and hyphens. */
|
|
827
|
+
const ownWakeKey = z.string().check(z.regex(/^[a-z0-9][a-z0-9-]{0,39}$/));
|
|
828
|
+
/** A signal by its number alone: what an answer names one by where the record holds the rest. */
|
|
829
|
+
const restSignalRef = z.object({ number: z.int().check(z.positive()) });
|
|
813
830
|
/** What the product offers to choose from, and what the driver can do. */
|
|
814
831
|
const runnerOffers = z.object({
|
|
815
832
|
models: z.array(runnerChoice).check(z.maxLength(MAX_RUNNER_OFFERS)),
|
|
@@ -827,7 +844,7 @@ export const restRunnerHeartbeatInputSchema = z.object({
|
|
|
827
844
|
/** How the runner says its agent stands; `unheard` is the console's word, never the runner's. */
|
|
828
845
|
state: z.enum(["running", "stopped", "refused", "failed"]),
|
|
829
846
|
reason: z.enum(AGENT_STATE_REASONS),
|
|
830
|
-
/** The number of the last signal
|
|
847
|
+
/** The number of the last signal delivered, every one before it too: the product took it, or the record says what became of it; `0` for none. */
|
|
831
848
|
delivered: z.int().check(z.gte(0)),
|
|
832
849
|
/** The open session, or `null`. */
|
|
833
850
|
session: z.nullable(uuid),
|
|
@@ -838,13 +855,48 @@ export const restRunnerHeartbeatInputSchema = z.object({
|
|
|
838
855
|
offers: runnerOffers,
|
|
839
856
|
/** What the open session runs with; `null` each where the product's own choice stands. */
|
|
840
857
|
running: z.object({ model: z.nullable(runnerChoice), effort: z.nullable(runnerChoice) }),
|
|
858
|
+
/** The wake sources the runner keeps beside the console's own, and how each stands (ADR-0144); left out by a runner of before. */
|
|
859
|
+
sources: z.optional(z.array(runnerSource).check(z.maxLength(MAX_RUNNER_SOURCES))),
|
|
841
860
|
});
|
|
842
861
|
export type RestRunnerHeartbeatInput = z.infer<typeof restRunnerHeartbeatInputSchema>;
|
|
843
862
|
|
|
863
|
+
/**
|
|
864
|
+
* A wake an agent account raises for itself (ADR-0145), by its own command: now, or at a moment
|
|
865
|
+
* to come, under a name of which one stands at a time. Its words are the account's own.
|
|
866
|
+
*/
|
|
867
|
+
export const restOwnWakeInputSchema = z.object({
|
|
868
|
+
text: z.optional(paragraphs(MAX_SIGNAL_LENGTH)),
|
|
869
|
+
/** When it is raised; left out, now. */
|
|
870
|
+
at: z.optional(instant),
|
|
871
|
+
/** What a wake to come is called: a second under the name takes the first one's place. */
|
|
872
|
+
key: z.optional(ownWakeKey),
|
|
873
|
+
});
|
|
874
|
+
export type RestOwnWakeInput = z.infer<typeof restOwnWakeInputSchema>;
|
|
875
|
+
|
|
876
|
+
/** A wake an agent account keeps for later: what it is called, when it is raised, and its words. */
|
|
877
|
+
export const restOwnWakeSchema = z.object({
|
|
878
|
+
key: z.string(),
|
|
879
|
+
at: instant,
|
|
880
|
+
text: z.string(),
|
|
881
|
+
createdAt: instant,
|
|
882
|
+
});
|
|
883
|
+
export type RestOwnWake = z.infer<typeof restOwnWakeSchema>;
|
|
884
|
+
|
|
885
|
+
/** What raising one answers: the signal, for one raised now; the wake kept, for one to come. */
|
|
886
|
+
export const restOwnWakeRaisedSchema = z.object({
|
|
887
|
+
signal: z.nullable(restSignalRef),
|
|
888
|
+
kept: z.nullable(restOwnWakeSchema),
|
|
889
|
+
});
|
|
890
|
+
export type RestOwnWakeRaised = z.infer<typeof restOwnWakeRaisedSchema>;
|
|
891
|
+
|
|
892
|
+
/** `GET /api/v1/agents/<handle>/wakes`: the wakes the account keeps for later, the soonest first. */
|
|
893
|
+
export const restOwnWakesSchema = z.object({ items: z.array(restOwnWakeSchema) });
|
|
894
|
+
export type RestOwnWakes = z.infer<typeof restOwnWakesSchema>;
|
|
895
|
+
|
|
844
896
|
/** What the heartbeat is answered: where the account's record of signals stands, what its supervisors chose, and how the console has the agent. */
|
|
845
897
|
export const restRunnerHeartbeatSchema = z.object({
|
|
846
898
|
latest: z.int().check(z.gte(0)),
|
|
847
|
-
/** The number of the last signal the console has as
|
|
899
|
+
/** The number of the last signal the console has as delivered: where a runner that lost its own count goes on from. */
|
|
848
900
|
delivered: z.int().check(z.gte(0)),
|
|
849
901
|
settings: restAgentChoiceSchema,
|
|
850
902
|
state: z.enum(AGENT_STATES),
|
|
@@ -886,6 +938,21 @@ export const restAgentRunnerSchema = z.object({
|
|
|
886
938
|
),
|
|
887
939
|
running: z.nullable(restAgentChoiceSchema),
|
|
888
940
|
settings: restAgentChoiceSchema,
|
|
941
|
+
/**
|
|
942
|
+
* The wake sources its runner keeps beside the console's own, as it last said (ADR-0144);
|
|
943
|
+
* left out where the runner says none. The state is read as a word, so that one a newer
|
|
944
|
+
* runner says is shown as it came.
|
|
945
|
+
*/
|
|
946
|
+
sources: z.optional(
|
|
947
|
+
z.array(
|
|
948
|
+
z.object({
|
|
949
|
+
name: z.string(),
|
|
950
|
+
state: z.string(),
|
|
951
|
+
since: instant,
|
|
952
|
+
why: z.optional(z.string()),
|
|
953
|
+
}),
|
|
954
|
+
),
|
|
955
|
+
),
|
|
889
956
|
});
|
|
890
957
|
export type RestAgentRunner = z.infer<typeof restAgentRunnerSchema>;
|
|
891
958
|
|
|
@@ -913,8 +980,17 @@ export const restSignalSchema = z.object({
|
|
|
913
980
|
});
|
|
914
981
|
export type RestSignal = z.infer<typeof restSignalSchema>;
|
|
915
982
|
|
|
916
|
-
/**
|
|
917
|
-
|
|
983
|
+
/**
|
|
984
|
+
* `GET /api/v1/agents/<handle>/signals?before=&limit=`: the record, the newest first, and whether
|
|
985
|
+
* there is more before; and `delivered`, the number of the last signal delivered, every one
|
|
986
|
+
* before it too (ADR-0131), as the account's runner last said, `0` for none: a signal of the
|
|
987
|
+
* record is delivered where its number is no more than that. A console before 0.5.2 leaves it out.
|
|
988
|
+
*/
|
|
989
|
+
export const restSignalsSchema = z.object({
|
|
990
|
+
items: z.array(restSignalSchema),
|
|
991
|
+
more: z.boolean(),
|
|
992
|
+
delivered: z.optional(z.int().check(z.gte(0))),
|
|
993
|
+
});
|
|
918
994
|
export type RestSignals = z.infer<typeof restSignalsSchema>;
|
|
919
995
|
|
|
920
996
|
/**
|
|
@@ -1370,6 +1446,14 @@ export const restAgentSchema = z.object({
|
|
|
1370
1446
|
onboarding: z.optional(
|
|
1371
1447
|
z.nullable(z.object({ project: z.string(), number: z.number().check(z.int()) })),
|
|
1372
1448
|
),
|
|
1449
|
+
/**
|
|
1450
|
+
* What its first sign-in is held to (ADR-0126), while nobody has signed in with it under a
|
|
1451
|
+
* sign-in at a git host: `account` where the host said which account its login is, so that
|
|
1452
|
+
* only that account is let in; `member` and `login` where the host did not, which the pages
|
|
1453
|
+
* and the command say as not confirmed. Left out once it has signed in, and under a provider
|
|
1454
|
+
* that makes its own addresses. Answered from 0.5.1 and read as optional.
|
|
1455
|
+
*/
|
|
1456
|
+
firstSignIn: z.optional(z.enum(FIRST_SIGN_INS)),
|
|
1373
1457
|
});
|
|
1374
1458
|
export type RestAgent = z.infer<typeof restAgentSchema>;
|
|
1375
1459
|
|
|
@@ -1429,6 +1513,14 @@ const projectSymbol = line(MAX_PROJECT_SYMBOL_LENGTH).check(
|
|
|
1429
1513
|
z.refine((value) => !/\s/.test(value), "must have no space in it"),
|
|
1430
1514
|
);
|
|
1431
1515
|
|
|
1516
|
+
/**
|
|
1517
|
+
* An icon of the pack by its name (ADR-0142), which a project's mark shows in its symbol's place:
|
|
1518
|
+
* a name of the pack this console was built with, and nothing else.
|
|
1519
|
+
*/
|
|
1520
|
+
const projectGlyph = z
|
|
1521
|
+
.string()
|
|
1522
|
+
.check(z.refine((value) => isIconName(value), "must be the name of an icon of the pack"));
|
|
1523
|
+
|
|
1432
1524
|
/** A project of the workspace, as the asker sees it: with what they are in it. */
|
|
1433
1525
|
/** A project's own image for its mark: the hash it is kept by, which `projectIconPath` reads it with, and its kind. */
|
|
1434
1526
|
export const restProjectIconSchema = z.object({
|
|
@@ -1461,7 +1553,12 @@ export const restProjectSchema = z.object({
|
|
|
1461
1553
|
color: z.nullable(z.enum(COLOR_NAMES)),
|
|
1462
1554
|
/** The project's mark, a letter or two or a symbol, or `null` for the first letter of its name. */
|
|
1463
1555
|
symbol: z.nullable(z.string()),
|
|
1464
|
-
/**
|
|
1556
|
+
/**
|
|
1557
|
+
* The icon of the pack the mark shows in the symbol's place (ADR-0142), by its name, or `null`
|
|
1558
|
+
* for none. Left out by a console older than it; a name the reader's pack lacks is read as none.
|
|
1559
|
+
*/
|
|
1560
|
+
glyph: z.optional(z.nullable(z.string())),
|
|
1561
|
+
/** The project's own image for its mark, shown in place of the symbol and of the icon, or `null` for none. */
|
|
1465
1562
|
icon: z.nullable(restProjectIconSchema),
|
|
1466
1563
|
/** The pack token the project reads a private pack with (ADR-0028): when it was set, never the token; `null` for none. */
|
|
1467
1564
|
packToken: z.nullable(z.object({ setAt: instant })),
|
|
@@ -1492,6 +1589,8 @@ export const restProjectInputSchema = z.object({
|
|
|
1492
1589
|
/** Left out or `null`: a colour chosen from the key, and the first letter of the name. */
|
|
1493
1590
|
color: z.optional(z.nullable(z.enum(COLOR_NAMES))),
|
|
1494
1591
|
symbol: z.optional(z.nullable(projectSymbol)),
|
|
1592
|
+
/** Left out or `null`: no icon of the pack, and the mark is the symbol. */
|
|
1593
|
+
glyph: z.optional(z.nullable(projectGlyph)),
|
|
1495
1594
|
});
|
|
1496
1595
|
export type RestProjectInput = z.infer<typeof restProjectInputSchema>;
|
|
1497
1596
|
|
|
@@ -1503,6 +1602,7 @@ export const restProjectPatchSchema = z.object({
|
|
|
1503
1602
|
skillsAddress: z.optional(z.nullable(skillsAddress)),
|
|
1504
1603
|
color: z.optional(z.nullable(z.enum(COLOR_NAMES))),
|
|
1505
1604
|
symbol: z.optional(z.nullable(projectSymbol)),
|
|
1605
|
+
glyph: z.optional(z.nullable(projectGlyph)),
|
|
1506
1606
|
});
|
|
1507
1607
|
export type RestProjectPatch = z.infer<typeof restProjectPatchSchema>;
|
|
1508
1608
|
|
|
@@ -1908,6 +2008,8 @@ const projectRef = z.object({
|
|
|
1908
2008
|
name: z.string(),
|
|
1909
2009
|
color: z.nullable(z.enum(COLOR_NAMES)),
|
|
1910
2010
|
symbol: z.nullable(z.string()),
|
|
2011
|
+
/** The icon of the pack on the mark, as a project says it; left out by a console older than it. */
|
|
2012
|
+
glyph: z.optional(z.nullable(z.string())),
|
|
1911
2013
|
icon: z.nullable(restProjectIconSchema),
|
|
1912
2014
|
});
|
|
1913
2015
|
|
|
@@ -1962,6 +2064,18 @@ export type RestPersonWork = z.infer<typeof restPersonWorkSchema>;
|
|
|
1962
2064
|
export const restTaskBriefSchema = z.omit(restTaskSchema, { body: true });
|
|
1963
2065
|
export type RestTaskBrief = z.infer<typeof restTaskBriefSchema>;
|
|
1964
2066
|
|
|
2067
|
+
/**
|
|
2068
|
+
* `GET /api/v1/projects/<key>/tasks?brief=true`: a page of the board as `.../tasks` answers it,
|
|
2069
|
+
* the tasks without their bodies, for whatever lists tasks and shows no body: a listing of
|
|
2070
|
+
* the command, a desk's pages. A console from before the brief form answers the tasks whole,
|
|
2071
|
+
* which reads the same.
|
|
2072
|
+
*/
|
|
2073
|
+
export const restTaskBriefsSchema = z.object({
|
|
2074
|
+
items: z.array(restTaskBriefSchema),
|
|
2075
|
+
more: z.boolean(),
|
|
2076
|
+
});
|
|
2077
|
+
export type RestTaskBriefs = z.infer<typeof restTaskBriefsSchema>;
|
|
2078
|
+
|
|
1965
2079
|
/** A decision as the plate's page asks for it: everything but its body. */
|
|
1966
2080
|
export const restDecisionBriefSchema = z.omit(restDecisionSchema, { body: true });
|
|
1967
2081
|
export type RestDecisionBrief = z.infer<typeof restDecisionBriefSchema>;
|
|
@@ -2121,6 +2235,8 @@ export const restEventDataSchema = z.object({
|
|
|
2121
2235
|
capabilities: z.optional(z.array(z.string())),
|
|
2122
2236
|
/** For `plugin.configured` of a secret: `administrator`, or the host of the answer it was sealed from (ADR-0070). */
|
|
2123
2237
|
source: z.optional(z.string()),
|
|
2238
|
+
/** For `plugin.configured` of a keyed secret: the key its value was set, removed or moved under (ADR-0111). */
|
|
2239
|
+
under: z.optional(z.string()),
|
|
2124
2240
|
/** For `plugin.granted` and `plugin.revoked`: the plugin the role went to, by key, where one did (ADR-0072). */
|
|
2125
2241
|
grantee: z.optional(z.string()),
|
|
2126
2242
|
/** For `plugin.granted` and `plugin.revoked`: whether the role went to everyone. */
|
|
@@ -2211,6 +2327,32 @@ export type RestRun = z.infer<typeof restRunSchema>;
|
|
|
2211
2327
|
export const restRunsSchema = z.object({ items: z.array(restRunSchema), more: z.boolean() });
|
|
2212
2328
|
export type RestRuns = z.infer<typeof restRunsSchema>;
|
|
2213
2329
|
|
|
2330
|
+
/**
|
|
2331
|
+
* A run as a listing asks for it: everything but its reports, of which it says how many. The
|
|
2332
|
+
* reports are what a run says as it goes, and weigh more than the rest of a listing together.
|
|
2333
|
+
* A console from before the brief form (0.5.0) ignores the word and answers the run whole, so
|
|
2334
|
+
* what is read is either: the count where the console counted, the reports where it sent them.
|
|
2335
|
+
*/
|
|
2336
|
+
export const restRunBriefSchema = z.extend(z.omit(restRunSchema, { reports: true }), {
|
|
2337
|
+
/** How many reports the run has, as the brief form says it. */
|
|
2338
|
+
reportCount: z.optional(count),
|
|
2339
|
+
/** The reports themselves, from a console from before the brief form; a console that knows it leaves them out. */
|
|
2340
|
+
reports: z.optional(z.array(restReportSchema)),
|
|
2341
|
+
});
|
|
2342
|
+
export type RestRunBrief = z.infer<typeof restRunBriefSchema>;
|
|
2343
|
+
|
|
2344
|
+
/** How many reports a run has, as a listing says it: as the console counted them, else as many as it sent. */
|
|
2345
|
+
export function reportCountOf(run: RestRunBrief): number {
|
|
2346
|
+
return run.reportCount ?? run.reports?.length ?? 0;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
/** `GET /api/v1/projects/<key>/runs?brief=true`: a page of the runs as `.../runs` answers it, without their reports. */
|
|
2350
|
+
export const restRunBriefsSchema = z.object({
|
|
2351
|
+
items: z.array(restRunBriefSchema),
|
|
2352
|
+
more: z.boolean(),
|
|
2353
|
+
});
|
|
2354
|
+
export type RestRunBriefs = z.infer<typeof restRunBriefsSchema>;
|
|
2355
|
+
|
|
2214
2356
|
/** A file put in a comment, kept as a run's file is; its bytes are at `projectPath(key, "files", <id>)`. */
|
|
2215
2357
|
export const restCommentFileSchema = z.object({
|
|
2216
2358
|
id: uuid,
|
|
@@ -2344,14 +2486,18 @@ export type RestConnectInput = z.infer<typeof restConnectInputSchema>;
|
|
|
2344
2486
|
/**
|
|
2345
2487
|
* What `POST /api/v1/connect` answers (ADR-0011): the code a person approves, the address of the
|
|
2346
2488
|
* console's own page for it, and the secret the command claims the token with, shown nowhere.
|
|
2489
|
+
* Bounded, each no wider than the command's credentials file reads back (`cli/credentials.ts`),
|
|
2490
|
+
* since the route answers nobody and the command keeps the answer while it waits (ADR-0129):
|
|
2491
|
+
* a console answers a code of nine characters and a wait of a few seconds.
|
|
2347
2492
|
*/
|
|
2348
2493
|
export const restConnectionSchema = z.object({
|
|
2349
|
-
code: z.string(),
|
|
2350
|
-
url: z.string(),
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2494
|
+
code: z.string().check(z.minLength(1), z.maxLength(64)),
|
|
2495
|
+
url: z.string().check(z.minLength(1), z.maxLength(MAX_URL_LENGTH)),
|
|
2496
|
+
/** As long as the claim takes one. */
|
|
2497
|
+
secret: z.string().check(z.minLength(1), z.maxLength(MAX_SECRET_LENGTH)),
|
|
2498
|
+
expiresAt: z.iso.datetime().check(z.maxLength(40)),
|
|
2499
|
+
/** How many seconds the command waits between claims: ten minutes at most. */
|
|
2500
|
+
interval: z.int().check(z.positive(), z.lte(600)),
|
|
2355
2501
|
});
|
|
2356
2502
|
export type RestConnection = z.infer<typeof restConnectionSchema>;
|
|
2357
2503
|
|
|
@@ -2669,16 +2815,25 @@ export const restRulesPluginSchema = z.object({
|
|
|
2669
2815
|
export type RestRulesPlugin = z.infer<typeof restRulesPluginSchema>;
|
|
2670
2816
|
|
|
2671
2817
|
/**
|
|
2672
|
-
* `GET /api/v1/rules`, and each half of a project's (ADR-0023): the rules that hold,
|
|
2673
|
-
*
|
|
2674
|
-
*
|
|
2818
|
+
* `GET /api/v1/rules`, and each half of a project's (ADR-0023, ADR-0120): the rules that hold,
|
|
2819
|
+
* and what stands beside the console's. At the workspace, `reference`: the console's rules
|
|
2820
|
+
* alone, since the organization adds nothing; `written`: something is added, on its page. In
|
|
2821
|
+
* a project's own half, `written`: the page the project wrote; `none`: it adds none.
|
|
2675
2822
|
*/
|
|
2676
2823
|
export const restRulesSchema = z.object({
|
|
2677
2824
|
source: z.enum(RULES_SOURCES),
|
|
2678
|
-
/**
|
|
2825
|
+
/**
|
|
2826
|
+
* The rules as they hold, Markdown. At the workspace, whole: the console's, then what the
|
|
2827
|
+
* organization adds under a heading of its own, which is what a command of before prints.
|
|
2828
|
+
* `null` for a project that adds none.
|
|
2829
|
+
*/
|
|
2679
2830
|
body: z.nullable(z.string()),
|
|
2680
|
-
/** The page
|
|
2831
|
+
/** The page what is added is written on, or `null` where nothing is added. */
|
|
2681
2832
|
page: z.nullable(restDocumentSummarySchema),
|
|
2833
|
+
/** At the workspace, from 0.5.1: the console's rules by themselves, as they always hold. */
|
|
2834
|
+
own: z.optional(z.string()),
|
|
2835
|
+
/** At the workspace, from 0.5.1: what the organization adds, with its page; `null` where it adds nothing. */
|
|
2836
|
+
added: z.optional(z.nullable(z.object({ body: z.string(), page: restDocumentSummarySchema }))),
|
|
2682
2837
|
/** At the workspace: every plugin the asker may use, by key; left out in the halves of a project's answer. */
|
|
2683
2838
|
plugins: z.optional(z.array(restRulesPluginSchema)),
|
|
2684
2839
|
});
|
|
@@ -2693,7 +2848,11 @@ export const restProjectRulesSchema = z.object({
|
|
|
2693
2848
|
});
|
|
2694
2849
|
export type RestProjectRules = z.infer<typeof restProjectRulesSchema>;
|
|
2695
2850
|
|
|
2696
|
-
/**
|
|
2851
|
+
/**
|
|
2852
|
+
* What `PUT /api/v1/rules` is sent: what the organization adds, as it is to be. A body that
|
|
2853
|
+
* carries the console's rules whole, as a client of before read them, is taken for what stands
|
|
2854
|
+
* before and after them.
|
|
2855
|
+
*/
|
|
2697
2856
|
export const restRulesInputSchema = z.object({
|
|
2698
2857
|
body: paragraphs(MAX_RULES_LENGTH),
|
|
2699
2858
|
/** The version the writer started from; the write is refused when the rules have moved on. */
|