@songsid/agend 2.2.0-alpha.9 → 2.2.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.zh-TW.md +1 -1
- package/dist/agent-cli-instructions.md +16 -9
- package/dist/agent-cli.js +15 -7
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.js +21 -9
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-whats-new.d.ts +47 -0
- package/dist/agent-whats-new.js +147 -0
- package/dist/agent-whats-new.js.map +1 -0
- package/dist/auth-api.d.ts +2 -2
- package/dist/auth-api.js +4 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/antigravity.d.ts +3 -0
- package/dist/backend/antigravity.js +9 -0
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-carry.d.ts +22 -0
- package/dist/backend/claude-carry.js +170 -0
- package/dist/backend/claude-carry.js.map +1 -0
- package/dist/backend/claude-code.d.ts +65 -2
- package/dist/backend/claude-code.js +226 -33
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex-metadata.d.ts +33 -0
- package/dist/backend/codex-metadata.js +122 -18
- package/dist/backend/codex-metadata.js.map +1 -1
- package/dist/backend/codex.d.ts +3 -0
- package/dist/backend/codex.js +17 -1
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/credential-profile.d.ts +40 -3
- package/dist/backend/credential-profile.js +113 -5
- package/dist/backend/credential-profile.js.map +1 -1
- package/dist/backend/effort-metadata.d.ts +1 -1
- package/dist/backend/effort-metadata.js +3 -2
- package/dist/backend/effort-metadata.js.map +1 -1
- package/dist/backend/grok.d.ts +4 -0
- package/dist/backend/grok.js +14 -0
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro-engine-ledger.d.ts +5 -0
- package/dist/backend/kiro-engine-ledger.js +20 -0
- package/dist/backend/kiro-engine-ledger.js.map +1 -1
- package/dist/backend/kiro-identity.d.ts +6 -0
- package/dist/backend/kiro-identity.js +19 -5
- package/dist/backend/kiro-identity.js.map +1 -1
- package/dist/backend/kiro.d.ts +39 -3
- package/dist/backend/kiro.js +143 -19
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/launch-effort.d.ts +33 -0
- package/dist/backend/launch-effort.js +123 -0
- package/dist/backend/launch-effort.js.map +1 -0
- package/dist/backend/muse.d.ts +84 -0
- package/dist/backend/muse.js +449 -53
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/types.d.ts +33 -4
- package/dist/backend/types.js +2 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-command.d.ts +91 -0
- package/dist/backend-command.js +122 -0
- package/dist/backend-command.js.map +1 -0
- package/dist/background-work-ended.d.ts +18 -0
- package/dist/background-work-ended.js +30 -0
- package/dist/background-work-ended.js.map +1 -0
- package/dist/cache-service.d.ts +2 -0
- package/dist/cache-service.js +2 -1
- package/dist/cache-service.js.map +1 -1
- package/dist/channel/adapters/discord.d.ts +26 -1
- package/dist/channel/adapters/discord.js +98 -3
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +26 -2
- package/dist/channel/adapters/telegram.js +123 -19
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/mcp-server.js +9 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.d.ts +11 -0
- package/dist/channel/mcp-tools.js +24 -13
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/message-edit-errors.d.ts +5 -0
- package/dist/channel/message-edit-errors.js +24 -0
- package/dist/channel/message-edit-errors.js.map +1 -0
- package/dist/channel/telegram-markdown.d.ts +6 -0
- package/dist/channel/telegram-markdown.js +104 -0
- package/dist/channel/telegram-markdown.js.map +1 -0
- package/dist/channel/tool-router.js +9 -3
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/channel/types.d.ts +41 -3
- package/dist/cli.js +133 -28
- package/dist/cli.js.map +1 -1
- package/dist/command-table.d.ts +2 -2
- package/dist/command-table.js +6 -3
- package/dist/command-table.js.map +1 -1
- package/dist/config-validator.js +59 -0
- package/dist/config-validator.js.map +1 -1
- package/dist/cross-instance-envelope.d.ts +15 -2
- package/dist/cross-instance-envelope.js +29 -5
- package/dist/cross-instance-envelope.js.map +1 -1
- package/dist/daemon.d.ts +156 -1
- package/dist/daemon.js +764 -89
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +62 -7
- package/dist/delivery-outbox.js +309 -22
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/delivery-reconciliation.d.ts +18 -1
- package/dist/delivery-reconciliation.js +67 -2
- package/dist/delivery-reconciliation.js.map +1 -1
- package/dist/fleet-context.d.ts +10 -1
- package/dist/fleet-manager.d.ts +352 -10
- package/dist/fleet-manager.js +1925 -175
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/backend-providers/SKILL.md +1 -1
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +92 -21
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +27 -3
- package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +8 -8
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +5 -5
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +4 -4
- package/dist/general-knowledge/skills/fleet-restart/SKILL.md +13 -13
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +3 -2
- package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +6 -0
- package/dist/general-knowledge/skills/model-discovery/SKILL.md +9 -9
- package/dist/general-knowledge/skills/multi-channel/SKILL.md +8 -2
- package/dist/general-knowledge/skills/scheduling/SKILL.md +5 -3
- package/dist/general-knowledge/skills/session-management/SKILL.md +6 -5
- package/dist/general-knowledge/skills/tui-effort/SKILL.md +2 -2
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +8 -3
- package/dist/general-knowledge/steering/core-rules.md +8 -7
- package/dist/host-memory.d.ts +10 -0
- package/dist/host-memory.js +33 -1
- package/dist/host-memory.js.map +1 -1
- package/dist/human-delivery-receipts.d.ts +83 -0
- package/dist/human-delivery-receipts.js +194 -0
- package/dist/human-delivery-receipts.js.map +1 -0
- package/dist/instance-avatar.d.ts +36 -0
- package/dist/instance-avatar.js +57 -0
- package/dist/instance-avatar.js.map +1 -0
- package/dist/instance-config-impact.js +6 -0
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +29 -6
- package/dist/instance-lifecycle.js +79 -28
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +3 -1
- package/dist/instructions.js +11 -8
- package/dist/instructions.js.map +1 -1
- package/dist/kiro-log-gate.d.ts +42 -0
- package/dist/kiro-log-gate.js +39 -0
- package/dist/kiro-log-gate.js.map +1 -0
- package/dist/locale.js +204 -44
- package/dist/locale.js.map +1 -1
- package/dist/log-service.d.ts +99 -0
- package/dist/log-service.js +243 -0
- package/dist/log-service.js.map +1 -0
- package/dist/log-steps.d.ts +169 -0
- package/dist/log-steps.js +858 -0
- package/dist/log-steps.js.map +1 -0
- package/dist/login-controller.d.ts +20 -3
- package/dist/login-controller.js +71 -19
- package/dist/login-controller.js.map +1 -1
- package/dist/login-flows.d.ts +5 -2
- package/dist/login-flows.js +5 -4
- package/dist/login-flows.js.map +1 -1
- package/dist/memory-pressure.d.ts +13 -1
- package/dist/memory-pressure.js +50 -10
- package/dist/memory-pressure.js.map +1 -1
- package/dist/needs-you-hub.js +2 -0
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you-live.d.ts +6 -0
- package/dist/needs-you-live.js +23 -3
- package/dist/needs-you-live.js.map +1 -1
- package/dist/next-steps.js +1 -1
- package/dist/next-steps.js.map +1 -1
- package/dist/outbound-handlers.d.ts +100 -0
- package/dist/outbound-handlers.js +263 -96
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +26 -15
- package/dist/outbound-schemas.js +24 -7
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-link-progress.d.ts +1 -1
- package/dist/public-link-progress.js +8 -2
- package/dist/public-link-progress.js.map +1 -1
- package/dist/public-preview.d.ts +101 -0
- package/dist/public-preview.js +236 -0
- package/dist/public-preview.js.map +1 -0
- package/dist/public-web-gateway.js +11 -4
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +24 -1
- package/dist/public-web-link.js +63 -9
- package/dist/public-web-link.js.map +1 -1
- package/dist/reply-buttons-controller.d.ts +3 -0
- package/dist/reply-buttons-controller.js +3 -2
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/restart-guard.d.ts +6 -3
- package/dist/restart-guard.js +6 -3
- package/dist/restart-guard.js.map +1 -1
- package/dist/restart-progress.d.ts +33 -0
- package/dist/restart-progress.js +30 -0
- package/dist/restart-progress.js.map +1 -1
- package/dist/service-activation.d.ts +15 -7
- package/dist/service-activation.js +46 -29
- package/dist/service-activation.js.map +1 -1
- package/dist/service-installer.d.ts +31 -0
- package/dist/service-installer.js +41 -2
- package/dist/service-installer.js.map +1 -1
- package/dist/settings-api.js +85 -25
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.js +72 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.js +28 -4
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.js +7 -0
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/setup-form.d.ts +1 -1
- package/dist/setup-form.js +1 -1
- package/dist/spawn-gate.js +5 -1
- package/dist/spawn-gate.js.map +1 -1
- package/dist/spawn-hold-reply.d.ts +12 -0
- package/dist/spawn-hold-reply.js +39 -0
- package/dist/spawn-hold-reply.js.map +1 -0
- package/dist/status-emojis.d.ts +10 -3
- package/dist/status-emojis.js +11 -2
- package/dist/status-emojis.js.map +1 -1
- package/dist/systemd-peer-bus.d.ts +95 -0
- package/dist/systemd-peer-bus.js +430 -0
- package/dist/systemd-peer-bus.js.map +1 -0
- package/dist/systemd-runtime.d.ts +27 -1
- package/dist/systemd-runtime.js +69 -7
- package/dist/systemd-runtime.js.map +1 -1
- package/dist/tips.js +4 -4
- package/dist/tips.js.map +1 -1
- package/dist/tool-progress.js +3 -2
- package/dist/tool-progress.js.map +1 -1
- package/dist/topic-commands.d.ts +42 -2
- package/dist/topic-commands.js +92 -7
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-delta-reader.d.ts +3 -3
- package/dist/transcript-delta-reader.js +8 -8
- package/dist/transcript-delta-reader.js.map +1 -1
- package/dist/transcript-jsonl.d.ts +80 -3
- package/dist/transcript-jsonl.js +147 -10
- package/dist/transcript-jsonl.js.map +1 -1
- package/dist/transcript-monitor.d.ts +19 -0
- package/dist/transcript-monitor.js +87 -15
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-sources.d.ts +78 -0
- package/dist/transcript-sources.js +375 -64
- package/dist/transcript-sources.js.map +1 -1
- package/dist/transcript-turns.d.ts +15 -2
- package/dist/transcript-turns.js +15 -2
- package/dist/transcript-turns.js.map +1 -1
- package/dist/tunnel/cloudflared.d.ts +7 -15
- package/dist/tunnel/cloudflared.js +36 -1
- package/dist/tunnel/cloudflared.js.map +1 -1
- package/dist/tunnel/purpose-lane.d.ts +5 -1
- package/dist/tunnel/purpose-lane.js +14 -7
- package/dist/tunnel/purpose-lane.js.map +1 -1
- package/dist/tunnel/types.d.ts +5 -1
- package/dist/tunnel/types.js.map +1 -1
- package/dist/turn-resume.d.ts +2 -0
- package/dist/turn-resume.js +1 -1
- package/dist/turn-resume.js.map +1 -1
- package/dist/types.d.ts +25 -0
- package/dist/ui/chat-commands.js +1 -0
- package/dist/ui/chat-emojis.js +33 -0
- package/dist/ui/chat-mentions.js +63 -0
- package/dist/ui/chat-render.js +42 -2
- package/dist/ui/chat-store.js +2 -2
- package/dist/ui/chat-strings.js +38 -20
- package/dist/ui/chat-thread.js +69 -12
- package/dist/ui/chat-time.js +80 -0
- package/dist/ui/panel-chat.js +39 -10
- package/dist/ui/panel-details.js +2 -0
- package/dist/ui/panel-fleet.js +199 -57
- package/dist/ui/panel-log.js +428 -0
- package/dist/ui/panel-needs.js +6 -2
- package/dist/ui/panel-settings.js +137 -32
- package/dist/ui/preview-panel.js +55 -15
- package/dist/ui/preview-status.js +28 -0
- package/dist/ui/preview.js +44 -3
- package/dist/ui/settings-dialogs.js +7 -2
- package/dist/ui/settings-model.js +2 -1
- package/dist/ui/settings-strings.js +46 -4
- package/dist/ui/settings-token.js +1 -1
- package/dist/ui/shared/app-i18n.js +43 -17
- package/dist/ui/shared/app-prefs.js +250 -0
- package/dist/ui/shared/app-route.js +7 -2
- package/dist/ui/shared/app-shell.js +165 -8
- package/dist/ui/shared/app-store.js +5 -1
- package/dist/ui/shared/app-stream.js +23 -5
- package/dist/ui/shared/app.css +159 -23
- package/dist/ui/shared/app.js +11 -1
- package/dist/ui/shared/fonts/README.md +1 -1
- package/dist/ui/shared/header-tools.js +55 -5
- package/dist/ui/shared/instance-nav.js +241 -45
- package/dist/ui/shared/instance-switch.js +4 -4
- package/dist/ui/shared/panel-view.js +6 -0
- package/dist/ui/shared/signin.js +7 -7
- package/dist/ui/shared/theme.js +39 -7
- package/dist/ui/shared/tokens.css +10 -1
- package/dist/ui/shared/ui-icons.js +1 -0
- package/dist/ui/shared/usage-dialog.js +23 -5
- package/dist/ui/shared/view-strings.js +32 -4
- package/dist/ui/signin.html +1 -1
- package/dist/unrecognised-prompt.d.ts +23 -0
- package/dist/unrecognised-prompt.js +74 -0
- package/dist/unrecognised-prompt.js.map +1 -0
- package/dist/update-install.d.ts +28 -2
- package/dist/update-install.js +22 -4
- package/dist/update-install.js.map +1 -1
- package/dist/update-marker.d.ts +51 -0
- package/dist/update-marker.js +61 -0
- package/dist/update-marker.js.map +1 -1
- package/dist/update-preflight.d.ts +100 -0
- package/dist/update-preflight.js +264 -0
- package/dist/update-preflight.js.map +1 -0
- package/dist/updater-caller.d.ts +31 -0
- package/dist/updater-caller.js +109 -0
- package/dist/updater-caller.js.map +1 -0
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +1 -1
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/providers.d.ts +34 -5
- package/dist/usage/providers.js +160 -27
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/statusline-usage.d.ts +6 -2
- package/dist/usage/statusline-usage.js +10 -4
- package/dist/usage/statusline-usage.js.map +1 -1
- package/dist/view-api.d.ts +1 -1
- package/dist/view-api.js +38 -8
- package/dist/view-api.js.map +1 -1
- package/dist/wake-coordinator.d.ts +11 -0
- package/dist/wake-coordinator.js +38 -4
- package/dist/wake-coordinator.js.map +1 -1
- package/dist/web-api.d.ts +49 -2
- package/dist/web-api.js +421 -31
- package/dist/web-api.js.map +1 -1
- package/dist/web-auth.d.ts +2 -2
- package/dist/web-auth.js +9 -4
- package/dist/web-auth.js.map +1 -1
- package/dist/web-commands.d.ts +27 -4
- package/dist/web-commands.js +19 -4
- package/dist/web-commands.js.map +1 -1
- package/dist/web-host-guard.d.ts +3 -11
- package/dist/web-host-guard.js +3 -12
- package/dist/web-host-guard.js.map +1 -1
- package/dist/web-images.d.ts +47 -0
- package/dist/web-images.js +169 -0
- package/dist/web-images.js.map +1 -0
- package/dist/web-mentions.d.ts +44 -0
- package/dist/web-mentions.js +75 -0
- package/dist/web-mentions.js.map +1 -0
- package/dist/web-prefs.d.ts +63 -0
- package/dist/web-prefs.js +265 -0
- package/dist/web-prefs.js.map +1 -0
- package/dist/web-preview.d.ts +14 -1
- package/dist/web-preview.js +35 -13
- package/dist/web-preview.js.map +1 -1
- package/dist/web-reply-files.d.ts +45 -0
- package/dist/web-reply-files.js +223 -0
- package/dist/web-reply-files.js.map +1 -0
- package/dist/web-schedules.d.ts +12 -0
- package/dist/web-schedules.js +34 -0
- package/dist/web-schedules.js.map +1 -0
- package/dist/web-server-drain.d.ts +10 -0
- package/dist/web-server-drain.js +50 -0
- package/dist/web-server-drain.js.map +1 -0
- package/dist/web-session.d.ts +36 -1
- package/dist/web-session.js +53 -6
- package/dist/web-session.js.map +1 -1
- package/dist/web-settings-patch.d.ts +23 -0
- package/dist/web-settings-patch.js +77 -0
- package/dist/web-settings-patch.js.map +1 -0
- package/dist/web-shell-routes.d.ts +5 -1
- package/dist/web-shell-routes.js +10 -1
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/web-upload.d.ts +17 -4
- package/dist/web-upload.js +64 -13
- package/dist/web-upload.js.map +1 -1
- package/dist/workflow-templates/default.md +1 -1
- package/package.json +1 -1
- package/templates/launchd.plist.ejs +3 -1
- package/templates/systemd.service.ejs +2 -1
|
@@ -105,13 +105,23 @@ export interface LifecycleContext {
|
|
|
105
105
|
* Offer a one-tap re-login beside an auth alert. Optional: contexts without
|
|
106
106
|
* it (tests, lightweight fleets) still get the alert's written remedy.
|
|
107
107
|
*/
|
|
108
|
-
|
|
108
|
+
/** `profile` (#1699 part 2): the button signs that credential profile in, not the backend's default login. */
|
|
109
|
+
offerBackendLogin?(targetInstance: string, backend: string, profile?: string): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* The credential profile an instance's CLI signs in with on `backend` (#1699 follow-up), or null for that backend's
|
|
112
|
+
* default login. Absent: every instance is on the default login (as before profiles).
|
|
113
|
+
*/
|
|
114
|
+
credentialProfileOf?(name: string, backend: string): string | null;
|
|
109
115
|
/** Notify a clean CLI exit and offer an admin-only restart action in General. */
|
|
110
116
|
notifyNormalExit(name: string): Promise<void>;
|
|
111
117
|
/** Tell every General, as an agent, that kiro-cli can no longer run this instance as configured. */
|
|
112
118
|
queueKiroIncompatNotice?(name: string, reason: string): void;
|
|
113
119
|
/** True for a dynamic ClassicBot channel instance (not a fleet topic). */
|
|
114
120
|
isClassicInstance?(name: string): boolean;
|
|
121
|
+
/** All OTHER configured kiro cwd's, fleet + ClassicBot, including stopped
|
|
122
|
+
* instances. Absent means the complete roster cannot be proven (#1624).
|
|
123
|
+
*/
|
|
124
|
+
kiroPeerWorkingDirectories?(name: string): string[];
|
|
115
125
|
/** True while the fleet is stopping on purpose or an `agend update` is running. */
|
|
116
126
|
isPlannedRestart(): boolean;
|
|
117
127
|
/** Suppress only incident kinds caused by the active tmux server storm. */
|
|
@@ -277,10 +287,10 @@ export declare class InstanceLifecycle {
|
|
|
277
287
|
private activitySeedNow;
|
|
278
288
|
/** When each instance was last woken or started for work — the pre-claim lease clock. */
|
|
279
289
|
private wokeAt;
|
|
280
|
-
/** backend → last auth-error alert time, so one expiry sends one alert. */
|
|
290
|
+
/** login (backend, or backend:profile) → last auth-error alert time, so one expiry sends one alert. */
|
|
281
291
|
private lastAuthAlertAt;
|
|
282
292
|
/**
|
|
283
|
-
* backend → cached token-free auth verification (see AUTH_VERIFY_CACHE_MS).
|
|
293
|
+
* login (backend, or backend:profile) → cached token-free auth verification (see AUTH_VERIFY_CACHE_MS).
|
|
284
294
|
* The PROMISE is cached, not the result: a shared credential expiring makes
|
|
285
295
|
* every instance of the backend fire in the same tick, and they must join
|
|
286
296
|
* one in-flight check instead of each spawning their own.
|
|
@@ -357,10 +367,20 @@ export declare class InstanceLifecycle {
|
|
|
357
367
|
* CLI is not. Cached per backend so simultaneous alerts run one check.
|
|
358
368
|
*/
|
|
359
369
|
private verifyAuthError;
|
|
370
|
+
/**
|
|
371
|
+
* The credential profile a running instance signs in with (#1699 follow-up): its login is that profile's, so its
|
|
372
|
+
* auth error is judged, cached and reported against that login — never the backend's default one, which can be fine
|
|
373
|
+
* while the profile's has expired.
|
|
374
|
+
*/
|
|
375
|
+
private profileOf;
|
|
376
|
+
private static loginKey;
|
|
360
377
|
private verifyCodexQuota;
|
|
361
378
|
private verifyClaudeQuota;
|
|
362
|
-
/**
|
|
363
|
-
|
|
379
|
+
/**
|
|
380
|
+
* Same verification keyed by login — a backend's default one, or one of its credential profiles, probed with that
|
|
381
|
+
* profile's environment (used by startup pre-flight priming).
|
|
382
|
+
*/
|
|
383
|
+
verifyBackendAuth(backend: string, profile?: string | null): Promise<"valid" | "invalid" | "unknown">;
|
|
364
384
|
/**
|
|
365
385
|
* Startup pre-flight: warm the per-backend auth verification cache so the
|
|
366
386
|
* detectors that fire seconds later (login-screen scan, MCP-died gate) get an
|
|
@@ -368,7 +388,10 @@ export declare class InstanceLifecycle {
|
|
|
368
388
|
* anything, because e.g. codex on a custom provider runs fine while
|
|
369
389
|
* `codex login status` reports logged out (live-verified on this fleet).
|
|
370
390
|
*/
|
|
371
|
-
primeAuthVerification(
|
|
391
|
+
primeAuthVerification(logins: Iterable<{
|
|
392
|
+
backend: string;
|
|
393
|
+
profile: string | null;
|
|
394
|
+
}>): void;
|
|
372
395
|
/**
|
|
373
396
|
* One alert per backend per cooldown, naming every affected instance — a CLI's
|
|
374
397
|
* credentials are shared, so N instances failing is ONE problem with ONE fix
|
|
@@ -19,6 +19,7 @@ import { reportProviderRateLimit } from "./usage/provider-alerts.js";
|
|
|
19
19
|
import { isFleetStartCommandLine } from "./fleet-lock.js";
|
|
20
20
|
import { GENERAL_PAUSE_ERROR, isGeneralInstance } from "./general-instance.js";
|
|
21
21
|
import { BACKEND_AUTH_CHECKS, checkAuthStatus, LOGIN_FLOWS } from "./login-flows.js";
|
|
22
|
+
import { CHAT_PROFILE_LOGIN_BACKENDS, credentialProfileEnv, credentialProfileLoginCommand } from "./backend/credential-profile.js";
|
|
22
23
|
import { fetchClaudeUsage, fetchCodexUsage } from "./usage/providers.js";
|
|
23
24
|
import { assertExplicitInstanceRemoval, authorizeExplicitInstanceRemoval } from "./instance-removal.js";
|
|
24
25
|
import { capturePendingTargetReconciliation, finishTargetReconciliation, reconcileTargetBeforeStart, RECONCILIATION_WRITE_DRAIN_TIMEOUT_MS, retireCapturedTargetWindows, } from "./delivery-reconciliation.js";
|
|
@@ -258,10 +259,10 @@ export class InstanceLifecycle {
|
|
|
258
259
|
activitySeedNow = new Set();
|
|
259
260
|
/** When each instance was last woken or started for work — the pre-claim lease clock. */
|
|
260
261
|
wokeAt = new Map();
|
|
261
|
-
/** backend → last auth-error alert time, so one expiry sends one alert. */
|
|
262
|
+
/** login (backend, or backend:profile) → last auth-error alert time, so one expiry sends one alert. */
|
|
262
263
|
lastAuthAlertAt = new Map();
|
|
263
264
|
/**
|
|
264
|
-
* backend → cached token-free auth verification (see AUTH_VERIFY_CACHE_MS).
|
|
265
|
+
* login (backend, or backend:profile) → cached token-free auth verification (see AUTH_VERIFY_CACHE_MS).
|
|
265
266
|
* The PROMISE is cached, not the result: a shared credential expiring makes
|
|
266
267
|
* every instance of the backend fire in the same tick, and they must join
|
|
267
268
|
* one in-flight check instead of each spawning their own.
|
|
@@ -370,7 +371,19 @@ export class InstanceLifecycle {
|
|
|
370
371
|
* CLI is not. Cached per backend so simultaneous alerts run one check.
|
|
371
372
|
*/
|
|
372
373
|
verifyAuthError(name) {
|
|
373
|
-
|
|
374
|
+
const backend = this.backendOf(name);
|
|
375
|
+
return this.verifyBackendAuth(backend, this.profileOf(name, backend));
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* The credential profile a running instance signs in with (#1699 follow-up): its login is that profile's, so its
|
|
379
|
+
* auth error is judged, cached and reported against that login — never the backend's default one, which can be fine
|
|
380
|
+
* while the profile's has expired.
|
|
381
|
+
*/
|
|
382
|
+
profileOf(name, backend) {
|
|
383
|
+
return this.ctx.credentialProfileOf?.(name, backend) ?? null;
|
|
384
|
+
}
|
|
385
|
+
static loginKey(backend, profile) {
|
|
386
|
+
return profile ? `${backend}:${profile}` : backend;
|
|
374
387
|
}
|
|
375
388
|
verifyCodexQuota() {
|
|
376
389
|
if (this.codexQuotaVerifyInFlight)
|
|
@@ -396,14 +409,19 @@ export class InstanceLifecycle {
|
|
|
396
409
|
});
|
|
397
410
|
return promise;
|
|
398
411
|
}
|
|
399
|
-
/**
|
|
400
|
-
|
|
401
|
-
|
|
412
|
+
/**
|
|
413
|
+
* Same verification keyed by login — a backend's default one, or one of its credential profiles, probed with that
|
|
414
|
+
* profile's environment (used by startup pre-flight priming).
|
|
415
|
+
*/
|
|
416
|
+
verifyBackendAuth(backend, profile = null) {
|
|
417
|
+
const key = InstanceLifecycle.loginKey(backend, profile);
|
|
418
|
+
const cached = this.authVerifyCache.get(key);
|
|
402
419
|
if (cached && Date.now() - cached.at < AUTH_VERIFY_CACHE_MS)
|
|
403
420
|
return cached.promise;
|
|
404
421
|
const check = LOGIN_FLOWS[backend]?.authCheck ?? BACKEND_AUTH_CHECKS[backend];
|
|
405
|
-
const
|
|
406
|
-
|
|
422
|
+
const env = profile ? credentialProfileEnv(getAgendHome(), backend, profile) : null;
|
|
423
|
+
const promise = check ? (env ? checkAuthStatus(check, env) : checkAuthStatus(check)) : Promise.resolve("unknown");
|
|
424
|
+
this.authVerifyCache.set(key, { at: Date.now(), promise });
|
|
407
425
|
return promise;
|
|
408
426
|
}
|
|
409
427
|
/**
|
|
@@ -413,11 +431,16 @@ export class InstanceLifecycle {
|
|
|
413
431
|
* anything, because e.g. codex on a custom provider runs fine while
|
|
414
432
|
* `codex login status` reports logged out (live-verified on this fleet).
|
|
415
433
|
*/
|
|
416
|
-
primeAuthVerification(
|
|
417
|
-
|
|
418
|
-
|
|
434
|
+
primeAuthVerification(logins) {
|
|
435
|
+
const seen = new Set();
|
|
436
|
+
for (const { backend, profile } of logins) {
|
|
437
|
+
const key = InstanceLifecycle.loginKey(backend, profile);
|
|
438
|
+
if (seen.has(key))
|
|
439
|
+
continue;
|
|
440
|
+
seen.add(key);
|
|
441
|
+
void this.verifyBackendAuth(backend, profile).then(result => {
|
|
419
442
|
if (result === "invalid") {
|
|
420
|
-
this.ctx.logger.warn({ backend }, "Pre-flight auth check failed — marking backend as auth-suspect");
|
|
443
|
+
this.ctx.logger.warn({ backend, profile }, "Pre-flight auth check failed — marking backend as auth-suspect");
|
|
421
444
|
}
|
|
422
445
|
}).catch(() => { });
|
|
423
446
|
}
|
|
@@ -430,27 +453,43 @@ export class InstanceLifecycle {
|
|
|
430
453
|
*/
|
|
431
454
|
notifyAuthErrorOnce(name, message, notificationTarget = name) {
|
|
432
455
|
const backend = this.backendOf(name);
|
|
456
|
+
// #1699 follow-up: a credential profile is a login of its own — its own alert, its own instances, its own fix.
|
|
457
|
+
const profile = this.profileOf(name, backend);
|
|
458
|
+
const key = InstanceLifecycle.loginKey(backend, profile);
|
|
433
459
|
const now = Date.now();
|
|
434
|
-
const last = this.lastAuthAlertAt.get(
|
|
460
|
+
const last = this.lastAuthAlertAt.get(key) ?? 0;
|
|
435
461
|
if (now - last < AUTH_ALERT_COOLDOWN_MS) {
|
|
436
|
-
this.ctx.logger.info({ name, backend }, "auth error suppressed (
|
|
462
|
+
this.ctx.logger.info({ name, backend, profile }, "auth error suppressed (this login already alerted)");
|
|
437
463
|
return;
|
|
438
464
|
}
|
|
439
|
-
this.lastAuthAlertAt.set(
|
|
440
|
-
const affected = [...this.daemons.keys()].filter(n => this.backendOf(n) === backend);
|
|
465
|
+
this.lastAuthAlertAt.set(key, now);
|
|
466
|
+
const affected = [...this.daemons.keys()].filter(n => this.backendOf(n) === backend && this.profileOf(n, backend) === profile);
|
|
441
467
|
const others = affected.filter(n => n !== name);
|
|
468
|
+
const on = profile ? `\`${backend}\` profile \`${profile}\`` : `\`${backend}\``;
|
|
442
469
|
const scope = others.length
|
|
443
|
-
? `${affected.length} instances on
|
|
444
|
-
: `\`${name}\` (${backend})`;
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
const
|
|
470
|
+
? `${affected.length} instances on ${on}: ${affected.join(", ")}`
|
|
471
|
+
: profile ? `\`${name}\` (${backend}, profile \`${profile}\`)` : `\`${name}\` (${backend})`;
|
|
472
|
+
// A profile is signed in with its own variable: `/login <backend>` would sign the DEFAULT login in. claude-code's
|
|
473
|
+
// can be signed in from chat (`/login <backend> <profile>`, #1699 part 2); the others' on the host.
|
|
474
|
+
const profileLogin = profile ? credentialProfileLoginCommand(getAgendHome(), backend, profile) : null;
|
|
475
|
+
const chatLogin = !!profileLogin && CHAT_PROFILE_LOGIN_BACKENDS.has(backend);
|
|
476
|
+
const remedy = chatLogin
|
|
477
|
+
? `Use \`/login ${backend} ${profile}\` to sign that profile in remotely (or run \`${profileLogin}\` on the host).`
|
|
478
|
+
: profileLogin
|
|
479
|
+
? `Run \`${profileLogin}\` on the host, then wake the affected instance(s).`
|
|
480
|
+
: backend === "opencode"
|
|
481
|
+
? "Run `opencode auth login` in a terminal, then wake the affected instance(s)."
|
|
482
|
+
: `Use \`/login ${backend}\` to re-login remotely.`;
|
|
483
|
+
const shared = profile
|
|
484
|
+
? "Credentials are shared per profile — one sign-in restores all of them; affected instances pause until then."
|
|
485
|
+
: "Credentials are shared per backend — one re-login restores all of them; affected instances pause until then.";
|
|
486
|
+
const dispatched = this.notifyIncident(notificationTarget, "auth_error", `🔑 ${message}\n\nAffects ${scope}. ${shared} ${remedy}`);
|
|
449
487
|
// Only alongside an alert somebody actually saw: a button on its own, or one
|
|
450
|
-
// trailing a suppressed alert, is a control with no explanation next to it.
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
488
|
+
// trailing a suppressed alert, is a control with no explanation next to it. For a profile only where its login
|
|
489
|
+
// runs from chat, and then the button carries the profile — the plain button signs the default login in.
|
|
490
|
+
if (dispatched && (!profileLogin || chatLogin)) {
|
|
491
|
+
void (profile ? this.ctx.offerBackendLogin?.(notificationTarget, backend, profile) : this.ctx.offerBackendLogin?.(notificationTarget, backend))
|
|
492
|
+
?.catch(err => this.ctx.logger.warn({ err, backend, profile }, "Could not offer the re-login button"));
|
|
454
493
|
}
|
|
455
494
|
}
|
|
456
495
|
/**
|
|
@@ -503,7 +542,9 @@ export class InstanceLifecycle {
|
|
|
503
542
|
attachLaunchWarningHandler(name, daemon) {
|
|
504
543
|
daemon.on("backend_launch_warning", safeHandler((data) => {
|
|
505
544
|
this.ctx.eventLog?.insert(name, "backend_launch_warning", { message: data.message });
|
|
506
|
-
|
|
545
|
+
// #1794: a quiet warning changes nothing for the user — the Log tab keeps it, the topic does not get it.
|
|
546
|
+
if (data.quiet !== true)
|
|
547
|
+
this.ctx.notifyInstanceTopic(name, t("inst.backend_launch_warning", name, data.message));
|
|
507
548
|
}, this.ctx.logger, `daemon.backend_launch_warning[${name}]`));
|
|
508
549
|
}
|
|
509
550
|
/**
|
|
@@ -804,6 +845,14 @@ export class InstanceLifecycle {
|
|
|
804
845
|
// (Kept `description` for kind === "dialog" rather than a dedicated
|
|
805
846
|
// kiro interactionKind: a new union member would flow into the category
|
|
806
847
|
// labels, summaries and every exhaustive match for one picker's text.)
|
|
848
|
+
// #1691: a prompt no table knows — what it asks (one sanitised, bounded line from the daemon, never the pane), and
|
|
849
|
+
// that AgEnD will not press anything.
|
|
850
|
+
if (data.unrecognised) {
|
|
851
|
+
const asked = data.question ? t("inst.unrecognised_prompt_question", data.question) : "";
|
|
852
|
+
this.notifyIncident(name, "dialog_parked", t("inst.unrecognised_prompt", name, asked));
|
|
853
|
+
this.ctx.notifyFleetError?.(t("fleet.unrecognised_prompt", name, asked));
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
807
856
|
const category = data.kind && data.kind !== "dialog" ? interactionCategory(data.kind, data.backend) : null;
|
|
808
857
|
const text = category ? t("inst.interaction_parked", name, category) : data.holdOnly
|
|
809
858
|
? t("inst.dialog_parked_hold", name, data.description)
|
|
@@ -1218,7 +1267,9 @@ export class InstanceLifecycle {
|
|
|
1218
1267
|
if (seedNow)
|
|
1219
1268
|
daemon.seedActivityNow();
|
|
1220
1269
|
// Read at each spawn so a fleet.yaml reload is honoured (#984).
|
|
1221
|
-
daemon.setPeerWorkingDirectories(
|
|
1270
|
+
daemon.setPeerWorkingDirectories(backendName === "kiro-cli"
|
|
1271
|
+
? this.ctx.kiroPeerWorkingDirectories ? () => this.ctx.kiroPeerWorkingDirectories(name) : undefined
|
|
1272
|
+
: () => peerWorkingDirectories(this.ctx.fleetConfig, name, backendName));
|
|
1222
1273
|
daemon.setStatusEmojiAvoidList(() => this.ctx.statusEmojiAvoidList?.(name));
|
|
1223
1274
|
// Before start: the first spawn builds the command and emits its launch
|
|
1224
1275
|
// warning synchronously inside Daemon.start, long before
|