@songsid/agend 2.4.0-beta.24 → 2.4.0-beta.26
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-endpoint.js +10 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-file-read.js +1 -1
- package/dist/agent-file-read.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/auth-api.js +3 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/antigravity.js +8 -6
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-code.js +17 -0
- package/dist/backend/claude-code.js.map +1 -1
- 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 +1 -1
- 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 +11 -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 +35 -0
- package/dist/daemon.js +234 -19
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +42 -1
- package/dist/delivery-outbox.js +198 -21
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-context.d.ts +8 -0
- package/dist/fleet-lock.d.ts +83 -2
- package/dist/fleet-lock.js +276 -2
- package/dist/fleet-lock.js.map +1 -1
- package/dist/fleet-manager.d.ts +183 -7
- package/dist/fleet-manager.js +1279 -78
- 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/cross-instance-messaging/SKILL.md +13 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +12 -1
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +3 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +21 -4
- 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/client.js +7 -0
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +5 -1
- package/dist/hub/compose/member.js +15 -6
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +1 -0
- package/dist/hub/compose/server.js +3 -2
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/http/compose.js +3 -2
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/deps.d.ts +1 -0
- package/dist/hub/member/room-ask.d.ts +12 -8
- package/dist/hub/member/room-ask.js +95 -29
- 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/room-reaction-acks.d.ts +12 -0
- package/dist/hub/member/room-reaction-acks.js +44 -0
- package/dist/hub/member/room-reaction-acks.js.map +1 -0
- 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/protocol.d.ts +4 -0
- package/dist/hub/protocol.js +2 -2
- package/dist/hub/protocol.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/hub/roles/audit-details.d.ts +2 -0
- package/dist/hub/roles/audit-details.js +1 -1
- package/dist/hub/roles/audit-details.js.map +1 -1
- package/dist/hub/roles/authority.d.ts +8 -3
- package/dist/hub/roles/authority.js +144 -102
- package/dist/hub/roles/authority.js.map +1 -1
- package/dist/hub/roles/delegation.js +2 -2
- package/dist/hub/roles/delegation.js.map +1 -1
- package/dist/hub/roles/model.d.ts +5 -2
- package/dist/hub/roles/model.js +5 -4
- package/dist/hub/roles/model.js.map +1 -1
- package/dist/hub/roles/review.js +2 -2
- package/dist/hub/roles/review.js.map +1 -1
- package/dist/hub/room-react-ack-model.d.ts +2 -0
- package/dist/hub/room-react-ack-model.js +3 -0
- package/dist/hub/room-react-ack-model.js.map +1 -0
- package/dist/hub/rooms/admin.d.ts +6 -0
- package/dist/hub/rooms/admin.js +33 -0
- package/dist/hub/rooms/admin.js.map +1 -1
- package/dist/hub/rooms/agents.d.ts +2 -0
- package/dist/hub/rooms/agents.js +44 -3
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +5 -1
- package/dist/hub/rooms/service.js +76 -24
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +2 -0
- package/dist/hub/server.js +6 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/types.d.ts +2 -0
- 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/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 +162 -6
- 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.d.ts +8 -0
- package/dist/needs-you.js +1 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-handlers.d.ts +12 -0
- package/dist/outbound-handlers.js +30 -2
- package/dist/outbound-handlers.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 +10 -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 +2638 -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 +87 -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-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-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 +2 -1
- package/dist/request-context-store.js +8 -1
- package/dist/request-context-store.js.map +1 -1
- 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/scheduler.d.ts +15 -0
- package/dist/scheduler/scheduler.js +45 -1
- package/dist/scheduler/scheduler.js.map +1 -1
- package/dist/scheduler/scheduler.test.js +17 -0
- package/dist/scheduler/scheduler.test.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +4 -0
- package/dist/scheduler/task-board.js +6 -0
- package/dist/scheduler/task-board.js.map +1 -1
- 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 +6 -0
- package/dist/settings-api.js +107 -0
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.js +14 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.js +11 -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/tmux-binary.js +1 -1
- package/dist/tmux-binary.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 +7 -0
- package/dist/ui/chat-store.js +5 -4
- package/dist/ui/contact-auth-strings.js +7 -2
- package/dist/ui/contact-permissions.js +10 -2
- package/dist/ui/fleet-office-card.js +15 -2
- package/dist/ui/fleet-office-pack.d.ts +2 -2
- package/dist/ui/fleet-office-pack.js +25 -8
- package/dist/ui/fleet-office-skin.js +33 -9
- package/dist/ui/fleet-office-vehicles.js +28 -11
- package/dist/ui/fleet-office-zones.js +10 -5
- package/dist/ui/fleet-office.js +158 -20
- package/dist/ui/fleet-task-files.js +1 -1
- package/dist/ui/hub-admin-rooms-strings.js +6 -2
- package/dist/ui/hub-admin-rooms.js +3 -1
- package/dist/ui/hub-group-search.js +2 -2
- package/dist/ui/hub-notify-keep.js +49 -0
- package/dist/ui/hub-role-view.js +1 -1
- package/dist/ui/hub-roles-strings.js +14 -10
- package/dist/ui/hub-roles.js +1 -1
- package/dist/ui/hub-room-notify.js +2 -1
- package/dist/ui/hub-room-strings.js +3 -3
- package/dist/ui/hub-room-thread.js +9 -4
- package/dist/ui/panel-chat.js +15 -2
- package/dist/ui/panel-hub.js +3 -2
- package/dist/ui/panel-needs.js +35 -7
- package/dist/ui/panel-settings.js +22 -8
- package/dist/ui/settings-preview-address.js +156 -0
- package/dist/ui/settings-registry.js +2 -0
- package/dist/ui/settings-strings.js +6 -6
- package/dist/ui/settings-update.js +13 -0
- package/dist/ui/shared/app-install.js +123 -0
- package/dist/ui/shared/app-shell.js +4 -2
- package/dist/ui/shared/app-update.js +16 -2
- package/dist/ui/shared/app.css +119 -2
- package/dist/ui/shared/app.js +3 -0
- package/dist/ui/shared/chat-strings.js +6 -2
- package/dist/ui/shared/chat-thread.js +7 -1
- package/dist/ui/shared/hub-chat.css +6 -0
- package/dist/ui/shared/preview-panel.js +1 -1
- package/dist/ui/shared/preview.js +11 -2
- package/dist/ui/shared/tokens.css +18 -3
- package/dist/ui/shared/ui-confirm.js +7 -5
- package/dist/ui/shared/ui-icons.js +2 -0
- package/dist/ui/shared/update-card-ui.js +419 -0
- 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-abandon.d.ts +26 -0
- package/dist/update-abandon.js +111 -0
- package/dist/update-abandon.js.map +1 -0
- 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 +59 -0
- package/dist/update-forward.js +227 -0
- package/dist/update-forward.js.map +1 -0
- package/dist/update-goback.d.ts +90 -0
- package/dist/update-goback.js +260 -0
- package/dist/update-goback.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 +359 -0
- package/dist/update-journal.js +723 -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 +84 -0
- package/dist/update-package-restore.js +329 -0
- package/dist/update-package-restore.js.map +1 -0
- package/dist/update-quiescence.d.ts +221 -0
- package/dist/update-quiescence.js +370 -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 +134 -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 +62 -0
- package/dist/update-recovery/runner.js +229 -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 +50 -0
- package/dist/update-restore.js +360 -0
- package/dist/update-restore.js.map +1 -0
- package/dist/update-retained.d.ts +65 -0
- package/dist/update-retained.js +116 -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 +63 -0
- package/dist/update-settings.js +162 -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 +173 -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 +3 -0
- package/dist/web-api.js +43 -8
- 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-icons.d.ts +11 -0
- package/dist/web-icons.js +14 -2
- package/dist/web-icons.js.map +1 -1
- package/dist/web-mentions.d.ts +27 -8
- package/dist/web-mentions.js +108 -1
- package/dist/web-mentions.js.map +1 -1
- package/dist/web-office-acts.js +3 -0
- package/dist/web-office-acts.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-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/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 +4 -3
- package/scripts/preinstall-guard.cjs +1 -1
package/dist/cli.js
CHANGED
|
@@ -19,12 +19,19 @@ import { Command, Option } from "commander";
|
|
|
19
19
|
import { registerBuildInfoCommand } from "./build-provenance-cli.js";
|
|
20
20
|
import { launchdServiceDomain } from "./launchd-service-domain.js";
|
|
21
21
|
import { registerBugReportCommand } from "./bug-report-cli.js";
|
|
22
|
-
import { join, dirname } from "node:path";
|
|
22
|
+
import { join, dirname, parse } from "node:path";
|
|
23
23
|
import { SchedulerDb } from "./scheduler/db.js";
|
|
24
24
|
import { Cron } from "croner";
|
|
25
25
|
import { existsSync, readFileSync, writeFileSync, appendFileSync, unlinkSync, mkdirSync, chmodSync, readdirSync, rmSync, statSync, realpathSync, openSync, writeSync, closeSync, } from "node:fs";
|
|
26
26
|
import { homedir, totalmem, freemem, userInfo } from "node:os";
|
|
27
27
|
import { fileURLToPath } from "node:url";
|
|
28
|
+
import { createRequire } from "node:module";
|
|
29
|
+
import { randomBytes } from "node:crypto";
|
|
30
|
+
import { acquireHomeUpdateLock, admitFleetStart, installPrefixOf } from "./home-update-lock.js";
|
|
31
|
+
import { admitServiceCommand } from "./service-lock.js";
|
|
32
|
+
import { claimHandoff, fleetStartGate } from "./update-journal.js";
|
|
33
|
+
import { takeSharedLease } from "./state-lease.js";
|
|
34
|
+
import { ensureAgendHome } from "./agend-home.js";
|
|
28
35
|
import { spawnSync, execSync, execFileSync } from "node:child_process";
|
|
29
36
|
import { spawn } from "./child-process.js";
|
|
30
37
|
import { getAgendHome, isDefaultAgendHome, realDefaultAgendHome } from "./paths.js";
|
|
@@ -34,7 +41,7 @@ import { COMPLETION_SHELLS, completionScript } from "./completion.js";
|
|
|
34
41
|
import { getUpdateSelector, isExactVersion, isUnrequestedDowngrade, downgradeRefusal, lookupTargetVersion, reportUpdateRestart, shouldSkipUpdate, runningFleetPredatesInstall, fleetProvenStopped, readFleetPidEvidence, pidAlive, processStartMs, } from "./update-check.js";
|
|
35
42
|
import { clearUpdateMarker, markUpdateInProgress, readUpdateProgress, setUpdateProgressStage } from "./update-marker.js";
|
|
36
43
|
import { describeSignalSource, forceAllowed, gateFleetControl, recordInstanceControl, withOrigin } from "./fleet-control-audit.js";
|
|
37
|
-
import { dropUpdateNpmBounds, withoutUpdateNpmBounds } from "./update-npm-env.js";
|
|
44
|
+
import { dropUpdateNpmBounds, npmAllowScripts, npmGlobalPrefix, withoutUpdateNpmBounds } from "./update-npm-env.js";
|
|
38
45
|
import { FLEET_STOP_TIMEOUT_MS, stopDetachedOwner, systemdStopTimeoutMs, detachedProcessStart, detachedProcessExited } from "./fleet-stop-budget.js";
|
|
39
46
|
import { fleetServiceOwner } from "./fleet-service-owner.js";
|
|
40
47
|
import { acquireFleetLock, isFleetStartCommandLine, readProcessCommandLine, releaseProcessFleetLock, setProcessFleetLock } from "./fleet-lock.js";
|
|
@@ -170,9 +177,105 @@ program.hook("preAction", async (_hooked, action) => {
|
|
|
170
177
|
}
|
|
171
178
|
catch { /* the banner never stands in a command's way */ }
|
|
172
179
|
});
|
|
180
|
+
/**
|
|
181
|
+
* M-3770 (#4480 §4.2): before claiming fleet.lock, take the home update lock: another install's update in progress on
|
|
182
|
+
* this home keeps this fleet from starting (its own update's restart goes through). Sync, like the claim it guards.
|
|
183
|
+
*/
|
|
184
|
+
function admitAgainstHomeUpdate() {
|
|
185
|
+
try {
|
|
186
|
+
ensureAgendHome(DATA_DIR); // as acquireFleetLock does next: the lock lives in it
|
|
187
|
+
const admission = createRequire(import.meta.url)("../launcher/install-admission.cjs");
|
|
188
|
+
const ownPrefix = installPrefixOf(fileURLToPath(new URL("..", import.meta.url)));
|
|
189
|
+
const admitted = admitFleetStart(DATA_DIR, ownPrefix, {
|
|
190
|
+
pid: process.pid, processStart: admission.processStart, startTicks: admission.startTicks, bootId: admission.bootId,
|
|
191
|
+
newToken: () => randomBytes(16).toString("hex"), now: () => new Date(), log: message => console.log(message),
|
|
192
|
+
});
|
|
193
|
+
if (!admitted.ok) {
|
|
194
|
+
console.error(admitted.reason);
|
|
195
|
+
process.exitCode = 1;
|
|
196
|
+
return { ok: false };
|
|
197
|
+
}
|
|
198
|
+
if (admitted.note)
|
|
199
|
+
console.log(` Home update lock: ${admitted.note}.`);
|
|
200
|
+
return { ok: true, release: admitted.release };
|
|
201
|
+
}
|
|
202
|
+
catch (err) {
|
|
203
|
+
// The lock's own failure never keeps a fleet down: fleet.lock still keeps one fleet per home.
|
|
204
|
+
console.log(` Home update lock not checked (${err.message}).`);
|
|
205
|
+
return { ok: true, release: () => { } };
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* M-3770 (design update-transaction §3.4): a service command takes the service lock for its run, and is refused at once
|
|
210
|
+
* while a live update holds it (admitted only with the updater's token). Released when this process exits.
|
|
211
|
+
*/
|
|
212
|
+
function guardServiceCommand(command) {
|
|
213
|
+
try {
|
|
214
|
+
const admission = createRequire(import.meta.url)("../launcher/install-admission.cjs");
|
|
215
|
+
const admitted = admitServiceCommand(DATA_DIR, command, {
|
|
216
|
+
pid: process.pid, processStart: admission.processStart, startTicks: admission.startTicks, bootId: admission.bootId,
|
|
217
|
+
newToken: () => randomBytes(16).toString("hex"), now: () => new Date(), log: message => console.log(message),
|
|
218
|
+
});
|
|
219
|
+
if (!admitted.ok) {
|
|
220
|
+
console.error(admitted.reason);
|
|
221
|
+
process.exitCode = 1;
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
process.once("exit", () => admitted.release());
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
catch (err) {
|
|
228
|
+
console.error(`\`agend ${command}\` is refused: the service lock could not be checked (${err.message}).`);
|
|
229
|
+
process.exitCode = 1;
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* M-3770 (design update-transaction §4.2 step 3): a state-writing command holds the state lease for its whole run, and
|
|
235
|
+
* is refused while an update is in progress. Released when this process exits.
|
|
236
|
+
*/
|
|
237
|
+
function holdStateLease(command) {
|
|
238
|
+
const taken = takeSharedLease(DATA_DIR, command);
|
|
239
|
+
if (!taken.ok) {
|
|
240
|
+
console.error(taken.reason);
|
|
241
|
+
process.exit(1);
|
|
242
|
+
}
|
|
243
|
+
process.once("exit", () => taken.lease.release());
|
|
244
|
+
}
|
|
245
|
+
/** The CLI's only way to open scheduler.db (it migrates on open, so even a read writes): under the state lease. */
|
|
246
|
+
function openCliSchedulerDb() {
|
|
247
|
+
holdStateLease("schedule");
|
|
248
|
+
return new SchedulerDb(join(DATA_DIR, "scheduler.db"));
|
|
249
|
+
}
|
|
173
250
|
function claimFleetSingleton() {
|
|
251
|
+
const home = admitAgainstHomeUpdate();
|
|
252
|
+
if (!home.ok)
|
|
253
|
+
return false;
|
|
174
254
|
try {
|
|
175
|
-
|
|
255
|
+
// M-3770 §4.3, §7: the journal first — an open, unknown or manual attempt refuses every start but the attempt's own
|
|
256
|
+
// (its planned nonce, AGEND_UPDATE_HANDOFF, while its updater lives). That start then takes the fence over by the
|
|
257
|
+
// journal's single-use claim.
|
|
258
|
+
const admission = createRequire(import.meta.url)("../launcher/install-admission.cjs");
|
|
259
|
+
const liveness = { processStart: admission.processStart, startTicks: admission.startTicks, bootId: admission.bootId };
|
|
260
|
+
const gate = fleetStartGate(DATA_DIR, process.env.AGEND_UPDATE_HANDOFF ?? null, liveness);
|
|
261
|
+
if (!gate.ok)
|
|
262
|
+
throw new Error(gate.reason);
|
|
263
|
+
// §7 (rev 13; Fable #4533): an interrupted commit is this start's to finish with the fleet's commit hands
|
|
264
|
+
// (`resumeCommitting`). Until those hands exist, it is refused, never admitted as a plain start that leaves the attempt
|
|
265
|
+
// committing for good. The `agend update` wiring replaces this refusal with the resumeCommitting(...) call.
|
|
266
|
+
if (gate.resumeCommitting)
|
|
267
|
+
throw new Error(`This fleet start is refused: update attempt ${gate.resumeCommitting} is committing, and this build can't finish it yet. Run \`agend update --resolve\`.`);
|
|
268
|
+
setProcessFleetLock(acquireFleetLock(DATA_DIR, {
|
|
269
|
+
claimHandoff: (attemptId, nonce, pid) => {
|
|
270
|
+
const processStart = admission.processStart(pid);
|
|
271
|
+
if (!processStart)
|
|
272
|
+
return false;
|
|
273
|
+
const ticks = admission.startTicks(pid), boot = admission.bootId();
|
|
274
|
+
const start = { processStart, ...(ticks !== null && boot !== null ? { startTicks: ticks, bootId: boot } : {}) };
|
|
275
|
+
return claimHandoff(DATA_DIR, attemptId, nonce, { pid, start }, liveness);
|
|
276
|
+
},
|
|
277
|
+
}));
|
|
278
|
+
home.release();
|
|
176
279
|
process.once("exit", () => { releaseProcessFleetLock(); });
|
|
177
280
|
// Before anything is spawned, so a tmux server the fleet starts inherits it
|
|
178
281
|
// (each CLI launch also sets it in its pane: coredumpFilterLaunchPrefix).
|
|
@@ -180,6 +283,7 @@ function claimFleetSingleton() {
|
|
|
180
283
|
return true;
|
|
181
284
|
}
|
|
182
285
|
catch (err) {
|
|
286
|
+
home.release();
|
|
183
287
|
console.error(err.message);
|
|
184
288
|
process.exitCode = 1;
|
|
185
289
|
return false;
|
|
@@ -1270,6 +1374,7 @@ topic
|
|
|
1270
1374
|
console.error(`Instance "${instance}" not found in fleet config`);
|
|
1271
1375
|
process.exit(1);
|
|
1272
1376
|
}
|
|
1377
|
+
holdStateLease("topic");
|
|
1273
1378
|
applyFleetYamlPatches(FLEET_CONFIG_PATH, [{ path: ["instances", instance, "topic_id"], value: topicId }]);
|
|
1274
1379
|
console.log(`Bound ${instance} \u2192 topic #${topicId}`);
|
|
1275
1380
|
});
|
|
@@ -1285,6 +1390,7 @@ topic
|
|
|
1285
1390
|
console.error(`Instance "${instance}" not found in fleet config`);
|
|
1286
1391
|
process.exit(1);
|
|
1287
1392
|
}
|
|
1393
|
+
holdStateLease("topic");
|
|
1288
1394
|
applyFleetYamlPatches(FLEET_CONFIG_PATH, [{ path: ["instances", instance, "topic_id"], remove: true }]);
|
|
1289
1395
|
console.log(`Unbound ${instance} from topic`);
|
|
1290
1396
|
});
|
|
@@ -1418,10 +1524,19 @@ program
|
|
|
1418
1524
|
// and its `npm install -g`) gives up on a silent connection instead of waiting minutes per try — set once, in this
|
|
1419
1525
|
// process's environment, for each key nobody set (a person's .npmrc, variable or flag is kept, whatever its value).
|
|
1420
1526
|
{
|
|
1421
|
-
const { applyUpdateNpmBounds, npmConfigQuery, parseNpmConfigLs, registryStop, updateRegistry } = await import("./update-npm-env.js");
|
|
1527
|
+
const { applyUpdateAllowScripts, applyUpdateNpmBounds, npmConfigQuery, parseNpmConfigLs, registryStop, scriptsIgnoredStop, updateRegistry, updateScriptsIgnored } = await import("./update-npm-env.js");
|
|
1422
1528
|
const listed = spawnSync("npm", npmConfigQuery(), { encoding: "utf-8", timeout: 15_000, stdio: ["ignore", "pipe", "ignore"] });
|
|
1423
1529
|
const explicit = listed.status === 0 ? parseNpmConfigLs(listed.stdout ?? "") : null;
|
|
1530
|
+
// M-3805: npm set to skip install scripts would install a release that cannot start: stop before anything changes.
|
|
1531
|
+
if (updateScriptsIgnored(process.env, explicit)) {
|
|
1532
|
+
const stop = scriptsIgnoredStop();
|
|
1533
|
+
console.error(`\n${stop}\n`);
|
|
1534
|
+
setUpdateProgressStage(DATA_DIR, "failed", { error: stop.trim() });
|
|
1535
|
+
process.exitCode = 1;
|
|
1536
|
+
return;
|
|
1537
|
+
}
|
|
1424
1538
|
applyUpdateNpmBounds(process.env, explicit);
|
|
1539
|
+
applyUpdateAllowScripts(process.env, explicit); // M-3805: npm 12 runs AgEnD's install scripts only when allowed
|
|
1425
1540
|
// With the network gone npm answers the version lookup from its stale cache, and the install then fails as a version
|
|
1426
1541
|
// that does not exist. Ask the registry AgEnD comes from (the @songsid scope's, never a cache) first: unreachable →
|
|
1427
1542
|
// stop here, nothing changed. Its config unreadable: nothing is asked, the update goes on as before.
|
|
@@ -1677,13 +1792,13 @@ program
|
|
|
1677
1792
|
const { verifyInstalledPackage } = await import("./update-install.js");
|
|
1678
1793
|
const verified = verifyInstalledPackage({ pkg: `@songsid/agend@${pkgVersion}`, targetVersion: pkgVersion, viaNvm: false, nvmSh }, {
|
|
1679
1794
|
run: (command, args, options = {}) => {
|
|
1680
|
-
const result = spawnSync(command, args, { encoding: "utf-8", timeout: options.timeoutMs, stdio: ["ignore", "pipe", "pipe"] });
|
|
1795
|
+
const result = spawnSync(command, args, { encoding: "utf-8", timeout: options.timeoutMs, stdio: ["ignore", "pipe", "pipe"], ...(options.cwd ? { cwd: options.cwd } : {}) });
|
|
1681
1796
|
return { status: result.status, signal: result.signal, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
|
|
1682
1797
|
},
|
|
1683
1798
|
log: message => console.log(message),
|
|
1684
1799
|
});
|
|
1685
1800
|
if (!verified.ok) {
|
|
1686
|
-
const message = `${verified.message}\n Not restarting the fleet onto it. Reinstall a working version: npm install -g @songsid/agend@<version>`;
|
|
1801
|
+
const message = `${verified.message}\n Not restarting the fleet onto it. Reinstall a working version: npm install -g --allow-scripts=@songsid/agend @songsid/agend@<version>`;
|
|
1687
1802
|
console.error(message);
|
|
1688
1803
|
setUpdateProgressStage(DATA_DIR, "failed", { error: message.trim() });
|
|
1689
1804
|
process.exitCode = 1;
|
|
@@ -1739,7 +1854,22 @@ program
|
|
|
1739
1854
|
// ── Check if npm global needs sudo (read-only; decides the nvm path the preflight judges) ──
|
|
1740
1855
|
let needsSudo = false;
|
|
1741
1856
|
try {
|
|
1742
|
-
|
|
1857
|
+
// M-3806: for a UUID in the path, `npm config get prefix` refuses (npm 10–12): read `npm prefix -g`, which npm
|
|
1858
|
+
// 11/12 print with `***`; that is asked the way npm tells a child, from the filesystem root (Fable #4526 F2).
|
|
1859
|
+
// No answer at all: as before, assume no sudo.
|
|
1860
|
+
const quiet = { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] };
|
|
1861
|
+
const said = (command, cwd) => { try {
|
|
1862
|
+
return execSync(command, cwd ? { ...quiet, cwd } : quiet);
|
|
1863
|
+
}
|
|
1864
|
+
catch {
|
|
1865
|
+
return "";
|
|
1866
|
+
} };
|
|
1867
|
+
let configured = said("npm config get prefix");
|
|
1868
|
+
if (!npmGlobalPrefix.lastLine(configured) || npmGlobalPrefix.masked(configured))
|
|
1869
|
+
configured = said("npm prefix -g");
|
|
1870
|
+
const prefix = npmGlobalPrefix.resolve(configured, undefined, () => said(`npm ${npmGlobalPrefix.ASK.slice(0, 2).join(" ")} "${npmGlobalPrefix.ASK[2]}"`, npmGlobalPrefix.neutralCwd())).prefix;
|
|
1871
|
+
if (!prefix)
|
|
1872
|
+
throw new Error("npm did not say where it installs global packages");
|
|
1743
1873
|
const { accessSync, constants } = await import("node:fs");
|
|
1744
1874
|
try {
|
|
1745
1875
|
accessSync(prefix, constants.W_OK);
|
|
@@ -1800,8 +1930,11 @@ program
|
|
|
1800
1930
|
markUpdateInProgress(DATA_DIR);
|
|
1801
1931
|
setUpdateProgressStage(DATA_DIR, "downloading", { version: targetVersion });
|
|
1802
1932
|
// AGEND_UPDATE_OWNER_PID: the marker this process just wrote is the installer's to carry on (and no one else's).
|
|
1933
|
+
// M-3812: from the filesystem (drive) root, never the folder `agend update` was started in. Inside a project npm
|
|
1934
|
+
// exec puts its node_modules/.bin first on PATH, and the installer would run on that project's own `node`. `pkg`
|
|
1935
|
+
// is a registry spec (an exact version), so it does not depend on the folder.
|
|
1803
1936
|
const installer = spawnSync("npm", ["exec", "--yes", "--package", pkg, "--", "agend-install", "--upgrade", "--target", targetVersion], {
|
|
1804
|
-
stdio: "inherit", env: { ...withOrigin("agend-update"), AGEND_UPDATE_OWNER_PID: String(process.pid) },
|
|
1937
|
+
stdio: "inherit", cwd: parse(process.cwd()).root, env: { ...withOrigin("agend-update"), AGEND_UPDATE_OWNER_PID: String(process.pid) },
|
|
1805
1938
|
});
|
|
1806
1939
|
if (installer.status === 0 || installer.status === 75) {
|
|
1807
1940
|
process.exitCode = installer.status ?? 0;
|
|
@@ -1871,13 +2004,34 @@ program
|
|
|
1871
2004
|
? { preflight: preflight.installPreflight(pkg, targetVersion, "the Node 22 nvm selected", { log: m => console.log(m), error: m => console.error(m) }) }
|
|
1872
2005
|
: {}),
|
|
1873
2006
|
lock: prefix => {
|
|
1874
|
-
const
|
|
2007
|
+
const lockDeps = {
|
|
1875
2008
|
pid: process.pid, processStart: admission.processStart, startTicks: admission.startTicks, bootId: admission.bootId, newToken: () => randomBytes(16).toString("hex"),
|
|
1876
|
-
now: () => new Date(), log: message => console.log(message),
|
|
1877
|
-
}
|
|
1878
|
-
|
|
2009
|
+
now: () => new Date(), log: (message) => console.log(message),
|
|
2010
|
+
};
|
|
2011
|
+
// M-3770 (#4480 §4.2): the home first — another install updating this home (a second prefix the prefix lock
|
|
2012
|
+
// never sees) refuses this one — then the prefix. Both are held until this process exits.
|
|
2013
|
+
let installPrefix = prefix;
|
|
2014
|
+
try {
|
|
2015
|
+
installPrefix = realpathSync(prefix);
|
|
2016
|
+
}
|
|
2017
|
+
catch { /* the prefix lock below says so */ }
|
|
2018
|
+
// A home no fleet has made yet (an update right after a fresh install) is made here, privately, as the fleet
|
|
2019
|
+
// lock makes it: the lock lives in it, and a missing home is no reason to refuse.
|
|
2020
|
+
try {
|
|
2021
|
+
ensureAgendHome(DATA_DIR);
|
|
2022
|
+
}
|
|
2023
|
+
catch (err) {
|
|
2024
|
+
return { ok: false, path: DATA_DIR, reason: `the AgEnD home ${DATA_DIR} could not be made (${err.message})` };
|
|
2025
|
+
}
|
|
2026
|
+
const home = acquireHomeUpdateLock(DATA_DIR, { spec: pkg, installPrefix }, lockDeps);
|
|
2027
|
+
if (!home.ok)
|
|
2028
|
+
return home;
|
|
2029
|
+
const lock = acquireInstallLock(prefix, { spec: pkg, agendHome: DATA_DIR }, lockDeps);
|
|
2030
|
+
if (!lock.ok) {
|
|
2031
|
+
home.release();
|
|
1879
2032
|
return lock;
|
|
1880
|
-
|
|
2033
|
+
}
|
|
2034
|
+
releaseLock = () => { lock.release(); home.release(); };
|
|
1881
2035
|
return { ok: true, token: lock.token };
|
|
1882
2036
|
},
|
|
1883
2037
|
}, {
|
|
@@ -1889,6 +2043,7 @@ program
|
|
|
1889
2043
|
timeout: options.timeoutMs,
|
|
1890
2044
|
stdio: options.inherit ? "inherit" : ["ignore", "pipe", "pipe"],
|
|
1891
2045
|
...(options.env ? { env: { ...process.env, ...options.env } } : {}),
|
|
2046
|
+
...(options.cwd ? { cwd: options.cwd } : {}),
|
|
1892
2047
|
});
|
|
1893
2048
|
return { status: result.status, signal: result.signal, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
|
|
1894
2049
|
},
|
|
@@ -1930,6 +2085,8 @@ program
|
|
|
1930
2085
|
.addOption(new Option("--activate").hideHelp())
|
|
1931
2086
|
.option("--no-activate", "Write the service file without activating it")
|
|
1932
2087
|
.action(async (opts) => {
|
|
2088
|
+
if (!guardServiceCommand("install"))
|
|
2089
|
+
return; // M-3770: not while an update owns the service
|
|
1933
2090
|
if (process.argv.includes("--activate")) {
|
|
1934
2091
|
console.error(t("cli.install_activate_removed"));
|
|
1935
2092
|
}
|
|
@@ -2155,6 +2312,8 @@ program
|
|
|
2155
2312
|
.action(async (opts) => {
|
|
2156
2313
|
if (!gateFleetControl(DATA_DIR, "stop", { yes: opts.yes }))
|
|
2157
2314
|
process.exit(1);
|
|
2315
|
+
if (!guardServiceCommand("stop"))
|
|
2316
|
+
return; // M-3770: not while an update owns the service
|
|
2158
2317
|
// #2481: a deliberate stop — the start attempts so far are not a crash loop.
|
|
2159
2318
|
{
|
|
2160
2319
|
const { clearStartAttempts } = await import("./start-failure.js");
|
|
@@ -2217,6 +2376,8 @@ program
|
|
|
2217
2376
|
.command("start")
|
|
2218
2377
|
.description("Start the AgEnD service, or start a detached fleet if no service is installed")
|
|
2219
2378
|
.action(async () => {
|
|
2379
|
+
if (!guardServiceCommand("start"))
|
|
2380
|
+
return; // M-3770: not while an update owns the service
|
|
2220
2381
|
const { getServicePath, getSystemServicePath, startService, startSystemService } = await import("./service-installer.js");
|
|
2221
2382
|
const userServicePath = getServicePath();
|
|
2222
2383
|
const systemServicePath = getSystemServicePath();
|
|
@@ -2316,6 +2477,8 @@ program
|
|
|
2316
2477
|
.option("-y, --yes", "Confirm when run from a fleet agent session (this affects every instance)")
|
|
2317
2478
|
.option("--force", "Restart even when the loaded service does not start this install on its selected Node (operators only)")
|
|
2318
2479
|
.action(async (instance, opts) => {
|
|
2480
|
+
if (!instance && !guardServiceCommand("restart"))
|
|
2481
|
+
return; // M-3770: the whole service, not while an update owns it
|
|
2319
2482
|
if (instance) {
|
|
2320
2483
|
if (opts.force) {
|
|
2321
2484
|
console.error(t("cli.force_whole_service"));
|
|
@@ -3103,7 +3266,7 @@ schedule
|
|
|
3103
3266
|
.option("--target <instance>", "Filter by target instance")
|
|
3104
3267
|
.option("--json", "Output as JSON")
|
|
3105
3268
|
.action((opts) => {
|
|
3106
|
-
const db =
|
|
3269
|
+
const db = openCliSchedulerDb();
|
|
3107
3270
|
try {
|
|
3108
3271
|
const schedules = db.list(opts.target);
|
|
3109
3272
|
if (opts.json) {
|
|
@@ -3140,7 +3303,7 @@ schedule
|
|
|
3140
3303
|
console.error(`Invalid cron expression: ${err.message}`);
|
|
3141
3304
|
process.exit(1);
|
|
3142
3305
|
}
|
|
3143
|
-
const db =
|
|
3306
|
+
const db = openCliSchedulerDb();
|
|
3144
3307
|
try {
|
|
3145
3308
|
const s = db.create({
|
|
3146
3309
|
cron: opts.cron,
|
|
@@ -3170,7 +3333,7 @@ schedule
|
|
|
3170
3333
|
.option("--timezone <tz>", "New timezone")
|
|
3171
3334
|
.option("--enabled <bool>", "Enable/disable (true/false)")
|
|
3172
3335
|
.action((id, opts) => {
|
|
3173
|
-
const db =
|
|
3336
|
+
const db = openCliSchedulerDb();
|
|
3174
3337
|
try {
|
|
3175
3338
|
const params = {};
|
|
3176
3339
|
if (opts.cron)
|
|
@@ -3198,7 +3361,7 @@ schedule
|
|
|
3198
3361
|
.description("Delete a schedule")
|
|
3199
3362
|
.argument("<id>", "Schedule ID")
|
|
3200
3363
|
.action((id) => {
|
|
3201
|
-
const db =
|
|
3364
|
+
const db = openCliSchedulerDb();
|
|
3202
3365
|
try {
|
|
3203
3366
|
db.delete(id);
|
|
3204
3367
|
console.log(`Deleted schedule ${id}`);
|
|
@@ -3213,7 +3376,7 @@ schedule
|
|
|
3213
3376
|
.description("Enable a schedule")
|
|
3214
3377
|
.argument("<id>", "Schedule ID")
|
|
3215
3378
|
.action((id) => {
|
|
3216
|
-
const db =
|
|
3379
|
+
const db = openCliSchedulerDb();
|
|
3217
3380
|
try {
|
|
3218
3381
|
db.update(id, { enabled: true });
|
|
3219
3382
|
console.log(`Enabled schedule ${id}`);
|
|
@@ -3228,7 +3391,7 @@ schedule
|
|
|
3228
3391
|
.description("Disable a schedule")
|
|
3229
3392
|
.argument("<id>", "Schedule ID")
|
|
3230
3393
|
.action((id) => {
|
|
3231
|
-
const db =
|
|
3394
|
+
const db = openCliSchedulerDb();
|
|
3232
3395
|
try {
|
|
3233
3396
|
db.update(id, { enabled: false });
|
|
3234
3397
|
console.log(`Disabled schedule ${id}`);
|
|
@@ -3244,7 +3407,7 @@ schedule
|
|
|
3244
3407
|
.argument("<id>", "Schedule ID")
|
|
3245
3408
|
.option("--limit <n>", "Number of runs to show", "20")
|
|
3246
3409
|
.action((id, opts) => {
|
|
3247
|
-
const db =
|
|
3410
|
+
const db = openCliSchedulerDb();
|
|
3248
3411
|
try {
|
|
3249
3412
|
const runs = db.getRuns(id, parseInt(opts.limit, 10));
|
|
3250
3413
|
if (runs.length === 0) {
|
|
@@ -4100,7 +4263,7 @@ program
|
|
|
4100
4263
|
}
|
|
4101
4264
|
return false;
|
|
4102
4265
|
},
|
|
4103
|
-
async install(v) { const r = spawnSync("npm", ["install", "-g",
|
|
4266
|
+
async install(v) { const spec = opts.package ?? `@songsid/agend@${v}`; const r = spawnSync("npm", ["install", "-g", spec, npmAllowScripts.flagFor(spec)], { stdio: "inherit" }); return { ok: r.status === 0, detail: `npm exited ${r.status ?? r.signal}` }; },
|
|
4104
4267
|
// The newly installed version's own `agend start` (the one now on PATH), never this process's code.
|
|
4105
4268
|
async startService() {
|
|
4106
4269
|
if (opts.start === false)
|