nolo-cli 0.146.0-alpha.5 → 0.147.0-alpha.2

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 (41) hide show
  1. package/{_executeModel-PSFK7JFS.js → _executeModel-3OCR5R5P.js} +12 -12
  2. package/{agentEmailCommands-4IDFCQL5.js → agentEmailCommands-OAPYGNYC.js} +10 -10
  3. package/{agentMachineCommands-IGC4R5M3.js → agentMachineCommands-OWLOV5WO.js} +1 -1
  4. package/{agentRecordCommands-TIWPKZ3T.js → agentRecordCommands-BW7HM6VH.js} +10 -10
  5. package/{agentRunCommand-LWNLMKAC.js → agentRunCommand-O2F3NU2H.js} +10 -10
  6. package/{agentSlice-ZTFKNEHJ.js → agentSlice-ZOCKW66S.js} +1 -1
  7. package/{chatQueueReduxAdapter-PIK5M2U6.js → chatQueueReduxAdapter-DFZ6QB4K.js} +2 -2
  8. package/{chunk-LFD2V36M.js → chunk-27VHPPII.js} +1 -1
  9. package/{chunk-N6MHJ3VG.js → chunk-2B74TU77.js} +2 -2
  10. package/{chunk-4CWJSCX5.js → chunk-36HTQWBD.js} +2 -2
  11. package/{chunk-IOPSD2SG.js → chunk-BCJPO6SE.js} +4 -4
  12. package/{chunk-CEXP7INN.js → chunk-BFLSOVHN.js} +7 -5
  13. package/{chunk-GOMR6S5Z.js → chunk-BJ3KD73I.js} +72 -0
  14. package/{chunk-6OTOA5MH.js → chunk-JK5XW3NO.js} +1 -1
  15. package/{chunk-YOJHATGG.js → chunk-JORF7I7F.js} +1 -1
  16. package/{chunk-TITGPUWJ.js → chunk-JQ4LUB5I.js} +1 -1
  17. package/{chunk-2BAC5FZX.js → chunk-KRC6GI2Q.js} +2 -2
  18. package/{chunk-6XNOGDTR.js → chunk-LQ6P2MFG.js} +6 -6
  19. package/{chunk-2T4P3OTH.js → chunk-NU4DCNMR.js} +4 -4
  20. package/{chunk-FV6LUB6R.js → chunk-OXGHM2WW.js} +11 -75
  21. package/{chunk-C5CV4CLU.js → chunk-P4CRULYJ.js} +2 -2
  22. package/{chunk-O4RO527J.js → chunk-PZ3HKBET.js} +28 -16
  23. package/{chunk-5MCQDAD6.js → chunk-UC3Q7X3J.js} +3 -3
  24. package/{chunk-PWOXYPE6.js → chunk-YYKMFBK7.js} +112 -0
  25. package/{commandRegistry-JY2L75RT.js → commandRegistry-OPVCVVOQ.js} +14 -14
  26. package/{contentThunks-A3O35EO3.js → contentThunks-IWXWFN6P.js} +3 -3
  27. package/{createAgentAutomationAction-3WQROJFS.js → createAgentAutomationAction-ROWX5ZPK.js} +3 -3
  28. package/{createDialogAction-27LGAZTE.js → createDialogAction-WLVAITHA.js} +4 -4
  29. package/{createPageAction-FEOA765U.js → createPageAction-DAJL6GES.js} +3 -3
  30. package/{dialogSlice-HA7LO4KI.js → dialogSlice-WW75BKLO.js} +2 -2
  31. package/{docStore-5ZEQSBCJ.js → docStore-2SADZYLX.js} +1 -1
  32. package/{handleSendMessageAction-L773P53D.js → handleSendMessageAction-2M57WHLO.js} +136 -79
  33. package/index.js +2 -2
  34. package/{machineCommands-3PAJ3N4U.js → machineCommands-7JUTOZP2.js} +10 -10
  35. package/{machineWsRunDispatch-6TQU3KYJ.js → machineWsRunDispatch-6EETR3RV.js} +10 -10
  36. package/package.json +1 -1
  37. package/{readlineWorkspace-7QZ5V5G4.js → readlineWorkspace-LBLAGNGM.js} +10 -10
  38. package/{runAgentClientLoop-POZB5FTY.js → runAgentClientLoop-RPEULJFS.js} +10 -10
  39. package/{streamAgentChatTurn-HSJ7LAWE.js → streamAgentChatTurn-D5POCPVX.js} +18 -121
  40. package/{tools-HO6FDNB4.js → tools-I6D2B2G6.js} +7 -7
  41. package/{updateDialogTitleAction-YV5HMYZM.js → updateDialogTitleAction-7YZ7FNAK.js} +3 -3
@@ -11,8 +11,9 @@ import {
11
11
  } from "./chunk-KQHGZWSV.js";
12
12
  import {
13
13
  createSSEParser,
14
+ isAgentSkillDisabled,
14
15
  waitForAbortableDelay
15
- } from "./chunk-GOMR6S5Z.js";
16
+ } from "./chunk-BJ3KD73I.js";
16
17
  import {
17
18
  isGatewayHttpStatus
18
19
  } from "./chunk-NF64D32W.js";
@@ -38,7 +39,7 @@ import {
38
39
  } from "./chunk-4JMDLJAD.js";
39
40
  import {
40
41
  createDialogAction
41
- } from "./chunk-C5CV4CLU.js";
42
+ } from "./chunk-P4CRULYJ.js";
42
43
  import {
43
44
  addMemberSpace,
44
45
  fetchAuthoritativeRemoteSpace,
@@ -62,7 +63,7 @@ import {
62
63
  } from "./chunk-VF4K2QE6.js";
63
64
  import {
64
65
  createDocState
65
- } from "./chunk-N6MHJ3VG.js";
66
+ } from "./chunk-2B74TU77.js";
66
67
  import {
67
68
  setDialogExtraReferencesAction
68
69
  } from "./chunk-Z7IZQF56.js";
@@ -101,7 +102,7 @@ import {
101
102
  updateContentCategory,
102
103
  updateContentTitle,
103
104
  writeStoredCollapsedCategories
104
- } from "./chunk-LFD2V36M.js";
105
+ } from "./chunk-27VHPPII.js";
105
106
  import {
106
107
  getCurrentSpaceId,
107
108
  getCurrentSpaceIdRaw,
@@ -123,14 +124,14 @@ import {
123
124
  selectMsgById,
124
125
  uiAskChoiceFunc,
125
126
  uiAskChoiceFunctionSchema
126
- } from "./chunk-O4RO527J.js";
127
+ } from "./chunk-PZ3HKBET.js";
127
128
  import {
128
129
  createAgent,
129
130
  deleteServerSyncedCredential,
130
131
  runLlm,
131
132
  streamAgentChatTurn,
132
133
  updateAgent
133
- } from "./chunk-5MCQDAD6.js";
134
+ } from "./chunk-UC3Q7X3J.js";
134
135
  import {
135
136
  getActiveDialogKey,
136
137
  selectCurrentDialogKey,
@@ -144,9 +145,7 @@ import {
144
145
  } from "./chunk-GMVELWJG.js";
145
146
  import {
146
147
  listBuiltinSkills,
147
- resolveBuiltinCapability,
148
- resolveBuiltinSkillByName,
149
- resolveBuiltinSkillEntry
148
+ resolveBuiltinSkillByName
150
149
  } from "./chunk-B2XUQXQX.js";
151
150
  import {
152
151
  CAPABILITY_PACKS
@@ -2225,67 +2224,6 @@ Imported from: ${url}` : ""
2225
2224
  });
2226
2225
  }
2227
2226
 
2228
- // packages/ai/tools/agentSkillConfig.ts
2229
- var MODES = [
2230
- "required",
2231
- "recommended",
2232
- "disabled"
2233
- ];
2234
- var DEFAULT_RECOMMENDED_SKILL_SLUGS = [
2235
- "worktree-isolation",
2236
- "systematic-investigation",
2237
- "show-me"
2238
- ];
2239
- var asMode = (value) => typeof value === "string" && MODES.includes(value) ? value : null;
2240
- var resolveAgentSkillConfig = (source) => {
2241
- const out = {};
2242
- const skills = source?.skills;
2243
- if (skills && typeof skills === "object" && !Array.isArray(skills)) {
2244
- for (const [rawSlug, rawMode] of Object.entries(skills)) {
2245
- const slug = typeof rawSlug === "string" ? rawSlug.trim() : "";
2246
- const mode = asMode(rawMode);
2247
- if (slug && mode) out[slug] = mode;
2248
- }
2249
- return out;
2250
- }
2251
- for (const slug of asTrimmedNonEmptyStringArray(source?.enabledPacks) ?? []) {
2252
- out[slug] = "required";
2253
- }
2254
- return out;
2255
- };
2256
- var resolveAgentRequiredPackIds = (source) => {
2257
- const config = resolveAgentSkillConfig(source);
2258
- return Object.keys(config).filter((slug) => config[slug] === "required");
2259
- };
2260
- var resolveAgentRecommendedSkillNames = (source, lookup) => {
2261
- const config = resolveAgentSkillConfig(source);
2262
- const resolve = lookup ?? defaultSkillTitleLookup;
2263
- const seen = /* @__PURE__ */ new Set();
2264
- const out = [];
2265
- const push = (slug) => {
2266
- const title = resolve(slug)?.title || slug;
2267
- if (seen.has(title)) return;
2268
- seen.add(title);
2269
- out.push(title);
2270
- };
2271
- for (const slug of Object.keys(config)) {
2272
- if (config[slug] !== "recommended") continue;
2273
- push(slug);
2274
- }
2275
- for (const slug of DEFAULT_RECOMMENDED_SKILL_SLUGS) {
2276
- if (Object.hasOwn(config, slug)) continue;
2277
- push(slug);
2278
- }
2279
- return out;
2280
- };
2281
- var defaultSkillTitleLookup = (slug) => {
2282
- const cap = resolveBuiltinCapability(slug);
2283
- if (cap) return { title: cap.title };
2284
- const skill = resolveBuiltinSkillEntry(slug);
2285
- return skill ? { title: skill.title } : null;
2286
- };
2287
- var isAgentSkillDisabled = (source, slug) => resolveAgentSkillConfig(source)[slug] === "disabled";
2288
-
2289
2227
  // packages/ai/tools/loadSkillTool.ts
2290
2228
  var loadSkillFunctionSchema = {
2291
2229
  name: "loadSkill",
@@ -3985,7 +3923,7 @@ async function deleteDialogsFunc(args, thunkApi) {
3985
3923
  const deletedDialogIds = [];
3986
3924
  const deletedDialogKeys = [];
3987
3925
  const failures = [];
3988
- const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-HA7LO4KI.js");
3926
+ const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-WW75BKLO.js");
3989
3927
  for (const target of targets) {
3990
3928
  try {
3991
3929
  await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
@@ -14842,7 +14780,7 @@ var executeToolRun = createAsyncThunk(
14842
14780
  if (!executionInput) {
14843
14781
  throw new Error(`ToolRun ${id} has no input to execute with.`);
14844
14782
  }
14845
- const { findToolExecutor: findToolExecutor2 } = await import("./tools-HO6FDNB4.js");
14783
+ const { findToolExecutor: findToolExecutor2 } = await import("./tools-I6D2B2G6.js");
14846
14784
  const { executor } = findToolExecutor2(run.toolName);
14847
14785
  toolRunStarted({
14848
14786
  id: run.id,
@@ -17349,7 +17287,7 @@ async function updateDocFunc(args, thunkApi) {
17349
17287
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
17350
17288
  };
17351
17289
  await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
17352
- const { getDocState, applyExternalDocUpdate } = await import("./docStore-5ZEQSBCJ.js");
17290
+ const { getDocState, applyExternalDocUpdate } = await import("./docStore-2SADZYLX.js");
17353
17291
  if (getDocState().pageKey === id) {
17354
17292
  applyExternalDocUpdate({
17355
17293
  slateData: finalSlateData,
@@ -19669,8 +19607,6 @@ export {
19669
19607
  clipMultilineText,
19670
19608
  fetchAndSerializeTable,
19671
19609
  getToolResultErrorData,
19672
- resolveAgentRequiredPackIds,
19673
- resolveAgentRecommendedSkillNames,
19674
19610
  readXPostFunctionSchema,
19675
19611
  readXPostFunc,
19676
19612
  readXhsProfileFunctionSchema,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-LFD2V36M.js";
3
+ } from "./chunk-27VHPPII.js";
4
4
  import {
5
5
  prepareAndPersistMessage,
6
6
  uiAskChoiceFunc,
7
7
  uiAskChoiceFunctionSchema
8
- } from "./chunk-O4RO527J.js";
8
+ } from "./chunk-PZ3HKBET.js";
9
9
  import {
10
10
  require_date_fns
11
11
  } from "./chunk-M76ECQRD.js";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-6O4IK4V2.js";
12
12
  import {
13
13
  runLlm
14
- } from "./chunk-5MCQDAD6.js";
14
+ } from "./chunk-UC3Q7X3J.js";
15
15
  import {
16
16
  cleanupCliSessionForDialog
17
17
  } from "./chunk-D76D3RTR.js";
@@ -18754,8 +18754,10 @@ var admin_locale_default = {
18754
18754
  day: "Daily"
18755
18755
  },
18756
18756
  summary: {
18757
- totalCost: "Total cost",
18757
+ totalCost: "All-call estimate",
18758
18758
  totalCostUnit: "credits",
18759
+ platformUsageCost: "Platform spend",
18760
+ scopeNote: "All-call estimate is catalog-rated and includes failed and non-billable calls; platform spend counts billable successful calls only. Actual deductions follow the ledger.",
18759
18761
  recordCount: "Records",
18760
18762
  recordCountUnit: "items",
18761
18763
  inputTokens: "Input tokens",
@@ -18766,7 +18768,8 @@ var admin_locale_default = {
18766
18768
  totalItems: "{{value}} items",
18767
18769
  table: {
18768
18770
  requests: "Requests",
18769
- cost: "Cost",
18771
+ cost: "Estimate",
18772
+ platformCost: "Platform spend",
18770
18773
  share: "Share",
18771
18774
  inputTokens: "Input tokens",
18772
18775
  outputTokens: "Output tokens"
@@ -19193,8 +19196,10 @@ var admin_locale_default = {
19193
19196
  day: "\u6BCF\u65E5"
19194
19197
  },
19195
19198
  summary: {
19196
- totalCost: "\u603B\u6D88\u8017",
19199
+ totalCost: "\u5168\u90E8\u8C03\u7528\u4F30\u503C",
19197
19200
  totalCostUnit: "\u79EF\u5206",
19201
+ platformUsageCost: "\u5E73\u53F0\u6D88\u8D39",
19202
+ scopeNote: "\u5168\u90E8\u8C03\u7528\u4F30\u503C\u4E3A\u76EE\u5F55\u4EF7\uFF0C\u542B\u5931\u8D25\u4E0E\u514D\u5355\u8C03\u7528\uFF1B\u5E73\u53F0\u6D88\u8D39\u4EC5\u542B\u53EF\u8BA1\u8D39\u4E14\u6210\u529F\u7684\u8C03\u7528\uFF1B\u5B9E\u9645\u6263\u6B3E\u4EE5\u8D26\u672C\u4E3A\u51C6\u3002",
19198
19203
  recordCount: "\u8BB0\u5F55\u6570",
19199
19204
  recordCountUnit: "\u6761",
19200
19205
  inputTokens: "\u8F93\u5165 Token",
@@ -19205,7 +19210,8 @@ var admin_locale_default = {
19205
19210
  totalItems: "\u5171 {{value}} \u9879",
19206
19211
  table: {
19207
19212
  requests: "\u8BF7\u6C42\u6570",
19208
- cost: "\u6D88\u8017",
19213
+ cost: "\u8C03\u7528\u4F30\u503C",
19214
+ platformCost: "\u5E73\u53F0\u6D88\u8D39",
19209
19215
  share: "\u5360\u6BD4",
19210
19216
  inputTokens: "\u8F93\u5165 Token",
19211
19217
  outputTokens: "\u8F93\u51FA Token"
@@ -19632,8 +19638,10 @@ var admin_locale_default = {
19632
19638
  day: "\u6BCF\u65E5"
19633
19639
  },
19634
19640
  summary: {
19635
- totalCost: "\u7E3D\u6D88\u8017",
19641
+ totalCost: "\u5168\u90E8\u8ABF\u7528\u4F30\u503C",
19636
19642
  totalCostUnit: "\u7A4D\u5206",
19643
+ platformUsageCost: "\u5E73\u53F0\u6D88\u8CBB",
19644
+ scopeNote: "\u5168\u90E8\u8ABF\u7528\u4F30\u503C\u70BA\u76EE\u9304\u50F9\uFF0C\u542B\u5931\u6557\u8207\u514D\u55AE\u8ABF\u7528\uFF1B\u5E73\u53F0\u6D88\u8CBB\u50C5\u542B\u53EF\u8A08\u8CBB\u4E14\u6210\u529F\u7684\u8ABF\u7528\uFF1B\u5BE6\u969B\u6263\u6B3E\u4EE5\u8CEC\u672C\u70BA\u6E96\u3002",
19637
19645
  recordCount: "\u8A18\u9304\u6578",
19638
19646
  recordCountUnit: "\u689D",
19639
19647
  inputTokens: "\u8F38\u5165 Token",
@@ -19644,7 +19652,8 @@ var admin_locale_default = {
19644
19652
  totalItems: "\u5171 {{value}} \u9805",
19645
19653
  table: {
19646
19654
  requests: "\u8ACB\u6C42\u6578",
19647
- cost: "\u6D88\u8017",
19655
+ cost: "\u8ABF\u7528\u4F30\u503C",
19656
+ platformCost: "\u5E73\u53F0\u6D88\u8CBB",
19648
19657
  share: "\u4F54\u6BD4",
19649
19658
  inputTokens: "\u8F38\u5165 Token",
19650
19659
  outputTokens: "\u8F38\u51FA Token"
@@ -20071,8 +20080,10 @@ var admin_locale_default = {
20071
20080
  day: "\u65E5\u5225"
20072
20081
  },
20073
20082
  summary: {
20074
- totalCost: "\u7DCF\u6D88\u8CBB",
20083
+ totalCost: "\u5168\u30B3\u30FC\u30EB\u63A8\u5B9A",
20075
20084
  totalCostUnit: "\u30DD\u30A4\u30F3\u30C8",
20085
+ platformUsageCost: "\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u6D88\u8CBB",
20086
+ scopeNote: "\u5168\u30B3\u30FC\u30EB\u63A8\u5B9A\u306F\u30AB\u30BF\u30ED\u30B0\u4FA1\u683C\u30D9\u30FC\u30B9\u3067\u3001\u5931\u6557\u30FB\u7121\u6599\u30B3\u30FC\u30EB\u3092\u542B\u307F\u307E\u3059\u3002\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u6D88\u8CBB\u306F\u8AB2\u91D1\u5BFE\u8C61\u3067\u6210\u529F\u3057\u305F\u30B3\u30FC\u30EB\u306E\u307F\u3067\u3059\u3002\u5B9F\u969B\u306E\u8ACB\u6C42\u306F\u53F0\u5E33\u306B\u5F93\u3044\u307E\u3059\u3002",
20076
20087
  recordCount: "\u30EC\u30B3\u30FC\u30C9\u6570",
20077
20088
  recordCountUnit: "\u4EF6",
20078
20089
  inputTokens: "\u5165\u529B\u30C8\u30FC\u30AF\u30F3",
@@ -20083,7 +20094,8 @@ var admin_locale_default = {
20083
20094
  totalItems: "\u5408\u8A08 {{value}} \u4EF6",
20084
20095
  table: {
20085
20096
  requests: "\u30EA\u30AF\u30A8\u30B9\u30C8\u6570",
20086
- cost: "\u6D88\u8CBB",
20097
+ cost: "\u63A8\u5B9A\u5024",
20098
+ platformCost: "\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u6D88\u8CBB",
20087
20099
  share: "\u5272\u5408",
20088
20100
  inputTokens: "\u5165\u529B\u30C8\u30FC\u30AF\u30F3",
20089
20101
  outputTokens: "\u51FA\u529B\u30C8\u30FC\u30AF\u30F3"
@@ -23937,7 +23949,7 @@ var messageSlice = createSliceWithThunks({
23937
23949
  runtimeOptions: args.runtimeOptions
23938
23950
  });
23939
23951
  if (agentKeyToUse) {
23940
- const { streamAgentChatTurn } = await import("./agentSlice-ZTFKNEHJ.js");
23952
+ const { streamAgentChatTurn } = await import("./agentSlice-ZOCKW66S.js");
23941
23953
  await dispatch(
23942
23954
  streamAgentChatTurn({
23943
23955
  agentKey: agentKeyToUse,
@@ -25073,7 +25085,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
25073
25085
  }
25074
25086
  if (isCurrentDialog) {
25075
25087
  await thunkApi.dispatch(resetMsgs());
25076
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-HA7LO4KI.js");
25088
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-WW75BKLO.js");
25077
25089
  dispatch(clearPendingAttachments2());
25078
25090
  }
25079
25091
  return { dialogKey, isCurrentDialog, attachmentPlan };
@@ -25081,15 +25093,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
25081
25093
 
25082
25094
  // packages/chat/dialog/dialogSlice.ts
25083
25095
  var runCreateDialogAction = async (args, thunkApi) => {
25084
- const { createDialogAction } = await import("./createDialogAction-27LGAZTE.js");
25096
+ const { createDialogAction } = await import("./createDialogAction-WLVAITHA.js");
25085
25097
  return createDialogAction(args, thunkApi);
25086
25098
  };
25087
25099
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
25088
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-3WQROJFS.js");
25100
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-ROWX5ZPK.js");
25089
25101
  return createAgentAutomationAction(args, thunkApi);
25090
25102
  };
25091
25103
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
25092
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-YV5HMYZM.js");
25104
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-7YZ7FNAK.js");
25093
25105
  return updateDialogTitleAction(args, thunkApi);
25094
25106
  };
25095
25107
  var runAddDialogAgentAction = async (args, thunkApi) => {
@@ -25113,7 +25125,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
25113
25125
  return setDialogExtraReferencesAction(args, thunkApi);
25114
25126
  };
25115
25127
  var runHandleSendMessageAction = async (args, thunkApi) => {
25116
- const { handleSendMessageAction } = await import("./handleSendMessageAction-L773P53D.js");
25128
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-2M57WHLO.js");
25117
25129
  return handleSendMessageAction(args, thunkApi);
25118
25130
  };
25119
25131
  function clearDialogState() {
@@ -25126,7 +25138,7 @@ var createPageAndAddReference = createAsyncThunk(
25126
25138
  async (payload, { dispatch, getState, rejectWithValue }) => {
25127
25139
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
25128
25140
  try {
25129
- const { createDocState } = await import("./docStore-5ZEQSBCJ.js");
25141
+ const { createDocState } = await import("./docStore-2SADZYLX.js");
25130
25142
  const pageKey = await createDocState(
25131
25143
  { slateData, title },
25132
25144
  { dispatch, getState }
@@ -304,7 +304,7 @@ var slice = createSliceWithThunks({
304
304
  const overrides = {};
305
305
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
306
306
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
307
- const { _executeModel } = await import("./_executeModel-PSFK7JFS.js");
307
+ const { _executeModel } = await import("./_executeModel-3OCR5R5P.js");
308
308
  return _executeModel(
309
309
  {
310
310
  isStreaming: args.isStreaming ?? false,
@@ -325,7 +325,7 @@ var slice = createSliceWithThunks({
325
325
  * - 循环直到无工具调用或触发其他运行时停止条件
326
326
  */
327
327
  runAgent: create.asyncThunk(async (args, thunkApi) => {
328
- const { runAgentClientLoop } = await import("./runAgentClientLoop-POZB5FTY.js");
328
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-RPEULJFS.js");
329
329
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
330
330
  {
331
331
  agentKey: args.agentKey,
@@ -341,7 +341,7 @@ var slice = createSliceWithThunks({
341
341
  * 聊天轮次流式 Agent 调用
342
342
  */
343
343
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
344
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-HSJ7LAWE.js");
344
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-D5POCPVX.js");
345
345
  return streamAgentChatTurnHandler(args, thunkApi);
346
346
  }),
347
347
  /**
@@ -1,6 +1,117 @@
1
+ import {
2
+ asOptionalFiniteNumber
3
+ } from "./chunk-WWC7I6TA.js";
1
4
  import {
2
5
  isAbortError
3
6
  } from "./chunk-QOKAKDPE.js";
7
+ import {
8
+ isRecord
9
+ } from "./chunk-KUG52IAP.js";
10
+ import {
11
+ asOptionalTrimmedString
12
+ } from "./chunk-G3SUCT4W.js";
13
+
14
+ // packages/ai/agent/projectDesktopToolUiContent.ts
15
+ var DESKTOP_TOOL_UI_CONTENT_MAX_CHARS = 48e3;
16
+ function clipUiText(value, max = DESKTOP_TOOL_UI_CONTENT_MAX_CHARS) {
17
+ if (value.length <= max) return value;
18
+ return `${value.slice(0, Math.max(0, max - 20))}
19
+ \u2026[truncated for UI]`;
20
+ }
21
+ function tryParseJsonRecord(text) {
22
+ const trimmed2 = text.trim();
23
+ if (!trimmed2.startsWith("{") && !trimmed2.startsWith("[")) return null;
24
+ try {
25
+ const parsed = JSON.parse(trimmed2);
26
+ return isRecord(parsed) ? parsed : null;
27
+ } catch {
28
+ return null;
29
+ }
30
+ }
31
+ function parseShellToolTextContent(content) {
32
+ const text = content ?? "";
33
+ if (!text.trim()) return { stdout: "", stderr: "" };
34
+ const exitMatch = text.match(/(?:^|\n)exitCode:\s*(-?\d+)\s*$/);
35
+ const exitCode = exitMatch ? Number(exitMatch[1]) : void 0;
36
+ const body = (exitMatch ? text.slice(0, exitMatch.index) : text).replace(
37
+ /\s+$/,
38
+ ""
39
+ );
40
+ let stdout = "";
41
+ let stderr = "";
42
+ if (body.startsWith("stdout:\n") || body.includes("\nstdout:\n")) {
43
+ const afterStdout = body.replace(/^[\s\S]*?stdout:\n/, "");
44
+ if (afterStdout.includes("\n\nstderr:\n")) {
45
+ const [out, err] = afterStdout.split("\n\nstderr:\n");
46
+ stdout = out ?? "";
47
+ stderr = err ?? "";
48
+ } else if (afterStdout.startsWith("stderr:\n")) {
49
+ stderr = afterStdout.slice("stderr:\n".length);
50
+ } else {
51
+ stdout = afterStdout;
52
+ }
53
+ } else if (body.startsWith("stderr:\n") || body.includes("\nstderr:\n")) {
54
+ stderr = body.replace(/^[\s\S]*?stderr:\n/, "");
55
+ } else {
56
+ stdout = body;
57
+ }
58
+ return {
59
+ stdout,
60
+ stderr,
61
+ ...typeof exitCode === "number" && Number.isFinite(exitCode) ? { exitCode } : {}
62
+ };
63
+ }
64
+ function resolveShellCommand(metadata, argumentsPreview) {
65
+ return asOptionalTrimmedString(metadata.command) || asOptionalTrimmedString(metadata.cmd) || asOptionalTrimmedString(argumentsPreview) || "";
66
+ }
67
+ function projectDesktopToolUiContent(args) {
68
+ const toolName = asOptionalTrimmedString(args.toolName) || "tool";
69
+ const metadata = isRecord(args.metadata) ? args.metadata : {};
70
+ const rawContent = typeof args.content === "string" ? args.content : typeof args.summary === "string" ? args.summary : typeof args.message === "string" ? args.message : "";
71
+ if (toolName === "setTodoList") {
72
+ const existing = tryParseJsonRecord(rawContent);
73
+ if (existing && Array.isArray(existing.todos)) {
74
+ return clipUiText(JSON.stringify({ todos: existing.todos }));
75
+ }
76
+ }
77
+ if (toolName === "execShell") {
78
+ const existing = tryParseJsonRecord(rawContent);
79
+ if (existing && (typeof existing.stdout === "string" || typeof existing.command === "string" || typeof existing.stderr === "string")) {
80
+ const command2 = asOptionalTrimmedString(existing.command) || resolveShellCommand(metadata, args.argumentsPreview);
81
+ return JSON.stringify({
82
+ ...existing,
83
+ command: command2,
84
+ cwd: asOptionalTrimmedString(existing.cwd) || asOptionalTrimmedString(metadata.cwd) || null,
85
+ exitCode: asOptionalFiniteNumber(existing.exitCode) ?? asOptionalFiniteNumber(metadata.exitCode)
86
+ });
87
+ }
88
+ const parsed = parseShellToolTextContent(rawContent);
89
+ const command = resolveShellCommand(metadata, args.argumentsPreview);
90
+ return JSON.stringify({
91
+ command,
92
+ cwd: asOptionalTrimmedString(metadata.cwd) || null,
93
+ stdout: clipUiText(parsed.stdout),
94
+ stderr: clipUiText(parsed.stderr),
95
+ exitCode: asOptionalFiniteNumber(metadata.exitCode) ?? parsed.exitCode,
96
+ timedOut: metadata.timedOut === true,
97
+ blocked: metadata.blocked === true
98
+ });
99
+ }
100
+ if (toolName === "readFile" || toolName === "read_file") {
101
+ const filePath = asOptionalTrimmedString(metadata.path) || asOptionalTrimmedString(metadata.filePath) || asOptionalTrimmedString(metadata.file_path) || asOptionalTrimmedString(args.argumentsPreview) || "";
102
+ const body = typeof args.content === "string" && args.content || typeof args.summary === "string" && args.summary || typeof args.message === "string" && args.message || "";
103
+ return JSON.stringify({
104
+ filePath,
105
+ content: clipUiText(body),
106
+ ...asOptionalFiniteNumber(metadata.startLine) != null ? { startLine: asOptionalFiniteNumber(metadata.startLine) } : {},
107
+ ...asOptionalFiniteNumber(metadata.endLine) != null ? { endLine: asOptionalFiniteNumber(metadata.endLine) } : {},
108
+ ...asOptionalFiniteNumber(metadata.totalLines) != null ? { totalLines: asOptionalFiniteNumber(metadata.totalLines) } : {},
109
+ ...metadata.truncated === true ? { truncated: true } : {}
110
+ });
111
+ }
112
+ const preferred = typeof args.content === "string" && args.content || typeof args.summary === "string" && args.summary || typeof args.message === "string" && args.message || "";
113
+ return clipUiText(preferred);
114
+ }
4
115
 
5
116
  // packages/ai/agent/foregroundTurnAdmissionFetch.ts
6
117
  var FOREGROUND_TURN_KEEPALIVE_MAX_BODY_BYTES = 60 * 1024;
@@ -189,6 +300,7 @@ async function consumeAgentRunStream(handlers) {
189
300
  }
190
301
 
191
302
  export {
303
+ projectDesktopToolUiContent,
192
304
  buildForegroundTurnAdmissionFetchInit,
193
305
  consumeAgentRunStream
194
306
  };
@@ -103,7 +103,7 @@ function createDaemonShortcutCommand(path, description, command) {
103
103
  // packages/cli/agentInternalCommandEntries.ts
104
104
  function getAgentInternalCommandEntries() {
105
105
  const createAgentRunCommand = (path, description) => createContextCommand(path, description, async (args, ctx) => {
106
- const { runAgentRunCommand } = await import("./agentRunCommand-LWNLMKAC.js");
106
+ const { runAgentRunCommand } = await import("./agentRunCommand-O2F3NU2H.js");
107
107
  return runAgentRunCommand(args, {
108
108
  env: ctx.env,
109
109
  scriptDir: ctx.scriptDir,
@@ -119,7 +119,7 @@ function getAgentInternalCommandEntries() {
119
119
  return runAgentListCommand(args, deps);
120
120
  }),
121
121
  createEnvCommand(["agent", "create"], "Create a new agent", async (args, deps) => {
122
- const { runAgentCreateCommand } = await import("./agentRecordCommands-TIWPKZ3T.js");
122
+ const { runAgentCreateCommand } = await import("./agentRecordCommands-BW7HM6VH.js");
123
123
  return runAgentCreateCommand(args, deps);
124
124
  }),
125
125
  createEnvCommand(["agent", "models"], "List models available on an OpenAI-compatible provider", async (args, deps) => {
@@ -135,7 +135,7 @@ function getAgentInternalCommandEntries() {
135
135
  return runAgentPullCommand(args, deps);
136
136
  }),
137
137
  createEnvCommand(["agent", "read"], "Read a single agent", async (args, deps) => {
138
- const { runAgentReadCommand } = await import("./agentRecordCommands-TIWPKZ3T.js");
138
+ const { runAgentReadCommand } = await import("./agentRecordCommands-BW7HM6VH.js");
139
139
  return runAgentReadCommand(args, deps);
140
140
  }),
141
141
  createAgentRunCommand(["agent", "run"], "Run an agent"),
@@ -164,26 +164,26 @@ function getAgentInternalCommandEntries() {
164
164
  return runSetupOfflineMarxistsAgentCommand(args, deps);
165
165
  }),
166
166
  createEnvCommand(["agent", "update"], "Update agent fields", async (args, deps) => {
167
- const { runAgentUpdateCommand } = await import("./agentRecordCommands-TIWPKZ3T.js");
167
+ const { runAgentUpdateCommand } = await import("./agentRecordCommands-BW7HM6VH.js");
168
168
  return runAgentUpdateCommand(args, deps);
169
169
  }),
170
170
  createEnvCommand(["agent", "email", "provision"], "Provision a controlled inbox for an agent", async (args, deps) => {
171
- const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-4IDFCQL5.js");
171
+ const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-OAPYGNYC.js");
172
172
  return runAgentEmailProvisionCommand(args, deps);
173
173
  }),
174
174
  createEnvCommand(["agent", "email", "bind"], "Bind an existing email address to an agent", async (args, deps) => {
175
- const { runAgentEmailBindCommand } = await import("./agentEmailCommands-4IDFCQL5.js");
175
+ const { runAgentEmailBindCommand } = await import("./agentEmailCommands-OAPYGNYC.js");
176
176
  return runAgentEmailBindCommand(args, deps);
177
177
  }),
178
178
  createEnvCommand(["agent", "email", "transfer"], "Transfer an email identity from one agent to another (cross-account)", async (args, deps) => {
179
- const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-4IDFCQL5.js");
179
+ const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-OAPYGNYC.js");
180
180
  return runAgentEmailTransferCommand(args, deps);
181
181
  }),
182
182
  createEnvCommand(
183
183
  ["agent", "email", "create-and-provision"],
184
184
  "Create an agent and provision its controlled inbox",
185
185
  async (args, deps) => {
186
- const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-4IDFCQL5.js");
186
+ const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-OAPYGNYC.js");
187
187
  return runAgentEmailCreateAndProvisionCommand(args, deps);
188
188
  }
189
189
  ),
@@ -204,15 +204,15 @@ function getAgentInternalCommandEntries() {
204
204
  return runAgentRevokeGrantCommand(args, deps);
205
205
  }),
206
206
  createEnvCommand(["agent", "bind-current"], "Bind an agent to this machine", async (args, deps) => {
207
- const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-IGC4R5M3.js");
207
+ const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-OWLOV5WO.js");
208
208
  return runAgentBindCurrentCommand(args, deps);
209
209
  }),
210
210
  createEnvCommand(["agent", "smoke-current"], "Smoke test a bound agent through this machine", async (args, deps) => {
211
- const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-IGC4R5M3.js");
211
+ const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-OWLOV5WO.js");
212
212
  return runAgentSmokeCurrentCommand(args, deps);
213
213
  }),
214
214
  createEnvCommand(["agent", "runtime-doctor"], "Diagnose current machine runtime compatibility", async (args, deps) => {
215
- const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-IGC4R5M3.js");
215
+ const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-OWLOV5WO.js");
216
216
  return runAgentRuntimeDoctorCommand(args, deps);
217
217
  }),
218
218
  createAgentRunCommand(["agent", "chat"], "Chat with an agent")
@@ -473,15 +473,15 @@ function getSystemInternalCommandEntries(renderHelpText2) {
473
473
  return runWhoamiCommand({ args, env: ctx.env });
474
474
  }),
475
475
  createEntrypointEnvCommand(["connect"], "Send machine heartbeats or hold a connector websocket", async (args, deps) => {
476
- const { runMachineConnectCommand } = await import("./machineCommands-3PAJ3N4U.js");
476
+ const { runMachineConnectCommand } = await import("./machineCommands-7JUTOZP2.js");
477
477
  return runMachineConnectCommand(args, deps);
478
478
  }),
479
479
  createDaemonShortcutCommand(["daemon"], "Run the connector daemon shortcut", async (args, deps) => {
480
- const { runMachineConnectCommand } = await import("./machineCommands-3PAJ3N4U.js");
480
+ const { runMachineConnectCommand } = await import("./machineCommands-7JUTOZP2.js");
481
481
  return runMachineConnectCommand(args, deps);
482
482
  }),
483
483
  createEnvCommand(["machine", "status"], "List machines registered to the current profile", async (args, deps) => {
484
- const { runMachineStatusCommand } = await import("./machineCommands-3PAJ3N4U.js");
484
+ const { runMachineStatusCommand } = await import("./machineCommands-7JUTOZP2.js");
485
485
  return runMachineStatusCommand(args, deps);
486
486
  }),
487
487
  createEnvCommand(["doctor", "runtime"], "Diagnose local-first agent runtime selection", async (args, deps) => {
@@ -7,13 +7,13 @@ import {
7
7
  updateContentPinned,
8
8
  updateContentTitle,
9
9
  uploadAndAddFileToSpace
10
- } from "./chunk-LFD2V36M.js";
10
+ } from "./chunk-27VHPPII.js";
11
11
  import "./chunk-ZJ7UHBJS.js";
12
- import "./chunk-O4RO527J.js";
12
+ import "./chunk-PZ3HKBET.js";
13
13
  import "./chunk-523DITKR.js";
14
14
  import "./chunk-YYLHWIW6.js";
15
15
  import "./chunk-6O4IK4V2.js";
16
- import "./chunk-5MCQDAD6.js";
16
+ import "./chunk-UC3Q7X3J.js";
17
17
  import "./chunk-D76D3RTR.js";
18
18
  import "./chunk-5RGU3J7P.js";
19
19
  import "./chunk-M76ECQRD.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-LFD2V36M.js";
3
+ } from "./chunk-27VHPPII.js";
4
4
  import "./chunk-ZJ7UHBJS.js";
5
- import "./chunk-O4RO527J.js";
5
+ import "./chunk-PZ3HKBET.js";
6
6
  import "./chunk-523DITKR.js";
7
7
  import "./chunk-YYLHWIW6.js";
8
8
  import "./chunk-6O4IK4V2.js";
9
- import "./chunk-5MCQDAD6.js";
9
+ import "./chunk-UC3Q7X3J.js";
10
10
  import "./chunk-D76D3RTR.js";
11
11
  import "./chunk-5RGU3J7P.js";
12
12
  import "./chunk-M76ECQRD.js";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  createDialogAction,
3
3
  isLocalOwnerDialogAgents
4
- } from "./chunk-C5CV4CLU.js";
5
- import "./chunk-LFD2V36M.js";
4
+ } from "./chunk-P4CRULYJ.js";
5
+ import "./chunk-27VHPPII.js";
6
6
  import "./chunk-ZJ7UHBJS.js";
7
- import "./chunk-O4RO527J.js";
7
+ import "./chunk-PZ3HKBET.js";
8
8
  import "./chunk-523DITKR.js";
9
9
  import "./chunk-YYLHWIW6.js";
10
10
  import "./chunk-6O4IK4V2.js";
11
- import "./chunk-5MCQDAD6.js";
11
+ import "./chunk-UC3Q7X3J.js";
12
12
  import "./chunk-D76D3RTR.js";
13
13
  import "./chunk-5RGU3J7P.js";
14
14
  import "./chunk-M76ECQRD.js";
@@ -14,15 +14,15 @@ import {
14
14
  import {
15
15
  addContentToSpace,
16
16
  client_default
17
- } from "./chunk-LFD2V36M.js";
17
+ } from "./chunk-27VHPPII.js";
18
18
  import {
19
19
  getCurrentSpaceId
20
20
  } from "./chunk-ZJ7UHBJS.js";
21
- import "./chunk-O4RO527J.js";
21
+ import "./chunk-PZ3HKBET.js";
22
22
  import "./chunk-523DITKR.js";
23
23
  import "./chunk-YYLHWIW6.js";
24
24
  import "./chunk-6O4IK4V2.js";
25
- import "./chunk-5MCQDAD6.js";
25
+ import "./chunk-UC3Q7X3J.js";
26
26
  import "./chunk-D76D3RTR.js";
27
27
  import "./chunk-5RGU3J7P.js";
28
28
  import "./chunk-M76ECQRD.js";