sim 2.1.4-dev.62.1 → 2.1.4-dev.65.1
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.
- package/dist/index.js +19 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2316,6 +2316,13 @@ import { dirname } from "node:path";
|
|
|
2316
2316
|
|
|
2317
2317
|
// src/embed-context.ts
|
|
2318
2318
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2319
|
+
function setSoftExitCode(code) {
|
|
2320
|
+
const ctx = embedStore.getStore();
|
|
2321
|
+
if (ctx)
|
|
2322
|
+
ctx.softExitCode = code;
|
|
2323
|
+
else
|
|
2324
|
+
process.exitCode = code;
|
|
2325
|
+
}
|
|
2319
2326
|
var embedStore = new AsyncLocalStorage;
|
|
2320
2327
|
function embeddedProfile() {
|
|
2321
2328
|
const ctx = embedStore.getStore();
|
|
@@ -6995,6 +7002,11 @@ var V2_OPERATIONS = {
|
|
|
6995
7002
|
conversationId: {
|
|
6996
7003
|
kind: "string",
|
|
6997
7004
|
describe: "Conversation to continue; a new one starts when omitted."
|
|
7005
|
+
},
|
|
7006
|
+
effort: {
|
|
7007
|
+
kind: "enum",
|
|
7008
|
+
values: ["low", "medium", "high", "xhigh", "max"],
|
|
7009
|
+
describe: "Model effort for this turn; defaults to the deployment default (high)."
|
|
6998
7010
|
}
|
|
6999
7011
|
}
|
|
7000
7012
|
},
|
|
@@ -8323,7 +8335,7 @@ var V2_OPERATIONS = {
|
|
|
8323
8335
|
},
|
|
8324
8336
|
selectedOutputs: {
|
|
8325
8337
|
kind: "array",
|
|
8326
|
-
describe: "Block output references to include in
|
|
8338
|
+
describe: "Block output references to include in the response, as `blockId`, `blockId.path`, or `BlockName.path` (resolved against the workflow state being run). On a sync request the named outputs come back in `blockOutputs`, keyed by these selector strings; on a stream they shape the streamed envelope. Selectors that resolve to no block or no value are omitted. Rejected when `async` is true — a queued run has produced nothing to select; narrow the finished run via the run resource instead."
|
|
8327
8339
|
},
|
|
8328
8340
|
includeThinking: {
|
|
8329
8341
|
kind: "boolean",
|
|
@@ -11855,7 +11867,7 @@ function whoamiCommand() {
|
|
|
11855
11867
|
});
|
|
11856
11868
|
const exitCode = WHOAMI_EXIT_CODES[verification.status];
|
|
11857
11869
|
if (exitCode !== 0)
|
|
11858
|
-
|
|
11870
|
+
setSoftExitCode(exitCode);
|
|
11859
11871
|
});
|
|
11860
11872
|
}
|
|
11861
11873
|
var PROFILE_COLUMNS = [
|
|
@@ -13066,7 +13078,7 @@ var CLI_CONTRACT = {
|
|
|
13066
13078
|
selectedOutputs: {
|
|
13067
13079
|
name: "select-output",
|
|
13068
13080
|
list: true,
|
|
13069
|
-
describe: "Return blockName.field values
|
|
13081
|
+
describe: "Return blockName.field values (e.g. agent_1.content) — in blockOutputs on a sync run, or from the streamed result with --follow; missing fields are omitted. Not available with --async"
|
|
13070
13082
|
},
|
|
13071
13083
|
stream: { omit: true },
|
|
13072
13084
|
includeThinking: { omit: true },
|
|
@@ -15960,8 +15972,8 @@ function followOrDelegate(previous) {
|
|
|
15960
15972
|
command.setOptionValue("run", selection);
|
|
15961
15973
|
const flags = command.optsWithGlobals();
|
|
15962
15974
|
if (flags.follow !== true) {
|
|
15963
|
-
if (Array.isArray(flags.selectOutput) && flags.selectOutput.length > 0) {
|
|
15964
|
-
throw new SimApiError(
|
|
15975
|
+
if (Array.isArray(flags.selectOutput) && flags.selectOutput.length > 0 && flags.async === true) {
|
|
15976
|
+
throw new SimApiError("--select-output names outputs of a completed run, and --async returns as soon as the run is queued. Drop one of them, or read the finished run with: sim workflows runs get <runId> --workflow <workflowId> --select-output <blockId>[.path] — that resource matches block ids, not the block names --select-output takes here.", 0);
|
|
15965
15977
|
}
|
|
15966
15978
|
if (flags.includeThinking === true || flags.includeToolCalls === true) {
|
|
15967
15979
|
throw new SimApiError("--include-thinking and --include-tool-calls describe a stream; add --follow", 0);
|
|
@@ -16084,7 +16096,7 @@ function attachWorkflowRunWait(runs) {
|
|
|
16084
16096
|
const message = explain(outcome, runId, options.workflow, snapshot);
|
|
16085
16097
|
if (message)
|
|
16086
16098
|
console.error(source_default.red(message));
|
|
16087
|
-
|
|
16099
|
+
setSoftExitCode(WAIT_EXIT_CODES[outcome]);
|
|
16088
16100
|
return;
|
|
16089
16101
|
}
|
|
16090
16102
|
const remainingMs = deadline - Date.now();
|
|
@@ -16092,7 +16104,7 @@ function attachWorkflowRunWait(runs) {
|
|
|
16092
16104
|
progress.finish();
|
|
16093
16105
|
renderResult("getWorkflowRun", profile.output, raw, runSpec());
|
|
16094
16106
|
console.error(source_default.red(`Timed out after ${timeoutSeconds}s waiting for run ${runId} (status: ${snapshot.status}${snapshot.resumeAt ? `, resuming at ${snapshot.resumeAt}` : ""}). Raise ${WAIT_TIMEOUT_FLAG}, or set it to 0 to wait indefinitely.`));
|
|
16095
|
-
|
|
16107
|
+
setSoftExitCode(WAIT_EXIT_CODES.timeout);
|
|
16096
16108
|
return;
|
|
16097
16109
|
}
|
|
16098
16110
|
progress.advance(snapshot.status, Date.now() - startedAt);
|