@labelbox/recursion-sdk 0.0.162 → 0.0.163

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.
@@ -480,6 +480,8 @@ export declare class ManagedAgents extends HeyApiClient {
480
480
  tag_ids?: string;
481
481
  external_source_type?: string;
482
482
  external_source_id?: string;
483
+ metadata?: Array<string>;
484
+ metadata_key?: Array<string>;
483
485
  root_only?: boolean;
484
486
  limit?: number;
485
487
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<GetManagedAgentsV1SessionsResponses, GetManagedAgentsV1SessionsErrors, ThrowOnError, "data">;
@@ -913,6 +913,8 @@ export class ManagedAgents extends HeyApiClient {
913
913
  { in: 'query', key: 'tag_ids' },
914
914
  { in: 'query', key: 'external_source_type' },
915
915
  { in: 'query', key: 'external_source_id' },
916
+ { in: 'query', key: 'metadata' },
917
+ { in: 'query', key: 'metadata_key' },
916
918
  { in: 'query', key: 'root_only' },
917
919
  { in: 'query', key: 'limit' }
918
920
  ] }]);
@@ -10613,6 +10613,12 @@ export type ManagedAgentsSession = {
10613
10613
  * RFC 3339 timestamp of when the agent loop last made progress. Distinct from updated_at, which any metadata write touches. Absent for sessions that run no loop.
10614
10614
  */
10615
10615
  last_activity_at?: unknown;
10616
+ /**
10617
+ * Caller-defined string key/value pairs supplied when the session was started, e.g. ids from your own system. Immutable, present on root sessions only, and filterable with metadata=key:value or metadata_key=key on GET /v1/sessions. At most 32 entries; keys use letters, digits, '_', '.', and '-' up to 64 characters; values are 1-512 characters.
10618
+ */
10619
+ metadata?: {
10620
+ [key: string]: string;
10621
+ };
10616
10622
  /**
10617
10623
  * Model reference the session's turns run on (UUID), resolved at start from the agent version or the start request.
10618
10624
  */
@@ -11205,6 +11211,12 @@ export type ManagedAgentsStartSessionRequest = {
11205
11211
  * Opening user message for the session, and the context the agent works from. Send it alongside an outcome to supply facts the agent needs without making them part of what the grader measures; the grader never sees it. Kept in the session's system prompt for the whole run, so context compaction cannot summarize it away.
11206
11212
  */
11207
11213
  message?: string;
11214
+ /**
11215
+ * Caller-defined string key/value pairs stored on the session, e.g. ids that map it back to your own system. Write-once: they cannot be changed after start. At most 32 entries; keys use letters, digits, '_', '.', and '-' up to 64 characters; values are 1-512 characters without control characters. Returned as metadata on GET /v1/sessions and filterable with metadata=key:value (repeatable, AND) or metadata_key=key.
11216
+ */
11217
+ metadata?: {
11218
+ [key: string]: string;
11219
+ };
11208
11220
  outcome?: ManagedAgentsDefineOutcomeRequest;
11209
11221
  /**
11210
11222
  * Labelbox project this session's work is attributed to, which the model gateway bills against. Required when the chosen model runs on an account restricted to customer projects, such as the Anthropic HDO models; the start is rejected without it.
@@ -25962,6 +25974,14 @@ export type GetManagedAgentsV1SessionsData = {
25962
25974
  tag_ids?: string;
25963
25975
  external_source_type?: string;
25964
25976
  external_source_id?: string;
25977
+ /**
25978
+ * Exact-match filter on caller-defined session metadata as key:value, split at the first colon. Repeat the parameter to require several pairs; a session's root must carry every one (AND semantics). Children of a matching root match too, so combine with root_only to list only the roots.
25979
+ */
25980
+ metadata?: Array<string>;
25981
+ /**
25982
+ * Require the root session to carry this caller-defined metadata key with any value. Repeatable; every listed key must be present.
25983
+ */
25984
+ metadata_key?: Array<string>;
25965
25985
  /**
25966
25986
  * Return only root sessions. Use this for model-cost list rows so children cannot consume the bounded page before their tree root.
25967
25987
  */
@@ -51295,6 +51295,12 @@ export const SDK_REFERENCE = {
51295
51295
  description: 'RFC 3339 timestamp of when the agent loop last made progress. Distinct from updated_at, which any metadata write touches. Absent for sessions that run no loop.',
51296
51296
  format: 'date-time',
51297
51297
  },
51298
+ {
51299
+ name: 'metadata',
51300
+ required: false,
51301
+ type: 'object',
51302
+ description: "Caller-defined string key/value pairs supplied when the session was started, e.g. ids from your own system. Immutable, present on root sessions only, and filterable with metadata=key:value or metadata_key=key on GET /v1/sessions. At most 32 entries; keys use letters, digits, '_', '.', and '-' up to 64 characters; values are 1-512 characters.",
51303
+ },
51298
51304
  {
51299
51305
  name: 'model_ref_id',
51300
51306
  required: false,
@@ -53721,7 +53727,7 @@ export const SDK_REFERENCE = {
53721
53727
  namespace: 'managedAgents',
53722
53728
  method: 'listSessions',
53723
53729
  signature: 'rl.managedAgents.listSessions()',
53724
- example: 'const result = await rl.managedAgents.listSessions({\n // optional: status, kind, agent_id, tag_ids, external_source_type, external_source_id, root_only, limit\n});',
53730
+ example: 'const result = await rl.managedAgents.listSessions({\n // optional: status, kind, agent_id, tag_ids, external_source_type, external_source_id, metadata, metadata_key, root_only, limit\n});',
53725
53731
  cliInvocation: 'rl managed-agents list-sessions',
53726
53732
  cliExample: 'rl managed-agents list-sessions',
53727
53733
  curlExample: "curl -X GET 'https://api.recursion.labelbox.com/managed-agents/v1/sessions' \\\n -H 'Authorization: Bearer $LABELBOX_API_KEY'",
@@ -53771,6 +53777,22 @@ export const SDK_REFERENCE = {
53771
53777
  required: false,
53772
53778
  type: 'string',
53773
53779
  },
53780
+ {
53781
+ name: 'metadata',
53782
+ in: 'query',
53783
+ required: false,
53784
+ type: 'string[]',
53785
+ description: "Exact-match filter on caller-defined session metadata as key:value, split at the first colon. Repeat the parameter to require several pairs; a session's root must carry every one (AND semantics). Children of a matching root match too, so combine with root_only to list only the roots.",
53786
+ maxItems: 32,
53787
+ },
53788
+ {
53789
+ name: 'metadata_key',
53790
+ in: 'query',
53791
+ required: false,
53792
+ type: 'string[]',
53793
+ description: 'Require the root session to carry this caller-defined metadata key with any value. Repeatable; every listed key must be present.',
53794
+ maxItems: 32,
53795
+ },
53774
53796
  {
53775
53797
  name: 'root_only',
53776
53798
  in: 'query',
@@ -55016,10 +55038,10 @@ export const SDK_REFERENCE = {
55016
55038
  method: 'startSession',
55017
55039
  bodyKey: 'body',
55018
55040
  signature: 'rl.managedAgents.startSession({ body })',
55019
- example: 'const result = await rl.managedAgents.startSession({\n body: {\n agent_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n credential_refs: [\n {\n credential_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n vault_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d"\n }\n ],\n environment_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n external_source_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n external_source_type: "example",\n idempotency_key: "example",\n message: "example",\n outcome: {\n description: "example",\n grader_model_ref_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n max_iterations: 1,\n rubric: "example"\n },\n project_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n skip_default_outcome: true,\n vault_ids: [\n "example"\n ]\n },\n});',
55041
+ example: 'const result = await rl.managedAgents.startSession({\n body: {\n agent_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n credential_refs: [\n {\n credential_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n vault_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d"\n }\n ],\n environment_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n external_source_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n external_source_type: "example",\n idempotency_key: "example",\n message: "example",\n metadata: {\n key: "example"\n },\n outcome: {\n description: "example",\n grader_model_ref_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n max_iterations: 1,\n rubric: "example"\n },\n project_id: "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n skip_default_outcome: true,\n vault_ids: [\n "example"\n ]\n },\n});',
55020
55042
  cliInvocation: 'rl managed-agents start-session',
55021
55043
  cliExample: "rl managed-agents start-session \\\n --agent_id '9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d' \\\n --environment_id '9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d' \\\n --from-json body.json",
55022
- curlExample: 'curl -X POST \'https://api.recursion.labelbox.com/managed-agents/v1/sessions\' \\\n -H \'Authorization: Bearer $LABELBOX_API_KEY\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "agent_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n "credential_refs": [\n {\n "credential_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n "vault_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d"\n }\n ],\n "environment_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n "external_source_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n "external_source_type": "example",\n "idempotency_key": "example",\n "message": "example",\n "outcome": {\n "description": "example",\n "grader_model_ref_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n "max_iterations": 1,\n "rubric": "example"\n },\n "project_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n "skip_default_outcome": true,\n "vault_ids": [\n "example"\n ]\n }\'',
55044
+ curlExample: 'curl -X POST \'https://api.recursion.labelbox.com/managed-agents/v1/sessions\' \\\n -H \'Authorization: Bearer $LABELBOX_API_KEY\' \\\n -H \'Content-Type: application/json\' \\\n -d \'{\n "agent_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n "credential_refs": [\n {\n "credential_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n "vault_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d"\n }\n ],\n "environment_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n "external_source_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n "external_source_type": "example",\n "idempotency_key": "example",\n "message": "example",\n "metadata": {\n "key": "example"\n },\n "outcome": {\n "description": "example",\n "grader_model_ref_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n "max_iterations": 1,\n "rubric": "example"\n },\n "project_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",\n "skip_default_outcome": true,\n "vault_ids": [\n "example"\n ]\n }\'',
55023
55045
  summary: 'Start a managed session',
55024
55046
  description: 'Starts a managed agent session and returns 202 with its session_id and status_path; the agent runs asynchronously, so poll getSession or subscribe with streamSessionEvents to follow it. Sandbox compute is provisioned here, which is where a session begins costing money. Send an Idempotency-Key header to make retries safe: the same key with the same body returns the original session, and with a different body is rejected.',
55025
55047
  httpMethod: 'post',
@@ -55093,6 +55115,13 @@ export const SDK_REFERENCE = {
55093
55115
  type: 'string',
55094
55116
  description: "Opening user message for the session, and the context the agent works from. Send it alongside an outcome to supply facts the agent needs without making them part of what the grader measures; the grader never sees it. Kept in the session's system prompt for the whole run, so context compaction cannot summarize it away.",
55095
55117
  },
55118
+ {
55119
+ name: 'metadata',
55120
+ in: 'body',
55121
+ required: false,
55122
+ type: 'object',
55123
+ description: "Caller-defined string key/value pairs stored on the session, e.g. ids that map it back to your own system. Write-once: they cannot be changed after start. At most 32 entries; keys use letters, digits, '_', '.', and '-' up to 64 characters; values are 1-512 characters without control characters. Returned as metadata on GET /v1/sessions and filterable with metadata=key:value (repeatable, AND) or metadata_key=key.",
55124
+ },
55096
55125
  {
55097
55126
  name: 'outcome',
55098
55127
  in: 'body',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbox/recursion-sdk",
3
- "version": "0.0.162",
3
+ "version": "0.0.163",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",