@songsid/agend 2.3.4-beta.9 → 2.3.5-alpha.10
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 +168 -0
- package/dist/accounts-view.js +188 -0
- package/dist/accounts-view.js.map +1 -0
- package/dist/agent-cli-instructions.md +1 -1
- 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 +49 -1
- package/dist/auth-api.js +299 -10
- 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/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 +16 -12
- package/dist/backend/claude-code.js +212 -142
- package/dist/backend/claude-code.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-metadata.d.ts +14 -0
- package/dist/backend/codex-metadata.js +45 -0
- package/dist/backend/codex-metadata.js.map +1 -1
- package/dist/backend/codex-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-speed.d.ts +14 -0
- package/dist/backend/codex-speed.js +35 -0
- package/dist/backend/codex-speed.js.map +1 -0
- package/dist/backend/codex.d.ts +143 -113
- package/dist/backend/codex.js +1352 -1233
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/credential-profile.js +2 -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 +12 -2
- 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 +20 -0
- package/dist/backend/types.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 +19 -0
- package/dist/bundled-tmux-guard.js +83 -0
- package/dist/bundled-tmux-guard.js.map +1 -0
- package/dist/cache-ledger.d.ts +10 -0
- package/dist/cache-ledger.js +49 -12
- package/dist/cache-ledger.js.map +1 -1
- 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 +51 -3
- package/dist/channel/adapters/telegram.js +232 -44
- 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 +2 -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 +48 -0
- package/dist/claude-auth-status.js +149 -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-capability.d.ts +186 -0
- package/dist/cli-capability.js +55 -0
- package/dist/cli-capability.js.map +1 -0
- package/dist/cli-caps-module.d.ts +29 -0
- package/dist/cli-caps-module.js +43 -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 +223 -0
- package/dist/cli-registry-check.js.map +1 -0
- package/dist/cli-registry.d.ts +526 -0
- package/dist/cli-registry.js +83 -0
- package/dist/cli-registry.js.map +1 -0
- package/dist/cli-spec-antigravity.d.ts +60 -0
- package/dist/cli-spec-antigravity.js +35 -0
- package/dist/cli-spec-antigravity.js.map +1 -0
- package/dist/cli-spec-claude-code.d.ts +84 -0
- package/dist/cli-spec-claude-code.js +35 -0
- package/dist/cli-spec-claude-code.js.map +1 -0
- package/dist/cli-spec-codex.d.ts +78 -0
- package/dist/cli-spec-codex.js +38 -0
- package/dist/cli-spec-codex.js.map +1 -0
- package/dist/cli-spec-grok.d.ts +59 -0
- package/dist/cli-spec-grok.js +35 -0
- package/dist/cli-spec-grok.js.map +1 -0
- package/dist/cli-spec-kiro-cli.d.ts +73 -0
- package/dist/cli-spec-kiro-cli.js +36 -0
- package/dist/cli-spec-kiro-cli.js.map +1 -0
- package/dist/cli-spec-muse.d.ts +52 -0
- package/dist/cli-spec-muse.js +38 -0
- package/dist/cli-spec-muse.js.map +1 -0
- package/dist/cli-spec-opencode.d.ts +50 -0
- package/dist/cli-spec-opencode.js +37 -0
- package/dist/cli-spec-opencode.js.map +1 -0
- package/dist/cli.js +258 -67
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +104 -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 +162 -7
- package/dist/daemon.js +1290 -305
- 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 +2 -2
- 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 +831 -7
- package/dist/fleet-manager.js +4894 -433
- package/dist/fleet-manager.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 +97 -39
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +15 -2
- 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 +31 -15
- 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 +11 -3
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +52 -5
- package/dist/instance-lifecycle.js +489 -198
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +2 -0
- package/dist/instructions.js +6 -0
- 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 +246 -34
- package/dist/locale.js.map +1 -1
- package/dist/log-service.d.ts +28 -0
- package/dist/log-service.js +29 -0
- package/dist/log-service.js.map +1 -1
- package/dist/logger.d.ts +16 -2
- package/dist/logger.js +346 -66
- 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.js +25 -4
- 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/missed-offline.d.ts +25 -0
- package/dist/missed-offline.js +79 -0
- package/dist/missed-offline.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 +5 -0
- package/dist/native-model-catalog.js +76 -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 +14 -1
- package/dist/needs-you-hub.js +57 -8
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +92 -2
- package/dist/needs-you.js +54 -3
- 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 +16 -0
- 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 +321 -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-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-install.d.ts +155 -0
- package/dist/runtime-cli-install.js +675 -0
- package/dist/runtime-cli-install.js.map +1 -0
- package/dist/runtime-cli.d.ts +14 -0
- package/dist/runtime-cli.js +416 -0
- package/dist/runtime-cli.js.map +1 -0
- package/dist/runtime-client-store.d.ts +75 -0
- package/dist/runtime-client-store.js +372 -0
- package/dist/runtime-client-store.js.map +1 -0
- package/dist/runtime-client.d.ts +236 -0
- package/dist/runtime-client.js +1267 -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 +107 -0
- package/dist/runtime-coordinator.js +1180 -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-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 +263 -0
- package/dist/runtime-protocol.js +89 -0
- package/dist/runtime-protocol.js.map +1 -0
- package/dist/runtime-remote-accounts.d.ts +197 -0
- package/dist/runtime-remote-accounts.js +663 -0
- package/dist/runtime-remote-accounts.js.map +1 -0
- package/dist/runtime-remote-setup.d.ts +105 -0
- package/dist/runtime-remote-setup.js +529 -0
- package/dist/runtime-remote-setup.js.map +1 -0
- package/dist/runtime-signin-transport.d.ts +39 -0
- package/dist/runtime-signin-transport.js +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 +75 -0
- package/dist/runtime-update-controller.js +691 -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 +23 -1
- package/dist/settings-api.js +705 -6
- 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 +10 -0
- package/dist/settings-change.js +76 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +42 -3
- package/dist/settings-confirmation.js +58 -12
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +17 -0
- package/dist/settings-effect.js +226 -2
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +28 -0
- package/dist/settings-http-confirmation.js +123 -9
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-instance-patch.js +28 -1
- package/dist/settings-instance-patch.js.map +1 -1
- package/dist/settings-request-capability.d.ts +7 -0
- package/dist/settings-request-capability.js +10 -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 +3 -0
- 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/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 +10 -3
- package/dist/tmux-manager.js +60 -38
- 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 +27 -0
- package/dist/ui/accounts-keepalive.js +118 -0
- package/dist/ui/accounts-manage.js +256 -0
- package/dist/ui/accounts-view.js +418 -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 +108 -36
- package/dist/ui/chat-ambient.js +1 -1
- package/dist/ui/chat-commands.js +7 -0
- package/dist/ui/chat-md-strings.js +3 -0
- package/dist/ui/chat-render.js +3 -670
- package/dist/ui/chat-store.js +14 -3
- package/dist/ui/chat-strings.js +3 -285
- package/dist/ui/chat-thread.js +3 -919
- package/dist/ui/chat-time.js +3 -80
- package/dist/ui/chat-tour.js +1 -1
- package/dist/ui/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/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 +74 -0
- package/dist/ui/hub-company-join.js +119 -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 +55 -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/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 +98 -77
- package/dist/ui/panel-details.js +3 -2
- package/dist/ui/panel-fleet.js +183 -32
- package/dist/ui/panel-hub.js +970 -0
- package/dist/ui/panel-log.js +4 -4
- package/dist/ui/panel-needs.js +189 -15
- package/dist/ui/panel-notices.js +4 -3
- package/dist/ui/panel-runtimes.js +446 -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 -472
- 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 +135 -0
- package/dist/ui/runtime-commands.d.ts +4 -0
- package/dist/ui/runtime-commands.js +59 -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 +5 -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 +39 -11
- package/dist/ui/settings-codex-copy.js +19 -0
- package/dist/ui/settings-confirm.js +108 -10
- package/dist/ui/settings-devices.js +249 -0
- package/dist/ui/settings-dialogs.js +78 -25
- package/dist/ui/settings-guests.js +28 -13
- package/dist/ui/settings-hub-browser-certificate.js +76 -0
- package/dist/ui/settings-hub-company-join.js +162 -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 +62 -0
- package/dist/ui/settings-hub-section.js +66 -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 +261 -0
- package/dist/ui/settings-layout.js +246 -0
- package/dist/ui/settings-model.js +26 -3
- package/dist/ui/settings-named-test.js +2 -2
- package/dist/ui/settings-outside.js +242 -0
- package/dist/ui/settings-quota-notice.js +102 -0
- package/dist/ui/settings-registry.js +24 -5
- package/dist/ui/settings-restart-strings.js +17 -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 +127 -52
- package/dist/ui/settings-update.js +69 -0
- package/dist/ui/settings-web-authority.js +19 -12
- package/dist/ui/shared/accounts-keepalive.css +12 -0
- package/dist/ui/shared/accounts.css +78 -0
- package/dist/ui/shared/app-i18n.js +18 -9
- package/dist/ui/shared/app-route.js +12 -3
- package/dist/ui/shared/app-session.js +6 -2
- package/dist/ui/shared/app-shell.js +312 -40
- 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 +1511 -6
- 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/header-tools.js +9 -9
- 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 +51 -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/page-head.js +8 -0
- package/dist/ui/shared/panel-view.js +77 -4
- 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 +30 -0
- package/dist/ui/shared/settings-width.js +31 -0
- package/dist/ui/shared/setup-host-text.js +4 -1
- package/dist/ui/shared/side-rail.js +15 -0
- package/dist/ui/shared/signin.js +280 -10
- 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 +3 -72
- 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-history.css +17 -0
- package/dist/ui/shared/view-history.js +438 -0
- package/dist/ui/shared/view-strings.js +23 -15
- package/dist/ui/shared/web-authorize.js +4 -4
- package/dist/ui/shared/workspace-follow.css +19 -0
- package/dist/ui/shared/workspace.css +20 -0
- package/dist/ui/signin.html +27 -2
- package/dist/ui/structured-signin.js +65 -15
- 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 +2 -2
- 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/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 +5 -0
- package/dist/usage-rollup.js +11 -6
- package/dist/usage-rollup.js.map +1 -1
- package/dist/view-api.d.ts +18 -8
- package/dist/view-api.js +108 -32
- package/dist/view-api.js.map +1 -1
- package/dist/view-history.d.ts +84 -0
- package/dist/view-history.js +116 -0
- package/dist/view-history.js.map +1 -0
- package/dist/web-api.d.ts +133 -2
- package/dist/web-api.js +1091 -26
- 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-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-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-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 +158 -0
- package/dist/web-remote-access.js +377 -0
- package/dist/web-remote-access.js.map +1 -0
- package/dist/web-session.d.ts +53 -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-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 +104 -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 +206 -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 +85 -0
- package/dist/windows-cli-worker.js +585 -0
- package/dist/windows-cli-worker.js.map +1 -0
- package/dist/windows-cli.d.ts +126 -0
- package/dist/windows-cli.js +416 -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 +8 -1
- package/launcher/launchd-session-type.cjs +14 -0
- package/launcher/postinstall.cjs +27 -2
- package/launcher/private-home.cjs +1 -1
- package/launcher/tmux-bundle.cjs +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 +411 -0
package/dist/web-api.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
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";
|
|
@@ -32,18 +35,24 @@ import { shellRoute } from "./web-shell-routes.js";
|
|
|
32
35
|
import { createReadStream, createWriteStream, readFileSync } from "node:fs";
|
|
33
36
|
import { join, dirname } from "node:path";
|
|
34
37
|
import { fileURLToPath } from "node:url";
|
|
38
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
35
39
|
import { CreateInstanceArgs, CreateScheduleArgs, UpdateScheduleArgs, validateArgs } from "./outbound-schemas.js";
|
|
36
40
|
import { scheduleView } from "./web-schedules.js";
|
|
37
41
|
import { DEFAULT_SCHEDULER_CONFIG } from "./scheduler/index.js";
|
|
38
42
|
import { CARD_PRIORITIES, CARD_SIZES, CARD_STATUSES, TaskBoardError } from "./scheduler/task-board.js";
|
|
39
43
|
import { readStatuslineModel, resolveInstanceContext } from "./topic-commands.js";
|
|
40
44
|
import { z } from "zod";
|
|
45
|
+
import { ONBOARDING_BACKENDS, ONBOARDING_BROWSER_BACKENDS } from "./backend-signin-pending.js";
|
|
41
46
|
import { evaluateWebRequest, isPassiveWebRead, isSecureRequest, isWebRequestAuthorized, WEB_TOKEN_INVALID_MESSAGE } from "./web-auth.js";
|
|
42
47
|
import { dashboardOriginFor } from "./web-preview.js";
|
|
43
48
|
import { WEB_CHAT_CARDS_OVERFLOW, catchUpWindow, newWebMessageId, parseLastEventId, webChatReplyRef, webChatReplyText } from "./web-chat-history.js";
|
|
44
49
|
import { PAGE_SHARE_LIMITS, htmlFences, htmlTitle } from "./page-share.js";
|
|
45
50
|
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
51
|
import { getAgendHome } from "./paths.js";
|
|
52
|
+
import { workspaceChanges, workspaceFile, workspaceFileDiff, workspaceImage, workspaceList, workspaceRoot, WorkspaceError } from "./agent-workspace.js";
|
|
53
|
+
import { resolveFollowSteps } from "./workspace-follow.js";
|
|
54
|
+
import { isGeneralInstance } from "./general-instance.js";
|
|
55
|
+
import { resolveToolSet } from "./tool-permissions.js";
|
|
47
56
|
import { OPERATOR, isOwnerEffectKey } from "./web-prefs.js";
|
|
48
57
|
import { WEB_NAME_FALLBACK, webPersonKey } from "./web-profile.js";
|
|
49
58
|
import { commitTeamCreate, commitTeamUpdate } from "./outbound-handlers.js";
|
|
@@ -54,6 +63,14 @@ import { resolveTz } from "./tz-utils.js";
|
|
|
54
63
|
import { QUERY_MAX_CHARS, RESULT_MAX, SEARCH_SOURCES } from "./search/search-store.js";
|
|
55
64
|
import { xmsgShown } from "./search/search-docs.js";
|
|
56
65
|
import { WebSendDedupe } from "./web-send-dedupe.js";
|
|
66
|
+
import { handleWindowsCliRequest, nativeCliAuthorization } from "./windows-cli-api.js";
|
|
67
|
+
import { createNativeInstance, handleNativeInstanceRequest } from "./native-instance-api.js";
|
|
68
|
+
import { handleAgentRuntimeChange } from "./agent-runtime-api.js";
|
|
69
|
+
import { isWindowsInstance, isNativePaneInstance, isNativeExecInstance } from "./native-instance-registry.js";
|
|
70
|
+
import { handleNativeModelCatalog } from "./native-model-catalog.js";
|
|
71
|
+
import { claudeDocumentedModels } from "./model-catalog-defaults.js";
|
|
72
|
+
import { handleRuntimeRequest } from "./runtime-api.js";
|
|
73
|
+
import { taskBoardOffNames } from "./dashboard-permissions.js";
|
|
57
74
|
import { topicFields } from "./instance-topic-delete.js";
|
|
58
75
|
// ── Strict public-facing schemas ────────────────────────────────────────────
|
|
59
76
|
// web-api endpoints must reject unknown fields so the dashboard cannot inject
|
|
@@ -233,8 +250,10 @@ function visibleNeeds(ctx, gateway, items) {
|
|
|
233
250
|
const { hidden } = boardHiding(ctx, true);
|
|
234
251
|
return items.filter((i) => {
|
|
235
252
|
const item = i;
|
|
236
|
-
if (item.type === "config")
|
|
237
|
-
return false; //
|
|
253
|
+
if (item.type === "config" || item.type === "hub")
|
|
254
|
+
return false; // member-local diagnostics/proposals never cross a public link
|
|
255
|
+
if (item.type === "runtime")
|
|
256
|
+
return false;
|
|
238
257
|
if (item.type !== "task")
|
|
239
258
|
return true;
|
|
240
259
|
const code = item.card?.code;
|
|
@@ -452,6 +471,131 @@ function handleAppIcon(req, res, url, ctx, method) {
|
|
|
452
471
|
});
|
|
453
472
|
return true;
|
|
454
473
|
}
|
|
474
|
+
/**
|
|
475
|
+
* M-2738 (#3332): updating AgEnD from the web.
|
|
476
|
+
* GET /ui/update { admin, current, offer?, checked_at?, check_failed?, progress?, now } — an admin session; a
|
|
477
|
+
* read-only session gets { admin: false, current } (its stale-tab reload line)
|
|
478
|
+
* POST /ui/update/check look now (one a minute) → the GET's answer
|
|
479
|
+
* POST /ui/update/start { confirm: "update-agend" } + Idempotency-Key → 202 { started } (the progress is the GET's)
|
|
480
|
+
* GET /ui/update/log { text, error } — the updater's own words, for the failure's "full log"
|
|
481
|
+
* Signed-in sessions only (never the CLI's token, a guest or the public link: none of these is a public route); an
|
|
482
|
+
* admin's for all but the version. Asked again once a body is in.
|
|
483
|
+
*/
|
|
484
|
+
function handleWebUpdate(req, res, url, ctx, path, method) {
|
|
485
|
+
const host = ctx.webUpdate;
|
|
486
|
+
if (!host) {
|
|
487
|
+
json(res, 404, { error: "not found" });
|
|
488
|
+
return true;
|
|
489
|
+
}
|
|
490
|
+
const routes = { "/ui/update": "GET", "/ui/update/check": "POST", "/ui/update/start": "POST", "/ui/update/log": "GET" };
|
|
491
|
+
if (!routes[path]) {
|
|
492
|
+
json(res, 404, { error: "not found" });
|
|
493
|
+
return true;
|
|
494
|
+
}
|
|
495
|
+
if (routes[path] !== method) {
|
|
496
|
+
res.setHeader("Allow", routes[path]);
|
|
497
|
+
json(res, 405, { error: "method not allowed" });
|
|
498
|
+
return true;
|
|
499
|
+
}
|
|
500
|
+
if (gatewayRequestContext(req)) {
|
|
501
|
+
json(res, 404, { error: "not found" });
|
|
502
|
+
return true;
|
|
503
|
+
}
|
|
504
|
+
res.setHeader("Cache-Control", "no-store");
|
|
505
|
+
const who = () => {
|
|
506
|
+
const verdict = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
507
|
+
if (verdict.kind !== "allow")
|
|
508
|
+
return { status: 401, error: WEB_TOKEN_INVALID_MESSAGE };
|
|
509
|
+
if (verdict.via !== "session" || !verdict.session || verdict.session.tier === "guest")
|
|
510
|
+
return { status: 403, error: "update_needs_a_signed_in_person" };
|
|
511
|
+
const owner = verdict.session.owner;
|
|
512
|
+
return { admin: verdict.session.tier === "admin", person: owner ? webPersonKey(owner) : "admin-session" };
|
|
513
|
+
};
|
|
514
|
+
const view = (admin) => {
|
|
515
|
+
const st = host.updateState();
|
|
516
|
+
if (!admin)
|
|
517
|
+
return { admin: false, current: st.current };
|
|
518
|
+
const progress = host.updateProgress();
|
|
519
|
+
return { admin: true, current: st.current, offer: st.offer, checked_at: st.checkedAt, check_failed: st.checkFailed, progress, now: Date.now() };
|
|
520
|
+
};
|
|
521
|
+
const first = who();
|
|
522
|
+
if ("status" in first) {
|
|
523
|
+
json(res, first.status, { error: first.error });
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
if (path === "/ui/update") {
|
|
527
|
+
json(res, 200, view(first.admin));
|
|
528
|
+
return true;
|
|
529
|
+
}
|
|
530
|
+
if (!first.admin) {
|
|
531
|
+
json(res, 403, { error: "update_needs_an_admin_session" });
|
|
532
|
+
return true;
|
|
533
|
+
}
|
|
534
|
+
if (path === "/ui/update/log") {
|
|
535
|
+
const l = host.updateLog();
|
|
536
|
+
json(res, 200, { text: l.text, error: l.error });
|
|
537
|
+
return true;
|
|
538
|
+
}
|
|
539
|
+
(async () => {
|
|
540
|
+
let body = {};
|
|
541
|
+
try {
|
|
542
|
+
body = await parseBody(req);
|
|
543
|
+
}
|
|
544
|
+
catch {
|
|
545
|
+
if (path === "/ui/update/start") {
|
|
546
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
if (!permitWebContinuation(req, res, ctx) || res.destroyed)
|
|
551
|
+
return;
|
|
552
|
+
const now = who();
|
|
553
|
+
if ("status" in now) {
|
|
554
|
+
json(res, now.status, { error: now.error });
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
if (!now.admin) {
|
|
558
|
+
json(res, 403, { error: "update_needs_an_admin_session" });
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
if (path === "/ui/update/check") {
|
|
562
|
+
const r = await host.checkUpdateNow();
|
|
563
|
+
if (!r.ok) {
|
|
564
|
+
json(res, r.status, { error: r.error });
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
json(res, 200, view(true));
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
const header = req.headers["idempotency-key"];
|
|
571
|
+
const key = typeof header === "string" ? header : "";
|
|
572
|
+
if (!/^[A-Za-z0-9_.:-]{8,128}$/.test(key)) {
|
|
573
|
+
json(res, 400, { error: "Idempotency-Key required (8-128 chars of [A-Za-z0-9_.:-])" });
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
// A literal, not a boolean: a stray `true` in a replayed body never means "update AgEnD".
|
|
577
|
+
if (body.confirm !== "update-agend") {
|
|
578
|
+
json(res, 400, { error: 'confirm must be the literal "update-agend"' });
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
// Prism #3505 P2-3: the session that asked, still current and still an admin's, right up to the updater's launch.
|
|
582
|
+
const stillAllowed = () => { const v = who(); return !("status" in v) && v.admin && v.person === now.person; };
|
|
583
|
+
const r = await host.startWebUpdate(key, now.person, stillAllowed);
|
|
584
|
+
if (!r.ok) {
|
|
585
|
+
json(res, r.status, { error: r.error });
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
ctx.logger.info({ person: now.person }, "web: update started");
|
|
589
|
+
json(res, 202, { started: true });
|
|
590
|
+
})().catch((err) => {
|
|
591
|
+
ctx.logger.error({ err: err.message }, "Web update request failed");
|
|
592
|
+
try {
|
|
593
|
+
json(res, 500, { error: "update_request_failed" });
|
|
594
|
+
}
|
|
595
|
+
catch { /* already answered */ }
|
|
596
|
+
});
|
|
597
|
+
return true;
|
|
598
|
+
}
|
|
455
599
|
/**
|
|
456
600
|
* #2636: Office share links — GET /ui/office-share (the open ones, and whether this fleet offers them), POST { office,
|
|
457
601
|
* 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 +1241,142 @@ function handleBrowserBackendSignIns(req, res, url, ctx) {
|
|
|
1097
1241
|
json(res, 403, { error: "sign_in_needs_a_local_admin" });
|
|
1098
1242
|
return true;
|
|
1099
1243
|
}
|
|
1100
|
-
if (!["GET", "POST"].includes(req.method ?? "")
|
|
1244
|
+
if (!["GET", "POST"].includes(req.method ?? "")) {
|
|
1101
1245
|
json(res, 404, { error: "not_found" });
|
|
1102
1246
|
return true;
|
|
1103
1247
|
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1248
|
+
// #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:
|
|
1249
|
+
// `?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
|
|
1250
|
+
// in full before anything else happens.
|
|
1251
|
+
const keys = [...url.searchParams.keys()];
|
|
1252
|
+
let target = null;
|
|
1253
|
+
let account = null;
|
|
1254
|
+
if (keys.length) {
|
|
1255
|
+
const machine = url.searchParams.get("machine"), backend = url.searchParams.get("backend"), profile = url.searchParams.get("profile");
|
|
1256
|
+
const shape = keys.length === 2 && new Set(keys).size === 2 && profile && validCredentialProfileName(profile);
|
|
1257
|
+
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)
|
|
1258
|
+
target = { machine, profile };
|
|
1259
|
+
else if (shape && backend === "claude-code" && !machine)
|
|
1260
|
+
account = { backend, profile };
|
|
1261
|
+
else {
|
|
1262
|
+
json(res, 404, { error: "not_found" });
|
|
1263
|
+
return true;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
// 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.
|
|
1267
|
+
const service = target || account ? undefined : ctx.browserBackendSignIns, machines = target ? ctx.machineSignIns : undefined, accounts = account ? ctx.profileSignIns : undefined;
|
|
1268
|
+
if (target ? !machines : account ? !accounts : !service) {
|
|
1106
1269
|
json(res, 404, { error: "sign_in_unavailable" });
|
|
1107
1270
|
return true;
|
|
1108
1271
|
}
|
|
1109
1272
|
void (async () => {
|
|
1110
1273
|
let result;
|
|
1111
|
-
if (
|
|
1274
|
+
if (target && machines) {
|
|
1275
|
+
if (reading)
|
|
1276
|
+
result = machines.snapshot(owner, target);
|
|
1277
|
+
else {
|
|
1278
|
+
let bytes;
|
|
1279
|
+
try {
|
|
1280
|
+
bytes = await readBoundedWebBody(req, 8192);
|
|
1281
|
+
}
|
|
1282
|
+
catch {
|
|
1283
|
+
json(res, 413, { error: "sign_in_body_bound" });
|
|
1284
|
+
return;
|
|
1285
|
+
}
|
|
1286
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
1287
|
+
return;
|
|
1288
|
+
if (who() !== owner) {
|
|
1289
|
+
json(res, 409, { error: "signin_session_expired" });
|
|
1290
|
+
return;
|
|
1291
|
+
}
|
|
1292
|
+
let body;
|
|
1293
|
+
try {
|
|
1294
|
+
body = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
1295
|
+
}
|
|
1296
|
+
catch {
|
|
1297
|
+
json(res, 400, { error: "sign_in_json" });
|
|
1298
|
+
return;
|
|
1299
|
+
}
|
|
1300
|
+
// Only what a computer's sign-in can do: start (Claude Code, subscription: the Runtime builds the command), answer a prompt, cancel, read again.
|
|
1301
|
+
const parsed = z.discriminatedUnion("operation", [
|
|
1302
|
+
z.strictObject({ operation: z.literal("start"), backend: z.literal("claude-code"), relogin: z.boolean().optional() }),
|
|
1303
|
+
z.strictObject({ operation: z.literal("input"), id: z.string().regex(/^[0-9a-f]{32}$/), revision: z.number().int().nonnegative(), action: z.discriminatedUnion("kind", [
|
|
1304
|
+
z.strictObject({ kind: z.literal("method"), choice: z.string().max(32) }),
|
|
1305
|
+
z.strictObject({ kind: z.enum(["code", "start_url", "region"]), value: z.string().max(4096) }),
|
|
1306
|
+
]) }),
|
|
1307
|
+
z.strictObject({ operation: z.literal("cancel") }), z.strictObject({ operation: z.literal("refresh") }),
|
|
1308
|
+
]).safeParse(body);
|
|
1309
|
+
if (!parsed.success) {
|
|
1310
|
+
json(res, 400, { error: "invalid_signin_action" });
|
|
1311
|
+
return;
|
|
1312
|
+
}
|
|
1313
|
+
const action = parsed.data;
|
|
1314
|
+
if (action.operation === "start")
|
|
1315
|
+
result = await machines.begin(owner, target, action.relogin === true);
|
|
1316
|
+
else if (action.operation === "input")
|
|
1317
|
+
result = await machines.input(owner, target, action.id, action.revision, action.action);
|
|
1318
|
+
else if (action.operation === "cancel")
|
|
1319
|
+
result = await machines.cancel(owner, target);
|
|
1320
|
+
else
|
|
1321
|
+
result = machines.snapshot(owner, target);
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
else if (account && accounts) {
|
|
1325
|
+
if (reading)
|
|
1326
|
+
result = await accounts.refresh(owner, account);
|
|
1327
|
+
else {
|
|
1328
|
+
let bytes;
|
|
1329
|
+
try {
|
|
1330
|
+
bytes = await readBoundedWebBody(req, 8192);
|
|
1331
|
+
}
|
|
1332
|
+
catch {
|
|
1333
|
+
json(res, 413, { error: "sign_in_body_bound" });
|
|
1334
|
+
return;
|
|
1335
|
+
}
|
|
1336
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
1337
|
+
return;
|
|
1338
|
+
if (who() !== owner) {
|
|
1339
|
+
json(res, 409, { error: "signin_session_expired" });
|
|
1340
|
+
return;
|
|
1341
|
+
}
|
|
1342
|
+
let body;
|
|
1343
|
+
try {
|
|
1344
|
+
body = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
1345
|
+
}
|
|
1346
|
+
catch {
|
|
1347
|
+
json(res, 400, { error: "sign_in_json" });
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
// 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.
|
|
1351
|
+
// No checklist here: no select, no skip.
|
|
1352
|
+
const parsed = z.discriminatedUnion("operation", [
|
|
1353
|
+
z.strictObject({ operation: z.literal("start"), backend: z.literal(account.backend), relogin: z.boolean().optional() }),
|
|
1354
|
+
z.strictObject({ operation: z.literal("input"), id: z.string().regex(/^[0-9a-f]{32}$/), revision: z.number().int().nonnegative(), action: z.discriminatedUnion("kind", [
|
|
1355
|
+
z.strictObject({ kind: z.literal("method"), choice: z.string().max(32) }),
|
|
1356
|
+
z.strictObject({ kind: z.enum(["code", "start_url", "region"]), value: z.string().max(4096) }),
|
|
1357
|
+
]) }),
|
|
1358
|
+
z.strictObject({ operation: z.literal("cancel"), id: z.string().regex(/^[0-9a-f]{32}$/).optional() }), z.strictObject({ operation: z.literal("refresh") }),
|
|
1359
|
+
]).safeParse(body);
|
|
1360
|
+
if (!parsed.success) {
|
|
1361
|
+
json(res, 400, { error: "invalid_signin_action" });
|
|
1362
|
+
return;
|
|
1363
|
+
}
|
|
1364
|
+
const action = parsed.data;
|
|
1365
|
+
if (action.operation === "start")
|
|
1366
|
+
result = await accounts.begin(owner, account, action.relogin === true);
|
|
1367
|
+
else if (action.operation === "input")
|
|
1368
|
+
result = await accounts.input(owner, account, action.id, action.revision, action.action);
|
|
1369
|
+
else if (action.operation === "cancel")
|
|
1370
|
+
result = await accounts.cancel(owner, account, action.id);
|
|
1371
|
+
else
|
|
1372
|
+
result = await accounts.refresh(owner, account, true);
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
else if (!service) {
|
|
1376
|
+
json(res, 404, { error: "sign_in_unavailable" });
|
|
1377
|
+
return;
|
|
1378
|
+
}
|
|
1379
|
+
else if (reading)
|
|
1112
1380
|
result = await service.refresh(owner);
|
|
1113
1381
|
else {
|
|
1114
1382
|
let bytes;
|
|
@@ -1134,13 +1402,13 @@ function handleBrowserBackendSignIns(req, res, url, ctx) {
|
|
|
1134
1402
|
return;
|
|
1135
1403
|
}
|
|
1136
1404
|
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(
|
|
1405
|
+
z.strictObject({ operation: z.literal("select"), backends: z.array(z.enum(ONBOARDING_BACKENDS)).max(ONBOARDING_BACKENDS.length) }),
|
|
1406
|
+
z.strictObject({ operation: z.literal("start"), backend: z.enum(ONBOARDING_BROWSER_BACKENDS), relogin: z.boolean().optional() }),
|
|
1139
1407
|
z.strictObject({ operation: z.literal("input"), id: z.string().regex(/^[0-9a-f]{32}$/), revision: z.number().int().nonnegative(), action: z.discriminatedUnion("kind", [
|
|
1140
1408
|
z.strictObject({ kind: z.literal("method"), choice: z.string().max(32) }),
|
|
1141
1409
|
z.strictObject({ kind: z.enum(["code", "start_url", "region"]), value: z.string().max(4096) }),
|
|
1142
1410
|
]) }),
|
|
1143
|
-
z.strictObject({ operation: z.literal("skip"), backend: z.enum(
|
|
1411
|
+
z.strictObject({ operation: z.literal("skip"), backend: z.enum(ONBOARDING_BACKENDS) }),
|
|
1144
1412
|
z.strictObject({ operation: z.literal("cancel") }), z.strictObject({ operation: z.literal("refresh") }),
|
|
1145
1413
|
]).safeParse(body);
|
|
1146
1414
|
if (!parsed.success) {
|
|
@@ -1170,7 +1438,7 @@ function handleBrowserBackendSignIns(req, res, url, ctx) {
|
|
|
1170
1438
|
json(res, 200, result);
|
|
1171
1439
|
})().catch(error => {
|
|
1172
1440
|
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";
|
|
1441
|
+
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
1442
|
if (!res.destroyed && !res.writableEnded)
|
|
1175
1443
|
json(res, safe === "signin_cleanup_failed" || safe === "signin_failed" ? 503 : 409, { error: safe });
|
|
1176
1444
|
});
|
|
@@ -1209,7 +1477,18 @@ function handleBackendLogin(req, res, url, ctx, path, method) {
|
|
|
1209
1477
|
}
|
|
1210
1478
|
const action = /^\/ui\/backend-login\/(check|start|cancel)$/.exec(path)?.[1];
|
|
1211
1479
|
if (reading && path === "/ui/backend-login" && [...url.searchParams.keys()].length === 0) {
|
|
1212
|
-
|
|
1480
|
+
// 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
|
|
1481
|
+
// and the page is told to read again when something new is known.
|
|
1482
|
+
try {
|
|
1483
|
+
ctx.refreshSignInIdentities?.();
|
|
1484
|
+
}
|
|
1485
|
+
catch { /* the list is served with what is known */ }
|
|
1486
|
+
try {
|
|
1487
|
+
json(res, 200, { login: logins.view(first.handle), targets: ctx.backendSignInTargets?.() ?? [] });
|
|
1488
|
+
}
|
|
1489
|
+
catch {
|
|
1490
|
+
json(res, 503, { error: "sign_in_unavailable" });
|
|
1491
|
+
}
|
|
1213
1492
|
return true;
|
|
1214
1493
|
}
|
|
1215
1494
|
if (method !== "POST" || !action) {
|
|
@@ -1262,11 +1541,17 @@ function handleBackendLogin(req, res, url, ctx, path, method) {
|
|
|
1262
1541
|
json(res, "error" in result ? 409 : 200, result);
|
|
1263
1542
|
}
|
|
1264
1543
|
else {
|
|
1265
|
-
|
|
1544
|
+
// `{}`: the explicit "Cancel sign-in" — whatever sign-in is running, as ever. `{ run, ifUnopened }`: the dialog's own Close (#3321 review), for
|
|
1545
|
+
// 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.
|
|
1546
|
+
const parsed = z.union([z.strictObject({}), z.strictObject({ run: z.string().regex(/^[0-9a-f]{32}$/), ifUnopened: z.literal(true) })]).safeParse(body);
|
|
1547
|
+
if (!parsed.success) {
|
|
1266
1548
|
json(res, 400, { error: "sign_in_args" });
|
|
1267
1549
|
return;
|
|
1268
1550
|
}
|
|
1269
|
-
|
|
1551
|
+
if ("run" in parsed.data)
|
|
1552
|
+
json(res, 200, await logins.closeRun(now, parsed.data.run));
|
|
1553
|
+
else
|
|
1554
|
+
json(res, 200, { message: await logins.cancel() });
|
|
1270
1555
|
}
|
|
1271
1556
|
})().catch(() => { try {
|
|
1272
1557
|
json(res, 500, { error: "sign_in_request_failed" });
|
|
@@ -1274,6 +1559,237 @@ function handleBackendLogin(req, res, url, ctx, path, method) {
|
|
|
1274
1559
|
catch { /* response ended */ } });
|
|
1275
1560
|
return true;
|
|
1276
1561
|
}
|
|
1562
|
+
/**
|
|
1563
|
+
* #3212 PR 2: Settings → Accounts — `POST /ui/accounts/<backend>` `{ name }` adds a named account (a credential profile's
|
|
1564
|
+
* folder); `DELETE /ui/accounts/<backend>/<name>` `{ confirm: <name> }` removes one (accounts-profiles.ts: every refusal
|
|
1565
|
+
* deletes nothing). PR 3: `POST /ui/accounts/<backend>/signout` `{ profile: <name> | null, confirm: true }` signs an
|
|
1566
|
+
* 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,
|
|
1567
|
+
* a read session, the public link or the gateway — refused before the body is read, and again after it.
|
|
1568
|
+
*/
|
|
1569
|
+
const ACCOUNT_STATUS = {
|
|
1570
|
+
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,
|
|
1571
|
+
unsafe: 409, default_home: 409, failed: 500, unsupported: 400,
|
|
1572
|
+
// #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).
|
|
1573
|
+
machine_unknown: 404, machine_offline: 409, machine_unsupported: 409, machine_accounts_off: 409, machine_unreachable: 502, machine_profile_not_owned: 409,
|
|
1574
|
+
machine_refused: 409, machine_default_login: 409,
|
|
1575
|
+
};
|
|
1576
|
+
function handleAccountWrite(req, res, url, ctx, path, method) {
|
|
1577
|
+
res.setHeader("Cache-Control", "private, no-store");
|
|
1578
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
1579
|
+
if (gatewayRequestContext(req)) {
|
|
1580
|
+
json(res, 403, { error: "accounts_not_over_public_link" });
|
|
1581
|
+
return true;
|
|
1582
|
+
}
|
|
1583
|
+
const who = () => {
|
|
1584
|
+
const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
1585
|
+
if (v.kind !== "allow")
|
|
1586
|
+
return { error: WEB_TOKEN_INVALID_MESSAGE, status: 401 };
|
|
1587
|
+
if (v.via !== "session" || v.session.tier !== "admin" || v.session.surface !== "local")
|
|
1588
|
+
return { error: "accounts_need_a_local_admin", status: 403 };
|
|
1589
|
+
return { handle: v.session.handle, label: v.session.label };
|
|
1590
|
+
};
|
|
1591
|
+
const first = who();
|
|
1592
|
+
if ("error" in first) {
|
|
1593
|
+
json(res, first.status, { error: first.error });
|
|
1594
|
+
return true;
|
|
1595
|
+
}
|
|
1596
|
+
const add = method === "POST" ? /^\/ui\/accounts\/([a-z][a-z0-9-]{0,31})$/.exec(path) : null;
|
|
1597
|
+
const remove = method === "DELETE" ? /^\/ui\/accounts\/([a-z][a-z0-9-]{0,31})\/([^/]{1,200})$/.exec(path) : null;
|
|
1598
|
+
const signout = method === "POST" ? /^\/ui\/accounts\/([a-z][a-z0-9-]{0,31})\/signout$/.exec(path) : null;
|
|
1599
|
+
if (!add && !remove && !signout) {
|
|
1600
|
+
json(res, 404, { error: "not_found" });
|
|
1601
|
+
return true;
|
|
1602
|
+
}
|
|
1603
|
+
const handler = add ? ctx.addAccountProfile : remove ? ctx.removeAccountProfile : ctx.signOutAccount;
|
|
1604
|
+
if (typeof handler !== "function") {
|
|
1605
|
+
json(res, 404, { error: "not_found" });
|
|
1606
|
+
return true;
|
|
1607
|
+
}
|
|
1608
|
+
let target = "";
|
|
1609
|
+
if (remove) {
|
|
1610
|
+
try {
|
|
1611
|
+
target = decodeURIComponent(remove[2]);
|
|
1612
|
+
}
|
|
1613
|
+
catch {
|
|
1614
|
+
json(res, 400, { error: "name" });
|
|
1615
|
+
return true;
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
(async () => {
|
|
1619
|
+
let bytes;
|
|
1620
|
+
try {
|
|
1621
|
+
bytes = await readBoundedWebBody(req, 1024);
|
|
1622
|
+
}
|
|
1623
|
+
catch {
|
|
1624
|
+
json(res, 413, { error: "accounts_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: "accounts_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: "accounts_json" });
|
|
1644
|
+
return;
|
|
1645
|
+
}
|
|
1646
|
+
// #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.
|
|
1647
|
+
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();
|
|
1648
|
+
const onMachine = (id) => {
|
|
1649
|
+
if (id === undefined)
|
|
1650
|
+
return undefined;
|
|
1651
|
+
return /^[a-f0-9]{16}$/.test(now.handle) ? { id, actor: `admin:${now.handle}` } : "refused";
|
|
1652
|
+
};
|
|
1653
|
+
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 } : {}) });
|
|
1654
|
+
if (add) {
|
|
1655
|
+
const parsed = z.strictObject({ name: z.string().max(200), machine: machineId }).safeParse(body);
|
|
1656
|
+
if (!parsed.success) {
|
|
1657
|
+
json(res, 400, { error: "accounts_args" });
|
|
1658
|
+
return;
|
|
1659
|
+
}
|
|
1660
|
+
const machine = onMachine(parsed.data.machine);
|
|
1661
|
+
if (machine === "refused") {
|
|
1662
|
+
json(res, 403, { error: "accounts_need_a_local_admin" });
|
|
1663
|
+
return;
|
|
1664
|
+
}
|
|
1665
|
+
const r = await (machine ? ctx.addAccountProfile(add[1], parsed.data.name, now.label, machine) : ctx.addAccountProfile(add[1], parsed.data.name, now.label));
|
|
1666
|
+
if (r.ok)
|
|
1667
|
+
json(res, 200, { added: parsed.data.name, ...(machine ? { machine: machine.id } : {}) });
|
|
1668
|
+
else
|
|
1669
|
+
fail(r);
|
|
1670
|
+
}
|
|
1671
|
+
else if (remove) {
|
|
1672
|
+
// `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.
|
|
1673
|
+
// A paired computer's sign-in is cancelled from that computer's side, so it is refused there.
|
|
1674
|
+
const parsed = z.strictObject({ confirm: z.string().max(200), machine: machineId, cancelSignIn: z.literal(true).optional() }).refine(a => !(a.machine && a.cancelSignIn)).safeParse(body);
|
|
1675
|
+
if (!parsed.success) {
|
|
1676
|
+
json(res, 400, { error: "accounts_args" });
|
|
1677
|
+
return;
|
|
1678
|
+
}
|
|
1679
|
+
const machine = onMachine(parsed.data.machine);
|
|
1680
|
+
if (machine === "refused") {
|
|
1681
|
+
json(res, 403, { error: "accounts_need_a_local_admin" });
|
|
1682
|
+
return;
|
|
1683
|
+
}
|
|
1684
|
+
const r = await (machine ? ctx.removeAccountProfile(remove[1], target, parsed.data.confirm, now.label, machine)
|
|
1685
|
+
: parsed.data.cancelSignIn ? ctx.removeAccountProfile(remove[1], target, parsed.data.confirm, now.label, undefined, { cancelSignIn: true })
|
|
1686
|
+
: ctx.removeAccountProfile(remove[1], target, parsed.data.confirm, now.label));
|
|
1687
|
+
if (r.ok)
|
|
1688
|
+
json(res, 200, { removed: target, ...(r.keychainLeft ? { keychainLeft: true } : {}) });
|
|
1689
|
+
else
|
|
1690
|
+
fail(r);
|
|
1691
|
+
}
|
|
1692
|
+
else {
|
|
1693
|
+
const parsed = z.strictObject({ profile: z.string().max(200).nullable(), confirm: z.literal(true), machine: machineId }).safeParse(body);
|
|
1694
|
+
if (!parsed.success) {
|
|
1695
|
+
json(res, 400, { error: "accounts_args" });
|
|
1696
|
+
return;
|
|
1697
|
+
}
|
|
1698
|
+
const machine = onMachine(parsed.data.machine);
|
|
1699
|
+
if (machine === "refused") {
|
|
1700
|
+
json(res, 403, { error: "accounts_need_a_local_admin" });
|
|
1701
|
+
return;
|
|
1702
|
+
}
|
|
1703
|
+
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));
|
|
1704
|
+
if (r.ok)
|
|
1705
|
+
json(res, 200, { signedOut: parsed.data.profile, ...(r.keychainLeft ? { keychainLeft: true } : {}) });
|
|
1706
|
+
else
|
|
1707
|
+
fail(r);
|
|
1708
|
+
}
|
|
1709
|
+
})().catch(() => { try {
|
|
1710
|
+
json(res, 500, { error: "accounts_request_failed" });
|
|
1711
|
+
}
|
|
1712
|
+
catch { /* response ended */ } });
|
|
1713
|
+
return true;
|
|
1714
|
+
}
|
|
1715
|
+
/**
|
|
1716
|
+
* #3292: Settings → Accounts → Keep sign-in alive — `POST /ui/accounts/keep-alive` `{ backend, profile: <name> | null,
|
|
1717
|
+
* enabled, fallback? }`. The same gate as the other account writes: the fleet's local admin session only, refused before
|
|
1718
|
+
* the body is read and again after it; never the gateway, a guest, a read session or the CLI's header token.
|
|
1719
|
+
*/
|
|
1720
|
+
const KEEPALIVE_STATUS = { backend: 400, profile: 400, fallback: 400, write: 500 };
|
|
1721
|
+
function handleAccountKeepAlive(req, res, url, ctx, method) {
|
|
1722
|
+
res.setHeader("Cache-Control", "private, no-store");
|
|
1723
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
1724
|
+
if (gatewayRequestContext(req)) {
|
|
1725
|
+
json(res, 403, { error: "accounts_not_over_public_link" });
|
|
1726
|
+
return true;
|
|
1727
|
+
}
|
|
1728
|
+
if (method !== "POST") {
|
|
1729
|
+
json(res, 405, { error: "method_not_allowed" });
|
|
1730
|
+
return true;
|
|
1731
|
+
}
|
|
1732
|
+
const who = () => {
|
|
1733
|
+
const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
1734
|
+
if (v.kind !== "allow")
|
|
1735
|
+
return { error: WEB_TOKEN_INVALID_MESSAGE, status: 401 };
|
|
1736
|
+
if (v.via !== "session" || v.session.tier !== "admin" || v.session.surface !== "local")
|
|
1737
|
+
return { error: "accounts_need_a_local_admin", status: 403 };
|
|
1738
|
+
return { handle: v.session.handle, label: v.session.label };
|
|
1739
|
+
};
|
|
1740
|
+
const first = who();
|
|
1741
|
+
if ("error" in first) {
|
|
1742
|
+
json(res, first.status, { error: first.error });
|
|
1743
|
+
return true;
|
|
1744
|
+
}
|
|
1745
|
+
if (typeof ctx.setAccountKeepAlive !== "function") {
|
|
1746
|
+
json(res, 404, { error: "not_found" });
|
|
1747
|
+
return true;
|
|
1748
|
+
}
|
|
1749
|
+
(async () => {
|
|
1750
|
+
let bytes;
|
|
1751
|
+
try {
|
|
1752
|
+
bytes = await readBoundedWebBody(req, 1024);
|
|
1753
|
+
}
|
|
1754
|
+
catch {
|
|
1755
|
+
json(res, 413, { error: "accounts_body_bound" });
|
|
1756
|
+
return;
|
|
1757
|
+
}
|
|
1758
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
1759
|
+
return;
|
|
1760
|
+
const now = who();
|
|
1761
|
+
if ("error" in now) {
|
|
1762
|
+
json(res, now.status, { error: now.error });
|
|
1763
|
+
return;
|
|
1764
|
+
}
|
|
1765
|
+
if (now.handle !== first.handle) {
|
|
1766
|
+
json(res, 409, { error: "accounts_session_changed" });
|
|
1767
|
+
return;
|
|
1768
|
+
}
|
|
1769
|
+
let body;
|
|
1770
|
+
try {
|
|
1771
|
+
body = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
1772
|
+
}
|
|
1773
|
+
catch {
|
|
1774
|
+
json(res, 400, { error: "accounts_json" });
|
|
1775
|
+
return;
|
|
1776
|
+
}
|
|
1777
|
+
const parsed = z.strictObject({ backend: z.string().max(32), profile: z.string().max(200).nullable(), enabled: z.boolean(), fallback: z.boolean().optional() }).safeParse(body);
|
|
1778
|
+
if (!parsed.success) {
|
|
1779
|
+
json(res, 400, { error: "accounts_args" });
|
|
1780
|
+
return;
|
|
1781
|
+
}
|
|
1782
|
+
const r = ctx.setAccountKeepAlive(parsed.data.backend, parsed.data.profile, parsed.data.enabled, parsed.data.fallback, now.label);
|
|
1783
|
+
if (r.ok)
|
|
1784
|
+
json(res, 200, { backend: parsed.data.backend, profile: parsed.data.profile, enabled: parsed.data.enabled });
|
|
1785
|
+
else
|
|
1786
|
+
json(res, KEEPALIVE_STATUS[r.error] ?? 409, { error: r.error });
|
|
1787
|
+
})().catch(() => { try {
|
|
1788
|
+
json(res, 500, { error: "accounts_request_failed" });
|
|
1789
|
+
}
|
|
1790
|
+
catch { /* response ended */ } });
|
|
1791
|
+
return true;
|
|
1792
|
+
}
|
|
1277
1793
|
/**
|
|
1278
1794
|
* #1629 r4 §4 (r4-5): mods — a person's import (stage, then commit), uninstall and export. Every route is a signed-in
|
|
1279
1795
|
* session's, writes an admin's: never the CLI's header token (the way an agent could reach it) and never the public link
|
|
@@ -1872,6 +2388,29 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1872
2388
|
return false;
|
|
1873
2389
|
}
|
|
1874
2390
|
// ── Static files ───────────────────────────────────────
|
|
2391
|
+
// Native local tools retain their administrator boundary on the shared chat/read/action routes.
|
|
2392
|
+
const nativePath = /^\/ui\/(?:chat|instance|cancel|stop|start|restart)\/([^/]+)$/.exec(path);
|
|
2393
|
+
let nativeTarget = url.searchParams.get("instance") ?? "";
|
|
2394
|
+
if (nativePath) {
|
|
2395
|
+
try {
|
|
2396
|
+
nativeTarget = decodeURIComponent(nativePath[1]);
|
|
2397
|
+
}
|
|
2398
|
+
catch {
|
|
2399
|
+
nativeTarget = "";
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
if (isWindowsInstance(ctx.fleetConfig?.instances?.[nativeTarget]) && !nativeCliAuthorization(req, url, ctx)) {
|
|
2403
|
+
json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
|
|
2404
|
+
return true;
|
|
2405
|
+
}
|
|
2406
|
+
if (handleAgentRuntimeChange(req, res, url, ctx))
|
|
2407
|
+
return true;
|
|
2408
|
+
if (handleNativeInstanceRequest(req, res, url, ctx))
|
|
2409
|
+
return true;
|
|
2410
|
+
if (handleWindowsCliRequest(req, res, url, ctx))
|
|
2411
|
+
return true;
|
|
2412
|
+
if (handleRuntimeRequest(req, res, url, ctx))
|
|
2413
|
+
return true;
|
|
1875
2414
|
// #1408: the app shell, for exactly the paths the classifier names (src/web-shell-routes.ts). One page for every
|
|
1876
2415
|
// route; the client router mounts the panel. A malformed instance name is a 400, an unknown one is the shell (the
|
|
1877
2416
|
// panel says "not found"), so the response never tells which names exist.
|
|
@@ -1880,6 +2419,11 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1880
2419
|
json(res, 400, { error: "invalid instance name" });
|
|
1881
2420
|
return true;
|
|
1882
2421
|
}
|
|
2422
|
+
// 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.
|
|
2423
|
+
if (shell?.kind === "shell" && shell.route.panel === "hub") {
|
|
2424
|
+
json(res, 404, { error: "not found" });
|
|
2425
|
+
return true;
|
|
2426
|
+
}
|
|
1883
2427
|
if (shell?.kind === "shell") {
|
|
1884
2428
|
serveAppShell(req, res, ctx, "full");
|
|
1885
2429
|
return true;
|
|
@@ -1927,7 +2471,45 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1927
2471
|
json(res, 400, { error: "backend (and optional instance) required" });
|
|
1928
2472
|
return true;
|
|
1929
2473
|
}
|
|
1930
|
-
|
|
2474
|
+
const runtime = url.searchParams.get("runtime"), refresh = url.searchParams.get("refresh");
|
|
2475
|
+
const machineId = url.searchParams.get("machineId");
|
|
2476
|
+
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")) {
|
|
2477
|
+
json(res, 400, { error: "Invalid model runtime machine" });
|
|
2478
|
+
return true;
|
|
2479
|
+
}
|
|
2480
|
+
if ((runtime !== null && runtime !== "wsl" && runtime !== "windows") || (refresh !== null && refresh !== "1")) {
|
|
2481
|
+
json(res, 400, { error: "Invalid model catalog options" });
|
|
2482
|
+
return true;
|
|
2483
|
+
}
|
|
2484
|
+
if (handleNativeModelCatalog(req, res, url, ctx))
|
|
2485
|
+
return true;
|
|
2486
|
+
const models = ctx.modelCatalogFor?.(backend, instance) ?? [];
|
|
2487
|
+
const answerCatalog = () => {
|
|
2488
|
+
if (backend === "claude-code" && !models.length) {
|
|
2489
|
+
const version = ctx.backendAvailabilityRows?.().find(row => row.backend === backend)?.version;
|
|
2490
|
+
json(res, 200, { backend, models: claudeDocumentedModels(version), source: "official-catalog" });
|
|
2491
|
+
}
|
|
2492
|
+
else
|
|
2493
|
+
json(res, 200, { backend, models });
|
|
2494
|
+
};
|
|
2495
|
+
// The existing catalog belongs to this instance/account and always wins.
|
|
2496
|
+
if (models.length || !ctx.cliModelCatalogFor) {
|
|
2497
|
+
answerCatalog();
|
|
2498
|
+
return true;
|
|
2499
|
+
}
|
|
2500
|
+
const canAnswer = () => !res.headersSent && !res.destroyed && !res.writableEnded && stillAuthorized(req, res, url, ctx);
|
|
2501
|
+
void (async () => {
|
|
2502
|
+
const cliModels = await ctx.cliModelCatalogFor?.(backend, instance) ?? [];
|
|
2503
|
+
if (!canAnswer())
|
|
2504
|
+
return;
|
|
2505
|
+
if (cliModels.length)
|
|
2506
|
+
json(res, 200, { backend, models: cliModels, source: "cli-cache" });
|
|
2507
|
+
else
|
|
2508
|
+
answerCatalog();
|
|
2509
|
+
})().catch(() => {
|
|
2510
|
+
if (canAnswer())
|
|
2511
|
+
json(res, 503, { error: "CLI model cache unavailable" });
|
|
2512
|
+
});
|
|
1931
2513
|
return true;
|
|
1932
2514
|
}
|
|
1933
2515
|
if (method === "GET" && path === "/ui/backends") {
|
|
@@ -2133,6 +2715,143 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2133
2715
|
json(res, 200, { messages, boot: ctx.webChatHistory?.boot ?? null, lastId: ctx.webChatHistory?.lastId ?? 0, ...(allHidden ? { allHidden: true } : {}) });
|
|
2134
2716
|
return true;
|
|
2135
2717
|
}
|
|
2718
|
+
// ── #3212 PR 1: Settings → Agents → Accounts (read-only) ─────────────────────────────────
|
|
2719
|
+
// Each CLI's default sign-in and credential profiles, who uses them and their weekly usage. Names, states, the masked
|
|
2720
|
+
// identity and the host login command (which, as in the sign-in list, names the profile's folder) — no credential or
|
|
2721
|
+
// full e-mail: only for the fleet's local admin session — never the public link, a guest, a token or the gateway (the
|
|
2722
|
+
// same rule as the sign-in list it extends).
|
|
2723
|
+
if (method === "GET" && path === "/ui/accounts") {
|
|
2724
|
+
res.setHeader("Cache-Control", "private, no-store");
|
|
2725
|
+
if (gatewayRequestContext(req)) {
|
|
2726
|
+
json(res, 404, { error: "not_found" });
|
|
2727
|
+
return true;
|
|
2728
|
+
}
|
|
2729
|
+
const localAdmin = () => {
|
|
2730
|
+
const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
2731
|
+
return v.kind === "allow" && v.via === "session" && v.session.tier === "admin" && v.session.surface === "local" ? v.session : null;
|
|
2732
|
+
};
|
|
2733
|
+
const who = localAdmin();
|
|
2734
|
+
if (!who) {
|
|
2735
|
+
json(res, 403, { error: "accounts_need_a_local_admin" });
|
|
2736
|
+
return true;
|
|
2737
|
+
}
|
|
2738
|
+
if (typeof ctx.accountsView !== "function") {
|
|
2739
|
+
json(res, 404, { error: "not_found" });
|
|
2740
|
+
return true;
|
|
2741
|
+
}
|
|
2742
|
+
void ctx.accountsView().then(view => {
|
|
2743
|
+
if (localAdmin()?.handle !== who.handle) {
|
|
2744
|
+
json(res, 403, { error: "accounts_need_a_local_admin" });
|
|
2745
|
+
return;
|
|
2746
|
+
}
|
|
2747
|
+
json(res, 200, view);
|
|
2748
|
+
}, err => { ctx.logger.error({ err: err.message }, "Accounts view failed"); json(res, 500, { error: "could not read the accounts" }); });
|
|
2749
|
+
return true;
|
|
2750
|
+
}
|
|
2751
|
+
// ── #3153 P1: an agent's Files / Changes (read-only) ─────────────────────────────────
|
|
2752
|
+
// The fleet's local admin session only: never the public link, a guest, a token or a connection from outside. One
|
|
2753
|
+
// agent's own working directory (agent-workspace.ts confines and filters every path); not General or a coordinator
|
|
2754
|
+
// (they work in the fleet's own directory), not an agent on another machine.
|
|
2755
|
+
if (method === "GET" && path === "/ui/workspace") {
|
|
2756
|
+
res.setHeader("Cache-Control", "private, no-store");
|
|
2757
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
2758
|
+
if (gatewayRequestContext(req)) {
|
|
2759
|
+
json(res, 404, { error: "not_found" });
|
|
2760
|
+
return true;
|
|
2761
|
+
}
|
|
2762
|
+
const localAdmin = () => {
|
|
2763
|
+
const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
2764
|
+
return v.kind === "allow" && v.via === "session" && v.session.tier === "admin" && v.session.surface === "local" ? v.session : null;
|
|
2765
|
+
};
|
|
2766
|
+
const who = localAdmin();
|
|
2767
|
+
if (!who) {
|
|
2768
|
+
json(res, 403, { error: "workspace_needs_a_local_admin" });
|
|
2769
|
+
return true;
|
|
2770
|
+
}
|
|
2771
|
+
const p = url.searchParams, instance = p.get("instance") ?? "", op = p.get("op") ?? "";
|
|
2772
|
+
const cfg = ctx.fleetConfig?.instances && Object.hasOwn(ctx.fleetConfig.instances, instance) ? ctx.fleetConfig.instances[instance] : undefined;
|
|
2773
|
+
if (!cfg) {
|
|
2774
|
+
json(res, 404, { error: "not_found" });
|
|
2775
|
+
return true;
|
|
2776
|
+
}
|
|
2777
|
+
const offered = !isGeneralInstance(ctx.fleetConfig, instance) && resolveToolSet(cfg, instance) !== "coordinator"
|
|
2778
|
+
&& cfg.runtime !== "windows" && !cfg.machine_id;
|
|
2779
|
+
if (!offered) {
|
|
2780
|
+
json(res, 404, { error: "workspace_not_offered" });
|
|
2781
|
+
return true;
|
|
2782
|
+
}
|
|
2783
|
+
if (!["changes", "list", "file", "image", "diff", "follow"].includes(op)) {
|
|
2784
|
+
json(res, 400, { error: "op: changes | list | file | image | diff | follow" });
|
|
2785
|
+
return true;
|
|
2786
|
+
}
|
|
2787
|
+
const workDir = String(cfg.working_directory ?? "").replace(/^~(?=$|\/)/, process.env.HOME ?? "~");
|
|
2788
|
+
const backend = String(cfg.backend ?? ctx.fleetConfig?.defaults?.backend ?? "claude-code");
|
|
2789
|
+
const daemon = ctx.daemons.get(instance);
|
|
2790
|
+
void (async () => {
|
|
2791
|
+
try {
|
|
2792
|
+
const ws = await workspaceRoot(workDir, getAgendHome());
|
|
2793
|
+
// The session must still be the same one when the answer goes out (it may have ended while git ran).
|
|
2794
|
+
const answer = async () => {
|
|
2795
|
+
if (op === "changes")
|
|
2796
|
+
return { kind: "json", body: await workspaceChanges(ws) };
|
|
2797
|
+
if (op === "list")
|
|
2798
|
+
return { kind: "json", body: await workspaceList(ws, p.get("path") ?? "") };
|
|
2799
|
+
if (op === "file")
|
|
2800
|
+
return { kind: "json", body: await workspaceFile(ws, p.get("path")) };
|
|
2801
|
+
if (op === "diff")
|
|
2802
|
+
return { kind: "json", body: await workspaceFileDiff(ws, p.get("path")) };
|
|
2803
|
+
if (op === "follow") {
|
|
2804
|
+
// #3160: this turn's file steps, from the CLI's own record, confined to this folder (outside paths dropped,
|
|
2805
|
+
// secret-looking ones marked hidden). Polled by an open panel with Follow on; nothing is pushed.
|
|
2806
|
+
const supported = backend === "claude-code" || backend === "codex";
|
|
2807
|
+
const d = daemon;
|
|
2808
|
+
const after = Number(p.get("after") ?? 0), turnQ = p.get("turn");
|
|
2809
|
+
const snap = supported && d && typeof d.workspaceFollow === "function"
|
|
2810
|
+
? d.workspaceFollow(Number.isSafeInteger(after) && after >= 0 ? after : 0, turnQ !== null && /^\d{1,9}$/.test(turnQ) ? Number(turnQ) : undefined, p.get("scope") ?? undefined)
|
|
2811
|
+
: { scope: "", turn: 0, steps: [], last: 0 };
|
|
2812
|
+
return { kind: "json", body: { supported, running: !!d, scope: snap.scope, turn: snap.turn, last: snap.last, steps: await resolveFollowSteps(ws, snap.steps) } };
|
|
2813
|
+
}
|
|
2814
|
+
return { kind: "image", body: await workspaceImage(ws, p.get("path")) };
|
|
2815
|
+
};
|
|
2816
|
+
const out = await answer();
|
|
2817
|
+
if (localAdmin()?.handle !== who.handle) {
|
|
2818
|
+
json(res, 403, { error: "workspace_needs_a_local_admin" });
|
|
2819
|
+
return;
|
|
2820
|
+
}
|
|
2821
|
+
const current = ctx.fleetConfig?.instances[instance];
|
|
2822
|
+
if (current !== cfg || String(current.working_directory ?? "").replace(/^~(?=$|\/)/, process.env.HOME ?? "~") !== workDir
|
|
2823
|
+
|| String(current.backend ?? ctx.fleetConfig?.defaults?.backend ?? "claude-code") !== backend
|
|
2824
|
+
|| current.runtime === "windows" || current.machine_id || isGeneralInstance(ctx.fleetConfig, instance)
|
|
2825
|
+
|| resolveToolSet(current, instance) === "coordinator" || (op === "follow" && ctx.daemons.get(instance) !== daemon)) {
|
|
2826
|
+
json(res, 403, { error: "workspace_changed" });
|
|
2827
|
+
return;
|
|
2828
|
+
}
|
|
2829
|
+
if (op === "follow" && out.kind === "json") {
|
|
2830
|
+
const frame = out.body;
|
|
2831
|
+
const live = daemon;
|
|
2832
|
+
if (frame.supported && frame.running && frame.scope && live?.workspaceFollow?.(0).scope !== frame.scope) {
|
|
2833
|
+
json(res, 403, { error: "workspace_changed" });
|
|
2834
|
+
return;
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
if (out.kind === "image") {
|
|
2838
|
+
res.writeHead(200, { "Content-Type": out.body.mime, "Content-Length": String(out.body.bytes.length), "Content-Security-Policy": "default-src 'none'; sandbox" });
|
|
2839
|
+
res.end(out.body.bytes);
|
|
2840
|
+
return;
|
|
2841
|
+
}
|
|
2842
|
+
json(res, 200, out.body);
|
|
2843
|
+
}
|
|
2844
|
+
catch (err) {
|
|
2845
|
+
if (err instanceof WorkspaceError) {
|
|
2846
|
+
json(res, err.code === "not_found" || err.code === "not_a_directory" ? 404 : 403, { error: err.code });
|
|
2847
|
+
return;
|
|
2848
|
+
}
|
|
2849
|
+
ctx.logger.error({ err: err.message, instance }, "Workspace read failed");
|
|
2850
|
+
json(res, 500, { error: "could not read the folder" });
|
|
2851
|
+
}
|
|
2852
|
+
})();
|
|
2853
|
+
return true;
|
|
2854
|
+
}
|
|
2136
2855
|
// ── #1218: the Log tab ─────────────────────────────────
|
|
2137
2856
|
// An instance's steps, read on demand from its own transcript (log-service.ts). Read-only, and offered on the public
|
|
2138
2857
|
// link on purpose (the user's decision): the same masking applies to every viewer. Passive (web-auth.ts).
|
|
@@ -2875,6 +3594,8 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2875
3594
|
// #2308: the app icon (handleAppIcon: its state for a signed-in person; changing it, an admin's session only).
|
|
2876
3595
|
if (path === "/ui/app-icon")
|
|
2877
3596
|
return handleAppIcon(req, res, url, ctx, method);
|
|
3597
|
+
if (path === "/ui/update" || path.startsWith("/ui/update/"))
|
|
3598
|
+
return handleWebUpdate(req, res, url, ctx, path, method);
|
|
2878
3599
|
// #1629 r4-5: mods — a person's import, uninstall and export (handleMods: sessions only, never the public link).
|
|
2879
3600
|
if (path === "/ui/mods" || path.startsWith("/ui/mods/"))
|
|
2880
3601
|
return handleMods(req, res, url, ctx, path, method);
|
|
@@ -2883,6 +3604,11 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2883
3604
|
return handleBrowserBackendSignIns(req, res, url, ctx);
|
|
2884
3605
|
if (path === "/ui/backend-login" || path.startsWith("/ui/backend-login/"))
|
|
2885
3606
|
return handleBackendLogin(req, res, url, ctx, path, method);
|
|
3607
|
+
// #3292: before the accounts prefix — its Add pattern (`POST /ui/accounts/<backend>`) would read "keep-alive" as a backend.
|
|
3608
|
+
if (path === "/ui/accounts/keep-alive")
|
|
3609
|
+
return handleAccountKeepAlive(req, res, url, ctx, method);
|
|
3610
|
+
if (path.startsWith("/ui/accounts/"))
|
|
3611
|
+
return handleAccountWrite(req, res, url, ctx, path, method);
|
|
2886
3612
|
// #1386: Acknowledge a "Needs you" delivery item — a session write (CSRF, checked by the gate) or the CLI's header
|
|
2887
3613
|
// token. Who did it is recorded by principal: the session's public handle, never the session id or a credential.
|
|
2888
3614
|
// #2910 D2: a web-only fleet's Notices — what General would have said. Admins only (never a guest: not in
|
|
@@ -2926,6 +3652,203 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2926
3652
|
});
|
|
2927
3653
|
return true;
|
|
2928
3654
|
}
|
|
3655
|
+
// ── #3008: connections from outside (a web-only fleet) ──
|
|
3656
|
+
// GET /ui/outside: the state (any admin; over the outside link too, read-only). Everything that changes it is this
|
|
3657
|
+
// computer's admin's, on this computer (the fleet asks the live session each time; the public link refuses these
|
|
3658
|
+
// routes outright): POST /ui/outside/enroll (a new secret, shown once), POST /ui/outside/enroll/confirm {code},
|
|
3659
|
+
// POST /ui/outside/remove, POST /ui/outside/switch {on}. Never a guest (not in GUEST_ROUTES).
|
|
3660
|
+
if (method === "GET" && path === "/ui/outside") {
|
|
3661
|
+
res.setHeader("Cache-Control", "no-store");
|
|
3662
|
+
json(res, 200, ctx.webOutsideStatus?.(req) ?? { webOnly: false, here: false, enrolled: false, enrolledAt: null, outside: false, pausedForMs: 0, link: null });
|
|
3663
|
+
return true;
|
|
3664
|
+
}
|
|
3665
|
+
if (method === "POST" && (path === "/ui/outside/enroll" || path === "/ui/outside/enroll/confirm" || path === "/ui/outside/remove" || path === "/ui/outside/switch")) {
|
|
3666
|
+
if (gatewayRequestContext(req)) {
|
|
3667
|
+
json(res, 403, { error: "outside_not_here" });
|
|
3668
|
+
return true;
|
|
3669
|
+
}
|
|
3670
|
+
(async () => {
|
|
3671
|
+
let body;
|
|
3672
|
+
try {
|
|
3673
|
+
body = await parseBody(req);
|
|
3674
|
+
}
|
|
3675
|
+
catch {
|
|
3676
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
3677
|
+
return;
|
|
3678
|
+
}
|
|
3679
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
3680
|
+
return;
|
|
3681
|
+
res.setHeader("Cache-Control", "no-store");
|
|
3682
|
+
if (path === "/ui/outside/enroll") {
|
|
3683
|
+
const r = ctx.webOutsideBeginEnrollment?.(req) ?? null;
|
|
3684
|
+
if (!r) {
|
|
3685
|
+
json(res, 403, { error: "outside_not_here" });
|
|
3686
|
+
return;
|
|
3687
|
+
}
|
|
3688
|
+
json(res, 200, r);
|
|
3689
|
+
return;
|
|
3690
|
+
}
|
|
3691
|
+
if (path === "/ui/outside/enroll/confirm") {
|
|
3692
|
+
const code = body && typeof body === "object" ? body.code : undefined;
|
|
3693
|
+
if (typeof code !== "string" || code.length > 32) {
|
|
3694
|
+
json(res, 400, { error: "code required" });
|
|
3695
|
+
return;
|
|
3696
|
+
}
|
|
3697
|
+
const r = ctx.webOutsideConfirmEnrollment?.(req, code) ?? "not_here";
|
|
3698
|
+
json(res, r === "ok" ? 200 : r === "not_here" ? 403 : r === "unsaved" ? 503 : 400, r === "ok" ? { ok: true } : { error: r === "not_here" ? "outside_not_here" : r });
|
|
3699
|
+
return;
|
|
3700
|
+
}
|
|
3701
|
+
if (path === "/ui/outside/remove") {
|
|
3702
|
+
const r = ctx.webOutsideRemove?.(req) ?? "not_here";
|
|
3703
|
+
json(res, r === "ok" ? 200 : r === "unsaved" ? 503 : 403, r === "ok" ? { ok: true } : { error: r === "unsaved" ? "unsaved" : "outside_not_here" });
|
|
3704
|
+
return;
|
|
3705
|
+
}
|
|
3706
|
+
const on = body && typeof body === "object" ? body.on : undefined;
|
|
3707
|
+
if (typeof on !== "boolean") {
|
|
3708
|
+
json(res, 400, { error: "on must be true or false" });
|
|
3709
|
+
return;
|
|
3710
|
+
}
|
|
3711
|
+
const r = ctx.webOutsideSwitch?.(req, on) ?? "not_here";
|
|
3712
|
+
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 });
|
|
3713
|
+
})().catch(err => {
|
|
3714
|
+
ctx.logger.error({ err: err.message }, "Outside connections change failed");
|
|
3715
|
+
try {
|
|
3716
|
+
json(res, 500, { error: "outside_failed" });
|
|
3717
|
+
}
|
|
3718
|
+
catch { /* already answered */ }
|
|
3719
|
+
});
|
|
3720
|
+
return true;
|
|
3721
|
+
}
|
|
3722
|
+
// ── Refs #3061 (P2a): signing a new device in with its 8-character code (a web-only fleet) ──
|
|
3723
|
+
// GET /ui/devices: whether this is such a fleet and whether THIS session may approve (it is the verified owner — this
|
|
3724
|
+
// computer's admin here, or signed in from outside with the authenticator's code). POST /ui/devices/lookup {code}: the
|
|
3725
|
+
// request that code names, for the confirm screen; POST /ui/devices/approve {code} and /ui/devices/deny {code}. Every
|
|
3726
|
+
// one asks the live session again in the fleet (webDeviceLoginAct) and answers 403 `owner_required` to anyone else —
|
|
3727
|
+
// a guest, a LAN or device-approved session, the CLI's header token. Over the public link only for the owner who
|
|
3728
|
+
// signed in from outside. A decision hands the new device nothing: its session is made by its own next poll.
|
|
3729
|
+
if (method === "GET" && path === "/ui/devices") {
|
|
3730
|
+
res.setHeader("Cache-Control", "no-store");
|
|
3731
|
+
json(res, 200, ctx.webDevicesStatus?.(req) ?? { webOnly: false, owner: false, devices: [] });
|
|
3732
|
+
return true;
|
|
3733
|
+
}
|
|
3734
|
+
// Refs #3061 (P2b): POST /ui/devices/signout {handle} — the verified owner ends another signed-in device. The same
|
|
3735
|
+
// authority as approving one, asked of the live session in the fleet after the body is in (webDeviceSignOut answers
|
|
3736
|
+
// 403 `owner_required` to anyone else before it looks the handle up). Over the public link only for the owner signed in
|
|
3737
|
+
// from outside, like approving.
|
|
3738
|
+
if (method === "POST" && path === "/ui/devices/signout") {
|
|
3739
|
+
const act = ctx.webDeviceSignOut?.bind(ctx);
|
|
3740
|
+
if (!act) {
|
|
3741
|
+
json(res, 404, { error: "not_found" });
|
|
3742
|
+
return true;
|
|
3743
|
+
}
|
|
3744
|
+
(async () => {
|
|
3745
|
+
let body;
|
|
3746
|
+
try {
|
|
3747
|
+
body = await parseBody(req);
|
|
3748
|
+
}
|
|
3749
|
+
catch {
|
|
3750
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
3751
|
+
return;
|
|
3752
|
+
}
|
|
3753
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
3754
|
+
return;
|
|
3755
|
+
const handle = body && typeof body === "object" ? body.handle : undefined;
|
|
3756
|
+
if (typeof handle !== "string" || !/^[0-9a-f]{16}$/.test(handle)) {
|
|
3757
|
+
json(res, 400, { error: "handle required" });
|
|
3758
|
+
return;
|
|
3759
|
+
}
|
|
3760
|
+
res.setHeader("Cache-Control", "no-store");
|
|
3761
|
+
const r = act(req, handle);
|
|
3762
|
+
json(res, r.status, r.body);
|
|
3763
|
+
})().catch(err => {
|
|
3764
|
+
ctx.logger.error({ err: err.message }, "Device sign-out failed");
|
|
3765
|
+
try {
|
|
3766
|
+
json(res, 500, { error: "devices_failed" });
|
|
3767
|
+
}
|
|
3768
|
+
catch { /* already answered */ }
|
|
3769
|
+
});
|
|
3770
|
+
return true;
|
|
3771
|
+
}
|
|
3772
|
+
if (method === "POST" && (path === "/ui/devices/lookup" || path === "/ui/devices/approve" || path === "/ui/devices/deny")) {
|
|
3773
|
+
const act = ctx.webDeviceLoginAct?.bind(ctx);
|
|
3774
|
+
if (!act) {
|
|
3775
|
+
json(res, 404, { error: "not_found" });
|
|
3776
|
+
return true;
|
|
3777
|
+
}
|
|
3778
|
+
const op = path === "/ui/devices/lookup" ? "lookup" : path === "/ui/devices/approve" ? "approve" : "deny";
|
|
3779
|
+
(async () => {
|
|
3780
|
+
let body;
|
|
3781
|
+
try {
|
|
3782
|
+
body = await parseBody(req);
|
|
3783
|
+
}
|
|
3784
|
+
catch {
|
|
3785
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
3786
|
+
return;
|
|
3787
|
+
}
|
|
3788
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
3789
|
+
return;
|
|
3790
|
+
const code = body && typeof body === "object" ? body.code : undefined;
|
|
3791
|
+
if (typeof code !== "string" || code.length > 32) {
|
|
3792
|
+
json(res, 400, { error: "code required" });
|
|
3793
|
+
return;
|
|
3794
|
+
}
|
|
3795
|
+
res.setHeader("Cache-Control", "no-store");
|
|
3796
|
+
const r = act(req, op, code);
|
|
3797
|
+
if (typeof r.body.retryAfterMs === "number")
|
|
3798
|
+
res.setHeader("Retry-After", String(Math.ceil(r.body.retryAfterMs / 1000)));
|
|
3799
|
+
json(res, r.status, r.body);
|
|
3800
|
+
})().catch(err => {
|
|
3801
|
+
ctx.logger.error({ err: err.message }, "New device approval failed");
|
|
3802
|
+
try {
|
|
3803
|
+
json(res, 500, { error: "devices_failed" });
|
|
3804
|
+
}
|
|
3805
|
+
catch { /* already answered */ }
|
|
3806
|
+
});
|
|
3807
|
+
return true;
|
|
3808
|
+
}
|
|
3809
|
+
// ── alpha.2 (M-2300): an agent's Windows request, decided by a web-only fleet's owner in Needs you ──
|
|
3810
|
+
// The list is the owner's only: anyone else (a guest, a LAN or public-link session, a chat fleet's admin) reads an
|
|
3811
|
+
// empty one, so nothing actionable ever reaches them. The stream's `agent_proposals` event carries nothing.
|
|
3812
|
+
if (method === "GET" && path === "/ui/agent-proposals") {
|
|
3813
|
+
const list = ctx.webAgentProposals?.(req) ?? null;
|
|
3814
|
+
json(res, 200, { owner: list !== null, proposals: list ?? [] });
|
|
3815
|
+
return true;
|
|
3816
|
+
}
|
|
3817
|
+
const proposalMatch = method === "POST" ? /^\/ui\/agent-proposals\/([0-9a-f]{32})$/.exec(path) : null;
|
|
3818
|
+
if (proposalMatch) {
|
|
3819
|
+
if (!ctx.webDecideAgentProposal) {
|
|
3820
|
+
json(res, 404, { error: "not_found" });
|
|
3821
|
+
return true;
|
|
3822
|
+
}
|
|
3823
|
+
const decide = ctx.webDecideAgentProposal.bind(ctx), id = proposalMatch[1];
|
|
3824
|
+
(async () => {
|
|
3825
|
+
let body;
|
|
3826
|
+
try {
|
|
3827
|
+
body = await parseBody(req);
|
|
3828
|
+
}
|
|
3829
|
+
catch {
|
|
3830
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
3831
|
+
return;
|
|
3832
|
+
}
|
|
3833
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
3834
|
+
return;
|
|
3835
|
+
const decision = body && typeof body === "object" ? body.decision : undefined;
|
|
3836
|
+
if (decision !== "confirm" && decision !== "reject") {
|
|
3837
|
+
json(res, 400, { error: "decision must be confirm or reject" });
|
|
3838
|
+
return;
|
|
3839
|
+
}
|
|
3840
|
+
const r = await decide(req, id, decision);
|
|
3841
|
+
if (!res.headersSent && !res.destroyed)
|
|
3842
|
+
json(res, r.status, r.body);
|
|
3843
|
+
})().catch(err => {
|
|
3844
|
+
ctx.logger.error({ err: err.message }, "Agent request decision failed");
|
|
3845
|
+
try {
|
|
3846
|
+
json(res, 500, { error: "decide_failed" });
|
|
3847
|
+
}
|
|
3848
|
+
catch { /* already answered */ }
|
|
3849
|
+
});
|
|
3850
|
+
return true;
|
|
3851
|
+
}
|
|
2929
3852
|
if (method === "POST" && path === "/ui/needs/ack") {
|
|
2930
3853
|
if (!ctx.acknowledgeNeedsItem) {
|
|
2931
3854
|
json(res, 404, { error: "Nothing to acknowledge here" });
|
|
@@ -3051,6 +3974,20 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3051
3974
|
json(res, 400, { error: "instance and command required" });
|
|
3052
3975
|
return;
|
|
3053
3976
|
}
|
|
3977
|
+
if (isNativeExecInstance(ctx.fleetConfig?.instances[instance])) {
|
|
3978
|
+
json(res, 400, { error: "This runtime does not support CLI control commands; use Agent settings or Cancel" });
|
|
3979
|
+
return;
|
|
3980
|
+
}
|
|
3981
|
+
if (isNativePaneInstance(ctx.fleetConfig?.instances[instance])) {
|
|
3982
|
+
if (!nativeCliAuthorization(req, url, ctx)) {
|
|
3983
|
+
json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
|
|
3984
|
+
return;
|
|
3985
|
+
}
|
|
3986
|
+
if (command !== "model") {
|
|
3987
|
+
json(res, 400, { error: "This persistent Windows runtime supports the model command; use its shared controls for other actions" });
|
|
3988
|
+
return;
|
|
3989
|
+
}
|
|
3990
|
+
}
|
|
3054
3991
|
if (body.args !== undefined && str(body.args, MAX_COMMAND_ARGS) === undefined) {
|
|
3055
3992
|
json(res, 400, { error: "args too long" });
|
|
3056
3993
|
return;
|
|
@@ -3319,6 +4256,10 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3319
4256
|
const body = await parseBody(req);
|
|
3320
4257
|
if (!permitWebContinuation(req, res, ctx))
|
|
3321
4258
|
return;
|
|
4259
|
+
if (body?.runtime === "windows") {
|
|
4260
|
+
await createNativeInstance(req, res, url, ctx, body);
|
|
4261
|
+
return;
|
|
4262
|
+
}
|
|
3322
4263
|
const v = validateArgs(CreateInstanceArgs, body, "create_instance");
|
|
3323
4264
|
if (!v.ok) {
|
|
3324
4265
|
json(res, 400, { error: v.error });
|
|
@@ -3439,7 +4380,10 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3439
4380
|
// board for a revision, so it is built once per (revision, done=all, minute) — the minute for the 14-day
|
|
3440
4381
|
// window. The public link's reads are filtered per request (hidden instances) and are built each time.
|
|
3441
4382
|
// #2757 review: and by the dispatchers gone (a deleted one makes its cards the person's, the revision unchanged).
|
|
3442
|
-
|
|
4383
|
+
// The instances with the task board switched off: no card is handed to them (the pickers mark them), and a
|
|
4384
|
+
// fleet.yaml edit changes them with the revision unchanged.
|
|
4385
|
+
const boardOff = taskBoardOffNames(ctx.fleetConfig).filter((n) => !hiddenName(n));
|
|
4386
|
+
const key = gateway ? null : `${rev}:${allDone ? 1 : 0}:${Math.floor(Date.now() / 60_000)}:${board.goneDispatchers(ctx.dispatcherGone)}:${boardOff.join("\u0000")}`;
|
|
3443
4387
|
const kept = key ? boardBodies.get(board) : undefined;
|
|
3444
4388
|
if (kept && kept.key === key) {
|
|
3445
4389
|
jsonText(res, 200, kept.body);
|
|
@@ -3451,7 +4395,7 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3451
4395
|
// #2355 review: the names a project's lead may be — the fleet's instances (a Classic-only room is not one); over the
|
|
3452
4396
|
// public link, not a hidden one.
|
|
3453
4397
|
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) });
|
|
4398
|
+
const body = JSON.stringify({ rev, cards: board.views(cards, scope, ctx.dispatcherGone), projects, leads, boardOff, stats: board.projectStats(ctx.dispatcherGone) });
|
|
3455
4399
|
if (key)
|
|
3456
4400
|
boardBodies.set(board, { key, body });
|
|
3457
4401
|
jsonText(res, 200, body);
|
|
@@ -4080,15 +5024,18 @@ function uploadRecipient(ctx, name) {
|
|
|
4080
5024
|
/** Closed, path-free explanations; arbitrary launch errors stay in the host log. */
|
|
4081
5025
|
function webDeliveryFailure(err) {
|
|
4082
5026
|
const message = err instanceof Error ? err.message : "";
|
|
5027
|
+
// M-2297: the per-PC agent limit — say so, with the agents holding its slots (names only: no path, no id).
|
|
5028
|
+
if (err instanceof MachineSlotLimitError)
|
|
5029
|
+
return { reason: "machine_limit", error: message, limit: err.limit, holders: err.holders.map(h => ({ name: h.name, unknown: h.unknown })) };
|
|
4083
5030
|
if (/No warm slot is free/.test(message))
|
|
4084
5031
|
return { reason: "wake_capacity", error: "No slot is free to wake this instance. Retry when another instance is idle." };
|
|
4085
5032
|
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.
|
|
5033
|
+
return { reason: "wake_credentials", error: "The instance could not sign in. Sign it in from Settings → Agents → AI sign-ins and API keys → Accounts, or send /login in chat, then retry." };
|
|
4087
5034
|
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
|
|
5035
|
+
return { reason: "wake_timeout", error: "The instance did not become ready in time. Retry, or check its status in Fleet." };
|
|
4089
5036
|
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
|
|
5037
|
+
return { reason: "instance_stopped", error: "This instance was stopped or removed. Start it from the agent's chat menu → Start instance, then retry." };
|
|
5038
|
+
return { reason: "delivery_unavailable", error: "The instance could not receive this message. Check its status in Fleet, then retry." };
|
|
4092
5039
|
}
|
|
4093
5040
|
/** Handle POST /ui/send — extracted for readability. */
|
|
4094
5041
|
/** Each web server's own memory of the sends it accepted by clientId (web-send-dedupe.ts). */
|
|
@@ -4127,6 +5074,15 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4127
5074
|
return;
|
|
4128
5075
|
}
|
|
4129
5076
|
const { instance, message: typed, attachments = [], replyTo, clientId } = parsed.data;
|
|
5077
|
+
const native = isWindowsInstance(ctx.fleetConfig?.instances[instance]);
|
|
5078
|
+
if (native && !nativeCliAuthorization(req, new URL(req.url ?? "/", "http://localhost"), ctx)) {
|
|
5079
|
+
json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
|
|
5080
|
+
return;
|
|
5081
|
+
}
|
|
5082
|
+
if (native && attachments.length) {
|
|
5083
|
+
json(res, 400, { error: "Attachments are not supported by this runtime yet" });
|
|
5084
|
+
return;
|
|
5085
|
+
}
|
|
4130
5086
|
// #1920 step 2b: a guest writes only to an in-scope instance, while guests may chat, and never a command.
|
|
4131
5087
|
const guest = guestRequestOf(req);
|
|
4132
5088
|
const refused = guestChatRefusal(guest, instance);
|
|
@@ -4180,6 +5136,16 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4180
5136
|
break;
|
|
4181
5137
|
}
|
|
4182
5138
|
}
|
|
5139
|
+
const locationHold = ctx.generalLocationDeliveryHold?.(instance);
|
|
5140
|
+
if (locationHold) {
|
|
5141
|
+
const messageId = newWebMessageId(), ts = new Date().toISOString();
|
|
5142
|
+
// Settle this client ID as answered. A Retry after reconnect must never queue its old input.
|
|
5143
|
+
acceptedId = messageId;
|
|
5144
|
+
ctx.emitSseEvent("message", { instance, sender: person.name, role: "user", text: typed, ts, messageId, ...(person.bound ? { from: person.voterKey } : {}), ...(clientId ? { clientId } : {}) });
|
|
5145
|
+
ctx.emitSseEvent("message", { instance, role: "status", sender: "AgEnD", text: locationHold, ts, messageId: newWebMessageId() });
|
|
5146
|
+
json(res, 200, { sent: true, messageId, serviceResponse: true });
|
|
5147
|
+
return;
|
|
5148
|
+
}
|
|
4183
5149
|
let files = [];
|
|
4184
5150
|
if (attachments.length > 0) {
|
|
4185
5151
|
const taken = ctx.webFiles?.takeForMessage(instance, attachments);
|
|
@@ -4202,15 +5168,39 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4202
5168
|
// Recheck the same admission all the way through a wake, before the facade's actual IPC handoff.
|
|
4203
5169
|
const requestUrl = new URL(req.url ?? "/", "http://localhost");
|
|
4204
5170
|
const admission = admissionOf(req, requestUrl, ctx);
|
|
4205
|
-
|
|
5171
|
+
// The sender's authority, without the request's own lifetime: the same admission, the same guest still allowed, the
|
|
5172
|
+
// instance still registered (a Windows one still Windows). A Windows turn is journaled before /ui/send answers and its
|
|
5173
|
+
// process starts after, so the bridge rechecks this one (a revoke in between still stops it); never res, which a
|
|
5174
|
+
// finished response marks destroyed (S-30: every web-chat turn to a Windows agent was refused).
|
|
5175
|
+
const authorityCurrent = () => admission !== null && admissionOf(req, requestUrl, ctx) === admission
|
|
4206
5176
|
&& (!guest || (guest.current() && !guestChatRefusal(guest, instance)))
|
|
4207
|
-
&& (
|
|
5177
|
+
&& (native ? isWindowsInstance(ctx.fleetConfig?.instances[instance]) && nativeCliAuthorization(req, requestUrl, ctx)
|
|
5178
|
+
: registered ? registeredChatInstance(ctx, instance) : ctx.instanceIpcClients.has(instance));
|
|
5179
|
+
const stillCurrent = () => !res.destroyed && authorityCurrent();
|
|
4208
5180
|
const message = typed;
|
|
4209
5181
|
// #1939 S1: what the receipt records about who authorized it (observe only: agents still read web as recognition).
|
|
4210
5182
|
const { authority } = confirmAfterBody(arrival, webAuthorityOf(req, new URL(req.url ?? "/", "http://localhost"), ctx, instance));
|
|
4211
5183
|
const ts = new Date().toISOString();
|
|
4212
5184
|
// The id the agent is given, and the one its delivery reports come back under: the page's ticks.
|
|
4213
|
-
const
|
|
5185
|
+
const nativeRequestId = isNativeExecInstance(ctx.fleetConfig?.instances[instance]) ? (() => {
|
|
5186
|
+
if (!clientId)
|
|
5187
|
+
return randomUUID();
|
|
5188
|
+
const hash = createHash("sha256").update(`agend-native-web\0${WebSendDedupe.key(person.key, instance, clientId)}`).digest("hex");
|
|
5189
|
+
return `${hash.slice(0, 8)}-${hash.slice(8, 12)}-4${hash.slice(13, 16)}-8${hash.slice(17, 20)}-${hash.slice(20, 32)}`;
|
|
5190
|
+
})() : undefined;
|
|
5191
|
+
const messageId = nativeRequestId ? `native:${nativeRequestId}:user` : newWebMessageId();
|
|
5192
|
+
if (nativeRequestId && ctx.nativeInstanceRuntime) {
|
|
5193
|
+
const previous = ctx.nativeInstanceRuntime().get(instance)?.turns.find(turn => turn.id === nativeRequestId);
|
|
5194
|
+
if (previous) {
|
|
5195
|
+
if (previous.prompt !== delivery.text) {
|
|
5196
|
+
json(res, 409, { error: "clientId belongs to a different message" });
|
|
5197
|
+
return;
|
|
5198
|
+
}
|
|
5199
|
+
acceptedId = messageId;
|
|
5200
|
+
json(res, 200, { sent: true, messageId, repeated: true });
|
|
5201
|
+
return;
|
|
5202
|
+
}
|
|
5203
|
+
}
|
|
4214
5204
|
// Use real Telegram context so daemon's lastChatId/lastThreadId are set,
|
|
4215
5205
|
// enabling reply tool even when first message comes from Web UI.
|
|
4216
5206
|
// Pure Web UI mode (no channel config) leaves these empty; the agent's reply then comes back to the
|
|
@@ -4256,11 +5246,12 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4256
5246
|
let delivered;
|
|
4257
5247
|
try {
|
|
4258
5248
|
const deliver = (name, payload) => ctx.deliverHumanToInstance
|
|
4259
|
-
? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent })
|
|
4260
|
-
: ctx.deliverToInstance(name, payload, { stillCurrent });
|
|
5249
|
+
? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
|
|
5250
|
+
: ctx.deliverToInstance(name, payload, { stillCurrent, ...(native ? { authorityCurrent } : {}) });
|
|
4261
5251
|
delivered = await deliver(instance, {
|
|
4262
5252
|
type: "fleet_inbound",
|
|
4263
5253
|
content: delivery.text,
|
|
5254
|
+
...(nativeRequestId ? { requestId: nativeRequestId } : {}),
|
|
4264
5255
|
targetSession: instance,
|
|
4265
5256
|
meta: {
|
|
4266
5257
|
chat_id: groupId ? String(groupId) : "",
|
|
@@ -4657,6 +5648,45 @@ function shellHtmlTag(ctx, mode, viewer) {
|
|
|
4657
5648
|
function shellOwnerCss(ctx, mode, viewer) {
|
|
4658
5649
|
return mode === "full" && !viewer?.guest && viewer?.person !== null && viewer?.person !== undefined && ctx.ownerCss ? ctx.ownerCss.active(viewer.person) : null;
|
|
4659
5650
|
}
|
|
5651
|
+
/**
|
|
5652
|
+
* AgEnD Hub P1 (docs/design/hub.md, docs/design/hub-ui-client.md): the page's Hub mark — presentation only, never
|
|
5653
|
+
* authority, set by the listener that serves the page (never a client's choice): `member` on this fleet's listener when
|
|
5654
|
+
* `hub_member.enabled`, never over the public link. `hub` is only the Hub listener's own workspace page
|
|
5655
|
+
* (serveHubWorkspaceShell). Nothing otherwise: no Hub UI is drawn and no Hub module loads.
|
|
5656
|
+
*/
|
|
5657
|
+
function hubBodyAttrs(req, ctx) {
|
|
5658
|
+
// alpha.6 user report: the mark read the parsed FleetConfig, which never has `hub_member` — a saved switch (or one in the
|
|
5659
|
+
// file at start) never marked the page, so Connect to a Hub never loaded. It reads what the runtime reads: the raw file.
|
|
5660
|
+
let config = null;
|
|
5661
|
+
try {
|
|
5662
|
+
config = (ctx.getRawFleetConfig?.() ?? null);
|
|
5663
|
+
}
|
|
5664
|
+
catch {
|
|
5665
|
+
config = null;
|
|
5666
|
+
}
|
|
5667
|
+
// hub.md §1: member handlers are local-owner-only and unavailable through the public gateway — no member mark there.
|
|
5668
|
+
const member = hubModeOf(config).member && !gatewayRequestContext(req) ? ' data-hub="member"' : "";
|
|
5669
|
+
// #3298 S-89 (leader, #3372 N2): Settings → Hub's Group permissions row only when this fleet's own Hub has them composed —
|
|
5670
|
+
// learned in this process, never by reading a Hub session across origins. Never over the public link.
|
|
5671
|
+
let groups = false;
|
|
5672
|
+
try {
|
|
5673
|
+
groups = ctx.hubGroupPermissions?.() === true;
|
|
5674
|
+
}
|
|
5675
|
+
catch {
|
|
5676
|
+
groups = false;
|
|
5677
|
+
}
|
|
5678
|
+
let setup = false;
|
|
5679
|
+
try {
|
|
5680
|
+
setup = !!ctx.hubSetupSession?.(req);
|
|
5681
|
+
}
|
|
5682
|
+
catch { /* unavailable authority never offers setup */ }
|
|
5683
|
+
return member + (groups && !gatewayRequestContext(req) ? ' data-hub-groups="1"' : "")
|
|
5684
|
+
+ (setup && !gatewayRequestContext(req) ? ' data-hub-setup="1"' : "")
|
|
5685
|
+
+ (setup && !gatewayRequestContext(req) && typeof ctx.hubDirectorySettings === "function"
|
|
5686
|
+
&& !!config?.hub?.hubId ? ' data-hub-directory-settings="1"' : "")
|
|
5687
|
+
+ (setup && !gatewayRequestContext(req) && typeof ctx.hubDirectoryNotices === "function"
|
|
5688
|
+
&& !!config?.hub?.hubId ? ' data-hub-directory-notices="1"' : "");
|
|
5689
|
+
}
|
|
4660
5690
|
function guestBodyAttrs(ctx, owner, attr) {
|
|
4661
5691
|
const badge = ctx.guestBadge?.(owner);
|
|
4662
5692
|
const trusted = ctx.guestTrusted?.(owner) ? ' data-guest-level="trusted"' : "";
|
|
@@ -4693,12 +5723,47 @@ function shellBodyTag(req, ctx, mode, viewer) {
|
|
|
4693
5723
|
+ `${gatewayRequestContext(req) ? ' data-public-link="1"' : ""}`
|
|
4694
5724
|
// #2478: search is offered over the public link unless web.search.public_link is false (the page then shows no entry).
|
|
4695
5725
|
+ `${gatewayRequestContext(req) && ctx.fleetConfig?.web?.search?.public_link === false ? ' data-search-link="0"' : ""}`
|
|
5726
|
+
// 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.
|
|
5727
|
+
+ `${mode === "full" && !viewer?.guest ? hubBodyAttrs(req, ctx) : ""}`
|
|
4696
5728
|
// #1920 phase 3: a guest's page — the shell shows only what a guest may use, and who it is signed in as.
|
|
4697
5729
|
+ `${mode === "full" && viewer?.guest && viewer.owner ? guestBodyAttrs(ctx, viewer.owner, attr) : ""}>`;
|
|
4698
5730
|
}
|
|
5731
|
+
/**
|
|
5732
|
+
* 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).
|
|
5733
|
+
* It boots Hub-only (app.js: no fleet stream, chat, Needs you, preferences or themes). Nothing of the request is read
|
|
5734
|
+
* — 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.
|
|
5735
|
+
*/
|
|
5736
|
+
export const HUB_SHELL_DROPS = '<script src="/assets/agend-auth.js"></script>';
|
|
5737
|
+
export function serveHubWorkspaceShell(res, hub) {
|
|
5738
|
+
try {
|
|
5739
|
+
// Without the fleet's fetch wrapper (agend-auth.js): it reads the fleet's /auth/session for a CSRF value and answers
|
|
5740
|
+
// a 401 with the fleet's "session ended" banner. The Hub's pages carry the Hub's own CSRF (hub-client.js).
|
|
5741
|
+
const html = readFileSync(join(__dirname, "ui", "app.html"), "utf-8").replace(HUB_SHELL_DROPS, "");
|
|
5742
|
+
const attr = (v) => v.replace(/[&<>"']/g, c => `&#${c.charCodeAt(0)};`);
|
|
5743
|
+
const name = hubNameOf(hub.name);
|
|
5744
|
+
const preview = hub.preview;
|
|
5745
|
+
const previewAttrs = preview ? ` data-dashboard-origin="${attr(preview.dashboardOrigin)}"`
|
|
5746
|
+
+ (preview.previewOrigin && preview.bootId ? ` data-preview-origin="${attr(preview.previewOrigin)}" data-preview-boot="${attr(preview.bootId)}"`
|
|
5747
|
+
: ` data-preview-reason-code="${attr(preview.reasonCode ?? "notOffered")}" data-preview-reason="${attr(preview.reason ?? "")}"`) : "";
|
|
5748
|
+
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}>`;
|
|
5749
|
+
sendPanelHtml(res, withAppIconLinks(html).replace("<body>", body), 200, { "Cache-Control": "no-store" }, { mediaSrc: "'none'", ...(preview?.previewOrigin ? { frameSrc: `${preview.previewOrigin}/frame` } : {}) });
|
|
5750
|
+
}
|
|
5751
|
+
catch {
|
|
5752
|
+
json(res, 500, { error: "app.html not found" });
|
|
5753
|
+
}
|
|
5754
|
+
}
|
|
4699
5755
|
/** The app shell page for one entry, under the panels' CSP; it may frame exactly <preview origin>/frame, and only
|
|
4700
5756
|
* when this load chose one. */
|
|
4701
|
-
|
|
5757
|
+
/**
|
|
5758
|
+
* The app shell page. `opts.hubWorkspace`: the page is a Hub's own workspace (slice 1's Hub listener only — the fleet's
|
|
5759
|
+
* listener never passes it), so it is drawn as the Hub shell.
|
|
5760
|
+
*/
|
|
5761
|
+
export function serveAppShell(req, res, ctx, mode, opts = {}) {
|
|
5762
|
+
// A Hub workspace is drawn from nothing of this fleet's: no fleet cookie, session, preference or preview is read.
|
|
5763
|
+
if (opts.hubWorkspace) {
|
|
5764
|
+
serveHubWorkspaceShell(res, opts.hubWorkspace);
|
|
5765
|
+
return;
|
|
5766
|
+
}
|
|
4702
5767
|
try {
|
|
4703
5768
|
const html = readFileSync(join(__dirname, "ui", "app.html"), "utf-8");
|
|
4704
5769
|
const viewer = mode === "full" ? prefsViewer(req, new URL(req.url ?? "/", "http://localhost"), ctx) : null;
|