@songsid/agend 2.3.5-alpha.4 → 2.3.5-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +52 -0
- package/dist/accounts-view.d.ts +97 -0
- package/dist/accounts-view.js +116 -0
- package/dist/accounts-view.js.map +1 -0
- package/dist/agent-cli-instructions.md +1 -1
- package/dist/agent-credentials.d.ts +24 -0
- package/dist/agent-credentials.js +66 -0
- package/dist/agent-credentials.js.map +1 -0
- package/dist/agent-endpoint.d.ts +3 -1
- package/dist/agent-endpoint.js +13 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-file-read.js +1 -1
- package/dist/agent-file-read.js.map +1 -1
- package/dist/agent-runtime-change.d.ts +3 -1
- package/dist/agent-runtime-change.js +15 -3
- package/dist/agent-runtime-change.js.map +1 -1
- package/dist/agent-workspace.d.ts +93 -0
- package/dist/agent-workspace.js +353 -0
- package/dist/agent-workspace.js.map +1 -0
- package/dist/auth-api.d.ts +27 -0
- package/dist/auth-api.js +164 -3
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/session-authorizations.d.ts +28 -4
- package/dist/authority/session-authorizations.js +63 -17
- package/dist/authority/session-authorizations.js.map +1 -1
- package/dist/backend/antigravity.js +3 -1
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/codex-footer-hints.d.ts +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-quota-history.d.ts +7 -0
- package/dist/backend/codex-quota-history.js +57 -0
- package/dist/backend/codex-quota-history.js.map +1 -0
- package/dist/backend/codex-session-lookup.d.ts +6 -0
- package/dist/backend/codex-session-lookup.js +1 -1
- package/dist/backend/codex-session-lookup.js.map +1 -1
- package/dist/backend/codex-speed.d.ts +14 -0
- package/dist/backend/codex-speed.js +35 -0
- package/dist/backend/codex-speed.js.map +1 -0
- package/dist/backend/codex.d.ts +7 -0
- package/dist/backend/codex.js +78 -15
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/grok-weekly-reset.d.ts +24 -0
- package/dist/backend/grok-weekly-reset.js +95 -0
- package/dist/backend/grok-weekly-reset.js.map +1 -0
- package/dist/backend/grok.d.ts +30 -1
- package/dist/backend/grok.js +301 -54
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro.d.ts +3 -0
- package/dist/backend/kiro.js +50 -2
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/muse.js +5 -3
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/native-pane.d.ts +3 -1
- package/dist/backend/native-pane.js +2 -2
- package/dist/backend/native-pane.js.map +1 -1
- package/dist/backend/types.d.ts +13 -1
- package/dist/backend/types.js +3 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance-cli.d.ts +3 -0
- package/dist/build-provenance-cli.js +11 -0
- package/dist/build-provenance-cli.js.map +1 -0
- package/dist/build-provenance.d.ts +20 -0
- package/dist/build-provenance.js +67 -0
- package/dist/build-provenance.js.map +1 -0
- package/dist/build-provenance.json +1 -0
- package/dist/cache-ledger.d.ts +95 -0
- package/dist/cache-ledger.js +276 -4
- package/dist/cache-ledger.js.map +1 -1
- package/dist/cache-service.d.ts +5 -0
- package/dist/cache-service.js +16 -4
- package/dist/cache-service.js.map +1 -1
- package/dist/channel/adapters/discord.js +11 -3
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +51 -0
- package/dist/channel/adapters/telegram.js +235 -17
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/mcp-tools.js +3 -3
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/types.d.ts +2 -0
- package/dist/claude-auth-status.d.ts +48 -0
- package/dist/claude-auth-status.js +149 -0
- package/dist/claude-auth-status.js.map +1 -0
- package/dist/cli.js +138 -37
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +21 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/cross-instance-notice.d.ts +10 -0
- package/dist/cross-instance-notice.js +67 -5
- package/dist/cross-instance-notice.js.map +1 -1
- package/dist/daemon.d.ts +70 -1
- package/dist/daemon.js +547 -25
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard-permissions.d.ts +8 -0
- package/dist/dashboard-permissions.js +16 -0
- package/dist/dashboard-permissions.js.map +1 -1
- package/dist/delivery-consumed-watch.d.ts +23 -1
- package/dist/delivery-consumed-watch.js +30 -3
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/delivery-reconciliation.d.ts +1 -1
- package/dist/delivery-reconciliation.js +1 -1
- package/dist/delivery-reconciliation.js.map +1 -1
- package/dist/doctor.js +20 -9
- package/dist/doctor.js.map +1 -1
- package/dist/export-import.d.ts +7 -0
- package/dist/export-import.js +44 -10
- package/dist/export-import.js.map +1 -1
- package/dist/fleet-context.d.ts +2 -0
- package/dist/fleet-manager.d.ts +359 -7
- package/dist/fleet-manager.js +1365 -90
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +2 -1
- package/dist/fleet-windows-runtime.js +25 -7
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +425 -0
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +5 -2
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +1 -0
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +2 -2
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +3 -1
- package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +41 -4
- package/dist/general-knowledge/skills/session-management/SKILL.md +1 -1
- package/dist/general-knowledge/skills/tui-effort/SKILL.md +10 -10
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +31 -15
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
- package/dist/general-role.d.ts +1 -1
- package/dist/general-role.js +1 -0
- package/dist/general-role.js.map +1 -1
- package/dist/hub/admission.d.ts +28 -0
- package/dist/hub/admission.js +62 -0
- package/dist/hub/admission.js.map +1 -0
- package/dist/hub/attachments/limits.d.ts +20 -0
- package/dist/hub/attachments/limits.js +48 -0
- package/dist/hub/attachments/limits.js.map +1 -0
- package/dist/hub/attachments/store.d.ts +116 -0
- package/dist/hub/attachments/store.js +246 -0
- package/dist/hub/attachments/store.js.map +1 -0
- package/dist/hub/audit/index.d.ts +62 -0
- package/dist/hub/audit/index.js +344 -0
- package/dist/hub/audit/index.js.map +1 -0
- package/dist/hub/browser-certificate.d.ts +38 -0
- package/dist/hub/browser-certificate.js +247 -0
- package/dist/hub/browser-certificate.js.map +1 -0
- package/dist/hub/buttons-model.d.ts +9 -0
- package/dist/hub/buttons-model.js +42 -0
- package/dist/hub/buttons-model.js.map +1 -0
- package/dist/hub/buttons.d.ts +54 -0
- package/dist/hub/buttons.js +346 -0
- package/dist/hub/buttons.js.map +1 -0
- package/dist/hub/catalog.d.ts +74 -0
- package/dist/hub/catalog.js +195 -0
- package/dist/hub/catalog.js.map +1 -0
- package/dist/hub/client.d.ts +69 -0
- package/dist/hub/client.js +300 -0
- package/dist/hub/client.js.map +1 -0
- package/dist/hub/compose/member.d.ts +139 -0
- package/dist/hub/compose/member.js +450 -0
- package/dist/hub/compose/member.js.map +1 -0
- package/dist/hub/compose/server.d.ts +77 -0
- package/dist/hub/compose/server.js +349 -0
- package/dist/hub/compose/server.js.map +1 -0
- package/dist/hub/compose/views.d.ts +12 -0
- package/dist/hub/compose/views.js +4 -0
- package/dist/hub/compose/views.js.map +1 -0
- package/dist/hub/db.d.ts +56 -0
- package/dist/hub/db.js +188 -0
- package/dist/hub/db.js.map +1 -0
- package/dist/hub/directory/config.d.ts +39 -0
- package/dist/hub/directory/config.js +108 -0
- package/dist/hub/directory/config.js.map +1 -0
- package/dist/hub/directory/directory.d.ts +18 -0
- package/dist/hub/directory/directory.js +320 -0
- package/dist/hub/directory/directory.js.map +1 -0
- package/dist/hub/directory/index.d.ts +7 -0
- package/dist/hub/directory/index.js +4 -0
- package/dist/hub/directory/index.js.map +1 -0
- package/dist/hub/directory/profiles.d.ts +41 -0
- package/dist/hub/directory/profiles.js +90 -0
- package/dist/hub/directory/profiles.js.map +1 -0
- package/dist/hub/directory/types.d.ts +71 -0
- package/dist/hub/directory/types.js +14 -0
- package/dist/hub/directory/types.js.map +1 -0
- package/dist/hub/execution/cli-provider.d.ts +23 -0
- package/dist/hub/execution/cli-provider.js +341 -0
- package/dist/hub/execution/cli-provider.js.map +1 -0
- package/dist/hub/execution/index.d.ts +13 -0
- package/dist/hub/execution/index.js +8 -0
- package/dist/hub/execution/index.js.map +1 -0
- package/dist/hub/execution/model-broker.d.ts +24 -0
- package/dist/hub/execution/model-broker.js +208 -0
- package/dist/hub/execution/model-broker.js.map +1 -0
- package/dist/hub/execution/provider-setup.d.ts +11 -0
- package/dist/hub/execution/provider-setup.js +21 -0
- package/dist/hub/execution/provider-setup.js.map +1 -0
- package/dist/hub/execution/sandbox-runner.d.ts +1 -0
- package/dist/hub/execution/sandbox-runner.js +221 -0
- package/dist/hub/execution/sandbox-runner.js.map +1 -0
- package/dist/hub/execution/service.d.ts +136 -0
- package/dist/hub/execution/service.js +459 -0
- package/dist/hub/execution/service.js.map +1 -0
- package/dist/hub/execution/store.d.ts +61 -0
- package/dist/hub/execution/store.js +182 -0
- package/dist/hub/execution/store.js.map +1 -0
- package/dist/hub/execution/views.d.ts +20 -0
- package/dist/hub/execution/views.js +48 -0
- package/dist/hub/execution/views.js.map +1 -0
- package/dist/hub/http/compose.d.ts +20 -0
- package/dist/hub/http/compose.js +518 -0
- package/dist/hub/http/compose.js.map +1 -0
- package/dist/hub/http/core.d.ts +49 -0
- package/dist/hub/http/core.js +124 -0
- package/dist/hub/http/core.js.map +1 -0
- package/dist/hub/http/deps.d.ts +61 -0
- package/dist/hub/http/deps.js +2 -0
- package/dist/hub/http/deps.js.map +1 -0
- package/dist/hub/http/schema.d.ts +14 -0
- package/dist/hub/http/schema.js +80 -0
- package/dist/hub/http/schema.js.map +1 -0
- package/dist/hub/identity.d.ts +32 -0
- package/dist/hub/identity.js +80 -0
- package/dist/hub/identity.js.map +1 -0
- package/dist/hub/init/browser-certificate.d.ts +9 -0
- package/dist/hub/init/browser-certificate.js +78 -0
- package/dist/hub/init/browser-certificate.js.map +1 -0
- package/dist/hub/init/browser-tls.d.ts +18 -0
- package/dist/hub/init/browser-tls.js +62 -0
- package/dist/hub/init/browser-tls.js.map +1 -0
- package/dist/hub/init/cli.d.ts +3 -0
- package/dist/hub/init/cli.js +83 -0
- package/dist/hub/init/cli.js.map +1 -0
- package/dist/hub/init/directory-certificate.d.ts +24 -0
- package/dist/hub/init/directory-certificate.js +222 -0
- package/dist/hub/init/directory-certificate.js.map +1 -0
- package/dist/hub/init/existing-fleet.d.ts +6 -0
- package/dist/hub/init/existing-fleet.js +58 -0
- package/dist/hub/init/existing-fleet.js.map +1 -0
- package/dist/hub/init/handoff.d.ts +8 -0
- package/dist/hub/init/handoff.js +36 -0
- package/dist/hub/init/handoff.js.map +1 -0
- package/dist/hub/init/identity.d.ts +5 -0
- package/dist/hub/init/identity.js +24 -0
- package/dist/hub/init/identity.js.map +1 -0
- package/dist/hub/init/initializer.d.ts +24 -0
- package/dist/hub/init/initializer.js +385 -0
- package/dist/hub/init/initializer.js.map +1 -0
- package/dist/hub/init/inventory.d.ts +17 -0
- package/dist/hub/init/inventory.js +33 -0
- package/dist/hub/init/inventory.js.map +1 -0
- package/dist/hub/init/layout.d.ts +32 -0
- package/dist/hub/init/layout.js +53 -0
- package/dist/hub/init/layout.js.map +1 -0
- package/dist/hub/init/network.d.ts +18 -0
- package/dist/hub/init/network.js +104 -0
- package/dist/hub/init/network.js.map +1 -0
- package/dist/hub/init/plan-digest.d.ts +5 -0
- package/dist/hub/init/plan-digest.js +47 -0
- package/dist/hub/init/plan-digest.js.map +1 -0
- package/dist/hub/init/prompt.d.ts +26 -0
- package/dist/hub/init/prompt.js +110 -0
- package/dist/hub/init/prompt.js.map +1 -0
- package/dist/hub/init/secret-file.d.ts +1 -0
- package/dist/hub/init/secret-file.js +59 -0
- package/dist/hub/init/secret-file.js.map +1 -0
- package/dist/hub/init/text.d.ts +127 -0
- package/dist/hub/init/text.js +247 -0
- package/dist/hub/init/text.js.map +1 -0
- package/dist/hub/init/types.d.ts +114 -0
- package/dist/hub/init/types.js +9 -0
- package/dist/hub/init/types.js.map +1 -0
- package/dist/hub/init/wizard.d.ts +34 -0
- package/dist/hub/init/wizard.js +554 -0
- package/dist/hub/init/wizard.js.map +1 -0
- package/dist/hub/initialization.d.ts +23 -0
- package/dist/hub/initialization.js +28 -0
- package/dist/hub/initialization.js.map +1 -0
- package/dist/hub/member/agent-mode.d.ts +6 -0
- package/dist/hub/member/agent-mode.js +23 -0
- package/dist/hub/member/agent-mode.js.map +1 -0
- package/dist/hub/member/attachments.d.ts +29 -0
- package/dist/hub/member/attachments.js +107 -0
- package/dist/hub/member/attachments.js.map +1 -0
- package/dist/hub/member/exposure-api.d.ts +87 -0
- package/dist/hub/member/exposure-api.js +64 -0
- package/dist/hub/member/exposure-api.js.map +1 -0
- package/dist/hub/member/exposures.d.ts +123 -0
- package/dist/hub/member/exposures.js +282 -0
- package/dist/hub/member/exposures.js.map +1 -0
- package/dist/hub/member/pairing-api.d.ts +85 -0
- package/dist/hub/member/pairing-api.js +385 -0
- package/dist/hub/member/pairing-api.js.map +1 -0
- package/dist/hub/member/quota.d.ts +20 -0
- package/dist/hub/member/quota.js +98 -0
- package/dist/hub/member/quota.js.map +1 -0
- package/dist/hub/member-journal.d.ts +104 -0
- package/dist/hub/member-journal.js +336 -0
- package/dist/hub/member-journal.js.map +1 -0
- package/dist/hub/member-reconciliation.d.ts +14 -0
- package/dist/hub/member-reconciliation.js +97 -0
- package/dist/hub/member-reconciliation.js.map +1 -0
- package/dist/hub/mount.d.ts +39 -0
- package/dist/hub/mount.js +123 -0
- package/dist/hub/mount.js.map +1 -0
- package/dist/hub/pairing-client.d.ts +17 -0
- package/dist/hub/pairing-client.js +108 -0
- package/dist/hub/pairing-client.js.map +1 -0
- package/dist/hub/pairing.d.ts +65 -0
- package/dist/hub/pairing.js +211 -0
- package/dist/hub/pairing.js.map +1 -0
- package/dist/hub/policy.d.ts +63 -0
- package/dist/hub/policy.js +147 -0
- package/dist/hub/policy.js.map +1 -0
- package/dist/hub/preview.d.ts +32 -0
- package/dist/hub/preview.js +64 -0
- package/dist/hub/preview.js.map +1 -0
- package/dist/hub/private-files.d.ts +5 -0
- package/dist/hub/private-files.js +44 -0
- package/dist/hub/private-files.js.map +1 -0
- package/dist/hub/profile.d.ts +59 -0
- package/dist/hub/profile.js +73 -0
- package/dist/hub/profile.js.map +1 -0
- package/dist/hub/protocol.d.ts +779 -0
- package/dist/hub/protocol.js +93 -0
- package/dist/hub/protocol.js.map +1 -0
- package/dist/hub/quota.d.ts +24 -0
- package/dist/hub/quota.js +112 -0
- package/dist/hub/quota.js.map +1 -0
- package/dist/hub/representative.d.ts +141 -0
- package/dist/hub/representative.js +528 -0
- package/dist/hub/representative.js.map +1 -0
- package/dist/hub/retention.d.ts +17 -0
- package/dist/hub/retention.js +45 -0
- package/dist/hub/retention.js.map +1 -0
- package/dist/hub/rooms.d.ts +120 -0
- package/dist/hub/rooms.js +535 -0
- package/dist/hub/rooms.js.map +1 -0
- package/dist/hub/runtime.d.ts +106 -0
- package/dist/hub/runtime.js +298 -0
- package/dist/hub/runtime.js.map +1 -0
- package/dist/hub/server.d.ts +56 -0
- package/dist/hub/server.js +202 -0
- package/dist/hub/server.js.map +1 -0
- package/dist/hub/service-start.d.ts +17 -0
- package/dist/hub/service-start.js +109 -0
- package/dist/hub/service-start.js.map +1 -0
- package/dist/hub/sessions.d.ts +53 -0
- package/dist/hub/sessions.js +196 -0
- package/dist/hub/sessions.js.map +1 -0
- package/dist/hub/socket.d.ts +24 -0
- package/dist/hub/socket.js +79 -0
- package/dist/hub/socket.js.map +1 -0
- package/dist/hub/store.d.ts +77 -0
- package/dist/hub/store.js +88 -0
- package/dist/hub/store.js.map +1 -0
- package/dist/hub/tls.d.ts +31 -0
- package/dist/hub/tls.js +135 -0
- package/dist/hub/tls.js.map +1 -0
- package/dist/hub/types.d.ts +401 -0
- package/dist/hub/types.js +2 -0
- package/dist/hub/types.js.map +1 -0
- package/dist/hub/validation.d.ts +33 -0
- package/dist/hub/validation.js +136 -0
- package/dist/hub/validation.js.map +1 -0
- package/dist/hub/version-floor.d.ts +10 -0
- package/dist/hub/version-floor.js +45 -0
- package/dist/hub/version-floor.js.map +1 -0
- package/dist/hub-browser-certificate-policy.d.ts +31 -0
- package/dist/hub-browser-certificate-policy.js +25 -0
- package/dist/hub-browser-certificate-policy.js.map +1 -0
- package/dist/hub-membership-settings.d.ts +6 -0
- package/dist/hub-membership-settings.js +21 -0
- package/dist/hub-membership-settings.js.map +1 -0
- package/dist/hub-mode.d.ts +15 -0
- package/dist/hub-mode.js +17 -0
- package/dist/hub-mode.js.map +1 -0
- package/dist/hub-pairing-summary.d.ts +48 -0
- package/dist/hub-pairing-summary.js +36 -0
- package/dist/hub-pairing-summary.js.map +1 -0
- package/dist/hub-report-target.d.ts +32 -0
- package/dist/hub-report-target.js +33 -0
- package/dist/hub-report-target.js.map +1 -0
- package/dist/hub-retention-policy.d.ts +14 -0
- package/dist/hub-retention-policy.js +15 -0
- package/dist/hub-retention-policy.js.map +1 -0
- package/dist/instance-config-impact.js +3 -0
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +17 -2
- package/dist/instance-lifecycle.js +58 -8
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instance-topic-delete.d.ts +77 -0
- package/dist/instance-topic-delete.js +123 -0
- package/dist/instance-topic-delete.js.map +1 -0
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.js +1 -1
- package/dist/instructions.js.map +1 -1
- package/dist/kiro-engine-status.d.ts +11 -0
- package/dist/kiro-engine-status.js +6 -0
- package/dist/kiro-engine-status.js.map +1 -1
- package/dist/launchd-service-domain.d.ts +5 -0
- package/dist/launchd-service-domain.js +21 -0
- package/dist/launchd-service-domain.js.map +1 -0
- package/dist/locale.js +125 -3
- package/dist/locale.js.map +1 -1
- package/dist/log-service.d.ts +28 -0
- package/dist/log-service.js +29 -0
- package/dist/log-service.js.map +1 -1
- package/dist/log-steps.d.ts +4 -3
- package/dist/log-steps.js +32 -7
- package/dist/log-steps.js.map +1 -1
- package/dist/logger.d.ts +16 -2
- package/dist/logger.js +346 -66
- package/dist/logger.js.map +1 -1
- package/dist/login-flows.d.ts +15 -7
- package/dist/login-flows.js +29 -3
- package/dist/login-flows.js.map +1 -1
- package/dist/login-manager.js +25 -4
- package/dist/login-manager.js.map +1 -1
- package/dist/ls-rows.js +3 -4
- package/dist/ls-rows.js.map +1 -1
- package/dist/missed-offline.d.ts +25 -0
- package/dist/missed-offline.js +79 -0
- package/dist/missed-offline.js.map +1 -0
- package/dist/native-instance-api.d.ts +0 -1
- package/dist/native-instance-api.js +15 -3
- package/dist/native-instance-api.js.map +1 -1
- package/dist/native-instance-input.d.ts +3 -0
- package/dist/native-instance-input.js +6 -1
- package/dist/native-instance-input.js.map +1 -1
- package/dist/native-instance-registry.d.ts +6 -0
- package/dist/native-instance-registry.js +24 -0
- package/dist/native-instance-registry.js.map +1 -1
- package/dist/native-mcp.d.ts +3 -0
- package/dist/native-mcp.js +15 -2
- package/dist/native-mcp.js.map +1 -1
- package/dist/native-pane-lifecycle.d.ts +8 -0
- package/dist/native-pane-lifecycle.js +13 -4
- package/dist/native-pane-lifecycle.js.map +1 -1
- package/dist/native-pane-manager.js +17 -9
- package/dist/native-pane-manager.js.map +1 -1
- package/dist/needs-you-hub.d.ts +9 -1
- package/dist/needs-you-hub.js +46 -8
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +47 -2
- package/dist/needs-you.js +31 -3
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +2 -2
- package/dist/office-share-page.js.map +1 -1
- package/dist/office-share.d.ts +11 -0
- package/dist/office-share.js +14 -0
- package/dist/office-share.js.map +1 -1
- package/dist/office-talk.d.ts +26 -0
- package/dist/office-talk.js +50 -0
- package/dist/office-talk.js.map +1 -0
- package/dist/outbound-handlers.d.ts +14 -0
- package/dist/outbound-handlers.js +49 -6
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +33 -1
- package/dist/outbound-schemas.js +29 -16
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-quota-history.d.ts +9 -0
- package/dist/pane-quota-history.js +67 -0
- package/dist/pane-quota-history.js.map +1 -0
- package/dist/pause-marker.d.ts +1 -1
- package/dist/pause-marker.js +1 -1
- package/dist/pause-marker.js.map +1 -1
- package/dist/platform-general.d.ts +46 -0
- package/dist/platform-general.js +91 -0
- package/dist/platform-general.js.map +1 -0
- package/dist/public-web-gateway.js +7 -0
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/queued-handoffs.d.ts +33 -0
- package/dist/queued-handoffs.js +75 -0
- package/dist/queued-handoffs.js.map +1 -0
- package/dist/quickstart.d.ts +13 -0
- package/dist/quickstart.js +81 -5
- package/dist/quickstart.js.map +1 -1
- package/dist/quota-notice.d.ts +7 -0
- package/dist/quota-notice.js +40 -0
- package/dist/quota-notice.js.map +1 -1
- package/dist/reply-buttons-controller.js +10 -6
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/reply-polls.d.ts +2 -2
- package/dist/reply-polls.js +3 -3
- package/dist/reply-polls.js.map +1 -1
- package/dist/runtime-api.d.ts +2 -0
- package/dist/runtime-api.js +25 -7
- package/dist/runtime-api.js.map +1 -1
- package/dist/runtime-build-info.js +5 -3
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-bundle.d.ts +3 -0
- package/dist/runtime-bundle.js +3 -1
- package/dist/runtime-bundle.js.map +1 -1
- package/dist/runtime-cli.d.ts +8 -1
- package/dist/runtime-cli.js +127 -8
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client-store.d.ts +7 -0
- package/dist/runtime-client-store.js +30 -2
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.d.ts +63 -1
- package/dist/runtime-client.js +295 -21
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +7 -0
- package/dist/runtime-coordinator.js +213 -35
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-credential-profiles.d.ts +78 -0
- package/dist/runtime-credential-profiles.js +280 -0
- package/dist/runtime-credential-profiles.js.map +1 -0
- package/dist/runtime-install.d.ts +50 -0
- package/dist/runtime-install.js +186 -0
- package/dist/runtime-install.js.map +1 -0
- package/dist/runtime-pane-assets.d.ts +1 -1
- package/dist/runtime-pane-assets.js +1 -1
- package/dist/runtime-pane-assets.js.map +1 -1
- package/dist/runtime-pane-codex-index.d.ts +10 -1
- package/dist/runtime-pane-codex-index.js +131 -27
- package/dist/runtime-pane-codex-index.js.map +1 -1
- package/dist/runtime-pane-host.d.ts +19 -0
- package/dist/runtime-pane-host.js +50 -7
- package/dist/runtime-pane-host.js.map +1 -1
- package/dist/runtime-pane-link.d.ts +7 -0
- package/dist/runtime-pane-link.js +93 -2
- package/dist/runtime-pane-link.js.map +1 -1
- package/dist/runtime-pane-mcp-relay.d.ts +1 -0
- package/dist/runtime-pane-mcp-relay.js +10 -0
- package/dist/runtime-pane-mcp-relay.js.map +1 -1
- package/dist/runtime-pane-mcp.d.ts +4 -0
- package/dist/runtime-pane-mcp.js +6 -3
- package/dist/runtime-pane-mcp.js.map +1 -1
- package/dist/runtime-pane-native.d.ts +32 -2
- package/dist/runtime-pane-native.js +55 -6
- package/dist/runtime-pane-native.js.map +1 -1
- package/dist/runtime-pane-port.d.ts +5 -0
- package/dist/runtime-pane-port.js +17 -1
- package/dist/runtime-pane-port.js.map +1 -1
- package/dist/runtime-pane-process.d.ts +1 -1
- package/dist/runtime-pane-process.js +11 -2
- package/dist/runtime-pane-process.js.map +1 -1
- package/dist/runtime-pane-protocol.d.ts +11 -1
- package/dist/runtime-pane-protocol.js +27 -5
- package/dist/runtime-pane-protocol.js.map +1 -1
- package/dist/runtime-pane-quota-history.d.ts +6 -0
- package/dist/runtime-pane-quota-history.js +44 -0
- package/dist/runtime-pane-quota-history.js.map +1 -0
- package/dist/runtime-pane-service.d.ts +5 -0
- package/dist/runtime-pane-service.js +47 -12
- package/dist/runtime-pane-service.js.map +1 -1
- package/dist/runtime-pane-transcript.d.ts +5 -0
- package/dist/runtime-pane-transcript.js +66 -5
- package/dist/runtime-pane-transcript.js.map +1 -1
- package/dist/runtime-pane-worker.js +19 -6
- package/dist/runtime-pane-worker.js.map +1 -1
- package/dist/runtime-protocol.d.ts +17 -2
- package/dist/runtime-protocol.js +12 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/runtime-update-activity.d.ts +21 -0
- package/dist/runtime-update-activity.js +51 -0
- package/dist/runtime-update-activity.js.map +1 -0
- package/dist/runtime-update-artifact.d.ts +31 -0
- package/dist/runtime-update-artifact.js +252 -0
- package/dist/runtime-update-artifact.js.map +1 -0
- package/dist/runtime-update-install.d.ts +31 -0
- package/dist/runtime-update-install.js +205 -0
- package/dist/runtime-update-install.js.map +1 -0
- package/dist/runtime-update-journal.d.ts +44 -0
- package/dist/runtime-update-journal.js +121 -0
- package/dist/runtime-update-journal.js.map +1 -0
- package/dist/runtime-update-lock.d.ts +48 -0
- package/dist/runtime-update-lock.js +217 -0
- package/dist/runtime-update-lock.js.map +1 -0
- package/dist/runtime-update-owners.d.ts +29 -0
- package/dist/runtime-update-owners.js +240 -0
- package/dist/runtime-update-owners.js.map +1 -0
- package/dist/runtime-update-protocol.d.ts +15 -0
- package/dist/runtime-update-protocol.js +13 -0
- package/dist/runtime-update-protocol.js.map +1 -0
- package/dist/runtime-windows-bridge.d.ts +2 -1
- package/dist/runtime-windows-bridge.js +11 -1
- package/dist/runtime-windows-bridge.js.map +1 -1
- package/dist/scheduler/db.d.ts +2 -1
- package/dist/scheduler/db.js +23 -9
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/task-board-text.js +1 -1
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +13 -0
- package/dist/scheduler/task-board.js +28 -3
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/service-drain.d.ts +19 -0
- package/dist/service-drain.js +64 -0
- package/dist/service-drain.js.map +1 -0
- package/dist/service-installer.d.ts +7 -2
- package/dist/service-installer.js +13 -10
- package/dist/service-installer.js.map +1 -1
- package/dist/settings-api.d.ts +20 -0
- package/dist/settings-api.js +414 -4
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +6 -0
- package/dist/settings-baseline.js +3 -1
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +29 -6
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.d.ts +13 -0
- package/dist/settings-effect.js +97 -0
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.js +13 -1
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-instance-patch.js +27 -0
- package/dist/settings-instance-patch.js.map +1 -1
- package/dist/setup-wizard.js +6 -2
- package/dist/setup-wizard.js.map +1 -1
- package/dist/task-board-tool.d.ts +13 -1
- package/dist/task-board-tool.js +104 -4
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-board-waker.d.ts +6 -0
- package/dist/task-board-waker.js +4 -0
- package/dist/task-board-waker.js.map +1 -1
- package/dist/tmux-binary.d.ts +59 -0
- package/dist/tmux-binary.js +200 -0
- package/dist/tmux-binary.js.map +1 -0
- package/dist/tmux-control.js +4 -4
- package/dist/tmux-control.js.map +1 -1
- package/dist/tmux-exec-helper.js +32 -1
- package/dist/tmux-exec-helper.js.map +1 -1
- package/dist/tmux-manager.d.ts +1 -1
- package/dist/tmux-manager.js +45 -36
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tmux-read.js +4 -3
- package/dist/tmux-read.js.map +1 -1
- package/dist/tool-permissions.d.ts +5 -2
- package/dist/tool-permissions.js +6 -5
- package/dist/tool-permissions.js.map +1 -1
- package/dist/tool-progress.d.ts +2 -0
- package/dist/tool-progress.js +19 -3
- package/dist/tool-progress.js.map +1 -1
- package/dist/topic-commands.js +10 -5
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-monitor.d.ts +20 -0
- package/dist/transcript-monitor.js +47 -3
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-needles.d.ts +7 -0
- package/dist/transcript-needles.js +9 -1
- package/dist/transcript-needles.js.map +1 -1
- package/dist/transcript-records.d.ts +1 -1
- package/dist/transcript-records.js +2 -1
- package/dist/transcript-records.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/ui/account-identity.js +27 -0
- package/dist/ui/accounts-view.js +214 -0
- package/dist/ui/agent-runtime-settings.js +9 -8
- package/dist/ui/backend-signin.js +4 -1
- package/dist/ui/chat-ambient.js +1 -1
- package/dist/ui/chat-md-strings.js +3 -0
- package/dist/ui/chat-render.js +3 -670
- package/dist/ui/chat-store.js +1 -1
- package/dist/ui/chat-strings.js +3 -333
- package/dist/ui/chat-thread.js +3 -919
- package/dist/ui/chat-time.js +3 -80
- package/dist/ui/chat-tour.js +1 -1
- package/dist/ui/credential-profile-select.js +54 -0
- package/dist/ui/fleet-office-dialogue.d.ts +30 -0
- package/dist/ui/fleet-office-dialogue.js +382 -0
- package/dist/ui/fleet-office-pack.d.ts +9 -0
- package/dist/ui/fleet-office-pack.js +76 -4
- package/dist/ui/fleet-office-skin.js +23 -5
- package/dist/ui/fleet-office-store.js +5 -0
- package/dist/ui/fleet-office.js +173 -6
- package/dist/ui/fleet-task-card.js +10 -6
- package/dist/ui/fleet-task-common.js +12 -2
- package/dist/ui/fleet-task-menu.js +188 -0
- package/dist/ui/fleet-task-stats.js +124 -0
- package/dist/ui/fleet-task-view.js +340 -0
- package/dist/ui/fleet-tasks.js +131 -43
- package/dist/ui/fleet-usage.js +90 -27
- package/dist/ui/html-attachment.js +3 -40
- package/dist/ui/hub-agent-copy.js +23 -0
- package/dist/ui/hub-button-actions.js +65 -0
- package/dist/ui/hub-chat-store.js +158 -0
- package/dist/ui/hub-chat-strings.js +77 -0
- package/dist/ui/hub-client.js +329 -0
- package/dist/ui/hub-owner-strings.js +51 -0
- package/dist/ui/hub-provider-guidance.js +31 -0
- package/dist/ui/hub-quota.js +85 -0
- package/dist/ui/hub-strings.js +162 -0
- package/dist/ui/hub-switcher.js +27 -0
- package/dist/ui/native-pane-recovery.js +1 -1
- package/dist/ui/office-share-page.js +4 -2
- package/dist/ui/panel-chat.js +34 -48
- package/dist/ui/panel-details.js +1 -1
- package/dist/ui/panel-fleet.js +78 -10
- package/dist/ui/panel-hub.js +619 -0
- package/dist/ui/panel-log.js +2 -2
- package/dist/ui/panel-needs.js +24 -8
- package/dist/ui/panel-runtimes.js +114 -23
- package/dist/ui/panel-settings.js +69 -80
- package/dist/ui/panel-windows-cli.js +12 -2
- package/dist/ui/preview-pages.js +1 -1
- package/dist/ui/preview-panel.js +92 -6
- package/dist/ui/preview-versions.js +1 -1
- package/dist/ui/preview.js +3 -476
- package/dist/ui/runtime-commands.d.ts +4 -0
- package/dist/ui/runtime-commands.js +59 -0
- package/dist/ui/search-dialog.js +2 -0
- package/dist/ui/settings-access-strings.js +42 -0
- package/dist/ui/settings-build-version.js +35 -0
- package/dist/ui/settings-codex-copy.js +19 -0
- package/dist/ui/settings-devices.js +253 -0
- package/dist/ui/settings-dialogs.js +28 -7
- package/dist/ui/settings-hub-browser-certificate.js +74 -0
- package/dist/ui/settings-hub-membership.js +72 -0
- package/dist/ui/settings-hub-retention.js +52 -0
- package/dist/ui/settings-hub.js +196 -0
- package/dist/ui/settings-layout.js +8 -11
- package/dist/ui/settings-model.js +16 -2
- package/dist/ui/settings-outside.js +104 -38
- package/dist/ui/settings-registry.js +4 -1
- package/dist/ui/settings-shared-strings.js +143 -0
- package/dist/ui/settings-shared.js +345 -0
- package/dist/ui/settings-strings.js +10 -46
- package/dist/ui/settings-web-authority.js +5 -2
- package/dist/ui/shared/accounts.css +15 -0
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-needs.js +1 -1
- package/dist/ui/shared/app-route.js +6 -1
- package/dist/ui/shared/app-session.js +6 -2
- package/dist/ui/shared/app-shell.js +64 -8
- package/dist/ui/shared/app.css +121 -30
- package/dist/ui/shared/app.js +12 -3
- package/dist/ui/shared/chat-composer.js +68 -0
- package/dist/ui/shared/chat-md-strings.js +9 -0
- package/dist/ui/shared/chat-render.js +682 -0
- package/dist/ui/shared/chat-strings.js +333 -0
- package/dist/ui/shared/chat-thread.js +969 -0
- package/dist/ui/shared/chat-time.js +80 -0
- package/dist/ui/shared/header-tools.js +3 -5
- package/dist/ui/shared/html-attachment.js +42 -0
- package/dist/ui/shared/hub-chat.css +85 -0
- package/dist/ui/shared/hub-owner.css +33 -0
- package/dist/ui/shared/hub-quota.css +8 -0
- package/dist/ui/shared/hub.css +71 -0
- package/dist/ui/shared/page-head.js +8 -0
- package/dist/ui/shared/panel-view.js +77 -4
- package/dist/ui/shared/preview.js +476 -0
- package/dist/ui/shared/runtime-install.css +26 -0
- package/dist/ui/shared/side-rail.js +15 -0
- package/dist/ui/shared/signin.js +172 -0
- package/dist/ui/shared/task-board.css +95 -0
- package/dist/ui/shared/usage-dialog.js +18 -1
- package/dist/ui/shared/view-history.css +17 -0
- package/dist/ui/shared/view-history.js +438 -0
- package/dist/ui/shared/view-strings.js +16 -0
- package/dist/ui/shared/workspace.css +20 -0
- package/dist/ui/signin.html +21 -0
- package/dist/ui/workspace-panel.js +189 -0
- package/dist/ui/workspace-strings.js +35 -0
- package/dist/unattended-install.d.ts +11 -2
- package/dist/unattended-install.js +41 -6
- package/dist/unattended-install.js.map +1 -1
- package/dist/usage/capacity.d.ts +69 -0
- package/dist/usage/capacity.js +119 -0
- package/dist/usage/capacity.js.map +1 -0
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +3 -0
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/profile-timeline.d.ts +16 -0
- package/dist/usage/profile-timeline.js +58 -0
- package/dist/usage/profile-timeline.js.map +1 -0
- package/dist/usage/providers.js +2 -1
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/quota-history.d.ts +43 -0
- package/dist/usage/quota-history.js +168 -0
- package/dist/usage/quota-history.js.map +1 -0
- package/dist/usage/usage-api.d.ts +31 -0
- package/dist/usage/usage-api.js +80 -1
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/usage-report.d.ts +25 -1
- package/dist/usage-report.js +55 -4
- package/dist/usage-report.js.map +1 -1
- package/dist/usage-rollup.d.ts +6 -1
- package/dist/usage-rollup.js +16 -4
- package/dist/usage-rollup.js.map +1 -1
- package/dist/view-api.d.ts +16 -0
- package/dist/view-api.js +105 -23
- package/dist/view-api.js.map +1 -1
- package/dist/view-history.d.ts +84 -0
- package/dist/view-history.js +116 -0
- package/dist/view-history.js.map +1 -0
- package/dist/web-api.d.ts +48 -2
- package/dist/web-api.js +276 -8
- package/dist/web-api.js.map +1 -1
- package/dist/web-backend-login.d.ts +23 -1
- package/dist/web-backend-login.js +11 -17
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-device-login.d.ts +153 -0
- package/dist/web-device-login.js +278 -0
- package/dist/web-device-login.js.map +1 -0
- package/dist/web-office-skins.d.ts +9 -0
- package/dist/web-office-skins.js +16 -1
- package/dist/web-office-skins.js.map +1 -1
- package/dist/web-session-authorization.d.ts +13 -2
- package/dist/web-session-authorization.js +10 -3
- package/dist/web-session-authorization.js.map +1 -1
- package/dist/web-session.d.ts +35 -0
- package/dist/web-session.js +7 -0
- package/dist/web-session.js.map +1 -1
- package/dist/web-settings-patch.d.ts +3 -1
- package/dist/web-settings-patch.js +4 -1
- package/dist/web-settings-patch.js.map +1 -1
- package/dist/web-shell-routes.d.ts +6 -0
- package/dist/web-shell-routes.js +7 -0
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/web-terminal.d.ts +4 -30
- package/dist/web-terminal.js +9 -6
- package/dist/web-terminal.js.map +1 -1
- package/dist/windows-agents.d.ts +1 -0
- package/dist/windows-agents.js +1 -0
- package/dist/windows-agents.js.map +1 -1
- package/dist/windows-cli-api.d.ts +12 -1
- package/dist/windows-cli-api.js +27 -1
- package/dist/windows-cli-api.js.map +1 -1
- package/dist/windows-cli-providers.d.ts +0 -9
- package/dist/windows-cli-providers.js +4 -9
- package/dist/windows-cli-providers.js.map +1 -1
- package/dist/windows-cli-worker.d.ts +24 -0
- package/dist/windows-cli-worker.js +96 -5
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +10 -0
- package/dist/windows-cli.js +10 -1
- package/dist/windows-cli.js.map +1 -1
- package/dist/yaml-shared-nodes.js +8 -3
- package/dist/yaml-shared-nodes.js.map +1 -1
- package/launcher/agend-install.cjs +8 -1
- package/launcher/launchd-session-type.cjs +14 -0
- package/launcher/postinstall.cjs +27 -2
- package/launcher/private-home.cjs +1 -1
- package/launcher/tmux-bundle.cjs +247 -0
- package/package.json +3 -2
- package/templates/launchd.plist.ejs +3 -1
- package/templates/runtime-install/install.ps1 +270 -0
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #2233: signing a backend in from the web dashboard — the dashboard side of LoginController's `web` requester.
|
|
3
|
+
*
|
|
4
|
+
* - Who: a signed-in admin session on the local surface (the route checks it; the controller asks again through the
|
|
5
|
+
* sink, and the watchdog below keeps asking while the sign-in runs). Never a guest, a read session or the public link.
|
|
6
|
+
* - Two steps, as in chat: `check` runs the controller's pre-check and keeps its answer here, server-side, under a
|
|
7
|
+
* random id bound to the session that asked (chat keeps it in a nonce button); `begin` with that id starts the
|
|
8
|
+
* sign-in through every check again. The client never says whether a token was present.
|
|
9
|
+
* - What chat sends as a link, a DM or a device code goes to the one session that started it, read back with `view`:
|
|
10
|
+
* the browser terminal's URL, the provider's URL and code, and the access token while it is unredeemed. Other admin
|
|
11
|
+
* sessions see that a sign-in is running (backend, device, phase) and may cancel it; nothing more.
|
|
12
|
+
* - A sign-in whose session signs out, expires or is revoked is cancelled (WEB_LOGIN_WATCH_MS).
|
|
13
|
+
*/
|
|
14
|
+
import type { AccountIdentity } from "./claude-auth-status.js";
|
|
1
15
|
import type { LoginChat, LoginStartOptions, WebLoginSink } from "./login-controller.js";
|
|
2
16
|
import type { AvailabilityState } from "./backend-availability.js";
|
|
3
17
|
export { linkableLoginUrl, LOGIN_LINK_HOSTS } from "./login-url.js";
|
|
@@ -21,6 +35,8 @@ export interface SignInTarget {
|
|
|
21
35
|
install?: string;
|
|
22
36
|
/** Too old: the command that installs the current version over it. */
|
|
23
37
|
update?: string;
|
|
38
|
+
/** Which account this sign-in is (a masked e-mail and a plan), Claude Code only, from the host's own `claude auth status`. Local administrators only: this list is never served to anyone else. */
|
|
39
|
+
identity?: AccountIdentity;
|
|
24
40
|
}
|
|
25
41
|
export interface WebLoginRequester {
|
|
26
42
|
/** The session's handle (web-session.ts): what the sign-in is bound to. */
|
|
@@ -46,7 +62,12 @@ export interface WebBackendLoginDeps {
|
|
|
46
62
|
handle: string;
|
|
47
63
|
}): void;
|
|
48
64
|
/** The current sign-in started, changed phase or went: the pages are told to read it again (no details in the event). */
|
|
49
|
-
changed?(): void;
|
|
65
|
+
changed?(phase?: "running" | "ended"): void;
|
|
66
|
+
/**
|
|
67
|
+
* Any sign-in this registry started has ended (success, failure or cancel), including one that a later one replaced or that ended before it was ever
|
|
68
|
+
* published as the current one. It says nothing about what the pages show: what is known about the accounts may be out of date, that is all.
|
|
69
|
+
*/
|
|
70
|
+
loginEnded?(): void;
|
|
50
71
|
now?(): number;
|
|
51
72
|
}
|
|
52
73
|
export interface WebLoginConfirm {
|
|
@@ -116,6 +137,7 @@ export declare class WebBackendLogins {
|
|
|
116
137
|
cancel(): Promise<string>;
|
|
117
138
|
dispose(): void;
|
|
118
139
|
private viewOf;
|
|
140
|
+
private loginEnded;
|
|
119
141
|
private changed;
|
|
120
142
|
private chatFor;
|
|
121
143
|
private sweep;
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* #2233: signing a backend in from the web dashboard — the dashboard side of LoginController's `web` requester.
|
|
3
|
-
*
|
|
4
|
-
* - Who: a signed-in admin session on the local surface (the route checks it; the controller asks again through the
|
|
5
|
-
* sink, and the watchdog below keeps asking while the sign-in runs). Never a guest, a read session or the public link.
|
|
6
|
-
* - Two steps, as in chat: `check` runs the controller's pre-check and keeps its answer here, server-side, under a
|
|
7
|
-
* random id bound to the session that asked (chat keeps it in a nonce button); `begin` with that id starts the
|
|
8
|
-
* sign-in through every check again. The client never says whether a token was present.
|
|
9
|
-
* - What chat sends as a link, a DM or a device code goes to the one session that started it, read back with `view`:
|
|
10
|
-
* the browser terminal's URL, the provider's URL and code, and the access token while it is unredeemed. Other admin
|
|
11
|
-
* sessions see that a sign-in is running (backend, device, phase) and may cancel it; nothing more.
|
|
12
|
-
* - A sign-in whose session signs out, expires or is revoked is cancelled (WEB_LOGIN_WATCH_MS).
|
|
13
|
-
*/
|
|
14
1
|
import { randomBytes } from "node:crypto";
|
|
15
2
|
import { LOGIN_BACKEND_ALIASES, LOGIN_FLOWS } from "./login-flows.js";
|
|
16
3
|
import { CHAT_PROFILE_LOGIN_BACKENDS } from "./backend/credential-profile.js";
|
|
@@ -92,8 +79,11 @@ export class WebBackendLogins {
|
|
|
92
79
|
this.live.delete(run);
|
|
93
80
|
if (!this.live.size)
|
|
94
81
|
this.stopWatch();
|
|
82
|
+
// Every end forgets the accounts, whichever sign-in it was: the account behind a login may have changed. Only the sign-in the pages are
|
|
83
|
+
// showing tells them it ended; one that was replaced (or never published) must not make them show the current one as over.
|
|
84
|
+
this.loginEnded();
|
|
95
85
|
if (this.run === run)
|
|
96
|
-
this.changed();
|
|
86
|
+
this.changed("ended");
|
|
97
87
|
},
|
|
98
88
|
};
|
|
99
89
|
// Watched from admission, not from publication: a session revoked while its listener, tunnel or cloudflared is
|
|
@@ -117,7 +107,7 @@ export class WebBackendLogins {
|
|
|
117
107
|
if (this.run && this.run.seq > run.seq)
|
|
118
108
|
return running ? { login: this.viewOf(run, who.handle) } : { message: message ?? run.lines.join("\n") };
|
|
119
109
|
this.run = run;
|
|
120
|
-
this.changed();
|
|
110
|
+
this.changed(run.phase);
|
|
121
111
|
if (running) {
|
|
122
112
|
try {
|
|
123
113
|
this.deps.notice({ shown: asked.profile ? `${asked.backend} (${asked.profile})` : asked.backend, label: who.label, handle: who.handle });
|
|
@@ -154,8 +144,12 @@ export class WebBackendLogins {
|
|
|
154
144
|
accessCode: running && run.terminal ? this.deps.accessToken(run.sink) : null,
|
|
155
145
|
};
|
|
156
146
|
}
|
|
157
|
-
|
|
158
|
-
this.deps.
|
|
147
|
+
loginEnded() { try {
|
|
148
|
+
this.deps.loginEnded?.();
|
|
149
|
+
}
|
|
150
|
+
catch { /* a cache of what is known about accounts never stops a sign-in */ } }
|
|
151
|
+
changed(phase) { try {
|
|
152
|
+
this.deps.changed?.(phase);
|
|
159
153
|
}
|
|
160
154
|
catch { /* the pages read it on their own next time */ } }
|
|
161
155
|
chatFor(who, sink, lines) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-backend-login.js","sourceRoot":"","sources":["../src/web-backend-login.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"web-backend-login.js","sourceRoot":"","sources":["../src/web-backend-login.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAE9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAA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C,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1F,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS;QAAE,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
export declare const DEVICE_LOGIN_TTL_MS: number;
|
|
2
|
+
export declare const MAX_PENDING_DEVICE_LOGINS = 8;
|
|
3
|
+
export declare const MAX_PENDING_PER_PEER = 2;
|
|
4
|
+
/** Requests one address, and the whole fleet, may ask for per DEVICE_LOGIN_CREATE_WINDOW_MS. */
|
|
5
|
+
export declare const DEVICE_LOGIN_CREATE_WINDOW_MS: number;
|
|
6
|
+
export declare const DEVICE_LOGIN_CREATES_PER_PEER = 6;
|
|
7
|
+
export declare const DEVICE_LOGIN_CREATES_GLOBAL = 20;
|
|
8
|
+
/**
|
|
9
|
+
* The approving side's breaker: this many wrong codes in the window pause it. Shorter than a request's life on purpose
|
|
10
|
+
* (a pause that outlasted it would end every request waiting): ten tries per two minutes is still hopeless against a
|
|
11
|
+
* 40-bit code among at most eight, and the person approving is already an owner-verified session.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DEVICE_APPROVE_WINDOW_MS: number;
|
|
14
|
+
export declare const DEVICE_APPROVE_THRESHOLD = 10;
|
|
15
|
+
export declare const DEVICE_APPROVE_PAUSE_MS: number;
|
|
16
|
+
/** Where a request came from, for the approver: this computer, or somewhere on the network (LAN, tailnet). */
|
|
17
|
+
export type DeviceLoginPeer = "host" | "network";
|
|
18
|
+
export type DeviceLoginState = "pending" | "approved" | "denied";
|
|
19
|
+
/** What the approving device may see of a request. */
|
|
20
|
+
export interface DeviceLoginView {
|
|
21
|
+
/** As typed: `ABCD-EFGH`. */
|
|
22
|
+
readonly code: string;
|
|
23
|
+
readonly label: string;
|
|
24
|
+
readonly peer: DeviceLoginPeer;
|
|
25
|
+
readonly address: string;
|
|
26
|
+
readonly expiresAt: number;
|
|
27
|
+
readonly state: DeviceLoginState;
|
|
28
|
+
}
|
|
29
|
+
export type DeviceLoginCreate = {
|
|
30
|
+
readonly kind: "ok";
|
|
31
|
+
readonly requestId: string;
|
|
32
|
+
readonly code: string;
|
|
33
|
+
readonly expiresAt: number;
|
|
34
|
+
}
|
|
35
|
+
/** Too many asked for from this address, or the fleet over. */
|
|
36
|
+
| {
|
|
37
|
+
readonly kind: "limited";
|
|
38
|
+
readonly retryAfterMs: number;
|
|
39
|
+
}
|
|
40
|
+
/** The room is full (or this address already has its share waiting). */
|
|
41
|
+
| {
|
|
42
|
+
readonly kind: "full";
|
|
43
|
+
};
|
|
44
|
+
export type DeviceLoginPoll = {
|
|
45
|
+
readonly kind: "pending";
|
|
46
|
+
readonly expiresAt: number;
|
|
47
|
+
}
|
|
48
|
+
/** Approved, and now spent: the caller makes the session. Never returned twice for one request. */
|
|
49
|
+
| {
|
|
50
|
+
readonly kind: "claimed";
|
|
51
|
+
readonly label: string;
|
|
52
|
+
readonly approvedBy: string;
|
|
53
|
+
} | {
|
|
54
|
+
readonly kind: "denied";
|
|
55
|
+
}
|
|
56
|
+
/** Expired, spent, withdrawn, made under another token, or never made: deliberately indistinguishable. */
|
|
57
|
+
| {
|
|
58
|
+
readonly kind: "expired";
|
|
59
|
+
};
|
|
60
|
+
export type DeviceLoginMatch = {
|
|
61
|
+
readonly kind: "ok";
|
|
62
|
+
readonly view: DeviceLoginView;
|
|
63
|
+
}
|
|
64
|
+
/** Wrong, expired, or none waiting: deliberately indistinguishable. */
|
|
65
|
+
| {
|
|
66
|
+
readonly kind: "invalid";
|
|
67
|
+
} | {
|
|
68
|
+
readonly kind: "paused";
|
|
69
|
+
readonly retryAfterMs: number;
|
|
70
|
+
};
|
|
71
|
+
export type DeviceLoginDecision = {
|
|
72
|
+
readonly kind: "ok";
|
|
73
|
+
readonly view: DeviceLoginView;
|
|
74
|
+
} | {
|
|
75
|
+
readonly kind: "invalid";
|
|
76
|
+
} | {
|
|
77
|
+
readonly kind: "paused";
|
|
78
|
+
readonly retryAfterMs: number;
|
|
79
|
+
}
|
|
80
|
+
/** The code was already approved or denied (and not yet taken up): what it is now. */
|
|
81
|
+
| {
|
|
82
|
+
readonly kind: "decided";
|
|
83
|
+
readonly state: DeviceLoginState;
|
|
84
|
+
};
|
|
85
|
+
export interface DeviceLoginRequestsOptions {
|
|
86
|
+
readonly now?: () => number;
|
|
87
|
+
/** For tests that need a known code. */
|
|
88
|
+
readonly generate?: () => string;
|
|
89
|
+
readonly onEvent?: (event: "created" | "approved" | "denied" | "claimed" | "breaker-open") => void;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The key the per-address limits count by. An IPv4 address (also one an IPv6 socket reports as `::ffff:a.b.c.d`) is its
|
|
93
|
+
* own key. An IPv6 address counts by its /64: a single network hands one machine a whole /64, so keying by the full
|
|
94
|
+
* address would give one host as many allowances as it has addresses. Whatever is not an IP address (`unknown`) is its
|
|
95
|
+
* own key. Never read from a header: only the socket's peer.
|
|
96
|
+
*/
|
|
97
|
+
export declare function peerKeyOf(address: string): string;
|
|
98
|
+
export declare class DeviceLoginRequests {
|
|
99
|
+
private readonly entries;
|
|
100
|
+
private readonly createdByPeer;
|
|
101
|
+
private created;
|
|
102
|
+
private approveFailures;
|
|
103
|
+
private approvePausedUntil;
|
|
104
|
+
private readonly now;
|
|
105
|
+
private readonly generate;
|
|
106
|
+
private readonly onEvent;
|
|
107
|
+
constructor(opts?: DeviceLoginRequestsOptions);
|
|
108
|
+
/** How many requests are waiting (or approved and not yet taken up) — for tests and status lines. */
|
|
109
|
+
get size(): number;
|
|
110
|
+
/** How many addresses the creation rate limit is holding stamps for (for tests: it must not grow without bound). */
|
|
111
|
+
get rateTableSize(): number;
|
|
112
|
+
/**
|
|
113
|
+
* A new request. `replaces` is the request id the same browser held (its cookie): it is withdrawn first, so "get a
|
|
114
|
+
* new code" never counts against the room — but it does count against the rate. `label`, `peer` and `address` are
|
|
115
|
+
* the server's own reading of the request (never body input); they are what the approver is shown.
|
|
116
|
+
*/
|
|
117
|
+
create(input: {
|
|
118
|
+
epoch: string;
|
|
119
|
+
peerKey: string;
|
|
120
|
+
label: string;
|
|
121
|
+
peer: DeviceLoginPeer;
|
|
122
|
+
address: string;
|
|
123
|
+
replaces?: string;
|
|
124
|
+
}): DeviceLoginCreate;
|
|
125
|
+
/**
|
|
126
|
+
* The new browser asks where its request stands. An approved one is spent by this very call (`claimed`): the caller
|
|
127
|
+
* then makes the session, and a second poll with the same id finds nothing. A denied one is told once and forgotten.
|
|
128
|
+
* An unknown, malformed, expired or other-token id is `expired` — the answer never says which.
|
|
129
|
+
*/
|
|
130
|
+
poll(requestId: string | undefined, currentEpoch: string): DeviceLoginPoll;
|
|
131
|
+
/** The browser leaves the page (or asks again): its request is withdrawn. Whatever the id, nothing is said. */
|
|
132
|
+
cancel(requestId: string | undefined): void;
|
|
133
|
+
/** The approving side types a code: the request it names, for the confirm screen. A wrong code counts. */
|
|
134
|
+
lookup(input: string, currentEpoch: string): DeviceLoginMatch;
|
|
135
|
+
/**
|
|
136
|
+
* Approve or deny the request this code names. Only a pending one changes: one already decided says what it is now,
|
|
137
|
+
* so a second tap approves nothing twice. `by` is the approving session's handle (logged, never shown to the device).
|
|
138
|
+
*/
|
|
139
|
+
decide(input: string, decision: "approved" | "denied", by: string, currentEpoch: string): DeviceLoginDecision;
|
|
140
|
+
/** `/dashboard revoke`: every request is withdrawn. */
|
|
141
|
+
revokeAll(): void;
|
|
142
|
+
/** How long the approving side stays paused by its breaker (0 when it is closed). */
|
|
143
|
+
approvePausedForMs(): number;
|
|
144
|
+
private codeTaken;
|
|
145
|
+
private match;
|
|
146
|
+
private prune;
|
|
147
|
+
}
|
|
148
|
+
export declare const DEVICE_LOGIN_COOKIE = "agend_device_login";
|
|
149
|
+
export declare const DEVICE_LOGIN_PATH = "/auth/device-login";
|
|
150
|
+
export declare function buildDeviceLoginCookie(requestId: string, secure: boolean, webToken: string, maxAgeSeconds: number): string;
|
|
151
|
+
export declare function clearDeviceLoginCookie(secure: boolean, webToken: string): string;
|
|
152
|
+
/** The request id this browser holds, if the cookie header carries a well-formed one. */
|
|
153
|
+
export declare function readDeviceLoginCookie(cookieHeader: string | undefined, webToken: string): string | undefined;
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device-code sign-in (Refs #3061, P2a): a new browser shows an 8-character code; a device that is already signed in AND
|
|
3
|
+
* is this fleet's verified owner types that code under Settings → Access & security → Add device and approves it; the
|
|
4
|
+
* new browser then signs itself in.
|
|
5
|
+
*
|
|
6
|
+
* What is kept here is only the requests — never a credential. Approval moves a request from `pending` to `approved`
|
|
7
|
+
* and nothing else: no cookie, session id or token passes from the approving device to the new one. The new browser
|
|
8
|
+
* mints its own session in its own request (auth-api `POST /auth/device-login/poll`), by presenting the request id it
|
|
9
|
+
* was given when it asked. That id is 256 random bits, is never shown to the approver, and travels only in an HttpOnly
|
|
10
|
+
* cookie scoped to /auth/device-login.
|
|
11
|
+
*
|
|
12
|
+
* The rules, each of them a property worth testing on its own:
|
|
13
|
+
* - **Short-lived and single-use.** A request lives five minutes from when it was asked for — approving does not extend
|
|
14
|
+
* it — and the poll that claims an approved request spends it. A second claim, a second approval of the same code and
|
|
15
|
+
* a code that has expired are all refused.
|
|
16
|
+
* - **Rotating the web token withdraws every request** (each carries the token epoch it was made under), as it does an
|
|
17
|
+
* unused login code. So does `/dashboard revoke` (`revokeAll`).
|
|
18
|
+
* - **Bounded.** At most MAX_PENDING_DEVICE_LOGINS requests at once, MAX_PENDING_PER_PEER per address, and a limit on
|
|
19
|
+
* how many one address — and the fleet — may ask for in a window, so a stranger on the network cannot fill the room
|
|
20
|
+
* or run the fleet out of memory. A full room refuses new requests; it never evicts a waiting person's.
|
|
21
|
+
* - **A breaker on the approving side.** Typing a code that matches no request is a wrong try; enough of them pause every
|
|
22
|
+
* lookup and decision, correct codes included. With no request waiting there is nothing to guess: it counts against
|
|
23
|
+
* nothing (as for login codes). The approving side is already an owner-verified session, so this guards against a
|
|
24
|
+
* mistake, a stolen owner session guessing at someone else's code, and a phishing line "read me the code".
|
|
25
|
+
* - **The approver learns only what it needs to decide:** the device's label, whether it asked from this computer or the
|
|
26
|
+
* network, its address, and the time left. Never the request id.
|
|
27
|
+
*
|
|
28
|
+
* Deliberately knows nothing of HTTP, sessions or who the approver is: the caller has already decided that.
|
|
29
|
+
* In memory only — a restart drops every request, as it does an unused login code.
|
|
30
|
+
*/
|
|
31
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
32
|
+
import { isIPv4, isIPv6 } from "node:net";
|
|
33
|
+
import { constantTimeMatches, formatOneTimeCode, generateOneTimeCode, normalizeOneTimeCode } from "./auth/one-time-code.js";
|
|
34
|
+
import { fleetCookieName } from "./web-cookie-names.js";
|
|
35
|
+
export const DEVICE_LOGIN_TTL_MS = 5 * 60 * 1000;
|
|
36
|
+
export const MAX_PENDING_DEVICE_LOGINS = 8;
|
|
37
|
+
export const MAX_PENDING_PER_PEER = 2;
|
|
38
|
+
/** Requests one address, and the whole fleet, may ask for per DEVICE_LOGIN_CREATE_WINDOW_MS. */
|
|
39
|
+
export const DEVICE_LOGIN_CREATE_WINDOW_MS = 10 * 60 * 1000;
|
|
40
|
+
export const DEVICE_LOGIN_CREATES_PER_PEER = 6;
|
|
41
|
+
export const DEVICE_LOGIN_CREATES_GLOBAL = 20;
|
|
42
|
+
/**
|
|
43
|
+
* The approving side's breaker: this many wrong codes in the window pause it. Shorter than a request's life on purpose
|
|
44
|
+
* (a pause that outlasted it would end every request waiting): ten tries per two minutes is still hopeless against a
|
|
45
|
+
* 40-bit code among at most eight, and the person approving is already an owner-verified session.
|
|
46
|
+
*/
|
|
47
|
+
export const DEVICE_APPROVE_WINDOW_MS = 15 * 60 * 1000;
|
|
48
|
+
export const DEVICE_APPROVE_THRESHOLD = 10;
|
|
49
|
+
export const DEVICE_APPROVE_PAUSE_MS = 2 * 60 * 1000;
|
|
50
|
+
/** Compared against when nothing waits, so "no request" costs what "wrong code" costs. */
|
|
51
|
+
const NO_REQUEST_PLACEHOLDER = "AAAAAAAA";
|
|
52
|
+
/**
|
|
53
|
+
* The key the per-address limits count by. An IPv4 address (also one an IPv6 socket reports as `::ffff:a.b.c.d`) is its
|
|
54
|
+
* own key. An IPv6 address counts by its /64: a single network hands one machine a whole /64, so keying by the full
|
|
55
|
+
* address would give one host as many allowances as it has addresses. Whatever is not an IP address (`unknown`) is its
|
|
56
|
+
* own key. Never read from a header: only the socket's peer.
|
|
57
|
+
*/
|
|
58
|
+
export function peerKeyOf(address) {
|
|
59
|
+
const a = address.replace(/%.*$/, "").toLowerCase(); // a zone id (fe80::1%eth0) is not part of the address
|
|
60
|
+
const dotted = /^::ffff:(\d{1,3}(?:\.\d{1,3}){3})$/.exec(a);
|
|
61
|
+
if (dotted)
|
|
62
|
+
return dotted[1];
|
|
63
|
+
const hex = /^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(a);
|
|
64
|
+
if (hex) {
|
|
65
|
+
const hi = parseInt(hex[1], 16), lo = parseInt(hex[2], 16);
|
|
66
|
+
return `${hi >> 8}.${hi & 255}.${lo >> 8}.${lo & 255}`;
|
|
67
|
+
}
|
|
68
|
+
if (isIPv4(a) || !isIPv6(a))
|
|
69
|
+
return a;
|
|
70
|
+
const halves = a.split("::");
|
|
71
|
+
const groups = (part) => (part ? part.split(":").flatMap(g => {
|
|
72
|
+
if (!g.includes("."))
|
|
73
|
+
return [g];
|
|
74
|
+
const [b0, b1, b2, b3] = g.split(".").map(Number); // an embedded IPv4 is two groups
|
|
75
|
+
return [((b0 << 8) | b1).toString(16), ((b2 << 8) | b3).toString(16)];
|
|
76
|
+
}) : []);
|
|
77
|
+
const head = groups(halves[0]), tail = halves.length > 1 ? groups(halves[1]) : [];
|
|
78
|
+
const all = halves.length > 1 ? [...head, ...Array(Math.max(0, 8 - head.length - tail.length)).fill("0"), ...tail] : head;
|
|
79
|
+
return `${all.slice(0, 4).map(g => parseInt(g || "0", 16).toString(16)).join(":")}::/64`;
|
|
80
|
+
}
|
|
81
|
+
/** The key a request id is kept under: its hash, so the map never holds what the new browser presents. */
|
|
82
|
+
function keyOf(requestId) {
|
|
83
|
+
return createHash("sha256").update(`agend-device-login-v1:${requestId}`).digest("hex");
|
|
84
|
+
}
|
|
85
|
+
const REQUEST_ID = /^[0-9a-f]{64}$/;
|
|
86
|
+
export class DeviceLoginRequests {
|
|
87
|
+
entries = new Map();
|
|
88
|
+
createdByPeer = new Map();
|
|
89
|
+
created = [];
|
|
90
|
+
approveFailures = [];
|
|
91
|
+
approvePausedUntil = 0;
|
|
92
|
+
now;
|
|
93
|
+
generate;
|
|
94
|
+
onEvent;
|
|
95
|
+
constructor(opts = {}) {
|
|
96
|
+
this.now = opts.now ?? (() => Date.now());
|
|
97
|
+
this.generate = opts.generate ?? generateOneTimeCode;
|
|
98
|
+
this.onEvent = opts.onEvent ?? (() => { });
|
|
99
|
+
}
|
|
100
|
+
/** How many requests are waiting (or approved and not yet taken up) — for tests and status lines. */
|
|
101
|
+
get size() { this.prune(); return this.entries.size; }
|
|
102
|
+
/** How many addresses the creation rate limit is holding stamps for (for tests: it must not grow without bound). */
|
|
103
|
+
get rateTableSize() { return this.createdByPeer.size; }
|
|
104
|
+
/**
|
|
105
|
+
* A new request. `replaces` is the request id the same browser held (its cookie): it is withdrawn first, so "get a
|
|
106
|
+
* new code" never counts against the room — but it does count against the rate. `label`, `peer` and `address` are
|
|
107
|
+
* the server's own reading of the request (never body input); they are what the approver is shown.
|
|
108
|
+
*/
|
|
109
|
+
create(input) {
|
|
110
|
+
const now = this.now();
|
|
111
|
+
this.prune();
|
|
112
|
+
if (input.replaces && REQUEST_ID.test(input.replaces))
|
|
113
|
+
this.entries.delete(keyOf(input.replaces));
|
|
114
|
+
const cutoff = now - DEVICE_LOGIN_CREATE_WINDOW_MS;
|
|
115
|
+
this.created = this.created.filter(t => t > cutoff);
|
|
116
|
+
// The whole per-address table, not just this address: one whose every stamp is out of the window is forgotten, so
|
|
117
|
+
// addresses seen once never pile up (the table holds at most what the window admitted — DEVICE_LOGIN_CREATES_GLOBAL).
|
|
118
|
+
for (const [key, stamps] of this.createdByPeer) {
|
|
119
|
+
const live = stamps.filter(t => t > cutoff);
|
|
120
|
+
if (live.length)
|
|
121
|
+
this.createdByPeer.set(key, live);
|
|
122
|
+
else
|
|
123
|
+
this.createdByPeer.delete(key);
|
|
124
|
+
}
|
|
125
|
+
const mine = this.createdByPeer.get(input.peerKey) ?? [];
|
|
126
|
+
if (mine.length >= DEVICE_LOGIN_CREATES_PER_PEER)
|
|
127
|
+
return { kind: "limited", retryAfterMs: Math.max(1000, mine[0] + DEVICE_LOGIN_CREATE_WINDOW_MS - now) };
|
|
128
|
+
if (this.created.length >= DEVICE_LOGIN_CREATES_GLOBAL)
|
|
129
|
+
return { kind: "limited", retryAfterMs: Math.max(1000, this.created[0] + DEVICE_LOGIN_CREATE_WINDOW_MS - now) };
|
|
130
|
+
let waitingHere = 0;
|
|
131
|
+
for (const e of this.entries.values())
|
|
132
|
+
if (e.peerKey === input.peerKey)
|
|
133
|
+
waitingHere++;
|
|
134
|
+
if (this.entries.size >= MAX_PENDING_DEVICE_LOGINS || waitingHere >= MAX_PENDING_PER_PEER)
|
|
135
|
+
return { kind: "full" };
|
|
136
|
+
// A code no other waiting request has (the room is eight; a clash is a one-in-a-trillion retry).
|
|
137
|
+
let code = this.generate();
|
|
138
|
+
for (let n = 0; n < 16 && this.codeTaken(code); n++)
|
|
139
|
+
code = this.generate();
|
|
140
|
+
if (this.codeTaken(code))
|
|
141
|
+
return { kind: "full" };
|
|
142
|
+
const requestId = randomBytes(32).toString("hex");
|
|
143
|
+
const expiresAt = now + DEVICE_LOGIN_TTL_MS;
|
|
144
|
+
this.entries.set(keyOf(requestId), { code, label: input.label, peer: input.peer, address: input.address, peerKey: input.peerKey,
|
|
145
|
+
epoch: input.epoch, createdAt: now, expiresAt, state: "pending" });
|
|
146
|
+
this.created.push(now);
|
|
147
|
+
this.createdByPeer.set(input.peerKey, [...mine, now]);
|
|
148
|
+
this.onEvent("created");
|
|
149
|
+
return { kind: "ok", requestId, code: formatOneTimeCode(code), expiresAt };
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The new browser asks where its request stands. An approved one is spent by this very call (`claimed`): the caller
|
|
153
|
+
* then makes the session, and a second poll with the same id finds nothing. A denied one is told once and forgotten.
|
|
154
|
+
* An unknown, malformed, expired or other-token id is `expired` — the answer never says which.
|
|
155
|
+
*/
|
|
156
|
+
poll(requestId, currentEpoch) {
|
|
157
|
+
if (!requestId || !REQUEST_ID.test(requestId))
|
|
158
|
+
return { kind: "expired" };
|
|
159
|
+
this.prune();
|
|
160
|
+
const key = keyOf(requestId), e = this.entries.get(key);
|
|
161
|
+
if (!e)
|
|
162
|
+
return { kind: "expired" };
|
|
163
|
+
if (e.epoch !== currentEpoch) {
|
|
164
|
+
this.entries.delete(key);
|
|
165
|
+
return { kind: "expired" };
|
|
166
|
+
}
|
|
167
|
+
if (e.state === "pending")
|
|
168
|
+
return { kind: "pending", expiresAt: e.expiresAt };
|
|
169
|
+
this.entries.delete(key);
|
|
170
|
+
if (e.state === "denied")
|
|
171
|
+
return { kind: "denied" };
|
|
172
|
+
this.onEvent("claimed");
|
|
173
|
+
return { kind: "claimed", label: e.label, approvedBy: e.decidedBy ?? "" };
|
|
174
|
+
}
|
|
175
|
+
/** The browser leaves the page (or asks again): its request is withdrawn. Whatever the id, nothing is said. */
|
|
176
|
+
cancel(requestId) {
|
|
177
|
+
if (requestId && REQUEST_ID.test(requestId))
|
|
178
|
+
this.entries.delete(keyOf(requestId));
|
|
179
|
+
}
|
|
180
|
+
/** The approving side types a code: the request it names, for the confirm screen. A wrong code counts. */
|
|
181
|
+
lookup(input, currentEpoch) {
|
|
182
|
+
const m = this.match(input, currentEpoch);
|
|
183
|
+
return m.kind === "found" ? { kind: "ok", view: viewOf(m.entry) } : m;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Approve or deny the request this code names. Only a pending one changes: one already decided says what it is now,
|
|
187
|
+
* so a second tap approves nothing twice. `by` is the approving session's handle (logged, never shown to the device).
|
|
188
|
+
*/
|
|
189
|
+
decide(input, decision, by, currentEpoch) {
|
|
190
|
+
const m = this.match(input, currentEpoch);
|
|
191
|
+
if (m.kind !== "found")
|
|
192
|
+
return m;
|
|
193
|
+
const e = m.entry;
|
|
194
|
+
if (e.state !== "pending")
|
|
195
|
+
return { kind: "decided", state: e.state };
|
|
196
|
+
e.state = decision;
|
|
197
|
+
e.decidedBy = by;
|
|
198
|
+
this.onEvent(decision === "approved" ? "approved" : "denied");
|
|
199
|
+
return { kind: "ok", view: viewOf(e) };
|
|
200
|
+
}
|
|
201
|
+
/** `/dashboard revoke`: every request is withdrawn. */
|
|
202
|
+
revokeAll() { this.entries.clear(); }
|
|
203
|
+
/** How long the approving side stays paused by its breaker (0 when it is closed). */
|
|
204
|
+
approvePausedForMs() { return Math.max(0, this.approvePausedUntil - this.now()); }
|
|
205
|
+
codeTaken(code) {
|
|
206
|
+
for (const e of this.entries.values())
|
|
207
|
+
if (e.code === code)
|
|
208
|
+
return true;
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
match(input, currentEpoch) {
|
|
212
|
+
const now = this.now();
|
|
213
|
+
if (now < this.approvePausedUntil)
|
|
214
|
+
return { kind: "paused", retryAfterMs: this.approvePausedUntil - now };
|
|
215
|
+
const provided = normalizeOneTimeCode(input);
|
|
216
|
+
// Nothing typed is not a guess; it costs nothing.
|
|
217
|
+
if (!provided)
|
|
218
|
+
return { kind: "invalid" };
|
|
219
|
+
this.prune();
|
|
220
|
+
for (const [key, e] of this.entries)
|
|
221
|
+
if (e.epoch !== currentEpoch)
|
|
222
|
+
this.entries.delete(key); // the token was rotated
|
|
223
|
+
if (!this.entries.size) {
|
|
224
|
+
constantTimeMatches(provided, NO_REQUEST_PLACEHOLDER);
|
|
225
|
+
return { kind: "invalid" };
|
|
226
|
+
}
|
|
227
|
+
// Every waiting code is compared, in constant time each: where the match is does not show in the time taken.
|
|
228
|
+
let hit = null;
|
|
229
|
+
for (const e of this.entries.values())
|
|
230
|
+
if (constantTimeMatches(provided, e.code))
|
|
231
|
+
hit = e;
|
|
232
|
+
if (hit)
|
|
233
|
+
return { kind: "found", entry: hit };
|
|
234
|
+
this.approveFailures = this.approveFailures.filter(t => t > now - DEVICE_APPROVE_WINDOW_MS);
|
|
235
|
+
this.approveFailures.push(now);
|
|
236
|
+
if (this.approveFailures.length >= DEVICE_APPROVE_THRESHOLD) {
|
|
237
|
+
this.approvePausedUntil = now + DEVICE_APPROVE_PAUSE_MS;
|
|
238
|
+
this.approveFailures = [];
|
|
239
|
+
this.onEvent("breaker-open");
|
|
240
|
+
}
|
|
241
|
+
return { kind: "invalid" };
|
|
242
|
+
}
|
|
243
|
+
prune() {
|
|
244
|
+
const now = this.now();
|
|
245
|
+
for (const [key, e] of this.entries)
|
|
246
|
+
if (now >= e.expiresAt)
|
|
247
|
+
this.entries.delete(key);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function viewOf(e) {
|
|
251
|
+
return { code: formatOneTimeCode(e.code), label: e.label, peer: e.peer, address: e.address, expiresAt: e.expiresAt, state: e.state };
|
|
252
|
+
}
|
|
253
|
+
// ── The new browser's one cookie: the request id, HttpOnly, and sent only to /auth/device-login ──
|
|
254
|
+
export const DEVICE_LOGIN_COOKIE = "agend_device_login";
|
|
255
|
+
export const DEVICE_LOGIN_PATH = "/auth/device-login";
|
|
256
|
+
export function buildDeviceLoginCookie(requestId, secure, webToken, maxAgeSeconds) {
|
|
257
|
+
return [`${fleetCookieName(DEVICE_LOGIN_COOKIE, webToken)}=${requestId}`, `Path=${DEVICE_LOGIN_PATH}`, "HttpOnly", "SameSite=Strict",
|
|
258
|
+
`Max-Age=${Math.max(0, Math.floor(maxAgeSeconds))}`, ...(secure ? ["Secure"] : [])].join("; ");
|
|
259
|
+
}
|
|
260
|
+
export function clearDeviceLoginCookie(secure, webToken) {
|
|
261
|
+
return buildDeviceLoginCookie("", secure, webToken, 0);
|
|
262
|
+
}
|
|
263
|
+
/** The request id this browser holds, if the cookie header carries a well-formed one. */
|
|
264
|
+
export function readDeviceLoginCookie(cookieHeader, webToken) {
|
|
265
|
+
if (!cookieHeader)
|
|
266
|
+
return undefined;
|
|
267
|
+
const name = fleetCookieName(DEVICE_LOGIN_COOKIE, webToken);
|
|
268
|
+
for (const part of cookieHeader.split(";")) {
|
|
269
|
+
const at = part.indexOf("=");
|
|
270
|
+
if (at < 0 || part.slice(0, at).trim() !== name)
|
|
271
|
+
continue;
|
|
272
|
+
const value = part.slice(at + 1).trim();
|
|
273
|
+
if (REQUEST_ID.test(value))
|
|
274
|
+
return value;
|
|
275
|
+
}
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=web-device-login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-device-login.js","sourceRoot":"","sources":["../src/web-device-login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC5H,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACjD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;A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E,QAAgB;IACtF,IAAI,CAAC,YAAY;QAAE,OAAO,SAAS,CAAC;IACpC,MAAM,IAAI,GAAG,eAAe,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IAC5D,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3C,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,IAAI;YAAE,SAAS;QAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACxC,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;IAC3C,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -72,6 +72,15 @@ export declare function checkSkinPicture(name: string, bytes: Uint8Array): {
|
|
|
72
72
|
width: number;
|
|
73
73
|
height: number;
|
|
74
74
|
} | SkinRefusal;
|
|
75
|
+
/** #2861: the largest portrait, and the largest dialogue-box frame (image px). */
|
|
76
|
+
export declare const PORTRAIT_MAX: {
|
|
77
|
+
w: number;
|
|
78
|
+
h: number;
|
|
79
|
+
};
|
|
80
|
+
export declare const FRAME_MAX: {
|
|
81
|
+
w: number;
|
|
82
|
+
h: number;
|
|
83
|
+
};
|
|
75
84
|
/**
|
|
76
85
|
* An upload, as the page sends it: { manifest, files: { <src>: <base64> }, name? }. Every rule, or a refusal naming
|
|
77
86
|
* where it broke. Pure (no I/O); `by` and `now` are kept in the record.
|