casedev 0.24.0 → 0.26.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/resources/agent/v1/chat/chat.d.mts +163 -0
  4. package/resources/agent/v1/chat/chat.d.mts.map +1 -0
  5. package/resources/agent/v1/chat/chat.d.ts +163 -0
  6. package/resources/agent/v1/chat/chat.d.ts.map +1 -0
  7. package/resources/agent/v1/chat/chat.js +109 -0
  8. package/resources/agent/v1/chat/chat.js.map +1 -0
  9. package/resources/agent/v1/chat/chat.mjs +104 -0
  10. package/resources/agent/v1/chat/chat.mjs.map +1 -0
  11. package/resources/agent/v1/chat/files.d.mts +42 -0
  12. package/resources/agent/v1/chat/files.d.mts.map +1 -0
  13. package/resources/agent/v1/chat/files.d.ts +42 -0
  14. package/resources/agent/v1/chat/files.d.ts.map +1 -0
  15. package/resources/agent/v1/chat/files.js +33 -0
  16. package/resources/agent/v1/chat/files.js.map +1 -0
  17. package/resources/agent/v1/chat/files.mjs +29 -0
  18. package/resources/agent/v1/chat/files.mjs.map +1 -0
  19. package/resources/agent/v1/chat/index.d.mts +3 -0
  20. package/resources/agent/v1/chat/index.d.mts.map +1 -0
  21. package/resources/agent/v1/chat/index.d.ts +3 -0
  22. package/resources/agent/v1/chat/index.d.ts.map +1 -0
  23. package/resources/agent/v1/chat/index.js +9 -0
  24. package/resources/agent/v1/chat/index.js.map +1 -0
  25. package/resources/agent/v1/chat/index.mjs +4 -0
  26. package/resources/agent/v1/chat/index.mjs.map +1 -0
  27. package/resources/agent/v1/chat.d.mts +1 -158
  28. package/resources/agent/v1/chat.d.mts.map +1 -1
  29. package/resources/agent/v1/chat.d.ts +1 -158
  30. package/resources/agent/v1/chat.d.ts.map +1 -1
  31. package/resources/agent/v1/chat.js +2 -97
  32. package/resources/agent/v1/chat.js.map +1 -1
  33. package/resources/agent/v1/chat.mjs +1 -95
  34. package/resources/agent/v1/chat.mjs.map +1 -1
  35. package/resources/agent/v1/index.d.mts +1 -1
  36. package/resources/agent/v1/index.d.ts +1 -1
  37. package/resources/agent/v1/index.js +2 -2
  38. package/resources/agent/v1/index.js.map +1 -1
  39. package/resources/agent/v1/index.mjs +1 -1
  40. package/resources/agent/v1/v1.d.mts +2 -2
  41. package/resources/agent/v1/v1.d.mts.map +1 -1
  42. package/resources/agent/v1/v1.d.ts +2 -2
  43. package/resources/agent/v1/v1.d.ts.map +1 -1
  44. package/resources/agent/v1/v1.js +2 -2
  45. package/resources/agent/v1/v1.js.map +1 -1
  46. package/resources/agent/v1/v1.mjs +2 -2
  47. package/resources/agent/v1/v1.mjs.map +1 -1
  48. package/resources/legal/v1.d.mts +46 -11
  49. package/resources/legal/v1.d.mts.map +1 -1
  50. package/resources/legal/v1.d.ts +46 -11
  51. package/resources/legal/v1.d.ts.map +1 -1
  52. package/resources/legal/v1.js +3 -3
  53. package/resources/legal/v1.mjs +3 -3
  54. package/src/resources/agent/v1/chat/chat.ts +267 -0
  55. package/src/resources/agent/v1/chat/files.ts +63 -0
  56. package/src/resources/agent/v1/chat/index.ts +16 -0
  57. package/src/resources/agent/v1/chat.ts +1 -253
  58. package/src/resources/agent/v1/index.ts +1 -1
  59. package/src/resources/agent/v1/v1.ts +14 -14
  60. package/src/resources/legal/v1.ts +53 -11
  61. package/src/version.ts +1 -1
  62. package/version.d.mts +1 -1
  63. package/version.d.ts +1 -1
  64. package/version.js +1 -1
  65. package/version.mjs +1 -1
@@ -1,255 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../../core/resource';
4
- import { APIPromise } from '../../../core/api-promise';
5
- import { Stream } from '../../../core/streaming';
6
- import { buildHeaders } from '../../../internal/headers';
7
- import { RequestOptions } from '../../../internal/request-options';
8
- import { path } from '../../../internal/utils/path';
9
-
10
- /**
11
- * Create, manage, and execute AI agents with tool access, sandbox environments, and async run workflows
12
- */
13
- export class Chat extends APIResource {
14
- /**
15
- * Creates a persistent OpenCode chat session in a Modal sandbox. Session state is
16
- * retained and can be resumed across requests.
17
- */
18
- create(
19
- body: ChatCreateParams | null | undefined = {},
20
- options?: RequestOptions,
21
- ): APIPromise<ChatCreateResponse> {
22
- return this._client.post('/agent/v1/chat', { body, ...options });
23
- }
24
-
25
- /**
26
- * Snapshots and terminates the active sandbox (if any), then marks the chat as
27
- * ended.
28
- */
29
- delete(id: string, options?: RequestOptions): APIPromise<ChatDeleteResponse> {
30
- return this._client.delete(path`/agent/v1/chat/${id}`, options);
31
- }
32
-
33
- /**
34
- * Aborts the active OpenCode generation for this chat session.
35
- */
36
- cancel(id: string, options?: RequestOptions): APIPromise<ChatCancelResponse> {
37
- return this._client.post(path`/agent/v1/chat/${id}/cancel`, options);
38
- }
39
-
40
- /**
41
- * Answers a pending OpenCode question for the chat session bound to this agent
42
- * chat.
43
- */
44
- replyToQuestion(
45
- requestID: string,
46
- params: ChatReplyToQuestionParams,
47
- options?: RequestOptions,
48
- ): APIPromise<void> {
49
- const { id, ...body } = params;
50
- return this._client.post(path`/agent/v1/chat/${id}/question/${requestID}/reply`, {
51
- body,
52
- ...options,
53
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
54
- });
55
- }
56
-
57
- /**
58
- * Streams a single assistant turn as normalized SSE events with stable turn,
59
- * message, and part IDs. Emits events: `turn.started`, `turn.status`,
60
- * `message.created`, `message.part.updated`, `message.completed`, `session.usage`,
61
- * `turn.completed`.
62
- *
63
- * **When to use this endpoint:** Recommended for building custom chat UIs that
64
- * need real-time streaming progress. This is the primary streaming endpoint for
65
- * new integrations.
66
- *
67
- * **Alternatives:**
68
- *
69
- * - `POST /chat/:id/message` — synchronous, returns complete response as JSON
70
- * (best for server-to-server)
71
- */
72
- respond(
73
- id: string,
74
- body: ChatRespondParams,
75
- options?: RequestOptions,
76
- ): APIPromise<Stream<ChatRespondResponse>> {
77
- return this._client.post(path`/agent/v1/chat/${id}/respond`, {
78
- body,
79
- ...options,
80
- headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
81
- stream: true,
82
- }) as APIPromise<Stream<ChatRespondResponse>>;
83
- }
84
-
85
- /**
86
- * Sends a message and returns the complete response as a single JSON body. Blocks
87
- * until the agent turn completes.
88
- *
89
- * **When to use this endpoint:** Best for server-to-server integrations,
90
- * background processing, or any context where you want the full response in one
91
- * call without managing an SSE stream.
92
- *
93
- * **Alternatives:**
94
- *
95
- * - `POST /chat/:id/respond` — streaming SSE with normalized events (recommended
96
- * for custom chat UIs)
97
- */
98
- sendMessage(id: string, body: ChatSendMessageParams, options?: RequestOptions): APIPromise<void> {
99
- return this._client.post(path`/agent/v1/chat/${id}/message`, {
100
- body,
101
- ...options,
102
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
103
- });
104
- }
105
-
106
- /**
107
- * Relays OpenCode SSE events for this chat. Supports replay from buffered events
108
- * using Last-Event-ID.
109
- */
110
- stream(
111
- id: string,
112
- query: ChatStreamParams | undefined = {},
113
- options?: RequestOptions,
114
- ): APIPromise<Stream<ChatStreamResponse>> {
115
- return this._client.get(path`/agent/v1/chat/${id}/stream`, {
116
- query,
117
- ...options,
118
- headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
119
- stream: true,
120
- }) as APIPromise<Stream<ChatStreamResponse>>;
121
- }
122
- }
123
-
124
- export interface ChatCreateResponse {
125
- id?: string;
126
-
127
- createdAt?: string;
128
-
129
- idleTimeoutMs?: number;
130
-
131
- status?: string;
132
- }
133
-
134
- export interface ChatDeleteResponse {
135
- id?: string;
136
-
137
- cost?: number;
138
-
139
- runtimeMs?: number;
140
-
141
- snapshotImageId?: string | null;
142
-
143
- status?: string;
144
- }
145
-
146
- export interface ChatCancelResponse {
147
- id?: string;
148
-
149
- ok?: boolean;
150
- }
151
-
152
- export type ChatRespondResponse = string;
153
-
154
- export type ChatStreamResponse = string;
155
-
156
- export interface ChatCreateParams {
157
- /**
158
- * Idle timeout before session is eligible for snapshot/termination. Defaults to 15
159
- * minutes.
160
- */
161
- idleTimeoutMs?: number | null;
162
-
163
- /**
164
- * Optional model override for the OpenCode session
165
- */
166
- model?: string | null;
167
-
168
- /**
169
- * Optional human-readable session title
170
- */
171
- title?: string;
172
-
173
- /**
174
- * Restrict the chat session to specific vault IDs
175
- */
176
- vaultIds?: Array<string> | null;
177
- }
178
-
179
- export interface ChatReplyToQuestionParams {
180
- /**
181
- * Path param: Chat session ID
182
- */
183
- id: string;
184
-
185
- /**
186
- * Body param: Answer selections for each prompt element in the pending question
187
- */
188
- answers: Array<Array<string>>;
189
- }
190
-
191
- export interface ChatRespondParams {
192
- /**
193
- * Message content parts. Currently only "text" type is supported. Additional types
194
- * (e.g. file, image) may be added in future versions.
195
- */
196
- parts?: Array<ChatRespondParams.Part>;
197
- }
198
-
199
- export namespace ChatRespondParams {
200
- export interface Part {
201
- /**
202
- * The message text content
203
- */
204
- text: string;
205
-
206
- /**
207
- * Part type. Currently only "text" is supported.
208
- */
209
- type: 'text';
210
- }
211
- }
212
-
213
- export interface ChatSendMessageParams {
214
- /**
215
- * Message content parts. Currently only "text" type is supported. Additional types
216
- * (e.g. file, image) may be added in future versions.
217
- */
218
- parts?: Array<ChatSendMessageParams.Part>;
219
- }
220
-
221
- export namespace ChatSendMessageParams {
222
- export interface Part {
223
- /**
224
- * The message text content
225
- */
226
- text: string;
227
-
228
- /**
229
- * Part type. Currently only "text" is supported.
230
- */
231
- type: 'text';
232
- }
233
- }
234
-
235
- export interface ChatStreamParams {
236
- /**
237
- * Replay events after this sequence number
238
- */
239
- lastEventId?: number;
240
- }
241
-
242
- export declare namespace Chat {
243
- export {
244
- type ChatCreateResponse as ChatCreateResponse,
245
- type ChatDeleteResponse as ChatDeleteResponse,
246
- type ChatCancelResponse as ChatCancelResponse,
247
- type ChatRespondResponse as ChatRespondResponse,
248
- type ChatStreamResponse as ChatStreamResponse,
249
- type ChatCreateParams as ChatCreateParams,
250
- type ChatReplyToQuestionParams as ChatReplyToQuestionParams,
251
- type ChatRespondParams as ChatRespondParams,
252
- type ChatSendMessageParams as ChatSendMessageParams,
253
- type ChatStreamParams as ChatStreamParams,
254
- };
255
- }
3
+ export * from './chat/index';
@@ -23,7 +23,7 @@ export {
23
23
  type ChatRespondParams,
24
24
  type ChatSendMessageParams,
25
25
  type ChatStreamParams,
26
- } from './chat';
26
+ } from './chat/index';
27
27
  export { Execute, type ExecuteCreateResponse, type ExecuteCreateParams } from './execute';
28
28
  export {
29
29
  Run,
@@ -13,20 +13,6 @@ import {
13
13
  AgentUpdateResponse,
14
14
  Agents,
15
15
  } from './agents';
16
- import * as ChatAPI from './chat';
17
- import {
18
- Chat,
19
- ChatCancelResponse,
20
- ChatCreateParams,
21
- ChatCreateResponse,
22
- ChatDeleteResponse,
23
- ChatReplyToQuestionParams,
24
- ChatRespondParams,
25
- ChatRespondResponse,
26
- ChatSendMessageParams,
27
- ChatStreamParams,
28
- ChatStreamResponse,
29
- } from './chat';
30
16
  import * as ExecuteAPI from './execute';
31
17
  import { Execute, ExecuteCreateParams, ExecuteCreateResponse } from './execute';
32
18
  import * as RunAPI from './run';
@@ -45,6 +31,20 @@ import {
45
31
  RunWatchParams,
46
32
  RunWatchResponse,
47
33
  } from './run';
34
+ import * as ChatAPI from './chat/chat';
35
+ import {
36
+ Chat,
37
+ ChatCancelResponse,
38
+ ChatCreateParams,
39
+ ChatCreateResponse,
40
+ ChatDeleteResponse,
41
+ ChatReplyToQuestionParams,
42
+ ChatRespondParams,
43
+ ChatRespondResponse,
44
+ ChatSendMessageParams,
45
+ ChatStreamParams,
46
+ ChatStreamResponse,
47
+ } from './chat/chat';
48
48
 
49
49
  export class V1 extends APIResource {
50
50
  agents: AgentsAPI.Agents = new AgentsAPI.Agents(this._client);
@@ -10,7 +10,7 @@ import { RequestOptions } from '../../internal/request-options';
10
10
  export class V1 extends APIResource {
11
11
  /**
12
12
  * Search federal court dockets or retrieve a specific docket with optional filing
13
- * entries via CourtListener RECAP data.
13
+ * entries. Use legal.listCourts() to resolve court slugs for filtering.
14
14
  */
15
15
  docket(body: V1DocketParams, options?: RequestOptions): APIPromise<V1DocketResponse> {
16
16
  return this._client.post('/legal/v1/docket', { body, ...options });
@@ -65,8 +65,8 @@ export class V1 extends APIResource {
65
65
  }
66
66
 
67
67
  /**
68
- * Returns CourtListener court IDs and names for docket filtering. Use these IDs in
69
- * legal.docket() as the court parameter.
68
+ * Returns court IDs (slugs) and names for use with the docket search endpoint. Use
69
+ * the returned court ID as the `court` parameter in legal.docket().
70
70
  */
71
71
  listCourts(
72
72
  body: V1ListCourtsParams | null | undefined = {},
@@ -234,6 +234,16 @@ export interface V1DocketResponse {
234
234
  */
235
235
  includeEntries?: boolean;
236
236
 
237
+ /**
238
+ * Whether this was a live PACER fetch (lookup mode only)
239
+ */
240
+ live?: boolean;
241
+
242
+ /**
243
+ * PACER fee information (present when live: true)
244
+ */
245
+ pacerFees?: V1DocketResponse.PacerFees | null;
246
+
237
247
  /**
238
248
  * Pagination info for entry list (lookup mode with includeEntries)
239
249
  */
@@ -276,6 +286,28 @@ export namespace V1DocketResponse {
276
286
  }
277
287
  }
278
288
 
289
+ /**
290
+ * PACER fee information (present when live: true)
291
+ */
292
+ export interface PacerFees {
293
+ currency?: 'USD';
294
+
295
+ /**
296
+ * Time taken for PACER fetch in milliseconds
297
+ */
298
+ fetchDurationMs?: number;
299
+
300
+ /**
301
+ * Maximum PACER charge per docket in USD
302
+ */
303
+ maxPacerCost?: number;
304
+
305
+ /**
306
+ * CaseMark service fee in USD
307
+ */
308
+ serviceFee?: number;
309
+ }
310
+
279
311
  /**
280
312
  * Pagination info for entry list (lookup mode with includeEntries)
281
313
  */
@@ -582,7 +614,7 @@ export interface V1ListCourtsResponse {
582
614
  export namespace V1ListCourtsResponse {
583
615
  export interface Court {
584
616
  /**
585
- * CourtListener court slug
617
+ * Court slug (use as the court parameter in legal.docket())
586
618
  */
587
619
  id?: string;
588
620
 
@@ -1044,7 +1076,14 @@ export interface V1DocketParams {
1044
1076
  type: 'search' | 'lookup';
1045
1077
 
1046
1078
  /**
1047
- * Optional CourtListener court slug (e.g. "nysd", "ca9", "cafc")
1079
+ * Required when live: true. Acknowledges that PACER fees (up to $3.00 per docket)
1080
+ * plus a $0.05 service fee will be charged to your account.
1081
+ */
1082
+ acknowledgePacerFees?: boolean;
1083
+
1084
+ /**
1085
+ * Optional court slug for filtering (e.g. "nysd", "ca9", "cafc"). Use
1086
+ * legal.listCourts() to find slugs.
1048
1087
  */
1049
1088
  court?: string;
1050
1089
 
@@ -1059,12 +1098,13 @@ export interface V1DocketParams {
1059
1098
  dateFiledBefore?: string;
1060
1099
 
1061
1100
  /**
1062
- * CourtListener docket ID (required for lookup)
1101
+ * Docket ID (required for lookup)
1063
1102
  */
1064
1103
  docketId?: string;
1065
1104
 
1066
1105
  /**
1067
- * Include docket entries/filings in lookup responses
1106
+ * Include docket entries/filings in lookup responses. Coming soon — currently
1107
+ * returns 501. The parameter is accepted for forward compatibility.
1068
1108
  */
1069
1109
  includeEntries?: boolean;
1070
1110
 
@@ -1075,8 +1115,9 @@ export interface V1DocketParams {
1075
1115
  limit?: number;
1076
1116
 
1077
1117
  /**
1078
- * Reserved for future PACER live fetch support. Setting true currently
1079
- * returns 400.
1118
+ * Trigger a live PACER fetch for dockets not yet in the RECAP archive. Requires
1119
+ * acknowledgePacerFees: true. PACER charges up to $3.00 per docket sheet plus a
1120
+ * $0.05 service fee. Only valid with type: "lookup".
1080
1121
  */
1081
1122
  live?: boolean;
1082
1123
 
@@ -1220,12 +1261,13 @@ export interface V1GetFullTextParams {
1220
1261
 
1221
1262
  export interface V1ListCourtsParams {
1222
1263
  /**
1223
- * Only return courts currently in use by CourtListener
1264
+ * Only return courts with available docket data
1224
1265
  */
1225
1266
  inUseOnly?: boolean;
1226
1267
 
1227
1268
  /**
1228
- * Optional CourtListener jurisdiction code filter (e.g. FD, F, S)
1269
+ * Optional jurisdiction code filter (e.g. FD for Federal District, F for all
1270
+ * Federal, S for State)
1229
1271
  */
1230
1272
  jurisdiction?: string;
1231
1273
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.24.0'; // x-release-please-version
1
+ export const VERSION = '0.26.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.24.0";
1
+ export declare const VERSION = "0.26.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.24.0";
1
+ export declare const VERSION = "0.26.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.24.0'; // x-release-please-version
4
+ exports.VERSION = '0.26.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.24.0'; // x-release-please-version
1
+ export const VERSION = '0.26.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map