@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/todos.js
CHANGED
|
@@ -121,7 +121,7 @@ export async function removeTodo(dataDir, id) {
|
|
|
121
121
|
/** The task text "▶ Run" turns an entry into: the suggested prompt (or the summary when the
|
|
122
122
|
* entry carries none), plus the suggested args as a trailing line. The single server-side
|
|
123
123
|
* source for `POST /api/todos/:id/start`; the cockpit's prefill copy
|
|
124
|
-
* (`web/
|
|
124
|
+
* (`packages/web/src/routes/inbox.tsx`, #374) lives in another process and cannot import this, so
|
|
125
125
|
* the two are pinned to the shared cases in `test/fixtures/todo-task-text.json`. */
|
|
126
126
|
export function todoTaskText(todo) {
|
|
127
127
|
let task = (todo.suggestedPrompt ?? todo.summary).trim() || todo.summary;
|
package/dist/ui-state.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UiState } from './contract/index.js';
|
|
1
2
|
/**
|
|
2
3
|
* `.ai/cezar/ui-state.json` — small GUI preferences the cockpit persists (files, not a DB).
|
|
3
4
|
* The server owns the schema and the writes (`PUT /api/ui-state` in `src/server/server.ts`);
|
|
@@ -8,5 +9,18 @@
|
|
|
8
9
|
* `{}` — an absent preference, never a throw, never a blocked startup.
|
|
9
10
|
*/
|
|
10
11
|
export declare function uiStatePath(repoRoot: string): string;
|
|
11
|
-
/**
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Read `ui-state.json` on demand — never cached, never throws.
|
|
14
|
+
*
|
|
15
|
+
* Typed by the CONTRACT (`UiState`), not by a loose record: `GET /api/v1/ui-state` answers this
|
|
16
|
+
* value verbatim, so a `Record<string, unknown>` here made the route name no key at all and the
|
|
17
|
+
* per-route parity guard vacuous — the same defect `healthSnapshot` had. `UiState` is a
|
|
18
|
+
* `z.looseObject`, so the index signature (and with it the round-trip promise of
|
|
19
|
+
* BACKWARD_COMPATIBILITY.md §3) survives; what it adds is the NAMES of the keys the server knows.
|
|
20
|
+
*
|
|
21
|
+
* The cast is unchanged in kind — the file is user-editable JSON and is deliberately NOT parsed
|
|
22
|
+
* through the schema, because a single malformed pref must not discard the whole bag (§3). What
|
|
23
|
+
* the type asserts is the wire shape the route promises; the write side (`PUT /ui-state`, validated
|
|
24
|
+
* by `uiStateBody`) is what actually enforces it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readUiState(repoRoot: string): Promise<UiState>;
|
package/dist/ui-state.js
CHANGED
|
@@ -12,7 +12,20 @@ import { join } from 'node:path';
|
|
|
12
12
|
export function uiStatePath(repoRoot) {
|
|
13
13
|
return join(repoRoot, '.ai/cezar', 'ui-state.json');
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Read `ui-state.json` on demand — never cached, never throws.
|
|
17
|
+
*
|
|
18
|
+
* Typed by the CONTRACT (`UiState`), not by a loose record: `GET /api/v1/ui-state` answers this
|
|
19
|
+
* value verbatim, so a `Record<string, unknown>` here made the route name no key at all and the
|
|
20
|
+
* per-route parity guard vacuous — the same defect `healthSnapshot` had. `UiState` is a
|
|
21
|
+
* `z.looseObject`, so the index signature (and with it the round-trip promise of
|
|
22
|
+
* BACKWARD_COMPATIBILITY.md §3) survives; what it adds is the NAMES of the keys the server knows.
|
|
23
|
+
*
|
|
24
|
+
* The cast is unchanged in kind — the file is user-editable JSON and is deliberately NOT parsed
|
|
25
|
+
* through the schema, because a single malformed pref must not discard the whole bag (§3). What
|
|
26
|
+
* the type asserts is the wire shape the route promises; the write side (`PUT /ui-state`, validated
|
|
27
|
+
* by `uiStateBody`) is what actually enforces it.
|
|
28
|
+
*/
|
|
16
29
|
export async function readUiState(repoRoot) {
|
|
17
30
|
try {
|
|
18
31
|
const parsed = JSON.parse(await readFile(uiStatePath(repoRoot), 'utf8'));
|
package/dist/ui-state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-state.js","sourceRoot":"","sources":["../src/ui-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ui-state.js","sourceRoot":"","sources":["../src/ui-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAAgB;IAChD,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QAClF,OAAO,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAE,MAAkB,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/workflows/load.d.ts
CHANGED
package/dist/workflows/run.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { RunnerId } from '../core/agent-runner.
|
|
2
|
-
import type { ContentBlock } from '../core/agent-runner.
|
|
3
|
-
import { type Skill } from '../skills.
|
|
4
|
-
import type { QueuedMessage, RunRecord, RunStore } from '../runs/store.
|
|
5
|
-
import { WorkspaceSemaphore } from '../workspace/semaphore.
|
|
6
|
-
import { type WorkflowDef } from './types.
|
|
1
|
+
import type { RunnerId } from '../core/agent-runner.ts';
|
|
2
|
+
import type { ContentBlock } from '../core/agent-runner.ts';
|
|
3
|
+
import { type Skill } from '../skills.ts';
|
|
4
|
+
import type { QueuedMessage, RunRecord, RunStore } from '../runs/store.ts';
|
|
5
|
+
import { WorkspaceSemaphore, type AccountHolds } from '../workspace/semaphore.ts';
|
|
6
|
+
import { type WorkflowDef } from './types.ts';
|
|
7
7
|
/** An interactive session that hears nothing from the user closes itself. */
|
|
8
8
|
export declare const IDLE_TIMEOUT_MS: number;
|
|
9
9
|
/**
|
|
@@ -20,11 +20,65 @@ export declare const AUTOSAVE_INTERVAL_MS = 90000;
|
|
|
20
20
|
* noise interleaving PR history. The flushes (`autosaveCommit` at turn end and before
|
|
21
21
|
* a draft PR) are NOT gated: the branch must still end holding the finished state. */
|
|
22
22
|
export declare function periodicAutosaveEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Explicitly opt out of the repository-root lease for runs that execute in the
|
|
25
|
+
* current checkout. This covers explicit worktree opt-out, non-Git degradation,
|
|
26
|
+
* and continuations whose worktree cannot be restored (spec 006 hardening, #438).
|
|
27
|
+
* This is intentionally unsafe: concurrent agents may overwrite each other's
|
|
28
|
+
* files or Git state. Isolated worktree runs are unaffected.
|
|
29
|
+
*/
|
|
30
|
+
export declare function repositoryRootLockDisabled(env?: NodeJS.ProcessEnv): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Auto-resume after a provider usage limit (spec 2026-08-03-auto-resume-after-usage-limit).
|
|
33
|
+
*
|
|
34
|
+
* The wait is the provider's own reset instant plus this grace: resuming AT the boundary races the
|
|
35
|
+
* provider's clock (and its rounding), and one failed resume costs the whole window over again.
|
|
36
|
+
* Thirty seconds is cheap next to five hours and long enough to be past any sane skew.
|
|
37
|
+
*/
|
|
38
|
+
export declare const AUTO_RESUME_GRACE_MS = 30000;
|
|
39
|
+
/**
|
|
40
|
+
* Consecutive automatic resumes allowed without a human turn. A resume can only fire after a real
|
|
41
|
+
* reset instant, so this is not a throttle — it is the backstop for the pathological case (a
|
|
42
|
+
* provider that answers "limit reached, retry now" in a loop), and it is deliberately generous
|
|
43
|
+
* enough to sit through a couple of days of five-hour windows.
|
|
44
|
+
*/
|
|
45
|
+
export declare const MAX_AUTO_RESUMES = 12;
|
|
46
|
+
/**
|
|
47
|
+
* How long a missed deadline stays worth acting on. The promise is "we pick this up when the
|
|
48
|
+
* window reopens" — kept across a restart or an overnight close, which is the case the feature
|
|
49
|
+
* exists for. A day later it is no longer that promise: the user has moved on, and a task
|
|
50
|
+
* springing back to life is a surprise rather than a service. Such a deadline is retired with a
|
|
51
|
+
* note instead of fired, so the only tasks a sweep can revive are ones someone is still waiting on.
|
|
52
|
+
*/
|
|
53
|
+
export declare const AUTO_RESUME_MISSED_WINDOW_MS: number;
|
|
54
|
+
/**
|
|
55
|
+
* How often the queue checks that it is not wedged.
|
|
56
|
+
*
|
|
57
|
+
* A hold is the only thing in the engine that can make an idle queue CORRECT, so it is also the
|
|
58
|
+
* only thing that can make a wedged one look correct. This tick is the way out: cheap (a few
|
|
59
|
+
* in-memory checks), unref'd, and it only ever acts when idling has no justification left.
|
|
60
|
+
*/
|
|
61
|
+
export declare const QUEUE_WATCHDOG_MS = 60000;
|
|
62
|
+
/**
|
|
63
|
+
* Which agent ACCOUNT a run's work runs on — the thing a provider usage limit actually closes
|
|
64
|
+
* (spec 2026-08-03-auto-resume-after-usage-limit).
|
|
65
|
+
*
|
|
66
|
+
* Backend plus agent account, because those are the two axes a limit is scoped to: a Claude
|
|
67
|
+
* limit must never stall a Codex task, and a second Claude login is a second budget. A record
|
|
68
|
+
* that names no runner has not started yet and will take the configured default, which is what
|
|
69
|
+
* `fallbackRunner` carries; a run that HAS started always carries its resolved runner (execute
|
|
70
|
+
* persists it), and only started runs can be holding.
|
|
71
|
+
*/
|
|
72
|
+
export declare function runAccountKey(run: Pick<RunRecord, 'runner' | 'agentProfile'>, fallbackRunner: RunnerId): string;
|
|
23
73
|
export interface StartRunInput {
|
|
24
74
|
task: string;
|
|
25
75
|
model?: string;
|
|
26
76
|
/** Agent backend chosen for this task (GUI). Unset = the config default. */
|
|
27
77
|
runner?: RunnerId;
|
|
78
|
+
/** Agent account for this task (spec 2026-07-29-agent-profiles), applying to steps that run
|
|
79
|
+
* on `runner`. Unset = the project's own selection. Persisted on the record so the choice
|
|
80
|
+
* survives into resume and Continue, and so the thread can say which account did the work. */
|
|
81
|
+
agentProfile?: string;
|
|
28
82
|
/** Screenshots pasted into the new-task form — persisted when the run is
|
|
29
83
|
* created and delivered once, with the first agent step's opening message. */
|
|
30
84
|
images?: ContentBlock[];
|
|
@@ -33,9 +87,8 @@ export interface StartRunInput {
|
|
|
33
87
|
* `resolveExtraSystemPrompt` for the precedence contract. */
|
|
34
88
|
systemPrompt?: string;
|
|
35
89
|
/** Composer opt-out (#worktree-toggle): `false` runs the task in the repo
|
|
36
|
-
* working tree instead of an isolated worktree
|
|
37
|
-
*
|
|
38
|
-
* Ignored for variants (they always isolate). */
|
|
90
|
+
* working tree instead of an isolated worktree. Undefined/`true` keeps the
|
|
91
|
+
* default per-task worktree. Ignored for variants (they always isolate). */
|
|
39
92
|
worktree?: boolean;
|
|
40
93
|
/** Autonomous mode (#autonomous): the run never parks at `waiting` for the
|
|
41
94
|
* user — turn-ends auto-continue until the agent signals done or the safety
|
|
@@ -69,6 +122,15 @@ export declare function resolveExtraSystemPrompt(override: string | undefined, c
|
|
|
69
122
|
* divider the skill+handoff composition has always used.
|
|
70
123
|
*/
|
|
71
124
|
export declare function composeSystemPrompt(...parts: Array<string | undefined>): string;
|
|
125
|
+
/**
|
|
126
|
+
* The directories a spawned agent may reach outside its worktree: the run-state
|
|
127
|
+
* folder that holds its handoff file, plus its own temp directory when this run
|
|
128
|
+
* got one (#785). Handing an agent a `TMPDIR` its file tools are not allowed to
|
|
129
|
+
* write would trade one silent failure for another, so the two travel together;
|
|
130
|
+
* under `CEZ_AGENT_TMPDIR=0` there is no per-run directory and the list is
|
|
131
|
+
* exactly what it always was.
|
|
132
|
+
*/
|
|
133
|
+
export declare function agentDirectories(runsDir: string, env: Record<string, string>): string[];
|
|
72
134
|
/**
|
|
73
135
|
* Materialized pasted attachment: the on-disk name/serving-URL pair the
|
|
74
136
|
* transcript already used, plus the absolute path that lets the agent
|
|
@@ -123,7 +185,13 @@ export declare class RunManager {
|
|
|
123
185
|
private readonly queue;
|
|
124
186
|
private readonly starting;
|
|
125
187
|
private readonly waiting;
|
|
188
|
+
/** Durable monitoring subset. Only the configured number receives the waiting-slot exemption. */
|
|
189
|
+
private readonly monitoring;
|
|
126
190
|
private readonly pendingJobs;
|
|
191
|
+
/** Interrupted agent turns recovered after a process restart. Unlike an
|
|
192
|
+
* explicit user Continue, these are bulk scheduler work and must re-enter
|
|
193
|
+
* through `pump()` so both workspace and per-project caps are honored. */
|
|
194
|
+
private readonly pendingContinuations;
|
|
127
195
|
/** Per-run image counter behind `pasted-<n>` / `screenshot-<n>` (#472). Lives on
|
|
128
196
|
* the manager rather than the `ActiveRun` so a *queued* run — which has no
|
|
129
197
|
* `ActiveRun` at all — can persist attachments. Seeded lazily from disk. */
|
|
@@ -131,14 +199,21 @@ export declare class RunManager {
|
|
|
131
199
|
/** Messages that landed in the dequeue → session-open gap (#472), flushed as
|
|
132
200
|
* ordinary follow-up turns the moment the session opens. In-memory only. */
|
|
133
201
|
private readonly deferredMessages;
|
|
202
|
+
/** Armed usage-limit resumes, keyed by run id (spec
|
|
203
|
+
* 2026-08-03-auto-resume-after-usage-limit). The DEADLINE itself lives on the record
|
|
204
|
+
* (`autoResumeAt`) — this map holds only the process-local timer, so a restart rebuilds it
|
|
205
|
+
* from the record rather than losing the wait. Runs here are `failed` and therefore NOT in
|
|
206
|
+
* `active`, which is why the timer cannot live on an `ActiveRun` like the monitoring one. */
|
|
207
|
+
private readonly autoResumeTimers;
|
|
134
208
|
private pumping;
|
|
135
209
|
/** A pump that arrived while one was in flight — replayed by `pump()`'s own
|
|
136
210
|
* loop so a slot freed mid-sweep is never a lost wakeup. */
|
|
137
211
|
private pumpAgain;
|
|
138
212
|
/**
|
|
139
213
|
* Runs normally isolate in worktrees and may execute in parallel. When that
|
|
140
|
-
* isolation is unavailable (or explicitly disabled),
|
|
141
|
-
*
|
|
214
|
+
* isolation is unavailable (or explicitly disabled), access to `repoRoot` is
|
|
215
|
+
* serialized by default so two agents cannot edit/revert the same files
|
|
216
|
+
* (#438). `CEZ_DISABLE_REPO_LOCK=1` deliberately bypasses this safety lease.
|
|
142
217
|
*/
|
|
143
218
|
private repoRootTail;
|
|
144
219
|
/** `.ai/cezar` — where the per-task handoff files and todos.json live. */
|
|
@@ -149,6 +224,13 @@ export declare class RunManager {
|
|
|
149
224
|
/** Unsubscribe handle for the constructor's `onUsage` subscription — released
|
|
150
225
|
* by dispose() so a torn-down manager stops receiving sampler ticks. */
|
|
151
226
|
private readonly offUsage;
|
|
227
|
+
/** The stalled-queue watchdog (see `rescueStalledQueue`). */
|
|
228
|
+
private readonly queueWatchdog;
|
|
229
|
+
/** Set by the watchdog for exactly one sweep: ignore the usage-limit hold and make progress. */
|
|
230
|
+
private forceNextPump;
|
|
231
|
+
/** Runs the watchdog started despite the hold. The spawn-time gate (`requeueWhileHeld`) would
|
|
232
|
+
* otherwise hand them straight back and the rescue would undo itself in a millisecond. */
|
|
233
|
+
private readonly forceStarted;
|
|
152
234
|
/** The workspace-wide parallel-cap semaphore + cached resource config
|
|
153
235
|
* (spec 2026-07-20, step 2.5). Boot constructs ONE and every manager shares
|
|
154
236
|
* it; the private fallback keeps single-manager callers and tests working. */
|
|
@@ -186,8 +268,33 @@ export declare class RunManager {
|
|
|
186
268
|
* key would let a value inherited from *this* process through — a nested
|
|
187
269
|
* cezar (an agent running `cez serve`/`cez run`/the test suite) would then
|
|
188
270
|
* write follow-ups into the parent's inbox despite the opt-out. Empty is the
|
|
189
|
-
* established "absent" spelling — consumers guard with `if (todosFile)`.
|
|
271
|
+
* established "absent" spelling — consumers guard with `if (todosFile)`.
|
|
272
|
+
*
|
|
273
|
+
* `TMPDIR`/`TEMP`/`TMP` (#785) point at this run's own scratch directory
|
|
274
|
+
* instead of the machine-wide one every agent used to share. Created and
|
|
275
|
+
* write-probed here, on the last common path before a spawn, so an unusable
|
|
276
|
+
* temp directory throws `AgentTempDirError` at the caller rather than
|
|
277
|
+
* turning into empty command output inside a running agent. */
|
|
190
278
|
private agentEnv;
|
|
279
|
+
/**
|
|
280
|
+
* `agentEnv` plus the agent-account variable for the profile this STEP runs under (spec
|
|
281
|
+
* 2026-07-29-agent-profiles), and the id it resolved to so the caller can record it.
|
|
282
|
+
*
|
|
283
|
+
* Resolved per step, not per run, because a workflow can mix backends: an override naming a
|
|
284
|
+
* Claude account says nothing about which Codex account a codex step should use. Resolution
|
|
285
|
+
* order, most specific first:
|
|
286
|
+
*
|
|
287
|
+
* 1. the step's ALREADY-RECORDED `profileId` — a resume or Continue must reattach to the
|
|
288
|
+
* account that created the session, whatever the project has since been switched to;
|
|
289
|
+
* 2. the run's composer override, but only for steps on the run's own runner;
|
|
290
|
+
* 3. the project's stored selection, and failing that the discovered default.
|
|
291
|
+
*
|
|
292
|
+
* Read fresh every time. `~/.cezar/config.json` is shared by every cezar process on this
|
|
293
|
+
* machine, so a cached snapshot is a staleness bug, and one small JSON read is free next to
|
|
294
|
+
* spawning a CLI. Never throws: an unreadable home degrades to the default profile, which is
|
|
295
|
+
* exactly the behaviour that predates profiles.
|
|
296
|
+
*/
|
|
297
|
+
private agentEnvForStep;
|
|
191
298
|
startRun(workflow: WorkflowDef, input: StartRunInput, group?: {
|
|
192
299
|
groupId: string;
|
|
193
300
|
variant: string;
|
|
@@ -235,6 +342,22 @@ export declare class RunManager {
|
|
|
235
342
|
* root (spec 006 degradation rule), which is always the tighter bound.
|
|
236
343
|
*/
|
|
237
344
|
private pump;
|
|
345
|
+
/**
|
|
346
|
+
* Make one `queued` RECORD executable again — the engine half a queued run needs but does not
|
|
347
|
+
* persist (`pendingJobs` / `pendingContinuations` are process-local, the record is not).
|
|
348
|
+
*
|
|
349
|
+
* Two callers, one path: boot recovery re-adopts everything the previous process was holding,
|
|
350
|
+
* and the queue watchdog re-adopts anything the running process has somehow lost. A queued
|
|
351
|
+
* record with no work item behind it is invisible to `pump()` and would sit there for good,
|
|
352
|
+
* which is the worst failure this engine has — the task is neither running nor failed, just
|
|
353
|
+
* silently never going to happen.
|
|
354
|
+
*
|
|
355
|
+
* A continuation is reconstructed first: its executable details are gone, but the pending
|
|
356
|
+
* `continue-N` step and the session before it are durable, which is enough. Otherwise the
|
|
357
|
+
* workflow is revived from the record. A run that can be neither is failed loudly rather than
|
|
358
|
+
* left in the queue as a ghost.
|
|
359
|
+
*/
|
|
360
|
+
private reviveQueuedRun;
|
|
238
361
|
/**
|
|
239
362
|
* Startup recovery (#367) — re-adopt runs that were live when the previous
|
|
240
363
|
* cezar process exited (requires the store opened with `keepLive`):
|
|
@@ -251,6 +374,97 @@ export declare class RunManager {
|
|
|
251
374
|
private reviveWorkflow;
|
|
252
375
|
/** Remove a run from the live registries — keeps `waiting ⊆ active`. */
|
|
253
376
|
private dropActive;
|
|
377
|
+
/**
|
|
378
|
+
* A run just failed: if the provider said "usage limit, back at T", promise to resume it at
|
|
379
|
+
* `T + AUTO_RESUME_GRACE_MS` instead of leaving the task dead until someone notices.
|
|
380
|
+
*
|
|
381
|
+
* Every refusal below is silent-but-honest — the run stays `failed` with its Continue button,
|
|
382
|
+
* which is exactly the pre-feature behavior — except the safety cap, which says so on the
|
|
383
|
+
* transcript, because a run that stops resuming itself needs to explain why.
|
|
384
|
+
*/
|
|
385
|
+
private scheduleAutoResumeIfLimited;
|
|
386
|
+
/** Publish the deadline on the record (the cockpit's only source) and arm the timer for it. */
|
|
387
|
+
private armAutoResume;
|
|
388
|
+
/**
|
|
389
|
+
* The window has reopened. Re-check the record synchronously — hours may have passed, and the
|
|
390
|
+
* user may have continued, deleted or cancelled the run in them — then hand the resume to the
|
|
391
|
+
* ordinary queued-continuation path so it obeys both concurrency caps like any other work.
|
|
392
|
+
*/
|
|
393
|
+
private fireAutoResume;
|
|
394
|
+
/**
|
|
395
|
+
* Make the armed timers agree with the records and the current setting. Runs on every `pump()`
|
|
396
|
+
* — which is where a settings change lands (a config PUT refreshes the shared semaphore, which
|
|
397
|
+
* pumps every manager) — and once from `recover()`.
|
|
398
|
+
*
|
|
399
|
+
* It is a RECONCILE rather than a one-shot restore because the deadline is durable state and
|
|
400
|
+
* the timer is not: a restart, a rebuilt project context, a manager disposed mid-wait, or a
|
|
401
|
+
* refusal all leave a record promising a resume that no timer is holding. Rebuilding from the
|
|
402
|
+
* record covers every one of those at once — the alternative is a hint counting down to a time
|
|
403
|
+
* that has already passed, which is exactly the failure this method exists to make impossible.
|
|
404
|
+
*
|
|
405
|
+
* Cheap: an in-memory scan, and arming is skipped for every run already held.
|
|
406
|
+
*/
|
|
407
|
+
private reconcileAutoResumes;
|
|
408
|
+
/**
|
|
409
|
+
* Hand a run that has not spawned anything back to the queue, when the account it would run on
|
|
410
|
+
* went into a usage-limit hold (spec 2026-08-03-auto-resume-after-usage-limit).
|
|
411
|
+
*
|
|
412
|
+
* The dequeue-time gate in `pump()` cannot be the only one: a run can sit between dequeue and
|
|
413
|
+
* spawn for a long time — an in-place run waiting for the exclusive repo-root lease is the
|
|
414
|
+
* measured case — and the account can close in that gap. This is the last honest moment to
|
|
415
|
+
* refuse, because everything after it costs a real agent turn.
|
|
416
|
+
*
|
|
417
|
+
* "Untouched" is the contract: the run has created no session and no worktree, so it goes back
|
|
418
|
+
* as plain `queued` with its `startedAt` cleared, and `pump()` will pick it up when the window
|
|
419
|
+
* reopens. Returns true when the caller must abandon the run.
|
|
420
|
+
*/
|
|
421
|
+
private requeueWhileHeld;
|
|
422
|
+
/**
|
|
423
|
+
* The failsafe: a queue must never be able to wedge.
|
|
424
|
+
*
|
|
425
|
+
* Everything else in this file makes an idle queue CORRECT under some condition — a slot cap, a
|
|
426
|
+
* repo-root lease, and now a usage-limit hold. That is also what makes a wedged queue look
|
|
427
|
+
* correct, and the hold has already produced one in the field: two resumes fired together, each
|
|
428
|
+
* holding the account the other was waiting on, and the whole workspace stopped with every task
|
|
429
|
+
* `queued`. That specific bug is fixed and tested, but "the queue stopped and nothing will ever
|
|
430
|
+
* restart it" is too expensive a failure mode to leave resting on any single fix being right.
|
|
431
|
+
*
|
|
432
|
+
* The test is deliberately about JUSTIFICATION rather than about any particular bug: idling is
|
|
433
|
+
* legitimate while work is running (here or in another project), or while a real appointment is
|
|
434
|
+
* still ahead — a scheduled resume that will fire and pump on its own. Anything else is a
|
|
435
|
+
* queue with work in it, nothing running anywhere, and no event coming to wake it. That gets one
|
|
436
|
+
* forced sweep, which starts work under the ordinary caps and lets the account's real state
|
|
437
|
+
* re-assert itself: if the window truly is shut, that task meets the limit and re-establishes an
|
|
438
|
+
* honest hold, with a real deadline behind it this time.
|
|
439
|
+
*
|
|
440
|
+
* Public so a test can drive the wedge directly instead of waiting out the interval.
|
|
441
|
+
*/
|
|
442
|
+
rescueStalledQueue(now?: number): Promise<void>;
|
|
443
|
+
/**
|
|
444
|
+
* The accounts this project is currently holding: one key per run parked on a usage-limit
|
|
445
|
+
* resume that has not come due yet (spec 2026-08-03-auto-resume-after-usage-limit).
|
|
446
|
+
*
|
|
447
|
+
* Published to the shared semaphore so the hold spans PROJECTS — one Claude account can be
|
|
448
|
+
* driving tasks in three repos, and a limit closes it for all of them. Derived from the
|
|
449
|
+
* records on every ask rather than tracked as state: a deadline that passes, a resume that
|
|
450
|
+
* fires, a cancel, an archive and a delete all lift the hold with no bookkeeping.
|
|
451
|
+
*
|
|
452
|
+
* Deliberately excludes a deadline that has already passed — that run is about to resume, and
|
|
453
|
+
* holding the queue for it would only stall the very work the window reopened for.
|
|
454
|
+
*/
|
|
455
|
+
accountHolds(now?: number): AccountHolds;
|
|
456
|
+
/**
|
|
457
|
+
* The PER-TASK off switch (`DELETE /api/v1/runs/:id/auto-resume`, and the archive route):
|
|
458
|
+
* stop resuming THIS task, without touching the workspace setting or any other task.
|
|
459
|
+
*
|
|
460
|
+
* Idempotent — a run with nothing pending answers the same way, because "this task will not
|
|
461
|
+
* resume itself" is equally true either way. Returns false only when the run does not exist,
|
|
462
|
+
* which is the route's 404.
|
|
463
|
+
*/
|
|
464
|
+
cancelAutoResume(runId: string): boolean;
|
|
465
|
+
/** Retire a pending resume — timer, deadline and counter. The counter goes too because every
|
|
466
|
+
* caller is a fresh epoch: a human Continue, or a resume that re-stamps its own count. */
|
|
467
|
+
private clearAutoResume;
|
|
254
468
|
/** Reclaim finished worktrees beyond the keep-limit (#483) — directory only,
|
|
255
469
|
* `cez/<id8>` branch kept. Best-effort; a failure never affects run
|
|
256
470
|
* lifecycle. `review`/live runs are excluded by the selector. */
|
|
@@ -295,12 +509,18 @@ export declare class RunManager {
|
|
|
295
509
|
* bound — asserted directly by a test.
|
|
296
510
|
*/
|
|
297
511
|
private hydrateQueuedInput;
|
|
512
|
+
/** Apply edits and messages made while a restart continuation waits for
|
|
513
|
+
* capacity. The durable record remains the source of truth, just as it is for
|
|
514
|
+
* an ordinary queued workflow (#472), so a second restart reconstructs and
|
|
515
|
+
* hydrates the same amendments instead of dropping them. */
|
|
516
|
+
private hydrateQueuedContinuation;
|
|
517
|
+
private readPersistedImages;
|
|
298
518
|
/**
|
|
299
519
|
* Still waiting for a slot? Checked against the engine's own queue rather than
|
|
300
520
|
* the record's `status` (#472): the record is written by `execute()` a tick
|
|
301
521
|
* after `pump()` dequeues, so a status read can see `queued` for a run that has
|
|
302
|
-
* already started.
|
|
303
|
-
* the authoritative answer for "can this prompt still be amended".
|
|
522
|
+
* already started. The pending maps are deleted synchronously at dequeue, so
|
|
523
|
+
* they are the authoritative answer for "can this prompt still be amended".
|
|
304
524
|
*/
|
|
305
525
|
private isQueued;
|
|
306
526
|
/** Split `ContentBlock[]` into the persisted shape a stacked message holds. */
|
|
@@ -351,6 +571,9 @@ export declare class RunManager {
|
|
|
351
571
|
* then offers "Continue" instead.
|
|
352
572
|
*/
|
|
353
573
|
sendMessage(runId: string, content: ContentBlock[]): boolean;
|
|
574
|
+
/** Shared live-session delivery. Synthetic scheduler prompts reuse lifecycle
|
|
575
|
+
* bookkeeping without masquerading as user-authored transcript messages. */
|
|
576
|
+
private deliverMessage;
|
|
354
577
|
/** Close the open session gracefully — the run then completes as `done`
|
|
355
578
|
* (or rests at `review` when the worktree holds changes, spec 009).
|
|
356
579
|
* On a run already resting at `review` (no session — the engine loop is
|
|
@@ -368,7 +591,10 @@ export declare class RunManager {
|
|
|
368
591
|
images?: ContentBlock[];
|
|
369
592
|
runner?: RunnerId;
|
|
370
593
|
model?: string;
|
|
371
|
-
}
|
|
594
|
+
},
|
|
595
|
+
/** Restart recovery may discover several interrupted tasks at once. Those
|
|
596
|
+
* continuations are queued; an explicit user Continue remains immediate. */
|
|
597
|
+
deferForCapacity?: boolean): {
|
|
372
598
|
ok: boolean;
|
|
373
599
|
error?: string;
|
|
374
600
|
};
|
|
@@ -389,6 +615,17 @@ export declare class RunManager {
|
|
|
389
615
|
/** Native backend asks arrive before turn-end. Persist and park immediately
|
|
390
616
|
* so the cockpit shows attention and the run releases its workspace slot. */
|
|
391
617
|
private handleRunnerUiEvent;
|
|
618
|
+
/** Persist the invocation checkpoint before launching a runner. A throw or
|
|
619
|
+
* process exit before `turn.started` therefore leaves a durable mismatch. */
|
|
620
|
+
private beginUsageInvocation;
|
|
621
|
+
/** Fold backend-neutral completed-turn usage into the current step exactly
|
|
622
|
+
* once. Invocation/turn counters are written before the event reaches the
|
|
623
|
+
* NDJSON sink so crashes cannot preserve a falsely complete subtotal. */
|
|
624
|
+
private recordUsageUiEvent;
|
|
625
|
+
/** Usage completeness is a crash boundary, unlike high-frequency token
|
|
626
|
+
* snapshots: the checkpoint must reach `runs.json` before the runner starts
|
|
627
|
+
* or the matching UI event is persisted and forwarded. */
|
|
628
|
+
private persistUsageCheckpoint;
|
|
392
629
|
/**
|
|
393
630
|
* Turn-end bookkeeping (#389), shared by `runAgentStep` and
|
|
394
631
|
* `runContinuation` — called (fire-and-forget) from every `turn-end` event:
|
|
@@ -464,6 +701,9 @@ export declare class RunManager {
|
|
|
464
701
|
private persistImage;
|
|
465
702
|
private armIdleTimer;
|
|
466
703
|
private clearIdleTimer;
|
|
704
|
+
private reconcileMonitoringWakeTimers;
|
|
705
|
+
private armMonitoringWakeTimer;
|
|
706
|
+
private clearMonitoringWakeTimer;
|
|
467
707
|
/** Autosave-commit the worktree every 90 s while the run lives (spec 006).
|
|
468
708
|
* Opt-in via CEZ_AUTOSAVE=1 (#471) — see periodicAutosaveEnabled. */
|
|
469
709
|
private armAutosave;
|
|
@@ -492,3 +732,24 @@ export declare function makeRunTitle(task: string, workflow: WorkflowDef): strin
|
|
|
492
732
|
* they are materialized into the worktree separately (see the call site).
|
|
493
733
|
*/
|
|
494
734
|
export declare function skillSystemPrompt(skill: Pick<Skill, 'name' | 'description' | 'body'> & Partial<Pick<Skill, 'path' | 'source'>>): string;
|
|
735
|
+
/**
|
|
736
|
+
* Expand a registry-backed slash skill in one prompt string before it reaches a
|
|
737
|
+
* backend. Claude otherwise intercepts an unknown leading slash command, and
|
|
738
|
+
* Codex/OpenCode have no native slash-skill lookup at all (#676).
|
|
739
|
+
*
|
|
740
|
+
* Only a match at character zero counts, and unknown commands pass through
|
|
741
|
+
* byte-for-byte — a backend's OWN slash commands must keep working. The caller
|
|
742
|
+
* persists the original user text before applying this delivery-only rewrite.
|
|
743
|
+
*
|
|
744
|
+
* Both delivery seams route through here: live-session messages via
|
|
745
|
+
* `expandRegistrySlashSkill`, and a continuation's opening prompt, which becomes
|
|
746
|
+
* the session's `userPrompt` and never passes through `deliverMessage` at all
|
|
747
|
+
* (#811).
|
|
748
|
+
*/
|
|
749
|
+
export declare function expandRegistrySlashSkillText(text: string, skills: readonly Skill[]): string;
|
|
750
|
+
/**
|
|
751
|
+
* `expandRegistrySlashSkillText` over a live chat message: only the first text
|
|
752
|
+
* block is eligible, and an unchanged block returns the caller's array
|
|
753
|
+
* identity untouched.
|
|
754
|
+
*/
|
|
755
|
+
export declare function expandRegistrySlashSkill(content: ContentBlock[], skills: readonly Skill[]): ContentBlock[];
|