@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/dist/console.js
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { StrictMode, useCallback, useEffect, useMemo, useState, } from "react";
|
|
2
|
+
import { StrictMode, useCallback, useEffect, useMemo, useRef, useState, } from "react";
|
|
3
3
|
import { createRoot } from "react-dom/client";
|
|
4
|
-
import {
|
|
4
|
+
import { AgentPage, AgentsNeedingYou } from "./agent-page.js";
|
|
5
|
+
import { ApiError, createClient, OPEN_TASK_STATES, PROJECT_RULES_TEMPLATE, RULES_PATH, RULES_TITLE, } from "./api.js";
|
|
6
|
+
import { AVATAR_SETS } from "./avatar.js";
|
|
7
|
+
import { AgentAccountForm, AgentAccountList, agentAccountGroups, } from "./components/agents.js";
|
|
5
8
|
import { Board, BoardFilters, byDue, filterTasks } from "./components/board.js";
|
|
6
9
|
import { Calendar, Workload } from "./components/calendar.js";
|
|
7
10
|
import { CategoryList } from "./components/categories.js";
|
|
8
11
|
import { ConnectWords } from "./components/connect.js";
|
|
9
12
|
import { DecisionForm } from "./components/decision-form.js";
|
|
10
|
-
import { DecisionCard, DecisionList } from "./components/decision-list.js";
|
|
13
|
+
import { DecisionCard, DecisionList, } from "./components/decision-list.js";
|
|
14
|
+
import { DeskWords } from "./components/desk.js";
|
|
11
15
|
import { EventFeed } from "./components/event-feed.js";
|
|
12
16
|
import { GoalForm, GoalList, GoalView, goalMonth } from "./components/goals.js";
|
|
13
17
|
import { HomeGrid } from "./components/home.js";
|
|
14
18
|
import { MyDecisions, ReachedDecision } from "./components/my-decisions.js";
|
|
15
19
|
import { PackTokenWays } from "./components/pack-token.js";
|
|
16
20
|
import { PAGE_SIZE } from "./components/paged.js";
|
|
17
|
-
import { ListingForm, PeopleList, TeamForm, TeamList, } from "./components/people.js";
|
|
21
|
+
import { ListingForm, PeopleList, supervisedBy, TeamForm, TeamList, } from "./components/people.js";
|
|
18
22
|
import { PluginFrame } from "./components/plugin-frame.js";
|
|
19
23
|
import { PluginSettingsList, PluginSettingsView } from "./components/plugin-settings.js";
|
|
20
24
|
import { MemberList, ProjectForm, ProjectMark, } from "./components/projects.js";
|
|
@@ -29,17 +33,21 @@ import { TaskForm } from "./components/task-form.js";
|
|
|
29
33
|
import { TaskList } from "./components/task-list.js";
|
|
30
34
|
import { TaskView } from "./components/task-view.js";
|
|
31
35
|
import { NewToken, TokenForm, TokenList } from "./components/tokens.js";
|
|
32
|
-
import { Button, Callout, CategoryBadge, cx, EmptyState, LinkButton, personName, Spinner, StateBadge, Time, } from "./components/ui.js";
|
|
36
|
+
import { AvatarSetsContext, Badge, Button, Callout, CategoryBadge, cx, EmptyState, LinkButton, personName, Spinner, StateBadge, Time, } from "./components/ui.js";
|
|
33
37
|
import { WorkList } from "./components/work.js";
|
|
34
|
-
import { peopleVisibilityOf, WorkspaceSettingsForm, WorkspaceSettingsView, weekStartOf, } from "./components/workspace.js";
|
|
38
|
+
import { peopleVisibilityOf, WorkspaceServicesForm, WorkspaceServicesView, WorkspaceSettingsForm, WorkspaceSettingsView, weekStartOf, } from "./components/workspace.js";
|
|
35
39
|
import { ConnectPage } from "./connect-page.js";
|
|
36
40
|
import { useConsoleData } from "./data.js";
|
|
37
41
|
import { monthOf, today } from "./dates.js";
|
|
38
42
|
import { DocsPage } from "./docs-page.js";
|
|
43
|
+
import { createGlanceReader } from "./glances.js";
|
|
39
44
|
import { browserPack, chooseLanguage, DEFAULT_LANGUAGES, LanguageContext, useWords, } from "./i18n/index.js";
|
|
45
|
+
import { proposeAgents } from "./persona.js";
|
|
40
46
|
import { pluginNavItems, pluginPagesAt, pluginWordOf } from "./plugin-nav.js";
|
|
41
|
-
import { boardHref, calendarHref, customPageHref, decisionHref, decisionsHref, docHref, goalHref, matchRoute, myDecisionHref, newDecisionHref, newGoalHref, newTaskHref, PATHS, personAgentsHref, personWorkHref, pluginHref, pluginSettingsHref, projectHref, projectSettingsHref, roadmapHref, settingsHref, signInFailureOf, taskHref, withoutSignInParam, workHref, } from "./router.js";
|
|
47
|
+
import { agentHref, agentsHref, agentWorkHref, boardHref, calendarHref, customPageHref, decisionHref, decisionsHref, docHref, goalHref, matchRoute, myDecisionHref, newDecisionHref, newGoalHref, newTaskHref, PATHS, personAgentsHref, personWorkHref, pluginHref, pluginSettingsHref, projectHref, projectSettingsHref, roadmapHref, settingsHref, signInFailureOf, taskHref, withoutSignInParam, workHref, } from "./router.js";
|
|
42
48
|
import { projectPath } from "./routes.js";
|
|
49
|
+
import { SetupPage } from "./setup-page.js";
|
|
50
|
+
import { currentTab, tabTitle } from "./tab-title.js";
|
|
43
51
|
import { errorWords, useAction } from "./use-action.js";
|
|
44
52
|
export const DEFAULT_COMPONENTS = {
|
|
45
53
|
Shell,
|
|
@@ -49,6 +57,8 @@ export const DEFAULT_COMPONENTS = {
|
|
|
49
57
|
EventFeed,
|
|
50
58
|
SignIn,
|
|
51
59
|
TokenList,
|
|
60
|
+
AgentAccountList,
|
|
61
|
+
AgentAccountForm,
|
|
52
62
|
SessionList,
|
|
53
63
|
PeopleList,
|
|
54
64
|
TeamList,
|
|
@@ -182,11 +192,13 @@ function Ground(props) {
|
|
|
182
192
|
return (_jsx("div", { className: "sc-shell", children: _jsx("main", { className: "sc-main", children: props.children }) }));
|
|
183
193
|
}
|
|
184
194
|
/**
|
|
185
|
-
* Whether the console holds a token rather than a session: a person's own console,
|
|
186
|
-
* their machine with
|
|
195
|
+
* Whether the console holds a token rather than a browser's session: a person's own console,
|
|
196
|
+
* served from their machine with what the command keeps (ADR-0014), a token or the command's own
|
|
197
|
+
* session (ADR-0084), which is held to what a token may ask. The API says so with `me.agent`,
|
|
198
|
+
* and with `me.session`.
|
|
187
199
|
*/
|
|
188
200
|
function holdsToken(data) {
|
|
189
|
-
return data.me !== undefined && data.me.agent !== null;
|
|
201
|
+
return data.me !== undefined && (data.me.agent !== null || data.me.session?.kind === "command");
|
|
190
202
|
}
|
|
191
203
|
/**
|
|
192
204
|
* The language to keep for a person the pages see for the first time (ADR-0065): the one their
|
|
@@ -205,8 +217,7 @@ export function languageToKeep(me, browser, packs) {
|
|
|
205
217
|
* (ADR-0021).
|
|
206
218
|
*/
|
|
207
219
|
export function onlyOnOwnPages(route) {
|
|
208
|
-
return (route.name === "
|
|
209
|
-
route.name === "sessions" ||
|
|
220
|
+
return (route.name === "sessions" ||
|
|
210
221
|
route.name === "new-token" ||
|
|
211
222
|
route.name === "person-agents" ||
|
|
212
223
|
route.name === "connect");
|
|
@@ -215,6 +226,39 @@ function NotWithToken() {
|
|
|
215
226
|
const words = useWords().common.notWithToken;
|
|
216
227
|
return _jsx(EmptyState, { title: words.title, body: words.body });
|
|
217
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* The boards of the projects the front page shows at a glance (ADR-0105), each in one request
|
|
231
|
+
* (ADR-0107): read when its tile is first shown at such a size, each time the front page is
|
|
232
|
+
* shown, and again when the person comes back to the window, so that what a tile says is what
|
|
233
|
+
* holds now. A read that fails is tried again; one the console refuses leaves the tile with the
|
|
234
|
+
* project's own figure.
|
|
235
|
+
*/
|
|
236
|
+
function useGlances(client) {
|
|
237
|
+
const [read, setRead] = useState({});
|
|
238
|
+
const wanted = useRef([]);
|
|
239
|
+
const reader = useRef(undefined);
|
|
240
|
+
useEffect(() => {
|
|
241
|
+
const made = createGlanceReader({
|
|
242
|
+
read: (project) => client.project(project.key).glance(),
|
|
243
|
+
store: (id, glance) => setRead((before) => ({ ...before, [id]: glance })),
|
|
244
|
+
// What the console refused it refuses again: a project that is not the person's to read.
|
|
245
|
+
again: (failure) => !(failure instanceof ApiError) || failure.status === 0 || failure.status >= 500,
|
|
246
|
+
});
|
|
247
|
+
reader.current = made;
|
|
248
|
+
// The grid said what it shows before this ran: a child's effect comes first.
|
|
249
|
+
made.want(wanted.current);
|
|
250
|
+
return () => {
|
|
251
|
+
made.stop();
|
|
252
|
+
reader.current = undefined;
|
|
253
|
+
};
|
|
254
|
+
}, [client]);
|
|
255
|
+
const want = useCallback((list) => {
|
|
256
|
+
wanted.current = list;
|
|
257
|
+
reader.current?.want(list);
|
|
258
|
+
}, []);
|
|
259
|
+
const renew = useCallback(() => reader.current?.renew(), []);
|
|
260
|
+
return { read, want, renew };
|
|
261
|
+
}
|
|
218
262
|
function ProjectsPage(props) {
|
|
219
263
|
const words = useWords().projects;
|
|
220
264
|
const homeWords = useWords().home;
|
|
@@ -224,6 +268,26 @@ function ProjectsPage(props) {
|
|
|
224
268
|
const [arranging, setArranging] = useState(false);
|
|
225
269
|
const { busy, error, act } = useAction();
|
|
226
270
|
const href = (project) => projectHref(project.key);
|
|
271
|
+
const glances = useGlances(client);
|
|
272
|
+
// What waits in each project is read with the projects, once when the console opens. Each
|
|
273
|
+
// time the front page is shown after that, and when the person comes back to its window,
|
|
274
|
+
// the projects are read again, and the glances with them.
|
|
275
|
+
const { refreshProjects } = data.actions;
|
|
276
|
+
const loaded = useRef(data.loaded);
|
|
277
|
+
const { renew } = glances;
|
|
278
|
+
useEffect(() => {
|
|
279
|
+
if (loaded.current) {
|
|
280
|
+
refreshProjects().catch(() => undefined);
|
|
281
|
+
}
|
|
282
|
+
const back = () => {
|
|
283
|
+
if (document.visibilityState === "visible") {
|
|
284
|
+
refreshProjects().catch(() => undefined);
|
|
285
|
+
renew();
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
document.addEventListener("visibilitychange", back);
|
|
289
|
+
return () => document.removeEventListener("visibilitychange", back);
|
|
290
|
+
}, [refreshProjects, renew]);
|
|
227
291
|
// A project is made by an administrator (ADR-0045): a member sees the list alone, the form's
|
|
228
292
|
// address included.
|
|
229
293
|
const administrator = data.me?.person?.role === "admin";
|
|
@@ -231,7 +295,7 @@ function ProjectsPage(props) {
|
|
|
231
295
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sc-page-head", children: [_jsx("h1", { className: "sc-page-title", children: words.title }), !arranging && (_jsxs("div", { className: "sc-page-actions", children: [me !== undefined && me.person !== null && (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => setArranging(true), children: homeWords.edit })), administrator && !making && (_jsx(LinkButton, { href: PATHS.newProject, variant: "primary", children: words.newProject }))] }))] }), error !== undefined && _jsx(Callout, { tone: "danger", children: error }), making && (_jsx("section", { className: "sc-panel sc-panel-form", "aria-label": words.form.aria, children: _jsx(ProjectForm, { busy: busy, skillsSource: data.me?.workspace.skills.source, organizationAddress: data.me?.workspace.skills.address ?? null, onSubmit: (input, icon) => void act(async () => {
|
|
232
296
|
const made = await data.actions.createProject(input, icon instanceof File ? uploadOf(icon) : undefined);
|
|
233
297
|
navigation.replace(projectHref(made.key));
|
|
234
|
-
}), onCancel: () => navigation.back(PATHS.projects) }) })), _jsx(components.HomeGrid, { projects: data.projects, plugins: data.plugins, home: me?.home, editing: arranging, onSave: (home) => data.actions.updateMe({ home }), onDone: () => setArranging(false), projectHref: href, onOpen: (project) => navigation.go(href(project)), nameOf: (name) => pluginWordOf(name, language), renderWidget: (tile, size) => me === undefined ? null : (_jsx(PluginFrame, { plugin: tile.plugin, widget: tile.widget.key, size: size, me: me, language: language, client: client, navigation: navigation, title: pluginWordOf(tile.widget.name, language) })), empty: _jsx(EmptyState, { title: words.empty.title, body: administrator ? words.empty.body : words.empty.bodyMember, action: administrator ? (_jsx(LinkButton, { href: PATHS.newProject, children: words.newProject })) : undefined }) })] }));
|
|
298
|
+
}), onCancel: () => navigation.back(PATHS.projects) }) })), _jsx(components.HomeGrid, { projects: data.projects, plugins: data.plugins, home: me?.home, editing: arranging, onSave: (home) => data.actions.updateMe({ home }), onDone: () => setArranging(false), projectHref: href, onOpen: (project) => navigation.go(href(project)), glances: glances.read, onGlance: glances.want, nameOf: (name) => pluginWordOf(name, language), renderWidget: (tile, size) => me === undefined ? null : (_jsx(PluginFrame, { plugin: tile.plugin, widget: tile.widget.key, size: size, me: me, language: language, client: client, navigation: navigation, title: pluginWordOf(tile.widget.name, language) })), empty: _jsx(EmptyState, { title: words.empty.title, body: administrator ? words.empty.body : words.empty.bodyMember, action: administrator ? (_jsx(LinkButton, { href: PATHS.newProject, children: words.newProject })) : undefined }) })] }));
|
|
235
299
|
}
|
|
236
300
|
/**
|
|
237
301
|
* A plugin's page (ADR-0054): the sub-tabs of its pages at the level, where it has several, above
|
|
@@ -447,7 +511,11 @@ function TaskPage(props) {
|
|
|
447
511
|
}), onMove: (target, state) => void act(() => data.actions.updateTask(target.id, { state })), onRaiseDecision: (input, files) => void act(async () => {
|
|
448
512
|
await data.actions.raiseDecision(input, uploadsOf(files));
|
|
449
513
|
navigation.replace(here);
|
|
450
|
-
}), onAnswer: (decision, input) => void act(() => data.actions.answerDecision(decision.id, input)), onUpdateDecision: (decision, patch) => void act(() => data.actions.updateDecision(decision.id, patch)),
|
|
514
|
+
}), onAnswer: (decision, input) => void act(() => data.actions.answerDecision(decision.id, input)), onUpdateDecision: (decision, patch) => void act(() => data.actions.updateDecision(decision.id, patch)), addressing: {
|
|
515
|
+
people: data.members.map((member) => member.person),
|
|
516
|
+
me: data.me?.person ?? undefined,
|
|
517
|
+
onAddress: (decision, deciders) => void act(() => data.actions.addressDecision(decision.id, deciders.map((person) => person.id))),
|
|
518
|
+
}, onAbandonRun: (run) => void act(() => data.actions.abandonRun(run.id)), onArchive: (target) => void act(async () => {
|
|
451
519
|
await data.actions.archiveTask(target.id);
|
|
452
520
|
navigation.go(projectHref(key, "archive"));
|
|
453
521
|
}), onRestore: (target) => void act(async () => {
|
|
@@ -469,6 +537,13 @@ function ProjectPage(props) {
|
|
|
469
537
|
const onMove = (task, state) => void act(() => data.actions.updateTask(task.id, { state }));
|
|
470
538
|
const onAnswer = (decision, input) => void act(() => data.actions.answerDecision(decision.id, input));
|
|
471
539
|
const onUpdate = (decision, patch) => void act(() => data.actions.updateDecision(decision.id, patch));
|
|
540
|
+
// Whom a waiting decision is for, said anew (ADR-0096), by anyone who may work here: the
|
|
541
|
+
// people to name are the project's members, as where a decision is raised.
|
|
542
|
+
const addressing = {
|
|
543
|
+
people: data.members.map((member) => member.person),
|
|
544
|
+
me: data.me?.person ?? undefined,
|
|
545
|
+
onAddress: (decision, deciders) => void act(() => data.actions.addressDecision(decision.id, deciders.map((person) => person.id))),
|
|
546
|
+
};
|
|
472
547
|
if (route.name === "board") {
|
|
473
548
|
const me = data.me?.person ?? undefined;
|
|
474
549
|
const shown = filterTasks(data.tasks, route.filter, me);
|
|
@@ -544,7 +619,7 @@ function ProjectPage(props) {
|
|
|
544
619
|
return (_jsx(DocsPage, { project: project, path: route.path, view: route.view, data: data, navigation: navigation }));
|
|
545
620
|
}
|
|
546
621
|
if (route.name === "decisions") {
|
|
547
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sc-page-head", children: [_jsx("h1", { className: "sc-page-title", children: words.decisions.title }), _jsx(LinkButton, { href: newDecisionHref(key), variant: "primary", children: words.decisions.raise })] }), error !== undefined && _jsx(Callout, { tone: "danger", children: error }), _jsx(components.DecisionList, { decisions: data.decisions, tasks: tasksById, taskHref: href, docHref: toDoc, fileHref: (fileId) => projectPath(key, "files", fileId), decisionHref: (decision) => decisionHref(key, decision.id), page: route.page, pageHref: (page) => decisionsHref(key, page), onAnswer: onAnswer, onUpdate: onUpdate, busy: busy, empty: _jsx(EmptyState, { title: words.decisions.empty.title, body: words.decisions.empty.body }) })] }));
|
|
622
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sc-page-head", children: [_jsx("h1", { className: "sc-page-title", children: words.decisions.title }), _jsx(LinkButton, { href: newDecisionHref(key), variant: "primary", children: words.decisions.raise })] }), error !== undefined && _jsx(Callout, { tone: "danger", children: error }), _jsx(components.DecisionList, { decisions: data.decisions, tasks: tasksById, taskHref: href, docHref: toDoc, fileHref: (fileId) => projectPath(key, "files", fileId), decisionHref: (decision) => decisionHref(key, decision.id), page: route.page, pageHref: (page) => decisionsHref(key, page), onAnswer: onAnswer, onUpdate: onUpdate, addressing: addressing, busy: busy, empty: _jsx(EmptyState, { title: words.decisions.empty.title, body: words.decisions.empty.body }) })] }));
|
|
548
623
|
}
|
|
549
624
|
if (route.name === "new-decision") {
|
|
550
625
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "sc-page-head", children: _jsx("h1", { className: "sc-page-title", children: words.decisions.raise }) }), error !== undefined && _jsx(Callout, { tone: "danger", children: error }), _jsx("section", { className: "sc-panel sc-panel-form", "aria-label": words.decisions.raiseAria, children: _jsx(DecisionForm, { findTasks: data.actions.findTasks, deciders: data.members.map((member) => member.person), me: data.me?.person ?? undefined, busy: busy, onSubmit: (input, files) => void act(async () => {
|
|
@@ -554,7 +629,7 @@ function ProjectPage(props) {
|
|
|
554
629
|
}
|
|
555
630
|
if (route.name === "decision") {
|
|
556
631
|
const decision = data.decisions.find((candidate) => candidate.id === route.id);
|
|
557
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sc-page-head", children: [_jsx("h1", { className: "sc-page-title", children: words.decisions.one }), _jsx(LinkButton, { href: projectHref(key, "decisions"), children: words.decisions.all })] }), error !== undefined && _jsx(Callout, { tone: "danger", children: error }), decision === undefined ? (_jsx(EmptyState, { title: words.decisions.noSuch.title, body: words.decisions.noSuch.body })) : (_jsx(DecisionCard, { decision: decision, task: decision.taskId === null ? undefined : tasksById.get(decision.taskId), taskHref: href, docHref: toDoc, fileHref: (fileId) => projectPath(key, "files", fileId), onAnswer: onAnswer, onUpdate: onUpdate, busy: busy }))] }));
|
|
632
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sc-page-head", children: [_jsx("h1", { className: "sc-page-title", children: words.decisions.one }), _jsx(LinkButton, { href: projectHref(key, "decisions"), children: words.decisions.all })] }), error !== undefined && _jsx(Callout, { tone: "danger", children: error }), decision === undefined ? (_jsx(EmptyState, { title: words.decisions.noSuch.title, body: words.decisions.noSuch.body })) : (_jsx(DecisionCard, { decision: decision, task: decision.taskId === null ? undefined : tasksById.get(decision.taskId), taskHref: href, docHref: toDoc, fileHref: (fileId) => projectPath(key, "files", fileId), onAnswer: onAnswer, onUpdate: onUpdate, addressing: addressing, busy: busy }))] }));
|
|
558
633
|
}
|
|
559
634
|
if (route.name === "archive") {
|
|
560
635
|
return _jsx(ArchivePage, { project: project, data: data });
|
|
@@ -770,7 +845,7 @@ function WorkspaceSettingsPage(props) {
|
|
|
770
845
|
if (!administrator) {
|
|
771
846
|
return _jsx(NothingHere, {});
|
|
772
847
|
}
|
|
773
|
-
return (_jsxs(_Fragment, { children: [head, error !== undefined && _jsx(Callout, { tone: "danger", children: error }), _jsx("section", { className: "sc-panel sc-panel-form", "aria-label": words.rules.title, children: rules === undefined ? (_jsx(Spinner, { label: words.rules.loading })) : (_jsx(RulesForm, { rules: rules, scope: "workspace", template:
|
|
848
|
+
return (_jsxs(_Fragment, { children: [head, error !== undefined && _jsx(Callout, { tone: "danger", children: error }), _jsx("section", { className: "sc-panel sc-panel-form", "aria-label": words.rules.title, children: rules === undefined ? (_jsx(Spinner, { label: words.rules.loading })) : (_jsx(RulesForm, { rules: rules, scope: "workspace", template: "", busy: busy, onSubmit: (input) => void act(async () => {
|
|
774
849
|
setRules(await data.actions.writeRules({
|
|
775
850
|
body: input.body,
|
|
776
851
|
...(input.baseVersion === undefined
|
|
@@ -778,10 +853,7 @@ function WorkspaceSettingsPage(props) {
|
|
|
778
853
|
: { baseVersion: input.baseVersion }),
|
|
779
854
|
}));
|
|
780
855
|
navigation.replace(PATHS.settings);
|
|
781
|
-
}), onCancel: () => navigation.back(PATHS.settings)
|
|
782
|
-
setRules(await data.actions.archiveRules());
|
|
783
|
-
navigation.replace(PATHS.settings);
|
|
784
|
-
}) })) })] }));
|
|
856
|
+
}), onCancel: () => navigation.back(PATHS.settings) })) })] }));
|
|
785
857
|
}
|
|
786
858
|
if (form === "pack-token") {
|
|
787
859
|
if (!administrator || workspace === undefined) {
|
|
@@ -798,6 +870,15 @@ function WorkspaceSettingsPage(props) {
|
|
|
798
870
|
navigation.replace(PATHS.settings);
|
|
799
871
|
}), onBack: () => navigation.back(PATHS.settings) })] }));
|
|
800
872
|
}
|
|
873
|
+
if (form === "services") {
|
|
874
|
+
if (!administrator || workspace === undefined) {
|
|
875
|
+
return _jsx(NothingHere, {});
|
|
876
|
+
}
|
|
877
|
+
return (_jsxs(_Fragment, { children: [head, error !== undefined && _jsx(Callout, { tone: "danger", children: error }), _jsxs("section", { className: "sc-panel sc-panel-form", "aria-label": words.settings.services.aria, children: [_jsx("h2", { className: "sc-section-title", children: words.settings.services.title }), _jsx(WorkspaceServicesForm, { workspace: workspace, busy: busy, onSubmit: (patch) => void act(async () => {
|
|
878
|
+
await data.actions.updateWorkspace(patch);
|
|
879
|
+
navigation.replace(PATHS.settings);
|
|
880
|
+
}), onCancel: () => navigation.back(PATHS.settings) })] })] }));
|
|
881
|
+
}
|
|
801
882
|
if (form === "workspace") {
|
|
802
883
|
if (!administrator || workspace === undefined) {
|
|
803
884
|
return _jsx(NothingHere, {});
|
|
@@ -807,7 +888,7 @@ function WorkspaceSettingsPage(props) {
|
|
|
807
888
|
navigation.replace(PATHS.settings);
|
|
808
889
|
}), onCancel: () => navigation.back(PATHS.settings) })] })] }));
|
|
809
890
|
}
|
|
810
|
-
return (_jsxs(_Fragment, { children: [head, !holdsToken(data) && _jsx(SettingsViews, { on: "workspace" }), error !== undefined && _jsx(Callout, { tone: "danger", children: error }), workspace !== undefined && (_jsxs("section", { className: "sc-panel", "aria-label": words.settings.workspace.aria, children: [_jsxs("div", { className: "sc-section-head", children: [_jsx("h2", { className: "sc-section-title", children: words.settings.workspace.title }), administrator && (_jsx("a", { className: "sc-button sc-button-secondary sc-button-sm", href: settingsHref("workspace"), children: words.common.edit }))] }), _jsx(WorkspaceSettingsView, { workspace: workspace, console: data.me?.console })] })), _jsxs("section", { className: "sc-panel", "aria-label": words.rules.title, children: [_jsx("h2", { className: "sc-section-title", children: words.rules.title }), rules === undefined ? (_jsx(Spinner, { label: words.rules.loading })) : (_jsx(RulesView, { rules: rules, scope: "workspace", editHref: administrator ? settingsHref("rules") : undefined, onArchive: administrator
|
|
891
|
+
return (_jsxs(_Fragment, { children: [head, !holdsToken(data) && _jsx(SettingsViews, { on: "workspace" }), error !== undefined && _jsx(Callout, { tone: "danger", children: error }), workspace !== undefined && (_jsxs("section", { className: "sc-panel", "aria-label": words.settings.workspace.aria, children: [_jsxs("div", { className: "sc-section-head", children: [_jsx("h2", { className: "sc-section-title", children: words.settings.workspace.title }), administrator && (_jsx("a", { className: "sc-button sc-button-secondary sc-button-sm", href: settingsHref("workspace"), children: words.common.edit }))] }), _jsx(WorkspaceSettingsView, { workspace: workspace, console: data.me?.console })] })), workspace !== undefined && (_jsxs("section", { className: "sc-panel", "aria-label": words.settings.services.aria, children: [_jsxs("div", { className: "sc-section-head", children: [_jsx("h2", { className: "sc-section-title", children: words.settings.services.title }), administrator && (_jsx("a", { className: "sc-button sc-button-secondary sc-button-sm", href: settingsHref("services"), children: words.common.edit }))] }), _jsx("p", { className: "sc-settings-hint", children: words.settings.services.intro }), _jsx(WorkspaceServicesView, { workspace: workspace })] })), _jsxs("section", { className: "sc-panel", "aria-label": words.rules.title, children: [_jsx("h2", { className: "sc-section-title", children: words.rules.title }), rules === undefined ? (_jsx(Spinner, { label: words.rules.loading })) : (_jsx(RulesView, { rules: rules, scope: "workspace", editHref: administrator ? settingsHref("rules") : undefined, onArchive: administrator
|
|
811
892
|
? () => void act(async () => {
|
|
812
893
|
setRules(await data.actions.archiveRules());
|
|
813
894
|
})
|
|
@@ -874,9 +955,32 @@ const shownBefore = new Map();
|
|
|
874
955
|
function rememberedAs(key) {
|
|
875
956
|
return shownBefore.get(key);
|
|
876
957
|
}
|
|
958
|
+
/** How long an answer asked for early stands for the page's own; past it, the page reads anew. */
|
|
959
|
+
const EARLY_FRESH_MS = 30_000;
|
|
960
|
+
/**
|
|
961
|
+
* What the page the console opened on asked for along with who is signed in, by the name the
|
|
962
|
+
* page takes it under: its own data a round trip sooner than once the person and the workspace
|
|
963
|
+
* are known. Taken once, by the page it was asked for.
|
|
964
|
+
*/
|
|
965
|
+
const askedEarly = new Map();
|
|
966
|
+
function askEarly(name, ask) {
|
|
967
|
+
if (!askedEarly.has(name)) {
|
|
968
|
+
const answer = ask();
|
|
969
|
+
answer.catch(() => undefined);
|
|
970
|
+
askedEarly.set(name, { answer, at: Date.now() });
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
/** The answer asked for early under the name, once, while it is fresh; nothing otherwise. */
|
|
974
|
+
function takeEarly(name) {
|
|
975
|
+
const asked = askedEarly.get(name);
|
|
976
|
+
askedEarly.delete(name);
|
|
977
|
+
return asked !== undefined && Date.now() - asked.at <= EARLY_FRESH_MS
|
|
978
|
+
? asked.answer
|
|
979
|
+
: undefined;
|
|
980
|
+
}
|
|
877
981
|
function PlatePage(props) {
|
|
878
982
|
const words = useWords();
|
|
879
|
-
const { components, load, couldNotLoad, refused, remember } = props;
|
|
983
|
+
const { components, load, couldNotLoad, refused, remember, early } = props;
|
|
880
984
|
const [plate, setPlate] = useState(() => rememberedAs(remember));
|
|
881
985
|
const [problem, setProblem] = useState(undefined);
|
|
882
986
|
const [forbidden, setForbidden] = useState(false);
|
|
@@ -885,7 +989,9 @@ function PlatePage(props) {
|
|
|
885
989
|
setPlate(rememberedAs(remember));
|
|
886
990
|
setProblem(undefined);
|
|
887
991
|
setForbidden(false);
|
|
888
|
-
|
|
992
|
+
// What was asked for as the console opened is taken; else the plate is read now.
|
|
993
|
+
const asked = early === undefined ? undefined : takeEarly(early);
|
|
994
|
+
(asked === undefined ? load(controller.signal) : asked.catch(() => load(controller.signal)))
|
|
889
995
|
.then((answer) => {
|
|
890
996
|
if (!controller.signal.aborted) {
|
|
891
997
|
shownBefore.set(remember, answer);
|
|
@@ -906,8 +1012,8 @@ function PlatePage(props) {
|
|
|
906
1012
|
}
|
|
907
1013
|
});
|
|
908
1014
|
return () => controller.abort();
|
|
909
|
-
}, [load, couldNotLoad, refused, remember]);
|
|
910
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sc-page-head", children: [_jsx("h1", { className: "sc-page-title", children: props.title }), props.aside] }), problem !== undefined && _jsx(Callout, { tone: "danger", children: problem }), forbidden && refused !== undefined ? (_jsx(EmptyState, { title: refused.title, body: refused.body, action: _jsx(LinkButton, { href: PATHS.work, children: words.nav.work }) })) : plate === undefined ? (problem === undefined && (_jsx("div", { className: "sc-loading", children: _jsx(Spinner, { label: props.loading }) }))) : plate.tasks.length === 0 &&
|
|
1015
|
+
}, [load, couldNotLoad, refused, remember, early]);
|
|
1016
|
+
return (_jsxs(_Fragment, { children: [props.headless !== true && (_jsxs("div", { className: "sc-page-head", children: [_jsx("h1", { className: "sc-page-title", children: props.title }), props.lead !== undefined && _jsx("p", { className: "sc-page-lead", children: props.lead }), props.aside] })), problem !== undefined && _jsx(Callout, { tone: "danger", children: problem }), forbidden && refused !== undefined ? (_jsx(EmptyState, { title: refused.title, body: refused.body, action: _jsx(LinkButton, { href: PATHS.work, children: words.nav.work }) })) : plate === undefined ? (problem === undefined && (_jsx("div", { className: "sc-loading", children: _jsx(Spinner, { label: props.loading }) }))) : plate.tasks.length === 0 &&
|
|
911
1017
|
(plate.closed?.length ?? 0) === 0 &&
|
|
912
1018
|
(plate.decisions?.length ?? 0) === 0 ? (_jsx(EmptyState, { title: props.empty.title, body: props.empty.body })) : (_jsx(components.WorkList, { work: plate, week: props.week, weekStart: props.weekStart, taskHref: (projectKey, task) => taskHref(projectKey, task.number), decisionHref: (projectKey, decisionId) => decisionHref(projectKey, decisionId), weekHref: props.weekHref }))] }));
|
|
913
1019
|
}
|
|
@@ -920,7 +1026,7 @@ function PlatePage(props) {
|
|
|
920
1026
|
function MyDecisionPage(props) {
|
|
921
1027
|
const words = useWords();
|
|
922
1028
|
const { id, data } = props;
|
|
923
|
-
const { reachDecision, answerReachedDecision } = data.actions;
|
|
1029
|
+
const { reachDecision, answerReachedDecision, addressDecisionIn, membersOf } = data.actions;
|
|
924
1030
|
const [reached, setReached] = useState(undefined);
|
|
925
1031
|
const [problem, setProblem] = useState(undefined);
|
|
926
1032
|
const { busy, error, act } = useAction();
|
|
@@ -944,7 +1050,14 @@ function MyDecisionPage(props) {
|
|
|
944
1050
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sc-page-head", children: [_jsx("h1", { className: "sc-page-title", children: words.decisions.one }), _jsx(LinkButton, { href: PATHS.decisions, children: words.myDecisions.title })] }), shown !== undefined && _jsx(Callout, { tone: "danger", children: shown }), reached === undefined ? (shown === undefined && (_jsx("div", { className: "sc-loading", children: _jsx(Spinner, { label: words.myDecisions.loading }) }))) : (_jsx(ReachedDecision, { reached: reached, onAnswer: (_decision, input) => void act(async () => {
|
|
945
1051
|
const answered = await answerReachedDecision(id, input);
|
|
946
1052
|
setReached((current) => current === undefined ? current : { ...current, decision: answered });
|
|
947
|
-
}),
|
|
1053
|
+
}), addressing: {
|
|
1054
|
+
people: () => membersOf(reached.project.key),
|
|
1055
|
+
me: data.me?.person ?? undefined,
|
|
1056
|
+
onAddress: (_decision, deciders) => void act(async () => {
|
|
1057
|
+
const addressed = await addressDecisionIn(reached.project.key, id, deciders.map((person) => person.id));
|
|
1058
|
+
setReached((current) => current === undefined ? current : { ...current, decision: addressed });
|
|
1059
|
+
}),
|
|
1060
|
+
}, busy: busy }))] }));
|
|
948
1061
|
}
|
|
949
1062
|
/** What is on the person's own plate, across their projects. */
|
|
950
1063
|
/** How many of a person's decisions are read at a time. */
|
|
@@ -959,7 +1072,12 @@ remember) {
|
|
|
959
1072
|
const read = useCallback(async (offset, signal) => {
|
|
960
1073
|
setBusy(true);
|
|
961
1074
|
try {
|
|
962
|
-
const
|
|
1075
|
+
const ask = () => myDecisions({ raised, limit: MY_DECISIONS_PAGE, offset }, signal);
|
|
1076
|
+
// The first page may have been asked for as the console opened: taken, else read now.
|
|
1077
|
+
const asked = offset === 0
|
|
1078
|
+
? takeEarly(`decisions:${raised ? "raised" : "addressed"}`)
|
|
1079
|
+
: undefined;
|
|
1080
|
+
const page = asked === undefined ? await ask() : await asked.catch(ask);
|
|
963
1081
|
if (signal?.aborted === true) {
|
|
964
1082
|
return;
|
|
965
1083
|
}
|
|
@@ -999,7 +1117,7 @@ remember) {
|
|
|
999
1117
|
*/
|
|
1000
1118
|
function MyDecisionsPage(props) {
|
|
1001
1119
|
const words = useWords();
|
|
1002
|
-
const { myDecisions, answerReachedDecision } = props.data.actions;
|
|
1120
|
+
const { myDecisions, answerReachedDecision, addressDecisionIn, membersOf } = props.data.actions;
|
|
1003
1121
|
const whose = props.data.me?.person?.id ?? "";
|
|
1004
1122
|
const addressed = useMyDecisions(myDecisions, false, words.myDecisions.couldNotLoad, `decisions:${whose}:addressed`);
|
|
1005
1123
|
const raised = useMyDecisions(myDecisions, true, words.myDecisions.couldNotLoad, `decisions:${whose}:raised`);
|
|
@@ -1015,12 +1133,20 @@ function MyDecisionsPage(props) {
|
|
|
1015
1133
|
});
|
|
1016
1134
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "sc-page-head", children: _jsx("h1", { className: "sc-page-title", children: words.myDecisions.title }) }), problem !== undefined && _jsx(Callout, { tone: "danger", children: problem }), addressed.items === undefined || raised.items === undefined ? (problem === undefined && (_jsx("div", { className: "sc-loading", children: _jsx(Spinner, { label: words.myDecisions.loading }) }))) : addressed.items.length === 0 && raised.items.length === 0 ? (_jsx(EmptyState, { title: words.myDecisions.empty.title, body: words.myDecisions.empty.body })) : (_jsx(MyDecisions, { addressed: { items: addressed.items, more: addressed.more, onMore: addressed.readMore }, raised: { items: raised.items, more: raised.more, onMore: raised.readMore }, decisionHref: (projectKey, decisionId) => props.data.projects.some((project) => project.key === projectKey)
|
|
1017
1135
|
? decisionHref(projectKey, decisionId)
|
|
1018
|
-
: myDecisionHref(decisionId), onAnswer: onAnswer,
|
|
1136
|
+
: myDecisionHref(decisionId), onAnswer: onAnswer, addressing: (projectKey) => ({
|
|
1137
|
+
people: () => membersOf(projectKey),
|
|
1138
|
+
me: props.data.me?.person ?? undefined,
|
|
1139
|
+
onAddress: (decision, deciders) => void act(async () => {
|
|
1140
|
+
await addressDecisionIn(projectKey, decision.id, deciders.map((person) => person.id));
|
|
1141
|
+
addressed.reload();
|
|
1142
|
+
raised.reload();
|
|
1143
|
+
}),
|
|
1144
|
+
}), busy: busy || addressed.busy || raised.busy }))] }));
|
|
1019
1145
|
}
|
|
1020
1146
|
function WorkPage(props) {
|
|
1021
1147
|
const words = useWords();
|
|
1022
|
-
const {
|
|
1023
|
-
return (_jsx(PlatePage, { components: props.components, load:
|
|
1148
|
+
const { plate } = props.data.actions;
|
|
1149
|
+
return (_jsxs(_Fragment, { children: [_jsx(AgentsNeedingYou, { agents: props.data.agents, me: props.data.me?.person?.id }), _jsx(PlatePage, { components: props.components, load: plate, remember: `work:${props.data.me?.person?.id ?? ""}`, early: "work", title: words.work.title, week: props.week, weekStart: weekStartOf(props.data.me?.workspace), weekHref: workHref, loading: words.work.loading, couldNotLoad: words.work.couldNotLoad, empty: words.work.empty })] }));
|
|
1024
1150
|
}
|
|
1025
1151
|
/** Another person's plate, for whoever oversees them: an administrator, or an owner of a project they are in. */
|
|
1026
1152
|
function PersonWorkPage(props) {
|
|
@@ -1028,13 +1154,87 @@ function PersonWorkPage(props) {
|
|
|
1028
1154
|
const { id, data } = props;
|
|
1029
1155
|
const person = data.people.find((candidate) => candidate.id === id);
|
|
1030
1156
|
const name = person === undefined ? "?" : personName(person);
|
|
1031
|
-
const {
|
|
1032
|
-
const load = useCallback((signal) =>
|
|
1033
|
-
return (_jsx(PlatePage, { components: props.components, load: load, remember: `work:${data.me?.person?.id ?? ""}:${id}`, title: words.people.workOf(name), aside: _jsx(LinkButton, { href: PATHS.people, children: words.nav.people }), week: props.week, weekStart: weekStartOf(data.me?.workspace), weekHref: (day) => personWorkHref(id, day), loading: words.people.loadingWork, couldNotLoad: words.people.couldNotLoadWork, empty: { title: words.people.noWork.title(name), body: words.people.noWork.body }, refused: words.people.notOverseen }));
|
|
1157
|
+
const { personPlate } = data.actions;
|
|
1158
|
+
const load = useCallback((signal) => personPlate(id, signal), [personPlate, id]);
|
|
1159
|
+
return (_jsx(PlatePage, { components: props.components, load: load, remember: `work:${data.me?.person?.id ?? ""}:${id}`, title: words.people.workOf(name), lead: person?.title ?? undefined, aside: _jsx(LinkButton, { href: PATHS.people, children: words.nav.people }), week: props.week, weekStart: weekStartOf(data.me?.workspace), weekHref: (day) => personWorkHref(id, day), loading: words.people.loadingWork, couldNotLoad: words.people.couldNotLoadWork, empty: { title: words.people.noWork.title(name), body: words.people.noWork.body }, refused: words.people.notOverseen }));
|
|
1160
|
+
}
|
|
1161
|
+
/** An agent account's plate on its own page (ADR-0084): its work as a member's, for whoever oversees it. */
|
|
1162
|
+
function AgentWork(props) {
|
|
1163
|
+
const words = useWords();
|
|
1164
|
+
const { agent, data } = props;
|
|
1165
|
+
const { id } = agent.person;
|
|
1166
|
+
const handle = agent.person.handle ?? "";
|
|
1167
|
+
const name = personName(agent.person);
|
|
1168
|
+
const { personPlate } = data.actions;
|
|
1169
|
+
const load = useCallback((signal) => personPlate(id, signal), [personPlate, id]);
|
|
1170
|
+
return (_jsx(PlatePage, { components: props.components, load: load, remember: `work:${data.me?.person?.id ?? ""}:${id}`, title: words.people.workOf(name), headless: true, week: props.week, weekStart: weekStartOf(data.me?.workspace), weekHref: (day) => agentWorkHref(handle, day), loading: words.people.loadingWork, couldNotLoad: words.people.couldNotLoadWork, empty: { title: words.people.noWork.title(name), body: words.people.noWork.body }, refused: words.people.notOverseen }));
|
|
1171
|
+
}
|
|
1172
|
+
/** Seeds of the page's own for personas proposed here: twelve characters nobody chose, each. */
|
|
1173
|
+
function freshSeeds(count) {
|
|
1174
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
1175
|
+
const bytes = crypto.getRandomValues(new Uint8Array(count * 12));
|
|
1176
|
+
return Array.from({ length: count }, (_, index) => Array.from(bytes.subarray(index * 12, (index + 1) * 12), (byte) => alphabet[byte % alphabet.length]).join(""));
|
|
1177
|
+
}
|
|
1178
|
+
/** How many personas the form proposes at a time. */
|
|
1179
|
+
const PROPOSALS_SHOWN = 4;
|
|
1180
|
+
/**
|
|
1181
|
+
* "Add an agent account" (ADR-0084), for an administrator: a few personas proposed, by the
|
|
1182
|
+
* console, or from the names a console of one's own brings; the form; and back to the accounts
|
|
1183
|
+
* once one is made.
|
|
1184
|
+
*/
|
|
1185
|
+
function NewAgentPage(props) {
|
|
1186
|
+
const words = useWords();
|
|
1187
|
+
const accounts = words.agents.accounts;
|
|
1188
|
+
const { data, components, navigation, language, names, avatarSets } = props;
|
|
1189
|
+
const { busy, error, act } = useAction();
|
|
1190
|
+
const [proposals, setProposals] = useState([]);
|
|
1191
|
+
/** Whether the proposals asked for last could not be read: the form says so, and is filled in by hand. */
|
|
1192
|
+
const [proposalsFailed, setProposalsFailed] = useState(false);
|
|
1193
|
+
const [round, setRound] = useState(0);
|
|
1194
|
+
const { agentProposals } = data.actions;
|
|
1195
|
+
const taken = data.agents.map((agent) => agent.person.handle ?? "").join(" ");
|
|
1196
|
+
const me = data.me?.person ?? undefined;
|
|
1197
|
+
const administrator = me?.role === "admin";
|
|
1198
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: `round` is the trigger, rolled again by the form
|
|
1199
|
+
useEffect(() => {
|
|
1200
|
+
if (!administrator) {
|
|
1201
|
+
return;
|
|
1202
|
+
}
|
|
1203
|
+
if (names !== undefined) {
|
|
1204
|
+
// A console that brings names of its own proposes from them here, as the console does.
|
|
1205
|
+
setProposals(proposeAgents(freshSeeds(PROPOSALS_SHOWN), {
|
|
1206
|
+
names,
|
|
1207
|
+
lang: language,
|
|
1208
|
+
taken: taken.split(" "),
|
|
1209
|
+
sets: avatarSets,
|
|
1210
|
+
}));
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
const controller = new AbortController();
|
|
1214
|
+
setProposalsFailed(false);
|
|
1215
|
+
agentProposals(PROPOSALS_SHOWN, language, controller.signal)
|
|
1216
|
+
.then((answer) => {
|
|
1217
|
+
if (!controller.signal.aborted) {
|
|
1218
|
+
setProposals(answer.items);
|
|
1219
|
+
}
|
|
1220
|
+
})
|
|
1221
|
+
.catch(() => {
|
|
1222
|
+
if (!controller.signal.aborted) {
|
|
1223
|
+
setProposalsFailed(true);
|
|
1224
|
+
}
|
|
1225
|
+
});
|
|
1226
|
+
return () => controller.abort();
|
|
1227
|
+
}, [round, administrator, names, avatarSets, language, taken, agentProposals]);
|
|
1228
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "sc-page-head", children: _jsx("h1", { className: "sc-page-title", children: accounts.add }) }), !administrator ? (_jsx(Callout, { tone: "warning", children: words.errors["auth.forbidden"] })) : (_jsx("section", { className: "sc-panel sc-panel-form", "aria-label": accounts.add, children: _jsx(components.AgentAccountForm, { proposals: proposals, proposalsFailed: proposalsFailed, onRoll: () => setRound((current) => current + 1), providers: data.me?.signIn ?? [], workspace: data.me?.workspace, people: data.people, me: me, projects: data.projects, busy: busy, error: error, onSubmit: (input) => void act(async () => {
|
|
1229
|
+
await data.actions.createAgent(input);
|
|
1230
|
+
// To the account's page, which says what is next: the invitation that leads a
|
|
1231
|
+
// machine to it, made there.
|
|
1232
|
+
navigation.replace(agentHref(input.handle));
|
|
1233
|
+
}), onCancel: () => navigation.back(PATHS.agents) }) }))] }));
|
|
1034
1234
|
}
|
|
1035
1235
|
function WorkspacePage(props) {
|
|
1036
1236
|
const words = useWords();
|
|
1037
|
-
const { route, data, components, navigation, client, language } = props;
|
|
1237
|
+
const { route, data, components, navigation, client, language, persona } = props;
|
|
1038
1238
|
const [fresh, setFresh] = useState(undefined);
|
|
1039
1239
|
const { busy, error, act } = useAction();
|
|
1040
1240
|
if (route.name === "plugin" && route.level === "workspace") {
|
|
@@ -1116,13 +1316,13 @@ function WorkspacePage(props) {
|
|
|
1116
1316
|
? (person, managerId) => void act(() => data.actions.updatePerson(person.id, { managerId }))
|
|
1117
1317
|
: undefined, onChangeEmail: administrator
|
|
1118
1318
|
? (person, email) => void act(() => data.actions.updatePerson(person.id, { email }))
|
|
1119
|
-
: undefined, onUnlist: administrator
|
|
1319
|
+
: undefined, onChangeTitle: (person, title) => void act(() => data.actions.updatePerson(person.id, { title })), mayChangeTitle: (person) => administrator || supervisedBy(me, person, data.people), onUnlist: administrator
|
|
1120
1320
|
? (listing) => void act(() => data.actions.removeListing(listing.id))
|
|
1121
1321
|
: undefined, teams: data.teams, onJoinTeam: administrator
|
|
1122
1322
|
? (person, team) => void act(() => data.actions.addTeamMember(team.key, person.id))
|
|
1123
1323
|
: undefined, onLeaveTeam: administrator
|
|
1124
1324
|
? (person, team) => void act(() => data.actions.removeTeamMember(team.key, person.id))
|
|
1125
|
-
: undefined, workHref: oversees ? (person) => personWorkHref(person.id) : undefined, agentsHref: administrator ? (person) => personAgentsHref(person.id) : undefined }))] }));
|
|
1325
|
+
: undefined, workHref: oversees ? (person) => personWorkHref(person.id) : undefined, agentsHref: administrator ? (person) => personAgentsHref(person.id) : undefined, agentHref: (person) => agentHref(person.handle ?? "") }))] }));
|
|
1126
1326
|
}
|
|
1127
1327
|
if (route.name === "person-agents") {
|
|
1128
1328
|
return _jsx(PersonAgentsPage, { id: route.id, data: data, components: components });
|
|
@@ -1130,14 +1330,48 @@ function WorkspacePage(props) {
|
|
|
1130
1330
|
if (route.name === "connect") {
|
|
1131
1331
|
return _jsx(ConnectPage, { code: route.code, data: data, navigation: navigation });
|
|
1132
1332
|
}
|
|
1333
|
+
if (route.name === "agent") {
|
|
1334
|
+
return (_jsx(AgentPage
|
|
1335
|
+
// Keyed by the account, so that going from one account to another by the browser's
|
|
1336
|
+
// history begins a page of its own: no name, title or hours of the one in the other's fields.
|
|
1337
|
+
, { handle: route.handle, tab: route.tab, session: route.session, client: client, viaToken: holdsToken(data), providers: data.me?.signIn, work: (agent) => (_jsx(AgentWork, { agent: agent, data: data, components: components, week: route.week })) }, route.handle));
|
|
1338
|
+
}
|
|
1339
|
+
if (route.name === "new-agent") {
|
|
1340
|
+
return (_jsx(NewAgentPage, { data: data, components: components, navigation: navigation, language: language, names: persona?.names, avatarSets: persona?.avatarSets }));
|
|
1341
|
+
}
|
|
1133
1342
|
if (route.name === "agents" || route.name === "new-token") {
|
|
1134
1343
|
const agents = words.agents;
|
|
1344
|
+
const accounts = agents.accounts;
|
|
1135
1345
|
const making = route.name === "new-token";
|
|
1136
1346
|
const origin = typeof window === "undefined" ? "" : window.location.origin;
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1347
|
+
const me = data.me?.person ?? undefined;
|
|
1348
|
+
const administrator = me?.role === "admin";
|
|
1349
|
+
// A console held through a token shows no tokens: the agents that act as a person are
|
|
1350
|
+
// listed where that person is signed in.
|
|
1351
|
+
const viaToken = holdsToken(data);
|
|
1352
|
+
const view = making ? "connected" : route.view;
|
|
1353
|
+
// The agent accounts (ADR-0084) whoever is looking manages, theirs to look after, and
|
|
1354
|
+
// under them, for an administrator, the ones someone else manages.
|
|
1355
|
+
const { managed: mine, others } = agentAccountGroups(data.agents, me, data.people);
|
|
1356
|
+
const views = [
|
|
1357
|
+
{ view: "mine", label: agents.views.mine, count: mine.length },
|
|
1358
|
+
...(viaToken
|
|
1359
|
+
? []
|
|
1360
|
+
: [
|
|
1361
|
+
{
|
|
1362
|
+
view: "connected",
|
|
1363
|
+
label: agents.views.connected,
|
|
1364
|
+
count: data.tokens.length,
|
|
1365
|
+
},
|
|
1366
|
+
]),
|
|
1367
|
+
];
|
|
1368
|
+
if (view === "connected" && viaToken) {
|
|
1369
|
+
return _jsx(NothingHere, {});
|
|
1370
|
+
}
|
|
1371
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sc-page-head", children: [_jsx("h1", { className: "sc-page-title", children: agents.title }), view !== "connected" && administrator && (_jsx(LinkButton, { href: PATHS.newAgent, variant: "primary", children: accounts.add })), view === "connected" && !making && (_jsx(LinkButton, { href: PATHS.newToken, variant: "primary", children: agents.makeByHand }))] }), _jsx("nav", { className: "sc-subtabs sc-agents-views", "aria-label": agents.views.aria, children: views.map((one) => (_jsxs("a", { className: cx("sc-tab", one.view === view && "sc-tab-current"), href: agentsHref(one.view), "aria-current": one.view === view ? "page" : undefined, children: [one.label, _jsx("span", { className: "sc-tab-count", children: one.count })] }, one.view))) }), error !== undefined && _jsx(Callout, { tone: "danger", children: error }), view !== "connected" ? (_jsxs(_Fragment, { children: [_jsxs("section", { className: "sc-people-group", "aria-label": agents.views.mine, children: [_jsx("p", { className: "sc-lead", children: accounts.intro }), _jsx(components.AgentAccountList, { agents: mine, me: me, busy: busy, href: (agent) => agentHref(agent.person.handle ?? ""), empty: others.length > 0 ? (_jsx("p", { className: "sc-field-hint", children: accounts.mineEmpty.title })) : administrator ? (_jsx(EmptyState, { title: accounts.empty.title, body: accounts.empty.body })) : (_jsx(EmptyState, { title: accounts.mineEmpty.title, body: accounts.mineEmpty.body, action: _jsx(LinkButton, { href: PATHS.people, children: words.nav.people }) })) })] }), others.length > 0 && (_jsxs("section", { className: "sc-people-group", "aria-label": accounts.others, children: [_jsxs("h2", { className: "sc-section-title", children: [accounts.others, _jsx(Badge, { kind: "count", children: others.length })] }), _jsx("p", { className: "sc-lead", children: accounts.othersIntro }), _jsx(components.AgentAccountList, { agents: others, me: me, busy: busy, href: (agent) => agentHref(agent.person.handle ?? "") })] }))] })) : (_jsxs("section", { "aria-label": agents.views.connected, children: [_jsx("p", { className: "sc-lead", children: accounts.yoursIntro }), fresh !== undefined && (_jsx(NewToken, { token: fresh.token, secret: fresh.secret, onDone: () => setFresh(undefined) })), making && (_jsx("section", { className: "sc-panel sc-panel-form", "aria-label": agents.makeAria, children: _jsx(TokenForm, { daysAtMost: data.me?.workspace.tokenDaysAtMost, busy: busy, onSubmit: (input) => void act(async () => {
|
|
1372
|
+
setFresh(await data.actions.createToken(input));
|
|
1373
|
+
navigation.replace(agentsHref("connected"));
|
|
1374
|
+
}), onCancel: () => navigation.back(agentsHref("connected")) }) })), _jsx(components.TokenList, { tokens: data.tokens, busy: busy, consoleVersion: data.me?.console?.version, onRevoke: (token) => void act(() => data.actions.revokeToken(token.id)), empty: _jsx(EmptyState, { title: agents.empty.title, body: agents.empty.body }) }), _jsx(ConnectWords, { origin: origin }), _jsx(DeskWords, { origin: origin })] }))] }));
|
|
1141
1375
|
}
|
|
1142
1376
|
return _jsx(NothingHere, {});
|
|
1143
1377
|
}
|
|
@@ -1149,6 +1383,8 @@ export function createConsole(config = {}) {
|
|
|
1149
1383
|
const fallbackTitle = config.title ?? "Console";
|
|
1150
1384
|
const languages = config.languages ?? DEFAULT_LANGUAGES;
|
|
1151
1385
|
const pages = config.pages ?? [];
|
|
1386
|
+
/** The shapes the avatars of agent accounts are drawn from here (ADR-0084): the package's, unless this console brings its own. */
|
|
1387
|
+
const avatarSets = config.persona?.avatarSets ?? AVATAR_SETS;
|
|
1152
1388
|
// biome-ignore lint/correctness/noComponentHookFactories: createConsole runs once, when a console is built, never during a render; App is that console's one root component, closing over its config.
|
|
1153
1389
|
function App(props) {
|
|
1154
1390
|
const { location, navigation } = useNavigation(props.initialPath);
|
|
@@ -1156,6 +1392,19 @@ export function createConsole(config = {}) {
|
|
|
1156
1392
|
const route = useMemo(() => matchRoute(location.pathname, location.search), [location.pathname, location.search]);
|
|
1157
1393
|
const projectKey = projectOf(route);
|
|
1158
1394
|
const data = useConsoleData(client, projectKey);
|
|
1395
|
+
// The page the console opens on asks for its own data along with who is signed in, which
|
|
1396
|
+
// useConsoleData asks for in the same breath, rather than once that answer has come: a
|
|
1397
|
+
// round trip fewer before the page stands.
|
|
1398
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: the page the console opened on, once
|
|
1399
|
+
useEffect(() => {
|
|
1400
|
+
if (route.name === "work") {
|
|
1401
|
+
askEarly("work", () => client.plate());
|
|
1402
|
+
}
|
|
1403
|
+
else if (route.name === "my-decisions") {
|
|
1404
|
+
askEarly("decisions:addressed", () => client.myDecisions({ limit: MY_DECISIONS_PAGE, offset: 0 }));
|
|
1405
|
+
askEarly("decisions:raised", () => client.myDecisions({ raised: true, limit: MY_DECISIONS_PAGE, offset: 0 }));
|
|
1406
|
+
}
|
|
1407
|
+
}, []);
|
|
1159
1408
|
const failure = signInFailureOf(location.search);
|
|
1160
1409
|
const title = data.me?.workspace.name ?? fallbackTitle;
|
|
1161
1410
|
const viaToken = holdsToken(data);
|
|
@@ -1179,14 +1428,20 @@ export function createConsole(config = {}) {
|
|
|
1179
1428
|
}, [route, navigation]);
|
|
1180
1429
|
useEffect(() => {
|
|
1181
1430
|
if (typeof document !== "undefined") {
|
|
1182
|
-
document.title = data.project === undefined ? title : `${data.project.name} · ${title}`;
|
|
1183
1431
|
document.documentElement.lang = pack.tag;
|
|
1184
1432
|
}
|
|
1185
|
-
}, [
|
|
1433
|
+
}, [pack.tag]);
|
|
1434
|
+
/** The tab the page shown is under, once the tabs are known. */
|
|
1435
|
+
let here;
|
|
1186
1436
|
let content;
|
|
1187
1437
|
if (data.me === undefined) {
|
|
1188
1438
|
content = (_jsx(Ground, { children: _jsx("div", { className: "sc-loading", children: data.error === undefined ? (_jsx(Spinner, { label: words.common.loading })) : (_jsx(Callout, { tone: "danger", title: words.common.couldNotReach, action: _jsx(Button, { onClick: data.reload, children: words.common.tryAgain }), children: errorWords(data.failure, data.error, words) })) }) }));
|
|
1189
1439
|
}
|
|
1440
|
+
else if (route.name === "setup") {
|
|
1441
|
+
// What an invitation's code opens is read without a sign-in (ADR-0088): the guide, and
|
|
1442
|
+
// nothing else of the console.
|
|
1443
|
+
content = (_jsx(Ground, { children: _jsx(SetupPage, { client: client, code: route.code }) }));
|
|
1444
|
+
}
|
|
1190
1445
|
else if (data.me.person === null) {
|
|
1191
1446
|
content = (_jsx(Ground, { children: _jsx(components.SignIn, { title: title, brand: config.brand, providers: data.me.signIn, returnTo: withoutSignInParam(location.pathname, location.search), failure: failure }) }));
|
|
1192
1447
|
}
|
|
@@ -1215,15 +1470,14 @@ export function createConsole(config = {}) {
|
|
|
1215
1470
|
route.name === "new-team" ||
|
|
1216
1471
|
route.name === "person-agents",
|
|
1217
1472
|
},
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
:
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
]),
|
|
1473
|
+
{
|
|
1474
|
+
href: PATHS.agents,
|
|
1475
|
+
label: words.nav.agents,
|
|
1476
|
+
current: route.name === "agents" ||
|
|
1477
|
+
route.name === "new-token" ||
|
|
1478
|
+
route.name === "new-agent" ||
|
|
1479
|
+
route.name === "agent",
|
|
1480
|
+
},
|
|
1227
1481
|
...pages
|
|
1228
1482
|
.filter((candidate) => candidate.level === "workspace")
|
|
1229
1483
|
.map((candidate) => ({
|
|
@@ -1328,10 +1582,19 @@ export function createConsole(config = {}) {
|
|
|
1328
1582
|
current: route.name === "settings",
|
|
1329
1583
|
},
|
|
1330
1584
|
];
|
|
1585
|
+
here = currentTab(nav);
|
|
1331
1586
|
/** A page of the console's own at the address, or nothing there. */
|
|
1332
1587
|
const customPageOf = (key, level) => {
|
|
1333
1588
|
const found = pages.find((candidate) => candidate.key === key && candidate.level === level);
|
|
1334
|
-
return found === undefined ? (_jsx(NothingHere, {})) : (found.render({
|
|
1589
|
+
return found === undefined ? (_jsx(NothingHere, {})) : (found.render({
|
|
1590
|
+
data,
|
|
1591
|
+
project,
|
|
1592
|
+
client,
|
|
1593
|
+
navigation,
|
|
1594
|
+
search: location.search,
|
|
1595
|
+
words,
|
|
1596
|
+
language: pack.tag,
|
|
1597
|
+
}));
|
|
1335
1598
|
};
|
|
1336
1599
|
let page;
|
|
1337
1600
|
if (!data.loaded || route.name === "moved") {
|
|
@@ -1347,7 +1610,7 @@ export function createConsole(config = {}) {
|
|
|
1347
1610
|
page = customPageOf(route.page, "workspace");
|
|
1348
1611
|
}
|
|
1349
1612
|
else if (projectKey === undefined) {
|
|
1350
|
-
page = (_jsx(WorkspacePage, { route: route, data: data, components: components, navigation: navigation, client: client, language: pack.tag }));
|
|
1613
|
+
page = (_jsx(WorkspacePage, { route: route, data: data, components: components, navigation: navigation, client: client, language: pack.tag, persona: config.persona }));
|
|
1351
1614
|
}
|
|
1352
1615
|
else if (data.projectError !== undefined) {
|
|
1353
1616
|
page = (_jsx(EmptyState, { title: words.common.noSuchProject.title, body: words.common.noSuchProject.body, action: _jsx(LinkButton, { href: PATHS.projects, children: words.nav.projects }) }));
|
|
@@ -1386,7 +1649,18 @@ export function createConsole(config = {}) {
|
|
|
1386
1649
|
void data.actions.signOut();
|
|
1387
1650
|
}, children: page }));
|
|
1388
1651
|
}
|
|
1389
|
-
|
|
1652
|
+
// The browser's tab is called after the page it shows. It is said again at every address,
|
|
1653
|
+
// not only when the words change: a plugin's page may name the tab itself (the frame's
|
|
1654
|
+
// `title`), and that name must not outlive the page.
|
|
1655
|
+
const tab = tabTitle([here, data.project?.name, title]);
|
|
1656
|
+
const address = `${location.pathname}${location.search}`;
|
|
1657
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: the address is why it is said again
|
|
1658
|
+
useEffect(() => {
|
|
1659
|
+
if (typeof document !== "undefined") {
|
|
1660
|
+
document.title = tab;
|
|
1661
|
+
}
|
|
1662
|
+
}, [tab, address]);
|
|
1663
|
+
return (_jsx(LanguageContext.Provider, { value: pack, children: _jsx(RemotePicturesContext.Provider, { value: pictureSrc, children: _jsx(AvatarSetsContext.Provider, { value: avatarSets, children: content }) }) }));
|
|
1390
1664
|
}
|
|
1391
1665
|
return {
|
|
1392
1666
|
App,
|