nolo-cli 0.95.0-alpha.3 → 0.95.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,7 +8,7 @@ import {
8
8
  resolveRunSettlementNote,
9
9
  resolveWorkflowReference,
10
10
  runAgentRunCommand
11
- } from "./chunk-CKBWCDW5.js";
11
+ } from "./chunk-YLALY5NG.js";
12
12
  import "./chunk-S7Z2HMCN.js";
13
13
  import {
14
14
  parseAgentRunArgs
@@ -37,6 +37,7 @@ import {
37
37
  spawnLocalBackgroundRun
38
38
  } from "./chunk-CPH3W5A7.js";
39
39
  import {
40
+ clearCredentialAvailability,
40
41
  readCredentialEntry,
41
42
  recordCredentialProbe,
42
43
  resolveCredentialKeyWithFallback
@@ -11290,22 +11291,24 @@ async function checkLocalAvailabilityBeforeHttpDispatch(options) {
11290
11291
  }
11291
11292
  const agentLevelAt = baseRecord.nextAvailableAt;
11292
11293
  const agentLevelNextAvailableAt = typeof agentLevelAt === "number" && Number.isFinite(agentLevelAt) ? agentLevelAt : void 0;
11293
- if (!credentialKey && agentLevelNextAvailableAt === void 0) return null;
11294
+ if (!credentialKey && agentLevelNextAvailableAt === void 0) {
11295
+ return { credentialKey };
11296
+ }
11294
11297
  const env = options.env;
11295
11298
  const now = Date.now();
11296
11299
  const entry = credentialKey ? await readCredentialEntry(credentialKey, env, now).catch(() => void 0) : void 0;
11297
11300
  const entryAt = entry?.nextAvailableAt;
11298
11301
  const effectiveNextAvailableAt = typeof entryAt === "number" ? mergeAvailabilityDeadline(agentLevelNextAvailableAt, entryAt) : agentLevelNextAvailableAt;
11299
- if (typeof effectiveNextAvailableAt !== "number") return null;
11302
+ if (typeof effectiveNextAvailableAt !== "number") return { credentialKey };
11300
11303
  const gateDecision = resolveCooldownGate(
11301
11304
  { nextAvailableAt: effectiveNextAvailableAt, lastProbeAt: entry?.lastProbeAt },
11302
11305
  now
11303
11306
  );
11304
11307
  if (gateDecision === "probe" && credentialKey) {
11305
11308
  await recordCredentialProbe(credentialKey, env, now).catch(() => void 0);
11306
- return null;
11309
+ return { credentialKey };
11307
11310
  }
11308
- if (gateDecision !== "blocked") return null;
11311
+ if (gateDecision !== "blocked") return { credentialKey };
11309
11312
  options.output.write(
11310
11313
  `[nolo] Agent ${options.agentName || options.agentKey} is temporarily unavailable (429 cooldown) until ${new Date(Number(effectiveNextAvailableAt)).toISOString()}.
11311
11314
  Dispatch aborted before reaching the server. Pick another agent via listAgents, or retry after the cooldown.
@@ -11388,11 +11391,18 @@ async function runAgentTurn(options) {
11388
11391
  );
11389
11392
  return { exitCode: 1 };
11390
11393
  }
11391
- const localBlock = await checkLocalAvailabilityBeforeHttpDispatch(options);
11392
- if (localBlock) {
11393
- return { exitCode: localBlock.exitCode };
11394
+ const localAvailability = await checkLocalAvailabilityBeforeHttpDispatch(options);
11395
+ if (localAvailability?.exitCode) {
11396
+ return { exitCode: localAvailability.exitCode };
11397
+ }
11398
+ const httpResult = await runHttpAgentTurn(options, authToken);
11399
+ if (httpResult.exitCode === 0 && localAvailability?.credentialKey) {
11400
+ await clearCredentialAvailability(
11401
+ localAvailability.credentialKey,
11402
+ options.env
11403
+ ).catch(() => void 0);
11394
11404
  }
11395
- return runHttpAgentTurn(options, authToken);
11405
+ return httpResult;
11396
11406
  }
11397
11407
 
11398
11408
  // packages/cli/agentRunCommand.ts
@@ -12394,10 +12404,14 @@ var withTimeout = async (promise, timeoutMs, label) => {
12394
12404
  };
12395
12405
  var runMemoryVNextShadowRead = async (input) => {
12396
12406
  const now = input.ctx.now ?? (() => performance.now());
12397
- const emit = input.emit ?? ((observation2) => console.info("[memory] vnext shadow read", {
12398
- event: "memory_vnext_shadow_read",
12399
- ...observation2
12400
- }));
12407
+ const defaultEmit = (observation2) => {
12408
+ const payload = {
12409
+ event: "memory_vnext_shadow_read",
12410
+ ...observation2
12411
+ };
12412
+ console.info("[memory] vnext shadow read", payload);
12413
+ };
12414
+ const emit = input.emit ?? defaultEmit;
12401
12415
  const legacyKeys = new Set(
12402
12416
  input.legacyItems.flatMap((item) => legacyItemKeys(item))
12403
12417
  );
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-MTR5X2MP.js");
130
+ const { runAgentRunCommand } = await import("./agentRunCommand-SVOSMV2Q.js");
131
131
  return runAgentRunCommand(args2, {
132
132
  env: ctx.env,
133
133
  scriptDir: ctx.scriptDir,
@@ -892,7 +892,7 @@ async function runScript(script, forwardedArgs, env) {
892
892
  return proc.exited;
893
893
  }
894
894
  async function launchTuiWorkspace(args2) {
895
- const { startTuiWorkspace } = await import("./readlineWorkspace-7IFXYFGX.js");
895
+ const { startTuiWorkspace } = await import("./readlineWorkspace-HGWW2JCK.js");
896
896
  const { createTuiSummaryLlmCaller } = await import("./tuiSummaryLlmCaller-T2SHYMDZ.js");
897
897
  return startTuiWorkspace({
898
898
  ...args2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nolo-cli",
3
- "version": "0.95.0-alpha.3",
3
+ "version": "0.95.0-alpha.4",
4
4
  "type": "module",
5
5
  "description": "Agent-first terminal workspace for Nolo",
6
6
  "bin": {
@@ -72,7 +72,7 @@ import {
72
72
  wrapTextToLines,
73
73
  wrapTranscriptLine,
74
74
  wrapTranscriptLineWithLayout
75
- } from "./chunk-CKBWCDW5.js";
75
+ } from "./chunk-YLALY5NG.js";
76
76
  import "./chunk-S7Z2HMCN.js";
77
77
  import "./chunk-V7E4PXQD.js";
78
78
  import {