nolo-cli 0.51.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-IPIJNOJJ.js";
12
- import "./chunk-BYFBW5FZ.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-UB2KMAXY.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-IPIJNOJJ.js";
6
- import "./chunk-BYFBW5FZ.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-RENO4QJU.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-BYFBW5FZ.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-BYFBW5FZ.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-BYFBW5FZ.js";
22
+ } from "./chunk-W3GYW6NZ.js";
23
23
  import {
24
24
  getReadableCliDb
25
25
  } from "./chunk-43CXXVJD.js";
@@ -5528,6 +5528,49 @@ function extractEmbeddedErrorMessage(message) {
5528
5528
  return void 0;
5529
5529
  }
5530
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
+ }
5531
5574
  async function resolveCurrentMachineId(options) {
5532
5575
  return options.currentMachineIdResolver ? options.currentMachineIdResolver(options.env) : detectCurrentMachineId(options.env);
5533
5576
  }
@@ -5773,7 +5816,12 @@ function describeLocalRunFailure(message, rawError) {
5773
5816
  /^[^:]*provider failed: HTTP \d{3}\s*/,
5774
5817
  ""
5775
5818
  );
5776
- const shownMessage = extractEmbeddedErrorMessage(cleanedMessage) ?? fallback;
5819
+ const balanceDetails = parseEmbeddedBalanceDetails(cleanedMessage);
5820
+ const shownMessage = balanceDetails ? t(
5821
+ "balanceInsufficientReason",
5822
+ balanceDetails.required,
5823
+ balanceDetails.current
5824
+ ) : extractEmbeddedErrorMessage(cleanedMessage) ?? fallback;
5777
5825
  return `[nolo] ${shownMessage}
5778
5826
  `;
5779
5827
  }
@@ -475,6 +475,10 @@ var STRINGS = {
475
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
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
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"
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.',
480
484
  zh: "[nolo] \u672C\u8F6E\u5931\u8D25\u4E86\uFF0C\u4F46\u5BF9\u8BDD\u5DF2\u4FDD\u7559\u3002\u76F4\u63A5\u518D\u8BF4\u4E00\u53E5\uFF08\u6216\u8BF4\u300C\u7EE7\u7EED\u300D\uFF09\u5373\u53EF\u5728\u540C\u4E00\u5BF9\u8BDD\u91CC\u63A5\u7740\u804A\u3002"
@@ -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-BYFBW5FZ.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-LK7BER3O.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-J4ENRTN4.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-J4ENRTN4.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-J4ENRTN4.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-FHBQ5QPA.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-FHBQ5QPA.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-FHBQ5QPA.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-FHBQ5QPA.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-LJ36TKS6.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-LJ36TKS6.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-LJ36TKS6.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-KYKZPZ4Q.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-KYKZPZ4Q.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-KYKZPZ4Q.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-D7UQATEL.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-VVZUMVYH.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-BYFBW5FZ.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-VVZUMVYH.js";
15
- import "./chunk-BYFBW5FZ.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.51.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-RENO4QJU.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-BYFBW5FZ.js";
89
+ } from "./chunk-W3GYW6NZ.js";
90
90
  import "./chunk-3YVCM5PE.js";
91
91
  import "./chunk-EADNWBAZ.js";
92
92
  import "./chunk-NI2BS6UD.js";