@wjarka/cezarion 0.17.0 → 0.18.0-dev.5793
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/bin.js +2 -0
- package/cez.js +2 -0
- package/cezarion.js +2 -0
- package/dist/cez.js +2 -0
- package/dist/cezarion.js +2 -0
- package/dist/hsq.js +2 -0
- package/dist/index.js +1 -835
- package/dist/server/app-type.d.ts +1 -6
- package/dist/server/app-type.js +1 -2
- package/hsq.js +2 -0
- package/package.json +20 -59
- package/web/dist/assets/activity-motion-0wHCeUs7.css +1 -0
- package/web/dist/assets/activity-motion-2nE59DAT.js +2 -0
- package/web/dist/assets/activity-route-R9lPc2jy.js +1 -0
- package/web/dist/assets/agent-accounts-f1cxwgfz.js +18 -0
- package/web/dist/assets/alert-dialog-Dj464rjk.js +1 -0
- package/web/dist/assets/arrow-right-Dh_Lx3um.js +1 -0
- package/web/dist/assets/button-CHUAMTHK.js +3 -0
- package/web/dist/assets/centered-state-DGyy0SuA.js +1 -0
- package/web/dist/assets/cez-idle-EVoUsgU3.js +1 -0
- package/web/dist/assets/commit-diff-panel-BJyNYmCY.js +1 -0
- package/web/dist/assets/control-locations-C9II3kPz.js +1 -0
- package/web/dist/assets/design-icons-DmYTv2r1.js +1 -0
- package/web/dist/assets/diff-D_9MtICR.js +3 -0
- package/web/dist/assets/diff-controls-BR2uqhwG.js +1 -0
- package/web/dist/assets/diff-view-xRPxXHXl.js +11 -0
- package/web/dist/assets/dropdown-menu-DhrBcVgr.js +1 -0
- package/web/dist/assets/es2015-D345RR4o.js +41 -0
- package/web/dist/assets/file-preview-D08Kq15E.js +2 -0
- package/web/dist/assets/git-toolbar-D9taioU5.js +1 -0
- package/web/dist/assets/github-bv_pBGc5.js +1 -0
- package/web/dist/assets/github-sidebar-model-B0Ufci5S.js +1 -0
- package/web/dist/assets/global-activity-route-QxTPDyx-.js +1 -0
- package/web/dist/assets/hourglass-B0lPAJvT.js +1 -0
- package/web/dist/assets/{image-preview-C_t9q45f.js → image-preview-Cq1vDiEo.js} +1 -1
- package/web/dist/assets/index-B18AqW0Z.css +1 -0
- package/web/dist/assets/index-DgU3yYUl.js +14 -0
- package/web/dist/assets/index.global-D3Ga_D3Y.js +1 -0
- package/web/dist/assets/live-protocol-BVn0UA_g.js +64 -0
- package/web/dist/assets/live-refetch-BdnmTJ_8.js +1 -0
- package/web/dist/assets/{live-worker-BizfZSoh.ts → live-worker-BWdeGzQX.ts} +2 -1
- package/web/dist/assets/loader-circle-CZkGEdoI.js +1 -0
- package/web/dist/assets/markdown-D7DUNWcJ.js +6 -0
- package/web/dist/assets/mermaid.min-3O9YjB2l.js +1 -0
- package/web/dist/assets/message-square-B-MD-8rD.js +1 -0
- package/web/dist/assets/{nav-row-styles-AoIhhIwf.js → nav-row-styles-BZUUavOF.js} +1 -1
- package/web/dist/assets/popover-DRcRI46x.js +1 -0
- package/web/dist/assets/preview-pane-connected-cD-MTiVN.js +3 -0
- package/web/dist/assets/project-router-MMOk9VbW.js +1 -0
- package/web/dist/assets/project-scope-context-B3M-u8R0.js +4 -0
- package/web/dist/assets/queries-DORTKwyN.js +1 -0
- package/web/dist/assets/repo-git-E_4Ighvg.js +1 -0
- package/web/dist/assets/report-reader-XVNQsXB4.js +1 -0
- package/web/dist/assets/report-title-D4Mbu2Er.js +1 -0
- package/web/dist/assets/reports-B7QAzibP.css +1 -0
- package/web/dist/assets/reports-B_PVTBzP.js +1 -0
- package/web/dist/assets/run-header-wm0gSs6X.js +2 -0
- package/web/dist/assets/skill-empty-hint-YDmkqgo-.js +1 -0
- package/web/dist/assets/skills-D2RLxUIc.js +1 -0
- package/web/dist/assets/skills-DFBiAuJG.js +1 -0
- package/web/dist/assets/skills-workflows-C21NystW.css +1 -0
- package/web/dist/assets/sortable.esm-zp_qkYGV.js +5 -0
- package/web/dist/assets/tab-link-BvoGfK8S.js +1 -0
- package/web/dist/assets/task-changes-DNtkfFzQ.js +1 -0
- package/web/dist/assets/task-commits-CivO-OrN.js +1 -0
- package/web/dist/assets/task-files-dczkxV_G.js +1 -0
- package/web/dist/assets/task-github-item-DKV4yrcf.js +1 -0
- package/web/dist/assets/task-thread-DIaTTGEF.js +9 -0
- package/web/dist/assets/textarea-DlVUfdWG.js +1 -0
- package/web/dist/assets/thread-state-DIozHuHb.js +4 -0
- package/web/dist/assets/toaster-B1MyeHiE.js +1 -0
- package/web/dist/assets/use-hand-to-agent-state-D58ayxI4.js +1 -0
- package/web/dist/assets/useInfiniteQuery-BbYMWe23.js +1 -0
- package/web/dist/assets/useQuery-CqqnAJvu.js +1 -0
- package/web/dist/assets/workflows-YMEsGXeB.js +7 -0
- package/web/dist/assets/ws-BtSVmivO.js +1 -0
- package/web/dist/assets/zoomable-image-5pOUaPEg.js +1 -0
- package/web/dist/index.html +31 -15
- package/web/dist/live-worker.js +2 -2
- package/LICENSE +0 -22
- package/README.md +0 -1725
- package/dist/agent-config/account-identity.d.ts +0 -28
- package/dist/agent-config/account-identity.js +0 -131
- package/dist/agent-config/account-identity.js.map +0 -1
- package/dist/agent-config/catalog.d.ts +0 -70
- package/dist/agent-config/catalog.js +0 -383
- package/dist/agent-config/catalog.js.map +0 -1
- package/dist/agent-config/files.d.ts +0 -42
- package/dist/agent-config/files.js +0 -115
- package/dist/agent-config/files.js.map +0 -1
- package/dist/agent-config/model-settings/claude.d.ts +0 -2
- package/dist/agent-config/model-settings/claude.js +0 -11
- package/dist/agent-config/model-settings/claude.js.map +0 -1
- package/dist/agent-config/model-settings/codex.d.ts +0 -2
- package/dist/agent-config/model-settings/codex.js +0 -16
- package/dist/agent-config/model-settings/codex.js.map +0 -1
- package/dist/agent-config/model-settings/opencode.d.ts +0 -2
- package/dist/agent-config/model-settings/opencode.js +0 -8
- package/dist/agent-config/model-settings/opencode.js.map +0 -1
- package/dist/agent-config/model-settings/pi.d.ts +0 -2
- package/dist/agent-config/model-settings/pi.js +0 -38
- package/dist/agent-config/model-settings/pi.js.map +0 -1
- package/dist/agent-config/model-settings/shared.d.ts +0 -12
- package/dist/agent-config/model-settings/shared.js +0 -100
- package/dist/agent-config/model-settings/shared.js.map +0 -1
- package/dist/agent-config/model-settings/types.d.ts +0 -9
- package/dist/agent-config/model-settings/types.js +0 -2
- package/dist/agent-config/model-settings/types.js.map +0 -1
- package/dist/agent-config/models.d.ts +0 -9
- package/dist/agent-config/models.js +0 -40
- package/dist/agent-config/models.js.map +0 -1
- package/dist/agent-config/seed.d.ts +0 -15
- package/dist/agent-config/seed.js +0 -94
- package/dist/agent-config/seed.js.map +0 -1
- package/dist/agent-config/service.d.ts +0 -44
- package/dist/agent-config/service.js +0 -72
- package/dist/agent-config/service.js.map +0 -1
- package/dist/agent-config/validate.d.ts +0 -18
- package/dist/agent-config/validate.js +0 -82
- package/dist/agent-config/validate.js.map +0 -1
- package/dist/application-update/bin-recovery.d.ts +0 -5
- package/dist/application-update/bin-recovery.js +0 -96
- package/dist/application-update/bin-recovery.js.map +0 -1
- package/dist/application-update/discovery.d.ts +0 -22
- package/dist/application-update/discovery.js +0 -91
- package/dist/application-update/discovery.js.map +0 -1
- package/dist/application-update/helper.d.ts +0 -57
- package/dist/application-update/helper.js +0 -369
- package/dist/application-update/helper.js.map +0 -1
- package/dist/application-update/launcher.d.ts +0 -12
- package/dist/application-update/launcher.js +0 -59
- package/dist/application-update/launcher.js.map +0 -1
- package/dist/application-update/lock.d.ts +0 -4
- package/dist/application-update/lock.js +0 -70
- package/dist/application-update/lock.js.map +0 -1
- package/dist/application-update/npm-process.d.ts +0 -17
- package/dist/application-update/npm-process.js +0 -133
- package/dist/application-update/npm-process.js.map +0 -1
- package/dist/application-update/service.d.ts +0 -69
- package/dist/application-update/service.js +0 -456
- package/dist/application-update/service.js.map +0 -1
- package/dist/archive-on-merge-setting.d.ts +0 -15
- package/dist/archive-on-merge-setting.js +0 -14
- package/dist/archive-on-merge-setting.js.map +0 -1
- package/dist/artifacts/cli.d.ts +0 -9
- package/dist/artifacts/cli.js +0 -59
- package/dist/artifacts/cli.js.map +0 -1
- package/dist/artifacts/lifecycle.d.ts +0 -4
- package/dist/artifacts/lifecycle.js +0 -42
- package/dist/artifacts/lifecycle.js.map +0 -1
- package/dist/artifacts/resolve.d.ts +0 -18
- package/dist/artifacts/resolve.js +0 -103
- package/dist/artifacts/resolve.js.map +0 -1
- package/dist/artifacts/store.d.ts +0 -8
- package/dist/artifacts/store.js +0 -323
- package/dist/artifacts/store.js.map +0 -1
- package/dist/automations/automation-cli.d.ts +0 -59
- package/dist/automations/automation-cli.js +0 -509
- package/dist/automations/automation-cli.js.map +0 -1
- package/dist/automations/builtin-skill.d.ts +0 -7
- package/dist/automations/builtin-skill.js +0 -14
- package/dist/automations/builtin-skill.js.map +0 -1
- package/dist/automations/coordinator.d.ts +0 -33
- package/dist/automations/coordinator.js +0 -86
- package/dist/automations/coordinator.js.map +0 -1
- package/dist/automations/github-baseline.d.ts +0 -3
- package/dist/automations/github-baseline.js +0 -17
- package/dist/automations/github-baseline.js.map +0 -1
- package/dist/automations/github-poller.d.ts +0 -93
- package/dist/automations/github-poller.js +0 -303
- package/dist/automations/github-poller.js.map +0 -1
- package/dist/automations/prompts.d.ts +0 -12
- package/dist/automations/prompts.js +0 -160
- package/dist/automations/prompts.js.map +0 -1
- package/dist/automations/schedule-runner.d.ts +0 -149
- package/dist/automations/schedule-runner.js +0 -513
- package/dist/automations/schedule-runner.js.map +0 -1
- package/dist/automations/scheduler.d.ts +0 -87
- package/dist/automations/scheduler.js +0 -434
- package/dist/automations/scheduler.js.map +0 -1
- package/dist/automations/service.d.ts +0 -777
- package/dist/automations/service.js +0 -444
- package/dist/automations/service.js.map +0 -1
- package/dist/automations/store.d.ts +0 -160
- package/dist/automations/store.js +0 -738
- package/dist/automations/store.js.map +0 -1
- package/dist/automations/task-template.d.ts +0 -59
- package/dist/automations/task-template.js +0 -273
- package/dist/automations/task-template.js.map +0 -1
- package/dist/automations/tool-adapter.d.ts +0 -6
- package/dist/automations/tool-adapter.js +0 -108
- package/dist/automations/tool-adapter.js.map +0 -1
- package/dist/automations/types.d.ts +0 -1
- package/dist/automations/types.js +0 -2
- package/dist/automations/types.js.map +0 -1
- package/dist/autosave-cleanup.d.ts +0 -26
- package/dist/autosave-cleanup.js +0 -87
- package/dist/autosave-cleanup.js.map +0 -1
- package/dist/autosave-git.d.ts +0 -21
- package/dist/autosave-git.js +0 -204
- package/dist/autosave-git.js.map +0 -1
- package/dist/autosave-group.d.ts +0 -8
- package/dist/autosave-group.js +0 -61
- package/dist/autosave-group.js.map +0 -1
- package/dist/autosave-holders.d.ts +0 -34
- package/dist/autosave-holders.js +0 -204
- package/dist/autosave-holders.js.map +0 -1
- package/dist/autosave-windows.d.ts +0 -25
- package/dist/autosave-windows.js +0 -156
- package/dist/autosave-windows.js.map +0 -1
- package/dist/ci-wait/client.d.ts +0 -28
- package/dist/ci-wait/client.js +0 -105
- package/dist/ci-wait/client.js.map +0 -1
- package/dist/ci-wait/controller.d.ts +0 -756
- package/dist/ci-wait/controller.js +0 -334
- package/dist/ci-wait/controller.js.map +0 -1
- package/dist/ci-wait/errors.d.ts +0 -27
- package/dist/ci-wait/errors.js +0 -252
- package/dist/ci-wait/errors.js.map +0 -1
- package/dist/ci-wait/github.d.ts +0 -87
- package/dist/ci-wait/github.js +0 -278
- package/dist/ci-wait/github.js.map +0 -1
- package/dist/ci-wait/injection.d.ts +0 -3
- package/dist/ci-wait/injection.js +0 -26
- package/dist/ci-wait/injection.js.map +0 -1
- package/dist/ci-wait/mcp.d.ts +0 -3
- package/dist/ci-wait/mcp.js +0 -30
- package/dist/ci-wait/mcp.js.map +0 -1
- package/dist/ci-wait/resources.d.ts +0 -7
- package/dist/ci-wait/resources.js +0 -32
- package/dist/ci-wait/resources.js.map +0 -1
- package/dist/ci-wait/supervisor.d.ts +0 -29
- package/dist/ci-wait/supervisor.js +0 -260
- package/dist/ci-wait/supervisor.js.map +0 -1
- package/dist/ci-wait/tools.d.ts +0 -827
- package/dist/ci-wait/tools.js +0 -208
- package/dist/ci-wait/tools.js.map +0 -1
- package/dist/config.d.ts +0 -68
- package/dist/config.js +0 -209
- package/dist/config.js.map +0 -1
- package/dist/contract/active-provider.d.ts +0 -12
- package/dist/contract/agent-config.d.ts +0 -160
- package/dist/contract/agent-profiles.d.ts +0 -369
- package/dist/contract/application-update.d.ts +0 -32
- package/dist/contract/artifacts.d.ts +0 -83
- package/dist/contract/ask-schema.d.ts +0 -50
- package/dist/contract/ask.d.ts +0 -9
- package/dist/contract/attachments.d.ts +0 -35
- package/dist/contract/attention.d.ts +0 -90
- package/dist/contract/automation-requests.d.ts +0 -308
- package/dist/contract/automation-schedule.d.ts +0 -89
- package/dist/contract/automation-storage.d.ts +0 -512
- package/dist/contract/automations.d.ts +0 -1542
- package/dist/contract/ci-wait.d.ts +0 -222
- package/dist/contract/config-requests.d.ts +0 -36
- package/dist/contract/conversations.d.ts +0 -351
- package/dist/contract/defined.d.ts +0 -8
- package/dist/contract/delegation.d.ts +0 -1882
- package/dist/contract/discovery.d.ts +0 -141
- package/dist/contract/effort.d.ts +0 -18
- package/dist/contract/events.d.ts +0 -292
- package/dist/contract/github-requests.d.ts +0 -26
- package/dist/contract/github.d.ts +0 -732
- package/dist/contract/handoff.d.ts +0 -43
- package/dist/contract/health.d.ts +0 -124
- package/dist/contract/image-path.d.ts +0 -6
- package/dist/contract/index.d.ts +0 -59
- package/dist/contract/index.js +0 -5887
- package/dist/contract/live-coordination.d.ts +0 -158
- package/dist/contract/live-limits.d.ts +0 -8
- package/dist/contract/live.d.ts +0 -123
- package/dist/contract/pending-ask.d.ts +0 -58
- package/dist/contract/permissions.d.ts +0 -54
- package/dist/contract/preview.d.ts +0 -541
- package/dist/contract/project-limits.d.ts +0 -33
- package/dist/contract/projects.d.ts +0 -716
- package/dist/contract/provider-requests.d.ts +0 -77
- package/dist/contract/query-requests.d.ts +0 -52
- package/dist/contract/repo-requests.d.ts +0 -12
- package/dist/contract/repo.d.ts +0 -496
- package/dist/contract/run-labels.d.ts +0 -8
- package/dist/contract/run-limits.d.ts +0 -8
- package/dist/contract/run-predicates.d.ts +0 -32
- package/dist/contract/run-requests.d.ts +0 -33
- package/dist/contract/run-search.d.ts +0 -193
- package/dist/contract/runs.d.ts +0 -5340
- package/dist/contract/scheduled-tasks.d.ts +0 -187
- package/dist/contract/skills.d.ts +0 -56
- package/dist/contract/team-skill-ref.d.ts +0 -10
- package/dist/contract/tool-display.d.ts +0 -25
- package/dist/contract/ui-state-requests.d.ts +0 -60
- package/dist/contract/version.d.ts +0 -3
- package/dist/contract/voice.d.ts +0 -213
- package/dist/contract/waits.d.ts +0 -1204
- package/dist/contract/workflow-file.d.ts +0 -37
- package/dist/contract/workflow-requests.d.ts +0 -7
- package/dist/contract/workflows.d.ts +0 -250
- package/dist/contract/workspace.d.ts +0 -631
- package/dist/contract/zoned-time.d.ts +0 -26
- package/dist/core/agent-env.d.ts +0 -30
- package/dist/core/agent-env.js +0 -400
- package/dist/core/agent-env.js.map +0 -1
- package/dist/core/agent-model-policy.d.ts +0 -10
- package/dist/core/agent-model-policy.js +0 -36
- package/dist/core/agent-model-policy.js.map +0 -1
- package/dist/core/agent-profiles.d.ts +0 -50
- package/dist/core/agent-profiles.js +0 -105
- package/dist/core/agent-profiles.js.map +0 -1
- package/dist/core/agent-runner.d.ts +0 -394
- package/dist/core/agent-runner.js +0 -96
- package/dist/core/agent-runner.js.map +0 -1
- package/dist/core/ask.d.ts +0 -79
- package/dist/core/ask.js +0 -232
- package/dist/core/ask.js.map +0 -1
- package/dist/core/backend-detect.d.ts +0 -17
- package/dist/core/backend-detect.js +0 -209
- package/dist/core/backend-detect.js.map +0 -1
- package/dist/core/claude-cli-runner.d.ts +0 -72
- package/dist/core/claude-cli-runner.js +0 -910
- package/dist/core/claude-cli-runner.js.map +0 -1
- package/dist/core/claude-model-catalog.d.ts +0 -16
- package/dist/core/claude-model-catalog.js +0 -198
- package/dist/core/claude-model-catalog.js.map +0 -1
- package/dist/core/claude-ui-mapper.d.ts +0 -80
- package/dist/core/claude-ui-mapper.js +0 -696
- package/dist/core/claude-ui-mapper.js.map +0 -1
- package/dist/core/codex-app-server-runner.d.ts +0 -61
- package/dist/core/codex-app-server-runner.js +0 -1278
- package/dist/core/codex-app-server-runner.js.map +0 -1
- package/dist/core/codex-app-server-transport.d.ts +0 -52
- package/dist/core/codex-app-server-transport.js +0 -199
- package/dist/core/codex-app-server-transport.js.map +0 -1
- package/dist/core/codex-approvals.d.ts +0 -12
- package/dist/core/codex-approvals.js +0 -161
- package/dist/core/codex-approvals.js.map +0 -1
- package/dist/core/codex-model-catalog.d.ts +0 -10
- package/dist/core/codex-model-catalog.js +0 -110
- package/dist/core/codex-model-catalog.js.map +0 -1
- package/dist/core/codex-permissions.d.ts +0 -6
- package/dist/core/codex-permissions.js +0 -27
- package/dist/core/codex-permissions.js.map +0 -1
- package/dist/core/codex-stream-error.d.ts +0 -2
- package/dist/core/codex-stream-error.js +0 -12
- package/dist/core/codex-stream-error.js.map +0 -1
- package/dist/core/codex-turn-outcome.d.ts +0 -8
- package/dist/core/codex-turn-outcome.js +0 -30
- package/dist/core/codex-turn-outcome.js.map +0 -1
- package/dist/core/codex-ui-mapper.d.ts +0 -112
- package/dist/core/codex-ui-mapper.js +0 -808
- package/dist/core/codex-ui-mapper.js.map +0 -1
- package/dist/core/cursor-acp-runner.d.ts +0 -34
- package/dist/core/cursor-acp-runner.js +0 -777
- package/dist/core/cursor-acp-runner.js.map +0 -1
- package/dist/core/cursor-cli-flags.d.ts +0 -19
- package/dist/core/cursor-cli-flags.js +0 -47
- package/dist/core/cursor-cli-flags.js.map +0 -1
- package/dist/core/cursor-config-options.d.ts +0 -18
- package/dist/core/cursor-config-options.js +0 -31
- package/dist/core/cursor-config-options.js.map +0 -1
- package/dist/core/cursor-model-catalog.d.ts +0 -45
- package/dist/core/cursor-model-catalog.js +0 -300
- package/dist/core/cursor-model-catalog.js.map +0 -1
- package/dist/core/cursor-print-capabilities.d.ts +0 -16
- package/dist/core/cursor-print-capabilities.js +0 -141
- package/dist/core/cursor-print-capabilities.js.map +0 -1
- package/dist/core/cursor-print-process.d.ts +0 -31
- package/dist/core/cursor-print-process.js +0 -117
- package/dist/core/cursor-print-process.js.map +0 -1
- package/dist/core/cursor-print-runner.d.ts +0 -31
- package/dist/core/cursor-print-runner.js +0 -555
- package/dist/core/cursor-print-runner.js.map +0 -1
- package/dist/core/cursor-print-tool-catalog.d.ts +0 -10
- package/dist/core/cursor-print-tool-catalog.js +0 -91
- package/dist/core/cursor-print-tool-catalog.js.map +0 -1
- package/dist/core/cursor-print-ui-mapper.d.ts +0 -47
- package/dist/core/cursor-print-ui-mapper.js +0 -553
- package/dist/core/cursor-print-ui-mapper.js.map +0 -1
- package/dist/core/cursor-provider-error.d.ts +0 -33
- package/dist/core/cursor-provider-error.js +0 -68
- package/dist/core/cursor-provider-error.js.map +0 -1
- package/dist/core/cursor-runner.d.ts +0 -24
- package/dist/core/cursor-runner.js +0 -149
- package/dist/core/cursor-runner.js.map +0 -1
- package/dist/core/cursor-ui-mapper.d.ts +0 -29
- package/dist/core/cursor-ui-mapper.js +0 -275
- package/dist/core/cursor-ui-mapper.js.map +0 -1
- package/dist/core/defined.d.ts +0 -1
- package/dist/core/defined.js +0 -2
- package/dist/core/defined.js.map +0 -1
- package/dist/core/hook-items.d.ts +0 -14
- package/dist/core/hook-items.js +0 -13
- package/dist/core/hook-items.js.map +0 -1
- package/dist/core/host-model-catalog.d.ts +0 -7
- package/dist/core/host-model-catalog.js +0 -21
- package/dist/core/host-model-catalog.js.map +0 -1
- package/dist/core/input-submissions.d.ts +0 -14
- package/dist/core/input-submissions.js +0 -26
- package/dist/core/input-submissions.js.map +0 -1
- package/dist/core/managed-session.d.ts +0 -6
- package/dist/core/managed-session.js +0 -116
- package/dist/core/managed-session.js.map +0 -1
- package/dist/core/model-identity.d.ts +0 -108
- package/dist/core/model-identity.js +0 -137
- package/dist/core/model-identity.js.map +0 -1
- package/dist/core/model-presets.d.ts +0 -10
- package/dist/core/model-presets.js +0 -77
- package/dist/core/model-presets.js.map +0 -1
- package/dist/core/ndjson.d.ts +0 -6
- package/dist/core/ndjson.js +0 -23
- package/dist/core/ndjson.js.map +0 -1
- package/dist/core/omp-model-catalog.d.ts +0 -43
- package/dist/core/omp-model-catalog.js +0 -205
- package/dist/core/omp-model-catalog.js.map +0 -1
- package/dist/core/omp-runner.d.ts +0 -72
- package/dist/core/omp-runner.js +0 -1049
- package/dist/core/omp-runner.js.map +0 -1
- package/dist/core/omp-ui-mapper.d.ts +0 -106
- package/dist/core/omp-ui-mapper.js +0 -882
- package/dist/core/omp-ui-mapper.js.map +0 -1
- package/dist/core/opencode-model-catalog.d.ts +0 -32
- package/dist/core/opencode-model-catalog.js +0 -215
- package/dist/core/opencode-model-catalog.js.map +0 -1
- package/dist/core/opencode-permissions.d.ts +0 -52
- package/dist/core/opencode-permissions.js +0 -101
- package/dist/core/opencode-permissions.js.map +0 -1
- package/dist/core/opencode-server-runner.d.ts +0 -61
- package/dist/core/opencode-server-runner.js +0 -1692
- package/dist/core/opencode-server-runner.js.map +0 -1
- package/dist/core/opencode-session-error.d.ts +0 -19
- package/dist/core/opencode-session-error.js +0 -42
- package/dist/core/opencode-session-error.js.map +0 -1
- package/dist/core/opencode-ui-mapper.d.ts +0 -137
- package/dist/core/opencode-ui-mapper.js +0 -768
- package/dist/core/opencode-ui-mapper.js.map +0 -1
- package/dist/core/pi-model-catalog.d.ts +0 -38
- package/dist/core/pi-model-catalog.js +0 -249
- package/dist/core/pi-model-catalog.js.map +0 -1
- package/dist/core/pi-runner.d.ts +0 -43
- package/dist/core/pi-runner.js +0 -827
- package/dist/core/pi-runner.js.map +0 -1
- package/dist/core/pi-ui-mapper.d.ts +0 -52
- package/dist/core/pi-ui-mapper.js +0 -395
- package/dist/core/pi-ui-mapper.js.map +0 -1
- package/dist/core/process-usage.d.ts +0 -74
- package/dist/core/process-usage.js +0 -218
- package/dist/core/process-usage.js.map +0 -1
- package/dist/core/provider-auth.d.ts +0 -168
- package/dist/core/provider-auth.js +0 -660
- package/dist/core/provider-auth.js.map +0 -1
- package/dist/core/provider-availability.d.ts +0 -3
- package/dist/core/provider-availability.js +0 -14
- package/dist/core/provider-availability.js.map +0 -1
- package/dist/core/runner-factory.d.ts +0 -11
- package/dist/core/runner-factory.js +0 -31
- package/dist/core/runner-factory.js.map +0 -1
- package/dist/core/runner-model-catalog.d.ts +0 -34
- package/dist/core/runner-model-catalog.js +0 -109
- package/dist/core/runner-model-catalog.js.map +0 -1
- package/dist/core/runner-runtime.d.ts +0 -40
- package/dist/core/runner-runtime.js +0 -88
- package/dist/core/runner-runtime.js.map +0 -1
- package/dist/core/runner-stderr.d.ts +0 -2
- package/dist/core/runner-stderr.js +0 -20
- package/dist/core/runner-stderr.js.map +0 -1
- package/dist/core/runner-tool-grants.d.ts +0 -21
- package/dist/core/runner-tool-grants.js +0 -64
- package/dist/core/runner-tool-grants.js.map +0 -1
- package/dist/core/secret-redaction.d.ts +0 -20
- package/dist/core/secret-redaction.js +0 -98
- package/dist/core/secret-redaction.js.map +0 -1
- package/dist/core/session-process.d.ts +0 -42
- package/dist/core/session-process.js +0 -360
- package/dist/core/session-process.js.map +0 -1
- package/dist/core/shell-env.d.ts +0 -17
- package/dist/core/shell-env.js +0 -51
- package/dist/core/shell-env.js.map +0 -1
- package/dist/core/ui-events.d.ts +0 -348
- package/dist/core/ui-events.js +0 -2
- package/dist/core/ui-events.js.map +0 -1
- package/dist/core/usage-limit.d.ts +0 -42
- package/dist/core/usage-limit.js +0 -152
- package/dist/core/usage-limit.js.map +0 -1
- package/dist/core/usage.d.ts +0 -11
- package/dist/core/usage.js +0 -15
- package/dist/core/usage.js.map +0 -1
- package/dist/core/v1-text-coalescer.d.ts +0 -36
- package/dist/core/v1-text-coalescer.js +0 -72
- package/dist/core/v1-text-coalescer.js.map +0 -1
- package/dist/data-gitignore.d.ts +0 -6
- package/dist/data-gitignore.js +0 -59
- package/dist/data-gitignore.js.map +0 -1
- package/dist/delegation/capacity.d.ts +0 -15
- package/dist/delegation/capacity.js +0 -30
- package/dist/delegation/capacity.js.map +0 -1
- package/dist/delegation/cli.d.ts +0 -4
- package/dist/delegation/cli.js +0 -481
- package/dist/delegation/cli.js.map +0 -1
- package/dist/delegation/context.d.ts +0 -40
- package/dist/delegation/context.js +0 -378
- package/dist/delegation/context.js.map +0 -1
- package/dist/delegation/conversations.d.ts +0 -9
- package/dist/delegation/conversations.js +0 -66
- package/dist/delegation/conversations.js.map +0 -1
- package/dist/delegation/credentials.d.ts +0 -21
- package/dist/delegation/credentials.js +0 -66
- package/dist/delegation/credentials.js.map +0 -1
- package/dist/delegation/destroy-observation.d.ts +0 -42
- package/dist/delegation/destroy-observation.js +0 -115
- package/dist/delegation/destroy-observation.js.map +0 -1
- package/dist/delegation/effort.d.ts +0 -1
- package/dist/delegation/effort.js +0 -11
- package/dist/delegation/effort.js.map +0 -1
- package/dist/delegation/execution-identity.d.ts +0 -180
- package/dist/delegation/execution-identity.js +0 -154
- package/dist/delegation/execution-identity.js.map +0 -1
- package/dist/delegation/idle-test-app.d.ts +0 -4
- package/dist/delegation/idle-test-app.js +0 -174
- package/dist/delegation/idle-test-app.js.map +0 -1
- package/dist/delegation/input.d.ts +0 -12
- package/dist/delegation/input.js +0 -50
- package/dist/delegation/input.js.map +0 -1
- package/dist/delegation/park-notice.d.ts +0 -42
- package/dist/delegation/park-notice.js +0 -71
- package/dist/delegation/park-notice.js.map +0 -1
- package/dist/delegation/policy.d.ts +0 -22
- package/dist/delegation/policy.js +0 -95
- package/dist/delegation/policy.js.map +0 -1
- package/dist/delegation/process-liveness.d.ts +0 -98
- package/dist/delegation/process-liveness.js +0 -213
- package/dist/delegation/process-liveness.js.map +0 -1
- package/dist/delegation/provision.d.ts +0 -32
- package/dist/delegation/provision.js +0 -177
- package/dist/delegation/provision.js.map +0 -1
- package/dist/delegation/questions.d.ts +0 -21
- package/dist/delegation/questions.js +0 -50
- package/dist/delegation/questions.js.map +0 -1
- package/dist/delegation/readiness.d.ts +0 -13
- package/dist/delegation/readiness.js +0 -19
- package/dist/delegation/readiness.js.map +0 -1
- package/dist/delegation/results.d.ts +0 -13
- package/dist/delegation/results.js +0 -154
- package/dist/delegation/results.js.map +0 -1
- package/dist/delegation/retry-backoff.d.ts +0 -31
- package/dist/delegation/retry-backoff.js +0 -26
- package/dist/delegation/retry-backoff.js.map +0 -1
- package/dist/delegation/routes.d.ts +0 -953
- package/dist/delegation/routes.js +0 -74
- package/dist/delegation/routes.js.map +0 -1
- package/dist/delegation/scratch-cleanup.d.ts +0 -28
- package/dist/delegation/scratch-cleanup.js +0 -145
- package/dist/delegation/scratch-cleanup.js.map +0 -1
- package/dist/delegation/service.d.ts +0 -211
- package/dist/delegation/service.js +0 -946
- package/dist/delegation/service.js.map +0 -1
- package/dist/delegation/transport.d.ts +0 -931
- package/dist/delegation/transport.js +0 -22
- package/dist/delegation/transport.js.map +0 -1
- package/dist/delegation/wait.d.ts +0 -14
- package/dist/delegation/wait.js +0 -72
- package/dist/delegation/wait.js.map +0 -1
- package/dist/delegation/windows-test-app.d.ts +0 -5
- package/dist/delegation/windows-test-app.js +0 -63
- package/dist/delegation/windows-test-app.js.map +0 -1
- package/dist/delegation/windows-workspace-identity.d.ts +0 -3
- package/dist/delegation/windows-workspace-identity.js +0 -22
- package/dist/delegation/windows-workspace-identity.js.map +0 -1
- package/dist/delegation/workspace.d.ts +0 -33
- package/dist/delegation/workspace.js +0 -556
- package/dist/delegation/workspace.js.map +0 -1
- package/dist/detached-process.d.ts +0 -103
- package/dist/detached-process.js +0 -301
- package/dist/detached-process.js.map +0 -1
- package/dist/discovery/catalog.d.ts +0 -15
- package/dist/discovery/catalog.js +0 -31
- package/dist/discovery/catalog.js.map +0 -1
- package/dist/discovery/cli.d.ts +0 -8
- package/dist/discovery/cli.js +0 -106
- package/dist/discovery/cli.js.map +0 -1
- package/dist/git-diff-base.d.ts +0 -41
- package/dist/git-diff-base.js +0 -116
- package/dist/git-diff-base.js.map +0 -1
- package/dist/git-index-copy.d.ts +0 -4
- package/dist/git-index-copy.js +0 -10
- package/dist/git-index-copy.js.map +0 -1
- package/dist/git-refs.d.ts +0 -11
- package/dist/git-refs.js +0 -14
- package/dist/git-refs.js.map +0 -1
- package/dist/git-worktree-lock-helper.d.ts +0 -7
- package/dist/git-worktree-lock-helper.js +0 -158
- package/dist/git-worktree-lock-helper.js.map +0 -1
- package/dist/git-worktree-lock.d.ts +0 -17
- package/dist/git-worktree-lock.js +0 -90
- package/dist/git-worktree-lock.js.map +0 -1
- package/dist/git-worktree-release.d.ts +0 -20
- package/dist/git-worktree-release.js +0 -27
- package/dist/git-worktree-release.js.map +0 -1
- package/dist/git-worktree.d.ts +0 -154
- package/dist/git-worktree.js +0 -858
- package/dist/git-worktree.js.map +0 -1
- package/dist/handoff.d.ts +0 -72
- package/dist/handoff.js +0 -206
- package/dist/handoff.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js.map +0 -1
- package/dist/install-as-command.d.ts +0 -40
- package/dist/install-as-command.js +0 -52
- package/dist/install-as-command.js.map +0 -1
- package/dist/merge-observations.d.ts +0 -13
- package/dist/merge-observations.js +0 -55
- package/dist/merge-observations.js.map +0 -1
- package/dist/open-url.d.ts +0 -2
- package/dist/open-url.js +0 -10
- package/dist/open-url.js.map +0 -1
- package/dist/pack-check.d.ts +0 -17
- package/dist/pack-check.js +0 -27
- package/dist/pack-check.js.map +0 -1
- package/dist/paths.d.ts +0 -138
- package/dist/paths.js +0 -220
- package/dist/paths.js.map +0 -1
- package/dist/planner.d.ts +0 -28
- package/dist/planner.js +0 -271
- package/dist/planner.js.map +0 -1
- package/dist/preview/agent-address.d.ts +0 -34
- package/dist/preview/agent-address.js +0 -51
- package/dist/preview/agent-address.js.map +0 -1
- package/dist/preview/agent-marker.d.ts +0 -17
- package/dist/preview/agent-marker.js +0 -71
- package/dist/preview/agent-marker.js.map +0 -1
- package/dist/preview/cdp-proxy.d.ts +0 -54
- package/dist/preview/cdp-proxy.js +0 -151
- package/dist/preview/cdp-proxy.js.map +0 -1
- package/dist/preview/cdp.d.ts +0 -49
- package/dist/preview/cdp.js +0 -167
- package/dist/preview/cdp.js.map +0 -1
- package/dist/preview/chromium.d.ts +0 -87
- package/dist/preview/chromium.js +0 -481
- package/dist/preview/chromium.js.map +0 -1
- package/dist/preview/dev-server.d.ts +0 -68
- package/dist/preview/dev-server.js +0 -317
- package/dist/preview/dev-server.js.map +0 -1
- package/dist/preview/host.d.ts +0 -221
- package/dist/preview/host.js +0 -967
- package/dist/preview/host.js.map +0 -1
- package/dist/preview/registration.d.ts +0 -68
- package/dist/preview/registration.js +0 -111
- package/dist/preview/registration.js.map +0 -1
- package/dist/preview/session.d.ts +0 -75
- package/dist/preview/session.js +0 -357
- package/dist/preview/session.js.map +0 -1
- package/dist/preview/url.d.ts +0 -6
- package/dist/preview/url.js +0 -17
- package/dist/preview/url.js.map +0 -1
- package/dist/process-wait/exit-file.d.ts +0 -29
- package/dist/process-wait/exit-file.js +0 -67
- package/dist/process-wait/exit-file.js.map +0 -1
- package/dist/process-wait/supervisor.d.ts +0 -30
- package/dist/process-wait/supervisor.js +0 -71
- package/dist/process-wait/supervisor.js.map +0 -1
- package/dist/release/manifests.d.ts +0 -103
- package/dist/release/manifests.js +0 -90
- package/dist/release/manifests.js.map +0 -1
- package/dist/release/snapshot.d.ts +0 -67
- package/dist/release/snapshot.js +0 -97
- package/dist/release/snapshot.js.map +0 -1
- package/dist/release/stable.d.ts +0 -38
- package/dist/release/stable.js +0 -55
- package/dist/release/stable.js.map +0 -1
- package/dist/runs/agent-tmpdir-removal.d.ts +0 -15
- package/dist/runs/agent-tmpdir-removal.js +0 -60
- package/dist/runs/agent-tmpdir-removal.js.map +0 -1
- package/dist/runs/agent-tmpdir.d.ts +0 -119
- package/dist/runs/agent-tmpdir.js +0 -829
- package/dist/runs/agent-tmpdir.js.map +0 -1
- package/dist/runs/arm-repo-handle.d.ts +0 -9
- package/dist/runs/arm-repo-handle.js +0 -45
- package/dist/runs/arm-repo-handle.js.map +0 -1
- package/dist/runs/auto-name.d.ts +0 -75
- package/dist/runs/auto-name.js +0 -179
- package/dist/runs/auto-name.js.map +0 -1
- package/dist/runs/client-request.d.ts +0 -11
- package/dist/runs/client-request.js +0 -26
- package/dist/runs/client-request.js.map +0 -1
- package/dist/runs/delegation-state.d.ts +0 -400
- package/dist/runs/delegation-state.js +0 -22
- package/dist/runs/delegation-state.js.map +0 -1
- package/dist/runs/event-history-agent-context.d.ts +0 -14
- package/dist/runs/event-history-agent-context.js +0 -105
- package/dist/runs/event-history-agent-context.js.map +0 -1
- package/dist/runs/event-history-context.d.ts +0 -15
- package/dist/runs/event-history-context.js +0 -109
- package/dist/runs/event-history-context.js.map +0 -1
- package/dist/runs/event-history.d.ts +0 -53
- package/dist/runs/event-history.js +0 -535
- package/dist/runs/event-history.js.map +0 -1
- package/dist/runs/history-compressor.d.ts +0 -29
- package/dist/runs/history-compressor.js +0 -116
- package/dist/runs/history-compressor.js.map +0 -1
- package/dist/runs/history-file.d.ts +0 -36
- package/dist/runs/history-file.js +0 -463
- package/dist/runs/history-file.js.map +0 -1
- package/dist/runs/history-stream.d.ts +0 -2
- package/dist/runs/history-stream.js +0 -62
- package/dist/runs/history-stream.js.map +0 -1
- package/dist/runs/legacy-index.d.ts +0 -49
- package/dist/runs/legacy-index.js +0 -155
- package/dist/runs/legacy-index.js.map +0 -1
- package/dist/runs/live-item-snapshots.d.ts +0 -13
- package/dist/runs/live-item-snapshots.js +0 -79
- package/dist/runs/live-item-snapshots.js.map +0 -1
- package/dist/runs/loaded-run-healing.d.ts +0 -3
- package/dist/runs/loaded-run-healing.js +0 -17
- package/dist/runs/loaded-run-healing.js.map +0 -1
- package/dist/runs/outcome-commit.d.ts +0 -98
- package/dist/runs/outcome-commit.js +0 -132
- package/dist/runs/outcome-commit.js.map +0 -1
- package/dist/runs/pull-requests.d.ts +0 -14
- package/dist/runs/pull-requests.js +0 -96
- package/dist/runs/pull-requests.js.map +0 -1
- package/dist/runs/raw-record.d.ts +0 -40
- package/dist/runs/raw-record.js +0 -133
- package/dist/runs/raw-record.js.map +0 -1
- package/dist/runs/retention.d.ts +0 -91
- package/dist/runs/retention.js +0 -182
- package/dist/runs/retention.js.map +0 -1
- package/dist/runs/review-gate.d.ts +0 -18
- package/dist/runs/review-gate.js +0 -21
- package/dist/runs/review-gate.js.map +0 -1
- package/dist/runs/run-claims.d.ts +0 -16
- package/dist/runs/run-claims.js +0 -24
- package/dist/runs/run-claims.js.map +0 -1
- package/dist/runs/run-database.d.ts +0 -380
- package/dist/runs/run-database.js +0 -1008
- package/dist/runs/run-database.js.map +0 -1
- package/dist/runs/run-index.d.ts +0 -26
- package/dist/runs/run-index.js +0 -212
- package/dist/runs/run-index.js.map +0 -1
- package/dist/runs/run-row.d.ts +0 -15
- package/dist/runs/run-row.js +0 -59
- package/dist/runs/run-row.js.map +0 -1
- package/dist/runs/store-open-error.d.ts +0 -24
- package/dist/runs/store-open-error.js +0 -61
- package/dist/runs/store-open-error.js.map +0 -1
- package/dist/runs/store.d.ts +0 -3090
- package/dist/runs/store.js +0 -4693
- package/dist/runs/store.js.map +0 -1
- package/dist/runs/task-markers.d.ts +0 -29
- package/dist/runs/task-markers.js +0 -78
- package/dist/runs/task-markers.js.map +0 -1
- package/dist/runs/task-refs.d.ts +0 -25
- package/dist/runs/task-refs.js +0 -74
- package/dist/runs/task-refs.js.map +0 -1
- package/dist/runs/transcript-facts-fold.d.ts +0 -64
- package/dist/runs/transcript-facts-fold.js +0 -109
- package/dist/runs/transcript-facts-fold.js.map +0 -1
- package/dist/runs/transcript-facts-load.d.ts +0 -11
- package/dist/runs/transcript-facts-load.js +0 -66
- package/dist/runs/transcript-facts-load.js.map +0 -1
- package/dist/runs/transcript-facts-queue.d.ts +0 -30
- package/dist/runs/transcript-facts-queue.js +0 -227
- package/dist/runs/transcript-facts-queue.js.map +0 -1
- package/dist/runs/transcript-facts-worker.d.ts +0 -15
- package/dist/runs/transcript-facts-worker.js +0 -26
- package/dist/runs/transcript-facts-worker.js.map +0 -1
- package/dist/runs/transcript-facts.d.ts +0 -39
- package/dist/runs/transcript-facts.js +0 -186
- package/dist/runs/transcript-facts.js.map +0 -1
- package/dist/runs/ui-event-sink.d.ts +0 -56
- package/dist/runs/ui-event-sink.js +0 -188
- package/dist/runs/ui-event-sink.js.map +0 -1
- package/dist/runs/webhook.d.ts +0 -191
- package/dist/runs/webhook.js +0 -360
- package/dist/runs/webhook.js.map +0 -1
- package/dist/runs/worker-execution.d.ts +0 -22
- package/dist/runs/worker-execution.js +0 -30
- package/dist/runs/worker-execution.js.map +0 -1
- package/dist/server/app-type.js.map +0 -1
- package/dist/server/archive-on-merge.d.ts +0 -35
- package/dist/server/archive-on-merge.js +0 -202
- package/dist/server/archive-on-merge.js.map +0 -1
- package/dist/server/capabilities.d.ts +0 -59
- package/dist/server/capabilities.js +0 -141
- package/dist/server/capabilities.js.map +0 -1
- package/dist/server/checkout-progress.d.ts +0 -10
- package/dist/server/checkout-progress.js +0 -27
- package/dist/server/checkout-progress.js.map +0 -1
- package/dist/server/checkout.d.ts +0 -129
- package/dist/server/checkout.js +0 -304
- package/dist/server/checkout.js.map +0 -1
- package/dist/server/cockpit-ownership.d.ts +0 -31
- package/dist/server/cockpit-ownership.js +0 -191
- package/dist/server/cockpit-ownership.js.map +0 -1
- package/dist/server/cold-repo-handles.d.ts +0 -14
- package/dist/server/cold-repo-handles.js +0 -78
- package/dist/server/cold-repo-handles.js.map +0 -1
- package/dist/server/completion-actions.d.ts +0 -30
- package/dist/server/completion-actions.js +0 -204
- package/dist/server/completion-actions.js.map +0 -1
- package/dist/server/create-project.d.ts +0 -71
- package/dist/server/create-project.js +0 -448
- package/dist/server/create-project.js.map +0 -1
- package/dist/server/forge/github-filters.d.ts +0 -22
- package/dist/server/forge/github-filters.js +0 -127
- package/dist/server/forge/github-filters.js.map +0 -1
- package/dist/server/forge/github-merge-requirements.d.ts +0 -18
- package/dist/server/forge/github-merge-requirements.js +0 -137
- package/dist/server/forge/github-merge-requirements.js.map +0 -1
- package/dist/server/forge/github.d.ts +0 -535
- package/dist/server/forge/github.js +0 -3200
- package/dist/server/forge/github.js.map +0 -1
- package/dist/server/forge/index.d.ts +0 -40
- package/dist/server/forge/index.js +0 -72
- package/dist/server/forge/index.js.map +0 -1
- package/dist/server/forge/types.d.ts +0 -244
- package/dist/server/forge/types.js +0 -2
- package/dist/server/forge/types.js.map +0 -1
- package/dist/server/fs-browse.d.ts +0 -80
- package/dist/server/fs-browse.js +0 -182
- package/dist/server/fs-browse.js.map +0 -1
- package/dist/server/git-changes.d.ts +0 -203
- package/dist/server/git-changes.js +0 -508
- package/dist/server/git-changes.js.map +0 -1
- package/dist/server/git.d.ts +0 -52
- package/dist/server/git.js +0 -170
- package/dist/server/git.js.map +0 -1
- package/dist/server/github.d.ts +0 -9
- package/dist/server/github.js +0 -8
- package/dist/server/github.js.map +0 -1
- package/dist/server/launch-key.d.ts +0 -5
- package/dist/server/launch-key.js +0 -31
- package/dist/server/launch-key.js.map +0 -1
- package/dist/server/live-routes.d.ts +0 -68
- package/dist/server/live-routes.js +0 -147
- package/dist/server/live-routes.js.map +0 -1
- package/dist/server/open-in-app.d.ts +0 -57
- package/dist/server/open-in-app.js +0 -177
- package/dist/server/open-in-app.js.map +0 -1
- package/dist/server/open-in-targets.d.ts +0 -42
- package/dist/server/open-in-targets.js +0 -110
- package/dist/server/open-in-targets.js.map +0 -1
- package/dist/server/open-in-terminal.d.ts +0 -73
- package/dist/server/open-in-terminal.js +0 -159
- package/dist/server/open-in-terminal.js.map +0 -1
- package/dist/server/pr.d.ts +0 -7
- package/dist/server/pr.js +0 -7
- package/dist/server/pr.js.map +0 -1
- package/dist/server/preview-cdp-socket.d.ts +0 -21
- package/dist/server/preview-cdp-socket.js +0 -112
- package/dist/server/preview-cdp-socket.js.map +0 -1
- package/dist/server/preview-socket.d.ts +0 -36
- package/dist/server/preview-socket.js +0 -126
- package/dist/server/preview-socket.js.map +0 -1
- package/dist/server/preview-sockets.d.ts +0 -14
- package/dist/server/preview-sockets.js +0 -18
- package/dist/server/preview-sockets.js.map +0 -1
- package/dist/server/project-context.d.ts +0 -192
- package/dist/server/project-context.js +0 -444
- package/dist/server/project-context.js.map +0 -1
- package/dist/server/provider-action-gate.d.ts +0 -5
- package/dist/server/provider-action-gate.js +0 -27
- package/dist/server/provider-action-gate.js.map +0 -1
- package/dist/server/provider-auth-runtime.d.ts +0 -32
- package/dist/server/provider-auth-runtime.js +0 -116
- package/dist/server/provider-auth-runtime.js.map +0 -1
- package/dist/server/repo-branches.d.ts +0 -99
- package/dist/server/repo-branches.js +0 -620
- package/dist/server/repo-branches.js.map +0 -1
- package/dist/server/repo-pull.d.ts +0 -18
- package/dist/server/repo-pull.js +0 -96
- package/dist/server/repo-pull.js.map +0 -1
- package/dist/server/run-event-feed.d.ts +0 -20
- package/dist/server/run-event-feed.js +0 -190
- package/dist/server/run-event-feed.js.map +0 -1
- package/dist/server/server-deps.d.ts +0 -37
- package/dist/server/server-deps.js +0 -114
- package/dist/server/server-deps.js.map +0 -1
- package/dist/server/server.d.ts +0 -28587
- package/dist/server/server.js +0 -5466
- package/dist/server/server.js.map +0 -1
- package/dist/server/start-run-options.d.ts +0 -82
- package/dist/server/start-run-options.js +0 -111
- package/dist/server/start-run-options.js.map +0 -1
- package/dist/server/static-ui.d.ts +0 -49
- package/dist/server/static-ui.js +0 -98
- package/dist/server/static-ui.js.map +0 -1
- package/dist/server/upgrade-router.d.ts +0 -23
- package/dist/server/upgrade-router.js +0 -53
- package/dist/server/upgrade-router.js.map +0 -1
- package/dist/server/validators.d.ts +0 -80
- package/dist/server/validators.js +0 -85
- package/dist/server/validators.js.map +0 -1
- package/dist/server/ws.d.ts +0 -65
- package/dist/server/ws.js +0 -200
- package/dist/server/ws.js.map +0 -1
- package/dist/server/wsl.d.ts +0 -25
- package/dist/server/wsl.js +0 -92
- package/dist/server/wsl.js.map +0 -1
- package/dist/server-install/engine.d.ts +0 -47
- package/dist/server-install/engine.js +0 -317
- package/dist/server-install/engine.js.map +0 -1
- package/dist/server-install/npx-cache.d.ts +0 -36
- package/dist/server-install/npx-cache.js +0 -104
- package/dist/server-install/npx-cache.js.map +0 -1
- package/dist/server-install/platforms/macosx-ngrok.d.ts +0 -6
- package/dist/server-install/platforms/macosx-ngrok.js +0 -371
- package/dist/server-install/platforms/macosx-ngrok.js.map +0 -1
- package/dist/server-install/platforms/ubuntu-vps.d.ts +0 -54
- package/dist/server-install/platforms/ubuntu-vps.js +0 -1066
- package/dist/server-install/platforms/ubuntu-vps.js.map +0 -1
- package/dist/server-install/state.d.ts +0 -50
- package/dist/server-install/state.js +0 -180
- package/dist/server-install/state.js.map +0 -1
- package/dist/server-install/steps.d.ts +0 -108
- package/dist/server-install/steps.js +0 -332
- package/dist/server-install/steps.js.map +0 -1
- package/dist/server-install/strategies.d.ts +0 -4
- package/dist/server-install/strategies.js +0 -20
- package/dist/server-install/strategies.js.map +0 -1
- package/dist/server-install/types.d.ts +0 -284
- package/dist/server-install/types.js +0 -118
- package/dist/server-install/types.js.map +0 -1
- package/dist/server-install/ui.d.ts +0 -36
- package/dist/server-install/ui.js +0 -130
- package/dist/server-install/ui.js.map +0 -1
- package/dist/session-context.d.ts +0 -64
- package/dist/session-context.js +0 -264
- package/dist/session-context.js.map +0 -1
- package/dist/skills-provision.d.ts +0 -62
- package/dist/skills-provision.js +0 -325
- package/dist/skills-provision.js.map +0 -1
- package/dist/skills-remote.d.ts +0 -129
- package/dist/skills-remote.js +0 -782
- package/dist/skills-remote.js.map +0 -1
- package/dist/skills.d.ts +0 -71
- package/dist/skills.js +0 -249
- package/dist/skills.js.map +0 -1
- package/dist/subcommands.d.ts +0 -11
- package/dist/subcommands.js +0 -24
- package/dist/subcommands.js.map +0 -1
- package/dist/task-cli/cli.d.ts +0 -38
- package/dist/task-cli/cli.js +0 -710
- package/dist/task-cli/cli.js.map +0 -1
- package/dist/task-cli/discovery.d.ts +0 -25
- package/dist/task-cli/discovery.js +0 -98
- package/dist/task-cli/discovery.js.map +0 -1
- package/dist/task-cli/hint.d.ts +0 -20
- package/dist/task-cli/hint.js +0 -14
- package/dist/task-cli/hint.js.map +0 -1
- package/dist/task-cli/http.d.ts +0 -49
- package/dist/task-cli/http.js +0 -109
- package/dist/task-cli/http.js.map +0 -1
- package/dist/task-cli/projections.d.ts +0 -68
- package/dist/task-cli/projections.js +0 -76
- package/dist/task-cli/projections.js.map +0 -1
- package/dist/task-cli/watch.d.ts +0 -119
- package/dist/task-cli/watch.js +0 -475
- package/dist/task-cli/watch.js.map +0 -1
- package/dist/ui-state.d.ts +0 -41
- package/dist/ui-state.js +0 -90
- package/dist/ui-state.js.map +0 -1
- package/dist/update-check.d.ts +0 -2
- package/dist/update-check.js +0 -26
- package/dist/update-check.js.map +0 -1
- package/dist/voice/decide.d.ts +0 -32
- package/dist/voice/decide.js +0 -297
- package/dist/voice/decide.js.map +0 -1
- package/dist/voice/decision-log.d.ts +0 -52
- package/dist/voice/decision-log.js +0 -107
- package/dist/voice/decision-log.js.map +0 -1
- package/dist/voice/engine.d.ts +0 -119
- package/dist/voice/engine.js +0 -60
- package/dist/voice/engine.js.map +0 -1
- package/dist/voice/fake-engine.d.ts +0 -10
- package/dist/voice/fake-engine.js +0 -192
- package/dist/voice/fake-engine.js.map +0 -1
- package/dist/voice/jev-engine.d.ts +0 -17
- package/dist/voice/jev-engine.js +0 -110
- package/dist/voice/jev-engine.js.map +0 -1
- package/dist/voice/pending-ask.d.ts +0 -17
- package/dist/voice/pending-ask.js +0 -50
- package/dist/voice/pending-ask.js.map +0 -1
- package/dist/voice/routes.d.ts +0 -115
- package/dist/voice/routes.js +0 -91
- package/dist/voice/routes.js.map +0 -1
- package/dist/voice/sentence.d.ts +0 -21
- package/dist/voice/sentence.js +0 -61
- package/dist/voice/sentence.js.map +0 -1
- package/dist/voice/thresholds.d.ts +0 -28
- package/dist/voice/thresholds.js +0 -29
- package/dist/voice/thresholds.js.map +0 -1
- package/dist/webhooks/cli.d.ts +0 -18
- package/dist/webhooks/cli.js +0 -145
- package/dist/webhooks/cli.js.map +0 -1
- package/dist/webhooks/prompt.d.ts +0 -5
- package/dist/webhooks/prompt.js +0 -26
- package/dist/webhooks/prompt.js.map +0 -1
- package/dist/workflows/active-run.d.ts +0 -167
- package/dist/workflows/active-run.js +0 -21
- package/dist/workflows/active-run.js.map +0 -1
- package/dist/workflows/attachment-path.d.ts +0 -6
- package/dist/workflows/attachment-path.js +0 -40
- package/dist/workflows/attachment-path.js.map +0 -1
- package/dist/workflows/continuation-admission.d.ts +0 -913
- package/dist/workflows/continuation-admission.js +0 -265
- package/dist/workflows/continuation-admission.js.map +0 -1
- package/dist/workflows/execution-account.d.ts +0 -13
- package/dist/workflows/execution-account.js +0 -18
- package/dist/workflows/execution-account.js.map +0 -1
- package/dist/workflows/grouped-command.d.ts +0 -31
- package/dist/workflows/grouped-command.js +0 -143
- package/dist/workflows/grouped-command.js.map +0 -1
- package/dist/workflows/input-acknowledgement.d.ts +0 -152
- package/dist/workflows/input-acknowledgement.js +0 -38
- package/dist/workflows/input-acknowledgement.js.map +0 -1
- package/dist/workflows/line-order.d.ts +0 -5
- package/dist/workflows/line-order.js +0 -25
- package/dist/workflows/line-order.js.map +0 -1
- package/dist/workflows/load.d.ts +0 -17
- package/dist/workflows/load.js +0 -61
- package/dist/workflows/load.js.map +0 -1
- package/dist/workflows/outcome-batches.d.ts +0 -20
- package/dist/workflows/outcome-batches.js +0 -25
- package/dist/workflows/outcome-batches.js.map +0 -1
- package/dist/workflows/question-routing.d.ts +0 -8
- package/dist/workflows/question-routing.js +0 -18
- package/dist/workflows/question-routing.js.map +0 -1
- package/dist/workflows/run-scheduling.d.ts +0 -35
- package/dist/workflows/run-scheduling.js +0 -61
- package/dist/workflows/run-scheduling.js.map +0 -1
- package/dist/workflows/run-states.d.ts +0 -190
- package/dist/workflows/run-states.js +0 -295
- package/dist/workflows/run-states.js.map +0 -1
- package/dist/workflows/run.d.ts +0 -2405
- package/dist/workflows/run.js +0 -10745
- package/dist/workflows/run.js.map +0 -1
- package/dist/workflows/turn-end.d.ts +0 -116
- package/dist/workflows/turn-end.js +0 -68
- package/dist/workflows/turn-end.js.map +0 -1
- package/dist/workflows/types.d.ts +0 -83
- package/dist/workflows/types.js +0 -192
- package/dist/workflows/types.js.map +0 -1
- package/dist/workflows/waits.d.ts +0 -74
- package/dist/workflows/waits.js +0 -197
- package/dist/workflows/waits.js.map +0 -1
- package/dist/workspace/agent-accounts.d.ts +0 -128
- package/dist/workspace/agent-accounts.js +0 -280
- package/dist/workspace/agent-accounts.js.map +0 -1
- package/dist/workspace/agent-profiles.d.ts +0 -124
- package/dist/workspace/agent-profiles.js +0 -190
- package/dist/workspace/agent-profiles.js.map +0 -1
- package/dist/workspace/config.d.ts +0 -181
- package/dist/workspace/config.js +0 -389
- package/dist/workspace/config.js.map +0 -1
- package/dist/workspace/migrations.d.ts +0 -35
- package/dist/workspace/migrations.js +0 -147
- package/dist/workspace/migrations.js.map +0 -1
- package/dist/workspace/projects-cli.d.ts +0 -25
- package/dist/workspace/projects-cli.js +0 -172
- package/dist/workspace/projects-cli.js.map +0 -1
- package/dist/workspace/projects.d.ts +0 -129
- package/dist/workspace/projects.js +0 -267
- package/dist/workspace/projects.js.map +0 -1
- package/dist/workspace/semaphore.d.ts +0 -145
- package/dist/workspace/semaphore.js +0 -196
- package/dist/workspace/semaphore.js.map +0 -1
- package/dist/workspace/ui-state.d.ts +0 -36
- package/dist/workspace/ui-state.js +0 -55
- package/dist/workspace/ui-state.js.map +0 -1
- package/dist/workspace/webhooks.d.ts +0 -40
- package/dist/workspace/webhooks.js +0 -146
- package/dist/workspace/webhooks.js.map +0 -1
- package/dist/worktree-manifest.d.ts +0 -165
- package/dist/worktree-manifest.js +0 -530
- package/dist/worktree-manifest.js.map +0 -1
- package/dist/worktree-setup.d.ts +0 -85
- package/dist/worktree-setup.js +0 -164
- package/dist/worktree-setup.js.map +0 -1
- package/scripts/benchmark-run-store-fixture.ts +0 -432
- package/scripts/benchmark-run-store.ts +0 -743
- package/scripts/benchmark-stuck-destroys.ts +0 -143
- package/scripts/check-pack.mjs +0 -48
- package/scripts/inline-contract.mjs +0 -165
- package/scripts/install-as-command.mjs +0 -122
- package/scripts/measure-transcript-facts-health.mjs +0 -87
- package/scripts/measure-transcript-facts-lag.mjs +0 -68
- package/scripts/mock-autonomous.mjs +0 -11
- package/scripts/mock-ci-tool.mjs +0 -111
- package/scripts/mock-claude-model-refusal.mjs +0 -42
- package/scripts/mock-claude.mjs +0 -1065
- package/scripts/mock-codex-app-server.mjs +0 -905
- package/scripts/mock-codex-coalesce-steer.mjs +0 -59
- package/scripts/mock-codex-reverse-steer.mjs +0 -130
- package/scripts/mock-cursor-acp.mjs +0 -423
- package/scripts/mock-cursor-hang-stdin-late.mjs +0 -35
- package/scripts/mock-cursor-hang-stdin.mjs +0 -30
- package/scripts/mock-cursor-print.mjs +0 -256
- package/scripts/mock-deferred-turn-start.mjs +0 -16
- package/scripts/mock-delivery-control.d.mts +0 -23
- package/scripts/mock-delivery-control.mjs +0 -80
- package/scripts/mock-env-record.mjs +0 -11
- package/scripts/mock-failure-control.d.mts +0 -13
- package/scripts/mock-failure-control.mjs +0 -68
- package/scripts/mock-multi-pr.mjs +0 -7
- package/scripts/mock-nudge.mjs +0 -45
- package/scripts/mock-omp-rpc.mjs +0 -779
- package/scripts/mock-opencode-serve.mjs +0 -1230
- package/scripts/mock-pi-rpc.mjs +0 -698
- package/scripts/mock-runner-crash.mjs +0 -58
- package/scripts/mock-session-context.d.mts +0 -5
- package/scripts/mock-session-context.mjs +0 -56
- package/scripts/mock-silent-tail.mjs +0 -85
- package/scripts/mock-turn-messages.mjs +0 -5
- package/scripts/omp-ci-wait.mjs +0 -29
- package/scripts/omp-restrict-delegation.yml +0 -4
- package/scripts/pi-ci-wait.mjs +0 -17
- package/scripts/pi-default-tools.mjs +0 -22
- package/scripts/pi-project-skills.mjs +0 -59
- package/scripts/pi-retry-degraded-service.mjs +0 -16
- package/scripts/probe-cursor-print.mjs +0 -627
- package/scripts/seed-archive-profile.ts +0 -53
- package/scripts/sync-readme.mjs +0 -20
- package/scripts/test-process-usage.mjs +0 -47
- package/scripts/transcript-facts-fixture.mjs +0 -53
- package/scripts/voice-replay.ts +0 -50
- package/scripts/windows-workspace-identity.cs +0 -208
- package/scripts/windows-workspace-identity.ps1 +0 -10
- package/web/dist/assets/alert-dialog-DfctKUMw.js +0 -1
- package/web/dist/assets/button-CeupvoKG.js +0 -41
- package/web/dist/assets/centered-state-hDsyXrnH.js +0 -1
- package/web/dist/assets/cez-idle-D3aj_9lp.js +0 -1
- package/web/dist/assets/diff-BnIXZK3i2.js +0 -3
- package/web/dist/assets/diff-controls-GewpW9aF.js +0 -1
- package/web/dist/assets/diff-view-Byo7gpvW.js +0 -11
- package/web/dist/assets/dropdown-menu-COj_J5wd.js +0 -6
- package/web/dist/assets/git-toolbar-DY0z0n4S.js +0 -1
- package/web/dist/assets/github-DwU6ALRK.js +0 -1
- package/web/dist/assets/index-BOfE8pyD.js +0 -34
- package/web/dist/assets/index-D9HpsmdW.css +0 -1
- package/web/dist/assets/lib-BQXq3kEf.js +0 -1
- package/web/dist/assets/live-protocol-Uce2NwEX.js +0 -64
- package/web/dist/assets/play-CmVAj_fu.js +0 -1
- package/web/dist/assets/popover-D56fhiXj.js +0 -1
- package/web/dist/assets/preview-pane-connected-BmVqfSU5.js +0 -3
- package/web/dist/assets/reference-chip-gQNk-4jc.js +0 -1
- package/web/dist/assets/repo-git-B5ECDUuv.js +0 -1
- package/web/dist/assets/run-header-C0Y1NvEM.js +0 -2
- package/web/dist/assets/skill-empty-hint-oOtzR3v0.js +0 -1
- package/web/dist/assets/skills-DUeTkZ9z.js +0 -1
- package/web/dist/assets/status-dot-1PR0i69P.js +0 -1
- package/web/dist/assets/tab-link-DmWk4l5O.js +0 -1
- package/web/dist/assets/task-changes-DKZXuW89.js +0 -1
- package/web/dist/assets/task-commits-BZ6KxWdF.js +0 -1
- package/web/dist/assets/task-files-DlF7Apcn.js +0 -2
- package/web/dist/assets/task-github-item-CVPo3geZ.js +0 -1
- package/web/dist/assets/task-thread-mm4-ECyo.js +0 -9
- package/web/dist/assets/thread-state-CIw2BlhT.js +0 -4
- package/web/dist/assets/use-hand-to-agent-state-BCDjzHnG.js +0 -1
- package/web/dist/assets/workflows-D8vYD-ql.js +0 -7
- package/web/dist/assets/zoomable-image-CxQSsfcn.js +0 -1
package/dist/core/pi-runner.js
DELETED
|
@@ -1,827 +0,0 @@
|
|
|
1
|
-
import { summarizeRunnerStderr } from './runner-stderr.js';
|
|
2
|
-
import { parseEffort } from '../contract/index.js';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { dirname, resolve as resolvePath } from 'node:path';
|
|
5
|
-
import { parseAskMarker } from './ask.js';
|
|
6
|
-
import { isSignalTerminationExit, unknownToolGrant } from './agent-runner.js';
|
|
7
|
-
import { signalSession, spawnSessionLeader, waitForEofExit } from './session-process.js';
|
|
8
|
-
import { buildChildEnv } from './agent-env.js';
|
|
9
|
-
import { cezarToolNames } from '../ci-wait/tools.js';
|
|
10
|
-
import { readNdjson } from './ndjson.js';
|
|
11
|
-
import { createPiUiState, mapPiRpcMessage, piFlushProviderError, piProviderErrorMessage, piTurnStarted } from './pi-ui-mapper.js';
|
|
12
|
-
import { V1TextCoalescer } from './v1-text-coalescer.js';
|
|
13
|
-
import { InputSubmissions } from './input-submissions.js';
|
|
14
|
-
import { boundOutputDrainAfterExit, AUTO_END_DELAY_MS, DEFAULT_RUN_TIMEOUT_MS, KILL_GRACE_MS } from './runner-runtime.js';
|
|
15
|
-
/**
|
|
16
|
-
* Persistent subprocess adapter for pi's documented RPC mode.
|
|
17
|
-
*
|
|
18
|
-
* Contract: https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/rpc.md
|
|
19
|
-
* Pi has its own command/event vocabulary; it is not Claude stream-json.
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* What the pi CLI receives from each `AgentRunSpec` field (#284). Tool names
|
|
23
|
-
* are mapped onto pi's own through `piTools`. An unset grant sends no tool
|
|
24
|
-
* flags; a grant's list takes one of three paths (hearsay-tools/cezarion#1305). A list holding every default
|
|
25
|
-
* built-in and nothing beyond pi's default set sends no allowlist:
|
|
26
|
-
* `--no-builtin-tools` plus the default-tools extension, which activates the
|
|
27
|
-
* listed built-ins, so MCP and extension tools stay callable. A narrowed list
|
|
28
|
-
* keeps the `--tools` allowlist; naming any other tool (an `mcp__` tool, for
|
|
29
|
-
* one) narrows it, so that grant stays limited to the named tools. A list that
|
|
30
|
-
* maps to nothing fails closed: `--tools` with
|
|
31
|
-
* only the cezar tools, or `--no-tools`. pi has no command-prefix equivalent
|
|
32
|
-
* for a `bashAllowlist`, so a list with one narrows to `--tools` and drops
|
|
33
|
-
* `bash` (fail closed) rather than widening. Held against the recorded
|
|
34
|
-
* argv and RPC prompt by the harness parity matrix.
|
|
35
|
-
*/
|
|
36
|
-
export const PI_SPEC_SUPPORT = {
|
|
37
|
-
cezarTools: { honored: true, via: 'explicit CI --extension and selected tool admission' },
|
|
38
|
-
systemPrompt: { honored: true, via: '--append-system-prompt' },
|
|
39
|
-
userPrompt: { honored: true, via: 'RPC prompt message' },
|
|
40
|
-
images: { honored: true, via: 'RPC prompt images' },
|
|
41
|
-
cwd: { honored: true, via: 'spawn cwd' },
|
|
42
|
-
toolGrant: { honored: true, via: 'mapped through piTools: the default list sends --no-builtin-tools and names its built-ins to the default-tools extension; a narrowed list, or one naming a tool outside the pi default set, sends --tools; a list that maps to nothing sends --tools with the cezar tools only, or --no-tools; a bashAllowlist has no prefix equivalent, so it narrows the list to --tools without bash (fail closed); unset sends no tool flags' },
|
|
43
|
-
restrictNativeDelegation: { honored: true, via: '--exclude-tools subagent (D1)' },
|
|
44
|
-
additionalDirectories: { honored: false, reason: 'pi has no extra-root flag' },
|
|
45
|
-
env: { honored: true, via: 'merged over the child env through buildChildEnv' },
|
|
46
|
-
model: { honored: true, via: '--model provider/model' },
|
|
47
|
-
effort: { honored: true, via: '--thinking, canonical level' },
|
|
48
|
-
timeoutMs: { honored: true, via: 'wall-clock kill switch on the child process' },
|
|
49
|
-
sessionId: { honored: true, via: '--session-id, or --session when resume is set' },
|
|
50
|
-
resume: { honored: true, via: '--session <sessionId> in place of --session-id' },
|
|
51
|
-
resumeFallbackSystemPrompt: { honored: false, reason: 'Continue already resends spec.systemPrompt on every process; a separate fallback prompt is unused' },
|
|
52
|
-
};
|
|
53
|
-
export class PiRunner {
|
|
54
|
-
backend = 'pi';
|
|
55
|
-
specSupport = PI_SPEC_SUPPORT;
|
|
56
|
-
systemPromptOnResume = 'resent';
|
|
57
|
-
inputDelivery = {
|
|
58
|
-
mode: 'steer', consumption: 'observable',
|
|
59
|
-
via: 'prompt with streamingBehavior steer; set_steering_mode all at session start; user message_start with the submitted text',
|
|
60
|
-
};
|
|
61
|
-
bin;
|
|
62
|
-
timeoutMs;
|
|
63
|
-
lastSession = null;
|
|
64
|
-
constructor(opts = {}) {
|
|
65
|
-
this.bin = opts.bin ?? process.env.CEZ_PI_BIN ?? (process.env.CEZ_DRY_RUN === '1' ? mockPiPath() : 'pi');
|
|
66
|
-
this.timeoutMs = opts.timeoutMs ?? DEFAULT_RUN_TIMEOUT_MS;
|
|
67
|
-
}
|
|
68
|
-
run(spec, onEvent) {
|
|
69
|
-
return this.startSession(spec, onEvent, { autoEndAfterFirstTurn: true }).result;
|
|
70
|
-
}
|
|
71
|
-
async interrupt() {
|
|
72
|
-
this.lastSession?.interrupt();
|
|
73
|
-
}
|
|
74
|
-
startSession(spec, onEvent, opts = {}) {
|
|
75
|
-
const child = spawnSessionLeader(this.bin, buildPiArgs(spec), {
|
|
76
|
-
cwd: spec.cwd,
|
|
77
|
-
env: buildChildEnv({ backend: this.backend, extraEnv: spec.env }),
|
|
78
|
-
});
|
|
79
|
-
boundOutputDrainAfterExit(child);
|
|
80
|
-
let open = true;
|
|
81
|
-
let timedOut = false;
|
|
82
|
-
let terminatedByCezar = false;
|
|
83
|
-
let explicitEnd = false;
|
|
84
|
-
let automaticCleanupStarted = false;
|
|
85
|
-
let autoEndTimer;
|
|
86
|
-
let killTimer;
|
|
87
|
-
let interruptKillTimer;
|
|
88
|
-
let piUi = createPiUiState();
|
|
89
|
-
const textChunks = [];
|
|
90
|
-
/** Streamed `text_delta` tokens buffered per content block — v1 `text` is
|
|
91
|
-
* one event per complete block (claude/codex/opencode parity), never per
|
|
92
|
-
* token. Token-by-token emission joined with newlines in `appendTurnText`
|
|
93
|
-
* split `CEZ:ASK` markers so `parseAskMarker` never matched (#902 / #2).
|
|
94
|
-
* Streaming display rides protocol v2's `item.delta`. */
|
|
95
|
-
const textCoalescer = new V1TextCoalescer((text) => {
|
|
96
|
-
textChunks.push(text);
|
|
97
|
-
onEvent?.({ type: 'text', text });
|
|
98
|
-
});
|
|
99
|
-
/** Pi's `contentIndex` restarts at 0 on every assistant message; the
|
|
100
|
-
* coalescer latches completed keys for the session. Map each open index
|
|
101
|
-
* to a once-per-block id so a later message's index-0 is not dropped. */
|
|
102
|
-
let textBlockSeq = 0;
|
|
103
|
-
const openTextBlockKeys = new Map();
|
|
104
|
-
const textBlockKey = (contentIndex) => {
|
|
105
|
-
if (typeof contentIndex !== 'number')
|
|
106
|
-
return undefined;
|
|
107
|
-
let key = openTextBlockKeys.get(contentIndex);
|
|
108
|
-
if (!key) {
|
|
109
|
-
key = `pi-text-${++textBlockSeq}`;
|
|
110
|
-
openTextBlockKeys.set(contentIndex, key);
|
|
111
|
-
}
|
|
112
|
-
return key;
|
|
113
|
-
};
|
|
114
|
-
/** flush() latches open keys as done — drop the index→key map too so a
|
|
115
|
-
* later contentIndex reuse allocates a fresh id instead of the dead one. */
|
|
116
|
-
const flushText = () => {
|
|
117
|
-
textCoalescer.flush();
|
|
118
|
-
openTextBlockKeys.clear();
|
|
119
|
-
};
|
|
120
|
-
const toolCalls = [];
|
|
121
|
-
let sessionId = spec.sessionId;
|
|
122
|
-
let tokensUsed = 0;
|
|
123
|
-
let latchedProviderError;
|
|
124
|
-
const emitLatchedProviderError = () => {
|
|
125
|
-
if (!latchedProviderError)
|
|
126
|
-
return;
|
|
127
|
-
onEvent?.({ type: 'error', message: latchedProviderError });
|
|
128
|
-
latchedProviderError = undefined;
|
|
129
|
-
};
|
|
130
|
-
let inputError;
|
|
131
|
-
let spawnError = null;
|
|
132
|
-
const stderr = [];
|
|
133
|
-
child.on('error', (error) => {
|
|
134
|
-
spawnError = wrapSpawnError(error, this.bin);
|
|
135
|
-
});
|
|
136
|
-
child.stderr.setEncoding('utf8');
|
|
137
|
-
child.stderr.on('data', (chunk) => stderr.push(chunk));
|
|
138
|
-
const emitUi = (value) => {
|
|
139
|
-
const mapped = mapPiRpcMessage(value, piUi);
|
|
140
|
-
piUi = mapped.state;
|
|
141
|
-
for (const event of mapped.events) {
|
|
142
|
-
opts.onUiEvent?.(event);
|
|
143
|
-
if (event.type === 'turn.started')
|
|
144
|
-
releaseHeldIntoTurn();
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
/** The mapper latches a provider failure until the turn settles; when the RPC
|
|
148
|
-
* stream ends without `agent_settled` this releases it the way v1 does. */
|
|
149
|
-
const emitLatchedUiProviderError = () => {
|
|
150
|
-
const mapped = piFlushProviderError(piUi);
|
|
151
|
-
piUi = mapped.state;
|
|
152
|
-
for (const event of mapped.events)
|
|
153
|
-
opts.onUiEvent?.(event);
|
|
154
|
-
};
|
|
155
|
-
const write = (command) => {
|
|
156
|
-
if (!open || !child.stdin.writable)
|
|
157
|
-
return false;
|
|
158
|
-
try {
|
|
159
|
-
child.stdin.write(`${JSON.stringify(command)}\n`);
|
|
160
|
-
return true;
|
|
161
|
-
}
|
|
162
|
-
catch (error) {
|
|
163
|
-
failInput(error instanceof Error ? error : new Error(String(error)));
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
let agentInputReady = false;
|
|
168
|
-
let promptSerial = 0;
|
|
169
|
-
let humanPromptAcks = 0;
|
|
170
|
-
// Each human prompt stays held from its write until a normalized turn has it, because an
|
|
171
|
-
// ack is not a turn boundary (hearsay-tools/cezarion#1112). Exits: its user message_start
|
|
172
|
-
// (the running turn read it), its ack while the turn it opened is still open, the first
|
|
173
|
-
// turn.started after its ack, a rejected ack, or discardQueuedMessages. A raw agent_start
|
|
174
|
-
// is not an exit: pi's mapper reports nothing for it, so a run released there could park
|
|
175
|
-
// before the turn that reads the prompt is reported. A steer acked after the turn's last
|
|
176
|
-
// model call is read as pi's next prompt, after agent_settled, so the ack alone never
|
|
177
|
-
// releases it.
|
|
178
|
-
const humanHeld = [];
|
|
179
|
-
/** A turn.started was just emitted: it reads every human prompt pi acknowledged before it. */
|
|
180
|
-
function releaseHeldIntoTurn() {
|
|
181
|
-
for (let at = humanHeld.length - 1; at >= 0; at--)
|
|
182
|
-
if (humanHeld[at].acked)
|
|
183
|
-
humanHeld.splice(at, 1);
|
|
184
|
-
}
|
|
185
|
-
let agentAck;
|
|
186
|
-
const rejectAgentAck = (error = new Error('pi closed before prompt acknowledgement')) => {
|
|
187
|
-
const pending = agentAck;
|
|
188
|
-
agentAck = undefined;
|
|
189
|
-
pending?.reject(error);
|
|
190
|
-
};
|
|
191
|
-
const failInput = (error) => {
|
|
192
|
-
// Late errors from caller close/abort/deadline teardown are not new failures.
|
|
193
|
-
if (!open || terminatedByCezar || inputError)
|
|
194
|
-
return;
|
|
195
|
-
inputError = new Error(`pi input stream failed: ${error.message}`);
|
|
196
|
-
open = false;
|
|
197
|
-
rejectAgentAck(inputError);
|
|
198
|
-
onEvent?.({ type: 'error', message: inputError.message });
|
|
199
|
-
opts.onUiEvent?.({ type: 'session.error', message: inputError.message, fatal: true });
|
|
200
|
-
// The output-loop catch owns the existing bounded process cleanup. The latch
|
|
201
|
-
// also prevents false success if the child exits zero before it observes this.
|
|
202
|
-
child.stdout.destroy(inputError);
|
|
203
|
-
};
|
|
204
|
-
child.stdin.on('error', failInput);
|
|
205
|
-
const scheduleAutoEnd = () => {
|
|
206
|
-
if (!opts.autoEndAfterFirstTurn || !open || autoEndTimer || agentAck || humanPromptAcks)
|
|
207
|
-
return;
|
|
208
|
-
autoEndTimer = setTimeout(() => {
|
|
209
|
-
autoEndTimer = undefined;
|
|
210
|
-
if (opts.shouldAutoEnd?.() !== false)
|
|
211
|
-
end();
|
|
212
|
-
}, AUTO_END_DELAY_MS);
|
|
213
|
-
autoEndTimer.unref?.();
|
|
214
|
-
};
|
|
215
|
-
// Agent input refused only because a prompt acknowledgement was outstanding gets
|
|
216
|
-
// one readiness hint when it lands, even mid-turn: the turn can be steered (#505).
|
|
217
|
-
let refusedForAck = false;
|
|
218
|
-
const readyAfterAck = () => {
|
|
219
|
-
if (open && agentInputReady && !piUi.turnId && !agentAck && !humanPromptAcks) {
|
|
220
|
-
refusedForAck = false;
|
|
221
|
-
opts.onAgentInputReady?.();
|
|
222
|
-
scheduleAutoEnd();
|
|
223
|
-
}
|
|
224
|
-
else if (refusedForAck && open && !agentAck && !humanPromptAcks && !pendingMarkerAsk) {
|
|
225
|
-
refusedForAck = false;
|
|
226
|
-
opts.onAgentInputReady?.();
|
|
227
|
-
}
|
|
228
|
-
else if (open && !piUi.turnId && !agentAck && !humanPromptAcks && !pendingMarkerAsk) {
|
|
229
|
-
// #486: a human ack drained with no turn open — re-settle the idle boundary.
|
|
230
|
-
refusedForAck = false;
|
|
231
|
-
opts.onAgentInputReady?.();
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
let pendingMarkerAsk = false;
|
|
235
|
-
let turnTextStart = 0;
|
|
236
|
-
// Accepted agent prompts not yet seen as a user message_start (#505).
|
|
237
|
-
const submissions = new InputSubmissions();
|
|
238
|
-
// Submissions already queued when a turn began: that turn reads them. Pi never
|
|
239
|
-
// drops an acknowledged steer — one sent as a turn settles runs as the next
|
|
240
|
-
// prompt — so pi reports no unconsumed input (#505).
|
|
241
|
-
let carried = new Set();
|
|
242
|
-
const acked = new Set();
|
|
243
|
-
let turnFailed = false;
|
|
244
|
-
const sendMessage = (content, requestId, inputIds = []) => {
|
|
245
|
-
if (!open)
|
|
246
|
-
return false;
|
|
247
|
-
// A steer joins the running turn; only an idle prompt opens one (#505).
|
|
248
|
-
const opensTurn = !piUi.turnId;
|
|
249
|
-
agentInputReady = false;
|
|
250
|
-
if (opensTurn) {
|
|
251
|
-
pendingMarkerAsk = false;
|
|
252
|
-
turnTextStart = textChunks.length;
|
|
253
|
-
}
|
|
254
|
-
const { message, images } = toPiPrompt(content);
|
|
255
|
-
if (autoEndTimer) {
|
|
256
|
-
clearTimeout(autoEndTimer);
|
|
257
|
-
autoEndTimer = undefined;
|
|
258
|
-
}
|
|
259
|
-
if (!write({
|
|
260
|
-
type: 'prompt',
|
|
261
|
-
...(requestId ? { id: requestId } : {}),
|
|
262
|
-
message,
|
|
263
|
-
...(images.length > 0 ? { images } : {}),
|
|
264
|
-
...(piUi.turnId ? { streamingBehavior: 'steer' } : {}),
|
|
265
|
-
})) {
|
|
266
|
-
return false;
|
|
267
|
-
}
|
|
268
|
-
if (requestId)
|
|
269
|
-
submissions.accept(requestId, inputIds, message);
|
|
270
|
-
if (!piUi.turnId) {
|
|
271
|
-
const mapped = piTurnStarted(piUi);
|
|
272
|
-
piUi = mapped.state;
|
|
273
|
-
for (const event of mapped.events)
|
|
274
|
-
opts.onUiEvent?.(event);
|
|
275
|
-
}
|
|
276
|
-
// An idle prompt names the turn it opened: its ack releases it while that turn is open.
|
|
277
|
-
if (!requestId) {
|
|
278
|
-
humanPromptAcks += 1;
|
|
279
|
-
humanHeld.push({ text: message, acked: false, ...(opensTurn ? { turnId: piUi.turnId ?? undefined } : {}) });
|
|
280
|
-
}
|
|
281
|
-
return true;
|
|
282
|
-
};
|
|
283
|
-
const end = () => {
|
|
284
|
-
if (child.exitCode === null && child.signalCode === null) {
|
|
285
|
-
explicitEnd = true;
|
|
286
|
-
terminatedByCezar ||= automaticCleanupStarted;
|
|
287
|
-
}
|
|
288
|
-
if (!open)
|
|
289
|
-
return;
|
|
290
|
-
open = false;
|
|
291
|
-
rejectAgentAck();
|
|
292
|
-
child.stdin.end();
|
|
293
|
-
killTimer = setTimeout(() => {
|
|
294
|
-
if (child.exitCode !== null || child.signalCode !== null)
|
|
295
|
-
return;
|
|
296
|
-
terminatedByCezar = true;
|
|
297
|
-
signalSession(child, 'SIGTERM');
|
|
298
|
-
// Closing input makes interrupt() a no-op; this watchdog must own
|
|
299
|
-
// escalation even when Pi ignores both EOF and SIGTERM.
|
|
300
|
-
killTimer = setTimeout(() => {
|
|
301
|
-
if (child.exitCode === null && child.signalCode === null)
|
|
302
|
-
signalSession(child, 'SIGKILL');
|
|
303
|
-
}, KILL_GRACE_MS);
|
|
304
|
-
killTimer.unref?.();
|
|
305
|
-
}, KILL_GRACE_MS);
|
|
306
|
-
killTimer.unref?.();
|
|
307
|
-
};
|
|
308
|
-
const interrupt = () => {
|
|
309
|
-
if (child.exitCode === null && child.signalCode === null)
|
|
310
|
-
terminatedByCezar = true;
|
|
311
|
-
if (!open)
|
|
312
|
-
return;
|
|
313
|
-
// Mark intent before the abort write: even a synchronous write failure is teardown.
|
|
314
|
-
terminatedByCezar = true;
|
|
315
|
-
write({ type: 'abort' });
|
|
316
|
-
open = false;
|
|
317
|
-
rejectAgentAck();
|
|
318
|
-
signalSession(child, 'SIGTERM');
|
|
319
|
-
interruptKillTimer = setTimeout(() => {
|
|
320
|
-
if (child.exitCode === null && child.signalCode === null)
|
|
321
|
-
signalSession(child, 'SIGKILL');
|
|
322
|
-
}, KILL_GRACE_MS);
|
|
323
|
-
interruptKillTimer.unref?.();
|
|
324
|
-
};
|
|
325
|
-
write({ id: 'cezar-state', type: 'get_state' });
|
|
326
|
-
// #551: Pi defaults steeringMode to one-at-a-time (one steer per completed
|
|
327
|
-
// assistant turn). This session is cezar's, and sendAgentMessage requires every
|
|
328
|
-
// accepted steer at the next model call. get_state cannot tell that default
|
|
329
|
-
// from an explicit user setting, so we always set all rather than guess.
|
|
330
|
-
write({ type: 'set_steering_mode', mode: 'all' });
|
|
331
|
-
sendMessage([
|
|
332
|
-
...(spec.images ?? []),
|
|
333
|
-
{
|
|
334
|
-
type: 'text',
|
|
335
|
-
text: spec.userPrompt,
|
|
336
|
-
},
|
|
337
|
-
]);
|
|
338
|
-
const limitMs = spec.timeoutMs ?? this.timeoutMs;
|
|
339
|
-
const deadline = limitMs > 0
|
|
340
|
-
? setTimeout(() => {
|
|
341
|
-
timedOut = true;
|
|
342
|
-
interrupt();
|
|
343
|
-
}, limitMs)
|
|
344
|
-
: undefined;
|
|
345
|
-
deadline?.unref?.();
|
|
346
|
-
const terminateAfterOutput = () => {
|
|
347
|
-
signalSession(child, 'SIGTERM');
|
|
348
|
-
const reap = setTimeout(() => {
|
|
349
|
-
if (child.exitCode === null && child.signalCode === null)
|
|
350
|
-
signalSession(child, 'SIGKILL');
|
|
351
|
-
}, KILL_GRACE_MS);
|
|
352
|
-
reap.unref?.();
|
|
353
|
-
return reap;
|
|
354
|
-
};
|
|
355
|
-
// EOF retains the existing grace and escalation order. Only attribution depends on evidence.
|
|
356
|
-
const cleanupAfterEof = async () => {
|
|
357
|
-
if (child.exitCode === null && child.signalCode === null) {
|
|
358
|
-
const state = await waitForEofExit(child);
|
|
359
|
-
if (state !== 'exited') {
|
|
360
|
-
automaticCleanupStarted = true;
|
|
361
|
-
terminatedByCezar ||= explicitEnd || state === 'live';
|
|
362
|
-
terminateAfterOutput();
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
const result = (async () => {
|
|
367
|
-
try {
|
|
368
|
-
for await (const line of readNdjson(child.stdout)) {
|
|
369
|
-
let value;
|
|
370
|
-
try {
|
|
371
|
-
value = JSON.parse(line);
|
|
372
|
-
}
|
|
373
|
-
catch {
|
|
374
|
-
onEvent?.({ type: 'note', message: `pi: skipped unparseable RPC line: ${truncate(line)}` });
|
|
375
|
-
continue;
|
|
376
|
-
}
|
|
377
|
-
if (isRecord(value) &&
|
|
378
|
-
value.type === 'message_end' &&
|
|
379
|
-
isRecord(value.message) &&
|
|
380
|
-
typeof value.message.errorMessage === 'string') {
|
|
381
|
-
value.message.errorMessage = restorePiDegradedServiceError(value.message.errorMessage);
|
|
382
|
-
}
|
|
383
|
-
opts.onActivity?.();
|
|
384
|
-
// Flush before real message/tool/turn boundaries so v2 UI events
|
|
385
|
-
// never overtake a pending block. Do NOT flush on prompt/response
|
|
386
|
-
// acks — mid-turn `steer` can land between text_deltas and would
|
|
387
|
-
// split one block into partial + full (and clear the live key).
|
|
388
|
-
if (isRecord(value) &&
|
|
389
|
-
(value.type === 'tool_execution_start' ||
|
|
390
|
-
value.type === 'message_end' ||
|
|
391
|
-
value.type === 'agent_settled' ||
|
|
392
|
-
value.type === 'turn_end' ||
|
|
393
|
-
value.type === 'agent_end')) {
|
|
394
|
-
flushText();
|
|
395
|
-
}
|
|
396
|
-
emitUi(value);
|
|
397
|
-
if (!isRecord(value))
|
|
398
|
-
continue;
|
|
399
|
-
if (value.type === 'response' && value.command === 'get_state' && value.success === true && isRecord(value.data)) {
|
|
400
|
-
const discovered = string(value.data.sessionId);
|
|
401
|
-
if (discovered && discovered !== sessionId) {
|
|
402
|
-
sessionId = discovered;
|
|
403
|
-
onEvent?.({ type: 'session', sessionId: discovered });
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
else if (value.type === 'response' && value.command === 'set_steering_mode') {
|
|
407
|
-
if (value.success !== true) {
|
|
408
|
-
onEvent?.({ type: 'note', message: `pi: set_steering_mode failed: ${rpcError(value)}` });
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
else if (value.type === 'response' && value.command === 'prompt') {
|
|
412
|
-
const pending = agentAck;
|
|
413
|
-
if (pending && value.id === pending.id) {
|
|
414
|
-
agentAck = undefined;
|
|
415
|
-
if (value.success === true) {
|
|
416
|
-
acked.add(pending.id);
|
|
417
|
-
pending.resolve();
|
|
418
|
-
}
|
|
419
|
-
else {
|
|
420
|
-
const message = rpcError(value);
|
|
421
|
-
if (open)
|
|
422
|
-
onEvent?.({ type: 'error', message });
|
|
423
|
-
pending.reject(new Error(message));
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
else if (value.id === undefined) {
|
|
427
|
-
// Human prompts carry no id, so acks answer them in write order. A second ack for
|
|
428
|
-
// a prompt pi already answered (a late steer re-run) finds no ack outstanding.
|
|
429
|
-
const held = humanPromptAcks > 0 ? humanHeld.find(entry => !entry.acked) : undefined;
|
|
430
|
-
humanPromptAcks = Math.max(0, humanPromptAcks - 1);
|
|
431
|
-
if (held && value.success === true && (!held.turnId || held.turnId !== piUi.turnId))
|
|
432
|
-
held.acked = true;
|
|
433
|
-
else if (held)
|
|
434
|
-
humanHeld.splice(humanHeld.indexOf(held), 1);
|
|
435
|
-
if (value.success === false)
|
|
436
|
-
onEvent?.({ type: 'error', message: rpcError(value) });
|
|
437
|
-
}
|
|
438
|
-
readyAfterAck();
|
|
439
|
-
}
|
|
440
|
-
else if (value.type === 'response' && value.success === false) {
|
|
441
|
-
onEvent?.({ type: 'error', message: rpcError(value) });
|
|
442
|
-
}
|
|
443
|
-
else if (value.type === 'message_update' && isRecord(value.assistantMessageEvent)) {
|
|
444
|
-
const update = value.assistantMessageEvent;
|
|
445
|
-
const contentKey = textBlockKey(update.contentIndex);
|
|
446
|
-
if (update.type === 'text_delta' && typeof update.delta === 'string') {
|
|
447
|
-
textCoalescer.append(contentKey, update.delta);
|
|
448
|
-
}
|
|
449
|
-
else if (update.type === 'text_end') {
|
|
450
|
-
const snapshot = typeof update.content === 'string' ? update.content : undefined;
|
|
451
|
-
textCoalescer.complete(contentKey, snapshot);
|
|
452
|
-
if (typeof update.contentIndex === 'number')
|
|
453
|
-
openTextBlockKeys.delete(update.contentIndex);
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
else if (value.type === 'message_end' && isRecord(value.message) && value.message.role === 'assistant') {
|
|
457
|
-
flushText();
|
|
458
|
-
const usage = usageValues(value.message.usage);
|
|
459
|
-
if (usage) {
|
|
460
|
-
tokensUsed += usage.weighted;
|
|
461
|
-
onEvent?.({ type: 'token-usage', tokensUsed });
|
|
462
|
-
if (usage.cost !== undefined)
|
|
463
|
-
onEvent?.({ type: 'cost', usd: usage.cost });
|
|
464
|
-
}
|
|
465
|
-
if (string(value.message.stopReason) === 'error') {
|
|
466
|
-
turnFailed = true;
|
|
467
|
-
latchedProviderError = piProviderErrorMessage(value.message);
|
|
468
|
-
}
|
|
469
|
-
else {
|
|
470
|
-
latchedProviderError = undefined;
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
else if (value.type === 'agent_start') {
|
|
474
|
-
// Pi handles commands in stream order: only a prompt it acknowledged before this
|
|
475
|
-
// agent_start can be in the turn it starts (#505 CI race).
|
|
476
|
-
carried = new Set(submissions.pendingIds().filter(id => acked.has(id)));
|
|
477
|
-
turnFailed = false;
|
|
478
|
-
}
|
|
479
|
-
else if (value.type === 'message_start' && isRecord(value.message) && value.message.role === 'user') {
|
|
480
|
-
// The model received this prompt now (#505).
|
|
481
|
-
const text = piMessageText(value.message);
|
|
482
|
-
const ids = submissions.consumeOldestByText(text);
|
|
483
|
-
if (ids.length)
|
|
484
|
-
opts.onAgentInputConsumed?.(ids);
|
|
485
|
-
else {
|
|
486
|
-
// Read with no normalized turn open (a late steer's own run): the run is not
|
|
487
|
-
// reported yet, so it stays held until that turn.started.
|
|
488
|
-
const human = humanHeld.findIndex(entry => entry.text === text);
|
|
489
|
-
if (human >= 0 && piUi.turnId)
|
|
490
|
-
humanHeld.splice(human, 1);
|
|
491
|
-
else if (human >= 0)
|
|
492
|
-
humanHeld[human].acked = true;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
else if (value.type === 'tool_execution_start') {
|
|
496
|
-
flushText();
|
|
497
|
-
const id = string(value.toolCallId);
|
|
498
|
-
const name = string(value.toolName);
|
|
499
|
-
if (id && name) {
|
|
500
|
-
toolCalls.push({ id, name, input: value.args });
|
|
501
|
-
onEvent?.({ type: 'tool-call', id, tool: name, input: value.args });
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
else if (value.type === 'tool_execution_end') {
|
|
505
|
-
const id = string(value.toolCallId);
|
|
506
|
-
if (id) {
|
|
507
|
-
onEvent?.({
|
|
508
|
-
type: 'tool-result',
|
|
509
|
-
toolCallId: id,
|
|
510
|
-
result: contentText(isRecord(value.result) ? value.result.content : undefined) ?? '',
|
|
511
|
-
isError: value.isError === true,
|
|
512
|
-
});
|
|
513
|
-
emitImages(isRecord(value.result) ? value.result.content : undefined, onEvent);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
else if (value.type === 'agent_settled') {
|
|
517
|
-
flushText();
|
|
518
|
-
emitLatchedProviderError();
|
|
519
|
-
pendingMarkerAsk = parseAskMarker(textChunks.slice(turnTextStart).join('\n')) !== null;
|
|
520
|
-
agentInputReady = true;
|
|
521
|
-
// Input queued before this turn began was processed by it, even when pi
|
|
522
|
-
// emitted no user message_start for it (#505) — unless a provider error ended
|
|
523
|
-
// the turn, which may never have reached the model.
|
|
524
|
-
const read = turnFailed ? [] : [...carried].flatMap(id => submissions.consume(id));
|
|
525
|
-
turnFailed = false;
|
|
526
|
-
carried = new Set();
|
|
527
|
-
if (read.length)
|
|
528
|
-
opts.onAgentInputConsumed?.(read);
|
|
529
|
-
onEvent?.({ type: 'turn-end' });
|
|
530
|
-
scheduleAutoEnd();
|
|
531
|
-
}
|
|
532
|
-
else if (value.type === 'extension_error') {
|
|
533
|
-
onEvent?.({ type: 'note', message: string(value.error) ?? 'pi extension error' });
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
catch (error) {
|
|
538
|
-
if (child.exitCode === null && child.signalCode === null) {
|
|
539
|
-
// Revoke input immediately, but keep result pending until the agent
|
|
540
|
-
// has actually exited so its capacity cannot be released early.
|
|
541
|
-
open = false;
|
|
542
|
-
rejectAgentAck();
|
|
543
|
-
terminatedByCezar = true;
|
|
544
|
-
const reap = terminateAfterOutput();
|
|
545
|
-
await waitForExit(child);
|
|
546
|
-
clearTimeout(reap);
|
|
547
|
-
throw error;
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
finally {
|
|
551
|
-
if (deadline)
|
|
552
|
-
clearTimeout(deadline);
|
|
553
|
-
if (autoEndTimer)
|
|
554
|
-
clearTimeout(autoEndTimer);
|
|
555
|
-
open = false;
|
|
556
|
-
rejectAgentAck();
|
|
557
|
-
}
|
|
558
|
-
await cleanupAfterEof();
|
|
559
|
-
flushText();
|
|
560
|
-
emitLatchedProviderError();
|
|
561
|
-
emitLatchedUiProviderError();
|
|
562
|
-
const exitCode = await waitForExit(child);
|
|
563
|
-
if (killTimer)
|
|
564
|
-
clearTimeout(killTimer);
|
|
565
|
-
if (interruptKillTimer)
|
|
566
|
-
clearTimeout(interruptKillTimer);
|
|
567
|
-
if (spawnError)
|
|
568
|
-
throw spawnError;
|
|
569
|
-
if (inputError)
|
|
570
|
-
throw inputError;
|
|
571
|
-
if (timedOut) {
|
|
572
|
-
const message = `pi CLI timed out after ${Math.round((limitMs / 60_000) * 10) / 10}m and was killed`;
|
|
573
|
-
onEvent?.({ type: 'error', message });
|
|
574
|
-
onEvent?.({ type: 'done' });
|
|
575
|
-
return { text: textChunks.join('\n').trim(), toolCalls, tokensUsed, sessionId };
|
|
576
|
-
}
|
|
577
|
-
// A signal we sent is teardown, not a second agent failure (#73).
|
|
578
|
-
if (terminatedByCezar && (isSignalTerminationExit(exitCode) || (exitCode === null && child.signalCode !== null))) {
|
|
579
|
-
onEvent?.({
|
|
580
|
-
type: 'note',
|
|
581
|
-
message: `pi CLI did not exit on its own after close; terminated by cezar (${exitCode === null ? child.signalCode : `code ${exitCode}`})`,
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
else if (exitCode === null && child.signalCode !== null) {
|
|
585
|
-
const message = `pi CLI was killed by signal ${child.signalCode}`;
|
|
586
|
-
onEvent?.({ type: 'error', message });
|
|
587
|
-
throw new Error(message);
|
|
588
|
-
}
|
|
589
|
-
else if (exitCode !== 0 && exitCode !== null) {
|
|
590
|
-
const diagnostic = stderr.join('');
|
|
591
|
-
if (diagnostic.trim())
|
|
592
|
-
onEvent?.({ type: 'note', message: `pi CLI stderr:\n${diagnostic}` });
|
|
593
|
-
const detail = summarizeRunnerStderr(diagnostic);
|
|
594
|
-
const message = `pi CLI exited with code ${exitCode}${detail ? ` — ${detail}` : ''}`;
|
|
595
|
-
onEvent?.({ type: 'error', message });
|
|
596
|
-
throw new Error(message);
|
|
597
|
-
}
|
|
598
|
-
if (piUi.turnId)
|
|
599
|
-
onEvent?.({ type: 'note', message: 'pi RPC session ended before agent_settled' });
|
|
600
|
-
if (tokensUsed === 0)
|
|
601
|
-
onEvent?.({ type: 'note', message: 'token usage not reported by pi CLI' });
|
|
602
|
-
opts.onUiEvent?.({ type: 'session.ended', reason: piUi.stopReason });
|
|
603
|
-
onEvent?.({ type: 'done' });
|
|
604
|
-
return { text: textChunks.join('\n').trim(), toolCalls, tokensUsed, sessionId };
|
|
605
|
-
})();
|
|
606
|
-
const session = {
|
|
607
|
-
result,
|
|
608
|
-
sendMessage,
|
|
609
|
-
sendAgentMessage: (content, inputIds = [], options) => {
|
|
610
|
-
// #505: a running turn is steered; only a pending CEZ:ASK (unless the caller delivers
|
|
611
|
-
// beside it) or an unacknowledged prompt refuses.
|
|
612
|
-
const askRefuses = pendingMarkerAsk && !options?.besideQuestion;
|
|
613
|
-
if (open && !askRefuses && (agentAck || humanPromptAcks)) {
|
|
614
|
-
refusedForAck = true;
|
|
615
|
-
return false;
|
|
616
|
-
}
|
|
617
|
-
if (!open || askRefuses)
|
|
618
|
-
return false;
|
|
619
|
-
const id = `cezar-agent-${++promptSerial}`;
|
|
620
|
-
let resolve, reject;
|
|
621
|
-
const acknowledged = new Promise((yes, no) => { resolve = yes; reject = no; });
|
|
622
|
-
agentAck = { id, resolve, reject };
|
|
623
|
-
if (!sendMessage(content, id, inputIds)) {
|
|
624
|
-
agentAck = undefined;
|
|
625
|
-
// A synchronous transport failure already rejected this receipt.
|
|
626
|
-
return inputError ? acknowledged : false;
|
|
627
|
-
}
|
|
628
|
-
return acknowledged;
|
|
629
|
-
},
|
|
630
|
-
// A written prompt cannot be unwritten; only stop reporting an acknowledged one as held.
|
|
631
|
-
discardQueuedMessages: () => { humanHeld.length = 0; },
|
|
632
|
-
holdsHumanInput: () => humanHeld.length > 0,
|
|
633
|
-
heldHumanInputCount: () => humanHeld.length,
|
|
634
|
-
end,
|
|
635
|
-
interrupt,
|
|
636
|
-
pid: child.pid,
|
|
637
|
-
get open() {
|
|
638
|
-
return open;
|
|
639
|
-
},
|
|
640
|
-
};
|
|
641
|
-
this.lastSession = session;
|
|
642
|
-
return session;
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
export function buildPiArgs(spec) {
|
|
646
|
-
// pi loads a repo's .pi/skills and .agents/skills only for a trusted folder; the project-skills
|
|
647
|
-
// extension offers them to an untrusted one without trusting it (hearsay-tools/cezarion#1295).
|
|
648
|
-
const args = ['--mode', 'rpc', '--extension', piDegradedServiceRetryExtensionPath(), '--extension', piProjectSkillsExtensionPath()];
|
|
649
|
-
if (spec.cezarTools)
|
|
650
|
-
args.push('--extension', fileURLToPath(new URL('../../scripts/pi-ci-wait.mjs', import.meta.url)));
|
|
651
|
-
if (spec.sessionId)
|
|
652
|
-
args.push(spec.resume ? '--session' : '--session-id', spec.sessionId);
|
|
653
|
-
if (spec.systemPrompt)
|
|
654
|
-
args.push('--append-system-prompt', spec.systemPrompt);
|
|
655
|
-
if (spec.model)
|
|
656
|
-
args.push('--model', spec.model);
|
|
657
|
-
const effort = parseEffort(spec.effort);
|
|
658
|
-
if (effort)
|
|
659
|
-
args.push('--thinking', effort);
|
|
660
|
-
// Pi 0.85.1 --exclude-tools covers the shipped subagent extension. Arbitrary
|
|
661
|
-
// custom delegation tool names have no discoverable capability (D1 exemption).
|
|
662
|
-
if (spec.restrictNativeDelegation)
|
|
663
|
-
args.push('--exclude-tools', 'subagent');
|
|
664
|
-
args.push(...piGrantArgs(spec, spec.toolGrant));
|
|
665
|
-
return args;
|
|
666
|
-
}
|
|
667
|
-
/** pi's tool flags for each grant kind. No list keeps pi's own tool set, MCP and extension tools included. */
|
|
668
|
-
function piGrantArgs(spec, grant) {
|
|
669
|
-
switch (grant.kind) {
|
|
670
|
-
case 'unset': return [];
|
|
671
|
-
case 'step-default':
|
|
672
|
-
case 'inherited': return piToolArgs(spec, grant.tools, grant.bashAllowlist);
|
|
673
|
-
// A written copy of the default list takes the default path too, so no list keeps MCP and
|
|
674
|
-
// extension tools out of a step that names only the default built-ins (hearsay-tools/cezarion#1417).
|
|
675
|
-
case 'explicit': return piToolArgs(spec, grant.tools, grant.bashAllowlist);
|
|
676
|
-
default: return unknownToolGrant(grant);
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
// The built-ins cezar's default list maps onto (DEFAULT_ALLOWED_TOOLS through piTools), and the
|
|
680
|
-
// names a default list may hold besides them (HARNESS_EXTRA_TOOLS.pi).
|
|
681
|
-
const PI_DEFAULT_BUILTINS = ['read', 'edit', 'write', 'grep', 'find', 'bash'];
|
|
682
|
-
const PI_DEFAULT_EXTRAS = ['subagent', 'subagent_supervisor', 'subagent_wait'];
|
|
683
|
-
/**
|
|
684
|
-
* pi reads --tools as an allowlist that hides every tool it does not name, MCP and extension tools
|
|
685
|
-
* included (hearsay-tools/cezarion#1305). So the default list sends no allowlist: --no-builtin-tools
|
|
686
|
-
* keeps every tool registered and the default-tools extension activates the listed built-ins. The
|
|
687
|
-
* default list holds every base built-in and nothing beyond pi's default set, so it covers both
|
|
688
|
-
* pi's own step default and the six tools a worker inherits from a Claude parent. Any other name
|
|
689
|
-
* (an mcp__ tool, WebFetch, a custom tool) or a bashAllowlist narrows the list to the allowlist, so
|
|
690
|
-
* a step that grants named tools gets only those, and a list that maps to nothing fails closed.
|
|
691
|
-
*/
|
|
692
|
-
function piToolArgs(spec, allowedTools, bashAllowlist) {
|
|
693
|
-
const narrowedBash = (bashAllowlist?.length ?? 0) > 0;
|
|
694
|
-
const tools = piTools(allowedTools, bashAllowlist);
|
|
695
|
-
const isDefault = PI_DEFAULT_BUILTINS.every((tool) => tools.includes(tool))
|
|
696
|
-
&& tools.every((tool) => PI_DEFAULT_BUILTINS.includes(tool) || PI_DEFAULT_EXTRAS.includes(tool));
|
|
697
|
-
if (!narrowedBash && isDefault) {
|
|
698
|
-
// The cezar tools need no name: pi activates an extension's tools on registration.
|
|
699
|
-
return ['--no-builtin-tools', '--extension', piDefaultToolsExtensionPath(), '--cezar-builtin-tools', tools.join(',')];
|
|
700
|
-
}
|
|
701
|
-
if (spec.cezarTools)
|
|
702
|
-
tools.push(...cezarToolNames(spec.env ?? {}));
|
|
703
|
-
return tools.length > 0 ? ['--tools', tools.join(',')] : ['--no-tools'];
|
|
704
|
-
}
|
|
705
|
-
function piDegradedServiceRetryExtensionPath() {
|
|
706
|
-
return fileURLToPath(new URL('../../scripts/pi-retry-degraded-service.mjs', import.meta.url));
|
|
707
|
-
}
|
|
708
|
-
function piProjectSkillsExtensionPath() {
|
|
709
|
-
return fileURLToPath(new URL('../../scripts/pi-project-skills.mjs', import.meta.url));
|
|
710
|
-
}
|
|
711
|
-
function piDefaultToolsExtensionPath() {
|
|
712
|
-
return fileURLToPath(new URL('../../scripts/pi-default-tools.mjs', import.meta.url));
|
|
713
|
-
}
|
|
714
|
-
function restorePiDegradedServiceError(errorMessage) {
|
|
715
|
-
const retryHint = '[cezar:retry-xai-degraded] Service unavailable: ';
|
|
716
|
-
return errorMessage.startsWith(retryHint) ? errorMessage.slice(retryHint.length) : errorMessage;
|
|
717
|
-
}
|
|
718
|
-
function piTools(tools, bashAllowlist) {
|
|
719
|
-
const map = {
|
|
720
|
-
Read: 'read',
|
|
721
|
-
Bash: 'bash',
|
|
722
|
-
Edit: 'edit',
|
|
723
|
-
Write: 'write',
|
|
724
|
-
Grep: 'grep',
|
|
725
|
-
Glob: 'find',
|
|
726
|
-
Subagent: 'subagent',
|
|
727
|
-
SubagentSupervisor: 'subagent_supervisor',
|
|
728
|
-
SubagentWait: 'subagent_wait',
|
|
729
|
-
};
|
|
730
|
-
return [
|
|
731
|
-
...new Set(tools
|
|
732
|
-
// Pi can allow/deny the whole bash tool but has no command-prefix
|
|
733
|
-
// equivalent. Fail closed when a workflow requests that narrower mode.
|
|
734
|
-
.filter((tool) => tool !== 'Bash' || !bashAllowlist || bashAllowlist.length === 0)
|
|
735
|
-
.map((tool) => map[tool] ?? tool.toLowerCase())),
|
|
736
|
-
];
|
|
737
|
-
}
|
|
738
|
-
function toPiPrompt(content) {
|
|
739
|
-
const text = [];
|
|
740
|
-
const images = [];
|
|
741
|
-
for (const block of content) {
|
|
742
|
-
if (block.type === 'text')
|
|
743
|
-
text.push(block.text);
|
|
744
|
-
else
|
|
745
|
-
images.push({ type: 'image', data: block.source.data, mimeType: block.source.media_type });
|
|
746
|
-
}
|
|
747
|
-
return { message: text.join('\n'), images };
|
|
748
|
-
}
|
|
749
|
-
function usageValues(value) {
|
|
750
|
-
if (!isRecord(value))
|
|
751
|
-
return undefined;
|
|
752
|
-
const input = number(value.input) ?? 0;
|
|
753
|
-
const output = number(value.output) ?? 0;
|
|
754
|
-
const cacheRead = number(value.cacheRead) ?? 0;
|
|
755
|
-
const cacheWrite = number(value.cacheWrite) ?? 0;
|
|
756
|
-
const cost = isRecord(value.cost) ? number(value.cost.total) : undefined;
|
|
757
|
-
return {
|
|
758
|
-
weighted: Math.round(input + output + cacheRead * 0.1 + cacheWrite * 1.25),
|
|
759
|
-
...(cost !== undefined && cost >= 0 ? { cost } : {}),
|
|
760
|
-
};
|
|
761
|
-
}
|
|
762
|
-
function emitImages(value, onEvent) {
|
|
763
|
-
if (!Array.isArray(value))
|
|
764
|
-
return;
|
|
765
|
-
for (const part of value) {
|
|
766
|
-
if (isRecord(part) && part.type === 'image') {
|
|
767
|
-
const data = string(part.data);
|
|
768
|
-
const mediaType = string(part.mimeType);
|
|
769
|
-
if (data && mediaType)
|
|
770
|
-
onEvent?.({ type: 'image', data, mediaType });
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
/** A pi message's text: a plain string, or its text parts joined like toPiPrompt. */
|
|
775
|
-
function piMessageText(message) {
|
|
776
|
-
if (typeof message.content === 'string')
|
|
777
|
-
return message.content;
|
|
778
|
-
return Array.isArray(message.content)
|
|
779
|
-
? message.content.flatMap(part => isRecord(part) && part.type === 'text' && typeof part.text === 'string' ? [part.text] : []).join('\n')
|
|
780
|
-
: '';
|
|
781
|
-
}
|
|
782
|
-
function contentText(value) {
|
|
783
|
-
if (typeof value === 'string')
|
|
784
|
-
return value;
|
|
785
|
-
if (!Array.isArray(value))
|
|
786
|
-
return undefined;
|
|
787
|
-
const text = value
|
|
788
|
-
.map((part) => (isRecord(part) && part.type === 'text' ? string(part.text) : undefined))
|
|
789
|
-
.filter((part) => part !== undefined);
|
|
790
|
-
return text.length > 0 ? text.join('\n') : undefined;
|
|
791
|
-
}
|
|
792
|
-
function rpcError(value) {
|
|
793
|
-
const error = isRecord(value.error) ? value.error : undefined;
|
|
794
|
-
return string(error?.message) ?? string(value.message) ?? `pi RPC command ${string(value.command) ?? 'unknown'} failed`;
|
|
795
|
-
}
|
|
796
|
-
function waitForExit(child) {
|
|
797
|
-
if (child.exitCode !== null || child.signalCode !== null)
|
|
798
|
-
return Promise.resolve(child.exitCode);
|
|
799
|
-
return new Promise((resolve) => child.once('close', resolve));
|
|
800
|
-
}
|
|
801
|
-
function wrapSpawnError(error, bin) {
|
|
802
|
-
if (error.code === 'ENOENT') {
|
|
803
|
-
return new Error(`\`${bin}\` not found on PATH — install pi and run \`pi\` once to configure a provider`);
|
|
804
|
-
}
|
|
805
|
-
return error;
|
|
806
|
-
}
|
|
807
|
-
/** Path to the bundled mock (`scripts/mock-pi-rpc.mjs`), for CEZ_DRY_RUN=1. */
|
|
808
|
-
function mockPiPath() {
|
|
809
|
-
// Resolved the same way `mockClaudePath` is, rather than through `new URL().pathname`:
|
|
810
|
-
// on Windows that yields a leading-slash `/C:/…` which `spawn` cannot execute.
|
|
811
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
812
|
-
// here = <pkg>/dist/core (built) or <pkg>/src/core (tsx dev).
|
|
813
|
-
return resolvePath(here, '..', '..', 'scripts', 'mock-pi-rpc.mjs');
|
|
814
|
-
}
|
|
815
|
-
function truncate(value, max = 200) {
|
|
816
|
-
return value.length > max ? `${value.slice(0, max)}…` : value;
|
|
817
|
-
}
|
|
818
|
-
function isRecord(value) {
|
|
819
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
820
|
-
}
|
|
821
|
-
function string(value) {
|
|
822
|
-
return typeof value === 'string' ? value : undefined;
|
|
823
|
-
}
|
|
824
|
-
function number(value) {
|
|
825
|
-
return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
826
|
-
}
|
|
827
|
-
//# sourceMappingURL=pi-runner.js.map
|