nolo-cli 0.37.0-alpha.4 → 0.38.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.
@@ -4,12 +4,12 @@ import {
4
4
  } from "./chunk-W445DPVT.js";
5
5
  import {
6
6
  runAgentCreateCommand
7
- } from "./chunk-5OXHHCUI.js";
7
+ } from "./chunk-LZZQTQPY.js";
8
8
  import {
9
9
  positionalArgs,
10
10
  readFlagValue
11
11
  } from "./chunk-4AWH4LQA.js";
12
- import "./chunk-QKCJPJNO.js";
12
+ import "./chunk-TH7ZZKPJ.js";
13
13
  import "./chunk-IZNJDUJ4.js";
14
14
  import "./chunk-6XG52ZQ6.js";
15
15
  import {
@@ -84,7 +84,7 @@ async function defaultExecuteCli(provider, prompt, options) {
84
84
  return executeCli(provider, prompt, options);
85
85
  }
86
86
  async function forwardConnectorRunMessage(machine, message, pushMessage, executeCli, env, fetchImpl) {
87
- const { handleConnectorRunMessage } = await import("./machineWsRunDispatch-PHYQYE4Q.js");
87
+ const { handleConnectorRunMessage } = await import("./machineWsRunDispatch-EWA7J37I.js");
88
88
  return handleConnectorRunMessage(message, pushMessage, executeCli, env, fetchImpl);
89
89
  }
90
90
  async function detectLaunchableMachineInfo() {
@@ -2,8 +2,8 @@ import {
2
2
  runAgentCreateCommand,
3
3
  runAgentReadCommand,
4
4
  runAgentUpdateCommand
5
- } from "./chunk-5OXHHCUI.js";
6
- import "./chunk-QKCJPJNO.js";
5
+ } from "./chunk-LZZQTQPY.js";
6
+ import "./chunk-TH7ZZKPJ.js";
7
7
  import "./chunk-IZNJDUJ4.js";
8
8
  import "./chunk-6XG52ZQ6.js";
9
9
  import "./chunk-UNHKVD2N.js";
@@ -5,12 +5,12 @@ import {
5
5
  prependSubjectDialogMarker,
6
6
  resolveWorkflowReference,
7
7
  runAgentRunCommand
8
- } from "./chunk-PEEWLG6V.js";
8
+ } from "./chunk-45NBTCS2.js";
9
9
  import "./chunk-IMHO5LC6.js";
10
10
  import {
11
11
  parseAgentRunArgs
12
12
  } from "./chunk-4AWH4LQA.js";
13
- import "./chunk-QKCJPJNO.js";
13
+ import "./chunk-TH7ZZKPJ.js";
14
14
  import "./chunk-IZNJDUJ4.js";
15
15
  import "./chunk-6XG52ZQ6.js";
16
16
  import "./chunk-UNHKVD2N.js";
@@ -20,7 +20,7 @@ import {
20
20
  parseAgentRunEvent,
21
21
  t,
22
22
  toolLabel
23
- } from "./chunk-QKCJPJNO.js";
23
+ } from "./chunk-TH7ZZKPJ.js";
24
24
  import {
25
25
  getReadableCliDb
26
26
  } from "./chunk-UNHKVD2N.js";
@@ -5589,8 +5589,12 @@ function describeLocalRunFailure(message, rawError) {
5589
5589
  busyDetail = rawError.detail.trim();
5590
5590
  }
5591
5591
  if (/PLATFORM_LLM_BUSY|服务器紧张/.test(message)) {
5592
- const shown = message.replace(/\s*\(PLATFORM_LLM_BUSY\)\s*$/, "");
5593
- return `${RUN_UNAVAILABLE_PREFIX} \u670D\u52A1\u5668\u7D27\u5F20${shown !== "\u670D\u52A1\u5668\u7D27\u5F20" ? ` (${shown})` : ""} (PLATFORM_LLM_BUSY)${busyDetail ? `: ${busyDetail}` : ""}. ${NO_FALLBACK} \u5E73\u53F0\u6A21\u578B\u4E0A\u6E38\u7E41\u5FD9\uFF0C\u7A0D\u540E\u91CD\u8BD5\u6216\u6362\u4E2A\u6A21\u578B\u3002
5592
+ const stripDebugNoise = (s) => s.replace(/\s*raw=".*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
5593
+ const shown = stripDebugNoise(
5594
+ message.replace(/\s*\(PLATFORM_LLM_BUSY\)\s*$/, "")
5595
+ );
5596
+ const cleanedBusyDetail = busyDetail ? stripDebugNoise(busyDetail) : void 0;
5597
+ return `${RUN_UNAVAILABLE_PREFIX} \u670D\u52A1\u5668\u7D27\u5F20${shown !== "\u670D\u52A1\u5668\u7D27\u5F20" ? ` (${shown})` : ""} (PLATFORM_LLM_BUSY)${cleanedBusyDetail ? `: ${cleanedBusyDetail}` : ""}. ${NO_FALLBACK} \u5E73\u53F0\u6A21\u578B\u4E0A\u6E38\u7E41\u5FD9\uFF0C\u7A0D\u540E\u91CD\u8BD5\u6216\u6362\u4E2A\u6A21\u578B\u3002Retry shortly, ${SERVER_FALLBACK_HINT}
5594
5598
  `;
5595
5599
  }
5596
5600
  if (/UPSTREAM_402|Insufficient Balance|余额不足|insufficient\s+balance/i.test(
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-QKCJPJNO.js";
4
+ } from "./chunk-TH7ZZKPJ.js";
5
5
  import {
6
6
  clipMultilineText
7
7
  } from "./chunk-JK7UM3LT.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearCliLocalRuntimePreparedAgentCache
3
- } from "./chunk-QKCJPJNO.js";
3
+ } from "./chunk-TH7ZZKPJ.js";
4
4
  import {
5
5
  getReadableCliDb
6
6
  } from "./chunk-UNHKVD2N.js";
@@ -9372,7 +9372,7 @@ async function shouldRetryPlatformProxyResponse(response) {
9372
9372
  if (response.status !== 503) return false;
9373
9373
  try {
9374
9374
  const body = await response.clone().json();
9375
- return body?.reason === "core_draining";
9375
+ return body?.reason === "core_draining" || body?.retryable === true;
9376
9376
  } catch {
9377
9377
  return false;
9378
9378
  }
@@ -9552,9 +9552,17 @@ import { fileURLToPath } from "node:url";
9552
9552
  var PROVIDER_STREAM_RETRY_MAX_ATTEMPTS = 2;
9553
9553
  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";
9554
9554
  var UPSTREAM_STREAM_INTERRUPTED_RE = /UPSTREAM_STREAM_INTERRUPTED/i;
9555
+ var BUSY_STREAM_ERROR_RE = /PLATFORM_LLM_BUSY|服务器紧张/i;
9556
+ var BUSY_STREAM_RETRY_DELAY_MS = 1200;
9557
+ function isBusyProviderStreamError(error) {
9558
+ return BUSY_STREAM_ERROR_RE.test(toErrorMessage(error));
9559
+ }
9560
+ async function defaultSleep3(ms) {
9561
+ await new Promise((resolve) => setTimeout(resolve, ms));
9562
+ }
9555
9563
  function isRetryableProviderStreamError(error) {
9556
9564
  const message = toErrorMessage(error);
9557
- return UPSTREAM_STREAM_INTERRUPTED_RE.test(message) || isTransientFetchError(message);
9565
+ return UPSTREAM_STREAM_INTERRUPTED_RE.test(message) || BUSY_STREAM_ERROR_RE.test(message) || isTransientFetchError(message);
9558
9566
  }
9559
9567
  function withProviderStreamRetry(provider, deps) {
9560
9568
  return {
@@ -9583,11 +9591,17 @@ function withProviderStreamRetry(provider, deps) {
9583
9591
  if (options?.signal?.aborted) throw error;
9584
9592
  if (attempt >= PROVIDER_STREAM_RETRY_MAX_ATTEMPTS) throw error;
9585
9593
  if (!isRetryableProviderStreamError(error)) throw error;
9594
+ if (deps.retryOnly && !deps.retryOnly(error)) throw error;
9586
9595
  if (sawToolEvent) throw error;
9587
9596
  if (streamedChars > 0 && options?.onTextDelta) {
9588
9597
  options.onTextDelta(STREAM_RETRY_MARKER);
9589
9598
  }
9590
- deps.activityReporter?.("\u4E0A\u6E38\u6D41\u4E2D\u65AD \xB7 \u81EA\u52A8\u91CD\u8BD5");
9599
+ if (isBusyProviderStreamError(error)) {
9600
+ deps.activityReporter?.("\u670D\u52A1\u5668\u7D27\u5F20 \xB7 \u7A0D\u5019\u81EA\u52A8\u91CD\u8BD5");
9601
+ await (deps.sleep ?? defaultSleep3)(BUSY_STREAM_RETRY_DELAY_MS);
9602
+ } else {
9603
+ deps.activityReporter?.("\u4E0A\u6E38\u6D41\u4E2D\u65AD \xB7 \u81EA\u52A8\u91CD\u8BD5");
9604
+ }
9591
9605
  }
9592
9606
  }
9593
9607
  }
@@ -12246,7 +12260,10 @@ function createCliLocalRuntimeAdapter(deps) {
12246
12260
  const provider = await adapterBase.resolveProviderBase(
12247
12261
  agentConfig
12248
12262
  );
12249
- return shouldUsePlatformChatProvider(deps.env, agentConfig) ? provider : withProviderStreamRetry(provider, deps);
12263
+ return shouldUsePlatformChatProvider(deps.env, agentConfig) ? withProviderStreamRetry(provider, {
12264
+ ...deps,
12265
+ retryOnly: isBusyProviderStreamError
12266
+ }) : withProviderStreamRetry(provider, deps);
12250
12267
  }
12251
12268
  };
12252
12269
  }
package/index.js CHANGED
@@ -127,7 +127,7 @@ function createDaemonShortcutCommand(path, description, command2) {
127
127
  // packages/cli/agentInternalCommandEntries.ts
128
128
  function getAgentInternalCommandEntries() {
129
129
  const createAgentRunCommand = (path, description) => createContextCommand(path, description, async (args2, ctx) => {
130
- const { runAgentRunCommand } = await import("./agentRunCommand-5LLSNUAJ.js");
130
+ const { runAgentRunCommand } = await import("./agentRunCommand-4MEMHFT5.js");
131
131
  return runAgentRunCommand(args2, {
132
132
  env: ctx.env,
133
133
  scriptDir: ctx.scriptDir,
@@ -143,7 +143,7 @@ function getAgentInternalCommandEntries() {
143
143
  return runAgentListCommand(args2, deps);
144
144
  }),
145
145
  createEnvCommand(["agent", "create"], "Create a new agent", async (args2, deps) => {
146
- const { runAgentCreateCommand } = await import("./agentRecordCommands-ZHH7KRWS.js");
146
+ const { runAgentCreateCommand } = await import("./agentRecordCommands-GJHH5GYI.js");
147
147
  return runAgentCreateCommand(args2, deps);
148
148
  }),
149
149
  createEnvCommand(["agent", "models"], "List models available on an OpenAI-compatible provider", async (args2, deps) => {
@@ -155,7 +155,7 @@ function getAgentInternalCommandEntries() {
155
155
  return runAgentPullCommand(args2, deps);
156
156
  }),
157
157
  createEnvCommand(["agent", "read"], "Read a single agent", async (args2, deps) => {
158
- const { runAgentReadCommand } = await import("./agentRecordCommands-ZHH7KRWS.js");
158
+ const { runAgentReadCommand } = await import("./agentRecordCommands-GJHH5GYI.js");
159
159
  return runAgentReadCommand(args2, deps);
160
160
  }),
161
161
  createAgentRunCommand(["agent", "run"], "Run an agent"),
@@ -193,26 +193,26 @@ function getAgentInternalCommandEntries() {
193
193
  return runSetupOfflineMarxistsAgentCommand(args2, deps);
194
194
  }),
195
195
  createEnvCommand(["agent", "update"], "Update agent fields", async (args2, deps) => {
196
- const { runAgentUpdateCommand } = await import("./agentRecordCommands-ZHH7KRWS.js");
196
+ const { runAgentUpdateCommand } = await import("./agentRecordCommands-GJHH5GYI.js");
197
197
  return runAgentUpdateCommand(args2, deps);
198
198
  }),
199
199
  createEnvCommand(["agent", "email", "provision"], "Provision a controlled inbox for an agent", async (args2, deps) => {
200
- const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-C6G4F4JL.js");
200
+ const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-NGL5B3UC.js");
201
201
  return runAgentEmailProvisionCommand(args2, deps);
202
202
  }),
203
203
  createEnvCommand(["agent", "email", "bind"], "Bind an existing email address to an agent", async (args2, deps) => {
204
- const { runAgentEmailBindCommand } = await import("./agentEmailCommands-C6G4F4JL.js");
204
+ const { runAgentEmailBindCommand } = await import("./agentEmailCommands-NGL5B3UC.js");
205
205
  return runAgentEmailBindCommand(args2, deps);
206
206
  }),
207
207
  createEnvCommand(["agent", "email", "transfer"], "Transfer an email identity from one agent to another (cross-account)", async (args2, deps) => {
208
- const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-C6G4F4JL.js");
208
+ const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-NGL5B3UC.js");
209
209
  return runAgentEmailTransferCommand(args2, deps);
210
210
  }),
211
211
  createEnvCommand(
212
212
  ["agent", "email", "create-and-provision"],
213
213
  "Create an agent and provision its controlled inbox",
214
214
  async (args2, deps) => {
215
- const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-C6G4F4JL.js");
215
+ const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-NGL5B3UC.js");
216
216
  return runAgentEmailCreateAndProvisionCommand(args2, deps);
217
217
  }
218
218
  ),
@@ -233,15 +233,15 @@ function getAgentInternalCommandEntries() {
233
233
  return runAgentRevokeGrantCommand(args2, deps);
234
234
  }),
235
235
  createEnvCommand(["agent", "bind-current"], "Bind an agent to this machine", async (args2, deps) => {
236
- const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-JGA4C6ZZ.js");
236
+ const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-AXOO4OKN.js");
237
237
  return runAgentBindCurrentCommand(args2, deps);
238
238
  }),
239
239
  createEnvCommand(["agent", "smoke-current"], "Smoke test a bound agent through this machine", async (args2, deps) => {
240
- const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-JGA4C6ZZ.js");
240
+ const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-AXOO4OKN.js");
241
241
  return runAgentSmokeCurrentCommand(args2, deps);
242
242
  }),
243
243
  createEnvCommand(["agent", "runtime-doctor"], "Diagnose current machine runtime compatibility", async (args2, deps) => {
244
- const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-JGA4C6ZZ.js");
244
+ const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-AXOO4OKN.js");
245
245
  return runAgentRuntimeDoctorCommand(args2, deps);
246
246
  }),
247
247
  createAgentRunCommand(["agent", "chat"], "Chat with an agent")
@@ -426,15 +426,15 @@ function getSystemInternalCommandEntries(renderHelpText2) {
426
426
  return runWhoamiCommand({ args: args2, env: ctx.env });
427
427
  }),
428
428
  createEntrypointEnvCommand(["connect"], "Send machine heartbeats or hold a connector websocket", async (args2, deps) => {
429
- const { runMachineConnectCommand } = await import("./machineCommands-FSLAJSUC.js");
429
+ const { runMachineConnectCommand } = await import("./machineCommands-NAFWPMLI.js");
430
430
  return runMachineConnectCommand(args2, deps);
431
431
  }),
432
432
  createDaemonShortcutCommand(["daemon"], "Run the connector daemon shortcut", async (args2, deps) => {
433
- const { runMachineConnectCommand } = await import("./machineCommands-FSLAJSUC.js");
433
+ const { runMachineConnectCommand } = await import("./machineCommands-NAFWPMLI.js");
434
434
  return runMachineConnectCommand(args2, deps);
435
435
  }),
436
436
  createEnvCommand(["machine", "status"], "List machines registered to the current profile", async (args2, deps) => {
437
- const { runMachineStatusCommand } = await import("./machineCommands-FSLAJSUC.js");
437
+ const { runMachineStatusCommand } = await import("./machineCommands-NAFWPMLI.js");
438
438
  return runMachineStatusCommand(args2, deps);
439
439
  }),
440
440
  createEnvCommand(["doctor", "runtime"], "Diagnose local-first agent runtime selection", async (args2, deps) => {
@@ -824,7 +824,7 @@ async function runScript(script, forwardedArgs, env) {
824
824
  return proc.exited;
825
825
  }
826
826
  async function launchTuiWorkspace(args2) {
827
- const { startTuiWorkspace } = await import("./readlineWorkspace-PLJJPDP2.js");
827
+ const { startTuiWorkspace } = await import("./readlineWorkspace-BCQVDX4V.js");
828
828
  const { createTuiSummaryLlmCaller } = await import("./tuiSummaryLlmCaller-SHRB4RWM.js");
829
829
  return startTuiWorkspace({
830
830
  ...args2,
@@ -2,13 +2,13 @@ import {
2
2
  buildMachinePermissionPromptBlock,
3
3
  handleConnectorRunMessage,
4
4
  resolveMachineRunPermissionPolicy
5
- } from "./chunk-55U32YAP.js";
5
+ } from "./chunk-GEGSCLZZ.js";
6
6
  import {
7
7
  isConnectorWebSocketAuthError,
8
8
  isConnectorWebSocketRetryableError,
9
9
  resolveConnectorWebSocketTarget
10
10
  } from "./chunk-MQRZ5QUH.js";
11
- import "./chunk-QKCJPJNO.js";
11
+ import "./chunk-TH7ZZKPJ.js";
12
12
  import "./chunk-IZNJDUJ4.js";
13
13
  import "./chunk-6XG52ZQ6.js";
14
14
  import "./chunk-J5NMOM35.js";
@@ -11,8 +11,8 @@ import {
11
11
  runtimeWorkspacePermissionPolicy,
12
12
  scopePermissionPolicyToRuntimeWorkspace,
13
13
  summarizeAgentConfigForLogs
14
- } from "./chunk-55U32YAP.js";
15
- import "./chunk-QKCJPJNO.js";
14
+ } from "./chunk-GEGSCLZZ.js";
15
+ import "./chunk-TH7ZZKPJ.js";
16
16
  import "./chunk-IZNJDUJ4.js";
17
17
  import "./chunk-6XG52ZQ6.js";
18
18
  import "./chunk-J5NMOM35.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nolo-cli",
3
- "version": "0.37.0-alpha.4",
3
+ "version": "0.38.0-alpha.1",
4
4
  "type": "module",
5
5
  "description": "Agent-first terminal workspace for Nolo",
6
6
  "bin": {
@@ -76,7 +76,7 @@ import {
76
76
  wrapTextToLines,
77
77
  wrapTranscriptLine,
78
78
  wrapTranscriptLineWithLayout
79
- } from "./chunk-PEEWLG6V.js";
79
+ } from "./chunk-45NBTCS2.js";
80
80
  import "./chunk-IMHO5LC6.js";
81
81
  import "./chunk-4AWH4LQA.js";
82
82
  import {
@@ -86,7 +86,7 @@ import {
86
86
  readTimestamp,
87
87
  setCliLocale,
88
88
  t
89
- } from "./chunk-QKCJPJNO.js";
89
+ } from "./chunk-TH7ZZKPJ.js";
90
90
  import "./chunk-IZNJDUJ4.js";
91
91
  import "./chunk-6XG52ZQ6.js";
92
92
  import {