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

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
  }
@@ -3433,7 +3510,7 @@ export class Session3 extends HeyApiClient {
3433
3510
  /**
3434
3511
  * List active sessions
3435
3512
  *
3436
- * Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive.
3513
+ * 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
3514
  */
3438
3515
  active(options) {
3439
3516
  return (options?.client ?? this.client).get({
@@ -3709,42 +3786,22 @@ export class Session3 extends HeyApiClient {
3709
3786
  });
3710
3787
  }
3711
3788
  /**
3712
- * Get session history
3789
+ * Read the session log
3713
3790
  *
3714
- * Read one finite page of public durable Session events after an exclusive aggregate sequence. Newly committed events may appear on later pages.
3791
+ * Durable, ordered, gap-free read of public session events after an exclusive aggregate sequence. Emits a caught-up marker once the replay reaches the end of the log, 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
3792
  */
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) {
3793
+ log(parameters, options) {
3738
3794
  const params = buildClientParams([parameters], [
3739
3795
  {
3740
3796
  args: [
3741
3797
  { in: "path", key: "sessionID" },
3742
3798
  { in: "query", key: "after" },
3799
+ { in: "query", key: "follow" },
3743
3800
  ],
3744
3801
  },
3745
3802
  ]);
3746
3803
  return (options?.client ?? this.client).sse.get({
3747
- url: "/api/session/{sessionID}/event",
3804
+ url: "/api/session/{sessionID}/log",
3748
3805
  ...options,
3749
3806
  ...params,
3750
3807
  });
@@ -3825,14 +3882,14 @@ export class Session3 extends HeyApiClient {
3825
3882
  get context2() {
3826
3883
  return (this._context ??= new Context({ client: this.client }));
3827
3884
  }
3885
+ _form;
3886
+ get form() {
3887
+ return (this._form ??= new Form({ client: this.client }));
3888
+ }
3828
3889
  _permission;
3829
3890
  get permission() {
3830
3891
  return (this._permission ??= new Permission2({ client: this.client }));
3831
3892
  }
3832
- _question;
3833
- get question() {
3834
- return (this._question ??= new Question2({ client: this.client }));
3835
- }
3836
3893
  }
3837
3894
  export class Model extends HeyApiClient {
3838
3895
  /**
@@ -4192,6 +4249,27 @@ export class Project2 extends HeyApiClient {
4192
4249
  }
4193
4250
  }
4194
4251
  export class Request extends HeyApiClient {
4252
+ /**
4253
+ * List pending form requests
4254
+ *
4255
+ * Retrieve pending forms for a location.
4256
+ */
4257
+ list(parameters, options) {
4258
+ const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }]);
4259
+ return (options?.client ?? this.client).get({
4260
+ url: "/api/form/request",
4261
+ ...options,
4262
+ ...params,
4263
+ });
4264
+ }
4265
+ }
4266
+ export class Form2 extends HeyApiClient {
4267
+ _request;
4268
+ get request() {
4269
+ return (this._request ??= new Request({ client: this.client }));
4270
+ }
4271
+ }
4272
+ export class Request2 extends HeyApiClient {
4195
4273
  /**
4196
4274
  * List pending permission requests
4197
4275
  *
@@ -4237,7 +4315,7 @@ export class Saved extends HeyApiClient {
4237
4315
  export class Permission3 extends HeyApiClient {
4238
4316
  _request;
4239
4317
  get request() {
4240
- return (this._request ??= new Request({ client: this.client }));
4318
+ return (this._request ??= new Request2({ client: this.client }));
4241
4319
  }
4242
4320
  _saved;
4243
4321
  get saved() {
@@ -4335,7 +4413,7 @@ export class Event2 extends HeyApiClient {
4335
4413
  /**
4336
4414
  * Subscribe to events
4337
4415
  *
4338
- * Subscribe to native event payloads for the server.
4416
+ * 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
4417
  */
4340
4418
  subscribe(options) {
4341
4419
  return (options?.client ?? this.client).sse.get({
@@ -4343,6 +4421,17 @@ export class Event2 extends HeyApiClient {
4343
4421
  ...options,
4344
4422
  });
4345
4423
  }
4424
+ /**
4425
+ * Subscribe to change hints
4426
+ *
4427
+ * 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.
4428
+ */
4429
+ changes(options) {
4430
+ return (options?.client ?? this.client).sse.get({
4431
+ url: "/api/event/changes",
4432
+ ...options,
4433
+ });
4434
+ }
4346
4435
  }
4347
4436
  export class Pty2 extends HeyApiClient {
4348
4437
  /**
@@ -4603,27 +4692,6 @@ export class Shell extends HeyApiClient {
4603
4692
  });
4604
4693
  }
4605
4694
  }
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
4695
  export class Reference extends HeyApiClient {
4628
4696
  /**
4629
4697
  * List references
@@ -4750,6 +4818,10 @@ export class V2 extends HeyApiClient {
4750
4818
  get project() {
4751
4819
  return (this._project ??= new Project2({ client: this.client }));
4752
4820
  }
4821
+ _form;
4822
+ get form() {
4823
+ return (this._form ??= new Form2({ client: this.client }));
4824
+ }
4753
4825
  _permission;
4754
4826
  get permission() {
4755
4827
  return (this._permission ??= new Permission3({ client: this.client }));
@@ -4778,10 +4850,6 @@ export class V2 extends HeyApiClient {
4778
4850
  get shell() {
4779
4851
  return (this._shell ??= new Shell({ client: this.client }));
4780
4852
  }
4781
- _question;
4782
- get question() {
4783
- return (this._question ??= new Question3({ client: this.client }));
4784
- }
4785
4853
  _reference;
4786
4854
  get reference() {
4787
4855
  return (this._reference ??= new Reference({ client: this.client }));