@opencode-ai/sdk 0.0.0-next-14722 → 0.0.0-next-14742

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.
@@ -3222,42 +3222,44 @@ export class Context extends HeyApiClient {
3222
3222
  return (this._entry ??= new Entry({ client: this.client }));
3223
3223
  }
3224
3224
  }
3225
- export class Permission2 extends HeyApiClient {
3225
+ export class Form extends HeyApiClient {
3226
3226
  /**
3227
- * List session permission requests
3227
+ * List session forms
3228
3228
  *
3229
- * Retrieve pending permission requests owned by a session.
3229
+ * Retrieve pending forms for a session.
3230
3230
  */
3231
3231
  list(parameters, options) {
3232
- const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]);
3232
+ const params = buildClientParams([parameters], [
3233
+ {
3234
+ args: [
3235
+ { in: "path", key: "sessionID" },
3236
+ { in: "query", key: "location" },
3237
+ ],
3238
+ },
3239
+ ]);
3233
3240
  return (options?.client ?? this.client).get({
3234
- url: "/api/session/{sessionID}/permission",
3241
+ url: "/api/session/{sessionID}/form",
3235
3242
  ...options,
3236
3243
  ...params,
3237
3244
  });
3238
3245
  }
3239
3246
  /**
3240
- * Create permission request
3247
+ * Create session form
3241
3248
  *
3242
- * Evaluate and, when approval is required, create a permission request for a session.
3249
+ * Create a form for a session.
3243
3250
  */
3244
3251
  create(parameters, options) {
3245
3252
  const params = buildClientParams([parameters], [
3246
3253
  {
3247
3254
  args: [
3248
3255
  { in: "path", key: "sessionID" },
3249
- { in: "body", key: "id" },
3250
- { in: "body", key: "action" },
3251
- { in: "body", key: "resources" },
3252
- { in: "body", key: "save" },
3253
- { in: "body", key: "metadata" },
3254
- { in: "body", key: "source" },
3255
- { in: "body", key: "agent" },
3256
+ { in: "query", key: "location" },
3257
+ { key: "formCreatePayload", map: "body" },
3256
3258
  ],
3257
3259
  },
3258
3260
  ]);
3259
3261
  return (options?.client ?? this.client).post({
3260
- url: "/api/session/{sessionID}/permission",
3262
+ url: "/api/session/{sessionID}/form",
3261
3263
  ...options,
3262
3264
  ...params,
3263
3265
  headers: {
@@ -3268,43 +3270,65 @@ export class Permission2 extends HeyApiClient {
3268
3270
  });
3269
3271
  }
3270
3272
  /**
3271
- * Get permission request
3273
+ * Get session form
3272
3274
  *
3273
- * Retrieve a pending permission request owned by a session.
3275
+ * Retrieve a form for a session.
3274
3276
  */
3275
3277
  get(parameters, options) {
3276
3278
  const params = buildClientParams([parameters], [
3277
3279
  {
3278
3280
  args: [
3279
3281
  { in: "path", key: "sessionID" },
3280
- { in: "path", key: "requestID" },
3282
+ { in: "path", key: "formID" },
3283
+ { in: "query", key: "location" },
3281
3284
  ],
3282
3285
  },
3283
3286
  ]);
3284
3287
  return (options?.client ?? this.client).get({
3285
- url: "/api/session/{sessionID}/permission/{requestID}",
3288
+ url: "/api/session/{sessionID}/form/{formID}",
3286
3289
  ...options,
3287
3290
  ...params,
3288
3291
  });
3289
3292
  }
3290
3293
  /**
3291
- * Reply to pending permission request
3294
+ * Get form state
3292
3295
  *
3293
- * Respond to a pending permission request owned by a session.
3296
+ * Retrieve the current state for a form.
3297
+ */
3298
+ state(parameters, options) {
3299
+ const params = buildClientParams([parameters], [
3300
+ {
3301
+ args: [
3302
+ { in: "path", key: "sessionID" },
3303
+ { in: "path", key: "formID" },
3304
+ { in: "query", key: "location" },
3305
+ ],
3306
+ },
3307
+ ]);
3308
+ return (options?.client ?? this.client).get({
3309
+ url: "/api/session/{sessionID}/form/{formID}/state",
3310
+ ...options,
3311
+ ...params,
3312
+ });
3313
+ }
3314
+ /**
3315
+ * Reply to form
3316
+ *
3317
+ * Submit an answer to a pending form.
3294
3318
  */
3295
3319
  reply(parameters, options) {
3296
3320
  const params = buildClientParams([parameters], [
3297
3321
  {
3298
3322
  args: [
3299
3323
  { in: "path", key: "sessionID" },
3300
- { in: "path", key: "requestID" },
3301
- { in: "body", key: "reply" },
3302
- { in: "body", key: "message" },
3324
+ { in: "path", key: "formID" },
3325
+ { in: "query", key: "location" },
3326
+ { key: "formReply", map: "body" },
3303
3327
  ],
3304
3328
  },
3305
3329
  ]);
3306
3330
  return (options?.client ?? this.client).post({
3307
- url: "/api/session/{sessionID}/permission/{requestID}/reply",
3331
+ url: "/api/session/{sessionID}/form/{formID}/reply",
3308
3332
  ...options,
3309
3333
  ...params,
3310
3334
  headers: {
@@ -3314,38 +3338,64 @@ export class Permission2 extends HeyApiClient {
3314
3338
  },
3315
3339
  });
3316
3340
  }
3341
+ /**
3342
+ * Cancel form
3343
+ *
3344
+ * Cancel a pending form.
3345
+ */
3346
+ cancel(parameters, options) {
3347
+ const params = buildClientParams([parameters], [
3348
+ {
3349
+ args: [
3350
+ { in: "path", key: "sessionID" },
3351
+ { in: "path", key: "formID" },
3352
+ { in: "query", key: "location" },
3353
+ ],
3354
+ },
3355
+ ]);
3356
+ return (options?.client ?? this.client).post({
3357
+ url: "/api/session/{sessionID}/form/{formID}/cancel",
3358
+ ...options,
3359
+ ...params,
3360
+ });
3361
+ }
3317
3362
  }
3318
- export class Question2 extends HeyApiClient {
3363
+ export class Permission2 extends HeyApiClient {
3319
3364
  /**
3320
- * List session question requests
3365
+ * List session permission requests
3321
3366
  *
3322
- * Retrieve pending question requests owned by a session.
3367
+ * Retrieve pending permission requests owned by a session.
3323
3368
  */
3324
3369
  list(parameters, options) {
3325
3370
  const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }]);
3326
3371
  return (options?.client ?? this.client).get({
3327
- url: "/api/session/{sessionID}/question",
3372
+ url: "/api/session/{sessionID}/permission",
3328
3373
  ...options,
3329
3374
  ...params,
3330
3375
  });
3331
3376
  }
3332
3377
  /**
3333
- * Reply to pending question request
3378
+ * Create permission request
3334
3379
  *
3335
- * Answer a pending question request owned by a session.
3380
+ * Evaluate and, when approval is required, create a permission request for a session.
3336
3381
  */
3337
- reply(parameters, options) {
3382
+ create(parameters, options) {
3338
3383
  const params = buildClientParams([parameters], [
3339
3384
  {
3340
3385
  args: [
3341
3386
  { in: "path", key: "sessionID" },
3342
- { in: "path", key: "requestID" },
3343
- { key: "questionV2Reply", map: "body" },
3387
+ { in: "body", key: "id" },
3388
+ { in: "body", key: "action" },
3389
+ { in: "body", key: "resources" },
3390
+ { in: "body", key: "save" },
3391
+ { in: "body", key: "metadata" },
3392
+ { in: "body", key: "source" },
3393
+ { in: "body", key: "agent" },
3344
3394
  ],
3345
3395
  },
3346
3396
  ]);
3347
3397
  return (options?.client ?? this.client).post({
3348
- url: "/api/session/{sessionID}/question/{requestID}/reply",
3398
+ url: "/api/session/{sessionID}/permission",
3349
3399
  ...options,
3350
3400
  ...params,
3351
3401
  headers: {
@@ -3356,11 +3406,11 @@ export class Question2 extends HeyApiClient {
3356
3406
  });
3357
3407
  }
3358
3408
  /**
3359
- * Reject pending question request
3409
+ * Get permission request
3360
3410
  *
3361
- * Reject a pending question request owned by a session.
3411
+ * Retrieve a pending permission request owned by a session.
3362
3412
  */
3363
- reject(parameters, options) {
3413
+ get(parameters, options) {
3364
3414
  const params = buildClientParams([parameters], [
3365
3415
  {
3366
3416
  args: [
@@ -3369,10 +3419,37 @@ export class Question2 extends HeyApiClient {
3369
3419
  ],
3370
3420
  },
3371
3421
  ]);
3422
+ return (options?.client ?? this.client).get({
3423
+ url: "/api/session/{sessionID}/permission/{requestID}",
3424
+ ...options,
3425
+ ...params,
3426
+ });
3427
+ }
3428
+ /**
3429
+ * Reply to pending permission request
3430
+ *
3431
+ * Respond to a pending permission request owned by a session.
3432
+ */
3433
+ reply(parameters, options) {
3434
+ const params = buildClientParams([parameters], [
3435
+ {
3436
+ args: [
3437
+ { in: "path", key: "sessionID" },
3438
+ { in: "path", key: "requestID" },
3439
+ { in: "body", key: "reply" },
3440
+ { in: "body", key: "message" },
3441
+ ],
3442
+ },
3443
+ ]);
3372
3444
  return (options?.client ?? this.client).post({
3373
- url: "/api/session/{sessionID}/question/{requestID}/reject",
3445
+ url: "/api/session/{sessionID}/permission/{requestID}/reply",
3374
3446
  ...options,
3375
3447
  ...params,
3448
+ headers: {
3449
+ "Content-Type": "application/json",
3450
+ ...options?.headers,
3451
+ ...params.headers,
3452
+ },
3376
3453
  });
3377
3454
  }
3378
3455
  }
@@ -3390,6 +3467,7 @@ export class Session3 extends HeyApiClient {
3390
3467
  { in: "query", key: "limit" },
3391
3468
  { in: "query", key: "order" },
3392
3469
  { in: "query", key: "search" },
3470
+ { in: "query", key: "parentID" },
3393
3471
  { in: "query", key: "directory" },
3394
3472
  { in: "query", key: "project" },
3395
3473
  { in: "query", key: "subpath" },
@@ -3433,7 +3511,7 @@ export class Session3 extends HeyApiClient {
3433
3511
  /**
3434
3512
  * List active sessions
3435
3513
  *
3436
- * Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive.
3514
+ * Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive. Watermarks are the durable log positions read alongside the activity snapshot; activity itself is process state, so the pairing is advisory rather than transactional.
3437
3515
  */
3438
3516
  active(options) {
3439
3517
  return (options?.client ?? this.client).get({
@@ -3709,42 +3787,22 @@ export class Session3 extends HeyApiClient {
3709
3787
  });
3710
3788
  }
3711
3789
  /**
3712
- * Get session history
3790
+ * Read the session log
3713
3791
  *
3714
- * Read one finite page of public durable Session events after an exclusive aggregate sequence. Newly committed events may appear on later pages.
3792
+ * Durable, ordered, gap-free read of public session events after an exclusive aggregate sequence. Emits a synced marker once replay reaches the captured watermark, then completes; with follow=true it continues with live events instead. The only event API that promises reliability: attach after a snapshot watermark to compose fetch and stream without a race window.
3715
3793
  */
3716
- history(parameters, options) {
3717
- const params = buildClientParams([parameters], [
3718
- {
3719
- args: [
3720
- { in: "path", key: "sessionID" },
3721
- { in: "query", key: "limit" },
3722
- { in: "query", key: "after" },
3723
- ],
3724
- },
3725
- ]);
3726
- return (options?.client ?? this.client).get({
3727
- url: "/api/session/{sessionID}/history",
3728
- ...options,
3729
- ...params,
3730
- });
3731
- }
3732
- /**
3733
- * Subscribe to session events
3734
- *
3735
- * Replay durable events after an aggregate sequence, then continue with new durable events.
3736
- */
3737
- events(parameters, options) {
3794
+ log(parameters, options) {
3738
3795
  const params = buildClientParams([parameters], [
3739
3796
  {
3740
3797
  args: [
3741
3798
  { in: "path", key: "sessionID" },
3742
3799
  { in: "query", key: "after" },
3800
+ { in: "query", key: "follow" },
3743
3801
  ],
3744
3802
  },
3745
3803
  ]);
3746
3804
  return (options?.client ?? this.client).sse.get({
3747
- url: "/api/session/{sessionID}/event",
3805
+ url: "/api/session/{sessionID}/log",
3748
3806
  ...options,
3749
3807
  ...params,
3750
3808
  });
@@ -3825,14 +3883,14 @@ export class Session3 extends HeyApiClient {
3825
3883
  get context2() {
3826
3884
  return (this._context ??= new Context({ client: this.client }));
3827
3885
  }
3886
+ _form;
3887
+ get form() {
3888
+ return (this._form ??= new Form({ client: this.client }));
3889
+ }
3828
3890
  _permission;
3829
3891
  get permission() {
3830
3892
  return (this._permission ??= new Permission2({ client: this.client }));
3831
3893
  }
3832
- _question;
3833
- get question() {
3834
- return (this._question ??= new Question2({ client: this.client }));
3835
- }
3836
3894
  }
3837
3895
  export class Model extends HeyApiClient {
3838
3896
  /**
@@ -4192,6 +4250,27 @@ export class Project2 extends HeyApiClient {
4192
4250
  }
4193
4251
  }
4194
4252
  export class Request extends HeyApiClient {
4253
+ /**
4254
+ * List pending form requests
4255
+ *
4256
+ * Retrieve pending forms for a location.
4257
+ */
4258
+ list(parameters, options) {
4259
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]);
4260
+ return (options?.client ?? this.client).get({
4261
+ url: "/api/form/request",
4262
+ ...options,
4263
+ ...params,
4264
+ });
4265
+ }
4266
+ }
4267
+ export class Form2 extends HeyApiClient {
4268
+ _request;
4269
+ get request() {
4270
+ return (this._request ??= new Request({ client: this.client }));
4271
+ }
4272
+ }
4273
+ export class Request2 extends HeyApiClient {
4195
4274
  /**
4196
4275
  * List pending permission requests
4197
4276
  *
@@ -4237,7 +4316,7 @@ export class Saved extends HeyApiClient {
4237
4316
  export class Permission3 extends HeyApiClient {
4238
4317
  _request;
4239
4318
  get request() {
4240
- return (this._request ??= new Request({ client: this.client }));
4319
+ return (this._request ??= new Request2({ client: this.client }));
4241
4320
  }
4242
4321
  _saved;
4243
4322
  get saved() {
@@ -4335,7 +4414,7 @@ export class Event2 extends HeyApiClient {
4335
4414
  /**
4336
4415
  * Subscribe to events
4337
4416
  *
4338
- * Subscribe to native event payloads for the server.
4417
+ * Subscribe to native event payloads for the server. Volatile by contract: a slow consumer overflows and fails the stream, and events during disconnection are missed. Consumers that need reliability should combine the changes feed with durable session log reads.
4339
4418
  */
4340
4419
  subscribe(options) {
4341
4420
  return (options?.client ?? this.client).sse.get({
@@ -4343,6 +4422,17 @@ export class Event2 extends HeyApiClient {
4343
4422
  ...options,
4344
4423
  });
4345
4424
  }
4425
+ /**
4426
+ * Subscribe to change hints
4427
+ *
4428
+ * Payload-free hint channel: after an event commits, a subscriber eventually receives a hint for that aggregate with seq at or beyond the event, or a sweep-required marker. Hints coalesce to the latest seq per aggregate under backpressure and the stream never fails from overflow. No consumer may derive correctness from receiving a hint; correctness always comes from durable log reads plus the consumer's own checkpoint. A sweep-required marker is emitted first on every (re)subscribe and whenever hint retention is exceeded: treat every aggregate as potentially dirty and recover via bounded sweep plus log reads.
4429
+ */
4430
+ changes(options) {
4431
+ return (options?.client ?? this.client).sse.get({
4432
+ url: "/api/event/changes",
4433
+ ...options,
4434
+ });
4435
+ }
4346
4436
  }
4347
4437
  export class Pty2 extends HeyApiClient {
4348
4438
  /**
@@ -4603,27 +4693,6 @@ export class Shell extends HeyApiClient {
4603
4693
  });
4604
4694
  }
4605
4695
  }
4606
- export class Request2 extends HeyApiClient {
4607
- /**
4608
- * List pending question requests
4609
- *
4610
- * Retrieve pending question requests for a location.
4611
- */
4612
- list(parameters, options) {
4613
- const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]);
4614
- return (options?.client ?? this.client).get({
4615
- url: "/api/question/request",
4616
- ...options,
4617
- ...params,
4618
- });
4619
- }
4620
- }
4621
- export class Question3 extends HeyApiClient {
4622
- _request;
4623
- get request() {
4624
- return (this._request ??= new Request2({ client: this.client }));
4625
- }
4626
- }
4627
4696
  export class Reference extends HeyApiClient {
4628
4697
  /**
4629
4698
  * List references
@@ -4750,6 +4819,10 @@ export class V2 extends HeyApiClient {
4750
4819
  get project() {
4751
4820
  return (this._project ??= new Project2({ client: this.client }));
4752
4821
  }
4822
+ _form;
4823
+ get form() {
4824
+ return (this._form ??= new Form2({ client: this.client }));
4825
+ }
4753
4826
  _permission;
4754
4827
  get permission() {
4755
4828
  return (this._permission ??= new Permission3({ client: this.client }));
@@ -4778,10 +4851,6 @@ export class V2 extends HeyApiClient {
4778
4851
  get shell() {
4779
4852
  return (this._shell ??= new Shell({ client: this.client }));
4780
4853
  }
4781
- _question;
4782
- get question() {
4783
- return (this._question ??= new Question3({ client: this.client }));
4784
- }
4785
4854
  _reference;
4786
4855
  get reference() {
4787
4856
  return (this._reference ??= new Reference({ client: this.client }));