@tutti-os/agent-gui 0.0.90 → 0.0.92
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 +12 -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 +63 -21
- 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 +1002 -562
- 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",
|
|
@@ -16870,6 +16874,9 @@ var styles = {
|
|
|
16870
16874
|
emptyHeroCarousel: "agent-gui-node__empty-hero-carousel",
|
|
16871
16875
|
emptyHeroCarouselCanvas: "agent-gui-node__empty-hero-carousel-canvas",
|
|
16872
16876
|
emptyHeroCarouselItem: "agent-gui-node__empty-hero-carousel-item",
|
|
16877
|
+
emptyHeroCarouselLayer: "agent-gui-node__empty-hero-carousel-layer",
|
|
16878
|
+
emptyHeroCarouselPlaceholder: "agent-gui-node__empty-hero-carousel-placeholder",
|
|
16879
|
+
emptyHeroCarouselStage: "agent-gui-node__empty-hero-carousel-stage",
|
|
16873
16880
|
emptyHeroIconEffect: "agent-gui-node__empty-hero-icon-effect",
|
|
16874
16881
|
emptyHeroIconRail: "agent-gui-node__empty-hero-icon-rail",
|
|
16875
16882
|
emptyHeroIconRailItem: "agent-gui-node__empty-hero-icon-rail-item",
|
|
@@ -16908,8 +16915,6 @@ var styles = {
|
|
|
16908
16915
|
providerRailAvatar: "agent-gui-node__provider-rail-avatar",
|
|
16909
16916
|
providerRailAvatarIcon: "agent-gui-node__provider-rail-avatar-icon",
|
|
16910
16917
|
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
16918
|
emptyHeroIconSlot: "agent-gui-node__empty-hero-icon-slot",
|
|
16914
16919
|
providerRailConfigButton: "agent-gui-node__provider-rail-config-button",
|
|
16915
16920
|
providerRailFooter: "agent-gui-node__provider-rail-footer",
|
|
@@ -17153,16 +17158,35 @@ import {
|
|
|
17153
17158
|
import * as THREE from "three";
|
|
17154
17159
|
var CAMERA_FOV_DEG = 14;
|
|
17155
17160
|
var CAMERA_Z = 7.5;
|
|
17156
|
-
var WHEEL_TARGET_SLOTS =
|
|
17157
|
-
var TILE_SPACING = 1.
|
|
17158
|
-
var
|
|
17159
|
-
var
|
|
17160
|
-
var
|
|
17161
|
+
var WHEEL_TARGET_SLOTS = 40;
|
|
17162
|
+
var TILE_SPACING = 1.55;
|
|
17163
|
+
var VISIBLE_ARC_CURVATURE = 0.9;
|
|
17164
|
+
var MIN_RECORD_OPACITY = 0.22;
|
|
17165
|
+
var RECORD_FADE_RANGE_SLOTS = 4.5;
|
|
17166
|
+
var RECORD_FADE_CURVE = 1.45;
|
|
17167
|
+
var SPRING_STIFFNESS = 120;
|
|
17168
|
+
var SPRING_DAMPING_RATIO = 0.78;
|
|
17169
|
+
var SPRING_MIN_LAUNCH_VELOCITY = 2.6;
|
|
17161
17170
|
var SPRING_SETTLE_EPSILON = 1e-3;
|
|
17162
17171
|
var SPRING_SETTLE_VELOCITY = 0.02;
|
|
17172
|
+
var MAX_FRAME_DELTA_SECONDS = 0.032;
|
|
17163
17173
|
var TEXTURE_SIZE = 256;
|
|
17164
|
-
var
|
|
17174
|
+
var BADGE_CORNER_RADIUS = 0.5;
|
|
17175
|
+
var BADGE_DIAMETER = 0.36;
|
|
17176
|
+
var BADGE_OFFSET = 0.4;
|
|
17165
17177
|
var MAX_PIXEL_RATIO = 2;
|
|
17178
|
+
var RECORD_RADIUS_RATIO = 0.47;
|
|
17179
|
+
var RECORD_LABEL_RADIUS_RATIO = 0.41;
|
|
17180
|
+
var RECORD_SPINDLE_RADIUS_RATIO = 0.035;
|
|
17181
|
+
var RECORD_SPIN_SECONDS = 7;
|
|
17182
|
+
var RECORD_MODEL_SCALE = 1.3;
|
|
17183
|
+
var RECORD_MODEL_RADIUS = 0.475;
|
|
17184
|
+
var RECORD_MODEL_THICKNESS = 0.065;
|
|
17185
|
+
var RECORD_MODEL_TILT_X = -0.11;
|
|
17186
|
+
var RECORD_MODEL_SIDE_TILT_FACTOR = 0.18;
|
|
17187
|
+
var RECORD_MODEL_MAX_SIDE_TILT = 0.16;
|
|
17188
|
+
var RECORD_RENDER_RANGE_SLOTS = 3.4;
|
|
17189
|
+
var RECORD_EDGE_SEGMENTS = 48;
|
|
17166
17190
|
function ringOffset(index, scroll, count) {
|
|
17167
17191
|
if (count <= 1) {
|
|
17168
17192
|
return index - scroll;
|
|
@@ -17176,13 +17200,120 @@ function ringOffset(index, scroll, count) {
|
|
|
17176
17200
|
}
|
|
17177
17201
|
return offset;
|
|
17178
17202
|
}
|
|
17179
|
-
function
|
|
17203
|
+
function vinylRecordTexture(image, onReadyRender) {
|
|
17204
|
+
const canvas = document.createElement("canvas");
|
|
17205
|
+
canvas.width = TEXTURE_SIZE;
|
|
17206
|
+
canvas.height = TEXTURE_SIZE;
|
|
17207
|
+
const context = canvas.getContext("2d");
|
|
17208
|
+
if (context) {
|
|
17209
|
+
const center = TEXTURE_SIZE / 2;
|
|
17210
|
+
const recordRadius = TEXTURE_SIZE * RECORD_RADIUS_RATIO;
|
|
17211
|
+
const labelRadius = recordRadius * RECORD_LABEL_RADIUS_RATIO;
|
|
17212
|
+
context.clearRect(0, 0, TEXTURE_SIZE, TEXTURE_SIZE);
|
|
17213
|
+
context.save();
|
|
17214
|
+
context.beginPath();
|
|
17215
|
+
context.arc(center, center, recordRadius, 0, Math.PI * 2);
|
|
17216
|
+
context.clip();
|
|
17217
|
+
const recordFill = context.createRadialGradient(
|
|
17218
|
+
center * 0.92,
|
|
17219
|
+
center * 0.88,
|
|
17220
|
+
labelRadius,
|
|
17221
|
+
center,
|
|
17222
|
+
center,
|
|
17223
|
+
recordRadius
|
|
17224
|
+
);
|
|
17225
|
+
recordFill.addColorStop(0, "rgb(26 26 27)");
|
|
17226
|
+
recordFill.addColorStop(0.54, "rgb(5 5 6)");
|
|
17227
|
+
recordFill.addColorStop(0.82, "rgb(18 18 19)");
|
|
17228
|
+
recordFill.addColorStop(1, "rgb(3 3 4)");
|
|
17229
|
+
context.fillStyle = recordFill;
|
|
17230
|
+
context.fillRect(0, 0, TEXTURE_SIZE, TEXTURE_SIZE);
|
|
17231
|
+
for (let radius = labelRadius + 4; radius < recordRadius - 3; radius += 3.5) {
|
|
17232
|
+
const grooveIndex = Math.round((radius - labelRadius) / 3.5);
|
|
17233
|
+
context.beginPath();
|
|
17234
|
+
context.arc(center, center, radius, 0, Math.PI * 2);
|
|
17235
|
+
context.strokeStyle = grooveIndex % 3 === 0 ? "rgb(255 255 255 / 0.12)" : "rgb(255 255 255 / 0.055)";
|
|
17236
|
+
context.lineWidth = grooveIndex % 3 === 0 ? 0.7 : 0.45;
|
|
17237
|
+
context.stroke();
|
|
17238
|
+
}
|
|
17239
|
+
context.save();
|
|
17240
|
+
context.translate(center, center);
|
|
17241
|
+
context.rotate(-Math.PI / 4);
|
|
17242
|
+
const sheen = context.createLinearGradient(
|
|
17243
|
+
-recordRadius,
|
|
17244
|
+
0,
|
|
17245
|
+
recordRadius,
|
|
17246
|
+
0
|
|
17247
|
+
);
|
|
17248
|
+
sheen.addColorStop(0, "rgb(255 255 255 / 0)");
|
|
17249
|
+
sheen.addColorStop(0.42, "rgb(255 255 255 / 0.02)");
|
|
17250
|
+
sheen.addColorStop(0.5, "rgb(255 255 255 / 0.18)");
|
|
17251
|
+
sheen.addColorStop(0.58, "rgb(255 255 255 / 0.02)");
|
|
17252
|
+
sheen.addColorStop(1, "rgb(255 255 255 / 0)");
|
|
17253
|
+
context.fillStyle = sheen;
|
|
17254
|
+
context.fillRect(
|
|
17255
|
+
-recordRadius,
|
|
17256
|
+
-recordRadius,
|
|
17257
|
+
recordRadius * 2,
|
|
17258
|
+
recordRadius * 2
|
|
17259
|
+
);
|
|
17260
|
+
context.restore();
|
|
17261
|
+
context.restore();
|
|
17262
|
+
context.save();
|
|
17263
|
+
context.beginPath();
|
|
17264
|
+
context.arc(center, center, labelRadius, 0, Math.PI * 2);
|
|
17265
|
+
context.clip();
|
|
17266
|
+
const scale = Math.max(
|
|
17267
|
+
labelRadius * 2 / image.width,
|
|
17268
|
+
labelRadius * 2 / image.height
|
|
17269
|
+
);
|
|
17270
|
+
const width = image.width * scale;
|
|
17271
|
+
const height = image.height * scale;
|
|
17272
|
+
context.drawImage(
|
|
17273
|
+
image,
|
|
17274
|
+
center - width / 2,
|
|
17275
|
+
center - height / 2,
|
|
17276
|
+
width,
|
|
17277
|
+
height
|
|
17278
|
+
);
|
|
17279
|
+
context.restore();
|
|
17280
|
+
context.beginPath();
|
|
17281
|
+
context.arc(center, center, labelRadius, 0, Math.PI * 2);
|
|
17282
|
+
context.strokeStyle = "rgb(255 255 255 / 0.2)";
|
|
17283
|
+
context.lineWidth = 1;
|
|
17284
|
+
context.stroke();
|
|
17285
|
+
context.beginPath();
|
|
17286
|
+
context.arc(
|
|
17287
|
+
center,
|
|
17288
|
+
center,
|
|
17289
|
+
recordRadius * RECORD_SPINDLE_RADIUS_RATIO,
|
|
17290
|
+
0,
|
|
17291
|
+
Math.PI * 2
|
|
17292
|
+
);
|
|
17293
|
+
context.fillStyle = "rgb(5 5 6)";
|
|
17294
|
+
context.fill();
|
|
17295
|
+
context.strokeStyle = "rgb(255 255 255 / 0.18)";
|
|
17296
|
+
context.lineWidth = 0.75;
|
|
17297
|
+
context.stroke();
|
|
17298
|
+
context.beginPath();
|
|
17299
|
+
context.arc(center, center, recordRadius - 0.75, 0, Math.PI * 2);
|
|
17300
|
+
context.strokeStyle = "rgb(255 255 255 / 0.32)";
|
|
17301
|
+
context.lineWidth = 1.25;
|
|
17302
|
+
context.stroke();
|
|
17303
|
+
}
|
|
17304
|
+
const texture = new THREE.CanvasTexture(canvas);
|
|
17305
|
+
texture.colorSpace = THREE.SRGBColorSpace;
|
|
17306
|
+
texture.anisotropy = 4;
|
|
17307
|
+
onReadyRender();
|
|
17308
|
+
return texture;
|
|
17309
|
+
}
|
|
17310
|
+
function roundedIconTexture(image, onReadyRender, cornerRadius) {
|
|
17180
17311
|
const canvas = document.createElement("canvas");
|
|
17181
17312
|
canvas.width = TEXTURE_SIZE;
|
|
17182
17313
|
canvas.height = TEXTURE_SIZE;
|
|
17183
17314
|
const context = canvas.getContext("2d");
|
|
17184
17315
|
if (context) {
|
|
17185
|
-
const radius = TEXTURE_SIZE *
|
|
17316
|
+
const radius = TEXTURE_SIZE * cornerRadius;
|
|
17186
17317
|
context.beginPath();
|
|
17187
17318
|
context.roundRect(0, 0, TEXTURE_SIZE, TEXTURE_SIZE, radius);
|
|
17188
17319
|
context.clip();
|
|
@@ -17219,8 +17350,11 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17219
17350
|
renderer;
|
|
17220
17351
|
scene;
|
|
17221
17352
|
camera;
|
|
17353
|
+
edgeGeometry;
|
|
17354
|
+
faceGeometry;
|
|
17222
17355
|
raycaster = new THREE.Raycaster();
|
|
17223
17356
|
tiles = [];
|
|
17357
|
+
textures = /* @__PURE__ */ new Set();
|
|
17224
17358
|
// Number of distinct agents; the wheel holds agentCount * repeats tiles
|
|
17225
17359
|
// (the icon sequence repeated), and scroll/target count TILE slots.
|
|
17226
17360
|
agentCount;
|
|
@@ -17232,11 +17366,15 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17232
17366
|
scroll = 0;
|
|
17233
17367
|
target = 0;
|
|
17234
17368
|
velocity = 0;
|
|
17235
|
-
|
|
17369
|
+
renderFrameHandle = null;
|
|
17370
|
+
springFrameHandle = null;
|
|
17371
|
+
recordSpinFrameHandle = null;
|
|
17236
17372
|
lastFrameAt = null;
|
|
17373
|
+
lastRecordSpinFrameAt = null;
|
|
17374
|
+
hoveredTile = null;
|
|
17237
17375
|
disposed = false;
|
|
17238
17376
|
constructor(options) {
|
|
17239
|
-
this.agentCount = options.
|
|
17377
|
+
this.agentCount = options.items.length;
|
|
17240
17378
|
const repeats = Math.max(
|
|
17241
17379
|
1,
|
|
17242
17380
|
Math.round(WHEEL_TARGET_SLOTS / Math.max(this.agentCount, 1))
|
|
@@ -17253,19 +17391,80 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17253
17391
|
this.scene = new THREE.Scene();
|
|
17254
17392
|
this.camera = new THREE.PerspectiveCamera(CAMERA_FOV_DEG, 1, 0.1, 50);
|
|
17255
17393
|
this.camera.position.set(0, 0, CAMERA_Z);
|
|
17394
|
+
this.scene.add(new THREE.AmbientLight(16777215, 1.25));
|
|
17395
|
+
const keyLight = new THREE.DirectionalLight(16777215, 2.4);
|
|
17396
|
+
keyLight.position.set(-2.5, 3.5, 5);
|
|
17397
|
+
this.scene.add(keyLight);
|
|
17398
|
+
const rimLight = new THREE.DirectionalLight(10467327, 0.9);
|
|
17399
|
+
rimLight.position.set(4, -1.5, 2.5);
|
|
17400
|
+
this.scene.add(rimLight);
|
|
17401
|
+
this.faceGeometry = new THREE.PlaneGeometry(1, 1);
|
|
17402
|
+
this.edgeGeometry = new THREE.CylinderGeometry(
|
|
17403
|
+
RECORD_MODEL_RADIUS,
|
|
17404
|
+
RECORD_MODEL_RADIUS,
|
|
17405
|
+
RECORD_MODEL_THICKNESS,
|
|
17406
|
+
RECORD_EDGE_SEGMENTS,
|
|
17407
|
+
1,
|
|
17408
|
+
true
|
|
17409
|
+
);
|
|
17256
17410
|
for (let slot = 0; slot < this.tileCount; slot++) {
|
|
17257
|
-
const
|
|
17258
|
-
const
|
|
17411
|
+
const agentIndex = slot % this.agentCount;
|
|
17412
|
+
const poseGroup = new THREE.Group();
|
|
17413
|
+
const recordGroup = new THREE.Group();
|
|
17414
|
+
recordGroup.scale.setScalar(RECORD_MODEL_SCALE);
|
|
17415
|
+
const faceMaterial = new THREE.MeshBasicMaterial({
|
|
17259
17416
|
transparent: true,
|
|
17260
17417
|
depthWrite: false,
|
|
17261
17418
|
visible: false
|
|
17262
17419
|
});
|
|
17263
|
-
const
|
|
17264
|
-
|
|
17265
|
-
|
|
17266
|
-
|
|
17420
|
+
const faceMesh = new THREE.Mesh(this.faceGeometry, faceMaterial);
|
|
17421
|
+
faceMesh.position.z = RECORD_MODEL_THICKNESS / 2 + 2e-3;
|
|
17422
|
+
faceMesh.userData.agentIndex = agentIndex;
|
|
17423
|
+
const edgeMaterial = new THREE.MeshStandardMaterial({
|
|
17424
|
+
color: 460552,
|
|
17425
|
+
metalness: 0.42,
|
|
17426
|
+
roughness: 0.28,
|
|
17427
|
+
transparent: true,
|
|
17428
|
+
depthWrite: false
|
|
17429
|
+
});
|
|
17430
|
+
const edgeMesh = new THREE.Mesh(this.edgeGeometry, edgeMaterial);
|
|
17431
|
+
edgeMesh.rotation.x = Math.PI / 2;
|
|
17432
|
+
const badgeMaterial = new THREE.MeshBasicMaterial({
|
|
17433
|
+
transparent: true,
|
|
17434
|
+
depthWrite: false,
|
|
17435
|
+
// The solid circle is the owner marker's asset-independent fallback.
|
|
17436
|
+
// Keep it visible while the optional remote avatar is loading or when
|
|
17437
|
+
// that avatar cannot safely become a WebGL texture.
|
|
17438
|
+
visible: options.items[slot % this.agentCount]?.badge != null
|
|
17439
|
+
});
|
|
17440
|
+
const badgeMesh = new THREE.Mesh(
|
|
17441
|
+
new THREE.CircleGeometry(BADGE_DIAMETER / 2, 32),
|
|
17442
|
+
badgeMaterial
|
|
17443
|
+
);
|
|
17444
|
+
badgeMesh.position.set(
|
|
17445
|
+
BADGE_OFFSET,
|
|
17446
|
+
-BADGE_OFFSET,
|
|
17447
|
+
RECORD_MODEL_THICKNESS / 2 + 0.01
|
|
17448
|
+
);
|
|
17449
|
+
badgeMesh.userData.agentIndex = agentIndex;
|
|
17450
|
+
recordGroup.add(edgeMesh, faceMesh);
|
|
17451
|
+
poseGroup.add(recordGroup, badgeMesh);
|
|
17452
|
+
poseGroup.visible = false;
|
|
17453
|
+
poseGroup.userData.agentIndex = agentIndex;
|
|
17454
|
+
this.scene.add(poseGroup);
|
|
17455
|
+
this.tiles.push({
|
|
17456
|
+
badgeMesh,
|
|
17457
|
+
edgeMaterial,
|
|
17458
|
+
edgeMesh,
|
|
17459
|
+
faceMaterial,
|
|
17460
|
+
faceMesh,
|
|
17461
|
+
poseGroup,
|
|
17462
|
+
ready: false,
|
|
17463
|
+
recordGroup,
|
|
17464
|
+
rotation: 0
|
|
17465
|
+
});
|
|
17267
17466
|
}
|
|
17268
|
-
options.
|
|
17467
|
+
options.items.forEach((item, agentIndex) => {
|
|
17269
17468
|
const loadedImage = options.loadedImages?.[agentIndex] ?? null;
|
|
17270
17469
|
const image = loadedImage ?? new Image();
|
|
17271
17470
|
if (!loadedImage) {
|
|
@@ -17284,10 +17483,14 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17284
17483
|
if (image.complete && image.naturalWidth > 0) {
|
|
17285
17484
|
this.applyImageTexture(image, agentIndex);
|
|
17286
17485
|
} else if (!loadedImage) {
|
|
17287
|
-
image.src = iconUrl;
|
|
17486
|
+
image.src = item.iconUrl;
|
|
17487
|
+
}
|
|
17488
|
+
if (item.badge?.iconUrl) {
|
|
17489
|
+
this.loadBadgeImage(item.badge.iconUrl, agentIndex);
|
|
17288
17490
|
}
|
|
17289
17491
|
});
|
|
17290
17492
|
this.applyPoses();
|
|
17493
|
+
this.startRecordSpin();
|
|
17291
17494
|
}
|
|
17292
17495
|
setSize(width, height) {
|
|
17293
17496
|
if (this.disposed || width <= 0 || height <= 0) {
|
|
@@ -17310,6 +17513,7 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17310
17513
|
// icon sequence repeats); returns the normalized agent index.
|
|
17311
17514
|
stepBy(direction) {
|
|
17312
17515
|
this.target += direction;
|
|
17516
|
+
this.primeSpringMotion();
|
|
17313
17517
|
this.animate();
|
|
17314
17518
|
return this.targetIndex();
|
|
17315
17519
|
}
|
|
@@ -17338,6 +17542,7 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17338
17542
|
}
|
|
17339
17543
|
this.target += best ?? 0;
|
|
17340
17544
|
if (animateMove) {
|
|
17545
|
+
this.primeSpringMotion();
|
|
17341
17546
|
this.animate();
|
|
17342
17547
|
return;
|
|
17343
17548
|
}
|
|
@@ -17348,6 +17553,26 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17348
17553
|
}
|
|
17349
17554
|
// Canvas-relative pointer coordinates -> agent index, or null.
|
|
17350
17555
|
pick(x, y, width, height) {
|
|
17556
|
+
const tile = this.pickTile(x, y, width, height);
|
|
17557
|
+
const index = tile?.poseGroup.userData.agentIndex;
|
|
17558
|
+
return typeof index === "number" ? index : null;
|
|
17559
|
+
}
|
|
17560
|
+
// Gives playback to the record beneath the pointer. When no record is
|
|
17561
|
+
// hovered, playback returns to the record nearest the center.
|
|
17562
|
+
hover(x, y, width, height) {
|
|
17563
|
+
const tile = this.pickTile(x, y, width, height);
|
|
17564
|
+
if (tile !== this.hoveredTile) {
|
|
17565
|
+
this.hoveredTile = tile;
|
|
17566
|
+
this.startRecordSpin();
|
|
17567
|
+
}
|
|
17568
|
+
const index = tile?.poseGroup.userData.agentIndex;
|
|
17569
|
+
return typeof index === "number" ? index : null;
|
|
17570
|
+
}
|
|
17571
|
+
clearHover() {
|
|
17572
|
+
this.hoveredTile = null;
|
|
17573
|
+
this.startRecordSpin();
|
|
17574
|
+
}
|
|
17575
|
+
pickTile(x, y, width, height) {
|
|
17351
17576
|
if (this.disposed || width <= 0 || height <= 0) {
|
|
17352
17577
|
return null;
|
|
17353
17578
|
}
|
|
@@ -17357,30 +17582,52 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17357
17582
|
);
|
|
17358
17583
|
this.raycaster.setFromCamera(pointer, this.camera);
|
|
17359
17584
|
const meshes = this.tiles.filter(
|
|
17360
|
-
(tile) => tile.
|
|
17361
|
-
).
|
|
17585
|
+
(tile) => tile.poseGroup.visible && tile.faceMaterial.visible && tile.faceMaterial.opacity > 0.05
|
|
17586
|
+
).flatMap(
|
|
17587
|
+
(tile) => tile.badgeMesh.material.visible ? [tile.faceMesh, tile.badgeMesh] : [tile.faceMesh]
|
|
17588
|
+
);
|
|
17362
17589
|
const hit = this.raycaster.intersectObjects(meshes, false)[0];
|
|
17363
|
-
|
|
17364
|
-
|
|
17590
|
+
if (!hit) {
|
|
17591
|
+
return null;
|
|
17592
|
+
}
|
|
17593
|
+
return this.tiles.find(
|
|
17594
|
+
(tile) => tile.faceMesh === hit.object || tile.badgeMesh === hit.object
|
|
17595
|
+
) ?? null;
|
|
17365
17596
|
}
|
|
17366
17597
|
dispose() {
|
|
17367
17598
|
this.disposed = true;
|
|
17368
|
-
if (this.
|
|
17369
|
-
cancelAnimationFrame(this.
|
|
17370
|
-
this.
|
|
17599
|
+
if (this.renderFrameHandle !== null) {
|
|
17600
|
+
cancelAnimationFrame(this.renderFrameHandle);
|
|
17601
|
+
this.renderFrameHandle = null;
|
|
17602
|
+
}
|
|
17603
|
+
if (this.springFrameHandle !== null) {
|
|
17604
|
+
cancelAnimationFrame(this.springFrameHandle);
|
|
17605
|
+
this.springFrameHandle = null;
|
|
17606
|
+
}
|
|
17607
|
+
if (this.recordSpinFrameHandle !== null) {
|
|
17608
|
+
cancelAnimationFrame(this.recordSpinFrameHandle);
|
|
17609
|
+
this.recordSpinFrameHandle = null;
|
|
17371
17610
|
}
|
|
17372
17611
|
for (const image of this.images) {
|
|
17373
17612
|
image.onload = null;
|
|
17613
|
+
image.onerror = null;
|
|
17374
17614
|
if (this.ownedImages.has(image)) {
|
|
17375
17615
|
image.src = "";
|
|
17376
17616
|
}
|
|
17377
17617
|
}
|
|
17378
17618
|
this.ownedImages.clear();
|
|
17379
17619
|
for (const tile of this.tiles) {
|
|
17380
|
-
tile.
|
|
17381
|
-
tile.
|
|
17382
|
-
tile.
|
|
17620
|
+
tile.badgeMesh.geometry.dispose();
|
|
17621
|
+
tile.badgeMesh.material.dispose();
|
|
17622
|
+
tile.faceMaterial.dispose();
|
|
17623
|
+
tile.edgeMaterial.dispose();
|
|
17624
|
+
}
|
|
17625
|
+
for (const texture of this.textures) {
|
|
17626
|
+
texture.dispose();
|
|
17383
17627
|
}
|
|
17628
|
+
this.textures.clear();
|
|
17629
|
+
this.faceGeometry.dispose();
|
|
17630
|
+
this.edgeGeometry.dispose();
|
|
17384
17631
|
this.renderer.dispose();
|
|
17385
17632
|
}
|
|
17386
17633
|
prefersReducedMotion() {
|
|
@@ -17398,17 +17645,31 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17398
17645
|
this.onSettle(this.targetIndex());
|
|
17399
17646
|
return;
|
|
17400
17647
|
}
|
|
17401
|
-
if (this.
|
|
17648
|
+
if (this.springFrameHandle === null) {
|
|
17649
|
+
if (this.renderFrameHandle !== null) {
|
|
17650
|
+
cancelAnimationFrame(this.renderFrameHandle);
|
|
17651
|
+
this.renderFrameHandle = null;
|
|
17652
|
+
}
|
|
17402
17653
|
this.lastFrameAt = null;
|
|
17403
|
-
this.
|
|
17654
|
+
this.springFrameHandle = requestAnimationFrame(this.frame);
|
|
17655
|
+
}
|
|
17656
|
+
}
|
|
17657
|
+
primeSpringMotion() {
|
|
17658
|
+
const delta = this.target - this.scroll;
|
|
17659
|
+
const direction = Math.sign(delta);
|
|
17660
|
+
if (direction === 0) {
|
|
17661
|
+
return;
|
|
17662
|
+
}
|
|
17663
|
+
if (this.velocity * direction < SPRING_MIN_LAUNCH_VELOCITY) {
|
|
17664
|
+
this.velocity = direction * SPRING_MIN_LAUNCH_VELOCITY;
|
|
17404
17665
|
}
|
|
17405
17666
|
}
|
|
17406
17667
|
frame = (now) => {
|
|
17407
|
-
this.
|
|
17668
|
+
this.springFrameHandle = null;
|
|
17408
17669
|
if (this.disposed) {
|
|
17409
17670
|
return;
|
|
17410
17671
|
}
|
|
17411
|
-
const dt = this.lastFrameAt === null ? 1 / 60 : Math.min((now - this.lastFrameAt) / 1e3,
|
|
17672
|
+
const dt = this.lastFrameAt === null ? 1 / 60 : Math.min((now - this.lastFrameAt) / 1e3, MAX_FRAME_DELTA_SECONDS);
|
|
17412
17673
|
this.lastFrameAt = now;
|
|
17413
17674
|
const delta = this.target - this.scroll;
|
|
17414
17675
|
if (Math.abs(delta) <= SPRING_SETTLE_EPSILON && Math.abs(this.velocity) <= SPRING_SETTLE_VELOCITY) {
|
|
@@ -17424,14 +17685,54 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17424
17685
|
this.scroll += this.velocity * dt;
|
|
17425
17686
|
this.applyPoses();
|
|
17426
17687
|
this.renderer.render(this.scene, this.camera);
|
|
17427
|
-
this.
|
|
17688
|
+
this.springFrameHandle = requestAnimationFrame(this.frame);
|
|
17689
|
+
};
|
|
17690
|
+
startRecordSpin() {
|
|
17691
|
+
if (this.disposed || this.prefersReducedMotion() || this.recordSpinFrameHandle !== null) {
|
|
17692
|
+
return;
|
|
17693
|
+
}
|
|
17694
|
+
this.lastRecordSpinFrameAt = null;
|
|
17695
|
+
this.recordSpinFrameHandle = requestAnimationFrame(this.recordSpinFrame);
|
|
17696
|
+
}
|
|
17697
|
+
recordSpinFrame = (now) => {
|
|
17698
|
+
this.recordSpinFrameHandle = null;
|
|
17699
|
+
const spinningTile = this.hoveredTile ?? this.centerTile();
|
|
17700
|
+
if (this.disposed || !spinningTile || this.prefersReducedMotion()) {
|
|
17701
|
+
return;
|
|
17702
|
+
}
|
|
17703
|
+
const dt = this.lastRecordSpinFrameAt === null ? 1 / 60 : Math.min(
|
|
17704
|
+
(now - this.lastRecordSpinFrameAt) / 1e3,
|
|
17705
|
+
MAX_FRAME_DELTA_SECONDS
|
|
17706
|
+
);
|
|
17707
|
+
this.lastRecordSpinFrameAt = now;
|
|
17708
|
+
spinningTile.rotation = (spinningTile.rotation + Math.PI * 2 * dt / RECORD_SPIN_SECONDS) % (Math.PI * 2);
|
|
17709
|
+
if (this.springFrameHandle === null) {
|
|
17710
|
+
this.applyPoses();
|
|
17711
|
+
this.renderer.render(this.scene, this.camera);
|
|
17712
|
+
}
|
|
17713
|
+
this.recordSpinFrameHandle = requestAnimationFrame(this.recordSpinFrame);
|
|
17428
17714
|
};
|
|
17715
|
+
centerTile() {
|
|
17716
|
+
let centeredTile = null;
|
|
17717
|
+
let centeredOffset = Number.POSITIVE_INFINITY;
|
|
17718
|
+
this.tiles.forEach((tile, index) => {
|
|
17719
|
+
if (!tile.ready) {
|
|
17720
|
+
return;
|
|
17721
|
+
}
|
|
17722
|
+
const offset = Math.abs(ringOffset(index, this.scroll, this.tileCount));
|
|
17723
|
+
if (offset < centeredOffset) {
|
|
17724
|
+
centeredTile = tile;
|
|
17725
|
+
centeredOffset = offset;
|
|
17726
|
+
}
|
|
17727
|
+
});
|
|
17728
|
+
return centeredTile;
|
|
17729
|
+
}
|
|
17429
17730
|
requestRender() {
|
|
17430
|
-
if (this.disposed || this.
|
|
17731
|
+
if (this.disposed || this.renderFrameHandle !== null || this.springFrameHandle !== null) {
|
|
17431
17732
|
return;
|
|
17432
17733
|
}
|
|
17433
|
-
this.
|
|
17434
|
-
this.
|
|
17734
|
+
this.renderFrameHandle = requestAnimationFrame(() => {
|
|
17735
|
+
this.renderFrameHandle = null;
|
|
17435
17736
|
if (!this.disposed) {
|
|
17436
17737
|
this.renderer.render(this.scene, this.camera);
|
|
17437
17738
|
}
|
|
@@ -17441,26 +17742,124 @@ var AgentGuiHeroCarouselScene = class _AgentGuiHeroCarouselScene {
|
|
|
17441
17742
|
if (this.disposed) {
|
|
17442
17743
|
return;
|
|
17443
17744
|
}
|
|
17444
|
-
const texture =
|
|
17745
|
+
const texture = vinylRecordTexture(image, () => this.requestRender());
|
|
17746
|
+
this.textures.add(texture);
|
|
17445
17747
|
for (const tile of this.tiles) {
|
|
17446
|
-
if (tile.
|
|
17447
|
-
tile.
|
|
17448
|
-
tile.
|
|
17449
|
-
tile.
|
|
17748
|
+
if (tile.poseGroup.userData.agentIndex === agentIndex) {
|
|
17749
|
+
tile.faceMaterial.map = texture;
|
|
17750
|
+
tile.faceMaterial.visible = true;
|
|
17751
|
+
tile.faceMaterial.needsUpdate = true;
|
|
17752
|
+
tile.ready = true;
|
|
17450
17753
|
}
|
|
17451
17754
|
}
|
|
17755
|
+
this.applyPoses();
|
|
17756
|
+
this.startRecordSpin();
|
|
17757
|
+
}
|
|
17758
|
+
loadBadgeImage(badgeUrl, agentIndex) {
|
|
17759
|
+
const image = new Image();
|
|
17760
|
+
image.crossOrigin = "anonymous";
|
|
17761
|
+
image.decoding = "async";
|
|
17762
|
+
image.loading = "eager";
|
|
17763
|
+
this.ownedImages.add(image);
|
|
17764
|
+
this.images.push(image);
|
|
17765
|
+
let settled = false;
|
|
17766
|
+
const keepFallback = () => {
|
|
17767
|
+
if (settled) {
|
|
17768
|
+
return;
|
|
17769
|
+
}
|
|
17770
|
+
settled = true;
|
|
17771
|
+
this.requestRender();
|
|
17772
|
+
};
|
|
17773
|
+
const applyDecodedImage = () => {
|
|
17774
|
+
if (settled) {
|
|
17775
|
+
return;
|
|
17776
|
+
}
|
|
17777
|
+
settled = true;
|
|
17778
|
+
this.applyBadgeImageTexture(image, agentIndex);
|
|
17779
|
+
};
|
|
17780
|
+
image.onload = () => {
|
|
17781
|
+
if (this.disposed) {
|
|
17782
|
+
return;
|
|
17783
|
+
}
|
|
17784
|
+
let decode;
|
|
17785
|
+
try {
|
|
17786
|
+
decode = image.decode?.();
|
|
17787
|
+
} catch {
|
|
17788
|
+
keepFallback();
|
|
17789
|
+
return;
|
|
17790
|
+
}
|
|
17791
|
+
if (decode) {
|
|
17792
|
+
void decode.then(applyDecodedImage).catch(keepFallback);
|
|
17793
|
+
return;
|
|
17794
|
+
}
|
|
17795
|
+
applyDecodedImage();
|
|
17796
|
+
};
|
|
17797
|
+
image.onerror = keepFallback;
|
|
17798
|
+
image.src = badgeUrl;
|
|
17799
|
+
}
|
|
17800
|
+
applyBadgeImageTexture(image, agentIndex) {
|
|
17801
|
+
if (this.disposed) {
|
|
17802
|
+
return;
|
|
17803
|
+
}
|
|
17804
|
+
let texture = null;
|
|
17805
|
+
try {
|
|
17806
|
+
texture = roundedIconTexture(
|
|
17807
|
+
image,
|
|
17808
|
+
() => this.requestRender(),
|
|
17809
|
+
BADGE_CORNER_RADIUS
|
|
17810
|
+
);
|
|
17811
|
+
this.renderer.initTexture(texture);
|
|
17812
|
+
} catch {
|
|
17813
|
+
texture?.dispose();
|
|
17814
|
+
this.requestRender();
|
|
17815
|
+
return;
|
|
17816
|
+
}
|
|
17817
|
+
this.textures.add(texture);
|
|
17818
|
+
for (const tile of this.tiles) {
|
|
17819
|
+
if (tile.poseGroup.userData.agentIndex === agentIndex) {
|
|
17820
|
+
tile.badgeMesh.material.map = texture;
|
|
17821
|
+
tile.badgeMesh.material.visible = true;
|
|
17822
|
+
tile.badgeMesh.material.needsUpdate = true;
|
|
17823
|
+
}
|
|
17824
|
+
}
|
|
17825
|
+
this.requestRender();
|
|
17452
17826
|
}
|
|
17453
17827
|
applyPoses() {
|
|
17454
17828
|
const step = Math.PI * 2 / Math.max(this.tileCount, 1);
|
|
17455
17829
|
this.tiles.forEach((tile, index) => {
|
|
17456
17830
|
const offset = ringOffset(index, this.scroll, this.tileCount);
|
|
17831
|
+
const visible = tile.ready && Math.abs(offset) <= RECORD_RENDER_RANGE_SLOTS;
|
|
17832
|
+
tile.poseGroup.visible = visible;
|
|
17833
|
+
if (!visible) {
|
|
17834
|
+
return;
|
|
17835
|
+
}
|
|
17457
17836
|
const angle = offset * step;
|
|
17458
17837
|
const x = this.wheelRadius * Math.sin(angle);
|
|
17459
|
-
const y = this.wheelRadius * (Math.cos(angle) - 1);
|
|
17460
|
-
tile.
|
|
17461
|
-
|
|
17462
|
-
|
|
17463
|
-
|
|
17838
|
+
const y = this.wheelRadius * (Math.cos(angle) - 1) * VISIBLE_ARC_CURVATURE;
|
|
17839
|
+
tile.poseGroup.position.set(x, y, 0);
|
|
17840
|
+
const fadeProgress = THREE.MathUtils.clamp(
|
|
17841
|
+
1 - Math.abs(offset) / RECORD_FADE_RANGE_SLOTS,
|
|
17842
|
+
0,
|
|
17843
|
+
1
|
|
17844
|
+
);
|
|
17845
|
+
const rangeOpacity = Math.pow(
|
|
17846
|
+
THREE.MathUtils.smoothstep(fadeProgress, 0, 1),
|
|
17847
|
+
RECORD_FADE_CURVE
|
|
17848
|
+
);
|
|
17849
|
+
tile.poseGroup.rotation.set(
|
|
17850
|
+
RECORD_MODEL_TILT_X,
|
|
17851
|
+
THREE.MathUtils.clamp(
|
|
17852
|
+
-angle * RECORD_MODEL_SIDE_TILT_FACTOR,
|
|
17853
|
+
-RECORD_MODEL_MAX_SIDE_TILT,
|
|
17854
|
+
RECORD_MODEL_MAX_SIDE_TILT
|
|
17855
|
+
),
|
|
17856
|
+
-angle * VISIBLE_ARC_CURVATURE
|
|
17857
|
+
);
|
|
17858
|
+
tile.recordGroup.rotation.z = -tile.rotation;
|
|
17859
|
+
const opacity = MIN_RECORD_OPACITY + (1 - MIN_RECORD_OPACITY) * rangeOpacity;
|
|
17860
|
+
tile.faceMaterial.opacity = opacity;
|
|
17861
|
+
tile.edgeMaterial.opacity = opacity;
|
|
17862
|
+
tile.badgeMesh.material.opacity = opacity;
|
|
17464
17863
|
});
|
|
17465
17864
|
}
|
|
17466
17865
|
};
|
|
@@ -17473,31 +17872,31 @@ var CAROUSEL_DRAG_STEP_PX = 52;
|
|
|
17473
17872
|
function emptyPreloadedCarouselImages(length) {
|
|
17474
17873
|
return Array.from({ length }).map(() => null);
|
|
17475
17874
|
}
|
|
17476
|
-
function useAgentGUIHeroCarouselImages(
|
|
17875
|
+
function useAgentGUIHeroCarouselImages(items, iconKey) {
|
|
17477
17876
|
const [preloadState, setPreloadState] = useState7({
|
|
17478
17877
|
images: [],
|
|
17479
|
-
ready:
|
|
17878
|
+
ready: items.length === 0
|
|
17480
17879
|
});
|
|
17481
17880
|
useEffect6(() => {
|
|
17482
|
-
if (
|
|
17881
|
+
if (items.length === 0) {
|
|
17483
17882
|
setPreloadState({ images: [], ready: true });
|
|
17484
17883
|
return;
|
|
17485
17884
|
}
|
|
17486
17885
|
if (typeof Image !== "function") {
|
|
17487
17886
|
setPreloadState({
|
|
17488
|
-
images: emptyPreloadedCarouselImages(
|
|
17887
|
+
images: emptyPreloadedCarouselImages(items.length),
|
|
17489
17888
|
ready: true
|
|
17490
17889
|
});
|
|
17491
17890
|
return;
|
|
17492
17891
|
}
|
|
17493
17892
|
let cancelled = false;
|
|
17494
17893
|
setPreloadState({
|
|
17495
|
-
images: emptyPreloadedCarouselImages(
|
|
17894
|
+
images: emptyPreloadedCarouselImages(items.length),
|
|
17496
17895
|
ready: false
|
|
17497
17896
|
});
|
|
17498
17897
|
void Promise.all(
|
|
17499
|
-
|
|
17500
|
-
(
|
|
17898
|
+
items.map(
|
|
17899
|
+
(item) => new Promise((resolve) => {
|
|
17501
17900
|
const image = new Image();
|
|
17502
17901
|
const resolveDecoded = () => {
|
|
17503
17902
|
const decode = image.decode?.();
|
|
@@ -17514,7 +17913,7 @@ function useAgentGUIHeroCarouselImages(icons, iconKey) {
|
|
|
17514
17913
|
resolveDecoded();
|
|
17515
17914
|
};
|
|
17516
17915
|
image.onerror = () => resolve(null);
|
|
17517
|
-
image.src =
|
|
17916
|
+
image.src = item.iconUrl;
|
|
17518
17917
|
if (image.complete) {
|
|
17519
17918
|
if (image.naturalWidth > 0) {
|
|
17520
17919
|
resolveDecoded();
|
|
@@ -17538,16 +17937,15 @@ function useAgentGUIHeroCarouselImages(icons, iconKey) {
|
|
|
17538
17937
|
var AgentGUIHeroAgentCarousel = memo2(
|
|
17539
17938
|
function AgentGUIHeroAgentCarousel2({
|
|
17540
17939
|
activeAgentTargetId,
|
|
17541
|
-
|
|
17542
|
-
providerTargets,
|
|
17940
|
+
items,
|
|
17543
17941
|
onProviderSelect,
|
|
17544
17942
|
providerSelectLabel
|
|
17545
17943
|
}) {
|
|
17546
17944
|
const activeIconIndex = useMemo4(
|
|
17547
|
-
() => !activeAgentTargetId ? -1 :
|
|
17548
|
-
(
|
|
17945
|
+
() => !activeAgentTargetId ? -1 : items.findIndex(
|
|
17946
|
+
(item) => item.agentTargetId === activeAgentTargetId
|
|
17549
17947
|
),
|
|
17550
|
-
[activeAgentTargetId,
|
|
17948
|
+
[activeAgentTargetId, items]
|
|
17551
17949
|
);
|
|
17552
17950
|
const [centerIndex, setCenterIndex] = useState7(
|
|
17553
17951
|
activeIconIndex >= 0 ? activeIconIndex : 0
|
|
@@ -17556,42 +17954,29 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17556
17954
|
centerIndexRef.current = centerIndex;
|
|
17557
17955
|
const activeIconIndexRef = useRef5(activeIconIndex);
|
|
17558
17956
|
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
|
-
);
|
|
17957
|
+
const interactive = onProviderSelect != null && items.length > 0;
|
|
17575
17958
|
const selectIndex = useCallback5(
|
|
17576
17959
|
(index) => {
|
|
17577
|
-
const
|
|
17578
|
-
if (!
|
|
17960
|
+
const item = items[index];
|
|
17961
|
+
if (!item || !onProviderSelect) {
|
|
17579
17962
|
return;
|
|
17580
17963
|
}
|
|
17581
17964
|
onProviderSelect({
|
|
17582
|
-
provider:
|
|
17583
|
-
agentTargetId:
|
|
17965
|
+
provider: item.provider,
|
|
17966
|
+
agentTargetId: item.targetId
|
|
17584
17967
|
});
|
|
17585
17968
|
},
|
|
17586
|
-
[
|
|
17969
|
+
[items, onProviderSelect]
|
|
17587
17970
|
);
|
|
17588
17971
|
const selectIndexRef = useRef5(selectIndex);
|
|
17589
17972
|
selectIndexRef.current = selectIndex;
|
|
17590
17973
|
const stageRef = useRef5(null);
|
|
17591
17974
|
const canvasRef = useRef5(null);
|
|
17592
17975
|
const sceneRef = useRef5(null);
|
|
17593
|
-
const iconKey =
|
|
17594
|
-
|
|
17976
|
+
const iconKey = items.map(
|
|
17977
|
+
(item) => `${item.agentTargetId}:${item.iconUrl}:${item.badge?.iconUrl ?? ""}`
|
|
17978
|
+
).join("|");
|
|
17979
|
+
const carouselImages = useAgentGUIHeroCarouselImages(items, iconKey);
|
|
17595
17980
|
useEffect6(() => {
|
|
17596
17981
|
const canvas = canvasRef.current;
|
|
17597
17982
|
const stage = stageRef.current;
|
|
@@ -17600,7 +17985,7 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17600
17985
|
}
|
|
17601
17986
|
const scene = AgentGuiHeroCarouselScene.create({
|
|
17602
17987
|
canvas,
|
|
17603
|
-
|
|
17988
|
+
items,
|
|
17604
17989
|
loadedImages: carouselImages.images,
|
|
17605
17990
|
onSettle: (index) => {
|
|
17606
17991
|
centerIndexRef.current = index;
|
|
@@ -17638,14 +18023,14 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17638
18023
|
const stepBy = useCallback5(
|
|
17639
18024
|
(direction) => {
|
|
17640
18025
|
const scene = sceneRef.current;
|
|
17641
|
-
if (!scene ||
|
|
18026
|
+
if (!scene || items.length <= 1) {
|
|
17642
18027
|
return;
|
|
17643
18028
|
}
|
|
17644
18029
|
const next = scene.stepBy(direction);
|
|
17645
18030
|
centerIndexRef.current = next;
|
|
17646
18031
|
setCenterIndex(next);
|
|
17647
18032
|
},
|
|
17648
|
-
[
|
|
18033
|
+
[items.length]
|
|
17649
18034
|
);
|
|
17650
18035
|
const stepByRef = useRef5(stepBy);
|
|
17651
18036
|
stepByRef.current = stepBy;
|
|
@@ -17681,6 +18066,7 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17681
18066
|
null
|
|
17682
18067
|
);
|
|
17683
18068
|
const suppressClickRef = useRef5(false);
|
|
18069
|
+
const pointerActivatedIndexRef = useRef5(null);
|
|
17684
18070
|
const handlePointerDown = (event) => {
|
|
17685
18071
|
if (!interactive || event.button !== 0) {
|
|
17686
18072
|
return;
|
|
@@ -17702,6 +18088,7 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17702
18088
|
}
|
|
17703
18089
|
drag.anchorX = event.clientX;
|
|
17704
18090
|
suppressClickRef.current = true;
|
|
18091
|
+
pointerActivatedIndexRef.current = null;
|
|
17705
18092
|
stepBy(deltaX < 0 ? 1 : -1);
|
|
17706
18093
|
};
|
|
17707
18094
|
const handlePointerEnd = (event) => {
|
|
@@ -17714,6 +18101,7 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17714
18101
|
return;
|
|
17715
18102
|
}
|
|
17716
18103
|
suppressClickRef.current = false;
|
|
18104
|
+
pointerActivatedIndexRef.current = null;
|
|
17717
18105
|
event.preventDefault();
|
|
17718
18106
|
event.stopPropagation();
|
|
17719
18107
|
};
|
|
@@ -17744,18 +18132,53 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17744
18132
|
rect.height
|
|
17745
18133
|
);
|
|
17746
18134
|
};
|
|
18135
|
+
const activateOnPointerDown = (index, event) => {
|
|
18136
|
+
if (event.button !== 0) {
|
|
18137
|
+
return;
|
|
18138
|
+
}
|
|
18139
|
+
pointerActivatedIndexRef.current = index;
|
|
18140
|
+
handleItemClick(index);
|
|
18141
|
+
};
|
|
18142
|
+
const activateOnClick = (index) => {
|
|
18143
|
+
if (pointerActivatedIndexRef.current === index) {
|
|
18144
|
+
pointerActivatedIndexRef.current = null;
|
|
18145
|
+
return;
|
|
18146
|
+
}
|
|
18147
|
+
pointerActivatedIndexRef.current = null;
|
|
18148
|
+
handleItemClick(index);
|
|
18149
|
+
};
|
|
18150
|
+
const handleCanvasPointerDown = (event) => {
|
|
18151
|
+
const index = pickAt(event);
|
|
18152
|
+
if (index !== null) {
|
|
18153
|
+
activateOnPointerDown(index, event);
|
|
18154
|
+
}
|
|
18155
|
+
};
|
|
17747
18156
|
const handleCanvasClick = (event) => {
|
|
17748
18157
|
const index = pickAt(event);
|
|
17749
18158
|
if (index !== null) {
|
|
17750
|
-
|
|
18159
|
+
activateOnClick(index);
|
|
17751
18160
|
}
|
|
17752
18161
|
};
|
|
17753
18162
|
const handleCanvasHover = (event) => {
|
|
18163
|
+
const scene = sceneRef.current;
|
|
17754
18164
|
const canvas = canvasRef.current;
|
|
17755
|
-
if (!canvas) {
|
|
18165
|
+
if (!scene || !canvas) {
|
|
17756
18166
|
return;
|
|
17757
18167
|
}
|
|
17758
|
-
|
|
18168
|
+
const rect = canvas.getBoundingClientRect();
|
|
18169
|
+
const hoveredIndex = scene.hover(
|
|
18170
|
+
event.clientX - rect.left,
|
|
18171
|
+
event.clientY - rect.top,
|
|
18172
|
+
rect.width,
|
|
18173
|
+
rect.height
|
|
18174
|
+
);
|
|
18175
|
+
canvas.style.cursor = hoveredIndex !== null ? "pointer" : "";
|
|
18176
|
+
};
|
|
18177
|
+
const handleCanvasLeave = () => {
|
|
18178
|
+
sceneRef.current?.clearHover();
|
|
18179
|
+
if (canvasRef.current) {
|
|
18180
|
+
canvasRef.current.style.cursor = "";
|
|
18181
|
+
}
|
|
17759
18182
|
};
|
|
17760
18183
|
return /* @__PURE__ */ jsxs9(
|
|
17761
18184
|
"div",
|
|
@@ -17780,28 +18203,31 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17780
18203
|
"aria-hidden": "true",
|
|
17781
18204
|
className: AgentGUINode_styles_default.emptyHeroCarouselCanvas,
|
|
17782
18205
|
onClick: interactive ? handleCanvasClick : void 0,
|
|
17783
|
-
|
|
18206
|
+
onPointerDown: interactive ? handleCanvasPointerDown : void 0,
|
|
18207
|
+
onPointerMove: interactive ? handleCanvasHover : void 0,
|
|
18208
|
+
onPointerLeave: interactive ? handleCanvasLeave : void 0
|
|
17784
18209
|
}
|
|
17785
18210
|
),
|
|
17786
|
-
|
|
18211
|
+
items.map((item, index) => {
|
|
17787
18212
|
const isCenter = index === centerIndex;
|
|
17788
|
-
const
|
|
17789
|
-
|
|
17790
|
-
|
|
17791
|
-
const label = providerSelectLabel ? `${providerSelectLabel}: ${
|
|
18213
|
+
const key = `${item.agentTargetId}:${item.iconUrl}`;
|
|
18214
|
+
if (onProviderSelect) {
|
|
18215
|
+
const itemLabel = item.badge?.label ? `${item.label}, ${item.badge.label}` : item.label;
|
|
18216
|
+
const label = providerSelectLabel ? `${providerSelectLabel}: ${itemLabel}` : itemLabel;
|
|
17792
18217
|
return /* @__PURE__ */ jsx20(
|
|
17793
18218
|
"button",
|
|
17794
18219
|
{
|
|
17795
18220
|
type: "button",
|
|
17796
18221
|
className: AgentGUINode_styles_default.emptyHeroCarouselItem,
|
|
17797
|
-
"data-agent-target-id":
|
|
17798
|
-
"data-provider":
|
|
18222
|
+
"data-agent-target-id": item.agentTargetId,
|
|
18223
|
+
"data-provider": item.provider,
|
|
17799
18224
|
"data-provider-active": isCenter,
|
|
17800
18225
|
"aria-label": label,
|
|
17801
18226
|
"aria-pressed": isCenter,
|
|
17802
|
-
title:
|
|
17803
|
-
|
|
17804
|
-
|
|
18227
|
+
title: item.label,
|
|
18228
|
+
onPointerDown: (event) => activateOnPointerDown(index, event),
|
|
18229
|
+
onClick: () => activateOnClick(index),
|
|
18230
|
+
children: item.label
|
|
17805
18231
|
},
|
|
17806
18232
|
key
|
|
17807
18233
|
);
|
|
@@ -17810,7 +18236,7 @@ var AgentGUIHeroAgentCarousel = memo2(
|
|
|
17810
18236
|
"span",
|
|
17811
18237
|
{
|
|
17812
18238
|
className: AgentGUINode_styles_default.emptyHeroCarouselItem,
|
|
17813
|
-
"data-provider":
|
|
18239
|
+
"data-provider": item.provider,
|
|
17814
18240
|
"data-provider-active": isCenter
|
|
17815
18241
|
},
|
|
17816
18242
|
key
|
|
@@ -23050,7 +23476,7 @@ var MENTION_PALETTE_DISMISS_INTERACTION_SELECTOR = [
|
|
|
23050
23476
|
function resolveComposerProviderIconUrl(provider) {
|
|
23051
23477
|
return MANAGED_AGENT_ICON_URLS[normalizeManagedAgentProvider(provider)] ?? MANAGED_AGENT_ICON_FALLBACK_URL;
|
|
23052
23478
|
}
|
|
23053
|
-
function
|
|
23479
|
+
function resolveComposerAgentTargetIconUrl(target) {
|
|
23054
23480
|
if (normalizeManagedAgentProvider(target.provider) === "cursor") {
|
|
23055
23481
|
return cursorColorfulUrl;
|
|
23056
23482
|
}
|
|
@@ -23230,9 +23656,9 @@ function AgentComposer({
|
|
|
23230
23656
|
queuedPrompts,
|
|
23231
23657
|
drainingQueuedPromptId,
|
|
23232
23658
|
workspaceAppIcons = EMPTY_WORKSPACE_APP_ICONS2,
|
|
23233
|
-
|
|
23234
|
-
|
|
23235
|
-
|
|
23659
|
+
selectedAgentTarget = null,
|
|
23660
|
+
agentTargets = [],
|
|
23661
|
+
handoffAgentTargets,
|
|
23236
23662
|
providerSelectReadonly = false,
|
|
23237
23663
|
onProviderSelect,
|
|
23238
23664
|
onHandoffConversation,
|
|
@@ -24719,35 +25145,35 @@ ${normalizedText}` : normalizedText;
|
|
|
24719
25145
|
const isHeroLayout = layoutMode === "hero";
|
|
24720
25146
|
const composerClassName = isHeroLayout ? AgentGUINode_styles_default.composerHero : AgentGUINode_styles_default.composer;
|
|
24721
25147
|
const providerSwitchTargets = useMemo10(
|
|
24722
|
-
() =>
|
|
24723
|
-
[
|
|
25148
|
+
() => agentTargets.filter(Boolean),
|
|
25149
|
+
[agentTargets]
|
|
24724
25150
|
);
|
|
24725
25151
|
const enabledProviderSwitchTargets = useMemo10(
|
|
24726
25152
|
() => providerSwitchTargets.filter((target) => target.disabled !== true),
|
|
24727
25153
|
[providerSwitchTargets]
|
|
24728
25154
|
);
|
|
24729
|
-
const selectedAgentTargetId =
|
|
25155
|
+
const selectedAgentTargetId = selectedAgentTarget?.targetId ?? `local:${provider}`;
|
|
24730
25156
|
const selectedProviderSwitchTarget = providerSwitchTargets.find(
|
|
24731
25157
|
(target) => target.targetId === selectedAgentTargetId
|
|
24732
|
-
) ?? providerSwitchTargets.find((target) => target.provider === provider) ??
|
|
25158
|
+
) ?? providerSwitchTargets.find((target) => target.provider === provider) ?? selectedAgentTarget;
|
|
24733
25159
|
const providerMenuTargets = selectedProviderSwitchTarget && !enabledProviderSwitchTargets.some(
|
|
24734
25160
|
(target) => target.targetId === selectedProviderSwitchTarget.targetId
|
|
24735
25161
|
) ? [selectedProviderSwitchTarget, ...enabledProviderSwitchTargets] : enabledProviderSwitchTargets;
|
|
24736
|
-
const
|
|
24737
|
-
() => (
|
|
25162
|
+
const enabledHandoffAgentTargets = useMemo10(
|
|
25163
|
+
() => (handoffAgentTargets ?? providerMenuTargets).filter(
|
|
24738
25164
|
(target) => target.disabled !== true
|
|
24739
25165
|
),
|
|
24740
|
-
[
|
|
25166
|
+
[handoffAgentTargets, providerMenuTargets]
|
|
24741
25167
|
);
|
|
24742
|
-
const handoffMenuTargets = selectedProviderSwitchTarget ?
|
|
25168
|
+
const handoffMenuTargets = selectedProviderSwitchTarget ? enabledHandoffAgentTargets.filter((target) => {
|
|
24743
25169
|
if (target.targetId === selectedProviderSwitchTarget.targetId) {
|
|
24744
25170
|
return false;
|
|
24745
25171
|
}
|
|
24746
25172
|
const selectedAgentTargetId2 = selectedProviderSwitchTarget.agentTargetId ?? selectedProviderSwitchTarget.targetId;
|
|
24747
25173
|
const targetAgentTargetId = target.agentTargetId ?? target.targetId;
|
|
24748
25174
|
return targetAgentTargetId !== selectedAgentTargetId2;
|
|
24749
|
-
}) :
|
|
24750
|
-
const selectedProviderLabel = selectedProviderSwitchTarget?.label ??
|
|
25175
|
+
}) : enabledHandoffAgentTargets;
|
|
25176
|
+
const selectedProviderLabel = selectedProviderSwitchTarget?.label ?? selectedAgentTarget?.label ?? provider;
|
|
24751
25177
|
const effectiveHandoffLabel = handoffLabel || labels.handoffConversation;
|
|
24752
25178
|
const effectiveHandoffMenuLabel = handoffMenuLabel || labels.handoffConversationMenu;
|
|
24753
25179
|
const inputShellClassName = cn(
|
|
@@ -25977,9 +26403,7 @@ ${normalizedText}` : normalizedText;
|
|
|
25977
26403
|
alt: "",
|
|
25978
26404
|
"aria-hidden": "true",
|
|
25979
26405
|
className: "size-4 shrink-0 rounded-[4px]",
|
|
25980
|
-
src:
|
|
25981
|
-
target
|
|
25982
|
-
)
|
|
26406
|
+
src: resolveComposerAgentTargetIconUrl(target)
|
|
25983
26407
|
}
|
|
25984
26408
|
),
|
|
25985
26409
|
/* @__PURE__ */ jsx32("span", { className: "min-w-0 truncate", children: target.label })
|
|
@@ -26029,7 +26453,7 @@ ${normalizedText}` : normalizedText;
|
|
|
26029
26453
|
alt: "",
|
|
26030
26454
|
"aria-hidden": "true",
|
|
26031
26455
|
className: "size-4 shrink-0 rounded-[4px]",
|
|
26032
|
-
src:
|
|
26456
|
+
src: resolveComposerAgentTargetIconUrl(
|
|
26033
26457
|
selectedProviderSwitchTarget
|
|
26034
26458
|
)
|
|
26035
26459
|
}
|
|
@@ -26056,7 +26480,7 @@ ${normalizedText}` : normalizedText;
|
|
|
26056
26480
|
alt: "",
|
|
26057
26481
|
"aria-hidden": "true",
|
|
26058
26482
|
className: "size-4 shrink-0 rounded-[4px]",
|
|
26059
|
-
src:
|
|
26483
|
+
src: resolveComposerAgentTargetIconUrl(target)
|
|
26060
26484
|
}
|
|
26061
26485
|
),
|
|
26062
26486
|
/* @__PURE__ */ jsx32("span", { className: "min-w-0 truncate", children: target.label })
|
|
@@ -26916,26 +27340,6 @@ function setBooleanStateIfChanged(stateRef, setState, nextState) {
|
|
|
26916
27340
|
stateRef.current = nextState;
|
|
26917
27341
|
setState(nextState);
|
|
26918
27342
|
}
|
|
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
27343
|
function shouldEmphasizeEmptyHeroProvider(label) {
|
|
26940
27344
|
return label.trim().length > 0;
|
|
26941
27345
|
}
|
|
@@ -27139,7 +27543,7 @@ function buildAgentConversationHandoffPrompt(input) {
|
|
|
27139
27543
|
if (!conversation) {
|
|
27140
27544
|
return "";
|
|
27141
27545
|
}
|
|
27142
|
-
const sourceAgentLabel = input.
|
|
27546
|
+
const sourceAgentLabel = input.selectedAgentTarget?.label?.trim() || conversation.provider;
|
|
27143
27547
|
const title = conversationPlainTitle(
|
|
27144
27548
|
conversation,
|
|
27145
27549
|
input.labels,
|
|
@@ -27348,7 +27752,7 @@ function AgentGUINodeView({
|
|
|
27348
27752
|
[viewModel.data.provider, viewModel.openclawGateway]
|
|
27349
27753
|
);
|
|
27350
27754
|
const isOpenclawGatewayBlocking = openclawGateway !== null && openclawGateway.status !== "ready";
|
|
27351
|
-
const createConversationDisabled = viewModel.isCreatingConversation || viewModel.
|
|
27755
|
+
const createConversationDisabled = viewModel.isCreatingConversation || viewModel.selectedAgentTarget.disabled === true || isOpenclawGatewayBlocking;
|
|
27352
27756
|
const createConversationAction = useStableEventCallback2(
|
|
27353
27757
|
actions.createConversation
|
|
27354
27758
|
);
|
|
@@ -27562,7 +27966,7 @@ function AgentGUINodeView({
|
|
|
27562
27966
|
};
|
|
27563
27967
|
const effectiveRailConfigProvider = railConfigProvider === void 0 ? viewModel.data.provider : railConfigProvider;
|
|
27564
27968
|
const effectiveRailSlashStatusLimits = railSlashStatusLimits ?? slashStatusLimits;
|
|
27565
|
-
const shouldShowProviderRailConfigButton = viewModel.conversationFilter.kind === "all" || viewModel.
|
|
27969
|
+
const shouldShowProviderRailConfigButton = viewModel.conversationFilter.kind === "all" || viewModel.selectedAgentTarget?.disabled !== true;
|
|
27566
27970
|
const shouldShowProviderRailConfigMenu = shouldShowProviderRailConfigButton && viewModel.conversationFilter.kind !== "all";
|
|
27567
27971
|
const effectiveProviderAuthAccountLabel = useMemo11(() => {
|
|
27568
27972
|
const provider = (effectiveRailConfigProvider ?? viewModel.data.provider)?.trim() ?? "";
|
|
@@ -27576,10 +27980,10 @@ function AgentGUINodeView({
|
|
|
27576
27980
|
providerAuthAccountLabels,
|
|
27577
27981
|
viewModel.data.provider
|
|
27578
27982
|
]);
|
|
27579
|
-
const
|
|
27983
|
+
const enabledAgentTargets = viewModel.agentTargets.filter(
|
|
27580
27984
|
(target) => target.disabled !== true && ((target.agentTargetId?.trim() ?? "") || (target.targetId?.trim() ?? ""))
|
|
27581
27985
|
);
|
|
27582
|
-
const sectionAgentTargetFallbackId =
|
|
27986
|
+
const sectionAgentTargetFallbackId = enabledAgentTargets.length <= 1 ? viewModel.selectedAgentTarget.agentTargetId?.trim() || viewModel.selectedAgentTarget.targetId?.trim() || null : null;
|
|
27583
27987
|
const openAgentEnvSetup = useCallback11(() => {
|
|
27584
27988
|
openAgentEnvPanel({ provider: effectiveRailConfigProvider, focus: null });
|
|
27585
27989
|
}, [effectiveRailConfigProvider]);
|
|
@@ -27608,8 +28012,8 @@ function AgentGUINodeView({
|
|
|
27608
28012
|
createConversationDisabled,
|
|
27609
28013
|
openclawGateway,
|
|
27610
28014
|
isCollapsed: conversationRailCollapsed,
|
|
27611
|
-
|
|
27612
|
-
|
|
28015
|
+
agentTargets: viewModel.agentTargets,
|
|
28016
|
+
agentTargetsLoading: viewModel.agentTargetsLoading,
|
|
27613
28017
|
conversationFilter: viewModel.conversationFilter,
|
|
27614
28018
|
sectionAgentTargetFallbackId,
|
|
27615
28019
|
onCreateConversation: requestCreateConversation,
|
|
@@ -27662,8 +28066,8 @@ function AgentGUINodeView({
|
|
|
27662
28066
|
selectConversation,
|
|
27663
28067
|
selectProjectDirectory,
|
|
27664
28068
|
sectionAgentTargetFallbackId,
|
|
27665
|
-
viewModel.
|
|
27666
|
-
viewModel.
|
|
28069
|
+
viewModel.agentTargets,
|
|
28070
|
+
viewModel.agentTargetsLoading,
|
|
27667
28071
|
toggleConversationPinned,
|
|
27668
28072
|
uiLanguage,
|
|
27669
28073
|
viewModel.conversationFilter,
|
|
@@ -27691,7 +28095,7 @@ function AgentGUINodeView({
|
|
|
27691
28095
|
conversationRailStoreState
|
|
27692
28096
|
);
|
|
27693
28097
|
const agentTargetPresentations = useMemo11(
|
|
27694
|
-
() => viewModel.
|
|
28098
|
+
() => viewModel.agentTargets.flatMap(
|
|
27695
28099
|
(target) => target.agentTargetId ? [
|
|
27696
28100
|
{
|
|
27697
28101
|
agentTargetId: target.agentTargetId,
|
|
@@ -27702,7 +28106,7 @@ function AgentGUINodeView({
|
|
|
27702
28106
|
}
|
|
27703
28107
|
] : []
|
|
27704
28108
|
),
|
|
27705
|
-
[viewModel.
|
|
28109
|
+
[viewModel.agentTargets, viewModel.workspaceId]
|
|
27706
28110
|
);
|
|
27707
28111
|
const content = /* @__PURE__ */ jsxs22(AgentTargetPresentationProvider, { agentTargets: agentTargetPresentations, children: [
|
|
27708
28112
|
/* @__PURE__ */ jsxs22(
|
|
@@ -27730,9 +28134,9 @@ function AgentGUINodeView({
|
|
|
27730
28134
|
labels,
|
|
27731
28135
|
previewMode,
|
|
27732
28136
|
workspaceId: viewModel.workspaceId,
|
|
27733
|
-
|
|
27734
|
-
|
|
27735
|
-
|
|
28137
|
+
selectedAgentTarget: viewModel.selectedAgentTarget,
|
|
28138
|
+
agentTargets: viewModel.agentTargets,
|
|
28139
|
+
agentTargetsLoading: viewModel.agentTargetsLoading,
|
|
27736
28140
|
renderProviderRailEmpty,
|
|
27737
28141
|
providerRailAllPresentation,
|
|
27738
28142
|
onSelectConversationFilterTarget: actions.selectConversationFilterTarget,
|
|
@@ -28157,9 +28561,9 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
28157
28561
|
avoidGroupingEdits: viewModel.avoidGroupingEdits
|
|
28158
28562
|
});
|
|
28159
28563
|
const hasActiveConversation = viewModel.activeConversationId !== null;
|
|
28160
|
-
const agentsLoadedEmpty = !viewModel.
|
|
28161
|
-
const
|
|
28162
|
-
const emptyProviderReadinessGate = !hasActiveConversation ? viewModel.providerReadinessGate ?? (
|
|
28564
|
+
const agentsLoadedEmpty = !viewModel.agentTargetsLoading && viewModel.agentTargets.length === 0;
|
|
28565
|
+
const selectedAgentTargetComingSoon = viewModel.selectedAgentTarget?.disabled === true && (viewModel.providerReadinessGate === null || viewModel.providerReadinessGate?.status === "coming_soon");
|
|
28566
|
+
const emptyProviderReadinessGate = !hasActiveConversation ? viewModel.providerReadinessGate ?? (selectedAgentTargetComingSoon ? { status: "coming_soon" } : null) : null;
|
|
28163
28567
|
const activePrompt = viewModel.pendingInteractivePrompt ?? viewModel.pendingApproval;
|
|
28164
28568
|
const activePromptRequestId = activePrompt?.requestId ?? null;
|
|
28165
28569
|
const sessionChrome = useMemo11(
|
|
@@ -28718,16 +29122,16 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
28718
29122
|
[submitInteractivePrompt]
|
|
28719
29123
|
);
|
|
28720
29124
|
const canSwitchComposerProvider = true;
|
|
28721
|
-
const
|
|
28722
|
-
const
|
|
28723
|
-
const composerProvider = viewModel.activeConversationId === null ? viewModel.
|
|
28724
|
-
const
|
|
29125
|
+
const composerAgentTargets = viewModel.agentTargets;
|
|
29126
|
+
const composerHandoffAgentTargets = viewModel.handoffAgentTargets;
|
|
29127
|
+
const composerProvider = viewModel.activeConversationId === null ? viewModel.selectedAgentTarget?.provider ?? viewModel.data.provider : viewModel.data.provider;
|
|
29128
|
+
const composerSelectedAgentTarget = viewModel.activeConversationId === null ? viewModel.selectedAgentTarget : viewModel.agentTargets.find((target) => {
|
|
28725
29129
|
if (target.provider !== viewModel.data.provider) {
|
|
28726
29130
|
return false;
|
|
28727
29131
|
}
|
|
28728
29132
|
const agentTargetId = viewModel.data.agentTargetId;
|
|
28729
29133
|
return !agentTargetId || target.targetId === agentTargetId || target.agentTargetId === agentTargetId;
|
|
28730
|
-
}) ?? viewModel.
|
|
29134
|
+
}) ?? viewModel.selectedAgentTarget;
|
|
28731
29135
|
const bottomDockComposerProps = useMemo11(
|
|
28732
29136
|
() => ({
|
|
28733
29137
|
workspaceId: viewModel.workspaceId,
|
|
@@ -28742,9 +29146,9 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
28742
29146
|
hasCompactableContext: viewModel.hasSentUserMessage,
|
|
28743
29147
|
compactSupported: viewModel.compactSupported,
|
|
28744
29148
|
availableSkills: viewModel.availableSkills,
|
|
28745
|
-
|
|
28746
|
-
|
|
28747
|
-
|
|
29149
|
+
selectedAgentTarget: composerSelectedAgentTarget,
|
|
29150
|
+
agentTargets: composerAgentTargets,
|
|
29151
|
+
handoffAgentTargets: composerHandoffAgentTargets,
|
|
28748
29152
|
providerSelectReadonly: !canSwitchComposerProvider || viewModel.activeConversationId !== null,
|
|
28749
29153
|
onProviderSelect: canSwitchComposerProvider && viewModel.activeConversationId === null ? selectHomeComposerAgentTargetAndFocus : void 0,
|
|
28750
29154
|
disabled: composerDisabled,
|
|
@@ -28800,7 +29204,7 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
28800
29204
|
activeConversation: viewModel.activeConversation,
|
|
28801
29205
|
currentUserId: viewModel.currentUserId,
|
|
28802
29206
|
labels,
|
|
28803
|
-
|
|
29207
|
+
selectedAgentTarget: composerSelectedAgentTarget,
|
|
28804
29208
|
uiLanguage,
|
|
28805
29209
|
workspaceId: viewModel.workspaceId
|
|
28806
29210
|
}),
|
|
@@ -28823,10 +29227,10 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
28823
29227
|
composerDisabled,
|
|
28824
29228
|
composerDisabledReason,
|
|
28825
29229
|
composerFocusRequestSequence,
|
|
28826
|
-
|
|
29230
|
+
composerHandoffAgentTargets,
|
|
28827
29231
|
composerLabels,
|
|
28828
|
-
|
|
28829
|
-
|
|
29232
|
+
composerAgentTargets,
|
|
29233
|
+
composerSelectedAgentTarget,
|
|
28830
29234
|
handleInterruptCurrentTurn,
|
|
28831
29235
|
isActive,
|
|
28832
29236
|
isComposerSending,
|
|
@@ -28899,40 +29303,31 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
28899
29303
|
}),
|
|
28900
29304
|
[bottomDockComposerProps]
|
|
28901
29305
|
);
|
|
28902
|
-
const emptyHeroProvider = viewModel.
|
|
29306
|
+
const emptyHeroProvider = viewModel.selectedAgentTarget?.provider ?? viewModel.data.provider;
|
|
28903
29307
|
const emptyHeroRuntimeProviderLabel = labels.emptyProviderForProvider?.(emptyHeroProvider) ?? labels.emptyProvider ?? "";
|
|
28904
|
-
const emptyHeroProviderLabel = viewModel.
|
|
29308
|
+
const emptyHeroProviderLabel = viewModel.selectedAgentTarget?.label ?? emptyHeroRuntimeProviderLabel;
|
|
28905
29309
|
const emptyHeroBaseLabel = labels.emptyForProvider?.(emptyHeroProvider) ?? labels.empty;
|
|
28906
29310
|
const emptyHeroLabel = emptyHeroRuntimeProviderLabel ? emptyHeroBaseLabel.replace(
|
|
28907
29311
|
emptyHeroRuntimeProviderLabel,
|
|
28908
29312
|
emptyHeroProviderLabel
|
|
28909
29313
|
) : emptyHeroBaseLabel;
|
|
28910
|
-
const
|
|
28911
|
-
() => 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
|
-
}
|
|
29314
|
+
const emptyHeroAvatarPresentations = useMemo11(
|
|
29315
|
+
() => viewModel.agentTargets.length > 0 ? viewModel.agentTargets.map(projectAgentGUIAgentTargetAvatar) : viewModel.selectedAgentTarget ? [projectAgentGUIAgentTargetAvatar(viewModel.selectedAgentTarget)] : [
|
|
29316
|
+
createFallbackAgentGUIAgentAvatar({
|
|
29317
|
+
provider: emptyHeroProvider,
|
|
29318
|
+
label: emptyHeroProviderLabel,
|
|
29319
|
+
iconUrl: null
|
|
29320
|
+
})
|
|
28926
29321
|
],
|
|
28927
29322
|
[
|
|
28928
29323
|
emptyHeroProvider,
|
|
28929
|
-
|
|
28930
|
-
viewModel.
|
|
28931
|
-
viewModel.
|
|
29324
|
+
emptyHeroProviderLabel,
|
|
29325
|
+
viewModel.agentTargets,
|
|
29326
|
+
viewModel.selectedAgentTarget
|
|
28932
29327
|
]
|
|
28933
29328
|
);
|
|
28934
|
-
const
|
|
28935
|
-
const shouldRenderProviderUnavailableState = !hasActiveConversation &&
|
|
29329
|
+
const disabledAgentTarget = selectedAgentTargetComingSoon ? viewModel.selectedAgentTarget ?? null : null;
|
|
29330
|
+
const shouldRenderProviderUnavailableState = !hasActiveConversation && disabledAgentTarget !== null && renderProviderUnavailableState !== void 0;
|
|
28936
29331
|
const shouldRenderProviderReadinessGateState = !hasActiveConversation && emptyProviderReadinessGate !== null && renderProviderReadinessGateState !== void 0;
|
|
28937
29332
|
const bottomDockStoreState = useMemo11(
|
|
28938
29333
|
() => ({
|
|
@@ -29335,62 +29730,73 @@ var AgentGUIDetailPane = memo3(function AgentGUIDetailPane2({
|
|
|
29335
29730
|
"data-testid": "agent-gui-agents-empty",
|
|
29336
29731
|
children: /* @__PURE__ */ jsx35("div", { className: AgentGUINode_styles_default.emptyHeroBody, children: /* @__PURE__ */ jsx35("h2", { className: AgentGUINode_styles_default.emptyHeroTitle, children: labels.agentsEmpty }) })
|
|
29337
29732
|
}
|
|
29338
|
-
) : shouldRenderProviderUnavailableState &&
|
|
29339
|
-
provider:
|
|
29733
|
+
) : shouldRenderProviderUnavailableState && disabledAgentTarget ? /* @__PURE__ */ jsx35(Fragment9, { children: renderProviderUnavailableState?.({
|
|
29734
|
+
provider: disabledAgentTarget.provider,
|
|
29340
29735
|
providerLabel: labels.emptyProviderForProvider?.(
|
|
29341
|
-
|
|
29736
|
+
disabledAgentTarget.provider
|
|
29342
29737
|
) ?? resolveAgentGuiWorkbenchProviderLabel(
|
|
29343
|
-
|
|
29738
|
+
disabledAgentTarget.provider
|
|
29344
29739
|
),
|
|
29345
|
-
target:
|
|
29740
|
+
target: disabledAgentTarget,
|
|
29346
29741
|
iconUrl: resolveAgentGUIHeroIconUrl(
|
|
29347
|
-
|
|
29742
|
+
disabledAgentTarget.provider
|
|
29348
29743
|
),
|
|
29349
|
-
unavailableReason:
|
|
29350
|
-
}) }) : emptyProviderReadinessGate
|
|
29744
|
+
unavailableReason: disabledAgentTarget.unavailableReason ?? null
|
|
29745
|
+
}) }) : emptyProviderReadinessGate && shouldRenderProviderReadinessGateState ? /* @__PURE__ */ jsx35(Fragment9, { children: renderProviderReadinessGateState?.({
|
|
29351
29746
|
provider: emptyHeroProvider,
|
|
29352
29747
|
providerLabel: emptyHeroProviderLabel || resolveAgentGuiWorkbenchProviderLabel(emptyHeroProvider),
|
|
29353
|
-
target: viewModel.
|
|
29748
|
+
target: viewModel.selectedAgentTarget ?? null,
|
|
29354
29749
|
iconUrl: resolveAgentGUIHeroIconUrl(emptyHeroProvider),
|
|
29355
29750
|
gate: emptyProviderReadinessGate,
|
|
29356
29751
|
showAllProviders: viewModel.conversationFilter.kind === "all"
|
|
29357
29752
|
}) }) : /* @__PURE__ */ jsx35(
|
|
29358
|
-
|
|
29753
|
+
AgentGUIEmptyHeroCarouselStage,
|
|
29359
29754
|
{
|
|
29360
|
-
|
|
29361
|
-
|
|
29362
|
-
showAllProviders: viewModel.conversationFilter.kind === "all",
|
|
29363
|
-
emptyLabel: emptyHeroLabel,
|
|
29364
|
-
emptyProvider: emptyHeroProviderLabel,
|
|
29365
|
-
providerTargets: composerProviderTargets,
|
|
29366
|
-
selectedProviderTarget: viewModel.selectedProviderTarget,
|
|
29755
|
+
activeAgentTargetId: viewModel.selectedAgentTarget?.agentTargetId ?? viewModel.selectedAgentTarget?.targetId,
|
|
29756
|
+
items: emptyHeroAvatarPresentations,
|
|
29367
29757
|
onProviderSelect: canSwitchComposerProvider && viewModel.activeConversationId === null ? selectHomeComposerAgentTargetAndFocus : void 0,
|
|
29368
29758
|
providerSelectLabel: labels.providerSwitchLabel,
|
|
29369
|
-
|
|
29370
|
-
|
|
29371
|
-
|
|
29372
|
-
|
|
29373
|
-
|
|
29374
|
-
|
|
29375
|
-
|
|
29376
|
-
|
|
29377
|
-
|
|
29378
|
-
|
|
29379
|
-
|
|
29380
|
-
|
|
29381
|
-
|
|
29382
|
-
|
|
29383
|
-
|
|
29384
|
-
|
|
29385
|
-
|
|
29386
|
-
|
|
29387
|
-
|
|
29388
|
-
|
|
29389
|
-
|
|
29390
|
-
|
|
29391
|
-
|
|
29392
|
-
|
|
29393
|
-
|
|
29759
|
+
children: emptyProviderReadinessGate ? /* @__PURE__ */ jsx35(
|
|
29760
|
+
AgentGUIProviderReadinessGatePane,
|
|
29761
|
+
{
|
|
29762
|
+
provider: emptyHeroProvider,
|
|
29763
|
+
gate: emptyProviderReadinessGate,
|
|
29764
|
+
showAllProviders: viewModel.conversationFilter.kind === "all",
|
|
29765
|
+
carouselMountedExternally: emptyHeroAvatarPresentations.length > 1,
|
|
29766
|
+
emptyLabel: emptyHeroLabel,
|
|
29767
|
+
emptyProvider: emptyHeroProviderLabel,
|
|
29768
|
+
agentTargets: composerAgentTargets,
|
|
29769
|
+
selectedAgentTarget: viewModel.selectedAgentTarget,
|
|
29770
|
+
onProviderSelect: canSwitchComposerProvider && viewModel.activeConversationId === null ? selectHomeComposerAgentTargetAndFocus : void 0,
|
|
29771
|
+
providerSelectLabel: labels.providerSwitchLabel,
|
|
29772
|
+
labels
|
|
29773
|
+
}
|
|
29774
|
+
) : /* @__PURE__ */ jsx35(
|
|
29775
|
+
AgentGUIEmptyHeroPane,
|
|
29776
|
+
{
|
|
29777
|
+
provider: emptyHeroProvider,
|
|
29778
|
+
emptyLabel: emptyHeroLabel,
|
|
29779
|
+
emptyProvider: emptyHeroProviderLabel,
|
|
29780
|
+
avatarPresentations: emptyHeroAvatarPresentations,
|
|
29781
|
+
carouselMountedExternally: emptyHeroAvatarPresentations.length > 1,
|
|
29782
|
+
inlineNoticeChrome,
|
|
29783
|
+
isRespondingApproval: viewModel.isRespondingApproval,
|
|
29784
|
+
onSubmitApprovalOption: submitApprovalOption,
|
|
29785
|
+
onRetryActivation: retryActivation,
|
|
29786
|
+
onAuthLogin: authLogin,
|
|
29787
|
+
onContinueInNewConversation: continueInNewConversation,
|
|
29788
|
+
onProviderSelect: canSwitchComposerProvider && viewModel.activeConversationId === null ? selectHomeComposerAgentTargetAndFocus : void 0,
|
|
29789
|
+
agentTargets: composerAgentTargets,
|
|
29790
|
+
selectedAgentTarget: viewModel.selectedAgentTarget,
|
|
29791
|
+
chromeLabels,
|
|
29792
|
+
composerProps: emptyHeroComposerProps,
|
|
29793
|
+
providerSelectLabel: labels.providerSwitchLabel,
|
|
29794
|
+
suggestions: labels.homeSuggestions ?? EMPTY_HOME_SUGGESTIONS,
|
|
29795
|
+
suggestionsCloseLabel: labels.homeSuggestionsClose,
|
|
29796
|
+
onSelectSuggestion: handleSelectHomeSuggestion,
|
|
29797
|
+
onSelectSuggestionAction: handleHomeSuggestionAction
|
|
29798
|
+
}
|
|
29799
|
+
)
|
|
29394
29800
|
}
|
|
29395
29801
|
) : /* @__PURE__ */ jsx35(
|
|
29396
29802
|
AgentGUIConversationTimelinePane,
|
|
@@ -29530,11 +29936,35 @@ function useOptionalStableEventCallback(callback) {
|
|
|
29530
29936
|
}, [callback != null]);
|
|
29531
29937
|
}
|
|
29532
29938
|
var EMPTY_HOME_SUGGESTIONS = Object.freeze([]);
|
|
29939
|
+
var AgentGUIEmptyHeroCarouselStage = memo3(
|
|
29940
|
+
function AgentGUIEmptyHeroCarouselStage2({
|
|
29941
|
+
activeAgentTargetId,
|
|
29942
|
+
children,
|
|
29943
|
+
items,
|
|
29944
|
+
onProviderSelect,
|
|
29945
|
+
providerSelectLabel
|
|
29946
|
+
}) {
|
|
29947
|
+
"use memo";
|
|
29948
|
+
return /* @__PURE__ */ jsxs22("div", { className: AgentGUINode_styles_default.emptyHeroCarouselStage, children: [
|
|
29949
|
+
items.length > 1 ? /* @__PURE__ */ jsx35("div", { className: AgentGUINode_styles_default.emptyHeroCarouselLayer, children: /* @__PURE__ */ jsx35(
|
|
29950
|
+
AgentGUIHeroAgentCarousel,
|
|
29951
|
+
{
|
|
29952
|
+
activeAgentTargetId,
|
|
29953
|
+
items,
|
|
29954
|
+
onProviderSelect,
|
|
29955
|
+
providerSelectLabel
|
|
29956
|
+
}
|
|
29957
|
+
) }) : null,
|
|
29958
|
+
children
|
|
29959
|
+
] });
|
|
29960
|
+
}
|
|
29961
|
+
);
|
|
29533
29962
|
var AgentGUIEmptyHeroPane = memo3(function AgentGUIEmptyHeroPane2({
|
|
29534
29963
|
provider,
|
|
29535
29964
|
emptyLabel,
|
|
29536
29965
|
emptyProvider,
|
|
29537
|
-
|
|
29966
|
+
avatarPresentations,
|
|
29967
|
+
carouselMountedExternally = false,
|
|
29538
29968
|
inlineNoticeChrome,
|
|
29539
29969
|
isRespondingApproval,
|
|
29540
29970
|
onSubmitApprovalOption,
|
|
@@ -29542,8 +29972,8 @@ var AgentGUIEmptyHeroPane = memo3(function AgentGUIEmptyHeroPane2({
|
|
|
29542
29972
|
onRetryActivation,
|
|
29543
29973
|
onContinueInNewConversation,
|
|
29544
29974
|
onProviderSelect,
|
|
29545
|
-
|
|
29546
|
-
|
|
29975
|
+
agentTargets,
|
|
29976
|
+
selectedAgentTarget,
|
|
29547
29977
|
chromeLabels,
|
|
29548
29978
|
composerProps,
|
|
29549
29979
|
providerSelectLabel,
|
|
@@ -29553,36 +29983,47 @@ var AgentGUIEmptyHeroPane = memo3(function AgentGUIEmptyHeroPane2({
|
|
|
29553
29983
|
onSelectSuggestionAction
|
|
29554
29984
|
}) {
|
|
29555
29985
|
"use memo";
|
|
29556
|
-
const
|
|
29557
|
-
|
|
29986
|
+
const heroAvatarPresentations = avatarPresentations.length > 0 ? avatarPresentations : [
|
|
29987
|
+
createFallbackAgentGUIAgentAvatar({
|
|
29988
|
+
provider,
|
|
29989
|
+
label: emptyProvider
|
|
29990
|
+
})
|
|
29991
|
+
];
|
|
29992
|
+
const heroIconAnimationKey = heroAvatarPresentations.map(
|
|
29993
|
+
(avatar) => `${avatar.agentTargetId}:${avatar.iconUrl}:${avatar.badge?.iconUrl ?? ""}`
|
|
29994
|
+
).join("|");
|
|
29558
29995
|
return /* @__PURE__ */ jsx35("div", { className: AgentGUINode_styles_default.emptyHero, children: /* @__PURE__ */ jsxs22("div", { className: AgentGUINode_styles_default.emptyHeroBody, children: [
|
|
29559
|
-
/* @__PURE__ */ jsx35(
|
|
29560
|
-
|
|
29561
|
-
{
|
|
29562
|
-
activeAgentTargetId: selectedProviderTarget?.agentTargetId ?? selectedProviderTarget?.targetId,
|
|
29563
|
-
icons: heroIconPresentations,
|
|
29564
|
-
providerTargets,
|
|
29565
|
-
onProviderSelect,
|
|
29566
|
-
providerSelectLabel
|
|
29567
|
-
},
|
|
29568
|
-
heroIconAnimationKey
|
|
29569
|
-
) : /* @__PURE__ */ jsx35(
|
|
29570
|
-
AgentGUIProviderIconVisual,
|
|
29996
|
+
/* @__PURE__ */ jsx35(
|
|
29997
|
+
"div",
|
|
29571
29998
|
{
|
|
29572
|
-
|
|
29573
|
-
|
|
29574
|
-
|
|
29575
|
-
|
|
29576
|
-
|
|
29577
|
-
|
|
29999
|
+
className: AgentGUINode_styles_default.emptyHeroIconSlot,
|
|
30000
|
+
"data-carousel-placeholder": carouselMountedExternally || void 0,
|
|
30001
|
+
children: carouselMountedExternally ? null : heroAvatarPresentations.length > 1 ? /* @__PURE__ */ jsx35(
|
|
30002
|
+
AgentGUIHeroAgentCarousel,
|
|
30003
|
+
{
|
|
30004
|
+
activeAgentTargetId: selectedAgentTarget?.agentTargetId ?? selectedAgentTarget?.targetId,
|
|
30005
|
+
items: heroAvatarPresentations,
|
|
30006
|
+
onProviderSelect,
|
|
30007
|
+
providerSelectLabel
|
|
30008
|
+
}
|
|
30009
|
+
) : /* @__PURE__ */ jsx35(
|
|
30010
|
+
AgentGUIAgentAvatarVisual,
|
|
30011
|
+
{
|
|
30012
|
+
className: AgentGUINode_styles_default.emptyHeroIconEffect,
|
|
30013
|
+
presentation: heroAvatarPresentations[0]
|
|
30014
|
+
},
|
|
30015
|
+
heroIconAnimationKey
|
|
30016
|
+
)
|
|
30017
|
+
}
|
|
30018
|
+
),
|
|
29578
30019
|
/* @__PURE__ */ jsx35("h2", { className: AgentGUINode_styles_default.emptyHeroTitle, children: /* @__PURE__ */ jsx35(
|
|
29579
30020
|
EmptyHeroTitle,
|
|
29580
30021
|
{
|
|
29581
30022
|
label: emptyLabel,
|
|
29582
30023
|
providerLabel: emptyProvider,
|
|
29583
30024
|
providerSelectLabel,
|
|
29584
|
-
|
|
29585
|
-
|
|
30025
|
+
agentTargets,
|
|
30026
|
+
selectedAgentTarget,
|
|
29586
30027
|
onProviderSelect
|
|
29587
30028
|
}
|
|
29588
30029
|
) }),
|
|
@@ -29617,24 +30058,17 @@ var AgentGUIProviderReadinessGatePane = memo3(
|
|
|
29617
30058
|
showAllProviders = false,
|
|
29618
30059
|
emptyLabel,
|
|
29619
30060
|
emptyProvider,
|
|
29620
|
-
|
|
29621
|
-
|
|
30061
|
+
agentTargets,
|
|
30062
|
+
selectedAgentTarget,
|
|
29622
30063
|
onProviderSelect,
|
|
29623
30064
|
providerSelectLabel,
|
|
30065
|
+
carouselMountedExternally = false,
|
|
29624
30066
|
labels
|
|
29625
30067
|
}) {
|
|
29626
30068
|
"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]
|
|
30069
|
+
const heroAvatarPresentations = useMemo11(
|
|
30070
|
+
() => agentTargets.map(projectAgentGUIAgentTargetAvatar),
|
|
30071
|
+
[agentTargets]
|
|
29638
30072
|
);
|
|
29639
30073
|
const pendingAction = gate.pendingAction ?? null;
|
|
29640
30074
|
const isPending = pendingAction !== null;
|
|
@@ -29652,23 +30086,28 @@ var AgentGUIProviderReadinessGatePane = memo3(
|
|
|
29652
30086
|
"data-testid": "agent-gui-provider-readiness-gate",
|
|
29653
30087
|
role: "status",
|
|
29654
30088
|
children: [
|
|
29655
|
-
|
|
30089
|
+
carouselMountedExternally ? /* @__PURE__ */ jsx35(
|
|
30090
|
+
"div",
|
|
30091
|
+
{
|
|
30092
|
+
"aria-hidden": "true",
|
|
30093
|
+
className: AgentGUINode_styles_default.emptyHeroCarouselPlaceholder
|
|
30094
|
+
}
|
|
30095
|
+
) : showAllProviders ? /* @__PURE__ */ jsx35(
|
|
29656
30096
|
AgentGUIHeroAgentCarousel,
|
|
29657
30097
|
{
|
|
29658
|
-
activeAgentTargetId:
|
|
29659
|
-
|
|
29660
|
-
providerTargets,
|
|
30098
|
+
activeAgentTargetId: selectedAgentTarget?.agentTargetId ?? selectedAgentTarget?.targetId,
|
|
30099
|
+
items: heroAvatarPresentations,
|
|
29661
30100
|
onProviderSelect,
|
|
29662
30101
|
providerSelectLabel
|
|
29663
30102
|
}
|
|
29664
30103
|
) : /* @__PURE__ */ jsx35(
|
|
29665
|
-
|
|
30104
|
+
AgentGUIAgentAvatarVisual,
|
|
29666
30105
|
{
|
|
29667
|
-
"aria-hidden": "true",
|
|
29668
30106
|
className: AgentGUINode_styles_default.emptyHeroIconEffect,
|
|
29669
|
-
|
|
29670
|
-
|
|
29671
|
-
|
|
30107
|
+
presentation: selectedAgentTarget ? projectAgentGUIAgentTargetAvatar(selectedAgentTarget) : createFallbackAgentGUIAgentAvatar({
|
|
30108
|
+
provider,
|
|
30109
|
+
label: emptyProvider
|
|
30110
|
+
})
|
|
29672
30111
|
}
|
|
29673
30112
|
),
|
|
29674
30113
|
/* @__PURE__ */ jsx35("h2", { className: AgentGUINode_styles_default.emptyHeroTitle, children: useSharedHeroTitle ? /* @__PURE__ */ jsx35(
|
|
@@ -29677,8 +30116,8 @@ var AgentGUIProviderReadinessGatePane = memo3(
|
|
|
29677
30116
|
label: emptyLabel,
|
|
29678
30117
|
providerLabel: emptyProvider,
|
|
29679
30118
|
providerSelectLabel,
|
|
29680
|
-
|
|
29681
|
-
|
|
30119
|
+
agentTargets,
|
|
30120
|
+
selectedAgentTarget,
|
|
29682
30121
|
onProviderSelect
|
|
29683
30122
|
}
|
|
29684
30123
|
) : content.title }),
|
|
@@ -29796,19 +30235,37 @@ function AgentGUIUnifiedProviderIcon({
|
|
|
29796
30235
|
}
|
|
29797
30236
|
) });
|
|
29798
30237
|
}
|
|
29799
|
-
function
|
|
29800
|
-
|
|
29801
|
-
|
|
29802
|
-
|
|
30238
|
+
function AgentGUIAgentAvatarVisual({
|
|
30239
|
+
className,
|
|
30240
|
+
imageClassName,
|
|
30241
|
+
presentation
|
|
29803
30242
|
}) {
|
|
29804
|
-
return /* @__PURE__ */
|
|
29805
|
-
"
|
|
30243
|
+
return /* @__PURE__ */ jsxs22(
|
|
30244
|
+
"span",
|
|
29806
30245
|
{
|
|
29807
|
-
|
|
29808
|
-
|
|
29809
|
-
|
|
29810
|
-
|
|
29811
|
-
|
|
30246
|
+
"aria-hidden": "true",
|
|
30247
|
+
className: cn3(AgentGUINode_styles_default.agentAvatar, className),
|
|
30248
|
+
"data-agent-target-id": presentation.agentTargetId,
|
|
30249
|
+
children: [
|
|
30250
|
+
/* @__PURE__ */ jsx35(
|
|
30251
|
+
"img",
|
|
30252
|
+
{
|
|
30253
|
+
alt: "",
|
|
30254
|
+
className: cn3(AgentGUINode_styles_default.agentAvatarImage, imageClassName),
|
|
30255
|
+
draggable: false,
|
|
30256
|
+
src: presentation.iconUrl
|
|
30257
|
+
}
|
|
30258
|
+
),
|
|
30259
|
+
presentation.badge?.iconUrl ? /* @__PURE__ */ jsx35("span", { className: AgentGUINode_styles_default.agentAvatarBadge, children: /* @__PURE__ */ jsx35(
|
|
30260
|
+
"img",
|
|
30261
|
+
{
|
|
30262
|
+
alt: "",
|
|
30263
|
+
className: AgentGUINode_styles_default.agentAvatarBadgeImage,
|
|
30264
|
+
draggable: false,
|
|
30265
|
+
src: presentation.badge.iconUrl
|
|
30266
|
+
}
|
|
30267
|
+
) }) : null
|
|
30268
|
+
]
|
|
29812
30269
|
}
|
|
29813
30270
|
);
|
|
29814
30271
|
}
|
|
@@ -29816,8 +30273,8 @@ function EmptyHeroTitle({
|
|
|
29816
30273
|
label,
|
|
29817
30274
|
providerLabel,
|
|
29818
30275
|
providerSelectLabel,
|
|
29819
|
-
|
|
29820
|
-
|
|
30276
|
+
agentTargets = [],
|
|
30277
|
+
selectedAgentTarget = null,
|
|
29821
30278
|
onProviderSelect
|
|
29822
30279
|
}) {
|
|
29823
30280
|
const providerStart = providerLabel ? label.indexOf(providerLabel) : -1;
|
|
@@ -29825,8 +30282,8 @@ function EmptyHeroTitle({
|
|
|
29825
30282
|
return /* @__PURE__ */ jsx35(Fragment9, { children: label });
|
|
29826
30283
|
}
|
|
29827
30284
|
const providerEnd = providerStart + providerLabel.length;
|
|
29828
|
-
const selectedAgentTargetId =
|
|
29829
|
-
const canSwitchProvider =
|
|
30285
|
+
const selectedAgentTargetId = selectedAgentTarget?.targetId ?? `local:${selectedAgentTarget?.provider ?? ""}`;
|
|
30286
|
+
const canSwitchProvider = agentTargets.length > 1 && selectedAgentTarget && onProviderSelect;
|
|
29830
30287
|
const providerName = label.slice(providerStart, providerEnd);
|
|
29831
30288
|
return /* @__PURE__ */ jsxs22(Fragment9, { children: [
|
|
29832
30289
|
label.slice(0, providerStart),
|
|
@@ -29835,7 +30292,7 @@ function EmptyHeroTitle({
|
|
|
29835
30292
|
{
|
|
29836
30293
|
value: selectedAgentTargetId,
|
|
29837
30294
|
onValueChange: (nextTargetId) => {
|
|
29838
|
-
const target =
|
|
30295
|
+
const target = agentTargets.find(
|
|
29839
30296
|
(candidate) => candidate.targetId === nextTargetId
|
|
29840
30297
|
);
|
|
29841
30298
|
if (!target) {
|
|
@@ -29862,7 +30319,7 @@ function EmptyHeroTitle({
|
|
|
29862
30319
|
{
|
|
29863
30320
|
align: "center",
|
|
29864
30321
|
className: cn3(AgentGUINode_styles_default.composerMenuContent, "min-w-[190px]"),
|
|
29865
|
-
children:
|
|
30322
|
+
children: agentTargets.map((target) => /* @__PURE__ */ jsx35(
|
|
29866
30323
|
SelectItem3,
|
|
29867
30324
|
{
|
|
29868
30325
|
value: target.targetId,
|
|
@@ -29879,10 +30336,10 @@ function EmptyHeroTitle({
|
|
|
29879
30336
|
alt: "",
|
|
29880
30337
|
"aria-hidden": "true",
|
|
29881
30338
|
className: "size-4 shrink-0 rounded-[4px]",
|
|
29882
|
-
src:
|
|
30339
|
+
src: resolveAgentGUIAgentAvatarIconUrl(
|
|
29883
30340
|
target.provider,
|
|
29884
30341
|
target.iconUrl
|
|
29885
|
-
)
|
|
30342
|
+
)
|
|
29886
30343
|
}
|
|
29887
30344
|
),
|
|
29888
30345
|
/* @__PURE__ */ jsx35("span", { className: "min-w-0 truncate", children: target.label })
|
|
@@ -30050,7 +30507,7 @@ function syncAgentGUIConversationRailStore(store, next) {
|
|
|
30050
30507
|
Object.assign(store, next);
|
|
30051
30508
|
}
|
|
30052
30509
|
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.
|
|
30510
|
+
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
30511
|
}
|
|
30055
30512
|
var AgentGUIConversationRailStorePane = memo3(
|
|
30056
30513
|
function AgentGUIConversationRailStorePane2({
|
|
@@ -30465,11 +30922,11 @@ function agentGUIProviderRailAriaLabel(label, badgeLabel) {
|
|
|
30465
30922
|
}
|
|
30466
30923
|
return `${label}, ${normalizedBadgeLabel}`;
|
|
30467
30924
|
}
|
|
30468
|
-
function
|
|
30925
|
+
function agentGUIAgentTargetMatchesConversationFilter(target, filter) {
|
|
30469
30926
|
return filter.kind === "agentTarget" && (target.agentTargetId?.trim() ?? "") === filter.agentTargetId;
|
|
30470
30927
|
}
|
|
30471
|
-
function agentGUIProviderRailTargets(
|
|
30472
|
-
return
|
|
30928
|
+
function agentGUIProviderRailTargets(agentTargets, agentTargetsLoading) {
|
|
30929
|
+
return agentTargetsLoading ? [] : agentTargets;
|
|
30473
30930
|
}
|
|
30474
30931
|
var AGENT_GUI_PROVIDER_RAIL_DRAG_HYSTERESIS_PX = 8;
|
|
30475
30932
|
var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
@@ -30477,9 +30934,9 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30477
30934
|
labels,
|
|
30478
30935
|
previewMode,
|
|
30479
30936
|
workspaceId,
|
|
30480
|
-
|
|
30481
|
-
|
|
30482
|
-
|
|
30937
|
+
selectedAgentTarget,
|
|
30938
|
+
agentTargets,
|
|
30939
|
+
agentTargetsLoading,
|
|
30483
30940
|
renderProviderRailEmpty,
|
|
30484
30941
|
providerRailAllPresentation,
|
|
30485
30942
|
onRequestComposerFocus,
|
|
@@ -30522,23 +30979,20 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30522
30979
|
},
|
|
30523
30980
|
[providerRailOrderStorageKey]
|
|
30524
30981
|
);
|
|
30525
|
-
const
|
|
30526
|
-
() => agentGUIProviderRailTargets(
|
|
30527
|
-
[
|
|
30982
|
+
const railAgentTargets = useMemo11(
|
|
30983
|
+
() => agentGUIProviderRailTargets(agentTargets, agentTargetsLoading),
|
|
30984
|
+
[agentTargets, agentTargetsLoading]
|
|
30528
30985
|
);
|
|
30529
30986
|
const providerTiles = useMemo11(() => {
|
|
30530
|
-
return applyAgentGUIProviderRailOrder(
|
|
30531
|
-
|
|
30532
|
-
providerRailOrder
|
|
30533
|
-
);
|
|
30534
|
-
}, [providerRailOrder, railProviderTargets]);
|
|
30987
|
+
return applyAgentGUIProviderRailOrder(railAgentTargets, providerRailOrder);
|
|
30988
|
+
}, [providerRailOrder, railAgentTargets]);
|
|
30535
30989
|
const visibleProviderTiles = providerTiles;
|
|
30536
|
-
const
|
|
30537
|
-
const allTileSelected = conversationFilter.kind === "all" && !
|
|
30990
|
+
const selectedAgentTargetIsPlaceholder = selectedAgentTarget?.disabled === true;
|
|
30991
|
+
const allTileSelected = conversationFilter.kind === "all" && !selectedAgentTargetIsPlaceholder;
|
|
30538
30992
|
const selectAllProviders = useCallback11(() => {
|
|
30539
30993
|
onUpdateConversationFilter({ kind: "all" });
|
|
30540
|
-
if (
|
|
30541
|
-
const fallbackTarget =
|
|
30994
|
+
if (selectedAgentTargetIsPlaceholder) {
|
|
30995
|
+
const fallbackTarget = railAgentTargets.find((target) => target.disabled !== true) ?? null;
|
|
30542
30996
|
if (fallbackTarget) {
|
|
30543
30997
|
onSelectConversationFilterTarget({
|
|
30544
30998
|
provider: fallbackTarget.provider,
|
|
@@ -30551,8 +31005,8 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30551
31005
|
onSelectConversationFilterTarget,
|
|
30552
31006
|
onRequestComposerFocus,
|
|
30553
31007
|
onUpdateConversationFilter,
|
|
30554
|
-
|
|
30555
|
-
|
|
31008
|
+
railAgentTargets,
|
|
31009
|
+
selectedAgentTargetIsPlaceholder
|
|
30556
31010
|
]);
|
|
30557
31011
|
const selectAgentTargetTile = useCallback11(
|
|
30558
31012
|
(target) => {
|
|
@@ -30569,7 +31023,7 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30569
31023
|
}, [setProviderRailDragState]);
|
|
30570
31024
|
const handleProviderRailDragStart = useCallback11(
|
|
30571
31025
|
(event, target) => {
|
|
30572
|
-
if (previewMode ||
|
|
31026
|
+
if (previewMode || agentTargetsLoading) {
|
|
30573
31027
|
event.preventDefault();
|
|
30574
31028
|
return;
|
|
30575
31029
|
}
|
|
@@ -30581,11 +31035,11 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30581
31035
|
position: null
|
|
30582
31036
|
});
|
|
30583
31037
|
},
|
|
30584
|
-
[previewMode,
|
|
31038
|
+
[previewMode, agentTargetsLoading, setProviderRailDragState]
|
|
30585
31039
|
);
|
|
30586
31040
|
const handleProviderRailDragOver = useCallback11(
|
|
30587
31041
|
(event, target) => {
|
|
30588
|
-
if (previewMode ||
|
|
31042
|
+
if (previewMode || agentTargetsLoading || !dragState) {
|
|
30589
31043
|
return;
|
|
30590
31044
|
}
|
|
30591
31045
|
event.preventDefault();
|
|
@@ -30613,7 +31067,7 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30613
31067
|
position
|
|
30614
31068
|
});
|
|
30615
31069
|
},
|
|
30616
|
-
[dragState, previewMode,
|
|
31070
|
+
[dragState, previewMode, agentTargetsLoading, setProviderRailDragState]
|
|
30617
31071
|
);
|
|
30618
31072
|
const commitProviderRailDragDrop = useCallback11(
|
|
30619
31073
|
(event) => {
|
|
@@ -30623,7 +31077,7 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30623
31077
|
overTargetId: null,
|
|
30624
31078
|
position: null
|
|
30625
31079
|
} : null);
|
|
30626
|
-
if (previewMode ||
|
|
31080
|
+
if (previewMode || agentTargetsLoading || !activeDragState) {
|
|
30627
31081
|
clearProviderRailDragState();
|
|
30628
31082
|
return;
|
|
30629
31083
|
}
|
|
@@ -30683,14 +31137,14 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30683
31137
|
dragState,
|
|
30684
31138
|
persistProviderRailOrder,
|
|
30685
31139
|
previewMode,
|
|
30686
|
-
|
|
31140
|
+
agentTargetsLoading,
|
|
30687
31141
|
visibleProviderTiles
|
|
30688
31142
|
]
|
|
30689
31143
|
);
|
|
30690
31144
|
const handleProviderRailContainerDragOver = useCallback11(
|
|
30691
31145
|
(event) => {
|
|
30692
31146
|
const activeDragState = dragStateRef.current ?? dragState;
|
|
30693
|
-
if (!activeDragState || previewMode ||
|
|
31147
|
+
if (!activeDragState || previewMode || agentTargetsLoading) {
|
|
30694
31148
|
return;
|
|
30695
31149
|
}
|
|
30696
31150
|
event.preventDefault();
|
|
@@ -30729,16 +31183,16 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30729
31183
|
position
|
|
30730
31184
|
});
|
|
30731
31185
|
},
|
|
30732
|
-
[dragState, previewMode,
|
|
31186
|
+
[dragState, previewMode, agentTargetsLoading, setProviderRailDragState]
|
|
30733
31187
|
);
|
|
30734
|
-
if (!
|
|
31188
|
+
if (!agentTargetsLoading && visibleProviderTiles.length === 0 && renderProviderRailEmpty) {
|
|
30735
31189
|
return /* @__PURE__ */ jsx35(
|
|
30736
31190
|
"div",
|
|
30737
31191
|
{
|
|
30738
31192
|
className: AgentGUINode_styles_default.providerRail,
|
|
30739
31193
|
role: "tablist",
|
|
30740
31194
|
"aria-label": labels.providerSwitchLabel,
|
|
30741
|
-
"aria-busy":
|
|
31195
|
+
"aria-busy": agentTargetsLoading,
|
|
30742
31196
|
"data-empty": "true"
|
|
30743
31197
|
}
|
|
30744
31198
|
);
|
|
@@ -30749,7 +31203,7 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30749
31203
|
className: "flex min-h-0 w-full flex-col items-center",
|
|
30750
31204
|
role: "tablist",
|
|
30751
31205
|
"aria-label": labels.providerSwitchLabel,
|
|
30752
|
-
"aria-busy":
|
|
31206
|
+
"aria-busy": agentTargetsLoading,
|
|
30753
31207
|
onDragOver: handleProviderRailContainerDragOver,
|
|
30754
31208
|
onDrop: commitProviderRailDragDrop,
|
|
30755
31209
|
children: [
|
|
@@ -30778,7 +31232,7 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30778
31232
|
),
|
|
30779
31233
|
/* @__PURE__ */ jsx35("span", { "aria-hidden": "true", className: AgentGUINode_styles_default.providerRailSeparator })
|
|
30780
31234
|
] }) : null,
|
|
30781
|
-
|
|
31235
|
+
agentTargetsLoading ? [0, 1, 2].map((index) => /* @__PURE__ */ jsx35(
|
|
30782
31236
|
"button",
|
|
30783
31237
|
{
|
|
30784
31238
|
type: "button",
|
|
@@ -30799,7 +31253,7 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30799
31253
|
`provider-target-loading-${index}`
|
|
30800
31254
|
)) : null,
|
|
30801
31255
|
visibleProviderTiles.map((target) => {
|
|
30802
|
-
const providerSelected = visibleProviderTiles.length === 1 ? true : target.disabled === true ?
|
|
31256
|
+
const providerSelected = visibleProviderTiles.length === 1 ? true : target.disabled === true ? selectedAgentTarget?.provider === target.provider && selectedAgentTarget?.targetId === target.targetId : agentGUIAgentTargetMatchesConversationFilter(
|
|
30803
31257
|
target,
|
|
30804
31258
|
conversationFilter
|
|
30805
31259
|
);
|
|
@@ -30827,33 +31281,19 @@ var AgentGUIProviderRail = memo3(function AgentGUIProviderRail2({
|
|
|
30827
31281
|
"data-agent-target-id": target.targetId,
|
|
30828
31282
|
"data-selected": providerSelected ? "true" : "false",
|
|
30829
31283
|
disabled: previewMode,
|
|
30830
|
-
draggable: !previewMode && !
|
|
31284
|
+
draggable: !previewMode && !agentTargetsLoading,
|
|
30831
31285
|
onClick: () => selectAgentTargetTile(target),
|
|
30832
31286
|
onDragEnd: clearProviderRailDragState,
|
|
30833
31287
|
onDragOver: (event) => handleProviderRailDragOver(event, target),
|
|
30834
31288
|
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
|
-
] })
|
|
31289
|
+
children: /* @__PURE__ */ jsx35(
|
|
31290
|
+
AgentGUIAgentAvatarVisual,
|
|
31291
|
+
{
|
|
31292
|
+
className: AgentGUINode_styles_default.providerRailAvatar,
|
|
31293
|
+
imageClassName: AgentGUINode_styles_default.providerRailAvatarImage,
|
|
31294
|
+
presentation: projectAgentGUIAgentTargetAvatar(target)
|
|
31295
|
+
}
|
|
31296
|
+
)
|
|
30857
31297
|
},
|
|
30858
31298
|
`${target.provider}:${target.targetId}`
|
|
30859
31299
|
);
|
|
@@ -33569,7 +34009,7 @@ function resolveAgentGUIRailStatusProvider(input) {
|
|
|
33569
34009
|
if (filter.kind !== "agentTarget") {
|
|
33570
34010
|
return null;
|
|
33571
34011
|
}
|
|
33572
|
-
const target = input.
|
|
34012
|
+
const target = input.agentTargets.find(
|
|
33573
34013
|
(candidate) => candidate.disabled !== true && (candidate.agentTargetId?.trim() ?? "") === filter.agentTargetId
|
|
33574
34014
|
);
|
|
33575
34015
|
return target ? target.provider : null;
|
|
@@ -33871,8 +34311,8 @@ var AgentGUINode = memo4(function AgentGUINode2({
|
|
|
33871
34311
|
data: state,
|
|
33872
34312
|
openSessionRequest,
|
|
33873
34313
|
prefillPromptRequest,
|
|
33874
|
-
|
|
33875
|
-
|
|
34314
|
+
agentTargets: internalAgentTargets,
|
|
34315
|
+
agentTargetsLoading: agentsLoading,
|
|
33876
34316
|
providerReadinessGates: internalProviderReadinessGates,
|
|
33877
34317
|
defaultAgentTargetId,
|
|
33878
34318
|
previewMode,
|
|
@@ -33904,9 +34344,9 @@ var AgentGUINode = memo4(function AgentGUINode2({
|
|
|
33904
34344
|
);
|
|
33905
34345
|
const fallbackAgentTitle = t("sidebar.fallbackAgentLabel");
|
|
33906
34346
|
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) :
|
|
34347
|
+
const activeReadinessProvider = viewModel.activeConversationId !== null ? activeProvider : viewModel.selectedAgentTarget.provider;
|
|
34348
|
+
const selectedAgentTargetLabel = viewModel.selectedAgentTarget?.label ?? resolveAgentGUIProviderDisplayLabel(state.provider, fallbackAgentTitle);
|
|
34349
|
+
const displayProviderLabel = viewModel.activeConversation ? resolveAgentGUIProviderDisplayLabel(activeProvider, fallbackAgentTitle) : selectedAgentTargetLabel;
|
|
33910
34350
|
const activeConversationDockTitle = viewModel.activeConversation ? resolveAgentGUIDockConversationTitle(viewModel.activeConversation) : null;
|
|
33911
34351
|
useEffect18(() => {
|
|
33912
34352
|
if (previewMode || !viewModel.activeConversation) {
|
|
@@ -34553,9 +34993,9 @@ var AgentGUINode = memo4(function AgentGUINode2({
|
|
|
34553
34993
|
const railStatusProvider = useMemo12(
|
|
34554
34994
|
() => resolveAgentGUIRailStatusProvider({
|
|
34555
34995
|
conversationFilter: viewModel.conversationFilter,
|
|
34556
|
-
|
|
34996
|
+
agentTargets: viewModel.agentTargets
|
|
34557
34997
|
}),
|
|
34558
|
-
[viewModel.conversationFilter, viewModel.
|
|
34998
|
+
[viewModel.conversationFilter, viewModel.agentTargets]
|
|
34559
34999
|
);
|
|
34560
35000
|
const activeAgentProbe = useMemo12(
|
|
34561
35001
|
() => findWorkspaceAgentProbeForDockProvider(
|