@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
|
@@ -8,257 +8,95 @@ import { z } from 'zod';
|
|
|
8
8
|
* `{{task}}` in a prompt is replaced with the user's task text. When a check
|
|
9
9
|
* loops back, the failing output is appended to the retried agent's prompt.
|
|
10
10
|
*/
|
|
11
|
-
export declare const workflowStepSchema: z.
|
|
11
|
+
export declare const workflowStepSchema: z.ZodObject<{
|
|
12
12
|
id: z.ZodString;
|
|
13
13
|
name: z.ZodOptional<z.ZodString>;
|
|
14
14
|
prompt: z.ZodOptional<z.ZodString>;
|
|
15
15
|
skill: z.ZodOptional<z.ZodString>;
|
|
16
16
|
model: z.ZodOptional<z.ZodString>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
runner: z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
claude: "claude";
|
|
19
|
+
codex: "codex";
|
|
20
|
+
opencode: "opencode";
|
|
21
|
+
pi: "pi";
|
|
22
|
+
}>>;
|
|
23
|
+
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
|
+
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
25
|
command: z.ZodOptional<z.ZodString>;
|
|
22
26
|
onFail: z.ZodOptional<z.ZodObject<{
|
|
23
27
|
retry: z.ZodString;
|
|
24
28
|
max: z.ZodDefault<z.ZodNumber>;
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
max: number;
|
|
28
|
-
}, {
|
|
29
|
-
retry: string;
|
|
30
|
-
max?: number | undefined;
|
|
31
|
-
}>>;
|
|
32
|
-
}, "strip", z.ZodTypeAny, {
|
|
33
|
-
id: string;
|
|
34
|
-
name?: string | undefined;
|
|
35
|
-
prompt?: string | undefined;
|
|
36
|
-
skill?: string | undefined;
|
|
37
|
-
model?: string | undefined;
|
|
38
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
39
|
-
allowedTools?: string[] | undefined;
|
|
40
|
-
bashAllowlist?: string[] | undefined;
|
|
41
|
-
command?: string | undefined;
|
|
42
|
-
onFail?: {
|
|
43
|
-
retry: string;
|
|
44
|
-
max: number;
|
|
45
|
-
} | undefined;
|
|
46
|
-
}, {
|
|
47
|
-
id: string;
|
|
48
|
-
name?: string | undefined;
|
|
49
|
-
prompt?: string | undefined;
|
|
50
|
-
skill?: string | undefined;
|
|
51
|
-
model?: string | undefined;
|
|
52
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
53
|
-
allowedTools?: string[] | undefined;
|
|
54
|
-
bashAllowlist?: string[] | undefined;
|
|
55
|
-
command?: string | undefined;
|
|
56
|
-
onFail?: {
|
|
57
|
-
retry: string;
|
|
58
|
-
max?: number | undefined;
|
|
59
|
-
} | undefined;
|
|
60
|
-
}>, {
|
|
61
|
-
id: string;
|
|
62
|
-
name?: string | undefined;
|
|
63
|
-
prompt?: string | undefined;
|
|
64
|
-
skill?: string | undefined;
|
|
65
|
-
model?: string | undefined;
|
|
66
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
67
|
-
allowedTools?: string[] | undefined;
|
|
68
|
-
bashAllowlist?: string[] | undefined;
|
|
69
|
-
command?: string | undefined;
|
|
70
|
-
onFail?: {
|
|
71
|
-
retry: string;
|
|
72
|
-
max: number;
|
|
73
|
-
} | undefined;
|
|
74
|
-
}, {
|
|
75
|
-
id: string;
|
|
76
|
-
name?: string | undefined;
|
|
77
|
-
prompt?: string | undefined;
|
|
78
|
-
skill?: string | undefined;
|
|
79
|
-
model?: string | undefined;
|
|
80
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
81
|
-
allowedTools?: string[] | undefined;
|
|
82
|
-
bashAllowlist?: string[] | undefined;
|
|
83
|
-
command?: string | undefined;
|
|
84
|
-
onFail?: {
|
|
85
|
-
retry: string;
|
|
86
|
-
max?: number | undefined;
|
|
87
|
-
} | undefined;
|
|
88
|
-
}>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
89
31
|
/**
|
|
90
32
|
* A workflow file names either full `steps` or the portable `skills` shorthand
|
|
91
33
|
* (spec 012 — what the builder exports): an ordered list of skill names, each
|
|
92
34
|
* becoming one agent step that applies that skill to `{{task}}`.
|
|
93
35
|
*/
|
|
94
|
-
export declare const workflowFileSchema: z.
|
|
36
|
+
export declare const workflowFileSchema: z.ZodObject<{
|
|
95
37
|
name: z.ZodString;
|
|
96
38
|
description: z.ZodOptional<z.ZodString>;
|
|
97
|
-
steps: z.ZodOptional<z.ZodArray<z.
|
|
39
|
+
steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
98
40
|
id: z.ZodString;
|
|
99
41
|
name: z.ZodOptional<z.ZodString>;
|
|
100
42
|
prompt: z.ZodOptional<z.ZodString>;
|
|
101
43
|
skill: z.ZodOptional<z.ZodString>;
|
|
102
44
|
model: z.ZodOptional<z.ZodString>;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
45
|
+
runner: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
claude: "claude";
|
|
47
|
+
codex: "codex";
|
|
48
|
+
opencode: "opencode";
|
|
49
|
+
pi: "pi";
|
|
50
|
+
}>>;
|
|
51
|
+
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
107
53
|
command: z.ZodOptional<z.ZodString>;
|
|
108
54
|
onFail: z.ZodOptional<z.ZodObject<{
|
|
109
55
|
retry: z.ZodString;
|
|
110
56
|
max: z.ZodDefault<z.ZodNumber>;
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
retry: string;
|
|
116
|
-
max?: number | undefined;
|
|
117
|
-
}>>;
|
|
118
|
-
}, "strip", z.ZodTypeAny, {
|
|
119
|
-
id: string;
|
|
120
|
-
name?: string | undefined;
|
|
121
|
-
prompt?: string | undefined;
|
|
122
|
-
skill?: string | undefined;
|
|
123
|
-
model?: string | undefined;
|
|
124
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
125
|
-
allowedTools?: string[] | undefined;
|
|
126
|
-
bashAllowlist?: string[] | undefined;
|
|
127
|
-
command?: string | undefined;
|
|
128
|
-
onFail?: {
|
|
129
|
-
retry: string;
|
|
130
|
-
max: number;
|
|
131
|
-
} | undefined;
|
|
132
|
-
}, {
|
|
133
|
-
id: string;
|
|
134
|
-
name?: string | undefined;
|
|
135
|
-
prompt?: string | undefined;
|
|
136
|
-
skill?: string | undefined;
|
|
137
|
-
model?: string | undefined;
|
|
138
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
139
|
-
allowedTools?: string[] | undefined;
|
|
140
|
-
bashAllowlist?: string[] | undefined;
|
|
141
|
-
command?: string | undefined;
|
|
142
|
-
onFail?: {
|
|
143
|
-
retry: string;
|
|
144
|
-
max?: number | undefined;
|
|
145
|
-
} | undefined;
|
|
146
|
-
}>, {
|
|
147
|
-
id: string;
|
|
148
|
-
name?: string | undefined;
|
|
149
|
-
prompt?: string | undefined;
|
|
150
|
-
skill?: string | undefined;
|
|
151
|
-
model?: string | undefined;
|
|
152
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
153
|
-
allowedTools?: string[] | undefined;
|
|
154
|
-
bashAllowlist?: string[] | undefined;
|
|
155
|
-
command?: string | undefined;
|
|
156
|
-
onFail?: {
|
|
157
|
-
retry: string;
|
|
158
|
-
max: number;
|
|
159
|
-
} | undefined;
|
|
160
|
-
}, {
|
|
161
|
-
id: string;
|
|
162
|
-
name?: string | undefined;
|
|
163
|
-
prompt?: string | undefined;
|
|
164
|
-
skill?: string | undefined;
|
|
165
|
-
model?: string | undefined;
|
|
166
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
167
|
-
allowedTools?: string[] | undefined;
|
|
168
|
-
bashAllowlist?: string[] | undefined;
|
|
169
|
-
command?: string | undefined;
|
|
170
|
-
onFail?: {
|
|
171
|
-
retry: string;
|
|
172
|
-
max?: number | undefined;
|
|
173
|
-
} | undefined;
|
|
174
|
-
}>, "many">>;
|
|
175
|
-
skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
176
|
-
}, "strip", z.ZodTypeAny, {
|
|
177
|
-
name: string;
|
|
178
|
-
description?: string | undefined;
|
|
179
|
-
steps?: {
|
|
180
|
-
id: string;
|
|
181
|
-
name?: string | undefined;
|
|
182
|
-
prompt?: string | undefined;
|
|
183
|
-
skill?: string | undefined;
|
|
184
|
-
model?: string | undefined;
|
|
185
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
186
|
-
allowedTools?: string[] | undefined;
|
|
187
|
-
bashAllowlist?: string[] | undefined;
|
|
188
|
-
command?: string | undefined;
|
|
189
|
-
onFail?: {
|
|
190
|
-
retry: string;
|
|
191
|
-
max: number;
|
|
192
|
-
} | undefined;
|
|
193
|
-
}[] | undefined;
|
|
194
|
-
skills?: string[] | undefined;
|
|
195
|
-
}, {
|
|
196
|
-
name: string;
|
|
197
|
-
description?: string | undefined;
|
|
198
|
-
steps?: {
|
|
199
|
-
id: string;
|
|
200
|
-
name?: string | undefined;
|
|
201
|
-
prompt?: string | undefined;
|
|
202
|
-
skill?: string | undefined;
|
|
203
|
-
model?: string | undefined;
|
|
204
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
205
|
-
allowedTools?: string[] | undefined;
|
|
206
|
-
bashAllowlist?: string[] | undefined;
|
|
207
|
-
command?: string | undefined;
|
|
208
|
-
onFail?: {
|
|
209
|
-
retry: string;
|
|
210
|
-
max?: number | undefined;
|
|
211
|
-
} | undefined;
|
|
212
|
-
}[] | undefined;
|
|
213
|
-
skills?: string[] | undefined;
|
|
214
|
-
}>, {
|
|
215
|
-
name: string;
|
|
216
|
-
description?: string | undefined;
|
|
217
|
-
steps?: {
|
|
218
|
-
id: string;
|
|
219
|
-
name?: string | undefined;
|
|
220
|
-
prompt?: string | undefined;
|
|
221
|
-
skill?: string | undefined;
|
|
222
|
-
model?: string | undefined;
|
|
223
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
224
|
-
allowedTools?: string[] | undefined;
|
|
225
|
-
bashAllowlist?: string[] | undefined;
|
|
226
|
-
command?: string | undefined;
|
|
227
|
-
onFail?: {
|
|
228
|
-
retry: string;
|
|
229
|
-
max: number;
|
|
230
|
-
} | undefined;
|
|
231
|
-
}[] | undefined;
|
|
232
|
-
skills?: string[] | undefined;
|
|
233
|
-
}, {
|
|
234
|
-
name: string;
|
|
235
|
-
description?: string | undefined;
|
|
236
|
-
steps?: {
|
|
237
|
-
id: string;
|
|
238
|
-
name?: string | undefined;
|
|
239
|
-
prompt?: string | undefined;
|
|
240
|
-
skill?: string | undefined;
|
|
241
|
-
model?: string | undefined;
|
|
242
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
243
|
-
allowedTools?: string[] | undefined;
|
|
244
|
-
bashAllowlist?: string[] | undefined;
|
|
245
|
-
command?: string | undefined;
|
|
246
|
-
onFail?: {
|
|
247
|
-
retry: string;
|
|
248
|
-
max?: number | undefined;
|
|
249
|
-
} | undefined;
|
|
250
|
-
}[] | undefined;
|
|
251
|
-
skills?: string[] | undefined;
|
|
252
|
-
}>;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
}, z.core.$strip>>>;
|
|
59
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
60
|
+
}, z.core.$strip>;
|
|
253
61
|
export type WorkflowStepDef = z.infer<typeof workflowStepSchema>;
|
|
254
62
|
export type WorkflowDoc = z.infer<typeof workflowFileSchema>;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
63
|
+
/**
|
|
64
|
+
* A resolved workflow: a catalog entry, or the ad-hoc "(planned)" chain a task
|
|
65
|
+
* was started with. A SCHEMA and not an interface because `RunStore` persists
|
|
66
|
+
* one of these on the run record (`workflowDef`) and has to parse it back —
|
|
67
|
+
* `src/server/contract-parity.workflows.test.ts` is what keeps this shape and
|
|
68
|
+
* the contract's `workflowDefSchema` from drifting.
|
|
69
|
+
*/
|
|
70
|
+
export declare const workflowDefSchema: z.ZodObject<{
|
|
71
|
+
name: z.ZodString;
|
|
72
|
+
description: z.ZodOptional<z.ZodString>;
|
|
73
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
name: z.ZodOptional<z.ZodString>;
|
|
76
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
77
|
+
skill: z.ZodOptional<z.ZodString>;
|
|
78
|
+
model: z.ZodOptional<z.ZodString>;
|
|
79
|
+
runner: z.ZodOptional<z.ZodEnum<{
|
|
80
|
+
claude: "claude";
|
|
81
|
+
codex: "codex";
|
|
82
|
+
opencode: "opencode";
|
|
83
|
+
pi: "pi";
|
|
84
|
+
}>>;
|
|
85
|
+
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
|
+
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
87
|
+
command: z.ZodOptional<z.ZodString>;
|
|
88
|
+
onFail: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
retry: z.ZodString;
|
|
90
|
+
max: z.ZodDefault<z.ZodNumber>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
source: z.ZodEnum<{
|
|
94
|
+
"built-in": "built-in";
|
|
95
|
+
file: "file";
|
|
96
|
+
}>;
|
|
97
|
+
path: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
export type WorkflowDef = z.infer<typeof workflowDefSchema>;
|
|
262
100
|
/** `skills: [a, b]` → agent steps, one per skill, each running `{{task}}`. */
|
|
263
101
|
export declare function skillsToSteps(skills: string[]): WorkflowStepDef[];
|
|
264
102
|
/** Resolve the steps/skills XOR into plain steps. */
|
package/dist/workflows/types.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { RUNNER_IDS } from '../core/agent-runner.js';
|
|
2
3
|
/**
|
|
3
4
|
* A workflow is an ordered list of steps. Two step kinds:
|
|
4
5
|
* - `agent` — one claude CLI run (prompt + optional skill + model + tools);
|
|
@@ -16,8 +17,16 @@ export const workflowStepSchema = z
|
|
|
16
17
|
prompt: z.string().optional(),
|
|
17
18
|
skill: z.string().optional(),
|
|
18
19
|
model: z.string().optional(),
|
|
19
|
-
/** Per-step agent backend override (falls back to the task / config default).
|
|
20
|
-
|
|
20
|
+
/** Per-step agent backend override (falls back to the task / config default).
|
|
21
|
+
*
|
|
22
|
+
* Deliberately NOT widened to the legacy `claude-cli` the way the run store's
|
|
23
|
+
* `runner`/`backend` were (#547). This enum validates two things a user AUTHORS —
|
|
24
|
+
* workflow YAML, and the inline chain on `POST /runs` — so the selectable set is the
|
|
25
|
+
* right one, and rejecting `claude-cli` here is a loud load-time error rather than
|
|
26
|
+
* data loss. It also gates the persisted `workflowDef` (`runs/store.ts`), but nothing
|
|
27
|
+
* has ever been able to write the legacy id THERE either, because this same enum was
|
|
28
|
+
* the only way in: there is no legacy shape to keep parseable. */
|
|
29
|
+
runner: z.enum(RUNNER_IDS).optional(),
|
|
21
30
|
allowedTools: z.array(z.string()).optional(),
|
|
22
31
|
bashAllowlist: z.array(z.string()).optional(),
|
|
23
32
|
// check step
|
|
@@ -47,6 +56,20 @@ export const workflowFileSchema = z
|
|
|
47
56
|
.refine((d) => Boolean(d.steps) !== Boolean(d.skills), {
|
|
48
57
|
message: 'a workflow lists either "steps" or "skills", not both',
|
|
49
58
|
});
|
|
59
|
+
/**
|
|
60
|
+
* A resolved workflow: a catalog entry, or the ad-hoc "(planned)" chain a task
|
|
61
|
+
* was started with. A SCHEMA and not an interface because `RunStore` persists
|
|
62
|
+
* one of these on the run record (`workflowDef`) and has to parse it back —
|
|
63
|
+
* `src/server/contract-parity.workflows.test.ts` is what keeps this shape and
|
|
64
|
+
* the contract's `workflowDefSchema` from drifting.
|
|
65
|
+
*/
|
|
66
|
+
export const workflowDefSchema = z.object({
|
|
67
|
+
name: z.string(),
|
|
68
|
+
description: z.string().optional(),
|
|
69
|
+
steps: z.array(workflowStepSchema),
|
|
70
|
+
source: z.enum(['built-in', 'file']),
|
|
71
|
+
path: z.string().optional(),
|
|
72
|
+
});
|
|
50
73
|
/** `skills: [a, b]` → agent steps, one per skill, each running `{{task}}`. */
|
|
51
74
|
export function skillsToSteps(skills) {
|
|
52
75
|
const used = new Set();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/workflows/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/workflows/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,aAAa;IACb,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B;;;;;;;;uEAQmE;IACnE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;IACrC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC7C,aAAa;IACb,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAA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GAAG;QAAE,OAAO,sBAAsB,GAAG,GAAG,CAAC;IAC7C,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;QACrC,IAAI,CAAC,CAAC,CAAC,MAAM;YAAE,SAAS;QACxB,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3C,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;YAC9B,OAAO,SAAS,CAAC,CAAC,EAAE,wDAAwD,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;QACjG,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,wEAAwE;AACxE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEvF,wEAAwE;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAgB;IAC9C,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,2CAA2C;IACxD,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE;QACL;YACE,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,aAAa;YACnB,MAAM,EAAE,UAAU;SACnB;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DEFAULT_AGENT_ACCOUNT_ID } from '../contract/index.js';
|
|
3
|
+
import { type ProviderId } from '../core/provider-auth.ts';
|
|
4
|
+
/**
|
|
5
|
+
* `~/.cezar/agent-accounts.json` — the agent-accounts store (spec `2026-07-29-agent-profiles.md`).
|
|
6
|
+
*
|
|
7
|
+
* ## Why its own file
|
|
8
|
+
*
|
|
9
|
+
* These keys started life in `config.json`, where their survival across a cezar downgrade rested
|
|
10
|
+
* on a `.passthrough()` modifier in the OTHER version's schema. That held for the versions in
|
|
11
|
+
* this repo's history — measured, not assumed — but it is not a guarantee this repo can make on
|
|
12
|
+
* behalf of a build someone switches to, and it fails completely in the one case that matters
|
|
13
|
+
* most: any version that cannot parse `config.json` degrades to in-memory defaults, and its next
|
|
14
|
+
* merge-write rewrites the file without whatever it did not understand.
|
|
15
|
+
*
|
|
16
|
+
* A version that has never heard of accounts does not open THIS file, so it cannot lose them.
|
|
17
|
+
* That is the entire argument, and it is why the selections live here too rather than on the
|
|
18
|
+
* project registry.
|
|
19
|
+
*
|
|
20
|
+
* ## House rules (the same ones `config.json` follows, for the same reasons)
|
|
21
|
+
*
|
|
22
|
+
* - every field optional/defaulted with `.catch`, so a bad value degrades per key;
|
|
23
|
+
* - `.passthrough()` at every object level, so a NEWER cezar's keys survive an older one;
|
|
24
|
+
* - per-entry salvage for `accounts` — one hand-edited row never evicts the rest;
|
|
25
|
+
* - atomic tmp+rename at `0600` through the shared writer;
|
|
26
|
+
* - a corrupt or unreadable file degrades to empty with ONE warning, never a boot failure.
|
|
27
|
+
*
|
|
28
|
+
* ## Identity
|
|
29
|
+
*
|
|
30
|
+
* Selections are keyed by the project's REALPATH'D ROOT, not its registry slug. The root is what
|
|
31
|
+
* every consumer already has in hand (`resolveProfileEnvForRoot` takes it), it survives the
|
|
32
|
+
* registry being rebuilt, and it means this file needs no cross-reference into `config.json` at
|
|
33
|
+
* all. An orphaned entry — a project the user deregistered — resolves to nothing and is inert.
|
|
34
|
+
*/
|
|
35
|
+
/** `id` slug rule — the project rule, for the same URL/segment-safety reason. */
|
|
36
|
+
export declare const AGENT_ACCOUNT_ID_RE: RegExp;
|
|
37
|
+
/**
|
|
38
|
+
* Reserved id meaning "the dir cezar discovers" (`agentHomePaths()`).
|
|
39
|
+
*
|
|
40
|
+
* NEVER stored and never allocated: the default account is the zero-config answer, so an absent
|
|
41
|
+
* file behaves exactly as cezar always has. Materializing it would turn a discovered fact into
|
|
42
|
+
* state a user has to maintain.
|
|
43
|
+
*
|
|
44
|
+
* Re-exported from the contract rather than spelled again here: the cockpit sends this exact string
|
|
45
|
+
* to mean "the discovered account, whatever the repo is set to", so a second definition is a place
|
|
46
|
+
* for the two sides to drift apart silently.
|
|
47
|
+
*/
|
|
48
|
+
export { DEFAULT_AGENT_ACCOUNT_ID };
|
|
49
|
+
/**
|
|
50
|
+
* Is `configDir` absolute on `platform`? The account routes' only path rule, and the reason it is a
|
|
51
|
+
* named function rather than a test written inline.
|
|
52
|
+
*
|
|
53
|
+
* A relative dir would resolve against whatever cwd the agent happens to be spawned in — for a task
|
|
54
|
+
* that is a throwaway worktree — so it has to be refused. But the obvious spelling of that refusal,
|
|
55
|
+
* a leading-`/` test, refuses every real Windows path too: `C:\Users\me\.claude-work` starts with
|
|
56
|
+
* neither `/` nor `~`. That is not a corner case: `core/shell-env.ts` renders `set "VAR=v"` for
|
|
57
|
+
* `cmd.exe` precisely so an account survives a Windows terminal handoff, and the Add-account dialog
|
|
58
|
+
* delegates ALL path validation to the server, so a string test would leave the whole feature
|
|
59
|
+
* unreachable on the one platform the rest of this work went out of its way to support.
|
|
60
|
+
*
|
|
61
|
+
* `platform` is a parameter so both answers stay testable from either OS.
|
|
62
|
+
*/
|
|
63
|
+
export declare function isAbsoluteConfigDir(configDir: string, platform?: NodeJS.Platform): boolean;
|
|
64
|
+
/** C0 controls + DEL. A path containing one is never legitimate and would be interpolated into a
|
|
65
|
+
* shell command by the CLI handoff, so it is refused at the schema, not just at the route. */
|
|
66
|
+
export declare const CONTROL_CHARS_RE: RegExp;
|
|
67
|
+
/**
|
|
68
|
+
* One extra config dir for a provider — a second login of the same CLI
|
|
69
|
+
* (`CLAUDE_CONFIG_DIR=~/.claude-klaudiusz claude`), see `src/core/agent-profiles.ts`.
|
|
70
|
+
*
|
|
71
|
+
* `id`, `provider` and `configDir` are load-bearing and carry no `.catch`: a row missing any of
|
|
72
|
+
* them names no account, so the per-entry salvage below drops it. Display fields degrade per key.
|
|
73
|
+
*
|
|
74
|
+
* `configDir` is stored AS WRITTEN — a literal `~` survives — and every consumer expands it
|
|
75
|
+
* through `expandTilde`.
|
|
76
|
+
*/
|
|
77
|
+
declare const agentAccountSchema: z.ZodObject<{
|
|
78
|
+
id: z.ZodString;
|
|
79
|
+
provider: z.ZodEnum<{
|
|
80
|
+
claude: "claude";
|
|
81
|
+
codex: "codex";
|
|
82
|
+
opencode: "opencode";
|
|
83
|
+
pi: "pi";
|
|
84
|
+
}>;
|
|
85
|
+
configDir: z.ZodString;
|
|
86
|
+
label: z.ZodCatch<z.ZodString>;
|
|
87
|
+
addedAt: z.ZodCatch<z.ZodString>;
|
|
88
|
+
}, z.core.$loose>;
|
|
89
|
+
export type AgentAccount = z.infer<typeof agentAccountSchema>;
|
|
90
|
+
/** One project's choice, per provider. Explicit keys so `PROVIDER_IDS` stays the one source of
|
|
91
|
+
* truth and the value is bounded. An absent key means the discovered default. */
|
|
92
|
+
declare const selectionSchema: z.ZodObject<{
|
|
93
|
+
claude: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
94
|
+
codex: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
95
|
+
opencode: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
96
|
+
pi: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
97
|
+
}, z.core.$loose>;
|
|
98
|
+
export type AgentAccountSelection = z.infer<typeof selectionSchema>;
|
|
99
|
+
declare const storeSchema: z.ZodObject<{
|
|
100
|
+
version: z.ZodCatch<z.ZodDefault<z.ZodNumber>>;
|
|
101
|
+
accounts: z.ZodPipe<z.ZodCatch<z.ZodDefault<z.ZodArray<z.ZodUnknown>>>, z.ZodTransform<{
|
|
102
|
+
[x: string]: unknown;
|
|
103
|
+
id: string;
|
|
104
|
+
provider: "claude" | "codex" | "opencode" | "pi";
|
|
105
|
+
configDir: string;
|
|
106
|
+
label: string;
|
|
107
|
+
addedAt: string;
|
|
108
|
+
}[], unknown[]>>;
|
|
109
|
+
defaults: z.ZodCatch<z.ZodDefault<z.ZodObject<{
|
|
110
|
+
claude: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
111
|
+
codex: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
112
|
+
opencode: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
113
|
+
pi: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
114
|
+
}, z.core.$loose>>>;
|
|
115
|
+
selections: z.ZodPipe<z.ZodCatch<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>, z.ZodTransform<Record<string, {
|
|
116
|
+
[x: string]: unknown;
|
|
117
|
+
claude?: string | undefined;
|
|
118
|
+
codex?: string | undefined;
|
|
119
|
+
opencode?: string | undefined;
|
|
120
|
+
pi?: string | undefined;
|
|
121
|
+
}>, Record<string, unknown>>>;
|
|
122
|
+
}, z.core.$loose>;
|
|
123
|
+
export type AgentAccountStore = z.infer<typeof storeSchema>;
|
|
124
|
+
/** The in-memory default — what a missing file behaves like, and the zero-config state. */
|
|
125
|
+
export declare function defaultAgentAccountStore(): AgentAccountStore;
|
|
126
|
+
/**
|
|
127
|
+
* Read the store on demand — never cached, never throws.
|
|
128
|
+
*
|
|
129
|
+
* Not cached because `~/.cezar/` is shared by every cezar process on the machine, so a snapshot is
|
|
130
|
+
* a staleness bug; one small JSON read is free next to spawning a CLI.
|
|
131
|
+
*
|
|
132
|
+
* A missing file is the zero-config default (silent). A corrupt one degrades to the default with a
|
|
133
|
+
* one-line warning and is left on disk untouched, so the user can repair it by hand — the next
|
|
134
|
+
* successful merge-write is what replaces it.
|
|
135
|
+
*/
|
|
136
|
+
export declare function loadAgentAccounts(): Promise<AgentAccountStore>;
|
|
137
|
+
/**
|
|
138
|
+
* Read-modify-write merge: re-read, apply `mutator`, atomic-rename write.
|
|
139
|
+
*
|
|
140
|
+
* Because every writer re-reads immediately before writing, two cezar processes editing different
|
|
141
|
+
* accounts converge instead of dropping each other's — last-writer-wins only inside the tiny
|
|
142
|
+
* read→rename window, which is the same bargain `config.json` makes. Throws on write failure (a
|
|
143
|
+
* read-only home); degrading is the caller's policy.
|
|
144
|
+
*/
|
|
145
|
+
export declare function mergeWriteAgentAccounts(mutator: (store: AgentAccountStore) => AgentAccountStore | void): Promise<AgentAccountStore>;
|
|
146
|
+
/**
|
|
147
|
+
* The account `provider` uses for `repoRoot`, or undefined when nothing has an opinion.
|
|
148
|
+
*
|
|
149
|
+
* Repo first, then the machine-wide default. The order is the whole feature: a repo that chose is
|
|
150
|
+
* never overruled by a later change to the default, and a repo that never chose follows it — so
|
|
151
|
+
* adding a second login is a one-time act rather than one per checkout.
|
|
152
|
+
*/
|
|
153
|
+
export declare function selectionFor(store: Pick<AgentAccountStore, 'selections' | 'defaults'>, repoRoot: string | undefined, provider: ProviderId): string | undefined;
|