@moda-ai/cli 1.39.0 → 1.40.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.
|
@@ -5637,6 +5637,8 @@ async function runPromptAb(flags, profileOptions, context) {
|
|
|
5637
5637
|
...plan.kind === "existing" ? replayCasePin(plan.caseIds) : {}
|
|
5638
5638
|
})
|
|
5639
5639
|
}, profileOptions, { timeoutMs: 120000, retries: 0 });
|
|
5640
|
+
if (context.outputMode === "human")
|
|
5641
|
+
warnIfQueued(enqueue);
|
|
5640
5642
|
const noWait = flags.wait === "false" || flags["no-wait"] === "true";
|
|
5641
5643
|
if (noWait) {
|
|
5642
5644
|
context.output.writeData({
|
|
@@ -5658,7 +5660,7 @@ async function runPromptAb(flags, profileOptions, context) {
|
|
|
5658
5660
|
break;
|
|
5659
5661
|
}
|
|
5660
5662
|
if (context.outputMode === "human") {
|
|
5661
|
-
process.stderr.write(`Waiting for replay run (${
|
|
5663
|
+
process.stderr.write(`Waiting for replay run (${waitLabel(latest.run)})...
|
|
5662
5664
|
`);
|
|
5663
5665
|
}
|
|
5664
5666
|
await sleep(pollIntervalMs);
|
|
@@ -5680,6 +5682,23 @@ async function runPromptAb(flags, profileOptions, context) {
|
|
|
5680
5682
|
}
|
|
5681
5683
|
context.output.writeData(result);
|
|
5682
5684
|
}
|
|
5685
|
+
function warnIfQueued(enqueue) {
|
|
5686
|
+
const { runsAhead, maxActiveRuns } = enqueue;
|
|
5687
|
+
if (typeof runsAhead !== "number" || typeof maxActiveRuns !== "number")
|
|
5688
|
+
return;
|
|
5689
|
+
if (runsAhead < maxActiveRuns)
|
|
5690
|
+
return;
|
|
5691
|
+
process.stderr.write(`Note: ${runsAhead} replay runs for this tenant are already running or queued ` + `(${maxActiveRuns} at a time); run ${enqueue.runId} waits in the queue until a slot frees.
|
|
5692
|
+
`);
|
|
5693
|
+
}
|
|
5694
|
+
function waitLabel(run) {
|
|
5695
|
+
if (!run?.status)
|
|
5696
|
+
return "pending";
|
|
5697
|
+
if (run.status === "accepted") {
|
|
5698
|
+
return typeof run.runsAhead === "number" ? `queued, ${run.runsAhead} run${run.runsAhead === 1 ? "" : "s"} ahead` : "queued";
|
|
5699
|
+
}
|
|
5700
|
+
return run.status;
|
|
5701
|
+
}
|
|
5683
5702
|
var FILE_ARM_RE = /[\\/]|\.(?:md|txt|json|ya?ml|jinja2?|j2|hbs|tmpl|prompt|[cm]?[jt]sx?|py)$/i;
|
|
5684
5703
|
var PROMPT_KEY_RE = /^[^\s"'`\x00-\x1f\x7f]+$/;
|
|
5685
5704
|
function assertArmSourceShape(source, label) {
|
|
@@ -5975,6 +5994,8 @@ async function enqueueAndPollComparison(args, profileOptions) {
|
|
|
5975
5994
|
...replayCasePin(args.caseIds)
|
|
5976
5995
|
})
|
|
5977
5996
|
}, profileOptions, { timeoutMs: 120000, retries: 0 });
|
|
5997
|
+
if (args.onWaiting)
|
|
5998
|
+
warnIfQueued(enqueue);
|
|
5978
5999
|
const timeoutMs = args.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS;
|
|
5979
6000
|
const pollIntervalMs = args.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
|
|
5980
6001
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -5986,7 +6007,7 @@ async function enqueueAndPollComparison(args, profileOptions) {
|
|
|
5986
6007
|
if (TERMINAL_RUN_STATUSES.has(status) && runId === enqueue.runId) {
|
|
5987
6008
|
return latest;
|
|
5988
6009
|
}
|
|
5989
|
-
args.onWaiting?.(
|
|
6010
|
+
args.onWaiting?.(waitLabel(latest.run));
|
|
5990
6011
|
await sleep(pollIntervalMs);
|
|
5991
6012
|
}
|
|
5992
6013
|
if (!latest?.run || latest.run.runId !== enqueue.runId || !TERMINAL_RUN_STATUSES.has(latest.run.status)) {
|
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
runPromptsCommand,
|
|
9
9
|
runSkillsCommand,
|
|
10
10
|
runStatusCommand
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-w9an3j54.js";
|
|
12
12
|
import {
|
|
13
13
|
ApiError,
|
|
14
14
|
HARNESS_REPORT_APPROVAL_PATH,
|
|
@@ -9168,7 +9168,7 @@ var commandRegistry = createCommandRegistry([
|
|
|
9168
9168
|
resetApiRequestCountBeforeRun: true,
|
|
9169
9169
|
telemetry: "result",
|
|
9170
9170
|
handler: async (context) => {
|
|
9171
|
-
const { runInit } = await import("./index-
|
|
9171
|
+
const { runInit } = await import("./index-1pb2ftqr.js");
|
|
9172
9172
|
if (context.outputMode === "agent-stream") {
|
|
9173
9173
|
context.output.writeEvent({
|
|
9174
9174
|
event: "started",
|
package/package.json
CHANGED