@skillcdn/console 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -12
- package/SKILLCDN.md +3 -3
- package/dist/agent-page.d.ts.map +1 -1
- package/dist/agent-page.js +7 -6
- package/dist/agent-page.js.map +1 -1
- package/dist/api.d.ts +9 -7
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +8 -6
- package/dist/api.js.map +1 -1
- package/dist/charts.d.ts +103 -0
- package/dist/charts.d.ts.map +1 -0
- package/dist/charts.js +182 -0
- package/dist/charts.js.map +1 -0
- package/dist/cli/cli.d.ts +58 -2
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +1742 -472
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/command-words.d.ts +20 -0
- package/dist/cli/command-words.d.ts.map +1 -0
- package/dist/cli/command-words.js +51 -0
- package/dist/cli/command-words.js.map +1 -0
- package/dist/cli/credentials.d.ts +54 -5
- package/dist/cli/credentials.d.ts.map +1 -1
- package/dist/cli/credentials.js +126 -20
- package/dist/cli/credentials.js.map +1 -1
- package/dist/cli/directory.d.ts +19 -4
- package/dist/cli/directory.d.ts.map +1 -1
- package/dist/cli/directory.js +16 -8
- package/dist/cli/directory.js.map +1 -1
- package/dist/cli/format.d.ts +70 -9
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +267 -40
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts +13 -4
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +101 -58
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/machine-check.d.ts +36 -0
- package/dist/cli/machine-check.d.ts.map +1 -0
- package/dist/cli/machine-check.js +151 -0
- package/dist/cli/machine-check.js.map +1 -0
- package/dist/cli/main.js +76 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/pack.d.ts +69 -60
- package/dist/cli/pack.d.ts.map +1 -1
- package/dist/cli/pack.js +241 -270
- package/dist/cli/pack.js.map +1 -1
- package/dist/cli/plugin-check.d.ts +42 -0
- package/dist/cli/plugin-check.d.ts.map +1 -1
- package/dist/cli/plugin-check.js +221 -36
- package/dist/cli/plugin-check.js.map +1 -1
- package/dist/cli/plugin-cli.d.ts +6 -1
- package/dist/cli/plugin-cli.d.ts.map +1 -1
- package/dist/cli/plugin-cli.js +21 -4
- package/dist/cli/plugin-cli.js.map +1 -1
- package/dist/cli/plugin-main.js +1 -0
- package/dist/cli/plugin-main.js.map +1 -1
- package/dist/cli/runner-host.d.ts +7 -0
- package/dist/cli/runner-host.d.ts.map +1 -1
- package/dist/cli/runner-host.js +2 -0
- package/dist/cli/runner-host.js.map +1 -1
- package/dist/cli/secret-notes.d.ts +8 -0
- package/dist/cli/secret-notes.d.ts.map +1 -0
- package/dist/cli/secret-notes.js +48 -0
- package/dist/cli/secret-notes.js.map +1 -0
- package/dist/cli/serve.d.ts +33 -1
- package/dist/cli/serve.d.ts.map +1 -1
- package/dist/cli/serve.js +252 -3
- package/dist/cli/serve.js.map +1 -1
- package/dist/client.d.ts +54 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +77 -80
- package/dist/client.js.map +1 -1
- package/dist/components/agent-page.d.ts +164 -8
- package/dist/components/agent-page.d.ts.map +1 -1
- package/dist/components/agent-page.js +588 -151
- package/dist/components/agent-page.js.map +1 -1
- package/dist/components/agents.d.ts.map +1 -1
- package/dist/components/agents.js +1 -1
- package/dist/components/agents.js.map +1 -1
- package/dist/components/board.d.ts.map +1 -1
- package/dist/components/board.js +3 -2
- package/dist/components/board.js.map +1 -1
- package/dist/components/categories.js +1 -1
- package/dist/components/categories.js.map +1 -1
- package/dist/components/charts.d.ts +157 -0
- package/dist/components/charts.d.ts.map +1 -0
- package/dist/components/charts.js +182 -0
- package/dist/components/charts.js.map +1 -0
- package/dist/components/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +1 -1
- package/dist/components/decision-list.js.map +1 -1
- package/dist/components/desk-records.d.ts +102 -0
- package/dist/components/desk-records.d.ts.map +1 -0
- package/dist/components/desk-records.js +221 -0
- package/dist/components/desk-records.js.map +1 -0
- package/dist/components/desk.d.ts +85 -0
- package/dist/components/desk.d.ts.map +1 -0
- package/dist/components/desk.js +135 -0
- package/dist/components/desk.js.map +1 -0
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +7 -3
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/goals.d.ts +2 -0
- package/dist/components/goals.d.ts.map +1 -1
- package/dist/components/goals.js +1 -1
- package/dist/components/goals.js.map +1 -1
- package/dist/components/home.d.ts.map +1 -1
- package/dist/components/home.js +14 -6
- package/dist/components/home.js.map +1 -1
- package/dist/components/icon.d.ts +31 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/icon.js +169 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/markdown.d.ts +6 -0
- package/dist/components/markdown.d.ts.map +1 -1
- package/dist/components/markdown.js +10 -2
- package/dist/components/markdown.js.map +1 -1
- package/dist/components/people.js +1 -1
- package/dist/components/people.js.map +1 -1
- package/dist/components/plugin-frame.d.ts.map +1 -1
- package/dist/components/plugin-frame.js +7 -0
- package/dist/components/plugin-frame.js.map +1 -1
- package/dist/components/plugin-settings.d.ts.map +1 -1
- package/dist/components/plugin-settings.js +54 -3
- package/dist/components/plugin-settings.js.map +1 -1
- package/dist/components/projects.d.ts +17 -4
- package/dist/components/projects.d.ts.map +1 -1
- package/dist/components/projects.js +51 -12
- package/dist/components/projects.js.map +1 -1
- package/dist/components/rules.d.ts +8 -10
- package/dist/components/rules.d.ts.map +1 -1
- package/dist/components/rules.js +35 -13
- package/dist/components/rules.js.map +1 -1
- package/dist/components/sessions.d.ts.map +1 -1
- package/dist/components/sessions.js +3 -2
- package/dist/components/sessions.js.map +1 -1
- package/dist/components/setup.d.ts +9 -3
- package/dist/components/setup.d.ts.map +1 -1
- package/dist/components/setup.js +12 -6
- package/dist/components/setup.js.map +1 -1
- package/dist/components/shell.d.ts.map +1 -1
- package/dist/components/shell.js +3 -2
- package/dist/components/shell.js.map +1 -1
- package/dist/components/tokens.js +1 -1
- package/dist/components/tokens.js.map +1 -1
- package/dist/components/ui.d.ts +5 -2
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +10 -7
- package/dist/components/ui.js.map +1 -1
- package/dist/connect-page.js +1 -1
- package/dist/connect-page.js.map +1 -1
- package/dist/console.css +1172 -106
- package/dist/console.d.ts +5 -0
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +52 -39
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +32 -33
- package/dist/data.js.map +1 -1
- package/dist/desk-page.d.ts +38 -0
- package/dist/desk-page.d.ts.map +1 -0
- package/dist/desk-page.js +184 -0
- package/dist/desk-page.js.map +1 -0
- package/dist/desk-records-page.d.ts +18 -0
- package/dist/desk-records-page.d.ts.map +1 -0
- package/dist/desk-records-page.js +130 -0
- package/dist/desk-records-page.js.map +1 -0
- package/dist/desk-records.d.ts +247 -0
- package/dist/desk-records.d.ts.map +1 -0
- package/dist/desk-records.js +543 -0
- package/dist/desk-records.js.map +1 -0
- package/dist/desk.d.ts +122 -0
- package/dist/desk.d.ts.map +1 -0
- package/dist/desk.js +211 -0
- package/dist/desk.js.map +1 -0
- package/dist/feed-stream.d.ts +39 -0
- package/dist/feed-stream.d.ts.map +1 -0
- package/dist/feed-stream.js +117 -0
- package/dist/feed-stream.js.map +1 -0
- package/dist/home-tiles.d.ts +19 -3
- package/dist/home-tiles.d.ts.map +1 -1
- package/dist/home-tiles.js +147 -42
- package/dist/home-tiles.js.map +1 -1
- package/dist/i18n/en.d.ts +228 -6
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +309 -9
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +366 -85
- package/dist/i18n/ko.js.map +1 -1
- package/dist/i18n/particles.d.ts +7 -0
- package/dist/i18n/particles.d.ts.map +1 -0
- package/dist/i18n/particles.js +72 -0
- package/dist/i18n/particles.js.map +1 -0
- package/dist/icons/glyphs.d.ts +605 -0
- package/dist/icons/glyphs.d.ts.map +1 -0
- package/dist/icons/glyphs.js +104 -0
- package/dist/icons/glyphs.js.map +1 -0
- package/dist/icons/index.d.ts +59 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +157 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +20 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +20 -0
- package/dist/limits.js.map +1 -1
- package/dist/marks.d.ts +9 -0
- package/dist/marks.d.ts.map +1 -1
- package/dist/marks.js +9 -0
- package/dist/marks.js.map +1 -1
- package/dist/onboarding.d.ts +6 -0
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +5 -5
- package/dist/onboarding.js.map +1 -1
- package/dist/plugin/context.d.ts +42 -11
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/limits.d.ts +2 -0
- package/dist/plugin/limits.d.ts.map +1 -1
- package/dist/plugin/limits.js +2 -0
- package/dist/plugin/limits.js.map +1 -1
- package/dist/plugin/manifest.d.ts +13 -0
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +30 -3
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +55 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +37 -0
- package/dist/plugin/rest-schemas.js.map +1 -1
- package/dist/plugin/sandbox.d.ts.map +1 -1
- package/dist/plugin/sandbox.js +4 -1
- package/dist/plugin/sandbox.js.map +1 -1
- package/dist/plugin/testing.d.ts +6 -2
- package/dist/plugin/testing.d.ts.map +1 -1
- package/dist/plugin/testing.js +52 -10
- package/dist/plugin/testing.js.map +1 -1
- package/dist/plugin/web.d.ts +3 -0
- package/dist/plugin/web.d.ts.map +1 -1
- package/dist/plugin/web.js +5 -1
- package/dist/plugin/web.js.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/records.d.ts +283 -0
- package/dist/records.d.ts.map +1 -0
- package/dist/records.js +543 -0
- package/dist/records.js.map +1 -0
- package/dist/routes.d.ts +3 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +3 -1
- package/dist/routes.js.map +1 -1
- package/dist/rules.d.ts +30 -11
- package/dist/rules.d.ts.map +1 -1
- package/dist/rules.js +98 -45
- package/dist/rules.js.map +1 -1
- package/dist/runner/acp.d.ts +1 -1
- package/dist/runner/acp.d.ts.map +1 -1
- package/dist/runner/acp.js +32 -21
- package/dist/runner/acp.js.map +1 -1
- package/dist/runner/awake.d.ts +35 -0
- package/dist/runner/awake.d.ts.map +1 -0
- package/dist/runner/awake.js +95 -0
- package/dist/runner/awake.js.map +1 -0
- package/dist/runner/claude.d.ts +1 -1
- package/dist/runner/claude.d.ts.map +1 -1
- package/dist/runner/claude.js +100 -18
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/codex.d.ts +1 -1
- package/dist/runner/codex.d.ts.map +1 -1
- package/dist/runner/codex.js +20 -17
- package/dist/runner/codex.js.map +1 -1
- package/dist/runner/config.d.ts +5 -0
- package/dist/runner/config.d.ts.map +1 -1
- package/dist/runner/config.js +9 -0
- package/dist/runner/config.js.map +1 -1
- package/dist/runner/desk.d.ts +43 -2
- package/dist/runner/desk.d.ts.map +1 -1
- package/dist/runner/desk.js +168 -13
- package/dist/runner/desk.js.map +1 -1
- package/dist/runner/process.d.ts.map +1 -1
- package/dist/runner/process.js +11 -4
- package/dist/runner/process.js.map +1 -1
- package/dist/runner/redact.d.ts +39 -4
- package/dist/runner/redact.d.ts.map +1 -1
- package/dist/runner/redact.js +81 -5
- package/dist/runner/redact.js.map +1 -1
- package/dist/runner/runner.d.ts +28 -3
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/runner.js +371 -54
- package/dist/runner/runner.js.map +1 -1
- package/dist/runner/slack.d.ts.map +1 -1
- package/dist/runner/slack.js +10 -4
- package/dist/runner/slack.js.map +1 -1
- package/dist/runner/task-scheduler.d.ts +20 -0
- package/dist/runner/task-scheduler.d.ts.map +1 -1
- package/dist/runner/task-scheduler.js +34 -4
- package/dist/runner/task-scheduler.js.map +1 -1
- package/dist/runner/types.d.ts +51 -1
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/types.js +26 -0
- package/dist/runner/types.js.map +1 -1
- package/dist/runner.d.ts +6 -6
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +5 -5
- package/dist/runner.js.map +1 -1
- package/dist/schemas.d.ts +603 -6
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +156 -20
- package/dist/schemas.js.map +1 -1
- package/dist/services.d.ts +22 -5
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +41 -17
- package/dist/services.js.map +1 -1
- package/dist/setup-guide.d.ts +17 -4
- package/dist/setup-guide.d.ts.map +1 -1
- package/dist/setup-guide.js +48 -41
- package/dist/setup-guide.js.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +5 -1
- package/dist/tokens.js.map +1 -1
- package/dist/vocabulary.d.ts +21 -3
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +19 -3
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +73 -44
- package/docs/specs/plugins.md +40 -22
- package/docs/specs/records.md +113 -0
- package/docs/specs/rest.md +30 -21
- package/docs/specs/runner.md +46 -22
- package/package.json +11 -2
- package/skills/building-a-console/SKILL.md +4 -4
- package/skills/building-a-plugin/SKILL.md +6 -6
- package/skills/deploying-a-console/SKILL.md +4 -4
- package/skills/deploying-a-console/references/resources.md +41 -4
- package/skills/deploying-a-console/references/running-it-again.md +3 -2
- package/skills/keeping-a-desk/SKILL.md +133 -0
- package/skills/keeping-a-desk/collections.md +96 -0
- package/skills/planning-the-board/SKILL.md +14 -18
- package/skills/planning-the-board/references/a-task.md +2 -2
- package/skills/planning-the-board/references/project-rules.md +13 -14
- package/skills/planning-the-board/references/setting-up.md +15 -13
- package/skills/running-an-agent/SKILL.md +47 -56
- package/skills/working-the-board/SKILL.md +63 -44
- package/skills/working-the-board/references/terms.md +9 -5
- package/skills/working-the-board/references/the-pack.md +12 -10
- package/skills/working-the-board/references/the-sentence.md +2 -2
- package/src/agent-page.tsx +16 -2
- package/src/api.ts +109 -3
- package/src/charts.ts +250 -0
- package/src/cli/cli.ts +2226 -580
- package/src/cli/command-words.ts +56 -0
- package/src/cli/credentials.ts +181 -20
- package/src/cli/directory.ts +28 -10
- package/src/cli/format.ts +332 -49
- package/src/cli/help.ts +113 -57
- package/src/cli/machine-check.ts +223 -0
- package/src/cli/main.ts +72 -2
- package/src/cli/pack.ts +333 -372
- package/src/cli/plugin-check.ts +275 -34
- package/src/cli/plugin-cli.ts +28 -4
- package/src/cli/plugin-main.ts +1 -0
- package/src/cli/runner-host.ts +8 -0
- package/src/cli/secret-notes.ts +63 -0
- package/src/cli/serve.ts +295 -2
- package/src/client.ts +215 -177
- package/src/components/agent-page.tsx +1044 -281
- package/src/components/agents.tsx +9 -5
- package/src/components/board.tsx +3 -15
- package/src/components/categories.tsx +2 -2
- package/src/components/charts.tsx +680 -0
- package/src/components/decision-list.tsx +11 -7
- package/src/components/desk-records.tsx +724 -0
- package/src/components/desk.tsx +471 -0
- package/src/components/event-feed.tsx +12 -3
- package/src/components/goals.tsx +33 -25
- package/src/components/home.tsx +42 -6
- package/src/components/icon.tsx +337 -0
- package/src/components/markdown.tsx +22 -2
- package/src/components/people.tsx +1 -1
- package/src/components/plugin-frame.tsx +7 -0
- package/src/components/plugin-settings.tsx +171 -12
- package/src/components/projects.tsx +68 -17
- package/src/components/rules.tsx +94 -34
- package/src/components/sessions.tsx +2 -13
- package/src/components/setup.tsx +20 -5
- package/src/components/shell.tsx +3 -20
- package/src/components/tokens.tsx +1 -1
- package/src/components/ui.tsx +16 -8
- package/src/connect-page.tsx +1 -1
- package/src/console.tsx +104 -62
- package/src/data.ts +37 -34
- package/src/desk-page.tsx +332 -0
- package/src/desk-records-page.tsx +256 -0
- package/src/desk-records.ts +808 -0
- package/src/desk.ts +329 -0
- package/src/feed-stream.ts +144 -0
- package/src/home-tiles.ts +170 -46
- package/src/i18n/en.ts +323 -11
- package/src/i18n/ko.ts +378 -87
- package/src/i18n/particles.ts +79 -0
- package/src/icons/glyphs.ts +112 -0
- package/src/icons/index.ts +195 -0
- package/src/index.ts +125 -0
- package/src/limits.ts +20 -0
- package/src/marks.ts +12 -0
- package/src/onboarding.ts +14 -6
- package/src/plugin/context.ts +55 -12
- package/src/plugin/limits.ts +2 -0
- package/src/plugin/manifest.ts +38 -2
- package/src/plugin/rest-schemas.ts +41 -0
- package/src/plugin/sandbox.ts +4 -1
- package/src/plugin/testing.ts +63 -12
- package/src/plugin/web.ts +9 -2
- package/src/plugin.ts +2 -0
- package/src/records.ts +702 -0
- package/src/routes.ts +3 -1
- package/src/rules.ts +108 -47
- package/src/runner/acp.ts +49 -30
- package/src/runner/awake.ts +135 -0
- package/src/runner/claude.ts +131 -26
- package/src/runner/codex.ts +37 -26
- package/src/runner/config.ts +9 -0
- package/src/runner/desk.ts +200 -15
- package/src/runner/process.ts +11 -4
- package/src/runner/redact.ts +92 -6
- package/src/runner/runner.ts +457 -56
- package/src/runner/slack.ts +10 -4
- package/src/runner/task-scheduler.ts +36 -4
- package/src/runner/types.ts +67 -1
- package/src/runner.ts +27 -2
- package/src/schemas.ts +177 -18
- package/src/services.ts +55 -16
- package/src/setup-guide.ts +49 -40
- package/src/styles/README.md +16 -5
- package/src/styles/base.css +17 -0
- package/src/styles/console.css +10 -0
- package/src/styles/drawn-by-pages.json +1 -1
- package/src/styles/pages/agents.css +103 -1
- package/src/styles/pages/board.css +0 -10
- package/src/styles/pages/calendar.css +1 -1
- package/src/styles/pages/connect.css +0 -10
- package/src/styles/pages/decisions.css +3 -1
- package/src/styles/pages/desk.css +126 -0
- package/src/styles/pages/documents.css +5 -0
- package/src/styles/pages/feed.css +5 -2
- package/src/styles/pages/home.css +5 -0
- package/src/styles/pages/roadmap.css +2 -2
- package/src/styles/pages/settings.css +11 -0
- package/src/styles/pages/task.css +0 -20
- package/src/styles/pages/thread.css +1 -1
- package/src/styles/parts/bars.css +80 -0
- package/src/styles/parts/calendar.css +1 -1
- package/src/styles/parts/callout.css +1 -0
- package/src/styles/parts/chart.css +173 -0
- package/src/styles/parts/detail.css +22 -0
- package/src/styles/parts/empty.css +2 -0
- package/src/styles/parts/eyebrow.css +1 -1
- package/src/styles/parts/facts.css +1 -1
- package/src/styles/parts/figures.css +65 -0
- package/src/styles/parts/form.css +2 -1
- package/src/styles/parts/icon.css +191 -0
- package/src/styles/parts/input.css +14 -4
- package/src/styles/parts/legend.css +48 -0
- package/src/styles/parts/mark.css +36 -0
- package/src/styles/parts/menu.css +1 -7
- package/src/styles/parts/page.css +1 -1
- package/src/styles/parts/panel.css +10 -0
- package/src/styles/parts/person.css +5 -2
- package/src/styles/parts/progress.css +5 -2
- package/src/styles/parts/rows.css +1 -0
- package/src/styles/parts/series.css +32 -0
- package/src/styles/parts/settings.css +5 -0
- package/src/styles/parts/share.css +25 -0
- package/src/styles/parts/spark.css +23 -0
- package/src/styles/parts/stat.css +69 -0
- package/src/styles/tokens.css +31 -10
- package/src/tokens.ts +5 -1
- package/src/vocabulary.ts +25 -3
- package/template/desk-web/README.md +8 -0
- package/template/desk-web/index.html +13 -0
- package/template/desk-web/package.json +25 -0
- package/template/desk-web/src/main.tsx +24 -0
- package/template/desk-web/src/page.tsx +51 -0
- package/template/desk-web/tsconfig.json +16 -0
- package/template/desk-web/vite.config.ts +15 -0
package/src/home-tiles.ts
CHANGED
|
@@ -364,13 +364,21 @@ function packed(
|
|
|
364
364
|
* fewest tiles leave the size they would rather have, then so that the page is the shortest. The
|
|
365
365
|
* projects take one size together, so that they line up as a row of the same tiles; a widget
|
|
366
366
|
* takes any of its own. A page that cannot close leaves the fewest cells empty it can.
|
|
367
|
+
*
|
|
368
|
+
* Where the page is the one a person is about to arrange, or has arranged (ADR-0139), what is
|
|
369
|
+
* on it is `kept`: an icon stays an icon, and a widget is given another size only where that
|
|
370
|
+
* takes no cell from it. A page that closed by turning the projects into cards, or by cutting
|
|
371
|
+
* its lead to a strip, would be another page than the one they looked at, and a lead beside a
|
|
372
|
+
* few icons scores better as a strip, since a strip takes fewer rows to count. What is empty is
|
|
373
|
+
* then counted in the rows the widgets take alone: the projects' last row may end short, as on
|
|
374
|
+
* the composed page (ADR-0108), and a row of icons under the widgets is no gap to close.
|
|
367
375
|
*/
|
|
368
|
-
function closedUp(wanted: readonly Wanted[], columns: number): PlacedTile[] {
|
|
376
|
+
function closedUp(wanted: readonly Wanted[], columns: number, kept = false): PlacedTile[] {
|
|
369
377
|
const projects = wanted.flatMap((entry, at) => (entry.tile.kind === "project" ? [at] : []));
|
|
370
378
|
// The choices: for each widget its sizes, the one it would rather have first; for the projects
|
|
371
379
|
// together, each its own, then each of the sizes a project comes in, all alike.
|
|
372
380
|
const choices: { readonly at: readonly number[]; readonly options: HomeTileSize[][] }[] = [];
|
|
373
|
-
if (projects.length > 0) {
|
|
381
|
+
if (projects.length > 0 && !kept) {
|
|
374
382
|
const own = projects.map((at) => wanted[at]?.size ?? "icon");
|
|
375
383
|
const alike = PROJECT_ALIKE_SIZES.filter(
|
|
376
384
|
(size) => HOME_TILE_CELLS[size].columns <= columns,
|
|
@@ -385,7 +393,13 @@ function closedUp(wanted: readonly Wanted[], columns: number): PlacedTile[] {
|
|
|
385
393
|
if (entry.tile.kind !== "widget") {
|
|
386
394
|
return;
|
|
387
395
|
}
|
|
388
|
-
const
|
|
396
|
+
const cells = (size: HomeTileSize) => {
|
|
397
|
+
const { w, h } = footprintOf(size, columns);
|
|
398
|
+
return w * h;
|
|
399
|
+
};
|
|
400
|
+
const others = sizesAt(entry.tile, columns).filter(
|
|
401
|
+
(size) => size !== entry.size && (!kept || cells(size) >= cells(entry.size)),
|
|
402
|
+
);
|
|
389
403
|
const all = [entry.size, ...others];
|
|
390
404
|
// Past what can be tried at once, a widget keeps the size it would rather have.
|
|
391
405
|
const options = combinations * all.length <= MOST_COMBINATIONS ? all : [entry.size];
|
|
@@ -400,11 +414,20 @@ function closedUp(wanted: readonly Wanted[], columns: number): PlacedTile[] {
|
|
|
400
414
|
if (choice === undefined) {
|
|
401
415
|
const placed = packed(wanted, sizes, columns);
|
|
402
416
|
const rows = rowsOf(placed, columns);
|
|
403
|
-
|
|
417
|
+
// The rows what is empty is counted in: the page's, or those the widgets take.
|
|
418
|
+
const counted = kept
|
|
419
|
+
? Math.max(
|
|
420
|
+
0,
|
|
421
|
+
...placed
|
|
422
|
+
.filter(({ tile }) => tile.kind === "widget")
|
|
423
|
+
.map((tile) => tile.y + footprintOf(tile.size, columns).h),
|
|
424
|
+
)
|
|
425
|
+
: rows;
|
|
426
|
+
const filled = placed.reduce((cells, { size, y }) => {
|
|
404
427
|
const { w, h } = footprintOf(size, columns);
|
|
405
|
-
return cells + w * h;
|
|
428
|
+
return cells + w * Math.max(0, Math.min(y + h, counted) - y);
|
|
406
429
|
}, 0);
|
|
407
|
-
const score = [
|
|
430
|
+
const score = [counted * columns - filled, changed, rows];
|
|
408
431
|
if (best === undefined || lessThan(score, best.score)) {
|
|
409
432
|
best = { placed, score };
|
|
410
433
|
}
|
|
@@ -442,30 +465,27 @@ export function arranged(
|
|
|
442
465
|
const hidden = new Set(home?.hidden ?? []);
|
|
443
466
|
const { entries, placed: keepsPlaces } = keptAt(home, columns);
|
|
444
467
|
if (nobodyArranged(home)) {
|
|
445
|
-
//
|
|
446
|
-
//
|
|
468
|
+
// Where the composed page stands every tile on whole cells at a size it comes in, a lead
|
|
469
|
+
// alone with the projects beside it (ADR-0110), the projects alone (ADR-0108), a narrow grid
|
|
470
|
+
// (ADR-0139), arranging starts on those very cells: the page and its arranging do not differ.
|
|
447
471
|
const boxes = composed(tiles, home, columns);
|
|
448
|
-
const
|
|
449
|
-
const left = Math.round(Math.min(...projects.map((box) => box.x)));
|
|
450
|
-
const top = Math.round(Math.min(...projects.map((box) => box.y)));
|
|
451
|
-
const across = Math.max(
|
|
452
|
-
1,
|
|
453
|
-
Math.round(Math.max(...projects.map((box) => box.x + box.w))) - left,
|
|
454
|
-
);
|
|
455
|
-
const taken = new Set<number>();
|
|
456
|
-
return boxes.map(({ tile, size, x, y }) => {
|
|
472
|
+
const whole = boxes.every(({ x, y, w, h, size }) => {
|
|
457
473
|
const shape = footprintOf(size, columns);
|
|
458
|
-
|
|
459
|
-
const near =
|
|
460
|
-
nth < 0
|
|
461
|
-
? { x: Math.round(x), y: Math.round(y) }
|
|
462
|
-
: { x: left + (nth % across), y: top + Math.floor(nth / across) };
|
|
463
|
-
const place = fits(taken, near, shape, columns)
|
|
464
|
-
? near
|
|
465
|
-
: nearestRoom(taken, shape, near, columns);
|
|
466
|
-
occupy(taken, place, shape, columns);
|
|
467
|
-
return { tile, size, ...place };
|
|
474
|
+
return Number.isInteger(x) && Number.isInteger(y) && shape.w === w && shape.h === h;
|
|
468
475
|
});
|
|
476
|
+
if (whole) {
|
|
477
|
+
return boxes.map(({ tile, size, x, y }) => ({ tile, size, x, y }));
|
|
478
|
+
}
|
|
479
|
+
// Otherwise it starts from the page closed up (ADR-0139): the tiles in the page's order, a
|
|
480
|
+
// widget at the size the composed page told it, or at another of its own that takes no cell
|
|
481
|
+
// from it where the rows close with that, the projects icons as they were. Put on the cells
|
|
482
|
+
// nearest where the composed page drew them, a tile drawn wider than any size it comes in
|
|
483
|
+
// left a band of empty cells beside it, and Done kept the bands.
|
|
484
|
+
const told = new Map(boxes.map(({ tile, size }) => [tile.id, size]));
|
|
485
|
+
const wanted = tiles
|
|
486
|
+
.filter((tile) => !hidden.has(tile.id))
|
|
487
|
+
.map((tile) => ({ tile, size: told.get(tile.id) ?? startingSizeAt(tile, columns) }));
|
|
488
|
+
return closedUp(wanted, columns, true);
|
|
469
489
|
}
|
|
470
490
|
if (!keepsPlaces) {
|
|
471
491
|
const wanted: Wanted[] = [];
|
|
@@ -519,6 +539,34 @@ export function arranged(
|
|
|
519
539
|
return placed;
|
|
520
540
|
}
|
|
521
541
|
|
|
542
|
+
/**
|
|
543
|
+
* A page being arranged, closed up (ADR-0139): its tiles in the order they are read, from the
|
|
544
|
+
* top, each widget at the size it has where the rows close with it and at another of its own
|
|
545
|
+
* where they do not, the projects as they are. What a person asks for when a page they kept has
|
|
546
|
+
* gaps they did not mean: from a tile that left, or from the page as it was first arranged.
|
|
547
|
+
*/
|
|
548
|
+
export function tidied(placed: readonly PlacedTile[], columns: number): PlacedTile[] {
|
|
549
|
+
return closedUp(
|
|
550
|
+
inReadingOrder(placed).map(({ tile, size }) => ({ tile, size })),
|
|
551
|
+
columns,
|
|
552
|
+
true,
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/** Whether two arrangements stand every tile on the same cells at the same size. */
|
|
557
|
+
export function sameArrangement(a: readonly PlacedTile[], b: readonly PlacedTile[]): boolean {
|
|
558
|
+
const at = new Map(b.map((tile) => [tile.tile.id, tile]));
|
|
559
|
+
return (
|
|
560
|
+
a.length === b.length &&
|
|
561
|
+
a.every((tile) => {
|
|
562
|
+
const other = at.get(tile.tile.id);
|
|
563
|
+
return (
|
|
564
|
+
other !== undefined && other.x === tile.x && other.y === tile.y && other.size === tile.size
|
|
565
|
+
);
|
|
566
|
+
})
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
|
|
522
570
|
/** How many rows the page takes. */
|
|
523
571
|
export function rowsOf(placed: readonly PlacedTile[], columns: number): number {
|
|
524
572
|
return Math.max(0, ...placed.map((tile) => tile.y + footprintOf(tile.size, columns).h));
|
|
@@ -529,6 +577,14 @@ export function nobodyArranged(home: RestHome | null | undefined): boolean {
|
|
|
529
577
|
return home === null || home === undefined || Object.keys(home.layouts).length === 0;
|
|
530
578
|
}
|
|
531
579
|
|
|
580
|
+
/** The page put back as composed: no width arranged, nothing taken off (ADR-0109). */
|
|
581
|
+
export const COMPOSED_HOME: RestHome = { hidden: [], layouts: {} };
|
|
582
|
+
|
|
583
|
+
/** Whether the page stands as composed, nothing taken off: nothing for putting it back to undo. */
|
|
584
|
+
export function standsComposed(home: RestHome | null | undefined): boolean {
|
|
585
|
+
return nobodyArranged(home) && (home?.hidden.length ?? 0) === 0;
|
|
586
|
+
}
|
|
587
|
+
|
|
532
588
|
/**
|
|
533
589
|
* A tile of the composed page: where it stands and how far it reaches, in cells, which need not
|
|
534
590
|
* be whole, and the size its frame is told, the one of its own nearest that shape.
|
|
@@ -575,9 +631,12 @@ function nearestSize(tile: HomeTile, w: number, h: number, columns: number): Hom
|
|
|
575
631
|
/**
|
|
576
632
|
* The page of someone who has arranged nothing, composed (ADR-0082): the first widget leads,
|
|
577
633
|
* half the page wide, and beside it stand the next two widgets and the projects, the column as
|
|
578
|
-
* high as the lead; on a grid of six columns or fewer they stand one under the other.
|
|
579
|
-
*
|
|
580
|
-
*
|
|
634
|
+
* high as the lead; on a grid of six columns or fewer they stand one under the other. With nothing
|
|
635
|
+
* beside it, the lead stands at a size it comes in, and the projects follow it in the columns it
|
|
636
|
+
* leaves (ADR-0110). The projects are icons, one to a cell, in rows as long as their column has
|
|
637
|
+
* cells, so that a project is never drawn in a shape it does not come in and the page is the one
|
|
638
|
+
* arranging starts from (ADR-0108); the last row may end short. The other widgets stand below, two
|
|
639
|
+
* to a row.
|
|
581
640
|
*/
|
|
582
641
|
export function composed(
|
|
583
642
|
tiles: readonly HomeTile[],
|
|
@@ -597,21 +656,66 @@ export function composed(
|
|
|
597
656
|
/** The rows the projects take in a column so wide: as many to a row as a cell each allows. */
|
|
598
657
|
const projectRows = (width: number) =>
|
|
599
658
|
projects.length === 0 ? 0 : Math.ceil(projects.length / Math.max(1, Math.floor(width)));
|
|
600
|
-
/** The projects in rows from a place,
|
|
659
|
+
/** The projects in rows from a place, one to a cell, each row as long as the width has cells. */
|
|
601
660
|
const putProjects = (x: number, y: number, width: number): number => {
|
|
602
|
-
const
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
661
|
+
const across = Math.max(1, Math.floor(width));
|
|
662
|
+
projects.forEach((tile, nth) => {
|
|
663
|
+
put(tile, x + (nth % across), y + Math.floor(nth / across), 1, 1);
|
|
664
|
+
});
|
|
665
|
+
return projectRows(width);
|
|
666
|
+
};
|
|
667
|
+
/**
|
|
668
|
+
* The projects beside a tile in the page's corner, so wide and so high: one to a cell in the
|
|
669
|
+
* columns it leaves, no lower than it reaches, then across the page below it. The row after them.
|
|
670
|
+
*/
|
|
671
|
+
const putProjectsBeside = (w: number, h: number, from = 0): number => {
|
|
672
|
+
const across = columns - w;
|
|
673
|
+
const beside = Math.min(projects.length, across * (h - from));
|
|
674
|
+
projects.forEach((tile, nth) => {
|
|
675
|
+
const below = nth - beside;
|
|
676
|
+
if (below < 0) {
|
|
677
|
+
put(tile, w + (nth % across), from + Math.floor(nth / across), 1, 1);
|
|
678
|
+
} else {
|
|
679
|
+
put(tile, below % columns, h + Math.floor(below / columns), 1, 1);
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
const left = projects.length - beside;
|
|
683
|
+
return h + Math.ceil(left / columns);
|
|
684
|
+
};
|
|
685
|
+
/**
|
|
686
|
+
* The widgets after the lead that stand beside it where it stands at a size of its own and
|
|
687
|
+
* leaves columns (ADR-0139): in their order, each at the largest of its sizes those columns
|
|
688
|
+
* hold, one under the other, no lower than the lead reaches, and none after the first that
|
|
689
|
+
* has no such size. How many stand there, and how far down they reach.
|
|
690
|
+
*/
|
|
691
|
+
const putWidgetsBeside = (
|
|
692
|
+
list: readonly HomeTile[],
|
|
693
|
+
w: number,
|
|
694
|
+
h: number,
|
|
695
|
+
): { readonly stood: number; readonly down: number } => {
|
|
696
|
+
const across = columns - w;
|
|
697
|
+
const area = (size: HomeTileSize) => HOME_TILE_CELLS[size].columns * HOME_TILE_CELLS[size].rows;
|
|
698
|
+
let down = 0;
|
|
699
|
+
let stood = 0;
|
|
700
|
+
for (const tile of list) {
|
|
701
|
+
const [size] = sizesAt(tile, columns)
|
|
702
|
+
.filter((candidate) => {
|
|
703
|
+
const cells = footprintOf(candidate, columns);
|
|
704
|
+
return cells.w === across && cells.h <= h - down;
|
|
705
|
+
})
|
|
706
|
+
.sort(
|
|
707
|
+
(a, b) =>
|
|
708
|
+
area(b) - area(a) || Number(b === tile.defaultSize) - Number(a === tile.defaultSize),
|
|
709
|
+
);
|
|
710
|
+
if (size === undefined) {
|
|
711
|
+
break;
|
|
612
712
|
}
|
|
713
|
+
const shape = footprintOf(size, columns);
|
|
714
|
+
boxes.push({ tile, size, x: w, y: down, ...shape });
|
|
715
|
+
down += shape.h;
|
|
716
|
+
stood += 1;
|
|
613
717
|
}
|
|
614
|
-
return
|
|
718
|
+
return { stood, down };
|
|
615
719
|
};
|
|
616
720
|
/** Widgets two to a row across the page, one alone as wide as the page. */
|
|
617
721
|
const putInPairs = (list: readonly HomeTile[], from: number): number => {
|
|
@@ -655,12 +759,32 @@ export function composed(
|
|
|
655
759
|
}
|
|
656
760
|
y = putInPairs([...others.slice(MOST_BESIDE), ...bottom], y);
|
|
657
761
|
} else {
|
|
762
|
+
let projectsPut = false;
|
|
763
|
+
let below = others;
|
|
658
764
|
if (lead !== undefined) {
|
|
659
|
-
|
|
660
|
-
|
|
765
|
+
// Nothing beside it, the lead is drawn at the size it is told, on that size's cells, and
|
|
766
|
+
// never stretched to the page's width and four rows (ADR-0110).
|
|
767
|
+
const size = nearestSize(lead, columns, LEAD_ROWS, columns);
|
|
768
|
+
const shape = footprintOf(size, columns);
|
|
769
|
+
boxes.push({ tile: lead, size, x: 0, y: 0, ...shape });
|
|
770
|
+
y = shape.h;
|
|
771
|
+
if (shape.w < columns) {
|
|
772
|
+
// In the columns it leaves stand the widgets that come in a size as wide as those
|
|
773
|
+
// columns, then the projects in the rows the widgets leave (ADR-0139): on a grid of six,
|
|
774
|
+
// two small widgets beside a large lead, where the projects alone left most of those
|
|
775
|
+
// columns empty and the widgets stood under the lead, each drawn at no size of its own.
|
|
776
|
+
const { stood, down } = putWidgetsBeside(others, shape.w, shape.h);
|
|
777
|
+
below = others.slice(stood);
|
|
778
|
+
if (projects.length > 0 && (stood === 0 || down < shape.h)) {
|
|
779
|
+
y = putProjectsBeside(shape.w, shape.h, down);
|
|
780
|
+
projectsPut = true;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
y = putInPairs(below, y);
|
|
785
|
+
if (!projectsPut) {
|
|
786
|
+
y += putProjects(0, y, columns);
|
|
661
787
|
}
|
|
662
|
-
y = putInPairs(others, y);
|
|
663
|
-
y += putProjects(0, y, columns);
|
|
664
788
|
putInPairs(bottom, y);
|
|
665
789
|
}
|
|
666
790
|
return boxes;
|