@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
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
import { addDays, isDay, weekOf } from "./dates.js";
|
|
2
|
+
import { MAX_RECORD_COLLECTIONS, MAX_RECORD_FILE_BYTES, MAX_RECORD_ITEMS, MAX_RECORD_METRIC_ROWS, MAX_RECORD_USES, RECORD_ID, RECORD_KEY, recordsCollectionSchema, recordsIndexSchema, recordsItemSchema, recordsMetricRowSchema, recordsUseSchema, } from "./records.js";
|
|
3
|
+
// A desk's records as the desk's pages read them (ADR-0117): what the desk's member made and what
|
|
4
|
+
// became of it, kept as files under the desk's `records/` and served beside the pages at
|
|
5
|
+
// `/records/`. An agent wrote them, so every file is read as what an agent sends: fetched from
|
|
6
|
+
// the page's own origin and nowhere else, bounded in size, parsed with the format's schemas,
|
|
7
|
+
// and what does not parse is named and left out while the rest is shown. A link is taken only
|
|
8
|
+
// as https and a preview only as a path under the collection's `files/`. This module is the
|
|
9
|
+
// reading and the counting, with no React in it; the views are `components/desk-records.tsx`.
|
|
10
|
+
/** Where a desk's records are served, beside the pages' own files. */
|
|
11
|
+
export const RECORDS_BASE = "/records";
|
|
12
|
+
/** How many weeks a collection's results count back, this week among them. */
|
|
13
|
+
export const RECORD_WEEKS = 8;
|
|
14
|
+
/** How many items a collection's results name as those that did best. */
|
|
15
|
+
export const RECORD_BEST = 10;
|
|
16
|
+
/** The kinds of picture a preview may be, by the end of its name. */
|
|
17
|
+
export const RECORD_PREVIEW_KINDS = ["png", "jpg", "jpeg", "gif", "webp", "avif"];
|
|
18
|
+
/** The text of an answer, as far as `max` bytes: nothing where it is longer. */
|
|
19
|
+
async function boundedText(response, max) {
|
|
20
|
+
const declared = Number(response.headers.get("content-length") ?? "");
|
|
21
|
+
if (Number.isFinite(declared) && declared > max) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
const body = response.body;
|
|
25
|
+
if (body === null) {
|
|
26
|
+
const whole = await response.text();
|
|
27
|
+
return whole.length > max ? undefined : whole;
|
|
28
|
+
}
|
|
29
|
+
const reader = body.getReader();
|
|
30
|
+
const decoder = new TextDecoder();
|
|
31
|
+
let text = "";
|
|
32
|
+
let read = 0;
|
|
33
|
+
for (;;) {
|
|
34
|
+
const { done, value } = await reader.read();
|
|
35
|
+
if (done) {
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
read += value.byteLength;
|
|
39
|
+
if (read > max) {
|
|
40
|
+
await reader.cancel().catch(() => undefined);
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
text += decoder.decode(value, { stream: true });
|
|
44
|
+
}
|
|
45
|
+
return text + decoder.decode();
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* One file of the records as JSON. A file that is not there is missing, and so is an answer
|
|
49
|
+
* that is not JSON by its type: a server that serves no records answers its own page there.
|
|
50
|
+
*/
|
|
51
|
+
async function readFile(reader, file, signal) {
|
|
52
|
+
const problem = (kind) => ({
|
|
53
|
+
kind: "problem",
|
|
54
|
+
problem: { file, kind },
|
|
55
|
+
});
|
|
56
|
+
let response;
|
|
57
|
+
try {
|
|
58
|
+
response = await reader.fetch(`${reader.base ?? RECORDS_BASE}/${file}`, {
|
|
59
|
+
cache: "no-store",
|
|
60
|
+
credentials: "same-origin",
|
|
61
|
+
...(signal === undefined ? {} : { signal }),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch (failure) {
|
|
65
|
+
if (signal?.aborted === true) {
|
|
66
|
+
throw failure;
|
|
67
|
+
}
|
|
68
|
+
return problem("unreadable");
|
|
69
|
+
}
|
|
70
|
+
if (response.status === 404) {
|
|
71
|
+
return { kind: "missing" };
|
|
72
|
+
}
|
|
73
|
+
if (!response.ok) {
|
|
74
|
+
return problem("unreadable");
|
|
75
|
+
}
|
|
76
|
+
if (!(response.headers.get("content-type") ?? "").toLowerCase().includes("json")) {
|
|
77
|
+
return { kind: "missing" };
|
|
78
|
+
}
|
|
79
|
+
const text = await boundedText(response, MAX_RECORD_FILE_BYTES);
|
|
80
|
+
if (text === undefined) {
|
|
81
|
+
return problem("too_large");
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
return { kind: "read", value: JSON.parse(text) };
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return problem("not_json");
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** Where in a file something is wrong, as a path a person can find: `[3].madeOn`. */
|
|
91
|
+
function placeOf(path) {
|
|
92
|
+
return path
|
|
93
|
+
.map((step, index) => typeof step === "number" ? `[${step}]` : `${index === 0 ? "" : "."}${String(step)}`)
|
|
94
|
+
.join("");
|
|
95
|
+
}
|
|
96
|
+
/** One value parsed with a schema of the format, or where it is not as the format says. */
|
|
97
|
+
function parseOne(schema, value) {
|
|
98
|
+
const parsed = schema.safeParse(value);
|
|
99
|
+
return parsed.success
|
|
100
|
+
? { value: parsed.data }
|
|
101
|
+
: { at: placeOf(parsed.error.issues[0]?.path ?? []) };
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A list of the format read entry by entry: those that are as the format says, `max` at most,
|
|
105
|
+
* and one problem for the rest, with where the first of them is wrong.
|
|
106
|
+
*/
|
|
107
|
+
function parseList(schema, value, max, file) {
|
|
108
|
+
if (!Array.isArray(value)) {
|
|
109
|
+
return { entries: [], problem: { file, kind: "not_as_format", at: "" } };
|
|
110
|
+
}
|
|
111
|
+
const entries = [];
|
|
112
|
+
let left = 0;
|
|
113
|
+
let at;
|
|
114
|
+
for (const [index, entry] of value.slice(0, max).entries()) {
|
|
115
|
+
const parsed = parseOne(schema, entry);
|
|
116
|
+
if ("value" in parsed) {
|
|
117
|
+
entries.push(parsed.value);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
left += 1;
|
|
121
|
+
at ??= `[${index}]${parsed.at.length === 0 || parsed.at.startsWith("[") ? "" : "."}${parsed.at}`;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (value.length > max) {
|
|
125
|
+
left += value.length - max;
|
|
126
|
+
at ??= `[${max}]`;
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
entries,
|
|
130
|
+
problem: left === 0 ? undefined : { file, kind: "not_as_format", at, left },
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/** The items of a collection by status: one count for each status the collection names. */
|
|
134
|
+
export function statusCounts(collection, items) {
|
|
135
|
+
return (collection?.statuses ?? []).map((status) => ({
|
|
136
|
+
key: status.key,
|
|
137
|
+
label: status.label,
|
|
138
|
+
count: items.filter((item) => item.status === status.key).length,
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
/** The latest day any of the items was made on. */
|
|
142
|
+
export function lastMadeOn(items) {
|
|
143
|
+
return items.reduce((latest, item) => (latest === undefined || item.madeOn > latest ? item.madeOn : latest), undefined);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The collections of a desk with what each holds: the index, then each collection's own file
|
|
147
|
+
* and its items, two requests a collection, `MAX_RECORD_COLLECTIONS` collections at most.
|
|
148
|
+
*/
|
|
149
|
+
export async function readDeskRecords(reader, signal) {
|
|
150
|
+
const index = await readFile(reader, "index.json", signal);
|
|
151
|
+
if (index.kind === "missing") {
|
|
152
|
+
return { kind: "none" };
|
|
153
|
+
}
|
|
154
|
+
if (index.kind === "problem") {
|
|
155
|
+
return { kind: "read", collections: [], problems: [index.problem] };
|
|
156
|
+
}
|
|
157
|
+
const parsed = parseOne(recordsIndexSchema, index.value);
|
|
158
|
+
if (!("value" in parsed)) {
|
|
159
|
+
return {
|
|
160
|
+
kind: "read",
|
|
161
|
+
collections: [],
|
|
162
|
+
problems: [{ file: "index.json", kind: "not_as_format", at: parsed.at }],
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
const named = new Map(parsed.value.collections.map((one) => [one.key, one]));
|
|
166
|
+
const read = await Promise.all([...named.values()].slice(0, MAX_RECORD_COLLECTIONS).map(async (one) => {
|
|
167
|
+
const records = await readCollection(reader, one.key, signal, { items: true });
|
|
168
|
+
return {
|
|
169
|
+
summary: {
|
|
170
|
+
key: one.key,
|
|
171
|
+
title: records.collection?.title ?? one.title,
|
|
172
|
+
description: records.collection?.description,
|
|
173
|
+
items: records.items.length,
|
|
174
|
+
statuses: statusCounts(records.collection, records.items),
|
|
175
|
+
lastMadeOn: lastMadeOn(records.items),
|
|
176
|
+
},
|
|
177
|
+
problems: records.problems,
|
|
178
|
+
};
|
|
179
|
+
}));
|
|
180
|
+
return {
|
|
181
|
+
kind: "read",
|
|
182
|
+
collections: read.map((one) => one.summary),
|
|
183
|
+
problems: read.flatMap((one) => one.problems),
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* One collection: its own file and its items, and its uses and its metrics unless `items`
|
|
188
|
+
* alone is asked for. A file that is missing is nothing held; one that is wrong is named
|
|
189
|
+
* among the problems and the rest is read all the same.
|
|
190
|
+
*/
|
|
191
|
+
export async function readCollection(reader, key, signal, only = {}) {
|
|
192
|
+
if (!RECORD_KEY.test(key)) {
|
|
193
|
+
return {
|
|
194
|
+
key,
|
|
195
|
+
collection: undefined,
|
|
196
|
+
items: [],
|
|
197
|
+
uses: [],
|
|
198
|
+
metrics: [],
|
|
199
|
+
problems: [],
|
|
200
|
+
found: false,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
const missing = { kind: "missing" };
|
|
204
|
+
const [own, itemsFile, usesFile, metricsFile] = await Promise.all([
|
|
205
|
+
readFile(reader, `${key}/collection.json`, signal),
|
|
206
|
+
readFile(reader, `${key}/items.json`, signal),
|
|
207
|
+
only.items === true ? missing : readFile(reader, `${key}/uses.json`, signal),
|
|
208
|
+
only.items === true ? missing : readFile(reader, `${key}/metrics.json`, signal),
|
|
209
|
+
]);
|
|
210
|
+
const problems = [];
|
|
211
|
+
let collection;
|
|
212
|
+
if (own.kind === "problem") {
|
|
213
|
+
problems.push(own.problem);
|
|
214
|
+
}
|
|
215
|
+
else if (own.kind === "read") {
|
|
216
|
+
const parsed = parseOne(recordsCollectionSchema, own.value);
|
|
217
|
+
if ("value" in parsed) {
|
|
218
|
+
collection = parsed.value;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
problems.push({ file: `${key}/collection.json`, kind: "not_as_format", at: parsed.at });
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const list = (file, name, schema, max) => {
|
|
225
|
+
if (file.kind === "problem") {
|
|
226
|
+
problems.push(file.problem);
|
|
227
|
+
return [];
|
|
228
|
+
}
|
|
229
|
+
if (file.kind === "missing") {
|
|
230
|
+
return [];
|
|
231
|
+
}
|
|
232
|
+
const parsed = parseList(schema, file.value, max, `${key}/${name}`);
|
|
233
|
+
if (parsed.problem !== undefined) {
|
|
234
|
+
problems.push(parsed.problem);
|
|
235
|
+
}
|
|
236
|
+
return parsed.entries;
|
|
237
|
+
};
|
|
238
|
+
// An id stands for one item: of two with the same, the first is the item.
|
|
239
|
+
const seen = new Set();
|
|
240
|
+
const items = list(itemsFile, "items.json", recordsItemSchema, MAX_RECORD_ITEMS)
|
|
241
|
+
.filter((item) => {
|
|
242
|
+
const first = !seen.has(item.id);
|
|
243
|
+
seen.add(item.id);
|
|
244
|
+
return first;
|
|
245
|
+
})
|
|
246
|
+
.sort((a, b) => b.madeOn.localeCompare(a.madeOn) || a.title.localeCompare(b.title));
|
|
247
|
+
const held = (entry) => seen.has(entry.item);
|
|
248
|
+
return {
|
|
249
|
+
key,
|
|
250
|
+
collection,
|
|
251
|
+
items,
|
|
252
|
+
uses: list(usesFile, "uses.json", recordsUseSchema, MAX_RECORD_USES)
|
|
253
|
+
.filter(held)
|
|
254
|
+
.sort((a, b) => b.on.localeCompare(a.on)),
|
|
255
|
+
metrics: list(metricsFile, "metrics.json", recordsMetricRowSchema, MAX_RECORD_METRIC_ROWS).filter(held),
|
|
256
|
+
problems,
|
|
257
|
+
found: own.kind !== "missing" || itemsFile.kind !== "missing",
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* A file of a collection as a path under its `files/`, or nothing where it is not one: no step
|
|
262
|
+
* up or out, no name that begins with a dot, nothing of an address about it. `files/` may lead
|
|
263
|
+
* the path or be left out.
|
|
264
|
+
*/
|
|
265
|
+
export function filePath(path) {
|
|
266
|
+
if (path === undefined || path.includes("\\") || path.includes("\0")) {
|
|
267
|
+
return undefined;
|
|
268
|
+
}
|
|
269
|
+
const steps = path.split("/");
|
|
270
|
+
const under = steps[0] === "files" ? steps.slice(1) : steps;
|
|
271
|
+
return under.length === 0 ||
|
|
272
|
+
under.some((step) => step.length === 0 || step.startsWith(".") || /[?#%]/.test(step))
|
|
273
|
+
? undefined
|
|
274
|
+
: `files/${under.join("/")}`;
|
|
275
|
+
}
|
|
276
|
+
/** Where a file of a collection is read from, on the page's own origin; nothing for what is no file of it. */
|
|
277
|
+
export function fileSrc(key, path, base = RECORDS_BASE) {
|
|
278
|
+
const under = filePath(path);
|
|
279
|
+
return under === undefined || !RECORD_KEY.test(key)
|
|
280
|
+
? undefined
|
|
281
|
+
: `${base}/${key}/${under.split("/").map(encodeURIComponent).join("/")}`;
|
|
282
|
+
}
|
|
283
|
+
/** A preview as a path under the collection's `files/`: a file of it that is a picture by the end of its name. */
|
|
284
|
+
export function previewPath(preview) {
|
|
285
|
+
const under = filePath(preview);
|
|
286
|
+
const kind = /\.([A-Za-z0-9]+)$/.exec(under ?? "")?.[1]?.toLowerCase();
|
|
287
|
+
return RECORD_PREVIEW_KINDS.some((one) => one === kind) ? under : undefined;
|
|
288
|
+
}
|
|
289
|
+
/** Where a preview is read from, on the page's own origin; nothing for what is no preview. */
|
|
290
|
+
export function previewSrc(key, preview, base = RECORDS_BASE) {
|
|
291
|
+
return fileSrc(key, previewPath(preview), base);
|
|
292
|
+
}
|
|
293
|
+
/** How many bytes of a file are read to tell what it is. */
|
|
294
|
+
const PROBE_BYTES = 256;
|
|
295
|
+
/** How many characters of the server's own words about a file are shown. */
|
|
296
|
+
export const RECORD_FILE_WORDS = 300;
|
|
297
|
+
/** What the pointer git LFS leaves in place of a file it has not fetched begins with. */
|
|
298
|
+
const LFS_POINTER = "version https://git-lfs.github.com/spec/";
|
|
299
|
+
/** The first bytes of an answer as text, and no more of it. */
|
|
300
|
+
async function headOf(response, max) {
|
|
301
|
+
const body = response.body;
|
|
302
|
+
if (body === null) {
|
|
303
|
+
return (await response.text()).slice(0, max);
|
|
304
|
+
}
|
|
305
|
+
const reader = body.getReader();
|
|
306
|
+
const chunks = [];
|
|
307
|
+
let read = 0;
|
|
308
|
+
while (read < max) {
|
|
309
|
+
const { done, value } = await reader.read();
|
|
310
|
+
if (done) {
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
chunks.push(value.subarray(0, max - read));
|
|
314
|
+
read += value.byteLength;
|
|
315
|
+
}
|
|
316
|
+
await reader.cancel().catch(() => undefined);
|
|
317
|
+
const bytes = new Uint8Array(chunks.reduce((total, chunk) => total + chunk.byteLength, 0));
|
|
318
|
+
let at = 0;
|
|
319
|
+
for (const chunk of chunks) {
|
|
320
|
+
bytes.set(chunk, at);
|
|
321
|
+
at += chunk.byteLength;
|
|
322
|
+
}
|
|
323
|
+
return new TextDecoder().decode(bytes);
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* How one file of an item stands: asked of the server for its first bytes alone, so that a
|
|
327
|
+
* film is not read to learn that it is one. The kind is the one the server says; a refusal is
|
|
328
|
+
* kept with the server's words; a file that is the pointer git LFS leaves is not fetched here.
|
|
329
|
+
*/
|
|
330
|
+
export async function probeFile(reader, key, path, signal) {
|
|
331
|
+
const src = fileSrc(key, path, reader.base ?? RECORDS_BASE);
|
|
332
|
+
if (src === undefined) {
|
|
333
|
+
return { kind: "unreadable" };
|
|
334
|
+
}
|
|
335
|
+
let response;
|
|
336
|
+
try {
|
|
337
|
+
response = await reader.fetch(src, {
|
|
338
|
+
cache: "no-store",
|
|
339
|
+
credentials: "same-origin",
|
|
340
|
+
headers: { range: `bytes=0-${PROBE_BYTES - 1}` },
|
|
341
|
+
...(signal === undefined ? {} : { signal }),
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
catch (failure) {
|
|
345
|
+
if (signal?.aborted === true) {
|
|
346
|
+
throw failure;
|
|
347
|
+
}
|
|
348
|
+
return { kind: "unreadable" };
|
|
349
|
+
}
|
|
350
|
+
const type = (response.headers.get("content-type") ?? "").toLowerCase();
|
|
351
|
+
const head = await headOf(response, PROBE_BYTES).catch(() => "");
|
|
352
|
+
const worded = /^text\/plain|json/.test(type) ? head.trim().slice(0, RECORD_FILE_WORDS) : "";
|
|
353
|
+
const words = worded.length === 0 ? undefined : worded;
|
|
354
|
+
if (head.startsWith(LFS_POINTER)) {
|
|
355
|
+
return { kind: "not_fetched", words: undefined };
|
|
356
|
+
}
|
|
357
|
+
if (!response.ok) {
|
|
358
|
+
// A server that knows the file for a pointer says so in its refusal.
|
|
359
|
+
return /\blfs\b/i.test(worded)
|
|
360
|
+
? { kind: "not_fetched", words }
|
|
361
|
+
: response.status === 404 && words === undefined
|
|
362
|
+
? { kind: "unreadable" }
|
|
363
|
+
: { kind: "refused", words };
|
|
364
|
+
}
|
|
365
|
+
if (type.startsWith("image/")) {
|
|
366
|
+
return { kind: "picture" };
|
|
367
|
+
}
|
|
368
|
+
if (type.startsWith("video/")) {
|
|
369
|
+
return { kind: "video" };
|
|
370
|
+
}
|
|
371
|
+
if (type.startsWith("audio/")) {
|
|
372
|
+
return { kind: "sound" };
|
|
373
|
+
}
|
|
374
|
+
if (type.startsWith("application/pdf")) {
|
|
375
|
+
// A frame shows it only where its own answer lets a page of the same origin frame it.
|
|
376
|
+
const policy = (response.headers.get("content-security-policy") ?? "").toLowerCase();
|
|
377
|
+
const options = (response.headers.get("x-frame-options") ?? "").toLowerCase();
|
|
378
|
+
return {
|
|
379
|
+
kind: "pdf",
|
|
380
|
+
framed: !/frame-ancestors[^;]*'none'/.test(policy) && options !== "deny",
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
return { kind: "other" };
|
|
384
|
+
}
|
|
385
|
+
/** A link as a page may follow it: https, and nothing else. */
|
|
386
|
+
export function httpsLink(url) {
|
|
387
|
+
if (url === undefined) {
|
|
388
|
+
return undefined;
|
|
389
|
+
}
|
|
390
|
+
try {
|
|
391
|
+
const parsed = new URL(url);
|
|
392
|
+
return parsed.protocol === "https:" && parsed.username === "" && parsed.password === ""
|
|
393
|
+
? parsed.href
|
|
394
|
+
: undefined;
|
|
395
|
+
}
|
|
396
|
+
catch {
|
|
397
|
+
return undefined;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* An item's fields in the collection's order, each as its kind has it read. A value that is
|
|
402
|
+
* not of its field's kind is shown as the text it is: a link that is not https is words.
|
|
403
|
+
*/
|
|
404
|
+
export function fieldsOf(collection, item) {
|
|
405
|
+
return (collection?.fields ?? []).flatMap((field) => {
|
|
406
|
+
const raw = item.fields?.[field.key];
|
|
407
|
+
if (raw === undefined || raw === "") {
|
|
408
|
+
return [];
|
|
409
|
+
}
|
|
410
|
+
const text = { kind: "text", text: String(raw) };
|
|
411
|
+
const link = field.kind === "link" && typeof raw === "string" ? httpsLink(raw) : undefined;
|
|
412
|
+
const value = field.kind === "number" && typeof raw === "number"
|
|
413
|
+
? { kind: "number", value: raw }
|
|
414
|
+
: field.kind === "day" && typeof raw === "string" && isDay(raw)
|
|
415
|
+
? { kind: "day", day: raw }
|
|
416
|
+
: link !== undefined
|
|
417
|
+
? { kind: "link", href: link }
|
|
418
|
+
: text;
|
|
419
|
+
return [{ key: field.key, label: field.label, value }];
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
/** One metric over some rows: their sum, or for a percentage their mean, since a sum of shares says nothing. */
|
|
423
|
+
function totalOf(metric, rows) {
|
|
424
|
+
const values = rows.flatMap((row) => {
|
|
425
|
+
const value = row.values[metric.key];
|
|
426
|
+
return value === undefined ? [] : [value];
|
|
427
|
+
});
|
|
428
|
+
if (values.length === 0) {
|
|
429
|
+
return undefined;
|
|
430
|
+
}
|
|
431
|
+
const sum = values.reduce((total, value) => total + value, 0);
|
|
432
|
+
return metric.unit === "percent" ? sum / values.length : sum;
|
|
433
|
+
}
|
|
434
|
+
/** A ratio over some rows: the sum of one metric for each of the other's, or nothing where there is none of the other. */
|
|
435
|
+
function ratioOf(ratio, rows) {
|
|
436
|
+
const sum = (key) => rows.reduce((total, row) => total + (row.values[key] ?? 0), 0);
|
|
437
|
+
const per = sum(ratio.per);
|
|
438
|
+
return per === 0 ? undefined : sum(ratio.of) / per;
|
|
439
|
+
}
|
|
440
|
+
/** The figures of some rows: each of the collection's metrics and each of its ratios. */
|
|
441
|
+
export function figuresOfRows(collection, rows) {
|
|
442
|
+
return {
|
|
443
|
+
metrics: (collection?.metrics ?? []).map((metric) => ({
|
|
444
|
+
key: metric.key,
|
|
445
|
+
label: metric.label,
|
|
446
|
+
unit: metric.unit,
|
|
447
|
+
total: totalOf(metric, rows),
|
|
448
|
+
})),
|
|
449
|
+
ratios: (collection?.ratios ?? []).map((ratio) => ({
|
|
450
|
+
key: ratio.key,
|
|
451
|
+
label: ratio.label,
|
|
452
|
+
as: ratio.as,
|
|
453
|
+
value: ratioOf(ratio, rows),
|
|
454
|
+
})),
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
/** A collection's results from its rows: the whole, and `weeks` weeks back from the week of `today`. */
|
|
458
|
+
export function resultsOf(input) {
|
|
459
|
+
const count = Math.max(1, input.weeks ?? RECORD_WEEKS);
|
|
460
|
+
const last = weekOf(input.today, input.firstDay ?? 1)[0] ?? input.today;
|
|
461
|
+
const whole = figuresOfRows(input.collection, input.rows);
|
|
462
|
+
return {
|
|
463
|
+
...whole,
|
|
464
|
+
weeks: Array.from({ length: count }, (_, index) => {
|
|
465
|
+
const start = addDays(last, (index - (count - 1)) * 7);
|
|
466
|
+
const end = addDays(start, 6);
|
|
467
|
+
return {
|
|
468
|
+
start,
|
|
469
|
+
end,
|
|
470
|
+
metrics: figuresOfRows(input.collection, input.rows.filter((row) => row.on >= start && row.on <= end)).metrics,
|
|
471
|
+
};
|
|
472
|
+
}),
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
/** The items that did best by one metric: the most first, `limit` at most, those with no row of it left out. */
|
|
476
|
+
export function bestItems(input) {
|
|
477
|
+
const metrics = input.collection?.metrics ?? [];
|
|
478
|
+
const metric = metrics.find((one) => one.key === input.by) ?? metrics[0];
|
|
479
|
+
if (metric === undefined) {
|
|
480
|
+
return { metric: undefined, items: [] };
|
|
481
|
+
}
|
|
482
|
+
const byItem = new Map();
|
|
483
|
+
for (const row of input.rows) {
|
|
484
|
+
const rows = byItem.get(row.item) ?? [];
|
|
485
|
+
rows.push(row);
|
|
486
|
+
byItem.set(row.item, rows);
|
|
487
|
+
}
|
|
488
|
+
return {
|
|
489
|
+
metric,
|
|
490
|
+
items: input.items
|
|
491
|
+
.flatMap((item) => {
|
|
492
|
+
const total = totalOf(metric, byItem.get(item.id) ?? []);
|
|
493
|
+
return total === undefined ? [] : [{ item, total }];
|
|
494
|
+
})
|
|
495
|
+
.sort((a, b) => b.total - a.total || a.item.title.localeCompare(b.item.title))
|
|
496
|
+
.slice(0, Math.max(1, input.limit ?? RECORD_BEST)),
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
/** How one item did: its rows by day, the last first, and its figures over all of them. */
|
|
500
|
+
export function itemResults(collection, rows, itemId) {
|
|
501
|
+
const days = rows.filter((row) => row.item === itemId).sort((a, b) => b.on.localeCompare(a.on));
|
|
502
|
+
return { days, ...figuresOfRows(collection, days) };
|
|
503
|
+
}
|
|
504
|
+
/** What a query says of the records' view: only keys and ids that could be ones. */
|
|
505
|
+
export function recordsAddressOf(search) {
|
|
506
|
+
const params = new URLSearchParams(search);
|
|
507
|
+
const keyOf = (name) => {
|
|
508
|
+
const value = params.get(name) ?? "";
|
|
509
|
+
return RECORD_KEY.test(value) ? value : undefined;
|
|
510
|
+
};
|
|
511
|
+
const collection = keyOf("collection");
|
|
512
|
+
if (collection === undefined) {
|
|
513
|
+
return {};
|
|
514
|
+
}
|
|
515
|
+
const item = params.get("item") ?? "";
|
|
516
|
+
if (RECORD_ID.test(item)) {
|
|
517
|
+
return { collection, item };
|
|
518
|
+
}
|
|
519
|
+
return params.get("show") === "results"
|
|
520
|
+
? { collection, results: true, by: keyOf("by") }
|
|
521
|
+
: { collection, status: keyOf("status") };
|
|
522
|
+
}
|
|
523
|
+
/** The query of a place in the records' view, to put after the page's own address. */
|
|
524
|
+
export function recordsQuery(address) {
|
|
525
|
+
const params = new URLSearchParams();
|
|
526
|
+
if (address.collection !== undefined) {
|
|
527
|
+
params.set("collection", address.collection);
|
|
528
|
+
if (address.item !== undefined) {
|
|
529
|
+
params.set("item", address.item);
|
|
530
|
+
}
|
|
531
|
+
else if (address.results === true) {
|
|
532
|
+
params.set("show", "results");
|
|
533
|
+
if (address.by !== undefined) {
|
|
534
|
+
params.set("by", address.by);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
else if (address.status !== undefined) {
|
|
538
|
+
params.set("status", address.status);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
return params.toString();
|
|
542
|
+
}
|
|
543
|
+
//# sourceMappingURL=desk-records.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"desk-records.js","sourceRoot":"","sources":["../src/desk-records.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,g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