nolo-cli 0.31.0-alpha.6 → 0.31.0

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-AOS5IN2I.js";
9
9
  import {
10
10
  runAgentCreateCommand
11
- } from "./chunk-L2JSYKLP.js";
12
- import "./chunk-5KXWNLL5.js";
11
+ } from "./chunk-VQLXUSS3.js";
12
+ import "./chunk-45X23W6O.js";
13
13
  import "./chunk-SFWZUTCI.js";
14
14
  import "./chunk-7KNERA53.js";
15
15
  import "./chunk-JDSUTNYY.js";
@@ -99,7 +99,7 @@ async function defaultExecuteCli(provider, prompt, options) {
99
99
  return executeCli(provider, prompt, options);
100
100
  }
101
101
  async function forwardConnectorRunMessage(machine, message, pushMessage, executeCli, env, fetchImpl) {
102
- const { handleConnectorRunMessage } = await import("./machineWsRunDispatch-JKPHEU5X.js");
102
+ const { handleConnectorRunMessage } = await import("./machineWsRunDispatch-RE5GJPTV.js");
103
103
  return handleConnectorRunMessage(message, pushMessage, executeCli, env, fetchImpl);
104
104
  }
105
105
  async function detectLaunchableMachineInfo() {
@@ -2,8 +2,8 @@ import {
2
2
  runAgentCreateCommand,
3
3
  runAgentReadCommand,
4
4
  runAgentUpdateCommand
5
- } from "./chunk-L2JSYKLP.js";
6
- import "./chunk-5KXWNLL5.js";
5
+ } from "./chunk-VQLXUSS3.js";
6
+ import "./chunk-45X23W6O.js";
7
7
  import "./chunk-SFWZUTCI.js";
8
8
  import "./chunk-7KNERA53.js";
9
9
  import "./chunk-JDSUTNYY.js";
@@ -7,12 +7,12 @@ import {
7
7
  prependSubjectDialogMarker,
8
8
  resolveWorkflowReference,
9
9
  runAgentRunCommand
10
- } from "./chunk-VU4WUYR3.js";
10
+ } from "./chunk-LABJBLQQ.js";
11
11
  import {
12
12
  parseAgentRunArgs
13
13
  } from "./chunk-AOS5IN2I.js";
14
14
  import "./chunk-6HYVJV7B.js";
15
- import "./chunk-5KXWNLL5.js";
15
+ import "./chunk-45X23W6O.js";
16
16
  import "./chunk-SFWZUTCI.js";
17
17
  import "./chunk-7KNERA53.js";
18
18
  import "./chunk-JDSUTNYY.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-5KXWNLL5.js";
4
+ } from "./chunk-45X23W6O.js";
5
5
  import {
6
6
  runLocalAgentTurn
7
7
  } from "./chunk-AYMOSAHE.js";
@@ -10756,15 +10756,21 @@ async function writeLocalTokenRecord(args) {
10756
10756
  return ops;
10757
10757
  }
10758
10758
  async function writeDialog(args) {
10759
+ const __perfEnabled = args.env?.NOLO_CLI_PERF === "1";
10760
+ const __perfT0 = __perfEnabled ? performance.now() : 0;
10759
10761
  let existingDialog = null;
10760
10762
  if (args.input.continueDialogId) {
10761
10763
  const dialogKey = `dialog-${args.userId}-${args.input.continueDialogId}`;
10762
10764
  existingDialog = await args.store.read(dialogKey);
10763
10765
  }
10766
+ if (__perfEnabled) {
10767
+ const ms = (performance.now() - __perfT0).toFixed(1);
10768
+ process.stderr.write(`[nolo-perf] writeDialog A:read-dialog: ${ms}ms
10769
+ `);
10770
+ }
10764
10771
  const nowMs = args.now();
10765
10772
  const existingTitle = typeof existingDialog?.title === "string" ? existingDialog.title.trim() : "";
10766
10773
  const existingTitleSource = existingDialog?.titleSource;
10767
- const titleTimeoutMs = args.titleTimeoutMs ?? 2500;
10768
10774
  let needsTitleUpdate = false;
10769
10775
  if (existingTitleSource === "manual") {
10770
10776
  needsTitleUpdate = false;
@@ -10786,30 +10792,20 @@ async function writeDialog(args) {
10786
10792
  const fallbackTitle = buildDialogFallbackTitleFromUserInput(rawLastUserText) || "Local agent run";
10787
10793
  titlePromise = args.titleGenerator({ messages: args.input.messages, fallbackTitle }).catch(() => null);
10788
10794
  }
10789
- let resolvedTitle = null;
10790
- if (titlePromise) {
10791
- let timeoutId;
10792
- const timeoutPromise = new Promise((resolve) => {
10793
- timeoutId = setTimeout(() => resolve(null), titleTimeoutMs);
10794
- });
10795
- try {
10796
- resolvedTitle = await Promise.race([titlePromise, timeoutPromise]);
10797
- } catch {
10798
- resolvedTitle = null;
10799
- } finally {
10800
- if (timeoutId) clearTimeout(timeoutId);
10801
- }
10802
- }
10803
10795
  const plan = buildLocalDialogWritePlan({
10804
10796
  input: args.input,
10805
10797
  userId: args.userId,
10806
10798
  now: nowMs,
10807
10799
  createId: args.createId,
10808
10800
  existingDialog,
10809
- cwd: args.cwd,
10810
- ...resolvedTitle ? { titleOverride: resolvedTitle } : {}
10801
+ cwd: args.cwd
10811
10802
  });
10812
10803
  await args.store.batch(plan.ops);
10804
+ if (__perfEnabled) {
10805
+ const ms = (performance.now() - __perfT0).toFixed(1);
10806
+ process.stderr.write(`[nolo-perf] writeDialog C:store-batch (cumulative): ${ms}ms
10807
+ `);
10808
+ }
10813
10809
  let tokenOps = [];
10814
10810
  try {
10815
10811
  tokenOps = await writeLocalTokenRecord({
@@ -10827,38 +10823,75 @@ async function writeDialog(args) {
10827
10823
  `
10828
10824
  );
10829
10825
  }
10826
+ if (__perfEnabled) {
10827
+ const ms = (performance.now() - __perfT0).toFixed(1);
10828
+ process.stderr.write(`[nolo-perf] writeDialog D:token-record (cumulative): ${ms}ms
10829
+ `);
10830
+ }
10830
10831
  const hasSubjectRefs = localTurnHasSubjectRefs(args.input);
10831
10832
  const isLocalUser = args.userId === "local";
10833
+ let remoteSyncPromise;
10832
10834
  if (!isLocalUser) {
10833
- try {
10834
- const syncResult = await syncLocalDialogEvidenceToRemote({
10835
+ if (hasSubjectRefs) {
10836
+ remoteSyncPromise = (async () => {
10837
+ const syncResult = await syncLocalDialogEvidenceToRemote({
10838
+ env: args.env,
10839
+ fetchImpl: args.fetchImpl,
10840
+ input: args.input,
10841
+ ops: [...plan.ops, ...tokenOps],
10842
+ output: args.output,
10843
+ userId: args.userId
10844
+ });
10845
+ if (!syncResult.attempted) {
10846
+ args.output?.write(
10847
+ "[nolo] Local dialog evidence is local-only; set NOLO_SERVER and AUTH_TOKEN to make subjectRefs remotely queryable.\n"
10848
+ );
10849
+ }
10850
+ })();
10851
+ await remoteSyncPromise;
10852
+ } else {
10853
+ remoteSyncPromise = syncLocalDialogEvidenceToRemote({
10835
10854
  env: args.env,
10836
10855
  fetchImpl: args.fetchImpl,
10837
10856
  input: args.input,
10838
10857
  ops: [...plan.ops, ...tokenOps],
10839
10858
  output: args.output,
10840
10859
  userId: args.userId
10841
- });
10842
- if (!syncResult.attempted) {
10843
- if (hasSubjectRefs) {
10844
- args.output?.write(
10845
- "[nolo] Local dialog evidence is local-only; set NOLO_SERVER and AUTH_TOKEN to make subjectRefs remotely queryable.\n"
10846
- );
10847
- }
10848
- }
10849
- } catch (error) {
10850
- if (hasSubjectRefs) {
10851
- throw error;
10852
- }
10853
- args.output?.write(
10854
- `[nolo] Remote dialog evidence sync failed; local dialog only: ${toErrorMessage(
10855
- error
10856
- )}
10860
+ }).catch((error) => {
10861
+ args.output?.write(
10862
+ `[nolo] Remote dialog evidence sync failed; local dialog only: ${toErrorMessage(error)}
10857
10863
  `
10858
- );
10864
+ );
10865
+ });
10859
10866
  }
10860
10867
  }
10861
- return { dialogId: plan.dialogId, title: plan.title };
10868
+ let titlePatchPromise;
10869
+ if (titlePromise) {
10870
+ const dialogKey = `dialog-${args.userId}-${plan.dialogId}`;
10871
+ titlePatchPromise = titlePromise.then(async (resolvedTitle) => {
10872
+ if (!resolvedTitle) return;
10873
+ try {
10874
+ const existing = await args.store.read(dialogKey);
10875
+ if (!existing || typeof existing !== "object") return;
10876
+ if (existing?.titleSource === "manual") return;
10877
+ const existingTitleUpdatedAtMs = parseTitleUpdatedAtMs(existing);
10878
+ if (existingTitleUpdatedAtMs > nowMs) return;
10879
+ await args.store.write(dialogKey, {
10880
+ ...existing,
10881
+ title: resolvedTitle,
10882
+ titleSource: "auto",
10883
+ titleUpdatedAt: new Date(nowMs).toISOString()
10884
+ });
10885
+ } catch {
10886
+ }
10887
+ });
10888
+ }
10889
+ if (__perfEnabled) {
10890
+ const ms = (performance.now() - __perfT0).toFixed(1);
10891
+ process.stderr.write(`[nolo-perf] writeDialog total (blocking): ${ms}ms
10892
+ `);
10893
+ }
10894
+ return { dialogId: plan.dialogId, title: plan.title, titlePatchPromise, remoteSyncPromise };
10862
10895
  }
10863
10896
  function resolveCliDialogRecordKey(userId, dialogId) {
10864
10897
  if (dialogId.startsWith("dialog-") && !dialogId.includes("-msg-")) {
@@ -19,7 +19,7 @@ import {
19
19
  parseAgentRunEvent,
20
20
  t,
21
21
  toolLabel
22
- } from "./chunk-5KXWNLL5.js";
22
+ } from "./chunk-45X23W6O.js";
23
23
  import {
24
24
  createRunActivityTracker,
25
25
  finalizeRunRecord,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearCliLocalRuntimePreparedAgentCache
3
- } from "./chunk-5KXWNLL5.js";
3
+ } from "./chunk-45X23W6O.js";
4
4
  import {
5
5
  getReadableCliDb
6
6
  } from "./chunk-WFHXMLHZ.js";
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-CNRM5FZN.js");
129
+ const { runAgentRunCommand } = await import("./agentRunCommand-NWZOXX5R.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-3CMUZWXT.js");
145
+ const { runAgentCreateCommand } = await import("./agentRecordCommands-2M6NJOAO.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-3CMUZWXT.js");
153
+ const { runAgentReadCommand } = await import("./agentRecordCommands-2M6NJOAO.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-3CMUZWXT.js");
182
+ const { runAgentUpdateCommand } = await import("./agentRecordCommands-2M6NJOAO.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-PTC4K4LH.js");
186
+ const { runAgentEmailProvisionCommand } = await import("./agentEmailCommands-GA6XIW47.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-PTC4K4LH.js");
190
+ const { runAgentEmailBindCommand } = await import("./agentEmailCommands-GA6XIW47.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-PTC4K4LH.js");
194
+ const { runAgentEmailTransferCommand } = await import("./agentEmailCommands-GA6XIW47.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-PTC4K4LH.js");
201
+ const { runAgentEmailCreateAndProvisionCommand } = await import("./agentEmailCommands-GA6XIW47.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-LEMYL344.js");
222
+ const { runAgentBindCurrentCommand } = await import("./agentMachineCommands-EPSFJASS.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-LEMYL344.js");
226
+ const { runAgentSmokeCurrentCommand } = await import("./agentMachineCommands-EPSFJASS.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-LEMYL344.js");
230
+ const { runAgentRuntimeDoctorCommand } = await import("./agentMachineCommands-EPSFJASS.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-XT6TOLK5.js");
411
+ const { runMachineConnectCommand } = await import("./machineCommands-7C3NKUAW.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-XT6TOLK5.js");
415
+ const { runMachineConnectCommand } = await import("./machineCommands-7C3NKUAW.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-XT6TOLK5.js");
419
+ const { runMachineStatusCommand } = await import("./machineCommands-7C3NKUAW.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-I6KRAVI4.js");
799
+ const { startTuiWorkspace } = await import("./readlineWorkspace-LTSW7XNF.js");
800
800
  const { createTuiSummaryLlmCaller } = await import("./tuiSummaryLlmCaller-SRZ4QQUP.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-KJU5MAGU.js";
5
+ } from "./chunk-2OUJC7YP.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-5KXWNLL5.js";
14
+ import "./chunk-45X23W6O.js";
15
15
  import "./chunk-SFWZUTCI.js";
16
16
  import "./chunk-7KNERA53.js";
17
17
  import "./chunk-JDSUTNYY.js";
@@ -11,8 +11,8 @@ import {
11
11
  runtimeWorkspacePermissionPolicy,
12
12
  scopePermissionPolicyToRuntimeWorkspace,
13
13
  summarizeAgentConfigForLogs
14
- } from "./chunk-KJU5MAGU.js";
15
- import "./chunk-5KXWNLL5.js";
14
+ } from "./chunk-2OUJC7YP.js";
15
+ import "./chunk-45X23W6O.js";
16
16
  import "./chunk-SFWZUTCI.js";
17
17
  import "./chunk-7KNERA53.js";
18
18
  import "./chunk-JDSUTNYY.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nolo-cli",
3
- "version": "0.31.0-alpha.6",
3
+ "version": "0.31.0",
4
4
  "type": "module",
5
5
  "description": "Agent-first terminal workspace for Nolo",
6
6
  "bin": {
@@ -58,7 +58,7 @@ import {
58
58
  visibleWidth,
59
59
  wrapTextToLines,
60
60
  wrapTranscriptLine
61
- } from "./chunk-VU4WUYR3.js";
61
+ } from "./chunk-LABJBLQQ.js";
62
62
  import "./chunk-AOS5IN2I.js";
63
63
  import "./chunk-6HYVJV7B.js";
64
64
  import {
@@ -80,7 +80,7 @@ import {
80
80
  readTimestamp,
81
81
  setCliLocale,
82
82
  t
83
- } from "./chunk-5KXWNLL5.js";
83
+ } from "./chunk-45X23W6O.js";
84
84
  import "./chunk-SFWZUTCI.js";
85
85
  import {
86
86
  checkStaleRun,