@labelbox/recursion-sdk 0.0.162 → 0.0.164

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.
@@ -2977,6 +2977,7 @@ export const RESOURCE_REFERENCE = {
2977
2977
  'managedAgentsListSessionModelCostNodes',
2978
2978
  'managedAgentsListSessionModelCosts',
2979
2979
  'managedAgentsListSessionOutcomes',
2980
+ 'managedAgentsListSessionResourceSamples',
2980
2981
  'managedAgentsListSessionThreads',
2981
2982
  'managedAgentsListSessionUsage',
2982
2983
  'managedAgentsListSessions',
@@ -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,
@@ -53637,6 +53643,131 @@ export const SDK_REFERENCE = {
53637
53643
  ],
53638
53644
  },
53639
53645
  },
53646
+ managedAgentsListSessionResourceSamples: {
53647
+ operationId: 'managedAgentsListSessionResourceSamples',
53648
+ tag: 'managed-agents',
53649
+ callPath: ['managedAgents', 'listSessionResourceSamples'],
53650
+ namespace: 'managedAgents',
53651
+ method: 'listSessionResourceSamples',
53652
+ signature: 'rl.managedAgents.listSessionResourceSamples({ session_id })',
53653
+ example: "const result = await rl.managedAgents.listSessionResourceSamples({\n session_id: '<session_id>',\n // optional: from, to, resolution, limit, page_token\n});",
53654
+ cliInvocation: 'rl managed-agents list-session-resource-samples',
53655
+ cliExample: 'rl managed-agents list-session-resource-samples \\\n --session_id <session_id>',
53656
+ curlExample: "curl -X GET 'https://api.recursion.labelbox.com/managed-agents/v1/sessions/<session_id>/resource-samples' \\\n -H 'Authorization: Bearer $LABELBOX_API_KEY'",
53657
+ summary: 'Read sandbox CPU, memory, and GPU usage for a session tree',
53658
+ description: "Returns the tree's sandbox attachments and one page of per-minute resource usage buckets for them, ordered by attachment then time. Each bucket carries the minute's average and peak; resolution=raw adds the individual samples as parallel arrays indexed by offsets_ms. A tree whose compute was released and revived has several attachments; follow revived_from_sandbox_id to connect them. live reports whether a sandbox is still attached, which is the cue to keep polling. An empty sandboxes list means the tree never ran in a sandbox or sampling is disabled; an attachment with sampling_source=unsupported means the sandbox could not measure itself.",
53659
+ httpMethod: 'get',
53660
+ path: '/managed-agents/v1/sessions/{session_id}/resource-samples',
53661
+ requiredPermissions: ['managed-agents:read'],
53662
+ params: [
53663
+ {
53664
+ name: 'from',
53665
+ in: 'query',
53666
+ required: false,
53667
+ type: 'string',
53668
+ description: 'Inclusive lower bound on bucket_start, RFC 3339. Omit for the start of the tree.',
53669
+ format: 'date-time',
53670
+ },
53671
+ {
53672
+ name: 'to',
53673
+ in: 'query',
53674
+ required: false,
53675
+ type: 'string',
53676
+ description: 'Exclusive upper bound on bucket_start, RFC 3339. Omit for now.',
53677
+ format: 'date-time',
53678
+ },
53679
+ {
53680
+ name: 'resolution',
53681
+ in: 'query',
53682
+ required: false,
53683
+ type: 'string',
53684
+ description: "minute returns per-minute summaries only; raw also includes each bucket's per-sample arrays at the producer's cadence (five seconds by default). Use raw for the window on screen and minute for the overview.",
53685
+ enum: ['minute', 'raw'],
53686
+ default: 'minute',
53687
+ },
53688
+ {
53689
+ name: 'limit',
53690
+ in: 'query',
53691
+ required: false,
53692
+ type: 'integer',
53693
+ description: "Maximum buckets per page, across all of the tree's sandbox attachments.",
53694
+ default: 120,
53695
+ minimum: 1,
53696
+ maximum: 720,
53697
+ },
53698
+ {
53699
+ name: 'page_token',
53700
+ in: 'query',
53701
+ required: false,
53702
+ type: 'string',
53703
+ description: "Signed continuation token from a previous page's next_page_token. Bound to the organization, session, and filters it was issued for.",
53704
+ },
53705
+ {
53706
+ name: 'session_id',
53707
+ in: 'path',
53708
+ required: true,
53709
+ type: 'string',
53710
+ description: 'Any session id (UUID) in the tree. The sandbox is shared by the whole tree, so every id in it returns the same usage.',
53711
+ format: 'uuid',
53712
+ },
53713
+ ],
53714
+ response: {
53715
+ type: 'ManagedAgentsSessionResourceSamplesResponse',
53716
+ description: 'Sandbox CPU, memory, and accelerator usage for a session tree, as minute buckets per sandbox attachment. Samples are what the sandbox measured of itself, drained to the control plane on tool calls and on read.',
53717
+ fields: [
53718
+ {
53719
+ name: 'as_of',
53720
+ required: false,
53721
+ type: 'string',
53722
+ description: 'RFC 3339 server time at which the page was read.',
53723
+ format: 'date-time',
53724
+ },
53725
+ {
53726
+ name: 'buckets',
53727
+ required: false,
53728
+ type: 'unknown',
53729
+ description: 'One page of minute buckets ordered by (sandbox_id, bucket_start). Each bucket names its attachment; join on sandboxes to place it on a lane.',
53730
+ },
53731
+ {
53732
+ name: 'live',
53733
+ required: false,
53734
+ type: 'boolean',
53735
+ description: 'True while a sandbox that can be sampled is still attached to the tree. A client keeps polling while this is true and stops once it turns false; an attached sandbox that cannot measure itself does not keep it true.',
53736
+ },
53737
+ {
53738
+ name: 'next_page_token',
53739
+ required: false,
53740
+ type: 'string',
53741
+ description: 'Present when more buckets remain. Pass as page_token with the same query to continue.',
53742
+ },
53743
+ {
53744
+ name: 'resolution',
53745
+ required: false,
53746
+ type: 'string',
53747
+ description: 'Resolution the buckets were read at.',
53748
+ enum: ['minute', 'raw'],
53749
+ },
53750
+ {
53751
+ name: 'root_session_id',
53752
+ required: false,
53753
+ type: 'string',
53754
+ description: 'Root of the tree the usage belongs to.',
53755
+ },
53756
+ {
53757
+ name: 'sandboxes',
53758
+ required: false,
53759
+ type: 'unknown',
53760
+ description: 'Every sandbox attachment the tree has had, oldest first, including ones that have since been released or closed. Empty when the tree never had a sandbox or sampling is disabled. Complete on every page.',
53761
+ },
53762
+ {
53763
+ name: 'session_id',
53764
+ required: false,
53765
+ type: 'string',
53766
+ description: 'Session id named in the request.',
53767
+ },
53768
+ ],
53769
+ },
53770
+ },
53640
53771
  managedAgentsListSessionThreads: {
53641
53772
  operationId: 'managedAgentsListSessionThreads',
53642
53773
  tag: 'managed-agents',
@@ -53721,7 +53852,7 @@ export const SDK_REFERENCE = {
53721
53852
  namespace: 'managedAgents',
53722
53853
  method: 'listSessions',
53723
53854
  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});',
53855
+ 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
53856
  cliInvocation: 'rl managed-agents list-sessions',
53726
53857
  cliExample: 'rl managed-agents list-sessions',
53727
53858
  curlExample: "curl -X GET 'https://api.recursion.labelbox.com/managed-agents/v1/sessions' \\\n -H 'Authorization: Bearer $LABELBOX_API_KEY'",
@@ -53771,6 +53902,22 @@ export const SDK_REFERENCE = {
53771
53902
  required: false,
53772
53903
  type: 'string',
53773
53904
  },
53905
+ {
53906
+ name: 'metadata',
53907
+ in: 'query',
53908
+ required: false,
53909
+ type: 'string[]',
53910
+ 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.",
53911
+ maxItems: 32,
53912
+ },
53913
+ {
53914
+ name: 'metadata_key',
53915
+ in: 'query',
53916
+ required: false,
53917
+ type: 'string[]',
53918
+ description: 'Require the root session to carry this caller-defined metadata key with any value. Repeatable; every listed key must be present.',
53919
+ maxItems: 32,
53920
+ },
53774
53921
  {
53775
53922
  name: 'root_only',
53776
53923
  in: 'query',
@@ -55016,10 +55163,10 @@ export const SDK_REFERENCE = {
55016
55163
  method: 'startSession',
55017
55164
  bodyKey: 'body',
55018
55165
  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});',
55166
+ 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
55167
  cliInvocation: 'rl managed-agents start-session',
55021
55168
  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 }\'',
55169
+ 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
55170
  summary: 'Start a managed session',
55024
55171
  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
55172
  httpMethod: 'post',
@@ -55093,6 +55240,13 @@ export const SDK_REFERENCE = {
55093
55240
  type: 'string',
55094
55241
  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
55242
  },
55243
+ {
55244
+ name: 'metadata',
55245
+ in: 'body',
55246
+ required: false,
55247
+ type: 'object',
55248
+ 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.",
55249
+ },
55096
55250
  {
55097
55251
  name: 'outcome',
55098
55252
  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.164",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",