@hearsay-tools/squawk 0.0.0-stage → 0.17.0-dev.5682
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +1846 -2
- package/dist/activity/demand.d.ts +21 -0
- package/dist/activity/demand.js +49 -0
- package/dist/activity/demand.js.map +1 -0
- package/dist/activity/publisher.d.ts +48 -0
- package/dist/activity/publisher.js +175 -0
- package/dist/activity/publisher.js.map +1 -0
- package/dist/activity/read-model.d.ts +50 -0
- package/dist/activity/read-model.js +143 -0
- package/dist/activity/read-model.js.map +1 -0
- package/dist/activity/requests.d.ts +27 -0
- package/dist/activity/requests.js +81 -0
- package/dist/activity/requests.js.map +1 -0
- package/dist/activity/text.d.ts +4 -0
- package/dist/activity/text.js +13 -0
- package/dist/activity/text.js.map +1 -0
- package/dist/activity/tool-activity.d.ts +87 -0
- package/dist/activity/tool-activity.js +250 -0
- package/dist/activity/tool-activity.js.map +1 -0
- package/dist/activity/wait.d.ts +19 -0
- package/dist/activity/wait.js +91 -0
- package/dist/activity/wait.js.map +1 -0
- package/dist/agent-config/account-identity.d.ts +28 -0
- package/dist/agent-config/account-identity.js +132 -0
- package/dist/agent-config/account-identity.js.map +1 -0
- package/dist/agent-config/catalog.d.ts +70 -0
- package/dist/agent-config/catalog.js +384 -0
- package/dist/agent-config/catalog.js.map +1 -0
- package/dist/agent-config/files.d.ts +42 -0
- package/dist/agent-config/files.js +115 -0
- package/dist/agent-config/files.js.map +1 -0
- package/dist/agent-config/model-settings/claude.d.ts +2 -0
- package/dist/agent-config/model-settings/claude.js +11 -0
- package/dist/agent-config/model-settings/claude.js.map +1 -0
- package/dist/agent-config/model-settings/codex.d.ts +2 -0
- package/dist/agent-config/model-settings/codex.js +16 -0
- package/dist/agent-config/model-settings/codex.js.map +1 -0
- package/dist/agent-config/model-settings/opencode.d.ts +2 -0
- package/dist/agent-config/model-settings/opencode.js +8 -0
- package/dist/agent-config/model-settings/opencode.js.map +1 -0
- package/dist/agent-config/model-settings/pi.d.ts +2 -0
- package/dist/agent-config/model-settings/pi.js +38 -0
- package/dist/agent-config/model-settings/pi.js.map +1 -0
- package/dist/agent-config/model-settings/shared.d.ts +12 -0
- package/dist/agent-config/model-settings/shared.js +100 -0
- package/dist/agent-config/model-settings/shared.js.map +1 -0
- package/dist/agent-config/model-settings/types.d.ts +9 -0
- package/dist/agent-config/model-settings/types.js +2 -0
- package/dist/agent-config/model-settings/types.js.map +1 -0
- package/dist/agent-config/models.d.ts +9 -0
- package/dist/agent-config/models.js +40 -0
- package/dist/agent-config/models.js.map +1 -0
- package/dist/agent-config/seed.d.ts +15 -0
- package/dist/agent-config/seed.js +94 -0
- package/dist/agent-config/seed.js.map +1 -0
- package/dist/agent-config/service.d.ts +44 -0
- package/dist/agent-config/service.js +73 -0
- package/dist/agent-config/service.js.map +1 -0
- package/dist/agent-config/validate.d.ts +18 -0
- package/dist/agent-config/validate.js +82 -0
- package/dist/agent-config/validate.js.map +1 -0
- package/dist/application-update/bin-recovery.d.ts +5 -0
- package/dist/application-update/bin-recovery.js +96 -0
- package/dist/application-update/bin-recovery.js.map +1 -0
- package/dist/application-update/discovery.d.ts +23 -0
- package/dist/application-update/discovery.js +131 -0
- package/dist/application-update/discovery.js.map +1 -0
- package/dist/application-update/helper.d.ts +58 -0
- package/dist/application-update/helper.js +363 -0
- package/dist/application-update/helper.js.map +1 -0
- package/dist/application-update/launcher.d.ts +12 -0
- package/dist/application-update/launcher.js +61 -0
- package/dist/application-update/launcher.js.map +1 -0
- package/dist/application-update/lock.d.ts +4 -0
- package/dist/application-update/lock.js +70 -0
- package/dist/application-update/lock.js.map +1 -0
- package/dist/application-update/npm-process.d.ts +17 -0
- package/dist/application-update/npm-process.js +156 -0
- package/dist/application-update/npm-process.js.map +1 -0
- package/dist/application-update/runtime-layout.d.ts +20 -0
- package/dist/application-update/runtime-layout.js +91 -0
- package/dist/application-update/runtime-layout.js.map +1 -0
- package/dist/application-update/scoped-recovery.d.ts +32 -0
- package/dist/application-update/scoped-recovery.js +210 -0
- package/dist/application-update/scoped-recovery.js.map +1 -0
- package/dist/application-update/service.d.ts +86 -0
- package/dist/application-update/service.js +523 -0
- package/dist/application-update/service.js.map +1 -0
- package/dist/archive-on-merge-setting.d.ts +15 -0
- package/dist/archive-on-merge-setting.js +15 -0
- package/dist/archive-on-merge-setting.js.map +1 -0
- package/dist/artifacts/cli.d.ts +1 -0
- package/dist/artifacts/cli.js +54 -0
- package/dist/artifacts/cli.js.map +1 -0
- package/dist/artifacts/lifecycle.d.ts +4 -0
- package/dist/artifacts/lifecycle.js +42 -0
- package/dist/artifacts/lifecycle.js.map +1 -0
- package/dist/artifacts/reports-index.d.ts +46 -0
- package/dist/artifacts/reports-index.js +279 -0
- package/dist/artifacts/reports-index.js.map +1 -0
- package/dist/artifacts/reports-watch.d.ts +43 -0
- package/dist/artifacts/reports-watch.js +129 -0
- package/dist/artifacts/reports-watch.js.map +1 -0
- package/dist/artifacts/resolve.d.ts +18 -0
- package/dist/artifacts/resolve.js +129 -0
- package/dist/artifacts/resolve.js.map +1 -0
- package/dist/artifacts/store.d.ts +40 -0
- package/dist/artifacts/store.js +513 -0
- package/dist/artifacts/store.js.map +1 -0
- package/dist/automations/automation-cli.d.ts +61 -0
- package/dist/automations/automation-cli.js +519 -0
- package/dist/automations/automation-cli.js.map +1 -0
- package/dist/automations/builtin-skill.d.ts +7 -0
- package/dist/automations/builtin-skill.js +14 -0
- package/dist/automations/builtin-skill.js.map +1 -0
- package/dist/automations/coordinator.d.ts +53 -0
- package/dist/automations/coordinator.js +136 -0
- package/dist/automations/coordinator.js.map +1 -0
- package/dist/automations/github-baseline.d.ts +3 -0
- package/dist/automations/github-baseline.js +17 -0
- package/dist/automations/github-baseline.js.map +1 -0
- package/dist/automations/github-poller.d.ts +93 -0
- package/dist/automations/github-poller.js +303 -0
- package/dist/automations/github-poller.js.map +1 -0
- package/dist/automations/project-files.d.ts +6 -0
- package/dist/automations/project-files.js +43 -0
- package/dist/automations/project-files.js.map +1 -0
- package/dist/automations/prompts.d.ts +12 -0
- package/dist/automations/prompts.js +162 -0
- package/dist/automations/prompts.js.map +1 -0
- package/dist/automations/schedule-runner.d.ts +153 -0
- package/dist/automations/schedule-runner.js +529 -0
- package/dist/automations/schedule-runner.js.map +1 -0
- package/dist/automations/scheduler.d.ts +95 -0
- package/dist/automations/scheduler.js +462 -0
- package/dist/automations/scheduler.js.map +1 -0
- package/dist/automations/service.d.ts +793 -0
- package/dist/automations/service.js +444 -0
- package/dist/automations/service.js.map +1 -0
- package/dist/automations/store.d.ts +168 -0
- package/dist/automations/store.js +805 -0
- package/dist/automations/store.js.map +1 -0
- package/dist/automations/task-template.d.ts +59 -0
- package/dist/automations/task-template.js +285 -0
- package/dist/automations/task-template.js.map +1 -0
- package/dist/automations/tool-adapter.d.ts +6 -0
- package/dist/automations/tool-adapter.js +115 -0
- package/dist/automations/tool-adapter.js.map +1 -0
- package/dist/automations/types.d.ts +1 -0
- package/dist/automations/types.js +2 -0
- package/dist/automations/types.js.map +1 -0
- package/dist/autosave-cleanup.d.ts +26 -0
- package/dist/autosave-cleanup.js +87 -0
- package/dist/autosave-cleanup.js.map +1 -0
- package/dist/autosave-git.d.ts +23 -0
- package/dist/autosave-git.js +211 -0
- package/dist/autosave-git.js.map +1 -0
- package/dist/autosave-group.d.ts +8 -0
- package/dist/autosave-group.js +61 -0
- package/dist/autosave-group.js.map +1 -0
- package/dist/autosave-holders.d.ts +34 -0
- package/dist/autosave-holders.js +228 -0
- package/dist/autosave-holders.js.map +1 -0
- package/dist/autosave-windows.d.ts +25 -0
- package/dist/autosave-windows.js +170 -0
- package/dist/autosave-windows.js.map +1 -0
- package/dist/cez.d.ts +2 -0
- package/dist/cez.js +3 -0
- package/dist/cez.js.map +1 -0
- package/dist/cezarion.d.ts +2 -0
- package/dist/cezarion.js +3 -0
- package/dist/cezarion.js.map +1 -0
- package/dist/ci-wait/client.d.ts +28 -0
- package/dist/ci-wait/client.js +123 -0
- package/dist/ci-wait/client.js.map +1 -0
- package/dist/ci-wait/controller.d.ts +824 -0
- package/dist/ci-wait/controller.js +305 -0
- package/dist/ci-wait/controller.js.map +1 -0
- package/dist/ci-wait/errors.d.ts +35 -0
- package/dist/ci-wait/errors.js +273 -0
- package/dist/ci-wait/errors.js.map +1 -0
- package/dist/ci-wait/github.d.ts +105 -0
- package/dist/ci-wait/github.js +324 -0
- package/dist/ci-wait/github.js.map +1 -0
- package/dist/ci-wait/injection.d.ts +3 -0
- package/dist/ci-wait/injection.js +13 -0
- package/dist/ci-wait/injection.js.map +1 -0
- package/dist/ci-wait/mcp.d.ts +3 -0
- package/dist/ci-wait/mcp.js +30 -0
- package/dist/ci-wait/mcp.js.map +1 -0
- package/dist/ci-wait/merge-progress.d.ts +84 -0
- package/dist/ci-wait/merge-progress.js +50 -0
- package/dist/ci-wait/merge-progress.js.map +1 -0
- package/dist/ci-wait/progress.d.ts +56 -0
- package/dist/ci-wait/progress.js +100 -0
- package/dist/ci-wait/progress.js.map +1 -0
- package/dist/ci-wait/resources.d.ts +9 -0
- package/dist/ci-wait/resources.js +46 -0
- package/dist/ci-wait/resources.js.map +1 -0
- package/dist/ci-wait/supervisor.d.ts +47 -0
- package/dist/ci-wait/supervisor.js +334 -0
- package/dist/ci-wait/supervisor.js.map +1 -0
- package/dist/ci-wait/text.d.ts +2 -0
- package/dist/ci-wait/text.js +5 -0
- package/dist/ci-wait/text.js.map +1 -0
- package/dist/ci-wait/tools.d.ts +845 -0
- package/dist/ci-wait/tools.js +232 -0
- package/dist/ci-wait/tools.js.map +1 -0
- package/dist/cli-dispatch.d.ts +33 -0
- package/dist/cli-dispatch.js +239 -0
- package/dist/cli-dispatch.js.map +1 -0
- package/dist/config.d.ts +117 -0
- package/dist/config.js +343 -0
- package/dist/config.js.map +1 -0
- package/dist/contract/active-provider.d.ts +12 -0
- package/dist/contract/activity.d.ts +1478 -0
- package/dist/contract/agent-config.d.ts +160 -0
- package/dist/contract/agent-profiles.d.ts +369 -0
- package/dist/contract/application-update.d.ts +32 -0
- package/dist/contract/artifacts.d.ts +100 -0
- package/dist/contract/ask-schema.d.ts +50 -0
- package/dist/contract/ask.d.ts +11 -0
- package/dist/contract/attachments.d.ts +35 -0
- package/dist/contract/attention.d.ts +99 -0
- package/dist/contract/automation-requests.d.ts +314 -0
- package/dist/contract/automation-schedule.d.ts +89 -0
- package/dist/contract/automation-storage.d.ts +518 -0
- package/dist/contract/automations.d.ts +1560 -0
- package/dist/contract/ci-wait.d.ts +281 -0
- package/dist/contract/config-requests.d.ts +36 -0
- package/dist/contract/control-locations.d.ts +10 -0
- package/dist/contract/conversations.d.ts +415 -0
- package/dist/contract/defined.d.ts +8 -0
- package/dist/contract/delegation.d.ts +2168 -0
- package/dist/contract/discovery.d.ts +228 -0
- package/dist/contract/effort.d.ts +18 -0
- package/dist/contract/events.d.ts +324 -0
- package/dist/contract/github-requests.d.ts +26 -0
- package/dist/contract/github.d.ts +732 -0
- package/dist/contract/handoff.d.ts +43 -0
- package/dist/contract/health.d.ts +128 -0
- package/dist/contract/home-recovery.d.ts +71 -0
- package/dist/contract/image-path.d.ts +6 -0
- package/dist/contract/index.d.ts +68 -0
- package/dist/contract/index.js +6709 -0
- package/dist/contract/live-coordination.d.ts +164 -0
- package/dist/contract/live-limits.d.ts +8 -0
- package/dist/contract/live.d.ts +123 -0
- package/dist/contract/pending-ask.d.ts +58 -0
- package/dist/contract/per-runner-optional-strings.d.ts +10 -0
- package/dist/contract/permissions.d.ts +54 -0
- package/dist/contract/preview.d.ts +568 -0
- package/dist/contract/project-limits.d.ts +35 -0
- package/dist/contract/projects.d.ts +716 -0
- package/dist/contract/provider-requests.d.ts +77 -0
- package/dist/contract/query-requests.d.ts +52 -0
- package/dist/contract/repo-requests.d.ts +12 -0
- package/dist/contract/repo.d.ts +515 -0
- package/dist/contract/report-title.d.ts +3 -0
- package/dist/contract/reports.d.ts +101 -0
- package/dist/contract/run-labels.d.ts +8 -0
- package/dist/contract/run-limits.d.ts +8 -0
- package/dist/contract/run-predicates.d.ts +87 -0
- package/dist/contract/run-requests.d.ts +33 -0
- package/dist/contract/run-search.d.ts +193 -0
- package/dist/contract/runs.d.ts +7108 -0
- package/dist/contract/scheduled-tasks.d.ts +188 -0
- package/dist/contract/self-update.d.ts +255 -0
- package/dist/contract/skill-sources.d.ts +125 -0
- package/dist/contract/skills.d.ts +56 -0
- package/dist/contract/task-options.d.ts +18 -0
- package/dist/contract/team-skill-ref.d.ts +10 -0
- package/dist/contract/tool-display.d.ts +25 -0
- package/dist/contract/ui-state-requests.d.ts +60 -0
- package/dist/contract/version.d.ts +3 -0
- package/dist/contract/voice.d.ts +213 -0
- package/dist/contract/waits.d.ts +1996 -0
- package/dist/contract/workflow-file.d.ts +37 -0
- package/dist/contract/workflow-requests.d.ts +7 -0
- package/dist/contract/workflows.d.ts +250 -0
- package/dist/contract/workspace-events.d.ts +410 -0
- package/dist/contract/workspace.d.ts +631 -0
- package/dist/contract/zoned-time.d.ts +26 -0
- package/dist/core/agent-env.d.ts +34 -0
- package/dist/core/agent-env.js +411 -0
- package/dist/core/agent-env.js.map +1 -0
- package/dist/core/agent-model-policy.d.ts +11 -0
- package/dist/core/agent-model-policy.js +38 -0
- package/dist/core/agent-model-policy.js.map +1 -0
- package/dist/core/agent-profiles.d.ts +50 -0
- package/dist/core/agent-profiles.js +105 -0
- package/dist/core/agent-profiles.js.map +1 -0
- package/dist/core/agent-runner.d.ts +425 -0
- package/dist/core/agent-runner.js +98 -0
- package/dist/core/agent-runner.js.map +1 -0
- package/dist/core/ask.d.ts +26 -0
- package/dist/core/ask.js +35 -0
- package/dist/core/ask.js.map +1 -0
- package/dist/core/backend-detect.d.ts +18 -0
- package/dist/core/backend-detect.js +216 -0
- package/dist/core/backend-detect.js.map +1 -0
- package/dist/core/claude-cli-runner.d.ts +85 -0
- package/dist/core/claude-cli-runner.js +899 -0
- package/dist/core/claude-cli-runner.js.map +1 -0
- package/dist/core/claude-executable.d.ts +2 -0
- package/dist/core/claude-executable.js +15 -0
- package/dist/core/claude-executable.js.map +1 -0
- package/dist/core/claude-model-catalog.d.ts +16 -0
- package/dist/core/claude-model-catalog.js +198 -0
- package/dist/core/claude-model-catalog.js.map +1 -0
- package/dist/core/claude-stream.d.ts +38 -0
- package/dist/core/claude-stream.js +77 -0
- package/dist/core/claude-stream.js.map +1 -0
- package/dist/core/claude-ui-mapper.d.ts +88 -0
- package/dist/core/claude-ui-mapper.js +851 -0
- package/dist/core/claude-ui-mapper.js.map +1 -0
- package/dist/core/codex-app-server-runner.d.ts +76 -0
- package/dist/core/codex-app-server-runner.js +1271 -0
- package/dist/core/codex-app-server-runner.js.map +1 -0
- package/dist/core/codex-app-server-transport.d.ts +52 -0
- package/dist/core/codex-app-server-transport.js +200 -0
- package/dist/core/codex-app-server-transport.js.map +1 -0
- package/dist/core/codex-approvals.d.ts +12 -0
- package/dist/core/codex-approvals.js +180 -0
- package/dist/core/codex-approvals.js.map +1 -0
- package/dist/core/codex-hook-mapper.d.ts +15 -0
- package/dist/core/codex-hook-mapper.js +73 -0
- package/dist/core/codex-hook-mapper.js.map +1 -0
- package/dist/core/codex-model-catalog.d.ts +10 -0
- package/dist/core/codex-model-catalog.js +110 -0
- package/dist/core/codex-model-catalog.js.map +1 -0
- package/dist/core/codex-native-frames.d.ts +35 -0
- package/dist/core/codex-native-frames.js +80 -0
- package/dist/core/codex-native-frames.js.map +1 -0
- package/dist/core/codex-permissions.d.ts +6 -0
- package/dist/core/codex-permissions.js +27 -0
- package/dist/core/codex-permissions.js.map +1 -0
- package/dist/core/codex-stream-error.d.ts +2 -0
- package/dist/core/codex-stream-error.js +12 -0
- package/dist/core/codex-stream-error.js.map +1 -0
- package/dist/core/codex-turn-outcome.d.ts +10 -0
- package/dist/core/codex-turn-outcome.js +35 -0
- package/dist/core/codex-turn-outcome.js.map +1 -0
- package/dist/core/codex-ui-mapper-state.d.ts +84 -0
- package/dist/core/codex-ui-mapper-state.js +8 -0
- package/dist/core/codex-ui-mapper-state.js.map +1 -0
- package/dist/core/codex-ui-mapper.d.ts +44 -0
- package/dist/core/codex-ui-mapper.js +799 -0
- package/dist/core/codex-ui-mapper.js.map +1 -0
- package/dist/core/cursor-cli-flags.d.ts +19 -0
- package/dist/core/cursor-cli-flags.js +47 -0
- package/dist/core/cursor-cli-flags.js.map +1 -0
- package/dist/core/cursor-config-options.d.ts +18 -0
- package/dist/core/cursor-config-options.js +31 -0
- package/dist/core/cursor-config-options.js.map +1 -0
- package/dist/core/cursor-model-catalog.d.ts +50 -0
- package/dist/core/cursor-model-catalog.js +306 -0
- package/dist/core/cursor-model-catalog.js.map +1 -0
- package/dist/core/cursor-print-capabilities.d.ts +14 -0
- package/dist/core/cursor-print-capabilities.js +169 -0
- package/dist/core/cursor-print-capabilities.js.map +1 -0
- package/dist/core/cursor-print-process.d.ts +31 -0
- package/dist/core/cursor-print-process.js +117 -0
- package/dist/core/cursor-print-process.js.map +1 -0
- package/dist/core/cursor-print-runner.d.ts +43 -0
- package/dist/core/cursor-print-runner.js +574 -0
- package/dist/core/cursor-print-runner.js.map +1 -0
- package/dist/core/cursor-print-tool-catalog.d.ts +3 -0
- package/dist/core/cursor-print-tool-catalog.js +13 -0
- package/dist/core/cursor-print-tool-catalog.js.map +1 -0
- package/dist/core/cursor-print-ui-mapper.d.ts +47 -0
- package/dist/core/cursor-print-ui-mapper.js +574 -0
- package/dist/core/cursor-print-ui-mapper.js.map +1 -0
- package/dist/core/cursor-provider-error.d.ts +9 -0
- package/dist/core/cursor-provider-error.js +15 -0
- package/dist/core/cursor-provider-error.js.map +1 -0
- package/dist/core/cursor-runner.d.ts +46 -0
- package/dist/core/cursor-runner.js +144 -0
- package/dist/core/cursor-runner.js.map +1 -0
- package/dist/core/defined.d.ts +1 -0
- package/dist/core/defined.js +2 -0
- package/dist/core/defined.js.map +1 -0
- package/dist/core/disclaim-spawn.d.ts +11 -0
- package/dist/core/disclaim-spawn.js +60 -0
- package/dist/core/disclaim-spawn.js.map +1 -0
- package/dist/core/edit-write-key.d.ts +2 -0
- package/dist/core/edit-write-key.js +6 -0
- package/dist/core/edit-write-key.js.map +1 -0
- package/dist/core/hook-items.d.ts +14 -0
- package/dist/core/hook-items.js +13 -0
- package/dist/core/hook-items.js.map +1 -0
- package/dist/core/host-model-catalog.d.ts +7 -0
- package/dist/core/host-model-catalog.js +21 -0
- package/dist/core/host-model-catalog.js.map +1 -0
- package/dist/core/input-submissions.d.ts +14 -0
- package/dist/core/input-submissions.js +26 -0
- package/dist/core/input-submissions.js.map +1 -0
- package/dist/core/managed-session.d.ts +6 -0
- package/dist/core/managed-session.js +116 -0
- package/dist/core/managed-session.js.map +1 -0
- package/dist/core/model-discovery-options.d.ts +8 -0
- package/dist/core/model-discovery-options.js +2 -0
- package/dist/core/model-discovery-options.js.map +1 -0
- package/dist/core/model-identity.d.ts +108 -0
- package/dist/core/model-identity.js +137 -0
- package/dist/core/model-identity.js.map +1 -0
- package/dist/core/model-presets.d.ts +10 -0
- package/dist/core/model-presets.js +77 -0
- package/dist/core/model-presets.js.map +1 -0
- package/dist/core/model-probe-teardown.d.ts +4 -0
- package/dist/core/model-probe-teardown.js +20 -0
- package/dist/core/model-probe-teardown.js.map +1 -0
- package/dist/core/ndjson.d.ts +6 -0
- package/dist/core/ndjson.js +23 -0
- package/dist/core/ndjson.js.map +1 -0
- package/dist/core/omp-model-catalog.d.ts +39 -0
- package/dist/core/omp-model-catalog.js +183 -0
- package/dist/core/omp-model-catalog.js.map +1 -0
- package/dist/core/omp-runner.d.ts +86 -0
- package/dist/core/omp-runner.js +818 -0
- package/dist/core/omp-runner.js.map +1 -0
- package/dist/core/omp-subagent-rows.d.ts +21 -0
- package/dist/core/omp-subagent-rows.js +99 -0
- package/dist/core/omp-subagent-rows.js.map +1 -0
- package/dist/core/omp-ui-mapper.d.ts +112 -0
- package/dist/core/omp-ui-mapper.js +807 -0
- package/dist/core/omp-ui-mapper.js.map +1 -0
- package/dist/core/opencode-model-catalog.d.ts +27 -0
- package/dist/core/opencode-model-catalog.js +189 -0
- package/dist/core/opencode-model-catalog.js.map +1 -0
- package/dist/core/opencode-permissions.d.ts +52 -0
- package/dist/core/opencode-permissions.js +101 -0
- package/dist/core/opencode-permissions.js.map +1 -0
- package/dist/core/opencode-runtime-config.d.ts +9 -0
- package/dist/core/opencode-runtime-config.js +26 -0
- package/dist/core/opencode-runtime-config.js.map +1 -0
- package/dist/core/opencode-server-runner.d.ts +75 -0
- package/dist/core/opencode-server-runner.js +1690 -0
- package/dist/core/opencode-server-runner.js.map +1 -0
- package/dist/core/opencode-session-error.d.ts +19 -0
- package/dist/core/opencode-session-error.js +42 -0
- package/dist/core/opencode-session-error.js.map +1 -0
- package/dist/core/opencode-task-scope.d.ts +9 -0
- package/dist/core/opencode-task-scope.js +19 -0
- package/dist/core/opencode-task-scope.js.map +1 -0
- package/dist/core/opencode-ui-mapper-state.d.ts +82 -0
- package/dist/core/opencode-ui-mapper-state.js +7 -0
- package/dist/core/opencode-ui-mapper-state.js.map +1 -0
- package/dist/core/opencode-ui-mapper.d.ts +59 -0
- package/dist/core/opencode-ui-mapper.js +724 -0
- package/dist/core/opencode-ui-mapper.js.map +1 -0
- package/dist/core/opencode-usage.d.ts +32 -0
- package/dist/core/opencode-usage.js +105 -0
- package/dist/core/opencode-usage.js.map +1 -0
- package/dist/core/pi-model-catalog.d.ts +34 -0
- package/dist/core/pi-model-catalog.js +247 -0
- package/dist/core/pi-model-catalog.js.map +1 -0
- package/dist/core/pi-rpc-turn.d.ts +179 -0
- package/dist/core/pi-rpc-turn.js +370 -0
- package/dist/core/pi-rpc-turn.js.map +1 -0
- package/dist/core/pi-rpc-wire.d.ts +31 -0
- package/dist/core/pi-rpc-wire.js +88 -0
- package/dist/core/pi-rpc-wire.js.map +1 -0
- package/dist/core/pi-runner.d.ts +58 -0
- package/dist/core/pi-runner.js +587 -0
- package/dist/core/pi-runner.js.map +1 -0
- package/dist/core/pi-ui-mapper.d.ts +52 -0
- package/dist/core/pi-ui-mapper.js +408 -0
- package/dist/core/pi-ui-mapper.js.map +1 -0
- package/dist/core/process-usage.d.ts +74 -0
- package/dist/core/process-usage.js +219 -0
- package/dist/core/process-usage.js.map +1 -0
- package/dist/core/product-env.d.ts +21 -0
- package/dist/core/product-env.js +38 -0
- package/dist/core/product-env.js.map +1 -0
- package/dist/core/provider-auth.d.ts +168 -0
- package/dist/core/provider-auth.js +661 -0
- package/dist/core/provider-auth.js.map +1 -0
- package/dist/core/provider-availability.d.ts +3 -0
- package/dist/core/provider-availability.js +14 -0
- package/dist/core/provider-availability.js.map +1 -0
- package/dist/core/runner-factory.d.ts +11 -0
- package/dist/core/runner-factory.js +36 -0
- package/dist/core/runner-factory.js.map +1 -0
- package/dist/core/runner-facts.d.ts +135 -0
- package/dist/core/runner-facts.js +59 -0
- package/dist/core/runner-facts.js.map +1 -0
- package/dist/core/runner-model-catalog.d.ts +34 -0
- package/dist/core/runner-model-catalog.js +109 -0
- package/dist/core/runner-model-catalog.js.map +1 -0
- package/dist/core/runner-runtime.d.ts +40 -0
- package/dist/core/runner-runtime.js +88 -0
- package/dist/core/runner-runtime.js.map +1 -0
- package/dist/core/runner-stderr.d.ts +2 -0
- package/dist/core/runner-stderr.js +20 -0
- package/dist/core/runner-stderr.js.map +1 -0
- package/dist/core/runner-tool-grants.d.ts +19 -0
- package/dist/core/runner-tool-grants.js +54 -0
- package/dist/core/runner-tool-grants.js.map +1 -0
- package/dist/core/secret-redaction.d.ts +20 -0
- package/dist/core/secret-redaction.js +95 -0
- package/dist/core/secret-redaction.js.map +1 -0
- package/dist/core/session-process.d.ts +43 -0
- package/dist/core/session-process.js +363 -0
- package/dist/core/session-process.js.map +1 -0
- package/dist/core/shell-env.d.ts +17 -0
- package/dist/core/shell-env.js +51 -0
- package/dist/core/shell-env.js.map +1 -0
- package/dist/core/ui-events.d.ts +356 -0
- package/dist/core/ui-events.js +13 -0
- package/dist/core/ui-events.js.map +1 -0
- package/dist/core/usage-limit.d.ts +42 -0
- package/dist/core/usage-limit.js +152 -0
- package/dist/core/usage-limit.js.map +1 -0
- package/dist/core/usage.d.ts +11 -0
- package/dist/core/usage.js +15 -0
- package/dist/core/usage.js.map +1 -0
- package/dist/core/v1-text-coalescer.d.ts +36 -0
- package/dist/core/v1-text-coalescer.js +72 -0
- package/dist/core/v1-text-coalescer.js.map +1 -0
- package/dist/data-gitignore.d.ts +6 -0
- package/dist/data-gitignore.js +80 -0
- package/dist/data-gitignore.js.map +1 -0
- package/dist/delegation/capacity.d.ts +15 -0
- package/dist/delegation/capacity.js +30 -0
- package/dist/delegation/capacity.js.map +1 -0
- package/dist/delegation/cli.d.ts +5 -0
- package/dist/delegation/cli.js +572 -0
- package/dist/delegation/cli.js.map +1 -0
- package/dist/delegation/context.d.ts +40 -0
- package/dist/delegation/context.js +398 -0
- package/dist/delegation/context.js.map +1 -0
- package/dist/delegation/conversation-send.d.ts +64 -0
- package/dist/delegation/conversation-send.js +74 -0
- package/dist/delegation/conversation-send.js.map +1 -0
- package/dist/delegation/conversations.d.ts +2186 -0
- package/dist/delegation/conversations.js +285 -0
- package/dist/delegation/conversations.js.map +1 -0
- package/dist/delegation/credentials.d.ts +21 -0
- package/dist/delegation/credentials.js +66 -0
- package/dist/delegation/credentials.js.map +1 -0
- package/dist/delegation/destroy-observation.d.ts +42 -0
- package/dist/delegation/destroy-observation.js +115 -0
- package/dist/delegation/destroy-observation.js.map +1 -0
- package/dist/delegation/effort.d.ts +1 -0
- package/dist/delegation/effort.js +11 -0
- package/dist/delegation/effort.js.map +1 -0
- package/dist/delegation/execution-identity.d.ts +257 -0
- package/dist/delegation/execution-identity.js +253 -0
- package/dist/delegation/execution-identity.js.map +1 -0
- package/dist/delegation/execution-settings.d.ts +11 -0
- package/dist/delegation/execution-settings.js +65 -0
- package/dist/delegation/execution-settings.js.map +1 -0
- package/dist/delegation/idle-test-app.d.ts +4 -0
- package/dist/delegation/idle-test-app.js +186 -0
- package/dist/delegation/idle-test-app.js.map +1 -0
- package/dist/delegation/input.d.ts +12 -0
- package/dist/delegation/input.js +50 -0
- package/dist/delegation/input.js.map +1 -0
- package/dist/delegation/park-notice.d.ts +45 -0
- package/dist/delegation/park-notice.js +81 -0
- package/dist/delegation/park-notice.js.map +1 -0
- package/dist/delegation/policy.d.ts +27 -0
- package/dist/delegation/policy.js +110 -0
- package/dist/delegation/policy.js.map +1 -0
- package/dist/delegation/process-liveness.d.ts +98 -0
- package/dist/delegation/process-liveness.js +213 -0
- package/dist/delegation/process-liveness.js.map +1 -0
- package/dist/delegation/provision.d.ts +36 -0
- package/dist/delegation/provision.js +218 -0
- package/dist/delegation/provision.js.map +1 -0
- package/dist/delegation/questions.d.ts +24 -0
- package/dist/delegation/questions.js +56 -0
- package/dist/delegation/questions.js.map +1 -0
- package/dist/delegation/readiness.d.ts +13 -0
- package/dist/delegation/readiness.js +19 -0
- package/dist/delegation/readiness.js.map +1 -0
- package/dist/delegation/results.d.ts +13 -0
- package/dist/delegation/results.js +153 -0
- package/dist/delegation/results.js.map +1 -0
- package/dist/delegation/retry-backoff.d.ts +31 -0
- package/dist/delegation/retry-backoff.js +26 -0
- package/dist/delegation/retry-backoff.js.map +1 -0
- package/dist/delegation/routes.d.ts +1017 -0
- package/dist/delegation/routes.js +85 -0
- package/dist/delegation/routes.js.map +1 -0
- package/dist/delegation/scratch-cleanup.d.ts +33 -0
- package/dist/delegation/scratch-cleanup.js +155 -0
- package/dist/delegation/scratch-cleanup.js.map +1 -0
- package/dist/delegation/service.d.ts +264 -0
- package/dist/delegation/service.js +807 -0
- package/dist/delegation/service.js.map +1 -0
- package/dist/delegation/task-discovery.d.ts +6 -0
- package/dist/delegation/task-discovery.js +27 -0
- package/dist/delegation/task-discovery.js.map +1 -0
- package/dist/delegation/transport.d.ts +995 -0
- package/dist/delegation/transport.js +22 -0
- package/dist/delegation/transport.js.map +1 -0
- package/dist/delegation/wait.d.ts +7 -0
- package/dist/delegation/wait.js +44 -0
- package/dist/delegation/wait.js.map +1 -0
- package/dist/delegation/windows-test-app.d.ts +5 -0
- package/dist/delegation/windows-test-app.js +64 -0
- package/dist/delegation/windows-test-app.js.map +1 -0
- package/dist/delegation/windows-workspace-identity.d.ts +3 -0
- package/dist/delegation/windows-workspace-identity.js +23 -0
- package/dist/delegation/windows-workspace-identity.js.map +1 -0
- package/dist/delegation/worker-cleanup.d.ts +53 -0
- package/dist/delegation/worker-cleanup.js +330 -0
- package/dist/delegation/worker-cleanup.js.map +1 -0
- package/dist/delegation/workspace.d.ts +40 -0
- package/dist/delegation/workspace.js +592 -0
- package/dist/delegation/workspace.js.map +1 -0
- package/dist/detached-process.d.ts +134 -0
- package/dist/detached-process.js +460 -0
- package/dist/detached-process.js.map +1 -0
- package/dist/discovery/catalog.d.ts +16 -0
- package/dist/discovery/catalog.js +31 -0
- package/dist/discovery/catalog.js.map +1 -0
- package/dist/discovery/cli.d.ts +8 -0
- package/dist/discovery/cli.js +122 -0
- package/dist/discovery/cli.js.map +1 -0
- package/dist/git-command.d.ts +7 -0
- package/dist/git-command.js +8 -0
- package/dist/git-command.js.map +1 -0
- package/dist/git-diff-base.d.ts +41 -0
- package/dist/git-diff-base.js +116 -0
- package/dist/git-diff-base.js.map +1 -0
- package/dist/git-index-copy.d.ts +4 -0
- package/dist/git-index-copy.js +10 -0
- package/dist/git-index-copy.js.map +1 -0
- package/dist/git-private-index.d.ts +11 -0
- package/dist/git-private-index.js +51 -0
- package/dist/git-private-index.js.map +1 -0
- package/dist/git-refs.d.ts +11 -0
- package/dist/git-refs.js +14 -0
- package/dist/git-refs.js.map +1 -0
- package/dist/git-worktree-lock-helper.d.ts +7 -0
- package/dist/git-worktree-lock-helper.js +178 -0
- package/dist/git-worktree-lock-helper.js.map +1 -0
- package/dist/git-worktree-lock.d.ts +17 -0
- package/dist/git-worktree-lock.js +90 -0
- package/dist/git-worktree-lock.js.map +1 -0
- package/dist/git-worktree-release.d.ts +20 -0
- package/dist/git-worktree-release.js +27 -0
- package/dist/git-worktree-release.js.map +1 -0
- package/dist/git-worktree.d.ts +148 -0
- package/dist/git-worktree.js +858 -0
- package/dist/git-worktree.js.map +1 -0
- package/dist/handoff.d.ts +72 -0
- package/dist/handoff.js +213 -0
- package/dist/handoff.js.map +1 -0
- package/dist/headless-run.d.ts +48 -0
- package/dist/headless-run.js +158 -0
- package/dist/headless-run.js.map +1 -0
- package/dist/home/boundary.d.ts +5 -0
- package/dist/home/boundary.js +76 -0
- package/dist/home/boundary.js.map +1 -0
- package/dist/home/changes.d.ts +3 -0
- package/dist/home/changes.js +11 -0
- package/dist/home/changes.js.map +1 -0
- package/dist/home/command.d.ts +9 -0
- package/dist/home/command.js +37 -0
- package/dist/home/command.js.map +1 -0
- package/dist/home/deprecation.d.ts +9 -0
- package/dist/home/deprecation.js +17 -0
- package/dist/home/deprecation.js.map +1 -0
- package/dist/home/display.d.ts +4 -0
- package/dist/home/display.js +11 -0
- package/dist/home/display.js.map +1 -0
- package/dist/home/entry-authorization.d.ts +17 -0
- package/dist/home/entry-authorization.js +39 -0
- package/dist/home/entry-authorization.js.map +1 -0
- package/dist/home/entry.d.ts +16 -0
- package/dist/home/entry.js +96 -0
- package/dist/home/entry.js.map +1 -0
- package/dist/home/file-location.d.ts +14 -0
- package/dist/home/file-location.js +24 -0
- package/dist/home/file-location.js.map +1 -0
- package/dist/home/home.d.ts +42 -0
- package/dist/home/home.js +70 -0
- package/dist/home/home.js.map +1 -0
- package/dist/home/identity.d.ts +22 -0
- package/dist/home/identity.js +25 -0
- package/dist/home/identity.js.map +1 -0
- package/dist/home/install-marker.d.ts +27 -0
- package/dist/home/install-marker.js +78 -0
- package/dist/home/install-marker.js.map +1 -0
- package/dist/home/kind-roots.d.ts +10 -0
- package/dist/home/kind-roots.js +36 -0
- package/dist/home/kind-roots.js.map +1 -0
- package/dist/home/leases.d.ts +14 -0
- package/dist/home/leases.js +55 -0
- package/dist/home/leases.js.map +1 -0
- package/dist/home/legacy-account-paths.d.ts +4 -0
- package/dist/home/legacy-account-paths.js +41 -0
- package/dist/home/legacy-account-paths.js.map +1 -0
- package/dist/home/legacy-merge.d.ts +3 -0
- package/dist/home/legacy-merge.js +45 -0
- package/dist/home/legacy-merge.js.map +1 -0
- package/dist/home/legacy-recovery.d.ts +5 -0
- package/dist/home/legacy-recovery.js +154 -0
- package/dist/home/legacy-recovery.js.map +1 -0
- package/dist/home/legacy-source.d.ts +15 -0
- package/dist/home/legacy-source.js +57 -0
- package/dist/home/legacy-source.js.map +1 -0
- package/dist/home/migrate.d.ts +19 -0
- package/dist/home/migrate.js +322 -0
- package/dist/home/migrate.js.map +1 -0
- package/dist/home/migration-account-source.d.ts +2 -0
- package/dist/home/migration-account-source.js +17 -0
- package/dist/home/migration-account-source.js.map +1 -0
- package/dist/home/migration-accounts.d.ts +23 -0
- package/dist/home/migration-accounts.js +174 -0
- package/dist/home/migration-accounts.js.map +1 -0
- package/dist/home/migration-boot.d.ts +23 -0
- package/dist/home/migration-boot.js +84 -0
- package/dist/home/migration-boot.js.map +1 -0
- package/dist/home/migration-claim.d.ts +4 -0
- package/dist/home/migration-claim.js +69 -0
- package/dist/home/migration-claim.js.map +1 -0
- package/dist/home/migration-cli.d.ts +3 -0
- package/dist/home/migration-cli.js +64 -0
- package/dist/home/migration-cli.js.map +1 -0
- package/dist/home/migration-files.d.ts +14 -0
- package/dist/home/migration-files.js +192 -0
- package/dist/home/migration-files.js.map +1 -0
- package/dist/home/migration-guard.d.ts +2 -0
- package/dist/home/migration-guard.js +20 -0
- package/dist/home/migration-guard.js.map +1 -0
- package/dist/home/migration-plan.d.ts +20 -0
- package/dist/home/migration-plan.js +71 -0
- package/dist/home/migration-plan.js.map +1 -0
- package/dist/home/migration-record.d.ts +79 -0
- package/dist/home/migration-record.js +39 -0
- package/dist/home/migration-record.js.map +1 -0
- package/dist/home/private-files.d.ts +13 -0
- package/dist/home/private-files.js +113 -0
- package/dist/home/private-files.js.map +1 -0
- package/dist/home/process-identity.d.ts +2 -0
- package/dist/home/process-identity.js +8 -0
- package/dist/home/process-identity.js.map +1 -0
- package/dist/home/protected-roots.d.ts +25 -0
- package/dist/home/protected-roots.js +91 -0
- package/dist/home/protected-roots.js.map +1 -0
- package/dist/home/recovery-watch.d.ts +3 -0
- package/dist/home/recovery-watch.js +75 -0
- package/dist/home/recovery-watch.js.map +1 -0
- package/dist/home/recovery.d.ts +10 -0
- package/dist/home/recovery.js +94 -0
- package/dist/home/recovery.js.map +1 -0
- package/dist/home/registry-content.d.ts +2 -0
- package/dist/home/registry-content.js +17 -0
- package/dist/home/registry-content.js.map +1 -0
- package/dist/home/reset-detection.d.ts +5 -0
- package/dist/home/reset-detection.js +22 -0
- package/dist/home/reset-detection.js.map +1 -0
- package/dist/home/resolve.d.ts +10 -0
- package/dist/home/resolve.js +28 -0
- package/dist/home/resolve.js.map +1 -0
- package/dist/home/store.d.ts +48 -0
- package/dist/home/store.js +324 -0
- package/dist/home/store.js.map +1 -0
- package/dist/home/switch.d.ts +2 -0
- package/dist/home/switch.js +3 -0
- package/dist/home/switch.js.map +1 -0
- package/dist/home/version-log.d.ts +48 -0
- package/dist/home/version-log.js +216 -0
- package/dist/home/version-log.js.map +1 -0
- package/dist/home/write-lock.d.ts +6 -0
- package/dist/home/write-lock.js +96 -0
- package/dist/home/write-lock.js.map +1 -0
- package/dist/hsq.d.ts +2 -0
- package/dist/hsq.js +3 -0
- package/dist/hsq.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +123 -0
- package/dist/index.js.map +1 -0
- package/dist/install-as-command.d.ts +32 -0
- package/dist/install-as-command.js +55 -0
- package/dist/install-as-command.js.map +1 -0
- package/dist/jobs/cli.d.ts +2 -0
- package/dist/jobs/cli.js +53 -0
- package/dist/jobs/cli.js.map +1 -0
- package/dist/jobs/command.d.ts +9 -0
- package/dist/jobs/command.js +19 -0
- package/dist/jobs/command.js.map +1 -0
- package/dist/jobs/job.d.ts +77 -0
- package/dist/jobs/job.js +252 -0
- package/dist/jobs/job.js.map +1 -0
- package/dist/merge-observations.d.ts +13 -0
- package/dist/merge-observations.js +55 -0
- package/dist/merge-observations.js.map +1 -0
- package/dist/merged-streams.d.ts +13 -0
- package/dist/merged-streams.js +33 -0
- package/dist/merged-streams.js.map +1 -0
- package/dist/open-url.d.ts +2 -0
- package/dist/open-url.js +10 -0
- package/dist/open-url.js.map +1 -0
- package/dist/pack-check.d.ts +17 -0
- package/dist/pack-check.js +27 -0
- package/dist/pack-check.js.map +1 -0
- package/dist/paths.d.ts +118 -0
- package/dist/paths.js +192 -0
- package/dist/paths.js.map +1 -0
- package/dist/planner.d.ts +30 -0
- package/dist/planner.js +270 -0
- package/dist/planner.js.map +1 -0
- package/dist/preview/agent-address.d.ts +34 -0
- package/dist/preview/agent-address.js +52 -0
- package/dist/preview/agent-address.js.map +1 -0
- package/dist/preview/agent-marker.d.ts +17 -0
- package/dist/preview/agent-marker.js +71 -0
- package/dist/preview/agent-marker.js.map +1 -0
- package/dist/preview/browser-launch.d.ts +28 -0
- package/dist/preview/browser-launch.js +64 -0
- package/dist/preview/browser-launch.js.map +1 -0
- package/dist/preview/cdp-proxy.d.ts +54 -0
- package/dist/preview/cdp-proxy.js +152 -0
- package/dist/preview/cdp-proxy.js.map +1 -0
- package/dist/preview/cdp.d.ts +49 -0
- package/dist/preview/cdp.js +167 -0
- package/dist/preview/cdp.js.map +1 -0
- package/dist/preview/chromium-launch-progress.d.ts +10 -0
- package/dist/preview/chromium-launch-progress.js +48 -0
- package/dist/preview/chromium-launch-progress.js.map +1 -0
- package/dist/preview/chromium.d.ts +91 -0
- package/dist/preview/chromium.js +500 -0
- package/dist/preview/chromium.js.map +1 -0
- package/dist/preview/density.d.ts +17 -0
- package/dist/preview/density.js +62 -0
- package/dist/preview/density.js.map +1 -0
- package/dist/preview/dev-server.d.ts +68 -0
- package/dist/preview/dev-server.js +318 -0
- package/dist/preview/dev-server.js.map +1 -0
- package/dist/preview/host.d.ts +215 -0
- package/dist/preview/host.js +954 -0
- package/dist/preview/host.js.map +1 -0
- package/dist/preview/registration.d.ts +68 -0
- package/dist/preview/registration.js +111 -0
- package/dist/preview/registration.js.map +1 -0
- package/dist/preview/run-tools.d.ts +9 -0
- package/dist/preview/run-tools.js +72 -0
- package/dist/preview/run-tools.js.map +1 -0
- package/dist/preview/session.d.ts +139 -0
- package/dist/preview/session.js +479 -0
- package/dist/preview/session.js.map +1 -0
- package/dist/preview/url.d.ts +6 -0
- package/dist/preview/url.js +17 -0
- package/dist/preview/url.js.map +1 -0
- package/dist/process-wait/exit-file.d.ts +29 -0
- package/dist/process-wait/exit-file.js +67 -0
- package/dist/process-wait/exit-file.js.map +1 -0
- package/dist/process-wait/supervisor.d.ts +30 -0
- package/dist/process-wait/supervisor.js +71 -0
- package/dist/process-wait/supervisor.js.map +1 -0
- package/dist/project-commands.d.ts +14 -0
- package/dist/project-commands.js +91 -0
- package/dist/project-commands.js.map +1 -0
- package/dist/project-migration/answer.d.ts +23 -0
- package/dist/project-migration/answer.js +37 -0
- package/dist/project-migration/answer.js.map +1 -0
- package/dist/project-migration/auto.d.ts +73 -0
- package/dist/project-migration/auto.js +161 -0
- package/dist/project-migration/auto.js.map +1 -0
- package/dist/project-migration/cli.d.ts +18 -0
- package/dist/project-migration/cli.js +57 -0
- package/dist/project-migration/cli.js.map +1 -0
- package/dist/project-migration/containment.d.ts +52 -0
- package/dist/project-migration/containment.js +200 -0
- package/dist/project-migration/containment.js.map +1 -0
- package/dist/project-migration/durable.d.ts +25 -0
- package/dist/project-migration/durable.js +69 -0
- package/dist/project-migration/durable.js.map +1 -0
- package/dist/project-migration/engine.d.ts +47 -0
- package/dist/project-migration/engine.js +103 -0
- package/dist/project-migration/engine.js.map +1 -0
- package/dist/project-migration/fresh.d.ts +4 -0
- package/dist/project-migration/fresh.js +25 -0
- package/dist/project-migration/fresh.js.map +1 -0
- package/dist/project-migration/journal.d.ts +139 -0
- package/dist/project-migration/journal.js +69 -0
- package/dist/project-migration/journal.js.map +1 -0
- package/dist/project-migration/live.d.ts +48 -0
- package/dist/project-migration/live.js +148 -0
- package/dist/project-migration/live.js.map +1 -0
- package/dist/project-migration/offline.d.ts +25 -0
- package/dist/project-migration/offline.js +54 -0
- package/dist/project-migration/offline.js.map +1 -0
- package/dist/project-migration/plan.d.ts +91 -0
- package/dist/project-migration/plan.js +466 -0
- package/dist/project-migration/plan.js.map +1 -0
- package/dist/project-migration/recovery.d.ts +28 -0
- package/dist/project-migration/recovery.js +78 -0
- package/dist/project-migration/recovery.js.map +1 -0
- package/dist/project-migration/steps.d.ts +18 -0
- package/dist/project-migration/steps.js +312 -0
- package/dist/project-migration/steps.js.map +1 -0
- package/dist/project-paths.d.ts +61 -0
- package/dist/project-paths.js +185 -0
- package/dist/project-paths.js.map +1 -0
- package/dist/release/compatibility.d.ts +12 -0
- package/dist/release/compatibility.js +62 -0
- package/dist/release/compatibility.js.map +1 -0
- package/dist/release/manifests.d.ts +112 -0
- package/dist/release/manifests.js +104 -0
- package/dist/release/manifests.js.map +1 -0
- package/dist/release/publication.d.ts +3 -0
- package/dist/release/publication.js +34 -0
- package/dist/release/publication.js.map +1 -0
- package/dist/release/snapshot.d.ts +67 -0
- package/dist/release/snapshot.js +97 -0
- package/dist/release/snapshot.js.map +1 -0
- package/dist/release/stable.d.ts +38 -0
- package/dist/release/stable.js +55 -0
- package/dist/release/stable.js.map +1 -0
- package/dist/remote-settings-cli.d.ts +24 -0
- package/dist/remote-settings-cli.js +156 -0
- package/dist/remote-settings-cli.js.map +1 -0
- package/dist/remote-settings.d.ts +41 -0
- package/dist/remote-settings.js +110 -0
- package/dist/remote-settings.js.map +1 -0
- package/dist/runs/agent-tmpdir-removal.d.ts +15 -0
- package/dist/runs/agent-tmpdir-removal.js +60 -0
- package/dist/runs/agent-tmpdir-removal.js.map +1 -0
- package/dist/runs/agent-tmpdir.d.ts +119 -0
- package/dist/runs/agent-tmpdir.js +855 -0
- package/dist/runs/agent-tmpdir.js.map +1 -0
- package/dist/runs/archive-family.d.ts +33 -0
- package/dist/runs/archive-family.js +90 -0
- package/dist/runs/archive-family.js.map +1 -0
- package/dist/runs/arm-repo-handle.d.ts +10 -0
- package/dist/runs/arm-repo-handle.js +45 -0
- package/dist/runs/arm-repo-handle.js.map +1 -0
- package/dist/runs/auto-name.d.ts +77 -0
- package/dist/runs/auto-name.js +179 -0
- package/dist/runs/auto-name.js.map +1 -0
- package/dist/runs/claim-families.d.ts +37 -0
- package/dist/runs/claim-families.js +101 -0
- package/dist/runs/claim-families.js.map +1 -0
- package/dist/runs/client-request.d.ts +11 -0
- package/dist/runs/client-request.js +26 -0
- package/dist/runs/client-request.js.map +1 -0
- package/dist/runs/cold-reads.d.ts +40 -0
- package/dist/runs/cold-reads.js +56 -0
- package/dist/runs/cold-reads.js.map +1 -0
- package/dist/runs/conversation-identity.d.ts +19 -0
- package/dist/runs/conversation-identity.js +31 -0
- package/dist/runs/conversation-identity.js.map +1 -0
- package/dist/runs/delegation-state.d.ts +409 -0
- package/dist/runs/delegation-state.js +22 -0
- package/dist/runs/delegation-state.js.map +1 -0
- package/dist/runs/event-history-agent-context.d.ts +15 -0
- package/dist/runs/event-history-agent-context.js +119 -0
- package/dist/runs/event-history-agent-context.js.map +1 -0
- package/dist/runs/event-history-context.d.ts +15 -0
- package/dist/runs/event-history-context.js +109 -0
- package/dist/runs/event-history-context.js.map +1 -0
- package/dist/runs/event-history.d.ts +53 -0
- package/dist/runs/event-history.js +563 -0
- package/dist/runs/event-history.js.map +1 -0
- package/dist/runs/exit-events.d.ts +27 -0
- package/dist/runs/exit-events.js +46 -0
- package/dist/runs/exit-events.js.map +1 -0
- package/dist/runs/history-compressor.d.ts +29 -0
- package/dist/runs/history-compressor.js +116 -0
- package/dist/runs/history-compressor.js.map +1 -0
- package/dist/runs/history-file.d.ts +36 -0
- package/dist/runs/history-file.js +464 -0
- package/dist/runs/history-file.js.map +1 -0
- package/dist/runs/history-stream.d.ts +2 -0
- package/dist/runs/history-stream.js +62 -0
- package/dist/runs/history-stream.js.map +1 -0
- package/dist/runs/legacy-index.d.ts +49 -0
- package/dist/runs/legacy-index.js +156 -0
- package/dist/runs/legacy-index.js.map +1 -0
- package/dist/runs/legacy-run-rows.d.ts +12 -0
- package/dist/runs/legacy-run-rows.js +33 -0
- package/dist/runs/legacy-run-rows.js.map +1 -0
- package/dist/runs/legacy-waits.d.ts +64 -0
- package/dist/runs/legacy-waits.js +335 -0
- package/dist/runs/legacy-waits.js.map +1 -0
- package/dist/runs/live-item-snapshots.d.ts +15 -0
- package/dist/runs/live-item-snapshots.js +95 -0
- package/dist/runs/live-item-snapshots.js.map +1 -0
- package/dist/runs/loaded-run-exits.d.ts +6 -0
- package/dist/runs/loaded-run-exits.js +32 -0
- package/dist/runs/loaded-run-exits.js.map +1 -0
- package/dist/runs/loaded-run-healing.d.ts +3 -0
- package/dist/runs/loaded-run-healing.js +17 -0
- package/dist/runs/loaded-run-healing.js.map +1 -0
- package/dist/runs/outcome-commit.d.ts +119 -0
- package/dist/runs/outcome-commit.js +155 -0
- package/dist/runs/outcome-commit.js.map +1 -0
- package/dist/runs/owned-run-create.d.ts +33 -0
- package/dist/runs/owned-run-create.js +98 -0
- package/dist/runs/owned-run-create.js.map +1 -0
- package/dist/runs/project-run-connection.d.ts +76 -0
- package/dist/runs/project-run-connection.js +287 -0
- package/dist/runs/project-run-connection.js.map +1 -0
- package/dist/runs/project-run-sources.d.ts +21 -0
- package/dist/runs/project-run-sources.js +86 -0
- package/dist/runs/project-run-sources.js.map +1 -0
- package/dist/runs/pull-requests.d.ts +14 -0
- package/dist/runs/pull-requests.js +96 -0
- package/dist/runs/pull-requests.js.map +1 -0
- package/dist/runs/raw-record.d.ts +40 -0
- package/dist/runs/raw-record.js +133 -0
- package/dist/runs/raw-record.js.map +1 -0
- package/dist/runs/record-write-rules.d.ts +129 -0
- package/dist/runs/record-write-rules.js +326 -0
- package/dist/runs/record-write-rules.js.map +1 -0
- package/dist/runs/report-rows.d.ts +36 -0
- package/dist/runs/report-rows.js +102 -0
- package/dist/runs/report-rows.js.map +1 -0
- package/dist/runs/retention.d.ts +91 -0
- package/dist/runs/retention.js +193 -0
- package/dist/runs/retention.js.map +1 -0
- package/dist/runs/review-gate.d.ts +18 -0
- package/dist/runs/review-gate.js +22 -0
- package/dist/runs/review-gate.js.map +1 -0
- package/dist/runs/run-claims.d.ts +30 -0
- package/dist/runs/run-claims.js +52 -0
- package/dist/runs/run-claims.js.map +1 -0
- package/dist/runs/run-database-peer-page.d.ts +12 -0
- package/dist/runs/run-database-peer-page.js +25 -0
- package/dist/runs/run-database-peer-page.js.map +1 -0
- package/dist/runs/run-database-row.d.ts +39 -0
- package/dist/runs/run-database-row.js +83 -0
- package/dist/runs/run-database-row.js.map +1 -0
- package/dist/runs/run-database-version.d.ts +14 -0
- package/dist/runs/run-database-version.js +19 -0
- package/dist/runs/run-database-version.js.map +1 -0
- package/dist/runs/run-database.d.ts +389 -0
- package/dist/runs/run-database.js +957 -0
- package/dist/runs/run-database.js.map +1 -0
- package/dist/runs/run-exits.d.ts +4510 -0
- package/dist/runs/run-exits.js +191 -0
- package/dist/runs/run-exits.js.map +1 -0
- package/dist/runs/run-index.d.ts +36 -0
- package/dist/runs/run-index.js +262 -0
- package/dist/runs/run-index.js.map +1 -0
- package/dist/runs/run-references.d.ts +61 -0
- package/dist/runs/run-references.js +421 -0
- package/dist/runs/run-references.js.map +1 -0
- package/dist/runs/run-row.d.ts +14 -0
- package/dist/runs/run-row.js +56 -0
- package/dist/runs/run-row.js.map +1 -0
- package/dist/runs/run-summary-page.d.ts +36 -0
- package/dist/runs/run-summary-page.js +46 -0
- package/dist/runs/run-summary-page.js.map +1 -0
- package/dist/runs/run-title.d.ts +8 -0
- package/dist/runs/run-title.js +28 -0
- package/dist/runs/run-title.js.map +1 -0
- package/dist/runs/store-open-error.d.ts +24 -0
- package/dist/runs/store-open-error.js +62 -0
- package/dist/runs/store-open-error.js.map +1 -0
- package/dist/runs/store.d.ts +3974 -0
- package/dist/runs/store.js +3516 -0
- package/dist/runs/store.js.map +1 -0
- package/dist/runs/task-markers.d.ts +29 -0
- package/dist/runs/task-markers.js +78 -0
- package/dist/runs/task-markers.js.map +1 -0
- package/dist/runs/task-refs.d.ts +39 -0
- package/dist/runs/task-refs.js +107 -0
- package/dist/runs/task-refs.js.map +1 -0
- package/dist/runs/transcript-facts-fold.d.ts +64 -0
- package/dist/runs/transcript-facts-fold.js +109 -0
- package/dist/runs/transcript-facts-fold.js.map +1 -0
- package/dist/runs/transcript-facts-load.d.ts +11 -0
- package/dist/runs/transcript-facts-load.js +66 -0
- package/dist/runs/transcript-facts-load.js.map +1 -0
- package/dist/runs/transcript-facts-queue.d.ts +30 -0
- package/dist/runs/transcript-facts-queue.js +227 -0
- package/dist/runs/transcript-facts-queue.js.map +1 -0
- package/dist/runs/transcript-facts-worker.d.ts +15 -0
- package/dist/runs/transcript-facts-worker.js +26 -0
- package/dist/runs/transcript-facts-worker.js.map +1 -0
- package/dist/runs/transcript-facts.d.ts +40 -0
- package/dist/runs/transcript-facts.js +193 -0
- package/dist/runs/transcript-facts.js.map +1 -0
- package/dist/runs/ui-event-sink.d.ts +59 -0
- package/dist/runs/ui-event-sink.js +197 -0
- package/dist/runs/ui-event-sink.js.map +1 -0
- package/dist/runs/wait-capacity.d.ts +8 -0
- package/dist/runs/wait-capacity.js +28 -0
- package/dist/runs/wait-capacity.js.map +1 -0
- package/dist/runs/wait-phases.d.ts +4 -0
- package/dist/runs/wait-phases.js +11 -0
- package/dist/runs/wait-phases.js.map +1 -0
- package/dist/runs/wait-registration-write.d.ts +5 -0
- package/dist/runs/wait-registration-write.js +35 -0
- package/dist/runs/wait-registration-write.js.map +1 -0
- package/dist/runs/webhook.d.ts +193 -0
- package/dist/runs/webhook.js +362 -0
- package/dist/runs/webhook.js.map +1 -0
- package/dist/runs/worker-deletion-proof.d.ts +13 -0
- package/dist/runs/worker-deletion-proof.js +13 -0
- package/dist/runs/worker-deletion-proof.js.map +1 -0
- package/dist/runs/worker-execution.d.ts +22 -0
- package/dist/runs/worker-execution.js +30 -0
- package/dist/runs/worker-execution.js.map +1 -0
- package/dist/runs/worker-resource-holders.d.ts +17 -0
- package/dist/runs/worker-resource-holders.js +34 -0
- package/dist/runs/worker-resource-holders.js.map +1 -0
- package/dist/runs/worker-result-commit.d.ts +26 -0
- package/dist/runs/worker-result-commit.js +121 -0
- package/dist/runs/worker-result-commit.js.map +1 -0
- package/dist/self-update/checkouts.d.ts +46 -0
- package/dist/self-update/checkouts.js +284 -0
- package/dist/self-update/checkouts.js.map +1 -0
- package/dist/self-update/cli.d.ts +19 -0
- package/dist/self-update/cli.js +243 -0
- package/dist/self-update/cli.js.map +1 -0
- package/dist/self-update/installer.d.ts +24 -0
- package/dist/self-update/installer.js +139 -0
- package/dist/self-update/installer.js.map +1 -0
- package/dist/self-update/launcher.d.ts +30 -0
- package/dist/self-update/launcher.js +172 -0
- package/dist/self-update/launcher.js.map +1 -0
- package/dist/self-update/layout.d.ts +108 -0
- package/dist/self-update/layout.js +276 -0
- package/dist/self-update/layout.js.map +1 -0
- package/dist/self-update/pulls.d.ts +30 -0
- package/dist/self-update/pulls.js +128 -0
- package/dist/self-update/pulls.js.map +1 -0
- package/dist/self-update/registry.d.ts +37 -0
- package/dist/self-update/registry.js +86 -0
- package/dist/self-update/registry.js.map +1 -0
- package/dist/self-update/restart.d.ts +25 -0
- package/dist/self-update/restart.js +79 -0
- package/dist/self-update/restart.js.map +1 -0
- package/dist/self-update/semver.d.ts +19 -0
- package/dist/self-update/semver.js +79 -0
- package/dist/self-update/semver.js.map +1 -0
- package/dist/self-update/service.d.ts +115 -0
- package/dist/self-update/service.js +332 -0
- package/dist/self-update/service.js.map +1 -0
- package/dist/self-update/supervisor.d.ts +10 -0
- package/dist/self-update/supervisor.js +52 -0
- package/dist/self-update/supervisor.js.map +1 -0
- package/dist/serve-boot.d.ts +60 -0
- package/dist/serve-boot.js +142 -0
- package/dist/serve-boot.js.map +1 -0
- package/dist/serve-command.d.ts +71 -0
- package/dist/serve-command.js +168 -0
- package/dist/serve-command.js.map +1 -0
- package/dist/serve-listener.d.ts +12 -0
- package/dist/serve-listener.js +52 -0
- package/dist/serve-listener.js.map +1 -0
- package/dist/server/activity-project-topic.d.ts +44 -0
- package/dist/server/activity-project-topic.js +137 -0
- package/dist/server/activity-project-topic.js.map +1 -0
- package/dist/server/activity-routes.d.ts +317 -0
- package/dist/server/activity-routes.js +117 -0
- package/dist/server/activity-routes.js.map +1 -0
- package/dist/server/activity-sources.d.ts +26 -0
- package/dist/server/activity-sources.js +45 -0
- package/dist/server/activity-sources.js.map +1 -0
- package/dist/server/activity-topic.d.ts +33 -0
- package/dist/server/activity-topic.js +48 -0
- package/dist/server/activity-topic.js.map +1 -0
- package/dist/server/app-type.d.ts +6 -0
- package/dist/server/app-type.js +2 -0
- package/dist/server/app-type.js.map +1 -0
- package/dist/server/archive-on-merge.d.ts +45 -0
- package/dist/server/archive-on-merge.js +242 -0
- package/dist/server/archive-on-merge.js.map +1 -0
- package/dist/server/automation-log-retry.d.ts +27 -0
- package/dist/server/automation-log-retry.js +88 -0
- package/dist/server/automation-log-retry.js.map +1 -0
- package/dist/server/capabilities.d.ts +69 -0
- package/dist/server/capabilities.js +111 -0
- package/dist/server/capabilities.js.map +1 -0
- package/dist/server/checkout-progress.d.ts +10 -0
- package/dist/server/checkout-progress.js +27 -0
- package/dist/server/checkout-progress.js.map +1 -0
- package/dist/server/checkout.d.ts +153 -0
- package/dist/server/checkout.js +323 -0
- package/dist/server/checkout.js.map +1 -0
- package/dist/server/cockpit-ownership.d.ts +112 -0
- package/dist/server/cockpit-ownership.js +420 -0
- package/dist/server/cockpit-ownership.js.map +1 -0
- package/dist/server/cold-repo-handles.d.ts +17 -0
- package/dist/server/cold-repo-handles.js +82 -0
- package/dist/server/cold-repo-handles.js.map +1 -0
- package/dist/server/completion-actions.d.ts +37 -0
- package/dist/server/completion-actions.js +261 -0
- package/dist/server/completion-actions.js.map +1 -0
- package/dist/server/config-merge.d.ts +11 -0
- package/dist/server/config-merge.js +74 -0
- package/dist/server/config-merge.js.map +1 -0
- package/dist/server/create-project.d.ts +71 -0
- package/dist/server/create-project.js +467 -0
- package/dist/server/create-project.js.map +1 -0
- package/dist/server/forge/draft-pr.d.ts +8 -0
- package/dist/server/forge/draft-pr.js +123 -0
- package/dist/server/forge/draft-pr.js.map +1 -0
- package/dist/server/forge/github-filters.d.ts +22 -0
- package/dist/server/forge/github-filters.js +128 -0
- package/dist/server/forge/github-filters.js.map +1 -0
- package/dist/server/forge/github-merge-requirements.d.ts +18 -0
- package/dist/server/forge/github-merge-requirements.js +148 -0
- package/dist/server/forge/github-merge-requirements.js.map +1 -0
- package/dist/server/forge/github-merge-state.d.ts +27 -0
- package/dist/server/forge/github-merge-state.js +248 -0
- package/dist/server/forge/github-merge-state.js.map +1 -0
- package/dist/server/forge/github-timeline.d.ts +117 -0
- package/dist/server/forge/github-timeline.js +273 -0
- package/dist/server/forge/github-timeline.js.map +1 -0
- package/dist/server/forge/github.d.ts +393 -0
- package/dist/server/forge/github.js +2881 -0
- package/dist/server/forge/github.js.map +1 -0
- package/dist/server/forge/index.d.ts +47 -0
- package/dist/server/forge/index.js +81 -0
- package/dist/server/forge/index.js.map +1 -0
- package/dist/server/forge/repo-handle-discovery.d.ts +16 -0
- package/dist/server/forge/repo-handle-discovery.js +2 -0
- package/dist/server/forge/repo-handle-discovery.js.map +1 -0
- package/dist/server/forge/types.d.ts +278 -0
- package/dist/server/forge/types.js +2 -0
- package/dist/server/forge/types.js.map +1 -0
- package/dist/server/fs-browse.d.ts +82 -0
- package/dist/server/fs-browse.js +217 -0
- package/dist/server/fs-browse.js.map +1 -0
- package/dist/server/git-changes.d.ts +205 -0
- package/dist/server/git-changes.js +531 -0
- package/dist/server/git-changes.js.map +1 -0
- package/dist/server/git.d.ts +52 -0
- package/dist/server/git.js +174 -0
- package/dist/server/git.js.map +1 -0
- package/dist/server/home-recovery-routes.d.ts +171 -0
- package/dist/server/home-recovery-routes.js +56 -0
- package/dist/server/home-recovery-routes.js.map +1 -0
- package/dist/server/launch-key.d.ts +5 -0
- package/dist/server/launch-key.js +35 -0
- package/dist/server/launch-key.js.map +1 -0
- package/dist/server/live-routes.d.ts +73 -0
- package/dist/server/live-routes.js +161 -0
- package/dist/server/live-routes.js.map +1 -0
- package/dist/server/open-in-app.d.ts +57 -0
- package/dist/server/open-in-app.js +178 -0
- package/dist/server/open-in-app.js.map +1 -0
- package/dist/server/open-in-targets.d.ts +53 -0
- package/dist/server/open-in-targets.js +112 -0
- package/dist/server/open-in-targets.js.map +1 -0
- package/dist/server/open-in-terminal.d.ts +73 -0
- package/dist/server/open-in-terminal.js +160 -0
- package/dist/server/open-in-terminal.js.map +1 -0
- package/dist/server/preview-cdp-socket.d.ts +21 -0
- package/dist/server/preview-cdp-socket.js +112 -0
- package/dist/server/preview-cdp-socket.js.map +1 -0
- package/dist/server/preview-socket.d.ts +36 -0
- package/dist/server/preview-socket.js +142 -0
- package/dist/server/preview-socket.js.map +1 -0
- package/dist/server/preview-sockets.d.ts +14 -0
- package/dist/server/preview-sockets.js +18 -0
- package/dist/server/preview-sockets.js.map +1 -0
- package/dist/server/project-context.d.ts +218 -0
- package/dist/server/project-context.js +525 -0
- package/dist/server/project-context.js.map +1 -0
- package/dist/server/project-run-files.d.ts +13 -0
- package/dist/server/project-run-files.js +52 -0
- package/dist/server/project-run-files.js.map +1 -0
- package/dist/server/provider-action-gate.d.ts +5 -0
- package/dist/server/provider-action-gate.js +28 -0
- package/dist/server/provider-action-gate.js.map +1 -0
- package/dist/server/provider-auth-runtime.d.ts +34 -0
- package/dist/server/provider-auth-runtime.js +118 -0
- package/dist/server/provider-auth-runtime.js.map +1 -0
- package/dist/server/repo-branch-forge.d.ts +61 -0
- package/dist/server/repo-branch-forge.js +158 -0
- package/dist/server/repo-branch-forge.js.map +1 -0
- package/dist/server/repo-branch-sweep.d.ts +21 -0
- package/dist/server/repo-branch-sweep.js +64 -0
- package/dist/server/repo-branch-sweep.js.map +1 -0
- package/dist/server/repo-branches.d.ts +103 -0
- package/dist/server/repo-branches.js +804 -0
- package/dist/server/repo-branches.js.map +1 -0
- package/dist/server/repo-pull.d.ts +18 -0
- package/dist/server/repo-pull.js +97 -0
- package/dist/server/repo-pull.js.map +1 -0
- package/dist/server/reports-api.d.ts +90 -0
- package/dist/server/reports-api.js +21 -0
- package/dist/server/reports-api.js.map +1 -0
- package/dist/server/reports-topic.d.ts +5 -0
- package/dist/server/reports-topic.js +37 -0
- package/dist/server/reports-topic.js.map +1 -0
- package/dist/server/run-checkout.d.ts +56 -0
- package/dist/server/run-checkout.js +141 -0
- package/dist/server/run-checkout.js.map +1 -0
- package/dist/server/run-event-feed.d.ts +20 -0
- package/dist/server/run-event-feed.js +203 -0
- package/dist/server/run-event-feed.js.map +1 -0
- package/dist/server/self-update-routes.d.ts +308 -0
- package/dist/server/self-update-routes.js +80 -0
- package/dist/server/self-update-routes.js.map +1 -0
- package/dist/server/server-deps.d.ts +40 -0
- package/dist/server/server-deps.js +132 -0
- package/dist/server/server-deps.js.map +1 -0
- package/dist/server/server.d.ts +35332 -0
- package/dist/server/server.js +5046 -0
- package/dist/server/server.js.map +1 -0
- package/dist/server/skill-sources.d.ts +264 -0
- package/dist/server/skill-sources.js +130 -0
- package/dist/server/skill-sources.js.map +1 -0
- package/dist/server/start-run-options.d.ts +84 -0
- package/dist/server/start-run-options.js +114 -0
- package/dist/server/start-run-options.js.map +1 -0
- package/dist/server/static-ui.d.ts +49 -0
- package/dist/server/static-ui.js +99 -0
- package/dist/server/static-ui.js.map +1 -0
- package/dist/server/upgrade-router.d.ts +23 -0
- package/dist/server/upgrade-router.js +53 -0
- package/dist/server/upgrade-router.js.map +1 -0
- package/dist/server/validators.d.ts +80 -0
- package/dist/server/validators.js +85 -0
- package/dist/server/validators.js.map +1 -0
- package/dist/server/workflow-files.d.ts +9 -0
- package/dist/server/workflow-files.js +27 -0
- package/dist/server/workflow-files.js.map +1 -0
- package/dist/server/workspace-config-patch.d.ts +11 -0
- package/dist/server/workspace-config-patch.js +75 -0
- package/dist/server/workspace-config-patch.js.map +1 -0
- package/dist/server/workspace-live-routes.d.ts +222 -0
- package/dist/server/workspace-live-routes.js +8 -0
- package/dist/server/workspace-live-routes.js.map +1 -0
- package/dist/server/workspace-projects.d.ts +51 -0
- package/dist/server/workspace-projects.js +161 -0
- package/dist/server/workspace-projects.js.map +1 -0
- package/dist/server/workspace-run-feed.d.ts +66 -0
- package/dist/server/workspace-run-feed.js +171 -0
- package/dist/server/workspace-run-feed.js.map +1 -0
- package/dist/server/ws.d.ts +80 -0
- package/dist/server/ws.js +280 -0
- package/dist/server/ws.js.map +1 -0
- package/dist/server/wsl.d.ts +25 -0
- package/dist/server/wsl.js +92 -0
- package/dist/server/wsl.js.map +1 -0
- package/dist/server-command.d.ts +53 -0
- package/dist/server-command.js +180 -0
- package/dist/server-command.js.map +1 -0
- package/dist/server-install/engine.d.ts +51 -0
- package/dist/server-install/engine.js +358 -0
- package/dist/server-install/engine.js.map +1 -0
- package/dist/server-install/group-migrate.d.ts +26 -0
- package/dist/server-install/group-migrate.js +241 -0
- package/dist/server-install/group-migrate.js.map +1 -0
- package/dist/server-install/migrate-cli.d.ts +12 -0
- package/dist/server-install/migrate-cli.js +44 -0
- package/dist/server-install/migrate-cli.js.map +1 -0
- package/dist/server-install/migrate-journal.d.ts +15 -0
- package/dist/server-install/migrate-journal.js +48 -0
- package/dist/server-install/migrate-journal.js.map +1 -0
- package/dist/server-install/migration-report.d.ts +3 -0
- package/dist/server-install/migration-report.js +21 -0
- package/dist/server-install/migration-report.js.map +1 -0
- package/dist/server-install/npx-cache.d.ts +34 -0
- package/dist/server-install/npx-cache.js +142 -0
- package/dist/server-install/npx-cache.js.map +1 -0
- package/dist/server-install/platforms/macosx-launchd-files.d.ts +11 -0
- package/dist/server-install/platforms/macosx-launchd-files.js +60 -0
- package/dist/server-install/platforms/macosx-launchd-files.js.map +1 -0
- package/dist/server-install/platforms/macosx-migration.d.ts +17 -0
- package/dist/server-install/platforms/macosx-migration.js +239 -0
- package/dist/server-install/platforms/macosx-migration.js.map +1 -0
- package/dist/server-install/platforms/macosx-ngrok.d.ts +12 -0
- package/dist/server-install/platforms/macosx-ngrok.js +490 -0
- package/dist/server-install/platforms/macosx-ngrok.js.map +1 -0
- package/dist/server-install/platforms/service-env.d.ts +4 -0
- package/dist/server-install/platforms/service-env.js +17 -0
- package/dist/server-install/platforms/service-env.js.map +1 -0
- package/dist/server-install/platforms/ubuntu-vps-files.d.ts +18 -0
- package/dist/server-install/platforms/ubuntu-vps-files.js +43 -0
- package/dist/server-install/platforms/ubuntu-vps-files.js.map +1 -0
- package/dist/server-install/platforms/ubuntu-vps-migration.d.ts +26 -0
- package/dist/server-install/platforms/ubuntu-vps-migration.js +391 -0
- package/dist/server-install/platforms/ubuntu-vps-migration.js.map +1 -0
- package/dist/server-install/platforms/ubuntu-vps-names.d.ts +30 -0
- package/dist/server-install/platforms/ubuntu-vps-names.js +50 -0
- package/dist/server-install/platforms/ubuntu-vps-names.js.map +1 -0
- package/dist/server-install/platforms/ubuntu-vps-redeploy.d.ts +42 -0
- package/dist/server-install/platforms/ubuntu-vps-redeploy.js +127 -0
- package/dist/server-install/platforms/ubuntu-vps-redeploy.js.map +1 -0
- package/dist/server-install/platforms/ubuntu-vps.d.ts +57 -0
- package/dist/server-install/platforms/ubuntu-vps.js +945 -0
- package/dist/server-install/platforms/ubuntu-vps.js.map +1 -0
- package/dist/server-install/state.d.ts +51 -0
- package/dist/server-install/state.js +178 -0
- package/dist/server-install/state.js.map +1 -0
- package/dist/server-install/steps.d.ts +108 -0
- package/dist/server-install/steps.js +348 -0
- package/dist/server-install/steps.js.map +1 -0
- package/dist/server-install/strategies.d.ts +6 -0
- package/dist/server-install/strategies.js +24 -0
- package/dist/server-install/strategies.js.map +1 -0
- package/dist/server-install/types.d.ts +316 -0
- package/dist/server-install/types.js +118 -0
- package/dist/server-install/types.js.map +1 -0
- package/dist/server-install/ui.d.ts +36 -0
- package/dist/server-install/ui.js +131 -0
- package/dist/server-install/ui.js.map +1 -0
- package/dist/session-context.d.ts +66 -0
- package/dist/session-context.js +266 -0
- package/dist/session-context.js.map +1 -0
- package/dist/skills-provision.d.ts +64 -0
- package/dist/skills-provision.js +325 -0
- package/dist/skills-provision.js.map +1 -0
- package/dist/skills-remote.d.ts +144 -0
- package/dist/skills-remote.js +847 -0
- package/dist/skills-remote.js.map +1 -0
- package/dist/skills.d.ts +81 -0
- package/dist/skills.js +288 -0
- package/dist/skills.js.map +1 -0
- package/dist/subcommands.d.ts +12 -0
- package/dist/subcommands.js +59 -0
- package/dist/subcommands.js.map +1 -0
- package/dist/task-cli/cli.d.ts +39 -0
- package/dist/task-cli/cli.js +773 -0
- package/dist/task-cli/cli.js.map +1 -0
- package/dist/task-cli/discovery.d.ts +32 -0
- package/dist/task-cli/discovery.js +133 -0
- package/dist/task-cli/discovery.js.map +1 -0
- package/dist/task-cli/hint.d.ts +20 -0
- package/dist/task-cli/hint.js +15 -0
- package/dist/task-cli/hint.js.map +1 -0
- package/dist/task-cli/http.d.ts +42 -0
- package/dist/task-cli/http.js +110 -0
- package/dist/task-cli/http.js.map +1 -0
- package/dist/task-cli/projections.d.ts +68 -0
- package/dist/task-cli/projections.js +76 -0
- package/dist/task-cli/projections.js.map +1 -0
- package/dist/task-cli/watch.d.ts +119 -0
- package/dist/task-cli/watch.js +494 -0
- package/dist/task-cli/watch.js.map +1 -0
- package/dist/ui-state.d.ts +41 -0
- package/dist/ui-state.js +93 -0
- package/dist/ui-state.js.map +1 -0
- package/dist/update-check.d.ts +2 -0
- package/dist/update-check.js +28 -0
- package/dist/update-check.js.map +1 -0
- package/dist/use-command-notice.d.ts +1 -0
- package/dist/use-command-notice.js +6 -0
- package/dist/use-command-notice.js.map +1 -0
- package/dist/voice/decide.d.ts +35 -0
- package/dist/voice/decide.js +329 -0
- package/dist/voice/decide.js.map +1 -0
- package/dist/voice/decision-log.d.ts +48 -0
- package/dist/voice/decision-log.js +117 -0
- package/dist/voice/decision-log.js.map +1 -0
- package/dist/voice/engine.d.ts +119 -0
- package/dist/voice/engine.js +61 -0
- package/dist/voice/engine.js.map +1 -0
- package/dist/voice/fake-engine.d.ts +10 -0
- package/dist/voice/fake-engine.js +192 -0
- package/dist/voice/fake-engine.js.map +1 -0
- package/dist/voice/jev-engine.d.ts +17 -0
- package/dist/voice/jev-engine.js +110 -0
- package/dist/voice/jev-engine.js.map +1 -0
- package/dist/voice/pending-ask.d.ts +17 -0
- package/dist/voice/pending-ask.js +51 -0
- package/dist/voice/pending-ask.js.map +1 -0
- package/dist/voice/routes.d.ts +115 -0
- package/dist/voice/routes.js +92 -0
- package/dist/voice/routes.js.map +1 -0
- package/dist/voice/sentence.d.ts +21 -0
- package/dist/voice/sentence.js +61 -0
- package/dist/voice/sentence.js.map +1 -0
- package/dist/voice/thresholds.d.ts +28 -0
- package/dist/voice/thresholds.js +29 -0
- package/dist/voice/thresholds.js.map +1 -0
- package/dist/webhooks/cli.d.ts +18 -0
- package/dist/webhooks/cli.js +127 -0
- package/dist/webhooks/cli.js.map +1 -0
- package/dist/webhooks/prompt.d.ts +5 -0
- package/dist/webhooks/prompt.js +26 -0
- package/dist/webhooks/prompt.js.map +1 -0
- package/dist/workflows/active-run.d.ts +46 -0
- package/dist/workflows/active-run.js +46 -0
- package/dist/workflows/active-run.js.map +1 -0
- package/dist/workflows/attachment-path.d.ts +6 -0
- package/dist/workflows/attachment-path.js +40 -0
- package/dist/workflows/attachment-path.js.map +1 -0
- package/dist/workflows/completion-policy.d.ts +98 -0
- package/dist/workflows/completion-policy.js +77 -0
- package/dist/workflows/completion-policy.js.map +1 -0
- package/dist/workflows/continuation-admission.d.ts +1229 -0
- package/dist/workflows/continuation-admission.js +277 -0
- package/dist/workflows/continuation-admission.js.map +1 -0
- package/dist/workflows/execution-account.d.ts +13 -0
- package/dist/workflows/execution-account.js +18 -0
- package/dist/workflows/execution-account.js.map +1 -0
- package/dist/workflows/grouped-command.d.ts +31 -0
- package/dist/workflows/grouped-command.js +147 -0
- package/dist/workflows/grouped-command.js.map +1 -0
- package/dist/workflows/input-acknowledgement.d.ts +233 -0
- package/dist/workflows/input-acknowledgement.js +41 -0
- package/dist/workflows/input-acknowledgement.js.map +1 -0
- package/dist/workflows/line-order.d.ts +5 -0
- package/dist/workflows/line-order.js +25 -0
- package/dist/workflows/line-order.js.map +1 -0
- package/dist/workflows/load.d.ts +19 -0
- package/dist/workflows/load.js +74 -0
- package/dist/workflows/load.js.map +1 -0
- package/dist/workflows/outcome-batches.d.ts +32 -0
- package/dist/workflows/outcome-batches.js +55 -0
- package/dist/workflows/outcome-batches.js.map +1 -0
- package/dist/workflows/pasted-content.d.ts +60 -0
- package/dist/workflows/pasted-content.js +69 -0
- package/dist/workflows/pasted-content.js.map +1 -0
- package/dist/workflows/question-routing.d.ts +16 -0
- package/dist/workflows/question-routing.js +28 -0
- package/dist/workflows/question-routing.js.map +1 -0
- package/dist/workflows/run/attachment-writer.d.ts +34 -0
- package/dist/workflows/run/attachment-writer.js +98 -0
- package/dist/workflows/run/attachment-writer.js.map +1 -0
- package/dist/workflows/run/auto-resume.d.ts +91 -0
- package/dist/workflows/run/auto-resume.js +247 -0
- package/dist/workflows/run/auto-resume.js.map +1 -0
- package/dist/workflows/run/cezar-tools.d.ts +45 -0
- package/dist/workflows/run/cezar-tools.js +117 -0
- package/dist/workflows/run/cezar-tools.js.map +1 -0
- package/dist/workflows/run/completion-gate.d.ts +77 -0
- package/dist/workflows/run/completion-gate.js +93 -0
- package/dist/workflows/run/completion-gate.js.map +1 -0
- package/dist/workflows/run/compose.d.ts +181 -0
- package/dist/workflows/run/compose.js +413 -0
- package/dist/workflows/run/compose.js.map +1 -0
- package/dist/workflows/run/constants.d.ts +48 -0
- package/dist/workflows/run/constants.js +49 -0
- package/dist/workflows/run/constants.js.map +1 -0
- package/dist/workflows/run/continuation-acceptance.d.ts +70 -0
- package/dist/workflows/run/continuation-acceptance.js +188 -0
- package/dist/workflows/run/continuation-acceptance.js.map +1 -0
- package/dist/workflows/run/continuation-session.d.ts +130 -0
- package/dist/workflows/run/continuation-session.js +597 -0
- package/dist/workflows/run/continuation-session.js.map +1 -0
- package/dist/workflows/run/drop-active.d.ts +4 -0
- package/dist/workflows/run/drop-active.js +11 -0
- package/dist/workflows/run/drop-active.js.map +1 -0
- package/dist/workflows/run/family-reconciler.d.ts +78 -0
- package/dist/workflows/run/family-reconciler.js +308 -0
- package/dist/workflows/run/family-reconciler.js.map +1 -0
- package/dist/workflows/run/human-waits.d.ts +85 -0
- package/dist/workflows/run/human-waits.js +163 -0
- package/dist/workflows/run/human-waits.js.map +1 -0
- package/dist/workflows/run/inbox-claims.d.ts +38 -0
- package/dist/workflows/run/inbox-claims.js +108 -0
- package/dist/workflows/run/inbox-claims.js.map +1 -0
- package/dist/workflows/run/input-batch.d.ts +15 -0
- package/dist/workflows/run/input-batch.js +32 -0
- package/dist/workflows/run/input-batch.js.map +1 -0
- package/dist/workflows/run/input-delivery.d.ts +202 -0
- package/dist/workflows/run/input-delivery.js +818 -0
- package/dist/workflows/run/input-delivery.js.map +1 -0
- package/dist/workflows/run/input-receipts.d.ts +65 -0
- package/dist/workflows/run/input-receipts.js +221 -0
- package/dist/workflows/run/input-receipts.js.map +1 -0
- package/dist/workflows/run/input-timers.d.ts +10 -0
- package/dist/workflows/run/input-timers.js +32 -0
- package/dist/workflows/run/input-timers.js.map +1 -0
- package/dist/workflows/run/launch-context.d.ts +62 -0
- package/dist/workflows/run/launch-context.js +119 -0
- package/dist/workflows/run/launch-context.js.map +1 -0
- package/dist/workflows/run/launch-read-resolver.d.ts +510 -0
- package/dist/workflows/run/launch-read-resolver.js +658 -0
- package/dist/workflows/run/launch-read-resolver.js.map +1 -0
- package/dist/workflows/run/launch-settings.d.ts +10 -0
- package/dist/workflows/run/launch-settings.js +11 -0
- package/dist/workflows/run/launch-settings.js.map +1 -0
- package/dist/workflows/run/live-session-state.d.ts +49 -0
- package/dist/workflows/run/live-session-state.js +83 -0
- package/dist/workflows/run/live-session-state.js.map +1 -0
- package/dist/workflows/run/maintenance-claims.d.ts +47 -0
- package/dist/workflows/run/maintenance-claims.js +83 -0
- package/dist/workflows/run/maintenance-claims.js.map +1 -0
- package/dist/workflows/run/memory-guard.d.ts +25 -0
- package/dist/workflows/run/memory-guard.js +64 -0
- package/dist/workflows/run/memory-guard.js.map +1 -0
- package/dist/workflows/run/opening.d.ts +30 -0
- package/dist/workflows/run/opening.js +6 -0
- package/dist/workflows/run/opening.js.map +1 -0
- package/dist/workflows/run/pending-ask-facts.d.ts +10 -0
- package/dist/workflows/run/pending-ask-facts.js +19 -0
- package/dist/workflows/run/pending-ask-facts.js.map +1 -0
- package/dist/workflows/run/prompts.d.ts +74 -0
- package/dist/workflows/run/prompts.js +140 -0
- package/dist/workflows/run/prompts.js.map +1 -0
- package/dist/workflows/run/queued-input.d.ts +108 -0
- package/dist/workflows/run/queued-input.js +249 -0
- package/dist/workflows/run/queued-input.js.map +1 -0
- package/dist/workflows/run/queued-revival.d.ts +44 -0
- package/dist/workflows/run/queued-revival.js +124 -0
- package/dist/workflows/run/queued-revival.js.map +1 -0
- package/dist/workflows/run/readonly-collections.d.ts +24 -0
- package/dist/workflows/run/readonly-collections.js +33 -0
- package/dist/workflows/run/readonly-collections.js.map +1 -0
- package/dist/workflows/run/repo-root-lease.d.ts +34 -0
- package/dist/workflows/run/repo-root-lease.js +71 -0
- package/dist/workflows/run/repo-root-lease.js.map +1 -0
- package/dist/workflows/run/resolved-wait-input-batch.d.ts +7 -0
- package/dist/workflows/run/resolved-wait-input-batch.js +23 -0
- package/dist/workflows/run/resolved-wait-input-batch.js.map +1 -0
- package/dist/workflows/run/run-cancel.d.ts +36 -0
- package/dist/workflows/run/run-cancel.js +130 -0
- package/dist/workflows/run/run-cancel.js.map +1 -0
- package/dist/workflows/run/run-finish.d.ts +72 -0
- package/dist/workflows/run/run-finish.js +256 -0
- package/dist/workflows/run/run-finish.js.map +1 -0
- package/dist/workflows/run/run-guards.d.ts +15 -0
- package/dist/workflows/run/run-guards.js +39 -0
- package/dist/workflows/run/run-guards.js.map +1 -0
- package/dist/workflows/run/run-line.d.ts +187 -0
- package/dist/workflows/run/run-line.js +438 -0
- package/dist/workflows/run/run-line.js.map +1 -0
- package/dist/workflows/run/run-recovery.d.ts +116 -0
- package/dist/workflows/run/run-recovery.js +422 -0
- package/dist/workflows/run/run-recovery.js.map +1 -0
- package/dist/workflows/run/run-settlement.d.ts +177 -0
- package/dist/workflows/run/run-settlement.js +504 -0
- package/dist/workflows/run/run-settlement.js.map +1 -0
- package/dist/workflows/run/run-skills.d.ts +114 -0
- package/dist/workflows/run/run-skills.js +233 -0
- package/dist/workflows/run/run-skills.js.map +1 -0
- package/dist/workflows/run/run-start.d.ts +64 -0
- package/dist/workflows/run/run-start.js +126 -0
- package/dist/workflows/run/run-start.js.map +1 -0
- package/dist/workflows/run/run-workspace.d.ts +25 -0
- package/dist/workflows/run/run-workspace.js +66 -0
- package/dist/workflows/run/run-workspace.js.map +1 -0
- package/dist/workflows/run/session-events.d.ts +155 -0
- package/dist/workflows/run/session-events.js +282 -0
- package/dist/workflows/run/session-events.js.map +1 -0
- package/dist/workflows/run/step-decisions.d.ts +37 -0
- package/dist/workflows/run/step-decisions.js +43 -0
- package/dist/workflows/run/step-decisions.js.map +1 -0
- package/dist/workflows/run/step-loop.d.ts +143 -0
- package/dist/workflows/run/step-loop.js +488 -0
- package/dist/workflows/run/step-loop.js.map +1 -0
- package/dist/workflows/run/step-session.d.ts +65 -0
- package/dist/workflows/run/step-session.js +280 -0
- package/dist/workflows/run/step-session.js.map +1 -0
- package/dist/workflows/run/steps.d.ts +13 -0
- package/dist/workflows/run/steps.js +14 -0
- package/dist/workflows/run/steps.js.map +1 -0
- package/dist/workflows/run/subagent-waits.d.ts +138 -0
- package/dist/workflows/run/subagent-waits.js +305 -0
- package/dist/workflows/run/subagent-waits.js.map +1 -0
- package/dist/workflows/run/tracked-work.d.ts +12 -0
- package/dist/workflows/run/tracked-work.js +29 -0
- package/dist/workflows/run/tracked-work.js.map +1 -0
- package/dist/workflows/run/turn-bookkeeping.d.ts +67 -0
- package/dist/workflows/run/turn-bookkeeping.js +173 -0
- package/dist/workflows/run/turn-bookkeeping.js.map +1 -0
- package/dist/workflows/run/turn-boundary.d.ts +215 -0
- package/dist/workflows/run/turn-boundary.js +329 -0
- package/dist/workflows/run/turn-boundary.js.map +1 -0
- package/dist/workflows/run/turn-markers.d.ts +62 -0
- package/dist/workflows/run/turn-markers.js +86 -0
- package/dist/workflows/run/turn-markers.js.map +1 -0
- package/dist/workflows/run/turn-nudges.d.ts +104 -0
- package/dist/workflows/run/turn-nudges.js +244 -0
- package/dist/workflows/run/turn-nudges.js.map +1 -0
- package/dist/workflows/run/turn-settler.d.ts +161 -0
- package/dist/workflows/run/turn-settler.js +469 -0
- package/dist/workflows/run/turn-settler.js.map +1 -0
- package/dist/workflows/run/types.d.ts +293 -0
- package/dist/workflows/run/types.js +2 -0
- package/dist/workflows/run/types.js.map +1 -0
- package/dist/workflows/run/usage-accounting.d.ts +49 -0
- package/dist/workflows/run/usage-accounting.js +213 -0
- package/dist/workflows/run/usage-accounting.js.map +1 -0
- package/dist/workflows/run/wait-engine.d.ts +1210 -0
- package/dist/workflows/run/wait-engine.js +456 -0
- package/dist/workflows/run/wait-engine.js.map +1 -0
- package/dist/workflows/run/wait-kinds.d.ts +336 -0
- package/dist/workflows/run/wait-kinds.js +471 -0
- package/dist/workflows/run/wait-kinds.js.map +1 -0
- package/dist/workflows/run/wait-registration-tool.d.ts +3 -0
- package/dist/workflows/run/wait-registration-tool.js +68 -0
- package/dist/workflows/run/wait-registration-tool.js.map +1 -0
- package/dist/workflows/run/wait-registration.d.ts +7 -0
- package/dist/workflows/run/wait-registration.js +39 -0
- package/dist/workflows/run/wait-registration.js.map +1 -0
- package/dist/workflows/run/wait-registry.d.ts +120 -0
- package/dist/workflows/run/wait-registry.js +365 -0
- package/dist/workflows/run/wait-registry.js.map +1 -0
- package/dist/workflows/run/wait-watches.d.ts +13 -0
- package/dist/workflows/run/wait-watches.js +12 -0
- package/dist/workflows/run/wait-watches.js.map +1 -0
- package/dist/workflows/run/wake-admission.d.ts +150 -0
- package/dist/workflows/run/wake-admission.js +397 -0
- package/dist/workflows/run/wake-admission.js.map +1 -0
- package/dist/workflows/run/wake-ledger.d.ts +61 -0
- package/dist/workflows/run/wake-ledger.js +78 -0
- package/dist/workflows/run/wake-ledger.js.map +1 -0
- package/dist/workflows/run/wake-retries.d.ts +31 -0
- package/dist/workflows/run/wake-retries.js +93 -0
- package/dist/workflows/run/wake-retries.js.map +1 -0
- package/dist/workflows/run/worker-executions.d.ts +54 -0
- package/dist/workflows/run/worker-executions.js +149 -0
- package/dist/workflows/run/worker-executions.js.map +1 -0
- package/dist/workflows/run/worker-orphans.d.ts +91 -0
- package/dist/workflows/run/worker-orphans.js +275 -0
- package/dist/workflows/run/worker-orphans.js.map +1 -0
- package/dist/workflows/run/worker-questions.d.ts +169 -0
- package/dist/workflows/run/worker-questions.js +464 -0
- package/dist/workflows/run/worker-questions.js.map +1 -0
- package/dist/workflows/run/workflow-position.d.ts +7 -0
- package/dist/workflows/run/workflow-position.js +9 -0
- package/dist/workflows/run/workflow-position.js.map +1 -0
- package/dist/workflows/run/worktree-autosave.d.ts +48 -0
- package/dist/workflows/run/worktree-autosave.js +175 -0
- package/dist/workflows/run/worktree-autosave.js.map +1 -0
- package/dist/workflows/run-scheduling.d.ts +38 -0
- package/dist/workflows/run-scheduling.js +76 -0
- package/dist/workflows/run-scheduling.js.map +1 -0
- package/dist/workflows/run-states.d.ts +73 -0
- package/dist/workflows/run-states.js +233 -0
- package/dist/workflows/run-states.js.map +1 -0
- package/dist/workflows/run.d.ts +275 -0
- package/dist/workflows/run.js +626 -0
- package/dist/workflows/run.js.map +1 -0
- package/dist/workflows/turn-end.d.ts +119 -0
- package/dist/workflows/turn-end.js +74 -0
- package/dist/workflows/turn-end.js.map +1 -0
- package/dist/workflows/types.d.ts +83 -0
- package/dist/workflows/types.js +192 -0
- package/dist/workflows/types.js.map +1 -0
- package/dist/workflows/wait-scope.d.ts +75 -0
- package/dist/workflows/wait-scope.js +115 -0
- package/dist/workflows/wait-scope.js.map +1 -0
- package/dist/workflows/waits.d.ts +58 -0
- package/dist/workflows/waits.js +89 -0
- package/dist/workflows/waits.js.map +1 -0
- package/dist/workspace/agent-accounts.d.ts +135 -0
- package/dist/workspace/agent-accounts.js +353 -0
- package/dist/workspace/agent-accounts.js.map +1 -0
- package/dist/workspace/agent-profiles.d.ts +125 -0
- package/dist/workspace/agent-profiles.js +190 -0
- package/dist/workspace/agent-profiles.js.map +1 -0
- package/dist/workspace/backup-cli.d.ts +9 -0
- package/dist/workspace/backup-cli.js +147 -0
- package/dist/workspace/backup-cli.js.map +1 -0
- package/dist/workspace/backups.d.ts +36 -0
- package/dist/workspace/backups.js +249 -0
- package/dist/workspace/backups.js.map +1 -0
- package/dist/workspace/config.d.ts +179 -0
- package/dist/workspace/config.js +396 -0
- package/dist/workspace/config.js.map +1 -0
- package/dist/workspace/migrations.d.ts +37 -0
- package/dist/workspace/migrations.js +149 -0
- package/dist/workspace/migrations.js.map +1 -0
- package/dist/workspace/projects-cli.d.ts +27 -0
- package/dist/workspace/projects-cli.js +175 -0
- package/dist/workspace/projects-cli.js.map +1 -0
- package/dist/workspace/projects.d.ts +131 -0
- package/dist/workspace/projects.js +274 -0
- package/dist/workspace/projects.js.map +1 -0
- package/dist/workspace/root-probe-cache.d.ts +10 -0
- package/dist/workspace/root-probe-cache.js +43 -0
- package/dist/workspace/root-probe-cache.js.map +1 -0
- package/dist/workspace/semaphore.d.ts +147 -0
- package/dist/workspace/semaphore.js +196 -0
- package/dist/workspace/semaphore.js.map +1 -0
- package/dist/workspace/ui-state.d.ts +17 -0
- package/dist/workspace/ui-state.js +59 -0
- package/dist/workspace/ui-state.js.map +1 -0
- package/dist/workspace/webhooks.d.ts +40 -0
- package/dist/workspace/webhooks.js +146 -0
- package/dist/workspace/webhooks.js.map +1 -0
- package/dist/worktree-manifest.d.ts +165 -0
- package/dist/worktree-manifest.js +535 -0
- package/dist/worktree-manifest.js.map +1 -0
- package/dist/worktree-setup.d.ts +88 -0
- package/dist/worktree-setup.js +170 -0
- package/dist/worktree-setup.js.map +1 -0
- package/package.json +80 -4
- package/scripts/benchmark-family-reconcile.ts +119 -0
- package/scripts/benchmark-home.ts +32 -0
- package/scripts/benchmark-project-probes.mjs +158 -0
- package/scripts/benchmark-run-store-fixture.ts +432 -0
- package/scripts/benchmark-run-store.ts +767 -0
- package/scripts/benchmark-stuck-destroys.ts +144 -0
- package/scripts/benchmark-workspace-events.ts +339 -0
- package/scripts/check-pack.mjs +48 -0
- package/scripts/inline-contract.mjs +165 -0
- package/scripts/install-as-command.mjs +125 -0
- package/scripts/measure-transcript-facts-health.mjs +103 -0
- package/scripts/measure-transcript-facts-lag.mjs +69 -0
- package/scripts/mock-autonomous.mjs +13 -0
- package/scripts/mock-ci-tool.mjs +159 -0
- package/scripts/mock-claude-model-refusal.mjs +76 -0
- package/scripts/mock-claude-subagents.mjs +54 -0
- package/scripts/mock-claude.mjs +800 -0
- package/scripts/mock-codex-app-server.mjs +767 -0
- package/scripts/mock-codex-coalesce-steer.mjs +59 -0
- package/scripts/mock-codex-reverse-steer.mjs +143 -0
- package/scripts/mock-codex-subagents.mjs +52 -0
- package/scripts/mock-controls.d.mts +11 -0
- package/scripts/mock-controls.mjs +13 -0
- package/scripts/mock-cursor-hang-stdin-late.mjs +35 -0
- package/scripts/mock-cursor-hang-stdin.mjs +30 -0
- package/scripts/mock-cursor-print.mjs +237 -0
- package/scripts/mock-deferred-turn-start.mjs +16 -0
- package/scripts/mock-delivery-control.d.mts +23 -0
- package/scripts/mock-delivery-control.mjs +80 -0
- package/scripts/mock-env-record.mjs +11 -0
- package/scripts/mock-failure-control.d.mts +13 -0
- package/scripts/mock-failure-control.mjs +68 -0
- package/scripts/mock-lifecycle.mjs +51 -0
- package/scripts/mock-multi-pr.mjs +10 -0
- package/scripts/mock-nudge.mjs +43 -0
- package/scripts/mock-omp-rpc.mjs +536 -0
- package/scripts/mock-opencode-serve.mjs +1000 -0
- package/scripts/mock-pi-rpc.mjs +421 -0
- package/scripts/mock-publish.mjs +13 -0
- package/scripts/mock-runner-crash.mjs +64 -0
- package/scripts/mock-scenario.d.mts +71 -0
- package/scripts/mock-scenario.mjs +295 -0
- package/scripts/mock-session-context.d.mts +5 -0
- package/scripts/mock-session-context.mjs +56 -0
- package/scripts/mock-silent-tail.mjs +93 -0
- package/scripts/mock-turn-messages.mjs +5 -0
- package/scripts/mock-wire-evidence.config.mjs +12 -0
- package/scripts/mock-wire-recorder.mjs +66 -0
- package/scripts/mock-wire-tools.mjs +7 -0
- package/scripts/omp-ci-wait.mjs +29 -0
- package/scripts/opencode-task-scope.d.mts +18 -0
- package/scripts/opencode-task-scope.mjs +59 -0
- package/scripts/parity-rows.ts +160 -0
- package/scripts/pi-ci-wait.mjs +17 -0
- package/scripts/pi-default-tools.mjs +22 -0
- package/scripts/pi-project-skills.mjs +59 -0
- package/scripts/pi-retry-degraded-service.mjs +16 -0
- package/scripts/probe-cursor-print.mjs +699 -0
- package/scripts/probe-session-env.ts +8 -0
- package/scripts/product-env.mjs +6 -0
- package/scripts/product-identity.mjs +12 -0
- package/scripts/record-mock-wires.mjs +16 -0
- package/scripts/seed-archive-profile.ts +53 -0
- package/scripts/sync-readme.mjs +20 -0
- package/scripts/test-process-usage.mjs +47 -0
- package/scripts/transcript-facts-fixture.mjs +53 -0
- package/scripts/transcript-facts-timing.mjs +42 -0
- package/scripts/voice-replay.ts +50 -0
- package/scripts/windows-workspace-identity.cs +208 -0
- package/scripts/windows-workspace-identity.ps1 +10 -0
- package/web/dist/assets/activity-motion-0wHCeUs7.css +1 -0
- package/web/dist/assets/activity-motion-SGth5vR4.js +2 -0
- package/web/dist/assets/activity-route-D8otXwOA.js +1 -0
- package/web/dist/assets/agent-accounts-6EuZhy-N.js +18 -0
- package/web/dist/assets/alert-dialog-vFjLgfK4.js +1 -0
- package/web/dist/assets/app-window-CSHwDX9N.js +1 -0
- package/web/dist/assets/arrow-right-Dh_Lx3um.js +1 -0
- package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
- package/web/dist/assets/button-BEK7XKhS.js +3 -0
- package/web/dist/assets/centered-state-CPgI8cCO.js +1 -0
- package/web/dist/assets/cez-idle-BT0U4GN_.js +1 -0
- package/web/dist/assets/chunk-BO2N2NFS-DE6qKn3r.js +131 -0
- package/web/dist/assets/commit-diff-panel-DzyWgn1Z.js +1 -0
- package/web/dist/assets/control-locations-CexZsd3M.js +1 -0
- package/web/dist/assets/core-BCsw8oQw.js +12 -0
- package/web/dist/assets/createLucideIcon-BHp8sXmF.js +1 -0
- package/web/dist/assets/css-BsVw1vtW.js +1 -0
- package/web/dist/assets/design-icons-DmYTv2r1.js +1 -0
- package/web/dist/assets/diff-DBDiZl58.js +3 -0
- package/web/dist/assets/diff-controls-DXyB0aDl.js +1 -0
- package/web/dist/assets/diff-view-DiKAwVMH.js +11 -0
- package/web/dist/assets/diff-woXpYk--.js +1 -0
- package/web/dist/assets/dropdown-menu-DYflHa4m.js +1 -0
- package/web/dist/assets/engine-javascript-FQvzRocB.js +141 -0
- package/web/dist/assets/es2015-BO600Xfi.js +41 -0
- package/web/dist/assets/eye-B8okNWXU.js +1 -0
- package/web/dist/assets/file-preview-DTSRkmMo.js +2 -0
- package/web/dist/assets/git-toolbar-U4s46kUd.js +1 -0
- package/web/dist/assets/github-UaBp2yRF.js +1 -0
- package/web/dist/assets/github-sidebar-model-czjLsgVJ.js +1 -0
- package/web/dist/assets/global-activity-route-B2N2Nz0H.js +1 -0
- package/web/dist/assets/go-rLFTqkRN.js +1 -0
- package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
- package/web/dist/assets/hourglass-B0lPAJvT.js +1 -0
- package/web/dist/assets/html-BY76lXLH.js +1 -0
- package/web/dist/assets/image-preview-XPCPclpG.js +1 -0
- package/web/dist/assets/index-B18AqW0Z.css +1 -0
- package/web/dist/assets/index-xj-3O89_.js +14 -0
- package/web/dist/assets/index.global-D3Ga_D3Y.js +1 -0
- package/web/dist/assets/info-DA1x_4bz.js +1 -0
- package/web/dist/assets/javascript-BgS3c2Ky.js +1 -0
- package/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/web/dist/assets/json-qhed-kSA.js +1 -0
- package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
- package/web/dist/assets/jsx-Bz0zcwM4.js +1 -0
- package/web/dist/assets/lib-BxQXEXDF.js +1 -0
- package/web/dist/assets/live-protocol-BDY7JJpT.js +64 -0
- package/web/dist/assets/live-refetch-C-Ony2Yr.js +1 -0
- package/web/dist/assets/live-worker-BWdeGzQX.ts +34 -0
- package/web/dist/assets/loader-circle-CZkGEdoI.js +1 -0
- package/web/dist/assets/markdown-BBDDg-4t.js +1 -0
- package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
- package/web/dist/assets/markdown-UdZ_toya.js +6 -0
- package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -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-BE99gD3_.js +1 -0
- package/web/dist/assets/popover-CpULuQSm.js +1 -0
- package/web/dist/assets/poppins-devanagari-400-normal-CJDn6rn8.woff2 +0 -0
- package/web/dist/assets/poppins-devanagari-400-normal-CqVvlrh5.woff +0 -0
- package/web/dist/assets/poppins-devanagari-500-normal-BIdkeU1p.woff2 +0 -0
- package/web/dist/assets/poppins-devanagari-500-normal-DMPDjHtT.woff +0 -0
- package/web/dist/assets/poppins-devanagari-600-normal-ClASKHrr.woff +0 -0
- package/web/dist/assets/poppins-devanagari-600-normal-STEjXBNN.woff2 +0 -0
- package/web/dist/assets/poppins-latin-400-normal-BOb3E3N0.woff +0 -0
- package/web/dist/assets/poppins-latin-400-normal-cpxAROuN.woff2 +0 -0
- package/web/dist/assets/poppins-latin-500-normal-C8OXljZJ.woff2 +0 -0
- package/web/dist/assets/poppins-latin-500-normal-DGXqpDMm.woff +0 -0
- package/web/dist/assets/poppins-latin-600-normal-BJdTmd5m.woff +0 -0
- package/web/dist/assets/poppins-latin-600-normal-zEkxB9Mr.woff2 +0 -0
- package/web/dist/assets/poppins-latin-ext-400-normal-DaBSavcJ.woff +0 -0
- package/web/dist/assets/poppins-latin-ext-400-normal-by3JarPu.woff2 +0 -0
- package/web/dist/assets/poppins-latin-ext-500-normal-CK-6C4Hw.woff2 +0 -0
- package/web/dist/assets/poppins-latin-ext-500-normal-CgAe2rWW.woff +0 -0
- package/web/dist/assets/poppins-latin-ext-600-normal-CAhIAdZj.woff2 +0 -0
- package/web/dist/assets/poppins-latin-ext-600-normal-Df5ffKXP.woff +0 -0
- package/web/dist/assets/preview-pane-connected-CgRK7GzB.js +3 -0
- package/web/dist/assets/project-router-CimAoN1H.js +1 -0
- package/web/dist/assets/project-scope-context-DMpvJqIm.js +4 -0
- package/web/dist/assets/python-gzcpVVnB.js +1 -0
- package/web/dist/assets/queries-BIOp8jLx.js +1 -0
- package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
- package/web/dist/assets/repo-git-DVXNOJDT.css +1 -0
- package/web/dist/assets/repo-git-XkyTfP9G.js +1 -0
- package/web/dist/assets/report-reader-CZjYS5Aw.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-D_2sFE1y.js +1 -0
- package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
- package/web/dist/assets/run-header-BwPDVPpg.js +2 -0
- package/web/dist/assets/run-header-CC7VUTg9.css +1 -0
- package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
- package/web/dist/assets/shellscript-CLZ0U2zV.js +1 -0
- package/web/dist/assets/skill-empty-hint-YDmkqgo-.js +1 -0
- package/web/dist/assets/skills-BkXe4p4q.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/sql-BsFa4tDR.js +1 -0
- package/web/dist/assets/tab-link-BIweqlIZ.js +1 -0
- package/web/dist/assets/task-changes-USNHNm_T.js +1 -0
- package/web/dist/assets/task-commits-kHqlOJe_.js +1 -0
- package/web/dist/assets/task-files-wTWwLR39.js +1 -0
- package/web/dist/assets/task-github-item-GzaQjkF1.js +1 -0
- package/web/dist/assets/task-thread-BZX863UN.js +9 -0
- package/web/dist/assets/task-thread-DtQ6uGfQ.css +1 -0
- package/web/dist/assets/textarea-FAUkHz1K.js +1 -0
- package/web/dist/assets/thread-state-CBzx2hmX.js +4 -0
- package/web/dist/assets/toaster-pthKGWiE.js +1 -0
- package/web/dist/assets/toml-CcmNWLt0.js +1 -0
- package/web/dist/assets/tsx-udAQXfEw.js +1 -0
- package/web/dist/assets/typescript-bsJCZSQ-.js +1 -0
- package/web/dist/assets/use-hand-to-agent-state-Bav9eT3b.js +1 -0
- package/web/dist/assets/use-hand-to-agent-state-C7esPJ-N.css +1 -0
- package/web/dist/assets/useInfiniteQuery-CQI4BO4C.js +1 -0
- package/web/dist/assets/useQuery-Bkq-x4Id.js +1 -0
- package/web/dist/assets/workflows-D871Gx--.js +7 -0
- package/web/dist/assets/ws-DspW9wBH.js +1 -0
- package/web/dist/assets/yaml-rwi0_p6S.js +1 -0
- package/web/dist/assets/zoomable-image-DNc6ORaF.js +1 -0
- package/web/dist/cezarion-lockup-dark.svg +9 -0
- package/web/dist/cezarion-lockup-light.svg +9 -0
- package/web/dist/cezarion-mark-dark.svg +4 -0
- package/web/dist/cezarion-mark-light.svg +4 -0
- package/web/dist/index.html +90 -0
- package/web/dist/live-worker.js +4 -0
|
@@ -0,0 +1,1690 @@
|
|
|
1
|
+
import { productEnv } from './product-env.js';
|
|
2
|
+
import { uiAskQuestions } from './ask.js';
|
|
3
|
+
import { opencodeSkillWarning } from './opencode-session-error.js';
|
|
4
|
+
import { summarizeRunnerStderr } from './runner-stderr.js';
|
|
5
|
+
import { finished } from 'node:stream/promises';
|
|
6
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { randomUUID } from 'node:crypto';
|
|
9
|
+
import { parseEffort } from '../contract/index.js';
|
|
10
|
+
import { request as httpRequest } from 'node:http';
|
|
11
|
+
import { isSignalTerminationExit, prependSystemPrompt, trackChildExit, } from './agent-runner.js';
|
|
12
|
+
import { RUNNER_FACTS } from './runner-facts.js';
|
|
13
|
+
import { InputSubmissions } from './input-submissions.js';
|
|
14
|
+
import { opencodeToolGrantFields } from './runner-tool-grants.js';
|
|
15
|
+
import { signalSession, spawnSessionLeader } from './session-process.js';
|
|
16
|
+
import { buildChildEnv } from './agent-env.js';
|
|
17
|
+
import { opencodeTaskScopeEnv } from './opencode-task-scope.js';
|
|
18
|
+
import { ciOpenCodeEnv } from '../ci-wait/injection.js';
|
|
19
|
+
import { parseAskRequest } from './ask.js';
|
|
20
|
+
import { boundOutputDrainAfterExit, AUTO_END_DELAY_MS, DEFAULT_RUN_TIMEOUT_MS } from './runner-runtime.js';
|
|
21
|
+
import { formatModelIdentity, parseModelIdentity } from './model-identity.js';
|
|
22
|
+
import { V1TextCoalescer } from './v1-text-coalescer.js';
|
|
23
|
+
import { isOpencodeDefaultAsk, opencodePermissionAskSchema, opencodePermissionBridge, opencodeUserPermissionRules, } from './opencode-permissions.js';
|
|
24
|
+
import { createOpencodeUiState, mapOpencodeEvent, opencodeSessionStarted, opencodeTurnStarted, } from './opencode-ui-mapper.js';
|
|
25
|
+
const SERVER_START_TIMEOUT_MS = 30_000;
|
|
26
|
+
/**
|
|
27
|
+
* Pause before the one retry of a server that exited before listening (#872).
|
|
28
|
+
* opencode 1.18.33, started within ~2 s of SIGTERM to the previous server on
|
|
29
|
+
* the same DB, printed `ServeError` and exited; the next start succeeded. The
|
|
30
|
+
* failing start can die well inside that window, so the pause alone spans it;
|
|
31
|
+
* it is only ever paid by a start that already failed.
|
|
32
|
+
*/
|
|
33
|
+
export const SERVE_START_RETRY_DELAY_MS = 2_000;
|
|
34
|
+
/** The URL wait saw the process exit before it printed a URL. */
|
|
35
|
+
class ServeExitedBeforeListening extends Error {
|
|
36
|
+
constructor() {
|
|
37
|
+
super('opencode serve exited before it started listening');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Grace between the teardown SIGTERM and the SIGKILL that follows it. */
|
|
41
|
+
export const KILL_GRACE_MS = 4_000;
|
|
42
|
+
/**
|
|
43
|
+
* `AgentRunner` over `opencode serve` — a headless HTTP server (the same one
|
|
44
|
+
* the opencode TUI talks to) with an SSE event stream. One server per session,
|
|
45
|
+
* bound to the run's `cwd` (worktree), gives OpenCode the same multi-turn shape
|
|
46
|
+
* as the Claude runner: each `sendMessage` posts another prompt to the same
|
|
47
|
+
* session (history is kept server-side), and `session/abort` cancels.
|
|
48
|
+
* Continue and restart recovery GET /session/{id} and prompt that session; a 404
|
|
49
|
+
* falls back to one fresh session with the full system prompt.
|
|
50
|
+
*
|
|
51
|
+
* Auth = the host's opencode config/logins. OpenCode's own permission config
|
|
52
|
+
* governs tools: cezar answers OpenCode's built-in default asks once and routes
|
|
53
|
+
* asks the user configured to the cockpit (hearsay-tools/cezarion#1266); this
|
|
54
|
+
* adapter does not map `spec.toolGrant`. Governed delegation adds only a
|
|
55
|
+
* supported session-level task deny rule.
|
|
56
|
+
* `spec.model` is `provider/model`.
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* What `opencode serve` receives from each `AgentRunSpec` field (#284).
|
|
60
|
+
* OpenCode's own permission config governs tool access and this adapter maps no
|
|
61
|
+
* per-tool allowlist, so `toolGrant` is declared dropped rather than mapped (spec
|
|
62
|
+
* 2026-07-17-permission-modes). Resume GETs `/session/{id}` and prompts it; a 404 opens one
|
|
63
|
+
* fresh session. Held against the recorded HTTP requests by the harness parity matrix.
|
|
64
|
+
*/
|
|
65
|
+
export const OPENCODE_SPEC_SUPPORT = {
|
|
66
|
+
cezarTools: { honored: true, via: 'merged OPENCODE_CONFIG_CONTENT local mcp entry' },
|
|
67
|
+
systemPrompt: { honored: true, via: 'prepended to the opening prompt_async text through prependSystemPrompt' },
|
|
68
|
+
userPrompt: { honored: true, via: 'prompt_async text part' },
|
|
69
|
+
images: { honored: false, reason: 'the adapter posts text parts only; image blocks are dropped' },
|
|
70
|
+
cwd: { honored: true, via: 'opencode serve spawn cwd; the session is bound to it' },
|
|
71
|
+
toolGrant: { honored: false, reason: 'OpenCode permission config governs tool access and bash; cezar answers its built-in default asks and routes configured asks to the cockpit, but maps no per-tool allowlist, so no command-prefix restriction either' },
|
|
72
|
+
restrictCrossSessionMessaging: { honored: true, via: 'the opencode-task-scope.mjs plugin appended to the OPENCODE_CONFIG_CONTENT plugin list; its tool.execute.before hook refuses a task call whose task_id names a session outside the caller\'s session tree, and keeps subagents (hearsay-tools/cezarion#2279)' },
|
|
73
|
+
additionalDirectories: { honored: false, reason: 'the server works from cwd; no extra-root mapping' },
|
|
74
|
+
env: { honored: true, via: 'merged over the child env through buildChildEnv' },
|
|
75
|
+
model: { honored: true, via: 'prompt_async model { providerID, modelID }, split from provider/model' },
|
|
76
|
+
effort: { honored: true, via: 'prompt_async variant, canonical level' },
|
|
77
|
+
timeoutMs: { honored: true, via: 'wall-clock kill switch on the child process' },
|
|
78
|
+
sessionId: { honored: true, via: 'GET /session/{id} when resume is set; a fresh POST /session mints its own id' },
|
|
79
|
+
resume: { honored: true, via: 'GET /session/{id} in place of POST /session; 404 falls back to a fresh session' },
|
|
80
|
+
resumeFallbackSystemPrompt: { honored: true, via: 'opening prependSystemPrompt of a fresh POST /session when GET /session/{id} returns 404 on resume' },
|
|
81
|
+
};
|
|
82
|
+
/** How long an idle session may sit on steered input before it counts as a lost wake. */
|
|
83
|
+
export const OPENCODE_LOST_WAKE_GRACE_MS = 2_000;
|
|
84
|
+
export class OpencodeServerRunner {
|
|
85
|
+
backend = 'opencode';
|
|
86
|
+
specSupport = OPENCODE_SPEC_SUPPORT;
|
|
87
|
+
systemPromptOnResume = RUNNER_FACTS.opencode.systemPromptOnResume;
|
|
88
|
+
facts = RUNNER_FACTS.opencode;
|
|
89
|
+
inputDelivery = RUNNER_FACTS.opencode.inputDelivery;
|
|
90
|
+
bin;
|
|
91
|
+
timeoutMs;
|
|
92
|
+
serverStartTimeoutMs;
|
|
93
|
+
lastSession = null;
|
|
94
|
+
constructor(opts = {}) {
|
|
95
|
+
this.bin = opts.bin ?? productEnv('OPENCODE_BIN') ?? (productEnv('DRY_RUN') === '1'
|
|
96
|
+
? fileURLToPath(new URL('../../scripts/mock-opencode-serve.mjs', import.meta.url)) : 'opencode');
|
|
97
|
+
this.timeoutMs = opts.timeoutMs ?? DEFAULT_RUN_TIMEOUT_MS;
|
|
98
|
+
this.serverStartTimeoutMs = opts.serverStartTimeoutMs ?? SERVER_START_TIMEOUT_MS;
|
|
99
|
+
}
|
|
100
|
+
run(spec, onEvent) {
|
|
101
|
+
return this.startSession(spec, onEvent, { autoEndAfterFirstTurn: true }).result;
|
|
102
|
+
}
|
|
103
|
+
async interrupt() {
|
|
104
|
+
this.lastSession?.interrupt();
|
|
105
|
+
}
|
|
106
|
+
startSession(spec, onEvent, opts = {}) {
|
|
107
|
+
const session = new OpencodeSession(this.bin, this.timeoutMs, this.serverStartTimeoutMs, spec, onEvent, opts);
|
|
108
|
+
this.lastSession = session;
|
|
109
|
+
return session;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/** One live `opencode serve` process driving a single session. */
|
|
113
|
+
class OpencodeSession {
|
|
114
|
+
bin;
|
|
115
|
+
serverStartTimeoutMs;
|
|
116
|
+
spec;
|
|
117
|
+
onEvent;
|
|
118
|
+
opts;
|
|
119
|
+
result;
|
|
120
|
+
/** The live server process. A start retry replaces it (#872), so every
|
|
121
|
+
* liveness, pid, signal and stderr read goes through this field. */
|
|
122
|
+
serve;
|
|
123
|
+
/** The first start, once the retry spawned for it ALSO exited before
|
|
124
|
+
* listening on its own (#872) — the one case that names both attempts. */
|
|
125
|
+
failedStart;
|
|
126
|
+
/** The retry's own spawn threw synchronously (EAGAIN, EMFILE…), so no second
|
|
127
|
+
* process exists and the first start's exit alone would misname the failure. */
|
|
128
|
+
retrySpawnError;
|
|
129
|
+
/** Aborted by teardown; cancels a pending start retry. */
|
|
130
|
+
startRetry = new AbortController();
|
|
131
|
+
serverOpen = true;
|
|
132
|
+
exitFailure;
|
|
133
|
+
baseUrl;
|
|
134
|
+
sessionId;
|
|
135
|
+
ready;
|
|
136
|
+
sse = new AbortController();
|
|
137
|
+
toolCalls = [];
|
|
138
|
+
textChunks = [];
|
|
139
|
+
/** Per text-part cursor so only newly-appended text is buffered (deltas). */
|
|
140
|
+
textSeen = new Map();
|
|
141
|
+
/** Streamed part deltas buffered per part — v1 `text` is emitted once per
|
|
142
|
+
* finished part (claude parity: one event per complete block), never per
|
|
143
|
+
* delta, so the persisted transcript and the headless CLI get whole
|
|
144
|
+
* paragraphs. Streaming display rides protocol v2's `item.delta`. */
|
|
145
|
+
textCoalescer = new V1TextCoalescer((text) => {
|
|
146
|
+
this.textChunks.push(text);
|
|
147
|
+
this.emit({ type: 'text', text });
|
|
148
|
+
});
|
|
149
|
+
toolsSeen = new Set();
|
|
150
|
+
/** messageID → role. Parts carry no role; only assistant parts are surfaced
|
|
151
|
+
* (the user's own message also streams as parts over the same SSE feed). */
|
|
152
|
+
msgRole = new Map();
|
|
153
|
+
/** Accepted agent prompts, the user message carrying each, and prompts that
|
|
154
|
+
* opened their turn (read when that turn goes idle) (#505). */
|
|
155
|
+
submissions = new InputSubmissions();
|
|
156
|
+
userMessageSubmission = new Map();
|
|
157
|
+
turnOpeners = new Set();
|
|
158
|
+
refusedBeforeOpening = false;
|
|
159
|
+
turnErrored = false;
|
|
160
|
+
lostWakeTimer;
|
|
161
|
+
/** Steered input an idle left unanswered: the server may still start a follow-on run for it.
|
|
162
|
+
* Settles when that run starts, or when the lost-wake grace or a teardown ends the wait. */
|
|
163
|
+
followOn;
|
|
164
|
+
followOnResolve = () => { };
|
|
165
|
+
refusedForFollowOn = false;
|
|
166
|
+
tokensUsed = 0;
|
|
167
|
+
/** OpenCode reports a cumulative cost for each message, not the session. */
|
|
168
|
+
costByMessage = new Map();
|
|
169
|
+
/** A prompt was posted and its `session.idle` has not arrived yet. */
|
|
170
|
+
turnActive = false;
|
|
171
|
+
agentInputReady = false;
|
|
172
|
+
agentRequest;
|
|
173
|
+
/** Human prompts scheduled behind the active turn, through their HTTP ack. */
|
|
174
|
+
pendingPromptRequests = 0;
|
|
175
|
+
/** A provider error must not abort its own independently arriving receipt. */
|
|
176
|
+
agentAcknowledgement;
|
|
177
|
+
providerErrorPending;
|
|
178
|
+
/** `finishTurn` ran for the current turn — repeats and stray idles no-op. */
|
|
179
|
+
turnEnded = false;
|
|
180
|
+
/** Monotonic identity used to reject async work completed by an older turn. */
|
|
181
|
+
turnSerial = 0;
|
|
182
|
+
/** Settles when the open turn finishes; re-armed at each turn start. The
|
|
183
|
+
* gate `prompt` waits on so turns never overlap (see there). */
|
|
184
|
+
turnFinished = Promise.resolve();
|
|
185
|
+
turnFinishedResolve = () => { };
|
|
186
|
+
/** Protocol v2 emission — additive alongside v1 (`onEvent` keeps flowing
|
|
187
|
+
* byte-identical); the channel is `opts.onUiEvent` (RunManager wiring
|
|
188
|
+
* lands in R2 step 2.1). Both streams take their turn-end from the wire
|
|
189
|
+
* `session.idle` (v1 since #4 — see `finishTurn`). */
|
|
190
|
+
uiState = createOpencodeUiState();
|
|
191
|
+
/** Question tool parts are snapshots. Once capture starts for an identity,
|
|
192
|
+
* every later state snapshot for that same part/call is already handled. */
|
|
193
|
+
handledQuestionParts = new Set();
|
|
194
|
+
pendingQuestion;
|
|
195
|
+
questionCapture;
|
|
196
|
+
questionReply;
|
|
197
|
+
/** User text submitted while a question reply POST is unsettled. It is not
|
|
198
|
+
* another answer; deliver it as ordinary prompts only after reply success. */
|
|
199
|
+
queuedQuestionMessages = [];
|
|
200
|
+
/** Bumped by `discardQueuedMessages` so a `prompt()` waiter that captured
|
|
201
|
+
* the previous generation returns instead of posting after idle. */
|
|
202
|
+
queuedPromptGeneration = 0;
|
|
203
|
+
/** Human prompts of the current generation, held from `sendMessage` until they post (#486). */
|
|
204
|
+
humanPromptWaiters = 0;
|
|
205
|
+
/** Native ask id → its live state, entered on receipt (hearsay-tools/cezarion#1266). Any
|
|
206
|
+
* entry holds agent input and auto-end, like a pending question, until OpenCode settles it. */
|
|
207
|
+
pendingPermissions = new Map();
|
|
208
|
+
/** Native ask ids already taken. Outlives retirement, so a duplicated frame is handled once. */
|
|
209
|
+
handledPermissionIds = new Set();
|
|
210
|
+
/** Asks are classified one at a time, in arrival order, after the one config read. */
|
|
211
|
+
permissionQueue = Promise.resolve();
|
|
212
|
+
permissionRules;
|
|
213
|
+
answeredDefaultAsk = false;
|
|
214
|
+
autoEndTimer;
|
|
215
|
+
timedOut = false;
|
|
216
|
+
openingPromptFailed = false;
|
|
217
|
+
constructor(bin, timeoutMs, serverStartTimeoutMs, spec, onEvent, opts) {
|
|
218
|
+
this.bin = bin;
|
|
219
|
+
this.serverStartTimeoutMs = serverStartTimeoutMs;
|
|
220
|
+
this.spec = spec;
|
|
221
|
+
this.onEvent = onEvent;
|
|
222
|
+
this.opts = opts;
|
|
223
|
+
this.serve = this.spawnServe();
|
|
224
|
+
// The server prints its URL on stdout once listening.
|
|
225
|
+
const urlReady = this.startServer();
|
|
226
|
+
const limitMs = spec.timeoutMs ?? timeoutMs;
|
|
227
|
+
let deadline;
|
|
228
|
+
if (limitMs > 0) {
|
|
229
|
+
deadline = setTimeout(() => {
|
|
230
|
+
this.timedOut = true;
|
|
231
|
+
this.interrupt();
|
|
232
|
+
}, limitMs);
|
|
233
|
+
deadline.unref?.();
|
|
234
|
+
}
|
|
235
|
+
this.ready = (async () => {
|
|
236
|
+
this.baseUrl = await urlReady;
|
|
237
|
+
await this.bootstrap();
|
|
238
|
+
})();
|
|
239
|
+
this.result = this.finishSession(deadline, limitMs);
|
|
240
|
+
}
|
|
241
|
+
/** Wait out the child, then map its exit onto the v1 result. */
|
|
242
|
+
async finishSession(deadline, limitMs) {
|
|
243
|
+
try {
|
|
244
|
+
await this.ready;
|
|
245
|
+
// Live for the whole session; the SSE loop runs until end()/interrupt.
|
|
246
|
+
await this.serve.exited;
|
|
247
|
+
}
|
|
248
|
+
catch (err) {
|
|
249
|
+
if (!this.timedOut && !this.openingPromptFailed) {
|
|
250
|
+
this.exitFailure = `opencode: ${err instanceof Error ? err.message : String(err)}`;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
finally {
|
|
254
|
+
if (deadline)
|
|
255
|
+
clearTimeout(deadline);
|
|
256
|
+
if (this.autoEndTimer)
|
|
257
|
+
clearTimeout(this.autoEndTimer);
|
|
258
|
+
this.sse.abort();
|
|
259
|
+
this.serverOpen = false;
|
|
260
|
+
this.clearLostWakeTimer();
|
|
261
|
+
this.agentRequest?.abort();
|
|
262
|
+
this.expirePermissions('session ended');
|
|
263
|
+
this.terminate();
|
|
264
|
+
}
|
|
265
|
+
const serve = this.serve;
|
|
266
|
+
await serve.exited;
|
|
267
|
+
await serve.outputDrained;
|
|
268
|
+
if (serve.spawnFailed) {
|
|
269
|
+
this.emit({ type: 'error', message: serve.spawnFailed.message });
|
|
270
|
+
throw serve.spawnFailed;
|
|
271
|
+
}
|
|
272
|
+
this.reportServeFailure(serve);
|
|
273
|
+
return this.resultFromCleanExit(limitMs);
|
|
274
|
+
}
|
|
275
|
+
reportServeFailure(serve) {
|
|
276
|
+
// SSE closure can precede the process exit event. Choose one authoritative
|
|
277
|
+
// error after settlement, before the synthetic turn-end, retaining the code.
|
|
278
|
+
const code = serve.child.exitCode;
|
|
279
|
+
const signal = serve.child.signalCode;
|
|
280
|
+
const crashed = (signal !== null && !serve.signalled)
|
|
281
|
+
|| (code !== null && code !== 0 && !(serve.signalled && isSignalTerminationExit(code)));
|
|
282
|
+
if (this.timedOut || (!crashed && !this.exitFailure))
|
|
283
|
+
return;
|
|
284
|
+
const stderr = serve.stderrChunks.join('');
|
|
285
|
+
const detail = summarizeRunnerStderr(stderr);
|
|
286
|
+
if (this.retrySpawnError) {
|
|
287
|
+
if (stderr.trim())
|
|
288
|
+
this.emit({ type: 'note', message: `opencode serve stderr:\n${stderr}` });
|
|
289
|
+
this.emit({ type: 'error', message: `opencode serve exited before listening (${describeEarlyExit(serve)}) and its retry could not start: ${this.retrySpawnError.message}` });
|
|
290
|
+
}
|
|
291
|
+
else if (this.failedStart) {
|
|
292
|
+
// #872: the retry failed too — one error naming both attempts.
|
|
293
|
+
const attempts = [this.failedStart, serve];
|
|
294
|
+
const notes = attempts.map((attempt, i) => {
|
|
295
|
+
const text = attempt.stderrChunks.join('');
|
|
296
|
+
return text.trim() ? `opencode serve stderr (attempt ${i + 1}):\n${text}` : '';
|
|
297
|
+
}).filter(Boolean);
|
|
298
|
+
if (notes.length)
|
|
299
|
+
this.emit({ type: 'note', message: notes.join('\n') });
|
|
300
|
+
const described = attempts.map((attempt, i) => `attempt ${i + 1}: ${describeEarlyExit(attempt)}`);
|
|
301
|
+
this.emit({ type: 'error', message: `opencode serve exited before listening on both attempts — ${described.join('; ')}` });
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
if (stderr.trim())
|
|
305
|
+
this.emit({ type: 'note', message: `opencode serve stderr:\n${stderr}` });
|
|
306
|
+
this.emit({ type: 'error', message: crashed ? `opencode serve exited with ${describeExit(serve)}${detail ? ` — ${detail}` : ''}` : this.exitFailure });
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
resultFromCleanExit(limitMs) {
|
|
310
|
+
// Timeout/interrupt can cut the SSE feed before its `session.idle` —
|
|
311
|
+
// close the turn (idempotent) so consumers still see the v1 boundary,
|
|
312
|
+
// and recover prose buffered mid-part.
|
|
313
|
+
this.finishTurn();
|
|
314
|
+
this.textCoalescer.flush();
|
|
315
|
+
// Chunks are whole blocks now (one per finished part), so newline-join
|
|
316
|
+
// like the other runners, not the old delta concatenation.
|
|
317
|
+
const base = {
|
|
318
|
+
text: this.textChunks.join('\n').trim(), toolCalls: this.toolCalls,
|
|
319
|
+
tokensUsed: this.tokensUsed, sessionId: this.sessionId ?? this.spec.sessionId,
|
|
320
|
+
};
|
|
321
|
+
if (this.timedOut) {
|
|
322
|
+
const mins = Math.round((limitMs / 60_000) * 10) / 10;
|
|
323
|
+
this.emit({ type: 'error', message: `opencode timed out after ${mins}m and was killed` });
|
|
324
|
+
}
|
|
325
|
+
this.emit({ type: 'done' });
|
|
326
|
+
return base;
|
|
327
|
+
}
|
|
328
|
+
get open() {
|
|
329
|
+
return this.serverOpen;
|
|
330
|
+
}
|
|
331
|
+
get pid() {
|
|
332
|
+
return this.serve.child.pid;
|
|
333
|
+
}
|
|
334
|
+
sendAgentMessage(content, inputIds = []) {
|
|
335
|
+
// #505: a busy session is steered with prompt_async; only a pending native question or
|
|
336
|
+
// permission ask, a queued human prompt or an in-flight agent POST refuses.
|
|
337
|
+
// Nothing may run ahead of the task: refuse until the opening prompt has started,
|
|
338
|
+
// then hint once so the refused input steers the opening turn.
|
|
339
|
+
if (this.serverOpen && this.turnSerial === 0) {
|
|
340
|
+
this.refusedBeforeOpening = true;
|
|
341
|
+
return false;
|
|
342
|
+
}
|
|
343
|
+
if (!this.serverOpen || !this.sessionId || this.pendingQuestion || this.questionReply || this.pendingPermissions.size > 0 ||
|
|
344
|
+
this.pendingPromptRequests > 0 || this.agentRequest)
|
|
345
|
+
return false;
|
|
346
|
+
// A prompt posted before a due follow-on run would have that run's idle close its turn, and
|
|
347
|
+
// its own run would then surface nothing (PR #1291 CI): it waits for that run, as for a turn.
|
|
348
|
+
if (this.followOn) {
|
|
349
|
+
this.refusedForFollowOn = true;
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
this.agentInputReady = false;
|
|
353
|
+
const request = new AbortController();
|
|
354
|
+
this.agentRequest = request;
|
|
355
|
+
const text = textOf(content);
|
|
356
|
+
const submissionId = randomUUID();
|
|
357
|
+
const steering = this.turnActive;
|
|
358
|
+
this.submissions.accept(submissionId, inputIds, text);
|
|
359
|
+
if (!steering && inputIds.length)
|
|
360
|
+
this.turnOpeners.add(submissionId);
|
|
361
|
+
const post = steering ? this.steerPrompt(text, request.signal) : this.prompt(text, 'agent', request.signal);
|
|
362
|
+
const acknowledgement = post.catch((err) => {
|
|
363
|
+
this.submissions.consume(submissionId);
|
|
364
|
+
this.turnOpeners.delete(submissionId);
|
|
365
|
+
throw err;
|
|
366
|
+
}).finally(() => {
|
|
367
|
+
if (this.agentRequest === request)
|
|
368
|
+
this.agentRequest = undefined;
|
|
369
|
+
if (this.serverOpen && !this.providerErrorPending && !this.turnActive && !this.pendingQuestion && !this.questionReply &&
|
|
370
|
+
this.pendingPermissions.size === 0) {
|
|
371
|
+
this.agentInputReady = true;
|
|
372
|
+
this.opts.onAgentInputReady?.();
|
|
373
|
+
this.scheduleAutoEnd();
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
this.agentAcknowledgement = acknowledgement;
|
|
377
|
+
return acknowledgement;
|
|
378
|
+
}
|
|
379
|
+
sendMessage(content) {
|
|
380
|
+
this.agentInputReady = false;
|
|
381
|
+
if (!this.serverOpen)
|
|
382
|
+
return false;
|
|
383
|
+
this.cancelAutoEnd();
|
|
384
|
+
const text = textOf(content);
|
|
385
|
+
if (!text)
|
|
386
|
+
return true;
|
|
387
|
+
if (this.questionReply) {
|
|
388
|
+
this.queuedQuestionMessages.push(text);
|
|
389
|
+
return true;
|
|
390
|
+
}
|
|
391
|
+
if (this.pendingQuestion) {
|
|
392
|
+
const pending = this.pendingQuestion;
|
|
393
|
+
const reply = this.replyQuestion(pending, text);
|
|
394
|
+
this.questionReply = reply;
|
|
395
|
+
const clearReply = () => {
|
|
396
|
+
if (this.questionReply === reply)
|
|
397
|
+
this.questionReply = undefined;
|
|
398
|
+
this.notifyAgentInputReady();
|
|
399
|
+
};
|
|
400
|
+
void reply.then(clearReply, clearReply);
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
// `prompt` already emitted the note and closed the turn before rethrowing,
|
|
404
|
+
// and a rejected `ready` already failed the session on the result path —
|
|
405
|
+
// there is nothing left to report here.
|
|
406
|
+
this.deliverPrompt(text);
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
409
|
+
discardQueuedMessages() {
|
|
410
|
+
this.queuedPromptGeneration += 1;
|
|
411
|
+
this.queuedQuestionMessages.length = 0;
|
|
412
|
+
this.humanPromptWaiters = 0; // #486: must read false immediately, not when waiters resume
|
|
413
|
+
}
|
|
414
|
+
holdsHumanInput() {
|
|
415
|
+
return this.humanPromptWaiters > 0 || this.queuedQuestionMessages.length > 0;
|
|
416
|
+
}
|
|
417
|
+
heldHumanInputCount() {
|
|
418
|
+
return this.humanPromptWaiters + this.queuedQuestionMessages.length;
|
|
419
|
+
}
|
|
420
|
+
deliverPrompt(text) {
|
|
421
|
+
this.pendingPromptRequests += 1;
|
|
422
|
+
// Held from admission, not from `ready`; a start that fails releases it (hearsay-tools/cezarion#2991).
|
|
423
|
+
const generation = this.queuedPromptGeneration;
|
|
424
|
+
this.humanPromptWaiters += 1;
|
|
425
|
+
let posting = false;
|
|
426
|
+
void this.ready.then(() => { posting = true; return this.prompt(text, 'human', undefined, generation); }).then(() => {
|
|
427
|
+
this.pendingPromptRequests -= 1;
|
|
428
|
+
this.notifyAgentInputReady();
|
|
429
|
+
}, () => {
|
|
430
|
+
if (!posting && generation === this.queuedPromptGeneration)
|
|
431
|
+
this.humanPromptWaiters = Math.max(0, this.humanPromptWaiters - 1);
|
|
432
|
+
this.pendingPromptRequests -= 1;
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
notifyAgentInputReady() {
|
|
436
|
+
if (this.serverOpen && this.turnEnded && !this.turnActive && !this.pendingQuestion &&
|
|
437
|
+
!this.questionReply && this.pendingPermissions.size === 0 && this.pendingPromptRequests === 0) {
|
|
438
|
+
this.agentInputReady = true;
|
|
439
|
+
this.opts.onAgentInputReady?.();
|
|
440
|
+
}
|
|
441
|
+
else if (this.serverOpen && this.turnActive && !this.pendingQuestion && !this.questionReply &&
|
|
442
|
+
this.pendingPermissions.size === 0 && this.pendingPromptRequests === 0 && !this.agentRequest) {
|
|
443
|
+
// A reply or prompt acknowledgement cleared the last barrier mid-turn: held agent
|
|
444
|
+
// input can steer the running turn now, not after it (#505 local review).
|
|
445
|
+
this.opts.onAgentInputReady?.();
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
cancelAutoEnd() {
|
|
449
|
+
if (!this.autoEndTimer)
|
|
450
|
+
return;
|
|
451
|
+
clearTimeout(this.autoEndTimer);
|
|
452
|
+
this.autoEndTimer = undefined;
|
|
453
|
+
}
|
|
454
|
+
scheduleAutoEnd() {
|
|
455
|
+
if (!this.opts.autoEndAfterFirstTurn || !this.serverOpen || this.autoEndTimer || this.agentRequest || this.pendingPermissions.size)
|
|
456
|
+
return;
|
|
457
|
+
this.autoEndTimer = setTimeout(() => {
|
|
458
|
+
this.autoEndTimer = undefined;
|
|
459
|
+
if (this.opts.shouldAutoEnd?.() !== false)
|
|
460
|
+
this.end();
|
|
461
|
+
}, AUTO_END_DELAY_MS);
|
|
462
|
+
this.autoEndTimer.unref?.();
|
|
463
|
+
}
|
|
464
|
+
end() {
|
|
465
|
+
if (!this.serverOpen)
|
|
466
|
+
return;
|
|
467
|
+
this.serverOpen = false;
|
|
468
|
+
this.clearLostWakeTimer();
|
|
469
|
+
this.agentRequest?.abort();
|
|
470
|
+
this.expirePermissions('session ended');
|
|
471
|
+
this.sse.abort();
|
|
472
|
+
this.terminate();
|
|
473
|
+
}
|
|
474
|
+
interrupt() {
|
|
475
|
+
this.serverOpen = false;
|
|
476
|
+
this.clearLostWakeTimer();
|
|
477
|
+
this.agentRequest?.abort();
|
|
478
|
+
this.expirePermissions('session ended');
|
|
479
|
+
if (this.baseUrl && this.sessionId) {
|
|
480
|
+
void this.http('POST', `/session/${this.sessionId}/abort`, undefined).catch(() => undefined);
|
|
481
|
+
}
|
|
482
|
+
this.sse.abort();
|
|
483
|
+
this.terminate();
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* The one place either signal is sent: SIGTERM now, SIGKILL once the grace
|
|
487
|
+
* window elapses.
|
|
488
|
+
*
|
|
489
|
+
* Both steps gate on `hasExited()`, never on `child.killed` — the latter
|
|
490
|
+
* flips the moment SIGTERM is *delivered*, so the old nested
|
|
491
|
+
* `exitCode == null && !killed` guard disarmed the escalation for exactly the
|
|
492
|
+
* server it was written for: one that installs its own SIGTERM handler stayed
|
|
493
|
+
* alive with `killed = true` and `exitCode === null`, outliving the whole
|
|
494
|
+
* window (#858, the same defect #844 fixed for the other two backends). Every
|
|
495
|
+
* caller here is followed by `await serve.exited`, so a server that survived
|
|
496
|
+
* SIGTERM did not just leak — it hung the session's result forever.
|
|
497
|
+
*
|
|
498
|
+
* One teardown per session: all three call sites can run for the same session
|
|
499
|
+
* (`interrupt()` on the deadline, then the result promise's `finally`), and
|
|
500
|
+
* once SIGTERM is out with SIGKILL armed there is nothing a second pass adds.
|
|
501
|
+
* The old `!child.killed` test deduplicated this as a side effect of being
|
|
502
|
+
* wrong; `signalled` keeps that property on purpose. It lives on the process,
|
|
503
|
+
* not the session: only the live one is ever signalled, and a start retry
|
|
504
|
+
* (#872) replaces it only after the first exited unsignalled.
|
|
505
|
+
*
|
|
506
|
+
* Teardown also cancels a pending start retry, so no second server spawns
|
|
507
|
+
* after `end()`, `interrupt()` or the deadline.
|
|
508
|
+
*/
|
|
509
|
+
terminate() {
|
|
510
|
+
this.startRetry.abort();
|
|
511
|
+
const serve = this.serve;
|
|
512
|
+
if (serve.signalled || serve.hasExited())
|
|
513
|
+
return;
|
|
514
|
+
serve.signalled = true;
|
|
515
|
+
signalSession(serve.child, 'SIGTERM');
|
|
516
|
+
setTimeout(() => {
|
|
517
|
+
if (serve.hasExited())
|
|
518
|
+
return;
|
|
519
|
+
signalSession(serve.child, 'SIGKILL');
|
|
520
|
+
}, KILL_GRACE_MS).unref?.();
|
|
521
|
+
}
|
|
522
|
+
// ---- server lifecycle ---------------------------------------------------
|
|
523
|
+
/** Spawn one `opencode serve` on a random high port and wire its lifecycle.
|
|
524
|
+
* A synchronous spawn throw is wrapped; an async spawn error is latched on
|
|
525
|
+
* the process record. */
|
|
526
|
+
spawnServe() {
|
|
527
|
+
// Random high port; the actual bound URL is read back from stdout.
|
|
528
|
+
const port = 40000 + Math.floor(Math.random() * 20000);
|
|
529
|
+
let child;
|
|
530
|
+
try {
|
|
531
|
+
child = spawnSessionLeader(this.bin, ['serve', '--hostname', '127.0.0.1', '--port', String(port)], {
|
|
532
|
+
cwd: this.spec.cwd,
|
|
533
|
+
env: buildChildEnv({ backend: 'opencode', extraEnv: opencodeTaskScopeEnv(ciOpenCodeEnv(this.spec), this.spec.restrictCrossSessionMessaging) }),
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
catch (err) {
|
|
537
|
+
throw wrapSpawnError(err, this.bin);
|
|
538
|
+
}
|
|
539
|
+
const hasExited = trackChildExit(child);
|
|
540
|
+
boundOutputDrainAfterExit(child);
|
|
541
|
+
// `exit` settles process liveness, not its pipes. The shared post-exit drain
|
|
542
|
+
// bound prevents an inherited descendant pipe from retaining this session.
|
|
543
|
+
const outputDrained = Promise.all([child.stdout, child.stderr].map(stream => finished(stream, { cleanup: true }).catch(() => undefined)));
|
|
544
|
+
const exited = new Promise((resolve) => {
|
|
545
|
+
child.once('exit', () => resolve());
|
|
546
|
+
child.once('close', () => resolve());
|
|
547
|
+
});
|
|
548
|
+
const serve = {
|
|
549
|
+
child, hasExited, exited, outputDrained, port,
|
|
550
|
+
stderrChunks: [], spawnFailed: null, signalled: false,
|
|
551
|
+
};
|
|
552
|
+
child.on('error', (err) => {
|
|
553
|
+
serve.spawnFailed = wrapSpawnError(err, this.bin);
|
|
554
|
+
});
|
|
555
|
+
child.stderr.setEncoding('utf8');
|
|
556
|
+
child.stderr.on('data', (chunk) => serve.stderrChunks.push(chunk));
|
|
557
|
+
return serve;
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Wait for the server URL, retrying once — after `SERVE_START_RETRY_DELAY_MS`,
|
|
561
|
+
* on a fresh port — when the process exited before it printed one (#872).
|
|
562
|
+
* Never retried: a spawn error (the process never ran), the no-URL timeout
|
|
563
|
+
* (it falls back to the requested port), and a session already torn down.
|
|
564
|
+
*/
|
|
565
|
+
async startServer() {
|
|
566
|
+
try {
|
|
567
|
+
return await this.waitForServerUrl(this.serve);
|
|
568
|
+
}
|
|
569
|
+
catch (err) {
|
|
570
|
+
const first = this.serve;
|
|
571
|
+
if (!(err instanceof ServeExitedBeforeListening))
|
|
572
|
+
throw err;
|
|
573
|
+
// Settle the process first: an ENOENT `error` and late stderr both land
|
|
574
|
+
// around `exit`, and the retry decision and its note need them.
|
|
575
|
+
await first.exited;
|
|
576
|
+
await first.outputDrained;
|
|
577
|
+
if (first.spawnFailed || first.child.pid === undefined || !this.serverOpen || this.timedOut)
|
|
578
|
+
throw err;
|
|
579
|
+
const detail = summarizeRunnerStderr(first.stderrChunks.join(''));
|
|
580
|
+
this.emit({
|
|
581
|
+
type: 'note',
|
|
582
|
+
message: `opencode serve exited before listening (${describeExit(first)}); retrying once${detail ? ` — ${detail}` : ''}`,
|
|
583
|
+
});
|
|
584
|
+
try {
|
|
585
|
+
await delay(SERVE_START_RETRY_DELAY_MS, undefined, { signal: this.startRetry.signal });
|
|
586
|
+
}
|
|
587
|
+
catch {
|
|
588
|
+
// Torn down during the pause: report the first start's failure as before.
|
|
589
|
+
throw err;
|
|
590
|
+
}
|
|
591
|
+
if (this.startRetry.signal.aborted || !this.serverOpen || this.timedOut)
|
|
592
|
+
throw err;
|
|
593
|
+
let next;
|
|
594
|
+
try {
|
|
595
|
+
next = this.spawnServe();
|
|
596
|
+
}
|
|
597
|
+
catch (spawnErr) {
|
|
598
|
+
this.retrySpawnError = spawnErr instanceof Error ? spawnErr : new Error(String(spawnErr));
|
|
599
|
+
throw spawnErr;
|
|
600
|
+
}
|
|
601
|
+
this.serve = next;
|
|
602
|
+
if (next.child.pid !== undefined)
|
|
603
|
+
this.opts.onPidChange?.(next.child.pid);
|
|
604
|
+
try {
|
|
605
|
+
return await this.waitForServerUrl(next);
|
|
606
|
+
}
|
|
607
|
+
catch (retryErr) {
|
|
608
|
+
// Only an unprompted second early exit names both attempts; a retry
|
|
609
|
+
// torn down by the session reports through the ordinary paths.
|
|
610
|
+
if (retryErr instanceof ServeExitedBeforeListening && !next.signalled)
|
|
611
|
+
this.failedStart = first;
|
|
612
|
+
throw retryErr;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
waitForServerUrl(serve) {
|
|
617
|
+
const { child } = serve;
|
|
618
|
+
return new Promise((resolve, reject) => {
|
|
619
|
+
let buffer = '';
|
|
620
|
+
const timer = setTimeout(() => {
|
|
621
|
+
cleanup();
|
|
622
|
+
// Nothing parsed — try the port we asked for.
|
|
623
|
+
resolve(`http://127.0.0.1:${serve.port}`);
|
|
624
|
+
}, this.serverStartTimeoutMs);
|
|
625
|
+
timer.unref?.();
|
|
626
|
+
const onData = (chunk) => {
|
|
627
|
+
buffer += chunk;
|
|
628
|
+
const m = /https?:\/\/[\d.]+:\d+/.exec(buffer);
|
|
629
|
+
if (m) {
|
|
630
|
+
cleanup();
|
|
631
|
+
resolve(m[0]);
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
const onExit = () => { cleanup(); reject(new ServeExitedBeforeListening()); };
|
|
635
|
+
// A failed spawn emits `error` and `close`, never `exit` (hearsay-tools/cezarion#895).
|
|
636
|
+
const onError = () => { if (child.pid === undefined)
|
|
637
|
+
onExit(); };
|
|
638
|
+
const cleanup = () => {
|
|
639
|
+
clearTimeout(timer);
|
|
640
|
+
child.stdout.off('data', onData);
|
|
641
|
+
child.off('exit', onExit);
|
|
642
|
+
child.off('error', onError);
|
|
643
|
+
};
|
|
644
|
+
child.stdout.setEncoding('utf8');
|
|
645
|
+
child.stdout.on('data', onData);
|
|
646
|
+
child.once('exit', onExit);
|
|
647
|
+
child.on('error', onError);
|
|
648
|
+
if (serve.spawnFailed)
|
|
649
|
+
onError();
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
/** 404 → `'missing'`. Any other non-OK status fails bootstrap (no fallback). */
|
|
653
|
+
async tryGetSession(id) {
|
|
654
|
+
if (!this.baseUrl)
|
|
655
|
+
throw new Error('opencode server not ready');
|
|
656
|
+
const res = await fetch(`${this.baseUrl}/session/${encodeURIComponent(id)}`, { method: 'GET' });
|
|
657
|
+
if (res.status === 404)
|
|
658
|
+
return 'missing';
|
|
659
|
+
if (!res.ok) {
|
|
660
|
+
const detail = await res.text().catch(() => '');
|
|
661
|
+
throw new Error(`GET /session/${id} → ${res.status} ${detail.slice(0, 200)}`);
|
|
662
|
+
}
|
|
663
|
+
const text = await res.text();
|
|
664
|
+
if (!text)
|
|
665
|
+
return { id };
|
|
666
|
+
try {
|
|
667
|
+
const parsed = JSON.parse(text);
|
|
668
|
+
return isRecord(parsed) ? parsed : { id };
|
|
669
|
+
}
|
|
670
|
+
catch {
|
|
671
|
+
return { id };
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
attachSession(id) {
|
|
675
|
+
this.sessionId = id;
|
|
676
|
+
this.emit({ type: 'session', sessionId: id });
|
|
677
|
+
this.emitUi((state) => opencodeSessionStarted(id, state));
|
|
678
|
+
}
|
|
679
|
+
async bootstrap() {
|
|
680
|
+
const requested = this.spec.resume ? this.spec.sessionId : undefined;
|
|
681
|
+
let resumed = false;
|
|
682
|
+
if (requested) {
|
|
683
|
+
const existing = await this.tryGetSession(requested);
|
|
684
|
+
if (existing === 'missing') {
|
|
685
|
+
this.emit({
|
|
686
|
+
type: 'note',
|
|
687
|
+
message: `OpenCode session ${requested} no longer exists; the continuation runs in a fresh session without the earlier conversation.`,
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
else {
|
|
691
|
+
// A `task` deny an older cezar added stays on the session: OpenCode appends permission
|
|
692
|
+
// rules and has no remove (hearsay-tools/cezarion#2279).
|
|
693
|
+
this.attachSession(stringField(existing, 'id') ?? requested);
|
|
694
|
+
resumed = true;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
if (!resumed) {
|
|
698
|
+
const created = await this.http('POST', '/session', {
|
|
699
|
+
title: 'cezar task',
|
|
700
|
+
...opencodeToolGrantFields(this.spec.toolGrant),
|
|
701
|
+
});
|
|
702
|
+
const sessionId = stringField(created, 'id');
|
|
703
|
+
if (!sessionId)
|
|
704
|
+
throw new Error('opencode did not return a session id');
|
|
705
|
+
this.attachSession(sessionId);
|
|
706
|
+
}
|
|
707
|
+
// The SSE subscription must be LIVE before the first prompt posts —
|
|
708
|
+
// events the server emits while the POST is in flight would otherwise be
|
|
709
|
+
// lost (a race this await closes; the bundled mock made it visible).
|
|
710
|
+
await this.consumeEvents();
|
|
711
|
+
// Lost-session fallback uses the full skill-inclusive prompt Continue
|
|
712
|
+
// stashed in resumeFallbackSystemPrompt; a true resume re-prepends only
|
|
713
|
+
// extra+handoff (the skill already lives in the thread).
|
|
714
|
+
const systemPrompt = !resumed && requested
|
|
715
|
+
? (this.spec.resumeFallbackSystemPrompt ?? this.spec.systemPrompt)
|
|
716
|
+
: this.spec.systemPrompt;
|
|
717
|
+
const first = prependSystemPrompt(systemPrompt, this.spec.userPrompt);
|
|
718
|
+
await this.prompt(first, 'opening');
|
|
719
|
+
if (this.refusedBeforeOpening)
|
|
720
|
+
queueMicrotask(() => {
|
|
721
|
+
this.refusedBeforeOpening = false;
|
|
722
|
+
if (this.serverOpen && !this.pendingQuestion && !this.questionReply && this.pendingPermissions.size === 0 && !this.agentRequest) {
|
|
723
|
+
this.opts.onAgentInputReady?.();
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
async prompt(text, origin = 'human', signal, generation = this.queuedPromptGeneration) {
|
|
728
|
+
// One turn at a time. `prompt_async` acknowledges before the turn runs,
|
|
729
|
+
// so `ready` no longer serializes prompts the way the long-poll did — a
|
|
730
|
+
// follow-up posted mid-turn would share the turnActive/turnEnded pair
|
|
731
|
+
// with the running turn and let that turn's idle close this one. Waiters
|
|
732
|
+
// resume in FIFO order; a teardown (`finishTurn` runs on every exit
|
|
733
|
+
// path) releases them into the `serverOpen` check below.
|
|
734
|
+
while (this.turnActive || this.followOn)
|
|
735
|
+
await (this.turnActive ? this.turnFinished : this.followOn);
|
|
736
|
+
if (origin === 'human' && generation === this.queuedPromptGeneration)
|
|
737
|
+
this.humanPromptWaiters = Math.max(0, this.humanPromptWaiters - 1);
|
|
738
|
+
if (generation !== this.queuedPromptGeneration)
|
|
739
|
+
return;
|
|
740
|
+
// A queued prompt may have started waiting before the preceding idle armed
|
|
741
|
+
// auto-end. Cancel at actual delivery time, not only at sendMessage time.
|
|
742
|
+
this.cancelAutoEnd();
|
|
743
|
+
if (!this.sessionId || !this.serverOpen)
|
|
744
|
+
return;
|
|
745
|
+
this.openTurn();
|
|
746
|
+
// Turn boundary, v1 and v2 alike — the prompt POST is the turn start
|
|
747
|
+
// (§7.1); the end comes from the SSE `session.idle`, never from the HTTP
|
|
748
|
+
// response below. `POST /session/:id/message` long-polled the whole turn,
|
|
749
|
+
// and undici's default 300s headers timeout ended it as `prompt failed:
|
|
750
|
+
// fetch failed` (#4, upstream #897); `prompt_async` returns immediately.
|
|
751
|
+
this.emitUi(opencodeTurnStarted);
|
|
752
|
+
const body = this.promptBody(text);
|
|
753
|
+
try {
|
|
754
|
+
await this.http('POST', `/session/${this.sessionId}/prompt_async`, body, signal);
|
|
755
|
+
}
|
|
756
|
+
catch (err) {
|
|
757
|
+
this.reportPromptFailure(origin, err);
|
|
758
|
+
throw err;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
reportPromptFailure(origin, err) {
|
|
762
|
+
// No turn started server-side, so no `session.idle` will ever close it —
|
|
763
|
+
// surface the failure and end the turn here instead of parking the run.
|
|
764
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
765
|
+
if (origin === 'agent' && this.providerErrorPending) {
|
|
766
|
+
// Latch the initiating provider failure before rejection reaches the
|
|
767
|
+
// manager's ACK handler (including grace expiry and explicit abort).
|
|
768
|
+
this.providerErrorPending.reported = true;
|
|
769
|
+
if (this.serverOpen)
|
|
770
|
+
this.emit({ type: 'error', message: this.providerErrorPending.message });
|
|
771
|
+
}
|
|
772
|
+
else if (origin === 'agent') {
|
|
773
|
+
// Fatal BEFORE the synthetic boundary: the rejected submission stays
|
|
774
|
+
// queued and must not drain more input or settle DONE.
|
|
775
|
+
if (this.serverOpen) {
|
|
776
|
+
this.emit({ type: 'error', message: `opencode: agent input failed: ${message}` });
|
|
777
|
+
this.interrupt();
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
else if (origin === 'opening') {
|
|
781
|
+
this.emit({ type: 'note', message: `opencode: prompt failed: ${message}` });
|
|
782
|
+
// A dropped ACK can be the first sign of a process crash. Retain HTTP
|
|
783
|
+
// rejection details, but let settlement choose one error before turn-end.
|
|
784
|
+
this.openingPromptFailed = true;
|
|
785
|
+
this.exitFailure = `opencode: ${message}`;
|
|
786
|
+
this.interrupt();
|
|
787
|
+
}
|
|
788
|
+
else {
|
|
789
|
+
this.emit({ type: 'note', message: `opencode: prompt failed: ${message}` });
|
|
790
|
+
}
|
|
791
|
+
if (!this.providerErrorPending && origin !== 'opening')
|
|
792
|
+
this.finishTurn();
|
|
793
|
+
// Bootstrap still rejects; its result path reports the latched opening
|
|
794
|
+
// failure. Human follow-ups keep their nonfatal note and turn boundary.
|
|
795
|
+
}
|
|
796
|
+
promptBody(text) {
|
|
797
|
+
const body = { parts: [{ type: 'text', text }] };
|
|
798
|
+
// `spec.model` arrives already normalised to canonical `provider/model`
|
|
799
|
+
// (the run wiring's fail-loud gate). Split it with the shared parser — the
|
|
800
|
+
// one every runner uses — into opencode's `{ providerID, modelID }`.
|
|
801
|
+
const id = parseModelIdentity(this.spec.model);
|
|
802
|
+
if (id)
|
|
803
|
+
body.model = { providerID: id.provider, modelID: id.model };
|
|
804
|
+
const effort = parseEffort(this.spec.effort);
|
|
805
|
+
if (effort)
|
|
806
|
+
body.variant = effort;
|
|
807
|
+
return body;
|
|
808
|
+
}
|
|
809
|
+
/** Busy agent input: the running prompt loop rereads it between steps (1.18.32 probe).
|
|
810
|
+
* No new turn opens; the running turn's idle ends it (#505). */
|
|
811
|
+
async steerPrompt(text, signal) {
|
|
812
|
+
try {
|
|
813
|
+
await this.http('POST', `/session/${this.sessionId}/prompt_async`, this.promptBody(text), signal);
|
|
814
|
+
}
|
|
815
|
+
catch (err) {
|
|
816
|
+
if (this.serverOpen) {
|
|
817
|
+
this.emit({ type: 'error', message: `opencode: agent input failed: ${err instanceof Error ? err.message : String(err)}` });
|
|
818
|
+
this.interrupt();
|
|
819
|
+
}
|
|
820
|
+
throw err;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
/** The single v1 turn-end: from the session's own `session.idle`, the
|
|
824
|
+
* prompt-POST failure path, or the teardown safety net — whichever comes
|
|
825
|
+
* first; the guards make every later call a no-op. */
|
|
826
|
+
/** Turn bookkeeping for a prompt POST, or for a server run that started on its own
|
|
827
|
+
* to answer steered input (#505). */
|
|
828
|
+
openTurn() {
|
|
829
|
+
this.clearLostWakeTimer();
|
|
830
|
+
this.turnActive = true;
|
|
831
|
+
this.agentInputReady = false;
|
|
832
|
+
this.turnEnded = false;
|
|
833
|
+
this.turnSerial += 1;
|
|
834
|
+
this.turnFinished = new Promise((resolve) => {
|
|
835
|
+
this.turnFinishedResolve = resolve;
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
clearLostWakeTimer() {
|
|
839
|
+
if (this.lostWakeTimer)
|
|
840
|
+
clearTimeout(this.lostWakeTimer);
|
|
841
|
+
this.lostWakeTimer = undefined;
|
|
842
|
+
this.settleFollowOn();
|
|
843
|
+
}
|
|
844
|
+
/** The follow-on wait is over. Input it refused is offered again unless a turn took over. */
|
|
845
|
+
settleFollowOn() {
|
|
846
|
+
if (!this.followOn)
|
|
847
|
+
return;
|
|
848
|
+
this.followOn = undefined;
|
|
849
|
+
this.followOnResolve();
|
|
850
|
+
if (!this.refusedForFollowOn)
|
|
851
|
+
return;
|
|
852
|
+
this.refusedForFollowOn = false;
|
|
853
|
+
if (this.turnActive)
|
|
854
|
+
return;
|
|
855
|
+
queueMicrotask(() => this.notifyAgentInputReady());
|
|
856
|
+
}
|
|
857
|
+
finishTurn() {
|
|
858
|
+
if (!this.turnActive || this.turnEnded)
|
|
859
|
+
return;
|
|
860
|
+
this.turnEnded = true;
|
|
861
|
+
this.turnActive = false;
|
|
862
|
+
this.questionCapture = undefined;
|
|
863
|
+
// SSE idle can beat the independent reply HTTP response. The active reply
|
|
864
|
+
// owns pending-question cleanup; without one, the pending ask is stale.
|
|
865
|
+
if (!this.questionReply)
|
|
866
|
+
this.pendingQuestion = undefined;
|
|
867
|
+
// OpenCode settles its own pending permission requests when the run stops.
|
|
868
|
+
this.expirePermissions('turn ended');
|
|
869
|
+
this.turnFinishedResolve();
|
|
870
|
+
// A part that never saw `time.end` (abort, server quirk) still surfaces
|
|
871
|
+
// its prose before the turn boundary (run.ts reads markers there).
|
|
872
|
+
this.textCoalescer.flush();
|
|
873
|
+
this.agentInputReady = true;
|
|
874
|
+
// A prompt that opened this turn was processed by it; steered input the turn never
|
|
875
|
+
// answered (no assistant message named it as parentID) is a lost wake (#505).
|
|
876
|
+
// A turn that failed may never have reached the model: its opener stays pending, so a
|
|
877
|
+
// closing session returns it to the queue (#505 review).
|
|
878
|
+
const opened = this.turnErrored ? [] : [...this.turnOpeners].flatMap(id => this.submissions.consume(id));
|
|
879
|
+
this.turnOpeners.clear();
|
|
880
|
+
this.turnErrored = false;
|
|
881
|
+
if (opened.length)
|
|
882
|
+
this.opts.onAgentInputConsumed?.(opened);
|
|
883
|
+
this.emit({ type: 'turn-end' });
|
|
884
|
+
// Steered input the server holds is read by a follow-on run, or stranded by the
|
|
885
|
+
// upstream lost wake (anomalyco/opencode#46842). Only a quiet grace window tells
|
|
886
|
+
// them apart; then report it so cezar submits it as a new prompt.
|
|
887
|
+
if (this.submissions.pending > 0) {
|
|
888
|
+
this.clearLostWakeTimer();
|
|
889
|
+
this.followOn = new Promise((resolve) => { this.followOnResolve = resolve; });
|
|
890
|
+
this.lostWakeTimer = setTimeout(() => {
|
|
891
|
+
this.lostWakeTimer = undefined;
|
|
892
|
+
if (!this.serverOpen || this.turnActive) {
|
|
893
|
+
this.settleFollowOn();
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
const inputIds = this.submissions.takeUnconsumed();
|
|
897
|
+
this.userMessageSubmission.clear();
|
|
898
|
+
if (inputIds.length)
|
|
899
|
+
this.emit({ type: 'input-unconsumed', inputIds });
|
|
900
|
+
this.settleFollowOn();
|
|
901
|
+
}, OPENCODE_LOST_WAKE_GRACE_MS);
|
|
902
|
+
this.lostWakeTimer.unref?.();
|
|
903
|
+
}
|
|
904
|
+
if (!this.questionReply)
|
|
905
|
+
this.scheduleAutoEnd();
|
|
906
|
+
}
|
|
907
|
+
// ---- SSE stream ---------------------------------------------------------
|
|
908
|
+
/** Resolves once the SSE stream is CONNECTED (headers in) — the frames are
|
|
909
|
+
* then drained in the background. Callers await the connection so no
|
|
910
|
+
* event emitted after this resolves can be missed.
|
|
911
|
+
*
|
|
912
|
+
* Speaks node:http, not fetch: undici's default Agent cuts a response
|
|
913
|
+
* body idle for 300s, which would sever a quiet turn's bus mid-run (#4) —
|
|
914
|
+
* node's own client has no idle timeout. (`process.getBuiltinModule`
|
|
915
|
+
* cannot fix that: undici is bundled into node but not exposed as a
|
|
916
|
+
* built-in, so there is no no-timeout dispatcher to hand fetch without
|
|
917
|
+
* taking undici as a real dependency.)
|
|
918
|
+
*
|
|
919
|
+
* A connection that cannot be established throws, failing `bootstrap`:
|
|
920
|
+
* with `prompt_async` this stream is the only source of turn-ends, so a
|
|
921
|
+
* session that cannot hear it is dead on arrival, not degraded. */
|
|
922
|
+
async consumeEvents() {
|
|
923
|
+
if (!this.baseUrl)
|
|
924
|
+
return;
|
|
925
|
+
let res;
|
|
926
|
+
try {
|
|
927
|
+
res = await new Promise((resolve, reject) => {
|
|
928
|
+
const req = httpRequest(`${this.baseUrl}/event`, { headers: { accept: 'text/event-stream' }, signal: this.sse.signal }, resolve);
|
|
929
|
+
req.on('error', reject);
|
|
930
|
+
req.end();
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
catch (err) {
|
|
934
|
+
if (this.sse.signal.aborted)
|
|
935
|
+
return; // torn down during bootstrap — not a failure
|
|
936
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
937
|
+
throw new Error(`event stream failed to connect: ${message}`);
|
|
938
|
+
}
|
|
939
|
+
// node:http hands over EVERY response, error statuses included — a proxy's
|
|
940
|
+
// 401 or a non-SSE 500 body is not an event bus, however well it parses.
|
|
941
|
+
const status = res.statusCode ?? 0;
|
|
942
|
+
if (status < 200 || status >= 300) {
|
|
943
|
+
res.resume(); // discard the body so the socket is released
|
|
944
|
+
throw new Error(`event stream failed to connect: HTTP ${status}`);
|
|
945
|
+
}
|
|
946
|
+
void this.readEvents(res);
|
|
947
|
+
}
|
|
948
|
+
async readEvents(res) {
|
|
949
|
+
// StringDecoder under the hood — multi-byte characters split across
|
|
950
|
+
// chunks arrive whole, like the TextDecoder streaming mode did.
|
|
951
|
+
res.setEncoding('utf8');
|
|
952
|
+
let buffer = '';
|
|
953
|
+
try {
|
|
954
|
+
for await (const chunk of res) {
|
|
955
|
+
this.opts.onActivity?.(); // Includes SSE heartbeat comments.
|
|
956
|
+
buffer += chunk;
|
|
957
|
+
let sep;
|
|
958
|
+
while ((sep = buffer.indexOf('\n\n')) >= 0) {
|
|
959
|
+
const frame = buffer.slice(0, sep);
|
|
960
|
+
buffer = buffer.slice(sep + 2);
|
|
961
|
+
await this.handleFrame(frame);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
catch {
|
|
966
|
+
// aborted — normal on end()/interrupt
|
|
967
|
+
}
|
|
968
|
+
finally {
|
|
969
|
+
// `session.idle` rides this stream and nothing else — a feed that dies
|
|
970
|
+
// while the server is still up would otherwise park the current turn
|
|
971
|
+
// forever and leave every later prompt unanswerable. An `error`, not a
|
|
972
|
+
// note: the turn's remaining output is lost, so the step must record a
|
|
973
|
+
// failure (run.ts classifies from v1 `error` only), never pass as an
|
|
974
|
+
// empty success. Then close the turn (flushing what did arrive) and end
|
|
975
|
+
// the session; "Continue" GETs this session id on the next server.
|
|
976
|
+
if (this.serverOpen && !this.sse.signal.aborted) {
|
|
977
|
+
this.exitFailure = 'opencode: event stream closed unexpectedly';
|
|
978
|
+
this.end();
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
async handleFrame(frame) {
|
|
983
|
+
const dataLines = frame
|
|
984
|
+
.split('\n')
|
|
985
|
+
.filter((l) => l.startsWith('data:'))
|
|
986
|
+
.map((l) => l.slice(5).trim());
|
|
987
|
+
if (dataLines.length === 0)
|
|
988
|
+
return;
|
|
989
|
+
let evt;
|
|
990
|
+
try {
|
|
991
|
+
evt = JSON.parse(dataLines.join('\n'));
|
|
992
|
+
}
|
|
993
|
+
catch {
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
996
|
+
this.emitUi((state) => mapOpencodeEvent(evt, state));
|
|
997
|
+
const sid = stringField(evt.properties ?? {}, 'sessionID');
|
|
998
|
+
if (evt.type === 'session.error' && !opencodeSkillWarning(evt.properties ?? {}) && (sid === undefined || sid === this.sessionId) && this.agentRequest) {
|
|
999
|
+
// HTTP and SSE are independent sockets: the error can overtake a positive
|
|
1000
|
+
// prompt ACK. Let that exact request settle before v1 makes RunManager
|
|
1001
|
+
// interrupt it. Keep later SSE idle frames behind the same barrier.
|
|
1002
|
+
// Reuse the teardown grace as a hard bound: a wedged ACK cannot keep a
|
|
1003
|
+
// failed turn alive indefinitely. Explicit end/interrupt still abort now.
|
|
1004
|
+
const failure = { message: this.sessionErrorMessage(evt.properties?.error), reported: false };
|
|
1005
|
+
this.providerErrorPending = failure;
|
|
1006
|
+
const request = this.agentRequest;
|
|
1007
|
+
const timer = setTimeout(() => request.abort(), KILL_GRACE_MS);
|
|
1008
|
+
try {
|
|
1009
|
+
await this.agentAcknowledgement?.catch(() => undefined);
|
|
1010
|
+
if (this.serverOpen && !failure.reported)
|
|
1011
|
+
this.handleEvent(evt);
|
|
1012
|
+
}
|
|
1013
|
+
finally {
|
|
1014
|
+
clearTimeout(timer);
|
|
1015
|
+
this.providerErrorPending = undefined;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
else {
|
|
1019
|
+
this.handleEvent(evt);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
/** #53 — a forwarded session error must never read like a missing
|
|
1023
|
+
* executable: a bare upstream `Not Found` used to surface as
|
|
1024
|
+
* `opencode: Not Found`, indistinguishable from the spawn failure whose
|
|
1025
|
+
* PATH/installation guidance lives in `wrapSpawnError`. Name the selected
|
|
1026
|
+
* provider/model — only the runner knows it — and keep any structured
|
|
1027
|
+
* upstream status or code, so a provider outage is recognizable as one. */
|
|
1028
|
+
sessionErrorMessage(error) {
|
|
1029
|
+
const id = parseModelIdentity(this.spec.model);
|
|
1030
|
+
const context = id ? `provider ${formatModelIdentity(id)}` : 'provider';
|
|
1031
|
+
const detail = sessionErrorDetail(error);
|
|
1032
|
+
const suffix = detail ? ` (${detail})` : '';
|
|
1033
|
+
return `opencode: ${context} request failed: ${sessionErrorText(error)}${suffix}`;
|
|
1034
|
+
}
|
|
1035
|
+
handleEvent(evt) {
|
|
1036
|
+
const type = evt.type ?? '';
|
|
1037
|
+
const props = evt.properties ?? {};
|
|
1038
|
+
if (type === 'message.updated' || type === 'message.created' || type === 'message.completed') {
|
|
1039
|
+
this.handleMessageEvent(props);
|
|
1040
|
+
}
|
|
1041
|
+
else if (type === 'message.part.updated' || type === 'message.part.created') {
|
|
1042
|
+
this.handlePart(props.part ?? props);
|
|
1043
|
+
}
|
|
1044
|
+
else if (type === 'permission.asked') {
|
|
1045
|
+
this.handlePermissionAsked(props);
|
|
1046
|
+
}
|
|
1047
|
+
else if (type === 'permission.replied') {
|
|
1048
|
+
this.handlePermissionReplied(props);
|
|
1049
|
+
}
|
|
1050
|
+
else if (type === 'session.idle') {
|
|
1051
|
+
// THE turn-end signal. The SSE bus is server-wide, so a child session's
|
|
1052
|
+
// (sub-agent's) idle must not close the main turn; an idle with no
|
|
1053
|
+
// sessionID is treated as ours, like the v2 mapper does.
|
|
1054
|
+
const sid = stringField(props, 'sessionID');
|
|
1055
|
+
if (sid === undefined || sid === this.sessionId)
|
|
1056
|
+
this.finishTurn();
|
|
1057
|
+
}
|
|
1058
|
+
else if (type === 'session.error') {
|
|
1059
|
+
this.handleSessionError(props);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
handleMessageEvent(props) {
|
|
1063
|
+
const info = props.info ?? props;
|
|
1064
|
+
const mid = stringField(info, 'id');
|
|
1065
|
+
const role = stringField(info, 'role');
|
|
1066
|
+
if (mid && role)
|
|
1067
|
+
this.msgRole.set(mid, role);
|
|
1068
|
+
// The model answers a steered user message: it has read it (#505).
|
|
1069
|
+
const parent = role === 'assistant' ? stringField(info, 'parentID') : undefined;
|
|
1070
|
+
const submission = parent ? this.userMessageSubmission.get(parent) : undefined;
|
|
1071
|
+
if (parent && submission) {
|
|
1072
|
+
this.userMessageSubmission.delete(parent);
|
|
1073
|
+
// After an idle, the server started a new run for steered input: a new turn.
|
|
1074
|
+
if (!this.turnActive && this.serverOpen) {
|
|
1075
|
+
this.openTurn();
|
|
1076
|
+
this.emitUi(opencodeTurnStarted);
|
|
1077
|
+
}
|
|
1078
|
+
const ids = this.submissions.consume(submission);
|
|
1079
|
+
if (ids.length)
|
|
1080
|
+
this.opts.onAgentInputConsumed?.(ids);
|
|
1081
|
+
}
|
|
1082
|
+
this.absorbUsage(info);
|
|
1083
|
+
}
|
|
1084
|
+
handlePermissionReplied(props) {
|
|
1085
|
+
// OpenCode settled the request, in any phase: our own reply, another client's, or its own.
|
|
1086
|
+
const nativeId = stringField(props, 'requestID');
|
|
1087
|
+
const pending = nativeId === undefined ? undefined : this.pendingPermissions.get(nativeId);
|
|
1088
|
+
// OpenCode publishes this before it answers the reply route, so a human reply in flight
|
|
1089
|
+
// that it echoes is that human's answer.
|
|
1090
|
+
if (!pending)
|
|
1091
|
+
return;
|
|
1092
|
+
const answered = pending.phase === 'answering' && pending.answer?.reply === stringField(props, 'reply');
|
|
1093
|
+
this.settlePermission(pending, answered ? { optionId: pending.answer.optionId } : { reason: 'resolved by OpenCode' });
|
|
1094
|
+
}
|
|
1095
|
+
handleSessionError(props) {
|
|
1096
|
+
const warning = opencodeSkillWarning(props);
|
|
1097
|
+
if (warning) {
|
|
1098
|
+
this.emit({ type: 'note', message: warning });
|
|
1099
|
+
return;
|
|
1100
|
+
}
|
|
1101
|
+
// The wire's failure signal, now that the prompt POST returns
|
|
1102
|
+
// before the turn runs: forward it to v1, whose `error` events are what
|
|
1103
|
+
// run.ts records failed steps from — dropped, the terminal idle would
|
|
1104
|
+
// file a provider/auth failure as a successful step. The idle that
|
|
1105
|
+
// follows still closes the turn.
|
|
1106
|
+
const sid = stringField(props, 'sessionID');
|
|
1107
|
+
if (sid === undefined || sid === this.sessionId) {
|
|
1108
|
+
this.turnErrored = true;
|
|
1109
|
+
this.emit({ type: 'error', message: this.sessionErrorMessage(props.error) });
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
handlePart(part) {
|
|
1113
|
+
if (!this.partBelongsToUs(part))
|
|
1114
|
+
return;
|
|
1115
|
+
const messageID = stringField(part, 'messageID');
|
|
1116
|
+
const kind = stringField(part, 'type');
|
|
1117
|
+
const id = stringField(part, 'id') ?? messageID ?? '';
|
|
1118
|
+
if (kind === 'text') {
|
|
1119
|
+
const full = stringField(part, 'text') ?? '';
|
|
1120
|
+
const seen = this.textSeen.get(id) ?? 0;
|
|
1121
|
+
if (full.length > seen) {
|
|
1122
|
+
this.textSeen.set(id, full.length);
|
|
1123
|
+
this.textCoalescer.append(id, full.slice(seen));
|
|
1124
|
+
}
|
|
1125
|
+
// `time.end` marks the part finished (same signal the v2 mapper uses) —
|
|
1126
|
+
// emit the whole block once, preferring the snapshot's full text.
|
|
1127
|
+
const time = part.time;
|
|
1128
|
+
if (time && typeof time === 'object' && typeof time.end === 'number') {
|
|
1129
|
+
this.textCoalescer.complete(id, full);
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
else if (kind === 'tool') {
|
|
1133
|
+
this.handleToolPart(part, id, messageID);
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
partBelongsToUs(part) {
|
|
1137
|
+
// The SSE bus carries every session on the server — drop parts that
|
|
1138
|
+
// belong to another one (a sub-agent's stream is surfaced by v2 only).
|
|
1139
|
+
const partSession = stringField(part, 'sessionID');
|
|
1140
|
+
if (partSession !== undefined && this.sessionId !== undefined && partSession !== this.sessionId)
|
|
1141
|
+
return false;
|
|
1142
|
+
// Only surface parts of assistant messages — the user's own message streams
|
|
1143
|
+
// over the same feed. Role is known early (the message.updated event
|
|
1144
|
+
// precedes its parts); an unknown role means "not assistant yet" → skip.
|
|
1145
|
+
const messageID = stringField(part, 'messageID');
|
|
1146
|
+
if (messageID && this.msgRole.get(messageID) !== 'assistant') {
|
|
1147
|
+
// A user message carrying submitted agent text: remember which submission it is.
|
|
1148
|
+
if (this.msgRole.get(messageID) === 'user' && stringField(part, 'type') === 'text' && !this.userMessageSubmission.has(messageID)) {
|
|
1149
|
+
const submission = this.submissions.findByText(stringField(part, 'text') ?? '');
|
|
1150
|
+
if (submission && ![...this.userMessageSubmission.values()].includes(submission))
|
|
1151
|
+
this.userMessageSubmission.set(messageID, submission);
|
|
1152
|
+
}
|
|
1153
|
+
return false;
|
|
1154
|
+
}
|
|
1155
|
+
return true;
|
|
1156
|
+
}
|
|
1157
|
+
handleToolPart(part, id, messageID) {
|
|
1158
|
+
const state = part.state ?? {};
|
|
1159
|
+
const status = stringField(state, 'status');
|
|
1160
|
+
const name = stringField(part, 'tool') ?? stringField(part, 'name') ?? 'tool';
|
|
1161
|
+
this.maybeCaptureQuestion(part, state, status, name, messageID);
|
|
1162
|
+
const callId = id || `${name}-${this.toolsSeen.size}`;
|
|
1163
|
+
if (!this.toolsSeen.has(callId)) {
|
|
1164
|
+
this.toolsSeen.add(callId);
|
|
1165
|
+
this.toolCalls.push({ id: callId, name, input: state.input ?? state });
|
|
1166
|
+
this.emit({ type: 'tool-call', id: callId, tool: name, input: state.input ?? state });
|
|
1167
|
+
}
|
|
1168
|
+
if (status === 'completed' || status === 'error') {
|
|
1169
|
+
this.emit({ type: 'tool-result', toolCallId: callId, result: safeStringify(state.output ?? state.result ?? state), isError: status === 'error' });
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
maybeCaptureQuestion(part, state, status, name, messageID) {
|
|
1173
|
+
const questionPartId = stringField(part, 'id') ?? stringField(part, 'callID') ?? messageID;
|
|
1174
|
+
const questionInput = state.input ?? state;
|
|
1175
|
+
const questionReady = name === 'question' && (toCezarQuestions(questionInput) !== null || status !== 'pending');
|
|
1176
|
+
if (!questionReady || !this.turnActive || this.pendingQuestion !== undefined || this.questionCapture !== undefined || this.questionReply !== undefined || (questionPartId !== undefined && this.handledQuestionParts.has(questionPartId)))
|
|
1177
|
+
return;
|
|
1178
|
+
if (questionPartId)
|
|
1179
|
+
this.handledQuestionParts.add(questionPartId);
|
|
1180
|
+
const capture = this.captureQuestion(questionInput);
|
|
1181
|
+
this.questionCapture = capture;
|
|
1182
|
+
const clearCapture = () => { if (this.questionCapture === capture)
|
|
1183
|
+
this.questionCapture = undefined; };
|
|
1184
|
+
void capture.then(clearCapture, clearCapture);
|
|
1185
|
+
}
|
|
1186
|
+
/** Pull cumulative tokens/cost out of an assistant message info object. */
|
|
1187
|
+
absorbUsage(info) {
|
|
1188
|
+
if (!info)
|
|
1189
|
+
return;
|
|
1190
|
+
const tokens = info.tokens;
|
|
1191
|
+
if (tokens) {
|
|
1192
|
+
const input = numField(tokens, 'input');
|
|
1193
|
+
const output = numField(tokens, 'output');
|
|
1194
|
+
const reasoning = numField(tokens, 'reasoning');
|
|
1195
|
+
const total = input + output + reasoning;
|
|
1196
|
+
if (total > this.tokensUsed) {
|
|
1197
|
+
this.tokensUsed = total;
|
|
1198
|
+
this.emit({ type: 'token-usage', tokensUsed: this.tokensUsed });
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
const messageId = stringField(info, 'id');
|
|
1202
|
+
const cost = info.cost;
|
|
1203
|
+
if (messageId && info.role === 'assistant' &&
|
|
1204
|
+
(info.sessionID === undefined || info.sessionID === this.sessionId) &&
|
|
1205
|
+
typeof cost === 'number' && Number.isFinite(cost) && cost >= 0) {
|
|
1206
|
+
const previous = this.costByMessage.get(messageId);
|
|
1207
|
+
if (previous === undefined || cost > previous) {
|
|
1208
|
+
this.emit({ type: 'cost', usd: cost - (previous ?? 0) });
|
|
1209
|
+
this.costByMessage.set(messageId, cost);
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
async captureQuestion(input) {
|
|
1214
|
+
const questions = toCezarQuestions(input);
|
|
1215
|
+
const turnSerial = this.turnSerial;
|
|
1216
|
+
let requestId;
|
|
1217
|
+
for (let attempt = 0; attempt < 8; attempt += 1) {
|
|
1218
|
+
if (!this.turnActive || this.turnSerial !== turnSerial)
|
|
1219
|
+
return;
|
|
1220
|
+
requestId = await this.pendingQuestionId().catch(() => undefined);
|
|
1221
|
+
if (requestId)
|
|
1222
|
+
break;
|
|
1223
|
+
if (attempt < 7)
|
|
1224
|
+
await sleep(150);
|
|
1225
|
+
}
|
|
1226
|
+
if (!this.turnActive || this.turnSerial !== turnSerial)
|
|
1227
|
+
return;
|
|
1228
|
+
if (!questions) {
|
|
1229
|
+
if (!requestId) {
|
|
1230
|
+
this.emit({
|
|
1231
|
+
type: 'error',
|
|
1232
|
+
message: 'opencode: unsupported native question could not be rejected: no pending question id',
|
|
1233
|
+
});
|
|
1234
|
+
this.finishTurn();
|
|
1235
|
+
this.end();
|
|
1236
|
+
return;
|
|
1237
|
+
}
|
|
1238
|
+
try {
|
|
1239
|
+
await this.http('POST', `/question/${encodeURIComponent(requestId)}/reject`, undefined);
|
|
1240
|
+
this.emit({ type: 'note', message: 'opencode: unsupported native question rejected' });
|
|
1241
|
+
}
|
|
1242
|
+
catch (err) {
|
|
1243
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1244
|
+
this.emit({
|
|
1245
|
+
type: 'error',
|
|
1246
|
+
message: `opencode: unsupported native question rejection failed: ${message}`,
|
|
1247
|
+
});
|
|
1248
|
+
this.finishTurn();
|
|
1249
|
+
this.end();
|
|
1250
|
+
}
|
|
1251
|
+
return;
|
|
1252
|
+
}
|
|
1253
|
+
const pending = {
|
|
1254
|
+
requestId,
|
|
1255
|
+
askRequestId: requestId ?? `opencode-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
1256
|
+
questions,
|
|
1257
|
+
};
|
|
1258
|
+
this.pendingQuestion = pending;
|
|
1259
|
+
this.emitQuestion(pending);
|
|
1260
|
+
}
|
|
1261
|
+
emitQuestion(pending) {
|
|
1262
|
+
this.emitUi((state) => ({
|
|
1263
|
+
state,
|
|
1264
|
+
events: [
|
|
1265
|
+
{
|
|
1266
|
+
type: 'ask.requested',
|
|
1267
|
+
requestId: pending.askRequestId,
|
|
1268
|
+
questions: uiAskQuestions(pending.questions),
|
|
1269
|
+
},
|
|
1270
|
+
],
|
|
1271
|
+
}));
|
|
1272
|
+
}
|
|
1273
|
+
async pendingQuestionId() {
|
|
1274
|
+
const value = await this.http('GET', '/question', undefined);
|
|
1275
|
+
if (!Array.isArray(value))
|
|
1276
|
+
return undefined;
|
|
1277
|
+
for (const entry of value) {
|
|
1278
|
+
if (!isRecord(entry) || stringField(entry, 'sessionID') !== this.sessionId)
|
|
1279
|
+
continue;
|
|
1280
|
+
const id = stringField(entry, 'id');
|
|
1281
|
+
if (id)
|
|
1282
|
+
return id;
|
|
1283
|
+
}
|
|
1284
|
+
return undefined;
|
|
1285
|
+
}
|
|
1286
|
+
async replyQuestion(pending, text) {
|
|
1287
|
+
try {
|
|
1288
|
+
const requestId = pending.requestId ?? (await this.pendingQuestionId());
|
|
1289
|
+
if (!requestId)
|
|
1290
|
+
throw new Error('no pending question id');
|
|
1291
|
+
pending.requestId = requestId;
|
|
1292
|
+
await this.http('POST', `/question/${encodeURIComponent(requestId)}/reply`, {
|
|
1293
|
+
answers: questionAnswers(pending.questions, text),
|
|
1294
|
+
});
|
|
1295
|
+
if (this.pendingQuestion === pending)
|
|
1296
|
+
this.pendingQuestion = undefined;
|
|
1297
|
+
const queued = this.queuedQuestionMessages.splice(0);
|
|
1298
|
+
for (const message of queued)
|
|
1299
|
+
this.deliverPrompt(message);
|
|
1300
|
+
if (queued.length === 0 && this.turnEnded)
|
|
1301
|
+
this.scheduleAutoEnd();
|
|
1302
|
+
}
|
|
1303
|
+
catch (err) {
|
|
1304
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1305
|
+
this.emit({ type: 'note', message: `opencode: question reply failed: ${message}` });
|
|
1306
|
+
if (this.pendingQuestion === pending)
|
|
1307
|
+
this.emitQuestion(pending);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
// ---- permissions (hearsay-tools/cezarion#1266) --------------------------
|
|
1311
|
+
/** Any session on this private server may ask, child sessions included. The ask holds agent
|
|
1312
|
+
* input and auto-end from receipt until OpenCode settles it, the turn ends or the session does. */
|
|
1313
|
+
handlePermissionAsked(props) {
|
|
1314
|
+
if (!this.serverOpen)
|
|
1315
|
+
return;
|
|
1316
|
+
const parsed = opencodePermissionAskSchema.safeParse(props);
|
|
1317
|
+
const nativeId = parsed.success ? parsed.data.id : typeof props.id === 'string' && props.id ? props.id : undefined;
|
|
1318
|
+
if (nativeId === undefined) {
|
|
1319
|
+
// OpenCode blocks the asking tool until a reply names this request: fail closed.
|
|
1320
|
+
this.emit({ type: 'error', message: 'opencode: unsupported permission request could not be rejected: no request id' });
|
|
1321
|
+
this.finishTurn();
|
|
1322
|
+
this.end();
|
|
1323
|
+
return;
|
|
1324
|
+
}
|
|
1325
|
+
if (this.handledPermissionIds.has(nativeId))
|
|
1326
|
+
return;
|
|
1327
|
+
this.handledPermissionIds.add(nativeId);
|
|
1328
|
+
// OpenCode asks only from inside a running session loop, so a main-session ask after the idle
|
|
1329
|
+
// means the server started a run: reopen the turn, as a steered follow-on run does. That run's
|
|
1330
|
+
// own idle closes it. A child session's ask leaves the main turn alone.
|
|
1331
|
+
if (!this.turnActive && this.sessionId !== undefined && stringField(props, 'sessionID') === this.sessionId) {
|
|
1332
|
+
this.openTurn();
|
|
1333
|
+
this.emitUi(opencodeTurnStarted);
|
|
1334
|
+
}
|
|
1335
|
+
const pending = parsed.success
|
|
1336
|
+
? { nativeId, ask: parsed.data, phase: 'classifying' }
|
|
1337
|
+
: { nativeId, phase: 'rejecting' };
|
|
1338
|
+
this.pendingPermissions.set(nativeId, pending);
|
|
1339
|
+
this.agentInputReady = false;
|
|
1340
|
+
this.cancelAutoEnd();
|
|
1341
|
+
if (!parsed.success) {
|
|
1342
|
+
this.emit({ type: 'note', message: 'opencode: rejected an OpenCode permission request cezar could not read' });
|
|
1343
|
+
void this.rejectPermission(pending, 'cezar could not read this permission request');
|
|
1344
|
+
return;
|
|
1345
|
+
}
|
|
1346
|
+
this.permissionQueue = this.permissionQueue.then(() => this.answerPermission(pending)).catch(() => undefined);
|
|
1347
|
+
}
|
|
1348
|
+
/** Still the ask OpenCode is waiting on: not settled, expired or torn down since an await. */
|
|
1349
|
+
permissionLive(pending) {
|
|
1350
|
+
return this.serverOpen && this.pendingPermissions.get(pending.nativeId) === pending;
|
|
1351
|
+
}
|
|
1352
|
+
async answerPermission(pending) {
|
|
1353
|
+
const rules = await this.userPermissionRules();
|
|
1354
|
+
if (!this.permissionLive(pending))
|
|
1355
|
+
return;
|
|
1356
|
+
if (isOpencodeDefaultAsk(pending.ask, rules)) {
|
|
1357
|
+
pending.phase = 'auto-replying';
|
|
1358
|
+
try {
|
|
1359
|
+
// Never `always`: that can persist an approval beyond this run.
|
|
1360
|
+
await this.replyPermission(pending.nativeId, { reply: 'once' });
|
|
1361
|
+
}
|
|
1362
|
+
catch {
|
|
1363
|
+
// OpenCode is still waiting: a failed automatic reply asks the human instead.
|
|
1364
|
+
if (this.permissionLive(pending))
|
|
1365
|
+
this.bridgePermission(pending);
|
|
1366
|
+
return;
|
|
1367
|
+
}
|
|
1368
|
+
if (this.serverOpen && !this.answeredDefaultAsk) {
|
|
1369
|
+
this.answeredDefaultAsk = true;
|
|
1370
|
+
this.emit({
|
|
1371
|
+
type: 'note',
|
|
1372
|
+
message: "opencode: answered OpenCode's built-in permission asks (outside-worktree reads, .env reads, repeated-call guard) with allow-once; your own OpenCode permission rules still ask",
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
this.settlePermission(pending);
|
|
1376
|
+
return;
|
|
1377
|
+
}
|
|
1378
|
+
this.bridgePermission(pending);
|
|
1379
|
+
}
|
|
1380
|
+
/** One lazy `GET /config` per session. An unreadable config is unknown provenance: every ask goes to the cockpit. */
|
|
1381
|
+
userPermissionRules() {
|
|
1382
|
+
this.permissionRules ??= this.readConfig().then(opencodeUserPermissionRules, () => undefined).then((rules) => {
|
|
1383
|
+
if (!rules)
|
|
1384
|
+
this.emit({ type: 'note', message: 'opencode: could not read the OpenCode config, so every permission prompt goes to the cockpit' });
|
|
1385
|
+
return rules;
|
|
1386
|
+
});
|
|
1387
|
+
return this.permissionRules;
|
|
1388
|
+
}
|
|
1389
|
+
/** Unlike `http`, an empty or unparsable body is a failure, never an empty config. */
|
|
1390
|
+
async readConfig() {
|
|
1391
|
+
if (!this.baseUrl)
|
|
1392
|
+
throw new Error('opencode server not ready');
|
|
1393
|
+
const res = await fetch(`${this.baseUrl}/config`, { method: 'GET' });
|
|
1394
|
+
if (!res.ok)
|
|
1395
|
+
throw new Error(`GET /config → ${res.status}`);
|
|
1396
|
+
return JSON.parse(await res.text());
|
|
1397
|
+
}
|
|
1398
|
+
bridgePermission(pending) {
|
|
1399
|
+
if (!this.opts.onUiEvent) {
|
|
1400
|
+
const message = 'no permission UI is attached to this cezar session';
|
|
1401
|
+
this.emit({ type: 'note', message: `opencode: rejected the OpenCode ${pending.ask.permission} permission prompt: ${message}` });
|
|
1402
|
+
void this.rejectPermission(pending, message);
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
if (!this.showPermissionCard(pending))
|
|
1406
|
+
void this.rejectPermission(pending, 'permission UI unavailable');
|
|
1407
|
+
}
|
|
1408
|
+
/** Emits a fresh cockpit card, with new ids, for the ask. False when the UI threw: that card is resolved again. */
|
|
1409
|
+
showPermissionCard(pending) {
|
|
1410
|
+
const bridge = opencodePermissionBridge(pending.ask);
|
|
1411
|
+
pending.bridge = bridge;
|
|
1412
|
+
pending.phase = 'card';
|
|
1413
|
+
pending.answer = undefined;
|
|
1414
|
+
try {
|
|
1415
|
+
this.opts.onUiEvent(bridge.event);
|
|
1416
|
+
return true;
|
|
1417
|
+
}
|
|
1418
|
+
catch {
|
|
1419
|
+
// A throwing consumer cannot leave OpenCode waiting on a card nobody sees.
|
|
1420
|
+
pending.bridge = undefined;
|
|
1421
|
+
this.emitPermissionResolved(bridge.event.requestId, { reason: 'permission UI unavailable' });
|
|
1422
|
+
return false;
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
/** A reject OpenCode never receives leaves the asking tool blocked: fail closed. */
|
|
1426
|
+
async rejectPermission(pending, message) {
|
|
1427
|
+
pending.phase = 'rejecting';
|
|
1428
|
+
try {
|
|
1429
|
+
await this.replyPermission(pending.nativeId, { reply: 'reject', message });
|
|
1430
|
+
}
|
|
1431
|
+
catch (err) {
|
|
1432
|
+
if (!this.permissionLive(pending))
|
|
1433
|
+
return;
|
|
1434
|
+
this.emit({ type: 'error', message: `opencode: permission rejection failed: ${err instanceof Error ? err.message : String(err)}` });
|
|
1435
|
+
this.finishTurn();
|
|
1436
|
+
this.end();
|
|
1437
|
+
return;
|
|
1438
|
+
}
|
|
1439
|
+
this.settlePermission(pending);
|
|
1440
|
+
}
|
|
1441
|
+
/** The card and the input barrier stay until OpenCode accepts the reply; a failed reply shows a fresh card. */
|
|
1442
|
+
respondPermission(requestId, optionId) {
|
|
1443
|
+
if (!this.serverOpen)
|
|
1444
|
+
return false;
|
|
1445
|
+
const pending = [...this.pendingPermissions.values()].find((entry) => entry.bridge?.event.requestId === requestId);
|
|
1446
|
+
const reply = pending?.bridge?.replies.get(optionId);
|
|
1447
|
+
if (!pending || pending.phase !== 'card' || !reply)
|
|
1448
|
+
return false;
|
|
1449
|
+
const bridge = pending.bridge;
|
|
1450
|
+
pending.phase = 'answering';
|
|
1451
|
+
pending.answer = { optionId, reply };
|
|
1452
|
+
void this.replyPermission(pending.nativeId, { reply }).then(() => {
|
|
1453
|
+
if (this.permissionLive(pending) && pending.bridge === bridge)
|
|
1454
|
+
this.settlePermission(pending, { optionId });
|
|
1455
|
+
}, (err) => {
|
|
1456
|
+
if (!this.permissionLive(pending) || pending.bridge !== bridge)
|
|
1457
|
+
return;
|
|
1458
|
+
this.emit({ type: 'note', message: `opencode: permission reply failed: ${err instanceof Error ? err.message : String(err)}` });
|
|
1459
|
+
// The fresh card first, so the run's pending set never empties and it stays parked.
|
|
1460
|
+
const shown = this.showPermissionCard(pending);
|
|
1461
|
+
this.emitPermissionResolved(bridge.event.requestId, { reason: 'permission reply failed' });
|
|
1462
|
+
if (!shown)
|
|
1463
|
+
void this.rejectPermission(pending, 'permission UI unavailable');
|
|
1464
|
+
});
|
|
1465
|
+
return true;
|
|
1466
|
+
}
|
|
1467
|
+
async replyPermission(nativeId, body) {
|
|
1468
|
+
await this.http('POST', `/permission/${encodeURIComponent(nativeId)}/reply`, body);
|
|
1469
|
+
}
|
|
1470
|
+
/** OpenCode no longer waits on the ask: retire it, resolve its card, and release the barrier. */
|
|
1471
|
+
settlePermission(pending, resolution = {}) {
|
|
1472
|
+
if (this.pendingPermissions.get(pending.nativeId) !== pending)
|
|
1473
|
+
return;
|
|
1474
|
+
this.pendingPermissions.delete(pending.nativeId);
|
|
1475
|
+
if (pending.bridge)
|
|
1476
|
+
this.emitPermissionResolved(pending.bridge.event.requestId, resolution);
|
|
1477
|
+
if (this.pendingPermissions.size)
|
|
1478
|
+
return;
|
|
1479
|
+
this.notifyAgentInputReady();
|
|
1480
|
+
// A card that arrived after the turn ended cancelled its auto-end: re-arm it.
|
|
1481
|
+
if (this.turnEnded && !this.turnActive && !this.questionReply)
|
|
1482
|
+
this.scheduleAutoEnd();
|
|
1483
|
+
}
|
|
1484
|
+
/** Retires every ask without HTTP: OpenCode settles its own request on idle or abort. The
|
|
1485
|
+
* caller owns what follows (turn end or teardown), so the barrier release is not run here. */
|
|
1486
|
+
expirePermissions(reason) {
|
|
1487
|
+
for (const pending of [...this.pendingPermissions.values()]) {
|
|
1488
|
+
this.pendingPermissions.delete(pending.nativeId);
|
|
1489
|
+
if (pending.bridge)
|
|
1490
|
+
this.emitPermissionResolved(pending.bridge.event.requestId, { reason });
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
emitPermissionResolved(requestId, resolution) {
|
|
1494
|
+
try {
|
|
1495
|
+
this.opts.onUiEvent?.({ type: 'permission.resolved', requestId, ...resolution });
|
|
1496
|
+
}
|
|
1497
|
+
catch { /* A failed consumer must not strand other pending requests. */ }
|
|
1498
|
+
}
|
|
1499
|
+
// ---- http ---------------------------------------------------------------
|
|
1500
|
+
async http(method, path, body, signal) {
|
|
1501
|
+
if (!this.baseUrl)
|
|
1502
|
+
throw new Error('opencode server not ready');
|
|
1503
|
+
// Plain fetch is fine here: every call is a short round-trip now that
|
|
1504
|
+
// prompts go through `prompt_async` — nothing long-polls anymore.
|
|
1505
|
+
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
1506
|
+
method,
|
|
1507
|
+
...(signal !== undefined ? { signal } : {}),
|
|
1508
|
+
headers: body !== undefined ? { 'content-type': 'application/json' } : {},
|
|
1509
|
+
...(body !== undefined ? { body: JSON.stringify(body) } : {}),
|
|
1510
|
+
});
|
|
1511
|
+
if (!res.ok) {
|
|
1512
|
+
const detail = await res.text().catch(() => '');
|
|
1513
|
+
throw new Error(`${method} ${path} → ${res.status} ${detail.slice(0, 200)}`);
|
|
1514
|
+
}
|
|
1515
|
+
const text = await res.text();
|
|
1516
|
+
if (!text)
|
|
1517
|
+
return {};
|
|
1518
|
+
try {
|
|
1519
|
+
return JSON.parse(text);
|
|
1520
|
+
}
|
|
1521
|
+
catch {
|
|
1522
|
+
return {};
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
emit(event) {
|
|
1526
|
+
this.onEvent?.(event);
|
|
1527
|
+
}
|
|
1528
|
+
/** The mapper never throws, but a defect in it must still never disturb
|
|
1529
|
+
* the v1 stream — hence the belt-and-braces try. */
|
|
1530
|
+
emitUi(map) {
|
|
1531
|
+
try {
|
|
1532
|
+
const mapped = map(this.uiState);
|
|
1533
|
+
this.uiState = mapped.state;
|
|
1534
|
+
if (this.opts.onUiEvent) {
|
|
1535
|
+
for (const event of mapped.events)
|
|
1536
|
+
this.opts.onUiEvent(event);
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
catch {
|
|
1540
|
+
// v2 mapping is best-effort; v1 consumers stay unaffected.
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
function textOf(content) {
|
|
1545
|
+
return content
|
|
1546
|
+
.filter((b) => b.type === 'text')
|
|
1547
|
+
.map((b) => b.text)
|
|
1548
|
+
.join('\n')
|
|
1549
|
+
.trim();
|
|
1550
|
+
}
|
|
1551
|
+
function toCezarQuestions(value) {
|
|
1552
|
+
if (!isRecord(value) || !Array.isArray(value.questions))
|
|
1553
|
+
return null;
|
|
1554
|
+
if (value.questions.length < 1 || value.questions.length > 4)
|
|
1555
|
+
return null;
|
|
1556
|
+
const questions = [];
|
|
1557
|
+
for (const rawQuestion of value.questions) {
|
|
1558
|
+
if (!isRecord(rawQuestion))
|
|
1559
|
+
return null;
|
|
1560
|
+
const header = clippedString(rawQuestion.header, 12);
|
|
1561
|
+
const question = clippedString(rawQuestion.question, 400);
|
|
1562
|
+
if (!header || !question || !Array.isArray(rawQuestion.options))
|
|
1563
|
+
return null;
|
|
1564
|
+
const options = [];
|
|
1565
|
+
for (const rawOption of rawQuestion.options) {
|
|
1566
|
+
if (options.length === 4)
|
|
1567
|
+
break;
|
|
1568
|
+
if (!isRecord(rawOption))
|
|
1569
|
+
continue;
|
|
1570
|
+
const label = clippedString(rawOption.label, 60);
|
|
1571
|
+
if (!label)
|
|
1572
|
+
continue;
|
|
1573
|
+
const description = clippedString(rawOption.description, 280);
|
|
1574
|
+
options.push({ label, ...(description ? { description } : {}) });
|
|
1575
|
+
}
|
|
1576
|
+
if (options.length < 2)
|
|
1577
|
+
return null;
|
|
1578
|
+
questions.push({
|
|
1579
|
+
header,
|
|
1580
|
+
question,
|
|
1581
|
+
options,
|
|
1582
|
+
...(rawQuestion.multiple === true ? { multiSelect: true } : {}),
|
|
1583
|
+
});
|
|
1584
|
+
}
|
|
1585
|
+
return parseAskRequest({ questions })?.questions ?? null;
|
|
1586
|
+
}
|
|
1587
|
+
function questionAnswers(questions, text) {
|
|
1588
|
+
const answers = questions.map(() => []);
|
|
1589
|
+
const matched = new Set();
|
|
1590
|
+
for (const line of text.split('\n')) {
|
|
1591
|
+
const trimmed = line.trim();
|
|
1592
|
+
const index = questions.findIndex((question, questionIndex) => !matched.has(questionIndex) && trimmed.startsWith(`${question.header}:`));
|
|
1593
|
+
if (index < 0)
|
|
1594
|
+
continue;
|
|
1595
|
+
matched.add(index);
|
|
1596
|
+
answers[index] = trimmed
|
|
1597
|
+
.slice(questions[index].header.length + 1)
|
|
1598
|
+
.split(',')
|
|
1599
|
+
.map((answer) => answer.trim())
|
|
1600
|
+
.filter(Boolean);
|
|
1601
|
+
}
|
|
1602
|
+
if (matched.size === 0 && answers[0])
|
|
1603
|
+
answers[0] = [text.trim()];
|
|
1604
|
+
return answers;
|
|
1605
|
+
}
|
|
1606
|
+
function clippedString(value, max) {
|
|
1607
|
+
if (typeof value !== 'string')
|
|
1608
|
+
return undefined;
|
|
1609
|
+
const trimmed = value.trim();
|
|
1610
|
+
return trimmed ? trimmed.slice(0, max) : undefined;
|
|
1611
|
+
}
|
|
1612
|
+
function isRecord(value) {
|
|
1613
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
1614
|
+
}
|
|
1615
|
+
function sleep(ms) {
|
|
1616
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1617
|
+
}
|
|
1618
|
+
function stringField(obj, key) {
|
|
1619
|
+
const v = obj[key];
|
|
1620
|
+
return typeof v === 'string' ? v : undefined;
|
|
1621
|
+
}
|
|
1622
|
+
/** Same reading of the wire error shape as the v2 mapper's `errorText`
|
|
1623
|
+
* (`opencode-ui-mapper.ts`): a bare string, `{message}`, `{data:{message}}`
|
|
1624
|
+
* (the real server's `ProviderAuthError` shape), or `{name}` as a last resort. */
|
|
1625
|
+
function sessionErrorText(error) {
|
|
1626
|
+
if (typeof error === 'string')
|
|
1627
|
+
return error;
|
|
1628
|
+
if (typeof error !== 'object' || error === null)
|
|
1629
|
+
return 'session error';
|
|
1630
|
+
const rec = error;
|
|
1631
|
+
const data = typeof rec.data === 'object' && rec.data !== null ? rec.data : undefined;
|
|
1632
|
+
return (stringField(rec, 'message') ??
|
|
1633
|
+
(data && stringField(data, 'message')) ??
|
|
1634
|
+
stringField(rec, 'name') ??
|
|
1635
|
+
'session error');
|
|
1636
|
+
}
|
|
1637
|
+
/** Structured upstream status or code, when the wire error carries one —
|
|
1638
|
+
* the AI SDK's `AI_APICallError` exposes a numeric `statusCode`, and some
|
|
1639
|
+
* providers nest a `code` inside `data`. Status wins over code; anything
|
|
1640
|
+
* else adds nothing (#53). */
|
|
1641
|
+
function sessionErrorDetail(error) {
|
|
1642
|
+
if (typeof error !== 'object' || error === null)
|
|
1643
|
+
return undefined;
|
|
1644
|
+
const rec = error;
|
|
1645
|
+
const data = isRecord(rec.data) ? rec.data : undefined;
|
|
1646
|
+
const status = numField(rec, 'statusCode') ||
|
|
1647
|
+
numField(rec, 'status') ||
|
|
1648
|
+
(data ? numField(data, 'statusCode') : 0) ||
|
|
1649
|
+
(data ? numField(data, 'status') : 0);
|
|
1650
|
+
if (status > 0)
|
|
1651
|
+
return `HTTP ${status}`;
|
|
1652
|
+
const rawCode = rec.code ?? (data ? data.code : undefined);
|
|
1653
|
+
if (typeof rawCode === 'string' && rawCode.trim())
|
|
1654
|
+
return `code ${rawCode.trim()}`;
|
|
1655
|
+
if (typeof rawCode === 'number')
|
|
1656
|
+
return `code ${rawCode}`;
|
|
1657
|
+
return undefined;
|
|
1658
|
+
}
|
|
1659
|
+
function numField(obj, key) {
|
|
1660
|
+
const v = obj[key];
|
|
1661
|
+
return typeof v === 'number' ? v : 0;
|
|
1662
|
+
}
|
|
1663
|
+
function safeStringify(value) {
|
|
1664
|
+
if (typeof value === 'string')
|
|
1665
|
+
return value;
|
|
1666
|
+
try {
|
|
1667
|
+
return JSON.stringify(value);
|
|
1668
|
+
}
|
|
1669
|
+
catch {
|
|
1670
|
+
return String(value);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
/** `code N` or `signal S` for a server process that exited. */
|
|
1674
|
+
function describeExit(serve) {
|
|
1675
|
+
const { exitCode, signalCode } = serve.child;
|
|
1676
|
+
return exitCode !== null ? `code ${exitCode}` : `signal ${signalCode}`;
|
|
1677
|
+
}
|
|
1678
|
+
/** `code N — <stderr summary>` for one start that exited before listening. */
|
|
1679
|
+
function describeEarlyExit(serve) {
|
|
1680
|
+
const detail = summarizeRunnerStderr(serve.stderrChunks.join(''));
|
|
1681
|
+
return `${describeExit(serve)}${detail ? ` — ${detail}` : ''}`;
|
|
1682
|
+
}
|
|
1683
|
+
function wrapSpawnError(err, bin) {
|
|
1684
|
+
const code = err?.code;
|
|
1685
|
+
if (code === 'ENOENT') {
|
|
1686
|
+
return new Error(`\`${bin}\` not found on PATH — install OpenCode (https://opencode.ai) and run \`opencode\` once to configure a provider`);
|
|
1687
|
+
}
|
|
1688
|
+
return err instanceof Error ? err : new Error(String(err));
|
|
1689
|
+
}
|
|
1690
|
+
//# sourceMappingURL=opencode-server-runner.js.map
|