nolo-cli 0.16.0-alpha.3 → 0.16.0-alpha.4

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-DZ3XJVET.js";
9
9
  import {
10
10
  runAgentCreateCommand
11
- } from "./chunk-R2PO4VB4.js";
12
- import "./chunk-64E4G62G.js";
11
+ } from "./chunk-4CANFLI7.js";
12
+ import "./chunk-OLNFFJVY.js";
13
13
  import "./chunk-XXUNUXCS.js";
14
14
  import {
15
15
  getReadableCliDb
@@ -77,7 +77,7 @@ async function defaultExecuteCli(provider, prompt, options) {
77
77
  return executeCli(provider, prompt, options);
78
78
  }
79
79
  async function forwardConnectorRunMessage(machine, message, pushMessage, executeCli, env, fetchImpl) {
80
- const { handleConnectorRunMessage } = await import("./machineWsRunDispatch-OZMHQJ43.js");
80
+ const { handleConnectorRunMessage } = await import("./machineWsRunDispatch-7675PUSK.js");
81
81
  return handleConnectorRunMessage(message, pushMessage, executeCli, env, fetchImpl);
82
82
  }
83
83
  async function detectLaunchableMachineInfo() {
@@ -2,8 +2,8 @@ import {
2
2
  runAgentCreateCommand,
3
3
  runAgentReadCommand,
4
4
  runAgentUpdateCommand
5
- } from "./chunk-R2PO4VB4.js";
6
- import "./chunk-64E4G62G.js";
5
+ } from "./chunk-4CANFLI7.js";
6
+ import "./chunk-OLNFFJVY.js";
7
7
  import "./chunk-XXUNUXCS.js";
8
8
  import "./chunk-W4NVOSFF.js";
9
9
  import "./chunk-WNUSEMPU.js";
@@ -6,12 +6,12 @@ import {
6
6
  prependSubjectDialogMarker,
7
7
  resolveWorkflowReference,
8
8
  runAgentRunCommand
9
- } from "./chunk-Y6G5CIAW.js";
9
+ } from "./chunk-2ZDQ5PN5.js";
10
10
  import {
11
11
  parseAgentRunArgs
12
12
  } from "./chunk-DZ3XJVET.js";
13
13
  import "./chunk-6HYVJV7B.js";
14
- import "./chunk-64E4G62G.js";
14
+ import "./chunk-OLNFFJVY.js";
15
15
  import "./chunk-XXUNUXCS.js";
16
16
  import "./chunk-W4NVOSFF.js";
17
17
  import "./chunk-WNUSEMPU.js";
@@ -18,7 +18,7 @@ import {
18
18
  isBuiltinNoloAgentRef,
19
19
  t,
20
20
  toolLabel
21
- } from "./chunk-64E4G62G.js";
21
+ } from "./chunk-OLNFFJVY.js";
22
22
  import {
23
23
  getReadableCliDb
24
24
  } from "./chunk-W4NVOSFF.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearCliLocalRuntimePreparedAgentCache
3
- } from "./chunk-64E4G62G.js";
3
+ } from "./chunk-OLNFFJVY.js";
4
4
  import {
5
5
  getReadableCliDb
6
6
  } from "./chunk-W4NVOSFF.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-64E4G62G.js";
4
+ } from "./chunk-OLNFFJVY.js";
5
5
  import {
6
6
  clipMultilineText
7
7
  } from "./chunk-CT3XKUX4.js";
@@ -2772,25 +2772,38 @@ var CLAUDE_CODE_IDENTITY_PATTERNS = [
2772
2772
  function stringValue(value) {
2773
2773
  return typeof value === "string" && value.length > 0 ? value : void 0;
2774
2774
  }
2775
+ function isCacheControl(value) {
2776
+ return Boolean(
2777
+ value && typeof value === "object" && !Array.isArray(value) && typeof value.type === "string"
2778
+ );
2779
+ }
2775
2780
  function toAnthropicContent(content) {
2776
- if (typeof content === "string") return [{ type: "text", text: content }];
2781
+ if (typeof content === "string") {
2782
+ return content.length > 0 ? [{ type: "text", text: content }] : [];
2783
+ }
2777
2784
  if (!Array.isArray(content)) return [];
2778
2785
  const blocks = [];
2779
2786
  for (const raw of content) {
2780
2787
  if (!raw || typeof raw !== "object") continue;
2781
2788
  const part = raw;
2782
2789
  if ((part.type === "text" || part.type === "input_text") && typeof part.text === "string") {
2783
- blocks.push({ type: "text", text: part.text });
2790
+ if (part.text.length > 0) {
2791
+ const block2 = { type: "text", text: part.text };
2792
+ if (isCacheControl(part.cache_control)) block2.cache_control = part.cache_control;
2793
+ blocks.push(block2);
2794
+ }
2784
2795
  continue;
2785
2796
  }
2786
2797
  if (part.type !== "image_url") continue;
2787
2798
  const imageUrl = typeof part.image_url === "string" ? part.image_url : stringValue(part.image_url?.url);
2788
2799
  if (!imageUrl) continue;
2789
2800
  const dataMatch = imageUrl.match(/^data:([^;,]+);base64,(.+)$/s);
2790
- blocks.push({
2801
+ const block = {
2791
2802
  type: "image",
2792
2803
  source: dataMatch ? { type: "base64", media_type: dataMatch[1], data: dataMatch[2] } : { type: "url", url: imageUrl }
2793
- });
2804
+ };
2805
+ if (isCacheControl(part.cache_control)) block.cache_control = part.cache_control;
2806
+ blocks.push(block);
2794
2807
  }
2795
2808
  return blocks;
2796
2809
  }
@@ -2866,6 +2879,12 @@ function buildAnthropicMessagesBody(args) {
2866
2879
  if (!hasClaudeCodeIdentity(system)) {
2867
2880
  system.unshift({ type: "text", text: CLAUDE_CODE_SYSTEM_INSTRUCTION });
2868
2881
  }
2882
+ if (system.length > 0) {
2883
+ const last = system[system.length - 1];
2884
+ if (!isCacheControl(last.cache_control)) {
2885
+ last.cache_control = { type: "ephemeral" };
2886
+ }
2887
+ }
2869
2888
  const tools = Array.isArray(args.openAiBody.tools) ? args.openAiBody.tools.flatMap((raw) => {
2870
2889
  if (!raw || typeof raw !== "object") return [];
2871
2890
  const fn = raw.function;
@@ -2880,6 +2899,16 @@ function buildAnthropicMessagesBody(args) {
2880
2899
  const model = stringValue(args.openAiBody.model) ?? args.agentConfig.model ?? "claude-sonnet-5";
2881
2900
  const maxTokensRaw = args.openAiBody.max_completion_tokens ?? args.openAiBody.max_tokens ?? args.agentConfig.max_tokens;
2882
2901
  const maxTokens = typeof maxTokensRaw === "number" && Number.isFinite(maxTokensRaw) ? Math.max(1, Math.floor(maxTokensRaw)) : 8192;
2902
+ if (messages.length > 0) {
2903
+ const lastMessage = messages[messages.length - 1];
2904
+ const content = Array.isArray(lastMessage.content) ? lastMessage.content : [];
2905
+ if (content.length > 0) {
2906
+ const lastBlock = content[content.length - 1];
2907
+ if (!isCacheControl(lastBlock.cache_control)) {
2908
+ lastBlock.cache_control = { type: "ephemeral" };
2909
+ }
2910
+ }
2911
+ }
2883
2912
  return {
2884
2913
  model,
2885
2914
  messages,
package/index.js CHANGED
@@ -126,7 +126,7 @@ function createDaemonShortcutCommand(path, description, command2) {
126
126
  // packages/cli/agentInternalCommandEntries.ts
127
127
  function getAgentInternalCommandEntries() {
128
128
  const createAgentRunCommand = (path, description) => createContextCommand(path, description, async (args2, ctx) => {
129
- const { runAgentRunCommand } = await import("./agentRunCommand-37H22M3U.js");
129
+ const { runAgentRunCommand } = await import("./agentRunCommand-5M2V6PJT.js");
130
130
  return runAgentRunCommand(args2, {
131
131
  env: ctx.env,
132
132
  scriptDir: ctx.scriptDir,
@@ -142,7 +142,7 @@ function getAgentInternalCommandEntries() {
142
142
  return runAgentListCommand(args2, deps);
143
143
  }),
144
144
  createEnvCommand(["agent", "create"], "Create a new agent", async (args2, deps) => {
145
- const { runAgentCreateCommand } = await import("./agentRecordCommands-VABNJQU5.js");
145
+ const { runAgentCreateCommand } = await import("./agentRecordCommands-MV6SFG6W.js");
146
146
  return runAgentCreateCommand(args2, deps);
147
147
  }),
148
148
  createEnvCommand(["agent", "pull"], "Cache an agent for local runs", async (args2, deps) => {
@@ -150,7 +150,7 @@ function getAgentInternalCommandEntries() {
150
150
  return runAgentPullCommand(args2, deps);
151
151
  }),
152
152
  createEnvCommand(["agent", "read"], "Read a single agent", async (args2, deps) => {
153
- const { runAgentReadCommand } = await import("./agentRecordCommands-VABNJQU5.js");
153
+ const { runAgentReadCommand } = await import("./agentRecordCommands-MV6SFG6W.js");
154
154
  return runAgentReadCommand(args2, deps);
155
155
  }),
156
156
  createAgentRunCommand(["agent", "run"], "Run an agent"),
@@ -179,26 +179,26 @@ function getAgentInternalCommandEntries() {
179
179
  return runSetupOfflineMarxistsAgentCommand(args2, deps);
180
180
  }),
181
181
  createEnvCommand(["agent", "update"], "Update agent fields", async (args2, deps) => {
182
- const { runAgentUpdateCommand } = await import("./agentRecordCommands-VABNJQU5.js");
182
+ const { runAgentUpdateCommand } = await import("./agentRecordCommands-MV6SFG6W.js");
183
183
  return runAgentUpdateCommand(args2, deps);
184
184
  }),
185
185
  createEnvCommand(["agent", "email", "provision"], "Provision a controlled inbox for an agent", async (args2, deps) => {
186
- const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-H3VL4WUZ.js");
186
+ const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-A4U3WMMS.js");
187
187
  return runAgentEmailProvisionCommand(args2, deps);
188
188
  }),
189
189
  createEnvCommand(["agent", "email", "bind"], "Bind an existing email address to an agent", async (args2, deps) => {
190
- const { runAgentEmailBindCommand } = await import("./agentEmailCommands-H3VL4WUZ.js");
190
+ const { runAgentEmailBindCommand } = await import("./agentEmailCommands-A4U3WMMS.js");
191
191
  return runAgentEmailBindCommand(args2, deps);
192
192
  }),
193
193
  createEnvCommand(["agent", "email", "transfer"], "Transfer an email identity from one agent to another (cross-account)", async (args2, deps) => {
194
- const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-H3VL4WUZ.js");
194
+ const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-A4U3WMMS.js");
195
195
  return runAgentEmailTransferCommand(args2, deps);
196
196
  }),
197
197
  createEnvCommand(
198
198
  ["agent", "email", "create-and-provision"],
199
199
  "Create an agent and provision its controlled inbox",
200
200
  async (args2, deps) => {
201
- const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-H3VL4WUZ.js");
201
+ const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-A4U3WMMS.js");
202
202
  return runAgentEmailCreateAndProvisionCommand(args2, deps);
203
203
  }
204
204
  ),
@@ -219,15 +219,15 @@ function getAgentInternalCommandEntries() {
219
219
  return runAgentRevokeGrantCommand(args2, deps);
220
220
  }),
221
221
  createEnvCommand(["agent", "bind-current"], "Bind an agent to this machine", async (args2, deps) => {
222
- const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-QJPXHLIG.js");
222
+ const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-VFFEYHWZ.js");
223
223
  return runAgentBindCurrentCommand(args2, deps);
224
224
  }),
225
225
  createEnvCommand(["agent", "smoke-current"], "Smoke test a bound agent through this machine", async (args2, deps) => {
226
- const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-QJPXHLIG.js");
226
+ const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-VFFEYHWZ.js");
227
227
  return runAgentSmokeCurrentCommand(args2, deps);
228
228
  }),
229
229
  createEnvCommand(["agent", "runtime-doctor"], "Diagnose current machine runtime compatibility", async (args2, deps) => {
230
- const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-QJPXHLIG.js");
230
+ const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-VFFEYHWZ.js");
231
231
  return runAgentRuntimeDoctorCommand(args2, deps);
232
232
  }),
233
233
  createAgentRunCommand(["agent", "chat"], "Chat with an agent")
@@ -408,15 +408,15 @@ function getSystemInternalCommandEntries(renderHelpText2) {
408
408
  return runWhoamiCommand({ args: args2, env: ctx.env });
409
409
  }),
410
410
  createEntrypointEnvCommand(["connect"], "Send machine heartbeats or hold a connector websocket", async (args2, deps) => {
411
- const { runMachineConnectCommand } = await import("./machineCommands-3XWBAXZL.js");
411
+ const { runMachineConnectCommand } = await import("./machineCommands-WF2VFJD2.js");
412
412
  return runMachineConnectCommand(args2, deps);
413
413
  }),
414
414
  createDaemonShortcutCommand(["daemon"], "Run the connector daemon shortcut", async (args2, deps) => {
415
- const { runMachineConnectCommand } = await import("./machineCommands-3XWBAXZL.js");
415
+ const { runMachineConnectCommand } = await import("./machineCommands-WF2VFJD2.js");
416
416
  return runMachineConnectCommand(args2, deps);
417
417
  }),
418
418
  createEnvCommand(["machine", "status"], "List machines registered to the current profile", async (args2, deps) => {
419
- const { runMachineStatusCommand } = await import("./machineCommands-3XWBAXZL.js");
419
+ const { runMachineStatusCommand } = await import("./machineCommands-WF2VFJD2.js");
420
420
  return runMachineStatusCommand(args2, deps);
421
421
  }),
422
422
  createEnvCommand(["doctor", "runtime"], "Diagnose local-first agent runtime selection", async (args2, deps) => {
@@ -796,7 +796,7 @@ async function runScript(script, forwardedArgs, env) {
796
796
  return proc.exited;
797
797
  }
798
798
  async function launchTuiWorkspace(args2) {
799
- const { startTuiWorkspace } = await import("./readlineWorkspace-3FRNDMQP.js");
799
+ const { startTuiWorkspace } = await import("./readlineWorkspace-4VTHXHUB.js");
800
800
  const { createTuiSummaryLlmCaller } = await import("./tuiSummaryLlmCaller-RV6ZXCLV.js");
801
801
  return startTuiWorkspace({
802
802
  ...args2,
@@ -2,7 +2,7 @@ import {
2
2
  buildMachinePermissionPromptBlock,
3
3
  handleConnectorRunMessage,
4
4
  resolveMachineRunPermissionPolicy
5
- } from "./chunk-TKNX6GFV.js";
5
+ } from "./chunk-NCMP6Q3I.js";
6
6
  import {
7
7
  isConnectorWebSocketAuthError,
8
8
  isConnectorWebSocketRetryableError,
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  detectMachineInfo
13
13
  } from "./chunk-6HYVJV7B.js";
14
- import "./chunk-64E4G62G.js";
14
+ import "./chunk-OLNFFJVY.js";
15
15
  import "./chunk-XXUNUXCS.js";
16
16
  import "./chunk-ONELX7AM.js";
17
17
  import "./chunk-VHBWHNVT.js";
@@ -11,8 +11,8 @@ import {
11
11
  runtimeWorkspacePermissionPolicy,
12
12
  scopePermissionPolicyToRuntimeWorkspace,
13
13
  summarizeAgentConfigForLogs
14
- } from "./chunk-TKNX6GFV.js";
15
- import "./chunk-64E4G62G.js";
14
+ } from "./chunk-NCMP6Q3I.js";
15
+ import "./chunk-OLNFFJVY.js";
16
16
  import "./chunk-XXUNUXCS.js";
17
17
  import "./chunk-ONELX7AM.js";
18
18
  import "./chunk-VHBWHNVT.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nolo-cli",
3
- "version": "0.16.0-alpha.3",
3
+ "version": "0.16.0-alpha.4",
4
4
  "type": "module",
5
5
  "description": "Agent-first terminal workspace for Nolo",
6
6
  "bin": {
@@ -57,7 +57,7 @@ import {
57
57
  visibleWidth,
58
58
  wrapTextToLines,
59
59
  wrapTranscriptLine
60
- } from "./chunk-Y6G5CIAW.js";
60
+ } from "./chunk-2ZDQ5PN5.js";
61
61
  import "./chunk-DZ3XJVET.js";
62
62
  import "./chunk-6HYVJV7B.js";
63
63
  import {
@@ -76,7 +76,7 @@ import {
76
76
  parseCliLocale,
77
77
  setCliLocale,
78
78
  t
79
- } from "./chunk-64E4G62G.js";
79
+ } from "./chunk-OLNFFJVY.js";
80
80
  import "./chunk-XXUNUXCS.js";
81
81
  import {
82
82
  getReadableCliDb
@@ -4033,8 +4033,8 @@ function renderTurnBlock(role, content, contentWidth, colorEnabled) {
4033
4033
  const line = logicalLines[i];
4034
4034
  let styledLine;
4035
4035
  if (colorEnabled) {
4036
- const prefix = i === 0 ? `${accentSeq}\u276F\x1B[39m ` : `${chromeSeq}\u2502\x1B[39m `;
4037
- styledLine = `${prefix}${line}`;
4036
+ const prefix = i === 0 ? `${accentSeq}\u276F ` : `${chromeSeq}\u2502 `;
4037
+ styledLine = `${prefix}\x1B[1m${accentSeq}${line}`;
4038
4038
  } else {
4039
4039
  const prefix = i === 0 ? "\u276F " : " ";
4040
4040
  styledLine = `${prefix}${line}`;