@songsid/agend 2.3.5-alpha.3 → 2.3.5-alpha.5
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/THIRD_PARTY_NOTICES.md +52 -0
- package/dist/accounts-view.d.ts +97 -0
- package/dist/accounts-view.js +116 -0
- package/dist/accounts-view.js.map +1 -0
- package/dist/agent-cli-instructions.md +1 -1
- package/dist/agent-credentials.d.ts +24 -0
- package/dist/agent-credentials.js +66 -0
- package/dist/agent-credentials.js.map +1 -0
- package/dist/agent-endpoint.d.ts +3 -1
- package/dist/agent-endpoint.js +13 -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-runtime-api.d.ts +4 -0
- package/dist/agent-runtime-api.js +59 -0
- package/dist/agent-runtime-api.js.map +1 -0
- package/dist/agent-runtime-change.d.ts +76 -0
- package/dist/agent-runtime-change.js +114 -0
- package/dist/agent-runtime-change.js.map +1 -0
- package/dist/agent-workspace.d.ts +93 -0
- package/dist/agent-workspace.js +353 -0
- package/dist/agent-workspace.js.map +1 -0
- package/dist/auth-api.d.ts +27 -0
- package/dist/auth-api.js +168 -3
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/session-authorizations.d.ts +28 -4
- package/dist/authority/session-authorizations.js +63 -17
- package/dist/authority/session-authorizations.js.map +1 -1
- package/dist/backend/antigravity.js +3 -1
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/codex-footer-hints.d.ts +7 -0
- package/dist/backend/codex-footer-hints.js +41 -0
- package/dist/backend/codex-footer-hints.js.map +1 -0
- package/dist/backend/codex-metadata.d.ts +14 -0
- package/dist/backend/codex-metadata.js +45 -0
- package/dist/backend/codex-metadata.js.map +1 -1
- package/dist/backend/codex-quota-history.d.ts +7 -0
- package/dist/backend/codex-quota-history.js +57 -0
- package/dist/backend/codex-quota-history.js.map +1 -0
- package/dist/backend/codex-session-lookup.d.ts +6 -0
- package/dist/backend/codex-session-lookup.js +1 -1
- package/dist/backend/codex-session-lookup.js.map +1 -1
- package/dist/backend/codex-speed.d.ts +14 -0
- package/dist/backend/codex-speed.js +35 -0
- package/dist/backend/codex-speed.js.map +1 -0
- package/dist/backend/codex.d.ts +7 -0
- package/dist/backend/codex.js +85 -24
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/grok-weekly-reset.d.ts +24 -0
- package/dist/backend/grok-weekly-reset.js +95 -0
- package/dist/backend/grok-weekly-reset.js.map +1 -0
- package/dist/backend/grok.d.ts +30 -1
- package/dist/backend/grok.js +301 -54
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro.d.ts +3 -0
- package/dist/backend/kiro.js +50 -2
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/muse.js +5 -3
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/native-pane.d.ts +3 -1
- package/dist/backend/native-pane.js +2 -2
- package/dist/backend/native-pane.js.map +1 -1
- package/dist/backend/types.d.ts +13 -1
- package/dist/backend/types.js +3 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance-cli.d.ts +3 -0
- package/dist/build-provenance-cli.js +11 -0
- package/dist/build-provenance-cli.js.map +1 -0
- package/dist/build-provenance.d.ts +20 -0
- package/dist/build-provenance.js +67 -0
- package/dist/build-provenance.js.map +1 -0
- package/dist/build-provenance.json +1 -0
- package/dist/cache-ledger.d.ts +95 -0
- package/dist/cache-ledger.js +276 -4
- package/dist/cache-ledger.js.map +1 -1
- package/dist/cache-service.d.ts +5 -0
- package/dist/cache-service.js +16 -4
- package/dist/cache-service.js.map +1 -1
- package/dist/channel/adapters/discord.js +11 -3
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +51 -0
- package/dist/channel/adapters/telegram.js +235 -17
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/mcp-tools.js +3 -3
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/types.d.ts +2 -0
- package/dist/claude-auth-status.d.ts +48 -0
- package/dist/claude-auth-status.js +149 -0
- package/dist/claude-auth-status.js.map +1 -0
- package/dist/cli.js +138 -37
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +21 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/cross-instance-notice.d.ts +10 -0
- package/dist/cross-instance-notice.js +67 -5
- package/dist/cross-instance-notice.js.map +1 -1
- package/dist/daemon.d.ts +70 -1
- package/dist/daemon.js +547 -25
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard-permissions.d.ts +8 -0
- package/dist/dashboard-permissions.js +16 -0
- package/dist/dashboard-permissions.js.map +1 -1
- package/dist/delivery-consumed-watch.d.ts +23 -1
- package/dist/delivery-consumed-watch.js +30 -3
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/delivery-reconciliation.d.ts +1 -1
- package/dist/delivery-reconciliation.js +1 -1
- package/dist/delivery-reconciliation.js.map +1 -1
- package/dist/doctor.js +20 -9
- package/dist/doctor.js.map +1 -1
- package/dist/export-import.d.ts +7 -0
- package/dist/export-import.js +44 -10
- package/dist/export-import.js.map +1 -1
- package/dist/fleet-context.d.ts +2 -0
- package/dist/fleet-manager.d.ts +362 -7
- package/dist/fleet-manager.js +1522 -91
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +8 -2
- package/dist/fleet-windows-runtime.js +93 -6
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +425 -0
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +5 -2
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +1 -0
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +2 -2
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +3 -1
- package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +41 -4
- package/dist/general-knowledge/skills/session-management/SKILL.md +1 -1
- package/dist/general-knowledge/skills/tui-effort/SKILL.md +10 -10
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +31 -15
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
- package/dist/general-role.d.ts +1 -1
- package/dist/general-role.js +1 -0
- package/dist/general-role.js.map +1 -1
- package/dist/hub/admission.d.ts +28 -0
- package/dist/hub/admission.js +62 -0
- package/dist/hub/admission.js.map +1 -0
- package/dist/hub/attachments/limits.d.ts +20 -0
- package/dist/hub/attachments/limits.js +48 -0
- package/dist/hub/attachments/limits.js.map +1 -0
- package/dist/hub/attachments/store.d.ts +116 -0
- package/dist/hub/attachments/store.js +246 -0
- package/dist/hub/attachments/store.js.map +1 -0
- package/dist/hub/audit/index.d.ts +62 -0
- package/dist/hub/audit/index.js +344 -0
- package/dist/hub/audit/index.js.map +1 -0
- package/dist/hub/browser-certificate.d.ts +38 -0
- package/dist/hub/browser-certificate.js +247 -0
- package/dist/hub/browser-certificate.js.map +1 -0
- package/dist/hub/buttons-model.d.ts +9 -0
- package/dist/hub/buttons-model.js +42 -0
- package/dist/hub/buttons-model.js.map +1 -0
- package/dist/hub/buttons.d.ts +54 -0
- package/dist/hub/buttons.js +346 -0
- package/dist/hub/buttons.js.map +1 -0
- package/dist/hub/catalog.d.ts +74 -0
- package/dist/hub/catalog.js +195 -0
- package/dist/hub/catalog.js.map +1 -0
- package/dist/hub/client.d.ts +69 -0
- package/dist/hub/client.js +300 -0
- package/dist/hub/client.js.map +1 -0
- package/dist/hub/compose/member.d.ts +139 -0
- package/dist/hub/compose/member.js +450 -0
- package/dist/hub/compose/member.js.map +1 -0
- package/dist/hub/compose/server.d.ts +77 -0
- package/dist/hub/compose/server.js +349 -0
- package/dist/hub/compose/server.js.map +1 -0
- package/dist/hub/compose/views.d.ts +12 -0
- package/dist/hub/compose/views.js +4 -0
- package/dist/hub/compose/views.js.map +1 -0
- package/dist/hub/db.d.ts +56 -0
- package/dist/hub/db.js +188 -0
- package/dist/hub/db.js.map +1 -0
- package/dist/hub/directory/config.d.ts +39 -0
- package/dist/hub/directory/config.js +108 -0
- package/dist/hub/directory/config.js.map +1 -0
- package/dist/hub/directory/directory.d.ts +18 -0
- package/dist/hub/directory/directory.js +320 -0
- package/dist/hub/directory/directory.js.map +1 -0
- package/dist/hub/directory/index.d.ts +7 -0
- package/dist/hub/directory/index.js +4 -0
- package/dist/hub/directory/index.js.map +1 -0
- package/dist/hub/directory/profiles.d.ts +41 -0
- package/dist/hub/directory/profiles.js +90 -0
- package/dist/hub/directory/profiles.js.map +1 -0
- package/dist/hub/directory/types.d.ts +71 -0
- package/dist/hub/directory/types.js +14 -0
- package/dist/hub/directory/types.js.map +1 -0
- package/dist/hub/execution/cli-provider.d.ts +23 -0
- package/dist/hub/execution/cli-provider.js +341 -0
- package/dist/hub/execution/cli-provider.js.map +1 -0
- package/dist/hub/execution/index.d.ts +13 -0
- package/dist/hub/execution/index.js +8 -0
- package/dist/hub/execution/index.js.map +1 -0
- package/dist/hub/execution/model-broker.d.ts +24 -0
- package/dist/hub/execution/model-broker.js +208 -0
- package/dist/hub/execution/model-broker.js.map +1 -0
- package/dist/hub/execution/provider-setup.d.ts +11 -0
- package/dist/hub/execution/provider-setup.js +21 -0
- package/dist/hub/execution/provider-setup.js.map +1 -0
- package/dist/hub/execution/sandbox-runner.d.ts +1 -0
- package/dist/hub/execution/sandbox-runner.js +221 -0
- package/dist/hub/execution/sandbox-runner.js.map +1 -0
- package/dist/hub/execution/service.d.ts +136 -0
- package/dist/hub/execution/service.js +459 -0
- package/dist/hub/execution/service.js.map +1 -0
- package/dist/hub/execution/store.d.ts +61 -0
- package/dist/hub/execution/store.js +182 -0
- package/dist/hub/execution/store.js.map +1 -0
- package/dist/hub/execution/views.d.ts +20 -0
- package/dist/hub/execution/views.js +48 -0
- package/dist/hub/execution/views.js.map +1 -0
- package/dist/hub/http/compose.d.ts +20 -0
- package/dist/hub/http/compose.js +518 -0
- package/dist/hub/http/compose.js.map +1 -0
- package/dist/hub/http/core.d.ts +49 -0
- package/dist/hub/http/core.js +124 -0
- package/dist/hub/http/core.js.map +1 -0
- package/dist/hub/http/deps.d.ts +61 -0
- package/dist/hub/http/deps.js +2 -0
- package/dist/hub/http/deps.js.map +1 -0
- package/dist/hub/http/schema.d.ts +14 -0
- package/dist/hub/http/schema.js +80 -0
- package/dist/hub/http/schema.js.map +1 -0
- package/dist/hub/identity.d.ts +32 -0
- package/dist/hub/identity.js +80 -0
- package/dist/hub/identity.js.map +1 -0
- package/dist/hub/init/browser-certificate.d.ts +9 -0
- package/dist/hub/init/browser-certificate.js +78 -0
- package/dist/hub/init/browser-certificate.js.map +1 -0
- package/dist/hub/init/browser-tls.d.ts +18 -0
- package/dist/hub/init/browser-tls.js +62 -0
- package/dist/hub/init/browser-tls.js.map +1 -0
- package/dist/hub/init/cli.d.ts +3 -0
- package/dist/hub/init/cli.js +83 -0
- package/dist/hub/init/cli.js.map +1 -0
- package/dist/hub/init/directory-certificate.d.ts +24 -0
- package/dist/hub/init/directory-certificate.js +222 -0
- package/dist/hub/init/directory-certificate.js.map +1 -0
- package/dist/hub/init/existing-fleet.d.ts +6 -0
- package/dist/hub/init/existing-fleet.js +58 -0
- package/dist/hub/init/existing-fleet.js.map +1 -0
- package/dist/hub/init/handoff.d.ts +8 -0
- package/dist/hub/init/handoff.js +36 -0
- package/dist/hub/init/handoff.js.map +1 -0
- package/dist/hub/init/identity.d.ts +5 -0
- package/dist/hub/init/identity.js +24 -0
- package/dist/hub/init/identity.js.map +1 -0
- package/dist/hub/init/initializer.d.ts +24 -0
- package/dist/hub/init/initializer.js +385 -0
- package/dist/hub/init/initializer.js.map +1 -0
- package/dist/hub/init/inventory.d.ts +17 -0
- package/dist/hub/init/inventory.js +33 -0
- package/dist/hub/init/inventory.js.map +1 -0
- package/dist/hub/init/layout.d.ts +32 -0
- package/dist/hub/init/layout.js +53 -0
- package/dist/hub/init/layout.js.map +1 -0
- package/dist/hub/init/network.d.ts +18 -0
- package/dist/hub/init/network.js +104 -0
- package/dist/hub/init/network.js.map +1 -0
- package/dist/hub/init/plan-digest.d.ts +5 -0
- package/dist/hub/init/plan-digest.js +47 -0
- package/dist/hub/init/plan-digest.js.map +1 -0
- package/dist/hub/init/prompt.d.ts +26 -0
- package/dist/hub/init/prompt.js +110 -0
- package/dist/hub/init/prompt.js.map +1 -0
- package/dist/hub/init/secret-file.d.ts +1 -0
- package/dist/hub/init/secret-file.js +59 -0
- package/dist/hub/init/secret-file.js.map +1 -0
- package/dist/hub/init/text.d.ts +127 -0
- package/dist/hub/init/text.js +247 -0
- package/dist/hub/init/text.js.map +1 -0
- package/dist/hub/init/types.d.ts +114 -0
- package/dist/hub/init/types.js +9 -0
- package/dist/hub/init/types.js.map +1 -0
- package/dist/hub/init/wizard.d.ts +34 -0
- package/dist/hub/init/wizard.js +554 -0
- package/dist/hub/init/wizard.js.map +1 -0
- package/dist/hub/initialization.d.ts +23 -0
- package/dist/hub/initialization.js +28 -0
- package/dist/hub/initialization.js.map +1 -0
- package/dist/hub/member/agent-mode.d.ts +6 -0
- package/dist/hub/member/agent-mode.js +23 -0
- package/dist/hub/member/agent-mode.js.map +1 -0
- package/dist/hub/member/attachments.d.ts +29 -0
- package/dist/hub/member/attachments.js +107 -0
- package/dist/hub/member/attachments.js.map +1 -0
- package/dist/hub/member/exposure-api.d.ts +87 -0
- package/dist/hub/member/exposure-api.js +64 -0
- package/dist/hub/member/exposure-api.js.map +1 -0
- package/dist/hub/member/exposures.d.ts +123 -0
- package/dist/hub/member/exposures.js +282 -0
- package/dist/hub/member/exposures.js.map +1 -0
- package/dist/hub/member/pairing-api.d.ts +85 -0
- package/dist/hub/member/pairing-api.js +385 -0
- package/dist/hub/member/pairing-api.js.map +1 -0
- package/dist/hub/member/quota.d.ts +20 -0
- package/dist/hub/member/quota.js +98 -0
- package/dist/hub/member/quota.js.map +1 -0
- package/dist/hub/member-journal.d.ts +104 -0
- package/dist/hub/member-journal.js +336 -0
- package/dist/hub/member-journal.js.map +1 -0
- package/dist/hub/member-reconciliation.d.ts +14 -0
- package/dist/hub/member-reconciliation.js +97 -0
- package/dist/hub/member-reconciliation.js.map +1 -0
- package/dist/hub/mount.d.ts +39 -0
- package/dist/hub/mount.js +123 -0
- package/dist/hub/mount.js.map +1 -0
- package/dist/hub/pairing-client.d.ts +17 -0
- package/dist/hub/pairing-client.js +108 -0
- package/dist/hub/pairing-client.js.map +1 -0
- package/dist/hub/pairing.d.ts +65 -0
- package/dist/hub/pairing.js +211 -0
- package/dist/hub/pairing.js.map +1 -0
- package/dist/hub/policy.d.ts +63 -0
- package/dist/hub/policy.js +147 -0
- package/dist/hub/policy.js.map +1 -0
- package/dist/hub/preview.d.ts +32 -0
- package/dist/hub/preview.js +64 -0
- package/dist/hub/preview.js.map +1 -0
- package/dist/hub/private-files.d.ts +5 -0
- package/dist/hub/private-files.js +44 -0
- package/dist/hub/private-files.js.map +1 -0
- package/dist/hub/profile.d.ts +59 -0
- package/dist/hub/profile.js +73 -0
- package/dist/hub/profile.js.map +1 -0
- package/dist/hub/protocol.d.ts +779 -0
- package/dist/hub/protocol.js +93 -0
- package/dist/hub/protocol.js.map +1 -0
- package/dist/hub/quota.d.ts +24 -0
- package/dist/hub/quota.js +112 -0
- package/dist/hub/quota.js.map +1 -0
- package/dist/hub/representative.d.ts +141 -0
- package/dist/hub/representative.js +528 -0
- package/dist/hub/representative.js.map +1 -0
- package/dist/hub/retention.d.ts +17 -0
- package/dist/hub/retention.js +45 -0
- package/dist/hub/retention.js.map +1 -0
- package/dist/hub/rooms.d.ts +120 -0
- package/dist/hub/rooms.js +535 -0
- package/dist/hub/rooms.js.map +1 -0
- package/dist/hub/runtime.d.ts +106 -0
- package/dist/hub/runtime.js +298 -0
- package/dist/hub/runtime.js.map +1 -0
- package/dist/hub/server.d.ts +56 -0
- package/dist/hub/server.js +202 -0
- package/dist/hub/server.js.map +1 -0
- package/dist/hub/service-start.d.ts +17 -0
- package/dist/hub/service-start.js +109 -0
- package/dist/hub/service-start.js.map +1 -0
- package/dist/hub/sessions.d.ts +53 -0
- package/dist/hub/sessions.js +196 -0
- package/dist/hub/sessions.js.map +1 -0
- package/dist/hub/socket.d.ts +24 -0
- package/dist/hub/socket.js +79 -0
- package/dist/hub/socket.js.map +1 -0
- package/dist/hub/store.d.ts +77 -0
- package/dist/hub/store.js +88 -0
- package/dist/hub/store.js.map +1 -0
- package/dist/hub/tls.d.ts +31 -0
- package/dist/hub/tls.js +135 -0
- package/dist/hub/tls.js.map +1 -0
- package/dist/hub/types.d.ts +401 -0
- package/dist/hub/types.js +2 -0
- package/dist/hub/types.js.map +1 -0
- package/dist/hub/validation.d.ts +33 -0
- package/dist/hub/validation.js +136 -0
- package/dist/hub/validation.js.map +1 -0
- package/dist/hub/version-floor.d.ts +10 -0
- package/dist/hub/version-floor.js +45 -0
- package/dist/hub/version-floor.js.map +1 -0
- package/dist/hub-browser-certificate-policy.d.ts +31 -0
- package/dist/hub-browser-certificate-policy.js +25 -0
- package/dist/hub-browser-certificate-policy.js.map +1 -0
- package/dist/hub-membership-settings.d.ts +6 -0
- package/dist/hub-membership-settings.js +21 -0
- package/dist/hub-membership-settings.js.map +1 -0
- package/dist/hub-mode.d.ts +15 -0
- package/dist/hub-mode.js +17 -0
- package/dist/hub-mode.js.map +1 -0
- package/dist/hub-pairing-summary.d.ts +48 -0
- package/dist/hub-pairing-summary.js +36 -0
- package/dist/hub-pairing-summary.js.map +1 -0
- package/dist/hub-report-target.d.ts +32 -0
- package/dist/hub-report-target.js +33 -0
- package/dist/hub-report-target.js.map +1 -0
- package/dist/hub-retention-policy.d.ts +14 -0
- package/dist/hub-retention-policy.js +15 -0
- package/dist/hub-retention-policy.js.map +1 -0
- package/dist/instance-config-impact.js +3 -0
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +17 -2
- package/dist/instance-lifecycle.js +58 -8
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instance-topic-delete.d.ts +77 -0
- package/dist/instance-topic-delete.js +123 -0
- package/dist/instance-topic-delete.js.map +1 -0
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.js +1 -1
- package/dist/instructions.js.map +1 -1
- package/dist/kiro-engine-status.d.ts +11 -0
- package/dist/kiro-engine-status.js +6 -0
- package/dist/kiro-engine-status.js.map +1 -1
- package/dist/launchd-service-domain.d.ts +5 -0
- package/dist/launchd-service-domain.js +21 -0
- package/dist/launchd-service-domain.js.map +1 -0
- package/dist/locale.js +125 -3
- package/dist/locale.js.map +1 -1
- package/dist/log-service.d.ts +28 -0
- package/dist/log-service.js +29 -0
- package/dist/log-service.js.map +1 -1
- package/dist/log-steps.d.ts +4 -3
- package/dist/log-steps.js +32 -7
- package/dist/log-steps.js.map +1 -1
- package/dist/logger.d.ts +16 -2
- package/dist/logger.js +346 -66
- package/dist/logger.js.map +1 -1
- package/dist/login-flows.d.ts +15 -7
- package/dist/login-flows.js +29 -3
- package/dist/login-flows.js.map +1 -1
- package/dist/login-manager.js +25 -4
- package/dist/login-manager.js.map +1 -1
- package/dist/ls-rows.js +3 -4
- package/dist/ls-rows.js.map +1 -1
- package/dist/missed-offline.d.ts +25 -0
- package/dist/missed-offline.js +79 -0
- package/dist/missed-offline.js.map +1 -0
- package/dist/native-instance-api.d.ts +0 -1
- package/dist/native-instance-api.js +15 -3
- package/dist/native-instance-api.js.map +1 -1
- package/dist/native-instance-input.d.ts +3 -0
- package/dist/native-instance-input.js +6 -1
- package/dist/native-instance-input.js.map +1 -1
- package/dist/native-instance-registry.d.ts +6 -0
- package/dist/native-instance-registry.js +24 -0
- package/dist/native-instance-registry.js.map +1 -1
- package/dist/native-mcp.d.ts +3 -0
- package/dist/native-mcp.js +15 -2
- package/dist/native-mcp.js.map +1 -1
- package/dist/native-pane-lifecycle.d.ts +8 -0
- package/dist/native-pane-lifecycle.js +13 -4
- package/dist/native-pane-lifecycle.js.map +1 -1
- package/dist/native-pane-manager.js +17 -9
- package/dist/native-pane-manager.js.map +1 -1
- package/dist/needs-you-hub.d.ts +9 -1
- package/dist/needs-you-hub.js +46 -8
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +47 -2
- package/dist/needs-you.js +31 -3
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +3 -3
- package/dist/office-share-page.js.map +1 -1
- package/dist/office-share.d.ts +11 -0
- package/dist/office-share.js +14 -0
- package/dist/office-share.js.map +1 -1
- package/dist/office-talk.d.ts +26 -0
- package/dist/office-talk.js +50 -0
- package/dist/office-talk.js.map +1 -0
- package/dist/outbound-handlers.d.ts +14 -0
- package/dist/outbound-handlers.js +49 -6
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +33 -1
- package/dist/outbound-schemas.js +29 -16
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-quota-history.d.ts +9 -0
- package/dist/pane-quota-history.js +67 -0
- package/dist/pane-quota-history.js.map +1 -0
- package/dist/pause-marker.d.ts +1 -1
- package/dist/pause-marker.js +1 -1
- package/dist/pause-marker.js.map +1 -1
- package/dist/platform-general.d.ts +46 -0
- package/dist/platform-general.js +91 -0
- package/dist/platform-general.js.map +1 -0
- package/dist/public-web-gateway.js +7 -0
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +6 -0
- package/dist/public-web-link.js +9 -0
- package/dist/public-web-link.js.map +1 -1
- package/dist/queued-handoffs.d.ts +33 -0
- package/dist/queued-handoffs.js +75 -0
- package/dist/queued-handoffs.js.map +1 -0
- package/dist/quickstart.d.ts +13 -0
- package/dist/quickstart.js +81 -5
- package/dist/quickstart.js.map +1 -1
- package/dist/quota-notice.d.ts +7 -0
- package/dist/quota-notice.js +40 -0
- package/dist/quota-notice.js.map +1 -1
- package/dist/reply-buttons-controller.js +10 -6
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/reply-polls.d.ts +2 -2
- package/dist/reply-polls.js +3 -3
- package/dist/reply-polls.js.map +1 -1
- package/dist/runtime-api.d.ts +2 -0
- package/dist/runtime-api.js +106 -13
- package/dist/runtime-api.js.map +1 -1
- package/dist/runtime-build-info.d.ts +9 -0
- package/dist/runtime-build-info.js +59 -0
- package/dist/runtime-build-info.js.map +1 -0
- package/dist/runtime-bundle.d.ts +6 -1
- package/dist/runtime-bundle.js +17 -9
- package/dist/runtime-bundle.js.map +1 -1
- package/dist/runtime-cli.d.ts +13 -1
- package/dist/runtime-cli.js +173 -19
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client-store.d.ts +27 -1
- package/dist/runtime-client-store.js +86 -6
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.d.ts +74 -0
- package/dist/runtime-client.js +336 -26
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-connection.d.ts +22 -0
- package/dist/runtime-connection.js +93 -0
- package/dist/runtime-connection.js.map +1 -0
- package/dist/runtime-coordinator.d.ts +16 -0
- package/dist/runtime-coordinator.js +287 -62
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-credential-profiles.d.ts +78 -0
- package/dist/runtime-credential-profiles.js +280 -0
- package/dist/runtime-credential-profiles.js.map +1 -0
- package/dist/runtime-install.d.ts +50 -0
- package/dist/runtime-install.js +186 -0
- package/dist/runtime-install.js.map +1 -0
- 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-boot.d.ts +7 -0
- package/dist/runtime-pane-boot.js +23 -0
- package/dist/runtime-pane-boot.js.map +1 -1
- package/dist/runtime-pane-codex-index.d.ts +10 -1
- package/dist/runtime-pane-codex-index.js +131 -27
- package/dist/runtime-pane-codex-index.js.map +1 -1
- package/dist/runtime-pane-host.d.ts +19 -0
- package/dist/runtime-pane-host.js +50 -7
- package/dist/runtime-pane-host.js.map +1 -1
- package/dist/runtime-pane-link.d.ts +7 -0
- package/dist/runtime-pane-link.js +93 -2
- package/dist/runtime-pane-link.js.map +1 -1
- package/dist/runtime-pane-mcp-relay.d.ts +1 -0
- package/dist/runtime-pane-mcp-relay.js +10 -0
- package/dist/runtime-pane-mcp-relay.js.map +1 -1
- package/dist/runtime-pane-mcp.d.ts +4 -0
- package/dist/runtime-pane-mcp.js +6 -3
- package/dist/runtime-pane-mcp.js.map +1 -1
- package/dist/runtime-pane-native.d.ts +32 -2
- package/dist/runtime-pane-native.js +55 -6
- package/dist/runtime-pane-native.js.map +1 -1
- package/dist/runtime-pane-port.d.ts +5 -0
- package/dist/runtime-pane-port.js +17 -1
- package/dist/runtime-pane-port.js.map +1 -1
- package/dist/runtime-pane-process.d.ts +1 -1
- package/dist/runtime-pane-process.js +11 -2
- package/dist/runtime-pane-process.js.map +1 -1
- package/dist/runtime-pane-protocol.d.ts +11 -1
- package/dist/runtime-pane-protocol.js +27 -5
- package/dist/runtime-pane-protocol.js.map +1 -1
- package/dist/runtime-pane-quota-history.d.ts +6 -0
- package/dist/runtime-pane-quota-history.js +44 -0
- package/dist/runtime-pane-quota-history.js.map +1 -0
- package/dist/runtime-pane-service.d.ts +5 -0
- package/dist/runtime-pane-service.js +47 -12
- package/dist/runtime-pane-service.js.map +1 -1
- package/dist/runtime-pane-transcript.d.ts +5 -0
- package/dist/runtime-pane-transcript.js +66 -5
- package/dist/runtime-pane-transcript.js.map +1 -1
- package/dist/runtime-pane-worker.js +19 -6
- package/dist/runtime-pane-worker.js.map +1 -1
- package/dist/runtime-protocol.d.ts +30 -2
- package/dist/runtime-protocol.js +30 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/runtime-update-activity.d.ts +21 -0
- package/dist/runtime-update-activity.js +51 -0
- package/dist/runtime-update-activity.js.map +1 -0
- package/dist/runtime-update-artifact.d.ts +31 -0
- package/dist/runtime-update-artifact.js +252 -0
- package/dist/runtime-update-artifact.js.map +1 -0
- package/dist/runtime-update-install.d.ts +31 -0
- package/dist/runtime-update-install.js +205 -0
- package/dist/runtime-update-install.js.map +1 -0
- package/dist/runtime-update-journal.d.ts +44 -0
- package/dist/runtime-update-journal.js +121 -0
- package/dist/runtime-update-journal.js.map +1 -0
- package/dist/runtime-update-lock.d.ts +48 -0
- package/dist/runtime-update-lock.js +217 -0
- package/dist/runtime-update-lock.js.map +1 -0
- package/dist/runtime-update-owners.d.ts +29 -0
- package/dist/runtime-update-owners.js +240 -0
- package/dist/runtime-update-owners.js.map +1 -0
- package/dist/runtime-update-protocol.d.ts +15 -0
- package/dist/runtime-update-protocol.js +13 -0
- package/dist/runtime-update-protocol.js.map +1 -0
- package/dist/runtime-windows-bridge.d.ts +2 -1
- package/dist/runtime-windows-bridge.js +11 -1
- package/dist/runtime-windows-bridge.js.map +1 -1
- package/dist/scheduler/db.d.ts +2 -1
- package/dist/scheduler/db.js +23 -9
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/task-board-text.js +1 -1
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +13 -0
- package/dist/scheduler/task-board.js +28 -3
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/service-drain.d.ts +19 -0
- package/dist/service-drain.js +64 -0
- package/dist/service-drain.js.map +1 -0
- package/dist/service-installer.d.ts +7 -2
- package/dist/service-installer.js +13 -10
- package/dist/service-installer.js.map +1 -1
- package/dist/settings-api.d.ts +20 -0
- package/dist/settings-api.js +414 -4
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +6 -0
- package/dist/settings-baseline.js +3 -1
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +29 -6
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.d.ts +13 -0
- package/dist/settings-effect.js +98 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +3 -0
- package/dist/settings-http-confirmation.js +28 -1
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-instance-patch.js +27 -0
- package/dist/settings-instance-patch.js.map +1 -1
- package/dist/setup-wizard.js +6 -2
- package/dist/setup-wizard.js.map +1 -1
- package/dist/task-board-tool.d.ts +13 -1
- package/dist/task-board-tool.js +104 -4
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-board-waker.d.ts +6 -0
- package/dist/task-board-waker.js +4 -0
- package/dist/task-board-waker.js.map +1 -1
- package/dist/tmux-binary.d.ts +59 -0
- package/dist/tmux-binary.js +200 -0
- package/dist/tmux-binary.js.map +1 -0
- package/dist/tmux-control.js +4 -4
- package/dist/tmux-control.js.map +1 -1
- package/dist/tmux-exec-helper.js +32 -1
- package/dist/tmux-exec-helper.js.map +1 -1
- package/dist/tmux-manager.d.ts +1 -1
- package/dist/tmux-manager.js +45 -36
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tmux-read.js +4 -3
- package/dist/tmux-read.js.map +1 -1
- package/dist/tool-permissions.d.ts +5 -2
- package/dist/tool-permissions.js +6 -5
- package/dist/tool-permissions.js.map +1 -1
- package/dist/tool-progress.d.ts +2 -0
- package/dist/tool-progress.js +19 -3
- package/dist/tool-progress.js.map +1 -1
- package/dist/topic-commands.js +10 -5
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-monitor.d.ts +20 -0
- package/dist/transcript-monitor.js +47 -3
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-needles.d.ts +7 -0
- package/dist/transcript-needles.js +9 -1
- package/dist/transcript-needles.js.map +1 -1
- package/dist/transcript-records.d.ts +1 -1
- package/dist/transcript-records.js +2 -1
- package/dist/transcript-records.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/ui/account-identity.js +27 -0
- package/dist/ui/accounts-view.js +214 -0
- package/dist/ui/agent-runtime-settings.js +68 -0
- package/dist/ui/agent-runtime.js +20 -2
- package/dist/ui/backend-signin.js +39 -21
- package/dist/ui/chat-ambient.js +1 -1
- package/dist/ui/chat-md-strings.js +3 -0
- package/dist/ui/chat-render.js +3 -670
- package/dist/ui/chat-store.js +1 -1
- package/dist/ui/chat-strings.js +3 -333
- package/dist/ui/chat-thread.js +3 -919
- package/dist/ui/chat-time.js +3 -80
- package/dist/ui/chat-tour.js +1 -1
- package/dist/ui/credential-profile-select.js +54 -0
- package/dist/ui/fleet-office-dialogue.d.ts +30 -0
- package/dist/ui/fleet-office-dialogue.js +382 -0
- package/dist/ui/fleet-office-pack.d.ts +9 -0
- package/dist/ui/fleet-office-pack.js +76 -4
- package/dist/ui/fleet-office-skin.js +23 -5
- package/dist/ui/fleet-office-store.js +5 -0
- package/dist/ui/fleet-office.js +173 -6
- package/dist/ui/fleet-task-card.js +10 -6
- package/dist/ui/fleet-task-common.js +12 -2
- package/dist/ui/fleet-task-menu.js +188 -0
- package/dist/ui/fleet-task-stats.js +124 -0
- package/dist/ui/fleet-task-view.js +340 -0
- package/dist/ui/fleet-tasks.js +131 -43
- package/dist/ui/fleet-usage.js +90 -27
- package/dist/ui/html-attachment.js +3 -40
- package/dist/ui/hub-agent-copy.js +23 -0
- package/dist/ui/hub-button-actions.js +65 -0
- package/dist/ui/hub-chat-store.js +158 -0
- package/dist/ui/hub-chat-strings.js +77 -0
- package/dist/ui/hub-client.js +329 -0
- package/dist/ui/hub-owner-strings.js +51 -0
- package/dist/ui/hub-provider-guidance.js +31 -0
- package/dist/ui/hub-quota.js +85 -0
- package/dist/ui/hub-strings.js +162 -0
- package/dist/ui/hub-switcher.js +27 -0
- package/dist/ui/native-instance-settings.js +5 -8
- package/dist/ui/native-pane-recovery.js +1 -1
- package/dist/ui/office-share-page.js +4 -2
- package/dist/ui/panel-chat.js +36 -49
- package/dist/ui/panel-details.js +1 -1
- package/dist/ui/panel-fleet.js +82 -12
- package/dist/ui/panel-hub.js +619 -0
- package/dist/ui/panel-log.js +2 -2
- package/dist/ui/panel-needs.js +24 -8
- package/dist/ui/panel-runtimes.js +239 -45
- package/dist/ui/panel-settings.js +266 -192
- package/dist/ui/panel-windows-cli.js +88 -42
- package/dist/ui/preview-pages.js +1 -1
- package/dist/ui/preview-panel.js +92 -6
- package/dist/ui/preview-versions.js +1 -1
- package/dist/ui/preview.js +3 -476
- package/dist/ui/runtime-commands.d.ts +4 -0
- package/dist/ui/runtime-commands.js +59 -0
- package/dist/ui/search-dialog.js +2 -0
- package/dist/ui/settings-access-strings.js +42 -0
- package/dist/ui/settings-agent-filters.js +94 -0
- package/dist/ui/settings-appearance.js +122 -23
- package/dist/ui/settings-build-version.js +35 -0
- package/dist/ui/settings-codex-copy.js +19 -0
- package/dist/ui/settings-devices.js +253 -0
- package/dist/ui/settings-dialogs.js +33 -12
- package/dist/ui/settings-guests.js +25 -11
- package/dist/ui/settings-hub-browser-certificate.js +74 -0
- package/dist/ui/settings-hub-membership.js +72 -0
- package/dist/ui/settings-hub-retention.js +52 -0
- package/dist/ui/settings-hub.js +196 -0
- package/dist/ui/settings-layout.js +242 -0
- package/dist/ui/settings-model.js +24 -2
- package/dist/ui/settings-outside.js +104 -38
- package/dist/ui/settings-registry.js +9 -4
- package/dist/ui/settings-shared-strings.js +143 -0
- package/dist/ui/settings-shared.js +345 -0
- package/dist/ui/settings-shortcuts.js +65 -0
- package/dist/ui/settings-strings.js +89 -32
- package/dist/ui/settings-web-authority.js +17 -11
- package/dist/ui/shared/accounts.css +15 -0
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-needs.js +1 -1
- package/dist/ui/shared/app-route.js +6 -1
- package/dist/ui/shared/app-session.js +6 -2
- package/dist/ui/shared/app-shell.js +81 -15
- package/dist/ui/shared/app.css +1114 -13
- package/dist/ui/shared/app.js +12 -3
- package/dist/ui/shared/chat-composer.js +68 -0
- package/dist/ui/shared/chat-md-strings.js +9 -0
- package/dist/ui/shared/chat-render.js +682 -0
- package/dist/ui/shared/chat-strings.js +333 -0
- package/dist/ui/shared/chat-thread.js +969 -0
- package/dist/ui/shared/chat-time.js +80 -0
- package/dist/ui/shared/header-tools.js +3 -5
- package/dist/ui/shared/html-attachment.js +42 -0
- package/dist/ui/shared/hub-chat.css +85 -0
- package/dist/ui/shared/hub-owner.css +33 -0
- package/dist/ui/shared/hub-quota.css +8 -0
- package/dist/ui/shared/hub.css +71 -0
- package/dist/ui/shared/instance-nav.js +3 -2
- package/dist/ui/shared/machine-name.js +13 -0
- package/dist/ui/shared/page-head.js +8 -0
- package/dist/ui/shared/panel-view.js +77 -4
- package/dist/ui/shared/preview.js +476 -0
- package/dist/ui/shared/runtime-install.css +26 -0
- package/dist/ui/shared/settings-width.js +31 -0
- package/dist/ui/shared/side-rail.js +15 -0
- package/dist/ui/shared/signin.js +172 -0
- package/dist/ui/shared/task-board.css +95 -0
- package/dist/ui/shared/tokens.css +1 -0
- package/dist/ui/shared/ui-dialog.js +2 -2
- package/dist/ui/shared/ui-menu.js +3 -3
- package/dist/ui/shared/usage-dialog.js +18 -1
- package/dist/ui/shared/view-history.css +17 -0
- package/dist/ui/shared/view-history.js +438 -0
- package/dist/ui/shared/view-strings.js +16 -0
- package/dist/ui/shared/workspace.css +20 -0
- package/dist/ui/signin.html +21 -0
- package/dist/ui/windows-cli-catalog.js +41 -12
- package/dist/ui/workspace-panel.js +189 -0
- package/dist/ui/workspace-strings.js +35 -0
- package/dist/unattended-install.d.ts +11 -2
- package/dist/unattended-install.js +41 -6
- package/dist/unattended-install.js.map +1 -1
- package/dist/usage/capacity.d.ts +69 -0
- package/dist/usage/capacity.js +119 -0
- package/dist/usage/capacity.js.map +1 -0
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +3 -0
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/profile-timeline.d.ts +16 -0
- package/dist/usage/profile-timeline.js +58 -0
- package/dist/usage/profile-timeline.js.map +1 -0
- package/dist/usage/providers.js +2 -1
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/quota-history.d.ts +43 -0
- package/dist/usage/quota-history.js +168 -0
- package/dist/usage/quota-history.js.map +1 -0
- package/dist/usage/usage-api.d.ts +31 -0
- package/dist/usage/usage-api.js +80 -1
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/usage-report.d.ts +25 -1
- package/dist/usage-report.js +55 -4
- package/dist/usage-report.js.map +1 -1
- package/dist/usage-rollup.d.ts +6 -1
- package/dist/usage-rollup.js +16 -4
- package/dist/usage-rollup.js.map +1 -1
- package/dist/view-api.d.ts +16 -0
- package/dist/view-api.js +105 -23
- package/dist/view-api.js.map +1 -1
- package/dist/view-history.d.ts +84 -0
- package/dist/view-history.js +116 -0
- package/dist/view-history.js.map +1 -0
- package/dist/web-api.d.ts +49 -2
- package/dist/web-api.js +279 -8
- package/dist/web-api.js.map +1 -1
- package/dist/web-backend-login.d.ts +23 -1
- package/dist/web-backend-login.js +11 -17
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-device-login.d.ts +153 -0
- package/dist/web-device-login.js +278 -0
- package/dist/web-device-login.js.map +1 -0
- package/dist/web-office-skins.d.ts +9 -0
- package/dist/web-office-skins.js +16 -1
- package/dist/web-office-skins.js.map +1 -1
- package/dist/web-session-authorization.d.ts +13 -2
- package/dist/web-session-authorization.js +10 -3
- package/dist/web-session-authorization.js.map +1 -1
- package/dist/web-session.d.ts +35 -0
- package/dist/web-session.js +7 -0
- package/dist/web-session.js.map +1 -1
- package/dist/web-settings-patch.d.ts +3 -1
- package/dist/web-settings-patch.js +4 -1
- package/dist/web-settings-patch.js.map +1 -1
- package/dist/web-shell-routes.d.ts +6 -0
- package/dist/web-shell-routes.js +7 -0
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/web-terminal.d.ts +4 -30
- package/dist/web-terminal.js +9 -6
- package/dist/web-terminal.js.map +1 -1
- package/dist/windows-agents.d.ts +4 -1
- package/dist/windows-agents.js +14 -10
- package/dist/windows-agents.js.map +1 -1
- package/dist/windows-cli-api.d.ts +12 -1
- package/dist/windows-cli-api.js +29 -2
- package/dist/windows-cli-api.js.map +1 -1
- package/dist/windows-cli-providers.d.ts +0 -9
- package/dist/windows-cli-providers.js +4 -9
- package/dist/windows-cli-providers.js.map +1 -1
- package/dist/windows-cli-worker.d.ts +25 -0
- package/dist/windows-cli-worker.js +98 -7
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +11 -0
- package/dist/windows-cli.js +17 -3
- package/dist/windows-cli.js.map +1 -1
- package/dist/yaml-shared-nodes.js +8 -3
- package/dist/yaml-shared-nodes.js.map +1 -1
- package/launcher/agend-install.cjs +8 -1
- package/launcher/launchd-session-type.cjs +14 -0
- package/launcher/postinstall.cjs +27 -2
- package/launcher/private-home.cjs +1 -1
- package/launcher/tmux-bundle.cjs +247 -0
- package/package.json +3 -2
- package/templates/launchd.plist.ejs +3 -1
- package/templates/runtime-install/install.ps1 +270 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** Read only root-level plist entries; comments and environment keys never select a manager domain. */
|
|
3
|
+
function sessionType(definition) {
|
|
4
|
+
if (typeof definition !== "string") return undefined;
|
|
5
|
+
var text = definition.replace(/<!--[\s\S]*?-->/g, ""), depth = 0, values = [];
|
|
6
|
+
var token = /<(\/?)(dict|array)\b[^>]*>|<key>([^<]*)<\/key>\s*<string>([^<]*)<\/string>/g, match;
|
|
7
|
+
while ((match = token.exec(text))) {
|
|
8
|
+
if (match[2]) depth += match[1] ? -1 : 1;
|
|
9
|
+
else if (depth === 1 && match[3] === "LimitLoadToSessionType") values.push(match[4]);
|
|
10
|
+
}
|
|
11
|
+
if (values.length > 1) throw Error("Ambiguous launchd session type; no domain was selected");
|
|
12
|
+
return values[0] === "Background" ? "Background" : undefined;
|
|
13
|
+
}
|
|
14
|
+
module.exports = { sessionType: sessionType };
|
package/launcher/postinstall.cjs
CHANGED
|
@@ -14,6 +14,7 @@ var crypto = require("crypto");
|
|
|
14
14
|
var childProcess = require("child_process");
|
|
15
15
|
var platform = require("./runtime-platform.cjs");
|
|
16
16
|
var select = require("./runtime-select.cjs");
|
|
17
|
+
var tmuxBundle = require("./tmux-bundle.cjs");
|
|
17
18
|
|
|
18
19
|
/** Runs on the candidate Node with argv[1] = the package dir: version, N-API, and a real DB open in both threads. */
|
|
19
20
|
var PROOF = [
|
|
@@ -44,13 +45,36 @@ function sha256(file) {
|
|
|
44
45
|
/** #1519 P7: the last line of a successful install (npm shows it with --foreground-scripts; install.sh says the same). */
|
|
45
46
|
var NEXT_STEP = " Next: run `agend quickstart` to set up AgEnD.";
|
|
46
47
|
|
|
48
|
+
/**
|
|
49
|
+
* M-2457 §6.1: verify the bundled tmux for this host, if this release pins one, and write its receipt; refuse the
|
|
50
|
+
* install when it fails. No pin for the host (none published yet): nothing to do. Pinned but not installed
|
|
51
|
+
* (--omit=optional, a mirror without it): a warning here; AgEnD itself refuses to start without it (§8).
|
|
52
|
+
*/
|
|
53
|
+
function checkBundledTmux(pkg, host, log, d) {
|
|
54
|
+
var pin = tmuxBundle.pinnedTmux(pkg.manifest, host);
|
|
55
|
+
if (!pin) return;
|
|
56
|
+
var candidate = tmuxBundle.tmuxCandidate(pkg.dir, pin);
|
|
57
|
+
if (!candidate.exists) {
|
|
58
|
+
log(" ⚠ AgEnD's bundled tmux (" + pin.name + ") was not installed (--omit=optional, or a registry mirror without it); AgEnD will not start until it is.");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
var proved = tmuxBundle.verifyTmux(candidate, pin, d.tmuxDeps);
|
|
62
|
+
if (!proved.ok) refuse(proved.reason, "npm install -g @songsid/agend@" + pkg.manifest.version + " (if it fails again, report it: the tmux package did not pass its check here)");
|
|
63
|
+
try {
|
|
64
|
+
tmuxBundle.writeReceipt(pkg.dir, pin, proved, host);
|
|
65
|
+
} catch (e) {
|
|
66
|
+
refuse(String(e && e.message || e), "install it under a plain path");
|
|
67
|
+
}
|
|
68
|
+
log(" ✓ AgEnD's bundled tmux " + proved.tmux + " verified (sha256, -V, a private-socket start and kill)");
|
|
69
|
+
}
|
|
70
|
+
|
|
47
71
|
function main(deps) {
|
|
48
72
|
var d = deps || {};
|
|
49
73
|
var pkg = select.packageDir(d.launcherDir || __dirname);
|
|
50
74
|
if (!pkg) refuse("the installed package is not @songsid/agend", "npm install -g @songsid/agend");
|
|
51
75
|
// A receipt describes THIS install's verification and nothing else: whatever is there now (one npm left behind, one
|
|
52
76
|
// copied in) goes first, so selection and installation see the same state (runtime-select.cjs).
|
|
53
|
-
[select.KEY, select.RECEIPT].forEach(function (name) {
|
|
77
|
+
[select.KEY, select.RECEIPT, tmuxBundle.RECEIPT].forEach(function (name) {
|
|
54
78
|
var file = path.join(pkg.dir, name);
|
|
55
79
|
if (select.absent(file)) return;
|
|
56
80
|
try { fs.unlinkSync(file); } catch (e) { /* checked below */ }
|
|
@@ -64,7 +88,8 @@ function main(deps) {
|
|
|
64
88
|
var pin = select.pinnedRuntime(pkg.manifest, host);
|
|
65
89
|
var support = platform.runtimeSupport(host);
|
|
66
90
|
var log = d.log || function (line) { process.stdout.write(line + "\n"); };
|
|
67
|
-
|
|
91
|
+
// M-2457: the bundled tmux is proved before the install is accepted (a refusal keeps the previous version).
|
|
92
|
+
var installed = function () { checkBundledTmux(pkg, host, log, d); log(NEXT_STEP); return 0; };
|
|
68
93
|
// #2264: `npm exec --package @songsid/agend@<v> -- agend-install` fetches a release only to run its installer. npm
|
|
69
94
|
// hoists the bundled Node out of <pkg>/node_modules there, and nothing runs `agend` from that copy: the installer's own
|
|
70
95
|
// `npm install -g` proves the bundled Node where AgEnD is installed. Refusing here (an old Node running npm, the
|
|
@@ -32,7 +32,7 @@ function ensurePrivateHome(dir, options) {
|
|
|
32
32
|
if (opts.afterOpen) opts.afterOpen(); // test seam: replacement at the check/change boundary
|
|
33
33
|
var info = io.fstatSync(fd), current = checkedPath(dir, io, false, message);
|
|
34
34
|
if (!info.isDirectory() || info.uid !== uid || current.dev !== info.dev || current.ino !== info.ino) throw new Error(message);
|
|
35
|
-
if (info.mode &
|
|
35
|
+
if (info.mode & 63) { // 0077: an owned home is private: repair legacy 0755/0775/0777 homes to 0700
|
|
36
36
|
io.fchmodSync(fd, 448);
|
|
37
37
|
if ((io.fstatSync(fd).mode & 511) !== 448) throw new Error(message);
|
|
38
38
|
(opts.log || function (line) { console.warn(line); })("AgEnD: tightened owned AGEND_HOME permissions to 0700.");
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// M-2457 (docs/design/bundled-tmux.md §6.1, §8): AgEnD's bundled tmux, @songsid/agend-tmux-<os>-<cpu>, pinned exactly in
|
|
3
|
+
// @songsid/agend's optionalDependencies. postinstall proves it BEFORE anything stops the running version: the files are
|
|
4
|
+
// the ones the package declares (sha256, size), `tmux -V` names the pinned release, and a throwaway server on a private
|
|
5
|
+
// socket starts, answers, captures and is killed. A failure refuses the install, and npm keeps the previous version.
|
|
6
|
+
// Then the receipt, `.agend-tmux.json` next to the package, records what was proved.
|
|
7
|
+
// Like postinstall, this runs under whatever Node runs npm: plain ES5-style CommonJS, built-ins only.
|
|
8
|
+
var fs = require("fs");
|
|
9
|
+
var path = require("path");
|
|
10
|
+
var crypto = require("crypto");
|
|
11
|
+
var childProcess = require("child_process");
|
|
12
|
+
|
|
13
|
+
var RECEIPT = ".agend-tmux.json";
|
|
14
|
+
var RECEIPT_KEYS = ["receipt", "pinnedVersion", "tmuxPath", "tmux", "size", "mtime", "sha256", "platform", "arch", "verifiedAt"];
|
|
15
|
+
var PLAIN = /^[^"\\\u0000-\u001f]*$/;
|
|
16
|
+
var SEMVER = /^\d+\.\d+\.\d+(-agend\.\d+)?$/;
|
|
17
|
+
var SMOKE_TIMEOUT_MS = 10000;
|
|
18
|
+
|
|
19
|
+
function readJson(file) {
|
|
20
|
+
try { return JSON.parse(fs.readFileSync(file, "utf8")); } catch (e) { return null; }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function absent(file) {
|
|
24
|
+
try { fs.lstatSync(file); return false; } catch (e) { return e && e.code === "ENOENT"; }
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function packageName(host) {
|
|
28
|
+
return "@songsid/agend-tmux-" + host.id;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The exact pin for this host from @songsid/agend's optionalDependencies, or null (none published for it yet). */
|
|
32
|
+
function pinnedTmux(manifest, host) {
|
|
33
|
+
var name = packageName(host);
|
|
34
|
+
var version = manifest && manifest.optionalDependencies && manifest.optionalDependencies[name];
|
|
35
|
+
return typeof version === "string" && SEMVER.test(version) ? { name: name, version: version } : null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Exactly <pkgDir>/node_modules/<name>, never require.resolve (it can walk up to an ancestor's copy). */
|
|
39
|
+
function tmuxCandidate(pkgDir, pin) {
|
|
40
|
+
var dir = path.join(pkgDir, "node_modules", pin.name);
|
|
41
|
+
var exists = !absent(dir);
|
|
42
|
+
return { dir: dir, exists: exists, manifest: exists ? readJson(path.join(dir, "package.json")) : null, tmux: path.join(dir, "bin", "tmux"), terminfo: path.join(dir, "share", "terminfo") };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function sha256(file) {
|
|
46
|
+
return crypto.createHash("sha256").update(fs.readFileSync(file)).digest("hex");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The environment the bundled tmux runs with: its own terminfo first, a UTF-8 locale, never a caller's $TMUX, and no
|
|
51
|
+
* shell startup hooks (the proof's pane runs /bin/sh directly; ENV/BASH_ENV would still make a shell read a file).
|
|
52
|
+
*/
|
|
53
|
+
function tmuxEnv(candidate, base) {
|
|
54
|
+
var env = {};
|
|
55
|
+
var from = base || process.env;
|
|
56
|
+
Object.keys(from).forEach(function (k) { if (k !== "TMUX" && k !== "TMUX_PANE" && k !== "ENV" && k !== "BASH_ENV") env[k] = from[k]; });
|
|
57
|
+
env.SHELL = "/bin/sh";
|
|
58
|
+
env.TERMINFO_DIRS = candidate.terminfo + (from.TERMINFO_DIRS ? ":" + from.TERMINFO_DIRS : ":/usr/share/terminfo:/lib/terminfo:/usr/lib/terminfo");
|
|
59
|
+
if (!/UTF-?8/i.test(String(from.LC_ALL || from.LC_CTYPE || from.LANG || ""))) env.LC_CTYPE = "C.UTF-8";
|
|
60
|
+
return env;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The proof's pane program: tmux execs this argv directly (more than one argument: no shell, no login shell). */
|
|
64
|
+
var PANE_MARK = "agend-verify-ok";
|
|
65
|
+
var PANE_ARGV = ["/bin/sh", "-c", "printf '%s\\n' " + PANE_MARK + "; exec sleep 60"];
|
|
66
|
+
|
|
67
|
+
function sleepMs(ms) {
|
|
68
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Has process `pid` exited? true only on positive evidence: no such process (ESRCH), or a zombie (it has exited and
|
|
73
|
+
* waits for a parent that may never reap it, e.g. a container whose PID 1 is not an init). Anything else is false.
|
|
74
|
+
*/
|
|
75
|
+
function processGone(pid, platform) {
|
|
76
|
+
try { process.kill(pid, 0); } catch (e) { return !!e && e.code === "ESRCH"; }
|
|
77
|
+
try {
|
|
78
|
+
if ((platform || process.platform) === "linux") {
|
|
79
|
+
var stat = fs.readFileSync("/proc/" + pid + "/stat", "utf8");
|
|
80
|
+
return stat.slice(stat.lastIndexOf(")") + 2, stat.lastIndexOf(")") + 3) === "Z";
|
|
81
|
+
}
|
|
82
|
+
var ps = childProcess.spawnSync("ps", ["-o", "stat=", "-p", String(pid)], { encoding: "utf8", timeout: 2000 });
|
|
83
|
+
return ps.status === 0 && /^\s*Z/.test(String(ps.stdout));
|
|
84
|
+
} catch (e) { return false; }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Prove the bundled tmux. Returns { ok: true, tmux, sha256, size, mtime, real } or { ok: false, reason }.
|
|
89
|
+
* The private-socket proof records the server it creates (pid, socket path and identity) and accepts its end only on
|
|
90
|
+
* positive evidence: that pid gone and a clean "no server" answer on the socket. An unknown observation (a timeout, a
|
|
91
|
+
* signal, an error) fails the proof, and then nothing is unlinked: the reason names what may still be running.
|
|
92
|
+
* Seams for tests: deps.spawnSync, deps.pid, deps.socket, deps.processGone, deps.exitWaitMs.
|
|
93
|
+
*/
|
|
94
|
+
function verifyTmux(candidate, pin, deps) {
|
|
95
|
+
var d = deps || {};
|
|
96
|
+
var spawn = d.spawnSync || childProcess.spawnSync;
|
|
97
|
+
var gone = d.processGone || processGone;
|
|
98
|
+
var exitWaitMs = d.exitWaitMs || 5000;
|
|
99
|
+
var m = candidate.manifest;
|
|
100
|
+
if (!m || m.name !== pin.name || m.version !== pin.version) return { ok: false, reason: "the bundled tmux package is not " + pin.name + "@" + pin.version };
|
|
101
|
+
var want = m.agendTmux;
|
|
102
|
+
if (!want || typeof want.tmux !== "string" || !/^\d+\.\d+[a-z]?$/.test(want.tmux) || !/^[0-9a-f]{64}$/.test(String(want.sha256)) || !(want.size > 0)) {
|
|
103
|
+
return { ok: false, reason: "the bundled tmux package does not say which binary it holds (agendTmux)" };
|
|
104
|
+
}
|
|
105
|
+
var st;
|
|
106
|
+
try { st = fs.lstatSync(candidate.tmux); } catch (e) { st = null; }
|
|
107
|
+
if (!st || !st.isFile()) return { ok: false, reason: "the bundled tmux binary is missing or not a regular file" };
|
|
108
|
+
if (st.size !== want.size) return { ok: false, reason: "the bundled tmux binary is " + st.size + " bytes, not the " + want.size + " its package declares" };
|
|
109
|
+
var sum = sha256(candidate.tmux);
|
|
110
|
+
if (sum !== want.sha256) return { ok: false, reason: "the bundled tmux binary's sha256 is not the one its package declares" };
|
|
111
|
+
var env = tmuxEnv(candidate, d.env);
|
|
112
|
+
var run = function (args) {
|
|
113
|
+
var r = spawn(candidate.tmux, args, { encoding: "utf8", timeout: SMOKE_TIMEOUT_MS, env: env, stdio: ["ignore", "pipe", "pipe"] });
|
|
114
|
+
return { status: r.status, stdout: String(r.stdout || ""), stderr: String(r.stderr || ""), error: r.error || null, signal: r.signal || null };
|
|
115
|
+
};
|
|
116
|
+
var clean = function (r) { return !r.error && !r.signal && typeof r.status === "number"; };
|
|
117
|
+
var why = function (r) { return r.error ? String(r.error.code || r.error.message || r.error) : r.signal ? "signal " + r.signal : "exit " + r.status + (r.stderr.trim() ? ": " + r.stderr.trim().split("\n").pop() : ""); };
|
|
118
|
+
// Every call names the throwaway socket, -V included: nothing here can reach the default or AgEnD's server.
|
|
119
|
+
var sock = d.socket || "agend-verify-" + (d.pid || process.pid);
|
|
120
|
+
var v = run(["-L", sock, "-V"]);
|
|
121
|
+
if (!clean(v) || v.status !== 0) return { ok: false, reason: "the bundled tmux did not run (" + why(v) + ")" };
|
|
122
|
+
if (v.stdout.trim() !== "tmux " + want.tmux) return { ok: false, reason: "the bundled tmux says '" + v.stdout.trim() + "', not 'tmux " + want.tmux + "'" };
|
|
123
|
+
|
|
124
|
+
// A throwaway server on that socket of its own: never the default socket, never AgEnD's `agend` socket.
|
|
125
|
+
var failed = null;
|
|
126
|
+
var server = null; // { pid, path, id } once known
|
|
127
|
+
var step = function (label, args) {
|
|
128
|
+
var r = run(args);
|
|
129
|
+
if (!clean(r) || r.status !== 0) failed = label + " failed (" + why(r) + ")";
|
|
130
|
+
return r;
|
|
131
|
+
};
|
|
132
|
+
try {
|
|
133
|
+
step("new-session", ["-L", sock, "-f", "/dev/null", "new-session", "-d", "-s", "verify", "-x", "80", "-y", "10"].concat(PANE_ARGV));
|
|
134
|
+
if (!failed) {
|
|
135
|
+
var idr = step("display-message", ["-L", sock, "display-message", "-p", "-t", "verify", "#{pid} #{socket_path}"]);
|
|
136
|
+
var mm = failed ? null : /^(\d+) (\/.+)$/.exec(idr.stdout.trim());
|
|
137
|
+
if (!failed && (!mm || path.basename(mm[2]) !== sock)) failed = "the server did not say which process and socket it is ('" + idr.stdout.trim() + "')";
|
|
138
|
+
if (!failed) {
|
|
139
|
+
var sst = socketIdentity(mm[2]);
|
|
140
|
+
if (!sst) failed = "the server's socket " + mm[2] + " is not a socket";
|
|
141
|
+
else server = { pid: Number(mm[1]), path: mm[2], id: sst };
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (!failed) step("has-session", ["-L", sock, "has-session", "-t", "verify"]);
|
|
145
|
+
if (!failed) {
|
|
146
|
+
// The pane program ran: its mark is on the screen (it may take a moment to paint).
|
|
147
|
+
var seen = false;
|
|
148
|
+
for (var k = 0; k < 20 && !failed && !seen; k++) {
|
|
149
|
+
var cap = step("capture-pane", ["-L", sock, "capture-pane", "-p", "-t", "verify"]);
|
|
150
|
+
seen = !failed && cap.stdout.indexOf(PANE_MARK) >= 0;
|
|
151
|
+
if (!seen && !failed) sleepMs(100);
|
|
152
|
+
}
|
|
153
|
+
if (!failed && !seen) failed = "capture-pane never showed the pane program's output";
|
|
154
|
+
}
|
|
155
|
+
if (!failed) step("kill-server", ["-L", sock, "kill-server"]);
|
|
156
|
+
if (!failed) {
|
|
157
|
+
// Gone, positively: the recorded pid has exited, and the socket answers a clean "no server".
|
|
158
|
+
var deadline = Date.now() + exitWaitMs;
|
|
159
|
+
while (!gone(server.pid) && Date.now() < deadline) sleepMs(50);
|
|
160
|
+
if (!gone(server.pid)) failed = "its server (pid " + server.pid + ") was still running after kill-server";
|
|
161
|
+
else {
|
|
162
|
+
var after = run(["-L", sock, "has-session"]);
|
|
163
|
+
if (!clean(after)) failed = "whether its server ended could not be confirmed (has-session: " + why(after) + ")";
|
|
164
|
+
else if (after.status === 0) failed = "its server was still answering after kill-server";
|
|
165
|
+
// Only tmux's own "no server" answer (exit 1) is proof; any other code is an unknown observation.
|
|
166
|
+
else if (after.status !== 1) failed = "whether its server ended could not be confirmed (has-session: " + why(after) + ")";
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
} finally {
|
|
170
|
+
// Cleanup that needs no proof: ask the server to go. Unlinking needs the proof above.
|
|
171
|
+
if (failed) run(["-L", sock, "kill-server"]);
|
|
172
|
+
}
|
|
173
|
+
if (failed) {
|
|
174
|
+
var left = server ? " (server pid " + server.pid + ", socket " + server.path + " left in place)" : " (socket -L " + sock + ")";
|
|
175
|
+
return { ok: false, reason: "the bundled tmux's private-socket check failed: " + failed + left };
|
|
176
|
+
}
|
|
177
|
+
// Reached only with the server's exit proved above.
|
|
178
|
+
removeStaleSocket(server);
|
|
179
|
+
var real = fs.realpathSync(candidate.tmux);
|
|
180
|
+
var fin = fs.statSync(real);
|
|
181
|
+
return { ok: true, tmux: want.tmux, sha256: sum, size: fin.size, mtime: Math.floor(fin.mtimeMs / 1000), real: real };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Remove the socket file tmux leaves behind after kill-server — only the one this proof created and saw exit: the same
|
|
186
|
+
* path, still a socket, the same identity (inode and change time). Anything else stays where it is.
|
|
187
|
+
*/
|
|
188
|
+
function removeStaleSocket(server) {
|
|
189
|
+
try {
|
|
190
|
+
if (socketIdentity(server.path) !== server.id) return;
|
|
191
|
+
fs.unlinkSync(server.path);
|
|
192
|
+
} catch (e) { /* already gone */ }
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* A socket file's identity: its inode and its change time to the nanosecond (an inode number alone can be reused at
|
|
197
|
+
* once by a file created where a removed one was). null when it is not a socket.
|
|
198
|
+
*/
|
|
199
|
+
function socketIdentity(file) {
|
|
200
|
+
try {
|
|
201
|
+
var st = fs.lstatSync(file, { bigint: true });
|
|
202
|
+
return st.isSocket() ? st.ino + ":" + st.ctimeNs : null;
|
|
203
|
+
} catch (e) { return null; }
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function receiptText(r) {
|
|
207
|
+
var o = {};
|
|
208
|
+
RECEIPT_KEYS.forEach(function (k) { o[k] = r[k]; });
|
|
209
|
+
return JSON.stringify(o, null, 2) + "\n";
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function receiptShapeOk(r) {
|
|
213
|
+
return !!r && r.receipt === 1 && typeof r.pinnedVersion === "string" && SEMVER.test(r.pinnedVersion)
|
|
214
|
+
&& typeof r.tmuxPath === "string" && PLAIN.test(r.tmuxPath) && path.isAbsolute(r.tmuxPath)
|
|
215
|
+
&& typeof r.tmux === "string" && /^\d+\.\d+[a-z]?$/.test(r.tmux)
|
|
216
|
+
&& typeof r.sha256 === "string" && /^[0-9a-f]{64}$/.test(r.sha256)
|
|
217
|
+
&& Number.isInteger(r.size) && r.size > 0 && Number.isInteger(r.mtime);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Write the receipt atomically next to the package (same rename-into-place as the runtime receipt). */
|
|
221
|
+
function writeReceipt(pkgDir, pin, proved, host) {
|
|
222
|
+
if (!PLAIN.test(proved.real)) throw new Error("AgEnD's install path " + JSON.stringify(proved.real) + " contains a quote, backslash or control character");
|
|
223
|
+
var receipt = { receipt: 1, pinnedVersion: pin.version, tmuxPath: proved.real, tmux: proved.tmux, size: proved.size, mtime: proved.mtime, sha256: proved.sha256, platform: host.platform, arch: host.arch, verifiedAt: new Date().toISOString() };
|
|
224
|
+
var file = path.join(pkgDir, RECEIPT);
|
|
225
|
+
var tmp = file + "." + process.pid + ".tmp";
|
|
226
|
+
fs.writeFileSync(tmp, receiptText(receipt));
|
|
227
|
+
fs.renameSync(tmp, file);
|
|
228
|
+
return receipt;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* The receipt, if it still describes the file on disk (size and mtime; the sha256 once per start is the caller's,
|
|
233
|
+
* PR B). null otherwise: a missing, malformed or stale receipt is never trusted.
|
|
234
|
+
*/
|
|
235
|
+
function readReceipt(pkgDir, pin) {
|
|
236
|
+
var r = readJson(path.join(pkgDir, RECEIPT));
|
|
237
|
+
if (!receiptShapeOk(r) || (pin && r.pinnedVersion !== pin.version)) return null;
|
|
238
|
+
var st;
|
|
239
|
+
try { st = fs.statSync(r.tmuxPath); } catch (e) { return null; }
|
|
240
|
+
return st.isFile() && st.size === r.size && Math.floor(st.mtimeMs / 1000) === r.mtime ? r : null;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
module.exports = {
|
|
244
|
+
RECEIPT: RECEIPT, RECEIPT_KEYS: RECEIPT_KEYS, SEMVER: SEMVER,
|
|
245
|
+
packageName: packageName, pinnedTmux: pinnedTmux, tmuxCandidate: tmuxCandidate, tmuxEnv: tmuxEnv,
|
|
246
|
+
verifyTmux: verifyTmux, processGone: processGone, PANE_ARGV: PANE_ARGV, writeReceipt: writeReceipt, readReceipt: readReceipt, receiptShapeOk: receiptShapeOk, receiptText: receiptText,
|
|
247
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@songsid/agend",
|
|
3
|
-
"version": "2.3.5-alpha.
|
|
3
|
+
"version": "2.3.5-alpha.5",
|
|
4
4
|
"description": "Multi-agent fleet daemon — run coding CLIs (Claude, Muse, Codex, OpenCode) from Discord or Telegram",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "tsc",
|
|
20
|
-
"postbuild": "node scripts/build-runtime-assets.mjs && node scripts/generate-tips-html.mjs && cp -r src/plugin dist/ && cp -r src/workflow-templates dist/ && cp src/agent-cli-instructions.md dist/ && cp -r src/ui dist/ && cp -r src/general-knowledge dist/ && chmod +x dist/cli.js && cd dist/plugin/agend && ln -sf ../../channel/mcp-server.js server.js",
|
|
20
|
+
"postbuild": "node scripts/write-build-provenance.mjs && node scripts/build-runtime-assets.mjs && node scripts/generate-tips-html.mjs && cp -r src/plugin dist/ && cp -r src/workflow-templates dist/ && cp src/agent-cli-instructions.md dist/ && cp -r src/ui dist/ && cp -r src/general-knowledge dist/ && chmod +x dist/cli.js && cd dist/plugin/agend && ln -sf ../../channel/mcp-server.js server.js",
|
|
21
21
|
"start": "tsx src/cli.ts start",
|
|
22
22
|
"dev": "tsx src/cli.ts",
|
|
23
23
|
"test": "vitest run",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"ejs": "^5.0.1",
|
|
71
71
|
"grammy": "^1.44.0",
|
|
72
72
|
"js-yaml": "^4.3.2",
|
|
73
|
+
"ldapts": "9.2.0",
|
|
73
74
|
"libavoid-js": "0.4.5",
|
|
74
75
|
"pino": "^10.3.1",
|
|
75
76
|
"pino-pretty": "^13.1.3",
|
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
<true/>
|
|
26
26
|
<key>KeepAlive</key>
|
|
27
27
|
<true/>
|
|
28
|
-
<key>
|
|
28
|
+
<% if (launchdSessionType) { %> <key>LimitLoadToSessionType</key>
|
|
29
|
+
<string><%= launchdSessionType %></string>
|
|
30
|
+
<% } %> <key>StandardOutPath</key>
|
|
29
31
|
<string><%= logPath %></string>
|
|
30
32
|
<key>StandardErrorPath</key>
|
|
31
33
|
<string><%= logPath %></string>
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# AgEnD Runtime for Windows: installs the runner that lets this PC work for an AgEnD fleet.
|
|
2
|
+
#
|
|
3
|
+
# Do not type this file's address by hand. The AgEnD page (Settings -> Runtime -> Connect a computer) shows the command to
|
|
4
|
+
# copy, with your fleet's address and THIS file's SHA-256 filled in. The command downloads this file, checks the hash shown on
|
|
5
|
+
# the page and only then runs it, so what runs is exactly what the page vouches for, whatever the TLS trust decision was.
|
|
6
|
+
# The server address is the one the command put in $agend (the reviewed address, never the Host that happened to serve this
|
|
7
|
+
# file); nothing here is looked up from the network, and nothing here is a secret. This file is the same bytes for everyone
|
|
8
|
+
# and for every request.
|
|
9
|
+
#
|
|
10
|
+
# It is run by the page's command (`iex` of the downloaded text), so it is kept safe for that: ASCII only (Windows
|
|
11
|
+
# PowerShell 5.1 may decode a download as the wrong code page), no param block, and no `exit` (under iex it would close the
|
|
12
|
+
# window). Windows PowerShell 5.1 and PowerShell 7 both run it. It needs no administrator rights and never changes your
|
|
13
|
+
# execution policy. Under Constrained Language Mode or AppLocker the page's command stops before this script is ever run (it cannot compute the hash there): use the ZIP from the same page instead.
|
|
14
|
+
#
|
|
15
|
+
# What it does, in order:
|
|
16
|
+
# 1. Checks that Node.js 22.14 or newer is installed (it never installs software for you).
|
|
17
|
+
# 2. Downloads the Runtime archive from $agend, checks its SHA-256 against the value pinned inside this script and, if it
|
|
18
|
+
# does not match, stops before anything is unpacked.
|
|
19
|
+
# 3. Unpacks it into %LOCALAPPDATA%\agend-runtime\<version>+<build>, NEXT TO any version already there (the folder names the build,
|
|
20
|
+
# the first 8 characters of the archive's SHA-256, because one version number can cover more than one build). An existing folder
|
|
21
|
+
# is never deleted or replaced: it may be the Runtime that is running right now.
|
|
22
|
+
# 4. Points agend-runtime at the new version: bin\agend-runtime.cmd never changes, and bin\current.txt (the version it
|
|
23
|
+
# starts) is swapped in with an atomic file replace. A Runtime that is already running keeps running its own version.
|
|
24
|
+
# 5. Adds the bin folder to YOUR user PATH (not the system PATH).
|
|
25
|
+
# 6. Prints the command that connects this PC. It does NOT connect and does NOT pair: pairing still needs the one-time
|
|
26
|
+
# code from AgEnD Settings, which you type in the terminal, and your approval in AgEnD.
|
|
27
|
+
#
|
|
28
|
+
# Optional, set in the same PowerShell window before running it:
|
|
29
|
+
# $env:AGEND_RUNTIME_NO_PATH = '1' leave PATH alone (the final message then shows the full path to run)
|
|
30
|
+
# $env:AGEND_RUNTIME_INSTALL_DIR = 'D:\agend' install somewhere other than %LOCALAPPDATA%\agend-runtime
|
|
31
|
+
# If it fails it says why, leaves what was installed before untouched, and sets $LASTEXITCODE to 1.
|
|
32
|
+
& {
|
|
33
|
+
$ErrorActionPreference = 'Stop'
|
|
34
|
+
|
|
35
|
+
# Pinned by the AgEnD server that serves this file: the version and the SHA-256 of the one archive it serves.
|
|
36
|
+
$pinnedVersion = '@@AGEND_RUNTIME_VERSION@@'
|
|
37
|
+
$pinnedSha256 = '@@AGEND_RUNTIME_SHA256@@'
|
|
38
|
+
$maxArchiveBytes = 16MB
|
|
39
|
+
|
|
40
|
+
function Write-Step([string]$text) { Write-Host ('AgEnD Runtime: ' + $text) }
|
|
41
|
+
function Write-Problem([string]$text) { Write-Host ('AgEnD Runtime: ' + $text) -ForegroundColor Red }
|
|
42
|
+
|
|
43
|
+
# Only an origin: https, or http for this computer itself (an SSH-forwarded port). No path, credentials, query or fragment.
|
|
44
|
+
function Resolve-AgendOrigin($value) {
|
|
45
|
+
if (-not ($value -is [string]) -or $value.Length -eq 0 -or $value.Length -gt 2048 -or $value -match '[\s\x00-\x1f\x7f]') { return '' }
|
|
46
|
+
$uri = $null
|
|
47
|
+
if (-not [Uri]::TryCreate($value, [UriKind]::Absolute, [ref]$uri)) { return '' }
|
|
48
|
+
$local = $uri.Host -in 'localhost', '127.0.0.1', '[::1]', '::1'
|
|
49
|
+
if (-not ($uri.Scheme -eq 'https' -or ($uri.Scheme -eq 'http' -and $local))) { return '' }
|
|
50
|
+
if ($uri.UserInfo -ne '' -or $uri.Query -ne '' -or $uri.Fragment -ne '' -or $uri.AbsolutePath -ne '/') { return '' }
|
|
51
|
+
return $uri.GetLeftPart([UriPartial]::Authority)
|
|
52
|
+
}
|
|
53
|
+
# Node.js satisfying the Runtime's engines: ^22.14.0 || ^23.6.0 || >=24.
|
|
54
|
+
function Test-NodeVersion([string]$text) {
|
|
55
|
+
$m = [regex]::Match($text, '\Av?(\d+)\.(\d+)\.(\d+)')
|
|
56
|
+
if (-not $m.Success) { return $false }
|
|
57
|
+
$major = [int]$m.Groups[1].Value; $minor = [int]$m.Groups[2].Value
|
|
58
|
+
return ($major -ge 24) -or ($major -eq 23 -and $minor -ge 6) -or ($major -eq 22 -and $minor -ge 14)
|
|
59
|
+
}
|
|
60
|
+
# One bounded download: no redirect is followed, and neither the wait nor the size can run on.
|
|
61
|
+
function Save-AgendArchive([string]$Uri, [string]$OutFile, [long]$MaxBytes) {
|
|
62
|
+
$request = [Net.HttpWebRequest]::Create($Uri)
|
|
63
|
+
$request.AllowAutoRedirect = $false; $request.Timeout = 120000; $request.ReadWriteTimeout = 60000; $request.UserAgent = 'agend-runtime-install'
|
|
64
|
+
$response = $null; $bodyStream = $null; $output = $null; $done = $false
|
|
65
|
+
try {
|
|
66
|
+
$response = $request.GetResponse()
|
|
67
|
+
if ([int]$response.StatusCode -ne 200) { throw ('The AgEnD server answered ' + [int]$response.StatusCode + ' for the Runtime archive.') }
|
|
68
|
+
if ($response.ContentLength -gt $MaxBytes) { throw 'The Runtime archive is larger than expected; refusing to download it.' }
|
|
69
|
+
$bodyStream = $response.GetResponseStream()
|
|
70
|
+
$output = [IO.File]::Open($OutFile, [IO.FileMode]::Create, [IO.FileAccess]::Write, [IO.FileShare]::None)
|
|
71
|
+
$buffer = New-Object byte[] 65536; $total = 0
|
|
72
|
+
while (($count = $bodyStream.Read($buffer, 0, $buffer.Length)) -gt 0) {
|
|
73
|
+
$total += $count
|
|
74
|
+
if ($total -gt $MaxBytes) { throw 'The Runtime archive is larger than expected; stopped downloading it.' }
|
|
75
|
+
$output.Write($buffer, 0, $count)
|
|
76
|
+
}
|
|
77
|
+
$done = $true
|
|
78
|
+
} finally {
|
|
79
|
+
if ($output) { $output.Dispose() }; if ($bodyStream) { $bodyStream.Dispose() }; if ($response) { $response.Close() }
|
|
80
|
+
if (-not $done) { Remove-Item -LiteralPath $OutFile -Force -ErrorAction SilentlyContinue }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
# .NET directly, not Get-FileHash: a PowerShell started from another one can inherit a module path that hides that cmdlet.
|
|
84
|
+
function Get-AgendSha256([string]$Path) {
|
|
85
|
+
$stream = [IO.File]::OpenRead($Path)
|
|
86
|
+
try {
|
|
87
|
+
$sha = [Security.Cryptography.SHA256]::Create()
|
|
88
|
+
try { return ([BitConverter]::ToString($sha.ComputeHash($stream)) -replace '-', '').ToLowerInvariant() } finally { $sha.Dispose() }
|
|
89
|
+
} finally { $stream.Dispose() }
|
|
90
|
+
}
|
|
91
|
+
# Writes a small file by writing a sibling and swapping it in, so a reader (a shim that is starting right now) sees the old or the
|
|
92
|
+
# new content, never half of it. Nothing happens when the file already says this.
|
|
93
|
+
function Set-AgendFile([string]$Path, [string]$Text) {
|
|
94
|
+
if ((Test-Path -LiteralPath $Path) -and ([IO.File]::ReadAllText($Path) -ceq $Text)) { return }
|
|
95
|
+
$new = $Path + '.new'
|
|
96
|
+
[IO.File]::WriteAllText($new, $Text, [Text.Encoding]::ASCII)
|
|
97
|
+
try {
|
|
98
|
+
# [NullString]::Value, not $null: PowerShell turns $null into an empty string for a string parameter, and Replace refuses that.
|
|
99
|
+
if (Test-Path -LiteralPath $Path) { [IO.File]::Replace($new, $Path, [NullString]::Value) } else { [IO.File]::Move($new, $Path) }
|
|
100
|
+
} catch {
|
|
101
|
+
Remove-Item -LiteralPath $new -Force -ErrorAction SilentlyContinue
|
|
102
|
+
throw ('Could not update ' + $Path + ' (' + $_.Exception.Message + '). Close any agend-runtime window that is starting, then run the install command again.')
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
# Adds a folder to the USER PATH in the registry, keeping its value kind: [Environment]::SetEnvironmentVariable would turn a
|
|
106
|
+
# REG_EXPAND_SZ PATH into plain REG_SZ and stop its %VARIABLES% entries expanding, and setx truncates at 1024 characters, so
|
|
107
|
+
# neither is used. An entry already there (written out or with %VARIABLES%) is not added again.
|
|
108
|
+
function Add-UserPathEntry([string]$Folder) {
|
|
109
|
+
$key = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey('Environment', $true)
|
|
110
|
+
try {
|
|
111
|
+
$raw = [string]$key.GetValue('Path', '', [Microsoft.Win32.RegistryValueOptions]::DoNotExpandEnvironmentNames)
|
|
112
|
+
$kind = [Microsoft.Win32.RegistryValueKind]::ExpandString
|
|
113
|
+
if ($key.GetValueNames() -contains 'Path') { $kind = $key.GetValueKind('Path') }
|
|
114
|
+
$want = $Folder.TrimEnd('\')
|
|
115
|
+
foreach ($entry in $raw.Split(';')) {
|
|
116
|
+
$e = $entry.Trim().TrimEnd('\')
|
|
117
|
+
if ($e -ieq $want -or [Environment]::ExpandEnvironmentVariables($e).TrimEnd('\') -ieq $want) { return $false }
|
|
118
|
+
}
|
|
119
|
+
$next = $Folder
|
|
120
|
+
if ($raw.Trim().Length -gt 0) { $next = $raw.TrimEnd(';') + ';' + $Folder }
|
|
121
|
+
$key.SetValue('Path', $next, $kind)
|
|
122
|
+
} finally { $key.Close() }
|
|
123
|
+
# Tell running programs the environment changed: setting and clearing a throwaway user variable makes Windows broadcast it. The PATH is
|
|
124
|
+
# already written, so a failure here is only a warning (open terminals learn of it later), never "install failed".
|
|
125
|
+
try {
|
|
126
|
+
[Environment]::SetEnvironmentVariable('AGEND_RUNTIME_ENV_REFRESH', '1', 'User')
|
|
127
|
+
[Environment]::SetEnvironmentVariable('AGEND_RUNTIME_ENV_REFRESH', $null, 'User')
|
|
128
|
+
} catch {
|
|
129
|
+
try { [Environment]::SetEnvironmentVariable('AGEND_RUNTIME_ENV_REFRESH', $null, 'User') } catch { }
|
|
130
|
+
Write-Host ('AgEnD Runtime: warning: your PATH was updated, but running programs could not be told (' + $_.Exception.Message + '). Open a new terminal to see the change.') -ForegroundColor Yellow
|
|
131
|
+
}
|
|
132
|
+
return $true
|
|
133
|
+
}
|
|
134
|
+
# The shim never changes from one version to the next, so replacing a version cannot disturb a batch file that is running.
|
|
135
|
+
# It starts the version named in current.txt, next to it; that one small file is what an install swaps.
|
|
136
|
+
# `setlocal DisableDelayedExpansion` comes before any line that expands a path or an argument: with cmd /V:ON (or the DelayedExpansion registry setting)
|
|
137
|
+
# an unmatched `!` in the install folder, which an accepted AGEND_RUNTIME_INSTALL_DIR can hold, would otherwise be eaten out of %~dp0 and the shim would
|
|
138
|
+
# look in another folder and report an incomplete install. (Changed once for that reason: see the change notice below.)
|
|
139
|
+
# DO NOT CHANGE $shimText unless a bug in it makes installs unusable. cmd.exe reads a batch file as it runs it, a piece at a time, not all at
|
|
140
|
+
# once, so rewriting the agend-runtime.cmd of a Runtime that is running (Set-AgendFile does that whenever this text differs from what is on
|
|
141
|
+
# disk) can make that Runtime's window misbehave when it ends. The text names no version for exactly that reason. If it must change, update the
|
|
142
|
+
# pinned hash in tests/runtime-install-script.test.ts in the same commit, and say in the docs and the changelog that running Runtimes should be
|
|
143
|
+
# stopped before the install command is run again.
|
|
144
|
+
$shimText = ('@echo off', 'setlocal DisableDelayedExpansion', 'set "AGEND_RT_VERSION="', 'if not exist "%~dp0current.txt" goto :agend_rt_missing', 'set /p AGEND_RT_VERSION=<"%~dp0current.txt"', 'if not defined AGEND_RT_VERSION goto :agend_rt_missing',
|
|
145
|
+
'if not exist "%~dp0..\%AGEND_RT_VERSION%\dist\runtime-cli.js" goto :agend_rt_missing', 'node.exe "%~dp0..\%AGEND_RT_VERSION%\dist\runtime-cli.js" %*',
|
|
146
|
+
'exit /b %errorlevel%', ':agend_rt_missing', 'echo AgEnD Runtime is not installed correctly. Run the install command shown in AgEnD Settings - Runtime - Connect a computer again.>&2',
|
|
147
|
+
'exit /b 1', '') -join "`r`n"
|
|
148
|
+
|
|
149
|
+
$tmp = $null
|
|
150
|
+
try {
|
|
151
|
+
try { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor 3072 } catch { }
|
|
152
|
+
|
|
153
|
+
$origin = Resolve-AgendOrigin $agend
|
|
154
|
+
if ($origin -eq '') {
|
|
155
|
+
Write-Problem 'This installer needs $agend set to your AgEnD address (https, or http only for this computer).'
|
|
156
|
+
Write-Host 'Do not run this file by hand: copy the install command from AgEnD (Settings -> Runtime -> Connect a computer -> Windows (PowerShell)).'
|
|
157
|
+
Write-Host 'It sets $agend to your address and checks this installer''s SHA-256 against the one the page shows before it runs anything.'
|
|
158
|
+
$global:LASTEXITCODE = 1
|
|
159
|
+
return
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
$nodeText = ''
|
|
163
|
+
$node = Get-Command node -ErrorAction SilentlyContinue
|
|
164
|
+
if ($node) { try { $nodeText = ((& $node.Source -v) | Out-String).Trim() } catch { $nodeText = '' } }
|
|
165
|
+
if (-not (Test-NodeVersion $nodeText)) {
|
|
166
|
+
if ($nodeText) { Write-Problem ('Node.js ' + $nodeText + ' is too old. The AgEnD Runtime needs Node.js 22.14 or newer (22.14+, 23.6+ or 24+).') }
|
|
167
|
+
else { Write-Problem 'Node.js was not found. The AgEnD Runtime needs Node.js 22.14 or newer (22.14+, 23.6+ or 24+).' }
|
|
168
|
+
Write-Host 'This installer does not install software for you. Install Node.js yourself, open a new PowerShell window, set $agend and run the command again:'
|
|
169
|
+
Write-Host ' winget install OpenJS.NodeJS.LTS'
|
|
170
|
+
Write-Host 'or download it from https://nodejs.org/'
|
|
171
|
+
$global:LASTEXITCODE = 1
|
|
172
|
+
return
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
$root = [string]$env:AGEND_RUNTIME_INSTALL_DIR
|
|
176
|
+
if ($root -ne '') {
|
|
177
|
+
# A folder you chose: it must be a full path on a drive, never a relative, UNC or control-character path.
|
|
178
|
+
if ($root -notmatch '\A[A-Za-z]:[\\/]' -or $root -match '[\x00-\x1f\x7f]') { throw 'AGEND_RUNTIME_INSTALL_DIR must be a full path on a drive, for example D:\agend.' }
|
|
179
|
+
} else {
|
|
180
|
+
if (-not $env:LOCALAPPDATA) { throw 'LOCALAPPDATA is not set; set AGEND_RUNTIME_INSTALL_DIR to a folder for the Runtime.' }
|
|
181
|
+
$root = Join-Path $env:LOCALAPPDATA 'agend-runtime'
|
|
182
|
+
}
|
|
183
|
+
$root = [IO.Path]::GetFullPath($root).TrimEnd('\')
|
|
184
|
+
# The folder names the build as well as the version: one version number often covers more than one build, and a different build must land
|
|
185
|
+
# beside the old one, not on it. The same build finds its own folder again and only repoints agend-runtime.
|
|
186
|
+
$folder = $pinnedVersion + '+' + $pinnedSha256.Substring(0, 8)
|
|
187
|
+
$target = Join-Path $root $folder
|
|
188
|
+
$bin = Join-Path $root 'bin'
|
|
189
|
+
$marker = Join-Path $target '.agend-install-sha256'
|
|
190
|
+
$createdRoot = -not (Test-Path -LiteralPath $root)
|
|
191
|
+
$null = New-Item -ItemType Directory -Path $root -Force
|
|
192
|
+
|
|
193
|
+
# An existing folder is never deleted or replaced: it may be the Runtime that is running right now. A folder with this build's own name that does
|
|
194
|
+
# not hold this build can only be one that was changed by hand or left incomplete, and is left alone too.
|
|
195
|
+
$installed = $false
|
|
196
|
+
if (Test-Path -LiteralPath $target) {
|
|
197
|
+
$existing = ''
|
|
198
|
+
if (Test-Path -LiteralPath $marker) { $existing = ([IO.File]::ReadAllText($marker)).Trim() }
|
|
199
|
+
if ($existing -eq $pinnedSha256 -and (Test-Path -LiteralPath (Join-Path $target 'dist\runtime-cli.js'))) { $installed = $true }
|
|
200
|
+
else { throw ('The folder ' + $target + ' exists but does not hold this build (it was changed or is incomplete). It was left untouched because it may be running. Close any agend-runtime window, move that folder away yourself, and run the install command again.') }
|
|
201
|
+
}
|
|
202
|
+
if ($installed) {
|
|
203
|
+
Write-Step ('version ' + $pinnedVersion + ' (build ' + $pinnedSha256.Substring(0, 8) + ') is already installed in ' + $target + '.')
|
|
204
|
+
} else {
|
|
205
|
+
$tmp = Join-Path $root ('.install-' + [Guid]::NewGuid().ToString('N'))
|
|
206
|
+
$null = New-Item -ItemType Directory -Path $tmp
|
|
207
|
+
$archive = Join-Path $tmp 'runtime.zip'
|
|
208
|
+
Write-Step ('downloading version ' + $pinnedVersion + ' (build ' + $pinnedSha256.Substring(0, 8) + ') from ' + $origin)
|
|
209
|
+
Save-AgendArchive ($origin + '/runtime/v1/bundle/windows.zip') $archive $maxArchiveBytes
|
|
210
|
+
$actual = Get-AgendSha256 $archive
|
|
211
|
+
if ($actual -ne $pinnedSha256) {
|
|
212
|
+
throw ('The downloaded Runtime does not match the checksum pinned in this installer, so nothing was unpacked. Expected ' + $pinnedSha256 + ' but received ' + $actual + '. If AgEnD was just updated, reload the AgEnD page and copy the install command again.')
|
|
213
|
+
}
|
|
214
|
+
Write-Step 'checksum verified; unpacking.'
|
|
215
|
+
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
|
216
|
+
$stage = Join-Path $tmp 'unpacked'
|
|
217
|
+
[IO.Compression.ZipFile]::ExtractToDirectory($archive, $stage)
|
|
218
|
+
$unpacked = Join-Path $stage 'agend-runtime'
|
|
219
|
+
if (-not (Test-Path -LiteralPath (Join-Path $unpacked 'dist\runtime-cli.js')) -or -not (Test-Path -LiteralPath (Join-Path $unpacked 'bundle-manifest.json'))) {
|
|
220
|
+
throw 'The Runtime archive does not contain the expected files, so nothing was installed.'
|
|
221
|
+
}
|
|
222
|
+
[IO.File]::WriteAllText((Join-Path $unpacked '.agend-install-sha256'), $pinnedSha256)
|
|
223
|
+
# A rename inside the install folder: the version folder appears whole or not at all, beside the versions already there.
|
|
224
|
+
Move-Item -LiteralPath $unpacked -Destination $target
|
|
225
|
+
Write-Step ('installed version ' + $pinnedVersion + ' (build ' + $pinnedSha256.Substring(0, 8) + ') in ' + $target + '.')
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
# Repoint agend-runtime. The shim file is written once and then left alone; current.txt is the atomic switch.
|
|
229
|
+
$null = New-Item -ItemType Directory -Path $bin -Force
|
|
230
|
+
$shim = Join-Path $bin 'agend-runtime.cmd'
|
|
231
|
+
$current = Join-Path $bin 'current.txt'
|
|
232
|
+
$was = ''
|
|
233
|
+
if (Test-Path -LiteralPath $current) { $was = ([IO.File]::ReadAllText($current)).Trim() }
|
|
234
|
+
Set-AgendFile $shim $shimText
|
|
235
|
+
Set-AgendFile $current $folder
|
|
236
|
+
if ($was -ne '' -and $was -ne $folder) {
|
|
237
|
+
Write-Step ('agend-runtime now starts ' + $folder + ' (it was ' + $was + '). A Runtime that is already running keeps its own version until you stop it with Ctrl+C and start it again with agend-runtime run.')
|
|
238
|
+
}
|
|
239
|
+
$others = @(Get-ChildItem -LiteralPath $root -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -ne $folder -and $_.Name -match '\A\d+\.\d+\.\d+([-+][A-Za-z0-9.+-]+)?\z' } | ForEach-Object { $_.Name })
|
|
240
|
+
# Earlier folders are not removed here: one of them may be running. Cleaning them up comes with the update and uninstall commands (phase 2).
|
|
241
|
+
if ($others.Count -gt 0) { Write-Step ('earlier versions are kept where they are (' + ($others -join ', ') + '). This installer never removes a version; clearing old ones comes later, with the update and uninstall commands.') }
|
|
242
|
+
|
|
243
|
+
$onPath = $false
|
|
244
|
+
if ([string]$env:AGEND_RUNTIME_NO_PATH -eq '1') {
|
|
245
|
+
Write-Step 'AGEND_RUNTIME_NO_PATH is set; your PATH was not changed.'
|
|
246
|
+
} else {
|
|
247
|
+
if (Add-UserPathEntry $bin) { Write-Step ('added ' + $bin + ' to your user PATH.') } else { Write-Step ($bin + ' is already on your user PATH.') }
|
|
248
|
+
$sessionHas = $false
|
|
249
|
+
foreach ($entry in ([string]$env:Path).Split(';')) { if ($entry.Trim().TrimEnd('\') -ieq $bin) { $sessionHas = $true } }
|
|
250
|
+
if (-not $sessionHas) { $env:Path = ([string]$env:Path).TrimEnd(';') + ';' + $bin }
|
|
251
|
+
$onPath = $true
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
Write-Host ''
|
|
255
|
+
Write-Host 'AgEnD Runtime is installed. This computer is not connected yet and nothing has been paired.'
|
|
256
|
+
Write-Host 'Next, connect it. Open Settings -> Runtime -> Connect a computer in AgEnD for the one-time pairing code, then run:'
|
|
257
|
+
Write-Host ''
|
|
258
|
+
if ($onPath) { Write-Host (' agend-runtime connect --server "' + $origin + '"') }
|
|
259
|
+
else { Write-Host (' & "' + $shim + '" connect --server "' + $origin + '"') }
|
|
260
|
+
Write-Host ''
|
|
261
|
+
Write-Host 'Type the pairing code when asked, compare the fingerprint with the one AgEnD shows, then approve this computer in AgEnD.'
|
|
262
|
+
} catch {
|
|
263
|
+
Write-Problem ('install failed: ' + $_.Exception.Message)
|
|
264
|
+
$global:LASTEXITCODE = 1
|
|
265
|
+
} finally {
|
|
266
|
+
if ($tmp -and (Test-Path -LiteralPath $tmp)) { Remove-Item -LiteralPath $tmp -Recurse -Force -ErrorAction SilentlyContinue }
|
|
267
|
+
# A run that installed nothing leaves nothing: the install folder this run created is removed again, but only while it is still empty.
|
|
268
|
+
if ($createdRoot -and $root -and (Test-Path -LiteralPath $root) -and -not (Get-ChildItem -LiteralPath $root -Force | Select-Object -First 1)) { Remove-Item -LiteralPath $root -Force -ErrorAction SilentlyContinue }
|
|
269
|
+
}
|
|
270
|
+
}
|