@songsid/agend 2.3.5 → 2.4.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/README.zh-TW.md +2 -0
- package/THIRD_PARTY_NOTICES.md +71 -0
- package/dist/accounts-profiles.d.ts +102 -0
- package/dist/accounts-profiles.js +194 -0
- package/dist/accounts-profiles.js.map +1 -0
- package/dist/accounts-signout.d.ts +59 -0
- package/dist/accounts-signout.js +181 -0
- package/dist/accounts-signout.js.map +1 -0
- package/dist/accounts-view.d.ts +189 -0
- package/dist/accounts-view.js +204 -0
- package/dist/accounts-view.js.map +1 -0
- package/dist/agent-endpoint.d.ts +5 -1
- package/dist/agent-endpoint.js +12 -2
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-export.d.ts +74 -0
- package/dist/agent-export.js +362 -0
- package/dist/agent-export.js.map +1 -0
- package/dist/agent-file-read.js +1 -1
- package/dist/agent-file-read.js.map +1 -1
- package/dist/agent-runtime-api.d.ts +4 -0
- package/dist/agent-runtime-api.js +59 -0
- package/dist/agent-runtime-api.js.map +1 -0
- package/dist/agent-runtime-change.d.ts +76 -0
- package/dist/agent-runtime-change.js +114 -0
- package/dist/agent-runtime-change.js.map +1 -0
- package/dist/agent-whats-new.js +10 -3
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/agent-workspace.d.ts +103 -0
- package/dist/agent-workspace.js +360 -0
- package/dist/agent-workspace.js.map +1 -0
- package/dist/apply-job.d.ts +5 -0
- package/dist/apply-job.js +10 -3
- package/dist/apply-job.js.map +1 -1
- package/dist/auth-api.d.ts +78 -0
- package/dist/auth-api.js +350 -16
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/company-join.d.ts +16 -0
- package/dist/authority/company-join.js +37 -0
- package/dist/authority/company-join.js.map +1 -0
- package/dist/authority/hub-initialization.d.ts +13 -0
- package/dist/authority/hub-initialization.js +30 -0
- package/dist/authority/hub-initialization.js.map +1 -0
- package/dist/authority/settings-role.d.ts +56 -0
- package/dist/authority/settings-role.js +48 -0
- package/dist/authority/settings-role.js.map +1 -0
- package/dist/authority/web-authority.d.ts +25 -2
- package/dist/authority/web-authority.js +37 -4
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/backend/claude-code.d.ts +19 -16
- package/dist/backend/claude-code.js +179 -144
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/claude-context.d.ts +17 -0
- package/dist/backend/claude-context.js +30 -0
- package/dist/backend/claude-context.js.map +1 -0
- package/dist/backend/codex-footer-hints.d.ts +3 -0
- package/dist/backend/codex-footer-hints.js +14 -0
- package/dist/backend/codex-footer-hints.js.map +1 -1
- package/dist/backend/codex-package.d.ts +5 -2
- package/dist/backend/codex-package.js +1 -5
- package/dist/backend/codex-package.js.map +1 -1
- package/dist/backend/codex-quota-history.js +4 -19
- package/dist/backend/codex-quota-history.js.map +1 -1
- package/dist/backend/codex.d.ts +149 -129
- package/dist/backend/codex.js +1323 -1233
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/credential-profile.d.ts +21 -0
- package/dist/backend/credential-profile.js +48 -1
- package/dist/backend/credential-profile.js.map +1 -1
- package/dist/backend/effort-metadata.d.ts +38 -2
- package/dist/backend/effort-metadata.js +145 -8
- package/dist/backend/effort-metadata.js.map +1 -1
- package/dist/backend/grok-mcp.d.ts +5 -0
- package/dist/backend/grok-mcp.js +221 -0
- package/dist/backend/grok-mcp.js.map +1 -0
- package/dist/backend/grok-model-cache.d.ts +7 -0
- package/dist/backend/grok-model-cache.js +65 -0
- package/dist/backend/grok-model-cache.js.map +1 -0
- package/dist/backend/grok.d.ts +7 -10
- package/dist/backend/grok.js +44 -88
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro.js +1 -1
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/launch-effort.d.ts +1 -1
- package/dist/backend/launch-effort.js +7 -3
- package/dist/backend/launch-effort.js.map +1 -1
- package/dist/backend/native-pane.d.ts +11 -0
- package/dist/backend/native-pane.js +59 -0
- package/dist/backend/native-pane.js.map +1 -0
- package/dist/backend/types.d.ts +20 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-availability.d.ts +15 -0
- package/dist/backend-availability.js +37 -1
- package/dist/backend-availability.js.map +1 -1
- package/dist/backend-signin-pending.d.ts +8 -2
- package/dist/backend-signin-pending.js +6 -2
- package/dist/backend-signin-pending.js.map +1 -1
- package/dist/browser-backend-signins.d.ts +2 -1
- package/dist/browser-backend-signins.js +1 -1
- package/dist/browser-backend-signins.js.map +1 -1
- package/dist/build-provenance-cli.d.ts +3 -0
- package/dist/build-provenance-cli.js +11 -0
- package/dist/build-provenance-cli.js.map +1 -0
- package/dist/build-provenance.d.ts +20 -0
- package/dist/build-provenance.js +67 -0
- package/dist/build-provenance.js.map +1 -0
- package/dist/build-provenance.json +1 -0
- package/dist/bundled-tmux-guard.d.ts +0 -2
- package/dist/bundled-tmux-guard.js +10 -23
- package/dist/bundled-tmux-guard.js.map +1 -1
- package/dist/channel/ipc-bridge.d.ts +2 -0
- package/dist/channel/mcp-tools.js +4 -4
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/classic-bindings.d.ts +13 -0
- package/dist/classic-bindings.js +28 -2
- package/dist/classic-bindings.js.map +1 -1
- package/dist/claude-auth-status.d.ts +60 -0
- package/dist/claude-auth-status.js +165 -0
- package/dist/claude-auth-status.js.map +1 -0
- package/dist/cli-audited.d.ts +60 -0
- package/dist/cli-audited.js +84 -0
- package/dist/cli-audited.js.map +1 -0
- package/dist/cli-capability.d.ts +217 -0
- package/dist/cli-capability.js +55 -0
- package/dist/cli-capability.js.map +1 -0
- package/dist/cli-caps-module.d.ts +33 -0
- package/dist/cli-caps-module.js +45 -0
- package/dist/cli-caps-module.js.map +1 -0
- package/dist/cli-registry-check.d.ts +28 -0
- package/dist/cli-registry-check.js +237 -0
- package/dist/cli-registry-check.js.map +1 -0
- package/dist/cli-registry.d.ts +578 -0
- package/dist/cli-registry.js +83 -0
- package/dist/cli-registry.js.map +1 -0
- package/dist/cli-spec-antigravity.d.ts +71 -0
- package/dist/cli-spec-antigravity.js +47 -0
- package/dist/cli-spec-antigravity.js.map +1 -0
- package/dist/cli-spec-claude-code.d.ts +93 -0
- package/dist/cli-spec-claude-code.js +37 -0
- package/dist/cli-spec-claude-code.js.map +1 -0
- package/dist/cli-spec-codex.d.ts +87 -0
- package/dist/cli-spec-codex.js +40 -0
- package/dist/cli-spec-codex.js.map +1 -0
- package/dist/cli-spec-grok.d.ts +64 -0
- package/dist/cli-spec-grok.js +40 -0
- package/dist/cli-spec-grok.js.map +1 -0
- package/dist/cli-spec-kiro-cli.d.ts +79 -0
- package/dist/cli-spec-kiro-cli.js +40 -0
- package/dist/cli-spec-kiro-cli.js.map +1 -0
- package/dist/cli-spec-muse.d.ts +54 -0
- package/dist/cli-spec-muse.js +40 -0
- package/dist/cli-spec-muse.js.map +1 -0
- package/dist/cli-spec-opencode.d.ts +60 -0
- package/dist/cli-spec-opencode.js +42 -0
- package/dist/cli-spec-opencode.js.map +1 -0
- package/dist/cli.js +311 -54
- package/dist/cli.js.map +1 -1
- package/dist/codex-pane-ownership.d.ts +13 -0
- package/dist/codex-pane-ownership.js +192 -0
- package/dist/codex-pane-ownership.js.map +1 -0
- package/dist/config-validator.js +93 -2
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +16 -0
- package/dist/config.js.map +1 -1
- package/dist/create-host-account.d.ts +17 -0
- package/dist/create-host-account.js +47 -0
- package/dist/create-host-account.js.map +1 -0
- package/dist/daemon.d.ts +101 -7
- package/dist/daemon.js +1058 -282
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-consumed-watch.d.ts +15 -3
- package/dist/delivery-consumed-watch.js +23 -1
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/delivery-outbox.d.ts +9 -0
- package/dist/delivery-outbox.js +43 -4
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/delivery-reconciliation.d.ts +2 -42
- package/dist/delivery-reconciliation.js +2 -164
- package/dist/delivery-reconciliation.js.map +1 -1
- package/dist/dispatcher-liveness.d.ts +172 -0
- package/dist/dispatcher-liveness.js +238 -0
- package/dist/dispatcher-liveness.js.map +1 -0
- package/dist/doctor.js +19 -9
- package/dist/doctor.js.map +1 -1
- package/dist/e2e-isolation.js +5 -2
- package/dist/e2e-isolation.js.map +1 -1
- package/dist/fleet-context.d.ts +7 -3
- package/dist/fleet-control-audit.d.ts +1 -1
- package/dist/fleet-level-config.d.ts +1 -1
- package/dist/fleet-level-config.js +2 -0
- package/dist/fleet-level-config.js.map +1 -1
- package/dist/fleet-manager.d.ts +1079 -29
- package/dist/fleet-manager.js +5564 -420
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +98 -0
- package/dist/fleet-windows-runtime.js +467 -0
- package/dist/fleet-windows-runtime.js.map +1 -0
- package/dist/general-binding.d.ts +85 -0
- package/dist/general-binding.js +298 -0
- package/dist/general-binding.js.map +1 -0
- package/dist/general-host-owner.d.ts +8 -0
- package/dist/general-host-owner.js +26 -0
- package/dist/general-host-owner.js.map +1 -0
- package/dist/general-instance.d.ts +7 -0
- package/dist/general-instance.js +20 -3
- package/dist/general-instance.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +75 -23
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +23 -9
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +1 -1
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +2 -2
- package/dist/general-knowledge/skills/fleet-restart/SKILL.md +1 -1
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -1
- package/dist/general-knowledge/skills/session-management/SKILL.md +1 -1
- package/dist/general-knowledge/skills/tui-effort/SKILL.md +10 -10
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +48 -26
- package/dist/general-knowledge/steering/core-rules.md +2 -2
- package/dist/general-role.d.ts +5 -0
- package/dist/general-role.js +27 -0
- package/dist/general-role.js.map +1 -0
- package/dist/hub/admission.d.ts +28 -0
- package/dist/hub/admission.js +62 -0
- package/dist/hub/admission.js.map +1 -0
- package/dist/hub/attachments/limits.d.ts +20 -0
- package/dist/hub/attachments/limits.js +48 -0
- package/dist/hub/attachments/limits.js.map +1 -0
- package/dist/hub/attachments/store.d.ts +116 -0
- package/dist/hub/attachments/store.js +246 -0
- package/dist/hub/attachments/store.js.map +1 -0
- package/dist/hub/audit/index.d.ts +62 -0
- package/dist/hub/audit/index.js +344 -0
- package/dist/hub/audit/index.js.map +1 -0
- package/dist/hub/browser-certificate.d.ts +38 -0
- package/dist/hub/browser-certificate.js +247 -0
- package/dist/hub/browser-certificate.js.map +1 -0
- package/dist/hub/buttons-model.d.ts +9 -0
- package/dist/hub/buttons-model.js +42 -0
- package/dist/hub/buttons-model.js.map +1 -0
- package/dist/hub/buttons.d.ts +54 -0
- package/dist/hub/buttons.js +348 -0
- package/dist/hub/buttons.js.map +1 -0
- package/dist/hub/catalog.d.ts +74 -0
- package/dist/hub/catalog.js +380 -0
- package/dist/hub/catalog.js.map +1 -0
- package/dist/hub/client.d.ts +71 -0
- package/dist/hub/client.js +333 -0
- package/dist/hub/client.js.map +1 -0
- package/dist/hub/compose/member.d.ts +145 -0
- package/dist/hub/compose/member.js +467 -0
- package/dist/hub/compose/member.js.map +1 -0
- package/dist/hub/compose/server.d.ts +170 -0
- package/dist/hub/compose/server.js +494 -0
- package/dist/hub/compose/server.js.map +1 -0
- package/dist/hub/compose/storage.d.ts +5 -0
- package/dist/hub/compose/storage.js +28 -0
- package/dist/hub/compose/storage.js.map +1 -0
- package/dist/hub/compose/views.d.ts +12 -0
- package/dist/hub/compose/views.js +4 -0
- package/dist/hub/compose/views.js.map +1 -0
- package/dist/hub/db.d.ts +58 -0
- package/dist/hub/db.js +215 -0
- package/dist/hub/db.js.map +1 -0
- package/dist/hub/directory/config.d.ts +39 -0
- package/dist/hub/directory/config.js +108 -0
- package/dist/hub/directory/config.js.map +1 -0
- package/dist/hub/directory/directory.d.ts +25 -0
- package/dist/hub/directory/directory.js +588 -0
- package/dist/hub/directory/directory.js.map +1 -0
- package/dist/hub/directory/groups.d.ts +55 -0
- package/dist/hub/directory/groups.js +30 -0
- package/dist/hub/directory/groups.js.map +1 -0
- package/dist/hub/directory/index.d.ts +8 -0
- package/dist/hub/directory/index.js +4 -0
- package/dist/hub/directory/index.js.map +1 -0
- package/dist/hub/directory/profiles.d.ts +41 -0
- package/dist/hub/directory/profiles.js +90 -0
- package/dist/hub/directory/profiles.js.map +1 -0
- package/dist/hub/directory/types.d.ts +84 -0
- package/dist/hub/directory/types.js +14 -0
- package/dist/hub/directory/types.js.map +1 -0
- package/dist/hub/directory-response-owner.d.ts +38 -0
- package/dist/hub/directory-response-owner.js +191 -0
- package/dist/hub/directory-response-owner.js.map +1 -0
- package/dist/hub/enrollment-budget.d.ts +6 -0
- package/dist/hub/enrollment-budget.js +24 -0
- package/dist/hub/enrollment-budget.js.map +1 -0
- package/dist/hub/execution/cli-provider.d.ts +23 -0
- package/dist/hub/execution/cli-provider.js +341 -0
- package/dist/hub/execution/cli-provider.js.map +1 -0
- package/dist/hub/execution/index.d.ts +13 -0
- package/dist/hub/execution/index.js +8 -0
- package/dist/hub/execution/index.js.map +1 -0
- package/dist/hub/execution/model-broker.d.ts +24 -0
- package/dist/hub/execution/model-broker.js +208 -0
- package/dist/hub/execution/model-broker.js.map +1 -0
- package/dist/hub/execution/provider-setup.d.ts +11 -0
- package/dist/hub/execution/provider-setup.js +21 -0
- package/dist/hub/execution/provider-setup.js.map +1 -0
- package/dist/hub/execution/sandbox-runner.d.ts +1 -0
- package/dist/hub/execution/sandbox-runner.js +221 -0
- package/dist/hub/execution/sandbox-runner.js.map +1 -0
- package/dist/hub/execution/service.d.ts +136 -0
- package/dist/hub/execution/service.js +459 -0
- package/dist/hub/execution/service.js.map +1 -0
- package/dist/hub/execution/store.d.ts +61 -0
- package/dist/hub/execution/store.js +182 -0
- package/dist/hub/execution/store.js.map +1 -0
- package/dist/hub/execution/views.d.ts +20 -0
- package/dist/hub/execution/views.js +48 -0
- package/dist/hub/execution/views.js.map +1 -0
- package/dist/hub/fleet-revocation.d.ts +3 -0
- package/dist/hub/fleet-revocation.js +7 -0
- package/dist/hub/fleet-revocation.js.map +1 -0
- package/dist/hub/group-policy/admin-api.d.ts +30 -0
- package/dist/hub/group-policy/admin-api.js +92 -0
- package/dist/hub/group-policy/admin-api.js.map +1 -0
- package/dist/hub/group-policy/admin-context.d.ts +23 -0
- package/dist/hub/group-policy/admin-context.js +52 -0
- package/dist/hub/group-policy/admin-context.js.map +1 -0
- package/dist/hub/group-policy/admin-control.d.ts +35 -0
- package/dist/hub/group-policy/admin-control.js +260 -0
- package/dist/hub/group-policy/admin-control.js.map +1 -0
- package/dist/hub/group-policy/admin-dto.d.ts +259 -0
- package/dist/hub/group-policy/admin-dto.js +57 -0
- package/dist/hub/group-policy/admin-dto.js.map +1 -0
- package/dist/hub/group-policy/admin-facts.d.ts +17 -0
- package/dist/hub/group-policy/admin-facts.js +33 -0
- package/dist/hub/group-policy/admin-facts.js.map +1 -0
- package/dist/hub/group-policy/admin-impact.d.ts +51 -0
- package/dist/hub/group-policy/admin-impact.js +88 -0
- package/dist/hub/group-policy/admin-impact.js.map +1 -0
- package/dist/hub/group-policy/admin-inventory.d.ts +24 -0
- package/dist/hub/group-policy/admin-inventory.js +72 -0
- package/dist/hub/group-policy/admin-inventory.js.map +1 -0
- package/dist/hub/group-policy/admin-read.d.ts +21 -0
- package/dist/hub/group-policy/admin-read.js +95 -0
- package/dist/hub/group-policy/admin-read.js.map +1 -0
- package/dist/hub/group-policy/admin-search.d.ts +14 -0
- package/dist/hub/group-policy/admin-search.js +72 -0
- package/dist/hub/group-policy/admin-search.js.map +1 -0
- package/dist/hub/group-policy/authorization.d.ts +65 -0
- package/dist/hub/group-policy/authorization.js +315 -0
- package/dist/hub/group-policy/authorization.js.map +1 -0
- package/dist/hub/group-policy/impact-inventory.d.ts +21 -0
- package/dist/hub/group-policy/impact-inventory.js +75 -0
- package/dist/hub/group-policy/impact-inventory.js.map +1 -0
- package/dist/hub/group-policy/model.d.ts +56 -0
- package/dist/hub/group-policy/model.js +46 -0
- package/dist/hub/group-policy/model.js.map +1 -0
- package/dist/hub/group-policy/resources.d.ts +72 -0
- package/dist/hub/group-policy/resources.js +260 -0
- package/dist/hub/group-policy/resources.js.map +1 -0
- package/dist/hub/group-policy/store.d.ts +69 -0
- package/dist/hub/group-policy/store.js +210 -0
- package/dist/hub/group-policy/store.js.map +1 -0
- package/dist/hub/group-policy/welcome.d.ts +36 -0
- package/dist/hub/group-policy/welcome.js +55 -0
- package/dist/hub/group-policy/welcome.js.map +1 -0
- package/dist/hub/http/compose.d.ts +24 -0
- package/dist/hub/http/compose.js +742 -0
- package/dist/hub/http/compose.js.map +1 -0
- package/dist/hub/http/core.d.ts +71 -0
- package/dist/hub/http/core.js +266 -0
- package/dist/hub/http/core.js.map +1 -0
- package/dist/hub/http/deps.d.ts +79 -0
- package/dist/hub/http/deps.js +2 -0
- package/dist/hub/http/deps.js.map +1 -0
- package/dist/hub/http/schema.d.ts +14 -0
- package/dist/hub/http/schema.js +84 -0
- package/dist/hub/http/schema.js.map +1 -0
- package/dist/hub/identity.d.ts +32 -0
- package/dist/hub/identity.js +80 -0
- package/dist/hub/identity.js.map +1 -0
- package/dist/hub/init/browser-certificate.d.ts +14 -0
- package/dist/hub/init/browser-certificate.js +99 -0
- package/dist/hub/init/browser-certificate.js.map +1 -0
- package/dist/hub/init/browser-tls.d.ts +18 -0
- package/dist/hub/init/browser-tls.js +62 -0
- package/dist/hub/init/browser-tls.js.map +1 -0
- package/dist/hub/init/cli.d.ts +3 -0
- package/dist/hub/init/cli.js +83 -0
- package/dist/hub/init/cli.js.map +1 -0
- package/dist/hub/init/directory-certificate.d.ts +24 -0
- package/dist/hub/init/directory-certificate.js +229 -0
- package/dist/hub/init/directory-certificate.js.map +1 -0
- package/dist/hub/init/existing-fleet.d.ts +6 -0
- package/dist/hub/init/existing-fleet.js +58 -0
- package/dist/hub/init/existing-fleet.js.map +1 -0
- package/dist/hub/init/handoff.d.ts +8 -0
- package/dist/hub/init/handoff.js +36 -0
- package/dist/hub/init/handoff.js.map +1 -0
- package/dist/hub/init/identity.d.ts +5 -0
- package/dist/hub/init/identity.js +24 -0
- package/dist/hub/init/identity.js.map +1 -0
- package/dist/hub/init/initializer.d.ts +34 -0
- package/dist/hub/init/initializer.js +504 -0
- package/dist/hub/init/initializer.js.map +1 -0
- package/dist/hub/init/inventory.d.ts +17 -0
- package/dist/hub/init/inventory.js +33 -0
- package/dist/hub/init/inventory.js.map +1 -0
- package/dist/hub/init/layout.d.ts +32 -0
- package/dist/hub/init/layout.js +53 -0
- package/dist/hub/init/layout.js.map +1 -0
- package/dist/hub/init/network.d.ts +20 -0
- package/dist/hub/init/network.js +108 -0
- package/dist/hub/init/network.js.map +1 -0
- package/dist/hub/init/plan-digest.d.ts +5 -0
- package/dist/hub/init/plan-digest.js +49 -0
- package/dist/hub/init/plan-digest.js.map +1 -0
- package/dist/hub/init/prompt.d.ts +26 -0
- package/dist/hub/init/prompt.js +111 -0
- package/dist/hub/init/prompt.js.map +1 -0
- package/dist/hub/init/secret-file.d.ts +1 -0
- package/dist/hub/init/secret-file.js +59 -0
- package/dist/hub/init/secret-file.js.map +1 -0
- package/dist/hub/init/text.d.ts +129 -0
- package/dist/hub/init/text.js +251 -0
- package/dist/hub/init/text.js.map +1 -0
- package/dist/hub/init/types.d.ts +142 -0
- package/dist/hub/init/types.js +9 -0
- package/dist/hub/init/types.js.map +1 -0
- package/dist/hub/init/web-audit-import.d.ts +12 -0
- package/dist/hub/init/web-audit-import.js +39 -0
- package/dist/hub/init/web-audit-import.js.map +1 -0
- package/dist/hub/init/web-audit.d.ts +30 -0
- package/dist/hub/init/web-audit.js +42 -0
- package/dist/hub/init/web-audit.js.map +1 -0
- package/dist/hub/init/web-error.d.ts +6 -0
- package/dist/hub/init/web-error.js +8 -0
- package/dist/hub/init/web-error.js.map +1 -0
- package/dist/hub/init/web-http.d.ts +9 -0
- package/dist/hub/init/web-http.js +103 -0
- package/dist/hub/init/web-http.js.map +1 -0
- package/dist/hub/init/web.d.ts +118 -0
- package/dist/hub/init/web.js +428 -0
- package/dist/hub/init/web.js.map +1 -0
- package/dist/hub/init/wizard.d.ts +34 -0
- package/dist/hub/init/wizard.js +580 -0
- package/dist/hub/init/wizard.js.map +1 -0
- package/dist/hub/initialization.d.ts +23 -0
- package/dist/hub/initialization.js +28 -0
- package/dist/hub/initialization.js.map +1 -0
- package/dist/hub/join/client.d.ts +52 -0
- package/dist/hub/join/client.js +136 -0
- package/dist/hub/join/client.js.map +1 -0
- package/dist/hub/join/descriptor.d.ts +52 -0
- package/dist/hub/join/descriptor.js +59 -0
- package/dist/hub/join/descriptor.js.map +1 -0
- package/dist/hub/join/display.d.ts +18 -0
- package/dist/hub/join/display.js +53 -0
- package/dist/hub/join/display.js.map +1 -0
- package/dist/hub/join/fleet-authority.d.ts +2 -0
- package/dist/hub/join/fleet-authority.js +3 -0
- package/dist/hub/join/fleet-authority.js.map +1 -0
- package/dist/hub/join/http.d.ts +8 -0
- package/dist/hub/join/http.js +122 -0
- package/dist/hub/join/http.js.map +1 -0
- package/dist/hub/join/invitation.d.ts +28 -0
- package/dist/hub/join/invitation.js +28 -0
- package/dist/hub/join/invitation.js.map +1 -0
- package/dist/hub/join/local-journal.d.ts +84 -0
- package/dist/hub/join/local-journal.js +65 -0
- package/dist/hub/join/local-journal.js.map +1 -0
- package/dist/hub/join/local.d.ts +228 -0
- package/dist/hub/join/local.js +613 -0
- package/dist/hub/join/local.js.map +1 -0
- package/dist/hub/join/private.d.ts +3 -0
- package/dist/hub/join/private.js +46 -0
- package/dist/hub/join/private.js.map +1 -0
- package/dist/hub/join/protocol.d.ts +69 -0
- package/dist/hub/join/protocol.js +96 -0
- package/dist/hub/join/protocol.js.map +1 -0
- package/dist/hub/join/receipt.d.ts +42 -0
- package/dist/hub/join/receipt.js +75 -0
- package/dist/hub/join/receipt.js.map +1 -0
- package/dist/hub/join/service.d.ts +194 -0
- package/dist/hub/join/service.js +631 -0
- package/dist/hub/join/service.js.map +1 -0
- package/dist/hub/join/store.d.ts +134 -0
- package/dist/hub/join/store.js +136 -0
- package/dist/hub/join/store.js.map +1 -0
- package/dist/hub/join/trust.d.ts +19 -0
- package/dist/hub/join/trust.js +94 -0
- package/dist/hub/join/trust.js.map +1 -0
- package/dist/hub/member/agent-mode.d.ts +6 -0
- package/dist/hub/member/agent-mode.js +23 -0
- package/dist/hub/member/agent-mode.js.map +1 -0
- package/dist/hub/member/attachments.d.ts +29 -0
- package/dist/hub/member/attachments.js +107 -0
- package/dist/hub/member/attachments.js.map +1 -0
- package/dist/hub/member/exposure-api.d.ts +89 -0
- package/dist/hub/member/exposure-api.js +66 -0
- package/dist/hub/member/exposure-api.js.map +1 -0
- package/dist/hub/member/exposures.d.ts +123 -0
- package/dist/hub/member/exposures.js +282 -0
- package/dist/hub/member/exposures.js.map +1 -0
- package/dist/hub/member/pairing-api.d.ts +101 -0
- package/dist/hub/member/pairing-api.js +429 -0
- package/dist/hub/member/pairing-api.js.map +1 -0
- package/dist/hub/member/pairing-notices.d.ts +18 -0
- package/dist/hub/member/pairing-notices.js +60 -0
- package/dist/hub/member/pairing-notices.js.map +1 -0
- package/dist/hub/member/quota.d.ts +20 -0
- package/dist/hub/member/quota.js +98 -0
- package/dist/hub/member/quota.js.map +1 -0
- package/dist/hub/member-journal.d.ts +104 -0
- package/dist/hub/member-journal.js +336 -0
- package/dist/hub/member-journal.js.map +1 -0
- package/dist/hub/member-reconciliation.d.ts +14 -0
- package/dist/hub/member-reconciliation.js +97 -0
- package/dist/hub/member-reconciliation.js.map +1 -0
- package/dist/hub/mount.d.ts +50 -0
- package/dist/hub/mount.js +157 -0
- package/dist/hub/mount.js.map +1 -0
- package/dist/hub/pairing-client.d.ts +17 -0
- package/dist/hub/pairing-client.js +108 -0
- package/dist/hub/pairing-client.js.map +1 -0
- package/dist/hub/pairing-notices.d.ts +47 -0
- package/dist/hub/pairing-notices.js +246 -0
- package/dist/hub/pairing-notices.js.map +1 -0
- package/dist/hub/pairing.d.ts +111 -0
- package/dist/hub/pairing.js +526 -0
- package/dist/hub/pairing.js.map +1 -0
- package/dist/hub/policy.d.ts +65 -0
- package/dist/hub/policy.js +154 -0
- package/dist/hub/policy.js.map +1 -0
- package/dist/hub/preview.d.ts +32 -0
- package/dist/hub/preview.js +64 -0
- package/dist/hub/preview.js.map +1 -0
- package/dist/hub/private-files.d.ts +5 -0
- package/dist/hub/private-files.js +44 -0
- package/dist/hub/private-files.js.map +1 -0
- package/dist/hub/profile.d.ts +59 -0
- package/dist/hub/profile.js +73 -0
- package/dist/hub/profile.js.map +1 -0
- package/dist/hub/protocol.d.ts +848 -0
- package/dist/hub/protocol.js +103 -0
- package/dist/hub/protocol.js.map +1 -0
- package/dist/hub/quota.d.ts +24 -0
- package/dist/hub/quota.js +112 -0
- package/dist/hub/quota.js.map +1 -0
- package/dist/hub/representative.d.ts +141 -0
- package/dist/hub/representative.js +528 -0
- package/dist/hub/representative.js.map +1 -0
- package/dist/hub/retention.d.ts +17 -0
- package/dist/hub/retention.js +45 -0
- package/dist/hub/retention.js.map +1 -0
- package/dist/hub/room-read-pacer.d.ts +14 -0
- package/dist/hub/room-read-pacer.js +51 -0
- package/dist/hub/room-read-pacer.js.map +1 -0
- package/dist/hub/rooms.d.ts +127 -0
- package/dist/hub/rooms.js +597 -0
- package/dist/hub/rooms.js.map +1 -0
- package/dist/hub/runtime.d.ts +163 -0
- package/dist/hub/runtime.js +708 -0
- package/dist/hub/runtime.js.map +1 -0
- package/dist/hub/server.d.ts +61 -0
- package/dist/hub/server.js +249 -0
- package/dist/hub/server.js.map +1 -0
- package/dist/hub/service-start.d.ts +17 -0
- package/dist/hub/service-start.js +109 -0
- package/dist/hub/service-start.js.map +1 -0
- package/dist/hub/session-directory-transition.d.ts +48 -0
- package/dist/hub/session-directory-transition.js +118 -0
- package/dist/hub/session-directory-transition.js.map +1 -0
- package/dist/hub/session-epoch.d.ts +16 -0
- package/dist/hub/session-epoch.js +50 -0
- package/dist/hub/session-epoch.js.map +1 -0
- package/dist/hub/sessions.d.ts +66 -0
- package/dist/hub/sessions.js +217 -0
- package/dist/hub/sessions.js.map +1 -0
- package/dist/hub/settings-api.d.ts +50 -0
- package/dist/hub/settings-api.js +92 -0
- package/dist/hub/settings-api.js.map +1 -0
- package/dist/hub/settings-commit.d.ts +108 -0
- package/dist/hub/settings-commit.js +537 -0
- package/dist/hub/settings-commit.js.map +1 -0
- package/dist/hub/settings-directory-ca.d.ts +31 -0
- package/dist/hub/settings-directory-ca.js +115 -0
- package/dist/hub/settings-directory-ca.js.map +1 -0
- package/dist/hub/settings-directory-control.d.ts +58 -0
- package/dist/hub/settings-directory-control.js +117 -0
- package/dist/hub/settings-directory-control.js.map +1 -0
- package/dist/hub/settings-directory-decision.d.ts +465 -0
- package/dist/hub/settings-directory-decision.js +322 -0
- package/dist/hub/settings-directory-decision.js.map +1 -0
- package/dist/hub/settings-directory-host-http.d.ts +9 -0
- package/dist/hub/settings-directory-host-http.js +75 -0
- package/dist/hub/settings-directory-host-http.js.map +1 -0
- package/dist/hub/settings-directory-host-notice-http.d.ts +9 -0
- package/dist/hub/settings-directory-host-notice-http.js +78 -0
- package/dist/hub/settings-directory-host-notice-http.js.map +1 -0
- package/dist/hub/settings-directory-host-notices.d.ts +11 -0
- package/dist/hub/settings-directory-host-notices.js +39 -0
- package/dist/hub/settings-directory-host-notices.js.map +1 -0
- package/dist/hub/settings-directory-http.d.ts +33 -0
- package/dist/hub/settings-directory-http.js +109 -0
- package/dist/hub/settings-directory-http.js.map +1 -0
- package/dist/hub/settings-directory-mount.d.ts +24 -0
- package/dist/hub/settings-directory-mount.js +77 -0
- package/dist/hub/settings-directory-mount.js.map +1 -0
- package/dist/hub/settings-directory-notices.d.ts +61 -0
- package/dist/hub/settings-directory-notices.js +132 -0
- package/dist/hub/settings-directory-notices.js.map +1 -0
- package/dist/hub/settings-directory-proof.d.ts +77 -0
- package/dist/hub/settings-directory-proof.js +313 -0
- package/dist/hub/settings-directory-proof.js.map +1 -0
- package/dist/hub/settings-directory-recovery-intent.d.ts +13 -0
- package/dist/hub/settings-directory-recovery-intent.js +29 -0
- package/dist/hub/settings-directory-recovery-intent.js.map +1 -0
- package/dist/hub/settings-directory-recovery.d.ts +45 -0
- package/dist/hub/settings-directory-recovery.js +178 -0
- package/dist/hub/settings-directory-recovery.js.map +1 -0
- package/dist/hub/settings-directory-runtime.d.ts +17 -0
- package/dist/hub/settings-directory-runtime.js +2 -0
- package/dist/hub/settings-directory-runtime.js.map +1 -0
- package/dist/hub/settings-directory-save.d.ts +37 -0
- package/dist/hub/settings-directory-save.js +175 -0
- package/dist/hub/settings-directory-save.js.map +1 -0
- package/dist/hub/settings-web-address-control.d.ts +49 -0
- package/dist/hub/settings-web-address-control.js +99 -0
- package/dist/hub/settings-web-address-control.js.map +1 -0
- package/dist/hub/settings-web-address-decision.d.ts +91 -0
- package/dist/hub/settings-web-address-decision.js +163 -0
- package/dist/hub/settings-web-address-decision.js.map +1 -0
- package/dist/hub/settings-web-address-http.d.ts +9 -0
- package/dist/hub/settings-web-address-http.js +74 -0
- package/dist/hub/settings-web-address-http.js.map +1 -0
- package/dist/hub/settings-web-address-network.d.ts +2 -0
- package/dist/hub/settings-web-address-network.js +25 -0
- package/dist/hub/settings-web-address-network.js.map +1 -0
- package/dist/hub/settings-web-address-policy.d.ts +27 -0
- package/dist/hub/settings-web-address-policy.js +47 -0
- package/dist/hub/settings-web-address-policy.js.map +1 -0
- package/dist/hub/settings-web-address.d.ts +64 -0
- package/dist/hub/settings-web-address.js +226 -0
- package/dist/hub/settings-web-address.js.map +1 -0
- package/dist/hub/socket.d.ts +24 -0
- package/dist/hub/socket.js +79 -0
- package/dist/hub/socket.js.map +1 -0
- package/dist/hub/store.d.ts +87 -0
- package/dist/hub/store.js +108 -0
- package/dist/hub/store.js.map +1 -0
- package/dist/hub/tls.d.ts +31 -0
- package/dist/hub/tls.js +135 -0
- package/dist/hub/tls.js.map +1 -0
- package/dist/hub/types.d.ts +421 -0
- package/dist/hub/types.js +2 -0
- package/dist/hub/types.js.map +1 -0
- package/dist/hub/validation.d.ts +33 -0
- package/dist/hub/validation.js +136 -0
- package/dist/hub/validation.js.map +1 -0
- package/dist/hub/version-floor.d.ts +10 -0
- package/dist/hub/version-floor.js +45 -0
- package/dist/hub/version-floor.js.map +1 -0
- package/dist/hub-browser-certificate-policy.d.ts +31 -0
- package/dist/hub-browser-certificate-policy.js +25 -0
- package/dist/hub-browser-certificate-policy.js.map +1 -0
- package/dist/hub-host-settings.d.ts +48 -0
- package/dist/hub-host-settings.js +85 -0
- package/dist/hub-host-settings.js.map +1 -0
- package/dist/hub-membership-settings.d.ts +6 -0
- package/dist/hub-membership-settings.js +21 -0
- package/dist/hub-membership-settings.js.map +1 -0
- package/dist/hub-mode.d.ts +15 -0
- package/dist/hub-mode.js +17 -0
- package/dist/hub-mode.js.map +1 -0
- package/dist/hub-pairing-summary.d.ts +50 -0
- package/dist/hub-pairing-summary.js +39 -0
- package/dist/hub-pairing-summary.js.map +1 -0
- package/dist/hub-report-target.d.ts +32 -0
- package/dist/hub-report-target.js +33 -0
- package/dist/hub-report-target.js.map +1 -0
- package/dist/hub-retention-policy.d.ts +14 -0
- package/dist/hub-retention-policy.js +15 -0
- package/dist/hub-retention-policy.js.map +1 -0
- package/dist/install-user-systemd.d.ts +20 -0
- package/dist/install-user-systemd.js +55 -0
- package/dist/install-user-systemd.js.map +1 -0
- package/dist/instance-config-impact.js +9 -0
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +42 -4
- package/dist/instance-lifecycle.js +460 -202
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +2 -0
- package/dist/instructions.js +6 -0
- package/dist/instructions.js.map +1 -1
- package/dist/launchd-service-domain.d.ts +5 -0
- package/dist/launchd-service-domain.js +21 -0
- package/dist/launchd-service-domain.js.map +1 -0
- package/dist/linux-launchers.d.ts +88 -0
- package/dist/linux-launchers.js +296 -0
- package/dist/linux-launchers.js.map +1 -0
- package/dist/local-pane-endpoint.d.ts +46 -0
- package/dist/local-pane-endpoint.js +189 -0
- package/dist/local-pane-endpoint.js.map +1 -0
- package/dist/local-pane-launcher.d.ts +2 -0
- package/dist/local-pane-launcher.js +38 -0
- package/dist/local-pane-launcher.js.map +1 -0
- package/dist/local-pane-stage.ps1 +101 -0
- package/dist/locale.js +402 -14
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +14 -1
- package/dist/login-controller.js +31 -1
- package/dist/login-controller.js.map +1 -1
- package/dist/login-flows.d.ts +12 -8
- package/dist/login-flows.js +34 -16
- package/dist/login-flows.js.map +1 -1
- package/dist/login-manager.d.ts +2 -2
- package/dist/login-manager.js +3 -2
- package/dist/login-manager.js.map +1 -1
- package/dist/login-window-lock.d.ts +2 -1
- package/dist/login-window-lock.js.map +1 -1
- package/dist/ls-rows.d.ts +1 -1
- package/dist/ls-rows.js +3 -4
- package/dist/ls-rows.js.map +1 -1
- package/dist/machine-accounts.d.ts +110 -0
- package/dist/machine-accounts.js +229 -0
- package/dist/machine-accounts.js.map +1 -0
- package/dist/machine-signins.d.ts +89 -0
- package/dist/machine-signins.js +182 -0
- package/dist/machine-signins.js.map +1 -0
- package/dist/model-catalog-defaults.d.ts +14 -0
- package/dist/model-catalog-defaults.js +20 -0
- package/dist/model-catalog-defaults.js.map +1 -0
- package/dist/native-agent-admission.d.ts +7 -0
- package/dist/native-agent-admission.js +26 -0
- package/dist/native-agent-admission.js.map +1 -0
- package/dist/native-daemon-client.d.ts +13 -0
- package/dist/native-daemon-client.js +28 -0
- package/dist/native-daemon-client.js.map +1 -0
- package/dist/native-instance-api.d.ts +13 -0
- package/dist/native-instance-api.js +217 -0
- package/dist/native-instance-api.js.map +1 -0
- package/dist/native-instance-input.d.ts +87 -0
- package/dist/native-instance-input.js +59 -0
- package/dist/native-instance-input.js.map +1 -0
- package/dist/native-instance-registry.d.ts +38 -0
- package/dist/native-instance-registry.js +129 -0
- package/dist/native-instance-registry.js.map +1 -0
- package/dist/native-mcp.d.ts +43 -0
- package/dist/native-mcp.js +291 -0
- package/dist/native-mcp.js.map +1 -0
- package/dist/native-model-catalog.d.ts +25 -0
- package/dist/native-model-catalog.js +181 -0
- package/dist/native-model-catalog.js.map +1 -0
- package/dist/native-pane-crash-budget.d.ts +20 -0
- package/dist/native-pane-crash-budget.js +60 -0
- package/dist/native-pane-crash-budget.js.map +1 -0
- package/dist/native-pane-create.d.ts +26 -0
- package/dist/native-pane-create.js +53 -0
- package/dist/native-pane-create.js.map +1 -0
- package/dist/native-pane-lifecycle.d.ts +73 -0
- package/dist/native-pane-lifecycle.js +239 -0
- package/dist/native-pane-lifecycle.js.map +1 -0
- package/dist/native-pane-manager.d.ts +59 -0
- package/dist/native-pane-manager.js +592 -0
- package/dist/native-pane-manager.js.map +1 -0
- package/dist/native-pane-output-log.d.ts +15 -0
- package/dist/native-pane-output-log.js +108 -0
- package/dist/native-pane-output-log.js.map +1 -0
- package/dist/native-pane-reconciliation.d.ts +4 -0
- package/dist/native-pane-reconciliation.js +40 -0
- package/dist/native-pane-reconciliation.js.map +1 -0
- package/dist/native-pane-recovery.d.ts +12 -0
- package/dist/native-pane-recovery.js +10 -0
- package/dist/native-pane-recovery.js.map +1 -0
- package/dist/native-pane-tools.d.ts +2 -0
- package/dist/native-pane-tools.js +14 -0
- package/dist/native-pane-tools.js.map +1 -0
- package/dist/needs-you-hub.d.ts +8 -0
- package/dist/needs-you-hub.js +31 -5
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +80 -3
- package/dist/needs-you.js +46 -3
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +3 -3
- package/dist/office-share-page.js.map +1 -1
- package/dist/office-share.d.ts +28 -2
- package/dist/office-share.js +32 -3
- package/dist/office-share.js.map +1 -1
- package/dist/office-talk.d.ts +26 -0
- package/dist/office-talk.js +50 -0
- package/dist/office-talk.js.map +1 -0
- package/dist/outbound-handlers.d.ts +30 -2
- package/dist/outbound-handlers.js +120 -4
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +79 -1
- package/dist/outbound-schemas.js +37 -14
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-port.d.ts +118 -0
- package/dist/pane-port.js +2 -0
- package/dist/pane-port.js.map +1 -0
- package/dist/pane-quota-history.d.ts +2 -0
- package/dist/pane-quota-history.js +20 -0
- package/dist/pane-quota-history.js.map +1 -1
- package/dist/pause-marker.d.ts +1 -1
- package/dist/pause-marker.js +1 -1
- package/dist/pause-marker.js.map +1 -1
- package/dist/profile-signins.d.ts +107 -0
- package/dist/profile-signins.js +249 -0
- package/dist/profile-signins.js.map +1 -0
- package/dist/public-web-gateway.js +17 -1
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +16 -0
- package/dist/public-web-link.js +21 -0
- package/dist/public-web-link.js.map +1 -1
- package/dist/quickstart-api.js +9 -5
- package/dist/quickstart-api.js.map +1 -1
- package/dist/quickstart.d.ts +6 -0
- package/dist/quickstart.js +31 -4
- package/dist/quickstart.js.map +1 -1
- package/dist/quiet-run.d.ts +31 -0
- package/dist/quiet-run.js +50 -0
- package/dist/quiet-run.js.map +1 -0
- package/dist/runtime-api.d.ts +23 -0
- package/dist/runtime-api.js +413 -0
- package/dist/runtime-api.js.map +1 -0
- package/dist/runtime-assets/@xterm/addon-serialize/LICENSE +21 -0
- package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.js +2 -0
- package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.mjs +19 -0
- package/dist/runtime-assets/@xterm/addon-serialize/package.json +29 -0
- package/dist/runtime-assets/@xterm/headless/LICENSE +21 -0
- package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.js +2 -0
- package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.mjs +46 -0
- package/dist/runtime-assets/@xterm/headless/package.json +29 -0
- package/dist/runtime-assets/node-pty/CONPTY-LICENSE +21 -0
- package/dist/runtime-assets/node-pty/CONPTY-NOTICE.md +503 -0
- package/dist/runtime-assets/node-pty/LICENSE +69 -0
- package/dist/runtime-assets/node-pty/lib/conpty_console_list_agent.js +16 -0
- package/dist/runtime-assets/node-pty/lib/eventEmitter2.js +47 -0
- package/dist/runtime-assets/node-pty/lib/index.js +52 -0
- package/dist/runtime-assets/node-pty/lib/interfaces.js +7 -0
- package/dist/runtime-assets/node-pty/lib/shared/conout.js +11 -0
- package/dist/runtime-assets/node-pty/lib/terminal.js +190 -0
- package/dist/runtime-assets/node-pty/lib/types.js +7 -0
- package/dist/runtime-assets/node-pty/lib/unixTerminal.js +346 -0
- package/dist/runtime-assets/node-pty/lib/utils.js +39 -0
- package/dist/runtime-assets/node-pty/lib/windowsConoutConnection.js +125 -0
- package/dist/runtime-assets/node-pty/lib/windowsPtyAgent.js +320 -0
- package/dist/runtime-assets/node-pty/lib/windowsTerminal.js +199 -0
- package/dist/runtime-assets/node-pty/lib/worker/conoutSocketWorker.js +22 -0
- package/dist/runtime-assets/node-pty/package.json +64 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty.node +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
- package/dist/runtime-autostart.d.ts +61 -0
- package/dist/runtime-autostart.js +161 -0
- package/dist/runtime-autostart.js.map +1 -0
- package/dist/runtime-background.d.ts +200 -0
- package/dist/runtime-background.js +480 -0
- package/dist/runtime-background.js.map +1 -0
- package/dist/runtime-build-info.d.ts +10 -0
- package/dist/runtime-build-info.js +64 -0
- package/dist/runtime-build-info.js.map +1 -0
- package/dist/runtime-bundle.d.ts +22 -0
- package/dist/runtime-bundle.js +158 -0
- package/dist/runtime-bundle.js.map +1 -0
- package/dist/runtime-cli-background.d.ts +92 -0
- package/dist/runtime-cli-background.js +336 -0
- package/dist/runtime-cli-background.js.map +1 -0
- package/dist/runtime-cli-install.d.ts +295 -0
- package/dist/runtime-cli-install.js +869 -0
- package/dist/runtime-cli-install.js.map +1 -0
- package/dist/runtime-cli.d.ts +21 -0
- package/dist/runtime-cli.js +578 -0
- package/dist/runtime-cli.js.map +1 -0
- package/dist/runtime-client-store.d.ts +86 -0
- package/dist/runtime-client-store.js +392 -0
- package/dist/runtime-client-store.js.map +1 -0
- package/dist/runtime-client.d.ts +258 -0
- package/dist/runtime-client.js +1353 -0
- package/dist/runtime-client.js.map +1 -0
- package/dist/runtime-connection.d.ts +22 -0
- package/dist/runtime-connection.js +93 -0
- package/dist/runtime-connection.js.map +1 -0
- package/dist/runtime-coordinator.d.ts +201 -0
- package/dist/runtime-coordinator.js +1514 -0
- package/dist/runtime-coordinator.js.map +1 -0
- package/dist/runtime-credential-profiles.d.ts +89 -0
- package/dist/runtime-credential-profiles.js +304 -0
- package/dist/runtime-credential-profiles.js.map +1 -0
- package/dist/runtime-enroll-notice.d.ts +4 -0
- package/dist/runtime-enroll-notice.js +21 -0
- package/dist/runtime-enroll-notice.js.map +1 -0
- package/dist/runtime-enrollment.d.ts +21 -0
- package/dist/runtime-enrollment.js +52 -0
- package/dist/runtime-enrollment.js.map +1 -0
- package/dist/runtime-general-protocol.d.ts +22 -0
- package/dist/runtime-general-protocol.js +57 -0
- package/dist/runtime-general-protocol.js.map +1 -0
- package/dist/runtime-general-workspace.d.ts +17 -0
- package/dist/runtime-general-workspace.js +213 -0
- package/dist/runtime-general-workspace.js.map +1 -0
- package/dist/runtime-install.d.ts +50 -0
- package/dist/runtime-install.js +189 -0
- package/dist/runtime-install.js.map +1 -0
- package/dist/runtime-pane-assets.d.ts +17 -0
- package/dist/runtime-pane-assets.js +23 -0
- package/dist/runtime-pane-assets.js.map +1 -0
- package/dist/runtime-pane-boot.d.ts +9 -0
- package/dist/runtime-pane-boot.js +47 -0
- package/dist/runtime-pane-boot.js.map +1 -0
- package/dist/runtime-pane-codex-index.d.ts +10 -0
- package/dist/runtime-pane-codex-index.js +151 -0
- package/dist/runtime-pane-codex-index.js.map +1 -0
- package/dist/runtime-pane-config.d.ts +16 -0
- package/dist/runtime-pane-config.js +54 -0
- package/dist/runtime-pane-config.js.map +1 -0
- package/dist/runtime-pane-host.d.ts +63 -0
- package/dist/runtime-pane-host.js +467 -0
- package/dist/runtime-pane-host.js.map +1 -0
- package/dist/runtime-pane-job-owner.d.ts +1 -0
- package/dist/runtime-pane-job-owner.js +29 -0
- package/dist/runtime-pane-job-owner.js.map +1 -0
- package/dist/runtime-pane-job.ps1 +116 -0
- package/dist/runtime-pane-link.d.ts +47 -0
- package/dist/runtime-pane-link.js +338 -0
- package/dist/runtime-pane-link.js.map +1 -0
- package/dist/runtime-pane-mcp-protocol.d.ts +32 -0
- package/dist/runtime-pane-mcp-protocol.js +39 -0
- package/dist/runtime-pane-mcp-protocol.js.map +1 -0
- package/dist/runtime-pane-mcp-relay.d.ts +18 -0
- package/dist/runtime-pane-mcp-relay.js +80 -0
- package/dist/runtime-pane-mcp-relay.js.map +1 -0
- package/dist/runtime-pane-mcp.d.ts +55 -0
- package/dist/runtime-pane-mcp.js +153 -0
- package/dist/runtime-pane-mcp.js.map +1 -0
- package/dist/runtime-pane-native.d.ts +75 -0
- package/dist/runtime-pane-native.js +114 -0
- package/dist/runtime-pane-native.js.map +1 -0
- package/dist/runtime-pane-output.d.ts +19 -0
- package/dist/runtime-pane-output.js +53 -0
- package/dist/runtime-pane-output.js.map +1 -0
- package/dist/runtime-pane-port.d.ts +144 -0
- package/dist/runtime-pane-port.js +574 -0
- package/dist/runtime-pane-port.js.map +1 -0
- package/dist/runtime-pane-private.d.ts +16 -0
- package/dist/runtime-pane-private.js +76 -0
- package/dist/runtime-pane-private.js.map +1 -0
- package/dist/runtime-pane-private.ps1 +81 -0
- package/dist/runtime-pane-process.d.ts +4 -0
- package/dist/runtime-pane-process.js +117 -0
- package/dist/runtime-pane-process.js.map +1 -0
- package/dist/runtime-pane-protocol.d.ts +182 -0
- package/dist/runtime-pane-protocol.js +217 -0
- package/dist/runtime-pane-protocol.js.map +1 -0
- package/dist/runtime-pane-quota-history.d.ts +6 -0
- package/dist/runtime-pane-quota-history.js +44 -0
- package/dist/runtime-pane-quota-history.js.map +1 -0
- package/dist/runtime-pane-screen.d.ts +19 -0
- package/dist/runtime-pane-screen.js +76 -0
- package/dist/runtime-pane-screen.js.map +1 -0
- package/dist/runtime-pane-service.d.ts +16 -0
- package/dist/runtime-pane-service.js +256 -0
- package/dist/runtime-pane-service.js.map +1 -0
- package/dist/runtime-pane-stdio-protocol.d.ts +54 -0
- package/dist/runtime-pane-stdio-protocol.js +94 -0
- package/dist/runtime-pane-stdio-protocol.js.map +1 -0
- package/dist/runtime-pane-stdio.d.ts +3 -0
- package/dist/runtime-pane-stdio.js +123 -0
- package/dist/runtime-pane-stdio.js.map +1 -0
- package/dist/runtime-pane-store.d.ts +43 -0
- package/dist/runtime-pane-store.js +176 -0
- package/dist/runtime-pane-store.js.map +1 -0
- package/dist/runtime-pane-transcript-protocol.d.ts +43 -0
- package/dist/runtime-pane-transcript-protocol.js +58 -0
- package/dist/runtime-pane-transcript-protocol.js.map +1 -0
- package/dist/runtime-pane-transcript.d.ts +50 -0
- package/dist/runtime-pane-transcript.js +666 -0
- package/dist/runtime-pane-transcript.js.map +1 -0
- package/dist/runtime-pane-worker.d.ts +1 -0
- package/dist/runtime-pane-worker.js +167 -0
- package/dist/runtime-pane-worker.js.map +1 -0
- package/dist/runtime-profile-ownership.d.ts +66 -0
- package/dist/runtime-profile-ownership.js +391 -0
- package/dist/runtime-profile-ownership.js.map +1 -0
- package/dist/runtime-protocol.d.ts +340 -0
- package/dist/runtime-protocol.js +179 -0
- package/dist/runtime-protocol.js.map +1 -0
- package/dist/runtime-remote-accounts.d.ts +209 -0
- package/dist/runtime-remote-accounts.js +714 -0
- package/dist/runtime-remote-accounts.js.map +1 -0
- package/dist/runtime-remote-setup.d.ts +108 -0
- package/dist/runtime-remote-setup.js +532 -0
- package/dist/runtime-remote-setup.js.map +1 -0
- package/dist/runtime-signin-transport.d.ts +39 -0
- package/dist/runtime-signin-transport.js +111 -0
- package/dist/runtime-signin-transport.js.map +1 -0
- package/dist/runtime-signin.d.ts +132 -0
- package/dist/runtime-signin.js +290 -0
- package/dist/runtime-signin.js.map +1 -0
- package/dist/runtime-switches.d.ts +79 -0
- package/dist/runtime-switches.js +90 -0
- package/dist/runtime-switches.js.map +1 -0
- package/dist/runtime-transcript-delta-reader.d.ts +23 -0
- package/dist/runtime-transcript-delta-reader.js +74 -0
- package/dist/runtime-transcript-delta-reader.js.map +1 -0
- package/dist/runtime-transcript-source.d.ts +36 -0
- package/dist/runtime-transcript-source.js +189 -0
- package/dist/runtime-transcript-source.js.map +1 -0
- package/dist/runtime-update-activity.d.ts +21 -0
- package/dist/runtime-update-activity.js +51 -0
- package/dist/runtime-update-activity.js.map +1 -0
- package/dist/runtime-update-artifact.d.ts +31 -0
- package/dist/runtime-update-artifact.js +252 -0
- package/dist/runtime-update-artifact.js.map +1 -0
- package/dist/runtime-update-attention.d.ts +4 -0
- package/dist/runtime-update-attention.js +11 -0
- package/dist/runtime-update-attention.js.map +1 -0
- package/dist/runtime-update-controller.d.ts +86 -0
- package/dist/runtime-update-controller.js +743 -0
- package/dist/runtime-update-controller.js.map +1 -0
- package/dist/runtime-update-install.d.ts +31 -0
- package/dist/runtime-update-install.js +205 -0
- package/dist/runtime-update-install.js.map +1 -0
- package/dist/runtime-update-ipc.d.ts +42 -0
- package/dist/runtime-update-ipc.js +144 -0
- package/dist/runtime-update-ipc.js.map +1 -0
- package/dist/runtime-update-journal.d.ts +49 -0
- package/dist/runtime-update-journal.js +128 -0
- package/dist/runtime-update-journal.js.map +1 -0
- package/dist/runtime-update-lock.d.ts +48 -0
- package/dist/runtime-update-lock.js +232 -0
- package/dist/runtime-update-lock.js.map +1 -0
- package/dist/runtime-update-owners.d.ts +29 -0
- package/dist/runtime-update-owners.js +240 -0
- package/dist/runtime-update-owners.js.map +1 -0
- package/dist/runtime-update-protocol.d.ts +15 -0
- package/dist/runtime-update-protocol.js +13 -0
- package/dist/runtime-update-protocol.js.map +1 -0
- package/dist/runtime-update-status.d.ts +30 -0
- package/dist/runtime-update-status.js +31 -0
- package/dist/runtime-update-status.js.map +1 -0
- package/dist/runtime-windows-bridge.d.ts +42 -0
- package/dist/runtime-windows-bridge.js +167 -0
- package/dist/runtime-windows-bridge.js.map +1 -0
- package/dist/scheduler/db.d.ts +3 -0
- package/dist/scheduler/db.js +4 -0
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/task-board-text.js +1 -1
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +4 -0
- package/dist/scheduler/task-board.js +9 -3
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/scheduler/task-liveness.d.ts +34 -0
- package/dist/scheduler/task-liveness.js +49 -0
- package/dist/scheduler/task-liveness.js.map +1 -0
- package/dist/selection-card.d.ts +4 -3
- package/dist/selection-card.js +2 -1
- package/dist/selection-card.js.map +1 -1
- package/dist/service-drain.d.ts +19 -0
- package/dist/service-drain.js +64 -0
- package/dist/service-drain.js.map +1 -0
- package/dist/service-installer.d.ts +7 -2
- package/dist/service-installer.js +24 -12
- package/dist/service-installer.js.map +1 -1
- package/dist/settings-api.d.ts +37 -2
- package/dist/settings-api.js +866 -12
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +7 -0
- package/dist/settings-baseline.js +3 -1
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.d.ts +7 -3
- package/dist/settings-change.js +128 -30
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +67 -7
- package/dist/settings-confirmation.js +68 -15
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +26 -0
- package/dist/settings-effect.js +317 -5
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +37 -0
- package/dist/settings-http-confirmation.js +162 -15
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-request-capability.d.ts +14 -0
- package/dist/settings-request-capability.js +12 -1
- package/dist/settings-request-capability.js.map +1 -1
- package/dist/settings-route-lifetime.d.ts +14 -0
- package/dist/settings-route-lifetime.js +48 -0
- package/dist/settings-route-lifetime.js.map +1 -0
- package/dist/settings-summary.d.ts +24 -0
- package/dist/settings-summary.js +42 -0
- package/dist/settings-summary.js.map +1 -0
- package/dist/settings-transaction.d.ts +4 -0
- package/dist/settings-transaction.js +9 -0
- package/dist/settings-transaction.js.map +1 -1
- package/dist/setup-form.js +6 -3
- package/dist/setup-form.js.map +1 -1
- package/dist/setup-host.js +1 -1
- package/dist/setup-host.js.map +1 -1
- package/dist/setup-i18n.js +3 -0
- package/dist/setup-i18n.js.map +1 -1
- package/dist/setup-wizard.js +4 -2
- package/dist/setup-wizard.js.map +1 -1
- package/dist/signin-keepalive.d.ts +206 -0
- package/dist/signin-keepalive.js +681 -0
- package/dist/signin-keepalive.js.map +1 -0
- package/dist/structured-signin-transport.d.ts +20 -2
- package/dist/structured-signin-transport.js +57 -2
- package/dist/structured-signin-transport.js.map +1 -1
- package/dist/structured-signin.d.ts +11 -2
- package/dist/structured-signin.js +5 -7
- package/dist/structured-signin.js.map +1 -1
- package/dist/task-board-tool.d.ts +2 -1
- package/dist/task-board-tool.js +76 -7
- package/dist/task-board-tool.js.map +1 -1
- package/dist/tmux-binary.d.ts +59 -0
- package/dist/tmux-binary.js +189 -0
- package/dist/tmux-binary.js.map +1 -0
- package/dist/tmux-control.d.ts +2 -1
- package/dist/tmux-control.js +4 -4
- package/dist/tmux-control.js.map +1 -1
- package/dist/tmux-exec-helper.js +32 -1
- package/dist/tmux-exec-helper.js.map +1 -1
- package/dist/tmux-legacy.d.ts +94 -0
- package/dist/tmux-legacy.js +309 -0
- package/dist/tmux-legacy.js.map +1 -0
- package/dist/tmux-manager.d.ts +11 -4
- package/dist/tmux-manager.js +61 -40
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tmux-pane-host.d.ts +26 -0
- package/dist/tmux-pane-host.js +25 -0
- package/dist/tmux-pane-host.js.map +1 -0
- package/dist/tmux-read.js +4 -3
- package/dist/tmux-read.js.map +1 -1
- package/dist/tmux-rollback.d.ts +42 -0
- package/dist/tmux-rollback.js +78 -0
- package/dist/tmux-rollback.js.map +1 -0
- package/dist/tmux-server.d.ts +102 -0
- package/dist/tmux-server.js +248 -0
- package/dist/tmux-server.js.map +1 -0
- package/dist/tool-permissions.js +2 -1
- package/dist/tool-permissions.js.map +1 -1
- package/dist/topic-commands.js +9 -5
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-delta-reader.d.ts +10 -2
- package/dist/transcript-delta-reader.js +38 -9
- package/dist/transcript-delta-reader.js.map +1 -1
- package/dist/transcript-monitor.d.ts +3 -0
- package/dist/transcript-monitor.js +68 -54
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-needles.d.ts +42 -0
- package/dist/transcript-needles.js +166 -0
- package/dist/transcript-needles.js.map +1 -0
- package/dist/transcript-records.d.ts +22 -0
- package/dist/transcript-records.js +144 -0
- package/dist/transcript-records.js.map +1 -0
- package/dist/transcript-sources.d.ts +5 -0
- package/dist/transcript-sources.js +11 -79
- package/dist/transcript-sources.js.map +1 -1
- package/dist/types.d.ts +39 -0
- package/dist/ui/account-identity.js +29 -0
- package/dist/ui/accounts-keepalive.js +111 -0
- package/dist/ui/accounts-manage.js +256 -0
- package/dist/ui/accounts-view.js +481 -0
- package/dist/ui/agent-details-settings.js +326 -0
- package/dist/ui/agent-export-dialog.js +170 -0
- package/dist/ui/agent-export-strings.js +81 -0
- package/dist/ui/agent-instructions-field.js +69 -0
- package/dist/ui/agent-page-strings.js +148 -0
- package/dist/ui/agent-proposals.js +90 -0
- package/dist/ui/agent-runtime-settings.js +70 -0
- package/dist/ui/agent-runtime.js +124 -0
- package/dist/ui/backend-signin.js +109 -37
- package/dist/ui/chat-ambient.js +1 -1
- package/dist/ui/chat-md-strings.js +3 -9
- package/dist/ui/chat-quote.js +20 -17
- package/dist/ui/chat-render.js +3 -682
- package/dist/ui/chat-store.js +39 -7
- package/dist/ui/chat-strings.js +3 -285
- package/dist/ui/chat-thread.js +3 -969
- package/dist/ui/chat-time.js +3 -80
- package/dist/ui/chat-tour.js +2 -2
- package/dist/ui/chat-workspace-navigation.js +125 -0
- package/dist/ui/chat-workspace.js +255 -0
- package/dist/ui/cli-caps.js +15 -0
- package/dist/ui/cli-picker.js +42 -0
- package/dist/ui/credential-profile-select.js +54 -0
- package/dist/ui/effort-field-strings.js +18 -0
- package/dist/ui/fleet-office-dialogue.d.ts +30 -0
- package/dist/ui/fleet-office-dialogue.js +382 -0
- package/dist/ui/fleet-office-levels.js +17 -1
- package/dist/ui/fleet-office-pack.d.ts +19 -1
- package/dist/ui/fleet-office-pack.js +177 -24
- package/dist/ui/fleet-office-skin.js +23 -5
- package/dist/ui/fleet-office-store.js +13 -3
- package/dist/ui/fleet-office-zones.js +124 -9
- package/dist/ui/fleet-office.js +203 -19
- package/dist/ui/fleet-task-card.js +8 -4
- package/dist/ui/fleet-task-common.js +2 -2
- package/dist/ui/fleet-task-menu.js +188 -0
- package/dist/ui/fleet-task-stats.js +124 -0
- package/dist/ui/fleet-task-view.js +340 -0
- package/dist/ui/fleet-tasks.js +125 -39
- package/dist/ui/general-location.js +85 -0
- package/dist/ui/host-install.js +290 -0
- package/dist/ui/html-attachment.js +3 -40
- package/dist/ui/hub-agent-copy.js +23 -0
- package/dist/ui/hub-attachments.js +90 -0
- package/dist/ui/hub-button-actions.js +65 -0
- package/dist/ui/hub-chat-store.js +168 -0
- package/dist/ui/hub-chat-strings.js +79 -0
- package/dist/ui/hub-client.js +410 -0
- package/dist/ui/hub-company-join-strings.js +77 -0
- package/dist/ui/hub-company-join.js +165 -0
- package/dist/ui/hub-directory-editor-strings.js +56 -0
- package/dist/ui/hub-directory-editor.js +163 -0
- package/dist/ui/hub-directory-notice-strings.js +28 -0
- package/dist/ui/hub-directory-notices.js +66 -0
- package/dist/ui/hub-grant-strings.js +13 -0
- package/dist/ui/hub-group-policy.js +183 -0
- package/dist/ui/hub-group-strings.js +110 -0
- package/dist/ui/hub-host-security-notices.js +28 -0
- package/dist/ui/hub-join-one-strings.js +131 -0
- package/dist/ui/hub-owner-strings.js +56 -0
- package/dist/ui/hub-pairing-progress-strings.js +15 -0
- package/dist/ui/hub-preview.js +101 -0
- package/dist/ui/hub-provider-guidance.js +31 -0
- package/dist/ui/hub-quick-pairing.js +209 -0
- package/dist/ui/hub-quick-strings.js +43 -0
- package/dist/ui/hub-quota.js +85 -0
- package/dist/ui/hub-read-strings.js +7 -0
- package/dist/ui/hub-strings.js +168 -0
- package/dist/ui/hub-switcher.js +27 -0
- package/dist/ui/hub-this-hub.js +113 -0
- package/dist/ui/hub-welcome.js +102 -0
- package/dist/ui/image-lightbox.js +11 -3
- package/dist/ui/machine-signin.js +56 -0
- package/dist/ui/model-picker.js +18 -14
- package/dist/ui/native-instance-settings.js +81 -0
- package/dist/ui/native-pane-recovery.js +45 -0
- package/dist/ui/office-share-page.js +4 -2
- package/dist/ui/panel-chat.js +245 -116
- package/dist/ui/panel-details.js +46 -17
- package/dist/ui/panel-fleet.js +113 -20
- package/dist/ui/panel-hub.js +974 -0
- package/dist/ui/panel-log.js +9 -6
- package/dist/ui/panel-needs.js +175 -9
- package/dist/ui/panel-runtimes.js +645 -0
- package/dist/ui/panel-settings.js +325 -213
- package/dist/ui/panel-windows-agent.js +87 -0
- package/dist/ui/panel-windows-cli.js +189 -0
- package/dist/ui/preview-pages.js +3 -41
- package/dist/ui/preview-panel-actions.js +3 -161
- package/dist/ui/preview-panel.js +11 -550
- package/dist/ui/preview-versions.js +3 -155
- package/dist/ui/preview.js +3 -476
- package/dist/ui/provider-marks.js +83 -0
- package/dist/ui/runtime-catalog.js +55 -0
- package/dist/ui/runtime-cli-install.js +214 -0
- package/dist/ui/runtime-commands.d.ts +6 -0
- package/dist/ui/runtime-commands.js +92 -0
- package/dist/ui/runtime-update-commands.d.ts +2 -0
- package/dist/ui/runtime-update-commands.js +11 -0
- package/dist/ui/runtime-update-status.js +53 -0
- package/dist/ui/search-dialog.js +3 -0
- package/dist/ui/settings-access-overview.js +188 -0
- package/dist/ui/settings-access-strings.js +42 -0
- package/dist/ui/settings-agent-filters.js +94 -0
- package/dist/ui/settings-appearance.js +122 -23
- package/dist/ui/settings-apply.js +12 -5
- package/dist/ui/settings-build-version.js +35 -0
- package/dist/ui/settings-catalog.js +68 -16
- package/dist/ui/settings-confirm.js +112 -14
- package/dist/ui/settings-devices.js +283 -0
- package/dist/ui/settings-dialogs.js +360 -140
- package/dist/ui/settings-guests.js +25 -11
- package/dist/ui/settings-hub-browser-certificate.js +76 -0
- package/dist/ui/settings-hub-company-join.js +270 -0
- package/dist/ui/settings-hub-connection.js +172 -0
- package/dist/ui/settings-hub-directory.js +29 -0
- package/dist/ui/settings-hub-membership.js +93 -0
- package/dist/ui/settings-hub-preview.js +74 -0
- package/dist/ui/settings-hub-retention.js +54 -0
- package/dist/ui/settings-hub-run.js +61 -0
- package/dist/ui/settings-hub-section.js +67 -0
- package/dist/ui/settings-hub-setup-strings.js +70 -0
- package/dist/ui/settings-hub-setup.js +195 -0
- package/dist/ui/settings-hub.js +276 -0
- package/dist/ui/settings-layout.js +246 -0
- package/dist/ui/settings-level-titles.js +73 -0
- package/dist/ui/settings-model.js +26 -2
- package/dist/ui/settings-named-test.js +2 -2
- package/dist/ui/settings-outside.js +310 -0
- package/dist/ui/settings-quota-notice.js +3 -3
- package/dist/ui/settings-registry.js +26 -5
- package/dist/ui/settings-restart-strings.js +17 -0
- package/dist/ui/settings-revoke-strings.js +28 -0
- package/dist/ui/settings-shared-strings.js +161 -0
- package/dist/ui/settings-shared.js +354 -0
- package/dist/ui/settings-shortcuts.js +65 -0
- package/dist/ui/settings-strings.js +127 -46
- package/dist/ui/settings-web-authority.js +27 -14
- package/dist/ui/shared/access-overview.css +48 -0
- package/dist/ui/shared/accounts-keepalive.css +12 -0
- package/dist/ui/shared/accounts.css +88 -0
- package/dist/ui/shared/agend-auth.js +8 -1
- package/dist/ui/shared/app-ctx.js +22 -1
- package/dist/ui/shared/app-i18n.js +17 -16
- package/dist/ui/shared/app-nav.js +34 -11
- package/dist/ui/shared/app-route.js +12 -3
- package/dist/ui/shared/app-session.js +17 -12
- package/dist/ui/shared/app-shell.js +454 -55
- package/dist/ui/shared/app-store.js +3 -0
- package/dist/ui/shared/app-stream.js +3 -1
- package/dist/ui/shared/app.css +1586 -10
- package/dist/ui/shared/app.js +28 -3
- package/dist/ui/shared/chat-composer.js +74 -0
- package/dist/ui/shared/chat-md-strings.js +9 -0
- package/dist/ui/shared/chat-render.js +694 -0
- package/dist/ui/shared/chat-strings.js +333 -0
- package/dist/ui/shared/chat-thread.js +969 -0
- package/dist/ui/shared/chat-time.js +80 -0
- package/dist/ui/shared/chat-work-bar.css +5 -0
- package/dist/ui/shared/chat-workspace-memory.js +14 -0
- package/dist/ui/shared/chat-workspace-model.js +76 -0
- package/dist/ui/shared/device-roles.js +27 -0
- package/dist/ui/shared/header-tools.js +9 -9
- package/dist/ui/shared/host-install.css +10 -0
- package/dist/ui/shared/html-attachment.js +42 -0
- package/dist/ui/shared/hub-chat.css +98 -0
- package/dist/ui/shared/hub-groups.css +28 -0
- package/dist/ui/shared/hub-owner.css +57 -0
- package/dist/ui/shared/hub-quota.css +8 -0
- package/dist/ui/shared/hub-signin.css +24 -0
- package/dist/ui/shared/hub.css +78 -0
- package/dist/ui/shared/instance-nav.js +44 -8
- package/dist/ui/shared/instance-switch.js +12 -4
- package/dist/ui/shared/machine-name.js +13 -0
- package/dist/ui/shared/model-picker.css +13 -1
- package/dist/ui/shared/page-head.js +8 -0
- package/dist/ui/shared/panel-view.js +39 -26
- package/dist/ui/shared/preview-pages.js +41 -0
- package/dist/ui/shared/preview-panel-actions.js +168 -0
- package/dist/ui/shared/preview-panel.js +576 -0
- package/dist/ui/shared/preview-versions.js +155 -0
- package/dist/ui/shared/preview.js +476 -0
- package/dist/ui/shared/qrcode.module.js +2237 -0
- package/dist/ui/shared/runtime-install.css +55 -0
- package/dist/ui/shared/settings-width.js +31 -0
- package/dist/ui/shared/side-rail.js +15 -0
- package/dist/ui/shared/signin.js +392 -34
- package/dist/ui/shared/task-board.css +95 -0
- package/dist/ui/shared/tokens.css +1 -0
- package/dist/ui/shared/ui-dialog.js +2 -2
- package/dist/ui/shared/ui-menu.js +36 -10
- package/dist/ui/shared/usage-dialog.js +3 -72
- package/dist/ui/shared/usage-meter.js +84 -0
- package/dist/ui/shared/vendor/qrcode-generator.LICENSE +27 -0
- package/dist/ui/shared/vendor/vendor.json +19 -2
- package/dist/ui/shared/view-roster-store.js +8 -0
- package/dist/ui/shared/view-strings.js +14 -4
- package/dist/ui/shared/web-authorize.js +53 -3
- package/dist/ui/shared/workspace-follow.css +19 -0
- package/dist/ui/shared/workspace.css +20 -0
- package/dist/ui/signin.html +41 -8
- package/dist/ui/structured-signin.js +67 -17
- package/dist/ui/windows-agents-nav.js +2 -0
- package/dist/ui/windows-cli-catalog.js +108 -0
- package/dist/ui/workspace-follow-strings.js +28 -0
- package/dist/ui/workspace-panel.js +378 -0
- package/dist/ui/workspace-strings.js +35 -0
- package/dist/unattended-install.js +2 -1
- package/dist/unattended-install.js.map +1 -1
- package/dist/update-dispatch.d.ts +62 -0
- package/dist/update-dispatch.js +69 -2
- package/dist/update-dispatch.js.map +1 -1
- package/dist/update-install.d.ts +7 -0
- package/dist/update-install.js +23 -0
- package/dist/update-install.js.map +1 -1
- package/dist/update-marker.d.ts +2 -0
- package/dist/update-marker.js.map +1 -1
- package/dist/usage/providers.d.ts +2 -0
- package/dist/usage/providers.js +20 -19
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/usage-api.d.ts +1 -1
- package/dist/usage/usage-api.js +3 -10
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/view-api.js +5 -7
- package/dist/view-api.js.map +1 -1
- package/dist/web-api.d.ts +167 -4
- package/dist/web-api.js +1579 -266
- package/dist/web-api.js.map +1 -1
- package/dist/web-backend-login.d.ts +41 -3
- package/dist/web-backend-login.js +25 -17
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-chat-history.d.ts +19 -2
- package/dist/web-chat-history.js +72 -3
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-commands.d.ts +10 -1
- package/dist/web-commands.js +1 -1
- package/dist/web-commands.js.map +1 -1
- package/dist/web-device-login.d.ts +153 -0
- package/dist/web-device-login.js +278 -0
- package/dist/web-device-login.js.map +1 -0
- package/dist/web-host-install.d.ts +127 -0
- package/dist/web-host-install.js +165 -0
- package/dist/web-host-install.js.map +1 -0
- package/dist/web-login.d.ts +35 -1
- package/dist/web-login.js +51 -5
- package/dist/web-login.js.map +1 -1
- package/dist/web-model-groups.d.ts +40 -0
- package/dist/web-model-groups.js +70 -0
- package/dist/web-model-groups.js.map +1 -0
- package/dist/web-notices.d.ts +9 -0
- package/dist/web-notices.js +19 -0
- package/dist/web-notices.js.map +1 -1
- package/dist/web-office-skins.d.ts +9 -0
- package/dist/web-office-skins.js +16 -1
- package/dist/web-office-skins.js.map +1 -1
- package/dist/web-office-store.d.ts +35 -2
- package/dist/web-office-store.js +64 -15
- package/dist/web-office-store.js.map +1 -1
- package/dist/web-only-fleet.d.ts +20 -0
- package/dist/web-only-fleet.js +21 -0
- package/dist/web-only-fleet.js.map +1 -1
- package/dist/web-remote-access.d.ts +341 -0
- package/dist/web-remote-access.js +801 -0
- package/dist/web-remote-access.js.map +1 -0
- package/dist/web-session.d.ts +63 -0
- package/dist/web-session.js +50 -1
- package/dist/web-session.js.map +1 -1
- package/dist/web-settings-patch.d.ts +3 -1
- package/dist/web-settings-patch.js +4 -1
- package/dist/web-settings-patch.js.map +1 -1
- package/dist/web-shell-routes.d.ts +10 -1
- package/dist/web-shell-routes.js +14 -2
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/web-signin-device.d.ts +16 -0
- package/dist/web-signin-device.js +81 -0
- package/dist/web-signin-device.js.map +1 -0
- package/dist/web-signin-link.d.ts +42 -0
- package/dist/web-signin-link.js +110 -0
- package/dist/web-signin-link.js.map +1 -0
- package/dist/web-terminal.d.ts +11 -30
- package/dist/web-terminal.js +23 -8
- package/dist/web-terminal.js.map +1 -1
- package/dist/web-update.d.ts +1 -0
- package/dist/web-update.js +4 -2
- package/dist/web-update.js.map +1 -1
- package/dist/windows-agents.d.ts +127 -0
- package/dist/windows-agents.js +491 -0
- package/dist/windows-agents.js.map +1 -0
- package/dist/windows-cli-api.d.ts +48 -0
- package/dist/windows-cli-api.js +207 -0
- package/dist/windows-cli-api.js.map +1 -0
- package/dist/windows-cli-providers.d.ts +109 -0
- package/dist/windows-cli-providers.js +396 -0
- package/dist/windows-cli-providers.js.map +1 -0
- package/dist/windows-cli-worker.d.ts +99 -0
- package/dist/windows-cli-worker.js +729 -0
- package/dist/windows-cli-worker.js.map +1 -0
- package/dist/windows-cli.d.ts +130 -0
- package/dist/windows-cli.js +424 -0
- package/dist/windows-cli.js.map +1 -0
- package/dist/windows-native-mcp.d.ts +19 -0
- package/dist/windows-native-mcp.js +143 -0
- package/dist/windows-native-mcp.js.map +1 -0
- package/dist/windows-pane-mcp.d.ts +26 -0
- package/dist/windows-pane-mcp.js +187 -0
- package/dist/windows-pane-mcp.js.map +1 -0
- package/dist/windows-shortcuts.d.ts +29 -5
- package/dist/windows-shortcuts.js +52 -9
- package/dist/windows-shortcuts.js.map +1 -1
- package/dist/workspace-file-policy.d.ts +2 -0
- package/dist/workspace-file-policy.js +31 -0
- package/dist/workspace-file-policy.js.map +1 -0
- package/dist/workspace-follow-parse.d.ts +36 -0
- package/dist/workspace-follow-parse.js +208 -0
- package/dist/workspace-follow-parse.js.map +1 -0
- package/dist/workspace-follow-records.d.ts +17 -0
- package/dist/workspace-follow-records.js +88 -0
- package/dist/workspace-follow-records.js.map +1 -0
- package/dist/workspace-follow.d.ts +41 -0
- package/dist/workspace-follow.js +144 -0
- package/dist/workspace-follow.js.map +1 -0
- package/dist/wsl-detect.d.ts +1 -0
- package/dist/wsl-detect.js +20 -0
- package/dist/wsl-detect.js.map +1 -0
- package/dist/yaml-shared-nodes.js +8 -3
- package/dist/yaml-shared-nodes.js.map +1 -1
- package/launcher/agend-install.cjs +15 -2
- package/launcher/launchd-session-type.cjs +14 -0
- package/launcher/postinstall.cjs +27 -2
- package/launcher/tmux-bundle.cjs +263 -0
- package/package.json +16 -5
- package/templates/icons/agend-restart.ico +0 -0
- package/templates/icons/agend.ico +0 -0
- package/templates/launchd.plist.ejs +3 -1
- package/templates/runtime-assets/conpty-LICENSE +21 -0
- package/templates/runtime-assets/conpty-NOTICE.md +503 -0
- package/templates/runtime-assets/local-pane-stage.ps1 +101 -0
- package/templates/runtime-assets/runtime-pane-job.ps1 +116 -0
- package/templates/runtime-assets/runtime-pane-private.ps1 +81 -0
- package/templates/runtime-assets/xterm-LICENSE +21 -0
- package/templates/runtime-install/install.ps1 +618 -0
- package/templates/windows-shortcuts.ps1 +45 -12
package/dist/daemon.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { nativePaneToolRefusal } from "./native-pane-tools.js";
|
|
2
|
+
import { generalByName } from "./general-instance.js";
|
|
1
3
|
import { codexMetadataHomes } from "./backend/codex-metadata.js";
|
|
2
4
|
import { claudeMinimumError, cliVersionBelow } from "./claude-model-minimum.js";
|
|
3
5
|
import { quotaNoticeProblem } from "./quota-notice-config.js";
|
|
@@ -24,8 +26,9 @@ import { assertNoSessionOomStop, readSessionOomStop, writeSessionOomStop, Sessio
|
|
|
24
26
|
import { mcpServerState } from "./mcp-liveness.js";
|
|
25
27
|
import { clearPausedMarker, writePausedMarker } from "./pause-marker.js";
|
|
26
28
|
import { writeBackgroundWorkEndedMarker } from "./background-work-ended.js";
|
|
27
|
-
import {
|
|
29
|
+
import { resolveTmuxLogicalSize, TmuxManager } from "./tmux-manager.js";
|
|
28
30
|
import { TranscriptMonitor } from "./transcript-monitor.js";
|
|
31
|
+
import { FollowLog } from "./workspace-follow.js";
|
|
29
32
|
import { createTranscriptSource } from "./transcript-sources.js";
|
|
30
33
|
import { TranscriptTurnLedger } from "./transcript-turns.js";
|
|
31
34
|
import { credentialProfileStoreHome, resolveCredentialProfile } from "./backend/credential-profile.js";
|
|
@@ -33,6 +36,8 @@ import { resolveToolSet, toolsFor } from "./tool-permissions.js";
|
|
|
33
36
|
import { TOOLS } from "./channel/mcp-tools.js";
|
|
34
37
|
import { dashboardAccessProblem, dashboardFeaturesOff, withoutFeatures } from "./dashboard-permissions.js";
|
|
35
38
|
import { getAgendHome } from "./paths.js";
|
|
39
|
+
import { legacyTmuxSocket, tmuxSocket } from "./tmux-binary.js";
|
|
40
|
+
import { migrateLegacyWindow, tagWindowId } from "./tmux-legacy.js";
|
|
36
41
|
import { scopedFleetConfigEnvironment } from "./web-experimental.js";
|
|
37
42
|
import { readAgentFile } from "./agent-file-read.js";
|
|
38
43
|
import { ASSET_UPLOAD_MAX_BYTES, receivePreview, sendAssetInParts, writePreview } from "./web-asset-parts.js";
|
|
@@ -52,6 +57,7 @@ import { HangDetector } from "./hang-detector.js";
|
|
|
52
57
|
import { writeSecretFile } from "./secret-file.js";
|
|
53
58
|
import { PaneWriteLock } from "./pane-write-lock.js";
|
|
54
59
|
import { answerRemoteCard } from "./remote-card-answer.js";
|
|
60
|
+
import { tmuxPaneHost } from "./tmux-pane-host.js";
|
|
55
61
|
import { buildFleetInstructions } from "./instructions.js";
|
|
56
62
|
import { formatHumanInboundMessage, prepareDeliveryWire, steerInboundEnvelope, BTW_INBOUND_PREFIX, humanBodyHash, humanOwnerObjectId } from "./human-delivery-receipts.js";
|
|
57
63
|
import { formatCrossInstanceInboundMessage, renderCrossInstanceHandoffMetadata, } from "./cross-instance-envelope.js";
|
|
@@ -61,6 +67,7 @@ import { CLAUDE_CREDIT_BALANCE_LOW, CLAUDE_MODEL_USAGE_LIMIT, CLAUDE_USAGE_LIMIT
|
|
|
61
67
|
import { t } from "./locale.js";
|
|
62
68
|
import { claudeResetInstant, claudeResetTime, quotaPausedLine } from "./quota-notice.js";
|
|
63
69
|
import { MuseUsageRelay, clearMuseUsageSnapshot } from "./muse-usage-relay.js";
|
|
70
|
+
import { reconcileNativePaneTarget } from "./native-pane-reconciliation.js";
|
|
64
71
|
import { deliveryContentDigest } from "./delivery-outbox.js";
|
|
65
72
|
import { consumedWatches } from "./delivery-consumed-watch.js";
|
|
66
73
|
import { queueResumePolicyForAttempt } from "./delivery-queue-evidence.js";
|
|
@@ -68,6 +75,7 @@ import { markerConsumed, scanTranscriptForDeliveryMarker } from "./delivery-reco
|
|
|
68
75
|
import { QUEUED_HANDOFF_MAX_REDELIVERIES, QueuedHandoffStore } from "./queued-handoffs.js";
|
|
69
76
|
import { measureSyncWork, noteSyncWork } from "./sync-work-attribution.js";
|
|
70
77
|
import { TranscriptDeltaReader } from "./transcript-delta-reader.js";
|
|
78
|
+
import { checkpointCodexPane } from "./codex-pane-ownership.js";
|
|
71
79
|
import { buildResumeContinuation, clearInFlightTurnMarker, consumeInFlightTurnMarker, decideTurnResume, normalizeResumeBackend, readResumeFingerprint, RESUME_BLOCKING_DELIVERY_STATES, writeInFlightTurnMarker, } from "./turn-resume.js";
|
|
72
80
|
import { codexLiveRowMatches } from "./backend/codex.js";
|
|
73
81
|
import { codexPackageProblemMessage } from "./backend/codex-package.js";
|
|
@@ -1120,6 +1128,7 @@ export class Daemon extends EventEmitter {
|
|
|
1120
1128
|
spawnGate;
|
|
1121
1129
|
stormWindow;
|
|
1122
1130
|
backendOutage;
|
|
1131
|
+
paneTransport;
|
|
1123
1132
|
/** #1314: fleet-directory fallbacks already reported to the topic (once per daemon, per field and path). */
|
|
1124
1133
|
promptFileFallbackNoticed = new Set();
|
|
1125
1134
|
/** Identity of this live Daemon object; changes on object stop/restart. */
|
|
@@ -1136,7 +1145,7 @@ export class Daemon extends EventEmitter {
|
|
|
1136
1145
|
/** Optional read-only child lane: only a current owned tmux launch, never stopped/native/cwd discovery. */
|
|
1137
1146
|
subagentSource() {
|
|
1138
1147
|
const backend = this.config.backend ?? "claude-code", path = this.logTranscriptPath();
|
|
1139
|
-
if ((backend !== "claude-code" && backend !== "codex") || !path || !this.tmux || this.processStatus !== "running"
|
|
1148
|
+
if (this.nativePaneLifecycle || (backend !== "claude-code" && backend !== "codex") || !path || !this.tmux || this.processStatus !== "running"
|
|
1140
1149
|
|| this.spawning || this.runtimeMonitorsFrozen)
|
|
1141
1150
|
return null;
|
|
1142
1151
|
const cwd = this.config.working_directory || process.cwd();
|
|
@@ -1822,6 +1831,7 @@ export class Daemon extends EventEmitter {
|
|
|
1822
1831
|
// still booting. Its new tmux window starts empty before resume restores the
|
|
1823
1832
|
// old transcript, so pre-ready scans must not lower this seeded baseline.
|
|
1824
1833
|
seededErrorCountBaselines = new Map();
|
|
1834
|
+
nativeQuotaReplayTaken = false;
|
|
1825
1835
|
quotaReplay = null;
|
|
1826
1836
|
paneQuotaPatterns() {
|
|
1827
1837
|
if (!["codex", "grok"].includes(this.backend?.binaryName ?? ""))
|
|
@@ -1857,7 +1867,11 @@ export class Daemon extends EventEmitter {
|
|
|
1857
1867
|
}
|
|
1858
1868
|
/** Before admission, this launch may absorb ONLY rows positively known before its resume. */
|
|
1859
1869
|
takeQuotaReplayBaseline(pane) {
|
|
1860
|
-
|
|
1870
|
+
// Native captures carry only a runner-frozen pre-launch proof, revalidated with this capture's owner and seq.
|
|
1871
|
+
const native = !this.nativeQuotaReplayTaken ? this.nativePaneLifecycle?.quotaReplayHistory?.() : null;
|
|
1872
|
+
if (this.nativePaneLifecycle)
|
|
1873
|
+
this.nativeQuotaReplayTaken = true;
|
|
1874
|
+
const history = this.quotaReplay ?? (native ? { ...native, spawn: this.spawnGeneration, fence: this.launchFenceEpoch, attempt: this.launchAttempt } : null);
|
|
1861
1875
|
if (!history)
|
|
1862
1876
|
return;
|
|
1863
1877
|
this.quotaReplay = null;
|
|
@@ -1923,14 +1937,23 @@ export class Daemon extends EventEmitter {
|
|
|
1923
1937
|
static USAGE_PAUSE_NOTICE_WINDOW_MS = 30 * 60_000;
|
|
1924
1938
|
/** The usage-pause notice told last: when (monotonic), Claude's words for the reset, and that reset (wall clock). */
|
|
1925
1939
|
usagePauseNotice = null;
|
|
1940
|
+
/** Coarse status for the representative quota hint; never exports model names or transcript text. */
|
|
1941
|
+
quotaPaused() {
|
|
1942
|
+
if (this.usageLimitHold)
|
|
1943
|
+
return true;
|
|
1944
|
+
const pause = this.usagePauseNotice;
|
|
1945
|
+
return !!pause && (pause.resetAt === null
|
|
1946
|
+
? performance.now() - pause.at < Daemon.USAGE_PAUSE_NOTICE_WINDOW_MS
|
|
1947
|
+
: Date.now() < pause.resetAt);
|
|
1948
|
+
}
|
|
1949
|
+
/** #3186 review: the lifecycle's second opinion dropped the notice (usage has capacity): nothing was told. */
|
|
1950
|
+
clearUsagePauseNotice() { this.usagePauseNotice = null; }
|
|
1926
1951
|
/**
|
|
1927
1952
|
* #2834 (#816): Claude paused itself until its usage window opens — the same notice the screen pattern gave. `at`: when
|
|
1928
1953
|
* Claude wrote it (its record's timestamp). One notice per pause: a reset time already past is not this pause (an old
|
|
1929
1954
|
* note), and its repeats ("reached again") within the window — or naming the same reset, until it comes — say nothing
|
|
1930
1955
|
* more. Claude's own "Usage limit reset" ends it.
|
|
1931
1956
|
*/
|
|
1932
|
-
/** #3186 review: the lifecycle's second opinion dropped the notice (usage has capacity): nothing was told. */
|
|
1933
|
-
clearUsagePauseNotice() { this.usagePauseNotice = null; }
|
|
1934
1957
|
noteClaudeInformational(text, at = null) {
|
|
1935
1958
|
const line = text.trim();
|
|
1936
1959
|
if (Daemon.USAGE_LIMIT_RESET.test(line)) {
|
|
@@ -2089,9 +2112,94 @@ export class Daemon extends EventEmitter {
|
|
|
2089
2112
|
this.errorRecoveryDeadlineAt = 0;
|
|
2090
2113
|
this.activeErrorPatternKey = null;
|
|
2091
2114
|
}
|
|
2115
|
+
/** Lazy default also preserves bare-prototype diagnostic/test construction. */
|
|
2116
|
+
get paneHost() { return this.paneTransport ?? tmuxPaneHost; }
|
|
2117
|
+
nativePaneLifecycle;
|
|
2118
|
+
nativeFleetBridge;
|
|
2119
|
+
nativeTranscriptSource;
|
|
2120
|
+
usesNativePane() { return !!this.nativePaneLifecycle; }
|
|
2121
|
+
/** cc3ce4fe: the CLI version this pane's launch actually ran, as its helper recorded it (undefined: not known). */
|
|
2122
|
+
nativePaneCliVersion() { try {
|
|
2123
|
+
return this.nativePaneLifecycle?.snapshot?.()?.cliVersion;
|
|
2124
|
+
}
|
|
2125
|
+
catch {
|
|
2126
|
+
return undefined;
|
|
2127
|
+
} }
|
|
2128
|
+
logNativeInputRefusal(details) {
|
|
2129
|
+
this.logger.warn({ component: "runtime-pane-host", reason: "expected_seq_changed", ...details }, "Native pane input refused before write");
|
|
2130
|
+
}
|
|
2131
|
+
logNativeToolFailure(details) {
|
|
2132
|
+
const turn = this.turnReplyGuard.snapshot();
|
|
2133
|
+
this.logger.warn({ ...details, currentMessageId: turn?.target.messageId ?? null,
|
|
2134
|
+
guardGeneration: turn?.generation ?? null, guardPhase: turn?.phase ?? null }, "Native pane tool operation failed");
|
|
2135
|
+
}
|
|
2136
|
+
nativePaneCurrent() { return this.nativePaneLifecycle?.current() ?? false; }
|
|
2137
|
+
nativeEnterHold = null;
|
|
2138
|
+
/** Per-launch attention for a native delivery whose bounded input attempts were refused or uncertain, including non-outbox input. */
|
|
2139
|
+
nativeDeliveryHold() {
|
|
2140
|
+
const hold = this.nativeEnterHold;
|
|
2141
|
+
return hold && this.nativePaneLifecycle && !this.deliveryWritesStopping && hold.spawn === this.spawnGeneration && hold.fence === this.launchFenceEpoch
|
|
2142
|
+
? { key: hold.key, since: hold.since } : null;
|
|
2143
|
+
}
|
|
2144
|
+
nativePaneHasExited() {
|
|
2145
|
+
const snapshot = this.nativePaneLifecycle?.snapshot?.();
|
|
2146
|
+
return snapshot?.state === "exited" && snapshot.instance === this.name && this.tmux?.getWindowId() === snapshot.paneId;
|
|
2147
|
+
}
|
|
2148
|
+
/** Positive native exit evidence only, fenced to this exact launch and Daemon owner. */
|
|
2149
|
+
nativePaneExitCurrent(snapshot, owner) {
|
|
2150
|
+
const actual = this.nativePaneLifecycle?.snapshot?.();
|
|
2151
|
+
return !!actual && actual.state === "exited" && snapshot.state === "exited"
|
|
2152
|
+
&& sameInteractionOwner(owner, this.interactionOwner()) && !this.runtimeMonitorsFrozen && !this.startupAborted
|
|
2153
|
+
&& ["hostBootId", "paneId", "launchId", "agentId", "instance", "sessionId", "commandSequence", "exitCode"].every(key => actual[key] === snapshot[key])
|
|
2154
|
+
&& this.tmux?.getWindowId() === snapshot.paneId;
|
|
2155
|
+
}
|
|
2156
|
+
async reconcileNativeDeliveries(outbox, current) {
|
|
2157
|
+
if (!this.nativePaneLifecycle)
|
|
2158
|
+
return false;
|
|
2159
|
+
return reconcileNativePaneTarget(outbox, this.name, this.nativePaneLifecycle, current);
|
|
2160
|
+
}
|
|
2161
|
+
/** Same-process transport for the owned native daemon; never exposed as a runner RPC. */
|
|
2162
|
+
setNativeFleetBridge(bridge) {
|
|
2163
|
+
if (!this.nativePaneLifecycle || this.nativeFleetBridge?.current())
|
|
2164
|
+
throw Error("Native Fleet bridge requires one bound pane owner");
|
|
2165
|
+
this.nativeFleetBridge = bridge;
|
|
2166
|
+
}
|
|
2167
|
+
/** Fleet admission and generation checks happen before this synchronous handoff. */
|
|
2168
|
+
acceptNativeFleetMessage(message) {
|
|
2169
|
+
if (!this.nativePaneLifecycle || !this.nativeFleetBridge?.current() || this.deliveryWritesStopping || this.runtimeMonitorsFrozen)
|
|
2170
|
+
return false;
|
|
2171
|
+
if (typeof message.type === "string" && FLEET_RESPONSE_TYPES.has(message.type)) {
|
|
2172
|
+
this.routeFleetResponse(message);
|
|
2173
|
+
return true;
|
|
2174
|
+
}
|
|
2175
|
+
const bridge = this.nativeFleetBridge;
|
|
2176
|
+
const current = () => this.nativeFleetBridge === bridge && bridge.current() && !this.deliveryWritesStopping && !this.runtimeMonitorsFrozen;
|
|
2177
|
+
return this.handleFleetMessage(message, reply => { if (current())
|
|
2178
|
+
this.broadcastFleetMessage(reply); }, current);
|
|
2179
|
+
}
|
|
2180
|
+
broadcastFleetMessage(message) {
|
|
2181
|
+
if (this.nativePaneLifecycle) {
|
|
2182
|
+
if (this.nativeFleetBridge?.current() && !this.runtimeMonitorsFrozen && !this.deliveryWritesStopping)
|
|
2183
|
+
this.nativeFleetBridge.send(message);
|
|
2184
|
+
}
|
|
2185
|
+
else
|
|
2186
|
+
this.ipcServer?.broadcast(message);
|
|
2187
|
+
}
|
|
2188
|
+
fleetTransportAvailable() {
|
|
2189
|
+
return this.nativePaneLifecycle ? !!this.nativeFleetBridge?.current() && !this.runtimeMonitorsFrozen : !!this.ipcServer;
|
|
2190
|
+
}
|
|
2191
|
+
/** Internal lifecycle injection, before start. Native paths and provider files stay on their runner. */
|
|
2192
|
+
setNativePaneLifecycle(native) {
|
|
2193
|
+
if (this.tmux || this.ipcServer || this.nativePaneLifecycle)
|
|
2194
|
+
throw Error("Native pane adapter must be bound before daemon startup");
|
|
2195
|
+
this.nativePaneLifecycle = native;
|
|
2196
|
+
this.backend = native.backend;
|
|
2197
|
+
this.paneTransport = native.host;
|
|
2198
|
+
this.controlClient = native.observation;
|
|
2199
|
+
}
|
|
2092
2200
|
constructor(name, config, instanceDir, topicMode = false, backend, controlClient, rootLogger, runtimeIdentity, spawnGate, stormWindow,
|
|
2093
2201
|
/** Fleet-level "is this CLI's backend down?" memory — see backend-outage.ts. */
|
|
2094
|
-
backendOutage) {
|
|
2202
|
+
backendOutage, paneTransport) {
|
|
2095
2203
|
super();
|
|
2096
2204
|
this.name = name;
|
|
2097
2205
|
this.config = config;
|
|
@@ -2103,6 +2211,7 @@ export class Daemon extends EventEmitter {
|
|
|
2103
2211
|
this.spawnGate = spawnGate;
|
|
2104
2212
|
this.stormWindow = stormWindow;
|
|
2105
2213
|
this.backendOutage = backendOutage;
|
|
2214
|
+
this.paneTransport = paneTransport;
|
|
2106
2215
|
// The live process owns its adopted configuration. Fleet defaults may be re-resolved in place after a save;
|
|
2107
2216
|
// sharing that object would activate cold changes before the normal restart/apply boundary.
|
|
2108
2217
|
this.config = structuredClone(config);
|
|
@@ -2125,7 +2234,8 @@ export class Daemon extends EventEmitter {
|
|
|
2125
2234
|
this.messageBus.setLogger(this.logger);
|
|
2126
2235
|
// General is the dispatcher — it must stay warm to route messages, so it is
|
|
2127
2236
|
// never auto-paused regardless of auto_pause_after.
|
|
2128
|
-
|
|
2237
|
+
// #3035 review: the one rule (an agent named general unticked — general_topic: false — is a worker).
|
|
2238
|
+
const isGeneral = config.general_topic === true || generalByName(name, config);
|
|
2129
2239
|
const autoPauseMinutes = isGeneral ? 0 : (typeof config.auto_pause_after === "number" ? config.auto_pause_after : 0); // default: disabled
|
|
2130
2240
|
this.autoPauseController = new AutoPauseController(Math.max(0, autoPauseMinutes) * 60_000, readLastInboundAt(instanceDir) ?? Date.now());
|
|
2131
2241
|
// #1209: every real completion clears the in-flight marker, so a
|
|
@@ -2193,17 +2303,25 @@ export class Daemon extends EventEmitter {
|
|
|
2193
2303
|
return outcome === "begun";
|
|
2194
2304
|
}
|
|
2195
2305
|
async durableAttemptEvidence(windowId, handingOffToNativeQueue, steer, rawPaste = false) {
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2306
|
+
const backend = this.config.backend ?? this.backend?.binaryName ?? "unknown";
|
|
2307
|
+
let checkpoint = null, runtimeTranscript = null;
|
|
2308
|
+
if (this.nativePaneLifecycle) {
|
|
2309
|
+
runtimeTranscript = await this.transcriptMonitor?.reconciliationRuntimeCheckpoint() ?? null;
|
|
2310
|
+
if (!runtimeTranscript || !this.nativePaneLifecycle.current(runtimeTranscript))
|
|
2311
|
+
throw Error("Native transcript checkpoint is not current; no delivery was written");
|
|
2312
|
+
}
|
|
2313
|
+
else if (!(rawPaste && backend === "codex")) {
|
|
2314
|
+
// Local raw Codex uses only the bounded exact-UUID checkpoint acquired below.
|
|
2315
|
+
try {
|
|
2316
|
+
checkpoint = await this.transcriptMonitor?.reconciliationCheckpoint() ?? null;
|
|
2317
|
+
}
|
|
2318
|
+
catch (err) {
|
|
2319
|
+
this.logger.debug({ err }, "Could not checkpoint transcript before durable delivery");
|
|
2320
|
+
}
|
|
2202
2321
|
}
|
|
2203
2322
|
const submissionMode = rawPaste ? "raw_paste" : steer
|
|
2204
2323
|
? "steer"
|
|
2205
2324
|
: handingOffToNativeQueue ? "native_queue_handoff" : "idle_submit";
|
|
2206
|
-
const backend = this.config.backend ?? this.backend?.binaryName ?? "unknown";
|
|
2207
2325
|
// The daemon does not synchronously probe CLI versions on the delivery
|
|
2208
2326
|
// path. Until lifecycle supplies a version tied to this exact process,
|
|
2209
2327
|
// queue handoffs persist an unknown resume contract and reconciliation
|
|
@@ -2214,8 +2332,9 @@ export class Daemon extends EventEmitter {
|
|
|
2214
2332
|
backendVersion,
|
|
2215
2333
|
windowId: windowId ?? this.tmux?.getWindowId() ?? null,
|
|
2216
2334
|
transcriptPath: checkpoint?.path ?? null,
|
|
2217
|
-
transcriptOffset: checkpoint?.offset ?? null,
|
|
2218
|
-
transcriptSessionId: checkpoint?.sessionId ?? null,
|
|
2335
|
+
transcriptOffset: runtimeTranscript?.cursor.offset ?? checkpoint?.offset ?? null,
|
|
2336
|
+
transcriptSessionId: runtimeTranscript?.cursor.sessionId ?? checkpoint?.sessionId ?? null,
|
|
2337
|
+
...(runtimeTranscript ? { runtimeTranscript } : {}),
|
|
2219
2338
|
submissionMode,
|
|
2220
2339
|
queueResumePolicy: queueResumePolicyForAttempt(backend, backendVersion, submissionMode),
|
|
2221
2340
|
};
|
|
@@ -2258,17 +2377,25 @@ export class Daemon extends EventEmitter {
|
|
|
2258
2377
|
const outbox = this.deliveryOutbox;
|
|
2259
2378
|
if (!checkpoint || !outbox?.markConsumed)
|
|
2260
2379
|
return;
|
|
2380
|
+
if (this.nativePaneLifecycle && !checkpoint.runtime)
|
|
2381
|
+
return;
|
|
2261
2382
|
if (verdict.submissionMode !== "steer" && verdict.submissionMode !== "native_queue_handoff")
|
|
2262
2383
|
return;
|
|
2263
2384
|
if (!["claude-code", "codex"].includes(checkpoint.backend))
|
|
2264
2385
|
return;
|
|
2265
2386
|
const spawn = this.spawnGeneration, fence = this.launchFenceEpoch, boot = this.bootId;
|
|
2387
|
+
let location;
|
|
2388
|
+
try {
|
|
2389
|
+
location = checkpoint.runtime ? { reader: this.nativeTranscriptReader(checkpoint.runtime, delivery.deliveryId) } : { path: checkpoint.path, offset: checkpoint.offset };
|
|
2390
|
+
}
|
|
2391
|
+
catch {
|
|
2392
|
+
return;
|
|
2393
|
+
} // The owner changed; an unavailable consumed watch proves nothing.
|
|
2266
2394
|
consumedWatches.start({
|
|
2267
2395
|
deliveryId: delivery.deliveryId,
|
|
2268
2396
|
attemptNo: delivery.attemptNo,
|
|
2269
2397
|
backend: checkpoint.backend,
|
|
2270
|
-
|
|
2271
|
-
offset: checkpoint.offset,
|
|
2398
|
+
...location,
|
|
2272
2399
|
current: () => !this.deliveryWritesStopping && spawn === this.spawnGeneration && fence === this.launchFenceEpoch,
|
|
2273
2400
|
consumed: (via, evidence) => {
|
|
2274
2401
|
try {
|
|
@@ -2310,15 +2437,18 @@ export class Daemon extends EventEmitter {
|
|
|
2310
2437
|
: humanVerificationId ? `[agend-human-id:${humanVerificationId}]` : null;
|
|
2311
2438
|
if (!marker || !formatted.startsWith(marker))
|
|
2312
2439
|
return;
|
|
2313
|
-
let
|
|
2314
|
-
if (!
|
|
2440
|
+
let found = verdict.transcriptCheckpoint ?? null;
|
|
2441
|
+
if (!found) {
|
|
2315
2442
|
try {
|
|
2316
|
-
|
|
2443
|
+
found = await this.transcriptMonitor?.reconciliationCheckpoint() ?? null;
|
|
2317
2444
|
}
|
|
2318
2445
|
catch (err) {
|
|
2319
2446
|
this.logger.debug({ err }, "Could not checkpoint the transcript before a queued hand-off");
|
|
2320
2447
|
}
|
|
2321
2448
|
}
|
|
2449
|
+
// main→alpha sync: a hand-off record is judged against a local transcript file. A native or remote runtime's
|
|
2450
|
+
// transcript (no local path) has none: it runs as before (✅ at the hand-off), as with no checkpoint at all.
|
|
2451
|
+
const checkpoint = found && typeof found.path === "string" && typeof found.offset === "number" ? { path: found.path, offset: found.offset } : null;
|
|
2322
2452
|
if (!checkpoint)
|
|
2323
2453
|
return; // nothing could judge it later: it runs as before (✅ at the hand-off)
|
|
2324
2454
|
const entry = {
|
|
@@ -2586,24 +2716,41 @@ export class Daemon extends EventEmitter {
|
|
|
2586
2716
|
const spawn = this.spawnGeneration;
|
|
2587
2717
|
const fence = this.launchFenceEpoch;
|
|
2588
2718
|
let last = "unavailable";
|
|
2589
|
-
|
|
2590
|
-
let
|
|
2719
|
+
const native = !!checkpoint.runtime || !!this.nativePaneLifecycle;
|
|
2720
|
+
let outcome = native ? "uncertain" : "delivered";
|
|
2721
|
+
let evidence = native ? "runtime-transcript-unconfirmed" : OUTPUT_EDGE_ONLY_EVIDENCE;
|
|
2591
2722
|
// #1647: a raw paste has no marker; its text is the needle, and its pane proof already failed — so without the turn
|
|
2592
2723
|
// in the transcript it stays uncertain (with the pane's reason), never the output-edge outcome.
|
|
2593
2724
|
const needle = rawPaste ? { rawText: rawPaste.text } : delivery.deliveryId;
|
|
2725
|
+
const bound = checkpoint.ownedCodex;
|
|
2726
|
+
const reader = !checkpoint.runtime && bound ? new TranscriptDeltaReader(checkpoint.path, checkpoint.offset, checkpoint.backend, needle, bound.identity, bound.retire) : null;
|
|
2594
2727
|
let found = false;
|
|
2595
2728
|
try {
|
|
2729
|
+
if (this.nativePaneLifecycle && !checkpoint.runtime)
|
|
2730
|
+
throw Error("Native proof cannot read a coordinator-local transcript path");
|
|
2731
|
+
const nativeReader = checkpoint.runtime ? this.nativeTranscriptReader(checkpoint.runtime, needle) : null;
|
|
2596
2732
|
for (let polls = 0; polls <= TRANSCRIPT_PROOF_WINDOW_MS / TRANSCRIPT_PROOF_POLL_MS; polls++) {
|
|
2597
2733
|
if (this.deliveryWritesStopping)
|
|
2598
2734
|
return; // reconciliation owns the row now
|
|
2599
|
-
|
|
2735
|
+
if (bound && (!bound.current() || !await bound.validate()))
|
|
2736
|
+
break;
|
|
2737
|
+
const look = nativeReader ? await nativeReader.look() : reader ? await reader.look()
|
|
2738
|
+
: await scanTranscriptForDeliveryMarker(checkpoint.path, checkpoint.offset, checkpoint.backend, needle);
|
|
2739
|
+
if (this.deliveryWritesStopping)
|
|
2740
|
+
return;
|
|
2741
|
+
if (spawn !== this.spawnGeneration || fence !== this.launchFenceEpoch) {
|
|
2742
|
+
last = "unavailable";
|
|
2743
|
+
break;
|
|
2744
|
+
}
|
|
2745
|
+
if (bound && (!await bound.validate() || !bound.current()))
|
|
2746
|
+
break;
|
|
2600
2747
|
if (look === "user" || look === "absorbed" || look === "queued") {
|
|
2601
2748
|
found = true;
|
|
2602
2749
|
outcome = "delivered";
|
|
2603
2750
|
evidence = transcriptMarkerEvidence(look, !!rawPaste);
|
|
2604
2751
|
break;
|
|
2605
2752
|
}
|
|
2606
|
-
last = look;
|
|
2753
|
+
last = look === "pending" ? "unavailable" : look;
|
|
2607
2754
|
if (spawn !== this.spawnGeneration || fence !== this.launchFenceEpoch) {
|
|
2608
2755
|
last = "unavailable";
|
|
2609
2756
|
break;
|
|
@@ -2615,13 +2762,13 @@ export class Daemon extends EventEmitter {
|
|
|
2615
2762
|
// `uncertain`: re-check the same fixed epochs after the last await, before settling (#1207 P2).
|
|
2616
2763
|
if (spawn !== this.spawnGeneration || fence !== this.launchFenceEpoch)
|
|
2617
2764
|
last = "unavailable";
|
|
2618
|
-
if (last === "no-match" &&
|
|
2765
|
+
if (last === "no-match" && !found) {
|
|
2619
2766
|
outcome = "uncertain";
|
|
2620
2767
|
evidence = "unverifiable-no-transcript-marker";
|
|
2621
2768
|
}
|
|
2622
2769
|
}
|
|
2623
2770
|
catch (err) {
|
|
2624
|
-
this.logger.debug({ err }, "Transcript proof
|
|
2771
|
+
this.logger.debug({ err }, "Transcript proof unavailable — preserving the conservative outcome");
|
|
2625
2772
|
}
|
|
2626
2773
|
if (rawPaste && !found) {
|
|
2627
2774
|
outcome = "uncertain";
|
|
@@ -2634,6 +2781,10 @@ export class Daemon extends EventEmitter {
|
|
|
2634
2781
|
try {
|
|
2635
2782
|
if (this.deliveryWritesStopping)
|
|
2636
2783
|
return;
|
|
2784
|
+
if (bound && (!await bound.validate() || !bound.current())) {
|
|
2785
|
+
outcome = "uncertain";
|
|
2786
|
+
evidence = "raw-paste-submit-proof:codex-session-binding-lost; not re-pasted";
|
|
2787
|
+
}
|
|
2637
2788
|
this.finishDurableDelivery(delivery, outcome, evidence);
|
|
2638
2789
|
}
|
|
2639
2790
|
catch (err) {
|
|
@@ -2808,128 +2959,150 @@ export class Daemon extends EventEmitter {
|
|
|
2808
2959
|
}
|
|
2809
2960
|
}
|
|
2810
2961
|
catch { /* corrupt/missing — ignore */ }
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2962
|
+
if (!this.nativePaneLifecycle) {
|
|
2963
|
+
// 1. IPC server — bridge between MCP server (Claude's child) and daemon
|
|
2964
|
+
const sockPath = join(this.instanceDir, "channel.sock");
|
|
2965
|
+
this.ipcServer = new IpcServer(sockPath, this.logger);
|
|
2966
|
+
// Forward IPC server errors as daemon events (prevents unhandled 'error' crash).
|
|
2967
|
+
// Guard: only forward post-listen errors — startup errors are handled by listen() rejection.
|
|
2968
|
+
let ipcListening = false;
|
|
2969
|
+
this.ipcServer.on("error", (err) => {
|
|
2970
|
+
if (!ipcListening)
|
|
2971
|
+
return; // startup errors handled by listen() rejection
|
|
2972
|
+
this.logger.error({ err, name: this.name }, "IPC server error");
|
|
2973
|
+
this.emit("error", err);
|
|
2974
|
+
});
|
|
2975
|
+
await this.ipcServer.listen();
|
|
2976
|
+
this.startupAdmission?.();
|
|
2977
|
+
ipcListening = true;
|
|
2978
|
+
// Permanent IPC dispatcher: routes responses to pending requests by type+id key
|
|
2979
|
+
this.ipcServer.on("message", (msg) => this.routeFleetResponse(msg));
|
|
2980
|
+
// IPC message relay: when daemon wants to push a channel message to Claude,
|
|
2981
|
+
// it broadcasts to all IPC clients (the MCP server is one of them).
|
|
2982
|
+
// When MCP server sends a tool_call, daemon handles it via the messageBus.
|
|
2983
|
+
this.ipcServer.on("message", (msg, socket) => {
|
|
2984
|
+
if (msg.type === "tool_call") {
|
|
2985
|
+
// MCP server forwarding a Claude tool call (reply, react, edit, download)
|
|
2986
|
+
this.handleToolCall(msg, socket);
|
|
2987
|
+
}
|
|
2988
|
+
else if (msg.type === "mcp_ready") {
|
|
2989
|
+
this.handleMcpReady(msg, socket);
|
|
2990
|
+
}
|
|
2991
|
+
else if (msg.type === "pong") {
|
|
2992
|
+
this.handleMcpPong(msg, socket);
|
|
2993
|
+
}
|
|
2994
|
+
else if (msg.type === "query_sessions") {
|
|
2995
|
+
// Fleet manager asks for all registered session names (catches sessions
|
|
2996
|
+
// that sent mcp_ready before fleet manager connected).
|
|
2997
|
+
const sessions = [];
|
|
2998
|
+
for (const [s, sessionName] of this.socketSessionNames) {
|
|
2999
|
+
if (!s.destroyed && sessionName !== this.name) {
|
|
3000
|
+
// Individual mcp_ready for initial registration path
|
|
3001
|
+
this.ipcServer?.send(socket, { type: "mcp_ready", sessionName });
|
|
3002
|
+
sessions.push(sessionName);
|
|
3003
|
+
}
|
|
2851
3004
|
}
|
|
3005
|
+
// Batch response for prune path
|
|
3006
|
+
this.ipcServer?.send(socket, { type: "query_sessions_response", sessions });
|
|
2852
3007
|
}
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
}
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
this.pushChannelMessage(msg.content, meta, targetSession, deliveryEpoch);
|
|
2863
|
-
}).catch(err => {
|
|
2864
|
-
this.deferDurableDelivery(meta, `target wake failed before pane submission: ${err.message}`);
|
|
2865
|
-
this.logger.error({ err: err.message }, "Wake failed for inbound delivery");
|
|
2866
|
-
});
|
|
2867
|
-
}
|
|
2868
|
-
else if (msg.type === "raw_paste") {
|
|
2869
|
-
this.handleRawPasteIpcMessage(msg);
|
|
2870
|
-
}
|
|
2871
|
-
else if (msg.type === "config_update") {
|
|
2872
|
-
this.applyConfigUpdate(msg.config);
|
|
2873
|
-
}
|
|
2874
|
-
else if (msg.type === "steer") {
|
|
2875
|
-
const meta = (msg.meta ?? {});
|
|
2876
|
-
this.steerMessage(msg.content, meta, this.captureDeliveryEpoch(msg.delivery_epoch));
|
|
2877
|
-
}
|
|
2878
|
-
else if (msg.type === "btw") {
|
|
2879
|
-
const meta = (msg.meta ?? {});
|
|
2880
|
-
this.btwMessage(msg.content, meta, this.captureDeliveryEpoch(msg.delivery_epoch));
|
|
2881
|
-
}
|
|
2882
|
-
else if (msg.type === "fleet_schedule_trigger") {
|
|
2883
|
-
const payload = msg.payload;
|
|
2884
|
-
const meta = msg.meta;
|
|
2885
|
-
const deliveryEpoch = this.captureDeliveryEpoch(msg.delivery_epoch);
|
|
2886
|
-
void this.wake().then(() => this.pushChannelMessage(payload.message, meta, undefined, deliveryEpoch)).catch(err => {
|
|
2887
|
-
this.logger.error({ err: err.message }, "Wake failed for scheduled delivery");
|
|
2888
|
-
});
|
|
2889
|
-
}
|
|
2890
|
-
else if (msg.type === "query_instance_state") {
|
|
2891
|
-
void this.respondToInstanceStateQuery(msg, socket);
|
|
2892
|
-
}
|
|
2893
|
-
});
|
|
2894
|
-
// 2. Tmux — ensure session, create window if not alive
|
|
2895
|
-
await TmuxManager.ensureSession(this.tmuxSessionName);
|
|
2896
|
-
this.startupAdmission?.();
|
|
2897
|
-
this.tmux = new TmuxManager(this.tmuxSessionName, "", resolveTmuxLogicalSize(this.config.terminal), this.controlClient);
|
|
2898
|
-
// Strategy A: always start fresh Claude window (MCP server has no reconnection)
|
|
2899
|
-
// Kill any existing window from previous run
|
|
2900
|
-
const windowIdFile = join(this.instanceDir, "window-id");
|
|
2901
|
-
if (existsSync(windowIdFile)) {
|
|
2902
|
-
const savedId = readFileSync(windowIdFile, "utf-8").trim();
|
|
2903
|
-
if (savedId) {
|
|
2904
|
-
const oldTmux = new TmuxManager(this.tmuxSessionName, savedId);
|
|
2905
|
-
if (await oldTmux.isWindowAlive()) {
|
|
2906
|
-
this.startupAdmission?.();
|
|
2907
|
-
await this.checkpointSessionId();
|
|
3008
|
+
else
|
|
3009
|
+
this.handleFleetMessage(msg, reply => { this.ipcServer?.send(socket, reply); });
|
|
3010
|
+
});
|
|
3011
|
+
}
|
|
3012
|
+
let nativeDisposition;
|
|
3013
|
+
if (this.nativePaneLifecycle) {
|
|
3014
|
+
this.beginSpawn();
|
|
3015
|
+
try {
|
|
3016
|
+
const acquired = await this.nativePaneLifecycle.acquire(() => {
|
|
2908
3017
|
this.startupAdmission?.();
|
|
2909
|
-
|
|
3018
|
+
if (this.startupAborted)
|
|
3019
|
+
throw Error("Native launch was superseded");
|
|
3020
|
+
});
|
|
3021
|
+
this.tmux = acquired.pane;
|
|
3022
|
+
this.nativeTranscriptSource = acquired.source;
|
|
3023
|
+
nativeDisposition = acquired.disposition;
|
|
3024
|
+
this.lastSpawnAt = Date.now();
|
|
3025
|
+
this.setProcessStatus("running");
|
|
3026
|
+
this.bindInstanceStateOutputListener(this.tmux.getWindowId());
|
|
3027
|
+
this.saveSessionId();
|
|
3028
|
+
// New/resumed native processes can still be painting their first frame. Keep deliveries behind the same
|
|
3029
|
+
// bounded dialog/readiness scan as local startup. An already-running reattachment may be busy: do not
|
|
3030
|
+
// wait for that work to finish or inject a startup key into it.
|
|
3031
|
+
if (acquired.disposition === "reattached") {
|
|
3032
|
+
if (this.backend?.binaryName === "codex") {
|
|
3033
|
+
const native = this.nativePaneLifecycle, spawn = this.spawnGeneration, fence = this.launchFenceEpoch, attempt = this.launchAttempt;
|
|
3034
|
+
try {
|
|
3035
|
+
const pane = await acquired.pane.capturePane();
|
|
3036
|
+
this.startupAdmission?.();
|
|
3037
|
+
if (!this.startupAborted && !this.deliveryWritesStopping && this.nativePaneLifecycle === native && this.tmux === acquired.pane
|
|
3038
|
+
&& spawn === this.spawnGeneration && fence === this.launchFenceEpoch && attempt === this.launchAttempt && native.current())
|
|
3039
|
+
this.takeQuotaReplayBaseline(pane);
|
|
3040
|
+
}
|
|
3041
|
+
catch { /* An old runner or unavailable proof keeps the existing fail-closed scanner. */ }
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
3044
|
+
else {
|
|
3045
|
+
if (!await this.finishStartupScan(120_000))
|
|
3046
|
+
throw Error("Native CLI exited during startup; retained session was not replaced");
|
|
2910
3047
|
this.startupAdmission?.();
|
|
2911
|
-
this.
|
|
3048
|
+
if (this.startupAborted || this.deliveryWritesStopping || !this.nativePaneLifecycle.current())
|
|
3049
|
+
throw Error("Native launch was superseded");
|
|
2912
3050
|
}
|
|
2913
3051
|
}
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
this.isNewSession = !resumed;
|
|
2918
|
-
if (!resumed) {
|
|
2919
|
-
await this.injectSnapshotMessage(this.startupAdmission);
|
|
2920
|
-
this.startupAdmission?.();
|
|
3052
|
+
finally {
|
|
3053
|
+
this.endSpawn();
|
|
3054
|
+
}
|
|
2921
3055
|
}
|
|
2922
3056
|
else {
|
|
2923
|
-
//
|
|
2924
|
-
|
|
2925
|
-
|
|
3057
|
+
// 2. Tmux — ensure session, create window if not alive
|
|
3058
|
+
await this.paneHost.ensureSession(this.tmuxSessionName);
|
|
3059
|
+
this.startupAdmission?.();
|
|
3060
|
+
this.tmux = this.paneHost.bind(this.tmuxSessionName, "", resolveTmuxLogicalSize(this.config.terminal), this.controlClient);
|
|
3061
|
+
// M-2457 §6 rule 3: a window-id 2.3 wrote names a window of the SYSTEM tmux's default server.
|
|
3062
|
+
// That window is proven ours, checkpointed and closed (or this instance is held) — and the id is dropped, as it
|
|
3063
|
+
// means nothing on AgEnD's own server — before the fresh-start below can look at it.
|
|
3064
|
+
await migrateLegacyWindow({ agendHome: getAgendHome(), instance: this.name, instanceDir: this.instanceDir, session: this.tmuxSessionName, legacySocket: legacyTmuxSocket(), currentSocket: tmuxSocket(),
|
|
3065
|
+
backendBinary: this.backend?.binaryName ?? "", checkpoint: () => this.checkpointSessionId(),
|
|
3066
|
+
log: (msg, data) => this.logger.info(data ?? {}, msg) });
|
|
3067
|
+
this.startupAdmission?.();
|
|
3068
|
+
// Strategy A: always start fresh Claude window (MCP server has no reconnection)
|
|
3069
|
+
// Kill any existing window from previous run
|
|
3070
|
+
const windowIdFile = join(this.instanceDir, "window-id");
|
|
3071
|
+
if (existsSync(windowIdFile)) {
|
|
3072
|
+
const savedId = readFileSync(windowIdFile, "utf-8").trim();
|
|
3073
|
+
if (savedId) {
|
|
3074
|
+
const oldTmux = this.paneHost.bind(this.tmuxSessionName, savedId);
|
|
3075
|
+
if (await oldTmux.isWindowAlive()) {
|
|
3076
|
+
this.startupAdmission?.();
|
|
3077
|
+
await this.checkpointSessionId();
|
|
3078
|
+
this.startupAdmission?.();
|
|
3079
|
+
await oldTmux.killWindow();
|
|
3080
|
+
this.startupAdmission?.();
|
|
3081
|
+
this.logger.info({ savedId }, "Killed old tmux window for fresh start");
|
|
3082
|
+
}
|
|
3083
|
+
}
|
|
3084
|
+
}
|
|
3085
|
+
const resumed = await this.spawnClaudeWindow();
|
|
3086
|
+
this.startupAdmission?.();
|
|
3087
|
+
this.isNewSession = !resumed;
|
|
3088
|
+
if (!resumed) {
|
|
3089
|
+
await this.injectSnapshotMessage(this.startupAdmission);
|
|
3090
|
+
this.startupAdmission?.();
|
|
3091
|
+
}
|
|
3092
|
+
else {
|
|
3093
|
+
// Clean up stale snapshot file — resume restored full context, snapshot not needed
|
|
3094
|
+
try {
|
|
3095
|
+
unlinkSync(join(this.instanceDir, "rotation-state.json"));
|
|
3096
|
+
}
|
|
3097
|
+
catch { /* may not exist */ }
|
|
2926
3098
|
}
|
|
2927
|
-
catch { /* may not exist */ }
|
|
2928
3099
|
}
|
|
3100
|
+
if (nativeDisposition)
|
|
3101
|
+
this.isNewSession = nativeDisposition === "fresh";
|
|
2929
3102
|
// #1209: conditional continuation for the turn interrupted by the last
|
|
2930
3103
|
// restart, if the gates allow. Detached; the gate
|
|
2931
3104
|
// consumes its one-shot marker first and never throws into boot.
|
|
2932
|
-
const legacyResume = this.maybeResumeInterruptedTurn().catch(() => "unknown");
|
|
3105
|
+
const legacyResume = this.nativePaneLifecycle ? Promise.resolve("unknown") : this.maybeResumeInterruptedTurn().catch(() => "unknown");
|
|
2933
3106
|
const recoveryOwner = JSON.stringify(this.interactionOwner());
|
|
2934
3107
|
void Promise.allSettled([legacyResume]).then(() => {
|
|
2935
3108
|
if (JSON.stringify(this.interactionOwner()) === recoveryOwner) {
|
|
@@ -2948,7 +3121,7 @@ export class Daemon extends EventEmitter {
|
|
|
2948
3121
|
// (statusline transcript); codex/kiro/opencode read their CLI's own
|
|
2949
3122
|
// conversation store via a pluggable source. Backends with no known
|
|
2950
3123
|
// source stay inert exactly as before.
|
|
2951
|
-
this.transcriptMonitor = this.buildTranscriptMonitor(createTranscriptSource(this.config.backend ?? "claude-code", this.config.working_directory, this.credentialProfileStore(), () => this.backend?.transcriptLaunch?.() ?? null));
|
|
3124
|
+
this.transcriptMonitor = this.buildTranscriptMonitor(this.nativeTranscriptSource ?? createTranscriptSource(this.config.backend ?? "claude-code", this.config.working_directory, this.credentialProfileStore(), () => this.backend?.transcriptLaunch?.() ?? null));
|
|
2952
3125
|
const transcriptMonitor = this.transcriptMonitor;
|
|
2953
3126
|
const transcriptFence = this.launchFenceEpoch;
|
|
2954
3127
|
// Baseline in the isolate before this daemon accepts new work. A
|
|
@@ -3004,13 +3177,15 @@ export class Daemon extends EventEmitter {
|
|
|
3004
3177
|
if (hangConfig?.enabled !== false) {
|
|
3005
3178
|
this.hangDetector = new HangDetector();
|
|
3006
3179
|
}
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
this.
|
|
3013
|
-
|
|
3180
|
+
if (!this.nativePaneLifecycle) {
|
|
3181
|
+
// 8. Context guardian
|
|
3182
|
+
const statusFile = join(this.instanceDir, "statusline.json");
|
|
3183
|
+
this.guardian = new ContextGuardian(this.config.context_guardian ?? {}, this.logger, statusFile);
|
|
3184
|
+
this.guardian.startWatching();
|
|
3185
|
+
this.guardian.on("status_update", () => {
|
|
3186
|
+
this.saveSessionId();
|
|
3187
|
+
});
|
|
3188
|
+
}
|
|
3014
3189
|
// Context rotation removed: all CLI backends have built-in auto-compact.
|
|
3015
3190
|
// Crash recovery (health check + respawn with snapshot) is retained below.
|
|
3016
3191
|
}
|
|
@@ -3063,7 +3238,7 @@ export class Daemon extends EventEmitter {
|
|
|
3063
3238
|
this.socketPids.delete(socket);
|
|
3064
3239
|
// Notify fleet manager so it can clean up sessionRegistry
|
|
3065
3240
|
if (sessionName !== this.name) {
|
|
3066
|
-
this.
|
|
3241
|
+
this.broadcastFleetMessage({ type: "session_disconnected", sessionName });
|
|
3067
3242
|
}
|
|
3068
3243
|
});
|
|
3069
3244
|
}
|
|
@@ -3079,11 +3254,16 @@ export class Daemon extends EventEmitter {
|
|
|
3079
3254
|
// sub-agent's server may have left a dead pid in the slot).
|
|
3080
3255
|
this.noteMcpProofOfLife("mcp_ready", typeof msg.pid === "number" ? msg.pid : undefined);
|
|
3081
3256
|
}
|
|
3082
|
-
this.
|
|
3257
|
+
this.broadcastFleetMessage({ type: "mcp_ready", sessionName });
|
|
3083
3258
|
}
|
|
3084
3259
|
checkMcpServerAlive() {
|
|
3085
3260
|
if (this.isPaused)
|
|
3086
3261
|
return;
|
|
3262
|
+
if (this.nativePaneLifecycle) {
|
|
3263
|
+
if (this.nativePaneLifecycle.mcpProof() === "alive")
|
|
3264
|
+
this.noteMcpProofOfLife("connection");
|
|
3265
|
+
return; // No native PID/socket guessing or restart from an unknown helper observation.
|
|
3266
|
+
}
|
|
3087
3267
|
const status = mcpServerState(this.instanceDir);
|
|
3088
3268
|
if (status.state === "alive") {
|
|
3089
3269
|
this.mcpServedGeneration = this.spawnGeneration;
|
|
@@ -3167,6 +3347,8 @@ export class Daemon extends EventEmitter {
|
|
|
3167
3347
|
* server from a third-party one, and failed the whole launch for either.
|
|
3168
3348
|
*/
|
|
3169
3349
|
checkFleetMcpNeverConnected() {
|
|
3350
|
+
if (this.nativePaneLifecycle)
|
|
3351
|
+
return; // Native helper presence owns this observation.
|
|
3170
3352
|
if (this.config.agent_mode === "cli")
|
|
3171
3353
|
return; // no MCP server by design
|
|
3172
3354
|
if (this.lastSpawnAt === 0 || this.mcpServedGeneration === this.spawnGeneration)
|
|
@@ -3377,6 +3559,8 @@ export class Daemon extends EventEmitter {
|
|
|
3377
3559
|
* proof that tools are being served, whatever channel.mcp.pid says.
|
|
3378
3560
|
*/
|
|
3379
3561
|
mcpServerAlive() {
|
|
3562
|
+
if (this.nativePaneLifecycle)
|
|
3563
|
+
return this.nativePaneLifecycle.mcpProof() === "alive" ? { alive: true, source: "connection" } : { alive: false, source: "none" };
|
|
3380
3564
|
const status = mcpServerState(this.instanceDir);
|
|
3381
3565
|
if (status.state === "alive")
|
|
3382
3566
|
return { alive: true, source: "pid", pid: status.pid };
|
|
@@ -3441,7 +3625,7 @@ export class Daemon extends EventEmitter {
|
|
|
3441
3625
|
this.mcpDeathNotifiedForPid = null;
|
|
3442
3626
|
this.mcpDeathDeferredForPid = null;
|
|
3443
3627
|
this.clearMcpRestartRequest();
|
|
3444
|
-
if (pid && mcpServerState(this.instanceDir).state !== "alive")
|
|
3628
|
+
if (!this.nativePaneLifecycle && pid && mcpServerState(this.instanceDir).state !== "alive")
|
|
3445
3629
|
this.repairMcpPidSlot(pid, source);
|
|
3446
3630
|
}
|
|
3447
3631
|
emitMcpRecovered(source, pid) {
|
|
@@ -3488,6 +3672,26 @@ export class Daemon extends EventEmitter {
|
|
|
3488
3672
|
// ended this instance's health loop because scheduleNext() sat after the
|
|
3489
3673
|
// throwing code. Catch, log, and keep checking.
|
|
3490
3674
|
try {
|
|
3675
|
+
if (this.nativePaneLifecycle) {
|
|
3676
|
+
if (this.healthCheckPaused) {
|
|
3677
|
+
scheduleNext();
|
|
3678
|
+
return;
|
|
3679
|
+
}
|
|
3680
|
+
const native = this.nativePaneLifecycle, pane = this.tmux;
|
|
3681
|
+
const status = await pane?.getPaneStatus();
|
|
3682
|
+
if (this.runtimeMonitorsFrozen || native !== this.nativePaneLifecycle || pane !== this.tmux)
|
|
3683
|
+
return;
|
|
3684
|
+
const snapshot = native.snapshot?.();
|
|
3685
|
+
if (status?.alive === false && snapshot?.state === "exited") {
|
|
3686
|
+
this.healthCheckPaused = true;
|
|
3687
|
+
this.setProcessStatus(snapshot.exitCode === 0 ? "stopped" : "crashed");
|
|
3688
|
+
this.emit("native_pane_exited", { name: this.name, snapshot, owner: this.interactionOwner() });
|
|
3689
|
+
}
|
|
3690
|
+
else if (status?.alive)
|
|
3691
|
+
this.checkMcpServerAlive();
|
|
3692
|
+
scheduleNext();
|
|
3693
|
+
return;
|
|
3694
|
+
}
|
|
3491
3695
|
// Instance directory removed externally (e.g. `rm -rf ~/.agend/instances/<name>`).
|
|
3492
3696
|
// Stop the loop permanently — otherwise every tick triggers a respawn, whose
|
|
3493
3697
|
// writeRotationSnapshot fails with ENOENT and gets caught as "Failed to respawn",
|
|
@@ -3623,13 +3827,13 @@ export class Daemon extends EventEmitter {
|
|
|
3623
3827
|
let inWindowLossBurst = false;
|
|
3624
3828
|
let nullReason;
|
|
3625
3829
|
if (!paneStatus) {
|
|
3626
|
-
const serverAlive = await
|
|
3830
|
+
const serverAlive = await this.paneHost.sessionExists(this.tmuxSessionName);
|
|
3627
3831
|
if (discardStaleHealth())
|
|
3628
3832
|
return;
|
|
3629
3833
|
// A server may have already restarted before this daemon's health
|
|
3630
3834
|
// tick. The new PID is the durable generation boundary: treat it as
|
|
3631
3835
|
// a fleet storm even though `has-session` is true again.
|
|
3632
|
-
const serverPid = serverAlive ? await
|
|
3836
|
+
const serverPid = serverAlive ? await this.paneHost.getServerPid(this.tmuxSessionName) : null;
|
|
3633
3837
|
if (discardStaleHealth())
|
|
3634
3838
|
return;
|
|
3635
3839
|
const generationChanged = serverAlive && this.stormWindow?.observeServerAlive(serverPid) === true;
|
|
@@ -3658,7 +3862,7 @@ export class Daemon extends EventEmitter {
|
|
|
3658
3862
|
// the window truly no longer exists vs a transient query glitch.
|
|
3659
3863
|
nullReason = "no_window";
|
|
3660
3864
|
try {
|
|
3661
|
-
const windows = await
|
|
3865
|
+
const windows = await this.paneHost.listWindowsStrict(this.tmuxSessionName, this.controlClient);
|
|
3662
3866
|
if (discardStaleHealth())
|
|
3663
3867
|
return;
|
|
3664
3868
|
this.windowQueryFailureTicks = 0;
|
|
@@ -3905,10 +4109,10 @@ export class Daemon extends EventEmitter {
|
|
|
3905
4109
|
// Wrapped in try-catch: if tmux server is dead, listWindows throws —
|
|
3906
4110
|
// must not block spawnClaudeWindow (which calls ensureSession).
|
|
3907
4111
|
try {
|
|
3908
|
-
const windows = await
|
|
4112
|
+
const windows = await this.paneHost.listWindows(this.tmuxSessionName);
|
|
3909
4113
|
for (const w of windows) {
|
|
3910
4114
|
if (w.name === this.name) {
|
|
3911
|
-
const tm =
|
|
4115
|
+
const tm = this.paneHost.bind(this.tmuxSessionName, w.id);
|
|
3912
4116
|
await tm.killWindow();
|
|
3913
4117
|
}
|
|
3914
4118
|
}
|
|
@@ -4053,7 +4257,7 @@ export class Daemon extends EventEmitter {
|
|
|
4053
4257
|
// Force the next ready capture to emit a fresh transition after respawn.
|
|
4054
4258
|
this.instanceState = "working";
|
|
4055
4259
|
}
|
|
4056
|
-
this.
|
|
4260
|
+
this.broadcastFleetMessage({
|
|
4057
4261
|
type: "instance_process_state",
|
|
4058
4262
|
instanceName: this.name,
|
|
4059
4263
|
status,
|
|
@@ -4253,12 +4457,15 @@ export class Daemon extends EventEmitter {
|
|
|
4253
4457
|
for (const key of dialog.keys) {
|
|
4254
4458
|
if (stale())
|
|
4255
4459
|
return;
|
|
4460
|
+
const keyScreen = this.nativePaneLifecycle ? await pollTmux.capturePane() : currentPane;
|
|
4461
|
+
if (stale() || !Daemon.dialogMatches(dialog, keyScreen))
|
|
4462
|
+
return;
|
|
4256
4463
|
let sent = false;
|
|
4257
4464
|
if (SPECIAL_KEYS.has(key)) {
|
|
4258
|
-
sent = await pollTmux.sendSpecialKey(key);
|
|
4465
|
+
sent = await (this.nativePaneLifecycle ? pollTmux.sendSpecialKey(key, undefined, { kind: "dialog", screen: keyScreen }) : pollTmux.sendSpecialKey(key));
|
|
4259
4466
|
}
|
|
4260
4467
|
else if (dialog.literalKeys) {
|
|
4261
|
-
sent = await pollTmux.sendKeys(key); // typed, no Enter (#2872)
|
|
4468
|
+
sent = await (this.nativePaneLifecycle ? pollTmux.sendKeys(key, { kind: "dialog", screen: keyScreen }) : pollTmux.sendKeys(key)); // typed, no Enter (#2872)
|
|
4262
4469
|
}
|
|
4263
4470
|
else {
|
|
4264
4471
|
sent = await pollTmux.pasteText(key, this.systemPasteOptions());
|
|
@@ -4561,7 +4768,7 @@ export class Daemon extends EventEmitter {
|
|
|
4561
4768
|
}
|
|
4562
4769
|
/** Arm the recovery gates and emit one detected error pattern. */
|
|
4563
4770
|
emitErrorPattern(ep, key, pane, now) {
|
|
4564
|
-
const minimum = this.backend?.binaryName === "claude" && ep.type === "outdated_cli" ? claudeMinimumError(pane) : null;
|
|
4771
|
+
const minimum = !this.nativePaneLifecycle && this.backend?.binaryName === "claude" && ep.type === "outdated_cli" ? claudeMinimumError(pane) : null;
|
|
4565
4772
|
if (minimum) {
|
|
4566
4773
|
this.lastErrorNotifiedAt.set(key, now);
|
|
4567
4774
|
void this.handleClaudeModelMinimum(minimum).catch(err => {
|
|
@@ -4637,7 +4844,20 @@ export class Daemon extends EventEmitter {
|
|
|
4637
4844
|
*/
|
|
4638
4845
|
async sendEscape() {
|
|
4639
4846
|
const cancelKey = this.backend?.getCancelKey() ?? "Escape";
|
|
4640
|
-
|
|
4847
|
+
const tmux = this.tmux;
|
|
4848
|
+
if (!tmux)
|
|
4849
|
+
return;
|
|
4850
|
+
if (this.nativePaneLifecycle) {
|
|
4851
|
+
// A native pane's composer proof cannot see a permission dialog, so an unproved key is withheld there. The cancel
|
|
4852
|
+
// is the person's own interrupt, keyed on the screen read just before (as the dialog answer path is): what Esc
|
|
4853
|
+
// does on Linux's tmux pane, on the same screen, with the same key.
|
|
4854
|
+
const screen = await tmux.capturePane().catch(() => null);
|
|
4855
|
+
if (screen === null)
|
|
4856
|
+
return;
|
|
4857
|
+
await tmux.sendSpecialKey(cancelKey, undefined, { kind: "dialog", screen });
|
|
4858
|
+
return;
|
|
4859
|
+
}
|
|
4860
|
+
await tmux.sendSpecialKey(cancelKey);
|
|
4641
4861
|
}
|
|
4642
4862
|
/**
|
|
4643
4863
|
* Drop every not-yet-started pane delivery which predates a user cancel.
|
|
@@ -4703,7 +4923,7 @@ export class Daemon extends EventEmitter {
|
|
|
4703
4923
|
return;
|
|
4704
4924
|
const outcome = follower.look(pane);
|
|
4705
4925
|
if (outcome) {
|
|
4706
|
-
this.
|
|
4926
|
+
this.broadcastFleetMessage({ type: "compact_pane_result", id, owner, outcome });
|
|
4707
4927
|
return;
|
|
4708
4928
|
}
|
|
4709
4929
|
}
|
|
@@ -4723,7 +4943,7 @@ export class Daemon extends EventEmitter {
|
|
|
4723
4943
|
const reportSwitch = (result) => {
|
|
4724
4944
|
if (!ownSwitch)
|
|
4725
4945
|
return;
|
|
4726
|
-
this.
|
|
4946
|
+
this.broadcastFleetMessage({ type: "runtime_switch_result", id: ownSwitch.id, ...result });
|
|
4727
4947
|
};
|
|
4728
4948
|
// Board 003648ac: the fleet follows a web /compact from just before its paste is written: the transcript's end then
|
|
4729
4949
|
// (taken here, under this launch, before the write) and the launch it was written under ride with the notice — once.
|
|
@@ -4738,7 +4958,7 @@ export class Daemon extends EventEmitter {
|
|
|
4738
4958
|
if (!notifyWritten || told)
|
|
4739
4959
|
return;
|
|
4740
4960
|
told = true;
|
|
4741
|
-
this.
|
|
4961
|
+
this.broadcastFleetMessage({ type: "raw_paste_written", id: notifyWritten, outcome: written ? "written" : "not_written",
|
|
4742
4962
|
...(written ? { owner, checkpoint, ...(paneFollower ? { pane: true } : {}) } : {}) });
|
|
4743
4963
|
if (written && paneFollower)
|
|
4744
4964
|
void this.followCompactPane(notifyWritten, owner, paneFollower);
|
|
@@ -4807,7 +5027,7 @@ export class Daemon extends EventEmitter {
|
|
|
4807
5027
|
else if (durableAttempt && verdict.paneWriteStarted) {
|
|
4808
5028
|
const unproven = `${verdict.phase ?? "raw-paste"}:${verdict.proof ?? "unverified"}`;
|
|
4809
5029
|
const checkpoint = verdict.transcriptCheckpoint;
|
|
4810
|
-
if (checkpoint && RAW_TEXT_TRANSCRIPT_BACKENDS.includes(checkpoint.backend)) {
|
|
5030
|
+
if (checkpoint && (checkpoint.ownedCodex || RAW_TEXT_TRANSCRIPT_BACKENDS.includes(checkpoint.backend))) {
|
|
4811
5031
|
// #1647: the pane could not show it, but the CLI's transcript records the turn the paste started — later
|
|
4812
5032
|
// than the pane window sometimes. Wait for it there (bounded), off the paste lock.
|
|
4813
5033
|
this.logger.info({ deliveryId: durableAttempt.deliveryId, unproven }, "Raw paste not proven on the pane — asking the CLI's transcript for the turn it started");
|
|
@@ -4900,10 +5120,11 @@ export class Daemon extends EventEmitter {
|
|
|
4900
5120
|
const press = (target, cursor, key) => this.paneWriteLock.run(async () => {
|
|
4901
5121
|
if (this.tmux !== tmux)
|
|
4902
5122
|
return false;
|
|
4903
|
-
const
|
|
5123
|
+
const screen = await read();
|
|
5124
|
+
const now = claudeSwitchDialog(screen);
|
|
4904
5125
|
if (!now || now.kind !== "model" || now.target !== target || (cursor !== null && now.cursor !== cursor))
|
|
4905
5126
|
return false;
|
|
4906
|
-
return tmux.sendSpecialKey(key);
|
|
5127
|
+
return this.nativePaneLifecycle ? tmux.sendSpecialKey(key, undefined, { kind: "dialog", screen }) : tmux.sendSpecialKey(key);
|
|
4907
5128
|
});
|
|
4908
5129
|
const gone = async () => {
|
|
4909
5130
|
const until = performance.now() + OWN_SWITCH_SETTLE_MS;
|
|
@@ -4992,9 +5213,12 @@ export class Daemon extends EventEmitter {
|
|
|
4992
5213
|
return false;
|
|
4993
5214
|
const specialKeys = new Set(["Up", "Down", "Enter", "Escape", "Right", "Left"]);
|
|
4994
5215
|
for (const key of dialog.keys) {
|
|
5216
|
+
const keyScreen = this.nativePaneLifecycle ? await this.tmux.capturePane() : currentPane;
|
|
5217
|
+
if (!matches(keyScreen))
|
|
5218
|
+
return false;
|
|
4995
5219
|
const ok = specialKeys.has(key)
|
|
4996
|
-
? await this.tmux.sendSpecialKey(key)
|
|
4997
|
-
: await this.tmux.sendKeys(key);
|
|
5220
|
+
? await (this.nativePaneLifecycle ? this.tmux.sendSpecialKey(key, undefined, { kind: "dialog", screen: keyScreen }) : this.tmux.sendSpecialKey(key))
|
|
5221
|
+
: await (this.nativePaneLifecycle ? this.tmux.sendKeys(key, { kind: "dialog", screen: keyScreen }) : this.tmux.sendKeys(key));
|
|
4998
5222
|
if (!ok)
|
|
4999
5223
|
return false;
|
|
5000
5224
|
await new Promise(resolve => setTimeout(resolve, 100));
|
|
@@ -5237,7 +5461,7 @@ export class Daemon extends EventEmitter {
|
|
|
5237
5461
|
await this.tmux.sendSpecialKey("Escape").catch(() => false);
|
|
5238
5462
|
return true;
|
|
5239
5463
|
}
|
|
5240
|
-
async stop() {
|
|
5464
|
+
async stop(options = {}) {
|
|
5241
5465
|
this.publishWorkingState("before_stop");
|
|
5242
5466
|
this.logger.info("Stopping daemon instance");
|
|
5243
5467
|
this.clearQuitRelaunchWatch();
|
|
@@ -5259,8 +5483,18 @@ export class Daemon extends EventEmitter {
|
|
|
5259
5483
|
}
|
|
5260
5484
|
if (this.adapter)
|
|
5261
5485
|
await this.adapter.stop();
|
|
5486
|
+
if (this.nativePaneLifecycle) {
|
|
5487
|
+
this.healthCheckPaused = true;
|
|
5488
|
+
this.saveSessionId();
|
|
5489
|
+
await this.nativePaneLifecycle.release(options.nativePane ?? "detach");
|
|
5490
|
+
try {
|
|
5491
|
+
unlinkSync(join(this.instanceDir, "daemon.pid"));
|
|
5492
|
+
}
|
|
5493
|
+
catch { /* metadata only */ }
|
|
5494
|
+
return;
|
|
5495
|
+
}
|
|
5262
5496
|
// Notify MCP servers of graceful shutdown (prevents reconnect attempts)
|
|
5263
|
-
this.
|
|
5497
|
+
this.broadcastFleetMessage({ type: "shutdown" });
|
|
5264
5498
|
// Quit CLI FIRST — this kills MCP server child processes cleanly.
|
|
5265
5499
|
// IPC must stay open during quit so MCP servers receive the shutdown message.
|
|
5266
5500
|
if (this.tmux) {
|
|
@@ -5406,6 +5640,24 @@ export class Daemon extends EventEmitter {
|
|
|
5406
5640
|
freshChoice: this.recoveryFreshChoice || this.isNewSession && !this.bootSkippedResume, crashLoopFresh: this.recoveryCrashLoopFresh,
|
|
5407
5641
|
cancelled: this.recoveryCancelled, background: this.workingBackgroundObservation };
|
|
5408
5642
|
}
|
|
5643
|
+
/** Observe this host General before its approved switch. No keys, process signals or provider writes. */
|
|
5644
|
+
async generalHostOwner() {
|
|
5645
|
+
const pane = this.tmux, owner = JSON.stringify(this.interactionOwner());
|
|
5646
|
+
if (!this.config.general_topic || this.nativePaneLifecycle || !pane || !/^@\d+$/.test(pane.getWindowId()))
|
|
5647
|
+
throw Error("General host owner is unavailable");
|
|
5648
|
+
const status = await pane.getPaneStatus();
|
|
5649
|
+
if (!status?.alive || !status.pid || status.pid <= 1)
|
|
5650
|
+
throw Error("General host process cannot be proven");
|
|
5651
|
+
const checkpoint = await this.transcriptMonitor?.reconciliationCheckpoint();
|
|
5652
|
+
if (this.tmux !== pane || owner !== JSON.stringify(this.interactionOwner()))
|
|
5653
|
+
throw Error("General host owner changed during observation");
|
|
5654
|
+
const backend = this.config.backend ?? "claude-code";
|
|
5655
|
+
let sessionId = this.backend?.getSessionId() ?? undefined;
|
|
5656
|
+
if (backend === "codex" && checkpoint)
|
|
5657
|
+
sessionId = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/i.exec(checkpoint.path)?.[1];
|
|
5658
|
+
return { kind: "tmux", windowId: pane.getWindowId(), pid: status.pid,
|
|
5659
|
+
...(typeof sessionId === "string" && sessionId.length > 0 && sessionId.length <= 256 && !/[\p{Cc}\p{Cf}]/u.test(sessionId) ? { pin: { backend, sessionId } } : {}) };
|
|
5660
|
+
}
|
|
5409
5661
|
/** Local system work: no user turn, channel reply target, wake or replay of an original request. */
|
|
5410
5662
|
async deliverWorkingRecovery(content, delivery, admitted) {
|
|
5411
5663
|
const tmux = this.tmux, owner = JSON.stringify(this.interactionOwner()), epoch = this.deliveryEpoch;
|
|
@@ -5426,7 +5678,11 @@ export class Daemon extends EventEmitter {
|
|
|
5426
5678
|
|| !this.paneAuthoritativelyIdle(pane) || this.inputTransientInPane(pane)
|
|
5427
5679
|
|| this.backend?.backgroundWorkRunning?.(pane) === true)
|
|
5428
5680
|
return;
|
|
5429
|
-
if (
|
|
5681
|
+
if (this.nativePaneLifecycle ? !this.nativePaneLifecycle.current() || this.nativePaneLifecycle.mcpProof() !== "alive"
|
|
5682
|
+
|| !!this.backend?.isDeliveryInputReadyPane && !this.backend.isDeliveryInputReadyPane(pane)
|
|
5683
|
+
: await tmux.getPaneInputMode?.() !== "raw")
|
|
5684
|
+
return;
|
|
5685
|
+
if (!current())
|
|
5430
5686
|
return;
|
|
5431
5687
|
const evidence = await this.durableAttemptEvidence(tmux.getWindowId(), false, false);
|
|
5432
5688
|
if (!current())
|
|
@@ -5517,7 +5773,7 @@ export class Daemon extends EventEmitter {
|
|
|
5517
5773
|
this.logger.debug({ err }, "Interaction listener failed");
|
|
5518
5774
|
}
|
|
5519
5775
|
try {
|
|
5520
|
-
this.
|
|
5776
|
+
this.broadcastFleetMessage({ type: "instance_interaction", instanceName: this.name, interaction });
|
|
5521
5777
|
}
|
|
5522
5778
|
catch (err) {
|
|
5523
5779
|
this.logger.debug({ err }, "Interaction broadcast failed");
|
|
@@ -5605,6 +5861,56 @@ export class Daemon extends EventEmitter {
|
|
|
5605
5861
|
}
|
|
5606
5862
|
return true;
|
|
5607
5863
|
}
|
|
5864
|
+
/** Shared Fleet inputs: socket and native transports retain the same wake, epoch and raw-paste semantics. */
|
|
5865
|
+
handleFleetMessage(msg, send, current = () => true) {
|
|
5866
|
+
if (msg.type === "query_sessions") {
|
|
5867
|
+
send({ type: "query_sessions_response", sessions: [] });
|
|
5868
|
+
}
|
|
5869
|
+
else if (msg.type === "fleet_inbound") {
|
|
5870
|
+
const meta = msg.meta;
|
|
5871
|
+
const targetSession = msg.targetSession;
|
|
5872
|
+
const deliveryEpoch = this.captureDeliveryEpoch(msg.delivery_epoch);
|
|
5873
|
+
void this.wake().then(() => {
|
|
5874
|
+
if (!current()) {
|
|
5875
|
+
this.deferDurableDelivery(meta, "native channel owner changed before pane submission");
|
|
5876
|
+
return;
|
|
5877
|
+
}
|
|
5878
|
+
this.pushChannelMessage(msg.content, meta, targetSession, deliveryEpoch);
|
|
5879
|
+
}).catch(err => {
|
|
5880
|
+
this.deferDurableDelivery(meta, `target wake failed before pane submission: ${err.message}`);
|
|
5881
|
+
this.logger.error({ err: err.message }, "Wake failed for inbound delivery");
|
|
5882
|
+
});
|
|
5883
|
+
}
|
|
5884
|
+
else if (msg.type === "raw_paste") {
|
|
5885
|
+
this.handleRawPasteIpcMessage(msg);
|
|
5886
|
+
}
|
|
5887
|
+
else if (msg.type === "config_update") {
|
|
5888
|
+
this.applyConfigUpdate(msg.config);
|
|
5889
|
+
}
|
|
5890
|
+
else if (msg.type === "steer") {
|
|
5891
|
+
const meta = (msg.meta ?? {});
|
|
5892
|
+
this.steerMessage(msg.content, meta, this.captureDeliveryEpoch(msg.delivery_epoch));
|
|
5893
|
+
}
|
|
5894
|
+
else if (msg.type === "btw") {
|
|
5895
|
+
const meta = (msg.meta ?? {});
|
|
5896
|
+
this.btwMessage(msg.content, meta, this.captureDeliveryEpoch(msg.delivery_epoch));
|
|
5897
|
+
}
|
|
5898
|
+
else if (msg.type === "fleet_schedule_trigger") {
|
|
5899
|
+
const payload = msg.payload;
|
|
5900
|
+
const meta = msg.meta;
|
|
5901
|
+
const deliveryEpoch = this.captureDeliveryEpoch(msg.delivery_epoch);
|
|
5902
|
+
void this.wake().then(() => { if (current())
|
|
5903
|
+
this.pushChannelMessage(payload.message, meta, undefined, deliveryEpoch); }).catch(err => {
|
|
5904
|
+
this.logger.error({ err: err.message }, "Wake failed for scheduled delivery");
|
|
5905
|
+
});
|
|
5906
|
+
}
|
|
5907
|
+
else if (msg.type === "query_instance_state") {
|
|
5908
|
+
void this.respondToInstanceStateQuery(msg, undefined, send);
|
|
5909
|
+
}
|
|
5910
|
+
else
|
|
5911
|
+
return false;
|
|
5912
|
+
return true;
|
|
5913
|
+
}
|
|
5608
5914
|
/**
|
|
5609
5915
|
* Answer a FleetManager state query. Most callers only need the cached state,
|
|
5610
5916
|
* but lifecycle decisions such as post-reply Cancel retirement need an
|
|
@@ -5612,7 +5918,7 @@ export class Daemon extends EventEmitter {
|
|
|
5612
5918
|
* the last transition can stay "working" even though the CLI has since
|
|
5613
5919
|
* settled without emitting another control-mode output record.
|
|
5614
5920
|
*/
|
|
5615
|
-
async respondToInstanceStateQuery(msg, socket) {
|
|
5921
|
+
async respondToInstanceStateQuery(msg, socket, send) {
|
|
5616
5922
|
try {
|
|
5617
5923
|
if (msg.deliveryIdle === true) {
|
|
5618
5924
|
await this.captureAndEvaluateInstanceState("delivery_idle_gate");
|
|
@@ -5621,7 +5927,7 @@ export class Daemon extends EventEmitter {
|
|
|
5621
5927
|
await this.captureAndEvaluateInstanceState("state_query");
|
|
5622
5928
|
}
|
|
5623
5929
|
const snapshot = this.getInstanceStateSnapshot();
|
|
5624
|
-
|
|
5930
|
+
const reply = {
|
|
5625
5931
|
type: "instance_state_response",
|
|
5626
5932
|
requestId: msg.requestId,
|
|
5627
5933
|
instanceName: this.name,
|
|
@@ -5629,7 +5935,11 @@ export class Daemon extends EventEmitter {
|
|
|
5629
5935
|
state: this.isPaused ? "paused" : snapshot.state,
|
|
5630
5936
|
processStatus: this.processStatus,
|
|
5631
5937
|
pausedAt: this.lastPausedAt,
|
|
5632
|
-
}
|
|
5938
|
+
};
|
|
5939
|
+
if (send)
|
|
5940
|
+
send(reply);
|
|
5941
|
+
else if (socket)
|
|
5942
|
+
this.ipcServer?.send(socket, reply);
|
|
5633
5943
|
}
|
|
5634
5944
|
catch (err) {
|
|
5635
5945
|
this.logger.debug({ err: err.message }, "Instance state query failed");
|
|
@@ -5669,7 +5979,49 @@ export class Daemon extends EventEmitter {
|
|
|
5669
5979
|
static AUTH_RECONFIRM_ROWS = 15;
|
|
5670
5980
|
/** Why the deferred pause was requested; what its marker records (Phase 2a). */
|
|
5671
5981
|
pendingPauseReason = "auth";
|
|
5982
|
+
nativePauseProof = null;
|
|
5983
|
+
/** Consume the exact idle proof synchronously after the lifecycle's await, before fencing and closing. */
|
|
5984
|
+
nativePauseStillReady() {
|
|
5985
|
+
const proof = this.nativePauseProof;
|
|
5986
|
+
this.nativePauseProof = null;
|
|
5987
|
+
if (proof?.())
|
|
5988
|
+
return true;
|
|
5989
|
+
this.pauseRequested = false;
|
|
5990
|
+
return false;
|
|
5991
|
+
}
|
|
5992
|
+
/** Native lifecycle pause uses the ordinary idle/background/admission proof before closing its owned Job. */
|
|
5993
|
+
async nativePauseReady(admission) {
|
|
5994
|
+
this.nativePauseProof = null;
|
|
5995
|
+
const native = this.nativePaneLifecycle, pane = this.tmux, owner = this.interactionOwner();
|
|
5996
|
+
const allowStuck = this.pauseAllowStuck;
|
|
5997
|
+
this.pauseAllowStuck = false;
|
|
5998
|
+
const ready = () => !!native && native === this.nativePaneLifecycle && native.current() && this.tmux === pane
|
|
5999
|
+
&& sameInteractionOwner(owner, this.interactionOwner()) && !this.runtimeMonitorsFrozen && !this.spawning
|
|
6000
|
+
&& this.processStatus === "running" && this.pasteQueueDepth === 0
|
|
6001
|
+
&& (this.instanceState === "idle" || allowStuck && this.instanceState === "stuck") && (!admission || admission.current());
|
|
6002
|
+
if (!pane || !ready()) {
|
|
6003
|
+
this.pauseRequested = false;
|
|
6004
|
+
return false;
|
|
6005
|
+
}
|
|
6006
|
+
let text;
|
|
6007
|
+
try {
|
|
6008
|
+
text = await pane.capturePane();
|
|
6009
|
+
}
|
|
6010
|
+
catch {
|
|
6011
|
+
this.pauseRequested = false;
|
|
6012
|
+
return false;
|
|
6013
|
+
}
|
|
6014
|
+
if (!ready() || admission && !admission.accepts(text) || this.backend?.backgroundWorkRunning?.(text)
|
|
6015
|
+
|| !allowStuck && !this.paneAuthoritativelyIdle(text)) {
|
|
6016
|
+
this.pauseRequested = false;
|
|
6017
|
+
return false;
|
|
6018
|
+
}
|
|
6019
|
+
this.nativePauseProof = ready;
|
|
6020
|
+
return true;
|
|
6021
|
+
}
|
|
5672
6022
|
async pause(reason = "operator", admission) {
|
|
6023
|
+
if (this.nativePaneLifecycle)
|
|
6024
|
+
throw Error("Native pause is owned by its Fleet lifecycle transition");
|
|
5673
6025
|
const flight = this.pauseInner(reason, admission);
|
|
5674
6026
|
const admissions = this.pauseAdmissions ??= new Set();
|
|
5675
6027
|
admissions.add(flight);
|
|
@@ -5777,7 +6129,7 @@ export class Daemon extends EventEmitter {
|
|
|
5777
6129
|
writePausedMarker(this.instanceDir, this.lastPausedAt ?? Date.now(), reason);
|
|
5778
6130
|
this.publishWorkingState("execution");
|
|
5779
6131
|
this.logger.info({ pausedAt: this.lastPausedAt }, "Instance auto-paused");
|
|
5780
|
-
this.
|
|
6132
|
+
this.broadcastFleetMessage({
|
|
5781
6133
|
type: "instance_state", instanceName: this.name, state: "paused", pausedAt: this.lastPausedAt,
|
|
5782
6134
|
});
|
|
5783
6135
|
this.emit("auto_paused", { name: this.name, pausedAt: this.lastPausedAt });
|
|
@@ -5883,7 +6235,7 @@ export class Daemon extends EventEmitter {
|
|
|
5883
6235
|
this.resumeRuntimeMonitors();
|
|
5884
6236
|
this.publishWorkingState("execution");
|
|
5885
6237
|
this.logger.info("Instance auto-woke");
|
|
5886
|
-
this.
|
|
6238
|
+
this.broadcastFleetMessage({
|
|
5887
6239
|
type: "instance_state", instanceName: this.name, state: this.instanceState, pausedAt: null,
|
|
5888
6240
|
});
|
|
5889
6241
|
this.emit("auto_woke", { name: this.name });
|
|
@@ -6047,7 +6399,7 @@ export class Daemon extends EventEmitter {
|
|
|
6047
6399
|
this.logStateEdge(previous, snapshot);
|
|
6048
6400
|
this.publishWorkingState("execution");
|
|
6049
6401
|
this.emit("instance_state", { name: this.name, ...snapshot });
|
|
6050
|
-
this.
|
|
6402
|
+
this.broadcastFleetMessage({ type: "instance_state", instanceName: this.name, ...snapshot });
|
|
6051
6403
|
if (snapshot.state === "stuck" && pane && this.instanceStateReadyPattern) {
|
|
6052
6404
|
this.handleStuckTransition(pane, snapshot, this.instanceStateReadyPattern);
|
|
6053
6405
|
}
|
|
@@ -6149,7 +6501,7 @@ export class Daemon extends EventEmitter {
|
|
|
6149
6501
|
// writing a marker would re-inject a continuation for a finished turn.
|
|
6150
6502
|
// #3030: a message only queued in the busy CLI has not started a turn: the interrupted turn is still the running one,
|
|
6151
6503
|
// and a queued message lost to a restart is the hand-off record's to redeliver, not a continuation's.
|
|
6152
|
-
if (!meta.resumedContinuationOf && !armed.completionDelivered && !queuedHandoff) {
|
|
6504
|
+
if (!this.nativePaneLifecycle && !meta.resumedContinuationOf && !armed.completionDelivered && !queuedHandoff) {
|
|
6153
6505
|
const resumeBackend = this.config.backend ?? this.backend?.binaryName ?? this.runtimeIdentity?.backend;
|
|
6154
6506
|
const resumeCwd = this.config.working_directory ?? "";
|
|
6155
6507
|
writeInFlightTurnMarker(this.instanceDir, {
|
|
@@ -6381,7 +6733,7 @@ export class Daemon extends EventEmitter {
|
|
|
6381
6733
|
// outbound action suppresses a duplicate proxy; only a delivered
|
|
6382
6734
|
// human-facing channel action satisfies the completion guard below.
|
|
6383
6735
|
if (!turn.outboundDelivered && this.config.mcp_proxy_reply === true
|
|
6384
|
-
&& mcpServerState(this.instanceDir).state === "dead") {
|
|
6736
|
+
&& (this.nativePaneLifecycle ? this.nativePaneLifecycle.mcpProof() === "dead" : mcpServerState(this.instanceDir).state === "dead")) {
|
|
6385
6737
|
this.turnReplyGuard.complete(turn.generation);
|
|
6386
6738
|
void this.sendProxyReply(pane, turn.target);
|
|
6387
6739
|
return;
|
|
@@ -6481,21 +6833,37 @@ export class Daemon extends EventEmitter {
|
|
|
6481
6833
|
|| this.config.backend === "claude-code"
|
|
6482
6834
|
|| this.backend?.binaryName === "claude";
|
|
6483
6835
|
}
|
|
6836
|
+
/** #3160: this agent's file steps in its current turn (the CLI's own record), for the Files & changes panel. */
|
|
6837
|
+
followLog = new FollowLog();
|
|
6838
|
+
workspaceFollow(after = 0, turn, scope) { return this.followLog.snapshot(after, turn, scope); }
|
|
6484
6839
|
/**
|
|
6485
6840
|
* This launch's transcript monitor. #1510: its turn boundaries feed the reply guard's ledger, which starts empty
|
|
6486
6841
|
* with it — a new monitor re-baselines at the transcript's end, so nothing the old one read can be attributed.
|
|
6487
6842
|
*/
|
|
6488
6843
|
buildTranscriptMonitor(source) {
|
|
6844
|
+
this.followLog.reset();
|
|
6489
6845
|
const monitor = new TranscriptMonitor(this.instanceDir, this.logger, source);
|
|
6490
6846
|
this.transcriptTurns.reset();
|
|
6491
6847
|
this.transcriptActivityAt = 0;
|
|
6492
6848
|
// Monotonic: a wall-clock correction must neither end nor extend the open-turn hold (#1641 R1).
|
|
6493
6849
|
const touch = () => { this.transcriptActivityAt = performance.now(); };
|
|
6494
|
-
monitor.on("turns", (turns) => {
|
|
6850
|
+
monitor.on("turns", (turns) => {
|
|
6851
|
+
this.transcriptTurns.observe(turns, performance.now());
|
|
6852
|
+
touch();
|
|
6853
|
+
});
|
|
6854
|
+
// #3160: the files this turn reads, edits and searches, for the Files & changes panel's Follow (a few string checks;
|
|
6855
|
+
// nothing is read from disk until someone asks). Claude's turn boundary is its next prompt.
|
|
6856
|
+
const canFollow = () => this.transcriptMonitor === monitor && this.config.runtime !== "windows"
|
|
6857
|
+
&& (this.backend?.binaryName === "claude" || this.backend?.binaryName === "codex");
|
|
6858
|
+
monitor.on("workspace_follow", (event) => { if (canFollow())
|
|
6859
|
+
this.followLog.observe(event); });
|
|
6860
|
+
monitor.on("workspace_reset", () => { if (this.transcriptMonitor === monitor)
|
|
6861
|
+
this.followLog.reset(); });
|
|
6495
6862
|
// #1641 R2: a re-baselined source starts over, and so does what it said (an open turn read before is withdrawn).
|
|
6496
6863
|
monitor.on("reset", () => { if (this.transcriptMonitor === monitor) {
|
|
6497
6864
|
this.transcriptTurns.reset();
|
|
6498
6865
|
this.transcriptActivityAt = 0;
|
|
6866
|
+
this.followLog.reset();
|
|
6499
6867
|
} });
|
|
6500
6868
|
for (const event of ["tool_use", "tool_result", "assistant_text"])
|
|
6501
6869
|
monitor.on(event, touch);
|
|
@@ -6758,7 +7126,7 @@ export class Daemon extends EventEmitter {
|
|
|
6758
7126
|
}
|
|
6759
7127
|
});
|
|
6760
7128
|
}
|
|
6761
|
-
if (!this.
|
|
7129
|
+
if (!this.fleetTransportAvailable()) {
|
|
6762
7130
|
this.logger.error(`${logLabel} failed — no adapter or fleet IPC route`);
|
|
6763
7131
|
return Promise.resolve(false);
|
|
6764
7132
|
}
|
|
@@ -6782,7 +7150,7 @@ export class Daemon extends EventEmitter {
|
|
|
6782
7150
|
resolve(delivered);
|
|
6783
7151
|
});
|
|
6784
7152
|
try {
|
|
6785
|
-
this.
|
|
7153
|
+
this.broadcastFleetMessage({
|
|
6786
7154
|
type: "fleet_outbound",
|
|
6787
7155
|
tool: "reply",
|
|
6788
7156
|
args,
|
|
@@ -7353,7 +7721,7 @@ export class Daemon extends EventEmitter {
|
|
|
7353
7721
|
if (next === this.currentActivity)
|
|
7354
7722
|
return;
|
|
7355
7723
|
this.currentActivity = next;
|
|
7356
|
-
this.
|
|
7724
|
+
this.broadcastFleetMessage({
|
|
7357
7725
|
type: "instance_activity",
|
|
7358
7726
|
instanceName: this.name,
|
|
7359
7727
|
activity: next,
|
|
@@ -7434,7 +7802,7 @@ export class Daemon extends EventEmitter {
|
|
|
7434
7802
|
else
|
|
7435
7803
|
this.config.auto_pause_after = nextAutoPause;
|
|
7436
7804
|
if (nextAutoPause !== previousAutoPause) {
|
|
7437
|
-
const isGeneral = this.config.general_topic === true || this.name
|
|
7805
|
+
const isGeneral = this.config.general_topic === true || generalByName(this.name, this.config);
|
|
7438
7806
|
this.autoPauseController.reconfigure((isGeneral ? 0 : nextAutoPause) * 60_000);
|
|
7439
7807
|
}
|
|
7440
7808
|
}
|
|
@@ -7514,7 +7882,7 @@ export class Daemon extends EventEmitter {
|
|
|
7514
7882
|
return;
|
|
7515
7883
|
this.lastProgressBroadcast = rendered;
|
|
7516
7884
|
this.lastProgressBroadcastAt = Date.now();
|
|
7517
|
-
this.
|
|
7885
|
+
this.broadcastFleetMessage({
|
|
7518
7886
|
type: "instance_progress",
|
|
7519
7887
|
instanceName: this.name,
|
|
7520
7888
|
progress: rendered,
|
|
@@ -7530,7 +7898,7 @@ export class Daemon extends EventEmitter {
|
|
|
7530
7898
|
if (this.lastProgressBroadcast !== "") {
|
|
7531
7899
|
this.lastProgressBroadcast = "";
|
|
7532
7900
|
this.lastProgressBroadcastAt = Date.now();
|
|
7533
|
-
this.
|
|
7901
|
+
this.broadcastFleetMessage({ type: "instance_progress", instanceName: this.name, progress: "" });
|
|
7534
7902
|
}
|
|
7535
7903
|
}
|
|
7536
7904
|
/**
|
|
@@ -7697,7 +8065,7 @@ export class Daemon extends EventEmitter {
|
|
|
7697
8065
|
reportCrossInstanceDeliveryFailure(meta, verdict, error) {
|
|
7698
8066
|
if (!meta.from_instance)
|
|
7699
8067
|
return;
|
|
7700
|
-
this.
|
|
8068
|
+
this.broadcastFleetMessage({
|
|
7701
8069
|
type: "cross_instance_delivery_failed",
|
|
7702
8070
|
senderSession: meta.from_instance,
|
|
7703
8071
|
targetInstance: this.name,
|
|
@@ -9115,13 +9483,14 @@ export class Daemon extends EventEmitter {
|
|
|
9115
9483
|
if (this.remoteCardAnswering)
|
|
9116
9484
|
return { outcome: "refused", reason: "another answer to this card is being keyed in" };
|
|
9117
9485
|
this.remoteCardAnswering = true;
|
|
9486
|
+
let answerScreen = null;
|
|
9118
9487
|
try {
|
|
9119
9488
|
const outcome = await answerRemoteCard({
|
|
9120
9489
|
locked: fn => this.paneWriteLock.run(fn),
|
|
9121
9490
|
// An unreadable screen (a failed capture, another spawn's pane) is unknown — never "the card closed".
|
|
9122
|
-
read: () => this.tmux === tmux ? tmux.capturePane().catch(() => null) :
|
|
9123
|
-
key: key => this.tmux !== tmux ? Promise.resolve(false) : key === "Space" ? tmux.sendKeys(" ") : tmux.sendSpecialKey(key),
|
|
9124
|
-
paste: text => this.tmux !== tmux ? Promise.resolve(false) : tmux.pasteBuffer(text),
|
|
9491
|
+
read: async () => answerScreen = this.tmux === tmux ? await tmux.capturePane().catch(() => null) : null,
|
|
9492
|
+
key: key => this.tmux !== tmux || answerScreen === null ? Promise.resolve(false) : key === "Space" ? (this.nativePaneLifecycle ? tmux.sendKeys(" ", { kind: "dialog", screen: answerScreen }) : tmux.sendKeys(" ")) : (this.nativePaneLifecycle ? tmux.sendSpecialKey(key, undefined, { kind: "dialog", screen: answerScreen }) : tmux.sendSpecialKey(key)),
|
|
9493
|
+
paste: text => this.tmux !== tmux || answerScreen === null ? Promise.resolve(false) : this.nativePaneLifecycle ? tmux.pasteBuffer(text, { proof: { kind: "dialog", screen: answerScreen } }) : tmux.pasteBuffer(text),
|
|
9125
9494
|
sleep: ms => new Promise(resolve => setTimeout(resolve, ms)),
|
|
9126
9495
|
now: () => performance.now(),
|
|
9127
9496
|
}, pane => {
|
|
@@ -9392,12 +9761,19 @@ export class Daemon extends EventEmitter {
|
|
|
9392
9761
|
if (!check || !this.tmux)
|
|
9393
9762
|
return !check;
|
|
9394
9763
|
try {
|
|
9395
|
-
const
|
|
9396
|
-
|
|
9764
|
+
const inputActive = this.nativePaneLifecycle
|
|
9765
|
+
? this.nativePaneLifecycle.current() && this.nativePaneLifecycle.mcpProof() === "alive"
|
|
9766
|
+
: await this.tmux.getPaneInputMode?.() === "raw";
|
|
9767
|
+
// ConPTY has no POSIX termios mode. Its closed launch plus current helper handshake is the input barrier;
|
|
9768
|
+
// the same strict composer detector below is still required. Never grant native unknown-layout fallback.
|
|
9769
|
+
if (!inputActive) {
|
|
9397
9770
|
this.resetFooterFallback();
|
|
9398
9771
|
return false;
|
|
9399
9772
|
}
|
|
9400
|
-
|
|
9773
|
+
const pane = await this.tmux.capturePane();
|
|
9774
|
+
if (this.nativePaneLifecycle && (!this.nativePaneLifecycle.current() || this.nativePaneLifecycle.mcpProof() !== "alive"))
|
|
9775
|
+
return false;
|
|
9776
|
+
return this.deliveryInputReadyPane(pane);
|
|
9401
9777
|
}
|
|
9402
9778
|
catch {
|
|
9403
9779
|
this.resetFooterFallback();
|
|
@@ -10171,34 +10547,86 @@ export class Daemon extends EventEmitter {
|
|
|
10171
10547
|
// tmux object and window — so the spawn generation and launch fence are part of the fence too: an Enter meant for
|
|
10172
10548
|
// the CLI this paste went to is never sent to its successor.
|
|
10173
10549
|
const tmux = this.tmux;
|
|
10550
|
+
const backend = this.backend;
|
|
10551
|
+
const native = !!this.nativePaneLifecycle;
|
|
10174
10552
|
const generation = this.spawnGeneration;
|
|
10175
10553
|
const fence = this.launchFenceEpoch;
|
|
10554
|
+
const windowId = native ? tmux?.getWindowId() : undefined;
|
|
10555
|
+
// M-2290 (#2985 review, Fable): the mode wait can last up to 10 minutes, and a respawn or relaunch reuses the same
|
|
10556
|
+
// tmux object and window — so the spawn generation and launch fence are part of every pane's fence: an Enter meant
|
|
10557
|
+
// for the CLI this paste went to is never sent to its successor. A native Windows pane keeps #2958's full fence too
|
|
10558
|
+
// (its launch can be replaced under the same handle).
|
|
10176
10559
|
const current = () => this.tmux === tmux && this.spawnGeneration === generation && this.launchFenceEpoch === fence
|
|
10177
|
-
&& !this.deliveryWritesStopping && (!stillCurrent || stillCurrent())
|
|
10560
|
+
&& !this.deliveryWritesStopping && (!stillCurrent || stillCurrent())
|
|
10561
|
+
&& (!native || (!!windowId && !!backend && this.backend === backend && tmux.getWindowId() === windowId));
|
|
10178
10562
|
if (!current())
|
|
10179
10563
|
return false;
|
|
10180
10564
|
// The pasted text may still be in the box: the caller keeps it uncertain (no false failure, no second paste).
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10565
|
+
// S-35: say which check withheld Enter.
|
|
10566
|
+
const hold = (reason) => {
|
|
10567
|
+
onInputHeld?.(reason);
|
|
10568
|
+
if (reason === "output_changed" && current() && !this.nativeDeliveryHold())
|
|
10569
|
+
this.nativeEnterHold = {
|
|
10570
|
+
key: `${this.bootId}:${generation}:${fence}`, since: Date.now(), spawn: generation, fence,
|
|
10571
|
+
};
|
|
10572
|
+
if (reason === "pane-in-mode")
|
|
10573
|
+
this.logger.warn({ phase, reason }, "The pane stayed in a tmux mode; Enter withheld");
|
|
10574
|
+
else
|
|
10575
|
+
this.logger.warn({ ...tmux?.getLastInputDiagnostic?.(), phase, reason, retryCount: positiveRefusals }, "Native delivery Enter withheld by its safety check");
|
|
10184
10576
|
return false;
|
|
10185
10577
|
};
|
|
10186
10578
|
// M-2267 (#2971): a pane in a tmux mode (a person left it in copy-mode) would take this Enter. Wait for the mode to
|
|
10187
10579
|
// end, then look once more within the same deadline — a pane flickering back into a mode is waited out again, never
|
|
10188
|
-
// past the bound.
|
|
10189
|
-
//
|
|
10580
|
+
// past the bound.
|
|
10581
|
+
// Native delivery follows main #2990: only this backend's recognised runtime dialog vetoes Enter.
|
|
10582
|
+
// The fresh capture still binds the native host output sequence; ownership and positive-ACK-only retries remain.
|
|
10190
10583
|
const modeDeadline = performance.now() + PANE_MODE_ENTER_WAIT_MS;
|
|
10584
|
+
let pane;
|
|
10585
|
+
let positiveRefusals = 0, enterMarked = false, positiveRetryDeadline = Infinity, linuxDialogRead = false;
|
|
10191
10586
|
for (;;) {
|
|
10192
|
-
const mode = await this.waitWhilePaneInMode(phase, current, modeDeadline);
|
|
10587
|
+
const mode = await this.waitWhilePaneInMode(phase, current, Math.min(modeDeadline, positiveRetryDeadline));
|
|
10193
10588
|
if (mode === "stale")
|
|
10194
10589
|
return false;
|
|
10195
10590
|
if (mode === "held")
|
|
10196
|
-
return hold();
|
|
10591
|
+
return hold("pane-in-mode");
|
|
10592
|
+
if (native) {
|
|
10593
|
+
// S-35: a native pane's capture refuses while output is still arriving ("Pane changed during capture; observe it
|
|
10594
|
+
// again"). Right after a turn the CLI repaints for a moment; one refused read left the message unsent for ever.
|
|
10595
|
+
// Read again a few times — reading types nothing — and still hold if it never settles.
|
|
10596
|
+
let captured;
|
|
10597
|
+
for (let attempt = 0; captured === undefined; attempt++) {
|
|
10598
|
+
try {
|
|
10599
|
+
captured = await tmux.capturePane();
|
|
10600
|
+
}
|
|
10601
|
+
catch {
|
|
10602
|
+
if (!current())
|
|
10603
|
+
return false;
|
|
10604
|
+
if (attempt >= 4)
|
|
10605
|
+
return hold("capture_failed");
|
|
10606
|
+
await new Promise(done => setTimeout(done, 150 * (attempt + 1)));
|
|
10607
|
+
if (!current())
|
|
10608
|
+
return false;
|
|
10609
|
+
}
|
|
10610
|
+
}
|
|
10611
|
+
const screen = captured;
|
|
10612
|
+
pane = screen;
|
|
10613
|
+
if (!current())
|
|
10614
|
+
return false;
|
|
10615
|
+
try {
|
|
10616
|
+
if (backend?.getRuntimeDialogs?.().some(dialog => Daemon.dialogMatches(dialog, screen)))
|
|
10617
|
+
return hold("dialog");
|
|
10618
|
+
}
|
|
10619
|
+
catch {
|
|
10620
|
+
return hold("check_failed");
|
|
10621
|
+
}
|
|
10622
|
+
if (!current())
|
|
10623
|
+
return false;
|
|
10624
|
+
}
|
|
10197
10625
|
if (await this.paneInTmuxMode(phase)) {
|
|
10198
10626
|
if (!current())
|
|
10199
10627
|
return false;
|
|
10200
10628
|
if (performance.now() >= modeDeadline)
|
|
10201
|
-
return hold();
|
|
10629
|
+
return hold("pane-in-mode");
|
|
10202
10630
|
await new Promise(r => setTimeout(r, PANE_MODE_POLL_MS));
|
|
10203
10631
|
if (!current())
|
|
10204
10632
|
return false;
|
|
@@ -10206,54 +10634,143 @@ export class Daemon extends EventEmitter {
|
|
|
10206
10634
|
}
|
|
10207
10635
|
if (!current())
|
|
10208
10636
|
return false;
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10637
|
+
// M-2290 (the simple half of the #2957 redesign, leader xmsg-1793712561468; main): on a Linux pane, a dialog the
|
|
10638
|
+
// backend RECOGNISES (runtimeDialogs: a permission card, the dangerous-command card, …) that painted between the
|
|
10639
|
+
// paste and this Enter would take the key as its answer. Read the pane once more: such a dialog withholds the
|
|
10640
|
+
// Enter (the caller keeps the delivery uncertain → Needs-you; the dialog scanner parks it for a person). Nothing
|
|
10641
|
+
// else is judged — an unknown or unreadable screen sends: #2958's composer proof (decision f57474aa) is NOT back.
|
|
10642
|
+
// Only a caller that can hold asks (onInputHeld); a native pane read its own screen above, every round.
|
|
10643
|
+
if (!native && onInputHeld && !linuxDialogRead) {
|
|
10644
|
+
linuxDialogRead = true;
|
|
10645
|
+
let finalPane = null;
|
|
10646
|
+
try {
|
|
10647
|
+
finalPane = await tmux.capturePane();
|
|
10648
|
+
}
|
|
10649
|
+
catch {
|
|
10650
|
+
finalPane = null;
|
|
10651
|
+
}
|
|
10652
|
+
if (!current())
|
|
10653
|
+
return false;
|
|
10654
|
+
let dialog;
|
|
10655
|
+
try {
|
|
10656
|
+
dialog = finalPane === null ? undefined : (this.backend?.getRuntimeDialogs?.() ?? []).find(d => Daemon.dialogMatches(d, finalPane))?.description;
|
|
10657
|
+
}
|
|
10658
|
+
catch {
|
|
10659
|
+
dialog = undefined;
|
|
10660
|
+
}
|
|
10661
|
+
if (dialog !== undefined) {
|
|
10662
|
+
onInputHeld("dialog");
|
|
10663
|
+
this.logger.warn({ phase, dialog }, "A dialog is on the pane; the delivery's Enter is withheld (it would answer it)");
|
|
10664
|
+
return false;
|
|
10665
|
+
}
|
|
10666
|
+
}
|
|
10667
|
+
if (positiveRefusals && performance.now() >= positiveRetryDeadline)
|
|
10668
|
+
return hold("output_changed");
|
|
10669
|
+
// W1: persist the "Enter may have happened" boundary before tmux receives
|
|
10670
|
+
// the key. A crash after this commit is never auto-replayed without a
|
|
10671
|
+
// positive transcript marker, even if the stale pane still shows composer.
|
|
10672
|
+
if (!enterMarked && durableAttempt && !this.deliveryOutbox?.markEnterStarted(durableAttempt.deliveryId, this.bootId, durableAttempt.attemptNo)) {
|
|
10673
|
+
this.logger.error({ phase, deliveryId: durableAttempt.deliveryId }, "Could not commit durable Enter write-ahead fence");
|
|
10674
|
+
return false;
|
|
10675
|
+
}
|
|
10676
|
+
enterMarked = true;
|
|
10677
|
+
const sent = await (native && pane !== undefined ? tmux.sendSpecialKey("Enter", undefined, { kind: "delivery", screen: pane, retryCount: positiveRefusals }) : tmux.sendSpecialKey("Enter"));
|
|
10678
|
+
// A busy renderer can change seq after our capture. Only a positive zero-input ACK admits a NEW proof/key;
|
|
10679
|
+
// An Enter retry never re-pastes, retries an uncertain write, reuses stale proof or re-commits the durable boundary.
|
|
10680
|
+
if (!sent && native && tmux.lastInputWasNotSent?.() === true
|
|
10681
|
+
&& tmux.getLastSendSpecialKeyError() === "Pane changed after observation; input was not sent"
|
|
10682
|
+
&& current()) {
|
|
10683
|
+
if (!positiveRefusals)
|
|
10684
|
+
positiveRetryDeadline = Math.min(modeDeadline, performance.now() + 2000);
|
|
10685
|
+
if (positiveRefusals >= 4 || performance.now() >= positiveRetryDeadline)
|
|
10686
|
+
return hold("output_changed");
|
|
10687
|
+
positiveRefusals++;
|
|
10688
|
+
await new Promise(done => setTimeout(done, 100));
|
|
10689
|
+
if (!current())
|
|
10690
|
+
return false;
|
|
10691
|
+
if (performance.now() >= positiveRetryDeadline)
|
|
10692
|
+
return hold("output_changed");
|
|
10693
|
+
continue;
|
|
10694
|
+
}
|
|
10695
|
+
if (!sent) {
|
|
10696
|
+
const details = { phase, tmuxError: this.tmux.getLastSendSpecialKeyError() ?? "unknown tmux send-keys failure" };
|
|
10697
|
+
if (native)
|
|
10698
|
+
this.logger.warn({ ...tmux?.getLastInputDiagnostic?.(), ...details, retryCount: positiveRefusals }, "Native delivery Enter gave up");
|
|
10699
|
+
else
|
|
10700
|
+
this.logger.error(details, "tmux send-keys Enter failed during message delivery");
|
|
10701
|
+
}
|
|
10702
|
+
if (sent && native && current())
|
|
10703
|
+
this.nativeEnterHold = null;
|
|
10704
|
+
return sent;
|
|
10705
|
+
}
|
|
10706
|
+
}
|
|
10707
|
+
/** A pre-existing native busy-paste race: retry bytes only after an exact, owned zero-input acknowledgement. */
|
|
10708
|
+
async sendDeliveryPaste(text, stillCurrent) {
|
|
10709
|
+
const pane = this.tmux, native = this.nativePaneLifecycle;
|
|
10710
|
+
if (!native)
|
|
10711
|
+
return pane.pasteBuffer(text);
|
|
10712
|
+
const backend = this.backend, generation = this.spawnGeneration, fence = this.launchFenceEpoch, windowId = pane.getWindowId();
|
|
10713
|
+
const current = () => !!windowId && this.tmux === pane && this.nativePaneLifecycle === native && this.backend === backend
|
|
10714
|
+
&& this.spawnGeneration === generation && this.launchFenceEpoch === fence && pane.getWindowId() === windowId
|
|
10715
|
+
&& !this.deliveryWritesStopping && (!stillCurrent || stillCurrent());
|
|
10716
|
+
let retryCount = 0;
|
|
10717
|
+
const hold = (reason) => {
|
|
10718
|
+
if (current() && !this.nativeDeliveryHold())
|
|
10719
|
+
this.nativeEnterHold = { key: `${this.bootId}:${generation}:${fence}`, since: Date.now(), spawn: generation, fence };
|
|
10720
|
+
this.logger.warn({ ...pane.getLastInputDiagnostic?.(), reason, retryCount }, "Native delivery paste held by its safety check");
|
|
10721
|
+
return false;
|
|
10722
|
+
};
|
|
10723
|
+
const deadline = performance.now() + 2000;
|
|
10724
|
+
for (let attempt = 0; attempt < 5; attempt++) {
|
|
10725
|
+
retryCount = attempt;
|
|
10726
|
+
if (!current())
|
|
10727
|
+
return false;
|
|
10728
|
+
if (performance.now() >= deadline)
|
|
10729
|
+
return hold("output_changed");
|
|
10730
|
+
let screen;
|
|
10731
|
+
for (let read = 0; read < 5 && screen === undefined; read++) {
|
|
10732
|
+
try {
|
|
10733
|
+
screen = await pane.capturePane();
|
|
10734
|
+
}
|
|
10735
|
+
catch { /* Reads do not construct an input operation. */ }
|
|
10736
|
+
if (!current())
|
|
10737
|
+
return false;
|
|
10738
|
+
if (performance.now() >= deadline)
|
|
10739
|
+
return hold("capture_failed");
|
|
10740
|
+
if (screen === undefined && read < 4)
|
|
10741
|
+
await new Promise(done => setTimeout(done, 100));
|
|
10742
|
+
}
|
|
10743
|
+
if (screen === undefined)
|
|
10744
|
+
return hold("capture_failed");
|
|
10221
10745
|
try {
|
|
10222
|
-
|
|
10746
|
+
if (backend?.getRuntimeDialogs?.().some(dialog => Daemon.dialogMatches(dialog, screen)))
|
|
10747
|
+
return hold("dialog");
|
|
10223
10748
|
}
|
|
10224
10749
|
catch {
|
|
10225
|
-
|
|
10750
|
+
return hold("check_failed");
|
|
10226
10751
|
}
|
|
10227
10752
|
if (!current())
|
|
10228
10753
|
return false;
|
|
10229
|
-
|
|
10754
|
+
if (performance.now() >= deadline)
|
|
10755
|
+
return hold("output_changed");
|
|
10756
|
+
let sent;
|
|
10230
10757
|
try {
|
|
10231
|
-
|
|
10758
|
+
sent = await pane.pasteBuffer(text, { guard: current, proof: { kind: "composer", screen, retryCount: attempt } });
|
|
10232
10759
|
}
|
|
10233
10760
|
catch {
|
|
10234
|
-
|
|
10761
|
+
return hold("unconfirmed");
|
|
10235
10762
|
}
|
|
10236
|
-
if (
|
|
10237
|
-
|
|
10238
|
-
|
|
10763
|
+
if (sent)
|
|
10764
|
+
return true; // Exactly one successful paste ends the loop, before any Enter.
|
|
10765
|
+
if (!current())
|
|
10239
10766
|
return false;
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
if (durableAttempt && !this.deliveryOutbox?.markEnterStarted(durableAttempt.deliveryId, this.bootId, durableAttempt.attemptNo)) {
|
|
10246
|
-
this.logger.error({ phase, deliveryId: durableAttempt.deliveryId }, "Could not commit durable Enter write-ahead fence");
|
|
10247
|
-
return false;
|
|
10767
|
+
if (pane.lastInputWasNotSent?.() !== true || pane.getLastPasteError?.() !== "Pane changed after observation; input was not sent")
|
|
10768
|
+
return hold("unconfirmed");
|
|
10769
|
+
if (attempt >= 4 || performance.now() >= deadline)
|
|
10770
|
+
return hold("output_changed");
|
|
10771
|
+
await new Promise(done => setTimeout(done, 100));
|
|
10248
10772
|
}
|
|
10249
|
-
|
|
10250
|
-
if (!sent) {
|
|
10251
|
-
this.logger.error({
|
|
10252
|
-
phase,
|
|
10253
|
-
tmuxError: this.tmux.getLastSendSpecialKeyError() ?? "unknown tmux send-keys failure",
|
|
10254
|
-
}, "tmux send-keys Enter failed during message delivery");
|
|
10255
|
-
}
|
|
10256
|
-
return sent;
|
|
10773
|
+
return hold("output_changed");
|
|
10257
10774
|
}
|
|
10258
10775
|
async writeMessageToPane(formatted, initialWindowId, handingOffToNativeQueue, status, submissionId,
|
|
10259
10776
|
// Last and defaulted so the positional callers that ignore the outcome stay
|
|
@@ -10291,6 +10808,9 @@ export class Daemon extends EventEmitter {
|
|
|
10291
10808
|
const tmuxAtWrite = this.tmux;
|
|
10292
10809
|
const steerCurrent = () => (!stillCurrent || stillCurrent()) && !this.deliveryWritesStopping
|
|
10293
10810
|
&& this.tmux === tmuxAtWrite && this.spawnGeneration === spawnAtWrite;
|
|
10811
|
+
// Alpha (S-36, Prism #2989 P2): a NATIVE pane keeps #2958's pre-paste owner fence through the initial Enter and every
|
|
10812
|
+
// retry Enter (a pane replaced while the paste awaits never takes this delivery's Enter); a tmux pane follows main.
|
|
10813
|
+
const nativeOwner = this.nativePaneLifecycle ? steerCurrent : undefined;
|
|
10294
10814
|
// Bug A: paste with backoff. Transient failures are usually a stale window id
|
|
10295
10815
|
// after a crash/respawn — recover by name and retry (max 3 attempts, 2s apart).
|
|
10296
10816
|
const maxAttempts = 3;
|
|
@@ -10339,6 +10859,7 @@ export class Daemon extends EventEmitter {
|
|
|
10339
10859
|
// first side effect; a crash during those waits remains safely replayable.
|
|
10340
10860
|
if (durableAttempt && !beginChecked) {
|
|
10341
10861
|
beginChecked = true;
|
|
10862
|
+
const proofOwner = this.interactionOwner();
|
|
10342
10863
|
const attemptEvidence = {
|
|
10343
10864
|
...await this.durableAttemptEvidence(windowId, handingOffToNativeQueue, steer, durableAttempt.submissionMode === "raw_paste"),
|
|
10344
10865
|
// #856: what arrived vs what is about to be written, taken at the
|
|
@@ -10346,7 +10867,15 @@ export class Daemon extends EventEmitter {
|
|
|
10346
10867
|
pastedContentSha256: durableAttempt.contentSha256 ?? null,
|
|
10347
10868
|
pastedBytesSha256: deliveryContentDigest(formatted),
|
|
10348
10869
|
};
|
|
10349
|
-
|
|
10870
|
+
const codexCheckpoint = !this.nativePaneLifecycle && rawPaste && attemptEvidence.backend === "codex" && windowId
|
|
10871
|
+
? await this.bindCodexRawPaste(windowId, steerCurrent) : null;
|
|
10872
|
+
if (codexCheckpoint) {
|
|
10873
|
+
attemptEvidence.transcriptPath = codexCheckpoint.path;
|
|
10874
|
+
attemptEvidence.transcriptOffset = codexCheckpoint.offset;
|
|
10875
|
+
attemptEvidence.transcriptSessionId = codexCheckpoint.sessionId;
|
|
10876
|
+
}
|
|
10877
|
+
if ((stillCurrent && !stillCurrent()) || (!this.nativePaneLifecycle && rawPaste && attemptEvidence.backend === "codex"
|
|
10878
|
+
&& (!sameInteractionOwner(proofOwner, this.interactionOwner()) || !steerCurrent()))) {
|
|
10350
10879
|
verdict.fenced = true;
|
|
10351
10880
|
return false;
|
|
10352
10881
|
}
|
|
@@ -10358,17 +10887,18 @@ export class Daemon extends EventEmitter {
|
|
|
10358
10887
|
}
|
|
10359
10888
|
verdict.durableBeginCommitted = true;
|
|
10360
10889
|
verdict.submissionMode = attemptEvidence.submissionMode;
|
|
10361
|
-
if (attemptEvidence.transcriptPath && attemptEvidence.transcriptOffset !== null) {
|
|
10362
|
-
verdict.transcriptCheckpoint = {
|
|
10890
|
+
if (attemptEvidence.runtimeTranscript || attemptEvidence.transcriptPath && attemptEvidence.transcriptOffset !== null) {
|
|
10891
|
+
verdict.transcriptCheckpoint = attemptEvidence.runtimeTranscript ? { backend: attemptEvidence.backend, runtime: attemptEvidence.runtimeTranscript } : {
|
|
10363
10892
|
backend: attemptEvidence.backend,
|
|
10364
10893
|
path: attemptEvidence.transcriptPath,
|
|
10365
10894
|
offset: attemptEvidence.transcriptOffset,
|
|
10895
|
+
...(codexCheckpoint ? { ownedCodex: codexCheckpoint.ownedCodex } : {}),
|
|
10366
10896
|
};
|
|
10367
10897
|
// From here every proof of this write may also ask the CLI's transcript (the pane can lose the echo to the
|
|
10368
10898
|
// reply, or still be painting the paste) — this delivery's exact marker only, or a raw paste's exact text (#1647).
|
|
10369
10899
|
// A raw paste's text only where the transcript is this instance's alone (RAW_TEXT_TRANSCRIPT_BACKENDS).
|
|
10370
10900
|
if (["claude-code", "codex"].includes(attemptEvidence.backend)
|
|
10371
|
-
&& (!rawPaste || RAW_TEXT_TRANSCRIPT_BACKENDS.includes(attemptEvidence.backend))) {
|
|
10901
|
+
&& (!rawPaste || codexCheckpoint || RAW_TEXT_TRANSCRIPT_BACKENDS.includes(attemptEvidence.backend))) {
|
|
10372
10902
|
signature.transcript = this.transcriptProofFor(verdict.transcriptCheckpoint, rawPaste ? { rawText: formatted } : durableAttempt.deliveryId, spawnAtWrite, stillCurrent, kind => { verdict.transcriptProof = kind; });
|
|
10373
10903
|
}
|
|
10374
10904
|
}
|
|
@@ -10435,7 +10965,15 @@ export class Daemon extends EventEmitter {
|
|
|
10435
10965
|
}
|
|
10436
10966
|
const pasteGeneration = this.spawnGeneration;
|
|
10437
10967
|
beforePaste?.();
|
|
10438
|
-
const pasted = await this.
|
|
10968
|
+
const pasted = await this.sendDeliveryPaste(formatted, nativeOwner);
|
|
10969
|
+
if (!pasted && this.nativePaneLifecycle) {
|
|
10970
|
+
// The native write attempt is retained as uncertain, including exhausted positive refusals. Never route an
|
|
10971
|
+
// unknown/partial write through legacy window recovery or abort it back to an automatically replayable row.
|
|
10972
|
+
verdict.paneWriteStarted = true;
|
|
10973
|
+
verdict.phase = "paste";
|
|
10974
|
+
verdict.proof = "native-paste-held";
|
|
10975
|
+
return false;
|
|
10976
|
+
}
|
|
10439
10977
|
if (pasted)
|
|
10440
10978
|
this.rememberPaste(formatted, pasteGeneration);
|
|
10441
10979
|
if (!pasted) {
|
|
@@ -10522,15 +11060,18 @@ export class Daemon extends EventEmitter {
|
|
|
10522
11060
|
const enterMono = performance.now();
|
|
10523
11061
|
const steerEnterCurrent = () => steerCurrent() && performance.now() <= steerEnterDeadline;
|
|
10524
11062
|
let inputHeld = null;
|
|
10525
|
-
if (!(await this.sendDeliveryEnter("initial-submit", steerComposerProof ? steerEnterCurrent : undefined, durableAttempt, (why) => { inputHeld = why; }))) {
|
|
11063
|
+
if (!(await this.sendDeliveryEnter("initial-submit", steerComposerProof || nativeOwner ? steerEnterCurrent : undefined, durableAttempt, (why) => { inputHeld = why; }))) {
|
|
10526
11064
|
if (inputHeld) {
|
|
10527
11065
|
// #2971: held in a tmux mode past the bound; M-2290: a recognised dialog on the pane. The paste may still be in
|
|
10528
11066
|
// the CLI: keep it uncertain (Needs-you), never re-paste, never answer the dialog.
|
|
10529
11067
|
verdict.phase = "submit-enter";
|
|
10530
|
-
|
|
11068
|
+
// The merge of #2957/M-2290 (main) and the alpha's native holds: a tmux mode, a recognised dialog on a Linux pane,
|
|
11069
|
+
// and each native safety check say which.
|
|
11070
|
+
verdict.proof = inputHeld === "pane-in-mode" ? "pane-in-mode-held" : nativeOwner ? `native-input-${inputHeld}`
|
|
11071
|
+
: inputHeld === "dialog" ? "dialog-on-pane" : `input-held-${inputHeld}`;
|
|
10531
11072
|
return false;
|
|
10532
11073
|
}
|
|
10533
|
-
if (steerComposerProof && !steerCurrent()) {
|
|
11074
|
+
if ((steerComposerProof || nativeOwner) && !steerCurrent()) {
|
|
10534
11075
|
verdict.phase = "submit-enter";
|
|
10535
11076
|
verdict.proof = "fenced-before-enter";
|
|
10536
11077
|
return false;
|
|
@@ -10560,7 +11101,7 @@ export class Daemon extends EventEmitter {
|
|
|
10560
11101
|
if (!rawPaste && !steerComposerProof && this.backend?.requiresDeliveryEnterRetry?.() === true) {
|
|
10561
11102
|
await new Promise(r => setTimeout(r, 1_000));
|
|
10562
11103
|
const retryAt = Date.now();
|
|
10563
|
-
if (await this.sendDeliveryEnter("queue-less-defensive-retry")) {
|
|
11104
|
+
if (await this.sendDeliveryEnter("queue-less-defensive-retry", nativeOwner)) {
|
|
10564
11105
|
enterAt = retryAt;
|
|
10565
11106
|
enterRetry = true;
|
|
10566
11107
|
this.logger.debug("Sent defensive Enter retry (queue-less TUI can swallow the first)");
|
|
@@ -10698,7 +11239,7 @@ export class Daemon extends EventEmitter {
|
|
|
10698
11239
|
// again. The prompt is back now, so an Enter can land.
|
|
10699
11240
|
this.logger.warn("Message still in the input row after idle — submitting the existing text instead of pasting it again");
|
|
10700
11241
|
const strandedAt = Date.now();
|
|
10701
|
-
if (!(await this.sendDeliveryEnter("native-queue-stranded-submit"))) {
|
|
11242
|
+
if (!(await this.sendDeliveryEnter("native-queue-stranded-submit", nativeOwner))) {
|
|
10702
11243
|
return this.failDelivery(verdict, status, "native-queue-submit", "tmux-send-keys-failed");
|
|
10703
11244
|
}
|
|
10704
11245
|
// The recovery Enter can be accepted before Codex paints its new
|
|
@@ -10751,7 +11292,7 @@ export class Daemon extends EventEmitter {
|
|
|
10751
11292
|
}
|
|
10752
11293
|
await new Promise(r => setTimeout(r, NORMAL_ENTER_SETTLE_MS));
|
|
10753
11294
|
const retryAt = Date.now();
|
|
10754
|
-
if (!(await this.sendDeliveryEnter("native-queue-idle-redelivery"))) {
|
|
11295
|
+
if (!(await this.sendDeliveryEnter("native-queue-idle-redelivery", nativeOwner))) {
|
|
10755
11296
|
return this.failDelivery(verdict, status, "native-queue-redelivery", "tmux-send-keys-failed");
|
|
10756
11297
|
}
|
|
10757
11298
|
if (windowId && this.controlClient) {
|
|
@@ -10803,7 +11344,7 @@ export class Daemon extends EventEmitter {
|
|
|
10803
11344
|
this.logger.warn("Message not submitted after Enter — waiting for the prompt, then re-sending Enter once");
|
|
10804
11345
|
const promptBack = await this.waitForPaneReadyForDelivery(windowId, STRANDED_RETRY_READY_WAIT_MS);
|
|
10805
11346
|
const retryAt = Date.now();
|
|
10806
|
-
if (promptBack && !(await this.sendDeliveryEnter("stranded-text-retry"))) {
|
|
11347
|
+
if (promptBack && !(await this.sendDeliveryEnter("stranded-text-retry", nativeOwner))) {
|
|
10807
11348
|
return this.failDelivery(verdict, status, "stranded-text-retry", "tmux-send-keys-failed");
|
|
10808
11349
|
}
|
|
10809
11350
|
submitted = promptBack && await this.confirmSubmittedAfterEnter(windowId, retryAt, formatted);
|
|
@@ -10891,7 +11432,7 @@ export class Daemon extends EventEmitter {
|
|
|
10891
11432
|
}
|
|
10892
11433
|
// No control client to observe output: fall back to the legacy double-Enter.
|
|
10893
11434
|
await new Promise(r => setTimeout(r, 1000));
|
|
10894
|
-
await this.sendDeliveryEnter("unobserved-defensive-retry");
|
|
11435
|
+
await this.sendDeliveryEnter("unobserved-defensive-retry", nativeOwner);
|
|
10895
11436
|
if (status)
|
|
10896
11437
|
this.emit("message_confirmed", status); // ✅ (best-effort)
|
|
10897
11438
|
}
|
|
@@ -11098,6 +11639,10 @@ export class Daemon extends EventEmitter {
|
|
|
11098
11639
|
pane = await this.tmux.capturePane();
|
|
11099
11640
|
}
|
|
11100
11641
|
catch { /* the transcript may still say */ }
|
|
11642
|
+
if (owned && !owned())
|
|
11643
|
+
return "unproven";
|
|
11644
|
+
if (signature.transcript?.validate && !await signature.transcript.validate())
|
|
11645
|
+
return "unproven";
|
|
11101
11646
|
if (owned && !owned())
|
|
11102
11647
|
return "unproven";
|
|
11103
11648
|
const onPane = pane === null ? "unproven" : this.judgeSubmission(pane, signature, baseline);
|
|
@@ -11105,6 +11650,8 @@ export class Daemon extends EventEmitter {
|
|
|
11105
11650
|
return onPane;
|
|
11106
11651
|
const t = signature.transcript;
|
|
11107
11652
|
const found = await this.transcriptLook(signature);
|
|
11653
|
+
if (t?.validate && !await t.validate())
|
|
11654
|
+
return "unproven";
|
|
11108
11655
|
// One synchronous stretch from here: the fence is asked after the last await, and only then is the hit kept and the
|
|
11109
11656
|
// spawn's guard retired — a stop or respawn that lands between the look and this line leaves both untouched.
|
|
11110
11657
|
if (!found || !t?.current() || (owned && !owned()))
|
|
@@ -11136,14 +11683,74 @@ export class Daemon extends EventEmitter {
|
|
|
11136
11683
|
* and the caller's own fence — so a look that lands after any of them is never used (#1380 review).
|
|
11137
11684
|
*/
|
|
11138
11685
|
transcriptProofFor(checkpoint, needle, spawnAtWrite, stillCurrent, onProof) {
|
|
11686
|
+
if (this.nativePaneLifecycle && !checkpoint.runtime)
|
|
11687
|
+
throw Error("Native proof cannot read a coordinator-local transcript path");
|
|
11139
11688
|
const launchAtWrite = this.launchFenceEpoch;
|
|
11140
11689
|
return {
|
|
11141
|
-
reader:
|
|
11690
|
+
reader: checkpoint.runtime ? this.nativeTranscriptReader(checkpoint.runtime, needle)
|
|
11691
|
+
: new TranscriptDeltaReader(checkpoint.path, checkpoint.offset, checkpoint.backend, needle, checkpoint.ownedCodex?.identity, checkpoint.ownedCodex?.retire),
|
|
11142
11692
|
current: () => !this.deliveryWritesStopping && this.spawnGeneration === spawnAtWrite
|
|
11143
|
-
&& this.launchFenceEpoch === launchAtWrite && (stillCurrent?.() ?? true)
|
|
11693
|
+
&& this.launchFenceEpoch === launchAtWrite && (stillCurrent?.() ?? true)
|
|
11694
|
+
&& (!checkpoint.runtime || this.nativePaneLifecycle?.current(checkpoint.runtime) === true)
|
|
11695
|
+
&& (checkpoint.ownedCodex?.current() ?? true),
|
|
11696
|
+
validate: checkpoint.ownedCodex?.validate,
|
|
11144
11697
|
onProof,
|
|
11145
11698
|
};
|
|
11146
11699
|
}
|
|
11700
|
+
nativeTranscriptReader(reference, needle) {
|
|
11701
|
+
if (!this.nativePaneLifecycle || !this.nativePaneLifecycle.current(reference))
|
|
11702
|
+
throw Error("Native delivery transcript owner is unavailable");
|
|
11703
|
+
return this.nativePaneLifecycle.proofReader(reference, needle);
|
|
11704
|
+
}
|
|
11705
|
+
/** A footer observation authorizes only this pre-write delta under this exact pane/launch. No persisted lease. */
|
|
11706
|
+
async bindCodexRawPaste(windowId, stillCurrent) {
|
|
11707
|
+
const tmux = this.tmux, backend = this.backend, owner = this.interactionOwner();
|
|
11708
|
+
if (this.nativePaneLifecycle || !tmux || !backend?.readRawPasteSession)
|
|
11709
|
+
return null;
|
|
11710
|
+
let retired = false;
|
|
11711
|
+
const current = () => {
|
|
11712
|
+
if (!retired && stillCurrent() && this.tmux === tmux && this.backend === backend && tmux.getWindowId() === windowId
|
|
11713
|
+
&& sameInteractionOwner(owner, this.interactionOwner()) && !this.deliveryWritesStopping)
|
|
11714
|
+
return true;
|
|
11715
|
+
retired = true;
|
|
11716
|
+
return false;
|
|
11717
|
+
};
|
|
11718
|
+
const observe = async () => {
|
|
11719
|
+
if (!current() || await tmux.paneInMode?.() === true || !current())
|
|
11720
|
+
return null;
|
|
11721
|
+
const pane = await tmux.capturePane().catch(() => null);
|
|
11722
|
+
if (!current() || pane === null || this.ownSwitch
|
|
11723
|
+
|| this.deliveryBlockingDialogs().some(dialog => Daemon.dialogMatches(dialog, pane)))
|
|
11724
|
+
return null;
|
|
11725
|
+
return backend.readRawPasteSession(pane);
|
|
11726
|
+
};
|
|
11727
|
+
const before = await observe();
|
|
11728
|
+
if (!before || !current())
|
|
11729
|
+
return null;
|
|
11730
|
+
const file = await checkpointCodexPane(before.sessionsDir, before.sessionId, this.config.working_directory || process.cwd());
|
|
11731
|
+
if (!file || !current())
|
|
11732
|
+
return null;
|
|
11733
|
+
const validate = async () => {
|
|
11734
|
+
if (!current())
|
|
11735
|
+
return false;
|
|
11736
|
+
const first = await observe();
|
|
11737
|
+
if (!first || first.sessionId !== before.sessionId || first.sessionsDir !== before.sessionsDir || !current()
|
|
11738
|
+
|| !await file.validateFile() || !current()) {
|
|
11739
|
+
retired = true;
|
|
11740
|
+
return false;
|
|
11741
|
+
}
|
|
11742
|
+
const last = await observe();
|
|
11743
|
+
if (!last || last.sessionId !== before.sessionId || last.sessionsDir !== before.sessionsDir || !current()) {
|
|
11744
|
+
retired = true;
|
|
11745
|
+
return false;
|
|
11746
|
+
}
|
|
11747
|
+
return true;
|
|
11748
|
+
};
|
|
11749
|
+
if (!await validate())
|
|
11750
|
+
return null;
|
|
11751
|
+
return { backend: "codex", path: file.path, offset: file.offset, sessionId: file.sessionId,
|
|
11752
|
+
ownedCodex: { identity: file.identity, current, validate, retire: () => { retired = true; } } };
|
|
11753
|
+
}
|
|
11147
11754
|
/** The CLI this daemon drives, for log lines shared by every backend ("claude-code", "codex", …). */
|
|
11148
11755
|
cliLabel() {
|
|
11149
11756
|
return this.config.backend ?? this.backend?.binaryName ?? "CLI";
|
|
@@ -11393,7 +12000,14 @@ export class Daemon extends EventEmitter {
|
|
|
11393
12000
|
* (the retries included). Without a guard it is exactly the old unconditional path.
|
|
11394
12001
|
*/
|
|
11395
12002
|
async submitSystemPaste(text, label, guard, admission) {
|
|
11396
|
-
|
|
12003
|
+
// Alpha (S-36, Prism #2989 P2): a NATIVE pane's system paste keeps the pane owner from before its first await
|
|
12004
|
+
// (#2958's fence, reverted on main for tmux panes) — a pane replaced while the paste awaits never takes its Enter.
|
|
12005
|
+
const native = !!this.nativePaneLifecycle;
|
|
12006
|
+
const ownerTmux = this.tmux, ownerGeneration = this.spawnGeneration, ownerFence = this.launchFenceEpoch;
|
|
12007
|
+
const ownerWindow = native ? ownerTmux?.getWindowId() : undefined;
|
|
12008
|
+
const owner = () => !native || (!!ownerTmux && !!ownerWindow && this.tmux === ownerTmux && ownerTmux.getWindowId() === ownerWindow
|
|
12009
|
+
&& this.spawnGeneration === ownerGeneration && this.launchFenceEpoch === ownerFence && !this.deliveryWritesStopping);
|
|
12010
|
+
const current = guard || admission || native ? () => { admission?.(); return owner() && (guard?.current() ?? true); } : undefined;
|
|
11397
12011
|
if (current && !current())
|
|
11398
12012
|
return false;
|
|
11399
12013
|
if (!this.tmux)
|
|
@@ -11411,6 +12025,10 @@ export class Daemon extends EventEmitter {
|
|
|
11411
12025
|
if (!current() || !guard.accept(pane))
|
|
11412
12026
|
return false;
|
|
11413
12027
|
baseline = this.paneEvidence(pane, signature);
|
|
12028
|
+
if (native && this.backend?.binaryName === "codex") {
|
|
12029
|
+
const counts = this.paneQuotaPatterns().map(ep => ({ key: Daemon.errorPatternKey(ep), count: Daemon.countOccurrences(ep.pattern, pane) }));
|
|
12030
|
+
baseline.quotaHistory = { spawn: ownerGeneration, fence: ownerFence, attempt: this.launchAttempt, tmux: ownerTmux, window: ownerWindow, counts, marker: signature.value, occurrences: baseline.payload };
|
|
12031
|
+
}
|
|
11414
12032
|
}
|
|
11415
12033
|
else {
|
|
11416
12034
|
baseline = await this.capturePaneEvidence(signature);
|
|
@@ -11514,15 +12132,15 @@ export class Daemon extends EventEmitter {
|
|
|
11514
12132
|
&& sameInteractionOwner(recoveryOwner, this.interactionOwner());
|
|
11515
12133
|
const previousWindowId = this.tmux?.getWindowId();
|
|
11516
12134
|
try {
|
|
11517
|
-
const windows = await
|
|
12135
|
+
const windows = await this.paneHost.listWindows(this.tmuxSessionName, this.controlClient);
|
|
11518
12136
|
if (!recoveryCurrent() || this.tmux !== previousTmux)
|
|
11519
12137
|
return undefined;
|
|
11520
12138
|
const match = windows.find(w => w.name === this.name);
|
|
11521
12139
|
if (!match)
|
|
11522
12140
|
return undefined;
|
|
11523
|
-
this.tmux =
|
|
12141
|
+
this.tmux = this.paneHost.bind(this.tmuxSessionName, match.id, resolveTmuxLogicalSize(this.config.terminal), this.controlClient);
|
|
11524
12142
|
const recoveredTmux = this.tmux;
|
|
11525
|
-
|
|
12143
|
+
this.writeWindowId(match.id);
|
|
11526
12144
|
// The window we were talking to is gone; leaving it registered means the
|
|
11527
12145
|
// control client re-resolves a dead id — one bounded read — on every
|
|
11528
12146
|
// reconnect, for the life of the fleet process.
|
|
@@ -11583,6 +12201,8 @@ export class Daemon extends EventEmitter {
|
|
|
11583
12201
|
return false;
|
|
11584
12202
|
}
|
|
11585
12203
|
getWindowId() {
|
|
12204
|
+
if (this.nativePaneLifecycle)
|
|
12205
|
+
return this.nativePaneLifecycle.current() ? this.tmux?.getWindowId() : undefined;
|
|
11586
12206
|
try {
|
|
11587
12207
|
return readFileSync(join(this.instanceDir, "window-id"), "utf-8").trim() || undefined;
|
|
11588
12208
|
}
|
|
@@ -11614,7 +12234,55 @@ export class Daemon extends EventEmitter {
|
|
|
11614
12234
|
* Handle a tool call from the MCP server (forwarded by Claude).
|
|
11615
12235
|
* Routes to the channel adapter via MessageBus.
|
|
11616
12236
|
*/
|
|
11617
|
-
|
|
12237
|
+
/** Internal native-MCP admission. The pane/machine/launch owner supplies a current, dynamically checked tool lease. */
|
|
12238
|
+
handlePaneToolCall(input, lease) {
|
|
12239
|
+
const refusal = nativePaneToolRefusal(input.tool, input.args);
|
|
12240
|
+
if (refusal)
|
|
12241
|
+
return Promise.resolve({ result: null, error: refusal });
|
|
12242
|
+
if (!lease.current() || !lease.allowed(input.tool, input.args) || this.deliveryWritesStopping)
|
|
12243
|
+
return Promise.resolve({ result: null, error: "Pane tool permission is no longer current" });
|
|
12244
|
+
const fence = this.launchFenceEpoch;
|
|
12245
|
+
const current = () => lease.current() && lease.allowed(input.tool, input.args) && !this.deliveryWritesStopping && fence === this.launchFenceEpoch;
|
|
12246
|
+
return new Promise(resolve => {
|
|
12247
|
+
let settled = false;
|
|
12248
|
+
const finish = (value) => { if (settled)
|
|
12249
|
+
return; settled = true; clearTimeout(timer); resolve(value); };
|
|
12250
|
+
const timer = setTimeout(() => finish({ result: null, error: "Pane tool result is unconfirmed; inspect its operation before retrying" }), daemonBudgetMs(input.tool) + 1000);
|
|
12251
|
+
timer.unref?.();
|
|
12252
|
+
try {
|
|
12253
|
+
this.handleToolCall({ ...input, requestId: ++this.fleetRequestSeq }, undefined, {
|
|
12254
|
+
current,
|
|
12255
|
+
dispatch: (tool, args, respond) => {
|
|
12256
|
+
if (!current()) {
|
|
12257
|
+
respond(null, "Pane tool permission was revoked before dispatch");
|
|
12258
|
+
return true;
|
|
12259
|
+
}
|
|
12260
|
+
const dispatched = lease.dispatch?.(tool, args);
|
|
12261
|
+
if (!dispatched)
|
|
12262
|
+
return false;
|
|
12263
|
+
void dispatched.then(result => respond(result), () => respond(null, "Pane tool operation was refused"));
|
|
12264
|
+
return true;
|
|
12265
|
+
},
|
|
12266
|
+
// Resolving the relay is not proof that its HTTP response reached the provider. No response-written receipt yet.
|
|
12267
|
+
send: value => {
|
|
12268
|
+
finish({ result: value.result, ...(typeof value.error === "string" ? { error: value.error } : {}),
|
|
12269
|
+
...(typeof value.errorCode === "string" || typeof value.errorCode === "number" ? { errorCode: value.errorCode } : {}) });
|
|
12270
|
+
return false;
|
|
12271
|
+
},
|
|
12272
|
+
});
|
|
12273
|
+
}
|
|
12274
|
+
catch {
|
|
12275
|
+
finish({ result: null, error: "Pane tool operation failed" });
|
|
12276
|
+
}
|
|
12277
|
+
});
|
|
12278
|
+
}
|
|
12279
|
+
/** Only the authority lease with a verified helper stdout ACK calls this internal barrier. */
|
|
12280
|
+
paneToolResponseWritten(operationId, current) {
|
|
12281
|
+
if (!current() || this.deliveryWritesStopping || !/^[a-f0-9-]{36}$/i.test(operationId))
|
|
12282
|
+
return;
|
|
12283
|
+
this.emit("mcp_tool_response_written", { operationId, daemonBootId: this.bootId });
|
|
12284
|
+
}
|
|
12285
|
+
handleToolCall(msg, socket, peer) {
|
|
11618
12286
|
const tool = msg.tool;
|
|
11619
12287
|
const args = (msg.args ?? {});
|
|
11620
12288
|
const requestId = msg.requestId;
|
|
@@ -11622,20 +12290,20 @@ export class Daemon extends EventEmitter {
|
|
|
11622
12290
|
this.logger.debug({ tool, requestId }, "Tool call from MCP server");
|
|
11623
12291
|
// A tool call can only come from a live MCP server of ours — proof of life
|
|
11624
12292
|
// that outranks whatever the pid slot says.
|
|
11625
|
-
if (this.socketSessionNames.get(socket) === this.name) {
|
|
11626
|
-
this.noteMcpProofOfLife("tool_call", this.socketPids.get(socket));
|
|
12293
|
+
if (peer?.current() || socket && this.socketSessionNames.get(socket) === this.name) {
|
|
12294
|
+
this.noteMcpProofOfLife("tool_call", socket ? this.socketPids.get(socket) : undefined);
|
|
11627
12295
|
}
|
|
11628
12296
|
// A tool invocation is not delivery evidence. Capture which obligation it
|
|
11629
12297
|
// belongs to now, then settle it only after the adapter/fleet responds.
|
|
11630
12298
|
// Explicitly mapped sibling sessions must not satisfy this instance's turn;
|
|
11631
12299
|
// an unmapped socket is retained for legacy/tests where mcp_ready was not
|
|
11632
12300
|
// observed before the first tool call.
|
|
11633
|
-
const sourceSession = this.socketSessionNames.get(socket);
|
|
12301
|
+
const sourceSession = peer ? this.name : socket ? this.socketSessionNames.get(socket) : undefined;
|
|
11634
12302
|
const replyAttempt = TURN_OUTBOUND_TOOLS.has(tool) && (!sourceSession || sourceSession === this.name)
|
|
11635
12303
|
? this.turnReplyGuard.beginToolAttempt(tool === "reply", TURN_COMPLETION_TOOLS.has(tool))
|
|
11636
12304
|
: null;
|
|
11637
12305
|
// For now, log and respond. Full adapter routing will be wired in fleet manager.
|
|
11638
|
-
const respond = (result, error) => {
|
|
12306
|
+
const respond = (result, error, errorCode) => {
|
|
11639
12307
|
// A message that verifiably went out stands down the dead-MCP proxy reply
|
|
11640
12308
|
// for this turn: the agent proved it can still speak for itself.
|
|
11641
12309
|
if (!error && result != null && TURN_OUTBOUND_TOOLS.has(tool)) {
|
|
@@ -11676,14 +12344,21 @@ export class Daemon extends EventEmitter {
|
|
|
11676
12344
|
// failed" and report unknown immediately rather than starting recovery.
|
|
11677
12345
|
this.turnReplyGuard.settleToolAttempt(replyAttempt, false);
|
|
11678
12346
|
}
|
|
11679
|
-
const
|
|
12347
|
+
const packet = { requestId, result, error, operationId, ...(errorCode !== undefined ? { errorCode } : {}) };
|
|
12348
|
+
const sent = peer ? peer.current() && peer.send(packet) : socket ? this.ipcServer?.send(socket, packet) ?? false : false;
|
|
11680
12349
|
if (!sent) {
|
|
11681
|
-
|
|
12350
|
+
if (peer)
|
|
12351
|
+
this.logger.debug({ tool, requestId }, "Native MCP result awaits transport-written confirmation");
|
|
12352
|
+
else
|
|
12353
|
+
this.logger.warn({ tool, requestId }, "Tool result could not be returned — originating MCP socket is closed");
|
|
11682
12354
|
}
|
|
11683
12355
|
else if (operationId) {
|
|
11684
12356
|
this.emit("mcp_tool_response_written", { operationId, daemonBootId: this.bootId });
|
|
11685
12357
|
}
|
|
11686
12358
|
};
|
|
12359
|
+
// Native Fleet/task operations carry their lease to the existing dispatcher mutation admission points.
|
|
12360
|
+
if (peer?.dispatch?.(tool, args, respond))
|
|
12361
|
+
return;
|
|
11687
12362
|
// Repo checkout — handled locally in daemon (no fleet-manager)
|
|
11688
12363
|
if (tool === "checkout_repo") {
|
|
11689
12364
|
this.handleCheckoutRepo(args, respond);
|
|
@@ -11712,7 +12387,7 @@ export class Daemon extends EventEmitter {
|
|
|
11712
12387
|
clearTimeout(timeout);
|
|
11713
12388
|
respond(respMsg.result, respMsg.error);
|
|
11714
12389
|
});
|
|
11715
|
-
this.
|
|
12390
|
+
this.broadcastFleetMessage({
|
|
11716
12391
|
type,
|
|
11717
12392
|
payload: args,
|
|
11718
12393
|
meta: { instance_name: this.name },
|
|
@@ -11738,7 +12413,7 @@ export class Daemon extends EventEmitter {
|
|
|
11738
12413
|
clearTimeout(timeout);
|
|
11739
12414
|
resolve({ result: respMsg.result, error: respMsg.error });
|
|
11740
12415
|
});
|
|
11741
|
-
this.
|
|
12416
|
+
this.broadcastFleetMessage({ type: WEB_THEME_IPC[tool], payload, meta: { instance_name: this.name }, fleetRequestId: fleetReqId });
|
|
11742
12417
|
});
|
|
11743
12418
|
void (async () => {
|
|
11744
12419
|
if (tool === "preview_web_appearance") {
|
|
@@ -11815,7 +12490,7 @@ export class Daemon extends EventEmitter {
|
|
|
11815
12490
|
clearTimeout(timeout);
|
|
11816
12491
|
respond(respMsg.result, respMsg.error);
|
|
11817
12492
|
});
|
|
11818
|
-
this.
|
|
12493
|
+
this.broadcastFleetMessage({
|
|
11819
12494
|
type: "fleet_task",
|
|
11820
12495
|
payload: args,
|
|
11821
12496
|
meta: { instance_name: this.name },
|
|
@@ -11838,7 +12513,7 @@ export class Daemon extends EventEmitter {
|
|
|
11838
12513
|
clearTimeout(timeout);
|
|
11839
12514
|
respond(respMsg.result, respMsg.error);
|
|
11840
12515
|
});
|
|
11841
|
-
this.
|
|
12516
|
+
this.broadcastFleetMessage({
|
|
11842
12517
|
type: typeMap[tool],
|
|
11843
12518
|
payload: args,
|
|
11844
12519
|
meta: { instance_name: this.name, working_directory: this.config.working_directory },
|
|
@@ -11865,7 +12540,7 @@ export class Daemon extends EventEmitter {
|
|
|
11865
12540
|
clearTimeout(timeout);
|
|
11866
12541
|
respond(respMsg.result, respMsg.error);
|
|
11867
12542
|
});
|
|
11868
|
-
this.
|
|
12543
|
+
this.broadcastFleetMessage({
|
|
11869
12544
|
type: typeMap[tool],
|
|
11870
12545
|
payload: args,
|
|
11871
12546
|
meta: {
|
|
@@ -11880,11 +12555,11 @@ export class Daemon extends EventEmitter {
|
|
|
11880
12555
|
}
|
|
11881
12556
|
if (CROSS_INSTANCE_TOOLS.has(tool)) {
|
|
11882
12557
|
// Route to fleet manager via IPC (topic mode only)
|
|
11883
|
-
if (this.topicMode && this.
|
|
12558
|
+
if (this.topicMode && this.fleetTransportAvailable()) {
|
|
11884
12559
|
// Use fleetRequestId (not requestId) to avoid MCP server resolving the
|
|
11885
12560
|
// pending tool call prematurely when it receives the broadcast.
|
|
11886
12561
|
const fleetReqId = `xmsg_${++this.fleetRequestSeq}_${requestId}`;
|
|
11887
|
-
const senderSessionName =
|
|
12562
|
+
const senderSessionName = sourceSession;
|
|
11888
12563
|
// Shared table, so delete_instance and the deployment tools get the same
|
|
11889
12564
|
// budget here as the MCP client expects (the ad-hoc list omitted them).
|
|
11890
12565
|
const crossTimeoutMs = daemonBudgetMs(tool);
|
|
@@ -11896,7 +12571,7 @@ export class Daemon extends EventEmitter {
|
|
|
11896
12571
|
clearTimeout(timeout);
|
|
11897
12572
|
respond(respMsg.result, respMsg.error);
|
|
11898
12573
|
});
|
|
11899
|
-
this.
|
|
12574
|
+
this.broadcastFleetMessage({
|
|
11900
12575
|
type: "fleet_outbound",
|
|
11901
12576
|
tool,
|
|
11902
12577
|
args,
|
|
@@ -11950,12 +12625,12 @@ export class Daemon extends EventEmitter {
|
|
|
11950
12625
|
}, daemonBudgetMs(tool));
|
|
11951
12626
|
this.pendingIpcRequests.set(outboundKey, (respMsg) => {
|
|
11952
12627
|
clearTimeout(timeout);
|
|
11953
|
-
respond(respMsg.result, respMsg.error);
|
|
12628
|
+
respond(respMsg.result, respMsg.error, respMsg.errorCode);
|
|
11954
12629
|
});
|
|
11955
12630
|
// Register the waiter before broadcasting. A fast/mock adapter can settle
|
|
11956
12631
|
// immediately; broadcasting first left a response-before-registration
|
|
11957
12632
|
// window that degraded into a timeout despite a completed POST.
|
|
11958
|
-
this.
|
|
12633
|
+
this.broadcastFleetMessage({
|
|
11959
12634
|
type: "fleet_outbound",
|
|
11960
12635
|
tool,
|
|
11961
12636
|
args,
|
|
@@ -12092,7 +12767,7 @@ export class Daemon extends EventEmitter {
|
|
|
12092
12767
|
// The daemon used to read `general_topic` alone while `isGeneralInstance`
|
|
12093
12768
|
// also accepted the name, so an instance called `general` without the flag
|
|
12094
12769
|
// was a worker here and a general everywhere else.
|
|
12095
|
-
const isGeneral = this.config.general_topic === true || this.name
|
|
12770
|
+
const isGeneral = this.config.general_topic === true || generalByName(this.name, this.config);
|
|
12096
12771
|
// No third argument for an ordinary instance: the default is `worker` now,
|
|
12097
12772
|
// and naming it here would be a second place to change it.
|
|
12098
12773
|
const toolSet = isGeneral
|
|
@@ -12256,6 +12931,7 @@ export class Daemon extends EventEmitter {
|
|
|
12256
12931
|
this.cancelCapacityNudge("the instance was stopped, paused or respawned");
|
|
12257
12932
|
this.lastErrorEpisode = null;
|
|
12258
12933
|
this.quotaReplay = null;
|
|
12934
|
+
this.nativeQuotaReplayTaken = false;
|
|
12259
12935
|
this.quotaInput = null;
|
|
12260
12936
|
this.nudgeBaselines = null;
|
|
12261
12937
|
// A relaunch settles any outstanding quit watch: the CLI came back.
|
|
@@ -12471,6 +13147,8 @@ export class Daemon extends EventEmitter {
|
|
|
12471
13147
|
catch { /* best effort */ }
|
|
12472
13148
|
}
|
|
12473
13149
|
async spawnClaudeWindow() {
|
|
13150
|
+
if (this.nativePaneLifecycle)
|
|
13151
|
+
throw Error("Native panes never enter local resume/fresh fallback");
|
|
12474
13152
|
this.assertSessionOomAdmission();
|
|
12475
13153
|
this.beginSpawn();
|
|
12476
13154
|
let resumedSuccessfully = false;
|
|
@@ -13047,6 +13725,71 @@ export class Daemon extends EventEmitter {
|
|
|
13047
13725
|
* retries. Idempotent, and fast: no graceful CLI quit, the CLI never reached
|
|
13048
13726
|
* its prompt.
|
|
13049
13727
|
*/
|
|
13728
|
+
/**
|
|
13729
|
+
* #3313 review r2: after a failed start (abortStartup), whether this start's CLI is positively gone — no window was ever
|
|
13730
|
+
* asked for, or its window (by id, or by name while its creation was pending) is positively absent after another kill.
|
|
13731
|
+
* False when that cannot be told (tmux could not list). The failed start's OWN cleanup: called once, by that start,
|
|
13732
|
+
* while the window is still its own. When it cannot tell, the window and its pane process are remembered for
|
|
13733
|
+
* `startupIncarnationEnded()`.
|
|
13734
|
+
*/
|
|
13735
|
+
async startupCliEnded() {
|
|
13736
|
+
if (this.nativePaneLifecycle)
|
|
13737
|
+
return true;
|
|
13738
|
+
if (!this.tmux)
|
|
13739
|
+
return true;
|
|
13740
|
+
const windowId = this.tmux.getWindowId();
|
|
13741
|
+
let pid = null;
|
|
13742
|
+
if (windowId?.trim()) {
|
|
13743
|
+
try {
|
|
13744
|
+
pid = await this.paneHost.getPanePid(this.tmuxSessionName, windowId);
|
|
13745
|
+
}
|
|
13746
|
+
catch {
|
|
13747
|
+
pid = null;
|
|
13748
|
+
}
|
|
13749
|
+
}
|
|
13750
|
+
let gone = false;
|
|
13751
|
+
try {
|
|
13752
|
+
gone = await this.tmux.killWindowConfirmed();
|
|
13753
|
+
}
|
|
13754
|
+
catch {
|
|
13755
|
+
gone = false;
|
|
13756
|
+
}
|
|
13757
|
+
if (!gone)
|
|
13758
|
+
this.failedStartupIncarnation = windowId?.trim() ? { windowId, pid } : { windowId: null, pid: null };
|
|
13759
|
+
return gone;
|
|
13760
|
+
}
|
|
13761
|
+
failedStartupIncarnation = null;
|
|
13762
|
+
/**
|
|
13763
|
+
* #3313 review r3: the later re-checks of a failed start whose end was not proven — READ-ONLY (never kills: a retry of
|
|
13764
|
+
* the same agent may already run in a window with the same id). Ended when that window is gone, or when it now runs a
|
|
13765
|
+
* different pane process (it was respawned: the one this start left has been replaced). False when it cannot be told.
|
|
13766
|
+
*/
|
|
13767
|
+
async startupIncarnationEnded() {
|
|
13768
|
+
const inc = this.failedStartupIncarnation;
|
|
13769
|
+
if (!inc)
|
|
13770
|
+
return true;
|
|
13771
|
+
if (!inc.windowId)
|
|
13772
|
+
return false; // its window was never learned: nothing proves it gone
|
|
13773
|
+
let windows;
|
|
13774
|
+
try {
|
|
13775
|
+
windows = await TmuxManager.listWindowsStrict(this.tmuxSessionName);
|
|
13776
|
+
}
|
|
13777
|
+
catch {
|
|
13778
|
+
return false;
|
|
13779
|
+
}
|
|
13780
|
+
if (!windows.some(w => w.id === inc.windowId))
|
|
13781
|
+
return true;
|
|
13782
|
+
if (inc.pid === null)
|
|
13783
|
+
return false;
|
|
13784
|
+
let now;
|
|
13785
|
+
try {
|
|
13786
|
+
now = await this.paneHost.getPanePid(this.tmuxSessionName, inc.windowId);
|
|
13787
|
+
}
|
|
13788
|
+
catch {
|
|
13789
|
+
return false;
|
|
13790
|
+
}
|
|
13791
|
+
return now !== null && now !== inc.pid;
|
|
13792
|
+
}
|
|
13050
13793
|
async abortStartup() {
|
|
13051
13794
|
if (this.startupAborted)
|
|
13052
13795
|
return;
|
|
@@ -13057,6 +13800,14 @@ export class Daemon extends EventEmitter {
|
|
|
13057
13800
|
await this.museUsageRelay.stop().catch(() => { });
|
|
13058
13801
|
this.museUsageRelay = null;
|
|
13059
13802
|
}
|
|
13803
|
+
if (this.nativePaneLifecycle) {
|
|
13804
|
+
await this.nativePaneLifecycle.release("detach");
|
|
13805
|
+
try {
|
|
13806
|
+
unlinkSync(join(this.instanceDir, "daemon.pid"));
|
|
13807
|
+
}
|
|
13808
|
+
catch { /* metadata only */ }
|
|
13809
|
+
return;
|
|
13810
|
+
}
|
|
13060
13811
|
try {
|
|
13061
13812
|
await this.killProcessTree("SIGTERM", "startup aborted");
|
|
13062
13813
|
}
|
|
@@ -13086,13 +13837,15 @@ export class Daemon extends EventEmitter {
|
|
|
13086
13837
|
}
|
|
13087
13838
|
/** Kill the entire process tree of the current tmux pane (CLI + MCP server). */
|
|
13088
13839
|
async killProcessTree(signal = "SIGTERM", reason = "unspecified") {
|
|
13840
|
+
if (this.nativePaneLifecycle)
|
|
13841
|
+
throw Error("Native processes can only be closed through their owned runtime pane");
|
|
13089
13842
|
const windowId = this.tmux?.getWindowId();
|
|
13090
13843
|
// Before createWindow succeeds there is no pane owned by this daemon.
|
|
13091
13844
|
// tmux interprets an empty selector as the session's active window.
|
|
13092
13845
|
if (!windowId?.trim())
|
|
13093
13846
|
return;
|
|
13094
13847
|
try {
|
|
13095
|
-
const pid = await
|
|
13848
|
+
const pid = await this.paneHost.getPanePid(this.tmuxSessionName, windowId);
|
|
13096
13849
|
if (pid) {
|
|
13097
13850
|
this.noteStopRequest(signal, reason);
|
|
13098
13851
|
process.kill(-pid, signal);
|
|
@@ -13427,7 +14180,7 @@ export class Daemon extends EventEmitter {
|
|
|
13427
14180
|
whatsNewRoles() {
|
|
13428
14181
|
if (this.runtimeIdentity?.kind === "classic")
|
|
13429
14182
|
return ["classic"];
|
|
13430
|
-
if (this.config.general_topic === true || this.name
|
|
14183
|
+
if (this.config.general_topic === true || generalByName(this.name, this.config))
|
|
13431
14184
|
return ["general"];
|
|
13432
14185
|
const set = resolveToolSet(this.config, this.name);
|
|
13433
14186
|
return set === "coordinator" || set === "full" ? ["worker", "coordinator"] : ["worker"];
|
|
@@ -13454,6 +14207,8 @@ export class Daemon extends EventEmitter {
|
|
|
13454
14207
|
}
|
|
13455
14208
|
}
|
|
13456
14209
|
async trySpawnInsideGate(reuseWindow = false, startupTimeoutMs, repairAdmission) {
|
|
14210
|
+
if (this.nativePaneLifecycle)
|
|
14211
|
+
throw Error("Native relaunch requires its owned exit and a new lifecycle reservation");
|
|
13457
14212
|
let expectedAttempt = this.launchAttempt;
|
|
13458
14213
|
const admit = () => { this.startupAdmission?.(); if (repairAdmission && !repairAdmission(expectedAttempt))
|
|
13459
14214
|
throw new Error("CLI repair superseded by another launch, pause or stop"); };
|
|
@@ -13570,8 +14325,8 @@ export class Daemon extends EventEmitter {
|
|
|
13570
14325
|
this.emit("backend_launch_warning", { name: this.name, message: note, quiet: true });
|
|
13571
14326
|
}
|
|
13572
14327
|
// Ensure tmux session exists (may have been destroyed if all windows died)
|
|
13573
|
-
await
|
|
13574
|
-
if (this.stormWindow?.observeServerAlive(await
|
|
14328
|
+
await this.paneHost.ensureSession(this.tmuxSessionName);
|
|
14329
|
+
if (this.stormWindow?.observeServerAlive(await this.paneHost.getServerPid(this.tmuxSessionName))) {
|
|
13575
14330
|
this.emit("tmux_server_crash", this.name);
|
|
13576
14331
|
}
|
|
13577
14332
|
admit();
|
|
@@ -13591,7 +14346,7 @@ export class Daemon extends EventEmitter {
|
|
|
13591
14346
|
this.controlClient?.unregisterWindow(retired);
|
|
13592
14347
|
}
|
|
13593
14348
|
admit();
|
|
13594
|
-
|
|
14349
|
+
this.writeWindowId(windowId);
|
|
13595
14350
|
// Enable remain-on-exit to capture exit codes on crash
|
|
13596
14351
|
await this.tmux.setRemainOnExit().catch(err => {
|
|
13597
14352
|
this.logger.warn({ err }, "Failed to set remain-on-exit — exit codes will not be captured");
|
|
@@ -13855,12 +14610,15 @@ export class Daemon extends EventEmitter {
|
|
|
13855
14610
|
// each have seen a respawn, pause or stop.
|
|
13856
14611
|
if (!owned())
|
|
13857
14612
|
return false;
|
|
14613
|
+
const keyScreen = this.nativePaneLifecycle ? await this.tmux.capturePane() : answeredPane;
|
|
14614
|
+
if (!owned() || !Daemon.dialogMatches(dialog, keyScreen))
|
|
14615
|
+
return false;
|
|
13858
14616
|
if (key === "Up" || key === "Down" || key === "Enter" || key === "Escape") {
|
|
13859
|
-
if (!await this.tmux.sendSpecialKey(key))
|
|
14617
|
+
if (!await (this.nativePaneLifecycle ? this.tmux.sendSpecialKey(key, undefined, { kind: "dialog", screen: keyScreen }) : this.tmux.sendSpecialKey(key)))
|
|
13860
14618
|
return false;
|
|
13861
14619
|
}
|
|
13862
14620
|
else {
|
|
13863
|
-
if (!await this.tmux.sendKeys(key))
|
|
14621
|
+
if (!await (this.nativePaneLifecycle ? this.tmux.sendKeys(key, { kind: "dialog", screen: keyScreen }) : this.tmux.sendKeys(key)))
|
|
13864
14622
|
return false;
|
|
13865
14623
|
}
|
|
13866
14624
|
await new Promise(r => setTimeout(r, 200));
|
|
@@ -13874,7 +14632,8 @@ export class Daemon extends EventEmitter {
|
|
|
13874
14632
|
// Wait for next screen to render — bounded by what is left of the budget.
|
|
13875
14633
|
const renderWait = Math.max(0, Math.min(10_000, remaining()));
|
|
13876
14634
|
if (this.controlClient) {
|
|
13877
|
-
const wid =
|
|
14635
|
+
const wid = this.nativePaneLifecycle ? ownerTmux.getWindowId()
|
|
14636
|
+
: readFileSync(join(this.instanceDir, "window-id"), "utf-8").trim();
|
|
13878
14637
|
await this.controlClient.waitForIdle(wid, renderWait);
|
|
13879
14638
|
}
|
|
13880
14639
|
else {
|
|
@@ -13917,7 +14676,9 @@ export class Daemon extends EventEmitter {
|
|
|
13917
14676
|
// scan parked on the old limit text.
|
|
13918
14677
|
const codexReady = this.backend.binaryName !== "codex"
|
|
13919
14678
|
|| this.isCodexLivePaneSnapshot(pane);
|
|
13920
|
-
|
|
14679
|
+
const nativeComposerReady = !this.nativePaneLifecycle || (this.backend?.readInputRow
|
|
14680
|
+
? this.backend.readInputRow(pane) !== null : this.backend?.isDeliveryInputReadyPane?.(pane) === true);
|
|
14681
|
+
if (readyPatternMatches && codexReady && nativeComposerReady) {
|
|
13921
14682
|
cleanReadyPolls++;
|
|
13922
14683
|
if (cleanReadyPolls >= 2 || remaining() <= 0) {
|
|
13923
14684
|
// A real ready prompt (with no fatal dialog on screen — those are
|
|
@@ -14013,6 +14774,11 @@ export class Daemon extends EventEmitter {
|
|
|
14013
14774
|
* lookup is the backend's own single-flight one: an idle observation already running it is joined,
|
|
14014
14775
|
* not repeated. Never rejects.
|
|
14015
14776
|
*/
|
|
14777
|
+
/** The window-id file and its socket tag: a window-id without it is 2.3's (tmux-legacy.ts). */
|
|
14778
|
+
writeWindowId(windowId) {
|
|
14779
|
+
writeFileSync(join(this.instanceDir, "window-id"), windowId);
|
|
14780
|
+
tagWindowId(this.instanceDir, tmuxSocket(), windowId);
|
|
14781
|
+
}
|
|
14016
14782
|
checkpointSessionId() {
|
|
14017
14783
|
const refresh = this.backend?.refreshSessionId;
|
|
14018
14784
|
if (this.skipResume || !refresh) {
|
|
@@ -14046,6 +14812,16 @@ export class Daemon extends EventEmitter {
|
|
|
14046
14812
|
void refresh.call(this.backend).then(() => this.saveSessionId(), () => { });
|
|
14047
14813
|
}
|
|
14048
14814
|
saveSessionId() {
|
|
14815
|
+
if (this.nativePaneLifecycle) {
|
|
14816
|
+
try {
|
|
14817
|
+
this.nativePaneLifecycle.checkpointSession();
|
|
14818
|
+
this.ownedWorkingSession = this.backend?.getSessionId() ?? null;
|
|
14819
|
+
}
|
|
14820
|
+
catch (err) {
|
|
14821
|
+
this.logger.warn({ err }, "Native conversation checkpoint is unconfirmed");
|
|
14822
|
+
}
|
|
14823
|
+
return;
|
|
14824
|
+
}
|
|
14049
14825
|
// When a resume failure has forced a fresh start, don't persist the stale id
|
|
14050
14826
|
// back from statusline.json — that would re-arm --continue and re-loop.
|
|
14051
14827
|
if (this.skipResume)
|