@skillcdn/console 0.4.7 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -14
- package/SKILLCDN.md +5 -3
- package/dist/agent-page.d.ts +44 -0
- package/dist/agent-page.d.ts.map +1 -0
- package/dist/agent-page.js +415 -0
- package/dist/agent-page.js.map +1 -0
- package/dist/agent-stream.d.ts +52 -0
- package/dist/agent-stream.d.ts.map +1 -0
- package/dist/agent-stream.js +155 -0
- package/dist/agent-stream.js.map +1 -0
- package/dist/api.d.ts +12 -6
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +11 -5
- package/dist/api.js.map +1 -1
- package/dist/avatar.d.ts +137 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/avatar.js +1216 -0
- package/dist/avatar.js.map +1 -0
- package/dist/charts.d.ts +103 -0
- package/dist/charts.d.ts.map +1 -0
- package/dist/charts.js +182 -0
- package/dist/charts.js.map +1 -0
- package/dist/cli/cli.d.ts +39 -1
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +2424 -296
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/command-words.d.ts +20 -0
- package/dist/cli/command-words.d.ts.map +1 -0
- package/dist/cli/command-words.js +51 -0
- package/dist/cli/command-words.js.map +1 -0
- package/dist/cli/credentials.d.ts +59 -5
- package/dist/cli/credentials.d.ts.map +1 -1
- package/dist/cli/credentials.js +128 -16
- package/dist/cli/credentials.js.map +1 -1
- package/dist/cli/directory.d.ts +19 -4
- package/dist/cli/directory.d.ts.map +1 -1
- package/dist/cli/directory.js +16 -8
- package/dist/cli/directory.js.map +1 -1
- package/dist/cli/format.d.ts +91 -8
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +386 -57
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts +13 -4
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +202 -62
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/main.js +94 -0
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/pack.d.ts +69 -36
- package/dist/cli/pack.d.ts.map +1 -1
- package/dist/cli/pack.js +241 -188
- package/dist/cli/pack.js.map +1 -1
- package/dist/cli/plugin-check.d.ts +42 -0
- package/dist/cli/plugin-check.d.ts.map +1 -1
- package/dist/cli/plugin-check.js +221 -36
- package/dist/cli/plugin-check.js.map +1 -1
- package/dist/cli/plugin-cli.d.ts +6 -1
- package/dist/cli/plugin-cli.d.ts.map +1 -1
- package/dist/cli/plugin-cli.js +21 -4
- package/dist/cli/plugin-cli.js.map +1 -1
- package/dist/cli/plugin-main.js +1 -0
- package/dist/cli/plugin-main.js.map +1 -1
- package/dist/cli/runner-host.d.ts +36 -0
- package/dist/cli/runner-host.d.ts.map +1 -0
- package/dist/cli/runner-host.js +154 -0
- package/dist/cli/runner-host.js.map +1 -0
- package/dist/cli/serve.d.ts +33 -1
- package/dist/cli/serve.d.ts.map +1 -1
- package/dist/cli/serve.js +275 -6
- package/dist/cli/serve.js.map +1 -1
- package/dist/cli/setup-machine.d.ts +36 -0
- package/dist/cli/setup-machine.d.ts.map +1 -0
- package/dist/cli/setup-machine.js +109 -0
- package/dist/cli/setup-machine.js.map +1 -0
- package/dist/client.d.ts +189 -10
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +192 -57
- package/dist/client.js.map +1 -1
- package/dist/compat.d.ts +1 -1
- package/dist/compat.js +2 -2
- package/dist/components/agent-page.d.ts +384 -0
- package/dist/components/agent-page.d.ts.map +1 -0
- package/dist/components/agent-page.js +985 -0
- package/dist/components/agent-page.js.map +1 -0
- package/dist/components/agents.d.ts +102 -0
- package/dist/components/agents.d.ts.map +1 -0
- package/dist/components/agents.js +246 -0
- package/dist/components/agents.js.map +1 -0
- package/dist/components/calendar.d.ts +17 -17
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/calendar.js +7 -2
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/charts.d.ts +157 -0
- package/dist/components/charts.d.ts.map +1 -0
- package/dist/components/charts.js +182 -0
- package/dist/components/charts.js.map +1 -0
- package/dist/components/comments.d.ts +2 -0
- package/dist/components/comments.d.ts.map +1 -1
- package/dist/components/comments.js +1 -1
- package/dist/components/comments.js.map +1 -1
- package/dist/components/connect.d.ts.map +1 -1
- package/dist/components/connect.js +7 -2
- package/dist/components/connect.js.map +1 -1
- package/dist/components/decision-form.d.ts +21 -0
- package/dist/components/decision-form.d.ts.map +1 -1
- package/dist/components/decision-form.js +20 -6
- package/dist/components/decision-form.js.map +1 -1
- package/dist/components/decision-list.d.ts +24 -0
- package/dist/components/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +54 -5
- package/dist/components/decision-list.js.map +1 -1
- package/dist/components/desk-records.d.ts +102 -0
- package/dist/components/desk-records.d.ts.map +1 -0
- package/dist/components/desk-records.js +221 -0
- package/dist/components/desk-records.js.map +1 -0
- package/dist/components/desk.d.ts +85 -0
- package/dist/components/desk.d.ts.map +1 -0
- package/dist/components/desk.js +135 -0
- package/dist/components/desk.js.map +1 -0
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +26 -1
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/home.d.ts +12 -1
- package/dist/components/home.d.ts.map +1 -1
- package/dist/components/home.js +175 -16
- package/dist/components/home.js.map +1 -1
- package/dist/components/my-decisions.d.ts +5 -0
- package/dist/components/my-decisions.d.ts.map +1 -1
- package/dist/components/my-decisions.js +3 -3
- package/dist/components/my-decisions.js.map +1 -1
- package/dist/components/people.d.ts +17 -0
- package/dist/components/people.d.ts.map +1 -1
- package/dist/components/people.js +55 -19
- package/dist/components/people.js.map +1 -1
- package/dist/components/picker.d.ts +2 -0
- package/dist/components/picker.d.ts.map +1 -1
- package/dist/components/picker.js +1 -1
- package/dist/components/picker.js.map +1 -1
- package/dist/components/pictures.d.ts +38 -10
- package/dist/components/pictures.d.ts.map +1 -1
- package/dist/components/pictures.js +195 -40
- package/dist/components/pictures.js.map +1 -1
- package/dist/components/plugin-events.d.ts +29 -0
- package/dist/components/plugin-events.d.ts.map +1 -0
- package/dist/components/plugin-events.js +139 -0
- package/dist/components/plugin-events.js.map +1 -0
- package/dist/components/plugin-frame.d.ts.map +1 -1
- package/dist/components/plugin-frame.js +14 -37
- package/dist/components/plugin-frame.js.map +1 -1
- package/dist/components/plugin-settings.d.ts.map +1 -1
- package/dist/components/plugin-settings.js +58 -7
- package/dist/components/plugin-settings.js.map +1 -1
- package/dist/components/projects.d.ts.map +1 -1
- package/dist/components/projects.js +30 -10
- package/dist/components/projects.js.map +1 -1
- package/dist/components/rules.d.ts +8 -10
- package/dist/components/rules.d.ts.map +1 -1
- package/dist/components/rules.js +36 -14
- package/dist/components/rules.js.map +1 -1
- package/dist/components/sessions.d.ts.map +1 -1
- package/dist/components/sessions.js +8 -4
- package/dist/components/sessions.js.map +1 -1
- package/dist/components/setup.d.ts +59 -0
- package/dist/components/setup.d.ts.map +1 -0
- package/dist/components/setup.js +93 -0
- package/dist/components/setup.js.map +1 -0
- package/dist/components/sign-in.js +1 -1
- package/dist/components/sign-in.js.map +1 -1
- package/dist/components/task-form.d.ts.map +1 -1
- package/dist/components/task-form.js +2 -2
- package/dist/components/task-form.js.map +1 -1
- package/dist/components/task-list.d.ts +7 -6
- package/dist/components/task-list.d.ts.map +1 -1
- package/dist/components/task-list.js.map +1 -1
- package/dist/components/task-view.d.ts +3 -0
- package/dist/components/task-view.d.ts.map +1 -1
- package/dist/components/task-view.js +1 -1
- package/dist/components/task-view.js.map +1 -1
- package/dist/components/ui.d.ts +78 -8
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +88 -9
- package/dist/components/ui.js.map +1 -1
- package/dist/components/work.d.ts +5 -5
- package/dist/components/work.d.ts.map +1 -1
- package/dist/components/work.js.map +1 -1
- package/dist/components/workspace.d.ts +17 -0
- package/dist/components/workspace.d.ts.map +1 -1
- package/dist/components/workspace.js +129 -2
- package/dist/components/workspace.js.map +1 -1
- package/dist/connect-page.d.ts.map +1 -1
- package/dist/connect-page.js +5 -2
- package/dist/connect-page.js.map +1 -1
- package/dist/console.css +7551 -4580
- package/dist/console.d.ts +20 -0
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +331 -57
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +22 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +62 -34
- package/dist/data.js.map +1 -1
- package/dist/desk-page.d.ts +38 -0
- package/dist/desk-page.d.ts.map +1 -0
- package/dist/desk-page.js +184 -0
- package/dist/desk-page.js.map +1 -0
- package/dist/desk-records-page.d.ts +18 -0
- package/dist/desk-records-page.d.ts.map +1 -0
- package/dist/desk-records-page.js +130 -0
- package/dist/desk-records-page.js.map +1 -0
- package/dist/desk-records.d.ts +247 -0
- package/dist/desk-records.d.ts.map +1 -0
- package/dist/desk-records.js +543 -0
- package/dist/desk-records.js.map +1 -0
- package/dist/desk.d.ts +122 -0
- package/dist/desk.d.ts.map +1 -0
- package/dist/desk.js +211 -0
- package/dist/desk.js.map +1 -0
- package/dist/feed-stream.d.ts +39 -0
- package/dist/feed-stream.d.ts.map +1 -0
- package/dist/feed-stream.js +117 -0
- package/dist/feed-stream.js.map +1 -0
- package/dist/glances.d.ts +39 -0
- package/dist/glances.d.ts.map +1 -0
- package/dist/glances.js +94 -0
- package/dist/glances.js.map +1 -0
- package/dist/home-tiles.d.ts +69 -5
- package/dist/home-tiles.d.ts.map +1 -1
- package/dist/home-tiles.js +347 -9
- package/dist/home-tiles.js.map +1 -1
- package/dist/i18n/en.d.ts +773 -3
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +770 -9
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +736 -9
- package/dist/i18n/ko.js.map +1 -1
- package/dist/index.d.ts +19 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +67 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +67 -0
- package/dist/limits.js.map +1 -1
- package/dist/onboarding.d.ts +21 -0
- package/dist/onboarding.d.ts.map +1 -0
- package/dist/onboarding.js +43 -0
- package/dist/onboarding.js.map +1 -0
- package/dist/persona.d.ts +34 -0
- package/dist/persona.d.ts.map +1 -0
- package/dist/persona.js +71 -0
- package/dist/persona.js.map +1 -0
- package/dist/plugin/context.d.ts +42 -11
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/limits.d.ts +2 -0
- package/dist/plugin/limits.d.ts.map +1 -1
- package/dist/plugin/limits.js +2 -0
- package/dist/plugin/limits.js.map +1 -1
- package/dist/plugin/manifest.d.ts +13 -0
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +34 -4
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +56 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +42 -0
- package/dist/plugin/rest-schemas.js.map +1 -1
- package/dist/plugin/sandbox.d.ts.map +1 -1
- package/dist/plugin/sandbox.js +4 -1
- package/dist/plugin/sandbox.js.map +1 -1
- package/dist/plugin/testing.d.ts +6 -2
- package/dist/plugin/testing.d.ts.map +1 -1
- package/dist/plugin/testing.js +52 -10
- package/dist/plugin/testing.js.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/records.d.ts +283 -0
- package/dist/records.d.ts.map +1 -0
- package/dist/records.js +543 -0
- package/dist/records.js.map +1 -0
- package/dist/router.d.ts +50 -3
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +78 -7
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +12 -2
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +14 -1
- package/dist/routes.js.map +1 -1
- package/dist/rules.d.ts +30 -11
- package/dist/rules.d.ts.map +1 -1
- package/dist/rules.js +99 -42
- package/dist/rules.js.map +1 -1
- package/dist/runner/acp.d.ts +20 -0
- package/dist/runner/acp.d.ts.map +1 -0
- package/dist/runner/acp.js +1132 -0
- package/dist/runner/acp.js.map +1 -0
- package/dist/runner/claude.d.ts +13 -0
- package/dist/runner/claude.d.ts.map +1 -0
- package/dist/runner/claude.js +615 -0
- package/dist/runner/claude.js.map +1 -0
- package/dist/runner/codex.d.ts +19 -0
- package/dist/runner/codex.d.ts.map +1 -0
- package/dist/runner/codex.js +597 -0
- package/dist/runner/codex.js.map +1 -0
- package/dist/runner/config.d.ts +35 -0
- package/dist/runner/config.d.ts.map +1 -0
- package/dist/runner/config.js +74 -0
- package/dist/runner/config.js.map +1 -0
- package/dist/runner/desk.d.ts +81 -0
- package/dist/runner/desk.d.ts.map +1 -0
- package/dist/runner/desk.js +303 -0
- package/dist/runner/desk.js.map +1 -0
- package/dist/runner/launchd.d.ts +7 -0
- package/dist/runner/launchd.d.ts.map +1 -0
- package/dist/runner/launchd.js +78 -0
- package/dist/runner/launchd.js.map +1 -0
- package/dist/runner/message.d.ts +66 -0
- package/dist/runner/message.d.ts.map +1 -0
- package/dist/runner/message.js +181 -0
- package/dist/runner/message.js.map +1 -0
- package/dist/runner/modules.d.ts +13 -0
- package/dist/runner/modules.d.ts.map +1 -0
- package/dist/runner/modules.js +30 -0
- package/dist/runner/modules.js.map +1 -0
- package/dist/runner/process.d.ts +7 -0
- package/dist/runner/process.d.ts.map +1 -0
- package/dist/runner/process.js +65 -0
- package/dist/runner/process.js.map +1 -0
- package/dist/runner/redact.d.ts +48 -0
- package/dist/runner/redact.d.ts.map +1 -0
- package/dist/runner/redact.js +214 -0
- package/dist/runner/redact.js.map +1 -0
- package/dist/runner/registry.d.ts +37 -0
- package/dist/runner/registry.d.ts.map +1 -0
- package/dist/runner/registry.js +26 -0
- package/dist/runner/registry.js.map +1 -0
- package/dist/runner/runner.d.ts +130 -0
- package/dist/runner/runner.d.ts.map +1 -0
- package/dist/runner/runner.js +1551 -0
- package/dist/runner/runner.js.map +1 -0
- package/dist/runner/slack.d.ts +16 -0
- package/dist/runner/slack.d.ts.map +1 -0
- package/dist/runner/slack.js +157 -0
- package/dist/runner/slack.js.map +1 -0
- package/dist/runner/systemd-user.d.ts +7 -0
- package/dist/runner/systemd-user.d.ts.map +1 -0
- package/dist/runner/systemd-user.js +93 -0
- package/dist/runner/systemd-user.js.map +1 -0
- package/dist/runner/task-scheduler.d.ts +38 -0
- package/dist/runner/task-scheduler.d.ts.map +1 -0
- package/dist/runner/task-scheduler.js +216 -0
- package/dist/runner/task-scheduler.js.map +1 -0
- package/dist/runner/types.d.ts +315 -0
- package/dist/runner/types.d.ts.map +1 -0
- package/dist/runner/types.js +24 -0
- package/dist/runner/types.js.map +1 -0
- package/dist/runner.d.ts +18 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +20 -0
- package/dist/runner.js.map +1 -0
- package/dist/schemas.d.ts +6082 -1295
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +930 -31
- package/dist/schemas.js.map +1 -1
- package/dist/services.d.ts +110 -0
- package/dist/services.d.ts.map +1 -0
- package/dist/services.js +305 -0
- package/dist/services.js.map +1 -0
- package/dist/setup-guide.d.ts +64 -0
- package/dist/setup-guide.d.ts.map +1 -0
- package/dist/setup-guide.js +256 -0
- package/dist/setup-guide.js.map +1 -0
- package/dist/setup-page.d.ts +6 -0
- package/dist/setup-page.d.ts.map +1 -0
- package/dist/setup-page.js +29 -0
- package/dist/setup-page.js.map +1 -0
- package/dist/sse.d.ts +15 -0
- package/dist/sse.d.ts.map +1 -0
- package/dist/sse.js +73 -0
- package/dist/sse.js.map +1 -0
- package/dist/tab-title.d.ts +6 -0
- package/dist/tab-title.d.ts.map +1 -0
- package/dist/tab-title.js +22 -0
- package/dist/tab-title.js.map +1 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +3 -0
- package/dist/tokens.js.map +1 -1
- package/dist/use-action.d.ts +5 -2
- package/dist/use-action.d.ts.map +1 -1
- package/dist/use-action.js +6 -1
- package/dist/use-action.js.map +1 -1
- package/dist/vocabulary.d.ts +84 -4
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +115 -3
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +147 -41
- package/docs/specs/plugins.md +37 -27
- package/docs/specs/records.md +113 -0
- package/docs/specs/rest.md +155 -20
- package/docs/specs/runner.md +347 -0
- package/package.json +12 -3
- package/skills/building-a-console/SKILL.md +4 -4
- package/skills/building-a-console/references/configuring.md +1 -0
- package/skills/building-a-plugin/SKILL.md +7 -7
- package/skills/deploying-a-console/SKILL.md +4 -4
- package/skills/deploying-a-console/references/resources.md +48 -8
- package/skills/deploying-a-console/references/running-it-again.md +3 -2
- package/skills/keeping-a-desk/SKILL.md +133 -0
- package/skills/keeping-a-desk/collections.md +96 -0
- package/skills/planning-the-board/SKILL.md +14 -18
- package/skills/planning-the-board/references/a-task.md +2 -2
- package/skills/planning-the-board/references/project-rules.md +13 -14
- package/skills/planning-the-board/references/setting-up.md +22 -9
- package/skills/running-an-agent/SKILL.md +107 -0
- package/skills/running-an-agent/references/slack-app.md +61 -0
- package/skills/working-the-board/SKILL.md +66 -39
- package/skills/working-the-board/references/terms.md +9 -5
- package/skills/working-the-board/references/the-pack.md +14 -9
- package/skills/working-the-board/references/the-sentence.md +2 -2
- package/src/agent-page.tsx +1039 -0
- package/src/agent-stream.ts +199 -0
- package/src/api.ts +317 -2
- package/src/avatar.ts +1506 -0
- package/src/charts.ts +250 -0
- package/src/cli/cli.ts +3210 -503
- package/src/cli/command-words.ts +56 -0
- package/src/cli/credentials.ts +188 -16
- package/src/cli/directory.ts +28 -10
- package/src/cli/format.ts +470 -67
- package/src/cli/help.ts +233 -61
- package/src/cli/main.ts +89 -0
- package/src/cli/pack.ts +332 -263
- package/src/cli/plugin-check.ts +275 -34
- package/src/cli/plugin-cli.ts +28 -4
- package/src/cli/plugin-main.ts +1 -0
- package/src/cli/runner-host.ts +188 -0
- package/src/cli/serve.ts +320 -5
- package/src/cli/setup-machine.ts +153 -0
- package/src/client.ts +711 -126
- package/src/compat.ts +2 -2
- package/src/components/agent-page.tsx +1946 -0
- package/src/components/agents.tsx +638 -0
- package/src/components/calendar.tsx +74 -53
- package/src/components/charts.tsx +680 -0
- package/src/components/comments.tsx +3 -0
- package/src/components/connect.tsx +37 -2
- package/src/components/decision-form.tsx +89 -51
- package/src/components/decision-list.tsx +140 -4
- package/src/components/desk-records.tsx +724 -0
- package/src/components/desk.tsx +471 -0
- package/src/components/event-feed.tsx +30 -1
- package/src/components/home.tsx +353 -12
- package/src/components/my-decisions.tsx +8 -2
- package/src/components/people.tsx +300 -203
- package/src/components/picker.tsx +3 -1
- package/src/components/pictures.tsx +256 -44
- package/src/components/plugin-events.ts +159 -0
- package/src/components/plugin-frame.tsx +14 -38
- package/src/components/plugin-settings.tsx +178 -22
- package/src/components/projects.tsx +33 -15
- package/src/components/rules.tsx +96 -36
- package/src/components/sessions.tsx +7 -4
- package/src/components/setup.tsx +252 -0
- package/src/components/sign-in.tsx +1 -1
- package/src/components/task-form.tsx +11 -2
- package/src/components/task-list.tsx +7 -6
- package/src/components/task-view.tsx +4 -0
- package/src/components/ui.tsx +169 -25
- package/src/components/work.tsx +9 -9
- package/src/components/workspace.tsx +345 -4
- package/src/connect-page.tsx +15 -2
- package/src/console.tsx +657 -83
- package/src/data.ts +109 -43
- package/src/desk-page.tsx +332 -0
- package/src/desk-records-page.tsx +256 -0
- package/src/desk-records.ts +808 -0
- package/src/desk.ts +329 -0
- package/src/feed-stream.ts +144 -0
- package/src/glances.ts +132 -0
- package/src/home-tiles.ts +411 -9
- package/src/i18n/en.ts +828 -10
- package/src/i18n/ko.ts +792 -10
- package/src/index.ts +172 -3
- package/src/limits.ts +67 -0
- package/src/onboarding.ts +84 -0
- package/src/persona.ts +100 -0
- package/src/plugin/context.ts +55 -12
- package/src/plugin/limits.ts +2 -0
- package/src/plugin/manifest.ts +42 -3
- package/src/plugin/rest-schemas.ts +46 -0
- package/src/plugin/sandbox.ts +4 -1
- package/src/plugin/testing.ts +63 -12
- package/src/plugin.ts +2 -0
- package/src/records.ts +702 -0
- package/src/router.ts +120 -10
- package/src/routes.ts +17 -1
- package/src/rules.ts +109 -44
- package/src/runner/acp.ts +1267 -0
- package/src/runner/claude.ts +695 -0
- package/src/runner/codex.ts +691 -0
- package/src/runner/config.ts +97 -0
- package/src/runner/desk.ts +377 -0
- package/src/runner/launchd.ts +86 -0
- package/src/runner/message.ts +232 -0
- package/src/runner/modules.ts +30 -0
- package/src/runner/process.ts +72 -0
- package/src/runner/redact.ts +242 -0
- package/src/runner/registry.ts +67 -0
- package/src/runner/runner.ts +1879 -0
- package/src/runner/slack.ts +180 -0
- package/src/runner/systemd-user.ts +103 -0
- package/src/runner/task-scheduler.ts +236 -0
- package/src/runner/types.ts +334 -0
- package/src/runner.ts +110 -0
- package/src/schemas.ts +1183 -30
- package/src/services.ts +424 -0
- package/src/setup-guide.ts +336 -0
- package/src/setup-page.tsx +46 -0
- package/src/sse.ts +84 -0
- package/src/styles/README.md +111 -0
- package/src/styles/base.css +130 -0
- package/src/styles/console.css +85 -7095
- package/src/styles/drawn-by-pages.json +256 -0
- package/src/styles/pages/agents.css +1195 -0
- package/src/styles/pages/board.css +380 -0
- package/src/styles/pages/calendar.css +214 -0
- package/src/styles/pages/connect.css +182 -0
- package/src/styles/pages/decisions.css +370 -0
- package/src/styles/pages/desk.css +126 -0
- package/src/styles/pages/documents.css +273 -0
- package/src/styles/pages/feed.css +118 -0
- package/src/styles/pages/home.css +718 -0
- package/src/styles/pages/people.css +90 -0
- package/src/styles/pages/plugins.css +212 -0
- package/src/styles/pages/roadmap.css +377 -0
- package/src/styles/pages/settings.css +171 -0
- package/src/styles/pages/shell.css +208 -0
- package/src/styles/pages/sign-in.css +178 -0
- package/src/styles/pages/task.css +108 -0
- package/src/styles/pages/thread.css +331 -0
- package/src/styles/pages/work.css +68 -0
- package/src/styles/parts/avatar.css +82 -0
- package/src/styles/parts/badge.css +227 -0
- package/src/styles/parts/bars.css +80 -0
- package/src/styles/parts/button.css +99 -0
- package/src/styles/parts/calendar.css +547 -0
- package/src/styles/parts/callout.css +41 -0
- package/src/styles/parts/category.css +8 -0
- package/src/styles/parts/chart.css +173 -0
- package/src/styles/parts/chip.css +90 -0
- package/src/styles/parts/code.css +48 -0
- package/src/styles/parts/count.css +27 -0
- package/src/styles/parts/crumbs.css +61 -0
- package/src/styles/parts/detail.css +110 -0
- package/src/styles/parts/empty.css +21 -0
- package/src/styles/parts/eyebrow.css +9 -0
- package/src/styles/parts/facts.css +147 -0
- package/src/styles/parts/figures.css +65 -0
- package/src/styles/parts/files.css +38 -0
- package/src/styles/parts/filters.css +42 -0
- package/src/styles/parts/form.css +109 -0
- package/src/styles/parts/frame.css +45 -0
- package/src/styles/parts/input.css +243 -0
- package/src/styles/parts/legend.css +48 -0
- package/src/styles/parts/links.css +37 -0
- package/src/styles/parts/mark.css +79 -0
- package/src/styles/parts/menu.css +147 -0
- package/src/styles/parts/page.css +174 -0
- package/src/styles/parts/pager.css +19 -0
- package/src/styles/parts/panel.css +33 -0
- package/src/styles/parts/person.css +257 -0
- package/src/styles/parts/picker.css +185 -0
- package/src/styles/parts/progress.css +25 -0
- package/src/styles/parts/prose.css +128 -0
- package/src/styles/parts/rows.css +63 -0
- package/src/styles/parts/series.css +32 -0
- package/src/styles/parts/settings.css +101 -0
- package/src/styles/parts/share.css +25 -0
- package/src/styles/parts/spark.css +23 -0
- package/src/styles/parts/spinner.css +29 -0
- package/src/styles/parts/stat.css +69 -0
- package/src/styles/parts/steps.css +68 -0
- package/src/styles/parts/tabs.css +175 -0
- package/src/styles/parts/text.css +61 -0
- package/src/styles/parts/toggle.css +71 -0
- package/src/styles/parts/workers.css +37 -0
- package/src/styles/tokens.css +295 -0
- package/src/tab-title.ts +25 -0
- package/src/tokens.ts +3 -0
- package/src/use-action.ts +7 -2
- package/src/vocabulary.ts +151 -3
- package/template/desk-web/README.md +8 -0
- package/template/desk-web/index.html +13 -0
- package/template/desk-web/package.json +25 -0
- package/template/desk-web/src/main.tsx +24 -0
- package/template/desk-web/src/page.tsx +51 -0
- package/template/desk-web/tsconfig.json +16 -0
- package/template/desk-web/vite.config.ts +15 -0
package/src/data.ts
CHANGED
|
@@ -4,10 +4,12 @@ import {
|
|
|
4
4
|
type CommentInput,
|
|
5
5
|
type ConsoleClient,
|
|
6
6
|
type DocumentFilter,
|
|
7
|
-
EVENT_KINDS,
|
|
8
7
|
type FileUpload,
|
|
9
8
|
LIST_LIMIT,
|
|
10
9
|
type ProjectClient,
|
|
10
|
+
type RestAgent,
|
|
11
|
+
type RestAgentInput,
|
|
12
|
+
type RestAgentProposals,
|
|
11
13
|
type RestAnswerInput,
|
|
12
14
|
type RestCategory,
|
|
13
15
|
type RestCategoryInput,
|
|
@@ -39,6 +41,7 @@ import {
|
|
|
39
41
|
type RestPerson,
|
|
40
42
|
type RestPersonPatch,
|
|
41
43
|
type RestPersonWork,
|
|
44
|
+
type RestPersonWorkBrief,
|
|
42
45
|
type RestPlugin,
|
|
43
46
|
type RestProject,
|
|
44
47
|
type RestProjectInput,
|
|
@@ -65,11 +68,12 @@ import {
|
|
|
65
68
|
type RestVersion,
|
|
66
69
|
type RestVersions,
|
|
67
70
|
type RestWork,
|
|
71
|
+
type RestWorkBrief,
|
|
68
72
|
type RestWorkspace,
|
|
69
73
|
type RestWorkspacePackConnect,
|
|
70
74
|
type RestWorkspacePatch,
|
|
71
|
-
restEventSchema,
|
|
72
75
|
} from "./api.js";
|
|
76
|
+
import { followFeed, whileFeedSettles } from "./feed-stream.js";
|
|
73
77
|
|
|
74
78
|
// What the console shows, and how it stays current: the workspace (who is signed in, the
|
|
75
79
|
// projects, the people, the tokens) is loaded once; the project the page is on is loaded whole,
|
|
@@ -84,6 +88,11 @@ const FEED_MAX_PAGES = 20;
|
|
|
84
88
|
const RELOAD_DELAY_MS = 150;
|
|
85
89
|
|
|
86
90
|
export interface ConsoleActions {
|
|
91
|
+
/**
|
|
92
|
+
* Reads the projects again and nothing else of the workspace: what the front page asks each
|
|
93
|
+
* time it is shown, so that what waits in each project is what waits now (ADR-0107).
|
|
94
|
+
*/
|
|
95
|
+
refreshProjects(): Promise<void>;
|
|
87
96
|
/** Makes a project, whose owner the person becomes, with an image for its mark when one is given. */
|
|
88
97
|
createProject(input: RestProjectInput, icon?: FileUpload): Promise<RestProject>;
|
|
89
98
|
/** Changes the settings of the project the page is on; for an owner. */
|
|
@@ -137,11 +146,23 @@ export interface ConsoleActions {
|
|
|
137
146
|
answerDecisionIn(projectKey: string, id: string, input: RestAnswerInput): Promise<RestDecision>;
|
|
138
147
|
/** Grows a decision's record: its context, or what followed. */
|
|
139
148
|
updateDecision(id: string, patch: RestDecisionPatch): Promise<RestDecision>;
|
|
149
|
+
/** Addresses a decision that waits anew (ADR-0096): the people named, by id, take the place of those it was for. */
|
|
150
|
+
addressDecision(id: string, deciderIds: readonly string[]): Promise<RestDecision>;
|
|
151
|
+
/** The same for a decision of any project the person may work in, by its project's key: for the person's own page of decisions. */
|
|
152
|
+
addressDecisionIn(
|
|
153
|
+
projectKey: string,
|
|
154
|
+
id: string,
|
|
155
|
+
deciderIds: readonly string[],
|
|
156
|
+
): Promise<RestDecision>;
|
|
157
|
+
/** Who may be named on a decision of a project, by its key: its members, read when a page of several projects asks. */
|
|
158
|
+
membersOf(projectKey: string, signal?: AbortSignal): Promise<readonly RestPerson[]>;
|
|
140
159
|
/** Sets a goal on the roadmap of the project the page is on; for an owner. */
|
|
141
160
|
createGoal(input: RestGoalInput): Promise<RestGoal>;
|
|
142
161
|
updateGoal(id: string, patch: RestGoalPatch): Promise<RestGoal>;
|
|
143
162
|
/** What is on the person's plate across their projects, read when the page asks. */
|
|
144
163
|
work(signal?: AbortSignal): Promise<RestWork>;
|
|
164
|
+
/** The plate as its page shows it: without the bodies of the tasks and the decisions. */
|
|
165
|
+
plate(signal?: AbortSignal): Promise<RestWorkBrief>;
|
|
145
166
|
/** The decisions addressed to the person (ADR-0042) across their projects, a page at a time, read when the page asks. */
|
|
146
167
|
myDecisions(
|
|
147
168
|
filter: {
|
|
@@ -180,6 +201,10 @@ export interface ConsoleActions {
|
|
|
180
201
|
updatePerson(id: string, patch: RestPersonPatch): Promise<RestPerson>;
|
|
181
202
|
/** Lets a login in (ADR-0022); for an administrator. */
|
|
182
203
|
createListing(input: RestListingInput): Promise<RestListing>;
|
|
204
|
+
/** Makes an agent account (ADR-0084); for an administrator. The people and the accounts are read again. */
|
|
205
|
+
createAgent(input: RestAgentInput): Promise<RestAgent>;
|
|
206
|
+
/** A few personas to choose from, a name in `lang` each; for an administrator. */
|
|
207
|
+
agentProposals(count: number, lang: string, signal?: AbortSignal): Promise<RestAgentProposals>;
|
|
183
208
|
/** Takes a listing away that nobody signed in with; for an administrator. */
|
|
184
209
|
removeListing(id: string): Promise<void>;
|
|
185
210
|
/** The teams (ADR-0073): made, renamed and removed, a person put in or taken out; for an administrator. */
|
|
@@ -227,6 +252,8 @@ export interface ConsoleActions {
|
|
|
227
252
|
refreshPlugins(): Promise<void>;
|
|
228
253
|
/** Another person's plate: for an administrator, or an owner of a project they are in. */
|
|
229
254
|
personWork(personId: string, signal?: AbortSignal): Promise<RestPersonWork>;
|
|
255
|
+
/** Another person's plate as its page shows it: without the tasks' bodies. */
|
|
256
|
+
personPlate(personId: string, signal?: AbortSignal): Promise<RestPersonWorkBrief>;
|
|
230
257
|
/** The tokens of another person, and the way to take one away: for an administrator. */
|
|
231
258
|
personTokens(personId: string, signal?: AbortSignal): Promise<RestTokens>;
|
|
232
259
|
revokePersonToken(personId: string, tokenId: string): Promise<void>;
|
|
@@ -250,6 +277,8 @@ export interface ConsoleData {
|
|
|
250
277
|
readonly listed: readonly RestListing[];
|
|
251
278
|
/** The teams of the workspace (ADR-0073), by name, each with the members the person may see. */
|
|
252
279
|
readonly teams: readonly RestTeam[];
|
|
280
|
+
/** The agent accounts the person sees or supervises (ADR-0084), by handle. */
|
|
281
|
+
readonly agents: readonly RestAgent[];
|
|
253
282
|
/** The organization at the git host that says who is in, where the deployment names one. */
|
|
254
283
|
readonly organization: RestOrganization | null;
|
|
255
284
|
/** The categories tasks are sorted into, by name. */
|
|
@@ -295,7 +324,11 @@ async function readFeed(
|
|
|
295
324
|
key: string,
|
|
296
325
|
signal: AbortSignal,
|
|
297
326
|
): Promise<RestEvent[]> {
|
|
298
|
-
|
|
327
|
+
// Asked again where the console cannot say yet where the feed stands: never begun from nothing.
|
|
328
|
+
const result = await whileFeedSettles(
|
|
329
|
+
() => client.project(key).events(0, { latest: true }, signal),
|
|
330
|
+
{ signal },
|
|
331
|
+
);
|
|
299
332
|
return result.items.slice(-FEED_KEEP);
|
|
300
333
|
}
|
|
301
334
|
|
|
@@ -389,6 +422,7 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
389
422
|
const [people, setPeople] = useState<readonly RestPerson[]>([]);
|
|
390
423
|
const [listed, setListed] = useState<readonly RestListing[]>([]);
|
|
391
424
|
const [teams, setTeams] = useState<readonly RestTeam[]>([]);
|
|
425
|
+
const [agents, setAgents] = useState<readonly RestAgent[]>([]);
|
|
392
426
|
const [organization, setOrganization] = useState<RestOrganization | null>(null);
|
|
393
427
|
const [categories, setCategories] = useState<readonly RestCategory[]>([]);
|
|
394
428
|
const [plugins, setPlugins] = useState<readonly RestPlugin[]>([]);
|
|
@@ -428,15 +462,18 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
428
462
|
/** Loads the workspace's lists again. What fails stays as it was. */
|
|
429
463
|
const refreshWorkspace = useCallback(
|
|
430
464
|
async (signal?: AbortSignal) => {
|
|
431
|
-
const [nextProjects, nextPeople, nextCategories, nextPlugins, nextTeams] =
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
465
|
+
const [nextProjects, nextPeople, nextCategories, nextPlugins, nextTeams, nextAgents] =
|
|
466
|
+
await Promise.all([
|
|
467
|
+
client.projects(signal),
|
|
468
|
+
client.people(signal),
|
|
469
|
+
client.categories(signal),
|
|
470
|
+
// A console without plugins answers none; one older than them answers nothing, which is none too.
|
|
471
|
+
client.plugins(signal).catch(() => ({ items: [], sql: false })),
|
|
472
|
+
// A console older than teams (ADR-0073) answers nothing, which is no team.
|
|
473
|
+
client.teams(signal).catch(() => ({ items: [] })),
|
|
474
|
+
// And one older than agent accounts (ADR-0084), no agent account.
|
|
475
|
+
client.agents(signal).catch(() => ({ items: [] })),
|
|
476
|
+
]);
|
|
440
477
|
if (signal?.aborted === true) {
|
|
441
478
|
return;
|
|
442
479
|
}
|
|
@@ -444,6 +481,7 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
444
481
|
setPeople(nextPeople.items);
|
|
445
482
|
setListed(nextPeople.listed);
|
|
446
483
|
setTeams(nextTeams.items);
|
|
484
|
+
setAgents(nextAgents.items);
|
|
447
485
|
setOrganization(nextPeople.organization);
|
|
448
486
|
setCategories(nextCategories.items);
|
|
449
487
|
setPlugins(nextPlugins.items);
|
|
@@ -573,7 +611,7 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
573
611
|
}
|
|
574
612
|
const controller = new AbortController();
|
|
575
613
|
const { signal } = controller;
|
|
576
|
-
let
|
|
614
|
+
let unfollow: (() => void) | undefined;
|
|
577
615
|
let reloadTimer: ReturnType<typeof setTimeout> | undefined;
|
|
578
616
|
const scope = client.project(projectKey);
|
|
579
617
|
const run = async () => {
|
|
@@ -618,42 +656,38 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
618
656
|
});
|
|
619
657
|
}
|
|
620
658
|
});
|
|
621
|
-
|
|
659
|
+
// The stream begins after the feed read, and is opened again from the last event that
|
|
660
|
+
// arrived when the browser gives it up, while the console restarts say (`feed-stream.ts`).
|
|
661
|
+
if (signal.aborted) {
|
|
622
662
|
return;
|
|
623
663
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
}
|
|
646
|
-
}, RELOAD_DELAY_MS);
|
|
647
|
-
};
|
|
648
|
-
for (const kind of EVENT_KINDS) {
|
|
649
|
-
source.addEventListener(kind, arrived);
|
|
650
|
-
}
|
|
664
|
+
unfollow = followFeed({
|
|
665
|
+
url: (after) => scope.eventStreamUrl(after),
|
|
666
|
+
after: lastEvent.current,
|
|
667
|
+
onLive: setLive,
|
|
668
|
+
onEvent: (event) => {
|
|
669
|
+
lastEvent.current = event.id;
|
|
670
|
+
setEvents((current) => [...current, event].slice(-FEED_KEEP));
|
|
671
|
+
clearTimeout(reloadTimer);
|
|
672
|
+
reloadTimer = setTimeout(() => {
|
|
673
|
+
refreshProject(signal).catch(() => undefined);
|
|
674
|
+
if (event.kind.startsWith("project.")) {
|
|
675
|
+
refreshWorkspace(signal).catch(() => undefined);
|
|
676
|
+
}
|
|
677
|
+
// A decision raised or answered here may be one of the person's own: the count
|
|
678
|
+
// beside My decisions follows it.
|
|
679
|
+
if (event.kind.startsWith("decision.")) {
|
|
680
|
+
refreshMe(signal).catch(() => undefined);
|
|
681
|
+
}
|
|
682
|
+
}, RELOAD_DELAY_MS);
|
|
683
|
+
},
|
|
684
|
+
});
|
|
651
685
|
};
|
|
652
686
|
void run();
|
|
653
687
|
return () => {
|
|
654
688
|
controller.abort();
|
|
655
689
|
clearTimeout(reloadTimer);
|
|
656
|
-
|
|
690
|
+
unfollow?.();
|
|
657
691
|
setLive(false);
|
|
658
692
|
};
|
|
659
693
|
}, [client, projectKey, signedIn, generation, refreshProject, refreshWorkspace, refreshMe]);
|
|
@@ -667,6 +701,10 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
667
701
|
return client.project(projectKey);
|
|
668
702
|
};
|
|
669
703
|
return {
|
|
704
|
+
async refreshProjects() {
|
|
705
|
+
const answer = await client.projects();
|
|
706
|
+
setProjects(answer.items);
|
|
707
|
+
},
|
|
670
708
|
async createProject(input, icon) {
|
|
671
709
|
const made = await client.createProject(input);
|
|
672
710
|
const marked = icon === undefined ? made : await client.project(made.key).setIcon(icon);
|
|
@@ -778,6 +816,21 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
778
816
|
);
|
|
779
817
|
return decision;
|
|
780
818
|
},
|
|
819
|
+
async addressDecision(id, deciderIds) {
|
|
820
|
+
const decision = await scope().addressDecision(id, deciderIds);
|
|
821
|
+
setDecisions((current) =>
|
|
822
|
+
current.map((candidate) => (candidate.id === id ? decision : candidate)),
|
|
823
|
+
);
|
|
824
|
+
await refreshMe().catch(() => undefined);
|
|
825
|
+
return decision;
|
|
826
|
+
},
|
|
827
|
+
async addressDecisionIn(projectKey, id, deciderIds) {
|
|
828
|
+
const decision = await client.project(projectKey).addressDecision(id, deciderIds);
|
|
829
|
+
await refreshMe().catch(() => undefined);
|
|
830
|
+
return decision;
|
|
831
|
+
},
|
|
832
|
+
membersOf: async (projectKey, signal) =>
|
|
833
|
+
(await client.project(projectKey).members(signal)).items.map((member) => member.person),
|
|
781
834
|
async createGoal(input) {
|
|
782
835
|
const goal = await scope().createGoal(input);
|
|
783
836
|
await refreshProject();
|
|
@@ -789,6 +842,7 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
789
842
|
return goal;
|
|
790
843
|
},
|
|
791
844
|
work: (signal) => client.work(signal),
|
|
845
|
+
plate: (signal) => client.plate(signal),
|
|
792
846
|
myDecisions: (filter, signal) => client.myDecisions(filter, signal),
|
|
793
847
|
reachDecision: (id, signal) => client.decision(id, signal),
|
|
794
848
|
async answerReachedDecision(id, input) {
|
|
@@ -824,6 +878,12 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
824
878
|
await refreshWorkspace();
|
|
825
879
|
return person;
|
|
826
880
|
},
|
|
881
|
+
async createAgent(input) {
|
|
882
|
+
const agent = await client.createAgent(input);
|
|
883
|
+
await refreshWorkspace();
|
|
884
|
+
return agent;
|
|
885
|
+
},
|
|
886
|
+
agentProposals: (count, lang, signal) => client.agentProposals({ count, lang }, signal),
|
|
827
887
|
async createListing(input) {
|
|
828
888
|
const listing = await client.createListing(input);
|
|
829
889
|
await refreshWorkspace();
|
|
@@ -903,7 +963,11 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
903
963
|
const history: RestEvent[] = [];
|
|
904
964
|
let after = 0;
|
|
905
965
|
for (let page = 0; page < FEED_MAX_PAGES; page += 1) {
|
|
906
|
-
const
|
|
966
|
+
const from = after;
|
|
967
|
+
const result = await whileFeedSettles(
|
|
968
|
+
() => scope().events(from, { task: taskId }, signal),
|
|
969
|
+
{ signal },
|
|
970
|
+
);
|
|
907
971
|
history.push(...result.items);
|
|
908
972
|
after = result.items.at(-1)?.id ?? after;
|
|
909
973
|
if (!result.more) {
|
|
@@ -934,6 +998,7 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
934
998
|
approveConnection: (code, input) => client.approveConnection(code, input),
|
|
935
999
|
denyConnection: (code) => client.denyConnection(code),
|
|
936
1000
|
personWork: (personId, signal) => client.personWork(personId, signal),
|
|
1001
|
+
personPlate: (personId, signal) => client.personPlate(personId, signal),
|
|
937
1002
|
personTokens: (personId, signal) => client.personTokens(personId, signal),
|
|
938
1003
|
revokePersonToken: (personId, tokenId) => client.revokePersonToken(personId, tokenId),
|
|
939
1004
|
async signOut() {
|
|
@@ -953,6 +1018,7 @@ export function useConsoleData(client: ConsoleClient, projectKey: string | undef
|
|
|
953
1018
|
people,
|
|
954
1019
|
listed,
|
|
955
1020
|
teams,
|
|
1021
|
+
agents,
|
|
956
1022
|
organization,
|
|
957
1023
|
categories,
|
|
958
1024
|
plugins,
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { useEffect, useMemo, useState } from "react";
|
|
2
|
+
import type { RestWorkBrief } from "./api.js";
|
|
3
|
+
import type { ConsoleClient } from "./client.js";
|
|
4
|
+
import {
|
|
5
|
+
DESK_VIEWS,
|
|
6
|
+
DeskArchive,
|
|
7
|
+
DeskFiguresView,
|
|
8
|
+
DeskStanding,
|
|
9
|
+
type DeskView,
|
|
10
|
+
DeskViews,
|
|
11
|
+
} from "./components/desk.js";
|
|
12
|
+
import { Callout, EmptyState, Spinner } from "./components/ui.js";
|
|
13
|
+
import type { CustomPage } from "./console.js";
|
|
14
|
+
import type { ConsoleData } from "./data.js";
|
|
15
|
+
import { deviceLanguage, firstDayOfWeek, today as todayOf } from "./dates.js";
|
|
16
|
+
import {
|
|
17
|
+
DESK_RUNS,
|
|
18
|
+
DESK_TASKS,
|
|
19
|
+
type DeskHistory,
|
|
20
|
+
type DeskProject,
|
|
21
|
+
type DeskRun,
|
|
22
|
+
figuresOf,
|
|
23
|
+
readHistory,
|
|
24
|
+
readOpenRuns,
|
|
25
|
+
withHistory,
|
|
26
|
+
} from "./desk.js";
|
|
27
|
+
import type { RecordsReader } from "./desk-records.js";
|
|
28
|
+
import { DeskRecords } from "./desk-records-page.js";
|
|
29
|
+
import { DEFAULT_LANGUAGES, useLanguage, useWords } from "./i18n/index.js";
|
|
30
|
+
import { customPageHref, decisionHref, type Navigation, taskHref } from "./router.js";
|
|
31
|
+
import { errorWords } from "./use-action.js";
|
|
32
|
+
|
|
33
|
+
// The page of a desk (ADR-0116, ADR-0117): one page of a console of a member's own, the
|
|
34
|
+
// member's own extension of the console's pages. It comes with the records' view, what the
|
|
35
|
+
// member made and what became of it, read from the desk's own files; beside it stand three
|
|
36
|
+
// views of the member's work on the board, read through the client when one is looked at: what
|
|
37
|
+
// stands now from the plate and the open runs, the figures and the archive from a bounded page
|
|
38
|
+
// of each project's closed tasks and ended runs. The address says which view, and what it
|
|
39
|
+
// shows (ADR-0010).
|
|
40
|
+
|
|
41
|
+
/** What the address of a desk's page says: its view, the records' where it names none, and the words the board's archive is found by. */
|
|
42
|
+
export function deskViewOf(search: string): { readonly view: DeskView; readonly words: string } {
|
|
43
|
+
const params = new URLSearchParams(search);
|
|
44
|
+
const named = params.get("view");
|
|
45
|
+
return {
|
|
46
|
+
view: DESK_VIEWS.find((view) => view === named) ?? "records",
|
|
47
|
+
words: (params.get("q") ?? "").trim(),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Where a view of a desk's page is, from the page's own address; the board's archive with the words it is found by. */
|
|
52
|
+
export function deskHref(base: string, view: DeskView, words = ""): string {
|
|
53
|
+
const params = new URLSearchParams();
|
|
54
|
+
if (view !== "records") {
|
|
55
|
+
params.set("view", view);
|
|
56
|
+
}
|
|
57
|
+
if (view === "archive" && words.length > 0) {
|
|
58
|
+
params.set("q", words);
|
|
59
|
+
}
|
|
60
|
+
const query = params.toString();
|
|
61
|
+
return query.length === 0 ? base : `${base}?${query}`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface DeskPageProps {
|
|
65
|
+
readonly client: ConsoleClient;
|
|
66
|
+
/** The workspace as the console keeps it current: who looks, and the projects they may see. */
|
|
67
|
+
readonly data: Pick<ConsoleData, "me" | "projects">;
|
|
68
|
+
/** The query of the address the page is at. */
|
|
69
|
+
readonly search: string;
|
|
70
|
+
/** The page's own address, without a query. */
|
|
71
|
+
readonly href: string;
|
|
72
|
+
readonly navigation: Navigation;
|
|
73
|
+
/** What reads the desk's records; the page's own `fetch` at `/records` where left out. */
|
|
74
|
+
readonly records?: RecordsReader | undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** What stands now, as one visit read it. */
|
|
78
|
+
interface Standing {
|
|
79
|
+
readonly work: RestWorkBrief;
|
|
80
|
+
readonly runs: readonly DeskRun[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The closed work read so far for some words: the pages of it as one. */
|
|
84
|
+
interface Read {
|
|
85
|
+
readonly words: string;
|
|
86
|
+
readonly pages: number;
|
|
87
|
+
readonly history: DeskHistory;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function DeskPage(props: DeskPageProps) {
|
|
91
|
+
const pack = useWords();
|
|
92
|
+
const words = pack.desk;
|
|
93
|
+
const { tag } = useLanguage();
|
|
94
|
+
const { client, data, search, href, navigation } = props;
|
|
95
|
+
const { view, words: query } = deskViewOf(search);
|
|
96
|
+
const personId = data.me?.person?.id;
|
|
97
|
+
const weekStart = data.me?.workspace.weekStart;
|
|
98
|
+
// The projects by what a row says of each: a list read again that says the same is the same
|
|
99
|
+
// list here, so that nothing is read from the console a second time for it.
|
|
100
|
+
const listed = JSON.stringify(
|
|
101
|
+
data.projects.map((project) => [
|
|
102
|
+
project.key,
|
|
103
|
+
project.name,
|
|
104
|
+
project.color,
|
|
105
|
+
project.symbol,
|
|
106
|
+
project.icon ?? null,
|
|
107
|
+
]),
|
|
108
|
+
);
|
|
109
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: the list is held by what it says, not by the array that holds it
|
|
110
|
+
const projects = useMemo<readonly DeskProject[]>(
|
|
111
|
+
() =>
|
|
112
|
+
data.projects.map((project) => ({
|
|
113
|
+
key: project.key,
|
|
114
|
+
name: project.name,
|
|
115
|
+
color: project.color,
|
|
116
|
+
symbol: project.symbol,
|
|
117
|
+
icon: project.icon ?? null,
|
|
118
|
+
})),
|
|
119
|
+
[listed],
|
|
120
|
+
);
|
|
121
|
+
const [standing, setStanding] = useState<Standing | undefined>(undefined);
|
|
122
|
+
// Everything closed, which the figures count and the archive lists; and what words found.
|
|
123
|
+
const [whole, setWhole] = useState<Read | undefined>(undefined);
|
|
124
|
+
const [found, setFound] = useState<Read | undefined>(undefined);
|
|
125
|
+
const [busy, setBusy] = useState(false);
|
|
126
|
+
const [problem, setProblem] = useState<string | undefined>(undefined);
|
|
127
|
+
const couldNotLoad = words.couldNotLoad;
|
|
128
|
+
|
|
129
|
+
// What stands now is read each time the view is come to: the plate, then the open runs of
|
|
130
|
+
// the projects where a task of the plate says one is.
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (view !== "now" || personId === undefined) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const controller = new AbortController();
|
|
136
|
+
setProblem(undefined);
|
|
137
|
+
client
|
|
138
|
+
.plate(controller.signal)
|
|
139
|
+
.then(async (work) => ({
|
|
140
|
+
work,
|
|
141
|
+
runs: await readOpenRuns(client, { tasks: work.tasks, personId }, controller.signal),
|
|
142
|
+
}))
|
|
143
|
+
.then((read) => {
|
|
144
|
+
if (!controller.signal.aborted) {
|
|
145
|
+
setStanding(read);
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
.catch((failure: unknown) => {
|
|
149
|
+
if (!controller.signal.aborted) {
|
|
150
|
+
setProblem(errorWords(failure, couldNotLoad));
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
return () => controller.abort();
|
|
154
|
+
}, [client, view, personId, couldNotLoad]);
|
|
155
|
+
|
|
156
|
+
// The closed work is read each time a view that shows it is come to, or its words change:
|
|
157
|
+
// the first page of each project, for the figures everything, for the archive what the
|
|
158
|
+
// words find.
|
|
159
|
+
const wanted = view === "archive" ? query : "";
|
|
160
|
+
const reads = view === "figures" || view === "archive";
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (!reads || personId === undefined) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const controller = new AbortController();
|
|
166
|
+
setProblem(undefined);
|
|
167
|
+
setBusy(true);
|
|
168
|
+
readHistory(client, { projects, personId, words: wanted }, controller.signal)
|
|
169
|
+
.then((history) => {
|
|
170
|
+
if (!controller.signal.aborted) {
|
|
171
|
+
(wanted.length === 0 ? setWhole : setFound)({ words: wanted, pages: 1, history });
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
.catch((failure: unknown) => {
|
|
175
|
+
if (!controller.signal.aborted) {
|
|
176
|
+
setProblem(errorWords(failure, couldNotLoad));
|
|
177
|
+
}
|
|
178
|
+
})
|
|
179
|
+
.finally(() => {
|
|
180
|
+
if (!controller.signal.aborted) {
|
|
181
|
+
setBusy(false);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
return () => controller.abort();
|
|
185
|
+
}, [client, reads, wanted, personId, projects, couldNotLoad]);
|
|
186
|
+
|
|
187
|
+
if (personId === undefined) {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
const shown = wanted.length === 0 ? whole : found?.words === wanted ? found : undefined;
|
|
191
|
+
/** The next page of what is shown, joined to what was read. */
|
|
192
|
+
const onMore = () => {
|
|
193
|
+
if (shown === undefined || busy) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
setBusy(true);
|
|
197
|
+
readHistory(client, { projects, personId, words: shown.words, page: shown.pages })
|
|
198
|
+
.then((history) => {
|
|
199
|
+
const next = {
|
|
200
|
+
words: shown.words,
|
|
201
|
+
pages: shown.pages + 1,
|
|
202
|
+
history: withHistory(shown.history, history),
|
|
203
|
+
};
|
|
204
|
+
(shown.words.length === 0 ? setWhole : setFound)(next);
|
|
205
|
+
})
|
|
206
|
+
.catch((failure: unknown) => setProblem(errorWords(failure, couldNotLoad)))
|
|
207
|
+
.finally(() => setBusy(false));
|
|
208
|
+
};
|
|
209
|
+
// A run that ended on a task still open has its title on the plate, where the plate was read.
|
|
210
|
+
const open = new Map((standing?.work.tasks ?? []).map(({ task }) => [task.id, task.title]));
|
|
211
|
+
const named = (runs: readonly DeskRun[]): readonly DeskRun[] =>
|
|
212
|
+
runs.map((run) =>
|
|
213
|
+
run.title === undefined ? { ...run, title: open.get(run.run.taskId) } : run,
|
|
214
|
+
);
|
|
215
|
+
const now = todayOf();
|
|
216
|
+
const loading = (
|
|
217
|
+
<div className="sc-loading">
|
|
218
|
+
<Spinner label={words.loading} />
|
|
219
|
+
</div>
|
|
220
|
+
);
|
|
221
|
+
const narrowed =
|
|
222
|
+
shown !== undefined && shown.history.of > shown.history.read ? (
|
|
223
|
+
<p className="sc-muted">{words.projectsRead(shown.history.read, shown.history.of)}</p>
|
|
224
|
+
) : null;
|
|
225
|
+
return (
|
|
226
|
+
<>
|
|
227
|
+
<div className="sc-page-head">
|
|
228
|
+
<h1 className="sc-page-title">{words.title}</h1>
|
|
229
|
+
<p className="sc-page-lead">{words.lead}</p>
|
|
230
|
+
</div>
|
|
231
|
+
<DeskViews view={view} viewHref={(one) => deskHref(href, one)} />
|
|
232
|
+
{problem !== undefined && view !== "records" && <Callout tone="danger">{problem}</Callout>}
|
|
233
|
+
{view === "records" ? (
|
|
234
|
+
<DeskRecords
|
|
235
|
+
search={search}
|
|
236
|
+
href={href}
|
|
237
|
+
navigation={navigation}
|
|
238
|
+
reader={props.records}
|
|
239
|
+
weekStart={weekStart}
|
|
240
|
+
taskHref={taskHref}
|
|
241
|
+
/>
|
|
242
|
+
) : view === "now" ? (
|
|
243
|
+
standing === undefined ? (
|
|
244
|
+
problem === undefined && loading
|
|
245
|
+
) : standing.work.tasks.length === 0 &&
|
|
246
|
+
standing.work.decisions.length === 0 &&
|
|
247
|
+
standing.runs.length === 0 ? (
|
|
248
|
+
<EmptyState title={words.now.empty.title} body={words.now.empty.body} />
|
|
249
|
+
) : (
|
|
250
|
+
<DeskStanding
|
|
251
|
+
tasks={standing.work.tasks}
|
|
252
|
+
decisions={standing.work.decisions}
|
|
253
|
+
runs={standing.runs}
|
|
254
|
+
today={now}
|
|
255
|
+
taskHref={taskHref}
|
|
256
|
+
decisionHref={decisionHref}
|
|
257
|
+
/>
|
|
258
|
+
)
|
|
259
|
+
) : view === "figures" ? (
|
|
260
|
+
shown === undefined ? (
|
|
261
|
+
problem === undefined && loading
|
|
262
|
+
) : (
|
|
263
|
+
<>
|
|
264
|
+
<DeskFiguresView
|
|
265
|
+
figures={figuresOf({
|
|
266
|
+
tasks: shown.history.tasks,
|
|
267
|
+
runs: shown.history.runs,
|
|
268
|
+
today: now,
|
|
269
|
+
firstDay: firstDayOfWeek(deviceLanguage(tag), weekStart),
|
|
270
|
+
})}
|
|
271
|
+
partial={
|
|
272
|
+
shown.history.more
|
|
273
|
+
? { tasks: shown.pages * DESK_TASKS, runs: shown.pages * DESK_RUNS }
|
|
274
|
+
: undefined
|
|
275
|
+
}
|
|
276
|
+
/>
|
|
277
|
+
{narrowed}
|
|
278
|
+
</>
|
|
279
|
+
)
|
|
280
|
+
) : shown === undefined ? (
|
|
281
|
+
problem === undefined && loading
|
|
282
|
+
) : (
|
|
283
|
+
<>
|
|
284
|
+
<DeskArchive
|
|
285
|
+
// Keyed by the words, so that the field says the words the address does.
|
|
286
|
+
key={shown.words}
|
|
287
|
+
tasks={shown.history.tasks}
|
|
288
|
+
runs={named(shown.history.runs)}
|
|
289
|
+
query={shown.words}
|
|
290
|
+
busy={busy}
|
|
291
|
+
onSearch={(next) => navigation.go(deskHref(href, "archive", next))}
|
|
292
|
+
more={shown.history.more}
|
|
293
|
+
onMore={onMore}
|
|
294
|
+
taskHref={taskHref}
|
|
295
|
+
/>
|
|
296
|
+
{narrowed}
|
|
297
|
+
</>
|
|
298
|
+
)}
|
|
299
|
+
</>
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/** The key a desk's page has unless a console names another: its address is `/pages/desk`. */
|
|
304
|
+
export const DESK_PAGE_KEY = "desk";
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* A desk's page for a console of one's own: `createConsole({ pages: [deskPage()] })` adds it as
|
|
308
|
+
* a tab among the workspace's, at `/pages/<key>`. `records` says what reads the desk's records,
|
|
309
|
+
* where that is not the page's own `fetch` at `/records`.
|
|
310
|
+
*/
|
|
311
|
+
export function deskPage(
|
|
312
|
+
options: { readonly key?: string | undefined; readonly records?: RecordsReader | undefined } = {},
|
|
313
|
+
): CustomPage {
|
|
314
|
+
const key = options.key ?? DESK_PAGE_KEY;
|
|
315
|
+
return {
|
|
316
|
+
key,
|
|
317
|
+
label: Object.fromEntries(
|
|
318
|
+
DEFAULT_LANGUAGES.map((language) => [language.tag, language.messages.desk.tab]),
|
|
319
|
+
),
|
|
320
|
+
level: "workspace",
|
|
321
|
+
render: (context) => (
|
|
322
|
+
<DeskPage
|
|
323
|
+
client={context.client}
|
|
324
|
+
data={context.data}
|
|
325
|
+
search={context.search}
|
|
326
|
+
href={customPageHref(key)}
|
|
327
|
+
navigation={context.navigation}
|
|
328
|
+
records={options.records}
|
|
329
|
+
/>
|
|
330
|
+
),
|
|
331
|
+
};
|
|
332
|
+
}
|