@opencode/protocol 2.3.1 → 2.4.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.
package/dist/client.js CHANGED
@@ -84,6 +84,7 @@ export const promiseOmitEndpoints = new Set([
84
84
  "pty.connect",
85
85
  "persistentPty.connect",
86
86
  "mcp.client",
87
+ "machine.link",
87
88
  "generate.textLegacy",
88
89
  ]);
89
90
  export const effectOmitEndpoints = new Set([
@@ -95,5 +96,6 @@ export const effectOmitEndpoints = new Set([
95
96
  "pty.connect",
96
97
  "persistentPty.connect",
97
98
  "mcp.client",
99
+ "machine.link",
98
100
  "generate.textLegacy",
99
101
  ]);
package/dist/errors.d.ts CHANGED
@@ -252,4 +252,10 @@ declare const ArtifactNotFoundError_base: Schema.Class<ArtifactNotFoundError, Sc
252
252
  }>, import("effect/Cause").YieldableError>;
253
253
  export declare class ArtifactNotFoundError extends ArtifactNotFoundError_base {
254
254
  }
255
+ declare const MachineNotFoundError_base: Schema.Class<MachineNotFoundError, Schema.TaggedStruct<"MachineNotFoundError", {
256
+ readonly machine: Schema.String;
257
+ readonly message: Schema.String;
258
+ }>, import("effect/Cause").YieldableError>;
259
+ export declare class MachineNotFoundError extends MachineNotFoundError_base {
260
+ }
255
261
  export {};
package/dist/errors.js CHANGED
@@ -210,3 +210,8 @@ export class ArtifactNotFoundError extends Schema.TaggedError()("ArtifactNotFoun
210
210
  message: Schema.String,
211
211
  }, { httpApiStatus: 404 }) {
212
212
  }
213
+ export class MachineNotFoundError extends Schema.TaggedError()("MachineNotFoundError", {
214
+ machine: Schema.String,
215
+ message: Schema.String,
216
+ }, { httpApiStatus: 404 }) {
217
+ }
@@ -45,6 +45,9 @@ export declare const CreatePayload: Schema.Struct<{
45
45
  readonly type: Schema.tag<"code">;
46
46
  readonly code: Schema.String;
47
47
  readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
48
+ }>, Schema.Struct<{
49
+ readonly type: Schema.tag<"shell">;
50
+ readonly command: Schema.NonEmptyString;
48
51
  }>]>;
49
52
  readonly expires: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
50
53
  readonly sessionID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "SessionID"> & {
@@ -107,6 +110,9 @@ export declare const AutomationEndpoints: readonly [HttpApiEndpoint.HttpApiEndpo
107
110
  readonly type: Schema.tag<"code">;
108
111
  readonly code: Schema.String;
109
112
  readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
113
+ }>, Schema.Struct<{
114
+ readonly type: Schema.tag<"shell">;
115
+ readonly command: Schema.NonEmptyString;
110
116
  }>]>;
111
117
  readonly expires: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
112
118
  readonly sessionID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "SessionID"> & {
@@ -165,6 +171,9 @@ export declare const AutomationEndpoints: readonly [HttpApiEndpoint.HttpApiEndpo
165
171
  readonly type: Schema.tag<"code">;
166
172
  readonly code: Schema.String;
167
173
  readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
174
+ }>, Schema.Struct<{
175
+ type: Schema.tag<"shell">;
176
+ command: Schema.NonEmptyString;
168
177
  }>]>;
169
178
  readonly expires: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
170
179
  readonly status: Schema.Literals<readonly ["active", "paused", "done"]>;
@@ -234,6 +243,9 @@ export declare const AutomationEndpoints: readonly [HttpApiEndpoint.HttpApiEndpo
234
243
  readonly type: Schema.tag<"code">;
235
244
  readonly code: Schema.String;
236
245
  readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
246
+ }>, Schema.Struct<{
247
+ type: Schema.tag<"shell">;
248
+ command: Schema.NonEmptyString;
237
249
  }>]>;
238
250
  readonly expires: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
239
251
  readonly status: Schema.Literals<readonly ["active", "paused", "done"]>;
@@ -302,6 +314,9 @@ export declare const AutomationEndpoints: readonly [HttpApiEndpoint.HttpApiEndpo
302
314
  readonly type: Schema.tag<"code">;
303
315
  readonly code: Schema.String;
304
316
  readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
317
+ }>, Schema.Struct<{
318
+ type: Schema.tag<"shell">;
319
+ command: Schema.NonEmptyString;
305
320
  }>]>;
306
321
  readonly expires: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
307
322
  readonly status: Schema.Literals<readonly ["active", "paused", "done"]>;
@@ -370,6 +385,9 @@ export declare const AutomationEndpoints: readonly [HttpApiEndpoint.HttpApiEndpo
370
385
  readonly type: Schema.tag<"code">;
371
386
  readonly code: Schema.String;
372
387
  readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
388
+ }>, Schema.Struct<{
389
+ type: Schema.tag<"shell">;
390
+ command: Schema.NonEmptyString;
373
391
  }>]>;
374
392
  readonly expires: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
375
393
  readonly status: Schema.Literals<readonly ["active", "paused", "done"]>;
@@ -438,6 +456,9 @@ export declare const AutomationEndpoints: readonly [HttpApiEndpoint.HttpApiEndpo
438
456
  readonly type: Schema.tag<"code">;
439
457
  readonly code: Schema.String;
440
458
  readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
459
+ }>, Schema.Struct<{
460
+ type: Schema.tag<"shell">;
461
+ command: Schema.NonEmptyString;
441
462
  }>]>;
442
463
  readonly expires: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
443
464
  readonly status: Schema.Literals<readonly ["active", "paused", "done"]>;
@@ -3,7 +3,7 @@ import { Session } from "@opencode/schema/session";
3
3
  import { Schema } from "effect";
4
4
  import { HttpApiEndpoint, HttpApiSchema, OpenApi } from "effect/http-api";
5
5
  import { AutomationNotFoundError, ForbiddenError, InvalidRequestError, SessionNotFoundError } from "../errors.js";
6
- const EXPERIMENTAL = "Experimental: needs experimental.automations in the config of the automation's directory and may change without compatibility guarantees.";
6
+ const EXPERIMENTAL = "Experimental: may change without compatibility guarantees. Set automations to false in the directory's config to disable access.";
7
7
  const errors = [AutomationNotFoundError, ForbiddenError];
8
8
  const params = { automationID: Automation.ID };
9
9
  const annotations = (identifier, summary, description) => OpenApi.annotations({
@@ -26,7 +26,7 @@ export const AutomationEndpoints = [
26
26
  payload: CreatePayload,
27
27
  success: Schema.Struct({ data: Automation.Info }),
28
28
  error: [InvalidRequestError, SessionNotFoundError, ForbiddenError],
29
- }).annotateMerge(annotations("create", "Create automation", "Create an automation that sends a prompt or runs a Code Mode program at a time, every interval, or on a cron. Creating an MCP event watch requires the automation_create tool in a local session; a session ID over HTTP is not a watch authorization.")),
29
+ }).annotateMerge(annotations("create", "Create automation", "Create an automation that sends a prompt, runs a Code Mode program, or runs a shell command at a time, every interval, or on a cron. Creating an MCP event watch requires the automation_create tool in a local session; a session ID over HTTP is not a watch authorization.")),
30
30
  HttpApiEndpoint.get("automation.list", "/api/experimental/automation", {
31
31
  query: ListQuery,
32
32
  success: Schema.Struct({ data: Schema.Array(Automation.Info) }),
@@ -3,5 +3,7 @@ import { HttpApiEndpoint } from "effect/http-api";
3
3
  import { BlobNotFoundError } from "../errors.js";
4
4
  /** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
5
5
  export declare const BlobGetEndpoint: HttpApiEndpoint.HttpApiEndpoint<"blob.get", "GET", "/api/experimental/blob/:id", Schema.toCodecStringTree<Schema.Struct<{
6
- id: Schema.brand<Schema.String, "Blob.ID">;
6
+ id: Schema.brand<Schema.String, "Blob.ID"> & {
7
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
8
+ };
7
9
  }>>, never, never, never, Schema.toCodecJson<Schema.Uint8Array>, Schema.toCodecJson<typeof BlobNotFoundError>, never, never>;
@@ -10,7 +10,7 @@ export const BlobGetEndpoint = HttpApiEndpoint.get("blob.get", "/api/experimenta
10
10
  }).annotateMerge(OpenApi.annotations({
11
11
  identifier: "experimental.blob.get",
12
12
  summary: "Read a blob",
13
- description: "Stream a stored blob's bytes, such as a generated video, with single byte Range, ETag and 304 Not Modified support. Blobs are deleted 7 days after they're written. Experimental: may change without compatibility guarantees.",
13
+ description: "Stream a stored blob's bytes, such as a generated video, with single byte Range, ETag and 304 Not Modified support. A blob is deleted a week after it was stored. Experimental: may change without compatibility guarantees.",
14
14
  // The route shares the `server.experimental` group with the persistent PTY prototype; tag it on its own.
15
15
  transform: (operation) => ({ ...operation, tags: ["experimental"] }),
16
16
  }));
@@ -49,7 +49,7 @@ export declare const makeEventGroup: <const Definitions extends ReadonlyArray<De
49
49
  readonly data: {};
50
50
  }[]])[number]>, never, never, never>, false>;
51
51
  export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpApiEndpoint.HttpApiEndpoint<"event.subscribe", "GET", "/api/event", never, Schema.toCodecStringTree<Schema.Struct<{
52
- readonly types: Schema.optional<Schema.ArrayEnsure<Schema.Union<readonly [Schema.Literals<readonly ("agent.updated" | "artifact.updated" | "command.updated" | "config.updated" | "credential.switched" | "credential.updated" | "experimental.mcp.event" | "filesystem.changed" | "form.cancelled" | "form.created" | "form.replied" | "installation.update-available" | "installation.updated" | "integration.updated" | "location.shutdown" | "mcp.resources.changed" | "mcp.status.changed" | "model.updated" | "models-dev.refreshed" | "permission.asked" | "permission.replied" | "persistent-pty.added" | "persistent-pty.removed" | "persistent-pty.updated" | "plugin.updated" | "project.updated" | "provider.updated" | "pty.created" | "pty.deleted" | "pty.exited" | "pty.updated" | "reference.updated" | "session.agent.selected" | "session.archived" | "session.compaction.delta" | "session.compaction.ended" | "session.compaction.failed" | "session.compaction.started" | "session.created" | "session.deleted" | "session.execution.failed" | "session.execution.interrupted" | "session.execution.started" | "session.execution.succeeded" | "session.forked" | "session.idle" | "session.inbox.cancelled" | "session.inbox.delivered" | "session.inbox.delivery.changed" | "session.inbox.enqueued" | "session.instructions.updated" | "session.metadata.updated" | "session.model.selected" | "session.moved" | "session.permissions" | "session.reasoning.delta" | "session.reasoning.ended" | "session.reasoning.started" | "session.renamed" | "session.retry.scheduled" | "session.revert.cleared" | "session.revert.committed" | "session.revert.staged" | "session.shell.ended" | "session.shell.started" | "session.skill.activated" | "session.status" | "session.step.ended" | "session.step.failed" | "session.step.first-token" | "session.step.started" | "session.step.streamed" | "session.synthetic" | "session.text.delta" | "session.text.ended" | "session.text.started" | "session.tool.called" | "session.tool.failed" | "session.tool.input.delta" | "session.tool.input.ended" | "session.tool.input.started" | "session.tool.progress" | "session.tool.success" | "session.unarchived" | "session.usage.updated" | "session.viewed" | "shell.created" | "shell.deleted" | "shell.exited" | "skill.updated" | "tui.command.execute" | "tui.prompt.append" | "tui.session.select" | "tui.toast.show" | "vcs.branch.updated" | "websearch.updated" | "worktree.resolved" | "worktree.updated")[]>, Schema.TemplateLiteral<readonly ["rpc.", Schema.String]>]>>>;
52
+ readonly types: Schema.optional<Schema.ArrayEnsure<Schema.Union<readonly [Schema.Literals<readonly ("agent.updated" | "artifact.updated" | "command.updated" | "config.updated" | "credential.switched" | "credential.updated" | "experimental.job.updated" | "experimental.mcp.event" | "filesystem.changed" | "form.cancelled" | "form.created" | "form.replied" | "installation.update-available" | "installation.updated" | "integration.updated" | "location.shutdown" | "mcp.resources.changed" | "mcp.status.changed" | "model.updated" | "models-dev.refreshed" | "permission.asked" | "permission.replied" | "persistent-pty.added" | "persistent-pty.removed" | "persistent-pty.updated" | "plugin.updated" | "project.updated" | "provider.updated" | "pty.created" | "pty.deleted" | "pty.exited" | "pty.updated" | "reference.updated" | "session.agent.selected" | "session.archived" | "session.compaction.delta" | "session.compaction.ended" | "session.compaction.failed" | "session.compaction.started" | "session.created" | "session.deleted" | "session.execution.failed" | "session.execution.interrupted" | "session.execution.started" | "session.execution.succeeded" | "session.forked" | "session.idle" | "session.inbox.cancelled" | "session.inbox.delivered" | "session.inbox.delivery.changed" | "session.inbox.enqueued" | "session.instructions.updated" | "session.metadata.updated" | "session.model.selected" | "session.moved" | "session.permissions" | "session.reasoning.delta" | "session.reasoning.ended" | "session.reasoning.started" | "session.renamed" | "session.retry.scheduled" | "session.revert.cleared" | "session.revert.committed" | "session.revert.staged" | "session.shell.ended" | "session.shell.started" | "session.skill.activated" | "session.status" | "session.step.ended" | "session.step.failed" | "session.step.first-token" | "session.step.started" | "session.step.streamed" | "session.synthetic" | "session.text.delta" | "session.text.ended" | "session.text.started" | "session.tool.called" | "session.tool.failed" | "session.tool.input.delta" | "session.tool.input.ended" | "session.tool.input.started" | "session.tool.progress" | "session.tool.success" | "session.unarchived" | "session.usage.updated" | "session.viewed" | "shell.created" | "shell.deleted" | "shell.exited" | "skill.updated" | "tui.command.execute" | "tui.prompt.append" | "tui.session.select" | "tui.toast.show" | "vcs.branch.updated" | "websearch.updated" | "worktree.resolved" | "worktree.updated")[]>, Schema.TemplateLiteral<readonly ["rpc.", Schema.String]>]>>>;
53
53
  }>>, never, never, HttpApiSchema.StreamSse<HttpApiSchema.SseEventFromData<Schema.Union<readonly [Schema.Struct<{
54
54
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
55
55
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -5586,6 +5586,182 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
5586
5586
  ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
5587
5587
  };
5588
5588
  }>;
5589
+ }, Schema.Struct<{
5590
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
5591
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
5592
+ };
5593
+ readonly created: Schema.Finite;
5594
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
5595
+ readonly type: Schema.Literal<"experimental.job.updated">;
5596
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
5597
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
5598
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
5599
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
5600
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
5601
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
5602
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
5603
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
5604
+ }>, never, never>;
5605
+ }>>>, Schema.optionalKey<Schema.Struct<{
5606
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
5607
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
5608
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
5609
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
5610
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
5611
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
5612
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
5613
+ }>, never, never>;
5614
+ }>>, never, never>;
5615
+ readonly data: Schema.Struct<{
5616
+ readonly info: Schema.Union<readonly [Schema.Struct<{
5617
+ readonly id: Schema.String;
5618
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
5619
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5620
+ };
5621
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
5622
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
5623
+ readonly time: Schema.Struct<{
5624
+ readonly started: Schema.Finite;
5625
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
5626
+ }>;
5627
+ readonly kind: Schema.tag<"shell">;
5628
+ readonly shellID: Schema.String;
5629
+ readonly command: Schema.String;
5630
+ }>, Schema.Struct<{
5631
+ readonly id: Schema.String;
5632
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
5633
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5634
+ };
5635
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
5636
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
5637
+ readonly time: Schema.Struct<{
5638
+ readonly started: Schema.Finite;
5639
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
5640
+ }>;
5641
+ readonly kind: Schema.tag<"subagent">;
5642
+ readonly childSessionID: Schema.brand<Schema.String, "SessionID"> & {
5643
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5644
+ };
5645
+ readonly agent: Schema.String;
5646
+ readonly description: Schema.String;
5647
+ }>, Schema.Struct<{
5648
+ readonly id: Schema.String;
5649
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
5650
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5651
+ };
5652
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
5653
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
5654
+ readonly time: Schema.Struct<{
5655
+ readonly started: Schema.Finite;
5656
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
5657
+ }>;
5658
+ readonly kind: Schema.tag<"image">;
5659
+ readonly path: Schema.String;
5660
+ readonly model: Schema.String;
5661
+ }>, Schema.Struct<{
5662
+ readonly id: Schema.String;
5663
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
5664
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5665
+ };
5666
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
5667
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
5668
+ readonly time: Schema.Struct<{
5669
+ readonly started: Schema.Finite;
5670
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
5671
+ }>;
5672
+ readonly kind: Schema.tag<"video">;
5673
+ readonly path: Schema.String;
5674
+ }>, Schema.Struct<{
5675
+ readonly id: Schema.String;
5676
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
5677
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5678
+ };
5679
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
5680
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
5681
+ readonly time: Schema.Struct<{
5682
+ readonly started: Schema.Finite;
5683
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
5684
+ }>;
5685
+ readonly kind: Schema.tag<"codemode">;
5686
+ }>]>;
5687
+ }>;
5688
+ }> & {
5689
+ type: "experimental.job.updated";
5690
+ durability: "ephemeral";
5691
+ durable: undefined;
5692
+ data: Schema.Struct<{
5693
+ readonly info: Schema.Union<readonly [Schema.Struct<{
5694
+ readonly id: Schema.String;
5695
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
5696
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5697
+ };
5698
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
5699
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
5700
+ readonly time: Schema.Struct<{
5701
+ readonly started: Schema.Finite;
5702
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
5703
+ }>;
5704
+ readonly kind: Schema.tag<"shell">;
5705
+ readonly shellID: Schema.String;
5706
+ readonly command: Schema.String;
5707
+ }>, Schema.Struct<{
5708
+ readonly id: Schema.String;
5709
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
5710
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5711
+ };
5712
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
5713
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
5714
+ readonly time: Schema.Struct<{
5715
+ readonly started: Schema.Finite;
5716
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
5717
+ }>;
5718
+ readonly kind: Schema.tag<"subagent">;
5719
+ readonly childSessionID: Schema.brand<Schema.String, "SessionID"> & {
5720
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5721
+ };
5722
+ readonly agent: Schema.String;
5723
+ readonly description: Schema.String;
5724
+ }>, Schema.Struct<{
5725
+ readonly id: Schema.String;
5726
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
5727
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5728
+ };
5729
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
5730
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
5731
+ readonly time: Schema.Struct<{
5732
+ readonly started: Schema.Finite;
5733
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
5734
+ }>;
5735
+ readonly kind: Schema.tag<"image">;
5736
+ readonly path: Schema.String;
5737
+ readonly model: Schema.String;
5738
+ }>, Schema.Struct<{
5739
+ readonly id: Schema.String;
5740
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
5741
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5742
+ };
5743
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
5744
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
5745
+ readonly time: Schema.Struct<{
5746
+ readonly started: Schema.Finite;
5747
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
5748
+ }>;
5749
+ readonly kind: Schema.tag<"video">;
5750
+ readonly path: Schema.String;
5751
+ }>, Schema.Struct<{
5752
+ readonly id: Schema.String;
5753
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
5754
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
5755
+ };
5756
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
5757
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
5758
+ readonly time: Schema.Struct<{
5759
+ readonly started: Schema.Finite;
5760
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
5761
+ }>;
5762
+ readonly kind: Schema.tag<"codemode">;
5763
+ }>]>;
5764
+ }>;
5589
5765
  }, Schema.Struct<{
5590
5766
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
5591
5767
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -7956,6 +8132,78 @@ export declare const EventGroup: HttpApiGroup.HttpApiGroup<"server.event", HttpA
7956
8132
  readonly integrationID: string & import("effect/Brand").Brand<"Integration.ID">;
7957
8133
  readonly credentialID: string & import("effect/Brand").Brand<"Credential.ID">;
7958
8134
  };
8135
+ } | {
8136
+ readonly id: string & import("effect/Brand").Brand<"Event.ID">;
8137
+ readonly created: number;
8138
+ readonly metadata?: {
8139
+ readonly [x: string]: unknown;
8140
+ } | undefined;
8141
+ readonly type: "experimental.job.updated";
8142
+ readonly location?: {
8143
+ readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
8144
+ readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
8145
+ } | undefined;
8146
+ readonly data: {
8147
+ readonly info: {
8148
+ readonly id: string;
8149
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
8150
+ readonly status: "cancelled" | "completed" | "error" | "running";
8151
+ readonly title?: string | undefined;
8152
+ readonly time: {
8153
+ readonly started: number;
8154
+ readonly completed?: number | undefined;
8155
+ };
8156
+ readonly kind: "shell";
8157
+ readonly shellID: string;
8158
+ readonly command: string;
8159
+ } | {
8160
+ readonly id: string;
8161
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
8162
+ readonly status: "cancelled" | "completed" | "error" | "running";
8163
+ readonly title?: string | undefined;
8164
+ readonly time: {
8165
+ readonly started: number;
8166
+ readonly completed?: number | undefined;
8167
+ };
8168
+ readonly kind: "subagent";
8169
+ readonly childSessionID: string & import("effect/Brand").Brand<"SessionID">;
8170
+ readonly agent: string;
8171
+ readonly description: string;
8172
+ } | {
8173
+ readonly id: string;
8174
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
8175
+ readonly status: "cancelled" | "completed" | "error" | "running";
8176
+ readonly title?: string | undefined;
8177
+ readonly time: {
8178
+ readonly started: number;
8179
+ readonly completed?: number | undefined;
8180
+ };
8181
+ readonly kind: "image";
8182
+ readonly path: string;
8183
+ readonly model: string;
8184
+ } | {
8185
+ readonly id: string;
8186
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
8187
+ readonly status: "cancelled" | "completed" | "error" | "running";
8188
+ readonly title?: string | undefined;
8189
+ readonly time: {
8190
+ readonly started: number;
8191
+ readonly completed?: number | undefined;
8192
+ };
8193
+ readonly kind: "video";
8194
+ readonly path: string;
8195
+ } | {
8196
+ readonly id: string;
8197
+ readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
8198
+ readonly status: "cancelled" | "completed" | "error" | "running";
8199
+ readonly title?: string | undefined;
8200
+ readonly time: {
8201
+ readonly started: number;
8202
+ readonly completed?: number | undefined;
8203
+ };
8204
+ readonly kind: "codemode";
8205
+ };
8206
+ };
7959
8207
  } | {
7960
8208
  readonly id: string & import("effect/Brand").Brand<"Event.ID">;
7961
8209
  readonly created: number;
@@ -14497,6 +14745,182 @@ export declare const OpenCodeEvent: Schema.Union<readonly [Schema.Struct<{
14497
14745
  ascending: (id?: string) => string & import("effect/Brand").Brand<"Shell.ID">;
14498
14746
  };
14499
14747
  }>;
14748
+ }, Schema.Struct<{
14749
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
14750
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
14751
+ };
14752
+ readonly created: Schema.Finite;
14753
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
14754
+ readonly type: Schema.Literal<"experimental.job.updated">;
14755
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
14756
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
14757
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
14758
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
14759
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
14760
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
14761
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
14762
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
14763
+ }>, never, never>;
14764
+ }>>>, Schema.optionalKey<Schema.Struct<{
14765
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
14766
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
14767
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
14768
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
14769
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
14770
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
14771
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
14772
+ }>, never, never>;
14773
+ }>>, never, never>;
14774
+ readonly data: Schema.Struct<{
14775
+ readonly info: Schema.Union<readonly [Schema.Struct<{
14776
+ readonly id: Schema.String;
14777
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
14778
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
14779
+ };
14780
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
14781
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14782
+ readonly time: Schema.Struct<{
14783
+ readonly started: Schema.Finite;
14784
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
14785
+ }>;
14786
+ readonly kind: Schema.tag<"shell">;
14787
+ readonly shellID: Schema.String;
14788
+ readonly command: Schema.String;
14789
+ }>, Schema.Struct<{
14790
+ readonly id: Schema.String;
14791
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
14792
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
14793
+ };
14794
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
14795
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14796
+ readonly time: Schema.Struct<{
14797
+ readonly started: Schema.Finite;
14798
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
14799
+ }>;
14800
+ readonly kind: Schema.tag<"subagent">;
14801
+ readonly childSessionID: Schema.brand<Schema.String, "SessionID"> & {
14802
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
14803
+ };
14804
+ readonly agent: Schema.String;
14805
+ readonly description: Schema.String;
14806
+ }>, Schema.Struct<{
14807
+ readonly id: Schema.String;
14808
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
14809
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
14810
+ };
14811
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
14812
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14813
+ readonly time: Schema.Struct<{
14814
+ readonly started: Schema.Finite;
14815
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
14816
+ }>;
14817
+ readonly kind: Schema.tag<"image">;
14818
+ readonly path: Schema.String;
14819
+ readonly model: Schema.String;
14820
+ }>, Schema.Struct<{
14821
+ readonly id: Schema.String;
14822
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
14823
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
14824
+ };
14825
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
14826
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14827
+ readonly time: Schema.Struct<{
14828
+ readonly started: Schema.Finite;
14829
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
14830
+ }>;
14831
+ readonly kind: Schema.tag<"video">;
14832
+ readonly path: Schema.String;
14833
+ }>, Schema.Struct<{
14834
+ readonly id: Schema.String;
14835
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
14836
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
14837
+ };
14838
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
14839
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14840
+ readonly time: Schema.Struct<{
14841
+ readonly started: Schema.Finite;
14842
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
14843
+ }>;
14844
+ readonly kind: Schema.tag<"codemode">;
14845
+ }>]>;
14846
+ }>;
14847
+ }> & {
14848
+ type: "experimental.job.updated";
14849
+ durability: "ephemeral";
14850
+ durable: undefined;
14851
+ data: Schema.Struct<{
14852
+ readonly info: Schema.Union<readonly [Schema.Struct<{
14853
+ readonly id: Schema.String;
14854
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
14855
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
14856
+ };
14857
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
14858
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14859
+ readonly time: Schema.Struct<{
14860
+ readonly started: Schema.Finite;
14861
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
14862
+ }>;
14863
+ readonly kind: Schema.tag<"shell">;
14864
+ readonly shellID: Schema.String;
14865
+ readonly command: Schema.String;
14866
+ }>, Schema.Struct<{
14867
+ readonly id: Schema.String;
14868
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
14869
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
14870
+ };
14871
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
14872
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14873
+ readonly time: Schema.Struct<{
14874
+ readonly started: Schema.Finite;
14875
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
14876
+ }>;
14877
+ readonly kind: Schema.tag<"subagent">;
14878
+ readonly childSessionID: Schema.brand<Schema.String, "SessionID"> & {
14879
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
14880
+ };
14881
+ readonly agent: Schema.String;
14882
+ readonly description: Schema.String;
14883
+ }>, Schema.Struct<{
14884
+ readonly id: Schema.String;
14885
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
14886
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
14887
+ };
14888
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
14889
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14890
+ readonly time: Schema.Struct<{
14891
+ readonly started: Schema.Finite;
14892
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
14893
+ }>;
14894
+ readonly kind: Schema.tag<"image">;
14895
+ readonly path: Schema.String;
14896
+ readonly model: Schema.String;
14897
+ }>, Schema.Struct<{
14898
+ readonly id: Schema.String;
14899
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
14900
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
14901
+ };
14902
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
14903
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14904
+ readonly time: Schema.Struct<{
14905
+ readonly started: Schema.Finite;
14906
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
14907
+ }>;
14908
+ readonly kind: Schema.tag<"video">;
14909
+ readonly path: Schema.String;
14910
+ }>, Schema.Struct<{
14911
+ readonly id: Schema.String;
14912
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
14913
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
14914
+ };
14915
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
14916
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
14917
+ readonly time: Schema.Struct<{
14918
+ readonly started: Schema.Finite;
14919
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
14920
+ }>;
14921
+ readonly kind: Schema.tag<"codemode">;
14922
+ }>]>;
14923
+ }>;
14500
14924
  }, Schema.Struct<{
14501
14925
  readonly id: Schema.brand<Schema.String, "Event.ID"> & {
14502
14926
  create: () => string & import("effect/Brand").Brand<"Event.ID">;
@@ -211,6 +211,9 @@ export declare const ExperimentalGroup: import("effect/http-api/HttpApiGroup").H
211
211
  readonly type: import("effect/Schema").tag<"code">;
212
212
  readonly code: import("effect/Schema").String;
213
213
  readonly args: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>, never, never>;
214
+ }>, import("effect/Schema").Struct<{
215
+ readonly type: import("effect/Schema").tag<"shell">;
216
+ readonly command: import("effect/Schema").NonEmptyString;
214
217
  }>]>;
215
218
  readonly expires: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").String>>, import("effect/Schema").optionalKey<import("effect/Schema").String>, never, never>;
216
219
  readonly sessionID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
@@ -269,6 +272,9 @@ export declare const ExperimentalGroup: import("effect/http-api/HttpApiGroup").H
269
272
  readonly type: import("effect/Schema").tag<"code">;
270
273
  readonly code: import("effect/Schema").String;
271
274
  readonly args: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>, never, never>;
275
+ }>, import("effect/Schema").Struct<{
276
+ type: import("effect/Schema").tag<"shell">;
277
+ command: import("effect/Schema").NonEmptyString;
272
278
  }>]>;
273
279
  readonly expires: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
274
280
  readonly status: import("effect/Schema").Literals<readonly ["active", "paused", "done"]>;
@@ -341,6 +347,9 @@ export declare const ExperimentalGroup: import("effect/http-api/HttpApiGroup").H
341
347
  readonly type: import("effect/Schema").tag<"code">;
342
348
  readonly code: import("effect/Schema").String;
343
349
  readonly args: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>, never, never>;
350
+ }>, import("effect/Schema").Struct<{
351
+ type: import("effect/Schema").tag<"shell">;
352
+ command: import("effect/Schema").NonEmptyString;
344
353
  }>]>;
345
354
  readonly expires: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
346
355
  readonly status: import("effect/Schema").Literals<readonly ["active", "paused", "done"]>;
@@ -410,6 +419,9 @@ export declare const ExperimentalGroup: import("effect/http-api/HttpApiGroup").H
410
419
  readonly type: import("effect/Schema").tag<"code">;
411
420
  readonly code: import("effect/Schema").String;
412
421
  readonly args: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>, never, never>;
422
+ }>, import("effect/Schema").Struct<{
423
+ type: import("effect/Schema").tag<"shell">;
424
+ command: import("effect/Schema").NonEmptyString;
413
425
  }>]>;
414
426
  readonly expires: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
415
427
  readonly status: import("effect/Schema").Literals<readonly ["active", "paused", "done"]>;
@@ -478,6 +490,9 @@ export declare const ExperimentalGroup: import("effect/http-api/HttpApiGroup").H
478
490
  readonly type: import("effect/Schema").tag<"code">;
479
491
  readonly code: import("effect/Schema").String;
480
492
  readonly args: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>, never, never>;
493
+ }>, import("effect/Schema").Struct<{
494
+ type: import("effect/Schema").tag<"shell">;
495
+ command: import("effect/Schema").NonEmptyString;
481
496
  }>]>;
482
497
  readonly expires: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
483
498
  readonly status: import("effect/Schema").Literals<readonly ["active", "paused", "done"]>;
@@ -546,6 +561,9 @@ export declare const ExperimentalGroup: import("effect/http-api/HttpApiGroup").H
546
561
  readonly type: import("effect/Schema").tag<"code">;
547
562
  readonly code: import("effect/Schema").String;
548
563
  readonly args: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>, never, never>;
564
+ }>, import("effect/Schema").Struct<{
565
+ type: import("effect/Schema").tag<"shell">;
566
+ command: import("effect/Schema").NonEmptyString;
549
567
  }>]>;
550
568
  readonly expires: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>>, import("effect/Schema").optionalKey<import("effect/Schema").decodeTo<import("effect/Schema").DateTimeUtc, import("effect/Schema").Finite, never, never>>, never, never>;
551
569
  readonly status: import("effect/Schema").Literals<readonly ["active", "paused", "done"]>;
@@ -561,12 +579,16 @@ export declare const ExperimentalGroup: import("effect/http-api/HttpApiGroup").H
561
579
  }>;
562
580
  }>;
563
581
  }>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ForbiddenError | typeof import("../errors.js").AutomationNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"blob.get", "GET", "/api/experimental/blob/:id", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
564
- id: import("effect/Schema").brand<import("effect/Schema").String, "Blob.ID">;
565
- }>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Uint8Array>, import("effect/Schema").toCodecJson<typeof import("../errors.js").BlobNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"job.list", "GET", "/api/experimental/job", never, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
582
+ id: import("effect/Schema").brand<import("effect/Schema").String, "Blob.ID"> & {
583
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
584
+ };
585
+ }>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Uint8Array>, import("effect/Schema").toCodecJson<typeof import("../errors.js").BlobNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"job.cancel", "POST", "/api/experimental/job/:id/cancel", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
586
+ id: import("effect/Schema").String;
587
+ }>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/http-api/HttpApiSchema").NoContent>, never, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"job.list", "GET", "/api/experimental/job", never, import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
566
588
  readonly sessionID: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
567
589
  create: () => string & import("effect/Brand").Brand<"SessionID">;
568
590
  }>;
569
- readonly kind: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["shell", "subagent", "image", "codemode"]>>;
591
+ readonly kind: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["shell", "subagent", "image", "video", "codemode"]>>;
570
592
  readonly status: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["running", "completed", "error", "cancelled"]>>;
571
593
  readonly descendants: import("effect/Schema").optional<import("effect/Schema").decodeTo<import("effect/Schema").Boolean, import("effect/Schema").Literals<readonly ["true", "false"]>, never, never>>;
572
594
  }>>, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
@@ -615,6 +637,19 @@ export declare const ExperimentalGroup: import("effect/http-api/HttpApiGroup").H
615
637
  readonly kind: import("effect/Schema").tag<"image">;
616
638
  readonly path: import("effect/Schema").String;
617
639
  readonly model: import("effect/Schema").String;
640
+ }>, import("effect/Schema").Struct<{
641
+ readonly id: import("effect/Schema").String;
642
+ readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
643
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
644
+ };
645
+ readonly status: import("effect/Schema").Literals<readonly ["running", "completed", "error", "cancelled"]>;
646
+ readonly title: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").String>>, import("effect/Schema").optionalKey<import("effect/Schema").String>, never, never>;
647
+ readonly time: import("effect/Schema").Struct<{
648
+ readonly started: import("effect/Schema").Finite;
649
+ readonly completed: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Finite>>, import("effect/Schema").optionalKey<import("effect/Schema").Finite>, never, never>;
650
+ }>;
651
+ readonly kind: import("effect/Schema").tag<"video">;
652
+ readonly path: import("effect/Schema").String;
618
653
  }>, import("effect/Schema").Struct<{
619
654
  readonly id: import("effect/Schema").String;
620
655
  readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
@@ -628,7 +663,41 @@ export declare const ExperimentalGroup: import("effect/http-api/HttpApiGroup").H
628
663
  }>;
629
664
  readonly kind: import("effect/Schema").tag<"codemode">;
630
665
  }>]>>;
631
- }>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").InvalidRequestError | typeof import("../errors.js").SessionNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"media.get", "GET", "/api/experimental/media/:hash", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
666
+ }>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").InvalidRequestError | typeof import("../errors.js").SessionNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"machine.add", "POST", "/api/experimental/machine", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
667
+ readonly name: import("effect/Schema").String;
668
+ readonly reach: import("effect/Schema").$Array<import("effect/Schema").Struct<{
669
+ readonly type: import("effect/Schema").Literal<"url">;
670
+ readonly url: import("effect/Schema").String;
671
+ }>>;
672
+ readonly replace: import("effect/Schema").optional<import("effect/Schema").Boolean>;
673
+ }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
674
+ readonly data: import("effect/Schema").Struct<{
675
+ readonly name: import("effect/Schema").String;
676
+ readonly join: import("effect/Schema").String;
677
+ readonly expires: import("effect/Schema").Int;
678
+ readonly reach: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
679
+ readonly type: import("effect/Schema").Literal<"url">;
680
+ readonly url: import("effect/Schema").String;
681
+ }>, import("effect/Schema").Struct<{
682
+ readonly type: import("effect/Schema").Literal<"iroh">;
683
+ }>]>>;
684
+ }>;
685
+ }>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").InvalidRequestError | typeof import("../errors.js").ConflictError | typeof import("../errors.js").ForbiddenError | typeof import("../errors.js").MachineNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"machine.link", "GET", "/api/experimental/machine/link", never, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Boolean>, never, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"machine.list", "GET", "/api/experimental/machine", never, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
686
+ readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
687
+ readonly id: import("effect/Schema").String;
688
+ readonly online: import("effect/Schema").Boolean;
689
+ readonly paired: import("effect/Schema").Boolean;
690
+ readonly os: import("effect/Schema").optionalKey<import("effect/Schema").String>;
691
+ readonly arch: import("effect/Schema").optionalKey<import("effect/Schema").String>;
692
+ readonly connection: import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
693
+ readonly kind: import("effect/Schema").Literals<readonly ["websocket", "iroh"]>;
694
+ readonly path: import("effect/Schema").optionalKey<import("effect/Schema").Literals<readonly ["direct", "relayed"]>>;
695
+ readonly rtt: import("effect/Schema").optionalKey<import("effect/Schema").Number>;
696
+ }>>;
697
+ }>>;
698
+ }>>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ForbiddenError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"machine.remove", "DELETE", "/api/experimental/machine/:name", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
699
+ name: import("effect/Schema").String;
700
+ }>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/http-api/HttpApiSchema").NoContent>, import("effect/Schema").toCodecJson<typeof import("../errors.js").ForbiddenError | typeof import("../errors.js").MachineNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"media.get", "GET", "/api/experimental/media/:hash", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
632
701
  hash: import("effect/Schema").String;
633
702
  }>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Uint8Array>, import("effect/Schema").toCodecJson<typeof import("../errors.js").InvalidRequestError | typeof import("../errors.js").FileNotFoundError>, never, never> | import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"persistentPty.connect", "GET", "/api/experimental/persistent-pty/:ptyID/connect", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
634
703
  ptyID: import("effect/Schema").brand<import("effect/Schema").String, "PtyID"> & {
@@ -2,7 +2,8 @@ import { ArtifactEndpoints } from "./artifact.js";
2
2
  import { BlobGetEndpoint } from "./blob.js";
3
3
  import { AutomationEndpoints } from "./automation.js";
4
4
  import { JobEndpoints } from "./job.js";
5
+ import { MachineEndpoints } from "./machine.js";
5
6
  import { MediaGetEndpoint } from "./media.js";
6
7
  import { PersistentPtyGroup } from "./persistent-pty.js";
7
8
  /** `server.experimental`: routes under /api/experimental, without compatibility guarantees. */
8
- export const ExperimentalGroup = PersistentPtyGroup.add(MediaGetEndpoint, BlobGetEndpoint, ...AutomationEndpoints, ...ArtifactEndpoints, ...JobEndpoints);
9
+ export const ExperimentalGroup = PersistentPtyGroup.add(MediaGetEndpoint, BlobGetEndpoint, ...AutomationEndpoints, ...ArtifactEndpoints, ...JobEndpoints, ...MachineEndpoints);
@@ -1,7 +1,7 @@
1
1
  import { Generate } from "@opencode/schema/generate";
2
2
  import { Schema } from "effect";
3
3
  import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
4
- import { ForbiddenError, VideoNotFoundError, InvalidRequestError, LocationNotFoundError, ModelNotFoundError, ProviderNotFoundError, ProviderRequestError, ServiceUnavailableError, UnsupportedModelError } from "../errors.js";
4
+ import { VideoNotFoundError, InvalidRequestError, LocationNotFoundError, ModelNotFoundError, ProviderNotFoundError, ProviderRequestError, ServiceUnavailableError, UnsupportedModelError } from "../errors.js";
5
5
  export declare const GenerateGroup: HttpApiGroup.HttpApiGroup<"server.generate", HttpApiEndpoint.HttpApiEndpoint<"generate.decisions", "POST", "/api/experimental/generate/decisions", never, never, Schema.toCodecJson<Schema.Struct<{
6
6
  readonly model: Schema.Struct<{
7
7
  readonly id: Schema.brand<Schema.String, "Model.ID">;
@@ -296,7 +296,7 @@ export declare const GenerateGroup: HttpApiGroup.HttpApiGroup<"server.generate",
296
296
  };
297
297
  readonly status: Schema.Literal<"running">;
298
298
  }>;
299
- }>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError | typeof ProviderNotFoundError | typeof ForbiddenError | typeof ModelNotFoundError | typeof UnsupportedModelError | typeof ProviderRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"generate.video.get", "GET", "/api/experimental/generate/video/:id", Schema.toCodecStringTree<Schema.Struct<{
299
+ }>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError | typeof ProviderNotFoundError | typeof ModelNotFoundError | typeof UnsupportedModelError | typeof ProviderRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"generate.video.get", "GET", "/api/experimental/generate/video/:id", Schema.toCodecStringTree<Schema.Struct<{
300
300
  id: Schema.brand<Schema.String, "Generate.VideoID"> & {
301
301
  create: () => string & import("effect/Brand").Brand<"Generate.VideoID">;
302
302
  };
@@ -312,10 +312,11 @@ export declare const GenerateGroup: HttpApiGroup.HttpApiGroup<"server.generate",
312
312
  };
313
313
  readonly status: Schema.Literal<"completed">;
314
314
  readonly blobs: Schema.$Array<Schema.Struct<{
315
- readonly id: Schema.brand<Schema.String, "Blob.ID">;
315
+ readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
316
+ create: () => string & import("effect/Brand").Brand<"Blob.ID">;
317
+ };
316
318
  readonly mime: Schema.String;
317
319
  readonly bytes: Schema.Finite;
318
- readonly expiresAt: Schema.Finite;
319
320
  }>>;
320
321
  }>, Schema.Struct<{
321
322
  readonly id: Schema.brand<Schema.String, "Generate.VideoID"> & {
@@ -325,4 +326,4 @@ export declare const GenerateGroup: HttpApiGroup.HttpApiGroup<"server.generate",
325
326
  readonly error: Schema.String;
326
327
  readonly reason: Schema.Literals<readonly ["failed", "cancelled", "expired", "unknown"]>;
327
328
  }>]>;
328
- }>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof ForbiddenError | typeof VideoNotFoundError>, never, never>, false>;
329
+ }>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof VideoNotFoundError>, never, never>, false>;
@@ -2,7 +2,7 @@ import { Generate } from "@opencode/schema/generate";
2
2
  import { Model } from "@opencode/schema/model";
3
3
  import { Schema } from "effect";
4
4
  import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
5
- import { ForbiddenError, VideoNotFoundError, InvalidRequestError, LocationNotFoundError, ModelNotFoundError, ProviderNotFoundError, ProviderRequestError, ServiceUnavailableError, UnsupportedModelError, } from "../errors.js";
5
+ import { VideoNotFoundError, InvalidRequestError, LocationNotFoundError, ModelNotFoundError, ProviderNotFoundError, ProviderRequestError, ServiceUnavailableError, UnsupportedModelError, } from "../errors.js";
6
6
  const errors = [
7
7
  InvalidRequestError,
8
8
  ProviderNotFoundError,
@@ -47,20 +47,20 @@ export const GenerateGroup = HttpApiGroup.make("server.generate")
47
47
  .add(HttpApiEndpoint.post("generate.video.create", "/api/experimental/generate/video", {
48
48
  payload: Generate.VideoRequest,
49
49
  success: Schema.Struct({ data: Generate.VideoRunning }).annotate({ identifier: "GenerateVideoCreateResponse" }),
50
- error: [...errors, ForbiddenError],
50
+ error: errors,
51
51
  }).annotateMerge(OpenApi.annotations({
52
52
  identifier: "experimental.generate.video.create",
53
53
  summary: "Create a video generation",
54
- description: "Submit a video job to a video model using the server's base configuration and return its ID once the provider accepted it. The server polls the job and stores the finished video as a blob for 7 days; read the job with GET /api/experimental/generate/video/:id and the video with GET /api/experimental/blob/:id. Behind the video_generate flag. Experimental: may change without compatibility guarantees.",
54
+ description: "Submit a video job to a video model using the server's base configuration and return its ID once the provider accepted it. The server polls the job and stores the finished videos as blobs; read the job with GET /api/experimental/generate/video/:id and the video with GET /api/experimental/blob/:id. Experimental: may change without compatibility guarantees.",
55
55
  })))
56
56
  .add(HttpApiEndpoint.get("generate.video.get", "/api/experimental/generate/video/:id", {
57
57
  params: { id: Generate.VideoID },
58
58
  success: Schema.Struct({ data: Generate.VideoJob }).annotate({ identifier: "GenerateVideoGetResponse" }),
59
- error: [VideoNotFoundError, ForbiddenError, LocationNotFoundError],
59
+ error: [VideoNotFoundError, LocationNotFoundError],
60
60
  }).annotateMerge(OpenApi.annotations({
61
61
  identifier: "experimental.generate.video.get",
62
62
  summary: "Read a video generation",
63
- description: "Read a video job: running, completed with the video's blob, or error with a reason. Jobs are kept in memory, so a server restart forgets them; a finished video's blob stays readable. Behind the video_generate flag. Experimental: may change without compatibility guarantees.",
63
+ description: "Read a video job: running, completed with its videos' blobs, or error with a reason. Jobs survive a server restart, which resumes polling running ones. A job is not found 24 hours after it finished, or once none of its blobs remain. Experimental: may change without compatibility guarantees.",
64
64
  })))
65
65
  .add(HttpApiEndpoint.post("generate.decisions", "/api/experimental/generate/decisions", {
66
66
  payload: Generate.DecisionRequest,
@@ -1,11 +1,11 @@
1
1
  import { Schema } from "effect";
2
- import { HttpApiEndpoint } from "effect/http-api";
2
+ import { HttpApiEndpoint, HttpApiSchema } from "effect/http-api";
3
3
  import { InvalidRequestError, SessionNotFoundError } from "../errors.js";
4
4
  export declare const ListQuery: Schema.Struct<{
5
5
  readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
6
6
  create: () => string & import("effect/Brand").Brand<"SessionID">;
7
7
  }>;
8
- readonly kind: Schema.optional<Schema.Literals<readonly ["shell", "subagent", "image", "codemode"]>>;
8
+ readonly kind: Schema.optional<Schema.Literals<readonly ["shell", "subagent", "image", "video", "codemode"]>>;
9
9
  readonly status: Schema.optional<Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>>;
10
10
  readonly descendants: Schema.optional<Schema.decodeTo<Schema.Boolean, Schema.Literals<readonly ["true", "false"]>, never, never>>;
11
11
  }>;
@@ -15,7 +15,7 @@ export declare const JobEndpoints: readonly [HttpApiEndpoint.HttpApiEndpoint<"jo
15
15
  readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
16
16
  create: () => string & import("effect/Brand").Brand<"SessionID">;
17
17
  }>;
18
- readonly kind: Schema.optional<Schema.Literals<readonly ["shell", "subagent", "image", "codemode"]>>;
18
+ readonly kind: Schema.optional<Schema.Literals<readonly ["shell", "subagent", "image", "video", "codemode"]>>;
19
19
  readonly status: Schema.optional<Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>>;
20
20
  readonly descendants: Schema.optional<Schema.decodeTo<Schema.Boolean, Schema.Literals<readonly ["true", "false"]>, never, never>>;
21
21
  }>>, never, never, Schema.toCodecJson<Schema.Struct<{
@@ -64,6 +64,19 @@ export declare const JobEndpoints: readonly [HttpApiEndpoint.HttpApiEndpoint<"jo
64
64
  readonly kind: Schema.tag<"image">;
65
65
  readonly path: Schema.String;
66
66
  readonly model: Schema.String;
67
+ }>, Schema.Struct<{
68
+ readonly id: Schema.String;
69
+ readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
70
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
71
+ };
72
+ readonly status: Schema.Literals<readonly ["running", "completed", "error", "cancelled"]>;
73
+ readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
74
+ readonly time: Schema.Struct<{
75
+ readonly started: Schema.Finite;
76
+ readonly completed: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Finite>>, Schema.optionalKey<Schema.Finite>, never, never>;
77
+ }>;
78
+ readonly kind: Schema.tag<"video">;
79
+ readonly path: Schema.String;
67
80
  }>, Schema.Struct<{
68
81
  readonly id: Schema.String;
69
82
  readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
@@ -77,4 +90,6 @@ export declare const JobEndpoints: readonly [HttpApiEndpoint.HttpApiEndpoint<"jo
77
90
  }>;
78
91
  readonly kind: Schema.tag<"codemode">;
79
92
  }>]>>;
80
- }>>, Schema.toCodecJson<typeof InvalidRequestError | typeof SessionNotFoundError>, never, never>];
93
+ }>>, Schema.toCodecJson<typeof InvalidRequestError | typeof SessionNotFoundError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"job.cancel", "POST", "/api/experimental/job/:id/cancel", Schema.toCodecStringTree<Schema.Struct<{
94
+ id: Schema.String;
95
+ }>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never>];
@@ -1,7 +1,7 @@
1
1
  import { Job } from "@opencode/schema/job";
2
2
  import { Session } from "@opencode/schema/session";
3
3
  import { Schema, SchemaGetter } from "effect";
4
- import { HttpApiEndpoint, OpenApi } from "effect/http-api";
4
+ import { HttpApiEndpoint, HttpApiSchema, OpenApi } from "effect/http-api";
5
5
  import { InvalidRequestError, SessionNotFoundError } from "../errors.js";
6
6
  const BooleanFromString = Schema.Literals(["true", "false"]).pipe(Schema.decodeTo(Schema.Boolean, {
7
7
  decode: SchemaGetter.transform((value) => value === "true"),
@@ -33,4 +33,13 @@ export const JobEndpoints = [
33
33
  description: "List active and unconsumed background jobs, optionally filtered by owning session, descendants, or kind. Experimental: may change without compatibility guarantees.",
34
34
  transform: (operation) => ({ ...operation, tags: ["experimental"] }),
35
35
  })),
36
+ HttpApiEndpoint.post("job.cancel", "/api/experimental/job/:id/cancel", {
37
+ params: { id: Schema.String },
38
+ success: HttpApiSchema.NoContent,
39
+ }).annotateMerge(OpenApi.annotations({
40
+ identifier: "experimental.job.cancel",
41
+ summary: "Cancel background job",
42
+ description: "Cancel a running background job, interrupting the work it started. Cancelling a job that already finished does nothing. Experimental: may change without compatibility guarantees.",
43
+ transform: (operation) => ({ ...operation, tags: ["experimental"] }),
44
+ })),
36
45
  ];
@@ -0,0 +1,100 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiSchema } from "effect/http-api";
3
+ import { ConflictError, ForbiddenError, InvalidRequestError, MachineNotFoundError } from "../errors.js";
4
+ export declare const MACHINE_LINK_PATH = "/api/experimental/machine/link";
5
+ export declare const MachineInfo: Schema.Struct<{
6
+ readonly id: Schema.String;
7
+ readonly online: Schema.Boolean;
8
+ readonly paired: Schema.Boolean;
9
+ readonly os: Schema.optionalKey<Schema.String>;
10
+ readonly arch: Schema.optionalKey<Schema.String>;
11
+ readonly connection: Schema.optionalKey<Schema.Struct<{
12
+ readonly kind: Schema.Literals<readonly ["websocket", "iroh"]>;
13
+ readonly path: Schema.optionalKey<Schema.Literals<readonly ["direct", "relayed"]>>;
14
+ /** Round-trip time in milliseconds. */
15
+ readonly rtt: Schema.optionalKey<Schema.Number>;
16
+ }>>;
17
+ }>;
18
+ export type MachineInfo = typeof MachineInfo.Type;
19
+ export declare const MachineReach: Schema.Struct<{
20
+ readonly type: Schema.Literal<"url">;
21
+ readonly url: Schema.String;
22
+ }>;
23
+ export type MachineReach = typeof MachineReach.Type;
24
+ export declare const MachineAddPayload: Schema.Struct<{
25
+ readonly name: Schema.String;
26
+ readonly reach: Schema.$Array<Schema.Struct<{
27
+ readonly type: Schema.Literal<"url">;
28
+ readonly url: Schema.String;
29
+ }>>;
30
+ readonly replace: Schema.optional<Schema.Boolean>;
31
+ }>;
32
+ export type MachineAddPayload = typeof MachineAddPayload.Type;
33
+ export declare const MachineInvite: Schema.Struct<{
34
+ readonly name: Schema.String;
35
+ readonly join: Schema.String;
36
+ readonly expires: Schema.Int;
37
+ readonly reach: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
38
+ readonly type: Schema.Literal<"url">;
39
+ readonly url: Schema.String;
40
+ }>, Schema.Struct<{
41
+ readonly type: Schema.Literal<"iroh">;
42
+ }>]>>;
43
+ }>;
44
+ export type MachineInvite = typeof MachineInvite.Type;
45
+ /**
46
+ * Whether a request asks to become a WebSocket, the one request the machine link serves and the one the server lets in
47
+ * without its password: a GET with `Upgrade: websocket` and `upgrade` among its `Connection` tokens.
48
+ */
49
+ export declare function isWebSocketUpgrade(request: {
50
+ readonly method: string;
51
+ readonly headers: Readonly<Record<string, string | undefined>>;
52
+ }): boolean;
53
+ /**
54
+ * The same, for code that runs before the router has matched a route: the path is the request's own, up to its query,
55
+ * compared as it was sent. A URL parser would resolve `..` and a leading `//host` to this path, and the router would not.
56
+ */
57
+ export declare function isMachineLinkUpgrade(request: {
58
+ readonly method: string;
59
+ readonly url: string;
60
+ readonly headers: Readonly<Record<string, string | undefined>>;
61
+ }): boolean;
62
+ /** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
63
+ export declare const MachineLinkEndpoint: HttpApiEndpoint.HttpApiEndpoint<"machine.link", "GET", "/api/experimental/machine/link", never, never, never, never, Schema.toCodecJson<Schema.Boolean>, never, never, never>;
64
+ /** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
65
+ export declare const MachineEndpoints: readonly [HttpApiEndpoint.HttpApiEndpoint<"machine.link", "GET", "/api/experimental/machine/link", never, never, never, never, Schema.toCodecJson<Schema.Boolean>, never, never, never>, HttpApiEndpoint.HttpApiEndpoint<"machine.list", "GET", "/api/experimental/machine", never, never, never, never, Schema.toCodecJson<Schema.Struct<{
66
+ readonly data: Schema.$Array<Schema.Struct<{
67
+ readonly id: Schema.String;
68
+ readonly online: Schema.Boolean;
69
+ readonly paired: Schema.Boolean;
70
+ readonly os: Schema.optionalKey<Schema.String>;
71
+ readonly arch: Schema.optionalKey<Schema.String>;
72
+ readonly connection: Schema.optionalKey<Schema.Struct<{
73
+ readonly kind: Schema.Literals<readonly ["websocket", "iroh"]>;
74
+ readonly path: Schema.optionalKey<Schema.Literals<readonly ["direct", "relayed"]>>;
75
+ /** Round-trip time in milliseconds. */
76
+ readonly rtt: Schema.optionalKey<Schema.Number>;
77
+ }>>;
78
+ }>>;
79
+ }>>, Schema.toCodecJson<typeof ForbiddenError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"machine.add", "POST", "/api/experimental/machine", never, never, Schema.toCodecJson<Schema.Struct<{
80
+ readonly name: Schema.String;
81
+ readonly reach: Schema.$Array<Schema.Struct<{
82
+ readonly type: Schema.Literal<"url">;
83
+ readonly url: Schema.String;
84
+ }>>;
85
+ readonly replace: Schema.optional<Schema.Boolean>;
86
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
87
+ readonly data: Schema.Struct<{
88
+ readonly name: Schema.String;
89
+ readonly join: Schema.String;
90
+ readonly expires: Schema.Int;
91
+ readonly reach: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
92
+ readonly type: Schema.Literal<"url">;
93
+ readonly url: Schema.String;
94
+ }>, Schema.Struct<{
95
+ readonly type: Schema.Literal<"iroh">;
96
+ }>]>>;
97
+ }>;
98
+ }>>, Schema.toCodecJson<typeof InvalidRequestError | typeof ConflictError | typeof ForbiddenError | typeof MachineNotFoundError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"machine.remove", "DELETE", "/api/experimental/machine/:name", Schema.toCodecStringTree<Schema.Struct<{
99
+ name: Schema.String;
100
+ }>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof ForbiddenError | typeof MachineNotFoundError>, never, never>];
@@ -0,0 +1,82 @@
1
+ import { Schema } from "effect";
2
+ import { HttpApiEndpoint, HttpApiSchema, OpenApi } from "effect/http-api";
3
+ import { ConflictError, ForbiddenError, InvalidRequestError, MachineNotFoundError } from "../errors.js";
4
+ export const MACHINE_LINK_PATH = "/api/experimental/machine/link";
5
+ const EXPERIMENTAL = "Behind the machines flag. Experimental: may change without compatibility guarantees.";
6
+ const annotations = (identifier, summary, description) => OpenApi.annotations({
7
+ identifier: `experimental.machine.${identifier}`,
8
+ summary,
9
+ description: `${description} ${EXPERIMENTAL}`,
10
+ transform: (operation) => ({ ...operation, tags: ["experimental"] }),
11
+ });
12
+ export const MachineInfo = Schema.Struct({
13
+ id: Schema.String,
14
+ online: Schema.Boolean,
15
+ paired: Schema.Boolean,
16
+ os: Schema.optionalKey(Schema.String),
17
+ arch: Schema.optionalKey(Schema.String),
18
+ connection: Schema.optionalKey(Schema.Struct({
19
+ kind: Schema.Literals(["websocket", "iroh"]),
20
+ path: Schema.optionalKey(Schema.Literals(["direct", "relayed"])),
21
+ /** Round-trip time in milliseconds. */
22
+ rtt: Schema.optionalKey(Schema.Number),
23
+ })),
24
+ }).annotate({ identifier: "Machine.Info" });
25
+ export const MachineReach = Schema.Struct({
26
+ type: Schema.Literal("url"),
27
+ url: Schema.String,
28
+ }).annotate({ identifier: "Machine.Reach" });
29
+ export const MachineAddPayload = Schema.Struct({
30
+ name: Schema.String,
31
+ reach: Schema.Array(MachineReach),
32
+ replace: Schema.optional(Schema.Boolean),
33
+ }).annotate({ identifier: "Machine.AddPayload" });
34
+ export const MachineInvite = Schema.Struct({
35
+ name: Schema.String,
36
+ join: Schema.String,
37
+ expires: Schema.Int,
38
+ reach: Schema.Array(Schema.Union([MachineReach, Schema.Struct({ type: Schema.Literal("iroh") })])),
39
+ }).annotate({ identifier: "Machine.Invite" });
40
+ /**
41
+ * Whether a request asks to become a WebSocket, the one request the machine link serves and the one the server lets in
42
+ * without its password: a GET with `Upgrade: websocket` and `upgrade` among its `Connection` tokens.
43
+ */
44
+ export function isWebSocketUpgrade(request) {
45
+ return (request.method === "GET" &&
46
+ request.headers.upgrade?.toLowerCase() === "websocket" &&
47
+ (request.headers.connection ?? "").split(",").some((token) => token.trim().toLowerCase() === "upgrade"));
48
+ }
49
+ /**
50
+ * The same, for code that runs before the router has matched a route: the path is the request's own, up to its query,
51
+ * compared as it was sent. A URL parser would resolve `..` and a leading `//host` to this path, and the router would not.
52
+ */
53
+ export function isMachineLinkUpgrade(request) {
54
+ return request.url.split("?", 1)[0] === MACHINE_LINK_PATH && isWebSocketUpgrade(request);
55
+ }
56
+ /** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
57
+ export const MachineLinkEndpoint = HttpApiEndpoint.get("machine.link", MACHINE_LINK_PATH, {
58
+ success: Schema.Boolean,
59
+ }).annotateMerge(OpenApi.annotations({
60
+ identifier: "experimental.machine.link",
61
+ summary: "Connect a machine",
62
+ description: "Upgrade to a WebSocket that carries a machine's link to this server: binary messages only, each at most 65,535 bytes. It takes no server password. The link's own handshake, which starts with the machine's first message, is the only way in: it admits a key this server has paired or a valid join string, and closes the socket on anything else without saying why. Behind the machines flag; without it the route does not exist. Experimental: may change without compatibility guarantees.",
63
+ transform: (operation) => ({ ...operation, "x-websocket": true, tags: ["experimental"] }),
64
+ }));
65
+ /** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
66
+ export const MachineEndpoints = [
67
+ MachineLinkEndpoint,
68
+ HttpApiEndpoint.get("machine.list", "/api/experimental/machine", {
69
+ success: Schema.Struct({ data: Schema.Array(MachineInfo) }),
70
+ error: [ForbiddenError],
71
+ }).annotateMerge(annotations("list", "List machines", "List known machines and whether each is paired and online.")),
72
+ HttpApiEndpoint.post("machine.add", "/api/experimental/machine", {
73
+ payload: MachineAddPayload,
74
+ success: Schema.Struct({ data: MachineInvite }),
75
+ error: [InvalidRequestError, ForbiddenError, MachineNotFoundError, ConflictError],
76
+ }).annotateMerge(annotations("add", "Add or invite a machine", "Add a machine by name if it does not exist, then create a single-use join string carrying the given reach addresses.")),
77
+ HttpApiEndpoint.delete("machine.remove", "/api/experimental/machine/:name", {
78
+ params: { name: Schema.String },
79
+ success: HttpApiSchema.NoContent,
80
+ error: [ForbiddenError, MachineNotFoundError],
81
+ }).annotateMerge(annotations("remove", "Remove a machine", "Forget a machine by name, closing any live link and revoking its key.")),
82
+ ];
@@ -117,7 +117,7 @@ export const makeSessionGroup = (sessionLocationMiddleware, formLocationMiddlewa
117
117
  payload: Schema.Struct({
118
118
  id: Session.ID.pipe(Schema.optional),
119
119
  parentID: Session.ID.pipe(Schema.optional).annotate({
120
- description: "Set parentID to create a subagent session at the parent's location; set agent to choose its agent (otherwise it uses the default) and start it with session.prompt. After each completed round, the child sends a `<subagent>` report to the parent's inbox and wakes the parent unless it has a staged revert.",
120
+ description: "Set parentID to create a subagent session at the parent's location; set agent to choose its agent (otherwise it uses the default) and start it with session.prompt. After each completed round, the child sends a `<background-result kind=\"subagent\">` report to the parent's inbox and wakes the parent unless it has a staged revert.",
121
121
  }),
122
122
  title: Schema.String.pipe(Schema.optional),
123
123
  agent: Agent.ID.pipe(Schema.optional),
@@ -4,6 +4,8 @@ import { InvalidRequestError, LocationNotFoundError, ServiceUnavailableError } f
4
4
  export declare const VoiceTransportType: Schema.Literals<readonly ["webrtc", "websocket"]>;
5
5
  export declare const VoiceModel: Schema.Struct<{
6
6
  readonly model: Schema.String;
7
+ readonly name: Schema.String;
8
+ readonly engine: Schema.String;
7
9
  readonly provider: Schema.String;
8
10
  readonly transports: Schema.$Array<Schema.Literals<readonly ["webrtc", "websocket"]>>;
9
11
  readonly available: Schema.Boolean;
@@ -46,6 +48,8 @@ export declare const VoiceGroup: HttpApiGroup.HttpApiGroup<"server.voice", HttpA
46
48
  readonly data: Schema.Struct<{
47
49
  readonly models: Schema.$Array<Schema.Struct<{
48
50
  readonly model: Schema.String;
51
+ readonly name: Schema.String;
52
+ readonly engine: Schema.String;
49
53
  readonly provider: Schema.String;
50
54
  readonly transports: Schema.$Array<Schema.Literals<readonly ["webrtc", "websocket"]>>;
51
55
  readonly available: Schema.Boolean;
@@ -6,6 +6,8 @@ export const VoiceTransportType = Schema.Literals(["webrtc", "websocket"]).annot
6
6
  });
7
7
  export const VoiceModel = Schema.Struct({
8
8
  model: Schema.String,
9
+ name: Schema.String,
10
+ engine: Schema.String,
9
11
  provider: Schema.String,
10
12
  transports: Schema.Array(VoiceTransportType),
11
13
  available: Schema.Boolean,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/protocol",
4
- "version": "2.3.1",
4
+ "version": "2.4.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "typecheck:tsc": "tsc --noEmit"
36
36
  },
37
37
  "dependencies": {
38
- "@opencode/schema": "2.3.1",
38
+ "@opencode/schema": "2.4.0",
39
39
  "effect": "4.1.0"
40
40
  },
41
41
  "devDependencies": {