@wjarka/cezarion 0.15.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -46
- package/dist/agent-config/catalog.d.ts +6 -2
- package/dist/agent-config/catalog.js +78 -3
- package/dist/agent-config/catalog.js.map +1 -1
- package/dist/agent-config/model-settings/shared.js +6 -3
- package/dist/agent-config/model-settings/shared.js.map +1 -1
- package/dist/agent-config/models.js +4 -0
- package/dist/agent-config/models.js.map +1 -1
- package/dist/agent-config/validate.js +6 -0
- package/dist/agent-config/validate.js.map +1 -1
- package/dist/artifacts/cli.js +10 -2
- package/dist/artifacts/cli.js.map +1 -1
- package/dist/automations/coordinator.d.ts +7 -0
- package/dist/automations/coordinator.js +22 -2
- package/dist/automations/coordinator.js.map +1 -1
- package/dist/automations/github-poller.d.ts +4 -4
- package/dist/automations/github-poller.js.map +1 -1
- package/dist/automations/schedule-runner.d.ts +130 -0
- package/dist/automations/schedule-runner.js +326 -0
- package/dist/automations/schedule-runner.js.map +1 -0
- package/dist/automations/scheduler.d.ts +38 -7
- package/dist/automations/scheduler.js +90 -22
- package/dist/automations/scheduler.js.map +1 -1
- package/dist/automations/store.d.ts +80 -3
- package/dist/automations/store.js +208 -16
- package/dist/automations/store.js.map +1 -1
- package/dist/automations/task-template.d.ts +42 -6
- package/dist/automations/task-template.js +152 -24
- package/dist/automations/task-template.js.map +1 -1
- package/dist/automations/types.d.ts +142 -6
- package/dist/automations/types.js +64 -6
- package/dist/automations/types.js.map +1 -1
- package/dist/autosave-holders.js +8 -12
- package/dist/autosave-holders.js.map +1 -1
- package/dist/ci-wait/client.d.ts +8 -1
- package/dist/ci-wait/client.js +43 -1
- package/dist/ci-wait/client.js.map +1 -1
- package/dist/ci-wait/controller.d.ts +83 -4
- package/dist/ci-wait/controller.js +76 -11
- package/dist/ci-wait/controller.js.map +1 -1
- package/dist/ci-wait/errors.d.ts +7 -1
- package/dist/ci-wait/errors.js +36 -0
- package/dist/ci-wait/errors.js.map +1 -1
- package/dist/ci-wait/github.d.ts +2 -0
- package/dist/ci-wait/github.js +3 -1
- package/dist/ci-wait/github.js.map +1 -1
- package/dist/ci-wait/mcp.d.ts +2 -98
- package/dist/ci-wait/mcp.js +11 -25
- package/dist/ci-wait/mcp.js.map +1 -1
- package/dist/ci-wait/supervisor.d.ts +2 -1
- package/dist/ci-wait/supervisor.js +2 -1
- package/dist/ci-wait/supervisor.js.map +1 -1
- package/dist/ci-wait/tools.d.ts +307 -0
- package/dist/ci-wait/tools.js +63 -0
- package/dist/ci-wait/tools.js.map +1 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -1
- package/dist/contract/agent-config.d.ts +5 -0
- package/dist/contract/agent-profiles.d.ts +15 -0
- package/dist/contract/automation-schedule.d.ts +60 -0
- package/dist/contract/automations.d.ts +208 -36
- package/dist/contract/delegation.d.ts +96 -0
- package/dist/contract/discovery.d.ts +7 -0
- package/dist/contract/github.d.ts +1 -0
- package/dist/contract/health.d.ts +6 -0
- package/dist/contract/index.d.ts +3 -0
- package/dist/contract/index.js +1445 -745
- package/dist/contract/preview.d.ts +508 -0
- package/dist/contract/runs.d.ts +716 -15
- package/dist/contract/skills.d.ts +39 -0
- package/dist/contract/workflows.d.ts +6 -0
- package/dist/contract/workspace.d.ts +65 -0
- package/dist/contract/zoned-time.d.ts +35 -0
- package/dist/core/agent-env.d.ts +11 -0
- package/dist/core/agent-env.js +27 -5
- package/dist/core/agent-env.js.map +1 -1
- package/dist/core/agent-profiles.js +7 -0
- package/dist/core/agent-profiles.js.map +1 -1
- package/dist/core/agent-runner.d.ts +49 -1
- package/dist/core/agent-runner.js +2 -1
- package/dist/core/agent-runner.js.map +1 -1
- package/dist/core/backend-detect.d.ts +3 -2
- package/dist/core/backend-detect.js +27 -1
- package/dist/core/backend-detect.js.map +1 -1
- package/dist/core/claude-cli-runner.d.ts +1 -0
- package/dist/core/claude-cli-runner.js +69 -19
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/codex-app-server-runner.d.ts +1 -0
- package/dist/core/codex-app-server-runner.js +200 -25
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/codex-app-server-transport.d.ts +7 -3
- package/dist/core/codex-app-server-transport.js +11 -9
- package/dist/core/codex-app-server-transport.js.map +1 -1
- package/dist/core/cursor-acp-runner.d.ts +1 -0
- package/dist/core/cursor-acp-runner.js +24 -9
- package/dist/core/cursor-acp-runner.js.map +1 -1
- package/dist/core/host-model-catalog.js +2 -0
- package/dist/core/host-model-catalog.js.map +1 -1
- package/dist/core/managed-session.js +2 -0
- package/dist/core/managed-session.js.map +1 -1
- package/dist/core/model-identity.js +2 -0
- package/dist/core/model-identity.js.map +1 -1
- package/dist/core/model-presets.js +3 -0
- package/dist/core/model-presets.js.map +1 -1
- package/dist/core/omp-model-catalog.d.ts +43 -0
- package/dist/core/omp-model-catalog.js +205 -0
- package/dist/core/omp-model-catalog.js.map +1 -0
- package/dist/core/omp-runner.d.ts +73 -0
- package/dist/core/omp-runner.js +990 -0
- package/dist/core/omp-runner.js.map +1 -0
- package/dist/core/omp-ui-mapper.d.ts +106 -0
- package/dist/core/omp-ui-mapper.js +882 -0
- package/dist/core/omp-ui-mapper.js.map +1 -0
- package/dist/core/opencode-server-runner.d.ts +18 -4
- package/dist/core/opencode-server-runner.js +337 -96
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/opencode-session-error.d.ts +11 -0
- package/dist/core/opencode-session-error.js +26 -0
- package/dist/core/opencode-session-error.js.map +1 -0
- package/dist/core/opencode-ui-mapper.js +4 -36
- package/dist/core/opencode-ui-mapper.js.map +1 -1
- package/dist/core/pi-runner.d.ts +1 -0
- package/dist/core/pi-runner.js +75 -12
- package/dist/core/pi-runner.js.map +1 -1
- package/dist/core/provider-auth.d.ts +9 -2
- package/dist/core/provider-auth.js +43 -6
- package/dist/core/provider-auth.js.map +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.js +1 -0
- package/dist/core/runner-model-catalog.js.map +1 -1
- package/dist/core/runner-stderr.d.ts +2 -0
- package/dist/core/runner-stderr.js +20 -0
- package/dist/core/runner-stderr.js.map +1 -0
- package/dist/core/session-process.d.ts +22 -0
- package/dist/core/session-process.js +202 -0
- package/dist/core/session-process.js.map +1 -0
- package/dist/core/ui-events.d.ts +1 -1
- package/dist/core/usage-limit.js +3 -60
- package/dist/core/usage-limit.js.map +1 -1
- package/dist/data-gitignore.d.ts +6 -0
- package/dist/data-gitignore.js +57 -0
- package/dist/data-gitignore.js.map +1 -0
- package/dist/delegation/capacity.d.ts +19 -0
- package/dist/delegation/capacity.js +34 -0
- package/dist/delegation/capacity.js.map +1 -0
- package/dist/delegation/cli.js +13 -4
- package/dist/delegation/cli.js.map +1 -1
- package/dist/delegation/conversations.d.ts +4 -2
- package/dist/delegation/conversations.js +8 -12
- package/dist/delegation/conversations.js.map +1 -1
- package/dist/delegation/credentials.d.ts +2 -0
- package/dist/delegation/credentials.js +10 -0
- package/dist/delegation/credentials.js.map +1 -1
- package/dist/delegation/destroy-observation.d.ts +42 -0
- package/dist/delegation/destroy-observation.js +115 -0
- package/dist/delegation/destroy-observation.js.map +1 -0
- package/dist/delegation/execution-identity.d.ts +6 -0
- package/dist/delegation/execution-identity.js +1 -1
- package/dist/delegation/execution-identity.js.map +1 -1
- package/dist/delegation/policy.d.ts +3 -2
- package/dist/delegation/policy.js +7 -5
- package/dist/delegation/policy.js.map +1 -1
- package/dist/delegation/process-liveness.d.ts +57 -20
- package/dist/delegation/process-liveness.js +114 -92
- package/dist/delegation/process-liveness.js.map +1 -1
- package/dist/delegation/provision.js +6 -6
- package/dist/delegation/provision.js.map +1 -1
- package/dist/delegation/results.js +4 -2
- package/dist/delegation/results.js.map +1 -1
- package/dist/delegation/retry-backoff.d.ts +23 -0
- package/dist/delegation/retry-backoff.js +18 -0
- package/dist/delegation/retry-backoff.js.map +1 -0
- package/dist/delegation/routes.d.ts +64 -58
- package/dist/delegation/scratch-cleanup.d.ts +29 -0
- package/dist/delegation/scratch-cleanup.js +143 -0
- package/dist/delegation/scratch-cleanup.js.map +1 -0
- package/dist/delegation/service.d.ts +20 -1
- package/dist/delegation/service.js +233 -70
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +12 -6
- package/dist/delegation/workspace.d.ts +23 -4
- package/dist/delegation/workspace.js +147 -31
- package/dist/delegation/workspace.js.map +1 -1
- package/dist/git-worktree-lock-helper.js +8 -3
- package/dist/git-worktree-lock-helper.js.map +1 -1
- package/dist/git-worktree-lock.d.ts +6 -1
- package/dist/git-worktree-lock.js +10 -4
- package/dist/git-worktree-lock.js.map +1 -1
- package/dist/git-worktree-release.d.ts +20 -0
- package/dist/git-worktree-release.js +27 -0
- package/dist/git-worktree-release.js.map +1 -0
- package/dist/git-worktree.d.ts +8 -2
- package/dist/git-worktree.js +19 -2
- 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 +109 -76
- package/dist/index.js.map +1 -1
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +5 -1
- package/dist/paths.js.map +1 -1
- package/dist/preview/cdp.d.ts +13 -0
- package/dist/preview/cdp.js +69 -0
- package/dist/preview/cdp.js.map +1 -0
- package/dist/preview/chromium.d.ts +75 -0
- package/dist/preview/chromium.js +394 -0
- package/dist/preview/chromium.js.map +1 -0
- package/dist/preview/dev-server.d.ts +68 -0
- package/dist/preview/dev-server.js +341 -0
- package/dist/preview/dev-server.js.map +1 -0
- package/dist/preview/host.d.ts +154 -0
- package/dist/preview/host.js +681 -0
- package/dist/preview/host.js.map +1 -0
- package/dist/preview/registration.d.ts +63 -0
- package/dist/preview/registration.js +109 -0
- package/dist/preview/registration.js.map +1 -0
- package/dist/preview/session.d.ts +73 -0
- package/dist/preview/session.js +347 -0
- package/dist/preview/session.js.map +1 -0
- package/dist/preview/url.d.ts +6 -0
- package/dist/preview/url.js +17 -0
- package/dist/preview/url.js.map +1 -0
- package/dist/runs/agent-tmpdir-removal.d.ts +15 -0
- package/dist/runs/agent-tmpdir-removal.js +60 -0
- package/dist/runs/agent-tmpdir-removal.js.map +1 -0
- package/dist/runs/agent-tmpdir.d.ts +12 -1
- package/dist/runs/agent-tmpdir.js +123 -34
- package/dist/runs/agent-tmpdir.js.map +1 -1
- package/dist/runs/delegation-state.d.ts +5 -1
- package/dist/runs/delegation-state.js +9 -0
- package/dist/runs/delegation-state.js.map +1 -1
- package/dist/runs/event-history.d.ts +4 -4
- package/dist/runs/event-history.js +97 -117
- package/dist/runs/event-history.js.map +1 -1
- package/dist/runs/history-compressor.d.ts +29 -0
- package/dist/runs/history-compressor.js +116 -0
- package/dist/runs/history-compressor.js.map +1 -0
- package/dist/runs/history-file.d.ts +36 -0
- package/dist/runs/history-file.js +463 -0
- package/dist/runs/history-file.js.map +1 -0
- package/dist/runs/human-ask-summary.js +18 -13
- package/dist/runs/human-ask-summary.js.map +1 -1
- package/dist/runs/legacy-index.d.ts +62 -0
- package/dist/runs/legacy-index.js +168 -0
- package/dist/runs/legacy-index.js.map +1 -0
- package/dist/runs/raw-record.d.ts +52 -0
- package/dist/runs/raw-record.js +145 -0
- package/dist/runs/raw-record.js.map +1 -0
- package/dist/runs/retention.d.ts +13 -6
- package/dist/runs/retention.js +42 -13
- package/dist/runs/retention.js.map +1 -1
- package/dist/runs/run-claims.d.ts +23 -0
- package/dist/runs/run-claims.js +24 -0
- package/dist/runs/run-claims.js.map +1 -0
- package/dist/runs/run-database.d.ts +385 -0
- package/dist/runs/run-database.js +930 -0
- package/dist/runs/run-database.js.map +1 -0
- package/dist/runs/run-index.d.ts +35 -9
- package/dist/runs/run-index.js +200 -25
- package/dist/runs/run-index.js.map +1 -1
- package/dist/runs/run-row.d.ts +44 -0
- package/dist/runs/run-row.js +84 -0
- package/dist/runs/run-row.js.map +1 -0
- package/dist/runs/run-search.d.ts +29 -0
- package/dist/runs/run-search.js +63 -0
- package/dist/runs/run-search.js.map +1 -0
- package/dist/runs/store-open-error.d.ts +24 -0
- package/dist/runs/store-open-error.js +61 -0
- package/dist/runs/store-open-error.js.map +1 -0
- package/dist/runs/store.d.ts +667 -32
- package/dist/runs/store.js +2153 -324
- package/dist/runs/store.js.map +1 -1
- package/dist/runs/transcript-facts.d.ts +77 -0
- package/dist/runs/transcript-facts.js +302 -0
- package/dist/runs/transcript-facts.js.map +1 -0
- package/dist/runs/webhook.js +5 -4
- package/dist/runs/webhook.js.map +1 -1
- package/dist/runs/worker-execution.d.ts +22 -0
- package/dist/runs/worker-execution.js +30 -0
- package/dist/runs/worker-execution.js.map +1 -0
- package/dist/server/capabilities.d.ts +1 -0
- package/dist/server/capabilities.js +2 -0
- package/dist/server/capabilities.js.map +1 -1
- package/dist/server/cockpit-ownership.d.ts +8 -0
- package/dist/server/cockpit-ownership.js +19 -0
- package/dist/server/cockpit-ownership.js.map +1 -1
- package/dist/server/forge/github.d.ts +1 -4
- package/dist/server/forge/github.js +47 -23
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/git.js +1 -1
- package/dist/server/git.js.map +1 -1
- package/dist/server/open-in-app.js +1 -0
- package/dist/server/open-in-app.js.map +1 -1
- package/dist/server/preview-socket.d.ts +36 -0
- package/dist/server/preview-socket.js +126 -0
- package/dist/server/preview-socket.js.map +1 -0
- package/dist/server/project-context.d.ts +31 -4
- package/dist/server/project-context.js +73 -9
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/provider-action-gate.js +1 -0
- package/dist/server/provider-action-gate.js.map +1 -1
- package/dist/server/repo-branches.d.ts +4 -3
- package/dist/server/repo-branches.js +5 -4
- package/dist/server/repo-branches.js.map +1 -1
- package/dist/server/server.d.ts +4500 -2727
- package/dist/server/server.js +651 -202
- package/dist/server/server.js.map +1 -1
- package/dist/server/upgrade-router.d.ts +23 -0
- package/dist/server/upgrade-router.js +53 -0
- package/dist/server/upgrade-router.js.map +1 -0
- package/dist/server/validators.d.ts +6 -1
- package/dist/server/validators.js +4 -4
- package/dist/server/validators.js.map +1 -1
- package/dist/server/ws.d.ts +16 -16
- package/dist/server/ws.js +56 -54
- package/dist/server/ws.js.map +1 -1
- package/dist/skills-remote.d.ts +14 -0
- package/dist/skills-remote.js +91 -15
- package/dist/skills-remote.js.map +1 -1
- package/dist/task-cli/cli.js +40 -16
- package/dist/task-cli/cli.js.map +1 -1
- package/dist/task-cli/discovery.d.ts +4 -3
- package/dist/task-cli/discovery.js +4 -3
- package/dist/task-cli/discovery.js.map +1 -1
- package/dist/task-cli/http.d.ts +2 -0
- package/dist/task-cli/http.js +10 -4
- package/dist/task-cli/http.js.map +1 -1
- package/dist/task-cli/projections.d.ts +5 -2
- package/dist/task-cli/projections.js +13 -0
- package/dist/task-cli/projections.js.map +1 -1
- package/dist/task-cli/watch.d.ts +15 -2
- package/dist/task-cli/watch.js +31 -9
- package/dist/task-cli/watch.js.map +1 -1
- package/dist/ui-state.d.ts +4 -3
- package/dist/ui-state.js +8 -3
- package/dist/ui-state.js.map +1 -1
- package/dist/workflows/grouped-command.d.ts +31 -0
- package/dist/workflows/grouped-command.js +143 -0
- package/dist/workflows/grouped-command.js.map +1 -0
- package/dist/workflows/run.d.ts +223 -42
- package/dist/workflows/run.js +1316 -398
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/types.d.ts +12 -0
- package/dist/workflows/types.js +20 -0
- package/dist/workflows/types.js.map +1 -1
- package/dist/workspace/agent-accounts.d.ts +5 -1
- package/dist/workspace/agent-accounts.js +1 -0
- package/dist/workspace/agent-accounts.js.map +1 -1
- package/dist/workspace/agent-profiles.js +1 -1
- package/dist/workspace/agent-profiles.js.map +1 -1
- package/dist/workspace/config.d.ts +3 -1
- package/dist/workspace/config.js +1 -0
- package/dist/workspace/config.js.map +1 -1
- package/dist/worktree-setup.d.ts +85 -0
- package/dist/worktree-setup.js +164 -0
- package/dist/worktree-setup.js.map +1 -0
- package/package.json +7 -5
- package/scripts/benchmark-run-store-fixture.ts +428 -0
- package/scripts/benchmark-run-store.ts +743 -0
- package/scripts/benchmark-stuck-destroys.ts +143 -0
- package/scripts/mock-autonomous.mjs +11 -0
- package/scripts/mock-ci-tool.mjs +20 -5
- package/scripts/mock-claude.mjs +110 -1
- package/scripts/mock-codex-app-server.mjs +117 -2
- package/scripts/mock-codex-coalesce-steer.mjs +59 -0
- package/scripts/mock-codex-reverse-steer.mjs +130 -0
- package/scripts/mock-cursor-acp.mjs +75 -1
- package/scripts/mock-omp-rpc.mjs +605 -0
- package/scripts/mock-opencode-serve.mjs +312 -22
- package/scripts/mock-pi-rpc.mjs +109 -3
- package/scripts/mock-runner-crash.mjs +42 -0
- package/scripts/mock-silent-tail.mjs +78 -0
- package/scripts/mock-turn-messages.mjs +5 -0
- package/scripts/omp-ci-wait.mjs +29 -0
- package/scripts/omp-restrict-delegation.yml +4 -0
- package/scripts/pi-ci-wait.mjs +12 -9
- package/scripts/seed-archive-profile.ts +3 -3
- package/web/dist/assets/agent-accounts-CFOBMVHc.js +1 -0
- package/web/dist/assets/alert-dialog-BrpNUwMt.js +1 -0
- package/web/dist/assets/app-window-CSHwDX9N.js +1 -0
- package/web/dist/assets/button-C_rd7CPp.js +43 -0
- package/web/dist/assets/compare-variants-D6WXhvXA.js +1 -0
- package/web/dist/assets/diff-DrEARXTV.js +3 -0
- package/web/dist/assets/diff-controls-B1-j7nFg.js +1 -0
- package/web/dist/assets/{diff-view-DPn6bQ5W.js → diff-view-DvGLjdTk.js} +3 -3
- package/web/dist/assets/dropdown-menu-BegOZFrj.js +1 -0
- package/web/dist/assets/format-DpNe3S0A.js +1 -0
- package/web/dist/assets/git-toolbar-Cw4ljmhB.js +1 -0
- package/web/dist/assets/github-CfV5sqL0.js +1 -0
- package/web/dist/assets/{image-preview-DJ8cgb1Z.js → image-preview-FOEfqpZP.js} +1 -1
- package/web/dist/assets/index-DgWWlOLy.js +13 -0
- package/web/dist/assets/index-fBFnuvxu.css +1 -0
- package/web/dist/assets/{nav-row-styles-3j64kH5s.js → nav-row-styles-vp2JbhuJ.js} +1 -1
- package/web/dist/assets/play-CmVAj_fu.js +1 -0
- package/web/dist/assets/popover-BohP6WTx.js +1 -0
- package/web/dist/assets/preview-pane-connected-qTA5KNoJ.js +3 -0
- package/web/dist/assets/preview-state-vuMviq6q.js +1 -0
- package/web/dist/assets/prompt-templates-Cubdut_C.js +15 -0
- package/web/dist/assets/repo-git-Cf4t5PD0.js +1 -0
- package/web/dist/assets/{run-diff-5-RRdcVz.js → run-diff-BpkUW37Z.js} +3 -3
- package/web/dist/assets/run-header-68WHf9wV.js +1 -0
- package/web/dist/assets/skills-DiVIgKeU.js +1 -0
- package/web/dist/assets/square-terminal-B6RYYieR.js +1 -0
- package/web/dist/assets/status-dot-CqTJHSP9.js +1 -0
- package/web/dist/assets/{tab-link-K0hjzEXR.js → tab-link-B07Hu4QX.js} +1 -1
- package/web/dist/assets/task-changes--lQF6EYf.js +1 -0
- package/web/dist/assets/task-commits-Cx0qy4DN.js +1 -0
- package/web/dist/assets/task-files-D50s-gKW.js +2 -0
- package/web/dist/assets/task-github-item-DaqmSwYT.js +1 -0
- package/web/dist/assets/task-thread-BPQ64lui.js +7 -0
- package/web/dist/assets/{task-thread-Bw_nQuTx.css → task-thread-zNE2Q9E-.css} +1 -1
- package/web/dist/assets/textarea-D20O4Pw0.js +1 -0
- package/web/dist/assets/thread-state-DWcFMrvb.js +4 -0
- package/web/dist/assets/use-hand-to-agent-state-BLIGmwbd.css +1 -0
- package/web/dist/assets/use-hand-to-agent-state-Cy9eyyfL.js +1 -0
- package/web/dist/assets/{utils-fzNfbPzA.js → utils-JsL3ZsJf.js} +1 -1
- package/web/dist/assets/workflows-jwG7uxqi.js +11 -0
- package/web/dist/assets/{zoomable-image-CDmZ_Rtl.js → zoomable-image-BJJ64KGc.js} +1 -1
- package/web/dist/cezarion-lockup-dark.svg +1 -13
- package/web/dist/cezarion-lockup-light.svg +1 -13
- package/web/dist/cezarion-mark-dark.svg +1 -12
- package/web/dist/cezarion-mark-light.svg +1 -12
- package/web/dist/index.html +16 -21
- package/web/dist/assets/agent-accounts-CU2ZDv24.js +0 -1
- package/web/dist/assets/alert-dialog-C-xYE_dg.js +0 -43
- package/web/dist/assets/chevron-right-BENZ-1ZN.js +0 -1
- package/web/dist/assets/collapsible-DD9J91Iv.js +0 -1
- package/web/dist/assets/compare-variants-5FmqpFSN.js +0 -1
- package/web/dist/assets/diff-controls-Bj0YrioE.js +0 -1
- package/web/dist/assets/diff-rE8rm75J2.js +0 -3
- package/web/dist/assets/diff-stat-BKDCSVfJ.js +0 -1
- package/web/dist/assets/dropdown-menu-Ch5BYQh_.js +0 -1
- package/web/dist/assets/format-dBiNDNVe.js +0 -1
- package/web/dist/assets/git-toolbar-ClVvf5iF.js +0 -1
- package/web/dist/assets/github-BkNOyour.css +0 -1
- package/web/dist/assets/github-DeZMeMwJ.js +0 -1
- package/web/dist/assets/github-item-detail-W5F6GVjF.js +0 -1
- package/web/dist/assets/github-sidebar-model-DcMu-IK2.js +0 -1
- package/web/dist/assets/highlighter-CdHqIwFr.js +0 -3
- package/web/dist/assets/index-CatemBEL.js +0 -8
- package/web/dist/assets/index-MvfD8bZJ.css +0 -1
- package/web/dist/assets/markdown-zdKeLIYA.js +0 -2
- package/web/dist/assets/mobile-run-bar-BCfmFi8V.js +0 -1
- package/web/dist/assets/prompt-templates-CBPp39IU.js +0 -15
- package/web/dist/assets/reference-chip-D6owncJT.js +0 -1
- package/web/dist/assets/repo-git-CtdkZFey.js +0 -1
- package/web/dist/assets/run-header-BcjoDi0W.js +0 -1
- package/web/dist/assets/sheet-ChnYVrp1.js +0 -1
- package/web/dist/assets/skills-C8YKp2vr.js +0 -1
- package/web/dist/assets/task-changes-BW8YdWG8.js +0 -1
- package/web/dist/assets/task-commits-q2kB2y6L.js +0 -1
- package/web/dist/assets/task-files-pPL6_3Cr.js +0 -2
- package/web/dist/assets/task-github-item-BXF5R52U.js +0 -1
- package/web/dist/assets/task-thread-DtkFL3EC.js +0 -10
- package/web/dist/assets/textarea-DxlkE-Yd.js +0 -1
- package/web/dist/assets/token-metrics-DIAjrPlM.js +0 -1
- package/web/dist/assets/use-desktop-CrDny2uG.js +0 -1
- package/web/dist/assets/use-submit-shortcut-KWJsC906.js +0 -1
- package/web/dist/assets/workflows-TmcPEj2K.js +0 -11
- /package/web/dist/assets/{lib-BQXq3kEf2.js → lib-BQXq3kEf.js} +0 -0
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Offline OMP (Oh My Pi) `--mode rpc` mock in OMP's own wire shape (v18.4.11, #595): the `ready`
|
|
3
|
+
// frame, id-echoed responses, `prompt_result`, `session_settled`. Startup argv and model errors
|
|
4
|
+
// are copied from the real binary (2026-10-05). Keep it standalone: optional scenario helpers
|
|
5
|
+
// are imported lazily.
|
|
6
|
+
import readline from 'node:readline';
|
|
7
|
+
import { spawn } from 'node:child_process';
|
|
8
|
+
import { appendFileSync, existsSync, writeFileSync } from 'node:fs';
|
|
9
|
+
|
|
10
|
+
const argv = process.argv.slice(2);
|
|
11
|
+
if (process.env.CEZ_MOCK_ARGS_FILE) appendFileSync(process.env.CEZ_MOCK_ARGS_FILE, `${JSON.stringify(argv)}\n`);
|
|
12
|
+
|
|
13
|
+
// OMP reports SIGTERM as 128 + 15 (real binary, 2026-10-05).
|
|
14
|
+
process.on('SIGTERM', () => process.exit(143));
|
|
15
|
+
|
|
16
|
+
const BUILTIN_TOOLS = ['read', 'bash', 'edit', 'ast_grep', 'ast_edit', 'ask', 'debug', 'ida', 'eval', 'github', 'glob', 'grep', 'find', 'lsp', 'checkpoint', 'rewind', 'context_notes', 'new_context', 'security_scan', 'task', 'wait', 'todo', 'web_search', 'write', 'memory_edit', 'retain', 'recall', 'reflect', 'learn', 'manage_skill'];
|
|
17
|
+
// Gated by `find.enabled` / `astGrep.enabled`, both off without user config.
|
|
18
|
+
const GATED_TOOLS = new Set(['find', 'ast_grep']);
|
|
19
|
+
const DEFAULT_TOOLS = ['read', 'bash', 'edit', 'eval', 'glob', 'grep', 'task', 'wait', 'todo', 'web_search', 'write'];
|
|
20
|
+
const VALUE_FLAGS = new Set(['--mode', '--extension', '--resume', '--append-system-prompt', '--model', '--thinking', '--add-dir', '--config', '--tools']);
|
|
21
|
+
const BOOLEAN_FLAGS = new Set(['--no-tools']);
|
|
22
|
+
|
|
23
|
+
function startupError(code, message) {
|
|
24
|
+
process.stderr.write(`${message}\nRun \`omp --help\` for available flags.\n`);
|
|
25
|
+
process.exit(code);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const flags = new Map();
|
|
29
|
+
const extensions = [];
|
|
30
|
+
// An older or different omp build without some flag: CEZ_MOCK_OMP_UNKNOWN_FLAGS=--add-dir.
|
|
31
|
+
const missingFlags = new Set((process.env.CEZ_MOCK_OMP_UNKNOWN_FLAGS ?? '').split(',').filter(Boolean));
|
|
32
|
+
const unknownFlags = [];
|
|
33
|
+
for (let i = 0; i < argv.length; i++) {
|
|
34
|
+
const flag = argv[i];
|
|
35
|
+
if (BOOLEAN_FLAGS.has(flag)) { flags.set(flag, true); continue; }
|
|
36
|
+
if (!VALUE_FLAGS.has(flag) || missingFlags.has(flag)) { unknownFlags.push(flag); if (VALUE_FLAGS.has(flag)) i++; continue; }
|
|
37
|
+
const value = argv[++i];
|
|
38
|
+
if (flag === '--extension') extensions.push(value);
|
|
39
|
+
flags.set(flag, value);
|
|
40
|
+
}
|
|
41
|
+
// OMP's parser reports every unrecognized occurrence in one error before any session work.
|
|
42
|
+
if (unknownFlags.length > 0) {
|
|
43
|
+
startupError(2, `Error: unknown flag${unknownFlags.length === 1 ? '' : 's'}: ${unknownFlags.join(', ')}`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let tools = flags.has('--no-tools') ? [] : DEFAULT_TOOLS;
|
|
47
|
+
if (typeof flags.get('--tools') === 'string') {
|
|
48
|
+
tools = flags.get('--tools').split(',');
|
|
49
|
+
// The CI extension registers cezar's tools (the preview tool only under CEZ_PREVIEW=1); an MCP name needs a configured server, which the mock
|
|
50
|
+
// takes from CEZ_MOCK_OMP_MCP_TOOLS (none by default, like a home without .omp/mcp.json).
|
|
51
|
+
const mcpTools = (process.env.CEZ_MOCK_OMP_MCP_TOOLS ?? '').split(',').filter(Boolean);
|
|
52
|
+
// Tools a user setting disabled (`todo.enabled: false`, `lsp.enabled: false`, ...) are built-ins
|
|
53
|
+
// missing from the session, exactly like the settings-gated ones.
|
|
54
|
+
const disabled = (process.env.CEZ_MOCK_OMP_DISABLED_TOOLS ?? '').split(',').filter(Boolean);
|
|
55
|
+
const registered = (name) => (BUILTIN_TOOLS.includes(name) && !GATED_TOOLS.has(name) && !disabled.includes(name))
|
|
56
|
+
|| mcpTools.includes(name)
|
|
57
|
+
|| (extensions.length > 0 && (name === 'cezar_wait_for_ci' || ((name === 'cezar_preview_serve' || name === 'cezar_preview_stop') && process.env.CEZ_PREVIEW === '1')));
|
|
58
|
+
// Mirrors v18.4.11 `emt()`: every missing name in ONE error, unknown names first, then the
|
|
59
|
+
// built-ins this session lacks, each line singular for one name.
|
|
60
|
+
const missing = tools.filter((name) => !registered(name));
|
|
61
|
+
const unknown = missing.filter((name) => !BUILTIN_TOOLS.includes(name));
|
|
62
|
+
const unavailable = missing.filter((name) => BUILTIN_TOOLS.includes(name));
|
|
63
|
+
const lines = [];
|
|
64
|
+
if (unknown.length > 0) {
|
|
65
|
+
lines.push(`Unknown tool${unknown.length === 1 ? '' : 's'} in --tools: ${unknown.join(', ')}.`);
|
|
66
|
+
lines.push(`Built-in tools: ${BUILTIN_TOOLS.join(', ')}. Other registered tools: goal, init_experiment, run_experiment, log_experiment, update_notes.`);
|
|
67
|
+
}
|
|
68
|
+
if (unavailable.length > 0) lines.push(`Built-in tool${unavailable.length === 1 ? '' : 's'} unavailable in this session: ${unavailable.join(', ')}.`);
|
|
69
|
+
if (lines.length > 0) startupError(2, `Error: ${lines.join('\n')}`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (process.env.CEZ_MOCK_OMP_NO_AUTH === '1') {
|
|
73
|
+
process.stderr.write('No models available. Use /login or set an API key environment variable. Then use /model to select a model.\n\nSet an API key environment variable:\n ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, etc.\n\nOr create ~/.omp/agent/models.yml\n');
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// The extension loads while OMP starts: with a CI target the mock lists and calls its tools now.
|
|
78
|
+
if (process.env.CEZ_MOCK_CI_PR) { const { probeCiTool } = await import('./mock-ci-tool.mjs'); await probeCiTool('omp', argv); }
|
|
79
|
+
|
|
80
|
+
// OMP v18.6.1 main.ts createSessionManager can implicitly continueRecent when autoResume
|
|
81
|
+
// is enabled. rpc-mode.ts get_state reports the restored conversation's messageCount.
|
|
82
|
+
const autoResume = process.env.CEZ_MOCK_OMP_AUTO_RESUME === '1';
|
|
83
|
+
const sessionId = typeof flags.get('--resume') === 'string' ? flags.get('--resume')
|
|
84
|
+
: autoResume ? '019a0000-0000-7000-8000-0000000000bb' : '019a0000-0000-7000-8000-0000000000aa';
|
|
85
|
+
let steeringMode = 'one-at-a-time';
|
|
86
|
+
let messageUpdates = 'full';
|
|
87
|
+
const write = (value) => process.stdout.write(`${JSON.stringify(value)}\n`);
|
|
88
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
89
|
+
async function waitForMockRelease(fallbackMs) {
|
|
90
|
+
const file = process.env.CEZ_MOCK_RELEASE_FILE;
|
|
91
|
+
if (!file) { if (fallbackMs) await sleep(fallbackMs); return; }
|
|
92
|
+
const deadline = Date.now() + 15_000;
|
|
93
|
+
while (!existsSync(file)) {
|
|
94
|
+
if (Date.now() > deadline) throw new Error('CEZ_MOCK_RELEASE_FILE was not created');
|
|
95
|
+
await sleep(10);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const record = (value) => {
|
|
99
|
+
if (!process.env.CEZ_MOCK_STDIN_FILE) return;
|
|
100
|
+
try { appendFileSync(process.env.CEZ_MOCK_STDIN_FILE, `${JSON.stringify(value)}\n`); } catch { /* best effort */ }
|
|
101
|
+
};
|
|
102
|
+
const fail = (command, error) => write({ ...(command.id ? { id: command.id } : {}), type: 'response', command: command.type, success: false, error });
|
|
103
|
+
/** `RpcPromptResults.fail`/`completeLocal`: a prompt finished without the agent (v18.4.11). */
|
|
104
|
+
const localResult = (command, status, error) => write({ type: 'prompt_result', ...(command.id ? { id: command.id } : {}), agentInvoked: false, status, ...(error ? { error } : {}), sessionSettled: false });
|
|
105
|
+
const respond = (command, data) => write({ ...(command.id ? { id: command.id } : {}), type: 'response', command: command.type, success: true, ...(data === undefined ? {} : { data }) });
|
|
106
|
+
|
|
107
|
+
// Real startup order: `ready`, then three unsolicited frames before any command is answered.
|
|
108
|
+
write({ type: 'ready', protocolVersion: 1, supportedProtocolVersions: [1, 2], maxFrameBytes: 1048576, maxReassembledFrameBytes: 16777216 });
|
|
109
|
+
write({ type: 'extension_ui_request', id: 'mock-widget-1', method: 'setWidget', widgetKey: 'mock', widgetLines: [] });
|
|
110
|
+
write({ type: 'advisor_cost_changed' });
|
|
111
|
+
write({ type: 'available_commands_update', commands: [{ name: 'model', description: 'Select model' }] });
|
|
112
|
+
|
|
113
|
+
/** One valid CEZ:ASK payload (spec #473), as mock-pi-rpc.mjs `ASK_MARKER_BODY`. */
|
|
114
|
+
const ASK_MARKER_BODY = '{"questions":[{"header":"Library","question":"Which test library?","multiSelect":false,"options":[{"label":"Vitest","description":"Use the existing test runner"},{"label":"Node test","description":"Use node:test"}]}]}';
|
|
115
|
+
const SNAPSHOT_ASK = 'Using the CEZ:ASK structured question format instead:\n\nCEZ:ASK {"questions":[{"header":"Library","question":"Which test library?","options":[{"label":"Vitest"},{"label":"Node test"}]}]}';
|
|
116
|
+
// OMP's tool-approval error with no interactive UI (v18.4.11 tool wrapper, `runner.hasUI()` false).
|
|
117
|
+
const NO_UI_APPROVAL_ERROR = 'Tool "bash" requires approval but no interactive UI available.\nOptions:\n 1. Set tools.approvalMode: yolo in /settings\n 2. Add tools.approval.bash: allow to config\n 3. Use an interactive UI to approve the tool call';
|
|
118
|
+
/** Set by `mock:ask mock:resume-done`: the human answer then finishes with CEZ:DONE. */
|
|
119
|
+
let resumeAfterAsk = false;
|
|
120
|
+
|
|
121
|
+
/** Same as mock-pi-rpc.mjs `watchdogStall`: a turn that never progresses (no-progress rows). */
|
|
122
|
+
function watchdogStall(message) {
|
|
123
|
+
writeFileSync('watchdog.pid', String(process.pid));
|
|
124
|
+
if (message.includes('ignore-term')) {
|
|
125
|
+
process.removeAllListeners('SIGTERM');
|
|
126
|
+
process.on('SIGTERM', () => {});
|
|
127
|
+
// Test-cleanup backstop, deliberately longer than the asserted teardown bound.
|
|
128
|
+
setTimeout(() => process.exit(0), 12_000);
|
|
129
|
+
}
|
|
130
|
+
if (message.includes('held-pipe')) {
|
|
131
|
+
spawn(process.execPath, ['-e', 'setTimeout(() => {}, 5000)'], { stdio: ['ignore', process.stdout, process.stderr] });
|
|
132
|
+
}
|
|
133
|
+
if (message.includes('leftover')) {
|
|
134
|
+
// hearsay-tools/cezarion#890: one child stays in the session's process group and ignores
|
|
135
|
+
// SIGTERM; one leaves the group with setsid. Both exit on their own as a cleanup backstop.
|
|
136
|
+
const leftover = (file) => `process.on('SIGTERM',()=>{}); require('fs').writeFileSync(${JSON.stringify(file)}, String(process.pid)); setTimeout(()=>{},20000)`;
|
|
137
|
+
spawn(process.execPath, ['-e', leftover('leftover-group.pid')], { stdio: 'ignore' });
|
|
138
|
+
spawn(process.execPath, ['-e', leftover('leftover-session.pid')], { stdio: 'ignore', detached: true }).unref();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** #401: hold late wire frames until the test has observed the park (as the codex mock). */
|
|
143
|
+
async function afterParityPark(message) {
|
|
144
|
+
const gate = /parity-release=([^\s"\\]+)/.exec(message)?.[1];
|
|
145
|
+
if (!gate) throw new Error('post-park scenario requires a release path');
|
|
146
|
+
while (!existsSync(gate)) await sleep(10);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** The turn in flight: steers admitted into it are read before it ends (#505). */
|
|
150
|
+
let activeTurn = null;
|
|
151
|
+
let messageSeq = 0;
|
|
152
|
+
|
|
153
|
+
function messageUpdate(messageId, event) {
|
|
154
|
+
const frame = { type: 'message_update', messageId, message: { role: 'assistant' }, assistantMessageEvent: event };
|
|
155
|
+
// Without `messageUpdates: "delta"` each update also carries the message snapshot.
|
|
156
|
+
if (messageUpdates !== 'delta') frame.assistantMessageEvent = { ...event, partial: { role: 'assistant', content: [] } };
|
|
157
|
+
write(frame);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function userMessage(text) {
|
|
161
|
+
const messageId = `msg-${++messageSeq}`;
|
|
162
|
+
const message = { role: 'user', content: [{ type: 'text', text }] };
|
|
163
|
+
write({ type: 'message_start', messageId, message });
|
|
164
|
+
write({ type: 'message_end', messageId, message });
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** One assistant thinking block, then its usage-bearing message_end. */
|
|
168
|
+
function assistantThinking(text, { stopReason = 'stop', usage = { input: 10, output: 5, cacheRead: 0, cacheWrite: 0, totalTokens: 15, cost: { total: 0.001 } } } = {}) {
|
|
169
|
+
const messageId = `msg-${++messageSeq}`;
|
|
170
|
+
write({ type: 'message_start', messageId, message: { role: 'assistant', content: [] } });
|
|
171
|
+
messageUpdate(messageId, { type: 'thinking_start', contentIndex: 0 });
|
|
172
|
+
messageUpdate(messageId, { type: 'thinking_delta', contentIndex: 0, delta: text });
|
|
173
|
+
messageUpdate(messageId, { type: 'thinking_end', contentIndex: 0, content: text });
|
|
174
|
+
write({ type: 'message_end', messageId, message: { role: 'assistant', content: [{ type: 'thinking', thinking: text }], provider: 'anthropic', model: 'claude-mock', usage, stopReason } });
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** One assistant message: text block (streamed as `deltas`), then its usage-bearing message_end. */
|
|
178
|
+
function assistantText(deltas, { stopReason = 'stop', usage = { input: 10, output: 5, cacheRead: 0, cacheWrite: 0, totalTokens: 15, cost: { total: 0.001 } }, extra = {} } = {}) {
|
|
179
|
+
const messageId = `msg-${++messageSeq}`;
|
|
180
|
+
write({ type: 'message_start', messageId, message: { role: 'assistant', content: [] } });
|
|
181
|
+
if (deltas.length > 0) {
|
|
182
|
+
messageUpdate(messageId, { type: 'text_start', contentIndex: 0 });
|
|
183
|
+
for (const delta of deltas) messageUpdate(messageId, { type: 'text_delta', contentIndex: 0, delta });
|
|
184
|
+
messageUpdate(messageId, { type: 'text_end', contentIndex: 0, content: deltas.join('') });
|
|
185
|
+
}
|
|
186
|
+
write({ type: 'message_end', messageId, message: { role: 'assistant', content: [{ type: 'text', text: deltas.join('') }], provider: 'anthropic', model: 'claude-mock', usage, stopReason, ...extra } });
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** One complete sub-agent text message, wrapped in `subagent_event` (rpc-subagents.ndjson). */
|
|
190
|
+
function subagentText(id, text, usage) {
|
|
191
|
+
const event = (inner) => write({ type: 'subagent_event', payload: { id, event: inner } });
|
|
192
|
+
event({ type: 'message_start', message: { role: 'assistant', content: [] } });
|
|
193
|
+
event({ type: 'message_update', message: { role: 'assistant' }, assistantMessageEvent: { type: 'text_start', contentIndex: 0 } });
|
|
194
|
+
event({ type: 'message_update', message: { role: 'assistant' }, assistantMessageEvent: { type: 'text_delta', contentIndex: 0, delta: text } });
|
|
195
|
+
event({ type: 'message_update', message: { role: 'assistant' }, assistantMessageEvent: { type: 'text_end', contentIndex: 0, content: text } });
|
|
196
|
+
event({ type: 'message_end', message: { role: 'assistant', content: [{ type: 'text', text }], stopReason: 'stop', ...(usage ? { usage } : {}) } });
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function beginTurn(command) {
|
|
200
|
+
activeTurn = { id: command?.id, steers: [] };
|
|
201
|
+
write({ type: 'agent_start' });
|
|
202
|
+
write({ type: 'turn_start' });
|
|
203
|
+
if (command) userMessage(command.message);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* The terminal sequence: admitted steers are read in this turn (all of them under steering mode
|
|
208
|
+
* `all`, the first otherwise), then the terminal `agent_end`, one `prompt_result` per admitted
|
|
209
|
+
* prompt, and `session_settled` (rpc-prompt-results.ts, rpc-session-settle, v18.4.11).
|
|
210
|
+
*/
|
|
211
|
+
function endTurn({ status = 'completed', error, settle = true } = {}) {
|
|
212
|
+
const turn = activeTurn;
|
|
213
|
+
activeTurn = null;
|
|
214
|
+
const readNow = steeringMode === 'all' ? turn.steers : turn.steers.slice(0, 1);
|
|
215
|
+
const deferred = steeringMode === 'all' ? [] : turn.steers.slice(1);
|
|
216
|
+
if (turn.late && readNow.length > 0) {
|
|
217
|
+
// A steer queued after the last model call: `AgentSession` rewrites this agent_end to
|
|
218
|
+
// `isTerminal: false` while `agent.hasQueuedMessages()`, and the next run reads the queue
|
|
219
|
+
// before the session settles (agent-session.ts, v18.4.11).
|
|
220
|
+
write({ type: 'turn_end' });
|
|
221
|
+
write({ type: 'agent_end', messages: [], isTerminal: false, yielded: false });
|
|
222
|
+
write({ type: 'agent_start' });
|
|
223
|
+
write({ type: 'turn_start' });
|
|
224
|
+
}
|
|
225
|
+
for (const steer of readNow) {
|
|
226
|
+
userMessage(steer.message);
|
|
227
|
+
assistantText([steer.message], { usage: { input: 1, output: 1, cacheRead: 0, cacheWrite: 0, totalTokens: 2, cost: { total: 0 } } });
|
|
228
|
+
}
|
|
229
|
+
write({ type: 'turn_end' });
|
|
230
|
+
write({ type: 'agent_end', messages: [], isTerminal: true, yielded: true });
|
|
231
|
+
for (const prompt of [{ id: turn.id }, ...readNow]) {
|
|
232
|
+
write({ type: 'prompt_result', ...(prompt.id ? { id: prompt.id } : {}), agentInvoked: true, status, ...(error ? { error } : {}), sessionSettled: settle });
|
|
233
|
+
}
|
|
234
|
+
if (settle) write({ type: 'session_settled' });
|
|
235
|
+
for (const steer of deferred) queue = queue.then(() => handle({ type: 'prompt', id: steer.id, message: steer.message }));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const rl = readline.createInterface({ input: process.stdin });
|
|
239
|
+
let queue = Promise.resolve();
|
|
240
|
+
rl.on('line', (line) => {
|
|
241
|
+
// Every raw command, in arrival order, for tests that pin what the runner wrote.
|
|
242
|
+
if (process.env.CEZ_MOCK_OMP_COMMANDS_FILE) appendFileSync(process.env.CEZ_MOCK_OMP_COMMANDS_FILE, `${line}\n`);
|
|
243
|
+
const command = JSON.parse(line);
|
|
244
|
+
if (command.type === 'prompt' && command.streamingBehavior === 'steer' && activeTurn) {
|
|
245
|
+
record({ userText: command.message, imageCount: (command.images ?? []).length, streamingBehavior: 'steer' });
|
|
246
|
+
// Steers OMP never hands to the running agent: none of them may end its turn.
|
|
247
|
+
if (command.message.includes('mock:steer-rejected')) {
|
|
248
|
+
// Rejected before admission: the error response only, the ticket is discarded.
|
|
249
|
+
fail(command, 'input hook rejected the steer');
|
|
250
|
+
} else if (command.message.includes('mock:steer-local-result')) {
|
|
251
|
+
respond(command);
|
|
252
|
+
localResult(command, 'completed');
|
|
253
|
+
} else if (command.message.includes('mock:steer-local')) {
|
|
254
|
+
respond(command, { agentInvoked: false });
|
|
255
|
+
} else if (command.message.includes('mock:steer-failed')) {
|
|
256
|
+
// Failed after admission: the ack, `onError`'s failure response, then `fail()`'s result.
|
|
257
|
+
respond(command);
|
|
258
|
+
fail(command, 'steer failed');
|
|
259
|
+
localResult(command, 'error', { message: 'steer failed', retryable: false });
|
|
260
|
+
} else {
|
|
261
|
+
activeTurn.steers.push({ id: command.id, message: command.message });
|
|
262
|
+
respond(command);
|
|
263
|
+
}
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
queue = queue.then(() => handle(command));
|
|
267
|
+
});
|
|
268
|
+
// stdin EOF drains the queue and exits 0 (real binary, 2026-10-05).
|
|
269
|
+
/** Set by `mock:linger`: stdin EOF does not exit and SIGTERM is ignored (a wedged OMP). */
|
|
270
|
+
let linger = false;
|
|
271
|
+
rl.on('close', () => { if (!linger) queue.then(() => process.exit(0)); });
|
|
272
|
+
|
|
273
|
+
async function handle(command) {
|
|
274
|
+
switch (command.type) {
|
|
275
|
+
case 'get_state':
|
|
276
|
+
respond(command, {
|
|
277
|
+
sessionId,
|
|
278
|
+
sessionFile: `/home/mock/.omp/agent/sessions/${sessionId}.jsonl`,
|
|
279
|
+
model: { id: 'claude-mock', name: 'Claude Mock', api: 'anthropic-messages', provider: 'anthropic' },
|
|
280
|
+
thinkingLevel: flags.get('--thinking') ?? 'medium',
|
|
281
|
+
isStreaming: activeTurn !== null,
|
|
282
|
+
isCompacting: false,
|
|
283
|
+
isSettled: activeTurn === null,
|
|
284
|
+
steeringMode,
|
|
285
|
+
followUpMode: 'one-at-a-time',
|
|
286
|
+
interruptMode: 'immediate',
|
|
287
|
+
autoCompactionEnabled: true,
|
|
288
|
+
messageCount: autoResume || flags.has('--resume') ? 4 : 0,
|
|
289
|
+
...(command.dumpTools ? { dumpTools: tools.map((name) => ({ name })) } : {}),
|
|
290
|
+
});
|
|
291
|
+
return;
|
|
292
|
+
case 'set_steering_mode':
|
|
293
|
+
if (command.mode === 'all' || command.mode === 'one-at-a-time') steeringMode = command.mode;
|
|
294
|
+
record({ type: 'set_steering_mode', mode: command.mode });
|
|
295
|
+
respond(command);
|
|
296
|
+
return;
|
|
297
|
+
case 'set_subagent_subscription':
|
|
298
|
+
record({ type: 'set_subagent_subscription', level: command.level });
|
|
299
|
+
respond(command, { level: command.level });
|
|
300
|
+
return;
|
|
301
|
+
case 'set_event_filter':
|
|
302
|
+
messageUpdates = command.messageUpdates === 'delta' ? 'delta' : 'full';
|
|
303
|
+
record({ type: 'set_event_filter', events: command.events, messageUpdates: command.messageUpdates });
|
|
304
|
+
respond(command, { events: command.events ?? null, messageUpdates });
|
|
305
|
+
return;
|
|
306
|
+
case 'abort':
|
|
307
|
+
respond(command);
|
|
308
|
+
return;
|
|
309
|
+
case 'prompt':
|
|
310
|
+
record({ userText: command.message, imageCount: (command.images ?? []).length });
|
|
311
|
+
return prompt(command);
|
|
312
|
+
default:
|
|
313
|
+
write({ ...(command.id ? { id: command.id } : {}), type: 'response', command: command.type, success: false, error: `Unknown command: ${command.type}` });
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
async function prompt(command) {
|
|
318
|
+
const message = command.message;
|
|
319
|
+
if (message.includes('mock:local-command')) {
|
|
320
|
+
// A prompt OMP finished itself (a slash command): the response says so, no prompt_result.
|
|
321
|
+
respond(command, { agentInvoked: false });
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (message.includes('mock:local-result')) {
|
|
325
|
+
respond(command);
|
|
326
|
+
write({ type: 'prompt_result', ...(command.id ? { id: command.id } : {}), agentInvoked: false, status: 'completed', sessionSettled: true });
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
if (message.includes('mock:prompt-error')) {
|
|
330
|
+
// The prompt failed after admission, before the agent ran: the ack, an error response,
|
|
331
|
+
// then its prompt_result (rpc-mode.ts `onError` + `RpcPromptResults.fail`).
|
|
332
|
+
respond(command);
|
|
333
|
+
fail(command, 'Model not found: anthropic/claude-missing');
|
|
334
|
+
write({ type: 'prompt_result', ...(command.id ? { id: command.id } : {}), agentInvoked: false, status: 'error', error: { message: 'Model not found: anthropic/claude-missing', provider: 'anthropic', model: 'claude-missing', retryable: false }, sessionSettled: true });
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
if (message.includes('mock:prompt-rejected')) {
|
|
338
|
+
// Rejected before admission (an input hook threw): the error response only, no prompt_result.
|
|
339
|
+
fail(command, 'input hook rejected the prompt');
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
if (message.includes('mock:linger')) {
|
|
344
|
+
linger = true;
|
|
345
|
+
process.removeAllListeners('SIGTERM');
|
|
346
|
+
process.on('SIGTERM', () => {});
|
|
347
|
+
// Test-cleanup backstop, deliberately longer than the asserted teardown bound.
|
|
348
|
+
setTimeout(() => process.exit(0), 12_000).unref?.();
|
|
349
|
+
setInterval(() => {}, 1_000);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (message.includes('mock:self-kill')) {
|
|
353
|
+
// An outside SIGKILL (OOM killer): close reports exitCode null with signalCode set.
|
|
354
|
+
process.kill(process.pid, 'SIGKILL');
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
if (message.includes('mock:crash-stderr')) {
|
|
359
|
+
// Every crash scenario dies before the prompt's ack (as the Pi mock), after a malformed frame.
|
|
360
|
+
const { crashWithStderr } = await import('./mock-runner-crash.mjs');
|
|
361
|
+
if (crashWithStderr(message, '{"type":"tool_execution_update","toolCallId":"truncated')) return;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
if (message.includes('mock:silent-tail') || message.includes('Your last turn ended without a message to the user.')) {
|
|
365
|
+
const silentEarly = await import('./mock-silent-tail.mjs');
|
|
366
|
+
silentEarly.noteSilentTailPrompt(message);
|
|
367
|
+
if (silentEarly.isAckOnlyNudge(message)) { respond(command); return; }
|
|
368
|
+
if (silentEarly.isLateNudge(message)) {
|
|
369
|
+
respond(command);
|
|
370
|
+
await silentEarly.sleep(silentEarly.LATE_REPLY_MS);
|
|
371
|
+
beginTurn(command);
|
|
372
|
+
} else {
|
|
373
|
+
respond(command);
|
|
374
|
+
beginTurn(command);
|
|
375
|
+
}
|
|
376
|
+
} else {
|
|
377
|
+
respond(command);
|
|
378
|
+
beginTurn(command);
|
|
379
|
+
}
|
|
380
|
+
if (message.includes('mock:turn-messages:')) {
|
|
381
|
+
const { turnMessages } = await import('./mock-turn-messages.mjs');
|
|
382
|
+
// Separate assistant messages within one native OMP turn; settle only after all of them.
|
|
383
|
+
for (const text of turnMessages(message)) assistantText([text]);
|
|
384
|
+
endTurn();
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
if (message.includes('mock:agent-echo')) {
|
|
388
|
+
assistantText([message]);
|
|
389
|
+
endTurn();
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
if (message.includes('mock:autonomous') || message.startsWith('Continue working autonomously until the task is fully complete.')) {
|
|
393
|
+
const { autonomousReply } = await import('./mock-autonomous.mjs');
|
|
394
|
+
assistantText([autonomousReply(message)]);
|
|
395
|
+
endTurn();
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
if (message.includes('mock:silent-tail') || message.includes('mock:tool-tail') || message.includes('Your last turn ended without a message to the user.')) {
|
|
399
|
+
const silent = await import('./mock-silent-tail.mjs');
|
|
400
|
+
silent.noteSilentTailPrompt(message);
|
|
401
|
+
if (silent.isFinalMessageNudge(message)) {
|
|
402
|
+
const kind = silent.finalMessageNudgeKind();
|
|
403
|
+
if (kind === 'silent') assistantThinking(silent.SILENT_TAIL_REASONING);
|
|
404
|
+
else if (kind === 'slow-done') {
|
|
405
|
+
assistantText([silent.SLOW_DONE_PREFIX]);
|
|
406
|
+
await silent.sleep(silent.SLOW_DONE_TAIL_MS);
|
|
407
|
+
assistantText([silent.SILENT_TAIL_DONE]);
|
|
408
|
+
} else assistantText([kind === 'standing' ? silent.FINAL_MESSAGE_STANDING : silent.SILENT_TAIL_DONE]);
|
|
409
|
+
endTurn();
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
if (silent.isSilentTailScenario(message)) {
|
|
413
|
+
assistantText([silent.SILENT_TAIL_OPENING]);
|
|
414
|
+
write({ type: 'tool_execution_start', toolCallId: 'tool-silent-gh', toolName: 'bash', args: { command: 'gh issue create' } });
|
|
415
|
+
write({ type: 'tool_execution_end', toolCallId: 'tool-silent-gh', toolName: 'bash', result: { content: [{ type: 'text', text: 'created' }] }, isError: false });
|
|
416
|
+
assistantThinking(silent.SILENT_TAIL_REASONING);
|
|
417
|
+
endTurn();
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
if (silent.isToolTailScenario(message)) {
|
|
421
|
+
assistantText([silent.TOOL_TAIL_OPENING]);
|
|
422
|
+
write({ type: 'tool_execution_start', toolCallId: 'tool-tail-git', toolName: 'bash', args: { command: 'git status --short' } });
|
|
423
|
+
write({ type: 'tool_execution_end', toolCallId: 'tool-tail-git', toolName: 'bash', result: { content: [{ type: 'text', text: ' M src/example.ts' }] }, isError: false });
|
|
424
|
+
endTurn();
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if (/mock:(no-progress|busy-progress)/.test(message)) {
|
|
429
|
+
if (message.includes('mock:no-progress')) {
|
|
430
|
+
// The turn never progresses and never settles.
|
|
431
|
+
watchdogStall(message);
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
for (let i = 0; i < 24; i++) {
|
|
435
|
+
write({ type: 'tool_execution_update', toolCallId: 'busy', toolName: 'bash', args: { command: 'build' }, partialResult: { content: [{ type: 'text', text: 'working' }] } });
|
|
436
|
+
await sleep(100);
|
|
437
|
+
}
|
|
438
|
+
assistantText(['busy progress finished']);
|
|
439
|
+
endTurn();
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
if (message.includes('mock:split-text')) {
|
|
443
|
+
// One text_delta per token, so the marker is split across deltas (harness parity S8).
|
|
444
|
+
assistantText(['parity split text', '\n\n', 'CEZ:', 'MONITORING']);
|
|
445
|
+
endTurn();
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
if (message.includes('mock:ask-snapshot')) {
|
|
449
|
+
// #401: an authoritative text_end with no deltas.
|
|
450
|
+
const messageId = `msg-${++messageSeq}`;
|
|
451
|
+
const text = message.includes('mock:ask-snapshot-bad') ? 'CEZ:ASK {not valid json' : SNAPSHOT_ASK;
|
|
452
|
+
write({ type: 'message_start', messageId, message: { role: 'assistant', content: [] } });
|
|
453
|
+
messageUpdate(messageId, { type: 'text_end', contentIndex: 0, content: text });
|
|
454
|
+
write({ type: 'message_end', messageId, message: { role: 'assistant', content: [{ type: 'text', text }], provider: 'anthropic', model: 'claude-mock', usage: { input: 10, output: 5, cacheRead: 0, cacheWrite: 0, totalTokens: 15, cost: { total: 0.001 } }, stopReason: 'stop' } });
|
|
455
|
+
endTurn();
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
if (message.includes('mock:ask-prose')) {
|
|
459
|
+
assistantText(['Use `CEZ:ASK {"questions":[]}` in your reply.\n> CEZ:ASK {not valid json']);
|
|
460
|
+
endTurn();
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
if (message.includes('mock:ask-bad')) {
|
|
464
|
+
// OMP's `ask` tool needs an interactive UI, so the CEZ:ASK marker is the ask path (as Pi's).
|
|
465
|
+
assistantText(['Pick one.\n\nCEZ:ASK {not valid json']);
|
|
466
|
+
endTurn();
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
if (message.includes('mock:ask')) {
|
|
470
|
+
resumeAfterAsk = message.includes('mock:resume-done');
|
|
471
|
+
// The marker and its JSON body land in separate deltas (the #2 boundary).
|
|
472
|
+
assistantText(['Pick one.\n\n', 'CEZ:ASK', ' ', ASK_MARKER_BODY]);
|
|
473
|
+
endTurn();
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
if (message.includes('mock:subagent-after-park')) {
|
|
477
|
+
// A `task` call whose sub-agent is still reporting after the parent parked on its marker.
|
|
478
|
+
write({ type: 'tool_execution_start', toolCallId: 'toolu_park_task', toolName: 'task', args: { agent: 'explore', task: 'Review the change' } });
|
|
479
|
+
write({ type: 'subagent_lifecycle', payload: { id: 'ParkReviewer', agent: 'explore', status: 'started', parentToolCallId: 'toolu_park_task', index: 0 } });
|
|
480
|
+
subagentText('ParkReviewer', 'Child review started.');
|
|
481
|
+
write({ type: 'tool_execution_end', toolCallId: 'toolu_park_task', toolName: 'task', result: { content: [{ type: 'text', text: 'ParkReviewer: running' }] }, isError: false });
|
|
482
|
+
assistantText(['Watching the child.\nCEZ:MONITORING']);
|
|
483
|
+
endTurn();
|
|
484
|
+
await afterParityPark(message);
|
|
485
|
+
write({ type: 'subagent_event', payload: { id: 'ParkReviewer', event: { type: 'tool_execution_start', toolCallId: 'toolu_park_read', toolName: 'read', args: { path: 'README.md' } } } });
|
|
486
|
+
write({ type: 'subagent_event', payload: { id: 'ParkReviewer', event: { type: 'tool_execution_end', toolCallId: 'toolu_park_read', toolName: 'read', result: { content: [{ type: 'text', text: 'mock file' }] } } } });
|
|
487
|
+
subagentText('ParkReviewer', 'Post-park child update processed.');
|
|
488
|
+
write({ type: 'subagent_event', payload: { id: 'ParkReviewer', event: { type: 'agent_end', messages: [], isTerminal: true, yielded: true } } });
|
|
489
|
+
write({ type: 'subagent_lifecycle', payload: { id: 'ParkReviewer', agent: 'explore', status: 'completed', parentToolCallId: 'toolu_park_task', index: 0 } });
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
if (message.includes('mock:subagent')) {
|
|
493
|
+
// #5/#600: the sub-agent's own terminal agent_end, nested under the parent's `task` call
|
|
494
|
+
// (rpc-subagents.ndjson), must not end the parent turn; #149: its text stays nested.
|
|
495
|
+
write({ type: 'tool_execution_start', toolCallId: 'toolu_task_1', toolName: 'task', args: { agent: 'explore', task: 'Review the change' } });
|
|
496
|
+
write({ type: 'subagent_lifecycle', payload: { id: 'Reviewer', agent: 'explore', status: 'started', parentToolCallId: 'toolu_task_1', index: 0 } });
|
|
497
|
+
write({ type: 'subagent_event', payload: { id: 'Reviewer', event: { type: 'agent_start' } } });
|
|
498
|
+
write({ type: 'subagent_event', payload: { id: 'Reviewer', event: { type: 'tool_execution_start', toolCallId: 'toolu_child_grep', toolName: 'grep', args: { pattern: 'ask' } } } });
|
|
499
|
+
write({ type: 'subagent_event', payload: { id: 'Reviewer', event: { type: 'tool_execution_end', toolCallId: 'toolu_child_grep', toolName: 'grep', result: { content: [{ type: 'text', text: '3 matches' }] } } } });
|
|
500
|
+
write({ type: 'subagent_event', payload: { id: 'Reviewer', event: { type: 'agent_end', messages: [], isTerminal: true, yielded: true } } });
|
|
501
|
+
write({ type: 'subagent_lifecycle', payload: { id: 'Reviewer', agent: 'explore', status: 'completed', parentToolCallId: 'toolu_task_1', index: 0 } });
|
|
502
|
+
write({ type: 'tool_execution_end', toolCallId: 'toolu_task_1', toolName: 'task', result: { content: [{ type: 'text', text: 'Reviewer: done' }] }, isError: false });
|
|
503
|
+
// The parent keeps streaming after the child's terminal frame.
|
|
504
|
+
assistantText(['Still working after the sub-agent.\nCEZ:MONITORING']);
|
|
505
|
+
// Late child text after the parent marker; the second block never completes.
|
|
506
|
+
subagentText('Reviewer', 'Child review finished.', { input: 20, output: 10, cacheRead: 100, cacheWrite: 4, totalTokens: 134, cost: { total: 0.002 } });
|
|
507
|
+
write({ type: 'subagent_event', payload: { id: 'Reviewer', event: { type: 'message_update', message: { role: 'assistant' }, assistantMessageEvent: { type: 'text_start', contentIndex: 0 } } } });
|
|
508
|
+
write({ type: 'subagent_event', payload: { id: 'Reviewer', event: { type: 'message_update', message: { role: 'assistant' }, assistantMessageEvent: { type: 'text_delta', contentIndex: 0, delta: 'Child review still streaming.' } } } });
|
|
509
|
+
endTurn();
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
if (message.includes('mock:approval-denied')) {
|
|
513
|
+
// A user's stricter `tools.approvalMode`: OMP fails the call closed when no UI can approve it.
|
|
514
|
+
write({ type: 'tool_execution_start', toolCallId: 'tool-denied', toolName: 'bash', args: { command: 'rm -rf build' } });
|
|
515
|
+
write({ type: 'tool_execution_end', toolCallId: 'tool-denied', toolName: 'bash', result: { content: [{ type: 'text', text: NO_UI_APPROVAL_ERROR }] }, isError: true });
|
|
516
|
+
assistantText(['The command needs approval I cannot get here.']);
|
|
517
|
+
endTurn();
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
if (message.includes('mock:steer-late')) {
|
|
521
|
+
// The final text first; a steer admitted now arrives after the last model call (#505).
|
|
522
|
+
assistantText(['late window: final message already sent']);
|
|
523
|
+
activeTurn.late = true;
|
|
524
|
+
await sleep(300);
|
|
525
|
+
endTurn();
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
if (message.includes('mock:hold-done')) {
|
|
529
|
+
await waitForMockRelease(400);
|
|
530
|
+
assistantText(['parity hold-done: content after the pause\n\nCEZ:DONE']);
|
|
531
|
+
endTurn();
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
if (message.includes('mock:hold-ask')) {
|
|
535
|
+
await waitForMockRelease(400);
|
|
536
|
+
assistantText(['Pick one.\n\nCEZ:ASK {"questions":[{"header":"Library","question":"Which test library?","options":[{"label":"Vitest"},{"label":"Node test"}]}]}']);
|
|
537
|
+
endTurn();
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
if (message.includes('mock:done') || (resumeAfterAsk && message.trim() === 'Library: Vitest')) {
|
|
541
|
+
resumeAfterAsk = false;
|
|
542
|
+
assistantText(['parity done: the task is complete\n\nCEZ:DONE']);
|
|
543
|
+
endTurn();
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
if (message.includes('mock:ci-wait')) {
|
|
547
|
+
const { ciPrompt } = await import('./mock-ci-tool.mjs');
|
|
548
|
+
assistantText([await ciPrompt('omp', argv, message)]);
|
|
549
|
+
endTurn();
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
if (message.includes('mock:steer-tool')) {
|
|
553
|
+
write({ type: 'tool_execution_start', toolCallId: 'tool-steer', toolName: 'bash', args: { command: 'wait' } });
|
|
554
|
+
await sleep(Number(process.env.CEZ_MOCK_STEER_MS ?? 600));
|
|
555
|
+
write({ type: 'tool_execution_end', toolCallId: 'tool-steer', toolName: 'bash', result: { content: [{ type: 'text', text: 'waited' }] }, isError: false });
|
|
556
|
+
assistantText(['steer tool done']);
|
|
557
|
+
endTurn();
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
if (message.includes('mock:provider-error')) {
|
|
561
|
+
const error = { message: 'Not Found', provider: 'anthropic', model: 'claude-mock', retryable: false };
|
|
562
|
+
assistantText([], { stopReason: 'error', usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0, cost: { total: 0 } }, extra: { errorMessage: 'Not Found' } });
|
|
563
|
+
endTurn({ status: 'error', error });
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
if (message.includes('mock:no-settle')) {
|
|
567
|
+
// The stream ends mid-turn after a failed attempt: no agent_end, no settle.
|
|
568
|
+
assistantText([], { stopReason: 'error', usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0, cost: { total: 0 } }, extra: { errorMessage: 'Overloaded' } });
|
|
569
|
+
process.exit(0);
|
|
570
|
+
}
|
|
571
|
+
if (message.includes('mock:hold-gated')) {
|
|
572
|
+
await waitForMockRelease(250);
|
|
573
|
+
assistantText(['parity hold-gated: content after the pause']);
|
|
574
|
+
await sleep(250);
|
|
575
|
+
endTurn();
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
if (message.includes('mock:hold')) {
|
|
579
|
+
// Content and the settle both trail the prompt ack, so a turn-end derived from the ack
|
|
580
|
+
// (or a short deadline) is caught before any content arrives.
|
|
581
|
+
await sleep(250);
|
|
582
|
+
assistantText(['parity hold: content after the pause']);
|
|
583
|
+
await sleep(250);
|
|
584
|
+
endTurn();
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
assistantText([`Investigating: `, message, ...(message.includes('mock:monitoring') ? ['\n\nCEZ:MONITORING'] : [])]);
|
|
589
|
+
write({ type: 'tool_execution_start', toolCallId: 'tool-1', toolName: 'read', args: { path: 'README.md' } });
|
|
590
|
+
write({ type: 'tool_execution_end', toolCallId: 'tool-1', toolName: 'read', result: { content: [{ type: 'text', text: 'mock file' }] }, isError: false });
|
|
591
|
+
if (!message.includes('mock:monitoring')) {
|
|
592
|
+
assistantText(['Done with the first pass.'], { usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0, cost: { total: 0 } } });
|
|
593
|
+
}
|
|
594
|
+
endTurn();
|
|
595
|
+
if (message.includes('mock:wake-after-settle')) {
|
|
596
|
+
// OMP resumes on its own after settling (async work finished): a new agent run, no prompt.
|
|
597
|
+
await sleep(250);
|
|
598
|
+
beginTurn();
|
|
599
|
+
assistantText(['woke after settle']);
|
|
600
|
+
write({ type: 'turn_end' });
|
|
601
|
+
write({ type: 'agent_end', messages: [], isTerminal: true, yielded: true });
|
|
602
|
+
activeTurn = null;
|
|
603
|
+
write({ type: 'session_settled' });
|
|
604
|
+
}
|
|
605
|
+
}
|