basalt-ui 1.41.0 → 2.0.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/AGENTS.md +46 -43
- package/CHANGELOG.md +542 -518
- package/MIGRATING.md +964 -37
- package/README.md +171 -366
- package/agent/rules/basalt-batteries.md +19 -74
- package/agent/rules/basalt-charts.md +21 -95
- package/agent/rules/basalt-controls.md +23 -131
- package/agent/rules/basalt-mantine.md +26 -99
- package/agent/rules/basalt-state.md +21 -103
- package/agent/rules/basalt-tokens.md +33 -114
- package/agent/skills/basalt-app/SKILL.md +229 -72
- package/agent/skills/basalt-charts/SKILL.md +23 -57
- package/agent/skills/basalt-design/SKILL.md +12 -70
- package/agent/templates/AGENTS-block.md.tpl +16 -26
- package/agent/templates/DESIGN.md.tpl +1 -1
- package/agent/templates/__root.tpl +9 -16
- package/agent/templates/main.tpl +21 -0
- package/agent/templates/nav.tpl +18 -0
- package/configs/oxlint-basalt.json +4 -10
- package/configs/oxlint-plugin.js +465 -844
- package/configs/oxlint-plugin.test.ts +661 -709
- package/configs/oxlint.json +10 -2
- package/dist/agent/ai-sdk-transport.d.ts +19 -7
- package/dist/agent/ai-sdk-transport.d.ts.map +1 -1
- package/dist/agent/ai-sdk-transport.js +10 -7
- package/dist/{agent-chat → agent/chat}/composer.d.ts +16 -16
- package/dist/agent/chat/composer.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/composer.js +10 -9
- package/dist/{agent-chat → agent/chat}/message-affordances.d.ts +7 -6
- package/dist/agent/chat/message-affordances.d.ts.map +1 -0
- package/dist/agent/chat/relative-time.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/thread-feed-row.d.ts +18 -16
- package/dist/agent/chat/thread-feed-row.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/thread-feed-row.js +12 -11
- package/dist/{agent-chat → agent/chat}/thread-feed.d.ts +8 -8
- package/dist/agent/chat/thread-feed.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/thread-feed.js +12 -10
- package/dist/{agent-chat → agent/chat}/thread-message.d.ts +12 -9
- package/dist/agent/chat/thread-message.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/thread-message.js +15 -13
- package/dist/{agent-chat → agent/chat}/thread-outcome-card.d.ts +2 -2
- package/dist/agent/chat/thread-outcome-card.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/thread-outcome-card.js +3 -3
- package/dist/{agent-chat → agent/chat}/tool-chip.d.ts +5 -5
- package/dist/agent/chat/tool-chip.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/tool-chip.js +4 -4
- package/dist/agent/chat/use-keyboard-inset.d.ts.map +1 -0
- package/dist/{agent-chat → agent/chat}/use-keyboard-inset.js +1 -1
- package/dist/{agent-chat → agent/chat}/virtualize.d.ts +7 -7
- package/dist/agent/chat/virtualize.d.ts.map +1 -0
- package/dist/agent/error.d.ts +31 -0
- package/dist/agent/error.d.ts.map +1 -0
- package/dist/agent/error.js +18 -0
- package/dist/agent/history.d.ts +2 -36
- package/dist/agent/history.d.ts.map +1 -1
- package/dist/agent/history.js +0 -32
- package/dist/agent/id.d.ts +4 -5
- package/dist/agent/id.d.ts.map +1 -1
- package/dist/agent/index.d.ts +19 -52
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +10 -32
- package/dist/agent/outcome.d.ts +3 -14
- package/dist/agent/outcome.d.ts.map +1 -1
- package/dist/agent/outcome.js +0 -30
- package/dist/agent/part-list.d.ts +3 -3
- package/dist/agent/part-list.d.ts.map +1 -1
- package/dist/agent/parts.d.ts +23 -24
- package/dist/agent/parts.d.ts.map +1 -1
- package/dist/agent/run-committer.d.ts +23 -0
- package/dist/agent/run-committer.d.ts.map +1 -0
- package/dist/agent/run-committer.js +41 -0
- package/dist/agent/run-records.d.ts +77 -0
- package/dist/agent/run-records.d.ts.map +1 -0
- package/dist/agent/run-records.js +69 -0
- package/dist/agent/thread.d.ts +23 -47
- package/dist/agent/thread.d.ts.map +1 -1
- package/dist/agent/thread.js +3 -134
- package/dist/agent/transport.d.ts +6 -69
- package/dist/agent/transport.d.ts.map +1 -1
- package/dist/agent/transport.js +0 -18
- package/dist/agent/use-agent-thread-runs.d.ts +63 -26
- package/dist/agent/use-agent-thread-runs.d.ts.map +1 -1
- package/dist/agent/use-agent-thread-runs.js +202 -66
- package/dist/charts/BandStrip.d.ts +46 -0
- package/dist/charts/BandStrip.d.ts.map +1 -0
- package/dist/charts/BandStrip.js +151 -0
- package/dist/charts/Bars.d.ts +19 -0
- package/dist/charts/Bars.d.ts.map +1 -0
- package/dist/charts/Bars.js +77 -0
- package/dist/charts/CartesianChart.d.ts +57 -0
- package/dist/charts/CartesianChart.d.ts.map +1 -0
- package/dist/charts/CartesianChart.js +121 -0
- package/dist/charts/ChartCard.d.ts +34 -0
- package/dist/charts/ChartCard.d.ts.map +1 -0
- package/dist/charts/ChartCard.js +115 -0
- package/dist/charts/Donut.d.ts +25 -0
- package/dist/charts/Donut.d.ts.map +1 -0
- package/dist/charts/Donut.js +191 -0
- package/dist/charts/DualPanel.d.ts +47 -0
- package/dist/charts/DualPanel.d.ts.map +1 -0
- package/dist/charts/DualPanel.js +214 -0
- package/dist/charts/Heatmap.d.ts +41 -0
- package/dist/charts/Heatmap.d.ts.map +1 -0
- package/dist/charts/Heatmap.js +216 -0
- package/dist/charts/Lines.d.ts +11 -0
- package/dist/charts/Lines.d.ts.map +1 -0
- package/dist/charts/Lines.js +114 -0
- package/dist/charts/MirroredBars.d.ts +44 -0
- package/dist/charts/MirroredBars.d.ts.map +1 -0
- package/dist/charts/MirroredBars.js +190 -0
- package/dist/charts/Sparkline.d.ts +22 -0
- package/dist/charts/Sparkline.d.ts.map +1 -0
- package/dist/charts/Sparkline.js +129 -0
- package/dist/charts/StackedArea.d.ts +15 -0
- package/dist/charts/StackedArea.d.ts.map +1 -0
- package/dist/charts/StackedArea.js +46 -0
- package/dist/charts/box.d.ts +38 -0
- package/dist/charts/box.d.ts.map +1 -0
- package/dist/charts/box.js +72 -0
- package/dist/charts/card-context.d.ts +3 -0
- package/dist/charts/card-context.d.ts.map +1 -0
- package/dist/charts/card-context.js +7 -0
- package/dist/charts/chart-box.module.css +64 -0
- package/{src/content/article-card.module.css.d.ts → dist/charts/chart-box.module.css.d.ts} +5 -9
- package/dist/charts/chart-card.module.css +25 -0
- package/dist/{dashboard/widget-grid.module.css.d.ts → charts/chart-card.module.css.d.ts} +1 -3
- package/dist/charts/chart-legend.module.css +38 -0
- package/{src/dashboard/widget-grid.module.css.d.ts → dist/charts/chart-legend.module.css.d.ts} +3 -3
- package/dist/charts/compile.d.ts +62 -0
- package/dist/charts/compile.d.ts.map +1 -0
- package/dist/charts/compile.js +386 -0
- package/dist/charts/cursor.d.ts +50 -0
- package/dist/charts/cursor.d.ts.map +1 -0
- package/dist/charts/cursor.js +157 -0
- package/dist/charts/curves.d.ts +12 -0
- package/dist/charts/curves.d.ts.map +1 -0
- package/dist/charts/curves.js +86 -0
- package/dist/charts/donut.module.css +54 -0
- package/dist/{content/article-card.module.css.d.ts → charts/donut.module.css.d.ts} +2 -9
- package/dist/charts/host.d.ts +17 -0
- package/dist/charts/host.d.ts.map +1 -0
- package/dist/charts/host.js +35 -0
- package/dist/charts/index.d.ts +18 -53
- package/dist/charts/index.d.ts.map +1 -1
- package/dist/charts/index.js +17 -189
- package/dist/charts/legend.d.ts +23 -0
- package/dist/charts/legend.d.ts.map +1 -0
- package/dist/charts/legend.js +160 -0
- package/dist/charts/marks.d.ts +25 -0
- package/dist/charts/marks.d.ts.map +1 -0
- package/dist/charts/marks.js +128 -0
- package/dist/charts/panel.d.ts +56 -0
- package/dist/charts/panel.d.ts.map +1 -0
- package/dist/charts/panel.js +123 -0
- package/dist/charts/scales.d.ts +44 -0
- package/dist/charts/scales.d.ts.map +1 -0
- package/dist/charts/scales.js +163 -0
- package/dist/charts/sizing.d.ts +12 -0
- package/dist/charts/sizing.d.ts.map +1 -0
- package/dist/charts/sizing.js +33 -0
- package/dist/charts/state.d.ts +17 -0
- package/dist/charts/state.d.ts.map +1 -0
- package/dist/charts/state.js +53 -0
- package/dist/charts/theme.d.ts +38 -19
- package/dist/charts/theme.d.ts.map +1 -1
- package/dist/charts/theme.js +48 -26
- package/dist/charts/types.d.ts +227 -0
- package/dist/charts/types.d.ts.map +1 -0
- package/dist/charts/types.js +4 -0
- package/dist/cli/audit-allows.d.ts +4 -17
- package/dist/cli/audit-allows.d.ts.map +1 -1
- package/dist/cli/config.d.ts +18 -43
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +6 -0
- package/dist/cli/doctor-upgrade.d.ts +43 -0
- package/dist/cli/doctor-upgrade.d.ts.map +1 -0
- package/dist/cli/doctor-upgrade.js +314 -0
- package/dist/cli/doctor.d.ts +14 -29
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +58 -9
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +2 -4
- package/dist/cli/index.d.ts +48 -172
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +39 -132
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +43 -37
- package/dist/cli/sync.d.ts +5 -21
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +4 -23
- package/dist/cli/tokens-css.d.ts +7 -28
- package/dist/cli/tokens-css.d.ts.map +1 -1
- package/dist/commands/ShortcutsHelp.d.ts.map +1 -1
- package/dist/commands/ShortcutsHelp.js +4 -5
- package/dist/commands/define-commands.d.ts +15 -31
- package/dist/commands/define-commands.d.ts.map +1 -1
- package/dist/commands/define-commands.js +1 -11
- package/dist/commands/define-overlays.d.ts +5 -19
- package/dist/commands/define-overlays.d.ts.map +1 -1
- package/dist/commands/define-overlays.js +3 -11
- package/dist/commands/index.d.ts +10 -40
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +9 -46
- package/dist/{notifications → commands/notifications}/bell.d.ts +1 -1
- package/dist/commands/notifications/bell.d.ts.map +1 -0
- package/dist/{notifications → commands/notifications}/center.d.ts +2 -2
- package/dist/commands/notifications/center.d.ts.map +1 -0
- package/dist/{notifications → commands/notifications}/center.js +2 -2
- package/dist/{notifications → commands/notifications}/define-notifications.d.ts +3 -3
- package/dist/commands/notifications/define-notifications.d.ts.map +1 -0
- package/dist/commands/notifications/notify.d.ts +44 -0
- package/dist/commands/notifications/notify.d.ts.map +1 -0
- package/dist/commands/notifications/notify.js +79 -0
- package/dist/{notifications → commands/notifications}/store.d.ts +2 -0
- package/dist/commands/notifications/store.d.ts.map +1 -0
- package/dist/{notifications → commands/notifications}/store.js +4 -0
- package/dist/commands/projectors.d.ts +1 -131
- package/dist/commands/projectors.d.ts.map +1 -1
- package/dist/commands/projectors.js +2 -73
- package/dist/commands/shell-bridge.d.ts +3 -3
- package/dist/commands/shortcut-format.d.ts +5 -4
- package/dist/commands/shortcut-format.d.ts.map +1 -1
- package/dist/common/errors.d.ts +3 -3
- package/dist/common/use-measured-widths.d.ts.map +1 -1
- package/dist/common/use-measured-widths.js +5 -3
- package/dist/common/validate.d.ts +2 -2
- package/dist/content/article-layout.d.ts.map +1 -1
- package/dist/content/article-layout.js +3 -3
- package/dist/content/article-model.d.ts +1 -46
- package/dist/content/article-model.d.ts.map +1 -1
- package/dist/content/article-model.js +1 -29
- package/dist/content/index.d.ts +11 -41
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +3 -35
- package/dist/content/markdown.d.ts +1 -1
- package/dist/content/markdown.d.ts.map +1 -1
- package/dist/content/markdown.js +1 -1
- package/dist/content/mermaid.d.ts.map +1 -1
- package/dist/content/mermaid.js +7 -7
- package/dist/content/slug.d.ts +1 -8
- package/dist/content/slug.d.ts.map +1 -1
- package/dist/content/slug.js +1 -8
- package/dist/content/url-hardening.d.ts +2 -2
- package/dist/content/url-hardening.d.ts.map +1 -1
- package/dist/content/url-hardening.js +2 -0
- package/dist/controls/actions.d.ts +16 -1
- package/dist/controls/actions.d.ts.map +1 -1
- package/dist/controls/enum-filter.d.ts +1 -1
- package/dist/controls/enum-filter.d.ts.map +1 -1
- package/dist/controls/filter-context.d.ts.map +1 -1
- package/dist/controls/filter-context.js +3 -1
- package/dist/controls/filter-set.js +4 -6
- package/dist/controls/form-layout.d.ts +1 -1
- package/dist/controls/form-layout.d.ts.map +1 -1
- package/dist/controls/form-layout.js +1 -1
- package/dist/controls/glyphs.d.ts +0 -2
- package/dist/controls/glyphs.d.ts.map +1 -1
- package/dist/controls/glyphs.js +0 -7
- package/dist/controls/index.d.ts +12 -17
- package/dist/controls/index.d.ts.map +1 -1
- package/dist/controls/index.js +5 -39
- package/dist/controls/multi-select-filter.d.ts +4 -3
- package/dist/controls/multi-select-filter.d.ts.map +1 -1
- package/dist/controls/number-filter.d.ts +4 -3
- package/dist/controls/number-filter.d.ts.map +1 -1
- package/dist/controls/number-filter.js +3 -1
- package/dist/controls/range-filter.d.ts +4 -3
- package/dist/controls/range-filter.d.ts.map +1 -1
- package/dist/controls/search-filter.d.ts +4 -3
- package/dist/controls/search-filter.d.ts.map +1 -1
- package/dist/controls/search-filter.js +19 -14
- package/dist/controls/select-filter.d.ts +4 -3
- package/dist/controls/select-filter.d.ts.map +1 -1
- package/dist/controls/sync-button.d.ts.map +1 -1
- package/dist/controls/sync-button.js +12 -15
- package/dist/controls/toggle-filter.d.ts +4 -3
- package/dist/controls/toggle-filter.d.ts.map +1 -1
- package/dist/controls/uncontrolled.d.ts +12 -0
- package/dist/controls/uncontrolled.d.ts.map +1 -0
- package/dist/controls/view-tabs.d.ts +2 -2
- package/dist/controls/view-tabs.d.ts.map +1 -1
- package/dist/controls-dates/index.d.ts +0 -1
- package/dist/controls-dates/index.d.ts.map +1 -1
- package/dist/dashboard/index.d.ts +7 -9
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +3 -23
- package/dist/dashboard/section.d.ts +4 -6
- package/dist/dashboard/section.d.ts.map +1 -1
- package/dist/dashboard/section.js +4 -10
- package/dist/dashboard/stat-card.d.ts +4 -4
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +3 -3
- package/dist/dashboard/widget-header.module.css +9 -7
- package/dist/dev-dock.d.ts.map +1 -1
- package/dist/dev-dock.js +6 -1
- package/dist/format/date.d.ts +0 -34
- package/dist/format/date.d.ts.map +1 -1
- package/dist/format/date.js +0 -54
- package/dist/format/index.d.ts +7 -22
- package/dist/format/index.d.ts.map +1 -1
- package/dist/format/index.js +2 -43
- package/dist/format/number.d.ts +3 -14
- package/dist/format/number.d.ts.map +1 -1
- package/dist/format/number.js +0 -13
- package/dist/format/shared.d.ts +2 -3
- package/dist/format/shared.d.ts.map +1 -1
- package/dist/forms/index.d.ts +0 -11
- package/dist/forms/index.d.ts.map +1 -1
- package/dist/forms/index.js +1 -14
- package/dist/guard/index.d.ts +6 -21
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +27 -115
- package/dist/guard/types.d.ts +7 -18
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/index.d.ts +16 -48
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -117
- package/dist/provider/create-router.d.ts +44 -0
- package/dist/provider/create-router.d.ts.map +1 -0
- package/dist/provider/create-router.js +62 -0
- package/dist/provider/hotkeys.d.ts +8 -0
- package/dist/provider/hotkeys.d.ts.map +1 -0
- package/dist/provider/hotkeys.js +50 -0
- package/dist/provider/index.d.ts +33 -110
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +182 -82
- package/dist/provider/lab-theme.d.ts.map +1 -1
- package/dist/provider/route-transition.d.ts +76 -0
- package/dist/provider/route-transition.d.ts.map +1 -0
- package/dist/provider/route-transition.js +98 -0
- package/dist/provider/spotlight-actions.d.ts +10 -0
- package/dist/provider/spotlight-actions.d.ts.map +1 -0
- package/dist/provider/spotlight-actions.js +55 -0
- package/dist/provider/test-router.d.ts +6 -0
- package/dist/provider/test-router.d.ts.map +1 -0
- package/dist/provider/test-router.js +18 -0
- package/dist/query-client.d.ts +4 -20
- package/dist/query-client.d.ts.map +1 -1
- package/dist/query-client.js +2 -2
- package/dist/router-tanstack/index.d.ts +18 -64
- package/dist/router-tanstack/index.d.ts.map +1 -1
- package/dist/router-tanstack/index.js +2 -16
- package/dist/router-tanstack/nav.d.ts +12 -1
- package/dist/router-tanstack/nav.d.ts.map +1 -1
- package/dist/router-tanstack/nav.js +8 -1
- package/dist/router-tanstack/search-store.d.ts +1 -1
- package/dist/router-tanstack/search-store.d.ts.map +1 -1
- package/dist/router-tanstack/use-nav.d.ts +8 -9
- package/dist/router-tanstack/use-nav.d.ts.map +1 -1
- package/dist/router-tanstack/use-nav.js +20 -1
- package/dist/shell/app-mobile-nav.d.ts.map +1 -1
- package/dist/shell/app-sidebar.js +1 -1
- package/dist/shell/index.d.ts +31 -10
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +14 -3
- package/dist/shell/page-aside.d.ts +2 -2
- package/dist/shell/page-aside.d.ts.map +1 -1
- package/dist/shell/page-aside.js +31 -12
- package/dist/shell/page-bar.d.ts +2 -2
- package/dist/shell/page-bar.d.ts.map +1 -1
- package/dist/shell/page-bar.js +1 -1
- package/dist/state.d.ts +10 -12
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +4 -6
- package/dist/styles.css +107 -7
- package/dist/surfaces.d.ts +28 -103
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +54 -143
- package/dist/{data → table}/data-table-state.d.ts +1 -1
- package/dist/table/data-table-state.d.ts.map +1 -0
- package/dist/{data → table}/data-table-state.js +4 -3
- package/dist/{data → table}/data-table.d.ts +28 -49
- package/dist/table/data-table.d.ts.map +1 -0
- package/dist/{data → table}/data-table.js +74 -60
- package/dist/table/index.d.ts +18 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/{data/table.js → table/index.js} +1 -1
- package/dist/table/query-branch.d.ts.map +1 -0
- package/dist/table/table-features.d.ts +69 -0
- package/dist/table/table-features.d.ts.map +1 -0
- package/dist/table/table-features.js +49 -0
- package/dist/telemetry.d.ts +77 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +33 -0
- package/dist/theme/index.d.ts +10 -21
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +3 -14
- package/dist/theme/theme-toggle.d.ts.map +1 -1
- package/dist/theme/theme-toggle.js +7 -33
- package/dist/theme/theme-toggle.module.css +30 -0
- package/dist/theme/theme-toggle.module.css.d.ts +10 -0
- package/dist/theme-lab/derive-controls.d.ts.map +1 -1
- package/dist/theme-lab/derive-controls.js +5 -3
- package/dist/theme-lab/derive-state.d.ts.map +1 -1
- package/dist/theme-lab/derive-state.js +2 -1
- package/dist/tokens/core.d.ts +360 -0
- package/dist/tokens/core.d.ts.map +1 -0
- package/dist/tokens/core.js +708 -0
- package/dist/tokens/derive.d.ts +1 -1
- package/dist/tokens/derive.d.ts.map +1 -1
- package/dist/tokens/index.d.ts +5 -373
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +8 -700
- package/dist/tokens/palette.d.ts +2 -6
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +1 -4
- package/dist/vite.d.ts +4 -3
- package/dist/vite.d.ts.map +1 -1
- package/llms.txt +43 -85
- package/package.json +80 -173
- package/src/agent/ai-sdk-transport.ts +57 -37
- package/src/{agent-chat → agent/chat}/composer.tsx +29 -30
- package/src/{agent-chat → agent/chat}/message-affordances.ts +8 -5
- package/src/{agent-chat → agent/chat}/thread-feed-row.tsx +30 -35
- package/src/{agent-chat → agent/chat}/thread-feed.tsx +40 -35
- package/src/{agent-chat → agent/chat}/thread-message.tsx +37 -35
- package/src/{agent-chat → agent/chat}/thread-outcome-card.tsx +5 -5
- package/src/{agent-chat → agent/chat}/tool-chip.tsx +12 -12
- package/src/{agent-chat → agent/chat}/use-keyboard-inset.ts +1 -1
- package/src/{agent-chat → agent/chat}/virtualize.ts +5 -5
- package/src/agent/error.ts +43 -0
- package/src/agent/history.ts +2 -107
- package/src/agent/id.ts +4 -5
- package/src/agent/index.ts +23 -112
- package/src/agent/outcome.ts +3 -56
- package/src/agent/part-list.tsx +3 -3
- package/src/agent/parts.ts +23 -22
- package/src/agent/run-committer.ts +64 -0
- package/src/agent/run-records.ts +147 -0
- package/src/agent/thread.ts +24 -231
- package/src/agent/transport.ts +6 -96
- package/src/agent/use-agent-thread-runs.ts +364 -199
- package/src/charts/BandStrip.tsx +276 -0
- package/src/charts/Bars.tsx +141 -0
- package/src/charts/CartesianChart.tsx +206 -0
- package/src/charts/ChartCard.tsx +178 -0
- package/src/charts/Donut.tsx +256 -0
- package/src/charts/DualPanel.tsx +326 -0
- package/src/charts/Heatmap.tsx +282 -0
- package/src/charts/Lines.tsx +151 -0
- package/src/charts/MirroredBars.tsx +303 -0
- package/src/charts/Sparkline.tsx +176 -0
- package/src/charts/StackedArea.tsx +80 -0
- package/src/charts/box.tsx +96 -0
- package/src/charts/card-context.ts +11 -0
- package/src/charts/chart-box.module.css +64 -0
- package/src/charts/chart-box.module.css.d.ts +12 -0
- package/src/charts/chart-card.module.css +25 -0
- package/src/charts/chart-card.module.css.d.ts +8 -0
- package/src/charts/chart-legend.module.css +38 -0
- package/src/charts/chart-legend.module.css.d.ts +10 -0
- package/src/charts/compile.ts +585 -0
- package/src/charts/cursor.ts +282 -0
- package/src/charts/curves.ts +111 -0
- package/src/charts/donut.module.css +54 -0
- package/src/charts/donut.module.css.d.ts +9 -0
- package/src/charts/host.tsx +60 -0
- package/src/charts/index.ts +41 -178
- package/src/charts/legend.tsx +204 -0
- package/src/charts/marks.ts +201 -0
- package/src/charts/panel.tsx +227 -0
- package/src/charts/scales.ts +237 -0
- package/src/charts/sizing.ts +47 -0
- package/src/charts/state.tsx +80 -0
- package/src/charts/theme.ts +65 -0
- package/src/charts/types.ts +242 -0
- package/src/cli/audit-allows.ts +8 -30
- package/src/cli/config.ts +26 -43
- package/src/cli/doctor-upgrade.ts +457 -0
- package/src/cli/doctor.ts +89 -72
- package/src/cli/help.ts +2 -4
- package/src/cli/index.ts +100 -384
- package/src/cli/init.ts +60 -51
- package/src/cli/sync.ts +13 -68
- package/src/cli/tokens-css.ts +7 -28
- package/src/commands/ShortcutsHelp.tsx +8 -9
- package/src/commands/define-commands.ts +16 -43
- package/src/commands/define-overlays.ts +12 -36
- package/src/commands/index.ts +11 -94
- package/src/{notifications → commands/notifications}/bell.tsx +2 -2
- package/src/{notifications → commands/notifications}/center.tsx +7 -5
- package/src/{notifications → commands/notifications}/define-notifications.ts +3 -3
- package/src/commands/notifications/notify.tsx +158 -0
- package/src/{notifications → commands/notifications}/store.ts +10 -2
- package/src/commands/projectors.ts +5 -225
- package/src/commands/shell-bridge.ts +5 -5
- package/src/commands/shortcut-format.ts +5 -4
- package/src/common/errors.ts +3 -3
- package/src/common/use-measured-widths.ts +6 -3
- package/src/common/validate.ts +2 -2
- package/src/content/article-layout.tsx +37 -38
- package/src/content/article-model.ts +1 -84
- package/src/content/index.ts +12 -83
- package/src/content/markdown.tsx +4 -3
- package/src/content/mermaid.tsx +9 -7
- package/src/content/slug.ts +1 -16
- package/src/content/url-hardening.ts +8 -2
- package/src/controls/actions.tsx +24 -1
- package/src/controls/enum-filter.tsx +1 -1
- package/src/controls/filter-context.tsx +3 -1
- package/src/controls/filter-set.tsx +5 -7
- package/src/controls/form-layout.tsx +2 -2
- package/src/controls/glyphs.tsx +0 -10
- package/src/controls/index.ts +13 -64
- package/src/controls/multi-select-filter.tsx +5 -4
- package/src/controls/number-filter.tsx +8 -4
- package/src/controls/range-filter.tsx +5 -4
- package/src/controls/search-filter.tsx +25 -19
- package/src/controls/select-filter.tsx +5 -4
- package/src/controls/sync-button.tsx +18 -20
- package/src/controls/toggle-filter.tsx +5 -4
- package/src/controls/uncontrolled.ts +12 -0
- package/src/controls/view-tabs.tsx +3 -3
- package/src/controls-dates/date-range-picker.tsx +1 -1
- package/src/controls-dates/index.ts +0 -1
- package/src/dashboard/index.ts +7 -48
- package/src/dashboard/section.tsx +11 -40
- package/src/dashboard/stat-card.tsx +14 -16
- package/src/dashboard/widget-header.module.css +9 -7
- package/src/dev-dock.tsx +14 -27
- package/src/format/date.ts +2 -92
- package/src/format/index.ts +7 -53
- package/src/format/number.ts +3 -26
- package/src/format/shared.ts +2 -3
- package/src/forms/index.ts +0 -23
- package/src/guard/index.ts +36 -191
- package/src/guard/types.ts +6 -19
- package/src/index.ts +30 -282
- package/src/provider/create-router.tsx +138 -0
- package/src/provider/hotkeys.ts +70 -0
- package/src/provider/index.tsx +260 -230
- package/src/provider/lab-theme.ts +3 -2
- package/src/provider/route-transition.ts +199 -0
- package/src/provider/spotlight-actions.tsx +69 -0
- package/src/provider/test-router.tsx +25 -0
- package/src/query-client.ts +4 -22
- package/src/router-tanstack/index.ts +18 -112
- package/src/router-tanstack/nav.ts +28 -2
- package/src/router-tanstack/search-store.ts +9 -2
- package/src/router-tanstack/use-nav.ts +47 -13
- package/src/shell/app-mobile-nav.tsx +3 -2
- package/src/shell/app-sidebar.tsx +1 -1
- package/src/shell/aside-docking.ts +1 -1
- package/src/shell/index.tsx +61 -20
- package/src/shell/page-aside.tsx +47 -23
- package/src/shell/page-bar.tsx +3 -3
- package/src/shell/page-title.tsx +1 -1
- package/src/state.ts +11 -37
- package/src/styles.css +107 -7
- package/src/surfaces.ts +56 -151
- package/src/{data → table}/data-table-state.ts +5 -4
- package/src/{data → table}/data-table.tsx +170 -161
- package/src/table/index.ts +18 -0
- package/src/table/table-features.ts +102 -0
- package/src/telemetry.ts +110 -0
- package/src/theme/index.ts +22 -47
- package/src/theme/theme-toggle.module.css +30 -0
- package/src/theme/theme-toggle.module.css.d.ts +10 -0
- package/src/theme/theme-toggle.tsx +15 -43
- package/src/theme-lab/derive-controls.tsx +5 -3
- package/src/theme-lab/derive-state.ts +2 -1
- package/src/tokens/core.ts +1163 -0
- package/src/tokens/derive.ts +1 -1
- package/src/tokens/index.ts +14 -1181
- package/src/tokens/palette.ts +3 -7
- package/src/vite.ts +3 -3
- package/agent/templates/query-client.ts.tpl +0 -26
- package/dist/agent/adapter.d.ts +0 -150
- package/dist/agent/adapter.d.ts.map +0 -1
- package/dist/agent/adapter.js +0 -482
- package/dist/agent/use-agent-stream.d.ts +0 -35
- package/dist/agent/use-agent-stream.d.ts.map +0 -1
- package/dist/agent/use-agent-stream.js +0 -59
- package/dist/agent-chat/composer.d.ts.map +0 -1
- package/dist/agent-chat/index.d.ts +0 -31
- package/dist/agent-chat/index.d.ts.map +0 -1
- package/dist/agent-chat/index.js +0 -19
- package/dist/agent-chat/message-affordances.d.ts.map +0 -1
- package/dist/agent-chat/relative-time.d.ts.map +0 -1
- package/dist/agent-chat/thread-detail-panel.d.ts +0 -28
- package/dist/agent-chat/thread-detail-panel.d.ts.map +0 -1
- package/dist/agent-chat/thread-detail-panel.js +0 -115
- package/dist/agent-chat/thread-feed-row.d.ts.map +0 -1
- package/dist/agent-chat/thread-feed.d.ts.map +0 -1
- package/dist/agent-chat/thread-message.d.ts.map +0 -1
- package/dist/agent-chat/thread-outcome-card.d.ts.map +0 -1
- package/dist/agent-chat/thread-workspace.d.ts +0 -44
- package/dist/agent-chat/thread-workspace.d.ts.map +0 -1
- package/dist/agent-chat/thread-workspace.js +0 -153
- package/dist/agent-chat/tool-chip.d.ts.map +0 -1
- package/dist/agent-chat/use-keyboard-inset.d.ts.map +0 -1
- package/dist/agent-chat/virtualize.d.ts.map +0 -1
- package/dist/charts/cursor/resolve.d.ts +0 -75
- package/dist/charts/cursor/resolve.d.ts.map +0 -1
- package/dist/charts/cursor/resolve.js +0 -91
- package/dist/charts/cursor/scope.d.ts +0 -20
- package/dist/charts/cursor/scope.d.ts.map +0 -1
- package/dist/charts/cursor/scope.js +0 -20
- package/dist/charts/cursor/store.d.ts +0 -35
- package/dist/charts/cursor/store.d.ts.map +0 -1
- package/dist/charts/cursor/store.js +0 -25
- package/dist/charts/cursor/touch-pin.d.ts +0 -45
- package/dist/charts/cursor/touch-pin.d.ts.map +0 -1
- package/dist/charts/cursor/touch-pin.js +0 -79
- package/dist/charts/hooks/use-discrete-cursor.d.ts +0 -66
- package/dist/charts/hooks/use-discrete-cursor.d.ts.map +0 -1
- package/dist/charts/hooks/use-discrete-cursor.js +0 -198
- package/dist/charts/hooks/use-hysteresis.d.ts +0 -18
- package/dist/charts/hooks/use-hysteresis.d.ts.map +0 -1
- package/dist/charts/hooks/use-hysteresis.js +0 -12
- package/dist/charts/hooks/useBandPlot.d.ts +0 -145
- package/dist/charts/hooks/useBandPlot.d.ts.map +0 -1
- package/dist/charts/hooks/useBandPlot.js +0 -178
- package/dist/charts/hooks/useChartCursor.d.ts +0 -75
- package/dist/charts/hooks/useChartCursor.d.ts.map +0 -1
- package/dist/charts/hooks/useChartCursor.js +0 -200
- package/dist/charts/hooks/useChartSize.d.ts +0 -29
- package/dist/charts/hooks/useChartSize.d.ts.map +0 -1
- package/dist/charts/hooks/useChartSize.js +0 -8
- package/dist/charts/kinds/BandStrip.d.ts +0 -132
- package/dist/charts/kinds/BandStrip.d.ts.map +0 -1
- package/dist/charts/kinds/BandStrip.js +0 -241
- package/dist/charts/kinds/Bars.d.ts +0 -141
- package/dist/charts/kinds/Bars.d.ts.map +0 -1
- package/dist/charts/kinds/Bars.js +0 -343
- package/dist/charts/kinds/Donut.d.ts +0 -77
- package/dist/charts/kinds/Donut.d.ts.map +0 -1
- package/dist/charts/kinds/Donut.js +0 -245
- package/dist/charts/kinds/DualPanel.d.ts +0 -111
- package/dist/charts/kinds/DualPanel.d.ts.map +0 -1
- package/dist/charts/kinds/DualPanel.js +0 -471
- package/dist/charts/kinds/Heatmap.d.ts +0 -85
- package/dist/charts/kinds/Heatmap.d.ts.map +0 -1
- package/dist/charts/kinds/Heatmap.js +0 -243
- package/dist/charts/kinds/MirroredBars.d.ts +0 -98
- package/dist/charts/kinds/MirroredBars.d.ts.map +0 -1
- package/dist/charts/kinds/MirroredBars.js +0 -292
- package/dist/charts/kinds/MultiLine.d.ts +0 -87
- package/dist/charts/kinds/MultiLine.d.ts.map +0 -1
- package/dist/charts/kinds/MultiLine.js +0 -176
- package/dist/charts/kinds/StackedArea.d.ts +0 -73
- package/dist/charts/kinds/StackedArea.d.ts.map +0 -1
- package/dist/charts/kinds/StackedArea.js +0 -135
- package/dist/charts/kinds/ZonedLine.d.ts +0 -97
- package/dist/charts/kinds/ZonedLine.d.ts.map +0 -1
- package/dist/charts/kinds/ZonedLine.js +0 -155
- package/dist/charts/kinds/band-chrome.d.ts +0 -31
- package/dist/charts/kinds/band-chrome.d.ts.map +0 -1
- package/dist/charts/kinds/band-chrome.js +0 -71
- package/dist/charts/kinds/donut-layout.d.ts +0 -47
- package/dist/charts/kinds/donut-layout.d.ts.map +0 -1
- package/dist/charts/kinds/donut-layout.js +0 -52
- package/dist/charts/layout/auto-margin.d.ts +0 -122
- package/dist/charts/layout/auto-margin.d.ts.map +0 -1
- package/dist/charts/layout/auto-margin.js +0 -81
- package/dist/charts/layout/end-labels.d.ts +0 -64
- package/dist/charts/layout/end-labels.d.ts.map +0 -1
- package/dist/charts/layout/end-labels.js +0 -76
- package/dist/charts/layout/log-ticks.d.ts +0 -27
- package/dist/charts/layout/log-ticks.d.ts.map +0 -1
- package/dist/charts/layout/log-ticks.js +0 -42
- package/dist/charts/primitives/AreaGradient.d.ts +0 -18
- package/dist/charts/primitives/AreaGradient.d.ts.map +0 -1
- package/dist/charts/primitives/AreaGradient.js +0 -13
- package/dist/charts/primitives/Axes.d.ts +0 -83
- package/dist/charts/primitives/Axes.d.ts.map +0 -1
- package/dist/charts/primitives/Axes.js +0 -168
- package/dist/charts/primitives/CartesianChart.d.ts +0 -257
- package/dist/charts/primitives/CartesianChart.d.ts.map +0 -1
- package/dist/charts/primitives/CartesianChart.js +0 -549
- package/dist/charts/primitives/ChartCard.d.ts +0 -66
- package/dist/charts/primitives/ChartCard.d.ts.map +0 -1
- package/dist/charts/primitives/ChartCard.js +0 -143
- package/dist/charts/primitives/ChartFrame.d.ts +0 -156
- package/dist/charts/primitives/ChartFrame.d.ts.map +0 -1
- package/dist/charts/primitives/ChartFrame.js +0 -241
- package/dist/charts/primitives/ChartLegend.d.ts +0 -67
- package/dist/charts/primitives/ChartLegend.d.ts.map +0 -1
- package/dist/charts/primitives/ChartLegend.js +0 -292
- package/dist/charts/primitives/ChartPending.d.ts +0 -113
- package/dist/charts/primitives/ChartPending.d.ts.map +0 -1
- package/dist/charts/primitives/ChartPending.js +0 -117
- package/dist/charts/primitives/ChartTooltip.d.ts +0 -59
- package/dist/charts/primitives/ChartTooltip.d.ts.map +0 -1
- package/dist/charts/primitives/ChartTooltip.js +0 -197
- package/dist/charts/primitives/Crosshair.d.ts +0 -26
- package/dist/charts/primitives/Crosshair.d.ts.map +0 -1
- package/dist/charts/primitives/Crosshair.js +0 -23
- package/dist/charts/primitives/HatchPattern.d.ts +0 -31
- package/dist/charts/primitives/HatchPattern.d.ts.map +0 -1
- package/dist/charts/primitives/HatchPattern.js +0 -31
- package/dist/charts/primitives/HoverOverlay.d.ts +0 -45
- package/dist/charts/primitives/HoverOverlay.d.ts.map +0 -1
- package/dist/charts/primitives/HoverOverlay.js +0 -72
- package/dist/charts/primitives/HoverOverlay.module.css +0 -13
- package/dist/charts/primitives/HoverOverlay.module.css.d.ts +0 -8
- package/dist/charts/primitives/XZoneRects.d.ts +0 -54
- package/dist/charts/primitives/XZoneRects.d.ts.map +0 -1
- package/dist/charts/primitives/XZoneRects.js +0 -65
- package/dist/charts/primitives/ZoneRects.d.ts +0 -38
- package/dist/charts/primitives/ZoneRects.d.ts.map +0 -1
- package/dist/charts/primitives/ZoneRects.js +0 -30
- package/dist/charts/primitives/chart-card-context.d.ts +0 -33
- package/dist/charts/primitives/chart-card-context.d.ts.map +0 -1
- package/dist/charts/primitives/chart-card-context.js +0 -18
- package/dist/charts/primitives/chart-frame-layout.d.ts +0 -185
- package/dist/charts/primitives/chart-frame-layout.d.ts.map +0 -1
- package/dist/charts/primitives/chart-frame-layout.js +0 -175
- package/dist/charts/primitives/chart-layout.d.ts +0 -112
- package/dist/charts/primitives/chart-layout.d.ts.map +0 -1
- package/dist/charts/primitives/chart-layout.js +0 -175
- package/dist/charts/primitives/chart-tier.d.ts +0 -16
- package/dist/charts/primitives/chart-tier.d.ts.map +0 -1
- package/dist/charts/primitives/chart-tier.js +0 -44
- package/dist/charts/primitives/legend-disclosure.d.ts +0 -27
- package/dist/charts/primitives/legend-disclosure.d.ts.map +0 -1
- package/dist/charts/primitives/legend-disclosure.js +0 -153
- package/dist/charts/series.d.ts +0 -189
- package/dist/charts/series.d.ts.map +0 -1
- package/dist/charts/series.js +0 -84
- package/dist/charts/sparklines/BarSparkline.d.ts +0 -37
- package/dist/charts/sparklines/BarSparkline.d.ts.map +0 -1
- package/dist/charts/sparklines/BarSparkline.js +0 -53
- package/dist/charts/sparklines/LineSparkline.d.ts +0 -15
- package/dist/charts/sparklines/LineSparkline.d.ts.map +0 -1
- package/dist/charts/sparklines/LineSparkline.js +0 -51
- package/dist/charts/sparklines/index.d.ts +0 -3
- package/dist/charts/sparklines/index.d.ts.map +0 -1
- package/dist/charts/sparklines/index.js +0 -6
- package/dist/charts/utils/domain.d.ts +0 -35
- package/dist/charts/utils/domain.d.ts.map +0 -1
- package/dist/charts/utils/domain.js +0 -12
- package/dist/charts/utils/format.d.ts +0 -8
- package/dist/charts/utils/format.d.ts.map +0 -1
- package/dist/charts/utils/format.js +0 -20
- package/dist/charts/utils/measure-text.d.ts +0 -25
- package/dist/charts/utils/measure-text.d.ts.map +0 -1
- package/dist/charts/utils/measure-text.js +0 -64
- package/dist/charts/utils/ticks.d.ts +0 -103
- package/dist/charts/utils/ticks.d.ts.map +0 -1
- package/dist/charts/utils/ticks.js +0 -92
- package/dist/commands/overlays-mount.d.ts +0 -122
- package/dist/commands/overlays-mount.d.ts.map +0 -1
- package/dist/commands/overlays-mount.js +0 -125
- package/dist/commands/useCommandHotkeys.d.ts +0 -14
- package/dist/commands/useCommandHotkeys.d.ts.map +0 -1
- package/dist/commands/useCommandHotkeys.js +0 -45
- package/dist/content/article-actions.d.ts +0 -39
- package/dist/content/article-actions.d.ts.map +0 -1
- package/dist/content/article-actions.js +0 -28
- package/dist/content/article-card.d.ts +0 -58
- package/dist/content/article-card.d.ts.map +0 -1
- package/dist/content/article-card.js +0 -79
- package/dist/content/article-card.module.css +0 -111
- package/dist/content/mdx.d.ts +0 -20
- package/dist/content/mdx.d.ts.map +0 -1
- package/dist/content/mdx.js +0 -64
- package/dist/controls/compare-filter.d.ts +0 -42
- package/dist/controls/compare-filter.d.ts.map +0 -1
- package/dist/controls/compare-filter.js +0 -38
- package/dist/controls/slider-control.d.ts +0 -36
- package/dist/controls/slider-control.d.ts.map +0 -1
- package/dist/controls/slider-control.js +0 -64
- package/dist/dashboard/widget-grid.d.ts +0 -27
- package/dist/dashboard/widget-grid.d.ts.map +0 -1
- package/dist/dashboard/widget-grid.js +0 -40
- package/dist/dashboard/widget-grid.module.css +0 -69
- package/dist/data/data-table-state.d.ts.map +0 -1
- package/dist/data/data-table.d.ts.map +0 -1
- package/dist/data/query-branch.d.ts.map +0 -1
- package/dist/data/table.d.ts +0 -24
- package/dist/data/table.d.ts.map +0 -1
- package/dist/data/virtual-list.d.ts +0 -133
- package/dist/data/virtual-list.d.ts.map +0 -1
- package/dist/data/virtual-list.js +0 -157
- package/dist/data/virtual.d.ts +0 -21
- package/dist/data/virtual.d.ts.map +0 -1
- package/dist/data/virtual.js +0 -4
- package/dist/forms/FormErrorSummary.d.ts +0 -30
- package/dist/forms/FormErrorSummary.d.ts.map +0 -1
- package/dist/forms/FormErrorSummary.js +0 -30
- package/dist/forms/use-field-array.d.ts +0 -60
- package/dist/forms/use-field-array.d.ts.map +0 -1
- package/dist/forms/use-field-array.js +0 -20
- package/dist/forms/use-form-draft.d.ts +0 -76
- package/dist/forms/use-form-draft.d.ts.map +0 -1
- package/dist/forms/use-form-draft.js +0 -92
- package/dist/forms/use-form-submit.d.ts +0 -88
- package/dist/forms/use-form-submit.d.ts.map +0 -1
- package/dist/forms/use-form-submit.js +0 -63
- package/dist/notifications/bell.d.ts.map +0 -1
- package/dist/notifications/center.d.ts.map +0 -1
- package/dist/notifications/define-notifications.d.ts.map +0 -1
- package/dist/notifications/index.d.ts +0 -40
- package/dist/notifications/index.d.ts.map +0 -1
- package/dist/notifications/index.js +0 -54
- package/dist/notifications/mount-guard.d.ts +0 -8
- package/dist/notifications/mount-guard.d.ts.map +0 -1
- package/dist/notifications/mount-guard.js +0 -18
- package/dist/notifications/notify.d.ts +0 -149
- package/dist/notifications/notify.d.ts.map +0 -1
- package/dist/notifications/notify.js +0 -171
- package/dist/notifications/store.d.ts.map +0 -1
- package/dist/provider/connectivity-indicator.d.ts +0 -13
- package/dist/provider/connectivity-indicator.d.ts.map +0 -1
- package/dist/provider/connectivity-indicator.js +0 -205
- package/dist/provider/connectivity-provider.d.ts +0 -7
- package/dist/provider/connectivity-provider.d.ts.map +0 -1
- package/dist/provider/connectivity-provider.js +0 -128
- package/dist/provider/connectivity-types.d.ts +0 -36
- package/dist/provider/connectivity-types.d.ts.map +0 -1
- package/dist/provider/use-connectivity.d.ts +0 -3
- package/dist/provider/use-connectivity.d.ts.map +0 -1
- package/dist/provider/use-connectivity.js +0 -14
- package/dist/query-devtools.d.ts +0 -21
- package/dist/query-devtools.d.ts.map +0 -1
- package/dist/query-devtools.js +0 -13
- package/src/agent/adapter.ts +0 -945
- package/src/agent/use-agent-stream.ts +0 -154
- package/src/agent-chat/index.ts +0 -54
- package/src/agent-chat/thread-detail-panel.tsx +0 -201
- package/src/agent-chat/thread-workspace.tsx +0 -279
- package/src/charts/cursor/resolve.ts +0 -198
- package/src/charts/cursor/scope.tsx +0 -35
- package/src/charts/cursor/store.ts +0 -58
- package/src/charts/cursor/touch-pin.ts +0 -138
- package/src/charts/hooks/use-discrete-cursor.ts +0 -335
- package/src/charts/hooks/use-hysteresis.ts +0 -26
- package/src/charts/hooks/useBandPlot.ts +0 -383
- package/src/charts/hooks/useChartCursor.ts +0 -367
- package/src/charts/hooks/useChartSize.ts +0 -35
- package/src/charts/kinds/BandStrip.tsx +0 -449
- package/src/charts/kinds/Bars.tsx +0 -589
- package/src/charts/kinds/Donut.tsx +0 -368
- package/src/charts/kinds/DualPanel.tsx +0 -712
- package/src/charts/kinds/Heatmap.tsx +0 -396
- package/src/charts/kinds/MirroredBars.tsx +0 -469
- package/src/charts/kinds/MultiLine.tsx +0 -322
- package/src/charts/kinds/StackedArea.tsx +0 -267
- package/src/charts/kinds/ZonedLine.tsx +0 -301
- package/src/charts/kinds/band-chrome.tsx +0 -91
- package/src/charts/kinds/donut-layout.ts +0 -82
- package/src/charts/layout/auto-margin.ts +0 -242
- package/src/charts/layout/end-labels.ts +0 -135
- package/src/charts/layout/log-ticks.ts +0 -90
- package/src/charts/primitives/AreaGradient.tsx +0 -26
- package/src/charts/primitives/Axes.tsx +0 -271
- package/src/charts/primitives/CartesianChart.tsx +0 -1002
- package/src/charts/primitives/ChartCard.tsx +0 -280
- package/src/charts/primitives/ChartFrame.tsx +0 -493
- package/src/charts/primitives/ChartLegend.tsx +0 -422
- package/src/charts/primitives/ChartPending.tsx +0 -243
- package/src/charts/primitives/ChartTooltip.tsx +0 -265
- package/src/charts/primitives/Crosshair.tsx +0 -43
- package/src/charts/primitives/HatchPattern.tsx +0 -55
- package/src/charts/primitives/HoverOverlay.module.css +0 -13
- package/src/charts/primitives/HoverOverlay.module.css.d.ts +0 -8
- package/src/charts/primitives/HoverOverlay.tsx +0 -109
- package/src/charts/primitives/XZoneRects.tsx +0 -132
- package/src/charts/primitives/ZoneRects.tsx +0 -67
- package/src/charts/primitives/chart-card-context.ts +0 -46
- package/src/charts/primitives/chart-frame-layout.ts +0 -430
- package/src/charts/primitives/chart-layout.ts +0 -318
- package/src/charts/primitives/chart-tier.tsx +0 -76
- package/src/charts/primitives/legend-disclosure.tsx +0 -178
- package/src/charts/series.ts +0 -276
- package/src/charts/sparklines/BarSparkline.tsx +0 -94
- package/src/charts/sparklines/LineSparkline.tsx +0 -71
- package/src/charts/sparklines/index.ts +0 -2
- package/src/charts/theme.tsx +0 -53
- package/src/charts/utils/domain.ts +0 -41
- package/src/charts/utils/format.ts +0 -19
- package/src/charts/utils/measure-text.ts +0 -109
- package/src/charts/utils/ticks.ts +0 -239
- package/src/commands/overlays-mount.tsx +0 -333
- package/src/commands/useCommandHotkeys.ts +0 -114
- package/src/content/article-actions.ts +0 -72
- package/src/content/article-card.module.css +0 -111
- package/src/content/article-card.tsx +0 -174
- package/src/content/mdx.tsx +0 -127
- package/src/controls/compare-filter.tsx +0 -81
- package/src/controls/slider-control.tsx +0 -159
- package/src/dashboard/widget-grid.module.css +0 -69
- package/src/dashboard/widget-grid.tsx +0 -146
- package/src/data/table.ts +0 -39
- package/src/data/virtual-list.tsx +0 -356
- package/src/data/virtual.ts +0 -26
- package/src/forms/FormErrorSummary.tsx +0 -71
- package/src/forms/use-field-array.ts +0 -94
- package/src/forms/use-form-draft.ts +0 -262
- package/src/forms/use-form-submit.ts +0 -199
- package/src/notifications/index.ts +0 -88
- package/src/notifications/mount-guard.ts +0 -38
- package/src/notifications/notify.tsx +0 -379
- package/src/provider/connectivity-indicator.tsx +0 -267
- package/src/provider/connectivity-provider.tsx +0 -189
- package/src/provider/connectivity-types.ts +0 -42
- package/src/provider/use-connectivity.ts +0 -26
- package/src/query-devtools.tsx +0 -40
- /package/dist/{agent-chat → agent/chat}/message-affordances.js +0 -0
- /package/dist/{agent-chat → agent/chat}/relative-time.d.ts +0 -0
- /package/dist/{agent-chat → agent/chat}/relative-time.js +0 -0
- /package/dist/{agent-chat → agent/chat}/use-keyboard-inset.d.ts +0 -0
- /package/dist/{agent-chat → agent/chat}/virtualize.js +0 -0
- /package/dist/{notifications → commands/notifications}/bell.js +0 -0
- /package/dist/{notifications → commands/notifications}/define-notifications.js +0 -0
- /package/dist/{provider/connectivity-types.js → controls/uncontrolled.js} +0 -0
- /package/dist/{data → table}/data-table.module.css +0 -0
- /package/dist/{data → table}/data-table.module.css.d.ts +0 -0
- /package/dist/{data → table}/query-branch.d.ts +0 -0
- /package/dist/{data → table}/query-branch.js +0 -0
- /package/src/{agent-chat → agent/chat}/relative-time.ts +0 -0
- /package/src/{data → table}/data-table.module.css +0 -0
- /package/src/{data → table}/data-table.module.css.d.ts +0 -0
- /package/src/{data → table}/query-branch.ts +0 -0
package/src/cli/index.ts
CHANGED
|
@@ -57,9 +57,7 @@ const GUARD_PASSTHROUGH = {
|
|
|
57
57
|
rawHtmlLayout: true,
|
|
58
58
|
inlineSpacing: true,
|
|
59
59
|
inlineDisplay: true,
|
|
60
|
-
rawVisxAxis: true,
|
|
61
60
|
rawMotionValue: true,
|
|
62
|
-
chartMissingAriaLabel: true,
|
|
63
61
|
rawFormControl: true,
|
|
64
62
|
sub16InputFont: true,
|
|
65
63
|
severity: true,
|
|
@@ -85,13 +83,9 @@ export function resolveGuardConfig(cfg: BasaltConfig, profile: DoctorProfile): G
|
|
|
85
83
|
}
|
|
86
84
|
|
|
87
85
|
/**
|
|
88
|
-
* The one consumer series path
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* Derived from the FIRST configured root (argo's convention: `<root>/lib/series.ts`), not a fixed
|
|
92
|
-
* `src/lib/series.ts` — a monorepo that correctly sets `roots: ['apps/web/src']` has no top-level
|
|
93
|
-
* `src/`, so a hardcoded default would seed a DESIGN.md pointing at a path that cannot exist and
|
|
94
|
-
* silently exempt nothing. `seriesModulePath` still overrides for a layout that isn't `<root>/lib/`.
|
|
86
|
+
* The one consumer series path (DESIGN.md's `{{SERIES_MODULE_PATH}}`, the default scan exemption,
|
|
87
|
+
* the skills' prose). Derived from the FIRST configured root (`<root>/lib/series.ts`), since a
|
|
88
|
+
* monorepo with `roots: ['apps/web/src']` has no top-level `src/`. `seriesModulePath` overrides.
|
|
95
89
|
*/
|
|
96
90
|
function resolveSeriesModulePath(cfg: BasaltConfig): string {
|
|
97
91
|
if (cfg.seriesModulePath !== undefined) return cfg.seriesModulePath
|
|
@@ -126,14 +120,8 @@ export const SERIES_MODULE_HINT_RE = /(series|palette)\.tsx?$/i
|
|
|
126
120
|
const SEVERITY_VALUES: readonly string[] = ['warn', 'error']
|
|
127
121
|
|
|
128
122
|
/**
|
|
129
|
-
* Drop `basalt.severity` entries whose value is not `'warn'` / `'error'`, loudly
|
|
130
|
-
*
|
|
131
|
-
* This is the one config field where a typo REMOVES enforcement rather than failing: package.json
|
|
132
|
-
* is untyped at runtime, and `"warning"` would stamp findings with a value matching neither the
|
|
133
|
-
* error bucket (which fails the build) nor the warn bucket (which prints them) — the kind would
|
|
134
|
-
* vanish and `check-theme` would exit 0 as if the tree were clean. Dropping the entry falls the
|
|
135
|
-
* kind back to its default, so the failure direction of a typo is "stricter than you meant, and
|
|
136
|
-
* told about it" instead of "silently unguarded".
|
|
123
|
+
* Drop `basalt.severity` entries whose value is not `'warn'` / `'error'`, loudly: a typo there would
|
|
124
|
+
* silently REMOVE enforcement. The kind falls back to its default instead (stricter, and told about).
|
|
137
125
|
*/
|
|
138
126
|
function sanitizeSeverity(cfg: BasaltConfig): BasaltConfig {
|
|
139
127
|
const raw: unknown = cfg.severity
|
|
@@ -180,17 +168,10 @@ export function readBasaltConfig(cwd: string): BasaltConfig {
|
|
|
180
168
|
}
|
|
181
169
|
|
|
182
170
|
/**
|
|
183
|
-
* Extensions the walker collects
|
|
184
|
-
* `
|
|
185
|
-
* places whose colors nothing re-derives on a scheme change, and which the scan never reached.
|
|
186
|
-
*
|
|
187
|
-
* `astro`/`jsx`/`vue` close the same gap one component layer up. rollhook's marketing site is
|
|
188
|
-
* Astro: `apps/marketing/src` holds two `.astro` templates that are its ENTIRE markup layer, and
|
|
189
|
-
* check-theme reported a clean 4-file scan without ever opening either. The colour and typography
|
|
190
|
-
* kinds apply to them exactly as they do to `.html`, which was already scanned; `.jsx` and `.vue`
|
|
191
|
-
* were missing from the same regex, so a plain-JS or Vue consumer was unguarded end to end.
|
|
171
|
+
* Extensions the walker collects: source (`.astro`/`.jsx`/`.vue` and the `.mjs`/`.cjs`/`.mts`/`.cts`
|
|
172
|
+
* module spellings) plus `html?`/`webmanifest`, where raw hex ships in `theme-color` and friends.
|
|
192
173
|
*/
|
|
193
|
-
const SCANNABLE_EXT = /\.(?:tsx?|jsx|astro|vue|css|html?|webmanifest)$/
|
|
174
|
+
const SCANNABLE_EXT = /\.(?:tsx?|jsx|[cm][jt]s|astro|vue|css|html?|webmanifest)$/
|
|
194
175
|
|
|
195
176
|
/**
|
|
196
177
|
* Recursively collect scannable files under a root, skipping dependency/build dirs. Node+Bun-safe.
|
|
@@ -237,14 +218,10 @@ export function relativePosix(fromDir: string, toPath: string): string {
|
|
|
237
218
|
}
|
|
238
219
|
|
|
239
220
|
/**
|
|
240
|
-
* Where `basalt-ui` actually resolves from, seen from a consumer directory.
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
* basalt a peer + devDependency gets it at `<pkg>/node_modules` and NOTHING at the root, so all three
|
|
245
|
-
* silently failed to resolve and `bunx` fetched a second, different copy. Resolution therefore walks
|
|
246
|
-
* OUTWARD from the consumer dir, then across the workspace packages — and every caller renders its
|
|
247
|
-
* paths from the answer rather than assuming the root.
|
|
221
|
+
* Where `basalt-ui` actually resolves from, seen from a consumer directory. Under bun's isolated
|
|
222
|
+
* linker a package that declares basalt gets it at `<pkg>/node_modules` and nothing at the root, so
|
|
223
|
+
* resolution walks OUTWARD from the consumer dir, then across workspace packages, and every caller
|
|
224
|
+
* renders its paths from the answer rather than assuming the root.
|
|
248
225
|
*/
|
|
249
226
|
export type BasaltInstall = {
|
|
250
227
|
/** Absolute path of the resolved `node_modules/basalt-ui` directory, or null when unresolvable. */
|
|
@@ -304,14 +281,9 @@ export function shippedAssetPath(install: BasaltInstall, fromDir: string, asset:
|
|
|
304
281
|
}
|
|
305
282
|
|
|
306
283
|
/**
|
|
307
|
-
* Which directory a project-scoped command (`check-theme`, `doctor`)
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
* package whose install lives elsewhere sets `BASALT_CWD` explicitly (or the invoking script's
|
|
311
|
-
* `root:`/`cwd` does) rather than relying on workspace-glob discovery or an ancestor/descendant
|
|
312
|
-
* walk — both were deleted (see `resolveProjectDir`'s own doc below) as multi-repo speculation for
|
|
313
|
-
* a single-owner fleet where every consumer already runs its own commands from its own directory.
|
|
314
|
-
* The scan scope within that directory is `basalt.roots` in `package.json` (default `src`).
|
|
284
|
+
* Which directory a project-scoped command (`check-theme`, `doctor`) reads: `BASALT_CWD` when set,
|
|
285
|
+
* else the invocation cwd. Nothing is inferred (workspace discovery was deleted). The scan scope
|
|
286
|
+
* within it is `basalt.roots` in `package.json` (default `src`).
|
|
315
287
|
*/
|
|
316
288
|
type ProjectResolution = {
|
|
317
289
|
/** The directory to read. Equals the invocation cwd unless BASALT_CWD relocated it. */
|
|
@@ -399,15 +371,9 @@ export function scannableFiles(cwd: string, cfg: BasaltConfig): string[] {
|
|
|
399
371
|
}
|
|
400
372
|
|
|
401
373
|
/**
|
|
402
|
-
* The app-shell files that sit BESIDE a source root rather than inside it
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
* Widening the walker's extension filter alone would still have missed every one of them: argo
|
|
406
|
-
* configures `roots: ['apps/dashboard/src']`, while the raw hex lives in `apps/dashboard/index.html`
|
|
407
|
-
* and `apps/dashboard/public/site.webmanifest`. Both locations are the Vite convention basalt's own
|
|
408
|
-
* `basaltViteConfig`/`basaltAppPlugin` assume, so deriving them from each root's parent needs no
|
|
409
|
-
* config and holds for a monorepo package the same way it holds at a repo root. Nothing else in the
|
|
410
|
-
* parent is walked — a sibling `docs/` full of throwaway HTML stays unscanned.
|
|
374
|
+
* The app-shell files that sit BESIDE a source root rather than inside it: `index.html` and anything
|
|
375
|
+
* under `public/` (argo's raw hex lives in `apps/dashboard/index.html`, with `roots` on `…/src`).
|
|
376
|
+
* Nothing else in the parent is walked.
|
|
411
377
|
*/
|
|
412
378
|
function appShellFiles(rootAbs: string): string[] {
|
|
413
379
|
const appDir = dirname(rootAbs)
|
|
@@ -448,23 +414,14 @@ export function waiverHintFor(relPath: string, profile: DoctorProfile): string {
|
|
|
448
414
|
// ──────────────────────────────────────────────────────────────────────────────
|
|
449
415
|
|
|
450
416
|
/**
|
|
451
|
-
* How a file the framework writes into a consumer repo is owned
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
* what Claude reads (.claude/rules/*, .claude/skills/*, the AGENTS.md block) —
|
|
457
|
-
* Claude Code cannot load rules or skills from node_modules, and that platform limit
|
|
458
|
-
* is the only reason anything is copied at all. The sync diff is the review gate.
|
|
459
|
-
* - `seed` : written once if absent, then owned entirely by the consumer. sync never overwrites
|
|
460
|
-
* it and never reports drift (a starting point, not a managed mirror). Everything a
|
|
461
|
-
* machine reads is a seed, and a good seed's content is a REFERENCE (`extends` into
|
|
462
|
-
* node_modules/basalt-ui/configs/*), not a copy, so the toolchain auto-updates with
|
|
463
|
-
* the package while the consumer still owns the file.
|
|
417
|
+
* How a file the framework writes into a consumer repo is owned:
|
|
418
|
+
* - `managed`: basalt owns it (what Claude reads: .claude/rules/*, .claude/skills/*, the AGENTS.md
|
|
419
|
+
* block). sync refreshes it; a local edit is skipped and reported (`--force` overwrites); `--check`
|
|
420
|
+
* exits 1 on drift.
|
|
421
|
+
* - `seed`: written once if absent, then the consumer's. sync never overwrites it or reports drift.
|
|
464
422
|
*
|
|
465
|
-
*
|
|
466
|
-
*
|
|
467
|
-
* managed ownership scoped to a region.
|
|
423
|
+
* `markers: true` splices a managed `<!-- basalt:begin -->…<!-- basalt:end -->` region into a host
|
|
424
|
+
* file the consumer otherwise owns (AGENTS.md).
|
|
468
425
|
*/
|
|
469
426
|
type Mode = 'managed' | 'seed'
|
|
470
427
|
|
|
@@ -526,7 +483,7 @@ const BLOCK_END = '<!-- basalt:end -->'
|
|
|
526
483
|
export const MANIFEST_PATH = '.basalt/manifest.json'
|
|
527
484
|
/** The host file the managed block is spliced into (and its manifest key). */
|
|
528
485
|
export const AGENTS_MD = 'AGENTS.md'
|
|
529
|
-
/**
|
|
486
|
+
/** A `CLAUDE.md` shadows {@link AGENTS_MD} unless it imports it — `doctor` warns on one. */
|
|
530
487
|
export const LEGACY_BLOCK_HOST = 'CLAUDE.md'
|
|
531
488
|
|
|
532
489
|
export function sha256(text: string): string {
|
|
@@ -534,8 +491,11 @@ export function sha256(text: string): string {
|
|
|
534
491
|
}
|
|
535
492
|
|
|
536
493
|
export function readIfExists(abs: string): string | null {
|
|
537
|
-
|
|
538
|
-
|
|
494
|
+
try {
|
|
495
|
+
return readFileSync(abs, 'utf8')
|
|
496
|
+
} catch {
|
|
497
|
+
return null // absent, a directory, unreadable or raced away: callers treat all four as "not there"
|
|
498
|
+
}
|
|
539
499
|
}
|
|
540
500
|
|
|
541
501
|
/** Read a shipped source asset from the package root; null if the sibling hasn't authored it yet. */
|
|
@@ -566,14 +526,9 @@ export function readFrameworkVersion(pkgRoot: string): string {
|
|
|
566
526
|
}
|
|
567
527
|
|
|
568
528
|
/**
|
|
569
|
-
* How a seeded script,
|
|
570
|
-
*
|
|
571
|
-
*
|
|
572
|
-
* fallback. `bunx` does not re-resolve a package it has cached, so a seeded `bunx basalt-ui` lets a
|
|
573
|
-
* consumer pin one version and be gated by another — which is exactly what happened across three
|
|
574
|
-
* consumer repos, in CI, in package.json scripts and in a `.claude` PreToolUse hook, all of them
|
|
575
|
-
* placed here. Every emitted invocation goes through this function so there is one place for it to
|
|
576
|
-
* be right.
|
|
529
|
+
* How a seeded script, CI step or piece of doctor advice invokes the CLI: the LOCAL bin wherever
|
|
530
|
+
* basalt resolved, `bunx basalt-ui` only as the pre-install fallback (`bunx` does not re-resolve a
|
|
531
|
+
* cached package, so it lets a consumer pin one version and be gated by another).
|
|
577
532
|
*/
|
|
578
533
|
export function basaltBinCommand(install: BasaltInstall, cwd: string): string {
|
|
579
534
|
if (install.dir === null) return 'bunx basalt-ui'
|
|
@@ -655,8 +610,7 @@ export function hasManagedBlock(host: string | null): boolean {
|
|
|
655
610
|
|
|
656
611
|
/**
|
|
657
612
|
* The block region of a host, or why it cannot be read: duplicate begin markers, or a begin marker
|
|
658
|
-
* with no end.
|
|
659
|
-
* about whether a `CLAUDE.md` is well-formed.
|
|
613
|
+
* with no end. Read by `doctor` to say whether a leftover `CLAUDE.md` is well-formed.
|
|
660
614
|
*/
|
|
661
615
|
export function scanBlock(host: string): {
|
|
662
616
|
region: { start: number; end: number } | null
|
|
@@ -690,117 +644,15 @@ export function importsAgentsMd(text: string): boolean {
|
|
|
690
644
|
return text.split(/\r?\n/).some(isAgentsImportLine)
|
|
691
645
|
}
|
|
692
646
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
pending: boolean
|
|
696
|
-
/** The legacy host was left empty (or `@AGENTS.md` only) and removed. */
|
|
697
|
-
deletedHost: boolean
|
|
698
|
-
/** Why nothing was moved and the run must fail: malformed markers, or two differing blocks. */
|
|
699
|
-
problem: string | null
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
/**
|
|
703
|
-
* Move the managed block out of `CLAUDE.md` into `AGENTS.md` (an install from before the move).
|
|
704
|
-
* Idempotent: a second run finds nothing and returns `pending: false`.
|
|
705
|
-
* 1. The ledger entry is re-keyed `CLAUDE.md` → `AGENTS.md` in memory (the caller persists it), so
|
|
706
|
-
* an unedited legacy block classifies `unchanged`, not untracked.
|
|
707
|
-
* 2. The region is cut out of `CLAUDE.md` and — unless `AGENTS.md` already has one — spliced into
|
|
708
|
-
* `AGENTS.md` AS IT IS, not as the new rendering: the normal three-way classify then sees a
|
|
709
|
-
* hand-edit and skips it like any drifted unit. The rest of `CLAUDE.md` is consumer-owned and
|
|
710
|
-
* stays, except the file is deleted when nothing but whitespace or `@AGENTS.md` is left.
|
|
711
|
-
* 3. Nothing is discarded silently: if `AGENTS.md` already has a block that differs (normalized,
|
|
712
|
-
* as the ledger compares) from the legacy one, or either file's markers are malformed, BOTH
|
|
713
|
-
* files are left byte-identical and `problem` says what to resolve by hand.
|
|
714
|
-
* `dryRun` (`sync --check`) writes nothing but still reports `pending` and `problem`.
|
|
715
|
-
*/
|
|
716
|
-
export function migrateBlockToAgentsMd(
|
|
717
|
-
cwd: string,
|
|
718
|
-
manifest: Manifest,
|
|
719
|
-
opts: { dryRun?: boolean } = {},
|
|
720
|
-
): BlockMigration {
|
|
721
|
-
const legacyHash = manifest.files[LEGACY_BLOCK_HOST]
|
|
722
|
-
if (legacyHash !== undefined) {
|
|
723
|
-
manifest.files[AGENTS_MD] ??= legacyHash
|
|
724
|
-
delete manifest.files[LEGACY_BLOCK_HOST]
|
|
725
|
-
}
|
|
726
|
-
const none: BlockMigration = { pending: false, deletedHost: false, problem: null }
|
|
727
|
-
const legacyAbs = resolve(cwd, LEGACY_BLOCK_HOST)
|
|
728
|
-
const agentsAbs = resolve(cwd, AGENTS_MD)
|
|
729
|
-
const legacy = readIfExists(legacyAbs)
|
|
730
|
-
if (legacy === null) return none
|
|
731
|
-
// A symlinked pair is one file: cutting the block out of "CLAUDE.md" would cut AGENTS.md too.
|
|
732
|
-
// Fail closed when that cannot be proven (EACCES, ELOOP, …) — and say so, not a stack trace.
|
|
733
|
-
try {
|
|
734
|
-
if (sameFile(legacyAbs, agentsAbs)) return none
|
|
735
|
-
} catch (error) {
|
|
736
|
-
const why = (error as NodeJS.ErrnoException).code ?? (error as Error).message
|
|
737
|
-
return { ...none, problem: `cannot tell whether ${LEGACY_BLOCK_HOST} is ${AGENTS_MD} (${why})` }
|
|
738
|
-
}
|
|
739
|
-
const legacyScan = scanBlock(legacy)
|
|
740
|
-
const { region } = legacyScan
|
|
741
|
-
if (legacyScan.problem !== null) {
|
|
742
|
-
return { ...none, problem: `${LEGACY_BLOCK_HOST}: ${legacyScan.problem}` }
|
|
743
|
-
}
|
|
744
|
-
if (region === null) return none
|
|
745
|
-
|
|
746
|
-
const agents = readIfExists(agentsAbs) ?? ''
|
|
747
|
-
const agentsScan = scanBlock(agents)
|
|
748
|
-
if (agentsScan.problem !== null)
|
|
749
|
-
return { ...none, problem: `${AGENTS_MD}: ${agentsScan.problem}` }
|
|
750
|
-
const legacyBlock = legacy.slice(region.start, region.end)
|
|
751
|
-
if (
|
|
752
|
-
agentsScan.region !== null &&
|
|
753
|
-
normalizeForLedger(agents.slice(agentsScan.region.start, agentsScan.region.end)) !==
|
|
754
|
-
normalizeForLedger(legacyBlock)
|
|
755
|
-
) {
|
|
756
|
-
return {
|
|
757
|
-
...none,
|
|
758
|
-
problem:
|
|
759
|
-
`${LEGACY_BLOCK_HOST} and ${AGENTS_MD} each carry a basalt block and they differ — ` +
|
|
760
|
-
`delete the stale block from ${LEGACY_BLOCK_HOST} (or the one in ${AGENTS_MD}, if ` +
|
|
761
|
-
`${LEGACY_BLOCK_HOST}'s is the one you want kept), then re-run.`,
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
const before = legacy.slice(0, region.start).trimEnd()
|
|
766
|
-
const after = legacy.slice(region.end).trimStart()
|
|
767
|
-
const remainder = before === '' || after === '' ? `${before}${after}` : `${before}\n\n${after}`
|
|
768
|
-
const deletedHost = remainder
|
|
769
|
-
.split(/\r?\n/)
|
|
770
|
-
.every((l) => l.trim() === '' || isAgentsImportLine(l))
|
|
771
|
-
if (opts.dryRun === true) return { pending: true, deletedHost, problem: null }
|
|
772
|
-
|
|
773
|
-
if (agentsScan.region === null) writeFileEnsuringDir(agentsAbs, applyBlock(agents, legacyBlock))
|
|
774
|
-
if (deletedHost) unlinkSync(legacyAbs)
|
|
775
|
-
else writeFileSync(legacyAbs, `${remainder.trimEnd()}\n`)
|
|
776
|
-
return { pending: true, deletedHost, problem: null }
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
/**
|
|
780
|
-
* The refusal `init` and `sync` run BEFORE any side effect (roots patch, package.json script,
|
|
781
|
-
* manifest): a dry-run migration against a scratch manifest, so a block that cannot be moved
|
|
782
|
-
* safely stops the command with nothing written. Null = safe to proceed.
|
|
783
|
-
*/
|
|
784
|
-
export function blockMigrationProblem(cwd: string): string | null {
|
|
785
|
-
const { problem } = migrateBlockToAgentsMd(cwd, { version: 1, files: {} }, { dryRun: true })
|
|
786
|
-
return problem === null
|
|
787
|
-
? null
|
|
788
|
-
: `${problem.replace(/\.$/, '')}. Nothing else was reconciled — resolve this by hand, then re-run.`
|
|
789
|
-
}
|
|
647
|
+
/** Scaffold options. `noMergeLint`: `--no-merge-lint` leaves an existing `.oxlintrc.json` untouched. */
|
|
648
|
+
export type ScaffoldFlags = { noMergeLint?: boolean }
|
|
790
649
|
|
|
791
|
-
/**
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
withQuery?: boolean
|
|
798
|
-
/** `--merge-lint`: splice the shipped preset's `extends` into an `.oxlintrc.json` init would keep. */
|
|
799
|
-
mergeLint?: boolean
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
/** Router/query peer presence, resolved from detection + explicit flags. */
|
|
803
|
-
export type PeerFlags = { hasRouter: boolean; hasQuery: boolean }
|
|
650
|
+
/** The router seeds (TanStack Router and Query are required peers of `.`, so they are always written). */
|
|
651
|
+
export const ROUTER_SEED_DESTS = {
|
|
652
|
+
nav: 'src/lib/nav.tsx',
|
|
653
|
+
root: 'src/routes/__root.tsx',
|
|
654
|
+
main: 'src/main.tsx',
|
|
655
|
+
} as const
|
|
804
656
|
|
|
805
657
|
/** True when `pkgName` appears in the consumer's dependencies, devDependencies, or peerDependencies. */
|
|
806
658
|
function hasDependency(cwd: string, pkgName: string): boolean {
|
|
@@ -820,19 +672,6 @@ function hasDependency(cwd: string, pkgName: string): boolean {
|
|
|
820
672
|
}
|
|
821
673
|
}
|
|
822
674
|
|
|
823
|
-
/**
|
|
824
|
-
* Resolves whether the consumer has the optional TanStack router/query peers — auto-detected from
|
|
825
|
-
* package.json, or forced via `--with-router` / `--with-query`. Both `basalt-ui init` (for gating
|
|
826
|
-
* which seed scaffolds to write) and `basalt-ui sync` (so it doesn't silently re-seed a scaffold whose
|
|
827
|
-
* peer was never installed) call this once, up front.
|
|
828
|
-
*/
|
|
829
|
-
export function resolvePeerFlags(cwd: string, flags: ScaffoldFlags): PeerFlags {
|
|
830
|
-
return {
|
|
831
|
-
hasRouter: flags.withRouter === true || hasDependency(cwd, '@tanstack/react-router'),
|
|
832
|
-
hasQuery: flags.withQuery === true || hasDependency(cwd, '@tanstack/react-query'),
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
|
|
836
675
|
/**
|
|
837
676
|
* Where the seed engine is running relative to the consumer's git repo — decides which
|
|
838
677
|
* repo-root-shaped seeds are safe to write. `init`/`sync` compute it once per run via
|
|
@@ -848,18 +687,12 @@ export type PlacementFlags = {
|
|
|
848
687
|
/** Absolute path of the detected repo root. Meaningful only when `isPackageRepoRoot` is false —
|
|
849
688
|
* otherwise it equals the package dir and is never read. */
|
|
850
689
|
repoRoot: string
|
|
851
|
-
/** Absolute path of a `query-client.ts` already present elsewhere under the package's `src/` (the
|
|
852
|
-
* consumer relocated it — e.g. to `src/lib/query-client.ts`), or null. The seed's OWN
|
|
853
|
-
* destination is deliberately excluded here — that exact-path case is handled by the ordinary
|
|
854
|
-
* skip-if-exists logic every seed file already goes through, unchanged. */
|
|
855
|
-
relocatedQueryClient: string | null
|
|
856
690
|
}
|
|
857
691
|
|
|
858
692
|
/** The default placement — today's single-package-at-repo-root behaviour, unconditionally. */
|
|
859
693
|
export const ROOT_PLACEMENT: PlacementFlags = {
|
|
860
694
|
isPackageRepoRoot: true,
|
|
861
695
|
repoRoot: '',
|
|
862
|
-
relocatedQueryClient: null,
|
|
863
696
|
}
|
|
864
697
|
|
|
865
698
|
/**
|
|
@@ -889,63 +722,17 @@ export function oxlintBinResolves(dir: string): boolean {
|
|
|
889
722
|
}
|
|
890
723
|
}
|
|
891
724
|
|
|
892
|
-
/**
|
|
893
|
-
* First path under `dir` (recursive) whose basename is `filename`, or null. Skips dependency/build
|
|
894
|
-
* dirs, mirroring `walkSourceFiles`'s scoping.
|
|
895
|
-
*/
|
|
896
|
-
function findFileNamed(dir: string, filename: string): string | null {
|
|
897
|
-
let entries: string[]
|
|
898
|
-
try {
|
|
899
|
-
entries = readdirSync(dir)
|
|
900
|
-
} catch {
|
|
901
|
-
return null
|
|
902
|
-
}
|
|
903
|
-
for (const name of entries) {
|
|
904
|
-
if (name === 'node_modules' || name === '.git' || name === 'dist') continue
|
|
905
|
-
const abs = resolve(dir, name)
|
|
906
|
-
let isDir: boolean
|
|
907
|
-
try {
|
|
908
|
-
isDir = statSync(abs).isDirectory()
|
|
909
|
-
} catch {
|
|
910
|
-
continue
|
|
911
|
-
}
|
|
912
|
-
if (isDir) {
|
|
913
|
-
const found = findFileNamed(abs, filename)
|
|
914
|
-
if (found !== null) return found
|
|
915
|
-
} else if (name === filename) {
|
|
916
|
-
return abs
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
return null
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
/**
|
|
923
|
-
* Absolute path of a `query-client.ts` living elsewhere under the package's `src/`, or null. The
|
|
924
|
-
* seed's own destination is excluded — reseeding on top of a RELOCATED client (the failure this
|
|
925
|
-
* exists to prevent) is a different case from the seed's own path already being occupied, which the
|
|
926
|
-
* ordinary skip-if-exists logic handles unchanged.
|
|
927
|
-
*/
|
|
928
|
-
function findRelocatedQueryClient(cwd: string): string | null {
|
|
929
|
-
const seedAbs = resolve(cwd, 'src/query-client.ts')
|
|
930
|
-
const found = findFileNamed(resolve(cwd, 'src'), 'query-client.ts')
|
|
931
|
-
return found !== null && found !== seedAbs ? found : null
|
|
932
|
-
}
|
|
933
|
-
|
|
934
725
|
/** Resolve a run's placement flags once, from the consumer cwd. */
|
|
935
726
|
export function resolvePlacement(cwd: string): PlacementFlags {
|
|
936
727
|
const repoRoot = findRepoRoot(cwd)
|
|
937
728
|
return {
|
|
938
729
|
isPackageRepoRoot: repoRoot === cwd,
|
|
939
730
|
repoRoot,
|
|
940
|
-
relocatedQueryClient: findRelocatedQueryClient(cwd),
|
|
941
731
|
}
|
|
942
732
|
}
|
|
943
733
|
|
|
944
734
|
/** The full managed-file manifest. Stable, declarative — the single source of truth for init/sync. */
|
|
945
|
-
export function managedFiles(
|
|
946
|
-
peers: PeerFlags,
|
|
947
|
-
placement: PlacementFlags = ROOT_PLACEMENT,
|
|
948
|
-
): ManagedFile[] {
|
|
735
|
+
export function managedFiles(placement: PlacementFlags = ROOT_PLACEMENT): ManagedFile[] {
|
|
949
736
|
// ── managed: exactly what Claude reads ──────────────────────────────────────
|
|
950
737
|
const rules: ManagedFile[] = RULE_NAMES.map((name) => ({
|
|
951
738
|
dest: `.claude/rules/basalt-${name}.md`,
|
|
@@ -1065,21 +852,9 @@ export function managedFiles(
|
|
|
1065
852
|
// ── Seed scaffolds: written by init, never overwritten by sync ─────────────
|
|
1066
853
|
// These are starting-point files owned entirely by the consumer after first write.
|
|
1067
854
|
|
|
1068
|
-
/** TanStack Query client bootstrap (seed — consumer-owned after init). */
|
|
1069
|
-
const queryClient: ManagedFile = {
|
|
1070
|
-
dest: 'src/query-client.ts',
|
|
1071
|
-
mode: 'seed',
|
|
1072
|
-
source: 'agent/templates/query-client.ts.tpl',
|
|
1073
|
-
render: (ctx) => {
|
|
1074
|
-
const tpl = readSource(ctx.pkgRoot, 'agent/templates/query-client.ts.tpl')
|
|
1075
|
-
if (tpl === null) return null
|
|
1076
|
-
return fillTemplate(tpl, ctx.vars)
|
|
1077
|
-
},
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
855
|
/** TanStack Router root route with QueryClient context wiring (seed — consumer-owned after init). */
|
|
1081
856
|
const rootRoute: ManagedFile = {
|
|
1082
|
-
dest:
|
|
857
|
+
dest: ROUTER_SEED_DESTS.root,
|
|
1083
858
|
mode: 'seed',
|
|
1084
859
|
source: 'agent/templates/__root.tpl',
|
|
1085
860
|
render: (ctx) => {
|
|
@@ -1089,13 +864,22 @@ export function managedFiles(
|
|
|
1089
864
|
},
|
|
1090
865
|
}
|
|
1091
866
|
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
867
|
+
/** The leaf `NAV` module `__root.tsx` imports (seed — consumer-owned after init). */
|
|
868
|
+
const navModule: ManagedFile = {
|
|
869
|
+
dest: ROUTER_SEED_DESTS.nav,
|
|
870
|
+
mode: 'seed',
|
|
871
|
+
source: 'agent/templates/nav.tpl',
|
|
872
|
+
render: (ctx) => readSource(ctx.pkgRoot, 'agent/templates/nav.tpl'),
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/** The 2.0 entry: mounts the router and declares the `Register` augmentation `defineNav` needs. */
|
|
876
|
+
const mainEntry: ManagedFile = {
|
|
877
|
+
dest: ROUTER_SEED_DESTS.main,
|
|
878
|
+
mode: 'seed',
|
|
879
|
+
source: 'agent/templates/main.tpl',
|
|
880
|
+
render: (ctx) => readSource(ctx.pkgRoot, 'agent/templates/main.tpl'),
|
|
881
|
+
}
|
|
882
|
+
const scaffolds: ManagedFile[] = [navModule, rootRoute, mainEntry]
|
|
1099
883
|
|
|
1100
884
|
// lefthook.yml / .github/workflows/check.yml are repo-root-shaped: lefthook and GitHub Actions
|
|
1101
885
|
// only ever read config at the repo root, so a package living in a subdirectory (a monorepo's
|
|
@@ -1134,13 +918,6 @@ export function placementNotices(cwd: string, placement: PlacementFlags): string
|
|
|
1134
918
|
'performs for lefthook, and needed for the same reason.',
|
|
1135
919
|
)
|
|
1136
920
|
}
|
|
1137
|
-
if (placement.relocatedQueryClient !== null) {
|
|
1138
|
-
out.push(
|
|
1139
|
-
`skipped src/query-client.ts (found an existing query client at ` +
|
|
1140
|
-
`${relative(cwd, placement.relocatedQueryClient)}) — import it from there instead of ` +
|
|
1141
|
-
're-seeding at the original path.',
|
|
1142
|
-
)
|
|
1143
|
-
}
|
|
1144
921
|
return out
|
|
1145
922
|
}
|
|
1146
923
|
|
|
@@ -1151,16 +928,9 @@ export type Manifest = {
|
|
|
1151
928
|
/** dest path → sha256 of the managed unit (file bytes, block body, or stanza) at last write. */
|
|
1152
929
|
files: Record<string, string>
|
|
1153
930
|
/**
|
|
1154
|
-
* The resolved level-0 spacing scale (`xs`..`xl`, px) at last write
|
|
1155
|
-
*
|
|
1156
|
-
*
|
|
1157
|
-
*
|
|
1158
|
-
* A retune of the spacing bases moves every surface in every consumer calling
|
|
1159
|
-
* `createBasaltTheme()` bare. basalt-ui bans majors by design, so the changelog is the only
|
|
1160
|
-
* channel that carries that, and a one-line `feat:` subject cannot convey blast radius: the
|
|
1161
|
-
* 1.2.0 retune shipped as "tighten the sidebar, open up components" and went unverified in
|
|
1162
|
-
* production for a day because nothing said "every padding moved". Recording the scale makes the
|
|
1163
|
-
* move mechanically visible on the next `doctor` run instead of depending on a subject line.
|
|
931
|
+
* The resolved level-0 spacing scale (`xs`..`xl`, px) at last write: `doctor`'s second axis, and
|
|
932
|
+
* the only one that reports a change in RENDERED OUTPUT. A retune of the spacing bases moves every
|
|
933
|
+
* surface in every consumer, which a one-line `feat:` subject cannot convey.
|
|
1164
934
|
*/
|
|
1165
935
|
spacingScale?: Record<string, number>
|
|
1166
936
|
}
|
|
@@ -1199,8 +969,7 @@ export function readManifest(cwd: string): Manifest {
|
|
|
1199
969
|
*
|
|
1200
970
|
* Scoped to these two patterns on purpose, and never applied to the manifest wholesale: several
|
|
1201
971
|
* managed/seed entries are legitimately absent from `managedFiles()` for a run (`lefthook.yml` and
|
|
1202
|
-
* `check.yml` when the package is not the repo root
|
|
1203
|
-
* the scaffolds without their peers). Deleting a dest just because this run did not place it would
|
|
972
|
+
* `check.yml` when the package is not the repo root). Deleting a dest just because this run did not place it would
|
|
1204
973
|
* remove a consumer's CI workflow on a monorepo.
|
|
1205
974
|
*/
|
|
1206
975
|
const RETIREABLE_DEST_PATTERNS: readonly RegExp[] = [
|
|
@@ -1243,31 +1012,11 @@ export function reportPrune(pruned: PruneResult): void {
|
|
|
1243
1012
|
)
|
|
1244
1013
|
}
|
|
1245
1014
|
|
|
1246
|
-
/** Name what {@link migrateBlockToAgentsMd} did — a file leaving a consumer's tree is never silent. */
|
|
1247
|
-
export function reportBlockMigration(migration: BlockMigration, command: 'init' | 'sync'): void {
|
|
1248
|
-
if (!migration.pending) return
|
|
1249
|
-
const tail = migration.deletedHost
|
|
1250
|
-
? `${LEGACY_BLOCK_HOST} held nothing else and was deleted.`
|
|
1251
|
-
: `the rest of ${LEGACY_BLOCK_HOST} is yours; while it exists Claude Code loads it INSTEAD of ` +
|
|
1252
|
-
`${AGENTS_MD} unless it imports @${AGENTS_MD} — move your content over and delete it.`
|
|
1253
|
-
console.log(
|
|
1254
|
-
`\nbasalt-ui ${command}: moved the basalt block from ${LEGACY_BLOCK_HOST} to ${AGENTS_MD} — ${tail}`,
|
|
1255
|
-
)
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
1015
|
/**
|
|
1259
1016
|
* Delete the managed rule/skill files this basalt version retired, and drop their manifest entries.
|
|
1260
|
-
*
|
|
1261
|
-
*
|
|
1262
|
-
*
|
|
1263
|
-
* agent would go on reading `basalt-router.md`'s superseded placement doctrine forever, with
|
|
1264
|
-
* `sync --check` reporting green because nothing in the ledger asks about a dest the run no longer
|
|
1265
|
-
* places.
|
|
1266
|
-
*
|
|
1267
|
-
* Same three-way discipline as every other managed unit, so a consumer edit is never discarded
|
|
1268
|
-
* silently: an untouched file (matching its recorded hash, raw or normalized) is deleted and its
|
|
1269
|
-
* entry dropped; a locally-edited one is LEFT in place, reported, and keeps its entry so
|
|
1270
|
-
* `sync --check` stays red and `--force` can still finish the job. `dryRun` is `--check`.
|
|
1017
|
+
* Same three-way discipline as every managed unit: an untouched file is deleted; a locally-edited
|
|
1018
|
+
* one is LEFT in place, reported, and keeps its entry so `sync --check` stays red and `--force` can
|
|
1019
|
+
* finish. `dryRun` is `--check`.
|
|
1271
1020
|
*/
|
|
1272
1021
|
export function pruneRetiredManagedFiles(
|
|
1273
1022
|
cwd: string,
|
|
@@ -1356,25 +1105,9 @@ export function unitState(file: ManagedFile, cwd: string, ctx: RenderContext): U
|
|
|
1356
1105
|
type Classification = 'unchanged' | 'drifted' | 'missing' | 'current'
|
|
1357
1106
|
|
|
1358
1107
|
/**
|
|
1359
|
-
* Normalize a managed unit's rendered bytes for the ledger comparison
|
|
1360
|
-
*
|
|
1361
|
-
*
|
|
1362
|
-
*
|
|
1363
|
-
* - Blank out the per-release `BASALT_VERSION` token in a marker's begin line
|
|
1364
|
-
* (`<!-- basalt:begin 1.0.1 -->` → `<!-- basalt:begin -->`). It changes on every release and is
|
|
1365
|
-
* the only per-release variable that lands INSIDE the hashed region (the rest of
|
|
1366
|
-
* `AGENTS-block.md.tpl` has no other `{{…}}` placeholders today), so stripping it is what lets
|
|
1367
|
-
* one normalized rendering stand in for every version of a given template body instead of
|
|
1368
|
-
* needing one ledger entry per release. If a future marker template interpolates another
|
|
1369
|
-
* per-release var inside its region, extend this normalization the same way.
|
|
1370
|
-
* - Trim trailing whitespace per line and collapse every run of blank lines to none. This is the
|
|
1371
|
-
* fix for the actual argo repro: lefthook's oxfmt reformats a spliced block (or a whole managed
|
|
1372
|
-
* file) AFTER `writeUnit` has already exited and the manifest hash was recorded, so the manifest
|
|
1373
|
-
* can never account for the reformat up front — normalizing it away here is the only place that
|
|
1374
|
-
* can.
|
|
1375
|
-
*
|
|
1376
|
-
* Deliberately whitespace-only — word content is untouched, so a genuine hand-edit inside the block
|
|
1377
|
-
* still changes the normalized text and still classifies `drifted`.
|
|
1108
|
+
* Normalize a managed unit's rendered bytes for the ledger comparison: blank the per-release version
|
|
1109
|
+
* in a marker's begin line, trim trailing whitespace per line and collapse blank-line runs. A
|
|
1110
|
+
* formatter run or a version bump is invisible to drift detection; a real content edit is not.
|
|
1378
1111
|
*/
|
|
1379
1112
|
export function normalizeForLedger(text: string): string {
|
|
1380
1113
|
return text
|
|
@@ -1404,21 +1137,12 @@ export function writeUnit(file: ManagedFile, cwd: string, desired: string): stri
|
|
|
1404
1137
|
}
|
|
1405
1138
|
|
|
1406
1139
|
/**
|
|
1407
|
-
* Classify a managed file against the manifest for a sync run
|
|
1408
|
-
* - missing :
|
|
1140
|
+
* Classify a managed file against the manifest for a sync run:
|
|
1141
|
+
* - missing : absent on disk → recreate.
|
|
1409
1142
|
* - current : on disk == desired → nothing to do.
|
|
1410
|
-
* - unchanged: on disk matches a KNOWN-SHIPPED rendering
|
|
1411
|
-
*
|
|
1412
|
-
*
|
|
1413
|
-
* the ledger normalized hold the RAW hash; keep matching so an upgrade never
|
|
1414
|
-
* mass-classifies a pristine tree as drifted).
|
|
1415
|
-
* 2. `sha256(normalizeForLedger(current)) === manifestHash` — the ledger proper (see
|
|
1416
|
-
* `writeUnit`): survives a downstream formatter AND a version bump that changed the
|
|
1417
|
-
* template's own words since the manifest entry was written (the argo false positive).
|
|
1418
|
-
* 3. `normalizeForLedger(current) === normalizeForLedger(desired)` — same-version
|
|
1419
|
-
* fallback when no manifest entry exists at all.
|
|
1420
|
-
* - drifted : on disk matches NONE of the above (a real, word-level local edit) → skip unless
|
|
1421
|
-
* --force.
|
|
1143
|
+
* - unchanged: on disk matches a KNOWN-SHIPPED rendering (raw manifest hash, normalized manifest
|
|
1144
|
+
* hash, or normalized == normalized desired when no entry exists) → safe overwrite.
|
|
1145
|
+
* - drifted : matches none of them (a real local edit) → skip unless --force.
|
|
1422
1146
|
*/
|
|
1423
1147
|
export function classify(state: UnitState, manifestHash: string | undefined): Classification {
|
|
1424
1148
|
if (state.current === null) return 'missing'
|
|
@@ -1517,19 +1241,9 @@ function rootCovers(root: string, detected: string): boolean {
|
|
|
1517
1241
|
}
|
|
1518
1242
|
|
|
1519
1243
|
/**
|
|
1520
|
-
* Read — and when absent and `write` is set, seed — `basalt.roots`.
|
|
1521
|
-
*
|
|
1522
|
-
*
|
|
1523
|
-
* built-in `src` default happens to resolve from a package cwd, so `guard-scan` passes, `check-theme`
|
|
1524
|
-
* scans something, and the repo is silently guarding a subset of itself. `init` wrote it and `sync`
|
|
1525
|
-
* did not — which meant the fix reached new scaffolds only, while every existing consumer (the ones
|
|
1526
|
-
* who by definition upgrade rather than scaffold) stayed on the undeclared default.
|
|
1527
|
-
*
|
|
1528
|
-
* A DECLARED value is never overwritten, not even when the layout disagrees with it. `roots` is a
|
|
1529
|
-
* subset by construction in a monorepo — a React-free package deliberately left out is the normal
|
|
1530
|
-
* case, not drift — so a disagreement is reported as one line naming what is not covered, and the
|
|
1531
|
-
* consumer decides. Silently widening someone's deliberate scope would turn an upgrade into an
|
|
1532
|
-
* unplanned lint debt.
|
|
1244
|
+
* Read — and when absent and `write` is set, seed — `basalt.roots`. Shared by `init` and `sync`: a
|
|
1245
|
+
* missing key silently guards a subset of the repo. A DECLARED value is never overwritten (a subset
|
|
1246
|
+
* is normal in a monorepo); a disagreement is reported as one line and the consumer decides.
|
|
1533
1247
|
*/
|
|
1534
1248
|
export function reconcileRoots(cwd: string, opts: { write: boolean }): RootsState {
|
|
1535
1249
|
const declared = readBasaltConfig(cwd).roots
|
|
@@ -1592,13 +1306,8 @@ export function rootsNotices(state: RootsState): { log: string[]; error: string[
|
|
|
1592
1306
|
}
|
|
1593
1307
|
|
|
1594
1308
|
/**
|
|
1595
|
-
* Strip JSONC comments
|
|
1596
|
-
*
|
|
1597
|
-
* perfectly good config. String-aware, so a `//` inside a value survives.
|
|
1598
|
-
*
|
|
1599
|
-
* Only ever used for reading. The trailing-comma pass is a plain regex and could in principle mangle
|
|
1600
|
-
* a `, }` sequence inside a string; the failure direction is a parse error, which the caller already
|
|
1601
|
-
* treats as "cannot tell", never as "passes".
|
|
1309
|
+
* Strip JSONC comments and trailing commas so oxlint/tsconfig files can be READ (string-aware). A
|
|
1310
|
+
* mangled string fails as a parse error, which callers treat as "cannot tell", never as a pass.
|
|
1602
1311
|
*/
|
|
1603
1312
|
function stripJsonc(text: string): string {
|
|
1604
1313
|
let out = ''
|
|
@@ -1629,7 +1338,7 @@ function stripJsonc(text: string): string {
|
|
|
1629
1338
|
/** Parse a JSONC document, or null when it does not parse at all. */
|
|
1630
1339
|
export function parseJsonc(text: string): Record<string, unknown> | null {
|
|
1631
1340
|
try {
|
|
1632
|
-
return JSON.parse(stripJsonc(text)) as Record<string, unknown>
|
|
1341
|
+
return JSON.parse(stripJsonc(text.replace(/^\uFEFF/, ''))) as Record<string, unknown>
|
|
1633
1342
|
} catch {
|
|
1634
1343
|
return null
|
|
1635
1344
|
}
|
|
@@ -1726,11 +1435,13 @@ export function inspectLefthookGate(repoRoot: string): LefthookGate {
|
|
|
1726
1435
|
return wired ? { kind: 'wired', file } : { kind: 'absent', file }
|
|
1727
1436
|
}
|
|
1728
1437
|
|
|
1438
|
+
const ONLY_EXPORT_COMPONENTS = 'react/only-export-components'
|
|
1439
|
+
|
|
1729
1440
|
/**
|
|
1730
|
-
* Splice the shipped preset into an EXISTING `.oxlintrc.json` (`init
|
|
1731
|
-
*
|
|
1732
|
-
*
|
|
1733
|
-
*
|
|
1441
|
+
* Splice the shipped preset into an EXISTING `.oxlintrc.json` (`init` does this unless
|
|
1442
|
+
* `--no-merge-lint`; the lint-debt notice says what it switches on). Prepends the preset so the
|
|
1443
|
+
* consumer's own `extends` entries still win. Only `extends` is rewritten; the config's own `plugins`
|
|
1444
|
+
* are untouched, and oxlint (1.87, checked with `--print-config`) unions them with the preset's.
|
|
1734
1445
|
*/
|
|
1735
1446
|
export function mergeOxlintExtends(cwd: string, presetPath: string): MergeLintResult {
|
|
1736
1447
|
const abs = resolve(cwd, '.oxlintrc.json')
|
|
@@ -1752,6 +1463,16 @@ export function mergeOxlintExtends(cwd: string, presetPath: string): MergeLintRe
|
|
|
1752
1463
|
for (const [key, value] of Object.entries(cfg)) {
|
|
1753
1464
|
merged[key] = key === 'extends' ? [presetPath, ...existing] : value
|
|
1754
1465
|
}
|
|
1466
|
+
// A consumer-set only-export-components (create-vite) replaces the preset's options: re-add `Route`.
|
|
1467
|
+
const rules = merged['rules'] as Record<string, unknown> | undefined
|
|
1468
|
+
if (rules !== undefined && ONLY_EXPORT_COMPONENTS in rules) {
|
|
1469
|
+
const [level, options] = [rules[ONLY_EXPORT_COMPONENTS]].flat()
|
|
1470
|
+
const opts = (typeof options === 'object' && options !== null ? options : {}) as {
|
|
1471
|
+
allowExportNames?: string[]
|
|
1472
|
+
}
|
|
1473
|
+
const allowExportNames = [...new Set([...(opts.allowExportNames ?? []), 'Route'])]
|
|
1474
|
+
rules[ONLY_EXPORT_COMPONENTS] = [level, { ...opts, allowExportNames }]
|
|
1475
|
+
}
|
|
1755
1476
|
const indent = /\n([ \t]+)"/.exec(raw)?.[1] ?? ' '
|
|
1756
1477
|
writeFileSync(abs, JSON.stringify(merged, null, indent) + (raw.endsWith('\n') ? '\n' : ''))
|
|
1757
1478
|
return 'added'
|
|
@@ -1941,10 +1662,7 @@ export function run(argv: string[], cwd: string = process.cwd()): number | Promi
|
|
|
1941
1662
|
console.log(USAGE)
|
|
1942
1663
|
return 0
|
|
1943
1664
|
}
|
|
1944
|
-
// Before dispatch,
|
|
1945
|
-
// must never run a command to do it. `bunx` does not re-resolve a cached package, so a consumer
|
|
1946
|
-
// can pin 1.23.0, invoke `bunx basalt-ui`, and be gated by a months-old copy — the version is the
|
|
1947
|
-
// only thing that catches it, and it has to be one bare line an agent can compare.
|
|
1665
|
+
// Before dispatch, like --help: it answers "which basalt-ui is running" as one bare line.
|
|
1948
1666
|
if (cmd === '--version' || cmd === '-v' || cmd === 'version') {
|
|
1949
1667
|
console.log(readFrameworkVersion(packageRoot()))
|
|
1950
1668
|
return 0
|
|
@@ -1963,9 +1681,7 @@ export function run(argv: string[], cwd: string = process.cwd()): number | Promi
|
|
|
1963
1681
|
switch (cmd) {
|
|
1964
1682
|
case 'init':
|
|
1965
1683
|
return init(cwd, {
|
|
1966
|
-
|
|
1967
|
-
withQuery: flags.includes('--with-query'),
|
|
1968
|
-
mergeLint: flags.includes('--merge-lint'),
|
|
1684
|
+
noMergeLint: flags.includes('--no-merge-lint'),
|
|
1969
1685
|
})
|
|
1970
1686
|
case 'sync':
|
|
1971
1687
|
return sync(
|