@opencode-ai/protocol 0.0.0-dev-18560 → 0.0.0-dev-18562

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.
@@ -4,7 +4,33 @@ import { ForbiddenError, InvalidRequestError, PtyNotFoundError, ServiceUnavailab
4
4
  import { PTY_CONNECT_TICKET_QUERY, PTY_CONNECT_TOKEN_HEADER, PTY_CONNECT_TOKEN_HEADER_VALUE } from "./pty.js";
5
5
  export { PTY_CONNECT_TICKET_QUERY, PTY_CONNECT_TOKEN_HEADER, PTY_CONNECT_TOKEN_HEADER_VALUE };
6
6
  export declare function hasPersistentPtyConnectTicketURL(url: URL): boolean;
7
- export declare const PersistentPtyGroup: HttpApiGroup.HttpApiGroup<"server.experimental", HttpApiEndpoint.HttpApiEndpoint<"persistentPty.list", "GET", "/api/experimental/session/:sessionID/terminal", Schema.toCodecStringTree<Schema.Struct<{
7
+ export declare const PersistentPtyGroup: HttpApiGroup.HttpApiGroup<"server.experimental", HttpApiEndpoint.HttpApiEndpoint<"persistentPty.read", "GET", "/api/experimental/session/:sessionID/terminal/read", Schema.toCodecStringTree<Schema.Struct<{
8
+ sessionID: Schema.brand<Schema.String, "SessionID"> & {
9
+ create: () => string & import("effect/Brand").Brand<"SessionID">;
10
+ descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
11
+ };
12
+ }>>, Schema.toCodecStringTree<Schema.Struct<{
13
+ lines: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
14
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
15
+ readonly data: Schema.NullOr<Schema.Struct<{
16
+ readonly ptyID: Schema.brand<Schema.String, "PtyID"> & {
17
+ create: () => string & import("effect/Brand").Brand<"PtyID">;
18
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"PtyID">;
19
+ };
20
+ readonly title: Schema.String;
21
+ readonly cwd: Schema.String;
22
+ readonly foregroundProcess: Schema.NullOr<Schema.String>;
23
+ readonly screen: Schema.Struct<{
24
+ readonly text: Schema.String;
25
+ readonly cols: Schema.Int;
26
+ readonly rows: Schema.Int;
27
+ readonly cursor: Schema.Struct<{
28
+ readonly x: Schema.Int;
29
+ readonly y: Schema.Int;
30
+ }>;
31
+ }>;
32
+ }>>;
33
+ }>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"persistentPty.list", "GET", "/api/experimental/session/:sessionID/terminal", Schema.toCodecStringTree<Schema.Struct<{
8
34
  sessionID: Schema.brand<Schema.String, "SessionID"> & {
9
35
  create: () => string & import("effect/Brand").Brand<"SessionID">;
10
36
  descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
@@ -14,6 +14,17 @@ export function hasPersistentPtyConnectTicketURL(url) {
14
14
  const errors = [InvalidRequestError, ServiceUnavailableError];
15
15
  const terminalErrors = [PtyNotFoundError, ServiceUnavailableError];
16
16
  export const PersistentPtyGroup = HttpApiGroup.make("server.experimental")
17
+ .add(HttpApiEndpoint.get("persistentPty.read", "/api/experimental/session/:sessionID/terminal/read", {
18
+ params: { sessionID: Session.ID },
19
+ query: {
20
+ lines: Schema.NumberFromString.pipe(Schema.decodeTo(PersistentPty.ReadLines), Schema.optional),
21
+ },
22
+ success: Schema.Struct({ data: Schema.NullOr(PersistentPty.ReadResult) }),
23
+ error: [ServiceUnavailableError],
24
+ }).annotateMerge(OpenApi.annotations({
25
+ summary: "Read the session's most recently controlled terminal",
26
+ description: "Read the last physical rows without changing selection or taking control. Omitted lines uses the live terminal height; larger counts include retained history. Blank rows are preserved. Screen dimensions and cursor remain relative to the live screen. Returns null when no current terminal exists. Selection is server-local and resets on restart. Experimental: may change without compatibility guarantees.",
27
+ })))
17
28
  .add(HttpApiEndpoint.get("persistentPty.list", "/api/experimental/session/:sessionID/terminal", {
18
29
  params: { sessionID: Session.ID },
19
30
  success: Schema.Struct({ data: Schema.Array(PersistentPty.Info) }),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/protocol",
4
- "version": "0.0.0-dev-18560",
4
+ "version": "0.0.0-dev-18562",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "typecheck": "tsgo --noEmit"
33
33
  },
34
34
  "dependencies": {
35
- "@opencode-ai/schema": "0.0.0-dev-18560",
35
+ "@opencode-ai/schema": "0.0.0-dev-18562",
36
36
  "effect": "4.0.0-rc.112"
37
37
  },
38
38
  "devDependencies": {