@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/runs/store.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import type { RunnerId } from '../core/agent-runner.ts';
|
|
3
4
|
export type RunStatus = 'queued' | 'running' | 'waiting' | 'review' | 'done' | 'failed' | 'cancelled';
|
|
4
5
|
/**
|
|
5
6
|
* A sub-state of `running` (spec 2026-07-18-subagent-monitoring-status, #490):
|
|
@@ -13,46 +14,43 @@ export type StepStatus = 'pending' | 'running' | 'waiting' | 'review' | 'done' |
|
|
|
13
14
|
declare const stepStateSchema: z.ZodObject<{
|
|
14
15
|
id: z.ZodString;
|
|
15
16
|
name: z.ZodString;
|
|
16
|
-
kind: z.ZodEnum<
|
|
17
|
-
|
|
17
|
+
kind: z.ZodEnum<{
|
|
18
|
+
agent: "agent";
|
|
19
|
+
check: "check";
|
|
20
|
+
}>;
|
|
21
|
+
status: z.ZodEnum<{
|
|
22
|
+
cancelled: "cancelled";
|
|
23
|
+
done: "done";
|
|
24
|
+
failed: "failed";
|
|
25
|
+
pending: "pending";
|
|
26
|
+
review: "review";
|
|
27
|
+
running: "running";
|
|
28
|
+
skipped: "skipped";
|
|
29
|
+
waiting: "waiting";
|
|
30
|
+
}>;
|
|
18
31
|
iterations: z.ZodNumber;
|
|
19
32
|
tokensUsed: z.ZodNumber;
|
|
33
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
usageInvocationsStarted: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
usageInvocationsObserved: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
usageTurnsStarted: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
usageTurnsRecorded: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
usageInvocationEpoch: z.ZodOptional<z.ZodNumber>;
|
|
20
40
|
startedAt: z.ZodOptional<z.ZodString>;
|
|
21
41
|
finishedAt: z.ZodOptional<z.ZodString>;
|
|
22
42
|
error: z.ZodOptional<z.ZodString>;
|
|
23
|
-
/** Latest backend-owned session id, used for same-backend Continue. */
|
|
24
43
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
44
|
+
backend: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
45
|
+
claude: "claude";
|
|
46
|
+
"claude-cli": "claude-cli";
|
|
47
|
+
codex: "codex";
|
|
48
|
+
opencode: "opencode";
|
|
49
|
+
pi: "pi";
|
|
50
|
+
}>, z.ZodTransform<"claude" | "codex" | "opencode" | "pi", "claude" | "claude-cli" | "codex" | "opencode" | "pi">>>;
|
|
51
|
+
profileId: z.ZodOptional<z.ZodString>;
|
|
28
52
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
29
|
-
},
|
|
30
|
-
id: string;
|
|
31
|
-
name: string;
|
|
32
|
-
kind: "agent" | "check";
|
|
33
|
-
status: "cancelled" | "done" | "failed" | "pending" | "review" | "running" | "skipped" | "waiting";
|
|
34
|
-
iterations: number;
|
|
35
|
-
tokensUsed: number;
|
|
36
|
-
startedAt?: string | undefined;
|
|
37
|
-
finishedAt?: string | undefined;
|
|
38
|
-
error?: string | undefined;
|
|
39
|
-
sessionId?: string | undefined;
|
|
40
|
-
backend?: "claude" | "codex" | "opencode" | undefined;
|
|
41
|
-
costUsd?: number | undefined;
|
|
42
|
-
}, {
|
|
43
|
-
id: string;
|
|
44
|
-
name: string;
|
|
45
|
-
kind: "agent" | "check";
|
|
46
|
-
status: "cancelled" | "done" | "failed" | "pending" | "review" | "running" | "skipped" | "waiting";
|
|
47
|
-
iterations: number;
|
|
48
|
-
tokensUsed: number;
|
|
49
|
-
startedAt?: string | undefined;
|
|
50
|
-
finishedAt?: string | undefined;
|
|
51
|
-
error?: string | undefined;
|
|
52
|
-
sessionId?: string | undefined;
|
|
53
|
-
backend?: "claude" | "codex" | "opencode" | undefined;
|
|
54
|
-
costUsd?: number | undefined;
|
|
55
|
-
}>;
|
|
53
|
+
}, z.core.$strip>;
|
|
56
54
|
/** One prompt message stacked onto a run while it waits for a free agent slot
|
|
57
55
|
* (#472). Folded into `{{task}}` at dequeue by `hydrateQueuedInput`; never
|
|
58
56
|
* delivered as its own turn — a follow-up turn would reach only the first step
|
|
@@ -60,365 +58,174 @@ declare const stepStateSchema: z.ZodObject<{
|
|
|
60
58
|
declare const queuedMessageSchema: z.ZodObject<{
|
|
61
59
|
id: z.ZodString;
|
|
62
60
|
text: z.ZodString;
|
|
63
|
-
|
|
64
|
-
images: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
61
|
+
images: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
62
|
createdAt: z.ZodString;
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
createdAt: string;
|
|
71
|
-
}, {
|
|
72
|
-
id: string;
|
|
73
|
-
text: string;
|
|
74
|
-
images?: string[] | undefined;
|
|
75
|
-
createdAt: string;
|
|
76
|
-
}>;
|
|
77
|
-
declare const runRecordSchema: z.ZodObject<{
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
/** Exported for `./run-index.ts`, the read-only reader of the same file. Nothing else should
|
|
65
|
+
* parse `runs.json` — see `reconcileLoadedRun` for why a second parser is a correctness risk. */
|
|
66
|
+
export declare const runRecordSchema: z.ZodObject<{
|
|
78
67
|
id: z.ZodString;
|
|
79
68
|
title: z.ZodString;
|
|
80
|
-
/** Display title (#389): the auto-derived summary of the first agent turn,
|
|
81
|
-
* or the user's inline edit (`PATCH /api/runs/:id` sets it together with
|
|
82
|
-
* `title` so edits always win). The UI shows `titleSummary ?? title`. */
|
|
83
69
|
titleSummary: z.ZodOptional<z.ZodString>;
|
|
84
|
-
/** `git diff --shortstat` of the worktree vs its base, refreshed on every
|
|
85
|
-
* turn-end (#389) — what the quick list / table shows without a git call. */
|
|
86
70
|
diffStat: z.ZodOptional<z.ZodObject<{
|
|
87
71
|
adds: z.ZodNumber;
|
|
88
72
|
dels: z.ZodNumber;
|
|
89
73
|
files: z.ZodNumber;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
dels: number;
|
|
93
|
-
files: number;
|
|
94
|
-
}, {
|
|
95
|
-
adds: number;
|
|
96
|
-
dels: number;
|
|
97
|
-
files: number;
|
|
98
|
-
}>>;
|
|
74
|
+
repointed: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
}, z.core.$strip>>;
|
|
99
76
|
workflow: z.ZodString;
|
|
100
77
|
task: z.ZodString;
|
|
101
|
-
/** Prompt messages stacked onto this run while it was queued (#472). Optional:
|
|
102
|
-
* `undefined` on every pre-#472 record reads as an empty stack. Like `task`,
|
|
103
|
-
* `text` is the user's own prompt and is replayed into `{{task}}`, so it is
|
|
104
|
-
* deliberately NOT in `redactPatch`'s field list — scrubbing it would corrupt
|
|
105
|
-
* the run the same way scrubbing `task` would. */
|
|
106
78
|
queuedMessages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
107
79
|
id: z.ZodString;
|
|
108
80
|
text: z.ZodString;
|
|
109
|
-
|
|
110
|
-
images: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
81
|
+
images: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
111
82
|
createdAt: z.ZodString;
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
text: string;
|
|
115
|
-
images?: string[] | undefined;
|
|
116
|
-
createdAt: string;
|
|
117
|
-
}, {
|
|
118
|
-
id: string;
|
|
119
|
-
text: string;
|
|
120
|
-
images?: string[] | undefined;
|
|
121
|
-
createdAt: string;
|
|
122
|
-
}>, "many">>;
|
|
123
|
-
/** URLs of images attached to the initial task prompt, for the thread's first bubble
|
|
124
|
-
* (#image-display) — persisted like agent screenshots, served from `/images/`. */
|
|
125
|
-
taskImages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
83
|
+
}, z.core.$strip>>>;
|
|
84
|
+
taskImages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
126
85
|
model: z.ZodOptional<z.ZodString>;
|
|
127
|
-
/** Canonical provider/model identity (#405) — the normalised `provider/model`
|
|
128
|
-
* (e.g. `anthropic/claude-opus-4-8`) the run actually used, resolved from the
|
|
129
|
-
* free-text `model` against the chosen runner. Additive and optional: pre-#405
|
|
130
|
-
* records carry only `model`, and it stays the human/hand-edit surface; this
|
|
131
|
-
* is the parseable identity cost attribution and reproducible replay key off. */
|
|
132
86
|
modelIdentity: z.ZodOptional<z.ZodString>;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
87
|
+
runner: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
88
|
+
claude: "claude";
|
|
89
|
+
"claude-cli": "claude-cli";
|
|
90
|
+
codex: "codex";
|
|
91
|
+
opencode: "opencode";
|
|
92
|
+
pi: "pi";
|
|
93
|
+
}>, z.ZodTransform<"claude" | "codex" | "opencode" | "pi", "claude" | "claude-cli" | "codex" | "opencode" | "pi">>>;
|
|
94
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
140
95
|
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
141
|
-
/** Per-task follow-up inbox contract (spec 007, #444). Missing on old runs
|
|
142
|
-
* means enabled — the historical behavior. */
|
|
143
96
|
generateFollowups: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
-
/** Autonomous mode (#489): the run was started with the "autonomous" checkbox,
|
|
145
|
-
* so it never parks at `waiting` (auto-nudge) and — once persisted here —
|
|
146
|
-
* never parks at the terminal `review` gate either (`settleSuccess` + the
|
|
147
|
-
* group-pick winner-park read it). Additive-safe: absent = falsy = not
|
|
148
|
-
* autonomous. Set at creation from `WorkflowInput.autonomous`. */
|
|
149
97
|
autonomous: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
98
|
+
automation: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
automationId: z.ZodString;
|
|
100
|
+
automationRevision: z.ZodNumber;
|
|
101
|
+
receiptId: z.ZodString;
|
|
102
|
+
event: z.ZodString;
|
|
103
|
+
githubUrl: z.ZodString;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
status: z.ZodEnum<{
|
|
106
|
+
cancelled: "cancelled";
|
|
107
|
+
done: "done";
|
|
108
|
+
failed: "failed";
|
|
109
|
+
queued: "queued";
|
|
110
|
+
review: "review";
|
|
111
|
+
running: "running";
|
|
112
|
+
waiting: "waiting";
|
|
113
|
+
}>;
|
|
114
|
+
activity: z.ZodOptional<z.ZodEnum<{
|
|
115
|
+
monitoring: "monitoring";
|
|
116
|
+
}>>;
|
|
117
|
+
monitoringWakeAt: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
118
|
+
monitoringWakeCapReached: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
autoResumeAt: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
120
|
+
autoResumeAttempts: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
155
121
|
createdAt: z.ZodString;
|
|
156
122
|
startedAt: z.ZodOptional<z.ZodString>;
|
|
157
123
|
finishedAt: z.ZodOptional<z.ZodString>;
|
|
158
124
|
tokensUsed: z.ZodNumber;
|
|
125
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
159
127
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
160
|
-
/** First GitHub PR URL spotted in the transcript (the janitor trick). */
|
|
161
128
|
pullRequestUrl: z.ZodOptional<z.ZodString>;
|
|
162
|
-
/** The PR this task is ABOUT (#407, spec 2026-07-16-pr-autodiscovery):
|
|
163
|
-
* auto-discovered from conversation references for tasks that work on an
|
|
164
|
-
* existing PR (review/continue/merge). Display-only tier — `pullRequestUrl`
|
|
165
|
-
* (the PR this task CREATED) always wins, and action gates ignore this. */
|
|
166
129
|
referencedPullRequestUrl: z.ZodOptional<z.ZodString>;
|
|
167
|
-
/** The PR/issue number this task is ABOUT (spec 2026-07-17-task-auto-naming):
|
|
168
|
-
* regex-extracted from the task prompt, upgradable by the namer's
|
|
169
|
-
* cross-checked output. Display tier — never gates actions. */
|
|
170
130
|
prNumber: z.ZodOptional<z.ZodNumber>;
|
|
171
131
|
issueNumber: z.ZodOptional<z.ZodNumber>;
|
|
172
|
-
/** Provenance for an `issueNumber` seeded by referenced-issue discovery.
|
|
173
|
-
* Persisted so ambiguity can revoke only the janitor's own value, including
|
|
174
|
-
* after a restart. Any prompt, namer, or marker write clears this flag. */
|
|
175
132
|
referencedIssueNumberSeeded: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
titleOrigin: z.ZodOptional<z.ZodEnum<["user", "auto", "marker"]>>;
|
|
182
|
-
/** References the agent itself declared via `CEZ:PR=` / `CEZ:ISSUE=` markers
|
|
183
|
-
* (spec 2026-07-18-task-ref-markers). Presence of a kind makes it
|
|
184
|
-
* authoritative: the namer may no longer write that kind, and a declared PR
|
|
185
|
-
* owns the referenced tier's resolution. */
|
|
133
|
+
titleOrigin: z.ZodOptional<z.ZodEnum<{
|
|
134
|
+
auto: "auto";
|
|
135
|
+
marker: "marker";
|
|
136
|
+
user: "user";
|
|
137
|
+
}>>;
|
|
186
138
|
markerRefs: z.ZodOptional<z.ZodObject<{
|
|
187
139
|
pr: z.ZodOptional<z.ZodNumber>;
|
|
188
140
|
issue: z.ZodOptional<z.ZodNumber>;
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
issue?: number | undefined;
|
|
192
|
-
}, {
|
|
193
|
-
pr?: number | undefined;
|
|
194
|
-
issue?: number | undefined;
|
|
195
|
-
}>>;
|
|
196
|
-
/** Distinct PR URLs spotted so far — the referenced tier's working set,
|
|
197
|
-
* persisted so a resumed run keeps disambiguating against the full history
|
|
198
|
-
* instead of re-adopting the next URL as "the only one". Capped. */
|
|
199
|
-
referencedPrCandidates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
200
|
-
/** The issue this task is ABOUT (spec 2026-07-21-report-ref-discovery):
|
|
201
|
-
* auto-discovered from `github.com/…/issues/N` links in the conversation,
|
|
202
|
-
* mirroring the referenced-PR tier. Display-only; never gates actions. */
|
|
141
|
+
}, z.core.$strip>>;
|
|
142
|
+
referencedPrCandidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
203
143
|
referencedIssueUrl: z.ZodOptional<z.ZodString>;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
referencedIssueCandidates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
207
|
-
/** Task worktree (spec 006) — absent when the run executed in the repo root. */
|
|
144
|
+
referencedIssueCandidates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
145
|
+
worktree: z.ZodOptional<z.ZodLiteral<false>>;
|
|
208
146
|
worktreePath: z.ZodOptional<z.ZodString>;
|
|
209
|
-
/** The task's own branch (`cez/<id8>`), created off `baseBranch`. */
|
|
210
147
|
branch: z.ZodOptional<z.ZodString>;
|
|
211
|
-
/** Branch (or commit, when HEAD was detached) the worktree was forked from. */
|
|
212
148
|
baseBranch: z.ZodOptional<z.ZodString>;
|
|
213
|
-
/** Set when count-based retention (#483) reclaimed this run's worktree
|
|
214
|
-
* *directory* (the `cez/<id8>` branch is kept). Presence means "materialized
|
|
215
|
-
* dir gone, recoverable via `git worktree add`"; it excludes the run from the
|
|
216
|
-
* retention budget until the dir is re-materialized (resume clears it). */
|
|
217
149
|
worktreeReclaimedAt: z.ZodOptional<z.ZodString>;
|
|
218
|
-
/** Parallel variants (spec 010): tasks sharing a groupId are one group. */
|
|
219
150
|
groupId: z.ZodOptional<z.ZodString>;
|
|
220
|
-
/** Variant letter within the group — 'A' | 'B' | 'C' (kept as a string). */
|
|
221
151
|
variant: z.ZodOptional<z.ZodString>;
|
|
222
|
-
/** Peak resident memory (bytes) / process count observed across the run's
|
|
223
|
-
* agent process trees (#348) — written when a session's telemetry ends.
|
|
224
|
-
* Optional: old runs.json files and `ps`-less platforms have neither. */
|
|
225
152
|
peakRssBytes: z.ZodOptional<z.ZodNumber>;
|
|
226
153
|
peakProcCount: z.ZodOptional<z.ZodNumber>;
|
|
227
154
|
archived: z.ZodDefault<z.ZodBoolean>;
|
|
228
155
|
archivedAt: z.ZodOptional<z.ZodString>;
|
|
156
|
+
seenAt: z.ZodOptional<z.ZodString>;
|
|
229
157
|
currentStepId: z.ZodOptional<z.ZodString>;
|
|
230
158
|
error: z.ZodOptional<z.ZodString>;
|
|
231
159
|
steps: z.ZodArray<z.ZodObject<{
|
|
232
160
|
id: z.ZodString;
|
|
233
161
|
name: z.ZodString;
|
|
234
|
-
kind: z.ZodEnum<
|
|
235
|
-
|
|
162
|
+
kind: z.ZodEnum<{
|
|
163
|
+
agent: "agent";
|
|
164
|
+
check: "check";
|
|
165
|
+
}>;
|
|
166
|
+
status: z.ZodEnum<{
|
|
167
|
+
cancelled: "cancelled";
|
|
168
|
+
done: "done";
|
|
169
|
+
failed: "failed";
|
|
170
|
+
pending: "pending";
|
|
171
|
+
review: "review";
|
|
172
|
+
running: "running";
|
|
173
|
+
skipped: "skipped";
|
|
174
|
+
waiting: "waiting";
|
|
175
|
+
}>;
|
|
236
176
|
iterations: z.ZodNumber;
|
|
237
177
|
tokensUsed: z.ZodNumber;
|
|
178
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
usageInvocationsStarted: z.ZodOptional<z.ZodNumber>;
|
|
181
|
+
usageInvocationsObserved: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
usageTurnsStarted: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
usageTurnsRecorded: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
usageInvocationEpoch: z.ZodOptional<z.ZodNumber>;
|
|
238
185
|
startedAt: z.ZodOptional<z.ZodString>;
|
|
239
186
|
finishedAt: z.ZodOptional<z.ZodString>;
|
|
240
187
|
error: z.ZodOptional<z.ZodString>;
|
|
241
|
-
/** Latest backend-owned session id, used for same-backend Continue. */
|
|
242
188
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
189
|
+
backend: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
|
|
190
|
+
claude: "claude";
|
|
191
|
+
"claude-cli": "claude-cli";
|
|
192
|
+
codex: "codex";
|
|
193
|
+
opencode: "opencode";
|
|
194
|
+
pi: "pi";
|
|
195
|
+
}>, z.ZodTransform<"claude" | "codex" | "opencode" | "pi", "claude" | "claude-cli" | "codex" | "opencode" | "pi">>>;
|
|
196
|
+
profileId: z.ZodOptional<z.ZodString>;
|
|
246
197
|
costUsd: z.ZodOptional<z.ZodNumber>;
|
|
247
|
-
},
|
|
248
|
-
|
|
249
|
-
name:
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
workflowDef: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
279
|
-
}, "strip", z.ZodTypeAny, {
|
|
280
|
-
id: string;
|
|
281
|
-
title: string;
|
|
282
|
-
titleSummary?: string | undefined;
|
|
283
|
-
diffStat?: {
|
|
284
|
-
adds: number;
|
|
285
|
-
dels: number;
|
|
286
|
-
files: number;
|
|
287
|
-
} | undefined;
|
|
288
|
-
workflow: string;
|
|
289
|
-
task: string;
|
|
290
|
-
queuedMessages?: {
|
|
291
|
-
id: string;
|
|
292
|
-
text: string;
|
|
293
|
-
images?: string[] | undefined;
|
|
294
|
-
createdAt: string;
|
|
295
|
-
}[] | undefined;
|
|
296
|
-
taskImages?: string[] | undefined;
|
|
297
|
-
model?: string | undefined;
|
|
298
|
-
modelIdentity?: string | undefined;
|
|
299
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
300
|
-
systemPrompt?: string | undefined;
|
|
301
|
-
generateFollowups?: boolean | undefined;
|
|
302
|
-
autonomous?: boolean | undefined;
|
|
303
|
-
status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
|
|
304
|
-
activity?: "monitoring" | undefined;
|
|
305
|
-
createdAt: string;
|
|
306
|
-
startedAt?: string | undefined;
|
|
307
|
-
finishedAt?: string | undefined;
|
|
308
|
-
tokensUsed: number;
|
|
309
|
-
costUsd?: number | undefined;
|
|
310
|
-
pullRequestUrl?: string | undefined;
|
|
311
|
-
referencedPullRequestUrl?: string | undefined;
|
|
312
|
-
prNumber?: number | undefined;
|
|
313
|
-
issueNumber?: number | undefined;
|
|
314
|
-
referencedIssueNumberSeeded?: boolean | undefined;
|
|
315
|
-
titleOrigin?: "auto" | "marker" | "user" | undefined;
|
|
316
|
-
markerRefs?: {
|
|
317
|
-
pr?: number | undefined;
|
|
318
|
-
issue?: number | undefined;
|
|
319
|
-
} | undefined;
|
|
320
|
-
referencedPrCandidates?: string[] | undefined;
|
|
321
|
-
referencedIssueUrl?: string | undefined;
|
|
322
|
-
referencedIssueCandidates?: string[] | undefined;
|
|
323
|
-
worktreePath?: string | undefined;
|
|
324
|
-
branch?: string | undefined;
|
|
325
|
-
baseBranch?: string | undefined;
|
|
326
|
-
worktreeReclaimedAt?: string | undefined;
|
|
327
|
-
groupId?: string | undefined;
|
|
328
|
-
variant?: string | undefined;
|
|
329
|
-
peakRssBytes?: number | undefined;
|
|
330
|
-
peakProcCount?: number | undefined;
|
|
331
|
-
archived: boolean;
|
|
332
|
-
archivedAt?: string | undefined;
|
|
333
|
-
currentStepId?: string | undefined;
|
|
334
|
-
error?: string | undefined;
|
|
335
|
-
steps: {
|
|
336
|
-
id: string;
|
|
337
|
-
name: string;
|
|
338
|
-
kind: "agent" | "check";
|
|
339
|
-
status: "cancelled" | "done" | "failed" | "pending" | "review" | "running" | "skipped" | "waiting";
|
|
340
|
-
iterations: number;
|
|
341
|
-
tokensUsed: number;
|
|
342
|
-
startedAt?: string | undefined;
|
|
343
|
-
finishedAt?: string | undefined;
|
|
344
|
-
error?: string | undefined;
|
|
345
|
-
sessionId?: string | undefined;
|
|
346
|
-
backend?: "claude" | "codex" | "opencode" | undefined;
|
|
347
|
-
costUsd?: number | undefined;
|
|
348
|
-
}[];
|
|
349
|
-
workflowDef?: Record<string, unknown> | undefined;
|
|
350
|
-
}, {
|
|
351
|
-
id: string;
|
|
352
|
-
title: string;
|
|
353
|
-
titleSummary?: string | undefined;
|
|
354
|
-
diffStat?: {
|
|
355
|
-
adds: number;
|
|
356
|
-
dels: number;
|
|
357
|
-
files: number;
|
|
358
|
-
} | undefined;
|
|
359
|
-
workflow: string;
|
|
360
|
-
task: string;
|
|
361
|
-
queuedMessages?: {
|
|
362
|
-
id: string;
|
|
363
|
-
text: string;
|
|
364
|
-
images?: string[] | undefined;
|
|
365
|
-
createdAt: string;
|
|
366
|
-
}[] | undefined;
|
|
367
|
-
taskImages?: string[] | undefined;
|
|
368
|
-
model?: string | undefined;
|
|
369
|
-
modelIdentity?: string | undefined;
|
|
370
|
-
runner?: "claude" | "codex" | "opencode" | undefined;
|
|
371
|
-
systemPrompt?: string | undefined;
|
|
372
|
-
generateFollowups?: boolean | undefined;
|
|
373
|
-
autonomous?: boolean | undefined;
|
|
374
|
-
status: "cancelled" | "done" | "failed" | "queued" | "review" | "running" | "waiting";
|
|
375
|
-
activity?: "monitoring" | undefined;
|
|
376
|
-
createdAt: string;
|
|
377
|
-
startedAt?: string | undefined;
|
|
378
|
-
finishedAt?: string | undefined;
|
|
379
|
-
tokensUsed: number;
|
|
380
|
-
costUsd?: number | undefined;
|
|
381
|
-
pullRequestUrl?: string | undefined;
|
|
382
|
-
referencedPullRequestUrl?: string | undefined;
|
|
383
|
-
prNumber?: number | undefined;
|
|
384
|
-
issueNumber?: number | undefined;
|
|
385
|
-
referencedIssueNumberSeeded?: boolean | undefined;
|
|
386
|
-
titleOrigin?: "auto" | "marker" | "user" | undefined;
|
|
387
|
-
markerRefs?: {
|
|
388
|
-
pr?: number | undefined;
|
|
389
|
-
issue?: number | undefined;
|
|
390
|
-
} | undefined;
|
|
391
|
-
referencedPrCandidates?: string[] | undefined;
|
|
392
|
-
referencedIssueUrl?: string | undefined;
|
|
393
|
-
referencedIssueCandidates?: string[] | undefined;
|
|
394
|
-
worktreePath?: string | undefined;
|
|
395
|
-
branch?: string | undefined;
|
|
396
|
-
baseBranch?: string | undefined;
|
|
397
|
-
worktreeReclaimedAt?: string | undefined;
|
|
398
|
-
groupId?: string | undefined;
|
|
399
|
-
variant?: string | undefined;
|
|
400
|
-
peakRssBytes?: number | undefined;
|
|
401
|
-
peakProcCount?: number | undefined;
|
|
402
|
-
archived?: boolean | undefined;
|
|
403
|
-
archivedAt?: string | undefined;
|
|
404
|
-
currentStepId?: string | undefined;
|
|
405
|
-
error?: string | undefined;
|
|
406
|
-
steps: {
|
|
407
|
-
id: string;
|
|
408
|
-
name: string;
|
|
409
|
-
kind: "agent" | "check";
|
|
410
|
-
status: "cancelled" | "done" | "failed" | "pending" | "review" | "running" | "skipped" | "waiting";
|
|
411
|
-
iterations: number;
|
|
412
|
-
tokensUsed: number;
|
|
413
|
-
startedAt?: string | undefined;
|
|
414
|
-
finishedAt?: string | undefined;
|
|
415
|
-
error?: string | undefined;
|
|
416
|
-
sessionId?: string | undefined;
|
|
417
|
-
backend?: "claude" | "codex" | "opencode" | undefined;
|
|
418
|
-
costUsd?: number | undefined;
|
|
419
|
-
}[];
|
|
420
|
-
workflowDef?: Record<string, unknown> | undefined;
|
|
421
|
-
}>;
|
|
198
|
+
}, z.core.$strip>>;
|
|
199
|
+
workflowDef: z.ZodCatch<z.ZodOptional<z.ZodObject<{
|
|
200
|
+
name: z.ZodString;
|
|
201
|
+
description: z.ZodOptional<z.ZodString>;
|
|
202
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
203
|
+
id: z.ZodString;
|
|
204
|
+
name: z.ZodOptional<z.ZodString>;
|
|
205
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
206
|
+
skill: z.ZodOptional<z.ZodString>;
|
|
207
|
+
model: z.ZodOptional<z.ZodString>;
|
|
208
|
+
runner: z.ZodOptional<z.ZodEnum<{
|
|
209
|
+
claude: "claude";
|
|
210
|
+
codex: "codex";
|
|
211
|
+
opencode: "opencode";
|
|
212
|
+
pi: "pi";
|
|
213
|
+
}>>;
|
|
214
|
+
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
215
|
+
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
216
|
+
command: z.ZodOptional<z.ZodString>;
|
|
217
|
+
onFail: z.ZodOptional<z.ZodObject<{
|
|
218
|
+
retry: z.ZodString;
|
|
219
|
+
max: z.ZodDefault<z.ZodNumber>;
|
|
220
|
+
}, z.core.$strip>>;
|
|
221
|
+
}, z.core.$strip>>;
|
|
222
|
+
source: z.ZodEnum<{
|
|
223
|
+
"built-in": "built-in";
|
|
224
|
+
file: "file";
|
|
225
|
+
}>;
|
|
226
|
+
path: z.ZodOptional<z.ZodString>;
|
|
227
|
+
}, z.core.$strip>>>;
|
|
228
|
+
}, z.core.$strip>;
|
|
422
229
|
export type StepState = z.infer<typeof stepStateSchema>;
|
|
423
230
|
export type QueuedMessage = z.infer<typeof queuedMessageSchema>;
|
|
424
231
|
export type RunRecord = z.infer<typeof runRecordSchema>;
|
|
@@ -430,6 +237,22 @@ export interface RunEvent {
|
|
|
430
237
|
type: string;
|
|
431
238
|
[key: string]: unknown;
|
|
432
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* Reconcile one record just read off disk with the fact that whichever process wrote it is gone.
|
|
242
|
+
*
|
|
243
|
+
* Mutates and returns `run`. Extracted from `RunStore.open` so the read-only index reader
|
|
244
|
+
* (`./run-index.ts`) answers the SAME question about a `running` row on disk. Two parsers that
|
|
245
|
+
* disagree here is a visible bug, not an internal one: the cockpit would show a task as running
|
|
246
|
+
* in the ⌘K index and failed the moment you opened it.
|
|
247
|
+
*
|
|
248
|
+
* `keepLive` (#367): leave `queued`/`running`/`waiting` untouched so the caller can recover them
|
|
249
|
+
* (RunManager.recover re-queues queued runs, resumes interrupted ones). Without it — one-shot CLI
|
|
250
|
+
* paths that never recover, and the index reader, which has no manager at all — live-looking runs
|
|
251
|
+
* are marked failed so no ghost stays behind.
|
|
252
|
+
*/
|
|
253
|
+
export declare function reconcileLoadedRun(run: RunRecord, opts?: {
|
|
254
|
+
keepLive?: boolean;
|
|
255
|
+
}): RunRecord;
|
|
433
256
|
/**
|
|
434
257
|
* File-backed run store: `runs.json` index (atomic tmp+rename writes, the
|
|
435
258
|
* pattern from @cezar/core's IssueStore) plus one append-only NDJSON event
|
|
@@ -441,12 +264,7 @@ export declare class RunStore extends EventEmitter {
|
|
|
441
264
|
private runs;
|
|
442
265
|
private saveTimer;
|
|
443
266
|
private constructor();
|
|
444
|
-
/**
|
|
445
|
-
* `keepLive` (#367): leave `queued`/`running`/`waiting` statuses untouched
|
|
446
|
-
* so the caller can recover them (RunManager.recover re-queues queued runs,
|
|
447
|
-
* resumes interrupted ones). Without it — one-shot CLI paths that never
|
|
448
|
-
* recover — live-looking runs are marked failed so no ghost stays behind.
|
|
449
|
-
*/
|
|
267
|
+
/** See `reconcileLoadedRun` for what `keepLive` (#367) decides about live-looking rows. */
|
|
450
268
|
static open(dataDir: string, opts?: {
|
|
451
269
|
keepLive?: boolean;
|
|
452
270
|
}): RunStore;
|
|
@@ -457,9 +275,12 @@ export declare class RunStore extends EventEmitter {
|
|
|
457
275
|
workflow: string;
|
|
458
276
|
task: string;
|
|
459
277
|
model?: string;
|
|
460
|
-
runner?:
|
|
278
|
+
runner?: RunnerId;
|
|
279
|
+
/** Composer's per-task agent account (spec 2026-07-29-agent-profiles). */
|
|
280
|
+
agentProfile?: string;
|
|
461
281
|
generateFollowups?: boolean;
|
|
462
282
|
autonomous?: boolean;
|
|
283
|
+
worktree?: false;
|
|
463
284
|
groupId?: string;
|
|
464
285
|
variant?: string;
|
|
465
286
|
steps: Array<Pick<StepState, 'id' | 'name' | 'kind'>>;
|
|
@@ -494,6 +315,50 @@ export declare class RunStore extends EventEmitter {
|
|
|
494
315
|
setArchived(id: string, archived: boolean): RunRecord | undefined;
|
|
495
316
|
/** Bulk-archive every finished run; returns how many were archived. */
|
|
496
317
|
archiveFinished(): number;
|
|
318
|
+
/** Mark one run as read (#unread-done-items): stamp the read receipt now. Mirrors
|
|
319
|
+
* `setArchived` — sets the field then persists + broadcasts via `touch`, so the
|
|
320
|
+
* updated record rides the existing `run` SSE with no new event. Idempotent by
|
|
321
|
+
* design: opening an already-read thread just re-stamps a later `seenAt`. */
|
|
322
|
+
setRead(id: string): RunRecord | undefined;
|
|
323
|
+
/** Mark one run as UNread (#775): drop the read receipt so the run rejoins the unread
|
|
324
|
+
* list. The inverse of `setRead` and, like it, `touch`es so the updated record rides the
|
|
325
|
+
* existing `run` SSE.
|
|
326
|
+
*
|
|
327
|
+
* Deleting the field rather than adding a "manually unread" flag is the whole point:
|
|
328
|
+
* absent `seenAt` is ALREADY what every reader treats as unread (`isUnread` in the
|
|
329
|
+
* cockpit's read-state.ts, and `markAllRead`'s clause-for-clause copy of it below), so
|
|
330
|
+
* clearing needs no new state and writes a shape any older cezar already parses.
|
|
331
|
+
*
|
|
332
|
+
* Deliberately unconditional: clearing a receipt is always a legal write, so this
|
|
333
|
+
* succeeds for an already-unread run (idempotent) and for statuses that can never wear
|
|
334
|
+
* the marker. WHETHER the action means anything for a given run is UI policy, and lives
|
|
335
|
+
* in the cockpit's `runActionFlags` — the same split the rest of the store keeps. */
|
|
336
|
+
setUnread(id: string): RunRecord | undefined;
|
|
337
|
+
/** Bulk mark-read: stamp every currently-unread finished run; returns the count.
|
|
338
|
+
* "Unread" here is the same rule the cockpit paints (`isUnread` in read-state.ts),
|
|
339
|
+
* clause for clause:
|
|
340
|
+
* - a `done` or `failed` run that finished and has not been seen since;
|
|
341
|
+
* - cancelled runs are never unread — you stopped them yourself;
|
|
342
|
+
* - archived ones never are either, since archiving is a stronger "done with this"
|
|
343
|
+
* than reading;
|
|
344
|
+
* - and a `failed` run with a pending `autoResumeAt` is not a done item AT ALL
|
|
345
|
+
* (`isScheduledResume`, spec 2026-08-03-auto-resume-after-usage-limit): it has an
|
|
346
|
+
* appointment to pick the work back up, so there is no outcome to have missed.
|
|
347
|
+
*
|
|
348
|
+
* Keeping the two rules identical is what makes the returned count the number the
|
|
349
|
+
* cockpit's unread badge was showing. The `autoResumeAt` clause is the one that drifted
|
|
350
|
+
* (#803): `isUnread` gained it with auto-resume and this sweep did not, so a task waiting
|
|
351
|
+
* out a usage limit was uncounted by the badge but stamped read by the sweep — and this
|
|
352
|
+
* comment asserted an invariant the code no longer held.
|
|
353
|
+
*
|
|
354
|
+
* This rule lives in two languages of the same repo, which is why it has now drifted
|
|
355
|
+
* once. The cockpit cannot import it (`packages/web` does not depend on the service, and
|
|
356
|
+
* should not), so a single definition would have to move to `packages/contract` — the one
|
|
357
|
+
* package both sides already import. Worth doing; deliberately not done here, because
|
|
358
|
+
* widening the contract package's remit from "shapes" to "behavior" is a design change
|
|
359
|
+
* that deserves its own review rather than riding along in a bug fix. Until then: EDIT
|
|
360
|
+
* BOTH, and the case-table tests on either side are what catch you if you don't. */
|
|
361
|
+
markAllRead(): number;
|
|
497
362
|
appendEvent(runId: string, event: {
|
|
498
363
|
type: string;
|
|
499
364
|
stepId?: string;
|