@soat/sdk 0.32.0 → 0.33.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.
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({
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;
@@ -13330,6 +13352,16 @@ type ListOrchestrationRunsData = {
13330
13352
  * Filter by orchestration public ID (orch_...)
13331
13353
  */
13332
13354
  orchestration_id?: string;
13355
+ /**
13356
+ * 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`.
13357
+ */
13358
+ parent_orchestration_run_id?: string;
13359
+ /**
13360
+ * 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.
13361
+ *
13362
+ * Contradicting `parent_orchestration_run_id` with `nested=false` is a `400`; any value other than `true` or `false` is a `400`.
13363
+ */
13364
+ nested?: boolean;
13333
13365
  /**
13334
13366
  * Maximum number of results to return
13335
13367
  */
@@ -18174,7 +18206,9 @@ declare class Orchestrations {
18174
18206
  /**
18175
18207
  * List orchestration runs
18176
18208
  *
18177
- * Returns orchestration runs the caller can access, optionally filtered by orchestration.
18209
+ * Returns orchestration runs the caller can access, optionally filtered by orchestration, by parent run, or by whether the run has a parent at all.
18210
+ *
18211
+ * 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
18212
  */
18179
18213
  static listOrchestrationRuns<ThrowOnError extends boolean = false>(options?: Options<ListOrchestrationRunsData, ThrowOnError>): RequestResult<ListOrchestrationRunsResponses, ListOrchestrationRunsErrors, ThrowOnError>;
18180
18214
  /**
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;
@@ -13330,6 +13352,16 @@ type ListOrchestrationRunsData = {
13330
13352
  * Filter by orchestration public ID (orch_...)
13331
13353
  */
13332
13354
  orchestration_id?: string;
13355
+ /**
13356
+ * 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`.
13357
+ */
13358
+ parent_orchestration_run_id?: string;
13359
+ /**
13360
+ * 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.
13361
+ *
13362
+ * Contradicting `parent_orchestration_run_id` with `nested=false` is a `400`; any value other than `true` or `false` is a `400`.
13363
+ */
13364
+ nested?: boolean;
13333
13365
  /**
13334
13366
  * Maximum number of results to return
13335
13367
  */
@@ -18174,7 +18206,9 @@ declare class Orchestrations {
18174
18206
  /**
18175
18207
  * List orchestration runs
18176
18208
  *
18177
- * Returns orchestration runs the caller can access, optionally filtered by orchestration.
18209
+ * Returns orchestration runs the caller can access, optionally filtered by orchestration, by parent run, or by whether the run has a parent at all.
18210
+ *
18211
+ * 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
18212
  */
18179
18213
  static listOrchestrationRuns<ThrowOnError extends boolean = false>(options?: Options<ListOrchestrationRunsData, ThrowOnError>): RequestResult<ListOrchestrationRunsResponses, ListOrchestrationRunsErrors, ThrowOnError>;
18180
18214
  /**
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({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "description": "TypeScript SDK for SOAT — open-source infrastructure for production-ready AI agents.",
5
5
  "keywords": [
6
6
  "ai-agents",