@songsid/agend 2.4.0-alpha.2 → 2.4.0-alpha.4
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/dist/account-isolation.d.ts +6 -0
- package/dist/account-isolation.js +40 -0
- package/dist/account-isolation.js.map +1 -0
- package/dist/accounts-signout.d.ts +15 -2
- package/dist/accounts-signout.js +52 -4
- package/dist/accounts-signout.js.map +1 -1
- package/dist/accounts-view.d.ts +114 -27
- package/dist/accounts-view.js +123 -60
- package/dist/accounts-view.js.map +1 -1
- package/dist/agent-cli-instructions.md +15 -9
- package/dist/agent-cli.js +47 -20
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.js +23 -8
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-list-output.d.ts +23 -0
- package/dist/agent-list-output.js +53 -0
- package/dist/agent-list-output.js.map +1 -0
- package/dist/agent-runtime-change.js +4 -4
- package/dist/agent-runtime-change.js.map +1 -1
- package/dist/agent-whats-new.js +9 -7
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/antigravity-first-run.d.ts +4 -0
- package/dist/antigravity-first-run.js +57 -0
- package/dist/antigravity-first-run.js.map +1 -0
- package/dist/antigravity-identity.d.ts +6 -0
- package/dist/antigravity-identity.js +27 -0
- package/dist/antigravity-identity.js.map +1 -0
- package/dist/antigravity-store.d.ts +22 -0
- package/dist/antigravity-store.js +79 -0
- package/dist/antigravity-store.js.map +1 -0
- package/dist/auth-api.js +11 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/agy-onboarding.d.ts +14 -0
- package/dist/backend/agy-onboarding.js +114 -0
- package/dist/backend/agy-onboarding.js.map +1 -0
- package/dist/backend/antigravity.d.ts +15 -0
- package/dist/backend/antigravity.js +44 -4
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-code.d.ts +8 -0
- package/dist/backend/claude-code.js +11 -4
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex.js +7 -3
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/credential-profile.d.ts +22 -3
- package/dist/backend/credential-profile.js +61 -9
- package/dist/backend/credential-profile.js.map +1 -1
- package/dist/backend/grok.d.ts +19 -0
- package/dist/backend/grok.js +112 -1
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/types.d.ts +10 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-availability.d.ts +6 -0
- package/dist/backend-availability.js +11 -0
- package/dist/backend-availability.js.map +1 -1
- package/dist/browser-backend-signins.d.ts +9 -1
- package/dist/browser-backend-signins.js +9 -5
- package/dist/browser-backend-signins.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-tools.js +10 -10
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/child-process.d.ts +1 -0
- package/dist/child-process.js.map +1 -1
- package/dist/claude-auth-status.d.ts +1 -0
- package/dist/claude-auth-status.js +25 -0
- package/dist/claude-auth-status.js.map +1 -1
- package/dist/claude-model-observation.d.ts +71 -0
- package/dist/claude-model-observation.js +169 -0
- package/dist/claude-model-observation.js.map +1 -0
- package/dist/cli-capability.d.ts +104 -19
- package/dist/cli-capability.js +3 -1
- package/dist/cli-capability.js.map +1 -1
- package/dist/cli-caps-module.d.ts +14 -0
- package/dist/cli-caps-module.js +8 -1
- package/dist/cli-caps-module.js.map +1 -1
- package/dist/cli-registry-check.js +114 -18
- package/dist/cli-registry-check.js.map +1 -1
- package/dist/cli-registry.d.ts +116 -12
- package/dist/cli-registry.js +16 -1
- package/dist/cli-registry.js.map +1 -1
- package/dist/cli-spec-antigravity.d.ts +53 -11
- package/dist/cli-spec-antigravity.js +44 -13
- package/dist/cli-spec-antigravity.js.map +1 -1
- package/dist/cli-spec-claude-code.d.ts +14 -1
- package/dist/cli-spec-claude-code.js +5 -4
- package/dist/cli-spec-claude-code.js.map +1 -1
- package/dist/cli-spec-codex.d.ts +8 -0
- package/dist/cli-spec-codex.js +4 -3
- package/dist/cli-spec-codex.js.map +1 -1
- package/dist/cli-spec-grok.d.ts +4 -0
- package/dist/cli-spec-grok.js +2 -1
- package/dist/cli-spec-grok.js.map +1 -1
- package/dist/cli-spec-kiro-cli.d.ts +7 -0
- package/dist/cli-spec-kiro-cli.js +3 -2
- package/dist/cli-spec-kiro-cli.js.map +1 -1
- package/dist/cli-spec-muse.d.ts +4 -0
- package/dist/cli-spec-muse.js +2 -1
- package/dist/cli-spec-muse.js.map +1 -1
- package/dist/cli-spec-opencode.d.ts +1 -0
- package/dist/cli-spec-opencode.js +1 -0
- package/dist/cli-spec-opencode.js.map +1 -1
- package/dist/credential-store-proof.d.ts +6 -0
- package/dist/credential-store-proof.js +30 -0
- package/dist/credential-store-proof.js.map +1 -0
- package/dist/cross-instance-envelope.d.ts +4 -1
- package/dist/cross-instance-envelope.js +12 -7
- package/dist/cross-instance-envelope.js.map +1 -1
- package/dist/daemon.d.ts +24 -2
- package/dist/daemon.js +265 -37
- package/dist/daemon.js.map +1 -1
- package/dist/decision-list.d.ts +5 -4
- package/dist/decision-list.js +22 -8
- package/dist/decision-list.js.map +1 -1
- package/dist/delivery-consumed-watch.d.ts +24 -0
- package/dist/delivery-consumed-watch.js +21 -10
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/delivery-outbox.d.ts +5 -1
- package/dist/delivery-outbox.js +5 -0
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-manager.d.ts +31 -2
- package/dist/fleet-manager.js +238 -56
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.js +6 -6
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +48 -7
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +23 -6
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +18 -8
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +16 -0
- package/dist/general-knowledge/skills/hub/SKILL.md +518 -0
- package/dist/general-knowledge/skills/multi-channel/SKILL.md +1 -1
- package/dist/general-knowledge/skills/scheduling/SKILL.md +1 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +199 -40
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +5 -1
- package/dist/general-role.d.ts +1 -1
- package/dist/general-role.js +1 -0
- package/dist/general-role.js.map +1 -1
- package/dist/grok-delivery-proof.d.ts +24 -0
- package/dist/grok-delivery-proof.js +124 -0
- package/dist/grok-delivery-proof.js.map +1 -0
- package/dist/hub/assistant/admin-types.d.ts +43 -0
- package/dist/hub/assistant/admin-types.js +2 -0
- package/dist/hub/assistant/admin-types.js.map +1 -0
- package/dist/hub/assistant/claude-host.d.ts +17 -0
- package/dist/hub/assistant/claude-host.js +300 -0
- package/dist/hub/assistant/claude-host.js.map +1 -0
- package/dist/hub/assistant/context.d.ts +3 -0
- package/dist/hub/assistant/context.js +7 -0
- package/dist/hub/assistant/context.js.map +1 -0
- package/dist/hub/assistant/fleet-host.d.ts +19 -0
- package/dist/hub/assistant/fleet-host.js +28 -0
- package/dist/hub/assistant/fleet-host.js.map +1 -0
- package/dist/hub/assistant/runner.d.ts +64 -0
- package/dist/hub/assistant/runner.js +239 -0
- package/dist/hub/assistant/runner.js.map +1 -0
- package/dist/hub/assistant/service.d.ts +51 -0
- package/dist/hub/assistant/service.js +143 -0
- package/dist/hub/assistant/service.js.map +1 -0
- package/dist/hub/assistant/store.d.ts +3 -0
- package/dist/hub/assistant/store.js +65 -0
- package/dist/hub/assistant/store.js.map +1 -0
- package/dist/hub/assistant/types.d.ts +60 -0
- package/dist/hub/assistant/types.js +2 -0
- package/dist/hub/assistant/types.js.map +1 -0
- package/dist/hub/buttons.d.ts +3 -0
- package/dist/hub/buttons.js +11 -11
- package/dist/hub/buttons.js.map +1 -1
- package/dist/hub/catalog.d.ts +13 -6
- package/dist/hub/catalog.js +127 -35
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.d.ts +16 -0
- package/dist/hub/client.js +52 -9
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +8 -1
- package/dist/hub/compose/member.js +238 -57
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +17 -1
- package/dist/hub/compose/server.js +76 -13
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/directory/admission.d.ts +15 -0
- package/dist/hub/directory/admission.js +56 -0
- package/dist/hub/directory/admission.js.map +1 -0
- package/dist/hub/directory/directory.d.ts +1 -1
- package/dist/hub/directory/directory.js +114 -0
- package/dist/hub/directory/directory.js.map +1 -1
- package/dist/hub/directory/types.d.ts +27 -0
- package/dist/hub/directory/types.js.map +1 -1
- package/dist/hub/enrolment-code.d.ts +1 -1
- package/dist/hub/enrolment-code.js +4 -4
- package/dist/hub/enrolment-code.js.map +1 -1
- package/dist/hub/grant-access.d.ts +11 -0
- package/dist/hub/grant-access.js +113 -0
- package/dist/hub/grant-access.js.map +1 -0
- package/dist/hub/grant-search.d.ts +9 -0
- package/dist/hub/grant-search.js +92 -0
- package/dist/hub/grant-search.js.map +1 -0
- package/dist/hub/group-policy/admin-control.d.ts +1 -0
- package/dist/hub/group-policy/admin-control.js +4 -2
- package/dist/hub/group-policy/admin-control.js.map +1 -1
- package/dist/hub/group-policy/admin-facts.d.ts +1 -0
- package/dist/hub/group-policy/admin-facts.js +2 -1
- package/dist/hub/group-policy/admin-facts.js.map +1 -1
- package/dist/hub/group-policy/admin-impact.d.ts +2 -0
- package/dist/hub/group-policy/admin-impact.js +10 -2
- package/dist/hub/group-policy/admin-impact.js.map +1 -1
- package/dist/hub/group-policy/admin-inventory.js +1 -1
- package/dist/hub/group-policy/admin-inventory.js.map +1 -1
- package/dist/hub/group-policy/admin-read.d.ts +1 -0
- package/dist/hub/group-policy/admin-read.js +3 -2
- package/dist/hub/group-policy/admin-read.js.map +1 -1
- package/dist/hub/group-policy/authorization.d.ts +5 -2
- package/dist/hub/group-policy/authorization.js +73 -32
- package/dist/hub/group-policy/authorization.js.map +1 -1
- package/dist/hub/group-policy/errors.d.ts +9 -0
- package/dist/hub/group-policy/errors.js +13 -0
- package/dist/hub/group-policy/errors.js.map +1 -0
- package/dist/hub/group-policy/impact-inventory.js +20 -4
- package/dist/hub/group-policy/impact-inventory.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +4 -5
- package/dist/hub/group-policy/resources.js +26 -19
- package/dist/hub/group-policy/resources.js.map +1 -1
- package/dist/hub/group-policy/store.d.ts +21 -12
- package/dist/hub/group-policy/store.js +99 -109
- package/dist/hub/group-policy/store.js.map +1 -1
- package/dist/hub/group-policy/welcome.js.map +1 -1
- package/dist/hub/http/compose.d.ts +1 -0
- package/dist/hub/http/compose.js +463 -20
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.d.ts +24 -5
- package/dist/hub/http/core.js +181 -54
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +26 -0
- package/dist/hub/http/schema.js +19 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/init/member-certificate.d.ts +1 -0
- package/dist/hub/init/member-certificate.js +39 -0
- package/dist/hub/init/member-certificate.js.map +1 -0
- package/dist/hub/init/plan-digest.js +1 -0
- package/dist/hub/init/plan-digest.js.map +1 -1
- package/dist/hub/invitations.d.ts +96 -0
- package/dist/hub/invitations.js +292 -0
- package/dist/hub/invitations.js.map +1 -0
- package/dist/hub/join/certificate-trust.d.ts +13 -0
- package/dist/hub/join/certificate-trust.js +41 -0
- package/dist/hub/join/certificate-trust.js.map +1 -0
- package/dist/hub/join/certificate.d.ts +11 -0
- package/dist/hub/join/certificate.js +67 -0
- package/dist/hub/join/certificate.js.map +1 -0
- package/dist/hub/join/client.d.ts +5 -0
- package/dist/hub/join/client.js +30 -3
- package/dist/hub/join/client.js.map +1 -1
- package/dist/hub/join/http.js +5 -3
- package/dist/hub/join/http.js.map +1 -1
- package/dist/hub/join/local.d.ts +37 -1
- package/dist/hub/join/local.js +142 -14
- package/dist/hub/join/local.js.map +1 -1
- package/dist/hub/join/service.d.ts +19 -0
- package/dist/hub/join/service.js +46 -35
- package/dist/hub/join/service.js.map +1 -1
- package/dist/hub/join/trust.d.ts +9 -0
- package/dist/hub/join/trust.js +35 -0
- package/dist/hub/join/trust.js.map +1 -1
- package/dist/hub/member/pairing-api.js +12 -1
- package/dist/hub/member/pairing-api.js.map +1 -1
- package/dist/hub/member/room-ask.d.ts +137 -0
- package/dist/hub/member/room-ask.js +358 -0
- package/dist/hub/member/room-ask.js.map +1 -0
- package/dist/hub/member-journal.d.ts +18 -1
- package/dist/hub/member-journal.js +76 -3
- package/dist/hub/member-journal.js.map +1 -1
- package/dist/hub/member-origin.d.ts +177 -0
- package/dist/hub/member-origin.js +314 -0
- package/dist/hub/member-origin.js.map +1 -0
- package/dist/hub/pairing-notices.d.ts +1 -0
- package/dist/hub/pairing-notices.js +2 -1
- package/dist/hub/pairing-notices.js.map +1 -1
- package/dist/hub/pairing.d.ts +11 -0
- package/dist/hub/pairing.js +69 -21
- package/dist/hub/pairing.js.map +1 -1
- package/dist/hub/policy.d.ts +1 -1
- package/dist/hub/policy.js +19 -6
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/protocol.d.ts +172 -0
- package/dist/hub/protocol.js +25 -2
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/quota.d.ts +2 -1
- package/dist/hub/quota.js +2 -2
- package/dist/hub/quota.js.map +1 -1
- package/dist/hub/roles/authority.d.ts +45 -0
- package/dist/hub/roles/authority.js +199 -0
- package/dist/hub/roles/authority.js.map +1 -0
- package/dist/hub/roles/change.d.ts +18 -0
- package/dist/hub/roles/change.js +76 -0
- package/dist/hub/roles/change.js.map +1 -0
- package/dist/hub/roles/clock.d.ts +18 -0
- package/dist/hub/roles/clock.js +58 -0
- package/dist/hub/roles/clock.js.map +1 -0
- package/dist/hub/roles/convert.d.ts +11 -0
- package/dist/hub/roles/convert.js +27 -0
- package/dist/hub/roles/convert.js.map +1 -0
- package/dist/hub/roles/cutover-inventory.d.ts +14 -0
- package/dist/hub/roles/cutover-inventory.js +42 -0
- package/dist/hub/roles/cutover-inventory.js.map +1 -0
- package/dist/hub/roles/cutover-marker.d.ts +57 -0
- package/dist/hub/roles/cutover-marker.js +26 -0
- package/dist/hub/roles/cutover-marker.js.map +1 -0
- package/dist/hub/roles/cutover.d.ts +32 -0
- package/dist/hub/roles/cutover.js +170 -0
- package/dist/hub/roles/cutover.js.map +1 -0
- package/dist/hub/roles/delegation.d.ts +24 -0
- package/dist/hub/roles/delegation.js +111 -0
- package/dist/hub/roles/delegation.js.map +1 -0
- package/dist/hub/roles/evaluate.d.ts +50 -0
- package/dist/hub/roles/evaluate.js +96 -0
- package/dist/hub/roles/evaluate.js.map +1 -0
- package/dist/hub/roles/expiry.d.ts +46 -0
- package/dist/hub/roles/expiry.js +180 -0
- package/dist/hub/roles/expiry.js.map +1 -0
- package/dist/hub/roles/mode-effects.d.ts +5 -0
- package/dist/hub/roles/mode-effects.js +21 -0
- package/dist/hub/roles/mode-effects.js.map +1 -0
- package/dist/hub/roles/model.d.ts +171 -0
- package/dist/hub/roles/model.js +79 -0
- package/dist/hub/roles/model.js.map +1 -0
- package/dist/hub/roles/read.d.ts +33 -0
- package/dist/hub/roles/read.js +55 -0
- package/dist/hub/roles/read.js.map +1 -0
- package/dist/hub/roles/writer.d.ts +80 -0
- package/dist/hub/roles/writer.js +427 -0
- package/dist/hub/roles/writer.js.map +1 -0
- package/dist/hub/rooms/admin.d.ts +45 -0
- package/dist/hub/rooms/admin.js +105 -0
- package/dist/hub/rooms/admin.js.map +1 -0
- package/dist/hub/rooms/agents.d.ts +74 -0
- package/dist/hub/rooms/agents.js +333 -0
- package/dist/hub/rooms/agents.js.map +1 -0
- package/dist/hub/rooms/assistant.d.ts +44 -0
- package/dist/hub/rooms/assistant.js +179 -0
- package/dist/hub/rooms/assistant.js.map +1 -0
- package/dist/hub/rooms/context.d.ts +10 -0
- package/dist/hub/rooms/context.js +24 -0
- package/dist/hub/rooms/context.js.map +1 -0
- package/dist/hub/rooms/direct-view.d.ts +39 -0
- package/dist/hub/rooms/direct-view.js +38 -0
- package/dist/hub/rooms/direct-view.js.map +1 -0
- package/dist/hub/rooms/directory.d.ts +35 -0
- package/dist/hub/rooms/directory.js +98 -0
- package/dist/hub/rooms/directory.js.map +1 -0
- package/dist/hub/rooms/schema.d.ts +11 -0
- package/dist/hub/rooms/schema.js +73 -0
- package/dist/hub/rooms/schema.js.map +1 -0
- package/dist/hub/rooms/service.d.ts +449 -0
- package/dist/hub/rooms/service.js +581 -0
- package/dist/hub/rooms/service.js.map +1 -0
- package/dist/hub/rooms/types.d.ts +79 -0
- package/dist/hub/rooms/types.js +2 -0
- package/dist/hub/rooms/types.js.map +1 -0
- package/dist/hub/rooms.d.ts +15 -1
- package/dist/hub/rooms.js +76 -31
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +8 -0
- package/dist/hub/runtime.js +57 -3
- package/dist/hub/runtime.js.map +1 -1
- package/dist/hub/server.d.ts +28 -0
- package/dist/hub/server.js +66 -6
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/sessions.js +6 -2
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/settings-commit.d.ts +6 -1
- package/dist/hub/settings-commit.js +15 -0
- package/dist/hub/settings-commit.js.map +1 -1
- package/dist/hub/settings-directory-decision.d.ts +2 -2
- package/dist/hub/settings-directory-decision.js +7 -5
- package/dist/hub/settings-directory-decision.js.map +1 -1
- package/dist/hub/settings-directory-proof.js +3 -1
- package/dist/hub/settings-directory-proof.js.map +1 -1
- package/dist/hub/settings-directory-recovery.d.ts +5 -0
- package/dist/hub/settings-directory-recovery.js +14 -4
- package/dist/hub/settings-directory-recovery.js.map +1 -1
- package/dist/hub/settings-member-address-control.d.ts +84 -0
- package/dist/hub/settings-member-address-control.js +150 -0
- package/dist/hub/settings-member-address-control.js.map +1 -0
- package/dist/hub/settings-member-address-decision.d.ts +229 -0
- package/dist/hub/settings-member-address-decision.js +318 -0
- package/dist/hub/settings-member-address-decision.js.map +1 -0
- package/dist/hub/settings-member-address-http.d.ts +9 -0
- package/dist/hub/settings-member-address-http.js +78 -0
- package/dist/hub/settings-member-address-http.js.map +1 -0
- package/dist/hub/settings-member-address-network.d.ts +2 -0
- package/dist/hub/settings-member-address-network.js +22 -0
- package/dist/hub/settings-member-address-network.js.map +1 -0
- package/dist/hub/settings-member-address-notices.d.ts +22 -0
- package/dist/hub/settings-member-address-notices.js +21 -0
- package/dist/hub/settings-member-address-notices.js.map +1 -0
- package/dist/hub/settings-member-address-policy.d.ts +21 -0
- package/dist/hub/settings-member-address-policy.js +34 -0
- package/dist/hub/settings-member-address-policy.js.map +1 -0
- package/dist/hub/settings-member-address.d.ts +64 -0
- package/dist/hub/settings-member-address.js +239 -0
- package/dist/hub/settings-member-address.js.map +1 -0
- package/dist/hub/sharing.d.ts +10 -0
- package/dist/hub/sharing.js +74 -0
- package/dist/hub/sharing.js.map +1 -0
- package/dist/hub/socket.d.ts +2 -0
- package/dist/hub/socket.js +2 -0
- package/dist/hub/socket.js.map +1 -1
- package/dist/hub/store.js +6 -2
- package/dist/hub/store.js.map +1 -1
- package/dist/hub/teams/types.d.ts +41 -0
- package/dist/hub/teams/types.js +2 -0
- package/dist/hub/teams/types.js.map +1 -0
- package/dist/hub/tls.d.ts +47 -0
- package/dist/hub/tls.js +23 -6
- package/dist/hub/tls.js.map +1 -1
- package/dist/hub/types.d.ts +68 -4
- package/dist/hub/validation.d.ts +1 -1
- package/dist/hub/validation.js +2 -2
- package/dist/hub/validation.js.map +1 -1
- package/dist/hub/web-origin.d.ts +93 -0
- package/dist/hub/web-origin.js +174 -0
- package/dist/hub/web-origin.js.map +1 -0
- package/dist/hub-pilot-trust-settings.d.ts +4 -0
- package/dist/hub-pilot-trust-settings.js +13 -0
- package/dist/hub-pilot-trust-settings.js.map +1 -0
- package/dist/human-delivery-receipts.d.ts +4 -2
- package/dist/human-delivery-receipts.js +20 -13
- package/dist/human-delivery-receipts.js.map +1 -1
- package/dist/inbound-presentation.d.ts +28 -0
- package/dist/inbound-presentation.js +48 -0
- package/dist/inbound-presentation.js.map +1 -0
- package/dist/instance-lifecycle.d.ts +13 -1
- package/dist/instance-lifecycle.js +33 -10
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +10 -2
- package/dist/instructions.js +32 -7
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +20 -6
- package/dist/locale.js.map +1 -1
- package/dist/log-service.d.ts +3 -0
- package/dist/log-service.js +39 -22
- package/dist/log-service.js.map +1 -1
- package/dist/log-steps.d.ts +56 -1
- package/dist/log-steps.js +318 -56
- package/dist/log-steps.js.map +1 -1
- package/dist/login-flows.d.ts +24 -2
- package/dist/login-flows.js +53 -22
- package/dist/login-flows.js.map +1 -1
- package/dist/login-url.js +3 -0
- package/dist/login-url.js.map +1 -1
- package/dist/machine-accounts.d.ts +42 -12
- package/dist/machine-accounts.js +144 -46
- package/dist/machine-accounts.js.map +1 -1
- package/dist/machine-signins.d.ts +35 -13
- package/dist/machine-signins.js +57 -27
- package/dist/machine-signins.js.map +1 -1
- package/dist/native-instance-input.js +4 -4
- package/dist/native-instance-input.js.map +1 -1
- package/dist/native-instance-registry.d.ts +3 -3
- package/dist/native-instance-registry.js +11 -10
- package/dist/native-instance-registry.js.map +1 -1
- package/dist/needs-you-hub.js +6 -2
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +5 -1
- package/dist/needs-you.js +4 -8
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +1 -1
- package/dist/office-share-page.js.map +1 -1
- package/dist/outbound-handlers.d.ts +1 -0
- package/dist/outbound-handlers.js +25 -19
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +19 -0
- package/dist/outbound-schemas.js +23 -4
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/profile-signins.d.ts +5 -0
- package/dist/profile-signins.js +1 -0
- package/dist/profile-signins.js.map +1 -1
- package/dist/queued-handoffs.d.ts +3 -1
- package/dist/queued-handoffs.js +1 -1
- package/dist/queued-handoffs.js.map +1 -1
- package/dist/runtime-build-info.js +6 -2
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli.js +33 -11
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client.d.ts +18 -2
- package/dist/runtime-client.js +84 -21
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-credential-profiles.d.ts +36 -4
- package/dist/runtime-credential-profiles.js +82 -16
- package/dist/runtime-credential-profiles.js.map +1 -1
- package/dist/runtime-profile-ownership.d.ts +2 -2
- package/dist/runtime-profile-ownership.js +3 -3
- package/dist/runtime-profile-ownership.js.map +1 -1
- package/dist/runtime-protocol.d.ts +5 -3
- package/dist/runtime-protocol.js +4 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/runtime-remote-accounts.d.ts +72 -5
- package/dist/runtime-remote-accounts.js +293 -52
- package/dist/runtime-remote-accounts.js.map +1 -1
- package/dist/runtime-remote-setup.d.ts +2 -2
- package/dist/runtime-remote-setup.js +2 -2
- package/dist/runtime-remote-setup.js.map +1 -1
- package/dist/runtime-signin-transport.d.ts +22 -4
- package/dist/runtime-signin-transport.js +50 -12
- package/dist/runtime-signin-transport.js.map +1 -1
- package/dist/runtime-signin.d.ts +42 -0
- package/dist/runtime-signin.js +105 -9
- package/dist/runtime-signin.js.map +1 -1
- package/dist/runtime-transcript-source.d.ts +2 -0
- package/dist/runtime-transcript-source.js +23 -1
- package/dist/runtime-transcript-source.js.map +1 -1
- package/dist/runtime-windows-bridge.js +6 -1
- package/dist/runtime-windows-bridge.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +1 -0
- package/dist/scheduler/task-board.js +10 -1
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/settings-api.d.ts +1 -0
- package/dist/settings-api.js +15 -8
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +3 -0
- package/dist/settings-baseline.js +2 -2
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-effect.d.ts +3 -0
- package/dist/settings-effect.js +12 -2
- package/dist/settings-effect.js.map +1 -1
- package/dist/signin-keepalive.d.ts +31 -2
- package/dist/signin-keepalive.js +123 -12
- package/dist/signin-keepalive.js.map +1 -1
- package/dist/structured-signin-transport.d.ts +2 -2
- package/dist/structured-signin-transport.js +27 -6
- package/dist/structured-signin-transport.js.map +1 -1
- package/dist/structured-signin.d.ts +16 -2
- package/dist/structured-signin.js +59 -4
- package/dist/structured-signin.js.map +1 -1
- package/dist/task-board-tool.d.ts +0 -13
- package/dist/task-board-tool.js +42 -6
- package/dist/task-board-tool.js.map +1 -1
- package/dist/tool-receipt-output.d.ts +151 -0
- package/dist/tool-receipt-output.js +50 -0
- package/dist/tool-receipt-output.js.map +1 -0
- package/dist/topic-commands.js +2 -1
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-jsonl.d.ts +24 -0
- package/dist/transcript-jsonl.js +72 -22
- package/dist/transcript-jsonl.js.map +1 -1
- package/dist/transcript-monitor.d.ts +5 -1
- package/dist/transcript-monitor.js +65 -3
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-needles.d.ts +1 -1
- package/dist/transcript-needles.js +1 -1
- package/dist/transcript-records.d.ts +2 -1
- package/dist/transcript-records.js.map +1 -1
- package/dist/transcript-sources.d.ts +4 -0
- package/dist/transcript-sources.js +2 -0
- package/dist/transcript-sources.js.map +1 -1
- package/dist/ui/accounts-keepalive.js +15 -6
- package/dist/ui/accounts-manage.js +25 -5
- package/dist/ui/accounts-view.js +28 -24
- package/dist/ui/agent-details-settings.js +10 -1
- package/dist/ui/agent-proposals.js +22 -2
- package/dist/ui/agent-runtime-settings.js +3 -3
- package/dist/ui/backend-signin.js +4 -4
- package/dist/ui/chat-activity.js +2 -2
- package/dist/ui/cli-caps.js +7 -7
- package/dist/ui/credential-profile-select.js +32 -19
- package/dist/ui/fleet-canvas.js +5 -2
- package/dist/ui/fleet-office-card.js +4 -2
- package/dist/ui/fleet-org.js +2 -0
- package/dist/ui/hub-admin-rooms-strings.js +28 -0
- package/dist/ui/hub-admin-rooms.js +77 -0
- package/dist/ui/hub-assistant-admin-strings.js +26 -0
- package/dist/ui/hub-assistant-admin.js +85 -0
- package/dist/ui/hub-chat-store.js +8 -4
- package/dist/ui/hub-client.js +224 -33
- package/dist/ui/hub-enrolment-code.js +1 -1
- package/dist/ui/hub-grant-picker.js +100 -0
- package/dist/ui/hub-group-search.js +2 -2
- package/dist/ui/hub-invitations-strings.js +30 -0
- package/dist/ui/hub-invitations.js +108 -0
- package/dist/ui/hub-join-one-strings.js +4 -2
- package/dist/ui/hub-join-steps.js +5 -2
- package/dist/ui/hub-pairing-form-strings.js +48 -0
- package/dist/ui/hub-pilot-trust-strings.js +27 -0
- package/dist/ui/hub-pilot-trust.js +41 -0
- package/dist/ui/hub-room-composer.js +113 -0
- package/dist/ui/hub-room-favorites.js +90 -0
- package/dist/ui/hub-room-list.js +152 -0
- package/dist/ui/hub-room-members-strings.js +12 -0
- package/dist/ui/hub-room-members.js +104 -0
- package/dist/ui/hub-room-new-strings.js +46 -0
- package/dist/ui/hub-room-new.js +135 -0
- package/dist/ui/hub-room-presence.js +123 -0
- package/dist/ui/hub-room-settings-strings.js +26 -0
- package/dist/ui/hub-room-settings.js +134 -0
- package/dist/ui/hub-room-strings.js +222 -0
- package/dist/ui/hub-room-thread.js +262 -0
- package/dist/ui/hub-room-unread.js +51 -0
- package/dist/ui/hub-room-working.js +29 -0
- package/dist/ui/log-row.js +14 -5
- package/dist/ui/machine-signin.js +47 -14
- package/dist/ui/panel-details.js +6 -1
- package/dist/ui/panel-fleet.js +2 -2
- package/dist/ui/panel-hub.js +145 -59
- package/dist/ui/panel-needs.js +2 -0
- package/dist/ui/panel-settings.js +2 -2
- package/dist/ui/settings-hub-company-join.js +32 -11
- package/dist/ui/settings-hub-connection.js +9 -3
- package/dist/ui/settings-hub-member-address.js +205 -0
- package/dist/ui/settings-hub-section.js +4 -0
- package/dist/ui/settings-hub-web-address.js +233 -0
- package/dist/ui/settings-hub.js +16 -4
- package/dist/ui/shared/accounts-keepalive.css +8 -0
- package/dist/ui/shared/accounts-usage-pool.css +10 -0
- package/dist/ui/shared/accounts.css +9 -0
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-needs.js +3 -0
- package/dist/ui/shared/app-shell.js +4 -1
- package/dist/ui/shared/app.css +43 -5
- package/dist/ui/shared/chat-render.js +10 -0
- package/dist/ui/shared/chat-thread.js +14 -5
- package/dist/ui/shared/hub-chat.css +17 -0
- package/dist/ui/shared/hub-grant-picker.css +4 -0
- package/dist/ui/shared/hub-rooms-u2.css +42 -0
- package/dist/ui/shared/hub-sharing.css +4 -0
- package/dist/ui/shared/model-observation.js +16 -0
- package/dist/ui/shared/stale-tab.css +6 -0
- package/dist/ui/shared/stale-tab.js +50 -0
- package/dist/ui/shared/view-strings.js +2 -2
- package/dist/ui/structured-signin.js +19 -6
- package/dist/ui/usage-pool.js +76 -0
- package/dist/usage/agent-output.d.ts +144 -0
- package/dist/usage/agent-output.js +75 -0
- package/dist/usage/agent-output.js.map +1 -0
- package/dist/usage/provider-alerts.d.ts +6 -0
- package/dist/usage/provider-alerts.js +6 -0
- package/dist/usage/provider-alerts.js.map +1 -1
- package/dist/usage/providers.d.ts +2 -2
- package/dist/usage/providers.js +60 -18
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/usage-api.d.ts +12 -0
- package/dist/usage/usage-api.js +39 -0
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/web-api.d.ts +4 -0
- package/dist/web-api.js +32 -13
- package/dist/web-api.js.map +1 -1
- package/dist/web-backend-login.d.ts +4 -1
- package/dist/web-backend-login.js.map +1 -1
- package/dist/windows-cli-providers.js +5 -1
- package/dist/windows-cli-providers.js.map +1 -1
- package/dist/windows-cli-worker.d.ts +33 -1
- package/dist/windows-cli-worker.js +150 -10
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +7 -1
- package/dist/windows-cli.js +19 -2
- package/dist/windows-cli.js.map +1 -1
- package/dist/workflow-templates/default.md +2 -2
- package/package.json +1 -1
package/dist/daemon.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { checkpointGrokDelivery } from "./grok-delivery-proof.js";
|
|
1
2
|
import { nativePaneToolRefusal } from "./native-pane-tools.js";
|
|
2
3
|
import { generalByName } from "./general-instance.js";
|
|
4
|
+
import { ClaudeModelObserver, normalizeClaudeModel } from "./claude-model-observation.js";
|
|
3
5
|
import { codexMetadataHomes } from "./backend/codex-metadata.js";
|
|
4
6
|
import { claudeMinimumError, cliVersionBelow } from "./claude-model-minimum.js";
|
|
5
7
|
import { quotaNoticeProblem } from "./quota-notice-config.js";
|
|
@@ -18,6 +20,7 @@ import { clearKiroSessionProof, proveKiroSessionId, recordKiroSessionProof } fro
|
|
|
18
20
|
import { fileURLToPath } from "node:url";
|
|
19
21
|
import { ensureInstanceDir } from "./private-dir.js";
|
|
20
22
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
23
|
+
import { HumanReminderState, humanReceiptMarker, escapeInboundField } from "./inbound-presentation.js";
|
|
21
24
|
import { EventEmitter } from "node:events";
|
|
22
25
|
import { rotateLogIfNeededAsync } from "./logger.js";
|
|
23
26
|
import { coredumpFilterLaunchPrefix } from "./coredump-filter.js";
|
|
@@ -58,7 +61,7 @@ import { writeSecretFile } from "./secret-file.js";
|
|
|
58
61
|
import { PaneWriteLock } from "./pane-write-lock.js";
|
|
59
62
|
import { answerRemoteCard } from "./remote-card-answer.js";
|
|
60
63
|
import { tmuxPaneHost } from "./tmux-pane-host.js";
|
|
61
|
-
import { buildFleetInstructions } from "./instructions.js";
|
|
64
|
+
import { buildFleetInstructions, INBOUND_HEADER_RULE } from "./instructions.js";
|
|
62
65
|
import { formatHumanInboundMessage, prepareDeliveryWire, steerInboundEnvelope, BTW_INBOUND_PREFIX, humanBodyHash, humanOwnerObjectId } from "./human-delivery-receipts.js";
|
|
63
66
|
import { formatCrossInstanceInboundMessage, renderCrossInstanceHandoffMetadata, } from "./cross-instance-envelope.js";
|
|
64
67
|
import { agendMessageInInput, bottomRowIsReady, inputAreaText, inputShowsPastedText, pastedTextSignature, pasteLeftInInput, strandedAgendMessageInInput } from "./pane-input-residue.js";
|
|
@@ -140,7 +143,7 @@ const TRANSCRIPT_RUNNING_HOLD_MAX_MS = 30 * 60_000;
|
|
|
140
143
|
* often; a long silent tool run shows its own busy row on the pane.
|
|
141
144
|
*/
|
|
142
145
|
export const TRANSCRIPT_OPEN_TURN_QUIET_MS = 15 * 60_000;
|
|
143
|
-
const REPLY_RECOVERY_PROMPT = "[system:reply-required]
|
|
146
|
+
const REPLY_RECOVERY_PROMPT = "[system:reply-required] Your last answer to the user hasn't reached them yet. Send it once now with the reply tool: what you did, the result, and the next step (the work itself is done; keep it as it is). If the message only needed an acknowledgement, an emoji react is enough; if you already replied, carry on. Answer this only through the react or reply tool.";
|
|
144
147
|
/** The outbox evidence for a delivery the CLI's transcript shows taken (#758; #1201 absorbed; #1647 a raw paste's text). */
|
|
145
148
|
function transcriptMarkerEvidence(kind, rawPaste = false) {
|
|
146
149
|
if (rawPaste)
|
|
@@ -1596,6 +1599,9 @@ export class Daemon extends EventEmitter {
|
|
|
1596
1599
|
pauseAdmissions = new Set();
|
|
1597
1600
|
// Model failover: override model on next spawn when rate-limited
|
|
1598
1601
|
modelOverride;
|
|
1602
|
+
claudeModelObserver = null;
|
|
1603
|
+
modelObservationBound = false;
|
|
1604
|
+
modelObservation() { return this.modelObservationBound ? this.claudeModelObserver?.snapshot() ?? null : null; }
|
|
1599
1605
|
// Context rotation v3: ring buffers for daemon-side snapshot
|
|
1600
1606
|
recentUserMessages = [];
|
|
1601
1607
|
recentEvents = [];
|
|
@@ -2367,25 +2373,36 @@ export class Daemon extends EventEmitter {
|
|
|
2367
2373
|
this.noteWorkActivity();
|
|
2368
2374
|
this.deliveryOutbox?.complete(delivery.deliveryId, this.bootId, delivery.attemptNo, outcome, evidence);
|
|
2369
2375
|
if (verdict && outcome !== "failed")
|
|
2370
|
-
this.startConsumedWatch(delivery, verdict);
|
|
2376
|
+
this.startConsumedWatch(delivery, verdict, outcome);
|
|
2371
2377
|
}
|
|
2372
2378
|
/**
|
|
2373
2379
|
* #1201: a steer or a native-queue hand-off was accepted into the CLI's input (or may have been) — not read. Watch
|
|
2374
2380
|
* the transcript from this attempt's checkpoint for the moment the CLI takes it, and record that on the delivery;
|
|
2375
|
-
* an `uncertain` row becomes `delivered` then.
|
|
2381
|
+
* an `uncertain` row becomes `delivered` then. An uncertain idle submission is watched the same way (M-3098). Grok
|
|
2382
|
+
* idle submissions use only their exact launch-UUID lease (#3810). The
|
|
2376
2383
|
* watch belongs to this CLI: a stop, pause or respawn ends it (restart reconciliation owns the row after that).
|
|
2377
2384
|
*/
|
|
2378
|
-
startConsumedWatch(delivery, verdict) {
|
|
2385
|
+
startConsumedWatch(delivery, verdict, outcome = "delivered") {
|
|
2379
2386
|
const checkpoint = verdict.transcriptCheckpoint;
|
|
2380
2387
|
const outbox = this.deliveryOutbox;
|
|
2381
2388
|
if (!checkpoint || !outbox?.markConsumed)
|
|
2382
2389
|
return;
|
|
2383
2390
|
if (this.nativePaneLifecycle && !checkpoint.runtime)
|
|
2384
2391
|
return;
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2392
|
+
const grok = !checkpoint.runtime && checkpoint.backend === "grok" ? checkpoint.ownedGrok : undefined;
|
|
2393
|
+
if (grok) {
|
|
2394
|
+
if (verdict.submissionMode !== "idle_submit")
|
|
2395
|
+
return;
|
|
2396
|
+
}
|
|
2397
|
+
else {
|
|
2398
|
+
// M-3098: an UNCERTAIN idle submission is watched too — the CLI's later marker is the same positive proof, and it
|
|
2399
|
+
// clears the row from Needs you. A delivered one is not: it needs no upgrade, and the fleet cap stays for real doubt.
|
|
2400
|
+
const lateIdle = verdict.submissionMode === "idle_submit" && outcome === "uncertain";
|
|
2401
|
+
if (verdict.submissionMode !== "steer" && verdict.submissionMode !== "native_queue_handoff" && !lateIdle)
|
|
2402
|
+
return;
|
|
2403
|
+
if (!["claude-code", "codex"].includes(checkpoint.backend))
|
|
2404
|
+
return;
|
|
2405
|
+
}
|
|
2389
2406
|
const spawn = this.spawnGeneration, fence = this.launchFenceEpoch, boot = this.bootId;
|
|
2390
2407
|
let location;
|
|
2391
2408
|
try {
|
|
@@ -2399,7 +2416,8 @@ export class Daemon extends EventEmitter {
|
|
|
2399
2416
|
attemptNo: delivery.attemptNo,
|
|
2400
2417
|
backend: checkpoint.backend,
|
|
2401
2418
|
...location,
|
|
2402
|
-
|
|
2419
|
+
...(grok ? { grokSessionId: grok.sessionId, readChunk: grok.readChunk } : {}),
|
|
2420
|
+
current: () => !this.deliveryWritesStopping && spawn === this.spawnGeneration && fence === this.launchFenceEpoch && (grok?.current() ?? true),
|
|
2403
2421
|
consumed: (via, evidence) => {
|
|
2404
2422
|
try {
|
|
2405
2423
|
const result = outbox.markConsumed(delivery.deliveryId, boot, delivery.attemptNo, via, evidence);
|
|
@@ -2437,7 +2455,7 @@ export class Daemon extends EventEmitter {
|
|
|
2437
2455
|
if (!["claude-code", "codex"].includes(backend))
|
|
2438
2456
|
return;
|
|
2439
2457
|
const marker = durableAttempt ? `[agend-delivery-id:${durableAttempt.deliveryId}]`
|
|
2440
|
-
: humanVerificationId ? `[agend-human-id:${humanVerificationId}]` : null;
|
|
2458
|
+
: humanVerificationId ? verdict.humanReceipt?.marker ?? `[agend-human-id:${humanVerificationId}]` : null;
|
|
2441
2459
|
if (!marker || !formatted.startsWith(marker))
|
|
2442
2460
|
return;
|
|
2443
2461
|
let found = verdict.transcriptCheckpoint ?? null;
|
|
@@ -2456,7 +2474,7 @@ export class Daemon extends EventEmitter {
|
|
|
2456
2474
|
return; // nothing could judge it later: it runs as before (✅ at the hand-off)
|
|
2457
2475
|
const entry = {
|
|
2458
2476
|
id: track.id ?? randomUUID(), marker, backend, path: checkpoint.path, offset: checkpoint.offset,
|
|
2459
|
-
content: track.content, meta: track.meta, holder: this.handoffHolder(), createdAt: Date.now(),
|
|
2477
|
+
content: track.content, meta: track.meta, wire: formatted, holder: this.handoffHolder(), createdAt: Date.now(),
|
|
2460
2478
|
redeliveries: track.redeliveries ?? 0,
|
|
2461
2479
|
};
|
|
2462
2480
|
try {
|
|
@@ -3051,6 +3069,18 @@ export class Daemon extends EventEmitter {
|
|
|
3051
3069
|
if (this.startupAborted || this.deliveryWritesStopping || !this.nativePaneLifecycle.current())
|
|
3052
3070
|
throw Error("Native launch was superseded");
|
|
3053
3071
|
}
|
|
3072
|
+
// Only a fresh owned launch has received this manager's current instruction grammar.
|
|
3073
|
+
// A resumed/reattached context learns it through the same proven legacy notice as local panes.
|
|
3074
|
+
this.startupAdmission?.();
|
|
3075
|
+
if (this.startupAborted || this.deliveryWritesStopping || !this.nativePaneLifecycle.current())
|
|
3076
|
+
throw Error("Native launch was superseded");
|
|
3077
|
+
if (acquired.disposition === "fresh")
|
|
3078
|
+
this.installCompactInboundInstructions();
|
|
3079
|
+
else {
|
|
3080
|
+
this.compactInboundInstructions = false;
|
|
3081
|
+
this.inboundCompatibilityPending = true;
|
|
3082
|
+
this.resetInboundPresentation();
|
|
3083
|
+
}
|
|
3054
3084
|
}
|
|
3055
3085
|
finally {
|
|
3056
3086
|
this.endSpawn();
|
|
@@ -4926,6 +4956,8 @@ export class Daemon extends EventEmitter {
|
|
|
4926
4956
|
return;
|
|
4927
4957
|
const outcome = follower.look(pane);
|
|
4928
4958
|
if (outcome) {
|
|
4959
|
+
if (outcome === "done")
|
|
4960
|
+
this.resetInboundPresentation();
|
|
4929
4961
|
this.broadcastFleetMessage({ type: "compact_pane_result", id, owner, outcome });
|
|
4930
4962
|
return;
|
|
4931
4963
|
}
|
|
@@ -4942,10 +4974,17 @@ export class Daemon extends EventEmitter {
|
|
|
4942
4974
|
isDeliveryEpochCurrent(epoch) {
|
|
4943
4975
|
return epoch === this.deliveryEpoch;
|
|
4944
4976
|
}
|
|
4945
|
-
queueRawPaste(rawText, deliveryEpoch = this.deliveryEpoch, confirmClear = false, durableAttempt, ownSwitch, notifyWritten) {
|
|
4977
|
+
queueRawPaste(rawText, deliveryEpoch = this.deliveryEpoch, confirmClear = false, durableAttempt, ownSwitch, notifyWritten, contextReset) {
|
|
4978
|
+
const modelObserver = this.claudeModelObserver;
|
|
4979
|
+
const modelOwner = launchIdentity(this.interactionOwner());
|
|
4980
|
+
const currentModelOwner = () => modelObserver === this.claudeModelObserver && modelOwner === launchIdentity(this.interactionOwner());
|
|
4946
4981
|
const reportSwitch = (result) => {
|
|
4947
4982
|
if (!ownSwitch)
|
|
4948
4983
|
return;
|
|
4984
|
+
if (currentModelOwner())
|
|
4985
|
+
modelObserver?.ownResult(result.outcome === "switched", ownSwitch.requested);
|
|
4986
|
+
if (result.outcome === "switched")
|
|
4987
|
+
this.resetInboundPresentation();
|
|
4949
4988
|
this.broadcastFleetMessage({ type: "runtime_switch_result", id: ownSwitch.id, ...result });
|
|
4950
4989
|
};
|
|
4951
4990
|
// Board 003648ac: the fleet follows a web /compact from just before its paste is written: the transcript's end then
|
|
@@ -5020,8 +5059,12 @@ export class Daemon extends EventEmitter {
|
|
|
5020
5059
|
preserveExactBytes: true,
|
|
5021
5060
|
// #1690: our own /model holds every other delivery from its write on — before the lock is released, so a steer
|
|
5022
5061
|
// or /btw waiting on it cannot type into the gap before claude paints "Switch model?" (default cursor: Yes).
|
|
5023
|
-
...(ownSwitch || notifyWritten ? { onPaneWritten: () => { if (
|
|
5024
|
-
this.
|
|
5062
|
+
...(ownSwitch || notifyWritten || contextReset ? { onPaneWritten: () => { if (contextReset)
|
|
5063
|
+
this.resetInboundPresentation(); if (ownSwitch) {
|
|
5064
|
+
this.ownSwitch = ownSwitch;
|
|
5065
|
+
if (currentModelOwner())
|
|
5066
|
+
modelObserver?.ownIntent(ownSwitch.requested);
|
|
5067
|
+
} tellWritten(true); } } : {}),
|
|
5025
5068
|
...(notifyWritten ? { beforePaneWrite: takeCheckpoint, ...(this.backend?.compactPaneUi?.() ? { lookBeforePaneWrite: lookBefore } : {}) } : {}),
|
|
5026
5069
|
});
|
|
5027
5070
|
tellWritten(false); // never written (once told, this says nothing)
|
|
@@ -5104,7 +5147,7 @@ export class Daemon extends EventEmitter {
|
|
|
5104
5147
|
const ownSwitch = sw && typeof sw.id === "string" && sw.kind === "model" && typeof sw.requested === "string"
|
|
5105
5148
|
? { id: sw.id, kind: "model", requested: sw.requested } : undefined;
|
|
5106
5149
|
const notifyWritten = typeof msg.notify_written === "string" && /^[0-9a-f]{16}$/.test(msg.notify_written) ? msg.notify_written : undefined;
|
|
5107
|
-
this.queueRawPaste(msg.content, this.captureDeliveryEpoch(msg.delivery_epoch), msg.confirm_clear === true, durableAttempt ? { ...durableAttempt, submissionMode: "raw_paste", silentSchedule: msg.silent_schedule === true } : undefined, ownSwitch, notifyWritten);
|
|
5150
|
+
this.queueRawPaste(msg.content, this.captureDeliveryEpoch(msg.delivery_epoch), msg.confirm_clear === true, durableAttempt ? { ...durableAttempt, submissionMode: "raw_paste", silentSchedule: msg.silent_schedule === true } : undefined, ownSwitch, notifyWritten, msg.context_reset === "clear" || msg.context_reset === "compact" ? msg.context_reset : undefined);
|
|
5108
5151
|
}
|
|
5109
5152
|
/**
|
|
5110
5153
|
* #1690 (the user's choice A): after AgEnD's own `/model <name>`, claude may ask "Switch model?" (a warm cache for
|
|
@@ -6845,7 +6888,57 @@ export class Daemon extends EventEmitter {
|
|
|
6845
6888
|
*/
|
|
6846
6889
|
buildTranscriptMonitor(source) {
|
|
6847
6890
|
this.followLog.reset();
|
|
6848
|
-
const
|
|
6891
|
+
const modelLaunch = this.backend?.modelObservationLaunch?.();
|
|
6892
|
+
const monitor = new TranscriptMonitor(this.instanceDir, this.logger, source, () => modelLaunch);
|
|
6893
|
+
let savedModel;
|
|
6894
|
+
try {
|
|
6895
|
+
const path = join(this.instanceDir, "claude-model-observation.json");
|
|
6896
|
+
if (statSync(path).size < 1_000_000)
|
|
6897
|
+
savedModel = JSON.parse(readFileSync(path, "utf-8"));
|
|
6898
|
+
}
|
|
6899
|
+
catch { /* No checkpoint. */ }
|
|
6900
|
+
const nativeModel = !!source && source === this.nativeTranscriptSource && !!source.modelObservationSession;
|
|
6901
|
+
const modelCurrent = () => !nativeModel || this.nativePaneLifecycle?.current() === true;
|
|
6902
|
+
const modelObserver = (!source || nativeModel) && this.isClaudeCodeBackend()
|
|
6903
|
+
? new ClaudeModelObserver(this.config.model, this.backend?.modelObservationLaunch?.()?.model ?? this.runtimeIdentity?.model ?? this.config.model, savedModel) : null;
|
|
6904
|
+
this.claudeModelObserver = modelObserver;
|
|
6905
|
+
this.modelObservationBound = false;
|
|
6906
|
+
const owner = launchIdentity(this.interactionOwner());
|
|
6907
|
+
let reminderSession = modelObserver?.checkpoint().sessionId ?? null;
|
|
6908
|
+
const observeReminderBoundary = (sessionId, before, after) => {
|
|
6909
|
+
const selected = (s) => normalizeClaudeModel(s.session ?? s.launch);
|
|
6910
|
+
const served = (s) => normalizeClaudeModel(s.active?.served ?? s.lastServed ?? s.session ?? s.launch);
|
|
6911
|
+
const moved = (a, b) => a !== null && b !== null && a !== b;
|
|
6912
|
+
const changed = reminderSession !== null && reminderSession !== sessionId
|
|
6913
|
+
|| moved(selected(before), selected(after)) || moved(served(before), served(after));
|
|
6914
|
+
reminderSession = sessionId;
|
|
6915
|
+
if (changed)
|
|
6916
|
+
this.resetInboundPresentation();
|
|
6917
|
+
};
|
|
6918
|
+
monitor.on("model_context", (sessionId, sessionModel) => {
|
|
6919
|
+
if (!modelObserver || this.transcriptMonitor !== monitor || owner !== launchIdentity(this.interactionOwner()) || !modelCurrent())
|
|
6920
|
+
return;
|
|
6921
|
+
const before = modelObserver.snapshot();
|
|
6922
|
+
modelObserver.bindSession(sessionId, sessionModel);
|
|
6923
|
+
this.modelObservationBound = true;
|
|
6924
|
+
observeReminderBoundary(sessionId, before, modelObserver.snapshot());
|
|
6925
|
+
});
|
|
6926
|
+
monitor.on("model_observation", (record, sessionModel, allowInference = true) => {
|
|
6927
|
+
if (!modelObserver || this.transcriptMonitor !== monitor || owner !== launchIdentity(this.interactionOwner()) || !modelCurrent())
|
|
6928
|
+
return;
|
|
6929
|
+
const before = modelObserver.snapshot();
|
|
6930
|
+
const changed = modelObserver.observe(record, sessionModel, allowInference);
|
|
6931
|
+
this.modelObservationBound = true;
|
|
6932
|
+
observeReminderBoundary(record.sessionId, before, modelObserver.snapshot());
|
|
6933
|
+
try {
|
|
6934
|
+
const path = join(this.instanceDir, "claude-model-observation.json"), temp = `${path}.tmp`;
|
|
6935
|
+
writeFileSync(temp, JSON.stringify(modelObserver.checkpoint()), { mode: 0o600 });
|
|
6936
|
+
renameSync(temp, path);
|
|
6937
|
+
}
|
|
6938
|
+
catch { /* Observation remains visible in memory. */ }
|
|
6939
|
+
if (changed)
|
|
6940
|
+
this.emit("model_observation");
|
|
6941
|
+
});
|
|
6849
6942
|
this.transcriptTurns.reset();
|
|
6850
6943
|
this.transcriptActivityAt = 0;
|
|
6851
6944
|
// Monotonic: a wall-clock correction must neither end nor extend the open-turn hold (#1641 R1).
|
|
@@ -6867,7 +6960,12 @@ export class Daemon extends EventEmitter {
|
|
|
6867
6960
|
this.transcriptTurns.reset();
|
|
6868
6961
|
this.transcriptActivityAt = 0;
|
|
6869
6962
|
this.followLog.reset();
|
|
6963
|
+
this.resetInboundPresentation();
|
|
6870
6964
|
} });
|
|
6965
|
+
monitor.on("context_reset", () => {
|
|
6966
|
+
if (this.transcriptMonitor === monitor && owner === launchIdentity(this.interactionOwner()))
|
|
6967
|
+
this.resetInboundPresentation();
|
|
6968
|
+
});
|
|
6871
6969
|
for (const event of ["tool_use", "tool_result", "assistant_text"])
|
|
6872
6970
|
monitor.on(event, touch);
|
|
6873
6971
|
return monitor;
|
|
@@ -7956,12 +8054,59 @@ export class Daemon extends EventEmitter {
|
|
|
7956
8054
|
*/
|
|
7957
8055
|
/** #1650: how this instance talks to the fleet — MCP tools, or agend-agent commands (agent_mode: cli). */
|
|
7958
8056
|
agentMode() { return this.config.agent_mode === "cli" ? "cli" : "mcp"; }
|
|
8057
|
+
humanReminders = new HumanReminderState();
|
|
8058
|
+
compactInboundInstructions = false;
|
|
8059
|
+
inboundCompatibilityPending = false;
|
|
8060
|
+
humanPreparations = new Map();
|
|
8061
|
+
humanReminderAttempts = new Map();
|
|
8062
|
+
/** Manager-owned admission capability. Never derived from a body marker. */
|
|
8063
|
+
registerHumanReceiptPreparation(receiptId, prepare, abandon) {
|
|
8064
|
+
this.humanPreparations ??= new Map();
|
|
8065
|
+
this.humanReminderAttempts ??= new Map();
|
|
8066
|
+
this.humanReminders ??= new HumanReminderState();
|
|
8067
|
+
const token = randomUUID();
|
|
8068
|
+
this.humanPreparations.set(token, { receiptId, prepare, abandon });
|
|
8069
|
+
return token;
|
|
8070
|
+
}
|
|
8071
|
+
/** Called only when this launch has installed instructions teaching both dialects. */
|
|
8072
|
+
installCompactInboundInstructions() {
|
|
8073
|
+
this.compactInboundInstructions = true;
|
|
8074
|
+
this.inboundCompatibilityPending = false;
|
|
8075
|
+
this.humanReminders.reset();
|
|
8076
|
+
}
|
|
8077
|
+
resetInboundPresentation() { (this.humanReminders ??= new HumanReminderState()).reset(); }
|
|
8078
|
+
prepareHumanReceiptWrite(meta, fallback) {
|
|
8079
|
+
if (!meta.human_prepare_token)
|
|
8080
|
+
return fallback;
|
|
8081
|
+
const preparation = this.humanPreparations.get(meta.human_prepare_token);
|
|
8082
|
+
if (!preparation || preparation.receiptId !== meta.human_receipt_id)
|
|
8083
|
+
throw new Error("Human delivery preparation is unavailable");
|
|
8084
|
+
const stamp = preparation.prepared?.stamp ?? this.humanReminders.prepare(preparation.receiptId);
|
|
8085
|
+
if (!this.humanReminders.current(stamp))
|
|
8086
|
+
throw new Error("Human delivery context changed");
|
|
8087
|
+
const dialect = this.compactInboundInstructions ? "compact" : "legacy";
|
|
8088
|
+
const prepared = preparation.prepared ?? { ...preparation.prepare({ dialect, replyHint: stamp.replyHint, escape: true,
|
|
8089
|
+
...(this.inboundCompatibilityPending ? { compatibilityNotice: "[system:headers] " + INBOUND_HEADER_RULE } : {}) }), stamp };
|
|
8090
|
+
preparation.prepared = prepared;
|
|
8091
|
+
Object.assign(meta, prepared.meta);
|
|
8092
|
+
this.humanReminderAttempts.set(preparation.receiptId, stamp);
|
|
8093
|
+
return prepared.wire;
|
|
8094
|
+
}
|
|
7959
8095
|
formatInboundMessage(content, meta) {
|
|
8096
|
+
let historicalHandoff = false;
|
|
8097
|
+
if (meta.handoff_redelivery) {
|
|
8098
|
+
const owned = this.handoffStore().list().find(row => row.id === meta.handoff_redelivery && row.holder === this.handoffHolder());
|
|
8099
|
+
if (owned?.wire)
|
|
8100
|
+
return owned.wire;
|
|
8101
|
+
// Pre-wire records retain their historical rendering only after proving the owned handoff.
|
|
8102
|
+
historicalHandoff = !!owned;
|
|
8103
|
+
}
|
|
8104
|
+
// Receiptless bot/system traffic has no final receipt preparation to replace this fallback.
|
|
7960
8105
|
if (!meta.from_instance)
|
|
7961
|
-
return formatHumanInboundMessage(content, meta, this.agentMode());
|
|
8106
|
+
return formatHumanInboundMessage(content, meta, this.agentMode(), { dialect: "legacy", escape: !historicalHandoff });
|
|
7962
8107
|
let formatted = formatCrossInstanceInboundMessage(content, meta, this.agentMode());
|
|
7963
8108
|
if (meta.reply_to_text)
|
|
7964
|
-
formatted += '\n(reply_to: "' + meta.reply_to_text + '")';
|
|
8109
|
+
formatted += '\n(reply_to: "' + escapeInboundField(meta.reply_to_text) + '")';
|
|
7965
8110
|
if (meta.delivery_id)
|
|
7966
8111
|
formatted = "[agend-delivery-id:" + meta.delivery_id + "]\n" + formatted;
|
|
7967
8112
|
return formatted;
|
|
@@ -7984,10 +8129,13 @@ export class Daemon extends EventEmitter {
|
|
|
7984
8129
|
}
|
|
7985
8130
|
}
|
|
7986
8131
|
/** The same formatter/sanitizer used by the actual write; snapshot only. */
|
|
7987
|
-
humanReceiptWire(content, meta, kind) {
|
|
8132
|
+
humanReceiptWire(content, meta, kind, presentation) {
|
|
7988
8133
|
let wire = kind === "raw_paste" ? content
|
|
7989
8134
|
: !meta.from_instance && content.startsWith("/raw ") && kind === "fleet_inbound"
|
|
7990
|
-
? content.slice(5) :
|
|
8135
|
+
? content.slice(5) : presentation && !meta.from_instance
|
|
8136
|
+
? formatHumanInboundMessage(content, meta, this.agentMode(), presentation) : this.formatInboundMessage(content, meta);
|
|
8137
|
+
if (presentation?.compatibilityNotice)
|
|
8138
|
+
wire = withWhatsNew(wire, presentation.compatibilityNotice);
|
|
7991
8139
|
if (kind === "steer")
|
|
7992
8140
|
wire = Daemon.steerEnvelope(wire);
|
|
7993
8141
|
else if (kind === "btw")
|
|
@@ -8001,8 +8149,10 @@ export class Daemon extends EventEmitter {
|
|
|
8001
8149
|
|| !daemonOwner || !meta.human_owner_key || !/^[a-f0-9]{64}$/.test(meta.human_wire_sha256 ?? "")
|
|
8002
8150
|
|| humanBodyHash(prepareDeliveryWire(wire)) !== meta.human_wire_sha256)
|
|
8003
8151
|
return undefined;
|
|
8152
|
+
const stamp = this.humanReminderAttempts?.get(id);
|
|
8004
8153
|
return { receiptId: id, verificationId: meta.verification_id, expectedWireHash: meta.human_wire_sha256,
|
|
8005
|
-
ownerKey: meta.human_owner_key, current: () => this.captureHumanReceiptOwner() === daemonOwner
|
|
8154
|
+
ownerKey: meta.human_owner_key, marker: humanReceiptMarker(meta.verification_id, meta.human_wire_dialect === "compact" ? "compact" : "legacy"), current: () => this.captureHumanReceiptOwner() === daemonOwner
|
|
8155
|
+
&& (!stamp || this.humanReminders.current(stamp)) };
|
|
8006
8156
|
}
|
|
8007
8157
|
/**
|
|
8008
8158
|
* #2770: a person's message a cancel dropped before it reached the CLI is told, not left as a silent "uncertain":
|
|
@@ -8025,8 +8175,15 @@ export class Daemon extends EventEmitter {
|
|
|
8025
8175
|
this.cancelledHumansTimer.unref?.();
|
|
8026
8176
|
}
|
|
8027
8177
|
finishHumanReceipt(meta, verdict) {
|
|
8028
|
-
if (!meta.human_receipt_id
|
|
8178
|
+
if (!meta.human_receipt_id)
|
|
8029
8179
|
return;
|
|
8180
|
+
if (!meta.human_owner_key) {
|
|
8181
|
+
const preparation = meta.human_prepare_token ? this.humanPreparations?.get(meta.human_prepare_token) : undefined;
|
|
8182
|
+
preparation?.abandon?.();
|
|
8183
|
+
if (meta.human_prepare_token)
|
|
8184
|
+
this.humanPreparations?.delete(meta.human_prepare_token);
|
|
8185
|
+
return;
|
|
8186
|
+
}
|
|
8030
8187
|
const attempt = verdict.humanReceipt;
|
|
8031
8188
|
const proof = attempt?.current() && !["unverified", "output-edge", "unverifiable"].includes(verdict.proof ?? "")
|
|
8032
8189
|
? attempt.proof ?? null : null;
|
|
@@ -8036,6 +8193,22 @@ export class Daemon extends EventEmitter {
|
|
|
8036
8193
|
catch (err) {
|
|
8037
8194
|
this.logger.error({ err }, "Could not publish human delivery evidence");
|
|
8038
8195
|
}
|
|
8196
|
+
finally {
|
|
8197
|
+
if (meta.human_prepare_token)
|
|
8198
|
+
this.humanPreparations.delete(meta.human_prepare_token);
|
|
8199
|
+
this.humanReminderAttempts.delete(meta.human_receipt_id);
|
|
8200
|
+
}
|
|
8201
|
+
}
|
|
8202
|
+
/** Synchronous acknowledgement from the manager after the existing receipt owner/authority checks. */
|
|
8203
|
+
noteHumanReceiptSettlement(id, positive) {
|
|
8204
|
+
const stamp = this.humanReminderAttempts?.get(id);
|
|
8205
|
+
if (!stamp || !positive || !this.humanReminders.current(stamp))
|
|
8206
|
+
return;
|
|
8207
|
+
this.humanReminders.settle(stamp, true);
|
|
8208
|
+
if (this.inboundCompatibilityPending) {
|
|
8209
|
+
this.compactInboundInstructions = true;
|
|
8210
|
+
this.inboundCompatibilityPending = false;
|
|
8211
|
+
}
|
|
8039
8212
|
}
|
|
8040
8213
|
/**
|
|
8041
8214
|
* Whether ONE delivery reached a verdict, carried by that delivery.
|
|
@@ -8138,7 +8311,7 @@ export class Daemon extends EventEmitter {
|
|
|
8138
8311
|
steer: true,
|
|
8139
8312
|
deliveryEpoch,
|
|
8140
8313
|
submissionId: meta.message_id,
|
|
8141
|
-
...(meta.verification_id ? { humanVerificationId: meta.verification_id } : {}),
|
|
8314
|
+
...(meta.verification_id ? { humanVerificationId: meta.verification_id, humanMeta: meta } : {}),
|
|
8142
8315
|
verdict,
|
|
8143
8316
|
durableAttempt: durableAttempt || undefined,
|
|
8144
8317
|
})) {
|
|
@@ -8216,7 +8389,7 @@ export class Daemon extends EventEmitter {
|
|
|
8216
8389
|
let delivered = false;
|
|
8217
8390
|
try {
|
|
8218
8391
|
if (await this.deliverMessage(formatted, status, { steer: true, deliveryEpoch, submissionId: meta.message_id,
|
|
8219
|
-
...(meta.verification_id ? { humanVerificationId: meta.verification_id } : {}), verdict })) {
|
|
8392
|
+
...(meta.verification_id ? { humanVerificationId: meta.verification_id, humanMeta: meta } : {}), verdict })) {
|
|
8220
8393
|
delivered = true;
|
|
8221
8394
|
this.markTurnStarted(meta, formatted, deliveryEpoch);
|
|
8222
8395
|
}
|
|
@@ -8353,7 +8526,7 @@ export class Daemon extends EventEmitter {
|
|
|
8353
8526
|
sent = await this.deliverMessage(pasted, status, {
|
|
8354
8527
|
deliveryEpoch,
|
|
8355
8528
|
submissionId: meta.message_id,
|
|
8356
|
-
...(meta.verification_id ? { humanVerificationId: meta.verification_id } : {}),
|
|
8529
|
+
...(meta.verification_id ? { humanVerificationId: meta.verification_id, humanMeta: meta } : {}),
|
|
8357
8530
|
verdict,
|
|
8358
8531
|
durableAttempt: durableAttempt || undefined,
|
|
8359
8532
|
});
|
|
@@ -8644,7 +8817,7 @@ export class Daemon extends EventEmitter {
|
|
|
8644
8817
|
return stale();
|
|
8645
8818
|
if (residue !== "clear")
|
|
8646
8819
|
return this.failDelivery(verdict, status, "input-residue", residue);
|
|
8647
|
-
const written = await this.writeMessageToPane(formatted, windowId, handingOffToNativeQueue, status, opts?.submissionId, verdict, opts?.durableAttempt, opts?.steer === true, writeCurrent, opts?.humanVerificationId, opts?.beforePaneWrite, opts?.lookBeforePaneWrite);
|
|
8820
|
+
const written = await this.writeMessageToPane(formatted, windowId, handingOffToNativeQueue, status, opts?.submissionId, verdict, opts?.durableAttempt, opts?.steer === true, writeCurrent, opts?.humanVerificationId, opts?.beforePaneWrite, opts?.lookBeforePaneWrite, opts?.humanMeta);
|
|
8648
8821
|
// #1690: still under the lock — whatever waits on it next must already see what this write started.
|
|
8649
8822
|
if (verdict.paneWriteStarted)
|
|
8650
8823
|
opts?.onPaneWritten?.();
|
|
@@ -10785,13 +10958,34 @@ export class Daemon extends EventEmitter {
|
|
|
10785
10958
|
// Board 003648ac: called synchronously right before each paste — after the last await and fence of that attempt.
|
|
10786
10959
|
beforePaste,
|
|
10787
10960
|
// Board 907c7899: awaited each attempt after its last capture, begin and fence; the fence is asked again after it.
|
|
10788
|
-
lookBeforePaste) {
|
|
10789
|
-
|
|
10961
|
+
lookBeforePaste, humanMeta) {
|
|
10962
|
+
if (humanMeta?.human_prepare_token) {
|
|
10963
|
+
if (stillCurrent && !stillCurrent())
|
|
10964
|
+
return false;
|
|
10965
|
+
formatted = this.prepareHumanReceiptWrite(humanMeta, formatted);
|
|
10966
|
+
if (verdict.trackHandoff) {
|
|
10967
|
+
const { human_prepare_token: _token, ...kept } = humanMeta;
|
|
10968
|
+
Object.assign(verdict.trackHandoff.meta, kept);
|
|
10969
|
+
delete verdict.trackHandoff.meta.human_prepare_token;
|
|
10970
|
+
}
|
|
10971
|
+
verdict.humanReceipt = this.humanReceiptAttempt(humanMeta, formatted);
|
|
10972
|
+
if (!verdict.humanReceipt?.current())
|
|
10973
|
+
return false;
|
|
10974
|
+
const writeOwner = stillCurrent;
|
|
10975
|
+
stillCurrent = () => (!writeOwner || writeOwner()) && verdict.humanReceipt.current();
|
|
10976
|
+
}
|
|
10977
|
+
const humanDialect = humanMeta?.human_wire_dialect === "compact" ? "compact" : "legacy";
|
|
10978
|
+
const signature = this.submissionSignature(formatted, humanVerificationId ?? submissionId, humanVerificationId !== undefined, humanDialect);
|
|
10979
|
+
// M-3098: the lead marker AgEnD put on this delivery, for a CLI that shows it as taken (Grok cuts its echo before
|
|
10980
|
+
// the trailing message_id). Only AgEnD's own value for this attempt, and only when the text really leads with it.
|
|
10981
|
+
const leadMarker = durableAttempt && humanVerificationId === undefined ? `[agend-delivery-id:${durableAttempt.deliveryId}]` : null;
|
|
10982
|
+
if (leadMarker && formatted.startsWith(leadMarker + "\n"))
|
|
10983
|
+
signature.takenMarker = leadMarker;
|
|
10790
10984
|
const rawPaste = durableAttempt?.submissionMode === "raw_paste";
|
|
10791
10985
|
const humanAttempt = verdict.humanReceipt;
|
|
10792
10986
|
const humanMode = rawPaste ? "raw_paste" : steer ? "steer"
|
|
10793
10987
|
: handingOffToNativeQueue ? "native_queue_handoff" : "idle_submit";
|
|
10794
|
-
if (humanAttempt && signature.unique && signature.value ===
|
|
10988
|
+
if (humanAttempt && signature.unique && signature.value === humanReceiptMarker(humanAttempt.verificationId, humanDialect).slice(1, -1)
|
|
10795
10989
|
&& humanBodyHash(formatted) === humanAttempt.expectedWireHash) {
|
|
10796
10990
|
signature.humanPositive = tag => {
|
|
10797
10991
|
if (!humanAttempt.current() || (stillCurrent && !stillCurrent()))
|
|
@@ -10872,12 +11066,21 @@ export class Daemon extends EventEmitter {
|
|
|
10872
11066
|
};
|
|
10873
11067
|
const codexCheckpoint = !this.nativePaneLifecycle && rawPaste && attemptEvidence.backend === "codex" && windowId
|
|
10874
11068
|
? await this.bindCodexRawPaste(windowId, steerCurrent) : null;
|
|
11069
|
+
const grokCheckpoint = !this.nativePaneLifecycle && !rawPaste && attemptEvidence.backend === "grok" && attemptEvidence.submissionMode === "idle_submit"
|
|
11070
|
+
? await checkpointGrokDelivery({ cwd: this.config.working_directory,
|
|
11071
|
+
sessionId: this.backend?.getDeliverySessionId?.() ?? null,
|
|
11072
|
+
current: () => steerCurrent() && sameInteractionOwner(proofOwner, this.interactionOwner()) }) : null;
|
|
11073
|
+
if (grokCheckpoint) {
|
|
11074
|
+
attemptEvidence.transcriptPath = grokCheckpoint.path;
|
|
11075
|
+
attemptEvidence.transcriptOffset = grokCheckpoint.offset;
|
|
11076
|
+
attemptEvidence.transcriptSessionId = grokCheckpoint.sessionId;
|
|
11077
|
+
}
|
|
10875
11078
|
if (codexCheckpoint) {
|
|
10876
11079
|
attemptEvidence.transcriptPath = codexCheckpoint.path;
|
|
10877
11080
|
attemptEvidence.transcriptOffset = codexCheckpoint.offset;
|
|
10878
11081
|
attemptEvidence.transcriptSessionId = codexCheckpoint.sessionId;
|
|
10879
11082
|
}
|
|
10880
|
-
if ((stillCurrent && !stillCurrent()) || (!this.nativePaneLifecycle && rawPaste && attemptEvidence.backend === "codex"
|
|
11083
|
+
if ((stillCurrent && !stillCurrent()) || ((grokCheckpoint || (!this.nativePaneLifecycle && rawPaste && attemptEvidence.backend === "codex"))
|
|
10881
11084
|
&& (!sameInteractionOwner(proofOwner, this.interactionOwner()) || !steerCurrent()))) {
|
|
10882
11085
|
verdict.fenced = true;
|
|
10883
11086
|
return false;
|
|
@@ -10896,6 +11099,7 @@ export class Daemon extends EventEmitter {
|
|
|
10896
11099
|
path: attemptEvidence.transcriptPath,
|
|
10897
11100
|
offset: attemptEvidence.transcriptOffset,
|
|
10898
11101
|
...(codexCheckpoint ? { ownedCodex: codexCheckpoint.ownedCodex } : {}),
|
|
11102
|
+
...(grokCheckpoint ? { ownedGrok: grokCheckpoint.ownedGrok } : {}),
|
|
10899
11103
|
};
|
|
10900
11104
|
// From here every proof of this write may also ask the CLI's transcript (the pane can lose the echo to the
|
|
10901
11105
|
// reply, or still be painting the paste) — this delivery's exact marker only, or a raw paste's exact text (#1647).
|
|
@@ -11055,7 +11259,7 @@ export class Daemon extends EventEmitter {
|
|
|
11055
11259
|
if (!this.steerPasteIsOurs(before.pane, formatted))
|
|
11056
11260
|
return this.failDelivery(verdict, status, "steer-paste", "box-not-this-paste");
|
|
11057
11261
|
const shown = this.backend?.readSteerComposerText?.(before.pane)?.replace(/\s+/g, " ").trim();
|
|
11058
|
-
humanComposerOwned = !!humanAttempt && shown === "[agend-human-id:" + humanAttempt.verificationId + "]";
|
|
11262
|
+
humanComposerOwned = !!humanAttempt && shown === (humanAttempt.marker ?? "[agend-human-id:" + humanAttempt.verificationId + "]");
|
|
11059
11263
|
// …and so is the Enter: the key is sent only while the reading is still within it.
|
|
11060
11264
|
steerEnterDeadline = deadline;
|
|
11061
11265
|
}
|
|
@@ -11821,6 +12025,12 @@ export class Daemon extends EventEmitter {
|
|
|
11821
12025
|
// Something sits in the box that cannot be attributed either way. Only a unique signature seen outside the box
|
|
11822
12026
|
// (below) can still prove this delivery; nothing else on screen may.
|
|
11823
12027
|
const unattributedResidue = !attributable && (after.strandedInput || after.collapsedPastes > 0);
|
|
12028
|
+
// M-3098: this delivery's own lead marker shown as TAKEN above the box — a Grok echo's first row, or its queue.
|
|
12029
|
+
// Grok cuts an echo to three rows, so the trailing message_id never shows after Enter; the marker always does.
|
|
12030
|
+
// Placed after the strand checks: text of ours still in the box (or its collapsed paste) outranks it.
|
|
12031
|
+
if (signature.takenMarker && after.inputReadable && this.backend?.readTakenMarkers?.(pane).includes(signature.takenMarker)) {
|
|
12032
|
+
return this.submittedProof();
|
|
12033
|
+
}
|
|
11824
12034
|
// 2. Positive evidence. A unique signature needs no baseline: no earlier
|
|
11825
12035
|
// message can carry this delivery's message_id, so finding it outside
|
|
11826
12036
|
// the input row is proof in itself — which also means a momentary
|
|
@@ -11974,7 +12184,7 @@ export class Daemon extends EventEmitter {
|
|
|
11974
12184
|
* paste that never landed. System pastes carry no envelope and fall back to
|
|
11975
12185
|
* the body signature, which the baseline comparison still ties to this paste.
|
|
11976
12186
|
*/
|
|
11977
|
-
submissionSignature(formatted, trustedId, verification = false) {
|
|
12187
|
+
submissionSignature(formatted, trustedId, verification = false, dialect = "legacy") {
|
|
11978
12188
|
// The id must come from the message's own metadata, never from scanning the
|
|
11979
12189
|
// rendered text: agents and users discuss message ids in the body all the
|
|
11980
12190
|
// time ("check message_id: abc"), and a body-scanned value would match an
|
|
@@ -11983,7 +12193,7 @@ export class Daemon extends EventEmitter {
|
|
|
11983
12193
|
// the handoff metadata identifies THIS delivery.
|
|
11984
12194
|
const id = trustedId?.trim();
|
|
11985
12195
|
if (id)
|
|
11986
|
-
return { value:
|
|
12196
|
+
return { value: verification ? humanReceiptMarker(id, dialect).slice(1, -1) : "message_id:" + id, unique: true };
|
|
11987
12197
|
return { value: pastedTextSignature(formatted), unique: false };
|
|
11988
12198
|
}
|
|
11989
12199
|
/**
|
|
@@ -12948,6 +13158,13 @@ export class Daemon extends EventEmitter {
|
|
|
12948
13158
|
this.clearReplyGuardConfirm();
|
|
12949
13159
|
this.sawBlockedInput = false;
|
|
12950
13160
|
if (this.spawnDepth === 0) {
|
|
13161
|
+
this.resetInboundPresentation();
|
|
13162
|
+
this.compactInboundInstructions = false;
|
|
13163
|
+
this.inboundCompatibilityPending = false;
|
|
13164
|
+
for (const p of this.humanPreparations?.values() ?? [])
|
|
13165
|
+
p.abandon?.();
|
|
13166
|
+
this.humanPreparations?.clear();
|
|
13167
|
+
this.humanReminderAttempts?.clear();
|
|
12951
13168
|
this.cliOomObservation = null;
|
|
12952
13169
|
this.spawnGeneration++;
|
|
12953
13170
|
this.interactionObservation.reset(this.interactionOwner());
|
|
@@ -14226,7 +14443,8 @@ export class Daemon extends EventEmitter {
|
|
|
14226
14443
|
this.emit("kiro_compatibility_hold", null);
|
|
14227
14444
|
}
|
|
14228
14445
|
// #1633: decided before prev-instructions is first written — its absence is what says "never launched before".
|
|
14229
|
-
|
|
14446
|
+
const freshInboundInstructions = !existsSync(join(this.instanceDir, "prev-instructions"));
|
|
14447
|
+
this.prepareWhatsNew(freshInboundInstructions);
|
|
14230
14448
|
// Record what this launch writes. #2787: a change is never announced in the pane; the CLI takes the new
|
|
14231
14449
|
// instructions whenever it next reads its own file.
|
|
14232
14450
|
if (backendConfig.instructions) {
|
|
@@ -14248,6 +14466,13 @@ export class Daemon extends EventEmitter {
|
|
|
14248
14466
|
if (launchFence !== this.launchFenceEpoch)
|
|
14249
14467
|
throw new Error("Launch cancelled: the instance was stopped or paused while the launch was being prepared");
|
|
14250
14468
|
this.backend.writeConfig(backendConfig);
|
|
14469
|
+
if (freshInboundInstructions)
|
|
14470
|
+
this.installCompactInboundInstructions();
|
|
14471
|
+
else {
|
|
14472
|
+
this.compactInboundInstructions = false;
|
|
14473
|
+
this.inboundCompatibilityPending = true;
|
|
14474
|
+
this.resetInboundPresentation();
|
|
14475
|
+
}
|
|
14251
14476
|
this.backend.preTrust?.(this.config.working_directory, backendConfig);
|
|
14252
14477
|
// Resolve working directory (e.g. symlink for hidden paths)
|
|
14253
14478
|
const resolvedCwd = this.backend.resolveWorkingDirectory?.(this.config.working_directory, this.name) ?? this.config.working_directory;
|
|
@@ -14617,7 +14842,7 @@ export class Daemon extends EventEmitter {
|
|
|
14617
14842
|
const keyScreen = this.nativePaneLifecycle ? await this.tmux.capturePane() : answeredPane;
|
|
14618
14843
|
if (!owned() || !Daemon.dialogMatches(dialog, keyScreen))
|
|
14619
14844
|
return false;
|
|
14620
|
-
if (key === "Up" || key === "Down" || key === "Enter" || key === "Escape") {
|
|
14845
|
+
if (key === "Up" || key === "Down" || key === "Enter" || key === "Escape" || key === "Right") {
|
|
14621
14846
|
if (!await (this.nativePaneLifecycle ? this.tmux.sendSpecialKey(key, undefined, { kind: "dialog", screen: keyScreen }) : this.tmux.sendSpecialKey(key)))
|
|
14622
14847
|
return false;
|
|
14623
14848
|
}
|
|
@@ -14845,8 +15070,11 @@ export class Daemon extends EventEmitter {
|
|
|
14845
15070
|
// Idle observations happen after turns. Avoid needless writes (and mtime
|
|
14846
15071
|
// churn) while still updating the marker when /new changes the session.
|
|
14847
15072
|
try {
|
|
14848
|
-
|
|
15073
|
+
const previous = readFileSync(path, "utf-8").trim();
|
|
15074
|
+
if (previous === sid)
|
|
14849
15075
|
return;
|
|
15076
|
+
if (previous)
|
|
15077
|
+
this.resetInboundPresentation();
|
|
14850
15078
|
}
|
|
14851
15079
|
catch { /* first checkpoint */ }
|
|
14852
15080
|
writeFileSync(path, sid);
|