@renai-labs/sdk 0.1.0 → 0.1.2

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 (38) hide show
  1. package/dist/auth.d.ts +1 -0
  2. package/dist/auth.js +2 -1
  3. package/dist/client.js +12 -1
  4. package/dist/generated/@tanstack/react-query.gen.d.ts +1056 -1058
  5. package/dist/generated/@tanstack/react-query.gen.js +1455 -1390
  6. package/dist/generated/client/client.gen.d.ts +1 -1
  7. package/dist/generated/client/client.gen.js +44 -46
  8. package/dist/generated/client/index.d.ts +8 -8
  9. package/dist/generated/client/index.js +5 -5
  10. package/dist/generated/client/types.gen.d.ts +18 -18
  11. package/dist/generated/client/utils.gen.d.ts +3 -3
  12. package/dist/generated/client/utils.gen.js +33 -35
  13. package/dist/generated/client.gen.d.ts +2 -2
  14. package/dist/generated/client.gen.js +1 -1
  15. package/dist/generated/core/auth.gen.d.ts +3 -3
  16. package/dist/generated/core/auth.gen.js +3 -3
  17. package/dist/generated/core/bodySerializer.gen.d.ts +1 -1
  18. package/dist/generated/core/bodySerializer.gen.js +3 -3
  19. package/dist/generated/core/params.gen.d.ts +3 -3
  20. package/dist/generated/core/params.gen.js +11 -9
  21. package/dist/generated/core/pathSerializer.gen.d.ts +4 -4
  22. package/dist/generated/core/pathSerializer.gen.js +37 -37
  23. package/dist/generated/core/queryKeySerializer.gen.js +8 -7
  24. package/dist/generated/core/serverSentEvents.gen.d.ts +3 -3
  25. package/dist/generated/core/serverSentEvents.gen.js +19 -19
  26. package/dist/generated/core/types.gen.d.ts +4 -4
  27. package/dist/generated/core/utils.gen.d.ts +1 -1
  28. package/dist/generated/core/utils.gen.js +17 -17
  29. package/dist/generated/internal/types.gen.d.ts +664 -0
  30. package/dist/generated/internal/types.gen.js +2 -0
  31. package/dist/generated/sdk.gen.d.ts +386 -320
  32. package/dist/generated/sdk.gen.js +1193 -672
  33. package/dist/generated/types.gen.d.ts +4010 -2286
  34. package/dist/generated/zod.gen.d.ts +9431 -2312
  35. package/dist/generated/zod.gen.js +2231 -1088
  36. package/dist/index.d.ts +1 -1
  37. package/dist/index.js +1 -1
  38. package/package.json +11 -3
@@ -0,0 +1,664 @@
1
+ export type ClientOptions = {
2
+ baseUrl: `${string}://${string}` | (string & {});
3
+ };
4
+ export type OpencodeEvent = {
5
+ id: string;
6
+ sessionId: string;
7
+ seq: number;
8
+ type: string;
9
+ data: {
10
+ [key: string]: unknown;
11
+ };
12
+ receivedAt: string;
13
+ };
14
+ export type OpencodeSessionSyncEntry = {
15
+ sessionId: string;
16
+ workspaceId: string | null;
17
+ projectId: string;
18
+ directory: string;
19
+ latestSeq: number;
20
+ };
21
+ export type SandboxManifestStaleResponse = {
22
+ stale: false;
23
+ };
24
+ export type SandboxManifest = {
25
+ orgId: string;
26
+ podId: string;
27
+ globalOpencodeJson: {
28
+ [key: string]: unknown;
29
+ };
30
+ projects: Array<SandboxManifestProject>;
31
+ environment: {
32
+ [key: string]: string;
33
+ };
34
+ members: Array<SandboxManifestMember>;
35
+ podVolume: SandboxMountedVolume;
36
+ updatedAt: string;
37
+ };
38
+ export type SandboxManifestMember = {
39
+ userId: string;
40
+ memberId: string;
41
+ role: "owner" | "member";
42
+ };
43
+ export type SandboxVolumeCreds = {
44
+ accessKeyId: string;
45
+ secretAccessKey: string;
46
+ sessionToken: string;
47
+ expiresAt: string;
48
+ };
49
+ export type SandboxMountedVolume = {
50
+ storeId: string;
51
+ kind: "file-store" | "memory-store" | "pod";
52
+ mountPath: string;
53
+ mode: "ro" | "rw";
54
+ bucket: string;
55
+ prefix: string;
56
+ region: string;
57
+ endpoint: string | null;
58
+ creds: SandboxVolumeCreds;
59
+ };
60
+ export type SandboxManifestProjectSkillSource = {
61
+ type: "s3";
62
+ presignedUrl: string;
63
+ } | {
64
+ type: "git";
65
+ url: string;
66
+ ref?: string;
67
+ path?: string;
68
+ };
69
+ export type SandboxManifestProjectSkillVersion = {
70
+ agentVersionId: string;
71
+ versionId: string;
72
+ version: string;
73
+ source: SandboxManifestProjectSkillSource | null;
74
+ };
75
+ export type SandboxManifestProjectSkill = {
76
+ skillId: string;
77
+ skillSlug: string;
78
+ versions: Array<SandboxManifestProjectSkillVersion>;
79
+ };
80
+ export type ProjectGitRepo = {
81
+ url: string;
82
+ baseBranch?: string;
83
+ mountPath?: string;
84
+ };
85
+ export type PermissionConfig = {
86
+ __originalKeys?: Array<string>;
87
+ read?: "allow" | "deny" | "ask" | {
88
+ [key: string]: "allow" | "deny" | "ask";
89
+ };
90
+ edit?: "allow" | "deny" | "ask" | {
91
+ [key: string]: "allow" | "deny" | "ask";
92
+ };
93
+ glob?: "allow" | "deny" | "ask" | {
94
+ [key: string]: "allow" | "deny" | "ask";
95
+ };
96
+ grep?: "allow" | "deny" | "ask" | {
97
+ [key: string]: "allow" | "deny" | "ask";
98
+ };
99
+ list?: "allow" | "deny" | "ask" | {
100
+ [key: string]: "allow" | "deny" | "ask";
101
+ };
102
+ bash?: "allow" | "deny" | "ask" | {
103
+ [key: string]: "allow" | "deny" | "ask";
104
+ };
105
+ task?: "allow" | "deny" | "ask" | {
106
+ [key: string]: "allow" | "deny" | "ask";
107
+ };
108
+ external_directory?: "allow" | "deny" | "ask" | {
109
+ [key: string]: "allow" | "deny" | "ask";
110
+ };
111
+ todowrite?: "allow" | "deny" | "ask";
112
+ question?: "allow" | "deny" | "ask";
113
+ webfetch?: "allow" | "deny" | "ask";
114
+ websearch?: "allow" | "deny" | "ask";
115
+ codesearch?: "allow" | "deny" | "ask";
116
+ lsp?: "allow" | "deny" | "ask" | {
117
+ [key: string]: "allow" | "deny" | "ask";
118
+ };
119
+ doom_loop?: "allow" | "deny" | "ask";
120
+ skill?: "allow" | "deny" | "ask" | {
121
+ [key: string]: "allow" | "deny" | "ask";
122
+ };
123
+ [key: string]: "allow" | "deny" | "ask" | {
124
+ [key: string]: "allow" | "deny" | "ask";
125
+ } | Array<string> | Array<string> | "allow" | "deny" | "ask" | {
126
+ [key: string]: "allow" | "deny" | "ask";
127
+ } | "allow" | "deny" | "ask" | {
128
+ [key: string]: "allow" | "deny" | "ask";
129
+ } | "allow" | "deny" | "ask" | {
130
+ [key: string]: "allow" | "deny" | "ask";
131
+ } | "allow" | "deny" | "ask" | {
132
+ [key: string]: "allow" | "deny" | "ask";
133
+ } | "allow" | "deny" | "ask" | {
134
+ [key: string]: "allow" | "deny" | "ask";
135
+ } | "allow" | "deny" | "ask" | {
136
+ [key: string]: "allow" | "deny" | "ask";
137
+ } | "allow" | "deny" | "ask" | {
138
+ [key: string]: "allow" | "deny" | "ask";
139
+ } | "allow" | "deny" | "ask" | {
140
+ [key: string]: "allow" | "deny" | "ask";
141
+ } | "allow" | "deny" | "ask" | "allow" | "deny" | "ask" | "allow" | "deny" | "ask" | "allow" | "deny" | "ask" | "allow" | "deny" | "ask" | "allow" | "deny" | "ask" | {
142
+ [key: string]: "allow" | "deny" | "ask";
143
+ } | "allow" | "deny" | "ask" | "allow" | "deny" | "ask" | {
144
+ [key: string]: "allow" | "deny" | "ask";
145
+ } | undefined;
146
+ } | "allow" | "deny" | "ask";
147
+ export type SandboxManifestProject = {
148
+ id: string;
149
+ slug: string;
150
+ name: string;
151
+ permission: PermissionConfig;
152
+ gitRepo: ProjectGitRepo | null;
153
+ path: string;
154
+ opencodeJson: {
155
+ [key: string]: unknown;
156
+ };
157
+ skills: Array<SandboxManifestProjectSkill>;
158
+ volumes: Array<SandboxMountedVolume>;
159
+ };
160
+ export type SandboxTokenResponse = {
161
+ token: string;
162
+ expiresAt: string;
163
+ tokenId: string;
164
+ };
165
+ export type OpencodeSession = {
166
+ id: string;
167
+ createdById: string;
168
+ projectId: string;
169
+ podId: string;
170
+ slug: string;
171
+ workspaceId: string | null;
172
+ directory: string;
173
+ title: string;
174
+ version: string;
175
+ shareUrl: string | null;
176
+ parentId: string | null;
177
+ summaryAdditions: number | null;
178
+ summaryDeletions: number | null;
179
+ summaryFiles: number | null;
180
+ summaryDiffs: Array<{
181
+ path: string;
182
+ additions: number;
183
+ deletions: number;
184
+ }> | null;
185
+ revert: {
186
+ messageId: string;
187
+ partId?: string;
188
+ snapshot?: string;
189
+ diff?: string;
190
+ } | null;
191
+ permission: {
192
+ [key: string]: unknown;
193
+ } | null;
194
+ status: "idle" | "busy" | "waiting" | "error";
195
+ error: {
196
+ code: string;
197
+ message: string;
198
+ details?: {
199
+ [key: string]: unknown;
200
+ };
201
+ } | null;
202
+ currentAgentId: string | null;
203
+ createdAt: string;
204
+ updatedAt: string;
205
+ archivedAt: string | null;
206
+ compactingAt: string | null;
207
+ };
208
+ export type OAuthCallbackInput = string;
209
+ /**
210
+ * Pass 'user' to scope the operation to the authenticated user's private namespace. Omit for the org-wide namespace.
211
+ */
212
+ export type ScopeQuery = "user";
213
+ export type HealthCheckData = {
214
+ body?: never;
215
+ path?: never;
216
+ query?: never;
217
+ url: "/health";
218
+ };
219
+ export type HealthCheckResponses = {
220
+ /**
221
+ * Service is healthy
222
+ */
223
+ 200: {
224
+ status: "ok";
225
+ };
226
+ };
227
+ export type HealthCheckResponse = HealthCheckResponses[keyof HealthCheckResponses];
228
+ export type CredentialOauthCallbackData = {
229
+ body?: never;
230
+ path?: never;
231
+ query: {
232
+ state: string;
233
+ };
234
+ url: "/api/vaults/oauth/callback";
235
+ };
236
+ export type GithubOauthCallbackData = {
237
+ body?: never;
238
+ path?: never;
239
+ query?: {
240
+ state?: string;
241
+ code?: string;
242
+ installation_id?: string;
243
+ setup_action?: "install" | "update";
244
+ };
245
+ url: "/api/github/oauth/callback";
246
+ };
247
+ export type GithubFlowStartData = {
248
+ body?: never;
249
+ path: {
250
+ flow: "install" | "connect";
251
+ };
252
+ query?: {
253
+ /**
254
+ * Pass 'user' to scope the operation to the authenticated user's private namespace. Omit for the org-wide namespace.
255
+ */
256
+ scope?: "user";
257
+ returnTo?: string;
258
+ };
259
+ url: "/api/github/{flow}/start";
260
+ };
261
+ export type GithubFlowStartErrors = {
262
+ /**
263
+ * Unauthorized
264
+ */
265
+ 401: {
266
+ error: string;
267
+ };
268
+ /**
269
+ * Forbidden
270
+ */
271
+ 403: {
272
+ error: string;
273
+ };
274
+ };
275
+ export type GithubFlowStartError = GithubFlowStartErrors[keyof GithubFlowStartErrors];
276
+ export type SlackInstallStartData = {
277
+ body?: never;
278
+ path?: never;
279
+ query?: {
280
+ /**
281
+ * Pass 'user' to scope the operation to the authenticated user's private namespace. Omit for the org-wide namespace.
282
+ */
283
+ scope?: "user";
284
+ returnTo?: string;
285
+ };
286
+ url: "/api/slack/install";
287
+ };
288
+ export type SlackInstallStartErrors = {
289
+ /**
290
+ * Unauthorized
291
+ */
292
+ 401: {
293
+ error: string;
294
+ };
295
+ /**
296
+ * Forbidden
297
+ */
298
+ 403: {
299
+ error: string;
300
+ };
301
+ };
302
+ export type SlackInstallStartError = SlackInstallStartErrors[keyof SlackInstallStartErrors];
303
+ export type SandboxAuthExchangeData = {
304
+ body?: {
305
+ token: string;
306
+ };
307
+ path?: never;
308
+ query?: never;
309
+ url: "/api/sandbox/auth/exchange";
310
+ };
311
+ export type SandboxAuthExchangeErrors = {
312
+ /**
313
+ * Bad request
314
+ */
315
+ 400: {
316
+ error: string;
317
+ };
318
+ /**
319
+ * Not found
320
+ */
321
+ 404: {
322
+ error: string;
323
+ };
324
+ };
325
+ export type SandboxAuthExchangeError = SandboxAuthExchangeErrors[keyof SandboxAuthExchangeErrors];
326
+ export type SandboxAuthExchangeResponses = {
327
+ /**
328
+ * Session token
329
+ */
330
+ 200: SandboxTokenResponse;
331
+ };
332
+ export type SandboxAuthExchangeResponse = SandboxAuthExchangeResponses[keyof SandboxAuthExchangeResponses];
333
+ export type SandboxAuthRefreshData = {
334
+ body?: {
335
+ token: string;
336
+ };
337
+ path?: never;
338
+ query?: never;
339
+ url: "/api/sandbox/auth/refresh";
340
+ };
341
+ export type SandboxAuthRefreshErrors = {
342
+ /**
343
+ * Bad request
344
+ */
345
+ 400: {
346
+ error: string;
347
+ };
348
+ /**
349
+ * Not found
350
+ */
351
+ 404: {
352
+ error: string;
353
+ };
354
+ };
355
+ export type SandboxAuthRefreshError = SandboxAuthRefreshErrors[keyof SandboxAuthRefreshErrors];
356
+ export type SandboxAuthRefreshResponses = {
357
+ /**
358
+ * Fresh session token
359
+ */
360
+ 200: SandboxTokenResponse;
361
+ };
362
+ export type SandboxAuthRefreshResponse = SandboxAuthRefreshResponses[keyof SandboxAuthRefreshResponses];
363
+ export type SandboxBootstrapCompleteData = {
364
+ body?: never;
365
+ path?: never;
366
+ query?: never;
367
+ url: "/api/sandbox/bootstrap-complete";
368
+ };
369
+ export type SandboxBootstrapCompleteErrors = {
370
+ /**
371
+ * Unauthorized
372
+ */
373
+ 401: {
374
+ error: string;
375
+ };
376
+ /**
377
+ * Forbidden
378
+ */
379
+ 403: {
380
+ error: string;
381
+ };
382
+ /**
383
+ * Not found
384
+ */
385
+ 404: {
386
+ error: string;
387
+ };
388
+ };
389
+ export type SandboxBootstrapCompleteError = SandboxBootstrapCompleteErrors[keyof SandboxBootstrapCompleteErrors];
390
+ export type SandboxBootstrapCompleteResponses = {
391
+ /**
392
+ * Signal delivered
393
+ */
394
+ 200: {
395
+ ok: true;
396
+ };
397
+ };
398
+ export type SandboxBootstrapCompleteResponse = SandboxBootstrapCompleteResponses[keyof SandboxBootstrapCompleteResponses];
399
+ export type SandboxManifestGetData = {
400
+ body?: never;
401
+ path?: never;
402
+ query?: {
403
+ since?: string;
404
+ };
405
+ url: "/api/sandbox/manifest";
406
+ };
407
+ export type SandboxManifestGetErrors = {
408
+ /**
409
+ * Unauthorized
410
+ */
411
+ 401: {
412
+ error: string;
413
+ };
414
+ /**
415
+ * Forbidden
416
+ */
417
+ 403: {
418
+ error: string;
419
+ };
420
+ /**
421
+ * Not found
422
+ */
423
+ 404: {
424
+ error: string;
425
+ };
426
+ };
427
+ export type SandboxManifestGetError = SandboxManifestGetErrors[keyof SandboxManifestGetErrors];
428
+ export type SandboxManifestGetResponses = {
429
+ /**
430
+ * Manifest snapshot if stale, else { stale: false }
431
+ */
432
+ 200: SandboxManifest | SandboxManifestStaleResponse;
433
+ };
434
+ export type SandboxManifestGetResponse = SandboxManifestGetResponses[keyof SandboxManifestGetResponses];
435
+ export type SandboxSessionsListData = {
436
+ body?: never;
437
+ path?: never;
438
+ query?: never;
439
+ url: "/api/sandbox/sessions";
440
+ };
441
+ export type SandboxSessionsListErrors = {
442
+ /**
443
+ * Unauthorized
444
+ */
445
+ 401: {
446
+ error: string;
447
+ };
448
+ /**
449
+ * Forbidden
450
+ */
451
+ 403: {
452
+ error: string;
453
+ };
454
+ /**
455
+ * Not found
456
+ */
457
+ 404: {
458
+ error: string;
459
+ };
460
+ };
461
+ export type SandboxSessionsListError = SandboxSessionsListErrors[keyof SandboxSessionsListErrors];
462
+ export type SandboxSessionsListResponses = {
463
+ /**
464
+ * Session sync entries for the pod
465
+ */
466
+ 200: Array<OpencodeSessionSyncEntry>;
467
+ };
468
+ export type SandboxSessionsListResponse = SandboxSessionsListResponses[keyof SandboxSessionsListResponses];
469
+ export type SandboxSyncListData = {
470
+ body?: never;
471
+ path: {
472
+ id: string;
473
+ };
474
+ query: {
475
+ sessionId: string;
476
+ sinceSeq: number;
477
+ };
478
+ url: "/api/sandbox/{id}/sync/events";
479
+ };
480
+ export type SandboxSyncListErrors = {
481
+ /**
482
+ * Bad request
483
+ */
484
+ 400: {
485
+ error: string;
486
+ };
487
+ /**
488
+ * Unauthorized
489
+ */
490
+ 401: {
491
+ error: string;
492
+ };
493
+ /**
494
+ * Forbidden
495
+ */
496
+ 403: {
497
+ error: string;
498
+ };
499
+ /**
500
+ * Not found
501
+ */
502
+ 404: {
503
+ error: string;
504
+ };
505
+ };
506
+ export type SandboxSyncListError = SandboxSyncListErrors[keyof SandboxSyncListErrors];
507
+ export type SandboxSyncListResponses = {
508
+ /**
509
+ * Events with seq > sinceSeq, ordered by seq
510
+ */
511
+ 200: Array<OpencodeEvent>;
512
+ };
513
+ export type SandboxSyncListResponse = SandboxSyncListResponses[keyof SandboxSyncListResponses];
514
+ export type SandboxSyncAppendData = {
515
+ body?: {
516
+ sessionId: string;
517
+ events: Array<{
518
+ id: string;
519
+ seq: number;
520
+ type: string;
521
+ data: {
522
+ [key: string]: unknown;
523
+ };
524
+ }>;
525
+ };
526
+ path: {
527
+ id: string;
528
+ };
529
+ query?: never;
530
+ url: "/api/sandbox/{id}/sync/events";
531
+ };
532
+ export type SandboxSyncAppendErrors = {
533
+ /**
534
+ * Bad request
535
+ */
536
+ 400: {
537
+ error: string;
538
+ };
539
+ /**
540
+ * Unauthorized
541
+ */
542
+ 401: {
543
+ error: string;
544
+ };
545
+ /**
546
+ * Forbidden
547
+ */
548
+ 403: {
549
+ error: string;
550
+ };
551
+ /**
552
+ * Not found
553
+ */
554
+ 404: {
555
+ error: string;
556
+ };
557
+ /**
558
+ * Conflict
559
+ */
560
+ 409: {
561
+ error: string;
562
+ };
563
+ };
564
+ export type SandboxSyncAppendError = SandboxSyncAppendErrors[keyof SandboxSyncAppendErrors];
565
+ export type SandboxSyncAppendResponses = {
566
+ /**
567
+ * Append result
568
+ */
569
+ 200: {
570
+ appended: number;
571
+ latestSeq: number;
572
+ };
573
+ };
574
+ export type SandboxSyncAppendResponse = SandboxSyncAppendResponses[keyof SandboxSyncAppendResponses];
575
+ export type SandboxVolumesMintCredsData = {
576
+ body?: never;
577
+ path: {
578
+ storeId: string;
579
+ };
580
+ query?: never;
581
+ url: "/api/sandbox/volumes/{storeId}/creds";
582
+ };
583
+ export type SandboxVolumesMintCredsErrors = {
584
+ /**
585
+ * Unauthorized
586
+ */
587
+ 401: {
588
+ error: string;
589
+ };
590
+ /**
591
+ * Forbidden
592
+ */
593
+ 403: {
594
+ error: string;
595
+ };
596
+ /**
597
+ * Not found
598
+ */
599
+ 404: {
600
+ error: string;
601
+ };
602
+ };
603
+ export type SandboxVolumesMintCredsError = SandboxVolumesMintCredsErrors[keyof SandboxVolumesMintCredsErrors];
604
+ export type SandboxVolumesMintCredsResponses = {
605
+ /**
606
+ * Volume credentials
607
+ */
608
+ 200: SandboxVolumeCreds;
609
+ };
610
+ export type SandboxVolumesMintCredsResponse = SandboxVolumesMintCredsResponses[keyof SandboxVolumesMintCredsResponses];
611
+ export type SandboxSessionUpdateData = {
612
+ body?: {
613
+ title?: string;
614
+ status?: "idle" | "busy" | "waiting" | "error";
615
+ error?: {
616
+ code: string;
617
+ message: string;
618
+ details?: {
619
+ [key: string]: unknown;
620
+ };
621
+ } | null;
622
+ currentProjectAgentId?: string;
623
+ };
624
+ path: {
625
+ id: string;
626
+ sessionId: string;
627
+ };
628
+ query?: never;
629
+ url: "/api/sandbox/{id}/sessions/{sessionId}";
630
+ };
631
+ export type SandboxSessionUpdateErrors = {
632
+ /**
633
+ * Bad request
634
+ */
635
+ 400: {
636
+ error: string;
637
+ };
638
+ /**
639
+ * Unauthorized
640
+ */
641
+ 401: {
642
+ error: string;
643
+ };
644
+ /**
645
+ * Forbidden
646
+ */
647
+ 403: {
648
+ error: string;
649
+ };
650
+ /**
651
+ * Not found
652
+ */
653
+ 404: {
654
+ error: string;
655
+ };
656
+ };
657
+ export type SandboxSessionUpdateError = SandboxSessionUpdateErrors[keyof SandboxSessionUpdateErrors];
658
+ export type SandboxSessionUpdateResponses = {
659
+ /**
660
+ * Updated session
661
+ */
662
+ 200: OpencodeSession;
663
+ };
664
+ export type SandboxSessionUpdateResponse = SandboxSessionUpdateResponses[keyof SandboxSessionUpdateResponses];
@@ -0,0 +1,2 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ export {};