@songsid/agend 2.3.5-alpha.5 → 2.3.5-alpha.7
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 +0 -1
- package/dist/accounts-profiles.d.ts +96 -0
- package/dist/accounts-profiles.js +178 -0
- package/dist/accounts-profiles.js.map +1 -0
- package/dist/accounts-signout.d.ts +59 -0
- package/dist/accounts-signout.js +184 -0
- package/dist/accounts-signout.js.map +1 -0
- package/dist/accounts-view.d.ts +54 -0
- package/dist/accounts-view.js +55 -11
- package/dist/accounts-view.js.map +1 -1
- package/dist/agent-workspace.d.ts +11 -0
- package/dist/agent-workspace.js +28 -0
- package/dist/agent-workspace.js.map +1 -1
- package/dist/auth-api.js +38 -5
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/session-authorizations.d.ts +2 -0
- package/dist/authority/session-authorizations.js +7 -1
- package/dist/authority/session-authorizations.js.map +1 -1
- package/dist/authority/web-authority.d.ts +13 -0
- package/dist/authority/web-authority.js +12 -0
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/backend/claude-code.js +47 -9
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex.js +1 -0
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/kiro.js +1 -1
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/types.d.ts +2 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/bundled-tmux-guard.d.ts +19 -0
- package/dist/bundled-tmux-guard.js +83 -0
- package/dist/bundled-tmux-guard.js.map +1 -0
- package/dist/channel/access-manager.d.ts +1 -6
- package/dist/channel/access-manager.js +4 -94
- package/dist/channel/access-manager.js.map +1 -1
- package/dist/channel/adapters/discord.d.ts +0 -2
- package/dist/channel/adapters/discord.js +0 -8
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +0 -3
- package/dist/channel/adapters/telegram.js +1 -30
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/types.d.ts +0 -2
- package/dist/classic-bindings.d.ts +13 -0
- package/dist/classic-bindings.js +28 -2
- package/dist/classic-bindings.js.map +1 -1
- package/dist/classic-channel-manager.d.ts +2 -0
- package/dist/classic-channel-manager.js +5 -1
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/cli.js +117 -30
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +11 -0
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +3 -1
- package/dist/config.js.map +1 -1
- package/dist/daemon.d.ts +27 -2
- package/dist/daemon.js +107 -6
- package/dist/daemon.js.map +1 -1
- package/dist/doctor.js +3 -4
- package/dist/doctor.js.map +1 -1
- package/dist/e2e-isolation.js +5 -2
- package/dist/e2e-isolation.js.map +1 -1
- package/dist/fleet-control-audit.d.ts +1 -1
- package/dist/fleet-manager.d.ts +188 -1
- package/dist/fleet-manager.js +1059 -79
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +22 -7
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +10 -0
- package/dist/general-knowledge/steering/core-rules.md +6 -4
- package/dist/hub/buttons.js +4 -2
- package/dist/hub/buttons.js.map +1 -1
- package/dist/hub/catalog.d.ts +1 -1
- package/dist/hub/catalog.js +82 -15
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/compose/server.d.ts +4 -1
- package/dist/hub/compose/server.js +30 -3
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/directory/directory.d.ts +1 -1
- package/dist/hub/directory/directory.js +142 -21
- package/dist/hub/directory/directory.js.map +1 -1
- package/dist/hub/directory/groups.d.ts +29 -0
- package/dist/hub/directory/groups.js +29 -0
- package/dist/hub/directory/groups.js.map +1 -0
- package/dist/hub/directory/index.d.ts +2 -1
- package/dist/hub/directory/types.d.ts +12 -2
- package/dist/hub/directory/types.js.map +1 -1
- package/dist/hub/group-policy/admin-context.d.ts +23 -0
- package/dist/hub/group-policy/admin-context.js +52 -0
- package/dist/hub/group-policy/admin-context.js.map +1 -0
- package/dist/hub/group-policy/admin-dto.d.ts +235 -0
- package/dist/hub/group-policy/admin-dto.js +55 -0
- package/dist/hub/group-policy/admin-dto.js.map +1 -0
- package/dist/hub/group-policy/admin-inventory.d.ts +24 -0
- package/dist/hub/group-policy/admin-inventory.js +72 -0
- package/dist/hub/group-policy/admin-inventory.js.map +1 -0
- package/dist/hub/group-policy/admin-read.d.ts +21 -0
- package/dist/hub/group-policy/admin-read.js +90 -0
- package/dist/hub/group-policy/admin-read.js.map +1 -0
- package/dist/hub/group-policy/authorization.d.ts +43 -0
- package/dist/hub/group-policy/authorization.js +170 -0
- package/dist/hub/group-policy/authorization.js.map +1 -0
- package/dist/hub/group-policy/model.d.ts +56 -0
- package/dist/hub/group-policy/model.js +46 -0
- package/dist/hub/group-policy/model.js.map +1 -0
- package/dist/hub/group-policy/resources.d.ts +60 -0
- package/dist/hub/group-policy/resources.js +191 -0
- package/dist/hub/group-policy/resources.js.map +1 -0
- package/dist/hub/group-policy/store.d.ts +58 -0
- package/dist/hub/group-policy/store.js +155 -0
- package/dist/hub/group-policy/store.js.map +1 -0
- package/dist/hub/http/compose.js +9 -9
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.d.ts +23 -3
- package/dist/hub/http/core.js +138 -5
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +3 -0
- package/dist/hub/pairing.d.ts +3 -1
- package/dist/hub/pairing.js +6 -3
- package/dist/hub/pairing.js.map +1 -1
- package/dist/hub/policy.d.ts +3 -1
- package/dist/hub/policy.js +13 -6
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/rooms.d.ts +1 -0
- package/dist/hub/rooms.js +76 -26
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/server.d.ts +2 -0
- package/dist/hub/server.js +12 -2
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/sessions.js +2 -1
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/types.d.ts +2 -0
- package/dist/instance-config-impact.js +4 -3
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +17 -0
- package/dist/instance-lifecycle.js +38 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +45 -18
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +5 -0
- package/dist/login-controller.js +11 -0
- package/dist/login-controller.js.map +1 -1
- package/dist/login-window-lock.d.ts +2 -1
- package/dist/login-window-lock.js.map +1 -1
- package/dist/ls-rows.d.ts +1 -1
- package/dist/ls-rows.js +1 -1
- package/dist/ls-rows.js.map +1 -1
- package/dist/machine-accounts.d.ts +110 -0
- package/dist/machine-accounts.js +229 -0
- package/dist/machine-accounts.js.map +1 -0
- package/dist/machine-signins.d.ts +89 -0
- package/dist/machine-signins.js +182 -0
- package/dist/machine-signins.js.map +1 -0
- package/dist/muse-usage-relay.d.ts +2 -0
- package/dist/muse-usage-relay.js +5 -3
- package/dist/muse-usage-relay.js.map +1 -1
- package/dist/needs-you-hub.d.ts +3 -0
- package/dist/needs-you-hub.js +13 -3
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +35 -2
- package/dist/needs-you.js +19 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/quickstart.js +7 -18
- package/dist/quickstart.js.map +1 -1
- package/dist/quiet-run.d.ts +31 -0
- package/dist/quiet-run.js +50 -0
- package/dist/quiet-run.js.map +1 -0
- package/dist/quota-notice-config.d.ts +22 -0
- package/dist/quota-notice-config.js +41 -0
- package/dist/quota-notice-config.js.map +1 -0
- package/dist/runtime-api.d.ts +13 -0
- package/dist/runtime-api.js +134 -2
- package/dist/runtime-api.js.map +1 -1
- package/dist/runtime-build-info.d.ts +2 -1
- package/dist/runtime-build-info.js +7 -3
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli-install.d.ts +153 -0
- package/dist/runtime-cli-install.js +675 -0
- package/dist/runtime-cli-install.js.map +1 -0
- package/dist/runtime-cli.js +157 -12
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client.d.ts +64 -2
- package/dist/runtime-client.js +277 -20
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +10 -1
- package/dist/runtime-coordinator.js +93 -2
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-credential-profiles.d.ts +11 -2
- package/dist/runtime-credential-profiles.js +28 -4
- package/dist/runtime-credential-profiles.js.map +1 -1
- package/dist/runtime-install.js +9 -6
- package/dist/runtime-install.js.map +1 -1
- package/dist/runtime-pane-link.js +2 -1
- package/dist/runtime-pane-link.js.map +1 -1
- package/dist/runtime-pane-service.js +2 -2
- package/dist/runtime-pane-service.js.map +1 -1
- package/dist/runtime-pane-store.d.ts +10 -0
- package/dist/runtime-pane-store.js +13 -1
- package/dist/runtime-pane-store.js.map +1 -1
- package/dist/runtime-profile-ownership.d.ts +66 -0
- package/dist/runtime-profile-ownership.js +391 -0
- package/dist/runtime-profile-ownership.js.map +1 -0
- package/dist/runtime-protocol.d.ts +88 -2
- package/dist/runtime-protocol.js +40 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/runtime-remote-accounts.d.ts +197 -0
- package/dist/runtime-remote-accounts.js +663 -0
- package/dist/runtime-remote-accounts.js.map +1 -0
- package/dist/runtime-remote-setup.d.ts +105 -0
- package/dist/runtime-remote-setup.js +529 -0
- package/dist/runtime-remote-setup.js.map +1 -0
- package/dist/runtime-signin-transport.d.ts +39 -0
- package/dist/runtime-signin-transport.js +110 -0
- package/dist/runtime-signin-transport.js.map +1 -0
- package/dist/runtime-signin.d.ts +132 -0
- package/dist/runtime-signin.js +289 -0
- package/dist/runtime-signin.js.map +1 -0
- package/dist/runtime-update-attention.d.ts +4 -0
- package/dist/runtime-update-attention.js +11 -0
- package/dist/runtime-update-attention.js.map +1 -0
- package/dist/runtime-update-controller.d.ts +75 -0
- package/dist/runtime-update-controller.js +691 -0
- package/dist/runtime-update-controller.js.map +1 -0
- package/dist/runtime-update-ipc.d.ts +42 -0
- package/dist/runtime-update-ipc.js +144 -0
- package/dist/runtime-update-ipc.js.map +1 -0
- package/dist/runtime-update-journal.d.ts +5 -0
- package/dist/runtime-update-journal.js +7 -0
- package/dist/runtime-update-journal.js.map +1 -1
- package/dist/runtime-update-lock.js +17 -2
- package/dist/runtime-update-lock.js.map +1 -1
- package/dist/runtime-update-status.d.ts +30 -0
- package/dist/runtime-update-status.js +31 -0
- package/dist/runtime-update-status.js.map +1 -0
- package/dist/settings-api.js +6 -2
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.d.ts +10 -0
- package/dist/settings-change.js +25 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +25 -1
- package/dist/settings-confirmation.js +11 -3
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.js +18 -6
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +21 -0
- package/dist/settings-http-confirmation.js +74 -3
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-instance-patch.js +1 -1
- package/dist/settings-instance-patch.js.map +1 -1
- package/dist/setup-wizard.js +3 -5
- package/dist/setup-wizard.js.map +1 -1
- package/dist/signin-keepalive.d.ts +203 -0
- package/dist/signin-keepalive.js +652 -0
- package/dist/signin-keepalive.js.map +1 -0
- package/dist/structured-signin-transport.js +4 -0
- package/dist/structured-signin-transport.js.map +1 -1
- package/dist/structured-signin.d.ts +7 -0
- package/dist/structured-signin.js +4 -2
- package/dist/structured-signin.js.map +1 -1
- package/dist/tips.js +4 -4
- package/dist/tips.js.map +1 -1
- package/dist/tmux-binary.d.ts +23 -23
- package/dist/tmux-binary.js +35 -46
- package/dist/tmux-binary.js.map +1 -1
- package/dist/tmux-exec-helper.js +3 -3
- package/dist/tmux-exec-helper.js.map +1 -1
- package/dist/tmux-legacy.d.ts +94 -0
- package/dist/tmux-legacy.js +309 -0
- package/dist/tmux-legacy.js.map +1 -0
- package/dist/tmux-manager.d.ts +7 -1
- package/dist/tmux-manager.js +21 -11
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tmux-rollback.d.ts +31 -0
- package/dist/tmux-rollback.js +72 -0
- package/dist/tmux-rollback.js.map +1 -0
- package/dist/tmux-server.d.ts +102 -0
- package/dist/tmux-server.js +248 -0
- package/dist/tmux-server.js.map +1 -0
- package/dist/transcript-monitor.js +43 -5
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-records.d.ts +2 -1
- package/dist/transcript-records.js +3 -0
- package/dist/transcript-records.js.map +1 -1
- package/dist/transcript-sources.js +3 -0
- package/dist/transcript-sources.js.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.js.map +1 -1
- package/dist/ui/accounts-keepalive.js +113 -0
- package/dist/ui/accounts-manage.js +237 -0
- package/dist/ui/accounts-view.js +191 -36
- package/dist/ui/agent-runtime-settings.js +2 -1
- package/dist/ui/app.html +8 -1
- package/dist/ui/backend-signin.js +12 -3
- package/dist/ui/general-location.js +28 -14
- package/dist/ui/hub-attachments.js +90 -0
- package/dist/ui/hub-chat-store.js +11 -5
- package/dist/ui/hub-client.js +20 -1
- package/dist/ui/hub-grant-strings.js +13 -0
- package/dist/ui/hub-owner-strings.js +6 -2
- package/dist/ui/hub-preview.js +101 -0
- package/dist/ui/hub-strings.js +4 -2
- package/dist/ui/machine-signin.js +56 -0
- package/dist/ui/panel-fleet.js +1 -1
- package/dist/ui/panel-hub.js +194 -54
- package/dist/ui/panel-log.js +2 -2
- package/dist/ui/panel-needs.js +14 -8
- package/dist/ui/panel-notices.js +4 -3
- package/dist/ui/panel-runtimes.js +32 -11
- package/dist/ui/panel-settings.js +18 -24
- package/dist/ui/panel-windows-agent.js +2 -1
- package/dist/ui/preview-pages.js +3 -41
- package/dist/ui/preview-panel-actions.js +3 -161
- package/dist/ui/preview-panel.js +10 -557
- package/dist/ui/preview-versions.js +3 -155
- package/dist/ui/runtime-cli-install.js +134 -0
- package/dist/ui/runtime-update-commands.d.ts +2 -0
- package/dist/ui/runtime-update-commands.js +11 -0
- package/dist/ui/runtime-update-status.js +53 -0
- package/dist/ui/search-dialog.js +3 -2
- package/dist/ui/settings-confirm.js +28 -0
- package/dist/ui/settings-devices.js +6 -10
- package/dist/ui/settings-guests.js +3 -2
- package/dist/ui/settings-hub-browser-certificate.js +2 -0
- package/dist/ui/settings-hub-membership.js +17 -11
- package/dist/ui/settings-hub-retention.js +2 -0
- package/dist/ui/settings-hub-section.js +35 -0
- package/dist/ui/settings-hub.js +17 -5
- package/dist/ui/settings-layout.js +6 -2
- package/dist/ui/settings-named-test.js +2 -2
- package/dist/ui/settings-outside.js +1 -1
- package/dist/ui/settings-quota-notice.js +102 -0
- package/dist/ui/settings-registry.js +4 -0
- package/dist/ui/settings-strings.js +6 -6
- package/dist/ui/settings-web-authority.js +2 -1
- package/dist/ui/shared/accounts-keepalive.css +7 -0
- package/dist/ui/shared/accounts.css +13 -0
- package/dist/ui/shared/app-i18n.js +4 -2
- package/dist/ui/shared/app-route.js +1 -1
- package/dist/ui/shared/app-shell.js +111 -8
- package/dist/ui/shared/app-store.js +2 -2
- package/dist/ui/shared/app.css +29 -0
- package/dist/ui/shared/app.js +2 -1
- package/dist/ui/shared/chat-strings.js +8 -8
- package/dist/ui/shared/hub-chat.css +1 -0
- package/dist/ui/shared/hub-owner.css +3 -3
- package/dist/ui/shared/hub-signin.css +24 -0
- package/dist/ui/shared/loading.css +37 -0
- package/dist/ui/shared/preview-pages.js +41 -0
- package/dist/ui/shared/preview-panel-actions.js +168 -0
- package/dist/ui/shared/preview-panel.js +565 -0
- package/dist/ui/shared/preview-versions.js +155 -0
- package/dist/ui/shared/runtime-install.css +4 -0
- package/dist/ui/shared/signin.js +68 -6
- package/dist/ui/shared/ui-states.js +14 -3
- package/dist/ui/shared/view-strings.js +4 -4
- package/dist/ui/shared/workspace-follow.css +19 -0
- package/dist/ui/signin.html +7 -3
- package/dist/ui/structured-signin.js +43 -11
- package/dist/ui/workspace-follow-strings.js +28 -0
- package/dist/ui/workspace-panel.js +225 -36
- package/dist/update-install.d.ts +7 -0
- package/dist/update-install.js +23 -0
- package/dist/update-install.js.map +1 -1
- package/dist/usage/providers.d.ts +6 -0
- package/dist/usage/providers.js +18 -9
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/quota-notices.d.ts +38 -0
- package/dist/usage/quota-notices.js +160 -0
- package/dist/usage/quota-notices.js.map +1 -0
- package/dist/usage/usage-api.d.ts +1 -0
- package/dist/usage/usage-api.js +16 -0
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/web-api.d.ts +38 -0
- package/dist/web-api.js +357 -14
- package/dist/web-api.js.map +1 -1
- package/dist/web-login.d.ts +35 -1
- package/dist/web-login.js +51 -5
- package/dist/web-login.js.map +1 -1
- package/dist/web-remote-access.d.ts +6 -0
- package/dist/web-remote-access.js +10 -1
- package/dist/web-remote-access.js.map +1 -1
- package/dist/web-session.d.ts +11 -0
- package/dist/web-session.js +38 -1
- package/dist/web-session.js.map +1 -1
- package/dist/web-shell-routes.d.ts +1 -1
- package/dist/web-shell-routes.js +1 -1
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/web-signin-link.d.ts +42 -0
- package/dist/web-signin-link.js +110 -0
- package/dist/web-signin-link.js.map +1 -0
- package/dist/windows-cli-api.d.ts +14 -0
- package/dist/windows-cli-api.js +21 -0
- package/dist/windows-cli-api.js.map +1 -1
- package/dist/windows-cli-worker.d.ts +3 -1
- package/dist/windows-cli-worker.js +18 -3
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/workspace-follow-parse.d.ts +36 -0
- package/dist/workspace-follow-parse.js +208 -0
- package/dist/workspace-follow-parse.js.map +1 -0
- package/dist/workspace-follow-records.d.ts +17 -0
- package/dist/workspace-follow-records.js +88 -0
- package/dist/workspace-follow-records.js.map +1 -0
- package/dist/workspace-follow.d.ts +41 -0
- package/dist/workspace-follow.js +143 -0
- package/dist/workspace-follow.js.map +1 -0
- package/dist/wsl-detect.d.ts +1 -0
- package/dist/wsl-detect.js +20 -0
- package/dist/wsl-detect.js.map +1 -0
- package/launcher/tmux-bundle.cjs +26 -10
- package/package.json +7 -2
- package/templates/runtime-install/install.ps1 +154 -13
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.7",
|
|
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": {
|
|
@@ -84,7 +84,11 @@
|
|
|
84
84
|
"@songsid/agend-node-darwin-arm64": "22.23.4",
|
|
85
85
|
"@songsid/agend-node-darwin-x64": "22.23.4",
|
|
86
86
|
"@songsid/agend-node-linux-arm64": "22.23.4",
|
|
87
|
-
"@songsid/agend-node-linux-x64": "22.23.4"
|
|
87
|
+
"@songsid/agend-node-linux-x64": "22.23.4",
|
|
88
|
+
"@songsid/agend-tmux-darwin-arm64": "3.8.0-agend.2",
|
|
89
|
+
"@songsid/agend-tmux-darwin-x64": "3.8.0-agend.2",
|
|
90
|
+
"@songsid/agend-tmux-linux-arm64": "3.8.0-agend.2",
|
|
91
|
+
"@songsid/agend-tmux-linux-x64": "3.8.0-agend.2"
|
|
88
92
|
},
|
|
89
93
|
"devDependencies": {
|
|
90
94
|
"@types/better-sqlite3": "^7.6.13",
|
|
@@ -96,6 +100,7 @@
|
|
|
96
100
|
"@xterm/addon-serialize": "0.14.0",
|
|
97
101
|
"@xterm/headless": "6.0.0",
|
|
98
102
|
"node-pty": "1.1.0",
|
|
103
|
+
"playwright-core": "1.64.0",
|
|
99
104
|
"tsx": "^4.23.15",
|
|
100
105
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
101
106
|
"vitest": "^4.1.12"
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
# code from AgEnD Settings, which you type in the terminal, and your approval in AgEnD.
|
|
27
27
|
#
|
|
28
28
|
# Optional, set in the same PowerShell window before running it:
|
|
29
|
+
# $env:AGEND_RUNTIME_REPAIR = '1' keep PATH unchanged; print run with an existing profile, never pairing steps
|
|
29
30
|
# $env:AGEND_RUNTIME_NO_PATH = '1' leave PATH alone (the final message then shows the full path to run)
|
|
30
31
|
# $env:AGEND_RUNTIME_INSTALL_DIR = 'D:\agend' install somewhere other than %LOCALAPPDATA%\agend-runtime
|
|
31
32
|
# If it fails it says why, leaves what was installed before untouched, and sets $LASTEXITCODE to 1.
|
|
@@ -90,11 +91,12 @@
|
|
|
90
91
|
}
|
|
91
92
|
# 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
93
|
# new content, never half of it. Nothing happens when the file already says this.
|
|
93
|
-
function Set-AgendFile([string]$Path, [string]$Text) {
|
|
94
|
+
function Set-AgendFile([string]$Path, [string]$Text, [scriptblock]$BeforeRename = $null) {
|
|
94
95
|
if ((Test-Path -LiteralPath $Path) -and ([IO.File]::ReadAllText($Path) -ceq $Text)) { return }
|
|
95
|
-
$new = $Path + '.new'
|
|
96
|
+
$new = $Path + '.' + [Guid]::NewGuid().ToString('N') + '.new'
|
|
96
97
|
[IO.File]::WriteAllText($new, $Text, [Text.Encoding]::ASCII)
|
|
97
98
|
try {
|
|
99
|
+
if ($BeforeRename) { & $BeforeRename }
|
|
98
100
|
# [NullString]::Value, not $null: PowerShell turns $null into an empty string for a string parameter, and Replace refuses that.
|
|
99
101
|
if (Test-Path -LiteralPath $Path) { [IO.File]::Replace($new, $Path, [NullString]::Value) } else { [IO.File]::Move($new, $Path) }
|
|
100
102
|
} catch {
|
|
@@ -102,6 +104,132 @@
|
|
|
102
104
|
throw ('Could not update ' + $Path + ' (' + $_.Exception.Message + '). Close any agend-runtime window that is starting, then run the install command again.')
|
|
103
105
|
}
|
|
104
106
|
}
|
|
107
|
+
function Assert-AgendDirectory([string]$Path) {
|
|
108
|
+
$entry = Get-Item -LiteralPath $Path -Force -ErrorAction Stop
|
|
109
|
+
if (-not $entry.PSIsContainer -or ($entry.Attributes -band [IO.FileAttributes]::ReparsePoint)) { throw 'The installation directory is unsafe or changed.' }
|
|
110
|
+
}
|
|
111
|
+
function Read-AgendSmallFile([string]$Path, [int]$Limit) {
|
|
112
|
+
try { $entry = Get-Item -LiteralPath $Path -Force -ErrorAction Stop }
|
|
113
|
+
catch [Management.Automation.ItemNotFoundException] { return $null }
|
|
114
|
+
if ($entry.PSIsContainer -or ($entry.Attributes -band [IO.FileAttributes]::ReparsePoint) -or [string]$entry.LinkType -ne '' -or $entry.Length -gt $Limit) { throw 'Installation metadata is unsafe or too large.' }
|
|
115
|
+
$stream = [IO.File]::Open($Path, [IO.FileMode]::Open, [IO.FileAccess]::Read, [IO.FileShare]::Read)
|
|
116
|
+
try {
|
|
117
|
+
$bytes = New-Object byte[] ($Limit + 1); $length = 0
|
|
118
|
+
while ($length -lt $bytes.Length) { $count = $stream.Read($bytes, $length, $bytes.Length - $length); if ($count -eq 0) { break }; $length += $count }
|
|
119
|
+
if ($length -gt $Limit) { throw 'Installation metadata grew beyond its bound.' }
|
|
120
|
+
return ([Text.UTF8Encoding]::new($false, $true)).GetString($bytes, 0, $length)
|
|
121
|
+
} finally { $stream.Dispose() }
|
|
122
|
+
}
|
|
123
|
+
function Get-AgendBootProof {
|
|
124
|
+
$ticks = [string](Get-CimInstance Win32_OperatingSystem -ErrorAction Stop).LastBootUpTime.ToUniversalTime().Ticks
|
|
125
|
+
if ($ticks -notmatch '\A\d{17,20}\z') { throw 'Windows process ownership could not be verified.' }
|
|
126
|
+
$sha = [Security.Cryptography.SHA256]::Create()
|
|
127
|
+
try { return ([BitConverter]::ToString($sha.ComputeHash([Text.Encoding]::UTF8.GetBytes('agend-windows-boot-v1:' + $ticks))) -replace '-', '').ToLowerInvariant() }
|
|
128
|
+
finally { $sha.Dispose() }
|
|
129
|
+
}
|
|
130
|
+
function Test-AgendOwnerRecord($Owner) {
|
|
131
|
+
$keys = @($Owner.PSObject.Properties.Name)
|
|
132
|
+
if ($keys.Count -ne 6 -or @($keys | Where-Object { $_ -cnotin 'version','type','nonce','pid','birth','boot' }).Count -ne 0 -or -not ($Owner.version -is [int] -or $Owner.version -is [long]) -or $Owner.version -ne 1 -or -not ($Owner.type -is [string]) -or -not ($Owner.nonce -is [string]) -or -not ($Owner.birth -is [string]) -or -not ($Owner.boot -is [string]) -or $Owner.type -cnotin 'installer','supervisor' -or
|
|
133
|
+
[string]$Owner.nonce -notmatch '\A[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\z' -or
|
|
134
|
+
-not ($Owner.pid -is [int] -or $Owner.pid -is [long]) -or $Owner.pid -lt 1 -or [string]$Owner.birth -notmatch '\A\d{17,20}\z' -or [string]$Owner.boot -notmatch '\A[a-f0-9]{64}\z') { throw 'The install lock owner is unconfirmed; use a fresh or separate installation.' }
|
|
135
|
+
}
|
|
136
|
+
function Get-AgendProcessMatch($Owner, [string]$Boot) {
|
|
137
|
+
try { $process = [Diagnostics.Process]::GetProcessById($Owner.pid) }
|
|
138
|
+
catch [ArgumentException] { return 'gone' }
|
|
139
|
+
catch { return 'unknown' }
|
|
140
|
+
try {
|
|
141
|
+
$birth = [string]$process.StartTime.ToUniversalTime().Ticks
|
|
142
|
+
if ($birth -cne [string]$Owner.birth -or $Boot -cne [string]$Owner.boot) { return 'gone' }
|
|
143
|
+
return 'alive'
|
|
144
|
+
} catch { return 'unknown' }
|
|
145
|
+
finally { $process.Dispose() }
|
|
146
|
+
}
|
|
147
|
+
function Read-AgendLock([string]$Path) {
|
|
148
|
+
Assert-AgendDirectory $Path
|
|
149
|
+
$raw = Read-AgendSmallFile (Join-Path $Path 'owner.json') 2048
|
|
150
|
+
if ($null -eq $raw) { throw 'The install lock is incomplete; use a fresh or separate installation.' }
|
|
151
|
+
$owner = $raw | ConvertFrom-Json; Test-AgendOwnerRecord $owner
|
|
152
|
+
return @{ path=$Path; raw=$raw; owner=$owner; birth=[string](Get-Item -LiteralPath $Path -Force).CreationTimeUtc.Ticks }
|
|
153
|
+
}
|
|
154
|
+
function Assert-AgendLock($Lock) {
|
|
155
|
+
$now = Read-AgendLock $Lock.path
|
|
156
|
+
if ($now.birth -cne $Lock.birth -or $now.raw -cne $Lock.raw) { throw 'Installation ownership changed; nothing was switched.' }
|
|
157
|
+
}
|
|
158
|
+
function Remove-AgendLock($Lock) {
|
|
159
|
+
Assert-AgendLock $Lock
|
|
160
|
+
if (@(Get-ChildItem -LiteralPath $Lock.path -Force | Where-Object { $_.Name -cne 'owner.json' }).Count -ne 0) { throw 'Installation cleanup is unconfirmed; its ownership was retained.' }
|
|
161
|
+
[IO.File]::Delete((Join-Path $Lock.path 'owner.json'))
|
|
162
|
+
try { [IO.Directory]::Delete($Lock.path) }
|
|
163
|
+
catch {
|
|
164
|
+
try {
|
|
165
|
+
Assert-AgendDirectory $Lock.path
|
|
166
|
+
if ([string](Get-Item -LiteralPath $Lock.path -Force).CreationTimeUtc.Ticks -ceq $Lock.birth -and $null -eq (Read-AgendSmallFile (Join-Path $Lock.path 'owner.json') 2048)) {
|
|
167
|
+
[IO.File]::WriteAllText((Join-Path $Lock.path 'owner.json'), $Lock.raw, [Text.UTF8Encoding]::new($false))
|
|
168
|
+
}
|
|
169
|
+
} catch { }
|
|
170
|
+
throw 'Installation cleanup is unconfirmed; inspect or retry this installation.'
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function Enter-AgendInstallLock([string]$Root) {
|
|
174
|
+
Assert-AgendDirectory $Root
|
|
175
|
+
$boot = Get-AgendBootProof; $process = [Diagnostics.Process]::GetCurrentProcess()
|
|
176
|
+
try { $birth = [string]$process.StartTime.ToUniversalTime().Ticks } finally { $process.Dispose() }
|
|
177
|
+
$owner = [pscustomobject][ordered]@{version=1;type='installer';nonce=[Guid]::NewGuid().ToString();pid=[int]$PID;birth=$birth;boot=$boot}
|
|
178
|
+
$raw = $owner | ConvertTo-Json -Compress
|
|
179
|
+
$candidate = Join-Path $Root ('.agend-lock-' + [Guid]::NewGuid().ToString('N')); $null = [IO.Directory]::CreateDirectory($candidate)
|
|
180
|
+
[IO.File]::WriteAllText((Join-Path $candidate 'owner.json'), $raw, [Text.UTF8Encoding]::new($false))
|
|
181
|
+
$created = Read-AgendLock $candidate; $path = Join-Path $Root '.agend-runtime-install.lock'
|
|
182
|
+
try {
|
|
183
|
+
try { [IO.Directory]::Move($candidate, $path); return (Read-AgendLock $path) }
|
|
184
|
+
catch { if (-not [IO.Directory]::Exists($path)) { throw } }
|
|
185
|
+
$previous = Read-AgendLock $path
|
|
186
|
+
if ((Get-AgendProcessMatch $previous.owner $boot) -cne 'gone') { throw 'Another installer or Runtime owns this installation. Retry when it is finished.' }
|
|
187
|
+
# Move an owned empty directory into the election slot: unlike CreateDirectory, Move refuses an existing slot atomically.
|
|
188
|
+
$guard = Join-Path $Root ('.agend-reclaim-' + [Guid]::NewGuid().ToString('N')); $null = [IO.Directory]::CreateDirectory($guard)
|
|
189
|
+
$claim = [Guid]::NewGuid().ToString(); [IO.File]::WriteAllText((Join-Path $guard 'claim.json'), $claim, [Text.Encoding]::ASCII)
|
|
190
|
+
$election = Join-Path $path 'reclaim'; $elected = $false
|
|
191
|
+
try {
|
|
192
|
+
[IO.Directory]::Move($guard, $election); $elected = $true
|
|
193
|
+
Assert-AgendLock $previous
|
|
194
|
+
if (@(Get-ChildItem -LiteralPath $path -Force | Where-Object { $_.Name -cnotin 'owner.json','reclaim' }).Count -ne 0) { throw 'Uncertain installation work remains; ownership was retained.' }
|
|
195
|
+
[IO.File]::Delete((Join-Path $path 'owner.json'))
|
|
196
|
+
[IO.File]::Delete((Join-Path $election 'claim.json')); [IO.Directory]::Delete($election); $elected = $false
|
|
197
|
+
[IO.Directory]::Delete($path)
|
|
198
|
+
} finally {
|
|
199
|
+
$ownedGuard = if ($elected) { $election } else { $guard }
|
|
200
|
+
if ([IO.Directory]::Exists($ownedGuard) -and (Read-AgendSmallFile (Join-Path $ownedGuard 'claim.json') 128) -ceq $claim) {
|
|
201
|
+
[IO.File]::Delete((Join-Path $ownedGuard 'claim.json')); [IO.Directory]::Delete($ownedGuard)
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
[IO.Directory]::Move($candidate, $path); return (Read-AgendLock $path)
|
|
205
|
+
} finally { if ([IO.Directory]::Exists($candidate)) { Remove-AgendLock $created } }
|
|
206
|
+
}
|
|
207
|
+
function Register-AgendInstallOrigin([string]$Root, [string]$Origin, [bool]$Fresh, $Lock) {
|
|
208
|
+
Assert-AgendLock $Lock
|
|
209
|
+
$path = Join-Path $Root '.agend-runtime-install.json'; $raw = Read-AgendSmallFile $path 20000
|
|
210
|
+
if ($null -eq $raw) {
|
|
211
|
+
if (-not $Fresh) { return }
|
|
212
|
+
$receipt = [pscustomobject][ordered]@{version=1;id=[Guid]::NewGuid().ToString();createdAt=[long][Math]::Floor(([DateTime]::UtcNow - [DateTime]'1970-01-01T00:00:00Z').TotalMilliseconds);revision=1;origins=@($Origin);shared=$false}
|
|
213
|
+
} else {
|
|
214
|
+
$receipt = $raw | ConvertFrom-Json; $keys = @($receipt.PSObject.Properties.Name)
|
|
215
|
+
if ($keys.Count -ne 6 -or @($keys | Where-Object { $_ -cnotin 'version','id','createdAt','revision','origins','shared' }).Count -ne 0 -or -not ($receipt.version -is [int] -or $receipt.version -is [long]) -or $receipt.version -ne 1 -or -not ($receipt.id -is [string]) -or
|
|
216
|
+
[string]$receipt.id -notmatch '\A[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\z' -or
|
|
217
|
+
-not ($receipt.createdAt -is [int] -or $receipt.createdAt -is [long]) -or $receipt.createdAt -lt 1 -or $receipt.createdAt -gt 9007199254740991 -or
|
|
218
|
+
-not ($receipt.revision -is [int] -or $receipt.revision -is [long]) -or $receipt.revision -lt 1 -or $receipt.revision -ge 9007199254740991 -or
|
|
219
|
+
-not ($receipt.origins -is [Array]) -or $receipt.origins.Count -lt 1 -or $receipt.origins.Count -gt 8 -or -not ($receipt.shared -is [bool])) { throw 'The managed-install receipt is unconfirmed; use a fresh or separate installation.' }
|
|
220
|
+
$seen = @{}
|
|
221
|
+
foreach ($entry in $receipt.origins) {
|
|
222
|
+
if (-not ($entry -is [string]) -or (Resolve-AgendOrigin $entry) -cne $entry -or $seen.ContainsKey($entry)) { throw 'The managed-install origins are unconfirmed.' }
|
|
223
|
+
$seen[$entry] = $true
|
|
224
|
+
}
|
|
225
|
+
if ($receipt.origins.Count -gt 1 -and -not $receipt.shared) { throw 'The shared-install receipt is unconfirmed.' }
|
|
226
|
+
if ($receipt.origins -ccontains $Origin) { return }
|
|
227
|
+
if ($receipt.origins.Count -ge 8) { throw 'This installation has too many origins. Use a separate fresh install; pairing is kept.' }
|
|
228
|
+
$receipt.origins = @($receipt.origins) + @($Origin); $receipt.shared = $true; $receipt.revision++
|
|
229
|
+
}
|
|
230
|
+
Set-AgendFile $path ($receipt | ConvertTo-Json -Depth 4 -Compress) { Assert-AgendLock $Lock; if ((Read-AgendSmallFile $path 20000) -cne $raw) { throw 'The managed-install receipt changed; nothing was switched.' } }
|
|
231
|
+
}
|
|
232
|
+
|
|
105
233
|
# Adds a folder to the USER PATH in the registry, keeping its value kind: [Environment]::SetEnvironmentVariable would turn a
|
|
106
234
|
# REG_EXPAND_SZ PATH into plain REG_SZ and stop its %VARIABLES% entries expanding, and setx truncates at 1024 characters, so
|
|
107
235
|
# neither is used. An entry already there (written out or with %VARIABLES%) is not added again.
|
|
@@ -146,7 +274,7 @@
|
|
|
146
274
|
'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
275
|
'exit /b 1', '') -join "`r`n"
|
|
148
276
|
|
|
149
|
-
$tmp = $null
|
|
277
|
+
$tmp = $null; $installLock = $null
|
|
150
278
|
try {
|
|
151
279
|
try { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor 3072 } catch { }
|
|
152
280
|
|
|
@@ -189,6 +317,10 @@
|
|
|
189
317
|
$marker = Join-Path $target '.agend-install-sha256'
|
|
190
318
|
$createdRoot = -not (Test-Path -LiteralPath $root)
|
|
191
319
|
$null = New-Item -ItemType Directory -Path $root -Force
|
|
320
|
+
$installLock = Enter-AgendInstallLock $root
|
|
321
|
+
$freshReceipt = $createdRoot -and @(Get-ChildItem -LiteralPath $root -Force | Where-Object { $_.Name -cne '.agend-runtime-install.lock' }).Count -eq 0
|
|
322
|
+
$current = Join-Path $bin 'current.txt'
|
|
323
|
+
$beforeCurrent = Read-AgendSmallFile $current 90
|
|
192
324
|
|
|
193
325
|
# 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
326
|
# not hold this build can only be one that was changed by hand or left incomplete, and is left alone too.
|
|
@@ -231,8 +363,9 @@
|
|
|
231
363
|
$current = Join-Path $bin 'current.txt'
|
|
232
364
|
$was = ''
|
|
233
365
|
if (Test-Path -LiteralPath $current) { $was = ([IO.File]::ReadAllText($current)).Trim() }
|
|
366
|
+
Register-AgendInstallOrigin $root $origin $freshReceipt $installLock
|
|
234
367
|
Set-AgendFile $shim $shimText
|
|
235
|
-
Set-AgendFile $current $folder
|
|
368
|
+
Set-AgendFile $current $folder { Assert-AgendLock $installLock; if ((Read-AgendSmallFile $current 90) -cne $beforeCurrent) { throw 'The selected Runtime changed during installation; nothing was switched.' } }
|
|
236
369
|
if ($was -ne '' -and $was -ne $folder) {
|
|
237
370
|
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
371
|
}
|
|
@@ -241,8 +374,8 @@
|
|
|
241
374
|
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
375
|
|
|
243
376
|
$onPath = $false
|
|
244
|
-
if ([string]$env:AGEND_RUNTIME_NO_PATH -eq '1') {
|
|
245
|
-
Write-Step '
|
|
377
|
+
if ([string]$env:AGEND_RUNTIME_NO_PATH -eq '1' -or [string]$env:AGEND_RUNTIME_REPAIR -eq '1') {
|
|
378
|
+
Write-Step 'your PATH was not changed.'
|
|
246
379
|
} else {
|
|
247
380
|
if (Add-UserPathEntry $bin) { Write-Step ('added ' + $bin + ' to your user PATH.') } else { Write-Step ($bin + ' is already on your user PATH.') }
|
|
248
381
|
$sessionHas = $false
|
|
@@ -252,18 +385,26 @@
|
|
|
252
385
|
}
|
|
253
386
|
|
|
254
387
|
Write-Host ''
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
388
|
+
if ([string]$env:AGEND_RUNTIME_REPAIR -eq '1') {
|
|
389
|
+
Write-Host 'AgEnD Runtime is installed. Keep your existing profile and pairing; PATH was not changed.'
|
|
390
|
+
Write-Host 'Use the same existing profile folder, including any previous --profile or AGEND_RUNTIME_HOME. Run this exact new executable and enter that folder:'
|
|
391
|
+
$literalShim = $shim.Replace("'", "''")
|
|
392
|
+
Write-Host (' $agendProfile = $null; $agendProfile = Read-Host ''Existing Runtime profile folder (same as before)''; if ($agendProfile) { & ''' + $literalShim + ''' run --profile $agendProfile } else { throw ''Existing Runtime profile folder is required'' }')
|
|
393
|
+
} else {
|
|
394
|
+
Write-Host 'AgEnD Runtime is installed. This computer is not connected yet and nothing has been paired.'
|
|
395
|
+
Write-Host 'Next, connect it. Open Settings -> Runtime -> Connect a computer in AgEnD for the one-time pairing code, then run:'
|
|
396
|
+
Write-Host ''
|
|
397
|
+
if ($onPath) { Write-Host (' agend-runtime connect --server "' + $origin + '"') }
|
|
398
|
+
else { Write-Host (' & "' + $shim + '" connect --server "' + $origin + '"') }
|
|
399
|
+
Write-Host ''
|
|
400
|
+
Write-Host 'Type the pairing code when asked, compare the fingerprint with the one AgEnD shows, then approve this computer in AgEnD.'
|
|
401
|
+
}
|
|
262
402
|
} catch {
|
|
263
403
|
Write-Problem ('install failed: ' + $_.Exception.Message)
|
|
264
404
|
$global:LASTEXITCODE = 1
|
|
265
405
|
} finally {
|
|
266
406
|
if ($tmp -and (Test-Path -LiteralPath $tmp)) { Remove-Item -LiteralPath $tmp -Recurse -Force -ErrorAction SilentlyContinue }
|
|
407
|
+
if ($installLock) { try { Remove-AgendLock $installLock } catch { Write-Problem 'Installation cleanup is unconfirmed; ownership was retained.'; $global:LASTEXITCODE = 1 } }
|
|
267
408
|
# A run that installed nothing leaves nothing: the install folder this run created is removed again, but only while it is still empty.
|
|
268
409
|
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
410
|
}
|