zz-meridian 0.35.0 → 0.36.0
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 +3 -3
- package/dist/adopt.js +32 -16
- package/dist/cli.js +18 -31
- package/dist/command-flags.js +32 -0
- package/dist/context.js +2 -2
- package/dist/create.js +11 -5
- package/dist/files.js +14 -5
- package/dist/migrations.js +223 -34
- package/dist/ownership.js +8 -7
- package/dist/rebrand.js +6 -6
- package/dist/reconcile.js +30 -7
- package/dist/session.js +16 -50
- package/dist/update.js +4 -5
- package/package.json +1 -1
- package/payload/.env.example +3 -2
- package/payload/CHANGELOG.md +196 -97
- package/payload/CONTRIBUTING.md +3 -3
- package/payload/LICENSE +21 -0
- package/payload/README.md +1 -1
- package/payload/app/(dashboard)/(home)/README.md +1 -1
- package/payload/app/(dashboard)/(home)/loading.tsx +6 -34
- package/payload/app/(dashboard)/business/README.md +1 -1
- package/payload/app/(dashboard)/business/loading.tsx +6 -32
- package/payload/app/(dashboard)/customers/README.md +1 -1
- package/payload/app/(dashboard)/customers/[id]/README.md +3 -3
- package/payload/app/(dashboard)/engineering/README.md +2 -2
- package/payload/app/(dashboard)/engineering/loading.tsx +6 -23
- package/payload/app/(dashboard)/engineering/page.tsx +1 -1
- package/payload/app/(dashboard)/error.tsx +4 -2
- package/payload/app/(dashboard)/keys/README.md +1 -1
- package/payload/app/(dashboard)/keys/actions.ts +33 -18
- package/payload/app/(dashboard)/members/README.md +2 -2
- package/payload/app/(dashboard)/members/actions.ts +7 -7
- package/payload/app/(dashboard)/members/page.tsx +7 -5
- package/payload/app/(dashboard)/operations-tickets/actions.ts +4 -4
- package/payload/app/(dashboard)/operations-tickets/page.tsx +12 -9
- package/payload/app/(dashboard)/requests/README.md +2 -2
- package/payload/app/(dashboard)/requests/[id]/README.md +3 -3
- package/payload/app/(dashboard)/requests/[id]/actions.ts +5 -3
- package/payload/app/(dashboard)/requests/[id]/page.tsx +4 -3
- package/payload/app/(dashboard)/services/README.md +2 -2
- package/payload/app/(dashboard)/services/loading.tsx +2 -9
- package/payload/app/(dashboard)/settings/README.md +2 -2
- package/payload/app/(dashboard)/settings/actions.ts +3 -3
- package/payload/app/(dashboard)/usage/README.md +2 -2
- package/payload/app/(dashboard)/usage/loading.tsx +2 -9
- package/payload/app/api/assistant/route.ts +34 -13
- package/payload/app/api/export/requests/route.ts +7 -2
- package/payload/app/embed/error.tsx +2 -2
- package/payload/app/embed/proposal/README.md +1 -1
- package/payload/app/embed/proposal/view.tsx +3 -1
- package/payload/app/embed/requests/README.md +1 -1
- package/payload/app/embed/requests/view.tsx +3 -3
- package/payload/app/sign-in/README.md +3 -1
- package/payload/app/sign-in/actions.ts +13 -8
- package/payload/app/sign-in/panel.tsx +7 -5
- package/payload/app/system/(atlas)/page.tsx +6 -6
- package/payload/app/system/states/error/page.tsx +4 -6
- package/payload/app/system/states/error/view.tsx +9 -0
- package/payload/docs/agents.md +14 -8
- package/payload/docs/assistant.md +15 -4
- package/payload/docs/atlas-scenario-coverage.md +4 -4
- package/payload/docs/benchmark.md +1 -1
- package/payload/docs/data-layers.md +14 -5
- package/payload/docs/distribution.md +9 -4
- package/payload/docs/product-workspaces.md +3 -3
- package/payload/docs/skill-evals.md +1 -1
- package/payload/docs/start-a-dashboard.md +3 -2
- package/payload/docs/surfaces.md +3 -2
- package/payload/docs/testing.md +13 -2
- package/payload/docs/voice.md +1 -1
- package/payload/journeys/workspaces.ts +34 -23
- package/payload/next.config.ts +3 -11
- package/payload/package.json +1 -1
- package/payload/proxy.ts +12 -5
- package/payload/scripts/ask.ts +16 -5
- package/payload/scripts/assistant.ts +2 -0
- package/payload/scripts/audit.ts +23 -34
- package/payload/scripts/brand.ts +6 -5
- package/payload/scripts/check.ts +19 -24
- package/payload/scripts/fake-llm.ts +9 -12
- package/payload/scripts/interactions.ts +15 -13
- package/payload/scripts/keyboard.ts +13 -30
- package/payload/scripts/lib/args.ts +17 -0
- package/payload/scripts/lib/bin.ts +29 -0
- package/payload/scripts/lib/chrome.ts +12 -2
- package/payload/scripts/lib/context-check.ts +6 -2
- package/payload/scripts/lib/coverage.ts +1 -1
- package/payload/scripts/lib/data-url.ts +13 -7
- package/payload/scripts/lib/deep.ts +46 -4
- package/payload/scripts/lib/journey.ts +41 -5
- package/payload/scripts/lib/layer-rules.ts +7 -7
- package/payload/scripts/lib/nav-under.ts +25 -8
- package/payload/scripts/lib/routes.ts +12 -8
- package/payload/scripts/lib/sample.ts +9 -4
- package/payload/scripts/lib/sizes.ts +3 -2
- package/payload/scripts/lib/team-config.ts +25 -0
- package/payload/scripts/live.ts +16 -24
- package/payload/scripts/navigate.ts +5 -22
- package/payload/scripts/perf.ts +5 -4
- package/payload/scripts/rail.ts +10 -12
- package/payload/scripts/registry.ts +12 -12
- package/payload/scripts/shot.ts +4 -7
- package/payload/scripts/sizes.ts +3 -3
- package/payload/scripts/verify.baseline.json +29 -29
- package/payload/scripts/verify.config.ts +14 -5
- package/payload/scripts/verify.ts +8 -15
- package/payload/scripts/vitals.ts +4 -1
- package/payload/skills/zz-meridian/SKILL.md +2 -2
- package/payload/skills/zz-meridian/references/agents.md +14 -8
- package/payload/skills/zz-meridian/references/cache.md +15 -9
- package/payload/skills/zz-meridian/references/customize.md +38 -18
- package/payload/skills/zz-meridian/references/data-layers.md +14 -5
- package/payload/skills/zz-meridian/references/existing-project.md +5 -3
- package/payload/skills/zz-meridian/references/live.md +12 -25
- package/payload/skills/zz-meridian/references/ownership.md +4 -3
- package/payload/skills/zz-meridian/references/update.md +9 -3
- package/payload/skills/zz-meridian/references/validation.md +11 -1
- package/payload/skills/zz-meridian/references/voice.md +1 -1
- package/payload/src/components/base/motion/README.md +1 -1
- package/payload/src/components/base/motion/preview.tsx +2 -2
- package/payload/src/components/base/providers.tsx +19 -5
- package/payload/src/components/base/shell/README.md +3 -1
- package/payload/src/components/base/shell/index.tsx +1 -1
- package/payload/src/components/base/shell/preview.tsx +2 -2
- package/payload/src/components/base/text-roles/README.md +1 -1
- package/payload/src/components/base/text-roles/preview.tsx +2 -2
- package/payload/src/components/charts/bar-list/index.tsx +6 -4
- package/payload/src/components/charts/bar-list/preview.tsx +1 -1
- package/payload/src/components/charts/column-chart/README.md +1 -1
- package/payload/src/components/charts/column-chart/grouped.tsx +25 -17
- package/payload/src/components/charts/column-chart/index.tsx +30 -18
- package/payload/src/components/charts/column-chart/shared.tsx +0 -1
- package/payload/src/components/charts/composition-bar/README.md +1 -1
- package/payload/src/components/charts/composition-bar/index.tsx +13 -10
- package/payload/src/components/charts/diverging-bars/index.tsx +2 -1
- package/payload/src/components/charts/heatmap/README.md +1 -1
- package/payload/src/components/charts/heatmap/index.tsx +17 -10
- package/payload/src/components/charts/meridian/README.md +1 -1
- package/payload/src/components/charts/sparkline/README.md +1 -1
- package/payload/src/components/charts/sparkline/index.tsx +12 -2
- package/payload/src/components/charts/sparkline/preview.tsx +7 -18
- package/payload/src/components/charts/trend-chart/README.md +2 -2
- package/payload/src/components/charts/trend-chart/index.tsx +17 -7
- package/payload/src/components/charts/uptime-bars/README.md +5 -2
- package/payload/src/components/charts/uptime-bars/index.tsx +22 -10
- package/payload/src/components/charts/uptime-bars/preview.tsx +22 -3
- package/payload/src/components/patterns/activity-feed/README.md +2 -2
- package/payload/src/components/patterns/activity-feed/preview.tsx +11 -1
- package/payload/src/components/patterns/appearance-menu/README.md +4 -4
- package/payload/src/components/patterns/appearance-menu/preview.tsx +3 -3
- package/payload/src/components/patterns/assistant/README.md +4 -4
- package/payload/src/components/patterns/assistant/index.tsx +41 -18
- package/payload/src/components/patterns/assistant/preview.tsx +5 -1
- package/payload/src/components/patterns/command-palette/README.md +5 -4
- package/payload/src/components/patterns/command-palette/index.tsx +17 -3
- package/payload/src/components/patterns/data-table/README.md +3 -3
- package/payload/src/components/patterns/data-table/index.tsx +9 -6
- package/payload/src/components/patterns/data-table/preview.tsx +8 -2
- package/payload/src/components/patterns/detail-head/README.md +1 -1
- package/payload/src/components/patterns/detail-head/index.tsx +1 -1
- package/payload/src/components/patterns/embed-frame/README.md +1 -1
- package/payload/src/components/patterns/embed-frame/index.tsx +12 -18
- package/payload/src/components/patterns/embed-frame/preview.tsx +8 -2
- package/payload/src/components/patterns/filter-bar/README.md +4 -4
- package/payload/src/components/patterns/filter-bar/index.tsx +6 -3
- package/payload/src/components/patterns/form-section/README.md +1 -1
- package/payload/src/components/patterns/form-section/index.tsx +5 -6
- package/payload/src/components/patterns/form-section/preview.tsx +5 -0
- package/payload/src/components/patterns/metric-tile/index.tsx +2 -2
- package/payload/src/components/patterns/metric-tile/preview.tsx +7 -19
- package/payload/src/components/patterns/page-loading/README.md +1 -1
- package/payload/src/components/patterns/page-loading/index.tsx +40 -0
- package/payload/src/components/patterns/page-loading/preview.tsx +7 -2
- package/payload/src/components/patterns/proposal/README.md +5 -5
- package/payload/src/components/patterns/proposal/index.tsx +5 -4
- package/payload/src/components/patterns/proposal/preview.tsx +4 -1
- package/payload/src/components/patterns/prose/preview.tsx +2 -2
- package/payload/src/components/patterns/rail/README.md +5 -3
- package/payload/src/components/patterns/rail/index.tsx +5 -7
- package/payload/src/components/patterns/rail/trail.ts +18 -4
- package/payload/src/components/patterns/shell-tools/README.md +3 -3
- package/payload/src/components/patterns/shell-tools/index.tsx +20 -5
- package/payload/src/components/patterns/status-list/README.md +1 -1
- package/payload/src/components/patterns/status-list/index.tsx +2 -3
- package/payload/src/components/patterns/status-list/preview.tsx +1 -1
- package/payload/src/components/ui/avatar/README.md +4 -4
- package/payload/src/components/ui/avatar/index.tsx +9 -2
- package/payload/src/components/ui/avatar/preview.tsx +3 -0
- package/payload/src/components/ui/badge/index.tsx +3 -2
- package/payload/src/components/ui/banner/README.md +3 -3
- package/payload/src/components/ui/banner/index.tsx +4 -3
- package/payload/src/components/ui/banner/preview.tsx +5 -3
- package/payload/src/components/ui/breadcrumb/README.md +3 -3
- package/payload/src/components/ui/breadcrumb/index.tsx +9 -3
- package/payload/src/components/ui/breadcrumb/preview.tsx +5 -0
- package/payload/src/components/ui/button/preview.tsx +12 -0
- package/payload/src/components/ui/card/README.md +4 -4
- package/payload/src/components/ui/card/preview.tsx +5 -5
- package/payload/src/components/ui/checkbox/README.md +2 -2
- package/payload/src/components/ui/checkbox/index.tsx +4 -2
- package/payload/src/components/ui/copy-field/README.md +3 -2
- package/payload/src/components/ui/copy-field/index.tsx +31 -12
- package/payload/src/components/ui/copy-field/preview.tsx +2 -0
- package/payload/src/components/ui/delta/README.md +2 -2
- package/payload/src/components/ui/delta/index.tsx +5 -2
- package/payload/src/components/ui/dialog/README.md +1 -1
- package/payload/src/components/ui/dialog/index.tsx +13 -3
- package/payload/src/components/ui/dialog/preview.tsx +4 -4
- package/payload/src/components/ui/empty-state/README.md +1 -1
- package/payload/src/components/ui/empty-state/index.tsx +2 -2
- package/payload/src/components/ui/field/README.md +2 -2
- package/payload/src/components/ui/icon-button/preview.tsx +2 -1
- package/payload/src/components/ui/input/index.tsx +4 -2
- package/payload/src/components/ui/input/preview.tsx +1 -1
- package/payload/src/components/ui/key-value/README.md +3 -3
- package/payload/src/components/ui/key-value/index.tsx +23 -19
- package/payload/src/components/ui/key-value/preview.tsx +1 -1
- package/payload/src/components/ui/pagination/README.md +2 -2
- package/payload/src/components/ui/pagination/preview.tsx +10 -4
- package/payload/src/components/ui/popover/README.md +3 -3
- package/payload/src/components/ui/popover/index.tsx +4 -1
- package/payload/src/components/ui/popover/preview.tsx +17 -11
- package/payload/src/components/ui/progress/README.md +4 -1
- package/payload/src/components/ui/progress/index.tsx +18 -13
- package/payload/src/components/ui/progress/preview.tsx +6 -2
- package/payload/src/components/ui/radio-group/README.md +7 -1
- package/payload/src/components/ui/radio-group/index.tsx +6 -4
- package/payload/src/components/ui/radio-group/preview.tsx +11 -1
- package/payload/src/components/ui/search-input/preview.tsx +8 -2
- package/payload/src/components/ui/segmented/preview.tsx +18 -2
- package/payload/src/components/ui/select/index.tsx +1 -1
- package/payload/src/components/ui/select/preview.tsx +1 -2
- package/payload/src/components/ui/sheet/README.md +1 -1
- package/payload/src/components/ui/sheet/index.tsx +1 -1
- package/payload/src/components/ui/sheet/preview.tsx +2 -2
- package/payload/src/components/ui/status-dot/README.md +5 -5
- package/payload/src/components/ui/status-dot/index.tsx +2 -1
- package/payload/src/components/ui/status-dot/preview.tsx +4 -1
- package/payload/src/components/ui/switch/README.md +1 -1
- package/payload/src/components/ui/switch/index.tsx +4 -2
- package/payload/src/components/ui/table/README.md +3 -3
- package/payload/src/components/ui/table/preview.tsx +4 -2
- package/payload/src/components/ui/tabs/README.md +3 -3
- package/payload/src/components/ui/tabs/index.tsx +2 -0
- package/payload/src/components/ui/textarea/README.md +1 -1
- package/payload/src/components/ui/textarea/index.tsx +2 -2
- package/payload/src/components/ui/toast/README.md +3 -2
- package/payload/src/components/ui/toast/index.tsx +58 -7
- package/payload/src/data/README.md +3 -3
- package/payload/src/data/access.ts +13 -7
- package/payload/src/data/collections.ts +20 -17
- package/payload/src/data/live-stream.ts +9 -20
- package/payload/src/data/member-mutations.ts +36 -30
- package/payload/src/data/metrics.ts +7 -18
- package/payload/src/data/read.ts +2 -2
- package/payload/src/data/requests.ts +6 -9
- package/payload/src/data/sample.ts +3 -3
- package/payload/src/data/ticket-mutations.ts +3 -3
- package/payload/src/data/uptime.ts +2 -2
- package/payload/src/data/view-as.ts +4 -4
- package/payload/src/lib/assistant/scoped.ts +2 -2
- package/payload/src/lib/collection.ts +17 -2
- package/payload/src/lib/demo-gate.ts +5 -0
- package/payload/src/lib/explore.ts +15 -12
- package/payload/src/lib/facts.ts +12 -7
- package/payload/src/lib/format-date.ts +23 -16
- package/payload/src/lib/format.ts +17 -0
- package/payload/src/lib/sort.ts +11 -0
- package/payload/src/lib/totals.ts +24 -0
- package/payload/src/logic/alerts.ts +6 -3
- package/payload/src/logic/customer-context.ts +6 -5
- package/payload/src/logic/customers-context.ts +16 -7
- package/payload/src/logic/derivations.ts +2 -2
- package/payload/src/logic/fact-insight.ts +9 -3
- package/payload/src/logic/home-context.ts +12 -10
- package/payload/src/logic/home-parts.ts +5 -5
- package/payload/src/logic/keys-context.ts +1 -1
- package/payload/src/logic/members-context.ts +4 -2
- package/payload/src/logic/now-context.ts +1 -3
- package/payload/src/logic/now-parts.ts +9 -9
- package/payload/src/logic/releases-context.ts +2 -1
- package/payload/src/logic/request-context.ts +18 -10
- package/payload/src/logic/requests-context.ts +2 -1
- package/payload/src/logic/requests-explore.ts +2 -3
- package/payload/src/logic/revenue-context.ts +4 -4
- package/payload/src/logic/revenue-parts.ts +6 -8
- package/payload/src/logic/services-context.ts +2 -2
- package/payload/src/logic/tests-context.ts +2 -2
- package/payload/src/logic/tools.ts +2 -2
- package/payload/src/logic/usage-context.ts +6 -5
- package/payload/src/logic/usage-parts.ts +4 -5
- package/payload/src/styles/base.css +1 -1
- package/payload/src/system/card-stage.tsx +10 -2
- package/payload/src/system/content.ts +8 -2
- package/payload/src/system/fixtures/company.ts +9 -12
- package/payload/src/system/fixtures/sample-records.ts +5 -1
- package/payload/src/system/fixtures/sample.ts +0 -1
- package/payload/src/system/hero.tsx +9 -6
- package/payload/src/system/page-stage.tsx +2 -2
- package/payload/src/system/sample-cells.tsx +1 -2
- package/payload/src/system/token-view.tsx +9 -9
- package/payload/src/views/console-live.tsx +1 -1
- package/payload/src/views/customer.tsx +12 -8
- package/payload/src/views/customers.tsx +1 -3
- package/payload/src/views/home.tsx +8 -10
- package/payload/src/views/keys.tsx +16 -8
- package/payload/src/views/members.tsx +28 -26
- package/payload/src/views/no-access.tsx +5 -4
- package/payload/src/views/not-found.tsx +2 -4
- package/payload/src/views/now.tsx +7 -9
- package/payload/src/views/period-actions.tsx +3 -3
- package/payload/src/views/refusal.tsx +1 -1
- package/payload/src/views/releases.tsx +3 -3
- package/payload/src/views/request.tsx +26 -15
- package/payload/src/views/requests.tsx +2 -3
- package/payload/src/views/revenue.tsx +3 -6
- package/payload/src/views/roles-matrix.tsx +5 -3
- package/payload/src/views/sample-footer.tsx +12 -8
- package/payload/src/views/settings.tsx +16 -8
- package/payload/src/views/tests.tsx +8 -9
- package/payload/src/views/tickets.tsx +15 -14
- package/payload/src/views/unread.tsx +2 -1
- package/payload/src/views/usage.tsx +3 -6
- package/payload/src/views/workspaces.ts +4 -11
- package/payload/tests/action-needs.test.tsx +1 -1
- package/payload/tests/alerts-read.test.tsx +33 -0
- package/payload/tests/assistant-access.test.ts +8 -8
- package/payload/tests/assistant-column-draft.test.tsx +50 -0
- package/payload/tests/assistant-guard.test.ts +0 -2
- package/payload/tests/assistant-ime.test.tsx +18 -0
- package/payload/tests/assistant-page-text.test.tsx +6 -4
- package/payload/tests/assistant-panel.test.tsx +4 -5
- package/payload/tests/assistant-prompt-truth.test.ts +1 -2
- package/payload/tests/assistant-prompt-writes.test.ts +1 -4
- package/payload/tests/assistant-proposal.test.tsx +1 -1
- package/payload/tests/assistant-questions.test.tsx +0 -3
- package/payload/tests/assistant-route.test.ts +10 -0
- package/payload/tests/assistant-settings.test.tsx +9 -7
- package/payload/tests/assistant-stale-scope.test.tsx +0 -4
- package/payload/tests/assistant-thread-scope.test.tsx +1 -5
- package/payload/tests/assistant-withheld.test.ts +3 -3
- package/payload/tests/atlas-layers.test.ts +18 -0
- package/payload/tests/atlas-product-slice.test.tsx +0 -3
- package/payload/tests/avatar-initials.test.tsx +23 -0
- package/payload/tests/banner-preview.test.tsx +31 -0
- package/payload/tests/bar-list-axis-words.test.tsx +1 -1
- package/payload/tests/bar-list-forms.test.tsx +28 -5
- package/payload/tests/bar-list-links.test.tsx +1 -1
- package/payload/tests/breadcrumb-fold.test.tsx +20 -0
- package/payload/tests/card-stage-hydration.test.tsx +2 -12
- package/payload/tests/chart-count-default.test.tsx +20 -0
- package/payload/tests/chart-scale-held.test.ts +1 -1
- package/payload/tests/chart-semantics.test.tsx +3 -3
- package/payload/tests/chart-table-memo.test.tsx +51 -0
- package/payload/tests/check-nav-under.test.ts +28 -1
- package/payload/tests/choice-description.test.tsx +33 -0
- package/payload/tests/chrome-navigation.test.tsx +8 -3
- package/payload/tests/collection-aggregate.test.ts +8 -9
- package/payload/tests/column-chart-grouped.test.tsx +1 -1
- package/payload/tests/composition-bar.test.tsx +23 -2
- package/payload/tests/console-chrome.test.tsx +12 -12
- package/payload/tests/context-check.test.ts +3 -0
- package/payload/tests/contexts-timezone.test.ts +45 -0
- package/payload/tests/copy-field.test.tsx +67 -1
- package/payload/tests/counts-and-lists.test.tsx +2 -13
- package/payload/tests/customer-empty-period.test.ts +25 -0
- package/payload/tests/customer-figures.test.ts +30 -1
- package/payload/tests/customers-payload.test.tsx +3 -6
- package/payload/tests/data-model.test.ts +0 -1
- package/payload/tests/data-table-manual-size.test.tsx +21 -0
- package/payload/tests/data-table.test.tsx +18 -1
- package/payload/tests/day-in-progress.test.ts +0 -1
- package/payload/tests/delta-flat.test.tsx +26 -0
- package/payload/tests/demo-gate.test.ts +14 -1
- package/payload/tests/demo-policy.test.ts +0 -1
- package/payload/tests/derivations.test.ts +22 -14
- package/payload/tests/dialog-focus.test.tsx +33 -0
- package/payload/tests/dialog-xl.test.tsx +1 -1
- package/payload/tests/disclosure.test.tsx +2 -2
- package/payload/tests/diverging-bars.test.tsx +1 -1
- package/payload/tests/embed-proposal.test.tsx +43 -0
- package/payload/tests/embed-requests-provenance.test.tsx +21 -0
- package/payload/tests/engineering-records.test.ts +1 -19
- package/payload/tests/engineering-workflows.test.ts +0 -4
- package/payload/tests/error-retry.test.tsx +26 -0
- package/payload/tests/explore-answer-length.test.ts +4 -10
- package/payload/tests/explore-contract.test.ts +2 -5
- package/payload/tests/explore-group-change.test.ts +5 -12
- package/payload/tests/explore-io.ts +16 -0
- package/payload/tests/explore-money.test.ts +6 -12
- package/payload/tests/explore-narrowed-measure.test.ts +6 -11
- package/payload/tests/explore-none.test.ts +4 -8
- package/payload/tests/explore-percent.test.ts +5 -12
- package/payload/tests/explore-refers.test.ts +7 -6
- package/payload/tests/explore-runner.test.ts +3 -5
- package/payload/tests/facts-config.test.ts +0 -6
- package/payload/tests/failed-request.test.ts +20 -0
- package/payload/tests/fake-llm.test.ts +1 -1
- package/payload/tests/feature-access.test.ts +1 -2
- package/payload/tests/feel-bar-list.test.tsx +1 -1
- package/payload/tests/feel-column-chart.test.tsx +1 -1
- package/payload/tests/feel-sparkline.test.tsx +13 -1
- package/payload/tests/filter-bar-search.test.tsx +13 -0
- package/payload/tests/filter-bar-view.test.tsx +20 -0
- package/payload/tests/form-section-readonly.test.tsx +14 -0
- package/payload/tests/format-currency.test.ts +1 -1
- package/payload/tests/format-date-calendar.test.ts +23 -0
- package/payload/tests/format.test.ts +31 -23
- package/payload/tests/hatch.test.ts +1 -1
- package/payload/tests/honest-controls.test.tsx +8 -24
- package/payload/tests/incident-card.test.tsx +1 -1
- package/payload/tests/input-states.test.tsx +16 -0
- package/payload/tests/key-value.test.tsx +14 -1
- package/payload/tests/keys-actions.test.ts +8 -7
- package/payload/tests/keys-gate.test.tsx +8 -31
- package/payload/tests/keys-scopes-view.test.tsx +1 -2
- package/payload/tests/keys-secret-view.test.tsx +2 -3
- package/payload/tests/linked-records.test.ts +11 -36
- package/payload/tests/live-client.test.tsx +1 -1
- package/payload/tests/live-resume.test.ts +0 -2
- package/payload/tests/live-route.test.ts +3 -3
- package/payload/tests/logo.test.ts +13 -0
- package/payload/tests/member-duplicate.test.ts +12 -1
- package/payload/tests/member-mutations.test.ts +28 -23
- package/payload/tests/member-roster-boundary.test.ts +3 -9
- package/payload/tests/members-optimistic.test.tsx +52 -41
- package/payload/tests/metric-tile-note.test.tsx +1 -1
- package/payload/tests/metric-tile-pointed-empty.test.tsx +1 -1
- package/payload/tests/next-start.test.ts +21 -0
- package/payload/tests/no-access.test.tsx +17 -7
- package/payload/tests/not-found.test.ts +7 -4
- package/payload/tests/page-frame-title.test.tsx +8 -8
- package/payload/tests/page-gates.test.tsx +2 -2
- package/payload/tests/page-loading.test.tsx +1 -1
- package/payload/tests/page-server-module.test.ts +23 -0
- package/payload/tests/pages-read-every-row.test.tsx +17 -31
- package/payload/tests/palette-hint.test.tsx +10 -6
- package/payload/tests/palette-ime.test.tsx +46 -0
- package/payload/tests/period-whole-previous.test.ts +25 -0
- package/payload/tests/plural.test.ts +11 -1
- package/payload/tests/popover-name.test.tsx +16 -0
- package/payload/tests/popover-preview.test.tsx +14 -0
- package/payload/tests/preview-live-controls.test.tsx +37 -0
- package/payload/tests/progress-values.test.tsx +38 -0
- package/payload/tests/providers-stored.test.tsx +28 -0
- package/payload/tests/rail-name-title.test.tsx +0 -4
- package/payload/tests/rail-trail.test.ts +16 -1
- package/payload/tests/read-all-query.test.ts +1 -3
- package/payload/tests/read-every-row.test.ts +6 -16
- package/payload/tests/records-consumers.test.tsx +4 -3
- package/payload/tests/refusal-descriptor.test.ts +1 -1
- package/payload/tests/request-curl.test.ts +27 -0
- package/payload/tests/request-keys-link.test.tsx +24 -0
- package/payload/tests/request-replay.test.ts +7 -0
- package/payload/tests/request-usage.test.tsx +40 -0
- package/payload/tests/requests-export.test.ts +15 -1
- package/payload/tests/requests-p95-one-rule.test.ts +24 -0
- package/payload/tests/requests-query.test.ts +6 -3
- package/payload/tests/requests-summary-newest.test.ts +0 -1
- package/payload/tests/review-held-scales.test.tsx +2 -1
- package/payload/tests/roles-matrix-redraw.test.tsx +22 -0
- package/payload/tests/routes-discover-shapes.test.ts +45 -0
- package/payload/tests/script-args.test.ts +78 -0
- package/payload/tests/select-touch.test.tsx +13 -0
- package/payload/tests/served.tsx +34 -0
- package/payload/tests/settings-access.test.tsx +11 -8
- package/payload/tests/settings-agents.test.tsx +0 -7
- package/payload/tests/settings-save.test.tsx +18 -0
- package/payload/tests/setup.ts +4 -0
- package/payload/tests/shared-context.test.tsx +97 -102
- package/payload/tests/shell-alerts.test.ts +11 -3
- package/payload/tests/shell-drawer-open.test.tsx +3 -2
- package/payload/tests/shell-first-arrival.test.tsx +0 -6
- package/payload/tests/shell-promise.test.tsx +1 -4
- package/payload/tests/shell-search-name.test.tsx +18 -1
- package/payload/tests/sign-in-answer.test.tsx +37 -0
- package/payload/tests/sign-in-honest.test.tsx +1 -1
- package/payload/tests/sign-in-persona.test.ts +15 -6
- package/payload/tests/sparkline-forms.test.tsx +5 -5
- package/payload/tests/specimen-still.test.tsx +1 -1
- package/payload/tests/status-list.test.tsx +8 -0
- package/payload/tests/table-cut-cell.test.tsx +3 -4
- package/payload/tests/table-grid.test.tsx +1 -2
- package/payload/tests/tabs-indicator.test.tsx +18 -0
- package/payload/tests/ticket-mutations.test.ts +0 -1
- package/payload/tests/ticket-owner.test.ts +0 -10
- package/payload/tests/tickets-view.test.tsx +9 -6
- package/payload/tests/toast-timing.test.tsx +53 -0
- package/payload/tests/trend-chart-curve.test.tsx +6 -6
- package/payload/tests/trend-chart-forms.test.tsx +5 -5
- package/payload/tests/trend-chart-whole.test.tsx +2 -0
- package/payload/tests/trend-chart.test.tsx +28 -0
- package/payload/tests/truncation-keeps-text.test.tsx +4 -5
- package/payload/tests/update-session.test.ts +0 -11
- package/payload/tests/uptime-bars-end.test.tsx +1 -3
- package/payload/tests/uptime-edges.test.tsx +45 -0
- package/payload/tests/uptime-no-data.test.tsx +1 -3
- package/payload/tests/uptime-svg.test.tsx +1 -3
- package/payload/tests/uptime-tap.test.tsx +15 -0
- package/payload/tests/usage-figures.test.ts +0 -1
- package/payload/tests/usage-summary.test.tsx +0 -1
- package/payload/tests/use-size-late.test.tsx +1 -1
- package/payload/tests/verify-data-url.test.ts +12 -0
- package/payload/tests/verify-loopback.test.ts +14 -3
- package/payload/tests/verify-personas.test.ts +4 -2
- package/payload/tests/verify-sample-surfaces.test.ts +34 -7
- package/payload/tests/verify-suite-outcome.test.ts +2 -2
- package/payload/tests/view-as.test.ts +0 -1
- package/payload/tests/view-tool-needs.test.ts +1 -2
- package/payload/tests/workspace-access.test.ts +0 -1
- package/payload/tests/workspace-figures.test.ts +0 -1
- package/payload/tests/workspace-home.test.tsx +0 -1
- package/payload/tests/bypasses.test.ts +0 -72
- package/payload/tests/logic-alerts.test.ts +0 -50
- package/payload/tests/logic-layer.test.ts +0 -58
- package/payload/tests/moved-paths-documented.test.ts +0 -51
- package/payload/tests/sample-company.test.ts +0 -227
- package/payload/tests/sample.test.ts +0 -158
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ npx zz-meridian@<version> brand [brand flags] # rebrand this project, with t
|
|
|
34
34
|
npx zz-meridian@latest skill [--global] # install only the agent skill
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
Brand flags: `--name "Acme Ops"`, `--hex '#2E6BE4'` (or `--accent indigo|cobalt|jade|graphite`), `--theme dark|light`,
|
|
37
|
+
Brand flags: `--name "Acme Ops"`, `--hex '#2E6BE4'` (or `--hue 250 --chroma 0.14`, or `--accent indigo|cobalt|jade|graphite`), `--theme dark|light`,
|
|
38
38
|
`--workspace`, `--timezone`, `--currency`, `--user`, `--role`. `--workspace` sets `app.workspace`, the environment named
|
|
39
39
|
in a page's kicker ("Production"); it does not touch the navigation workspaces.
|
|
40
40
|
|
|
@@ -81,7 +81,7 @@ refuses when one of those outputs was edited, while an update is open, or on a d
|
|
|
81
81
|
it with the version the manifest records. The project's own `pnpm brand` still works, but its changes count as your edits.
|
|
82
82
|
|
|
83
83
|
The standard a project on Meridian is built to is
|
|
84
|
-
[data-layers.md](https://github.com/zhixuan312/zz-meridian/blob/
|
|
84
|
+
[data-layers.md](https://github.com/zhixuan312/zz-meridian/blob/master/docs/data-layers.md): the four layers between a
|
|
85
85
|
database and the screen, the contract a backend answers, and the six rules a project switches on in its own
|
|
86
86
|
`scripts/check.local.ts`.
|
|
87
87
|
|
|
@@ -104,4 +104,4 @@ Meridian's own template or sample data.
|
|
|
104
104
|
|
|
105
105
|
## License
|
|
106
106
|
|
|
107
|
-
MIT
|
|
107
|
+
MIT: the text is `payload/LICENSE` in the package and `LICENSE` in a project `create` makes.
|
package/dist/adopt.js
CHANGED
|
@@ -3,18 +3,16 @@
|
|
|
3
3
|
* its data layer. Everything here is the settled part of the skill's Route A; rebuilding each page on Meridian's
|
|
4
4
|
* components is the agent's work, and the printed next step hands it over.
|
|
5
5
|
*
|
|
6
|
-
* Nothing is written until every check has passed: a
|
|
7
|
-
* or a file of the same name with other content stops
|
|
6
|
+
* Nothing is written until every check has passed: a project already on Meridian (its manifest: update is the command),
|
|
7
|
+
* a dirty tree, a project that is not Next.js with the App Router, or a file of the same name with other content stops
|
|
8
|
+
* it before the first write.
|
|
8
9
|
*/
|
|
9
10
|
import fs from 'node:fs';
|
|
10
11
|
import path from 'node:path';
|
|
11
12
|
import { VERSION, brandArgs, effectiveBrand, inside, installArgs, installSkill, jsoncExtras, packageManager, payloadBytes, payloadFiles, readJsonc, readPayload, relativeImports, skillPaths, run, runTool, sha256, writeIn, writeManifest, } from './files.js';
|
|
12
13
|
import { BRIEF_TEMPLATE, managedBlock, upsertManagedBlock } from './context.js';
|
|
13
|
-
import { FIXED, adoptSetOf, managedPaths } from './ownership.js';
|
|
14
|
-
|
|
15
|
-
const DEPS = ['next', 'react', 'react-dom', 'radix-ui', 'lucide-react', 'clsx', 'tailwind-merge', 'react-markdown', 'remark-gfm', 'ai', '@ai-sdk/react', 'zod'];
|
|
16
|
-
const DEV_DEPS = ['typescript', '@types/node', '@types/react', '@types/react-dom', 'tailwindcss', '@tailwindcss/postcss', 'eslint', 'eslint-config-next', 'vitest', '@vitejs/plugin-react', 'jsdom', '@testing-library/react', '@testing-library/dom', '@testing-library/jest-dom'];
|
|
17
|
-
const SCRIPTS = ['typecheck', 'test', 'tokens', 'check', 'contrast', 'gate', 'audit', 'verify', 'brand', 'shot', 'interactions', 'keyboard', 'vitals'];
|
|
14
|
+
import { FIXED, adoptSetOf, managedPaths, parseManifest } from './ownership.js';
|
|
15
|
+
import { MERIDIAN_SCRIPTS, TOOLCHAIN, needOf } from './reconcile.js';
|
|
18
16
|
const major = (spec) => Number(/(\d+)/.exec(spec)?.[1] ?? NaN);
|
|
19
17
|
const TS = /\.(ts|tsx)$/;
|
|
20
18
|
/** A specifier inside a copied file, pinned to the exact module so a team file of a similar name can never win. */
|
|
@@ -93,13 +91,14 @@ export function projectConfig(template, pages) {
|
|
|
93
91
|
.replace(/export const nav: NavGroup\[\] = \[[\s\S]*?\n\];/, `/** Written by zz-meridian adopt from the project's pages: give each its own icon and group them. */\nexport const nav: NavGroup[] = [\n {\n items: [\n${items}\n ],\n },\n];`);
|
|
94
92
|
}
|
|
95
93
|
/**
|
|
96
|
-
* `scripts/verify.config.ts` as a project gets it. The sample's persona rows are what used `EVERY_ROUTE
|
|
97
|
-
* config object leaves
|
|
98
|
-
* wrote, 0.7 s after the other steps passed
|
|
94
|
+
* `scripts/verify.config.ts` as a project gets it. The sample's persona rows are what used `EVERY_ROUTE` and `ROLE_ROUTES`,
|
|
95
|
+
* so replacing the config object leaves them declared and never read — which the gate's own lint fails, in the project
|
|
96
|
+
* adopt just wrote, 0.7 s after the other steps passed — and names the sample's routes in the team's file. Each goes
|
|
97
|
+
* with its doc line. Exported so a test can hold the rewrite to that.
|
|
99
98
|
*/
|
|
100
99
|
export function verifyConfig() {
|
|
101
100
|
return readPayload('scripts/verify.config.ts')
|
|
102
|
-
.replace(
|
|
101
|
+
.replace(/^\/\*\*[^\n]*\*\/\nconst (?:EVERY_ROUTE|ROLE_ROUTES) = \[[^\n]*\n\n?/gm, '')
|
|
103
102
|
.replace(/const config: VerifyConfig = \{[\s\S]*?\n\};/, `const config: VerifyConfig = {
|
|
104
103
|
// One detail page per state worth seeing (a normal record, a failed one, a missing one), with ids from your data.
|
|
105
104
|
detailRoutes: [],
|
|
@@ -182,6 +181,17 @@ export function adopt(o) {
|
|
|
182
181
|
// ── Checks: nothing is written until all of them pass ─────────────────────────────────────────────────
|
|
183
182
|
if (!fs.existsSync(pkgPath))
|
|
184
183
|
return fail(`no package.json in ${root}: run adopt in the project's folder`);
|
|
184
|
+
// A project adopt or create already set up holds Meridian's files as its manifest records them, and whatever the team
|
|
185
|
+
// changed since; adopted again, every edited one would be listed as a conflict. Moving it to this release is update's.
|
|
186
|
+
const manifestPath = path.join(root, '.meridian/manifest.json');
|
|
187
|
+
if (fs.existsSync(manifestPath)) {
|
|
188
|
+
let at = '';
|
|
189
|
+
try {
|
|
190
|
+
at = ` ${parseManifest(fs.readFileSync(manifestPath, 'utf8')).version}`;
|
|
191
|
+
}
|
|
192
|
+
catch { /* the version is only named */ }
|
|
193
|
+
return fail(`this project is already on Meridian${at} (.meridian/manifest.json): run npx zz-meridian@latest update to move it to this release`);
|
|
194
|
+
}
|
|
185
195
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
186
196
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
187
197
|
const dir = appDir(root);
|
|
@@ -275,10 +285,13 @@ Rename or move them, then run adopt again.`);
|
|
|
275
285
|
}
|
|
276
286
|
}
|
|
277
287
|
};
|
|
278
|
-
|
|
279
|
-
|
|
288
|
+
// The packages the adopted modules import, and the framework: the rule `update` applies to a created project.
|
|
289
|
+
const sources = new Map(set.filter((rel) => TS.test(rel)).map((rel) => [rel, payloadBytes(rel).toString('utf8')]));
|
|
290
|
+
sources.set('src/app.config.ts', config);
|
|
291
|
+
merge('dependencies', needOf(tpl, sources).runtime);
|
|
292
|
+
merge('devDependencies', TOOLCHAIN);
|
|
280
293
|
pkg.scripts ??= {};
|
|
281
|
-
for (const s of
|
|
294
|
+
for (const s of MERIDIAN_SCRIPTS) {
|
|
282
295
|
const want = tpl.scripts[s];
|
|
283
296
|
if (!pkg.scripts[s])
|
|
284
297
|
pkg.scripts[s] = want;
|
|
@@ -364,8 +377,11 @@ Rename or move them, then run adopt again.`);
|
|
|
364
377
|
const brandDirs = () => ['tokens', 'src/styles'].flatMap((d) => listFiles(root, d));
|
|
365
378
|
const existed = new Set(brandDirs());
|
|
366
379
|
const b = run(process.execPath, ['scripts/brand.ts', ...brandArgs(brand), '--existing'], root);
|
|
367
|
-
if (b.status !== 0)
|
|
368
|
-
|
|
380
|
+
if (b.status !== 0) {
|
|
381
|
+
// From a clean tree, git takes back exactly what adopt wrote; with --allow-dirty it would take the team's changes too.
|
|
382
|
+
const back = o.allowDirty ? 'remove what adopt wrote (git status shows it beside your own changes)' : 'put the tree back (git restore . && git clean -fd removes only what adopt wrote, since it started clean)';
|
|
383
|
+
return fail(`scripts/brand.ts failed (above) after the files were copied, and the manifest and agent files are not written. Fix the cause, ${back}, and run zz-meridian adopt again with the same flags`);
|
|
384
|
+
}
|
|
369
385
|
// The project's own AGENTS.md keeps every byte and gains the managed block; the brief is the team's, written only when absent.
|
|
370
386
|
// Neither is a Meridian file, so neither is recorded in the manifest.
|
|
371
387
|
const pm = packageManager(root);
|
package/dist/cli.js
CHANGED
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import os from 'node:os';
|
|
7
7
|
import path from 'node:path';
|
|
8
|
-
import { parseArgs } from 'node:util';
|
|
9
8
|
import { adopt } from './adopt.js';
|
|
10
|
-
import { misapplied } from './command-flags.js';
|
|
9
|
+
import { misapplied, readFlags } from './command-flags.js';
|
|
11
10
|
import { create } from './create.js';
|
|
12
11
|
import { BRAND_FLAGS, VERSION, installSkill } from './files.js';
|
|
13
12
|
import { brandCommand } from './rebrand.js';
|
|
@@ -40,29 +39,17 @@ Brand flags: --name "Acme Ops" --workspace Production --timezone Europe/London -
|
|
|
40
39
|
--user "Ada Park" --role Admin --accent indigo|cobalt|jade|graphite | --hex '#2E6BE4' | --hue 250 --chroma 0.14
|
|
41
40
|
|
|
42
41
|
Then give your coding agent the skill: .agents/skills/zz-meridian/SKILL.md.`;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
'dry-run': { type: 'boolean' },
|
|
50
|
-
resume: { type: 'boolean' },
|
|
51
|
-
finalize: { type: 'boolean' },
|
|
52
|
-
abort: { type: 'boolean' },
|
|
53
|
-
verify: { type: 'boolean' },
|
|
54
|
-
verbose: { type: 'boolean' },
|
|
55
|
-
global: { type: 'boolean' },
|
|
56
|
-
help: { type: 'boolean', short: 'h' },
|
|
57
|
-
version: { type: 'boolean', short: 'v' },
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
const flags = values;
|
|
42
|
+
const read = readFlags(process.argv.slice(2));
|
|
43
|
+
if ('error' in read) {
|
|
44
|
+
console.error(`zz-meridian: ${read.error}. zz-meridian --help lists the commands and their flags.`);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
const { values: flags, positionals } = read;
|
|
61
48
|
const brand = Object.fromEntries(BRAND_FLAGS.flatMap((f) => (typeof flags[f] === 'string' ? [[f, flags[f]]] : [])));
|
|
62
|
-
const install = !
|
|
49
|
+
const install = !flags['no-install'];
|
|
63
50
|
const [command, arg] = positionals;
|
|
64
51
|
function main() {
|
|
65
|
-
if (
|
|
52
|
+
if (flags.version) {
|
|
66
53
|
console.log(VERSION);
|
|
67
54
|
return 0;
|
|
68
55
|
}
|
|
@@ -72,9 +59,9 @@ function main() {
|
|
|
72
59
|
console.error(`zz-meridian: --${unsafe[0]} may not contain a backslash or a line break`);
|
|
73
60
|
return 1;
|
|
74
61
|
}
|
|
75
|
-
if (
|
|
62
|
+
if (flags.help || !command) {
|
|
76
63
|
console.log(HELP);
|
|
77
|
-
return command ||
|
|
64
|
+
return command || flags.help ? 0 : 1;
|
|
78
65
|
}
|
|
79
66
|
// A flag a command does not read is refused, never ignored: `adopt --dry-run` wrote the project rather than previewing it.
|
|
80
67
|
const wrong = misapplied(command, flags);
|
|
@@ -83,7 +70,7 @@ function main() {
|
|
|
83
70
|
return 1;
|
|
84
71
|
}
|
|
85
72
|
if (command === 'adopt')
|
|
86
|
-
return adopt({ root: process.cwd(), brand, allowDirty: Boolean(
|
|
73
|
+
return adopt({ root: process.cwd(), brand, allowDirty: Boolean(flags['allow-dirty']), install });
|
|
87
74
|
if (command === 'create') {
|
|
88
75
|
if (!arg) {
|
|
89
76
|
console.error('zz-meridian create: name the folder for the new dashboard');
|
|
@@ -92,26 +79,26 @@ function main() {
|
|
|
92
79
|
return create({ dir: arg, brand, install });
|
|
93
80
|
}
|
|
94
81
|
if (command === 'update') {
|
|
95
|
-
const modes = ['dry-run', 'resume', 'finalize', 'abort'].filter((m) =>
|
|
82
|
+
const modes = ['dry-run', 'resume', 'finalize', 'abort'].filter((m) => flags[m]);
|
|
96
83
|
if (modes.length > 1) {
|
|
97
84
|
console.error(`zz-meridian update: ${modes.map((m) => `--${m}`).join(' and ')} cannot be combined`);
|
|
98
85
|
return 1;
|
|
99
86
|
}
|
|
100
|
-
if (
|
|
87
|
+
if (flags.verify && !flags.finalize) {
|
|
101
88
|
console.error('zz-meridian update: --verify belongs to --finalize');
|
|
102
89
|
return 1;
|
|
103
90
|
}
|
|
104
91
|
const mode = modes[0] ?? 'update';
|
|
105
|
-
return update({ root: process.cwd(), mode, flags: { verbose: Boolean(
|
|
92
|
+
return update({ root: process.cwd(), mode, flags: { verbose: Boolean(flags.verbose), allowDirty: Boolean(flags['allow-dirty']), install, verify: Boolean(flags.verify) } });
|
|
106
93
|
}
|
|
107
94
|
if (command === 'brand')
|
|
108
|
-
return brandCommand({ root: process.cwd(), flags: brand, allowDirty: Boolean(
|
|
95
|
+
return brandCommand({ root: process.cwd(), flags: brand, allowDirty: Boolean(flags['allow-dirty']) });
|
|
109
96
|
if (command === 'skill') {
|
|
110
|
-
const roots =
|
|
97
|
+
const roots = flags.global ? [os.homedir()] : [process.cwd()];
|
|
111
98
|
for (const r of roots)
|
|
112
99
|
installSkill(r);
|
|
113
100
|
const skill = path.join(roots[0], '.claude/skills/zz-meridian/SKILL.md');
|
|
114
|
-
console.log(`The zz-meridian skill is in ${
|
|
101
|
+
console.log(`The zz-meridian skill is in ${flags.global ? path.join(os.homedir(), '.agents/skills') + ' and ' + path.join(os.homedir(), '.claude/skills') : '.agents/skills and .claude/skills'}. Codex may need a restart to list it.`);
|
|
115
102
|
console.log(`To follow it now, read ${skill} and the references beside it: it says how to build what was asked and when it is done.`);
|
|
116
103
|
return 0;
|
|
117
104
|
}
|
package/dist/command-flags.js
CHANGED
|
@@ -3,7 +3,39 @@
|
|
|
3
3
|
* else it is refused by name rather than accepted and ignored, so `adopt --dry-run` never modifies a project while the
|
|
4
4
|
* person waits for a preview.
|
|
5
5
|
*/
|
|
6
|
+
import { parseArgs } from 'node:util';
|
|
6
7
|
import { BRAND_FLAGS } from './files.js';
|
|
8
|
+
/**
|
|
9
|
+
* The command line, read: its flags and positionals, or the reason it cannot be read (an unknown flag, a value-less one),
|
|
10
|
+
* as one line for the person rather than a stack trace.
|
|
11
|
+
*/
|
|
12
|
+
export function readFlags(args) {
|
|
13
|
+
try {
|
|
14
|
+
const { values, positionals } = parseArgs({
|
|
15
|
+
args,
|
|
16
|
+
allowPositionals: true,
|
|
17
|
+
options: {
|
|
18
|
+
...Object.fromEntries(BRAND_FLAGS.map((f) => [f, { type: 'string' }])),
|
|
19
|
+
'allow-dirty': { type: 'boolean' },
|
|
20
|
+
'no-install': { type: 'boolean' },
|
|
21
|
+
'dry-run': { type: 'boolean' },
|
|
22
|
+
resume: { type: 'boolean' },
|
|
23
|
+
finalize: { type: 'boolean' },
|
|
24
|
+
abort: { type: 'boolean' },
|
|
25
|
+
verify: { type: 'boolean' },
|
|
26
|
+
verbose: { type: 'boolean' },
|
|
27
|
+
global: { type: 'boolean' },
|
|
28
|
+
help: { type: 'boolean', short: 'h' },
|
|
29
|
+
version: { type: 'boolean', short: 'v' },
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
return { values: { ...values }, positionals };
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
// Node's first sentence names the flag; the rest is about positionals that start with a dash.
|
|
36
|
+
return { error: e.message.split('. ')[0] };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
7
39
|
/** Every command reads these. */
|
|
8
40
|
const EVERYWHERE = ['help', 'version'];
|
|
9
41
|
/** The brand flags, read by the commands that write a brand. */
|
package/dist/context.js
CHANGED
|
@@ -41,8 +41,8 @@ Brand, layout and behaviour choices already made, one line each with its reason,
|
|
|
41
41
|
## Glossary
|
|
42
42
|
The team's own words for things, one per line: term and what it means here.
|
|
43
43
|
`;
|
|
44
|
-
/**
|
|
45
|
-
function command(pm, script, flags) {
|
|
44
|
+
/** A package script with flags, as the package manager runs it: npm passes flags on only after `--`. */
|
|
45
|
+
export function command(pm, script, flags) {
|
|
46
46
|
if (pm === 'pnpm')
|
|
47
47
|
return `pnpm ${script}${flags}`;
|
|
48
48
|
if (pm === 'npm')
|
package/dist/create.js
CHANGED
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
import fs from 'node:fs';
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import { managedPaths } from './ownership.js';
|
|
9
|
-
import { BRIEF_TEMPLATE, managedBlock, upsertManagedBlock } from './context.js';
|
|
9
|
+
import { BRIEF_TEMPLATE, command, managedBlock, upsertManagedBlock } from './context.js';
|
|
10
10
|
import { VERSION, brandArgs, effectiveBrand, hasCommand, inside, installSkill, payloadBytes, payloadFiles, run, sha256, writeIn, writeManifest } from './files.js';
|
|
11
11
|
export function create(o) {
|
|
12
12
|
const root = path.resolve(o.dir);
|
|
13
|
+
if (fs.existsSync(root) && !fs.statSync(root).isDirectory())
|
|
14
|
+
return fail(`${root} is a file: name a new folder`);
|
|
13
15
|
if (fs.existsSync(root) && fs.readdirSync(root).length)
|
|
14
16
|
return fail(`${root} exists and is not empty: name a new folder`);
|
|
15
17
|
let brand;
|
|
@@ -27,7 +29,7 @@ export function create(o) {
|
|
|
27
29
|
const name = brand.name ?? path.basename(root).replace(/[-_]+/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase());
|
|
28
30
|
brand = effectiveBrand({ ...brand, name });
|
|
29
31
|
if (run(process.execPath, ['scripts/brand.ts', ...brandArgs(brand), '--product'], root).status !== 0) {
|
|
30
|
-
return fail(
|
|
32
|
+
return fail(`scripts/brand.ts failed (above). ${root} holds the unbranded template and nothing else: fix the cause, delete the folder and run zz-meridian create again with the same flags`);
|
|
31
33
|
}
|
|
32
34
|
// pnpm installs from the template's lockfile, with install scripts off (pnpm-workspace.yaml). Without pnpm, corepack
|
|
33
35
|
// (bundled with Node 22) runs it; only without both does npm install, from the version ranges, with scripts off too.
|
|
@@ -76,11 +78,15 @@ export function create(o) {
|
|
|
76
78
|
${name} is a new Meridian ${VERSION} dashboard in ${root}.
|
|
77
79
|
skill: .agents/skills/zz-meridian (Codex) and .claude/skills/zz-meridian (Claude Code)
|
|
78
80
|
|
|
79
|
-
|
|
80
|
-
step 4's colour check, then data and the pages, then the loop in references/standard.md until ${pm} run verify --full --timed ends with "the project meets the
|
|
81
|
-
Meridian standard" and no view on the scoreboard is Weak.`);
|
|
81
|
+
${nextStep(pm)}`);
|
|
82
82
|
return 0;
|
|
83
83
|
}
|
|
84
|
+
/** What the person does next, with the full verify written so their package manager passes its flags on. */
|
|
85
|
+
export function nextStep(pm) {
|
|
86
|
+
return `Next: follow .agents/skills/zz-meridian/SKILL.md from step 3's brief (the template is fetched and branded): the brief,
|
|
87
|
+
step 4's colour check, then data and the pages, then the loop in references/standard.md until ${command(pm, 'verify', ' --full --timed')} ends with "the project meets the
|
|
88
|
+
Meridian standard" and no view on the scoreboard is Weak.`;
|
|
89
|
+
}
|
|
84
90
|
function fail(msg) {
|
|
85
91
|
console.error(`zz-meridian create: ${msg}`);
|
|
86
92
|
return 1;
|
package/dist/files.js
CHANGED
|
@@ -7,7 +7,7 @@ import { spawnSync } from 'node:child_process';
|
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import path from 'node:path';
|
|
9
9
|
import { fileURLToPath } from 'node:url';
|
|
10
|
-
/** The template snapshot this package carries,
|
|
10
|
+
/** The template snapshot this package carries, extracted from the release commit by `git archive` (cli/scripts/build-payload.ts). */
|
|
11
11
|
export const PAYLOAD = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'payload');
|
|
12
12
|
export const VERSION = JSON.parse(fs.readFileSync(path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'package.json'), 'utf8')).version;
|
|
13
13
|
/**
|
|
@@ -73,6 +73,8 @@ export function writeIn(root, rel, content) {
|
|
|
73
73
|
fs.writeFileSync(abs, content);
|
|
74
74
|
}
|
|
75
75
|
export const sha256 = (content) => `sha256-${createHash('sha256').update(content).digest('hex')}`;
|
|
76
|
+
/** What a quiet command may print and still be read whole: past Node's 1 MiB default the child is killed, and a long gate reads as exit 1. */
|
|
77
|
+
const OUTPUT = 256 * 1024 * 1024;
|
|
76
78
|
/**
|
|
77
79
|
* A command with its arguments, without a shell, so nothing in a name or a path is ever interpreted. The one exception
|
|
78
80
|
* is a Windows .cmd shim (npm, pnpm, tsc), which Node runs only through a shell: those calls pass fixed arguments
|
|
@@ -80,7 +82,7 @@ export const sha256 = (content) => `sha256-${createHash('sha256').update(content
|
|
|
80
82
|
*/
|
|
81
83
|
export function run(cmd, args, cwd, quiet = false) {
|
|
82
84
|
const shim = process.platform === 'win32' && cmd !== process.execPath;
|
|
83
|
-
return spawnSync(shim && cmd.includes(' ') ? `"${cmd}"` : cmd, args, { cwd, encoding: 'utf8', stdio: quiet ? 'pipe' : 'inherit', shell: shim });
|
|
85
|
+
return spawnSync(shim && cmd.includes(' ') ? `"${cmd}"` : cmd, args, { cwd, encoding: 'utf8', stdio: quiet ? 'pipe' : 'inherit', shell: shim, maxBuffer: OUTPUT });
|
|
84
86
|
}
|
|
85
87
|
/** The package manager a project already uses, from its lockfile; npm when it has none. */
|
|
86
88
|
export function packageManager(root) {
|
|
@@ -99,7 +101,7 @@ export function packageManager(root) {
|
|
|
99
101
|
export const installArgs = (pm) => (pm === 'pnpm' ? ['install', '--no-frozen-lockfile'] : ['install']);
|
|
100
102
|
/** A tool in the project's node_modules, run as `node <its script>`: no shell and no .cmd shim on any platform. */
|
|
101
103
|
export function runTool(root, entry, args, quiet = true) {
|
|
102
|
-
return spawnSync(process.execPath, [path.join(root, 'node_modules', entry), ...args], { cwd: root, encoding: 'utf8', stdio: quiet ? 'pipe' : 'inherit' });
|
|
104
|
+
return spawnSync(process.execPath, [path.join(root, 'node_modules', entry), ...args], { cwd: root, encoding: 'utf8', stdio: quiet ? 'pipe' : 'inherit', maxBuffer: OUTPUT });
|
|
103
105
|
}
|
|
104
106
|
export const hasCommand = (cmd) => spawnSync(cmd, ['--version'], { stdio: 'ignore', shell: process.platform === 'win32' }).status === 0;
|
|
105
107
|
/** A JSONC document's text with the comments dropped, and whether anything had to be dropped to read it. */
|
|
@@ -164,9 +166,16 @@ export function relativeImports(rel, source) {
|
|
|
164
166
|
return `${lead}${q}${to}${q}`;
|
|
165
167
|
});
|
|
166
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* The manifest file as every writer writes it: paths sorted by code unit (never the machine's collation), two-space
|
|
171
|
+
* indent, a final newline. Finalize tells an interrupted rename by comparing the file with this, byte for byte.
|
|
172
|
+
*/
|
|
173
|
+
export function manifestText(m) {
|
|
174
|
+
const files = Object.fromEntries(Object.entries(m.files).sort(([a], [b]) => (a < b ? -1 : 1)));
|
|
175
|
+
return `${JSON.stringify({ ...m, files }, null, 2)}\n`;
|
|
176
|
+
}
|
|
167
177
|
export function writeManifest(root, m) {
|
|
168
|
-
|
|
169
|
-
writeIn(root, '.meridian/manifest.json', JSON.stringify({ ...m, files: sorted }, null, 2) + '\n');
|
|
178
|
+
writeIn(root, '.meridian/manifest.json', manifestText(m));
|
|
170
179
|
}
|
|
171
180
|
/**
|
|
172
181
|
* Where the skill goes: the folders each agent reads in a repository, Codex (`.agents`) and Claude Code (`.claude`), and
|