@songsid/agend 2.3.4 → 2.3.5-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/README.zh-TW.md +2 -0
- package/THIRD_PARTY_NOTICES.md +67 -0
- package/dist/accounts-profiles.d.ts +102 -0
- package/dist/accounts-profiles.js +194 -0
- package/dist/accounts-profiles.js.map +1 -0
- package/dist/accounts-signout.d.ts +59 -0
- package/dist/accounts-signout.js +181 -0
- package/dist/accounts-signout.js.map +1 -0
- package/dist/accounts-view.d.ts +182 -0
- package/dist/accounts-view.js +204 -0
- package/dist/accounts-view.js.map +1 -0
- package/dist/agent-cli-instructions.md +3 -3
- package/dist/agent-cli.js +5 -2
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.d.ts +5 -1
- package/dist/agent-endpoint.js +12 -2
- 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-whats-new.js +5 -0
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/agent-workspace.d.ts +104 -0
- package/dist/agent-workspace.js +381 -0
- package/dist/agent-workspace.js.map +1 -0
- package/dist/apply-job.d.ts +5 -0
- package/dist/apply-job.js +10 -3
- package/dist/apply-job.js.map +1 -1
- package/dist/auth-api.d.ts +81 -1
- package/dist/auth-api.js +365 -14
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/company-join.d.ts +16 -0
- package/dist/authority/company-join.js +37 -0
- package/dist/authority/company-join.js.map +1 -0
- package/dist/authority/hub-initialization.d.ts +13 -0
- package/dist/authority/hub-initialization.js +30 -0
- package/dist/authority/hub-initialization.js.map +1 -0
- 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/settings-role.d.ts +56 -0
- package/dist/authority/settings-role.js +48 -0
- package/dist/authority/settings-role.js.map +1 -0
- package/dist/authority/web-authority.d.ts +25 -2
- package/dist/authority/web-authority.js +37 -4
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/backend/claude-code.d.ts +18 -12
- package/dist/backend/claude-code.js +228 -145
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/cli-env-probe.js +6 -2
- package/dist/backend/cli-env-probe.js.map +1 -1
- package/dist/backend/codex-footer-hints.d.ts +3 -0
- package/dist/backend/codex-footer-hints.js +14 -0
- package/dist/backend/codex-footer-hints.js.map +1 -1
- package/dist/backend/codex-package.d.ts +5 -2
- package/dist/backend/codex-package.js +1 -5
- package/dist/backend/codex-package.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.d.ts +148 -116
- package/dist/backend/codex.js +1355 -1225
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/credential-profile.d.ts +2 -0
- package/dist/backend/credential-profile.js +4 -1
- package/dist/backend/credential-profile.js.map +1 -1
- package/dist/backend/grok-model-cache.d.ts +7 -0
- package/dist/backend/grok-model-cache.js +65 -0
- package/dist/backend/grok-model-cache.js.map +1 -0
- 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 +32 -1
- package/dist/backend/grok.js +323 -54
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro.js +1 -1
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/native-pane.d.ts +11 -0
- package/dist/backend/native-pane.js +59 -0
- package/dist/backend/native-pane.js.map +1 -0
- package/dist/backend/types.d.ts +25 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-availability.d.ts +15 -0
- package/dist/backend-availability.js +37 -1
- package/dist/backend-availability.js.map +1 -1
- package/dist/backend-signin-pending.d.ts +8 -2
- package/dist/backend-signin-pending.js +6 -2
- package/dist/backend-signin-pending.js.map +1 -1
- package/dist/browser-backend-signins.d.ts +2 -1
- package/dist/browser-backend-signins.js +1 -1
- package/dist/browser-backend-signins.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/bundled-tmux-guard.d.ts +23 -0
- package/dist/bundled-tmux-guard.js +90 -0
- package/dist/bundled-tmux-guard.js.map +1 -0
- package/dist/cache-service.d.ts +6 -0
- package/dist/cache-service.js +105 -0
- package/dist/cache-service.js.map +1 -1
- 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/ipc-bridge.d.ts +2 -0
- package/dist/channel/mcp-tools.js +7 -7
- package/dist/channel/mcp-tools.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/claude-auth-status.d.ts +60 -0
- package/dist/claude-auth-status.js +165 -0
- package/dist/claude-auth-status.js.map +1 -0
- package/dist/claude-model-minimum.d.ts +7 -0
- package/dist/claude-model-minimum.js +16 -0
- package/dist/claude-model-minimum.js.map +1 -0
- package/dist/cli-audited.d.ts +60 -0
- package/dist/cli-audited.js +84 -0
- package/dist/cli-audited.js.map +1 -0
- package/dist/cli-capability.d.ts +217 -0
- package/dist/cli-capability.js +55 -0
- package/dist/cli-capability.js.map +1 -0
- package/dist/cli-caps-module.d.ts +33 -0
- package/dist/cli-caps-module.js +45 -0
- package/dist/cli-caps-module.js.map +1 -0
- package/dist/cli-registry-check.d.ts +28 -0
- package/dist/cli-registry-check.js +237 -0
- package/dist/cli-registry-check.js.map +1 -0
- package/dist/cli-registry.d.ts +578 -0
- package/dist/cli-registry.js +83 -0
- package/dist/cli-registry.js.map +1 -0
- package/dist/cli-spec-antigravity.d.ts +71 -0
- package/dist/cli-spec-antigravity.js +47 -0
- package/dist/cli-spec-antigravity.js.map +1 -0
- package/dist/cli-spec-claude-code.d.ts +93 -0
- package/dist/cli-spec-claude-code.js +37 -0
- package/dist/cli-spec-claude-code.js.map +1 -0
- package/dist/cli-spec-codex.d.ts +87 -0
- package/dist/cli-spec-codex.js +40 -0
- package/dist/cli-spec-codex.js.map +1 -0
- package/dist/cli-spec-grok.d.ts +64 -0
- package/dist/cli-spec-grok.js +40 -0
- package/dist/cli-spec-grok.js.map +1 -0
- package/dist/cli-spec-kiro-cli.d.ts +79 -0
- package/dist/cli-spec-kiro-cli.js +40 -0
- package/dist/cli-spec-kiro-cli.js.map +1 -0
- package/dist/cli-spec-muse.d.ts +54 -0
- package/dist/cli-spec-muse.js +40 -0
- package/dist/cli-spec-muse.js.map +1 -0
- package/dist/cli-spec-opencode.d.ts +60 -0
- package/dist/cli-spec-opencode.js +42 -0
- package/dist/cli-spec-opencode.js.map +1 -0
- package/dist/cli.js +286 -68
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +99 -2
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +19 -1
- package/dist/config.js.map +1 -1
- package/dist/daemon.d.ts +165 -7
- package/dist/daemon.js +1307 -307
- 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/decision-list.d.ts +2 -0
- package/dist/decision-list.js +1 -1
- package/dist/decision-list.js.map +1 -1
- package/dist/delivery-consumed-watch.d.ts +15 -3
- package/dist/delivery-consumed-watch.js +23 -1
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/delivery-outbox.d.ts +5 -0
- package/dist/delivery-outbox.js +32 -4
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/delivery-reconciliation.d.ts +2 -42
- package/dist/delivery-reconciliation.js +2 -164
- package/dist/delivery-reconciliation.js.map +1 -1
- package/dist/doctor.js +19 -9
- 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-context.d.ts +7 -3
- package/dist/fleet-control-audit.d.ts +1 -1
- package/dist/fleet-level-config.d.ts +1 -1
- package/dist/fleet-level-config.js +2 -0
- package/dist/fleet-level-config.js.map +1 -1
- package/dist/fleet-manager.d.ts +1108 -27
- package/dist/fleet-manager.js +5735 -462
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-process-handlers.d.ts +1 -1
- package/dist/fleet-process-handlers.js +3 -2
- package/dist/fleet-process-handlers.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +98 -0
- package/dist/fleet-windows-runtime.js +467 -0
- package/dist/fleet-windows-runtime.js.map +1 -0
- package/dist/general-binding.d.ts +85 -0
- package/dist/general-binding.js +298 -0
- package/dist/general-binding.js.map +1 -0
- package/dist/general-host-owner.d.ts +8 -0
- package/dist/general-host-owner.js +26 -0
- package/dist/general-host-owner.js.map +1 -0
- package/dist/general-instance.d.ts +7 -0
- package/dist/general-instance.js +20 -3
- package/dist/general-instance.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +101 -39
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +23 -9
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +9 -1
- package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +4 -1
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +12 -0
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +3 -3
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +4 -0
- 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 +51 -33
- package/dist/general-knowledge/steering/core-rules.md +7 -5
- package/dist/general-role.d.ts +5 -0
- package/dist/general-role.js +27 -0
- package/dist/general-role.js.map +1 -0
- 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 +348 -0
- package/dist/hub/buttons.js.map +1 -0
- package/dist/hub/catalog.d.ts +74 -0
- package/dist/hub/catalog.js +380 -0
- package/dist/hub/catalog.js.map +1 -0
- package/dist/hub/client.d.ts +69 -0
- package/dist/hub/client.js +304 -0
- package/dist/hub/client.js.map +1 -0
- package/dist/hub/compose/member.d.ts +145 -0
- package/dist/hub/compose/member.js +458 -0
- package/dist/hub/compose/member.js.map +1 -0
- package/dist/hub/compose/server.d.ts +167 -0
- package/dist/hub/compose/server.js +477 -0
- package/dist/hub/compose/server.js.map +1 -0
- package/dist/hub/compose/storage.d.ts +5 -0
- package/dist/hub/compose/storage.js +28 -0
- package/dist/hub/compose/storage.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 +58 -0
- package/dist/hub/db.js +215 -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 +25 -0
- package/dist/hub/directory/directory.js +526 -0
- package/dist/hub/directory/directory.js.map +1 -0
- package/dist/hub/directory/groups.d.ts +41 -0
- package/dist/hub/directory/groups.js +30 -0
- package/dist/hub/directory/groups.js.map +1 -0
- package/dist/hub/directory/index.d.ts +8 -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 +83 -0
- package/dist/hub/directory/types.js +14 -0
- package/dist/hub/directory/types.js.map +1 -0
- package/dist/hub/directory-response-owner.d.ts +38 -0
- package/dist/hub/directory-response-owner.js +191 -0
- package/dist/hub/directory-response-owner.js.map +1 -0
- package/dist/hub/enrollment-budget.d.ts +6 -0
- package/dist/hub/enrollment-budget.js +24 -0
- package/dist/hub/enrollment-budget.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/group-policy/admin-api.d.ts +30 -0
- package/dist/hub/group-policy/admin-api.js +83 -0
- package/dist/hub/group-policy/admin-api.js.map +1 -0
- 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-control.d.ts +34 -0
- package/dist/hub/group-policy/admin-control.js +258 -0
- package/dist/hub/group-policy/admin-control.js.map +1 -0
- package/dist/hub/group-policy/admin-dto.d.ts +249 -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-facts.d.ts +17 -0
- package/dist/hub/group-policy/admin-facts.js +33 -0
- package/dist/hub/group-policy/admin-facts.js.map +1 -0
- package/dist/hub/group-policy/admin-impact.d.ts +51 -0
- package/dist/hub/group-policy/admin-impact.js +88 -0
- package/dist/hub/group-policy/admin-impact.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 +95 -0
- package/dist/hub/group-policy/admin-read.js.map +1 -0
- package/dist/hub/group-policy/authorization.d.ts +65 -0
- package/dist/hub/group-policy/authorization.js +315 -0
- package/dist/hub/group-policy/authorization.js.map +1 -0
- package/dist/hub/group-policy/impact-inventory.d.ts +21 -0
- package/dist/hub/group-policy/impact-inventory.js +75 -0
- package/dist/hub/group-policy/impact-inventory.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 +72 -0
- package/dist/hub/group-policy/resources.js +260 -0
- package/dist/hub/group-policy/resources.js.map +1 -0
- package/dist/hub/group-policy/store.d.ts +69 -0
- package/dist/hub/group-policy/store.js +210 -0
- package/dist/hub/group-policy/store.js.map +1 -0
- package/dist/hub/group-policy/welcome.d.ts +36 -0
- package/dist/hub/group-policy/welcome.js +55 -0
- package/dist/hub/group-policy/welcome.js.map +1 -0
- package/dist/hub/http/compose.d.ts +24 -0
- package/dist/hub/http/compose.js +739 -0
- package/dist/hub/http/compose.js.map +1 -0
- package/dist/hub/http/core.d.ts +71 -0
- package/dist/hub/http/core.js +266 -0
- package/dist/hub/http/core.js.map +1 -0
- package/dist/hub/http/deps.d.ts +79 -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 +84 -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 +14 -0
- package/dist/hub/init/browser-certificate.js +99 -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 +229 -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 +34 -0
- package/dist/hub/init/initializer.js +504 -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 +142 -0
- package/dist/hub/init/types.js +9 -0
- package/dist/hub/init/types.js.map +1 -0
- package/dist/hub/init/web-audit-import.d.ts +12 -0
- package/dist/hub/init/web-audit-import.js +39 -0
- package/dist/hub/init/web-audit-import.js.map +1 -0
- package/dist/hub/init/web-audit.d.ts +30 -0
- package/dist/hub/init/web-audit.js +42 -0
- package/dist/hub/init/web-audit.js.map +1 -0
- package/dist/hub/init/web-error.d.ts +6 -0
- package/dist/hub/init/web-error.js +8 -0
- package/dist/hub/init/web-error.js.map +1 -0
- package/dist/hub/init/web-http.d.ts +9 -0
- package/dist/hub/init/web-http.js +103 -0
- package/dist/hub/init/web-http.js.map +1 -0
- package/dist/hub/init/web.d.ts +118 -0
- package/dist/hub/init/web.js +428 -0
- package/dist/hub/init/web.js.map +1 -0
- package/dist/hub/init/wizard.d.ts +34 -0
- package/dist/hub/init/wizard.js +552 -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/join/client.d.ts +35 -0
- package/dist/hub/join/client.js +112 -0
- package/dist/hub/join/client.js.map +1 -0
- package/dist/hub/join/descriptor.d.ts +45 -0
- package/dist/hub/join/descriptor.js +52 -0
- package/dist/hub/join/descriptor.js.map +1 -0
- package/dist/hub/join/fleet-authority.d.ts +2 -0
- package/dist/hub/join/fleet-authority.js +3 -0
- package/dist/hub/join/fleet-authority.js.map +1 -0
- package/dist/hub/join/http.d.ts +8 -0
- package/dist/hub/join/http.js +112 -0
- package/dist/hub/join/http.js.map +1 -0
- package/dist/hub/join/invitation.d.ts +28 -0
- package/dist/hub/join/invitation.js +28 -0
- package/dist/hub/join/invitation.js.map +1 -0
- package/dist/hub/join/local-journal.d.ts +84 -0
- package/dist/hub/join/local-journal.js +65 -0
- package/dist/hub/join/local-journal.js.map +1 -0
- package/dist/hub/join/local.d.ts +116 -0
- package/dist/hub/join/local.js +419 -0
- package/dist/hub/join/local.js.map +1 -0
- package/dist/hub/join/private.d.ts +3 -0
- package/dist/hub/join/private.js +46 -0
- package/dist/hub/join/private.js.map +1 -0
- package/dist/hub/join/protocol.d.ts +69 -0
- package/dist/hub/join/protocol.js +96 -0
- package/dist/hub/join/protocol.js.map +1 -0
- package/dist/hub/join/receipt.d.ts +42 -0
- package/dist/hub/join/receipt.js +75 -0
- package/dist/hub/join/receipt.js.map +1 -0
- package/dist/hub/join/service.d.ts +177 -0
- package/dist/hub/join/service.js +564 -0
- package/dist/hub/join/service.js.map +1 -0
- package/dist/hub/join/store.d.ts +97 -0
- package/dist/hub/join/store.js +87 -0
- package/dist/hub/join/store.js.map +1 -0
- package/dist/hub/join/trust.d.ts +13 -0
- package/dist/hub/join/trust.js +68 -0
- package/dist/hub/join/trust.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 +87 -0
- package/dist/hub/member/pairing-api.js +391 -0
- package/dist/hub/member/pairing-api.js.map +1 -0
- package/dist/hub/member/pairing-notices.d.ts +18 -0
- package/dist/hub/member/pairing-notices.js +60 -0
- package/dist/hub/member/pairing-notices.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 +48 -0
- package/dist/hub/mount.js +146 -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-notices.d.ts +47 -0
- package/dist/hub/pairing-notices.js +246 -0
- package/dist/hub/pairing-notices.js.map +1 -0
- package/dist/hub/pairing.d.ts +105 -0
- package/dist/hub/pairing.js +514 -0
- package/dist/hub/pairing.js.map +1 -0
- package/dist/hub/policy.d.ts +65 -0
- package/dist/hub/policy.js +154 -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 +840 -0
- package/dist/hub/protocol.js +100 -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/room-read-pacer.d.ts +14 -0
- package/dist/hub/room-read-pacer.js +51 -0
- package/dist/hub/room-read-pacer.js.map +1 -0
- package/dist/hub/rooms.d.ts +127 -0
- package/dist/hub/rooms.js +597 -0
- package/dist/hub/rooms.js.map +1 -0
- package/dist/hub/runtime.d.ts +155 -0
- package/dist/hub/runtime.js +651 -0
- package/dist/hub/runtime.js.map +1 -0
- package/dist/hub/server.d.ts +61 -0
- package/dist/hub/server.js +235 -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/session-directory-transition.d.ts +48 -0
- package/dist/hub/session-directory-transition.js +118 -0
- package/dist/hub/session-directory-transition.js.map +1 -0
- package/dist/hub/session-epoch.d.ts +16 -0
- package/dist/hub/session-epoch.js +50 -0
- package/dist/hub/session-epoch.js.map +1 -0
- package/dist/hub/sessions.d.ts +66 -0
- package/dist/hub/sessions.js +217 -0
- package/dist/hub/sessions.js.map +1 -0
- package/dist/hub/settings-api.d.ts +50 -0
- package/dist/hub/settings-api.js +92 -0
- package/dist/hub/settings-api.js.map +1 -0
- package/dist/hub/settings-commit.d.ts +102 -0
- package/dist/hub/settings-commit.js +522 -0
- package/dist/hub/settings-commit.js.map +1 -0
- package/dist/hub/settings-directory-ca.d.ts +31 -0
- package/dist/hub/settings-directory-ca.js +115 -0
- package/dist/hub/settings-directory-ca.js.map +1 -0
- package/dist/hub/settings-directory-control.d.ts +58 -0
- package/dist/hub/settings-directory-control.js +117 -0
- package/dist/hub/settings-directory-control.js.map +1 -0
- package/dist/hub/settings-directory-decision.d.ts +465 -0
- package/dist/hub/settings-directory-decision.js +322 -0
- package/dist/hub/settings-directory-decision.js.map +1 -0
- package/dist/hub/settings-directory-host-http.d.ts +9 -0
- package/dist/hub/settings-directory-host-http.js +75 -0
- package/dist/hub/settings-directory-host-http.js.map +1 -0
- package/dist/hub/settings-directory-host-notice-http.d.ts +9 -0
- package/dist/hub/settings-directory-host-notice-http.js +78 -0
- package/dist/hub/settings-directory-host-notice-http.js.map +1 -0
- package/dist/hub/settings-directory-host-notices.d.ts +11 -0
- package/dist/hub/settings-directory-host-notices.js +39 -0
- package/dist/hub/settings-directory-host-notices.js.map +1 -0
- package/dist/hub/settings-directory-http.d.ts +33 -0
- package/dist/hub/settings-directory-http.js +109 -0
- package/dist/hub/settings-directory-http.js.map +1 -0
- package/dist/hub/settings-directory-mount.d.ts +24 -0
- package/dist/hub/settings-directory-mount.js +77 -0
- package/dist/hub/settings-directory-mount.js.map +1 -0
- package/dist/hub/settings-directory-notices.d.ts +61 -0
- package/dist/hub/settings-directory-notices.js +132 -0
- package/dist/hub/settings-directory-notices.js.map +1 -0
- package/dist/hub/settings-directory-proof.d.ts +77 -0
- package/dist/hub/settings-directory-proof.js +313 -0
- package/dist/hub/settings-directory-proof.js.map +1 -0
- package/dist/hub/settings-directory-recovery-intent.d.ts +13 -0
- package/dist/hub/settings-directory-recovery-intent.js +29 -0
- package/dist/hub/settings-directory-recovery-intent.js.map +1 -0
- package/dist/hub/settings-directory-recovery.d.ts +37 -0
- package/dist/hub/settings-directory-recovery.js +173 -0
- package/dist/hub/settings-directory-recovery.js.map +1 -0
- package/dist/hub/settings-directory-runtime.d.ts +17 -0
- package/dist/hub/settings-directory-runtime.js +2 -0
- package/dist/hub/settings-directory-runtime.js.map +1 -0
- package/dist/hub/settings-directory-save.d.ts +37 -0
- package/dist/hub/settings-directory-save.js +175 -0
- package/dist/hub/settings-directory-save.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 +87 -0
- package/dist/hub/store.js +92 -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 +416 -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-host-settings.d.ts +48 -0
- package/dist/hub-host-settings.js +85 -0
- package/dist/hub-host-settings.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 +9 -3
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +52 -5
- package/dist/instance-lifecycle.js +493 -200
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +2 -0
- package/dist/instructions.js +35 -6
- package/dist/instructions.js.map +1 -1
- package/dist/kiro-history-scan.d.ts +26 -0
- package/dist/kiro-history-scan.js +141 -0
- package/dist/kiro-history-scan.js.map +1 -0
- package/dist/kiro-history-worker.d.ts +1 -0
- package/dist/kiro-history-worker.js +9 -0
- package/dist/kiro-history-worker.js.map +1 -0
- package/dist/kiro-history.d.ts +20 -0
- package/dist/kiro-history.js +96 -0
- package/dist/kiro-history.js.map +1 -0
- package/dist/kiro-usage-run.d.ts +2 -0
- package/dist/kiro-usage-run.js +4 -1
- package/dist/kiro-usage-run.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/local-pane-endpoint.d.ts +46 -0
- package/dist/local-pane-endpoint.js +189 -0
- package/dist/local-pane-endpoint.js.map +1 -0
- package/dist/local-pane-launcher.d.ts +2 -0
- package/dist/local-pane-launcher.js +38 -0
- package/dist/local-pane-launcher.js.map +1 -0
- package/dist/local-pane-stage.ps1 +101 -0
- package/dist/locale.js +345 -99
- package/dist/locale.js.map +1 -1
- package/dist/logger.d.ts +5 -3
- package/dist/logger.js +323 -85
- package/dist/logger.js.map +1 -1
- package/dist/login-controller.d.ts +14 -1
- package/dist/login-controller.js +31 -1
- package/dist/login-controller.js.map +1 -1
- package/dist/login-flows.d.ts +21 -8
- package/dist/login-flows.js +40 -18
- package/dist/login-flows.js.map +1 -1
- package/dist/login-manager.d.ts +2 -2
- package/dist/login-manager.js +28 -6
- package/dist/login-manager.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 +3 -4
- 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/model-catalog-defaults.d.ts +14 -0
- package/dist/model-catalog-defaults.js +20 -0
- package/dist/model-catalog-defaults.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/native-agent-admission.d.ts +7 -0
- package/dist/native-agent-admission.js +26 -0
- package/dist/native-agent-admission.js.map +1 -0
- package/dist/native-daemon-client.d.ts +13 -0
- package/dist/native-daemon-client.js +28 -0
- package/dist/native-daemon-client.js.map +1 -0
- package/dist/native-instance-api.d.ts +13 -0
- package/dist/native-instance-api.js +217 -0
- package/dist/native-instance-api.js.map +1 -0
- package/dist/native-instance-input.d.ts +87 -0
- package/dist/native-instance-input.js +59 -0
- package/dist/native-instance-input.js.map +1 -0
- package/dist/native-instance-registry.d.ts +38 -0
- package/dist/native-instance-registry.js +129 -0
- package/dist/native-instance-registry.js.map +1 -0
- package/dist/native-mcp.d.ts +43 -0
- package/dist/native-mcp.js +291 -0
- package/dist/native-mcp.js.map +1 -0
- package/dist/native-model-catalog.d.ts +25 -0
- package/dist/native-model-catalog.js +181 -0
- package/dist/native-model-catalog.js.map +1 -0
- package/dist/native-pane-crash-budget.d.ts +20 -0
- package/dist/native-pane-crash-budget.js +60 -0
- package/dist/native-pane-crash-budget.js.map +1 -0
- package/dist/native-pane-create.d.ts +26 -0
- package/dist/native-pane-create.js +53 -0
- package/dist/native-pane-create.js.map +1 -0
- package/dist/native-pane-lifecycle.d.ts +73 -0
- package/dist/native-pane-lifecycle.js +239 -0
- package/dist/native-pane-lifecycle.js.map +1 -0
- package/dist/native-pane-manager.d.ts +59 -0
- package/dist/native-pane-manager.js +592 -0
- package/dist/native-pane-manager.js.map +1 -0
- package/dist/native-pane-output-log.d.ts +15 -0
- package/dist/native-pane-output-log.js +108 -0
- package/dist/native-pane-output-log.js.map +1 -0
- package/dist/native-pane-reconciliation.d.ts +4 -0
- package/dist/native-pane-reconciliation.js +40 -0
- package/dist/native-pane-reconciliation.js.map +1 -0
- package/dist/native-pane-recovery.d.ts +12 -0
- package/dist/native-pane-recovery.js +10 -0
- package/dist/native-pane-recovery.js.map +1 -0
- package/dist/native-pane-tools.d.ts +2 -0
- package/dist/native-pane-tools.js +14 -0
- package/dist/native-pane-tools.js.map +1 -0
- package/dist/needs-you-hub.d.ts +8 -0
- package/dist/needs-you-hub.js +29 -3
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +78 -2
- package/dist/needs-you.js +45 -2
- package/dist/needs-you.js.map +1 -1
- package/dist/office-levels.d.ts +4 -3
- package/dist/office-levels.js +3 -3
- package/dist/office-levels.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 +30 -2
- package/dist/outbound-handlers.js +156 -18
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +94 -1
- package/dist/outbound-schemas.js +44 -16
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-port.d.ts +118 -0
- package/dist/pane-port.js +2 -0
- package/dist/pane-port.js.map +1 -0
- 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/profile-signins.d.ts +107 -0
- package/dist/profile-signins.js +249 -0
- package/dist/profile-signins.js.map +1 -0
- package/dist/public-web-gateway.js +17 -1
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +11 -0
- package/dist/public-web-link.js +13 -0
- package/dist/public-web-link.js.map +1 -1
- package/dist/quickstart-api.js +11 -7
- package/dist/quickstart-api.js.map +1 -1
- package/dist/quickstart.d.ts +14 -0
- package/dist/quickstart.js +72 -4
- 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/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.d.ts +5 -1
- package/dist/reply-buttons-controller.js +18 -10
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/reply-buttons.d.ts +6 -2
- package/dist/reply-buttons.js +7 -3
- package/dist/reply-buttons.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 +23 -0
- package/dist/runtime-api.js +413 -0
- package/dist/runtime-api.js.map +1 -0
- package/dist/runtime-assets/@xterm/addon-serialize/LICENSE +21 -0
- package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.js +2 -0
- package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.mjs +19 -0
- package/dist/runtime-assets/@xterm/addon-serialize/package.json +29 -0
- package/dist/runtime-assets/@xterm/headless/LICENSE +21 -0
- package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.js +2 -0
- package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.mjs +46 -0
- package/dist/runtime-assets/@xterm/headless/package.json +29 -0
- package/dist/runtime-assets/node-pty/CONPTY-LICENSE +21 -0
- package/dist/runtime-assets/node-pty/CONPTY-NOTICE.md +503 -0
- package/dist/runtime-assets/node-pty/LICENSE +69 -0
- package/dist/runtime-assets/node-pty/lib/conpty_console_list_agent.js +16 -0
- package/dist/runtime-assets/node-pty/lib/eventEmitter2.js +47 -0
- package/dist/runtime-assets/node-pty/lib/index.js +52 -0
- package/dist/runtime-assets/node-pty/lib/interfaces.js +7 -0
- package/dist/runtime-assets/node-pty/lib/shared/conout.js +11 -0
- package/dist/runtime-assets/node-pty/lib/terminal.js +190 -0
- package/dist/runtime-assets/node-pty/lib/types.js +7 -0
- package/dist/runtime-assets/node-pty/lib/unixTerminal.js +346 -0
- package/dist/runtime-assets/node-pty/lib/utils.js +39 -0
- package/dist/runtime-assets/node-pty/lib/windowsConoutConnection.js +125 -0
- package/dist/runtime-assets/node-pty/lib/windowsPtyAgent.js +320 -0
- package/dist/runtime-assets/node-pty/lib/windowsTerminal.js +199 -0
- package/dist/runtime-assets/node-pty/lib/worker/conoutSocketWorker.js +22 -0
- package/dist/runtime-assets/node-pty/package.json +64 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty.node +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
- package/dist/runtime-autostart.d.ts +61 -0
- package/dist/runtime-autostart.js +161 -0
- package/dist/runtime-autostart.js.map +1 -0
- package/dist/runtime-background.d.ts +200 -0
- package/dist/runtime-background.js +480 -0
- package/dist/runtime-background.js.map +1 -0
- package/dist/runtime-build-info.d.ts +10 -0
- package/dist/runtime-build-info.js +64 -0
- package/dist/runtime-build-info.js.map +1 -0
- package/dist/runtime-bundle.d.ts +22 -0
- package/dist/runtime-bundle.js +158 -0
- package/dist/runtime-bundle.js.map +1 -0
- package/dist/runtime-cli-background.d.ts +92 -0
- package/dist/runtime-cli-background.js +336 -0
- package/dist/runtime-cli-background.js.map +1 -0
- package/dist/runtime-cli-install.d.ts +295 -0
- package/dist/runtime-cli-install.js +869 -0
- package/dist/runtime-cli-install.js.map +1 -0
- package/dist/runtime-cli.d.ts +21 -0
- package/dist/runtime-cli.js +578 -0
- package/dist/runtime-cli.js.map +1 -0
- package/dist/runtime-client-store.d.ts +86 -0
- package/dist/runtime-client-store.js +387 -0
- package/dist/runtime-client-store.js.map +1 -0
- package/dist/runtime-client.d.ts +258 -0
- package/dist/runtime-client.js +1353 -0
- package/dist/runtime-client.js.map +1 -0
- 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 +201 -0
- package/dist/runtime-coordinator.js +1514 -0
- package/dist/runtime-coordinator.js.map +1 -0
- package/dist/runtime-credential-profiles.d.ts +89 -0
- package/dist/runtime-credential-profiles.js +304 -0
- package/dist/runtime-credential-profiles.js.map +1 -0
- package/dist/runtime-enroll-notice.d.ts +4 -0
- package/dist/runtime-enroll-notice.js +21 -0
- package/dist/runtime-enroll-notice.js.map +1 -0
- package/dist/runtime-enrollment.d.ts +21 -0
- package/dist/runtime-enrollment.js +52 -0
- package/dist/runtime-enrollment.js.map +1 -0
- package/dist/runtime-general-protocol.d.ts +22 -0
- package/dist/runtime-general-protocol.js +57 -0
- package/dist/runtime-general-protocol.js.map +1 -0
- package/dist/runtime-general-workspace.d.ts +17 -0
- package/dist/runtime-general-workspace.js +213 -0
- package/dist/runtime-general-workspace.js.map +1 -0
- package/dist/runtime-install.d.ts +50 -0
- package/dist/runtime-install.js +189 -0
- package/dist/runtime-install.js.map +1 -0
- package/dist/runtime-pane-assets.d.ts +17 -0
- package/dist/runtime-pane-assets.js +23 -0
- package/dist/runtime-pane-assets.js.map +1 -0
- package/dist/runtime-pane-boot.d.ts +9 -0
- package/dist/runtime-pane-boot.js +47 -0
- package/dist/runtime-pane-boot.js.map +1 -0
- package/dist/runtime-pane-codex-index.d.ts +10 -0
- package/dist/runtime-pane-codex-index.js +151 -0
- package/dist/runtime-pane-codex-index.js.map +1 -0
- package/dist/runtime-pane-config.d.ts +16 -0
- package/dist/runtime-pane-config.js +54 -0
- package/dist/runtime-pane-config.js.map +1 -0
- package/dist/runtime-pane-host.d.ts +63 -0
- package/dist/runtime-pane-host.js +467 -0
- package/dist/runtime-pane-host.js.map +1 -0
- package/dist/runtime-pane-job-owner.d.ts +1 -0
- package/dist/runtime-pane-job-owner.js +29 -0
- package/dist/runtime-pane-job-owner.js.map +1 -0
- package/dist/runtime-pane-job.ps1 +116 -0
- package/dist/runtime-pane-link.d.ts +47 -0
- package/dist/runtime-pane-link.js +338 -0
- package/dist/runtime-pane-link.js.map +1 -0
- package/dist/runtime-pane-mcp-protocol.d.ts +32 -0
- package/dist/runtime-pane-mcp-protocol.js +39 -0
- package/dist/runtime-pane-mcp-protocol.js.map +1 -0
- package/dist/runtime-pane-mcp-relay.d.ts +18 -0
- package/dist/runtime-pane-mcp-relay.js +80 -0
- package/dist/runtime-pane-mcp-relay.js.map +1 -0
- package/dist/runtime-pane-mcp.d.ts +55 -0
- package/dist/runtime-pane-mcp.js +153 -0
- package/dist/runtime-pane-mcp.js.map +1 -0
- package/dist/runtime-pane-native.d.ts +75 -0
- package/dist/runtime-pane-native.js +114 -0
- package/dist/runtime-pane-native.js.map +1 -0
- package/dist/runtime-pane-output.d.ts +19 -0
- package/dist/runtime-pane-output.js +53 -0
- package/dist/runtime-pane-output.js.map +1 -0
- package/dist/runtime-pane-port.d.ts +144 -0
- package/dist/runtime-pane-port.js +574 -0
- package/dist/runtime-pane-port.js.map +1 -0
- package/dist/runtime-pane-private.d.ts +14 -0
- package/dist/runtime-pane-private.js +51 -0
- package/dist/runtime-pane-private.js.map +1 -0
- package/dist/runtime-pane-private.ps1 +14 -0
- package/dist/runtime-pane-process.d.ts +4 -0
- package/dist/runtime-pane-process.js +117 -0
- package/dist/runtime-pane-process.js.map +1 -0
- package/dist/runtime-pane-protocol.d.ts +182 -0
- package/dist/runtime-pane-protocol.js +217 -0
- package/dist/runtime-pane-protocol.js.map +1 -0
- 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-screen.d.ts +19 -0
- package/dist/runtime-pane-screen.js +76 -0
- package/dist/runtime-pane-screen.js.map +1 -0
- package/dist/runtime-pane-service.d.ts +16 -0
- package/dist/runtime-pane-service.js +256 -0
- package/dist/runtime-pane-service.js.map +1 -0
- package/dist/runtime-pane-stdio-protocol.d.ts +54 -0
- package/dist/runtime-pane-stdio-protocol.js +94 -0
- package/dist/runtime-pane-stdio-protocol.js.map +1 -0
- package/dist/runtime-pane-stdio.d.ts +3 -0
- package/dist/runtime-pane-stdio.js +123 -0
- package/dist/runtime-pane-stdio.js.map +1 -0
- package/dist/runtime-pane-store.d.ts +43 -0
- package/dist/runtime-pane-store.js +176 -0
- package/dist/runtime-pane-store.js.map +1 -0
- package/dist/runtime-pane-transcript-protocol.d.ts +43 -0
- package/dist/runtime-pane-transcript-protocol.js +58 -0
- package/dist/runtime-pane-transcript-protocol.js.map +1 -0
- package/dist/runtime-pane-transcript.d.ts +50 -0
- package/dist/runtime-pane-transcript.js +666 -0
- package/dist/runtime-pane-transcript.js.map +1 -0
- package/dist/runtime-pane-worker.d.ts +1 -0
- package/dist/runtime-pane-worker.js +167 -0
- package/dist/runtime-pane-worker.js.map +1 -0
- 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 +340 -0
- package/dist/runtime-protocol.js +179 -0
- package/dist/runtime-protocol.js.map +1 -0
- package/dist/runtime-remote-accounts.d.ts +209 -0
- package/dist/runtime-remote-accounts.js +714 -0
- package/dist/runtime-remote-accounts.js.map +1 -0
- package/dist/runtime-remote-setup.d.ts +108 -0
- package/dist/runtime-remote-setup.js +532 -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 +111 -0
- package/dist/runtime-signin-transport.js.map +1 -0
- package/dist/runtime-signin.d.ts +132 -0
- package/dist/runtime-signin.js +290 -0
- package/dist/runtime-signin.js.map +1 -0
- package/dist/runtime-switches.d.ts +79 -0
- package/dist/runtime-switches.js +90 -0
- package/dist/runtime-switches.js.map +1 -0
- package/dist/runtime-transcript-delta-reader.d.ts +23 -0
- package/dist/runtime-transcript-delta-reader.js +74 -0
- package/dist/runtime-transcript-delta-reader.js.map +1 -0
- package/dist/runtime-transcript-source.d.ts +36 -0
- package/dist/runtime-transcript-source.js +189 -0
- package/dist/runtime-transcript-source.js.map +1 -0
- 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-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 +86 -0
- package/dist/runtime-update-controller.js +743 -0
- package/dist/runtime-update-controller.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-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 +49 -0
- package/dist/runtime-update-journal.js +128 -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 +232 -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-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/runtime-windows-bridge.d.ts +42 -0
- package/dist/runtime-windows-bridge.js +167 -0
- package/dist/runtime-windows-bridge.js.map +1 -0
- package/dist/scheduler/db.d.ts +10 -0
- package/dist/scheduler/db.js +38 -11
- 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/scheduler/types.d.ts +6 -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 +36 -2
- package/dist/settings-api.js +734 -9
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +7 -0
- package/dist/settings-baseline.js +3 -1
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.d.ts +5 -3
- package/dist/settings-change.js +61 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +44 -7
- package/dist/settings-confirmation.js +56 -14
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +22 -0
- package/dist/settings-effect.js +294 -4
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +35 -0
- package/dist/settings-http-confirmation.js +153 -13
- 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/settings-request-capability.d.ts +14 -0
- package/dist/settings-request-capability.js +12 -1
- package/dist/settings-request-capability.js.map +1 -1
- package/dist/settings-route-lifetime.d.ts +14 -0
- package/dist/settings-route-lifetime.js +48 -0
- package/dist/settings-route-lifetime.js.map +1 -0
- package/dist/settings-transaction.d.ts +4 -0
- package/dist/settings-transaction.js +9 -0
- package/dist/settings-transaction.js.map +1 -1
- package/dist/setup-form.js +6 -3
- package/dist/setup-form.js.map +1 -1
- package/dist/setup-host.js +1 -1
- package/dist/setup-host.js.map +1 -1
- package/dist/setup-i18n.js +7 -4
- package/dist/setup-i18n.js.map +1 -1
- package/dist/setup-wizard.js +4 -2
- package/dist/setup-wizard.js.map +1 -1
- package/dist/signin-keepalive.d.ts +207 -0
- package/dist/signin-keepalive.js +682 -0
- package/dist/signin-keepalive.js.map +1 -0
- package/dist/structured-signin-transport.d.ts +20 -2
- package/dist/structured-signin-transport.js +57 -2
- package/dist/structured-signin-transport.js.map +1 -1
- package/dist/structured-signin.d.ts +11 -2
- package/dist/structured-signin.js +8 -8
- package/dist/structured-signin.js.map +1 -1
- package/dist/subagent-records.d.ts +45 -0
- package/dist/subagent-records.js +214 -0
- package/dist/subagent-records.js.map +1 -0
- package/dist/subagent-service.d.ts +27 -0
- package/dist/subagent-service.js +199 -0
- package/dist/subagent-service.js.map +1 -0
- 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/team-membership.d.ts +7 -0
- package/dist/team-membership.js +10 -0
- package/dist/team-membership.js.map +1 -0
- package/dist/tips.js +4 -4
- package/dist/tips.js.map +1 -1
- package/dist/tmux-binary.d.ts +59 -0
- package/dist/tmux-binary.js +189 -0
- package/dist/tmux-binary.js.map +1 -0
- package/dist/tmux-control.d.ts +2 -1
- 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-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 +11 -4
- package/dist/tmux-manager.js +64 -40
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tmux-pane-host.d.ts +26 -0
- package/dist/tmux-pane-host.js +25 -0
- package/dist/tmux-pane-host.js.map +1 -0
- package/dist/tmux-read.js +4 -3
- package/dist/tmux-read.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/tool-permissions.d.ts +2 -3
- package/dist/tool-permissions.js +5 -4
- package/dist/tool-permissions.js.map +1 -1
- package/dist/topic-commands.js +10 -6
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-delta-reader.d.ts +1 -1
- package/dist/transcript-delta-reader.js +1 -1
- package/dist/transcript-delta-reader.js.map +1 -1
- package/dist/transcript-monitor.d.ts +23 -0
- package/dist/transcript-monitor.js +107 -49
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-needles.d.ts +42 -0
- package/dist/transcript-needles.js +166 -0
- package/dist/transcript-needles.js.map +1 -0
- package/dist/transcript-records.d.ts +22 -0
- package/dist/transcript-records.js +144 -0
- package/dist/transcript-records.js.map +1 -0
- package/dist/transcript-sources.d.ts +5 -0
- package/dist/transcript-sources.js +11 -79
- package/dist/transcript-sources.js.map +1 -1
- package/dist/types.d.ts +34 -0
- package/dist/types.js.map +1 -1
- package/dist/ui/account-identity.js +29 -0
- package/dist/ui/accounts-keepalive.js +118 -0
- package/dist/ui/accounts-manage.js +256 -0
- package/dist/ui/accounts-view.js +460 -0
- package/dist/ui/agent-proposals.js +90 -0
- package/dist/ui/agent-runtime-settings.js +69 -0
- package/dist/ui/agent-runtime.js +124 -0
- package/dist/ui/app.html +8 -1
- package/dist/ui/backend-signin.js +169 -97
- package/dist/ui/chat-ambient.js +1 -1
- package/dist/ui/chat-commands.js +7 -0
- package/dist/ui/chat-md-strings.js +3 -9
- package/dist/ui/chat-msg-actions.js +50 -4
- package/dist/ui/chat-quote.js +256 -0
- package/dist/ui/chat-render.js +3 -670
- package/dist/ui/chat-store.js +23 -7
- package/dist/ui/chat-strings.js +3 -285
- package/dist/ui/chat-thread.js +3 -969
- package/dist/ui/chat-time.js +3 -80
- package/dist/ui/chat-tour.js +1 -1
- package/dist/ui/cli-caps.js +15 -0
- package/dist/ui/cli-picker.js +42 -0
- package/dist/ui/credential-profile-select.js +54 -0
- package/dist/ui/fleet-cache.js +3 -3
- package/dist/ui/fleet-canvas.js +2 -2
- package/dist/ui/fleet-office-dialogue.d.ts +30 -0
- package/dist/ui/fleet-office-dialogue.js +382 -0
- package/dist/ui/fleet-office-editor.js +1 -1
- 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 +174 -7
- package/dist/ui/fleet-org.js +2 -2
- package/dist/ui/fleet-task-card.js +11 -7
- package/dist/ui/fleet-task-common.js +18 -8
- 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/general-location.js +85 -0
- package/dist/ui/host-install.js +290 -0
- package/dist/ui/html-attachment.js +3 -40
- package/dist/ui/hub-agent-copy.js +23 -0
- package/dist/ui/hub-attachments.js +90 -0
- package/dist/ui/hub-button-actions.js +65 -0
- package/dist/ui/hub-chat-store.js +168 -0
- package/dist/ui/hub-chat-strings.js +79 -0
- package/dist/ui/hub-client.js +410 -0
- package/dist/ui/hub-company-join-strings.js +77 -0
- package/dist/ui/hub-company-join.js +137 -0
- package/dist/ui/hub-directory-editor-strings.js +56 -0
- package/dist/ui/hub-directory-editor.js +163 -0
- package/dist/ui/hub-directory-notice-strings.js +28 -0
- package/dist/ui/hub-directory-notices.js +66 -0
- package/dist/ui/hub-grant-strings.js +13 -0
- package/dist/ui/hub-group-policy.js +183 -0
- package/dist/ui/hub-group-strings.js +110 -0
- package/dist/ui/hub-host-security-notices.js +28 -0
- package/dist/ui/hub-owner-strings.js +56 -0
- package/dist/ui/hub-pairing-progress-strings.js +15 -0
- package/dist/ui/hub-preview.js +101 -0
- package/dist/ui/hub-provider-guidance.js +31 -0
- package/dist/ui/hub-quick-pairing.js +209 -0
- package/dist/ui/hub-quick-strings.js +43 -0
- package/dist/ui/hub-quota.js +85 -0
- package/dist/ui/hub-read-strings.js +7 -0
- package/dist/ui/hub-strings.js +164 -0
- package/dist/ui/hub-switcher.js +27 -0
- package/dist/ui/hub-this-hub.js +113 -0
- package/dist/ui/hub-welcome.js +102 -0
- package/dist/ui/machine-signin.js +56 -0
- package/dist/ui/model-picker.js +68 -0
- package/dist/ui/native-instance-settings.js +44 -0
- package/dist/ui/native-pane-recovery.js +45 -0
- package/dist/ui/office-share-page.js +4 -2
- package/dist/ui/panel-chat.js +167 -87
- package/dist/ui/panel-details.js +3 -2
- package/dist/ui/panel-fleet.js +183 -32
- package/dist/ui/panel-hub.js +974 -0
- package/dist/ui/panel-log.js +4 -4
- package/dist/ui/panel-needs.js +179 -13
- package/dist/ui/panel-notices.js +4 -3
- package/dist/ui/panel-runtimes.js +645 -0
- package/dist/ui/panel-settings.js +292 -201
- package/dist/ui/panel-windows-agent.js +87 -0
- package/dist/ui/panel-windows-cli.js +189 -0
- package/dist/ui/preview-pages.js +3 -41
- package/dist/ui/preview-panel-actions.js +3 -161
- package/dist/ui/preview-panel.js +11 -548
- package/dist/ui/preview-versions.js +3 -155
- package/dist/ui/preview.js +3 -476
- package/dist/ui/provider-marks.js +83 -0
- package/dist/ui/runtime-catalog.js +55 -0
- package/dist/ui/runtime-cli-install.js +214 -0
- package/dist/ui/runtime-commands.d.ts +6 -0
- package/dist/ui/runtime-commands.js +92 -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 +6 -2
- 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-apply.js +12 -5
- package/dist/ui/settings-build-version.js +35 -0
- package/dist/ui/settings-catalog.js +57 -13
- package/dist/ui/settings-confirm.js +108 -10
- package/dist/ui/settings-devices.js +283 -0
- package/dist/ui/settings-dialogs.js +72 -28
- package/dist/ui/settings-guests.js +29 -14
- package/dist/ui/settings-hub-browser-certificate.js +76 -0
- package/dist/ui/settings-hub-company-join.js +165 -0
- package/dist/ui/settings-hub-connection.js +121 -0
- package/dist/ui/settings-hub-directory.js +29 -0
- package/dist/ui/settings-hub-membership.js +93 -0
- package/dist/ui/settings-hub-preview.js +74 -0
- package/dist/ui/settings-hub-retention.js +54 -0
- package/dist/ui/settings-hub-run.js +61 -0
- package/dist/ui/settings-hub-section.js +63 -0
- package/dist/ui/settings-hub-setup-strings.js +70 -0
- package/dist/ui/settings-hub-setup.js +195 -0
- package/dist/ui/settings-hub.js +266 -0
- package/dist/ui/settings-layout.js +246 -0
- package/dist/ui/settings-model.js +10 -1
- package/dist/ui/settings-named-test.js +2 -2
- package/dist/ui/settings-outside.js +310 -0
- package/dist/ui/settings-quota-notice.js +102 -0
- package/dist/ui/settings-registry.js +26 -6
- package/dist/ui/settings-restart-strings.js +17 -0
- package/dist/ui/settings-revoke-strings.js +28 -0
- 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 +146 -71
- package/dist/ui/settings-update.js +69 -0
- package/dist/ui/settings-web-authority.js +29 -15
- package/dist/ui/shared/accounts-keepalive.css +12 -0
- package/dist/ui/shared/accounts.css +88 -0
- package/dist/ui/shared/agend-auth.js +8 -1
- package/dist/ui/shared/app-i18n.js +25 -18
- package/dist/ui/shared/app-route.js +12 -3
- package/dist/ui/shared/app-session.js +13 -12
- package/dist/ui/shared/app-shell.js +320 -48
- package/dist/ui/shared/app-store.js +3 -2
- package/dist/ui/shared/app-stream.js +3 -1
- package/dist/ui/shared/app-update.js +215 -0
- package/dist/ui/shared/app.css +1542 -8
- package/dist/ui/shared/app.js +18 -4
- 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/device-roles.js +27 -0
- package/dist/ui/shared/header-tools.js +9 -9
- package/dist/ui/shared/host-install.css +10 -0
- package/dist/ui/shared/html-attachment.js +42 -0
- package/dist/ui/shared/hub-chat.css +98 -0
- package/dist/ui/shared/hub-groups.css +28 -0
- package/dist/ui/shared/hub-owner.css +57 -0
- package/dist/ui/shared/hub-quota.css +8 -0
- package/dist/ui/shared/hub-signin.css +24 -0
- package/dist/ui/shared/hub.css +78 -0
- package/dist/ui/shared/instance-nav.js +35 -8
- package/dist/ui/shared/instance-switch.js +4 -3
- package/dist/ui/shared/loading.css +37 -0
- package/dist/ui/shared/machine-name.js +13 -0
- package/dist/ui/shared/model-picker.css +21 -0
- package/dist/ui/shared/page-head.js +8 -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/preview.js +476 -0
- package/dist/ui/shared/qrcode.module.js +2237 -0
- package/dist/ui/shared/runtime-install.css +55 -0
- package/dist/ui/shared/settings-width.js +31 -0
- package/dist/ui/shared/setup-host-text.js +8 -5
- package/dist/ui/shared/side-rail.js +15 -0
- package/dist/ui/shared/signin-authenticator.js +60 -0
- package/dist/ui/shared/signin.js +315 -25
- package/dist/ui/shared/subagent-row.css +15 -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 +30 -10
- package/dist/ui/shared/ui-states.js +14 -3
- package/dist/ui/shared/usage-dialog.js +4 -73
- package/dist/ui/shared/usage-meter.js +84 -0
- package/dist/ui/shared/vendor/qrcode-generator.LICENSE +27 -0
- package/dist/ui/shared/vendor/vendor.json +19 -2
- package/dist/ui/shared/view-strings.js +26 -18
- package/dist/ui/shared/web-authorize.js +55 -5
- package/dist/ui/shared/workspace-follow.css +19 -0
- package/dist/ui/shared/workspace.css +20 -0
- package/dist/ui/signin-authenticator.html +60 -0
- package/dist/ui/signin.html +27 -2
- package/dist/ui/structured-signin.js +89 -39
- package/dist/ui/subagent-row.js +72 -0
- package/dist/ui/web-terminal/terminal.js +9 -9
- package/dist/ui/windows-agents-nav.js +2 -0
- package/dist/ui/windows-cli-catalog.js +108 -0
- package/dist/ui/workspace-follow-strings.js +28 -0
- package/dist/ui/workspace-panel.js +378 -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/update-dispatch.d.ts +32 -4
- package/dist/update-dispatch.js +146 -16
- package/dist/update-dispatch.js.map +1 -1
- 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/update-launch.d.ts +1 -1
- package/dist/update-launch.js +6 -3
- package/dist/update-launch.js.map +1 -1
- package/dist/update-marker.d.ts +4 -2
- package/dist/update-marker.js +4 -3
- package/dist/update-marker.js.map +1 -1
- package/dist/update-npm-env.d.ts +70 -0
- package/dist/update-npm-env.js +128 -0
- package/dist/update-npm-env.js.map +1 -0
- package/dist/usage/providers.d.ts +8 -0
- package/dist/usage/providers.js +36 -26
- 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 +2 -1
- package/dist/usage/usage-api.js +19 -10
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/usage-rollup.d.ts +3 -0
- package/dist/usage-rollup.js +2 -0
- package/dist/usage-rollup.js.map +1 -1
- package/dist/view-api.d.ts +2 -8
- package/dist/view-api.js +8 -16
- package/dist/view-api.js.map +1 -1
- package/dist/web-api.d.ts +163 -3
- package/dist/web-api.js +1391 -32
- package/dist/web-api.js.map +1 -1
- package/dist/web-auth.js +2 -1
- package/dist/web-auth.js.map +1 -1
- package/dist/web-backend-login.d.ts +39 -3
- package/dist/web-backend-login.js +25 -17
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-channel-echo.js +3 -1
- package/dist/web-channel-echo.js.map +1 -1
- package/dist/web-chat-history.d.ts +19 -2
- package/dist/web-chat-history.js +72 -3
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-commands.d.ts +9 -1
- package/dist/web-commands.js +7 -1
- package/dist/web-commands.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-host-install.d.ts +127 -0
- package/dist/web-host-install.js +165 -0
- package/dist/web-host-install.js.map +1 -0
- 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-notices.d.ts +9 -0
- package/dist/web-notices.js +19 -0
- package/dist/web-notices.js.map +1 -1
- 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-only-fleet.d.ts +20 -0
- package/dist/web-only-fleet.js +21 -0
- package/dist/web-only-fleet.js.map +1 -1
- package/dist/web-remote-access.d.ts +273 -0
- package/dist/web-remote-access.js +610 -0
- package/dist/web-remote-access.js.map +1 -0
- package/dist/web-session.d.ts +61 -0
- package/dist/web-session.js +47 -1
- 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 +10 -1
- package/dist/web-shell-routes.js +14 -2
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/web-signin-device.d.ts +16 -0
- package/dist/web-signin-device.js +81 -0
- package/dist/web-signin-device.js.map +1 -0
- 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/web-terminal.d.ts +11 -30
- package/dist/web-terminal.js +23 -8
- package/dist/web-terminal.js.map +1 -1
- package/dist/web-update.d.ts +78 -0
- package/dist/web-update.js +106 -0
- package/dist/web-update.js.map +1 -0
- package/dist/windows-agents.d.ts +127 -0
- package/dist/windows-agents.js +491 -0
- package/dist/windows-agents.js.map +1 -0
- package/dist/windows-cli-api.d.ts +48 -0
- package/dist/windows-cli-api.js +207 -0
- package/dist/windows-cli-api.js.map +1 -0
- package/dist/windows-cli-providers.d.ts +109 -0
- package/dist/windows-cli-providers.js +396 -0
- package/dist/windows-cli-providers.js.map +1 -0
- package/dist/windows-cli-worker.d.ts +99 -0
- package/dist/windows-cli-worker.js +729 -0
- package/dist/windows-cli-worker.js.map +1 -0
- package/dist/windows-cli.d.ts +130 -0
- package/dist/windows-cli.js +424 -0
- package/dist/windows-cli.js.map +1 -0
- package/dist/windows-native-mcp.d.ts +19 -0
- package/dist/windows-native-mcp.js +143 -0
- package/dist/windows-native-mcp.js.map +1 -0
- package/dist/windows-pane-mcp.d.ts +26 -0
- package/dist/windows-pane-mcp.js +187 -0
- package/dist/windows-pane-mcp.js.map +1 -0
- 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/dist/yaml-shared-nodes.js +8 -3
- package/dist/yaml-shared-nodes.js.map +1 -1
- package/launcher/agend-install.cjs +24 -4
- package/launcher/launchd-session-type.cjs +14 -0
- package/launcher/postinstall.cjs +27 -2
- package/launcher/tmux-bundle.cjs +263 -0
- package/package.json +16 -4
- package/templates/launchd.plist.ejs +3 -1
- package/templates/runtime-assets/conpty-LICENSE +21 -0
- package/templates/runtime-assets/conpty-NOTICE.md +503 -0
- package/templates/runtime-assets/local-pane-stage.ps1 +101 -0
- package/templates/runtime-assets/runtime-pane-job.ps1 +116 -0
- package/templates/runtime-assets/runtime-pane-private.ps1 +14 -0
- package/templates/runtime-assets/xterm-LICENSE +21 -0
- package/templates/runtime-install/install.ps1 +618 -0
package/dist/web-api.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { hubModeOf, hubNameOf } from "./hub-mode.js";
|
|
2
|
+
import { validCredentialProfileName } from "./runtime-credential-profiles.js";
|
|
1
3
|
import { CANVAS_WORKER_EXPERIMENTAL_MESSAGE } from "./web-experimental.js";
|
|
4
|
+
import { MachineSlotLimitError } from "./windows-agents.js";
|
|
2
5
|
import { daemonTopicMode } from "./web-only-fleet.js";
|
|
3
6
|
import { webHumanOrigin } from "./human-delivery-receipts.js";
|
|
4
7
|
import { classifyWebPeer, confirmAfterBody, noAuthority } from "./authority/web-authority.js";
|
|
5
8
|
import { guestChatRefusal, guestCommandText, guestDeliveries, GUEST_PREF_MAX_BYTES, GUEST_SEARCHES, guestFrameData, guestHistory, guestMessages, guestOwnPrefs, guestPollBody, guestPrefs, guestRequestOf, guestSeesMessage, guestStatus } from "./web-guest-access.js";
|
|
6
9
|
import { withSpawnHoldReply } from "./spawn-hold-reply.js";
|
|
7
10
|
import { binaryProbe } from "./binary-probe.js";
|
|
8
|
-
import { settingsRequestExecution, settingsWrite, isSettingsReplay } from "./settings-request-capability.js";
|
|
11
|
+
import { settingsRequestExecution, settingsRequestLocalAdmin, settingsRequestRequester, settingsWrite, isSettingsReplay } from "./settings-request-capability.js";
|
|
9
12
|
import { readBoundedWebBody } from "./web-body.js";
|
|
10
13
|
import { APP_ICON_MAX_BYTES } from "./web-app-icon.js";
|
|
11
14
|
import { withAppIconLinks } from "./web-icons.js";
|
|
@@ -18,6 +21,9 @@ import { SKIN_WIRE_BYTES } from "./web-office-skins.js";
|
|
|
18
21
|
import { gatewayRequestContext } from "./web-request-context.js";
|
|
19
22
|
import { crossInstanceVisibility } from "./cross-instance-notice.js";
|
|
20
23
|
import { permitWebContinuation } from "./web-continuation.js";
|
|
24
|
+
import { HOST_CLI_PATHS, isRuntimeCliInstallPath } from "./settings-effect.js";
|
|
25
|
+
import { hostUpdateAckError } from "./web-host-install.js";
|
|
26
|
+
import { LATEST_ACK_FIELD } from "./cli-audited.js";
|
|
21
27
|
/**
|
|
22
28
|
* Web UI HTTP API handler.
|
|
23
29
|
* All /ui/* routes are handled here, extracted from fleet-manager.ts.
|
|
@@ -32,18 +38,24 @@ import { shellRoute } from "./web-shell-routes.js";
|
|
|
32
38
|
import { createReadStream, createWriteStream, readFileSync } from "node:fs";
|
|
33
39
|
import { join, dirname } from "node:path";
|
|
34
40
|
import { fileURLToPath } from "node:url";
|
|
41
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
35
42
|
import { CreateInstanceArgs, CreateScheduleArgs, UpdateScheduleArgs, validateArgs } from "./outbound-schemas.js";
|
|
36
43
|
import { scheduleView } from "./web-schedules.js";
|
|
37
44
|
import { DEFAULT_SCHEDULER_CONFIG } from "./scheduler/index.js";
|
|
38
45
|
import { CARD_PRIORITIES, CARD_SIZES, CARD_STATUSES, TaskBoardError } from "./scheduler/task-board.js";
|
|
39
46
|
import { readStatuslineModel, resolveInstanceContext } from "./topic-commands.js";
|
|
40
47
|
import { z } from "zod";
|
|
48
|
+
import { ONBOARDING_BACKENDS, ONBOARDING_BROWSER_BACKENDS } from "./backend-signin-pending.js";
|
|
41
49
|
import { evaluateWebRequest, isPassiveWebRead, isSecureRequest, isWebRequestAuthorized, WEB_TOKEN_INVALID_MESSAGE } from "./web-auth.js";
|
|
42
50
|
import { dashboardOriginFor } from "./web-preview.js";
|
|
43
51
|
import { WEB_CHAT_CARDS_OVERFLOW, catchUpWindow, newWebMessageId, parseLastEventId, webChatReplyRef, webChatReplyText } from "./web-chat-history.js";
|
|
44
52
|
import { PAGE_SHARE_LIMITS, htmlFences, htmlTitle } from "./page-share.js";
|
|
45
53
|
import { attachmentDelivery, createPartFile, displayName, fileTooLargeText, INLINE_MIME, isFileId, MEDIA_RANGE_MAX, publicAttachment, UPLOAD_LIMITS, UPLOAD_MAX_MS, UPLOAD_STALL_MS, UploadSniffer, uploadLimits, wellFormed } from "./web-upload.js";
|
|
46
54
|
import { getAgendHome } from "./paths.js";
|
|
55
|
+
import { workspaceChanges, workspaceFile, workspaceFileDiff, workspaceImage, workspaceList, workspaceRoot, WorkspaceError } from "./agent-workspace.js";
|
|
56
|
+
import { resolveFollowSteps } from "./workspace-follow.js";
|
|
57
|
+
import { isGeneralInstance } from "./general-instance.js";
|
|
58
|
+
import { resolveToolSet } from "./tool-permissions.js";
|
|
47
59
|
import { OPERATOR, isOwnerEffectKey } from "./web-prefs.js";
|
|
48
60
|
import { WEB_NAME_FALLBACK, webPersonKey } from "./web-profile.js";
|
|
49
61
|
import { commitTeamCreate, commitTeamUpdate } from "./outbound-handlers.js";
|
|
@@ -54,6 +66,14 @@ import { resolveTz } from "./tz-utils.js";
|
|
|
54
66
|
import { QUERY_MAX_CHARS, RESULT_MAX, SEARCH_SOURCES } from "./search/search-store.js";
|
|
55
67
|
import { xmsgShown } from "./search/search-docs.js";
|
|
56
68
|
import { WebSendDedupe } from "./web-send-dedupe.js";
|
|
69
|
+
import { handleWindowsCliRequest, nativeCliAuthorization } from "./windows-cli-api.js";
|
|
70
|
+
import { createNativeInstance, handleNativeInstanceRequest } from "./native-instance-api.js";
|
|
71
|
+
import { handleAgentRuntimeChange } from "./agent-runtime-api.js";
|
|
72
|
+
import { isWindowsInstance, isNativePaneInstance, isNativeExecInstance } from "./native-instance-registry.js";
|
|
73
|
+
import { handleNativeModelCatalog, refreshNativeModelCatalog } from "./native-model-catalog.js";
|
|
74
|
+
import { claudeDocumentedModels } from "./model-catalog-defaults.js";
|
|
75
|
+
import { handleRuntimeRequest } from "./runtime-api.js";
|
|
76
|
+
import { taskBoardOffNames } from "./dashboard-permissions.js";
|
|
57
77
|
import { topicFields } from "./instance-topic-delete.js";
|
|
58
78
|
// ── Strict public-facing schemas ────────────────────────────────────────────
|
|
59
79
|
// web-api endpoints must reject unknown fields so the dashboard cannot inject
|
|
@@ -233,8 +253,10 @@ function visibleNeeds(ctx, gateway, items) {
|
|
|
233
253
|
const { hidden } = boardHiding(ctx, true);
|
|
234
254
|
return items.filter((i) => {
|
|
235
255
|
const item = i;
|
|
236
|
-
if (item.type === "config")
|
|
237
|
-
return false; //
|
|
256
|
+
if (item.type === "config" || item.type === "hub")
|
|
257
|
+
return false; // member-local diagnostics/proposals never cross a public link
|
|
258
|
+
if (item.type === "runtime")
|
|
259
|
+
return false;
|
|
238
260
|
if (item.type !== "task")
|
|
239
261
|
return true;
|
|
240
262
|
const code = item.card?.code;
|
|
@@ -452,6 +474,131 @@ function handleAppIcon(req, res, url, ctx, method) {
|
|
|
452
474
|
});
|
|
453
475
|
return true;
|
|
454
476
|
}
|
|
477
|
+
/**
|
|
478
|
+
* M-2738 (#3332): updating AgEnD from the web.
|
|
479
|
+
* GET /ui/update { admin, current, offer?, checked_at?, check_failed?, progress?, now } — an admin session; a
|
|
480
|
+
* read-only session gets { admin: false, current } (its stale-tab reload line)
|
|
481
|
+
* POST /ui/update/check look now (one a minute) → the GET's answer
|
|
482
|
+
* POST /ui/update/start { confirm: "update-agend" } + Idempotency-Key → 202 { started } (the progress is the GET's)
|
|
483
|
+
* GET /ui/update/log { text, error } — the updater's own words, for the failure's "full log"
|
|
484
|
+
* Signed-in sessions only (never the CLI's token, a guest or the public link: none of these is a public route); an
|
|
485
|
+
* admin's for all but the version. Asked again once a body is in.
|
|
486
|
+
*/
|
|
487
|
+
function handleWebUpdate(req, res, url, ctx, path, method) {
|
|
488
|
+
const host = ctx.webUpdate;
|
|
489
|
+
if (!host) {
|
|
490
|
+
json(res, 404, { error: "not found" });
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
const routes = { "/ui/update": "GET", "/ui/update/check": "POST", "/ui/update/start": "POST", "/ui/update/log": "GET" };
|
|
494
|
+
if (!routes[path]) {
|
|
495
|
+
json(res, 404, { error: "not found" });
|
|
496
|
+
return true;
|
|
497
|
+
}
|
|
498
|
+
if (routes[path] !== method) {
|
|
499
|
+
res.setHeader("Allow", routes[path]);
|
|
500
|
+
json(res, 405, { error: "method not allowed" });
|
|
501
|
+
return true;
|
|
502
|
+
}
|
|
503
|
+
if (gatewayRequestContext(req)) {
|
|
504
|
+
json(res, 404, { error: "not found" });
|
|
505
|
+
return true;
|
|
506
|
+
}
|
|
507
|
+
res.setHeader("Cache-Control", "no-store");
|
|
508
|
+
const who = () => {
|
|
509
|
+
const verdict = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
510
|
+
if (verdict.kind !== "allow")
|
|
511
|
+
return { status: 401, error: WEB_TOKEN_INVALID_MESSAGE };
|
|
512
|
+
if (verdict.via !== "session" || !verdict.session || verdict.session.tier === "guest")
|
|
513
|
+
return { status: 403, error: "update_needs_a_signed_in_person" };
|
|
514
|
+
const owner = verdict.session.owner;
|
|
515
|
+
return { admin: verdict.session.tier === "admin", person: owner ? webPersonKey(owner) : "admin-session" };
|
|
516
|
+
};
|
|
517
|
+
const view = (admin) => {
|
|
518
|
+
const st = host.updateState();
|
|
519
|
+
if (!admin)
|
|
520
|
+
return { admin: false, current: st.current };
|
|
521
|
+
const progress = host.updateProgress();
|
|
522
|
+
return { admin: true, current: st.current, offer: st.offer, checked_at: st.checkedAt, check_failed: st.checkFailed, progress, now: Date.now() };
|
|
523
|
+
};
|
|
524
|
+
const first = who();
|
|
525
|
+
if ("status" in first) {
|
|
526
|
+
json(res, first.status, { error: first.error });
|
|
527
|
+
return true;
|
|
528
|
+
}
|
|
529
|
+
if (path === "/ui/update") {
|
|
530
|
+
json(res, 200, view(first.admin));
|
|
531
|
+
return true;
|
|
532
|
+
}
|
|
533
|
+
if (!first.admin) {
|
|
534
|
+
json(res, 403, { error: "update_needs_an_admin_session" });
|
|
535
|
+
return true;
|
|
536
|
+
}
|
|
537
|
+
if (path === "/ui/update/log") {
|
|
538
|
+
const l = host.updateLog();
|
|
539
|
+
json(res, 200, { text: l.text, error: l.error });
|
|
540
|
+
return true;
|
|
541
|
+
}
|
|
542
|
+
(async () => {
|
|
543
|
+
let body = {};
|
|
544
|
+
try {
|
|
545
|
+
body = await parseBody(req);
|
|
546
|
+
}
|
|
547
|
+
catch {
|
|
548
|
+
if (path === "/ui/update/start") {
|
|
549
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
if (!permitWebContinuation(req, res, ctx) || res.destroyed)
|
|
554
|
+
return;
|
|
555
|
+
const now = who();
|
|
556
|
+
if ("status" in now) {
|
|
557
|
+
json(res, now.status, { error: now.error });
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
if (!now.admin) {
|
|
561
|
+
json(res, 403, { error: "update_needs_an_admin_session" });
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
if (path === "/ui/update/check") {
|
|
565
|
+
const r = await host.checkUpdateNow();
|
|
566
|
+
if (!r.ok) {
|
|
567
|
+
json(res, r.status, { error: r.error });
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
json(res, 200, view(true));
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
const header = req.headers["idempotency-key"];
|
|
574
|
+
const key = typeof header === "string" ? header : "";
|
|
575
|
+
if (!/^[A-Za-z0-9_.:-]{8,128}$/.test(key)) {
|
|
576
|
+
json(res, 400, { error: "Idempotency-Key required (8-128 chars of [A-Za-z0-9_.:-])" });
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
// A literal, not a boolean: a stray `true` in a replayed body never means "update AgEnD".
|
|
580
|
+
if (body.confirm !== "update-agend") {
|
|
581
|
+
json(res, 400, { error: 'confirm must be the literal "update-agend"' });
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
// Prism #3505 P2-3: the session that asked, still current and still an admin's, right up to the updater's launch.
|
|
585
|
+
const stillAllowed = () => { const v = who(); return !("status" in v) && v.admin && v.person === now.person; };
|
|
586
|
+
const r = await host.startWebUpdate(key, now.person, stillAllowed);
|
|
587
|
+
if (!r.ok) {
|
|
588
|
+
json(res, r.status, { error: r.error });
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
ctx.logger.info({ person: now.person }, "web: update started");
|
|
592
|
+
json(res, 202, { started: true });
|
|
593
|
+
})().catch((err) => {
|
|
594
|
+
ctx.logger.error({ err: err.message }, "Web update request failed");
|
|
595
|
+
try {
|
|
596
|
+
json(res, 500, { error: "update_request_failed" });
|
|
597
|
+
}
|
|
598
|
+
catch { /* already answered */ }
|
|
599
|
+
});
|
|
600
|
+
return true;
|
|
601
|
+
}
|
|
455
602
|
/**
|
|
456
603
|
* #2636: Office share links — GET /ui/office-share (the open ones, and whether this fleet offers them), POST { office,
|
|
457
604
|
* minutes?, text?, theme? } (a new one; #2715 theme "auto" | "light" | "dark"; answers its URL once its tunnel is up, or why not), DELETE /ui/office-share/<id|all>.
|
|
@@ -1097,18 +1244,142 @@ function handleBrowserBackendSignIns(req, res, url, ctx) {
|
|
|
1097
1244
|
json(res, 403, { error: "sign_in_needs_a_local_admin" });
|
|
1098
1245
|
return true;
|
|
1099
1246
|
}
|
|
1100
|
-
if (!["GET", "POST"].includes(req.method ?? "")
|
|
1247
|
+
if (!["GET", "POST"].includes(req.method ?? "")) {
|
|
1101
1248
|
json(res, 404, { error: "not_found" });
|
|
1102
1249
|
return true;
|
|
1103
1250
|
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1251
|
+
// #3190 Part 3c: `?machine=<id>&profile=<name>` addresses the same sign-in controls for a credential profile on a paired computer (machine-signins.ts). #3212:
|
|
1252
|
+
// `?backend=<cli>&profile=<name>` addresses them for a named account on THIS host (profile-signins.ts). Nothing else is accepted in the query, and both are checked
|
|
1253
|
+
// in full before anything else happens.
|
|
1254
|
+
const keys = [...url.searchParams.keys()];
|
|
1255
|
+
let target = null;
|
|
1256
|
+
let account = null;
|
|
1257
|
+
if (keys.length) {
|
|
1258
|
+
const machine = url.searchParams.get("machine"), backend = url.searchParams.get("backend"), profile = url.searchParams.get("profile");
|
|
1259
|
+
const shape = keys.length === 2 && new Set(keys).size === 2 && profile && validCredentialProfileName(profile);
|
|
1260
|
+
if (shape && machine && /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(machine) && !backend)
|
|
1261
|
+
target = { machine, profile };
|
|
1262
|
+
else if (shape && backend === "claude-code" && !machine)
|
|
1263
|
+
account = { backend, profile };
|
|
1264
|
+
else {
|
|
1265
|
+
json(res, 404, { error: "not_found" });
|
|
1266
|
+
return true;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
// Only the one that is asked for is looked up: the host's creates its checklist state, a computer's or a named account's does not need it.
|
|
1270
|
+
const service = target || account ? undefined : ctx.browserBackendSignIns, machines = target ? ctx.machineSignIns : undefined, accounts = account ? ctx.profileSignIns : undefined;
|
|
1271
|
+
if (target ? !machines : account ? !accounts : !service) {
|
|
1106
1272
|
json(res, 404, { error: "sign_in_unavailable" });
|
|
1107
1273
|
return true;
|
|
1108
1274
|
}
|
|
1109
1275
|
void (async () => {
|
|
1110
1276
|
let result;
|
|
1111
|
-
if (
|
|
1277
|
+
if (target && machines) {
|
|
1278
|
+
if (reading)
|
|
1279
|
+
result = machines.snapshot(owner, target);
|
|
1280
|
+
else {
|
|
1281
|
+
let bytes;
|
|
1282
|
+
try {
|
|
1283
|
+
bytes = await readBoundedWebBody(req, 8192);
|
|
1284
|
+
}
|
|
1285
|
+
catch {
|
|
1286
|
+
json(res, 413, { error: "sign_in_body_bound" });
|
|
1287
|
+
return;
|
|
1288
|
+
}
|
|
1289
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
1290
|
+
return;
|
|
1291
|
+
if (who() !== owner) {
|
|
1292
|
+
json(res, 409, { error: "signin_session_expired" });
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1295
|
+
let body;
|
|
1296
|
+
try {
|
|
1297
|
+
body = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
1298
|
+
}
|
|
1299
|
+
catch {
|
|
1300
|
+
json(res, 400, { error: "sign_in_json" });
|
|
1301
|
+
return;
|
|
1302
|
+
}
|
|
1303
|
+
// Only what a computer's sign-in can do: start (Claude Code, subscription: the Runtime builds the command), answer a prompt, cancel, read again.
|
|
1304
|
+
const parsed = z.discriminatedUnion("operation", [
|
|
1305
|
+
z.strictObject({ operation: z.literal("start"), backend: z.literal("claude-code"), relogin: z.boolean().optional() }),
|
|
1306
|
+
z.strictObject({ operation: z.literal("input"), id: z.string().regex(/^[0-9a-f]{32}$/), revision: z.number().int().nonnegative(), action: z.discriminatedUnion("kind", [
|
|
1307
|
+
z.strictObject({ kind: z.literal("method"), choice: z.string().max(32) }),
|
|
1308
|
+
z.strictObject({ kind: z.enum(["code", "start_url", "region"]), value: z.string().max(4096) }),
|
|
1309
|
+
]) }),
|
|
1310
|
+
z.strictObject({ operation: z.literal("cancel") }), z.strictObject({ operation: z.literal("refresh") }),
|
|
1311
|
+
]).safeParse(body);
|
|
1312
|
+
if (!parsed.success) {
|
|
1313
|
+
json(res, 400, { error: "invalid_signin_action" });
|
|
1314
|
+
return;
|
|
1315
|
+
}
|
|
1316
|
+
const action = parsed.data;
|
|
1317
|
+
if (action.operation === "start")
|
|
1318
|
+
result = await machines.begin(owner, target, action.relogin === true);
|
|
1319
|
+
else if (action.operation === "input")
|
|
1320
|
+
result = await machines.input(owner, target, action.id, action.revision, action.action);
|
|
1321
|
+
else if (action.operation === "cancel")
|
|
1322
|
+
result = await machines.cancel(owner, target);
|
|
1323
|
+
else
|
|
1324
|
+
result = machines.snapshot(owner, target);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
else if (account && accounts) {
|
|
1328
|
+
if (reading)
|
|
1329
|
+
result = await accounts.refresh(owner, account);
|
|
1330
|
+
else {
|
|
1331
|
+
let bytes;
|
|
1332
|
+
try {
|
|
1333
|
+
bytes = await readBoundedWebBody(req, 8192);
|
|
1334
|
+
}
|
|
1335
|
+
catch {
|
|
1336
|
+
json(res, 413, { error: "sign_in_body_bound" });
|
|
1337
|
+
return;
|
|
1338
|
+
}
|
|
1339
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
1340
|
+
return;
|
|
1341
|
+
if (who() !== owner) {
|
|
1342
|
+
json(res, 409, { error: "signin_session_expired" });
|
|
1343
|
+
return;
|
|
1344
|
+
}
|
|
1345
|
+
let body;
|
|
1346
|
+
try {
|
|
1347
|
+
body = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
1348
|
+
}
|
|
1349
|
+
catch {
|
|
1350
|
+
json(res, 400, { error: "sign_in_json" });
|
|
1351
|
+
return;
|
|
1352
|
+
}
|
|
1353
|
+
// The same controls as the default account's, for the one account in the address: start (its backend must be the address's), answer a prompt, cancel, read again.
|
|
1354
|
+
// No checklist here: no select, no skip.
|
|
1355
|
+
const parsed = z.discriminatedUnion("operation", [
|
|
1356
|
+
z.strictObject({ operation: z.literal("start"), backend: z.literal(account.backend), relogin: z.boolean().optional() }),
|
|
1357
|
+
z.strictObject({ operation: z.literal("input"), id: z.string().regex(/^[0-9a-f]{32}$/), revision: z.number().int().nonnegative(), action: z.discriminatedUnion("kind", [
|
|
1358
|
+
z.strictObject({ kind: z.literal("method"), choice: z.string().max(32) }),
|
|
1359
|
+
z.strictObject({ kind: z.enum(["code", "start_url", "region"]), value: z.string().max(4096) }),
|
|
1360
|
+
]) }),
|
|
1361
|
+
z.strictObject({ operation: z.literal("cancel"), id: z.string().regex(/^[0-9a-f]{32}$/).optional() }), z.strictObject({ operation: z.literal("refresh") }),
|
|
1362
|
+
]).safeParse(body);
|
|
1363
|
+
if (!parsed.success) {
|
|
1364
|
+
json(res, 400, { error: "invalid_signin_action" });
|
|
1365
|
+
return;
|
|
1366
|
+
}
|
|
1367
|
+
const action = parsed.data;
|
|
1368
|
+
if (action.operation === "start")
|
|
1369
|
+
result = await accounts.begin(owner, account, action.relogin === true);
|
|
1370
|
+
else if (action.operation === "input")
|
|
1371
|
+
result = await accounts.input(owner, account, action.id, action.revision, action.action);
|
|
1372
|
+
else if (action.operation === "cancel")
|
|
1373
|
+
result = await accounts.cancel(owner, account, action.id);
|
|
1374
|
+
else
|
|
1375
|
+
result = await accounts.refresh(owner, account, true);
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
else if (!service) {
|
|
1379
|
+
json(res, 404, { error: "sign_in_unavailable" });
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1382
|
+
else if (reading)
|
|
1112
1383
|
result = await service.refresh(owner);
|
|
1113
1384
|
else {
|
|
1114
1385
|
let bytes;
|
|
@@ -1134,13 +1405,13 @@ function handleBrowserBackendSignIns(req, res, url, ctx) {
|
|
|
1134
1405
|
return;
|
|
1135
1406
|
}
|
|
1136
1407
|
const parsed = z.discriminatedUnion("operation", [
|
|
1137
|
-
z.strictObject({ operation: z.literal("select"), backends: z.array(z.enum(
|
|
1138
|
-
z.strictObject({ operation: z.literal("start"), backend: z.enum(
|
|
1408
|
+
z.strictObject({ operation: z.literal("select"), backends: z.array(z.enum(ONBOARDING_BACKENDS)).max(ONBOARDING_BACKENDS.length) }),
|
|
1409
|
+
z.strictObject({ operation: z.literal("start"), backend: z.enum(ONBOARDING_BROWSER_BACKENDS), relogin: z.boolean().optional() }),
|
|
1139
1410
|
z.strictObject({ operation: z.literal("input"), id: z.string().regex(/^[0-9a-f]{32}$/), revision: z.number().int().nonnegative(), action: z.discriminatedUnion("kind", [
|
|
1140
1411
|
z.strictObject({ kind: z.literal("method"), choice: z.string().max(32) }),
|
|
1141
1412
|
z.strictObject({ kind: z.enum(["code", "start_url", "region"]), value: z.string().max(4096) }),
|
|
1142
1413
|
]) }),
|
|
1143
|
-
z.strictObject({ operation: z.literal("skip"), backend: z.enum(
|
|
1414
|
+
z.strictObject({ operation: z.literal("skip"), backend: z.enum(ONBOARDING_BACKENDS) }),
|
|
1144
1415
|
z.strictObject({ operation: z.literal("cancel") }), z.strictObject({ operation: z.literal("refresh") }),
|
|
1145
1416
|
]).safeParse(body);
|
|
1146
1417
|
if (!parsed.success) {
|
|
@@ -1170,7 +1441,7 @@ function handleBrowserBackendSignIns(req, res, url, ctx) {
|
|
|
1170
1441
|
json(res, 200, result);
|
|
1171
1442
|
})().catch(error => {
|
|
1172
1443
|
const code = error instanceof Error ? error.message : "";
|
|
1173
|
-
const safe = /^(?:signin_(?:session_expired|console_only|cleanup_failed|action_(?:stale|invalid|ended|busy))|invalid_signin_(?:action|checklist))$/.test(code) ? code : "signin_failed";
|
|
1444
|
+
const safe = /^(?:signin_(?:session_expired|console_only|cleanup_failed|busy|profile_unknown|action_(?:stale|invalid|ended|busy))|invalid_signin_(?:action|checklist|target)|machine_(?:unknown|offline|unsupported|accounts_off|unreachable|profile_not_owned|busy)|invalid_machine_target)$/.test(code) ? code : "signin_failed";
|
|
1174
1445
|
if (!res.destroyed && !res.writableEnded)
|
|
1175
1446
|
json(res, safe === "signin_cleanup_failed" || safe === "signin_failed" ? 503 : 409, { error: safe });
|
|
1176
1447
|
});
|
|
@@ -1209,7 +1480,18 @@ function handleBackendLogin(req, res, url, ctx, path, method) {
|
|
|
1209
1480
|
}
|
|
1210
1481
|
const action = /^\/ui\/backend-login\/(check|start|cancel)$/.exec(path)?.[1];
|
|
1211
1482
|
if (reading && path === "/ui/backend-login" && [...url.searchParams.keys()].length === 0) {
|
|
1212
|
-
|
|
1483
|
+
// The sign-in view (its access code included) is answered at once and never waits for an account to be read: that happens in the background
|
|
1484
|
+
// and the page is told to read again when something new is known.
|
|
1485
|
+
try {
|
|
1486
|
+
ctx.refreshSignInIdentities?.();
|
|
1487
|
+
}
|
|
1488
|
+
catch { /* the list is served with what is known */ }
|
|
1489
|
+
try {
|
|
1490
|
+
json(res, 200, { login: logins.view(first.handle), targets: ctx.backendSignInTargets?.() ?? [] });
|
|
1491
|
+
}
|
|
1492
|
+
catch {
|
|
1493
|
+
json(res, 503, { error: "sign_in_unavailable" });
|
|
1494
|
+
}
|
|
1213
1495
|
return true;
|
|
1214
1496
|
}
|
|
1215
1497
|
if (method !== "POST" || !action) {
|
|
@@ -1262,11 +1544,17 @@ function handleBackendLogin(req, res, url, ctx, path, method) {
|
|
|
1262
1544
|
json(res, "error" in result ? 409 : 200, result);
|
|
1263
1545
|
}
|
|
1264
1546
|
else {
|
|
1265
|
-
|
|
1547
|
+
// `{}`: the explicit "Cancel sign-in" — whatever sign-in is running, as ever. `{ run, ifUnopened }`: the dialog's own Close (#3321 review), for
|
|
1548
|
+
// that one run and only while its terminal is unopened and it is this session's own; anything else is left alone and `cancelled` is false.
|
|
1549
|
+
const parsed = z.union([z.strictObject({}), z.strictObject({ run: z.string().regex(/^[0-9a-f]{32}$/), ifUnopened: z.literal(true) })]).safeParse(body);
|
|
1550
|
+
if (!parsed.success) {
|
|
1266
1551
|
json(res, 400, { error: "sign_in_args" });
|
|
1267
1552
|
return;
|
|
1268
1553
|
}
|
|
1269
|
-
|
|
1554
|
+
if ("run" in parsed.data)
|
|
1555
|
+
json(res, 200, await logins.closeRun(now, parsed.data.run));
|
|
1556
|
+
else
|
|
1557
|
+
json(res, 200, { message: await logins.cancel() });
|
|
1270
1558
|
}
|
|
1271
1559
|
})().catch(() => { try {
|
|
1272
1560
|
json(res, 500, { error: "sign_in_request_failed" });
|
|
@@ -1274,6 +1562,355 @@ function handleBackendLogin(req, res, url, ctx, path, method) {
|
|
|
1274
1562
|
catch { /* response ended */ } });
|
|
1275
1563
|
return true;
|
|
1276
1564
|
}
|
|
1565
|
+
/**
|
|
1566
|
+
* AGEND-133 (upstream #3521): installing a CLI on the AgEnD host from the dashboard (web-host-install.ts). The gate is the sign-in routes' own — a signed-in admin
|
|
1567
|
+
* session on the local surface; never the CLI's header token (an agent's), a guest, a read session, or the public link (refused before the body is read, and again
|
|
1568
|
+
* after it). `GET` reads the current install; `POST` `{ backend }` starts one — the browser names a CLI, the server looks up the registry's command, nothing it sends
|
|
1569
|
+
* is ever run; `POST …/cancel` `{}` stops the running one. Every answer is no-store.
|
|
1570
|
+
*/
|
|
1571
|
+
const HOST_INSTALL_STATUS = { not_allowed: 403, unsupported: 400, already: 409, not_installed: 409, up_to_date: 409, version_unreadable: 409, busy: 409, shutting_down: 503, failed: 500 };
|
|
1572
|
+
function handleHostInstall(req, res, url, ctx, path, method) {
|
|
1573
|
+
res.setHeader("Cache-Control", "private, no-store");
|
|
1574
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
1575
|
+
const reading = method === "GET";
|
|
1576
|
+
if (gatewayRequestContext(req)) {
|
|
1577
|
+
json(res, reading ? 404 : 403, { error: "install_not_over_public_link" });
|
|
1578
|
+
return true;
|
|
1579
|
+
}
|
|
1580
|
+
const who = () => {
|
|
1581
|
+
if (isSettingsReplay(req)) {
|
|
1582
|
+
const requester = settingsRequestRequester(req);
|
|
1583
|
+
if (!requester || !settingsRequestLocalAdmin(req))
|
|
1584
|
+
return { error: "install_needs_a_local_admin", status: 403 };
|
|
1585
|
+
return requester;
|
|
1586
|
+
}
|
|
1587
|
+
const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
1588
|
+
if (v.kind !== "allow")
|
|
1589
|
+
return { error: WEB_TOKEN_INVALID_MESSAGE, status: 401 };
|
|
1590
|
+
if (v.via !== "session" || v.session.tier !== "admin" || v.session.surface !== "local")
|
|
1591
|
+
return { error: "install_needs_a_local_admin", status: 403 };
|
|
1592
|
+
return { handle: v.session.handle, label: v.session.label };
|
|
1593
|
+
};
|
|
1594
|
+
const first = who();
|
|
1595
|
+
if ("error" in first) {
|
|
1596
|
+
json(res, first.status, { error: first.error });
|
|
1597
|
+
return true;
|
|
1598
|
+
}
|
|
1599
|
+
const installs = ctx.webHostInstalls;
|
|
1600
|
+
if (!installs) {
|
|
1601
|
+
json(res, 404, { error: "install_unavailable" });
|
|
1602
|
+
return true;
|
|
1603
|
+
}
|
|
1604
|
+
if (reading && path === "/ui/host-install" && [...url.searchParams.keys()].length === 0) {
|
|
1605
|
+
try {
|
|
1606
|
+
json(res, 200, { install: installs.view() });
|
|
1607
|
+
}
|
|
1608
|
+
catch {
|
|
1609
|
+
json(res, 503, { error: "install_unavailable" });
|
|
1610
|
+
}
|
|
1611
|
+
return true;
|
|
1612
|
+
}
|
|
1613
|
+
// Cancel only takes something away (any local admin may stop it, as `/login cancel`): it is not a held change. Install and Update (AGEND-136) are, and run only as the gate's confirmed replay.
|
|
1614
|
+
if (method !== "POST" || (path !== "/ui/host-install/cancel" && !HOST_CLI_PATHS.has(path))) {
|
|
1615
|
+
json(res, 404, { error: "not_found" });
|
|
1616
|
+
return true;
|
|
1617
|
+
}
|
|
1618
|
+
(async () => {
|
|
1619
|
+
let bytes;
|
|
1620
|
+
try {
|
|
1621
|
+
bytes = await readBoundedWebBody(req, 1024);
|
|
1622
|
+
}
|
|
1623
|
+
catch {
|
|
1624
|
+
json(res, 413, { error: "install_body_bound" });
|
|
1625
|
+
return;
|
|
1626
|
+
}
|
|
1627
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
1628
|
+
return;
|
|
1629
|
+
const now = who();
|
|
1630
|
+
if ("error" in now) {
|
|
1631
|
+
json(res, now.status, { error: now.error });
|
|
1632
|
+
return;
|
|
1633
|
+
}
|
|
1634
|
+
if (now.handle !== first.handle) {
|
|
1635
|
+
json(res, 409, { error: "install_session_changed" });
|
|
1636
|
+
return;
|
|
1637
|
+
}
|
|
1638
|
+
let body;
|
|
1639
|
+
try {
|
|
1640
|
+
body = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
1641
|
+
}
|
|
1642
|
+
catch {
|
|
1643
|
+
json(res, 400, { error: "install_json" });
|
|
1644
|
+
return;
|
|
1645
|
+
}
|
|
1646
|
+
if (path === "/ui/host-install/cancel") {
|
|
1647
|
+
if (!z.strictObject({}).safeParse(body).success) {
|
|
1648
|
+
json(res, 400, { error: "install_args" });
|
|
1649
|
+
return;
|
|
1650
|
+
}
|
|
1651
|
+
json(res, 200, { cancelled: await installs.cancel() });
|
|
1652
|
+
return;
|
|
1653
|
+
}
|
|
1654
|
+
// AGEND-154 (Prism P2-1 on #3552): an update may carry `acceptLatestUnaudited: true` (only the page that knows the named exception sends it); the request and the registry must agree (below).
|
|
1655
|
+
const parsed = z.strictObject({ backend: z.string().regex(/^[a-z][a-z0-9-]{0,31}$/), ...(path === "/ui/host-update" ? { [LATEST_ACK_FIELD]: z.literal(true).optional() } : {}) }).safeParse(body);
|
|
1656
|
+
if (!parsed.success) {
|
|
1657
|
+
json(res, 400, { error: "install_args" });
|
|
1658
|
+
return;
|
|
1659
|
+
}
|
|
1660
|
+
if (!isSettingsReplay(req) || !settingsRequestExecution(req)) {
|
|
1661
|
+
json(res, 403, { error: "install_confirmation_required" });
|
|
1662
|
+
return;
|
|
1663
|
+
}
|
|
1664
|
+
if (path === "/ui/host-update") {
|
|
1665
|
+
const ackError = hostUpdateAckError(parsed.data.backend, parsed.data[LATEST_ACK_FIELD]);
|
|
1666
|
+
if (ackError) {
|
|
1667
|
+
json(res, 409, { error: ackError });
|
|
1668
|
+
return;
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
// AGEND-136: `POST /ui/host-update { backend }` is the same request for an update: the server picks the command and the audited release; the page sends only the CLI's id.
|
|
1672
|
+
const result = await installs.begin(now, parsed.data.backend, settingsRequestExecution(req), path === "/ui/host-update" ? "update" : "install");
|
|
1673
|
+
if ("error" in result)
|
|
1674
|
+
json(res, HOST_INSTALL_STATUS[result.error] ?? 409, { error: result.error, ...(result.message ? { message: result.message } : {}) });
|
|
1675
|
+
else
|
|
1676
|
+
json(res, 200, result);
|
|
1677
|
+
})().catch(() => { try {
|
|
1678
|
+
json(res, 500, { error: "install_request_failed" });
|
|
1679
|
+
}
|
|
1680
|
+
catch { /* response ended */ } });
|
|
1681
|
+
return true;
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* #3212 PR 2: Settings → Accounts — `POST /ui/accounts/<backend>` `{ name }` adds a named account (a credential profile's
|
|
1685
|
+
* folder); `DELETE /ui/accounts/<backend>/<name>` `{ confirm: <name> }` removes one (accounts-profiles.ts: every refusal
|
|
1686
|
+
* deletes nothing). PR 3: `POST /ui/accounts/<backend>/signout` `{ profile: <name> | null, confirm: true }` signs an
|
|
1687
|
+
* account out with the CLI's own logout (accounts-signout.ts). The fleet's local admin session only, as the sign-in routes: never the CLI's header token, a guest,
|
|
1688
|
+
* a read session, the public link or the gateway — refused before the body is read, and again after it.
|
|
1689
|
+
*/
|
|
1690
|
+
const ACCOUNT_STATUS = {
|
|
1691
|
+
backend: 400, name: 400, confirm: 400, exists: 409, case_clash: 409, unsafe_root: 409, in_use: 409, users_unknown: 409, signing_in: 409, missing: 404,
|
|
1692
|
+
unsafe: 409, default_home: 409, failed: 500, unsupported: 400,
|
|
1693
|
+
// #3190 Part 3c: a paired computer (the Runtime there decides; these are what the server can say before it asks, or what the computer answered).
|
|
1694
|
+
machine_unknown: 404, machine_offline: 409, machine_unsupported: 409, machine_accounts_off: 409, machine_unreachable: 502, machine_profile_not_owned: 409,
|
|
1695
|
+
machine_refused: 409, machine_default_login: 409,
|
|
1696
|
+
};
|
|
1697
|
+
function handleAccountWrite(req, res, url, ctx, path, method) {
|
|
1698
|
+
res.setHeader("Cache-Control", "private, no-store");
|
|
1699
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
1700
|
+
if (gatewayRequestContext(req)) {
|
|
1701
|
+
json(res, 403, { error: "accounts_not_over_public_link" });
|
|
1702
|
+
return true;
|
|
1703
|
+
}
|
|
1704
|
+
const who = () => {
|
|
1705
|
+
const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
1706
|
+
if (v.kind !== "allow")
|
|
1707
|
+
return { error: WEB_TOKEN_INVALID_MESSAGE, status: 401 };
|
|
1708
|
+
if (v.via !== "session" || v.session.tier !== "admin" || v.session.surface !== "local")
|
|
1709
|
+
return { error: "accounts_need_a_local_admin", status: 403 };
|
|
1710
|
+
return { handle: v.session.handle, label: v.session.label };
|
|
1711
|
+
};
|
|
1712
|
+
const first = who();
|
|
1713
|
+
if ("error" in first) {
|
|
1714
|
+
json(res, first.status, { error: first.error });
|
|
1715
|
+
return true;
|
|
1716
|
+
}
|
|
1717
|
+
const add = method === "POST" ? /^\/ui\/accounts\/([a-z][a-z0-9-]{0,31})$/.exec(path) : null;
|
|
1718
|
+
const remove = method === "DELETE" ? /^\/ui\/accounts\/([a-z][a-z0-9-]{0,31})\/([^/]{1,200})$/.exec(path) : null;
|
|
1719
|
+
const signout = method === "POST" ? /^\/ui\/accounts\/([a-z][a-z0-9-]{0,31})\/signout$/.exec(path) : null;
|
|
1720
|
+
if (!add && !remove && !signout) {
|
|
1721
|
+
json(res, 404, { error: "not_found" });
|
|
1722
|
+
return true;
|
|
1723
|
+
}
|
|
1724
|
+
const handler = add ? ctx.addAccountProfile : remove ? ctx.removeAccountProfile : ctx.signOutAccount;
|
|
1725
|
+
if (typeof handler !== "function") {
|
|
1726
|
+
json(res, 404, { error: "not_found" });
|
|
1727
|
+
return true;
|
|
1728
|
+
}
|
|
1729
|
+
let target = "";
|
|
1730
|
+
if (remove) {
|
|
1731
|
+
try {
|
|
1732
|
+
target = decodeURIComponent(remove[2]);
|
|
1733
|
+
}
|
|
1734
|
+
catch {
|
|
1735
|
+
json(res, 400, { error: "name" });
|
|
1736
|
+
return true;
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
(async () => {
|
|
1740
|
+
let bytes;
|
|
1741
|
+
try {
|
|
1742
|
+
bytes = await readBoundedWebBody(req, 1024);
|
|
1743
|
+
}
|
|
1744
|
+
catch {
|
|
1745
|
+
json(res, 413, { error: "accounts_body_bound" });
|
|
1746
|
+
return;
|
|
1747
|
+
}
|
|
1748
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
1749
|
+
return;
|
|
1750
|
+
const now = who();
|
|
1751
|
+
if ("error" in now) {
|
|
1752
|
+
json(res, now.status, { error: now.error });
|
|
1753
|
+
return;
|
|
1754
|
+
}
|
|
1755
|
+
if (now.handle !== first.handle) {
|
|
1756
|
+
json(res, 409, { error: "accounts_session_changed" });
|
|
1757
|
+
return;
|
|
1758
|
+
}
|
|
1759
|
+
let body;
|
|
1760
|
+
try {
|
|
1761
|
+
body = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
1762
|
+
}
|
|
1763
|
+
catch {
|
|
1764
|
+
json(res, 400, { error: "accounts_json" });
|
|
1765
|
+
return;
|
|
1766
|
+
}
|
|
1767
|
+
// #3190 Part 3c: `machine` (a paired computer's id) turns the same route into that computer's account; the person's audit name is the session's opaque handle.
|
|
1768
|
+
const machineId = z.string().regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/).optional();
|
|
1769
|
+
const onMachine = (id) => {
|
|
1770
|
+
if (id === undefined)
|
|
1771
|
+
return undefined;
|
|
1772
|
+
return /^[a-f0-9]{16}$/.test(now.handle) ? { id, actor: `admin:${now.handle}` } : "refused";
|
|
1773
|
+
};
|
|
1774
|
+
const fail = (r) => json(res, ACCOUNT_STATUS[r.error] ?? 409, { error: r.error, ...(r.clash ? { clash: r.clash } : {}), ...(r.users ? { users: r.users } : {}), ...(r.message ? { message: r.message } : {}) });
|
|
1775
|
+
if (add) {
|
|
1776
|
+
const parsed = z.strictObject({ name: z.string().max(200), machine: machineId }).safeParse(body);
|
|
1777
|
+
if (!parsed.success) {
|
|
1778
|
+
json(res, 400, { error: "accounts_args" });
|
|
1779
|
+
return;
|
|
1780
|
+
}
|
|
1781
|
+
const machine = onMachine(parsed.data.machine);
|
|
1782
|
+
if (machine === "refused") {
|
|
1783
|
+
json(res, 403, { error: "accounts_need_a_local_admin" });
|
|
1784
|
+
return;
|
|
1785
|
+
}
|
|
1786
|
+
const r = await (machine ? ctx.addAccountProfile(add[1], parsed.data.name, now.label, machine) : ctx.addAccountProfile(add[1], parsed.data.name, now.label));
|
|
1787
|
+
if (r.ok)
|
|
1788
|
+
json(res, 200, { added: parsed.data.name, ...(machine ? { machine: machine.id } : {}) });
|
|
1789
|
+
else
|
|
1790
|
+
fail(r);
|
|
1791
|
+
}
|
|
1792
|
+
else if (remove) {
|
|
1793
|
+
// `cancelSignIn` (#3321 review): "Cancel sign-in and remove" — end the running sign-in of THIS account (and no other), then remove it, in one request.
|
|
1794
|
+
// A paired computer's sign-in is cancelled from that computer's side, so it is refused there.
|
|
1795
|
+
const parsed = z.strictObject({ confirm: z.string().max(200), machine: machineId, cancelSignIn: z.literal(true).optional() }).refine(a => !(a.machine && a.cancelSignIn)).safeParse(body);
|
|
1796
|
+
if (!parsed.success) {
|
|
1797
|
+
json(res, 400, { error: "accounts_args" });
|
|
1798
|
+
return;
|
|
1799
|
+
}
|
|
1800
|
+
const machine = onMachine(parsed.data.machine);
|
|
1801
|
+
if (machine === "refused") {
|
|
1802
|
+
json(res, 403, { error: "accounts_need_a_local_admin" });
|
|
1803
|
+
return;
|
|
1804
|
+
}
|
|
1805
|
+
const r = await (machine ? ctx.removeAccountProfile(remove[1], target, parsed.data.confirm, now.label, machine)
|
|
1806
|
+
: parsed.data.cancelSignIn ? ctx.removeAccountProfile(remove[1], target, parsed.data.confirm, now.label, undefined, { cancelSignIn: true })
|
|
1807
|
+
: ctx.removeAccountProfile(remove[1], target, parsed.data.confirm, now.label));
|
|
1808
|
+
if (r.ok)
|
|
1809
|
+
json(res, 200, { removed: target, ...(r.keychainLeft ? { keychainLeft: true } : {}) });
|
|
1810
|
+
else
|
|
1811
|
+
fail(r);
|
|
1812
|
+
}
|
|
1813
|
+
else {
|
|
1814
|
+
const parsed = z.strictObject({ profile: z.string().max(200).nullable(), confirm: z.literal(true), machine: machineId }).safeParse(body);
|
|
1815
|
+
if (!parsed.success) {
|
|
1816
|
+
json(res, 400, { error: "accounts_args" });
|
|
1817
|
+
return;
|
|
1818
|
+
}
|
|
1819
|
+
const machine = onMachine(parsed.data.machine);
|
|
1820
|
+
if (machine === "refused") {
|
|
1821
|
+
json(res, 403, { error: "accounts_need_a_local_admin" });
|
|
1822
|
+
return;
|
|
1823
|
+
}
|
|
1824
|
+
const r = await (machine ? ctx.signOutAccount(signout[1], parsed.data.profile, parsed.data.confirm, now.label, machine) : ctx.signOutAccount(signout[1], parsed.data.profile, parsed.data.confirm, now.label));
|
|
1825
|
+
if (r.ok)
|
|
1826
|
+
json(res, 200, { signedOut: parsed.data.profile, ...(r.keychainLeft ? { keychainLeft: true } : {}) });
|
|
1827
|
+
else
|
|
1828
|
+
fail(r);
|
|
1829
|
+
}
|
|
1830
|
+
})().catch(() => { try {
|
|
1831
|
+
json(res, 500, { error: "accounts_request_failed" });
|
|
1832
|
+
}
|
|
1833
|
+
catch { /* response ended */ } });
|
|
1834
|
+
return true;
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* #3292: Settings → Accounts → Keep sign-in alive — `POST /ui/accounts/keep-alive` `{ backend, profile: <name> | null,
|
|
1838
|
+
* enabled, fallback? }`. The same gate as the other account writes: the fleet's local admin session only, refused before
|
|
1839
|
+
* the body is read and again after it; never the gateway, a guest, a read session or the CLI's header token.
|
|
1840
|
+
*/
|
|
1841
|
+
const KEEPALIVE_STATUS = { backend: 400, profile: 400, fallback: 400, write: 500 };
|
|
1842
|
+
function handleAccountKeepAlive(req, res, url, ctx, method) {
|
|
1843
|
+
res.setHeader("Cache-Control", "private, no-store");
|
|
1844
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
1845
|
+
if (gatewayRequestContext(req)) {
|
|
1846
|
+
json(res, 403, { error: "accounts_not_over_public_link" });
|
|
1847
|
+
return true;
|
|
1848
|
+
}
|
|
1849
|
+
if (method !== "POST") {
|
|
1850
|
+
json(res, 405, { error: "method_not_allowed" });
|
|
1851
|
+
return true;
|
|
1852
|
+
}
|
|
1853
|
+
const who = () => {
|
|
1854
|
+
const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
1855
|
+
if (v.kind !== "allow")
|
|
1856
|
+
return { error: WEB_TOKEN_INVALID_MESSAGE, status: 401 };
|
|
1857
|
+
if (v.via !== "session" || v.session.tier !== "admin" || v.session.surface !== "local")
|
|
1858
|
+
return { error: "accounts_need_a_local_admin", status: 403 };
|
|
1859
|
+
return { handle: v.session.handle, label: v.session.label };
|
|
1860
|
+
};
|
|
1861
|
+
const first = who();
|
|
1862
|
+
if ("error" in first) {
|
|
1863
|
+
json(res, first.status, { error: first.error });
|
|
1864
|
+
return true;
|
|
1865
|
+
}
|
|
1866
|
+
if (typeof ctx.setAccountKeepAlive !== "function") {
|
|
1867
|
+
json(res, 404, { error: "not_found" });
|
|
1868
|
+
return true;
|
|
1869
|
+
}
|
|
1870
|
+
(async () => {
|
|
1871
|
+
let bytes;
|
|
1872
|
+
try {
|
|
1873
|
+
bytes = await readBoundedWebBody(req, 1024);
|
|
1874
|
+
}
|
|
1875
|
+
catch {
|
|
1876
|
+
json(res, 413, { error: "accounts_body_bound" });
|
|
1877
|
+
return;
|
|
1878
|
+
}
|
|
1879
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
1880
|
+
return;
|
|
1881
|
+
const now = who();
|
|
1882
|
+
if ("error" in now) {
|
|
1883
|
+
json(res, now.status, { error: now.error });
|
|
1884
|
+
return;
|
|
1885
|
+
}
|
|
1886
|
+
if (now.handle !== first.handle) {
|
|
1887
|
+
json(res, 409, { error: "accounts_session_changed" });
|
|
1888
|
+
return;
|
|
1889
|
+
}
|
|
1890
|
+
let body;
|
|
1891
|
+
try {
|
|
1892
|
+
body = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
1893
|
+
}
|
|
1894
|
+
catch {
|
|
1895
|
+
json(res, 400, { error: "accounts_json" });
|
|
1896
|
+
return;
|
|
1897
|
+
}
|
|
1898
|
+
const parsed = z.strictObject({ backend: z.string().max(32), profile: z.string().max(200).nullable(), enabled: z.boolean(), fallback: z.boolean().optional() }).safeParse(body);
|
|
1899
|
+
if (!parsed.success) {
|
|
1900
|
+
json(res, 400, { error: "accounts_args" });
|
|
1901
|
+
return;
|
|
1902
|
+
}
|
|
1903
|
+
const r = ctx.setAccountKeepAlive(parsed.data.backend, parsed.data.profile, parsed.data.enabled, parsed.data.fallback, now.label);
|
|
1904
|
+
if (r.ok)
|
|
1905
|
+
json(res, 200, { backend: parsed.data.backend, profile: parsed.data.profile, enabled: parsed.data.enabled });
|
|
1906
|
+
else
|
|
1907
|
+
json(res, KEEPALIVE_STATUS[r.error] ?? 409, { error: r.error });
|
|
1908
|
+
})().catch(() => { try {
|
|
1909
|
+
json(res, 500, { error: "accounts_request_failed" });
|
|
1910
|
+
}
|
|
1911
|
+
catch { /* response ended */ } });
|
|
1912
|
+
return true;
|
|
1913
|
+
}
|
|
1277
1914
|
/**
|
|
1278
1915
|
* #1629 r4 §4 (r4-5): mods — a person's import (stage, then commit), uninstall and export. Every route is a signed-in
|
|
1279
1916
|
* session's, writes an admin's: never the CLI's header token (the way an agent could reach it) and never the public link
|
|
@@ -1852,7 +2489,7 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1852
2489
|
// the panel instead of comparing null against a missing credential.
|
|
1853
2490
|
if (path.startsWith("/ui")) {
|
|
1854
2491
|
const approved = isSettingsReplay(req) && method === "POST"
|
|
1855
|
-
&& (path === "/ui/config" || path === "/ui/instances" || /^\/ui\/instances\/[^/]+\/delete$/.test(path))
|
|
2492
|
+
&& (path === "/ui/config" || path === "/ui/instances" || /^\/ui\/instances\/[^/]+\/delete$/.test(path) || HOST_CLI_PATHS.has(path) || isRuntimeCliInstallPath(path))
|
|
1856
2493
|
? settingsRequestExecution(req) : undefined;
|
|
1857
2494
|
if (approved) {
|
|
1858
2495
|
try {
|
|
@@ -1872,6 +2509,29 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1872
2509
|
return false;
|
|
1873
2510
|
}
|
|
1874
2511
|
// ── Static files ───────────────────────────────────────
|
|
2512
|
+
// Native local tools retain their administrator boundary on the shared chat/read/action routes.
|
|
2513
|
+
const nativePath = /^\/ui\/(?:chat|instance|cancel|stop|start|restart)\/([^/]+)$/.exec(path);
|
|
2514
|
+
let nativeTarget = url.searchParams.get("instance") ?? "";
|
|
2515
|
+
if (nativePath) {
|
|
2516
|
+
try {
|
|
2517
|
+
nativeTarget = decodeURIComponent(nativePath[1]);
|
|
2518
|
+
}
|
|
2519
|
+
catch {
|
|
2520
|
+
nativeTarget = "";
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
if (isWindowsInstance(ctx.fleetConfig?.instances?.[nativeTarget]) && !nativeCliAuthorization(req, url, ctx)) {
|
|
2524
|
+
json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
|
|
2525
|
+
return true;
|
|
2526
|
+
}
|
|
2527
|
+
if (handleAgentRuntimeChange(req, res, url, ctx))
|
|
2528
|
+
return true;
|
|
2529
|
+
if (handleNativeInstanceRequest(req, res, url, ctx))
|
|
2530
|
+
return true;
|
|
2531
|
+
if (handleWindowsCliRequest(req, res, url, ctx))
|
|
2532
|
+
return true;
|
|
2533
|
+
if (handleRuntimeRequest(req, res, url, ctx))
|
|
2534
|
+
return true;
|
|
1875
2535
|
// #1408: the app shell, for exactly the paths the classifier names (src/web-shell-routes.ts). One page for every
|
|
1876
2536
|
// route; the client router mounts the panel. A malformed instance name is a 400, an unknown one is the shell (the
|
|
1877
2537
|
// panel says "not found"), so the response never tells which names exist.
|
|
@@ -1880,6 +2540,11 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1880
2540
|
json(res, 400, { error: "invalid instance name" });
|
|
1881
2541
|
return true;
|
|
1882
2542
|
}
|
|
2543
|
+
// AgEnD Hub P1: the Hub's pages live on a Hub's own listener (slice 1), never on this fleet's: the ordinary not-found.
|
|
2544
|
+
if (shell?.kind === "shell" && shell.route.panel === "hub") {
|
|
2545
|
+
json(res, 404, { error: "not found" });
|
|
2546
|
+
return true;
|
|
2547
|
+
}
|
|
1883
2548
|
if (shell?.kind === "shell") {
|
|
1884
2549
|
serveAppShell(req, res, ctx, "full");
|
|
1885
2550
|
return true;
|
|
@@ -1918,8 +2583,79 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1918
2583
|
}
|
|
1919
2584
|
return true;
|
|
1920
2585
|
}
|
|
1921
|
-
// ── Backend detection ─────────────────────────────────
|
|
1922
|
-
// #2072: the model a Settings field offers — the cached catalog of that backend (that instance's account's). Read only.
|
|
2586
|
+
// ── Backend detection ─────────────────────────────────
|
|
2587
|
+
// #2072: the model a Settings field offers — the cached catalog of that backend (that instance's account's). Read only.
|
|
2588
|
+
if (method === "POST" && path === "/ui/models/refresh") {
|
|
2589
|
+
const admission = adminAdmissionOf(req, url, ctx);
|
|
2590
|
+
if (!admission) {
|
|
2591
|
+
json(res, 403, { error: "admin_required" });
|
|
2592
|
+
return true;
|
|
2593
|
+
}
|
|
2594
|
+
void (async () => {
|
|
2595
|
+
let body;
|
|
2596
|
+
try {
|
|
2597
|
+
body = await parseBody(req);
|
|
2598
|
+
}
|
|
2599
|
+
catch {
|
|
2600
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
2601
|
+
return;
|
|
2602
|
+
}
|
|
2603
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
2604
|
+
return;
|
|
2605
|
+
if (adminAdmissionOf(req, url, ctx) !== admission) {
|
|
2606
|
+
json(res, 403, { error: "admin_required" });
|
|
2607
|
+
return;
|
|
2608
|
+
}
|
|
2609
|
+
if (!body || Array.isArray(body) || typeof body !== "object" || Object.keys(body).some(k => !["backend", "instance", "runtime", "machineId", "profile"].includes(k))) {
|
|
2610
|
+
json(res, 400, { error: "invalid model target" });
|
|
2611
|
+
return;
|
|
2612
|
+
}
|
|
2613
|
+
const backend = body.backend, instance = body.instance ?? null;
|
|
2614
|
+
if (typeof backend !== "string" || !/^[a-z][a-z0-9-]{0,31}$/.test(backend) || (instance !== null && (typeof instance !== "string" || !isSafeInstanceName(instance)))) {
|
|
2615
|
+
json(res, 400, { error: "invalid model target" });
|
|
2616
|
+
return;
|
|
2617
|
+
}
|
|
2618
|
+
const runtime = body.runtime, machineId = body.machineId, profile = body.profile;
|
|
2619
|
+
if (runtime !== undefined && runtime !== "windows" && runtime !== "wsl" || machineId !== undefined && (typeof machineId !== "string" || !/^[a-f0-9-]{36}$/i.test(machineId)) || profile !== undefined && (typeof profile !== "string" || profile !== "" && !/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(profile))) {
|
|
2620
|
+
json(res, 400, { error: "invalid model target" });
|
|
2621
|
+
return;
|
|
2622
|
+
}
|
|
2623
|
+
const target = { backend, instance, ...(runtime ? { runtime: runtime } : {}), ...(machineId ? { machineId: machineId } : {}), ...(profile !== undefined ? { profile: profile } : {}) };
|
|
2624
|
+
let result;
|
|
2625
|
+
try {
|
|
2626
|
+
result = await refreshNativeModelCatalog(req, url, ctx, target);
|
|
2627
|
+
// Recheck after runtime selection, before any portable probe is admitted.
|
|
2628
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
2629
|
+
return;
|
|
2630
|
+
if (adminAdmissionOf(req, url, ctx) !== admission) {
|
|
2631
|
+
json(res, 403, { error: "admin_required" });
|
|
2632
|
+
return;
|
|
2633
|
+
}
|
|
2634
|
+
if (!result) {
|
|
2635
|
+
if (machineId || !ctx.refreshModelCatalogFor) {
|
|
2636
|
+
json(res, 503, { error: "model_refresh_unavailable" });
|
|
2637
|
+
return;
|
|
2638
|
+
}
|
|
2639
|
+
result = await (profile !== undefined ? ctx.refreshModelCatalogFor(backend, instance, { profile: profile }) : ctx.refreshModelCatalogFor(backend, instance));
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
catch {
|
|
2643
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
2644
|
+
return;
|
|
2645
|
+
json(res, 503, { error: "model_refresh_unavailable" });
|
|
2646
|
+
return;
|
|
2647
|
+
}
|
|
2648
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
2649
|
+
return;
|
|
2650
|
+
if (adminAdmissionOf(req, url, ctx) !== admission) {
|
|
2651
|
+
json(res, 403, { error: "admin_required" });
|
|
2652
|
+
return;
|
|
2653
|
+
}
|
|
2654
|
+
json(res, 200, { backend, ...result });
|
|
2655
|
+
})().catch(() => { if (!res.headersSent)
|
|
2656
|
+
json(res, 500, { error: "model_refresh_failed" }); });
|
|
2657
|
+
return true;
|
|
2658
|
+
}
|
|
1923
2659
|
if (method === "GET" && path === "/ui/models") {
|
|
1924
2660
|
const backend = url.searchParams.get("backend") ?? "";
|
|
1925
2661
|
const instance = url.searchParams.get("instance");
|
|
@@ -1927,7 +2663,50 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1927
2663
|
json(res, 400, { error: "backend (and optional instance) required" });
|
|
1928
2664
|
return true;
|
|
1929
2665
|
}
|
|
1930
|
-
|
|
2666
|
+
const runtime = url.searchParams.get("runtime"), refresh = url.searchParams.get("refresh");
|
|
2667
|
+
const machineId = url.searchParams.get("machineId");
|
|
2668
|
+
if (machineId !== null && (!/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(machineId) || runtime === "wsl")) {
|
|
2669
|
+
json(res, 400, { error: "Invalid model runtime machine" });
|
|
2670
|
+
return true;
|
|
2671
|
+
}
|
|
2672
|
+
if ((runtime !== null && runtime !== "wsl" && runtime !== "windows") || (refresh !== null && refresh !== "1")) {
|
|
2673
|
+
json(res, 400, { error: "Invalid model catalog options" });
|
|
2674
|
+
return true;
|
|
2675
|
+
}
|
|
2676
|
+
const profile = url.searchParams.get("profile");
|
|
2677
|
+
if (profile !== null && profile !== "" && !/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(profile)) {
|
|
2678
|
+
json(res, 400, { error: "Invalid model account" });
|
|
2679
|
+
return true;
|
|
2680
|
+
}
|
|
2681
|
+
if (handleNativeModelCatalog(req, res, url, ctx))
|
|
2682
|
+
return true;
|
|
2683
|
+
const models = (profile !== null ? ctx.modelCatalogFor?.(backend, instance, { profile }) : ctx.modelCatalogFor?.(backend, instance)) ?? [];
|
|
2684
|
+
const answerCatalog = () => {
|
|
2685
|
+
if (backend === "claude-code" && !models.length && !profile) {
|
|
2686
|
+
const version = ctx.backendAvailabilityRows?.().find(row => row.backend === backend)?.version;
|
|
2687
|
+
json(res, 200, { backend, models: claudeDocumentedModels(version), source: "official-catalog" });
|
|
2688
|
+
}
|
|
2689
|
+
else
|
|
2690
|
+
json(res, 200, { backend, models });
|
|
2691
|
+
};
|
|
2692
|
+
// The existing catalog belongs to this instance/account and always wins.
|
|
2693
|
+
if (models.length || !ctx.cliModelCatalogFor || profile !== null) {
|
|
2694
|
+
answerCatalog();
|
|
2695
|
+
return true;
|
|
2696
|
+
}
|
|
2697
|
+
const canAnswer = () => !res.headersSent && !res.destroyed && !res.writableEnded && stillAuthorized(req, res, url, ctx);
|
|
2698
|
+
void (async () => {
|
|
2699
|
+
const cliModels = await ctx.cliModelCatalogFor?.(backend, instance) ?? [];
|
|
2700
|
+
if (!canAnswer())
|
|
2701
|
+
return;
|
|
2702
|
+
if (cliModels.length)
|
|
2703
|
+
json(res, 200, { backend, models: cliModels, source: "cli-cache" });
|
|
2704
|
+
else
|
|
2705
|
+
answerCatalog();
|
|
2706
|
+
})().catch(() => {
|
|
2707
|
+
if (canAnswer())
|
|
2708
|
+
json(res, 503, { error: "CLI model cache unavailable" });
|
|
2709
|
+
});
|
|
1931
2710
|
return true;
|
|
1932
2711
|
}
|
|
1933
2712
|
if (method === "GET" && path === "/ui/backends") {
|
|
@@ -2133,9 +2912,178 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2133
2912
|
json(res, 200, { messages, boot: ctx.webChatHistory?.boot ?? null, lastId: ctx.webChatHistory?.lastId ?? 0, ...(allHidden ? { allHidden: true } : {}) });
|
|
2134
2913
|
return true;
|
|
2135
2914
|
}
|
|
2915
|
+
// ── #3212 PR 1: Settings → Agents → Accounts (read-only) ─────────────────────────────────
|
|
2916
|
+
// Each CLI's default sign-in and credential profiles, who uses them and their weekly usage. Names, states, the masked
|
|
2917
|
+
// identity and the host login command (which, as in the sign-in list, names the profile's folder) — no credential or
|
|
2918
|
+
// full e-mail: only for the fleet's local admin session — never the public link, a guest, a token or the gateway (the
|
|
2919
|
+
// same rule as the sign-in list it extends).
|
|
2920
|
+
if (method === "GET" && path === "/ui/accounts") {
|
|
2921
|
+
res.setHeader("Cache-Control", "private, no-store");
|
|
2922
|
+
if (gatewayRequestContext(req)) {
|
|
2923
|
+
json(res, 404, { error: "not_found" });
|
|
2924
|
+
return true;
|
|
2925
|
+
}
|
|
2926
|
+
const localAdmin = () => {
|
|
2927
|
+
const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
2928
|
+
return v.kind === "allow" && v.via === "session" && v.session.tier === "admin" && v.session.surface === "local" ? v.session : null;
|
|
2929
|
+
};
|
|
2930
|
+
const who = localAdmin();
|
|
2931
|
+
if (!who) {
|
|
2932
|
+
json(res, 403, { error: "accounts_need_a_local_admin" });
|
|
2933
|
+
return true;
|
|
2934
|
+
}
|
|
2935
|
+
if (typeof ctx.accountsView !== "function") {
|
|
2936
|
+
json(res, 404, { error: "not_found" });
|
|
2937
|
+
return true;
|
|
2938
|
+
}
|
|
2939
|
+
void ctx.accountsView().then(view => {
|
|
2940
|
+
if (localAdmin()?.handle !== who.handle) {
|
|
2941
|
+
json(res, 403, { error: "accounts_need_a_local_admin" });
|
|
2942
|
+
return;
|
|
2943
|
+
}
|
|
2944
|
+
json(res, 200, view);
|
|
2945
|
+
}, err => { ctx.logger.error({ err: err.message }, "Accounts view failed"); json(res, 500, { error: "could not read the accounts" }); });
|
|
2946
|
+
return true;
|
|
2947
|
+
}
|
|
2948
|
+
// ── #3153 P1: an agent's Files / Changes (read-only) ─────────────────────────────────
|
|
2949
|
+
// The fleet's local admin session only: never the public link, a guest, a token or a connection from outside. One
|
|
2950
|
+
// agent's own working directory (agent-workspace.ts confines and filters every path); not General or a coordinator
|
|
2951
|
+
// (they work in the fleet's own directory), not an agent on another machine.
|
|
2952
|
+
if (method === "GET" && path === "/ui/workspace") {
|
|
2953
|
+
res.setHeader("Cache-Control", "private, no-store");
|
|
2954
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
2955
|
+
if (gatewayRequestContext(req)) {
|
|
2956
|
+
json(res, 404, { error: "not_found" });
|
|
2957
|
+
return true;
|
|
2958
|
+
}
|
|
2959
|
+
const localAdmin = () => {
|
|
2960
|
+
const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
2961
|
+
return v.kind === "allow" && v.via === "session" && v.session.tier === "admin" && v.session.surface === "local" ? v.session : null;
|
|
2962
|
+
};
|
|
2963
|
+
const who = localAdmin();
|
|
2964
|
+
if (!who) {
|
|
2965
|
+
json(res, 403, { error: "workspace_needs_a_local_admin" });
|
|
2966
|
+
return true;
|
|
2967
|
+
}
|
|
2968
|
+
const p = url.searchParams, instance = p.get("instance") ?? "", op = p.get("op") ?? "";
|
|
2969
|
+
const cfg = ctx.fleetConfig?.instances && Object.hasOwn(ctx.fleetConfig.instances, instance) ? ctx.fleetConfig.instances[instance] : undefined;
|
|
2970
|
+
if (!cfg) {
|
|
2971
|
+
json(res, 404, { error: "not_found" });
|
|
2972
|
+
return true;
|
|
2973
|
+
}
|
|
2974
|
+
const offered = !isGeneralInstance(ctx.fleetConfig, instance) && resolveToolSet(cfg, instance) !== "coordinator"
|
|
2975
|
+
&& cfg.runtime !== "windows" && !cfg.machine_id;
|
|
2976
|
+
if (!offered) {
|
|
2977
|
+
json(res, 404, { error: "workspace_not_offered" });
|
|
2978
|
+
return true;
|
|
2979
|
+
}
|
|
2980
|
+
if (!["changes", "list", "file", "image", "diff", "follow"].includes(op)) {
|
|
2981
|
+
json(res, 400, { error: "op: changes | list | file | image | diff | follow" });
|
|
2982
|
+
return true;
|
|
2983
|
+
}
|
|
2984
|
+
const workDir = String(cfg.working_directory ?? "").replace(/^~(?=$|\/)/, process.env.HOME ?? "~");
|
|
2985
|
+
const backend = String(cfg.backend ?? ctx.fleetConfig?.defaults?.backend ?? "claude-code");
|
|
2986
|
+
const daemon = ctx.daemons.get(instance);
|
|
2987
|
+
void (async () => {
|
|
2988
|
+
try {
|
|
2989
|
+
const ws = await workspaceRoot(workDir, getAgendHome());
|
|
2990
|
+
// The session must still be the same one when the answer goes out (it may have ended while git ran).
|
|
2991
|
+
const answer = async () => {
|
|
2992
|
+
if (op === "changes")
|
|
2993
|
+
return { kind: "json", body: await workspaceChanges(ws) };
|
|
2994
|
+
if (op === "list")
|
|
2995
|
+
return { kind: "json", body: await workspaceList(ws, p.get("path") ?? "") };
|
|
2996
|
+
if (op === "file")
|
|
2997
|
+
return { kind: "json", body: await workspaceFile(ws, p.get("path")) };
|
|
2998
|
+
if (op === "diff")
|
|
2999
|
+
return { kind: "json", body: await workspaceFileDiff(ws, p.get("path")) };
|
|
3000
|
+
if (op === "follow") {
|
|
3001
|
+
// #3160: this turn's file steps, from the CLI's own record, confined to this folder (outside paths dropped,
|
|
3002
|
+
// secret-looking ones marked hidden). Polled by an open panel with Follow on; nothing is pushed.
|
|
3003
|
+
const supported = backend === "claude-code" || backend === "codex";
|
|
3004
|
+
const d = daemon;
|
|
3005
|
+
const after = Number(p.get("after") ?? 0), turnQ = p.get("turn");
|
|
3006
|
+
const snap = supported && d && typeof d.workspaceFollow === "function"
|
|
3007
|
+
? d.workspaceFollow(Number.isSafeInteger(after) && after >= 0 ? after : 0, turnQ !== null && /^\d{1,9}$/.test(turnQ) ? Number(turnQ) : undefined, p.get("scope") ?? undefined)
|
|
3008
|
+
: { scope: "", turn: 0, steps: [], last: 0 };
|
|
3009
|
+
return { kind: "json", body: { supported, running: !!d, scope: snap.scope, turn: snap.turn, last: snap.last, steps: await resolveFollowSteps(ws, snap.steps) } };
|
|
3010
|
+
}
|
|
3011
|
+
return { kind: "image", body: await workspaceImage(ws, p.get("path")) };
|
|
3012
|
+
};
|
|
3013
|
+
const out = await answer();
|
|
3014
|
+
if (localAdmin()?.handle !== who.handle) {
|
|
3015
|
+
json(res, 403, { error: "workspace_needs_a_local_admin" });
|
|
3016
|
+
return;
|
|
3017
|
+
}
|
|
3018
|
+
const current = ctx.fleetConfig?.instances[instance];
|
|
3019
|
+
if (current !== cfg || String(current.working_directory ?? "").replace(/^~(?=$|\/)/, process.env.HOME ?? "~") !== workDir
|
|
3020
|
+
|| String(current.backend ?? ctx.fleetConfig?.defaults?.backend ?? "claude-code") !== backend
|
|
3021
|
+
|| current.runtime === "windows" || current.machine_id || isGeneralInstance(ctx.fleetConfig, instance)
|
|
3022
|
+
|| resolveToolSet(current, instance) === "coordinator" || (op === "follow" && ctx.daemons.get(instance) !== daemon)) {
|
|
3023
|
+
json(res, 403, { error: "workspace_changed" });
|
|
3024
|
+
return;
|
|
3025
|
+
}
|
|
3026
|
+
if (op === "follow" && out.kind === "json") {
|
|
3027
|
+
const frame = out.body;
|
|
3028
|
+
const live = daemon;
|
|
3029
|
+
if (frame.supported && frame.running && frame.scope && live?.workspaceFollow?.(0).scope !== frame.scope) {
|
|
3030
|
+
json(res, 403, { error: "workspace_changed" });
|
|
3031
|
+
return;
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
if (out.kind === "image") {
|
|
3035
|
+
res.writeHead(200, { "Content-Type": out.body.mime, "Content-Length": String(out.body.bytes.length), "Content-Security-Policy": "default-src 'none'; sandbox" });
|
|
3036
|
+
res.end(out.body.bytes);
|
|
3037
|
+
return;
|
|
3038
|
+
}
|
|
3039
|
+
json(res, 200, out.body);
|
|
3040
|
+
}
|
|
3041
|
+
catch (err) {
|
|
3042
|
+
if (err instanceof WorkspaceError) {
|
|
3043
|
+
json(res, err.code === "not_found" || err.code === "not_a_directory" ? 404 : 403, { error: err.code });
|
|
3044
|
+
return;
|
|
3045
|
+
}
|
|
3046
|
+
ctx.logger.error({ err: err.message, instance }, "Workspace read failed");
|
|
3047
|
+
json(res, 500, { error: "could not read the folder" });
|
|
3048
|
+
}
|
|
3049
|
+
})();
|
|
3050
|
+
return true;
|
|
3051
|
+
}
|
|
2136
3052
|
// ── #1218: the Log tab ─────────────────────────────────
|
|
2137
3053
|
// An instance's steps, read on demand from its own transcript (log-service.ts). Read-only, and offered on the public
|
|
2138
3054
|
// link on purpose (the user's decision): the same masking applies to every viewer. Passive (web-auth.ts).
|
|
3055
|
+
// Deliberately absent from public gateway, guest, View and Hub projections.
|
|
3056
|
+
if (method === "GET" && path === "/ui/subagents") {
|
|
3057
|
+
const admission = adminAdmissionOf(req, url, ctx), name = url.searchParams.get("instance") ?? "";
|
|
3058
|
+
if (!admission || gatewayRequestContext(req) || guestRequestOf(req)) {
|
|
3059
|
+
json(res, 403, { error: "admin_only" });
|
|
3060
|
+
return true;
|
|
3061
|
+
}
|
|
3062
|
+
if (!name || name.length > 128 || !safeInstanceSegment(name)) {
|
|
3063
|
+
json(res, 400, { error: "invalid instance" });
|
|
3064
|
+
return true;
|
|
3065
|
+
}
|
|
3066
|
+
if (!ctx.subagentRuns) {
|
|
3067
|
+
json(res, 404, { error: "not available" });
|
|
3068
|
+
return true;
|
|
3069
|
+
}
|
|
3070
|
+
void ctx.subagentRuns(name).then(answer => {
|
|
3071
|
+
if (res.destroyed)
|
|
3072
|
+
return;
|
|
3073
|
+
if (adminAdmissionOf(req, url, ctx) !== admission || gatewayRequestContext(req) || guestRequestOf(req)) {
|
|
3074
|
+
json(res, 403, { error: "admin_only" });
|
|
3075
|
+
return;
|
|
3076
|
+
}
|
|
3077
|
+
if (answer.status === "busy") {
|
|
3078
|
+
res.setHeader("Retry-After", "2");
|
|
3079
|
+
json(res, 429, { error: "busy" });
|
|
3080
|
+
return;
|
|
3081
|
+
}
|
|
3082
|
+
json(res, 200, answer);
|
|
3083
|
+
}).catch(() => { if (!res.destroyed)
|
|
3084
|
+
json(res, 503, { error: "unavailable" }); });
|
|
3085
|
+
return true;
|
|
3086
|
+
}
|
|
2139
3087
|
if (method === "GET" && path === "/ui/steps") {
|
|
2140
3088
|
const p = url.searchParams;
|
|
2141
3089
|
const instance = p.get("instance") ?? "";
|
|
@@ -2875,6 +3823,8 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2875
3823
|
// #2308: the app icon (handleAppIcon: its state for a signed-in person; changing it, an admin's session only).
|
|
2876
3824
|
if (path === "/ui/app-icon")
|
|
2877
3825
|
return handleAppIcon(req, res, url, ctx, method);
|
|
3826
|
+
if (path === "/ui/update" || path.startsWith("/ui/update/"))
|
|
3827
|
+
return handleWebUpdate(req, res, url, ctx, path, method);
|
|
2878
3828
|
// #1629 r4-5: mods — a person's import, uninstall and export (handleMods: sessions only, never the public link).
|
|
2879
3829
|
if (path === "/ui/mods" || path.startsWith("/ui/mods/"))
|
|
2880
3830
|
return handleMods(req, res, url, ctx, path, method);
|
|
@@ -2883,6 +3833,13 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2883
3833
|
return handleBrowserBackendSignIns(req, res, url, ctx);
|
|
2884
3834
|
if (path === "/ui/backend-login" || path.startsWith("/ui/backend-login/"))
|
|
2885
3835
|
return handleBackendLogin(req, res, url, ctx, path, method);
|
|
3836
|
+
if (path === "/ui/host-install" || path === "/ui/host-install/cancel" || path === "/ui/host-update")
|
|
3837
|
+
return handleHostInstall(req, res, url, ctx, path, method);
|
|
3838
|
+
// #3292: before the accounts prefix — its Add pattern (`POST /ui/accounts/<backend>`) would read "keep-alive" as a backend.
|
|
3839
|
+
if (path === "/ui/accounts/keep-alive")
|
|
3840
|
+
return handleAccountKeepAlive(req, res, url, ctx, method);
|
|
3841
|
+
if (path.startsWith("/ui/accounts/"))
|
|
3842
|
+
return handleAccountWrite(req, res, url, ctx, path, method);
|
|
2886
3843
|
// #1386: Acknowledge a "Needs you" delivery item — a session write (CSRF, checked by the gate) or the CLI's header
|
|
2887
3844
|
// token. Who did it is recorded by principal: the session's public handle, never the session id or a credential.
|
|
2888
3845
|
// #2910 D2: a web-only fleet's Notices — what General would have said. Admins only (never a guest: not in
|
|
@@ -2926,6 +3883,235 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2926
3883
|
});
|
|
2927
3884
|
return true;
|
|
2928
3885
|
}
|
|
3886
|
+
// ── #3008: connections from outside (a web-only fleet) ──
|
|
3887
|
+
// GET /ui/outside: the state (any admin; over the outside link too, read-only). What changes it is an admin's, over a
|
|
3888
|
+
// direct connection (the fleet asks the live session each time; the public link refuses these routes outright):
|
|
3889
|
+
// POST /ui/outside/enroll (a new secret, shown once; AGEND-122: {code} — the current one — while the owner's stricter
|
|
3890
|
+
// option is on and this is not the AgEnD computer), POST /ui/outside/enroll/confirm {code}, POST /ui/outside/remove
|
|
3891
|
+
// ({code} likewise), POST /ui/outside/strict {on, code?} (your own "ask for my code" switch) and POST /ui/outside/switch {on} — the
|
|
3892
|
+
// switch stays this computer's admin's, on a web-only fleet. Each acts on the caller's own authenticator only (per admin).
|
|
3893
|
+
// Never a guest (not in GUEST_ROUTES).
|
|
3894
|
+
if (method === "GET" && path === "/ui/outside") {
|
|
3895
|
+
res.setHeader("Cache-Control", "no-store");
|
|
3896
|
+
json(res, 200, ctx.webOutsideStatus?.(req) ?? { webOnly: false, here: false, manage: false, codeNeeded: false, strict: false, enrolled: false, enrolledAt: null, outside: false, pausedForMs: 0, link: null });
|
|
3897
|
+
return true;
|
|
3898
|
+
}
|
|
3899
|
+
if (method === "POST" && (path === "/ui/outside/enroll" || path === "/ui/outside/enroll/confirm" || path === "/ui/outside/remove" || path === "/ui/outside/switch" || path === "/ui/outside/strict")) {
|
|
3900
|
+
if (gatewayRequestContext(req)) {
|
|
3901
|
+
json(res, 403, { error: "outside_not_here" });
|
|
3902
|
+
return true;
|
|
3903
|
+
}
|
|
3904
|
+
(async () => {
|
|
3905
|
+
let body;
|
|
3906
|
+
try {
|
|
3907
|
+
body = await parseBody(req);
|
|
3908
|
+
}
|
|
3909
|
+
catch {
|
|
3910
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
3911
|
+
return;
|
|
3912
|
+
}
|
|
3913
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
3914
|
+
return;
|
|
3915
|
+
res.setHeader("Cache-Control", "no-store");
|
|
3916
|
+
// AGEND-122: replacing or removing the authenticator asks for the current code while the owner's stricter option is on
|
|
3917
|
+
// and this is not the AgEnD computer's own browser (the fleet decides); the answer to a missing or wrong one is its own.
|
|
3918
|
+
const stepCode = body && typeof body === "object" && typeof body.code === "string" && body.code.length <= 32 ? body.code : undefined;
|
|
3919
|
+
const refusal = (r) => {
|
|
3920
|
+
if (r.error === "paused") {
|
|
3921
|
+
res.setHeader("Retry-After", String(Math.ceil((r.retryAfterMs ?? 60_000) / 1000)));
|
|
3922
|
+
json(res, 429, { error: "paused", retryAfterMs: r.retryAfterMs ?? null });
|
|
3923
|
+
return;
|
|
3924
|
+
}
|
|
3925
|
+
json(res, r.error === "wrong" ? 401 : r.error === "unavailable" ? 503 : r.error === "code_required" ? 400 : 403, { error: r.error === "not_here" ? "outside_not_here" : r.error });
|
|
3926
|
+
};
|
|
3927
|
+
if (path === "/ui/outside/enroll") {
|
|
3928
|
+
const r = ctx.webOutsideBeginEnrollment?.(req, stepCode) ?? null;
|
|
3929
|
+
if (!r) {
|
|
3930
|
+
json(res, 403, { error: "outside_not_here" });
|
|
3931
|
+
return;
|
|
3932
|
+
}
|
|
3933
|
+
if ("error" in r) {
|
|
3934
|
+
refusal(r);
|
|
3935
|
+
return;
|
|
3936
|
+
}
|
|
3937
|
+
json(res, 200, r);
|
|
3938
|
+
return;
|
|
3939
|
+
}
|
|
3940
|
+
if (path === "/ui/outside/enroll/confirm") {
|
|
3941
|
+
const code = body && typeof body === "object" ? body.code : undefined;
|
|
3942
|
+
if (typeof code !== "string" || code.length > 32) {
|
|
3943
|
+
json(res, 400, { error: "code required" });
|
|
3944
|
+
return;
|
|
3945
|
+
}
|
|
3946
|
+
const r = ctx.webOutsideConfirmEnrollment?.(req, code) ?? "not_here";
|
|
3947
|
+
json(res, r === "ok" ? 200 : r === "not_here" ? 403 : r === "unsaved" ? 503 : r === "full" ? 409 : 400, r === "ok" ? { ok: true } : { error: r === "not_here" ? "outside_not_here" : r });
|
|
3948
|
+
return;
|
|
3949
|
+
}
|
|
3950
|
+
if (path === "/ui/outside/remove") {
|
|
3951
|
+
const r = ctx.webOutsideRemove?.(req, stepCode) ?? "not_here";
|
|
3952
|
+
if (typeof r === "object") {
|
|
3953
|
+
refusal(r);
|
|
3954
|
+
return;
|
|
3955
|
+
}
|
|
3956
|
+
json(res, r === "ok" ? 200 : r === "unsaved" ? 503 : 403, r === "ok" ? { ok: true } : { error: r === "unsaved" ? "unsaved" : "outside_not_here" });
|
|
3957
|
+
return;
|
|
3958
|
+
}
|
|
3959
|
+
const on = body && typeof body === "object" ? body.on : undefined;
|
|
3960
|
+
if (typeof on !== "boolean") {
|
|
3961
|
+
json(res, 400, { error: "on must be true or false" });
|
|
3962
|
+
return;
|
|
3963
|
+
}
|
|
3964
|
+
if (path === "/ui/outside/strict") {
|
|
3965
|
+
// AGEND-122 (per admin): the caller's OWN "ask for my code" switch — on needs their app and asks nothing, off asks their current code.
|
|
3966
|
+
const sr = ctx.webOutsideStrict?.(req, on, stepCode) ?? "not_here";
|
|
3967
|
+
if (typeof sr === "object") {
|
|
3968
|
+
refusal(sr);
|
|
3969
|
+
return;
|
|
3970
|
+
}
|
|
3971
|
+
json(res, sr === "ok" ? 200 : sr === "not_here" ? 403 : sr === "unsaved" ? 503 : 409, sr === "ok" ? { ok: true } : { error: sr === "not_here" ? "outside_not_here" : sr });
|
|
3972
|
+
return;
|
|
3973
|
+
}
|
|
3974
|
+
const r = ctx.webOutsideSwitch?.(req, on) ?? "not_here";
|
|
3975
|
+
json(res, r === "ok" ? 200 : r === "not_here" ? 403 : r === "unsaved" ? 503 : 409, r === "ok" ? { ok: true } : { error: r === "not_here" ? "outside_not_here" : r });
|
|
3976
|
+
})().catch(err => {
|
|
3977
|
+
ctx.logger.error({ err: err.message }, "Outside connections change failed");
|
|
3978
|
+
try {
|
|
3979
|
+
json(res, 500, { error: "outside_failed" });
|
|
3980
|
+
}
|
|
3981
|
+
catch { /* already answered */ }
|
|
3982
|
+
});
|
|
3983
|
+
return true;
|
|
3984
|
+
}
|
|
3985
|
+
// ── Refs #3061 (P2a): signing a new device in with its 8-character code (a web-only fleet) ──
|
|
3986
|
+
// GET /ui/devices: whether this is such a fleet and whether THIS session may approve (it is the verified owner — this
|
|
3987
|
+
// computer's admin here, or signed in from outside with the authenticator's code). POST /ui/devices/lookup {code}: the
|
|
3988
|
+
// request that code names, for the confirm screen; POST /ui/devices/approve {code} and /ui/devices/deny {code}. Every
|
|
3989
|
+
// one asks the live session again in the fleet (webDeviceLoginAct) and answers 403 `owner_required` to anyone else —
|
|
3990
|
+
// a guest, a LAN or device-approved session, the CLI's header token. Over the public link only for the owner who
|
|
3991
|
+
// signed in from outside. A decision hands the new device nothing: its session is made by its own next poll.
|
|
3992
|
+
if (method === "GET" && path === "/ui/devices") {
|
|
3993
|
+
res.setHeader("Cache-Control", "no-store");
|
|
3994
|
+
json(res, 200, ctx.webDevicesStatus?.(req) ?? { webOnly: false, owner: false, devices: [] });
|
|
3995
|
+
return true;
|
|
3996
|
+
}
|
|
3997
|
+
// Refs #3061 (P2b): POST /ui/devices/signout {handle} — the verified owner ends another signed-in device. The same
|
|
3998
|
+
// authority as approving one, asked of the live session in the fleet after the body is in (webDeviceSignOut answers
|
|
3999
|
+
// 403 `owner_required` to anyone else before it looks the handle up). Over the public link only for the owner signed in
|
|
4000
|
+
// from outside, like approving.
|
|
4001
|
+
if (method === "POST" && path === "/ui/devices/signout") {
|
|
4002
|
+
const act = ctx.webDeviceSignOut?.bind(ctx);
|
|
4003
|
+
if (!act) {
|
|
4004
|
+
json(res, 404, { error: "not_found" });
|
|
4005
|
+
return true;
|
|
4006
|
+
}
|
|
4007
|
+
(async () => {
|
|
4008
|
+
let body;
|
|
4009
|
+
try {
|
|
4010
|
+
body = await parseBody(req);
|
|
4011
|
+
}
|
|
4012
|
+
catch {
|
|
4013
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
4014
|
+
return;
|
|
4015
|
+
}
|
|
4016
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
4017
|
+
return;
|
|
4018
|
+
const handle = body && typeof body === "object" ? body.handle : undefined;
|
|
4019
|
+
if (typeof handle !== "string" || !/^[0-9a-f]{16}$/.test(handle)) {
|
|
4020
|
+
json(res, 400, { error: "handle required" });
|
|
4021
|
+
return;
|
|
4022
|
+
}
|
|
4023
|
+
res.setHeader("Cache-Control", "no-store");
|
|
4024
|
+
const r = act(req, handle);
|
|
4025
|
+
json(res, r.status, r.body);
|
|
4026
|
+
})().catch(err => {
|
|
4027
|
+
ctx.logger.error({ err: err.message }, "Device sign-out failed");
|
|
4028
|
+
try {
|
|
4029
|
+
json(res, 500, { error: "devices_failed" });
|
|
4030
|
+
}
|
|
4031
|
+
catch { /* already answered */ }
|
|
4032
|
+
});
|
|
4033
|
+
return true;
|
|
4034
|
+
}
|
|
4035
|
+
if (method === "POST" && (path === "/ui/devices/lookup" || path === "/ui/devices/approve" || path === "/ui/devices/deny")) {
|
|
4036
|
+
const act = ctx.webDeviceLoginAct?.bind(ctx);
|
|
4037
|
+
if (!act) {
|
|
4038
|
+
json(res, 404, { error: "not_found" });
|
|
4039
|
+
return true;
|
|
4040
|
+
}
|
|
4041
|
+
const op = path === "/ui/devices/lookup" ? "lookup" : path === "/ui/devices/approve" ? "approve" : "deny";
|
|
4042
|
+
(async () => {
|
|
4043
|
+
let body;
|
|
4044
|
+
try {
|
|
4045
|
+
body = await parseBody(req);
|
|
4046
|
+
}
|
|
4047
|
+
catch {
|
|
4048
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
4049
|
+
return;
|
|
4050
|
+
}
|
|
4051
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
4052
|
+
return;
|
|
4053
|
+
const code = body && typeof body === "object" ? body.code : undefined;
|
|
4054
|
+
if (typeof code !== "string" || code.length > 32) {
|
|
4055
|
+
json(res, 400, { error: "code required" });
|
|
4056
|
+
return;
|
|
4057
|
+
}
|
|
4058
|
+
res.setHeader("Cache-Control", "no-store");
|
|
4059
|
+
const r = act(req, op, code);
|
|
4060
|
+
if (typeof r.body.retryAfterMs === "number")
|
|
4061
|
+
res.setHeader("Retry-After", String(Math.ceil(r.body.retryAfterMs / 1000)));
|
|
4062
|
+
json(res, r.status, r.body);
|
|
4063
|
+
})().catch(err => {
|
|
4064
|
+
ctx.logger.error({ err: err.message }, "New device approval failed");
|
|
4065
|
+
try {
|
|
4066
|
+
json(res, 500, { error: "devices_failed" });
|
|
4067
|
+
}
|
|
4068
|
+
catch { /* already answered */ }
|
|
4069
|
+
});
|
|
4070
|
+
return true;
|
|
4071
|
+
}
|
|
4072
|
+
// ── alpha.2 (M-2300): an agent's Windows request, decided by a web-only fleet's owner in Needs you ──
|
|
4073
|
+
// The list is the owner's only: anyone else (a guest, a LAN or public-link session, a chat fleet's admin) reads an
|
|
4074
|
+
// empty one, so nothing actionable ever reaches them. The stream's `agent_proposals` event carries nothing.
|
|
4075
|
+
if (method === "GET" && path === "/ui/agent-proposals") {
|
|
4076
|
+
const list = ctx.webAgentProposals?.(req) ?? null;
|
|
4077
|
+
json(res, 200, { owner: list !== null, proposals: list ?? [] });
|
|
4078
|
+
return true;
|
|
4079
|
+
}
|
|
4080
|
+
const proposalMatch = method === "POST" ? /^\/ui\/agent-proposals\/([0-9a-f]{32})$/.exec(path) : null;
|
|
4081
|
+
if (proposalMatch) {
|
|
4082
|
+
if (!ctx.webDecideAgentProposal) {
|
|
4083
|
+
json(res, 404, { error: "not_found" });
|
|
4084
|
+
return true;
|
|
4085
|
+
}
|
|
4086
|
+
const decide = ctx.webDecideAgentProposal.bind(ctx), id = proposalMatch[1];
|
|
4087
|
+
(async () => {
|
|
4088
|
+
let body;
|
|
4089
|
+
try {
|
|
4090
|
+
body = await parseBody(req);
|
|
4091
|
+
}
|
|
4092
|
+
catch {
|
|
4093
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
4094
|
+
return;
|
|
4095
|
+
}
|
|
4096
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
4097
|
+
return;
|
|
4098
|
+
const decision = body && typeof body === "object" ? body.decision : undefined;
|
|
4099
|
+
if (decision !== "confirm" && decision !== "reject") {
|
|
4100
|
+
json(res, 400, { error: "decision must be confirm or reject" });
|
|
4101
|
+
return;
|
|
4102
|
+
}
|
|
4103
|
+
const r = await decide(req, id, decision);
|
|
4104
|
+
if (!res.headersSent && !res.destroyed)
|
|
4105
|
+
json(res, r.status, r.body);
|
|
4106
|
+
})().catch(err => {
|
|
4107
|
+
ctx.logger.error({ err: err.message }, "Agent request decision failed");
|
|
4108
|
+
try {
|
|
4109
|
+
json(res, 500, { error: "decide_failed" });
|
|
4110
|
+
}
|
|
4111
|
+
catch { /* already answered */ }
|
|
4112
|
+
});
|
|
4113
|
+
return true;
|
|
4114
|
+
}
|
|
2929
4115
|
if (method === "POST" && path === "/ui/needs/ack") {
|
|
2930
4116
|
if (!ctx.acknowledgeNeedsItem) {
|
|
2931
4117
|
json(res, 404, { error: "Nothing to acknowledge here" });
|
|
@@ -3051,10 +4237,28 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3051
4237
|
json(res, 400, { error: "instance and command required" });
|
|
3052
4238
|
return;
|
|
3053
4239
|
}
|
|
4240
|
+
if (isNativeExecInstance(ctx.fleetConfig?.instances[instance])) {
|
|
4241
|
+
json(res, 400, { error: "This runtime does not support CLI control commands; use Agent settings or Cancel" });
|
|
4242
|
+
return;
|
|
4243
|
+
}
|
|
4244
|
+
if (isNativePaneInstance(ctx.fleetConfig?.instances[instance])) {
|
|
4245
|
+
if (!nativeCliAuthorization(req, url, ctx)) {
|
|
4246
|
+
json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
|
|
4247
|
+
return;
|
|
4248
|
+
}
|
|
4249
|
+
if (command !== "model") {
|
|
4250
|
+
json(res, 400, { error: "This persistent Windows runtime supports the model command; use its shared controls for other actions" });
|
|
4251
|
+
return;
|
|
4252
|
+
}
|
|
4253
|
+
}
|
|
3054
4254
|
if (body.args !== undefined && str(body.args, MAX_COMMAND_ARGS) === undefined) {
|
|
3055
4255
|
json(res, 400, { error: "args too long" });
|
|
3056
4256
|
return;
|
|
3057
4257
|
}
|
|
4258
|
+
if (body.action !== undefined && !["refresh", "more", "refreshAll"].includes(body.action)) {
|
|
4259
|
+
json(res, 400, { error: "invalid model action" });
|
|
4260
|
+
return;
|
|
4261
|
+
}
|
|
3058
4262
|
if (body.confirm !== undefined && !(typeof body.confirm === "string" && /^[0-9a-f]{32}$/.test(body.confirm))) {
|
|
3059
4263
|
json(res, 400, { error: "invalid confirmation" });
|
|
3060
4264
|
return;
|
|
@@ -3086,9 +4290,33 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3086
4290
|
guestCommandsRunning.add(account);
|
|
3087
4291
|
ctx.guestCommandRuns?.record(account);
|
|
3088
4292
|
}
|
|
4293
|
+
if (isNativePaneInstance(ctx.fleetConfig?.instances[instance]) && body.action) {
|
|
4294
|
+
if (command !== "model" || body.action !== "refresh" || body.args) {
|
|
4295
|
+
json(res, 400, { error: "invalid model action" });
|
|
4296
|
+
return;
|
|
4297
|
+
}
|
|
4298
|
+
const target = ctx.fleetConfig.instances[instance];
|
|
4299
|
+
try {
|
|
4300
|
+
const refreshed = await refreshNativeModelCatalog(req, url, ctx, { backend: target.backend, instance });
|
|
4301
|
+
if (!stillAuthorized(req, res, url, ctx))
|
|
4302
|
+
return;
|
|
4303
|
+
if (!refreshed || ctx.fleetConfig?.instances[instance] !== target || !nativeCliAuthorization(req, url, ctx)) {
|
|
4304
|
+
json(res, 409, { error: "model target changed" });
|
|
4305
|
+
return;
|
|
4306
|
+
}
|
|
4307
|
+
json(res, 200, { choices: { current: target.model ?? null, options: refreshed.models.map(m => ({ id: m.id, label: m.label })), actions: ["refresh"] } });
|
|
4308
|
+
}
|
|
4309
|
+
catch {
|
|
4310
|
+
if (stillAuthorized(req, res, url, ctx))
|
|
4311
|
+
json(res, 503, { error: t("model.refresh_failed") });
|
|
4312
|
+
}
|
|
4313
|
+
return;
|
|
4314
|
+
}
|
|
3089
4315
|
try {
|
|
3090
4316
|
const { authority } = confirmAfterBody(arrival, webAuthorityOf(req, url, ctx, instance));
|
|
3091
|
-
const r = await run({ instance, command, args: str(body.args, MAX_COMMAND_ARGS), confirm: body.confirm }, { publicLink: !!gatewayRequestContext(req), person, authority, ...(guest ? { guest: true } : {}) });
|
|
4317
|
+
const r = await run({ instance, command, args: str(body.args, MAX_COMMAND_ARGS), confirm: body.confirm, ...(body.action ? { action: body.action } : {}) }, { publicLink: !!gatewayRequestContext(req), person, authority, ...(guest ? { guest: true } : {}) });
|
|
4318
|
+
if (!stillAuthorized(req, res, url, ctx))
|
|
4319
|
+
return;
|
|
3092
4320
|
json(res, r.status, r.body);
|
|
3093
4321
|
}
|
|
3094
4322
|
finally {
|
|
@@ -3319,6 +4547,10 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3319
4547
|
const body = await parseBody(req);
|
|
3320
4548
|
if (!permitWebContinuation(req, res, ctx))
|
|
3321
4549
|
return;
|
|
4550
|
+
if (body?.runtime === "windows") {
|
|
4551
|
+
await createNativeInstance(req, res, url, ctx, body);
|
|
4552
|
+
return;
|
|
4553
|
+
}
|
|
3322
4554
|
const v = validateArgs(CreateInstanceArgs, body, "create_instance");
|
|
3323
4555
|
if (!v.ok) {
|
|
3324
4556
|
json(res, 400, { error: v.error });
|
|
@@ -3439,7 +4671,10 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3439
4671
|
// board for a revision, so it is built once per (revision, done=all, minute) — the minute for the 14-day
|
|
3440
4672
|
// window. The public link's reads are filtered per request (hidden instances) and are built each time.
|
|
3441
4673
|
// #2757 review: and by the dispatchers gone (a deleted one makes its cards the person's, the revision unchanged).
|
|
3442
|
-
|
|
4674
|
+
// The instances with the task board switched off: no card is handed to them (the pickers mark them), and a
|
|
4675
|
+
// fleet.yaml edit changes them with the revision unchanged.
|
|
4676
|
+
const boardOff = taskBoardOffNames(ctx.fleetConfig).filter((n) => !hiddenName(n));
|
|
4677
|
+
const key = gateway ? null : `${rev}:${allDone ? 1 : 0}:${Math.floor(Date.now() / 60_000)}:${board.goneDispatchers(ctx.dispatcherGone)}:${boardOff.join("\u0000")}`;
|
|
3443
4678
|
const kept = key ? boardBodies.get(board) : undefined;
|
|
3444
4679
|
if (kept && kept.key === key) {
|
|
3445
4680
|
jsonText(res, 200, kept.body);
|
|
@@ -3451,7 +4686,7 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3451
4686
|
// #2355 review: the names a project's lead may be — the fleet's instances (a Classic-only room is not one); over the
|
|
3452
4687
|
// public link, not a hidden one.
|
|
3453
4688
|
const leads = Object.keys(ctx.fleetConfig?.instances ?? {}).filter((n) => !hiddenName(n)).sort();
|
|
3454
|
-
const body = JSON.stringify({ rev, cards: board.views(cards, scope, ctx.dispatcherGone), projects, leads, stats: board.projectStats(ctx.dispatcherGone) });
|
|
4689
|
+
const body = JSON.stringify({ rev, cards: board.views(cards, scope, ctx.dispatcherGone), projects, leads, boardOff, stats: board.projectStats(ctx.dispatcherGone) });
|
|
3455
4690
|
if (key)
|
|
3456
4691
|
boardBodies.set(board, { key, body });
|
|
3457
4692
|
jsonText(res, 200, body);
|
|
@@ -4080,15 +5315,18 @@ function uploadRecipient(ctx, name) {
|
|
|
4080
5315
|
/** Closed, path-free explanations; arbitrary launch errors stay in the host log. */
|
|
4081
5316
|
function webDeliveryFailure(err) {
|
|
4082
5317
|
const message = err instanceof Error ? err.message : "";
|
|
5318
|
+
// M-2297: the per-PC agent limit — say so, with the agents holding its slots (names only: no path, no id).
|
|
5319
|
+
if (err instanceof MachineSlotLimitError)
|
|
5320
|
+
return { reason: "machine_limit", error: message, limit: err.limit, holders: err.holders.map(h => ({ name: h.name, unknown: h.unknown })) };
|
|
4083
5321
|
if (/No warm slot is free/.test(message))
|
|
4084
5322
|
return { reason: "wake_capacity", error: "No slot is free to wake this instance. Retry when another instance is idle." };
|
|
4085
5323
|
if (/login|log in|sign in|\bauth(?:entication|orization)?\b|credential|api.?key/i.test(message))
|
|
4086
|
-
return { reason: "wake_credentials", error: "The instance could not sign in.
|
|
5324
|
+
return { reason: "wake_credentials", error: "The instance could not sign in. Connect its AI account in Settings → Agents → AI accounts and API keys → Accounts, or send /login in chat, then retry." };
|
|
4087
5325
|
if (/timed? out|timeout/i.test(message))
|
|
4088
|
-
return { reason: "wake_timeout", error: "The instance did not become ready in time. Retry, or check its status
|
|
5326
|
+
return { reason: "wake_timeout", error: "The instance did not become ready in time. Retry, or check its status in Fleet." };
|
|
4089
5327
|
if (/Cannot wake stopped|no longer configured/.test(message))
|
|
4090
|
-
return { reason: "instance_stopped", error: "This instance was stopped or removed. Start it
|
|
4091
|
-
return { reason: "delivery_unavailable", error: "The instance could not receive this message. Check its status
|
|
5328
|
+
return { reason: "instance_stopped", error: "This instance was stopped or removed. Start it from the agent's chat menu → Start instance, then retry." };
|
|
5329
|
+
return { reason: "delivery_unavailable", error: "The instance could not receive this message. Check its status in Fleet, then retry." };
|
|
4092
5330
|
}
|
|
4093
5331
|
/** Handle POST /ui/send — extracted for readability. */
|
|
4094
5332
|
/** Each web server's own memory of the sends it accepted by clientId (web-send-dedupe.ts). */
|
|
@@ -4127,6 +5365,15 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4127
5365
|
return;
|
|
4128
5366
|
}
|
|
4129
5367
|
const { instance, message: typed, attachments = [], replyTo, clientId } = parsed.data;
|
|
5368
|
+
const native = isWindowsInstance(ctx.fleetConfig?.instances[instance]);
|
|
5369
|
+
if (native && !nativeCliAuthorization(req, new URL(req.url ?? "/", "http://localhost"), ctx)) {
|
|
5370
|
+
json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
|
|
5371
|
+
return;
|
|
5372
|
+
}
|
|
5373
|
+
if (native && attachments.length) {
|
|
5374
|
+
json(res, 400, { error: "Attachments are not supported by this runtime yet" });
|
|
5375
|
+
return;
|
|
5376
|
+
}
|
|
4130
5377
|
// #1920 step 2b: a guest writes only to an in-scope instance, while guests may chat, and never a command.
|
|
4131
5378
|
const guest = guestRequestOf(req);
|
|
4132
5379
|
const refused = guestChatRefusal(guest, instance);
|
|
@@ -4180,6 +5427,16 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4180
5427
|
break;
|
|
4181
5428
|
}
|
|
4182
5429
|
}
|
|
5430
|
+
const locationHold = ctx.generalLocationDeliveryHold?.(instance);
|
|
5431
|
+
if (locationHold) {
|
|
5432
|
+
const messageId = newWebMessageId(), ts = new Date().toISOString();
|
|
5433
|
+
// Settle this client ID as answered. A Retry after reconnect must never queue its old input.
|
|
5434
|
+
acceptedId = messageId;
|
|
5435
|
+
ctx.emitSseEvent("message", { instance, sender: person.name, role: "user", text: typed, ts, messageId, ...(person.bound ? { from: person.voterKey } : {}), ...(clientId ? { clientId } : {}) });
|
|
5436
|
+
ctx.emitSseEvent("message", { instance, role: "status", sender: "AgEnD", text: locationHold, ts, messageId: newWebMessageId() });
|
|
5437
|
+
json(res, 200, { sent: true, messageId, serviceResponse: true });
|
|
5438
|
+
return;
|
|
5439
|
+
}
|
|
4183
5440
|
let files = [];
|
|
4184
5441
|
if (attachments.length > 0) {
|
|
4185
5442
|
const taken = ctx.webFiles?.takeForMessage(instance, attachments);
|
|
@@ -4202,15 +5459,39 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4202
5459
|
// Recheck the same admission all the way through a wake, before the facade's actual IPC handoff.
|
|
4203
5460
|
const requestUrl = new URL(req.url ?? "/", "http://localhost");
|
|
4204
5461
|
const admission = admissionOf(req, requestUrl, ctx);
|
|
4205
|
-
|
|
5462
|
+
// The sender's authority, without the request's own lifetime: the same admission, the same guest still allowed, the
|
|
5463
|
+
// instance still registered (a Windows one still Windows). A Windows turn is journaled before /ui/send answers and its
|
|
5464
|
+
// process starts after, so the bridge rechecks this one (a revoke in between still stops it); never res, which a
|
|
5465
|
+
// finished response marks destroyed (S-30: every web-chat turn to a Windows agent was refused).
|
|
5466
|
+
const authorityCurrent = () => admission !== null && admissionOf(req, requestUrl, ctx) === admission
|
|
4206
5467
|
&& (!guest || (guest.current() && !guestChatRefusal(guest, instance)))
|
|
4207
|
-
&& (
|
|
5468
|
+
&& (native ? isWindowsInstance(ctx.fleetConfig?.instances[instance]) && nativeCliAuthorization(req, requestUrl, ctx)
|
|
5469
|
+
: registered ? registeredChatInstance(ctx, instance) : ctx.instanceIpcClients.has(instance));
|
|
5470
|
+
const stillCurrent = () => !res.destroyed && authorityCurrent();
|
|
4208
5471
|
const message = typed;
|
|
4209
5472
|
// #1939 S1: what the receipt records about who authorized it (observe only: agents still read web as recognition).
|
|
4210
5473
|
const { authority } = confirmAfterBody(arrival, webAuthorityOf(req, new URL(req.url ?? "/", "http://localhost"), ctx, instance));
|
|
4211
5474
|
const ts = new Date().toISOString();
|
|
4212
5475
|
// The id the agent is given, and the one its delivery reports come back under: the page's ticks.
|
|
4213
|
-
const
|
|
5476
|
+
const nativeRequestId = isNativeExecInstance(ctx.fleetConfig?.instances[instance]) ? (() => {
|
|
5477
|
+
if (!clientId)
|
|
5478
|
+
return randomUUID();
|
|
5479
|
+
const hash = createHash("sha256").update(`agend-native-web\0${WebSendDedupe.key(person.key, instance, clientId)}`).digest("hex");
|
|
5480
|
+
return `${hash.slice(0, 8)}-${hash.slice(8, 12)}-4${hash.slice(13, 16)}-8${hash.slice(17, 20)}-${hash.slice(20, 32)}`;
|
|
5481
|
+
})() : undefined;
|
|
5482
|
+
const messageId = nativeRequestId ? `native:${nativeRequestId}:user` : newWebMessageId();
|
|
5483
|
+
if (nativeRequestId && ctx.nativeInstanceRuntime) {
|
|
5484
|
+
const previous = ctx.nativeInstanceRuntime().get(instance)?.turns.find(turn => turn.id === nativeRequestId);
|
|
5485
|
+
if (previous) {
|
|
5486
|
+
if (previous.prompt !== delivery.text) {
|
|
5487
|
+
json(res, 409, { error: "clientId belongs to a different message" });
|
|
5488
|
+
return;
|
|
5489
|
+
}
|
|
5490
|
+
acceptedId = messageId;
|
|
5491
|
+
json(res, 200, { sent: true, messageId, repeated: true });
|
|
5492
|
+
return;
|
|
5493
|
+
}
|
|
5494
|
+
}
|
|
4214
5495
|
// Use real Telegram context so daemon's lastChatId/lastThreadId are set,
|
|
4215
5496
|
// enabling reply tool even when first message comes from Web UI.
|
|
4216
5497
|
// Pure Web UI mode (no channel config) leaves these empty; the agent's reply then comes back to the
|
|
@@ -4256,11 +5537,12 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4256
5537
|
let delivered;
|
|
4257
5538
|
try {
|
|
4258
5539
|
const deliver = (name, payload) => ctx.deliverHumanToInstance
|
|
4259
|
-
? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent })
|
|
4260
|
-
: ctx.deliverToInstance(name, payload, { stillCurrent });
|
|
5540
|
+
? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
|
|
5541
|
+
: ctx.deliverToInstance(name, payload, { stillCurrent, ...(native ? { authorityCurrent } : {}) });
|
|
4261
5542
|
delivered = await deliver(instance, {
|
|
4262
5543
|
type: "fleet_inbound",
|
|
4263
5544
|
content: delivery.text,
|
|
5545
|
+
...(nativeRequestId ? { requestId: nativeRequestId } : {}),
|
|
4264
5546
|
targetSession: instance,
|
|
4265
5547
|
meta: {
|
|
4266
5548
|
chat_id: groupId ? String(groupId) : "",
|
|
@@ -4657,6 +5939,45 @@ function shellHtmlTag(ctx, mode, viewer) {
|
|
|
4657
5939
|
function shellOwnerCss(ctx, mode, viewer) {
|
|
4658
5940
|
return mode === "full" && !viewer?.guest && viewer?.person !== null && viewer?.person !== undefined && ctx.ownerCss ? ctx.ownerCss.active(viewer.person) : null;
|
|
4659
5941
|
}
|
|
5942
|
+
/**
|
|
5943
|
+
* AgEnD Hub P1 (docs/design/hub.md, docs/design/hub-ui-client.md): the page's Hub mark — presentation only, never
|
|
5944
|
+
* authority, set by the listener that serves the page (never a client's choice): `member` on this fleet's listener when
|
|
5945
|
+
* `hub_member.enabled`, never over the public link. `hub` is only the Hub listener's own workspace page
|
|
5946
|
+
* (serveHubWorkspaceShell). Nothing otherwise: no Hub UI is drawn and no Hub module loads.
|
|
5947
|
+
*/
|
|
5948
|
+
function hubBodyAttrs(req, ctx) {
|
|
5949
|
+
// alpha.6 user report: the mark read the parsed FleetConfig, which never has `hub_member` — a saved switch (or one in the
|
|
5950
|
+
// file at start) never marked the page, so Connect to a Hub never loaded. It reads what the runtime reads: the raw file.
|
|
5951
|
+
let config = null;
|
|
5952
|
+
try {
|
|
5953
|
+
config = (ctx.getRawFleetConfig?.() ?? null);
|
|
5954
|
+
}
|
|
5955
|
+
catch {
|
|
5956
|
+
config = null;
|
|
5957
|
+
}
|
|
5958
|
+
// hub.md §1: member handlers are local-owner-only and unavailable through the public gateway — no member mark there.
|
|
5959
|
+
const member = hubModeOf(config).member && !gatewayRequestContext(req) ? ' data-hub="member"' : "";
|
|
5960
|
+
// #3298 S-89 (leader, #3372 N2): Settings → Hub's Group permissions row only when this fleet's own Hub has them composed —
|
|
5961
|
+
// learned in this process, never by reading a Hub session across origins. Never over the public link.
|
|
5962
|
+
let groups = false;
|
|
5963
|
+
try {
|
|
5964
|
+
groups = ctx.hubGroupPermissions?.() === true;
|
|
5965
|
+
}
|
|
5966
|
+
catch {
|
|
5967
|
+
groups = false;
|
|
5968
|
+
}
|
|
5969
|
+
let setup = false;
|
|
5970
|
+
try {
|
|
5971
|
+
setup = !!ctx.hubSetupSession?.(req);
|
|
5972
|
+
}
|
|
5973
|
+
catch { /* unavailable authority never offers setup */ }
|
|
5974
|
+
return member + (groups && !gatewayRequestContext(req) ? ' data-hub-groups="1"' : "")
|
|
5975
|
+
+ (setup && !gatewayRequestContext(req) ? ' data-hub-setup="1"' : "")
|
|
5976
|
+
+ (setup && !gatewayRequestContext(req) && typeof ctx.hubDirectorySettings === "function"
|
|
5977
|
+
&& !!config?.hub?.hubId ? ' data-hub-directory-settings="1"' : "")
|
|
5978
|
+
+ (setup && !gatewayRequestContext(req) && typeof ctx.hubDirectoryNotices === "function"
|
|
5979
|
+
&& !!config?.hub?.hubId ? ' data-hub-directory-notices="1"' : "");
|
|
5980
|
+
}
|
|
4660
5981
|
function guestBodyAttrs(ctx, owner, attr) {
|
|
4661
5982
|
const badge = ctx.guestBadge?.(owner);
|
|
4662
5983
|
const trusted = ctx.guestTrusted?.(owner) ? ' data-guest-level="trusted"' : "";
|
|
@@ -4672,7 +5993,10 @@ function shellBodyTag(req, ctx, mode, viewer) {
|
|
|
4672
5993
|
ownerCssState = "unknown";
|
|
4673
5994
|
}
|
|
4674
5995
|
const attr = (v) => String(v ?? "").replace(/[&<>"']/g, c => `&#${c.charCodeAt(0)};`);
|
|
4675
|
-
|
|
5996
|
+
const admission = evaluateWebRequest(req, new URL(req.url ?? "/", "http://localhost"), ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
5997
|
+
const childMark = mode === "full" && !gatewayRequestContext(req) && !viewer?.guest && admission.kind === "allow"
|
|
5998
|
+
&& (admission.via !== "session" || admission.session.tier === "admin");
|
|
5999
|
+
return `<body data-mode="${mode}"${childMark ? ' data-subagents="1"' : ""}${mode === "full" && gatewayRequestContext(req) ? ' data-web-transport="poll"' : ""} data-dashboard-origin="${attr(p?.dashboardOrigin)}" data-preview-origin="${attr(p?.previewOrigin)}"`
|
|
4676
6000
|
+ ` data-preview-boot="${attr(p?.previewOrigin ? p.boot : "")}" data-preview-reason="${attr(p ? p.reason : "Previews are not available on this fleet.")}"`
|
|
4677
6001
|
// #1554: no availability asked (the public link, or not the full app) still says why, in the page's language.
|
|
4678
6002
|
+ ` data-preview-reason-code="${attr(p ? p.code ?? "" : gatewayRequestContext(req) ? "publicLink" : "notOffered")}"`
|
|
@@ -4693,12 +6017,47 @@ function shellBodyTag(req, ctx, mode, viewer) {
|
|
|
4693
6017
|
+ `${gatewayRequestContext(req) ? ' data-public-link="1"' : ""}`
|
|
4694
6018
|
// #2478: search is offered over the public link unless web.search.public_link is false (the page then shows no entry).
|
|
4695
6019
|
+ `${gatewayRequestContext(req) && ctx.fleetConfig?.web?.search?.public_link === false ? ' data-search-link="0"' : ""}`
|
|
6020
|
+
// AgEnD Hub P1 (docs/design/hub-ui-client.md): the Hub's marks — only when a switch is on, never on a guest's page.
|
|
6021
|
+
+ `${mode === "full" && !viewer?.guest ? hubBodyAttrs(req, ctx) : ""}`
|
|
4696
6022
|
// #1920 phase 3: a guest's page — the shell shows only what a guest may use, and who it is signed in as.
|
|
4697
6023
|
+ `${mode === "full" && viewer?.guest && viewer.owner ? guestBodyAttrs(ctx, viewer.owner, attr) : ""}>`;
|
|
4698
6024
|
}
|
|
6025
|
+
/**
|
|
6026
|
+
* AgEnD Hub P1, slice 3: the app shell as a Hub's own workspace (served only by the Hub's listener, at its own origin).
|
|
6027
|
+
* It boots Hub-only (app.js: no fleet stream, chat, Needs you, preferences or themes). Nothing of the request is read
|
|
6028
|
+
* — no cookie (the fleet's or the Hub's), no session, no Host: who is signed in is the page's own /hub/v1/session.
|
|
6029
|
+
*/
|
|
6030
|
+
export const HUB_SHELL_DROPS = '<script src="/assets/agend-auth.js"></script>';
|
|
6031
|
+
export function serveHubWorkspaceShell(res, hub) {
|
|
6032
|
+
try {
|
|
6033
|
+
// Without the fleet's fetch wrapper (agend-auth.js): it reads the fleet's /auth/session for a CSRF value and answers
|
|
6034
|
+
// a 401 with the fleet's "session ended" banner. The Hub's pages carry the Hub's own CSRF (hub-client.js).
|
|
6035
|
+
const html = readFileSync(join(__dirname, "ui", "app.html"), "utf-8").replace(HUB_SHELL_DROPS, "");
|
|
6036
|
+
const attr = (v) => v.replace(/[&<>"']/g, c => `&#${c.charCodeAt(0)};`);
|
|
6037
|
+
const name = hubNameOf(hub.name);
|
|
6038
|
+
const preview = hub.preview;
|
|
6039
|
+
const previewAttrs = preview ? ` data-dashboard-origin="${attr(preview.dashboardOrigin)}"`
|
|
6040
|
+
+ (preview.previewOrigin && preview.bootId ? ` data-preview-origin="${attr(preview.previewOrigin)}" data-preview-boot="${attr(preview.bootId)}"`
|
|
6041
|
+
: ` data-preview-reason-code="${attr(preview.reasonCode ?? "notOffered")}" data-preview-reason="${attr(preview.reason ?? "")}"`) : "";
|
|
6042
|
+
const body = `<body data-mode="full" data-web-transport="none" data-usage-panel="0" data-log-tab="0" data-hub="hub"${name ? ` data-hub-name="${attr(name)}"` : ""}${previewAttrs}>`;
|
|
6043
|
+
sendPanelHtml(res, withAppIconLinks(html).replace("<body>", body), 200, { "Cache-Control": "no-store" }, { mediaSrc: "'none'", ...(preview?.previewOrigin ? { frameSrc: `${preview.previewOrigin}/frame` } : {}) });
|
|
6044
|
+
}
|
|
6045
|
+
catch {
|
|
6046
|
+
json(res, 500, { error: "app.html not found" });
|
|
6047
|
+
}
|
|
6048
|
+
}
|
|
4699
6049
|
/** The app shell page for one entry, under the panels' CSP; it may frame exactly <preview origin>/frame, and only
|
|
4700
6050
|
* when this load chose one. */
|
|
4701
|
-
|
|
6051
|
+
/**
|
|
6052
|
+
* The app shell page. `opts.hubWorkspace`: the page is a Hub's own workspace (slice 1's Hub listener only — the fleet's
|
|
6053
|
+
* listener never passes it), so it is drawn as the Hub shell.
|
|
6054
|
+
*/
|
|
6055
|
+
export function serveAppShell(req, res, ctx, mode, opts = {}) {
|
|
6056
|
+
// A Hub workspace is drawn from nothing of this fleet's: no fleet cookie, session, preference or preview is read.
|
|
6057
|
+
if (opts.hubWorkspace) {
|
|
6058
|
+
serveHubWorkspaceShell(res, opts.hubWorkspace);
|
|
6059
|
+
return;
|
|
6060
|
+
}
|
|
4702
6061
|
try {
|
|
4703
6062
|
const html = readFileSync(join(__dirname, "ui", "app.html"), "utf-8");
|
|
4704
6063
|
const viewer = mode === "full" ? prefsViewer(req, new URL(req.url ?? "/", "http://localhost"), ctx) : null;
|