nolo-cli 0.50.0-alpha.1 → 0.52.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.
@@ -8,8 +8,8 @@ import {
8
8
  } from "./chunk-LYGNQHUW.js";
9
9
  import {
10
10
  runAgentCreateCommand
11
- } from "./chunk-FTSPVLKJ.js";
12
- import "./chunk-27MWS6HD.js";
11
+ } from "./chunk-Z2OCOUGR.js";
12
+ import "./chunk-W3GYW6NZ.js";
13
13
  import "./chunk-3YVCM5PE.js";
14
14
  import "./chunk-EADNWBAZ.js";
15
15
  import "./chunk-NI2BS6UD.js";
@@ -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-UODRJY63.js");
87
+ const { handleConnectorRunMessage } = await import("./machineWsRunDispatch-GUYB43AQ.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-FTSPVLKJ.js";
6
- import "./chunk-27MWS6HD.js";
5
+ } from "./chunk-Z2OCOUGR.js";
6
+ import "./chunk-W3GYW6NZ.js";
7
7
  import "./chunk-3YVCM5PE.js";
8
8
  import "./chunk-EADNWBAZ.js";
9
9
  import "./chunk-NI2BS6UD.js";
@@ -5,12 +5,12 @@ import {
5
5
  prependSubjectDialogMarker,
6
6
  resolveWorkflowReference,
7
7
  runAgentRunCommand
8
- } from "./chunk-WWXZYFWM.js";
8
+ } from "./chunk-LQXYIEDC.js";
9
9
  import "./chunk-J3UALFHL.js";
10
10
  import {
11
11
  parseAgentRunArgs
12
12
  } from "./chunk-LYGNQHUW.js";
13
- import "./chunk-27MWS6HD.js";
13
+ import "./chunk-W3GYW6NZ.js";
14
14
  import "./chunk-3YVCM5PE.js";
15
15
  import "./chunk-EADNWBAZ.js";
16
16
  import "./chunk-NI2BS6UD.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-27MWS6HD.js";
4
+ } from "./chunk-W3GYW6NZ.js";
5
5
  import {
6
6
  clipMultilineText
7
7
  } from "./chunk-72COHDZR.js";
@@ -19,7 +19,7 @@ import {
19
19
  parseAgentRunEvent,
20
20
  t,
21
21
  toolLabel
22
- } from "./chunk-27MWS6HD.js";
22
+ } from "./chunk-W3GYW6NZ.js";
23
23
  import {
24
24
  getReadableCliDb
25
25
  } from "./chunk-43CXXVJD.js";
@@ -5515,6 +5515,62 @@ async function loadRunLocalAgentTurn() {
5515
5515
  const { runLocalAgentTurn } = await import("./agentRuntimeLocal-SIQYQGSK.js");
5516
5516
  return runLocalAgentTurn;
5517
5517
  }
5518
+ var stripDebugNoise = (s) => s.replace(/\s*raw="[\s\S]*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
5519
+ function extractEmbeddedErrorMessage(message) {
5520
+ const match = /"message"\s*:\s*"((?:[^"\\]|\\.)*)"/.exec(message);
5521
+ if (!match) return void 0;
5522
+ try {
5523
+ const decoded = JSON.parse(`"${match[1]}"`);
5524
+ if (typeof decoded !== "string" || !decoded.trim()) return void 0;
5525
+ const cleaned = decoded.replace(/[\u0000-\u001f\u007f]/g, "");
5526
+ return cleaned.trim() ? cleaned : void 0;
5527
+ } catch {
5528
+ return void 0;
5529
+ }
5530
+ }
5531
+ function parseEmbeddedBalanceDetails(message) {
5532
+ const jsonStart = message.indexOf('{"error"');
5533
+ if (jsonStart < 0) return void 0;
5534
+ try {
5535
+ let depth = 0;
5536
+ let inString = false;
5537
+ let escaped = false;
5538
+ let jsonEnd = -1;
5539
+ for (let i = jsonStart; i < message.length; i += 1) {
5540
+ const char = message[i];
5541
+ if (inString) {
5542
+ if (escaped) escaped = false;
5543
+ else if (char === "\\") escaped = true;
5544
+ else if (char === '"') inString = false;
5545
+ } else if (char === '"') {
5546
+ inString = true;
5547
+ } else if (char === "{") {
5548
+ depth += 1;
5549
+ } else if (char === "}" && --depth === 0) {
5550
+ jsonEnd = i + 1;
5551
+ break;
5552
+ }
5553
+ }
5554
+ if (jsonEnd < 0) return void 0;
5555
+ const parsed = JSON.parse(message.slice(jsonStart, jsonEnd));
5556
+ if (!parsed || typeof parsed !== "object") return void 0;
5557
+ const error = parsed.error;
5558
+ if (!error || typeof error !== "object") return void 0;
5559
+ const details = error.details;
5560
+ if (!details || typeof details !== "object") return void 0;
5561
+ const requiredBalance = details.requiredBalance;
5562
+ const currentBalance = details.currentBalance;
5563
+ if (typeof requiredBalance !== "number" || typeof currentBalance !== "number") {
5564
+ return void 0;
5565
+ }
5566
+ if (!Number.isFinite(requiredBalance) || !Number.isFinite(currentBalance) || requiredBalance <= 0) {
5567
+ return void 0;
5568
+ }
5569
+ return { required: String(requiredBalance), current: String(currentBalance) };
5570
+ } catch {
5571
+ return void 0;
5572
+ }
5573
+ }
5518
5574
  async function resolveCurrentMachineId(options) {
5519
5575
  return options.currentMachineIdResolver ? options.currentMachineIdResolver(options.env) : detectCurrentMachineId(options.env);
5520
5576
  }
@@ -5745,7 +5801,6 @@ function describeLocalRunFailure(message, rawError) {
5745
5801
  busyDetail = rawError.detail.trim();
5746
5802
  }
5747
5803
  if (/PLATFORM_LLM_BUSY|服务器紧张/.test(message)) {
5748
- const stripDebugNoise = (s) => s.replace(/\s*raw=".*"/g, "").replace(/\s*raw=\S+/g, "").replace(/\s*headers=\[[^\]]*\]/g, "").replace(/\s*headers=\S+/g, "").trim();
5749
5804
  const shown = stripDebugNoise(
5750
5805
  message.replace(/\s*\(PLATFORM_LLM_BUSY\)\s*$/, "")
5751
5806
  );
@@ -5756,7 +5811,18 @@ function describeLocalRunFailure(message, rawError) {
5756
5811
  if (/UPSTREAM_402|Insufficient Balance|余额不足|insufficient\s+balance/i.test(
5757
5812
  message
5758
5813
  )) {
5759
- return `${RUN_UNAVAILABLE_PREFIX} (${message}). ${NO_FALLBACK} Top up your balance, then send again (or say "\u7EE7\u7EED") \u2014 if a dialog was kept, context is preserved.
5814
+ const cleanedMessage = stripDebugNoise(message);
5815
+ const fallback = cleanedMessage.replace(
5816
+ /^[^:]*provider failed: HTTP \d{3}\s*/,
5817
+ ""
5818
+ );
5819
+ const balanceDetails = parseEmbeddedBalanceDetails(cleanedMessage);
5820
+ const shownMessage = balanceDetails ? t(
5821
+ "balanceInsufficientReason",
5822
+ balanceDetails.required,
5823
+ balanceDetails.current
5824
+ ) : extractEmbeddedErrorMessage(cleanedMessage) ?? fallback;
5825
+ return `[nolo] ${shownMessage}
5760
5826
  `;
5761
5827
  }
5762
5828
  const cls = classifyLocalRunError(message);
@@ -472,8 +472,12 @@ var STRINGS = {
472
472
  zh: "[nolo] \u5F53\u524D agent \u4F3C\u4E4E\u989D\u5EA6/\u901F\u7387\u53D7\u9650\uFF08429\uFF09\u3002\n\u53EF\u4EE5\u7528 /agent \u5207\u6362\u5230\u5176\u4ED6 agent \u540E\u7EE7\u7EED\uFF0C\u540C\u4E00\u5BF9\u8BDD\u4F1A\u4FDD\u7559\u4E0A\u4E0B\u6587\u3002"
473
473
  },
474
474
  balanceExhaustedHint: {
475
- en: '[nolo] Insufficient balance. Your message is saved in this dialog \u2014 top up, then send again or say "continue".',
476
- zh: "[nolo] \u4F59\u989D\u4E0D\u8DB3\u3002\u4F60\u521A\u53D1\u7684\u8BDD\u5DF2\u4FDD\u5B58\u5728\u5F53\u524D\u5BF9\u8BDD\u91CC\u2014\u2014\u5145\u503C\u540E\u76F4\u63A5\u518D\u8BF4\u4E00\u53E5\u6216\u8BF4\u300C\u7EE7\u7EED\u300D\u5373\u53EF\uFF0C\u4E0D\u4F1A\u4E22\u4E0A\u4E0B\u6587\u3002"
475
+ en: '[nolo] Your message is saved in this dialog \u2014 top up, then send again or say "continue" to pick up where you left off.',
476
+ zh: "[nolo] \u4F60\u521A\u53D1\u7684\u8BDD\u5DF2\u4FDD\u5B58\u5728\u5F53\u524D\u5BF9\u8BDD\u91CC\u2014\u2014\u5145\u503C\u540E\u76F4\u63A5\u518D\u8BF4\u4E00\u53E5\u6216\u8BF4\u300C\u7EE7\u7EED\u300D\u5373\u53EF\u63A5\u7740\u804A\uFF0C\u4E0D\u4F1A\u4E22\u4E0A\u4E0B\u6587\u3002"
477
+ },
478
+ balanceInsufficientReason: {
479
+ en: "Insufficient balance: requires > {required}, current balance {current}.",
480
+ zh: "\u4F59\u989D\u4E0D\u8DB3\uFF1A\u9700\u8981\u4F59\u989D > {required}\uFF0C\u5F53\u524D {current}\u3002"
477
481
  },
478
482
  dialogPreservedHint: {
479
483
  en: '[nolo] This turn failed, but the dialog is kept. Send another message (or say "continue") to keep going in the same conversation.',
@@ -1090,8 +1094,9 @@ Use /switch, /switch list, /switch minimax-m3, or a full agent key.`,
1090
1094
  function t(key, ...params) {
1091
1095
  const text = STRINGS[key][currentLocale];
1092
1096
  if (params.length === 0) return text;
1093
- return text.replace(/\{(\d+)\}/g, (match, index) => {
1094
- const replacement = params[Number(index)];
1097
+ return text.replace(/\{(\d+|required|current)\}/g, (match, name) => {
1098
+ const index = name === "required" ? 0 : name === "current" ? 1 : Number(name);
1099
+ const replacement = params[index];
1095
1100
  return replacement === void 0 ? match : replacement;
1096
1101
  });
1097
1102
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearCliLocalRuntimePreparedAgentCache
3
- } from "./chunk-27MWS6HD.js";
3
+ } from "./chunk-W3GYW6NZ.js";
4
4
  import {
5
5
  getReadableCliDb
6
6
  } from "./chunk-43CXXVJD.js";
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-4AXTA7MR.js");
130
+ const { runAgentRunCommand } = await import("./agentRunCommand-MXZGNSA3.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-OXC6JSH6.js");
146
+ const { runAgentCreateCommand } = await import("./agentRecordCommands-XDMCGNPQ.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-OXC6JSH6.js");
158
+ const { runAgentReadCommand } = await import("./agentRecordCommands-XDMCGNPQ.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-OXC6JSH6.js");
196
+ const { runAgentUpdateCommand } = await import("./agentRecordCommands-XDMCGNPQ.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-5TEW64UO.js");
200
+ const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-3AGHYFVG.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-5TEW64UO.js");
204
+ const { runAgentEmailBindCommand } = await import("./agentEmailCommands-3AGHYFVG.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-5TEW64UO.js");
208
+ const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-3AGHYFVG.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-5TEW64UO.js");
215
+ const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-3AGHYFVG.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-4LQF5YB5.js");
236
+ const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-KUB2M4KB.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-4LQF5YB5.js");
240
+ const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-KUB2M4KB.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-4LQF5YB5.js");
244
+ const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-KUB2M4KB.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-FMMFBMCQ.js");
429
+ const { runMachineConnectCommand } = await import("./machineCommands-JZVC7JEX.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-FMMFBMCQ.js");
433
+ const { runMachineConnectCommand } = await import("./machineCommands-JZVC7JEX.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-FMMFBMCQ.js");
437
+ const { runMachineStatusCommand } = await import("./machineCommands-JZVC7JEX.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-GVDEA7RH.js");
827
+ const { startTuiWorkspace } = await import("./readlineWorkspace-76MBPA5B.js");
828
828
  const { createTuiSummaryLlmCaller } = await import("./tuiSummaryLlmCaller-U4EGD2SX.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-HIDPTO4B.js";
5
+ } from "./chunk-5UVEQ7GT.js";
6
6
  import {
7
7
  isConnectorWebSocketAuthError,
8
8
  isConnectorWebSocketRetryableError,
9
9
  resolveConnectorWebSocketTarget
10
10
  } from "./chunk-ALXHV7NK.js";
11
- import "./chunk-27MWS6HD.js";
11
+ import "./chunk-W3GYW6NZ.js";
12
12
  import "./chunk-3YVCM5PE.js";
13
13
  import "./chunk-EADNWBAZ.js";
14
14
  import "./chunk-NI2BS6UD.js";
@@ -11,8 +11,8 @@ import {
11
11
  runtimeWorkspacePermissionPolicy,
12
12
  scopePermissionPolicyToRuntimeWorkspace,
13
13
  summarizeAgentConfigForLogs
14
- } from "./chunk-HIDPTO4B.js";
15
- import "./chunk-27MWS6HD.js";
14
+ } from "./chunk-5UVEQ7GT.js";
15
+ import "./chunk-W3GYW6NZ.js";
16
16
  import "./chunk-3YVCM5PE.js";
17
17
  import "./chunk-EADNWBAZ.js";
18
18
  import "./chunk-NI2BS6UD.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nolo-cli",
3
- "version": "0.50.0-alpha.1",
3
+ "version": "0.52.0-alpha.1",
4
4
  "type": "module",
5
5
  "description": "Agent-first terminal workspace for Nolo",
6
6
  "bin": {
@@ -64,7 +64,7 @@ import {
64
64
  wrapTextToLines,
65
65
  wrapTranscriptLine,
66
66
  wrapTranscriptLineWithLayout
67
- } from "./chunk-WWXZYFWM.js";
67
+ } from "./chunk-LQXYIEDC.js";
68
68
  import {
69
69
  listFavoriteAgentIdsAcrossServers,
70
70
  listLocalCachedAgents,
@@ -86,7 +86,7 @@ import {
86
86
  readTimestamp,
87
87
  setCliLocale,
88
88
  t
89
- } from "./chunk-27MWS6HD.js";
89
+ } from "./chunk-W3GYW6NZ.js";
90
90
  import "./chunk-3YVCM5PE.js";
91
91
  import "./chunk-EADNWBAZ.js";
92
92
  import "./chunk-NI2BS6UD.js";