@songsid/agend 2.4.0-beta.26 → 2.4.0-beta.27
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/dist/agent-endpoint.d.ts +1 -0
- package/dist/agent-endpoint.js +5 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-whats-new.js +4 -0
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/backend/kiro-auth-store.d.ts +15 -2
- package/dist/backend/kiro-auth-store.js +64 -0
- package/dist/backend/kiro-auth-store.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/adapters/discord.js +4 -4
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.js +3 -3
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/ipc-bridge.d.ts +7 -0
- package/dist/channel/ipc-bridge.js +45 -11
- package/dist/channel/ipc-bridge.js.map +1 -1
- package/dist/channel/mcp-server.js +3 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.js +5 -3
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/cli.js +35 -2
- package/dist/cli.js.map +1 -1
- package/dist/daemon.d.ts +64 -3
- package/dist/daemon.js +497 -102
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +107 -7
- package/dist/delivery-outbox.js +293 -8
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/detached-fleet-stop.d.ts +40 -0
- package/dist/detached-fleet-stop.js +126 -0
- package/dist/detached-fleet-stop.js.map +1 -0
- package/dist/fleet-lock.d.ts +5 -0
- package/dist/fleet-lock.js +21 -2
- package/dist/fleet-lock.js.map +1 -1
- package/dist/fleet-manager.d.ts +482 -4
- package/dist/fleet-manager.js +2692 -215
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +39 -3
- package/dist/fleet-windows-runtime.js +208 -30
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +5 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +95 -25
- package/dist/hub/admin-dashboard.js +1 -1
- package/dist/hub/admin-dashboard.js.map +1 -1
- package/dist/hub/agent-catalog.d.ts +1 -1
- package/dist/hub/agent-catalog.js +4 -3
- package/dist/hub/agent-catalog.js.map +1 -1
- package/dist/hub/agent-intro.d.ts +1 -1
- package/dist/hub/agent-intro.js +1 -1
- package/dist/hub/agent-intro.js.map +1 -1
- package/dist/hub/agent-pictures.d.ts +1 -1
- package/dist/hub/agent-pictures.js +4 -3
- package/dist/hub/agent-pictures.js.map +1 -1
- package/dist/hub/catalog.d.ts +2 -2
- package/dist/hub/catalog.js +16 -13
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.js +9 -2
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.js +8 -1
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.js +4 -2
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/fleet-updates.d.ts +2 -2
- package/dist/hub/fleet-updates.js +7 -5
- package/dist/hub/fleet-updates.js.map +1 -1
- package/dist/hub/fleet-versions.d.ts +1 -1
- package/dist/hub/fleet-versions.js +3 -2
- package/dist/hub/fleet-versions.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +1 -1
- package/dist/hub/http/compose.js +57 -30
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/schema.js +4 -1
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/join/service.d.ts +6 -0
- package/dist/hub/join/service.js +10 -0
- package/dist/hub/join/service.js.map +1 -1
- package/dist/hub/member/room-ask.js +2 -0
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-post.d.ts +4 -0
- package/dist/hub/member/room-post.js +26 -1
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/protocol.d.ts +58 -0
- package/dist/hub/protocol.js +3 -2
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/quota.d.ts +2 -2
- package/dist/hub/quota.js +6 -4
- package/dist/hub/quota.js.map +1 -1
- package/dist/hub/read-statement.d.ts +6 -0
- package/dist/hub/read-statement.js +33 -0
- package/dist/hub/read-statement.js.map +1 -0
- package/dist/hub/recommendations.d.ts +1 -1
- package/dist/hub/recommendations.js +3 -2
- package/dist/hub/recommendations.js.map +1 -1
- package/dist/hub/representative.d.ts +2 -0
- package/dist/hub/representative.js +8 -4
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/roles/clock.js +6 -5
- package/dist/hub/roles/clock.js.map +1 -1
- package/dist/hub/roles/read.d.ts +2 -0
- package/dist/hub/roles/read.js +27 -6
- package/dist/hub/roles/read.js.map +1 -1
- package/dist/hub/room-history-model.d.ts +87 -0
- package/dist/hub/room-history-model.js +14 -0
- package/dist/hub/room-history-model.js.map +1 -0
- package/dist/hub/rooms/agents.d.ts +1 -1
- package/dist/hub/rooms/agents.js +3 -2
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/history.d.ts +8 -0
- package/dist/hub/rooms/history.js +31 -0
- package/dist/hub/rooms/history.js.map +1 -0
- package/dist/hub/rooms/schema.d.ts +2 -0
- package/dist/hub/rooms/schema.js +4 -0
- package/dist/hub/rooms/schema.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +35 -19
- package/dist/hub/rooms/service.js +105 -26
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/server.js +10 -3
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/session-epoch.js +2 -1
- package/dist/hub/session-epoch.js.map +1 -1
- package/dist/hub/settings-directory-decision.js +3 -2
- package/dist/hub/settings-directory-decision.js.map +1 -1
- package/dist/hub/settings-member-address-decision.js +2 -1
- package/dist/hub/settings-member-address-decision.js.map +1 -1
- package/dist/hub/settings-web-address-decision.js +2 -1
- package/dist/hub/settings-web-address-decision.js.map +1 -1
- package/dist/hub/store.d.ts +1 -0
- package/dist/hub/store.js +12 -4
- package/dist/hub/store.js.map +1 -1
- package/dist/hub/types.d.ts +2 -2
- package/dist/hub-agent-incarnation-record.d.ts +24 -0
- package/dist/hub-agent-incarnation-record.js +46 -0
- package/dist/hub-agent-incarnation-record.js.map +1 -0
- package/dist/human-delivery-receipts.d.ts +16 -4
- package/dist/human-delivery-receipts.js +26 -5
- package/dist/human-delivery-receipts.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +9 -3
- package/dist/instance-lifecycle.js +27 -10
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/local-pane-endpoint.d.ts +14 -0
- package/dist/local-pane-endpoint.js +32 -0
- package/dist/local-pane-endpoint.js.map +1 -1
- package/dist/locale.js +52 -4
- package/dist/locale.js.map +1 -1
- package/dist/native-agent-admission.js +9 -0
- package/dist/native-agent-admission.js.map +1 -1
- package/dist/native-exec-context.d.ts +11 -0
- package/dist/native-exec-context.js +18 -0
- package/dist/native-exec-context.js.map +1 -0
- package/dist/native-exec-input.d.ts +56 -0
- package/dist/native-exec-input.js +89 -0
- package/dist/native-exec-input.js.map +1 -0
- package/dist/native-mcp.d.ts +9 -1
- package/dist/native-mcp.js +29 -7
- package/dist/native-mcp.js.map +1 -1
- package/dist/native-pane-lifecycle.d.ts +3 -0
- package/dist/native-pane-lifecycle.js +2 -0
- package/dist/native-pane-lifecycle.js.map +1 -1
- package/dist/native-pane-manager.d.ts +18 -0
- package/dist/native-pane-manager.js +85 -8
- package/dist/native-pane-manager.js.map +1 -1
- package/dist/needs-you.d.ts +2 -1
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-handlers.d.ts +1 -0
- package/dist/outbound-handlers.js +9 -3
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +5 -0
- package/dist/outbound-schemas.js +2 -0
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +3 -1
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/recover.cjs +1 -0
- package/dist/reply-buttons-controller.d.ts +1 -0
- package/dist/reply-buttons-controller.js +1 -1
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/request-contact-gate.d.ts +2 -0
- package/dist/request-contact-gate.js +8 -3
- package/dist/request-contact-gate.js.map +1 -1
- package/dist/request-context-activation.d.ts +29 -0
- package/dist/request-context-activation.js +74 -0
- package/dist/request-context-activation.js.map +1 -0
- package/dist/request-context-admission.d.ts +22 -0
- package/dist/request-context-admission.js +12 -0
- package/dist/request-context-admission.js.map +1 -0
- package/dist/request-context-boot.d.ts +35 -0
- package/dist/request-context-boot.js +97 -0
- package/dist/request-context-boot.js.map +1 -0
- package/dist/request-context-call.d.ts +2 -0
- package/dist/request-context-call.js.map +1 -1
- package/dist/request-context-continuation.d.ts +6 -0
- package/dist/request-context-continuation.js +24 -0
- package/dist/request-context-continuation.js.map +1 -0
- package/dist/request-context-control-api.d.ts +101 -0
- package/dist/request-context-control-api.js +177 -0
- package/dist/request-context-control-api.js.map +1 -0
- package/dist/request-context-control-copy.d.ts +3 -0
- package/dist/request-context-control-copy.js +7 -0
- package/dist/request-context-control-copy.js.map +1 -0
- package/dist/request-context-controller.d.ts +44 -0
- package/dist/request-context-controller.js +129 -0
- package/dist/request-context-controller.js.map +1 -0
- package/dist/request-context-delivery-resolver.d.ts +13 -0
- package/dist/request-context-delivery-resolver.js +30 -0
- package/dist/request-context-delivery-resolver.js.map +1 -0
- package/dist/request-context-drain.d.ts +13 -0
- package/dist/request-context-drain.js +79 -6
- package/dist/request-context-drain.js.map +1 -1
- package/dist/request-context-enable-offer.d.ts +13 -0
- package/dist/request-context-enable-offer.js +31 -0
- package/dist/request-context-enable-offer.js.map +1 -0
- package/dist/request-context-exec-owner.d.ts +39 -0
- package/dist/request-context-exec-owner.js +128 -0
- package/dist/request-context-exec-owner.js.map +1 -0
- package/dist/request-context-go-back-view.d.ts +1 -0
- package/dist/request-context-go-back-view.js +17 -0
- package/dist/request-context-go-back-view.js.map +1 -0
- package/dist/request-context-helper-readiness.d.ts +14 -0
- package/dist/request-context-helper-readiness.js +23 -0
- package/dist/request-context-helper-readiness.js.map +1 -0
- package/dist/request-context-helper.d.ts +20 -0
- package/dist/request-context-helper.js +41 -0
- package/dist/request-context-helper.js.map +1 -0
- package/dist/request-context-hub-resolver.d.ts +29 -0
- package/dist/request-context-hub-resolver.js +90 -0
- package/dist/request-context-hub-resolver.js.map +1 -0
- package/dist/request-context-human-resolver.d.ts +20 -0
- package/dist/request-context-human-resolver.js +77 -0
- package/dist/request-context-human-resolver.js.map +1 -0
- package/dist/request-context-human.d.ts +106 -0
- package/dist/request-context-human.js +153 -0
- package/dist/request-context-human.js.map +1 -0
- package/dist/request-context-inputs.d.ts +21 -0
- package/dist/request-context-inputs.js +63 -0
- package/dist/request-context-inputs.js.map +1 -0
- package/dist/request-context-installation.d.ts +117 -0
- package/dist/request-context-installation.js +328 -0
- package/dist/request-context-installation.js.map +1 -0
- package/dist/request-context-knowledge.d.ts +5 -0
- package/dist/request-context-knowledge.js +32 -0
- package/dist/request-context-knowledge.js.map +1 -0
- package/dist/request-context-native-human.d.ts +20 -0
- package/dist/request-context-native-human.js +91 -0
- package/dist/request-context-native-human.js.map +1 -0
- package/dist/request-context-native-output.d.ts +15 -0
- package/dist/request-context-native-output.js +46 -0
- package/dist/request-context-native-output.js.map +1 -0
- package/dist/request-context-native-result.d.ts +15 -0
- package/dist/request-context-native-result.js +46 -0
- package/dist/request-context-native-result.js.map +1 -0
- package/dist/request-context-off.d.ts +22 -0
- package/dist/request-context-off.js +77 -0
- package/dist/request-context-off.js.map +1 -0
- package/dist/request-context-outside-label.d.ts +5 -0
- package/dist/request-context-outside-label.js +28 -0
- package/dist/request-context-outside-label.js.map +1 -0
- package/dist/request-context-pane.d.ts +8 -0
- package/dist/request-context-pane.js +19 -0
- package/dist/request-context-pane.js.map +1 -1
- package/dist/request-context-pending-work.d.ts +11 -0
- package/dist/request-context-pending-work.js +43 -0
- package/dist/request-context-pending-work.js.map +1 -0
- package/dist/request-context-policy.d.ts +17 -1
- package/dist/request-context-policy.js +84 -6
- package/dist/request-context-policy.js.map +1 -1
- package/dist/request-context-readiness.d.ts +49 -0
- package/dist/request-context-readiness.js +64 -0
- package/dist/request-context-readiness.js.map +1 -0
- package/dist/request-context-recovery.d.ts +6 -2
- package/dist/request-context-recovery.js +25 -0
- package/dist/request-context-recovery.js.map +1 -1
- package/dist/request-context-relay.d.ts +2 -2
- package/dist/request-context-relay.js +10 -10
- package/dist/request-context-relay.js.map +1 -1
- package/dist/request-context-retirement.d.ts +19 -0
- package/dist/request-context-retirement.js +16 -0
- package/dist/request-context-retirement.js.map +1 -0
- package/dist/request-context-start.d.ts +15 -0
- package/dist/request-context-start.js +2 -0
- package/dist/request-context-start.js.map +1 -0
- package/dist/request-context-turns.d.ts +1 -1
- package/dist/request-context-turns.js +3 -2
- package/dist/request-context-turns.js.map +1 -1
- package/dist/request-context-unproved-label.d.ts +4 -0
- package/dist/request-context-unproved-label.js +25 -0
- package/dist/request-context-unproved-label.js.map +1 -0
- package/dist/request-context-update-guard.d.ts +15 -0
- package/dist/request-context-update-guard.js +54 -0
- package/dist/request-context-update-guard.js.map +1 -0
- package/dist/request-context-work.d.ts +50 -0
- package/dist/request-context-work.js +178 -0
- package/dist/request-context-work.js.map +1 -0
- package/dist/request-hub-context.d.ts +1 -0
- package/dist/request-hub-output.d.ts +2 -0
- package/dist/request-hub-output.js +12 -0
- package/dist/request-hub-output.js.map +1 -1
- package/dist/retained-human-control.d.ts +11 -0
- package/dist/retained-human-control.js +11 -0
- package/dist/retained-human-control.js.map +1 -0
- package/dist/runtime-build-info.js +1 -1
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli.js +1 -1
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client-store.js +7 -1
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.js +15 -3
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +23 -0
- package/dist/runtime-coordinator.js +103 -4
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-pane-mcp.d.ts +9 -0
- package/dist/runtime-pane-mcp.js +22 -2
- package/dist/runtime-pane-mcp.js.map +1 -1
- package/dist/runtime-protocol.d.ts +2 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/runtime-update-controller.js +1 -1
- package/dist/runtime-update-controller.js.map +1 -1
- package/dist/runtime-windows-bridge.d.ts +8 -0
- package/dist/runtime-windows-bridge.js +50 -3
- package/dist/runtime-windows-bridge.js.map +1 -1
- package/dist/service-install-handover.d.ts +52 -0
- package/dist/service-install-handover.js +50 -0
- package/dist/service-install-handover.js.map +1 -0
- package/dist/service-installer.d.ts +12 -0
- package/dist/service-installer.js +24 -10
- package/dist/service-installer.js.map +1 -1
- package/dist/settings-api.d.ts +2 -0
- package/dist/settings-api.js +4 -0
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +1 -0
- package/dist/settings-baseline.js +5 -4
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-confirmation.d.ts +2 -0
- package/dist/settings-confirmation.js +6 -0
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +2 -0
- package/dist/settings-effect.js +44 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +3 -0
- package/dist/settings-http-confirmation.js +29 -0
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-route-lifetime.d.ts +3 -1
- package/dist/settings-route-lifetime.js +15 -5
- package/dist/settings-route-lifetime.js.map +1 -1
- package/dist/settings-transaction.d.ts +3 -2
- package/dist/settings-transaction.js.map +1 -1
- package/dist/tips.js +1 -1
- package/dist/tips.js.map +1 -1
- package/dist/tool-permissions.js +3 -3
- package/dist/tool-permissions.js.map +1 -1
- package/dist/tool-receipt-output.d.ts +6 -6
- package/dist/turn-reply-guard.d.ts +16 -1
- package/dist/turn-reply-guard.js +20 -2
- package/dist/turn-reply-guard.js.map +1 -1
- package/dist/ui/app.html +2 -2
- package/dist/ui/contact-auth-strings.js +6 -6
- package/dist/ui/contact-authorizations.js +19 -1
- package/dist/ui/contact-grant-editor.js +71 -11
- package/dist/ui/contact-needs.js +27 -8
- package/dist/ui/contact-permissions.js +25 -8
- package/dist/ui/contact-tool-groups.js +1 -1
- package/dist/ui/hub-client.js +3 -0
- package/dist/ui/hub-room-members.js +4 -2
- package/dist/ui/hub-room-settings-strings.js +8 -0
- package/dist/ui/hub-room-settings.js +32 -0
- package/dist/ui/hub-room-thread.js +7 -1
- package/dist/ui/icons/hub-apple-touch-icon.png +0 -0
- package/dist/ui/icons/hub-favicon.ico +0 -0
- package/dist/ui/icons/hub-favicon.svg +10 -0
- package/dist/ui/icons/hub-icon-192.png +0 -0
- package/dist/ui/icons/hub-icon-512.png +0 -0
- package/dist/ui/icons/hub-icon-maskable-192.png +0 -0
- package/dist/ui/icons/hub-icon-maskable-512.png +0 -0
- package/dist/ui/icons/hub-maskable.svg +12 -0
- package/dist/ui/panel-hub.js +14 -3
- package/dist/ui/panel-needs.js +2 -1
- package/dist/ui/panel-settings.js +2 -1
- package/dist/ui/request-contact-card.js +287 -0
- package/dist/ui/request-contact-client.js +83 -0
- package/dist/ui/request-contact-page.js +78 -0
- package/dist/ui/request-context-control.js +171 -0
- package/dist/ui/settings-registry.js +2 -0
- package/dist/ui/settings-update.js +3 -2
- package/dist/ui/shared/app-install.js +2 -2
- package/dist/ui/shared/app-shell.js +13 -3
- package/dist/ui/shared/app-stream.js +1 -0
- package/dist/ui/shared/app-update.js +2 -1
- package/dist/ui/shared/app.css +93 -8
- package/dist/ui/shared/app.js +16 -2
- package/dist/ui/shared/ui-states.js +6 -0
- package/dist/ui/shared/update-card-ui.js +178 -11
- package/dist/ui/shared/view-strings.js +18 -0
- package/dist/ui/shared/web-authorize.js +1 -1
- package/dist/update-card.d.ts +1 -1
- package/dist/update-card.js +7 -7
- package/dist/update-card.js.map +1 -1
- package/dist/update-fix.d.ts +66 -0
- package/dist/update-fix.js +67 -0
- package/dist/update-fix.js.map +1 -0
- package/dist/update-goback.js +12 -2
- package/dist/update-goback.js.map +1 -1
- package/dist/update-readiness.d.ts +2 -0
- package/dist/update-readiness.js +5 -1
- package/dist/update-readiness.js.map +1 -1
- package/dist/update-snapshot-scope.js +1 -0
- package/dist/update-snapshot-scope.js.map +1 -1
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +9 -0
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/providers.d.ts +3 -11
- package/dist/usage/providers.js +93 -131
- package/dist/usage/providers.js.map +1 -1
- package/dist/web-api.d.ts +4 -0
- package/dist/web-api.js +50 -7
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +2 -0
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-icons.d.ts +9 -3
- package/dist/web-icons.js +62 -5
- package/dist/web-icons.js.map +1 -1
- package/dist/web-update.d.ts +9 -0
- package/dist/windows-agents.d.ts +24 -2
- package/dist/windows-agents.js +110 -4
- package/dist/windows-agents.js.map +1 -1
- package/dist/windows-cli-worker.js +9 -1
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +15 -0
- package/dist/windows-cli.js +54 -6
- package/dist/windows-cli.js.map +1 -1
- package/package.json +1 -1
package/dist/usage/providers.js
CHANGED
|
@@ -29,7 +29,7 @@ import { loadFleetConfig } from "../config.js";
|
|
|
29
29
|
import { classicProfile, profileName, readClassicBindings } from "../classic-bindings.js";
|
|
30
30
|
import { CHAT_PROFILE_LOGIN_BACKENDS, credentialHomeSpec, credentialProfileHome, credentialProfileLogin, credentialProfileStoreHome, instanceCredentialProfile, isCredentialProfileName, } from "../backend/credential-profile.js";
|
|
31
31
|
import { claudeKeychainService } from "../backend/claude-code.js";
|
|
32
|
-
import {
|
|
32
|
+
import { readKiroUsageIdentity } from "../backend/kiro-auth-store.js";
|
|
33
33
|
import { homedir, userInfo } from "node:os";
|
|
34
34
|
import { antigravityCapKey, getProviderRateLimit } from "./provider-alerts.js";
|
|
35
35
|
import { MUSE_USAGE_STALE_MS, readMuseUsageSnapshot } from "../muse-usage-relay.js";
|
|
@@ -1378,177 +1378,139 @@ async function fetchGrokUsage() {
|
|
|
1378
1378
|
return { status: "ok", plan, metrics };
|
|
1379
1379
|
}
|
|
1380
1380
|
// ── Kiro (Amazon Q Developer) ────────────────────────────────────────────────
|
|
1381
|
-
//
|
|
1382
|
-
//
|
|
1383
|
-
//
|
|
1384
|
-
// Read-only: the CLI refreshes its own tokens.
|
|
1381
|
+
// Read-only GetUsageLimits, bound to the CLI's selected identity/profile.
|
|
1382
|
+
// Sign-in flow is not a subscription tier. The CLI owns token refresh; this
|
|
1383
|
+
// collector never starts a chat or refreshes a login. See docs/evidence/kiro-quota-m3863/.
|
|
1385
1384
|
const KIRO_TARGET = "AmazonCodeWhispererService.GetUsageLimits";
|
|
1386
1385
|
export function kiroAuthKind(token) {
|
|
1387
|
-
return typeof token.start_url === "string" && token.start_url.trim()
|
|
1388
|
-
? "q-developer-pro"
|
|
1389
|
-
: "builder-id";
|
|
1390
|
-
}
|
|
1391
|
-
/**
|
|
1392
|
-
* `notInstalled` means there is no kiro-cli data directory at all — the only
|
|
1393
|
-
* case where the provider should vanish from the panel. `missing` means kiro-cli
|
|
1394
|
-
* IS installed but no login we recognise is stored: a real state the user needs
|
|
1395
|
-
* to see, not a reason to hide the row.
|
|
1396
|
-
*
|
|
1397
|
-
* A credential profile can only ever be `missing`, never `notInstalled`: the
|
|
1398
|
-
* profile exists because the fleet configured it, so the CLI is demonstrably
|
|
1399
|
-
* here and the absent store means *this subscription* has never been logged in.
|
|
1400
|
-
* That is the one thing the user must see — running two subscriptions, the one
|
|
1401
|
-
* you still have to log into is precisely the row that must not disappear.
|
|
1402
|
-
*/
|
|
1403
|
-
function readKiroToken(storeHome) {
|
|
1404
|
-
// A credential profile keeps its own store; without one this is the shared
|
|
1405
|
-
// login, exactly as before.
|
|
1406
|
-
const home = storeHome ?? process.env.KIRO_CLI_HOME ?? join(homedir(), ".local", "share", "kiro-cli");
|
|
1407
|
-
const read = readKiroAuthTokens(home);
|
|
1408
|
-
if (read.kind === "no-store")
|
|
1409
|
-
return storeHome ? { missing: true } : { notInstalled: true };
|
|
1410
|
-
const candidates = read.tokens;
|
|
1411
|
-
if (candidates.length === 0)
|
|
1412
|
-
return { missing: true };
|
|
1413
|
-
// Switching login type leaves the old token behind, so "first key wins"
|
|
1414
|
-
// could report a stale account. Prefer a token that has not expired, then
|
|
1415
|
-
// the one that expires latest.
|
|
1416
|
-
const expiry = (t) => (t.expires_at ? new Date(t.expires_at).getTime() : 0);
|
|
1417
|
-
const now = Date.now();
|
|
1418
|
-
const live = candidates.filter(t => expiry(t) > now);
|
|
1419
|
-
const token = (live.length ? live : candidates).sort((a, b) => expiry(b) - expiry(a))[0];
|
|
1420
|
-
return { token, kind: kiroAuthKind(token) };
|
|
1386
|
+
return typeof token.start_url === "string" && token.start_url.trim() ? "identity-center" : "social";
|
|
1421
1387
|
}
|
|
1422
1388
|
function kiroTitleCase(s) {
|
|
1423
1389
|
return s.toLowerCase().replace(/(^|\s)\S/g, c => c.toUpperCase());
|
|
1424
1390
|
}
|
|
1425
1391
|
function kiroEpochIso(sec) {
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1392
|
+
if (typeof sec !== "number" || !Number.isFinite(sec) || sec < 1_000_000_000 || sec > 4_102_444_800)
|
|
1393
|
+
return null;
|
|
1394
|
+
const date = new Date(sec * 1000);
|
|
1395
|
+
return Number.isFinite(date.getTime()) ? date.toISOString() : null;
|
|
1429
1396
|
}
|
|
1430
|
-
|
|
1397
|
+
const KIRO_USAGE_ENDPOINTS = {
|
|
1398
|
+
"us-east-1": "https://codewhisperer.us-east-1.amazonaws.com/",
|
|
1399
|
+
"eu-central-1": "https://q.eu-central-1.amazonaws.com/",
|
|
1400
|
+
};
|
|
1401
|
+
/** Read-only quota lookup for the CLI-selected identity. No refresh or chat fallback. */
|
|
1431
1402
|
export async function fetchKiroUsage(storeHome) {
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1434
|
-
|
|
1403
|
+
const home = storeHome ?? process.env.KIRO_CLI_HOME ?? join(homedir(), ".local", "share", "kiro-cli");
|
|
1404
|
+
const identity = readKiroUsageIdentity(home);
|
|
1405
|
+
if (identity.kind === "no-store" && !storeHome) {
|
|
1435
1406
|
return { status: "no-credentials", hint: "Log in with the Kiro CLI (`kiro-cli`).", hintI18n: i18n("usage.hint.login_kiro"), metrics: [] };
|
|
1436
1407
|
}
|
|
1437
|
-
if (missing ||
|
|
1438
|
-
// Installed but no readable login. Previously indistinguishable from
|
|
1439
|
-
// not-installed, so the whole Kiro row vanished instead of saying this.
|
|
1408
|
+
if (identity.kind === "missing" || identity.kind === "no-store") {
|
|
1440
1409
|
return { status: "ok", plan: "Kiro", hint: "Signed out — run `kiro-cli` to log in.", hintI18n: i18n("usage.hint.kiro_signed_out"), metrics: [] };
|
|
1441
1410
|
}
|
|
1411
|
+
const unknown = (reason) => ({
|
|
1412
|
+
status: "ok", plan: "Kiro", metrics: [],
|
|
1413
|
+
hint: `Not measurable — ${reason} information is unavailable or ambiguous.`,
|
|
1414
|
+
hintI18n: i18n(`usage.hint.kiro_${reason}_unknown`),
|
|
1415
|
+
});
|
|
1416
|
+
if (identity.kind === "unknown")
|
|
1417
|
+
return unknown(identity.reason);
|
|
1418
|
+
const { token, profileArn } = identity;
|
|
1442
1419
|
const expiresAt = token.expires_at ? new Date(token.expires_at).getTime() : null;
|
|
1443
|
-
if (expiresAt && expiresAt
|
|
1444
|
-
// Not an error state: kiro-cli refreshes its own login on next use, and the
|
|
1445
|
-
// panel showing a red failure for a routine token rollover is just noise.
|
|
1446
|
-
// Still `ok` rather than no-credentials, so the row stays on screen with its
|
|
1447
|
-
// explanation instead of the provider silently disappearing.
|
|
1420
|
+
if (expiresAt !== null && (!Number.isFinite(expiresAt) || expiresAt <= Date.now())) {
|
|
1448
1421
|
return { status: "ok", plan: "Kiro", hint: "Token refreshing — try again in a moment.", hintI18n: i18n("usage.hint.token_refreshing"), metrics: [] };
|
|
1449
1422
|
}
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1464
|
-
|
|
1423
|
+
// Profile ARN is the runtime region, not the OIDC authentication region.
|
|
1424
|
+
let region = "us-east-1";
|
|
1425
|
+
if (profileArn !== undefined) {
|
|
1426
|
+
if (typeof profileArn !== "string")
|
|
1427
|
+
return unknown("profile");
|
|
1428
|
+
const parsed = /^arn:aws:codewhisperer:([a-z0-9-]+):[0-9]{12}:profile\/[A-Za-z0-9._-]+$/.exec(profileArn);
|
|
1429
|
+
if (!parsed)
|
|
1430
|
+
return unknown("profile");
|
|
1431
|
+
region = parsed[1];
|
|
1432
|
+
}
|
|
1433
|
+
else if (kiroAuthKind(token) === "identity-center")
|
|
1434
|
+
return unknown("profile");
|
|
1435
|
+
const endpoint = KIRO_USAGE_ENDPOINTS[region];
|
|
1436
|
+
if (!endpoint)
|
|
1437
|
+
return unknown("region");
|
|
1465
1438
|
let res;
|
|
1466
1439
|
try {
|
|
1467
|
-
res = await fetch(
|
|
1440
|
+
res = await fetch(endpoint, {
|
|
1468
1441
|
method: "POST",
|
|
1469
|
-
headers: {
|
|
1470
|
-
|
|
1471
|
-
"X-Amz-Target": KIRO_TARGET,
|
|
1472
|
-
Authorization: `Bearer ${token.access_token}`,
|
|
1473
|
-
},
|
|
1474
|
-
body: JSON.stringify(token.profile_arn ? { profileArn: token.profile_arn } : {}),
|
|
1442
|
+
headers: { "Content-Type": "application/x-amz-json-1.0", "X-Amz-Target": KIRO_TARGET, Authorization: `Bearer ${token.access_token}` },
|
|
1443
|
+
body: JSON.stringify(profileArn ? { profileArn } : {}),
|
|
1475
1444
|
signal: AbortSignal.timeout(LONGEST_SINGLE_FETCH_MS),
|
|
1476
1445
|
});
|
|
1477
1446
|
}
|
|
1478
1447
|
catch {
|
|
1479
|
-
return { status: "error", error: `Could not reach
|
|
1448
|
+
return { status: "error", error: `Could not reach ${new URL(endpoint).hostname}.`, errorI18n: i18n("usage.error.unreachable", new URL(endpoint).hostname), metrics: [] };
|
|
1480
1449
|
}
|
|
1481
|
-
if (res.status === 401
|
|
1482
|
-
return { status: "
|
|
1450
|
+
if (res.status === 401) {
|
|
1451
|
+
return { status: "ok", plan: "Kiro", hint: "Not measurable — login was rejected (HTTP 401). Run `kiro-cli` to sign in again.", hintI18n: i18n("usage.hint.kiro_unauthorized"), metrics: [] };
|
|
1452
|
+
}
|
|
1453
|
+
if (res.status === 403) {
|
|
1454
|
+
return { status: "ok", plan: "Kiro", hint: `Not measurable — usage access was rejected (HTTP ${res.status}).`, hintI18n: i18n("usage.hint.kiro_rejected", res.status), metrics: [] };
|
|
1483
1455
|
}
|
|
1484
1456
|
if (!res.ok)
|
|
1485
1457
|
return { status: "error", error: `Usage request failed (HTTP ${res.status}).`, errorI18n: i18n("usage.error.http", res.status), metrics: [] };
|
|
1486
1458
|
let body;
|
|
1487
1459
|
try {
|
|
1488
|
-
|
|
1460
|
+
const value = await res.json();
|
|
1461
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
1462
|
+
throw new Error("shape");
|
|
1463
|
+
body = value;
|
|
1489
1464
|
}
|
|
1490
1465
|
catch {
|
|
1491
1466
|
return { status: "error", error: "Invalid response from GetUsageLimits.", errorI18n: i18n("usage.error.invalid_kiro_response"), metrics: [] };
|
|
1492
1467
|
}
|
|
1493
|
-
const
|
|
1494
|
-
|
|
1495
|
-
: null;
|
|
1468
|
+
const title = body.subscriptionInfo?.subscriptionTitle;
|
|
1469
|
+
const plan = typeof title === "string" && title.trim() ? kiroTitleCase(title.trim()) : "Kiro";
|
|
1496
1470
|
const metrics = [];
|
|
1471
|
+
const finite = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
1472
|
+
let ambiguousBonus = false;
|
|
1497
1473
|
for (const ub of Array.isArray(body.usageBreakdownList) ? body.usageBreakdownList : []) {
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
const
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1474
|
+
if (!ub || typeof ub !== "object")
|
|
1475
|
+
continue;
|
|
1476
|
+
const displayName = typeof ub.displayNamePlural === "string" ? ub.displayNamePlural : typeof ub.displayName === "string" ? ub.displayName : ub.resourceType === "CREDIT" ? "Credits" : "Usage";
|
|
1477
|
+
const unit = displayName.toLowerCase();
|
|
1478
|
+
const reset = kiroEpochIso(ub.nextDateReset ?? body.nextDateReset);
|
|
1479
|
+
const addPool = (label, key, used, limit, expiry) => {
|
|
1480
|
+
if (!finite(used) || !finite(limit) || limit <= 0 || used > limit)
|
|
1481
|
+
return;
|
|
1482
|
+
metrics.push({ label, labelI18n: key === "usage.metric.named_monthly" ? i18n(key, displayName) : i18n(key), type: "percent", used: Math.min(100, used / limit * 100),
|
|
1483
|
+
resetsAt: expiry === undefined ? reset : expiry, ...(expiry === undefined ? { quotaPeriod: "monthly" } : { resetKind: "expiry" }),
|
|
1484
|
+
note: `${+used.toFixed(1)} / ${+limit.toFixed(1)} ${unit}`, noteI18n: i18n("usage.note.used_limit_unit", +used.toFixed(1), +limit.toFixed(1), unit) });
|
|
1485
|
+
};
|
|
1486
|
+
const used = ub.currentUsageWithPrecision ?? ub.currentUsage;
|
|
1487
|
+
const limit = ub.usageLimitWithPrecision ?? ub.usageLimit;
|
|
1488
|
+
const overage = ub.currentOveragesWithPrecision ?? ub.currentOverages ?? 0;
|
|
1489
|
+
const bonuses = Array.isArray(ub.bonuses) ? ub.bonuses.filter(bonus => bonus?.status === "ACTIVE") : [];
|
|
1490
|
+
// Active bonus spend is not separated from plan consumption. Historical
|
|
1491
|
+
// expired codes alone must not suppress the current monthly gauge forever.
|
|
1492
|
+
if (bonuses.length)
|
|
1493
|
+
ambiguousBonus = true;
|
|
1494
|
+
else if (finite(used) && finite(overage) && overage <= used) {
|
|
1495
|
+
addPool(`${displayName} (monthly)`, "usage.metric.named_monthly", used - overage, limit);
|
|
1515
1496
|
}
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
const bUsed = bonuses.reduce((s, b) => s + (b.currentUsage ?? 0), 0);
|
|
1520
|
-
const bLimit = bonuses.reduce((s, b) => s + (b.usageLimit ?? 0), 0);
|
|
1521
|
-
const expiries = bonuses.map(b => b.expiresAt).filter((e) => typeof e === "number" && e > 0);
|
|
1522
|
-
if (bLimit > 0) {
|
|
1523
|
-
metrics.push({
|
|
1524
|
-
label: "Bonus credits",
|
|
1525
|
-
labelI18n: i18n("usage.metric.bonus_credits"),
|
|
1526
|
-
type: "percent",
|
|
1527
|
-
used: Math.min(100, (bUsed / bLimit) * 100),
|
|
1528
|
-
// When the first code expires — the credits go, nothing refills.
|
|
1529
|
-
resetsAt: expiries.length ? kiroEpochIso(Math.min(...expiries)) : null,
|
|
1530
|
-
resetKind: "expiry",
|
|
1531
|
-
note: `${+bUsed.toFixed(1)} / ${+bLimit.toFixed(0)} ${unit} · ${bonuses.length} codes`,
|
|
1532
|
-
noteI18n: i18n("usage.note.bonus_codes", +bUsed.toFixed(1), +bLimit.toFixed(0), unit, bonuses.length),
|
|
1533
|
-
});
|
|
1534
|
-
}
|
|
1497
|
+
for (const bonus of bonuses) {
|
|
1498
|
+
if (bonus?.status === "ACTIVE")
|
|
1499
|
+
addPool("Bonus credits", "usage.metric.bonus_credits", bonus.currentUsageWithPrecision ?? bonus.currentUsage, bonus.usageLimitWithPrecision ?? bonus.usageLimit, kiroEpochIso(bonus.expiresAt));
|
|
1535
1500
|
}
|
|
1536
|
-
const
|
|
1537
|
-
if (
|
|
1501
|
+
const trial = ub.freeTrialInfo;
|
|
1502
|
+
if (trial?.freeTrialStatus === "ACTIVE")
|
|
1503
|
+
addPool("Trial credits", "usage.metric.kiro_trial", trial.currentUsageWithPrecision ?? trial.currentUsage, trial.usageLimitWithPrecision ?? trial.usageLimit, kiroEpochIso(trial.freeTrialExpiry));
|
|
1504
|
+
addPool("Overage credits", "usage.metric.kiro_overage", overage, ub.overageCapWithPrecision ?? ub.overageCap);
|
|
1505
|
+
if (finite(overage) && overage > 0 && finite(ub.overageCharges))
|
|
1538
1506
|
metrics.push({ label: "Overage charges", labelI18n: i18n("usage.metric.overage_charges"), type: "dollars", used: ub.overageCharges });
|
|
1539
|
-
}
|
|
1540
1507
|
}
|
|
1508
|
+
if (metrics.length === 0)
|
|
1509
|
+
return { ...unknown("quota"), plan };
|
|
1541
1510
|
const overageStatus = body.overageConfiguration?.overageStatus;
|
|
1542
|
-
if (typeof overageStatus === "string")
|
|
1511
|
+
if (typeof overageStatus === "string")
|
|
1543
1512
|
metrics.push({ label: "Pay-per-use", labelI18n: i18n("usage.metric.pay_per_use"), type: "text", value: kiroTitleCase(overageStatus.replace(/_/g, " ")) });
|
|
1544
|
-
}
|
|
1545
|
-
if (metrics.length === 0) {
|
|
1546
|
-
// Amazon Q logins whose account type reports no credit buckets (#398's
|
|
1547
|
-
// sibling case): an OK answer with nothing in it must say so, not render an
|
|
1548
|
-
// empty row that reads like a failure.
|
|
1549
|
-
return { status: "ok", plan: plan ?? "Amazon Q", hint: "No quota information available for this account type.", hintI18n: i18n("usage.hint.no_quota_account"), metrics: [] };
|
|
1550
|
-
}
|
|
1551
|
-
return { status: "ok", plan, metrics };
|
|
1513
|
+
return ambiguousBonus ? { ...unknown("bonus"), plan, metrics } : { status: "ok", plan, metrics };
|
|
1552
1514
|
}
|
|
1553
1515
|
/** How each provider's usage is read (behaviour, keyed by the provider id the registry gives each CLI: cli-registry.ts `host.usage.providerId`). */
|
|
1554
1516
|
const USAGE_FETCHERS = {
|