sim 2.2.7-preview.197.1 → 2.2.7-preview.198.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.
@@ -93,6 +93,16 @@ export interface FlagSpec {
93
93
  * including a deliberate `--details basic`.
94
94
  */
95
95
  requestDefault?: string;
96
+ /**
97
+ * Value an embedded invocation sends when the caller passes nothing; wins over
98
+ * `requestDefault` there and is ignored by the installed CLI.
99
+ *
100
+ * The embedding host returns stdout to a model or writes it to the model's
101
+ * workbench, which addresses files and run state by id rather than reading
102
+ * bulk payloads inline. A field whose server default inlines such a payload
103
+ * names the leaner value here. Whatever the caller types still wins.
104
+ */
105
+ embeddedRequestDefault?: string;
96
106
  /** Accepted values when the generated descriptor cannot recover an enum. */
97
107
  choices?: readonly string[];
98
108
  /**
package/dist/index.js CHANGED
@@ -17808,6 +17808,12 @@ var CLI_CONTRACT = {
17808
17808
  getLog: {
17809
17809
  describe: "Show run diagnostics",
17810
17810
  expandedTrace: true,
17811
+ flags: {
17812
+ includeWorkflowState: {
17813
+ embeddedRequestDefault: "false",
17814
+ describe: "Include the saved workflow snapshot (default: true; Sim’s in-app agent leaves it out unless this flag is passed). Set false to omit block configuration from a log read. Other run fields are unchanged."
17815
+ }
17816
+ },
17811
17817
  fields: [
17812
17818
  { header: "run", path: "runId" },
17813
17819
  { header: "workflow", path: "workflow.name" },
@@ -19046,6 +19052,9 @@ var CLI_CONTRACT = {
19046
19052
  stream: { omit: true },
19047
19053
  includeThinking: { omit: true },
19048
19054
  includeToolCalls: { omit: true },
19055
+ includeFileBase64: {
19056
+ describe: "Inline eligible output files as base64 content (default: true; Sim’s in-app agent gets file references only unless this flag is passed). Rejected when `async` is true."
19057
+ },
19049
19058
  "x-run-id": {
19050
19059
  name: "run-id",
19051
19060
  describe: "One-shot identifier for this run; NOT an idempotency key — reusing a claimed value fails with RUN_ID_CONFLICT instead of replaying the first result, and a fresh value starts another run"
@@ -20013,7 +20022,7 @@ async function buildRequest(operation, positional, flags, workspaceId) {
20013
20022
  const flagName = flagNameFor(operation, field);
20014
20023
  const omitProfileWorkspace = commandSpec.allWorkspaces && flags.allWorkspaces === true;
20015
20024
  const provided = field === PROFILE_INJECTED_FIELD ? omitProfileWorkspace ? undefined : workspaceId : flags[camel(flagName)];
20016
- const raw = provided ?? flag.requestDefault;
20025
+ const raw = provided ?? (embedStore.getStore() ? flag.embeddedRequestDefault : undefined) ?? flag.requestDefault;
20017
20026
  if ((slot === "query" || NUMERIC_KINDS.has(descriptor.kind)) && typeof raw === "string" && raw.trim() === "" && !(field === "limit" && paginatedLimit)) {
20018
20027
  throw new SimApiError(`--${flagName} cannot be empty`, 0);
20019
20028
  }
@@ -22342,6 +22351,11 @@ async function readWorkflowResult(response) {
22342
22351
  }
22343
22352
  throw new SimApiError("Workflow result stream ended without a final result", response.status);
22344
22353
  }
22354
+ function withEmbeddedFileReferences(body) {
22355
+ if (!embedStore.getStore() || body?.includeFileBase64 !== undefined)
22356
+ return body;
22357
+ return { ...body, includeFileBase64: false };
22358
+ }
22345
22359
  async function runWithResultStream(workflowId, command) {
22346
22360
  const flags = command.optsWithGlobals();
22347
22361
  const { client, profile } = clientFrom(command);
@@ -22352,7 +22366,7 @@ async function runWithResultStream(workflowId, command) {
22352
22366
  const response = await client.requestRaw(request.path, {
22353
22367
  method: operation.method,
22354
22368
  query: request.query,
22355
- body: request.body,
22369
+ body: withEmbeddedFileReferences(request.body),
22356
22370
  headers: { ...request.headers, accept: WORKFLOW_RESULT_STREAM_CONTENT_TYPE }
22357
22371
  });
22358
22372
  const payload = await readWorkflowResult(response);
@@ -22495,7 +22509,7 @@ async function followRun(workflowId, command) {
22495
22509
  method: "POST",
22496
22510
  query: request.query,
22497
22511
  body: {
22498
- ...request.body ?? {},
22512
+ ...withEmbeddedFileReferences(request.body),
22499
22513
  stream: true,
22500
22514
  ...includeThinking ? { includeThinking: true } : {},
22501
22515
  ...includeToolCalls ? { includeToolCalls: true } : {}
package/dist/runtime.js CHANGED
@@ -17857,6 +17857,12 @@ var CLI_CONTRACT = {
17857
17857
  getLog: {
17858
17858
  describe: "Show run diagnostics",
17859
17859
  expandedTrace: true,
17860
+ flags: {
17861
+ includeWorkflowState: {
17862
+ embeddedRequestDefault: "false",
17863
+ describe: "Include the saved workflow snapshot (default: true; Sim’s in-app agent leaves it out unless this flag is passed). Set false to omit block configuration from a log read. Other run fields are unchanged."
17864
+ }
17865
+ },
17860
17866
  fields: [
17861
17867
  { header: "run", path: "runId" },
17862
17868
  { header: "workflow", path: "workflow.name" },
@@ -19095,6 +19101,9 @@ var CLI_CONTRACT = {
19095
19101
  stream: { omit: true },
19096
19102
  includeThinking: { omit: true },
19097
19103
  includeToolCalls: { omit: true },
19104
+ includeFileBase64: {
19105
+ describe: "Inline eligible output files as base64 content (default: true; Sim’s in-app agent gets file references only unless this flag is passed). Rejected when `async` is true."
19106
+ },
19098
19107
  "x-run-id": {
19099
19108
  name: "run-id",
19100
19109
  describe: "One-shot identifier for this run; NOT an idempotency key — reusing a claimed value fails with RUN_ID_CONFLICT instead of replaying the first result, and a fresh value starts another run"
@@ -20062,7 +20071,7 @@ async function buildRequest(operation, positional, flags, workspaceId) {
20062
20071
  const flagName = flagNameFor(operation, field);
20063
20072
  const omitProfileWorkspace = commandSpec.allWorkspaces && flags.allWorkspaces === true;
20064
20073
  const provided = field === PROFILE_INJECTED_FIELD ? omitProfileWorkspace ? undefined : workspaceId : flags[camel(flagName)];
20065
- const raw = provided ?? flag.requestDefault;
20074
+ const raw = provided ?? (embedStore.getStore() ? flag.embeddedRequestDefault : undefined) ?? flag.requestDefault;
20066
20075
  if ((slot === "query" || NUMERIC_KINDS.has(descriptor.kind)) && typeof raw === "string" && raw.trim() === "" && !(field === "limit" && paginatedLimit)) {
20067
20076
  throw new SimApiError(`--${flagName} cannot be empty`, 0);
20068
20077
  }
@@ -22391,6 +22400,11 @@ async function readWorkflowResult(response) {
22391
22400
  }
22392
22401
  throw new SimApiError("Workflow result stream ended without a final result", response.status);
22393
22402
  }
22403
+ function withEmbeddedFileReferences(body) {
22404
+ if (!embedStore.getStore() || body?.includeFileBase64 !== undefined)
22405
+ return body;
22406
+ return { ...body, includeFileBase64: false };
22407
+ }
22394
22408
  async function runWithResultStream(workflowId, command) {
22395
22409
  const flags = command.optsWithGlobals();
22396
22410
  const { client, profile } = clientFrom(command);
@@ -22401,7 +22415,7 @@ async function runWithResultStream(workflowId, command) {
22401
22415
  const response = await client.requestRaw(request.path, {
22402
22416
  method: operation.method,
22403
22417
  query: request.query,
22404
- body: request.body,
22418
+ body: withEmbeddedFileReferences(request.body),
22405
22419
  headers: { ...request.headers, accept: WORKFLOW_RESULT_STREAM_CONTENT_TYPE }
22406
22420
  });
22407
22421
  const payload = await readWorkflowResult(response);
@@ -22544,7 +22558,7 @@ async function followRun(workflowId, command) {
22544
22558
  method: "POST",
22545
22559
  query: request.query,
22546
22560
  body: {
22547
- ...request.body ?? {},
22561
+ ...withEmbeddedFileReferences(request.body),
22548
22562
  stream: true,
22549
22563
  ...includeThinking ? { includeThinking: true } : {},
22550
22564
  ...includeToolCalls ? { includeToolCalls: true } : {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sim",
3
- "version": "2.2.7-preview.197.1",
3
+ "version": "2.2.7-preview.198.1",
4
4
  "description": "Sim CLI - talk to the Sim API from your terminal",
5
5
  "type": "module",
6
6
  "imports": {