@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/claude.ts
CHANGED
|
@@ -2,15 +2,20 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import { MAX_FILE_BYTES } from "../limits.js";
|
|
3
3
|
import { TRANSCRIPT_PICTURE_TYPES } from "../vocabulary.js";
|
|
4
4
|
import type { DriverHost } from "./registry.js";
|
|
5
|
-
import
|
|
6
|
-
Child,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
import {
|
|
6
|
+
type Child,
|
|
7
|
+
type Cut,
|
|
8
|
+
type Driver,
|
|
9
|
+
type DriverEvent,
|
|
10
|
+
type DriverMessage,
|
|
11
|
+
type DriverSession,
|
|
12
|
+
errorsShown,
|
|
13
|
+
type Fact,
|
|
14
|
+
notStarted,
|
|
15
|
+
type Picture,
|
|
16
|
+
plainCut,
|
|
17
|
+
plainCutEnd,
|
|
18
|
+
type StartOptions,
|
|
14
19
|
} from "./types.js";
|
|
15
20
|
|
|
16
21
|
// The `claude` driver (docs/specs/runner.md): the Claude Code binary, unmodified, over its
|
|
@@ -65,7 +70,7 @@ function lineOf(line: string): Json | undefined {
|
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
/** A tool's input as a person reads it: the command of a shell, the path of a file, or the input whole and bounded. */
|
|
68
|
-
function inputOf(input: unknown): string {
|
|
73
|
+
function inputOf(input: unknown, cut: Cut): string {
|
|
69
74
|
if (isObject(input)) {
|
|
70
75
|
const line = textOf(input.command) ?? textOf(input.file_path) ?? textOf(input.path);
|
|
71
76
|
if (line !== undefined && Object.keys(input).length <= 3) {
|
|
@@ -78,7 +83,38 @@ function inputOf(input: unknown): string {
|
|
|
78
83
|
} catch {
|
|
79
84
|
whole = "";
|
|
80
85
|
}
|
|
81
|
-
return whole
|
|
86
|
+
return cut(whole, MAX_INPUT_LENGTH);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** The most characters of what a sub-agent is called that an event carries. */
|
|
90
|
+
const MAX_SUBAGENT_LENGTH = 80;
|
|
91
|
+
/** How many calls that started a sub-agent are remembered by their ids: the oldest is let go past it. */
|
|
92
|
+
const MAX_SUBAGENTS = 500;
|
|
93
|
+
/** The product's tools that start a sub-agent, as it has called them: one whose input names a kind of sub-agent is one too. */
|
|
94
|
+
const SUBAGENT_TOOLS: ReadonlySet<string> = new Set(["Agent", "Task"]);
|
|
95
|
+
|
|
96
|
+
/** A word of a call's input, trimmed, or nothing where it holds none. */
|
|
97
|
+
const wordOf = (input: unknown, name: string): string | undefined => {
|
|
98
|
+
const word = isObject(input) ? textOf(input[name])?.trim() : undefined;
|
|
99
|
+
return word === undefined || word.length === 0 ? undefined : word;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* What a call that starts a sub-agent calls it: the kind of sub-agent its input names and what
|
|
104
|
+
* its input says it is for, the kind first (`Explore: Read src/ of acme/web`), so that two of
|
|
105
|
+
* one kind at once are told apart; the one of the two the input names alone; the tool where
|
|
106
|
+
* it names neither; nothing for a call that starts none. Within the bound, mark and all, cut
|
|
107
|
+
* after the secrets are out of it, as everything a driver shows a part of is.
|
|
108
|
+
*/
|
|
109
|
+
function subagentOf(tool: string, input: unknown, cut: Cut): string | undefined {
|
|
110
|
+
const kind = wordOf(input, "subagent_type");
|
|
111
|
+
if (kind === undefined && !SUBAGENT_TOOLS.has(tool)) {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
const about = wordOf(input, "description");
|
|
115
|
+
const name =
|
|
116
|
+
kind !== undefined && about !== undefined ? `${kind}: ${about}` : (kind ?? about ?? tool);
|
|
117
|
+
return cut(name, MAX_SUBAGENT_LENGTH - 1);
|
|
82
118
|
}
|
|
83
119
|
|
|
84
120
|
/** The pictures and the text of what a tool returned: a string, or blocks of text and pictures. */
|
|
@@ -124,7 +160,7 @@ function resultOf(
|
|
|
124
160
|
}
|
|
125
161
|
|
|
126
162
|
/** What a denial says of the tool it denied. */
|
|
127
|
-
function denialOf(denial: unknown): DriverEvent | undefined {
|
|
163
|
+
function denialOf(denial: unknown, cut: Cut): DriverEvent | undefined {
|
|
128
164
|
if (!isObject(denial)) {
|
|
129
165
|
return undefined;
|
|
130
166
|
}
|
|
@@ -137,7 +173,7 @@ function denialOf(denial: unknown): DriverEvent | undefined {
|
|
|
137
173
|
return {
|
|
138
174
|
type: "event",
|
|
139
175
|
kind: "permission",
|
|
140
|
-
text: `Denied, with nobody at the terminal to ask: ${tool} ${inputOf(denial.tool_input)}`.trim(),
|
|
176
|
+
text: `Denied, with nobody at the terminal to ask: ${tool} ${inputOf(denial.tool_input, cut)}`.trim(),
|
|
141
177
|
data,
|
|
142
178
|
};
|
|
143
179
|
}
|
|
@@ -159,6 +195,25 @@ interface Read {
|
|
|
159
195
|
acknowledges: boolean;
|
|
160
196
|
/** The tool calls of the turn it said were denied, which the turn's result says again. */
|
|
161
197
|
readonly denied: Set<string>;
|
|
198
|
+
/** The calls that started a sub-agent, by their ids, with what each calls it. */
|
|
199
|
+
readonly subagents: Map<string, string>;
|
|
200
|
+
/** What cuts a text to what is shown of it. */
|
|
201
|
+
readonly cut: Cut;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Whose a line of the product is, as facts of its events (ADR-0131): a line a sub-agent wrote
|
|
206
|
+
* names the call that started that sub-agent, by the id the product gave the call, as the
|
|
207
|
+
* product's documentation has it (`parent_tool_use_id`), and what that call called it, where
|
|
208
|
+
* the call was read. Nothing for a line of the session's own.
|
|
209
|
+
*/
|
|
210
|
+
function whoseOf(line: Json, state: Read): Record<string, Fact> {
|
|
211
|
+
const parent = textOf(line.parent_tool_use_id);
|
|
212
|
+
if (parent === undefined || parent.length === 0) {
|
|
213
|
+
return {};
|
|
214
|
+
}
|
|
215
|
+
const subagent = state.subagents.get(parent);
|
|
216
|
+
return subagent === undefined ? { parent } : { parent, subagent };
|
|
162
217
|
}
|
|
163
218
|
|
|
164
219
|
/** The product's permission modes, as its documentation and its own help name them. */
|
|
@@ -262,7 +317,7 @@ function eventsOf(line: Json, state: Read): DriverEvent[] {
|
|
|
262
317
|
});
|
|
263
318
|
} else if (line.subtype === "permission_denied") {
|
|
264
319
|
// Said when it happens, and again in the turn's result, which is then not said twice.
|
|
265
|
-
const denied = denialOf(line);
|
|
320
|
+
const denied = denialOf(line, state.cut);
|
|
266
321
|
if (denied !== undefined) {
|
|
267
322
|
events.push(denied);
|
|
268
323
|
const id = textOf(line.tool_use_id);
|
|
@@ -274,21 +329,47 @@ function eventsOf(line: Json, state: Read): DriverEvent[] {
|
|
|
274
329
|
return events;
|
|
275
330
|
}
|
|
276
331
|
case "assistant": {
|
|
332
|
+
const whose = whoseOf(line, state);
|
|
333
|
+
// A fact is said only where there is one: a line of the session's own carries none.
|
|
334
|
+
const said = Object.keys(whose).length === 0 ? {} : { data: whose };
|
|
277
335
|
for (const block of blocks) {
|
|
278
336
|
if (!isObject(block)) {
|
|
279
337
|
continue;
|
|
280
338
|
}
|
|
281
339
|
if (block.type === "text" && typeof block.text === "string") {
|
|
282
|
-
events.push({ type: "event", kind: "assistant", text: block.text });
|
|
340
|
+
events.push({ type: "event", kind: "assistant", text: block.text, ...said });
|
|
283
341
|
} else if (block.type === "thinking" && typeof block.thinking === "string") {
|
|
284
|
-
|
|
342
|
+
// A thought the product sends with no words, its signature alone, is no event: it
|
|
343
|
+
// would show nothing, and count against what an hour of a session takes.
|
|
344
|
+
if (block.thinking.trim().length > 0) {
|
|
345
|
+
events.push({ type: "event", kind: "thinking", text: block.thinking, ...said });
|
|
346
|
+
}
|
|
285
347
|
} else if (block.type === "tool_use") {
|
|
286
348
|
const tool = textOf(block.name) ?? "a tool";
|
|
349
|
+
const id = textOf(block.id);
|
|
350
|
+
const subagent = subagentOf(tool, block.input, state.cut);
|
|
351
|
+
if (id !== undefined && subagent !== undefined) {
|
|
352
|
+
// What the sub-agent this call starts does names the call: remembered by its id.
|
|
353
|
+
if (state.subagents.size >= MAX_SUBAGENTS) {
|
|
354
|
+
const oldest = state.subagents.keys().next().value;
|
|
355
|
+
if (oldest !== undefined) {
|
|
356
|
+
state.subagents.delete(oldest);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
state.subagents.set(id, subagent);
|
|
360
|
+
}
|
|
287
361
|
events.push({
|
|
288
362
|
type: "event",
|
|
289
363
|
kind: "tool_call",
|
|
290
|
-
text: inputOf(block.input),
|
|
291
|
-
|
|
364
|
+
text: inputOf(block.input, state.cut),
|
|
365
|
+
// A call that starts a sub-agent says so, with what it calls it: a page then knows
|
|
366
|
+
// of the sub-agent before its first line arrives.
|
|
367
|
+
data: {
|
|
368
|
+
tool,
|
|
369
|
+
id: id ?? null,
|
|
370
|
+
...(subagent === undefined ? {} : { starts: subagent }),
|
|
371
|
+
...whose,
|
|
372
|
+
},
|
|
292
373
|
});
|
|
293
374
|
}
|
|
294
375
|
}
|
|
@@ -305,7 +386,8 @@ function eventsOf(line: Json, state: Read): DriverEvent[] {
|
|
|
305
386
|
}
|
|
306
387
|
return events;
|
|
307
388
|
}
|
|
308
|
-
// What came back from a tool is recorded here.
|
|
389
|
+
// What came back from a tool is recorded here, a sub-agent's tool as the session's own.
|
|
390
|
+
const whose = whoseOf(line, state);
|
|
309
391
|
for (const block of blocks) {
|
|
310
392
|
if (!isObject(block) || block.type !== "tool_result") {
|
|
311
393
|
continue;
|
|
@@ -316,7 +398,11 @@ function eventsOf(line: Json, state: Read): DriverEvent[] {
|
|
|
316
398
|
type: "event",
|
|
317
399
|
kind: "tool_result",
|
|
318
400
|
text: result.text,
|
|
319
|
-
data: {
|
|
401
|
+
data: {
|
|
402
|
+
id: textOf(block.tool_use_id) ?? null,
|
|
403
|
+
error: block.is_error === true,
|
|
404
|
+
...whose,
|
|
405
|
+
},
|
|
320
406
|
pictures: result.pictures,
|
|
321
407
|
});
|
|
322
408
|
}
|
|
@@ -324,7 +410,7 @@ function eventsOf(line: Json, state: Read): DriverEvent[] {
|
|
|
324
410
|
}
|
|
325
411
|
case "result": {
|
|
326
412
|
for (const denial of Array.isArray(line.permission_denials) ? line.permission_denials : []) {
|
|
327
|
-
const denied = denialOf(denial);
|
|
413
|
+
const denied = denialOf(denial, state.cut);
|
|
328
414
|
const id = isObject(denial) ? textOf(denial.tool_use_id) : undefined;
|
|
329
415
|
if (denied !== undefined && (id === undefined || !state.denied.has(id))) {
|
|
330
416
|
events.push(denied);
|
|
@@ -448,7 +534,14 @@ const wait = (ms: number): Promise<"timeout"> =>
|
|
|
448
534
|
setTimeout(() => resolve("timeout"), ms).unref?.();
|
|
449
535
|
});
|
|
450
536
|
|
|
451
|
-
function sessionOf(
|
|
537
|
+
function sessionOf(
|
|
538
|
+
child: Child,
|
|
539
|
+
command: string,
|
|
540
|
+
asked: string,
|
|
541
|
+
uuid: () => string,
|
|
542
|
+
cut: Cut,
|
|
543
|
+
cutEnd: Cut,
|
|
544
|
+
): DriverSession {
|
|
452
545
|
let stopping = false;
|
|
453
546
|
const state: Read = {
|
|
454
547
|
began: false,
|
|
@@ -459,6 +552,8 @@ function sessionOf(child: Child, asked: string, uuid: () => string): DriverSessi
|
|
|
459
552
|
waiting: new Set(),
|
|
460
553
|
denied: new Set(),
|
|
461
554
|
acknowledges: false,
|
|
555
|
+
subagents: new Map(),
|
|
556
|
+
cut,
|
|
462
557
|
};
|
|
463
558
|
|
|
464
559
|
async function* events(): AsyncGenerator<DriverEvent> {
|
|
@@ -478,10 +573,12 @@ function sessionOf(child: Child, asked: string, uuid: () => string): DriverSessi
|
|
|
478
573
|
const clean = stopping || (exit.code === 0 && exit.signal === null && exit.error === undefined);
|
|
479
574
|
if (!clean && !waits) {
|
|
480
575
|
const said = child.errors().trim();
|
|
576
|
+
// Its end, cut after the secrets are out, so that none stands at the cut.
|
|
577
|
+
const shown = errorsShown(said, cutEnd);
|
|
481
578
|
const text =
|
|
482
579
|
exit.error !== undefined
|
|
483
|
-
?
|
|
484
|
-
: `The product's process ended${exit.signal === null ? ` with code ${exit.code}` : ` on ${exit.signal}`}.${
|
|
580
|
+
? notStarted(exit.error, command)
|
|
581
|
+
: `The product's process ended${exit.signal === null ? ` with code ${exit.code}` : ` on ${exit.signal}`}.${shown.length === 0 ? "" : `\n${shown}`}`;
|
|
485
582
|
yield { type: "event", kind: "error", text };
|
|
486
583
|
yield {
|
|
487
584
|
type: "cannot_go_on",
|
|
@@ -556,6 +653,9 @@ export function claudeArguments(options: StartOptions): readonly string[] {
|
|
|
556
653
|
claudeMode(options.permissions),
|
|
557
654
|
"--permission-prompts",
|
|
558
655
|
"none",
|
|
656
|
+
// The product's browser tool is off in a run nobody attends unless it is asked for when the
|
|
657
|
+
// product starts: seen with 2.1.329, where its own setting for it did nothing in this mode.
|
|
658
|
+
...(options.browser === "chrome" ? ["--chrome"] : []),
|
|
559
659
|
...(model === undefined ? [] : ["--model", model]),
|
|
560
660
|
...(effort === undefined ? [] : ["--effort", effort]),
|
|
561
661
|
...(resume === undefined ? [] : ["--resume", resume]),
|
|
@@ -565,9 +665,11 @@ export function claudeArguments(options: StartOptions): readonly string[] {
|
|
|
565
665
|
/**
|
|
566
666
|
* The builds of the binary the driver was run against, a turn, a tool call, a picture each way,
|
|
567
667
|
* a message during a tool call, a turn stopped for a message, a denial and a conversation gone
|
|
568
|
-
* on with: what the fixtures of the tests were written down from.
|
|
668
|
+
* on with: what the fixtures of the tests were written down from, of the first two. The third
|
|
669
|
+
* kept an agent account at work against a live console for a day, its browser tool among it,
|
|
670
|
+
* and no fixture was taken of it.
|
|
569
671
|
*/
|
|
570
|
-
const TRIED = ["2.1.321", "2.1.322"] as const;
|
|
672
|
+
const TRIED = ["2.1.321", "2.1.322", "2.1.329"] as const;
|
|
571
673
|
|
|
572
674
|
export function createClaudeDriver(host: DriverHost): Driver {
|
|
573
675
|
const command = host.command ?? "claude";
|
|
@@ -597,8 +699,11 @@ export function createClaudeDriver(host: DriverHost): Driver {
|
|
|
597
699
|
start(options) {
|
|
598
700
|
return sessionOf(
|
|
599
701
|
host.spawn(command, claudeArguments(options), { cwd: options.cwd, env: options.env }),
|
|
702
|
+
command,
|
|
600
703
|
claudeMode(options.permissions),
|
|
601
704
|
uuid,
|
|
705
|
+
options.cut ?? plainCut,
|
|
706
|
+
options.cutEnd ?? plainCutEnd,
|
|
602
707
|
);
|
|
603
708
|
},
|
|
604
709
|
};
|
package/src/runner/codex.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { DriverHost } from "./registry.js";
|
|
2
|
-
import
|
|
3
|
-
Child,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import {
|
|
3
|
+
type Child,
|
|
4
|
+
type Cut,
|
|
5
|
+
type Driver,
|
|
6
|
+
type DriverEvent,
|
|
7
|
+
type DriverMessage,
|
|
8
|
+
type DriverSession,
|
|
9
|
+
errorsShown,
|
|
10
|
+
type Fact,
|
|
11
|
+
notStarted,
|
|
12
|
+
plainCut,
|
|
13
|
+
plainCutEnd,
|
|
14
|
+
type StartOptions,
|
|
10
15
|
} from "./types.js";
|
|
11
16
|
|
|
12
17
|
// The `codex` driver (docs/specs/runner.md): the Codex binary, unmodified, run with nobody at
|
|
@@ -151,16 +156,13 @@ function lineOf(line: string): Json | undefined {
|
|
|
151
156
|
}
|
|
152
157
|
}
|
|
153
158
|
|
|
154
|
-
const bounded = (text: string): string =>
|
|
155
|
-
text.length > MAX_INPUT_LENGTH ? `${text.slice(0, MAX_INPUT_LENGTH)}…` : text;
|
|
156
|
-
|
|
157
159
|
/** Anything as a line of text a person reads, bounded. */
|
|
158
|
-
function shown(value: unknown): string {
|
|
160
|
+
function shown(value: unknown, cut: Cut): string {
|
|
159
161
|
if (typeof value === "string") {
|
|
160
|
-
return
|
|
162
|
+
return cut(value, MAX_INPUT_LENGTH);
|
|
161
163
|
}
|
|
162
164
|
try {
|
|
163
|
-
return
|
|
165
|
+
return cut(JSON.stringify(value) ?? "", MAX_INPUT_LENGTH);
|
|
164
166
|
} catch {
|
|
165
167
|
return "";
|
|
166
168
|
}
|
|
@@ -201,6 +203,8 @@ interface Read {
|
|
|
201
203
|
turned: boolean;
|
|
202
204
|
/** How many messages the turn under way was started with. */
|
|
203
205
|
messages: number;
|
|
206
|
+
/** What cuts a text to what is shown of it. */
|
|
207
|
+
readonly cut: Cut;
|
|
204
208
|
}
|
|
205
209
|
|
|
206
210
|
/** What a turn runs with, as the session's first event and the heartbeat say it. */
|
|
@@ -211,19 +215,23 @@ interface Runs {
|
|
|
211
215
|
}
|
|
212
216
|
|
|
213
217
|
/** A tool call of the product, by the kind of item it writes for one: its name and its input as a line. */
|
|
214
|
-
function callOf(
|
|
218
|
+
function callOf(
|
|
219
|
+
item: Json,
|
|
220
|
+
cut: Cut,
|
|
221
|
+
): { readonly tool: string; readonly text: string } | undefined {
|
|
215
222
|
switch (item.type) {
|
|
216
223
|
case "command_execution":
|
|
217
|
-
return { tool: "command_execution", text: shown(item.command ?? "") };
|
|
224
|
+
return { tool: "command_execution", text: shown(item.command ?? "", cut) };
|
|
218
225
|
case "file_change": {
|
|
219
226
|
const changes = Array.isArray(item.changes) ? item.changes : [];
|
|
220
227
|
return {
|
|
221
228
|
tool: "file_change",
|
|
222
|
-
text:
|
|
229
|
+
text: cut(
|
|
223
230
|
changes
|
|
224
231
|
.filter(isObject)
|
|
225
232
|
.map((change) => `${textOf(change.kind) ?? "change"} ${textOf(change.path) ?? ""}`)
|
|
226
233
|
.join("\n"),
|
|
234
|
+
MAX_INPUT_LENGTH,
|
|
227
235
|
),
|
|
228
236
|
};
|
|
229
237
|
}
|
|
@@ -231,17 +239,17 @@ function callOf(item: Json): { readonly tool: string; readonly text: string } |
|
|
|
231
239
|
case "mcp_tool_call":
|
|
232
240
|
return {
|
|
233
241
|
tool: `${textOf(item.server) ?? "mcp"}.${textOf(item.tool) ?? "tool"}`,
|
|
234
|
-
text: item.arguments === undefined ? "" : shown(item.arguments),
|
|
242
|
+
text: item.arguments === undefined ? "" : shown(item.arguments, cut),
|
|
235
243
|
};
|
|
236
244
|
case "web_search":
|
|
237
|
-
return { tool: "web_search", text: shown(item.query ?? "") };
|
|
245
|
+
return { tool: "web_search", text: shown(item.query ?? "", cut) };
|
|
238
246
|
default:
|
|
239
247
|
return undefined;
|
|
240
248
|
}
|
|
241
249
|
}
|
|
242
250
|
|
|
243
251
|
/** What came back from a tool call, where the product says: a command's output, or what a tool answered. */
|
|
244
|
-
function resultOf(item: Json): string {
|
|
252
|
+
function resultOf(item: Json, cut: Cut): string {
|
|
245
253
|
if (item.type === "command_execution") {
|
|
246
254
|
return textOf(item.aggregated_output) ?? "";
|
|
247
255
|
}
|
|
@@ -249,7 +257,7 @@ function resultOf(item: Json): string {
|
|
|
249
257
|
if (isObject(item.error) && typeof item.error.message === "string") {
|
|
250
258
|
return item.error.message;
|
|
251
259
|
}
|
|
252
|
-
return item.result === undefined || item.result === null ? "" : shown(item.result);
|
|
260
|
+
return item.result === undefined || item.result === null ? "" : shown(item.result, cut);
|
|
253
261
|
}
|
|
254
262
|
return "";
|
|
255
263
|
}
|
|
@@ -284,7 +292,7 @@ function eventsOf(line: Json, read: Read, runs: Runs): DriverEvent[] {
|
|
|
284
292
|
return events;
|
|
285
293
|
}
|
|
286
294
|
case "item.started": {
|
|
287
|
-
const call = item === undefined ? undefined : callOf(item);
|
|
295
|
+
const call = item === undefined ? undefined : callOf(item, read.cut);
|
|
288
296
|
const id = textOf(item?.id);
|
|
289
297
|
if (call !== undefined) {
|
|
290
298
|
events.push({
|
|
@@ -313,7 +321,7 @@ function eventsOf(line: Json, read: Read, runs: Runs): DriverEvent[] {
|
|
|
313
321
|
// A word of warning inside a turn: the turn goes on.
|
|
314
322
|
events.push({ type: "event", kind: "error", text: errorOf(item.message) });
|
|
315
323
|
} else {
|
|
316
|
-
const call = callOf(item);
|
|
324
|
+
const call = callOf(item, read.cut);
|
|
317
325
|
if (call === undefined) {
|
|
318
326
|
return events;
|
|
319
327
|
}
|
|
@@ -340,7 +348,7 @@ function eventsOf(line: Json, read: Read, runs: Runs): DriverEvent[] {
|
|
|
340
348
|
events.push({
|
|
341
349
|
type: "event",
|
|
342
350
|
kind: "tool_result",
|
|
343
|
-
text: resultOf(item),
|
|
351
|
+
text: resultOf(item, read.cut),
|
|
344
352
|
data,
|
|
345
353
|
pictures: [],
|
|
346
354
|
});
|
|
@@ -434,6 +442,7 @@ function sessionOf(
|
|
|
434
442
|
failed: undefined,
|
|
435
443
|
turned: false,
|
|
436
444
|
messages: 0,
|
|
445
|
+
cut: options.cut ?? plainCut,
|
|
437
446
|
};
|
|
438
447
|
const mode = codexMode(options.permissions);
|
|
439
448
|
let conversation = word(options.resume);
|
|
@@ -512,7 +521,7 @@ function sessionOf(
|
|
|
512
521
|
});
|
|
513
522
|
} else if (exit.error !== undefined) {
|
|
514
523
|
emit(
|
|
515
|
-
{ type: "event", kind: "error", text:
|
|
524
|
+
{ type: "event", kind: "error", text: notStarted(exit.error, host.command) },
|
|
516
525
|
{ type: "cannot_go_on", state: "failed", reason: "start" },
|
|
517
526
|
);
|
|
518
527
|
// Nothing was taken: the runner sends again what it sent.
|
|
@@ -521,10 +530,12 @@ function sessionOf(
|
|
|
521
530
|
} else if (!read.completed) {
|
|
522
531
|
const errors = child.errors().trim();
|
|
523
532
|
if (read.failed === undefined) {
|
|
533
|
+
// Its end, cut after the secrets are out, so that none stands at the cut.
|
|
534
|
+
const shown = errorsShown(errors, options.cutEnd ?? plainCutEnd);
|
|
524
535
|
emit({
|
|
525
536
|
type: "event",
|
|
526
537
|
kind: "error",
|
|
527
|
-
text: `The product's process ended${exit.signal === null ? ` with code ${exit.code}` : ` on ${exit.signal}`} before the turn did.${
|
|
538
|
+
text: `The product's process ended${exit.signal === null ? ` with code ${exit.code}` : ` on ${exit.signal}`} before the turn did.${shown.length === 0 ? "" : `\n${shown}`}`,
|
|
528
539
|
});
|
|
529
540
|
}
|
|
530
541
|
if (SIGN_IN.test(`${read.failed ?? ""}\n${errors}`)) {
|
package/src/runner/config.ts
CHANGED
|
@@ -22,6 +22,8 @@ const workFile = z.string().check(
|
|
|
22
22
|
);
|
|
23
23
|
const secretName = z.string().check(z.refine(isSecretName, "is the name of a secret"));
|
|
24
24
|
const MAX_ENTRIES = 50;
|
|
25
|
+
/** The browsers a desk may name for its product's browser tool. */
|
|
26
|
+
export const RUNNER_BROWSERS = ["chrome"] as const;
|
|
25
27
|
const bounded = <T extends Record<string, string>>(entries: T): boolean =>
|
|
26
28
|
Object.keys(entries).length <= MAX_ENTRIES;
|
|
27
29
|
|
|
@@ -57,6 +59,13 @@ export const runnerConfigSchema = z.object({
|
|
|
57
59
|
* asking. Left out, the driver's own for a run nobody attends.
|
|
58
60
|
*/
|
|
59
61
|
permissions: z.optional(z.string().check(z.regex(/^[A-Za-z][A-Za-z0-9-]{0,39}$/))),
|
|
62
|
+
/**
|
|
63
|
+
* The browser the product's own browser tool works in, for a driver whose product has such a
|
|
64
|
+
* tool and turns it on when it is started (ADR-0140): a name of a short list, and never words
|
|
65
|
+
* for the product's command line. Left out, a session has no browser tool but what the
|
|
66
|
+
* product gives it by itself.
|
|
67
|
+
*/
|
|
68
|
+
browser: z.optional(z.enum(RUNNER_BROWSERS)),
|
|
60
69
|
});
|
|
61
70
|
export type RunnerConfig = z.infer<typeof runnerConfigSchema>;
|
|
62
71
|
|