@open-mercato/cezar 0.9.1 → 0.9.2-pr710.1256
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/LICENSE +21 -0
- package/README.md +157 -32
- package/dist/agent-config/account-identity.d.ts +44 -0
- package/dist/agent-config/account-identity.js +128 -0
- package/dist/agent-config/account-identity.js.map +1 -0
- package/dist/agent-config/catalog.d.ts +9 -1
- package/dist/agent-config/catalog.js +18 -0
- package/dist/agent-config/catalog.js.map +1 -1
- package/dist/agent-config/files.d.ts +1 -1
- package/dist/agent-config/model-settings/claude.d.ts +2 -0
- package/dist/agent-config/model-settings/claude.js +11 -0
- package/dist/agent-config/model-settings/claude.js.map +1 -0
- package/dist/agent-config/model-settings/codex.d.ts +2 -0
- package/dist/agent-config/model-settings/codex.js +16 -0
- package/dist/agent-config/model-settings/codex.js.map +1 -0
- package/dist/agent-config/model-settings/opencode.d.ts +2 -0
- package/dist/agent-config/model-settings/opencode.js +8 -0
- package/dist/agent-config/model-settings/opencode.js.map +1 -0
- package/dist/agent-config/model-settings/pi.d.ts +12 -0
- package/dist/agent-config/model-settings/pi.js +18 -0
- package/dist/agent-config/model-settings/pi.js.map +1 -0
- package/dist/agent-config/model-settings/shared.d.ts +9 -0
- package/dist/agent-config/model-settings/shared.js +93 -0
- package/dist/agent-config/model-settings/shared.js.map +1 -0
- package/dist/agent-config/model-settings/types.d.ts +9 -0
- package/dist/agent-config/model-settings/types.js +2 -0
- package/dist/agent-config/model-settings/types.js.map +1 -0
- package/dist/agent-config/models.d.ts +9 -0
- package/dist/agent-config/models.js +32 -0
- package/dist/agent-config/models.js.map +1 -0
- package/dist/agent-config/service.d.ts +1 -1
- package/dist/agent-config/service.js +4 -4
- package/dist/agent-config/service.js.map +1 -1
- package/dist/agent-config/validate.d.ts +1 -1
- package/dist/automations/coordinator.d.ts +26 -0
- package/dist/automations/coordinator.js +66 -0
- package/dist/automations/coordinator.js.map +1 -0
- package/dist/automations/github-poller.d.ts +74 -0
- package/dist/automations/github-poller.js +234 -0
- package/dist/automations/github-poller.js.map +1 -0
- package/dist/automations/scheduler.d.ts +42 -0
- package/dist/automations/scheduler.js +192 -0
- package/dist/automations/scheduler.js.map +1 -0
- package/dist/automations/store.d.ts +65 -0
- package/dist/automations/store.js +298 -0
- package/dist/automations/store.js.map +1 -0
- package/dist/automations/task-template.d.ts +18 -0
- package/dist/automations/task-template.js +95 -0
- package/dist/automations/task-template.js.map +1 -0
- package/dist/automations/types.d.ts +255 -0
- package/dist/automations/types.js +159 -0
- package/dist/automations/types.js.map +1 -0
- package/dist/config.d.ts +19 -112
- package/dist/config.js +48 -5
- package/dist/config.js.map +1 -1
- package/dist/contract/agent-config.d.ts +153 -0
- package/dist/contract/agent-profiles.d.ts +347 -0
- package/dist/contract/automations.d.ts +935 -0
- package/dist/contract/events.d.ts +104 -0
- package/dist/contract/github.d.ts +467 -0
- package/dist/contract/health.d.ts +102 -0
- package/dist/contract/index.d.ts +16 -0
- package/dist/contract/index.js +1830 -0
- package/dist/contract/projects.d.ts +210 -0
- package/dist/contract/repo.d.ts +234 -0
- package/dist/contract/runs.d.ts +1407 -0
- package/dist/contract/skills.d.ts +232 -0
- package/dist/contract/workflows.d.ts +218 -0
- package/dist/contract/workspace.d.ts +577 -0
- package/dist/core/agent-env.d.ts +1 -1
- package/dist/core/agent-env.js +41 -16
- package/dist/core/agent-env.js.map +1 -1
- package/dist/core/agent-model-policy.d.ts +10 -0
- package/dist/core/agent-model-policy.js +36 -0
- package/dist/core/agent-model-policy.js.map +1 -0
- package/dist/core/agent-profiles.d.ts +62 -0
- package/dist/core/agent-profiles.js +90 -0
- package/dist/core/agent-profiles.js.map +1 -0
- package/dist/core/agent-runner.d.ts +49 -7
- package/dist/core/agent-runner.js +48 -3
- package/dist/core/agent-runner.js.map +1 -1
- package/dist/core/ask.d.ts +45 -124
- package/dist/core/ask.js +103 -13
- package/dist/core/ask.js.map +1 -1
- package/dist/core/backend-detect.d.ts +5 -5
- package/dist/core/backend-detect.js +44 -7
- package/dist/core/backend-detect.js.map +1 -1
- package/dist/core/claude-cli-runner.d.ts +2 -2
- package/dist/core/claude-cli-runner.js +61 -13
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/claude-ui-mapper.d.ts +1 -1
- package/dist/core/codex-app-server-runner.d.ts +1 -1
- package/dist/core/codex-app-server-runner.js +65 -3
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/codex-app-server-transport.d.ts +6 -1
- package/dist/core/codex-app-server-transport.js +17 -3
- package/dist/core/codex-app-server-transport.js.map +1 -1
- package/dist/core/codex-model-catalog.d.ts +1 -1
- package/dist/core/codex-ui-mapper.d.ts +5 -1
- package/dist/core/codex-ui-mapper.js +74 -17
- package/dist/core/codex-ui-mapper.js.map +1 -1
- package/dist/core/model-identity.d.ts +24 -12
- package/dist/core/model-identity.js +41 -24
- package/dist/core/model-identity.js.map +1 -1
- package/dist/core/model-presets.d.ts +10 -4
- package/dist/core/model-presets.js +52 -9
- package/dist/core/model-presets.js.map +1 -1
- package/dist/core/opencode-model-catalog.d.ts +30 -0
- package/dist/core/opencode-model-catalog.js +126 -0
- package/dist/core/opencode-model-catalog.js.map +1 -0
- package/dist/core/opencode-server-runner.d.ts +2 -2
- package/dist/core/opencode-ui-mapper.d.ts +4 -1
- package/dist/core/opencode-ui-mapper.js +45 -7
- package/dist/core/opencode-ui-mapper.js.map +1 -1
- package/dist/core/pi-runner.d.ts +24 -0
- package/dist/core/pi-runner.js +349 -0
- package/dist/core/pi-runner.js.map +1 -0
- package/dist/core/pi-ui-mapper.d.ts +34 -0
- package/dist/core/pi-ui-mapper.js +270 -0
- package/dist/core/pi-ui-mapper.js.map +1 -0
- package/dist/core/provider-auth.d.ts +154 -0
- package/dist/core/provider-auth.js +509 -0
- package/dist/core/provider-auth.js.map +1 -0
- package/dist/core/provider-availability.d.ts +3 -0
- package/dist/core/provider-availability.js +14 -0
- package/dist/core/provider-availability.js.map +1 -0
- package/dist/core/runner-factory.d.ts +1 -1
- package/dist/core/runner-factory.js +3 -0
- package/dist/core/runner-factory.js.map +1 -1
- package/dist/core/runner-model-catalog.d.ts +1 -1
- package/dist/core/shell-env.d.ts +28 -0
- package/dist/core/shell-env.js +56 -0
- package/dist/core/shell-env.js.map +1 -0
- package/dist/core/tool-display.d.ts +1 -1
- package/dist/core/ui-events.d.ts +2 -2
- package/dist/core/ui-events.js +1 -1
- package/dist/core/usage-limit.d.ts +42 -0
- package/dist/core/usage-limit.js +209 -0
- package/dist/core/usage-limit.js.map +1 -0
- package/dist/git-diff-base.d.ts +85 -0
- package/dist/git-diff-base.js +180 -0
- package/dist/git-diff-base.js.map +1 -0
- package/dist/git-worktree.d.ts +46 -6
- package/dist/git-worktree.js +46 -9
- package/dist/git-worktree.js.map +1 -1
- package/dist/handoff.d.ts +2 -2
- package/dist/handoff.js +1 -1
- package/dist/index.js +66 -8
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +69 -6
- package/dist/paths.js +86 -9
- package/dist/paths.js.map +1 -1
- package/dist/planner.d.ts +2 -2
- package/dist/planner.js +7 -1
- package/dist/planner.js.map +1 -1
- package/dist/release/manifests.d.ts +81 -0
- package/dist/release/manifests.js +74 -0
- package/dist/release/manifests.js.map +1 -0
- package/dist/release/snapshot.d.ts +9 -23
- package/dist/release/snapshot.js +9 -22
- package/dist/release/snapshot.js.map +1 -1
- package/dist/release/stable.d.ts +15 -29
- package/dist/release/stable.js +14 -27
- package/dist/release/stable.js.map +1 -1
- package/dist/runs/agent-tmpdir.d.ts +41 -0
- package/dist/runs/agent-tmpdir.js +183 -0
- package/dist/runs/agent-tmpdir.js.map +1 -0
- package/dist/runs/auto-name.d.ts +1 -1
- package/dist/runs/auto-name.js +6 -1
- package/dist/runs/auto-name.js.map +1 -1
- package/dist/runs/event-history.d.ts +50 -0
- package/dist/runs/event-history.js +613 -0
- package/dist/runs/event-history.js.map +1 -0
- package/dist/runs/retention.d.ts +1 -1
- package/dist/runs/run-index.d.ts +19 -0
- package/dist/runs/run-index.js +43 -0
- package/dist/runs/run-index.js.map +1 -0
- package/dist/runs/store.d.ts +209 -344
- package/dist/runs/store.js +298 -39
- package/dist/runs/store.js.map +1 -1
- package/dist/runs/ui-event-sink.d.ts +1 -1
- package/dist/server/app-type.d.ts +21 -0
- package/dist/server/app-type.js +2 -0
- package/dist/server/app-type.js.map +1 -0
- package/dist/server/capabilities.d.ts +21 -6
- package/dist/server/capabilities.js +27 -1
- package/dist/server/capabilities.js.map +1 -1
- package/dist/server/forge/github.d.ts +58 -151
- package/dist/server/forge/github.js +530 -6
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/forge/index.d.ts +19 -3
- package/dist/server/forge/index.js +28 -1
- package/dist/server/forge/index.js.map +1 -1
- package/dist/server/forge/types.d.ts +86 -1
- package/dist/server/git-changes.d.ts +10 -8
- package/dist/server/git-changes.js +19 -17
- package/dist/server/git-changes.js.map +1 -1
- package/dist/server/git.d.ts +2 -0
- package/dist/server/git.js +9 -0
- package/dist/server/git.js.map +1 -1
- package/dist/server/github.d.ts +3 -3
- package/dist/server/github.js +1 -1
- package/dist/server/github.js.map +1 -1
- package/dist/server/open-in-app.d.ts +2 -1
- package/dist/server/open-in-app.js +3 -1
- package/dist/server/open-in-app.js.map +1 -1
- package/dist/server/open-in-terminal.d.ts +46 -1
- package/dist/server/open-in-terminal.js +72 -13
- package/dist/server/open-in-terminal.js.map +1 -1
- package/dist/server/pr.d.ts +2 -2
- package/dist/server/project-context.d.ts +20 -3
- package/dist/server/project-context.js +30 -1
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/provider-action-gate.d.ts +8 -0
- package/dist/server/provider-action-gate.js +56 -0
- package/dist/server/provider-action-gate.js.map +1 -0
- package/dist/server/provider-auth-runtime.d.ts +21 -0
- package/dist/server/provider-auth-runtime.js +66 -0
- package/dist/server/provider-auth-runtime.js.map +1 -0
- package/dist/server/server.d.ts +12802 -47
- package/dist/server/server.js +2857 -949
- package/dist/server/server.js.map +1 -1
- package/dist/server/validators.d.ts +97 -0
- package/dist/server/validators.js +86 -0
- package/dist/server/validators.js.map +1 -0
- package/dist/server/ws.d.ts +2 -2
- package/dist/server/ws.js +2 -2
- package/dist/server/ws.js.map +1 -1
- package/dist/server-install/engine.d.ts +1 -1
- package/dist/server-install/engine.js +5 -18
- package/dist/server-install/engine.js.map +1 -1
- package/dist/server-install/platforms/macosx-ngrok.d.ts +1 -1
- package/dist/server-install/platforms/ubuntu-vps.d.ts +16 -1
- package/dist/server-install/platforms/ubuntu-vps.js +83 -1
- package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
- package/dist/server-install/state.d.ts +1 -1
- package/dist/server-install/steps.d.ts +2 -2
- package/dist/server-install/steps.js +6 -2
- package/dist/server-install/steps.js.map +1 -1
- package/dist/server-install/strategies.d.ts +1 -1
- package/dist/server-install/types.d.ts +38 -424
- package/dist/server-install/ui.d.ts +1 -1
- package/dist/skills-banner.d.ts +7 -6
- package/dist/skills-banner.js +7 -6
- package/dist/skills-banner.js.map +1 -1
- package/dist/skills-remote.d.ts +2 -2
- package/dist/skills-update.d.ts +88 -0
- package/dist/skills-update.js +392 -0
- package/dist/skills-update.js.map +1 -0
- package/dist/skills.d.ts +2 -0
- package/dist/skills.js +7 -2
- package/dist/skills.js.map +1 -1
- package/dist/todos.d.ts +2 -28
- package/dist/todos.js +1 -1
- package/dist/ui-state.d.ts +16 -2
- package/dist/ui-state.js +14 -1
- package/dist/ui-state.js.map +1 -1
- package/dist/workflows/load.d.ts +1 -1
- package/dist/workflows/run.d.ts +276 -15
- package/dist/workflows/run.js +1261 -159
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/types.d.ts +62 -224
- package/dist/workflows/types.js +25 -2
- package/dist/workflows/types.js.map +1 -1
- package/dist/workspace/agent-accounts.d.ts +153 -0
- package/dist/workspace/agent-accounts.js +304 -0
- package/dist/workspace/agent-accounts.js.map +1 -0
- package/dist/workspace/agent-profiles.d.ts +78 -0
- package/dist/workspace/agent-profiles.js +115 -0
- package/dist/workspace/agent-profiles.js.map +1 -0
- package/dist/workspace/config.d.ts +94 -206
- package/dist/workspace/config.js +226 -14
- package/dist/workspace/config.js.map +1 -1
- package/dist/workspace/migrations.d.ts +1 -1
- package/dist/workspace/migrations.js +19 -4
- package/dist/workspace/migrations.js.map +1 -1
- package/dist/workspace/projects-cli.js +54 -4
- package/dist/workspace/projects-cli.js.map +1 -1
- package/dist/workspace/projects.d.ts +26 -2
- package/dist/workspace/projects.js +42 -3
- package/dist/workspace/projects.js.map +1 -1
- package/dist/workspace/semaphore.d.ts +51 -0
- package/dist/workspace/semaphore.js +53 -3
- package/dist/workspace/semaphore.js.map +1 -1
- package/dist/workspace/ui-state.d.ts +16 -5
- package/dist/workspace/ui-state.js +18 -7
- package/dist/workspace/ui-state.js.map +1 -1
- package/package.json +17 -39
- package/scripts/inline-contract.mjs +112 -0
- package/scripts/mock-claude.mjs +59 -1
- package/scripts/mock-pi-rpc.mjs +83 -0
- package/scripts/sync-readme.mjs +20 -0
- package/web/dist/assets/alert-dialog-BVs3QSmP.js +1 -0
- package/web/dist/assets/arrow-down-D7T7XuF6.js +1 -0
- package/web/dist/assets/arrow-left-B1dRFd8y.js +1 -0
- package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
- package/web/dist/assets/centered-state-DdRLYi9u.js +43 -0
- package/web/dist/assets/chevron-right-Dh0t3AL8.js +1 -0
- package/web/dist/assets/{chunk-BO2N2NFS-DtrdTCWa.js → chunk-BO2N2NFS-DE6qKn3r.js} +8 -8
- package/web/dist/assets/circle-check-4FDOlh9u.js +1 -0
- package/web/dist/assets/circle-x-CgTVbqX5.js +1 -0
- package/web/dist/assets/collapsible-BoADzTok.js +1 -0
- package/web/dist/assets/commit-list-BCcCkRbU.js +1 -0
- package/web/dist/assets/compare-variants-B7gTgGqR.js +1 -0
- package/web/dist/assets/{core-DePtBHcl.js → core-BCsw8oQw.js} +1 -1
- package/web/dist/assets/diff-ecfV3-op.js +3 -0
- package/web/dist/assets/diff-stat-C2KGLVnZ.js +1 -0
- package/web/dist/assets/{diff-view-DCeSegKk.js → diff-view-CQtonQ4L.js} +4 -4
- package/web/dist/assets/dropdown-menu-WcGoirf2.js +1 -0
- package/web/dist/assets/editable-title-SqNK-wuI.js +1 -0
- package/web/dist/assets/{ellipsis-vertical-CNnSLn5a.js → ellipsis-vertical-ClTFrwit.js} +1 -1
- package/web/dist/assets/{file-D4GBh1ao.js → file-BU0mWida.js} +1 -1
- package/web/dist/assets/folder-rsgCF0aw.js +1 -0
- package/web/dist/assets/{git-pull-request-DnR8Xh4_.js → git-pull-request-BFhIKb83.js} +1 -1
- package/web/dist/assets/git-toolbar-CF1_tzqz.js +1 -0
- package/web/dist/assets/github-CyjPz-Ks.js +1 -0
- package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
- package/web/dist/assets/highlighter-CdHqIwFr.js +3 -0
- package/web/dist/assets/image-preview-iEzCyEmz.js +1 -0
- package/web/dist/assets/index-BN09RpYY.css +2 -0
- package/web/dist/assets/index-CyG7aE1W.js +7 -0
- package/web/dist/assets/lib-BQXq3kEf.js +1 -0
- package/web/dist/assets/lib-BxQXEXDF.js +1 -0
- package/web/dist/assets/markdown-CNAa22LB.js +2 -0
- package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
- package/web/dist/assets/new-task-form-CWhQZbsX.js +1 -0
- package/web/dist/assets/pill-BO5s2x3N.js +1 -0
- package/web/dist/assets/project-router-Dm4OhAPE.js +1 -0
- package/web/dist/assets/prompt-templates-CP__OCDQ.js +15 -0
- package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
- package/web/dist/assets/{refresh-cw-BT8E96Tm.js → refresh-cw-DyiysCoP.js} +1 -1
- package/web/dist/assets/repo-git-B1WM6N8T.js +1 -0
- package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
- package/web/dist/assets/run-diff-CKx4d9Oo.js +3 -0
- package/web/dist/assets/run-header-DpbfOtNi.js +1 -0
- package/web/dist/assets/{search-x-BDjaMrzG.js → search-x-DRvk-6x4.js} +1 -1
- package/web/dist/assets/skill-empty-hint-D5vsHfMr.js +1 -0
- package/web/dist/assets/skills-BiWfHmCR.js +1 -0
- package/web/dist/assets/skills-XGltyIJ_.js +1 -0
- package/web/dist/assets/sparkles-BugkDxWO.js +1 -0
- package/web/dist/assets/{square-terminal-Ckjjn0vb.js → square-terminal-Drp2h-o8.js} +1 -1
- package/web/dist/assets/tab-link-CiRLRlnY.js +1 -0
- package/web/dist/assets/task-changes-C2hKkEtc.js +1 -0
- package/web/dist/assets/task-commits-CwGs_Opa.js +1 -0
- package/web/dist/assets/task-files-5KUgFzX3.js +2 -0
- package/web/dist/assets/task-thread-B3AFO3SS.js +9 -0
- package/web/dist/assets/textarea-Dn90Eun6.js +1 -0
- package/web/dist/assets/thread-loading-_1hPuk76.js +1 -0
- package/web/dist/assets/{trash-2-DAyZ0VSi.js → trash-2-BKEc5Sp2.js} +1 -1
- package/web/dist/assets/{triangle-alert-Uy8rokUh.js → triangle-alert-BGGPY2C2.js} +1 -1
- package/web/dist/assets/{upload-CDdyPPo_.js → upload-B0AQw-mO.js} +1 -1
- package/web/dist/assets/use-desktop-CegyTp3X.js +1 -0
- package/web/dist/assets/use-submit-shortcut-Mle-9uJp.js +1 -0
- package/web/dist/assets/utils-D9GHDNza.js +64 -0
- package/web/dist/assets/workflows-3PCz57Z6.js +11 -0
- package/web/dist/assets/zoomable-image-DTq7s8CZ.js +1 -0
- package/web/dist/index.html +33 -13
- package/scripts/dev.mjs +0 -74
- package/scripts/release-snapshot.mjs +0 -130
- package/scripts/release.mjs +0 -119
- package/web/dist/assets/arrow-left-CnSdp92h.js +0 -1
- package/web/dist/assets/bundle-mjs-BegPhL5c.js +0 -1
- package/web/dist/assets/centered-state-DOsTcJZF.js +0 -43
- package/web/dist/assets/commit-list-BrxBEzRK.js +0 -1
- package/web/dist/assets/compare-variants-Bv2c9ORF.js +0 -1
- package/web/dist/assets/dist-B6XQOhgM.js +0 -1
- package/web/dist/assets/git-toolbar-pIC1ubPM.js +0 -1
- package/web/dist/assets/github-DTTSG0ht.js +0 -1
- package/web/dist/assets/highlighted-body-OFNGDK62-BuFJwunK.js +0 -1
- package/web/dist/assets/image-preview-DEhW0TFz.js +0 -1
- package/web/dist/assets/index-Cijmlz7q.js +0 -30
- package/web/dist/assets/index-DzroxqBG.css +0 -2
- package/web/dist/assets/lib-DPEZDBUN.js +0 -1
- package/web/dist/assets/lib-uHpeUPzK.js +0 -1
- package/web/dist/assets/mermaid-GHXKKRXX-CN2zQue0.js +0 -1
- package/web/dist/assets/open-mercato-toBr6SOa.svg +0 -11
- package/web/dist/assets/project-router-BMx4e8m-.js +0 -1
- package/web/dist/assets/repo-git-BusYfa3t.js +0 -1
- package/web/dist/assets/run-diff-wOJ3odA-.js +0 -3
- package/web/dist/assets/run-header-Cg5incil.js +0 -1
- package/web/dist/assets/skill-empty-hint-DTUSp6Vl.js +0 -1
- package/web/dist/assets/skills-PpP2owbM.js +0 -1
- package/web/dist/assets/tab-link-F3uQrdm2.js +0 -1
- package/web/dist/assets/task-changes-iD9kS79I.js +0 -1
- package/web/dist/assets/task-commits-COkLaUri.js +0 -1
- package/web/dist/assets/task-files-Ckttz7XH.js +0 -2
- package/web/dist/assets/task-thread-CQD91VPt.js +0 -9
- package/web/dist/assets/textarea-Bj_LCreg.js +0 -1
- package/web/dist/assets/use-desktop-DUh0STzq.js +0 -3
- package/web/dist/assets/utils-B8s5qIcK.js +0 -1
- package/web/dist/assets/workflows-BFk8C0co.js +0 -11
- package/web/dist/assets/zoomable-image-PEDOqyLQ.js +0 -1
- /package/web/{open-mercato.svg → dist/open-mercato.svg} +0 -0
package/dist/paths.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentHomePaths } from './agent-config/catalog.
|
|
1
|
+
import type { AgentHomePaths } from './agent-config/catalog.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Per-user cezar home. Literal `~/.cezar` on every platform (no XDG, no
|
|
4
4
|
* `%LOCALAPPDATA%` branch) — one rule, and it matches how the existing cache
|
|
@@ -10,7 +10,22 @@ import type { AgentHomePaths } from './agent-config/catalog.js';
|
|
|
10
10
|
* first writer owns the file, later specs import it. Do not duplicate this
|
|
11
11
|
* homedir logic elsewhere.
|
|
12
12
|
*/
|
|
13
|
-
export declare function cezarHomeDir(): string;
|
|
13
|
+
export declare function cezarHomeDir(env?: NodeJS.ProcessEnv): string;
|
|
14
|
+
/**
|
|
15
|
+
* The last line of defence for the developer's own `~/.cezar` while the suite
|
|
16
|
+
* runs. Every workspace test pins `CEZ_HOME` to a temp dir, but the pin lives
|
|
17
|
+
* in `process.env` — a single global for the whole worker. A test that ends
|
|
18
|
+
* before its write does (a timeout is enough) has its `afterEach` drop the pin
|
|
19
|
+
* while the write is still in flight, and the write then resolves the REAL
|
|
20
|
+
* home and replaces the developer's project registry with the fixture's.
|
|
21
|
+
*
|
|
22
|
+
* So writers into the cezar home ask here first: under vitest, a write whose
|
|
23
|
+
* destination is the real `~/.cezar` is always a leaked test, never intent —
|
|
24
|
+
* fail it loudly instead of rewriting a file the suite does not own. Outside
|
|
25
|
+
* vitest this is a no-op, and an explicitly pinned `CEZ_HOME` (the temp dir the
|
|
26
|
+
* test meant to use) never matches the real home, so honest tests are unaffected.
|
|
27
|
+
*/
|
|
28
|
+
export declare function assertCezarHomeWriteIsSandboxed(path: string, env?: NodeJS.ProcessEnv): void;
|
|
14
29
|
/**
|
|
15
30
|
* The default server-install instance id. An install with no `--domain` (the
|
|
16
31
|
* original single-cockpit-per-host flow) is this instance, and it keeps the
|
|
@@ -45,13 +60,28 @@ export declare function serverStatePath(instance?: string): string;
|
|
|
45
60
|
* been booted in. Lives directly under `cezarHomeDir()`, so the `CEZ_HOME`
|
|
46
61
|
* override applies (tests/containers never touch a real home dir).
|
|
47
62
|
*/
|
|
48
|
-
export declare function workspaceConfigPath(): string;
|
|
63
|
+
export declare function workspaceConfigPath(env?: NodeJS.ProcessEnv): string;
|
|
49
64
|
/**
|
|
50
65
|
* Global GUI state — the workspace twin of the per-repo
|
|
51
66
|
* `.ai/cezar/ui-state.json`. Cross-project UI prefs live here; per-project
|
|
52
67
|
* state (pinned runs, templates) stays in each repo's file.
|
|
53
68
|
*/
|
|
54
69
|
export declare function workspaceUiStatePath(): string;
|
|
70
|
+
/**
|
|
71
|
+
* Agent accounts — extra config dirs for a second login of the same agent CLI, plus which one
|
|
72
|
+
* each project uses (spec `2026-07-29-agent-profiles.md`).
|
|
73
|
+
*
|
|
74
|
+
* Its OWN file rather than a key in `config.json`, and that is the whole point: a cezar version
|
|
75
|
+
* that has never heard of accounts does not open this file, so it cannot drop them. Living in
|
|
76
|
+
* `config.json` made their survival depend on a `.passthrough()` in *another version's* source —
|
|
77
|
+
* a guarantee this repo cannot make on behalf of a build the user might switch to, and one that
|
|
78
|
+
* evaporates entirely the moment any version fails to parse that file and degrades to defaults
|
|
79
|
+
* (the next merge-write then rewrites it without them).
|
|
80
|
+
*
|
|
81
|
+
* The per-project selections live here too, beside the accounts they name, so deleting an account
|
|
82
|
+
* and scrubbing every reference to it stays ONE atomic write.
|
|
83
|
+
*/
|
|
84
|
+
export declare function agentAccountsPath(): string;
|
|
55
85
|
/**
|
|
56
86
|
* Expand a leading `~` to the user's home. Lives here with the other homedir
|
|
57
87
|
* logic (see the module note above — one place owns `homedir()`): the
|
|
@@ -70,8 +100,41 @@ export declare function expandTilde(path: string): string;
|
|
|
70
100
|
export declare function serverLockPath(instance?: string): string;
|
|
71
101
|
/**
|
|
72
102
|
* Where each coding agent keeps its per-user config, honouring the env vars the
|
|
73
|
-
* vendors document: `$
|
|
74
|
-
* relocates
|
|
75
|
-
*
|
|
103
|
+
* vendors document: `$CLAUDE_CONFIG_DIR` relocates Claude Code's home;
|
|
104
|
+
* `$CODEX_HOME` relocates Codex's; `$XDG_CONFIG_HOME` relocates OpenCode's config
|
|
105
|
+
* dir (falling back to `~/.config`). Read per call so tests and ops can set env live.
|
|
106
|
+
*
|
|
107
|
+
* These are the DEFAULT profile's dirs. A second login of the same CLI is an
|
|
108
|
+
* agent profile (`src/core/agent-profiles.ts`) and resolves through
|
|
109
|
+
* `agentHomePathsForProfiles` instead — what this function answers is what the
|
|
110
|
+
* host is configured for when nothing overrides it.
|
|
76
111
|
*/
|
|
77
112
|
export declare function agentHomePaths(env?: NodeJS.ProcessEnv): AgentHomePaths;
|
|
113
|
+
/**
|
|
114
|
+
* Where Claude Code keeps `.claude.json` — its MCP/state file — for a given config dir. The
|
|
115
|
+
* location is NOT uniform: by default the file is a SIBLING of `~/.claude`, but under a
|
|
116
|
+
* `CLAUDE_CONFIG_DIR` override it moves INSIDE the overridden dir (verified against the shipped CLI
|
|
117
|
+
* 2026-07-29, and against a real second-account dir on disk). Reading it from `dirname(configDir)`
|
|
118
|
+
* unconditionally — as this repo did — lands on `~/.claude.json` for a `~/.claude-klaudiusz`
|
|
119
|
+
* profile, i.e. the wrong account's file.
|
|
120
|
+
*
|
|
121
|
+
* The condition below reads like two heuristics OR-ed together; it is one exact rule. The file sits
|
|
122
|
+
* inside precisely when the CLI will SEE `CLAUDE_CONFIG_DIR` for this dir, and cezar knows when
|
|
123
|
+
* that is:
|
|
124
|
+
*
|
|
125
|
+
* - a stored account is always spawned with it (`profileEnv`), and its dir is by construction not
|
|
126
|
+
* `~/.claude` — the route refuses a dir that is already the discovered account's;
|
|
127
|
+
* - the DISCOVERED account is spawned with nothing added, so it sees the variable only when the
|
|
128
|
+
* cezar process itself carries one — and it does reach the child, because `CLAUDE_` is in
|
|
129
|
+
* `BACKEND_ALLOW_PREFIXES`.
|
|
130
|
+
*
|
|
131
|
+
* One case is worth naming because it looks like a bug and is not. Start cezar with
|
|
132
|
+
* `CLAUDE_CONFIG_DIR=/opt/work` and add `~/.claude` as a NAMED account (legal — the discovered
|
|
133
|
+
* account is `/opt/work`, so `~/.claude` is not a duplicate). This answers `~/.claude/.claude.json`,
|
|
134
|
+
* not the sibling `~/.claude.json`, and "Show details" can therefore say "not signed in" for a
|
|
135
|
+
* folder a bare `claude` would treat as signed in. That is correct rather than unfortunate: cezar
|
|
136
|
+
* will run that account as `CLAUDE_CONFIG_DIR=~/.claude claude`, and under that invocation the
|
|
137
|
+
* state file the CLI reads and writes IS the one inside. Reporting the sibling would describe a
|
|
138
|
+
* login this account will never use.
|
|
139
|
+
*/
|
|
140
|
+
export declare function claudeStateFilePath(claudeHome: string, env?: NodeJS.ProcessEnv): string;
|
package/dist/paths.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { homedir } from 'node:os';
|
|
2
|
-
import { join } from 'node:path';
|
|
2
|
+
import { dirname, join, sep } from 'node:path';
|
|
3
3
|
/**
|
|
4
4
|
* Per-user cezar home. Literal `~/.cezar` on every platform (no XDG, no
|
|
5
5
|
* `%LOCALAPPDATA%` branch) — one rule, and it matches how the existing cache
|
|
@@ -11,10 +11,33 @@ import { join } from 'node:path';
|
|
|
11
11
|
* first writer owns the file, later specs import it. Do not duplicate this
|
|
12
12
|
* homedir logic elsewhere.
|
|
13
13
|
*/
|
|
14
|
-
export function cezarHomeDir() {
|
|
14
|
+
export function cezarHomeDir(env = process.env) {
|
|
15
15
|
// `|| undefined` so an EMPTY CEZ_HOME (e.g. `CEZ_HOME= cezar …`) falls back
|
|
16
16
|
// to the default instead of yielding relative paths in the cwd.
|
|
17
|
-
return (
|
|
17
|
+
return (env.CEZ_HOME || undefined) ?? join(homedir(), '.cezar');
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The last line of defence for the developer's own `~/.cezar` while the suite
|
|
21
|
+
* runs. Every workspace test pins `CEZ_HOME` to a temp dir, but the pin lives
|
|
22
|
+
* in `process.env` — a single global for the whole worker. A test that ends
|
|
23
|
+
* before its write does (a timeout is enough) has its `afterEach` drop the pin
|
|
24
|
+
* while the write is still in flight, and the write then resolves the REAL
|
|
25
|
+
* home and replaces the developer's project registry with the fixture's.
|
|
26
|
+
*
|
|
27
|
+
* So writers into the cezar home ask here first: under vitest, a write whose
|
|
28
|
+
* destination is the real `~/.cezar` is always a leaked test, never intent —
|
|
29
|
+
* fail it loudly instead of rewriting a file the suite does not own. Outside
|
|
30
|
+
* vitest this is a no-op, and an explicitly pinned `CEZ_HOME` (the temp dir the
|
|
31
|
+
* test meant to use) never matches the real home, so honest tests are unaffected.
|
|
32
|
+
*/
|
|
33
|
+
export function assertCezarHomeWriteIsSandboxed(path, env = process.env) {
|
|
34
|
+
if (!env.VITEST)
|
|
35
|
+
return;
|
|
36
|
+
const realHome = join(homedir(), '.cezar');
|
|
37
|
+
if (path !== realHome && !path.startsWith(realHome + sep))
|
|
38
|
+
return;
|
|
39
|
+
throw new Error(`[cez] refusing to write ${path} from a test run — CEZ_HOME is not pinned to a sandbox. ` +
|
|
40
|
+
'Pin it (the vitest setup file does this by default) so the suite never touches the real cezar home.');
|
|
18
41
|
}
|
|
19
42
|
/**
|
|
20
43
|
* The default server-install instance id. An install with no `--domain` (the
|
|
@@ -62,8 +85,8 @@ export function serverStatePath(instance = DEFAULT_SERVER_INSTANCE) {
|
|
|
62
85
|
* been booted in. Lives directly under `cezarHomeDir()`, so the `CEZ_HOME`
|
|
63
86
|
* override applies (tests/containers never touch a real home dir).
|
|
64
87
|
*/
|
|
65
|
-
export function workspaceConfigPath() {
|
|
66
|
-
return join(cezarHomeDir(), 'config.json');
|
|
88
|
+
export function workspaceConfigPath(env = process.env) {
|
|
89
|
+
return join(cezarHomeDir(env), 'config.json');
|
|
67
90
|
}
|
|
68
91
|
/**
|
|
69
92
|
* Global GUI state — the workspace twin of the per-repo
|
|
@@ -73,6 +96,23 @@ export function workspaceConfigPath() {
|
|
|
73
96
|
export function workspaceUiStatePath() {
|
|
74
97
|
return join(cezarHomeDir(), 'ui-state.json');
|
|
75
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Agent accounts — extra config dirs for a second login of the same agent CLI, plus which one
|
|
101
|
+
* each project uses (spec `2026-07-29-agent-profiles.md`).
|
|
102
|
+
*
|
|
103
|
+
* Its OWN file rather than a key in `config.json`, and that is the whole point: a cezar version
|
|
104
|
+
* that has never heard of accounts does not open this file, so it cannot drop them. Living in
|
|
105
|
+
* `config.json` made their survival depend on a `.passthrough()` in *another version's* source —
|
|
106
|
+
* a guarantee this repo cannot make on behalf of a build the user might switch to, and one that
|
|
107
|
+
* evaporates entirely the moment any version fails to parse that file and degrades to defaults
|
|
108
|
+
* (the next merge-write then rewrites it without them).
|
|
109
|
+
*
|
|
110
|
+
* The per-project selections live here too, beside the accounts they name, so deleting an account
|
|
111
|
+
* and scrubbing every reference to it stays ONE atomic write.
|
|
112
|
+
*/
|
|
113
|
+
export function agentAccountsPath() {
|
|
114
|
+
return join(cezarHomeDir(), 'agent-accounts.json');
|
|
115
|
+
}
|
|
76
116
|
/**
|
|
77
117
|
* Expand a leading `~` to the user's home. Lives here with the other homedir
|
|
78
118
|
* logic (see the module note above — one place owns `homedir()`): the
|
|
@@ -99,17 +139,54 @@ export function serverLockPath(instance = DEFAULT_SERVER_INSTANCE) {
|
|
|
99
139
|
}
|
|
100
140
|
/**
|
|
101
141
|
* Where each coding agent keeps its per-user config, honouring the env vars the
|
|
102
|
-
* vendors document: `$
|
|
103
|
-
* relocates
|
|
104
|
-
*
|
|
142
|
+
* vendors document: `$CLAUDE_CONFIG_DIR` relocates Claude Code's home;
|
|
143
|
+
* `$CODEX_HOME` relocates Codex's; `$XDG_CONFIG_HOME` relocates OpenCode's config
|
|
144
|
+
* dir (falling back to `~/.config`). Read per call so tests and ops can set env live.
|
|
145
|
+
*
|
|
146
|
+
* These are the DEFAULT profile's dirs. A second login of the same CLI is an
|
|
147
|
+
* agent profile (`src/core/agent-profiles.ts`) and resolves through
|
|
148
|
+
* `agentHomePathsForProfiles` instead — what this function answers is what the
|
|
149
|
+
* host is configured for when nothing overrides it.
|
|
105
150
|
*/
|
|
106
151
|
export function agentHomePaths(env = process.env) {
|
|
107
152
|
const home = env.HOME || env.USERPROFILE || homedir();
|
|
108
153
|
const xdgConfig = env.XDG_CONFIG_HOME?.trim() || join(home, '.config');
|
|
109
154
|
return {
|
|
110
|
-
claude: join(home, '.claude'),
|
|
155
|
+
claude: env.CLAUDE_CONFIG_DIR?.trim() || join(home, '.claude'),
|
|
111
156
|
codex: env.CODEX_HOME?.trim() || join(home, '.codex'),
|
|
112
157
|
opencodeConfig: join(xdgConfig, 'opencode'),
|
|
113
158
|
};
|
|
114
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Where Claude Code keeps `.claude.json` — its MCP/state file — for a given config dir. The
|
|
162
|
+
* location is NOT uniform: by default the file is a SIBLING of `~/.claude`, but under a
|
|
163
|
+
* `CLAUDE_CONFIG_DIR` override it moves INSIDE the overridden dir (verified against the shipped CLI
|
|
164
|
+
* 2026-07-29, and against a real second-account dir on disk). Reading it from `dirname(configDir)`
|
|
165
|
+
* unconditionally — as this repo did — lands on `~/.claude.json` for a `~/.claude-klaudiusz`
|
|
166
|
+
* profile, i.e. the wrong account's file.
|
|
167
|
+
*
|
|
168
|
+
* The condition below reads like two heuristics OR-ed together; it is one exact rule. The file sits
|
|
169
|
+
* inside precisely when the CLI will SEE `CLAUDE_CONFIG_DIR` for this dir, and cezar knows when
|
|
170
|
+
* that is:
|
|
171
|
+
*
|
|
172
|
+
* - a stored account is always spawned with it (`profileEnv`), and its dir is by construction not
|
|
173
|
+
* `~/.claude` — the route refuses a dir that is already the discovered account's;
|
|
174
|
+
* - the DISCOVERED account is spawned with nothing added, so it sees the variable only when the
|
|
175
|
+
* cezar process itself carries one — and it does reach the child, because `CLAUDE_` is in
|
|
176
|
+
* `BACKEND_ALLOW_PREFIXES`.
|
|
177
|
+
*
|
|
178
|
+
* One case is worth naming because it looks like a bug and is not. Start cezar with
|
|
179
|
+
* `CLAUDE_CONFIG_DIR=/opt/work` and add `~/.claude` as a NAMED account (legal — the discovered
|
|
180
|
+
* account is `/opt/work`, so `~/.claude` is not a duplicate). This answers `~/.claude/.claude.json`,
|
|
181
|
+
* not the sibling `~/.claude.json`, and "Show details" can therefore say "not signed in" for a
|
|
182
|
+
* folder a bare `claude` would treat as signed in. That is correct rather than unfortunate: cezar
|
|
183
|
+
* will run that account as `CLAUDE_CONFIG_DIR=~/.claude claude`, and under that invocation the
|
|
184
|
+
* state file the CLI reads and writes IS the one inside. Reporting the sibling would describe a
|
|
185
|
+
* login this account will never use.
|
|
186
|
+
*/
|
|
187
|
+
export function claudeStateFilePath(claudeHome, env = process.env) {
|
|
188
|
+
const seesOverride = (env.CLAUDE_CONFIG_DIR?.trim() || '') !== ''
|
|
189
|
+
|| claudeHome !== join(env.HOME || env.USERPROFILE || homedir(), '.claude');
|
|
190
|
+
return seesOverride ? join(claudeHome, '.claude.json') : join(dirname(claudeHome), '.claude.json');
|
|
191
|
+
}
|
|
115
192
|
//# sourceMappingURL=paths.js.map
|
package/dist/paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAG/C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;IAC/D,4EAA4E;IAC5E,gEAAgE;IAChE,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,SAAS,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,M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,UAAU,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;QACrD,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;KAC5C,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB,EAAE,GAAG,GAAsB,OAAO,CAAC,GAAG;IAC1F,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE;WAC5D,UAAU,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,WAAW,IAAI,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IAC9E,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC,CAAC;AACrG,CAAC"}
|
package/dist/planner.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type WorkflowStepDef } from './workflows/types.
|
|
2
|
+
import { type WorkflowStepDef } from './workflows/types.ts';
|
|
3
3
|
export interface PlanResult {
|
|
4
4
|
/** The proposed workflow title (kebab-case slug), when the planner named one. The auto chain
|
|
5
5
|
* creator pre-fills the builder's name field with it. Absent on the degraded fallback. */
|
|
@@ -24,4 +24,4 @@ export declare function proposeWorkflowName(raw: string | undefined): string | u
|
|
|
24
24
|
* then scan for balanced top-level `{...}` blocks and return the first that
|
|
25
25
|
* validates. Null when nothing does — the caller decides how to recover.
|
|
26
26
|
*/
|
|
27
|
-
export declare function parseStructured<T>(raw: string, schema: z.ZodType<T,
|
|
27
|
+
export declare function parseStructured<T>(raw: string, schema: z.ZodType<T, unknown>): T | null;
|
package/dist/planner.js
CHANGED
|
@@ -4,6 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
import { createRunner } from './core/runner-factory.js';
|
|
5
5
|
import { loadConfig } from './config.js';
|
|
6
6
|
import { discoverSkills } from './skills.js';
|
|
7
|
+
import { resolveProfileEnvForRoot } from './workspace/agent-profiles.js';
|
|
7
8
|
import { workflowStepSchema } from './workflows/types.js';
|
|
8
9
|
/**
|
|
9
10
|
* Chain-from-prompt (spec 008): one cheap `claude` call turns the user's task
|
|
@@ -46,6 +47,10 @@ export async function planChain(repoRoot, task) {
|
|
|
46
47
|
// OpenCode pick their own default model instead.
|
|
47
48
|
const runner = createRunner(config.defaultRunner);
|
|
48
49
|
const plannerModel = config.defaultRunner === 'claude' ? config.plannerModel : undefined;
|
|
50
|
+
// Plan under the SAME agent account this project's tasks run on (spec
|
|
51
|
+
// 2026-07-29-agent-profiles). Without this the planner would quietly bill the personal
|
|
52
|
+
// subscription for a project the user pointed at their work account.
|
|
53
|
+
const { env: profileEnv } = await resolveProfileEnvForRoot(repoRoot, config.defaultRunner);
|
|
49
54
|
// One retry on an unparseable answer; a runner error goes straight to fallback.
|
|
50
55
|
for (let attempt = 0; attempt < 2; attempt++) {
|
|
51
56
|
let text;
|
|
@@ -55,6 +60,7 @@ export async function planChain(repoRoot, task) {
|
|
|
55
60
|
userPrompt,
|
|
56
61
|
cwd: repoRoot,
|
|
57
62
|
allowedTools: [],
|
|
63
|
+
...(Object.keys(profileEnv).length > 0 ? { env: profileEnv } : {}),
|
|
58
64
|
model: plannerModel,
|
|
59
65
|
timeoutMs: PLANNER_TIMEOUT_MS,
|
|
60
66
|
});
|
|
@@ -106,7 +112,7 @@ function buildPlannerPrompt(task, skills, verifyCommands) {
|
|
|
106
112
|
*/
|
|
107
113
|
async function detectVerifyCommands(repoRoot) {
|
|
108
114
|
const out = [];
|
|
109
|
-
const pkgSchema = z.object({ scripts: z.record(z.string()).default({}) });
|
|
115
|
+
const pkgSchema = z.object({ scripts: z.record(z.string(), z.string()).default({}) });
|
|
110
116
|
try {
|
|
111
117
|
const raw = JSON.parse(await readFile(join(repoRoot, 'package.json'), 'utf8'));
|
|
112
118
|
const pkg = pkgSchema.safeParse(raw);
|
package/dist/planner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner.js","sourceRoot":"","sources":["../src/planner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAc,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAwB,MAAM,sBAAsB,CAAC;AAEhF;;;;;;GAMG;AAEH,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,MAAM,qBAAqB,GACzB,gGAAgG;IAChG,oHAAoH;IACpH,mGAAmG;IACnG,kGAAkG;IAClG,kGAAkG;IAClG,wDAAwD,CAAC;AAE3D,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,oGAAoG;IACpG,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,CAAC;SACL,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACvB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC,CACH;SACA,GAAG,CAAC,CAAC,CAAC;SAC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AI,EAAE,KAAK,GAAG,EAAE,CAAC;YACtB,IAAI,KAAK,KAAK,CAAC;gBAAE,SAAS;YAC1B,KAAK,EAAE,CAAC;YACR,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;gBAC9B,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACzC,KAAK,GAAG,CAAC,CAAC,CAAC;YACb,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/** The manifest arithmetic both release channels share — the pure half of stamping.
|
|
2
|
+
*
|
|
3
|
+
* `stable.ts` and `snapshot.ts` differ in exactly one decision (how a released package pins
|
|
4
|
+
* its sibling: a caret range for stable, an exact pin for a snapshot), so everything else
|
|
5
|
+
* lives here rather than twice.
|
|
6
|
+
*
|
|
7
|
+
* Deliberately name-agnostic: names come from the checked-out manifests at call time, never
|
|
8
|
+
* from constants, so a package rename lands without touching this pipeline.
|
|
9
|
+
*/
|
|
10
|
+
/** The minimal manifest shape the stamper touches; everything else passes through. */
|
|
11
|
+
export interface ManifestLike {
|
|
12
|
+
name: string;
|
|
13
|
+
version: string;
|
|
14
|
+
/** npm's own opt-out. A private package is still versioned in lockstep, never published. */
|
|
15
|
+
private?: boolean;
|
|
16
|
+
dependencies?: Record<string, string>;
|
|
17
|
+
devDependencies?: Record<string, string>;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Whether a release stamps AND publishes this package, or only stamps it.
|
|
22
|
+
*
|
|
23
|
+
* The distinction exists because "in the release" and "on the registry" are different things.
|
|
24
|
+
* A package that ships nowhere yet still needs its version moved in lockstep: the api-client is
|
|
25
|
+
* the worked example — the service pins it, so a frozen version would leave that range pointing
|
|
26
|
+
* at a build the release was not cut from, which is exactly the drift this pipeline exists to
|
|
27
|
+
* prevent. Publishing is gated on npm's own `private` flag rather than a list here, so opening
|
|
28
|
+
* a package up is one line in ITS manifest and no change to the release code.
|
|
29
|
+
*/
|
|
30
|
+
export declare function isPublishable(pkg: ManifestLike): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Every manifest a release stamps.
|
|
33
|
+
*
|
|
34
|
+
* The order of the fields is the order they must be PUBLISHED in, because each one depends on
|
|
35
|
+
* the one before it: the alias is a bin-shim over the service, and the service (from the phase
|
|
36
|
+
* where it stops merely testing against the client and starts importing it) depends on the
|
|
37
|
+
* api-client. Publishing the dependent first would briefly advertise a version of its
|
|
38
|
+
* dependency that does not exist on the registry yet.
|
|
39
|
+
*/
|
|
40
|
+
export interface ReleaseManifests {
|
|
41
|
+
/**
|
|
42
|
+
* The API contract (zod schemas + inferred types). FIRST in the stamped set because both the
|
|
43
|
+
* api-client and the service depend on it, so its version has to settle before their pins are
|
|
44
|
+
* rewritten. Like the api-client it is `private`, so it is stamped but never published — which
|
|
45
|
+
* is exactly why the service cannot simply depend on it at runtime: `packages/cezar/scripts/
|
|
46
|
+
* inline-contract.mjs` folds it into `dist/contract/` at build time instead. It moves to a real
|
|
47
|
+
* publish the day that script is deleted.
|
|
48
|
+
*/
|
|
49
|
+
contract: ManifestLike;
|
|
50
|
+
/** The contract package a consumer installs to talk to a cezar service. */
|
|
51
|
+
apiClient: ManifestLike;
|
|
52
|
+
/** The published service + CLI. */
|
|
53
|
+
cezar: ManifestLike;
|
|
54
|
+
/** The unscoped bin alias, so `npx cezar-cli` works. */
|
|
55
|
+
alias: ManifestLike;
|
|
56
|
+
}
|
|
57
|
+
/** How a released package pins a sibling it depends on. */
|
|
58
|
+
export type PinStyle = (version: string) => string;
|
|
59
|
+
/**
|
|
60
|
+
* Rewrite `pkg`'s range for `depName`, in whichever dependency section already declares it.
|
|
61
|
+
*
|
|
62
|
+
* Absent means absent: a package that does not depend on the other is returned untouched. That
|
|
63
|
+
* is what lets the api-client dependency migrate from `devDependencies` (today: only the tests
|
|
64
|
+
* import it) to `dependencies` (once the service imports its DTOs at runtime) without the
|
|
65
|
+
* release pipeline needing to know it happened.
|
|
66
|
+
*/
|
|
67
|
+
export declare function pinDependency(pkg: ManifestLike, depName: string, range: string): ManifestLike;
|
|
68
|
+
/**
|
|
69
|
+
* Stamp every manifest to `version` and re-pin the intra-release dependencies.
|
|
70
|
+
*
|
|
71
|
+
* Two pins, both derived from the manifests rather than hardcoded:
|
|
72
|
+
* - the alias → the service, so `npx <alias>@<v>` runs the matching CLI;
|
|
73
|
+
* - the service → the api-client, so a published service can never resolve a client build it
|
|
74
|
+
* was not released with.
|
|
75
|
+
*
|
|
76
|
+
* The alias also inherits `repository`/`homepage`/`bugs` from the service manifest: we publish
|
|
77
|
+
* with `--provenance`, and npm rejects (E422) any manifest whose `repository.url` does not
|
|
78
|
+
* match the building repo. The alias file carries none of its own, so it borrows the
|
|
79
|
+
* service's — already correct, and being a git URL, unaffected by any npm-name rename.
|
|
80
|
+
*/
|
|
81
|
+
export declare function stampManifestSet(manifests: ReleaseManifests, version: string, pin: PinStyle): ReleaseManifests;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** The manifest arithmetic both release channels share — the pure half of stamping.
|
|
2
|
+
*
|
|
3
|
+
* `stable.ts` and `snapshot.ts` differ in exactly one decision (how a released package pins
|
|
4
|
+
* its sibling: a caret range for stable, an exact pin for a snapshot), so everything else
|
|
5
|
+
* lives here rather than twice.
|
|
6
|
+
*
|
|
7
|
+
* Deliberately name-agnostic: names come from the checked-out manifests at call time, never
|
|
8
|
+
* from constants, so a package rename lands without touching this pipeline.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Whether a release stamps AND publishes this package, or only stamps it.
|
|
12
|
+
*
|
|
13
|
+
* The distinction exists because "in the release" and "on the registry" are different things.
|
|
14
|
+
* A package that ships nowhere yet still needs its version moved in lockstep: the api-client is
|
|
15
|
+
* the worked example — the service pins it, so a frozen version would leave that range pointing
|
|
16
|
+
* at a build the release was not cut from, which is exactly the drift this pipeline exists to
|
|
17
|
+
* prevent. Publishing is gated on npm's own `private` flag rather than a list here, so opening
|
|
18
|
+
* a package up is one line in ITS manifest and no change to the release code.
|
|
19
|
+
*/
|
|
20
|
+
export function isPublishable(pkg) {
|
|
21
|
+
return pkg.private !== true;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Rewrite `pkg`'s range for `depName`, in whichever dependency section already declares it.
|
|
25
|
+
*
|
|
26
|
+
* Absent means absent: a package that does not depend on the other is returned untouched. That
|
|
27
|
+
* is what lets the api-client dependency migrate from `devDependencies` (today: only the tests
|
|
28
|
+
* import it) to `dependencies` (once the service imports its DTOs at runtime) without the
|
|
29
|
+
* release pipeline needing to know it happened.
|
|
30
|
+
*/
|
|
31
|
+
export function pinDependency(pkg, depName, range) {
|
|
32
|
+
const sections = ['dependencies', 'devDependencies', 'peerDependencies'];
|
|
33
|
+
const out = { ...pkg };
|
|
34
|
+
for (const section of sections) {
|
|
35
|
+
const deps = pkg[section];
|
|
36
|
+
if (deps && depName in deps)
|
|
37
|
+
out[section] = { ...deps, [depName]: range };
|
|
38
|
+
}
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Stamp every manifest to `version` and re-pin the intra-release dependencies.
|
|
43
|
+
*
|
|
44
|
+
* Two pins, both derived from the manifests rather than hardcoded:
|
|
45
|
+
* - the alias → the service, so `npx <alias>@<v>` runs the matching CLI;
|
|
46
|
+
* - the service → the api-client, so a published service can never resolve a client build it
|
|
47
|
+
* was not released with.
|
|
48
|
+
*
|
|
49
|
+
* The alias also inherits `repository`/`homepage`/`bugs` from the service manifest: we publish
|
|
50
|
+
* with `--provenance`, and npm rejects (E422) any manifest whose `repository.url` does not
|
|
51
|
+
* match the building repo. The alias file carries none of its own, so it borrows the
|
|
52
|
+
* service's — already correct, and being a git URL, unaffected by any npm-name rename.
|
|
53
|
+
*/
|
|
54
|
+
export function stampManifestSet(manifests, version, pin) {
|
|
55
|
+
const { contract, apiClient, cezar, alias } = manifests;
|
|
56
|
+
const range = pin(version);
|
|
57
|
+
const inherited = {};
|
|
58
|
+
for (const field of ['repository', 'homepage', 'bugs']) {
|
|
59
|
+
if (cezar[field] !== undefined)
|
|
60
|
+
inherited[field] = cezar[field];
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
contract: { ...contract, version },
|
|
64
|
+
apiClient: pinDependency({ ...apiClient, version }, contract.name, range),
|
|
65
|
+
cezar: pinDependency(pinDependency({ ...cezar, version }, apiClient.name, range), contract.name, range),
|
|
66
|
+
alias: {
|
|
67
|
+
...pinDependency({ ...alias, ...inherited, version }, cezar.name, range),
|
|
68
|
+
// The alias exists only to depend on the service — an unpinned or missing entry would
|
|
69
|
+
// make `npx <alias>` install nothing useful, so this one is asserted, not merged.
|
|
70
|
+
dependencies: { ...alias.dependencies, [cezar.name]: range },
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=manifests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifests.js","sourceRoot":"","sources":["../../src/release/manifests.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,GAAiB;IAC7C,OAAO,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC;AAC9B,CAAC;AAgCD;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,GAAiB,EAAE,OAAe,EAAE,KAAa;IAC7E,MAAM,QAAQ,GAAG,CAAC,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,CAAU,CAAC;IAClF,MAAM,GAAG,GAAiB,EAAE,GAAG,GAAG,EAAE,CAAC;IACrC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAuC,CAAC;QAChE,IA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AC,IAAI,CAAC,EAAE,KAAK,EAAE;SAC7D;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* at call time, never from constants — so the `@pat-lewczuk/cezar` →
|
|
12
12
|
* `@open-mercato/cezar` rename (PR #501) lands independently of this pipeline.
|
|
13
13
|
*/
|
|
14
|
+
import { type ReleaseManifests as ReleaseManifestSet } from './manifests.ts';
|
|
14
15
|
/** The CI facts the decision needs, straight from GitHub Actions' env/event. */
|
|
15
16
|
export interface SnapshotContext {
|
|
16
17
|
/** `GITHUB_EVENT_NAME` — only `pull_request` and `push` ever publish. */
|
|
@@ -40,30 +41,15 @@ export interface SnapshotPlan {
|
|
|
40
41
|
distTag: string;
|
|
41
42
|
}
|
|
42
43
|
export declare function computeSnapshot(ctx: SnapshotContext): SnapshotPlan | null;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
name: string;
|
|
46
|
-
version: string;
|
|
47
|
-
dependencies?: Record<string, string>;
|
|
48
|
-
[key: string]: unknown;
|
|
49
|
-
}
|
|
50
|
-
/** Stamp both manifests to the snapshot version.
|
|
51
|
-
*
|
|
52
|
-
* The alias is a bin-shim whose only dependency is the scoped package; a
|
|
53
|
-
* snapshot must pin that dependency **exact** (`0.1.5-pr482.123`, no range) so
|
|
54
|
-
* `npx <alias>@<version>` runs exactly the PR's code — a `^` range would
|
|
55
|
-
* resolve to whatever newer version exists (spec, resolved Q5). Stable
|
|
56
|
-
* releases keep their `^` range and never go through this stamper.
|
|
44
|
+
export type { ManifestLike, ReleaseManifests } from './manifests.ts';
|
|
45
|
+
/** Stamp the release set to the snapshot version.
|
|
57
46
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
export declare function stampManifests(
|
|
64
|
-
root: ManifestLike;
|
|
65
|
-
alias: ManifestLike;
|
|
66
|
-
};
|
|
47
|
+
* Every intra-release dependency is pinned **exact** (`0.1.5-pr482.123`, no range) so
|
|
48
|
+
* `npx <alias>@<version>` runs exactly the PR's code and the service resolves exactly the
|
|
49
|
+
* api-client it was cut with — a `^` range would resolve to whatever newer version exists
|
|
50
|
+
* (spec, resolved Q5). Stable releases keep their `^` range and never go through this
|
|
51
|
+
* stamper. */
|
|
52
|
+
export declare function stampManifests(manifests: ReleaseManifestSet, version: string): ReleaseManifestSet;
|
|
67
53
|
/** The copy-pasteable commands for the sticky PR comment and the step summary.
|
|
68
54
|
* Rendered from the *actual* alias package name so a future rename of the npx
|
|
69
55
|
* command can never leave stale instructions (spec, resolved Q1). */
|
package/dist/release/snapshot.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* at call time, never from constants — so the `@pat-lewczuk/cezar` →
|
|
12
12
|
* `@open-mercato/cezar` rename (PR #501) lands independently of this pipeline.
|
|
13
13
|
*/
|
|
14
|
+
import { stampManifestSet } from './manifests.js';
|
|
14
15
|
export function computeSnapshot(ctx) {
|
|
15
16
|
const channel = resolveChannel(ctx);
|
|
16
17
|
if (!channel)
|
|
@@ -48,29 +49,15 @@ function resolveChannel(ctx) {
|
|
|
48
49
|
}
|
|
49
50
|
return null;
|
|
50
51
|
}
|
|
51
|
-
/** Stamp
|
|
52
|
+
/** Stamp the release set to the snapshot version.
|
|
52
53
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
* we publish with `--provenance`, and npm rejects (E422) any manifest whose
|
|
61
|
-
* `repository.url` doesn't match the building repo. The alias file carries no
|
|
62
|
-
* such fields of its own, so it must borrow the root's — which already matches
|
|
63
|
-
* and, being a git URL, is unaffected by any npm-name rename. */
|
|
64
|
-
export function stampManifests(rootPkg, aliasPkg, version) {
|
|
65
|
-
const inherited = {};
|
|
66
|
-
for (const field of ['repository', 'homepage', 'bugs']) {
|
|
67
|
-
if (rootPkg[field] !== undefined)
|
|
68
|
-
inherited[field] = rootPkg[field];
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
root: { ...rootPkg, version },
|
|
72
|
-
alias: { ...aliasPkg, ...inherited, version, dependencies: { [rootPkg.name]: version } },
|
|
73
|
-
};
|
|
54
|
+
* Every intra-release dependency is pinned **exact** (`0.1.5-pr482.123`, no range) so
|
|
55
|
+
* `npx <alias>@<version>` runs exactly the PR's code and the service resolves exactly the
|
|
56
|
+
* api-client it was cut with — a `^` range would resolve to whatever newer version exists
|
|
57
|
+
* (spec, resolved Q5). Stable releases keep their `^` range and never go through this
|
|
58
|
+
* stamper. */
|
|
59
|
+
export function stampManifests(manifests, version) {
|
|
60
|
+
return stampManifestSet(manifests, version, (v) => v);
|
|
74
61
|
}
|
|
75
62
|
/** The copy-pasteable commands for the sticky PR comment and the step summary.
|
|
76
63
|
* Rendered from the *actual* alias package name so a future rename of the npx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../src/release/snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../src/release/snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,gBAAgB,EAA+C,MAAM,gBAAgB,CAAC;AAgC/F,MAAM,UAAU,eAAe,CAAC,GAAoB;IAClD,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,SAAS,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5F,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC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