@tutti-os/agent-gui 0.0.99 → 0.0.100
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/{AgentGUI-Bkk2TRS0.d.ts → AgentGUI-DgBjACOL.d.ts} +12 -3
- package/dist/agent-conversation/index.d.ts +4 -4
- package/dist/agent-conversation/index.js +8 -9
- package/dist/agent-conversation/index.js.map +1 -1
- package/dist/agent-gui.d.ts +5 -4
- package/dist/agent-gui.js +19 -19
- package/dist/agent-message-center/index.d.ts +4 -6
- package/dist/agent-message-center/index.js +13 -52
- package/dist/agent-message-center/index.js.map +1 -1
- package/dist/agent-title-text.js +1 -1
- package/dist/{agentConversationVM-C335TR6S.d.ts → agentConversationVM-BzHZhwFP.d.ts} +1 -1
- package/dist/{agentGuiNodeTypes-DAsluxjv.d.ts → agentGuiNodeTypes-C-wBSM-Y.d.ts} +19 -4
- package/dist/app/renderer/agentactivity.css +141 -36
- package/dist/chunk-2RQM7PJN.js +16 -0
- package/dist/chunk-2RQM7PJN.js.map +1 -0
- package/dist/{chunk-FSKGEGGX.js → chunk-4E3QCW6L.js} +17 -3
- package/dist/chunk-4E3QCW6L.js.map +1 -0
- package/dist/{chunk-63BE6RGM.js → chunk-4YCCATI4.js} +14 -374
- package/dist/chunk-4YCCATI4.js.map +1 -0
- package/dist/{chunk-IYEXLOUE.js → chunk-4YVKAPKW.js} +5 -8
- package/dist/chunk-4YVKAPKW.js.map +1 -0
- package/dist/{chunk-PLCHNOXL.js → chunk-BQJOYTW2.js} +863 -679
- package/dist/chunk-BQJOYTW2.js.map +1 -0
- package/dist/{chunk-MRRICFWA.js → chunk-D7HMQLBO.js} +159 -55
- package/dist/chunk-D7HMQLBO.js.map +1 -0
- package/dist/{chunk-OTRZBTFQ.js → chunk-DWUVRWXD.js} +2 -2
- package/dist/{chunk-RHTZAODZ.js → chunk-E5AD46HP.js} +2 -2
- package/dist/{chunk-3NOJFKDV.js → chunk-EUW6VPIK.js} +414 -49
- package/dist/chunk-EUW6VPIK.js.map +1 -0
- package/dist/{chunk-Y35GDLP2.js → chunk-F5UR6EJG.js} +2 -17
- package/dist/chunk-F5UR6EJG.js.map +1 -0
- package/dist/{chunk-J7ZYAUPC.js → chunk-FAE7CXZO.js} +8 -6
- package/dist/chunk-FAE7CXZO.js.map +1 -0
- package/dist/{chunk-CPUEPDF7.js → chunk-GCW57WYQ.js} +646 -595
- package/dist/chunk-GCW57WYQ.js.map +1 -0
- package/dist/{chunk-7M77BK6K.js → chunk-JWHPVETQ.js} +154 -147
- package/dist/chunk-JWHPVETQ.js.map +1 -0
- package/dist/{chunk-4ROALW3K.js → chunk-KAV2WHTG.js} +82 -61
- package/dist/chunk-KAV2WHTG.js.map +1 -0
- package/dist/{chunk-T6PEJFRP.js → chunk-MES7BQWI.js} +378 -369
- package/dist/chunk-MES7BQWI.js.map +1 -0
- package/dist/chunk-MIJXEELH.js +96 -0
- package/dist/chunk-MIJXEELH.js.map +1 -0
- package/dist/{chunk-QWGJ5TEG.js → chunk-QY22OBJS.js} +28 -30
- package/dist/chunk-QY22OBJS.js.map +1 -0
- package/dist/{chunk-MASXZENX.js → chunk-UESYITH6.js} +21 -2
- package/dist/chunk-UESYITH6.js.map +1 -0
- package/dist/{chunk-SPZJCTBV.js → chunk-XFRY2WWB.js} +348 -322
- package/dist/chunk-XFRY2WWB.js.map +1 -0
- package/dist/context-mention-palette/index.d.ts +5 -1
- package/dist/context-mention-palette/index.js +10 -11
- package/dist/contribution-CTVBPN0R.d.ts +119 -0
- package/dist/i18n/index.d.ts +16 -2
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +8 -7
- package/dist/index.js +21 -20
- package/dist/index.js.map +1 -1
- package/dist/mention-search.d.ts +18 -6
- package/dist/mention-search.js +8 -9
- package/dist/workbench/contribution.d.ts +6 -107
- package/dist/workbench/contribution.js +7 -3
- package/dist/workbench/index.d.ts +6 -4
- package/dist/workbench/index.js +27 -21
- package/dist/workbench/launch.d.ts +13 -5
- package/dist/workbench/launch.js +1 -1
- package/dist/workbench/sessionTitle.d.ts +5 -7
- package/dist/workbench/sessionTitle.js +3 -4
- package/dist/workbench/state.js +3 -1
- package/dist/workspace-agent-generated-files.d.ts +8 -13
- package/dist/workspace-agent-generated-files.js +6 -21
- package/dist/{workspaceAgentActivityListTypes-C7gPWYiA.d.ts → workspaceAgentActivityListTypes-DZfS_HgG.d.ts} +3 -26
- package/package.json +12 -12
- package/dist/chunk-3NOJFKDV.js.map +0 -1
- package/dist/chunk-4ROALW3K.js.map +0 -1
- package/dist/chunk-63BE6RGM.js.map +0 -1
- package/dist/chunk-7M77BK6K.js.map +0 -1
- package/dist/chunk-CPUEPDF7.js.map +0 -1
- package/dist/chunk-FSKGEGGX.js.map +0 -1
- package/dist/chunk-GAD6Y3BF.js +0 -88
- package/dist/chunk-GAD6Y3BF.js.map +0 -1
- package/dist/chunk-GCBDIQDX.js +0 -22
- package/dist/chunk-GCBDIQDX.js.map +0 -1
- package/dist/chunk-IYEXLOUE.js.map +0 -1
- package/dist/chunk-J7ZYAUPC.js.map +0 -1
- package/dist/chunk-MASXZENX.js.map +0 -1
- package/dist/chunk-MRRICFWA.js.map +0 -1
- package/dist/chunk-PLCHNOXL.js.map +0 -1
- package/dist/chunk-QWGJ5TEG.js.map +0 -1
- package/dist/chunk-SPZJCTBV.js.map +0 -1
- package/dist/chunk-T6PEJFRP.js.map +0 -1
- package/dist/chunk-Y35GDLP2.js.map +0 -1
- package/dist/chunk-Y5M6Q6WX.js +0 -25
- package/dist/chunk-Y5M6Q6WX.js.map +0 -1
- /package/dist/{chunk-OTRZBTFQ.js.map → chunk-DWUVRWXD.js.map} +0 -0
- /package/dist/{chunk-RHTZAODZ.js.map → chunk-E5AD46HP.js.map} +0 -0
|
@@ -13,15 +13,15 @@ import {
|
|
|
13
13
|
attrsToMentionItem,
|
|
14
14
|
createAgentFileMentionExtension,
|
|
15
15
|
formatAgentMentionMarkdown,
|
|
16
|
+
isWorkspaceAgentSyntheticControlMessage,
|
|
16
17
|
mentionItemToAttrs,
|
|
17
18
|
parseAgentMentionMarkdown
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-GCW57WYQ.js";
|
|
19
20
|
import {
|
|
20
21
|
fileChangeCountFromChanges,
|
|
21
22
|
fileChangeEntriesFromChanges,
|
|
22
|
-
fileChangeTypeValue
|
|
23
|
-
|
|
24
|
-
} from "./chunk-Y35GDLP2.js";
|
|
23
|
+
fileChangeTypeValue
|
|
24
|
+
} from "./chunk-F5UR6EJG.js";
|
|
25
25
|
import {
|
|
26
26
|
AgentGUIConversation_styles_default,
|
|
27
27
|
AgentMessageMarkdown,
|
|
@@ -39,21 +39,19 @@ import {
|
|
|
39
39
|
resolveWorkspaceFilePathCandidate,
|
|
40
40
|
resolveWorkspaceLinkAction,
|
|
41
41
|
useAgentTargetPresentations
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-MES7BQWI.js";
|
|
43
43
|
import {
|
|
44
44
|
useOptionalAgentActivityRuntime,
|
|
45
|
-
useOptionalAgentHostApi
|
|
46
|
-
} from "./chunk-MASXZENX.js";
|
|
47
|
-
import {
|
|
45
|
+
useOptionalAgentHostApi,
|
|
48
46
|
workspaceAgentProviderLabel
|
|
49
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-UESYITH6.js";
|
|
50
48
|
import {
|
|
51
49
|
normalizeAgentTitleText
|
|
52
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-MIJXEELH.js";
|
|
53
51
|
import {
|
|
54
52
|
getActiveUiLanguage,
|
|
55
53
|
translate
|
|
56
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-E5AD46HP.js";
|
|
57
55
|
|
|
58
56
|
// shared/imageGenerationTool.ts
|
|
59
57
|
var KNOWN_IMAGE_GENERATION_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
@@ -2930,6 +2928,122 @@ function dedupeStrings(values) {
|
|
|
2930
2928
|
return [...new Set(values.map((value) => value.trim()).filter(Boolean))];
|
|
2931
2929
|
}
|
|
2932
2930
|
|
|
2931
|
+
// shared/agentConversation/projection/agentToolRendererKind.ts
|
|
2932
|
+
function resolveAgentToolRendererKind(call, approval = null, askUserQuestion = null, planMode = null, task = null) {
|
|
2933
|
+
const normalizedToolName = normalizeToolName3(call.toolName);
|
|
2934
|
+
const normalizedCallType = normalizeCallType(call.callType);
|
|
2935
|
+
if (approval) {
|
|
2936
|
+
return "approval";
|
|
2937
|
+
}
|
|
2938
|
+
if (askUserQuestion) {
|
|
2939
|
+
return "ask-user";
|
|
2940
|
+
}
|
|
2941
|
+
if (normalizedToolName === "askuserquestion") {
|
|
2942
|
+
return "ask-user";
|
|
2943
|
+
}
|
|
2944
|
+
if (planMode?.kind === "enter") {
|
|
2945
|
+
return "plan-enter";
|
|
2946
|
+
}
|
|
2947
|
+
if (normalizedToolName === "enterplanmode") {
|
|
2948
|
+
return "plan-enter";
|
|
2949
|
+
}
|
|
2950
|
+
if (planMode?.kind === "exit") {
|
|
2951
|
+
return "plan-exit";
|
|
2952
|
+
}
|
|
2953
|
+
if (normalizedToolName === "exitplanmode") {
|
|
2954
|
+
return "plan-exit";
|
|
2955
|
+
}
|
|
2956
|
+
if (normalizedCallType === "approval" || normalizedToolName === "approval") {
|
|
2957
|
+
return "approval";
|
|
2958
|
+
}
|
|
2959
|
+
if (task) {
|
|
2960
|
+
return "task";
|
|
2961
|
+
}
|
|
2962
|
+
if (["task", "subagent", "delegatetask", "delegateagent", "agent"].includes(
|
|
2963
|
+
normalizedToolName
|
|
2964
|
+
)) {
|
|
2965
|
+
return "task";
|
|
2966
|
+
}
|
|
2967
|
+
if (isImageGenerationToolCall({
|
|
2968
|
+
toolName: call.toolName,
|
|
2969
|
+
displayName: call.displayName,
|
|
2970
|
+
content: call.content,
|
|
2971
|
+
outputContent: call.output?.content,
|
|
2972
|
+
inputPrompt: call.input?.prompt
|
|
2973
|
+
})) {
|
|
2974
|
+
return "image-generation";
|
|
2975
|
+
}
|
|
2976
|
+
switch (normalizedToolName) {
|
|
2977
|
+
case "read":
|
|
2978
|
+
case "readfile":
|
|
2979
|
+
return "read";
|
|
2980
|
+
case "write":
|
|
2981
|
+
case "writefile":
|
|
2982
|
+
return "write";
|
|
2983
|
+
case "edit":
|
|
2984
|
+
case "editfile":
|
|
2985
|
+
case "multiedit":
|
|
2986
|
+
return "edit";
|
|
2987
|
+
case "bash":
|
|
2988
|
+
case "shell":
|
|
2989
|
+
case "exec":
|
|
2990
|
+
case "execcommand":
|
|
2991
|
+
return "bash";
|
|
2992
|
+
case "grep":
|
|
2993
|
+
case "glob":
|
|
2994
|
+
case "search":
|
|
2995
|
+
case "searchfiles":
|
|
2996
|
+
return "search";
|
|
2997
|
+
case "websearch":
|
|
2998
|
+
return "web-search";
|
|
2999
|
+
case "webfetch":
|
|
3000
|
+
return "web-fetch";
|
|
3001
|
+
case "todowrite":
|
|
3002
|
+
return "todo-write";
|
|
3003
|
+
case "toolsearch":
|
|
3004
|
+
return "tool-search";
|
|
3005
|
+
case "skill":
|
|
3006
|
+
return "skill";
|
|
3007
|
+
default:
|
|
3008
|
+
if (normalizedCallType === "mcp" || normalizedToolName.startsWith("mcp") || hasMcpMetadata(call.metadata)) {
|
|
3009
|
+
return "mcp";
|
|
3010
|
+
}
|
|
3011
|
+
return "default";
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
function inferToolCallType(toolName) {
|
|
3015
|
+
const normalizedToolName = normalizeToolName3(toolName);
|
|
3016
|
+
if (normalizedToolName === "approval") {
|
|
3017
|
+
return "approval";
|
|
3018
|
+
}
|
|
3019
|
+
if (["askuserquestion", "enterplanmode", "exitplanmode"].includes(
|
|
3020
|
+
normalizedToolName
|
|
3021
|
+
)) {
|
|
3022
|
+
return "interactive";
|
|
3023
|
+
}
|
|
3024
|
+
if (normalizedToolName.startsWith("mcp")) {
|
|
3025
|
+
return "mcp";
|
|
3026
|
+
}
|
|
3027
|
+
return "tool";
|
|
3028
|
+
}
|
|
3029
|
+
function isApprovalToolCall(call) {
|
|
3030
|
+
return normalizeCallType(call.callType) === "approval" || normalizeToolName3(call.toolName) === "approval";
|
|
3031
|
+
}
|
|
3032
|
+
function normalizeToolName3(value) {
|
|
3033
|
+
return (value ?? "").replace(/[_\s-]+/g, "").trim().toLowerCase();
|
|
3034
|
+
}
|
|
3035
|
+
function hasMcpMetadata(metadata) {
|
|
3036
|
+
return Boolean(
|
|
3037
|
+
stringValue3(metadata?.server) ?? stringValue3(metadata?.serverName) ?? stringValue3(metadata?.mcpServer)
|
|
3038
|
+
);
|
|
3039
|
+
}
|
|
3040
|
+
function normalizeCallType(value) {
|
|
3041
|
+
return (value ?? "").trim().toLowerCase();
|
|
3042
|
+
}
|
|
3043
|
+
function stringValue3(value) {
|
|
3044
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
3045
|
+
}
|
|
3046
|
+
|
|
2933
3047
|
// shared/agentConversation/projection/agentApprovalProjection.ts
|
|
2934
3048
|
function projectAgentApprovalItem(call, input, output) {
|
|
2935
3049
|
const callType = normalizeToken(call.callType);
|
|
@@ -2937,7 +3051,7 @@ function projectAgentApprovalItem(call, input, output) {
|
|
|
2937
3051
|
if (callType !== "approval" && toolName !== "approval") {
|
|
2938
3052
|
return null;
|
|
2939
3053
|
}
|
|
2940
|
-
const requestId =
|
|
3054
|
+
const requestId = stringValue4(input?.requestId) ?? stringValue4(call.payload?.requestId) ?? stringValue4(output?.requestId);
|
|
2941
3055
|
if (!requestId) {
|
|
2942
3056
|
return null;
|
|
2943
3057
|
}
|
|
@@ -2961,7 +3075,7 @@ function projectAgentApprovalItem(call, input, output) {
|
|
|
2961
3075
|
callId: call.id.replace(/^call:/, ""),
|
|
2962
3076
|
title: mcpTarget?.displayName ?? (call.summary.trim() || call.name),
|
|
2963
3077
|
toolName: call.toolName,
|
|
2964
|
-
status:
|
|
3078
|
+
status: stringValue4(call.payload?.status) ?? call.status,
|
|
2965
3079
|
input,
|
|
2966
3080
|
options,
|
|
2967
3081
|
output,
|
|
@@ -2971,17 +3085,17 @@ function projectAgentApprovalItem(call, input, output) {
|
|
|
2971
3085
|
function normalizeApprovalOptions(values) {
|
|
2972
3086
|
return values.flatMap((value) => {
|
|
2973
3087
|
const option = objectValue(value);
|
|
2974
|
-
const id =
|
|
3088
|
+
const id = stringValue4(option?.optionId) ?? stringValue4(option?.id);
|
|
2975
3089
|
if (!id) {
|
|
2976
3090
|
return [];
|
|
2977
3091
|
}
|
|
2978
|
-
const label =
|
|
3092
|
+
const label = stringValue4(option?.name) ?? stringValue4(option?.label) ?? stringValue4(option?.title) ?? stringValue4(option?.kind) ?? id;
|
|
2979
3093
|
return [
|
|
2980
3094
|
{
|
|
2981
3095
|
id,
|
|
2982
3096
|
label,
|
|
2983
|
-
kind:
|
|
2984
|
-
...
|
|
3097
|
+
kind: stringValue4(option?.kind) ?? "",
|
|
3098
|
+
...stringValue4(option?.description) ? { description: stringValue4(option?.description) } : {}
|
|
2985
3099
|
}
|
|
2986
3100
|
];
|
|
2987
3101
|
});
|
|
@@ -2989,7 +3103,7 @@ function normalizeApprovalOptions(values) {
|
|
|
2989
3103
|
function normalizeToken(value) {
|
|
2990
3104
|
return (value ?? "").trim().toLowerCase();
|
|
2991
3105
|
}
|
|
2992
|
-
function
|
|
3106
|
+
function stringValue4(value) {
|
|
2993
3107
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
2994
3108
|
}
|
|
2995
3109
|
function objectValue(value) {
|
|
@@ -3001,7 +3115,7 @@ function arrayValue(value) {
|
|
|
3001
3115
|
|
|
3002
3116
|
// shared/agentConversation/projection/agentInteractiveProjection.ts
|
|
3003
3117
|
function projectAgentAskUserQuestionItem(call, input, output) {
|
|
3004
|
-
if (
|
|
3118
|
+
if (normalizeToolName4(call.toolName) !== "askuserquestion") {
|
|
3005
3119
|
return null;
|
|
3006
3120
|
}
|
|
3007
3121
|
const questions = normalizeAskUserQuestions(input?.questions);
|
|
@@ -3013,7 +3127,7 @@ function projectAgentAskUserQuestionItem(call, input, output) {
|
|
|
3013
3127
|
kind: "ask-user",
|
|
3014
3128
|
id: call.id,
|
|
3015
3129
|
turnId: call.turnId ?? "turn:unknown",
|
|
3016
|
-
requestId:
|
|
3130
|
+
requestId: stringValue5(input?.requestId) ?? stringValue5(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
|
|
3017
3131
|
title: call.name,
|
|
3018
3132
|
status: call.status,
|
|
3019
3133
|
questions: questions.map((question) => ({
|
|
@@ -3029,18 +3143,18 @@ function projectAgentPlanModeItem(call, input) {
|
|
|
3029
3143
|
itemKind: "plan-mode",
|
|
3030
3144
|
id: call.id,
|
|
3031
3145
|
turnId: call.turnId ?? "turn:unknown",
|
|
3032
|
-
requestId:
|
|
3146
|
+
requestId: stringValue5(input?.requestId) ?? stringValue5(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
|
|
3033
3147
|
kind: "exit",
|
|
3034
|
-
title:
|
|
3148
|
+
title: stringValue5(objectValue2(input?.toolCall)?.title) ?? call.name,
|
|
3035
3149
|
status: call.status,
|
|
3036
|
-
plan:
|
|
3037
|
-
filePath:
|
|
3150
|
+
plan: stringValue5(input?.plan) ?? stringValue5(call.payload?.plan) ?? (call.summary.trim() || null),
|
|
3151
|
+
filePath: stringValue5(input?.filePath) ?? stringValue5(call.payload?.filePath),
|
|
3038
3152
|
options: extractExitPlanModeOptions(input),
|
|
3039
3153
|
...keepPlanningOption(extractExitPlanKeepPlanningOptionId(input)),
|
|
3040
3154
|
occurredAtUnixMs: call.occurredAtUnixMs ?? null
|
|
3041
3155
|
};
|
|
3042
3156
|
}
|
|
3043
|
-
const toolName =
|
|
3157
|
+
const toolName = normalizeToolName4(call.toolName);
|
|
3044
3158
|
if (toolName === "enterplanmode") {
|
|
3045
3159
|
return {
|
|
3046
3160
|
itemKind: "plan-mode",
|
|
@@ -3049,8 +3163,8 @@ function projectAgentPlanModeItem(call, input) {
|
|
|
3049
3163
|
kind: "enter",
|
|
3050
3164
|
title: call.name,
|
|
3051
3165
|
status: call.status,
|
|
3052
|
-
plan:
|
|
3053
|
-
filePath:
|
|
3166
|
+
plan: stringValue5(input?.content) ?? (call.summary.trim() || null),
|
|
3167
|
+
filePath: stringValue5(input?.filePath),
|
|
3054
3168
|
occurredAtUnixMs: call.occurredAtUnixMs ?? null
|
|
3055
3169
|
};
|
|
3056
3170
|
}
|
|
@@ -3061,12 +3175,12 @@ function projectAgentPlanModeItem(call, input) {
|
|
|
3061
3175
|
itemKind: "plan-mode",
|
|
3062
3176
|
id: call.id,
|
|
3063
3177
|
turnId: call.turnId ?? "turn:unknown",
|
|
3064
|
-
requestId:
|
|
3178
|
+
requestId: stringValue5(input?.requestId) ?? stringValue5(call.payload?.requestId) ?? call.id.replace(/^call:/, ""),
|
|
3065
3179
|
kind: "exit",
|
|
3066
3180
|
title: call.name,
|
|
3067
3181
|
status: call.status,
|
|
3068
|
-
plan:
|
|
3069
|
-
filePath:
|
|
3182
|
+
plan: stringValue5(input?.plan) ?? stringValue5(call.payload?.plan) ?? (call.summary.trim() || null),
|
|
3183
|
+
filePath: stringValue5(input?.filePath) ?? stringValue5(call.payload?.filePath),
|
|
3070
3184
|
occurredAtUnixMs: call.occurredAtUnixMs ?? null
|
|
3071
3185
|
};
|
|
3072
3186
|
}
|
|
@@ -3088,10 +3202,10 @@ function answerForQuestion(questionId, answersByQuestionId, output) {
|
|
|
3088
3202
|
function keepPlanningOption(optionId) {
|
|
3089
3203
|
return optionId ? { keepPlanningOptionId: optionId } : {};
|
|
3090
3204
|
}
|
|
3091
|
-
function
|
|
3205
|
+
function normalizeToolName4(value) {
|
|
3092
3206
|
return (value ?? "").replace(/[_\s-]+/g, "").trim().toLowerCase();
|
|
3093
3207
|
}
|
|
3094
|
-
function
|
|
3208
|
+
function stringValue5(value) {
|
|
3095
3209
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
3096
3210
|
}
|
|
3097
3211
|
function objectValue2(value) {
|
|
@@ -3101,122 +3215,9 @@ function arrayValue2(value) {
|
|
|
3101
3215
|
return Array.isArray(value) ? value : null;
|
|
3102
3216
|
}
|
|
3103
3217
|
|
|
3104
|
-
// shared/agentConversation/projection/agentToolRendererKind.ts
|
|
3105
|
-
function resolveAgentToolRendererKind(call, approval = null, askUserQuestion = null, planMode = null, task = null) {
|
|
3106
|
-
const normalizedToolName = normalizeToolName4(call.toolName);
|
|
3107
|
-
const normalizedCallType = normalizeCallType(call.callType);
|
|
3108
|
-
if (approval) {
|
|
3109
|
-
return "approval";
|
|
3110
|
-
}
|
|
3111
|
-
if (askUserQuestion) {
|
|
3112
|
-
return "ask-user";
|
|
3113
|
-
}
|
|
3114
|
-
if (normalizedToolName === "askuserquestion") {
|
|
3115
|
-
return "ask-user";
|
|
3116
|
-
}
|
|
3117
|
-
if (planMode?.kind === "enter") {
|
|
3118
|
-
return "plan-enter";
|
|
3119
|
-
}
|
|
3120
|
-
if (normalizedToolName === "enterplanmode") {
|
|
3121
|
-
return "plan-enter";
|
|
3122
|
-
}
|
|
3123
|
-
if (planMode?.kind === "exit") {
|
|
3124
|
-
return "plan-exit";
|
|
3125
|
-
}
|
|
3126
|
-
if (normalizedToolName === "exitplanmode") {
|
|
3127
|
-
return "plan-exit";
|
|
3128
|
-
}
|
|
3129
|
-
if (normalizedCallType === "approval" || normalizedToolName === "approval") {
|
|
3130
|
-
return "approval";
|
|
3131
|
-
}
|
|
3132
|
-
if (task) {
|
|
3133
|
-
return "task";
|
|
3134
|
-
}
|
|
3135
|
-
if (["task", "subagent", "delegatetask", "delegateagent", "agent"].includes(
|
|
3136
|
-
normalizedToolName
|
|
3137
|
-
)) {
|
|
3138
|
-
return "task";
|
|
3139
|
-
}
|
|
3140
|
-
if (isImageGenerationToolCall({
|
|
3141
|
-
toolName: call.toolName,
|
|
3142
|
-
displayName: call.displayName,
|
|
3143
|
-
content: call.content,
|
|
3144
|
-
outputContent: call.output?.content,
|
|
3145
|
-
inputPrompt: call.input?.prompt
|
|
3146
|
-
})) {
|
|
3147
|
-
return "image-generation";
|
|
3148
|
-
}
|
|
3149
|
-
switch (normalizedToolName) {
|
|
3150
|
-
case "read":
|
|
3151
|
-
case "readfile":
|
|
3152
|
-
return "read";
|
|
3153
|
-
case "write":
|
|
3154
|
-
case "writefile":
|
|
3155
|
-
return "write";
|
|
3156
|
-
case "edit":
|
|
3157
|
-
case "editfile":
|
|
3158
|
-
case "multiedit":
|
|
3159
|
-
return "edit";
|
|
3160
|
-
case "bash":
|
|
3161
|
-
case "shell":
|
|
3162
|
-
case "exec":
|
|
3163
|
-
case "execcommand":
|
|
3164
|
-
return "bash";
|
|
3165
|
-
case "grep":
|
|
3166
|
-
case "glob":
|
|
3167
|
-
case "search":
|
|
3168
|
-
case "searchfiles":
|
|
3169
|
-
return "search";
|
|
3170
|
-
case "websearch":
|
|
3171
|
-
return "web-search";
|
|
3172
|
-
case "webfetch":
|
|
3173
|
-
return "web-fetch";
|
|
3174
|
-
case "todowrite":
|
|
3175
|
-
return "todo-write";
|
|
3176
|
-
case "toolsearch":
|
|
3177
|
-
return "tool-search";
|
|
3178
|
-
case "skill":
|
|
3179
|
-
return "skill";
|
|
3180
|
-
default:
|
|
3181
|
-
if (normalizedCallType === "mcp" || normalizedToolName.startsWith("mcp") || hasMcpMetadata(call.metadata)) {
|
|
3182
|
-
return "mcp";
|
|
3183
|
-
}
|
|
3184
|
-
return "default";
|
|
3185
|
-
}
|
|
3186
|
-
}
|
|
3187
|
-
function inferToolCallType(toolName) {
|
|
3188
|
-
const normalizedToolName = normalizeToolName4(toolName);
|
|
3189
|
-
if (normalizedToolName === "approval") {
|
|
3190
|
-
return "approval";
|
|
3191
|
-
}
|
|
3192
|
-
if (["askuserquestion", "enterplanmode", "exitplanmode"].includes(
|
|
3193
|
-
normalizedToolName
|
|
3194
|
-
)) {
|
|
3195
|
-
return "interactive";
|
|
3196
|
-
}
|
|
3197
|
-
if (normalizedToolName.startsWith("mcp")) {
|
|
3198
|
-
return "mcp";
|
|
3199
|
-
}
|
|
3200
|
-
return "tool";
|
|
3201
|
-
}
|
|
3202
|
-
function normalizeToolName4(value) {
|
|
3203
|
-
return (value ?? "").replace(/[_\s-]+/g, "").trim().toLowerCase();
|
|
3204
|
-
}
|
|
3205
|
-
function hasMcpMetadata(metadata) {
|
|
3206
|
-
return Boolean(
|
|
3207
|
-
stringValue5(metadata?.server) ?? stringValue5(metadata?.serverName) ?? stringValue5(metadata?.mcpServer)
|
|
3208
|
-
);
|
|
3209
|
-
}
|
|
3210
|
-
function normalizeCallType(value) {
|
|
3211
|
-
return (value ?? "").trim().toLowerCase();
|
|
3212
|
-
}
|
|
3213
|
-
function stringValue5(value) {
|
|
3214
|
-
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
3215
|
-
}
|
|
3216
|
-
|
|
3217
3218
|
// shared/agentConversation/projection/agentTaskProjection.ts
|
|
3218
3219
|
function projectAgentTaskItem(call, input, output, metadata) {
|
|
3219
|
-
const toolName =
|
|
3220
|
+
const toolName = normalizeToolName3(call.toolName);
|
|
3220
3221
|
if (!["task", "subagent", "delegatetask", "delegateagent", "agent"].includes(
|
|
3221
3222
|
toolName
|
|
3222
3223
|
)) {
|
|
@@ -3250,6 +3251,9 @@ function normalizeTaskSteps(values, turnId) {
|
|
|
3250
3251
|
}
|
|
3251
3252
|
const toolName = stringValue6(step.toolName) ?? stringValue6(step.tool_name) ?? stringValue6(step.name);
|
|
3252
3253
|
const callType = stringValue6(step.callType) ?? stringValue6(step.call_type);
|
|
3254
|
+
if (isApprovalToolCall({ toolName, callType })) {
|
|
3255
|
+
return [];
|
|
3256
|
+
}
|
|
3253
3257
|
const inputPayload = objectValue3(step.toolInput) ?? objectValue3(step.tool_input);
|
|
3254
3258
|
const outputPayload = objectValue3(step.toolResult) ?? objectValue3(step.tool_result);
|
|
3255
3259
|
const errorPayload = objectValue3(step.toolError) ?? objectValue3(step.tool_error);
|
|
@@ -4136,6 +4140,9 @@ function buildAgentTurnSequenceItems(turn, workspaceId) {
|
|
|
4136
4140
|
});
|
|
4137
4141
|
return;
|
|
4138
4142
|
}
|
|
4143
|
+
if (isApprovalToolCall(entry.call)) {
|
|
4144
|
+
return;
|
|
4145
|
+
}
|
|
4139
4146
|
sequence.push({
|
|
4140
4147
|
kind: "tool-call",
|
|
4141
4148
|
call: projectAgentToolCall(entry.call)
|
|
@@ -15298,4 +15305,4 @@ export {
|
|
|
15298
15305
|
AgentConversationFlow,
|
|
15299
15306
|
useProjectedAgentConversation
|
|
15300
15307
|
};
|
|
15301
|
-
//# sourceMappingURL=chunk-
|
|
15308
|
+
//# sourceMappingURL=chunk-JWHPVETQ.js.map
|