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.
|
@@ -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)
|
|
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
|
|
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
|
|
11309
|
+
return { credentialKey };
|
|
11307
11310
|
}
|
|
11308
|
-
if (gateDecision !== "blocked") return
|
|
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
|
|
11392
|
-
if (
|
|
11393
|
-
return { 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
|
|
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
|
|
12398
|
-
|
|
12399
|
-
|
|
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-
|
|
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-
|
|
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