@songsid/agend 2.4.0-beta.23 → 2.4.0-beta.25
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 +1 -1
- package/README.zh-TW.md +1 -1
- package/dist/agend-home.js +5 -5
- package/dist/agend-home.js.map +1 -1
- package/dist/agent-cli-instructions.md +4 -3
- package/dist/agent-cli.js +32 -2
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.js +10 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-file-read.js +2 -2
- package/dist/agent-file-read.js.map +1 -1
- package/dist/agent-whats-new.js +11 -1
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/agent-workspace.d.ts +18 -2
- package/dist/agent-workspace.js +15 -4
- package/dist/agent-workspace.js.map +1 -1
- package/dist/backend/antigravity.js +8 -6
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-code.d.ts +15 -0
- package/dist/backend/claude-code.js +25 -3
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/claude-mcp-carry.d.ts +63 -0
- package/dist/backend/claude-mcp-carry.js +242 -0
- package/dist/backend/claude-mcp-carry.js.map +1 -0
- package/dist/backend/claude-usage-credits.d.ts +8 -0
- package/dist/backend/claude-usage-credits.js +121 -0
- package/dist/backend/claude-usage-credits.js.map +1 -0
- package/dist/backend/types.d.ts +30 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/adapters/discord.js +7 -1
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/mcp-tools.js +7 -6
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/tool-router.js +1 -0
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/cli-audited.js +9 -4
- package/dist/cli-audited.js.map +1 -1
- package/dist/cli.js +184 -21
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +17 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/contact-auth-store.d.ts +18 -0
- package/dist/contact-auth-store.js +55 -8
- package/dist/contact-auth-store.js.map +1 -1
- package/dist/contact-auth-types.d.ts +3 -0
- package/dist/contact-auth-types.js.map +1 -1
- package/dist/contact-change-proposals.d.ts +34 -0
- package/dist/contact-change-proposals.js +1 -1
- package/dist/contact-change-proposals.js.map +1 -1
- package/dist/cross-instance-notice.d.ts +1 -0
- package/dist/cross-instance-notice.js +9 -8
- package/dist/cross-instance-notice.js.map +1 -1
- package/dist/daemon.d.ts +46 -0
- package/dist/daemon.js +299 -33
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard-permissions.d.ts +8 -0
- package/dist/dashboard-permissions.js +8 -0
- package/dist/dashboard-permissions.js.map +1 -1
- package/dist/delivery-outbox.d.ts +56 -1
- package/dist/delivery-outbox.js +254 -22
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-context.d.ts +8 -0
- package/dist/fleet-lock.d.ts +67 -2
- package/dist/fleet-lock.js +236 -2
- package/dist/fleet-lock.js.map +1 -1
- package/dist/fleet-manager.d.ts +177 -6
- package/dist/fleet-manager.js +1203 -75
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +20 -1
- package/dist/fleet-windows-runtime.js +98 -18
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +22 -9
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +6 -0
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +7 -0
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +3 -3
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -1
- package/dist/general-knowledge/skills/task-board/SKILL.md +17 -0
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +4 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +35 -7
- package/dist/home-update-lock.d.ts +35 -0
- package/dist/home-update-lock.js +81 -0
- package/dist/home-update-lock.js.map +1 -0
- package/dist/hub/compose/member.d.ts +5 -1
- package/dist/hub/compose/member.js +9 -5
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +1 -1
- package/dist/hub/member/room-ask.d.ts +5 -0
- package/dist/hub/member/room-ask.js +43 -16
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-mention-feedback.d.ts +2 -0
- package/dist/hub/member/room-mention-feedback.js +1 -1
- package/dist/hub/member/room-mention-feedback.js.map +1 -1
- package/dist/hub/member/room-post-answers.d.ts +2 -0
- package/dist/hub/member/room-post-answers.js +1 -1
- package/dist/hub/member/room-post-answers.js.map +1 -1
- package/dist/hub/member/room-post.d.ts +5 -0
- package/dist/hub/member/room-post.js +4 -1
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/member/updates.d.ts +7 -1
- package/dist/hub/member/updates.js +7 -1
- package/dist/hub/member/updates.js.map +1 -1
- package/dist/hub/representative.d.ts +7 -0
- package/dist/hub/representative.js +38 -5
- package/dist/hub/representative.js.map +1 -1
- package/dist/install-lock.d.ts +15 -1
- package/dist/install-lock.js +16 -8
- package/dist/install-lock.js.map +1 -1
- package/dist/install-ownership.d.ts +165 -0
- package/dist/install-ownership.js +404 -0
- package/dist/install-ownership.js.map +1 -0
- package/dist/instance-config-impact.js +2 -0
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +2 -0
- package/dist/instance-lifecycle.js +29 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +4 -0
- package/dist/instructions.js +4 -0
- package/dist/instructions.js.map +1 -1
- package/dist/local-pane-endpoint.d.ts +4 -1
- package/dist/local-pane-endpoint.js +12 -2
- package/dist/local-pane-endpoint.js.map +1 -1
- package/dist/locale.js +170 -4
- package/dist/locale.js.map +1 -1
- package/dist/native-agent-admission.d.ts +7 -0
- package/dist/native-agent-admission.js +46 -3
- package/dist/native-agent-admission.js.map +1 -1
- package/dist/native-mcp.d.ts +16 -1
- package/dist/native-mcp.js +38 -5
- package/dist/native-mcp.js.map +1 -1
- package/dist/native-pane-lifecycle.d.ts +9 -0
- package/dist/native-pane-lifecycle.js +23 -0
- package/dist/native-pane-lifecycle.js.map +1 -1
- package/dist/native-pane-manager.d.ts +19 -6
- package/dist/native-pane-manager.js +79 -4
- package/dist/native-pane-manager.js.map +1 -1
- package/dist/needs-you-hub.d.ts +3 -0
- package/dist/needs-you-hub.js +31 -5
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +22 -1
- package/dist/needs-you.js +6 -0
- 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/office-share.js +2 -1
- package/dist/office-share.js.map +1 -1
- package/dist/outbound-handlers.d.ts +12 -0
- package/dist/outbound-handlers.js +59 -8
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +3 -0
- package/dist/outbound-schemas.js +7 -5
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/package-preimage.js +4 -0
- package/dist/package-preimage.js.map +1 -1
- package/dist/pane-port.d.ts +1 -0
- package/dist/plist-args.d.ts +9 -0
- package/dist/plist-args.js +22 -0
- package/dist/plist-args.js.map +1 -0
- package/dist/public-preview.d.ts +4 -6
- package/dist/public-preview.js +5 -2
- package/dist/public-preview.js.map +1 -1
- package/dist/public-web-gateway.js +11 -3
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +13 -1
- package/dist/public-web-link.js +28 -1
- package/dist/public-web-link.js.map +1 -1
- package/dist/recover.cjs +2452 -0
- package/dist/remote-card-prompt.d.ts +6 -2
- package/dist/remote-card-prompt.js +12 -3
- package/dist/remote-card-prompt.js.map +1 -1
- package/dist/reply-draft.d.ts +12 -0
- package/dist/reply-draft.js +81 -0
- package/dist/reply-draft.js.map +1 -0
- package/dist/request-contact-api.d.ts +15 -0
- package/dist/request-contact-api.js +120 -0
- package/dist/request-contact-api.js.map +1 -0
- package/dist/request-contact-card.d.ts +36 -0
- package/dist/request-contact-card.js +206 -0
- package/dist/request-contact-card.js.map +1 -0
- package/dist/request-contact-gate.d.ts +79 -0
- package/dist/request-contact-gate.js +262 -0
- package/dist/request-contact-gate.js.map +1 -0
- package/dist/request-contact-native.d.ts +52 -0
- package/dist/request-contact-native.js +83 -0
- package/dist/request-contact-native.js.map +1 -0
- package/dist/request-contact-types.d.ts +86 -0
- package/dist/request-contact-types.js +7 -0
- package/dist/request-contact-types.js.map +1 -0
- package/dist/request-context-call-protocol.d.ts +12 -0
- package/dist/request-context-call-protocol.js +14 -0
- package/dist/request-context-call-protocol.js.map +1 -0
- package/dist/request-context-call.d.ts +22 -0
- package/dist/request-context-call.js +35 -0
- package/dist/request-context-call.js.map +1 -0
- package/dist/request-context-compatibility.d.ts +20 -0
- package/dist/request-context-compatibility.js +74 -0
- package/dist/request-context-compatibility.js.map +1 -0
- package/dist/request-context-drain.d.ts +39 -0
- package/dist/request-context-drain.js +159 -0
- package/dist/request-context-drain.js.map +1 -0
- package/dist/request-context-fence.d.ts +28 -0
- package/dist/request-context-fence.js +58 -0
- package/dist/request-context-fence.js.map +1 -0
- package/dist/request-context-migration.d.ts +64 -0
- package/dist/request-context-migration.js +158 -0
- package/dist/request-context-migration.js.map +1 -0
- package/dist/request-context-pane.d.ts +25 -0
- package/dist/request-context-pane.js +48 -0
- package/dist/request-context-pane.js.map +1 -0
- package/dist/request-context-policy.d.ts +74 -0
- package/dist/request-context-policy.js +116 -0
- package/dist/request-context-policy.js.map +1 -0
- package/dist/request-context-protocol.d.ts +137 -0
- package/dist/request-context-protocol.js +38 -0
- package/dist/request-context-protocol.js.map +1 -0
- package/dist/request-context-recovery.d.ts +14 -0
- package/dist/request-context-recovery.js +56 -0
- package/dist/request-context-recovery.js.map +1 -0
- package/dist/request-context-relay.d.ts +19 -0
- package/dist/request-context-relay.js +63 -0
- package/dist/request-context-relay.js.map +1 -0
- package/dist/request-context-returns.d.ts +67 -0
- package/dist/request-context-returns.js +211 -0
- package/dist/request-context-returns.js.map +1 -0
- package/dist/request-context-store.d.ts +26 -0
- package/dist/request-context-store.js +144 -0
- package/dist/request-context-store.js.map +1 -0
- package/dist/request-context-turns.d.ts +99 -0
- package/dist/request-context-turns.js +215 -0
- package/dist/request-context-turns.js.map +1 -0
- package/dist/request-context-view.d.ts +33 -0
- package/dist/request-context-view.js +36 -0
- package/dist/request-context-view.js.map +1 -0
- package/dist/request-hub-context.d.ts +130 -0
- package/dist/request-hub-context.js +89 -0
- package/dist/request-hub-context.js.map +1 -0
- package/dist/request-hub-output.d.ts +11 -0
- package/dist/request-hub-output.js +21 -0
- package/dist/request-hub-output.js.map +1 -0
- package/dist/runtime-cli-install.js +13 -11
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/runtime-client.d.ts +2 -0
- package/dist/runtime-client.js +17 -4
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +4 -1
- package/dist/runtime-coordinator.js +10 -3
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-pane-assets.d.ts +1 -1
- package/dist/runtime-pane-assets.js +1 -1
- package/dist/runtime-pane-assets.js.map +1 -1
- package/dist/runtime-pane-host.d.ts +3 -0
- package/dist/runtime-pane-host.js +39 -21
- package/dist/runtime-pane-host.js.map +1 -1
- package/dist/runtime-pane-link.d.ts +6 -2
- package/dist/runtime-pane-link.js +17 -4
- package/dist/runtime-pane-link.js.map +1 -1
- package/dist/runtime-pane-mcp-relay.d.ts +11 -1
- package/dist/runtime-pane-mcp-relay.js +69 -3
- package/dist/runtime-pane-mcp-relay.js.map +1 -1
- package/dist/runtime-pane-mcp.d.ts +28 -1
- package/dist/runtime-pane-mcp.js +92 -15
- package/dist/runtime-pane-mcp.js.map +1 -1
- package/dist/runtime-pane-port.d.ts +6 -0
- package/dist/runtime-pane-port.js +23 -4
- package/dist/runtime-pane-port.js.map +1 -1
- package/dist/runtime-pane-protocol.d.ts +4 -0
- package/dist/runtime-pane-protocol.js +11 -4
- package/dist/runtime-pane-protocol.js.map +1 -1
- package/dist/runtime-pane-service.d.ts +1 -0
- package/dist/runtime-pane-service.js +25 -9
- package/dist/runtime-pane-service.js.map +1 -1
- package/dist/runtime-pane-stdio-protocol.d.ts +4 -0
- package/dist/runtime-pane-stdio-protocol.js +12 -5
- package/dist/runtime-pane-stdio-protocol.js.map +1 -1
- package/dist/runtime-pane-stdio.js +5 -5
- package/dist/runtime-pane-stdio.js.map +1 -1
- package/dist/runtime-protocol.d.ts +3 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/scheduler/db.js +26 -0
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/scheduler.d.ts +6 -0
- package/dist/scheduler/scheduler.js +19 -1
- package/dist/scheduler/scheduler.js.map +1 -1
- package/dist/scheduler/task-board-text.d.ts +2 -0
- package/dist/scheduler/task-board-text.js +12 -0
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +106 -2
- package/dist/scheduler/task-board.js +248 -24
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/scheduler/task-files.d.ts +80 -0
- package/dist/scheduler/task-files.js +357 -0
- package/dist/scheduler/task-files.js.map +1 -0
- package/dist/scheduler/types.d.ts +1 -1
- package/dist/service-activation.js +3 -13
- package/dist/service-activation.js.map +1 -1
- package/dist/service-lock.d.ts +28 -0
- package/dist/service-lock.js +85 -0
- package/dist/service-lock.js.map +1 -0
- package/dist/settings-api.d.ts +8 -0
- package/dist/settings-api.js +41 -1
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +1 -0
- package/dist/settings-baseline.js +1 -1
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +1 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.d.ts +2 -0
- package/dist/settings-effect.js +5 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/state-lease.d.ts +24 -0
- package/dist/state-lease.js +103 -0
- package/dist/state-lease.js.map +1 -0
- package/dist/task-attach-client.d.ts +43 -0
- package/dist/task-attach-client.js +125 -0
- package/dist/task-attach-client.js.map +1 -0
- package/dist/task-board-tool.d.ts +12 -0
- package/dist/task-board-tool.js +107 -6
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-file-limits.d.ts +15 -0
- package/dist/task-file-limits.js +21 -0
- package/dist/task-file-limits.js.map +1 -0
- package/dist/tmux-binary.js +1 -1
- package/dist/tmux-binary.js.map +1 -1
- package/dist/tool-permissions.d.ts +32 -0
- package/dist/tool-permissions.js +63 -0
- package/dist/tool-permissions.js.map +1 -1
- package/dist/tool-receipt-output.d.ts +2 -0
- package/dist/topic-commands.js +21 -1
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-monitor.js +3 -0
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/tunnel/named-link-test.d.ts +27 -0
- package/dist/tunnel/named-link-test.js +41 -0
- package/dist/tunnel/named-link-test.js.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/ui/agent-details-settings.js +7 -5
- package/dist/ui/agent-who-can-use-strings.js +125 -0
- package/dist/ui/agent-who-can-use.js +238 -0
- package/dist/ui/chat-store.js +5 -4
- package/dist/ui/fleet-office-card.js +37 -6
- package/dist/ui/fleet-office-editor.js +5 -5
- package/dist/ui/fleet-office-pack.d.ts +10 -0
- package/dist/ui/fleet-office-pack.js +65 -2
- package/dist/ui/fleet-office-skin.js +75 -17
- package/dist/ui/fleet-office-store.js +33 -2
- package/dist/ui/fleet-office-vehicles.js +130 -0
- package/dist/ui/fleet-office-zones.js +13 -4
- package/dist/ui/fleet-office.js +245 -46
- package/dist/ui/fleet-task-activity.js +9 -82
- package/dist/ui/fleet-task-archive.js +111 -0
- package/dist/ui/fleet-task-card.js +6 -4
- package/dist/ui/fleet-task-common.js +2 -2
- package/dist/ui/fleet-task-edit.js +8 -1
- package/dist/ui/fleet-task-files.js +196 -0
- package/dist/ui/fleet-task-md.js +98 -0
- package/dist/ui/fleet-task-menu.js +1 -1
- package/dist/ui/fleet-task-stats.js +2 -2
- package/dist/ui/fleet-task-view.js +12 -8
- package/dist/ui/fleet-tasks.js +42 -18
- package/dist/ui/panel-chat.js +15 -2
- package/dist/ui/panel-details.js +3 -1
- package/dist/ui/panel-needs.js +25 -5
- package/dist/ui/panel-settings.js +37 -9
- package/dist/ui/settings-preview-address.js +156 -0
- package/dist/ui/settings-registry.js +3 -0
- package/dist/ui/settings-shared-strings.js +9 -0
- package/dist/ui/settings-shared.js +6 -1
- package/dist/ui/settings-strings.js +6 -6
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-needs.js +8 -1
- package/dist/ui/shared/app.css +131 -5
- package/dist/ui/shared/chat-strings.js +10 -6
- package/dist/ui/shared/chat-thread.js +7 -1
- package/dist/ui/shared/preview-panel.js +1 -1
- package/dist/ui/shared/preview.js +11 -2
- package/dist/ui/shared/task-board.css +64 -0
- package/dist/ui/shared/tokens.css +18 -3
- package/dist/ui/shared/ui-confirm.js +5 -4
- package/dist/ui/shared/workspace.css +7 -0
- package/dist/ui/usage-credits-card.js +84 -0
- package/dist/ui/workspace-ignored-strings.js +16 -0
- package/dist/ui/workspace-panel.js +15 -6
- package/dist/update-card.d.ts +193 -0
- package/dist/update-card.js +620 -0
- package/dist/update-card.js.map +1 -0
- package/dist/update-dispatch.d.ts +16 -1
- package/dist/update-dispatch.js +12 -4
- package/dist/update-dispatch.js.map +1 -1
- package/dist/update-forward.d.ts +73 -0
- package/dist/update-forward.js +283 -0
- package/dist/update-forward.js.map +1 -0
- package/dist/update-idle.d.ts +1 -0
- package/dist/update-idle.js +12 -3
- package/dist/update-idle.js.map +1 -1
- package/dist/update-install.d.ts +2 -1
- package/dist/update-install.js +18 -10
- package/dist/update-install.js.map +1 -1
- package/dist/update-journal.d.ts +351 -0
- package/dist/update-journal.js +717 -0
- package/dist/update-journal.js.map +1 -0
- package/dist/update-launch.js +1 -1
- package/dist/update-launch.js.map +1 -1
- package/dist/update-npm-env.d.ts +45 -12
- package/dist/update-npm-env.js +48 -0
- package/dist/update-npm-env.js.map +1 -1
- package/dist/update-package-restore.d.ts +75 -0
- package/dist/update-package-restore.js +318 -0
- package/dist/update-package-restore.js.map +1 -0
- package/dist/update-quiescence.d.ts +192 -0
- package/dist/update-quiescence.js +330 -0
- package/dist/update-quiescence.js.map +1 -0
- package/dist/update-readiness-host.d.ts +61 -0
- package/dist/update-readiness-host.js +297 -0
- package/dist/update-readiness-host.js.map +1 -0
- package/dist/update-readiness.d.ts +83 -0
- package/dist/update-readiness.js +459 -0
- package/dist/update-readiness.js.map +1 -0
- package/dist/update-recovery/kit.d.ts +35 -0
- package/dist/update-recovery/kit.js +99 -0
- package/dist/update-recovery/kit.js.map +1 -0
- package/dist/update-recovery/pre-start.d.ts +34 -0
- package/dist/update-recovery/pre-start.js +103 -0
- package/dist/update-recovery/pre-start.js.map +1 -0
- package/dist/update-recovery/recover-main.d.ts +1 -0
- package/dist/update-recovery/recover-main.js +4 -0
- package/dist/update-recovery/recover-main.js.map +1 -0
- package/dist/update-recovery/recover.d.ts +22 -0
- package/dist/update-recovery/recover.js +124 -0
- package/dist/update-recovery/recover.js.map +1 -0
- package/dist/update-recovery/route.d.ts +53 -0
- package/dist/update-recovery/route.js +262 -0
- package/dist/update-recovery/route.js.map +1 -0
- package/dist/update-recovery/runner.d.ts +58 -0
- package/dist/update-recovery/runner.js +196 -0
- package/dist/update-recovery/runner.js.map +1 -0
- package/dist/update-recovery/service-manager.d.ts +39 -0
- package/dist/update-recovery/service-manager.js +57 -0
- package/dist/update-recovery/service-manager.js.map +1 -0
- package/dist/update-restore.d.ts +44 -0
- package/dist/update-restore.js +355 -0
- package/dist/update-restore.js.map +1 -0
- package/dist/update-retained.d.ts +38 -0
- package/dist/update-retained.js +91 -0
- package/dist/update-retained.js.map +1 -0
- package/dist/update-rollback.d.ts +74 -0
- package/dist/update-rollback.js +221 -0
- package/dist/update-rollback.js.map +1 -0
- package/dist/update-settings.d.ts +36 -0
- package/dist/update-settings.js +122 -0
- package/dist/update-settings.js.map +1 -0
- package/dist/update-snapshot-manifest.d.ts +32 -0
- package/dist/update-snapshot-manifest.js +65 -0
- package/dist/update-snapshot-manifest.js.map +1 -0
- package/dist/update-snapshot-scope.d.ts +67 -0
- package/dist/update-snapshot-scope.js +172 -0
- package/dist/update-snapshot-scope.js.map +1 -0
- package/dist/update-snapshot.d.ts +34 -0
- package/dist/update-snapshot.js +246 -0
- package/dist/update-snapshot.js.map +1 -0
- package/dist/update-writers.d.ts +71 -0
- package/dist/update-writers.js +235 -0
- package/dist/update-writers.js.map +1 -0
- package/dist/web-api.d.ts +6 -0
- package/dist/web-api.js +140 -22
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +7 -0
- package/dist/web-chat-history.js +15 -0
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-office-acts.d.ts +16 -0
- package/dist/web-office-acts.js +27 -9
- package/dist/web-office-acts.js.map +1 -1
- package/dist/web-office-pack-read.js +1 -1
- package/dist/web-office-pack-read.js.map +1 -1
- package/dist/web-office-skins.d.ts +5 -3
- package/dist/web-office-skins.js +20 -16
- package/dist/web-office-skins.js.map +1 -1
- package/dist/web-preview.d.ts +5 -0
- package/dist/web-preview.js +1 -1
- package/dist/web-preview.js.map +1 -1
- package/dist/web-settings-patch.d.ts +27 -0
- package/dist/web-settings-patch.js +67 -0
- package/dist/web-settings-patch.js.map +1 -1
- package/dist/web-update.d.ts +6 -0
- package/dist/windows-agents.d.ts +12 -0
- package/dist/windows-agents.js +5 -0
- package/dist/windows-agents.js.map +1 -1
- package/dist/workflow-templates/default.md +1 -0
- package/launcher/agend +4 -1
- package/launcher/agend-agent +4 -1
- package/launcher/agend-install.cjs +16 -8
- package/launcher/install-admission.d.cts +8 -0
- package/launcher/npm-allow-scripts.cjs +72 -0
- package/launcher/npm-global-prefix.cjs +81 -0
- package/launcher/postinstall.cjs +9 -8
- package/launcher/runtime-select.cjs +8 -2
- package/package.json +3 -2
- package/scripts/preinstall-guard.cjs +1 -1
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M-3770 slice 2.3 (design update-transaction §6.3): the package and the service unit, put back with retryable substeps.
|
|
3
|
+
*
|
|
4
|
+
* - **The transaction's own package preimage** is a copy, taken before the install: `<prefix>/.agend-rollback/
|
|
5
|
+
* attempt-<id>/agend`, with the bin links' targets recorded and every entry hashed into `preimage.json` (its sha256
|
|
6
|
+
* is the install intent's `preimage.manifestSha256`, §3.2). `restorePackagePreimage` (the legacy one) consumes its
|
|
7
|
+
* copy; this one never does — a restore copies from it.
|
|
8
|
+
* - **Package restore**, each substep journaled after its effect, each retry recognising an effect already done by
|
|
9
|
+
* the path's presence and its hash against the preimage's manifest:
|
|
10
|
+
* 1. `pkg-aside`: the current `<root>/@songsid/agend` renamed to `<preimage>/replaced-package` (if present, and that
|
|
11
|
+
* destination is new);
|
|
12
|
+
* 2. `pkg-staged`: the preimage tree copied to `<root>/@songsid/.agend-restore-<id>`, fsynced;
|
|
13
|
+
* 3. `pkg-placed`: the staged tree renamed into `<root>/@songsid/agend`;
|
|
14
|
+
* 4. `bins`: each bin link made at `<bin>.restore-tmp` and renamed over `<bin>` (removed when it had none).
|
|
15
|
+
* - **Unit restore**: `unit.preimage`'s bytes written to `<fragment>.restore-tmp`, fsynced, renamed; the route either
|
|
16
|
+
* kept (the runner, until the takeover is acknowledged: §6.2 step 3 — launchd keeps its wrapper around the original
|
|
17
|
+
* arguments) or removed; then the manager reloaded. A retry writes the same bytes again.
|
|
18
|
+
*
|
|
19
|
+
* Anything a retry can't recognise is manual-recovery. The caller holds the locks and has re-proven ownership.
|
|
20
|
+
*/
|
|
21
|
+
import { createHash } from "node:crypto";
|
|
22
|
+
import { closeSync, cpSync, existsSync, fsyncSync, lstatSync, mkdirSync, openSync, readdirSync, readFileSync, readlinkSync, renameSync, rmSync, symlinkSync, unlinkSync, writeSync } from "node:fs";
|
|
23
|
+
import { basename, dirname, join } from "node:path";
|
|
24
|
+
import { dropInPath, dropInText, removeRecoveryRoute, unitPreimagePath, wrapPlist } from "./update-recovery/route.js";
|
|
25
|
+
import { identityOf } from "./install-ownership.js";
|
|
26
|
+
export const ATTEMPT_PREIMAGE_PREFIX = "attempt-";
|
|
27
|
+
export const PREIMAGE_MANIFEST = "preimage.json";
|
|
28
|
+
export const attemptPreimageDir = (prefix, attemptId) => join(prefix, ".agend-rollback", `${ATTEMPT_PREIMAGE_PREFIX}${attemptId}`);
|
|
29
|
+
const fsyncPath = (p) => { const fd = openSync(p, "r"); try {
|
|
30
|
+
fsyncSync(fd);
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
closeSync(fd);
|
|
34
|
+
} };
|
|
35
|
+
const sha256 = (b) => createHash("sha256").update(b).digest("hex");
|
|
36
|
+
/** A tree's entries, never following a link, in a stable order. */
|
|
37
|
+
function treeOf(root) {
|
|
38
|
+
const out = [];
|
|
39
|
+
const visit = (rel) => {
|
|
40
|
+
for (const name of readdirSync(rel ? join(root, rel) : root).sort()) {
|
|
41
|
+
const r = rel ? `${rel}/${name}` : name, st = lstatSync(join(root, r));
|
|
42
|
+
if (st.isSymbolicLink())
|
|
43
|
+
out.push({ rel: r, type: "link", mode: 0, target: readlinkSync(join(root, r)) });
|
|
44
|
+
else if (st.isDirectory()) {
|
|
45
|
+
out.push({ rel: r, type: "dir", mode: st.mode & 0o7777 });
|
|
46
|
+
visit(r);
|
|
47
|
+
}
|
|
48
|
+
else
|
|
49
|
+
out.push({ rel: r, type: "file", mode: st.mode & 0o7777, sha256: sha256(readFileSync(join(root, r))) });
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
visit("");
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
/** Does the tree at `root` match `entries` exactly? */
|
|
56
|
+
function treeMatches(root, entries) {
|
|
57
|
+
if (!existsSync(root))
|
|
58
|
+
return false;
|
|
59
|
+
let now;
|
|
60
|
+
try {
|
|
61
|
+
now = treeOf(root);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
return JSON.stringify(now) === JSON.stringify(entries);
|
|
67
|
+
}
|
|
68
|
+
/** Every file and directory under `root` fsynced, deepest first. */
|
|
69
|
+
function fsyncTree(root) {
|
|
70
|
+
const dirs = [root];
|
|
71
|
+
for (const e of treeOf(root)) {
|
|
72
|
+
if (e.type === "dir")
|
|
73
|
+
dirs.push(join(root, e.rel));
|
|
74
|
+
else if (e.type === "file")
|
|
75
|
+
fsyncPath(join(root, e.rel));
|
|
76
|
+
}
|
|
77
|
+
for (const d of dirs.sort((a, b) => b.length - a.length))
|
|
78
|
+
fsyncPath(d);
|
|
79
|
+
}
|
|
80
|
+
/** §6.3: copy the installed package aside for this attempt, hash it, record the bin links. Its directory must be new. */
|
|
81
|
+
export function takeAttemptPreimage(ownership, attemptId) {
|
|
82
|
+
const dir = attemptPreimageDir(ownership.prefix, attemptId);
|
|
83
|
+
if (existsSync(dir))
|
|
84
|
+
return { ok: false, reason: `${dir} already exists; an attempt's preimage is never reused` };
|
|
85
|
+
try {
|
|
86
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
87
|
+
cpSync(ownership.packagePath, join(dir, "agend"), { recursive: true, verbatimSymlinks: true, preserveTimestamps: true });
|
|
88
|
+
fsyncTree(join(dir, "agend"));
|
|
89
|
+
const bins = {};
|
|
90
|
+
for (const [name, link] of Object.entries(ownership.binLinks)) {
|
|
91
|
+
const st = lstatSync(link, { throwIfNoEntry: false });
|
|
92
|
+
bins[name] = !st ? { link, kind: "absent" }
|
|
93
|
+
: st.isSymbolicLink() ? { link, kind: "link", target: readlinkSync(link) }
|
|
94
|
+
: { link, kind: "file", sha256: sha256(readFileSync(link)) };
|
|
95
|
+
}
|
|
96
|
+
const manifest = { schema: 1, attemptId, packagePath: ownership.packagePath, entries: treeOf(join(dir, "agend")), bins };
|
|
97
|
+
const text = JSON.stringify(manifest, null, 2) + "\n";
|
|
98
|
+
const tmp = join(dir, `${PREIMAGE_MANIFEST}.tmp`);
|
|
99
|
+
const fd = openSync(tmp, "wx", 0o600);
|
|
100
|
+
try {
|
|
101
|
+
writeSync(fd, text);
|
|
102
|
+
fsyncSync(fd);
|
|
103
|
+
}
|
|
104
|
+
finally {
|
|
105
|
+
closeSync(fd);
|
|
106
|
+
}
|
|
107
|
+
renameSync(tmp, join(dir, PREIMAGE_MANIFEST));
|
|
108
|
+
fsyncPath(dir);
|
|
109
|
+
fsyncPath(dirname(dir));
|
|
110
|
+
return { ok: true, dir, manifestSha256: sha256(text) };
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
rmSync(dir, { recursive: true, force: true });
|
|
114
|
+
return { ok: false, reason: `the installed package can't be copied aside (${err.message})` };
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/** The preimage, verified against the sha256 the attempt recorded: its manifest and its tree exactly. */
|
|
118
|
+
export function readAttemptPreimage(dir, manifestSha256) {
|
|
119
|
+
let text;
|
|
120
|
+
try {
|
|
121
|
+
text = readFileSync(join(dir, PREIMAGE_MANIFEST), "utf8");
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
return { ok: false, reason: `the preimage's manifest can't be read (${err.message})` };
|
|
125
|
+
}
|
|
126
|
+
if (sha256(text) !== manifestSha256)
|
|
127
|
+
return { ok: false, reason: "the preimage's manifest isn't the one the attempt recorded" };
|
|
128
|
+
const manifest = JSON.parse(text);
|
|
129
|
+
if (!treeMatches(join(dir, "agend"), manifest.entries))
|
|
130
|
+
return { ok: false, reason: "the preimage's tree doesn't match its manifest" };
|
|
131
|
+
return { ok: true, manifest };
|
|
132
|
+
}
|
|
133
|
+
class Manual extends Error {
|
|
134
|
+
}
|
|
135
|
+
/** §6.3: put the preimage's package and bin links back. */
|
|
136
|
+
export function restorePackage(ownership, attemptId, manifestSha256, steps) {
|
|
137
|
+
const dir = attemptPreimageDir(ownership.prefix, attemptId);
|
|
138
|
+
const pre = readAttemptPreimage(dir, manifestSha256);
|
|
139
|
+
if (!pre.ok)
|
|
140
|
+
return { ok: false, manual: true, reason: pre.reason };
|
|
141
|
+
const { manifest } = pre;
|
|
142
|
+
const pkg = ownership.packagePath, scope = dirname(pkg), staged = join(scope, `.agend-restore-${attemptId}`), replaced = join(dir, "replaced-package");
|
|
143
|
+
try {
|
|
144
|
+
if (pkg !== manifest.packagePath)
|
|
145
|
+
throw new Manual(`the preimage was taken for ${manifest.packagePath}, not ${pkg}`);
|
|
146
|
+
if (!steps.done("pkg-aside")) {
|
|
147
|
+
const here = existsSync(pkg) || isLink(pkg), there = existsSync(replaced) || isLink(replaced);
|
|
148
|
+
if (here && !there) {
|
|
149
|
+
renameSync(pkg, replaced);
|
|
150
|
+
fsyncPath(scope);
|
|
151
|
+
fsyncPath(dir);
|
|
152
|
+
}
|
|
153
|
+
else if (here && there)
|
|
154
|
+
throw new Manual(`${pkg} and ${replaced} both exist`);
|
|
155
|
+
steps.record("pkg-aside"); // moved now, moved before (only replaced/), or nothing was installed
|
|
156
|
+
}
|
|
157
|
+
if (!steps.done("pkg-staged")) {
|
|
158
|
+
rmSync(staged, { recursive: true, force: true }); // only this restore's own staging directory: copied afresh
|
|
159
|
+
cpSync(join(dir, "agend"), staged, { recursive: true, verbatimSymlinks: true, preserveTimestamps: true });
|
|
160
|
+
fsyncTree(staged);
|
|
161
|
+
fsyncPath(scope);
|
|
162
|
+
steps.record("pkg-staged");
|
|
163
|
+
}
|
|
164
|
+
if (!steps.done("pkg-placed")) {
|
|
165
|
+
if (treeMatches(pkg, manifest.entries) && !existsSync(staged)) { /* the rename landed before its line */ }
|
|
166
|
+
else if (existsSync(staged) && !existsSync(pkg) && !isLink(pkg)) {
|
|
167
|
+
renameSync(staged, pkg);
|
|
168
|
+
fsyncPath(scope);
|
|
169
|
+
}
|
|
170
|
+
else
|
|
171
|
+
throw new Manual(`${pkg} can't be placed: ${existsSync(pkg) ? "something else is there" : "the staged tree is missing"}`);
|
|
172
|
+
steps.record("pkg-placed");
|
|
173
|
+
}
|
|
174
|
+
if (!steps.done("bins")) {
|
|
175
|
+
for (const before of Object.values(manifest.bins)) {
|
|
176
|
+
const { link } = before;
|
|
177
|
+
const st = lstatSync(link, { throwIfNoEntry: false });
|
|
178
|
+
if (before.kind === "file") {
|
|
179
|
+
// Not npm's link (Fable #4528 N1): never removed or replaced — it must still be the same file.
|
|
180
|
+
if (!st || !st.isFile() || sha256(readFileSync(link)) !== before.sha256)
|
|
181
|
+
throw new Manual(`${link} was a file before the install, and isn't that file now`);
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
if (before.kind === "absent") {
|
|
185
|
+
if (st) {
|
|
186
|
+
if (st.isSymbolicLink())
|
|
187
|
+
unlinkSync(link);
|
|
188
|
+
else
|
|
189
|
+
throw new Manual(`${link} wasn't there before, and isn't a link now`);
|
|
190
|
+
}
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
if (st?.isSymbolicLink() && readlinkSync(link) === before.target)
|
|
194
|
+
continue;
|
|
195
|
+
if (st && !st.isSymbolicLink())
|
|
196
|
+
throw new Manual(`${link} is a file now, not the link it was`);
|
|
197
|
+
const tmp = `${link}.restore-tmp`;
|
|
198
|
+
rmSync(tmp, { force: true });
|
|
199
|
+
symlinkSync(before.target, tmp);
|
|
200
|
+
renameSync(tmp, link);
|
|
201
|
+
}
|
|
202
|
+
for (const d of new Set(Object.values(manifest.bins).map(b => dirname(b.link))))
|
|
203
|
+
fsyncPath(d);
|
|
204
|
+
steps.record("bins");
|
|
205
|
+
}
|
|
206
|
+
return { ok: true };
|
|
207
|
+
}
|
|
208
|
+
catch (err) {
|
|
209
|
+
if (err instanceof Manual)
|
|
210
|
+
return { ok: false, manual: true, reason: err.message };
|
|
211
|
+
throw err; // a crash: the retry recognises what landed
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
function isLink(p) { try {
|
|
215
|
+
return lstatSync(p).isSymbolicLink();
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
return false;
|
|
219
|
+
} }
|
|
220
|
+
/**
|
|
221
|
+
* §6.3: put the unit's own definition back. `keepRoute` (the runner, §6.2 step 3): systemd keeps its drop-in; launchd
|
|
222
|
+
* gets its wrapper around the ORIGINAL arguments. Otherwise the route goes too. Then `reload()` (daemon-reload, or the
|
|
223
|
+
* plist reload with no start job in progress — the caller's).
|
|
224
|
+
*/
|
|
225
|
+
export function restoreUnit(home, attempt, opts, steps) {
|
|
226
|
+
const service = identityOf(attempt)?.ownership.service;
|
|
227
|
+
if (!service)
|
|
228
|
+
return { ok: false, manual: true, reason: "the attempt records no service" };
|
|
229
|
+
let preimage;
|
|
230
|
+
try {
|
|
231
|
+
preimage = readFileSync(unitPreimagePath(home, attempt.id));
|
|
232
|
+
}
|
|
233
|
+
catch (err) {
|
|
234
|
+
return { ok: false, manual: true, reason: `the unit's preimage can't be read (${err.message})` };
|
|
235
|
+
}
|
|
236
|
+
let want = preimage;
|
|
237
|
+
if (service.kind === "launchd" && opts.keepRoute) {
|
|
238
|
+
const original = opts.plistArgs(preimage.toString("utf8"));
|
|
239
|
+
const wrapped = original ? wrapPlist(preimage.toString("utf8"), home, attempt.id, original) : null;
|
|
240
|
+
if (!wrapped)
|
|
241
|
+
return { ok: false, manual: true, reason: "the job's original arguments can't be wrapped" };
|
|
242
|
+
want = Buffer.from(wrapped);
|
|
243
|
+
}
|
|
244
|
+
try {
|
|
245
|
+
if (!steps.done("unit-written")) {
|
|
246
|
+
// Written afresh (a retry finds the same bytes either way): tmp, fsync, rename, directory fsync; the mode kept.
|
|
247
|
+
const tmp = `${service.fragmentPath}.restore-tmp`;
|
|
248
|
+
rmSync(tmp, { force: true });
|
|
249
|
+
let mode = 0o644;
|
|
250
|
+
try {
|
|
251
|
+
mode = lstatSync(service.fragmentPath).mode & 0o7777;
|
|
252
|
+
}
|
|
253
|
+
catch { /* absent: the default */ }
|
|
254
|
+
const fd = openSync(tmp, "wx", mode);
|
|
255
|
+
try {
|
|
256
|
+
writeSync(fd, want);
|
|
257
|
+
fsyncSync(fd);
|
|
258
|
+
}
|
|
259
|
+
finally {
|
|
260
|
+
closeSync(fd);
|
|
261
|
+
}
|
|
262
|
+
renameSync(tmp, service.fragmentPath);
|
|
263
|
+
fsyncPath(dirname(service.fragmentPath));
|
|
264
|
+
steps.record("unit-written");
|
|
265
|
+
}
|
|
266
|
+
// keepRoute ENSURES the route (Fable #4528 F2): systemd's drop-in must be exactly this attempt's — absent, it is
|
|
267
|
+
// written again (tmp, fsync, rename, directory fsync); other bytes fail closed (§3.2). launchd's wrapper was written
|
|
268
|
+
// above with the fragment.
|
|
269
|
+
if (opts.keepRoute && service.kind === "systemd" && !steps.done("unit-route-kept")) {
|
|
270
|
+
const path = dropInPath(service), want = dropInText(home, attempt.id);
|
|
271
|
+
let now = null;
|
|
272
|
+
try {
|
|
273
|
+
now = readFileSync(path, "utf8");
|
|
274
|
+
}
|
|
275
|
+
catch (err) {
|
|
276
|
+
if (err.code !== "ENOENT")
|
|
277
|
+
throw err;
|
|
278
|
+
}
|
|
279
|
+
if (now !== null && now !== want)
|
|
280
|
+
throw new Manual(`${path} isn't this attempt's drop-in any more`);
|
|
281
|
+
if (now === null) {
|
|
282
|
+
mkdirSync(dirname(path), { recursive: true, mode: 0o755 });
|
|
283
|
+
const tmp = `${path}.restore-tmp`;
|
|
284
|
+
rmSync(tmp, { force: true });
|
|
285
|
+
const fd = openSync(tmp, "wx", 0o644);
|
|
286
|
+
try {
|
|
287
|
+
writeSync(fd, want);
|
|
288
|
+
fsyncSync(fd);
|
|
289
|
+
}
|
|
290
|
+
finally {
|
|
291
|
+
closeSync(fd);
|
|
292
|
+
}
|
|
293
|
+
renameSync(tmp, path);
|
|
294
|
+
fsyncPath(dirname(path));
|
|
295
|
+
fsyncPath(dirname(dirname(path)));
|
|
296
|
+
}
|
|
297
|
+
steps.record("unit-route-kept");
|
|
298
|
+
}
|
|
299
|
+
if (!opts.keepRoute && service.kind === "systemd" && !steps.done("unit-route-removed")) {
|
|
300
|
+
const removed = removeRecoveryRoute(home, attempt, { plistArgs: opts.plistArgs });
|
|
301
|
+
if (!removed.ok)
|
|
302
|
+
throw new Manual(removed.reason);
|
|
303
|
+
steps.record("unit-route-removed");
|
|
304
|
+
}
|
|
305
|
+
if (!steps.done("unit-reloaded")) {
|
|
306
|
+
if (!opts.reload())
|
|
307
|
+
return { ok: false, manual: false, reason: `the service manager couldn't reload ${basename(service.fragmentPath)}; retry` };
|
|
308
|
+
steps.record("unit-reloaded");
|
|
309
|
+
}
|
|
310
|
+
return { ok: true };
|
|
311
|
+
}
|
|
312
|
+
catch (err) {
|
|
313
|
+
if (err instanceof Manual)
|
|
314
|
+
return { ok: false, manual: true, reason: err.message };
|
|
315
|
+
throw err;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
//# sourceMappingURL=update-package-restore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-package-restore.js","sourceRoot":"","sources":["../src/update-package-restore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EACpI,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACtH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;A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CAAC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;gBAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,uCAAuC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC;YAChJ,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,MAAM;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QACnF,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { type AttemptRecord, type InboxSource, type JournalIo, type JournalRead, type Stage } from "./update-journal.js";
|
|
2
|
+
export declare const DEFAULT_MAX_IDLE_WAIT_MS: number;
|
|
3
|
+
/** What the card offers again after a honoured cancel or an honoured idle timeout (§3.3 step 2.4). */
|
|
4
|
+
export declare const HONOURED_CANCEL_ACTIONS: readonly ["Update now", "Keep waiting"];
|
|
5
|
+
/** What the card says when a cancel is consumed after the snapshot (#4491 §2.6). */
|
|
6
|
+
export declare const TOO_LATE_CANCEL = "too late to cancel: the update is past the point of no return";
|
|
7
|
+
/** Class Self, and both versions speak the transaction. Otherwise the caller stays on Phase 1. */
|
|
8
|
+
export declare function usesQuiescenceBarrier(tx: {
|
|
9
|
+
txClass: string;
|
|
10
|
+
from: number;
|
|
11
|
+
to: number;
|
|
12
|
+
vTx: number;
|
|
13
|
+
}): boolean;
|
|
14
|
+
/** Control commands and admin edits are not agent turns. `/stop` and `/restart` are in this set too. */
|
|
15
|
+
export declare function skipsAgentFence(kind: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The service lock (#4491 §3.4), as a reader of the journal. An open, unknown, or manual attempt refuses
|
|
18
|
+
* `start` / `stop` / `restart` / `service install` (and chat `/stop` and `/restart`). `/status`, `/cancel`,
|
|
19
|
+
* `/update`, the card's cancel, and an admin edit do not take that lock. A closing attempt has already released it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function serviceCommandRefusal(read: JournalRead, kind: string): {
|
|
22
|
+
refused: true;
|
|
23
|
+
id: string;
|
|
24
|
+
stage: string;
|
|
25
|
+
} | {
|
|
26
|
+
refused: false;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* What a state-writing command does after it takes the state lease and reads `current` (#4491 §4.2).
|
|
30
|
+
* Refused while `current` names an open, unknown, or manual attempt. Admitted once `current` is gone.
|
|
31
|
+
*/
|
|
32
|
+
export declare function stateWriteRefused(read: JournalRead): boolean;
|
|
33
|
+
export declare function cardAfterHonouredCancel(): {
|
|
34
|
+
status: "waiting";
|
|
35
|
+
actions: readonly ["Update now", "Keep waiting"];
|
|
36
|
+
};
|
|
37
|
+
/** The card is cancellable while the attempt is still `opened` (the wait, once published) or `barrier`. */
|
|
38
|
+
export declare function cancelAllowed(stage: Stage): boolean;
|
|
39
|
+
export interface BarrierAgent {
|
|
40
|
+
process: string;
|
|
41
|
+
/** The daemon's own process status, for the paused-and-stopped skip `hubUpdateIdle` already uses. */
|
|
42
|
+
daemonProcess?: string;
|
|
43
|
+
execution: string;
|
|
44
|
+
phase?: string;
|
|
45
|
+
workerBusy?: boolean;
|
|
46
|
+
workerInFlight?: boolean;
|
|
47
|
+
restartInFlight?: boolean;
|
|
48
|
+
stopInFlight?: boolean;
|
|
49
|
+
handOffInFlight?: boolean;
|
|
50
|
+
ipcConnectInFlight?: boolean;
|
|
51
|
+
pendingIdleGated?: boolean;
|
|
52
|
+
webEchoTail?: boolean;
|
|
53
|
+
workLease?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* One synchronous look at the fleet. `pending` is every outbox row `claimNext` could claim (queued or retry_wait,
|
|
57
|
+
* not in flight), in any order. `scheduleInRun` is true when a schedule is already inside `runWithLock`: that is
|
|
58
|
+
* not busy, and the check does not stop it.
|
|
59
|
+
*/
|
|
60
|
+
export interface BarrierSnapshot {
|
|
61
|
+
pin: boolean;
|
|
62
|
+
inPause: boolean;
|
|
63
|
+
startupComplete: boolean;
|
|
64
|
+
shuttingDown: boolean;
|
|
65
|
+
reconcileInFlight: boolean;
|
|
66
|
+
anotherClaim: boolean;
|
|
67
|
+
scheduleInRun: boolean;
|
|
68
|
+
outboxInFlight: boolean;
|
|
69
|
+
agents: BarrierAgent[];
|
|
70
|
+
pending: Array<{
|
|
71
|
+
deliveryId: string;
|
|
72
|
+
createdSeq: number;
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
export type BarrierRefusal = "pin" | "pause" | "shutdown" | "reconcile" | "claim" | "starting";
|
|
76
|
+
/** Pin, pause, shutdown, a reconcile, another claim, and a fleet still starting refuse the attempt. They are not "busy". */
|
|
77
|
+
export declare function barrierRefusal(snap: BarrierSnapshot): BarrierRefusal | null;
|
|
78
|
+
/**
|
|
79
|
+
* Sibling of `hubUpdateIdle`. The same agent loop, except `phase === "waiting"` counts as idle. A schedule already
|
|
80
|
+
* inside `runWithLock` is not consulted: `scheduleInRun` does not fail this check.
|
|
81
|
+
*/
|
|
82
|
+
export declare function barrierIdle(snap: BarrierSnapshot): boolean;
|
|
83
|
+
/** A pane payload that would start or continue an agent turn. Schedule triggers and control commands are not. */
|
|
84
|
+
export declare function isAgentTurn(payload: Record<string, unknown>): boolean;
|
|
85
|
+
export declare function turnSource(payload: Record<string, unknown>): InboxSource;
|
|
86
|
+
/**
|
|
87
|
+
* The four commit points call this. Unarmed, every method allows the write. Armed, a claim or a turn is journaled
|
|
88
|
+
* and not committed; a task claim is refused and is not a file.
|
|
89
|
+
*/
|
|
90
|
+
export interface QuiescenceGate {
|
|
91
|
+
armed(): boolean;
|
|
92
|
+
/** True: do not claim. A delivery id already in the sequence is not written again. */
|
|
93
|
+
holdOutboxClaim(deliveryId: string, createdSeq: number): boolean;
|
|
94
|
+
/** True: the occurrence is deferred. Do not call `onTrigger`, `markHandled`, or delete the row. */
|
|
95
|
+
holdSchedule(scheduleId: string, runId: string): boolean;
|
|
96
|
+
/** True: do not write the claim. Nothing is journaled. */
|
|
97
|
+
holdTaskClaim(): boolean;
|
|
98
|
+
/** After `admitDurableDelivery` inserts a row. The row stays; this writes a reference. */
|
|
99
|
+
noteAdmission(deliveryId: string, createdSeq: number): void;
|
|
100
|
+
/**
|
|
101
|
+
* True: an adapter or web turn was journaled as a copy and must not be sent.
|
|
102
|
+
* A Hub or room payload is not a copy. The producer leaves that row queued, and the caller must not send it.
|
|
103
|
+
*/
|
|
104
|
+
commitTurn(payload: Record<string, unknown>): boolean;
|
|
105
|
+
}
|
|
106
|
+
export interface HandbackPorts {
|
|
107
|
+
log(fields: {
|
|
108
|
+
deliveryId: string;
|
|
109
|
+
seq: number;
|
|
110
|
+
}, message: string): void;
|
|
111
|
+
lookup(deliveryId: string): {
|
|
112
|
+
state: string;
|
|
113
|
+
target: string;
|
|
114
|
+
} | null;
|
|
115
|
+
/** Claim this delivery id only. `ineligible` holds later entries for that same target. */
|
|
116
|
+
claim(deliveryId: string): "claimed" | "ineligible" | "settled" | "missing";
|
|
117
|
+
/** One insert under `sourceKey`. A replay returns the row the first insert created. */
|
|
118
|
+
admitCopy(sourceKey: string, body: unknown): {
|
|
119
|
+
deliveryId: string;
|
|
120
|
+
};
|
|
121
|
+
runDeferred(job: {
|
|
122
|
+
scheduleId: string;
|
|
123
|
+
runId: string;
|
|
124
|
+
}): void;
|
|
125
|
+
recordInterrupted(job: {
|
|
126
|
+
scheduleId: string;
|
|
127
|
+
runId: string;
|
|
128
|
+
}): void;
|
|
129
|
+
}
|
|
130
|
+
export type WaitResult = "ready" | "timeout" | "not-idle";
|
|
131
|
+
export interface WaitOpts {
|
|
132
|
+
maxMs: number;
|
|
133
|
+
pollMs: number;
|
|
134
|
+
idle: () => boolean;
|
|
135
|
+
sleep: (ms: number) => Promise<void>;
|
|
136
|
+
now?: () => number;
|
|
137
|
+
/** `agend update --now` and the card's Update now: one look, no sleep. */
|
|
138
|
+
once?: boolean;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The updater's close when the second check is busy or refused (#4493). The fleet was not stopped, so `restart-old`
|
|
142
|
+
* finds it running, hand-back has no files, and `finish` clears `current`. The fleet does not call this; the updater
|
|
143
|
+
* does, and only after the flag is already down.
|
|
144
|
+
*/
|
|
145
|
+
export declare function closeUnusedAttempt(home: string, attempt: AttemptRecord, io?: JournalIo): AttemptRecord;
|
|
146
|
+
export declare class QuiescenceBarrier implements QuiescenceGate {
|
|
147
|
+
private readonly home;
|
|
148
|
+
private readonly io;
|
|
149
|
+
private flag;
|
|
150
|
+
private seq;
|
|
151
|
+
private seen;
|
|
152
|
+
/** Deferred occurrences already on this attempt, so a re-offered run is not written twice. */
|
|
153
|
+
private deferred;
|
|
154
|
+
private attempt;
|
|
155
|
+
constructor(home: string, io?: JournalIo);
|
|
156
|
+
armed(): boolean;
|
|
157
|
+
attemptId(): string | null;
|
|
158
|
+
/** The updater has published `opened`. Reloads the sequence already on disk so a retry does not renumber it. */
|
|
159
|
+
bind(attempt: AttemptRecord): void;
|
|
160
|
+
/**
|
|
161
|
+
* Fence and check again, with no await. The flag is set, the predicate runs, and only then does this return.
|
|
162
|
+
* Busy or refused: the flag is cleared before any file is written. Idle: the outbox prefix is written while the
|
|
163
|
+
* attempt is still `opened`, and the flag stays up. This does not advance the stage.
|
|
164
|
+
*/
|
|
165
|
+
secondCheck(snap: BarrierSnapshot): "held" | "busy" | "refused";
|
|
166
|
+
/** The unfenced wait. The flag stays down, so a message that arrives here is delivered. */
|
|
167
|
+
waitForCandidate(opts: WaitOpts): Promise<WaitResult>;
|
|
168
|
+
holdOutboxClaim(deliveryId: string, createdSeq: number): boolean;
|
|
169
|
+
holdSchedule(scheduleId: string, runId: string): boolean;
|
|
170
|
+
holdTaskClaim(): boolean;
|
|
171
|
+
noteAdmission(deliveryId: string, createdSeq: number): void;
|
|
172
|
+
commitTurn(payload: Record<string, unknown>): boolean;
|
|
173
|
+
/**
|
|
174
|
+
* The card action `cancel`, only while the attempt is cancellable. Writing the marker does not abandon.
|
|
175
|
+
* `by` is the card's display label, the same kind Phase 1 stores on `lastAnswer.by`.
|
|
176
|
+
*/
|
|
177
|
+
requestCancel(attempt: AttemptRecord, cancel: {
|
|
178
|
+
reason: string;
|
|
179
|
+
by: string;
|
|
180
|
+
}): boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Hand-back, only at substep `hand-back`. Reconciles each entry with durable state before doing it again, and
|
|
183
|
+
* writes `.acked` only after that effect. A missing reference is logged, acknowledged, and the walk continues.
|
|
184
|
+
* An ineligible row holds later entries for the same target only.
|
|
185
|
+
*/
|
|
186
|
+
runHandback(attempt: AttemptRecord, ports: HandbackPorts): {
|
|
187
|
+
walked: boolean;
|
|
188
|
+
acked: number;
|
|
189
|
+
};
|
|
190
|
+
/** A reference, once. The journal sequence is the barrier's own counter; `createdSeq` stays the outbox's. */
|
|
191
|
+
private rememberReference;
|
|
192
|
+
}
|