@soat/sdk 0.18.4 → 0.18.5

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.cjs CHANGED
@@ -3173,7 +3173,7 @@ var Tasks = class {
3173
3173
  /**
3174
3174
  * Create a task
3175
3175
  *
3176
- * Creates a task bound to a workflow. The task is placed in the workflow's initial state and that state's `on_enter` automation fires.
3176
+ * Creates a task bound to a workflow. By default the task is placed in the workflow's initial state; passing `state` places it directly in that named state instead — an alternate entry point for starting a task mid-flow (e.g. "a new recorte for an existing theme by id"), rather than re-submitting from the initial state and hoping a guard or similarity gate recognizes it. Entering the resulting state, initial or named, behaves identically: that state's `on_enter` automation fires and its `stalled_after` clock arms.
3177
3177
  */
3178
3178
  static createTask(options) {
3179
3179
  return (options.client ?? client).post({
package/dist/index.d.cts CHANGED
@@ -2217,6 +2217,16 @@ type ToolResourceProperties = {
2217
2217
  headers?: {
2218
2218
  [key: string]: unknown;
2219
2219
  } | null;
2220
+ /**
2221
+ * Request body encoding for `POST`/`PUT`/`PATCH`: `json` (default) or `multipart`. Incompatible with `auth.type: aws_sigv4`.
2222
+ */
2223
+ body_mode?: string | null;
2224
+ /**
2225
+ * Computed request credential. `type` is `aws_sigv4` (with `region`, `service`, `access_key_id`, `secret_access_key` and optional `session_token`) or `gcp_service_account` (with `credentials` and `scopes`). Credential fields accept `{{secret:...}}` references.
2226
+ */
2227
+ auth?: {
2228
+ [key: string]: unknown;
2229
+ } | null;
2220
2230
  } | null;
2221
2231
  /**
2222
2232
  * MCP server connection configuration. Required for `mcp` tools.
@@ -4334,7 +4344,7 @@ type Task = {
4334
4344
  };
4335
4345
  assignee?: string | null;
4336
4346
  /**
4337
- * { kind, id, status } of the current state's dispatch, if any.
4347
+ * { kind, id, status } of the current state's dispatch, if any. Carries an additional `attempt` (1-based) while the state's `on_enter.retry` policy is in effect.
4338
4348
  */
4339
4349
  active_dispatch?: {
4340
4350
  [key: string]: unknown;
@@ -4377,6 +4387,10 @@ type CreateTaskRequest = {
4377
4387
  [key: string]: unknown;
4378
4388
  };
4379
4389
  assignee?: string | null;
4390
+ /**
4391
+ * Name of a declared workflow state to create the task in directly, instead of the workflow's `initial` state. Must name a state declared on the workflow, or the request is rejected with `TASK_STATE_NOT_FOUND` (400). Defaults to the `initial` state.
4392
+ */
4393
+ state?: string;
4380
4394
  };
4381
4395
  type UpdateTaskRequest = {
4382
4396
  title?: string;
@@ -4422,6 +4436,13 @@ type Tool = {
4422
4436
  /**
4423
4437
  * Execution config for http tools. Supported fields: `url` (required), `method` (default `POST`), `headers`, and `body_mode`. The `url` may contain `{paramName}` placeholders (e.g. `/users/{userId}`) that are replaced at call time with the corresponding tool argument value (URL-encoded). Arguments consumed as path parameters are excluded from the query string and request body. `body_mode` is `json` (default) or `multipart`. In `multipart` mode the merged tool arguments are sent as a `multipart/form-data` body: scalar fields become plain form fields and a field shaped like `{ content_type, filename, data_base64 }` is decoded from base64 and attached as a file part (the hardcoded `Content-Type: application/json` is dropped so `fetch` sets the multipart boundary itself).
4424
4438
  *
4439
+ * `auth` adds a computed request credential, for targets whose `Authorization` value cannot be expressed as a static header. Supported `auth.type` values:
4440
+ *
4441
+ * - `aws_sigv4` — signs the request with AWS Signature Version 4. Requires `region`, `service`, `access_key_id` and `secret_access_key`; `session_token` is optional (temporary credentials). Incompatible with `body_mode: multipart`, whose body bytes are not known at signing time.
4442
+ * - `gcp_service_account` — mints a Google OAuth 2.0 access token from a signed service account assertion and sends it as a bearer token. Requires `credentials` (the service account key file JSON, as a string) and `scopes` (a non-empty array). Tokens are cached per service account and scope set until shortly before they expire.
4443
+ *
4444
+ * Credential fields accept `{{secret:...}}` references and should use them — a tool is readable by anyone who can `GET /tools`, and the stored reference is what is echoed back, never the resolved value.
4445
+ *
4425
4446
  */
4426
4447
  execute?: {
4427
4448
  [key: string]: unknown;
@@ -4453,7 +4474,7 @@ type Tool = {
4453
4474
  [key: string]: unknown;
4454
4475
  } | null;
4455
4476
  /**
4456
- * Universal JSON Logic mapping applied to the tool's raw result, for every tool type (`http`, `mcp`, `soat`, `pipeline`, `client`). Evaluated over `{ output: <raw result> }`, so `{ "var": "output.text" }` extracts a bare scalar field instead of requiring a wrapping `pipeline` tool. For `pipeline` tools this runs *after* the pipeline's own `output` mapping, over that mapping's result.
4477
+ * Universal JSON Logic mapping applied to the tool's raw result, for every tool type (`http`, `mcp`, `soat`, `pipeline`, `client`). Evaluated over `{ output: <raw result>, input: <merged input> }`, so `{ "var": "output.text" }` extracts a bare scalar field instead of requiring a wrapping `pipeline` tool, and `{ "var": "input.title" }` echoes back a field of the request that produced the response. For `pipeline` tools this runs *after* the pipeline's own `output` mapping, over that mapping's result.
4457
4478
  */
4458
4479
  output_mapping?: {
4459
4480
  [key: string]: unknown;
@@ -4491,6 +4512,13 @@ type CreateToolRequest = {
4491
4512
  /**
4492
4513
  * Execution config for http tools. Supported fields: `url` (required), `method` (default `POST`), `headers`, and `body_mode`. The `url` may contain `{paramName}` placeholders (e.g. `/users/{userId}`) that are replaced at call time with the corresponding tool argument value (URL-encoded). Arguments consumed as path parameters are excluded from the query string and request body. `body_mode` is `json` (default) or `multipart`. In `multipart` mode the merged tool arguments are sent as a `multipart/form-data` body: scalar fields become plain form fields and a field shaped like `{ content_type, filename, data_base64 }` is decoded from base64 and attached as a file part (the hardcoded `Content-Type: application/json` is dropped so `fetch` sets the multipart boundary itself).
4493
4514
  *
4515
+ * `auth` adds a computed request credential, for targets whose `Authorization` value cannot be expressed as a static header. Supported `auth.type` values:
4516
+ *
4517
+ * - `aws_sigv4` — signs the request with AWS Signature Version 4. Requires `region`, `service`, `access_key_id` and `secret_access_key`; `session_token` is optional (temporary credentials). Incompatible with `body_mode: multipart`, whose body bytes are not known at signing time.
4518
+ * - `gcp_service_account` — mints a Google OAuth 2.0 access token from a signed service account assertion and sends it as a bearer token. Requires `credentials` (the service account key file JSON, as a string) and `scopes` (a non-empty array). Tokens are cached per service account and scope set until shortly before they expire.
4519
+ *
4520
+ * Credential fields accept `{{secret:...}}` references and should use them — a tool is readable by anyone who can `GET /tools`, and the stored reference is what is echoed back, never the resolved value.
4521
+ *
4494
4522
  */
4495
4523
  execute?: {
4496
4524
  [key: string]: unknown;
@@ -4542,6 +4570,13 @@ type UpdateToolRequest = {
4542
4570
  /**
4543
4571
  * Execution config for http tools. Supported fields: `url` (required), `method` (default `POST`), `headers`, and `body_mode`. The `url` may contain `{paramName}` placeholders (e.g. `/users/{userId}`) that are replaced at call time with the corresponding tool argument value (URL-encoded). Arguments consumed as path parameters are excluded from the query string and request body. `body_mode` is `json` (default) or `multipart`. In `multipart` mode the merged tool arguments are sent as a `multipart/form-data` body: scalar fields become plain form fields and a field shaped like `{ content_type, filename, data_base64 }` is decoded from base64 and attached as a file part (the hardcoded `Content-Type: application/json` is dropped so `fetch` sets the multipart boundary itself).
4544
4572
  *
4573
+ * `auth` adds a computed request credential, for targets whose `Authorization` value cannot be expressed as a static header. Supported `auth.type` values:
4574
+ *
4575
+ * - `aws_sigv4` — signs the request with AWS Signature Version 4. Requires `region`, `service`, `access_key_id` and `secret_access_key`; `session_token` is optional (temporary credentials). Incompatible with `body_mode: multipart`, whose body bytes are not known at signing time.
4576
+ * - `gcp_service_account` — mints a Google OAuth 2.0 access token from a signed service account assertion and sends it as a bearer token. Requires `credentials` (the service account key file JSON, as a string) and `scopes` (a non-empty array). Tokens are cached per service account and scope set until shortly before they expire.
4577
+ *
4578
+ * Credential fields accept `{{secret:...}}` references and should use them — a tool is readable by anyone who can `GET /tools`, and the stored reference is what is echoed back, never the resolved value.
4579
+ *
4545
4580
  */
4546
4581
  execute?: {
4547
4582
  [key: string]: unknown;
@@ -5199,7 +5234,7 @@ type DeliveryListResponse = {
5199
5234
  offset?: number;
5200
5235
  };
5201
5236
  /**
5202
- * A named state. Exactly one state must be `initial: true`; any number may be `terminal: true`. A `kind: human` state never dispatches — the task parks until a transition fires. `on_enter` (§5) dispatches one agent generation or orchestration run on entry.
5237
+ * A named state. Exactly one state must be `initial: true`; any number may be `terminal: true`. A `kind: human` state never dispatches — the task parks until a transition fires. `on_enter` (§5) dispatches one agent generation or orchestration run on entry, optionally under a `retry` policy (`max_attempts` 1-10, `backoff_seconds`, `backoff_multiplier`) that re-runs execution failures before `on_failure` applies.
5203
5238
  */
5204
5239
  type WorkflowState = {
5205
5240
  name: string;
@@ -5833,7 +5868,8 @@ type DeleteAgentErrors = {
5833
5868
  */
5834
5869
  404: ErrorResponse;
5835
5870
  /**
5836
- * Agent has dependent generations or traces (pass `force=true` to delete anyway)
5871
+ * Agent has dependent generations or traces (pass `force=true` to delete anyway). `error.meta` carries `generationCount` and `traceCount` so a caller can tell which one is nonzero.
5872
+ *
5837
5873
  */
5838
5874
  409: ErrorResponse;
5839
5875
  };
@@ -12897,7 +12933,7 @@ type CreateTaskData = {
12897
12933
  };
12898
12934
  type CreateTaskErrors = {
12899
12935
  /**
12900
- * Bad request (invalid payload)
12936
+ * Bad request invalid payload (`TASK_PAYLOAD_INVALID`), or `state` does not name a declared state of the workflow (`TASK_STATE_NOT_FOUND`)
12901
12937
  */
12902
12938
  400: unknown;
12903
12939
  /**
@@ -15980,7 +16016,7 @@ declare class Tasks {
15980
16016
  /**
15981
16017
  * Create a task
15982
16018
  *
15983
- * Creates a task bound to a workflow. The task is placed in the workflow's initial state and that state's `on_enter` automation fires.
16019
+ * Creates a task bound to a workflow. By default the task is placed in the workflow's initial state; passing `state` places it directly in that named state instead — an alternate entry point for starting a task mid-flow (e.g. "a new recorte for an existing theme by id"), rather than re-submitting from the initial state and hoping a guard or similarity gate recognizes it. Entering the resulting state, initial or named, behaves identically: that state's `on_enter` automation fires and its `stalled_after` clock arms.
15984
16020
  */
15985
16021
  static createTask<ThrowOnError extends boolean = false>(options: Options<CreateTaskData, ThrowOnError>): RequestResult<CreateTaskResponses, CreateTaskErrors, ThrowOnError>;
15986
16022
  /**
package/dist/index.d.mts CHANGED
@@ -2217,6 +2217,16 @@ type ToolResourceProperties = {
2217
2217
  headers?: {
2218
2218
  [key: string]: unknown;
2219
2219
  } | null;
2220
+ /**
2221
+ * Request body encoding for `POST`/`PUT`/`PATCH`: `json` (default) or `multipart`. Incompatible with `auth.type: aws_sigv4`.
2222
+ */
2223
+ body_mode?: string | null;
2224
+ /**
2225
+ * Computed request credential. `type` is `aws_sigv4` (with `region`, `service`, `access_key_id`, `secret_access_key` and optional `session_token`) or `gcp_service_account` (with `credentials` and `scopes`). Credential fields accept `{{secret:...}}` references.
2226
+ */
2227
+ auth?: {
2228
+ [key: string]: unknown;
2229
+ } | null;
2220
2230
  } | null;
2221
2231
  /**
2222
2232
  * MCP server connection configuration. Required for `mcp` tools.
@@ -4334,7 +4344,7 @@ type Task = {
4334
4344
  };
4335
4345
  assignee?: string | null;
4336
4346
  /**
4337
- * { kind, id, status } of the current state's dispatch, if any.
4347
+ * { kind, id, status } of the current state's dispatch, if any. Carries an additional `attempt` (1-based) while the state's `on_enter.retry` policy is in effect.
4338
4348
  */
4339
4349
  active_dispatch?: {
4340
4350
  [key: string]: unknown;
@@ -4377,6 +4387,10 @@ type CreateTaskRequest = {
4377
4387
  [key: string]: unknown;
4378
4388
  };
4379
4389
  assignee?: string | null;
4390
+ /**
4391
+ * Name of a declared workflow state to create the task in directly, instead of the workflow's `initial` state. Must name a state declared on the workflow, or the request is rejected with `TASK_STATE_NOT_FOUND` (400). Defaults to the `initial` state.
4392
+ */
4393
+ state?: string;
4380
4394
  };
4381
4395
  type UpdateTaskRequest = {
4382
4396
  title?: string;
@@ -4422,6 +4436,13 @@ type Tool = {
4422
4436
  /**
4423
4437
  * Execution config for http tools. Supported fields: `url` (required), `method` (default `POST`), `headers`, and `body_mode`. The `url` may contain `{paramName}` placeholders (e.g. `/users/{userId}`) that are replaced at call time with the corresponding tool argument value (URL-encoded). Arguments consumed as path parameters are excluded from the query string and request body. `body_mode` is `json` (default) or `multipart`. In `multipart` mode the merged tool arguments are sent as a `multipart/form-data` body: scalar fields become plain form fields and a field shaped like `{ content_type, filename, data_base64 }` is decoded from base64 and attached as a file part (the hardcoded `Content-Type: application/json` is dropped so `fetch` sets the multipart boundary itself).
4424
4438
  *
4439
+ * `auth` adds a computed request credential, for targets whose `Authorization` value cannot be expressed as a static header. Supported `auth.type` values:
4440
+ *
4441
+ * - `aws_sigv4` — signs the request with AWS Signature Version 4. Requires `region`, `service`, `access_key_id` and `secret_access_key`; `session_token` is optional (temporary credentials). Incompatible with `body_mode: multipart`, whose body bytes are not known at signing time.
4442
+ * - `gcp_service_account` — mints a Google OAuth 2.0 access token from a signed service account assertion and sends it as a bearer token. Requires `credentials` (the service account key file JSON, as a string) and `scopes` (a non-empty array). Tokens are cached per service account and scope set until shortly before they expire.
4443
+ *
4444
+ * Credential fields accept `{{secret:...}}` references and should use them — a tool is readable by anyone who can `GET /tools`, and the stored reference is what is echoed back, never the resolved value.
4445
+ *
4425
4446
  */
4426
4447
  execute?: {
4427
4448
  [key: string]: unknown;
@@ -4453,7 +4474,7 @@ type Tool = {
4453
4474
  [key: string]: unknown;
4454
4475
  } | null;
4455
4476
  /**
4456
- * Universal JSON Logic mapping applied to the tool's raw result, for every tool type (`http`, `mcp`, `soat`, `pipeline`, `client`). Evaluated over `{ output: <raw result> }`, so `{ "var": "output.text" }` extracts a bare scalar field instead of requiring a wrapping `pipeline` tool. For `pipeline` tools this runs *after* the pipeline's own `output` mapping, over that mapping's result.
4477
+ * Universal JSON Logic mapping applied to the tool's raw result, for every tool type (`http`, `mcp`, `soat`, `pipeline`, `client`). Evaluated over `{ output: <raw result>, input: <merged input> }`, so `{ "var": "output.text" }` extracts a bare scalar field instead of requiring a wrapping `pipeline` tool, and `{ "var": "input.title" }` echoes back a field of the request that produced the response. For `pipeline` tools this runs *after* the pipeline's own `output` mapping, over that mapping's result.
4457
4478
  */
4458
4479
  output_mapping?: {
4459
4480
  [key: string]: unknown;
@@ -4491,6 +4512,13 @@ type CreateToolRequest = {
4491
4512
  /**
4492
4513
  * Execution config for http tools. Supported fields: `url` (required), `method` (default `POST`), `headers`, and `body_mode`. The `url` may contain `{paramName}` placeholders (e.g. `/users/{userId}`) that are replaced at call time with the corresponding tool argument value (URL-encoded). Arguments consumed as path parameters are excluded from the query string and request body. `body_mode` is `json` (default) or `multipart`. In `multipart` mode the merged tool arguments are sent as a `multipart/form-data` body: scalar fields become plain form fields and a field shaped like `{ content_type, filename, data_base64 }` is decoded from base64 and attached as a file part (the hardcoded `Content-Type: application/json` is dropped so `fetch` sets the multipart boundary itself).
4493
4514
  *
4515
+ * `auth` adds a computed request credential, for targets whose `Authorization` value cannot be expressed as a static header. Supported `auth.type` values:
4516
+ *
4517
+ * - `aws_sigv4` — signs the request with AWS Signature Version 4. Requires `region`, `service`, `access_key_id` and `secret_access_key`; `session_token` is optional (temporary credentials). Incompatible with `body_mode: multipart`, whose body bytes are not known at signing time.
4518
+ * - `gcp_service_account` — mints a Google OAuth 2.0 access token from a signed service account assertion and sends it as a bearer token. Requires `credentials` (the service account key file JSON, as a string) and `scopes` (a non-empty array). Tokens are cached per service account and scope set until shortly before they expire.
4519
+ *
4520
+ * Credential fields accept `{{secret:...}}` references and should use them — a tool is readable by anyone who can `GET /tools`, and the stored reference is what is echoed back, never the resolved value.
4521
+ *
4494
4522
  */
4495
4523
  execute?: {
4496
4524
  [key: string]: unknown;
@@ -4542,6 +4570,13 @@ type UpdateToolRequest = {
4542
4570
  /**
4543
4571
  * Execution config for http tools. Supported fields: `url` (required), `method` (default `POST`), `headers`, and `body_mode`. The `url` may contain `{paramName}` placeholders (e.g. `/users/{userId}`) that are replaced at call time with the corresponding tool argument value (URL-encoded). Arguments consumed as path parameters are excluded from the query string and request body. `body_mode` is `json` (default) or `multipart`. In `multipart` mode the merged tool arguments are sent as a `multipart/form-data` body: scalar fields become plain form fields and a field shaped like `{ content_type, filename, data_base64 }` is decoded from base64 and attached as a file part (the hardcoded `Content-Type: application/json` is dropped so `fetch` sets the multipart boundary itself).
4544
4572
  *
4573
+ * `auth` adds a computed request credential, for targets whose `Authorization` value cannot be expressed as a static header. Supported `auth.type` values:
4574
+ *
4575
+ * - `aws_sigv4` — signs the request with AWS Signature Version 4. Requires `region`, `service`, `access_key_id` and `secret_access_key`; `session_token` is optional (temporary credentials). Incompatible with `body_mode: multipart`, whose body bytes are not known at signing time.
4576
+ * - `gcp_service_account` — mints a Google OAuth 2.0 access token from a signed service account assertion and sends it as a bearer token. Requires `credentials` (the service account key file JSON, as a string) and `scopes` (a non-empty array). Tokens are cached per service account and scope set until shortly before they expire.
4577
+ *
4578
+ * Credential fields accept `{{secret:...}}` references and should use them — a tool is readable by anyone who can `GET /tools`, and the stored reference is what is echoed back, never the resolved value.
4579
+ *
4545
4580
  */
4546
4581
  execute?: {
4547
4582
  [key: string]: unknown;
@@ -5199,7 +5234,7 @@ type DeliveryListResponse = {
5199
5234
  offset?: number;
5200
5235
  };
5201
5236
  /**
5202
- * A named state. Exactly one state must be `initial: true`; any number may be `terminal: true`. A `kind: human` state never dispatches — the task parks until a transition fires. `on_enter` (§5) dispatches one agent generation or orchestration run on entry.
5237
+ * A named state. Exactly one state must be `initial: true`; any number may be `terminal: true`. A `kind: human` state never dispatches — the task parks until a transition fires. `on_enter` (§5) dispatches one agent generation or orchestration run on entry, optionally under a `retry` policy (`max_attempts` 1-10, `backoff_seconds`, `backoff_multiplier`) that re-runs execution failures before `on_failure` applies.
5203
5238
  */
5204
5239
  type WorkflowState = {
5205
5240
  name: string;
@@ -5833,7 +5868,8 @@ type DeleteAgentErrors = {
5833
5868
  */
5834
5869
  404: ErrorResponse;
5835
5870
  /**
5836
- * Agent has dependent generations or traces (pass `force=true` to delete anyway)
5871
+ * Agent has dependent generations or traces (pass `force=true` to delete anyway). `error.meta` carries `generationCount` and `traceCount` so a caller can tell which one is nonzero.
5872
+ *
5837
5873
  */
5838
5874
  409: ErrorResponse;
5839
5875
  };
@@ -12897,7 +12933,7 @@ type CreateTaskData = {
12897
12933
  };
12898
12934
  type CreateTaskErrors = {
12899
12935
  /**
12900
- * Bad request (invalid payload)
12936
+ * Bad request invalid payload (`TASK_PAYLOAD_INVALID`), or `state` does not name a declared state of the workflow (`TASK_STATE_NOT_FOUND`)
12901
12937
  */
12902
12938
  400: unknown;
12903
12939
  /**
@@ -15980,7 +16016,7 @@ declare class Tasks {
15980
16016
  /**
15981
16017
  * Create a task
15982
16018
  *
15983
- * Creates a task bound to a workflow. The task is placed in the workflow's initial state and that state's `on_enter` automation fires.
16019
+ * Creates a task bound to a workflow. By default the task is placed in the workflow's initial state; passing `state` places it directly in that named state instead — an alternate entry point for starting a task mid-flow (e.g. "a new recorte for an existing theme by id"), rather than re-submitting from the initial state and hoping a guard or similarity gate recognizes it. Entering the resulting state, initial or named, behaves identically: that state's `on_enter` automation fires and its `stalled_after` clock arms.
15984
16020
  */
15985
16021
  static createTask<ThrowOnError extends boolean = false>(options: Options<CreateTaskData, ThrowOnError>): RequestResult<CreateTaskResponses, CreateTaskErrors, ThrowOnError>;
15986
16022
  /**
package/dist/index.mjs CHANGED
@@ -3172,7 +3172,7 @@ var Tasks = class {
3172
3172
  /**
3173
3173
  * Create a task
3174
3174
  *
3175
- * Creates a task bound to a workflow. The task is placed in the workflow's initial state and that state's `on_enter` automation fires.
3175
+ * Creates a task bound to a workflow. By default the task is placed in the workflow's initial state; passing `state` places it directly in that named state instead — an alternate entry point for starting a task mid-flow (e.g. "a new recorte for an existing theme by id"), rather than re-submitting from the initial state and hoping a guard or similarity gate recognizes it. Entering the resulting state, initial or named, behaves identically: that state's `on_enter` automation fires and its `stalled_after` clock arms.
3176
3176
  */
3177
3177
  static createTask(options) {
3178
3178
  return (options.client ?? client).post({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.18.4",
3
+ "version": "0.18.5",
4
4
  "description": "TypeScript SDK for the SOAT API",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",