nolo-cli 0.29.2 → 0.30.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 (135) hide show
  1. package/{_executeModel-BFVTGZXE.js → _executeModel-VBHHG7LT.js} +62 -68
  2. package/{action-LG32A6DJ.js → action-FENWPT3C.js} +14 -15
  3. package/{addContentAction-MPGMBJTQ.js → addContentAction-Z5S5ZQ7I.js} +12 -12
  4. package/{addDialogAgentAction-ZH23WDID.js → addDialogAgentAction-VUNVD2XR.js} +11 -11
  5. package/{agentDeleteCommand-4S4STG42.js → agentDeleteCommand-LLGZXUYJ.js} +60 -39
  6. package/{agentEmailCommands-3F4IP4DI.js → agentEmailCommands-LC2FPN6G.js} +76 -81
  7. package/{agentGrantCommands-JNDE4RWR.js → agentGrantCommands-E7ZZFRHK.js} +2 -1
  8. package/{agentListCommands-JCRV2XF6.js → agentListCommands-A6OBQ3QX.js} +57 -40
  9. package/{agentMachineCommands-KYXPYSFP.js → agentMachineCommands-4O4Q5B5X.js} +53 -35
  10. package/{agentPullCommand-ZZGU5KOY.js → agentPullCommand-4V36XNGV.js} +4 -3
  11. package/{agentRecordCommands-UADUPIXO.js → agentRecordCommands-W22RIQRV.js} +73 -78
  12. package/{agentRunCommand-MJWSR53W.js → agentRunCommand-V4OBU4FB.js} +77 -82
  13. package/{agentRunControl-SNUKXN6J.js → agentRunControl-AKBN2366.js} +13 -1
  14. package/{agentRuntimeLocal-PC5RRRPT.js → agentRuntimeLocal-I57YSGH4.js} +48 -30
  15. package/{agentSlice-C5OYLNBT.js → agentSlice-3ZHY7RAO.js} +12 -13
  16. package/{appDeleteCommands-ZXODZ5AD.js → appDeleteCommands-DJJF466K.js} +53 -35
  17. package/{appDeployCommands-AWC6JPZH.js → appDeployCommands-WJZGIOEZ.js} +53 -35
  18. package/{appDeployStatusCommands-74NXMDAI.js → appDeployStatusCommands-ICYXUJNO.js} +53 -35
  19. package/{appGetCommands-6YGIAP5L.js → appGetCommands-UOCWYJPV.js} +53 -35
  20. package/{appListCommands-DZWBHMNK.js → appListCommands-EOKWTXPW.js} +53 -35
  21. package/{authCommand-XMQHBK5L.js → authCommand-H5KE7K7K.js} +16 -16
  22. package/{authCommands-JSOG2H4E.js → authCommands-CXJ6PI2O.js} +7 -7
  23. package/{chunk-OEWEE4VW.js → chunk-2XM5KUNE.js} +4 -2
  24. package/{chunk-7H3UTGPM.js → chunk-3AUWC6EM.js} +82 -3
  25. package/{chunk-HEXXIS77.js → chunk-3RIWR23B.js} +1 -1
  26. package/{chunk-R7LOFGRE.js → chunk-446VANPP.js} +18 -14
  27. package/{chunk-RZNYL4LW.js → chunk-4SAV7BD7.js} +65 -1
  28. package/{chunk-QC6ZWDSV.js → chunk-56IUA7RU.js} +3 -3
  29. package/{chunk-R3JSTDQO.js → chunk-66O5MZYH.js} +1 -1
  30. package/{chunk-PSK2RUHV.js → chunk-7CD24PU4.js} +360 -2
  31. package/{chunk-G2BZ43DV.js → chunk-A4JDTA5T.js} +13 -13
  32. package/{chunk-DZ3XJVET.js → chunk-AOS5IN2I.js} +1 -1
  33. package/{chunk-SKDNBYZK.js → chunk-BOL2D2JW.js} +1 -1
  34. package/{chunk-YTA2QOEE.js → chunk-CAENRKNJ.js} +15 -0
  35. package/{chunk-2TYLTEAH.js → chunk-CV6I4HBA.js} +1 -1
  36. package/chunk-DCDL3GC4.js +171 -0
  37. package/{chunk-FVOSIYXM.js → chunk-DCWBP2O7.js} +42 -393
  38. package/{chunk-OLWMGSW2.js → chunk-DI6MXJK5.js} +37 -37
  39. package/{chunk-HRPWRVBI.js → chunk-DKRT67FG.js} +11 -11
  40. package/{chunk-L6RBX4L4.js → chunk-DWQNDGO7.js} +20 -8
  41. package/{chunk-VKBTAQWT.js → chunk-FS5TTXPS.js} +6 -6
  42. package/chunk-G5JHHUAK.js +73 -0
  43. package/{chunk-TOGGHWHI.js → chunk-G6VITLCZ.js} +3 -3
  44. package/{chunk-RJBTU7AS.js → chunk-GAGUBI42.js} +302 -14
  45. package/{chunk-NXMJ55RU.js → chunk-GVKTKT3O.js} +3 -3
  46. package/{chunk-5ZXNLOAG.js → chunk-HI7QZNWX.js} +17 -10
  47. package/{chunk-DF7SMWEV.js → chunk-HLG6GAUD.js} +1 -1
  48. package/{chunk-MQRZ5QUH.js → chunk-IXZX5CJK.js} +1 -1
  49. package/{chunk-IC7W63RM.js → chunk-IZ3CBMD5.js} +3 -3
  50. package/{chunk-VHBWHNVT.js → chunk-K6QEHQZ3.js} +8 -4
  51. package/chunk-KW47OSRJ.js +3246 -0
  52. package/{chunk-Q5RXHXKU.js → chunk-KWKD3BCC.js} +189 -122
  53. package/{chunk-L65QKSVJ.js → chunk-L3GCUVOH.js} +1 -1
  54. package/{chunk-4BDPDTJU.js → chunk-L3VQOVKK.js} +8 -8
  55. package/{chunk-HALKDXKP.js → chunk-MEUZFIAJ.js} +8 -4
  56. package/{chunk-H5S4XUGI.js → chunk-MMCVBEAD.js} +174 -149
  57. package/{chunk-XOIF2TNF.js → chunk-OB6FBSH3.js} +13 -0
  58. package/chunk-OYK7PA5U.js +1707 -0
  59. package/{chunk-6HTWA77J.js → chunk-Q24P6TUS.js} +1 -1
  60. package/{chunk-GMJS5AYP.js → chunk-QLV2GKU5.js} +16 -178
  61. package/{chunk-WMB7GVPN.js → chunk-SWOTB2TX.js} +134 -1166
  62. package/{chunk-GC34RRTQ.js → chunk-SWYMCHM7.js} +1 -69
  63. package/{chunk-BBGRJB5E.js → chunk-SZ5CBYMZ.js} +4 -4
  64. package/chunk-T27IEBNQ.js +149 -0
  65. package/{chunk-WX3ZOSTL.js → chunk-T3Y5EMJS.js} +24 -26
  66. package/{chunk-UFL6WHHJ.js → chunk-THTAR67C.js} +1056 -137
  67. package/{chunk-2FX23RGA.js → chunk-TJYWZ3LO.js} +4 -4
  68. package/{chunk-KEF5OBOZ.js → chunk-UKC5HU2C.js} +33 -27
  69. package/{chunk-HRJEPMZY.js → chunk-UTQZ73QQ.js} +2 -2
  70. package/{chunk-GT3GG2H7.js → chunk-VSTUQGLT.js} +1 -1
  71. package/{chunk-32ZM6HVI.js → chunk-W2YKDXT7.js} +95 -95
  72. package/{chunk-L3QFIBZG.js → chunk-WTGCTVJG.js} +1 -1
  73. package/{chunk-XS7UPVR7.js → chunk-XD5NQEOH.js} +5 -5
  74. package/{chunk-WSQLK2KR.js → chunk-XFGM5PJP.js} +6 -6
  75. package/{chunk-JSB4N6NU.js → chunk-YLADSPDU.js} +3 -3
  76. package/{chunk-FRN5QOKN.js → chunk-YWGSCF37.js} +19 -4
  77. package/{codingSkills-EN6Z6G6U.js → codingSkills-V35TRR4Y.js} +1 -2
  78. package/{createAgentAutomationAction-BK4UZJKU.js → createAgentAutomationAction-3GMH6ORX.js} +30 -37
  79. package/{createDialogAction-MJJUI2MK.js → createDialogAction-R5MCL4RE.js} +32 -38
  80. package/{createPageAction-YMZ7K363.js → createPageAction-QYTG656R.js} +43 -50
  81. package/{dbSlice-6QJYQUBV.js → dbSlice-OBV7VFCF.js} +11 -11
  82. package/{deleteFile-WDZ3VM7B.js → deleteFile-AC45HYSM.js} +5 -5
  83. package/{dialogCommands-OKH45ASS.js → dialogCommands-NUQGIXVZ.js} +53 -37
  84. package/{dialogSlice-UDOKNDHB.js → dialogSlice-CFDECXEU.js} +27 -34
  85. package/{docCreateCommands-MCLMR4TE.js → docCreateCommands-UNFCXB5N.js} +52 -36
  86. package/{docDeleteCommands-ONDHI7JV.js → docDeleteCommands-NG5IVKE5.js} +54 -38
  87. package/{docReadCommands-FCXBMISW.js → docReadCommands-6J7MUUX6.js} +52 -36
  88. package/{docStore-N66O4CGH.js → docStore-MZZWJM4F.js} +28 -35
  89. package/{docUpdateCommands-T3XN6XOX.js → docUpdateCommands-6AW3VZOX.js} +55 -39
  90. package/{fetchMessages-W4IKHPCS.js → fetchMessages-VPPQDDZ4.js} +3 -3
  91. package/{getPricing-X6I23RN6.js → getPricing-XQYSSVV6.js} +6 -7
  92. package/{handleSendMessageAction-KC4AYUZP.js → handleSendMessageAction-IU2QNTLM.js} +30 -37
  93. package/index.js +72 -72
  94. package/{localDialogRead-UFLBS6OT.js → localDialogRead-P72W2U2R.js} +1 -1
  95. package/{machineCommands-DIMRFA3Y.js → machineCommands-Z2QEWTHZ.js} +76 -81
  96. package/{machineWsRunDispatch-2DYJZI6Z.js → machineWsRunDispatch-SJTYHZHN.js} +71 -76
  97. package/{models-YT32CTT5.js → models-WDUTTYFS.js} +2 -2
  98. package/{offlineMarxistsAgentCommand-5OOWZLJI.js → offlineMarxistsAgentCommand-E6LUG63A.js} +6 -2
  99. package/package.json +1 -1
  100. package/{read-C7Y6LSBM.js → read-QK7ZRX6G.js} +6 -6
  101. package/{readDocTool-TOHRYJHP.js → readDocTool-EYDMVRBL.js} +2 -1
  102. package/{readlineWorkspace-HUPHMLDG.js → readlineWorkspace-BGKPABK4.js} +208 -183
  103. package/{removeDialogAgentAction-WZXPOH5S.js → removeDialogAgentAction-TBW3UZJW.js} +15 -16
  104. package/{runAgentClientLoop-5TGSUKHV.js → runAgentClientLoop-N3YDLTMS.js} +61 -66
  105. package/{setDialogExtraReferencesAction-INZY2ENI.js → setDialogExtraReferencesAction-Q3ANF2NR.js} +12 -12
  106. package/{setPrimaryDialogAgentAction-WCVLPYCF.js → setPrimaryDialogAgentAction-FQ5R3EFJ.js} +15 -16
  107. package/{settingSlice-IDUM4LWU.js → settingSlice-JKKV2T7O.js} +13 -14
  108. package/{skillDiscovery-ITA7BI7A.js → skillDiscovery-I3QRA7NE.js} +2 -2
  109. package/{spaceCommands-XSSDB3YK.js → spaceCommands-R6AEQNLG.js} +57 -40
  110. package/{spaceSlice-BXDCO6PT.js → spaceSlice-MCH7RLLP.js} +27 -34
  111. package/{streamAgentChatTurn-HRFMVSVC.js → streamAgentChatTurn-Q4U2CVMI.js} +130 -1300
  112. package/{switchDialogAgentAction-YBFFCBOD.js → switchDialogAgentAction-QQGVE4SL.js} +11 -11
  113. package/{toolApiClient-WVTUYOFM.js → toolApiClient-ARGFDJAG.js} +2 -2
  114. package/{tools-5V6FHWQU.js → tools-Y3UBLLYW.js} +50 -56
  115. package/{tuiSummaryLlmCaller-GCUPULOV.js → tuiSummaryLlmCaller-4474IBTI.js} +12 -12
  116. package/{updateDialogTitleAction-W62C4W4K.js → updateDialogTitleAction-3J7GH67I.js} +35 -43
  117. package/chunk-5CS33IBL.js +0 -301
  118. package/chunk-5MMAK75Q.js +0 -15
  119. package/chunk-HYSJHRWD.js +0 -669
  120. package/chunk-MRC4Q34M.js +0 -188
  121. package/chunk-SIZQB7BD.js +0 -91
  122. package/chunk-UEOPA6MV.js +0 -641
  123. package/chunk-VIDPVFP3.js +0 -20
  124. package/chunk-W2LZV5GE.js +0 -231
  125. package/chunk-Y5GCAMGP.js +0 -9
  126. package/chunk-YYLHWIW6.js +0 -48
  127. package/chunk-Z54ZAZZC.js +0 -1791
  128. package/chunk-ZZ2MH7LE.js +0 -84
  129. package/{chunk-OMP5L5NF.js → chunk-44HACRCK.js} +3 -3
  130. package/{chunk-ZVZMT3EA.js → chunk-KWCLUYGQ.js} +3 -3
  131. package/{chunk-NRY4GCKJ.js → chunk-WHLVPK32.js} +3 -3
  132. package/{chunk-RQSOAMPJ.js → chunk-Z5MXSEOJ.js} +2 -2
  133. package/{chunk-XMLRJUU5.js → chunk-ZFTCLBEX.js} +9 -9
  134. package/{runtimeDoctorCommands-HSU632DY.js → runtimeDoctorCommands-E2OUORHK.js} +3 -3
  135. package/{tableCommands-QSZILI7I.js → tableCommands-PRJNWN6Q.js} +6 -6
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  trimTrailingSlash
3
- } from "./chunk-XS7UPVR7.js";
3
+ } from "./chunk-XD5NQEOH.js";
4
4
  import {
5
5
  toErrorMessage
6
6
  } from "./chunk-HNMXYYJR.js";
7
- import {
8
- asOptionalFiniteNumber
9
- } from "./chunk-WWC7I6TA.js";
10
7
  import {
11
8
  asTrimmedLowercaseString
12
9
  } from "./chunk-QSJ3HFEF.js";
10
+ import {
11
+ asOptionalFiniteNumber
12
+ } from "./chunk-WWC7I6TA.js";
13
13
  import {
14
14
  asOptionalTrimmedString
15
15
  } from "./chunk-G3SUCT4W.js";
@@ -4,11 +4,14 @@ import {
4
4
  providerHttpFailure,
5
5
  readSseFrames,
6
6
  throwIfChatCompletionStreamFailed
7
- } from "./chunk-HALKDXKP.js";
7
+ } from "./chunk-MEUZFIAJ.js";
8
+ import {
9
+ sanitizeForOutbound
10
+ } from "./chunk-T27IEBNQ.js";
8
11
  import {
9
12
  parseToolArgumentsJson,
10
13
  resolveHistoricalToolContentCap
11
- } from "./chunk-Z54ZAZZC.js";
14
+ } from "./chunk-KW47OSRJ.js";
12
15
  import {
13
16
  createThinkParserState,
14
17
  createToolCallAccumulator,
@@ -19,7 +22,7 @@ import {
19
22
  import {
20
23
  requiresBareImageUrl,
21
24
  toBareImageUrlMessages
22
- } from "./chunk-PSK2RUHV.js";
25
+ } from "./chunk-7CD24PU4.js";
23
26
  import {
24
27
  shouldStripReasoningContentForOutbound,
25
28
  toOpenAiCompatibleMessages
@@ -27,37 +30,34 @@ import {
27
30
  import {
28
31
  buildProviderAuthHeaders,
29
32
  buildProviderExecutionPlan
30
- } from "./chunk-XS7UPVR7.js";
33
+ } from "./chunk-XD5NQEOH.js";
34
+ import {
35
+ buildDialogFallbackTitleFromUserInput
36
+ } from "./chunk-2MBTWINN.js";
31
37
  import {
32
38
  NOLO_WORKSPACE_TOOL_NAMES,
33
39
  buildNoloWorkspaceCommandArgs,
34
40
  noloStringArg,
35
41
  parseNoloWorkspaceToolArguments
36
- } from "./chunk-UEOPA6MV.js";
37
- import {
38
- buildDialogFallbackTitleFromUserInput
39
- } from "./chunk-2MBTWINN.js";
40
- import {
41
- canonicalizeToolName
42
- } from "./chunk-ZZ2MH7LE.js";
42
+ } from "./chunk-OYK7PA5U.js";
43
43
  import {
44
44
  toErrorMessage
45
45
  } from "./chunk-HNMXYYJR.js";
46
46
  import {
47
47
  asRecordOrEmpty
48
48
  } from "./chunk-KX6YBIHG.js";
49
+ import {
50
+ asTrimmedLowercaseString
51
+ } from "./chunk-QSJ3HFEF.js";
52
+ import {
53
+ normalizeServerOrigin
54
+ } from "./chunk-CF7PE763.js";
49
55
  import {
50
56
  dialogMessageKey
51
- } from "./chunk-NRY4GCKJ.js";
57
+ } from "./chunk-WHLVPK32.js";
52
58
  import {
53
59
  asOptionalFiniteNumber
54
60
  } from "./chunk-WWC7I6TA.js";
55
- import {
56
- asTrimmedNonEmptyStringArray
57
- } from "./chunk-I42VC5KR.js";
58
- import {
59
- asTrimmedLowercaseString
60
- } from "./chunk-QSJ3HFEF.js";
61
61
  import {
62
62
  asTrimmedString
63
63
  } from "./chunk-3EUW3WEO.js";
@@ -68,8 +68,11 @@ import {
68
68
  isRecord
69
69
  } from "./chunk-KUG52IAP.js";
70
70
  import {
71
- normalizeServerOrigin
72
- } from "./chunk-CF7PE763.js";
71
+ canonicalizeToolName
72
+ } from "./chunk-3AUWC6EM.js";
73
+ import {
74
+ asTrimmedNonEmptyStringArray
75
+ } from "./chunk-I42VC5KR.js";
73
76
  import {
74
77
  asOptionalTrimmedString
75
78
  } from "./chunk-G3SUCT4W.js";
@@ -145,7 +148,8 @@ function buildOpenAiCompatibleChatCompletionRequest(args) {
145
148
  args.providerConfig.provider,
146
149
  args.providerConfig.model
147
150
  );
148
- const messages = toOpenAiCompatibleMessages(args.messages, {
151
+ const sanitizedMessages = sanitizeForOutbound(args.messages, args.tools);
152
+ const messages = toOpenAiCompatibleMessages(sanitizedMessages, {
149
153
  stripReasoningContent: shouldStripReasoning
150
154
  });
151
155
  const body = {
@@ -1123,6 +1127,7 @@ function resolveLocalToolPolicy(args) {
1123
1127
  reason: `${toolName} is not enabled for local runtime runs. The agent must declare the tool in its manifest; in restricted mode (NOLO_LOCAL_TOOL_MODE=restricted) non-default tools also require adding to NOLO_LOCAL_ALLOWED_TOOLS (e.g. NOLO_LOCAL_ALLOWED_TOOLS=someCustomTool) and restarting the session so the env var loads.`
1124
1128
  };
1125
1129
  }
1130
+ var ABORT_AWARE_LOCAL_TOOLS = /* @__PURE__ */ new Set(["execShell", "controlAgentRun"]);
1126
1131
  async function executeLocalToolWithPolicy(args) {
1127
1132
  const decision = resolveLocalToolPolicy({
1128
1133
  env: args.env,
@@ -1134,7 +1139,7 @@ async function executeLocalToolWithPolicy(args) {
1134
1139
  if (!executor) {
1135
1140
  throw new Error(`${decision.toolName} is allowed by policy but no local executor is registered.`);
1136
1141
  }
1137
- const effectiveExecutor = args.abortSignal && decision.toolName === "execShell" && args.executors ? (call) => args.executors.execShell(call, {
1142
+ const effectiveExecutor = args.abortSignal && ABORT_AWARE_LOCAL_TOOLS.has(decision.toolName) && args.executors ? (call) => executor(call, {
1138
1143
  abortSignal: args.abortSignal,
1139
1144
  detachMs: args.detachMs
1140
1145
  }) : executor;
@@ -2549,8 +2554,8 @@ function convertEol(text, eol) {
2549
2554
  function pluralizeReplacement(count) {
2550
2555
  return count === 1 ? "replacement" : "replacements";
2551
2556
  }
2552
- var EDIT_SNIPPET_MAX_LINES = 5;
2553
- var EDIT_SNIPPET_WIDTH = 96;
2557
+ var EDIT_SNIPPET_MAX_LINES = 24;
2558
+ var EDIT_SNIPPET_WIDTH = 160;
2554
2559
  function clipEditSnippet(text) {
2555
2560
  const lines = text.split(/\r?\n/).filter((line) => line.length > 0);
2556
2561
  return lines.slice(0, EDIT_SNIPPET_MAX_LINES).map((line) => line.length > EDIT_SNIPPET_WIDTH ? `${line.slice(0, EDIT_SNIPPET_WIDTH)}\u2026` : line).join("\n");
@@ -3239,6 +3244,7 @@ async function writeFileTool(args) {
3239
3244
  metadata: {
3240
3245
  path: relativePath,
3241
3246
  bytes: Buffer.byteLength(content),
3247
+ totalLines: content.length === 0 ? 0 : content.split(/\r?\n/).length,
3242
3248
  ...diffStat ? { diffStat } : {},
3243
3249
  ...activity ? { activity } : {}
3244
3250
  }
@@ -4080,10 +4086,10 @@ function buildLoadSkillExecutor(args) {
4080
4086
  metadata: { loadSkill: true, resolved: false }
4081
4087
  };
4082
4088
  }
4083
- const { resolveSkillByName } = await import("./skillDiscovery-ITA7BI7A.js");
4089
+ const { resolveSkillByName } = await import("./skillDiscovery-I3QRA7NE.js");
4084
4090
  const resolved = resolveSkillByName(args.cwd, name);
4085
4091
  if (!resolved) {
4086
- const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-EN6Z6G6U.js");
4092
+ const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-V35TRR4Y.js");
4087
4093
  const builtinSlug = resolveCodingBuiltinSlug(name);
4088
4094
  if (builtinSlug) {
4089
4095
  const body = buildCodingSkillContentBySlug(builtinSlug);
@@ -4118,7 +4124,7 @@ ${body}`,
4118
4124
  };
4119
4125
  }
4120
4126
  async function formatUnknownSkillMessage(cwd, requestedName) {
4121
- const { discoverSkills } = await import("./skillDiscovery-ITA7BI7A.js");
4127
+ const { discoverSkills } = await import("./skillDiscovery-I3QRA7NE.js");
4122
4128
  let available = [];
4123
4129
  try {
4124
4130
  available = discoverSkills(cwd).map((s) => s.name);
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  isOAuthApiKeyRef
3
- } from "./chunk-YYLHWIW6.js";
3
+ } from "./chunk-THTAR67C.js";
4
4
  import {
5
5
  getModelAbility
6
- } from "./chunk-L3QFIBZG.js";
6
+ } from "./chunk-WTGCTVJG.js";
7
7
  import {
8
8
  isOwnedAgentKey,
9
9
  ownedAgentKey,
@@ -14,7 +14,7 @@ import {
14
14
  platformHostedModels,
15
15
  xaiModels,
16
16
  zaiModels
17
- } from "./chunk-YTA2QOEE.js";
17
+ } from "./chunk-CAENRKNJ.js";
18
18
  import {
19
19
  __export
20
20
  } from "./chunk-4VNS5WPM.js";
@@ -1,107 +1,19 @@
1
1
  import {
2
2
  i18n_default,
3
3
  toolRegistry
4
- } from "./chunk-WMB7GVPN.js";
5
- import {
6
- canonicalizeToolNames
7
- } from "./chunk-ZZ2MH7LE.js";
4
+ } from "./chunk-SWOTB2TX.js";
8
5
  import {
9
6
  isNoloHostedProvider
10
- } from "./chunk-YTA2QOEE.js";
7
+ } from "./chunk-CAENRKNJ.js";
11
8
  import {
12
9
  asTrimmedLowercaseString
13
10
  } from "./chunk-QSJ3HFEF.js";
14
11
  import {
15
12
  isRecord
16
13
  } from "./chunk-KUG52IAP.js";
17
-
18
- // packages/ai/chat/inlineImageUrlsForCustomProvider.ts
19
- var FILE_CONTENT_PATH = "/api/v1/db/file/content/";
20
- var shouldInlineImageUrlsForAgent = (agentConfig) => {
21
- const apiSource = agentConfig?.apiSource?.toLowerCase();
22
- const provider = agentConfig?.provider?.toLowerCase();
23
- const model = agentConfig?.model?.toLowerCase();
24
- if (apiSource === "custom" || provider === "custom") return true;
25
- if (isNoloHostedProvider(provider)) return true;
26
- return provider === "openrouter" && model === "minimax/minimax-m3";
27
- };
28
- var isInlineCandidate = (url) => /^https?:\/\//i.test(url) && url.includes(FILE_CONTENT_PATH);
29
- var bytesToBase64 = (bytes) => {
30
- let binary = "";
31
- for (const byte of bytes) {
32
- binary += String.fromCharCode(byte);
33
- }
34
- return btoa(binary);
35
- };
36
- var defaultFetchImage = async (url) => {
37
- const response = await fetch(url);
38
- if (!response.ok) {
39
- return {
40
- ok: false,
41
- error: `HTTP ${response.status}`
42
- };
43
- }
44
- const bytes = new Uint8Array(await response.arrayBuffer());
45
- return {
46
- ok: true,
47
- mimeType: response.headers.get("content-type") ?? "application/octet-stream",
48
- bytes
49
- };
50
- };
51
- var cloneImagePartWithDataUrl = async (part, fetchImage, isAllowedImageUrl) => {
52
- const url = part?.image_url?.url;
53
- if (typeof url !== "string" || !isInlineCandidate(url) || isAllowedImageUrl && !isAllowedImageUrl(url)) {
54
- return part;
55
- }
56
- const result = await fetchImage(url);
57
- if (!result.ok || !result.bytes) return part;
58
- const mimeType = result.mimeType || "application/octet-stream";
59
- return {
60
- ...part,
61
- image_url: {
62
- ...part.image_url,
63
- url: `data:${mimeType};base64,${bytesToBase64(result.bytes)}`
64
- }
65
- };
66
- };
67
- var inlineImageUrlsForCustomProvider = async (bodyData, options) => {
68
- if (!options.shouldInline) return bodyData;
69
- const body = bodyData;
70
- if (!Array.isArray(body?.messages)) return bodyData;
71
- const fetchImage = options.fetchImage ?? defaultFetchImage;
72
- let changed = false;
73
- const messages = [];
74
- for (const message of body.messages) {
75
- if (!Array.isArray(message?.content)) {
76
- messages.push(message);
77
- continue;
78
- }
79
- const content = await Promise.all(
80
- message.content.map(async (part) => {
81
- if (part?.type !== "image_url") return part;
82
- return cloneImagePartWithDataUrl(
83
- part,
84
- fetchImage,
85
- options.isAllowedImageUrl
86
- );
87
- })
88
- );
89
- let messageChanged = false;
90
- for (let i = 0; i < content.length; i++) {
91
- if (content[i] !== message.content[i]) {
92
- changed = true;
93
- messageChanged = true;
94
- break;
95
- }
96
- }
97
- messages.push(messageChanged ? { ...message, content } : message);
98
- }
99
- if (!changed) return bodyData;
100
- return {
101
- ...body,
102
- messages
103
- };
104
- };
14
+ import {
15
+ canonicalizeToolNames
16
+ } from "./chunk-3AUWC6EM.js";
105
17
 
106
18
  // packages/ai/tools/toolSchemaCompatibility.ts
107
19
  var COMPOSITION_KEYS = ["anyOf", "oneOf", "allOf"];
@@ -266,8 +178,96 @@ var prepareTools = (toolNames, options) => {
266
178
  return prepared.slice();
267
179
  };
268
180
 
181
+ // packages/ai/chat/inlineImageUrlsForCustomProvider.ts
182
+ var FILE_CONTENT_PATH = "/api/v1/db/file/content/";
183
+ var shouldInlineImageUrlsForAgent = (agentConfig) => {
184
+ const apiSource = agentConfig?.apiSource?.toLowerCase();
185
+ const provider = agentConfig?.provider?.toLowerCase();
186
+ const model = agentConfig?.model?.toLowerCase();
187
+ if (apiSource === "custom" || provider === "custom") return true;
188
+ if (isNoloHostedProvider(provider)) return true;
189
+ return provider === "openrouter" && model === "minimax/minimax-m3";
190
+ };
191
+ var isInlineCandidate = (url) => /^https?:\/\//i.test(url) && url.includes(FILE_CONTENT_PATH);
192
+ var bytesToBase64 = (bytes) => {
193
+ let binary = "";
194
+ for (const byte of bytes) {
195
+ binary += String.fromCharCode(byte);
196
+ }
197
+ return btoa(binary);
198
+ };
199
+ var defaultFetchImage = async (url) => {
200
+ const response = await fetch(url);
201
+ if (!response.ok) {
202
+ return {
203
+ ok: false,
204
+ error: `HTTP ${response.status}`
205
+ };
206
+ }
207
+ const bytes = new Uint8Array(await response.arrayBuffer());
208
+ return {
209
+ ok: true,
210
+ mimeType: response.headers.get("content-type") ?? "application/octet-stream",
211
+ bytes
212
+ };
213
+ };
214
+ var cloneImagePartWithDataUrl = async (part, fetchImage, isAllowedImageUrl) => {
215
+ const url = part?.image_url?.url;
216
+ if (typeof url !== "string" || !isInlineCandidate(url) || isAllowedImageUrl && !isAllowedImageUrl(url)) {
217
+ return part;
218
+ }
219
+ const result = await fetchImage(url);
220
+ if (!result.ok || !result.bytes) return part;
221
+ const mimeType = result.mimeType || "application/octet-stream";
222
+ return {
223
+ ...part,
224
+ image_url: {
225
+ ...part.image_url,
226
+ url: `data:${mimeType};base64,${bytesToBase64(result.bytes)}`
227
+ }
228
+ };
229
+ };
230
+ var inlineImageUrlsForCustomProvider = async (bodyData, options) => {
231
+ if (!options.shouldInline) return bodyData;
232
+ const body = bodyData;
233
+ if (!Array.isArray(body?.messages)) return bodyData;
234
+ const fetchImage = options.fetchImage ?? defaultFetchImage;
235
+ let changed = false;
236
+ const messages = [];
237
+ for (const message of body.messages) {
238
+ if (!Array.isArray(message?.content)) {
239
+ messages.push(message);
240
+ continue;
241
+ }
242
+ const content = await Promise.all(
243
+ message.content.map(async (part) => {
244
+ if (part?.type !== "image_url") return part;
245
+ return cloneImagePartWithDataUrl(
246
+ part,
247
+ fetchImage,
248
+ options.isAllowedImageUrl
249
+ );
250
+ })
251
+ );
252
+ let messageChanged = false;
253
+ for (let i = 0; i < content.length; i++) {
254
+ if (content[i] !== message.content[i]) {
255
+ changed = true;
256
+ messageChanged = true;
257
+ break;
258
+ }
259
+ }
260
+ messages.push(messageChanged ? { ...message, content } : message);
261
+ }
262
+ if (!changed) return bodyData;
263
+ return {
264
+ ...body,
265
+ messages
266
+ };
267
+ };
268
+
269
269
  export {
270
+ prepareTools,
270
271
  shouldInlineImageUrlsForAgent,
271
- inlineImageUrlsForCustomProvider,
272
- prepareTools
272
+ inlineImageUrlsForCustomProvider
273
273
  };
@@ -9,7 +9,7 @@ import {
9
9
  platformHostedModels,
10
10
  xaiModels,
11
11
  zaiModels
12
- } from "./chunk-YTA2QOEE.js";
12
+ } from "./chunk-CAENRKNJ.js";
13
13
 
14
14
  // packages/ai/llm/modelAbility.ts
15
15
  var MODEL_ABILITY_TABLE = {
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  getModelConfig
3
- } from "./chunk-GT3GG2H7.js";
3
+ } from "./chunk-VSTUQGLT.js";
4
4
  import {
5
5
  isPlatformHostedClaudeModel,
6
6
  isPlatformHostedGrokModel
7
- } from "./chunk-YTA2QOEE.js";
7
+ } from "./chunk-CAENRKNJ.js";
8
8
  import {
9
9
  asTrimmedLowercaseString
10
10
  } from "./chunk-QSJ3HFEF.js";
11
- import {
12
- asTrimmedString
13
- } from "./chunk-3EUW3WEO.js";
14
11
  import {
15
12
  normalizeServerOrigin
16
13
  } from "./chunk-CF7PE763.js";
14
+ import {
15
+ asTrimmedString
16
+ } from "./chunk-3EUW3WEO.js";
17
17
  import {
18
18
  asOptionalTrimmedString
19
19
  } from "./chunk-G3SUCT4W.js";
@@ -18,21 +18,21 @@ import {
18
18
  import {
19
19
  DEFAULT_NOLO_SERVER_URL
20
20
  } from "./chunk-OLZBQWZU.js";
21
+ import {
22
+ normalizeServerOrigin
23
+ } from "./chunk-CF7PE763.js";
21
24
  import {
22
25
  createMemoryKey,
23
26
  createMemoryOwnerIndexKey,
24
27
  createMemorySubjectKindIndexKey,
25
28
  memoryOwnerRange
26
- } from "./chunk-NRY4GCKJ.js";
27
- import {
28
- asTrimmedNonEmptyStringArray
29
- } from "./chunk-I42VC5KR.js";
29
+ } from "./chunk-WHLVPK32.js";
30
30
  import {
31
31
  asTrimmedString
32
32
  } from "./chunk-3EUW3WEO.js";
33
33
  import {
34
- normalizeServerOrigin
35
- } from "./chunk-CF7PE763.js";
34
+ asTrimmedNonEmptyStringArray
35
+ } from "./chunk-I42VC5KR.js";
36
36
 
37
37
  // packages/cli/authCommands.ts
38
38
  import { createInterface } from "node:readline/promises";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  patch,
3
3
  read
4
- } from "./chunk-G2BZ43DV.js";
4
+ } from "./chunk-A4JDTA5T.js";
5
5
  import {
6
6
  DEVICE_LOCAL_OWNER_ID,
7
7
  isDeviceLocalSpaceBody,
8
8
  selectIdentityUserId
9
- } from "./chunk-XMLRJUU5.js";
9
+ } from "./chunk-ZFTCLBEX.js";
10
10
 
11
11
  // packages/create/space/spaceKeys.ts
12
12
  var SEPARATOR = "-";
@@ -165,8 +165,8 @@ var addContentAction = async (input, thunkAPI) => {
165
165
  export {
166
166
  normalizeSpaceId,
167
167
  createSpaceKey,
168
+ UNCATEGORIZED_ID,
168
169
  checkSpaceMembership,
169
170
  localSpaceAuthorityPatchStamp,
170
- UNCATEGORIZED_ID,
171
171
  addContentAction
172
172
  };
@@ -1,12 +1,9 @@
1
- import {
2
- getPublicImageAgentDefaultProfile
3
- } from "./chunk-VIDPVFP3.js";
4
1
  import {
5
2
  getApproxPricePerImage
6
3
  } from "./chunk-CWMSB67P.js";
7
4
  import {
8
5
  getModelConfig
9
- } from "./chunk-GT3GG2H7.js";
6
+ } from "./chunk-VSTUQGLT.js";
10
7
  import {
11
8
  asOptionalFiniteNumber
12
9
  } from "./chunk-WWC7I6TA.js";
@@ -14,6 +11,22 @@ import {
14
11
  asOptionalPositiveFiniteNumber
15
12
  } from "./chunk-U6VC4MU4.js";
16
13
 
14
+ // packages/ai/agent/utils/publicImageAgentMode.ts
15
+ var getPublicImageAgentMode = (agent) => {
16
+ if (!agent) return null;
17
+ if (agent.imageWorkflow) return agent.imageWorkflow;
18
+ return null;
19
+ };
20
+ var getPublicImageAgentDefaultProfile = (mode) => {
21
+ if (mode === "generate") {
22
+ return { quality: "medium", size: "1024x1024", outputFormat: "png" };
23
+ }
24
+ if (mode === "edit") {
25
+ return { quality: "medium", size: "auto", outputFormat: "png" };
26
+ }
27
+ return { quality: "low", size: "auto", outputFormat: "png" };
28
+ };
29
+
17
30
  // packages/ai/llm/getPricing.ts
18
31
  var MAX_OUTPUT_TOKENS = 8192;
19
32
  var getModelPricing = (provider, modelName, _requestedServiceTier) => {
@@ -136,6 +149,8 @@ var formatCompactTurnPrice = (amount) => {
136
149
  };
137
150
 
138
151
  export {
152
+ getPublicImageAgentMode,
153
+ getPublicImageAgentDefaultProfile,
139
154
  getModelPricing,
140
155
  getModelPricingForModel,
141
156
  hasExplicitAgentPricing,
@@ -17,11 +17,10 @@ import {
17
17
  compileCodingEffectiveTools,
18
18
  resolveCodingBuiltinSlug,
19
19
  resolveCodingEffectiveTools
20
- } from "./chunk-7H3UTGPM.js";
20
+ } from "./chunk-3AUWC6EM.js";
21
21
  import "./chunk-CF7S2RYZ.js";
22
22
  import "./chunk-ZWJOGMKH.js";
23
23
  import "./chunk-WZSRQNQG.js";
24
- import "./chunk-ZZ2MH7LE.js";
25
24
  import "./chunk-UZ6XXCVR.js";
26
25
  import "./chunk-I42VC5KR.js";
27
26
  import "./chunk-G3SUCT4W.js";
@@ -1,59 +1,52 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-UFL6WHHJ.js";
4
- import "./chunk-XOIF2TNF.js";
5
- import "./chunk-MRC4Q34M.js";
6
- import "./chunk-SIZQB7BD.js";
7
- import "./chunk-RJBTU7AS.js";
8
- import "./chunk-YYLHWIW6.js";
9
- import "./chunk-CWMSB67P.js";
10
- import "./chunk-IC7W63RM.js";
3
+ } from "./chunk-THTAR67C.js";
4
+ import "./chunk-OB6FBSH3.js";
5
+ import "./chunk-IZ3CBMD5.js";
6
+ import "./chunk-GAGUBI42.js";
7
+ import "./chunk-JZPBVBIY.js";
11
8
  import "./chunk-5RGU3J7P.js";
12
9
  import "./chunk-M76ECQRD.js";
13
- import "./chunk-L65QKSVJ.js";
14
- import "./chunk-HYSJHRWD.js";
15
- import "./chunk-5MMAK75Q.js";
16
- import "./chunk-5CS33IBL.js";
17
- import "./chunk-JZPBVBIY.js";
18
- import "./chunk-GT3GG2H7.js";
19
- import "./chunk-ZHXJ6M7T.js";
20
- import "./chunk-3ASDTTEI.js";
21
- import "./chunk-DWLEOOGR.js";
22
10
  import "./chunk-HNMXYYJR.js";
23
- import "./chunk-L3QFIBZG.js";
24
- import "./chunk-YTA2QOEE.js";
25
- import "./chunk-R7LOFGRE.js";
26
- import "./chunk-Y5GCAMGP.js";
27
- import "./chunk-UZ6XXCVR.js";
11
+ import "./chunk-DWLEOOGR.js";
12
+ import "./chunk-3ASDTTEI.js";
13
+ import "./chunk-YLADSPDU.js";
14
+ import "./chunk-WTGCTVJG.js";
15
+ import "./chunk-CWMSB67P.js";
16
+ import "./chunk-VSTUQGLT.js";
17
+ import "./chunk-ZHXJ6M7T.js";
18
+ import "./chunk-CAENRKNJ.js";
19
+ import "./chunk-446VANPP.js";
28
20
  import "./chunk-KX6YBIHG.js";
29
- import "./chunk-JSB4N6NU.js";
30
21
  import {
31
22
  write
32
- } from "./chunk-G2BZ43DV.js";
23
+ } from "./chunk-A4JDTA5T.js";
24
+ import "./chunk-BOL2D2JW.js";
25
+ import "./chunk-QSJ3HFEF.js";
26
+ import "./chunk-DWQNDGO7.js";
27
+ import "./chunk-TOW4E763.js";
28
+ import {
29
+ selectIdentityUserId
30
+ } from "./chunk-ZFTCLBEX.js";
31
+ import "./chunk-R5V5G73M.js";
32
+ import "./chunk-LCBAMY2M.js";
33
+ import "./chunk-4SN6J65J.js";
34
+ import "./chunk-CF7PE763.js";
35
+ import "./chunk-L3GCUVOH.js";
33
36
  import {
34
37
  buildAgentAutomationOwnerIndexValue,
35
38
  createAgentAutomationKey,
36
39
  createAgentAutomationOwnerIndexKey
37
- } from "./chunk-NRY4GCKJ.js";
40
+ } from "./chunk-WHLVPK32.js";
38
41
  import "./chunk-WWC7I6TA.js";
39
- import "./chunk-SKDNBYZK.js";
40
- import "./chunk-I42VC5KR.js";
41
- import "./chunk-QSJ3HFEF.js";
42
- import "./chunk-L6RBX4L4.js";
43
- import {
44
- selectIdentityUserId
45
- } from "./chunk-XMLRJUU5.js";
46
- import "./chunk-R5V5G73M.js";
47
42
  import "./chunk-GBRG75BQ.js";
48
43
  import {
49
44
  asTrimmedString
50
45
  } from "./chunk-3EUW3WEO.js";
51
46
  import "./chunk-U6VC4MU4.js";
52
- import "./chunk-TOW4E763.js";
53
47
  import "./chunk-KUG52IAP.js";
54
- import "./chunk-LCBAMY2M.js";
55
- import "./chunk-4SN6J65J.js";
56
- import "./chunk-CF7PE763.js";
48
+ import "./chunk-UZ6XXCVR.js";
49
+ import "./chunk-I42VC5KR.js";
57
50
  import {
58
51
  asOptionalTrimmedString
59
52
  } from "./chunk-G3SUCT4W.js";