nolo-cli 0.14.0-alpha.7 → 0.14.0-alpha.9

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 (71) hide show
  1. package/{_executeModel-RFT5SF7K.js → _executeModel-OQ6KPFSB.js} +13 -13
  2. package/{agentDeleteCommand-AZDVM4HQ.js → agentDeleteCommand-UBXH2FDO.js} +9 -9
  3. package/{agentEmailCommands-QEDVGC4R.js → agentEmailCommands-ZI2FIUBV.js} +18 -18
  4. package/{agentGrantCommands-B4MB23VQ.js → agentGrantCommands-JMTM6U4B.js} +1 -1
  5. package/{agentListCommands-OJLOXSKL.js → agentListCommands-7M6FHCSH.js} +10 -10
  6. package/{agentMachineCommands-TU6R63NY.js → agentMachineCommands-R3FW62QH.js} +9 -9
  7. package/{agentPullCommand-KRBRIFIY.js → agentPullCommand-UXANSFU3.js} +1 -1
  8. package/{agentRecordCommands-HU7Z6AIF.js → agentRecordCommands-WUY3C3HZ.js} +18 -18
  9. package/{agentRunCommand-OV5KJJEJ.js → agentRunCommand-CWXYVYPZ.js} +18 -18
  10. package/{agentRunControl-IX4F5W2C.js → agentRunControl-6ADXVYMR.js} +2 -2
  11. package/{agentRuntimeLocal-DSUBT77I.js → agentRuntimeLocal-BONMVACL.js} +5 -5
  12. package/{agentSlice-AZJM7JEU.js → agentSlice-IHOSTSWC.js} +1 -1
  13. package/{authCommand-66ME4KZX.js → authCommand-IKIU4FZY.js} +2 -2
  14. package/{authCommands-GH5T6RYV.js → authCommands-QP43ADV3.js} +2 -2
  15. package/{chunk-VQFY3VXW.js → chunk-2ROIXEDX.js} +2 -1
  16. package/{chunk-PB2DHBEQ.js → chunk-3AE4NQ5O.js} +1 -1
  17. package/{chunk-FUMEXHAF.js → chunk-7VKJDLPO.js} +1 -1
  18. package/{chunk-5NBHQD4D.js → chunk-A7GB5UGH.js} +1 -1
  19. package/{chunk-TQCONXQ3.js → chunk-CDQ2ICPR.js} +1 -1
  20. package/{chunk-RZALKBP4.js → chunk-CXLGUR7M.js} +2 -2
  21. package/{chunk-TLNEQI2R.js → chunk-CY4TAX6S.js} +2 -2
  22. package/{chunk-FTSTPJ5H.js → chunk-DUE6E46E.js} +6 -6
  23. package/{chunk-VWQGVOXQ.js → chunk-FVGJNXPJ.js} +18 -14
  24. package/{chunk-OJTVDHOJ.js → chunk-GGHFCK3X.js} +85 -35
  25. package/{chunk-OHEKYYJF.js → chunk-HBRZXXP5.js} +1 -1
  26. package/{chunk-UW3WOIWJ.js → chunk-JHFMRUGX.js} +1 -1
  27. package/{chunk-7JJCGV7N.js → chunk-K6EUAOW3.js} +1 -1
  28. package/{chunk-3TNFSPK4.js → chunk-KUDUXBNE.js} +8 -8
  29. package/{chunk-CGN3RCBB.js → chunk-MEXNTURY.js} +1 -1
  30. package/{chunk-4ON5AV72.js → chunk-MYMMNKYL.js} +1 -1
  31. package/{chunk-J4ZTWTKV.js → chunk-NFHGY5T5.js} +3 -3
  32. package/{chunk-ABUSYXKS.js → chunk-NSZB7BYV.js} +3 -3
  33. package/{chunk-2H5WLDK5.js → chunk-P6DRYHVM.js} +10 -8
  34. package/{chunk-OIMX7MM4.js → chunk-QLO2G5HP.js} +1 -1
  35. package/{chunk-YJAWJCEI.js → chunk-QNXEDF7V.js} +2 -2
  36. package/{chunk-KTFJUPDW.js → chunk-SRKNB2WB.js} +31 -31
  37. package/{chunk-ZVNP5V7L.js → chunk-SW3Q2OV5.js} +11 -10
  38. package/{chunk-33K5FKRL.js → chunk-SZ7RUWAQ.js} +17 -5
  39. package/{chunk-XIDYAII4.js → chunk-U4J6ZZFY.js} +2 -2
  40. package/{chunk-KI6SJNRP.js → chunk-UONU6Q4P.js} +1 -1
  41. package/{chunk-G5HNXQBU.js → chunk-YDOTMXTK.js} +4 -4
  42. package/{chunk-5R73BS7Y.js → chunk-YG3CCS7C.js} +2 -2
  43. package/{chunk-4UUJFFMK.js → chunk-YQAG2J2T.js} +1 -1
  44. package/{cliEnvHelpers-VYC2OPTB.js → cliEnvHelpers-ZXNMX7VV.js} +1 -1
  45. package/{createAgentAutomationAction-G6CHUK2D.js → createAgentAutomationAction-W4OZQ63I.js} +2 -2
  46. package/{createDialogAction-2WHKUKWV.js → createDialogAction-G6XQLPAN.js} +3 -3
  47. package/{createPageAction-C2LKKOBJ.js → createPageAction-RNT4LCAX.js} +2 -2
  48. package/{dialogCommands-BQDGLVMO.js → dialogCommands-YUTOCICO.js} +10 -10
  49. package/{dialogSlice-LZU5QKIN.js → dialogSlice-QZZF4JXD.js} +2 -2
  50. package/{docCreateCommands-K2MPMXYF.js → docCreateCommands-LQYOVE7D.js} +9 -9
  51. package/{docDeleteCommands-NBAARB77.js → docDeleteCommands-LNS5V76K.js} +10 -10
  52. package/{docReadCommands-S3MO5RPS.js → docReadCommands-IRCP66BG.js} +9 -9
  53. package/{docStore-QD57XJ4K.js → docStore-66Q4JTTG.js} +3 -3
  54. package/{docUpdateCommands-EHEI7FCE.js → docUpdateCommands-4VUX3Q7W.js} +9 -9
  55. package/{handleSendMessageAction-5OHXNVMH.js → handleSendMessageAction-CB5UKK2X.js} +2 -2
  56. package/index.js +77 -77
  57. package/{machineCommands-CXMIAUIS.js → machineCommands-PX2BADIB.js} +17 -17
  58. package/{machineWsRunDispatch-MYFROKK2.js → machineWsRunDispatch-IBNCRCEQ.js} +17 -17
  59. package/{memoryCommands-AFMES3LN.js → memoryCommands-EBMICQR6.js} +1 -1
  60. package/package.json +1 -1
  61. package/{readlineWorkspace-NBVFYLFX.js → readlineWorkspace-YIXJ2OOO.js} +32 -30
  62. package/{runAgentClientLoop-LYBCFZ2N.js → runAgentClientLoop-BXMDAQB2.js} +10 -10
  63. package/{runtimeDoctorCommands-QNF3J3UV.js → runtimeDoctorCommands-THIHX2SY.js} +1 -1
  64. package/{spaceCommands-4R63UST3.js → spaceCommands-7Z6DZFEE.js} +9 -9
  65. package/{spaceSlice-BFQF34NY.js → spaceSlice-3GLIRD3Q.js} +2 -2
  66. package/{streamAgentChatTurn-4XRHF5WM.js → streamAgentChatTurn-SN7YS2VV.js} +12 -12
  67. package/{tableCommands-E4SQWDOX.js → tableCommands-V5O7QMXY.js} +1 -1
  68. package/{tools-TWULRP6D.js → tools-4JSNWHIK.js} +5 -5
  69. package/{tuiSummaryLlmCaller-2D65LKWM.js → tuiSummaryLlmCaller-PS5BDLHV.js} +2 -2
  70. package/{updateCommands-XZDOOYFH.js → updateCommands-XTW55TOT.js} +2 -2
  71. package/{updateDialogTitleAction-FDFEHTQP.js → updateDialogTitleAction-DUJ2JZXX.js} +2 -2
@@ -7,7 +7,7 @@ import {
7
7
  listUserRecordsFromServers,
8
8
  readDbRecordFromServers,
9
9
  readLiveDbRecordAfterTombstoneMerge
10
- } from "./chunk-4UUJFFMK.js";
10
+ } from "./chunk-YQAG2J2T.js";
11
11
  import {
12
12
  buildDialogAttachmentPlan,
13
13
  extractFileContentIds
@@ -38,7 +38,7 @@ import {
38
38
  resolveDeleteServerCandidates,
39
39
  resolveServerCandidates,
40
40
  resolveServerUrl
41
- } from "./chunk-5NBHQD4D.js";
41
+ } from "./chunk-A7GB5UGH.js";
42
42
  import {
43
43
  asOptionalTrimmedString
44
44
  } from "./chunk-G3SUCT4W.js";
@@ -5,10 +5,10 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-CGN3RCBB.js";
8
+ } from "./chunk-MEXNTURY.js";
9
9
  import {
10
10
  performFetchRequest
11
- } from "./chunk-2H5WLDK5.js";
11
+ } from "./chunk-P6DRYHVM.js";
12
12
  import {
13
13
  getPublicImageAgentMode
14
14
  } from "./chunk-VIDPVFP3.js";
@@ -22,20 +22,20 @@ import {
22
22
  toolRunSetPending,
23
23
  toolRunStarted,
24
24
  toolRunSucceeded
25
- } from "./chunk-3TNFSPK4.js";
25
+ } from "./chunk-KUDUXBNE.js";
26
26
  import {
27
27
  addToolMessage,
28
28
  messageStreamEnd,
29
29
  messageStreaming,
30
30
  selectCurrentSpaceId,
31
31
  updateToolMessage
32
- } from "./chunk-ZVNP5V7L.js";
32
+ } from "./chunk-SW3Q2OV5.js";
33
33
  import {
34
34
  streamAgentChatTurn
35
- } from "./chunk-J4ZTWTKV.js";
35
+ } from "./chunk-NFHGY5T5.js";
36
36
  import {
37
37
  EMPTY_ASSISTANT_REPAIR_PROMPT
38
- } from "./chunk-VQFY3VXW.js";
38
+ } from "./chunk-2ROIXEDX.js";
39
39
  import {
40
40
  accumulateToolCallDelta,
41
41
  createThinkParserState,
@@ -18,7 +18,7 @@ import {
18
18
  isBuiltinNoloAgentRef,
19
19
  t,
20
20
  toolLabel
21
- } from "./chunk-OJTVDHOJ.js";
21
+ } from "./chunk-GGHFCK3X.js";
22
22
  import {
23
23
  CliProviderQuotaError
24
24
  } from "./chunk-CMKUBIGW.js";
@@ -28,10 +28,10 @@ import {
28
28
  import {
29
29
  readDbRecord,
30
30
  resolveAgentRecordFromHybridStore
31
- } from "./chunk-5R73BS7Y.js";
31
+ } from "./chunk-YG3CCS7C.js";
32
32
  import {
33
33
  normalizeAgentHandle
34
- } from "./chunk-TQCONXQ3.js";
34
+ } from "./chunk-CDQ2ICPR.js";
35
35
  import {
36
36
  NOLO_PROJECT_MANAGER_AGENT_KEY,
37
37
  isLocalCliAgentKey
@@ -48,7 +48,7 @@ import {
48
48
  formatStatusRunCard,
49
49
  formatStopRunCard,
50
50
  isAgentRunTerminalStatus
51
- } from "./chunk-3TNFSPK4.js";
51
+ } from "./chunk-KUDUXBNE.js";
52
52
  import {
53
53
  isGatewayHttpStatus
54
54
  } from "./chunk-RQSOAMPJ.js";
@@ -57,7 +57,7 @@ import {
57
57
  chooseMemoryOwners,
58
58
  loadMemoryCandidatesFromDb,
59
59
  resolveAgentMemoryPolicy
60
- } from "./chunk-FUMEXHAF.js";
60
+ } from "./chunk-7VKJDLPO.js";
61
61
  import {
62
62
  parseExternalSkillMarkdown,
63
63
  parseSkillDocProtocol
@@ -66,14 +66,14 @@ import {
66
66
  API_REPORTED_COST_MULTIPLIER,
67
67
  normalizeUsage,
68
68
  parseUiAskChoiceContent
69
- } from "./chunk-ZVNP5V7L.js";
69
+ } from "./chunk-SW3Q2OV5.js";
70
70
  import {
71
71
  buildSkillDiscoveryContextBlock
72
72
  } from "./chunk-AS3ZQ3O2.js";
73
73
  import {
74
74
  buildPlatformChatCompletionRequest,
75
75
  parsePlatformChatCompletionData
76
- } from "./chunk-PB2DHBEQ.js";
76
+ } from "./chunk-3AE4NQ5O.js";
77
77
  import {
78
78
  resolveAgentRuntimeConfigFromRecord
79
79
  } from "./chunk-OIQPORYI.js";
@@ -82,10 +82,11 @@ import {
82
82
  LOCAL_TURN_ABORTED_CODE,
83
83
  readActionGate,
84
84
  readCommandActionGatePayload
85
- } from "./chunk-VQFY3VXW.js";
85
+ } from "./chunk-2ROIXEDX.js";
86
86
  import {
87
+ resolvePlatformAuthToken,
87
88
  resolvePlatformChatCompletionsEndpoint
88
- } from "./chunk-KTFJUPDW.js";
89
+ } from "./chunk-SRKNB2WB.js";
89
90
  import {
90
91
  DEFAULT_CONTEXT_WINDOW,
91
92
  getModelContextWindow
@@ -107,7 +108,7 @@ import {
107
108
  createRunActivityTracker,
108
109
  finalizeRunRecord,
109
110
  spawnLocalBackgroundRun
110
- } from "./chunk-4ON5AV72.js";
111
+ } from "./chunk-MYMMNKYL.js";
111
112
  import {
112
113
  toErrorMessage
113
114
  } from "./chunk-HNMXYYJR.js";
@@ -137,7 +138,7 @@ import {
137
138
  } from "./chunk-3EUW3WEO.js";
138
139
  import {
139
140
  resolveAuthToken
140
- } from "./chunk-5NBHQD4D.js";
141
+ } from "./chunk-A7GB5UGH.js";
141
142
  import {
142
143
  isLoopbackUrl
143
144
  } from "./chunk-4SN6J65J.js";
@@ -3422,7 +3423,7 @@ async function readStreamingAgentRun(options, res, existingSpinner) {
3422
3423
 
3423
3424
  // packages/cli/client/agentRunTypes.ts
3424
3425
  function resolveAuthToken2(env) {
3425
- return env.AUTH_TOKEN || env.AUTH || env.BENCHMARK_AUTH_TOKEN || "";
3426
+ return resolvePlatformAuthToken(env);
3426
3427
  }
3427
3428
  function isMachineBoundLocalhostCustomProvider(agentConfig) {
3428
3429
  const machineId = agentConfig?.runtimeBinding && typeof agentConfig.runtimeBinding === "object" ? String(agentConfig.runtimeBinding.machineId ?? "").trim() : "";
@@ -3670,7 +3671,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
3670
3671
  // packages/cli/client/agentRun.ts
3671
3672
  import { ulid } from "ulid";
3672
3673
  async function loadRunLocalAgentTurn() {
3673
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-DSUBT77I.js");
3674
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-BONMVACL.js");
3674
3675
  return runLocalAgentTurn;
3675
3676
  }
3676
3677
  async function resolveCurrentMachineId(options) {
@@ -4107,7 +4108,7 @@ async function runLocalAgentTurnForCli(options, settings) {
4107
4108
  } : void 0;
4108
4109
  const currentDialogId = options.continueDialogId ?? ulid();
4109
4110
  const runChildTurn = async (input) => {
4110
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-DSUBT77I.js");
4111
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-BONMVACL.js");
4111
4112
  return runLocalAgentTurn(input);
4112
4113
  };
4113
4114
  const createFreshChildBaseAdapter = () => {
@@ -4219,6 +4220,7 @@ async function runLocalAgentTurnForCli(options, settings) {
4219
4220
  return {
4220
4221
  exitCode: 0,
4221
4222
  dialogId: result.dialogId,
4223
+ title: result.title,
4222
4224
  turnTokens: buildTurnTokenUsage(result.usage, result.model)
4223
4225
  };
4224
4226
  } catch (error) {
@@ -4262,6 +4264,7 @@ async function runAgentTurn(options) {
4262
4264
  return {
4263
4265
  exitCode: localResult.exitCode,
4264
4266
  ...localResult.dialogId ? { dialogId: localResult.dialogId } : {},
4267
+ title: localResult.title,
4265
4268
  ...localResult.turnTokens ? { turnTokens: localResult.turnTokens } : {},
4266
4269
  ...localResult.streamInterrupted ? { streamInterrupted: localResult.streamInterrupted } : {},
4267
4270
  ...localResult.pendingToolName ? { pendingToolName: localResult.pendingToolName } : {}
@@ -4282,6 +4285,7 @@ async function runAgentTurn(options) {
4282
4285
  return {
4283
4286
  exitCode: retriedLocalResult.exitCode,
4284
4287
  ...retriedLocalResult.dialogId ? { dialogId: retriedLocalResult.dialogId } : {},
4288
+ title: retriedLocalResult.title,
4285
4289
  ...retriedLocalResult.turnTokens ? { turnTokens: retriedLocalResult.turnTokens } : {}
4286
4290
  };
4287
4291
  }
@@ -12,7 +12,7 @@ import {
12
12
  buildLocalAgentLookupKeys,
13
13
  normalizeAgentHandle,
14
14
  shouldReadAgentKeyRemotely
15
- } from "./chunk-TQCONXQ3.js";
15
+ } from "./chunk-CDQ2ICPR.js";
16
16
  import {
17
17
  LOCAL_CODEX_AGENT_ID,
18
18
  LOCAL_CODEX_AGENT_KEY,
@@ -28,13 +28,13 @@ import {
28
28
  import {
29
29
  inlineImageUrlsForCustomProvider,
30
30
  prepareTools
31
- } from "./chunk-CGN3RCBB.js";
31
+ } from "./chunk-MEXNTURY.js";
32
32
  import {
33
33
  getAntigravityUserAgent,
34
34
  isAntigravityOAuthAgent,
35
35
  readAntigravityProjectId,
36
36
  resolveAntigravityCloudCodeBaseUrl
37
- } from "./chunk-OIMX7MM4.js";
37
+ } from "./chunk-QLO2G5HP.js";
38
38
  import {
39
39
  FORCED_TOOLS,
40
40
  addDefaultLightWebToolsForConfiguredAgents,
@@ -53,7 +53,7 @@ import {
53
53
  readXhsProfileFunctionSchema,
54
54
  rememberMemoryFunctionSchema,
55
55
  resolveEffectiveEnabledPacks
56
- } from "./chunk-3TNFSPK4.js";
56
+ } from "./chunk-KUDUXBNE.js";
57
57
  import {
58
58
  createDrainExhaustedResponse,
59
59
  isCoreDrainingBody,
@@ -65,13 +65,13 @@ import {
65
65
  } from "./chunk-OWOHNGCN.js";
66
66
  import {
67
67
  prepareTokenUsageData
68
- } from "./chunk-ZVNP5V7L.js";
68
+ } from "./chunk-SW3Q2OV5.js";
69
69
  import {
70
70
  BUILTIN_TITLE_LLM_CONFIG
71
71
  } from "./chunk-V2J635L5.js";
72
72
  import {
73
73
  fetchServerSyncedCredential
74
- } from "./chunk-J4ZTWTKV.js";
74
+ } from "./chunk-NFHGY5T5.js";
75
75
  import {
76
76
  buildAgentRuntimeDialogWritePlan,
77
77
  buildLocalWorkspaceOpenAiTools,
@@ -84,7 +84,7 @@ import {
84
84
  parseSseDataLineJson,
85
85
  readOpenAiCompatibleSseCompletion,
86
86
  resolveOpenAiCompatibleProviderConfig
87
- } from "./chunk-33K5FKRL.js";
87
+ } from "./chunk-SZ7RUWAQ.js";
88
88
  import {
89
89
  buildPlatformChatCompletionRequest,
90
90
  canUsePlatformChatProvider,
@@ -94,14 +94,17 @@ import {
94
94
  resolveLegacyDeepSeekProxyChatFallback,
95
95
  resolvePlatformChatProviderConfig,
96
96
  shouldUsePlatformChatProvider
97
- } from "./chunk-PB2DHBEQ.js";
97
+ } from "./chunk-3AE4NQ5O.js";
98
98
  import {
99
99
  resolveAgentRuntimeConfigFromRecord
100
100
  } from "./chunk-OIQPORYI.js";
101
101
  import {
102
102
  parseToolArgumentsJson,
103
103
  summarizeToolArguments
104
- } from "./chunk-VQFY3VXW.js";
104
+ } from "./chunk-2ROIXEDX.js";
105
+ import {
106
+ resolvePlatformAuthToken
107
+ } from "./chunk-SRKNB2WB.js";
105
108
  import {
106
109
  buildLoadSkillExecutor,
107
110
  buildNoloWorkspaceCliToolExecutors,
@@ -134,7 +137,7 @@ import {
134
137
  findRunRecord,
135
138
  listRunRecords,
136
139
  spawnLocalBackgroundRun
137
- } from "./chunk-4ON5AV72.js";
140
+ } from "./chunk-MYMMNKYL.js";
138
141
  import {
139
142
  toErrorMessage
140
143
  } from "./chunk-HNMXYYJR.js";
@@ -172,7 +175,7 @@ import {
172
175
  import {
173
176
  isCompiledBinary,
174
177
  parseUserIdFromAuthToken
175
- } from "./chunk-5NBHQD4D.js";
178
+ } from "./chunk-A7GB5UGH.js";
176
179
  import {
177
180
  DEFAULT_NOLO_SERVER_URL
178
181
  } from "./chunk-OLZBQWZU.js";
@@ -954,7 +957,7 @@ function resolveRuntimeServerUrl(env) {
954
957
  return (env?.NOLO_SERVER_URL || env?.NOLO_SERVER || env?.BASE_URL || "").replace(/\/+$/, "");
955
958
  }
956
959
  function resolveRuntimeAuthToken(env) {
957
- return env?.AUTH_TOKEN || env?.AUTH || env?.NOLO_MACHINE_API_KEY || "";
960
+ return resolvePlatformAuthToken(env ?? {});
958
961
  }
959
962
 
960
963
  // packages/cli/client/localRuntimeFetchRetry.ts
@@ -2541,6 +2544,24 @@ function convertOpenAiMessagesToCca(messages, options) {
2541
2544
  const contents = [];
2542
2545
  const systemTexts = [];
2543
2546
  const toolNamesById = /* @__PURE__ */ new Map();
2547
+ let pendingFunctionCalls = [];
2548
+ const pushOrMergeContent = (role, parts) => {
2549
+ if (parts.length === 0) return;
2550
+ const last = contents[contents.length - 1];
2551
+ if (last && last.role === role) {
2552
+ last.parts.push(...parts);
2553
+ } else {
2554
+ contents.push({ role, parts });
2555
+ }
2556
+ };
2557
+ const flushPendingFunctionCalls = () => {
2558
+ if (pendingFunctionCalls.length === 0) return;
2559
+ const dummyResponses = pendingFunctionCalls.map(({ name }) => ({
2560
+ functionResponse: { name, response: { output: "{}" } }
2561
+ }));
2562
+ pendingFunctionCalls = [];
2563
+ pushOrMergeContent("user", dummyResponses);
2564
+ };
2544
2565
  for (const raw of messages) {
2545
2566
  if (!raw || typeof raw !== "object" || !("role" in raw)) continue;
2546
2567
  const role = String(raw.role);
@@ -2551,6 +2572,7 @@ function convertOpenAiMessagesToCca(messages, options) {
2551
2572
  continue;
2552
2573
  }
2553
2574
  if (role === "user") {
2575
+ flushPendingFunctionCalls();
2554
2576
  const text = messageText(content);
2555
2577
  const imageParts = extractInlineDataParts(
2556
2578
  content
@@ -2559,10 +2581,11 @@ function convertOpenAiMessagesToCca(messages, options) {
2559
2581
  const parts = [];
2560
2582
  if (text) parts.push({ text });
2561
2583
  for (const img of imageParts) parts.push(img);
2562
- contents.push({ role: "user", parts });
2584
+ pushOrMergeContent("user", parts);
2563
2585
  continue;
2564
2586
  }
2565
2587
  if (role === "assistant") {
2588
+ flushPendingFunctionCalls();
2566
2589
  const parts = [];
2567
2590
  const text = messageText(content);
2568
2591
  if (text) parts.push({ text });
@@ -2572,6 +2595,7 @@ function convertOpenAiMessagesToCca(messages, options) {
2572
2595
  if (!name) continue;
2573
2596
  const id = call.id?.trim() || `${name}_${toolNamesById.size}`;
2574
2597
  toolNamesById.set(id, name);
2598
+ pendingFunctionCalls.push({ name, id });
2575
2599
  const realSignature = typeof call.thought_signature === "string" && call.thought_signature ? call.thought_signature : void 0;
2576
2600
  const isFirstFunctionCallPart = !parts.some((p) => "functionCall" in p);
2577
2601
  parts.push({
@@ -2584,19 +2608,28 @@ function convertOpenAiMessagesToCca(messages, options) {
2584
2608
  });
2585
2609
  }
2586
2610
  if (parts.length === 0) continue;
2587
- contents.push({ role: "model", parts });
2611
+ pushOrMergeContent("model", parts);
2588
2612
  continue;
2589
2613
  }
2590
2614
  if (role === "tool") {
2591
2615
  const toolCallId = "tool_call_id" in raw && typeof raw.tool_call_id === "string" ? raw.tool_call_id : "";
2592
- const name = toolNamesById.get(toolCallId) ?? "tool";
2616
+ const rawName = "name" in raw && typeof raw.name === "string" ? raw.name.trim() : "";
2617
+ const name = toolNamesById.get(toolCallId) || rawName || pendingFunctionCalls[0]?.name || "tool";
2618
+ const pendingIndex = pendingFunctionCalls.findIndex(
2619
+ (p) => toolCallId ? p.id === toolCallId : p.name === name
2620
+ );
2621
+ if (pendingIndex !== -1) {
2622
+ pendingFunctionCalls.splice(pendingIndex, 1);
2623
+ } else if (pendingFunctionCalls.length > 0) {
2624
+ pendingFunctionCalls.shift();
2625
+ }
2593
2626
  const output = messageText(content) || "{}";
2594
- contents.push({
2595
- role: "user",
2596
- parts: [{ functionResponse: { name, response: { output } } }]
2597
- });
2627
+ pushOrMergeContent("user", [
2628
+ { functionResponse: { name, response: { output } } }
2629
+ ]);
2598
2630
  }
2599
2631
  }
2632
+ flushPendingFunctionCalls();
2600
2633
  return { contents, systemTexts };
2601
2634
  }
2602
2635
  function convertOpenAiTools(tools) {
@@ -9199,7 +9232,7 @@ function resolveFallbackServers(env) {
9199
9232
  return [...new Set(values.map(normalizeServerOrigin))];
9200
9233
  }
9201
9234
  function resolveAuthToken(env) {
9202
- return env.AUTH_TOKEN || env.AUTH || env.BENCHMARK_AUTH_TOKEN || "";
9235
+ return resolvePlatformAuthToken(env);
9203
9236
  }
9204
9237
  function createCliHybridRecordStore(deps) {
9205
9238
  return createHybridRecordStore({
@@ -9321,10 +9354,13 @@ function buildOpenAiTools(args) {
9321
9354
  ];
9322
9355
  }
9323
9356
  var CLI_DEFAULT_TOOLS = ["exa_search", "fetchWebpage"];
9324
- function addDefaultCliCoreTools(toolNames, env) {
9357
+ function addDefaultCliCoreTools(toolNames, env, options) {
9325
9358
  const declaredOnly = env && shouldUseDeclaredOnlyLocalWorkspaceTools(env);
9326
- const injected = declaredOnly ? [...FORCED_TOOLS] : [...FORCED_TOOLS, ...CLI_DEFAULT_TOOLS];
9327
- return [.../* @__PURE__ */ new Set([...toolNames, ...injected])];
9359
+ const forcedTools = options?.hasUserChoice ? FORCED_TOOLS : FORCED_TOOLS.filter((name) => name !== "ui_ask_choice");
9360
+ const injected = declaredOnly ? [...forcedTools] : [...forcedTools, ...CLI_DEFAULT_TOOLS];
9361
+ const combined = [...toolNames, ...injected];
9362
+ const filtered = options?.hasUserChoice ? combined : combined.filter((name) => name !== "ui_ask_choice");
9363
+ return [...new Set(filtered)];
9328
9364
  }
9329
9365
  function resolveCliEffectiveEnabledPacks(args) {
9330
9366
  return resolveEffectiveEnabledPacks({
@@ -9349,7 +9385,7 @@ function withRuntimeEnabledPacksAndPrompt(config) {
9349
9385
  ...prompt ? { prompt } : {}
9350
9386
  };
9351
9387
  }
9352
- function resolveCliRequestedToolNames(agentConfig, env, systemBuiltinSkills) {
9388
+ function resolveCliRequestedToolNames(agentConfig, env, systemBuiltinSkills, options) {
9353
9389
  const declaredOnly = shouldUseDeclaredOnlyLocalWorkspaceTools(env);
9354
9390
  const expanded = addDefaultLightWebToolsForConfiguredAgents(
9355
9391
  addDefaultCliCoreTools(
@@ -9366,7 +9402,8 @@ function resolveCliRequestedToolNames(agentConfig, env, systemBuiltinSkills) {
9366
9402
  resolveRequestedRuntimeToolNames({ agentConfig })
9367
9403
  )
9368
9404
  ),
9369
- env
9405
+ env,
9406
+ options
9370
9407
  ),
9371
9408
  agentConfig
9372
9409
  );
@@ -9376,10 +9413,10 @@ function resolveCliRequestedToolNames(agentConfig, env, systemBuiltinSkills) {
9376
9413
  agentConfig?.disabledTools
9377
9414
  );
9378
9415
  }
9379
- function resolveProviderOpenAiToolBundle(agentConfig, env, buildTools = buildOpenAiTools, additionalToolNames = []) {
9416
+ function resolveProviderOpenAiToolBundle(agentConfig, env, buildTools = buildOpenAiTools, additionalToolNames = [], options) {
9380
9417
  const requestedToolNames = [
9381
9418
  .../* @__PURE__ */ new Set([
9382
- ...resolveCliRequestedToolNames(agentConfig, env),
9419
+ ...resolveCliRequestedToolNames(agentConfig, env, null, options),
9383
9420
  ...additionalToolNames
9384
9421
  ])
9385
9422
  ];
@@ -9701,7 +9738,9 @@ async function writeDialog(args) {
9701
9738
  existingDialog = await args.store.read(dialogKey);
9702
9739
  }
9703
9740
  const authToken = resolveRuntimeAuthToken2(args.env);
9704
- const isLoggedIn = Boolean(authToken && parseUserIdFromAuthToken(authToken));
9741
+ const isLoggedIn = Boolean(
9742
+ authToken && (parseUserIdFromAuthToken(authToken) || args.env.NOLO_MACHINE_API_KEY?.trim())
9743
+ );
9705
9744
  const hasExistingTitle = typeof existingDialog?.title === "string" && existingDialog.title.trim();
9706
9745
  let titleOverride;
9707
9746
  if (isLoggedIn && !hasExistingTitle && args.titleGenerator) {
@@ -9774,7 +9813,7 @@ async function writeDialog(args) {
9774
9813
  );
9775
9814
  }
9776
9815
  }
9777
- return { dialogId: plan.dialogId };
9816
+ return { dialogId: plan.dialogId, title: plan.title };
9778
9817
  }
9779
9818
  function resolveCliDialogRecordKey(userId, dialogId) {
9780
9819
  if (dialogId.startsWith("dialog-") && !dialogId.includes("-msg-")) {
@@ -9883,7 +9922,13 @@ function createCliLocalRuntimeAdapter(deps) {
9883
9922
  deps.env
9884
9923
  );
9885
9924
  const agentConfig = baseAgentConfig ? withRuntimeEnabledPacksAndPrompt(baseAgentConfig) : baseAgentConfig;
9886
- const requestedToolNames = agentConfig ? resolveCliRequestedToolNames(agentConfig, deps.env, systemBuiltinSkills) : [];
9925
+ const hasUserChoice2 = Boolean(deps.requestUserChoice);
9926
+ const requestedToolNames = agentConfig ? resolveCliRequestedToolNames(
9927
+ agentConfig,
9928
+ deps.env,
9929
+ systemBuiltinSkills,
9930
+ { hasUserChoice: hasUserChoice2 }
9931
+ ) : [];
9887
9932
  activeAgentToolNames = buildLocalPolicyToolNames({
9888
9933
  agentKey: agentConfig?.key,
9889
9934
  toolNames: [...requestedToolNames, ...additionalToolNames],
@@ -10013,7 +10058,8 @@ function createCliLocalRuntimeAdapter(deps) {
10013
10058
  agentConfig,
10014
10059
  deps.env,
10015
10060
  buildProviderOpenAiTools,
10016
- additionalToolNames
10061
+ additionalToolNames,
10062
+ { hasUserChoice }
10017
10063
  );
10018
10064
  logLocalRuntimeDiagnostic("provider.selected", {
10019
10065
  agentKey: agentConfig.key,
@@ -10094,7 +10140,8 @@ function createCliLocalRuntimeAdapter(deps) {
10094
10140
  agentConfig,
10095
10141
  deps.env,
10096
10142
  buildProviderOpenAiTools,
10097
- additionalToolNames
10143
+ additionalToolNames,
10144
+ { hasUserChoice }
10098
10145
  );
10099
10146
  logLocalRuntimeDiagnostic("provider.selected", {
10100
10147
  agentKey: agentConfig.key,
@@ -10160,7 +10207,8 @@ function createCliLocalRuntimeAdapter(deps) {
10160
10207
  agentConfig,
10161
10208
  deps.env,
10162
10209
  buildProviderOpenAiTools,
10163
- additionalToolNames
10210
+ additionalToolNames,
10211
+ { hasUserChoice }
10164
10212
  );
10165
10213
  logLocalRuntimeDiagnostic("provider.selected", {
10166
10214
  agentKey: agentConfig.key,
@@ -10243,7 +10291,8 @@ function createCliLocalRuntimeAdapter(deps) {
10243
10291
  agentConfig,
10244
10292
  deps.env,
10245
10293
  buildProviderOpenAiTools,
10246
- additionalToolNames
10294
+ additionalToolNames,
10295
+ { hasUserChoice: Boolean(deps.requestUserChoice) }
10247
10296
  );
10248
10297
  return {
10249
10298
  model: providerConfig2.model,
@@ -10399,7 +10448,8 @@ function createCliLocalRuntimeAdapter(deps) {
10399
10448
  agentConfig,
10400
10449
  deps.env,
10401
10450
  buildProviderOpenAiTools,
10402
- additionalToolNames
10451
+ additionalToolNames,
10452
+ { hasUserChoice: Boolean(deps.requestUserChoice) }
10403
10453
  );
10404
10454
  return {
10405
10455
  model: providerConfig.model,
@@ -26,7 +26,7 @@ import {
26
26
  } from "./chunk-3EUW3WEO.js";
27
27
  import {
28
28
  resolveAuthTokenFromEnv
29
- } from "./chunk-5NBHQD4D.js";
29
+ } from "./chunk-A7GB5UGH.js";
30
30
  import {
31
31
  DEFAULT_NOLO_SERVER_URL
32
32
  } from "./chunk-OLZBQWZU.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isImageUrlPart
3
- } from "./chunk-KTFJUPDW.js";
3
+ } from "./chunk-SRKNB2WB.js";
4
4
  import {
5
5
  canonicalizeToolNames
6
6
  } from "./chunk-B4KT7RN2.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-IDZTNRP2.js";
7
7
  import {
8
8
  isCompiledBinary
9
- } from "./chunk-5NBHQD4D.js";
9
+ } from "./chunk-A7GB5UGH.js";
10
10
  import {
11
11
  DEFAULT_NOLO_SERVER_URL
12
12
  } from "./chunk-OLZBQWZU.js";
@@ -34,10 +34,10 @@ import {
34
34
  } from "./chunk-VF4K2QE6.js";
35
35
  import {
36
36
  createDocState
37
- } from "./chunk-YJAWJCEI.js";
37
+ } from "./chunk-QNXEDF7V.js";
38
38
  import {
39
39
  createDialogAction
40
- } from "./chunk-FUMEXHAF.js";
40
+ } from "./chunk-7VKJDLPO.js";
41
41
  import {
42
42
  buildSkillDocMarkdown,
43
43
  normalizeSkillBudgetTier,
@@ -76,13 +76,13 @@ import {
76
76
  updateContentCategory,
77
77
  updateContentTitle,
78
78
  updateStep
79
- } from "./chunk-ZVNP5V7L.js";
79
+ } from "./chunk-SW3Q2OV5.js";
80
80
  import {
81
81
  createAgent,
82
82
  runLlm,
83
83
  streamAgentChatTurn,
84
84
  updateAgent
85
- } from "./chunk-J4ZTWTKV.js";
85
+ } from "./chunk-NFHGY5T5.js";
86
86
  import {
87
87
  NOLO_WORKSPACE_TOOL_NAMES,
88
88
  buildNoloSubjectRefQueryTarget,
@@ -14155,7 +14155,7 @@ async function deleteDialogsFunc(args, thunkApi) {
14155
14155
  const deletedDialogIds = [];
14156
14156
  const deletedDialogKeys = [];
14157
14157
  const failures = [];
14158
- const { deleteDialog } = await import("./dialogSlice-LZU5QKIN.js");
14158
+ const { deleteDialog } = await import("./dialogSlice-QZZF4JXD.js");
14159
14159
  for (const target of targets) {
14160
14160
  try {
14161
14161
  await thunkApi.dispatch(deleteDialog(target.dbKey)).unwrap();
@@ -23361,7 +23361,7 @@ var executeToolRun = createAsyncThunk(
23361
23361
  if (!executionInput) {
23362
23362
  throw new Error(`ToolRun ${id} has no input to execute with.`);
23363
23363
  }
23364
- const { findToolExecutor: findToolExecutor2 } = await import("./tools-TWULRP6D.js");
23364
+ const { findToolExecutor: findToolExecutor2 } = await import("./tools-4JSNWHIK.js");
23365
23365
  const { executor } = findToolExecutor2(run.toolName);
23366
23366
  toolRunStarted({
23367
23367
  id: run.id,
@@ -23385,7 +23385,7 @@ var executeToolRun = createAsyncThunk(
23385
23385
  const latestState = thunkApi.getState();
23386
23386
  const userId = latestState.auth?.currentUser?.userId;
23387
23387
  if (userId) {
23388
- const { fetchUserSpaceMemberships } = await import("./spaceSlice-BFQF34NY.js");
23388
+ const { fetchUserSpaceMemberships } = await import("./spaceSlice-3GLIRD3Q.js");
23389
23389
  await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
23390
23390
  }
23391
23391
  }
@@ -25788,7 +25788,7 @@ async function updateDocFunc(args, thunkApi) {
25788
25788
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
25789
25789
  };
25790
25790
  await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
25791
- const { getDocState, applyExternalDocUpdate } = await import("./docStore-QD57XJ4K.js");
25791
+ const { getDocState, applyExternalDocUpdate } = await import("./docStore-66Q4JTTG.js");
25792
25792
  if (getDocState().pageKey === id) {
25793
25793
  applyExternalDocUpdate({
25794
25794
  slateData: finalSlateData,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  i18n_default,
3
3
  toolRegistry
4
- } from "./chunk-3TNFSPK4.js";
4
+ } from "./chunk-KUDUXBNE.js";
5
5
  import {
6
6
  canonicalizeToolNames
7
7
  } from "./chunk-B4KT7RN2.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isCompiledBinary,
3
3
  resolveCliEntrypointPath
4
- } from "./chunk-5NBHQD4D.js";
4
+ } from "./chunk-A7GB5UGH.js";
5
5
 
6
6
  // packages/cli/agentRunControl.ts
7
7
  import { homedir as nodeHomedir } from "node:os";
@@ -300,7 +300,7 @@ var slice = createSliceWithThunks({
300
300
  const overrides = {};
301
301
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
302
302
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
303
- const { _executeModel } = await import("./_executeModel-RFT5SF7K.js");
303
+ const { _executeModel } = await import("./_executeModel-OQ6KPFSB.js");
304
304
  return _executeModel(
305
305
  {
306
306
  isStreaming: args.isStreaming ?? false,
@@ -321,7 +321,7 @@ var slice = createSliceWithThunks({
321
321
  * - 循环直到无工具调用或触发其他运行时停止条件
322
322
  */
323
323
  runAgent: create.asyncThunk(async (args, thunkApi) => {
324
- const { runAgentClientLoop } = await import("./runAgentClientLoop-LYBCFZ2N.js");
324
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-BXMDAQB2.js");
325
325
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
326
326
  {
327
327
  agentKey: args.agentKey,
@@ -337,7 +337,7 @@ var slice = createSliceWithThunks({
337
337
  * 聊天轮次流式 Agent 调用
338
338
  */
339
339
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
340
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-4XRHF5WM.js");
340
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-SN7YS2VV.js");
341
341
  return streamAgentChatTurnHandler(args, thunkApi);
342
342
  }),
343
343
  /**