@opencode-ai/sdk 1.17.3 → 1.17.5

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.
@@ -302,52 +302,23 @@ export class Resource extends HeyApiClient {
302
302
  }
303
303
  export class ProjectCopy extends HeyApiClient {
304
304
  /**
305
- * Remove project copy
305
+ * Generate project copy name
306
306
  *
307
- * Remove a local physical copy of a project using the selected strategy.
307
+ * Generate a short name for a project copy from task context.
308
308
  */
309
- remove(parameters, options) {
310
- const params = buildClientParams([parameters], [
311
- {
312
- args: [
313
- { in: "path", key: "projectID" },
314
- { in: "query", key: "workspace" },
315
- { in: "body", key: "directory" },
316
- { in: "body", key: "force" },
317
- ],
318
- },
319
- ]);
320
- return (options?.client ?? this.client).delete({
321
- url: "/experimental/project/{projectID}/copy",
322
- ...options,
323
- ...params,
324
- headers: {
325
- "Content-Type": "application/json",
326
- ...options?.headers,
327
- ...params.headers,
328
- },
329
- });
330
- }
331
- /**
332
- * Create project copy
333
- *
334
- * Create a local physical copy of a project using the selected strategy.
335
- */
336
- create(parameters, options) {
309
+ generateName(parameters, options) {
337
310
  const params = buildClientParams([parameters], [
338
311
  {
339
312
  args: [
340
313
  { in: "path", key: "projectID" },
314
+ { in: "query", key: "directory" },
341
315
  { in: "query", key: "workspace" },
342
- { in: "body", key: "strategy" },
343
- { in: "body", key: "directory" },
344
- { in: "body", key: "name" },
345
316
  { in: "body", key: "context" },
346
317
  ],
347
318
  },
348
319
  ]);
349
320
  return (options?.client ?? this.client).post({
350
- url: "/experimental/project/{projectID}/copy",
321
+ url: "/experimental/project/{projectID}/copy/generate-name",
351
322
  ...options,
352
323
  ...params,
353
324
  headers: {
@@ -357,27 +328,6 @@ export class ProjectCopy extends HeyApiClient {
357
328
  },
358
329
  });
359
330
  }
360
- /**
361
- * Refresh project copies
362
- *
363
- * Discover local project copies using one or all configured strategies.
364
- */
365
- refresh(parameters, options) {
366
- const params = buildClientParams([parameters], [
367
- {
368
- args: [
369
- { in: "path", key: "projectID" },
370
- { in: "query", key: "directory" },
371
- { in: "query", key: "workspace" },
372
- ],
373
- },
374
- ]);
375
- return (options?.client ?? this.client).post({
376
- url: "/experimental/project/{projectID}/copy/refresh",
377
- ...options,
378
- ...params,
379
- });
380
- }
381
331
  }
382
332
  export class Adapter extends HeyApiClient {
383
333
  /**
@@ -3084,6 +3034,21 @@ export class Health extends HeyApiClient {
3084
3034
  });
3085
3035
  }
3086
3036
  }
3037
+ export class Location extends HeyApiClient {
3038
+ /**
3039
+ * Get location
3040
+ *
3041
+ * Resolve the requested location or the server default location.
3042
+ */
3043
+ get(parameters, options) {
3044
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]);
3045
+ return (options?.client ?? this.client).get({
3046
+ url: "/api/location",
3047
+ ...options,
3048
+ ...params,
3049
+ });
3050
+ }
3051
+ }
3087
3052
  export class Agent extends HeyApiClient {
3088
3053
  /**
3089
3054
  * List agents
@@ -3142,6 +3107,19 @@ export class Permission2 extends HeyApiClient {
3142
3107
  }
3143
3108
  }
3144
3109
  export class Question2 extends HeyApiClient {
3110
+ /**
3111
+ * List session question requests
3112
+ *
3113
+ * Retrieve pending question requests owned by a session.
3114
+ */
3115
+ list(parameters, options) {
3116
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]);
3117
+ return (options?.client ?? this.client).get({
3118
+ url: "/api/session/{sessionID}/question",
3119
+ ...options,
3120
+ ...params,
3121
+ });
3122
+ }
3145
3123
  /**
3146
3124
  * Reply to pending question request
3147
3125
  *
@@ -3216,6 +3194,46 @@ export class Session3 extends HeyApiClient {
3216
3194
  ...params,
3217
3195
  });
3218
3196
  }
3197
+ /**
3198
+ * Create session
3199
+ *
3200
+ * Create a session at the requested location.
3201
+ */
3202
+ create(parameters, options) {
3203
+ const params = buildClientParams([parameters], [
3204
+ {
3205
+ args: [
3206
+ { in: "body", key: "id" },
3207
+ { in: "body", key: "agent" },
3208
+ { in: "body", key: "model" },
3209
+ { in: "body", key: "location" },
3210
+ ],
3211
+ },
3212
+ ]);
3213
+ return (options?.client ?? this.client).post({
3214
+ url: "/api/session",
3215
+ ...options,
3216
+ ...params,
3217
+ headers: {
3218
+ "Content-Type": "application/json",
3219
+ ...options?.headers,
3220
+ ...params.headers,
3221
+ },
3222
+ });
3223
+ }
3224
+ /**
3225
+ * Get session
3226
+ *
3227
+ * Retrieve a session by ID.
3228
+ */
3229
+ get(parameters, options) {
3230
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]);
3231
+ return (options?.client ?? this.client).get({
3232
+ url: "/api/session/{sessionID}",
3233
+ ...options,
3234
+ ...params,
3235
+ });
3236
+ }
3219
3237
  /**
3220
3238
  * Send message
3221
3239
  *
@@ -3364,6 +3382,214 @@ export class Provider2 extends HeyApiClient {
3364
3382
  });
3365
3383
  }
3366
3384
  }
3385
+ export class Connect extends HeyApiClient {
3386
+ /**
3387
+ * Connect with key
3388
+ *
3389
+ * Run a key authentication method and store the resulting credential.
3390
+ */
3391
+ key(parameters, options) {
3392
+ const params = buildClientParams([parameters], [
3393
+ {
3394
+ args: [
3395
+ { in: "path", key: "integrationID" },
3396
+ { in: "query", key: "location" },
3397
+ { in: "body", key: "key" },
3398
+ { in: "body", key: "label" },
3399
+ ],
3400
+ },
3401
+ ]);
3402
+ return (options?.client ?? this.client).post({
3403
+ url: "/api/integration/{integrationID}/connect/key",
3404
+ ...options,
3405
+ ...params,
3406
+ headers: {
3407
+ "Content-Type": "application/json",
3408
+ ...options?.headers,
3409
+ ...params.headers,
3410
+ },
3411
+ });
3412
+ }
3413
+ /**
3414
+ * Begin OAuth connection
3415
+ *
3416
+ * Start an OAuth attempt and return the authorization details.
3417
+ */
3418
+ oauth(parameters, options) {
3419
+ const params = buildClientParams([parameters], [
3420
+ {
3421
+ args: [
3422
+ { in: "path", key: "integrationID" },
3423
+ { in: "query", key: "location" },
3424
+ { in: "body", key: "methodID" },
3425
+ { in: "body", key: "inputs" },
3426
+ { in: "body", key: "label" },
3427
+ ],
3428
+ },
3429
+ ]);
3430
+ return (options?.client ?? this.client).post({
3431
+ url: "/api/integration/{integrationID}/connect/oauth",
3432
+ ...options,
3433
+ ...params,
3434
+ headers: {
3435
+ "Content-Type": "application/json",
3436
+ ...options?.headers,
3437
+ ...params.headers,
3438
+ },
3439
+ });
3440
+ }
3441
+ }
3442
+ export class Attempt extends HeyApiClient {
3443
+ /**
3444
+ * Cancel OAuth connection
3445
+ *
3446
+ * Cancel an OAuth attempt and release its resources.
3447
+ */
3448
+ cancel(parameters, options) {
3449
+ const params = buildClientParams([parameters], [
3450
+ {
3451
+ args: [
3452
+ { in: "path", key: "attemptID" },
3453
+ { in: "query", key: "location" },
3454
+ ],
3455
+ },
3456
+ ]);
3457
+ return (options?.client ?? this.client).delete({
3458
+ url: "/api/integration/attempt/{attemptID}",
3459
+ ...options,
3460
+ ...params,
3461
+ });
3462
+ }
3463
+ /**
3464
+ * Get OAuth attempt status
3465
+ *
3466
+ * Poll the current status of an OAuth attempt.
3467
+ */
3468
+ status(parameters, options) {
3469
+ const params = buildClientParams([parameters], [
3470
+ {
3471
+ args: [
3472
+ { in: "path", key: "attemptID" },
3473
+ { in: "query", key: "location" },
3474
+ ],
3475
+ },
3476
+ ]);
3477
+ return (options?.client ?? this.client).get({
3478
+ url: "/api/integration/attempt/{attemptID}",
3479
+ ...options,
3480
+ ...params,
3481
+ });
3482
+ }
3483
+ /**
3484
+ * Complete OAuth connection
3485
+ *
3486
+ * Complete a code-based OAuth attempt and store the resulting credential.
3487
+ */
3488
+ complete(parameters, options) {
3489
+ const params = buildClientParams([parameters], [
3490
+ {
3491
+ args: [
3492
+ { in: "path", key: "attemptID" },
3493
+ { in: "query", key: "location" },
3494
+ { in: "body", key: "code" },
3495
+ ],
3496
+ },
3497
+ ]);
3498
+ return (options?.client ?? this.client).post({
3499
+ url: "/api/integration/attempt/{attemptID}/complete",
3500
+ ...options,
3501
+ ...params,
3502
+ headers: {
3503
+ "Content-Type": "application/json",
3504
+ ...options?.headers,
3505
+ ...params.headers,
3506
+ },
3507
+ });
3508
+ }
3509
+ }
3510
+ export class Integration extends HeyApiClient {
3511
+ /**
3512
+ * List integrations
3513
+ *
3514
+ * Retrieve available integrations and their authentication methods.
3515
+ */
3516
+ list(parameters, options) {
3517
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]);
3518
+ return (options?.client ?? this.client).get({
3519
+ url: "/api/integration",
3520
+ ...options,
3521
+ ...params,
3522
+ });
3523
+ }
3524
+ /**
3525
+ * Get integration
3526
+ *
3527
+ * Retrieve one integration and its authentication methods.
3528
+ */
3529
+ get(parameters, options) {
3530
+ const params = buildClientParams([parameters], [
3531
+ {
3532
+ args: [
3533
+ { in: "path", key: "integrationID" },
3534
+ { in: "query", key: "location" },
3535
+ ],
3536
+ },
3537
+ ]);
3538
+ return (options?.client ?? this.client).get({
3539
+ url: "/api/integration/{integrationID}",
3540
+ ...options,
3541
+ ...params,
3542
+ });
3543
+ }
3544
+ _connect;
3545
+ get connect() {
3546
+ return (this._connect ??= new Connect({ client: this.client }));
3547
+ }
3548
+ _attempt;
3549
+ get attempt() {
3550
+ return (this._attempt ??= new Attempt({ client: this.client }));
3551
+ }
3552
+ }
3553
+ export class Credential extends HeyApiClient {
3554
+ /**
3555
+ * Remove credential
3556
+ *
3557
+ * Remove a stored integration credential.
3558
+ */
3559
+ remove(parameters, options) {
3560
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "credentialID" }] }]);
3561
+ return (options?.client ?? this.client).delete({
3562
+ url: "/api/credential/{credentialID}",
3563
+ ...options,
3564
+ ...params,
3565
+ });
3566
+ }
3567
+ /**
3568
+ * Update credential
3569
+ *
3570
+ * Update a stored credential label.
3571
+ */
3572
+ update(parameters, options) {
3573
+ const params = buildClientParams([parameters], [
3574
+ {
3575
+ args: [
3576
+ { in: "path", key: "credentialID" },
3577
+ { in: "body", key: "label" },
3578
+ ],
3579
+ },
3580
+ ]);
3581
+ return (options?.client ?? this.client).patch({
3582
+ url: "/api/credential/{credentialID}",
3583
+ ...options,
3584
+ ...params,
3585
+ headers: {
3586
+ "Content-Type": "application/json",
3587
+ ...options?.headers,
3588
+ ...params.headers,
3589
+ },
3590
+ });
3591
+ }
3592
+ }
3367
3593
  export class Request extends HeyApiClient {
3368
3594
  /**
3369
3595
  * List pending permission requests
@@ -3421,19 +3647,12 @@ export class Fs extends HeyApiClient {
3421
3647
  /**
3422
3648
  * Read file
3423
3649
  *
3424
- * Read one file relative to the requested location.
3650
+ * Serve one file relative to the requested location.
3425
3651
  */
3426
3652
  read(parameters, options) {
3427
- const params = buildClientParams([parameters], [
3428
- {
3429
- args: [
3430
- { in: "query", key: "location" },
3431
- { in: "query", key: "path" },
3432
- ],
3433
- },
3434
- ]);
3653
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]);
3435
3654
  return (options?.client ?? this.client).get({
3436
- url: "/api/fs/read",
3655
+ url: "/api/fs/read/*",
3437
3656
  ...options,
3438
3657
  ...params,
3439
3658
  });
@@ -3562,11 +3781,77 @@ export class Reference extends HeyApiClient {
3562
3781
  });
3563
3782
  }
3564
3783
  }
3784
+ export class ProjectCopy2 extends HeyApiClient {
3785
+ remove(parameters, options) {
3786
+ const params = buildClientParams([parameters], [
3787
+ {
3788
+ args: [
3789
+ { in: "path", key: "projectID" },
3790
+ { in: "query", key: "location" },
3791
+ { in: "body", key: "directory" },
3792
+ { in: "body", key: "force" },
3793
+ ],
3794
+ },
3795
+ ]);
3796
+ return (options?.client ?? this.client).delete({
3797
+ url: "/experimental/project/{projectID}/copy",
3798
+ ...options,
3799
+ ...params,
3800
+ headers: {
3801
+ "Content-Type": "application/json",
3802
+ ...options?.headers,
3803
+ ...params.headers,
3804
+ },
3805
+ });
3806
+ }
3807
+ create(parameters, options) {
3808
+ const params = buildClientParams([parameters], [
3809
+ {
3810
+ args: [
3811
+ { in: "path", key: "projectID" },
3812
+ { in: "query", key: "location" },
3813
+ { in: "body", key: "strategy" },
3814
+ { in: "body", key: "directory" },
3815
+ { in: "body", key: "name" },
3816
+ ],
3817
+ },
3818
+ ]);
3819
+ return (options?.client ?? this.client).post({
3820
+ url: "/experimental/project/{projectID}/copy",
3821
+ ...options,
3822
+ ...params,
3823
+ headers: {
3824
+ "Content-Type": "application/json",
3825
+ ...options?.headers,
3826
+ ...params.headers,
3827
+ },
3828
+ });
3829
+ }
3830
+ refresh(parameters, options) {
3831
+ const params = buildClientParams([parameters], [
3832
+ {
3833
+ args: [
3834
+ { in: "path", key: "projectID" },
3835
+ { in: "query", key: "location" },
3836
+ ],
3837
+ },
3838
+ ]);
3839
+ return (options?.client ?? this.client).post({
3840
+ url: "/experimental/project/{projectID}/copy/refresh",
3841
+ ...options,
3842
+ ...params,
3843
+ });
3844
+ }
3845
+ }
3565
3846
  export class V2 extends HeyApiClient {
3566
3847
  _health;
3567
3848
  get health() {
3568
3849
  return (this._health ??= new Health({ client: this.client }));
3569
3850
  }
3851
+ _location;
3852
+ get location() {
3853
+ return (this._location ??= new Location({ client: this.client }));
3854
+ }
3570
3855
  _agent;
3571
3856
  get agent() {
3572
3857
  return (this._agent ??= new Agent({ client: this.client }));
@@ -3583,6 +3868,14 @@ export class V2 extends HeyApiClient {
3583
3868
  get provider() {
3584
3869
  return (this._provider ??= new Provider2({ client: this.client }));
3585
3870
  }
3871
+ _integration;
3872
+ get integration() {
3873
+ return (this._integration ??= new Integration({ client: this.client }));
3874
+ }
3875
+ _credential;
3876
+ get credential() {
3877
+ return (this._credential ??= new Credential({ client: this.client }));
3878
+ }
3586
3879
  _permission;
3587
3880
  get permission() {
3588
3881
  return (this._permission ??= new Permission3({ client: this.client }));
@@ -3611,6 +3904,10 @@ export class V2 extends HeyApiClient {
3611
3904
  get reference() {
3612
3905
  return (this._reference ??= new Reference({ client: this.client }));
3613
3906
  }
3907
+ _projectCopy;
3908
+ get projectCopy() {
3909
+ return (this._projectCopy ??= new ProjectCopy2({ client: this.client }));
3910
+ }
3614
3911
  }
3615
3912
  export class OpencodeClient extends HeyApiClient {
3616
3913
  static __registry = new HeyApiRegistry();