@tutti-os/agent-gui 0.0.89 → 0.0.91
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 +7 -0
- package/dist/agent-conversation/index.d.ts +2 -2
- package/dist/agent-conversation/index.js +1 -1
- package/dist/{agentGuiNodeTypes-D4mk1Nr3.d.ts → agentGuiNodeTypes-rGaDqxVR.d.ts} +5 -5
- package/dist/app/renderer/agentactivity.css +25 -8
- package/dist/{chunk-KTXWPKGP.js → chunk-7QHBFRG5.js} +1 -1
- package/dist/chunk-7QHBFRG5.js.map +1 -0
- package/dist/{chunk-P7RX2NSY.js → chunk-M2LWH54R.js} +1 -1
- package/dist/{chunk-P7RX2NSY.js.map → chunk-M2LWH54R.js.map} +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +482 -477
- package/dist/index.js.map +1 -1
- package/dist/queued-prompt-runtime.d.ts +2 -2
- package/dist/{types-BvztUbHf.d.ts → types-PLFZ8SBX.d.ts} +6 -6
- package/dist/workbench/contribution.d.ts +1 -1
- package/dist/workbench/contribution.js +1 -1
- package/dist/workbench/index.d.ts +1 -1
- package/dist/workbench/index.js +1 -1
- package/package.json +12 -12
- package/dist/chunk-KTXWPKGP.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
resolveAgentGuiSessionProviderFlatIconUrl,
|
|
15
15
|
resolveNextAgentGUIConversationRailWidthPx,
|
|
16
16
|
shouldAutoCollapseAgentGUIConversationRail
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-M2LWH54R.js";
|
|
18
18
|
import "./chunk-45FF4DQU.js";
|
|
19
19
|
import "./chunk-7LMJXF4R.js";
|
|
20
20
|
import "./chunk-GAPTLVII.js";
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
textPromptContent,
|
|
81
81
|
toLocalShortDateTime,
|
|
82
82
|
useProjectedAgentConversation
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-7QHBFRG5.js";
|
|
84
84
|
import {
|
|
85
85
|
AgentMessageMarkdown,
|
|
86
86
|
AgentTargetPresentationProvider,
|
|
@@ -2366,8 +2366,8 @@ var DEFAULT_AGENT_SETTINGS = {
|
|
|
2366
2366
|
hideWorktreeMismatchDropWarning: false
|
|
2367
2367
|
};
|
|
2368
2368
|
|
|
2369
|
-
//
|
|
2370
|
-
var
|
|
2369
|
+
// agentTargets.ts
|
|
2370
|
+
var agentGUIAgentTargetStaticLabels = {
|
|
2371
2371
|
"claude-code": "Claude Code",
|
|
2372
2372
|
codex: "Codex",
|
|
2373
2373
|
cursor: "Cursor",
|
|
@@ -2390,8 +2390,8 @@ var agentGUIDisabledPlaceholderProviders = [
|
|
|
2390
2390
|
"hermes",
|
|
2391
2391
|
"openclaw"
|
|
2392
2392
|
];
|
|
2393
|
-
function
|
|
2394
|
-
const targetId =
|
|
2393
|
+
function createLocalAgentGUIAgentTarget(provider) {
|
|
2394
|
+
const targetId = localAgentGUIAgentTargetId(provider);
|
|
2395
2395
|
const agentTargetId = localAgentGUIAgentTargetId(provider);
|
|
2396
2396
|
return {
|
|
2397
2397
|
targetId,
|
|
@@ -2401,49 +2401,27 @@ function createLocalAgentGUIProviderTarget(provider) {
|
|
|
2401
2401
|
kind: "local",
|
|
2402
2402
|
provider
|
|
2403
2403
|
},
|
|
2404
|
-
label:
|
|
2404
|
+
label: agentGUIAgentTargetStaticLabels[provider] ?? provider
|
|
2405
2405
|
};
|
|
2406
2406
|
}
|
|
2407
|
-
function
|
|
2407
|
+
function createDisabledPlaceholderAgentGUIAgentTarget(provider) {
|
|
2408
2408
|
return {
|
|
2409
|
-
...
|
|
2409
|
+
...createLocalAgentGUIAgentTarget(provider),
|
|
2410
2410
|
disabled: true
|
|
2411
2411
|
};
|
|
2412
2412
|
}
|
|
2413
|
-
function
|
|
2413
|
+
function createStaticAgentGUIAgentTargets(providers = agentGUIDefaultTargetProviders, options) {
|
|
2414
2414
|
const disabledProviders = new Set(
|
|
2415
2415
|
options?.includeDisabledPlaceholders === true ? agentGUIDisabledPlaceholderProviders : []
|
|
2416
2416
|
);
|
|
2417
2417
|
return providers.map(
|
|
2418
|
-
(provider) => disabledProviders.has(provider) ?
|
|
2418
|
+
(provider) => disabledProviders.has(provider) ? createDisabledPlaceholderAgentGUIAgentTarget(provider) : createLocalAgentGUIAgentTarget(provider)
|
|
2419
2419
|
);
|
|
2420
2420
|
}
|
|
2421
|
-
function localAgentGUIProviderTargetId(provider) {
|
|
2422
|
-
return `local:${provider}`;
|
|
2423
|
-
}
|
|
2424
2421
|
function localAgentGUIAgentTargetId(provider) {
|
|
2425
|
-
|
|
2426
|
-
case "codex":
|
|
2427
|
-
return "local:codex";
|
|
2428
|
-
case "claude-code":
|
|
2429
|
-
return "local:claude-code";
|
|
2430
|
-
case "tutti-agent":
|
|
2431
|
-
return "local:tutti-agent";
|
|
2432
|
-
case "cursor":
|
|
2433
|
-
return "local:cursor";
|
|
2434
|
-
case "hermes":
|
|
2435
|
-
return "local:hermes";
|
|
2436
|
-
case "nexight":
|
|
2437
|
-
return "local:nexight";
|
|
2438
|
-
case "openclaw":
|
|
2439
|
-
return "local:openclaw";
|
|
2440
|
-
case "opencode":
|
|
2441
|
-
return "local:opencode";
|
|
2442
|
-
default:
|
|
2443
|
-
return null;
|
|
2444
|
-
}
|
|
2422
|
+
return `local:${provider}`;
|
|
2445
2423
|
}
|
|
2446
|
-
function
|
|
2424
|
+
function normalizeAgentGUIAgentTargets(targets, options) {
|
|
2447
2425
|
const includeDisabledPlaceholders = options?.includeDisabledPlaceholders === true;
|
|
2448
2426
|
const useStaticCatalog = options?.useStaticCatalog !== false;
|
|
2449
2427
|
const source = targets && targets.length > 0 ? targets : [];
|
|
@@ -2451,7 +2429,7 @@ function normalizeAgentGUIProviderTargets(targets, options) {
|
|
|
2451
2429
|
const seenTargetKeys = /* @__PURE__ */ new Set();
|
|
2452
2430
|
const seenProviders = /* @__PURE__ */ new Set();
|
|
2453
2431
|
for (const target of source) {
|
|
2454
|
-
const normalized =
|
|
2432
|
+
const normalized = normalizeAgentGUIAgentTarget(target);
|
|
2455
2433
|
if (!normalized) {
|
|
2456
2434
|
continue;
|
|
2457
2435
|
}
|
|
@@ -2469,15 +2447,15 @@ function normalizeAgentGUIProviderTargets(targets, options) {
|
|
|
2469
2447
|
continue;
|
|
2470
2448
|
}
|
|
2471
2449
|
normalizedTargets.push(
|
|
2472
|
-
|
|
2450
|
+
createDisabledPlaceholderAgentGUIAgentTarget(provider)
|
|
2473
2451
|
);
|
|
2474
2452
|
}
|
|
2475
2453
|
}
|
|
2476
|
-
return normalizedTargets.length > 0 || !useStaticCatalog ? normalizedTargets :
|
|
2454
|
+
return normalizedTargets.length > 0 || !useStaticCatalog ? normalizedTargets : createStaticAgentGUIAgentTargets(void 0, {
|
|
2477
2455
|
includeDisabledPlaceholders
|
|
2478
2456
|
});
|
|
2479
2457
|
}
|
|
2480
|
-
function
|
|
2458
|
+
function normalizeAgentGUIAgentTarget(target) {
|
|
2481
2459
|
const {
|
|
2482
2460
|
targetId: _targetId,
|
|
2483
2461
|
agentTargetId: _agentTargetId,
|
|
@@ -2498,7 +2476,7 @@ function normalizeAgentGUIProviderTarget(target) {
|
|
|
2498
2476
|
if (!targetId || !label || !kind || target.ref.provider !== target.provider) {
|
|
2499
2477
|
return null;
|
|
2500
2478
|
}
|
|
2501
|
-
const normalizedBadge =
|
|
2479
|
+
const normalizedBadge = normalizeAgentGUIAgentTargetBadge(badge);
|
|
2502
2480
|
return {
|
|
2503
2481
|
...rest,
|
|
2504
2482
|
targetId,
|
|
@@ -2517,7 +2495,7 @@ function normalizeAgentGUIProviderTarget(target) {
|
|
|
2517
2495
|
...unavailableReason?.trim() ? { unavailableReason: unavailableReason.trim() } : {}
|
|
2518
2496
|
};
|
|
2519
2497
|
}
|
|
2520
|
-
function
|
|
2498
|
+
function normalizeAgentGUIAgentTargetBadge(badge) {
|
|
2521
2499
|
const iconUrl = badge?.iconUrl?.trim() ?? "";
|
|
2522
2500
|
if (!iconUrl) {
|
|
2523
2501
|
return null;
|
|
@@ -7010,7 +6988,7 @@ function composerDefaultsPatchFromSettings(touched, finalSettings) {
|
|
|
7010
6988
|
}
|
|
7011
6989
|
return Object.keys(patch).length > 0 ? patch : null;
|
|
7012
6990
|
}
|
|
7013
|
-
function
|
|
6991
|
+
function composerTargetDataFromAgentTarget(input) {
|
|
7014
6992
|
const agentTargetId = normalizeOptionalText2(input.target.agentTargetId);
|
|
7015
6993
|
const currentAgentTargetId = normalizeOptionalText2(
|
|
7016
6994
|
input.current.agentTargetId
|
|
@@ -7034,7 +7012,7 @@ function composerTargetDataFromProviderTarget(input) {
|
|
|
7034
7012
|
}
|
|
7035
7013
|
};
|
|
7036
7014
|
}
|
|
7037
|
-
function
|
|
7015
|
+
function isExplicitAgentGUIAgentTarget(target, explicitTargets) {
|
|
7038
7016
|
return explicitTargets.some(
|
|
7039
7017
|
(candidate) => candidate.agentTargetId === target.agentTargetId
|
|
7040
7018
|
);
|
|
@@ -7052,8 +7030,8 @@ function resolveAgentGUIDirectorySelection(input) {
|
|
|
7052
7030
|
if (agentTargetId) {
|
|
7053
7031
|
return findAgentGUIDirectoryTarget(input.targets, agentTargetId) ?? null;
|
|
7054
7032
|
}
|
|
7055
|
-
const
|
|
7056
|
-
return
|
|
7033
|
+
const agentTargets = input.provider ? input.targets.filter((target) => target.provider === input.provider) : [];
|
|
7034
|
+
return agentTargets.find((target) => target.disabled !== true) ?? agentTargets[0] ?? input.targets.find((target) => target.disabled !== true) ?? input.targets[0] ?? null;
|
|
7057
7035
|
}
|
|
7058
7036
|
function resolveAgentGUIHomeDirectorySelection(input) {
|
|
7059
7037
|
const dataAgentTargetId = normalizeOptionalText2(input.data.agentTargetId);
|
|
@@ -7184,7 +7162,7 @@ function sanitizeComposerSettingsForTarget(input) {
|
|
|
7184
7162
|
}
|
|
7185
7163
|
return sanitizeComposerSettingsForOptions(input.settings, input.options);
|
|
7186
7164
|
}
|
|
7187
|
-
function
|
|
7165
|
+
function agentGUIAgentTargetsEqual(left, right) {
|
|
7188
7166
|
return (left.agentTargetId ?? left.targetId) === (right.agentTargetId ?? right.targetId);
|
|
7189
7167
|
}
|
|
7190
7168
|
function reportAgentGUIDiagnostic(runtime, input) {
|
|
@@ -7239,7 +7217,7 @@ function reportAgentGUIConversationFilterTargetUnresolved(input) {
|
|
|
7239
7217
|
details: {
|
|
7240
7218
|
agentTargetId: input.agentTargetId,
|
|
7241
7219
|
provider: input.provider,
|
|
7242
|
-
|
|
7220
|
+
agentTargetCount: input.agentTargetCount,
|
|
7243
7221
|
reason: input.reason
|
|
7244
7222
|
},
|
|
7245
7223
|
event: "agent.gui.conversation_filter.target_unresolved",
|
|
@@ -7284,15 +7262,15 @@ function reportAgentGUIRenderStateDiagnostic(input) {
|
|
|
7284
7262
|
isInterrupting: input.isInterrupting,
|
|
7285
7263
|
isLoadingMessages: input.isLoadingMessages,
|
|
7286
7264
|
isSubmitting: input.isSubmitting,
|
|
7287
|
-
|
|
7265
|
+
agentTargetsLoading: input.agentTargetsLoading,
|
|
7288
7266
|
pendingApprovalRequestId: input.pendingApproval?.requestId ?? null,
|
|
7289
7267
|
pendingInteractivePromptKind: input.pendingInteractivePrompt?.kind ?? null,
|
|
7290
7268
|
pendingInteractivePromptRequestId: promptRequestId(
|
|
7291
7269
|
input.pendingInteractivePrompt
|
|
7292
7270
|
),
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7271
|
+
selectedAgentTargetDisabled: input.selectedAgentTargetDisabled,
|
|
7272
|
+
selectedAgentTargetId: input.selectedAgentTargetId,
|
|
7273
|
+
selectedAgentTargetIsExplicit: input.selectedAgentTargetIsExplicit,
|
|
7296
7274
|
sessionAuthBlocked: input.sessionAuthBlocked,
|
|
7297
7275
|
runtimeSession: agentGUIRuntimeSessionDiagnosticDetails(
|
|
7298
7276
|
input.activeRuntimeSession
|
|
@@ -9209,8 +9187,8 @@ function useAgentGUINodeController({
|
|
|
9209
9187
|
workspacePath,
|
|
9210
9188
|
avoidGroupingEdits,
|
|
9211
9189
|
data,
|
|
9212
|
-
|
|
9213
|
-
|
|
9190
|
+
agentTargets,
|
|
9191
|
+
agentTargetsLoading = false,
|
|
9214
9192
|
providerReadinessGates = null,
|
|
9215
9193
|
defaultAgentTargetId = null,
|
|
9216
9194
|
openSessionRequest = null,
|
|
@@ -9241,95 +9219,87 @@ function useAgentGUINodeController({
|
|
|
9241
9219
|
const agentQueuedPromptRuntime = useAgentQueuedPromptRuntime();
|
|
9242
9220
|
const agentHostApi = useAgentHostApi();
|
|
9243
9221
|
const agentActivitySnapshot = useAgentActivitySnapshot(workspaceId);
|
|
9244
|
-
const
|
|
9245
|
-
() =>
|
|
9222
|
+
const normalizedExplicitAgentTargets = useMemo3(
|
|
9223
|
+
() => normalizeAgentGUIAgentTargets(agentTargets, {
|
|
9246
9224
|
// AgentGUINode always passes the projected `/agents` array, including
|
|
9247
9225
|
// an explicit empty array. The undefined branch exists only for direct
|
|
9248
9226
|
// package-internal controller harnesses and legacy tests.
|
|
9249
|
-
useStaticCatalog:
|
|
9227
|
+
useStaticCatalog: agentTargets === void 0
|
|
9250
9228
|
}),
|
|
9251
|
-
[
|
|
9229
|
+
[agentTargets]
|
|
9252
9230
|
);
|
|
9253
|
-
const
|
|
9254
|
-
const
|
|
9255
|
-
() =>
|
|
9231
|
+
const normalizedAgentTargets = agentTargetsLoading ? [] : normalizedExplicitAgentTargets;
|
|
9232
|
+
const handoffAgentTargets = useMemo3(
|
|
9233
|
+
() => agentTargetsLoading ? [] : normalizedExplicitAgentTargets.filter(
|
|
9256
9234
|
(target) => target.disabled !== true
|
|
9257
9235
|
),
|
|
9258
|
-
[
|
|
9236
|
+
[normalizedExplicitAgentTargets, agentTargetsLoading]
|
|
9259
9237
|
);
|
|
9260
9238
|
const homeDirectorySelection = useMemo3(() => {
|
|
9261
9239
|
return resolveAgentGUIHomeDirectorySelection({
|
|
9262
9240
|
data,
|
|
9263
9241
|
defaultAgentTargetId,
|
|
9264
|
-
directory:
|
|
9265
|
-
directoryLoading:
|
|
9242
|
+
directory: normalizedAgentTargets,
|
|
9243
|
+
directoryLoading: agentTargetsLoading
|
|
9266
9244
|
});
|
|
9267
|
-
}, [
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
]);
|
|
9273
|
-
const selectedProviderTarget = homeDirectorySelection.target;
|
|
9274
|
-
const selectedProviderTargetIsExplicit = useMemo3(
|
|
9275
|
-
() => normalizedExplicitProviderTargets.some(
|
|
9276
|
-
(target) => target.agentTargetId === selectedProviderTarget.agentTargetId
|
|
9245
|
+
}, [data, defaultAgentTargetId, normalizedAgentTargets, agentTargetsLoading]);
|
|
9246
|
+
const selectedAgentTarget = homeDirectorySelection.target;
|
|
9247
|
+
const selectedAgentTargetIsExplicit = useMemo3(
|
|
9248
|
+
() => normalizedExplicitAgentTargets.some(
|
|
9249
|
+
(target) => target.agentTargetId === selectedAgentTarget.agentTargetId
|
|
9277
9250
|
),
|
|
9278
|
-
[
|
|
9251
|
+
[normalizedExplicitAgentTargets, selectedAgentTarget]
|
|
9279
9252
|
);
|
|
9280
9253
|
const [homeComposerTargetOverride, setHomeComposerTargetOverride] = useState4(null);
|
|
9281
9254
|
const homeComposerTargetOverrideIsExplicit = useMemo3(
|
|
9282
|
-
() => homeComposerTargetOverride ?
|
|
9255
|
+
() => homeComposerTargetOverride ? normalizedExplicitAgentTargets.some(
|
|
9283
9256
|
(target) => target.agentTargetId === homeComposerTargetOverride.agentTargetId
|
|
9284
9257
|
) : false,
|
|
9285
|
-
[homeComposerTargetOverride,
|
|
9258
|
+
[homeComposerTargetOverride, normalizedExplicitAgentTargets]
|
|
9286
9259
|
);
|
|
9287
|
-
const
|
|
9288
|
-
const
|
|
9289
|
-
const
|
|
9260
|
+
const effectiveSelectedAgentTarget = homeComposerTargetOverride ?? selectedAgentTarget;
|
|
9261
|
+
const effectiveSelectedAgentTargetIsExplicit = homeComposerTargetOverride ? homeComposerTargetOverrideIsExplicit : selectedAgentTargetIsExplicit;
|
|
9262
|
+
const firstReadyHomeComposerAgentTarget = useMemo3(() => {
|
|
9290
9263
|
if (!providerReadinessGates) {
|
|
9291
9264
|
return null;
|
|
9292
9265
|
}
|
|
9293
|
-
return
|
|
9266
|
+
return normalizedAgentTargets.find(
|
|
9294
9267
|
(target) => target.disabled !== true && providerReadinessGates[target.provider] === null
|
|
9295
9268
|
) ?? null;
|
|
9296
|
-
}, [
|
|
9297
|
-
const
|
|
9269
|
+
}, [normalizedAgentTargets, providerReadinessGates]);
|
|
9270
|
+
const nodeComposerTargetResolvedByAgentTarget = agentGUINodeDataHasComposerTarget(data) && selectedAgentTarget.agentTargetId === normalizeOptionalText2(data.agentTargetId);
|
|
9298
9271
|
const selectedComposerTargetData = useMemo3(
|
|
9299
|
-
() => homeComposerTargetOverride ?
|
|
9272
|
+
() => homeComposerTargetOverride ? composerTargetDataFromAgentTarget({
|
|
9300
9273
|
current: data,
|
|
9301
9274
|
isExplicit: homeComposerTargetOverrideIsExplicit,
|
|
9302
9275
|
target: homeComposerTargetOverride
|
|
9303
|
-
}) :
|
|
9276
|
+
}) : nodeComposerTargetResolvedByAgentTarget ? composerTargetDataFromAgentTarget({
|
|
9304
9277
|
current: data,
|
|
9305
|
-
isExplicit:
|
|
9306
|
-
target:
|
|
9307
|
-
}) : agentGUINodeDataHasComposerTarget(data) && data.lastActiveAgentSessionId !== null ? composerTargetDataFromNodeData(data,
|
|
9278
|
+
isExplicit: selectedAgentTargetIsExplicit,
|
|
9279
|
+
target: selectedAgentTarget
|
|
9280
|
+
}) : agentGUINodeDataHasComposerTarget(data) && data.lastActiveAgentSessionId !== null ? composerTargetDataFromNodeData(data, normalizedAgentTargets) : composerTargetDataFromAgentTarget({
|
|
9308
9281
|
current: data,
|
|
9309
|
-
isExplicit:
|
|
9310
|
-
target:
|
|
9282
|
+
isExplicit: selectedAgentTargetIsExplicit,
|
|
9283
|
+
target: selectedAgentTarget
|
|
9311
9284
|
}),
|
|
9312
9285
|
[
|
|
9313
9286
|
data,
|
|
9314
9287
|
homeComposerTargetOverride,
|
|
9315
9288
|
homeComposerTargetOverrideIsExplicit,
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9289
|
+
nodeComposerTargetResolvedByAgentTarget,
|
|
9290
|
+
normalizedAgentTargets,
|
|
9291
|
+
selectedAgentTarget,
|
|
9292
|
+
selectedAgentTargetIsExplicit
|
|
9320
9293
|
]
|
|
9321
9294
|
);
|
|
9322
9295
|
useEffect4(() => {
|
|
9323
9296
|
if (!homeComposerTargetOverride) {
|
|
9324
9297
|
return;
|
|
9325
9298
|
}
|
|
9326
|
-
if (
|
|
9327
|
-
homeComposerTargetOverride,
|
|
9328
|
-
selectedProviderTarget
|
|
9329
|
-
)) {
|
|
9299
|
+
if (agentGUIAgentTargetsEqual(homeComposerTargetOverride, selectedAgentTarget)) {
|
|
9330
9300
|
setHomeComposerTargetOverride(null);
|
|
9331
9301
|
}
|
|
9332
|
-
}, [homeComposerTargetOverride,
|
|
9302
|
+
}, [homeComposerTargetOverride, selectedAgentTarget]);
|
|
9333
9303
|
const agentActivityDisplayStatusesRef = useRef4(null);
|
|
9334
9304
|
const agentActivityDisplayStatuses = useMemo3(() => {
|
|
9335
9305
|
const next = selectSessionDisplayStatuses(agentActivitySnapshot);
|
|
@@ -9467,7 +9437,7 @@ function useAgentGUINodeController({
|
|
|
9467
9437
|
sessionViewRef(activeConversationId)
|
|
9468
9438
|
);
|
|
9469
9439
|
const activeSessionState = activeSessionView?.controlState ?? null;
|
|
9470
|
-
const composerTargetData = activeConversationId === null ? selectedComposerTargetData : composerTargetDataFromNodeData(data,
|
|
9440
|
+
const composerTargetData = activeConversationId === null ? selectedComposerTargetData : composerTargetDataFromNodeData(data, normalizedAgentTargets);
|
|
9471
9441
|
const providerComposerOptions = composerOptionsForTarget({
|
|
9472
9442
|
snapshot: agentActivitySnapshot,
|
|
9473
9443
|
target: composerTargetData
|
|
@@ -9728,18 +9698,18 @@ function useAgentGUINodeController({
|
|
|
9728
9698
|
agentActivitySnapshot
|
|
9729
9699
|
);
|
|
9730
9700
|
const dataRef = useRef4(data);
|
|
9731
|
-
const
|
|
9732
|
-
|
|
9733
|
-
const
|
|
9734
|
-
|
|
9735
|
-
);
|
|
9736
|
-
|
|
9737
|
-
const
|
|
9738
|
-
|
|
9701
|
+
const selectedAgentTargetRef = useRef4(effectiveSelectedAgentTarget);
|
|
9702
|
+
selectedAgentTargetRef.current = effectiveSelectedAgentTarget;
|
|
9703
|
+
const selectedAgentTargetIsExplicitRef = useRef4(
|
|
9704
|
+
effectiveSelectedAgentTargetIsExplicit
|
|
9705
|
+
);
|
|
9706
|
+
selectedAgentTargetIsExplicitRef.current = effectiveSelectedAgentTargetIsExplicit;
|
|
9707
|
+
const agentTargetsProvidedRef = useRef4(agentTargets !== void 0);
|
|
9708
|
+
agentTargetsProvidedRef.current = agentTargets !== void 0;
|
|
9739
9709
|
const selectedComposerTargetDataRef = useRef4(selectedComposerTargetData);
|
|
9740
9710
|
selectedComposerTargetDataRef.current = selectedComposerTargetData;
|
|
9741
|
-
const
|
|
9742
|
-
|
|
9711
|
+
const normalizedAgentTargetsRef = useRef4(normalizedAgentTargets);
|
|
9712
|
+
normalizedAgentTargetsRef.current = normalizedAgentTargets;
|
|
9743
9713
|
const draftSettingsBySessionIdRef = useRef4(draftSettingsBySessionId);
|
|
9744
9714
|
const onDataChangeRef = useRef4(onDataChange);
|
|
9745
9715
|
const onRememberComposerDefaultsRef = useRef4(onRememberComposerDefaults);
|
|
@@ -11421,7 +11391,7 @@ function useAgentGUINodeController({
|
|
|
11421
11391
|
(options) => {
|
|
11422
11392
|
const targetData = activeConversationIdRef.current === null ? selectedComposerTargetDataRef.current : composerTargetDataFromNodeData(
|
|
11423
11393
|
dataRef.current,
|
|
11424
|
-
|
|
11394
|
+
normalizedAgentTargetsRef.current
|
|
11425
11395
|
);
|
|
11426
11396
|
loadComposerOptionsForTarget(targetData, options);
|
|
11427
11397
|
},
|
|
@@ -12157,10 +12127,10 @@ function useAgentGUINodeController({
|
|
|
12157
12127
|
}, []);
|
|
12158
12128
|
const startConversation = useCallback4(
|
|
12159
12129
|
(initialContentInput, displayPrompt) => {
|
|
12160
|
-
const target =
|
|
12130
|
+
const target = selectedAgentTargetRef.current;
|
|
12161
12131
|
const targetData = selectedComposerTargetDataRef.current;
|
|
12162
12132
|
const agentTargetId = targetData.agentTargetId ?? "";
|
|
12163
|
-
if (!agentTargetId ||
|
|
12133
|
+
if (!agentTargetId || agentTargetsProvidedRef.current && !selectedAgentTargetIsExplicitRef.current) {
|
|
12164
12134
|
setDetailError(translate("agentHost.agentGui.agentTargetRequired"));
|
|
12165
12135
|
return;
|
|
12166
12136
|
}
|
|
@@ -12698,7 +12668,7 @@ function useAgentGUINodeController({
|
|
|
12698
12668
|
const filterTarget = resolveAgentGUIDirectorySelection({
|
|
12699
12669
|
agentTargetId: filter.agentTargetId,
|
|
12700
12670
|
provider: dataRef.current.provider,
|
|
12701
|
-
targets:
|
|
12671
|
+
targets: normalizedAgentTargets
|
|
12702
12672
|
});
|
|
12703
12673
|
if (filterTarget && filterTarget.disabled !== true && (filterTarget.agentTargetId?.trim() ?? "") === filter.agentTargetId) {
|
|
12704
12674
|
setHomeComposerTargetOverride(filterTarget);
|
|
@@ -12739,7 +12709,7 @@ function useAgentGUINodeController({
|
|
|
12739
12709
|
agentActivityRuntime,
|
|
12740
12710
|
defaultAgentTargetId,
|
|
12741
12711
|
loadDraftComposerOptions,
|
|
12742
|
-
|
|
12712
|
+
normalizedAgentTargets,
|
|
12743
12713
|
persistActiveConversation,
|
|
12744
12714
|
workspaceId
|
|
12745
12715
|
]
|
|
@@ -12751,7 +12721,7 @@ function useAgentGUINodeController({
|
|
|
12751
12721
|
if (handledPrefillPromptSequenceRef.current === prefillPromptRequest.sequence) {
|
|
12752
12722
|
return;
|
|
12753
12723
|
}
|
|
12754
|
-
if (
|
|
12724
|
+
if (agentTargetsLoading && prefillPromptRequest.agentTargetId?.trim()) {
|
|
12755
12725
|
return;
|
|
12756
12726
|
}
|
|
12757
12727
|
const selectedTargetData = selectedComposerTargetDataRef.current;
|
|
@@ -12759,7 +12729,7 @@ function useAgentGUINodeController({
|
|
|
12759
12729
|
const prefillTarget = prefillTargetHinted ? resolveAgentGUIDirectorySelection({
|
|
12760
12730
|
agentTargetId: prefillPromptRequest.agentTargetId,
|
|
12761
12731
|
provider: prefillPromptRequest.provider ?? selectedTargetData.provider,
|
|
12762
|
-
targets:
|
|
12732
|
+
targets: normalizedAgentTargets
|
|
12763
12733
|
}) : null;
|
|
12764
12734
|
handledPrefillPromptSequenceRef.current = prefillPromptRequest.sequence;
|
|
12765
12735
|
if (prefillPromptRequest.agentTargetId?.trim() && !prefillTarget) {
|
|
@@ -12795,11 +12765,11 @@ function useAgentGUINodeController({
|
|
|
12795
12765
|
setActiveConversationId(null);
|
|
12796
12766
|
setIsLoadingMessages(false);
|
|
12797
12767
|
setDetailError(null);
|
|
12798
|
-
const targetData = prefillTarget ?
|
|
12768
|
+
const targetData = prefillTarget ? composerTargetDataFromAgentTarget({
|
|
12799
12769
|
current: dataRef.current,
|
|
12800
|
-
isExplicit:
|
|
12770
|
+
isExplicit: isExplicitAgentGUIAgentTarget(
|
|
12801
12771
|
prefillTarget,
|
|
12802
|
-
|
|
12772
|
+
normalizedExplicitAgentTargets
|
|
12803
12773
|
),
|
|
12804
12774
|
target: prefillTarget
|
|
12805
12775
|
}) : selectedTargetData;
|
|
@@ -12809,11 +12779,11 @@ function useAgentGUINodeController({
|
|
|
12809
12779
|
targetData.agentTargetId ? { kind: "agentTarget", agentTargetId: targetData.agentTargetId } : { kind: "all" }
|
|
12810
12780
|
);
|
|
12811
12781
|
onDataChangeRef.current((current) => {
|
|
12812
|
-
const nextTargetData =
|
|
12782
|
+
const nextTargetData = composerTargetDataFromAgentTarget({
|
|
12813
12783
|
current,
|
|
12814
|
-
isExplicit:
|
|
12784
|
+
isExplicit: isExplicitAgentGUIAgentTarget(
|
|
12815
12785
|
prefillTarget,
|
|
12816
|
-
|
|
12786
|
+
normalizedExplicitAgentTargets
|
|
12817
12787
|
),
|
|
12818
12788
|
target: prefillTarget
|
|
12819
12789
|
});
|
|
@@ -12845,12 +12815,12 @@ function useAgentGUINodeController({
|
|
|
12845
12815
|
agentActivityRuntime,
|
|
12846
12816
|
defaultAgentTargetId,
|
|
12847
12817
|
loadDraftComposerOptions,
|
|
12848
|
-
|
|
12849
|
-
|
|
12818
|
+
normalizedExplicitAgentTargets,
|
|
12819
|
+
normalizedAgentTargets,
|
|
12850
12820
|
persistActiveConversation,
|
|
12851
12821
|
prefillPromptRequest,
|
|
12852
12822
|
previewMode,
|
|
12853
|
-
|
|
12823
|
+
agentTargetsLoading,
|
|
12854
12824
|
workspaceId
|
|
12855
12825
|
]);
|
|
12856
12826
|
const continueInNewConversation = useCallback4(() => {
|
|
@@ -14978,7 +14948,7 @@ function useAgentGUINodeController({
|
|
|
14978
14948
|
workspacePath
|
|
14979
14949
|
]);
|
|
14980
14950
|
useEffect4(() => {
|
|
14981
|
-
if (previewMode ||
|
|
14951
|
+
if (previewMode || agentTargetsLoading || !activeConversationId) {
|
|
14982
14952
|
return;
|
|
14983
14953
|
}
|
|
14984
14954
|
const summary = resolveConversationSummaryById(
|
|
@@ -14998,7 +14968,7 @@ function useAgentGUINodeController({
|
|
|
14998
14968
|
const sessionTarget = resolveAgentGUIDirectorySelection({
|
|
14999
14969
|
agentTargetId: summaryAgentTargetId,
|
|
15000
14970
|
provider: summary.provider,
|
|
15001
|
-
targets:
|
|
14971
|
+
targets: normalizedAgentTargets
|
|
15002
14972
|
});
|
|
15003
14973
|
if (!sessionTarget || sessionTarget.provider !== summary.provider) {
|
|
15004
14974
|
return;
|
|
@@ -15007,11 +14977,11 @@ function useAgentGUINodeController({
|
|
|
15007
14977
|
return;
|
|
15008
14978
|
}
|
|
15009
14979
|
setHomeComposerTargetOverride(null);
|
|
15010
|
-
const sessionTargetIsExplicit =
|
|
15011
|
-
(target) =>
|
|
14980
|
+
const sessionTargetIsExplicit = normalizedExplicitAgentTargets.some(
|
|
14981
|
+
(target) => agentGUIAgentTargetsEqual(target, sessionTarget)
|
|
15012
14982
|
);
|
|
15013
14983
|
onDataChangeRef.current((current) => {
|
|
15014
|
-
const targetData =
|
|
14984
|
+
const targetData = composerTargetDataFromAgentTarget({
|
|
15015
14985
|
current,
|
|
15016
14986
|
isExplicit: sessionTargetIsExplicit,
|
|
15017
14987
|
target: sessionTarget
|
|
@@ -15026,19 +14996,16 @@ function useAgentGUINodeController({
|
|
|
15026
14996
|
activeConversationId,
|
|
15027
14997
|
conversations,
|
|
15028
14998
|
defaultAgentTargetId,
|
|
15029
|
-
|
|
15030
|
-
|
|
14999
|
+
normalizedExplicitAgentTargets,
|
|
15000
|
+
normalizedAgentTargets,
|
|
15031
15001
|
previewMode,
|
|
15032
|
-
|
|
15002
|
+
agentTargetsLoading
|
|
15033
15003
|
]);
|
|
15034
15004
|
const activeSessionTargetResolution = useMemo3(() => {
|
|
15035
15005
|
if (previewMode || activeConversationId === null) {
|
|
15036
15006
|
return {
|
|
15037
15007
|
status: "resolved",
|
|
15038
|
-
target: composerTargetDataFromNodeData(
|
|
15039
|
-
data,
|
|
15040
|
-
normalizedProviderTargets
|
|
15041
|
-
),
|
|
15008
|
+
target: composerTargetDataFromNodeData(data, normalizedAgentTargets),
|
|
15042
15009
|
missingAgentTargetId: null
|
|
15043
15010
|
};
|
|
15044
15011
|
}
|
|
@@ -15048,16 +15015,16 @@ function useAgentGUINodeController({
|
|
|
15048
15015
|
// key; the node's persisted agentTargetId can lag when the reconcile
|
|
15049
15016
|
// effect declines to overwrite an explicit target with a fallback.
|
|
15050
15017
|
foreignKeyAgentTargetId: activeConversation?.agentTargetId ?? data.agentTargetId ?? null,
|
|
15051
|
-
directory:
|
|
15052
|
-
directoryLoading:
|
|
15018
|
+
directory: normalizedAgentTargets,
|
|
15019
|
+
directoryLoading: agentTargetsLoading
|
|
15053
15020
|
});
|
|
15054
15021
|
}, [
|
|
15055
15022
|
activeConversation?.agentTargetId,
|
|
15056
15023
|
activeConversationId,
|
|
15057
15024
|
data,
|
|
15058
|
-
|
|
15025
|
+
normalizedAgentTargets,
|
|
15059
15026
|
previewMode,
|
|
15060
|
-
|
|
15027
|
+
agentTargetsLoading
|
|
15061
15028
|
]);
|
|
15062
15029
|
const activeSessionTargetMissing = activeSessionTargetResolution.status === "missing";
|
|
15063
15030
|
const visibleConversationsRef = useRef4(
|
|
@@ -15473,7 +15440,7 @@ function useAgentGUINodeController({
|
|
|
15473
15440
|
hasProviderSessionNotFoundError,
|
|
15474
15441
|
pendingApproval
|
|
15475
15442
|
]);
|
|
15476
|
-
const canSubmit = !
|
|
15443
|
+
const canSubmit = !agentTargetsLoading && activeLiveState !== "activating" && activeLiveState !== "failed" && !activeConversationResumeUnavailable && (activeConversationId !== null || effectiveSelectedAgentTarget.disabled !== true && effectiveSelectedAgentTargetIsExplicit) && (composerTargetData.provider !== "openclaw" || openclawGateway?.status === "ready") && pendingApproval === null && pendingInteractivePrompt === null && sessionChrome.auth === null && !activeConversationBusy && !isCreatingConversation && !isSubmitting && !isInterrupting;
|
|
15477
15444
|
const activeConversationCreatePending = Boolean(activeConversationId) && isCreatingConversation && startingConversationIdRef.current === activeConversationId;
|
|
15478
15445
|
const canQueueWhileBusy = Boolean(activeConversationId) && (activeConversationCreatePending || activeConversationBusy || isSubmitting || Boolean(activeSessionState?.pendingInteractive));
|
|
15479
15446
|
useEffect4(() => {
|
|
@@ -15531,11 +15498,11 @@ function useAgentGUINodeController({
|
|
|
15531
15498
|
isSubmitting,
|
|
15532
15499
|
pendingApproval,
|
|
15533
15500
|
pendingInteractivePrompt,
|
|
15534
|
-
|
|
15501
|
+
agentTargetsLoading,
|
|
15535
15502
|
runtime: agentActivityRuntime,
|
|
15536
|
-
|
|
15537
|
-
|
|
15538
|
-
|
|
15503
|
+
selectedAgentTargetDisabled: effectiveSelectedAgentTarget.disabled === true,
|
|
15504
|
+
selectedAgentTargetId: effectiveSelectedAgentTarget.agentTargetId ?? null,
|
|
15505
|
+
selectedAgentTargetIsExplicit: effectiveSelectedAgentTargetIsExplicit,
|
|
15539
15506
|
sessionAuthBlocked: sessionChrome.auth !== null,
|
|
15540
15507
|
workspaceId
|
|
15541
15508
|
});
|
|
@@ -15554,16 +15521,16 @@ function useAgentGUINodeController({
|
|
|
15554
15521
|
canQueueWhileBusy,
|
|
15555
15522
|
canSubmit,
|
|
15556
15523
|
conversation,
|
|
15557
|
-
|
|
15558
|
-
|
|
15559
|
-
|
|
15524
|
+
effectiveSelectedAgentTarget.agentTargetId,
|
|
15525
|
+
effectiveSelectedAgentTarget.disabled,
|
|
15526
|
+
effectiveSelectedAgentTargetIsExplicit,
|
|
15560
15527
|
isCreatingConversation,
|
|
15561
15528
|
isInterrupting,
|
|
15562
15529
|
isLoadingMessages,
|
|
15563
15530
|
isSubmitting,
|
|
15564
15531
|
pendingApproval,
|
|
15565
15532
|
pendingInteractivePrompt,
|
|
15566
|
-
|
|
15533
|
+
agentTargetsLoading,
|
|
15567
15534
|
sessionChrome.auth,
|
|
15568
15535
|
workspaceId
|
|
15569
15536
|
]);
|
|
@@ -15680,12 +15647,12 @@ function useAgentGUINodeController({
|
|
|
15680
15647
|
const defaultTargetId = defaultAgentTargetId?.trim() ?? "";
|
|
15681
15648
|
if (defaultTargetId) {
|
|
15682
15649
|
return findAgentGUIDirectoryTarget(
|
|
15683
|
-
|
|
15650
|
+
normalizedAgentTargets,
|
|
15684
15651
|
defaultTargetId
|
|
15685
15652
|
) ?? null;
|
|
15686
15653
|
}
|
|
15687
|
-
return
|
|
15688
|
-
}, [defaultAgentTargetId,
|
|
15654
|
+
return normalizedAgentTargets.find((target) => target.disabled !== true) ?? normalizedAgentTargets[0] ?? null;
|
|
15655
|
+
}, [defaultAgentTargetId, normalizedAgentTargets]);
|
|
15689
15656
|
const resetHomeComposerAgentTargetToDefault = useCallback4(() => {
|
|
15690
15657
|
if (previewMode) {
|
|
15691
15658
|
return;
|
|
@@ -15694,10 +15661,10 @@ function useAgentGUINodeController({
|
|
|
15694
15661
|
if (!nextTarget) {
|
|
15695
15662
|
return;
|
|
15696
15663
|
}
|
|
15697
|
-
const nextTargetIsExplicit =
|
|
15698
|
-
(target) =>
|
|
15664
|
+
const nextTargetIsExplicit = normalizedExplicitAgentTargets.some(
|
|
15665
|
+
(target) => agentGUIAgentTargetsEqual(target, nextTarget)
|
|
15699
15666
|
);
|
|
15700
|
-
const nextTargetData =
|
|
15667
|
+
const nextTargetData = composerTargetDataFromAgentTarget({
|
|
15701
15668
|
current: dataRef.current,
|
|
15702
15669
|
isExplicit: nextTargetIsExplicit,
|
|
15703
15670
|
target: nextTarget
|
|
@@ -15707,7 +15674,7 @@ function useAgentGUINodeController({
|
|
|
15707
15674
|
isComposerHomeRef.current = true;
|
|
15708
15675
|
setIsComposerHome(true);
|
|
15709
15676
|
onDataChangeRef.current((current) => {
|
|
15710
|
-
const currentNextTargetData =
|
|
15677
|
+
const currentNextTargetData = composerTargetDataFromAgentTarget({
|
|
15711
15678
|
current,
|
|
15712
15679
|
isExplicit: nextTargetIsExplicit,
|
|
15713
15680
|
target: nextTarget
|
|
@@ -15728,7 +15695,7 @@ function useAgentGUINodeController({
|
|
|
15728
15695
|
}
|
|
15729
15696
|
}, [
|
|
15730
15697
|
loadComposerOptionsForTarget,
|
|
15731
|
-
|
|
15698
|
+
normalizedExplicitAgentTargets,
|
|
15732
15699
|
previewMode,
|
|
15733
15700
|
resolveDefaultHomeComposerTarget
|
|
15734
15701
|
]);
|
|
@@ -15751,15 +15718,15 @@ function useAgentGUINodeController({
|
|
|
15751
15718
|
const nextTarget = resolveAgentGUIDirectorySelection({
|
|
15752
15719
|
agentTargetId: input.agentTargetId,
|
|
15753
15720
|
provider: nextProvider,
|
|
15754
|
-
targets:
|
|
15721
|
+
targets: normalizedAgentTargets
|
|
15755
15722
|
});
|
|
15756
15723
|
if (!nextTarget) {
|
|
15757
15724
|
return;
|
|
15758
15725
|
}
|
|
15759
|
-
const nextTargetIsExplicit =
|
|
15760
|
-
(target) =>
|
|
15726
|
+
const nextTargetIsExplicit = normalizedExplicitAgentTargets.some(
|
|
15727
|
+
(target) => agentGUIAgentTargetsEqual(target, nextTarget)
|
|
15761
15728
|
);
|
|
15762
|
-
const nextTargetData =
|
|
15729
|
+
const nextTargetData = composerTargetDataFromAgentTarget({
|
|
15763
15730
|
current: dataRef.current,
|
|
15764
15731
|
isExplicit: nextTargetIsExplicit,
|
|
15765
15732
|
target: nextTarget
|
|
@@ -15818,7 +15785,7 @@ function useAgentGUINodeController({
|
|
|
15818
15785
|
setDetailError(null);
|
|
15819
15786
|
persistActiveConversation(null);
|
|
15820
15787
|
onDataChangeRef.current((current) => {
|
|
15821
|
-
const currentNextTargetData =
|
|
15788
|
+
const currentNextTargetData = composerTargetDataFromAgentTarget({
|
|
15822
15789
|
current,
|
|
15823
15790
|
isExplicit: nextTargetIsExplicit,
|
|
15824
15791
|
target: nextTarget
|
|
@@ -15826,13 +15793,13 @@ function useAgentGUINodeController({
|
|
|
15826
15793
|
const nextAgentTargetId = currentNextTargetData.agentTargetId;
|
|
15827
15794
|
const currentTargetId = normalizeOptionalText2(current.agentTargetId);
|
|
15828
15795
|
const nextTargetId = nextAgentTargetId ?? nextTarget.targetId;
|
|
15829
|
-
const
|
|
15796
|
+
const agentTargetChanged = current.provider !== nextProvider || (currentTargetId !== null || nextAgentTargetId !== null) && currentTargetId !== nextTargetId;
|
|
15830
15797
|
const nextData = {
|
|
15831
15798
|
...current,
|
|
15832
15799
|
provider: currentNextTargetData.provider,
|
|
15833
15800
|
agentTargetId: currentNextTargetData.agentTargetId,
|
|
15834
15801
|
lastActiveAgentSessionId: null,
|
|
15835
|
-
composerOverrides:
|
|
15802
|
+
composerOverrides: agentTargetChanged ? null : current.composerOverrides
|
|
15836
15803
|
};
|
|
15837
15804
|
dataRef.current = nextData;
|
|
15838
15805
|
return nextData;
|
|
@@ -15845,42 +15812,42 @@ function useAgentGUINodeController({
|
|
|
15845
15812
|
activation,
|
|
15846
15813
|
defaultAgentTargetId,
|
|
15847
15814
|
loadComposerOptionsForTarget,
|
|
15848
|
-
|
|
15849
|
-
|
|
15815
|
+
normalizedExplicitAgentTargets,
|
|
15816
|
+
normalizedAgentTargets,
|
|
15850
15817
|
persistActiveConversation,
|
|
15851
15818
|
previewMode
|
|
15852
15819
|
]
|
|
15853
15820
|
);
|
|
15854
15821
|
useEffect4(() => {
|
|
15855
|
-
if (previewMode || activeConversationId !== null || conversationFilter.kind !== "all" || homeComposerTargetOverride !== null || agentGUINodeDataHasComposerTarget(data) || homeDirectorySelection.source !== "implicit" || !providerReadinessGates || !
|
|
15822
|
+
if (previewMode || activeConversationId !== null || conversationFilter.kind !== "all" || homeComposerTargetOverride !== null || agentGUINodeDataHasComposerTarget(data) || homeDirectorySelection.source !== "implicit" || !providerReadinessGates || !firstReadyHomeComposerAgentTarget) {
|
|
15856
15823
|
return;
|
|
15857
15824
|
}
|
|
15858
|
-
if (
|
|
15859
|
-
|
|
15860
|
-
|
|
15825
|
+
if (agentGUIAgentTargetsEqual(
|
|
15826
|
+
firstReadyHomeComposerAgentTarget,
|
|
15827
|
+
effectiveSelectedAgentTarget
|
|
15861
15828
|
)) {
|
|
15862
15829
|
return;
|
|
15863
15830
|
}
|
|
15864
15831
|
if (!Object.prototype.hasOwnProperty.call(
|
|
15865
15832
|
providerReadinessGates,
|
|
15866
|
-
|
|
15833
|
+
effectiveSelectedAgentTarget.provider
|
|
15867
15834
|
)) {
|
|
15868
15835
|
return;
|
|
15869
15836
|
}
|
|
15870
|
-
const selectedGate = providerReadinessGates[
|
|
15837
|
+
const selectedGate = providerReadinessGates[effectiveSelectedAgentTarget.provider];
|
|
15871
15838
|
if (!selectedGate) {
|
|
15872
15839
|
return;
|
|
15873
15840
|
}
|
|
15874
15841
|
selectHomeComposerAgentTarget({
|
|
15875
|
-
provider:
|
|
15876
|
-
agentTargetId:
|
|
15842
|
+
provider: firstReadyHomeComposerAgentTarget.provider,
|
|
15843
|
+
agentTargetId: firstReadyHomeComposerAgentTarget.agentTargetId ?? firstReadyHomeComposerAgentTarget.targetId
|
|
15877
15844
|
});
|
|
15878
15845
|
}, [
|
|
15879
15846
|
activeConversationId,
|
|
15880
15847
|
conversationFilter.kind,
|
|
15881
15848
|
data,
|
|
15882
|
-
|
|
15883
|
-
|
|
15849
|
+
effectiveSelectedAgentTarget,
|
|
15850
|
+
firstReadyHomeComposerAgentTarget,
|
|
15884
15851
|
homeDirectorySelection.source,
|
|
15885
15852
|
homeComposerTargetOverride,
|
|
15886
15853
|
previewMode,
|
|
@@ -15892,13 +15859,13 @@ function useAgentGUINodeController({
|
|
|
15892
15859
|
const nextTarget = resolveAgentGUIDirectorySelection({
|
|
15893
15860
|
agentTargetId: input.agentTargetId,
|
|
15894
15861
|
provider: input.provider,
|
|
15895
|
-
targets:
|
|
15862
|
+
targets: normalizedAgentTargets
|
|
15896
15863
|
});
|
|
15897
15864
|
if (!nextTarget) {
|
|
15898
15865
|
reportAgentGUIConversationFilterTargetUnresolved({
|
|
15899
15866
|
provider: input.provider,
|
|
15900
15867
|
agentTargetId: input.agentTargetId ?? null,
|
|
15901
|
-
|
|
15868
|
+
agentTargetCount: normalizedAgentTargets.length,
|
|
15902
15869
|
reason: "unresolved",
|
|
15903
15870
|
runtime: agentActivityRuntime,
|
|
15904
15871
|
workspaceId
|
|
@@ -15941,20 +15908,20 @@ function useAgentGUINodeController({
|
|
|
15941
15908
|
[
|
|
15942
15909
|
agentActivityRuntime,
|
|
15943
15910
|
defaultAgentTargetId,
|
|
15944
|
-
|
|
15911
|
+
normalizedAgentTargets,
|
|
15945
15912
|
selectConversation,
|
|
15946
15913
|
selectHomeComposerAgentTarget,
|
|
15947
15914
|
workspaceId
|
|
15948
15915
|
]
|
|
15949
15916
|
);
|
|
15950
15917
|
useEffect4(() => {
|
|
15951
|
-
if (previewMode ||
|
|
15918
|
+
if (previewMode || agentTargetsLoading || activeConversationId === null || conversationFilter.kind !== "agentTarget" || isLoadingConversations || conversationListState?.initialized !== true) {
|
|
15952
15919
|
return;
|
|
15953
15920
|
}
|
|
15954
15921
|
if (filterAgentGUIConversationSummaries(conversations, conversationFilter).length > 0) {
|
|
15955
15922
|
return;
|
|
15956
15923
|
}
|
|
15957
|
-
const target =
|
|
15924
|
+
const target = normalizedAgentTargets.find(
|
|
15958
15925
|
(candidate) => (candidate.agentTargetId?.trim() ?? "") === conversationFilter.agentTargetId
|
|
15959
15926
|
);
|
|
15960
15927
|
if (!target) {
|
|
@@ -15970,9 +15937,9 @@ function useAgentGUINodeController({
|
|
|
15970
15937
|
conversationListState?.initialized,
|
|
15971
15938
|
conversations,
|
|
15972
15939
|
isLoadingConversations,
|
|
15973
|
-
|
|
15940
|
+
normalizedAgentTargets,
|
|
15974
15941
|
previewMode,
|
|
15975
|
-
|
|
15942
|
+
agentTargetsLoading,
|
|
15976
15943
|
selectHomeComposerAgentTarget
|
|
15977
15944
|
]);
|
|
15978
15945
|
const stableCreateConversation = useStableControllerEventCallback(createConversation);
|
|
@@ -16048,7 +16015,7 @@ function useAgentGUINodeController({
|
|
|
16048
16015
|
);
|
|
16049
16016
|
const viewData = activeConversationId === null ? selectedComposerTargetData.data : data;
|
|
16050
16017
|
const effectiveHomeDirectorySelectionStatus = homeComposerTargetOverride ? "resolved" : homeDirectorySelection.status;
|
|
16051
|
-
const providerReadinessGate = activeConversationId === null ? effectiveHomeDirectorySelectionStatus === "loading" ? { status: "checking" } : effectiveHomeDirectorySelectionStatus === "missing" ? { status: "unavailable" } : providerReadinessGates?.[
|
|
16018
|
+
const providerReadinessGate = activeConversationId === null ? effectiveHomeDirectorySelectionStatus === "loading" ? { status: "checking" } : effectiveHomeDirectorySelectionStatus === "missing" ? { status: "unavailable" } : providerReadinessGates?.[effectiveSelectedAgentTarget.provider] ?? null : null;
|
|
16052
16019
|
const controllerActions = useMemo3(
|
|
16053
16020
|
() => ({
|
|
16054
16021
|
updateConversationFilter: stableUpdateConversationFilter,
|
|
@@ -16132,10 +16099,10 @@ function useAgentGUINodeController({
|
|
|
16132
16099
|
workspacePath,
|
|
16133
16100
|
currentUserId,
|
|
16134
16101
|
data: viewData,
|
|
16135
|
-
|
|
16136
|
-
|
|
16137
|
-
|
|
16138
|
-
|
|
16102
|
+
selectedAgentTarget: effectiveSelectedAgentTarget,
|
|
16103
|
+
agentTargets: normalizedAgentTargets,
|
|
16104
|
+
handoffAgentTargets,
|
|
16105
|
+
agentTargetsLoading,
|
|
16139
16106
|
conversationFilter,
|
|
16140
16107
|
conversations: visibleConversations,
|
|
16141
16108
|
userProjects,
|
|
@@ -16215,11 +16182,11 @@ function useAgentGUINodeController({
|
|
|
16215
16182
|
conversationDetail,
|
|
16216
16183
|
controllerActions,
|
|
16217
16184
|
data,
|
|
16218
|
-
|
|
16219
|
-
|
|
16220
|
-
|
|
16185
|
+
effectiveSelectedAgentTarget,
|
|
16186
|
+
handoffAgentTargets,
|
|
16187
|
+
normalizedAgentTargets,
|
|
16221
16188
|
providerReadinessGate,
|
|
16222
|
-
|
|
16189
|
+
agentTargetsLoading,
|
|
16223
16190
|
detailError,
|
|
16224
16191
|
draftContent,
|
|
16225
16192
|
draftPrompt,
|
|
@@ -16247,7 +16214,7 @@ function useAgentGUINodeController({
|
|
|
16247
16214
|
pendingDeleteConversations,
|
|
16248
16215
|
pendingApproval,
|
|
16249
16216
|
pendingInteractivePrompt,
|
|
16250
|
-
|
|
16217
|
+
effectiveSelectedAgentTarget.disabled,
|
|
16251
16218
|
queuedPrompts,
|
|
16252
16219
|
drainingQueuedPromptId,
|
|
16253
16220
|
currentUserId,
|
|
@@ -16659,6 +16626,39 @@ import {
|
|
|
16659
16626
|
cn as cn3
|
|
16660
16627
|
} from "@tutti-os/ui-system";
|
|
16661
16628
|
import { WorkspaceUserProjectSelect as WorkspaceUserProjectSelect2 } from "@tutti-os/workspace-user-project/ui";
|
|
16629
|
+
|
|
16630
|
+
// agent-gui/agentGuiNode/model/agentGuiAgentAvatarPresentation.ts
|
|
16631
|
+
function resolveAgentGUIHeroIconUrl(provider) {
|
|
16632
|
+
const normalizedProvider = normalizeManagedAgentProvider(provider);
|
|
16633
|
+
return MANAGED_AGENT_ICON_URLS[normalizedProvider] ?? MANAGED_AGENT_ICON_FALLBACK_URL;
|
|
16634
|
+
}
|
|
16635
|
+
function resolveAgentGUIAgentAvatarIconUrl(provider, iconUrl) {
|
|
16636
|
+
const normalizedProvider = normalizeManagedAgentProvider(provider);
|
|
16637
|
+
return iconUrl?.trim() || MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS[normalizedProvider] || resolveAgentGUIHeroIconUrl(normalizedProvider);
|
|
16638
|
+
}
|
|
16639
|
+
function projectAgentGUIAgentTargetAvatar(target) {
|
|
16640
|
+
return {
|
|
16641
|
+
targetId: target.targetId,
|
|
16642
|
+
agentTargetId: target.agentTargetId ?? target.targetId,
|
|
16643
|
+
provider: target.provider,
|
|
16644
|
+
label: target.label,
|
|
16645
|
+
iconUrl: resolveAgentGUIAgentAvatarIconUrl(target.provider, target.iconUrl),
|
|
16646
|
+
...target.badge ? { badge: target.badge } : {},
|
|
16647
|
+
...target.disabled === true ? { disabled: true } : {}
|
|
16648
|
+
};
|
|
16649
|
+
}
|
|
16650
|
+
function createFallbackAgentGUIAgentAvatar(input) {
|
|
16651
|
+
const agentTargetId = input.agentTargetId?.trim() || `local:${input.provider}`;
|
|
16652
|
+
return {
|
|
16653
|
+
targetId: agentTargetId,
|
|
16654
|
+
agentTargetId,
|
|
16655
|
+
provider: input.provider,
|
|
16656
|
+
label: input.label,
|
|
16657
|
+
iconUrl: resolveAgentGUIAgentAvatarIconUrl(input.provider, input.iconUrl)
|
|
16658
|
+
};
|
|
16659
|
+
}
|
|
16660
|
+
|
|
16661
|
+
// agent-gui/agentGuiNode/AgentGUINodeView.tsx
|
|
16662
16662
|
import {
|
|
16663
16663
|
BareIconButton,
|
|
16664
16664
|
Input as Input2,
|
|
@@ -16765,6 +16765,10 @@ import { ArrowLeftRight, Code, Compass, Import, Pencil, X } from "lucide-react";
|
|
|
16765
16765
|
|
|
16766
16766
|
// agent-gui/agentGuiNode/AgentGUINode.styles.ts
|
|
16767
16767
|
var styles = {
|
|
16768
|
+
agentAvatar: "agent-gui-node__agent-avatar",
|
|
16769
|
+
agentAvatarBadge: "agent-gui-node__agent-avatar-badge",
|
|
16770
|
+
agentAvatarBadgeImage: "agent-gui-node__agent-avatar-badge-image",
|
|
16771
|
+
agentAvatarImage: "agent-gui-node__agent-avatar-image",
|
|
16768
16772
|
bottomDock: "agent-gui-node__bottom-dock",
|
|
16769
16773
|
bottomDockPrompt: "agent-gui-node__bottom-dock-prompt",
|
|
16770
16774
|
bottomDockScrollToBottom: "agent-gui-node__bottom-dock-scroll-to-bottom",
|
|
@@ -16908,8 +16912,6 @@ var styles = {
|
|
|
16908
16912
|
providerRailAvatar: "agent-gui-node__provider-rail-avatar",
|
|
16909
16913
|
providerRailAvatarIcon: "agent-gui-node__provider-rail-avatar-icon",
|
|
16910
16914
|
providerRailAvatarImage: "agent-gui-node__provider-rail-avatar-image",
|
|
16911
|
-
providerRailBadge: "agent-gui-node__provider-rail-badge",
|
|
16912
|
-
providerRailBadgeImage: "agent-gui-node__provider-rail-badge-image",
|
|
16913
16915
|
emptyHeroIconSlot: "agent-gui-node__empty-hero-icon-slot",
|
|
16914
16916
|
providerRailConfigButton: "agent-gui-node__provider-rail-config-button",
|
|
16915
16917
|
providerRailFooter: "agent-gui-node__provider-rail-footer",
|
|
@@ -17162,6 +17164,9 @@ var SPRING_SETTLE_EPSILON = 1e-3;
|
|
|
17162
17164
|
var SPRING_SETTLE_VELOCITY = 0.02;
|
|
17163
17165
|
var TEXTURE_SIZE = 256;
|
|
17164
17166
|
var TEXTURE_CORNER_RADIUS = 0.05;
|
|
17167
|
+
var BADGE_CORNER_RADIUS = 0.5;
|
|
17168
|
+
var BADGE_DIAMETER = 0.36;
|
|
17169
|
+
var BADGE_OFFSET = 0.4;
|
|
17165
17170
|
var MAX_PIXEL_RATIO = 2;
|
|
17166
17171
|
function ringOffset(index, scroll, count) {
|
|
17167
17172
|
if (count <= 1) {
|
|
@@ -17176,13 +17181,13 @@ function ringOffset(index, scroll, count) {
|
|
|
17176
17181
|
}
|
|
17177
17182
|
return offset;
|
|
17178
17183
|
}
|
|
17179
|
-
function roundedIconTexture(image, onReadyRender) {
|
|
17184
|
+
function roundedIconTexture(image, onReadyRender, cornerRadius = TEXTURE_CORNER_RADIUS) {
|
|
17180
17185
|
const canvas = document.createElement("canvas");
|
|
17181
17186
|
canvas.width = TEXTURE_SIZE;
|
|
17182
17187
|
canvas.height = TEXTURE_SIZE;
|
|
17183
17188
|
const context = canvas.getContext("2d");
|
|
17184
17189
|
if (context) {
|
|
17185
|
-
const radius = TEXTURE_SIZE *
|
|
17190
|
+
const radius = TEXTURE_SIZE * cornerRadius;
|
|
17186
17191
|
context.beginPath();
|
|
17187
17192
|
context.roundRect(0, 0, TEXTURE_SIZE, TEXTURE_SIZE, radius);
|
|
17188
17193
|
context.clip();
|
|
@@ -17236,7 +17241,7 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17236
17241
|
lastFrameAt = null;
|
|
17237
17242
|
disposed = false;
|
|
17238
17243
|
constructor(options) {
|
|
17239
|
-
this.agentCount = options.
|
|
17244
|
+
this.agentCount = options.items.length;
|
|
17240
17245
|
const repeats = Math.max(
|
|
17241
17246
|
1,
|
|
17242
17247
|
Math.round(WHEEL_TARGET_SLOTS / Math.max(this.agentCount, 1))
|
|
@@ -17262,10 +17267,22 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17262
17267
|
});
|
|
17263
17268
|
const mesh = new THREE.Mesh(geometry, material);
|
|
17264
17269
|
mesh.userData.agentIndex = slot % this.agentCount;
|
|
17270
|
+
const badgeMaterial = new THREE.MeshBasicMaterial({
|
|
17271
|
+
transparent: true,
|
|
17272
|
+
depthWrite: false,
|
|
17273
|
+
visible: false
|
|
17274
|
+
});
|
|
17275
|
+
const badgeMesh = new THREE.Mesh(
|
|
17276
|
+
new THREE.CircleGeometry(BADGE_DIAMETER / 2, 32),
|
|
17277
|
+
badgeMaterial
|
|
17278
|
+
);
|
|
17279
|
+
badgeMesh.position.set(BADGE_OFFSET, -BADGE_OFFSET, 0.01);
|
|
17280
|
+
badgeMesh.userData.agentIndex = slot % this.agentCount;
|
|
17281
|
+
mesh.add(badgeMesh);
|
|
17265
17282
|
this.scene.add(mesh);
|
|
17266
|
-
this.tiles.push({ mesh });
|
|
17283
|
+
this.tiles.push({ badgeMesh, mesh });
|
|
17267
17284
|
}
|
|
17268
|
-
options.
|
|
17285
|
+
options.items.forEach((item, agentIndex) => {
|
|
17269
17286
|
const loadedImage = options.loadedImages?.[agentIndex] ?? null;
|
|
17270
17287
|
const image = loadedImage ?? new Image();
|
|
17271
17288
|
if (!loadedImage) {
|
|
@@ -17284,7 +17301,10 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17284
17301
|
if (image.complete && image.naturalWidth > 0) {
|
|
17285
17302
|
this.applyImageTexture(image, agentIndex);
|
|
17286
17303
|
} else if (!loadedImage) {
|
|
17287
|
-
image.src = iconUrl;
|
|
17304
|
+
image.src = item.iconUrl;
|
|
17305
|
+
}
|
|
17306
|
+
if (item.badge?.iconUrl) {
|
|
17307
|
+
this.loadBadgeImage(item.badge.iconUrl, agentIndex);
|
|
17288
17308
|
}
|
|
17289
17309
|
});
|
|
17290
17310
|
this.applyPoses();
|
|
@@ -17358,7 +17378,9 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17358
17378
|
this.raycaster.setFromCamera(pointer, this.camera);
|
|
17359
17379
|
const meshes = this.tiles.filter(
|
|
17360
17380
|
(tile) => tile.mesh.material.visible && tile.mesh.material.opacity > 0.05
|
|
17361
|
-
).
|
|
17381
|
+
).flatMap(
|
|
17382
|
+
(tile) => tile.badgeMesh.material.visible ? [tile.mesh, tile.badgeMesh] : [tile.mesh]
|
|
17383
|
+
);
|
|
17362
17384
|
const hit = this.raycaster.intersectObjects(meshes, false)[0];
|
|
17363
17385
|
const index = hit?.object.userData.agentIndex;
|
|
17364
17386
|
return typeof index === "number" ? index : null;
|
|
@@ -17380,6 +17402,9 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17380
17402
|
tile.mesh.geometry.dispose();
|
|
17381
17403
|
tile.mesh.material.map?.dispose();
|
|
17382
17404
|
tile.mesh.material.dispose();
|
|
17405
|
+
tile.badgeMesh.geometry.dispose();
|
|
17406
|
+
tile.badgeMesh.material.map?.dispose();
|
|
17407
|
+
tile.badgeMesh.material.dispose();
|
|
17383
17408
|
}
|
|
17384
17409
|
this.renderer.dispose();
|
|
17385
17410
|
}
|
|
@@ -17450,6 +17475,32 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17450
17475
|
}
|
|
17451
17476
|
}
|
|
17452
17477
|
}
|
|
17478
|
+
loadBadgeImage(badgeUrl, agentIndex) {
|
|
17479
|
+
const image = new Image();
|
|
17480
|
+
image.decoding = "async";
|
|
17481
|
+
image.loading = "eager";
|
|
17482
|
+
this.ownedImages.add(image);
|
|
17483
|
+
this.images.push(image);
|
|
17484
|
+
image.onload = () => {
|
|
17485
|
+
if (this.disposed) {
|
|
17486
|
+
return;
|
|
17487
|
+
}
|
|
17488
|
+
const texture = roundedIconTexture(
|
|
17489
|
+
image,
|
|
17490
|
+
() => this.requestRender(),
|
|
17491
|
+
BADGE_CORNER_RADIUS
|
|
17492
|
+
);
|
|
17493
|
+
for (const tile of this.tiles) {
|
|
17494
|
+
if (tile.mesh.userData.agentIndex === agentIndex) {
|
|
17495
|
+
tile.badgeMesh.material.map = texture;
|
|
17496
|
+
tile.badgeMesh.material.visible = true;
|
|
17497
|
+
tile.badgeMesh.material.needsUpdate = true;
|
|
17498
|
+
}
|
|
17499
|
+
}
|
|
17500
|
+
this.requestRender();
|
|
17501
|
+
};
|
|
17502
|
+
image.src = badgeUrl;
|
|
17503
|
+
}
|
|
17453
17504
|
applyPoses() {
|
|
17454
17505
|
const step = Math.PI * 2 / Math.max(this.tileCount, 1);
|
|
17455
17506
|
this.tiles.forEach((tile, index) => {
|
|
@@ -17461,6 +17512,7 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17461
17512
|
tile.mesh.rotation.z = -angle;
|
|
17462
17513
|
const focus = THREE.MathUtils.clamp(1 - Math.abs(offset), 0, 1);
|
|
17463
17514
|
tile.mesh.material.opacity = UNFOCUSED_OPACITY + (1 - UNFOCUSED_OPACITY) * focus;
|
|
17515
|
+
tile.badgeMesh.material.opacity = tile.mesh.material.opacity;
|
|
17464
17516
|
});
|
|
17465
17517
|
}
|
|
17466
17518
|
};
|
|
@@ -17473,31 +17525,31 @@ var CAROUSEL_DRAG_STEP_PX = 52;
|
|
|
17473
17525
|
function emptyPreloadedCarouselImages(length) {
|
|
17474
17526
|
return Array.from({ length }).map(() => null);
|
|
17475
17527
|
}
|
|
17476
|
-
function useAgentGUIHeroCarouselImages(
|
|
17528
|
+
function useAgentGUIHeroCarouselImages(items, iconKey) {
|
|
17477
17529
|
const [preloadState, setPreloadState] = useState7({
|
|
17478
17530
|
images: [],
|
|
17479
|
-
ready:
|
|
17531
|
+
ready: items.length === 0
|
|
17480
17532
|
});
|
|
17481
17533
|
useEffect6(() => {
|
|
17482
|
-
if (
|
|
17534
|
+
if (items.length === 0) {
|
|
17483
17535
|
setPreloadState({ images: [], ready: true });
|
|
17484
17536
|
return;
|
|
17485
17537
|
}
|
|
17486
17538
|
if (typeof Image !== "function") {
|
|
17487
17539
|
setPreloadState({
|
|
17488
|
-
images: emptyPreloadedCarouselImages(
|
|
17540
|
+
images: emptyPreloadedCarouselImages(items.length),
|
|
17489
17541
|
ready: true
|
|
17490
17542
|
});
|
|
17491
17543
|
return;
|
|
17492
17544
|
}
|
|
17493
17545
|
let cancelled = false;
|
|
17494
17546
|
setPreloadState({
|
|
17495
|
-
images: emptyPreloadedCarouselImages(
|
|
17547
|
+
images: emptyPreloadedCarouselImages(items.length),
|
|
17496
17548
|
ready: false
|
|
17497
17549
|
});
|
|
17498
17550
|
void Promise.all(
|
|
17499
|
-
|
|
17500
|
-
(
|
|
17551
|
+
items.map(
|
|
17552
|
+
(item) => new Promise((resolve) => {
|
|
17501
17553
|
const image = new Image();
|
|
17502
17554
|
const resolveDecoded = () => {
|
|
17503
17555
|
const decode = image.decode?.();
|
|
@@ -17514,7 +17566,7 @@ function useAgentGUIHeroCarouselImages(icons, iconKey) {
|
|
|
17514
17566
|
resolveDecoded();
|
|
17515
17567
|
};
|
|
17516
17568
|
image.onerror = () => resolve(null);
|
|
17517
|
-
image.src =
|
|
17569
|
+
image.src = item.iconUrl;
|
|
17518
17570
|
if (image.complete) {
|
|
17519
17571
|
if (image.naturalWidth > 0) {
|
|
17520
17572
|
resolveDecoded();
|
|
@@ -17538,16 +17590,15 @@ function useAgentGUIHeroCarouselImages(icons, iconKey) {
|
|
|
17538
17590
|
var AgentGUIHeroAgentCarousel = memo2(
|
|
17539
17591
|
function AgentGUIHeroAgentCarousel2({
|
|
17540
17592
|
activeAgentTargetId,
|
|
17541
|
-
|
|
17542
|
-
providerTargets,
|
|
17593
|
+
items,
|
|
17543
17594
|
onProviderSelect,
|
|
17544
17595
|
providerSelectLabel
|
|
17545
17596
|
}) {
|
|
17546
17597
|
const activeIconIndex = useMemo4(
|
|
17547
|
-
() => !activeAgentTargetId ? -1 :
|
|
17548
|
-
(
|
|
17598
|
+
() => !activeAgentTargetId ? -1 : items.findIndex(
|
|
17599
|
+
(item) => item.agentTargetId === activeAgentTargetId
|
|
17549
17600
|
),
|
|
17550
|
-
[activeAgentTargetId,
|
|
17601
|
+
[activeAgentTargetId, items]
|
|
17551
17602
|
);
|
|
17552
17603
|
const [centerIndex, setCenterIndex] = useState7(
|
|
17553
17604
|
activeIconIndex >= 0 ? activeIconIndex : 0
|
|
@@ -17556,42 +17607,29 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17556
17607
|
centerIndexRef.current = centerIndex;
|
|
17557
17608
|
const activeIconIndexRef = useRef5(activeIconIndex);
|
|
17558
17609
|
activeIconIndexRef.current = activeIconIndex;
|
|
17559
|
-
const interactive = onProviderSelect != null &&
|
|
17560
|
-
const targetForIndex = useCallback5(
|
|
17561
|
-
(index) => {
|
|
17562
|
-
const icon = icons[index];
|
|
17563
|
-
if (!icon || !interactive) {
|
|
17564
|
-
return null;
|
|
17565
|
-
}
|
|
17566
|
-
if (!icon.agentTargetId) {
|
|
17567
|
-
return null;
|
|
17568
|
-
}
|
|
17569
|
-
return providerTargets?.find(
|
|
17570
|
-
(target) => (target.agentTargetId ?? target.targetId) === icon.agentTargetId
|
|
17571
|
-
) ?? null;
|
|
17572
|
-
},
|
|
17573
|
-
[icons, interactive, providerTargets]
|
|
17574
|
-
);
|
|
17610
|
+
const interactive = onProviderSelect != null && items.length > 0;
|
|
17575
17611
|
const selectIndex = useCallback5(
|
|
17576
17612
|
(index) => {
|
|
17577
|
-
const
|
|
17578
|
-
if (!
|
|
17613
|
+
const item = items[index];
|
|
17614
|
+
if (!item || !onProviderSelect) {
|
|
17579
17615
|
return;
|
|
17580
17616
|
}
|
|
17581
17617
|
onProviderSelect({
|
|
17582
|
-
provider:
|
|
17583
|
-
agentTargetId:
|
|
17618
|
+
provider: item.provider,
|
|
17619
|
+
agentTargetId: item.targetId
|
|
17584
17620
|
});
|
|
17585
17621
|
},
|
|
17586
|
-
[
|
|
17622
|
+
[items, onProviderSelect]
|
|
17587
17623
|
);
|
|
17588
17624
|
const selectIndexRef = useRef5(selectIndex);
|
|
17589
17625
|
selectIndexRef.current = selectIndex;
|
|
17590
17626
|
const stageRef = useRef5(null);
|
|
17591
17627
|
const canvasRef = useRef5(null);
|
|
17592
17628
|
const sceneRef = useRef5(null);
|
|
17593
|
-
const iconKey =
|
|
17594
|
-
|
|
17629
|
+
const iconKey = items.map(
|
|
17630
|
+
(item) => `${item.agentTargetId}:${item.iconUrl}:${item.badge?.iconUrl ?? ""}`
|
|
17631
|
+
).join("|");
|
|
17632
|
+
const carouselImages = useAgentGUIHeroCarouselImages(items, iconKey);
|
|
17595
17633
|
useEffect6(() => {
|
|
17596
17634
|
const canvas = canvasRef.current;
|
|
17597
17635
|
const stage = stageRef.current;
|
|
@@ -17600,7 +17638,7 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17600
17638
|
}
|
|
17601
17639
|
const scene = AgentGuiHeroCarouselScene.create({
|
|
17602
17640
|
canvas,
|
|
17603
|
-
|
|
17641
|
+
items,
|
|
17604
17642
|
loadedImages: carouselImages.images,
|
|
17605
17643
|
onSettle: (index) => {
|
|
17606
17644
|
centerIndexRef.current = index;
|
|
@@ -17638,14 +17676,14 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17638
17676
|
const stepBy = useCallback5(
|
|
17639
17677
|
(direction) => {
|
|
17640
17678
|
const scene = sceneRef.current;
|
|
17641
|
-
if (!scene ||
|
|
17679
|
+
if (!scene || items.length <= 1) {
|
|
17642
17680
|
return;
|
|
17643
17681
|
}
|
|
17644
17682
|
const next = scene.stepBy(direction);
|
|
17645
17683
|
centerIndexRef.current = next;
|
|
17646
17684
|
setCenterIndex(next);
|
|
17647
17685
|
},
|
|
17648
|
-
[
|
|
17686
|
+
[items.length]
|
|
17649
17687
|
);
|
|
17650
17688
|
const stepByRef = useRef5(stepBy);
|
|
17651
17689
|
stepByRef.current = stepBy;
|
|
@@ -17783,25 +17821,25 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17783
17821
|
onPointerMove: interactive ? handleCanvasHover : void 0
|
|
17784
17822
|
}
|
|
17785
17823
|
),
|
|
17786
|
-
|
|
17824
|
+
items.map((item, index) => {
|
|
17787
17825
|
const isCenter = index === centerIndex;
|
|
17788
|
-
const
|
|
17789
|
-
|
|
17790
|
-
|
|
17791
|
-
const label = providerSelectLabel ? `${providerSelectLabel}: ${
|
|
17826
|
+
const key = `${item.agentTargetId}:${item.iconUrl}`;
|
|
17827
|
+
if (onProviderSelect) {
|
|
17828
|
+
const itemLabel = item.badge?.label ? `${item.label}, ${item.badge.label}` : item.label;
|
|
17829
|
+
const label = providerSelectLabel ? `${providerSelectLabel}: ${itemLabel}` : itemLabel;
|
|
17792
17830
|
return /* @__PURE__ */ jsx20(
|
|
17793
17831
|
"button",
|
|
17794
17832
|
{
|
|
17795
17833
|
type: "button",
|
|
17796
17834
|
className: AgentGUINode_styles_default.emptyHeroCarouselItem,
|
|
17797
|
-
"data-agent-target-id":
|
|
17798
|
-
"data-provider":
|
|
17835
|
+
"data-agent-target-id": item.agentTargetId,
|
|
17836
|
+
"data-provider": item.provider,
|
|
17799
17837
|
"data-provider-active": isCenter,
|
|
17800
17838
|
"aria-label": label,
|
|
17801
17839
|
"aria-pressed": isCenter,
|
|
17802
|
-
title:
|
|
17840
|
+
title: item.label,
|
|
17803
17841
|
onClick: () => handleItemClick(index),
|
|
17804
|
-
children:
|
|
17842
|
+
children: item.label
|
|
17805
17843
|
},
|
|
17806
17844
|
key
|
|
17807
17845
|
);
|
|
@@ -17810,7 +17848,7 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17810
17848
|
"span",
|
|
17811
17849
|
{
|
|
17812
17850
|
className: AgentGUINode_styles_default.emptyHeroCarouselItem,
|
|
17813
|
-
"data-provider":
|
|
17851
|
+
"data-provider": item.provider,
|
|
17814
17852
|
"data-provider-active": isCenter
|
|
17815
17853
|
},
|
|
17816
17854
|
key
|
|
@@ -23050,7 +23088,7 @@ var MENTION_PALETTE_DISMISS_INTERACTION_SELECTOR = [
|
|
|
23050
23088
|
function resolveComposerProviderIconUrl(provider) {
|
|
23051
23089
|
return MANAGED_AGENT_ICON_URLS[normalizeManagedAgentProvider(provider)] ?? MANAGED_AGENT_ICON_FALLBACK_URL;
|
|
23052
23090
|
}
|
|
23053
|
-
function
|
|
23091
|
+
function resolveComposerAgentTargetIconUrl(target) {
|
|
23054
23092
|
if (normalizeManagedAgentProvider(target.provider) === "cursor") {
|
|
23055
23093
|
return cursorColorfulUrl;
|
|
23056
23094
|
}
|
|
@@ -23230,9 +23268,9 @@ function AgentComposer({
|
|
|
23230
23268
|
queuedPrompts,
|
|
23231
23269
|
drainingQueuedPromptId,
|
|
23232
23270
|
workspaceAppIcons = EMPTY_WORKSPACE_APP_ICONS2,
|
|
23233
|
-
|
|
23234
|
-
|
|
23235
|
-
|
|
23271
|
+
selectedAgentTarget = null,
|
|
23272
|
+
agentTargets = [],
|
|
23273
|
+
handoffAgentTargets,
|
|
23236
23274
|
providerSelectReadonly = false,
|
|
23237
23275
|
onProviderSelect,
|
|
23238
23276
|
onHandoffConversation,
|
|
@@ -24719,35 +24757,35 @@ ${normalizedText}` : normalizedText;
|
|
|
24719
24757
|
const isHeroLayout = layoutMode === "hero";
|
|
24720
24758
|
const composerClassName = isHeroLayout ? AgentGUINode_styles_default.composerHero : AgentGUINode_styles_default.composer;
|
|
24721
24759
|
const providerSwitchTargets = useMemo10(
|
|
24722
|
-
() =>
|
|
24723
|
-
[
|
|
24760
|
+
() => agentTargets.filter(Boolean),
|
|
24761
|
+
[agentTargets]
|
|
24724
24762
|
);
|
|
24725
24763
|
const enabledProviderSwitchTargets = useMemo10(
|
|
24726
24764
|
() => providerSwitchTargets.filter((target) => target.disabled !== true),
|
|
24727
24765
|
[providerSwitchTargets]
|
|
24728
24766
|
);
|
|
24729
|
-
const selectedAgentTargetId =
|
|
24767
|
+
const selectedAgentTargetId = selectedAgentTarget?.targetId ?? `local:${provider}`;
|
|
24730
24768
|
const selectedProviderSwitchTarget = providerSwitchTargets.find(
|
|
24731
24769
|
(target) => target.targetId === selectedAgentTargetId
|
|
24732
|
-
) ?? providerSwitchTargets.find((target) => target.provider === provider) ??
|
|
24770
|
+
) ?? providerSwitchTargets.find((target) => target.provider === provider) ?? selectedAgentTarget;
|
|
24733
24771
|
const providerMenuTargets = selectedProviderSwitchTarget && !enabledProviderSwitchTargets.some(
|
|
24734
24772
|
(target) => target.targetId === selectedProviderSwitchTarget.targetId
|
|
24735
24773
|
) ? [selectedProviderSwitchTarget, ...enabledProviderSwitchTargets] : enabledProviderSwitchTargets;
|
|
24736
|
-
const
|
|
24737
|
-
() => (
|
|
24774
|
+
const enabledHandoffAgentTargets = useMemo10(
|
|
24775
|
+
() => (handoffAgentTargets ?? providerMenuTargets).filter(
|
|
24738
24776
|
(target) => target.disabled !== true
|
|
24739
24777
|
),
|
|
24740
|
-
[
|
|
24778
|
+
[handoffAgentTargets, providerMenuTargets]
|
|
24741
24779
|
);
|
|
24742
|
-
const handoffMenuTargets = selectedProviderSwitchTarget ?
|
|
24780
|
+
const handoffMenuTargets = selectedProviderSwitchTarget ? enabledHandoffAgentTargets.filter((target) => {
|
|
24743
24781
|
if (target.targetId === selectedProviderSwitchTarget.targetId) {
|
|
24744
24782
|
return false;
|
|
24745
24783
|
}
|
|
24746
24784
|
const selectedAgentTargetId2 = selectedProviderSwitchTarget.agentTargetId ?? selectedProviderSwitchTarget.targetId;
|
|
24747
24785
|
const targetAgentTargetId = target.agentTargetId ?? target.targetId;
|
|
24748
24786
|
return targetAgentTargetId !== selectedAgentTargetId2;
|
|
24749
|
-
}) :
|
|
24750
|
-
const selectedProviderLabel = selectedProviderSwitchTarget?.label ??
|
|
24787
|
+
}) : enabledHandoffAgentTargets;
|
|
24788
|
+
const selectedProviderLabel = selectedProviderSwitchTarget?.label ?? selectedAgentTarget?.label ?? provider;
|
|
24751
24789
|
const effectiveHandoffLabel = handoffLabel || labels.handoffConversation;
|
|
24752
24790
|
const effectiveHandoffMenuLabel = handoffMenuLabel || labels.handoffConversationMenu;
|
|
24753
24791
|
const inputShellClassName = cn(
|
|
@@ -25977,9 +26015,7 @@ ${normalizedText}` : normalizedText;
|
|
|
25977
26015
|
alt: "",
|
|
25978
26016
|
"aria-hidden": "true",
|
|
25979
26017
|
className: "size-4 shrink-0 rounded-[4px]",
|
|
25980
|
-
src:
|
|
25981
|
-
target
|
|
25982
|
-
)
|
|
26018
|
+
src: resolveComposerAgentTargetIconUrl(target)
|
|
25983
26019
|
}
|
|
25984
26020
|
),
|
|
25985
26021
|
/* @__PURE__ */ jsx32("span", { className: "min-w-0 truncate", children: target.label })
|
|
@@ -26029,7 +26065,7 @@ ${normalizedText}` : normalizedText;
|
|
|
26029
26065
|
alt: "",
|
|
26030
26066
|
"aria-hidden": "true",
|
|
26031
26067
|
className: "size-4 shrink-0 rounded-[4px]",
|
|
26032
|
-
src:
|
|
26068
|
+
src: resolveComposerAgentTargetIconUrl(
|
|
26033
26069
|
selectedProviderSwitchTarget
|
|
26034
26070
|
)
|
|
26035
26071
|
}
|
|
@@ -26056,7 +26092,7 @@ ${normalizedText}` : normalizedText;
|
|
|
26056
26092
|
alt: "",
|
|
26057
26093
|
"aria-hidden": "true",
|
|
26058
26094
|
className: "size-4 shrink-0 rounded-[4px]",
|
|
26059
|
-
src:
|
|
26095
|
+
src: resolveComposerAgentTargetIconUrl(target)
|
|
26060
26096
|
}
|
|
26061
26097
|
),
|
|
26062
26098
|
/* @__PURE__ */ jsx32("span", { className: "min-w-0 truncate", children: target.label })
|
|
@@ -26916,26 +26952,6 @@ function setBooleanStateIfChanged(stateRef, setState, nextState) {
|
|
|
26916
26952
|
stateRef.current = nextState;
|
|
26917
26953
|
setState(nextState);
|
|
26918
26954
|
}
|
|
26919
|
-
function resolveAgentGUIHeroIconUrl(provider) {
|
|
26920
|
-
const normalizedProvider = normalizeManagedAgentProvider(provider);
|
|
26921
|
-
return MANAGED_AGENT_ICON_URLS[normalizedProvider] ?? MANAGED_AGENT_ICON_FALLBACK_URL;
|
|
26922
|
-
}
|
|
26923
|
-
function agentGUIProviderIconPresentation(provider, iconUrl) {
|
|
26924
|
-
const normalizedProvider = normalizeManagedAgentProvider(provider);
|
|
26925
|
-
const providerRailIconUrl = MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS[normalizedProvider] ?? null;
|
|
26926
|
-
return {
|
|
26927
|
-
provider: normalizedProvider,
|
|
26928
|
-
iconUrl: iconUrl?.trim() || providerRailIconUrl || resolveAgentGUIHeroIconUrl(normalizedProvider)
|
|
26929
|
-
};
|
|
26930
|
-
}
|
|
26931
|
-
function agentGUIProviderRailIconPresentation(provider, iconUrl) {
|
|
26932
|
-
const normalizedProvider = normalizeManagedAgentProvider(provider);
|
|
26933
|
-
const providerRailIconUrl = MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS[normalizedProvider] ?? null;
|
|
26934
|
-
return {
|
|
26935
|
-
provider: normalizedProvider,
|
|
26936
|
-
iconUrl: iconUrl?.trim() || providerRailIconUrl || resolveAgentGUIHeroIconUrl(normalizedProvider)
|
|
26937
|
-
};
|
|
26938
|
-
}
|
|
26939
26955
|
function shouldEmphasizeEmptyHeroProvider(label) {
|
|
26940
26956
|
return label.trim().length > 0;
|
|
26941
26957
|
}
|
|
@@ -27139,7 +27155,7 @@ function buildAgentConversationHandoffPrompt(input) {
|
|
|
27139
27155
|
if (!conversation) {
|
|
27140
27156
|
return "";
|
|
27141
27157
|
}
|
|
27142
|
-
const sourceAgentLabel = input.
|
|
27158
|
+
const sourceAgentLabel = input.selectedAgentTarget?.label?.trim() || conversation.provider;
|
|
27143
27159
|
const title = conversationPlainTitle(
|
|
27144
27160
|
conversation,
|
|
27145
27161
|
input.labels,
|
|
@@ -27348,7 +27364,7 @@ function AgentGUINodeView({
|
|
|
27348
27364
|
[viewModel.data.provider, viewModel.openclawGateway]
|
|
27349
27365
|
);
|
|
27350
27366
|
const isOpenclawGatewayBlocking = openclawGateway !== null && openclawGateway.status !== "ready";
|
|
27351
|
-
const createConversationDisabled = viewModel.isCreatingConversation || viewModel.
|
|
27367
|
+
const createConversationDisabled = viewModel.isCreatingConversation || viewModel.selectedAgentTarget.disabled === true || isOpenclawGatewayBlocking;
|
|
27352
27368
|
const createConversationAction = useStableEventCallback2(
|
|
27353
27369
|
actions.createConversation
|
|
27354
27370
|
);
|
|
@@ -27562,7 +27578,7 @@ function AgentGUINodeView({
|
|
|
27562
27578
|
};
|
|
27563
27579
|
const effectiveRailConfigProvider = railConfigProvider === void 0 ? viewModel.data.provider : railConfigProvider;
|
|
27564
27580
|
const effectiveRailSlashStatusLimits = railSlashStatusLimits ?? slashStatusLimits;
|
|
27565
|
-
const shouldShowProviderRailConfigButton = viewModel.conversationFilter.kind === "all" || viewModel.
|
|
27581
|
+
const shouldShowProviderRailConfigButton = viewModel.conversationFilter.kind === "all" || viewModel.selectedAgentTarget?.disabled !== true;
|
|
27566
27582
|
const shouldShowProviderRailConfigMenu = shouldShowProviderRailConfigButton && viewModel.conversationFilter.kind !== "all";
|
|
27567
27583
|
const effectiveProviderAuthAccountLabel = useMemo11(() => {
|
|
27568
27584
|
const provider = (effectiveRailConfigProvider ?? viewModel.data.provider)?.trim() ?? "";
|
|
@@ -27576,10 +27592,10 @@ function AgentGUINodeView({
|
|
|
27576
27592
|
providerAuthAccountLabels,
|
|
27577
27593
|
viewModel.data.provider
|
|
27578
27594
|
]);
|
|
27579
|
-
const
|
|
27595
|
+
const enabledAgentTargets = viewModel.agentTargets.filter(
|
|
27580
27596
|
(target) => target.disabled !== true && ((target.agentTargetId?.trim() ?? "") || (target.targetId?.trim() ?? ""))
|
|
27581
27597
|
);
|
|
27582
|
-
const sectionAgentTargetFallbackId =
|
|
27598
|
+
const sectionAgentTargetFallbackId = enabledAgentTargets.length <= 1 ? viewModel.selectedAgentTarget.agentTargetId?.trim() || viewModel.selectedAgentTarget.targetId?.trim() || null : null;
|
|
27583
27599
|
const openAgentEnvSetup = useCallback11(() => {
|
|
27584
27600
|
openAgentEnvPanel({ provider: effectiveRailConfigProvider, focus: null });
|
|
27585
27601
|
}, [effectiveRailConfigProvider]);
|
|
@@ -27608,8 +27624,8 @@ function AgentGUINodeView({
|
|
|
27608
27624
|
createConversationDisabled,
|
|
27609
27625
|
openclawGateway,
|
|
27610
27626
|
isCollapsed: conversationRailCollapsed,
|
|
27611
|
-
|
|
27612
|
-
|
|
27627
|
+
agentTargets: viewModel.agentTargets,
|
|
27628
|
+
agentTargetsLoading: viewModel.agentTargetsLoading,
|
|
27613
27629
|
conversationFilter: viewModel.conversationFilter,
|
|
27614
27630
|
sectionAgentTargetFallbackId,
|
|
27615
27631
|
onCreateConversation: requestCreateConversation,
|
|
@@ -27662,8 +27678,8 @@ function AgentGUINodeView({
|
|
|
27662
27678
|
selectConversation,
|
|
27663
27679
|
selectProjectDirectory,
|
|
27664
27680
|
sectionAgentTargetFallbackId,
|
|
27665
|
-
viewModel.
|
|
27666
|
-
viewModel.
|
|
27681
|
+
viewModel.agentTargets,
|
|
27682
|
+
viewModel.agentTargetsLoading,
|
|
27667
27683
|
toggleConversationPinned,
|
|
27668
27684
|
uiLanguage,
|
|
27669
27685
|
viewModel.conversationFilter,
|
|
@@ -27691,7 +27707,7 @@ function AgentGUINodeView({
|
|
|
27691
27707
|
conversationRailStoreState
|
|
27692
27708
|
);
|
|
27693
27709
|
const agentTargetPresentations = useMemo11(
|
|
27694
|
-
() => viewModel.
|
|
27710
|
+
() => viewModel.agentTargets.flatMap(
|
|
27695
27711
|
(target) => target.agentTargetId ? [
|
|
27696
27712
|
{
|
|
27697
27713
|
agentTargetId: target.agentTargetId,
|
|
@@ -27702,7 +27718,7 @@ function AgentGUINodeView({
|
|
|
27702
27718
|
}
|
|
27703
27719
|
] : []
|
|
27704
27720
|
),
|
|
27705
|
-
[viewModel.
|
|
27721
|
+
[viewModel.agentTargets, viewModel.workspaceId]
|
|
27706
27722
|
);
|
|
27707
27723
|
const content = /* @__PURE__ */ jsxs22(AgentTargetPresentationProvider, { agentTargets: agentTargetPresentations, children: [
|
|
27708
27724
|
/* @__PURE__ */ jsxs22(
|
|
@@ -27730,9 +27746,9 @@ function AgentGUINodeView({
|
|
|
27730
27746
|
labels,
|
|
27731
27747
|
previewMode,
|
|
27732
27748
|
workspaceId: viewModel.workspaceId,
|
|
27733
|
-
|
|
27734
|
-
|
|
27735
|
-
|
|
27749
|
+
selectedAgentTarget: viewModel.selectedAgentTarget,
|
|
27750
|
+
agentTargets: viewModel.agentTargets,
|
|
27751
|
+
agentTargetsLoading: viewModel.agentTargetsLoading,
|
|
27736
27752
|
renderProviderRailEmpty,
|
|
27737
27753
|
providerRailAllPresentation,
|
|
27738
27754
|
onSelectConversationFilterTarget: actions.selectConversationFilterTarget,
|
|
@@ -28157,9 +28173,9 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
28157
28173
|
avoidGroupingEdits: viewModel.avoidGroupingEdits
|
|
28158
28174
|
});
|
|
28159
28175
|
const hasActiveConversation = viewModel.activeConversationId !== null;
|
|
28160
|
-
const agentsLoadedEmpty = !viewModel.
|
|
28161
|
-
const
|
|
28162
|
-
const emptyProviderReadinessGate = !hasActiveConversation ? viewModel.providerReadinessGate ?? (
|
|
28176
|
+
const agentsLoadedEmpty = !viewModel.agentTargetsLoading && viewModel.agentTargets.length === 0;
|
|
28177
|
+
const selectedAgentTargetComingSoon = viewModel.selectedAgentTarget?.disabled === true && (viewModel.providerReadinessGate === null || viewModel.providerReadinessGate?.status === "coming_soon");
|
|
28178
|
+
const emptyProviderReadinessGate = !hasActiveConversation ? viewModel.providerReadinessGate ?? (selectedAgentTargetComingSoon ? { status: "coming_soon" } : null) : null;
|
|
28163
28179
|
const activePrompt = viewModel.pendingInteractivePrompt ?? viewModel.pendingApproval;
|
|
28164
28180
|
const activePromptRequestId = activePrompt?.requestId ?? null;
|
|
28165
28181
|
const sessionChrome = useMemo11(
|
|
@@ -28718,16 +28734,16 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
28718
28734
|
[submitInteractivePrompt]
|
|
28719
28735
|
);
|
|
28720
28736
|
const canSwitchComposerProvider = true;
|
|
28721
|
-
const
|
|
28722
|
-
const
|
|
28723
|
-
const composerProvider = viewModel.activeConversationId === null ? viewModel.
|
|
28724
|
-
const
|
|
28737
|
+
const composerAgentTargets = viewModel.agentTargets;
|
|
28738
|
+
const composerHandoffAgentTargets = viewModel.handoffAgentTargets;
|
|
28739
|
+
const composerProvider = viewModel.activeConversationId === null ? viewModel.selectedAgentTarget?.provider ?? viewModel.data.provider : viewModel.data.provider;
|
|
28740
|
+
const composerSelectedAgentTarget = viewModel.activeConversationId === null ? viewModel.selectedAgentTarget : viewModel.agentTargets.find((target) => {
|
|
28725
28741
|
if (target.provider !== viewModel.data.provider) {
|
|
28726
28742
|
return false;
|
|
28727
28743
|
}
|
|
28728
28744
|
const agentTargetId = viewModel.data.agentTargetId;
|
|
28729
28745
|
return !agentTargetId || target.targetId === agentTargetId || target.agentTargetId === agentTargetId;
|
|
28730
|
-
}) ?? viewModel.
|
|
28746
|
+
}) ?? viewModel.selectedAgentTarget;
|
|
28731
28747
|
const bottomDockComposerProps = useMemo11(
|
|
28732
28748
|
() => ({
|
|
28733
28749
|
workspaceId: viewModel.workspaceId,
|
|
@@ -28742,9 +28758,9 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
28742
28758
|
hasCompactableContext: viewModel.hasSentUserMessage,
|
|
28743
28759
|
compactSupported: viewModel.compactSupported,
|
|
28744
28760
|
availableSkills: viewModel.availableSkills,
|
|
28745
|
-
|
|
28746
|
-
|
|
28747
|
-
|
|
28761
|
+
selectedAgentTarget: composerSelectedAgentTarget,
|
|
28762
|
+
agentTargets: composerAgentTargets,
|
|
28763
|
+
handoffAgentTargets: composerHandoffAgentTargets,
|
|
28748
28764
|
providerSelectReadonly: !canSwitchComposerProvider || viewModel.activeConversationId !== null,
|
|
28749
28765
|
onProviderSelect: canSwitchComposerProvider && viewModel.activeConversationId === null ? selectHomeComposerAgentTargetAndFocus : void 0,
|
|
28750
28766
|
disabled: composerDisabled,
|
|
@@ -28800,7 +28816,7 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
28800
28816
|
activeConversation: viewModel.activeConversation,
|
|
28801
28817
|
currentUserId: viewModel.currentUserId,
|
|
28802
28818
|
labels,
|
|
28803
|
-
|
|
28819
|
+
selectedAgentTarget: composerSelectedAgentTarget,
|
|
28804
28820
|
uiLanguage,
|
|
28805
28821
|
workspaceId: viewModel.workspaceId
|
|
28806
28822
|
}),
|
|
@@ -28823,10 +28839,10 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
28823
28839
|
composerDisabled,
|
|
28824
28840
|
composerDisabledReason,
|
|
28825
28841
|
composerFocusRequestSequence,
|
|
28826
|
-
|
|
28842
|
+
composerHandoffAgentTargets,
|
|
28827
28843
|
composerLabels,
|
|
28828
|
-
|
|
28829
|
-
|
|
28844
|
+
composerAgentTargets,
|
|
28845
|
+
composerSelectedAgentTarget,
|
|
28830
28846
|
handleInterruptCurrentTurn,
|
|
28831
28847
|
isActive,
|
|
28832
28848
|
isComposerSending,
|
|
@@ -28899,40 +28915,32 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
28899
28915
|
}),
|
|
28900
28916
|
[bottomDockComposerProps]
|
|
28901
28917
|
);
|
|
28902
|
-
const emptyHeroProvider = viewModel.
|
|
28918
|
+
const emptyHeroProvider = viewModel.selectedAgentTarget?.provider ?? viewModel.data.provider;
|
|
28903
28919
|
const emptyHeroRuntimeProviderLabel = labels.emptyProviderForProvider?.(emptyHeroProvider) ?? labels.emptyProvider ?? "";
|
|
28904
|
-
const emptyHeroProviderLabel = viewModel.
|
|
28920
|
+
const emptyHeroProviderLabel = viewModel.selectedAgentTarget?.label ?? emptyHeroRuntimeProviderLabel;
|
|
28905
28921
|
const emptyHeroBaseLabel = labels.emptyForProvider?.(emptyHeroProvider) ?? labels.empty;
|
|
28906
28922
|
const emptyHeroLabel = emptyHeroRuntimeProviderLabel ? emptyHeroBaseLabel.replace(
|
|
28907
28923
|
emptyHeroRuntimeProviderLabel,
|
|
28908
28924
|
emptyHeroProviderLabel
|
|
28909
28925
|
) : emptyHeroBaseLabel;
|
|
28910
|
-
const
|
|
28911
|
-
() => viewModel.conversationFilter.kind === "all" ? viewModel.
|
|
28912
|
-
|
|
28913
|
-
|
|
28914
|
-
|
|
28915
|
-
|
|
28916
|
-
|
|
28917
|
-
).iconUrl
|
|
28918
|
-
})) : [
|
|
28919
|
-
{
|
|
28920
|
-
...agentGUIProviderIconPresentation(
|
|
28921
|
-
emptyHeroProvider,
|
|
28922
|
-
viewModel.selectedProviderTarget?.iconUrl
|
|
28923
|
-
),
|
|
28924
|
-
agentTargetId: viewModel.selectedProviderTarget?.agentTargetId ?? viewModel.selectedProviderTarget?.targetId
|
|
28925
|
-
}
|
|
28926
|
+
const emptyHeroAvatarPresentations = useMemo11(
|
|
28927
|
+
() => viewModel.conversationFilter.kind === "all" ? viewModel.agentTargets.map(projectAgentGUIAgentTargetAvatar) : viewModel.selectedAgentTarget ? [projectAgentGUIAgentTargetAvatar(viewModel.selectedAgentTarget)] : [
|
|
28928
|
+
createFallbackAgentGUIAgentAvatar({
|
|
28929
|
+
provider: emptyHeroProvider,
|
|
28930
|
+
label: emptyHeroProviderLabel,
|
|
28931
|
+
iconUrl: null
|
|
28932
|
+
})
|
|
28926
28933
|
],
|
|
28927
28934
|
[
|
|
28928
28935
|
emptyHeroProvider,
|
|
28936
|
+
emptyHeroProviderLabel,
|
|
28929
28937
|
viewModel.conversationFilter.kind,
|
|
28930
|
-
viewModel.
|
|
28931
|
-
viewModel.
|
|
28938
|
+
viewModel.agentTargets,
|
|
28939
|
+
viewModel.selectedAgentTarget
|
|
28932
28940
|
]
|
|
28933
28941
|
);
|
|
28934
|
-
const
|
|
28935
|
-
const shouldRenderProviderUnavailableState = !hasActiveConversation &&
|
|
28942
|
+
const disabledAgentTarget = selectedAgentTargetComingSoon ? viewModel.selectedAgentTarget ?? null : null;
|
|
28943
|
+
const shouldRenderProviderUnavailableState = !hasActiveConversation && disabledAgentTarget !== null && renderProviderUnavailableState !== void 0;
|
|
28936
28944
|
const shouldRenderProviderReadinessGateState = !hasActiveConversation && emptyProviderReadinessGate !== null && renderProviderReadinessGateState !== void 0;
|
|
28937
28945
|
const bottomDockStoreState = useMemo11(
|
|
28938
28946
|
() => ({
|
|
@@ -29335,22 +29343,22 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
29335
29343
|
"data-testid": "agent-gui-agents-empty",
|
|
29336
29344
|
children: /* @__PURE__ */ jsx35("div", { className: AgentGUINode_styles_default.emptyHeroBody, children: /* @__PURE__ */ jsx35("h2", { className: AgentGUINode_styles_default.emptyHeroTitle, children: labels.agentsEmpty }) })
|
|
29337
29345
|
}
|
|
29338
|
-
) : shouldRenderProviderUnavailableState &&
|
|
29339
|
-
provider:
|
|
29346
|
+
) : shouldRenderProviderUnavailableState && disabledAgentTarget ? /* @__PURE__ */ jsx35(Fragment9, { children: renderProviderUnavailableState?.({
|
|
29347
|
+
provider: disabledAgentTarget.provider,
|
|
29340
29348
|
providerLabel: labels.emptyProviderForProvider?.(
|
|
29341
|
-
|
|
29349
|
+
disabledAgentTarget.provider
|
|
29342
29350
|
) ?? resolveAgentGuiWorkbenchProviderLabel(
|
|
29343
|
-
|
|
29351
|
+
disabledAgentTarget.provider
|
|
29344
29352
|
),
|
|
29345
|
-
target:
|
|
29353
|
+
target: disabledAgentTarget,
|
|
29346
29354
|
iconUrl: resolveAgentGUIHeroIconUrl(
|
|
29347
|
-
|
|
29355
|
+
disabledAgentTarget.provider
|
|
29348
29356
|
),
|
|
29349
|
-
unavailableReason:
|
|
29357
|
+
unavailableReason: disabledAgentTarget.unavailableReason ?? null
|
|
29350
29358
|
}) }) : emptyProviderReadinessGate ? shouldRenderProviderReadinessGateState ? /* @__PURE__ */ jsx35(Fragment9, { children: renderProviderReadinessGateState?.({
|
|
29351
29359
|
provider: emptyHeroProvider,
|
|
29352
29360
|
providerLabel: emptyHeroProviderLabel || resolveAgentGuiWorkbenchProviderLabel(emptyHeroProvider),
|
|
29353
|
-
target: viewModel.
|
|
29361
|
+
target: viewModel.selectedAgentTarget ?? null,
|
|
29354
29362
|
iconUrl: resolveAgentGUIHeroIconUrl(emptyHeroProvider),
|
|
29355
29363
|
gate: emptyProviderReadinessGate,
|
|
29356
29364
|
showAllProviders: viewModel.conversationFilter.kind === "all"
|
|
@@ -29362,8 +29370,8 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
29362
29370
|
showAllProviders: viewModel.conversationFilter.kind === "all",
|
|
29363
29371
|
emptyLabel: emptyHeroLabel,
|
|
29364
29372
|
emptyProvider: emptyHeroProviderLabel,
|
|
29365
|
-
|
|
29366
|
-
|
|
29373
|
+
agentTargets: composerAgentTargets,
|
|
29374
|
+
selectedAgentTarget: viewModel.selectedAgentTarget,
|
|
29367
29375
|
onProviderSelect: canSwitchComposerProvider && viewModel.activeConversationId === null ? selectHomeComposerAgentTargetAndFocus : void 0,
|
|
29368
29376
|
providerSelectLabel: labels.providerSwitchLabel,
|
|
29369
29377
|
labels
|
|
@@ -29374,7 +29382,7 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
29374
29382
|
provider: emptyHeroProvider,
|
|
29375
29383
|
emptyLabel: emptyHeroLabel,
|
|
29376
29384
|
emptyProvider: emptyHeroProviderLabel,
|
|
29377
|
-
|
|
29385
|
+
avatarPresentations: emptyHeroAvatarPresentations,
|
|
29378
29386
|
inlineNoticeChrome,
|
|
29379
29387
|
isRespondingApproval: viewModel.isRespondingApproval,
|
|
29380
29388
|
onSubmitApprovalOption: submitApprovalOption,
|
|
@@ -29382,8 +29390,8 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
29382
29390
|
onAuthLogin: authLogin,
|
|
29383
29391
|
onContinueInNewConversation: continueInNewConversation,
|
|
29384
29392
|
onProviderSelect: canSwitchComposerProvider && viewModel.activeConversationId === null ? selectHomeComposerAgentTargetAndFocus : void 0,
|
|
29385
|
-
|
|
29386
|
-
|
|
29393
|
+
agentTargets: composerAgentTargets,
|
|
29394
|
+
selectedAgentTarget: viewModel.selectedAgentTarget,
|
|
29387
29395
|
chromeLabels,
|
|
29388
29396
|
composerProps: emptyHeroComposerProps,
|
|
29389
29397
|
providerSelectLabel: labels.providerSwitchLabel,
|
|
@@ -29534,7 +29542,7 @@ var AgentGUIEmptyHeroPane = memo3(function AgentGUIEmptyHeroPane2({
|
|
|
29534
29542
|
provider,
|
|
29535
29543
|
emptyLabel,
|
|
29536
29544
|
emptyProvider,
|
|
29537
|
-
|
|
29545
|
+
avatarPresentations,
|
|
29538
29546
|
inlineNoticeChrome,
|
|
29539
29547
|
isRespondingApproval,
|
|
29540
29548
|
onSubmitApprovalOption,
|
|
@@ -29542,8 +29550,8 @@ var AgentGUIEmptyHeroPane = memo3(function AgentGUIEmptyHeroPane2({
|
|
|
29542
29550
|
onRetryActivation,
|
|
29543
29551
|
onContinueInNewConversation,
|
|
29544
29552
|
onProviderSelect,
|
|
29545
|
-
|
|
29546
|
-
|
|
29553
|
+
agentTargets,
|
|
29554
|
+
selectedAgentTarget,
|
|
29547
29555
|
chromeLabels,
|
|
29548
29556
|
composerProps,
|
|
29549
29557
|
providerSelectLabel,
|
|
@@ -29553,25 +29561,30 @@ var AgentGUIEmptyHeroPane = memo3(function AgentGUIEmptyHeroPane2({
|
|
|
29553
29561
|
onSelectSuggestionAction
|
|
29554
29562
|
}) {
|
|
29555
29563
|
"use memo";
|
|
29556
|
-
const
|
|
29557
|
-
|
|
29564
|
+
const heroAvatarPresentations = avatarPresentations.length > 0 ? avatarPresentations : [
|
|
29565
|
+
createFallbackAgentGUIAgentAvatar({
|
|
29566
|
+
provider,
|
|
29567
|
+
label: emptyProvider
|
|
29568
|
+
})
|
|
29569
|
+
];
|
|
29570
|
+
const heroIconAnimationKey = heroAvatarPresentations.map(
|
|
29571
|
+
(avatar) => `${avatar.agentTargetId}:${avatar.iconUrl}:${avatar.badge?.iconUrl ?? ""}`
|
|
29572
|
+
).join("|");
|
|
29558
29573
|
return /* @__PURE__ */ jsx35("div", { className: AgentGUINode_styles_default.emptyHero, children: /* @__PURE__ */ jsxs22("div", { className: AgentGUINode_styles_default.emptyHeroBody, children: [
|
|
29559
|
-
/* @__PURE__ */ jsx35("div", { className: AgentGUINode_styles_default.emptyHeroIconSlot, children:
|
|
29574
|
+
/* @__PURE__ */ jsx35("div", { className: AgentGUINode_styles_default.emptyHeroIconSlot, children: heroAvatarPresentations.length > 1 ? /* @__PURE__ */ jsx35(
|
|
29560
29575
|
AgentGUIHeroAgentCarousel,
|
|
29561
29576
|
{
|
|
29562
|
-
activeAgentTargetId:
|
|
29563
|
-
|
|
29564
|
-
providerTargets,
|
|
29577
|
+
activeAgentTargetId: selectedAgentTarget?.agentTargetId ?? selectedAgentTarget?.targetId,
|
|
29578
|
+
items: heroAvatarPresentations,
|
|
29565
29579
|
onProviderSelect,
|
|
29566
29580
|
providerSelectLabel
|
|
29567
29581
|
},
|
|
29568
29582
|
heroIconAnimationKey
|
|
29569
29583
|
) : /* @__PURE__ */ jsx35(
|
|
29570
|
-
|
|
29584
|
+
AgentGUIAgentAvatarVisual,
|
|
29571
29585
|
{
|
|
29572
|
-
|
|
29573
|
-
|
|
29574
|
-
icon: heroIconPresentations[0]
|
|
29586
|
+
className: AgentGUINode_styles_default.emptyHeroIconEffect,
|
|
29587
|
+
presentation: heroAvatarPresentations[0]
|
|
29575
29588
|
},
|
|
29576
29589
|
heroIconAnimationKey
|
|
29577
29590
|
) }),
|
|
@@ -29581,8 +29594,8 @@ var AgentGUIEmptyHeroPane = memo3(function AgentGUIEmptyHeroPane2({
|
|
|
29581
29594
|
label: emptyLabel,
|
|
29582
29595
|
providerLabel: emptyProvider,
|
|
29583
29596
|
providerSelectLabel,
|
|
29584
|
-
|
|
29585
|
-
|
|
29597
|
+
agentTargets,
|
|
29598
|
+
selectedAgentTarget,
|
|
29586
29599
|
onProviderSelect
|
|
29587
29600
|
}
|
|
29588
29601
|
) }),
|
|
@@ -29617,24 +29630,16 @@ var AgentGUIProviderReadinessGatePane = memo3(
|
|
|
29617
29630
|
showAllProviders = false,
|
|
29618
29631
|
emptyLabel,
|
|
29619
29632
|
emptyProvider,
|
|
29620
|
-
|
|
29621
|
-
|
|
29633
|
+
agentTargets,
|
|
29634
|
+
selectedAgentTarget,
|
|
29622
29635
|
onProviderSelect,
|
|
29623
29636
|
providerSelectLabel,
|
|
29624
29637
|
labels
|
|
29625
29638
|
}) {
|
|
29626
29639
|
"use memo";
|
|
29627
|
-
const
|
|
29628
|
-
|
|
29629
|
-
|
|
29630
|
-
agentTargetId: target.agentTargetId ?? target.targetId,
|
|
29631
|
-
provider: target.provider,
|
|
29632
|
-
iconUrl: agentGUIProviderRailIconPresentation(
|
|
29633
|
-
target.provider,
|
|
29634
|
-
target.iconUrl
|
|
29635
|
-
).iconUrl
|
|
29636
|
-
})),
|
|
29637
|
-
[providerTargets]
|
|
29640
|
+
const heroAvatarPresentations = useMemo11(
|
|
29641
|
+
() => agentTargets.map(projectAgentGUIAgentTargetAvatar),
|
|
29642
|
+
[agentTargets]
|
|
29638
29643
|
);
|
|
29639
29644
|
const pendingAction = gate.pendingAction ?? null;
|
|
29640
29645
|
const isPending = pendingAction !== null;
|
|
@@ -29655,20 +29660,19 @@ var AgentGUIProviderReadinessGatePane = memo3(
|
|
|
29655
29660
|
showAllProviders ? /* @__PURE__ */ jsx35(
|
|
29656
29661
|
AgentGUIHeroAgentCarousel,
|
|
29657
29662
|
{
|
|
29658
|
-
activeAgentTargetId:
|
|
29659
|
-
|
|
29660
|
-
providerTargets,
|
|
29663
|
+
activeAgentTargetId: selectedAgentTarget?.agentTargetId ?? selectedAgentTarget?.targetId,
|
|
29664
|
+
items: heroAvatarPresentations,
|
|
29661
29665
|
onProviderSelect,
|
|
29662
29666
|
providerSelectLabel
|
|
29663
29667
|
}
|
|
29664
29668
|
) : /* @__PURE__ */ jsx35(
|
|
29665
|
-
|
|
29669
|
+
AgentGUIAgentAvatarVisual,
|
|
29666
29670
|
{
|
|
29667
|
-
"aria-hidden": "true",
|
|
29668
29671
|
className: AgentGUINode_styles_default.emptyHeroIconEffect,
|
|
29669
|
-
|
|
29670
|
-
|
|
29671
|
-
|
|
29672
|
+
presentation: selectedAgentTarget ? projectAgentGUIAgentTargetAvatar(selectedAgentTarget) : createFallbackAgentGUIAgentAvatar({
|
|
29673
|
+
provider,
|
|
29674
|
+
label: emptyProvider
|
|
29675
|
+
})
|
|
29672
29676
|
}
|
|
29673
29677
|
),
|
|
29674
29678
|
/* @__PURE__ */ jsx35("h2", { className: AgentGUINode_styles_default.emptyHeroTitle, children: useSharedHeroTitle ? /* @__PURE__ */ jsx35(
|
|
@@ -29677,8 +29681,8 @@ var AgentGUIProviderReadinessGatePane = memo3(
|
|
|
29677
29681
|
label: emptyLabel,
|
|
29678
29682
|
providerLabel: emptyProvider,
|
|
29679
29683
|
providerSelectLabel,
|
|
29680
|
-
|
|
29681
|
-
|
|
29684
|
+
agentTargets,
|
|
29685
|
+
selectedAgentTarget,
|
|
29682
29686
|
onProviderSelect
|
|
29683
29687
|
}
|
|
29684
29688
|
) : content.title }),
|
|
@@ -29796,19 +29800,37 @@ function AgentGUIUnifiedProviderIcon({
|
|
|
29796
29800
|
}
|
|
29797
29801
|
) });
|
|
29798
29802
|
}
|
|
29799
|
-
function
|
|
29800
|
-
|
|
29801
|
-
|
|
29802
|
-
|
|
29803
|
+
function AgentGUIAgentAvatarVisual({
|
|
29804
|
+
className,
|
|
29805
|
+
imageClassName,
|
|
29806
|
+
presentation
|
|
29803
29807
|
}) {
|
|
29804
|
-
return /* @__PURE__ */
|
|
29805
|
-
"
|
|
29808
|
+
return /* @__PURE__ */ jsxs22(
|
|
29809
|
+
"span",
|
|
29806
29810
|
{
|
|
29807
|
-
|
|
29808
|
-
|
|
29809
|
-
|
|
29810
|
-
|
|
29811
|
-
|
|
29811
|
+
"aria-hidden": "true",
|
|
29812
|
+
className: cn3(AgentGUINode_styles_default.agentAvatar, className),
|
|
29813
|
+
"data-agent-target-id": presentation.agentTargetId,
|
|
29814
|
+
children: [
|
|
29815
|
+
/* @__PURE__ */ jsx35(
|
|
29816
|
+
"img",
|
|
29817
|
+
{
|
|
29818
|
+
alt: "",
|
|
29819
|
+
className: cn3(AgentGUINode_styles_default.agentAvatarImage, imageClassName),
|
|
29820
|
+
draggable: false,
|
|
29821
|
+
src: presentation.iconUrl
|
|
29822
|
+
}
|
|
29823
|
+
),
|
|
29824
|
+
presentation.badge?.iconUrl ? /* @__PURE__ */ jsx35("span", { className: AgentGUINode_styles_default.agentAvatarBadge, children: /* @__PURE__ */ jsx35(
|
|
29825
|
+
"img",
|
|
29826
|
+
{
|
|
29827
|
+
alt: "",
|
|
29828
|
+
className: AgentGUINode_styles_default.agentAvatarBadgeImage,
|
|
29829
|
+
draggable: false,
|
|
29830
|
+
src: presentation.badge.iconUrl
|
|
29831
|
+
}
|
|
29832
|
+
) }) : null
|
|
29833
|
+
]
|
|
29812
29834
|
}
|
|
29813
29835
|
);
|
|
29814
29836
|
}
|
|
@@ -29816,8 +29838,8 @@ function EmptyHeroTitle({
|
|
|
29816
29838
|
label,
|
|
29817
29839
|
providerLabel,
|
|
29818
29840
|
providerSelectLabel,
|
|
29819
|
-
|
|
29820
|
-
|
|
29841
|
+
agentTargets = [],
|
|
29842
|
+
selectedAgentTarget = null,
|
|
29821
29843
|
onProviderSelect
|
|
29822
29844
|
}) {
|
|
29823
29845
|
const providerStart = providerLabel ? label.indexOf(providerLabel) : -1;
|
|
@@ -29825,8 +29847,8 @@ function EmptyHeroTitle({
|
|
|
29825
29847
|
return /* @__PURE__ */ jsx35(Fragment9, { children: label });
|
|
29826
29848
|
}
|
|
29827
29849
|
const providerEnd = providerStart + providerLabel.length;
|
|
29828
|
-
const selectedAgentTargetId =
|
|
29829
|
-
const canSwitchProvider =
|
|
29850
|
+
const selectedAgentTargetId = selectedAgentTarget?.targetId ?? `local:${selectedAgentTarget?.provider ?? ""}`;
|
|
29851
|
+
const canSwitchProvider = agentTargets.length > 1 && selectedAgentTarget && onProviderSelect;
|
|
29830
29852
|
const providerName = label.slice(providerStart, providerEnd);
|
|
29831
29853
|
return /* @__PURE__ */ jsxs22(Fragment9, { children: [
|
|
29832
29854
|
label.slice(0, providerStart),
|
|
@@ -29835,7 +29857,7 @@ function EmptyHeroTitle({
|
|
|
29835
29857
|
{
|
|
29836
29858
|
value: selectedAgentTargetId,
|
|
29837
29859
|
onValueChange: (nextTargetId) => {
|
|
29838
|
-
const target =
|
|
29860
|
+
const target = agentTargets.find(
|
|
29839
29861
|
(candidate) => candidate.targetId === nextTargetId
|
|
29840
29862
|
);
|
|
29841
29863
|
if (!target) {
|
|
@@ -29862,7 +29884,7 @@ function EmptyHeroTitle({
|
|
|
29862
29884
|
{
|
|
29863
29885
|
align: "center",
|
|
29864
29886
|
className: cn3(AgentGUINode_styles_default.composerMenuContent, "min-w-[190px]"),
|
|
29865
|
-
children:
|
|
29887
|
+
children: agentTargets.map((target) => /* @__PURE__ */ jsx35(
|
|
29866
29888
|
SelectItem3,
|
|
29867
29889
|
{
|
|
29868
29890
|
value: target.targetId,
|
|
@@ -29879,10 +29901,10 @@ function EmptyHeroTitle({
|
|
|
29879
29901
|
alt: "",
|
|
29880
29902
|
"aria-hidden": "true",
|
|
29881
29903
|
className: "size-4 shrink-0 rounded-[4px]",
|
|
29882
|
-
src:
|
|
29904
|
+
src: resolveAgentGUIAgentAvatarIconUrl(
|
|
29883
29905
|
target.provider,
|
|
29884
29906
|
target.iconUrl
|
|
29885
|
-
)
|
|
29907
|
+
)
|
|
29886
29908
|
}
|
|
29887
29909
|
),
|
|
29888
29910
|
/* @__PURE__ */ jsx35("span", { className: "min-w-0 truncate", children: target.label })
|
|
@@ -30050,7 +30072,7 @@ function syncAgentGUIConversationRailStore(store, next) {
|
|
|
30050
30072
|
Object.assign(store, next);
|
|
30051
30073
|
}
|
|
30052
30074
|
function agentGUIConversationRailStoreSnapshotsEqual(current, next) {
|
|
30053
|
-
return current.activeConversationId === next.activeConversationId && current.pendingDeleteConversationId === next.pendingDeleteConversationId && current.pendingDeleteProjectConversations === next.pendingDeleteProjectConversations && current.pendingDeleteConversations === next.pendingDeleteConversations && current.isLoadingConversations === next.isLoadingConversations && current.isDeletingConversation === next.isDeletingConversation && current.isDeletingProjectConversations === next.isDeletingProjectConversations && current.labels === next.labels && current.workspaceUserProjectI18n === next.workspaceUserProjectI18n && current.uiLanguage === next.uiLanguage && current.previewMode === next.previewMode && current.createConversationDisabled === next.createConversationDisabled && current.openclawGateway === next.openclawGateway && current.isCollapsed === next.isCollapsed && current.
|
|
30075
|
+
return current.activeConversationId === next.activeConversationId && current.pendingDeleteConversationId === next.pendingDeleteConversationId && current.pendingDeleteProjectConversations === next.pendingDeleteProjectConversations && current.pendingDeleteConversations === next.pendingDeleteConversations && current.isLoadingConversations === next.isLoadingConversations && current.isDeletingConversation === next.isDeletingConversation && current.isDeletingProjectConversations === next.isDeletingProjectConversations && current.labels === next.labels && current.workspaceUserProjectI18n === next.workspaceUserProjectI18n && current.uiLanguage === next.uiLanguage && current.previewMode === next.previewMode && current.createConversationDisabled === next.createConversationDisabled && current.openclawGateway === next.openclawGateway && current.isCollapsed === next.isCollapsed && current.agentTargets === next.agentTargets && current.agentTargetsLoading === next.agentTargetsLoading && current.conversationFilter === next.conversationFilter && current.sectionAgentTargetFallbackId === next.sectionAgentTargetFallbackId && current.onUpdateConversationFilter === next.onUpdateConversationFilter && current.onSelectConversationFilterTarget === next.onSelectConversationFilterTarget && current.onCreateConversation === next.onCreateConversation && current.onRetryOpenclawGateway === next.onRetryOpenclawGateway && current.onSelectConversation === next.onSelectConversation && current.onToggleConversationPinned === next.onToggleConversationPinned && current.onMarkConversationUnread === next.onMarkConversationUnread && current.onOpenProjectFiles === next.onOpenProjectFiles && current.onOpenConversationWindow === next.onOpenConversationWindow && current.selectProjectDirectory === next.selectProjectDirectory && current.onRemoveProject === next.onRemoveProject && current.onRequestDeleteProjectConversations === next.onRequestDeleteProjectConversations && current.onCancelDeleteProjectConversations === next.onCancelDeleteProjectConversations && current.onConfirmDeleteProjectConversations === next.onConfirmDeleteProjectConversations && current.onRequestDeleteConversations === next.onRequestDeleteConversations && current.onCancelDeleteConversations === next.onCancelDeleteConversations && current.onConfirmDeleteConversations === next.onConfirmDeleteConversations && current.onRequestDeleteConversation === next.onRequestDeleteConversation && current.onRequestRenameConversation === next.onRequestRenameConversation && current.onCancelDeleteConversation === next.onCancelDeleteConversation && current.onConfirmDeleteConversation === next.onConfirmDeleteConversation;
|
|
30054
30076
|
}
|
|
30055
30077
|
var AgentGUIConversationRailStorePane = memo3(
|
|
30056
30078
|
function AgentGUIConversationRailStorePane2({
|
|
@@ -30465,11 +30487,11 @@ function agentGUIProviderRailAriaLabel(label, badgeLabel) {
|
|
|
30465
30487
|
}
|
|
30466
30488
|
return `${label}, ${normalizedBadgeLabel}`;
|
|
30467
30489
|
}
|
|
30468
|
-
function
|
|
30490
|
+
function agentGUIAgentTargetMatchesConversationFilter(target, filter) {
|
|
30469
30491
|
return filter.kind === "agentTarget" && (target.agentTargetId?.trim() ?? "") === filter.agentTargetId;
|
|
30470
30492
|
}
|
|
30471
|
-
function agentGUIProviderRailTargets(
|
|
30472
|
-
return
|
|
30493
|
+
function agentGUIProviderRailTargets(agentTargets, agentTargetsLoading) {
|
|
30494
|
+
return agentTargetsLoading ? [] : agentTargets;
|
|
30473
30495
|
}
|
|
30474
30496
|
var AGENT_GUI_PROVIDER_RAIL_DRAG_HYSTERESIS_PX = 8;
|
|
30475
30497
|
var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
@@ -30477,9 +30499,9 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30477
30499
|
labels,
|
|
30478
30500
|
previewMode,
|
|
30479
30501
|
workspaceId,
|
|
30480
|
-
|
|
30481
|
-
|
|
30482
|
-
|
|
30502
|
+
selectedAgentTarget,
|
|
30503
|
+
agentTargets,
|
|
30504
|
+
agentTargetsLoading,
|
|
30483
30505
|
renderProviderRailEmpty,
|
|
30484
30506
|
providerRailAllPresentation,
|
|
30485
30507
|
onRequestComposerFocus,
|
|
@@ -30522,23 +30544,20 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30522
30544
|
},
|
|
30523
30545
|
[providerRailOrderStorageKey]
|
|
30524
30546
|
);
|
|
30525
|
-
const
|
|
30526
|
-
() => agentGUIProviderRailTargets(
|
|
30527
|
-
[
|
|
30547
|
+
const railAgentTargets = useMemo11(
|
|
30548
|
+
() => agentGUIProviderRailTargets(agentTargets, agentTargetsLoading),
|
|
30549
|
+
[agentTargets, agentTargetsLoading]
|
|
30528
30550
|
);
|
|
30529
30551
|
const providerTiles = useMemo11(() => {
|
|
30530
|
-
return applyAgentGUIProviderRailOrder(
|
|
30531
|
-
|
|
30532
|
-
providerRailOrder
|
|
30533
|
-
);
|
|
30534
|
-
}, [providerRailOrder, railProviderTargets]);
|
|
30552
|
+
return applyAgentGUIProviderRailOrder(railAgentTargets, providerRailOrder);
|
|
30553
|
+
}, [providerRailOrder, railAgentTargets]);
|
|
30535
30554
|
const visibleProviderTiles = providerTiles;
|
|
30536
|
-
const
|
|
30537
|
-
const allTileSelected = conversationFilter.kind === "all" && !
|
|
30555
|
+
const selectedAgentTargetIsPlaceholder = selectedAgentTarget?.disabled === true;
|
|
30556
|
+
const allTileSelected = conversationFilter.kind === "all" && !selectedAgentTargetIsPlaceholder;
|
|
30538
30557
|
const selectAllProviders = useCallback11(() => {
|
|
30539
30558
|
onUpdateConversationFilter({ kind: "all" });
|
|
30540
|
-
if (
|
|
30541
|
-
const fallbackTarget =
|
|
30559
|
+
if (selectedAgentTargetIsPlaceholder) {
|
|
30560
|
+
const fallbackTarget = railAgentTargets.find((target) => target.disabled !== true) ?? null;
|
|
30542
30561
|
if (fallbackTarget) {
|
|
30543
30562
|
onSelectConversationFilterTarget({
|
|
30544
30563
|
provider: fallbackTarget.provider,
|
|
@@ -30551,8 +30570,8 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30551
30570
|
onSelectConversationFilterTarget,
|
|
30552
30571
|
onRequestComposerFocus,
|
|
30553
30572
|
onUpdateConversationFilter,
|
|
30554
|
-
|
|
30555
|
-
|
|
30573
|
+
railAgentTargets,
|
|
30574
|
+
selectedAgentTargetIsPlaceholder
|
|
30556
30575
|
]);
|
|
30557
30576
|
const selectAgentTargetTile = useCallback11(
|
|
30558
30577
|
(target) => {
|
|
@@ -30569,7 +30588,7 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30569
30588
|
}, [setProviderRailDragState]);
|
|
30570
30589
|
const handleProviderRailDragStart = useCallback11(
|
|
30571
30590
|
(event, target) => {
|
|
30572
|
-
if (previewMode ||
|
|
30591
|
+
if (previewMode || agentTargetsLoading) {
|
|
30573
30592
|
event.preventDefault();
|
|
30574
30593
|
return;
|
|
30575
30594
|
}
|
|
@@ -30581,11 +30600,11 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30581
30600
|
position: null
|
|
30582
30601
|
});
|
|
30583
30602
|
},
|
|
30584
|
-
[previewMode,
|
|
30603
|
+
[previewMode, agentTargetsLoading, setProviderRailDragState]
|
|
30585
30604
|
);
|
|
30586
30605
|
const handleProviderRailDragOver = useCallback11(
|
|
30587
30606
|
(event, target) => {
|
|
30588
|
-
if (previewMode ||
|
|
30607
|
+
if (previewMode || agentTargetsLoading || !dragState) {
|
|
30589
30608
|
return;
|
|
30590
30609
|
}
|
|
30591
30610
|
event.preventDefault();
|
|
@@ -30613,7 +30632,7 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30613
30632
|
position
|
|
30614
30633
|
});
|
|
30615
30634
|
},
|
|
30616
|
-
[dragState, previewMode,
|
|
30635
|
+
[dragState, previewMode, agentTargetsLoading, setProviderRailDragState]
|
|
30617
30636
|
);
|
|
30618
30637
|
const commitProviderRailDragDrop = useCallback11(
|
|
30619
30638
|
(event) => {
|
|
@@ -30623,7 +30642,7 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30623
30642
|
overTargetId: null,
|
|
30624
30643
|
position: null
|
|
30625
30644
|
} : null);
|
|
30626
|
-
if (previewMode ||
|
|
30645
|
+
if (previewMode || agentTargetsLoading || !activeDragState) {
|
|
30627
30646
|
clearProviderRailDragState();
|
|
30628
30647
|
return;
|
|
30629
30648
|
}
|
|
@@ -30683,14 +30702,14 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30683
30702
|
dragState,
|
|
30684
30703
|
persistProviderRailOrder,
|
|
30685
30704
|
previewMode,
|
|
30686
|
-
|
|
30705
|
+
agentTargetsLoading,
|
|
30687
30706
|
visibleProviderTiles
|
|
30688
30707
|
]
|
|
30689
30708
|
);
|
|
30690
30709
|
const handleProviderRailContainerDragOver = useCallback11(
|
|
30691
30710
|
(event) => {
|
|
30692
30711
|
const activeDragState = dragStateRef.current ?? dragState;
|
|
30693
|
-
if (!activeDragState || previewMode ||
|
|
30712
|
+
if (!activeDragState || previewMode || agentTargetsLoading) {
|
|
30694
30713
|
return;
|
|
30695
30714
|
}
|
|
30696
30715
|
event.preventDefault();
|
|
@@ -30729,16 +30748,16 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30729
30748
|
position
|
|
30730
30749
|
});
|
|
30731
30750
|
},
|
|
30732
|
-
[dragState, previewMode,
|
|
30751
|
+
[dragState, previewMode, agentTargetsLoading, setProviderRailDragState]
|
|
30733
30752
|
);
|
|
30734
|
-
if (!
|
|
30753
|
+
if (!agentTargetsLoading && visibleProviderTiles.length === 0 && renderProviderRailEmpty) {
|
|
30735
30754
|
return /* @__PURE__ */ jsx35(
|
|
30736
30755
|
"div",
|
|
30737
30756
|
{
|
|
30738
30757
|
className: AgentGUINode_styles_default.providerRail,
|
|
30739
30758
|
role: "tablist",
|
|
30740
30759
|
"aria-label": labels.providerSwitchLabel,
|
|
30741
|
-
"aria-busy":
|
|
30760
|
+
"aria-busy": agentTargetsLoading,
|
|
30742
30761
|
"data-empty": "true"
|
|
30743
30762
|
}
|
|
30744
30763
|
);
|
|
@@ -30749,7 +30768,7 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30749
30768
|
className: "flex min-h-0 w-full flex-col items-center",
|
|
30750
30769
|
role: "tablist",
|
|
30751
30770
|
"aria-label": labels.providerSwitchLabel,
|
|
30752
|
-
"aria-busy":
|
|
30771
|
+
"aria-busy": agentTargetsLoading,
|
|
30753
30772
|
onDragOver: handleProviderRailContainerDragOver,
|
|
30754
30773
|
onDrop: commitProviderRailDragDrop,
|
|
30755
30774
|
children: [
|
|
@@ -30778,7 +30797,7 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30778
30797
|
),
|
|
30779
30798
|
/* @__PURE__ */ jsx35("span", { "aria-hidden": "true", className: AgentGUINode_styles_default.providerRailSeparator })
|
|
30780
30799
|
] }) : null,
|
|
30781
|
-
|
|
30800
|
+
agentTargetsLoading ? [0, 1, 2].map((index) => /* @__PURE__ */ jsx35(
|
|
30782
30801
|
"button",
|
|
30783
30802
|
{
|
|
30784
30803
|
type: "button",
|
|
@@ -30799,7 +30818,7 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30799
30818
|
`provider-target-loading-${index}`
|
|
30800
30819
|
)) : null,
|
|
30801
30820
|
visibleProviderTiles.map((target) => {
|
|
30802
|
-
const providerSelected = visibleProviderTiles.length === 1 ? true : target.disabled === true ?
|
|
30821
|
+
const providerSelected = visibleProviderTiles.length === 1 ? true : target.disabled === true ? selectedAgentTarget?.provider === target.provider && selectedAgentTarget?.targetId === target.targetId : agentGUIAgentTargetMatchesConversationFilter(
|
|
30803
30822
|
target,
|
|
30804
30823
|
conversationFilter
|
|
30805
30824
|
);
|
|
@@ -30827,33 +30846,19 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30827
30846
|
"data-agent-target-id": target.targetId,
|
|
30828
30847
|
"data-selected": providerSelected ? "true" : "false",
|
|
30829
30848
|
disabled: previewMode,
|
|
30830
|
-
draggable: !previewMode && !
|
|
30849
|
+
draggable: !previewMode && !agentTargetsLoading,
|
|
30831
30850
|
onClick: () => selectAgentTargetTile(target),
|
|
30832
30851
|
onDragEnd: clearProviderRailDragState,
|
|
30833
30852
|
onDragOver: (event) => handleProviderRailDragOver(event, target),
|
|
30834
30853
|
onDragStart: (event) => handleProviderRailDragStart(event, target),
|
|
30835
|
-
children: /* @__PURE__ */
|
|
30836
|
-
|
|
30837
|
-
|
|
30838
|
-
|
|
30839
|
-
|
|
30840
|
-
|
|
30841
|
-
|
|
30842
|
-
|
|
30843
|
-
target.iconUrl
|
|
30844
|
-
)
|
|
30845
|
-
}
|
|
30846
|
-
),
|
|
30847
|
-
target.badge?.iconUrl ? /* @__PURE__ */ jsx35("span", { "aria-hidden": "true", className: AgentGUINode_styles_default.providerRailBadge, children: /* @__PURE__ */ jsx35(
|
|
30848
|
-
"img",
|
|
30849
|
-
{
|
|
30850
|
-
alt: "",
|
|
30851
|
-
className: AgentGUINode_styles_default.providerRailBadgeImage,
|
|
30852
|
-
draggable: false,
|
|
30853
|
-
src: target.badge.iconUrl
|
|
30854
|
-
}
|
|
30855
|
-
) }) : null
|
|
30856
|
-
] })
|
|
30854
|
+
children: /* @__PURE__ */ jsx35(
|
|
30855
|
+
AgentGUIAgentAvatarVisual,
|
|
30856
|
+
{
|
|
30857
|
+
className: AgentGUINode_styles_default.providerRailAvatar,
|
|
30858
|
+
imageClassName: AgentGUINode_styles_default.providerRailAvatarImage,
|
|
30859
|
+
presentation: projectAgentGUIAgentTargetAvatar(target)
|
|
30860
|
+
}
|
|
30861
|
+
)
|
|
30857
30862
|
},
|
|
30858
30863
|
`${target.provider}:${target.targetId}`
|
|
30859
30864
|
);
|
|
@@ -33569,7 +33574,7 @@ function resolveAgentGUIRailStatusProvider(input) {
|
|
|
33569
33574
|
if (filter.kind !== "agentTarget") {
|
|
33570
33575
|
return null;
|
|
33571
33576
|
}
|
|
33572
|
-
const target = input.
|
|
33577
|
+
const target = input.agentTargets.find(
|
|
33573
33578
|
(candidate) => candidate.disabled !== true && (candidate.agentTargetId?.trim() ?? "") === filter.agentTargetId
|
|
33574
33579
|
);
|
|
33575
33580
|
return target ? target.provider : null;
|
|
@@ -33871,8 +33876,8 @@ var AgentGUINode = memo4(function AgentGUINode2({
|
|
|
33871
33876
|
data: state,
|
|
33872
33877
|
openSessionRequest,
|
|
33873
33878
|
prefillPromptRequest,
|
|
33874
|
-
|
|
33875
|
-
|
|
33879
|
+
agentTargets: internalAgentTargets,
|
|
33880
|
+
agentTargetsLoading: agentsLoading,
|
|
33876
33881
|
providerReadinessGates: internalProviderReadinessGates,
|
|
33877
33882
|
defaultAgentTargetId,
|
|
33878
33883
|
previewMode,
|
|
@@ -33904,9 +33909,9 @@ var AgentGUINode = memo4(function AgentGUINode2({
|
|
|
33904
33909
|
);
|
|
33905
33910
|
const fallbackAgentTitle = t("sidebar.fallbackAgentLabel");
|
|
33906
33911
|
const activeProvider = viewModel.activeConversation?.provider ?? state.provider;
|
|
33907
|
-
const activeReadinessProvider = viewModel.activeConversationId !== null ? activeProvider : viewModel.
|
|
33908
|
-
const
|
|
33909
|
-
const displayProviderLabel = viewModel.activeConversation ? resolveAgentGUIProviderDisplayLabel(activeProvider, fallbackAgentTitle) :
|
|
33912
|
+
const activeReadinessProvider = viewModel.activeConversationId !== null ? activeProvider : viewModel.selectedAgentTarget.provider;
|
|
33913
|
+
const selectedAgentTargetLabel = viewModel.selectedAgentTarget?.label ?? resolveAgentGUIProviderDisplayLabel(state.provider, fallbackAgentTitle);
|
|
33914
|
+
const displayProviderLabel = viewModel.activeConversation ? resolveAgentGUIProviderDisplayLabel(activeProvider, fallbackAgentTitle) : selectedAgentTargetLabel;
|
|
33910
33915
|
const activeConversationDockTitle = viewModel.activeConversation ? resolveAgentGUIDockConversationTitle(viewModel.activeConversation) : null;
|
|
33911
33916
|
useEffect18(() => {
|
|
33912
33917
|
if (previewMode || !viewModel.activeConversation) {
|
|
@@ -34553,9 +34558,9 @@ var AgentGUINode = memo4(function AgentGUINode2({
|
|
|
34553
34558
|
const railStatusProvider = useMemo12(
|
|
34554
34559
|
() => resolveAgentGUIRailStatusProvider({
|
|
34555
34560
|
conversationFilter: viewModel.conversationFilter,
|
|
34556
|
-
|
|
34561
|
+
agentTargets: viewModel.agentTargets
|
|
34557
34562
|
}),
|
|
34558
|
-
[viewModel.conversationFilter, viewModel.
|
|
34563
|
+
[viewModel.conversationFilter, viewModel.agentTargets]
|
|
34559
34564
|
);
|
|
34560
34565
|
const activeAgentProbe = useMemo12(
|
|
34561
34566
|
() => findWorkspaceAgentProbeForDockProvider(
|