@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/console.tsx
CHANGED
|
@@ -5,9 +5,11 @@ import {
|
|
|
5
5
|
useCallback,
|
|
6
6
|
useEffect,
|
|
7
7
|
useMemo,
|
|
8
|
+
useRef,
|
|
8
9
|
useState,
|
|
9
10
|
} from "react";
|
|
10
11
|
import { createRoot, type Root } from "react-dom/client";
|
|
12
|
+
import { AgentPage, AgentsNeedingYou } from "./agent-page.js";
|
|
11
13
|
import {
|
|
12
14
|
ApiError,
|
|
13
15
|
type ConsoleClient,
|
|
@@ -15,7 +17,8 @@ import {
|
|
|
15
17
|
type FileUpload,
|
|
16
18
|
OPEN_TASK_STATES,
|
|
17
19
|
PROJECT_RULES_TEMPLATE,
|
|
18
|
-
|
|
20
|
+
type RestAgent,
|
|
21
|
+
type RestAgentProposal,
|
|
19
22
|
type RestAnswerInput,
|
|
20
23
|
type RestComment,
|
|
21
24
|
type RestDecision,
|
|
@@ -36,21 +39,35 @@ import {
|
|
|
36
39
|
type RestTaskInput,
|
|
37
40
|
type RestToken,
|
|
38
41
|
type RestTokenCreated,
|
|
39
|
-
type
|
|
42
|
+
type RestWorkBrief,
|
|
40
43
|
RULES_PATH,
|
|
41
44
|
RULES_TITLE,
|
|
42
45
|
type TaskState,
|
|
43
46
|
type WeekStart,
|
|
44
47
|
} from "./api.js";
|
|
48
|
+
import { AVATAR_SETS, type AvatarSet } from "./avatar.js";
|
|
49
|
+
import {
|
|
50
|
+
AgentAccountForm,
|
|
51
|
+
type AgentAccountFormProps,
|
|
52
|
+
AgentAccountList,
|
|
53
|
+
type AgentAccountListProps,
|
|
54
|
+
agentAccountGroups,
|
|
55
|
+
} from "./components/agents.js";
|
|
45
56
|
import { Board, BoardFilters, type BoardProps, byDue, filterTasks } from "./components/board.js";
|
|
46
57
|
import { Calendar, type CalendarProps, Workload } from "./components/calendar.js";
|
|
47
58
|
import { CategoryList, type CategoryListProps } from "./components/categories.js";
|
|
48
59
|
import { ConnectWords } from "./components/connect.js";
|
|
49
60
|
import { DecisionForm } from "./components/decision-form.js";
|
|
50
|
-
import {
|
|
61
|
+
import {
|
|
62
|
+
type DecisionAddressing,
|
|
63
|
+
DecisionCard,
|
|
64
|
+
DecisionList,
|
|
65
|
+
type DecisionListProps,
|
|
66
|
+
} from "./components/decision-list.js";
|
|
67
|
+
import { DeskWords } from "./components/desk.js";
|
|
51
68
|
import { EventFeed, type EventFeedProps } from "./components/event-feed.js";
|
|
52
69
|
import { GoalForm, GoalList, type GoalListProps, GoalView, goalMonth } from "./components/goals.js";
|
|
53
|
-
import { HomeGrid, type HomeGridProps } from "./components/home.js";
|
|
70
|
+
import { HomeGrid, type HomeGridProps, type ProjectGlance } from "./components/home.js";
|
|
54
71
|
import { MyDecisions, ReachedDecision } from "./components/my-decisions.js";
|
|
55
72
|
import { PackTokenWays } from "./components/pack-token.js";
|
|
56
73
|
import { PAGE_SIZE } from "./components/paged.js";
|
|
@@ -58,6 +75,7 @@ import {
|
|
|
58
75
|
ListingForm,
|
|
59
76
|
PeopleList,
|
|
60
77
|
type PeopleListProps,
|
|
78
|
+
supervisedBy,
|
|
61
79
|
TeamForm,
|
|
62
80
|
TeamList,
|
|
63
81
|
type TeamListProps,
|
|
@@ -88,6 +106,8 @@ import { TaskList } from "./components/task-list.js";
|
|
|
88
106
|
import { TaskView, type TaskViewProps } from "./components/task-view.js";
|
|
89
107
|
import { NewToken, TokenForm, TokenList, type TokenListProps } from "./components/tokens.js";
|
|
90
108
|
import {
|
|
109
|
+
AvatarSetsContext,
|
|
110
|
+
Badge,
|
|
91
111
|
Button,
|
|
92
112
|
Callout,
|
|
93
113
|
CategoryBadge,
|
|
@@ -102,6 +122,8 @@ import {
|
|
|
102
122
|
import { WorkList, type WorkListProps } from "./components/work.js";
|
|
103
123
|
import {
|
|
104
124
|
peopleVisibilityOf,
|
|
125
|
+
WorkspaceServicesForm,
|
|
126
|
+
WorkspaceServicesView,
|
|
105
127
|
WorkspaceSettingsForm,
|
|
106
128
|
WorkspaceSettingsView,
|
|
107
129
|
weekStartOf,
|
|
@@ -110,6 +132,7 @@ import { ConnectPage } from "./connect-page.js";
|
|
|
110
132
|
import { type ConsoleData, useConsoleData } from "./data.js";
|
|
111
133
|
import { monthOf, today } from "./dates.js";
|
|
112
134
|
import { DocsPage } from "./docs-page.js";
|
|
135
|
+
import { createGlanceReader, type GlanceReader } from "./glances.js";
|
|
113
136
|
import {
|
|
114
137
|
browserPack,
|
|
115
138
|
chooseLanguage,
|
|
@@ -119,8 +142,13 @@ import {
|
|
|
119
142
|
type Messages,
|
|
120
143
|
useWords,
|
|
121
144
|
} from "./i18n/index.js";
|
|
145
|
+
import { type PersonaName, proposeAgents } from "./persona.js";
|
|
122
146
|
import { pluginNavItems, pluginPagesAt, pluginWordOf } from "./plugin-nav.js";
|
|
123
147
|
import {
|
|
148
|
+
type AgentsView,
|
|
149
|
+
agentHref,
|
|
150
|
+
agentsHref,
|
|
151
|
+
agentWorkHref,
|
|
124
152
|
boardHref,
|
|
125
153
|
calendarHref,
|
|
126
154
|
customPageHref,
|
|
@@ -151,6 +179,8 @@ import {
|
|
|
151
179
|
workHref,
|
|
152
180
|
} from "./router.js";
|
|
153
181
|
import { projectPath } from "./routes.js";
|
|
182
|
+
import { SetupPage } from "./setup-page.js";
|
|
183
|
+
import { currentTab, tabTitle } from "./tab-title.js";
|
|
154
184
|
import { errorWords, useAction } from "./use-action.js";
|
|
155
185
|
|
|
156
186
|
// The composition of the default console: the pages assembled from the components, with the
|
|
@@ -168,6 +198,8 @@ export interface ConsoleComponents {
|
|
|
168
198
|
readonly EventFeed: ComponentType<EventFeedProps>;
|
|
169
199
|
readonly SignIn: ComponentType<SignInProps>;
|
|
170
200
|
readonly TokenList: ComponentType<TokenListProps>;
|
|
201
|
+
readonly AgentAccountList: ComponentType<AgentAccountListProps>;
|
|
202
|
+
readonly AgentAccountForm: ComponentType<AgentAccountFormProps>;
|
|
171
203
|
readonly SessionList: ComponentType<SessionListProps>;
|
|
172
204
|
readonly PeopleList: ComponentType<PeopleListProps>;
|
|
173
205
|
readonly TeamList: ComponentType<TeamListProps>;
|
|
@@ -188,6 +220,8 @@ export const DEFAULT_COMPONENTS: ConsoleComponents = {
|
|
|
188
220
|
EventFeed,
|
|
189
221
|
SignIn,
|
|
190
222
|
TokenList,
|
|
223
|
+
AgentAccountList,
|
|
224
|
+
AgentAccountForm,
|
|
191
225
|
SessionList,
|
|
192
226
|
PeopleList,
|
|
193
227
|
TeamList,
|
|
@@ -226,6 +260,11 @@ export interface CustomPageContext {
|
|
|
226
260
|
/** The client, for what the data does not carry. */
|
|
227
261
|
readonly client: ConsoleClient;
|
|
228
262
|
readonly navigation: Navigation;
|
|
263
|
+
/**
|
|
264
|
+
* The query of the address the page is at, as the browser has it (`?view=figures`), or `""`:
|
|
265
|
+
* how a page of one's own is shown is said by its address, as every page's is (ADR-0010).
|
|
266
|
+
*/
|
|
267
|
+
readonly search: string;
|
|
229
268
|
/** The words of the language the pages speak, and its tag. */
|
|
230
269
|
readonly words: Messages;
|
|
231
270
|
readonly language: string;
|
|
@@ -261,6 +300,18 @@ export interface ConsoleConfig {
|
|
|
261
300
|
readonly client?: ConsoleClient | undefined;
|
|
262
301
|
/** Pages of the console's own, as tabs beside the default ones. */
|
|
263
302
|
readonly pages?: readonly CustomPage[] | undefined;
|
|
303
|
+
/**
|
|
304
|
+
* What an agent account's persona is proposed and drawn from (ADR-0084), in place of the
|
|
305
|
+
* package's: the names a new account is proposed, in each language, and the sets of shapes the
|
|
306
|
+
* avatars are drawn from on this console's pages. A set keeps its version for good; a console
|
|
307
|
+
* that brings shapes of its own gives them versions the package does not use.
|
|
308
|
+
*/
|
|
309
|
+
readonly persona?:
|
|
310
|
+
| {
|
|
311
|
+
readonly names?: readonly PersonaName[] | undefined;
|
|
312
|
+
readonly avatarSets?: readonly AvatarSet[] | undefined;
|
|
313
|
+
}
|
|
314
|
+
| undefined;
|
|
264
315
|
}
|
|
265
316
|
|
|
266
317
|
export interface ConsoleApp {
|
|
@@ -394,11 +445,13 @@ function Ground(props: { readonly children: React.ReactNode }) {
|
|
|
394
445
|
}
|
|
395
446
|
|
|
396
447
|
/**
|
|
397
|
-
* Whether the console holds a token rather than a session: a person's own console,
|
|
398
|
-
* their machine with
|
|
448
|
+
* Whether the console holds a token rather than a browser's session: a person's own console,
|
|
449
|
+
* served from their machine with what the command keeps (ADR-0014), a token or the command's own
|
|
450
|
+
* session (ADR-0084), which is held to what a token may ask. The API says so with `me.agent`,
|
|
451
|
+
* and with `me.session`.
|
|
399
452
|
*/
|
|
400
453
|
function holdsToken(data: ConsoleData): boolean {
|
|
401
|
-
return data.me !== undefined && data.me.agent !== null;
|
|
454
|
+
return data.me !== undefined && (data.me.agent !== null || data.me.session?.kind === "command");
|
|
402
455
|
}
|
|
403
456
|
|
|
404
457
|
/**
|
|
@@ -424,7 +477,6 @@ export function languageToKeep(
|
|
|
424
477
|
*/
|
|
425
478
|
export function onlyOnOwnPages(route: Route): boolean {
|
|
426
479
|
return (
|
|
427
|
-
route.name === "agents" ||
|
|
428
480
|
route.name === "sessions" ||
|
|
429
481
|
route.name === "new-token" ||
|
|
430
482
|
route.name === "person-agents" ||
|
|
@@ -437,6 +489,46 @@ function NotWithToken() {
|
|
|
437
489
|
return <EmptyState title={words.title} body={words.body} />;
|
|
438
490
|
}
|
|
439
491
|
|
|
492
|
+
/**
|
|
493
|
+
* The boards of the projects the front page shows at a glance (ADR-0105), each in one request
|
|
494
|
+
* (ADR-0107): read when its tile is first shown at such a size, each time the front page is
|
|
495
|
+
* shown, and again when the person comes back to the window, so that what a tile says is what
|
|
496
|
+
* holds now. A read that fails is tried again; one the console refuses leaves the tile with the
|
|
497
|
+
* project's own figure.
|
|
498
|
+
*/
|
|
499
|
+
function useGlances(client: ConsoleClient): {
|
|
500
|
+
readonly read: Readonly<Record<string, ProjectGlance>>;
|
|
501
|
+
readonly want: (projects: readonly RestProject[]) => void;
|
|
502
|
+
/** Reads every glance shown again. */
|
|
503
|
+
readonly renew: () => void;
|
|
504
|
+
} {
|
|
505
|
+
const [read, setRead] = useState<Readonly<Record<string, ProjectGlance>>>({});
|
|
506
|
+
const wanted = useRef<readonly RestProject[]>([]);
|
|
507
|
+
const reader = useRef<GlanceReader<RestProject> | undefined>(undefined);
|
|
508
|
+
useEffect(() => {
|
|
509
|
+
const made = createGlanceReader<RestProject, ProjectGlance>({
|
|
510
|
+
read: (project) => client.project(project.key).glance(),
|
|
511
|
+
store: (id, glance) => setRead((before) => ({ ...before, [id]: glance })),
|
|
512
|
+
// What the console refused it refuses again: a project that is not the person's to read.
|
|
513
|
+
again: (failure) =>
|
|
514
|
+
!(failure instanceof ApiError) || failure.status === 0 || failure.status >= 500,
|
|
515
|
+
});
|
|
516
|
+
reader.current = made;
|
|
517
|
+
// The grid said what it shows before this ran: a child's effect comes first.
|
|
518
|
+
made.want(wanted.current);
|
|
519
|
+
return () => {
|
|
520
|
+
made.stop();
|
|
521
|
+
reader.current = undefined;
|
|
522
|
+
};
|
|
523
|
+
}, [client]);
|
|
524
|
+
const want = useCallback((list: readonly RestProject[]) => {
|
|
525
|
+
wanted.current = list;
|
|
526
|
+
reader.current?.want(list);
|
|
527
|
+
}, []);
|
|
528
|
+
const renew = useCallback(() => reader.current?.renew(), []);
|
|
529
|
+
return { read, want, renew };
|
|
530
|
+
}
|
|
531
|
+
|
|
440
532
|
function ProjectsPage(props: {
|
|
441
533
|
readonly data: ConsoleData;
|
|
442
534
|
readonly components: ConsoleComponents;
|
|
@@ -454,6 +546,26 @@ function ProjectsPage(props: {
|
|
|
454
546
|
const [arranging, setArranging] = useState(false);
|
|
455
547
|
const { busy, error, act } = useAction();
|
|
456
548
|
const href = (project: RestProject) => projectHref(project.key);
|
|
549
|
+
const glances = useGlances(client);
|
|
550
|
+
// What waits in each project is read with the projects, once when the console opens. Each
|
|
551
|
+
// time the front page is shown after that, and when the person comes back to its window,
|
|
552
|
+
// the projects are read again, and the glances with them.
|
|
553
|
+
const { refreshProjects } = data.actions;
|
|
554
|
+
const loaded = useRef(data.loaded);
|
|
555
|
+
const { renew } = glances;
|
|
556
|
+
useEffect(() => {
|
|
557
|
+
if (loaded.current) {
|
|
558
|
+
refreshProjects().catch(() => undefined);
|
|
559
|
+
}
|
|
560
|
+
const back = () => {
|
|
561
|
+
if (document.visibilityState === "visible") {
|
|
562
|
+
refreshProjects().catch(() => undefined);
|
|
563
|
+
renew();
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
document.addEventListener("visibilitychange", back);
|
|
567
|
+
return () => document.removeEventListener("visibilitychange", back);
|
|
568
|
+
}, [refreshProjects, renew]);
|
|
457
569
|
// A project is made by an administrator (ADR-0045): a member sees the list alone, the form's
|
|
458
570
|
// address included.
|
|
459
571
|
const administrator = data.me?.person?.role === "admin";
|
|
@@ -506,6 +618,8 @@ function ProjectsPage(props: {
|
|
|
506
618
|
onDone={() => setArranging(false)}
|
|
507
619
|
projectHref={href}
|
|
508
620
|
onOpen={(project) => navigation.go(href(project))}
|
|
621
|
+
glances={glances.read}
|
|
622
|
+
onGlance={glances.want}
|
|
509
623
|
nameOf={(name) => pluginWordOf(name, language)}
|
|
510
624
|
renderWidget={(tile, size) =>
|
|
511
625
|
me === undefined ? null : (
|
|
@@ -781,7 +895,7 @@ function TaskPage(props: {
|
|
|
781
895
|
readonly navigation: Navigation;
|
|
782
896
|
readonly busy: boolean;
|
|
783
897
|
readonly error: string | undefined;
|
|
784
|
-
readonly act: (work: () => Promise<unknown>) => Promise<
|
|
898
|
+
readonly act: (work: () => Promise<unknown>) => Promise<unknown>;
|
|
785
899
|
}) {
|
|
786
900
|
const words = useWords();
|
|
787
901
|
const { route, project, data, components, navigation, busy, error, act } = props;
|
|
@@ -936,6 +1050,17 @@ function TaskPage(props: {
|
|
|
936
1050
|
onUpdateDecision={(decision, patch) =>
|
|
937
1051
|
void act(() => data.actions.updateDecision(decision.id, patch))
|
|
938
1052
|
}
|
|
1053
|
+
addressing={{
|
|
1054
|
+
people: data.members.map((member) => member.person),
|
|
1055
|
+
me: data.me?.person ?? undefined,
|
|
1056
|
+
onAddress: (decision, deciders) =>
|
|
1057
|
+
void act(() =>
|
|
1058
|
+
data.actions.addressDecision(
|
|
1059
|
+
decision.id,
|
|
1060
|
+
deciders.map((person) => person.id),
|
|
1061
|
+
),
|
|
1062
|
+
),
|
|
1063
|
+
}}
|
|
939
1064
|
onAbandonRun={(run) => void act(() => data.actions.abandonRun(run.id))}
|
|
940
1065
|
onArchive={(target) =>
|
|
941
1066
|
void act(async () => {
|
|
@@ -972,7 +1097,7 @@ function ProjectPage(props: {
|
|
|
972
1097
|
const { busy, error, act } = useAction();
|
|
973
1098
|
const tasksById = useMemo(() => new Map(data.tasks.map((task) => [task.id, task])), [data.tasks]);
|
|
974
1099
|
const key = project.key;
|
|
975
|
-
const href = (task:
|
|
1100
|
+
const href = (task: { readonly number: number }) => taskHref(key, task.number);
|
|
976
1101
|
const toDoc = (path: string) => docHref(key, path);
|
|
977
1102
|
const owner = project.role === "owner";
|
|
978
1103
|
|
|
@@ -982,6 +1107,19 @@ function ProjectPage(props: {
|
|
|
982
1107
|
void act(() => data.actions.answerDecision(decision.id, input));
|
|
983
1108
|
const onUpdate = (decision: RestDecision, patch: RestDecisionPatch) =>
|
|
984
1109
|
void act(() => data.actions.updateDecision(decision.id, patch));
|
|
1110
|
+
// Whom a waiting decision is for, said anew (ADR-0096), by anyone who may work here: the
|
|
1111
|
+
// people to name are the project's members, as where a decision is raised.
|
|
1112
|
+
const addressing: DecisionAddressing = {
|
|
1113
|
+
people: data.members.map((member) => member.person),
|
|
1114
|
+
me: data.me?.person ?? undefined,
|
|
1115
|
+
onAddress: (decision, deciders) =>
|
|
1116
|
+
void act(() =>
|
|
1117
|
+
data.actions.addressDecision(
|
|
1118
|
+
decision.id,
|
|
1119
|
+
deciders.map((person) => person.id),
|
|
1120
|
+
),
|
|
1121
|
+
),
|
|
1122
|
+
};
|
|
985
1123
|
|
|
986
1124
|
if (route.name === "board") {
|
|
987
1125
|
const me = data.me?.person ?? undefined;
|
|
@@ -1371,6 +1509,7 @@ function ProjectPage(props: {
|
|
|
1371
1509
|
pageHref={(page) => decisionsHref(key, page)}
|
|
1372
1510
|
onAnswer={onAnswer}
|
|
1373
1511
|
onUpdate={onUpdate}
|
|
1512
|
+
addressing={addressing}
|
|
1374
1513
|
busy={busy}
|
|
1375
1514
|
empty={
|
|
1376
1515
|
<EmptyState title={words.decisions.empty.title} body={words.decisions.empty.body} />
|
|
@@ -1424,6 +1563,7 @@ function ProjectPage(props: {
|
|
|
1424
1563
|
fileHref={(fileId) => projectPath(key, "files", fileId)}
|
|
1425
1564
|
onAnswer={onAnswer}
|
|
1426
1565
|
onUpdate={onUpdate}
|
|
1566
|
+
addressing={addressing}
|
|
1427
1567
|
busy={busy}
|
|
1428
1568
|
/>
|
|
1429
1569
|
)}
|
|
@@ -1908,7 +2048,7 @@ function SessionsPage(props: {
|
|
|
1908
2048
|
* from, which whoever runs the console set. Read by everyone; the rules written by an administrator.
|
|
1909
2049
|
*/
|
|
1910
2050
|
function WorkspaceSettingsPage(props: {
|
|
1911
|
-
readonly form: "rules" | "workspace" | "pack-token" | undefined;
|
|
2051
|
+
readonly form: "rules" | "workspace" | "services" | "pack-token" | undefined;
|
|
1912
2052
|
readonly data: ConsoleData;
|
|
1913
2053
|
readonly navigation: Navigation;
|
|
1914
2054
|
readonly language: string;
|
|
@@ -1953,7 +2093,7 @@ function WorkspaceSettingsPage(props: {
|
|
|
1953
2093
|
<RulesForm
|
|
1954
2094
|
rules={rules}
|
|
1955
2095
|
scope="workspace"
|
|
1956
|
-
template=
|
|
2096
|
+
template=""
|
|
1957
2097
|
busy={busy}
|
|
1958
2098
|
onSubmit={(input) =>
|
|
1959
2099
|
void act(async () => {
|
|
@@ -1969,12 +2109,6 @@ function WorkspaceSettingsPage(props: {
|
|
|
1969
2109
|
})
|
|
1970
2110
|
}
|
|
1971
2111
|
onCancel={() => navigation.back(PATHS.settings)}
|
|
1972
|
-
onReset={() =>
|
|
1973
|
-
void act(async () => {
|
|
1974
|
-
setRules(await data.actions.archiveRules());
|
|
1975
|
-
navigation.replace(PATHS.settings);
|
|
1976
|
-
})
|
|
1977
|
-
}
|
|
1978
2112
|
/>
|
|
1979
2113
|
)}
|
|
1980
2114
|
</section>
|
|
@@ -2021,6 +2155,31 @@ function WorkspaceSettingsPage(props: {
|
|
|
2021
2155
|
</>
|
|
2022
2156
|
);
|
|
2023
2157
|
}
|
|
2158
|
+
if (form === "services") {
|
|
2159
|
+
if (!administrator || workspace === undefined) {
|
|
2160
|
+
return <NothingHere />;
|
|
2161
|
+
}
|
|
2162
|
+
return (
|
|
2163
|
+
<>
|
|
2164
|
+
{head}
|
|
2165
|
+
{error !== undefined && <Callout tone="danger">{error}</Callout>}
|
|
2166
|
+
<section className="sc-panel sc-panel-form" aria-label={words.settings.services.aria}>
|
|
2167
|
+
<h2 className="sc-section-title">{words.settings.services.title}</h2>
|
|
2168
|
+
<WorkspaceServicesForm
|
|
2169
|
+
workspace={workspace}
|
|
2170
|
+
busy={busy}
|
|
2171
|
+
onSubmit={(patch) =>
|
|
2172
|
+
void act(async () => {
|
|
2173
|
+
await data.actions.updateWorkspace(patch);
|
|
2174
|
+
navigation.replace(PATHS.settings);
|
|
2175
|
+
})
|
|
2176
|
+
}
|
|
2177
|
+
onCancel={() => navigation.back(PATHS.settings)}
|
|
2178
|
+
/>
|
|
2179
|
+
</section>
|
|
2180
|
+
</>
|
|
2181
|
+
);
|
|
2182
|
+
}
|
|
2024
2183
|
if (form === "workspace") {
|
|
2025
2184
|
if (!administrator || workspace === undefined) {
|
|
2026
2185
|
return <NothingHere />;
|
|
@@ -2067,6 +2226,23 @@ function WorkspaceSettingsPage(props: {
|
|
|
2067
2226
|
<WorkspaceSettingsView workspace={workspace} console={data.me?.console} />
|
|
2068
2227
|
</section>
|
|
2069
2228
|
)}
|
|
2229
|
+
{workspace !== undefined && (
|
|
2230
|
+
<section className="sc-panel" aria-label={words.settings.services.aria}>
|
|
2231
|
+
<div className="sc-section-head">
|
|
2232
|
+
<h2 className="sc-section-title">{words.settings.services.title}</h2>
|
|
2233
|
+
{administrator && (
|
|
2234
|
+
<a
|
|
2235
|
+
className="sc-button sc-button-secondary sc-button-sm"
|
|
2236
|
+
href={settingsHref("services")}
|
|
2237
|
+
>
|
|
2238
|
+
{words.common.edit}
|
|
2239
|
+
</a>
|
|
2240
|
+
)}
|
|
2241
|
+
</div>
|
|
2242
|
+
<p className="sc-settings-hint">{words.settings.services.intro}</p>
|
|
2243
|
+
<WorkspaceServicesView workspace={workspace} />
|
|
2244
|
+
</section>
|
|
2245
|
+
)}
|
|
2070
2246
|
<section className="sc-panel" aria-label={words.rules.title}>
|
|
2071
2247
|
<h2 className="sc-section-title">{words.rules.title}</h2>
|
|
2072
2248
|
{rules === undefined ? (
|
|
@@ -2267,9 +2443,9 @@ function PersonAgentsPage(props: {
|
|
|
2267
2443
|
|
|
2268
2444
|
/** What a plate's page shows: the tasks, open and lately closed, and the decisions waiting on the person's own. */
|
|
2269
2445
|
interface Plate {
|
|
2270
|
-
readonly tasks:
|
|
2271
|
-
readonly closed?:
|
|
2272
|
-
readonly decisions?:
|
|
2446
|
+
readonly tasks: RestWorkBrief["tasks"];
|
|
2447
|
+
readonly closed?: RestWorkBrief["closed"] | undefined;
|
|
2448
|
+
readonly decisions?: RestWorkBrief["decisions"] | undefined;
|
|
2273
2449
|
}
|
|
2274
2450
|
|
|
2275
2451
|
/**
|
|
@@ -2287,13 +2463,43 @@ function rememberedAs<T>(key: string): T | undefined {
|
|
|
2287
2463
|
return shownBefore.get(key) as T | undefined;
|
|
2288
2464
|
}
|
|
2289
2465
|
|
|
2466
|
+
/** How long an answer asked for early stands for the page's own; past it, the page reads anew. */
|
|
2467
|
+
const EARLY_FRESH_MS = 30_000;
|
|
2468
|
+
/**
|
|
2469
|
+
* What the page the console opened on asked for along with who is signed in, by the name the
|
|
2470
|
+
* page takes it under: its own data a round trip sooner than once the person and the workspace
|
|
2471
|
+
* are known. Taken once, by the page it was asked for.
|
|
2472
|
+
*/
|
|
2473
|
+
const askedEarly = new Map<string, { readonly answer: Promise<unknown>; readonly at: number }>();
|
|
2474
|
+
function askEarly(name: string, ask: () => Promise<unknown>): void {
|
|
2475
|
+
if (!askedEarly.has(name)) {
|
|
2476
|
+
const answer = ask();
|
|
2477
|
+
answer.catch(() => undefined);
|
|
2478
|
+
askedEarly.set(name, { answer, at: Date.now() });
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2481
|
+
/** The answer asked for early under the name, once, while it is fresh; nothing otherwise. */
|
|
2482
|
+
function takeEarly<T>(name: string): Promise<T> | undefined {
|
|
2483
|
+
const asked = askedEarly.get(name);
|
|
2484
|
+
askedEarly.delete(name);
|
|
2485
|
+
return asked !== undefined && Date.now() - asked.at <= EARLY_FRESH_MS
|
|
2486
|
+
? (asked.answer as Promise<T>)
|
|
2487
|
+
: undefined;
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2290
2490
|
function PlatePage(props: {
|
|
2291
2491
|
readonly components: ConsoleComponents;
|
|
2292
2492
|
/** Reads the plate; stable across renders, since the page reads again whenever it changes. */
|
|
2293
2493
|
readonly load: (signal: AbortSignal) => Promise<Plate>;
|
|
2294
2494
|
/** What the plate is remembered by, with whose it is: come back to, the page shows it at once and reads again. */
|
|
2295
2495
|
readonly remember: string;
|
|
2496
|
+
/** The name the plate was asked for under as the console opened (`askEarly`), where it was; taken once. */
|
|
2497
|
+
readonly early?: string | undefined;
|
|
2296
2498
|
readonly title: string;
|
|
2499
|
+
/** Where the plate is a view of a page with a head of its own, an agent account's: no second head. */
|
|
2500
|
+
readonly headless?: boolean | undefined;
|
|
2501
|
+
/** A line under the title: what the member whose plate it is does (ADR-0084), where a title says. */
|
|
2502
|
+
readonly lead?: string | undefined;
|
|
2297
2503
|
/** What stands beside the title: the way back, on another person's plate. */
|
|
2298
2504
|
readonly aside?: ReactNode;
|
|
2299
2505
|
/** A day of the week shown at the top, from the address; today's week when it names none. */
|
|
@@ -2308,7 +2514,7 @@ function PlatePage(props: {
|
|
|
2308
2514
|
readonly weekStart?: WeekStart | undefined;
|
|
2309
2515
|
}) {
|
|
2310
2516
|
const words = useWords();
|
|
2311
|
-
const { components, load, couldNotLoad, refused, remember } = props;
|
|
2517
|
+
const { components, load, couldNotLoad, refused, remember, early } = props;
|
|
2312
2518
|
const [plate, setPlate] = useState<Plate | undefined>(() => rememberedAs<Plate>(remember));
|
|
2313
2519
|
const [problem, setProblem] = useState<string | undefined>(undefined);
|
|
2314
2520
|
const [forbidden, setForbidden] = useState(false);
|
|
@@ -2317,7 +2523,9 @@ function PlatePage(props: {
|
|
|
2317
2523
|
setPlate(rememberedAs<Plate>(remember));
|
|
2318
2524
|
setProblem(undefined);
|
|
2319
2525
|
setForbidden(false);
|
|
2320
|
-
|
|
2526
|
+
// What was asked for as the console opened is taken; else the plate is read now.
|
|
2527
|
+
const asked = early === undefined ? undefined : takeEarly<Plate>(early);
|
|
2528
|
+
(asked === undefined ? load(controller.signal) : asked.catch(() => load(controller.signal)))
|
|
2321
2529
|
.then((answer) => {
|
|
2322
2530
|
if (!controller.signal.aborted) {
|
|
2323
2531
|
shownBefore.set(remember, answer);
|
|
@@ -2339,13 +2547,16 @@ function PlatePage(props: {
|
|
|
2339
2547
|
}
|
|
2340
2548
|
});
|
|
2341
2549
|
return () => controller.abort();
|
|
2342
|
-
}, [load, couldNotLoad, refused, remember]);
|
|
2550
|
+
}, [load, couldNotLoad, refused, remember, early]);
|
|
2343
2551
|
return (
|
|
2344
2552
|
<>
|
|
2345
|
-
|
|
2346
|
-
<
|
|
2347
|
-
|
|
2348
|
-
|
|
2553
|
+
{props.headless !== true && (
|
|
2554
|
+
<div className="sc-page-head">
|
|
2555
|
+
<h1 className="sc-page-title">{props.title}</h1>
|
|
2556
|
+
{props.lead !== undefined && <p className="sc-page-lead">{props.lead}</p>}
|
|
2557
|
+
{props.aside}
|
|
2558
|
+
</div>
|
|
2559
|
+
)}
|
|
2349
2560
|
{problem !== undefined && <Callout tone="danger">{problem}</Callout>}
|
|
2350
2561
|
{forbidden && refused !== undefined ? (
|
|
2351
2562
|
<EmptyState
|
|
@@ -2386,7 +2597,7 @@ function PlatePage(props: {
|
|
|
2386
2597
|
function MyDecisionPage(props: { readonly id: string; readonly data: ConsoleData }) {
|
|
2387
2598
|
const words = useWords();
|
|
2388
2599
|
const { id, data } = props;
|
|
2389
|
-
const { reachDecision, answerReachedDecision } = data.actions;
|
|
2600
|
+
const { reachDecision, answerReachedDecision, addressDecisionIn, membersOf } = data.actions;
|
|
2390
2601
|
const [reached, setReached] = useState<RestReachedDecision | undefined>(undefined);
|
|
2391
2602
|
const [problem, setProblem] = useState<string | undefined>(undefined);
|
|
2392
2603
|
const { busy, error, act } = useAction();
|
|
@@ -2434,6 +2645,21 @@ function MyDecisionPage(props: { readonly id: string; readonly data: ConsoleData
|
|
|
2434
2645
|
);
|
|
2435
2646
|
})
|
|
2436
2647
|
}
|
|
2648
|
+
addressing={{
|
|
2649
|
+
people: () => membersOf(reached.project.key),
|
|
2650
|
+
me: data.me?.person ?? undefined,
|
|
2651
|
+
onAddress: (_decision, deciders) =>
|
|
2652
|
+
void act(async () => {
|
|
2653
|
+
const addressed = await addressDecisionIn(
|
|
2654
|
+
reached.project.key,
|
|
2655
|
+
id,
|
|
2656
|
+
deciders.map((person) => person.id),
|
|
2657
|
+
);
|
|
2658
|
+
setReached((current) =>
|
|
2659
|
+
current === undefined ? current : { ...current, decision: addressed },
|
|
2660
|
+
);
|
|
2661
|
+
}),
|
|
2662
|
+
}}
|
|
2437
2663
|
busy={busy}
|
|
2438
2664
|
/>
|
|
2439
2665
|
)}
|
|
@@ -2482,7 +2708,13 @@ function useMyDecisions(
|
|
|
2482
2708
|
async (offset: number, signal?: AbortSignal) => {
|
|
2483
2709
|
setBusy(true);
|
|
2484
2710
|
try {
|
|
2485
|
-
const
|
|
2711
|
+
const ask = () => myDecisions({ raised, limit: MY_DECISIONS_PAGE, offset }, signal);
|
|
2712
|
+
// The first page may have been asked for as the console opened: taken, else read now.
|
|
2713
|
+
const asked =
|
|
2714
|
+
offset === 0
|
|
2715
|
+
? takeEarly<RestMyDecisions>(`decisions:${raised ? "raised" : "addressed"}`)
|
|
2716
|
+
: undefined;
|
|
2717
|
+
const page = asked === undefined ? await ask() : await asked.catch(ask);
|
|
2486
2718
|
if (signal?.aborted === true) {
|
|
2487
2719
|
return;
|
|
2488
2720
|
}
|
|
@@ -2523,7 +2755,7 @@ function useMyDecisions(
|
|
|
2523
2755
|
*/
|
|
2524
2756
|
function MyDecisionsPage(props: { readonly data: ConsoleData }) {
|
|
2525
2757
|
const words = useWords();
|
|
2526
|
-
const { myDecisions, answerReachedDecision } = props.data.actions;
|
|
2758
|
+
const { myDecisions, answerReachedDecision, addressDecisionIn, membersOf } = props.data.actions;
|
|
2527
2759
|
const whose = props.data.me?.person?.id ?? "";
|
|
2528
2760
|
const addressed = useMyDecisions(
|
|
2529
2761
|
myDecisions,
|
|
@@ -2572,6 +2804,20 @@ function MyDecisionsPage(props: { readonly data: ConsoleData }) {
|
|
|
2572
2804
|
: myDecisionHref(decisionId)
|
|
2573
2805
|
}
|
|
2574
2806
|
onAnswer={onAnswer}
|
|
2807
|
+
addressing={(projectKey) => ({
|
|
2808
|
+
people: () => membersOf(projectKey),
|
|
2809
|
+
me: props.data.me?.person ?? undefined,
|
|
2810
|
+
onAddress: (decision, deciders) =>
|
|
2811
|
+
void act(async () => {
|
|
2812
|
+
await addressDecisionIn(
|
|
2813
|
+
projectKey,
|
|
2814
|
+
decision.id,
|
|
2815
|
+
deciders.map((person) => person.id),
|
|
2816
|
+
);
|
|
2817
|
+
addressed.reload();
|
|
2818
|
+
raised.reload();
|
|
2819
|
+
}),
|
|
2820
|
+
})}
|
|
2575
2821
|
busy={busy || addressed.busy || raised.busy}
|
|
2576
2822
|
/>
|
|
2577
2823
|
)}
|
|
@@ -2585,20 +2831,24 @@ function WorkPage(props: {
|
|
|
2585
2831
|
readonly week: string | undefined;
|
|
2586
2832
|
}) {
|
|
2587
2833
|
const words = useWords();
|
|
2588
|
-
const {
|
|
2834
|
+
const { plate } = props.data.actions;
|
|
2589
2835
|
return (
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2836
|
+
<>
|
|
2837
|
+
<AgentsNeedingYou agents={props.data.agents} me={props.data.me?.person?.id} />
|
|
2838
|
+
<PlatePage
|
|
2839
|
+
components={props.components}
|
|
2840
|
+
load={plate}
|
|
2841
|
+
remember={`work:${props.data.me?.person?.id ?? ""}`}
|
|
2842
|
+
early="work"
|
|
2843
|
+
title={words.work.title}
|
|
2844
|
+
week={props.week}
|
|
2845
|
+
weekStart={weekStartOf(props.data.me?.workspace)}
|
|
2846
|
+
weekHref={workHref}
|
|
2847
|
+
loading={words.work.loading}
|
|
2848
|
+
couldNotLoad={words.work.couldNotLoad}
|
|
2849
|
+
empty={words.work.empty}
|
|
2850
|
+
/>
|
|
2851
|
+
</>
|
|
2602
2852
|
);
|
|
2603
2853
|
}
|
|
2604
2854
|
|
|
@@ -2613,14 +2863,15 @@ function PersonWorkPage(props: {
|
|
|
2613
2863
|
const { id, data } = props;
|
|
2614
2864
|
const person = data.people.find((candidate) => candidate.id === id);
|
|
2615
2865
|
const name = person === undefined ? "?" : personName(person);
|
|
2616
|
-
const {
|
|
2617
|
-
const load = useCallback((signal: AbortSignal) =>
|
|
2866
|
+
const { personPlate } = data.actions;
|
|
2867
|
+
const load = useCallback((signal: AbortSignal) => personPlate(id, signal), [personPlate, id]);
|
|
2618
2868
|
return (
|
|
2619
2869
|
<PlatePage
|
|
2620
2870
|
components={props.components}
|
|
2621
2871
|
load={load}
|
|
2622
2872
|
remember={`work:${data.me?.person?.id ?? ""}:${id}`}
|
|
2623
2873
|
title={words.people.workOf(name)}
|
|
2874
|
+
lead={person?.title ?? undefined}
|
|
2624
2875
|
aside={<LinkButton href={PATHS.people}>{words.nav.people}</LinkButton>}
|
|
2625
2876
|
week={props.week}
|
|
2626
2877
|
weekStart={weekStartOf(data.me?.workspace)}
|
|
@@ -2633,6 +2884,146 @@ function PersonWorkPage(props: {
|
|
|
2633
2884
|
);
|
|
2634
2885
|
}
|
|
2635
2886
|
|
|
2887
|
+
/** An agent account's plate on its own page (ADR-0084): its work as a member's, for whoever oversees it. */
|
|
2888
|
+
function AgentWork(props: {
|
|
2889
|
+
readonly agent: RestAgent;
|
|
2890
|
+
readonly data: ConsoleData;
|
|
2891
|
+
readonly components: ConsoleComponents;
|
|
2892
|
+
readonly week: string | undefined;
|
|
2893
|
+
}) {
|
|
2894
|
+
const words = useWords();
|
|
2895
|
+
const { agent, data } = props;
|
|
2896
|
+
const { id } = agent.person;
|
|
2897
|
+
const handle = agent.person.handle ?? "";
|
|
2898
|
+
const name = personName(agent.person);
|
|
2899
|
+
const { personPlate } = data.actions;
|
|
2900
|
+
const load = useCallback((signal: AbortSignal) => personPlate(id, signal), [personPlate, id]);
|
|
2901
|
+
return (
|
|
2902
|
+
<PlatePage
|
|
2903
|
+
components={props.components}
|
|
2904
|
+
load={load}
|
|
2905
|
+
remember={`work:${data.me?.person?.id ?? ""}:${id}`}
|
|
2906
|
+
title={words.people.workOf(name)}
|
|
2907
|
+
headless
|
|
2908
|
+
week={props.week}
|
|
2909
|
+
weekStart={weekStartOf(data.me?.workspace)}
|
|
2910
|
+
weekHref={(day) => agentWorkHref(handle, day)}
|
|
2911
|
+
loading={words.people.loadingWork}
|
|
2912
|
+
couldNotLoad={words.people.couldNotLoadWork}
|
|
2913
|
+
empty={{ title: words.people.noWork.title(name), body: words.people.noWork.body }}
|
|
2914
|
+
refused={words.people.notOverseen}
|
|
2915
|
+
/>
|
|
2916
|
+
);
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
/** Seeds of the page's own for personas proposed here: twelve characters nobody chose, each. */
|
|
2920
|
+
function freshSeeds(count: number): string[] {
|
|
2921
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
2922
|
+
const bytes = crypto.getRandomValues(new Uint8Array(count * 12));
|
|
2923
|
+
return Array.from({ length: count }, (_, index) =>
|
|
2924
|
+
Array.from(
|
|
2925
|
+
bytes.subarray(index * 12, (index + 1) * 12),
|
|
2926
|
+
(byte) => alphabet[byte % alphabet.length],
|
|
2927
|
+
).join(""),
|
|
2928
|
+
);
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
/** How many personas the form proposes at a time. */
|
|
2932
|
+
const PROPOSALS_SHOWN = 4;
|
|
2933
|
+
|
|
2934
|
+
/**
|
|
2935
|
+
* "Add an agent account" (ADR-0084), for an administrator: a few personas proposed, by the
|
|
2936
|
+
* console, or from the names a console of one's own brings; the form; and back to the accounts
|
|
2937
|
+
* once one is made.
|
|
2938
|
+
*/
|
|
2939
|
+
function NewAgentPage(props: {
|
|
2940
|
+
readonly data: ConsoleData;
|
|
2941
|
+
readonly components: ConsoleComponents;
|
|
2942
|
+
readonly navigation: Navigation;
|
|
2943
|
+
readonly language: string;
|
|
2944
|
+
readonly names: readonly PersonaName[] | undefined;
|
|
2945
|
+
readonly avatarSets: readonly AvatarSet[] | undefined;
|
|
2946
|
+
}) {
|
|
2947
|
+
const words = useWords();
|
|
2948
|
+
const accounts = words.agents.accounts;
|
|
2949
|
+
const { data, components, navigation, language, names, avatarSets } = props;
|
|
2950
|
+
const { busy, error, act } = useAction();
|
|
2951
|
+
const [proposals, setProposals] = useState<readonly RestAgentProposal[]>([]);
|
|
2952
|
+
/** Whether the proposals asked for last could not be read: the form says so, and is filled in by hand. */
|
|
2953
|
+
const [proposalsFailed, setProposalsFailed] = useState(false);
|
|
2954
|
+
const [round, setRound] = useState(0);
|
|
2955
|
+
const { agentProposals } = data.actions;
|
|
2956
|
+
const taken = data.agents.map((agent) => agent.person.handle ?? "").join(" ");
|
|
2957
|
+
const me = data.me?.person ?? undefined;
|
|
2958
|
+
const administrator = me?.role === "admin";
|
|
2959
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: `round` is the trigger, rolled again by the form
|
|
2960
|
+
useEffect(() => {
|
|
2961
|
+
if (!administrator) {
|
|
2962
|
+
return;
|
|
2963
|
+
}
|
|
2964
|
+
if (names !== undefined) {
|
|
2965
|
+
// A console that brings names of its own proposes from them here, as the console does.
|
|
2966
|
+
setProposals(
|
|
2967
|
+
proposeAgents(freshSeeds(PROPOSALS_SHOWN), {
|
|
2968
|
+
names,
|
|
2969
|
+
lang: language,
|
|
2970
|
+
taken: taken.split(" "),
|
|
2971
|
+
sets: avatarSets,
|
|
2972
|
+
}),
|
|
2973
|
+
);
|
|
2974
|
+
return;
|
|
2975
|
+
}
|
|
2976
|
+
const controller = new AbortController();
|
|
2977
|
+
setProposalsFailed(false);
|
|
2978
|
+
agentProposals(PROPOSALS_SHOWN, language, controller.signal)
|
|
2979
|
+
.then((answer) => {
|
|
2980
|
+
if (!controller.signal.aborted) {
|
|
2981
|
+
setProposals(answer.items);
|
|
2982
|
+
}
|
|
2983
|
+
})
|
|
2984
|
+
.catch(() => {
|
|
2985
|
+
if (!controller.signal.aborted) {
|
|
2986
|
+
setProposalsFailed(true);
|
|
2987
|
+
}
|
|
2988
|
+
});
|
|
2989
|
+
return () => controller.abort();
|
|
2990
|
+
}, [round, administrator, names, avatarSets, language, taken, agentProposals]);
|
|
2991
|
+
return (
|
|
2992
|
+
<>
|
|
2993
|
+
<div className="sc-page-head">
|
|
2994
|
+
<h1 className="sc-page-title">{accounts.add}</h1>
|
|
2995
|
+
</div>
|
|
2996
|
+
{!administrator ? (
|
|
2997
|
+
<Callout tone="warning">{words.errors["auth.forbidden"]}</Callout>
|
|
2998
|
+
) : (
|
|
2999
|
+
<section className="sc-panel sc-panel-form" aria-label={accounts.add}>
|
|
3000
|
+
<components.AgentAccountForm
|
|
3001
|
+
proposals={proposals}
|
|
3002
|
+
proposalsFailed={proposalsFailed}
|
|
3003
|
+
onRoll={() => setRound((current) => current + 1)}
|
|
3004
|
+
providers={data.me?.signIn ?? []}
|
|
3005
|
+
workspace={data.me?.workspace}
|
|
3006
|
+
people={data.people}
|
|
3007
|
+
me={me}
|
|
3008
|
+
projects={data.projects}
|
|
3009
|
+
busy={busy}
|
|
3010
|
+
error={error}
|
|
3011
|
+
onSubmit={(input) =>
|
|
3012
|
+
void act(async () => {
|
|
3013
|
+
await data.actions.createAgent(input);
|
|
3014
|
+
// To the account's page, which says what is next: the invitation that leads a
|
|
3015
|
+
// machine to it, made there.
|
|
3016
|
+
navigation.replace(agentHref(input.handle));
|
|
3017
|
+
})
|
|
3018
|
+
}
|
|
3019
|
+
onCancel={() => navigation.back(PATHS.agents)}
|
|
3020
|
+
/>
|
|
3021
|
+
</section>
|
|
3022
|
+
)}
|
|
3023
|
+
</>
|
|
3024
|
+
);
|
|
3025
|
+
}
|
|
3026
|
+
|
|
2636
3027
|
function WorkspacePage(props: {
|
|
2637
3028
|
readonly route: Route;
|
|
2638
3029
|
readonly data: ConsoleData;
|
|
@@ -2640,9 +3031,11 @@ function WorkspacePage(props: {
|
|
|
2640
3031
|
readonly navigation: Navigation;
|
|
2641
3032
|
readonly client: ConsoleClient;
|
|
2642
3033
|
readonly language: string;
|
|
3034
|
+
/** The names and the shapes a console of one's own proposes and draws agent accounts with (ADR-0084). */
|
|
3035
|
+
readonly persona?: ConsoleConfig["persona"];
|
|
2643
3036
|
}) {
|
|
2644
3037
|
const words = useWords();
|
|
2645
|
-
const { route, data, components, navigation, client, language } = props;
|
|
3038
|
+
const { route, data, components, navigation, client, language, persona } = props;
|
|
2646
3039
|
const [fresh, setFresh] = useState<RestTokenCreated | undefined>(undefined);
|
|
2647
3040
|
const { busy, error, act } = useAction();
|
|
2648
3041
|
if (route.name === "plugin" && route.level === "workspace") {
|
|
@@ -2873,6 +3266,10 @@ function WorkspacePage(props: {
|
|
|
2873
3266
|
? (person, email) => void act(() => data.actions.updatePerson(person.id, { email }))
|
|
2874
3267
|
: undefined
|
|
2875
3268
|
}
|
|
3269
|
+
onChangeTitle={(person, title) =>
|
|
3270
|
+
void act(() => data.actions.updatePerson(person.id, { title }))
|
|
3271
|
+
}
|
|
3272
|
+
mayChangeTitle={(person) => administrator || supervisedBy(me, person, data.people)}
|
|
2876
3273
|
onUnlist={
|
|
2877
3274
|
administrator
|
|
2878
3275
|
? (listing) => void act(() => data.actions.removeListing(listing.id))
|
|
@@ -2892,6 +3289,7 @@ function WorkspacePage(props: {
|
|
|
2892
3289
|
}
|
|
2893
3290
|
workHref={oversees ? (person) => personWorkHref(person.id) : undefined}
|
|
2894
3291
|
agentsHref={administrator ? (person) => personAgentsHref(person.id) : undefined}
|
|
3292
|
+
agentHref={(person) => agentHref(person.handle ?? "")}
|
|
2895
3293
|
/>
|
|
2896
3294
|
)}
|
|
2897
3295
|
</>
|
|
@@ -2903,47 +3301,175 @@ function WorkspacePage(props: {
|
|
|
2903
3301
|
if (route.name === "connect") {
|
|
2904
3302
|
return <ConnectPage code={route.code} data={data} navigation={navigation} />;
|
|
2905
3303
|
}
|
|
3304
|
+
if (route.name === "agent") {
|
|
3305
|
+
return (
|
|
3306
|
+
<AgentPage
|
|
3307
|
+
// Keyed by the account, so that going from one account to another by the browser's
|
|
3308
|
+
// history begins a page of its own: no name, title or hours of the one in the other's fields.
|
|
3309
|
+
key={route.handle}
|
|
3310
|
+
handle={route.handle}
|
|
3311
|
+
tab={route.tab}
|
|
3312
|
+
session={route.session}
|
|
3313
|
+
client={client}
|
|
3314
|
+
viaToken={holdsToken(data)}
|
|
3315
|
+
providers={data.me?.signIn}
|
|
3316
|
+
work={(agent) => (
|
|
3317
|
+
<AgentWork agent={agent} data={data} components={components} week={route.week} />
|
|
3318
|
+
)}
|
|
3319
|
+
/>
|
|
3320
|
+
);
|
|
3321
|
+
}
|
|
3322
|
+
if (route.name === "new-agent") {
|
|
3323
|
+
return (
|
|
3324
|
+
<NewAgentPage
|
|
3325
|
+
data={data}
|
|
3326
|
+
components={components}
|
|
3327
|
+
navigation={navigation}
|
|
3328
|
+
language={language}
|
|
3329
|
+
names={persona?.names}
|
|
3330
|
+
avatarSets={persona?.avatarSets}
|
|
3331
|
+
/>
|
|
3332
|
+
);
|
|
3333
|
+
}
|
|
2906
3334
|
if (route.name === "agents" || route.name === "new-token") {
|
|
2907
3335
|
const agents = words.agents;
|
|
3336
|
+
const accounts = agents.accounts;
|
|
2908
3337
|
const making = route.name === "new-token";
|
|
2909
3338
|
const origin = typeof window === "undefined" ? "" : window.location.origin;
|
|
3339
|
+
const me = data.me?.person ?? undefined;
|
|
3340
|
+
const administrator = me?.role === "admin";
|
|
3341
|
+
// A console held through a token shows no tokens: the agents that act as a person are
|
|
3342
|
+
// listed where that person is signed in.
|
|
3343
|
+
const viaToken = holdsToken(data);
|
|
3344
|
+
const view: AgentsView = making ? "connected" : route.view;
|
|
3345
|
+
// The agent accounts (ADR-0084) whoever is looking manages, theirs to look after, and
|
|
3346
|
+
// under them, for an administrator, the ones someone else manages.
|
|
3347
|
+
const { managed: mine, others } = agentAccountGroups(data.agents, me, data.people);
|
|
3348
|
+
const views: readonly {
|
|
3349
|
+
readonly view: AgentsView;
|
|
3350
|
+
readonly label: string;
|
|
3351
|
+
readonly count: number;
|
|
3352
|
+
}[] = [
|
|
3353
|
+
{ view: "mine", label: agents.views.mine, count: mine.length },
|
|
3354
|
+
...(viaToken
|
|
3355
|
+
? []
|
|
3356
|
+
: [
|
|
3357
|
+
{
|
|
3358
|
+
view: "connected" as const,
|
|
3359
|
+
label: agents.views.connected,
|
|
3360
|
+
count: data.tokens.length,
|
|
3361
|
+
},
|
|
3362
|
+
]),
|
|
3363
|
+
];
|
|
3364
|
+
if (view === "connected" && viaToken) {
|
|
3365
|
+
return <NothingHere />;
|
|
3366
|
+
}
|
|
2910
3367
|
return (
|
|
2911
3368
|
<>
|
|
2912
3369
|
<div className="sc-page-head">
|
|
2913
3370
|
<h1 className="sc-page-title">{agents.title}</h1>
|
|
2914
|
-
{
|
|
3371
|
+
{view !== "connected" && administrator && (
|
|
3372
|
+
<LinkButton href={PATHS.newAgent} variant="primary">
|
|
3373
|
+
{accounts.add}
|
|
3374
|
+
</LinkButton>
|
|
3375
|
+
)}
|
|
3376
|
+
{view === "connected" && !making && (
|
|
2915
3377
|
<LinkButton href={PATHS.newToken} variant="primary">
|
|
2916
3378
|
{agents.makeByHand}
|
|
2917
3379
|
</LinkButton>
|
|
2918
3380
|
)}
|
|
2919
3381
|
</div>
|
|
3382
|
+
<nav className="sc-subtabs sc-agents-views" aria-label={agents.views.aria}>
|
|
3383
|
+
{views.map((one) => (
|
|
3384
|
+
<a
|
|
3385
|
+
key={one.view}
|
|
3386
|
+
className={cx("sc-tab", one.view === view && "sc-tab-current")}
|
|
3387
|
+
href={agentsHref(one.view)}
|
|
3388
|
+
aria-current={one.view === view ? "page" : undefined}
|
|
3389
|
+
>
|
|
3390
|
+
{one.label}
|
|
3391
|
+
<span className="sc-tab-count">{one.count}</span>
|
|
3392
|
+
</a>
|
|
3393
|
+
))}
|
|
3394
|
+
</nav>
|
|
2920
3395
|
{error !== undefined && <Callout tone="danger">{error}</Callout>}
|
|
2921
|
-
{
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
3396
|
+
{view !== "connected" ? (
|
|
3397
|
+
<>
|
|
3398
|
+
<section className="sc-people-group" aria-label={agents.views.mine}>
|
|
3399
|
+
<p className="sc-lead">{accounts.intro}</p>
|
|
3400
|
+
<components.AgentAccountList
|
|
3401
|
+
agents={mine}
|
|
3402
|
+
me={me}
|
|
3403
|
+
busy={busy}
|
|
3404
|
+
href={(agent) => agentHref(agent.person.handle ?? "")}
|
|
3405
|
+
empty={
|
|
3406
|
+
others.length > 0 ? (
|
|
3407
|
+
// The accounts under this say that there are some: a line is enough here.
|
|
3408
|
+
<p className="sc-field-hint">{accounts.mineEmpty.title}</p>
|
|
3409
|
+
) : administrator ? (
|
|
3410
|
+
<EmptyState title={accounts.empty.title} body={accounts.empty.body} />
|
|
3411
|
+
) : (
|
|
3412
|
+
<EmptyState
|
|
3413
|
+
title={accounts.mineEmpty.title}
|
|
3414
|
+
body={accounts.mineEmpty.body}
|
|
3415
|
+
action={<LinkButton href={PATHS.people}>{words.nav.people}</LinkButton>}
|
|
3416
|
+
/>
|
|
3417
|
+
)
|
|
3418
|
+
}
|
|
3419
|
+
/>
|
|
3420
|
+
</section>
|
|
3421
|
+
{others.length > 0 && (
|
|
3422
|
+
<section className="sc-people-group" aria-label={accounts.others}>
|
|
3423
|
+
<h2 className="sc-section-title">
|
|
3424
|
+
{accounts.others}
|
|
3425
|
+
<Badge kind="count">{others.length}</Badge>
|
|
3426
|
+
</h2>
|
|
3427
|
+
<p className="sc-lead">{accounts.othersIntro}</p>
|
|
3428
|
+
<components.AgentAccountList
|
|
3429
|
+
agents={others}
|
|
3430
|
+
me={me}
|
|
3431
|
+
busy={busy}
|
|
3432
|
+
href={(agent) => agentHref(agent.person.handle ?? "")}
|
|
3433
|
+
/>
|
|
3434
|
+
</section>
|
|
3435
|
+
)}
|
|
3436
|
+
</>
|
|
3437
|
+
) : (
|
|
3438
|
+
<section aria-label={agents.views.connected}>
|
|
3439
|
+
<p className="sc-lead">{accounts.yoursIntro}</p>
|
|
3440
|
+
{fresh !== undefined && (
|
|
3441
|
+
<NewToken
|
|
3442
|
+
token={fresh.token}
|
|
3443
|
+
secret={fresh.secret}
|
|
3444
|
+
onDone={() => setFresh(undefined)}
|
|
3445
|
+
/>
|
|
3446
|
+
)}
|
|
3447
|
+
{making && (
|
|
3448
|
+
<section className="sc-panel sc-panel-form" aria-label={agents.makeAria}>
|
|
3449
|
+
<TokenForm
|
|
3450
|
+
daysAtMost={data.me?.workspace.tokenDaysAtMost}
|
|
3451
|
+
busy={busy}
|
|
3452
|
+
onSubmit={(input) =>
|
|
3453
|
+
void act(async () => {
|
|
3454
|
+
setFresh(await data.actions.createToken(input));
|
|
3455
|
+
navigation.replace(agentsHref("connected"));
|
|
3456
|
+
})
|
|
3457
|
+
}
|
|
3458
|
+
onCancel={() => navigation.back(agentsHref("connected"))}
|
|
3459
|
+
/>
|
|
3460
|
+
</section>
|
|
3461
|
+
)}
|
|
3462
|
+
<components.TokenList
|
|
3463
|
+
tokens={data.tokens}
|
|
2928
3464
|
busy={busy}
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
navigation.replace(PATHS.agents);
|
|
2933
|
-
})
|
|
2934
|
-
}
|
|
2935
|
-
onCancel={() => navigation.back(PATHS.agents)}
|
|
3465
|
+
consoleVersion={data.me?.console?.version}
|
|
3466
|
+
onRevoke={(token) => void act(() => data.actions.revokeToken(token.id))}
|
|
3467
|
+
empty={<EmptyState title={agents.empty.title} body={agents.empty.body} />}
|
|
2936
3468
|
/>
|
|
3469
|
+
<ConnectWords origin={origin} />
|
|
3470
|
+
<DeskWords origin={origin} />
|
|
2937
3471
|
</section>
|
|
2938
3472
|
)}
|
|
2939
|
-
<components.TokenList
|
|
2940
|
-
tokens={data.tokens}
|
|
2941
|
-
busy={busy}
|
|
2942
|
-
consoleVersion={data.me?.console?.version}
|
|
2943
|
-
onRevoke={(token) => void act(() => data.actions.revokeToken(token.id))}
|
|
2944
|
-
empty={<EmptyState title={agents.empty.title} body={agents.empty.body} />}
|
|
2945
|
-
/>
|
|
2946
|
-
<ConnectWords origin={origin} />
|
|
2947
3473
|
</>
|
|
2948
3474
|
);
|
|
2949
3475
|
}
|
|
@@ -2958,6 +3484,8 @@ export function createConsole(config: ConsoleConfig = {}): ConsoleApp {
|
|
|
2958
3484
|
const fallbackTitle = config.title ?? "Console";
|
|
2959
3485
|
const languages = config.languages ?? DEFAULT_LANGUAGES;
|
|
2960
3486
|
const pages = config.pages ?? [];
|
|
3487
|
+
/** The shapes the avatars of agent accounts are drawn from here (ADR-0084): the package's, unless this console brings its own. */
|
|
3488
|
+
const avatarSets = config.persona?.avatarSets ?? AVATAR_SETS;
|
|
2961
3489
|
|
|
2962
3490
|
// 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.
|
|
2963
3491
|
function App(props: { readonly initialPath?: string | undefined }) {
|
|
@@ -2969,6 +3497,22 @@ export function createConsole(config: ConsoleConfig = {}): ConsoleApp {
|
|
|
2969
3497
|
);
|
|
2970
3498
|
const projectKey = projectOf(route);
|
|
2971
3499
|
const data = useConsoleData(client, projectKey);
|
|
3500
|
+
// The page the console opens on asks for its own data along with who is signed in, which
|
|
3501
|
+
// useConsoleData asks for in the same breath, rather than once that answer has come: a
|
|
3502
|
+
// round trip fewer before the page stands.
|
|
3503
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: the page the console opened on, once
|
|
3504
|
+
useEffect(() => {
|
|
3505
|
+
if (route.name === "work") {
|
|
3506
|
+
askEarly("work", () => client.plate());
|
|
3507
|
+
} else if (route.name === "my-decisions") {
|
|
3508
|
+
askEarly("decisions:addressed", () =>
|
|
3509
|
+
client.myDecisions({ limit: MY_DECISIONS_PAGE, offset: 0 }),
|
|
3510
|
+
);
|
|
3511
|
+
askEarly("decisions:raised", () =>
|
|
3512
|
+
client.myDecisions({ raised: true, limit: MY_DECISIONS_PAGE, offset: 0 }),
|
|
3513
|
+
);
|
|
3514
|
+
}
|
|
3515
|
+
}, []);
|
|
2972
3516
|
const failure = signInFailureOf(location.search);
|
|
2973
3517
|
const title = data.me?.workspace.name ?? fallbackTitle;
|
|
2974
3518
|
const viaToken = holdsToken(data);
|
|
@@ -3008,11 +3552,12 @@ export function createConsole(config: ConsoleConfig = {}): ConsoleApp {
|
|
|
3008
3552
|
|
|
3009
3553
|
useEffect(() => {
|
|
3010
3554
|
if (typeof document !== "undefined") {
|
|
3011
|
-
document.title = data.project === undefined ? title : `${data.project.name} · ${title}`;
|
|
3012
3555
|
document.documentElement.lang = pack.tag;
|
|
3013
3556
|
}
|
|
3014
|
-
}, [
|
|
3557
|
+
}, [pack.tag]);
|
|
3015
3558
|
|
|
3559
|
+
/** The tab the page shown is under, once the tabs are known. */
|
|
3560
|
+
let here: string | undefined;
|
|
3016
3561
|
let content: React.ReactNode;
|
|
3017
3562
|
if (data.me === undefined) {
|
|
3018
3563
|
content = (
|
|
@@ -3032,6 +3577,14 @@ export function createConsole(config: ConsoleConfig = {}): ConsoleApp {
|
|
|
3032
3577
|
</div>
|
|
3033
3578
|
</Ground>
|
|
3034
3579
|
);
|
|
3580
|
+
} else if (route.name === "setup") {
|
|
3581
|
+
// What an invitation's code opens is read without a sign-in (ADR-0088): the guide, and
|
|
3582
|
+
// nothing else of the console.
|
|
3583
|
+
content = (
|
|
3584
|
+
<Ground>
|
|
3585
|
+
<SetupPage client={client} code={route.code} />
|
|
3586
|
+
</Ground>
|
|
3587
|
+
);
|
|
3035
3588
|
} else if (data.me.person === null) {
|
|
3036
3589
|
content = (
|
|
3037
3590
|
<Ground>
|
|
@@ -3070,15 +3623,15 @@ export function createConsole(config: ConsoleConfig = {}): ConsoleApp {
|
|
|
3070
3623
|
route.name === "new-team" ||
|
|
3071
3624
|
route.name === "person-agents",
|
|
3072
3625
|
},
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
:
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3626
|
+
{
|
|
3627
|
+
href: PATHS.agents,
|
|
3628
|
+
label: words.nav.agents,
|
|
3629
|
+
current:
|
|
3630
|
+
route.name === "agents" ||
|
|
3631
|
+
route.name === "new-token" ||
|
|
3632
|
+
route.name === "new-agent" ||
|
|
3633
|
+
route.name === "agent",
|
|
3634
|
+
},
|
|
3082
3635
|
...pages
|
|
3083
3636
|
.filter((candidate) => candidate.level === "workspace")
|
|
3084
3637
|
.map((candidate) => ({
|
|
@@ -3192,13 +3745,22 @@ export function createConsole(config: ConsoleConfig = {}): ConsoleApp {
|
|
|
3192
3745
|
current: route.name === "settings",
|
|
3193
3746
|
},
|
|
3194
3747
|
];
|
|
3748
|
+
here = currentTab(nav);
|
|
3195
3749
|
/** A page of the console's own at the address, or nothing there. */
|
|
3196
3750
|
const customPageOf = (key: string, level: CustomPage["level"]): ReactNode => {
|
|
3197
3751
|
const found = pages.find((candidate) => candidate.key === key && candidate.level === level);
|
|
3198
3752
|
return found === undefined ? (
|
|
3199
3753
|
<NothingHere />
|
|
3200
3754
|
) : (
|
|
3201
|
-
found.render({
|
|
3755
|
+
found.render({
|
|
3756
|
+
data,
|
|
3757
|
+
project,
|
|
3758
|
+
client,
|
|
3759
|
+
navigation,
|
|
3760
|
+
search: location.search,
|
|
3761
|
+
words,
|
|
3762
|
+
language: pack.tag,
|
|
3763
|
+
})
|
|
3202
3764
|
);
|
|
3203
3765
|
};
|
|
3204
3766
|
let page: ReactNode;
|
|
@@ -3232,6 +3794,7 @@ export function createConsole(config: ConsoleConfig = {}): ConsoleApp {
|
|
|
3232
3794
|
navigation={navigation}
|
|
3233
3795
|
client={client}
|
|
3234
3796
|
language={pack.tag}
|
|
3797
|
+
persona={config.persona}
|
|
3235
3798
|
/>
|
|
3236
3799
|
);
|
|
3237
3800
|
} else if (data.projectError !== undefined) {
|
|
@@ -3318,10 +3881,21 @@ export function createConsole(config: ConsoleConfig = {}): ConsoleApp {
|
|
|
3318
3881
|
</components.Shell>
|
|
3319
3882
|
);
|
|
3320
3883
|
}
|
|
3884
|
+
// The browser's tab is called after the page it shows. It is said again at every address,
|
|
3885
|
+
// not only when the words change: a plugin's page may name the tab itself (the frame's
|
|
3886
|
+
// `title`), and that name must not outlive the page.
|
|
3887
|
+
const tab = tabTitle([here, data.project?.name, title]);
|
|
3888
|
+
const address = `${location.pathname}${location.search}`;
|
|
3889
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: the address is why it is said again
|
|
3890
|
+
useEffect(() => {
|
|
3891
|
+
if (typeof document !== "undefined") {
|
|
3892
|
+
document.title = tab;
|
|
3893
|
+
}
|
|
3894
|
+
}, [tab, address]);
|
|
3321
3895
|
return (
|
|
3322
3896
|
<LanguageContext.Provider value={pack}>
|
|
3323
3897
|
<RemotePicturesContext.Provider value={pictureSrc}>
|
|
3324
|
-
{content}
|
|
3898
|
+
<AvatarSetsContext.Provider value={avatarSets}>{content}</AvatarSetsContext.Provider>
|
|
3325
3899
|
</RemotePicturesContext.Provider>
|
|
3326
3900
|
</LanguageContext.Provider>
|
|
3327
3901
|
);
|