@tutti-os/agent-gui 0.0.171 → 0.0.173
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 +54 -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-OUOVA353.js → chunk-5VUHTRRS.js} +4 -4
- package/dist/{chunk-EZ6E3LVP.js → chunk-CAZ7NYUE.js} +2 -2
- 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-C7RY5XMJ.js → chunk-I27O33CO.js} +6 -6
- package/dist/{chunk-7M6STXDS.js → chunk-K57GJTVC.js} +2 -2
- package/dist/{chunk-GMALB4L6.js → chunk-NNBJT5DD.js} +5 -5
- package/dist/{chunk-BHLX4ZFU.js → chunk-OKBVGNH7.js} +2 -2
- package/dist/{chunk-42W6JENH.js → chunk-UPX5IC2U.js} +2 -2
- package/dist/{chunk-5EHKHIFG.js → chunk-UXSYGLY3.js} +3 -3
- package/dist/{chunk-QEOAZW53.js → chunk-V7V7PU7Z.js} +2 -2
- package/dist/chunk-V7V7PU7Z.js.map +1 -0
- package/dist/{chunk-J4RQ2RTM.js → chunk-VGUKS6JR.js} +7 -7
- package/dist/chunk-VGUKS6JR.js.map +1 -0
- package/dist/{chunk-KDRU3NBW.js → chunk-ZPZD5XTH.js} +4 -4
- package/dist/{chunk-LQ6CK4GS.js → chunk-ZRZVJR3M.js} +1215 -741
- package/dist/chunk-ZRZVJR3M.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 +96 -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 +15 -15
- package/dist/chunk-J4RQ2RTM.js.map +0 -1
- package/dist/chunk-LQ6CK4GS.js.map +0 -1
- package/dist/chunk-QEOAZW53.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-OUOVA353.js.map → chunk-5VUHTRRS.js.map} +0 -0
- /package/dist/{chunk-EZ6E3LVP.js.map → chunk-CAZ7NYUE.js.map} +0 -0
- /package/dist/{chunk-C7RY5XMJ.js.map → chunk-I27O33CO.js.map} +0 -0
- /package/dist/{chunk-7M6STXDS.js.map → chunk-K57GJTVC.js.map} +0 -0
- /package/dist/{chunk-GMALB4L6.js.map → chunk-NNBJT5DD.js.map} +0 -0
- /package/dist/{chunk-BHLX4ZFU.js.map → chunk-OKBVGNH7.js.map} +0 -0
- /package/dist/{chunk-42W6JENH.js.map → chunk-UPX5IC2U.js.map} +0 -0
- /package/dist/{chunk-5EHKHIFG.js.map → chunk-UXSYGLY3.js.map} +0 -0
- /package/dist/{chunk-KDRU3NBW.js.map → chunk-ZPZD5XTH.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-I27O33CO.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-ZPZD5XTH.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-NNBJT5DD.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-5VUHTRRS.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-UXSYGLY3.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-V7V7PU7Z.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";
|
|
@@ -5054,7 +5054,7 @@ function normalizeInteractiveToolName(toolName) {
|
|
|
5054
5054
|
function areAgentGUIUserProjectsEqual(left, right) {
|
|
5055
5055
|
return left.length === right.length && left.every((project, index) => {
|
|
5056
5056
|
const candidate = right[index];
|
|
5057
|
-
return candidate !== void 0 && project.id === candidate.id && project.path === candidate.path && project.label === candidate.label && project.sectionKey === candidate.sectionKey && project.pinnedAtUnixMs === candidate.pinnedAtUnixMs;
|
|
5057
|
+
return candidate !== void 0 && project.id === candidate.id && project.path === candidate.path && project.label === candidate.label && project.sectionKey === candidate.sectionKey && project.pinnedAtUnixMs === candidate.pinnedAtUnixMs && project.createdAtUnixMs === candidate.createdAtUnixMs && project.updatedAtUnixMs === candidate.updatedAtUnixMs && project.lastUsedAtUnixMs === candidate.lastUsedAtUnixMs;
|
|
5058
5058
|
});
|
|
5059
5059
|
}
|
|
5060
5060
|
function upsertAgentGUIUserProject(projects, project) {
|
|
@@ -5738,6 +5738,7 @@ function useAgentGUIActivation({
|
|
|
5738
5738
|
...input.cwd !== void 0 ? { cwd: input.cwd } : {},
|
|
5739
5739
|
expiresAtUnixMs: requestedAtUnixMs + ACTIVATION_EXPIRY_MS,
|
|
5740
5740
|
...input.initialTurnExpected !== void 0 ? { initialTurnExpected: input.initialTurnExpected } : {},
|
|
5741
|
+
...input.railSectionKey?.trim() ? { railSectionKey: input.railSectionKey.trim() } : {},
|
|
5741
5742
|
...input.initialDisplayPrompt ? { initialDisplayPrompt: input.initialDisplayPrompt } : {},
|
|
5742
5743
|
...input.runtimeContent ? { runtimeContent: input.runtimeContent } : {},
|
|
5743
5744
|
...input.submitDiagnostics ? { submitDiagnostics: input.submitDiagnostics } : {},
|
|
@@ -6662,6 +6663,7 @@ function useAgentGuiConversationList(engine, query, agentTargets = EMPTY_AGENT_G
|
|
|
6662
6663
|
sortTimeUnixMs: activation.requestedAtUnixMs,
|
|
6663
6664
|
status: "working",
|
|
6664
6665
|
projectionSource: "pending_activation",
|
|
6666
|
+
railSectionKey: activation.railSectionKey,
|
|
6665
6667
|
title,
|
|
6666
6668
|
titleLeadingMentionKind,
|
|
6667
6669
|
titleFallback,
|
|
@@ -8154,6 +8156,37 @@ function useAgentGUIConversationBatchDeletion(input) {
|
|
|
8154
8156
|
sessionIds: [...targetIds],
|
|
8155
8157
|
workspaceId
|
|
8156
8158
|
}).then((result) => {
|
|
8159
|
+
if (result.cleanupFailedSessionIds.length > 0) {
|
|
8160
|
+
try {
|
|
8161
|
+
void Promise.resolve(
|
|
8162
|
+
agentActivityRuntime.reportDiagnostic?.({
|
|
8163
|
+
details: {
|
|
8164
|
+
cleanupFailedSessionIds: result.cleanupFailedSessionIds
|
|
8165
|
+
},
|
|
8166
|
+
event: "agent.gui.conversation_delete.cleanup_failed",
|
|
8167
|
+
level: "warn",
|
|
8168
|
+
source: "agent-gui",
|
|
8169
|
+
workspaceId
|
|
8170
|
+
})
|
|
8171
|
+
).catch((error) => {
|
|
8172
|
+
console.error(
|
|
8173
|
+
"[agent-gui-cleanup-diagnostic]",
|
|
8174
|
+
JSON.stringify({
|
|
8175
|
+
error: getAgentGUIErrorMessage(error),
|
|
8176
|
+
workspaceId
|
|
8177
|
+
})
|
|
8178
|
+
);
|
|
8179
|
+
});
|
|
8180
|
+
} catch (error) {
|
|
8181
|
+
console.error(
|
|
8182
|
+
"[agent-gui-cleanup-diagnostic]",
|
|
8183
|
+
JSON.stringify({
|
|
8184
|
+
error: getAgentGUIErrorMessage(error),
|
|
8185
|
+
workspaceId
|
|
8186
|
+
})
|
|
8187
|
+
);
|
|
8188
|
+
}
|
|
8189
|
+
}
|
|
8157
8190
|
const removedIds = /* @__PURE__ */ new Set([
|
|
8158
8191
|
...targetIds,
|
|
8159
8192
|
...result.removedSessionIds
|
|
@@ -8829,6 +8862,7 @@ function useAgentGUINewConversationActivation(input) {
|
|
|
8829
8862
|
isCreatingConversationRef,
|
|
8830
8863
|
onDataChangeRef,
|
|
8831
8864
|
selectedProjectPathRef,
|
|
8865
|
+
userProjectsRef,
|
|
8832
8866
|
draftByScopeKeyRef,
|
|
8833
8867
|
submittedDraftSnapshotsRef,
|
|
8834
8868
|
draftSettingsBySessionIdRef,
|
|
@@ -8884,6 +8918,11 @@ function useAgentGUINewConversationActivation(input) {
|
|
|
8884
8918
|
}
|
|
8885
8919
|
);
|
|
8886
8920
|
const selectedProjectPath = selectedProjectPathRef.current;
|
|
8921
|
+
const selectedProject = resolveAgentGUIConversationProject(
|
|
8922
|
+
selectedProjectPath,
|
|
8923
|
+
userProjectsRef.current
|
|
8924
|
+
);
|
|
8925
|
+
const railSectionKey = !selectedProjectPath?.trim() ? "conversations" : selectedProject?.sectionKey?.trim() || void 0;
|
|
8887
8926
|
const initialNodeSettings = readNodeDefaultDraftSettings({
|
|
8888
8927
|
data: targetData.data,
|
|
8889
8928
|
defaultReasoningEffort,
|
|
@@ -8927,6 +8966,7 @@ function useAgentGUINewConversationActivation(input) {
|
|
|
8927
8966
|
agentTargetId,
|
|
8928
8967
|
clientSubmitId: submitTrace.clientSubmitId,
|
|
8929
8968
|
cwd: selectedProjectPath ?? "",
|
|
8969
|
+
...railSectionKey ? { railSectionKey } : {},
|
|
8930
8970
|
initialContent: normalizedInitialContent,
|
|
8931
8971
|
...initialTurnExpected !== void 0 ? { initialTurnExpected } : {},
|
|
8932
8972
|
initialDisplayPrompt,
|
|
@@ -13350,11 +13390,721 @@ function useAgentGUINodeController({
|
|
|
13350
13390
|
return viewAssembly;
|
|
13351
13391
|
}
|
|
13352
13392
|
|
|
13393
|
+
// agent-gui/agentGuiNode/controller/useAgentGUIStatus.ts
|
|
13394
|
+
import { useCallback as useCallback28, useMemo as useMemo19 } from "react";
|
|
13395
|
+
|
|
13396
|
+
// agent-gui/workspaceDesktop/view/desktopDockAgentProbeTooltipModel.ts
|
|
13397
|
+
function buildDockAgentProbeTooltipLines(probe, isLoadingAvailability, t, popupOpts) {
|
|
13398
|
+
if (isLoadingAvailability && !probe) {
|
|
13399
|
+
return [t("agentHost.workspaceAgentProbeDockChecking")];
|
|
13400
|
+
}
|
|
13401
|
+
if (!probe) {
|
|
13402
|
+
return [t("agentHost.workspaceAgentProbeDockNoData")];
|
|
13403
|
+
}
|
|
13404
|
+
const lines = [];
|
|
13405
|
+
switch (probe.availability.status) {
|
|
13406
|
+
case "available":
|
|
13407
|
+
lines.push({
|
|
13408
|
+
label: t("agentHost.workspaceAgentProbeDetailStatus"),
|
|
13409
|
+
primary: t("agentHost.workspaceAgentProbeDockAvailable")
|
|
13410
|
+
});
|
|
13411
|
+
break;
|
|
13412
|
+
case "unavailable":
|
|
13413
|
+
lines.push({
|
|
13414
|
+
label: t("agentHost.workspaceAgentProbeDetailStatus"),
|
|
13415
|
+
primary: t("agentHost.workspaceAgentProbeUnavailableAria")
|
|
13416
|
+
});
|
|
13417
|
+
break;
|
|
13418
|
+
default:
|
|
13419
|
+
lines.push({
|
|
13420
|
+
label: t("agentHost.workspaceAgentProbeDetailStatus"),
|
|
13421
|
+
primary: t("agentHost.workspaceAgentProbeUnknownAria")
|
|
13422
|
+
});
|
|
13423
|
+
}
|
|
13424
|
+
if (probe.availability.status !== "available" && probe.availability.detailsVisible) {
|
|
13425
|
+
for (const check of probe.availability.checks ?? []) {
|
|
13426
|
+
if (!check.passed) {
|
|
13427
|
+
const primary = check.detail?.trim() || check.name.trim();
|
|
13428
|
+
if (!primary) {
|
|
13429
|
+
continue;
|
|
13430
|
+
}
|
|
13431
|
+
lines.push({
|
|
13432
|
+
label: check.name,
|
|
13433
|
+
primary
|
|
13434
|
+
});
|
|
13435
|
+
}
|
|
13436
|
+
}
|
|
13437
|
+
}
|
|
13438
|
+
const errMsg = probe.lastError?.message?.trim();
|
|
13439
|
+
if (errMsg && !popupOpts?.includeUsageLines) {
|
|
13440
|
+
lines.push(errMsg);
|
|
13441
|
+
}
|
|
13442
|
+
if (!popupOpts?.includeUsageLines) {
|
|
13443
|
+
return lines;
|
|
13444
|
+
}
|
|
13445
|
+
appendDockProbeUsageLines(probe, lines, popupOpts.isLoadingUsage ?? false, t);
|
|
13446
|
+
return lines;
|
|
13447
|
+
}
|
|
13448
|
+
function formatQuotaResetDisplay(quota) {
|
|
13449
|
+
if (!quota) {
|
|
13450
|
+
return void 0;
|
|
13451
|
+
}
|
|
13452
|
+
if (typeof quota.resetsAtUnixMs === "number" && Number.isFinite(quota.resetsAtUnixMs)) {
|
|
13453
|
+
return toLocalShortDateTime(quota.resetsAtUnixMs);
|
|
13454
|
+
}
|
|
13455
|
+
return quota.resetText;
|
|
13456
|
+
}
|
|
13457
|
+
function quotaTypeLabel(quotaType, t) {
|
|
13458
|
+
switch (quotaType) {
|
|
13459
|
+
case "session":
|
|
13460
|
+
return t("agentHost.workspaceAgentProbeQuotaSession");
|
|
13461
|
+
case "weekly":
|
|
13462
|
+
return t("agentHost.workspaceAgentProbeQuotaWeekly");
|
|
13463
|
+
case "monthly":
|
|
13464
|
+
return t("agentHost.workspaceAgentProbeQuotaMonthly");
|
|
13465
|
+
case "daily":
|
|
13466
|
+
return t("agentHost.workspaceAgentProbeQuotaDaily");
|
|
13467
|
+
case "cost":
|
|
13468
|
+
return t("agentHost.workspaceAgentProbeQuotaCost");
|
|
13469
|
+
default:
|
|
13470
|
+
return quotaType;
|
|
13471
|
+
}
|
|
13472
|
+
}
|
|
13473
|
+
function buildCompactDisplayQuotas(quotas, t) {
|
|
13474
|
+
const modelQuotas = quotas.filter(
|
|
13475
|
+
(quota) => quota.modelName || quota.quotaType === "model"
|
|
13476
|
+
);
|
|
13477
|
+
const nonModelQuotas = quotas.filter(
|
|
13478
|
+
(quota) => !quota.modelName && quota.quotaType !== "model"
|
|
13479
|
+
);
|
|
13480
|
+
const displayRows = nonModelQuotas.map((quota) => ({
|
|
13481
|
+
label: quota.quotaType === "session" ? "" : quotaTypeLabel(quota.quotaType, t),
|
|
13482
|
+
percentRemaining: quota.percentRemaining,
|
|
13483
|
+
dollarRemaining: quota.dollarRemaining,
|
|
13484
|
+
resetDisplay: formatQuotaResetDisplay(quota)
|
|
13485
|
+
}));
|
|
13486
|
+
if (modelQuotas.length === 0) {
|
|
13487
|
+
return displayRows;
|
|
13488
|
+
}
|
|
13489
|
+
const percentQuota = modelQuotas.filter(
|
|
13490
|
+
(quota) => typeof quota.percentRemaining === "number"
|
|
13491
|
+
).sort((left, right) => left.percentRemaining - right.percentRemaining)[0];
|
|
13492
|
+
const dollarQuota = modelQuotas.filter(
|
|
13493
|
+
(quota) => typeof quota.dollarRemaining === "number"
|
|
13494
|
+
).sort((left, right) => left.dollarRemaining - right.dollarRemaining)[0];
|
|
13495
|
+
displayRows.push({
|
|
13496
|
+
label: t("agentHost.workspaceAgentProbeAgentUsage"),
|
|
13497
|
+
percentRemaining: percentQuota?.percentRemaining,
|
|
13498
|
+
dollarRemaining: dollarQuota?.dollarRemaining,
|
|
13499
|
+
resetDisplay: formatQuotaResetDisplay(percentQuota ?? dollarQuota)
|
|
13500
|
+
});
|
|
13501
|
+
return displayRows;
|
|
13502
|
+
}
|
|
13503
|
+
function formatQuotaPrimaryLine(row, t) {
|
|
13504
|
+
if (row.percentRemaining !== void 0) {
|
|
13505
|
+
return t("agentHost.workspaceAgentProbeQuotaRemaining", {
|
|
13506
|
+
percent: Math.round(row.percentRemaining)
|
|
13507
|
+
});
|
|
13508
|
+
}
|
|
13509
|
+
if (row.dollarRemaining !== void 0) {
|
|
13510
|
+
return t("agentHost.workspaceAgentProbeQuotaDollarRemaining", {
|
|
13511
|
+
amount: row.dollarRemaining.toFixed(2)
|
|
13512
|
+
});
|
|
13513
|
+
}
|
|
13514
|
+
return null;
|
|
13515
|
+
}
|
|
13516
|
+
function appendDockProbeUsageLines(probe, lines, isLoadingUsage, t) {
|
|
13517
|
+
if (probe.lastError?.code === "unsupported") {
|
|
13518
|
+
lines.push({
|
|
13519
|
+
label: t("agentHost.workspaceAgentProbeDetailQuota"),
|
|
13520
|
+
primary: t("agentHost.workspaceAgentProbeUsageUnsupported")
|
|
13521
|
+
});
|
|
13522
|
+
return;
|
|
13523
|
+
}
|
|
13524
|
+
if (isLoadingUsage && !probe.usage) {
|
|
13525
|
+
lines.push(t("agentHost.workspaceAgentProbeLoadingUsage"));
|
|
13526
|
+
return;
|
|
13527
|
+
}
|
|
13528
|
+
const quotas = probe.usage?.quotas ?? [];
|
|
13529
|
+
if (quotas.length === 0) {
|
|
13530
|
+
lines.push({
|
|
13531
|
+
label: t("agentHost.workspaceAgentProbeDetailQuota"),
|
|
13532
|
+
primary: t("agentHost.workspaceAgentProbeUsageUnsupported")
|
|
13533
|
+
});
|
|
13534
|
+
return;
|
|
13535
|
+
}
|
|
13536
|
+
const rows = buildCompactDisplayQuotas(quotas, t);
|
|
13537
|
+
for (const row of rows) {
|
|
13538
|
+
const primary = formatQuotaPrimaryLine(row, t);
|
|
13539
|
+
const labelTrim = row.label.trim();
|
|
13540
|
+
if (primary) {
|
|
13541
|
+
const label = labelTrim || t("agentHost.workspaceAgentProbeDetailQuota");
|
|
13542
|
+
lines.push({
|
|
13543
|
+
label,
|
|
13544
|
+
primary
|
|
13545
|
+
});
|
|
13546
|
+
if (row.resetDisplay) {
|
|
13547
|
+
lines.push({
|
|
13548
|
+
label: t("agentHost.workspaceAgentProbeQuotaResetTimeLabel", {
|
|
13549
|
+
label
|
|
13550
|
+
}),
|
|
13551
|
+
primary: row.resetDisplay
|
|
13552
|
+
});
|
|
13553
|
+
}
|
|
13554
|
+
}
|
|
13555
|
+
}
|
|
13556
|
+
}
|
|
13557
|
+
|
|
13558
|
+
// agent-gui/agentGuiNode/AgentGUINode.usage.ts
|
|
13559
|
+
function slashStatusQuotaLabel(quota, t) {
|
|
13560
|
+
const modelName = quota.modelName?.trim();
|
|
13561
|
+
if (modelName) {
|
|
13562
|
+
return modelName;
|
|
13563
|
+
}
|
|
13564
|
+
switch (quota.quotaType) {
|
|
13565
|
+
case "session":
|
|
13566
|
+
return t("agentHost.agentGui.slashStatusFiveHourLimit");
|
|
13567
|
+
case "weekly":
|
|
13568
|
+
return t("agentHost.agentGui.slashStatusWeeklyLimit");
|
|
13569
|
+
case "daily":
|
|
13570
|
+
return t("agentHost.workspaceAgentProbeQuotaDaily");
|
|
13571
|
+
case "monthly":
|
|
13572
|
+
return t("agentHost.workspaceAgentProbeQuotaMonthly");
|
|
13573
|
+
case "cost":
|
|
13574
|
+
return t("agentHost.workspaceAgentProbeQuotaCost");
|
|
13575
|
+
case "model":
|
|
13576
|
+
return t("agentHost.workspaceAgentProbeAgentUsage");
|
|
13577
|
+
default:
|
|
13578
|
+
return quota.quotaType;
|
|
13579
|
+
}
|
|
13580
|
+
}
|
|
13581
|
+
function slashStatusQuotaValue(quota, t) {
|
|
13582
|
+
if (typeof quota.percentRemaining === "number" && Number.isFinite(quota.percentRemaining)) {
|
|
13583
|
+
return t("agentHost.agentGui.slashStatusLimitPercentLeft", {
|
|
13584
|
+
percent: Math.round(quota.percentRemaining)
|
|
13585
|
+
});
|
|
13586
|
+
}
|
|
13587
|
+
if (typeof quota.dollarRemaining === "number" && Number.isFinite(quota.dollarRemaining)) {
|
|
13588
|
+
return t("agentHost.workspaceAgentProbeQuotaDollarRemaining", {
|
|
13589
|
+
amount: quota.dollarRemaining.toFixed(2)
|
|
13590
|
+
});
|
|
13591
|
+
}
|
|
13592
|
+
return "";
|
|
13593
|
+
}
|
|
13594
|
+
function slashStatusQuotaReset(quota, t) {
|
|
13595
|
+
const reset = typeof quota.resetsAtUnixMs === "number" && Number.isFinite(quota.resetsAtUnixMs) ? toLocalShortDateTime(quota.resetsAtUnixMs) : quota.resetText?.trim();
|
|
13596
|
+
return reset ? t("agentHost.agentGui.slashStatusLimitReset", { reset }) : "";
|
|
13597
|
+
}
|
|
13598
|
+
function slashStatusLimitsFromQuotas(quotas, selectedModel, t) {
|
|
13599
|
+
const filteredQuotas = filterSlashStatusQuotasForModel(quotas, selectedModel);
|
|
13600
|
+
return filteredQuotas.map((quota, index) => {
|
|
13601
|
+
const value = slashStatusQuotaValue(quota, t);
|
|
13602
|
+
if (!value) {
|
|
13603
|
+
return null;
|
|
13604
|
+
}
|
|
13605
|
+
const label = slashStatusQuotaLabel(quota, t).trim();
|
|
13606
|
+
if (!label) {
|
|
13607
|
+
return null;
|
|
13608
|
+
}
|
|
13609
|
+
return {
|
|
13610
|
+
id: `${quota.quotaType}:${quota.modelName ?? ""}:${index}`,
|
|
13611
|
+
label,
|
|
13612
|
+
percentRemaining: typeof quota.percentRemaining === "number" && Number.isFinite(quota.percentRemaining) ? Math.max(0, Math.min(100, Math.round(quota.percentRemaining))) : null,
|
|
13613
|
+
value,
|
|
13614
|
+
reset: slashStatusQuotaReset(quota, t) || null
|
|
13615
|
+
};
|
|
13616
|
+
}).filter((limit) => limit !== null);
|
|
13617
|
+
}
|
|
13618
|
+
function filterSlashStatusQuotasForModel(quotas, selectedModel) {
|
|
13619
|
+
const normalizedSelectedModel = normalizeSlashStatusModelName(selectedModel);
|
|
13620
|
+
const baseQuotas = (quotas ?? []).filter(
|
|
13621
|
+
(quota) => quota.quotaType !== "model"
|
|
13622
|
+
);
|
|
13623
|
+
const matchingModelQuotas = (quotas ?? []).filter((quota) => {
|
|
13624
|
+
const quotaModelName = normalizeSlashStatusModelName(quota.modelName);
|
|
13625
|
+
return quota.quotaType === "model" && quotaModelName !== "" && normalizedSelectedModel !== "" && quotaModelName === normalizedSelectedModel;
|
|
13626
|
+
});
|
|
13627
|
+
return [...baseQuotas, ...matchingModelQuotas];
|
|
13628
|
+
}
|
|
13629
|
+
function normalizeSlashStatusModelName(value) {
|
|
13630
|
+
return value?.trim().toLowerCase().replace(/[^a-z0-9]+/gu, "-").replace(/^-+|-+$/gu, "") ?? "";
|
|
13631
|
+
}
|
|
13632
|
+
function resolveAgentGUIRailStatusProvider(input) {
|
|
13633
|
+
const filter = input.conversationFilter;
|
|
13634
|
+
if (filter.kind !== "agentTarget") {
|
|
13635
|
+
return null;
|
|
13636
|
+
}
|
|
13637
|
+
const target = input.agentTargets.find(
|
|
13638
|
+
(candidate) => candidate.disabled !== true && (candidate.agentTargetId?.trim() ?? "") === filter.agentTargetId
|
|
13639
|
+
);
|
|
13640
|
+
return target ? target.provider : null;
|
|
13641
|
+
}
|
|
13642
|
+
|
|
13643
|
+
// agent-gui/agentGuiNode/controller/AgentStatusController.ts
|
|
13644
|
+
var DEFAULT_REQUEST_TIMEOUT_MS = 3e4;
|
|
13645
|
+
var DEFAULT_RETAINED_SNAPSHOT_MS = 60 * 6e4;
|
|
13646
|
+
var DEFAULT_FORCED_REFRESH_DEBOUNCE_MS = 5e3;
|
|
13647
|
+
var IDLE_SNAPSHOT = {
|
|
13648
|
+
query: null,
|
|
13649
|
+
value: null,
|
|
13650
|
+
phase: "idle",
|
|
13651
|
+
isRefreshing: false,
|
|
13652
|
+
errorCode: null
|
|
13653
|
+
};
|
|
13654
|
+
function normalizeQuery(query) {
|
|
13655
|
+
const scopeKey = query.scopeKey.trim();
|
|
13656
|
+
if (!scopeKey) {
|
|
13657
|
+
return null;
|
|
13658
|
+
}
|
|
13659
|
+
return {
|
|
13660
|
+
scopeKey,
|
|
13661
|
+
agentSessionId: query.agentSessionId?.trim() || null,
|
|
13662
|
+
reason: query.reason,
|
|
13663
|
+
forceRefresh: query.forceRefresh === true
|
|
13664
|
+
};
|
|
13665
|
+
}
|
|
13666
|
+
function cacheKeyFor(query) {
|
|
13667
|
+
return `${query.scopeKey}\0${query.agentSessionId ?? ""}`;
|
|
13668
|
+
}
|
|
13669
|
+
function selectAgentStatusControllerSnapshot(snapshot, key) {
|
|
13670
|
+
const scopeKey = key.scopeKey.trim();
|
|
13671
|
+
const agentSessionId = key.agentSessionId?.trim() || null;
|
|
13672
|
+
if (snapshot.query?.scopeKey !== scopeKey || (snapshot.query.agentSessionId?.trim() || null) !== agentSessionId || key.reasons !== void 0 && !key.reasons.includes(snapshot.query.reason)) {
|
|
13673
|
+
return IDLE_SNAPSHOT;
|
|
13674
|
+
}
|
|
13675
|
+
return snapshot;
|
|
13676
|
+
}
|
|
13677
|
+
function createAgentStatusController(options) {
|
|
13678
|
+
const now = options.now ?? Date.now;
|
|
13679
|
+
const requestTimeoutMs = options.requestTimeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
|
|
13680
|
+
const retainedSnapshotMs = options.retainedSnapshotMs ?? DEFAULT_RETAINED_SNAPSHOT_MS;
|
|
13681
|
+
const forcedRefreshDebounceMs = options.forcedRefreshDebounceMs ?? DEFAULT_FORCED_REFRESH_DEBOUNCE_MS;
|
|
13682
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
13683
|
+
const retained = /* @__PURE__ */ new Map();
|
|
13684
|
+
const lastForcedRefreshAt = /* @__PURE__ */ new Map();
|
|
13685
|
+
let snapshot = IDLE_SNAPSHOT;
|
|
13686
|
+
let active = null;
|
|
13687
|
+
let nextRequestId = 1;
|
|
13688
|
+
const publish = (next) => {
|
|
13689
|
+
if (snapshot === next) {
|
|
13690
|
+
return;
|
|
13691
|
+
}
|
|
13692
|
+
snapshot = next;
|
|
13693
|
+
for (const listener of listeners) {
|
|
13694
|
+
listener();
|
|
13695
|
+
}
|
|
13696
|
+
};
|
|
13697
|
+
const stopActive = () => {
|
|
13698
|
+
const current = active;
|
|
13699
|
+
active = null;
|
|
13700
|
+
if (!current) {
|
|
13701
|
+
return;
|
|
13702
|
+
}
|
|
13703
|
+
if (current.timeout !== null) {
|
|
13704
|
+
current.timeout.cancel();
|
|
13705
|
+
}
|
|
13706
|
+
current.unsubscribe?.();
|
|
13707
|
+
};
|
|
13708
|
+
const finishRequest = (request) => {
|
|
13709
|
+
if (active?.id !== request.id) {
|
|
13710
|
+
return false;
|
|
13711
|
+
}
|
|
13712
|
+
active = null;
|
|
13713
|
+
if (request.timeout !== null) {
|
|
13714
|
+
request.timeout.cancel();
|
|
13715
|
+
request.timeout = null;
|
|
13716
|
+
}
|
|
13717
|
+
const unsubscribe = request.unsubscribe;
|
|
13718
|
+
request.unsubscribe = null;
|
|
13719
|
+
unsubscribe?.();
|
|
13720
|
+
return true;
|
|
13721
|
+
};
|
|
13722
|
+
const controller = {
|
|
13723
|
+
getSnapshot: () => snapshot,
|
|
13724
|
+
subscribe: (listener) => {
|
|
13725
|
+
listeners.add(listener);
|
|
13726
|
+
return () => listeners.delete(listener);
|
|
13727
|
+
},
|
|
13728
|
+
open: (requestedQuery) => {
|
|
13729
|
+
const query = normalizeQuery(requestedQuery);
|
|
13730
|
+
if (!query) {
|
|
13731
|
+
stopActive();
|
|
13732
|
+
publish({
|
|
13733
|
+
query: null,
|
|
13734
|
+
value: null,
|
|
13735
|
+
phase: "error",
|
|
13736
|
+
isRefreshing: false,
|
|
13737
|
+
errorCode: "invalid_target"
|
|
13738
|
+
});
|
|
13739
|
+
return;
|
|
13740
|
+
}
|
|
13741
|
+
const cacheKey = cacheKeyFor(query);
|
|
13742
|
+
const requestedAt = now();
|
|
13743
|
+
if (query.forceRefresh) {
|
|
13744
|
+
const previousForcedRefreshAt = lastForcedRefreshAt.get(cacheKey);
|
|
13745
|
+
if (previousForcedRefreshAt !== void 0 && requestedAt - previousForcedRefreshAt < forcedRefreshDebounceMs) {
|
|
13746
|
+
return;
|
|
13747
|
+
}
|
|
13748
|
+
lastForcedRefreshAt.set(cacheKey, requestedAt);
|
|
13749
|
+
}
|
|
13750
|
+
stopActive();
|
|
13751
|
+
const retainedEntry = retained.get(cacheKey);
|
|
13752
|
+
const retainedValue = retainedEntry && requestedAt - retainedEntry.receivedAtUnixMs <= retainedSnapshotMs ? retainedEntry.value : null;
|
|
13753
|
+
if (retainedEntry && retainedValue === null) {
|
|
13754
|
+
retained.delete(cacheKey);
|
|
13755
|
+
}
|
|
13756
|
+
const request = {
|
|
13757
|
+
id: nextRequestId++,
|
|
13758
|
+
cacheKey,
|
|
13759
|
+
frameCount: 0,
|
|
13760
|
+
lastFrameKind: null,
|
|
13761
|
+
receivedFrame: false,
|
|
13762
|
+
timeout: null,
|
|
13763
|
+
unsubscribe: null
|
|
13764
|
+
};
|
|
13765
|
+
active = request;
|
|
13766
|
+
publish({
|
|
13767
|
+
query,
|
|
13768
|
+
value: retainedValue,
|
|
13769
|
+
phase: retainedValue ? "ready" : "loading",
|
|
13770
|
+
isRefreshing: true,
|
|
13771
|
+
errorCode: null
|
|
13772
|
+
});
|
|
13773
|
+
request.timeout = agentGuiScheduler.schedule(requestTimeoutMs, () => {
|
|
13774
|
+
if (active?.id !== request.id) {
|
|
13775
|
+
return;
|
|
13776
|
+
}
|
|
13777
|
+
stopActive();
|
|
13778
|
+
publish({
|
|
13779
|
+
...snapshot,
|
|
13780
|
+
phase: snapshot.value ? "ready" : "error",
|
|
13781
|
+
isRefreshing: false,
|
|
13782
|
+
errorCode: "timeout"
|
|
13783
|
+
});
|
|
13784
|
+
});
|
|
13785
|
+
const isCurrent = () => active?.id === request.id;
|
|
13786
|
+
const observer = {
|
|
13787
|
+
onFrame: (frame) => {
|
|
13788
|
+
if (!isCurrent()) {
|
|
13789
|
+
return;
|
|
13790
|
+
}
|
|
13791
|
+
const responseSessionId = frame.value.agentSessionId?.trim() || null;
|
|
13792
|
+
const expectedSessionId = query.agentSessionId?.trim() || null;
|
|
13793
|
+
const invalidSequence = request.frameCount >= 2 || request.frameCount === 1 && (request.lastFrameKind !== "snapshot" || frame.kind !== "refreshed");
|
|
13794
|
+
if (invalidSequence || responseSessionId !== expectedSessionId) {
|
|
13795
|
+
if (!finishRequest(request)) return;
|
|
13796
|
+
publish({
|
|
13797
|
+
...snapshot,
|
|
13798
|
+
phase: snapshot.value ? "ready" : "error",
|
|
13799
|
+
isRefreshing: false,
|
|
13800
|
+
errorCode: "unavailable"
|
|
13801
|
+
});
|
|
13802
|
+
return;
|
|
13803
|
+
}
|
|
13804
|
+
request.frameCount++;
|
|
13805
|
+
request.lastFrameKind = frame.kind;
|
|
13806
|
+
request.receivedFrame = true;
|
|
13807
|
+
retained.set(cacheKey, {
|
|
13808
|
+
value: frame.value,
|
|
13809
|
+
receivedAtUnixMs: now()
|
|
13810
|
+
});
|
|
13811
|
+
publish({
|
|
13812
|
+
query,
|
|
13813
|
+
value: frame.value,
|
|
13814
|
+
phase: "ready",
|
|
13815
|
+
isRefreshing: true,
|
|
13816
|
+
errorCode: null
|
|
13817
|
+
});
|
|
13818
|
+
},
|
|
13819
|
+
onError: (error) => {
|
|
13820
|
+
if (!finishRequest(request)) {
|
|
13821
|
+
return;
|
|
13822
|
+
}
|
|
13823
|
+
publish({
|
|
13824
|
+
...snapshot,
|
|
13825
|
+
phase: snapshot.value ? "ready" : "error",
|
|
13826
|
+
isRefreshing: false,
|
|
13827
|
+
errorCode: error.code.trim() || "unavailable"
|
|
13828
|
+
});
|
|
13829
|
+
},
|
|
13830
|
+
onComplete: () => {
|
|
13831
|
+
if (!finishRequest(request)) {
|
|
13832
|
+
return;
|
|
13833
|
+
}
|
|
13834
|
+
const errorCode = request.receivedFrame ? snapshot.errorCode : "unavailable";
|
|
13835
|
+
publish({
|
|
13836
|
+
...snapshot,
|
|
13837
|
+
phase: snapshot.value ? "ready" : "error",
|
|
13838
|
+
isRefreshing: false,
|
|
13839
|
+
errorCode
|
|
13840
|
+
});
|
|
13841
|
+
}
|
|
13842
|
+
};
|
|
13843
|
+
try {
|
|
13844
|
+
const unsubscribe = options.source.open(query, observer);
|
|
13845
|
+
if (active?.id === request.id) {
|
|
13846
|
+
request.unsubscribe = unsubscribe;
|
|
13847
|
+
} else {
|
|
13848
|
+
unsubscribe();
|
|
13849
|
+
}
|
|
13850
|
+
} catch {
|
|
13851
|
+
observer.onError({ code: "unavailable" });
|
|
13852
|
+
}
|
|
13853
|
+
},
|
|
13854
|
+
close: () => {
|
|
13855
|
+
stopActive();
|
|
13856
|
+
if (snapshot.isRefreshing) {
|
|
13857
|
+
publish({ ...snapshot, isRefreshing: false });
|
|
13858
|
+
}
|
|
13859
|
+
},
|
|
13860
|
+
invalidate: (scopeKey) => {
|
|
13861
|
+
const normalizedScopeKey = scopeKey?.trim() ?? "";
|
|
13862
|
+
if (!normalizedScopeKey) {
|
|
13863
|
+
retained.clear();
|
|
13864
|
+
lastForcedRefreshAt.clear();
|
|
13865
|
+
} else {
|
|
13866
|
+
for (const key of retained.keys()) {
|
|
13867
|
+
if (key.startsWith(`${normalizedScopeKey}\0`)) {
|
|
13868
|
+
retained.delete(key);
|
|
13869
|
+
}
|
|
13870
|
+
}
|
|
13871
|
+
for (const key of lastForcedRefreshAt.keys()) {
|
|
13872
|
+
if (key.startsWith(`${normalizedScopeKey}\0`)) {
|
|
13873
|
+
lastForcedRefreshAt.delete(key);
|
|
13874
|
+
}
|
|
13875
|
+
}
|
|
13876
|
+
}
|
|
13877
|
+
if (snapshot.query && (!normalizedScopeKey || snapshot.query.scopeKey === normalizedScopeKey)) {
|
|
13878
|
+
stopActive();
|
|
13879
|
+
publish(IDLE_SNAPSHOT);
|
|
13880
|
+
}
|
|
13881
|
+
}
|
|
13882
|
+
};
|
|
13883
|
+
return controller;
|
|
13884
|
+
}
|
|
13885
|
+
|
|
13886
|
+
// agent-gui/agentGuiNode/controller/useAgentGUIStatus.ts
|
|
13887
|
+
var EMPTY_STATUS_SNAPSHOT = {
|
|
13888
|
+
query: null,
|
|
13889
|
+
value: null,
|
|
13890
|
+
phase: "idle",
|
|
13891
|
+
isRefreshing: false,
|
|
13892
|
+
errorCode: null
|
|
13893
|
+
};
|
|
13894
|
+
var EMPTY_STATUS_STORE = {
|
|
13895
|
+
getSnapshot: () => EMPTY_STATUS_SNAPSHOT,
|
|
13896
|
+
subscribe: () => () => {
|
|
13897
|
+
}
|
|
13898
|
+
};
|
|
13899
|
+
var selectStatusSnapshot = (snapshot) => snapshot;
|
|
13900
|
+
function useAgentGUIStatus(input) {
|
|
13901
|
+
const { agentStatusController, previewMode, t, viewModel } = input;
|
|
13902
|
+
const agentStatusSnapshot = useEngineSelector(
|
|
13903
|
+
agentStatusController ?? EMPTY_STATUS_STORE,
|
|
13904
|
+
selectStatusSnapshot
|
|
13905
|
+
);
|
|
13906
|
+
const activeStatusScopeKey = viewModel.rail.activeConversation?.agentTargetId?.trim() || viewModel.rail.selectedAgentTarget.agentTargetId?.trim() || viewModel.rail.selectedAgentTarget.targetId.trim();
|
|
13907
|
+
const activeStatusSessionId = viewModel.rail.activeConversationId?.trim() || viewModel.interaction.sessionChrome.rawState?.agentSessionId?.trim() || null;
|
|
13908
|
+
const railStatusProvider = useMemo19(
|
|
13909
|
+
() => resolveAgentGUIRailStatusProvider({
|
|
13910
|
+
conversationFilter: viewModel.rail.conversationFilter,
|
|
13911
|
+
agentTargets: viewModel.rail.agentTargets
|
|
13912
|
+
}),
|
|
13913
|
+
[viewModel.rail.conversationFilter, viewModel.rail.agentTargets]
|
|
13914
|
+
);
|
|
13915
|
+
const railStatusScopeKey = viewModel.rail.conversationFilter.kind === "agentTarget" ? viewModel.rail.conversationFilter.agentTargetId.trim() : activeStatusScopeKey;
|
|
13916
|
+
const activeAgentStatusSnapshot = selectAgentStatusControllerSnapshot(
|
|
13917
|
+
agentStatusSnapshot,
|
|
13918
|
+
{
|
|
13919
|
+
scopeKey: activeStatusScopeKey,
|
|
13920
|
+
agentSessionId: activeStatusSessionId,
|
|
13921
|
+
reasons: ["slash-status", "agent-info"]
|
|
13922
|
+
}
|
|
13923
|
+
);
|
|
13924
|
+
const railAgentStatusSnapshot = selectAgentStatusControllerSnapshot(
|
|
13925
|
+
agentStatusSnapshot,
|
|
13926
|
+
{
|
|
13927
|
+
scopeKey: railStatusScopeKey,
|
|
13928
|
+
agentSessionId: null,
|
|
13929
|
+
reasons: ["agent-config"]
|
|
13930
|
+
}
|
|
13931
|
+
);
|
|
13932
|
+
const agentInfoProbe = useMemo19(() => {
|
|
13933
|
+
const value = activeAgentStatusSnapshot.value;
|
|
13934
|
+
return {
|
|
13935
|
+
provider: input.activeProvider,
|
|
13936
|
+
availability: {
|
|
13937
|
+
status: "unknown",
|
|
13938
|
+
detailsVisible: false,
|
|
13939
|
+
checks: []
|
|
13940
|
+
},
|
|
13941
|
+
...value && (value.limitsState === "available" || value.quotas.length > 0) ? {
|
|
13942
|
+
usage: {
|
|
13943
|
+
quotas: [...value.quotas],
|
|
13944
|
+
capturedAtUnixMs: value.limitsCapturedAtUnixMs ?? 0
|
|
13945
|
+
}
|
|
13946
|
+
} : {},
|
|
13947
|
+
...value?.limitsState === "error" ? { lastError: { code: "runtime_unavailable" } } : {}
|
|
13948
|
+
};
|
|
13949
|
+
}, [activeAgentStatusSnapshot.value, input.activeProvider]);
|
|
13950
|
+
const agentProbeLines = useMemo19(
|
|
13951
|
+
() => buildDockAgentProbeTooltipLines(
|
|
13952
|
+
agentInfoProbe,
|
|
13953
|
+
activeAgentStatusSnapshot.phase === "loading" && activeAgentStatusSnapshot.value === null,
|
|
13954
|
+
t,
|
|
13955
|
+
{
|
|
13956
|
+
includeUsageLines: true,
|
|
13957
|
+
isLoadingUsage: activeAgentStatusSnapshot.isRefreshing && activeAgentStatusSnapshot.value === null
|
|
13958
|
+
}
|
|
13959
|
+
),
|
|
13960
|
+
[
|
|
13961
|
+
activeAgentStatusSnapshot.isRefreshing,
|
|
13962
|
+
activeAgentStatusSnapshot.phase,
|
|
13963
|
+
activeAgentStatusSnapshot.value,
|
|
13964
|
+
agentInfoProbe,
|
|
13965
|
+
t
|
|
13966
|
+
]
|
|
13967
|
+
);
|
|
13968
|
+
const requestStatus = useCallback28(
|
|
13969
|
+
(request) => {
|
|
13970
|
+
if (!previewMode) {
|
|
13971
|
+
agentStatusController?.open(request);
|
|
13972
|
+
}
|
|
13973
|
+
},
|
|
13974
|
+
[agentStatusController, previewMode]
|
|
13975
|
+
);
|
|
13976
|
+
const closeStatus = useCallback28(
|
|
13977
|
+
(reason) => {
|
|
13978
|
+
if (agentStatusSnapshot.query?.reason === reason) {
|
|
13979
|
+
agentStatusController?.close();
|
|
13980
|
+
}
|
|
13981
|
+
},
|
|
13982
|
+
[agentStatusController, agentStatusSnapshot.query?.reason]
|
|
13983
|
+
);
|
|
13984
|
+
const handleAgentProbeInfoOpen = useCallback28(() => {
|
|
13985
|
+
requestStatus({
|
|
13986
|
+
scopeKey: activeStatusScopeKey,
|
|
13987
|
+
agentSessionId: activeStatusSessionId,
|
|
13988
|
+
reason: "agent-info"
|
|
13989
|
+
});
|
|
13990
|
+
}, [activeStatusScopeKey, activeStatusSessionId, requestStatus]);
|
|
13991
|
+
const handleAgentProbeInfoClose = useCallback28(
|
|
13992
|
+
() => closeStatus("agent-info"),
|
|
13993
|
+
[closeStatus]
|
|
13994
|
+
);
|
|
13995
|
+
const handleAgentConfigMenuOpen = useCallback28(() => {
|
|
13996
|
+
requestStatus({
|
|
13997
|
+
scopeKey: railStatusScopeKey,
|
|
13998
|
+
agentSessionId: null,
|
|
13999
|
+
reason: "agent-config"
|
|
14000
|
+
});
|
|
14001
|
+
}, [railStatusScopeKey, requestStatus]);
|
|
14002
|
+
const handleAgentConfigMenuClose = useCallback28(
|
|
14003
|
+
() => closeStatus("agent-config"),
|
|
14004
|
+
[closeStatus]
|
|
14005
|
+
);
|
|
14006
|
+
const handleAgentUsageRefresh = useCallback28(() => {
|
|
14007
|
+
requestStatus({
|
|
14008
|
+
scopeKey: railStatusScopeKey,
|
|
14009
|
+
agentSessionId: null,
|
|
14010
|
+
reason: "agent-config",
|
|
14011
|
+
forceRefresh: true
|
|
14012
|
+
});
|
|
14013
|
+
}, [railStatusScopeKey, requestStatus]);
|
|
14014
|
+
const handleSlashStatusClose = useCallback28(
|
|
14015
|
+
() => closeStatus("slash-status"),
|
|
14016
|
+
[closeStatus]
|
|
14017
|
+
);
|
|
14018
|
+
const handleSlashStatusOpen = useCallback28(() => {
|
|
14019
|
+
requestStatus({
|
|
14020
|
+
scopeKey: activeStatusScopeKey,
|
|
14021
|
+
agentSessionId: activeStatusSessionId,
|
|
14022
|
+
reason: "slash-status"
|
|
14023
|
+
});
|
|
14024
|
+
}, [activeStatusScopeKey, activeStatusSessionId, requestStatus]);
|
|
14025
|
+
const handleSlashStatusRefresh = useCallback28(() => {
|
|
14026
|
+
requestStatus({
|
|
14027
|
+
scopeKey: activeStatusScopeKey,
|
|
14028
|
+
agentSessionId: activeStatusSessionId,
|
|
14029
|
+
reason: "slash-status",
|
|
14030
|
+
forceRefresh: true
|
|
14031
|
+
});
|
|
14032
|
+
}, [activeStatusScopeKey, activeStatusSessionId, requestStatus]);
|
|
14033
|
+
const agentStatusLimits = useMemo19(
|
|
14034
|
+
() => slashStatusLimitsFromQuotas(
|
|
14035
|
+
activeAgentStatusSnapshot.value?.quotas,
|
|
14036
|
+
viewModel.composer.composerSettings.selectedModelValue ?? viewModel.composer.composerSettings.draftSettings.model,
|
|
14037
|
+
t
|
|
14038
|
+
),
|
|
14039
|
+
[
|
|
14040
|
+
activeAgentStatusSnapshot.value?.quotas,
|
|
14041
|
+
t,
|
|
14042
|
+
viewModel.composer.composerSettings.draftSettings.model,
|
|
14043
|
+
viewModel.composer.composerSettings.selectedModelValue
|
|
14044
|
+
]
|
|
14045
|
+
);
|
|
14046
|
+
const railAgentStatusLimits = useMemo19(
|
|
14047
|
+
() => slashStatusLimitsFromQuotas(
|
|
14048
|
+
railAgentStatusSnapshot.value?.quotas,
|
|
14049
|
+
null,
|
|
14050
|
+
t
|
|
14051
|
+
),
|
|
14052
|
+
[railAgentStatusSnapshot.value?.quotas, t]
|
|
14053
|
+
);
|
|
14054
|
+
const slashStatusOverride = useMemo19(() => {
|
|
14055
|
+
if (!agentStatusController) return null;
|
|
14056
|
+
const value = activeAgentStatusSnapshot.value;
|
|
14057
|
+
return {
|
|
14058
|
+
agentSessionId: value?.agentSessionId ?? activeStatusSessionId,
|
|
14059
|
+
contextWindow: value?.contextWindow ?? null,
|
|
14060
|
+
limits: agentStatusLimits,
|
|
14061
|
+
limitsLoading: activeAgentStatusSnapshot.phase === "loading" && value === null,
|
|
14062
|
+
limitsUnavailable: activeAgentStatusSnapshot.phase === "error" || value !== null && value.limitsState !== "available",
|
|
14063
|
+
limitsResolvedEmpty: value?.limitsState === "available" && agentStatusLimits.length === 0,
|
|
14064
|
+
limitsCapturedAtUnixMs: value?.limitsCapturedAtUnixMs ?? null,
|
|
14065
|
+
refreshFailed: activeAgentStatusSnapshot.errorCode !== null || value?.limitsState === "error",
|
|
14066
|
+
isRefreshing: activeAgentStatusSnapshot.isRefreshing
|
|
14067
|
+
};
|
|
14068
|
+
}, [
|
|
14069
|
+
activeAgentStatusSnapshot.errorCode,
|
|
14070
|
+
activeAgentStatusSnapshot.isRefreshing,
|
|
14071
|
+
activeAgentStatusSnapshot.phase,
|
|
14072
|
+
activeAgentStatusSnapshot.value,
|
|
14073
|
+
activeStatusSessionId,
|
|
14074
|
+
agentStatusController,
|
|
14075
|
+
agentStatusLimits
|
|
14076
|
+
]);
|
|
14077
|
+
const controllerRailStatus = agentStatusController ? {
|
|
14078
|
+
limits: railAgentStatusLimits,
|
|
14079
|
+
loading: railAgentStatusSnapshot.phase === "loading" && railAgentStatusSnapshot.value === null,
|
|
14080
|
+
capturedAtUnixMs: railAgentStatusSnapshot.value?.limitsCapturedAtUnixMs ?? null,
|
|
14081
|
+
didFail: railAgentStatusSnapshot.errorCode !== null || railAgentStatusSnapshot.value?.limitsState === "error",
|
|
14082
|
+
attempted: railAgentStatusSnapshot.value !== null || railAgentStatusSnapshot.errorCode !== null,
|
|
14083
|
+
resolvedEmpty: railAgentStatusSnapshot.value?.limitsState === "available" && railAgentStatusLimits.length === 0
|
|
14084
|
+
} : null;
|
|
14085
|
+
return {
|
|
14086
|
+
agentProbeLines,
|
|
14087
|
+
controllerRailStatus,
|
|
14088
|
+
handleAgentConfigMenuClose,
|
|
14089
|
+
handleAgentConfigMenuOpen,
|
|
14090
|
+
handleAgentProbeInfoClose,
|
|
14091
|
+
handleAgentProbeInfoOpen,
|
|
14092
|
+
handleAgentUsageRefresh,
|
|
14093
|
+
handleSlashStatusClose,
|
|
14094
|
+
handleSlashStatusOpen,
|
|
14095
|
+
handleSlashStatusRefresh,
|
|
14096
|
+
railStatusProvider,
|
|
14097
|
+
slashStatusLimits: agentStatusLimits,
|
|
14098
|
+
slashStatusLimitsUnavailable: activeAgentStatusSnapshot.phase === "error" || activeAgentStatusSnapshot.value !== null && activeAgentStatusSnapshot.value.limitsState !== "available",
|
|
14099
|
+
slashStatusOverride
|
|
14100
|
+
};
|
|
14101
|
+
}
|
|
14102
|
+
|
|
13353
14103
|
// agent-gui/agentGuiNode/AgentGUINodeView.tsx
|
|
13354
14104
|
import {
|
|
13355
|
-
useCallback as
|
|
14105
|
+
useCallback as useCallback62,
|
|
13356
14106
|
useEffect as useEffect38,
|
|
13357
|
-
useMemo as
|
|
14107
|
+
useMemo as useMemo44,
|
|
13358
14108
|
useRef as useRef55,
|
|
13359
14109
|
useState as useState44
|
|
13360
14110
|
} from "react";
|
|
@@ -13571,7 +14321,7 @@ var styles = {
|
|
|
13571
14321
|
var AgentGUINode_styles_default = styles;
|
|
13572
14322
|
|
|
13573
14323
|
// agent-gui/agentGuiNode/view/agentGUIViewUtils.ts
|
|
13574
|
-
import { useCallback as
|
|
14324
|
+
import { useCallback as useCallback29, useLayoutEffect, useMemo as useMemo20, useRef as useRef21 } from "react";
|
|
13575
14325
|
function objectRecord(value) {
|
|
13576
14326
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
13577
14327
|
}
|
|
@@ -13593,14 +14343,14 @@ function useStableEventCallback(callback) {
|
|
|
13593
14343
|
useLayoutEffect(() => {
|
|
13594
14344
|
callbackRef.current = callback;
|
|
13595
14345
|
}, [callback]);
|
|
13596
|
-
return
|
|
14346
|
+
return useCallback29((...args) => callbackRef.current(...args), []);
|
|
13597
14347
|
}
|
|
13598
14348
|
function useOptionalStableEventCallback(callback) {
|
|
13599
14349
|
const callbackRef = useRef21(callback);
|
|
13600
14350
|
useLayoutEffect(() => {
|
|
13601
14351
|
callbackRef.current = callback;
|
|
13602
14352
|
}, [callback]);
|
|
13603
|
-
return
|
|
14353
|
+
return useMemo20(() => {
|
|
13604
14354
|
if (callback == null) {
|
|
13605
14355
|
return void 0;
|
|
13606
14356
|
}
|
|
@@ -13627,7 +14377,7 @@ function conversationPlainTitle(conversation, labels, uiLanguage) {
|
|
|
13627
14377
|
}
|
|
13628
14378
|
|
|
13629
14379
|
// agent-gui/agentGuiNode/view/AgentGUIAccountConfig.tsx
|
|
13630
|
-
import { memo, useCallback as
|
|
14380
|
+
import { memo, useCallback as useCallback30, useEffect as useEffect15, useState as useState9 } from "react";
|
|
13631
14381
|
import {
|
|
13632
14382
|
Coins,
|
|
13633
14383
|
Crown as Crown2,
|
|
@@ -13898,7 +14648,7 @@ var AgentGUIAccountRailMenu = memo(function AgentGUIAccountRailMenu2({
|
|
|
13898
14648
|
const membershipLabel = accountMenuState.membershipLabel.trim() || labels.accountMenuFree;
|
|
13899
14649
|
const creditsLabel = accountMenuState.loading && !accountMenuState.creditsLabel ? labels.accountMenuLoading : accountMenuState.creditsLabel ?? labels.accountMenuUnavailable;
|
|
13900
14650
|
const errorLabel = accountMenuState.error || (accountMenuState.partialError ? labels.accountMenuDataUnavailable : null);
|
|
13901
|
-
const openExternal =
|
|
14651
|
+
const openExternal = useCallback30(
|
|
13902
14652
|
(url) => {
|
|
13903
14653
|
accountMenuState.onOpenExternal(url);
|
|
13904
14654
|
},
|
|
@@ -14096,12 +14846,14 @@ function AgentGUIConfigMenu({
|
|
|
14096
14846
|
providerScopedActionsVisible,
|
|
14097
14847
|
slashStatusLimits,
|
|
14098
14848
|
slashStatusLimitsLoading,
|
|
14849
|
+
slashStatusLimitsResolvedEmpty,
|
|
14099
14850
|
slashStatusUsageCapturedAtUnixMs,
|
|
14100
14851
|
slashStatusUsageDidFail,
|
|
14101
14852
|
slashStatusUsageAttempted,
|
|
14102
14853
|
provider,
|
|
14103
14854
|
providerAuthAccountLabel,
|
|
14104
14855
|
onAgentConfigMenuOpen,
|
|
14856
|
+
onAgentConfigMenuClose,
|
|
14105
14857
|
onAgentUsageRefresh,
|
|
14106
14858
|
onOpenAgentEnvSetup,
|
|
14107
14859
|
onOpenAgentSettings
|
|
@@ -14118,6 +14870,8 @@ function AgentGUIConfigMenu({
|
|
|
14118
14870
|
setOpen(nextOpen);
|
|
14119
14871
|
if (nextOpen) {
|
|
14120
14872
|
onAgentConfigMenuOpen?.();
|
|
14873
|
+
} else {
|
|
14874
|
+
onAgentConfigMenuClose?.();
|
|
14121
14875
|
}
|
|
14122
14876
|
},
|
|
14123
14877
|
children: [
|
|
@@ -14179,7 +14933,7 @@ function AgentGUIConfigMenu({
|
|
|
14179
14933
|
{
|
|
14180
14934
|
className: "min-w-0 truncate text-[var(--text-tertiary)]",
|
|
14181
14935
|
"data-testid": "agent-gui-config-usage-unavailable",
|
|
14182
|
-
children: labels.slashStatusLimitsUnavailable
|
|
14936
|
+
children: slashStatusLimitsResolvedEmpty ? labels.slashStatusEmptyValue : labels.slashStatusLimitsUnavailable
|
|
14183
14937
|
}
|
|
14184
14938
|
) : null
|
|
14185
14939
|
] }),
|
|
@@ -14256,8 +15010,8 @@ function AgentGUIConfigMenu({
|
|
|
14256
15010
|
// agent-gui/agentGuiNode/view/AgentGUIProviderRail.tsx
|
|
14257
15011
|
import {
|
|
14258
15012
|
memo as memo4,
|
|
14259
|
-
useCallback as
|
|
14260
|
-
useMemo as
|
|
15013
|
+
useCallback as useCallback47,
|
|
15014
|
+
useMemo as useMemo35,
|
|
14261
15015
|
useRef as useRef42,
|
|
14262
15016
|
useState as useState30
|
|
14263
15017
|
} from "react";
|
|
@@ -14482,7 +15236,7 @@ function changeAgentGUIProviderManagerVisibility(input) {
|
|
|
14482
15236
|
}
|
|
14483
15237
|
|
|
14484
15238
|
// agent-gui/agentGuiNode/view/AgentGUIEmptyState.tsx
|
|
14485
|
-
import { memo as memo3, useMemo as
|
|
15239
|
+
import { memo as memo3, useMemo as useMemo34 } from "react";
|
|
14486
15240
|
import {
|
|
14487
15241
|
Select as Select5,
|
|
14488
15242
|
SelectContent as SelectContent5,
|
|
@@ -15830,7 +16584,7 @@ import { Button as Button2 } from "@tutti-os/ui-system";
|
|
|
15830
16584
|
// app/renderer/components/icons/CastIcon.tsx
|
|
15831
16585
|
import {
|
|
15832
16586
|
forwardRef as forwardRef2,
|
|
15833
|
-
useCallback as
|
|
16587
|
+
useCallback as useCallback31,
|
|
15834
16588
|
useEffect as useEffect16,
|
|
15835
16589
|
useImperativeHandle,
|
|
15836
16590
|
useRef as useRef22
|
|
@@ -15865,13 +16619,13 @@ var CastIcon = forwardRef2(
|
|
|
15865
16619
|
const controls = useAnimation();
|
|
15866
16620
|
const reduceMotion = useReducedMotion();
|
|
15867
16621
|
const isControlledRef = useRef22(false);
|
|
15868
|
-
const startAnimation =
|
|
16622
|
+
const startAnimation = useCallback31(() => {
|
|
15869
16623
|
if (reduceMotion) {
|
|
15870
16624
|
return;
|
|
15871
16625
|
}
|
|
15872
16626
|
void controls.start("animate");
|
|
15873
16627
|
}, [controls, reduceMotion]);
|
|
15874
|
-
const stopAnimation =
|
|
16628
|
+
const stopAnimation = useCallback31(() => {
|
|
15875
16629
|
void controls.start("normal");
|
|
15876
16630
|
}, [controls]);
|
|
15877
16631
|
useImperativeHandle(ref, () => {
|
|
@@ -15888,7 +16642,7 @@ var CastIcon = forwardRef2(
|
|
|
15888
16642
|
}
|
|
15889
16643
|
stopAnimation();
|
|
15890
16644
|
}, [active, startAnimation, stopAnimation]);
|
|
15891
|
-
const handleMouseEnter =
|
|
16645
|
+
const handleMouseEnter = useCallback31(
|
|
15892
16646
|
(event) => {
|
|
15893
16647
|
if (isControlledRef.current) {
|
|
15894
16648
|
onMouseEnter?.(event);
|
|
@@ -15898,7 +16652,7 @@ var CastIcon = forwardRef2(
|
|
|
15898
16652
|
},
|
|
15899
16653
|
[onMouseEnter, startAnimation]
|
|
15900
16654
|
);
|
|
15901
|
-
const handleMouseLeave =
|
|
16655
|
+
const handleMouseLeave = useCallback31(
|
|
15902
16656
|
(event) => {
|
|
15903
16657
|
if (isControlledRef.current) {
|
|
15904
16658
|
onMouseLeave?.(event);
|
|
@@ -16184,7 +16938,7 @@ function AgentSessionChrome({
|
|
|
16184
16938
|
}
|
|
16185
16939
|
|
|
16186
16940
|
// agent-gui/agentGuiNode/AgentComposer.tsx
|
|
16187
|
-
import { useCallback as
|
|
16941
|
+
import { useCallback as useCallback44, useEffect as useEffect28, useRef as useRef39, useState as useState26 } from "react";
|
|
16188
16942
|
import { repairMentionPaletteHighlight } from "@tutti-os/ui-rich-text/at-panel";
|
|
16189
16943
|
|
|
16190
16944
|
// agent-gui/agentGuiNode/AgentSlashStatusPanel.tsx
|
|
@@ -16217,11 +16971,11 @@ function slashStatusContextText(status, labels) {
|
|
|
16217
16971
|
function AgentSlashStatusPanel({
|
|
16218
16972
|
status,
|
|
16219
16973
|
labels,
|
|
16220
|
-
onClose
|
|
16974
|
+
onClose,
|
|
16975
|
+
onRefresh
|
|
16221
16976
|
}) {
|
|
16222
16977
|
const limits = status?.limits ?? [];
|
|
16223
16978
|
const agentSessionId = status?.agentSessionId?.trim() ?? "";
|
|
16224
|
-
const baseUrl = status?.baseUrl?.trim() ?? "";
|
|
16225
16979
|
const showSessionDetails = agentSessionId.length > 0;
|
|
16226
16980
|
return /* @__PURE__ */ jsxs13(
|
|
16227
16981
|
"section",
|
|
@@ -16232,15 +16986,35 @@ function AgentSlashStatusPanel({
|
|
|
16232
16986
|
children: [
|
|
16233
16987
|
/* @__PURE__ */ jsxs13("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
16234
16988
|
/* @__PURE__ */ jsx20("h3", { className: "truncate text-[11px] font-semibold leading-4", children: labels.slashStatusTitle }),
|
|
16235
|
-
/* @__PURE__ */
|
|
16236
|
-
|
|
16237
|
-
|
|
16238
|
-
|
|
16239
|
-
|
|
16240
|
-
|
|
16241
|
-
|
|
16242
|
-
|
|
16243
|
-
|
|
16989
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
16990
|
+
onRefresh ? /* @__PURE__ */ jsx20(
|
|
16991
|
+
AgentProbeUsageFreshness,
|
|
16992
|
+
{
|
|
16993
|
+
capturedAtUnixMs: status?.limitsCapturedAtUnixMs ?? null,
|
|
16994
|
+
isLoading: status?.isRefreshing === true,
|
|
16995
|
+
didFail: status?.refreshFailed === true,
|
|
16996
|
+
onRefresh,
|
|
16997
|
+
labels: {
|
|
16998
|
+
justUpdated: labels.slashStatusUsageJustUpdated,
|
|
16999
|
+
minutesAgo: labels.slashStatusUsageMinutesAgo,
|
|
17000
|
+
hoursAgo: labels.slashStatusUsageHoursAgo,
|
|
17001
|
+
updating: labels.slashStatusUsageUpdating,
|
|
17002
|
+
refreshFailed: labels.slashStatusUsageRefreshFailed,
|
|
17003
|
+
refreshAria: labels.slashStatusUsageRefreshAria
|
|
17004
|
+
},
|
|
17005
|
+
testId: "agent-gui-slash-status-refresh"
|
|
17006
|
+
}
|
|
17007
|
+
) : null,
|
|
17008
|
+
/* @__PURE__ */ jsx20(
|
|
17009
|
+
"button",
|
|
17010
|
+
{
|
|
17011
|
+
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]",
|
|
17012
|
+
type: "button",
|
|
17013
|
+
onClick: onClose,
|
|
17014
|
+
children: labels.slashStatusClose
|
|
17015
|
+
}
|
|
17016
|
+
)
|
|
17017
|
+
] })
|
|
16244
17018
|
] }),
|
|
16245
17019
|
/* @__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
17020
|
showSessionDetails ? /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
@@ -16248,20 +17022,13 @@ function AgentSlashStatusPanel({
|
|
|
16248
17022
|
labels.slashStatusSession,
|
|
16249
17023
|
":"
|
|
16250
17024
|
] }),
|
|
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) })
|
|
17025
|
+
/* @__PURE__ */ jsx20("dd", { className: "min-w-0 truncate", children: agentSessionId })
|
|
16264
17026
|
] }) : null,
|
|
17027
|
+
/* @__PURE__ */ jsxs13("dt", { className: "text-muted-foreground", children: [
|
|
17028
|
+
labels.slashStatusContext,
|
|
17029
|
+
":"
|
|
17030
|
+
] }),
|
|
17031
|
+
/* @__PURE__ */ jsx20("dd", { className: "min-w-0", children: slashStatusContextText(status, labels) }),
|
|
16265
17032
|
limits.map((limit) => /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
16266
17033
|
/* @__PURE__ */ jsxs13("dt", { className: "text-muted-foreground", children: [
|
|
16267
17034
|
limit.label,
|
|
@@ -16298,12 +17065,12 @@ function AgentSlashStatusPanel({
|
|
|
16298
17065
|
] })
|
|
16299
17066
|
] }) })
|
|
16300
17067
|
] }, limit.id)),
|
|
16301
|
-
limits.length === 0 && status?.limitsUnavailable ? /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
17068
|
+
limits.length === 0 && (status?.limitsUnavailable || status?.limitsResolvedEmpty || status?.limitsLoading) ? /* @__PURE__ */ jsxs13(Fragment5, { children: [
|
|
16302
17069
|
/* @__PURE__ */ jsxs13("dt", { className: "text-muted-foreground", children: [
|
|
16303
17070
|
labels.slashStatusLimits,
|
|
16304
17071
|
":"
|
|
16305
17072
|
] }),
|
|
16306
|
-
/* @__PURE__ */ jsx20("dd", { className: "min-w-0 text-muted-foreground", children: labels.slashStatusLimitsUnavailable })
|
|
17073
|
+
/* @__PURE__ */ jsx20("dd", { className: "min-w-0 text-muted-foreground", children: status?.limitsLoading ? labels.slashStatusUsageUpdating : status?.limitsResolvedEmpty ? labels.slashStatusEmptyValue : labels.slashStatusLimitsUnavailable })
|
|
16307
17074
|
] }) : null
|
|
16308
17075
|
] })
|
|
16309
17076
|
]
|
|
@@ -16314,7 +17081,7 @@ function AgentSlashStatusPanel({
|
|
|
16314
17081
|
// agent-gui/agentGuiNode/composer/useComposerDraftAttachments.ts
|
|
16315
17082
|
import { flushSync as flushSync3 } from "react-dom";
|
|
16316
17083
|
import {
|
|
16317
|
-
useCallback as
|
|
17084
|
+
useCallback as useCallback32,
|
|
16318
17085
|
useRef as useRef23
|
|
16319
17086
|
} from "react";
|
|
16320
17087
|
|
|
@@ -16397,7 +17164,7 @@ function agentComposerDevConsoleDiagnosticSinkEnabled(runtime) {
|
|
|
16397
17164
|
function useStableEventCallback2(callback) {
|
|
16398
17165
|
const callbackRef = useRef23(callback);
|
|
16399
17166
|
callbackRef.current = callback;
|
|
16400
|
-
return
|
|
17167
|
+
return useCallback32((...args) => callbackRef.current(...args), []);
|
|
16401
17168
|
}
|
|
16402
17169
|
function useComposerDraftAttachments({
|
|
16403
17170
|
workspaceId,
|
|
@@ -16495,7 +17262,7 @@ function useComposerDraftAttachments({
|
|
|
16495
17262
|
);
|
|
16496
17263
|
}
|
|
16497
17264
|
);
|
|
16498
|
-
const clearGoalModeBadge =
|
|
17265
|
+
const clearGoalModeBadge = useCallback32(() => {
|
|
16499
17266
|
if (!isGoalModeActive) {
|
|
16500
17267
|
return;
|
|
16501
17268
|
}
|
|
@@ -16507,7 +17274,7 @@ function useComposerDraftAttachments({
|
|
|
16507
17274
|
(currentDraft) => updateDraftPromptAndReconcileFiles(currentDraft, nextPrompt)
|
|
16508
17275
|
);
|
|
16509
17276
|
}, [draftScopeKey, goalDraftObjective, isGoalModeActive, updateScopedDraft]);
|
|
16510
|
-
const addDraftImages =
|
|
17277
|
+
const addDraftImages = useCallback32(
|
|
16511
17278
|
(images) => {
|
|
16512
17279
|
if (images.length === 0) {
|
|
16513
17280
|
return;
|
|
@@ -16660,7 +17427,7 @@ function useComposerDraftAttachments({
|
|
|
16660
17427
|
workspaceId
|
|
16661
17428
|
]
|
|
16662
17429
|
);
|
|
16663
|
-
const removeDraftImage =
|
|
17430
|
+
const removeDraftImage = useCallback32(
|
|
16664
17431
|
(id) => {
|
|
16665
17432
|
const nextDraftImages = draftImagesRef.current.filter(
|
|
16666
17433
|
(image) => image.id !== id
|
|
@@ -16678,7 +17445,7 @@ function useComposerDraftAttachments({
|
|
|
16678
17445
|
},
|
|
16679
17446
|
[draftScopeKey, publishScopedDraft]
|
|
16680
17447
|
);
|
|
16681
|
-
const addDraftFiles =
|
|
17448
|
+
const addDraftFiles = useCallback32(
|
|
16682
17449
|
(files) => {
|
|
16683
17450
|
if (files.length === 0 || !promptFilesSupported || !prepareExternalPromptFiles || !editorHandleRef.current) {
|
|
16684
17451
|
return;
|
|
@@ -16806,7 +17573,7 @@ function useComposerDraftAttachments({
|
|
|
16806
17573
|
workspaceId
|
|
16807
17574
|
]
|
|
16808
17575
|
);
|
|
16809
|
-
const removeDraftLargeText =
|
|
17576
|
+
const removeDraftLargeText = useCallback32(
|
|
16810
17577
|
(id) => {
|
|
16811
17578
|
const nextDraftLargeTexts = draftLargeTextsRef.current.filter(
|
|
16812
17579
|
(item) => item.id !== id
|
|
@@ -16824,7 +17591,7 @@ function useComposerDraftAttachments({
|
|
|
16824
17591
|
},
|
|
16825
17592
|
[draftScopeKey, publishScopedDraft]
|
|
16826
17593
|
);
|
|
16827
|
-
const expandDraftLargeTextToPrompt =
|
|
17594
|
+
const expandDraftLargeTextToPrompt = useCallback32(
|
|
16828
17595
|
(id) => {
|
|
16829
17596
|
const item = draftLargeTextsRef.current.find((entry) => entry.id === id);
|
|
16830
17597
|
if (!item || !item.text.trim()) {
|
|
@@ -16854,7 +17621,7 @@ ${item.text}` : item.text;
|
|
|
16854
17621
|
},
|
|
16855
17622
|
[draftScopeKey, publishScopedDraft]
|
|
16856
17623
|
);
|
|
16857
|
-
const handlePastedLargeText =
|
|
17624
|
+
const handlePastedLargeText = useCallback32(
|
|
16858
17625
|
(text) => {
|
|
16859
17626
|
const normalizedText = text.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
16860
17627
|
if (!normalizedText.trim()) {
|
|
@@ -16945,7 +17712,7 @@ ${item.text}` : item.text;
|
|
|
16945
17712
|
workspaceId
|
|
16946
17713
|
]
|
|
16947
17714
|
);
|
|
16948
|
-
const applyReferencePickResult =
|
|
17715
|
+
const applyReferencePickResult = useCallback32(
|
|
16949
17716
|
async (result) => {
|
|
16950
17717
|
if (result.files.length > 0) {
|
|
16951
17718
|
editorHandleRef.current?.insertWorkspaceReferences(result.files);
|
|
@@ -16956,13 +17723,13 @@ ${item.text}` : item.text;
|
|
|
16956
17723
|
},
|
|
16957
17724
|
[]
|
|
16958
17725
|
);
|
|
16959
|
-
const handleWorkspaceReferencePicker =
|
|
17726
|
+
const handleWorkspaceReferencePicker = useCallback32(async () => {
|
|
16960
17727
|
if (!onRequestWorkspaceReferences) {
|
|
16961
17728
|
return;
|
|
16962
17729
|
}
|
|
16963
17730
|
await applyReferencePickResult(await onRequestWorkspaceReferences());
|
|
16964
17731
|
}, [applyReferencePickResult, onRequestWorkspaceReferences]);
|
|
16965
|
-
const handleOpenReferencesForEntity =
|
|
17732
|
+
const handleOpenReferencesForEntity = useCallback32(
|
|
16966
17733
|
(entity) => {
|
|
16967
17734
|
if (!onRequestWorkspaceReferences) {
|
|
16968
17735
|
return;
|
|
@@ -16982,7 +17749,7 @@ ${item.text}` : item.text;
|
|
|
16982
17749
|
);
|
|
16983
17750
|
openReferencesForEntityRef.current = handleOpenReferencesForEntity;
|
|
16984
17751
|
openReferencesForEntityRef.current = handleOpenReferencesForEntity;
|
|
16985
|
-
const handleLinkClick =
|
|
17752
|
+
const handleLinkClick = useCallback32(
|
|
16986
17753
|
(href) => {
|
|
16987
17754
|
const item = parseMentionItemFromHref({ name: "", href });
|
|
16988
17755
|
if (item?.kind === "workspace-reference") {
|
|
@@ -17018,7 +17785,7 @@ ${item.text}` : item.text;
|
|
|
17018
17785
|
// agent-gui/agentGuiNode/composer/useComposerLayout.ts
|
|
17019
17786
|
import {
|
|
17020
17787
|
useLayoutEffect as useLayoutEffect2,
|
|
17021
|
-
useMemo as
|
|
17788
|
+
useMemo as useMemo21
|
|
17022
17789
|
} from "react";
|
|
17023
17790
|
var DOCK_COMPOSER_INPUT_MIN_HEIGHT = 56;
|
|
17024
17791
|
var DOCK_COMPOSER_TEXT_LINE_HEIGHT = 24;
|
|
@@ -17221,7 +17988,7 @@ function useComposerLayout({
|
|
|
17221
17988
|
resizeObserver?.disconnect();
|
|
17222
17989
|
};
|
|
17223
17990
|
}, [draftImages.length, draftLargeTexts.length, isHeroLayout]);
|
|
17224
|
-
const composerStyle =
|
|
17991
|
+
const composerStyle = useMemo21(
|
|
17225
17992
|
() => isHeroLayout ? void 0 : {
|
|
17226
17993
|
// The dock keeps only the collapsed 56px input row in flow; a
|
|
17227
17994
|
// growing draft overhangs upward past the composer's top edge.
|
|
@@ -17235,11 +18002,11 @@ function useComposerLayout({
|
|
|
17235
18002
|
},
|
|
17236
18003
|
[dockComposerInputHeight, isHeroLayout]
|
|
17237
18004
|
);
|
|
17238
|
-
const inputShellStyle =
|
|
18005
|
+
const inputShellStyle = useMemo21(
|
|
17239
18006
|
() => showFileMentionPalette || showFloatingCommandMenu ? { zIndex: COMPOSER_PALETTE_Z_INDEX } : void 0,
|
|
17240
18007
|
[showFileMentionPalette, showFloatingCommandMenu]
|
|
17241
18008
|
);
|
|
17242
|
-
const promptInputAreaStyle =
|
|
18009
|
+
const promptInputAreaStyle = useMemo21(
|
|
17243
18010
|
() => isHeroLayout ? void 0 : {
|
|
17244
18011
|
"--agent-gui-composer-attachment-height": `${dockComposerAttachmentHeight}px`,
|
|
17245
18012
|
"--agent-gui-composer-input-height": `${dockComposerInputHeight}px`,
|
|
@@ -17273,7 +18040,7 @@ function useComposerLayout({
|
|
|
17273
18040
|
}
|
|
17274
18041
|
|
|
17275
18042
|
// agent-gui/agentGuiNode/composer/useComposerPaletteCatalog.ts
|
|
17276
|
-
import { useMemo as
|
|
18043
|
+
import { useMemo as useMemo22 } from "react";
|
|
17277
18044
|
|
|
17278
18045
|
// agent-gui/agentGuiNode/composer/slashCommandDisplay.ts
|
|
17279
18046
|
function slashCommandDescriptionForDisplay(command, labels) {
|
|
@@ -17354,7 +18121,7 @@ function useComposerPaletteCatalog({
|
|
|
17354
18121
|
const promptBeforeSelection = editorHandleRef.current?.getPromptTextBeforeSelection() ?? "";
|
|
17355
18122
|
const skillQueryDraft = promptBeforeSelection || paletteDraftPrompt;
|
|
17356
18123
|
const skillQueryMatch = getAgentComposerTriggerQueryMatch(skillQueryDraft);
|
|
17357
|
-
const resolvedSlashCommands =
|
|
18124
|
+
const resolvedSlashCommands = useMemo22(
|
|
17358
18125
|
() => resolveSlashCommandsForProvider({
|
|
17359
18126
|
provider,
|
|
17360
18127
|
policy: slashCommandPolicy,
|
|
@@ -17379,11 +18146,11 @@ function useComposerPaletteCatalog({
|
|
|
17379
18146
|
slashCommandPolicy
|
|
17380
18147
|
]
|
|
17381
18148
|
);
|
|
17382
|
-
const filteredCommands =
|
|
18149
|
+
const filteredCommands = useMemo22(
|
|
17383
18150
|
() => slashQuery === null ? [] : filterSlashCommands(resolvedSlashCommands, slashQuery),
|
|
17384
18151
|
[resolvedSlashCommands, slashQuery]
|
|
17385
18152
|
);
|
|
17386
|
-
const filteredSkills =
|
|
18153
|
+
const filteredSkills = useMemo22(
|
|
17387
18154
|
() => skillQueryMatch === null ? [] : filterProviderSkillsForTrigger({
|
|
17388
18155
|
skills: availableSkills,
|
|
17389
18156
|
query: skillQueryMatch.query,
|
|
@@ -17391,7 +18158,7 @@ function useComposerPaletteCatalog({
|
|
|
17391
18158
|
}),
|
|
17392
18159
|
[availableSkills, skillQueryMatch]
|
|
17393
18160
|
);
|
|
17394
|
-
const availableCapabilities =
|
|
18161
|
+
const availableCapabilities = useMemo22(() => {
|
|
17395
18162
|
const entries = [];
|
|
17396
18163
|
if (composerSettings.supportsBrowser) {
|
|
17397
18164
|
entries.push({
|
|
@@ -17416,7 +18183,7 @@ function useComposerPaletteCatalog({
|
|
|
17416
18183
|
labels.browserUseCapabilityLabel,
|
|
17417
18184
|
labels.computerUseCapabilityLabel
|
|
17418
18185
|
]);
|
|
17419
|
-
const slashPaletteEntries =
|
|
18186
|
+
const slashPaletteEntries = useMemo22(() => {
|
|
17420
18187
|
const commandEntries = filteredCommands.flatMap((command) => {
|
|
17421
18188
|
if (isSlashCommandCapability(command)) {
|
|
17422
18189
|
const browserConnectionMode = capabilityMenuState?.browserUse?.connectionMode ?? null;
|
|
@@ -17517,15 +18284,15 @@ function useComposerPaletteCatalog({
|
|
|
17517
18284
|
|
|
17518
18285
|
// agent-gui/agentGuiNode/composer/useMentionPaletteFrame.ts
|
|
17519
18286
|
import {
|
|
17520
|
-
useCallback as
|
|
18287
|
+
useCallback as useCallback34,
|
|
17521
18288
|
useLayoutEffect as useLayoutEffect3,
|
|
17522
|
-
useMemo as
|
|
18289
|
+
useMemo as useMemo23,
|
|
17523
18290
|
useState as useState11
|
|
17524
18291
|
} from "react";
|
|
17525
18292
|
|
|
17526
18293
|
// agent-gui/agentGuiNode/composer/AgentComposerChrome.tsx
|
|
17527
18294
|
import {
|
|
17528
|
-
useCallback as
|
|
18295
|
+
useCallback as useCallback33,
|
|
17529
18296
|
useEffect as useEffect17,
|
|
17530
18297
|
useRef as useRef24,
|
|
17531
18298
|
useState as useState10
|
|
@@ -17584,24 +18351,24 @@ function AgentUsageChip({
|
|
|
17584
18351
|
const usageLevel = agentUsageChipLevel(clampedPercent);
|
|
17585
18352
|
const ringColor = agentUsageRingColor(usageLevel);
|
|
17586
18353
|
const usagePopoverCloseTimerRef = useRef24(null);
|
|
17587
|
-
const clearUsagePopoverHoverTimer =
|
|
18354
|
+
const clearUsagePopoverHoverTimer = useCallback33(() => {
|
|
17588
18355
|
if (usagePopoverHoverTimerRef.current) {
|
|
17589
18356
|
clearTimeout(usagePopoverHoverTimerRef.current);
|
|
17590
18357
|
usagePopoverHoverTimerRef.current = null;
|
|
17591
18358
|
}
|
|
17592
18359
|
}, []);
|
|
17593
|
-
const clearUsagePopoverCloseTimer =
|
|
18360
|
+
const clearUsagePopoverCloseTimer = useCallback33(() => {
|
|
17594
18361
|
if (usagePopoverCloseTimerRef.current) {
|
|
17595
18362
|
clearTimeout(usagePopoverCloseTimerRef.current);
|
|
17596
18363
|
usagePopoverCloseTimerRef.current = null;
|
|
17597
18364
|
}
|
|
17598
18365
|
}, []);
|
|
17599
|
-
const openUsagePopover =
|
|
18366
|
+
const openUsagePopover = useCallback33(() => {
|
|
17600
18367
|
clearUsagePopoverHoverTimer();
|
|
17601
18368
|
clearUsagePopoverCloseTimer();
|
|
17602
18369
|
setUsagePopoverOpen(true);
|
|
17603
18370
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
17604
|
-
const openUsagePopoverAfterHoverDelay =
|
|
18371
|
+
const openUsagePopoverAfterHoverDelay = useCallback33(() => {
|
|
17605
18372
|
clearUsagePopoverHoverTimer();
|
|
17606
18373
|
clearUsagePopoverCloseTimer();
|
|
17607
18374
|
usagePopoverHoverTimerRef.current = setTimeout(() => {
|
|
@@ -17609,12 +18376,12 @@ function AgentUsageChip({
|
|
|
17609
18376
|
setUsagePopoverOpen(true);
|
|
17610
18377
|
}, USAGE_POPOVER_HOVER_DELAY_MS);
|
|
17611
18378
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
17612
|
-
const closeUsagePopover =
|
|
18379
|
+
const closeUsagePopover = useCallback33(() => {
|
|
17613
18380
|
clearUsagePopoverHoverTimer();
|
|
17614
18381
|
clearUsagePopoverCloseTimer();
|
|
17615
18382
|
setUsagePopoverOpen(false);
|
|
17616
18383
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
17617
|
-
const scheduleUsagePopoverClose =
|
|
18384
|
+
const scheduleUsagePopoverClose = useCallback33(() => {
|
|
17618
18385
|
clearUsagePopoverHoverTimer();
|
|
17619
18386
|
clearUsagePopoverCloseTimer();
|
|
17620
18387
|
usagePopoverCloseTimerRef.current = setTimeout(() => {
|
|
@@ -17622,7 +18389,7 @@ function AgentUsageChip({
|
|
|
17622
18389
|
setUsagePopoverOpen(false);
|
|
17623
18390
|
}, 140);
|
|
17624
18391
|
}, [clearUsagePopoverCloseTimer, clearUsagePopoverHoverTimer]);
|
|
17625
|
-
const handleUsagePopoverOpenChange =
|
|
18392
|
+
const handleUsagePopoverOpenChange = useCallback33(
|
|
17626
18393
|
(open) => {
|
|
17627
18394
|
if (open) {
|
|
17628
18395
|
openUsagePopover();
|
|
@@ -17632,7 +18399,7 @@ function AgentUsageChip({
|
|
|
17632
18399
|
},
|
|
17633
18400
|
[closeUsagePopover, openUsagePopover]
|
|
17634
18401
|
);
|
|
17635
|
-
const handleUsageTriggerBlur =
|
|
18402
|
+
const handleUsageTriggerBlur = useCallback33(
|
|
17636
18403
|
(event) => {
|
|
17637
18404
|
const nextFocusTarget = event.relatedTarget;
|
|
17638
18405
|
if (nextFocusTarget instanceof Node && usagePopoverContentRef.current?.contains(nextFocusTarget)) {
|
|
@@ -17881,7 +18648,7 @@ function AgentComposerHandoffIcon({
|
|
|
17881
18648
|
// agent-gui/agentGuiNode/composer/useMentionPaletteFrame.ts
|
|
17882
18649
|
function useMentionPaletteFrame(inputShellRef, showFileMentionPalette) {
|
|
17883
18650
|
const [mentionPaletteFrame, setMentionPaletteFrame] = useState11(null);
|
|
17884
|
-
const syncMentionPaletteFrame =
|
|
18651
|
+
const syncMentionPaletteFrame = useCallback34(() => {
|
|
17885
18652
|
const anchor = inputShellRef.current;
|
|
17886
18653
|
if (!anchor || typeof window === "undefined") {
|
|
17887
18654
|
setMentionPaletteFrame(null);
|
|
@@ -17943,7 +18710,7 @@ function useMentionPaletteFrame(inputShellRef, showFileMentionPalette) {
|
|
|
17943
18710
|
window.removeEventListener("scroll", syncMentionPaletteFrame, true);
|
|
17944
18711
|
};
|
|
17945
18712
|
}, [showFileMentionPalette, syncMentionPaletteFrame]);
|
|
17946
|
-
const mentionPaletteStyle =
|
|
18713
|
+
const mentionPaletteStyle = useMemo23(
|
|
17947
18714
|
() => ({
|
|
17948
18715
|
position: "fixed",
|
|
17949
18716
|
left: `${mentionPaletteFrame?.left ?? 0}px`,
|
|
@@ -17963,14 +18730,14 @@ function useMentionPaletteFrame(inputShellRef, showFileMentionPalette) {
|
|
|
17963
18730
|
|
|
17964
18731
|
// agent-gui/agentGuiNode/composer/useComposerSlashActions.ts
|
|
17965
18732
|
import {
|
|
17966
|
-
useCallback as
|
|
17967
|
-
useMemo as
|
|
18733
|
+
useCallback as useCallback35,
|
|
18734
|
+
useMemo as useMemo24,
|
|
17968
18735
|
useRef as useRef25
|
|
17969
18736
|
} from "react";
|
|
17970
18737
|
function useStableEventCallback3(callback) {
|
|
17971
18738
|
const callbackRef = useRef25(callback);
|
|
17972
18739
|
callbackRef.current = callback;
|
|
17973
|
-
return
|
|
18740
|
+
return useCallback35((...args) => callbackRef.current(...args), []);
|
|
17974
18741
|
}
|
|
17975
18742
|
function useComposerSlashActions(input) {
|
|
17976
18743
|
const agentActivityRuntime = useOptionalAgentActivityRuntime();
|
|
@@ -17992,6 +18759,7 @@ function useComposerSlashActions(input) {
|
|
|
17992
18759
|
onSubmitGuidance,
|
|
17993
18760
|
onCapabilitySettingsRequest,
|
|
17994
18761
|
onSlashStatusOpen,
|
|
18762
|
+
onSlashStatusClose,
|
|
17995
18763
|
onPromptImagesUnsupported,
|
|
17996
18764
|
onRequestGitBranches,
|
|
17997
18765
|
draftContent,
|
|
@@ -18018,15 +18786,16 @@ function useComposerSlashActions(input) {
|
|
|
18018
18786
|
setIsSlashStatusPanelOpen,
|
|
18019
18787
|
setHighlightedIndex
|
|
18020
18788
|
} = input;
|
|
18021
|
-
const clearSlashCommandDraft =
|
|
18789
|
+
const clearSlashCommandDraft = useCallback35(() => {
|
|
18022
18790
|
draftPromptRef.current = "";
|
|
18023
18791
|
setPaletteDraftPrompt("");
|
|
18024
18792
|
setIsPaletteOpen(false);
|
|
18025
18793
|
onDraftContentChange(emptyAgentComposerDraft());
|
|
18026
18794
|
}, [onDraftContentChange]);
|
|
18027
|
-
const closeSlashStatusPanel =
|
|
18795
|
+
const closeSlashStatusPanel = useCallback35(() => {
|
|
18028
18796
|
setIsSlashStatusPanelOpen(false);
|
|
18029
|
-
|
|
18797
|
+
onSlashStatusClose?.();
|
|
18798
|
+
}, [onSlashStatusClose, setIsSlashStatusPanelOpen]);
|
|
18030
18799
|
const settingsControlsDisabled = isSendingTurn || isSubmittingPrompt || showStopButton;
|
|
18031
18800
|
const permissionModeControlsDisabled = resolvePermissionModeControlsDisabled({
|
|
18032
18801
|
isSendingTurn,
|
|
@@ -18034,15 +18803,24 @@ function useComposerSlashActions(input) {
|
|
|
18034
18803
|
showStopButton
|
|
18035
18804
|
});
|
|
18036
18805
|
const composerControlsHardDisabled = isSelectedProjectMissing || isSubmittingPrompt || disabled && !isSendingTurn && !showStopButton;
|
|
18037
|
-
const closeReviewPicker =
|
|
18806
|
+
const closeReviewPicker = useCallback35(() => {
|
|
18038
18807
|
setIsReviewPickerOpen(false);
|
|
18039
18808
|
}, []);
|
|
18040
|
-
const closeSlashFloatingMenu =
|
|
18809
|
+
const closeSlashFloatingMenu = useCallback35(() => {
|
|
18810
|
+
if (isSlashStatusPanelOpen) {
|
|
18811
|
+
onSlashStatusClose?.();
|
|
18812
|
+
}
|
|
18041
18813
|
setIsSlashStatusPanelOpen(false);
|
|
18042
18814
|
setIsReviewPickerOpen(false);
|
|
18043
18815
|
setIsPaletteOpen(false);
|
|
18044
|
-
}, [
|
|
18045
|
-
|
|
18816
|
+
}, [
|
|
18817
|
+
isSlashStatusPanelOpen,
|
|
18818
|
+
onSlashStatusClose,
|
|
18819
|
+
setIsPaletteOpen,
|
|
18820
|
+
setIsReviewPickerOpen,
|
|
18821
|
+
setIsSlashStatusPanelOpen
|
|
18822
|
+
]);
|
|
18823
|
+
const submitReviewCommand = useCallback35(
|
|
18046
18824
|
(command) => {
|
|
18047
18825
|
setIsReviewPickerOpen(false);
|
|
18048
18826
|
clearSlashCommandDraft();
|
|
@@ -18050,7 +18828,7 @@ function useComposerSlashActions(input) {
|
|
|
18050
18828
|
},
|
|
18051
18829
|
[clearSlashCommandDraft, onSubmit]
|
|
18052
18830
|
);
|
|
18053
|
-
const reviewBranchLoader =
|
|
18831
|
+
const reviewBranchLoader = useMemo24(() => {
|
|
18054
18832
|
if (!onRequestGitBranches) {
|
|
18055
18833
|
return null;
|
|
18056
18834
|
}
|
|
@@ -18062,7 +18840,7 @@ function useComposerSlashActions(input) {
|
|
|
18062
18840
|
}
|
|
18063
18841
|
return null;
|
|
18064
18842
|
}, [onRequestGitBranches, selectedProjectPath, slashStatusAgentSessionId]);
|
|
18065
|
-
const executeSlashCommandEffect =
|
|
18843
|
+
const executeSlashCommandEffect = useCallback35(
|
|
18066
18844
|
(effect) => {
|
|
18067
18845
|
if (effect.kind === "submitPrompt") {
|
|
18068
18846
|
clearSlashCommandDraft();
|
|
@@ -18083,17 +18861,25 @@ function useComposerSlashActions(input) {
|
|
|
18083
18861
|
setIsReviewPickerOpen(false);
|
|
18084
18862
|
if (!isSlashStatusPanelOpen) {
|
|
18085
18863
|
onSlashStatusOpen?.();
|
|
18864
|
+
} else {
|
|
18865
|
+
onSlashStatusClose?.();
|
|
18086
18866
|
}
|
|
18087
18867
|
setIsSlashStatusPanelOpen((current) => !current);
|
|
18088
18868
|
return;
|
|
18089
18869
|
}
|
|
18090
18870
|
if (effect.kind === "showReviewPicker") {
|
|
18091
18871
|
clearSlashCommandDraft();
|
|
18092
|
-
|
|
18872
|
+
if (isSlashStatusPanelOpen) {
|
|
18873
|
+
onSlashStatusClose?.();
|
|
18874
|
+
setIsSlashStatusPanelOpen(false);
|
|
18875
|
+
}
|
|
18093
18876
|
setIsReviewPickerOpen(true);
|
|
18094
18877
|
return;
|
|
18095
18878
|
}
|
|
18096
18879
|
if (effect.kind === "activateGoalMode") {
|
|
18880
|
+
if (isSlashStatusPanelOpen) {
|
|
18881
|
+
onSlashStatusClose?.();
|
|
18882
|
+
}
|
|
18097
18883
|
draftPromptRef.current = GOAL_MODE_SLASH_COMMAND2;
|
|
18098
18884
|
setPaletteDraftPrompt("");
|
|
18099
18885
|
setIsSlashStatusPanelOpen(false);
|
|
@@ -18166,13 +18952,14 @@ function useComposerSlashActions(input) {
|
|
|
18166
18952
|
draftContent,
|
|
18167
18953
|
isSlashStatusPanelOpen,
|
|
18168
18954
|
onDraftContentChange,
|
|
18955
|
+
onSlashStatusClose,
|
|
18169
18956
|
onSlashStatusOpen,
|
|
18170
18957
|
onSettingsChange,
|
|
18171
18958
|
onSubmit,
|
|
18172
18959
|
settingsControlsDisabled
|
|
18173
18960
|
]
|
|
18174
18961
|
);
|
|
18175
|
-
const selectCommand =
|
|
18962
|
+
const selectCommand = useCallback35(
|
|
18176
18963
|
(command) => {
|
|
18177
18964
|
const selectionEffect = resolveSlashCommandSelectionEffect({
|
|
18178
18965
|
provider,
|
|
@@ -18186,7 +18973,7 @@ function useComposerSlashActions(input) {
|
|
|
18186
18973
|
},
|
|
18187
18974
|
[executeSlashCommandEffect, provider, slashCommandPolicy]
|
|
18188
18975
|
);
|
|
18189
|
-
const selectCapability =
|
|
18976
|
+
const selectCapability = useCallback35(
|
|
18190
18977
|
(capability) => {
|
|
18191
18978
|
const selectionEffect = resolveSlashCommandSelectionEffect({
|
|
18192
18979
|
provider,
|
|
@@ -18200,14 +18987,14 @@ function useComposerSlashActions(input) {
|
|
|
18200
18987
|
},
|
|
18201
18988
|
[executeSlashCommandEffect, provider, slashCommandPolicy]
|
|
18202
18989
|
);
|
|
18203
|
-
const selectCapabilitySettings =
|
|
18990
|
+
const selectCapabilitySettings = useCallback35(
|
|
18204
18991
|
(capability) => {
|
|
18205
18992
|
onCapabilitySettingsRequest?.(capability.capability);
|
|
18206
18993
|
setIsPaletteOpen(false);
|
|
18207
18994
|
},
|
|
18208
18995
|
[onCapabilitySettingsRequest]
|
|
18209
18996
|
);
|
|
18210
|
-
const selectSkill =
|
|
18997
|
+
const selectSkill = useCallback35(
|
|
18211
18998
|
(skill) => {
|
|
18212
18999
|
const trigger = skillTriggerForPrefix(skill, skillQueryMatch?.prefix);
|
|
18213
19000
|
const replacedDraft = trigger && skillQueryMatch && promptBeforeSelection !== "" ? editorHandleRef.current?.replaceTextBeforeSelection(
|
|
@@ -18330,7 +19117,7 @@ function useComposerSlashActions(input) {
|
|
|
18330
19117
|
}
|
|
18331
19118
|
}
|
|
18332
19119
|
);
|
|
18333
|
-
const submit =
|
|
19120
|
+
const submit = useCallback35(
|
|
18334
19121
|
(event) => {
|
|
18335
19122
|
event.preventDefault();
|
|
18336
19123
|
submitCurrentPrompt();
|
|
@@ -18414,7 +19201,7 @@ function useComposerSlashActions(input) {
|
|
|
18414
19201
|
|
|
18415
19202
|
// agent-gui/agentGuiNode/composer/useComposerMentionActions.ts
|
|
18416
19203
|
import {
|
|
18417
|
-
useCallback as
|
|
19204
|
+
useCallback as useCallback36,
|
|
18418
19205
|
useEffect as useEffect18,
|
|
18419
19206
|
useRef as useRef26
|
|
18420
19207
|
} from "react";
|
|
@@ -18438,7 +19225,7 @@ function isAgentRichTextImeComposing(event) {
|
|
|
18438
19225
|
function useStableEventCallback4(callback) {
|
|
18439
19226
|
const callbackRef = useRef26(callback);
|
|
18440
19227
|
callbackRef.current = callback;
|
|
18441
|
-
return
|
|
19228
|
+
return useCallback36((...args) => callbackRef.current(...args), []);
|
|
18442
19229
|
}
|
|
18443
19230
|
function useComposerMentionActions(input) {
|
|
18444
19231
|
const {
|
|
@@ -18475,7 +19262,7 @@ function useComposerMentionActions(input) {
|
|
|
18475
19262
|
paletteContentRef,
|
|
18476
19263
|
shouldCenterMentionHighlight
|
|
18477
19264
|
} = input;
|
|
18478
|
-
const selectFileMention =
|
|
19265
|
+
const selectFileMention = useCallback36(
|
|
18479
19266
|
(entry) => {
|
|
18480
19267
|
if (entry.kind === "file" && entry.mentionNavigation) {
|
|
18481
19268
|
mentionControllerRef.current?.selectFileMentionNavigationItem(entry);
|
|
@@ -18491,7 +19278,7 @@ function useComposerMentionActions(input) {
|
|
|
18491
19278
|
},
|
|
18492
19279
|
[fileMentionSuggestion]
|
|
18493
19280
|
);
|
|
18494
|
-
const closeFileMentionPalette =
|
|
19281
|
+
const closeFileMentionPalette = useCallback36(() => {
|
|
18495
19282
|
if (fileMentionSuggestion) {
|
|
18496
19283
|
exitAgentFileMentionSuggestion(fileMentionSuggestion.editor);
|
|
18497
19284
|
}
|
|
@@ -18499,7 +19286,7 @@ function useComposerMentionActions(input) {
|
|
|
18499
19286
|
setFileMentionSuggestion(null);
|
|
18500
19287
|
setIsPaletteOpen(false);
|
|
18501
19288
|
}, [fileMentionSuggestion]);
|
|
18502
|
-
const clearActiveFileMentionTrigger =
|
|
19289
|
+
const clearActiveFileMentionTrigger = useCallback36(() => {
|
|
18503
19290
|
if (!fileMentionSuggestion) {
|
|
18504
19291
|
return;
|
|
18505
19292
|
}
|
|
@@ -18517,14 +19304,14 @@ function useComposerMentionActions(input) {
|
|
|
18517
19304
|
updateAgentComposerDraft(draftContent, { prompt: nextDraft })
|
|
18518
19305
|
);
|
|
18519
19306
|
}, [draftContent, fileMentionSuggestion, onDraftContentChange]);
|
|
18520
|
-
const closeOpenPalette =
|
|
19307
|
+
const closeOpenPalette = useCallback36(() => {
|
|
18521
19308
|
if (showFileMentionPalette) {
|
|
18522
19309
|
closeFileMentionPalette();
|
|
18523
19310
|
return;
|
|
18524
19311
|
}
|
|
18525
19312
|
setIsPaletteOpen(false);
|
|
18526
19313
|
}, [closeFileMentionPalette, showFileMentionPalette]);
|
|
18527
|
-
const createFileMentionPaletteAdapter =
|
|
19314
|
+
const createFileMentionPaletteAdapter = useCallback36(
|
|
18528
19315
|
(highlightedKey = mentionHighlightedKey) => createMentionPaletteStateAdapter({
|
|
18529
19316
|
state: mentionSearchState,
|
|
18530
19317
|
highlightedKey,
|
|
@@ -18554,23 +19341,23 @@ function useComposerMentionActions(input) {
|
|
|
18554
19341
|
}),
|
|
18555
19342
|
[mentionHighlightedKey, mentionSearchState, selectFileMention]
|
|
18556
19343
|
);
|
|
18557
|
-
const moveFileMentionSelection =
|
|
19344
|
+
const moveFileMentionSelection = useCallback36(
|
|
18558
19345
|
(delta) => {
|
|
18559
19346
|
createFileMentionPaletteAdapter().moveSelection(delta);
|
|
18560
19347
|
},
|
|
18561
19348
|
[createFileMentionPaletteAdapter]
|
|
18562
19349
|
);
|
|
18563
|
-
const handleMentionHighlightChange =
|
|
19350
|
+
const handleMentionHighlightChange = useCallback36((key) => {
|
|
18564
19351
|
autoMentionHighlightedKeyRef.current = null;
|
|
18565
19352
|
setMentionHighlightedKey(key);
|
|
18566
19353
|
}, []);
|
|
18567
|
-
const cycleFileMentionFilter =
|
|
19354
|
+
const cycleFileMentionFilter = useCallback36(
|
|
18568
19355
|
(delta = 1) => {
|
|
18569
19356
|
createFileMentionPaletteAdapter().cycleCategory(delta);
|
|
18570
19357
|
},
|
|
18571
19358
|
[createFileMentionPaletteAdapter]
|
|
18572
19359
|
);
|
|
18573
|
-
const navigateFileMentionHierarchy =
|
|
19360
|
+
const navigateFileMentionHierarchy = useCallback36(
|
|
18574
19361
|
(delta) => {
|
|
18575
19362
|
if (delta === -1) {
|
|
18576
19363
|
return mentionControllerRef.current?.exitFileMentionBrowse() ?? false;
|
|
@@ -18586,13 +19373,13 @@ function useComposerMentionActions(input) {
|
|
|
18586
19373
|
},
|
|
18587
19374
|
[createFileMentionPaletteAdapter]
|
|
18588
19375
|
);
|
|
18589
|
-
const navigateIntoFileMentionItem =
|
|
19376
|
+
const navigateIntoFileMentionItem = useCallback36(
|
|
18590
19377
|
(item) => {
|
|
18591
19378
|
mentionControllerRef.current?.selectFileMentionNavigationItem(item);
|
|
18592
19379
|
},
|
|
18593
19380
|
[]
|
|
18594
19381
|
);
|
|
18595
|
-
const handleFileMentionKeyDown =
|
|
19382
|
+
const handleFileMentionKeyDown = useCallback36(
|
|
18596
19383
|
(event) => {
|
|
18597
19384
|
if (!showFileMentionPalette) {
|
|
18598
19385
|
return false;
|
|
@@ -18619,7 +19406,7 @@ function useComposerMentionActions(input) {
|
|
|
18619
19406
|
showFileMentionPalette
|
|
18620
19407
|
]
|
|
18621
19408
|
);
|
|
18622
|
-
const handlePlanModeToggleKeyDown =
|
|
19409
|
+
const handlePlanModeToggleKeyDown = useCallback36(
|
|
18623
19410
|
(event) => {
|
|
18624
19411
|
if (event.key !== "Tab" || !event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) {
|
|
18625
19412
|
return false;
|
|
@@ -18674,7 +19461,7 @@ function useComposerMentionActions(input) {
|
|
|
18674
19461
|
});
|
|
18675
19462
|
};
|
|
18676
19463
|
}, [handlePaletteKeyDown, showPalette, workspaceReferencePickerOpen]);
|
|
18677
|
-
const handleFileMentionSuggestionChange =
|
|
19464
|
+
const handleFileMentionSuggestionChange = useCallback36(
|
|
18678
19465
|
(state) => {
|
|
18679
19466
|
setFileMentionSuggestion(state);
|
|
18680
19467
|
if (!state) {
|
|
@@ -18740,7 +19527,7 @@ function useComposerMentionActions(input) {
|
|
|
18740
19527
|
}
|
|
18741
19528
|
|
|
18742
19529
|
// agent-gui/agentGuiNode/composer/useComposerProviderTargets.ts
|
|
18743
|
-
import { useMemo as
|
|
19530
|
+
import { useMemo as useMemo25 } from "react";
|
|
18744
19531
|
function useComposerProviderTargets(input) {
|
|
18745
19532
|
const {
|
|
18746
19533
|
layoutMode,
|
|
@@ -18764,7 +19551,7 @@ function useComposerProviderTargets(input) {
|
|
|
18764
19551
|
};
|
|
18765
19552
|
const isHeroLayout = layoutMode === "hero";
|
|
18766
19553
|
const composerClassName = isHeroLayout ? AgentGUINode_styles_default.composerHero : AgentGUINode_styles_default.composer;
|
|
18767
|
-
const providerSwitchTargets =
|
|
19554
|
+
const providerSwitchTargets = useMemo25(
|
|
18768
19555
|
() => agentTargets.filter(Boolean),
|
|
18769
19556
|
[agentTargets]
|
|
18770
19557
|
);
|
|
@@ -18775,7 +19562,7 @@ function useComposerProviderTargets(input) {
|
|
|
18775
19562
|
const providerMenuTargets = selectedProviderSwitchTarget && !providerSwitchTargets.some(
|
|
18776
19563
|
(target) => target.targetId === selectedProviderSwitchTarget.targetId
|
|
18777
19564
|
) ? [selectedProviderSwitchTarget, ...providerSwitchTargets] : providerSwitchTargets;
|
|
18778
|
-
const enabledHandoffProviderTargets =
|
|
19565
|
+
const enabledHandoffProviderTargets = useMemo25(
|
|
18779
19566
|
() => (handoffAgentTargets ?? providerMenuTargets).filter(
|
|
18780
19567
|
(target) => target.disabled !== true
|
|
18781
19568
|
),
|
|
@@ -18820,7 +19607,7 @@ function useComposerProviderTargets(input) {
|
|
|
18820
19607
|
}
|
|
18821
19608
|
|
|
18822
19609
|
// agent-gui/agentGuiNode/composer/useComposerFocusAndDrop.ts
|
|
18823
|
-
import { useCallback as
|
|
19610
|
+
import { useCallback as useCallback37, useEffect as useEffect20 } from "react";
|
|
18824
19611
|
|
|
18825
19612
|
// agent-gui/agentGuiNode/composer/useComposerFileDrop.ts
|
|
18826
19613
|
import { useEffect as useEffect19, useState as useState12 } from "react";
|
|
@@ -19208,13 +19995,13 @@ function useComposerFocusAndDrop(input) {
|
|
|
19208
19995
|
addDraftFiles,
|
|
19209
19996
|
onPromptImagesUnsupported
|
|
19210
19997
|
} = input;
|
|
19211
|
-
const handleMentionPaletteButton =
|
|
19998
|
+
const handleMentionPaletteButton = useCallback37(() => {
|
|
19212
19999
|
if (composerControlsHardDisabled || inputDisabled) {
|
|
19213
20000
|
return;
|
|
19214
20001
|
}
|
|
19215
20002
|
editorHandleRef.current?.openMentionPalette();
|
|
19216
20003
|
}, [composerControlsHardDisabled, inputDisabled]);
|
|
19217
|
-
const scheduleComposerFocus =
|
|
20004
|
+
const scheduleComposerFocus = useCallback37(() => {
|
|
19218
20005
|
if (inputDisabled) {
|
|
19219
20006
|
return;
|
|
19220
20007
|
}
|
|
@@ -19224,7 +20011,7 @@ function useComposerFocusAndDrop(input) {
|
|
|
19224
20011
|
});
|
|
19225
20012
|
});
|
|
19226
20013
|
}, [inputDisabled]);
|
|
19227
|
-
const handlePastedImages =
|
|
20014
|
+
const handlePastedImages = useCallback37(
|
|
19228
20015
|
(images) => {
|
|
19229
20016
|
addDraftImages(images);
|
|
19230
20017
|
scheduleComposerFocus();
|
|
@@ -19269,7 +20056,7 @@ function useComposerFocusAndDrop(input) {
|
|
|
19269
20056
|
|
|
19270
20057
|
// agent-gui/agentGuiNode/composer/useComposerPresentation.tsx
|
|
19271
20058
|
import {
|
|
19272
|
-
useCallback as
|
|
20059
|
+
useCallback as useCallback38,
|
|
19273
20060
|
useEffect as useEffect21,
|
|
19274
20061
|
useState as useState14
|
|
19275
20062
|
} from "react";
|
|
@@ -19537,7 +20324,7 @@ function useComposerPresentation(input) {
|
|
|
19537
20324
|
useEffect21(() => {
|
|
19538
20325
|
setDismissedPromptRequestId(null);
|
|
19539
20326
|
}, [activePromptRequestId]);
|
|
19540
|
-
const submitInteractivePromptAndDismiss =
|
|
20327
|
+
const submitInteractivePromptAndDismiss = useCallback38(
|
|
19541
20328
|
(input2) => {
|
|
19542
20329
|
onSubmitInteractivePrompt(input2);
|
|
19543
20330
|
setDismissedPromptRequestId(input2.requestId);
|
|
@@ -20804,7 +21591,7 @@ function optionsWithSelectedValue(options, selectedValue) {
|
|
|
20804
21591
|
}
|
|
20805
21592
|
|
|
20806
21593
|
// agent-gui/agentGuiNode/AgentComposerProjectMenu.tsx
|
|
20807
|
-
import { useMemo as
|
|
21594
|
+
import { useMemo as useMemo26 } from "react";
|
|
20808
21595
|
import { ChevronDown } from "lucide-react";
|
|
20809
21596
|
import {
|
|
20810
21597
|
WorkspaceUserProjectSelect,
|
|
@@ -20849,11 +21636,11 @@ function AgentProjectDropdown({
|
|
|
20849
21636
|
}) {
|
|
20850
21637
|
"use memo";
|
|
20851
21638
|
const agentHostApi = useAgentHostApi();
|
|
20852
|
-
const resolvedLabels =
|
|
21639
|
+
const resolvedLabels = useMemo26(
|
|
20853
21640
|
() => resolveWorkspaceUserProjectSelectLabels(i18n, labels),
|
|
20854
21641
|
[i18n, labels]
|
|
20855
21642
|
);
|
|
20856
|
-
const userProjectApi =
|
|
21643
|
+
const userProjectApi = useMemo26(
|
|
20857
21644
|
() => createAgentGUIUserProjectSelectionApi({
|
|
20858
21645
|
selectProjectDirectory,
|
|
20859
21646
|
userProjects: previewMode ? null : agentHostApi.userProjects
|
|
@@ -21561,9 +22348,9 @@ function AgentFullAccessRestoredWarning({
|
|
|
21561
22348
|
// agent-gui/agentGuiNode/agentRichText/AgentRichTextEditor.tsx
|
|
21562
22349
|
import {
|
|
21563
22350
|
forwardRef as forwardRef3,
|
|
21564
|
-
useCallback as
|
|
22351
|
+
useCallback as useCallback40,
|
|
21565
22352
|
useEffect as useEffect23,
|
|
21566
|
-
useMemo as
|
|
22353
|
+
useMemo as useMemo27,
|
|
21567
22354
|
useRef as useRef29,
|
|
21568
22355
|
useState as useState18
|
|
21569
22356
|
} from "react";
|
|
@@ -22160,7 +22947,7 @@ function useAgentRichTextEditorHandle(input) {
|
|
|
22160
22947
|
|
|
22161
22948
|
// agent-gui/agentGuiNode/agentRichText/AgentRichTextEditorSurface.tsx
|
|
22162
22949
|
import {
|
|
22163
|
-
useCallback as
|
|
22950
|
+
useCallback as useCallback39,
|
|
22164
22951
|
useRef as useRef28
|
|
22165
22952
|
} from "react";
|
|
22166
22953
|
import { createPortal as createPortal2 } from "react-dom";
|
|
@@ -22250,7 +23037,7 @@ function AgentRichTextContextMenuButton({
|
|
|
22250
23037
|
onSelect
|
|
22251
23038
|
}) {
|
|
22252
23039
|
const selectionStartedRef = useRef28(false);
|
|
22253
|
-
const select =
|
|
23040
|
+
const select = useCallback39(() => {
|
|
22254
23041
|
if (disabled || selectionStartedRef.current) return;
|
|
22255
23042
|
selectionStartedRef.current = true;
|
|
22256
23043
|
void Promise.resolve(onSelect()).finally(() => {
|
|
@@ -22380,10 +23167,10 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
22380
23167
|
const suppressPastedAtSuggestionRef = useRef29(false);
|
|
22381
23168
|
const scrollFrameRef = useRef29(null);
|
|
22382
23169
|
const [contextMenu, setContextMenu] = useState18(null);
|
|
22383
|
-
const closeContextMenu =
|
|
23170
|
+
const closeContextMenu = useCallback40(() => {
|
|
22384
23171
|
setContextMenu(null);
|
|
22385
23172
|
}, []);
|
|
22386
|
-
const insertPlainText =
|
|
23173
|
+
const insertPlainText = useCallback40((text) => {
|
|
22387
23174
|
const currentEditor = editorRef.current;
|
|
22388
23175
|
if (!currentEditor || currentEditor.isDestroyed || !text) {
|
|
22389
23176
|
return;
|
|
@@ -22403,7 +23190,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
22403
23190
|
})
|
|
22404
23191
|
).run();
|
|
22405
23192
|
}, []);
|
|
22406
|
-
const copySelection =
|
|
23193
|
+
const copySelection = useCallback40(async () => {
|
|
22407
23194
|
const currentEditor = editorRef.current;
|
|
22408
23195
|
const selectedText = contextMenu && contextMenu.hasSelection && currentEditor ? readPromptTextRange(
|
|
22409
23196
|
currentEditor,
|
|
@@ -22416,7 +23203,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
22416
23203
|
}
|
|
22417
23204
|
await writePlainTextToClipboard(selectedText);
|
|
22418
23205
|
}, [closeContextMenu, contextMenu]);
|
|
22419
|
-
const cutSelection =
|
|
23206
|
+
const cutSelection = useCallback40(async () => {
|
|
22420
23207
|
const currentEditor = editorRef.current;
|
|
22421
23208
|
const selectionFrom = contextMenu?.selectionFrom ?? null;
|
|
22422
23209
|
const selectionTo = contextMenu?.selectionTo ?? null;
|
|
@@ -22435,7 +23222,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
22435
23222
|
const { from, to } = selectionFrom !== null && selectionTo !== null && selectionFrom < selectionTo ? { from: selectionFrom, to: selectionTo } : currentEditor.state.selection;
|
|
22436
23223
|
currentEditor.chain().focus().deleteRange({ from, to }).run();
|
|
22437
23224
|
}, [closeContextMenu, contextMenu, disabled]);
|
|
22438
|
-
const pasteClipboardText =
|
|
23225
|
+
const pasteClipboardText = useCallback40(async () => {
|
|
22439
23226
|
closeContextMenu();
|
|
22440
23227
|
if (disabled) {
|
|
22441
23228
|
return;
|
|
@@ -22462,7 +23249,7 @@ var AgentRichTextEditor = forwardRef3(function AgentRichTextEditor2({
|
|
|
22462
23249
|
scrollEditorSelectionIntoView(currentEditor);
|
|
22463
23250
|
});
|
|
22464
23251
|
};
|
|
22465
|
-
const extensions =
|
|
23252
|
+
const extensions = useMemo27(
|
|
22466
23253
|
() => [
|
|
22467
23254
|
...createAgentRichTextInputExtensions(
|
|
22468
23255
|
{
|
|
@@ -23180,7 +23967,7 @@ function slashPaletteEntryIcon(entry) {
|
|
|
23180
23967
|
}
|
|
23181
23968
|
|
|
23182
23969
|
// agent-gui/agentGuiNode/AgentReviewPickerPanel.tsx
|
|
23183
|
-
import { useCallback as
|
|
23970
|
+
import { useCallback as useCallback41, useEffect as useEffect25, useMemo as useMemo28, useRef as useRef31, useState as useState19 } from "react";
|
|
23184
23971
|
import { menuItemClassName } from "@tutti-os/ui-system";
|
|
23185
23972
|
|
|
23186
23973
|
// agent-gui/agentGuiNode/AgentReviewBranchController.ts
|
|
@@ -23332,25 +24119,25 @@ function AgentReviewPickerPanel({
|
|
|
23332
24119
|
useEffect25(() => {
|
|
23333
24120
|
searchInputRef.current?.focus();
|
|
23334
24121
|
}, [stage]);
|
|
23335
|
-
const submit =
|
|
24122
|
+
const submit = useCallback41(
|
|
23336
24123
|
(command) => {
|
|
23337
24124
|
onSubmitReview(command);
|
|
23338
24125
|
},
|
|
23339
24126
|
[onSubmitReview]
|
|
23340
24127
|
);
|
|
23341
|
-
const goToStage =
|
|
24128
|
+
const goToStage = useCallback41((next) => {
|
|
23342
24129
|
setStage(next);
|
|
23343
24130
|
setQuery("");
|
|
23344
24131
|
setHighlightedIndex(0);
|
|
23345
24132
|
}, []);
|
|
23346
|
-
const goBackToRoot =
|
|
24133
|
+
const goBackToRoot = useCallback41(() => {
|
|
23347
24134
|
setStage("root");
|
|
23348
24135
|
setQuery("");
|
|
23349
24136
|
setHighlightedIndex(0);
|
|
23350
24137
|
}, []);
|
|
23351
24138
|
const trimmedQuery = query.trim();
|
|
23352
24139
|
const normalizedQuery = trimmedQuery.toLowerCase();
|
|
23353
|
-
const entries =
|
|
24140
|
+
const entries = useMemo28(() => {
|
|
23354
24141
|
if (stage === "root") {
|
|
23355
24142
|
const options = [
|
|
23356
24143
|
{
|
|
@@ -23431,7 +24218,7 @@ function AgentReviewPickerPanel({
|
|
|
23431
24218
|
emptyMessage = labels.branchEmpty;
|
|
23432
24219
|
}
|
|
23433
24220
|
}
|
|
23434
|
-
const handleKeyDown =
|
|
24221
|
+
const handleKeyDown = useCallback41(
|
|
23435
24222
|
(event) => {
|
|
23436
24223
|
if (event.key === "ArrowDown") {
|
|
23437
24224
|
event.preventDefault();
|
|
@@ -23541,10 +24328,10 @@ function AgentReviewPickerPanel({
|
|
|
23541
24328
|
// agent-gui/agentGuiNode/composerFloatingMenu/ComposerFloatingMenuSurface.tsx
|
|
23542
24329
|
import {
|
|
23543
24330
|
forwardRef as forwardRef4,
|
|
23544
|
-
useCallback as
|
|
24331
|
+
useCallback as useCallback42,
|
|
23545
24332
|
useEffect as useEffect26,
|
|
23546
24333
|
useLayoutEffect as useLayoutEffect5,
|
|
23547
|
-
useMemo as
|
|
24334
|
+
useMemo as useMemo29,
|
|
23548
24335
|
useRef as useRef32,
|
|
23549
24336
|
useState as useState20
|
|
23550
24337
|
} from "react";
|
|
@@ -23639,7 +24426,7 @@ function useComposerAnchoredMenuFrame({
|
|
|
23639
24426
|
open
|
|
23640
24427
|
}) {
|
|
23641
24428
|
const [frame, setFrame] = useState20(null);
|
|
23642
|
-
const syncFrame =
|
|
24429
|
+
const syncFrame = useCallback42(() => {
|
|
23643
24430
|
const anchor = anchorRef.current;
|
|
23644
24431
|
if (!anchor || typeof window === "undefined") {
|
|
23645
24432
|
setFrame(null);
|
|
@@ -23698,7 +24485,7 @@ var ComposerFloatingMenuSurface = forwardRef4(function ComposerFloatingMenuSurfa
|
|
|
23698
24485
|
maxHeight,
|
|
23699
24486
|
open
|
|
23700
24487
|
});
|
|
23701
|
-
const setSurfaceRef =
|
|
24488
|
+
const setSurfaceRef = useCallback42(
|
|
23702
24489
|
(node) => {
|
|
23703
24490
|
localSurfaceRef.current = node;
|
|
23704
24491
|
assignRef(surfaceRef, node);
|
|
@@ -23753,7 +24540,7 @@ var ComposerFloatingMenuSurface = forwardRef4(function ComposerFloatingMenuSurfa
|
|
|
23753
24540
|
window.removeEventListener("blur", onDismiss);
|
|
23754
24541
|
};
|
|
23755
24542
|
}, [anchorRef, dismissBoundaryRef, onDismiss, open]);
|
|
23756
|
-
const style =
|
|
24543
|
+
const style = useMemo29(() => {
|
|
23757
24544
|
const baseStyle = {
|
|
23758
24545
|
position: "fixed",
|
|
23759
24546
|
left: `${frame?.left ?? 0}px`,
|
|
@@ -24704,7 +25491,7 @@ function validateDraft(draft, labels) {
|
|
|
24704
25491
|
}
|
|
24705
25492
|
|
|
24706
25493
|
// agent-gui/agentGuiNode/composer/quickPrompts/AgentQuickPromptList.tsx
|
|
24707
|
-
import { useMemo as
|
|
25494
|
+
import { useMemo as useMemo30, useRef as useRef35 } from "react";
|
|
24708
25495
|
import { Sortable, SortableContent, SortableItem } from "@tutti-os/ui-system";
|
|
24709
25496
|
|
|
24710
25497
|
// agent-gui/agentGuiNode/composer/quickPrompts/AgentQuickPromptRow.tsx
|
|
@@ -24846,11 +25633,11 @@ function AgentQuickPromptList({
|
|
|
24846
25633
|
}) {
|
|
24847
25634
|
const handleRefs = useRef35(/* @__PURE__ */ new Map());
|
|
24848
25635
|
const { filteredPrompts, labels, snapshot } = controller;
|
|
24849
|
-
const promptsById =
|
|
25636
|
+
const promptsById = useMemo30(
|
|
24850
25637
|
() => new Map(filteredPrompts.map((prompt) => [prompt.id, prompt])),
|
|
24851
25638
|
[filteredPrompts]
|
|
24852
25639
|
);
|
|
24853
|
-
const accessibility =
|
|
25640
|
+
const accessibility = useMemo30(
|
|
24854
25641
|
() => ({
|
|
24855
25642
|
announcements: {
|
|
24856
25643
|
onDragStart({ active }) {
|
|
@@ -25482,6 +26269,7 @@ function AgentComposerView(input) {
|
|
|
25482
26269
|
onSubmit,
|
|
25483
26270
|
onProviderSelect,
|
|
25484
26271
|
onHandoffConversation,
|
|
26272
|
+
onSlashStatusRefresh,
|
|
25485
26273
|
compactSupported = null,
|
|
25486
26274
|
hasCompactableContext = true
|
|
25487
26275
|
} = input.props;
|
|
@@ -25883,9 +26671,17 @@ function AgentComposerView(input) {
|
|
|
25883
26671
|
slashStatusClose: labels.slashStatusClose,
|
|
25884
26672
|
slashStatusContextValue: labels.slashStatusContextValue,
|
|
25885
26673
|
slashStatusContextUnavailable: labels.slashStatusContextUnavailable,
|
|
25886
|
-
slashStatusLimitsUnavailable: labels.slashStatusLimitsUnavailable
|
|
26674
|
+
slashStatusLimitsUnavailable: labels.slashStatusLimitsUnavailable,
|
|
26675
|
+
slashStatusEmptyValue: labels.slashStatusEmptyValue,
|
|
26676
|
+
slashStatusUsageJustUpdated: labels.slashStatusUsageJustUpdated,
|
|
26677
|
+
slashStatusUsageMinutesAgo: labels.slashStatusUsageMinutesAgo,
|
|
26678
|
+
slashStatusUsageHoursAgo: labels.slashStatusUsageHoursAgo,
|
|
26679
|
+
slashStatusUsageUpdating: labels.slashStatusUsageUpdating,
|
|
26680
|
+
slashStatusUsageRefreshFailed: labels.slashStatusUsageRefreshFailed,
|
|
26681
|
+
slashStatusUsageRefreshAria: labels.slashStatusUsageRefreshAria
|
|
25887
26682
|
},
|
|
25888
|
-
onClose: closeSlashStatusPanel
|
|
26683
|
+
onClose: closeSlashStatusPanel,
|
|
26684
|
+
onRefresh: onSlashStatusRefresh
|
|
25889
26685
|
}
|
|
25890
26686
|
)
|
|
25891
26687
|
}
|
|
@@ -26019,12 +26815,12 @@ function AgentComposerView(input) {
|
|
|
26019
26815
|
}
|
|
26020
26816
|
|
|
26021
26817
|
// agent-gui/agentGuiNode/composer/useAgentMentionSearchController.ts
|
|
26022
|
-
import { useEffect as useEffect27, useMemo as
|
|
26818
|
+
import { useEffect as useEffect27, useMemo as useMemo31, useRef as useRef37, useState as useState24 } from "react";
|
|
26023
26819
|
import { useRichTextMentionService } from "@tutti-os/ui-rich-text/editor";
|
|
26024
26820
|
var EMPTY_AGENT_CONTEXT_MENTION_PROVIDERS = [];
|
|
26025
26821
|
function useAgentMentionSearchController(referenceProvenanceFilter) {
|
|
26026
26822
|
const mentionService = useRichTextMentionService();
|
|
26027
|
-
const contextMentionProviders =
|
|
26823
|
+
const contextMentionProviders = useMemo31(
|
|
26028
26824
|
() => mentionService?.listProviders().filter(isAgentContextMentionProvider) ?? EMPTY_AGENT_CONTEXT_MENTION_PROVIDERS,
|
|
26029
26825
|
[mentionService]
|
|
26030
26826
|
);
|
|
@@ -26077,7 +26873,7 @@ var INITIAL_AGENT_MENTION_SEARCH_STATE = {
|
|
|
26077
26873
|
};
|
|
26078
26874
|
|
|
26079
26875
|
// agent-gui/agentGuiNode/composer/quickPrompts/useAgentQuickPromptLibrary.ts
|
|
26080
|
-
import { useCallback as
|
|
26876
|
+
import { useCallback as useCallback43, useMemo as useMemo32, useRef as useRef38, useState as useState25 } from "react";
|
|
26081
26877
|
var unavailableSnapshot = {
|
|
26082
26878
|
enabled: false,
|
|
26083
26879
|
status: "idle",
|
|
@@ -26127,7 +26923,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26127
26923
|
setReorderError(null);
|
|
26128
26924
|
}
|
|
26129
26925
|
const effectiveMode = disclosureAvailable && previousDisclosureAvailable === disclosureAvailable ? mode : "closed";
|
|
26130
|
-
const filteredPrompts =
|
|
26926
|
+
const filteredPrompts = useMemo32(() => {
|
|
26131
26927
|
const query = searchQuery.trim().toLocaleLowerCase();
|
|
26132
26928
|
if (!query) {
|
|
26133
26929
|
return snapshot.prompts;
|
|
@@ -26143,7 +26939,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26143
26939
|
const showReorderHandles = Boolean(
|
|
26144
26940
|
quickPrompts?.move && capabilityAvailable && !searchQuery.trim() && filteredPrompts.length > 1
|
|
26145
26941
|
);
|
|
26146
|
-
const openPopover =
|
|
26942
|
+
const openPopover = useCallback43(() => {
|
|
26147
26943
|
if (!capabilityAvailable || disabled) {
|
|
26148
26944
|
return;
|
|
26149
26945
|
}
|
|
@@ -26162,7 +26958,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26162
26958
|
quickPrompts,
|
|
26163
26959
|
snapshot.status
|
|
26164
26960
|
]);
|
|
26165
|
-
const close =
|
|
26961
|
+
const close = useCallback43(() => {
|
|
26166
26962
|
modeRef.current = "closed";
|
|
26167
26963
|
setMode("closed");
|
|
26168
26964
|
setSelectedPrompt(null);
|
|
@@ -26171,7 +26967,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26171
26967
|
setMutationError(null);
|
|
26172
26968
|
setReorderError(null);
|
|
26173
26969
|
}, []);
|
|
26174
|
-
const closeDialog =
|
|
26970
|
+
const closeDialog = useCallback43(() => {
|
|
26175
26971
|
const nextMode = capabilityAvailable && !disabled ? "popover" : "closed";
|
|
26176
26972
|
modeRef.current = nextMode;
|
|
26177
26973
|
setMutationError(null);
|
|
@@ -26181,7 +26977,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26181
26977
|
setPromptToDelete(null);
|
|
26182
26978
|
setMode(nextMode);
|
|
26183
26979
|
}, [capabilityAvailable, disabled]);
|
|
26184
|
-
const setPopoverOpen =
|
|
26980
|
+
const setPopoverOpen = useCallback43(
|
|
26185
26981
|
(open) => {
|
|
26186
26982
|
if (open) {
|
|
26187
26983
|
openPopover();
|
|
@@ -26191,7 +26987,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26191
26987
|
},
|
|
26192
26988
|
[close, openPopover]
|
|
26193
26989
|
);
|
|
26194
|
-
const openCreate =
|
|
26990
|
+
const openCreate = useCallback43(
|
|
26195
26991
|
(draft) => {
|
|
26196
26992
|
if (isInteractionLocked) return;
|
|
26197
26993
|
modeRef.current = "create";
|
|
@@ -26202,7 +26998,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26202
26998
|
},
|
|
26203
26999
|
[isInteractionLocked]
|
|
26204
27000
|
);
|
|
26205
|
-
const openEdit =
|
|
27001
|
+
const openEdit = useCallback43(
|
|
26206
27002
|
(prompt) => {
|
|
26207
27003
|
if (isInteractionLocked) return;
|
|
26208
27004
|
modeRef.current = "edit";
|
|
@@ -26213,7 +27009,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26213
27009
|
},
|
|
26214
27010
|
[isInteractionLocked]
|
|
26215
27011
|
);
|
|
26216
|
-
const deletePrompt =
|
|
27012
|
+
const deletePrompt = useCallback43(
|
|
26217
27013
|
(prompt) => {
|
|
26218
27014
|
if (isInteractionLocked) return;
|
|
26219
27015
|
modeRef.current = "delete";
|
|
@@ -26223,7 +27019,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26223
27019
|
},
|
|
26224
27020
|
[isInteractionLocked]
|
|
26225
27021
|
);
|
|
26226
|
-
const saveDraft =
|
|
27022
|
+
const saveDraft = useCallback43(
|
|
26227
27023
|
async (draft) => {
|
|
26228
27024
|
if (!quickPrompts || !capabilityAvailable || isInteractionLocked) {
|
|
26229
27025
|
return false;
|
|
@@ -26262,7 +27058,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26262
27058
|
},
|
|
26263
27059
|
[capabilityAvailable, isInteractionLocked, quickPrompts, selectedPrompt]
|
|
26264
27060
|
);
|
|
26265
|
-
const submitDelete =
|
|
27061
|
+
const submitDelete = useCallback43(async () => {
|
|
26266
27062
|
if (!quickPrompts || !capabilityAvailable || !promptToDelete || isInteractionLocked) {
|
|
26267
27063
|
return false;
|
|
26268
27064
|
}
|
|
@@ -26295,14 +27091,14 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26295
27091
|
setIsDeleting(false);
|
|
26296
27092
|
}
|
|
26297
27093
|
}, [capabilityAvailable, isInteractionLocked, promptToDelete, quickPrompts]);
|
|
26298
|
-
const retry =
|
|
27094
|
+
const retry = useCallback43(() => {
|
|
26299
27095
|
if (!quickPrompts || !capabilityAvailable || isInteractionLocked) {
|
|
26300
27096
|
return;
|
|
26301
27097
|
}
|
|
26302
27098
|
setReorderError(null);
|
|
26303
27099
|
void quickPrompts.ensureLoaded({ force: true }).catch(() => void 0);
|
|
26304
27100
|
}, [capabilityAvailable, isInteractionLocked, quickPrompts]);
|
|
26305
|
-
const reorderPrompts =
|
|
27101
|
+
const reorderPrompts = useCallback43(
|
|
26306
27102
|
async (promptId, beforePromptId) => {
|
|
26307
27103
|
if (!quickPrompts?.move || !canReorder) return false;
|
|
26308
27104
|
const prompt = snapshot.prompts.find((item) => item.id === promptId);
|
|
@@ -26325,7 +27121,7 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26325
27121
|
},
|
|
26326
27122
|
[canReorder, quickPrompts, snapshot.prompts]
|
|
26327
27123
|
);
|
|
26328
|
-
const insertPromptContent =
|
|
27124
|
+
const insertPromptContent = useCallback43(
|
|
26329
27125
|
(content) => {
|
|
26330
27126
|
if (disabled || !capabilityAvailable || isInteractionLocked) {
|
|
26331
27127
|
return;
|
|
@@ -26335,14 +27131,14 @@ function useAgentQuickPromptLibrary(input) {
|
|
|
26335
27131
|
},
|
|
26336
27132
|
[capabilityAvailable, close, disabled, isInteractionLocked, onInsertPrompt]
|
|
26337
27133
|
);
|
|
26338
|
-
const updateSearchQuery =
|
|
27134
|
+
const updateSearchQuery = useCallback43(
|
|
26339
27135
|
(query) => {
|
|
26340
27136
|
if (isInteractionLocked) return;
|
|
26341
27137
|
setSearchQuery(query);
|
|
26342
27138
|
},
|
|
26343
27139
|
[isInteractionLocked]
|
|
26344
27140
|
);
|
|
26345
|
-
const selectPrompt =
|
|
27141
|
+
const selectPrompt = useCallback43(
|
|
26346
27142
|
(prompt) => {
|
|
26347
27143
|
insertPromptContent(prompt.content);
|
|
26348
27144
|
},
|
|
@@ -26798,7 +27594,7 @@ function AgentComposer(props) {
|
|
|
26798
27594
|
onLinkAction
|
|
26799
27595
|
});
|
|
26800
27596
|
const { addDraftFiles, addDraftImages } = attachments;
|
|
26801
|
-
const addExternalPromptEntries =
|
|
27597
|
+
const addExternalPromptEntries = useCallback44(
|
|
26802
27598
|
(files) => {
|
|
26803
27599
|
const entries = resolveAgentExternalPromptEntries(
|
|
26804
27600
|
files,
|
|
@@ -26837,11 +27633,11 @@ function AgentComposer(props) {
|
|
|
26837
27633
|
defaultHandoffMenuLabel: labels.handoffConversationMenu
|
|
26838
27634
|
});
|
|
26839
27635
|
const { inputDisabled, isHeroLayout } = providerState;
|
|
26840
|
-
const closeQuickPromptCompetingDisclosure =
|
|
27636
|
+
const closeQuickPromptCompetingDisclosure = useCallback44(() => {
|
|
26841
27637
|
mentionActions.closeFileMentionPalette();
|
|
26842
27638
|
slashActions.closeSlashFloatingMenu();
|
|
26843
27639
|
}, [mentionActions, slashActions]);
|
|
26844
|
-
const insertQuickPrompt =
|
|
27640
|
+
const insertQuickPrompt = useCallback44((content) => {
|
|
26845
27641
|
editorHandleRef.current?.insertPlainTextAtSelection(content);
|
|
26846
27642
|
}, []);
|
|
26847
27643
|
const quickPromptLibrary = useAgentQuickPromptLibrary({
|
|
@@ -27343,9 +28139,9 @@ import {
|
|
|
27343
28139
|
// shared/agentEnv/agentTargetSetupController.tsx
|
|
27344
28140
|
import {
|
|
27345
28141
|
createContext,
|
|
27346
|
-
useCallback as
|
|
28142
|
+
useCallback as useCallback45,
|
|
27347
28143
|
useContext,
|
|
27348
|
-
useMemo as
|
|
28144
|
+
useMemo as useMemo33,
|
|
27349
28145
|
useRef as useRef40
|
|
27350
28146
|
} from "react";
|
|
27351
28147
|
import { toast as toast2 } from "@tutti-os/ui-system";
|
|
@@ -27403,7 +28199,7 @@ function useCreateAgentTargetSetupController(agentTarget) {
|
|
|
27403
28199
|
const { t } = useTranslation();
|
|
27404
28200
|
const agentTargetId = agentTarget?.agentTargetId?.trim() || agentTarget?.targetId.trim() || "";
|
|
27405
28201
|
const enabled = agentTarget?.ref.setupKind === "target_runtime" && Boolean(hostApi?.agentTargetSetup && agentTargetId);
|
|
27406
|
-
const stableAgentTarget =
|
|
28202
|
+
const stableAgentTarget = useMemo33(
|
|
27407
28203
|
() => agentTarget,
|
|
27408
28204
|
[
|
|
27409
28205
|
agentTargetId,
|
|
@@ -27412,11 +28208,11 @@ function useCreateAgentTargetSetupController(agentTarget) {
|
|
|
27412
28208
|
agentTarget?.ref.setupKind
|
|
27413
28209
|
]
|
|
27414
28210
|
);
|
|
27415
|
-
const watch =
|
|
28211
|
+
const watch = useMemo33(
|
|
27416
28212
|
() => enabled ? hostApi?.agentTargetSetup?.watch({ agentTargetId }) ?? null : null,
|
|
27417
28213
|
[agentTargetId, enabled, hostApi?.agentTargetSetup]
|
|
27418
28214
|
);
|
|
27419
|
-
const showNotification =
|
|
28215
|
+
const showNotification = useCallback45(
|
|
27420
28216
|
(notification) => showTargetSetupFailureNotification({
|
|
27421
28217
|
hostToast: hostApi?.toast,
|
|
27422
28218
|
notification,
|
|
@@ -27424,7 +28220,7 @@ function useCreateAgentTargetSetupController(agentTarget) {
|
|
|
27424
28220
|
}),
|
|
27425
28221
|
[hostApi?.toast, t]
|
|
27426
28222
|
);
|
|
27427
|
-
const logCommandError =
|
|
28223
|
+
const logCommandError = useCallback45(
|
|
27428
28224
|
(command, error) => {
|
|
27429
28225
|
hostApi?.debug?.logRuntimeDiagnostics({
|
|
27430
28226
|
agentTargetId,
|
|
@@ -27436,7 +28232,7 @@ function useCreateAgentTargetSetupController(agentTarget) {
|
|
|
27436
28232
|
);
|
|
27437
28233
|
const controllerRef = useRef40(null);
|
|
27438
28234
|
const targetKey = enabled ? agentTargetId : "";
|
|
27439
|
-
const controllerEntry =
|
|
28235
|
+
const controllerEntry = useMemo33(() => {
|
|
27440
28236
|
const previousState = controllerRef.current?.targetKey === targetKey ? controllerRef.current.controller.getSnapshot() : null;
|
|
27441
28237
|
return {
|
|
27442
28238
|
controller: createAgentTargetSetupController({
|
|
@@ -27921,7 +28717,7 @@ var AgentGUIEmptyHomePane = memo3(function AgentGUIEmptyHomePane2({
|
|
|
27921
28717
|
}).fullLabel : runtimeProviderLabel;
|
|
27922
28718
|
const baseLabel = labels.emptyForProvider?.(provider) ?? labels.empty;
|
|
27923
28719
|
const emptyLabel = runtimeProviderLabel ? baseLabel.replace(runtimeProviderLabel, providerLabel) : baseLabel;
|
|
27924
|
-
const avatarPresentations =
|
|
28720
|
+
const avatarPresentations = useMemo34(
|
|
27925
28721
|
() => agentTargets.length ? agentTargets.map(projectAgentGUIAgentTargetAvatar) : selectedAgentTarget ? [projectAgentGUIAgentTargetAvatar(selectedAgentTarget)] : [
|
|
27926
28722
|
createFallbackAgentGUIAgentAvatar({
|
|
27927
28723
|
provider,
|
|
@@ -28872,7 +29668,7 @@ function AgentGUIProviderManagerDialog({
|
|
|
28872
29668
|
}
|
|
28873
29669
|
|
|
28874
29670
|
// agent-gui/agentGuiNode/view/useAgentGUIProviderRailPreferences.ts
|
|
28875
|
-
import { useCallback as
|
|
29671
|
+
import { useCallback as useCallback46, useEffect as useEffect29, useState as useState29 } from "react";
|
|
28876
29672
|
function readAgentGUIProviderRailPreferences(storageKey) {
|
|
28877
29673
|
return parseAgentGUIProviderRailPreferences(
|
|
28878
29674
|
globalThis.localStorage?.getItem(storageKey)
|
|
@@ -28905,7 +29701,7 @@ function useAgentGUIProviderRailPreferences() {
|
|
|
28905
29701
|
);
|
|
28906
29702
|
};
|
|
28907
29703
|
}, [storageKey]);
|
|
28908
|
-
const persistPreferences =
|
|
29704
|
+
const persistPreferences = useCallback46(
|
|
28909
29705
|
(nextPreferences) => {
|
|
28910
29706
|
setPreferences(nextPreferences);
|
|
28911
29707
|
globalThis.localStorage?.setItem(
|
|
@@ -29015,14 +29811,14 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29015
29811
|
} = useAgentGUIProviderRailPreferences();
|
|
29016
29812
|
const [dragState, setDragState] = useState30(null);
|
|
29017
29813
|
const dragStateRef = useRef42(null);
|
|
29018
|
-
const setProviderRailDragState =
|
|
29814
|
+
const setProviderRailDragState = useCallback47(
|
|
29019
29815
|
(nextDragState) => {
|
|
29020
29816
|
dragStateRef.current = nextDragState;
|
|
29021
29817
|
setDragState(nextDragState);
|
|
29022
29818
|
},
|
|
29023
29819
|
[]
|
|
29024
29820
|
);
|
|
29025
|
-
const railProviderTargets =
|
|
29821
|
+
const railProviderTargets = useMemo35(
|
|
29026
29822
|
() => agentGUIProviderRailTargets(
|
|
29027
29823
|
agentTargets,
|
|
29028
29824
|
agentTargetsLoading,
|
|
@@ -29031,7 +29827,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29031
29827
|
),
|
|
29032
29828
|
[comingSoonProviders, providerRailMode, agentTargets, agentTargetsLoading]
|
|
29033
29829
|
);
|
|
29034
|
-
const providerTiles =
|
|
29830
|
+
const providerTiles = useMemo35(() => {
|
|
29035
29831
|
const targets = [...railProviderTargets];
|
|
29036
29832
|
const orderedTargets = providerRailMode === "exact" ? targets : (() => {
|
|
29037
29833
|
const originalIndexByTarget = /* @__PURE__ */ new Map();
|
|
@@ -29071,7 +29867,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29071
29867
|
agentTargets: providerTiles,
|
|
29072
29868
|
conversations
|
|
29073
29869
|
});
|
|
29074
|
-
const visibleProviderTiles =
|
|
29870
|
+
const visibleProviderTiles = useMemo35(
|
|
29075
29871
|
() => applyAgentGUIProviderRailVisibility(
|
|
29076
29872
|
providerTiles,
|
|
29077
29873
|
effectiveHiddenTargetIds
|
|
@@ -29079,11 +29875,11 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29079
29875
|
[effectiveHiddenTargetIds, providerTiles]
|
|
29080
29876
|
);
|
|
29081
29877
|
const allTileSelected = conversationFilter.kind === "all";
|
|
29082
|
-
const selectAllProviders =
|
|
29878
|
+
const selectAllProviders = useCallback47(() => {
|
|
29083
29879
|
onUpdateConversationFilter({ kind: "all" });
|
|
29084
29880
|
onRequestComposerFocus();
|
|
29085
29881
|
}, [onRequestComposerFocus, onUpdateConversationFilter]);
|
|
29086
|
-
const selectAgentTargetTile =
|
|
29882
|
+
const selectAgentTargetTile = useCallback47(
|
|
29087
29883
|
(target) => {
|
|
29088
29884
|
const agentTargetId = target.agentTargetId?.trim() ?? "";
|
|
29089
29885
|
if (!agentTargetId) {
|
|
@@ -29097,10 +29893,10 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29097
29893
|
},
|
|
29098
29894
|
[onRequestComposerFocus, onSelectConversationFilterTarget]
|
|
29099
29895
|
);
|
|
29100
|
-
const clearProviderRailDragState =
|
|
29896
|
+
const clearProviderRailDragState = useCallback47(() => {
|
|
29101
29897
|
setProviderRailDragState(null);
|
|
29102
29898
|
}, [setProviderRailDragState]);
|
|
29103
|
-
const handleProviderRailDragStart =
|
|
29899
|
+
const handleProviderRailDragStart = useCallback47(
|
|
29104
29900
|
(event, target) => {
|
|
29105
29901
|
if (previewMode || agentTargetsLoading) {
|
|
29106
29902
|
event.preventDefault();
|
|
@@ -29116,7 +29912,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29116
29912
|
},
|
|
29117
29913
|
[previewMode, agentTargetsLoading, setProviderRailDragState]
|
|
29118
29914
|
);
|
|
29119
|
-
const handleProviderRailDragOver =
|
|
29915
|
+
const handleProviderRailDragOver = useCallback47(
|
|
29120
29916
|
(event, target) => {
|
|
29121
29917
|
if (previewMode || agentTargetsLoading || !dragState) {
|
|
29122
29918
|
return;
|
|
@@ -29148,7 +29944,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29148
29944
|
},
|
|
29149
29945
|
[dragState, previewMode, agentTargetsLoading, setProviderRailDragState]
|
|
29150
29946
|
);
|
|
29151
|
-
const commitProviderRailDragDrop =
|
|
29947
|
+
const commitProviderRailDragDrop = useCallback47(
|
|
29152
29948
|
(event) => {
|
|
29153
29949
|
const fallbackDraggedTargetId = event.dataTransfer.getData("text/plain").trim();
|
|
29154
29950
|
const activeDragState = dragStateRef.current ?? dragState ?? (fallbackDraggedTargetId ? {
|
|
@@ -29277,7 +30073,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29277
30073
|
onUpdateConversationFilter({ kind: "all" });
|
|
29278
30074
|
}
|
|
29279
30075
|
};
|
|
29280
|
-
const handleProviderRailContainerDragOver =
|
|
30076
|
+
const handleProviderRailContainerDragOver = useCallback47(
|
|
29281
30077
|
(event) => {
|
|
29282
30078
|
const activeDragState = dragStateRef.current ?? dragState;
|
|
29283
30079
|
if (!activeDragState || previewMode || agentTargetsLoading) {
|
|
@@ -29490,7 +30286,7 @@ var AgentGUIProviderRail = memo4(function AgentGUIProviderRail2({
|
|
|
29490
30286
|
import { memo as memo9, useState as useState36 } from "react";
|
|
29491
30287
|
|
|
29492
30288
|
// agent-gui/agentGuiNode/view/AgentGUIConversationRailPane.tsx
|
|
29493
|
-
import { Fragment as Fragment19, memo as memo8, useEffect as useEffect30, useMemo as
|
|
30289
|
+
import { Fragment as Fragment19, memo as memo8, useEffect as useEffect30, useMemo as useMemo38, useRef as useRef45, useState as useState35 } from "react";
|
|
29494
30290
|
import { Button as SystemButton } from "@tutti-os/ui-system";
|
|
29495
30291
|
import { ScrollArea as ScrollArea2 } from "@tutti-os/ui-system/components";
|
|
29496
30292
|
import { CreateChatIcon as CreateChatIcon2 } from "@tutti-os/ui-system/icons";
|
|
@@ -30233,7 +31029,7 @@ function reduceAgentGUIConversationRailViewState(state, action) {
|
|
|
30233
31029
|
}
|
|
30234
31030
|
|
|
30235
31031
|
// agent-gui/agentGuiNode/controller/useAgentGUIProjectDrag.ts
|
|
30236
|
-
import { useCallback as
|
|
31032
|
+
import { useCallback as useCallback48, useState as useState31 } from "react";
|
|
30237
31033
|
var PROJECT_DRAG_SCROLL_EDGE_PX = 40;
|
|
30238
31034
|
function projectDragAutoScrollDelta(clientY, bounds) {
|
|
30239
31035
|
if (clientY < bounds.top + PROJECT_DRAG_SCROLL_EDGE_PX) {
|
|
@@ -30261,14 +31057,14 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30261
31057
|
image: null,
|
|
30262
31058
|
viewport: null
|
|
30263
31059
|
}));
|
|
30264
|
-
const stopAutoScroll =
|
|
31060
|
+
const stopAutoScroll = useCallback48(() => {
|
|
30265
31061
|
if (runtime.frame !== null) {
|
|
30266
31062
|
window.cancelAnimationFrame(runtime.frame);
|
|
30267
31063
|
runtime.frame = null;
|
|
30268
31064
|
}
|
|
30269
31065
|
runtime.clientY = null;
|
|
30270
31066
|
}, [runtime]);
|
|
30271
|
-
const clear =
|
|
31067
|
+
const clear = useCallback48(() => {
|
|
30272
31068
|
stopAutoScroll();
|
|
30273
31069
|
runtime.image?.remove();
|
|
30274
31070
|
runtime.image = null;
|
|
@@ -30277,7 +31073,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30277
31073
|
runtime.viewport = null;
|
|
30278
31074
|
setDragState(null);
|
|
30279
31075
|
}, [runtime, stopAutoScroll]);
|
|
30280
|
-
const runAutoScroll =
|
|
31076
|
+
const runAutoScroll = useCallback48(() => {
|
|
30281
31077
|
runtime.frame = null;
|
|
30282
31078
|
const viewport = runtime.viewport ?? input.scrollViewportRef.current;
|
|
30283
31079
|
if (!runtime.active || !viewport || runtime.clientY === null) return;
|
|
@@ -30288,7 +31084,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30288
31084
|
runtime.frame = window.requestAnimationFrame(runAutoScroll);
|
|
30289
31085
|
}
|
|
30290
31086
|
}, [input.scrollViewportRef, runtime]);
|
|
30291
|
-
const trackPosition =
|
|
31087
|
+
const trackPosition = useCallback48(
|
|
30292
31088
|
(clientY) => {
|
|
30293
31089
|
if (!runtime.active) return;
|
|
30294
31090
|
runtime.clientY = clientY;
|
|
@@ -30298,7 +31094,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30298
31094
|
},
|
|
30299
31095
|
[runAutoScroll, runtime]
|
|
30300
31096
|
);
|
|
30301
|
-
const start =
|
|
31097
|
+
const start = useCallback48(
|
|
30302
31098
|
(section, event) => {
|
|
30303
31099
|
const projectId = section.project?.id?.trim() ?? "";
|
|
30304
31100
|
if (input.disabled || isMovePending || !projectId) {
|
|
@@ -30339,7 +31135,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30339
31135
|
},
|
|
30340
31136
|
[input.disabled, isMovePending, runtime]
|
|
30341
31137
|
);
|
|
30342
|
-
const updateTarget =
|
|
31138
|
+
const updateTarget = useCallback48(
|
|
30343
31139
|
(section, edge, event) => {
|
|
30344
31140
|
const targetId = section.project?.id?.trim() ?? "";
|
|
30345
31141
|
const currentDragState = runtime.dragState;
|
|
@@ -30379,7 +31175,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30379
31175
|
},
|
|
30380
31176
|
[input.userProjects, runtime, trackPosition]
|
|
30381
31177
|
);
|
|
30382
|
-
const drop =
|
|
31178
|
+
const drop = useCallback48(
|
|
30383
31179
|
async (event) => {
|
|
30384
31180
|
const currentDragState = runtime.dragState;
|
|
30385
31181
|
if (!currentDragState || !runtime.active) return;
|
|
@@ -30399,7 +31195,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30399
31195
|
},
|
|
30400
31196
|
[clear, input.onMoveProject, runtime]
|
|
30401
31197
|
);
|
|
30402
|
-
const keepValidDropTarget =
|
|
31198
|
+
const keepValidDropTarget = useCallback48(
|
|
30403
31199
|
(event) => {
|
|
30404
31200
|
if (!runtime.active || !runtime.dragState?.canDrop) return;
|
|
30405
31201
|
event.preventDefault();
|
|
@@ -30407,7 +31203,7 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30407
31203
|
},
|
|
30408
31204
|
[runtime]
|
|
30409
31205
|
);
|
|
30410
|
-
const installGlobalListeners =
|
|
31206
|
+
const installGlobalListeners = useCallback48(() => {
|
|
30411
31207
|
const clearOnGlobalEnd = () => clear();
|
|
30412
31208
|
const trackGlobalPosition = (event) => trackPosition(event.clientY);
|
|
30413
31209
|
document.addEventListener("dragend", clearOnGlobalEnd, true);
|
|
@@ -30433,10 +31229,10 @@ function useAgentGUIProjectDrag(input) {
|
|
|
30433
31229
|
}
|
|
30434
31230
|
|
|
30435
31231
|
// agent-gui/agentGuiNode/view/AgentGUIConversationRailSection.tsx
|
|
30436
|
-
import { memo as memo7, useCallback as
|
|
31232
|
+
import { memo as memo7, useCallback as useCallback52 } from "react";
|
|
30437
31233
|
|
|
30438
31234
|
// agent-gui/agentGuiNode/view/AgentGUIConversationRailItem.tsx
|
|
30439
|
-
import { memo as memo5, useCallback as
|
|
31235
|
+
import { memo as memo5, useCallback as useCallback50, useMemo as useMemo37 } from "react";
|
|
30440
31236
|
import { ExternalLink as ExternalLink3 } from "lucide-react";
|
|
30441
31237
|
import { IssueIcon, NewWorkspaceLinedIcon as NewWorkspaceLinedIcon2, cn as cn7 } from "@tutti-os/ui-system";
|
|
30442
31238
|
import { WorkspaceUserProjectSelect as WorkspaceUserProjectSelect2 } from "@tutti-os/workspace-user-project/ui";
|
|
@@ -30673,8 +31469,8 @@ function AgentGUIConversationRailRelativeTime({
|
|
|
30673
31469
|
// agent-gui/agentGuiNode/view/AgentGUIConversationActionsMenu.tsx
|
|
30674
31470
|
import {
|
|
30675
31471
|
Fragment as Fragment16,
|
|
30676
|
-
useCallback as
|
|
30677
|
-
useMemo as
|
|
31472
|
+
useCallback as useCallback49,
|
|
31473
|
+
useMemo as useMemo36,
|
|
30678
31474
|
useRef as useRef43,
|
|
30679
31475
|
useState as useState32
|
|
30680
31476
|
} from "react";
|
|
@@ -30757,7 +31553,7 @@ async function readWorkspaceImageAsAttachment(readFile, input) {
|
|
|
30757
31553
|
}
|
|
30758
31554
|
function useAgentGUIClipboardWriter(labels) {
|
|
30759
31555
|
const agentHostApi = useOptionalAgentHostApi();
|
|
30760
|
-
return
|
|
31556
|
+
return useCallback49(
|
|
30761
31557
|
(value, toastHandle) => {
|
|
30762
31558
|
const payload = typeof value === "string" ? { text: value } : value;
|
|
30763
31559
|
const clipboard = agentHostApi?.clipboard;
|
|
@@ -30793,7 +31589,7 @@ function useAgentGUIConversationCopyAction(labels) {
|
|
|
30793
31589
|
const agentHostApi = useOptionalAgentHostApi();
|
|
30794
31590
|
const agentActivityRuntime = useOptionalAgentActivityRuntime();
|
|
30795
31591
|
const writeClipboardValue = useAgentGUIClipboardWriter(labels);
|
|
30796
|
-
return
|
|
31592
|
+
return useCallback49(
|
|
30797
31593
|
(action, { conversation, uiLanguage, workspaceId }) => {
|
|
30798
31594
|
if (action === "copy-reference") {
|
|
30799
31595
|
writeClipboardValue(
|
|
@@ -30888,7 +31684,7 @@ function useConversationActionGroups({
|
|
|
30888
31684
|
const copyConversationValue = useAgentGUIConversationCopyAction(labels);
|
|
30889
31685
|
const [resetKey, setResetKey] = useState32(0);
|
|
30890
31686
|
const pendingActionRef = useRef43(false);
|
|
30891
|
-
const run =
|
|
31687
|
+
const run = useCallback49(
|
|
30892
31688
|
(action) => {
|
|
30893
31689
|
if (pendingActionRef.current) {
|
|
30894
31690
|
return;
|
|
@@ -30904,7 +31700,7 @@ function useConversationActionGroups({
|
|
|
30904
31700
|
},
|
|
30905
31701
|
[isInteractionLocked]
|
|
30906
31702
|
);
|
|
30907
|
-
const groups =
|
|
31703
|
+
const groups = useMemo36(() => {
|
|
30908
31704
|
const clipboardUnavailable = typeof agentHostApi?.clipboard?.writeText !== "function";
|
|
30909
31705
|
const copyItem = (action, icon, label, disabled = false) => ({
|
|
30910
31706
|
// copy-reference builds the mention link synchronously from the
|
|
@@ -31137,13 +31933,13 @@ var AgentGUIConversationRailItem = memo5(
|
|
|
31137
31933
|
workspaceId,
|
|
31138
31934
|
agentTargets
|
|
31139
31935
|
);
|
|
31140
|
-
const setItemElement =
|
|
31936
|
+
const setItemElement = useCallback50(
|
|
31141
31937
|
(element) => {
|
|
31142
31938
|
registerItemElement(item.id, element);
|
|
31143
31939
|
},
|
|
31144
31940
|
[item.id, registerItemElement]
|
|
31145
31941
|
);
|
|
31146
|
-
const handleMouseLeave =
|
|
31942
|
+
const handleMouseLeave = useCallback50(() => {
|
|
31147
31943
|
if (isPendingDeleteConversation && !isRailInteractionLocked()) {
|
|
31148
31944
|
onCancelDeleteConversation();
|
|
31149
31945
|
}
|
|
@@ -31364,7 +32160,7 @@ function AgentGUIProjectRailHeader({
|
|
|
31364
32160
|
}) {
|
|
31365
32161
|
"use memo";
|
|
31366
32162
|
const agentHostApi = useAgentHostApi();
|
|
31367
|
-
const userProjectApi =
|
|
32163
|
+
const userProjectApi = useMemo37(
|
|
31368
32164
|
() => createAgentGUIUserProjectSelectionApi({
|
|
31369
32165
|
selectProjectDirectory,
|
|
31370
32166
|
userProjects: agentHostApi.userProjects
|
|
@@ -31435,7 +32231,7 @@ function AgentGUIProjectRailHeader({
|
|
|
31435
32231
|
}
|
|
31436
32232
|
|
|
31437
32233
|
// agent-gui/agentGuiNode/view/AgentGUIConversationRailSectionHeader.tsx
|
|
31438
|
-
import { forwardRef as forwardRef5, memo as memo6, useCallback as
|
|
32234
|
+
import { forwardRef as forwardRef5, memo as memo6, useCallback as useCallback51, useState as useState33 } from "react";
|
|
31439
32235
|
import { ChevronRight as ChevronRight2 } from "lucide-react";
|
|
31440
32236
|
import {
|
|
31441
32237
|
DropdownMenu as DropdownMenu5,
|
|
@@ -31847,7 +32643,7 @@ var AgentGUIConversationRailSectionHeader = memo6(
|
|
|
31847
32643
|
"use memo";
|
|
31848
32644
|
const [projectMenuOpen, setProjectMenuOpen] = useState33(false);
|
|
31849
32645
|
const [conversationMenuOpen, setConversationMenuOpen] = useState33(false);
|
|
31850
|
-
const handleProjectMenuOpenChange =
|
|
32646
|
+
const handleProjectMenuOpenChange = useCallback51(
|
|
31851
32647
|
(open) => {
|
|
31852
32648
|
setProjectMenuOpen(open);
|
|
31853
32649
|
onProjectMenuOpenChange(open);
|
|
@@ -31999,7 +32795,7 @@ var AgentGUIConversationRailSection = memo7(
|
|
|
31999
32795
|
const visibleCountTowardTotal = visiblePageableIds.size + (activeConversationCountsTowardTotal && activeConversation && visibleItems.some((item) => item.id === activeConversation.id) && !visiblePageableIds.has(activeConversation.id) ? 1 : 0);
|
|
32000
32796
|
const canShowMore = !isSectionCollapsed && visibleCountTowardTotal < sectionTotalCount && (visibleItemCount < pageableItems.length || sectionHasMore);
|
|
32001
32797
|
const canShowLess = !isSectionCollapsed && visibleItemCount > AGENT_GUI_CONVERSATION_RAIL_SECTION_PAGE_SIZE;
|
|
32002
|
-
const showMoreConversations =
|
|
32798
|
+
const showMoreConversations = useCallback52(() => {
|
|
32003
32799
|
if (isRailInteractionLocked()) return;
|
|
32004
32800
|
if (visibleItemCount >= pageableItems.length && sectionHasMore) {
|
|
32005
32801
|
onLoadMoreConversations(section);
|
|
@@ -32026,7 +32822,7 @@ var AgentGUIConversationRailSection = memo7(
|
|
|
32026
32822
|
visibleItemCount,
|
|
32027
32823
|
visibleItemLimit
|
|
32028
32824
|
]);
|
|
32029
|
-
const showLessConversations =
|
|
32825
|
+
const showLessConversations = useCallback52(() => {
|
|
32030
32826
|
if (isRailInteractionLocked()) return;
|
|
32031
32827
|
onVisibleItemLimitChange(
|
|
32032
32828
|
section.id,
|
|
@@ -32238,7 +33034,7 @@ function AgentGUIProjectActionConfirmationDialog(props) {
|
|
|
32238
33034
|
}
|
|
32239
33035
|
|
|
32240
33036
|
// agent-gui/agentGuiNode/view/useAgentGUIConversationRailViewState.ts
|
|
32241
|
-
import { useCallback as
|
|
33037
|
+
import { useCallback as useCallback53, useLayoutEffect as useLayoutEffect6, useReducer, useRef as useRef44 } from "react";
|
|
32242
33038
|
function applyRailScrollNavigation(input) {
|
|
32243
33039
|
const activeConversationId = input.activeConversationId?.trim() || null;
|
|
32244
33040
|
const current = input.current.navigationKey === input.navigationKey ? input.current : {
|
|
@@ -32338,7 +33134,7 @@ function useAgentGUIConversationRailViewState(input) {
|
|
|
32338
33134
|
navigationKey,
|
|
32339
33135
|
searchActive
|
|
32340
33136
|
]);
|
|
32341
|
-
const registerConversationItemElement =
|
|
33137
|
+
const registerConversationItemElement = useCallback53(
|
|
32342
33138
|
(itemId, element) => {
|
|
32343
33139
|
if (element) {
|
|
32344
33140
|
conversationItemElementsRef.current.set(itemId, element);
|
|
@@ -32378,14 +33174,14 @@ function useAgentGUIConversationRailViewState(input) {
|
|
|
32378
33174
|
}
|
|
32379
33175
|
|
|
32380
33176
|
// agent-gui/agentGuiNode/view/useAgentGUIProjectMenuState.ts
|
|
32381
|
-
import { useCallback as
|
|
33177
|
+
import { useCallback as useCallback54, useState as useState34 } from "react";
|
|
32382
33178
|
function useAgentGUIProjectMenuState(isRailInteractionLocked, isUserProjectMutationPending) {
|
|
32383
33179
|
const [openSectionId, setOpenSectionId] = useState34(null);
|
|
32384
|
-
const isProjectActionLocked =
|
|
33180
|
+
const isProjectActionLocked = useCallback54(
|
|
32385
33181
|
() => isRailInteractionLocked() || isUserProjectMutationPending,
|
|
32386
33182
|
[isRailInteractionLocked, isUserProjectMutationPending]
|
|
32387
33183
|
);
|
|
32388
|
-
const onProjectMenuOpenChange =
|
|
33184
|
+
const onProjectMenuOpenChange = useCallback54(
|
|
32389
33185
|
(sectionId, open) => {
|
|
32390
33186
|
setOpenSectionId(
|
|
32391
33187
|
(current) => open ? sectionId : current === sectionId ? null : current
|
|
@@ -32530,7 +33326,7 @@ var AgentGUIConversationRailPane = memo8(
|
|
|
32530
33326
|
userProjects
|
|
32531
33327
|
});
|
|
32532
33328
|
const railActiveOverlay = runtimeDisplayProjection.activeOverlay;
|
|
32533
|
-
const displayConversations =
|
|
33329
|
+
const displayConversations = useMemo38(() => {
|
|
32534
33330
|
if (backendSearchActive) {
|
|
32535
33331
|
return backendSearchConversations;
|
|
32536
33332
|
}
|
|
@@ -32551,7 +33347,7 @@ var AgentGUIConversationRailPane = memo8(
|
|
|
32551
33347
|
runtimeRailSections,
|
|
32552
33348
|
runtimeSectionsEnabled
|
|
32553
33349
|
]);
|
|
32554
|
-
const filteredConversationResult =
|
|
33350
|
+
const filteredConversationResult = useMemo38(() => {
|
|
32555
33351
|
const startedAtMs = agentGuiPerfNowMs();
|
|
32556
33352
|
const query = conversationQuery.trim().toLowerCase();
|
|
32557
33353
|
const items = backendSearchActive ? displayConversations : !query ? displayConversations : displayConversations.filter(
|
|
@@ -32569,7 +33365,7 @@ var AgentGUIConversationRailPane = memo8(
|
|
|
32569
33365
|
uiLanguage
|
|
32570
33366
|
]);
|
|
32571
33367
|
const filteredConversations = filteredConversationResult.items;
|
|
32572
|
-
const groupedConversationResult =
|
|
33368
|
+
const groupedConversationResult = useMemo38(() => {
|
|
32573
33369
|
const startedAtMs = agentGuiPerfNowMs();
|
|
32574
33370
|
const query = conversationQuery.trim();
|
|
32575
33371
|
const rawGroups = backendSearchActive ? projectConversationRailSearchSections({
|
|
@@ -32622,7 +33418,7 @@ var AgentGUIConversationRailPane = memo8(
|
|
|
32622
33418
|
sectionAgentTargetFallbackId,
|
|
32623
33419
|
workspaceId
|
|
32624
33420
|
});
|
|
32625
|
-
const groupedConversationIdentityKey =
|
|
33421
|
+
const groupedConversationIdentityKey = useMemo38(
|
|
32626
33422
|
() => `${groupedConversations.map(
|
|
32627
33423
|
(section) => `${section.id}:${section.items.map((item) => item.id).join(",")}`
|
|
32628
33424
|
).join("|")}|active:${railActiveOverlay?.conversation.id ?? ""}`,
|
|
@@ -32894,7 +33690,7 @@ var AgentGUIConversationRailPane = memo8(
|
|
|
32894
33690
|
);
|
|
32895
33691
|
|
|
32896
33692
|
// agent-gui/agentGuiNode/controller/useAgentGUIConversationRailQuery.ts
|
|
32897
|
-
import { useEffect as useEffect31, useMemo as
|
|
33693
|
+
import { useEffect as useEffect31, useMemo as useMemo39, useRef as useRef46 } from "react";
|
|
32898
33694
|
|
|
32899
33695
|
// agent-gui/agentGuiNode/controller/agentGuiConversationRailDiagnostics.ts
|
|
32900
33696
|
var CONVERSATION_RAIL_SLOW_DIAGNOSTIC_THRESHOLD_MS = 250;
|
|
@@ -33047,7 +33843,7 @@ function projectConversationRailMembershipRecords(state) {
|
|
|
33047
33843
|
id: record.agentSessionId,
|
|
33048
33844
|
pinnedAtUnixMs: null,
|
|
33049
33845
|
projectionSource: "pending_activation",
|
|
33050
|
-
railSectionKey: null,
|
|
33846
|
+
railSectionKey: record.railSectionKey?.trim() || null,
|
|
33051
33847
|
title: record.title ?? ""
|
|
33052
33848
|
}))
|
|
33053
33849
|
];
|
|
@@ -34011,13 +34807,13 @@ function useAgentGUIConversationRailQuery({
|
|
|
34011
34807
|
workspaceId
|
|
34012
34808
|
}) {
|
|
34013
34809
|
const runtime = useAgentActivityRuntime();
|
|
34014
|
-
const engine =
|
|
34810
|
+
const engine = useMemo39(
|
|
34015
34811
|
() => runtime.getSessionEngine(workspaceId),
|
|
34016
34812
|
[runtime, workspaceId]
|
|
34017
34813
|
);
|
|
34018
34814
|
const activeConversationIdRef = useRef46(activeConversationId);
|
|
34019
34815
|
activeConversationIdRef.current = activeConversationId;
|
|
34020
|
-
const controller =
|
|
34816
|
+
const controller = useMemo39(
|
|
34021
34817
|
() => new AgentGUIConversationRailQueryController({
|
|
34022
34818
|
engine,
|
|
34023
34819
|
getActiveConversationId: () => activeConversationIdRef.current,
|
|
@@ -34055,7 +34851,7 @@ function useAgentGUIConversationRailQuery({
|
|
|
34055
34851
|
identitySnapshot,
|
|
34056
34852
|
Object.is
|
|
34057
34853
|
);
|
|
34058
|
-
const requestedRailScopeKey =
|
|
34854
|
+
const requestedRailScopeKey = useMemo39(
|
|
34059
34855
|
() => resolveConversationRailQueryScope(workspaceId, {
|
|
34060
34856
|
conversationFilter,
|
|
34061
34857
|
previewMode,
|
|
@@ -34070,7 +34866,7 @@ function useAgentGUIConversationRailQuery({
|
|
|
34070
34866
|
workspaceId
|
|
34071
34867
|
]
|
|
34072
34868
|
);
|
|
34073
|
-
return
|
|
34869
|
+
return useMemo39(
|
|
34074
34870
|
() => ({
|
|
34075
34871
|
...querySnapshot,
|
|
34076
34872
|
isInteractionLocked: controller.isInteractionLocked,
|
|
@@ -34120,9 +34916,9 @@ var AgentGUIConversationRailController = memo9(
|
|
|
34120
34916
|
// agent-gui/agentGuiNode/view/AgentGUIDetailPane.tsx
|
|
34121
34917
|
import {
|
|
34122
34918
|
memo as memo12,
|
|
34123
|
-
useCallback as
|
|
34919
|
+
useCallback as useCallback56,
|
|
34124
34920
|
useEffect as useEffect34,
|
|
34125
|
-
useMemo as
|
|
34921
|
+
useMemo as useMemo41,
|
|
34126
34922
|
useRef as useRef49,
|
|
34127
34923
|
useState as useState41
|
|
34128
34924
|
} from "react";
|
|
@@ -34746,7 +35542,7 @@ function setTimelineScrollTopWithUserTransition(element, top) {
|
|
|
34746
35542
|
|
|
34747
35543
|
// agent-gui/agentGuiNode/view/useAgentGUIDetailScroll.ts
|
|
34748
35544
|
import {
|
|
34749
|
-
useCallback as
|
|
35545
|
+
useCallback as useCallback55,
|
|
34750
35546
|
useEffect as useEffect33,
|
|
34751
35547
|
useLayoutEffect as useLayoutEffect7,
|
|
34752
35548
|
useRef as useRef48,
|
|
@@ -35090,7 +35886,7 @@ function useAgentGUIDetailScroll(input) {
|
|
|
35090
35886
|
viewModel.detail.hasOlderMessages,
|
|
35091
35887
|
viewModel.detail.isLoadingOlderMessages
|
|
35092
35888
|
]);
|
|
35093
|
-
const scrollTimelineToBottom =
|
|
35889
|
+
const scrollTimelineToBottom = useCallback55(() => {
|
|
35094
35890
|
const timeline = timelineRef.current;
|
|
35095
35891
|
const activeConversationId = timelineConversationId;
|
|
35096
35892
|
if (!timeline || !activeConversationId) {
|
|
@@ -35125,7 +35921,7 @@ function useAgentGUIDetailScroll(input) {
|
|
|
35125
35921
|
}
|
|
35126
35922
|
|
|
35127
35923
|
// agent-gui/agentGuiNode/view/useAgentGUIDetailModel.tsx
|
|
35128
|
-
import { useMemo as
|
|
35924
|
+
import { useMemo as useMemo40 } from "react";
|
|
35129
35925
|
|
|
35130
35926
|
// app/renderer/components/icons/UnavailableChatIcon.tsx
|
|
35131
35927
|
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
@@ -35219,11 +36015,11 @@ function useAgentGUIDetailModel(input) {
|
|
|
35219
36015
|
const emptyProviderReadinessGate = !hasActiveConversation ? selectedAgentTargetComingSoon ? { status: "coming_soon" } : viewModel.readiness.providerReadinessGate : null;
|
|
35220
36016
|
const activePrompt = viewModel.interaction.pendingInteractivePrompt ?? viewModel.interaction.pendingApproval;
|
|
35221
36017
|
const activePromptRequestId = activePrompt?.requestId ?? null;
|
|
35222
|
-
const sessionChrome =
|
|
36018
|
+
const sessionChrome = useMemo40(
|
|
35223
36019
|
() => ({ ...viewModel.interaction.sessionChrome, approval: null }),
|
|
35224
36020
|
[viewModel.interaction.sessionChrome]
|
|
35225
36021
|
);
|
|
35226
|
-
const rawSlashStatus =
|
|
36022
|
+
const rawSlashStatus = useMemo40(
|
|
35227
36023
|
() => resolveSlashStatus({
|
|
35228
36024
|
rawState: viewModel.interaction.sessionChrome.rawState,
|
|
35229
36025
|
limits: slashStatusLimits,
|
|
@@ -35240,7 +36036,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35240
36036
|
]
|
|
35241
36037
|
);
|
|
35242
36038
|
const slashStatus = useStableSlashStatus(rawSlashStatus);
|
|
35243
|
-
const displayedInlineNotice =
|
|
36039
|
+
const displayedInlineNotice = useMemo40(() => {
|
|
35244
36040
|
const inlineNotice = viewModel.interaction.inlineNotice;
|
|
35245
36041
|
const inlineNoticeMessage = inlineNotice?.message.trim() ?? "";
|
|
35246
36042
|
if (!inlineNotice || inlineNoticeMessage === "") {
|
|
@@ -35264,7 +36060,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35264
36060
|
viewModel.readiness.activeLiveState,
|
|
35265
36061
|
viewModel.interaction.inlineNotice
|
|
35266
36062
|
]);
|
|
35267
|
-
const inlineNoticeChrome =
|
|
36063
|
+
const inlineNoticeChrome = useMemo40(() => {
|
|
35268
36064
|
if (!displayedInlineNotice) {
|
|
35269
36065
|
return null;
|
|
35270
36066
|
}
|
|
@@ -35316,7 +36112,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35316
36112
|
isSubmitting: viewModel.composer.isSubmitting,
|
|
35317
36113
|
isUnavailable: viewModel.readiness.activeLiveState === "failed" || viewModel.readiness.sessionRuntimeBlocked
|
|
35318
36114
|
});
|
|
35319
|
-
const conversationFlowLabels =
|
|
36115
|
+
const conversationFlowLabels = useMemo40(
|
|
35320
36116
|
() => ({
|
|
35321
36117
|
thinkingLabel: labels.thinkingLabel,
|
|
35322
36118
|
toolCallsLabel: labels.toolCallsLabel,
|
|
@@ -35332,7 +36128,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35332
36128
|
labels.userMessageLocator
|
|
35333
36129
|
]
|
|
35334
36130
|
);
|
|
35335
|
-
const conversationFlowEmpty =
|
|
36131
|
+
const conversationFlowEmpty = useMemo40(
|
|
35336
36132
|
() => showUnavailableChatEmpty ? /* @__PURE__ */ jsxs50(
|
|
35337
36133
|
"div",
|
|
35338
36134
|
{
|
|
@@ -35346,7 +36142,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35346
36142
|
) : /* @__PURE__ */ jsx71(Fragment21, {}),
|
|
35347
36143
|
[labels.conversationUnavailable, showUnavailableChatEmpty]
|
|
35348
36144
|
);
|
|
35349
|
-
const chromeLabels =
|
|
36145
|
+
const chromeLabels = useMemo40(
|
|
35350
36146
|
() => ({
|
|
35351
36147
|
approvalRequired: labels.approvalRequired,
|
|
35352
36148
|
authRequired: labels.authRequired,
|
|
@@ -35367,7 +36163,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35367
36163
|
viewModel.composer.isCancelPending
|
|
35368
36164
|
]
|
|
35369
36165
|
);
|
|
35370
|
-
const goalBannerLabels =
|
|
36166
|
+
const goalBannerLabels = useMemo40(
|
|
35371
36167
|
() => ({
|
|
35372
36168
|
titleActive: labels.goalTitleActive,
|
|
35373
36169
|
titlePaused: labels.goalTitlePaused,
|
|
@@ -35397,7 +36193,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35397
36193
|
labels.goalClearAction
|
|
35398
36194
|
]
|
|
35399
36195
|
);
|
|
35400
|
-
const interactivePromptLabels =
|
|
36196
|
+
const interactivePromptLabels = useMemo40(
|
|
35401
36197
|
() => ({
|
|
35402
36198
|
approvalLead: labels.approvalRequired,
|
|
35403
36199
|
fileChangeApprovalLead: labels.fileChangeApprovalRequired,
|
|
@@ -35437,7 +36233,7 @@ function useAgentGUIDetailModel(input) {
|
|
|
35437
36233
|
labels.planImplementationSkip
|
|
35438
36234
|
]
|
|
35439
36235
|
);
|
|
35440
|
-
const composerLabels =
|
|
36236
|
+
const composerLabels = useMemo40(
|
|
35441
36237
|
() => ({
|
|
35442
36238
|
send: labels.send,
|
|
35443
36239
|
modelLabel: labels.modelLabel,
|
|
@@ -35534,6 +36330,13 @@ function useAgentGUIDetailModel(input) {
|
|
|
35534
36330
|
slashStatusContextValue: labels.slashStatusContextValue,
|
|
35535
36331
|
slashStatusContextUnavailable: labels.slashStatusContextUnavailable,
|
|
35536
36332
|
slashStatusLimitsUnavailable: labels.slashStatusLimitsUnavailable,
|
|
36333
|
+
slashStatusEmptyValue: labels.slashStatusEmptyValue,
|
|
36334
|
+
slashStatusUsageJustUpdated: labels.slashStatusUsageJustUpdated,
|
|
36335
|
+
slashStatusUsageMinutesAgo: labels.slashStatusUsageMinutesAgo,
|
|
36336
|
+
slashStatusUsageHoursAgo: labels.slashStatusUsageHoursAgo,
|
|
36337
|
+
slashStatusUsageUpdating: labels.slashStatusUsageUpdating,
|
|
36338
|
+
slashStatusUsageRefreshFailed: labels.slashStatusUsageRefreshFailed,
|
|
36339
|
+
slashStatusUsageRefreshAria: labels.slashStatusUsageRefreshAria,
|
|
35537
36340
|
usageChipLabel: labels.usageChipLabel,
|
|
35538
36341
|
usageTooltipLabel: labels.usageTooltipLabel,
|
|
35539
36342
|
usagePopoverTitle: labels.usagePopoverTitle,
|
|
@@ -35678,6 +36481,13 @@ function useAgentGUIDetailModel(input) {
|
|
|
35678
36481
|
labels.slashStatusBaseUrl,
|
|
35679
36482
|
labels.slashStatusLimits,
|
|
35680
36483
|
labels.slashStatusLimitsUnavailable,
|
|
36484
|
+
labels.slashStatusEmptyValue,
|
|
36485
|
+
labels.slashStatusUsageHoursAgo,
|
|
36486
|
+
labels.slashStatusUsageJustUpdated,
|
|
36487
|
+
labels.slashStatusUsageMinutesAgo,
|
|
36488
|
+
labels.slashStatusUsageRefreshAria,
|
|
36489
|
+
labels.slashStatusUsageRefreshFailed,
|
|
36490
|
+
labels.slashStatusUsageUpdating,
|
|
35681
36491
|
labels.slashStatusSession,
|
|
35682
36492
|
labels.slashStatusTitle,
|
|
35683
36493
|
labels.usageChipLabel,
|
|
@@ -35790,7 +36600,10 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35790
36600
|
slashStatusLimits,
|
|
35791
36601
|
slashStatusLimitsLoading,
|
|
35792
36602
|
slashStatusLimitsUnavailable,
|
|
36603
|
+
slashStatusOverride,
|
|
35793
36604
|
onSlashStatusOpen,
|
|
36605
|
+
onSlashStatusClose,
|
|
36606
|
+
onSlashStatusRefresh,
|
|
35794
36607
|
onLinkAction,
|
|
35795
36608
|
onHandoffConversation,
|
|
35796
36609
|
capabilityMenuState,
|
|
@@ -35841,7 +36654,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35841
36654
|
showStopButton,
|
|
35842
36655
|
showTimelineSkeleton,
|
|
35843
36656
|
showUnavailableChatEmpty,
|
|
35844
|
-
slashStatus,
|
|
36657
|
+
slashStatus: derivedSlashStatus,
|
|
35845
36658
|
submitDisabled,
|
|
35846
36659
|
timelineConversationId,
|
|
35847
36660
|
timelineInteractionLocked
|
|
@@ -35853,7 +36666,8 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35853
36666
|
slashStatusLimitsUnavailable,
|
|
35854
36667
|
viewModel
|
|
35855
36668
|
});
|
|
35856
|
-
const
|
|
36669
|
+
const slashStatus = slashStatusOverride ?? derivedSlashStatus;
|
|
36670
|
+
const handleInterruptCurrentTurn = useCallback56(() => {
|
|
35857
36671
|
actions.interruptCurrentTurn(labels.noRunningResponse);
|
|
35858
36672
|
}, [actions.interruptCurrentTurn, labels.noRunningResponse]);
|
|
35859
36673
|
const submitApprovalOption = useStableEventCallback(
|
|
@@ -35873,14 +36687,14 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35873
36687
|
const selectHomeComposerAgentTarget = useStableEventCallback(
|
|
35874
36688
|
actions.selectHomeComposerAgentTarget
|
|
35875
36689
|
);
|
|
35876
|
-
const selectHomeComposerAgentTargetAndFocus =
|
|
36690
|
+
const selectHomeComposerAgentTargetAndFocus = useCallback56(
|
|
35877
36691
|
(input) => {
|
|
35878
36692
|
selectHomeComposerAgentTarget(input);
|
|
35879
36693
|
onRequestComposerFocus();
|
|
35880
36694
|
},
|
|
35881
36695
|
[onRequestComposerFocus, selectHomeComposerAgentTarget]
|
|
35882
36696
|
);
|
|
35883
|
-
const handleSelectHomeSuggestion =
|
|
36697
|
+
const handleSelectHomeSuggestion = useCallback56(
|
|
35884
36698
|
(prompt) => {
|
|
35885
36699
|
updateDraftContent(
|
|
35886
36700
|
updateAgentComposerDraft(viewModel.composer.draftContent, { prompt })
|
|
@@ -35888,7 +36702,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35888
36702
|
},
|
|
35889
36703
|
[updateDraftContent, viewModel.composer.draftContent]
|
|
35890
36704
|
);
|
|
35891
|
-
const handleHomeSuggestionAction =
|
|
36705
|
+
const handleHomeSuggestionAction = useCallback56(
|
|
35892
36706
|
(action) => {
|
|
35893
36707
|
if (action === "import-session") {
|
|
35894
36708
|
window.dispatchEvent(
|
|
@@ -35903,7 +36717,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35903
36717
|
const submitGuidancePrompt = useStableEventCallback(
|
|
35904
36718
|
actions.submitGuidancePrompt
|
|
35905
36719
|
);
|
|
35906
|
-
const requestSubmittedPromptScrollToBottom =
|
|
36720
|
+
const requestSubmittedPromptScrollToBottom = useCallback56(() => {
|
|
35907
36721
|
const activeConversationId = viewModel.rail.activeConversationId;
|
|
35908
36722
|
if (!activeConversationId) {
|
|
35909
36723
|
return;
|
|
@@ -35911,7 +36725,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35911
36725
|
submittedPromptScrollConversationRef.current = activeConversationId;
|
|
35912
36726
|
pendingPrependScrollAnchorRef.current = null;
|
|
35913
36727
|
}, [viewModel.rail.activeConversationId]);
|
|
35914
|
-
const submitPromptAndScrollToBottom =
|
|
36728
|
+
const submitPromptAndScrollToBottom = useCallback56(
|
|
35915
36729
|
(content, displayPrompt, options) => {
|
|
35916
36730
|
requestSubmittedPromptScrollToBottom();
|
|
35917
36731
|
if (displayPrompt === void 0) {
|
|
@@ -35922,7 +36736,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35922
36736
|
},
|
|
35923
36737
|
[requestSubmittedPromptScrollToBottom, submitPrompt]
|
|
35924
36738
|
);
|
|
35925
|
-
const submitGuidancePromptAndScrollToBottom =
|
|
36739
|
+
const submitGuidancePromptAndScrollToBottom = useCallback56(
|
|
35926
36740
|
(content, displayPrompt) => {
|
|
35927
36741
|
requestSubmittedPromptScrollToBottom();
|
|
35928
36742
|
if (displayPrompt === void 0) {
|
|
@@ -35953,7 +36767,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35953
36767
|
);
|
|
35954
36768
|
const stableRequestGitBranches = useOptionalStableEventCallback(onRequestGitBranches);
|
|
35955
36769
|
const authLogin = useOptionalStableEventCallback(onAgentProviderLogin);
|
|
35956
|
-
const submitBottomDockInteractivePrompt =
|
|
36770
|
+
const submitBottomDockInteractivePrompt = useCallback56(
|
|
35957
36771
|
(input) => {
|
|
35958
36772
|
submitInteractivePrompt(input);
|
|
35959
36773
|
setBottomDockDismissedPromptRequestId(input.requestId);
|
|
@@ -35991,7 +36805,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35991
36805
|
)
|
|
35992
36806
|
}) : void 0
|
|
35993
36807
|
);
|
|
35994
|
-
const bottomDockComposerProps =
|
|
36808
|
+
const bottomDockComposerProps = useMemo41(
|
|
35995
36809
|
() => ({
|
|
35996
36810
|
workspaceId: viewModel.shell.workspaceId,
|
|
35997
36811
|
workspacePath: viewModel.shell.workspacePath,
|
|
@@ -35999,6 +36813,8 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
35999
36813
|
provider: composerProvider,
|
|
36000
36814
|
slashStatus,
|
|
36001
36815
|
onSlashStatusOpen,
|
|
36816
|
+
onSlashStatusClose,
|
|
36817
|
+
onSlashStatusRefresh,
|
|
36002
36818
|
usage: viewModel.detail.usage,
|
|
36003
36819
|
draftContent: viewModel.composer.draftContent,
|
|
36004
36820
|
engagement: composerEngagement,
|
|
@@ -36144,7 +36960,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
36144
36960
|
selectHomeComposerAgentTargetAndFocus
|
|
36145
36961
|
]
|
|
36146
36962
|
);
|
|
36147
|
-
const emptyHeroComposerProps =
|
|
36963
|
+
const emptyHeroComposerProps = useMemo41(
|
|
36148
36964
|
() => ({
|
|
36149
36965
|
...bottomDockComposerProps,
|
|
36150
36966
|
layoutMode: "hero"
|
|
@@ -36298,7 +37114,7 @@ var AgentGUIDetailPane = memo12(function AgentGUIDetailPane2({
|
|
|
36298
37114
|
});
|
|
36299
37115
|
|
|
36300
37116
|
// agent-gui/agentGuiNode/view/AgentGUIRenameConversationDialog.tsx
|
|
36301
|
-
import { memo as memo13, useCallback as
|
|
37117
|
+
import { memo as memo13, useCallback as useCallback57, useEffect as useEffect35, useRef as useRef50, useState as useState42 } from "react";
|
|
36302
37118
|
import { ConfirmationDialog as ConfirmationDialog4, Input as Input4 } from "@tutti-os/ui-system";
|
|
36303
37119
|
import { jsx as jsx73, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
36304
37120
|
var AgentGUIRenameConversationDialog = memo13(
|
|
@@ -36336,12 +37152,12 @@ var AgentGUIRenameConversationDialog = memo13(
|
|
|
36336
37152
|
}, 0);
|
|
36337
37153
|
return () => window.clearTimeout(timer);
|
|
36338
37154
|
}, [open, conversation?.id]);
|
|
36339
|
-
const closeRenameDialog =
|
|
37155
|
+
const closeRenameDialog = useCallback57(() => {
|
|
36340
37156
|
if (!isSavingRef.current) {
|
|
36341
37157
|
onOpenChange(false);
|
|
36342
37158
|
}
|
|
36343
37159
|
}, [onOpenChange]);
|
|
36344
|
-
const confirmRename =
|
|
37160
|
+
const confirmRename = useCallback57(() => {
|
|
36345
37161
|
if (!conversation || isSavingRef.current || !trimmedTitle) {
|
|
36346
37162
|
return;
|
|
36347
37163
|
}
|
|
@@ -36498,7 +37314,6 @@ function AgentGUIReferencePickerSurface({
|
|
|
36498
37314
|
isNodeSelectable,
|
|
36499
37315
|
open,
|
|
36500
37316
|
purpose,
|
|
36501
|
-
provenanceFilter,
|
|
36502
37317
|
resolveEntryIconUrl,
|
|
36503
37318
|
workspaceId,
|
|
36504
37319
|
onClose,
|
|
@@ -36515,14 +37330,6 @@ function AgentGUIReferencePickerSurface({
|
|
|
36515
37330
|
fileManagerCopy: fileManagerCopy ?? void 0,
|
|
36516
37331
|
open,
|
|
36517
37332
|
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
37333
|
resolveEntryIconUrl,
|
|
36527
37334
|
workspaceId,
|
|
36528
37335
|
onClose,
|
|
@@ -36545,11 +37352,11 @@ function AgentGUIReferencePickerSurface({
|
|
|
36545
37352
|
}
|
|
36546
37353
|
|
|
36547
37354
|
// agent-gui/agentGuiNode/view/AgentTargetSetupRoot.tsx
|
|
36548
|
-
import { useCallback as
|
|
37355
|
+
import { useCallback as useCallback58, useMemo as useMemo42 } from "react";
|
|
36549
37356
|
import { jsx as jsx75, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
36550
37357
|
function useAgentTargetSetupRoot(input) {
|
|
36551
37358
|
const { preferences } = useAgentGUIProviderRailPreferences();
|
|
36552
|
-
const homeTargetProjection =
|
|
37359
|
+
const homeTargetProjection = useMemo42(
|
|
36553
37360
|
() => projectAgentGUIManagedHomeTargets({
|
|
36554
37361
|
agentTargets: input.agentTargets,
|
|
36555
37362
|
preferences,
|
|
@@ -36563,7 +37370,7 @@ function useAgentTargetSetupRoot(input) {
|
|
|
36563
37370
|
);
|
|
36564
37371
|
const targetRuntimeSetupVisible = effectiveSelectedTarget.ref.setupKind === "target_runtime";
|
|
36565
37372
|
const environmentSetupVisible = targetRuntimeSetupVisible || !!resolveAgentGUIProviderCatalogIdentity(input.environmentProvider ?? "");
|
|
36566
|
-
const openAgentEnvSetup =
|
|
37373
|
+
const openAgentEnvSetup = useCallback58(() => {
|
|
36567
37374
|
if (targetRuntimeSetupVisible) {
|
|
36568
37375
|
controller.setDialogOpen(true);
|
|
36569
37376
|
return;
|
|
@@ -36604,7 +37411,7 @@ function AgentTargetSetupRoot({
|
|
|
36604
37411
|
}
|
|
36605
37412
|
|
|
36606
37413
|
// agent-gui/agentGuiNode/view/useAgentGUIWorkspaceReferencePicker.ts
|
|
36607
|
-
import { useCallback as
|
|
37414
|
+
import { useCallback as useCallback59, useMemo as useMemo43, useRef as useRef51, useState as useState43 } from "react";
|
|
36608
37415
|
import { createRichTextMentionHref } from "@tutti-os/ui-rich-text/core";
|
|
36609
37416
|
function useAgentGUIWorkspaceReferencePicker(input) {
|
|
36610
37417
|
const {
|
|
@@ -36623,12 +37430,12 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36623
37430
|
const [workspaceReferencePickerTarget, setWorkspaceReferencePickerTarget] = useState43(null);
|
|
36624
37431
|
const workspaceReferencePickerResolverRef = useRef51(null);
|
|
36625
37432
|
const projectDirectoryPickerResolverRef = useRef51(null);
|
|
36626
|
-
const emptyReferencePickResult =
|
|
37433
|
+
const emptyReferencePickResult = useMemo43(
|
|
36627
37434
|
() => ({ files: [], mentionItems: [] }),
|
|
36628
37435
|
[]
|
|
36629
37436
|
);
|
|
36630
37437
|
const hostLocalFileSourceId = "host-local-file";
|
|
36631
|
-
const isWorkspaceReferencePickerNodeSelectable =
|
|
37438
|
+
const isWorkspaceReferencePickerNodeSelectable = useCallback59(
|
|
36632
37439
|
(node) => {
|
|
36633
37440
|
if (workspaceReferencePickerPurpose === "directory") {
|
|
36634
37441
|
return node.kind === "folder";
|
|
@@ -36637,7 +37444,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36637
37444
|
},
|
|
36638
37445
|
[hostLocalFileSourceId, workspaceReferencePickerPurpose]
|
|
36639
37446
|
);
|
|
36640
|
-
const requestWorkspaceReferences =
|
|
37447
|
+
const requestWorkspaceReferences = useCallback59(
|
|
36641
37448
|
async (entity) => {
|
|
36642
37449
|
if (previewMode) {
|
|
36643
37450
|
return emptyReferencePickResult;
|
|
@@ -36673,7 +37480,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36673
37480
|
workspaceFileReferenceCopy
|
|
36674
37481
|
]
|
|
36675
37482
|
);
|
|
36676
|
-
const requestProjectDirectory =
|
|
37483
|
+
const requestProjectDirectory = useCallback59(async () => {
|
|
36677
37484
|
if (previewMode || !projectDirectorySourceAggregator) {
|
|
36678
37485
|
return null;
|
|
36679
37486
|
}
|
|
@@ -36687,7 +37494,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36687
37494
|
projectDirectoryPickerResolverRef.current = resolve;
|
|
36688
37495
|
});
|
|
36689
37496
|
}, [emptyReferencePickResult, previewMode, projectDirectorySourceAggregator]);
|
|
36690
|
-
const closeWorkspaceReferencePicker =
|
|
37497
|
+
const closeWorkspaceReferencePicker = useCallback59(() => {
|
|
36691
37498
|
workspaceReferencePickerResolverRef.current?.(emptyReferencePickResult);
|
|
36692
37499
|
workspaceReferencePickerResolverRef.current = null;
|
|
36693
37500
|
projectDirectoryPickerResolverRef.current?.(null);
|
|
@@ -36696,7 +37503,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36696
37503
|
setWorkspaceReferencePickerTarget(null);
|
|
36697
37504
|
setWorkspaceReferencePickerPurpose("reference");
|
|
36698
37505
|
}, [emptyReferencePickResult]);
|
|
36699
|
-
const settleReferencePicker =
|
|
37506
|
+
const settleReferencePicker = useCallback59(
|
|
36700
37507
|
(result, addedFiles) => {
|
|
36701
37508
|
workspaceReferencePickerResolverRef.current?.(result);
|
|
36702
37509
|
workspaceReferencePickerResolverRef.current = null;
|
|
@@ -36709,7 +37516,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36709
37516
|
},
|
|
36710
37517
|
[onWorkspaceFileReferencesAdded]
|
|
36711
37518
|
);
|
|
36712
|
-
const confirmWorkspaceReferencePicker =
|
|
37519
|
+
const confirmWorkspaceReferencePicker = useCallback59(
|
|
36713
37520
|
(refs) => {
|
|
36714
37521
|
if (workspaceReferencePickerPurpose === "directory") {
|
|
36715
37522
|
const directory = refs.find((ref) => ref.kind === "folder") ?? null;
|
|
@@ -36726,7 +37533,7 @@ function useAgentGUIWorkspaceReferencePicker(input) {
|
|
|
36726
37533
|
},
|
|
36727
37534
|
[settleReferencePicker, workspaceReferencePickerPurpose]
|
|
36728
37535
|
);
|
|
36729
|
-
const confirmWorkspaceReferenceBundles =
|
|
37536
|
+
const confirmWorkspaceReferenceBundles = useCallback59(
|
|
36730
37537
|
(result) => {
|
|
36731
37538
|
const workspaceRefs = result.files.filter(
|
|
36732
37539
|
(ref) => ref.sourceId !== hostLocalFileSourceId
|
|
@@ -37026,7 +37833,7 @@ function useAgentGUINodeEngagement(input) {
|
|
|
37026
37833
|
}
|
|
37027
37834
|
|
|
37028
37835
|
// agent-gui/agentGuiNode/view/useAgentGUIConversationRailResizePointerMove.ts
|
|
37029
|
-
import { useCallback as
|
|
37836
|
+
import { useCallback as useCallback60 } from "react";
|
|
37030
37837
|
function useAgentGUIConversationRailResizePointerMove({
|
|
37031
37838
|
clampConversationRailWidth,
|
|
37032
37839
|
layoutElementRef,
|
|
@@ -37038,7 +37845,7 @@ function useAgentGUIConversationRailResizePointerMove({
|
|
|
37038
37845
|
const reportConversationRailLayoutChange = useOptionalStableEventCallback(
|
|
37039
37846
|
onConversationRailLayoutChange
|
|
37040
37847
|
);
|
|
37041
|
-
return
|
|
37848
|
+
return useCallback60(
|
|
37042
37849
|
(event) => {
|
|
37043
37850
|
if (previewMode) return;
|
|
37044
37851
|
const resizeState = railResizeInteractionRef.current;
|
|
@@ -37072,7 +37879,7 @@ function useAgentGUIConversationRailResizePointerMove({
|
|
|
37072
37879
|
}
|
|
37073
37880
|
|
|
37074
37881
|
// agent-gui/agentGuiNode/view/useAgentGUIExternalRequests.ts
|
|
37075
|
-
import { useCallback as
|
|
37882
|
+
import { useCallback as useCallback61, useEffect as useEffect37, useRef as useRef54 } from "react";
|
|
37076
37883
|
function resolveSessionActionConversation(viewModel, agentSessionId) {
|
|
37077
37884
|
const active = viewModel.rail.activeConversation;
|
|
37078
37885
|
if (!agentSessionId) {
|
|
@@ -37099,7 +37906,7 @@ function useAgentGUIExternalRequests(input) {
|
|
|
37099
37906
|
} = input;
|
|
37100
37907
|
const agentHostApi = useOptionalAgentHostApi();
|
|
37101
37908
|
const railInteractionLockProbeRef = useRef54(null);
|
|
37102
|
-
const registerRailInteractionLockProbe =
|
|
37909
|
+
const registerRailInteractionLockProbe = useCallback61(
|
|
37103
37910
|
(probe) => {
|
|
37104
37911
|
railInteractionLockProbeRef.current = probe;
|
|
37105
37912
|
},
|
|
@@ -37176,15 +37983,20 @@ function AgentGUINodeView({
|
|
|
37176
37983
|
slashStatusLimits = [],
|
|
37177
37984
|
slashStatusLimitsLoading = false,
|
|
37178
37985
|
slashStatusLimitsUnavailable = false,
|
|
37986
|
+
slashStatusOverride = null,
|
|
37179
37987
|
providerAuthAccountLabels,
|
|
37180
37988
|
railConfigProvider,
|
|
37181
37989
|
railSlashStatusLimits,
|
|
37990
|
+
slashStatusLimitsResolvedEmpty = false,
|
|
37182
37991
|
slashStatusUsageCapturedAtUnixMs = null,
|
|
37183
37992
|
slashStatusUsageDidFail = false,
|
|
37184
37993
|
slashStatusUsageAttempted = false,
|
|
37994
|
+
onAgentConfigMenuClose,
|
|
37185
37995
|
onAgentConfigMenuOpen,
|
|
37186
37996
|
onAgentUsageRefresh,
|
|
37187
37997
|
onSlashStatusOpen,
|
|
37998
|
+
onSlashStatusClose,
|
|
37999
|
+
onSlashStatusRefresh,
|
|
37188
38000
|
accountMenuState = null,
|
|
37189
38001
|
previewMode = false,
|
|
37190
38002
|
onAgentProviderLogin,
|
|
@@ -37296,10 +38108,10 @@ function AgentGUINodeView({
|
|
|
37296
38108
|
);
|
|
37297
38109
|
const openProjectFiles = useOptionalStableEventCallback(onLinkAction);
|
|
37298
38110
|
const detailComposerFocusRequestSequence = localComposerFocusRequestSequence === 0 ? composerFocusRequestSequence : (composerFocusRequestSequence ?? 0) + localComposerFocusRequestSequence;
|
|
37299
|
-
const requestComposerFocus =
|
|
38111
|
+
const requestComposerFocus = useCallback62(() => {
|
|
37300
38112
|
setLocalComposerFocusRequestSequence((current) => current + 1);
|
|
37301
38113
|
}, []);
|
|
37302
|
-
const requestCreateConversation =
|
|
38114
|
+
const requestCreateConversation = useCallback62(
|
|
37303
38115
|
(options) => {
|
|
37304
38116
|
if (previewMode) {
|
|
37305
38117
|
return;
|
|
@@ -37324,7 +38136,7 @@ function AgentGUINodeView({
|
|
|
37324
38136
|
viewModel.composer.composerSettings.selectedProjectPath
|
|
37325
38137
|
]
|
|
37326
38138
|
);
|
|
37327
|
-
const effectiveWorkspaceAppIcons =
|
|
38139
|
+
const effectiveWorkspaceAppIcons = useMemo44(
|
|
37328
38140
|
() => mergeWorkspaceAppIconsFromCommands({
|
|
37329
38141
|
commands: viewModel.composer.availableCommands,
|
|
37330
38142
|
workspaceAppIcons,
|
|
@@ -37336,7 +38148,7 @@ function AgentGUINodeView({
|
|
|
37336
38148
|
workspaceAppIcons
|
|
37337
38149
|
]
|
|
37338
38150
|
);
|
|
37339
|
-
const clampConversationRailWidth =
|
|
38151
|
+
const clampConversationRailWidth = useCallback62(
|
|
37340
38152
|
(widthPx) => Math.min(
|
|
37341
38153
|
conversationRailMaxWidthPx,
|
|
37342
38154
|
Math.max(conversationRailMinWidthPx, widthPx)
|
|
@@ -37344,7 +38156,7 @@ function AgentGUINodeView({
|
|
|
37344
38156
|
[conversationRailMaxWidthPx, conversationRailMinWidthPx]
|
|
37345
38157
|
);
|
|
37346
38158
|
const providerRailWidthPx = conversationRailCollapsed ? 0 : 52;
|
|
37347
|
-
const handleConversationRailResizePointerDown =
|
|
38159
|
+
const handleConversationRailResizePointerDown = useCallback62(
|
|
37348
38160
|
(event) => {
|
|
37349
38161
|
if (previewMode) {
|
|
37350
38162
|
return;
|
|
@@ -37373,7 +38185,7 @@ function AgentGUINodeView({
|
|
|
37373
38185
|
providerRailWidthPx,
|
|
37374
38186
|
railResizeInteractionRef
|
|
37375
38187
|
});
|
|
37376
|
-
const endConversationRailResize =
|
|
38188
|
+
const endConversationRailResize = useCallback62(
|
|
37377
38189
|
(event) => {
|
|
37378
38190
|
const resizeState = railResizeInteractionRef.current;
|
|
37379
38191
|
if (event && resizeState?.pointerId === event.pointerId && event.currentTarget.hasPointerCapture?.(event.pointerId)) {
|
|
@@ -37404,7 +38216,7 @@ function AgentGUINodeView({
|
|
|
37404
38216
|
isRailResizing,
|
|
37405
38217
|
railResizeWidthPx
|
|
37406
38218
|
]);
|
|
37407
|
-
const handleConversationRailResizeKeyDown =
|
|
38219
|
+
const handleConversationRailResizeKeyDown = useCallback62(
|
|
37408
38220
|
(event) => {
|
|
37409
38221
|
if (previewMode) {
|
|
37410
38222
|
return;
|
|
@@ -37442,7 +38254,7 @@ function AgentGUINodeView({
|
|
|
37442
38254
|
const effectiveRailConfigProvider = railConfigProvider === void 0 ? viewModel.shell.data.provider : railConfigProvider;
|
|
37443
38255
|
const effectiveRailSlashStatusLimits = railSlashStatusLimits ?? slashStatusLimits;
|
|
37444
38256
|
const shouldShowProviderRailConfigButton = viewModel.rail.conversationFilter.kind === "all" || viewModel.rail.selectedAgentTarget?.disabled !== true;
|
|
37445
|
-
const effectiveProviderAuthAccountLabel =
|
|
38257
|
+
const effectiveProviderAuthAccountLabel = useMemo44(() => {
|
|
37446
38258
|
const provider = (effectiveRailConfigProvider ?? viewModel.shell.data.provider)?.trim() ?? "";
|
|
37447
38259
|
if (!provider) {
|
|
37448
38260
|
return null;
|
|
@@ -37470,7 +38282,7 @@ function AgentGUINodeView({
|
|
|
37470
38282
|
openEnvironmentSetup: onAgentEnvPanelOpen,
|
|
37471
38283
|
selectedAgentTarget: viewModel.rail.selectedAgentTarget
|
|
37472
38284
|
});
|
|
37473
|
-
const openAgentSettings =
|
|
38285
|
+
const openAgentSettings = useCallback62(() => {
|
|
37474
38286
|
openWorkspaceSettingsPanel({
|
|
37475
38287
|
section: "agent",
|
|
37476
38288
|
pane: "agents",
|
|
@@ -37479,7 +38291,7 @@ function AgentGUINodeView({
|
|
|
37479
38291
|
}, [effectiveRailConfigProvider]);
|
|
37480
38292
|
const [renameConversationTarget, setRenameConversationTarget] = useState44(null);
|
|
37481
38293
|
const [renameConversationDialogOpen, setRenameConversationDialogOpen] = useState44(false);
|
|
37482
|
-
const requestRenameConversation =
|
|
38294
|
+
const requestRenameConversation = useCallback62(
|
|
37483
38295
|
(conversation) => {
|
|
37484
38296
|
setRenameConversationTarget(conversation);
|
|
37485
38297
|
setRenameConversationDialogOpen(true);
|
|
@@ -37497,7 +38309,7 @@ function AgentGUINodeView({
|
|
|
37497
38309
|
uiLanguage,
|
|
37498
38310
|
viewModel
|
|
37499
38311
|
});
|
|
37500
|
-
const conversationRailStoreState =
|
|
38312
|
+
const conversationRailStoreState = useMemo44(
|
|
37501
38313
|
() => ({
|
|
37502
38314
|
activeConversation: viewModel.rail.activeConversation,
|
|
37503
38315
|
activeConversationId: viewModel.rail.activeConversationId,
|
|
@@ -37577,7 +38389,7 @@ function AgentGUINodeView({
|
|
|
37577
38389
|
const targetPresentationKey = agentTargetPresentationKey(
|
|
37578
38390
|
viewModel.rail.agentTargets
|
|
37579
38391
|
);
|
|
37580
|
-
const agentTargetPresentations =
|
|
38392
|
+
const agentTargetPresentations = useMemo44(
|
|
37581
38393
|
() => projectAgentTargetPresentations({
|
|
37582
38394
|
agentTargets: viewModel.rail.agentTargets,
|
|
37583
38395
|
workspaceId: viewModel.shell.workspaceId
|
|
@@ -37657,11 +38469,13 @@ function AgentGUINodeView({
|
|
|
37657
38469
|
providerScopedActionsVisible: viewModel.rail.conversationFilter.kind !== "all",
|
|
37658
38470
|
slashStatusLimits: effectiveRailSlashStatusLimits,
|
|
37659
38471
|
slashStatusLimitsLoading,
|
|
38472
|
+
slashStatusLimitsResolvedEmpty,
|
|
37660
38473
|
slashStatusUsageCapturedAtUnixMs,
|
|
37661
38474
|
slashStatusUsageDidFail,
|
|
37662
38475
|
slashStatusUsageAttempted,
|
|
37663
38476
|
provider: effectiveRailConfigProvider,
|
|
37664
38477
|
providerAuthAccountLabel: effectiveProviderAuthAccountLabel,
|
|
38478
|
+
onAgentConfigMenuClose,
|
|
37665
38479
|
onAgentConfigMenuOpen,
|
|
37666
38480
|
onAgentUsageRefresh,
|
|
37667
38481
|
onOpenAgentEnvSetup: openAgentEnvSetup,
|
|
@@ -37740,7 +38554,10 @@ function AgentGUINodeView({
|
|
|
37740
38554
|
slashStatusLimits,
|
|
37741
38555
|
slashStatusLimitsLoading,
|
|
37742
38556
|
slashStatusLimitsUnavailable,
|
|
38557
|
+
slashStatusOverride,
|
|
37743
38558
|
onSlashStatusOpen,
|
|
38559
|
+
onSlashStatusClose,
|
|
38560
|
+
onSlashStatusRefresh,
|
|
37744
38561
|
onLinkAction,
|
|
37745
38562
|
onHandoffConversation,
|
|
37746
38563
|
capabilityMenuState,
|
|
@@ -37774,7 +38591,6 @@ function AgentGUINodeView({
|
|
|
37774
38591
|
isNodeSelectable: isWorkspaceReferencePickerNodeSelectable,
|
|
37775
38592
|
open: workspaceReferencePickerOpen,
|
|
37776
38593
|
purpose: workspaceReferencePickerPurpose,
|
|
37777
|
-
provenanceFilter: referenceProvenanceFilter,
|
|
37778
38594
|
resolveEntryIconUrl: resolveWorkspaceReferenceEntryIconUrl,
|
|
37779
38595
|
workspaceId: viewModel.shell.workspaceId,
|
|
37780
38596
|
onClose: closeWorkspaceReferencePicker,
|
|
@@ -37803,178 +38619,10 @@ function AgentGUINodeView({
|
|
|
37803
38619
|
return previewMode ? content : /* @__PURE__ */ jsx76(TooltipProvider7, { children: content });
|
|
37804
38620
|
}
|
|
37805
38621
|
|
|
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
38622
|
// agent-gui/workspaceDesktop/view/AgentProbeInfoPopover.tsx
|
|
37975
38623
|
import { Info as Info2 } from "lucide-react";
|
|
37976
38624
|
import {
|
|
37977
|
-
useCallback as
|
|
38625
|
+
useCallback as useCallback63,
|
|
37978
38626
|
useEffect as useEffect39,
|
|
37979
38627
|
useLayoutEffect as useLayoutEffect9,
|
|
37980
38628
|
useRef as useRef56,
|
|
@@ -38012,27 +38660,36 @@ function AgentProbeInfoPopover({
|
|
|
38012
38660
|
lines,
|
|
38013
38661
|
testId = "agent-probe-info",
|
|
38014
38662
|
className,
|
|
38015
|
-
onOpen
|
|
38663
|
+
onOpen,
|
|
38664
|
+
onClose
|
|
38016
38665
|
}) {
|
|
38017
38666
|
"use memo";
|
|
38018
38667
|
const anchorRef = useRef56(null);
|
|
38019
38668
|
const popoverRef = useRef56(null);
|
|
38020
38669
|
const [isOpen, setIsOpen] = useState45(false);
|
|
38021
38670
|
const [popoverStyle, setPopoverStyle] = useState45(null);
|
|
38022
|
-
const openPopover =
|
|
38671
|
+
const openPopover = useCallback63(() => {
|
|
38023
38672
|
if (!isOpen) {
|
|
38024
38673
|
onOpen?.();
|
|
38025
38674
|
}
|
|
38026
38675
|
setIsOpen(true);
|
|
38027
38676
|
}, [isOpen, onOpen]);
|
|
38028
|
-
const
|
|
38029
|
-
|
|
38030
|
-
if (nextTarget instanceof Node && (anchorRef.current?.contains(nextTarget) || popoverRef.current?.contains(nextTarget))) {
|
|
38031
|
-
return;
|
|
38032
|
-
}
|
|
38677
|
+
const closePopover = useCallback63(() => {
|
|
38678
|
+
if (!isOpen) return;
|
|
38033
38679
|
setIsOpen(false);
|
|
38034
|
-
|
|
38035
|
-
|
|
38680
|
+
onClose?.();
|
|
38681
|
+
}, [isOpen, onClose]);
|
|
38682
|
+
const closeIfPointerLeavesPopover = useCallback63(
|
|
38683
|
+
(event) => {
|
|
38684
|
+
const nextTarget = event.relatedTarget;
|
|
38685
|
+
if (nextTarget instanceof Node && (anchorRef.current?.contains(nextTarget) || popoverRef.current?.contains(nextTarget))) {
|
|
38686
|
+
return;
|
|
38687
|
+
}
|
|
38688
|
+
closePopover();
|
|
38689
|
+
},
|
|
38690
|
+
[closePopover]
|
|
38691
|
+
);
|
|
38692
|
+
const updatePopoverPosition = useCallback63(() => {
|
|
38036
38693
|
const anchor = anchorRef.current;
|
|
38037
38694
|
if (!anchor) {
|
|
38038
38695
|
return;
|
|
@@ -38131,7 +38788,7 @@ function AgentProbeInfoPopover({
|
|
|
38131
38788
|
updatePopoverPosition();
|
|
38132
38789
|
openPopover();
|
|
38133
38790
|
},
|
|
38134
|
-
onBlur:
|
|
38791
|
+
onBlur: closePopover,
|
|
38135
38792
|
children: [
|
|
38136
38793
|
/* @__PURE__ */ jsx77(Info2, { size: 15, strokeWidth: 2.1, "aria-hidden": "true" }),
|
|
38137
38794
|
isOpen ? createPortal5(popover, document.body) : null
|
|
@@ -38222,11 +38879,11 @@ function areAgentGUINodePropsEqual(previous, next) {
|
|
|
38222
38879
|
const pc = previous.hostCapabilities, nc = next.hostCapabilities;
|
|
38223
38880
|
const pa = previous.hostActions, na = next.hostActions;
|
|
38224
38881
|
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.
|
|
38882
|
+
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
38883
|
}
|
|
38227
38884
|
|
|
38228
38885
|
// agent-gui/agentGuiNode/AgentGUIMentionServiceBoundary.tsx
|
|
38229
|
-
import { useMemo as
|
|
38886
|
+
import { useMemo as useMemo45 } from "react";
|
|
38230
38887
|
import {
|
|
38231
38888
|
RichTextMentionServiceProvider,
|
|
38232
38889
|
useRichTextMentionService as useRichTextMentionService2
|
|
@@ -38275,7 +38932,7 @@ function AgentGUIMentionServiceBoundary({
|
|
|
38275
38932
|
service
|
|
38276
38933
|
}) {
|
|
38277
38934
|
const inheritedService = useRichTextMentionService2();
|
|
38278
|
-
const effectiveService =
|
|
38935
|
+
const effectiveService = useMemo45(
|
|
38279
38936
|
() => service && inheritedService && service !== inheritedService ? composeAgentGUIMentionService({
|
|
38280
38937
|
inheritedService,
|
|
38281
38938
|
surfaceService: service
|
|
@@ -38289,7 +38946,7 @@ function AgentGUIMentionServiceBoundary({
|
|
|
38289
38946
|
}
|
|
38290
38947
|
|
|
38291
38948
|
// agent-gui/agentGuiNode/AgentGUINode.labels.ts
|
|
38292
|
-
import { useMemo as
|
|
38949
|
+
import { useMemo as useMemo46 } from "react";
|
|
38293
38950
|
|
|
38294
38951
|
// agent-gui/agentGuiNode/model/agentHomeSuggestions.ts
|
|
38295
38952
|
import { createRichTextMentionHref as createRichTextMentionHref2 } from "@tutti-os/ui-rich-text/core";
|
|
@@ -38607,7 +39264,7 @@ function agentQuickPromptLabels(t) {
|
|
|
38607
39264
|
|
|
38608
39265
|
// agent-gui/agentGuiNode/AgentGUINode.labels.ts
|
|
38609
39266
|
function useAgentGUIConversationRailLabels(t) {
|
|
38610
|
-
return
|
|
39267
|
+
return useMemo46(() => agentGUIConversationRailLabels(t), [t]);
|
|
38611
39268
|
}
|
|
38612
39269
|
var workspaceFileReferenceLocaleKeyByPickerKey = {
|
|
38613
39270
|
"actions.cancel": "common.cancel",
|
|
@@ -38648,7 +39305,6 @@ var workspaceFileReferenceLocaleKeyByPickerKey = {
|
|
|
38648
39305
|
"referencePicker.searchPlaceholder": "agentHost.agentGui.referencePicker.searchPlaceholder",
|
|
38649
39306
|
"referencePicker.selectGroupHint": "agentHost.agentGui.referencePicker.selectGroupHint",
|
|
38650
39307
|
"referencePicker.selectedCount": "agentHost.agentGui.referencePicker.selectedCount",
|
|
38651
|
-
"referencePicker.workspaceRootGroup": "agentHost.agentGui.referencePicker.workspaceRootGroup",
|
|
38652
39308
|
"referencePicker.sourceColumn": "agentHost.agentGui.referencePicker.sourceColumn",
|
|
38653
39309
|
"referencePicker.title": "agentHost.agentGui.referencePicker.title"
|
|
38654
39310
|
};
|
|
@@ -38661,7 +39317,7 @@ function useAgentGUIViewLabels(input) {
|
|
|
38661
39317
|
workspaceAppIcons,
|
|
38662
39318
|
workspaceId
|
|
38663
39319
|
} = input;
|
|
38664
|
-
return
|
|
39320
|
+
return useMemo46(
|
|
38665
39321
|
() => ({
|
|
38666
39322
|
initialPlaceholder: t("agentHost.agentGui.initialPlaceholder", {
|
|
38667
39323
|
provider: displayProviderLabel
|
|
@@ -38828,6 +39484,7 @@ function useAgentGUIViewLabels(input) {
|
|
|
38828
39484
|
slashStatusLimitsUnavailable: t(
|
|
38829
39485
|
"agentHost.agentGui.slashStatusLimitsUnavailable"
|
|
38830
39486
|
),
|
|
39487
|
+
slashStatusEmptyValue: t("agentHost.agentGui.slashStatusEmptyValue"),
|
|
38831
39488
|
slashStatusUsageJustUpdated: t(
|
|
38832
39489
|
"agentHost.agentGui.slashStatusUsageJustUpdated"
|
|
38833
39490
|
),
|
|
@@ -39297,7 +39954,7 @@ function useAgentGUIViewLabels(input) {
|
|
|
39297
39954
|
);
|
|
39298
39955
|
}
|
|
39299
39956
|
function useAgentGUIWorkspaceFileReferenceCopy(t) {
|
|
39300
|
-
return
|
|
39957
|
+
return useMemo46(
|
|
39301
39958
|
() => ({
|
|
39302
39959
|
t(key, values) {
|
|
39303
39960
|
const localeKey = workspaceFileReferenceLocaleKeyByPickerKey[key];
|
|
@@ -39308,94 +39965,8 @@ function useAgentGUIWorkspaceFileReferenceCopy(t) {
|
|
|
39308
39965
|
);
|
|
39309
39966
|
}
|
|
39310
39967
|
|
|
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
39968
|
// agent-gui/agentGuiNode/AgentGUINode.tsx
|
|
39397
39969
|
import { jsx as jsx79, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
39398
|
-
var EMPTY_SLASH_STATUS_QUOTAS = [];
|
|
39399
39970
|
var DISABLED_REFERENCE_PROVENANCE_CATALOG = {
|
|
39400
39971
|
enabledDimensions: [],
|
|
39401
39972
|
agentOptions: [],
|
|
@@ -39451,9 +40022,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39451
40022
|
sessionAction: sessionActionRequest = null,
|
|
39452
40023
|
openSession: openSessionRequest = null,
|
|
39453
40024
|
prefillPrompt: prefillPromptRequest = null,
|
|
39454
|
-
|
|
39455
|
-
onProbeDemandChange: onAgentProbeDemandChange,
|
|
39456
|
-
onProbeRefreshRequest: onAgentProbeRefreshRequest
|
|
40025
|
+
agentStatusController
|
|
39457
40026
|
} = runtimeRequests;
|
|
39458
40027
|
const {
|
|
39459
40028
|
capabilityMenuState,
|
|
@@ -39507,21 +40076,21 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39507
40076
|
sidebarFooter: renderSidebarFooter
|
|
39508
40077
|
} = renderSlots;
|
|
39509
40078
|
const { i18n, locale, t } = useTranslation();
|
|
39510
|
-
const workspaceUserProjectI18n =
|
|
40079
|
+
const workspaceUserProjectI18n = useMemo47(
|
|
39511
40080
|
() => createWorkspaceUserProjectI18nRuntime(i18n),
|
|
39512
40081
|
[i18n]
|
|
39513
40082
|
);
|
|
39514
|
-
const workspaceFileManagerI18n =
|
|
40083
|
+
const workspaceFileManagerI18n = useMemo47(
|
|
39515
40084
|
() => typeof i18n?.t === "function" ? createWorkspaceFileManagerI18nRuntime(i18n) : null,
|
|
39516
40085
|
[i18n]
|
|
39517
40086
|
);
|
|
39518
|
-
const handleLinkAction =
|
|
40087
|
+
const handleLinkAction = useCallback64(
|
|
39519
40088
|
(action) => {
|
|
39520
40089
|
onLinkAction?.(action);
|
|
39521
40090
|
},
|
|
39522
40091
|
[onLinkAction]
|
|
39523
40092
|
);
|
|
39524
|
-
const handleAgentProviderLogin =
|
|
40093
|
+
const handleAgentProviderLogin = useCallback64(
|
|
39525
40094
|
(provider) => {
|
|
39526
40095
|
const resolvedProvider = normalizeAgentGUIProviderIdentity(provider);
|
|
39527
40096
|
onAgentProviderLogin?.(
|
|
@@ -39530,7 +40099,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39530
40099
|
},
|
|
39531
40100
|
[onAgentProviderLogin, state.provider]
|
|
39532
40101
|
);
|
|
39533
|
-
const handleWorkspaceFileReferencesAdded =
|
|
40102
|
+
const handleWorkspaceFileReferencesAdded = useCallback64(
|
|
39534
40103
|
(references) => {
|
|
39535
40104
|
onWorkspaceFileReferencesAdded?.({
|
|
39536
40105
|
provider: state.provider,
|
|
@@ -39539,7 +40108,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39539
40108
|
},
|
|
39540
40109
|
[onWorkspaceFileReferencesAdded, state.provider]
|
|
39541
40110
|
);
|
|
39542
|
-
const handleDataChange =
|
|
40111
|
+
const handleDataChange = useCallback64(
|
|
39543
40112
|
(updater) => {
|
|
39544
40113
|
if (previewMode) {
|
|
39545
40114
|
return;
|
|
@@ -39548,7 +40117,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39548
40117
|
},
|
|
39549
40118
|
[onUpdateNode, previewMode]
|
|
39550
40119
|
);
|
|
39551
|
-
const handleConversationRailWidthChanged =
|
|
40120
|
+
const handleConversationRailWidthChanged = useCallback64(
|
|
39552
40121
|
(widthPx) => {
|
|
39553
40122
|
if (previewMode) {
|
|
39554
40123
|
return;
|
|
@@ -39573,14 +40142,14 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39573
40142
|
const isConversationRailManuallyCollapsed = state.conversationRailCollapsed === true;
|
|
39574
40143
|
const isConversationRailAutoCollapsed = shouldAutoCollapseAgentGUIConversationRail(width, railAutoCollapseWidthPx);
|
|
39575
40144
|
const isConversationRailCollapsed = isConversationRailManuallyCollapsed || isConversationRailAutoCollapsed;
|
|
39576
|
-
const minSize =
|
|
40145
|
+
const minSize = useMemo47(
|
|
39577
40146
|
() => ({
|
|
39578
40147
|
...resolveCanonicalNodeMinSize("agentGui"),
|
|
39579
40148
|
width: AGENT_GUI_COLLAPSED_MIN_WIDTH_PX
|
|
39580
40149
|
}),
|
|
39581
40150
|
[]
|
|
39582
40151
|
);
|
|
39583
|
-
const toggleConversationRailCollapsed =
|
|
40152
|
+
const toggleConversationRailCollapsed = useCallback64(() => {
|
|
39584
40153
|
if (previewMode) {
|
|
39585
40154
|
return;
|
|
39586
40155
|
}
|
|
@@ -39589,7 +40158,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39589
40158
|
conversationRailCollapsed: current.conversationRailCollapsed !== true
|
|
39590
40159
|
}));
|
|
39591
40160
|
}, [onUpdateNode, previewMode]);
|
|
39592
|
-
const handleConversationRailToggle =
|
|
40161
|
+
const handleConversationRailToggle = useCallback64(() => {
|
|
39593
40162
|
if (previewMode) {
|
|
39594
40163
|
return;
|
|
39595
40164
|
}
|
|
@@ -39650,7 +40219,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39650
40219
|
onRememberComposerDefaults,
|
|
39651
40220
|
onShowMessage
|
|
39652
40221
|
});
|
|
39653
|
-
const handleCreateConversation =
|
|
40222
|
+
const handleCreateConversation = useCallback64(
|
|
39654
40223
|
(...args) => {
|
|
39655
40224
|
if (!previewMode) {
|
|
39656
40225
|
onUpdateNode(
|
|
@@ -39664,7 +40233,7 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39664
40233
|
},
|
|
39665
40234
|
[actions, onUpdateNode, previewMode]
|
|
39666
40235
|
);
|
|
39667
|
-
const viewActions =
|
|
40236
|
+
const viewActions = useMemo47(
|
|
39668
40237
|
() => ({
|
|
39669
40238
|
...actions,
|
|
39670
40239
|
createConversation: handleCreateConversation
|
|
@@ -39686,131 +40255,28 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39686
40255
|
});
|
|
39687
40256
|
const workspaceFileReferenceCopy = useAgentGUIWorkspaceFileReferenceCopy(t);
|
|
39688
40257
|
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,
|
|
40258
|
+
const {
|
|
40259
|
+
agentProbeLines,
|
|
40260
|
+
controllerRailStatus,
|
|
40261
|
+
handleAgentConfigMenuClose,
|
|
40262
|
+
handleAgentConfigMenuOpen,
|
|
40263
|
+
handleAgentProbeInfoClose,
|
|
40264
|
+
handleAgentProbeInfoOpen,
|
|
40265
|
+
handleAgentUsageRefresh,
|
|
40266
|
+
handleSlashStatusClose,
|
|
40267
|
+
handleSlashStatusOpen,
|
|
40268
|
+
handleSlashStatusRefresh,
|
|
40269
|
+
railStatusProvider,
|
|
40270
|
+
slashStatusLimits,
|
|
40271
|
+
slashStatusLimitsUnavailable,
|
|
40272
|
+
slashStatusOverride
|
|
40273
|
+
} = useAgentGUIStatus({
|
|
40274
|
+
activeProvider,
|
|
40275
|
+
agentStatusController,
|
|
39811
40276
|
previewMode,
|
|
39812
|
-
|
|
39813
|
-
|
|
40277
|
+
t,
|
|
40278
|
+
viewModel
|
|
40279
|
+
});
|
|
39814
40280
|
return /* @__PURE__ */ jsx79(AgentGUIMentionServiceBoundary, { service: mentionService, children: /* @__PURE__ */ jsx79(
|
|
39815
40281
|
WorkspaceNodeWindow,
|
|
39816
40282
|
{
|
|
@@ -39834,7 +40300,8 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39834
40300
|
lines: agentProbeLines,
|
|
39835
40301
|
testId: "agent-gui-window-agent-info",
|
|
39836
40302
|
className: AgentGUINode_styles_default.windowAgentInfo,
|
|
39837
|
-
onOpen: handleAgentProbeInfoOpen
|
|
40303
|
+
onOpen: handleAgentProbeInfoOpen,
|
|
40304
|
+
onClose: handleAgentProbeInfoClose
|
|
39838
40305
|
}
|
|
39839
40306
|
),
|
|
39840
40307
|
/* @__PURE__ */ jsx79(
|
|
@@ -39889,17 +40356,22 @@ var AgentGUINode = memo14(function AgentGUINode2({
|
|
|
39889
40356
|
newConversationRequestSequence,
|
|
39890
40357
|
sessionActionRequest,
|
|
39891
40358
|
slashStatusLimits,
|
|
39892
|
-
slashStatusLimitsLoading:
|
|
40359
|
+
slashStatusLimitsLoading: controllerRailStatus?.loading ?? false,
|
|
39893
40360
|
slashStatusLimitsUnavailable,
|
|
40361
|
+
slashStatusOverride,
|
|
39894
40362
|
railConfigProvider: railStatusProvider,
|
|
39895
|
-
railSlashStatusLimits,
|
|
39896
|
-
slashStatusUsageCapturedAtUnixMs,
|
|
39897
|
-
slashStatusUsageDidFail,
|
|
39898
|
-
slashStatusUsageAttempted,
|
|
40363
|
+
railSlashStatusLimits: controllerRailStatus?.limits ?? [],
|
|
40364
|
+
slashStatusUsageCapturedAtUnixMs: controllerRailStatus?.capturedAtUnixMs ?? null,
|
|
40365
|
+
slashStatusUsageDidFail: controllerRailStatus?.didFail ?? false,
|
|
40366
|
+
slashStatusUsageAttempted: controllerRailStatus?.attempted ?? false,
|
|
40367
|
+
slashStatusLimitsResolvedEmpty: controllerRailStatus?.resolvedEmpty ?? false,
|
|
39899
40368
|
providerAuthAccountLabels,
|
|
40369
|
+
onAgentConfigMenuClose: handleAgentConfigMenuClose,
|
|
39900
40370
|
onAgentConfigMenuOpen: handleAgentConfigMenuOpen,
|
|
39901
40371
|
onAgentUsageRefresh: handleAgentUsageRefresh,
|
|
39902
|
-
onSlashStatusOpen:
|
|
40372
|
+
onSlashStatusOpen: handleSlashStatusOpen,
|
|
40373
|
+
onSlashStatusClose: handleSlashStatusClose,
|
|
40374
|
+
onSlashStatusRefresh: handleSlashStatusRefresh,
|
|
39903
40375
|
previewMode,
|
|
39904
40376
|
onLinkAction: handleLinkAction,
|
|
39905
40377
|
onHandoffConversation,
|
|
@@ -39962,16 +40434,16 @@ var AgentGUI = memo15(function AgentGUI2({
|
|
|
39962
40434
|
locale,
|
|
39963
40435
|
...props
|
|
39964
40436
|
}) {
|
|
39965
|
-
const normalizedAgents =
|
|
40437
|
+
const normalizedAgents = useMemo48(
|
|
39966
40438
|
() => normalizeAgentGUIAgents(agentDirectory.agents),
|
|
39967
40439
|
[agentDirectory.agents]
|
|
39968
40440
|
);
|
|
39969
|
-
const agentTargets =
|
|
40441
|
+
const agentTargets = useMemo48(
|
|
39970
40442
|
() => projectAgentGUIAgentsToTargets(normalizedAgents),
|
|
39971
40443
|
[normalizedAgents]
|
|
39972
40444
|
);
|
|
39973
40445
|
const effectiveHandoffAgentDirectory = handoffAgentDirectory ?? agentDirectory;
|
|
39974
|
-
const normalizedHandoffAgents =
|
|
40446
|
+
const normalizedHandoffAgents = useMemo48(
|
|
39975
40447
|
() => effectiveHandoffAgentDirectory.agents === agentDirectory.agents ? normalizedAgents : normalizeAgentGUIAgents(effectiveHandoffAgentDirectory.agents),
|
|
39976
40448
|
[
|
|
39977
40449
|
agentDirectory.agents,
|
|
@@ -39979,13 +40451,13 @@ var AgentGUI = memo15(function AgentGUI2({
|
|
|
39979
40451
|
normalizedAgents
|
|
39980
40452
|
]
|
|
39981
40453
|
);
|
|
39982
|
-
const handoffAgentTargets =
|
|
40454
|
+
const handoffAgentTargets = useMemo48(
|
|
39983
40455
|
() => normalizedHandoffAgents === normalizedAgents ? agentTargets : projectAgentGUIAgentsToTargets(normalizedHandoffAgents),
|
|
39984
40456
|
[agentTargets, normalizedAgents, normalizedHandoffAgents]
|
|
39985
40457
|
);
|
|
39986
40458
|
const hostCapabilities = props.hostCapabilities;
|
|
39987
40459
|
const renderSlots = props.renderSlots;
|
|
39988
|
-
const nodeHostCapabilities =
|
|
40460
|
+
const nodeHostCapabilities = useMemo48(
|
|
39989
40461
|
() => ({
|
|
39990
40462
|
...hostCapabilities,
|
|
39991
40463
|
agentTargets,
|
|
@@ -40008,7 +40480,7 @@ var AgentGUI = memo15(function AgentGUI2({
|
|
|
40008
40480
|
hostCapabilities
|
|
40009
40481
|
]
|
|
40010
40482
|
);
|
|
40011
|
-
const nodeRenderSlots =
|
|
40483
|
+
const nodeRenderSlots = useMemo48(
|
|
40012
40484
|
() => ({
|
|
40013
40485
|
...renderSlots,
|
|
40014
40486
|
providerRailEmpty: renderAgentsEmpty
|
|
@@ -40039,7 +40511,9 @@ export {
|
|
|
40039
40511
|
localAgentGUIAgentTargetId,
|
|
40040
40512
|
normalizeAgentGUIAgentTargets,
|
|
40041
40513
|
resolveAgentGUIAgentTarget,
|
|
40514
|
+
selectAgentStatusControllerSnapshot,
|
|
40515
|
+
createAgentStatusController,
|
|
40042
40516
|
AgentHandoffMenu,
|
|
40043
40517
|
AgentGUI
|
|
40044
40518
|
};
|
|
40045
|
-
//# sourceMappingURL=chunk-
|
|
40519
|
+
//# sourceMappingURL=chunk-ZRZVJR3M.js.map
|