@tutti-os/agent-gui 0.0.171 → 0.0.172
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AgentRichTextReadonly-WOIEQ673.js → AgentRichTextReadonly-ZEMFCKVR.js} +5 -5
- package/dist/agent-conversation/index.d.ts +1 -1
- package/dist/agent-conversation/index.js +7 -7
- package/dist/agent-gui.d.ts +53 -16
- package/dist/agent-gui.js +15 -15
- package/dist/agent-message-center/index.d.ts +1 -1
- package/dist/agent-message-center/index.js +7 -7
- package/dist/{agentGuiNodeTypes-CXL3ISqC.d.ts → agentGuiNodeTypes-CLU6X2Hk.d.ts} +1 -1
- package/dist/{chunk-Y3K2YTLD.js → chunk-3QPFTVLN.js} +4 -4
- package/dist/{chunk-42KTGN4W.js → chunk-5UTK6FDH.js} +2 -2
- package/dist/{chunk-QEOAZW53.js → chunk-7E2JZRSI.js} +2 -2
- package/dist/{chunk-LQ6CK4GS.js → chunk-7VPICMI3.js} +1173 -739
- package/dist/chunk-7VPICMI3.js.map +1 -0
- package/dist/{chunk-OUOVA353.js → chunk-ADZL6MLR.js} +4 -4
- package/dist/{chunk-GMALB4L6.js → chunk-ARJ63FKZ.js} +5 -5
- package/dist/{chunk-EZ6E3LVP.js → chunk-CAZ7NYUE.js} +2 -2
- package/dist/{chunk-KDRU3NBW.js → chunk-EJM3JYAD.js} +4 -4
- package/dist/{chunk-2RQM7PJN.js → chunk-EVQ4JY3N.js} +1 -1
- package/dist/{chunk-2RQM7PJN.js.map → chunk-EVQ4JY3N.js.map} +1 -1
- package/dist/{chunk-7M6STXDS.js → chunk-K57GJTVC.js} +2 -2
- package/dist/{chunk-BHLX4ZFU.js → chunk-OKBVGNH7.js} +2 -2
- package/dist/{chunk-5EHKHIFG.js → chunk-P44BIVG6.js} +3 -3
- package/dist/{chunk-C7RY5XMJ.js → chunk-P5OTILPN.js} +6 -6
- package/dist/{chunk-42W6JENH.js → chunk-UPX5IC2U.js} +2 -2
- package/dist/{chunk-J4RQ2RTM.js → chunk-VGUKS6JR.js} +7 -7
- package/dist/chunk-VGUKS6JR.js.map +1 -0
- package/dist/context-mention-palette/index.js +7 -7
- package/dist/i18n/index.d.ts +4 -4
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +95 -21
- package/dist/index.js +20 -16
- package/dist/index.js.map +1 -1
- package/dist/mention-search.js +5 -5
- package/dist/workbench/browser-element-context/index.js +1 -1
- package/dist/workbench/contribution.js +4 -4
- package/dist/workbench/index.js +4 -4
- package/dist/workbench/sessionTitle.js +2 -2
- package/package.json +13 -13
- package/dist/chunk-J4RQ2RTM.js.map +0 -1
- package/dist/chunk-LQ6CK4GS.js.map +0 -1
- /package/dist/{AgentRichTextReadonly-WOIEQ673.js.map → AgentRichTextReadonly-ZEMFCKVR.js.map} +0 -0
- /package/dist/{chunk-Y3K2YTLD.js.map → chunk-3QPFTVLN.js.map} +0 -0
- /package/dist/{chunk-42KTGN4W.js.map → chunk-5UTK6FDH.js.map} +0 -0
- /package/dist/{chunk-QEOAZW53.js.map → chunk-7E2JZRSI.js.map} +0 -0
- /package/dist/{chunk-OUOVA353.js.map → chunk-ADZL6MLR.js.map} +0 -0
- /package/dist/{chunk-GMALB4L6.js.map → chunk-ARJ63FKZ.js.map} +0 -0
- /package/dist/{chunk-EZ6E3LVP.js.map → chunk-CAZ7NYUE.js.map} +0 -0
- /package/dist/{chunk-KDRU3NBW.js.map → chunk-EJM3JYAD.js.map} +0 -0
- /package/dist/{chunk-7M6STXDS.js.map → chunk-K57GJTVC.js.map} +0 -0
- /package/dist/{chunk-BHLX4ZFU.js.map → chunk-OKBVGNH7.js.map} +0 -0
- /package/dist/{chunk-5EHKHIFG.js.map → chunk-P44BIVG6.js.map} +0 -0
- /package/dist/{chunk-C7RY5XMJ.js.map → chunk-P5OTILPN.js.map} +0 -0
- /package/dist/{chunk-42W6JENH.js.map → chunk-UPX5IC2U.js.map} +0 -0
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
resolveAgentGuiSessionProviderFlatIconUrl,
|
|
13
13
|
resolveNextAgentGUIConversationRailWidthPx,
|
|
14
14
|
shouldAutoCollapseAgentGUIConversationRail
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3QPFTVLN.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveAgentGuiWorkbenchProviderLabel
|
|
18
18
|
} from "./chunk-SZVHT57M.js";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
resolveAgentGUIFirstUserMessageDisplayPrompt,
|
|
32
32
|
resolveAgentGUIProviderDisplayLabel,
|
|
33
33
|
resolveAgentGUIProviderIdentity
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-5UTK6FDH.js";
|
|
35
35
|
import {
|
|
36
36
|
AgentConversationFlow,
|
|
37
37
|
Button,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
toLocalShortDateTime,
|
|
66
66
|
updateAgentComposerDraft,
|
|
67
67
|
useProjectedAgentConversation
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-P5OTILPN.js";
|
|
69
69
|
import {
|
|
70
70
|
agentRichTextContentToPromptText,
|
|
71
71
|
createAgentRichTextInputExtensions,
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
plainTextToAgentRichTextInlineContent,
|
|
76
76
|
skillDescriptionForDisplay,
|
|
77
77
|
skillTriggerForPrefix
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-UPX5IC2U.js";
|
|
79
79
|
import {
|
|
80
80
|
AgentEnvPanelActionProvider
|
|
81
81
|
} from "./chunk-THBCAUBR.js";
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
AgentFileMentionPalette,
|
|
91
91
|
agentMentionItemKey,
|
|
92
92
|
isAgentMentionItemDisabled
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-EJM3JYAD.js";
|
|
94
94
|
import {
|
|
95
95
|
normalizeAgentGUIAgents,
|
|
96
96
|
projectAgentGUIAgentsToTargets
|
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
DEFAULT_AGENT_MENTION_FILTER,
|
|
102
102
|
agentGuiScheduler,
|
|
103
103
|
buildWorkspaceAgentActivityListViewModel
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-ARJ63FKZ.js";
|
|
105
105
|
import {
|
|
106
106
|
AGENT_RICH_TEXT_CARET_ANCHOR,
|
|
107
107
|
agentComposerFileMentionReferences,
|
|
@@ -118,7 +118,7 @@ import {
|
|
|
118
118
|
parseMentionItemFromHref,
|
|
119
119
|
remainingAgentComposerPromptAssetSlots,
|
|
120
120
|
updateAgentComposerFileMentions
|
|
121
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-K57GJTVC.js";
|
|
122
122
|
import {
|
|
123
123
|
AgentInteractivePromptSurface,
|
|
124
124
|
PLAN_IMPLEMENTATION_ACTION_FEEDBACK,
|
|
@@ -128,17 +128,17 @@ import {
|
|
|
128
128
|
dispatchAgentPlanPromptAction,
|
|
129
129
|
latestPlanTurnId,
|
|
130
130
|
planImplementationPromptFromPlanTurn
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-ADZL6MLR.js";
|
|
132
132
|
import {
|
|
133
133
|
useEngineSelector
|
|
134
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-EVQ4JY3N.js";
|
|
135
135
|
import {
|
|
136
136
|
AgentMessageMarkdown,
|
|
137
137
|
ZoomableImage,
|
|
138
138
|
blobToBase64,
|
|
139
139
|
normalizeAgentApprovalPurpose,
|
|
140
140
|
resolveWorkspaceLinkAction
|
|
141
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-P44BIVG6.js";
|
|
142
142
|
import {
|
|
143
143
|
AgentTargetPresentationProvider,
|
|
144
144
|
cn,
|
|
@@ -156,7 +156,7 @@ import {
|
|
|
156
156
|
useAgentHostApi,
|
|
157
157
|
useOptionalAgentActivityRuntime,
|
|
158
158
|
useOptionalAgentHostApi
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-7E2JZRSI.js";
|
|
160
160
|
import {
|
|
161
161
|
MANAGED_AGENT_ICON_FALLBACK_URL,
|
|
162
162
|
MANAGED_AGENT_ICON_URLS,
|
|
@@ -166,7 +166,7 @@ import {
|
|
|
166
166
|
AgentGuiI18nProvider,
|
|
167
167
|
translate,
|
|
168
168
|
useTranslation
|
|
169
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-CAZ7NYUE.js";
|
|
170
170
|
import {
|
|
171
171
|
isBetaAgentProvider,
|
|
172
172
|
normalizeManagedAgentProvider
|
|
@@ -182,11 +182,11 @@ import {
|
|
|
182
182
|
} from "./chunk-5CLSJWUN.js";
|
|
183
183
|
|
|
184
184
|
// AgentGUI.tsx
|
|
185
|
-
import { memo as memo15, useMemo as
|
|
185
|
+
import { memo as memo15, useMemo as useMemo48 } from "react";
|
|
186
186
|
import { TooltipProvider as TooltipProvider8 } from "@tutti-os/ui-system";
|
|
187
187
|
|
|
188
188
|
// agent-gui/agentGuiNode/AgentGUINode.tsx
|
|
189
|
-
import { memo as memo14, useCallback as
|
|
189
|
+
import { memo as memo14, useCallback as useCallback64, useMemo as useMemo47, useRef as useRef57 } from "react";
|
|
190
190
|
import { createWorkspaceUserProjectI18nRuntime } from "@tutti-os/workspace-user-project/i18n";
|
|
191
191
|
import { createWorkspaceFileManagerI18nRuntime } from "@tutti-os/workspace-file-manager";
|
|
192
192
|
import { useReferenceProvenanceFilterCatalog } from "@tutti-os/workspace-file-reference/react";
|
|
@@ -13350,11 +13350,721 @@ function useAgentGUINodeController({
|
|
|
13350
13350
|
return viewAssembly;
|
|
13351
13351
|
}
|
|
13352
13352
|
|
|
13353
|
+
// agent-gui/agentGuiNode/controller/useAgentGUIStatus.ts
|
|
13354
|
+
import { useCallback as useCallback28, useMemo as useMemo19 } from "react";
|
|
13355
|
+
|
|
13356
|
+
// agent-gui/workspaceDesktop/view/desktopDockAgentProbeTooltipModel.ts
|
|
13357
|
+
function buildDockAgentProbeTooltipLines(probe, isLoadingAvailability, t, popupOpts) {
|
|
13358
|
+
if (isLoadingAvailability && !probe) {
|
|
13359
|
+
return [t("agentHost.workspaceAgentProbeDockChecking")];
|
|
13360
|
+
}
|
|
13361
|
+
if (!probe) {
|
|
13362
|
+
return [t("agentHost.workspaceAgentProbeDockNoData")];
|
|
13363
|
+
}
|
|
13364
|
+
const lines = [];
|
|
13365
|
+
switch (probe.availability.status) {
|
|
13366
|
+
case "available":
|
|
13367
|
+
lines.push({
|
|
13368
|
+
label: t("agentHost.workspaceAgentProbeDetailStatus"),
|
|
13369
|
+
primary: t("agentHost.workspaceAgentProbeDockAvailable")
|
|
13370
|
+
});
|
|
13371
|
+
break;
|
|
13372
|
+
case "unavailable":
|
|
13373
|
+
lines.push({
|
|
13374
|
+
label: t("agentHost.workspaceAgentProbeDetailStatus"),
|
|
13375
|
+
primary: t("agentHost.workspaceAgentProbeUnavailableAria")
|
|
13376
|
+
});
|
|
13377
|
+
break;
|
|
13378
|
+
default:
|
|
13379
|
+
lines.push({
|
|
13380
|
+
label: t("agentHost.workspaceAgentProbeDetailStatus"),
|
|
13381
|
+
primary: t("agentHost.workspaceAgentProbeUnknownAria")
|
|
13382
|
+
});
|
|
13383
|
+
}
|
|
13384
|
+
if (probe.availability.status !== "available" && probe.availability.detailsVisible) {
|
|
13385
|
+
for (const check of probe.availability.checks ?? []) {
|
|
13386
|
+
if (!check.passed) {
|
|
13387
|
+
const primary = check.detail?.trim() || check.name.trim();
|
|
13388
|
+
if (!primary) {
|
|
13389
|
+
continue;
|
|
13390
|
+
}
|
|
13391
|
+
lines.push({
|
|
13392
|
+
label: check.name,
|
|
13393
|
+
primary
|
|
13394
|
+
});
|
|
13395
|
+
}
|
|
13396
|
+
}
|
|
13397
|
+
}
|
|
13398
|
+
const errMsg = probe.lastError?.message?.trim();
|
|
13399
|
+
if (errMsg && !popupOpts?.includeUsageLines) {
|
|
13400
|
+
lines.push(errMsg);
|
|
13401
|
+
}
|
|
13402
|
+
if (!popupOpts?.includeUsageLines) {
|
|
13403
|
+
return lines;
|
|
13404
|
+
}
|
|
13405
|
+
appendDockProbeUsageLines(probe, lines, popupOpts.isLoadingUsage ?? false, t);
|
|
13406
|
+
return lines;
|
|
13407
|
+
}
|
|
13408
|
+
function formatQuotaResetDisplay(quota) {
|
|
13409
|
+
if (!quota) {
|
|
13410
|
+
return void 0;
|
|
13411
|
+
}
|
|
13412
|
+
if (typeof quota.resetsAtUnixMs === "number" && Number.isFinite(quota.resetsAtUnixMs)) {
|
|
13413
|
+
return toLocalShortDateTime(quota.resetsAtUnixMs);
|
|
13414
|
+
}
|
|
13415
|
+
return quota.resetText;
|
|
13416
|
+
}
|
|
13417
|
+
function quotaTypeLabel(quotaType, t) {
|
|
13418
|
+
switch (quotaType) {
|
|
13419
|
+
case "session":
|
|
13420
|
+
return t("agentHost.workspaceAgentProbeQuotaSession");
|
|
13421
|
+
case "weekly":
|
|
13422
|
+
return t("agentHost.workspaceAgentProbeQuotaWeekly");
|
|
13423
|
+
case "monthly":
|
|
13424
|
+
return t("agentHost.workspaceAgentProbeQuotaMonthly");
|
|
13425
|
+
case "daily":
|
|
13426
|
+
return t("agentHost.workspaceAgentProbeQuotaDaily");
|
|
13427
|
+
case "cost":
|
|
13428
|
+
return t("agentHost.workspaceAgentProbeQuotaCost");
|
|
13429
|
+
default:
|
|
13430
|
+
return quotaType;
|
|
13431
|
+
}
|
|
13432
|
+
}
|
|
13433
|
+
function buildCompactDisplayQuotas(quotas, t) {
|
|
13434
|
+
const modelQuotas = quotas.filter(
|
|
13435
|
+
(quota) => quota.modelName || quota.quotaType === "model"
|
|
13436
|
+
);
|
|
13437
|
+
const nonModelQuotas = quotas.filter(
|
|
13438
|
+
(quota) => !quota.modelName && quota.quotaType !== "model"
|
|
13439
|
+
);
|
|
13440
|
+
const displayRows = nonModelQuotas.map((quota) => ({
|
|
13441
|
+
label: quota.quotaType === "session" ? "" : quotaTypeLabel(quota.quotaType, t),
|
|
13442
|
+
percentRemaining: quota.percentRemaining,
|
|
13443
|
+
dollarRemaining: quota.dollarRemaining,
|
|
13444
|
+
resetDisplay: formatQuotaResetDisplay(quota)
|
|
13445
|
+
}));
|
|
13446
|
+
if (modelQuotas.length === 0) {
|
|
13447
|
+
return displayRows;
|
|
13448
|
+
}
|
|
13449
|
+
const percentQuota = modelQuotas.filter(
|
|
13450
|
+
(quota) => typeof quota.percentRemaining === "number"
|
|
13451
|
+
).sort((left, right) => left.percentRemaining - right.percentRemaining)[0];
|
|
13452
|
+
const dollarQuota = modelQuotas.filter(
|
|
13453
|
+
(quota) => typeof quota.dollarRemaining === "number"
|
|
13454
|
+
).sort((left, right) => left.dollarRemaining - right.dollarRemaining)[0];
|
|
13455
|
+
displayRows.push({
|
|
13456
|
+
label: t("agentHost.workspaceAgentProbeAgentUsage"),
|
|
13457
|
+
percentRemaining: percentQuota?.percentRemaining,
|
|
13458
|
+
dollarRemaining: dollarQuota?.dollarRemaining,
|
|
13459
|
+
resetDisplay: formatQuotaResetDisplay(percentQuota ?? dollarQuota)
|
|
13460
|
+
});
|
|
13461
|
+
return displayRows;
|
|
13462
|
+
}
|
|
13463
|
+
function formatQuotaPrimaryLine(row, t) {
|
|
13464
|
+
if (row.percentRemaining !== void 0) {
|
|
13465
|
+
return t("agentHost.workspaceAgentProbeQuotaRemaining", {
|
|
13466
|
+
percent: Math.round(row.percentRemaining)
|
|
13467
|
+
});
|
|
13468
|
+
}
|
|
13469
|
+
if (row.dollarRemaining !== void 0) {
|
|
13470
|
+
return t("agentHost.workspaceAgentProbeQuotaDollarRemaining", {
|
|
13471
|
+
amount: row.dollarRemaining.toFixed(2)
|
|
13472
|
+
});
|
|
13473
|
+
}
|
|
13474
|
+
return null;
|
|
13475
|
+
}
|
|
13476
|
+
function appendDockProbeUsageLines(probe, lines, isLoadingUsage, t) {
|
|
13477
|
+
if (probe.lastError?.code === "unsupported") {
|
|
13478
|
+
lines.push({
|
|
13479
|
+
label: t("agentHost.workspaceAgentProbeDetailQuota"),
|
|
13480
|
+
primary: t("agentHost.workspaceAgentProbeUsageUnsupported")
|
|
13481
|
+
});
|
|
13482
|
+
return;
|
|
13483
|
+
}
|
|
13484
|
+
if (isLoadingUsage && !probe.usage) {
|
|
13485
|
+
lines.push(t("agentHost.workspaceAgentProbeLoadingUsage"));
|
|
13486
|
+
return;
|
|
13487
|
+
}
|
|
13488
|
+
const quotas = probe.usage?.quotas ?? [];
|
|
13489
|
+
if (quotas.length === 0) {
|
|
13490
|
+
lines.push({
|
|
13491
|
+
label: t("agentHost.workspaceAgentProbeDetailQuota"),
|
|
13492
|
+
primary: t("agentHost.workspaceAgentProbeUsageUnsupported")
|
|
13493
|
+
});
|
|
13494
|
+
return;
|
|
13495
|
+
}
|
|
13496
|
+
const rows = buildCompactDisplayQuotas(quotas, t);
|
|
13497
|
+
for (const row of rows) {
|
|
13498
|
+
const primary = formatQuotaPrimaryLine(row, t);
|
|
13499
|
+
const labelTrim = row.label.trim();
|
|
13500
|
+
if (primary) {
|
|
13501
|
+
const label = labelTrim || t("agentHost.workspaceAgentProbeDetailQuota");
|
|
13502
|
+
lines.push({
|
|
13503
|
+
label,
|
|
13504
|
+
primary
|
|
13505
|
+
});
|
|
13506
|
+
if (row.resetDisplay) {
|
|
13507
|
+
lines.push({
|
|
13508
|
+
label: t("agentHost.workspaceAgentProbeQuotaResetTimeLabel", {
|
|
13509
|
+
label
|
|
13510
|
+
}),
|
|
13511
|
+
primary: row.resetDisplay
|
|
13512
|
+
});
|
|
13513
|
+
}
|
|
13514
|
+
}
|
|
13515
|
+
}
|
|
13516
|
+
}
|
|
13517
|
+
|
|
13518
|
+
// agent-gui/agentGuiNode/AgentGUINode.usage.ts
|
|
13519
|
+
function slashStatusQuotaLabel(quota, t) {
|
|
13520
|
+
const modelName = quota.modelName?.trim();
|
|
13521
|
+
if (modelName) {
|
|
13522
|
+
return modelName;
|
|
13523
|
+
}
|
|
13524
|
+
switch (quota.quotaType) {
|
|
13525
|
+
case "session":
|
|
13526
|
+
return t("agentHost.agentGui.slashStatusFiveHourLimit");
|
|
13527
|
+
case "weekly":
|
|
13528
|
+
return t("agentHost.agentGui.slashStatusWeeklyLimit");
|
|
13529
|
+
case "daily":
|
|
13530
|
+
return t("agentHost.workspaceAgentProbeQuotaDaily");
|
|
13531
|
+
case "monthly":
|
|
13532
|
+
return t("agentHost.workspaceAgentProbeQuotaMonthly");
|
|
13533
|
+
case "cost":
|
|
13534
|
+
return t("agentHost.workspaceAgentProbeQuotaCost");
|
|
13535
|
+
case "model":
|
|
13536
|
+
return t("agentHost.workspaceAgentProbeAgentUsage");
|
|
13537
|
+
default:
|
|
13538
|
+
return quota.quotaType;
|
|
13539
|
+
}
|
|
13540
|
+
}
|
|
13541
|
+
function slashStatusQuotaValue(quota, t) {
|
|
13542
|
+
if (typeof quota.percentRemaining === "number" && Number.isFinite(quota.percentRemaining)) {
|
|
13543
|
+
return t("agentHost.agentGui.slashStatusLimitPercentLeft", {
|
|
13544
|
+
percent: Math.round(quota.percentRemaining)
|
|
13545
|
+
});
|
|
13546
|
+
}
|
|
13547
|
+
if (typeof quota.dollarRemaining === "number" && Number.isFinite(quota.dollarRemaining)) {
|
|
13548
|
+
return t("agentHost.workspaceAgentProbeQuotaDollarRemaining", {
|
|
13549
|
+
amount: quota.dollarRemaining.toFixed(2)
|
|
13550
|
+
});
|
|
13551
|
+
}
|
|
13552
|
+
return "";
|
|
13553
|
+
}
|
|
13554
|
+
function slashStatusQuotaReset(quota, t) {
|
|
13555
|
+
const reset = typeof quota.resetsAtUnixMs === "number" && Number.isFinite(quota.resetsAtUnixMs) ? toLocalShortDateTime(quota.resetsAtUnixMs) : quota.resetText?.trim();
|
|
13556
|
+
return reset ? t("agentHost.agentGui.slashStatusLimitReset", { reset }) : "";
|
|
13557
|
+
}
|
|
13558
|
+
function slashStatusLimitsFromQuotas(quotas, selectedModel, t) {
|
|
13559
|
+
const filteredQuotas = filterSlashStatusQuotasForModel(quotas, selectedModel);
|
|
13560
|
+
return filteredQuotas.map((quota, index) => {
|
|
13561
|
+
const value = slashStatusQuotaValue(quota, t);
|
|
13562
|
+
if (!value) {
|
|
13563
|
+
return null;
|
|
13564
|
+
}
|
|
13565
|
+
const label = slashStatusQuotaLabel(quota, t).trim();
|
|
13566
|
+
if (!label) {
|
|
13567
|
+
return null;
|
|
13568
|
+
}
|
|
13569
|
+
return {
|
|
13570
|
+
id: `${quota.quotaType}:${quota.modelName ?? ""}:${index}`,
|
|
13571
|
+
label,
|
|
13572
|
+
percentRemaining: typeof quota.percentRemaining === "number" && Number.isFinite(quota.percentRemaining) ? Math.max(0, Math.min(100, Math.round(quota.percentRemaining))) : null,
|
|
13573
|
+
value,
|
|
13574
|
+
reset: slashStatusQuotaReset(quota, t) || null
|
|
13575
|
+
};
|
|
13576
|
+
}).filter((limit) => limit !== null);
|
|
13577
|
+
}
|
|
13578
|
+
function filterSlashStatusQuotasForModel(quotas, selectedModel) {
|
|
13579
|
+
const normalizedSelectedModel = normalizeSlashStatusModelName(selectedModel);
|
|
13580
|
+
const baseQuotas = (quotas ?? []).filter(
|
|
13581
|
+
(quota) => quota.quotaType !== "model"
|
|
13582
|
+
);
|
|
13583
|
+
const matchingModelQuotas = (quotas ?? []).filter((quota) => {
|
|
13584
|
+
const quotaModelName = normalizeSlashStatusModelName(quota.modelName);
|
|
13585
|
+
return quota.quotaType === "model" && quotaModelName !== "" && normalizedSelectedModel !== "" && quotaModelName === normalizedSelectedModel;
|
|
13586
|
+
});
|
|
13587
|
+
return [...baseQuotas, ...matchingModelQuotas];
|
|
13588
|
+
}
|
|
13589
|
+
function normalizeSlashStatusModelName(value) {
|
|
13590
|
+
return value?.trim().toLowerCase().replace(/[^a-z0-9]+/gu, "-").replace(/^-+|-+$/gu, "") ?? "";
|
|
13591
|
+
}
|
|
13592
|
+
function resolveAgentGUIRailStatusProvider(input) {
|
|
13593
|
+
const filter = input.conversationFilter;
|
|
13594
|
+
if (filter.kind !== "agentTarget") {
|
|
13595
|
+
return null;
|
|
13596
|
+
}
|
|
13597
|
+
const target = input.agentTargets.find(
|
|
13598
|
+
(candidate) => candidate.disabled !== true && (candidate.agentTargetId?.trim() ?? "") === filter.agentTargetId
|
|
13599
|
+
);
|
|
13600
|
+
return target ? target.provider : null;
|
|
13601
|
+
}
|
|
13602
|
+
|
|
13603
|
+
// agent-gui/agentGuiNode/controller/AgentStatusController.ts
|
|
13604
|
+
var DEFAULT_REQUEST_TIMEOUT_MS = 3e4;
|
|
13605
|
+
var DEFAULT_RETAINED_SNAPSHOT_MS = 60 * 6e4;
|
|
13606
|
+
var DEFAULT_FORCED_REFRESH_DEBOUNCE_MS = 5e3;
|
|
13607
|
+
var IDLE_SNAPSHOT = {
|
|
13608
|
+
query: null,
|
|
13609
|
+
value: null,
|
|
13610
|
+
phase: "idle",
|
|
13611
|
+
isRefreshing: false,
|
|
13612
|
+
errorCode: null
|
|
13613
|
+
};
|
|
13614
|
+
function normalizeQuery(query) {
|
|
13615
|
+
const scopeKey = query.scopeKey.trim();
|
|
13616
|
+
if (!scopeKey) {
|
|
13617
|
+
return null;
|
|
13618
|
+
}
|
|
13619
|
+
return {
|
|
13620
|
+
scopeKey,
|
|
13621
|
+
agentSessionId: query.agentSessionId?.trim() || null,
|
|
13622
|
+
reason: query.reason,
|
|
13623
|
+
forceRefresh: query.forceRefresh === true
|
|
13624
|
+
};
|
|
13625
|
+
}
|
|
13626
|
+
function cacheKeyFor(query) {
|
|
13627
|
+
return `${query.scopeKey}\0${query.agentSessionId ?? ""}`;
|
|
13628
|
+
}
|
|
13629
|
+
function selectAgentStatusControllerSnapshot(snapshot, key) {
|
|
13630
|
+
const scopeKey = key.scopeKey.trim();
|
|
13631
|
+
const agentSessionId = key.agentSessionId?.trim() || null;
|
|
13632
|
+
if (snapshot.query?.scopeKey !== scopeKey || (snapshot.query.agentSessionId?.trim() || null) !== agentSessionId || key.reasons !== void 0 && !key.reasons.includes(snapshot.query.reason)) {
|
|
13633
|
+
return IDLE_SNAPSHOT;
|
|
13634
|
+
}
|
|
13635
|
+
return snapshot;
|
|
13636
|
+
}
|
|
13637
|
+
function createAgentStatusController(options) {
|
|
13638
|
+
const now = options.now ?? Date.now;
|
|
13639
|
+
const requestTimeoutMs = options.requestTimeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
|
|
13640
|
+
const retainedSnapshotMs = options.retainedSnapshotMs ?? DEFAULT_RETAINED_SNAPSHOT_MS;
|
|
13641
|
+
const forcedRefreshDebounceMs = options.forcedRefreshDebounceMs ?? DEFAULT_FORCED_REFRESH_DEBOUNCE_MS;
|
|
13642
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
13643
|
+
const retained = /* @__PURE__ */ new Map();
|
|
13644
|
+
const lastForcedRefreshAt = /* @__PURE__ */ new Map();
|
|
13645
|
+
let snapshot = IDLE_SNAPSHOT;
|
|
13646
|
+
let active = null;
|
|
13647
|
+
let nextRequestId = 1;
|
|
13648
|
+
const publish = (next) => {
|
|
13649
|
+
if (snapshot === next) {
|
|
13650
|
+
return;
|
|
13651
|
+
}
|
|
13652
|
+
snapshot = next;
|
|
13653
|
+
for (const listener of listeners) {
|
|
13654
|
+
listener();
|
|
13655
|
+
}
|
|
13656
|
+
};
|
|
13657
|
+
const stopActive = () => {
|
|
13658
|
+
const current = active;
|
|
13659
|
+
active = null;
|
|
13660
|
+
if (!current) {
|
|
13661
|
+
return;
|
|
13662
|
+
}
|
|
13663
|
+
if (current.timeout !== null) {
|
|
13664
|
+
current.timeout.cancel();
|
|
13665
|
+
}
|
|
13666
|
+
current.unsubscribe?.();
|
|
13667
|
+
};
|
|
13668
|
+
const finishRequest = (request) => {
|
|
13669
|
+
if (active?.id !== request.id) {
|
|
13670
|
+
return false;
|
|
13671
|
+
}
|
|
13672
|
+
active = null;
|
|
13673
|
+
if (request.timeout !== null) {
|
|
13674
|
+
request.timeout.cancel();
|
|
13675
|
+
request.timeout = null;
|
|
13676
|
+
}
|
|
13677
|
+
const unsubscribe = request.unsubscribe;
|
|
13678
|
+
request.unsubscribe = null;
|
|
13679
|
+
unsubscribe?.();
|
|
13680
|
+
return true;
|
|
13681
|
+
};
|
|
13682
|
+
const controller = {
|
|
13683
|
+
getSnapshot: () => snapshot,
|
|
13684
|
+
subscribe: (listener) => {
|
|
13685
|
+
listeners.add(listener);
|
|
13686
|
+
return () => listeners.delete(listener);
|
|
13687
|
+
},
|
|
13688
|
+
open: (requestedQuery) => {
|
|
13689
|
+
const query = normalizeQuery(requestedQuery);
|
|
13690
|
+
if (!query) {
|
|
13691
|
+
stopActive();
|
|
13692
|
+
publish({
|
|
13693
|
+
query: null,
|
|
13694
|
+
value: null,
|
|
13695
|
+
phase: "error",
|
|
13696
|
+
isRefreshing: false,
|
|
13697
|
+
errorCode: "invalid_target"
|
|
13698
|
+
});
|
|
13699
|
+
return;
|
|
13700
|
+
}
|
|
13701
|
+
const cacheKey = cacheKeyFor(query);
|
|
13702
|
+
const requestedAt = now();
|
|
13703
|
+
if (query.forceRefresh) {
|
|
13704
|
+
const previousForcedRefreshAt = lastForcedRefreshAt.get(cacheKey);
|
|
13705
|
+
if (previousForcedRefreshAt !== void 0 && requestedAt - previousForcedRefreshAt < forcedRefreshDebounceMs) {
|
|
13706
|
+
return;
|
|
13707
|
+
}
|
|
13708
|
+
lastForcedRefreshAt.set(cacheKey, requestedAt);
|
|
13709
|
+
}
|
|
13710
|
+
stopActive();
|
|
13711
|
+
const retainedEntry = retained.get(cacheKey);
|
|
13712
|
+
const retainedValue = retainedEntry && requestedAt - retainedEntry.receivedAtUnixMs <= retainedSnapshotMs ? retainedEntry.value : null;
|
|
13713
|
+
if (retainedEntry && retainedValue === null) {
|
|
13714
|
+
retained.delete(cacheKey);
|
|
13715
|
+
}
|
|
13716
|
+
const request = {
|
|
13717
|
+
id: nextRequestId++,
|
|
13718
|
+
cacheKey,
|
|
13719
|
+
frameCount: 0,
|
|
13720
|
+
lastFrameKind: null,
|
|
13721
|
+
receivedFrame: false,
|
|
13722
|
+
timeout: null,
|
|
13723
|
+
unsubscribe: null
|
|
13724
|
+
};
|
|
13725
|
+
active = request;
|
|
13726
|
+
publish({
|
|
13727
|
+
query,
|
|
13728
|
+
value: retainedValue,
|
|
13729
|
+
phase: retainedValue ? "ready" : "loading",
|
|
13730
|
+
isRefreshing: true,
|
|
13731
|
+
errorCode: null
|
|
13732
|
+
});
|
|
13733
|
+
request.timeout = agentGuiScheduler.schedule(requestTimeoutMs, () => {
|
|
13734
|
+
if (active?.id !== request.id) {
|
|
13735
|
+
return;
|
|
13736
|
+
}
|
|
13737
|
+
stopActive();
|
|
13738
|
+
publish({
|
|
13739
|
+
...snapshot,
|
|
13740
|
+
phase: snapshot.value ? "ready" : "error",
|
|
13741
|
+
isRefreshing: false,
|
|
13742
|
+
errorCode: "timeout"
|
|
13743
|
+
});
|
|
13744
|
+
});
|
|
13745
|
+
const isCurrent = () => active?.id === request.id;
|
|
13746
|
+
const observer = {
|
|
13747
|
+
onFrame: (frame) => {
|
|
13748
|
+
if (!isCurrent()) {
|
|
13749
|
+
return;
|
|
13750
|
+
}
|
|
13751
|
+
const responseSessionId = frame.value.agentSessionId?.trim() || null;
|
|
13752
|
+
const expectedSessionId = query.agentSessionId?.trim() || null;
|
|
13753
|
+
const invalidSequence = request.frameCount >= 2 || request.frameCount === 1 && (request.lastFrameKind !== "snapshot" || frame.kind !== "refreshed");
|
|
13754
|
+
if (invalidSequence || responseSessionId !== expectedSessionId) {
|
|
13755
|
+
if (!finishRequest(request)) return;
|
|
13756
|
+
publish({
|
|
13757
|
+
...snapshot,
|
|
13758
|
+
phase: snapshot.value ? "ready" : "error",
|
|
13759
|
+
isRefreshing: false,
|
|
13760
|
+
errorCode: "unavailable"
|
|
13761
|
+
});
|
|
13762
|
+
return;
|
|
13763
|
+
}
|
|
13764
|
+
request.frameCount++;
|
|
13765
|
+
request.lastFrameKind = frame.kind;
|
|
13766
|
+
request.receivedFrame = true;
|
|
13767
|
+
retained.set(cacheKey, {
|
|
13768
|
+
value: frame.value,
|
|
13769
|
+
receivedAtUnixMs: now()
|
|
13770
|
+
});
|
|
13771
|
+
publish({
|
|
13772
|
+
query,
|
|
13773
|
+
value: frame.value,
|
|
13774
|
+
phase: "ready",
|
|
13775
|
+
isRefreshing: true,
|
|
13776
|
+
errorCode: null
|
|
13777
|
+
});
|
|
13778
|
+
},
|
|
13779
|
+
onError: (error) => {
|
|
13780
|
+
if (!finishRequest(request)) {
|
|
13781
|
+
return;
|
|
13782
|
+
}
|
|
13783
|
+
publish({
|
|
13784
|
+
...snapshot,
|
|
13785
|
+
phase: snapshot.value ? "ready" : "error",
|
|
13786
|
+
isRefreshing: false,
|
|
13787
|
+
errorCode: error.code.trim() || "unavailable"
|
|
13788
|
+
});
|
|
13789
|
+
},
|
|
13790
|
+
onComplete: () => {
|
|
13791
|
+
if (!finishRequest(request)) {
|
|
13792
|
+
return;
|
|
13793
|
+
}
|
|
13794
|
+
const errorCode = request.receivedFrame ? snapshot.errorCode : "unavailable";
|
|
13795
|
+
publish({
|
|
13796
|
+
...snapshot,
|
|
13797
|
+
phase: snapshot.value ? "ready" : "error",
|
|
13798
|
+
isRefreshing: false,
|
|
13799
|
+
errorCode
|
|
13800
|
+
});
|
|
13801
|
+
}
|
|
13802
|
+
};
|
|
13803
|
+
try {
|
|
13804
|
+
const unsubscribe = options.source.open(query, observer);
|
|
13805
|
+
if (active?.id === request.id) {
|
|
13806
|
+
request.unsubscribe = unsubscribe;
|
|
13807
|
+
} else {
|
|
13808
|
+
unsubscribe();
|
|
13809
|
+
}
|
|
13810
|
+
} catch {
|
|
13811
|
+
observer.onError({ code: "unavailable" });
|
|
13812
|
+
}
|
|
13813
|
+
},
|
|
13814
|
+
close: () => {
|
|
13815
|
+
stopActive();
|
|
13816
|
+
if (snapshot.isRefreshing) {
|
|
13817
|
+
publish({ ...snapshot, isRefreshing: false });
|
|
13818
|
+
}
|
|
13819
|
+
},
|
|
13820
|
+
invalidate: (scopeKey) => {
|
|
13821
|
+
const normalizedScopeKey = scopeKey?.trim() ?? "";
|
|
13822
|
+
if (!normalizedScopeKey) {
|
|
13823
|
+
retained.clear();
|
|
13824
|
+
lastForcedRefreshAt.clear();
|
|
13825
|
+
} else {
|
|
13826
|
+
for (const key of retained.keys()) {
|
|
13827
|
+
if (key.startsWith(`${normalizedScopeKey}\0`)) {
|
|
13828
|
+
retained.delete(key);
|
|
13829
|
+
}
|
|
13830
|
+
}
|
|
13831
|
+
for (const key of lastForcedRefreshAt.keys()) {
|
|
13832
|
+
if (key.startsWith(`${normalizedScopeKey}\0`)) {
|
|
13833
|
+
lastForcedRefreshAt.delete(key);
|
|
13834
|
+
}
|
|
13835
|
+
}
|
|
13836
|
+
}
|
|
13837
|
+
if (snapshot.query && (!normalizedScopeKey || snapshot.query.scopeKey === normalizedScopeKey)) {
|
|
13838
|
+
stopActive();
|
|
13839
|
+
publish(IDLE_SNAPSHOT);
|
|
13840
|
+
}
|
|
13841
|
+
}
|
|
13842
|
+
};
|
|
13843
|
+
return controller;
|
|
13844
|
+
}
|
|
13845
|
+
|
|
13846
|
+
// agent-gui/agentGuiNode/controller/useAgentGUIStatus.ts
|
|
13847
|
+
var EMPTY_STATUS_SNAPSHOT = {
|
|
13848
|
+
query: null,
|
|
13849
|
+
value: null,
|
|
13850
|
+
phase: "idle",
|
|
13851
|
+
isRefreshing: false,
|
|
13852
|
+
errorCode: null
|
|
13853
|
+
};
|
|
13854
|
+
var EMPTY_STATUS_STORE = {
|
|
13855
|
+
getSnapshot: () => EMPTY_STATUS_SNAPSHOT,
|
|
13856
|
+
subscribe: () => () => {
|
|
13857
|
+
}
|
|
13858
|
+
};
|
|
13859
|
+
var selectStatusSnapshot = (snapshot) => snapshot;
|
|
13860
|
+
function useAgentGUIStatus(input) {
|
|
13861
|
+
const { agentStatusController, previewMode, t, viewModel } = input;
|
|
13862
|
+
const agentStatusSnapshot = useEngineSelector(
|
|
13863
|
+
agentStatusController ?? EMPTY_STATUS_STORE,
|
|
13864
|
+
selectStatusSnapshot
|
|
13865
|
+
);
|
|
13866
|
+
const activeStatusScopeKey = viewModel.rail.activeConversation?.agentTargetId?.trim() || viewModel.rail.selectedAgentTarget.agentTargetId?.trim() || viewModel.rail.selectedAgentTarget.targetId.trim();
|
|
13867
|
+
const activeStatusSessionId = viewModel.rail.activeConversationId?.trim() || viewModel.interaction.sessionChrome.rawState?.agentSessionId?.trim() || null;
|
|
13868
|
+
const railStatusProvider = useMemo19(
|
|
13869
|
+
() => resolveAgentGUIRailStatusProvider({
|
|
13870
|
+
conversationFilter: viewModel.rail.conversationFilter,
|
|
13871
|
+
agentTargets: viewModel.rail.agentTargets
|
|
13872
|
+
}),
|
|
13873
|
+
[viewModel.rail.conversationFilter, viewModel.rail.agentTargets]
|
|
13874
|
+
);
|
|
13875
|
+
const railStatusScopeKey = viewModel.rail.conversationFilter.kind === "agentTarget" ? viewModel.rail.conversationFilter.agentTargetId.trim() : activeStatusScopeKey;
|
|
13876
|
+
const activeAgentStatusSnapshot = selectAgentStatusControllerSnapshot(
|
|
13877
|
+
agentStatusSnapshot,
|
|
13878
|
+
{
|
|
13879
|
+
scopeKey: activeStatusScopeKey,
|
|
13880
|
+
agentSessionId: activeStatusSessionId,
|
|
13881
|
+
reasons: ["slash-status", "agent-info"]
|
|
13882
|
+
}
|
|
13883
|
+
);
|
|
13884
|
+
const railAgentStatusSnapshot = selectAgentStatusControllerSnapshot(
|
|
13885
|
+
agentStatusSnapshot,
|
|
13886
|
+
{
|
|
13887
|
+
scopeKey: railStatusScopeKey,
|
|
13888
|
+
agentSessionId: null,
|
|
13889
|
+
reasons: ["agent-config"]
|
|
13890
|
+
}
|
|
13891
|
+
);
|
|
13892
|
+
const agentInfoProbe = useMemo19(() => {
|
|
13893
|
+
const value = activeAgentStatusSnapshot.value;
|
|
13894
|
+
return {
|
|
13895
|
+
provider: input.activeProvider,
|
|
13896
|
+
availability: {
|
|
13897
|
+
status: "unknown",
|
|
13898
|
+
detailsVisible: false,
|
|
13899
|
+
checks: []
|
|
13900
|
+
},
|
|
13901
|
+
...value && (value.limitsState === "available" || value.quotas.length > 0) ? {
|
|
13902
|
+
usage: {
|
|
13903
|
+
quotas: [...value.quotas],
|
|
13904
|
+
capturedAtUnixMs: value.limitsCapturedAtUnixMs ?? 0
|
|
13905
|
+
}
|
|
13906
|
+
} : {},
|
|
13907
|
+
...value?.limitsState === "error" ? { lastError: { code: "runtime_unavailable" } } : {}
|
|
13908
|
+
};
|
|
13909
|
+
}, [activeAgentStatusSnapshot.value, input.activeProvider]);
|
|
13910
|
+
const agentProbeLines = useMemo19(
|
|
13911
|
+
() => buildDockAgentProbeTooltipLines(
|
|
13912
|
+
agentInfoProbe,
|
|
13913
|
+
activeAgentStatusSnapshot.phase === "loading" && activeAgentStatusSnapshot.value === null,
|
|
13914
|
+
t,
|
|
13915
|
+
{
|
|
13916
|
+
includeUsageLines: true,
|
|
13917
|
+
isLoadingUsage: activeAgentStatusSnapshot.isRefreshing && activeAgentStatusSnapshot.value === null
|
|
13918
|
+
}
|
|
13919
|
+
),
|
|
13920
|
+
[
|
|
13921
|
+
activeAgentStatusSnapshot.isRefreshing,
|
|
13922
|
+
activeAgentStatusSnapshot.phase,
|
|
13923
|
+
activeAgentStatusSnapshot.value,
|
|
13924
|
+
agentInfoProbe,
|
|
13925
|
+
t
|
|
13926
|
+
]
|
|
13927
|
+
);
|
|
13928
|
+
const requestStatus = useCallback28(
|
|
13929
|
+
(request) => {
|
|
13930
|
+
if (!previewMode) {
|
|
13931
|
+
agentStatusController?.open(request);
|
|
13932
|
+
}
|
|
13933
|
+
},
|
|
13934
|
+
[agentStatusController, previewMode]
|
|
13935
|
+
);
|
|
13936
|
+
const closeStatus = useCallback28(
|
|
13937
|
+
(reason) => {
|
|
13938
|
+
if (agentStatusSnapshot.query?.reason === reason) {
|
|
13939
|
+
agentStatusController?.close();
|
|
13940
|
+
}
|
|
13941
|
+
},
|
|
13942
|
+
[agentStatusController, agentStatusSnapshot.query?.reason]
|
|
13943
|
+
);
|
|
13944
|
+
const handleAgentProbeInfoOpen = useCallback28(() => {
|
|
13945
|
+
requestStatus({
|
|
13946
|
+
scopeKey: activeStatusScopeKey,
|
|
13947
|
+
agentSessionId: activeStatusSessionId,
|
|
13948
|
+
reason: "agent-info"
|
|
13949
|
+
});
|
|
13950
|
+
}, [activeStatusScopeKey, activeStatusSessionId, requestStatus]);
|
|
13951
|
+
const handleAgentProbeInfoClose = useCallback28(
|
|
13952
|
+
() => closeStatus("agent-info"),
|
|
13953
|
+
[closeStatus]
|
|
13954
|
+
);
|
|
13955
|
+
const handleAgentConfigMenuOpen = useCallback28(() => {
|
|
13956
|
+
requestStatus({
|
|
13957
|
+
scopeKey: railStatusScopeKey,
|
|
13958
|
+
agentSessionId: null,
|
|
13959
|
+
reason: "agent-config"
|
|
13960
|
+
});
|
|
13961
|
+
}, [railStatusScopeKey, requestStatus]);
|
|
13962
|
+
const handleAgentConfigMenuClose = useCallback28(
|
|
13963
|
+
() => closeStatus("agent-config"),
|
|
13964
|
+
[closeStatus]
|
|
13965
|
+
);
|
|
13966
|
+
const handleAgentUsageRefresh = useCallback28(() => {
|
|
13967
|
+
requestStatus({
|
|
13968
|
+
scopeKey: railStatusScopeKey,
|
|
13969
|
+
agentSessionId: null,
|
|
13970
|
+
reason: "agent-config",
|
|
13971
|
+
forceRefresh: true
|
|
13972
|
+
});
|
|
13973
|
+
}, [railStatusScopeKey, requestStatus]);
|
|
13974
|
+
const handleSlashStatusClose = useCallback28(
|
|
13975
|
+
() => closeStatus("slash-status"),
|
|
13976
|
+
[closeStatus]
|
|
13977
|
+
);
|
|
13978
|
+
const handleSlashStatusOpen = useCallback28(() => {
|
|
13979
|
+
requestStatus({
|
|
13980
|
+
scopeKey: activeStatusScopeKey,
|
|
13981
|
+
agentSessionId: activeStatusSessionId,
|
|
13982
|
+
reason: "slash-status"
|
|
13983
|
+
});
|
|
13984
|
+
}, [activeStatusScopeKey, activeStatusSessionId, requestStatus]);
|
|
13985
|
+
const handleSlashStatusRefresh = useCallback28(() => {
|
|
13986
|
+
requestStatus({
|
|
13987
|
+
scopeKey: activeStatusScopeKey,
|
|
13988
|
+
agentSessionId: activeStatusSessionId,
|
|
13989
|
+
reason: "slash-status",
|
|
13990
|
+
forceRefresh: true
|
|
13991
|
+
});
|
|
13992
|
+
}, [activeStatusScopeKey, activeStatusSessionId, requestStatus]);
|
|
13993
|
+
const agentStatusLimits = useMemo19(
|
|
13994
|
+
() => slashStatusLimitsFromQuotas(
|
|
13995
|
+
activeAgentStatusSnapshot.value?.quotas,
|
|
13996
|
+
viewModel.composer.composerSettings.selectedModelValue ?? viewModel.composer.composerSettings.draftSettings.model,
|
|
13997
|
+
t
|
|
13998
|
+
),
|
|
13999
|
+
[
|
|
14000
|
+
activeAgentStatusSnapshot.value?.quotas,
|
|
14001
|
+
t,
|
|
14002
|
+
viewModel.composer.composerSettings.draftSettings.model,
|
|
14003
|
+
viewModel.composer.composerSettings.selectedModelValue
|
|
14004
|
+
]
|
|
14005
|
+
);
|
|
14006
|
+
const railAgentStatusLimits = useMemo19(
|
|
14007
|
+
() => slashStatusLimitsFromQuotas(
|
|
14008
|
+
railAgentStatusSnapshot.value?.quotas,
|
|
14009
|
+
null,
|
|
14010
|
+
t
|
|
14011
|
+
),
|
|
14012
|
+
[railAgentStatusSnapshot.value?.quotas, t]
|
|
14013
|
+
);
|
|
14014
|
+
const slashStatusOverride = useMemo19(() => {
|
|
14015
|
+
if (!agentStatusController) return null;
|
|
14016
|
+
const value = activeAgentStatusSnapshot.value;
|
|
14017
|
+
return {
|
|
14018
|
+
agentSessionId: value?.agentSessionId ?? activeStatusSessionId,
|
|
14019
|
+
contextWindow: value?.contextWindow ?? null,
|
|
14020
|
+
limits: agentStatusLimits,
|
|
14021
|
+
limitsLoading: activeAgentStatusSnapshot.phase === "loading" && value === null,
|
|
14022
|
+
limitsUnavailable: activeAgentStatusSnapshot.phase === "error" || value !== null && value.limitsState !== "available",
|
|
14023
|
+
limitsResolvedEmpty: value?.limitsState === "available" && agentStatusLimits.length === 0,
|
|
14024
|
+
limitsCapturedAtUnixMs: value?.limitsCapturedAtUnixMs ?? null,
|
|
14025
|
+
refreshFailed: activeAgentStatusSnapshot.errorCode !== null || value?.limitsState === "error",
|
|
14026
|
+
isRefreshing: activeAgentStatusSnapshot.isRefreshing
|
|
14027
|
+
};
|
|
14028
|
+
}, [
|
|
14029
|
+
activeAgentStatusSnapshot.errorCode,
|
|
14030
|
+
activeAgentStatusSnapshot.isRefreshing,
|
|
14031
|
+
activeAgentStatusSnapshot.phase,
|
|
14032
|
+
activeAgentStatusSnapshot.value,
|
|
14033
|
+
activeStatusSessionId,
|
|
14034
|
+
agentStatusController,
|
|
14035
|
+
agentStatusLimits
|
|
14036
|
+
]);
|
|
14037
|
+
const controllerRailStatus = agentStatusController ? {
|
|
14038
|
+
limits: railAgentStatusLimits,
|
|
14039
|
+
loading: railAgentStatusSnapshot.phase === "loading" && railAgentStatusSnapshot.value === null,
|
|
14040
|
+
capturedAtUnixMs: railAgentStatusSnapshot.value?.limitsCapturedAtUnixMs ?? null,
|
|
14041
|
+
didFail: railAgentStatusSnapshot.errorCode !== null || railAgentStatusSnapshot.value?.limitsState === "error",
|
|
14042
|
+
attempted: railAgentStatusSnapshot.value !== null || railAgentStatusSnapshot.errorCode !== null,
|
|
14043
|
+
resolvedEmpty: railAgentStatusSnapshot.value?.limitsState === "available" && railAgentStatusLimits.length === 0
|
|
14044
|
+
} : null;
|
|
14045
|
+
return {
|
|
14046
|
+
agentProbeLines,
|
|
14047
|
+
controllerRailStatus,
|
|
14048
|
+
handleAgentConfigMenuClose,
|
|
14049
|
+
handleAgentConfigMenuOpen,
|
|
14050
|
+
handleAgentProbeInfoClose,
|
|
14051
|
+
handleAgentProbeInfoOpen,
|
|
14052
|
+
handleAgentUsageRefresh,
|
|
14053
|
+
handleSlashStatusClose,
|
|
14054
|
+
handleSlashStatusOpen,
|
|
14055
|
+
handleSlashStatusRefresh,
|
|
14056
|
+
railStatusProvider,
|
|
14057
|
+
slashStatusLimits: agentStatusLimits,
|
|
14058
|
+
slashStatusLimitsUnavailable: activeAgentStatusSnapshot.phase === "error" || activeAgentStatusSnapshot.value !== null && activeAgentStatusSnapshot.value.limitsState !== "available",
|
|
14059
|
+
slashStatusOverride
|
|
14060
|
+
};
|
|
14061
|
+
}
|
|
14062
|
+
|
|
13353
14063
|
// agent-gui/agentGuiNode/AgentGUINodeView.tsx
|
|
13354
14064
|
import {
|
|
13355
|
-
useCallback as
|
|
14065
|
+
useCallback as useCallback62,
|
|
13356
14066
|
useEffect as useEffect38,
|
|
13357
|
-
useMemo as
|
|
14067
|
+
useMemo as useMemo44,
|
|
13358
14068
|
useRef as useRef55,
|
|
13359
14069
|
useState as useState44
|
|
13360
14070
|
} from "react";
|
|
@@ -13571,7 +14281,7 @@ var styles = {
|
|
|
13571
14281
|
var AgentGUINode_styles_default = styles;
|
|
13572
14282
|
|
|
13573
14283
|
// agent-gui/agentGuiNode/view/agentGUIViewUtils.ts
|
|
13574
|
-
import { useCallback as
|
|
14284
|
+
import { useCallback as useCallback29, useLayoutEffect, useMemo as useMemo20, useRef as useRef21 } from "react";
|
|
13575
14285
|
function objectRecord(value) {
|
|
13576
14286
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
13577
14287
|
}
|
|
@@ -13593,14 +14303,14 @@ function useStableEventCallback(callback) {
|
|
|
13593
14303
|
useLayoutEffect(() => {
|
|
13594
14304
|
callbackRef.current = callback;
|
|
13595
14305
|
}, [callback]);
|
|
13596
|
-
return
|
|
14306
|
+
return useCallback29((...args) => callbackRef.current(...args), []);
|
|
13597
14307
|
}
|
|
13598
14308
|
function useOptionalStableEventCallback(callback) {
|
|
13599
14309
|
const callbackRef = useRef21(callback);
|
|
13600
14310
|
useLayoutEffect(() => {
|
|
13601
14311
|
callbackRef.current = callback;
|
|
13602
14312
|
}, [callback]);
|
|
13603
|
-
return
|
|
14313
|
+
return useMemo20(() => {
|
|
13604
14314
|
if (callback == null) {
|
|
13605
14315
|
return void 0;
|
|
13606
14316
|
}
|
|
@@ -13627,7 +14337,7 @@ function conversationPlainTitle(conversation, labels, uiLanguage) {
|
|
|
13627
14337
|
}
|
|
13628
14338
|
|
|
13629
14339
|
// agent-gui/agentGuiNode/view/AgentGUIAccountConfig.tsx
|
|
13630
|
-
import { memo, useCallback as
|
|
14340
|
+
import { memo, useCallback as useCallback30, useEffect as useEffect15, useState as useState9 } from "react";
|
|
13631
14341
|
import {
|
|
13632
14342
|
Coins,
|
|
13633
14343
|
Crown as Crown2,
|
|
@@ -13898,7 +14608,7 @@ var AgentGUIAccountRailMenu = memo(function AgentGUIAccountRailMenu2({
|
|
|
13898
14608
|
const membershipLabel = accountMenuState.membershipLabel.trim() || labels.accountMenuFree;
|
|
13899
14609
|
const creditsLabel = accountMenuState.loading && !accountMenuState.creditsLabel ? labels.accountMenuLoading : accountMenuState.creditsLabel ?? labels.accountMenuUnavailable;
|
|
13900
14610
|
const errorLabel = accountMenuState.error || (accountMenuState.partialError ? labels.accountMenuDataUnavailable : null);
|
|
13901
|
-
const openExternal =
|
|
14611
|
+
const openExternal = useCallback30(
|
|
13902
14612
|
(url) => {
|
|
13903
14613
|
accountMenuState.onOpenExternal(url);
|
|
13904
14614
|
},
|
|
@@ -14096,12 +14806,14 @@ function AgentGUIConfigMenu({
|
|
|
14096
14806
|
providerScopedActionsVisible,
|
|
14097
14807
|
slashStatusLimits,
|
|
14098
14808
|
slashStatusLimitsLoading,
|
|
14809
|
+
slashStatusLimitsResolvedEmpty,
|
|
14099
14810
|
slashStatusUsageCapturedAtUnixMs,
|
|
14100
14811
|
slashStatusUsageDidFail,
|
|
14101
14812
|
slashStatusUsageAttempted,
|
|
14102
14813
|
provider,
|
|
14103
14814
|
providerAuthAccountLabel,
|
|
14104
14815
|
onAgentConfigMenuOpen,
|
|
14816
|
+
onAgentConfigMenuClose,
|
|
14105
14817
|
onAgentUsageRefresh,
|
|
14106
14818
|
onOpenAgentEnvSetup,
|
|
14107
14819
|
onOpenAgentSettings
|
|
@@ -14118,6 +14830,8 @@ function AgentGUIConfigMenu({
|
|
|
14118
14830
|
setOpen(nextOpen);
|
|
14119
14831
|
if (nextOpen) {
|
|
14120
14832
|
onAgentConfigMenuOpen?.();
|
|
14833
|
+
} else {
|
|
14834
|
+
onAgentConfigMenuClose?.();
|
|
14121
14835
|
}
|
|
14122
14836
|
},
|
|
14123
14837
|
children: [
|
|
@@ -14179,7 +14893,7 @@ function AgentGUIConfigMenu({
|
|
|
14179
14893
|
{
|
|
14180
14894
|
className: "min-w-0 truncate text-[var(--text-tertiary)]",
|
|
14181
14895
|
"data-testid": "agent-gui-config-usage-unavailable",
|
|
14182
|
-
children: labels.slashStatusLimitsUnavailable
|
|
14896
|
+
children: slashStatusLimitsResolvedEmpty ? labels.slashStatusEmptyValue : labels.slashStatusLimitsUnavailable
|
|
14183
14897
|
}
|
|
14184
14898
|
) : null
|
|
14185
14899
|
] }),
|
|
@@ -14256,8 +14970,8 @@ function AgentGUIConfigMenu({
|
|
|
14256
14970
|
// agent-gui/agentGuiNode/view/AgentGUIProviderRail.tsx
|
|
14257
14971
|
import {
|
|
14258
14972
|
memo as memo4,
|
|
14259
|
-
useCallback as
|
|
14260
|
-
useMemo as
|
|
14973
|
+
useCallback as useCallback47,
|
|
14974
|
+
useMemo as useMemo35,
|
|
14261
14975
|
useRef as useRef42,
|
|
14262
14976
|
useState as useState30
|
|
14263
14977
|
} from "react";
|
|
@@ -14482,7 +15196,7 @@ function changeAgentGUIProviderManagerVisibility(input) {
|
|
|
14482
15196
|
}
|
|
14483
15197
|
|
|
14484
15198
|
// agent-gui/agentGuiNode/view/AgentGUIEmptyState.tsx
|
|
14485
|
-
import { memo as memo3, useMemo as
|
|
15199
|
+
import { memo as memo3, useMemo as useMemo34 } from "react";
|
|
14486
15200
|
import {
|
|
14487
15201
|
Select as Select5,
|
|
14488
15202
|
SelectContent as SelectContent5,
|
|
@@ -15830,7 +16544,7 @@ import { Button as Button2 } from "@tutti-os/ui-system";
|
|
|
15830
16544
|
// app/renderer/components/icons/CastIcon.tsx
|
|
15831
16545
|
import {
|
|
15832
16546
|
forwardRef as forwardRef2,
|
|
15833
|
-
useCallback as
|
|
16547
|
+
useCallback as useCallback31,
|
|
15834
16548
|
useEffect as useEffect16,
|
|
15835
16549
|
useImperativeHandle,
|
|
15836
16550
|
useRef as useRef22
|
|
@@ -15865,13 +16579,13 @@ var CastIcon = forwardRef2(
|
|
|
15865
16579
|
const controls = useAnimation();
|
|
15866
16580
|
const reduceMotion = useReducedMotion();
|
|
15867
16581
|
const isControlledRef = useRef22(false);
|
|
15868
|
-
const startAnimation =
|
|
16582
|
+
const startAnimation = useCallback31(() => {
|
|
15869
16583
|
if (reduceMotion) {
|
|
15870
16584
|
return;
|
|
15871
16585
|
}
|
|
15872
16586
|
void controls.start("animate");
|
|
15873
16587
|
}, [controls, reduceMotion]);
|
|
15874
|
-
const stopAnimation =
|
|
16588
|
+
const stopAnimation = useCallback31(() => {
|
|
15875
16589
|
void controls.start("normal");
|
|
15876
16590
|
}, [controls]);
|
|
15877
16591
|
useImperativeHandle(ref, () => {
|
|
@@ -15888,7 +16602,7 @@ var CastIcon = forwardRef2(
|
|
|
15888
16602
|
}
|
|
15889
16603
|
stopAnimation();
|
|
15890
16604
|
}, [active, startAnimation, stopAnimation]);
|
|
15891
|
-
const handleMouseEnter =
|
|
16605
|
+
const handleMouseEnter = useCallback31(
|
|
15892
16606
|
(event) => {
|
|
15893
16607
|
if (isControlledRef.current) {
|
|
15894
16608
|
onMouseEnter?.(event);
|
|
@@ -15898,7 +16612,7 @@ var CastIcon = forwardRef2(
|
|
|
15898
16612
|
},
|
|
15899
16613
|
[onMouseEnter, startAnimation]
|
|
15900
16614
|
);
|
|
15901
|
-
const handleMouseLeave =
|
|
16615
|
+
const handleMouseLeave = useCallback31(
|
|
15902
16616
|
(event) => {
|
|
15903
16617
|
if (isControlledRef.current) {
|
|
15904
16618
|
onMouseLeave?.(event);
|
|
@@ -16184,7 +16898,7 @@ function AgentSessionChrome({
|
|
|
16184
16898
|
}
|
|
16185
16899
|
|
|
16186
16900
|
// agent-gui/agentGuiNode/AgentComposer.tsx
|
|
16187
|
-
import { useCallback as
|
|
16901
|
+
import { useCallback as useCallback44, useEffect as useEffect28, useRef as useRef39, useState as useState26 } from "react";
|
|
16188
16902
|
import { repairMentionPaletteHighlight } from "@tutti-os/ui-rich-text/at-panel";
|
|
16189
16903
|
|
|
16190
16904
|
// agent-gui/agentGuiNode/AgentSlashStatusPanel.tsx
|
|
@@ -16217,11 +16931,11 @@ function slashStatusContextText(status, labels) {
|
|
|
16217
16931
|
function AgentSlashStatusPanel({
|
|
16218
16932
|
status,
|
|
16219
16933
|
labels,
|
|
16220
|
-
onClose
|
|
16934
|
+
onClose,
|
|
16935
|
+
onRefresh
|
|
16221
16936
|
}) {
|
|
16222
16937
|
const limits = status?.limits ?? [];
|
|
16223
16938
|
const agentSessionId = status?.agentSessionId?.trim() ?? "";
|
|
16224
|
-
const baseUrl = status?.baseUrl?.trim() ?? "";
|
|
16225
16939
|
const showSessionDetails = agentSessionId.length > 0;
|
|
16226
16940
|
return /* @__PURE__ */ jsxs13(
|
|
16227
16941
|
"section",
|
|
@@ -16232,15 +16946,35 @@ function AgentSlashStatusPanel({
|
|
|
16232
16946
|
children: [
|
|
16233
16947
|
/* @__PURE__ */ jsxs13("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
16234
16948
|
/* @__PURE__ */ jsx20("h3", { className: "truncate text-[11px] font-semibold leading-4", children: labels.slashStatusTitle }),
|
|
16235
|
-
/* @__PURE__ */
|
|
16236
|
-
|
|
16237
|
-
|
|
16238
|
-
|
|
16239
|
-
|
|
16240
|
-
|
|
16241
|
-
|
|
16242
|
-
|
|
16243
|
-
|
|
16949
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
16950
|
+
onRefresh ? /* @__PURE__ */ jsx20(
|
|
16951
|
+
AgentProbeUsageFreshness,
|
|
16952
|
+
{
|
|
16953
|
+
capturedAtUnixMs: status?.limitsCapturedAtUnixMs ?? null,
|
|
16954
|
+
isLoading: status?.isRefreshing === true,
|
|
16955
|
+
didFail: status?.refreshFailed === true,
|
|
16956
|
+
onRefresh,
|
|
16957
|
+
labels: {
|
|
16958
|
+
justUpdated: labels.slashStatusUsageJustUpdated,
|
|
16959
|
+
minutesAgo: labels.slashStatusUsageMinutesAgo,
|
|
16960
|
+
hoursAgo: labels.slashStatusUsageHoursAgo,
|
|
16961
|
+
updating: labels.slashStatusUsageUpdating,
|
|
16962
|
+
refreshFailed: labels.slashStatusUsageRefreshFailed,
|
|
16963
|
+
refreshAria: labels.slashStatusUsageRefreshAria
|
|
16964
|
+
},
|
|
16965
|
+
testId: "agent-gui-slash-status-refresh"
|
|
16966
|
+
}
|
|
16967
|
+
) : null,
|
|
16968
|
+
/* @__PURE__ */ jsx20(
|
|
16969
|
+
"button",
|
|
16970
|
+
{
|
|
16971
|
+
className: "nodrag shrink-0 rounded-[5px] px-1.5 py-0.5 text-[11px] leading-4 text-muted-foreground transition-colors hover:bg-background-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [-webkit-app-region:no-drag]",
|
|
16972
|
+
type: "button",
|
|
16973
|
+
onClick: onClose,
|
|
16974
|
+
children: labels.slashStatusClose
|
|
16975
|
+
}
|
|
16976
|
+
)
|
|
16977
|
+
] })
|
|
16244
16978
|
] }),
|
|
16245
16979
|
/* @__PURE__ */ jsxs13("dl", { className: "grid grid-cols-[max-content_minmax(0,1fr)] gap-x-3 gap-y-1 font-mono text-[11px] leading-4", children: [
|
|
16246
16980
|
showSessionDetails ? /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
@@ -16248,20 +16982,13 @@ function AgentSlashStatusPanel({
|
|
|
16248
16982
|
labels.slashStatusSession,
|
|
16249
16983
|
":"
|
|
16250
16984
|
] }),
|
|
16251
|
-
/* @__PURE__ */ jsx20("dd", { className: "min-w-0 truncate", children: agentSessionId })
|
|
16252
|
-
baseUrl ? /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
16253
|
-
/* @__PURE__ */ jsxs13("dt", { className: "text-muted-foreground", children: [
|
|
16254
|
-
labels.slashStatusBaseUrl,
|
|
16255
|
-
":"
|
|
16256
|
-
] }),
|
|
16257
|
-
/* @__PURE__ */ jsx20("dd", { className: "min-w-0 truncate", children: baseUrl })
|
|
16258
|
-
] }) : null,
|
|
16259
|
-
/* @__PURE__ */ jsxs13("dt", { className: "text-muted-foreground", children: [
|
|
16260
|
-
labels.slashStatusContext,
|
|
16261
|
-
":"
|
|
16262
|
-
] }),
|
|
16263
|
-
/* @__PURE__ */ jsx20("dd", { className: "min-w-0", children: slashStatusContextText(status, labels) })
|
|
16985
|
+
/* @__PURE__ */ jsx20("dd", { className: "min-w-0 truncate", children: agentSessionId })
|
|
16264
16986
|
] }) : null,
|
|
16987
|
+
/* @__PURE__ */ jsxs13("dt", { className: "text-muted-foreground", children: [
|
|
16988
|
+
labels.slashStatusContext,
|
|
16989
|
+
":"
|
|
16990
|
+
] }),
|
|
16991
|
+
/* @__PURE__ */ jsx20("dd", { className: "min-w-0", children: slashStatusContextText(status, labels) }),
|
|
16265
16992
|
limits.map((limit) => /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
16266
16993
|
/* @__PURE__ */ jsxs13("dt", { className: "text-muted-foreground", children: [
|
|
16267
16994
|
limit.label,
|
|
@@ -16298,12 +17025,12 @@ function AgentSlashStatusPanel({
|
|
|
16298
17025
|
] })
|
|
16299
17026
|
] }) })
|
|
16300
17027
|
] }, limit.id)),
|
|
16301
|
-
limits.length === 0 && status?.limitsUnavailable ? /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
17028
|
+
limits.length === 0 && (status?.limitsUnavailable || status?.limitsResolvedEmpty || status?.limitsLoading) ? /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
16302
17029
|
/* @__PURE__ */ jsxs13("dt", { className: "text-muted-foreground", children: [
|
|
16303
17030
|
labels.slashStatusLimits,
|
|
16304
17031
|
":"
|
|
16305
17032
|
] }),
|
|
16306
|
-
/* @__PURE__ */ jsx20("dd", { className: "min-w-0 text-muted-foreground", children: labels.slashStatusLimitsUnavailable })
|
|
17033
|
+
/* @__PURE__ */ jsx20("dd", { className: "min-w-0 text-muted-foreground", children: status?.limitsLoading ? labels.slashStatusUsageUpdating : status?.limitsResolvedEmpty ? labels.slashStatusEmptyValue : labels.slashStatusLimitsUnavailable })
|
|
16307
17034
|
] }) : null
|
|
16308
17035
|
] })
|
|
16309
17036
|
]
|
|
@@ -16314,7 +17041,7 @@ function AgentSlashStatusPanel({
|
|
|
16314
17041
|
// agent-gui/agentGuiNode/composer/useComposerDraftAttachments.ts
|
|
16315
17042
|
import { flushSync as flushSync3 } from "react-dom";
|
|
16316
17043
|
import {
|
|
16317
|
-
useCallback as
|
|
17044
|
+
useCallback as useCallback32,
|
|
16318
17045
|
useRef as useRef23
|
|
16319
17046
|
} from "react";
|
|
16320
17047
|
|
|
@@ -16397,7 +17124,7 @@ function agentComposerDevConsoleDiagnosticSinkEnabled(runtime) {
|
|
|
16397
17124
|
function useStableEventCallback2(callback) {
|
|
16398
17125
|
const callbackRef = useRef23(callback);
|
|
16399
17126
|
callbackRef.current = callback;
|
|
16400
|
-
return
|
|
17127
|
+
return useCallback32((...args) => callbackRef.current(...args), []);
|
|
16401
17128
|
}
|
|
16402
17129
|
function useComposerDraftAttachments({
|
|
16403
17130
|
workspaceId,
|
|
@@ -16495,7 +17222,7 @@ function useComposerDraftAttachments({
|
|
|
16495
17222
|
);
|
|
16496
17223
|
}
|
|
16497
17224
|
);
|
|
16498
|
-
const clearGoalModeBadge =
|
|
17225
|
+
const clearGoalModeBadge = useCallback32(() => {
|
|
16499
17226
|
if (!isGoalModeActive) {
|
|
16500
17227
|
return;
|
|
16501
17228
|
}
|
|
@@ -16507,7 +17234,7 @@ function useComposerDraftAttachments({
|
|
|
16507
17234
|
(currentDraft) => updateDraftPromptAndReconcileFiles(currentDraft, nextPrompt)
|
|
16508
17235
|
);
|
|
16509
17236
|
}, [draftScopeKey, goalDraftObjective, isGoalModeActive, updateScopedDraft]);
|
|
16510
|
-
const addDraftImages =
|
|
17237
|
+
const addDraftImages = useCallback32(
|
|
16511
17238
|
(images) => {
|
|
16512
17239
|
if (images.length === 0) {
|
|
16513
17240
|
return;
|
|
@@ -16660,7 +17387,7 @@ function useComposerDraftAttachments({
|
|
|
16660
17387
|
workspaceId
|
|
16661
17388
|
]
|
|
16662
17389
|
);
|
|
16663
|
-
const removeDraftImage =
|
|
17390
|
+
const removeDraftImage = useCallback32(
|
|
16664
17391
|
(id) => {
|
|
16665
17392
|
const nextDraftImages = draftImagesRef.current.filter(
|
|
16666
17393
|
(image) => image.id !== id
|
|
@@ -16678,7 +17405,7 @@ function useComposerDraftAttachments({
|
|
|
16678
17405
|
},
|
|
16679
17406
|
[draftScopeKey, publishScopedDraft]
|
|
16680
17407
|
);
|
|
16681
|
-
const addDraftFiles =
|
|
17408
|
+
const addDraftFiles = useCallback32(
|
|
16682
17409
|
(files) => {
|
|
16683
17410
|
if (files.length === 0 || !promptFilesSupported || !prepareExternalPromptFiles || !editorHandleRef.current) {
|
|
16684
17411
|
return;
|
|
@@ -16806,7 +17533,7 @@ function useComposerDraftAttachments({
|
|
|
16806
17533
|
workspaceId
|
|
16807
17534
|
]
|
|
16808
17535
|
);
|
|
16809
|
-
const removeDraftLargeText =
|
|
17536
|
+
const removeDraftLargeText = useCallback32(
|
|
16810
17537
|
(id) => {
|
|
16811
17538
|
const nextDraftLargeTexts = draftLargeTextsRef.current.filter(
|
|
16812
17539
|
(item) => item.id !== id
|
|
@@ -16824,7 +17551,7 @@ function useComposerDraftAttachments({
|
|
|
16824
17551
|
},
|
|
16825
17552
|
[draftScopeKey, publishScopedDraft]
|
|
16826
17553
|
);
|
|
16827
|
-
const expandDraftLargeTextToPrompt =
|
|
17554
|
+
const expandDraftLargeTextToPrompt = useCallback32(
|
|
16828
17555
|
(id) => {
|
|
16829
17556
|
const item = draftLargeTextsRef.current.find((entry) => entry.id === id);
|
|
16830
17557
|
if (!item || !item.text.trim()) {
|
|
@@ -16854,7 +17581,7 @@ ${item.text}` : item.text;
|
|
|
16854
17581
|
},
|
|
16855
17582
|
[draftScopeKey, publishScopedDraft]
|
|
16856
17583
|
);
|
|
16857
|
-
const handlePastedLargeText =
|
|
17584
|
+
const handlePastedLargeText = useCallback32(
|
|
16858
17585
|
(text) => {
|
|
16859
17586
|
const normalizedText = text.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
16860
17587
|
if (!normalizedText.trim()) {
|
|
@@ -16945,7 +17672,7 @@ ${item.text}` : item.text;
|
|
|
16945
17672
|
workspaceId
|
|
16946
17673
|
]
|
|
16947
17674
|
);
|
|
16948
|
-
const applyReferencePickResult =
|
|
17675
|
+
const applyReferencePickResult = useCallback32(
|
|
16949
17676
|
async (result) => {
|
|
16950
17677
|
if (result.files.length > 0) {
|
|
16951
17678
|
editorHandleRef.current?.insertWorkspaceReferences(result.files);
|
|
@@ -16956,13 +17683,13 @@ ${item.text}` : item.text;
|
|
|
16956
17683
|
},
|
|
16957
17684
|
[]
|
|
16958
17685
|
);
|
|
16959
|
-
const handleWorkspaceReferencePicker =
|
|
17686
|
+
const handleWorkspaceReferencePicker = useCallback32(async () => {
|
|
16960
17687
|
if (!onRequestWorkspaceReferences) {
|
|
16961
17688
|
return;
|
|
16962
17689
|
}
|
|
16963
17690
|
await applyReferencePickResult(await onRequestWorkspaceReferences());
|
|
16964
17691
|
}, [applyReferencePickResult, onRequestWorkspaceReferences]);
|
|
16965
|
-
const handleOpenReferencesForEntity =
|
|
17692
|
+
const handleOpenReferencesForEntity = useCallback32(
|
|
16966
17693
|
(entity) => {
|
|
16967
17694
|
if (!onRequestWorkspaceReferences) {
|
|
16968
17695
|
return;
|
|
@@ -16982,7 +17709,7 @@ ${item.text}` : item.text;
|
|
|
16982
17709
|
);
|
|
16983
17710
|
openReferencesForEntityRef.current = handleOpenReferencesForEntity;
|
|
16984
17711
|
openReferencesForEntityRef.current = handleOpenReferencesForEntity;
|
|
16985
|
-
const handleLinkClick =
|
|
17712
|
+
const handleLinkClick = useCallback32(
|
|
16986
17713
|
(href) => {
|
|
16987
17714
|
const item = parseMentionItemFromHref({ name: "", href });
|
|
16988
17715
|
if (item?.kind === "workspace-reference") {
|
|
@@ -17018,7 +17745,7 @@ ${item.text}` : item.text;
|
|
|
17018
17745
|
// agent-gui/agentGuiNode/composer/useComposerLayout.ts
|
|
17019
17746
|
import {
|
|
17020
17747
|
useLayoutEffect as useLayoutEffect2,
|
|
17021
|
-
useMemo as
|
|
17748
|
+
useMemo as useMemo21
|
|
17022
17749
|
} from "react";
|
|
17023
17750
|
var DOCK_COMPOSER_INPUT_MIN_HEIGHT = 56;
|
|
17024
17751
|
var DOCK_COMPOSER_TEXT_LINE_HEIGHT = 24;
|
|
@@ -17221,7 +17948,7 @@ function useComposerLayout({
|
|
|
17221
17948
|
resizeObserver?.disconnect();
|
|
17222
17949
|
};
|
|
17223
17950
|
}, [draftImages.length, draftLargeTexts.length, isHeroLayout]);
|
|
17224
|
-
const composerStyle =
|
|
17951
|
+
const composerStyle = useMemo21(
|
|
17225
17952
|
() => isHeroLayout ? void 0 : {
|
|
17226
17953
|
// The dock keeps only the collapsed 56px input row in flow; a
|
|
17227
17954
|
// growing draft overhangs upward past the composer's top edge.
|
|
@@ -17235,11 +17962,11 @@ function useComposerLayout({
|
|
|
17235
17962
|
},
|
|
17236
17963
|
[dockComposerInputHeight, isHeroLayout]
|
|
17237
17964
|
);
|
|
17238
|
-
const inputShellStyle =
|
|
17965
|
+
const inputShellStyle = useMemo21(
|
|
17239
17966
|
() => showFileMentionPalette || showFloatingCommandMenu ? { zIndex: COMPOSER_PALETTE_Z_INDEX } : void 0,
|
|
17240
17967
|
[showFileMentionPalette, showFloatingCommandMenu]
|
|
17241
17968
|
);
|
|
17242
|
-
const promptInputAreaStyle =
|
|
17969
|
+
const promptInputAreaStyle = useMemo21(
|
|
17243
17970
|
() => isHeroLayout ? void 0 : {
|
|
17244
17971
|
"--agent-gui-composer-attachment-height": `${dockComposerAttachmentHeight}px`,
|
|
17245
17972
|
"--agent-gui-composer-input-height": `${dockComposerInputHeight}px`,
|
|
@@ -17273,7 +18000,7 @@ function useComposerLayout({
|
|
|
17273
18000
|
}
|
|
17274
18001
|
|
|
17275
18002
|
// agent-gui/agentGuiNode/composer/useComposerPaletteCatalog.ts
|
|
17276
|
-
import { useMemo as
|
|
18003
|
+
import { useMemo as useMemo22 } from "react";
|
|
17277
18004
|
|
|
17278
18005
|
// agent-gui/agentGuiNode/composer/slashCommandDisplay.ts
|
|
17279
18006
|
function slashCommandDescriptionForDisplay(command, labels) {
|
|
@@ -17354,7 +18081,7 @@ function useComposerPaletteCatalog({
|
|
|
17354
18081
|
const promptBeforeSelection = editorHandleRef.current?.getPromptTextBeforeSelection() ?? "";
|
|
17355
18082
|
const skillQueryDraft = promptBeforeSelection || paletteDraftPrompt;
|
|
17356
18083
|
const skillQueryMatch = getAgentComposerTriggerQueryMatch(skillQueryDraft);
|
|
17357
|
-
const resolvedSlashCommands =
|
|
18084
|
+
const resolvedSlashCommands = useMemo22(
|
|
17358
18085
|
() => resolveSlashCommandsForProvider({
|
|
17359
18086
|
provider,
|
|
17360
18087
|
policy: slashCommandPolicy,
|
|
@@ -17379,11 +18106,11 @@ function useComposerPaletteCatalog({
|
|
|
17379
18106
|
slashCommandPolicy
|
|
17380
18107
|
]
|
|
17381
18108
|
);
|
|
17382
|
-
const filteredCommands =
|
|
18109
|
+
const filteredCommands = useMemo22(
|
|
17383
18110
|
() => slashQuery === null ? [] : filterSlashCommands(resolvedSlashCommands, slashQuery),
|
|
17384
18111
|
[resolvedSlashCommands, slashQuery]
|
|
17385
18112
|
);
|
|
17386
|
-
const filteredSkills =
|
|
18113
|
+
const filteredSkills = useMemo22(
|
|
17387
18114
|
() => skillQueryMatch === null ? [] : filterProviderSkillsForTrigger({
|
|
17388
18115
|
skills: availableSkills,
|
|
17389
18116
|
query: skillQueryMatch.query,
|
|
@@ -17391,7 +18118,7 @@ function useComposerPaletteCatalog({
|
|
|
17391
18118
|
}),
|
|
17392
18119
|
[availableSkills, skillQueryMatch]
|
|
17393
18120
|
);
|
|
17394
|
-
const availableCapabilities =
|
|
18121
|
+
const availableCapabilities = useMemo22(() => {
|
|
17395
18122
|
const entries = [];
|
|
17396
18123
|
if (composerSettings.supportsBrowser) {
|
|
17397
18124
|
entries.push({
|
|
@@ -17416,7 +18143,7 @@ function useComposerPaletteCatalog({
|
|
|
17416
18143
|
labels.browserUseCapabilityLabel,
|
|
17417
18144
|
labels.computerUseCapabilityLabel
|
|
17418
18145
|
]);
|
|
17419
|
-
const slashPaletteEntries =
|
|
18146
|
+
const slashPaletteEntries = useMemo22(() => {
|
|
17420
18147
|
const commandEntries = filteredCommands.flatMap((command) => {
|
|
17421
18148
|
if (isSlashCommandCapability(command)) {
|
|
17422
18149
|
const browserConnectionMode = capabilityMenuState?.browserUse?.connectionMode ?? null;
|
|
@@ -17517,15 +18244,15 @@ function useComposerPaletteCatalog({
|
|
|
17517
18244
|
|
|
17518
18245
|
// agent-gui/agentGuiNode/composer/useMentionPaletteFrame.ts
|
|
17519
18246
|
import {
|
|
17520
|
-
useCallback as
|
|
18247
|
+
useCallback as useCallback34,
|
|
17521
18248
|
useLayoutEffect as useLayoutEffect3,
|
|
17522
|
-
useMemo as
|
|
18249
|
+
useMemo as useMemo23,
|
|
17523
18250
|
useState as useState11
|
|
17524
18251
|
} from "react";
|
|
17525
18252
|
|
|
17526
18253
|
// agent-gui/agentGuiNode/composer/AgentComposerChrome.tsx
|
|
17527
18254
|
import {
|
|
17528
|
-
useCallback as
|
|
18255
|
+
useCallback as useCallback33,
|
|
17529
18256
|
useEffect as useEffect17,
|
|
17530
18257
|
useRef as useRef24,
|
|
17531
18258
|
useState as useState10
|
|
@@ -17584,24 +18311,24 @@ function AgentUsageChip({
|
|
|
17584
18311
|
const usageLevel = agentUsageChipLevel(clampedPercent);
|
|
17585
18312
|
const ringColor = agentUsageRingColor(usageLevel);
|
|
17586
18313
|
const usagePopoverCloseTimerRef = useRef24(null);
|
|
17587
|
-
const clearUsagePopoverHoverTimer =
|
|
18314
|
+
const clearUsagePopoverHoverTimer = useCallback33(() => {
|
|
17588
18315
|
if (usagePopoverHoverTimerRef.current) {
|
|
17589
18316
|
clearTimeout(usagePopoverHoverTimerRef.current);
|
|
17590
18317
|
usagePopoverHoverTimerRef.current = null;
|
|
17591
18318
|
}
|
|
17592
18319
|
}, []);
|
|
17593
|
-
const clearUsagePopoverCloseTimer =
|
|
18320
|
+
const clearUsagePopoverCloseTimer = useCallback33(() => {
|
|
17594
18321
|
if (usagePopoverCloseTimerRef.current) {
|
|
17595
18322
|
clearTimeout(usagePopoverCloseTimerRef.current);
|
|
17596
18323
|
usagePopoverCloseTimerRef.current = null;
|
|
17597
18324
|
}
|
|
17598
18325
|
}, []);
|
|
17599
|
-
const openUsagePopover =
|
|
18326
|
+
const openUsagePopover = useCallback33(() => {
|
|
17600
18327
|
clearUsagePopoverHoverTimer();
|
|
17601
18328
|
clearUsagePopoverCloseTimer();
|
|
17602
18329
|
setUsagePopoverOpen(true);
|
|
17603
18330
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
17604
|
-
const openUsagePopoverAfterHoverDelay =
|
|
18331
|
+
const openUsagePopoverAfterHoverDelay = useCallback33(() => {
|
|
17605
18332
|
clearUsagePopoverHoverTimer();
|
|
17606
18333
|
clearUsagePopoverCloseTimer();
|
|
17607
18334
|
usagePopoverHoverTimerRef.current = setTimeout(() => {
|
|
@@ -17609,12 +18336,12 @@ function AgentUsageChip({
|
|
|
17609
18336
|
setUsagePopoverOpen(true);
|
|
17610
18337
|
}, USAGE_POPOVER_HOVER_DELAY_MS);
|
|
17611
18338
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
17612
|
-
const closeUsagePopover =
|
|
18339
|
+
const closeUsagePopover = useCallback33(() => {
|
|
17613
18340
|
clearUsagePopoverHoverTimer();
|
|
17614
18341
|
clearUsagePopoverCloseTimer();
|
|
17615
18342
|
setUsagePopoverOpen(false);
|
|
17616
18343
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
17617
|
-
const scheduleUsagePopoverClose =
|
|
18344
|
+
const scheduleUsagePopoverClose = useCallback33(() => {
|
|
17618
18345
|
clearUsagePopoverHoverTimer();
|
|
17619
18346
|
clearUsagePopoverCloseTimer();
|
|
17620
18347
|
usagePopoverCloseTimerRef.current = setTimeout(() => {
|
|
@@ -17622,7 +18349,7 @@ function AgentUsageChip({
|
|
|
17622
18349
|
setUsagePopoverOpen(false);
|
|
17623
18350
|
}, 140);
|
|
17624
18351
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
17625
|
-
const handleUsagePopoverOpenChange =
|
|
18352
|
+
const handleUsagePopoverOpenChange = useCallback33(
|
|
17626
18353
|
(open) => {
|
|
17627
18354
|
if (open) {
|
|
17628
18355
|
openUsagePopover();
|
|
@@ -17632,7 +18359,7 @@ function AgentUsageChip({
|
|
|
17632
18359
|
},
|
|
17633
18360
|
[closeUsagePopover, openUsagePopover]
|
|
17634
18361
|
);
|
|
17635
|
-
const handleUsageTriggerBlur =
|
|
18362
|
+
const handleUsageTriggerBlur = useCallback33(
|
|
17636
18363
|
(event) => {
|
|
17637
18364
|
const nextFocusTarget = event.relatedTarget;
|
|
17638
18365
|
if (nextFocusTarget instanceof Node && usagePopoverContentRef.current?.contains(nextFocusTarget)) {
|
|
@@ -17881,7 +18608,7 @@ function AgentComposerHandoffIcon({
|
|
|
17881
18608
|
// agent-gui/agentGuiNode/composer/useMentionPaletteFrame.ts
|
|
17882
18609
|
function useMentionPaletteFrame(inputShellRef, showFileMentionPalette) {
|
|
17883
18610
|
const [mentionPaletteFrame, setMentionPaletteFrame] = useState11(null);
|
|
17884
|
-
const syncMentionPaletteFrame =
|
|
18611
|
+
const syncMentionPaletteFrame = useCallback34(() => {
|
|
17885
18612
|
const anchor = inputShellRef.current;
|
|
17886
18613
|
if (!anchor || typeof window === "undefined") {
|
|
17887
18614
|
setMentionPaletteFrame(null);
|
|
@@ -17943,7 +18670,7 @@ function useMentionPaletteFrame(inputShellRef, showFileMentionPalette) {
|
|
|
17943
18670
|
window.removeEventListener("scroll", syncMentionPaletteFrame, true);
|
|
17944
18671
|
};
|
|
17945
18672
|
}, [showFileMentionPalette, syncMentionPaletteFrame]);
|
|
17946
|
-
const mentionPaletteStyle =
|
|
18673
|
+
const mentionPaletteStyle = useMemo23(
|
|
17947
18674
|
() => ({
|
|
17948
18675
|
position: "fixed",
|
|
17949
18676
|
left: `${mentionPaletteFrame?.left ?? 0}px`,
|
|
@@ -17963,14 +18690,14 @@ function useMentionPaletteFrame(inputShellRef, showFileMentionPalette) {
|
|
|
17963
18690
|
|
|
17964
18691
|
// agent-gui/agentGuiNode/composer/useComposerSlashActions.ts
|
|
17965
18692
|
import {
|
|
17966
|
-
useCallback as
|
|
17967
|
-
useMemo as
|
|
18693
|
+
useCallback as useCallback35,
|
|
18694
|
+
useMemo as useMemo24,
|
|
17968
18695
|
useRef as useRef25
|
|
17969
18696
|
} from "react";
|
|
17970
18697
|
function useStableEventCallback3(callback) {
|
|
17971
18698
|
const callbackRef = useRef25(callback);
|
|
17972
18699
|
callbackRef.current = callback;
|
|
17973
|
-
return
|
|
18700
|
+
return useCallback35((...args) => callbackRef.current(...args), []);
|
|
17974
18701
|
}
|
|
17975
18702
|
function useComposerSlashActions(input) {
|
|
17976
18703
|
const agentActivityRuntime = useOptionalAgentActivityRuntime();
|
|
@@ -17992,6 +18719,7 @@ function useComposerSlashActions(input) {
|
|
|
17992
18719
|
onSubmitGuidance,
|
|
17993
18720
|
onCapabilitySettingsRequest,
|
|
17994
18721
|
onSlashStatusOpen,
|
|
18722
|
+
onSlashStatusClose,
|
|
17995
18723
|
onPromptImagesUnsupported,
|
|
17996
18724
|
onRequestGitBranches,
|
|
17997
18725
|
draftContent,
|
|
@@ -18018,15 +18746,16 @@ function useComposerSlashActions(input) {
|
|
|
18018
18746
|
setIsSlashStatusPanelOpen,
|
|
18019
18747
|
setHighlightedIndex
|
|
18020
18748
|
} = input;
|
|
18021
|
-
const clearSlashCommandDraft =
|
|
18749
|
+
const clearSlashCommandDraft = useCallback35(() => {
|
|
18022
18750
|
draftPromptRef.current = "";
|
|
18023
18751
|
setPaletteDraftPrompt("");
|
|
18024
18752
|
setIsPaletteOpen(false);
|
|
18025
18753
|
onDraftContentChange(emptyAgentComposerDraft());
|
|
18026
18754
|
}, [onDraftContentChange]);
|
|
18027
|
-
const closeSlashStatusPanel =
|
|
18755
|
+
const closeSlashStatusPanel = useCallback35(() => {
|
|
18028
18756
|
setIsSlashStatusPanelOpen(false);
|
|
18029
|
-
|
|
18757
|
+
onSlashStatusClose?.();
|
|
18758
|
+
}, [onSlashStatusClose, setIsSlashStatusPanelOpen]);
|
|
18030
18759
|
const settingsControlsDisabled = isSendingTurn || isSubmittingPrompt || showStopButton;
|
|
18031
18760
|
const permissionModeControlsDisabled = resolvePermissionModeControlsDisabled({
|
|
18032
18761
|
isSendingTurn,
|
|
@@ -18034,15 +18763,24 @@ function useComposerSlashActions(input) {
|
|
|
18034
18763
|
showStopButton
|
|
18035
18764
|
});
|
|
18036
18765
|
const composerControlsHardDisabled = isSelectedProjectMissing || isSubmittingPrompt || disabled && !isSendingTurn && !showStopButton;
|
|
18037
|
-
const closeReviewPicker =
|
|
18766
|
+
const closeReviewPicker = useCallback35(() => {
|
|
18038
18767
|
setIsReviewPickerOpen(false);
|
|
18039
18768
|
}, []);
|
|
18040
|
-
const closeSlashFloatingMenu =
|
|
18769
|
+
const closeSlashFloatingMenu = useCallback35(() => {
|
|
18770
|
+
if (isSlashStatusPanelOpen) {
|
|
18771
|
+
onSlashStatusClose?.();
|
|
18772
|
+
}
|
|
18041
18773
|
setIsSlashStatusPanelOpen(false);
|
|
18042
18774
|
setIsReviewPickerOpen(false);
|
|
18043
18775
|
setIsPaletteOpen(false);
|
|
18044
|
-
}, [
|
|
18045
|
-
|
|
18776
|
+
}, [
|
|
18777
|
+
isSlashStatusPanelOpen,
|
|
18778
|
+
onSlashStatusClose,
|
|
18779
|
+
setIsPaletteOpen,
|
|
18780
|
+
setIsReviewPickerOpen,
|
|
18781
|
+
setIsSlashStatusPanelOpen
|
|
18782
|
+
]);
|
|
18783
|
+
const submitReviewCommand = useCallback35(
|
|
18046
18784
|
(command) => {
|
|
18047
18785
|
setIsReviewPickerOpen(false);
|
|
18048
18786
|
clearSlashCommandDraft();
|
|
@@ -18050,7 +18788,7 @@ function useComposerSlashActions(input) {
|
|
|
18050
18788
|
},
|
|
18051
18789
|
[clearSlashCommandDraft, onSubmit]
|
|
18052
18790
|
);
|
|
18053
|
-
const reviewBranchLoader =
|
|
18791
|
+
const reviewBranchLoader = useMemo24(() => {
|
|
18054
18792
|
if (!onRequestGitBranches) {
|
|
18055
18793
|
return null;
|
|
18056
18794
|
}
|
|
@@ -18062,7 +18800,7 @@ function useComposerSlashActions(input) {
|
|
|
18062
18800
|
}
|
|
18063
18801
|
return null;
|
|
18064
18802
|
}, [onRequestGitBranches, selectedProjectPath, slashStatusAgentSessionId]);
|
|
18065
|
-
const executeSlashCommandEffect =
|
|
18803
|
+
const executeSlashCommandEffect = useCallback35(
|
|
18066
18804
|
(effect) => {
|
|
18067
18805
|
if (effect.kind === "submitPrompt") {
|
|
18068
18806
|
clearSlashCommandDraft();
|
|
@@ -18083,17 +18821,25 @@ function useComposerSlashActions(input) {
|
|
|
18083
18821
|
setIsReviewPickerOpen(false);
|
|
18084
18822
|
if (!isSlashStatusPanelOpen) {
|
|
18085
18823
|
onSlashStatusOpen?.();
|
|
18824
|
+
} else {
|
|
18825
|
+
onSlashStatusClose?.();
|
|
18086
18826
|
}
|
|
18087
18827
|
setIsSlashStatusPanelOpen((current) => !current);
|
|
18088
18828
|
return;
|
|
18089
18829
|
}
|
|
18090
18830
|
if (effect.kind === "showReviewPicker") {
|
|
18091
18831
|
clearSlashCommandDraft();
|
|
18092
|
-
|
|
18832
|
+
if (isSlashStatusPanelOpen) {
|
|
18833
|
+
onSlashStatusClose?.();
|
|
18834
|
+
setIsSlashStatusPanelOpen(false);
|
|
18835
|
+
}
|
|
18093
18836
|
setIsReviewPickerOpen(true);
|
|
18094
18837
|
return;
|
|
18095
18838
|
}
|
|
18096
18839
|
if (effect.kind === "activateGoalMode") {
|
|
18840
|
+
if (isSlashStatusPanelOpen) {
|
|
18841
|
+
onSlashStatusClose?.();
|
|
18842
|
+
}
|
|
18097
18843
|
draftPromptRef.current = GOAL_MODE_SLASH_COMMAND2;
|
|
18098
18844
|
setPaletteDraftPrompt("");
|
|
18099
18845
|
setIsSlashStatusPanelOpen(false);
|
|
@@ -18166,13 +18912,14 @@ function useComposerSlashActions(input) {
|
|
|
18166
18912
|
draftContent,
|
|
18167
18913
|
isSlashStatusPanelOpen,
|
|
18168
18914
|
onDraftContentChange,
|
|
18915
|
+
onSlashStatusClose,
|
|
18169
18916
|
onSlashStatusOpen,
|
|
18170
18917
|
onSettingsChange,
|
|
18171
18918
|
onSubmit,
|
|
18172
18919
|
settingsControlsDisabled
|
|
18173
18920
|
]
|
|
18174
18921
|
);
|
|
18175
|
-
const selectCommand =
|
|
18922
|
+
const selectCommand = useCallback35(
|
|
18176
18923
|
(command) => {
|
|
18177
18924
|
const selectionEffect = resolveSlashCommandSelectionEffect({
|
|
18178
18925
|
provider,
|
|
@@ -18186,7 +18933,7 @@ function useComposerSlashActions(input) {
|
|
|
18186
18933
|
},
|
|
18187
18934
|
[executeSlashCommandEffect, provider, slashCommandPolicy]
|
|
18188
18935
|
);
|
|
18189
|
-
const selectCapability =
|
|
18936
|
+
const selectCapability = useCallback35(
|
|
18190
18937
|
(capability) => {
|
|
18191
18938
|
const selectionEffect = resolveSlashCommandSelectionEffect({
|
|
18192
18939
|
provider,
|
|
@@ -18200,14 +18947,14 @@ function useComposerSlashActions(input) {
|
|
|
18200
18947
|
},
|
|
18201
18948
|
[executeSlashCommandEffect, provider, slashCommandPolicy]
|
|
18202
18949
|
);
|
|
18203
|
-
const selectCapabilitySettings =
|
|
18950
|
+
const selectCapabilitySettings = useCallback35(
|
|
18204
18951
|
(capability) => {
|
|
18205
18952
|
onCapabilitySettingsRequest?.(capability.capability);
|
|
18206
18953
|
setIsPaletteOpen(false);
|
|
18207
18954
|
},
|
|
18208
18955
|
[onCapabilitySettingsRequest]
|
|
18209
18956
|
);
|
|
18210
|
-
const selectSkill =
|
|
18957
|
+
const selectSkill = useCallback35(
|
|
18211
18958
|
(skill) => {
|
|
18212
18959
|
const trigger = skillTriggerForPrefix(skill, skillQueryMatch?.prefix);
|
|
18213
18960
|
const replacedDraft = trigger && skillQueryMatch && promptBeforeSelection !== "" ? editorHandleRef.current?.replaceTextBeforeSelection(
|
|
@@ -18330,7 +19077,7 @@ function useComposerSlashActions(input) {
|
|
|
18330
19077
|
}
|
|
18331
19078
|
}
|
|
18332
19079
|
);
|
|
18333
|
-
const submit =
|
|
19080
|
+
const submit = useCallback35(
|
|
18334
19081
|
(event) => {
|
|
18335
19082
|
event.preventDefault();
|
|
18336
19083
|
submitCurrentPrompt();
|
|
@@ -18414,7 +19161,7 @@ function useComposerSlashActions(input) {
|
|
|
18414
19161
|
|
|
18415
19162
|
// agent-gui/agentGuiNode/composer/useComposerMentionActions.ts
|
|
18416
19163
|
import {
|
|
18417
|
-
useCallback as
|
|
19164
|
+
useCallback as useCallback36,
|
|
18418
19165
|
useEffect as useEffect18,
|
|
18419
19166
|
useRef as useRef26
|
|
18420
19167
|
} from "react";
|
|
@@ -18438,7 +19185,7 @@ function isAgentRichTextImeComposing(event) {
|
|
|
18438
19185
|
function useStableEventCallback4(callback) {
|
|
18439
19186
|
const callbackRef = useRef26(callback);
|
|
18440
19187
|
callbackRef.current = callback;
|
|
18441
|
-
return
|
|
19188
|
+
return useCallback36((...args) => callbackRef.current(...args), []);
|
|
18442
19189
|
}
|
|
18443
19190
|
function useComposerMentionActions(input) {
|
|
18444
19191
|
const {
|
|
@@ -18475,7 +19222,7 @@ function useComposerMentionActions(input) {
|
|
|
18475
19222
|
paletteContentRef,
|
|
18476
19223
|
shouldCenterMentionHighlight
|
|
18477
19224
|
} = input;
|
|
18478
|
-
const selectFileMention =
|
|
19225
|
+
const selectFileMention = useCallback36(
|
|
18479
19226
|
(entry) => {
|
|
18480
19227
|
if (entry.kind === "file" && entry.mentionNavigation) {
|
|
18481
19228
|
mentionControllerRef.current?.selectFileMentionNavigationItem(entry);
|
|
@@ -18491,7 +19238,7 @@ function useComposerMentionActions(input) {
|
|
|
18491
19238
|
},
|
|
18492
19239
|
[fileMentionSuggestion]
|
|
18493
19240
|
);
|
|
18494
|
-
const closeFileMentionPalette =
|
|
19241
|
+
const closeFileMentionPalette = useCallback36(() => {
|
|
18495
19242
|
if (fileMentionSuggestion) {
|
|
18496
19243
|
exitAgentFileMentionSuggestion(fileMentionSuggestion.editor);
|
|
18497
19244
|
}
|
|
@@ -18499,7 +19246,7 @@ function useComposerMentionActions(input) {
|
|
|
18499
19246
|
setFileMentionSuggestion(null);
|
|
18500
19247
|
setIsPaletteOpen(false);
|
|
18501
19248
|
}, [fileMentionSuggestion]);
|
|
18502
|
-
const clearActiveFileMentionTrigger =
|
|
19249
|
+
const clearActiveFileMentionTrigger = useCallback36(() => {
|
|
18503
19250
|
if (!fileMentionSuggestion) {
|
|
18504
19251
|
return;
|
|
18505
19252
|
}
|
|
@@ -18517,14 +19264,14 @@ function useComposerMentionActions(input) {
|
|
|
18517
19264
|
updateAgentComposerDraft(draftContent, { prompt: nextDraft })
|
|
18518
19265
|
);
|
|
18519
19266
|
}, [draftContent, fileMentionSuggestion, onDraftContentChange]);
|
|
18520
|
-
const closeOpenPalette =
|
|
19267
|
+
const closeOpenPalette = useCallback36(() => {
|
|
18521
19268
|
if (showFileMentionPalette) {
|
|
18522
19269
|
closeFileMentionPalette();
|
|
18523
19270
|
return;
|
|
18524
19271
|
}
|
|
18525
19272
|
setIsPaletteOpen(false);
|
|
18526
19273
|
}, [closeFileMentionPalette, showFileMentionPalette]);
|
|
18527
|
-
const createFileMentionPaletteAdapter =
|
|
19274
|
+
const createFileMentionPaletteAdapter = useCallback36(
|
|
18528
19275
|
(highlightedKey = mentionHighlightedKey) => createMentionPaletteStateAdapter({
|
|
18529
19276
|
state: mentionSearchState,
|
|
18530
19277
|
highlightedKey,
|
|
@@ -18554,23 +19301,23 @@ function useComposerMentionActions(input) {
|
|
|
18554
19301
|
}),
|
|
18555
19302
|
[mentionHighlightedKey, mentionSearchState, selectFileMention]
|
|
18556
19303
|
);
|
|
18557
|
-
const moveFileMentionSelection =
|
|
19304
|
+
const moveFileMentionSelection = useCallback36(
|
|
18558
19305
|
(delta) => {
|
|
18559
19306
|
createFileMentionPaletteAdapter().moveSelection(delta);
|
|
18560
19307
|
},
|
|
18561
19308
|
[createFileMentionPaletteAdapter]
|
|
18562
19309
|
);
|
|
18563
|
-
const handleMentionHighlightChange =
|
|
19310
|
+
const handleMentionHighlightChange = useCallback36((key) => {
|
|
18564
19311
|
autoMentionHighlightedKeyRef.current = null;
|
|
18565
19312
|
setMentionHighlightedKey(key);
|
|
18566
19313
|
}, []);
|
|
18567
|
-
const cycleFileMentionFilter =
|
|
19314
|
+
const cycleFileMentionFilter = useCallback36(
|
|
18568
19315
|
(delta = 1) => {
|
|
18569
19316
|
createFileMentionPaletteAdapter().cycleCategory(delta);
|
|
18570
19317
|
},
|
|
18571
19318
|
[createFileMentionPaletteAdapter]
|
|
18572
19319
|
);
|
|
18573
|
-
const navigateFileMentionHierarchy =
|
|
19320
|
+
const navigateFileMentionHierarchy = useCallback36(
|
|
18574
19321
|
(delta) => {
|
|
18575
19322
|
if (delta === -1) {
|
|
18576
19323
|
return mentionControllerRef.current?.exitFileMentionBrowse() ?? false;
|
|
@@ -18586,13 +19333,13 @@ function useComposerMentionActions(input) {
|
|
|
18586
19333
|
},
|
|
18587
19334
|
[createFileMentionPaletteAdapter]
|
|
18588
19335
|
);
|
|
18589
|
-
const navigateIntoFileMentionItem =
|
|
19336
|
+
const navigateIntoFileMentionItem = useCallback36(
|
|
18590
19337
|
(item) => {
|
|
18591
19338
|
mentionControllerRef.current?.selectFileMentionNavigationItem(item);
|
|
18592
19339
|
},
|
|
18593
19340
|
[]
|
|
18594
19341
|
);
|
|
18595
|
-
const handleFileMentionKeyDown =
|
|
19342
|
+
const handleFileMentionKeyDown = useCallback36(
|
|
18596
19343
|
(event) => {
|
|
18597
19344
|
if (!showFileMentionPalette) {
|
|
18598
19345
|
return false;
|
|
@@ -18619,7 +19366,7 @@ function useComposerMentionActions(input) {
|
|
|
18619
19366
|
showFileMentionPalette
|
|
18620
19367
|
]
|
|
18621
19368
|
);
|
|
18622
|
-
const handlePlanModeToggleKeyDown =
|
|
19369
|
+
const handlePlanModeToggleKeyDown = useCallback36(
|
|
18623
19370
|
(event) => {
|
|
18624
19371
|
if (event.key !== "Tab" || !event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) {
|
|
18625
19372
|
return false;
|
|
@@ -18674,7 +19421,7 @@ function useComposerMentionActions(input) {
|
|
|
18674
19421
|
});
|
|
18675
19422
|
};
|
|
18676
19423
|
}, [handlePaletteKeyDown, showPalette, workspaceReferencePickerOpen]);
|
|
18677
|
-
const handleFileMentionSuggestionChange =
|
|
19424
|
+
const handleFileMentionSuggestionChange = useCallback36(
|
|
18678
19425
|
(state) => {
|
|
18679
19426
|
setFileMentionSuggestion(state);
|
|
18680
19427
|
if (!state) {
|
|
@@ -18740,7 +19487,7 @@ function useComposerMentionActions(input) {
|
|
|
18740
19487
|
}
|
|
18741
19488
|
|
|
18742
19489
|
// agent-gui/agentGuiNode/composer/useComposerProviderTargets.ts
|
|
18743
|
-
import { useMemo as
|
|
19490
|
+
import { useMemo as useMemo25 } from "react";
|
|
18744
19491
|
function useComposerProviderTargets(input) {
|
|
18745
19492
|
const {
|
|
18746
19493
|
layoutMode,
|
|
@@ -18764,7 +19511,7 @@ function useComposerProviderTargets(input) {
|
|
|
18764
19511
|
};
|
|
18765
19512
|
const isHeroLayout = layoutMode === "hero";
|
|
18766
19513
|
const composerClassName = isHeroLayout ? AgentGUINode_styles_default.composerHero : AgentGUINode_styles_default.composer;
|
|
18767
|
-
const providerSwitchTargets =
|
|
19514
|
+
const providerSwitchTargets = useMemo25(
|
|
18768
19515
|
() => agentTargets.filter(Boolean),
|
|
18769
19516
|
[agentTargets]
|
|
18770
19517
|
);
|
|
@@ -18775,7 +19522,7 @@ function useComposerProviderTargets(input) {
|
|
|
18775
19522
|
const providerMenuTargets = selectedProviderSwitchTarget && !providerSwitchTargets.some(
|
|
18776
19523
|
(target) => target.targetId === selectedProviderSwitchTarget.targetId
|
|
18777
19524
|
) ? [selectedProviderSwitchTarget, ...providerSwitchTargets] : providerSwitchTargets;
|
|
18778
|
-
const enabledHandoffProviderTargets =
|
|
19525
|
+
const enabledHandoffProviderTargets = useMemo25(
|
|
18779
19526
|
() => (handoffAgentTargets ?? providerMenuTargets).filter(
|
|
18780
19527
|
(target) => target.disabled !== true
|
|
18781
19528
|
),
|
|
@@ -18820,7 +19567,7 @@ function useComposerProviderTargets(input) {
|
|
|
18820
19567
|
}
|
|
18821
19568
|
|
|
18822
19569
|
// agent-gui/agentGuiNode/composer/useComposerFocusAndDrop.ts
|
|
18823
|
-
import { useCallback as
|
|
19570
|
+
import { useCallback as useCallback37, useEffect as useEffect20 } from "react";
|
|
18824
19571
|
|
|
18825
19572
|
// agent-gui/agentGuiNode/composer/useComposerFileDrop.ts
|
|
18826
19573
|
import { useEffect as useEffect19, useState as useState12 } from "react";
|
|
@@ -19208,13 +19955,13 @@ function useComposerFocusAndDrop(input) {
|
|
|
19208
19955
|
addDraftFiles,
|
|
19209
19956
|
onPromptImagesUnsupported
|
|
19210
19957
|
} = input;
|
|
19211
|
-
const handleMentionPaletteButton =
|
|
19958
|
+
const handleMentionPaletteButton = useCallback37(() => {
|
|
19212
19959
|
if (composerControlsHardDisabled || inputDisabled) {
|
|
19213
19960
|
return;
|
|
19214
19961
|
}
|
|
19215
19962
|
editorHandleRef.current?.openMentionPalette();
|
|
19216
19963
|
}, [composerControlsHardDisabled, inputDisabled]);
|
|
19217
|
-
const scheduleComposerFocus =
|
|
19964
|
+
const scheduleComposerFocus = useCallback37(() => {
|
|
19218
19965
|
if (inputDisabled) {
|
|
19219
19966
|
return;
|
|
19220
19967
|
}
|
|
@@ -19224,7 +19971,7 @@ function useComposerFocusAndDrop(input) {
|
|
|
19224
19971
|
});
|
|
19225
19972
|
});
|
|
19226
19973
|
}, [inputDisabled]);
|
|
19227
|
-
const handlePastedImages =
|
|
19974
|
+
const handlePastedImages = useCallback37(
|
|
19228
19975
|
(images) => {
|
|
19229
19976
|
addDraftImages(images);
|
|
19230
19977
|
scheduleComposerFocus();
|
|
@@ -19269,7 +20016,7 @@ function useComposerFocusAndDrop(input) {
|
|
|
19269
20016
|
|
|
19270
20017
|
// agent-gui/agentGuiNode/composer/useComposerPresentation.tsx
|
|
19271
20018
|
import {
|
|
19272
|
-
useCallback as
|
|
20019
|
+
useCallback as useCallback38,
|
|
19273
20020
|
useEffect as useEffect21,
|
|
19274
20021
|
useState as useState14
|
|
19275
20022
|
} from "react";
|
|
@@ -19537,7 +20284,7 @@ function useComposerPresentation(input) {
|
|
|
19537
20284
|
useEffect21(() => {
|
|
19538
20285
|
setDismissedPromptRequestId(null);
|
|
19539
20286
|
}, [activePromptRequestId]);
|
|
19540
|
-
const submitInteractivePromptAndDismiss =
|
|
20287
|
+
const submitInteractivePromptAndDismiss = useCallback38(
|
|
19541
20288
|
(input2) => {
|
|
19542
20289
|
onSubmitInteractivePrompt(input2);
|
|
19543
20290
|
setDismissedPromptRequestId(input2.requestId);
|
|
@@ -20804,7 +21551,7 @@ function optionsWithSelectedValue(options, selectedValue) {
|
|
|
20804
21551
|
}
|
|
20805
21552
|
|
|
20806
21553
|
// agent-gui/agentGuiNode/AgentComposerProjectMenu.tsx
|
|
20807
|
-
import { useMemo as
|
|
21554
|
+
import { useMemo as useMemo26 } from "react";
|
|
20808
21555
|
import { ChevronDown } from "lucide-react";
|
|
20809
21556
|
import {
|
|
20810
21557
|
WorkspaceUserProjectSelect,
|
|
@@ -20849,11 +21596,11 @@ function AgentProjectDropdown({
|
|
|
20849
21596
|
}) {
|
|
20850
21597
|
"use memo";
|
|
20851
21598
|
const agentHostApi = useAgentHostApi();
|
|
20852
|
-
const resolvedLabels =
|
|
21599
|
+
const resolvedLabels = useMemo26(
|
|
20853
21600
|
() => resolveWorkspaceUserProjectSelectLabels(i18n, labels),
|
|
20854
21601
|
[i18n, labels]
|
|
20855
21602
|
);
|
|
20856
|
-
const userProjectApi =
|
|
21603
|
+
const userProjectApi = useMemo26(
|
|
20857
21604
|
() => createAgentGUIUserProjectSelectionApi({
|
|
20858
21605
|
selectProjectDirectory,
|
|
20859
21606
|
userProjects: previewMode ? null : agentHostApi.userProjects
|
|
@@ -21561,9 +22308,9 @@ function AgentFullAccessRestoredWarning({
|
|
|
21561
22308
|
// agent-gui/agentGuiNode/agentRichText/AgentRichTextEditor.tsx
|
|
21562
22309
|
import {
|
|
21563
22310
|
forwardRef as forwardRef3,
|
|
21564
|
-
useCallback as
|
|
22311
|
+
useCallback as useCallback40,
|
|
21565
22312
|
useEffect as useEffect23,
|
|
21566
|
-
useMemo as
|
|
22313
|
+
useMemo as useMemo27,
|
|
21567
22314
|
useRef as useRef29,
|
|
21568
22315
|
useState as useState18
|
|
21569
22316
|
} from "react";
|
|
@@ -22160,7 +22907,7 @@ function useAgentRichTextEditorHandle(input) {
|
|
|
22160
22907
|
|
|
22161
22908
|
// agent-gui/agentGuiNode/agentRichText/AgentRichTextEditorSurface.tsx
|
|
22162
22909
|
import {
|
|
22163
|
-
useCallback as
|
|
22910
|
+
useCallback as useCallback39,
|
|
22164
22911
|
useRef as useRef28
|
|
22165
22912
|
} from "react";
|
|
22166
22913
|
import { createPortal as createPortal2 } from "react-dom";
|
|
@@ -22250,7 +22997,7 @@ function AgentRichTextContextMenuButton({
|
|
|
22250
22997
|
onSelect
|
|
22251
22998
|
}) {
|
|
22252
22999
|
const selectionStartedRef = useRef28(false);
|
|
22253
|
-
const select =
|
|
23000
|
+
const select = useCallback39(() => {
|
|
22254
23001
|
if (disabled || selectionStartedRef.current) return;
|
|
22255
23002
|
selectionStartedRef.current = true;
|
|
22256
23003
|
void Promise.resolve(onSelect()).finally(() => {
|
|
@@ -22380,10 +23127,10 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
22380
23127
|
const suppressPastedAtSuggestionRef = useRef29(false);
|
|
22381
23128
|
const scrollFrameRef = useRef29(null);
|
|
22382
23129
|
const [contextMenu, setContextMenu] = useState18(null);
|
|
22383
|
-
const closeContextMenu =
|
|
23130
|
+
const closeContextMenu = useCallback40(() => {
|
|
22384
23131
|
setContextMenu(null);
|
|
22385
23132
|
}, []);
|
|
22386
|
-
const insertPlainText =
|
|
23133
|
+
const insertPlainText = useCallback40((text) => {
|
|
22387
23134
|
const currentEditor = editorRef.current;
|
|
22388
23135
|
if (!currentEditor || currentEditor.isDestroyed || !text) {
|
|
22389
23136
|
return;
|
|
@@ -22403,7 +23150,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
22403
23150
|
})
|
|
22404
23151
|
).run();
|
|
22405
23152
|
}, []);
|
|
22406
|
-
const copySelection =
|
|
23153
|
+
const copySelection = useCallback40(async () => {
|
|
22407
23154
|
const currentEditor = editorRef.current;
|
|
22408
23155
|
const selectedText = contextMenu && contextMenu.hasSelection && currentEditor ? readPromptTextRange(
|
|
22409
23156
|
currentEditor,
|
|
@@ -22416,7 +23163,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
22416
23163
|
}
|
|
22417
23164
|
await writePlainTextToClipboard(selectedText);
|
|
22418
23165
|
}, [closeContextMenu, contextMenu]);
|
|
22419
|
-
const cutSelection =
|
|
23166
|
+
const cutSelection = useCallback40(async () => {
|
|
22420
23167
|
const currentEditor = editorRef.current;
|
|
22421
23168
|
const selectionFrom = contextMenu?.selectionFrom ?? null;
|
|
22422
23169
|
const selectionTo = contextMenu?.selectionTo ?? null;
|
|
@@ -22435,7 +23182,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
22435
23182
|
const { from, to } = selectionFrom !== null && selectionTo !== null && selectionFrom < selectionTo ? { from: selectionFrom, to: selectionTo } : currentEditor.state.selection;
|
|
22436
23183
|
currentEditor.chain().focus().deleteRange({ from, to }).run();
|
|
22437
23184
|
}, [closeContextMenu, contextMenu, disabled]);
|
|
22438
|
-
const pasteClipboardText =
|
|
23185
|
+
const pasteClipboardText = useCallback40(async () => {
|
|
22439
23186
|
closeContextMenu();
|
|
22440
23187
|
if (disabled) {
|
|
22441
23188
|
return;
|
|
@@ -22462,7 +23209,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
22462
23209
|
scrollEditorSelectionIntoView(currentEditor);
|
|
22463
23210
|
});
|
|
22464
23211
|
};
|
|
22465
|
-
const extensions =
|
|
23212
|
+
const extensions = useMemo27(
|
|
22466
23213
|
() => [
|
|
22467
23214
|
...createAgentRichTextInputExtensions(
|
|
22468
23215
|
{
|
|
@@ -23180,7 +23927,7 @@ function slashPaletteEntryIcon(entry) {
|
|
|
23180
23927
|
}
|
|
23181
23928
|
|
|
23182
23929
|
// agent-gui/agentGuiNode/AgentReviewPickerPanel.tsx
|
|
23183
|
-
import { useCallback as
|
|
23930
|
+
import { useCallback as useCallback41, useEffect as useEffect25, useMemo as useMemo28, useRef as useRef31, useState as useState19 } from "react";
|
|
23184
23931
|
import { menuItemClassName } from "@tutti-os/ui-system";
|
|
23185
23932
|
|
|
23186
23933
|
// agent-gui/agentGuiNode/AgentReviewBranchController.ts
|
|
@@ -23332,25 +24079,25 @@ function AgentReviewPickerPanel({
|
|
|
23332
24079
|
useEffect25(() => {
|
|
23333
24080
|
searchInputRef.current?.focus();
|
|
23334
24081
|
}, [stage]);
|
|
23335
|
-
const submit =
|
|
24082
|
+
const submit = useCallback41(
|
|
23336
24083
|
(command) => {
|
|
23337
24084
|
onSubmitReview(command);
|
|
23338
24085
|
},
|
|
23339
24086
|
[onSubmitReview]
|
|
23340
24087
|
);
|
|
23341
|
-
const goToStage =
|
|
24088
|
+
const goToStage = useCallback41((next) => {
|
|
23342
24089
|
setStage(next);
|
|
23343
24090
|
setQuery("");
|
|
23344
24091
|
setHighlightedIndex(0);
|
|
23345
24092
|
}, []);
|
|
23346
|
-
const goBackToRoot =
|
|
24093
|
+
const goBackToRoot = useCallback41(() => {
|
|
23347
24094
|
setStage("root");
|
|
23348
24095
|
setQuery("");
|
|
23349
24096
|
setHighlightedIndex(0);
|
|
23350
24097
|
}, []);
|
|
23351
24098
|
const trimmedQuery = query.trim();
|
|
23352
24099
|
const normalizedQuery = trimmedQuery.toLowerCase();
|
|
23353
|
-
const entries =
|
|
24100
|
+
const entries = useMemo28(() => {
|
|
23354
24101
|
if (stage === "root") {
|
|
23355
24102
|
const options = [
|
|
23356
24103
|
{
|
|
@@ -23431,7 +24178,7 @@ function AgentReviewPickerPanel({
|
|
|
23431
24178
|
emptyMessage = labels.branchEmpty;
|
|
23432
24179
|
}
|
|
23433
24180
|
}
|
|
23434
|
-
const handleKeyDown =
|
|
24181
|
+
const handleKeyDown = useCallback41(
|
|
23435
24182
|
(event) => {
|
|
23436
24183
|
if (event.key === "ArrowDown") {
|
|
23437
24184
|
event.preventDefault();
|
|
@@ -23541,10 +24288,10 @@ function AgentReviewPickerPanel({
|
|
|
23541
24288
|
// agent-gui/agentGuiNode/composerFloatingMenu/ComposerFloatingMenuSurface.tsx
|
|
23542
24289
|
import {
|
|
23543
24290
|
forwardRef as forwardRef4,
|
|
23544
|
-
useCallback as
|
|
24291
|
+
useCallback as useCallback42,
|
|
23545
24292
|
useEffect as useEffect26,
|
|
23546
24293
|
useLayoutEffect as useLayoutEffect5,
|
|
23547
|
-
useMemo as
|
|
24294
|
+
useMemo as useMemo29,
|
|
23548
24295
|
useRef as useRef32,
|
|
23549
24296
|
useState as useState20
|
|
23550
24297
|
} from "react";
|
|
@@ -23639,7 +24386,7 @@ function useComposerAnchoredMenuFrame({
|
|
|
23639
24386
|
open
|
|
23640
24387
|
}) {
|
|
23641
24388
|
const [frame, setFrame] = useState20(null);
|
|
23642
|
-
const syncFrame =
|
|
24389
|
+
const syncFrame = useCallback42(() => {
|
|
23643
24390
|
const anchor = anchorRef.current;
|
|
23644
24391
|
if (!anchor || typeof window === "undefined") {
|
|
23645
24392
|
setFrame(null);
|
|
@@ -23698,7 +24445,7 @@ var ComposerFloatingMenuSurface = forwardRef4(function ComposerFloatingMenuSurfa
|
|
|
23698
24445
|
maxHeight,
|
|
23699
24446
|
open
|
|
23700
24447
|
});
|
|
23701
|
-
const setSurfaceRef =
|
|
24448
|
+
const setSurfaceRef = useCallback42(
|
|
23702
24449
|
(node) => {
|
|
23703
24450
|
localSurfaceRef.current = node;
|
|
23704
24451
|
assignRef(surfaceRef, node);
|
|
@@ -23753,7 +24500,7 @@ var ComposerFloatingMenuSurface = forwardRef4(function ComposerFloatingMenuSurfa
|
|
|
23753
24500
|
window.removeEventListener("blur", onDismiss);
|
|
23754
24501
|
};
|
|
23755
24502
|
}, [anchorRef, dismissBoundaryRef, onDismiss, open]);
|
|
23756
|
-
const style =
|
|
24503
|
+
const style = useMemo29(() => {
|
|
23757
24504
|
const baseStyle = {
|
|
23758
24505
|
position: "fixed",
|
|
23759
24506
|
left: `${frame?.left ?? 0}px`,
|
|
@@ -24704,7 +25451,7 @@ function validateDraft(draft, labels) {
|
|
|
24704
25451
|
}
|
|
24705
25452
|
|
|
24706
25453
|
// agent-gui/agentGuiNode/composer/quickPrompts/AgentQuickPromptList.tsx
|
|
24707
|
-
import { useMemo as
|
|
25454
|
+
import { useMemo as useMemo30, useRef as useRef35 } from "react";
|
|
24708
25455
|
import { Sortable, SortableContent, SortableItem } from "@tutti-os/ui-system";
|
|
24709
25456
|
|
|
24710
25457
|
// agent-gui/agentGuiNode/composer/quickPrompts/AgentQuickPromptRow.tsx
|
|
@@ -24846,11 +25593,11 @@ function AgentQuickPromptList({
|
|
|
24846
25593
|
}) {
|
|
24847
25594
|
const handleRefs = useRef35(/* @__PURE__ */ new Map());
|
|
24848
25595
|
const { filteredPrompts, labels, snapshot } = controller;
|
|
24849
|
-
const promptsById =
|
|
25596
|
+
const promptsById = useMemo30(
|
|
24850
25597
|
() => new Map(filteredPrompts.map((prompt) => [prompt.id, prompt])),
|
|
24851
25598
|
[filteredPrompts]
|
|
24852
25599
|
);
|
|
24853
|
-
const accessibility =
|
|
25600
|
+
const accessibility = useMemo30(
|
|
24854
25601
|
() => ({
|
|
24855
25602
|
announcements: {
|
|
24856
25603
|
onDragStart({ active }) {
|
|
@@ -25482,6 +26229,7 @@ function AgentComposerView(input) {
|
|
|
25482
26229
|
onSubmit,
|
|
25483
26230
|
onProviderSelect,
|
|
25484
26231
|
onHandoffConversation,
|
|
26232
|
+
onSlashStatusRefresh,
|
|
25485
26233
|
compactSupported = null,
|
|
25486
26234
|
hasCompactableContext = true
|
|
25487
26235
|
} = input.props;
|
|
@@ -25883,9 +26631,17 @@ function AgentComposerView(input) {
|
|
|
25883
26631
|
slashStatusClose: labels.slashStatusClose,
|
|
25884
26632
|
slashStatusContextValue: labels.slashStatusContextValue,
|
|
25885
26633
|
slashStatusContextUnavailable: labels.slashStatusContextUnavailable,
|
|
25886
|
-
slashStatusLimitsUnavailable: labels.slashStatusLimitsUnavailable
|
|
26634
|
+
slashStatusLimitsUnavailable: labels.slashStatusLimitsUnavailable,
|
|
26635
|
+
slashStatusEmptyValue: labels.slashStatusEmptyValue,
|
|
26636
|
+
slashStatusUsageJustUpdated: labels.slashStatusUsageJustUpdated,
|
|
26637
|
+
slashStatusUsageMinutesAgo: labels.slashStatusUsageMinutesAgo,
|
|
26638
|
+
slashStatusUsageHoursAgo: labels.slashStatusUsageHoursAgo,
|
|
26639
|
+
slashStatusUsageUpdating: labels.slashStatusUsageUpdating,
|
|
26640
|
+
slashStatusUsageRefreshFailed: labels.slashStatusUsageRefreshFailed,
|
|
26641
|
+
slashStatusUsageRefreshAria: labels.slashStatusUsageRefreshAria
|
|
25887
26642
|
},
|
|
25888
|
-
onClose: closeSlashStatusPanel
|
|
26643
|
+
onClose: closeSlashStatusPanel,
|
|
26644
|
+
onRefresh: onSlashStatusRefresh
|
|
25889
26645
|
}
|
|
25890
26646
|
)
|
|
25891
26647
|
}
|
|
@@ -26019,12 +26775,12 @@ function AgentComposerView(input) {
|
|
|
26019
26775
|
}
|
|
26020
26776
|
|
|
26021
26777
|
// agent-gui/agentGuiNode/composer/useAgentMentionSearchController.ts
|
|
26022
|
-
import { useEffect as useEffect27, useMemo as
|
|
26778
|
+
import { useEffect as useEffect27, useMemo as useMemo31, useRef as useRef37, useState as useState24 } from "react";
|
|
26023
26779
|
import { useRichTextMentionService } from "@tutti-os/ui-rich-text/editor";
|
|
26024
26780
|
var EMPTY_AGENT_CONTEXT_MENTION_PROVIDERS = [];
|
|
26025
26781
|
function useAgentMentionSearchController(referenceProvenanceFilter) {
|
|
26026
26782
|
const mentionService = useRichTextMentionService();
|
|
26027
|
-
const contextMentionProviders =
|
|
26783
|
+
const contextMentionProviders = useMemo31(
|
|
26028
26784
|
() => mentionService?.listProviders().filter(isAgentContextMentionProvider) ?? EMPTY_AGENT_CONTEXT_MENTION_PROVIDERS,
|
|
26029
26785
|
[mentionService]
|
|
26030
26786
|
);
|
|
@@ -26077,7 +26833,7 @@ var INITIAL_AGENT_MENTION_SEARCH_STATE = {
|
|
|
26077
26833
|
};
|
|
26078
26834
|
|
|
26079
26835
|
// agent-gui/agentGuiNode/composer/quickPrompts/useAgentQuickPromptLibrary.ts
|
|
26080
|
-
import { useCallback as
|
|
26836
|
+
import { useCallback as useCallback43, useMemo as useMemo32, useRef as useRef38, useState as useState25 } from "react";
|
|
26081
26837
|
var unavailableSnapshot = {
|
|
26082
26838
|
enabled: false,
|
|
26083
26839
|
status: "idle",
|
|
@@ -26127,7 +26883,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26127
26883
|
setReorderError(null);
|
|
26128
26884
|
}
|
|
26129
26885
|
const effectiveMode = disclosureAvailable && previousDisclosureAvailable === disclosureAvailable ? mode : "closed";
|
|
26130
|
-
const filteredPrompts =
|
|
26886
|
+
const filteredPrompts = useMemo32(() => {
|
|
26131
26887
|
const query = searchQuery.trim().toLocaleLowerCase();
|
|
26132
26888
|
if (!query) {
|
|
26133
26889
|
return snapshot.prompts;
|
|
@@ -26143,7 +26899,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26143
26899
|
const showReorderHandles = Boolean(
|
|
26144
26900
|
quickPrompts?.move && capabilityAvailable && !searchQuery.trim() && filteredPrompts.length > 1
|
|
26145
26901
|
);
|
|
26146
|
-
const openPopover =
|
|
26902
|
+
const openPopover = useCallback43(() => {
|
|
26147
26903
|
if (!capabilityAvailable || disabled) {
|
|
26148
26904
|
return;
|
|
26149
26905
|
}
|
|
@@ -26162,7 +26918,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26162
26918
|
quickPrompts,
|
|
26163
26919
|
snapshot.status
|
|
26164
26920
|
]);
|
|
26165
|
-
const close =
|
|
26921
|
+
const close = useCallback43(() => {
|
|
26166
26922
|
modeRef.current = "closed";
|
|
26167
26923
|
setMode("closed");
|
|
26168
26924
|
setSelectedPrompt(null);
|
|
@@ -26171,7 +26927,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26171
26927
|
setMutationError(null);
|
|
26172
26928
|
setReorderError(null);
|
|
26173
26929
|
}, []);
|
|
26174
|
-
const closeDialog =
|
|
26930
|
+
const closeDialog = useCallback43(() => {
|
|
26175
26931
|
const nextMode = capabilityAvailable && !disabled ? "popover" : "closed";
|
|
26176
26932
|
modeRef.current = nextMode;
|
|
26177
26933
|
setMutationError(null);
|
|
@@ -26181,7 +26937,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26181
26937
|
setPromptToDelete(null);
|
|
26182
26938
|
setMode(nextMode);
|
|
26183
26939
|
}, [capabilityAvailable, disabled]);
|
|
26184
|
-
const setPopoverOpen =
|
|
26940
|
+
const setPopoverOpen = useCallback43(
|
|
26185
26941
|
(open) => {
|
|
26186
26942
|
if (open) {
|
|
26187
26943
|
openPopover();
|
|
@@ -26191,7 +26947,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26191
26947
|
},
|
|
26192
26948
|
[close, openPopover]
|
|
26193
26949
|
);
|
|
26194
|
-
const openCreate =
|
|
26950
|
+
const openCreate = useCallback43(
|
|
26195
26951
|
(draft) => {
|
|
26196
26952
|
if (isInteractionLocked) return;
|
|
26197
26953
|
modeRef.current = "create";
|
|
@@ -26202,7 +26958,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26202
26958
|
},
|
|
26203
26959
|
[isInteractionLocked]
|
|
26204
26960
|
);
|
|
26205
|
-
const openEdit =
|
|
26961
|
+
const openEdit = useCallback43(
|
|
26206
26962
|
(prompt) => {
|
|
26207
26963
|
if (isInteractionLocked) return;
|
|
26208
26964
|
modeRef.current = "edit";
|
|
@@ -26213,7 +26969,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26213
26969
|
},
|
|
26214
26970
|
[isInteractionLocked]
|
|
26215
26971
|
);
|
|
26216
|
-
const deletePrompt =
|
|
26972
|
+
const deletePrompt = useCallback43(
|
|
26217
26973
|
(prompt) => {
|
|
26218
26974
|
if (isInteractionLocked) return;
|
|
26219
26975
|
modeRef.current = "delete";
|
|
@@ -26223,7 +26979,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26223
26979
|
},
|
|
26224
26980
|
[isInteractionLocked]
|
|
26225
26981
|
);
|
|
26226
|
-
const saveDraft =
|
|
26982
|
+
const saveDraft = useCallback43(
|
|
26227
26983
|
async (draft) => {
|
|
26228
26984
|
if (!quickPrompts || !capabilityAvailable || isInteractionLocked) {
|
|
26229
26985
|
return false;
|
|
@@ -26262,7 +27018,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26262
27018
|
},
|
|
26263
27019
|
[capabilityAvailable, isInteractionLocked, quickPrompts, selectedPrompt]
|
|
26264
27020
|
);
|
|
26265
|
-
const submitDelete =
|
|
27021
|
+
const submitDelete = useCallback43(async () => {
|
|
26266
27022
|
if (!quickPrompts || !capabilityAvailable || !promptToDelete || isInteractionLocked) {
|
|
26267
27023
|
return false;
|
|
26268
27024
|
}
|
|
@@ -26295,14 +27051,14 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26295
27051
|
setIsDeleting(false);
|
|
26296
27052
|
}
|
|
26297
27053
|
}, [capabilityAvailable, isInteractionLocked, promptToDelete, quickPrompts]);
|
|
26298
|
-
const retry =
|
|
27054
|
+
const retry = useCallback43(() => {
|
|
26299
27055
|
if (!quickPrompts || !capabilityAvailable || isInteractionLocked) {
|
|
26300
27056
|
return;
|
|
26301
27057
|
}
|
|
26302
27058
|
setReorderError(null);
|
|
26303
27059
|
void quickPrompts.ensureLoaded({ force: true }).catch(() => void 0);
|
|
26304
27060
|
}, [capabilityAvailable, isInteractionLocked, quickPrompts]);
|
|
26305
|
-
const reorderPrompts =
|
|
27061
|
+
const reorderPrompts = useCallback43(
|
|
26306
27062
|
async (promptId, beforePromptId) => {
|
|
26307
27063
|
if (!quickPrompts?.move || !canReorder) return false;
|
|
26308
27064
|
const prompt = snapshot.prompts.find((item) => item.id === promptId);
|
|
@@ -26325,7 +27081,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26325
27081
|
},
|
|
26326
27082
|
[canReorder, quickPrompts, snapshot.prompts]
|
|
26327
27083
|
);
|
|
26328
|
-
const insertPromptContent =
|
|
27084
|
+
const insertPromptContent = useCallback43(
|
|
26329
27085
|
(content) => {
|
|
26330
27086
|
if (disabled || !capabilityAvailable || isInteractionLocked) {
|
|
26331
27087
|
return;
|
|
@@ -26335,14 +27091,14 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26335
27091
|
},
|
|
26336
27092
|
[capabilityAvailable, close, disabled, isInteractionLocked, onInsertPrompt]
|
|
26337
27093
|
);
|
|
26338
|
-
const updateSearchQuery =
|
|
27094
|
+
const updateSearchQuery = useCallback43(
|
|
26339
27095
|
(query) => {
|
|
26340
27096
|
if (isInteractionLocked) return;
|
|
26341
27097
|
setSearchQuery(query);
|
|
26342
27098
|
},
|
|
26343
27099
|
[isInteractionLocked]
|
|
26344
27100
|
);
|
|
26345
|
-
const selectPrompt =
|
|
27101
|
+
const selectPrompt = useCallback43(
|
|
26346
27102
|
(prompt) => {
|
|
26347
27103
|
insertPromptContent(prompt.content);
|
|
26348
27104
|
},
|
|
@@ -26798,7 +27554,7 @@ function AgentComposer(props) {
|
|
|
26798
27554
|
onLinkAction
|
|
26799
27555
|
});
|
|
26800
27556
|
const { addDraftFiles, addDraftImages } = attachments;
|
|
26801
|
-
const addExternalPromptEntries =
|
|
27557
|
+
const addExternalPromptEntries = useCallback44(
|
|
26802
27558
|
(files) => {
|
|
26803
27559
|
const entries = resolveAgentExternalPromptEntries(
|
|
26804
27560
|
files,
|
|
@@ -26837,11 +27593,11 @@ function AgentComposer(props) {
|
|
|
26837
27593
|
defaultHandoffMenuLabel: labels.handoffConversationMenu
|
|
26838
27594
|
});
|
|
26839
27595
|
const { inputDisabled, isHeroLayout } = providerState;
|
|
26840
|
-
const closeQuickPromptCompetingDisclosure =
|
|
27596
|
+
const closeQuickPromptCompetingDisclosure = useCallback44(() => {
|
|
26841
27597
|
mentionActions.closeFileMentionPalette();
|
|
26842
27598
|
slashActions.closeSlashFloatingMenu();
|
|
26843
27599
|
}, [mentionActions, slashActions]);
|
|
26844
|
-
const insertQuickPrompt =
|
|
27600
|
+
const insertQuickPrompt = useCallback44((content) => {
|
|
26845
27601
|
editorHandleRef.current?.insertPlainTextAtSelection(content);
|
|
26846
27602
|
}, []);
|
|
26847
27603
|
const quickPromptLibrary = useAgentQuickPromptLibrary({
|
|
@@ -27343,9 +28099,9 @@ import {
|
|
|
27343
28099
|
// shared/agentEnv/agentTargetSetupController.tsx
|
|
27344
28100
|
import {
|
|
27345
28101
|
createContext,
|
|
27346
|
-
useCallback as
|
|
28102
|
+
useCallback as useCallback45,
|
|
27347
28103
|
useContext,
|
|
27348
|
-
useMemo as
|
|
28104
|
+
useMemo as useMemo33,
|
|
27349
28105
|
useRef as useRef40
|
|
27350
28106
|
} from "react";
|
|
27351
28107
|
import { toast as toast2 } from "@tutti-os/ui-system";
|
|
@@ -27403,7 +28159,7 @@ function useCreateAgentTargetSetupController(agentTarget) {
|
|
|
27403
28159
|
const { t } = useTranslation();
|
|
27404
28160
|
const agentTargetId = agentTarget?.agentTargetId?.trim() || agentTarget?.targetId.trim() || "";
|
|
27405
28161
|
const enabled = agentTarget?.ref.setupKind === "target_runtime" && Boolean(hostApi?.agentTargetSetup && agentTargetId);
|
|
27406
|
-
const stableAgentTarget =
|
|
28162
|
+
const stableAgentTarget = useMemo33(
|
|
27407
28163
|
() => agentTarget,
|
|
27408
28164
|
[
|
|
27409
28165
|
agentTargetId,
|
|
@@ -27412,11 +28168,11 @@ function useCreateAgentTargetSetupController(agentTarget) {
|
|
|
27412
28168
|
agentTarget?.ref.setupKind
|
|
27413
28169
|
]
|
|
27414
28170
|
);
|
|
27415
|
-
const watch =
|
|
28171
|
+
const watch = useMemo33(
|
|
27416
28172
|
() => enabled ? hostApi?.agentTargetSetup?.watch({ agentTargetId }) ?? null : null,
|
|
27417
28173
|
[agentTargetId, enabled, hostApi?.agentTargetSetup]
|
|
27418
28174
|
);
|
|
27419
|
-
const showNotification =
|
|
28175
|
+
const showNotification = useCallback45(
|
|
27420
28176
|
(notification) => showTargetSetupFailureNotification({
|
|
27421
28177
|
hostToast: hostApi?.toast,
|
|
27422
28178
|
notification,
|
|
@@ -27424,7 +28180,7 @@ function useCreateAgentTargetSetupController(agentTarget) {
|
|
|
27424
28180
|
}),
|
|
27425
28181
|
[hostApi?.toast, t]
|
|
27426
28182
|
);
|
|
27427
|
-
const logCommandError =
|
|
28183
|
+
const logCommandError = useCallback45(
|
|
27428
28184
|
(command, error) => {
|
|
27429
28185
|
hostApi?.debug?.logRuntimeDiagnostics({
|
|
27430
28186
|
agentTargetId,
|
|
@@ -27436,7 +28192,7 @@ function useCreateAgentTargetSetupController(agentTarget) {
|
|
|
27436
28192
|
);
|
|
27437
28193
|
const controllerRef = useRef40(null);
|
|
27438
28194
|
const targetKey = enabled ? agentTargetId : "";
|
|
27439
|
-
const controllerEntry =
|
|
28195
|
+
const controllerEntry = useMemo33(() => {
|
|
27440
28196
|
const previousState = controllerRef.current?.targetKey === targetKey ? controllerRef.current.controller.getSnapshot() : null;
|
|
27441
28197
|
return {
|
|
27442
28198
|
controller: createAgentTargetSetupController({
|
|
@@ -27921,7 +28677,7 @@ var AgentGUIEmptyHomePane = memo3(function AgentGUIEmptyHomePane2({
|
|
|
27921
28677
|
}).fullLabel : runtimeProviderLabel;
|
|
27922
28678
|
const baseLabel = labels.emptyForProvider?.(provider) ?? labels.empty;
|
|
27923
28679
|
const emptyLabel = runtimeProviderLabel ? baseLabel.replace(runtimeProviderLabel, providerLabel) : baseLabel;
|
|
27924
|
-
const avatarPresentations =
|
|
28680
|
+
const avatarPresentations = useMemo34(
|
|
27925
28681
|
() => agentTargets.length ? agentTargets.map(projectAgentGUIAgentTargetAvatar) : selectedAgentTarget ? [projectAgentGUIAgentTargetAvatar(selectedAgentTarget)] : [
|
|
27926
28682
|
createFallbackAgentGUIAgentAvatar({
|
|
27927
28683
|
provider,
|
|
@@ -28872,7 +29628,7 @@ function AgentGUIProviderManagerDialog({
|
|
|
28872
29628
|
}
|
|
28873
29629
|
|
|
28874
29630
|
// agent-gui/agentGuiNode/view/useAgentGUIProviderRailPreferences.ts
|
|
28875
|
-
import { useCallback as
|
|
29631
|
+
import { useCallback as useCallback46, useEffect as useEffect29, useState as useState29 } from "react";
|
|
28876
29632
|
function readAgentGUIProviderRailPreferences(storageKey) {
|
|
28877
29633
|
return parseAgentGUIProviderRailPreferences(
|
|
28878
29634
|
globalThis.localStorage?.getItem(storageKey)
|
|
@@ -28905,7 +29661,7 @@ function useAgentGUIProviderRailPreferences() {
|
|
|
28905
29661
|
);
|
|
28906
29662
|
};
|
|
28907
29663
|
}, [storageKey]);
|
|
28908
|
-
const persistPreferences =
|
|
29664
|
+
const persistPreferences = useCallback46(
|
|
28909
29665
|
(nextPreferences) => {
|
|
28910
29666
|
setPreferences(nextPreferences);
|
|
28911
29667
|
globalThis.localStorage?.setItem(
|
|
@@ -29015,14 +29771,14 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29015
29771
|
} = useAgentGUIProviderRailPreferences();
|
|
29016
29772
|
const [dragState, setDragState] = useState30(null);
|
|
29017
29773
|
const dragStateRef = useRef42(null);
|
|
29018
|
-
const setProviderRailDragState =
|
|
29774
|
+
const setProviderRailDragState = useCallback47(
|
|
29019
29775
|
(nextDragState) => {
|
|
29020
29776
|
dragStateRef.current = nextDragState;
|
|
29021
29777
|
setDragState(nextDragState);
|
|
29022
29778
|
},
|
|
29023
29779
|
[]
|
|
29024
29780
|
);
|
|
29025
|
-
const railProviderTargets =
|
|
29781
|
+
const railProviderTargets = useMemo35(
|
|
29026
29782
|
() => agentGUIProviderRailTargets(
|
|
29027
29783
|
agentTargets,
|
|
29028
29784
|
agentTargetsLoading,
|
|
@@ -29031,7 +29787,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29031
29787
|
),
|
|
29032
29788
|
[comingSoonProviders, providerRailMode, agentTargets, agentTargetsLoading]
|
|
29033
29789
|
);
|
|
29034
|
-
const providerTiles =
|
|
29790
|
+
const providerTiles = useMemo35(() => {
|
|
29035
29791
|
const targets = [...railProviderTargets];
|
|
29036
29792
|
const orderedTargets = providerRailMode === "exact" ? targets : (() => {
|
|
29037
29793
|
const originalIndexByTarget = /* @__PURE__ */ new Map();
|
|
@@ -29071,7 +29827,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29071
29827
|
agentTargets: providerTiles,
|
|
29072
29828
|
conversations
|
|
29073
29829
|
});
|
|
29074
|
-
const visibleProviderTiles =
|
|
29830
|
+
const visibleProviderTiles = useMemo35(
|
|
29075
29831
|
() => applyAgentGUIProviderRailVisibility(
|
|
29076
29832
|
providerTiles,
|
|
29077
29833
|
effectiveHiddenTargetIds
|
|
@@ -29079,11 +29835,11 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29079
29835
|
[effectiveHiddenTargetIds, providerTiles]
|
|
29080
29836
|
);
|
|
29081
29837
|
const allTileSelected = conversationFilter.kind === "all";
|
|
29082
|
-
const selectAllProviders =
|
|
29838
|
+
const selectAllProviders = useCallback47(() => {
|
|
29083
29839
|
onUpdateConversationFilter({ kind: "all" });
|
|
29084
29840
|
onRequestComposerFocus();
|
|
29085
29841
|
}, [onRequestComposerFocus, onUpdateConversationFilter]);
|
|
29086
|
-
const selectAgentTargetTile =
|
|
29842
|
+
const selectAgentTargetTile = useCallback47(
|
|
29087
29843
|
(target) => {
|
|
29088
29844
|
const agentTargetId = target.agentTargetId?.trim() ?? "";
|
|
29089
29845
|
if (!agentTargetId) {
|
|
@@ -29097,10 +29853,10 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29097
29853
|
},
|
|
29098
29854
|
[onRequestComposerFocus, onSelectConversationFilterTarget]
|
|
29099
29855
|
);
|
|
29100
|
-
const clearProviderRailDragState =
|
|
29856
|
+
const clearProviderRailDragState = useCallback47(() => {
|
|
29101
29857
|
setProviderRailDragState(null);
|
|
29102
29858
|
}, [setProviderRailDragState]);
|
|
29103
|
-
const handleProviderRailDragStart =
|
|
29859
|
+
const handleProviderRailDragStart = useCallback47(
|
|
29104
29860
|
(event, target) => {
|
|
29105
29861
|
if (previewMode || agentTargetsLoading) {
|
|
29106
29862
|
event.preventDefault();
|
|
@@ -29116,7 +29872,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29116
29872
|
},
|
|
29117
29873
|
[previewMode, agentTargetsLoading, setProviderRailDragState]
|
|
29118
29874
|
);
|
|
29119
|
-
const handleProviderRailDragOver =
|
|
29875
|
+
const handleProviderRailDragOver = useCallback47(
|
|
29120
29876
|
(event, target) => {
|
|
29121
29877
|
if (previewMode || agentTargetsLoading || !dragState) {
|
|
29122
29878
|
return;
|
|
@@ -29148,7 +29904,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29148
29904
|
},
|
|
29149
29905
|
[dragState, previewMode, agentTargetsLoading, setProviderRailDragState]
|
|
29150
29906
|
);
|
|
29151
|
-
const commitProviderRailDragDrop =
|
|
29907
|
+
const commitProviderRailDragDrop = useCallback47(
|
|
29152
29908
|
(event) => {
|
|
29153
29909
|
const fallbackDraggedTargetId = event.dataTransfer.getData("text/plain").trim();
|
|
29154
29910
|
const activeDragState = dragStateRef.current ?? dragState ?? (fallbackDraggedTargetId ? {
|
|
@@ -29277,7 +30033,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29277
30033
|
onUpdateConversationFilter({ kind: "all" });
|
|
29278
30034
|
}
|
|
29279
30035
|
};
|
|
29280
|
-
const handleProviderRailContainerDragOver =
|
|
30036
|
+
const handleProviderRailContainerDragOver = useCallback47(
|
|
29281
30037
|
(event) => {
|
|
29282
30038
|
const activeDragState = dragStateRef.current ?? dragState;
|
|
29283
30039
|
if (!activeDragState || previewMode || agentTargetsLoading) {
|
|
@@ -29490,7 +30246,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29490
30246
|
import { memo as memo9, useState as useState36 } from "react";
|
|
29491
30247
|
|
|
29492
30248
|
// agent-gui/agentGuiNode/view/AgentGUIConversationRailPane.tsx
|
|
29493
|
-
import { Fragment as Fragment19, memo as memo8, useEffect as useEffect30, useMemo as
|
|
30249
|
+
import { Fragment as Fragment19, memo as memo8, useEffect as useEffect30, useMemo as useMemo38, useRef as useRef45, useState as useState35 } from "react";
|
|
29494
30250
|
import { Button as SystemButton } from "@tutti-os/ui-system";
|
|
29495
30251
|
import { ScrollArea as ScrollArea2 } from "@tutti-os/ui-system/components";
|
|
29496
30252
|
import { CreateChatIcon as CreateChatIcon2 } from "@tutti-os/ui-system/icons";
|
|
@@ -30233,7 +30989,7 @@ function reduceAgentGUIConversationRailViewState(state, action) {
|
|
|
30233
30989
|
}
|
|
30234
30990
|
|
|
30235
30991
|
// agent-gui/agentGuiNode/controller/useAgentGUIProjectDrag.ts
|
|
30236
|
-
import { useCallback as
|
|
30992
|
+
import { useCallback as useCallback48, useState as useState31 } from "react";
|
|
30237
30993
|
var PROJECT_DRAG_SCROLL_EDGE_PX = 40;
|
|
30238
30994
|
function projectDragAutoScrollDelta(clientY, bounds) {
|
|
30239
30995
|
if (clientY < bounds.top + PROJECT_DRAG_SCROLL_EDGE_PX) {
|
|
@@ -30261,14 +31017,14 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30261
31017
|
image: null,
|
|
30262
31018
|
viewport: null
|
|
30263
31019
|
}));
|
|
30264
|
-
const stopAutoScroll =
|
|
31020
|
+
const stopAutoScroll = useCallback48(() => {
|
|
30265
31021
|
if (runtime.frame !== null) {
|
|
30266
31022
|
window.cancelAnimationFrame(runtime.frame);
|
|
30267
31023
|
runtime.frame = null;
|
|
30268
31024
|
}
|
|
30269
31025
|
runtime.clientY = null;
|
|
30270
31026
|
}, [runtime]);
|
|
30271
|
-
const clear =
|
|
31027
|
+
const clear = useCallback48(() => {
|
|
30272
31028
|
stopAutoScroll();
|
|
30273
31029
|
runtime.image?.remove();
|
|
30274
31030
|
runtime.image = null;
|
|
@@ -30277,7 +31033,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30277
31033
|
runtime.viewport = null;
|
|
30278
31034
|
setDragState(null);
|
|
30279
31035
|
}, [runtime, stopAutoScroll]);
|
|
30280
|
-
const runAutoScroll =
|
|
31036
|
+
const runAutoScroll = useCallback48(() => {
|
|
30281
31037
|
runtime.frame = null;
|
|
30282
31038
|
const viewport = runtime.viewport ?? input.scrollViewportRef.current;
|
|
30283
31039
|
if (!runtime.active || !viewport || runtime.clientY === null) return;
|
|
@@ -30288,7 +31044,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30288
31044
|
runtime.frame = window.requestAnimationFrame(runAutoScroll);
|
|
30289
31045
|
}
|
|
30290
31046
|
}, [input.scrollViewportRef, runtime]);
|
|
30291
|
-
const trackPosition =
|
|
31047
|
+
const trackPosition = useCallback48(
|
|
30292
31048
|
(clientY) => {
|
|
30293
31049
|
if (!runtime.active) return;
|
|
30294
31050
|
runtime.clientY = clientY;
|
|
@@ -30298,7 +31054,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30298
31054
|
},
|
|
30299
31055
|
[runAutoScroll, runtime]
|
|
30300
31056
|
);
|
|
30301
|
-
const start =
|
|
31057
|
+
const start = useCallback48(
|
|
30302
31058
|
(section, event) => {
|
|
30303
31059
|
const projectId = section.project?.id?.trim() ?? "";
|
|
30304
31060
|
if (input.disabled || isMovePending || !projectId) {
|
|
@@ -30339,7 +31095,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30339
31095
|
},
|
|
30340
31096
|
[input.disabled, isMovePending, runtime]
|
|
30341
31097
|
);
|
|
30342
|
-
const updateTarget =
|
|
31098
|
+
const updateTarget = useCallback48(
|
|
30343
31099
|
(section, edge, event) => {
|
|
30344
31100
|
const targetId = section.project?.id?.trim() ?? "";
|
|
30345
31101
|
const currentDragState = runtime.dragState;
|
|
@@ -30379,7 +31135,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30379
31135
|
},
|
|
30380
31136
|
[input.userProjects, runtime, trackPosition]
|
|
30381
31137
|
);
|
|
30382
|
-
const drop =
|
|
31138
|
+
const drop = useCallback48(
|
|
30383
31139
|
async (event) => {
|
|
30384
31140
|
const currentDragState = runtime.dragState;
|
|
30385
31141
|
if (!currentDragState || !runtime.active) return;
|
|
@@ -30399,7 +31155,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30399
31155
|
},
|
|
30400
31156
|
[clear, input.onMoveProject, runtime]
|
|
30401
31157
|
);
|
|
30402
|
-
const keepValidDropTarget =
|
|
31158
|
+
const keepValidDropTarget = useCallback48(
|
|
30403
31159
|
(event) => {
|
|
30404
31160
|
if (!runtime.active || !runtime.dragState?.canDrop) return;
|
|
30405
31161
|
event.preventDefault();
|
|
@@ -30407,7 +31163,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30407
31163
|
},
|
|
30408
31164
|
[runtime]
|
|
30409
31165
|
);
|
|
30410
|
-
const installGlobalListeners =
|
|
31166
|
+
const installGlobalListeners = useCallback48(() => {
|
|
30411
31167
|
const clearOnGlobalEnd = () => clear();
|
|
30412
31168
|
const trackGlobalPosition = (event) => trackPosition(event.clientY);
|
|
30413
31169
|
document.addEventListener("dragend", clearOnGlobalEnd, true);
|
|
@@ -30433,10 +31189,10 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30433
31189
|
}
|
|
30434
31190
|
|
|
30435
31191
|
// agent-gui/agentGuiNode/view/AgentGUIConversationRailSection.tsx
|
|
30436
|
-
import { memo as memo7, useCallback as
|
|
31192
|
+
import { memo as memo7, useCallback as useCallback52 } from "react";
|
|
30437
31193
|
|
|
30438
31194
|
// agent-gui/agentGuiNode/view/AgentGUIConversationRailItem.tsx
|
|
30439
|
-
import { memo as memo5, useCallback as
|
|
31195
|
+
import { memo as memo5, useCallback as useCallback50, useMemo as useMemo37 } from "react";
|
|
30440
31196
|
import { ExternalLink as ExternalLink3 } from "lucide-react";
|
|
30441
31197
|
import { IssueIcon, NewWorkspaceLinedIcon as NewWorkspaceLinedIcon2, cn as cn7 } from "@tutti-os/ui-system";
|
|
30442
31198
|
import { WorkspaceUserProjectSelect as WorkspaceUserProjectSelect2 } from "@tutti-os/workspace-user-project/ui";
|
|
@@ -30673,8 +31429,8 @@ function AgentGUIConversationRailRelativeTime({
|
|
|
30673
31429
|
// agent-gui/agentGuiNode/view/AgentGUIConversationActionsMenu.tsx
|
|
30674
31430
|
import {
|
|
30675
31431
|
Fragment as Fragment16,
|
|
30676
|
-
useCallback as
|
|
30677
|
-
useMemo as
|
|
31432
|
+
useCallback as useCallback49,
|
|
31433
|
+
useMemo as useMemo36,
|
|
30678
31434
|
useRef as useRef43,
|
|
30679
31435
|
useState as useState32
|
|
30680
31436
|
} from "react";
|
|
@@ -30757,7 +31513,7 @@ async function readWorkspaceImageAsAttachment(readFile, input) {
|
|
|
30757
31513
|
}
|
|
30758
31514
|
function useAgentGUIClipboardWriter(labels) {
|
|
30759
31515
|
const agentHostApi = useOptionalAgentHostApi();
|
|
30760
|
-
return
|
|
31516
|
+
return useCallback49(
|
|
30761
31517
|
(value, toastHandle) => {
|
|
30762
31518
|
const payload = typeof value === "string" ? { text: value } : value;
|
|
30763
31519
|
const clipboard = agentHostApi?.clipboard;
|
|
@@ -30793,7 +31549,7 @@ function useAgentGUIConversationCopyAction(labels) {
|
|
|
30793
31549
|
const agentHostApi = useOptionalAgentHostApi();
|
|
30794
31550
|
const agentActivityRuntime = useOptionalAgentActivityRuntime();
|
|
30795
31551
|
const writeClipboardValue = useAgentGUIClipboardWriter(labels);
|
|
30796
|
-
return
|
|
31552
|
+
return useCallback49(
|
|
30797
31553
|
(action, { conversation, uiLanguage, workspaceId }) => {
|
|
30798
31554
|
if (action === "copy-reference") {
|
|
30799
31555
|
writeClipboardValue(
|
|
@@ -30888,7 +31644,7 @@ function useConversationActionGroups({
|
|
|
30888
31644
|
const copyConversationValue = useAgentGUIConversationCopyAction(labels);
|
|
30889
31645
|
const [resetKey, setResetKey] = useState32(0);
|
|
30890
31646
|
const pendingActionRef = useRef43(false);
|
|
30891
|
-
const run =
|
|
31647
|
+
const run = useCallback49(
|
|
30892
31648
|
(action) => {
|
|
30893
31649
|
if (pendingActionRef.current) {
|
|
30894
31650
|
return;
|
|
@@ -30904,7 +31660,7 @@ function useConversationActionGroups({
|
|
|
30904
31660
|
},
|
|
30905
31661
|
[isInteractionLocked]
|
|
30906
31662
|
);
|
|
30907
|
-
const groups =
|
|
31663
|
+
const groups = useMemo36(() => {
|
|
30908
31664
|
const clipboardUnavailable = typeof agentHostApi?.clipboard?.writeText !== "function";
|
|
30909
31665
|
const copyItem = (action, icon, label, disabled = false) => ({
|
|
30910
31666
|
// copy-reference builds the mention link synchronously from the
|
|
@@ -31137,13 +31893,13 @@ var AgentGUIConversationRailItem = memo5(
|
|
|
31137
31893
|
workspaceId,
|
|
31138
31894
|
agentTargets
|
|
31139
31895
|
);
|
|
31140
|
-
const setItemElement =
|
|
31896
|
+
const setItemElement = useCallback50(
|
|
31141
31897
|
(element) => {
|
|
31142
31898
|
registerItemElement(item.id, element);
|
|
31143
31899
|
},
|
|
31144
31900
|
[item.id, registerItemElement]
|
|
31145
31901
|
);
|
|
31146
|
-
const handleMouseLeave =
|
|
31902
|
+
const handleMouseLeave = useCallback50(() => {
|
|
31147
31903
|
if (isPendingDeleteConversation && !isRailInteractionLocked()) {
|
|
31148
31904
|
onCancelDeleteConversation();
|
|
31149
31905
|
}
|
|
@@ -31364,7 +32120,7 @@ function AgentGUIProjectRailHeader({
|
|
|
31364
32120
|
}) {
|
|
31365
32121
|
"use memo";
|
|
31366
32122
|
const agentHostApi = useAgentHostApi();
|
|
31367
|
-
const userProjectApi =
|
|
32123
|
+
const userProjectApi = useMemo37(
|
|
31368
32124
|
() => createAgentGUIUserProjectSelectionApi({
|
|
31369
32125
|
selectProjectDirectory,
|
|
31370
32126
|
userProjects: agentHostApi.userProjects
|
|
@@ -31435,7 +32191,7 @@ function AgentGUIProjectRailHeader({
|
|
|
31435
32191
|
}
|
|
31436
32192
|
|
|
31437
32193
|
// agent-gui/agentGuiNode/view/AgentGUIConversationRailSectionHeader.tsx
|
|
31438
|
-
import { forwardRef as forwardRef5, memo as memo6, useCallback as
|
|
32194
|
+
import { forwardRef as forwardRef5, memo as memo6, useCallback as useCallback51, useState as useState33 } from "react";
|
|
31439
32195
|
import { ChevronRight as ChevronRight2 } from "lucide-react";
|
|
31440
32196
|
import {
|
|
31441
32197
|
DropdownMenu as DropdownMenu5,
|
|
@@ -31847,7 +32603,7 @@ var AgentGUIConversationRailSectionHeader = memo6(
|
|
|
31847
32603
|
"use memo";
|
|
31848
32604
|
const [projectMenuOpen, setProjectMenuOpen] = useState33(false);
|
|
31849
32605
|
const [conversationMenuOpen, setConversationMenuOpen] = useState33(false);
|
|
31850
|
-
const handleProjectMenuOpenChange =
|
|
32606
|
+
const handleProjectMenuOpenChange = useCallback51(
|
|
31851
32607
|
(open) => {
|
|
31852
32608
|
setProjectMenuOpen(open);
|
|
31853
32609
|
onProjectMenuOpenChange(open);
|
|
@@ -31999,7 +32755,7 @@ var AgentGUIConversationRailSection = memo7(
|
|
|
31999
32755
|
const visibleCountTowardTotal = visiblePageableIds.size + (activeConversationCountsTowardTotal && activeConversation && visibleItems.some((item) => item.id === activeConversation.id) && !visiblePageableIds.has(activeConversation.id) ? 1 : 0);
|
|
32000
32756
|
const canShowMore = !isSectionCollapsed && visibleCountTowardTotal < sectionTotalCount && (visibleItemCount < pageableItems.length || sectionHasMore);
|
|
32001
32757
|
const canShowLess = !isSectionCollapsed && visibleItemCount > AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE;
|
|
32002
|
-
const showMoreConversations =
|
|
32758
|
+
const showMoreConversations = useCallback52(() => {
|
|
32003
32759
|
if (isRailInteractionLocked()) return;
|
|
32004
32760
|
if (visibleItemCount >= pageableItems.length && sectionHasMore) {
|
|
32005
32761
|
onLoadMoreConversations(section);
|
|
@@ -32026,7 +32782,7 @@ var AgentGUIConversationRailSection = memo7(
|
|
|
32026
32782
|
visibleItemCount,
|
|
32027
32783
|
visibleItemLimit
|
|
32028
32784
|
]);
|
|
32029
|
-
const showLessConversations =
|
|
32785
|
+
const showLessConversations = useCallback52(() => {
|
|
32030
32786
|
if (isRailInteractionLocked()) return;
|
|
32031
32787
|
onVisibleItemLimitChange(
|
|
32032
32788
|
section.id,
|
|
@@ -32238,7 +32994,7 @@ function AgentGUIProjectActionConfirmationDialog(props) {
|
|
|
32238
32994
|
}
|
|
32239
32995
|
|
|
32240
32996
|
// agent-gui/agentGuiNode/view/useAgentGUIConversationRailViewState.ts
|
|
32241
|
-
import { useCallback as
|
|
32997
|
+
import { useCallback as useCallback53, useLayoutEffect as useLayoutEffect6, useReducer, useRef as useRef44 } from "react";
|
|
32242
32998
|
function applyRailScrollNavigation(input) {
|
|
32243
32999
|
const activeConversationId = input.activeConversationId?.trim() || null;
|
|
32244
33000
|
const current = input.current.navigationKey === input.navigationKey ? input.current : {
|
|
@@ -32338,7 +33094,7 @@ function useAgentGUIConversationRailViewState(input) {
|
|
|
32338
33094
|
navigationKey,
|
|
32339
33095
|
searchActive
|
|
32340
33096
|
]);
|
|
32341
|
-
const registerConversationItemElement =
|
|
33097
|
+
const registerConversationItemElement = useCallback53(
|
|
32342
33098
|
(itemId, element) => {
|
|
32343
33099
|
if (element) {
|
|
32344
33100
|
conversationItemElementsRef.current.set(itemId, element);
|
|
@@ -32378,14 +33134,14 @@ function useAgentGUIConversationRailViewState(input) {
|
|
|
32378
33134
|
}
|
|
32379
33135
|
|
|
32380
33136
|
// agent-gui/agentGuiNode/view/useAgentGUIProjectMenuState.ts
|
|
32381
|
-
import { useCallback as
|
|
33137
|
+
import { useCallback as useCallback54, useState as useState34 } from "react";
|
|
32382
33138
|
function useAgentGUIProjectMenuState(isRailInteractionLocked, isUserProjectMutationPending) {
|
|
32383
33139
|
const [openSectionId, setOpenSectionId] = useState34(null);
|
|
32384
|
-
const isProjectActionLocked =
|
|
33140
|
+
const isProjectActionLocked = useCallback54(
|
|
32385
33141
|
() => isRailInteractionLocked() || isUserProjectMutationPending,
|
|
32386
33142
|
[isRailInteractionLocked, isUserProjectMutationPending]
|
|
32387
33143
|
);
|
|
32388
|
-
const onProjectMenuOpenChange =
|
|
33144
|
+
const onProjectMenuOpenChange = useCallback54(
|
|
32389
33145
|
(sectionId, open) => {
|
|
32390
33146
|
setOpenSectionId(
|
|
32391
33147
|
(current) => open ? sectionId : current === sectionId ? null : current
|
|
@@ -32530,7 +33286,7 @@ var AgentGUIConversationRailPane = memo8(
|
|
|
32530
33286
|
userProjects
|
|
32531
33287
|
});
|
|
32532
33288
|
const railActiveOverlay = runtimeDisplayProjection.activeOverlay;
|
|
32533
|
-
const displayConversations =
|
|
33289
|
+
const displayConversations = useMemo38(() => {
|
|
32534
33290
|
if (backendSearchActive) {
|
|
32535
33291
|
return backendSearchConversations;
|
|
32536
33292
|
}
|
|
@@ -32551,7 +33307,7 @@ var AgentGUIConversationRailPane = memo8(
|
|
|
32551
33307
|
runtimeRailSections,
|
|
32552
33308
|
runtimeSectionsEnabled
|
|
32553
33309
|
]);
|
|
32554
|
-
const filteredConversationResult =
|
|
33310
|
+
const filteredConversationResult = useMemo38(() => {
|
|
32555
33311
|
const startedAtMs = agentGuiPerfNowMs();
|
|
32556
33312
|
const query = conversationQuery.trim().toLowerCase();
|
|
32557
33313
|
const items = backendSearchActive ? displayConversations : !query ? displayConversations : displayConversations.filter(
|
|
@@ -32569,7 +33325,7 @@ var AgentGUIConversationRailPane = memo8(
|
|
|
32569
33325
|
uiLanguage
|
|
32570
33326
|
]);
|
|
32571
33327
|
const filteredConversations = filteredConversationResult.items;
|
|
32572
|
-
const groupedConversationResult =
|
|
33328
|
+
const groupedConversationResult = useMemo38(() => {
|
|
32573
33329
|
const startedAtMs = agentGuiPerfNowMs();
|
|
32574
33330
|
const query = conversationQuery.trim();
|
|
32575
33331
|
const rawGroups = backendSearchActive ? projectConversationRailSearchSections({
|
|
@@ -32622,7 +33378,7 @@ var AgentGUIConversationRailPane = memo8(
|
|
|
32622
33378
|
sectionAgentTargetFallbackId,
|
|
32623
33379
|
workspaceId
|
|
32624
33380
|
});
|
|
32625
|
-
const groupedConversationIdentityKey =
|
|
33381
|
+
const groupedConversationIdentityKey = useMemo38(
|
|
32626
33382
|
() => `${groupedConversations.map(
|
|
32627
33383
|
(section) => `${section.id}:${section.items.map((item) => item.id).join(",")}`
|
|
32628
33384
|
).join("|")}|active:${railActiveOverlay?.conversation.id ?? ""}`,
|
|
@@ -32894,7 +33650,7 @@ var AgentGUIConversationRailPane = memo8(
|
|
|
32894
33650
|
);
|
|
32895
33651
|
|
|
32896
33652
|
// agent-gui/agentGuiNode/controller/useAgentGUIConversationRailQuery.ts
|
|
32897
|
-
import { useEffect as useEffect31, useMemo as
|
|
33653
|
+
import { useEffect as useEffect31, useMemo as useMemo39, useRef as useRef46 } from "react";
|
|
32898
33654
|
|
|
32899
33655
|
// agent-gui/agentGuiNode/controller/agentGuiConversationRailDiagnostics.ts
|
|
32900
33656
|
var CONVERSATION_RAIL_SLOW_DIAGNOSTIC_THRESHOLD_MS = 250;
|
|
@@ -34011,13 +34767,13 @@ function useAgentGUIConversationRailQuery({
|
|
|
34011
34767
|
workspaceId
|
|
34012
34768
|
}) {
|
|
34013
34769
|
const runtime = useAgentActivityRuntime();
|
|
34014
|
-
const engine =
|
|
34770
|
+
const engine = useMemo39(
|
|
34015
34771
|
() => runtime.getSessionEngine(workspaceId),
|
|
34016
34772
|
[runtime, workspaceId]
|
|
34017
34773
|
);
|
|
34018
34774
|
const activeConversationIdRef = useRef46(activeConversationId);
|
|
34019
34775
|
activeConversationIdRef.current = activeConversationId;
|
|
34020
|
-
const controller =
|
|
34776
|
+
const controller = useMemo39(
|
|
34021
34777
|
() => new AgentGUIConversationRailQueryController({
|
|
34022
34778
|
engine,
|
|
34023
34779
|
getActiveConversationId: () => activeConversationIdRef.current,
|
|
@@ -34055,7 +34811,7 @@ function useAgentGUIConversationRailQuery({
|
|
|
34055
34811
|
identitySnapshot,
|
|
34056
34812
|
Object.is
|
|
34057
34813
|
);
|
|
34058
|
-
const requestedRailScopeKey =
|
|
34814
|
+
const requestedRailScopeKey = useMemo39(
|
|
34059
34815
|
() => resolveConversationRailQueryScope(workspaceId, {
|
|
34060
34816
|
conversationFilter,
|
|
34061
34817
|
previewMode,
|
|
@@ -34070,7 +34826,7 @@ function useAgentGUIConversationRailQuery({
|
|
|
34070
34826
|
workspaceId
|
|
34071
34827
|
]
|
|
34072
34828
|
);
|
|
34073
|
-
return
|
|
34829
|
+
return useMemo39(
|
|
34074
34830
|
() => ({
|
|
34075
34831
|
...querySnapshot,
|
|
34076
34832
|
isInteractionLocked: controller.isInteractionLocked,
|
|
@@ -34120,9 +34876,9 @@ var AgentGUIConversationRailController = memo9(
|
|
|
34120
34876
|
// agent-gui/agentGuiNode/view/AgentGUIDetailPane.tsx
|
|
34121
34877
|
import {
|
|
34122
34878
|
memo as memo12,
|
|
34123
|
-
useCallback as
|
|
34879
|
+
useCallback as useCallback56,
|
|
34124
34880
|
useEffect as useEffect34,
|
|
34125
|
-
useMemo as
|
|
34881
|
+
useMemo as useMemo41,
|
|
34126
34882
|
useRef as useRef49,
|
|
34127
34883
|
useState as useState41
|
|
34128
34884
|
} from "react";
|
|
@@ -34746,7 +35502,7 @@ function setTimelineScrollTopWithUserTransition(element, top) {
|
|
|
34746
35502
|
|
|
34747
35503
|
// agent-gui/agentGuiNode/view/useAgentGUIDetailScroll.ts
|
|
34748
35504
|
import {
|
|
34749
|
-
useCallback as
|
|
35505
|
+
useCallback as useCallback55,
|
|
34750
35506
|
useEffect as useEffect33,
|
|
34751
35507
|
useLayoutEffect as useLayoutEffect7,
|
|
34752
35508
|
useRef as useRef48,
|
|
@@ -35090,7 +35846,7 @@ function useAgentGUIDetailScroll(input) {
|
|
|
35090
35846
|
viewModel.detail.hasOlderMessages,
|
|
35091
35847
|
viewModel.detail.isLoadingOlderMessages
|
|
35092
35848
|
]);
|
|
35093
|
-
const scrollTimelineToBottom =
|
|
35849
|
+
const scrollTimelineToBottom = useCallback55(() => {
|
|
35094
35850
|
const timeline = timelineRef.current;
|
|
35095
35851
|
const activeConversationId = timelineConversationId;
|
|
35096
35852
|
if (!timeline || !activeConversationId) {
|
|
@@ -35125,7 +35881,7 @@ function useAgentGUIDetailScroll(input) {
|
|
|
35125
35881
|
}
|
|
35126
35882
|
|
|
35127
35883
|
// agent-gui/agentGuiNode/view/useAgentGUIDetailModel.tsx
|
|
35128
|
-
import { useMemo as
|
|
35884
|
+
import { useMemo as useMemo40 } from "react";
|
|
35129
35885
|
|
|
35130
35886
|
// app/renderer/components/icons/UnavailableChatIcon.tsx
|
|
35131
35887
|
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
@@ -35219,11 +35975,11 @@ function useAgentGUIDetailModel(input) {
|
|
|
35219
35975
|
const emptyProviderReadinessGate = !hasActiveConversation ? selectedAgentTargetComingSoon ? { status: "coming_soon" } : viewModel.readiness.providerReadinessGate : null;
|
|
35220
35976
|
const activePrompt = viewModel.interaction.pendingInteractivePrompt ?? viewModel.interaction.pendingApproval;
|
|
35221
35977
|
const activePromptRequestId = activePrompt?.requestId ?? null;
|
|
35222
|
-
const sessionChrome =
|
|
35978
|
+
const sessionChrome = useMemo40(
|
|
35223
35979
|
() => ({ ...viewModel.interaction.sessionChrome, approval: null }),
|
|
35224
35980
|
[viewModel.interaction.sessionChrome]
|
|
35225
35981
|
);
|
|
35226
|
-
const rawSlashStatus =
|
|
35982
|
+
const rawSlashStatus = useMemo40(
|
|
35227
35983
|
() => resolveSlashStatus({
|
|
35228
35984
|
rawState: viewModel.interaction.sessionChrome.rawState,
|
|
35229
35985
|
limits: slashStatusLimits,
|
|
@@ -35240,7 +35996,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35240
35996
|
]
|
|
35241
35997
|
);
|
|
35242
35998
|
const slashStatus = useStableSlashStatus(rawSlashStatus);
|
|
35243
|
-
const displayedInlineNotice =
|
|
35999
|
+
const displayedInlineNotice = useMemo40(() => {
|
|
35244
36000
|
const inlineNotice = viewModel.interaction.inlineNotice;
|
|
35245
36001
|
const inlineNoticeMessage = inlineNotice?.message.trim() ?? "";
|
|
35246
36002
|
if (!inlineNotice || inlineNoticeMessage === "") {
|
|
@@ -35264,7 +36020,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35264
36020
|
viewModel.readiness.activeLiveState,
|
|
35265
36021
|
viewModel.interaction.inlineNotice
|
|
35266
36022
|
]);
|
|
35267
|
-
const inlineNoticeChrome =
|
|
36023
|
+
const inlineNoticeChrome = useMemo40(() => {
|
|
35268
36024
|
if (!displayedInlineNotice) {
|
|
35269
36025
|
return null;
|
|
35270
36026
|
}
|
|
@@ -35316,7 +36072,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35316
36072
|
isSubmitting: viewModel.composer.isSubmitting,
|
|
35317
36073
|
isUnavailable: viewModel.readiness.activeLiveState === "failed" || viewModel.readiness.sessionRuntimeBlocked
|
|
35318
36074
|
});
|
|
35319
|
-
const conversationFlowLabels =
|
|
36075
|
+
const conversationFlowLabels = useMemo40(
|
|
35320
36076
|
() => ({
|
|
35321
36077
|
thinkingLabel: labels.thinkingLabel,
|
|
35322
36078
|
toolCallsLabel: labels.toolCallsLabel,
|
|
@@ -35332,7 +36088,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35332
36088
|
labels.userMessageLocator
|
|
35333
36089
|
]
|
|
35334
36090
|
);
|
|
35335
|
-
const conversationFlowEmpty =
|
|
36091
|
+
const conversationFlowEmpty = useMemo40(
|
|
35336
36092
|
() => showUnavailableChatEmpty ? /* @__PURE__ */ jsxs50(
|
|
35337
36093
|
"div",
|
|
35338
36094
|
{
|
|
@@ -35346,7 +36102,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35346
36102
|
) : /* @__PURE__ */ jsx71(Fragment21, {}),
|
|
35347
36103
|
[labels.conversationUnavailable, showUnavailableChatEmpty]
|
|
35348
36104
|
);
|
|
35349
|
-
const chromeLabels =
|
|
36105
|
+
const chromeLabels = useMemo40(
|
|
35350
36106
|
() => ({
|
|
35351
36107
|
approvalRequired: labels.approvalRequired,
|
|
35352
36108
|
authRequired: labels.authRequired,
|
|
@@ -35367,7 +36123,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35367
36123
|
viewModel.composer.isCancelPending
|
|
35368
36124
|
]
|
|
35369
36125
|
);
|
|
35370
|
-
const goalBannerLabels =
|
|
36126
|
+
const goalBannerLabels = useMemo40(
|
|
35371
36127
|
() => ({
|
|
35372
36128
|
titleActive: labels.goalTitleActive,
|
|
35373
36129
|
titlePaused: labels.goalTitlePaused,
|
|
@@ -35397,7 +36153,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35397
36153
|
labels.goalClearAction
|
|
35398
36154
|
]
|
|
35399
36155
|
);
|
|
35400
|
-
const interactivePromptLabels =
|
|
36156
|
+
const interactivePromptLabels = useMemo40(
|
|
35401
36157
|
() => ({
|
|
35402
36158
|
approvalLead: labels.approvalRequired,
|
|
35403
36159
|
fileChangeApprovalLead: labels.fileChangeApprovalRequired,
|
|
@@ -35437,7 +36193,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35437
36193
|
labels.planImplementationSkip
|
|
35438
36194
|
]
|
|
35439
36195
|
);
|
|
35440
|
-
const composerLabels =
|
|
36196
|
+
const composerLabels = useMemo40(
|
|
35441
36197
|
() => ({
|
|
35442
36198
|
send: labels.send,
|
|
35443
36199
|
modelLabel: labels.modelLabel,
|
|
@@ -35534,6 +36290,13 @@ function useAgentGUIDetailModel(input) {
|
|
|
35534
36290
|
slashStatusContextValue: labels.slashStatusContextValue,
|
|
35535
36291
|
slashStatusContextUnavailable: labels.slashStatusContextUnavailable,
|
|
35536
36292
|
slashStatusLimitsUnavailable: labels.slashStatusLimitsUnavailable,
|
|
36293
|
+
slashStatusEmptyValue: labels.slashStatusEmptyValue,
|
|
36294
|
+
slashStatusUsageJustUpdated: labels.slashStatusUsageJustUpdated,
|
|
36295
|
+
slashStatusUsageMinutesAgo: labels.slashStatusUsageMinutesAgo,
|
|
36296
|
+
slashStatusUsageHoursAgo: labels.slashStatusUsageHoursAgo,
|
|
36297
|
+
slashStatusUsageUpdating: labels.slashStatusUsageUpdating,
|
|
36298
|
+
slashStatusUsageRefreshFailed: labels.slashStatusUsageRefreshFailed,
|
|
36299
|
+
slashStatusUsageRefreshAria: labels.slashStatusUsageRefreshAria,
|
|
35537
36300
|
usageChipLabel: labels.usageChipLabel,
|
|
35538
36301
|
usageTooltipLabel: labels.usageTooltipLabel,
|
|
35539
36302
|
usagePopoverTitle: labels.usagePopoverTitle,
|
|
@@ -35678,6 +36441,13 @@ function useAgentGUIDetailModel(input) {
|
|
|
35678
36441
|
labels.slashStatusBaseUrl,
|
|
35679
36442
|
labels.slashStatusLimits,
|
|
35680
36443
|
labels.slashStatusLimitsUnavailable,
|
|
36444
|
+
labels.slashStatusEmptyValue,
|
|
36445
|
+
labels.slashStatusUsageHoursAgo,
|
|
36446
|
+
labels.slashStatusUsageJustUpdated,
|
|
36447
|
+
labels.slashStatusUsageMinutesAgo,
|
|
36448
|
+
labels.slashStatusUsageRefreshAria,
|
|
36449
|
+
labels.slashStatusUsageRefreshFailed,
|
|
36450
|
+
labels.slashStatusUsageUpdating,
|
|
35681
36451
|
labels.slashStatusSession,
|
|
35682
36452
|
labels.slashStatusTitle,
|
|
35683
36453
|
labels.usageChipLabel,
|
|
@@ -35790,7 +36560,10 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35790
36560
|
slashStatusLimits,
|
|
35791
36561
|
slashStatusLimitsLoading,
|
|
35792
36562
|
slashStatusLimitsUnavailable,
|
|
36563
|
+
slashStatusOverride,
|
|
35793
36564
|
onSlashStatusOpen,
|
|
36565
|
+
onSlashStatusClose,
|
|
36566
|
+
onSlashStatusRefresh,
|
|
35794
36567
|
onLinkAction,
|
|
35795
36568
|
onHandoffConversation,
|
|
35796
36569
|
capabilityMenuState,
|
|
@@ -35841,7 +36614,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35841
36614
|
showStopButton,
|
|
35842
36615
|
showTimelineSkeleton,
|
|
35843
36616
|
showUnavailableChatEmpty,
|
|
35844
|
-
slashStatus,
|
|
36617
|
+
slashStatus: derivedSlashStatus,
|
|
35845
36618
|
submitDisabled,
|
|
35846
36619
|
timelineConversationId,
|
|
35847
36620
|
timelineInteractionLocked
|
|
@@ -35853,7 +36626,8 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35853
36626
|
slashStatusLimitsUnavailable,
|
|
35854
36627
|
viewModel
|
|
35855
36628
|
});
|
|
35856
|
-
const
|
|
36629
|
+
const slashStatus = slashStatusOverride ?? derivedSlashStatus;
|
|
36630
|
+
const handleInterruptCurrentTurn = useCallback56(() => {
|
|
35857
36631
|
actions.interruptCurrentTurn(labels.noRunningResponse);
|
|
35858
36632
|
}, [actions.interruptCurrentTurn, labels.noRunningResponse]);
|
|
35859
36633
|
const submitApprovalOption = useStableEventCallback(
|
|
@@ -35873,14 +36647,14 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35873
36647
|
const selectHomeComposerAgentTarget = useStableEventCallback(
|
|
35874
36648
|
actions.selectHomeComposerAgentTarget
|
|
35875
36649
|
);
|
|
35876
|
-
const selectHomeComposerAgentTargetAndFocus =
|
|
36650
|
+
const selectHomeComposerAgentTargetAndFocus = useCallback56(
|
|
35877
36651
|
(input) => {
|
|
35878
36652
|
selectHomeComposerAgentTarget(input);
|
|
35879
36653
|
onRequestComposerFocus();
|
|
35880
36654
|
},
|
|
35881
36655
|
[onRequestComposerFocus, selectHomeComposerAgentTarget]
|
|
35882
36656
|
);
|
|
35883
|
-
const handleSelectHomeSuggestion =
|
|
36657
|
+
const handleSelectHomeSuggestion = useCallback56(
|
|
35884
36658
|
(prompt) => {
|
|
35885
36659
|
updateDraftContent(
|
|
35886
36660
|
updateAgentComposerDraft(viewModel.composer.draftContent, { prompt })
|
|
@@ -35888,7 +36662,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35888
36662
|
},
|
|
35889
36663
|
[updateDraftContent, viewModel.composer.draftContent]
|
|
35890
36664
|
);
|
|
35891
|
-
const handleHomeSuggestionAction =
|
|
36665
|
+
const handleHomeSuggestionAction = useCallback56(
|
|
35892
36666
|
(action) => {
|
|
35893
36667
|
if (action === "import-session") {
|
|
35894
36668
|
window.dispatchEvent(
|
|
@@ -35903,7 +36677,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35903
36677
|
const submitGuidancePrompt = useStableEventCallback(
|
|
35904
36678
|
actions.submitGuidancePrompt
|
|
35905
36679
|
);
|
|
35906
|
-
const requestSubmittedPromptScrollToBottom =
|
|
36680
|
+
const requestSubmittedPromptScrollToBottom = useCallback56(() => {
|
|
35907
36681
|
const activeConversationId = viewModel.rail.activeConversationId;
|
|
35908
36682
|
if (!activeConversationId) {
|
|
35909
36683
|
return;
|
|
@@ -35911,7 +36685,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35911
36685
|
submittedPromptScrollConversationRef.current = activeConversationId;
|
|
35912
36686
|
pendingPrependScrollAnchorRef.current = null;
|
|
35913
36687
|
}, [viewModel.rail.activeConversationId]);
|
|
35914
|
-
const submitPromptAndScrollToBottom =
|
|
36688
|
+
const submitPromptAndScrollToBottom = useCallback56(
|
|
35915
36689
|
(content, displayPrompt, options) => {
|
|
35916
36690
|
requestSubmittedPromptScrollToBottom();
|
|
35917
36691
|
if (displayPrompt === void 0) {
|
|
@@ -35922,7 +36696,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35922
36696
|
},
|
|
35923
36697
|
[requestSubmittedPromptScrollToBottom, submitPrompt]
|
|
35924
36698
|
);
|
|
35925
|
-
const submitGuidancePromptAndScrollToBottom =
|
|
36699
|
+
const submitGuidancePromptAndScrollToBottom = useCallback56(
|
|
35926
36700
|
(content, displayPrompt) => {
|
|
35927
36701
|
requestSubmittedPromptScrollToBottom();
|
|
35928
36702
|
if (displayPrompt === void 0) {
|
|
@@ -35953,7 +36727,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35953
36727
|
);
|
|
35954
36728
|
const stableRequestGitBranches = useOptionalStableEventCallback(onRequestGitBranches);
|
|
35955
36729
|
const authLogin = useOptionalStableEventCallback(onAgentProviderLogin);
|
|
35956
|
-
const submitBottomDockInteractivePrompt =
|
|
36730
|
+
const submitBottomDockInteractivePrompt = useCallback56(
|
|
35957
36731
|
(input) => {
|
|
35958
36732
|
submitInteractivePrompt(input);
|
|
35959
36733
|
setBottomDockDismissedPromptRequestId(input.requestId);
|
|
@@ -35991,7 +36765,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35991
36765
|
)
|
|
35992
36766
|
}) : void 0
|
|
35993
36767
|
);
|
|
35994
|
-
const bottomDockComposerProps =
|
|
36768
|
+
const bottomDockComposerProps = useMemo41(
|
|
35995
36769
|
() => ({
|
|
35996
36770
|
workspaceId: viewModel.shell.workspaceId,
|
|
35997
36771
|
workspacePath: viewModel.shell.workspacePath,
|
|
@@ -35999,6 +36773,8 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35999
36773
|
provider: composerProvider,
|
|
36000
36774
|
slashStatus,
|
|
36001
36775
|
onSlashStatusOpen,
|
|
36776
|
+
onSlashStatusClose,
|
|
36777
|
+
onSlashStatusRefresh,
|
|
36002
36778
|
usage: viewModel.detail.usage,
|
|
36003
36779
|
draftContent: viewModel.composer.draftContent,
|
|
36004
36780
|
engagement: composerEngagement,
|
|
@@ -36144,7 +36920,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
36144
36920
|
selectHomeComposerAgentTargetAndFocus
|
|
36145
36921
|
]
|
|
36146
36922
|
);
|
|
36147
|
-
const emptyHeroComposerProps =
|
|
36923
|
+
const emptyHeroComposerProps = useMemo41(
|
|
36148
36924
|
() => ({
|
|
36149
36925
|
...bottomDockComposerProps,
|
|
36150
36926
|
layoutMode: "hero"
|
|
@@ -36298,7 +37074,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
36298
37074
|
});
|
|
36299
37075
|
|
|
36300
37076
|
// agent-gui/agentGuiNode/view/AgentGUIRenameConversationDialog.tsx
|
|
36301
|
-
import { memo as memo13, useCallback as
|
|
37077
|
+
import { memo as memo13, useCallback as useCallback57, useEffect as useEffect35, useRef as useRef50, useState as useState42 } from "react";
|
|
36302
37078
|
import { ConfirmationDialog as ConfirmationDialog4, Input as Input4 } from "@tutti-os/ui-system";
|
|
36303
37079
|
import { jsx as jsx73, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
36304
37080
|
var AgentGUIRenameConversationDialog = memo13(
|
|
@@ -36336,12 +37112,12 @@ var AgentGUIRenameConversationDialog = memo13(
|
|
|
36336
37112
|
}, 0);
|
|
36337
37113
|
return () => window.clearTimeout(timer);
|
|
36338
37114
|
}, [open, conversation?.id]);
|
|
36339
|
-
const closeRenameDialog =
|
|
37115
|
+
const closeRenameDialog = useCallback57(() => {
|
|
36340
37116
|
if (!isSavingRef.current) {
|
|
36341
37117
|
onOpenChange(false);
|
|
36342
37118
|
}
|
|
36343
37119
|
}, [onOpenChange]);
|
|
36344
|
-
const confirmRename =
|
|
37120
|
+
const confirmRename = useCallback57(() => {
|
|
36345
37121
|
if (!conversation || isSavingRef.current || !trimmedTitle) {
|
|
36346
37122
|
return;
|
|
36347
37123
|
}
|
|
@@ -36498,7 +37274,6 @@ function AgentGUIReferencePickerSurface({
|
|
|
36498
37274
|
isNodeSelectable,
|
|
36499
37275
|
open,
|
|
36500
37276
|
purpose,
|
|
36501
|
-
provenanceFilter,
|
|
36502
37277
|
resolveEntryIconUrl,
|
|
36503
37278
|
workspaceId,
|
|
36504
37279
|
onClose,
|
|
@@ -36515,14 +37290,6 @@ function AgentGUIReferencePickerSurface({
|
|
|
36515
37290
|
fileManagerCopy: fileManagerCopy ?? void 0,
|
|
36516
37291
|
open,
|
|
36517
37292
|
purpose,
|
|
36518
|
-
provenanceFilter: provenanceFilter?.snapshot.value,
|
|
36519
|
-
provenanceFilterControl: provenanceFilter ? /* @__PURE__ */ jsx74(
|
|
36520
|
-
AgentReferenceProvenanceFilterControl,
|
|
36521
|
-
{
|
|
36522
|
-
filter: provenanceFilter,
|
|
36523
|
-
popoverElevation: "panel"
|
|
36524
|
-
}
|
|
36525
|
-
) : void 0,
|
|
36526
37293
|
resolveEntryIconUrl,
|
|
36527
37294
|
workspaceId,
|
|
36528
37295
|
onClose,
|
|
@@ -36545,11 +37312,11 @@ function AgentGUIReferencePickerSurface({
|
|
|
36545
37312
|
}
|
|
36546
37313
|
|
|
36547
37314
|
// agent-gui/agentGuiNode/view/AgentTargetSetupRoot.tsx
|
|
36548
|
-
import { useCallback as
|
|
37315
|
+
import { useCallback as useCallback58, useMemo as useMemo42 } from "react";
|
|
36549
37316
|
import { jsx as jsx75, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
36550
37317
|
function useAgentTargetSetupRoot(input) {
|
|
36551
37318
|
const { preferences } = useAgentGUIProviderRailPreferences();
|
|
36552
|
-
const homeTargetProjection =
|
|
37319
|
+
const homeTargetProjection = useMemo42(
|
|
36553
37320
|
() => projectAgentGUIManagedHomeTargets({
|
|
36554
37321
|
agentTargets: input.agentTargets,
|
|
36555
37322
|
preferences,
|
|
@@ -36563,7 +37330,7 @@ function useAgentTargetSetupRoot(input) {
|
|
|
36563
37330
|
);
|
|
36564
37331
|
const targetRuntimeSetupVisible = effectiveSelectedTarget.ref.setupKind === "target_runtime";
|
|
36565
37332
|
const environmentSetupVisible = targetRuntimeSetupVisible || !!resolveAgentGUIProviderCatalogIdentity(input.environmentProvider ?? "");
|
|
36566
|
-
const openAgentEnvSetup =
|
|
37333
|
+
const openAgentEnvSetup = useCallback58(() => {
|
|
36567
37334
|
if (targetRuntimeSetupVisible) {
|
|
36568
37335
|
controller.setDialogOpen(true);
|
|
36569
37336
|
return;
|
|
@@ -36604,7 +37371,7 @@ function AgentTargetSetupRoot({
|
|
|
36604
37371
|
}
|
|
36605
37372
|
|
|
36606
37373
|
// agent-gui/agentGuiNode/view/useAgentGUIWorkspaceReferencePicker.ts
|
|
36607
|
-
import { useCallback as
|
|
37374
|
+
import { useCallback as useCallback59, useMemo as useMemo43, useRef as useRef51, useState as useState43 } from "react";
|
|
36608
37375
|
import { createRichTextMentionHref } from "@tutti-os/ui-rich-text/core";
|
|
36609
37376
|
function useAgentGUIWorkspaceReferencePicker(input) {
|
|
36610
37377
|
const {
|
|
@@ -36623,12 +37390,12 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36623
37390
|
const [workspaceReferencePickerTarget, setWorkspaceReferencePickerTarget] = useState43(null);
|
|
36624
37391
|
const workspaceReferencePickerResolverRef = useRef51(null);
|
|
36625
37392
|
const projectDirectoryPickerResolverRef = useRef51(null);
|
|
36626
|
-
const emptyReferencePickResult =
|
|
37393
|
+
const emptyReferencePickResult = useMemo43(
|
|
36627
37394
|
() => ({ files: [], mentionItems: [] }),
|
|
36628
37395
|
[]
|
|
36629
37396
|
);
|
|
36630
37397
|
const hostLocalFileSourceId = "host-local-file";
|
|
36631
|
-
const isWorkspaceReferencePickerNodeSelectable =
|
|
37398
|
+
const isWorkspaceReferencePickerNodeSelectable = useCallback59(
|
|
36632
37399
|
(node) => {
|
|
36633
37400
|
if (workspaceReferencePickerPurpose === "directory") {
|
|
36634
37401
|
return node.kind === "folder";
|
|
@@ -36637,7 +37404,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36637
37404
|
},
|
|
36638
37405
|
[hostLocalFileSourceId, workspaceReferencePickerPurpose]
|
|
36639
37406
|
);
|
|
36640
|
-
const requestWorkspaceReferences =
|
|
37407
|
+
const requestWorkspaceReferences = useCallback59(
|
|
36641
37408
|
async (entity) => {
|
|
36642
37409
|
if (previewMode) {
|
|
36643
37410
|
return emptyReferencePickResult;
|
|
@@ -36673,7 +37440,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36673
37440
|
workspaceFileReferenceCopy
|
|
36674
37441
|
]
|
|
36675
37442
|
);
|
|
36676
|
-
const requestProjectDirectory =
|
|
37443
|
+
const requestProjectDirectory = useCallback59(async () => {
|
|
36677
37444
|
if (previewMode || !projectDirectorySourceAggregator) {
|
|
36678
37445
|
return null;
|
|
36679
37446
|
}
|
|
@@ -36687,7 +37454,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36687
37454
|
projectDirectoryPickerResolverRef.current = resolve;
|
|
36688
37455
|
});
|
|
36689
37456
|
}, [emptyReferencePickResult, previewMode, projectDirectorySourceAggregator]);
|
|
36690
|
-
const closeWorkspaceReferencePicker =
|
|
37457
|
+
const closeWorkspaceReferencePicker = useCallback59(() => {
|
|
36691
37458
|
workspaceReferencePickerResolverRef.current?.(emptyReferencePickResult);
|
|
36692
37459
|
workspaceReferencePickerResolverRef.current = null;
|
|
36693
37460
|
projectDirectoryPickerResolverRef.current?.(null);
|
|
@@ -36696,7 +37463,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36696
37463
|
setWorkspaceReferencePickerTarget(null);
|
|
36697
37464
|
setWorkspaceReferencePickerPurpose("reference");
|
|
36698
37465
|
}, [emptyReferencePickResult]);
|
|
36699
|
-
const settleReferencePicker =
|
|
37466
|
+
const settleReferencePicker = useCallback59(
|
|
36700
37467
|
(result, addedFiles) => {
|
|
36701
37468
|
workspaceReferencePickerResolverRef.current?.(result);
|
|
36702
37469
|
workspaceReferencePickerResolverRef.current = null;
|
|
@@ -36709,7 +37476,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36709
37476
|
},
|
|
36710
37477
|
[onWorkspaceFileReferencesAdded]
|
|
36711
37478
|
);
|
|
36712
|
-
const confirmWorkspaceReferencePicker =
|
|
37479
|
+
const confirmWorkspaceReferencePicker = useCallback59(
|
|
36713
37480
|
(refs) => {
|
|
36714
37481
|
if (workspaceReferencePickerPurpose === "directory") {
|
|
36715
37482
|
const directory = refs.find((ref) => ref.kind === "folder") ?? null;
|
|
@@ -36726,7 +37493,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36726
37493
|
},
|
|
36727
37494
|
[settleReferencePicker, workspaceReferencePickerPurpose]
|
|
36728
37495
|
);
|
|
36729
|
-
const confirmWorkspaceReferenceBundles =
|
|
37496
|
+
const confirmWorkspaceReferenceBundles = useCallback59(
|
|
36730
37497
|
(result) => {
|
|
36731
37498
|
const workspaceRefs = result.files.filter(
|
|
36732
37499
|
(ref) => ref.sourceId !== hostLocalFileSourceId
|
|
@@ -37026,7 +37793,7 @@ function useAgentGUINodeEngagement(input) {
|
|
|
37026
37793
|
}
|
|
37027
37794
|
|
|
37028
37795
|
// agent-gui/agentGuiNode/view/useAgentGUIConversationRailResizePointerMove.ts
|
|
37029
|
-
import { useCallback as
|
|
37796
|
+
import { useCallback as useCallback60 } from "react";
|
|
37030
37797
|
function useAgentGUIConversationRailResizePointerMove({
|
|
37031
37798
|
clampConversationRailWidth,
|
|
37032
37799
|
layoutElementRef,
|
|
@@ -37038,7 +37805,7 @@ function useAgentGUIConversationRailResizePointerMove({
|
|
|
37038
37805
|
const reportConversationRailLayoutChange = useOptionalStableEventCallback(
|
|
37039
37806
|
onConversationRailLayoutChange
|
|
37040
37807
|
);
|
|
37041
|
-
return
|
|
37808
|
+
return useCallback60(
|
|
37042
37809
|
(event) => {
|
|
37043
37810
|
if (previewMode) return;
|
|
37044
37811
|
const resizeState = railResizeInteractionRef.current;
|
|
@@ -37072,7 +37839,7 @@ function useAgentGUIConversationRailResizePointerMove({
|
|
|
37072
37839
|
}
|
|
37073
37840
|
|
|
37074
37841
|
// agent-gui/agentGuiNode/view/useAgentGUIExternalRequests.ts
|
|
37075
|
-
import { useCallback as
|
|
37842
|
+
import { useCallback as useCallback61, useEffect as useEffect37, useRef as useRef54 } from "react";
|
|
37076
37843
|
function resolveSessionActionConversation(viewModel, agentSessionId) {
|
|
37077
37844
|
const active = viewModel.rail.activeConversation;
|
|
37078
37845
|
if (!agentSessionId) {
|
|
@@ -37099,7 +37866,7 @@ function useAgentGUIExternalRequests(input) {
|
|
|
37099
37866
|
} = input;
|
|
37100
37867
|
const agentHostApi = useOptionalAgentHostApi();
|
|
37101
37868
|
const railInteractionLockProbeRef = useRef54(null);
|
|
37102
|
-
const registerRailInteractionLockProbe =
|
|
37869
|
+
const registerRailInteractionLockProbe = useCallback61(
|
|
37103
37870
|
(probe) => {
|
|
37104
37871
|
railInteractionLockProbeRef.current = probe;
|
|
37105
37872
|
},
|
|
@@ -37176,15 +37943,20 @@ function AgentGUINodeView({
|
|
|
37176
37943
|
slashStatusLimits = [],
|
|
37177
37944
|
slashStatusLimitsLoading = false,
|
|
37178
37945
|
slashStatusLimitsUnavailable = false,
|
|
37946
|
+
slashStatusOverride = null,
|
|
37179
37947
|
providerAuthAccountLabels,
|
|
37180
37948
|
railConfigProvider,
|
|
37181
37949
|
railSlashStatusLimits,
|
|
37950
|
+
slashStatusLimitsResolvedEmpty = false,
|
|
37182
37951
|
slashStatusUsageCapturedAtUnixMs = null,
|
|
37183
37952
|
slashStatusUsageDidFail = false,
|
|
37184
37953
|
slashStatusUsageAttempted = false,
|
|
37954
|
+
onAgentConfigMenuClose,
|
|
37185
37955
|
onAgentConfigMenuOpen,
|
|
37186
37956
|
onAgentUsageRefresh,
|
|
37187
37957
|
onSlashStatusOpen,
|
|
37958
|
+
onSlashStatusClose,
|
|
37959
|
+
onSlashStatusRefresh,
|
|
37188
37960
|
accountMenuState = null,
|
|
37189
37961
|
previewMode = false,
|
|
37190
37962
|
onAgentProviderLogin,
|
|
@@ -37296,10 +38068,10 @@ function AgentGUINodeView({
|
|
|
37296
38068
|
);
|
|
37297
38069
|
const openProjectFiles = useOptionalStableEventCallback(onLinkAction);
|
|
37298
38070
|
const detailComposerFocusRequestSequence = localComposerFocusRequestSequence === 0 ? composerFocusRequestSequence : (composerFocusRequestSequence ?? 0) + localComposerFocusRequestSequence;
|
|
37299
|
-
const requestComposerFocus =
|
|
38071
|
+
const requestComposerFocus = useCallback62(() => {
|
|
37300
38072
|
setLocalComposerFocusRequestSequence((current) => current + 1);
|
|
37301
38073
|
}, []);
|
|
37302
|
-
const requestCreateConversation =
|
|
38074
|
+
const requestCreateConversation = useCallback62(
|
|
37303
38075
|
(options) => {
|
|
37304
38076
|
if (previewMode) {
|
|
37305
38077
|
return;
|
|
@@ -37324,7 +38096,7 @@ function AgentGUINodeView({
|
|
|
37324
38096
|
viewModel.composer.composerSettings.selectedProjectPath
|
|
37325
38097
|
]
|
|
37326
38098
|
);
|
|
37327
|
-
const effectiveWorkspaceAppIcons =
|
|
38099
|
+
const effectiveWorkspaceAppIcons = useMemo44(
|
|
37328
38100
|
() => mergeWorkspaceAppIconsFromCommands({
|
|
37329
38101
|
commands: viewModel.composer.availableCommands,
|
|
37330
38102
|
workspaceAppIcons,
|
|
@@ -37336,7 +38108,7 @@ function AgentGUINodeView({
|
|
|
37336
38108
|
workspaceAppIcons
|
|
37337
38109
|
]
|
|
37338
38110
|
);
|
|
37339
|
-
const clampConversationRailWidth =
|
|
38111
|
+
const clampConversationRailWidth = useCallback62(
|
|
37340
38112
|
(widthPx) => Math.min(
|
|
37341
38113
|
conversationRailMaxWidthPx,
|
|
37342
38114
|
Math.max(conversationRailMinWidthPx, widthPx)
|
|
@@ -37344,7 +38116,7 @@ function AgentGUINodeView({
|
|
|
37344
38116
|
[conversationRailMaxWidthPx, conversationRailMinWidthPx]
|
|
37345
38117
|
);
|
|
37346
38118
|
const providerRailWidthPx = conversationRailCollapsed ? 0 : 52;
|
|
37347
|
-
const handleConversationRailResizePointerDown =
|
|
38119
|
+
const handleConversationRailResizePointerDown = useCallback62(
|
|
37348
38120
|
(event) => {
|
|
37349
38121
|
if (previewMode) {
|
|
37350
38122
|
return;
|
|
@@ -37373,7 +38145,7 @@ function AgentGUINodeView({
|
|
|
37373
38145
|
providerRailWidthPx,
|
|
37374
38146
|
railResizeInteractionRef
|
|
37375
38147
|
});
|
|
37376
|
-
const endConversationRailResize =
|
|
38148
|
+
const endConversationRailResize = useCallback62(
|
|
37377
38149
|
(event) => {
|
|
37378
38150
|
const resizeState = railResizeInteractionRef.current;
|
|
37379
38151
|
if (event && resizeState?.pointerId === event.pointerId && event.currentTarget.hasPointerCapture?.(event.pointerId)) {
|
|
@@ -37404,7 +38176,7 @@ function AgentGUINodeView({
|
|
|
37404
38176
|
isRailResizing,
|
|
37405
38177
|
railResizeWidthPx
|
|
37406
38178
|
]);
|
|
37407
|
-
const handleConversationRailResizeKeyDown =
|
|
38179
|
+
const handleConversationRailResizeKeyDown = useCallback62(
|
|
37408
38180
|
(event) => {
|
|
37409
38181
|
if (previewMode) {
|
|
37410
38182
|
return;
|
|
@@ -37442,7 +38214,7 @@ function AgentGUINodeView({
|
|
|
37442
38214
|
const effectiveRailConfigProvider = railConfigProvider === void 0 ? viewModel.shell.data.provider : railConfigProvider;
|
|
37443
38215
|
const effectiveRailSlashStatusLimits = railSlashStatusLimits ?? slashStatusLimits;
|
|
37444
38216
|
const shouldShowProviderRailConfigButton = viewModel.rail.conversationFilter.kind === "all" || viewModel.rail.selectedAgentTarget?.disabled !== true;
|
|
37445
|
-
const effectiveProviderAuthAccountLabel =
|
|
38217
|
+
const effectiveProviderAuthAccountLabel = useMemo44(() => {
|
|
37446
38218
|
const provider = (effectiveRailConfigProvider ?? viewModel.shell.data.provider)?.trim() ?? "";
|
|
37447
38219
|
if (!provider) {
|
|
37448
38220
|
return null;
|
|
@@ -37470,7 +38242,7 @@ function AgentGUINodeView({
|
|
|
37470
38242
|
openEnvironmentSetup: onAgentEnvPanelOpen,
|
|
37471
38243
|
selectedAgentTarget: viewModel.rail.selectedAgentTarget
|
|
37472
38244
|
});
|
|
37473
|
-
const openAgentSettings =
|
|
38245
|
+
const openAgentSettings = useCallback62(() => {
|
|
37474
38246
|
openWorkspaceSettingsPanel({
|
|
37475
38247
|
section: "agent",
|
|
37476
38248
|
pane: "agents",
|
|
@@ -37479,7 +38251,7 @@ function AgentGUINodeView({
|
|
|
37479
38251
|
}, [effectiveRailConfigProvider]);
|
|
37480
38252
|
const [renameConversationTarget, setRenameConversationTarget] = useState44(null);
|
|
37481
38253
|
const [renameConversationDialogOpen, setRenameConversationDialogOpen] = useState44(false);
|
|
37482
|
-
const requestRenameConversation =
|
|
38254
|
+
const requestRenameConversation = useCallback62(
|
|
37483
38255
|
(conversation) => {
|
|
37484
38256
|
setRenameConversationTarget(conversation);
|
|
37485
38257
|
setRenameConversationDialogOpen(true);
|
|
@@ -37497,7 +38269,7 @@ function AgentGUINodeView({
|
|
|
37497
38269
|
uiLanguage,
|
|
37498
38270
|
viewModel
|
|
37499
38271
|
});
|
|
37500
|
-
const conversationRailStoreState =
|
|
38272
|
+
const conversationRailStoreState = useMemo44(
|
|
37501
38273
|
() => ({
|
|
37502
38274
|
activeConversation: viewModel.rail.activeConversation,
|
|
37503
38275
|
activeConversationId: viewModel.rail.activeConversationId,
|
|
@@ -37577,7 +38349,7 @@ function AgentGUINodeView({
|
|
|
37577
38349
|
const targetPresentationKey = agentTargetPresentationKey(
|
|
37578
38350
|
viewModel.rail.agentTargets
|
|
37579
38351
|
);
|
|
37580
|
-
const agentTargetPresentations =
|
|
38352
|
+
const agentTargetPresentations = useMemo44(
|
|
37581
38353
|
() => projectAgentTargetPresentations({
|
|
37582
38354
|
agentTargets: viewModel.rail.agentTargets,
|
|
37583
38355
|
workspaceId: viewModel.shell.workspaceId
|
|
@@ -37657,11 +38429,13 @@ function AgentGUINodeView({
|
|
|
37657
38429
|
providerScopedActionsVisible: viewModel.rail.conversationFilter.kind !== "all",
|
|
37658
38430
|
slashStatusLimits: effectiveRailSlashStatusLimits,
|
|
37659
38431
|
slashStatusLimitsLoading,
|
|
38432
|
+
slashStatusLimitsResolvedEmpty,
|
|
37660
38433
|
slashStatusUsageCapturedAtUnixMs,
|
|
37661
38434
|
slashStatusUsageDidFail,
|
|
37662
38435
|
slashStatusUsageAttempted,
|
|
37663
38436
|
provider: effectiveRailConfigProvider,
|
|
37664
38437
|
providerAuthAccountLabel: effectiveProviderAuthAccountLabel,
|
|
38438
|
+
onAgentConfigMenuClose,
|
|
37665
38439
|
onAgentConfigMenuOpen,
|
|
37666
38440
|
onAgentUsageRefresh,
|
|
37667
38441
|
onOpenAgentEnvSetup: openAgentEnvSetup,
|
|
@@ -37740,7 +38514,10 @@ function AgentGUINodeView({
|
|
|
37740
38514
|
slashStatusLimits,
|
|
37741
38515
|
slashStatusLimitsLoading,
|
|
37742
38516
|
slashStatusLimitsUnavailable,
|
|
38517
|
+
slashStatusOverride,
|
|
37743
38518
|
onSlashStatusOpen,
|
|
38519
|
+
onSlashStatusClose,
|
|
38520
|
+
onSlashStatusRefresh,
|
|
37744
38521
|
onLinkAction,
|
|
37745
38522
|
onHandoffConversation,
|
|
37746
38523
|
capabilityMenuState,
|
|
@@ -37774,7 +38551,6 @@ function AgentGUINodeView({
|
|
|
37774
38551
|
isNodeSelectable: isWorkspaceReferencePickerNodeSelectable,
|
|
37775
38552
|
open: workspaceReferencePickerOpen,
|
|
37776
38553
|
purpose: workspaceReferencePickerPurpose,
|
|
37777
|
-
provenanceFilter: referenceProvenanceFilter,
|
|
37778
38554
|
resolveEntryIconUrl: resolveWorkspaceReferenceEntryIconUrl,
|
|
37779
38555
|
workspaceId: viewModel.shell.workspaceId,
|
|
37780
38556
|
onClose: closeWorkspaceReferencePicker,
|
|
@@ -37803,178 +38579,10 @@ function AgentGUINodeView({
|
|
|
37803
38579
|
return previewMode ? content : /* @__PURE__ */ jsx76(TooltipProvider7, { children: content });
|
|
37804
38580
|
}
|
|
37805
38581
|
|
|
37806
|
-
// agent-gui/workspaceDesktop/view/desktopDockAgentProbeTooltipModel.ts
|
|
37807
|
-
function findWorkspaceAgentProbeForDockProvider(snapshot, provider) {
|
|
37808
|
-
if (!snapshot?.providers) {
|
|
37809
|
-
return null;
|
|
37810
|
-
}
|
|
37811
|
-
return snapshot.providers.find((p) => p.provider === provider) ?? null;
|
|
37812
|
-
}
|
|
37813
|
-
function buildDockAgentProbeTooltipLines(probe, isLoadingAvailability, t, popupOpts) {
|
|
37814
|
-
if (isLoadingAvailability && !probe) {
|
|
37815
|
-
return [t("agentHost.workspaceAgentProbeDockChecking")];
|
|
37816
|
-
}
|
|
37817
|
-
if (!probe) {
|
|
37818
|
-
return [t("agentHost.workspaceAgentProbeDockNoData")];
|
|
37819
|
-
}
|
|
37820
|
-
const lines = [];
|
|
37821
|
-
switch (probe.availability.status) {
|
|
37822
|
-
case "available":
|
|
37823
|
-
lines.push({
|
|
37824
|
-
label: t("agentHost.workspaceAgentProbeDetailStatus"),
|
|
37825
|
-
primary: t("agentHost.workspaceAgentProbeDockAvailable")
|
|
37826
|
-
});
|
|
37827
|
-
break;
|
|
37828
|
-
case "unavailable":
|
|
37829
|
-
lines.push({
|
|
37830
|
-
label: t("agentHost.workspaceAgentProbeDetailStatus"),
|
|
37831
|
-
primary: t("agentHost.workspaceAgentProbeUnavailableAria")
|
|
37832
|
-
});
|
|
37833
|
-
break;
|
|
37834
|
-
default:
|
|
37835
|
-
lines.push({
|
|
37836
|
-
label: t("agentHost.workspaceAgentProbeDetailStatus"),
|
|
37837
|
-
primary: t("agentHost.workspaceAgentProbeUnknownAria")
|
|
37838
|
-
});
|
|
37839
|
-
}
|
|
37840
|
-
if (probe.availability.status !== "available" && probe.availability.detailsVisible) {
|
|
37841
|
-
for (const check of probe.availability.checks ?? []) {
|
|
37842
|
-
if (!check.passed) {
|
|
37843
|
-
const primary = check.detail?.trim() || check.name.trim();
|
|
37844
|
-
if (!primary) {
|
|
37845
|
-
continue;
|
|
37846
|
-
}
|
|
37847
|
-
lines.push({
|
|
37848
|
-
label: check.name,
|
|
37849
|
-
primary
|
|
37850
|
-
});
|
|
37851
|
-
}
|
|
37852
|
-
}
|
|
37853
|
-
}
|
|
37854
|
-
const errMsg = probe.lastError?.message?.trim();
|
|
37855
|
-
if (errMsg && !popupOpts?.includeUsageLines) {
|
|
37856
|
-
lines.push(errMsg);
|
|
37857
|
-
}
|
|
37858
|
-
if (!popupOpts?.includeUsageLines) {
|
|
37859
|
-
return lines;
|
|
37860
|
-
}
|
|
37861
|
-
appendDockProbeUsageLines(probe, lines, popupOpts.isLoadingUsage ?? false, t);
|
|
37862
|
-
return lines;
|
|
37863
|
-
}
|
|
37864
|
-
function formatQuotaResetDisplay(quota) {
|
|
37865
|
-
if (!quota) {
|
|
37866
|
-
return void 0;
|
|
37867
|
-
}
|
|
37868
|
-
if (typeof quota.resetsAtUnixMs === "number" && Number.isFinite(quota.resetsAtUnixMs)) {
|
|
37869
|
-
return toLocalShortDateTime(quota.resetsAtUnixMs);
|
|
37870
|
-
}
|
|
37871
|
-
return quota.resetText;
|
|
37872
|
-
}
|
|
37873
|
-
function quotaTypeLabel(quotaType, t) {
|
|
37874
|
-
switch (quotaType) {
|
|
37875
|
-
case "session":
|
|
37876
|
-
return t("agentHost.workspaceAgentProbeQuotaSession");
|
|
37877
|
-
case "weekly":
|
|
37878
|
-
return t("agentHost.workspaceAgentProbeQuotaWeekly");
|
|
37879
|
-
case "monthly":
|
|
37880
|
-
return t("agentHost.workspaceAgentProbeQuotaMonthly");
|
|
37881
|
-
case "daily":
|
|
37882
|
-
return t("agentHost.workspaceAgentProbeQuotaDaily");
|
|
37883
|
-
case "cost":
|
|
37884
|
-
return t("agentHost.workspaceAgentProbeQuotaCost");
|
|
37885
|
-
default:
|
|
37886
|
-
return quotaType;
|
|
37887
|
-
}
|
|
37888
|
-
}
|
|
37889
|
-
function buildCompactDisplayQuotas(quotas, t) {
|
|
37890
|
-
const modelQuotas = quotas.filter(
|
|
37891
|
-
(quota) => quota.modelName || quota.quotaType === "model"
|
|
37892
|
-
);
|
|
37893
|
-
const nonModelQuotas = quotas.filter(
|
|
37894
|
-
(quota) => !quota.modelName && quota.quotaType !== "model"
|
|
37895
|
-
);
|
|
37896
|
-
const displayRows = nonModelQuotas.map((quota) => ({
|
|
37897
|
-
label: quota.quotaType === "session" ? "" : quotaTypeLabel(quota.quotaType, t),
|
|
37898
|
-
percentRemaining: quota.percentRemaining,
|
|
37899
|
-
dollarRemaining: quota.dollarRemaining,
|
|
37900
|
-
resetDisplay: formatQuotaResetDisplay(quota)
|
|
37901
|
-
}));
|
|
37902
|
-
if (modelQuotas.length === 0) {
|
|
37903
|
-
return displayRows;
|
|
37904
|
-
}
|
|
37905
|
-
const percentQuota = modelQuotas.filter(
|
|
37906
|
-
(quota) => typeof quota.percentRemaining === "number"
|
|
37907
|
-
).sort((left, right) => left.percentRemaining - right.percentRemaining)[0];
|
|
37908
|
-
const dollarQuota = modelQuotas.filter(
|
|
37909
|
-
(quota) => typeof quota.dollarRemaining === "number"
|
|
37910
|
-
).sort((left, right) => left.dollarRemaining - right.dollarRemaining)[0];
|
|
37911
|
-
displayRows.push({
|
|
37912
|
-
label: t("agentHost.workspaceAgentProbeAgentUsage"),
|
|
37913
|
-
percentRemaining: percentQuota?.percentRemaining,
|
|
37914
|
-
dollarRemaining: dollarQuota?.dollarRemaining,
|
|
37915
|
-
resetDisplay: formatQuotaResetDisplay(percentQuota ?? dollarQuota)
|
|
37916
|
-
});
|
|
37917
|
-
return displayRows;
|
|
37918
|
-
}
|
|
37919
|
-
function formatQuotaPrimaryLine(row, t) {
|
|
37920
|
-
if (row.percentRemaining !== void 0) {
|
|
37921
|
-
return t("agentHost.workspaceAgentProbeQuotaRemaining", {
|
|
37922
|
-
percent: Math.round(row.percentRemaining)
|
|
37923
|
-
});
|
|
37924
|
-
}
|
|
37925
|
-
if (row.dollarRemaining !== void 0) {
|
|
37926
|
-
return t("agentHost.workspaceAgentProbeQuotaDollarRemaining", {
|
|
37927
|
-
amount: row.dollarRemaining.toFixed(2)
|
|
37928
|
-
});
|
|
37929
|
-
}
|
|
37930
|
-
return null;
|
|
37931
|
-
}
|
|
37932
|
-
function appendDockProbeUsageLines(probe, lines, isLoadingUsage, t) {
|
|
37933
|
-
if (probe.lastError?.code === "unsupported") {
|
|
37934
|
-
lines.push({
|
|
37935
|
-
label: t("agentHost.workspaceAgentProbeDetailQuota"),
|
|
37936
|
-
primary: t("agentHost.workspaceAgentProbeUsageUnsupported")
|
|
37937
|
-
});
|
|
37938
|
-
return;
|
|
37939
|
-
}
|
|
37940
|
-
if (isLoadingUsage && !probe.usage) {
|
|
37941
|
-
lines.push(t("agentHost.workspaceAgentProbeLoadingUsage"));
|
|
37942
|
-
return;
|
|
37943
|
-
}
|
|
37944
|
-
const quotas = probe.usage?.quotas ?? [];
|
|
37945
|
-
if (quotas.length === 0) {
|
|
37946
|
-
lines.push({
|
|
37947
|
-
label: t("agentHost.workspaceAgentProbeDetailQuota"),
|
|
37948
|
-
primary: t("agentHost.workspaceAgentProbeUsageUnsupported")
|
|
37949
|
-
});
|
|
37950
|
-
return;
|
|
37951
|
-
}
|
|
37952
|
-
const rows = buildCompactDisplayQuotas(quotas, t);
|
|
37953
|
-
for (const row of rows) {
|
|
37954
|
-
const primary = formatQuotaPrimaryLine(row, t);
|
|
37955
|
-
const labelTrim = row.label.trim();
|
|
37956
|
-
if (primary) {
|
|
37957
|
-
const label = labelTrim || t("agentHost.workspaceAgentProbeDetailQuota");
|
|
37958
|
-
lines.push({
|
|
37959
|
-
label,
|
|
37960
|
-
primary
|
|
37961
|
-
});
|
|
37962
|
-
if (row.resetDisplay) {
|
|
37963
|
-
lines.push({
|
|
37964
|
-
label: t("agentHost.workspaceAgentProbeQuotaResetTimeLabel", {
|
|
37965
|
-
label
|
|
37966
|
-
}),
|
|
37967
|
-
primary: row.resetDisplay
|
|
37968
|
-
});
|
|
37969
|
-
}
|
|
37970
|
-
}
|
|
37971
|
-
}
|
|
37972
|
-
}
|
|
37973
|
-
|
|
37974
38582
|
// agent-gui/workspaceDesktop/view/AgentProbeInfoPopover.tsx
|
|
37975
38583
|
import { Info as Info2 } from "lucide-react";
|
|
37976
38584
|
import {
|
|
37977
|
-
useCallback as
|
|
38585
|
+
useCallback as useCallback63,
|
|
37978
38586
|
useEffect as useEffect39,
|
|
37979
38587
|
useLayoutEffect as useLayoutEffect9,
|
|
37980
38588
|
useRef as useRef56,
|
|
@@ -38012,27 +38620,36 @@ function AgentProbeInfoPopover({
|
|
|
38012
38620
|
lines,
|
|
38013
38621
|
testId = "agent-probe-info",
|
|
38014
38622
|
className,
|
|
38015
|
-
onOpen
|
|
38623
|
+
onOpen,
|
|
38624
|
+
onClose
|
|
38016
38625
|
}) {
|
|
38017
38626
|
"use memo";
|
|
38018
38627
|
const anchorRef = useRef56(null);
|
|
38019
38628
|
const popoverRef = useRef56(null);
|
|
38020
38629
|
const [isOpen, setIsOpen] = useState45(false);
|
|
38021
38630
|
const [popoverStyle, setPopoverStyle] = useState45(null);
|
|
38022
|
-
const openPopover =
|
|
38631
|
+
const openPopover = useCallback63(() => {
|
|
38023
38632
|
if (!isOpen) {
|
|
38024
38633
|
onOpen?.();
|
|
38025
38634
|
}
|
|
38026
38635
|
setIsOpen(true);
|
|
38027
38636
|
}, [isOpen, onOpen]);
|
|
38028
|
-
const
|
|
38029
|
-
|
|
38030
|
-
if (nextTarget instanceof Node && (anchorRef.current?.contains(nextTarget) || popoverRef.current?.contains(nextTarget))) {
|
|
38031
|
-
return;
|
|
38032
|
-
}
|
|
38637
|
+
const closePopover = useCallback63(() => {
|
|
38638
|
+
if (!isOpen) return;
|
|
38033
38639
|
setIsOpen(false);
|
|
38034
|
-
|
|
38035
|
-
|
|
38640
|
+
onClose?.();
|
|
38641
|
+
}, [isOpen, onClose]);
|
|
38642
|
+
const closeIfPointerLeavesPopover = useCallback63(
|
|
38643
|
+
(event) => {
|
|
38644
|
+
const nextTarget = event.relatedTarget;
|
|
38645
|
+
if (nextTarget instanceof Node && (anchorRef.current?.contains(nextTarget) || popoverRef.current?.contains(nextTarget))) {
|
|
38646
|
+
return;
|
|
38647
|
+
}
|
|
38648
|
+
closePopover();
|
|
38649
|
+
},
|
|
38650
|
+
[closePopover]
|
|
38651
|
+
);
|
|
38652
|
+
const updatePopoverPosition = useCallback63(() => {
|
|
38036
38653
|
const anchor = anchorRef.current;
|
|
38037
38654
|
if (!anchor) {
|
|
38038
38655
|
return;
|
|
@@ -38131,7 +38748,7 @@ function AgentProbeInfoPopover({
|
|
|
38131
38748
|
updatePopoverPosition();
|
|
38132
38749
|
openPopover();
|
|
38133
38750
|
},
|
|
38134
|
-
onBlur:
|
|
38751
|
+
onBlur: closePopover,
|
|
38135
38752
|
children: [
|
|
38136
38753
|
/* @__PURE__ */ jsx77(Info2, { size: 15, strokeWidth: 2.1, "aria-hidden": "true" }),
|
|
38137
38754
|
isOpen ? createPortal5(popover, document.body) : null
|
|
@@ -38222,11 +38839,11 @@ function areAgentGUINodePropsEqual(previous, next) {
|
|
|
38222
38839
|
const pc = previous.hostCapabilities, nc = next.hostCapabilities;
|
|
38223
38840
|
const pa = previous.hostActions, na = next.hostActions;
|
|
38224
38841
|
const ps = previous.renderSlots, ns = next.renderSlots;
|
|
38225
|
-
return pi.nodeId === ni.nodeId && pi.workspaceId === ni.workspaceId && pi.currentUserId === ni.currentUserId && pi.title === ni.title && pw.path === nw.path && pw.fileReferenceAdapter === nw.fileReferenceAdapter && pw.onRequestGitBranches === nw.onRequestGitBranches && pw.selectProjectDirectory === nw.selectProjectDirectory && pw.resolveExternalPromptEntries === nw.resolveExternalPromptEntries && pw.prepareExternalPromptFiles === nw.prepareExternalPromptFiles && pw.promptAssetLimit === nw.promptAssetLimit && pw.projectDirectorySourceAggregator === nw.projectDirectorySourceAggregator && pw.referenceSourceAggregator === nw.referenceSourceAggregator && pw.resolveReferenceEntryIconUrl === nw.resolveReferenceEntryIconUrl && pw.resolveMentionReferenceTarget === nw.resolveMentionReferenceTarget && pw.resolveReferenceInitialTarget === nw.resolveReferenceInitialTarget && pw.onFileReferencesAdded === nw.onFileReferencesAdded && pw.agentSettings.avoidGroupingEdits === nw.agentSettings.avoidGroupingEdits && pc.referenceProvenanceFilterCatalog === nc.referenceProvenanceFilterCatalog && pc.referenceProvenanceFilterEnabled === nc.referenceProvenanceFilterEnabled && agentGuiStateEquals(previous.state, next.state) && pf.position.x === nf.position.x && pf.position.y === nf.position.y && pf.width === nf.width && pf.height === nf.height && pf.desktopSize.width === nf.desktopSize.width && pf.desktopSize.height === nf.desktopSize.height && pf.isMaximized === nf.isMaximized && pf.isActive === nf.isActive && pf.isVisible === nf.isVisible && pf.embedded === nf.embedded && pf.previewMode === nf.previewMode && pf.conversationRailAutoCollapseWidthPx === nf.conversationRailAutoCollapseWidthPx && pr.composerFocusSequence === nr.composerFocusSequence && pr.composerAppend === nr.composerAppend && pr.newConversationSequence === nr.newConversationSequence && pr.sessionAction === nr.sessionAction && pr.openSession === nr.openSession && pr.prefillPrompt === nr.prefillPrompt && pr.
|
|
38842
|
+
return pi.nodeId === ni.nodeId && pi.workspaceId === ni.workspaceId && pi.currentUserId === ni.currentUserId && pi.title === ni.title && pw.path === nw.path && pw.fileReferenceAdapter === nw.fileReferenceAdapter && pw.onRequestGitBranches === nw.onRequestGitBranches && pw.selectProjectDirectory === nw.selectProjectDirectory && pw.resolveExternalPromptEntries === nw.resolveExternalPromptEntries && pw.prepareExternalPromptFiles === nw.prepareExternalPromptFiles && pw.promptAssetLimit === nw.promptAssetLimit && pw.projectDirectorySourceAggregator === nw.projectDirectorySourceAggregator && pw.referenceSourceAggregator === nw.referenceSourceAggregator && pw.resolveReferenceEntryIconUrl === nw.resolveReferenceEntryIconUrl && pw.resolveMentionReferenceTarget === nw.resolveMentionReferenceTarget && pw.resolveReferenceInitialTarget === nw.resolveReferenceInitialTarget && pw.onFileReferencesAdded === nw.onFileReferencesAdded && pw.agentSettings.avoidGroupingEdits === nw.agentSettings.avoidGroupingEdits && pc.referenceProvenanceFilterCatalog === nc.referenceProvenanceFilterCatalog && pc.referenceProvenanceFilterEnabled === nc.referenceProvenanceFilterEnabled && agentGuiStateEquals(previous.state, next.state) && pf.position.x === nf.position.x && pf.position.y === nf.position.y && pf.width === nf.width && pf.height === nf.height && pf.desktopSize.width === nf.desktopSize.width && pf.desktopSize.height === nf.desktopSize.height && pf.isMaximized === nf.isMaximized && pf.isActive === nf.isActive && pf.isVisible === nf.isVisible && pf.embedded === nf.embedded && pf.previewMode === nf.previewMode && pf.conversationRailAutoCollapseWidthPx === nf.conversationRailAutoCollapseWidthPx && pr.composerFocusSequence === nr.composerFocusSequence && pr.composerAppend === nr.composerAppend && pr.newConversationSequence === nr.newConversationSequence && pr.sessionAction === nr.sessionAction && pr.openSession === nr.openSession && pr.prefillPrompt === nr.prefillPrompt && pr.agentStatusController === nr.agentStatusController && pc.capabilityMenuState === nc.capabilityMenuState && pc.accountMenuState === nc.accountMenuState && pc.agentTargets === nc.agentTargets && pc.agentTargetsLoading === nc.agentTargetsLoading && pc.handoffAgentTargets === nc.handoffAgentTargets && pc.handoffAgentTargetsLoading === nc.handoffAgentTargetsLoading && pc.providerRailAllPresentation?.iconUrl === nc.providerRailAllPresentation?.iconUrl && pc.providerRailMode === nc.providerRailMode && pc.comingSoonProviders === nc.comingSoonProviders && pc.providerReadinessGates === nc.providerReadinessGates && pc.defaultAgentTargetId === nc.defaultAgentTargetId && pc.providerAuthAccountLabels === nc.providerAuthAccountLabels && pc.mentionService === nc.mentionService && pc.workspaceAppIcons === nc.workspaceAppIcons && pc.disabledHomeSuggestions === nc.disabledHomeSuggestions && pa.onLinkAction === na.onLinkAction && pa.onHandoffConversation === na.onHandoffConversation && pa.onCapabilitySettingsRequest === na.onCapabilitySettingsRequest && pa.onAgentProviderLogin === na.onAgentProviderLogin && pa.onAgentEnvPanelOpen === na.onAgentEnvPanelOpen && pa.onOpenConversationWindow === na.onOpenConversationWindow && pa.onClose === na.onClose && pa.onResize === na.onResize && pa.onUpdateNode === na.onUpdateNode && pa.onRememberComposerDefaults === na.onRememberComposerDefaults && pa.isMuted === na.isMuted && pa.onMinimize === na.onMinimize && pa.onToggleMaximize === na.onToggleMaximize && pa.onShowMessage === na.onShowMessage && pa.onEngagementEvent === na.onEngagementEvent && pa.onConversationRailLayoutChange === na.onConversationRailLayoutChange && ps.providerRailEmpty === ns.providerRailEmpty && ps.providerUnavailableState === ns.providerUnavailableState && ps.sidebarFooter === ns.sidebarFooter;
|
|
38226
38843
|
}
|
|
38227
38844
|
|
|
38228
38845
|
// agent-gui/agentGuiNode/AgentGUIMentionServiceBoundary.tsx
|
|
38229
|
-
import { useMemo as
|
|
38846
|
+
import { useMemo as useMemo45 } from "react";
|
|
38230
38847
|
import {
|
|
38231
38848
|
RichTextMentionServiceProvider,
|
|
38232
38849
|
useRichTextMentionService as useRichTextMentionService2
|
|
@@ -38275,7 +38892,7 @@ function AgentGUIMentionServiceBoundary({
|
|
|
38275
38892
|
service
|
|
38276
38893
|
}) {
|
|
38277
38894
|
const inheritedService = useRichTextMentionService2();
|
|
38278
|
-
const effectiveService =
|
|
38895
|
+
const effectiveService = useMemo45(
|
|
38279
38896
|
() => service && inheritedService && service !== inheritedService ? composeAgentGUIMentionService({
|
|
38280
38897
|
inheritedService,
|
|
38281
38898
|
surfaceService: service
|
|
@@ -38289,7 +38906,7 @@ function AgentGUIMentionServiceBoundary({
|
|
|
38289
38906
|
}
|
|
38290
38907
|
|
|
38291
38908
|
// agent-gui/agentGuiNode/AgentGUINode.labels.ts
|
|
38292
|
-
import { useMemo as
|
|
38909
|
+
import { useMemo as useMemo46 } from "react";
|
|
38293
38910
|
|
|
38294
38911
|
// agent-gui/agentGuiNode/model/agentHomeSuggestions.ts
|
|
38295
38912
|
import { createRichTextMentionHref as createRichTextMentionHref2 } from "@tutti-os/ui-rich-text/core";
|
|
@@ -38607,7 +39224,7 @@ function agentQuickPromptLabels(t) {
|
|
|
38607
39224
|
|
|
38608
39225
|
// agent-gui/agentGuiNode/AgentGUINode.labels.ts
|
|
38609
39226
|
function useAgentGUIConversationRailLabels(t) {
|
|
38610
|
-
return
|
|
39227
|
+
return useMemo46(() => agentGUIConversationRailLabels(t), [t]);
|
|
38611
39228
|
}
|
|
38612
39229
|
var workspaceFileReferenceLocaleKeyByPickerKey = {
|
|
38613
39230
|
"actions.cancel": "common.cancel",
|
|
@@ -38648,7 +39265,6 @@ var workspaceFileReferenceLocaleKeyByPickerKey = {
|
|
|
38648
39265
|
"referencePicker.searchPlaceholder": "agentHost.agentGui.referencePicker.searchPlaceholder",
|
|
38649
39266
|
"referencePicker.selectGroupHint": "agentHost.agentGui.referencePicker.selectGroupHint",
|
|
38650
39267
|
"referencePicker.selectedCount": "agentHost.agentGui.referencePicker.selectedCount",
|
|
38651
|
-
"referencePicker.workspaceRootGroup": "agentHost.agentGui.referencePicker.workspaceRootGroup",
|
|
38652
39268
|
"referencePicker.sourceColumn": "agentHost.agentGui.referencePicker.sourceColumn",
|
|
38653
39269
|
"referencePicker.title": "agentHost.agentGui.referencePicker.title"
|
|
38654
39270
|
};
|
|
@@ -38661,7 +39277,7 @@ function useAgentGUIViewLabels(input) {
|
|
|
38661
39277
|
workspaceAppIcons,
|
|
38662
39278
|
workspaceId
|
|
38663
39279
|
} = input;
|
|
38664
|
-
return
|
|
39280
|
+
return useMemo46(
|
|
38665
39281
|
() => ({
|
|
38666
39282
|
initialPlaceholder: t("agentHost.agentGui.initialPlaceholder", {
|
|
38667
39283
|
provider: displayProviderLabel
|
|
@@ -38828,6 +39444,7 @@ function useAgentGUIViewLabels(input) {
|
|
|
38828
39444
|
slashStatusLimitsUnavailable: t(
|
|
38829
39445
|
"agentHost.agentGui.slashStatusLimitsUnavailable"
|
|
38830
39446
|
),
|
|
39447
|
+
slashStatusEmptyValue: t("agentHost.agentGui.slashStatusEmptyValue"),
|
|
38831
39448
|
slashStatusUsageJustUpdated: t(
|
|
38832
39449
|
"agentHost.agentGui.slashStatusUsageJustUpdated"
|
|
38833
39450
|
),
|
|
@@ -39297,7 +39914,7 @@ function useAgentGUIViewLabels(input) {
|
|
|
39297
39914
|
);
|
|
39298
39915
|
}
|
|
39299
39916
|
function useAgentGUIWorkspaceFileReferenceCopy(t) {
|
|
39300
|
-
return
|
|
39917
|
+
return useMemo46(
|
|
39301
39918
|
() => ({
|
|
39302
39919
|
t(key, values) {
|
|
39303
39920
|
const localeKey = workspaceFileReferenceLocaleKeyByPickerKey[key];
|
|
@@ -39308,94 +39925,8 @@ function useAgentGUIWorkspaceFileReferenceCopy(t) {
|
|
|
39308
39925
|
);
|
|
39309
39926
|
}
|
|
39310
39927
|
|
|
39311
|
-
// agent-gui/agentGuiNode/AgentGUINode.usage.ts
|
|
39312
|
-
function slashStatusQuotaLabel(quota, t) {
|
|
39313
|
-
const modelName = quota.modelName?.trim();
|
|
39314
|
-
if (modelName) {
|
|
39315
|
-
return modelName;
|
|
39316
|
-
}
|
|
39317
|
-
switch (quota.quotaType) {
|
|
39318
|
-
case "session":
|
|
39319
|
-
return t("agentHost.agentGui.slashStatusFiveHourLimit");
|
|
39320
|
-
case "weekly":
|
|
39321
|
-
return t("agentHost.agentGui.slashStatusWeeklyLimit");
|
|
39322
|
-
case "daily":
|
|
39323
|
-
return t("agentHost.workspaceAgentProbeQuotaDaily");
|
|
39324
|
-
case "monthly":
|
|
39325
|
-
return t("agentHost.workspaceAgentProbeQuotaMonthly");
|
|
39326
|
-
case "cost":
|
|
39327
|
-
return t("agentHost.workspaceAgentProbeQuotaCost");
|
|
39328
|
-
case "model":
|
|
39329
|
-
return t("agentHost.workspaceAgentProbeAgentUsage");
|
|
39330
|
-
default:
|
|
39331
|
-
return quota.quotaType;
|
|
39332
|
-
}
|
|
39333
|
-
}
|
|
39334
|
-
function slashStatusQuotaValue(quota, t) {
|
|
39335
|
-
if (typeof quota.percentRemaining === "number" && Number.isFinite(quota.percentRemaining)) {
|
|
39336
|
-
return t("agentHost.agentGui.slashStatusLimitPercentLeft", {
|
|
39337
|
-
percent: Math.round(quota.percentRemaining)
|
|
39338
|
-
});
|
|
39339
|
-
}
|
|
39340
|
-
if (typeof quota.dollarRemaining === "number" && Number.isFinite(quota.dollarRemaining)) {
|
|
39341
|
-
return t("agentHost.workspaceAgentProbeQuotaDollarRemaining", {
|
|
39342
|
-
amount: quota.dollarRemaining.toFixed(2)
|
|
39343
|
-
});
|
|
39344
|
-
}
|
|
39345
|
-
return "";
|
|
39346
|
-
}
|
|
39347
|
-
function slashStatusQuotaReset(quota, t) {
|
|
39348
|
-
const reset = typeof quota.resetsAtUnixMs === "number" && Number.isFinite(quota.resetsAtUnixMs) ? toLocalShortDateTime(quota.resetsAtUnixMs) : quota.resetText?.trim();
|
|
39349
|
-
return reset ? t("agentHost.agentGui.slashStatusLimitReset", { reset }) : "";
|
|
39350
|
-
}
|
|
39351
|
-
function slashStatusLimitsFromQuotas(quotas, selectedModel, t) {
|
|
39352
|
-
const filteredQuotas = filterSlashStatusQuotasForModel(quotas, selectedModel);
|
|
39353
|
-
return filteredQuotas.map((quota, index) => {
|
|
39354
|
-
const value = slashStatusQuotaValue(quota, t);
|
|
39355
|
-
if (!value) {
|
|
39356
|
-
return null;
|
|
39357
|
-
}
|
|
39358
|
-
const label = slashStatusQuotaLabel(quota, t).trim();
|
|
39359
|
-
if (!label) {
|
|
39360
|
-
return null;
|
|
39361
|
-
}
|
|
39362
|
-
return {
|
|
39363
|
-
id: `${quota.quotaType}:${quota.modelName ?? ""}:${index}`,
|
|
39364
|
-
label,
|
|
39365
|
-
percentRemaining: typeof quota.percentRemaining === "number" && Number.isFinite(quota.percentRemaining) ? Math.max(0, Math.min(100, Math.round(quota.percentRemaining))) : null,
|
|
39366
|
-
value,
|
|
39367
|
-
reset: slashStatusQuotaReset(quota, t) || null
|
|
39368
|
-
};
|
|
39369
|
-
}).filter((limit) => limit !== null);
|
|
39370
|
-
}
|
|
39371
|
-
function filterSlashStatusQuotasForModel(quotas, selectedModel) {
|
|
39372
|
-
const normalizedSelectedModel = normalizeSlashStatusModelName(selectedModel);
|
|
39373
|
-
const baseQuotas = (quotas ?? []).filter(
|
|
39374
|
-
(quota) => quota.quotaType !== "model"
|
|
39375
|
-
);
|
|
39376
|
-
const matchingModelQuotas = (quotas ?? []).filter((quota) => {
|
|
39377
|
-
const quotaModelName = normalizeSlashStatusModelName(quota.modelName);
|
|
39378
|
-
return quota.quotaType === "model" && quotaModelName !== "" && normalizedSelectedModel !== "" && quotaModelName === normalizedSelectedModel;
|
|
39379
|
-
});
|
|
39380
|
-
return [...baseQuotas, ...matchingModelQuotas];
|
|
39381
|
-
}
|
|
39382
|
-
function normalizeSlashStatusModelName(value) {
|
|
39383
|
-
return value?.trim().toLowerCase().replace(/[^a-z0-9]+/gu, "-").replace(/^-+|-+$/gu, "") ?? "";
|
|
39384
|
-
}
|
|
39385
|
-
function resolveAgentGUIRailStatusProvider(input) {
|
|
39386
|
-
const filter = input.conversationFilter;
|
|
39387
|
-
if (filter.kind !== "agentTarget") {
|
|
39388
|
-
return null;
|
|
39389
|
-
}
|
|
39390
|
-
const target = input.agentTargets.find(
|
|
39391
|
-
(candidate) => candidate.disabled !== true && (candidate.agentTargetId?.trim() ?? "") === filter.agentTargetId
|
|
39392
|
-
);
|
|
39393
|
-
return target ? target.provider : null;
|
|
39394
|
-
}
|
|
39395
|
-
|
|
39396
39928
|
// agent-gui/agentGuiNode/AgentGUINode.tsx
|
|
39397
39929
|
import { jsx as jsx79, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
39398
|
-
var EMPTY_SLASH_STATUS_QUOTAS = [];
|
|
39399
39930
|
var DISABLED_REFERENCE_PROVENANCE_CATALOG = {
|
|
39400
39931
|
enabledDimensions: [],
|
|
39401
39932
|
agentOptions: [],
|
|
@@ -39451,9 +39982,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39451
39982
|
sessionAction: sessionActionRequest = null,
|
|
39452
39983
|
openSession: openSessionRequest = null,
|
|
39453
39984
|
prefillPrompt: prefillPromptRequest = null,
|
|
39454
|
-
|
|
39455
|
-
onProbeDemandChange: onAgentProbeDemandChange,
|
|
39456
|
-
onProbeRefreshRequest: onAgentProbeRefreshRequest
|
|
39985
|
+
agentStatusController
|
|
39457
39986
|
} = runtimeRequests;
|
|
39458
39987
|
const {
|
|
39459
39988
|
capabilityMenuState,
|
|
@@ -39507,21 +40036,21 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39507
40036
|
sidebarFooter: renderSidebarFooter
|
|
39508
40037
|
} = renderSlots;
|
|
39509
40038
|
const { i18n, locale, t } = useTranslation();
|
|
39510
|
-
const workspaceUserProjectI18n =
|
|
40039
|
+
const workspaceUserProjectI18n = useMemo47(
|
|
39511
40040
|
() => createWorkspaceUserProjectI18nRuntime(i18n),
|
|
39512
40041
|
[i18n]
|
|
39513
40042
|
);
|
|
39514
|
-
const workspaceFileManagerI18n =
|
|
40043
|
+
const workspaceFileManagerI18n = useMemo47(
|
|
39515
40044
|
() => typeof i18n?.t === "function" ? createWorkspaceFileManagerI18nRuntime(i18n) : null,
|
|
39516
40045
|
[i18n]
|
|
39517
40046
|
);
|
|
39518
|
-
const handleLinkAction =
|
|
40047
|
+
const handleLinkAction = useCallback64(
|
|
39519
40048
|
(action) => {
|
|
39520
40049
|
onLinkAction?.(action);
|
|
39521
40050
|
},
|
|
39522
40051
|
[onLinkAction]
|
|
39523
40052
|
);
|
|
39524
|
-
const handleAgentProviderLogin =
|
|
40053
|
+
const handleAgentProviderLogin = useCallback64(
|
|
39525
40054
|
(provider) => {
|
|
39526
40055
|
const resolvedProvider = normalizeAgentGUIProviderIdentity(provider);
|
|
39527
40056
|
onAgentProviderLogin?.(
|
|
@@ -39530,7 +40059,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39530
40059
|
},
|
|
39531
40060
|
[onAgentProviderLogin, state.provider]
|
|
39532
40061
|
);
|
|
39533
|
-
const handleWorkspaceFileReferencesAdded =
|
|
40062
|
+
const handleWorkspaceFileReferencesAdded = useCallback64(
|
|
39534
40063
|
(references) => {
|
|
39535
40064
|
onWorkspaceFileReferencesAdded?.({
|
|
39536
40065
|
provider: state.provider,
|
|
@@ -39539,7 +40068,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39539
40068
|
},
|
|
39540
40069
|
[onWorkspaceFileReferencesAdded, state.provider]
|
|
39541
40070
|
);
|
|
39542
|
-
const handleDataChange =
|
|
40071
|
+
const handleDataChange = useCallback64(
|
|
39543
40072
|
(updater) => {
|
|
39544
40073
|
if (previewMode) {
|
|
39545
40074
|
return;
|
|
@@ -39548,7 +40077,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39548
40077
|
},
|
|
39549
40078
|
[onUpdateNode, previewMode]
|
|
39550
40079
|
);
|
|
39551
|
-
const handleConversationRailWidthChanged =
|
|
40080
|
+
const handleConversationRailWidthChanged = useCallback64(
|
|
39552
40081
|
(widthPx) => {
|
|
39553
40082
|
if (previewMode) {
|
|
39554
40083
|
return;
|
|
@@ -39573,14 +40102,14 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39573
40102
|
const isConversationRailManuallyCollapsed = state.conversationRailCollapsed === true;
|
|
39574
40103
|
const isConversationRailAutoCollapsed = shouldAutoCollapseAgentGUIConversationRail(width, railAutoCollapseWidthPx);
|
|
39575
40104
|
const isConversationRailCollapsed = isConversationRailManuallyCollapsed || isConversationRailAutoCollapsed;
|
|
39576
|
-
const minSize =
|
|
40105
|
+
const minSize = useMemo47(
|
|
39577
40106
|
() => ({
|
|
39578
40107
|
...resolveCanonicalNodeMinSize("agentGui"),
|
|
39579
40108
|
width: AGENT_GUI_COLLAPSED_MIN_WIDTH_PX
|
|
39580
40109
|
}),
|
|
39581
40110
|
[]
|
|
39582
40111
|
);
|
|
39583
|
-
const toggleConversationRailCollapsed =
|
|
40112
|
+
const toggleConversationRailCollapsed = useCallback64(() => {
|
|
39584
40113
|
if (previewMode) {
|
|
39585
40114
|
return;
|
|
39586
40115
|
}
|
|
@@ -39589,7 +40118,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39589
40118
|
conversationRailCollapsed: current.conversationRailCollapsed !== true
|
|
39590
40119
|
}));
|
|
39591
40120
|
}, [onUpdateNode, previewMode]);
|
|
39592
|
-
const handleConversationRailToggle =
|
|
40121
|
+
const handleConversationRailToggle = useCallback64(() => {
|
|
39593
40122
|
if (previewMode) {
|
|
39594
40123
|
return;
|
|
39595
40124
|
}
|
|
@@ -39650,7 +40179,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39650
40179
|
onRememberComposerDefaults,
|
|
39651
40180
|
onShowMessage
|
|
39652
40181
|
});
|
|
39653
|
-
const handleCreateConversation =
|
|
40182
|
+
const handleCreateConversation = useCallback64(
|
|
39654
40183
|
(...args) => {
|
|
39655
40184
|
if (!previewMode) {
|
|
39656
40185
|
onUpdateNode(
|
|
@@ -39664,7 +40193,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39664
40193
|
},
|
|
39665
40194
|
[actions, onUpdateNode, previewMode]
|
|
39666
40195
|
);
|
|
39667
|
-
const viewActions =
|
|
40196
|
+
const viewActions = useMemo47(
|
|
39668
40197
|
() => ({
|
|
39669
40198
|
...actions,
|
|
39670
40199
|
createConversation: handleCreateConversation
|
|
@@ -39686,131 +40215,28 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39686
40215
|
});
|
|
39687
40216
|
const workspaceFileReferenceCopy = useAgentGUIWorkspaceFileReferenceCopy(t);
|
|
39688
40217
|
const windowTitle = title;
|
|
39689
|
-
const
|
|
39690
|
-
|
|
39691
|
-
|
|
39692
|
-
|
|
39693
|
-
|
|
39694
|
-
|
|
39695
|
-
|
|
39696
|
-
|
|
39697
|
-
|
|
39698
|
-
|
|
39699
|
-
|
|
39700
|
-
|
|
39701
|
-
|
|
39702
|
-
|
|
39703
|
-
|
|
39704
|
-
|
|
39705
|
-
|
|
39706
|
-
|
|
39707
|
-
railStatusProvider
|
|
39708
|
-
) : null,
|
|
39709
|
-
[railStatusProvider, workspaceAgentProbes?.snapshot]
|
|
39710
|
-
);
|
|
39711
|
-
const canonicalSlashStatusQuotas = viewModel.detail.usage?.quotas ?? EMPTY_SLASH_STATUS_QUOTAS;
|
|
39712
|
-
const slashStatusQuotaSource = canonicalSlashStatusQuotas.length > 0 ? canonicalSlashStatusQuotas : activeAgentProbe?.usage?.quotas && activeAgentProbe.usage.quotas.length > 0 ? activeAgentProbe.usage.quotas : EMPTY_SLASH_STATUS_QUOTAS;
|
|
39713
|
-
const slashStatusLimits = useMemo46(
|
|
39714
|
-
() => slashStatusLimitsFromQuotas(
|
|
39715
|
-
slashStatusQuotaSource,
|
|
39716
|
-
viewModel.composer.composerSettings.selectedModelValue ?? viewModel.composer.composerSettings.draftSettings.model,
|
|
39717
|
-
t
|
|
39718
|
-
),
|
|
39719
|
-
[
|
|
39720
|
-
slashStatusQuotaSource,
|
|
39721
|
-
t,
|
|
39722
|
-
viewModel.composer.composerSettings.draftSettings.model,
|
|
39723
|
-
viewModel.composer.composerSettings.selectedModelValue
|
|
39724
|
-
]
|
|
39725
|
-
);
|
|
39726
|
-
const slashStatusLimitsUnavailable = slashStatusLimits.length === 0 && canonicalSlashStatusQuotas.length === 0 && !(workspaceAgentProbes?.isLoadingUsage ?? false) && (Boolean(activeAgentProbe?.usage) || Boolean(activeAgentProbe?.lastError));
|
|
39727
|
-
const railSlashStatusQuotaSource = railStatusProvider && railAgentProbe?.usage?.quotas && railAgentProbe.usage.quotas.length > 0 ? railAgentProbe.usage.quotas : EMPTY_SLASH_STATUS_QUOTAS;
|
|
39728
|
-
const railSlashStatusLimits = useMemo46(
|
|
39729
|
-
() => slashStatusLimitsFromQuotas(railSlashStatusQuotaSource, null, t),
|
|
39730
|
-
[railSlashStatusQuotaSource, t]
|
|
39731
|
-
);
|
|
39732
|
-
const slashStatusUsageProbe = railStatusProvider ? railAgentProbe : activeAgentProbe;
|
|
39733
|
-
const slashStatusUsageCapturedAtUnixMs = slashStatusUsageProbe?.usage?.capturedAtUnixMs ?? null;
|
|
39734
|
-
const slashStatusUsageDidFail = workspaceAgentProbes?.usageLoadFailed ?? false;
|
|
39735
|
-
const slashStatusUsageAttempted = Boolean(slashStatusUsageProbe?.usage) || Boolean(slashStatusUsageProbe?.lastError);
|
|
39736
|
-
const agentProbeLines = useMemo46(() => {
|
|
39737
|
-
return buildDockAgentProbeTooltipLines(
|
|
39738
|
-
activeAgentProbe,
|
|
39739
|
-
workspaceAgentProbes?.isLoadingAvailability ?? false,
|
|
39740
|
-
t,
|
|
39741
|
-
{
|
|
39742
|
-
includeUsageLines: true,
|
|
39743
|
-
isLoadingUsage: workspaceAgentProbes?.isLoadingUsage ?? false
|
|
39744
|
-
}
|
|
39745
|
-
);
|
|
39746
|
-
}, [
|
|
39747
|
-
activeAgentProbe,
|
|
39748
|
-
workspaceAgentProbes?.isLoadingAvailability,
|
|
39749
|
-
workspaceAgentProbes?.isLoadingUsage,
|
|
39750
|
-
t
|
|
39751
|
-
]);
|
|
39752
|
-
useEffect40(() => {
|
|
39753
|
-
if (previewMode || !onAgentProbeDemandChange) {
|
|
39754
|
-
return;
|
|
39755
|
-
}
|
|
39756
|
-
const probeSourceId = `agent-gui:${nodeId}`;
|
|
39757
|
-
onAgentProbeDemandChange(activeProbeProvider, probeSourceId);
|
|
39758
|
-
return () => {
|
|
39759
|
-
onAgentProbeDemandChange(null, probeSourceId);
|
|
39760
|
-
};
|
|
39761
|
-
}, [activeProbeProvider, nodeId, onAgentProbeDemandChange, previewMode]);
|
|
39762
|
-
useEffect40(() => {
|
|
39763
|
-
if (previewMode || !onAgentProbeDemandChange || !railStatusProvider || railStatusProvider === activeProbeProvider) {
|
|
39764
|
-
return;
|
|
39765
|
-
}
|
|
39766
|
-
const probeSourceId = `agent-gui:${nodeId}:rail`;
|
|
39767
|
-
onAgentProbeDemandChange(railStatusProvider, probeSourceId);
|
|
39768
|
-
return () => {
|
|
39769
|
-
onAgentProbeDemandChange(null, probeSourceId);
|
|
39770
|
-
};
|
|
39771
|
-
}, [
|
|
39772
|
-
activeProbeProvider,
|
|
39773
|
-
nodeId,
|
|
39774
|
-
onAgentProbeDemandChange,
|
|
39775
|
-
previewMode,
|
|
39776
|
-
railStatusProvider
|
|
39777
|
-
]);
|
|
39778
|
-
const handleAgentProbeInfoOpen = useCallback63(() => {
|
|
39779
|
-
if (previewMode || !onAgentProbeRefreshRequest) {
|
|
39780
|
-
return;
|
|
39781
|
-
}
|
|
39782
|
-
onAgentProbeRefreshRequest(activeProbeProvider, `agent-gui:${nodeId}`);
|
|
39783
|
-
}, [activeProbeProvider, nodeId, onAgentProbeRefreshRequest, previewMode]);
|
|
39784
|
-
const handleAgentConfigMenuOpen = useCallback63(() => {
|
|
39785
|
-
if (previewMode || !onAgentProbeRefreshRequest) {
|
|
39786
|
-
return;
|
|
39787
|
-
}
|
|
39788
|
-
onAgentProbeRefreshRequest(
|
|
39789
|
-
railStatusProvider ?? activeProbeProvider,
|
|
39790
|
-
`agent-gui:${nodeId}:config`
|
|
39791
|
-
);
|
|
39792
|
-
}, [
|
|
39793
|
-
activeProbeProvider,
|
|
39794
|
-
nodeId,
|
|
39795
|
-
onAgentProbeRefreshRequest,
|
|
39796
|
-
previewMode,
|
|
39797
|
-
railStatusProvider
|
|
39798
|
-
]);
|
|
39799
|
-
const handleAgentUsageRefresh = useCallback63(() => {
|
|
39800
|
-
if (previewMode || !onAgentProbeRefreshRequest) {
|
|
39801
|
-
return;
|
|
39802
|
-
}
|
|
39803
|
-
onAgentProbeRefreshRequest(
|
|
39804
|
-
railStatusProvider ?? activeProbeProvider,
|
|
39805
|
-
`agent-gui:${nodeId}:usage-refresh`
|
|
39806
|
-
);
|
|
39807
|
-
}, [
|
|
39808
|
-
activeProbeProvider,
|
|
39809
|
-
nodeId,
|
|
39810
|
-
onAgentProbeRefreshRequest,
|
|
40218
|
+
const {
|
|
40219
|
+
agentProbeLines,
|
|
40220
|
+
controllerRailStatus,
|
|
40221
|
+
handleAgentConfigMenuClose,
|
|
40222
|
+
handleAgentConfigMenuOpen,
|
|
40223
|
+
handleAgentProbeInfoClose,
|
|
40224
|
+
handleAgentProbeInfoOpen,
|
|
40225
|
+
handleAgentUsageRefresh,
|
|
40226
|
+
handleSlashStatusClose,
|
|
40227
|
+
handleSlashStatusOpen,
|
|
40228
|
+
handleSlashStatusRefresh,
|
|
40229
|
+
railStatusProvider,
|
|
40230
|
+
slashStatusLimits,
|
|
40231
|
+
slashStatusLimitsUnavailable,
|
|
40232
|
+
slashStatusOverride
|
|
40233
|
+
} = useAgentGUIStatus({
|
|
40234
|
+
activeProvider,
|
|
40235
|
+
agentStatusController,
|
|
39811
40236
|
previewMode,
|
|
39812
|
-
|
|
39813
|
-
|
|
40237
|
+
t,
|
|
40238
|
+
viewModel
|
|
40239
|
+
});
|
|
39814
40240
|
return /* @__PURE__ */ jsx79(AgentGUIMentionServiceBoundary, { service: mentionService, children: /* @__PURE__ */ jsx79(
|
|
39815
40241
|
WorkspaceNodeWindow,
|
|
39816
40242
|
{
|
|
@@ -39834,7 +40260,8 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39834
40260
|
lines: agentProbeLines,
|
|
39835
40261
|
testId: "agent-gui-window-agent-info",
|
|
39836
40262
|
className: AgentGUINode_styles_default.windowAgentInfo,
|
|
39837
|
-
onOpen: handleAgentProbeInfoOpen
|
|
40263
|
+
onOpen: handleAgentProbeInfoOpen,
|
|
40264
|
+
onClose: handleAgentProbeInfoClose
|
|
39838
40265
|
}
|
|
39839
40266
|
),
|
|
39840
40267
|
/* @__PURE__ */ jsx79(
|
|
@@ -39889,17 +40316,22 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39889
40316
|
newConversationRequestSequence,
|
|
39890
40317
|
sessionActionRequest,
|
|
39891
40318
|
slashStatusLimits,
|
|
39892
|
-
slashStatusLimitsLoading:
|
|
40319
|
+
slashStatusLimitsLoading: controllerRailStatus?.loading ?? false,
|
|
39893
40320
|
slashStatusLimitsUnavailable,
|
|
40321
|
+
slashStatusOverride,
|
|
39894
40322
|
railConfigProvider: railStatusProvider,
|
|
39895
|
-
railSlashStatusLimits,
|
|
39896
|
-
slashStatusUsageCapturedAtUnixMs,
|
|
39897
|
-
slashStatusUsageDidFail,
|
|
39898
|
-
slashStatusUsageAttempted,
|
|
40323
|
+
railSlashStatusLimits: controllerRailStatus?.limits ?? [],
|
|
40324
|
+
slashStatusUsageCapturedAtUnixMs: controllerRailStatus?.capturedAtUnixMs ?? null,
|
|
40325
|
+
slashStatusUsageDidFail: controllerRailStatus?.didFail ?? false,
|
|
40326
|
+
slashStatusUsageAttempted: controllerRailStatus?.attempted ?? false,
|
|
40327
|
+
slashStatusLimitsResolvedEmpty: controllerRailStatus?.resolvedEmpty ?? false,
|
|
39899
40328
|
providerAuthAccountLabels,
|
|
40329
|
+
onAgentConfigMenuClose: handleAgentConfigMenuClose,
|
|
39900
40330
|
onAgentConfigMenuOpen: handleAgentConfigMenuOpen,
|
|
39901
40331
|
onAgentUsageRefresh: handleAgentUsageRefresh,
|
|
39902
|
-
onSlashStatusOpen:
|
|
40332
|
+
onSlashStatusOpen: handleSlashStatusOpen,
|
|
40333
|
+
onSlashStatusClose: handleSlashStatusClose,
|
|
40334
|
+
onSlashStatusRefresh: handleSlashStatusRefresh,
|
|
39903
40335
|
previewMode,
|
|
39904
40336
|
onLinkAction: handleLinkAction,
|
|
39905
40337
|
onHandoffConversation,
|
|
@@ -39962,16 +40394,16 @@ var AgentGUI = memo15(function AgentGUI2({
|
|
|
39962
40394
|
locale,
|
|
39963
40395
|
...props
|
|
39964
40396
|
}) {
|
|
39965
|
-
const normalizedAgents =
|
|
40397
|
+
const normalizedAgents = useMemo48(
|
|
39966
40398
|
() => normalizeAgentGUIAgents(agentDirectory.agents),
|
|
39967
40399
|
[agentDirectory.agents]
|
|
39968
40400
|
);
|
|
39969
|
-
const agentTargets =
|
|
40401
|
+
const agentTargets = useMemo48(
|
|
39970
40402
|
() => projectAgentGUIAgentsToTargets(normalizedAgents),
|
|
39971
40403
|
[normalizedAgents]
|
|
39972
40404
|
);
|
|
39973
40405
|
const effectiveHandoffAgentDirectory = handoffAgentDirectory ?? agentDirectory;
|
|
39974
|
-
const normalizedHandoffAgents =
|
|
40406
|
+
const normalizedHandoffAgents = useMemo48(
|
|
39975
40407
|
() => effectiveHandoffAgentDirectory.agents === agentDirectory.agents ? normalizedAgents : normalizeAgentGUIAgents(effectiveHandoffAgentDirectory.agents),
|
|
39976
40408
|
[
|
|
39977
40409
|
agentDirectory.agents,
|
|
@@ -39979,13 +40411,13 @@ var AgentGUI = memo15(function AgentGUI2({
|
|
|
39979
40411
|
normalizedAgents
|
|
39980
40412
|
]
|
|
39981
40413
|
);
|
|
39982
|
-
const handoffAgentTargets =
|
|
40414
|
+
const handoffAgentTargets = useMemo48(
|
|
39983
40415
|
() => normalizedHandoffAgents === normalizedAgents ? agentTargets : projectAgentGUIAgentsToTargets(normalizedHandoffAgents),
|
|
39984
40416
|
[agentTargets, normalizedAgents, normalizedHandoffAgents]
|
|
39985
40417
|
);
|
|
39986
40418
|
const hostCapabilities = props.hostCapabilities;
|
|
39987
40419
|
const renderSlots = props.renderSlots;
|
|
39988
|
-
const nodeHostCapabilities =
|
|
40420
|
+
const nodeHostCapabilities = useMemo48(
|
|
39989
40421
|
() => ({
|
|
39990
40422
|
...hostCapabilities,
|
|
39991
40423
|
agentTargets,
|
|
@@ -40008,7 +40440,7 @@ var AgentGUI = memo15(function AgentGUI2({
|
|
|
40008
40440
|
hostCapabilities
|
|
40009
40441
|
]
|
|
40010
40442
|
);
|
|
40011
|
-
const nodeRenderSlots =
|
|
40443
|
+
const nodeRenderSlots = useMemo48(
|
|
40012
40444
|
() => ({
|
|
40013
40445
|
...renderSlots,
|
|
40014
40446
|
providerRailEmpty: renderAgentsEmpty
|
|
@@ -40039,7 +40471,9 @@ export {
|
|
|
40039
40471
|
localAgentGUIAgentTargetId,
|
|
40040
40472
|
normalizeAgentGUIAgentTargets,
|
|
40041
40473
|
resolveAgentGUIAgentTarget,
|
|
40474
|
+
selectAgentStatusControllerSnapshot,
|
|
40475
|
+
createAgentStatusController,
|
|
40042
40476
|
AgentHandoffMenu,
|
|
40043
40477
|
AgentGUI
|
|
40044
40478
|
};
|
|
40045
|
-
//# sourceMappingURL=chunk-
|
|
40479
|
+
//# sourceMappingURL=chunk-7VPICMI3.js.map
|