@agent-os-sdk/client 0.9.4 → 0.9.6

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.
@@ -2647,138 +2647,6 @@
2647
2647
  }
2648
2648
  }
2649
2649
  },
2650
- "/v1/api/runs/dlq": {
2651
- "get": {
2652
- "tags": [
2653
- "Dlq"
2654
- ],
2655
- "summary": "List DLQ messages.",
2656
- "parameters": [
2657
- {
2658
- "name": "messageType",
2659
- "in": "query",
2660
- "schema": {
2661
- "type": "string"
2662
- }
2663
- },
2664
- {
2665
- "name": "skip",
2666
- "in": "query",
2667
- "schema": {
2668
- "type": "integer",
2669
- "format": "int32",
2670
- "default": 0
2671
- }
2672
- },
2673
- {
2674
- "name": "take",
2675
- "in": "query",
2676
- "schema": {
2677
- "type": "integer",
2678
- "format": "int32",
2679
- "default": 50
2680
- }
2681
- }
2682
- ],
2683
- "responses": {
2684
- "200": {
2685
- "description": "OK"
2686
- }
2687
- }
2688
- }
2689
- },
2690
- "/v1/api/runs/dlq/{id}": {
2691
- "get": {
2692
- "tags": [
2693
- "Dlq"
2694
- ],
2695
- "summary": "Get a specific DLQ message.",
2696
- "parameters": [
2697
- {
2698
- "name": "id",
2699
- "in": "path",
2700
- "required": true,
2701
- "schema": {
2702
- "type": "string",
2703
- "format": "uuid"
2704
- }
2705
- }
2706
- ],
2707
- "responses": {
2708
- "200": {
2709
- "description": "OK"
2710
- }
2711
- }
2712
- },
2713
- "delete": {
2714
- "tags": [
2715
- "Dlq"
2716
- ],
2717
- "summary": "Delete/acknowledge a DLQ message.",
2718
- "parameters": [
2719
- {
2720
- "name": "id",
2721
- "in": "path",
2722
- "required": true,
2723
- "schema": {
2724
- "type": "string",
2725
- "format": "uuid"
2726
- }
2727
- }
2728
- ],
2729
- "responses": {
2730
- "200": {
2731
- "description": "OK"
2732
- }
2733
- }
2734
- }
2735
- },
2736
- "/v1/api/runs/dlq/{id}/retry": {
2737
- "post": {
2738
- "tags": [
2739
- "Dlq"
2740
- ],
2741
- "summary": "Retry a DLQ message (re-enqueue the original operation).",
2742
- "parameters": [
2743
- {
2744
- "name": "id",
2745
- "in": "path",
2746
- "required": true,
2747
- "schema": {
2748
- "type": "string",
2749
- "format": "uuid"
2750
- }
2751
- }
2752
- ],
2753
- "responses": {
2754
- "200": {
2755
- "description": "OK"
2756
- }
2757
- }
2758
- }
2759
- },
2760
- "/v1/api/runs/dlq/purge": {
2761
- "delete": {
2762
- "tags": [
2763
- "Dlq"
2764
- ],
2765
- "summary": "Purge all DLQ messages for the tenant.",
2766
- "parameters": [
2767
- {
2768
- "name": "messageType",
2769
- "in": "query",
2770
- "schema": {
2771
- "type": "string"
2772
- }
2773
- }
2774
- ],
2775
- "responses": {
2776
- "200": {
2777
- "description": "OK"
2778
- }
2779
- }
2780
- }
2781
- },
2782
2650
  "/v1/api/evaluations/datasets": {
2783
2651
  "post": {
2784
2652
  "tags": [
@@ -5371,7 +5239,7 @@
5371
5239
  "content": {
5372
5240
  "application/json": {
5373
5241
  "schema": {
5374
- "$ref": "#/components/schemas/ReplayResponse"
5242
+ "$ref": "#/components/schemas/RunReplayResponse"
5375
5243
  }
5376
5244
  }
5377
5245
  }
@@ -10416,6 +10284,36 @@
10416
10284
  "type": "integer",
10417
10285
  "format": "int32",
10418
10286
  "nullable": true
10287
+ },
10288
+ "execute": {
10289
+ "type": "boolean"
10290
+ },
10291
+ "provider": {
10292
+ "type": "string",
10293
+ "nullable": true
10294
+ },
10295
+ "model": {
10296
+ "type": "string",
10297
+ "nullable": true
10298
+ },
10299
+ "credential_id": {
10300
+ "type": "string",
10301
+ "format": "uuid",
10302
+ "nullable": true
10303
+ },
10304
+ "credential_name": {
10305
+ "type": "string",
10306
+ "nullable": true
10307
+ },
10308
+ "temperature": {
10309
+ "type": "number",
10310
+ "format": "double",
10311
+ "nullable": true
10312
+ },
10313
+ "max_tokens": {
10314
+ "type": "integer",
10315
+ "format": "int32",
10316
+ "nullable": true
10419
10317
  }
10420
10318
  },
10421
10319
  "additionalProperties": false
@@ -10721,6 +10619,11 @@
10721
10619
  "type": "integer",
10722
10620
  "format": "int32"
10723
10621
  },
10622
+ "min_score": {
10623
+ "type": "number",
10624
+ "format": "float",
10625
+ "nullable": true
10626
+ },
10724
10627
  "filters": {
10725
10628
  "type": "object",
10726
10629
  "additionalProperties": { },
@@ -11082,6 +10985,32 @@
11082
10985
  },
11083
10986
  "additionalProperties": false
11084
10987
  },
10988
+ "RunReplayResponse": {
10989
+ "type": "object",
10990
+ "properties": {
10991
+ "run_id": {
10992
+ "type": "string",
10993
+ "format": "uuid"
10994
+ },
10995
+ "replayed_from_run_id": {
10996
+ "type": "string",
10997
+ "format": "uuid"
10998
+ },
10999
+ "replayed_from_checkpoint_id": {
11000
+ "type": "string",
11001
+ "format": "uuid"
11002
+ },
11003
+ "mode": {
11004
+ "type": "string",
11005
+ "nullable": true
11006
+ },
11007
+ "status": {
11008
+ "type": "string",
11009
+ "nullable": true
11010
+ }
11011
+ },
11012
+ "additionalProperties": false
11013
+ },
11085
11014
  "RunResponse": {
11086
11015
  "type": "object",
11087
11016
  "properties": {
@@ -12361,9 +12290,6 @@
12361
12290
  {
12362
12291
  "name": "Datasets"
12363
12292
  },
12364
- {
12365
- "name": "Dlq"
12366
- },
12367
12293
  {
12368
12294
  "name": "Evaluation"
12369
12295
  },
@@ -15,7 +15,8 @@ import { parseSSE, type SSEEvent } from "../sse/client.js";
15
15
  type WaitRunResponse = components["schemas"]["WaitRunResponse"];
16
16
  type BatchRunResponse = components["schemas"]["BatchRunResponse"];
17
17
  type CancelRunResponse = components["schemas"]["CancelRunResponse"];
18
- type CheckpointListResponse = components["schemas"]["CheckpointListResponse"];
18
+ type CheckpointIndexResponse = components["schemas"]["CheckpointIndexResponse"];
19
+ type RunReplayResponse = components["schemas"]["RunReplayResponse"];
19
20
 
20
21
  // Response types
21
22
  export interface Run {
@@ -278,33 +279,18 @@ export class RunsModule {
278
279
  /**
279
280
  * Replay from checkpoint (stateful).
280
281
  * Creates a NEW run that starts from the specified checkpoint.
281
- *
282
- * @param runId - The original run to replay from
283
- * @param checkpointId - The checkpoint ID to start from
284
- * @param options - Replay options
285
- * @returns New run created from checkpoint
286
- *
287
- * @example
288
- * ```ts
289
- * const checkpoints = await client.runs.getCheckpoints(runId)
290
- * const newRun = await client.runs.replay(runId, checkpoints[2].id, {
291
- * mode: 'best_effort',
292
- * reason: 'Debugging step 3'
293
- * })
294
- * ```
295
282
  */
296
283
  async replay(
297
284
  runId: string,
298
- checkpointId?: string,
285
+ checkpointId: string,
299
286
  options?: {
300
287
  mode?: "best_effort" | "strict";
301
288
  reason?: string;
302
289
  }
303
- ): Promise<APIResponse<CreateRunResponse>> {
304
- return this.client.POST<CreateRunResponse>("/v1/api/runs/{runId}/replay", {
305
- params: { path: { runId } },
290
+ ): Promise<APIResponse<RunReplayResponse>> {
291
+ return this.client.POST<RunReplayResponse>("/v1/api/runs/{runId}/checkpoints/{checkpointId}/replay", {
292
+ params: { path: { runId, checkpointId } },
306
293
  body: {
307
- checkpoint_id: checkpointId,
308
294
  mode: options?.mode,
309
295
  reason: options?.reason
310
296
  },
@@ -381,8 +367,8 @@ export class RunsModule {
381
367
  /**
382
368
  * Get checkpoints for a run.
383
369
  */
384
- async getCheckpoints(runId: string): Promise<APIResponse<CheckpointListResponse>> {
385
- return this.client.GET<CheckpointListResponse>("/v1/api/runs/{runId}/checkpoints", {
370
+ async getCheckpoints(runId: string): Promise<APIResponse<CheckpointIndexResponse>> {
371
+ return this.client.GET<CheckpointIndexResponse>("/v1/api/runs/{runId}/checkpoints/index", {
386
372
  params: { path: { runId } },
387
373
  });
388
374
  }
@@ -56,6 +56,12 @@ export interface TraceDetail extends Trace {
56
56
  spans: Span[];
57
57
  }
58
58
 
59
+ export interface SpansByRunResponse {
60
+ run_id: string;
61
+ spans: Span[];
62
+ count: number;
63
+ }
64
+
59
65
  export class TracesModule {
60
66
  constructor(private client: RawClient, private headers: () => Record<string, string>) { }
61
67
 
@@ -95,6 +101,16 @@ export class TracesModule {
95
101
  });
96
102
  }
97
103
 
104
+ /**
105
+ * Get all spans associated with a run.
106
+ * Maps to: GET /v1/api/traces/by-run/{runId}
107
+ */
108
+ async getByRun(runId: string): Promise<APIResponse<SpansByRunResponse>> {
109
+ return this.client.GET<SpansByRunResponse>(`/v1/api/traces/by-run/${runId}`, {
110
+ headers: this.headers(),
111
+ });
112
+ }
113
+
98
114
  /**
99
115
  * Ingest spans (batch).
100
116
  */
@@ -1,81 +0,0 @@
1
- /**
2
- * DLQ Module - Fully Typed
3
- */
4
- import type { RawClient, APIResponse } from "../client/raw.js";
5
- export interface DlqMessage {
6
- id: string;
7
- workspace_id: string;
8
- message_type: string;
9
- original_run_id?: string;
10
- bundle_id?: string;
11
- error_code?: string;
12
- error_detail?: string;
13
- is_poison: boolean;
14
- retry_count: number;
15
- failed_at: string;
16
- created_at: string;
17
- payload?: unknown;
18
- dead_letter_reason?: string;
19
- attempt_id?: string;
20
- }
21
- export interface DlqListItem {
22
- id: string;
23
- message_type: string;
24
- original_run_id?: string;
25
- bundle_id?: string;
26
- error_code?: string;
27
- error_detail?: string;
28
- is_poison: boolean;
29
- retry_count: number;
30
- failed_at: string;
31
- created_at: string;
32
- }
33
- export interface DlqListResponse {
34
- items: DlqListItem[];
35
- total: number;
36
- skip: number;
37
- take: number;
38
- }
39
- export interface DlqRetryResponse {
40
- retried: boolean;
41
- new_run_id?: string;
42
- retry_count?: number;
43
- removed_from_dlq?: boolean;
44
- message?: string;
45
- error?: string;
46
- }
47
- export interface DlqPurgeResponse {
48
- deleted_count: number;
49
- }
50
- export declare class DlqModule {
51
- private client;
52
- private headers;
53
- constructor(client: RawClient, headers: () => Record<string, string>);
54
- /**
55
- * List DLQ messages.
56
- */
57
- list(params?: {
58
- queue_name?: string;
59
- limit?: number;
60
- offset?: number;
61
- }): Promise<APIResponse<DlqListResponse>>;
62
- /**
63
- * Get a DLQ message by ID.
64
- */
65
- get(messageId: string): Promise<APIResponse<DlqMessage>>;
66
- /**
67
- * Retry a DLQ message.
68
- */
69
- retry(messageId: string): Promise<APIResponse<DlqRetryResponse>>;
70
- /**
71
- * Delete a DLQ message.
72
- */
73
- delete(messageId: string): Promise<APIResponse<void>>;
74
- /**
75
- * Purge DLQ messages.
76
- */
77
- purge(params?: {
78
- queue_name?: string;
79
- }): Promise<APIResponse<DlqPurgeResponse>>;
80
- }
81
- //# sourceMappingURL=dlq.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dlq.d.ts","sourceRoot":"","sources":["../../src/modules/dlq.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IAEnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,C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,EAAE;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;CAS7C"}
@@ -1,66 +0,0 @@
1
- /**
2
- * DLQ Module - Fully Typed
3
- */
4
- export class DlqModule {
5
- client;
6
- headers;
7
- constructor(client, headers) {
8
- this.client = client;
9
- this.headers = headers;
10
- }
11
- /**
12
- * List DLQ messages.
13
- */
14
- async list(params) {
15
- const queryParams = {};
16
- if (params?.queue_name)
17
- queryParams.messageType = params.queue_name;
18
- if (params?.limit !== undefined)
19
- queryParams.take = params.limit;
20
- if (params?.offset !== undefined)
21
- queryParams.skip = params.offset;
22
- return this.client.GET("/v1/api/runs/dlq", {
23
- params: { query: queryParams },
24
- headers: this.headers(),
25
- });
26
- }
27
- /**
28
- * Get a DLQ message by ID.
29
- */
30
- async get(messageId) {
31
- return this.client.GET("/v1/api/runs/dlq/{id}", {
32
- params: { path: { id: messageId } },
33
- headers: this.headers(),
34
- });
35
- }
36
- /**
37
- * Retry a DLQ message.
38
- */
39
- async retry(messageId) {
40
- return this.client.POST("/v1/api/runs/dlq/{id}/retry", {
41
- params: { path: { id: messageId } },
42
- headers: this.headers(),
43
- });
44
- }
45
- /**
46
- * Delete a DLQ message.
47
- */
48
- async delete(messageId) {
49
- return this.client.DELETE("/v1/api/runs/dlq/{id}", {
50
- params: { path: { id: messageId } },
51
- headers: this.headers(),
52
- });
53
- }
54
- /**
55
- * Purge DLQ messages.
56
- */
57
- async purge(params) {
58
- const queryParams = {};
59
- if (params?.queue_name)
60
- queryParams.messageType = params.queue_name;
61
- return this.client.DELETE("/v1/api/runs/dlq/purge", {
62
- params: { query: queryParams },
63
- headers: this.headers(),
64
- });
65
- }
66
- }
@@ -1,125 +0,0 @@
1
- /**
2
- * DLQ Module - Fully Typed
3
- */
4
-
5
- import type { RawClient, APIResponse } from "../client/raw.js";
6
-
7
- export interface DlqMessage {
8
- id: string;
9
- workspace_id: string;
10
- message_type: string;
11
- original_run_id?: string;
12
- bundle_id?: string;
13
- error_code?: string;
14
- error_detail?: string;
15
- is_poison: boolean;
16
- retry_count: number;
17
- failed_at: string;
18
- created_at: string;
19
- // Detailing specific fields that might come from the full object
20
- payload?: unknown;
21
- dead_letter_reason?: string;
22
- attempt_id?: string;
23
- }
24
-
25
- export interface DlqListItem {
26
- id: string;
27
- message_type: string;
28
- original_run_id?: string;
29
- bundle_id?: string;
30
- error_code?: string;
31
- error_detail?: string;
32
- is_poison: boolean;
33
- retry_count: number;
34
- failed_at: string;
35
- created_at: string;
36
- }
37
-
38
- export interface DlqListResponse {
39
- items: DlqListItem[];
40
- total: number;
41
- skip: number;
42
- take: number;
43
- }
44
-
45
- export interface DlqRetryResponse {
46
- retried: boolean;
47
- new_run_id?: string;
48
- retry_count?: number;
49
- removed_from_dlq?: boolean;
50
- message?: string;
51
- error?: string;
52
- }
53
-
54
- export interface DlqPurgeResponse {
55
- deleted_count: number;
56
- }
57
-
58
- export class DlqModule {
59
- constructor(private client: RawClient, private headers: () => Record<string, string>) { }
60
-
61
- /**
62
- * List DLQ messages.
63
- */
64
- async list(params?: {
65
- queue_name?: string; // Maps to messageType
66
- limit?: number; // Maps to take
67
- offset?: number; // Maps to skip
68
- }): Promise<APIResponse<DlqListResponse>> {
69
- const queryParams: Record<string, any> = {};
70
-
71
- if (params?.queue_name) queryParams.messageType = params.queue_name;
72
- if (params?.limit !== undefined) queryParams.take = params.limit;
73
- if (params?.offset !== undefined) queryParams.skip = params.offset;
74
-
75
- return this.client.GET<DlqListResponse>("/v1/api/runs/dlq", {
76
- params: { query: queryParams },
77
- headers: this.headers(),
78
- });
79
- }
80
-
81
- /**
82
- * Get a DLQ message by ID.
83
- */
84
- async get(messageId: string): Promise<APIResponse<DlqMessage>> {
85
- return this.client.GET<DlqMessage>("/v1/api/runs/dlq/{id}", {
86
- params: { path: { id: messageId } },
87
- headers: this.headers(),
88
- });
89
- }
90
-
91
- /**
92
- * Retry a DLQ message.
93
- */
94
- async retry(messageId: string): Promise<APIResponse<DlqRetryResponse>> {
95
- return this.client.POST<DlqRetryResponse>("/v1/api/runs/dlq/{id}/retry", {
96
- params: { path: { id: messageId } },
97
- headers: this.headers(),
98
- });
99
- }
100
-
101
- /**
102
- * Delete a DLQ message.
103
- */
104
- async delete(messageId: string): Promise<APIResponse<void>> {
105
- return this.client.DELETE<void>("/v1/api/runs/dlq/{id}", {
106
- params: { path: { id: messageId } },
107
- headers: this.headers(),
108
- });
109
- }
110
-
111
- /**
112
- * Purge DLQ messages.
113
- */
114
- async purge(params?: {
115
- queue_name?: string; // Maps to messageType
116
- }): Promise<APIResponse<DlqPurgeResponse>> {
117
- const queryParams: Record<string, any> = {};
118
- if (params?.queue_name) queryParams.messageType = params.queue_name;
119
-
120
- return this.client.DELETE<DlqPurgeResponse>("/v1/api/runs/dlq/purge", {
121
- params: { query: queryParams },
122
- headers: this.headers(),
123
- });
124
- }
125
- }