nolo-cli 0.29.1 → 0.30.0-alpha.1

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 (138) hide show
  1. package/{_executeModel-TN7FW73L.js → _executeModel-VBHHG7LT.js} +62 -68
  2. package/{action-6BM26ZYM.js → action-FENWPT3C.js} +14 -15
  3. package/{addContentAction-HLTFX56O.js → addContentAction-Z5S5ZQ7I.js} +12 -12
  4. package/{addDialogAgentAction-Q2TYWDO6.js → addDialogAgentAction-VUNVD2XR.js} +11 -11
  5. package/{agentDeleteCommand-VP4VLCMG.js → agentDeleteCommand-LLGZXUYJ.js} +60 -39
  6. package/{agentEmailCommands-N32KWVCX.js → agentEmailCommands-LC2FPN6G.js} +76 -81
  7. package/{agentGrantCommands-JNDE4RWR.js → agentGrantCommands-E7ZZFRHK.js} +2 -1
  8. package/{agentListCommands-MXITEBUS.js → agentListCommands-A6OBQ3QX.js} +57 -40
  9. package/{agentMachineCommands-47Y2XEZZ.js → agentMachineCommands-4O4Q5B5X.js} +53 -35
  10. package/{agentPullCommand-ZZGU5KOY.js → agentPullCommand-4V36XNGV.js} +4 -3
  11. package/{agentRecordCommands-AK6ZRJLD.js → agentRecordCommands-W22RIQRV.js} +73 -78
  12. package/{agentRunCommand-24SNVDNC.js → agentRunCommand-V4OBU4FB.js} +77 -82
  13. package/{agentRunControl-SNUKXN6J.js → agentRunControl-AKBN2366.js} +13 -1
  14. package/{agentRuntimeLocal-VI3NHLDU.js → agentRuntimeLocal-I57YSGH4.js} +52 -34
  15. package/{agentSlice-D666DABC.js → agentSlice-3ZHY7RAO.js} +12 -13
  16. package/{appDeleteCommands-SF2V6QYZ.js → appDeleteCommands-DJJF466K.js} +53 -35
  17. package/{appDeployCommands-3EPVR545.js → appDeployCommands-WJZGIOEZ.js} +53 -35
  18. package/{appDeployStatusCommands-O65Y747J.js → appDeployStatusCommands-ICYXUJNO.js} +53 -35
  19. package/{appGetCommands-AHDOF4SS.js → appGetCommands-UOCWYJPV.js} +53 -35
  20. package/{appListCommands-Y7YCXODU.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-SNMJPH7J.js → chunk-2XM5KUNE.js} +4 -2
  24. package/{chunk-7H3UTGPM.js → chunk-3AUWC6EM.js} +82 -3
  25. package/{chunk-FVY6KI5A.js → chunk-3RIWR23B.js} +1 -1
  26. package/{chunk-ENUJPSZN.js → chunk-446VANPP.js} +18 -14
  27. package/{chunk-PB7G5MAM.js → chunk-44HACRCK.js} +4 -4
  28. package/{chunk-RZNYL4LW.js → chunk-4SAV7BD7.js} +65 -1
  29. package/{chunk-I5TJCJQP.js → chunk-56IUA7RU.js} +3 -3
  30. package/{chunk-STOUEEBU.js → chunk-66O5MZYH.js} +1 -1
  31. package/{chunk-PSK2RUHV.js → chunk-7CD24PU4.js} +360 -2
  32. package/{chunk-JYSXE6LE.js → chunk-A4JDTA5T.js} +13 -13
  33. package/{chunk-DZ3XJVET.js → chunk-AOS5IN2I.js} +1 -1
  34. package/{chunk-SKDNBYZK.js → chunk-BOL2D2JW.js} +1 -1
  35. package/{chunk-YTA2QOEE.js → chunk-CAENRKNJ.js} +15 -0
  36. package/{chunk-2TYLTEAH.js → chunk-CV6I4HBA.js} +1 -1
  37. package/chunk-DCDL3GC4.js +171 -0
  38. package/{chunk-WNENLKKI.js → chunk-DCWBP2O7.js} +42 -393
  39. package/{chunk-Y52E3TIS.js → chunk-DI6MXJK5.js} +37 -37
  40. package/{chunk-Z3LLUGD5.js → chunk-DKRT67FG.js} +11 -11
  41. package/{chunk-NWT2WUCY.js → chunk-DWQNDGO7.js} +20 -8
  42. package/{chunk-BPZSJH5X.js → chunk-FS5TTXPS.js} +6 -6
  43. package/chunk-G5JHHUAK.js +73 -0
  44. package/{chunk-GFVFYNL7.js → chunk-G6VITLCZ.js} +3 -3
  45. package/{chunk-MUI34IA2.js → chunk-GAGUBI42.js} +302 -14
  46. package/{chunk-YBHJZVWO.js → chunk-GVKTKT3O.js} +15 -8
  47. package/{chunk-GVYU3EVI.js → chunk-HI7QZNWX.js} +17 -10
  48. package/{chunk-MHHYH3JA.js → chunk-HLG6GAUD.js} +1 -1
  49. package/{chunk-MQRZ5QUH.js → chunk-IXZX5CJK.js} +1 -1
  50. package/{chunk-INWBJPQC.js → chunk-IZ3CBMD5.js} +3 -3
  51. package/{chunk-VHBWHNVT.js → chunk-K6QEHQZ3.js} +8 -4
  52. package/chunk-KW47OSRJ.js +3246 -0
  53. package/{chunk-F7S2SH5C.js → chunk-KWKD3BCC.js} +189 -122
  54. package/{chunk-L65QKSVJ.js → chunk-L3GCUVOH.js} +1 -1
  55. package/{chunk-XISENOC2.js → chunk-L3VQOVKK.js} +8 -8
  56. package/{chunk-HALKDXKP.js → chunk-MEUZFIAJ.js} +8 -4
  57. package/{chunk-XMAMUPXU.js → chunk-MMCVBEAD.js} +174 -149
  58. package/{chunk-XOIF2TNF.js → chunk-OB6FBSH3.js} +13 -0
  59. package/chunk-OYK7PA5U.js +1707 -0
  60. package/{chunk-WPRSBZYN.js → chunk-Q24P6TUS.js} +1 -1
  61. package/{chunk-7CP4UOUV.js → chunk-QLV2GKU5.js} +16 -178
  62. package/{chunk-2AX4ZWSG.js → chunk-SWOTB2TX.js} +135 -1166
  63. package/{chunk-BOPFLKHA.js → chunk-SWYMCHM7.js} +1 -69
  64. package/{chunk-YRMUYZ5H.js → chunk-SZ5CBYMZ.js} +4 -4
  65. package/chunk-T27IEBNQ.js +149 -0
  66. package/{chunk-WX3ZOSTL.js → chunk-T3Y5EMJS.js} +24 -26
  67. package/{chunk-RD6AOXQI.js → chunk-THTAR67C.js} +1056 -137
  68. package/{chunk-2FX23RGA.js → chunk-TJYWZ3LO.js} +4 -4
  69. package/{chunk-SLOGKB7M.js → chunk-TOW4E763.js} +9 -1
  70. package/{chunk-33K2M3AU.js → chunk-UKC5HU2C.js} +33 -40
  71. package/{chunk-STRCGEC6.js → chunk-UTQZ73QQ.js} +13 -9
  72. package/{chunk-GT3GG2H7.js → chunk-VSTUQGLT.js} +1 -1
  73. package/{chunk-4MCHUZUI.js → chunk-W2YKDXT7.js} +95 -95
  74. package/{chunk-L3QFIBZG.js → chunk-WTGCTVJG.js} +1 -1
  75. package/{chunk-XS7UPVR7.js → chunk-XD5NQEOH.js} +5 -5
  76. package/{chunk-WSQLK2KR.js → chunk-XFGM5PJP.js} +6 -6
  77. package/{chunk-DBUNOYLF.js → chunk-YLADSPDU.js} +3 -3
  78. package/{chunk-FRN5QOKN.js → chunk-YWGSCF37.js} +19 -4
  79. package/{codingSkills-EN6Z6G6U.js → codingSkills-V35TRR4Y.js} +1 -2
  80. package/{createAgentAutomationAction-VK3N263U.js → createAgentAutomationAction-3GMH6ORX.js} +30 -37
  81. package/{createDialogAction-KWZ74S2G.js → createDialogAction-R5MCL4RE.js} +32 -38
  82. package/{createPageAction-3CIZL5ZL.js → createPageAction-QYTG656R.js} +43 -50
  83. package/{db-W5UHK4P3.js → db-IPCJ43PW.js} +10 -6
  84. package/{dbSlice-GOKRGQ47.js → dbSlice-OBV7VFCF.js} +11 -11
  85. package/{deleteFile-WDZ3VM7B.js → deleteFile-AC45HYSM.js} +5 -5
  86. package/{dialogCommands-N4XKI6ZU.js → dialogCommands-NUQGIXVZ.js} +53 -37
  87. package/{dialogSlice-TKYB6VLO.js → dialogSlice-CFDECXEU.js} +27 -34
  88. package/{docCreateCommands-DTDKANXX.js → docCreateCommands-UNFCXB5N.js} +52 -36
  89. package/{docDeleteCommands-U4NB6OHK.js → docDeleteCommands-NG5IVKE5.js} +54 -38
  90. package/{docReadCommands-SDVQM3BH.js → docReadCommands-6J7MUUX6.js} +52 -36
  91. package/{docStore-E5QAM75M.js → docStore-MZZWJM4F.js} +28 -35
  92. package/{docUpdateCommands-O2O644FV.js → docUpdateCommands-6AW3VZOX.js} +55 -39
  93. package/{fetchMessages-W4IKHPCS.js → fetchMessages-VPPQDDZ4.js} +3 -3
  94. package/{getPricing-X6I23RN6.js → getPricing-XQYSSVV6.js} +6 -7
  95. package/{handleSendMessageAction-7OVC2SVU.js → handleSendMessageAction-IU2QNTLM.js} +30 -37
  96. package/index.js +72 -72
  97. package/localDialogRead-P72W2U2R.js +38 -0
  98. package/{machineCommands-6GNFKAVC.js → machineCommands-Z2QEWTHZ.js} +76 -81
  99. package/{machineWsRunDispatch-2DCHVG3U.js → machineWsRunDispatch-SJTYHZHN.js} +71 -76
  100. package/{models-YT32CTT5.js → models-WDUTTYFS.js} +2 -2
  101. package/{offlineMarxistsAgentCommand-5OOWZLJI.js → offlineMarxistsAgentCommand-E6LUG63A.js} +6 -2
  102. package/package.json +1 -1
  103. package/{read-A23NKT3O.js → read-QK7ZRX6G.js} +6 -6
  104. package/{readDocTool-JAM5BI5Q.js → readDocTool-EYDMVRBL.js} +2 -1
  105. package/{readlineWorkspace-KELDMUNZ.js → readlineWorkspace-EY3BPXIU.js} +151 -163
  106. package/{removeDialogAgentAction-K4HOWFHO.js → removeDialogAgentAction-TBW3UZJW.js} +15 -16
  107. package/{runAgentClientLoop-R3S7YN6Z.js → runAgentClientLoop-N3YDLTMS.js} +61 -66
  108. package/{setDialogExtraReferencesAction-JD7J7JM4.js → setDialogExtraReferencesAction-Q3ANF2NR.js} +12 -12
  109. package/{setPrimaryDialogAgentAction-YWSA5XEU.js → setPrimaryDialogAgentAction-FQ5R3EFJ.js} +15 -16
  110. package/{settingSlice-22GTX6CA.js → settingSlice-JKKV2T7O.js} +13 -14
  111. package/{skillDiscovery-ITA7BI7A.js → skillDiscovery-I3QRA7NE.js} +2 -2
  112. package/{spaceCommands-WM6W3WMQ.js → spaceCommands-R6AEQNLG.js} +57 -40
  113. package/{spaceSlice-RC2APBOD.js → spaceSlice-MCH7RLLP.js} +27 -34
  114. package/{streamAgentChatTurn-Q655CCVP.js → streamAgentChatTurn-Q4U2CVMI.js} +130 -1300
  115. package/{switchDialogAgentAction-6JKFBJVR.js → switchDialogAgentAction-QQGVE4SL.js} +11 -11
  116. package/{toolApiClient-ISM4ZQX4.js → toolApiClient-ARGFDJAG.js} +3 -3
  117. package/{tools-A6MUIA3Q.js → tools-Y3UBLLYW.js} +50 -56
  118. package/{tuiSummaryLlmCaller-GCUPULOV.js → tuiSummaryLlmCaller-4474IBTI.js} +12 -12
  119. package/{updateDialogTitleAction-DQYY564Y.js → updateDialogTitleAction-3J7GH67I.js} +35 -43
  120. package/chunk-3LJ4RSSF.js +0 -231
  121. package/chunk-5CS33IBL.js +0 -301
  122. package/chunk-5MMAK75Q.js +0 -15
  123. package/chunk-MRC4Q34M.js +0 -188
  124. package/chunk-P6TB7JIA.js +0 -1791
  125. package/chunk-PFTK5SEB.js +0 -620
  126. package/chunk-PMSG3OGF.js +0 -669
  127. package/chunk-SIZQB7BD.js +0 -91
  128. package/chunk-VIDPVFP3.js +0 -20
  129. package/chunk-Y5GCAMGP.js +0 -9
  130. package/chunk-YYLHWIW6.js +0 -48
  131. package/chunk-ZZ2MH7LE.js +0 -84
  132. package/localDialogRead-JXTAHW2E.js +0 -26
  133. package/{chunk-ZVZMT3EA.js → chunk-KWCLUYGQ.js} +3 -3
  134. package/{chunk-NRY4GCKJ.js → chunk-WHLVPK32.js} +3 -3
  135. package/{chunk-RQSOAMPJ.js → chunk-Z5MXSEOJ.js} +2 -2
  136. package/{chunk-XMLRJUU5.js → chunk-ZFTCLBEX.js} +9 -9
  137. package/{runtimeDoctorCommands-HSU632DY.js → runtimeDoctorCommands-E2OUORHK.js} +3 -3
  138. 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";
@@ -25,9 +25,17 @@ var extractCustomId = (key) => {
25
25
  };
26
26
  var PUBLIC_AGENT_KEY_PREFIX = "agent-pub-";
27
27
  var publicAgentKey = (id) => `${PUBLIC_AGENT_KEY_PREFIX}${id}`;
28
+ var ownedAgentKeyPrefix = (userId) => `agent-${userId}-`;
29
+ var ownedAgentKey = (userId, id) => id.startsWith(ownedAgentKeyPrefix(userId)) ? id : `${ownedAgentKeyPrefix(userId)}${id}`;
30
+ var isOwnedAgentKey = (key, userId) => typeof key === "string" && key.startsWith(ownedAgentKeyPrefix(userId));
31
+ var parseOwnedAgentId = (key, userId) => isOwnedAgentKey(key, userId) ? key.slice(ownedAgentKeyPrefix(userId).length) || null : null;
28
32
 
29
33
  export {
30
34
  extractUserId,
31
35
  extractCustomId,
32
- publicAgentKey
36
+ PUBLIC_AGENT_KEY_PREFIX,
37
+ publicAgentKey,
38
+ ownedAgentKey,
39
+ isOwnedAgentKey,
40
+ parseOwnedAgentId
33
41
  };
@@ -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-P6TB7JIA.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-PFTK5SEB.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 = {
@@ -446,17 +450,6 @@ public class NoloCredNative {
446
450
  }
447
451
  `.trim();
448
452
 
449
- // packages/agent-runtime/agentRecordKeys.ts
450
- function buildAgentRuntimeAgentLookupKeys(args) {
451
- if (/^agent(-pub)?-/.test(args.agentRef)) {
452
- return [args.agentRef];
453
- }
454
- return [`agent-${args.userId}-${args.agentRef}`, `agent-pub-${args.agentRef}`];
455
- }
456
- function shouldFetchAgentRuntimeRecordRemotely(dbKey) {
457
- return /^agent(-pub)?-/.test(dbKey);
458
- }
459
-
460
453
  // packages/agent-runtime/dialogMessageRecord.ts
461
454
  function dialogMessageRecordToAgentRuntimeMessage(record) {
462
455
  if (!record || typeof record !== "object") return null;
@@ -1134,6 +1127,7 @@ function resolveLocalToolPolicy(args) {
1134
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.`
1135
1128
  };
1136
1129
  }
1130
+ var ABORT_AWARE_LOCAL_TOOLS = /* @__PURE__ */ new Set(["execShell", "controlAgentRun"]);
1137
1131
  async function executeLocalToolWithPolicy(args) {
1138
1132
  const decision = resolveLocalToolPolicy({
1139
1133
  env: args.env,
@@ -1145,7 +1139,7 @@ async function executeLocalToolWithPolicy(args) {
1145
1139
  if (!executor) {
1146
1140
  throw new Error(`${decision.toolName} is allowed by policy but no local executor is registered.`);
1147
1141
  }
1148
- 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, {
1149
1143
  abortSignal: args.abortSignal,
1150
1144
  detachMs: args.detachMs
1151
1145
  }) : executor;
@@ -2560,8 +2554,8 @@ function convertEol(text, eol) {
2560
2554
  function pluralizeReplacement(count) {
2561
2555
  return count === 1 ? "replacement" : "replacements";
2562
2556
  }
2563
- var EDIT_SNIPPET_MAX_LINES = 5;
2564
- var EDIT_SNIPPET_WIDTH = 96;
2557
+ var EDIT_SNIPPET_MAX_LINES = 24;
2558
+ var EDIT_SNIPPET_WIDTH = 160;
2565
2559
  function clipEditSnippet(text) {
2566
2560
  const lines = text.split(/\r?\n/).filter((line) => line.length > 0);
2567
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");
@@ -3250,6 +3244,7 @@ async function writeFileTool(args) {
3250
3244
  metadata: {
3251
3245
  path: relativePath,
3252
3246
  bytes: Buffer.byteLength(content),
3247
+ totalLines: content.length === 0 ? 0 : content.split(/\r?\n/).length,
3253
3248
  ...diffStat ? { diffStat } : {},
3254
3249
  ...activity ? { activity } : {}
3255
3250
  }
@@ -4091,10 +4086,10 @@ function buildLoadSkillExecutor(args) {
4091
4086
  metadata: { loadSkill: true, resolved: false }
4092
4087
  };
4093
4088
  }
4094
- const { resolveSkillByName } = await import("./skillDiscovery-ITA7BI7A.js");
4089
+ const { resolveSkillByName } = await import("./skillDiscovery-I3QRA7NE.js");
4095
4090
  const resolved = resolveSkillByName(args.cwd, name);
4096
4091
  if (!resolved) {
4097
- const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-EN6Z6G6U.js");
4092
+ const { resolveCodingBuiltinSlug, buildCodingSkillContentBySlug } = await import("./codingSkills-V35TRR4Y.js");
4098
4093
  const builtinSlug = resolveCodingBuiltinSlug(name);
4099
4094
  if (builtinSlug) {
4100
4095
  const body = buildCodingSkillContentBySlug(builtinSlug);
@@ -4129,7 +4124,7 @@ ${body}`,
4129
4124
  };
4130
4125
  }
4131
4126
  async function formatUnknownSkillMessage(cwd, requestedName) {
4132
- const { discoverSkills } = await import("./skillDiscovery-ITA7BI7A.js");
4127
+ const { discoverSkills } = await import("./skillDiscovery-I3QRA7NE.js");
4133
4128
  let available = [];
4134
4129
  try {
4135
4130
  available = discoverSkills(cwd).map((s) => s.name);
@@ -4154,8 +4149,6 @@ export {
4154
4149
  readOpenAiCompatibleSseCompletion,
4155
4150
  executeOpenAiCompatibleChatCompletion,
4156
4151
  resolveOpenAiCompatibleProviderConfig,
4157
- buildAgentRuntimeAgentLookupKeys,
4158
- shouldFetchAgentRuntimeRecordRemotely,
4159
4152
  dialogMessageRecordToAgentRuntimeMessage,
4160
4153
  buildAgentRuntimeDialogWritePlan,
4161
4154
  shouldCacheHybridRemoteRecord,
@@ -1,9 +1,14 @@
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
+ import {
8
+ isOwnedAgentKey,
9
+ ownedAgentKey,
10
+ publicAgentKey
11
+ } from "./chunk-TOW4E763.js";
7
12
 
8
13
  // packages/ai/agent/safeAgentSummary.ts
9
14
  function parseTimestamp(val) {
@@ -49,9 +54,9 @@ function resolveFavoriteStatus(record, options) {
49
54
  if (typeof record?.publicKey === "string" && record.publicKey) candidateKeys.push(record.publicKey);
50
55
  if (typeof record?.id === "string" && record.id) {
51
56
  candidateKeys.push(record.id);
52
- candidateKeys.push(`agent-pub-${record.id}`);
57
+ candidateKeys.push(publicAgentKey(record.id));
53
58
  if (options?.userId) {
54
- candidateKeys.push(`agent-${options.userId}-${record.id}`);
59
+ candidateKeys.push(ownedAgentKey(options.userId, record.id));
55
60
  }
56
61
  }
57
62
  let matched = false;
@@ -90,7 +95,7 @@ function toSafeAgentSummary(record, options) {
90
95
  if (typeof record?.publicKey === "string" && record.publicKey && !publicRecordDenied) {
91
96
  publicKey = record.publicKey;
92
97
  } else if (publicRecordConfirmed && id) {
93
- publicKey = `agent-pub-${id}`;
98
+ publicKey = publicAgentKey(id);
94
99
  }
95
100
  const name = typeof record?.name === "string" && record.name ? record.name : "(unnamed)";
96
101
  const handle = typeof record?.handle === "string" && record.handle ? record.handle : null;
@@ -109,16 +114,15 @@ function toSafeAgentSummary(record, options) {
109
114
  const nextAvailableAt = typeof record?.nextAvailableAt === "number" && Number.isFinite(record.nextAvailableAt) ? record.nextAvailableAt : void 0;
110
115
  const currentUserId = options?.userId;
111
116
  const isOwnedByRecord = Boolean(currentUserId) && (typeof record?.userId === "string" && record.userId === currentUserId || typeof record?.ownerId === "string" && record.ownerId === currentUserId);
112
- const ownKeyPrefix = currentUserId ? `agent-${currentUserId}-` : "";
113
- const ownedKey = ownKeyPrefix ? [record?.dbKey, record?.privateKey].find(
114
- (key) => typeof key === "string" && key.startsWith(ownKeyPrefix)
117
+ const ownedKey = currentUserId ? [record?.dbKey, record?.privateKey].find(
118
+ (key) => isOwnedAgentKey(key, currentUserId)
115
119
  ) : void 0;
116
120
  const isOwned = isOwnedByRecord || Boolean(ownedKey);
117
121
  const isOAuth = isOAuthApiKeyRef(record?.apiKeyRef);
118
122
  let agentKey;
119
123
  if (currentUserId) {
120
124
  if (isOwned) {
121
- agentKey = ownedKey ?? (id ? id.startsWith(ownKeyPrefix) ? id : `${ownKeyPrefix}${id}` : void 0);
125
+ agentKey = ownedKey ?? (id ? ownedAgentKey(currentUserId, id) : void 0);
122
126
  } else if (publicKey) {
123
127
  agentKey = publicKey;
124
128
  }
@@ -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-2AX4ZWSG.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-JYSXE6LE.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";