@tutti-os/agent-gui 0.0.233 → 0.0.234
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/dist/{AgentRichTextReadonly-U3XUJYCW.js → AgentRichTextReadonly-CCELQPHE.js} +5 -5
- package/dist/agent-conversation/index.d.ts +17 -4
- package/dist/agent-conversation/index.js +13 -9
- package/dist/agent-conversation/index.js.map +1 -1
- package/dist/agent-gui.d.ts +19 -3
- package/dist/agent-gui.js +22 -16
- package/dist/agent-message-center/index.d.ts +1 -1
- package/dist/agent-message-center/index.js +10 -7
- package/dist/agent-message-center/index.js.map +1 -1
- package/dist/{agentGuiNodeTypes-DW7T--Y8.d.ts → agentGuiNodeTypes-Dgl7kQHA.d.ts} +2 -2
- package/dist/agents.d.ts +1 -1
- package/dist/app/renderer/agentactivity.css +17 -0
- package/dist/{chunk-M6WEFXPL.js → chunk-2MCNNB2P.js} +2 -24
- package/dist/chunk-2MCNNB2P.js.map +1 -0
- package/dist/{chunk-CQFT3MI5.js → chunk-3YYI6RXA.js} +7 -5
- package/dist/{chunk-CQFT3MI5.js.map → chunk-3YYI6RXA.js.map} +1 -1
- package/dist/{chunk-EDP4D42H.js → chunk-45KN5Z5F.js} +877 -871
- package/dist/chunk-45KN5Z5F.js.map +1 -0
- package/dist/{chunk-T57ZZWTC.js → chunk-4HAG3FOY.js} +2 -2
- package/dist/{chunk-ZBI6R46N.js → chunk-5DN5N2XS.js} +2 -2
- package/dist/{chunk-BCBB4HOV.js → chunk-634MNSI5.js} +2 -2
- package/dist/chunk-A4KKC324.js +4768 -0
- package/dist/chunk-A4KKC324.js.map +1 -0
- package/dist/chunk-ALAGL6VL.js +48 -0
- package/dist/chunk-ALAGL6VL.js.map +1 -0
- package/dist/{chunk-2STAUA73.js → chunk-AYTUAZE3.js} +5 -2
- package/dist/chunk-AYTUAZE3.js.map +1 -0
- package/dist/{chunk-SWO67UWQ.js → chunk-CZOZBUIM.js} +7 -7
- package/dist/{chunk-SWO67UWQ.js.map → chunk-CZOZBUIM.js.map} +1 -1
- package/dist/{chunk-2L2LVSOD.js → chunk-EHNPHZE4.js} +881 -5812
- package/dist/chunk-EHNPHZE4.js.map +1 -0
- package/dist/{chunk-N5356722.js → chunk-EKQ7UX2B.js} +13 -319
- package/dist/chunk-EKQ7UX2B.js.map +1 -0
- package/dist/{chunk-ZXEICU6J.js → chunk-KK7YXPTS.js} +3 -1
- package/dist/chunk-KK7YXPTS.js.map +1 -0
- package/dist/{chunk-WGCDSA7P.js → chunk-MBM7PJIF.js} +27 -506
- package/dist/chunk-MBM7PJIF.js.map +1 -0
- package/dist/chunk-RMC2MGL4.js +557 -0
- package/dist/chunk-RMC2MGL4.js.map +1 -0
- package/dist/{chunk-JA6XAKKE.js → chunk-TWF6JXPC.js} +2 -2
- package/dist/{chunk-7AYFKNLD.js → chunk-TWMV6YTX.js} +4 -4
- package/dist/chunk-VV3YIU5W.js +25 -0
- package/dist/chunk-VV3YIU5W.js.map +1 -0
- package/dist/{chunk-GLVENTN6.js → chunk-WXLO33YP.js} +2 -2
- package/dist/chunk-XWPHTXEM.js +529 -0
- package/dist/chunk-XWPHTXEM.js.map +1 -0
- package/dist/chunk-YEXRTXTE.js +315 -0
- package/dist/chunk-YEXRTXTE.js.map +1 -0
- package/dist/{chunk-WMJDOMG6.js → chunk-ZELGKLW5.js} +4 -4
- package/dist/composer-projection.d.ts +37 -0
- package/dist/composer-projection.js +21 -0
- package/dist/composer-projection.js.map +1 -0
- package/dist/context-mention-palette/index.js +9 -7
- package/dist/conversation-projection.d.ts +551 -0
- package/dist/conversation-projection.js +42 -0
- package/dist/conversation-projection.js.map +1 -0
- package/dist/conversation-rail-projection.js +3 -3
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +32 -13
- package/dist/index.js +22 -16
- package/dist/index.js.map +1 -1
- package/dist/mention-search.js +7 -5
- package/dist/{types-CHAMK2g7.d.ts → types-DtXXsISB.d.ts} +1 -1
- package/dist/workbench/contribution.js +4 -4
- package/dist/workbench/index.js +4 -4
- package/dist/workbench/sessionTitle.js +3 -3
- package/dist/workspace-agent-generated-files.d.ts +1 -12
- package/dist/workspaceAgentActivityListTypes-BUKNyMbh.d.ts +48 -0
- package/dist/{workspaceLinkActions-CzsbvGmC.d.ts → workspaceLinkActions-DxyzMy10.d.ts} +13 -12
- package/package.json +31 -17
- package/dist/chunk-2L2LVSOD.js.map +0 -1
- package/dist/chunk-2STAUA73.js.map +0 -1
- package/dist/chunk-EDP4D42H.js.map +0 -1
- package/dist/chunk-M6WEFXPL.js.map +0 -1
- package/dist/chunk-N5356722.js.map +0 -1
- package/dist/chunk-WGCDSA7P.js.map +0 -1
- package/dist/chunk-ZXEICU6J.js.map +0 -1
- /package/dist/{AgentRichTextReadonly-U3XUJYCW.js.map → AgentRichTextReadonly-CCELQPHE.js.map} +0 -0
- /package/dist/{chunk-T57ZZWTC.js.map → chunk-4HAG3FOY.js.map} +0 -0
- /package/dist/{chunk-ZBI6R46N.js.map → chunk-5DN5N2XS.js.map} +0 -0
- /package/dist/{chunk-BCBB4HOV.js.map → chunk-634MNSI5.js.map} +0 -0
- /package/dist/{chunk-JA6XAKKE.js.map → chunk-TWF6JXPC.js.map} +0 -0
- /package/dist/{chunk-7AYFKNLD.js.map → chunk-TWMV6YTX.js.map} +0 -0
- /package/dist/{chunk-GLVENTN6.js.map → chunk-WXLO33YP.js.map} +0 -0
- /package/dist/{chunk-WMJDOMG6.js.map → chunk-ZELGKLW5.js.map} +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
translate
|
|
3
|
+
} from "./chunk-WXLO33YP.js";
|
|
4
|
+
import {
|
|
5
|
+
agentGUIProviderIdentityDisplayName,
|
|
6
|
+
resolveMigratedAgentGUIProviderIdentity
|
|
7
|
+
} from "./chunk-O433KXLK.js";
|
|
8
|
+
|
|
9
|
+
// shared/workspaceAgentProviderLabel.ts
|
|
10
|
+
function workspaceAgentProviderLabel(provider) {
|
|
11
|
+
const normalized = provider.trim().toLowerCase();
|
|
12
|
+
const migratedIdentity = resolveMigratedAgentGUIProviderIdentity(normalized);
|
|
13
|
+
if (migratedIdentity) {
|
|
14
|
+
return agentGUIProviderIdentityDisplayName(migratedIdentity, translate);
|
|
15
|
+
}
|
|
16
|
+
return titleCase(provider);
|
|
17
|
+
}
|
|
18
|
+
function titleCase(value) {
|
|
19
|
+
return value.split(/[-_\s]+/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
workspaceAgentProviderLabel
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=chunk-VV3YIU5W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../shared/workspaceAgentProviderLabel.ts"],"sourcesContent":["import {\n agentGUIProviderIdentityDisplayName,\n resolveMigratedAgentGUIProviderIdentity\n} from \"../providerIdentityCatalog.ts\";\nimport { translate } from \"../i18n/index.ts\";\n\nexport function workspaceAgentProviderLabel(provider: string): string {\n const normalized = provider.trim().toLowerCase();\n const migratedIdentity = resolveMigratedAgentGUIProviderIdentity(normalized);\n if (migratedIdentity) {\n return agentGUIProviderIdentityDisplayName(migratedIdentity, translate);\n }\n return titleCase(provider);\n}\n\nfunction titleCase(value: string): string {\n return value\n .split(/[-_\\s]+/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(\" \");\n}\n"],"mappings":";;;;;;;;;AAMO,SAAS,4BAA4B,UAA0B;AACpE,QAAM,aAAa,SAAS,KAAK,EAAE,YAAY;AAC/C,QAAM,mBAAmB,wCAAwC,UAAU;AAC3E,MAAI,kBAAkB;AACpB,WAAO,oCAAoC,kBAAkB,SAAS;AAAA,EACxE;AACA,SAAO,UAAU,QAAQ;AAC3B;AAEA,SAAS,UAAU,OAAuB;AACxC,SAAO,MACJ,MAAM,SAAS,EACf,OAAO,OAAO,EACd,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC,CAAC,EAC1D,KAAK,GAAG;AACb;","names":[]}
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
setCurrentAgentGuiI18nRuntime,
|
|
7
7
|
translate,
|
|
8
8
|
translateInUiLanguage
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KK7YXPTS.js";
|
|
10
10
|
|
|
11
11
|
// i18n/index.ts
|
|
12
12
|
import React, {
|
|
@@ -68,4 +68,4 @@ export {
|
|
|
68
68
|
AgentGuiI18nProvider,
|
|
69
69
|
useTranslation
|
|
70
70
|
};
|
|
71
|
-
//# sourceMappingURL=chunk-
|
|
71
|
+
//# sourceMappingURL=chunk-WXLO33YP.js.map
|
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
// shared/agentMcpToolTarget.ts
|
|
2
|
+
function extractAgentMcpToolTarget({
|
|
3
|
+
input: rawInput,
|
|
4
|
+
metadata: rawMetadata,
|
|
5
|
+
payload: rawPayload,
|
|
6
|
+
toolName
|
|
7
|
+
}) {
|
|
8
|
+
const payload = objectValue(rawPayload);
|
|
9
|
+
const input = objectValue(rawInput) ?? objectValue(payload?.input);
|
|
10
|
+
const metadata = objectValue(rawMetadata) ?? objectValue(payload?.metadata);
|
|
11
|
+
const toolCall = objectValue(input?.toolCall);
|
|
12
|
+
const toolCallRawInput = objectValue(toolCall?.rawInput);
|
|
13
|
+
const request = objectValue(input?.request) ?? objectValue(toolCall?.request);
|
|
14
|
+
const requestMeta = objectValue(request?._meta);
|
|
15
|
+
const parsedToolName = parseMcpToolName(
|
|
16
|
+
firstString(toolName, stringValue(metadata?.toolName))
|
|
17
|
+
);
|
|
18
|
+
const server = firstString(
|
|
19
|
+
stringValue(metadata?.server),
|
|
20
|
+
stringValue(metadata?.serverName),
|
|
21
|
+
stringValue(metadata?.mcpServer),
|
|
22
|
+
stringValue(input?.server),
|
|
23
|
+
stringValue(input?.server_name),
|
|
24
|
+
stringValue(input?.serverName),
|
|
25
|
+
stringValue(input?.mcpServer),
|
|
26
|
+
stringValue(toolCall?.server),
|
|
27
|
+
stringValue(toolCall?.server_name),
|
|
28
|
+
stringValue(toolCall?.serverName),
|
|
29
|
+
stringValue(toolCallRawInput?.server),
|
|
30
|
+
stringValue(toolCallRawInput?.server_name),
|
|
31
|
+
stringValue(toolCallRawInput?.serverName),
|
|
32
|
+
parsedToolName?.server
|
|
33
|
+
);
|
|
34
|
+
const tool = firstString(
|
|
35
|
+
stringValue(metadata?.toolName),
|
|
36
|
+
stringValue(metadata?.tool),
|
|
37
|
+
stringValue(input?.tool),
|
|
38
|
+
stringValue(input?.toolName),
|
|
39
|
+
stringValue(toolCall?.tool),
|
|
40
|
+
stringValue(toolCall?.toolName),
|
|
41
|
+
stringValue(toolCallRawInput?.tool),
|
|
42
|
+
stringValue(toolCallRawInput?.toolName),
|
|
43
|
+
parsedToolName?.tool
|
|
44
|
+
);
|
|
45
|
+
if (!server || !tool) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
server,
|
|
50
|
+
tool,
|
|
51
|
+
displayName: formatAgentMcpToolTarget({ server, tool }),
|
|
52
|
+
instruction: firstString(
|
|
53
|
+
formatToolParamsDisplay(requestMeta?.tool_params_display),
|
|
54
|
+
formatObjectInstruction(requestMeta?.tool_params),
|
|
55
|
+
formatObjectInstruction(input?.arguments),
|
|
56
|
+
formatObjectInstruction(toolCallRawInput?.arguments)
|
|
57
|
+
) ?? null
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function formatAgentMcpToolTarget({
|
|
61
|
+
server,
|
|
62
|
+
tool
|
|
63
|
+
}) {
|
|
64
|
+
return `${server} / ${tool}`;
|
|
65
|
+
}
|
|
66
|
+
function parseMcpToolName(value) {
|
|
67
|
+
const match = value?.match(/^mcp__([^_]+(?:_[^_]+)*)__(.+)$/i);
|
|
68
|
+
if (!match) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
const server = match[1]?.replace(/_/gu, "-").trim();
|
|
72
|
+
const tool = match[2]?.trim();
|
|
73
|
+
return server && tool ? { server, tool } : null;
|
|
74
|
+
}
|
|
75
|
+
function firstString(...values) {
|
|
76
|
+
return values.find((value) => value !== null && value !== void 0) ?? null;
|
|
77
|
+
}
|
|
78
|
+
function formatToolParamsDisplay(value) {
|
|
79
|
+
if (!Array.isArray(value)) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
const parts = value.flatMap((entry) => {
|
|
83
|
+
const record = objectValue(entry);
|
|
84
|
+
const name = stringValue(record?.display_name) ?? stringValue(record?.displayName) ?? stringValue(record?.name);
|
|
85
|
+
const rawValue = record?.value;
|
|
86
|
+
const formattedValue = formatInstructionValue(rawValue);
|
|
87
|
+
return name && formattedValue ? [`${name}: ${formattedValue}`] : [];
|
|
88
|
+
});
|
|
89
|
+
return parts.length > 0 ? parts.join(", ") : null;
|
|
90
|
+
}
|
|
91
|
+
function formatObjectInstruction(value) {
|
|
92
|
+
const record = objectValue(value);
|
|
93
|
+
if (!record) {
|
|
94
|
+
return stringValue(value);
|
|
95
|
+
}
|
|
96
|
+
const parts = Object.entries(record).flatMap(([key, rawValue]) => {
|
|
97
|
+
const formattedValue = formatInstructionValue(rawValue);
|
|
98
|
+
return formattedValue ? [`${key}: ${formattedValue}`] : [];
|
|
99
|
+
});
|
|
100
|
+
return parts.length > 0 ? parts.join(", ") : null;
|
|
101
|
+
}
|
|
102
|
+
function formatInstructionValue(value) {
|
|
103
|
+
if (typeof value === "string") {
|
|
104
|
+
return stringValue(value);
|
|
105
|
+
}
|
|
106
|
+
if (typeof value === "number" || typeof value === "boolean" || value === null) {
|
|
107
|
+
return String(value);
|
|
108
|
+
}
|
|
109
|
+
if (Array.isArray(value)) {
|
|
110
|
+
const parts = value.flatMap((entry) => {
|
|
111
|
+
const formattedValue = formatInstructionValue(entry);
|
|
112
|
+
return formattedValue ? [formattedValue] : [];
|
|
113
|
+
});
|
|
114
|
+
return parts.length > 0 ? parts.join(", ") : null;
|
|
115
|
+
}
|
|
116
|
+
if (objectValue(value)) {
|
|
117
|
+
return stableJsonValue(value);
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
function stableJsonValue(value) {
|
|
122
|
+
try {
|
|
123
|
+
return JSON.stringify(value);
|
|
124
|
+
} catch {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function stringValue(value) {
|
|
129
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
130
|
+
}
|
|
131
|
+
function objectValue(value) {
|
|
132
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// shared/agentConversation/agentApprovalPurpose.ts
|
|
136
|
+
function normalizeAgentApprovalPurpose(value) {
|
|
137
|
+
return value === "edit-files" ? value : null;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// shared/agentConversation/exitPlanOptions.ts
|
|
141
|
+
var EXIT_PLAN_KEEP_PLANNING_OPTION_ID = "plan";
|
|
142
|
+
function isExitPlanSwitchModeInput(input) {
|
|
143
|
+
const record = recordValue(input);
|
|
144
|
+
const toolCall = recordValue(record.toolCall);
|
|
145
|
+
if (normalizeToken(stringValue2(toolCall.kind)) !== "switchmode") {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
return collectRawOptions(record).some(
|
|
149
|
+
(option) => normalizeToken(rawOptionId(option)) === EXIT_PLAN_KEEP_PLANNING_OPTION_ID
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
function extractExitPlanModeOptions(input, payload) {
|
|
153
|
+
const sources = payload === void 0 ? [recordValue(input)] : [recordValue(input), recordValue(payload)];
|
|
154
|
+
return sources.flatMap(collectRawOptions).flatMap((option) => {
|
|
155
|
+
const id = rawOptionId(option);
|
|
156
|
+
if (!id || normalizeToken(id) === EXIT_PLAN_KEEP_PLANNING_OPTION_ID) {
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
159
|
+
return [
|
|
160
|
+
{
|
|
161
|
+
id,
|
|
162
|
+
label: stringValue2(option.name) ?? stringValue2(option.label) ?? stringValue2(option.title) ?? stringValue2(option.kind) ?? id,
|
|
163
|
+
kind: stringValue2(option.kind) ?? id,
|
|
164
|
+
...stringValue2(option.description) ? { description: stringValue2(option.description) } : {}
|
|
165
|
+
}
|
|
166
|
+
];
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function extractExitPlanKeepPlanningOptionId(input, payload) {
|
|
170
|
+
const sources = payload === void 0 ? [recordValue(input)] : [recordValue(input), recordValue(payload)];
|
|
171
|
+
for (const option of sources.flatMap(collectRawOptions)) {
|
|
172
|
+
const id = rawOptionId(option);
|
|
173
|
+
if (id && normalizeToken(id) === EXIT_PLAN_KEEP_PLANNING_OPTION_ID) {
|
|
174
|
+
return id;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
function collectRawOptions(record) {
|
|
180
|
+
return arrayValue(record.options).map(recordValue);
|
|
181
|
+
}
|
|
182
|
+
function rawOptionId(option) {
|
|
183
|
+
return stringValue2(option.optionId) ?? stringValue2(option.id) ?? stringValue2(option.kind) ?? "";
|
|
184
|
+
}
|
|
185
|
+
function normalizeToken(value) {
|
|
186
|
+
return (value ?? "").replace(/[_\s-]+/g, "").trim().toLowerCase();
|
|
187
|
+
}
|
|
188
|
+
function stringValue2(value) {
|
|
189
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
190
|
+
}
|
|
191
|
+
function recordValue(value) {
|
|
192
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
193
|
+
}
|
|
194
|
+
function arrayValue(value) {
|
|
195
|
+
return Array.isArray(value) ? value : [];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// shared/agentConversation/askUserQuestions.ts
|
|
199
|
+
function normalizeAskUserQuestions(rawQuestions, options = {}) {
|
|
200
|
+
const missingText = options.missingText ?? null;
|
|
201
|
+
return arrayValue2(rawQuestions).flatMap((value, index) => {
|
|
202
|
+
const question = objectValue2(value);
|
|
203
|
+
if (!question) {
|
|
204
|
+
return [];
|
|
205
|
+
}
|
|
206
|
+
return [
|
|
207
|
+
{
|
|
208
|
+
id: stringValue3(question.id) ?? `question-${index + 1}`,
|
|
209
|
+
header: stringValue3(question.header) ?? missingText ?? `Question ${index + 1}`,
|
|
210
|
+
question: stringValue3(question.question) ?? stringValue3(question.header) ?? missingText ?? `Question ${index + 1}`,
|
|
211
|
+
options: arrayValue2(question.options).flatMap((optionValue) => {
|
|
212
|
+
const option = objectValue2(optionValue);
|
|
213
|
+
const label = stringValue3(option?.label);
|
|
214
|
+
if (!label) {
|
|
215
|
+
return [];
|
|
216
|
+
}
|
|
217
|
+
return [
|
|
218
|
+
{
|
|
219
|
+
label,
|
|
220
|
+
description: stringValue3(option?.description) ?? ""
|
|
221
|
+
}
|
|
222
|
+
];
|
|
223
|
+
}),
|
|
224
|
+
multiSelect: Boolean(question.multiSelect)
|
|
225
|
+
}
|
|
226
|
+
];
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
function stringValue3(value) {
|
|
230
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
231
|
+
}
|
|
232
|
+
function objectValue2(value) {
|
|
233
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
234
|
+
}
|
|
235
|
+
function arrayValue2(value) {
|
|
236
|
+
return Array.isArray(value) ? value : [];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// actions/portableWorkspaceNavigationActions.ts
|
|
240
|
+
import { parseRichTextMentionHref } from "@tutti-os/ui-rich-text/core";
|
|
241
|
+
|
|
242
|
+
// shared/utils/websiteUrl.ts
|
|
243
|
+
var ALLOWED_WEBSITE_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:"]);
|
|
244
|
+
var LIKELY_HOST_PATTERN = /^(localhost|(\d{1,3}\.){3}\d{1,3}|(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})(?::\d{1,5})?(?:[/?#][^\s]*)?$/i;
|
|
245
|
+
var EXPLICIT_PROTOCOL_PATTERN = /^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//;
|
|
246
|
+
var LOOPBACK_HOST_PATTERN = /^(localhost|127(?:\.\d{1,3}){3})(?::\d{1,5})?(?:[/?#][^\s]*)?$/i;
|
|
247
|
+
function defaultSchemeForHostInput(value) {
|
|
248
|
+
return LOOPBACK_HOST_PATTERN.test(value) ? "http" : "https";
|
|
249
|
+
}
|
|
250
|
+
function resolveWebsiteNavigationUrl(rawUrl) {
|
|
251
|
+
const trimmed = rawUrl.trim();
|
|
252
|
+
if (trimmed.length === 0) {
|
|
253
|
+
return { url: null, error: null };
|
|
254
|
+
}
|
|
255
|
+
if (EXPLICIT_PROTOCOL_PATTERN.test(trimmed)) {
|
|
256
|
+
try {
|
|
257
|
+
const parsed = new URL(trimmed);
|
|
258
|
+
if (!ALLOWED_WEBSITE_PROTOCOLS.has(parsed.protocol)) {
|
|
259
|
+
return { url: null, error: `Unsupported protocol: ${parsed.protocol}` };
|
|
260
|
+
}
|
|
261
|
+
return { url: parsed.toString(), error: null };
|
|
262
|
+
} catch {
|
|
263
|
+
return { url: null, error: "Invalid URL" };
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (!LIKELY_HOST_PATTERN.test(trimmed)) {
|
|
267
|
+
return { url: null, error: "Invalid URL" };
|
|
268
|
+
}
|
|
269
|
+
try {
|
|
270
|
+
const parsed = new URL(
|
|
271
|
+
`${defaultSchemeForHostInput(trimmed)}://${trimmed}`
|
|
272
|
+
);
|
|
273
|
+
return { url: parsed.toString(), error: null };
|
|
274
|
+
} catch {
|
|
275
|
+
return { url: null, error: "Invalid URL" };
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// actions/portableWorkspaceNavigationActions.ts
|
|
280
|
+
function resolveWorkspaceUrlLinkAction({
|
|
281
|
+
url,
|
|
282
|
+
source
|
|
283
|
+
}) {
|
|
284
|
+
const resolved = resolveWebsiteNavigationUrl(url);
|
|
285
|
+
if (!resolved.url || resolved.error) {
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
type: "open-url",
|
|
290
|
+
url: resolved.url,
|
|
291
|
+
source
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
function resolveAgentSessionMentionLinkAction({
|
|
295
|
+
href,
|
|
296
|
+
source
|
|
297
|
+
}) {
|
|
298
|
+
const mention = parseRichTextMentionHref(href, "");
|
|
299
|
+
if (!mention || mention.providerId !== "agent-session") {
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
const workspaceId = mention.scope?.workspaceId?.trim() || "";
|
|
303
|
+
const agentSessionId = mention.entityId.trim();
|
|
304
|
+
if (!workspaceId || !agentSessionId) {
|
|
305
|
+
return null;
|
|
306
|
+
}
|
|
307
|
+
const agentTargetId = mention.scope?.agentTargetId?.trim() || null;
|
|
308
|
+
return {
|
|
309
|
+
type: "open-agent-session",
|
|
310
|
+
workspaceId,
|
|
311
|
+
agentSessionId,
|
|
312
|
+
...agentTargetId ? { agentTargetId } : {},
|
|
313
|
+
source
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// actions/workspaceFilePathCandidate.ts
|
|
318
|
+
var URL_LIKE_LINK_PATTERN = /^[a-zA-Z][a-zA-Z\d+.-]*:|^#/;
|
|
319
|
+
var LOCAL_ASSET_ROOT = "/var/cache/tsh/local-assets";
|
|
320
|
+
function resolveWorkspaceFilePathCandidate({
|
|
321
|
+
path,
|
|
322
|
+
workspaceRoot,
|
|
323
|
+
basePath
|
|
324
|
+
}) {
|
|
325
|
+
const rawPath = decodeWorkspaceLinkPath(path.trim());
|
|
326
|
+
if (!rawPath || isUrlLikeWorkspaceFilePath(rawPath) || isUncWorkspaceFilePath(rawPath)) {
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
const normalizedPath = normalizeWorkspaceFilePath(rawPath);
|
|
330
|
+
if (isUnsupportedSpecialWorkspaceFilePath(normalizedPath)) {
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
if (isStagedLocalAssetPath(normalizedPath)) {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
if (isHomeRelativeWorkspaceFilePath(normalizedPath)) {
|
|
337
|
+
const directoryPath = dirnameForHomeRelativePath(normalizedPath);
|
|
338
|
+
return {
|
|
339
|
+
path: normalizedPath,
|
|
340
|
+
directoryPath,
|
|
341
|
+
workspaceRoot: normalizeWorkspaceFilePath(workspaceRoot?.trim() ?? "") || directoryPath
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
if (isAbsoluteLocalPath(normalizedPath) && (isDirectAgentGeneratedMediaPath(normalizedPath) || isDirectWorkspaceAppDataPath(normalizedPath))) {
|
|
345
|
+
const directoryPath = dirname(normalizedPath);
|
|
346
|
+
return {
|
|
347
|
+
path: normalizedPath,
|
|
348
|
+
directoryPath,
|
|
349
|
+
workspaceRoot: normalizeWorkspaceFilePath(workspaceRoot?.trim() ?? "") || directoryPath
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
const selectedRoot = normalizeWorkspaceFilePath(workspaceRoot?.trim() ?? "");
|
|
353
|
+
const sessionRoot = normalizeWorkspaceFilePath(basePath?.trim() ?? "");
|
|
354
|
+
const root = selectedRoot || sessionRoot;
|
|
355
|
+
if (!root) {
|
|
356
|
+
return null;
|
|
357
|
+
}
|
|
358
|
+
if (isAbsoluteLocalPath(normalizedPath)) {
|
|
359
|
+
const directoryPath = dirname(normalizedPath);
|
|
360
|
+
return {
|
|
361
|
+
path: normalizedPath,
|
|
362
|
+
directoryPath,
|
|
363
|
+
workspaceRoot: root
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
const base = normalizeWorkspaceFilePath(basePath?.trim() || root);
|
|
367
|
+
const resolvedPath = normalizeWorkspaceFilePath(`${base}/${normalizedPath}`);
|
|
368
|
+
if (!isInsideOrEqualWorkspaceFilePath(resolvedPath, root) && !isDirectAgentGeneratedMediaPath(resolvedPath)) {
|
|
369
|
+
return null;
|
|
370
|
+
}
|
|
371
|
+
return {
|
|
372
|
+
path: resolvedPath,
|
|
373
|
+
directoryPath: resolvedPath === root ? root : dirname(resolvedPath),
|
|
374
|
+
workspaceRoot: root
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
function normalizeWorkspaceFilePath(path) {
|
|
378
|
+
const normalizedPath = path.trim().replaceAll("\\", "/");
|
|
379
|
+
const drive = /^[A-Za-z]:/.exec(normalizedPath)?.[0] ?? "";
|
|
380
|
+
const startsWithSlash = normalizedPath.startsWith("/");
|
|
381
|
+
const pathBody = drive ? normalizedPath.slice(drive.length) : startsWithSlash ? normalizedPath.slice(1) : normalizedPath;
|
|
382
|
+
const parts = [];
|
|
383
|
+
for (const part of pathBody.split("/")) {
|
|
384
|
+
if (!part || part === ".") {
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
387
|
+
if (part === "..") {
|
|
388
|
+
parts.pop();
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
parts.push(part);
|
|
392
|
+
}
|
|
393
|
+
if (drive) {
|
|
394
|
+
return parts.length > 0 ? `${drive}/${parts.join("/")}` : `${drive}/`;
|
|
395
|
+
}
|
|
396
|
+
if (startsWithSlash) {
|
|
397
|
+
return parts.length > 0 ? `/${parts.join("/")}` : "/";
|
|
398
|
+
}
|
|
399
|
+
return parts.join("/");
|
|
400
|
+
}
|
|
401
|
+
function isUrlLikeWorkspaceFilePath(path) {
|
|
402
|
+
if (path.startsWith("#")) {
|
|
403
|
+
return true;
|
|
404
|
+
}
|
|
405
|
+
if (isWindowsAbsolutePath(path.trim().replaceAll("\\", "/"))) {
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
return URL_LIKE_LINK_PATTERN.test(path);
|
|
409
|
+
}
|
|
410
|
+
function decodeWorkspaceLinkPath(path) {
|
|
411
|
+
if (!path.includes("%")) {
|
|
412
|
+
return path;
|
|
413
|
+
}
|
|
414
|
+
try {
|
|
415
|
+
return decodeURI(path);
|
|
416
|
+
} catch {
|
|
417
|
+
return path;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function workspaceFilePathBasename(path) {
|
|
421
|
+
return path.split("/").filter(Boolean).at(-1) ?? path;
|
|
422
|
+
}
|
|
423
|
+
function isInsideOrEqualWorkspaceFilePath(path, root) {
|
|
424
|
+
if (root === "/") {
|
|
425
|
+
return path.startsWith("/");
|
|
426
|
+
}
|
|
427
|
+
const comparison = isWindowsAbsolutePath(root) || isWindowsAbsolutePath(path) ? { path: path.toLowerCase(), root: root.toLowerCase() } : { path, root };
|
|
428
|
+
return comparison.path === comparison.root || comparison.path.startsWith(`${comparison.root}/`);
|
|
429
|
+
}
|
|
430
|
+
function isDirectAgentGeneratedMediaPath(path) {
|
|
431
|
+
if (!isAbsoluteLocalPath(path)) {
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
const statePath = getTuttiStatePathSegments(path);
|
|
435
|
+
if (!statePath) {
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
438
|
+
if (statePath[1] !== "agent" || statePath[2] !== "runs" || !statePath.includes("generated_images") && !statePath.includes("generated_videos")) {
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
441
|
+
return /\.(?:png|jpe?g|gif|webp|bmp|mp4|webm)$/i.test(path);
|
|
442
|
+
}
|
|
443
|
+
function isAbsoluteLocalPath(path) {
|
|
444
|
+
return path.startsWith("/") || isWindowsAbsolutePath(path);
|
|
445
|
+
}
|
|
446
|
+
function isHomeRelativeWorkspaceFilePath(path) {
|
|
447
|
+
return path === "~" || path.startsWith("~/");
|
|
448
|
+
}
|
|
449
|
+
function dirnameForHomeRelativePath(path) {
|
|
450
|
+
return path === "~" ? "~" : dirname(path);
|
|
451
|
+
}
|
|
452
|
+
function isWindowsAbsolutePath(path) {
|
|
453
|
+
return /^[A-Za-z]:\//.test(path);
|
|
454
|
+
}
|
|
455
|
+
function isUncWorkspaceFilePath(path) {
|
|
456
|
+
return /^(?:\\\\|\/\/)[^/\\]+[/\\][^/\\]+/.test(path);
|
|
457
|
+
}
|
|
458
|
+
function isUnsupportedSpecialWorkspaceFilePath(path) {
|
|
459
|
+
const comparisonPath = cleanWorkspaceFilePathForComparison(path);
|
|
460
|
+
return comparisonPath === "/dev/null" || comparisonPath.split("/").some((segment) => {
|
|
461
|
+
const normalized = segment.trim().replace(/[. ]+$/g, "");
|
|
462
|
+
const deviceName = normalized.split(".", 1)[0]?.toUpperCase();
|
|
463
|
+
return deviceName === "NUL";
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
function cleanWorkspaceFilePathForComparison(path) {
|
|
467
|
+
const normalized = path.replace(/\/+/g, "/");
|
|
468
|
+
const parts = [];
|
|
469
|
+
for (const part of normalized.split("/")) {
|
|
470
|
+
if (!part || part === ".") {
|
|
471
|
+
continue;
|
|
472
|
+
}
|
|
473
|
+
if (part === "..") {
|
|
474
|
+
parts.pop();
|
|
475
|
+
continue;
|
|
476
|
+
}
|
|
477
|
+
parts.push(part);
|
|
478
|
+
}
|
|
479
|
+
return normalized.startsWith("/") ? `/${parts.join("/")}` : parts.join("/");
|
|
480
|
+
}
|
|
481
|
+
function dirname(path) {
|
|
482
|
+
const index = path.lastIndexOf("/");
|
|
483
|
+
if (index <= 0) {
|
|
484
|
+
return "/";
|
|
485
|
+
}
|
|
486
|
+
return path.slice(0, index);
|
|
487
|
+
}
|
|
488
|
+
function isStagedLocalAssetPath(path) {
|
|
489
|
+
return path !== LOCAL_ASSET_ROOT && isInsideOrEqualWorkspaceFilePath(path, LOCAL_ASSET_ROOT);
|
|
490
|
+
}
|
|
491
|
+
function isDirectWorkspaceAppDataPath(path) {
|
|
492
|
+
if (!isAbsoluteLocalPath(path)) {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
const statePath = getTuttiStatePathSegments(path);
|
|
496
|
+
if (!statePath) {
|
|
497
|
+
return false;
|
|
498
|
+
}
|
|
499
|
+
return statePath[1] === "apps" && statePath[2] === "workspaces" && statePath.length > 5;
|
|
500
|
+
}
|
|
501
|
+
function getTuttiStatePathSegments(path) {
|
|
502
|
+
const segments = path.split("/").filter(Boolean);
|
|
503
|
+
const stateRootIndex = segments.findIndex(
|
|
504
|
+
(segment) => segment === ".tutti" || segment === ".tutti-dev"
|
|
505
|
+
);
|
|
506
|
+
if (stateRootIndex < 0) {
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
return segments.slice(stateRootIndex);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
export {
|
|
513
|
+
extractAgentMcpToolTarget,
|
|
514
|
+
normalizeAgentApprovalPurpose,
|
|
515
|
+
isExitPlanSwitchModeInput,
|
|
516
|
+
extractExitPlanModeOptions,
|
|
517
|
+
extractExitPlanKeepPlanningOptionId,
|
|
518
|
+
normalizeAskUserQuestions,
|
|
519
|
+
resolveWorkspaceFilePathCandidate,
|
|
520
|
+
normalizeWorkspaceFilePath,
|
|
521
|
+
isUrlLikeWorkspaceFilePath,
|
|
522
|
+
decodeWorkspaceLinkPath,
|
|
523
|
+
workspaceFilePathBasename,
|
|
524
|
+
isInsideOrEqualWorkspaceFilePath,
|
|
525
|
+
isDirectAgentGeneratedMediaPath,
|
|
526
|
+
resolveWorkspaceUrlLinkAction,
|
|
527
|
+
resolveAgentSessionMentionLinkAction
|
|
528
|
+
};
|
|
529
|
+
//# sourceMappingURL=chunk-XWPHTXEM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../shared/agentMcpToolTarget.ts","../shared/agentConversation/agentApprovalPurpose.ts","../shared/agentConversation/exitPlanOptions.ts","../shared/agentConversation/askUserQuestions.ts","../actions/portableWorkspaceNavigationActions.ts","../shared/utils/websiteUrl.ts","../actions/workspaceFilePathCandidate.ts"],"sourcesContent":["export interface AgentMcpToolTarget {\n server: string;\n tool: string;\n displayName: string;\n instruction: string | null;\n}\n\nexport interface ExtractAgentMcpToolTargetInput {\n input?: Record<string, unknown> | null;\n metadata?: Record<string, unknown> | null;\n name?: string | null;\n payload?: Record<string, unknown> | null;\n toolName?: string | null;\n}\n\nexport function extractAgentMcpToolTarget({\n input: rawInput,\n metadata: rawMetadata,\n payload: rawPayload,\n toolName\n}: ExtractAgentMcpToolTargetInput): AgentMcpToolTarget | null {\n const payload = objectValue(rawPayload);\n const input = objectValue(rawInput) ?? objectValue(payload?.input);\n const metadata = objectValue(rawMetadata) ?? objectValue(payload?.metadata);\n const toolCall = objectValue(input?.toolCall);\n const toolCallRawInput = objectValue(toolCall?.rawInput);\n const request = objectValue(input?.request) ?? objectValue(toolCall?.request);\n const requestMeta = objectValue(request?._meta);\n const parsedToolName = parseMcpToolName(\n firstString(toolName, stringValue(metadata?.toolName))\n );\n const server = firstString(\n stringValue(metadata?.server),\n stringValue(metadata?.serverName),\n stringValue(metadata?.mcpServer),\n stringValue(input?.server),\n stringValue(input?.server_name),\n stringValue(input?.serverName),\n stringValue(input?.mcpServer),\n stringValue(toolCall?.server),\n stringValue(toolCall?.server_name),\n stringValue(toolCall?.serverName),\n stringValue(toolCallRawInput?.server),\n stringValue(toolCallRawInput?.server_name),\n stringValue(toolCallRawInput?.serverName),\n parsedToolName?.server\n );\n const tool = firstString(\n stringValue(metadata?.toolName),\n stringValue(metadata?.tool),\n stringValue(input?.tool),\n stringValue(input?.toolName),\n stringValue(toolCall?.tool),\n stringValue(toolCall?.toolName),\n stringValue(toolCallRawInput?.tool),\n stringValue(toolCallRawInput?.toolName),\n parsedToolName?.tool\n );\n if (!server || !tool) {\n return null;\n }\n return {\n server,\n tool,\n displayName: formatAgentMcpToolTarget({ server, tool }),\n instruction:\n firstString(\n formatToolParamsDisplay(requestMeta?.tool_params_display),\n formatObjectInstruction(requestMeta?.tool_params),\n formatObjectInstruction(input?.arguments),\n formatObjectInstruction(toolCallRawInput?.arguments)\n ) ?? null\n };\n}\n\nexport function formatAgentMcpToolTarget({\n server,\n tool\n}: {\n server: string;\n tool: string;\n}): string {\n return `${server} / ${tool}`;\n}\n\nfunction parseMcpToolName(\n value: string | null\n): { server: string; tool: string } | null {\n const match = value?.match(/^mcp__([^_]+(?:_[^_]+)*)__(.+)$/i);\n if (!match) {\n return null;\n }\n const server = match[1]?.replace(/_/gu, \"-\").trim();\n const tool = match[2]?.trim();\n return server && tool ? { server, tool } : null;\n}\n\nfunction firstString(\n ...values: Array<string | null | undefined>\n): string | null {\n return values.find((value) => value !== null && value !== undefined) ?? null;\n}\n\nfunction formatToolParamsDisplay(value: unknown): string | null {\n if (!Array.isArray(value)) {\n return null;\n }\n const parts = value.flatMap((entry) => {\n const record = objectValue(entry);\n const name =\n stringValue(record?.display_name) ??\n stringValue(record?.displayName) ??\n stringValue(record?.name);\n const rawValue = record?.value;\n const formattedValue = formatInstructionValue(rawValue);\n return name && formattedValue ? [`${name}: ${formattedValue}`] : [];\n });\n return parts.length > 0 ? parts.join(\", \") : null;\n}\n\nfunction formatObjectInstruction(value: unknown): string | null {\n const record = objectValue(value);\n if (!record) {\n return stringValue(value);\n }\n const parts = Object.entries(record).flatMap(([key, rawValue]) => {\n const formattedValue = formatInstructionValue(rawValue);\n return formattedValue ? [`${key}: ${formattedValue}`] : [];\n });\n return parts.length > 0 ? parts.join(\", \") : null;\n}\n\nfunction formatInstructionValue(value: unknown): string | null {\n if (typeof value === \"string\") {\n return stringValue(value);\n }\n if (\n typeof value === \"number\" ||\n typeof value === \"boolean\" ||\n value === null\n ) {\n return String(value);\n }\n if (Array.isArray(value)) {\n const parts = value.flatMap((entry) => {\n const formattedValue = formatInstructionValue(entry);\n return formattedValue ? [formattedValue] : [];\n });\n return parts.length > 0 ? parts.join(\", \") : null;\n }\n if (objectValue(value)) {\n return stableJsonValue(value);\n }\n return null;\n}\n\nfunction stableJsonValue(value: unknown): string | null {\n try {\n return JSON.stringify(value);\n } catch {\n return null;\n }\n}\n\nfunction stringValue(value: unknown): string | null {\n return typeof value === \"string\" && value.trim() ? value.trim() : null;\n}\n\nfunction objectValue(value: unknown): Record<string, unknown> | null {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null;\n}\n","export type AgentApprovalPurpose = \"edit-files\";\n\nexport function normalizeAgentApprovalPurpose(\n value: unknown\n): AgentApprovalPurpose | null {\n return value === \"edit-files\" ? value : null;\n}\n","import type { AgentApprovalOptionVM } from \"./contracts/agentApprovalItemVM\";\n\n// Shared exit-plan (Claude Code `switch_mode`) detection and option extraction.\n//\n// Claude Code surfaces \"exit plan mode\" as a permission/approval whose\n// `input.toolCall.kind` is `switch_mode` and whose options are the permission\n// modes to switch into (\"Yes, and bypass permissions\" / \"...auto\" / etc.) plus\n// a trailing `plan` option (\"No, keep planning\"). Both the conversation and the\n// message-center deck must classify and render these identically, so the\n// detection + option normalization live here instead of being re-implemented at\n// each projection site (which is how they drifted in the first place).\n//\n// The runtime is the source of truth for the option set: callers render exactly\n// the modes it sent (so newly added modes like `auto` appear automatically)\n// rather than a hand-maintained list. The `plan` option is the keep-planning /\n// deny action and is filtered out of the mode list — callers render it as a\n// dedicated \"keep planning\" affordance.\n\nexport const EXIT_PLAN_KEEP_PLANNING_OPTION_ID = \"plan\";\n\nexport function isExitPlanSwitchModeInput(input: unknown): boolean {\n const record = recordValue(input);\n const toolCall = recordValue(record.toolCall);\n if (normalizeToken(stringValue(toolCall.kind)) !== \"switchmode\") {\n return false;\n }\n return collectRawOptions(record).some(\n (option) =>\n normalizeToken(rawOptionId(option)) === EXIT_PLAN_KEEP_PLANNING_OPTION_ID\n );\n}\n\n// Normalized \"Yes, and ...\" mode options, in runtime order, with the\n// keep-planning (`plan`) option removed. Returns [] when the payload carries no\n// options (e.g. Codex plan or the legacy `exitplanmode` tool), letting callers\n// fall back to a curated default list.\nexport function extractExitPlanModeOptions(\n input: unknown,\n payload?: unknown\n): AgentApprovalOptionVM[] {\n const sources =\n payload === undefined\n ? [recordValue(input)]\n : [recordValue(input), recordValue(payload)];\n return sources.flatMap(collectRawOptions).flatMap((option) => {\n // The emitted id must be the runtime's exact value (e.g. \"acceptEdits\",\n // \"auto\") — it is submitted back as the permission mode. Only the\n // keep-planning comparison is case/format-insensitive.\n const id = rawOptionId(option);\n if (!id || normalizeToken(id) === EXIT_PLAN_KEEP_PLANNING_OPTION_ID) {\n return [];\n }\n return [\n {\n id,\n label:\n stringValue(option.name) ??\n stringValue(option.label) ??\n stringValue(option.title) ??\n stringValue(option.kind) ??\n id,\n kind: stringValue(option.kind) ?? id,\n ...(stringValue(option.description)\n ? { description: stringValue(option.description) as string }\n : {})\n }\n ];\n });\n}\n\n// The runtime's keep-planning option id (\"No, keep planning\"), preserving its\n// exact casing so it can be submitted back. The daemon models exit-plan as an\n// approval that *requires* an option id — declining means selecting this option,\n// not sending a bare deny. Returns null when the payload has no plan option\n// (legacy `exitplanmode` / Codex), where callers fall back to a plain deny.\nexport function extractExitPlanKeepPlanningOptionId(\n input: unknown,\n payload?: unknown\n): string | null {\n const sources =\n payload === undefined\n ? [recordValue(input)]\n : [recordValue(input), recordValue(payload)];\n for (const option of sources.flatMap(collectRawOptions)) {\n const id = rawOptionId(option);\n if (id && normalizeToken(id) === EXIT_PLAN_KEEP_PLANNING_OPTION_ID) {\n return id;\n }\n }\n return null;\n}\n\nfunction collectRawOptions(\n record: Record<string, unknown>\n): Record<string, unknown>[] {\n return arrayValue(record.options).map(recordValue);\n}\n\nfunction rawOptionId(option: Record<string, unknown>): string {\n return (\n stringValue(option.optionId) ??\n stringValue(option.id) ??\n stringValue(option.kind) ??\n \"\"\n );\n}\n\nfunction normalizeToken(value: string | null | undefined): string {\n return (value ?? \"\")\n .replace(/[_\\s-]+/g, \"\")\n .trim()\n .toLowerCase();\n}\n\nfunction stringValue(value: unknown): string | null {\n return typeof value === \"string\" && value.trim() ? value.trim() : null;\n}\n\nfunction recordValue(value: unknown): Record<string, unknown> {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : {};\n}\n\nfunction arrayValue(value: unknown): unknown[] {\n return Array.isArray(value) ? value : [];\n}\n","import type { AgentAskUserQuestionVM } from \"./contracts/agentAskUserQuestionItemVM\";\n\n/**\n * Single source of truth for turning a raw AskUserQuestion tool input's\n * `questions` array into the view-model shape. Both the in-conversation tool\n * projection and the message-center derivation call this, so the two surfaces\n * can never drift on which fields they read or how they default them (the\n * exact class of bug that left the message-center card without its options).\n *\n * Input shape (codex / ACP): each entry may carry `id`, `header`, `question`,\n * `multiSelect`, and `options: [{ label, description }]`. Answers are layered on\n * by the caller (the live projection knows them; a pending prompt has none), so\n * this returns the answer-less base.\n */\nexport function normalizeAskUserQuestions(\n rawQuestions: unknown,\n options: { missingText?: string } = {}\n): AgentAskUserQuestionVM[] {\n const missingText = options.missingText ?? null;\n return arrayValue(rawQuestions).flatMap((value, index) => {\n const question = objectValue(value);\n if (!question) {\n return [];\n }\n return [\n {\n id: stringValue(question.id) ?? `question-${index + 1}`,\n header:\n stringValue(question.header) ??\n missingText ??\n `Question ${index + 1}`,\n question:\n stringValue(question.question) ??\n stringValue(question.header) ??\n missingText ??\n `Question ${index + 1}`,\n options: arrayValue(question.options).flatMap((optionValue) => {\n const option = objectValue(optionValue);\n const label = stringValue(option?.label);\n if (!label) {\n return [];\n }\n return [\n {\n label,\n description: stringValue(option?.description) ?? \"\"\n }\n ];\n }),\n multiSelect: Boolean(question.multiSelect)\n }\n ];\n });\n}\n\nfunction stringValue(value: unknown): string | null {\n return typeof value === \"string\" && value.trim() ? value.trim() : null;\n}\n\nfunction objectValue(value: unknown): Record<string, unknown> | null {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null;\n}\n\nfunction arrayValue(value: unknown): unknown[] {\n return Array.isArray(value) ? value : [];\n}\n","import { parseRichTextMentionHref } from \"@tutti-os/ui-rich-text/core\";\nimport { resolveWebsiteNavigationUrl } from \"../shared/utils/websiteUrl\";\n\nexport type WorkspaceLinkActionSource =\n | \"agent-markdown\"\n | \"agent-file-change\"\n | string;\n\nexport interface OpenWorkspaceUrlLinkAction {\n type: \"open-url\";\n url: string;\n source: WorkspaceLinkActionSource;\n}\n\nexport interface OpenAgentSessionLinkAction {\n type: \"open-agent-session\";\n workspaceId: string;\n agentSessionId: string;\n agentTargetId?: string | null;\n source: WorkspaceLinkActionSource;\n}\n\nexport interface ResolveWorkspaceUrlLinkActionInput {\n url: string;\n source: WorkspaceLinkActionSource;\n}\n\nexport interface ResolveAgentSessionMentionLinkActionInput {\n href: string;\n source: WorkspaceLinkActionSource;\n}\n\nexport function resolveWorkspaceUrlLinkAction({\n url,\n source\n}: ResolveWorkspaceUrlLinkActionInput): OpenWorkspaceUrlLinkAction | null {\n const resolved = resolveWebsiteNavigationUrl(url);\n if (!resolved.url || resolved.error) {\n return null;\n }\n\n return {\n type: \"open-url\",\n url: resolved.url,\n source\n };\n}\n\nexport function resolveAgentSessionMentionLinkAction({\n href,\n source\n}: ResolveAgentSessionMentionLinkActionInput): OpenAgentSessionLinkAction | null {\n const mention = parseRichTextMentionHref(href, \"\");\n if (!mention || mention.providerId !== \"agent-session\") {\n return null;\n }\n\n const workspaceId = mention.scope?.workspaceId?.trim() || \"\";\n const agentSessionId = mention.entityId.trim();\n if (!workspaceId || !agentSessionId) {\n return null;\n }\n\n const agentTargetId = mention.scope?.agentTargetId?.trim() || null;\n return {\n type: \"open-agent-session\",\n workspaceId,\n agentSessionId,\n ...(agentTargetId ? { agentTargetId } : {}),\n source\n };\n}\n","const ALLOWED_WEBSITE_PROTOCOLS = new Set([\"http:\", \"https:\"]);\nexport const DEFAULT_WEBSITE_NODE_URL = \"https://www.google.com/\";\nconst GOOGLE_SEARCH_BASE_URL = \"https://www.google.com/search\";\nconst LIKELY_HOST_PATTERN =\n /^(localhost|(\\d{1,3}\\.){3}\\d{1,3}|(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,})(?::\\d{1,5})?(?:[/?#][^\\s]*)?$/i;\nconst EXPLICIT_PROTOCOL_PATTERN = /^[a-zA-Z][a-zA-Z\\d+\\-.]*:\\/\\//;\nconst LOOPBACK_HOST_PATTERN =\n /^(localhost|127(?:\\.\\d{1,3}){3})(?::\\d{1,5})?(?:[/?#][^\\s]*)?$/i;\n\nfunction defaultSchemeForHostInput(value: string): \"http\" | \"https\" {\n return LOOPBACK_HOST_PATTERN.test(value) ? \"http\" : \"https\";\n}\n\nexport function resolveWebsiteNavigationUrl(rawUrl: string): {\n url: string | null;\n error: string | null;\n} {\n const trimmed = rawUrl.trim();\n if (trimmed.length === 0) {\n return { url: null, error: null };\n }\n\n if (EXPLICIT_PROTOCOL_PATTERN.test(trimmed)) {\n try {\n const parsed = new URL(trimmed);\n if (!ALLOWED_WEBSITE_PROTOCOLS.has(parsed.protocol)) {\n return { url: null, error: `Unsupported protocol: ${parsed.protocol}` };\n }\n\n return { url: parsed.toString(), error: null };\n } catch {\n return { url: null, error: \"Invalid URL\" };\n }\n }\n\n if (!LIKELY_HOST_PATTERN.test(trimmed)) {\n return { url: null, error: \"Invalid URL\" };\n }\n\n try {\n const parsed = new URL(\n `${defaultSchemeForHostInput(trimmed)}://${trimmed}`\n );\n return { url: parsed.toString(), error: null };\n } catch {\n return { url: null, error: \"Invalid URL\" };\n }\n}\n\nexport function isWebsiteUrlAllowedForNavigation(rawUrl: string): boolean {\n const resolved = resolveWebsiteNavigationUrl(rawUrl);\n return resolved.url !== null && resolved.error === null;\n}\n\nexport function resolveWebsiteAddressInput(rawInput: string): {\n url: string | null;\n error: string | null;\n} {\n const trimmed = rawInput.trim();\n if (trimmed.length === 0) {\n return { url: null, error: null };\n }\n\n const navigation = resolveWebsiteNavigationUrl(trimmed);\n if (navigation.url) {\n return navigation;\n }\n\n const searchUrl = new URL(GOOGLE_SEARCH_BASE_URL);\n searchUrl.searchParams.set(\"q\", trimmed);\n return { url: searchUrl.toString(), error: null };\n}\n\nexport function normalizeWebsiteComparableUrl(rawUrl: string): string | null {\n const resolved = resolveWebsiteNavigationUrl(rawUrl);\n return resolved.error === null ? resolved.url : null;\n}\n","const URL_LIKE_LINK_PATTERN = /^[a-zA-Z][a-zA-Z\\d+.-]*:|^#/;\nconst LOCAL_ASSET_ROOT = \"/var/cache/tsh/local-assets\";\n\nexport interface ResolveWorkspaceFilePathCandidateInput {\n path: string;\n workspaceRoot?: string | null;\n basePath?: string | null;\n}\n\nexport interface ResolvedWorkspaceFilePathCandidate {\n path: string;\n directoryPath: string;\n workspaceRoot: string;\n}\n\n/**\n * Pure file-path policy shared by transcript projection and host link actions.\n * It intentionally has no Workspace mention, app, issue, registry, or renderer\n * dependencies.\n */\nexport function resolveWorkspaceFilePathCandidate({\n path,\n workspaceRoot,\n basePath\n}: ResolveWorkspaceFilePathCandidateInput): ResolvedWorkspaceFilePathCandidate | null {\n const rawPath = decodeWorkspaceLinkPath(path.trim());\n if (\n !rawPath ||\n isUrlLikeWorkspaceFilePath(rawPath) ||\n isUncWorkspaceFilePath(rawPath)\n ) {\n return null;\n }\n\n const normalizedPath = normalizeWorkspaceFilePath(rawPath);\n if (isUnsupportedSpecialWorkspaceFilePath(normalizedPath)) {\n return null;\n }\n if (isStagedLocalAssetPath(normalizedPath)) {\n return null;\n }\n if (isHomeRelativeWorkspaceFilePath(normalizedPath)) {\n const directoryPath = dirnameForHomeRelativePath(normalizedPath);\n return {\n path: normalizedPath,\n directoryPath,\n workspaceRoot:\n normalizeWorkspaceFilePath(workspaceRoot?.trim() ?? \"\") || directoryPath\n };\n }\n if (\n isAbsoluteLocalPath(normalizedPath) &&\n (isDirectAgentGeneratedMediaPath(normalizedPath) ||\n isDirectWorkspaceAppDataPath(normalizedPath))\n ) {\n const directoryPath = dirname(normalizedPath);\n return {\n path: normalizedPath,\n directoryPath,\n workspaceRoot:\n normalizeWorkspaceFilePath(workspaceRoot?.trim() ?? \"\") || directoryPath\n };\n }\n\n const selectedRoot = normalizeWorkspaceFilePath(workspaceRoot?.trim() ?? \"\");\n const sessionRoot = normalizeWorkspaceFilePath(basePath?.trim() ?? \"\");\n const root = selectedRoot || sessionRoot;\n if (!root) {\n return null;\n }\n if (isAbsoluteLocalPath(normalizedPath)) {\n const directoryPath = dirname(normalizedPath);\n return {\n path: normalizedPath,\n directoryPath,\n workspaceRoot: root\n };\n }\n const base = normalizeWorkspaceFilePath(basePath?.trim() || root);\n const resolvedPath = normalizeWorkspaceFilePath(`${base}/${normalizedPath}`);\n if (\n !isInsideOrEqualWorkspaceFilePath(resolvedPath, root) &&\n !isDirectAgentGeneratedMediaPath(resolvedPath)\n ) {\n return null;\n }\n\n return {\n path: resolvedPath,\n directoryPath: resolvedPath === root ? root : dirname(resolvedPath),\n workspaceRoot: root\n };\n}\n\nexport function normalizeWorkspaceFilePath(path: string): string {\n const normalizedPath = path.trim().replaceAll(\"\\\\\", \"/\");\n const drive = /^[A-Za-z]:/.exec(normalizedPath)?.[0] ?? \"\";\n const startsWithSlash = normalizedPath.startsWith(\"/\");\n const pathBody = drive\n ? normalizedPath.slice(drive.length)\n : startsWithSlash\n ? normalizedPath.slice(1)\n : normalizedPath;\n const parts: string[] = [];\n for (const part of pathBody.split(\"/\")) {\n if (!part || part === \".\") {\n continue;\n }\n if (part === \"..\") {\n parts.pop();\n continue;\n }\n parts.push(part);\n }\n if (drive) {\n return parts.length > 0 ? `${drive}/${parts.join(\"/\")}` : `${drive}/`;\n }\n if (startsWithSlash) {\n return parts.length > 0 ? `/${parts.join(\"/\")}` : \"/\";\n }\n return parts.join(\"/\");\n}\n\nexport function isUrlLikeWorkspaceFilePath(path: string): boolean {\n if (path.startsWith(\"#\")) {\n return true;\n }\n if (isWindowsAbsolutePath(path.trim().replaceAll(\"\\\\\", \"/\"))) {\n return false;\n }\n return URL_LIKE_LINK_PATTERN.test(path);\n}\n\nexport function decodeWorkspaceLinkPath(path: string): string {\n if (!path.includes(\"%\")) {\n return path;\n }\n try {\n return decodeURI(path);\n } catch {\n return path;\n }\n}\n\nexport function workspaceFilePathBasename(path: string): string {\n return path.split(\"/\").filter(Boolean).at(-1) ?? path;\n}\n\nexport function isInsideOrEqualWorkspaceFilePath(\n path: string,\n root: string\n): boolean {\n if (root === \"/\") {\n return path.startsWith(\"/\");\n }\n const comparison =\n isWindowsAbsolutePath(root) || isWindowsAbsolutePath(path)\n ? { path: path.toLowerCase(), root: root.toLowerCase() }\n : { path, root };\n return (\n comparison.path === comparison.root ||\n comparison.path.startsWith(`${comparison.root}/`)\n );\n}\n\nexport function isDirectAgentGeneratedMediaPath(path: string): boolean {\n if (!isAbsoluteLocalPath(path)) {\n return false;\n }\n const statePath = getTuttiStatePathSegments(path);\n if (!statePath) {\n return false;\n }\n if (\n statePath[1] !== \"agent\" ||\n statePath[2] !== \"runs\" ||\n (!statePath.includes(\"generated_images\") &&\n !statePath.includes(\"generated_videos\"))\n ) {\n return false;\n }\n return /\\.(?:png|jpe?g|gif|webp|bmp|mp4|webm)$/i.test(path);\n}\n\nfunction isAbsoluteLocalPath(path: string): boolean {\n return path.startsWith(\"/\") || isWindowsAbsolutePath(path);\n}\n\nfunction isHomeRelativeWorkspaceFilePath(path: string): boolean {\n return path === \"~\" || path.startsWith(\"~/\");\n}\n\nfunction dirnameForHomeRelativePath(path: string): string {\n return path === \"~\" ? \"~\" : dirname(path);\n}\n\nfunction isWindowsAbsolutePath(path: string): boolean {\n return /^[A-Za-z]:\\//.test(path);\n}\n\nfunction isUncWorkspaceFilePath(path: string): boolean {\n return /^(?:\\\\\\\\|\\/\\/)[^/\\\\]+[/\\\\][^/\\\\]+/.test(path);\n}\n\nfunction isUnsupportedSpecialWorkspaceFilePath(path: string): boolean {\n const comparisonPath = cleanWorkspaceFilePathForComparison(path);\n return (\n comparisonPath === \"/dev/null\" ||\n comparisonPath.split(\"/\").some((segment) => {\n const normalized = segment.trim().replace(/[. ]+$/g, \"\");\n const deviceName = normalized.split(\".\", 1)[0]?.toUpperCase();\n return deviceName === \"NUL\";\n })\n );\n}\n\nfunction cleanWorkspaceFilePathForComparison(path: string): string {\n const normalized = path.replace(/\\/+/g, \"/\");\n const parts: string[] = [];\n for (const part of normalized.split(\"/\")) {\n if (!part || part === \".\") {\n continue;\n }\n if (part === \"..\") {\n parts.pop();\n continue;\n }\n parts.push(part);\n }\n return normalized.startsWith(\"/\") ? `/${parts.join(\"/\")}` : parts.join(\"/\");\n}\n\nfunction dirname(path: string): string {\n const index = path.lastIndexOf(\"/\");\n if (index <= 0) {\n return \"/\";\n }\n return path.slice(0, index);\n}\n\nfunction isStagedLocalAssetPath(path: string): boolean {\n return (\n path !== LOCAL_ASSET_ROOT &&\n isInsideOrEqualWorkspaceFilePath(path, LOCAL_ASSET_ROOT)\n );\n}\n\nfunction isDirectWorkspaceAppDataPath(path: string): boolean {\n if (!isAbsoluteLocalPath(path)) {\n return false;\n }\n const statePath = getTuttiStatePathSegments(path);\n if (!statePath) {\n return false;\n }\n return (\n statePath[1] === \"apps\" &&\n statePath[2] === \"workspaces\" &&\n statePath.length > 5\n );\n}\n\nfunction getTuttiStatePathSegments(path: string): string[] | null {\n const segments = path.split(\"/\").filter(Boolean);\n const stateRootIndex = segments.findIndex(\n (segment) => segment === \".tutti\" || segment === \".tutti-dev\"\n );\n if (stateRootIndex < 0) {\n return null;\n }\n return segments.slice(stateRootIndex);\n}\n"],"mappings":";AAeO,SAAS,0BAA0B;AAAA,EACxC,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT;AACF,GAA8D;AAC5D,QAAM,UAAU,YAAY,UAAU;AACtC,QAAM,QAAQ,YAAY,QAAQ,KAAK,YAAY,SAAS,KAAK;AACjE,QAAM,WAAW,YAAY,WAAW,KAAK,YAAY,SAAS,QAAQ;AAC1E,QAAM,WAAW,YAAY,OAAO,QAAQ;AAC5C,QAAM,mBA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