@labelbox/recursion-sdk 0.0.175 → 0.0.177

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.
@@ -22474,6 +22474,276 @@ export const SDK_REFERENCE = {
22474
22474
  ],
22475
22475
  },
22476
22476
  },
22477
+ getProblemRunUsage: {
22478
+ operationId: 'getProblemRunUsage',
22479
+ tag: 'problem-runs',
22480
+ callPath: ['problemRuns', 'getUsage'],
22481
+ namespace: 'problemRuns',
22482
+ method: 'getUsage',
22483
+ signature: 'rl.problemRuns.getUsage({ problemRunId })',
22484
+ example: "const result = await rl.problemRuns.getUsage({\n problemRunId: '<problemRunId>',\n});",
22485
+ cliInvocation: 'rl problem-runs get-usage',
22486
+ cliExample: 'rl problem-runs get-usage \\\n --problem-run-id <problemRunId>',
22487
+ curlExample: "curl -X GET 'https://api.recursion.labelbox.com/v1/problem-runs/<problemRunId>/usage' \\\n -H 'Authorization: Bearer $LABELBOX_API_KEY'",
22488
+ summary: 'Get cost and resource usage for a problem run',
22489
+ description: 'One row per agent-service run attributed to the problem run (the solver, then each grader), each with its cost and, when the runner reported it, what the container consumed against what it was granted. Rows appear as the underlying runs finish.',
22490
+ httpMethod: 'get',
22491
+ path: '/v1/problem-runs/{problemRunId}/usage',
22492
+ requiredPermissions: ['runs:read'],
22493
+ params: [
22494
+ {
22495
+ name: 'problemRunId',
22496
+ in: 'path',
22497
+ required: true,
22498
+ type: 'string',
22499
+ description: 'Stable problem-run identifier (UUID). One solver attempt at one problem version.',
22500
+ format: 'uuid',
22501
+ },
22502
+ ],
22503
+ response: {
22504
+ type: 'ProblemRunUsageResponseDto',
22505
+ description: 'Cost and consumed-vs-requested resources for every agent-service run behind a problem run.',
22506
+ fields: [
22507
+ {
22508
+ name: 'items',
22509
+ required: true,
22510
+ type: 'object[]',
22511
+ description: 'One row per agent-service run attributed to this problem run: the solver first, then graders.',
22512
+ items: {
22513
+ type: 'object',
22514
+ description: 'Cost and resource usage of one agent-service run attributed to a problem run.',
22515
+ fields: [
22516
+ {
22517
+ name: 'runType',
22518
+ required: true,
22519
+ type: 'string',
22520
+ description: "Which agent-service run this row bills: 'solver' for the attempt itself, or a grading type such as 'agentic_grading'.",
22521
+ example: 'solver',
22522
+ },
22523
+ {
22524
+ name: 'modelName',
22525
+ required: true,
22526
+ type: 'string',
22527
+ description: 'Model the run used, when known.',
22528
+ nullable: true,
22529
+ },
22530
+ {
22531
+ name: 'agentCostUsd',
22532
+ required: true,
22533
+ type: 'number',
22534
+ description: 'USD spent on model calls. Null when not reported.',
22535
+ nullable: true,
22536
+ },
22537
+ {
22538
+ name: 'computeCostUsd',
22539
+ required: true,
22540
+ type: 'number',
22541
+ description: 'USD spent on compute. Null when not reported.',
22542
+ nullable: true,
22543
+ },
22544
+ {
22545
+ name: 'totalCostUsd',
22546
+ required: true,
22547
+ type: 'number',
22548
+ description: 'Agent plus compute cost in USD. Null when neither leg was reported.',
22549
+ nullable: true,
22550
+ },
22551
+ {
22552
+ name: 'inputTokens',
22553
+ required: true,
22554
+ type: 'integer',
22555
+ description: 'Uncached input tokens. Null when not reported.',
22556
+ nullable: true,
22557
+ minimum: -9007199254740991,
22558
+ maximum: 9007199254740991,
22559
+ },
22560
+ {
22561
+ name: 'outputTokens',
22562
+ required: true,
22563
+ type: 'integer',
22564
+ description: 'Output tokens. Null when not reported.',
22565
+ nullable: true,
22566
+ minimum: -9007199254740991,
22567
+ maximum: 9007199254740991,
22568
+ },
22569
+ {
22570
+ name: 'cacheReadInputTokens',
22571
+ required: true,
22572
+ type: 'integer',
22573
+ description: 'Input tokens served from prompt cache. Null when not reported.',
22574
+ nullable: true,
22575
+ minimum: -9007199254740991,
22576
+ maximum: 9007199254740991,
22577
+ },
22578
+ {
22579
+ name: 'cacheCreationInputTokens',
22580
+ required: true,
22581
+ type: 'integer',
22582
+ description: 'Input tokens written to prompt cache. Null when not reported.',
22583
+ nullable: true,
22584
+ minimum: -9007199254740991,
22585
+ maximum: 9007199254740991,
22586
+ },
22587
+ {
22588
+ name: 'resourceUsage',
22589
+ required: true,
22590
+ type: 'object',
22591
+ description: 'Resources the run consumed. Null for runs whose runner predates resource sampling or whose container could not be read.',
22592
+ nullable: true,
22593
+ fields: [
22594
+ {
22595
+ name: 'scope',
22596
+ required: true,
22597
+ type: 'string',
22598
+ description: "Sampling scope reported by the runner, e.g. 'cgroup' for the run's own container.",
22599
+ },
22600
+ {
22601
+ name: 'sampleCount',
22602
+ required: true,
22603
+ type: 'number',
22604
+ description: 'Number of samples folded into this summary.',
22605
+ },
22606
+ {
22607
+ name: 'sampledSeconds',
22608
+ required: true,
22609
+ type: 'number',
22610
+ description: 'Wall-clock seconds the samples cover — the workload phase, not queueing.',
22611
+ },
22612
+ {
22613
+ name: 'cpu',
22614
+ required: true,
22615
+ type: 'object',
22616
+ description: 'CPU consumed against what was requested.',
22617
+ fields: [
22618
+ {
22619
+ name: 'avgMillicores',
22620
+ required: true,
22621
+ type: 'number',
22622
+ description: 'Interval-weighted mean CPU in millicores; 1000 is one core fully busy.',
22623
+ },
22624
+ {
22625
+ name: 'peakMillicores',
22626
+ required: true,
22627
+ type: 'number',
22628
+ description: 'Highest sampled CPU in millicores.',
22629
+ },
22630
+ {
22631
+ name: 'capacityMillicores',
22632
+ required: true,
22633
+ type: 'number',
22634
+ description: 'CPU the container was granted (its cgroup limit) — the requested amount. Null when the runner could not read a limit.',
22635
+ nullable: true,
22636
+ },
22637
+ {
22638
+ name: 'coreSeconds',
22639
+ required: true,
22640
+ type: 'number',
22641
+ description: 'Total CPU time consumed: the integral of cores over the sampled interval.',
22642
+ },
22643
+ ],
22644
+ },
22645
+ {
22646
+ name: 'memory',
22647
+ required: true,
22648
+ type: 'object',
22649
+ description: 'Memory consumed against what was requested.',
22650
+ fields: [
22651
+ {
22652
+ name: 'avgWorkingSetBytes',
22653
+ required: true,
22654
+ type: 'number',
22655
+ description: 'Interval-weighted mean working-set memory in bytes.',
22656
+ },
22657
+ {
22658
+ name: 'peakWorkingSetBytes',
22659
+ required: true,
22660
+ type: 'number',
22661
+ description: 'Highest sampled working-set memory in bytes.',
22662
+ },
22663
+ {
22664
+ name: 'capacityBytes',
22665
+ required: true,
22666
+ type: 'number',
22667
+ description: 'Memory the container was granted (its cgroup limit) — the requested amount. Null when the runner could not read a limit.',
22668
+ nullable: true,
22669
+ },
22670
+ ],
22671
+ },
22672
+ {
22673
+ name: 'gpu',
22674
+ required: true,
22675
+ type: 'object',
22676
+ description: 'GPU utilization and memory. Null when the run had no GPU.',
22677
+ nullable: true,
22678
+ fields: [
22679
+ {
22680
+ name: 'count',
22681
+ required: true,
22682
+ type: 'number',
22683
+ description: 'GPUs visible to the container.',
22684
+ },
22685
+ {
22686
+ name: 'avgUtilizationPercent',
22687
+ required: true,
22688
+ type: 'number',
22689
+ description: 'Interval-weighted mean GPU utilization, 0-100.',
22690
+ },
22691
+ {
22692
+ name: 'peakUtilizationPercent',
22693
+ required: true,
22694
+ type: 'number',
22695
+ description: 'Highest sampled GPU utilization, 0-100.',
22696
+ },
22697
+ {
22698
+ name: 'peakMemoryUsedBytes',
22699
+ required: true,
22700
+ type: 'number',
22701
+ description: 'Highest sampled GPU memory in use.',
22702
+ },
22703
+ {
22704
+ name: 'memoryTotalBytes',
22705
+ required: true,
22706
+ type: 'number',
22707
+ description: 'Total GPU memory across the visible devices.',
22708
+ },
22709
+ ],
22710
+ },
22711
+ {
22712
+ name: 'disk',
22713
+ required: true,
22714
+ type: 'object',
22715
+ description: 'Workspace disk usage. Null when the runner could not read the filesystem.',
22716
+ nullable: true,
22717
+ fields: [
22718
+ {
22719
+ name: 'peakUsedBytes',
22720
+ required: true,
22721
+ type: 'number',
22722
+ description: 'Highest sampled workspace disk usage in bytes.',
22723
+ },
22724
+ {
22725
+ name: 'capacityBytes',
22726
+ required: true,
22727
+ type: 'number',
22728
+ description: 'Workspace disk capacity in bytes.',
22729
+ },
22730
+ ],
22731
+ },
22732
+ ],
22733
+ },
22734
+ ],
22735
+ },
22736
+ },
22737
+ {
22738
+ name: 'totalCostUsd',
22739
+ required: true,
22740
+ type: 'number',
22741
+ description: 'Sum of every row that reported a cost. Null when no row has cost data yet.',
22742
+ nullable: true,
22743
+ },
22744
+ ],
22745
+ },
22746
+ },
22477
22747
  getProblemVersion: {
22478
22748
  operationId: 'getProblemVersion',
22479
22749
  tag: 'problem-versions',
@@ -54051,7 +54321,7 @@ export const SDK_REFERENCE = {
54051
54321
  namespace: 'managedAgents',
54052
54322
  method: 'listSessions',
54053
54323
  signature: 'rl.managedAgents.listSessions()',
54054
- 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});',
54324
+ 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, page_token\n});',
54055
54325
  cliInvocation: 'rl managed-agents list-sessions',
54056
54326
  cliExample: 'rl managed-agents list-sessions',
54057
54327
  curlExample: "curl -X GET 'https://api.recursion.labelbox.com/managed-agents/v1/sessions' \\\n -H 'Authorization: Bearer $LABELBOX_API_KEY'",
@@ -54129,19 +54399,33 @@ export const SDK_REFERENCE = {
54129
54399
  in: 'query',
54130
54400
  required: false,
54131
54401
  type: 'integer',
54402
+ description: 'Page size. When more rows match, the response carries next_page_token; pass it back as page_token with the same filters and limit to read the next page.',
54132
54403
  default: 100,
54133
54404
  maximum: 1000,
54134
54405
  },
54406
+ {
54407
+ name: 'page_token',
54408
+ in: 'query',
54409
+ required: false,
54410
+ type: 'string',
54411
+ description: "Signed continuation token from a previous page's next_page_token. Bound to the organization and to the exact filters and limit it was issued for; valid for one hour.",
54412
+ },
54135
54413
  ],
54136
54414
  response: {
54137
54415
  type: 'ManagedAgentsSessionListResponse',
54138
- description: 'Response body of GET /v1/sessions. This list is limit-truncated rather than cursored: it carries no continuation token, so a caller that hits the limit must narrow the filters (status, kind, agent_id, external_source_*) rather than page onward. Token and cost totals are not included; fetch them for a batch of ids via GET /v1/sessions/usage.',
54416
+ description: 'Response body of GET /v1/sessions. Keyset-paginated over (updated_at, id): a page is a stable window at the moment it is read, but a session updated between two page reads moves to the front of the list, so a live list may show it twice or skip it once. Each row is a summary without the start-time snapshots; read one session for those. Token and cost totals are not included; fetch them for a batch of ids via GET /v1/sessions/usage and GET /v1/sessions/costs.',
54139
54417
  fields: [
54418
+ {
54419
+ name: 'next_page_token',
54420
+ required: false,
54421
+ type: 'string',
54422
+ description: 'Present when more sessions match. Pass it as page_token with the same filters and limit to read the next page. Absent on the last page.',
54423
+ },
54140
54424
  {
54141
54425
  name: 'sessions',
54142
54426
  required: false,
54143
54427
  type: 'unknown',
54144
- description: "Sessions matching the query filters, newest first, capped by limit (default 100). May be null or an empty array; both mean nothing matched. Rows the caller's access policy does not permit are dropped silently rather than reported.",
54428
+ description: "Sessions matching the query filters, most recently updated first, at most limit (default 100) per page. May be null or an empty array; both mean nothing matched. Rows the caller's access policy does not permit are dropped silently rather than reported. Rows are summaries: agent_snapshot and model_snapshot are omitted and config is an empty object; GET /v1/sessions/{session_id} returns them.",
54145
54429
  },
54146
54430
  ],
54147
54431
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbox/recursion-sdk",
3
- "version": "0.0.175",
3
+ "version": "0.0.177",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",