@soat/sdk 0.32.0 → 0.33.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.cjs CHANGED
@@ -2938,7 +2938,9 @@ var Orchestrations = class {
2938
2938
  /**
2939
2939
  * List orchestration runs
2940
2940
  *
2941
- * Returns orchestration runs the caller can access, optionally filtered by orchestration.
2941
+ * Returns orchestration runs the caller can access, optionally filtered by orchestration, by parent run, or by whether the run has a parent at all.
2942
+ *
2943
+ * Note when aggregating: a run's `usage` covers its whole subtree, so summing it over a list that contains both a parent and its children counts the children more than once. Pass `nested=false` to sum over runs a caller started.
2942
2944
  */
2943
2945
  static listOrchestrationRuns(options) {
2944
2946
  return (options?.client ?? client).get({
@@ -4312,9 +4314,7 @@ const bindResource = (SdkClass, client) => {
4312
4314
  } });
4313
4315
  };
4314
4316
  /**
4315
- * Stripe-style SOAT client.
4316
- *
4317
- * Create an instance once and reuse it throughout your application:
4317
+ * Stripe-style SOAT client. Create an instance once and reuse it:
4318
4318
  *
4319
4319
  * ```ts
4320
4320
  * import { SoatClient } from '@soat/sdk';
@@ -4327,14 +4327,13 @@ const bindResource = (SdkClass, client) => {
4327
4327
  * });
4328
4328
  * ```
4329
4329
  *
4330
- * The instance exposes one property per API resource. Each property mirrors
4331
- * the corresponding static class from the generated SDK, so all method
4332
- * signatures, types, and return values are identical — the only difference
4333
- * is that you never need to supply `client` yourself.
4330
+ * One property per API resource, each mirroring the corresponding static class
4331
+ * from the generated SDK — identical signatures, types and return values, only
4332
+ * without having to supply `client`.
4334
4333
  *
4335
- * The list is exhaustive by construction: `NoUnregisteredResource` at the
4336
- * bottom of this file fails `pnpm typecheck` when a spec adds a resource this
4337
- * class does not expose.
4334
+ * The list is exhaustive by construction: `NoUnregisteredResource` at the bottom
4335
+ * of this file fails `pnpm typecheck` when a spec adds a resource this class
4336
+ * does not expose.
4338
4337
  */
4339
4338
  var SoatClient = class {
4340
4339
  activity;
package/dist/index.d.cts CHANGED
@@ -4593,6 +4593,14 @@ type OrchestrationRun = {
4593
4593
  metadata?: {
4594
4594
  [key: string]: unknown;
4595
4595
  } | null;
4596
+ /**
4597
+ * The run whose node started this one — set only on a child a `loop` or `sub_orchestration` node spawned, null for a run a caller started. A child is its own run with its own usage events, so this is what makes a delegated run's spend attributable to the run that ordered it.
4598
+ */
4599
+ parent_orchestration_run_id?: string | null;
4600
+ /**
4601
+ * The node within `parent_orchestration_run_id` that started this run. Null when `parent_orchestration_run_id` is null.
4602
+ */
4603
+ parent_node_id?: string | null;
4596
4604
  /**
4597
4605
  * Terminal node artifact(s) when the run has succeeded.
4598
4606
  */
@@ -4604,9 +4612,17 @@ type OrchestrationRun = {
4604
4612
  */
4605
4613
  node_executions?: Array<NodeExecution>;
4606
4614
  /**
4607
- * Usage roll-up (token counts and cost_usd) summed across every metered generation the run produced. Present on the single-run read; omitted from run list responses.
4615
+ * What the run cost: token counts and `cost_usd` summed across every metered generation it produced **and every run it started** through `loop` / `sub_orchestration` nodes, at any depth. Present on the single-run read; omitted from run list responses.
4616
+ *
4617
+ * A nested child is a run record of its own, so this figure spans several of them. Two consequences: summing `usage` across a list that mixes parents and children double-counts (filter with `nested=false`), and the per-event receipt at `/api/v1/usage/receipt` stays scoped to one run — its line items carry a `node_id` from one graph only.
4608
4618
  */
4609
4619
  usage?: RunUsageTotals;
4620
+ /**
4621
+ * The same roll-up restricted to **this run's own nodes**, excluding every nested run it started. Equal to `usage` for a run with no children; below it for a run that delegates. Present on the single-run read; omitted from run list responses.
4622
+ *
4623
+ * This is the field to read to see where cost sits in a run tree — own versus subtree — without walking the children.
4624
+ */
4625
+ usage_own?: RunUsageTotals;
4610
4626
  required_action?: RequiredAction | null;
4611
4627
  started_at?: Date | null;
4612
4628
  completed_at?: Date | null;
@@ -5367,6 +5383,8 @@ type Tool = {
5367
5383
  context_keys?: Array<string> | null;
5368
5384
  /**
5369
5385
  * Fixed parameters pinned on every call this tool makes, whatever its type. Keys matching fields in the input schema are removed from the schema shown to the model, and a pinned value wins over one the model or a direct caller supplies for the same key.
5386
+ *
5387
+ * Values accept `{{context:<key>}}` references, resolved per call from the caller's `tool_context`, so a pin can be the run's own value — the one account this run may act on — rather than one fixed when the tool was created. A resolved value is retyped to the parameter's declared schema type; a key missing from the call's `tool_context` fails the call with `MISSING_TOOL_CONTEXT_KEY` rather than sending the literal placeholder. `{{secret:...}}` is not resolved here. See the Tool Context reference.
5370
5388
  */
5371
5389
  preset_parameters?: {
5372
5390
  [key: string]: unknown;
@@ -5449,6 +5467,8 @@ type CreateToolRequest = {
5449
5467
  context_keys?: Array<string> | null;
5450
5468
  /**
5451
5469
  * Fixed parameters pinned on every call this tool makes, whatever its type. Keys matching fields in the input schema are removed from the schema shown to the model, and a pinned value wins over one the model or a direct caller supplies for the same key.
5470
+ *
5471
+ * Values accept `{{context:<key>}}` references, resolved per call from the caller's `tool_context`, so a pin can be the run's own value — the one account this run may act on — rather than one fixed when the tool was created. A resolved value is retyped to the parameter's declared schema type; a key missing from the call's `tool_context` fails the call with `MISSING_TOOL_CONTEXT_KEY` rather than sending the literal placeholder. `{{secret:...}}` is not resolved here. See the Tool Context reference.
5452
5472
  */
5453
5473
  preset_parameters?: {
5454
5474
  [key: string]: unknown;
@@ -5513,6 +5533,8 @@ type UpdateToolRequest = {
5513
5533
  context_keys?: Array<string> | null;
5514
5534
  /**
5515
5535
  * Fixed parameters pinned on every call this tool makes, whatever its type. Keys matching fields in the input schema are removed from the schema shown to the model, and a pinned value wins over one the model or a direct caller supplies for the same key.
5536
+ *
5537
+ * Values accept `{{context:<key>}}` references, resolved per call from the caller's `tool_context`, so a pin can be the run's own value — the one account this run may act on — rather than one fixed when the tool was created. A resolved value is retyped to the parameter's declared schema type; a key missing from the call's `tool_context` fails the call with `MISSING_TOOL_CONTEXT_KEY` rather than sending the literal placeholder. `{{secret:...}}` is not resolved here. See the Tool Context reference.
5516
5538
  */
5517
5539
  preset_parameters?: {
5518
5540
  [key: string]: unknown;
@@ -7379,6 +7401,20 @@ type ListAiProvidersResponses = {
7379
7401
  name?: string;
7380
7402
  provider?: 'openai' | 'anthropic' | 'google' | 'xai' | 'groq' | 'ollama' | 'azure' | 'bedrock' | 'vertex' | 'gateway' | 'custom';
7381
7403
  default_model?: string;
7404
+ /**
7405
+ * Secret ID containing API credentials, or null when the record links none.
7406
+ */
7407
+ secret_id?: string | null;
7408
+ /**
7409
+ * Custom base URL for the provider. Absent when the record sets none.
7410
+ */
7411
+ base_url?: string;
7412
+ /**
7413
+ * Additional provider-specific configuration. Absent when the record sets none.
7414
+ */
7415
+ config?: {
7416
+ [key: string]: unknown;
7417
+ };
7382
7418
  project_id?: string;
7383
7419
  created_at?: Date;
7384
7420
  updated_at?: Date;
@@ -13330,6 +13366,16 @@ type ListOrchestrationRunsData = {
13330
13366
  * Filter by orchestration public ID (orch_...)
13331
13367
  */
13332
13368
  orchestration_id?: string;
13369
+ /**
13370
+ * Filter to the runs one specific parent run's `loop` / `sub_orchestration` nodes started (run_...). This is how a caller holding a parent names the individual children behind its `usage`.
13371
+ */
13372
+ parent_orchestration_run_id?: string;
13373
+ /**
13374
+ * Filter by whether the run was started by another run. `false` returns only the runs a caller started (no parent), which is the set to sum `usage` over; `true` returns only the runs a `loop` / `sub_orchestration` node started, across every parent. Omit to return both.
13375
+ *
13376
+ * Contradicting `parent_orchestration_run_id` with `nested=false` is a `400`; any value other than `true` or `false` is a `400`.
13377
+ */
13378
+ nested?: boolean;
13333
13379
  /**
13334
13380
  * Maximum number of results to return
13335
13381
  */
@@ -18174,7 +18220,9 @@ declare class Orchestrations {
18174
18220
  /**
18175
18221
  * List orchestration runs
18176
18222
  *
18177
- * Returns orchestration runs the caller can access, optionally filtered by orchestration.
18223
+ * Returns orchestration runs the caller can access, optionally filtered by orchestration, by parent run, or by whether the run has a parent at all.
18224
+ *
18225
+ * Note when aggregating: a run's `usage` covers its whole subtree, so summing it over a list that contains both a parent and its children counts the children more than once. Pass `nested=false` to sum over runs a caller started.
18178
18226
  */
18179
18227
  static listOrchestrationRuns<ThrowOnError extends boolean = false>(options?: Options<ListOrchestrationRunsData, ThrowOnError>): RequestResult<ListOrchestrationRunsResponses, ListOrchestrationRunsErrors, ThrowOnError>;
18180
18228
  /**
@@ -18877,9 +18925,7 @@ interface SoatClientOptions {
18877
18925
  headers?: Record<string, string>;
18878
18926
  }
18879
18927
  /**
18880
- * Stripe-style SOAT client.
18881
- *
18882
- * Create an instance once and reuse it throughout your application:
18928
+ * Stripe-style SOAT client. Create an instance once and reuse it:
18883
18929
  *
18884
18930
  * ```ts
18885
18931
  * import { SoatClient } from '@soat/sdk';
@@ -18892,14 +18938,13 @@ interface SoatClientOptions {
18892
18938
  * });
18893
18939
  * ```
18894
18940
  *
18895
- * The instance exposes one property per API resource. Each property mirrors
18896
- * the corresponding static class from the generated SDK, so all method
18897
- * signatures, types, and return values are identical — the only difference
18898
- * is that you never need to supply `client` yourself.
18941
+ * One property per API resource, each mirroring the corresponding static class
18942
+ * from the generated SDK — identical signatures, types and return values, only
18943
+ * without having to supply `client`.
18899
18944
  *
18900
- * The list is exhaustive by construction: `NoUnregisteredResource` at the
18901
- * bottom of this file fails `pnpm typecheck` when a spec adds a resource this
18902
- * class does not expose.
18945
+ * The list is exhaustive by construction: `NoUnregisteredResource` at the bottom
18946
+ * of this file fails `pnpm typecheck` when a spec adds a resource this class
18947
+ * does not expose.
18903
18948
  */
18904
18949
  declare class SoatClient {
18905
18950
  readonly activity: typeof Activity;
package/dist/index.d.mts CHANGED
@@ -4593,6 +4593,14 @@ type OrchestrationRun = {
4593
4593
  metadata?: {
4594
4594
  [key: string]: unknown;
4595
4595
  } | null;
4596
+ /**
4597
+ * The run whose node started this one — set only on a child a `loop` or `sub_orchestration` node spawned, null for a run a caller started. A child is its own run with its own usage events, so this is what makes a delegated run's spend attributable to the run that ordered it.
4598
+ */
4599
+ parent_orchestration_run_id?: string | null;
4600
+ /**
4601
+ * The node within `parent_orchestration_run_id` that started this run. Null when `parent_orchestration_run_id` is null.
4602
+ */
4603
+ parent_node_id?: string | null;
4596
4604
  /**
4597
4605
  * Terminal node artifact(s) when the run has succeeded.
4598
4606
  */
@@ -4604,9 +4612,17 @@ type OrchestrationRun = {
4604
4612
  */
4605
4613
  node_executions?: Array<NodeExecution>;
4606
4614
  /**
4607
- * Usage roll-up (token counts and cost_usd) summed across every metered generation the run produced. Present on the single-run read; omitted from run list responses.
4615
+ * What the run cost: token counts and `cost_usd` summed across every metered generation it produced **and every run it started** through `loop` / `sub_orchestration` nodes, at any depth. Present on the single-run read; omitted from run list responses.
4616
+ *
4617
+ * A nested child is a run record of its own, so this figure spans several of them. Two consequences: summing `usage` across a list that mixes parents and children double-counts (filter with `nested=false`), and the per-event receipt at `/api/v1/usage/receipt` stays scoped to one run — its line items carry a `node_id` from one graph only.
4608
4618
  */
4609
4619
  usage?: RunUsageTotals;
4620
+ /**
4621
+ * The same roll-up restricted to **this run's own nodes**, excluding every nested run it started. Equal to `usage` for a run with no children; below it for a run that delegates. Present on the single-run read; omitted from run list responses.
4622
+ *
4623
+ * This is the field to read to see where cost sits in a run tree — own versus subtree — without walking the children.
4624
+ */
4625
+ usage_own?: RunUsageTotals;
4610
4626
  required_action?: RequiredAction | null;
4611
4627
  started_at?: Date | null;
4612
4628
  completed_at?: Date | null;
@@ -5367,6 +5383,8 @@ type Tool = {
5367
5383
  context_keys?: Array<string> | null;
5368
5384
  /**
5369
5385
  * Fixed parameters pinned on every call this tool makes, whatever its type. Keys matching fields in the input schema are removed from the schema shown to the model, and a pinned value wins over one the model or a direct caller supplies for the same key.
5386
+ *
5387
+ * Values accept `{{context:<key>}}` references, resolved per call from the caller's `tool_context`, so a pin can be the run's own value — the one account this run may act on — rather than one fixed when the tool was created. A resolved value is retyped to the parameter's declared schema type; a key missing from the call's `tool_context` fails the call with `MISSING_TOOL_CONTEXT_KEY` rather than sending the literal placeholder. `{{secret:...}}` is not resolved here. See the Tool Context reference.
5370
5388
  */
5371
5389
  preset_parameters?: {
5372
5390
  [key: string]: unknown;
@@ -5449,6 +5467,8 @@ type CreateToolRequest = {
5449
5467
  context_keys?: Array<string> | null;
5450
5468
  /**
5451
5469
  * Fixed parameters pinned on every call this tool makes, whatever its type. Keys matching fields in the input schema are removed from the schema shown to the model, and a pinned value wins over one the model or a direct caller supplies for the same key.
5470
+ *
5471
+ * Values accept `{{context:<key>}}` references, resolved per call from the caller's `tool_context`, so a pin can be the run's own value — the one account this run may act on — rather than one fixed when the tool was created. A resolved value is retyped to the parameter's declared schema type; a key missing from the call's `tool_context` fails the call with `MISSING_TOOL_CONTEXT_KEY` rather than sending the literal placeholder. `{{secret:...}}` is not resolved here. See the Tool Context reference.
5452
5472
  */
5453
5473
  preset_parameters?: {
5454
5474
  [key: string]: unknown;
@@ -5513,6 +5533,8 @@ type UpdateToolRequest = {
5513
5533
  context_keys?: Array<string> | null;
5514
5534
  /**
5515
5535
  * Fixed parameters pinned on every call this tool makes, whatever its type. Keys matching fields in the input schema are removed from the schema shown to the model, and a pinned value wins over one the model or a direct caller supplies for the same key.
5536
+ *
5537
+ * Values accept `{{context:<key>}}` references, resolved per call from the caller's `tool_context`, so a pin can be the run's own value — the one account this run may act on — rather than one fixed when the tool was created. A resolved value is retyped to the parameter's declared schema type; a key missing from the call's `tool_context` fails the call with `MISSING_TOOL_CONTEXT_KEY` rather than sending the literal placeholder. `{{secret:...}}` is not resolved here. See the Tool Context reference.
5516
5538
  */
5517
5539
  preset_parameters?: {
5518
5540
  [key: string]: unknown;
@@ -7379,6 +7401,20 @@ type ListAiProvidersResponses = {
7379
7401
  name?: string;
7380
7402
  provider?: 'openai' | 'anthropic' | 'google' | 'xai' | 'groq' | 'ollama' | 'azure' | 'bedrock' | 'vertex' | 'gateway' | 'custom';
7381
7403
  default_model?: string;
7404
+ /**
7405
+ * Secret ID containing API credentials, or null when the record links none.
7406
+ */
7407
+ secret_id?: string | null;
7408
+ /**
7409
+ * Custom base URL for the provider. Absent when the record sets none.
7410
+ */
7411
+ base_url?: string;
7412
+ /**
7413
+ * Additional provider-specific configuration. Absent when the record sets none.
7414
+ */
7415
+ config?: {
7416
+ [key: string]: unknown;
7417
+ };
7382
7418
  project_id?: string;
7383
7419
  created_at?: Date;
7384
7420
  updated_at?: Date;
@@ -13330,6 +13366,16 @@ type ListOrchestrationRunsData = {
13330
13366
  * Filter by orchestration public ID (orch_...)
13331
13367
  */
13332
13368
  orchestration_id?: string;
13369
+ /**
13370
+ * Filter to the runs one specific parent run's `loop` / `sub_orchestration` nodes started (run_...). This is how a caller holding a parent names the individual children behind its `usage`.
13371
+ */
13372
+ parent_orchestration_run_id?: string;
13373
+ /**
13374
+ * Filter by whether the run was started by another run. `false` returns only the runs a caller started (no parent), which is the set to sum `usage` over; `true` returns only the runs a `loop` / `sub_orchestration` node started, across every parent. Omit to return both.
13375
+ *
13376
+ * Contradicting `parent_orchestration_run_id` with `nested=false` is a `400`; any value other than `true` or `false` is a `400`.
13377
+ */
13378
+ nested?: boolean;
13333
13379
  /**
13334
13380
  * Maximum number of results to return
13335
13381
  */
@@ -18174,7 +18220,9 @@ declare class Orchestrations {
18174
18220
  /**
18175
18221
  * List orchestration runs
18176
18222
  *
18177
- * Returns orchestration runs the caller can access, optionally filtered by orchestration.
18223
+ * Returns orchestration runs the caller can access, optionally filtered by orchestration, by parent run, or by whether the run has a parent at all.
18224
+ *
18225
+ * Note when aggregating: a run's `usage` covers its whole subtree, so summing it over a list that contains both a parent and its children counts the children more than once. Pass `nested=false` to sum over runs a caller started.
18178
18226
  */
18179
18227
  static listOrchestrationRuns<ThrowOnError extends boolean = false>(options?: Options<ListOrchestrationRunsData, ThrowOnError>): RequestResult<ListOrchestrationRunsResponses, ListOrchestrationRunsErrors, ThrowOnError>;
18180
18228
  /**
@@ -18877,9 +18925,7 @@ interface SoatClientOptions {
18877
18925
  headers?: Record<string, string>;
18878
18926
  }
18879
18927
  /**
18880
- * Stripe-style SOAT client.
18881
- *
18882
- * Create an instance once and reuse it throughout your application:
18928
+ * Stripe-style SOAT client. Create an instance once and reuse it:
18883
18929
  *
18884
18930
  * ```ts
18885
18931
  * import { SoatClient } from '@soat/sdk';
@@ -18892,14 +18938,13 @@ interface SoatClientOptions {
18892
18938
  * });
18893
18939
  * ```
18894
18940
  *
18895
- * The instance exposes one property per API resource. Each property mirrors
18896
- * the corresponding static class from the generated SDK, so all method
18897
- * signatures, types, and return values are identical — the only difference
18898
- * is that you never need to supply `client` yourself.
18941
+ * One property per API resource, each mirroring the corresponding static class
18942
+ * from the generated SDK — identical signatures, types and return values, only
18943
+ * without having to supply `client`.
18899
18944
  *
18900
- * The list is exhaustive by construction: `NoUnregisteredResource` at the
18901
- * bottom of this file fails `pnpm typecheck` when a spec adds a resource this
18902
- * class does not expose.
18945
+ * The list is exhaustive by construction: `NoUnregisteredResource` at the bottom
18946
+ * of this file fails `pnpm typecheck` when a spec adds a resource this class
18947
+ * does not expose.
18903
18948
  */
18904
18949
  declare class SoatClient {
18905
18950
  readonly activity: typeof Activity;
package/dist/index.mjs CHANGED
@@ -2937,7 +2937,9 @@ var Orchestrations = class {
2937
2937
  /**
2938
2938
  * List orchestration runs
2939
2939
  *
2940
- * Returns orchestration runs the caller can access, optionally filtered by orchestration.
2940
+ * Returns orchestration runs the caller can access, optionally filtered by orchestration, by parent run, or by whether the run has a parent at all.
2941
+ *
2942
+ * Note when aggregating: a run's `usage` covers its whole subtree, so summing it over a list that contains both a parent and its children counts the children more than once. Pass `nested=false` to sum over runs a caller started.
2941
2943
  */
2942
2944
  static listOrchestrationRuns(options) {
2943
2945
  return (options?.client ?? client).get({
@@ -4311,9 +4313,7 @@ const bindResource = (SdkClass, client) => {
4311
4313
  } });
4312
4314
  };
4313
4315
  /**
4314
- * Stripe-style SOAT client.
4315
- *
4316
- * Create an instance once and reuse it throughout your application:
4316
+ * Stripe-style SOAT client. Create an instance once and reuse it:
4317
4317
  *
4318
4318
  * ```ts
4319
4319
  * import { SoatClient } from '@soat/sdk';
@@ -4326,14 +4326,13 @@ const bindResource = (SdkClass, client) => {
4326
4326
  * });
4327
4327
  * ```
4328
4328
  *
4329
- * The instance exposes one property per API resource. Each property mirrors
4330
- * the corresponding static class from the generated SDK, so all method
4331
- * signatures, types, and return values are identical — the only difference
4332
- * is that you never need to supply `client` yourself.
4329
+ * One property per API resource, each mirroring the corresponding static class
4330
+ * from the generated SDK — identical signatures, types and return values, only
4331
+ * without having to supply `client`.
4333
4332
  *
4334
- * The list is exhaustive by construction: `NoUnregisteredResource` at the
4335
- * bottom of this file fails `pnpm typecheck` when a spec adds a resource this
4336
- * class does not expose.
4333
+ * The list is exhaustive by construction: `NoUnregisteredResource` at the bottom
4334
+ * of this file fails `pnpm typecheck` when a spec adds a resource this class
4335
+ * does not expose.
4337
4336
  */
4338
4337
  var SoatClient = class {
4339
4338
  activity;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.32.0",
3
+ "version": "0.33.1",
4
4
  "description": "TypeScript SDK for SOAT — open-source infrastructure for production-ready AI agents.",
5
5
  "keywords": [
6
6
  "ai-agents",