nolo-cli 0.33.0-alpha.14 → 0.33.0-alpha.16

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 (53) hide show
  1. package/{_executeModel-7JTMK4RG.js → _executeModel-N7UZ7MFF.js} +11 -11
  2. package/{agentDeleteCommand-2TZHJ3RQ.js → agentDeleteCommand-DNLUNGHG.js} +2 -2
  3. package/{agentEmailCommands-DPSDC3HD.js → agentEmailCommands-XBI3DVIX.js} +11 -11
  4. package/{agentListCommands-DTAXH3J6.js → agentListCommands-CBAILFEV.js} +2 -2
  5. package/{agentMachineCommands-AZQTRWSO.js → agentMachineCommands-RI2D7IKF.js} +3 -3
  6. package/{agentRecordCommands-MJM6ZF2G.js → agentRecordCommands-O7FXP7ST.js} +11 -11
  7. package/{agentRunCommand-PTOU5ADW.js → agentRunCommand-RX4SEBVJ.js} +11 -11
  8. package/{agentRuntimeLocal-Q7UJUPCH.js → agentRuntimeLocal-WPHIGITW.js} +2 -2
  9. package/{agentSlice-UU62MB3X.js → agentSlice-DL5WYNE7.js} +1 -1
  10. package/{appDeleteCommands-GK2VPNKO.js → appDeleteCommands-QCKSZMHC.js} +2 -2
  11. package/{appDeployCommands-VQLBLXQ4.js → appDeployCommands-X3RPEPOZ.js} +2 -2
  12. package/{appDeployStatusCommands-QBCR22M6.js → appDeployStatusCommands-2DEUCBPH.js} +2 -2
  13. package/{appGetCommands-XKKIUK2X.js → appGetCommands-XD67TWUX.js} +2 -2
  14. package/{appListCommands-H4H6BAIG.js → appListCommands-5YWXIUEE.js} +2 -2
  15. package/{chatQueueReduxAdapter-HU54G64R.js → chatQueueReduxAdapter-YCAKX5VE.js} +2 -2
  16. package/{chunk-6BNXAFZD.js → chunk-2ORF5DS4.js} +4 -0
  17. package/{chunk-3F66RTMA.js → chunk-5LWAL7BM.js} +3 -3
  18. package/{chunk-G3IZYZYL.js → chunk-6PPURIM6.js} +1 -1
  19. package/{chunk-KJRULCTO.js → chunk-6XYCMONZ.js} +2 -2
  20. package/{chunk-4GRUSXSX.js → chunk-7RUIWGT2.js} +9 -9
  21. package/{chunk-IPVRJ7YP.js → chunk-7XR4OGXP.js} +2 -2
  22. package/{chunk-KT4XMX76.js → chunk-BG7P4GQ3.js} +1 -1
  23. package/{chunk-33TKEKZL.js → chunk-CIHJW5VX.js} +1 -1
  24. package/{chunk-WO42AOGQ.js → chunk-CXGYEBNT.js} +1 -1
  25. package/{chunk-GHDWBVDC.js → chunk-DHT7AQTA.js} +11 -6
  26. package/{chunk-FS5HQTXA.js → chunk-H442K6U4.js} +8 -8
  27. package/{chunk-PXNTCR3F.js → chunk-HEDDKJEM.js} +3 -3
  28. package/{chunk-FLUK32AS.js → chunk-LWVOFTNC.js} +3 -3
  29. package/{chunk-HLDRWLQT.js → chunk-TVUO5GM6.js} +7 -7
  30. package/{chunk-MNG4T5EG.js → chunk-V5EN447C.js} +2 -2
  31. package/{chunk-XSFNKLAP.js → chunk-XEPM3JUR.js} +79 -33
  32. package/{createAgentAutomationAction-UUB7I2IZ.js → createAgentAutomationAction-DXG33NH6.js} +3 -3
  33. package/{createDialogAction-6L4UPVOM.js → createDialogAction-NSYFGB3J.js} +4 -4
  34. package/{createPageAction-YHKPY27S.js → createPageAction-2L3BQD2N.js} +3 -3
  35. package/{dialogCommands-4CM7WLJU.js → dialogCommands-7Q2C7ODY.js} +2 -2
  36. package/{dialogSlice-IGMZSFYT.js → dialogSlice-LW6C3M6A.js} +2 -2
  37. package/{docCreateCommands-J73A5E4E.js → docCreateCommands-6YHGFV54.js} +2 -2
  38. package/{docDeleteCommands-OQARRE6H.js → docDeleteCommands-QN3VJSRH.js} +2 -2
  39. package/{docReadCommands-EOF3SUF3.js → docReadCommands-NYKOOFFB.js} +2 -2
  40. package/{docStore-XAICS4VA.js → docStore-EJUEJZQE.js} +4 -4
  41. package/{docUpdateCommands-3NBWWIX3.js → docUpdateCommands-MBFOJPVJ.js} +2 -2
  42. package/{handleSendMessageAction-ET2RT4YC.js → handleSendMessageAction-LB4EPR3X.js} +2 -2
  43. package/index.js +40 -40
  44. package/{machineCommands-SJTKJRAK.js → machineCommands-FJBYAY3I.js} +11 -11
  45. package/{machineWsRunDispatch-RDRIH27N.js → machineWsRunDispatch-ZNOVFX5A.js} +11 -11
  46. package/package.json +1 -1
  47. package/{readlineWorkspace-T2MLNAVK.js → readlineWorkspace-ZPWJDKVP.js} +31 -163
  48. package/{runAgentClientLoop-H7HEYRIW.js → runAgentClientLoop-UDNCP7YC.js} +8 -8
  49. package/{spaceCommands-EWIIKS7T.js → spaceCommands-LU2YYNE4.js} +2 -2
  50. package/{spaceSlice-IEUHVARG.js → spaceSlice-KHPDJFFP.js} +3 -3
  51. package/{streamAgentChatTurn-DXKMGZTX.js → streamAgentChatTurn-7VYQ3GP7.js} +10 -10
  52. package/{tools-36F2CQ4F.js → tools-ZDXFZEEW.js} +6 -6
  53. package/{updateDialogTitleAction-N7UF3L3R.js → updateDialogTitleAction-WREH6JRU.js} +3 -3
@@ -21,10 +21,11 @@ import {
21
21
  getCliLocale,
22
22
  isBuiltinNoloAgentRef,
23
23
  isSubtaskRun,
24
+ isTransientFetchError,
24
25
  parseAgentRunEvent,
25
26
  t,
26
27
  toolLabel
27
- } from "./chunk-XSFNKLAP.js";
28
+ } from "./chunk-XEPM3JUR.js";
28
29
  import {
29
30
  NOLO_PROJECT_MANAGER_AGENT_KEY,
30
31
  isLocalCliAgentKey
@@ -38,7 +39,7 @@ import {
38
39
  } from "./chunk-ESHYE7WU.js";
39
40
  import {
40
41
  formatAgentListCard
41
- } from "./chunk-4GRUSXSX.js";
42
+ } from "./chunk-7RUIWGT2.js";
42
43
  import {
43
44
  isGatewayHttpStatus
44
45
  } from "./chunk-RQSOAMPJ.js";
@@ -50,12 +51,12 @@ import {
50
51
  chooseMemoryOwners,
51
52
  loadMemoryCandidatesFromDb,
52
53
  resolveAgentMemoryPolicy
53
- } from "./chunk-IPVRJ7YP.js";
54
+ } from "./chunk-7XR4OGXP.js";
54
55
  import {
55
56
  API_REPORTED_COST_MULTIPLIER,
56
57
  normalizeUsage,
57
58
  parseUiAskChoiceContent
58
- } from "./chunk-FS5HQTXA.js";
59
+ } from "./chunk-H442K6U4.js";
59
60
  import {
60
61
  resolveAgentRuntimeConfigFromRecord
61
62
  } from "./chunk-OIQPORYI.js";
@@ -64,7 +65,7 @@ import {
64
65
  LOCAL_TURN_ABORTED_CODE,
65
66
  readActionGate,
66
67
  readCommandActionGatePayload
67
- } from "./chunk-6BNXAFZD.js";
68
+ } from "./chunk-2ORF5DS4.js";
68
69
  import {
69
70
  createThinkParserState,
70
71
  flushThinkParser,
@@ -3521,7 +3522,7 @@ function findCollapsedPasteSpanAt(buffer, pos, opts = {}) {
3521
3522
  // packages/cli/client/agentRun.ts
3522
3523
  import { ulid } from "ulid";
3523
3524
  async function loadRunLocalAgentTurn() {
3524
- const { runLocalAgentTurn } = await import("./agentRuntimeLocal-Q7UJUPCH.js");
3525
+ const { runLocalAgentTurn } = await import("./agentRuntimeLocal-WPHIGITW.js");
3525
3526
  return runLocalAgentTurn;
3526
3527
  }
3527
3528
  async function resolveCurrentMachineId(options) {
@@ -3753,6 +3754,10 @@ function describeLocalRunFailure(message) {
3753
3754
  }
3754
3755
  const cls = classifyLocalRunError(message);
3755
3756
  if (cls.kind === "generic") {
3757
+ if (isTransientFetchError(message)) {
3758
+ return `${RUN_UNAVAILABLE_PREFIX} (${message}). ${NO_FALLBACK} The upstream connection dropped mid-request (transient network/gateway issue \u2014 not a local credential or config problem). Send again (or say "continue") to retry in the same conversation.
3759
+ `;
3760
+ }
3756
3761
  return `${RUN_UNAVAILABLE_PREFIX} (${message}). ${NO_FALLBACK} Fix the local credential/config and retry, ${SERVER_FALLBACK_HINT}.
3757
3762
  `;
3758
3763
  }
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-CWMSB67P.js";
14
14
  import {
15
15
  runLlm
16
- } from "./chunk-FLUK32AS.js";
16
+ } from "./chunk-LWVOFTNC.js";
17
17
  import {
18
18
  cleanupCliSessionForDialog
19
19
  } from "./chunk-FH7VUJN5.js";
@@ -3520,7 +3520,7 @@ var messageSlice = createSliceWithThunks({
3520
3520
  runtimeOptions: args.runtimeOptions
3521
3521
  });
3522
3522
  if (agentKeyToUse) {
3523
- const { streamAgentChatTurn } = await import("./agentSlice-UU62MB3X.js");
3523
+ const { streamAgentChatTurn } = await import("./agentSlice-DL5WYNE7.js");
3524
3524
  await dispatch(
3525
3525
  streamAgentChatTurn({
3526
3526
  agentKey: agentKeyToUse,
@@ -4779,7 +4779,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
4779
4779
  }
4780
4780
  if (isCurrentDialog) {
4781
4781
  await thunkApi.dispatch(resetMsgs());
4782
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-IGMZSFYT.js");
4782
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-LW6C3M6A.js");
4783
4783
  dispatch(clearPendingAttachments2());
4784
4784
  clearWorkflow();
4785
4785
  }
@@ -4788,15 +4788,15 @@ var deleteDialogThunk = async (payload, thunkApi) => {
4788
4788
 
4789
4789
  // packages/chat/dialog/dialogSlice.ts
4790
4790
  var runCreateDialogAction = async (args, thunkApi) => {
4791
- const { createDialogAction } = await import("./createDialogAction-6L4UPVOM.js");
4791
+ const { createDialogAction } = await import("./createDialogAction-NSYFGB3J.js");
4792
4792
  return createDialogAction(args, thunkApi);
4793
4793
  };
4794
4794
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
4795
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-UUB7I2IZ.js");
4795
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-DXG33NH6.js");
4796
4796
  return createAgentAutomationAction(args, thunkApi);
4797
4797
  };
4798
4798
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
4799
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-N7UF3L3R.js");
4799
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-WREH6JRU.js");
4800
4800
  return updateDialogTitleAction(args, thunkApi);
4801
4801
  };
4802
4802
  var runAddDialogAgentAction = async (args, thunkApi) => {
@@ -4820,7 +4820,7 @@ var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
4820
4820
  return setDialogExtraReferencesAction(args, thunkApi);
4821
4821
  };
4822
4822
  var runHandleSendMessageAction = async (args, thunkApi) => {
4823
- const { handleSendMessageAction } = await import("./handleSendMessageAction-ET2RT4YC.js");
4823
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-LB4EPR3X.js");
4824
4824
  return handleSendMessageAction(args, thunkApi);
4825
4825
  };
4826
4826
  function clearDialogState() {
@@ -4833,7 +4833,7 @@ var createPageAndAddReference = createAsyncThunk(
4833
4833
  async (payload, { dispatch, getState, rejectWithValue }) => {
4834
4834
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
4835
4835
  try {
4836
- const { createDocState } = await import("./docStore-XAICS4VA.js");
4836
+ const { createDocState } = await import("./docStore-EJUEJZQE.js");
4837
4837
  const pageKey = await createDocState(
4838
4838
  { slateData, title },
4839
4839
  { dispatch, getState }
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-XSFNKLAP.js";
4
+ } from "./chunk-XEPM3JUR.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-4GRUSXSX.js";
7
+ } from "./chunk-7RUIWGT2.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-6BNXAFZD.js";
10
+ } from "./chunk-2ORF5DS4.js";
11
11
  import {
12
12
  resolveLocalRuntimeEnvFromPolicy
13
13
  } from "./chunk-RQFO3CAF.js";
@@ -304,7 +304,7 @@ var slice = createSliceWithThunks({
304
304
  const overrides = {};
305
305
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
306
306
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
307
- const { _executeModel } = await import("./_executeModel-7JTMK4RG.js");
307
+ const { _executeModel } = await import("./_executeModel-N7UZ7MFF.js");
308
308
  return _executeModel(
309
309
  {
310
310
  isStreaming: args.isStreaming ?? false,
@@ -325,7 +325,7 @@ var slice = createSliceWithThunks({
325
325
  * - 循环直到无工具调用或触发其他运行时停止条件
326
326
  */
327
327
  runAgent: create.asyncThunk(async (args, thunkApi) => {
328
- const { runAgentClientLoop } = await import("./runAgentClientLoop-H7HEYRIW.js");
328
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-UDNCP7YC.js");
329
329
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
330
330
  {
331
331
  agentKey: args.agentKey,
@@ -341,7 +341,7 @@ var slice = createSliceWithThunks({
341
341
  * 聊天轮次流式 Agent 调用
342
342
  */
343
343
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
344
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-DXKMGZTX.js");
344
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-7VYQ3GP7.js");
345
345
  return streamAgentChatTurnHandler(args, thunkApi);
346
346
  }),
347
347
  /**
@@ -8,10 +8,10 @@ import {
8
8
  inlineImageUrlsForCustomProvider,
9
9
  prepareTools,
10
10
  shouldInlineImageUrlsForAgent
11
- } from "./chunk-WO42AOGQ.js";
11
+ } from "./chunk-CXGYEBNT.js";
12
12
  import {
13
13
  performFetchRequest
14
- } from "./chunk-3F66RTMA.js";
14
+ } from "./chunk-5LWAL7BM.js";
15
15
  import {
16
16
  createSSEParser,
17
17
  createToolRunId,
@@ -22,22 +22,22 @@ import {
22
22
  toolRunSetPending,
23
23
  toolRunStarted,
24
24
  toolRunSucceeded
25
- } from "./chunk-4GRUSXSX.js";
25
+ } from "./chunk-7RUIWGT2.js";
26
26
  import {
27
27
  getCurrentSpaceId
28
- } from "./chunk-KJRULCTO.js";
28
+ } from "./chunk-6XYCMONZ.js";
29
29
  import {
30
30
  addToolMessage,
31
31
  messageStreamEnd,
32
32
  messageStreaming,
33
33
  updateToolMessage
34
- } from "./chunk-FS5HQTXA.js";
34
+ } from "./chunk-H442K6U4.js";
35
35
  import {
36
36
  streamAgentChatTurn
37
- } from "./chunk-FLUK32AS.js";
37
+ } from "./chunk-LWVOFTNC.js";
38
38
  import {
39
39
  EMPTY_ASSISTANT_REPAIR_PROMPT
40
- } from "./chunk-6BNXAFZD.js";
40
+ } from "./chunk-2ORF5DS4.js";
41
41
  import {
42
42
  accumulateToolCallDelta,
43
43
  createThinkParserState,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  updateContentTitle
3
- } from "./chunk-KJRULCTO.js";
3
+ } from "./chunk-6XYCMONZ.js";
4
4
  import {
5
5
  require_date_fns
6
6
  } from "./chunk-M76ECQRD.js";
@@ -367,7 +367,7 @@ async function saveDocState(arg, { dispatch, getState }) {
367
367
  }
368
368
  }
369
369
  async function createDocState(args, thunkApi) {
370
- const { createPageAction } = await import("./createPageAction-YHKPY27S.js");
370
+ const { createPageAction } = await import("./createPageAction-2L3BQD2N.js");
371
371
  return createPageAction(args, thunkApi);
372
372
  }
373
373
  function subscribe(listener) {
@@ -20,7 +20,7 @@ import {
20
20
  import {
21
21
  inlineImageUrlsForCustomProvider,
22
22
  prepareTools
23
- } from "./chunk-WO42AOGQ.js";
23
+ } from "./chunk-CXGYEBNT.js";
24
24
  import {
25
25
  getServerProviderSecret
26
26
  } from "./chunk-HS7MLR74.js";
@@ -39,7 +39,7 @@ import {
39
39
  rememberMemoryFunctionSchema,
40
40
  resolveAgentRequiredPackIds,
41
41
  setTodoListFunc
42
- } from "./chunk-4GRUSXSX.js";
42
+ } from "./chunk-7RUIWGT2.js";
43
43
  import {
44
44
  createDrainExhaustedResponse,
45
45
  isCoreDrainingBody,
@@ -55,13 +55,13 @@ import {
55
55
  prepareTokenUsageData,
56
56
  resolveBuiltinPlatformAgentConfig,
57
57
  runKeyed
58
- } from "./chunk-FS5HQTXA.js";
58
+ } from "./chunk-H442K6U4.js";
59
59
  import {
60
60
  BUILTIN_TITLE_LLM_CONFIG
61
61
  } from "./chunk-RCFIB45Q.js";
62
62
  import {
63
63
  fetchServerSyncedCredential
64
- } from "./chunk-FLUK32AS.js";
64
+ } from "./chunk-LWVOFTNC.js";
65
65
  import {
66
66
  require_date_fns
67
67
  } from "./chunk-M76ECQRD.js";
@@ -86,7 +86,7 @@ import {
86
86
  parseSyncServersEnv,
87
87
  resolveAgentNextAvailableAt,
88
88
  resolveOpenAiCompatibleProviderConfig
89
- } from "./chunk-33TKEKZL.js";
89
+ } from "./chunk-CIHJW5VX.js";
90
90
  import {
91
91
  buildPlatformChatCompletionRequest,
92
92
  canUsePlatformChatProvider,
@@ -105,7 +105,7 @@ import {
105
105
  import {
106
106
  resolveHistoricalToolContentCap,
107
107
  summarizeToolArguments
108
- } from "./chunk-6BNXAFZD.js";
108
+ } from "./chunk-2ORF5DS4.js";
109
109
  import {
110
110
  convertMessagesToResponsesInput,
111
111
  toResponsesTools
@@ -423,16 +423,8 @@ var STRINGS = {
423
423
  zh: "\u5F53\u524D\u73AF\u5883\u6CA1\u6709\u53EF\u7528\u7684\u526A\u8D34\u677F\u3002\u6700\u540E\u4E00\u6761\u56DE\u590D\u5DF2\u6253\u5370\u5728\u4E0A\u65B9\uFF0C\u53EF\u624B\u52A8\u590D\u5236\u3002"
424
424
  },
425
425
  copyUsage: {
426
- en: "Usage: /copy or /copy view",
427
- zh: "\u7528\u6CD5\uFF1A/copy \u6216 /copy view"
428
- },
429
- copyViewTitle: {
430
- en: "Copy view \u2014 conversation history",
431
- zh: "\u590D\u5236\u89C6\u56FE \u2014 \u5BF9\u8BDD\u5386\u53F2"
432
- },
433
- copyViewHint: {
434
- en: "Drag to select. Use PageUp/PageDown, Home/End, or the mouse wheel to scroll. Press Esc or Enter to return.",
435
- zh: "\u76F4\u63A5\u62D6\u9009\u3002\u53EF\u7528 PageUp/PageDown\u3001Home/End \u6216\u9F20\u6807\u6EDA\u8F6E\u6EDA\u52A8\u3002\u6309 Esc \u6216 Enter \u8FD4\u56DE\u3002"
426
+ en: "Usage: /copy",
427
+ zh: "\u7528\u6CD5\uFF1A/copy"
436
428
  },
437
429
  historyNoToken: {
438
430
  en: "History requires an auth token. Run `nolo login` or set AUTH_TOKEN.",
@@ -714,7 +706,6 @@ var STRINGS = {
714
706
  " /resume <dialogId> Resume a dialog directly by id",
715
707
  " /lang <zh|en> Switch interface language",
716
708
  " /copy Copy the last reply to the clipboard",
717
- " /copy view Open native scrollback for partial selection (Ctrl+O)",
718
709
  " /mouse <on|off> Toggle mouse mode (off = drag to select text)",
719
710
  " /altscreen <on|off> Toggle the terminal alternate screen (default on; off shares shell scrollback)",
720
711
  " /doc List attached docs",
@@ -750,7 +741,6 @@ var STRINGS = {
750
741
  " /resume <dialogId> \u6309 id \u76F4\u63A5\u6062\u590D\u5BF9\u8BDD",
751
742
  " /lang <zh|en> \u5207\u6362\u754C\u9762\u8BED\u8A00",
752
743
  " /copy \u590D\u5236\u6700\u540E\u4E00\u6761\u56DE\u590D\u5230\u526A\u8D34\u677F",
753
- " /copy view \u6253\u5F00\u539F\u751F\u56DE\u6EDA\u8FDB\u884C\u8DE8\u5C4F\u62D6\u9009\uFF08Ctrl+O\uFF09",
754
744
  " /mouse <on|off> \u5207\u6362\u9F20\u6807\u6A21\u5F0F\uFF08off \u540E\u53EF\u76F4\u63A5\u62D6\u9009\u6587\u672C\uFF09",
755
745
  " /altscreen <on|off> \u5207\u6362\u7EC8\u7AEF\u5907\u7528\u5C4F\uFF08\u9ED8\u8BA4 on\uFF1Boff \u6539\u4E3A\u4E0E shell \u5171\u7528\u56DE\u6EDA\uFF09",
756
746
  " /doc \u5217\u51FA\u5DF2\u6302\u8F7D\u7684\u6587\u6863",
@@ -1105,19 +1095,6 @@ function summarizeEndpoint(value) {
1105
1095
  }
1106
1096
  }
1107
1097
 
1108
- // packages/cli/client/localRuntimeHelpers.ts
1109
- var REMOTE_DIALOG_SYNC_TIMEOUT_MS = 1e4;
1110
- var remoteDialogSyncTimeoutMsForTest;
1111
- function remoteDialogSyncTimeout() {
1112
- return remoteDialogSyncTimeoutMsForTest ?? REMOTE_DIALOG_SYNC_TIMEOUT_MS;
1113
- }
1114
- function resolveRuntimeServerUrl(env) {
1115
- return (env?.NOLO_SERVER_URL || env?.NOLO_SERVER || env?.BASE_URL || "").replace(/\/+$/, "");
1116
- }
1117
- function resolveRuntimeAuthToken(env) {
1118
- return resolvePlatformAuthToken(env ?? {});
1119
- }
1120
-
1121
1098
  // packages/cli/client/localRuntimeFetchRetry.ts
1122
1099
  import { request as httpRequest } from "node:http";
1123
1100
  import { request as httpsRequest } from "node:https";
@@ -1273,6 +1250,65 @@ async function fetchWithTransientRetry(fetchImpl, input, init, options = {}) {
1273
1250
  throw lastError;
1274
1251
  }
1275
1252
 
1253
+ // packages/cli/client/providerStreamRetry.ts
1254
+ var PROVIDER_STREAM_RETRY_MAX_ATTEMPTS = 2;
1255
+ var STREAM_RETRY_MARKER = "\n\n[nolo] \u4E0A\u6E38\u6D41\u4E2D\u65AD\uFF0C\u81EA\u52A8\u91CD\u8BD5\uFF08\u4EE5\u4E0B\u4E3A\u8BE5\u8F6E\u91CD\u65B0\u751F\u6210\u7684\u5185\u5BB9\uFF09\n\n";
1256
+ var UPSTREAM_STREAM_INTERRUPTED_RE = /UPSTREAM_STREAM_INTERRUPTED/i;
1257
+ function isRetryableProviderStreamError(error) {
1258
+ const message = toErrorMessage(error);
1259
+ return UPSTREAM_STREAM_INTERRUPTED_RE.test(message) || isTransientFetchError(message);
1260
+ }
1261
+ function withProviderStreamRetry(provider, deps) {
1262
+ return {
1263
+ model: provider.model,
1264
+ complete: async (messages, options) => {
1265
+ let streamedChars = 0;
1266
+ let sawToolEvent = false;
1267
+ for (let attempt = 1; ; attempt += 1) {
1268
+ try {
1269
+ return await provider.complete(messages, {
1270
+ ...options,
1271
+ ...options?.onTextDelta ? {
1272
+ onTextDelta: (chunk) => {
1273
+ streamedChars += chunk.length;
1274
+ options.onTextDelta(chunk);
1275
+ }
1276
+ } : {},
1277
+ ...options?.onToolEvent ? {
1278
+ onToolEvent: (event) => {
1279
+ sawToolEvent = true;
1280
+ options.onToolEvent(event);
1281
+ }
1282
+ } : {}
1283
+ });
1284
+ } catch (error) {
1285
+ if (options?.signal?.aborted) throw error;
1286
+ if (attempt >= PROVIDER_STREAM_RETRY_MAX_ATTEMPTS) throw error;
1287
+ if (!isRetryableProviderStreamError(error)) throw error;
1288
+ if (sawToolEvent) throw error;
1289
+ if (streamedChars > 0 && options?.onTextDelta) {
1290
+ options.onTextDelta(STREAM_RETRY_MARKER);
1291
+ }
1292
+ deps.activityReporter?.("\u4E0A\u6E38\u6D41\u4E2D\u65AD \xB7 \u81EA\u52A8\u91CD\u8BD5");
1293
+ }
1294
+ }
1295
+ }
1296
+ };
1297
+ }
1298
+
1299
+ // packages/cli/client/localRuntimeHelpers.ts
1300
+ var REMOTE_DIALOG_SYNC_TIMEOUT_MS = 1e4;
1301
+ var remoteDialogSyncTimeoutMsForTest;
1302
+ function remoteDialogSyncTimeout() {
1303
+ return remoteDialogSyncTimeoutMsForTest ?? REMOTE_DIALOG_SYNC_TIMEOUT_MS;
1304
+ }
1305
+ function resolveRuntimeServerUrl(env) {
1306
+ return (env?.NOLO_SERVER_URL || env?.NOLO_SERVER || env?.BASE_URL || "").replace(/\/+$/, "");
1307
+ }
1308
+ function resolveRuntimeAuthToken(env) {
1309
+ return resolvePlatformAuthToken(env ?? {});
1310
+ }
1311
+
1276
1312
  // packages/cli/client/cliRemoteDialogSync.ts
1277
1313
  function prepareRemoteDialogEvidenceRecord(key, value) {
1278
1314
  const record = isRecord(value) ? { ...value } : {};
@@ -10991,7 +11027,7 @@ function createCliLocalRuntimeAdapter(deps) {
10991
11027
  ...deps.pastedTextStore ? { pastedTextStore: deps.pastedTextStore } : {},
10992
11028
  ...runtimeToolExecutionLimits
10993
11029
  });
10994
- return {
11030
+ const adapterBase = {
10995
11031
  host: "cli",
10996
11032
  capabilities: [
10997
11033
  "leveldb-agent-config",
@@ -11106,7 +11142,7 @@ function createCliLocalRuntimeAdapter(deps) {
11106
11142
  loopbackRequest
11107
11143
  })
11108
11144
  }),
11109
- resolveProvider: async (agentConfig) => {
11145
+ resolveProviderBase: async (agentConfig) => {
11110
11146
  if (isAgentCoolingDown(agentConfig, now())) {
11111
11147
  throw new Error(
11112
11148
  `agent temporarily unavailable until ${new Date(Number(agentConfig.nextAvailableAt)).toISOString()}`
@@ -11861,10 +11897,20 @@ function createCliLocalRuntimeAdapter(deps) {
11861
11897
  };
11862
11898
  }
11863
11899
  };
11900
+ return {
11901
+ ...adapterBase,
11902
+ resolveProvider: async (agentConfig) => withProviderStreamRetry(
11903
+ await adapterBase.resolveProviderBase(
11904
+ agentConfig
11905
+ ),
11906
+ deps
11907
+ )
11908
+ };
11864
11909
  }
11865
11910
 
11866
11911
  export {
11867
11912
  summarizeEndpoint,
11913
+ isTransientFetchError,
11868
11914
  isBuiltinNoloAgentRef,
11869
11915
  readTimestamp,
11870
11916
  parseAgentRunEvent,
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-KJRULCTO.js";
3
+ } from "./chunk-6XYCMONZ.js";
4
4
  import "./chunk-M3JEW6N6.js";
5
5
  import "./chunk-IDAU4UFS.js";
6
- import "./chunk-FS5HQTXA.js";
6
+ import "./chunk-H442K6U4.js";
7
7
  import "./chunk-RCFIB45Q.js";
8
8
  import "./chunk-EGRJC4ZN.js";
9
9
  import "./chunk-YYLHWIW6.js";
10
10
  import "./chunk-CWMSB67P.js";
11
- import "./chunk-FLUK32AS.js";
11
+ import "./chunk-LWVOFTNC.js";
12
12
  import "./chunk-FH7VUJN5.js";
13
13
  import "./chunk-5RGU3J7P.js";
14
14
  import "./chunk-M76ECQRD.js";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  createDialogAction,
3
3
  isLocalOwnerDialogAgents
4
- } from "./chunk-IPVRJ7YP.js";
5
- import "./chunk-KJRULCTO.js";
4
+ } from "./chunk-7XR4OGXP.js";
5
+ import "./chunk-6XYCMONZ.js";
6
6
  import "./chunk-M3JEW6N6.js";
7
7
  import "./chunk-IDAU4UFS.js";
8
- import "./chunk-FS5HQTXA.js";
8
+ import "./chunk-H442K6U4.js";
9
9
  import "./chunk-RCFIB45Q.js";
10
10
  import "./chunk-EGRJC4ZN.js";
11
11
  import "./chunk-YYLHWIW6.js";
12
12
  import "./chunk-CWMSB67P.js";
13
- import "./chunk-FLUK32AS.js";
13
+ import "./chunk-LWVOFTNC.js";
14
14
  import "./chunk-FH7VUJN5.js";
15
15
  import "./chunk-5RGU3J7P.js";
16
16
  import "./chunk-M76ECQRD.js";
@@ -15,15 +15,15 @@ import {
15
15
  addContentToSpace,
16
16
  client_default,
17
17
  getCurrentSpaceId
18
- } from "./chunk-KJRULCTO.js";
18
+ } from "./chunk-6XYCMONZ.js";
19
19
  import "./chunk-M3JEW6N6.js";
20
20
  import "./chunk-IDAU4UFS.js";
21
- import "./chunk-FS5HQTXA.js";
21
+ import "./chunk-H442K6U4.js";
22
22
  import "./chunk-RCFIB45Q.js";
23
23
  import "./chunk-EGRJC4ZN.js";
24
24
  import "./chunk-YYLHWIW6.js";
25
25
  import "./chunk-CWMSB67P.js";
26
- import "./chunk-FLUK32AS.js";
26
+ import "./chunk-LWVOFTNC.js";
27
27
  import "./chunk-FH7VUJN5.js";
28
28
  import "./chunk-5RGU3J7P.js";
29
29
  import "./chunk-M76ECQRD.js";
@@ -16,12 +16,12 @@ import "./chunk-X2DAEZ3X.js";
16
16
  import "./chunk-EKLRRZIN.js";
17
17
  import "./chunk-KQHGZWSV.js";
18
18
  import "./chunk-EGRJC4ZN.js";
19
- import "./chunk-33TKEKZL.js";
19
+ import "./chunk-CIHJW5VX.js";
20
20
  import "./chunk-ZNFJWEN4.js";
21
21
  import "./chunk-EQ6HOWEJ.js";
22
22
  import "./chunk-OIQPORYI.js";
23
23
  import "./chunk-T27IEBNQ.js";
24
- import "./chunk-6BNXAFZD.js";
24
+ import "./chunk-2ORF5DS4.js";
25
25
  import "./chunk-N7J63Q6C.js";
26
26
  import "./chunk-ZKUATCEY.js";
27
27
  import "./chunk-NNWHHCVP.js";
@@ -20,12 +20,12 @@ import {
20
20
  switchDialogAgent,
21
21
  updateDialogTitle,
22
22
  updateTokens
23
- } from "./chunk-FS5HQTXA.js";
23
+ } from "./chunk-H442K6U4.js";
24
24
  import "./chunk-RCFIB45Q.js";
25
25
  import "./chunk-EGRJC4ZN.js";
26
26
  import "./chunk-YYLHWIW6.js";
27
27
  import "./chunk-CWMSB67P.js";
28
- import "./chunk-FLUK32AS.js";
28
+ import "./chunk-LWVOFTNC.js";
29
29
  import "./chunk-FH7VUJN5.js";
30
30
  import {
31
31
  getActiveDialogAgentId
@@ -26,12 +26,12 @@ import "./chunk-YDTYDA5W.js";
26
26
  import "./chunk-X2DAEZ3X.js";
27
27
  import "./chunk-EKLRRZIN.js";
28
28
  import "./chunk-VF4K2QE6.js";
29
- import "./chunk-33TKEKZL.js";
29
+ import "./chunk-CIHJW5VX.js";
30
30
  import "./chunk-ZNFJWEN4.js";
31
31
  import "./chunk-EQ6HOWEJ.js";
32
32
  import "./chunk-OIQPORYI.js";
33
33
  import "./chunk-T27IEBNQ.js";
34
- import "./chunk-6BNXAFZD.js";
34
+ import "./chunk-2ORF5DS4.js";
35
35
  import "./chunk-N7J63Q6C.js";
36
36
  import "./chunk-ZKUATCEY.js";
37
37
  import "./chunk-NNWHHCVP.js";
@@ -19,12 +19,12 @@ import "./chunk-X2DAEZ3X.js";
19
19
  import "./chunk-EKLRRZIN.js";
20
20
  import "./chunk-KQHGZWSV.js";
21
21
  import "./chunk-VF4K2QE6.js";
22
- import "./chunk-33TKEKZL.js";
22
+ import "./chunk-CIHJW5VX.js";
23
23
  import "./chunk-ZNFJWEN4.js";
24
24
  import "./chunk-EQ6HOWEJ.js";
25
25
  import "./chunk-OIQPORYI.js";
26
26
  import "./chunk-T27IEBNQ.js";
27
- import "./chunk-6BNXAFZD.js";
27
+ import "./chunk-2ORF5DS4.js";
28
28
  import "./chunk-N7J63Q6C.js";
29
29
  import "./chunk-ZKUATCEY.js";
30
30
  import "./chunk-NNWHHCVP.js";
@@ -14,12 +14,12 @@ import "./chunk-YDTYDA5W.js";
14
14
  import "./chunk-X2DAEZ3X.js";
15
15
  import "./chunk-EKLRRZIN.js";
16
16
  import "./chunk-VF4K2QE6.js";
17
- import "./chunk-33TKEKZL.js";
17
+ import "./chunk-CIHJW5VX.js";
18
18
  import "./chunk-ZNFJWEN4.js";
19
19
  import "./chunk-EQ6HOWEJ.js";
20
20
  import "./chunk-OIQPORYI.js";
21
21
  import "./chunk-T27IEBNQ.js";
22
- import "./chunk-6BNXAFZD.js";
22
+ import "./chunk-2ORF5DS4.js";
23
23
  import "./chunk-N7J63Q6C.js";
24
24
  import "./chunk-ZKUATCEY.js";
25
25
  import "./chunk-NNWHHCVP.js";
@@ -24,16 +24,16 @@ import {
24
24
  updateTitleDoc,
25
25
  useDocField,
26
26
  useDocState
27
- } from "./chunk-MNG4T5EG.js";
28
- import "./chunk-KJRULCTO.js";
27
+ } from "./chunk-V5EN447C.js";
28
+ import "./chunk-6XYCMONZ.js";
29
29
  import "./chunk-M3JEW6N6.js";
30
30
  import "./chunk-IDAU4UFS.js";
31
- import "./chunk-FS5HQTXA.js";
31
+ import "./chunk-H442K6U4.js";
32
32
  import "./chunk-RCFIB45Q.js";
33
33
  import "./chunk-EGRJC4ZN.js";
34
34
  import "./chunk-YYLHWIW6.js";
35
35
  import "./chunk-CWMSB67P.js";
36
- import "./chunk-FLUK32AS.js";
36
+ import "./chunk-LWVOFTNC.js";
37
37
  import "./chunk-FH7VUJN5.js";
38
38
  import "./chunk-5RGU3J7P.js";
39
39
  import "./chunk-M76ECQRD.js";
@@ -25,12 +25,12 @@ import "./chunk-YDTYDA5W.js";
25
25
  import "./chunk-X2DAEZ3X.js";
26
26
  import "./chunk-EKLRRZIN.js";
27
27
  import "./chunk-VF4K2QE6.js";
28
- import "./chunk-33TKEKZL.js";
28
+ import "./chunk-CIHJW5VX.js";
29
29
  import "./chunk-ZNFJWEN4.js";
30
30
  import "./chunk-EQ6HOWEJ.js";
31
31
  import "./chunk-OIQPORYI.js";
32
32
  import "./chunk-T27IEBNQ.js";
33
- import "./chunk-6BNXAFZD.js";
33
+ import "./chunk-2ORF5DS4.js";
34
34
  import "./chunk-N7J63Q6C.js";
35
35
  import "./chunk-ZKUATCEY.js";
36
36
  import "./chunk-NNWHHCVP.js";
@@ -2,14 +2,14 @@ import {
2
2
  messageStreamEnd,
3
3
  prepareAndPersistUserMessage,
4
4
  resolveHandleSendMessageContext
5
- } from "./chunk-FS5HQTXA.js";
5
+ } from "./chunk-H442K6U4.js";
6
6
  import "./chunk-RCFIB45Q.js";
7
7
  import "./chunk-EGRJC4ZN.js";
8
8
  import "./chunk-YYLHWIW6.js";
9
9
  import "./chunk-CWMSB67P.js";
10
10
  import {
11
11
  streamAgentChatTurn
12
- } from "./chunk-FLUK32AS.js";
12
+ } from "./chunk-LWVOFTNC.js";
13
13
  import "./chunk-FH7VUJN5.js";
14
14
  import "./chunk-5RGU3J7P.js";
15
15
  import "./chunk-M76ECQRD.js";