nolo-cli 0.102.1 → 0.102.3

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.
Files changed (107) hide show
  1. package/{_executeModel-WLFACVFR.js → _executeModel-TOH473HN.js} +32 -32
  2. package/{action-PNPQLJHG.js → action-C4KMTCJF.js} +2 -2
  3. package/{addContentAction-RBOUD7SJ.js → addContentAction-7TNIOVZI.js} +6 -6
  4. package/{addDialogAgentAction-IODCR6TB.js → addDialogAgentAction-O47J3MVW.js} +5 -5
  5. package/{agentDeleteCommand-XHHDYJ3U.js → agentDeleteCommand-3EV2EOUI.js} +38 -38
  6. package/{agentEmailCommands-GJ2TE3CV.js → agentEmailCommands-V2V54ZIH.js} +38 -38
  7. package/{agentListCommands-B3YHJQNM.js → agentListCommands-SRRN3TCW.js} +21 -21
  8. package/{agentMachineCommands-KQLRJF5O.js → agentMachineCommands-JYJMU27G.js} +19 -19
  9. package/{agentRecordCommands-LXDIXYQM.js → agentRecordCommands-KQMZLZHW.js} +38 -38
  10. package/{agentRunCommand-P2KLVSYL.js → agentRunCommand-IWKQO47Q.js} +38 -38
  11. package/{agentRuntimeLocal-SXYAKX3A.js → agentRuntimeLocal-3QKZ76C7.js} +16 -16
  12. package/{agentSlice-WBSSBKBB.js → agentSlice-MR6JWMM5.js} +7 -7
  13. package/{appDeleteCommands-4EX37I4K.js → appDeleteCommands-SZFKFV4S.js} +20 -20
  14. package/{appDeployCommands-SDBR3J75.js → appDeployCommands-JWH5HMET.js} +20 -20
  15. package/{appDeployStatusCommands-764PQNYN.js → appDeployStatusCommands-CLONFBVO.js} +20 -20
  16. package/{appGetCommands-BBCN3XJC.js → appGetCommands-4Z7V7UYA.js} +20 -20
  17. package/{appListCommands-OGTABCS3.js → appListCommands-IIUS64VI.js} +20 -20
  18. package/{authCommand-NHDLY3IB.js → authCommand-NQPMGYHP.js} +3 -3
  19. package/{authCommands-UDBJVSZU.js → authCommands-LWLOZETU.js} +2 -2
  20. package/{builtinSkillRegistry-MAR5LPAC.js → builtinSkillRegistry-GFY77VRN.js} +4 -4
  21. package/{chunk-UM4PH574.js → chunk-22RVE2PC.js} +1 -1
  22. package/{chunk-XFUBXRVI.js → chunk-2H6SEVDS.js} +1 -1
  23. package/{chunk-PCF3QU5Q.js → chunk-2K4TM6AW.js} +1 -1
  24. package/{chunk-ODTDLPBV.js → chunk-3MSJ4XDQ.js} +3 -3
  25. package/{chunk-VEYL5MO5.js → chunk-4G4C5SXT.js} +3 -3
  26. package/{chunk-WCGC6S77.js → chunk-4HTMUQIZ.js} +2 -2
  27. package/{chunk-4FFUDT6D.js → chunk-56HJ2LAA.js} +17 -7
  28. package/{chunk-E73ON47R.js → chunk-5EPHWMP5.js} +2 -2
  29. package/{chunk-7EPXUZOX.js → chunk-6UEJDFF7.js} +2 -2
  30. package/{chunk-5LTAPGPV.js → chunk-6XHM3LNF.js} +2 -2
  31. package/{chunk-5OA5HMTL.js → chunk-7JWCVINR.js} +1 -1
  32. package/{chunk-4YSOUKUR.js → chunk-7KWFIKKK.js} +1 -1
  33. package/{chunk-AOJB5QYD.js → chunk-AFRHU2JO.js} +10 -11
  34. package/{chunk-G53AA7RW.js → chunk-BML3APFI.js} +90 -18
  35. package/{chunk-YXZYNMYK.js → chunk-CMKQ7RCH.js} +2 -2
  36. package/{chunk-6O4IK4V2.js → chunk-CUF4MYKI.js} +1 -1
  37. package/{chunk-PTDYOADJ.js → chunk-D2GQE6AF.js} +1 -1
  38. package/{chunk-46Y5D2BZ.js → chunk-EV235ILT.js} +1 -1
  39. package/{chunk-HRYFI64G.js → chunk-F6DFZLO4.js} +3 -3
  40. package/{chunk-FJ5BGMNM.js → chunk-FBTNYNAL.js} +1 -1
  41. package/{chunk-EHER73LN.js → chunk-GCTKWVLU.js} +1 -1
  42. package/{chunk-CJN5OERD.js → chunk-GLD6Q25H.js} +22 -22
  43. package/{chunk-SEB5HAUU.js → chunk-HD3S2F7U.js} +1 -1
  44. package/{chunk-XIRXOUBV.js → chunk-HDYUKPEB.js} +6 -6
  45. package/{chunk-LKERWYPX.js → chunk-IRZTHHNM.js} +2 -2
  46. package/{chunk-CHNCM7EF.js → chunk-JVP74JRH.js} +7 -7
  47. package/{chunk-7TKWCTSY.js → chunk-KNVDNYH7.js} +2 -2
  48. package/{chunk-7MMSLEPA.js → chunk-LB5A6JTU.js} +3 -3
  49. package/{chunk-PH275YDS.js → chunk-MEZSLGQZ.js} +25 -18
  50. package/{chunk-TVCAR26G.js → chunk-MSFZ7FMO.js} +1 -1
  51. package/chunk-NKWIS6G2.js +442 -0
  52. package/{chunk-DNHENQ3T.js → chunk-NR7N2RWA.js} +5 -5
  53. package/{chunk-Z56IK6UT.js → chunk-O2LBWZLR.js} +8 -8
  54. package/{chunk-UJXNKP5V.js → chunk-O7SVKKLY.js} +129 -14
  55. package/{chunk-SNMQMOD2.js → chunk-Q7O72MF5.js} +1 -1
  56. package/{chunk-U6IGAJT4.js → chunk-REPRKRB2.js} +7 -7
  57. package/{chunk-GARACBQB.js → chunk-RILRSUGC.js} +1 -1
  58. package/{chunk-OYPMWCIQ.js → chunk-S274RDSE.js} +9 -9
  59. package/{chunk-SEA64CDY.js → chunk-TSXNDTXL.js} +1 -1
  60. package/{chunk-W72ISAKC.js → chunk-UNAOTLKO.js} +1 -1
  61. package/{chunk-KLUBZL6X.js → chunk-USTPPV3J.js} +1 -1
  62. package/{chunk-N4QIAW6W.js → chunk-V6YASAZR.js} +1 -1
  63. package/{chunk-V5OWQOJZ.js → chunk-VL3H5ZU3.js} +48 -7
  64. package/{chunk-AUDNYVRC.js → chunk-VLGL7FOL.js} +1 -1
  65. package/{chunk-NTDEBTK5.js → chunk-XMUZHRSB.js} +6 -6
  66. package/{chunk-ADBZWMFB.js → chunk-YDO5ERB4.js} +1 -1
  67. package/{chunk-U7XXEI5R.js → chunk-YGCJITP3.js} +2 -2
  68. package/{chunk-GUYEMTRK.js → chunk-YIEUDVD6.js} +45 -32
  69. package/{chunk-OW4APERY.js → chunk-YK5MHOWM.js} +54 -9
  70. package/{commandRegistry-TDXN5OP7.js → commandRegistry-POKHERIN.js} +50 -50
  71. package/{contentThunks-F2BNWOZV.js → contentThunks-HEEW3GBT.js} +15 -15
  72. package/{createAgentAutomationAction-5N2NRNR7.js → createAgentAutomationAction-C5UTM2ZI.js} +15 -15
  73. package/{createDialogAction-DSEG4L5Y.js → createDialogAction-VODZCSHM.js} +18 -18
  74. package/{createPageAction-K32FYQPE.js → createPageAction-XUFSVLBC.js} +16 -16
  75. package/{dbSlice-Q25STFGJ.js → dbSlice-QOLNF5GN.js} +5 -5
  76. package/{deleteFile-AJ2EZMHT.js → deleteFile-KESP65GC.js} +2 -2
  77. package/{dialogCommands-ODG2OKLO.js → dialogCommands-4XNYPCE7.js} +21 -21
  78. package/{dialogSlice-4GBOUTGL.js → dialogSlice-KXBFWRVK.js} +14 -14
  79. package/{docCreateCommands-Q6FQUHUF.js → docCreateCommands-P4XCR2SW.js} +21 -21
  80. package/{docDeleteCommands-N224CFZL.js → docDeleteCommands-KZZ3L6LS.js} +22 -22
  81. package/{docReadCommands-CJWAEAB4.js → docReadCommands-JN6HL4BC.js} +21 -21
  82. package/{docStore-ZTYSP3YE.js → docStore-PLGBTV5U.js} +6 -6
  83. package/{docUpdateCommands-OPG6ZY4H.js → docUpdateCommands-EYE7BTXW.js} +21 -21
  84. package/{fetchMessages-I5ICDDHM.js → fetchMessages-5L7OVM5Y.js} +2 -2
  85. package/{handleSendMessageAction-XFZH2TQS.js → handleSendMessageAction-BBB6A54Z.js} +14 -14
  86. package/index.js +3 -3
  87. package/{localDialogRead-ZHZ3KXDM.js → localDialogRead-O5A26FDK.js} +1 -1
  88. package/{machineCommands-KMU3D5I5.js → machineCommands-4LP4XFEY.js} +37 -37
  89. package/{machineWsRunDispatch-6GJ5YOSW.js → machineWsRunDispatch-4PWOZYRA.js} +37 -37
  90. package/{memberThunks-R75S3RWP.js → memberThunks-25K6DDRA.js} +6 -6
  91. package/package.json +1 -1
  92. package/{read-SRQMNO26.js → read-PJIT2YEJ.js} +2 -2
  93. package/{readDocTool-RC3JUNJ2.js → readDocTool-DRSXHGNL.js} +1 -1
  94. package/{readlineWorkspace-EXCG3IFX.js → readlineWorkspace-CFUUABFV.js} +70 -71
  95. package/{removeDialogAgentAction-46XQV5Q7.js → removeDialogAgentAction-VIWJL6MX.js} +6 -6
  96. package/{runAgentClientLoop-URRDZ5WG.js → runAgentClientLoop-CAPNBF7Q.js} +30 -30
  97. package/{setDialogExtraReferencesAction-J4V5ADQF.js → setDialogExtraReferencesAction-A7VA3NFM.js} +6 -6
  98. package/{setPrimaryDialogAgentAction-UHHV2QZW.js → setPrimaryDialogAgentAction-B4P7YQX2.js} +6 -6
  99. package/{settingThunks-PPZZZOWN.js → settingThunks-KOYSAT65.js} +5 -5
  100. package/{spaceCommands-7CLUNI2I.js → spaceCommands-QCZUWUMS.js} +19 -19
  101. package/{streamAgentChatTurn-YPUYKXDX.js → streamAgentChatTurn-XX3N3P4J.js} +33 -33
  102. package/{switchDialogAgentAction-A2TMVGAE.js → switchDialogAgentAction-3VYWHZKH.js} +5 -5
  103. package/{tools-M5ENXZRJ.js → tools-U6BT6H56.js} +27 -27
  104. package/{tuiSummaryLlmCaller-Q65IBDGO.js → tuiSummaryLlmCaller-QCHCULPM.js} +9 -9
  105. package/{updateDialogTitleAction-7PNUE23W.js → updateDialogTitleAction-NKHQ5LCX.js} +15 -15
  106. package/chunk-CQ3WA2NE.js +0 -299
  107. /package/{chunk-3AH7LNUB.js → chunk-ODAPITXL.js} +0 -0
package/chunk-CQ3WA2NE.js DELETED
@@ -1,299 +0,0 @@
1
- // packages/agent-runtime/declaredToolNames.ts
2
- function extractDeclaredToolNames(tools) {
3
- if (!Array.isArray(tools)) return void 0;
4
- const names = /* @__PURE__ */ new Set();
5
- for (const t of tools) {
6
- const fn = t?.function;
7
- if (fn && typeof fn.name === "string" && fn.name) names.add(fn.name);
8
- }
9
- return names;
10
- }
11
-
12
- // packages/agent-runtime/outboundHistorySanitize.ts
13
- function sanitizeForOutbound(messages, tools) {
14
- return sanitizeOutboundHistory(messages, {
15
- declaredToolNames: extractDeclaredToolNames(tools)
16
- });
17
- }
18
- function stableToolCallId(assistantIndex, callIndex) {
19
- return `call_sanitize_${assistantIndex}_${callIndex}`;
20
- }
21
- function isString(v) {
22
- return typeof v === "string";
23
- }
24
- function isNonEmptyString(v) {
25
- return typeof v === "string" && v.length > 0;
26
- }
27
- function joinLines(...parts) {
28
- return parts.filter(isNonEmptyString).join("\n");
29
- }
30
- function jsonStringifyArguments(args) {
31
- if (typeof args === "string") return args;
32
- try {
33
- return JSON.stringify(args ?? "");
34
- } catch {
35
- return "";
36
- }
37
- }
38
- function renderToolCallAsText(call) {
39
- const name = call?.function?.name ?? "unknown";
40
- const rawArgs = call?.function?.arguments;
41
- const args = jsonStringifyArguments(rawArgs);
42
- return `[tool_call: ${name}(${args})]`;
43
- }
44
- function renderToolResultAsText(message) {
45
- const name = isNonEmptyString(message.toolName) ? message.toolName : "tool";
46
- const body = typeof message.content === "string" ? message.content : "";
47
- return `[tool_result: ${name}: ${body}]`;
48
- }
49
- function normalizeToolCall(call, assistantIndex, callIndex) {
50
- if (!call || typeof call !== "object") return null;
51
- const c = call;
52
- const fn = c.function;
53
- if (!fn || typeof fn !== "object" || !isString(fn.name)) return null;
54
- const id = isNonEmptyString(c.id) ? c.id : stableToolCallId(assistantIndex, callIndex);
55
- return {
56
- id,
57
- type: isString(c.type) && c.type ? c.type : "function",
58
- function: { name: fn.name, arguments: jsonStringifyArguments(fn.arguments) },
59
- ...typeof c.thought_signature === "string" ? { thought_signature: c.thought_signature } : {}
60
- };
61
- }
62
- function sanitizeOutboundHistory(messages, options) {
63
- if (!Array.isArray(messages) || messages.length === 0) return messages;
64
- const declared = options?.declaredToolNames;
65
- const candidateCallIds = /* @__PURE__ */ new Set();
66
- for (let i = 0; i < messages.length; i++) {
67
- const m = messages[i];
68
- if (m.role !== "assistant" || !Array.isArray(m.tool_calls)) continue;
69
- m.tool_calls.forEach((call, callIndex) => {
70
- const name = call?.function?.name;
71
- const declaredAllows = !declared || isString(name) && declared.has(name);
72
- if (!declaredAllows) return;
73
- if (!hasParsableObjectArguments(call?.function?.arguments)) {
74
- return;
75
- }
76
- const id = isNonEmptyString(call?.id) ? call.id : stableToolCallId(i, callIndex);
77
- candidateCallIds.add(id);
78
- });
79
- }
80
- const resultIds = /* @__PURE__ */ new Set();
81
- for (const m of messages) {
82
- if (m.role === "tool" && isNonEmptyString(m.tool_call_id)) {
83
- resultIds.add(m.tool_call_id);
84
- }
85
- }
86
- const keepCallIds = /* @__PURE__ */ new Set();
87
- for (const id of candidateCallIds) {
88
- if (resultIds.has(id)) keepCallIds.add(id);
89
- }
90
- const out = [];
91
- for (let i = 0; i < messages.length; i++) {
92
- const m = messages[i];
93
- if (m.role === "assistant") {
94
- let toolCalls;
95
- const downgradedLines = [];
96
- if (Array.isArray(m.tool_calls) && m.tool_calls.length > 0) {
97
- const kept = [];
98
- m.tool_calls.forEach((call, callIndex) => {
99
- const name = call?.function?.name;
100
- const declaredAllows = !declared || isString(name) && declared.has(name);
101
- const id = isNonEmptyString(call?.id) ? call.id : stableToolCallId(i, callIndex);
102
- const keepStructural = declaredAllows && keepCallIds.has(id);
103
- if (keepStructural) {
104
- const normalized = normalizeToolCall(call, i, callIndex);
105
- if (normalized) kept.push(normalized);
106
- } else {
107
- downgradedLines.push(renderToolCallAsText(call));
108
- }
109
- });
110
- toolCalls = kept.length > 0 ? kept : void 0;
111
- }
112
- const downgradedText = joinLines(...downgradedLines);
113
- const contentWithDowngrade = downgradedText.length > 0 ? combineContentWithText(m.content, downgradedText) : m.content;
114
- const sanitizedAssistant = {
115
- ...m,
116
- content: contentWithDowngrade,
117
- tool_calls: toolCalls
118
- };
119
- if (!toolCalls) delete sanitizedAssistant.tool_calls;
120
- out.push(sanitizedAssistant);
121
- continue;
122
- }
123
- if (m.role === "tool") {
124
- const id = isNonEmptyString(m.tool_call_id) ? m.tool_call_id : "";
125
- if (id && keepCallIds.has(id)) {
126
- out.push({ ...m, content: m.content ?? "", tool_call_id: id });
127
- } else {
128
- out.push({
129
- role: "assistant",
130
- content: renderToolResultAsText(m)
131
- });
132
- }
133
- continue;
134
- }
135
- out.push({ ...m });
136
- }
137
- return out;
138
- }
139
- function combineContentWithText(base, extra) {
140
- if (typeof base === "string") {
141
- return base ? `${base}
142
- ${extra}` : extra;
143
- }
144
- if (Array.isArray(base)) {
145
- return [...base, { type: "text", text: extra }];
146
- }
147
- return extra;
148
- }
149
- function hasParsableObjectArguments(raw) {
150
- if (raw === void 0) return true;
151
- if (raw === null || typeof raw === "number" || typeof raw === "boolean") {
152
- return false;
153
- }
154
- if (typeof raw !== "string") return true;
155
- if (raw.trim() === "") return true;
156
- try {
157
- const parsed = JSON.parse(raw);
158
- return parsed !== null && typeof parsed === "object";
159
- } catch {
160
- return false;
161
- }
162
- }
163
- var STRICT_JSON_STRING_TOKEN = /^"(?:[^"\\\u0000-\u001F]|\\["\\/bfnrt]|\\u[0-9A-Fa-f]{4})*"$/;
164
- function isStrictJsonStringToken(value) {
165
- if (!STRICT_JSON_STRING_TOKEN.test(value)) return false;
166
- try {
167
- return typeof JSON.parse(value) === "string";
168
- } catch {
169
- return false;
170
- }
171
- }
172
- function closersOf(openStack) {
173
- return openStack.slice().reverse().map((ch) => ch === "{" ? "}" : "]").join("");
174
- }
175
- function scanJsonForTailRepair(input) {
176
- const stack = [];
177
- let inString = false;
178
- let escaped = false;
179
- let lastCommaOutsideString = null;
180
- for (let i = 0; i < input.length; i += 1) {
181
- const ch = input[i];
182
- if (inString) {
183
- if (escaped) escaped = false;
184
- else if (ch === "\\") escaped = true;
185
- else if (ch === '"') inString = false;
186
- continue;
187
- }
188
- if (ch === '"') {
189
- inString = true;
190
- continue;
191
- }
192
- if (ch === "{" || ch === "[") {
193
- stack.push(ch);
194
- continue;
195
- }
196
- if (ch === "}" || ch === "]") {
197
- const open = stack.pop();
198
- if (open !== (ch === "}" ? "{" : "[")) return null;
199
- continue;
200
- }
201
- if (ch === ",") {
202
- lastCommaOutsideString = { index: i, closers: closersOf(stack) };
203
- continue;
204
- }
205
- }
206
- return { inString, closers: closersOf(stack), lastCommaOutsideString };
207
- }
208
- function repairTruncatedToolArguments(raw) {
209
- if (typeof raw !== "string") return null;
210
- const withoutTrailingSpace = raw.replace(/\s+$/, "");
211
- const endsWithComma = withoutTrailingSpace.endsWith(",");
212
- const trimmed = endsWithComma ? withoutTrailingSpace.slice(0, -1).replace(/\s+$/, "") : withoutTrailingSpace;
213
- if (trimmed === "" || trimmed.endsWith(",")) return null;
214
- const scan = scanJsonForTailRepair(trimmed);
215
- if (!scan || scan.inString) return null;
216
- const lastChar = trimmed[trimmed.length - 1];
217
- const tailIsCompleteToken = endsWithComma || lastChar === '"' || lastChar === "}" || lastChar === "]";
218
- if (!tailIsCompleteToken) return null;
219
- const candidates = [trimmed + scan.closers];
220
- const lastComma = scan.lastCommaOutsideString;
221
- if (lastComma && lastComma.index > 0) {
222
- const tailAfterComma = trimmed.slice(lastComma.index + 1).trim();
223
- if (isStrictJsonStringToken(tailAfterComma)) {
224
- const head = trimmed.slice(0, lastComma.index);
225
- candidates.push(head + lastComma.closers);
226
- }
227
- }
228
- for (const candidate of candidates) {
229
- try {
230
- const parsed = JSON.parse(candidate);
231
- if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) && Object.keys(parsed).length > 0) {
232
- return candidate;
233
- }
234
- } catch {
235
- }
236
- }
237
- return null;
238
- }
239
- function downgradeUnparsableToolCalls(messages) {
240
- if (!Array.isArray(messages) || messages.length === 0) {
241
- return { messages, downgraded: 0 };
242
- }
243
- const poisonIds = /* @__PURE__ */ new Set();
244
- for (let i = 0; i < messages.length; i++) {
245
- const m = messages[i];
246
- if (m.role !== "assistant" || !Array.isArray(m.tool_calls)) continue;
247
- m.tool_calls.forEach((call, callIndex) => {
248
- if (!hasParsableObjectArguments(call?.function?.arguments)) {
249
- const id = isNonEmptyString(call?.id) ? call.id : stableToolCallId(i, callIndex);
250
- poisonIds.add(id);
251
- }
252
- });
253
- }
254
- if (poisonIds.size === 0) return { messages, downgraded: 0 };
255
- let downgraded = 0;
256
- const out = [];
257
- for (const m of messages) {
258
- if (m.role === "assistant" && Array.isArray(m.tool_calls) && m.tool_calls.length > 0) {
259
- const kept = [];
260
- const lines = [];
261
- for (const call of m.tool_calls) {
262
- if (!hasParsableObjectArguments(call?.function?.arguments)) {
263
- lines.push(renderToolCallAsText(call));
264
- downgraded++;
265
- } else {
266
- kept.push(call);
267
- }
268
- }
269
- if (lines.length === 0) {
270
- out.push(m);
271
- continue;
272
- }
273
- const sanitized = {
274
- ...m,
275
- content: combineContentWithText(m.content, joinLines(...lines)),
276
- tool_calls: kept.length > 0 ? kept : void 0
277
- };
278
- if (kept.length === 0) delete sanitized.tool_calls;
279
- out.push(sanitized);
280
- continue;
281
- }
282
- if (m.role === "tool") {
283
- const id = isNonEmptyString(m.tool_call_id) ? m.tool_call_id : "";
284
- if (id && poisonIds.has(id)) {
285
- out.push({ role: "assistant", content: renderToolResultAsText(m) });
286
- continue;
287
- }
288
- }
289
- out.push(m);
290
- }
291
- return { messages: out, downgraded };
292
- }
293
-
294
- export {
295
- sanitizeForOutbound,
296
- hasParsableObjectArguments,
297
- repairTruncatedToolArguments,
298
- downgradeUnparsableToolCalls
299
- };
File without changes