@songsid/agend 2.4.0-beta.7 → 2.4.0-beta.9
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/auth-api.js +4 -0
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/antigravity.d.ts +9 -2
- package/dist/backend/antigravity.js +24 -6
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/cli-env-probe.js +1 -1
- package/dist/backend/cli-env-probe.js.map +1 -1
- package/dist/backend/cli-runtime-switch.js +1 -26
- package/dist/backend/cli-runtime-switch.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/connect/mcp.d.ts +9 -0
- package/dist/connect/mcp.js +10 -0
- package/dist/connect/mcp.js.map +1 -0
- package/dist/connect/stdio.d.ts +1 -1
- package/dist/connect/stdio.js +22 -28
- package/dist/connect/stdio.js.map +1 -1
- package/dist/daemon.d.ts +13 -0
- package/dist/daemon.js +64 -1
- package/dist/daemon.js.map +1 -1
- package/dist/dispatcher-liveness.d.ts +51 -1
- package/dist/dispatcher-liveness.js +92 -2
- package/dist/dispatcher-liveness.js.map +1 -1
- package/dist/fleet-manager.d.ts +56 -1
- package/dist/fleet-manager.js +243 -32
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +83 -3
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +10 -2
- package/dist/hub/admin-dashboard.js +17 -1
- package/dist/hub/admin-dashboard.js.map +1 -1
- package/dist/hub/audit/index.d.ts +2 -0
- package/dist/hub/audit/index.js +8 -0
- package/dist/hub/audit/index.js.map +1 -1
- package/dist/hub/buttons.js +3 -1
- package/dist/hub/buttons.js.map +1 -1
- package/dist/hub/catalog.d.ts +7 -4
- package/dist/hub/catalog.js +19 -10
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.d.ts +3 -0
- package/dist/hub/client.js +14 -2
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.js +28 -11
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +5 -0
- package/dist/hub/compose/server.js +91 -10
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/group-policy/admin-api.d.ts +1 -0
- package/dist/hub/group-policy/admin-api.js +1 -1
- package/dist/hub/group-policy/admin-api.js.map +1 -1
- package/dist/hub/group-policy/admin-dto.d.ts +2 -1
- package/dist/hub/group-policy/admin-impact.d.ts +32 -3
- package/dist/hub/group-policy/admin-impact.js +14 -2
- package/dist/hub/group-policy/admin-impact.js.map +1 -1
- package/dist/hub/group-policy/admin-inventory.d.ts +2 -0
- package/dist/hub/group-policy/admin-inventory.js +13 -4
- package/dist/hub/group-policy/admin-inventory.js.map +1 -1
- package/dist/hub/group-policy/authorization.d.ts +2 -0
- package/dist/hub/group-policy/authorization.js +7 -2
- package/dist/hub/group-policy/authorization.js.map +1 -1
- package/dist/hub/group-policy/impact-inventory.d.ts +1 -1
- package/dist/hub/group-policy/impact-inventory.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +2 -0
- package/dist/hub/group-policy/resources.js +12 -1
- package/dist/hub/group-policy/resources.js.map +1 -1
- package/dist/hub/http/compose.js +164 -23
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.js +27 -0
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +12 -0
- package/dist/hub/http/schema.js +6 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/join/service.d.ts +1 -1
- package/dist/hub/join/service.js.map +1 -1
- package/dist/hub/mcp/auth-schema.d.ts +7 -0
- package/dist/hub/mcp/auth-schema.js +31 -0
- package/dist/hub/mcp/auth-schema.js.map +1 -0
- package/dist/hub/mcp/auth.d.ts +89 -0
- package/dist/hub/mcp/auth.js +374 -0
- package/dist/hub/mcp/auth.js.map +1 -0
- package/dist/hub/mcp/catalog.d.ts +44 -0
- package/dist/hub/mcp/catalog.js +31 -0
- package/dist/hub/mcp/catalog.js.map +1 -0
- package/dist/hub/mcp/door-schema.d.ts +7 -0
- package/dist/hub/mcp/door-schema.js +20 -0
- package/dist/hub/mcp/door-schema.js.map +1 -0
- package/dist/hub/mcp/http.d.ts +25 -0
- package/dist/hub/mcp/http.js +259 -0
- package/dist/hub/mcp/http.js.map +1 -0
- package/dist/hub/mcp/policy.d.ts +65 -0
- package/dist/hub/mcp/policy.js +153 -0
- package/dist/hub/mcp/policy.js.map +1 -0
- package/dist/hub/mcp/server.d.ts +3 -0
- package/dist/hub/mcp/server.js +32 -0
- package/dist/hub/mcp/server.js.map +1 -0
- package/dist/hub/mcp/tools.d.ts +31 -0
- package/dist/hub/mcp/tools.js +176 -0
- package/dist/hub/mcp/tools.js.map +1 -0
- package/dist/hub/member/room-ask.d.ts +4 -4
- package/dist/hub/member/room-ask.js +12 -0
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-mention-feedback.d.ts +44 -0
- package/dist/hub/member/room-mention-feedback.js +121 -0
- package/dist/hub/member/room-mention-feedback.js.map +1 -0
- package/dist/hub/member/room-notification.d.ts +9 -0
- package/dist/hub/member/room-notification.js +2 -0
- package/dist/hub/member/room-notification.js.map +1 -0
- package/dist/hub/member/room-post-answers.d.ts +1 -7
- package/dist/hub/member/room-post-answers.js.map +1 -1
- package/dist/hub/member/room-post.d.ts +3 -0
- package/dist/hub/member/room-post.js +9 -1
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/pairing.d.ts +15 -1
- package/dist/hub/pairing.js +33 -2
- package/dist/hub/pairing.js.map +1 -1
- package/dist/hub/personal/owner-host.d.ts +140 -0
- package/dist/hub/personal/owner-host.js +287 -0
- package/dist/hub/personal/owner-host.js.map +1 -0
- package/dist/hub/personal/refusals.d.ts +11 -0
- package/dist/hub/personal/refusals.js +33 -0
- package/dist/hub/personal/refusals.js.map +1 -0
- package/dist/hub/personal/runtime-host.d.ts +26 -0
- package/dist/hub/personal/runtime-host.js +51 -0
- package/dist/hub/personal/runtime-host.js.map +1 -0
- package/dist/hub/personal/schema.d.ts +4 -0
- package/dist/hub/personal/schema.js +54 -0
- package/dist/hub/personal/schema.js.map +1 -0
- package/dist/hub/personal/turns.d.ts +39 -0
- package/dist/hub/personal/turns.js +221 -0
- package/dist/hub/personal/turns.js.map +1 -0
- package/dist/hub/personal/types.d.ts +42 -0
- package/dist/hub/personal/types.js +2 -0
- package/dist/hub/personal/types.js.map +1 -0
- package/dist/hub/policy.d.ts +1 -1
- package/dist/hub/policy.js +2 -0
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/protocol.d.ts +43 -0
- package/dist/hub/protocol.js +16 -4
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/quota.js +3 -1
- package/dist/hub/quota.js.map +1 -1
- package/dist/hub/roles/admin-control.d.ts +29 -0
- package/dist/hub/roles/admin-control.js +187 -0
- package/dist/hub/roles/admin-control.js.map +1 -0
- package/dist/hub/roles/admin-types.d.ts +72 -0
- package/dist/hub/roles/admin-types.js +2 -0
- package/dist/hub/roles/admin-types.js.map +1 -0
- package/dist/hub/roles/allowed-list-control.d.ts +34 -0
- package/dist/hub/roles/allowed-list-control.js +179 -0
- package/dist/hub/roles/allowed-list-control.js.map +1 -0
- package/dist/hub/roles/allowed-list.d.ts +8 -0
- package/dist/hub/roles/allowed-list.js +49 -0
- package/dist/hub/roles/allowed-list.js.map +1 -0
- package/dist/hub/roles/audit-details.d.ts +144 -0
- package/dist/hub/roles/audit-details.js +26 -0
- package/dist/hub/roles/audit-details.js.map +1 -0
- package/dist/hub/roles/authority.d.ts +12 -0
- package/dist/hub/roles/authority.js +39 -3
- package/dist/hub/roles/authority.js.map +1 -1
- package/dist/hub/roles/change.d.ts +3 -1
- package/dist/hub/roles/change.js +4 -3
- package/dist/hub/roles/change.js.map +1 -1
- package/dist/hub/roles/clock.d.ts +3 -0
- package/dist/hub/roles/clock.js +1 -1
- package/dist/hub/roles/clock.js.map +1 -1
- package/dist/hub/roles/cutover-inventory.d.ts +2 -0
- package/dist/hub/roles/cutover-inventory.js +8 -1
- package/dist/hub/roles/cutover-inventory.js.map +1 -1
- package/dist/hub/roles/cutover.d.ts +2 -2
- package/dist/hub/roles/cutover.js +3 -4
- package/dist/hub/roles/cutover.js.map +1 -1
- package/dist/hub/roles/delegation.d.ts +4 -1
- package/dist/hub/roles/delegation.js +3 -2
- package/dist/hub/roles/delegation.js.map +1 -1
- package/dist/hub/roles/expiry-effects.d.ts +8 -0
- package/dist/hub/roles/expiry-effects.js +50 -0
- package/dist/hub/roles/expiry-effects.js.map +1 -0
- package/dist/hub/roles/migrations.d.ts +7 -0
- package/dist/hub/roles/migrations.js +44 -0
- package/dist/hub/roles/migrations.js.map +1 -0
- package/dist/hub/roles/model.d.ts +2 -0
- package/dist/hub/roles/model.js +2 -1
- package/dist/hub/roles/model.js.map +1 -1
- package/dist/hub/roles/overview.d.ts +8 -0
- package/dist/hub/roles/overview.js +15 -0
- package/dist/hub/roles/overview.js.map +1 -0
- package/dist/hub/roles/resource-effects.d.ts +17 -0
- package/dist/hub/roles/resource-effects.js +62 -0
- package/dist/hub/roles/resource-effects.js.map +1 -0
- package/dist/hub/roles/review.d.ts +16 -0
- package/dist/hub/roles/review.js +42 -0
- package/dist/hub/roles/review.js.map +1 -0
- package/dist/hub/roles/writer.d.ts +14 -3
- package/dist/hub/roles/writer.js +64 -16
- package/dist/hub/roles/writer.js.map +1 -1
- package/dist/hub/room-mention-feedback-model.d.ts +12 -0
- package/dist/hub/room-mention-feedback-model.js +12 -0
- package/dist/hub/room-mention-feedback-model.js.map +1 -0
- package/dist/hub/rooms/agents.d.ts +3 -1
- package/dist/hub/rooms/agents.js +96 -11
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/direct-view.d.ts +6 -2
- package/dist/hub/rooms/direct-view.js +3 -3
- package/dist/hub/rooms/direct-view.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +27 -3
- package/dist/hub/rooms/service.js +74 -13
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +3 -1
- package/dist/hub/rooms.d.ts +12 -2
- package/dist/hub/rooms.js +87 -17
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.js +1 -1
- package/dist/hub/runtime.js.map +1 -1
- package/dist/hub/server.d.ts +2 -0
- package/dist/hub/server.js +19 -3
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/session-directory-transition.d.ts +2 -1
- package/dist/hub/session-directory-transition.js +10 -3
- package/dist/hub/session-directory-transition.js.map +1 -1
- package/dist/hub/sessions.d.ts +1 -1
- package/dist/hub/sessions.js +26 -4
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/settings-commit.d.ts +32 -1
- package/dist/hub/settings-commit.js +11 -4
- package/dist/hub/settings-commit.js.map +1 -1
- package/dist/hub/settings-directory-ca.js +1 -1
- package/dist/hub/settings-directory-ca.js.map +1 -1
- package/dist/hub/settings-directory-control.js +7 -7
- package/dist/hub/settings-directory-control.js.map +1 -1
- package/dist/hub/settings-directory-http.d.ts +2 -0
- package/dist/hub/settings-directory-http.js +21 -6
- package/dist/hub/settings-directory-http.js.map +1 -1
- package/dist/hub/settings-directory-proof.d.ts +5 -1
- package/dist/hub/settings-directory-proof.js +27 -9
- package/dist/hub/settings-directory-proof.js.map +1 -1
- package/dist/hub/settings-directory-recovery.js +2 -1
- package/dist/hub/settings-directory-recovery.js.map +1 -1
- package/dist/hub/settings-directory-save.d.ts +2 -0
- package/dist/hub/settings-directory-save.js +9 -6
- package/dist/hub/settings-directory-save.js.map +1 -1
- package/dist/hub/sharing.js +2 -2
- package/dist/hub/sharing.js.map +1 -1
- package/dist/hub/types.d.ts +26 -3
- package/dist/locale.js +13 -10
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +19 -2
- package/dist/login-controller.js +26 -8
- package/dist/login-controller.js.map +1 -1
- package/dist/native-model-catalog.d.ts +15 -0
- package/dist/native-model-catalog.js +43 -3
- package/dist/native-model-catalog.js.map +1 -1
- package/dist/runtime-build-info.js +1 -0
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli.js +31 -5
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client-store.d.ts +5 -0
- package/dist/runtime-client-store.js +28 -0
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.d.ts +4 -0
- package/dist/runtime-client.js +33 -10
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +4 -2
- package/dist/runtime-coordinator.js +33 -6
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-install.d.ts +6 -1
- package/dist/runtime-install.js +12 -4
- package/dist/runtime-install.js.map +1 -1
- package/dist/runtime-personal-answer-only-probe.d.ts +3 -0
- package/dist/runtime-personal-answer-only-probe.js +134 -0
- package/dist/runtime-personal-answer-only-probe.js.map +1 -0
- package/dist/runtime-personal-answer-only.d.ts +16 -0
- package/dist/runtime-personal-answer-only.js +54 -0
- package/dist/runtime-personal-answer-only.js.map +1 -0
- package/dist/runtime-personal-answer.d.ts +7 -2
- package/dist/runtime-personal-answer.js +12 -3
- package/dist/runtime-personal-answer.js.map +1 -1
- package/dist/runtime-personal-preflight.d.ts +8 -0
- package/dist/runtime-personal-preflight.js +103 -0
- package/dist/runtime-personal-preflight.js.map +1 -0
- package/dist/runtime-personal-profile.d.ts +7 -1
- package/dist/runtime-personal-profile.js +24 -4
- package/dist/runtime-personal-profile.js.map +1 -1
- package/dist/runtime-personal-protocol.d.ts +10 -0
- package/dist/runtime-personal-protocol.js +15 -0
- package/dist/runtime-personal-protocol.js.map +1 -0
- package/dist/runtime-personal-stage.d.ts +37 -0
- package/dist/runtime-personal-stage.js +167 -0
- package/dist/runtime-personal-stage.js.map +1 -0
- package/dist/runtime-protocol.d.ts +2 -0
- package/dist/setup-form.js +10 -0
- package/dist/setup-form.js.map +1 -1
- package/dist/tunnel/lease.d.ts +14 -0
- package/dist/tunnel/lease.js +23 -0
- package/dist/tunnel/lease.js.map +1 -1
- package/dist/ui/backend-signin.js +86 -20
- package/dist/ui/chat-activity-groups.js +41 -8
- package/dist/ui/chat-activity.js +3 -1
- package/dist/ui/chat-store.js +39 -2
- package/dist/ui/chat-tour.js +1 -1
- package/dist/ui/fleet-canvas.js +10 -5
- package/dist/ui/fleet-office.js +73 -7
- package/dist/ui/hub-ai-apps-strings.js +6 -0
- package/dist/ui/hub-ai-apps.js +83 -0
- package/dist/ui/hub-client.js +32 -1
- package/dist/ui/hub-directory-editor-strings.js +2 -2
- package/dist/ui/hub-directory-editor.js +1 -0
- package/dist/ui/hub-group-policy.js +4 -3
- package/dist/ui/hub-group-strings.js +2 -2
- package/dist/ui/hub-personal-agent-strings.js +160 -0
- package/dist/ui/hub-personal-agent.js +94 -0
- package/dist/ui/hub-role-audit.js +39 -0
- package/dist/ui/hub-role-forms.js +99 -0
- package/dist/ui/hub-role-notices.js +11 -0
- package/dist/ui/hub-role-view.js +86 -0
- package/dist/ui/hub-roles-strings.js +439 -0
- package/dist/ui/hub-roles.js +83 -0
- package/dist/ui/hub-room-composer.js +3 -2
- package/dist/ui/hub-room-list.js +4 -3
- package/dist/ui/hub-room-members.js +4 -2
- package/dist/ui/hub-room-settings.js +6 -0
- package/dist/ui/hub-room-source-strings.js +17 -0
- package/dist/ui/hub-room-source.js +34 -0
- package/dist/ui/hub-room-thread.js +10 -4
- package/dist/ui/hub-switcher.js +2 -2
- package/dist/ui/hub-this-hub.js +2 -2
- package/dist/ui/model-picker.js +4 -1
- package/dist/ui/panel-chat.js +4 -4
- package/dist/ui/panel-fleet.js +3 -3
- package/dist/ui/panel-hub.js +51 -31
- package/dist/ui/panel-settings.js +2 -3
- package/dist/ui/runtime-commands.d.ts +2 -2
- package/dist/ui/runtime-commands.js +7 -4
- package/dist/ui/settings-build-version.js +2 -2
- package/dist/ui/settings-catalog.js +22 -0
- package/dist/ui/settings-hub-setup.js +2 -1
- package/dist/ui/settings-strings.js +2 -0
- package/dist/ui/shared/access-overview.css +1 -1
- package/dist/ui/shared/accounts-keepalive.css +1 -1
- package/dist/ui/shared/accounts.css +1 -1
- package/dist/ui/shared/agent-sheet.js +2 -2
- package/dist/ui/shared/app-prefs.js +5 -2
- package/dist/ui/shared/app-shell.js +20 -8
- package/dist/ui/shared/app-stream.js +3 -1
- package/dist/ui/shared/app-swipe.js +3 -1
- package/dist/ui/shared/app.css +142 -48
- package/dist/ui/shared/app.js +1 -1
- package/dist/ui/shared/chat-thread.js +5 -1
- package/dist/ui/shared/chat-work-bar.css +5 -5
- package/dist/ui/shared/connector-prompt.d.ts +1 -0
- package/dist/ui/shared/connector-prompt.js +10 -0
- package/dist/ui/shared/hub-ai-apps.css +12 -0
- package/dist/ui/shared/hub-chat.css +9 -2
- package/dist/ui/shared/hub-groups.css +1 -1
- package/dist/ui/shared/hub-owner.css +5 -5
- package/dist/ui/shared/hub-roles.css +99 -0
- package/dist/ui/shared/hub-rooms-u2.css +14 -0
- package/dist/ui/shared/hub.css +13 -5
- package/dist/ui/shared/instance-nav.js +24 -9
- package/dist/ui/shared/loading.css +1 -1
- package/dist/ui/shared/model-picker.css +2 -2
- package/dist/ui/shared/preview-panel-actions.js +1 -1
- package/dist/ui/shared/preview-panel.js +2 -2
- package/dist/ui/shared/signin.js +27 -12
- package/dist/ui/shared/task-board.css +2 -2
- package/dist/ui/shared/tokens.css +1 -1
- package/dist/ui/shared/ui-toast.js +4 -4
- package/dist/ui/shared/usage-dialog.js +110 -16
- package/dist/ui/shared/view-strings.js +8 -0
- package/dist/ui/signin.html +4 -2
- package/dist/ui/structured-signin.js +64 -12
- package/dist/ui/web-terminal/terminal.css +1 -1
- package/dist/web-api.d.ts +4 -0
- package/dist/web-api.js +39 -23
- package/dist/web-api.js.map +1 -1
- package/dist/web-backend-login.d.ts +5 -1
- package/dist/web-backend-login.js +8 -2
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-prefs.js +2 -0
- package/dist/web-prefs.js.map +1 -1
- package/dist/windows-cli-worker.d.ts +10 -0
- package/dist/windows-cli-worker.js +109 -14
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +10 -1
- package/dist/windows-cli.js +47 -13
- package/dist/windows-cli.js.map +1 -1
- package/package.json +1 -1
- package/templates/runtime-install/install.ps1 +24 -4
package/dist/fleet-manager.js
CHANGED
|
@@ -135,7 +135,7 @@ import { routeToolCall } from "./channel/tool-router.js";
|
|
|
135
135
|
import { Scheduler } from "./scheduler/index.js";
|
|
136
136
|
import { boardActivity, boardCardLimit, boardToolAction } from "./task-board-tool.js";
|
|
137
137
|
import { TaskBoardWaker, namesCard } from "./task-board-waker.js";
|
|
138
|
-
import { DispatcherLiveness, LIVENESS_STARTUP_GRACE_MS, livenessSettings } from "./dispatcher-liveness.js";
|
|
138
|
+
import { DispatcherLiveness, LIVENESS_STARTUP_GRACE_MS, livenessSettings, questionNotices, turnQuestion } from "./dispatcher-liveness.js";
|
|
139
139
|
import { TaskBoardError, waitsForPerson, wrapUpGap } from "./scheduler/task-board.js";
|
|
140
140
|
import { escapeTelegramHtml, scheduleClock, scheduleRetryLabel } from "./scheduler/retry-label.js";
|
|
141
141
|
import { DEFAULT_SCHEDULER_CONFIG } from "./scheduler/index.js";
|
|
@@ -229,7 +229,7 @@ import { RuntimeWindowsBridge } from "./runtime-windows-bridge.js";
|
|
|
229
229
|
import { FleetWindowsRuntime } from "./fleet-windows-runtime.js";
|
|
230
230
|
import { NativeMcpSessions } from "./native-mcp.js";
|
|
231
231
|
import { nativeProviderMcpSupported } from "./windows-cli-providers.js";
|
|
232
|
-
import { cachedNativeModelCatalog } from "./native-model-catalog.js";
|
|
232
|
+
import { cachedNativeModelCatalog, refreshNativeModelCatalogAfterSignIn } from "./native-model-catalog.js";
|
|
233
233
|
import { shapeWebModelCatalog } from "./web-model-groups.js";
|
|
234
234
|
import { isWindowsInstance, isNativePaneInstance, isNativeExecInstance, WINDOWS_CONFIG_REFUSED, nativeCredentialProfile } from "./native-instance-registry.js";
|
|
235
235
|
import { createNativeWindowsInstance, updateNativeWindowsInstance } from "./native-instance-api.js";
|
|
@@ -329,7 +329,7 @@ import { TargetQueueWorker } from "./target-queue-worker.js";
|
|
|
329
329
|
import { resolveDeliveryWorkerMode } from "./types.js";
|
|
330
330
|
import { isFleetStartCommandLine, readProcessCommandLine, releaseProcessFleetLock } from "./fleet-lock.js";
|
|
331
331
|
import { isSetupComplete, markSetupComplete } from "./setup-marker.js";
|
|
332
|
-
import {
|
|
332
|
+
import { reapLeftoverTunnels } from "./tunnel/lease.js";
|
|
333
333
|
import { buildToolPermissionsNotice } from "./tool-permissions-notice.js";
|
|
334
334
|
import { NeedsYouHub } from "./needs-you-hub.js";
|
|
335
335
|
import { SignInKeepAlive, isKeepAliveBackend } from "./signin-keepalive.js";
|
|
@@ -693,6 +693,13 @@ const NONCE_RETIRE_BUDGET_MS = 5_000;
|
|
|
693
693
|
* so nothing re-probed and `/model` kept serving a list up to 24h old.
|
|
694
694
|
*/
|
|
695
695
|
const CLI_ENV_FRESH_MS = 60 * 60 * 1000;
|
|
696
|
+
/**
|
|
697
|
+
* How long a menu that opens on an empty model list waits for its one discovery, and how long an attempt that
|
|
698
|
+
* found nothing (a CLI not signed in, offline) is not repeated by the next open. Shorter than CLI_ENV_PROBE_DEADLINE_MS: a
|
|
699
|
+
* slower probe finishes behind the menu and the page reads again (the `models` event).
|
|
700
|
+
*/
|
|
701
|
+
const MODEL_OPEN_PROBE_WAIT_MS = 12_000;
|
|
702
|
+
const MODEL_OPEN_PROBE_COOLDOWN_MS = 60_000;
|
|
696
703
|
/**
|
|
697
704
|
* Upper bound on a live probe driven by `/model`.
|
|
698
705
|
*
|
|
@@ -2549,7 +2556,7 @@ export class FleetManager {
|
|
|
2549
2556
|
roomToolsChanged: () => this.notifyHubRoomTools(),
|
|
2550
2557
|
roomConversationGeneration: agent => this.daemons.get(agent)?.roomConversationGeneration() ?? null,
|
|
2551
2558
|
attachRoomInputs: handler => { this.hubRoomInput = handler; },
|
|
2552
|
-
roomNotify: input => this.
|
|
2559
|
+
roomNotify: input => this.deliverHubRoomNotification(input),
|
|
2553
2560
|
roomReceipt: (caller, receiptId) => verifyRoomReceipt({
|
|
2554
2561
|
lookup: (agent, id) => {
|
|
2555
2562
|
const item = this.queryDurableDeliveryStatus(agent, { messageId: id }).items[0];
|
|
@@ -2891,14 +2898,15 @@ export class FleetManager {
|
|
|
2891
2898
|
} });
|
|
2892
2899
|
return result !== false;
|
|
2893
2900
|
}
|
|
2894
|
-
async
|
|
2901
|
+
async deliverHubRoomNotification(input) {
|
|
2895
2902
|
const { HUB_REPORT_TARGET } = await import("./hub/representative.js");
|
|
2896
2903
|
if (this.shuttingDown || !this.fleetConfig?.instances[input.agent] || isNativeExecInstance(this.fleetConfig.instances[input.agent]))
|
|
2897
2904
|
return false;
|
|
2905
|
+
const prefix = input.kind === "mention-feedback" ? "hub-room-mention-feedback" : "hub-room-post-answer";
|
|
2898
2906
|
const result = await this.deliverToInstance(input.agent, { type: "fleet_inbound", targetSession: input.agent, content: input.text,
|
|
2899
|
-
meta: { chat_id: "", message_id:
|
|
2900
|
-
ts: new Date().toISOString(), thread_id: "", from_instance: HUB_REPORT_TARGET, from_display: "Hub", correlation_id:
|
|
2901
|
-
request_kind: "notification", requires_reply: "false", task_summary: "A reply to your Hub room post" } }, { isCrossInstance: true, stillCurrent: input.stillCurrent, beforeInput: input.beforeInput });
|
|
2907
|
+
meta: { chat_id: "", message_id: `${prefix}-${input.id}`, user: `instance:${HUB_REPORT_TARGET}`, user_id: `instance:${HUB_REPORT_TARGET}`,
|
|
2908
|
+
ts: new Date().toISOString(), thread_id: "", from_instance: HUB_REPORT_TARGET, from_display: "Hub", correlation_id: `${prefix}-${input.id}`,
|
|
2909
|
+
request_kind: "notification", requires_reply: "false", task_summary: input.kind === "mention-feedback" ? "Hub mention delivery feedback" : "A reply to your Hub room post" } }, { isCrossInstance: true, stillCurrent: input.stillCurrent, beforeInput: input.beforeInput });
|
|
2902
2910
|
return result !== false;
|
|
2903
2911
|
}
|
|
2904
2912
|
/** S-51: why the Hub (or this fleet's Hub membership) is not running, if it is held. Empty while off or running. */
|
|
@@ -3137,6 +3145,8 @@ export class FleetManager {
|
|
|
3137
3145
|
livenessGone = new Map();
|
|
3138
3146
|
/** #3647: when each instance last showed working (after the startup grace): activity for "quiet". */
|
|
3139
3147
|
lastWorkingAt = new Map();
|
|
3148
|
+
/** M-3239: the instances whose progress is read from their transcript (see cacheInstanceExecutionState). */
|
|
3149
|
+
livenessTurnEvidence = new Set();
|
|
3140
3150
|
dispatcherLiveness = null;
|
|
3141
3151
|
/** Adapters whose last slash command registration failed and General was told (#1131). */
|
|
3142
3152
|
slashRegistrationFailed = new Set();
|
|
@@ -5808,6 +5818,39 @@ export class FleetManager {
|
|
|
5808
5818
|
claimedAt: Math.max(ms(board.lastChangeAt(c.uuid)), ms(c.startedAt)), updatedAt: ms(c.updatedAt),
|
|
5809
5819
|
}));
|
|
5810
5820
|
}
|
|
5821
|
+
/**
|
|
5822
|
+
* M-3239: a tool call or an answer in the agent's transcript. Unlike the pane's spinner it counts from the fleet's start
|
|
5823
|
+
* (the boot shows working; a transcript line is real work, and the monitor starts at the transcript's end).
|
|
5824
|
+
*/
|
|
5825
|
+
noteTurnActivity(name, at) {
|
|
5826
|
+
if (!Number.isFinite(at) || at > Date.now() + 60_000 || at < this.startedAt)
|
|
5827
|
+
return;
|
|
5828
|
+
if (at > (this.lastWorkingAt.get(name) ?? 0))
|
|
5829
|
+
this.lastWorkingAt.set(name, at);
|
|
5830
|
+
}
|
|
5831
|
+
/**
|
|
5832
|
+
* M-3239: an agent ended a turn without messaging anyone. If its final text asks a question and it holds a card
|
|
5833
|
+
* another agent handed it, that dispatcher is told, quoting the question — otherwise the question sits on the agent's
|
|
5834
|
+
* own screen and the card stalls (a beta.7 rehearsal waited 1.5 h on one).
|
|
5835
|
+
*/
|
|
5836
|
+
onTurnEndedQuietly(name, startedAt, text) {
|
|
5837
|
+
if (this.shuttingDown || this.isPlannedRestart() || !livenessSettings(this.fleetConfig).enabled)
|
|
5838
|
+
return;
|
|
5839
|
+
const question = turnQuestion(text);
|
|
5840
|
+
if (!question)
|
|
5841
|
+
return;
|
|
5842
|
+
const outbox = this.deliveryOutbox;
|
|
5843
|
+
if (!outbox?.isOpen)
|
|
5844
|
+
return;
|
|
5845
|
+
const sent = outbox.latestSentAt(name);
|
|
5846
|
+
if (sent !== null && sent >= startedAt)
|
|
5847
|
+
return; // it did tell someone during the turn
|
|
5848
|
+
const isAgent = (d) => (this.fleetConfig?.instances?.[d] != null || this.isClassicInstance(d)) && !taskBoardOffIn(this.fleetConfig, d);
|
|
5849
|
+
for (const n of questionNotices(this.livenessCards(), name, question, startedAt, isAgent)) {
|
|
5850
|
+
this.admitTaskBoardNotice(n.dispatcher, n.message, n.key);
|
|
5851
|
+
this.logger.info({ assignee: name, dispatcher: n.dispatcher }, "Dispatcher told: assignee ended its turn on a question it sent no one");
|
|
5852
|
+
}
|
|
5853
|
+
}
|
|
5811
5854
|
/** #3647: what the fleet knows about an assignee now; null when it is not an instance here. */
|
|
5812
5855
|
livenessFacts(name) {
|
|
5813
5856
|
if (this.fleetConfig?.instances?.[name] == null)
|
|
@@ -5837,6 +5880,9 @@ export class FleetManager {
|
|
|
5837
5880
|
usageHold: this.daemons.get(name)?.usageHold?.() ?? null,
|
|
5838
5881
|
execution: exec ? { state: exec.state, since: exec.stateChangedAt } : null,
|
|
5839
5882
|
lastWorkingAt: this.lastWorkingAt.get(name) ?? null,
|
|
5883
|
+
turnEvidence: this.livenessTurnEvidence.has(name),
|
|
5884
|
+
// M-3239 (Fable F1): a restart forgets the transcript's progress; its quiet clock starts no earlier than the fleet.
|
|
5885
|
+
quietFloor: this.livenessTurnEvidence.has(name) ? this.startedAt : null,
|
|
5840
5886
|
prompt: p.state === "awaiting_input" && p.interaction?.since ? { since: p.interaction.since } : null,
|
|
5841
5887
|
waitingOn,
|
|
5842
5888
|
// Asked only when it could be quiet (one indexed read per idle assignee).
|
|
@@ -6435,16 +6481,9 @@ export class FleetManager {
|
|
|
6435
6481
|
this.tightenInstanceDirectories();
|
|
6436
6482
|
// #1723: the public link's preview tunnel keeps its own lease beside it; a leftover one is reaped the same way (and
|
|
6437
6483
|
// #2636's Office share tunnel's).
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
if (outcome.kind === "manual")
|
|
6442
|
-
this.logger.warn({ tunnel: outcome }, manualCleanupMessage(outcome));
|
|
6443
|
-
else if (outcome.kind === "reaped")
|
|
6444
|
-
this.logger.info({ how: outcome.how, pid: outcome.pid }, "Reaped a leftover tunnel");
|
|
6445
|
-
})
|
|
6446
|
-
.catch(err => this.logger.warn({ err }, "Tunnel reaper failed"));
|
|
6447
|
-
}
|
|
6484
|
+
// M-3247: this runs after auto_open (and a /web click) may already have opened this run's own tunnels; the sweep
|
|
6485
|
+
// spares leases this process wrote — it once killed the named link it had opened 10 s earlier.
|
|
6486
|
+
void reapLeftoverTunnels([this.dataDir, join(this.dataDir, PUBLIC_PREVIEW_TUNNEL_DIR), join(this.dataDir, OFFICE_SHARE_TUNNEL_DIR)], { log: (level, message, detail) => this.logger[level](detail, message) });
|
|
6448
6487
|
// An existing installation has never written the setup marker — it predates
|
|
6449
6488
|
// it — so `agend setup` would open a pre-fleet form for a fleet that plainly
|
|
6450
6489
|
// exists. A fleet that just came up on a config with agents in it is proof
|
|
@@ -7513,8 +7552,16 @@ export class FleetManager {
|
|
|
7513
7552
|
// asks "is anyone still reporting", which only the receiver can date.
|
|
7514
7553
|
receivedAt: now,
|
|
7515
7554
|
});
|
|
7516
|
-
// #3647: activity, for "quiet" — not the boot itself (every agent shows working while it starts).
|
|
7517
|
-
|
|
7555
|
+
// #3647: activity, for "quiet" — not the boot itself (every agent shows working while it starts). M-3239: an agent
|
|
7556
|
+
// whose transcript tells its turns (Claude, Codex) shows progress by its tool calls and answers, not by its pane's
|
|
7557
|
+
// spinner — Claude compacting its context on its own, idle, held off a stalled card's notice.
|
|
7558
|
+
if (msg.turnEvidence === true)
|
|
7559
|
+
this.livenessTurnEvidence.add(name);
|
|
7560
|
+
else if (msg.turnEvidence === false)
|
|
7561
|
+
this.livenessTurnEvidence.delete(name);
|
|
7562
|
+
if (typeof msg.turnActivityAt === "number")
|
|
7563
|
+
this.noteTurnActivity(name, msg.turnActivityAt);
|
|
7564
|
+
if (state === "working" && !this.livenessTurnEvidence.has(name) && now - this.startedAt >= LIVENESS_STARTUP_GRACE_MS)
|
|
7518
7565
|
this.lastWorkingAt.set(name, now);
|
|
7519
7566
|
// The dashboard's "working" line and its Stop button follow the edges, not the heartbeat.
|
|
7520
7567
|
if (previous?.state !== state)
|
|
@@ -13547,6 +13594,14 @@ export class FleetManager {
|
|
|
13547
13594
|
waiter(msg);
|
|
13548
13595
|
}
|
|
13549
13596
|
}
|
|
13597
|
+
else if (msg.type === "turn_activity") {
|
|
13598
|
+
if (typeof msg.at === "number")
|
|
13599
|
+
this.noteTurnActivity(name, msg.at);
|
|
13600
|
+
}
|
|
13601
|
+
else if (msg.type === "turn_ended") {
|
|
13602
|
+
if (typeof msg.startedAt === "number" && typeof msg.text === "string")
|
|
13603
|
+
this.onTurnEndedQuietly(name, msg.startedAt, msg.text);
|
|
13604
|
+
}
|
|
13550
13605
|
else if (msg.type === "instance_state" || msg.type === "instance_state_response") {
|
|
13551
13606
|
this.cacheInstanceExecutionState(name, msg);
|
|
13552
13607
|
if (msg.type === "instance_state_response") {
|
|
@@ -21080,6 +21135,9 @@ export class FleetManager {
|
|
|
21080
21135
|
return { current: catalog.current_model, options: catalog.models.map(m => ({ id: m.id, label: m.label })), actions: ["refresh"] };
|
|
21081
21136
|
}
|
|
21082
21137
|
const backend = this.backendNameForInstance(instance);
|
|
21138
|
+
// Opened on an empty list, the menu waits for one bounded discovery ("loading") instead of showing nothing.
|
|
21139
|
+
if (!more)
|
|
21140
|
+
await this.ensureModelCatalog(backend, instance);
|
|
21083
21141
|
const env = this.webModelEnv(backend, instance);
|
|
21084
21142
|
const current = this.resolveInstanceModel(instance).model;
|
|
21085
21143
|
const models = more ? this.modelCatalogFor(backend, instance) : env?.models ?? [];
|
|
@@ -21149,7 +21207,11 @@ export class FleetManager {
|
|
|
21149
21207
|
const refusal = this.backendCommandRefusal(instance);
|
|
21150
21208
|
if (refusal)
|
|
21151
21209
|
return { error: refusal };
|
|
21152
|
-
// The cached model lists
|
|
21210
|
+
// The cached model lists, as the web's /model; an empty one is discovered once, bounded (moving to a CLI
|
|
21211
|
+
// never signed in at startup, or probed before it was installed, must not offer an empty list).
|
|
21212
|
+
const wanted = backendArgs(args)[0];
|
|
21213
|
+
if (wanted && KNOWN_BACKENDS.includes(wanted))
|
|
21214
|
+
await this.ensureModelCatalog(wanted, instance);
|
|
21153
21215
|
const step = await backendStep({ ...this.backendCommandDeps(instance, { live: false }), models: async (backend) => this.modelCatalogFor(backend, instance) }, instance, backendArgs(args));
|
|
21154
21216
|
if (step.kind === "refuse")
|
|
21155
21217
|
return step.noop ? { text: step.text } : { error: step.text };
|
|
@@ -22553,8 +22615,10 @@ export class FleetManager {
|
|
|
22553
22615
|
// #2072: a sign-in just finished — the pickers learn it now, not at the next pass.
|
|
22554
22616
|
if (!profile)
|
|
22555
22617
|
void this.backendAvailability.refresh([backend], { force: true });
|
|
22618
|
+
this.modelsAfterSignIn(backend, profile ?? null); // Chat /login and the dashboard's terminal sign-in
|
|
22556
22619
|
return this.recoverBackendInstances(backend, undefined, profile ?? null);
|
|
22557
22620
|
},
|
|
22621
|
+
agentLabel: name => this.fleetConfig?.instances[name]?.display_name?.trim() || name, // M-3249: the outcome line names agents as people see them
|
|
22558
22622
|
claimWindow: backend => this.loginWindow.tryClaim("web", backend),
|
|
22559
22623
|
releaseWindow: claim => { this.loginWindow.release(claim); },
|
|
22560
22624
|
isClaimCurrent: claim => this.loginWindow.isCurrent(claim),
|
|
@@ -22588,7 +22652,7 @@ export class FleetManager {
|
|
|
22588
22652
|
reported: (id, profile, backend) => this.machineAccounts.profileState(id, profile, backend),
|
|
22589
22653
|
reportedDefault: (id, backend) => this.machineAccounts.reportedDefault(id, backend),
|
|
22590
22654
|
readiness: (id, backend, named) => this.machineAccounts.readiness(id, backend, named),
|
|
22591
|
-
actor: owner =>
|
|
22655
|
+
actor: owner => this.machineSignInActor(owner),
|
|
22592
22656
|
changed: (event, owner) => {
|
|
22593
22657
|
// Safe fields only: the computer, the CLI, the profile name (none for Antigravity's default login), a phase and a fixed reason. Never a URL, a code, output or an e-mail address.
|
|
22594
22658
|
this.logger.info({ machine: event.machine, backend: event.backend, ...(event.profile ? { profile: event.profile } : {}), phase: event.phase, ...(event.reason ? { reason: event.reason } : {}), by: owner.label }, "Computer account sign-in from Settings → Accounts");
|
|
@@ -22596,11 +22660,44 @@ export class FleetManager {
|
|
|
22596
22660
|
// Only the computer's OWN login (no profile) is remembered here: a named account's sign-in is reported by its Runtime's inventory, which it sends before the sign-in ends.
|
|
22597
22661
|
if (event.phase === "done" && event.profile === undefined)
|
|
22598
22662
|
this.machineAccounts.noteDefaultLogin(event.machine, event.backend, true);
|
|
22663
|
+
// That computer's Runtime lists models in its own inventory (never a host probe): pages read it again now,
|
|
22664
|
+
// and the Runtime is asked once, for the admin who finished the sign-in, to list them as this account.
|
|
22665
|
+
if (event.phase === "done") {
|
|
22666
|
+
this.announceModels(event.backend);
|
|
22667
|
+
void this.nativeModelsAfterSignIn(event, owner);
|
|
22668
|
+
}
|
|
22599
22669
|
broadcastSseEvent(this.sseClients, "backend_login", {}, err => this.logger.debug({ err }, "backend_login event failed"));
|
|
22600
22670
|
this.needsYou?.poke();
|
|
22601
22671
|
},
|
|
22602
22672
|
});
|
|
22603
22673
|
}
|
|
22674
|
+
/**
|
|
22675
|
+
* A paired computer's sign-in ended — ask its Runtime once (`models.refresh`, as the admin who finished the
|
|
22676
|
+
* sign-in) for the list as this account, so the next read of its agents' and the create dialog's list has it without the
|
|
22677
|
+
* Refresh button. Once per sign-in; never on a read (M-2239 P1-2). A Runtime without the capability, a refused account or any
|
|
22678
|
+
* failure is skipped quietly: the sign-in is done either way.
|
|
22679
|
+
*/
|
|
22680
|
+
/** The name a paired computer's audit log records for the admin session that signed in on it (`admin:<handle>`); null refuses. */
|
|
22681
|
+
machineSignInActor(owner) {
|
|
22682
|
+
const handle = owner.handle;
|
|
22683
|
+
return typeof handle === "string" && /^[a-f0-9]{16}$/.test(handle) ? `admin:${handle}` : null;
|
|
22684
|
+
}
|
|
22685
|
+
async nativeModelsAfterSignIn(event, owner) {
|
|
22686
|
+
try {
|
|
22687
|
+
const actor = this.machineSignInActor(owner);
|
|
22688
|
+
if (!actor || this.shuttingDown || !this.browserSignInOwnerCurrent(owner))
|
|
22689
|
+
return;
|
|
22690
|
+
const refreshed = await refreshNativeModelCatalogAfterSignIn(this, {
|
|
22691
|
+
backend: event.backend, machineId: event.machine, ...(event.profile ? { profile: event.profile } : {}), actor,
|
|
22692
|
+
stillAdmin: () => !this.shuttingDown && this.browserSignInOwnerCurrent(owner),
|
|
22693
|
+
});
|
|
22694
|
+
if (refreshed)
|
|
22695
|
+
this.announceModels(event.backend);
|
|
22696
|
+
}
|
|
22697
|
+
catch (err) {
|
|
22698
|
+
this.logger.debug({ backend: event.backend, err }, "Model refresh after a computer's sign-in skipped");
|
|
22699
|
+
}
|
|
22700
|
+
}
|
|
22604
22701
|
machineAccountsInstance = null;
|
|
22605
22702
|
/** #3190 Part 3c: a paired computer's accounts in Settings → Accounts (machine-accounts.ts). */
|
|
22606
22703
|
get machineAccounts() {
|
|
@@ -22649,6 +22746,7 @@ export class FleetManager {
|
|
|
22649
22746
|
broadcastSseEvent(this.sseClients, "backend_login", {}, err => this.logger.debug({ err }, "backend_login event failed"));
|
|
22650
22747
|
if (event.phase === "done") {
|
|
22651
22748
|
this.forgetSignInIdentities(); // a sign-in may be a different account now
|
|
22749
|
+
this.modelsAfterSignIn(event.backend, null); // The list read before this sign-in (a signed-out CLI answers none) is not this account's
|
|
22652
22750
|
this.keepAliveAfterSignIn(event.backend, null); // its file changed, whoever is watching: a "needs sign-in" left from before is no longer the answer
|
|
22653
22751
|
this.usageAfterSignIn(); // the usage read before this sign-in is not this account's
|
|
22654
22752
|
}
|
|
@@ -22704,6 +22802,7 @@ export class FleetManager {
|
|
|
22704
22802
|
broadcastSseEvent(this.sseClients, "backend_login", {}, err => this.logger.debug({ err }, "backend_login event failed"));
|
|
22705
22803
|
if (event.phase === "done") {
|
|
22706
22804
|
this.forgetSignInIdentities(); // a sign-in may be a different account now
|
|
22805
|
+
this.modelsAfterSignIn(event.backend, event.profile);
|
|
22707
22806
|
this.keepAliveAfterSignIn(event.backend, event.profile);
|
|
22708
22807
|
this.usageAfterSignIn();
|
|
22709
22808
|
}
|
|
@@ -25915,6 +26014,8 @@ export class FleetManager {
|
|
|
25915
26014
|
/** Preserve the existing cache merge rules for worker probes. */
|
|
25916
26015
|
persistCliEnvProbeResult(backend, probed, profile = null) {
|
|
25917
26016
|
const env = { backend, probedAt: Date.now(), ...probed };
|
|
26017
|
+
const listed = (e) => (e?.models ?? []).map(m => m.id).join("\0");
|
|
26018
|
+
const before = listed(this.readCliEnv(backend, profile));
|
|
25918
26019
|
// An empty result must never overwrite a catalog we already have. Some
|
|
25919
26020
|
// probes hit the network (`agy models` fetches, 5s cap), so a slow moment
|
|
25920
26021
|
// returns [] — and writing that would blank the list for the whole 24h
|
|
@@ -25945,6 +26046,8 @@ export class FleetManager {
|
|
|
25945
26046
|
const path = this.cliEnvPath(backend, profile);
|
|
25946
26047
|
mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
|
|
25947
26048
|
writeFileSync(path, JSON.stringify(env, null, 2));
|
|
26049
|
+
if (listed(env) !== before)
|
|
26050
|
+
this.announceModels(backend); // An open /model or Settings page reads the new list
|
|
25948
26051
|
return env;
|
|
25949
26052
|
}
|
|
25950
26053
|
/** Background-probe every distinct backend in use at startup (non-blocking). */
|
|
@@ -25966,6 +26069,105 @@ export class FleetManager {
|
|
|
25966
26069
|
void this.probeBackendBounded(b);
|
|
25967
26070
|
this.probeChangedCliEnvs(null);
|
|
25968
26071
|
}
|
|
26072
|
+
/**
|
|
26073
|
+
* Whether a named account's catalog can be discovered without publishing another account's models under its name
|
|
26074
|
+
* (#3526 / D7). A CLI whose profile is a variable the probe inherits (codex, kiro, claude) is. A CLI told its account by an
|
|
26075
|
+
* argument (agy, `launch-argument`) is too, since AGEND-278: the probe is run with the account's own folder
|
|
26076
|
+
* (backend/antigravity.ts `listModels`), and it answers nothing for a folder with no sign-in. Never a profile on a
|
|
26077
|
+
* backend that has no credential home at all.
|
|
26078
|
+
*/
|
|
26079
|
+
modelDiscoverable(backend, binding) {
|
|
26080
|
+
return !binding.profile || !!credentialHomeSpec(backend);
|
|
26081
|
+
}
|
|
26082
|
+
/** One model discovery for a binding — the scoped (own config) or the shared per-backend/profile cache — or null when fenced. */
|
|
26083
|
+
discoverModels(backend, name, binding = this.webModelBinding(backend, name), opts = {}) {
|
|
26084
|
+
if (!binding || !this.modelDiscoverable(backend, binding))
|
|
26085
|
+
return null;
|
|
26086
|
+
// A scoped read resolves its binding again (publication and current checks included), so it is handed the selection the
|
|
26087
|
+
// binding came from: without it the agent's saved/default account would be probed and populated instead.
|
|
26088
|
+
return binding.scoped
|
|
26089
|
+
? this.refreshModelCatalogFor(backend, name, opts.selection, opts.afterSignIn ? { afterSignIn: true } : {})
|
|
26090
|
+
: this.probeBackendBounded(backend, { profile: binding.profile, ...(opts.refreshVendorCatalog ? { refreshVendorCatalog: true } : {}) });
|
|
26091
|
+
}
|
|
26092
|
+
/** The `models` stream event: a backend's model list changed — an open page reads it again (no details, as `backend_login`). */
|
|
26093
|
+
announceModels(backend) {
|
|
26094
|
+
try {
|
|
26095
|
+
broadcastSseEvent(this.sseClients, "models", { backend }, err => this.logger.debug({ err }, "models event failed"));
|
|
26096
|
+
}
|
|
26097
|
+
catch { /* best effort */ }
|
|
26098
|
+
}
|
|
26099
|
+
modelOpenProbes = new Map();
|
|
26100
|
+
/**
|
|
26101
|
+
* The list a menu opens on. Cached and fresh: nothing to do. Empty (never discovered: the CLI was signed out
|
|
26102
|
+
* at startup, or the agent just moved to this CLI): one bounded discovery that the caller waits for — so `/model` and
|
|
26103
|
+
* Settings show "loading" instead of an empty list. Stale: the list stands and is refreshed behind it. Both join a
|
|
26104
|
+
* discovery already running, and an attempt that found nothing is not repeated for MODEL_OPEN_PROBE_COOLDOWN_MS.
|
|
26105
|
+
* Never throws; a Windows Runtime's catalog is its inventory's and is not a host probe.
|
|
26106
|
+
*/
|
|
26107
|
+
async ensureModelCatalog(backend, instance, selection) {
|
|
26108
|
+
try {
|
|
26109
|
+
const binding = this.webModelBinding(backend, instance, selection);
|
|
26110
|
+
if (!binding || this.shuttingDown)
|
|
26111
|
+
return;
|
|
26112
|
+
const env = this.webModelEnv(backend, instance, selection);
|
|
26113
|
+
const empty = !env?.models?.length;
|
|
26114
|
+
if (!empty && !this.cliEnvNeedsRefresh(env))
|
|
26115
|
+
return;
|
|
26116
|
+
this.modelOpenProbes ??= new Map();
|
|
26117
|
+
const last = this.modelOpenProbes.get(binding.key);
|
|
26118
|
+
if (last !== undefined && Date.now() - last < MODEL_OPEN_PROBE_COOLDOWN_MS)
|
|
26119
|
+
return;
|
|
26120
|
+
const work = this.discoverModels(backend, instance, binding, { selection });
|
|
26121
|
+
if (!work)
|
|
26122
|
+
return;
|
|
26123
|
+
const done = work.catch(err => { this.logger.debug({ backend, instance, err }, "Model discovery on open failed"); }).then(() => {
|
|
26124
|
+
const after = this.webModelEnv(backend, instance, selection);
|
|
26125
|
+
if (!after?.models?.length || this.cliEnvNeedsRefresh(after))
|
|
26126
|
+
this.modelOpenProbes.set(binding.key, Date.now());
|
|
26127
|
+
else
|
|
26128
|
+
this.modelOpenProbes.delete(binding.key);
|
|
26129
|
+
});
|
|
26130
|
+
if (!empty)
|
|
26131
|
+
return;
|
|
26132
|
+
let timer;
|
|
26133
|
+
await Promise.race([done, new Promise(resolve => { timer = setTimeout(resolve, MODEL_OPEN_PROBE_WAIT_MS); timer.unref?.(); })]);
|
|
26134
|
+
if (timer)
|
|
26135
|
+
clearTimeout(timer);
|
|
26136
|
+
}
|
|
26137
|
+
catch (err) {
|
|
26138
|
+
this.logger.debug({ backend, instance, err }, "Model discovery on open failed");
|
|
26139
|
+
}
|
|
26140
|
+
}
|
|
26141
|
+
/**
|
|
26142
|
+
* A sign-in just ended, so the CLI can now answer `models` as this account — whatever started the sign-in
|
|
26143
|
+
* (Settings → Accounts, a named account, chat `/login`, the dashboard's terminal). The account's list is read again now,
|
|
26144
|
+
* not at the next startup or by hand. The default account: the backend's shared cache. A named account: its own store
|
|
26145
|
+
* (claude's profile catalog), or each agent's scoped one (the other CLIs, agy included: its probe runs with the account's folder).
|
|
26146
|
+
* A provider-bound agent does not depend on the sign-in. Background; each page is told when the list changed.
|
|
26147
|
+
*/
|
|
26148
|
+
modelsAfterSignIn(backend, profile) {
|
|
26149
|
+
if (this.shuttingDown || !KNOWN_BACKENDS.includes(backend) || backend === "mock")
|
|
26150
|
+
return;
|
|
26151
|
+
(this.modelOpenProbes ??= new Map()).clear(); // a cooldown from before the sign-in said "nothing to find": it no longer does
|
|
26152
|
+
const settle = (work) => {
|
|
26153
|
+
void work?.catch(err => this.logger.debug({ backend, profile, err }, "Model discovery after sign-in failed"));
|
|
26154
|
+
};
|
|
26155
|
+
if (profile === null) {
|
|
26156
|
+
settle(this.discoverModels(backend, null, undefined, { refreshVendorCatalog: true }));
|
|
26157
|
+
return;
|
|
26158
|
+
}
|
|
26159
|
+
if (backend === "claude-code") {
|
|
26160
|
+
settle(this.probeBackendBounded(backend, { profile, refreshVendorCatalog: true }));
|
|
26161
|
+
return;
|
|
26162
|
+
}
|
|
26163
|
+
for (const name of this.configuredBackendInstanceNames()) {
|
|
26164
|
+
if (this.backendNameOf(name) !== backend || this.credentialProfileOf(name, backend) !== profile)
|
|
26165
|
+
continue;
|
|
26166
|
+
const binding = this.webModelBinding(backend, name);
|
|
26167
|
+
if (binding?.scoped)
|
|
26168
|
+
settle(this.discoverModels(backend, name, binding, { afterSignIn: true }));
|
|
26169
|
+
}
|
|
26170
|
+
}
|
|
25969
26171
|
/** Maintain discovery after committed config changes; a model-field read remains passive. */
|
|
25970
26172
|
probeChangedCliEnvs(previous) {
|
|
25971
26173
|
const signature = (fleet, name) => {
|
|
@@ -25980,11 +26182,7 @@ export class FleetManager {
|
|
|
25980
26182
|
continue;
|
|
25981
26183
|
const backend = this.backendNameForInstance(name);
|
|
25982
26184
|
const binding = this.webModelBinding(backend, name);
|
|
25983
|
-
|
|
25984
|
-
// never publish the ambient account's models under that profile (#3526 / D7). (AGEND-119: agy now HAS
|
|
25985
|
-
// named accounts, but `agy models` is not run with the account's folder, so its answer would still be the
|
|
25986
|
-
// default account's: only a CLI whose profile is a variable the probe inherits is discovered under one.)
|
|
25987
|
-
if (!binding || (binding.profile && (!credentialHomeSpec(backend) || credentialHomeSpec(backend).kind === "launch-argument")))
|
|
26185
|
+
if (!binding || !this.modelDiscoverable(backend, binding))
|
|
25988
26186
|
continue;
|
|
25989
26187
|
// A description/defaults save can retire a scoped answer's full binding even
|
|
25990
26188
|
// though its account signature is unchanged. Keep the conservative fence and
|
|
@@ -25992,10 +26190,8 @@ export class FleetManager {
|
|
|
25992
26190
|
if (previous && signature(previous, name) === signature(this.fleetConfig, name)
|
|
25993
26191
|
&& (!binding.scoped || this.webModelEnv(backend, name) || this.webModelRefreshes.has(binding.key)))
|
|
25994
26192
|
continue;
|
|
25995
|
-
const work = binding
|
|
25996
|
-
|
|
25997
|
-
: this.probeBackendBounded(backend, { profile: binding.profile });
|
|
25998
|
-
void work.catch(err => this.logger.debug({ backend, name, err }, "Background model discovery failed"));
|
|
26193
|
+
const work = this.discoverModels(backend, name, binding);
|
|
26194
|
+
void work?.catch(err => this.logger.debug({ backend, name, err }, "Background model discovery failed"));
|
|
25999
26195
|
}
|
|
26000
26196
|
}
|
|
26001
26197
|
/** Best-effort model list for `/model`: cached CLI env first, else live probe. Never throws. */
|
|
@@ -27209,11 +27405,22 @@ export class FleetManager {
|
|
|
27209
27405
|
return shapeWebModelCatalog(backend, env?.models ?? [], env?.apiModels ?? []);
|
|
27210
27406
|
}
|
|
27211
27407
|
/** Explicit, bounded vendor rediscovery. Never publish an answer under a different account/config/instance. */
|
|
27212
|
-
async refreshModelCatalogFor(backend, instance, selection) {
|
|
27408
|
+
async refreshModelCatalogFor(backend, instance, selection, opts = {}) {
|
|
27213
27409
|
const binding = this.webModelBinding(backend, instance, selection);
|
|
27214
27410
|
if (!binding || this.shuttingDown)
|
|
27215
27411
|
return { models: [], refreshed: false };
|
|
27216
27412
|
const pending = this.webModelRefreshes.get(binding.key);
|
|
27413
|
+
if (pending && opts.afterSignIn) {
|
|
27414
|
+
// A sign-in changes the credentials, not the binding key, so a flight started before it is answering as the signed-out
|
|
27415
|
+
// account. Join it for admission (the worker limit), then read once more as the signed-in one; sign-ins that land on the
|
|
27416
|
+
// same flight meet in that one read (the second finds the first's flight).
|
|
27417
|
+
return pending.catch(() => null).then(() => {
|
|
27418
|
+
const next = this.webModelBinding(backend, instance, selection);
|
|
27419
|
+
if (next?.key !== binding.key)
|
|
27420
|
+
return { models: [], refreshed: false };
|
|
27421
|
+
return this.refreshModelCatalogFor(backend, instance, selection);
|
|
27422
|
+
});
|
|
27423
|
+
}
|
|
27217
27424
|
if (pending)
|
|
27218
27425
|
return pending;
|
|
27219
27426
|
const epoch = this.cliEnvProbeEpoch;
|
|
@@ -27231,7 +27438,11 @@ export class FleetManager {
|
|
|
27231
27438
|
return { models: this.modelCatalogFor(backend, instance, selection), refreshed: false };
|
|
27232
27439
|
if (this.webModelCatalogs.size >= 64)
|
|
27233
27440
|
this.webModelCatalogs.delete(this.webModelCatalogs.keys().next().value);
|
|
27441
|
+
const listed = (models) => models.map(m => m.id).join("\0");
|
|
27442
|
+
const before = listed(this.webModelEnv(backend, instance, selection)?.models ?? []);
|
|
27234
27443
|
this.webModelCatalogs.set(binding.key, { ...result, backend, probedAt: Date.now() });
|
|
27444
|
+
if (listed(result.models) !== before)
|
|
27445
|
+
this.announceModels(backend);
|
|
27235
27446
|
return { models: this.modelCatalogFor(backend, instance, selection), refreshed: true };
|
|
27236
27447
|
}).finally(() => { if (this.webModelRefreshes.get(binding.key) === work)
|
|
27237
27448
|
this.webModelRefreshes.delete(binding.key); });
|