GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: generate · ildella/opencode@8cc2276

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • core/src
      • pty.ts
    • opencode/test/server
      • httpapi-v2-pty.test.ts
    • sdk
      • js/src/v2/gen
        • sdk.gen.ts
        • types.gen.ts
      • openapi.json
    • server/src/handlers
      • pty.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/core/src/pty.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/pty.ts
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,7 @@ export const layer = Layer.effect(
278278
const update = Effect.fn("Pty.update")(function* (id: PtyID, input: UpdateInput) {
279279
const session = yield* requireSession(id)
280280
if (input.title) session.info.title = input.title
281-
if (input.size && session.info.status === "running")
282-
session.process.resize(input.size.cols, input.size.rows)
281+
if (input.size && session.info.status === "running") session.process.resize(input.size.cols, input.size.rows)
283282
yield* events.publish(Event.Updated, { info: session.info })
284283
return session.info
285284
})
Collapse file

‎packages/opencode/test/server/httpapi-v2-pty.test.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/test/server/httpapi-v2-pty.test.ts
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ describe("v2 pty HttpApi", () => {
164164
expect(yield* takeUntil("ping-v2")).toContain("ping-v2")
165165
yield* write(new Socket.CloseEvent(1000, "done")).pipe(Effect.catch(() => Effect.void))
166166

167-
const removed = yield* HttpClientRequest.delete(`/api/pty/${info.id}`).pipe(directoryHeader(dir), HttpClient.execute)
167+
const removed = yield* HttpClientRequest.delete(`/api/pty/${info.id}`).pipe(
168+
directoryHeader(dir),
169+
HttpClient.execute,
170+
)
168171
expect(removed.status).toBe(204)
169172
}),
170173
)
Collapse file

‎packages/sdk/js/src/v2/gen/sdk.gen.ts‎

Copy file name to clipboardExpand all lines: packages/sdk/js/src/v2/gen/sdk.gen.ts
+271Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,20 @@ import type {
309309
V2ProviderGetResponses,
310310
V2ProviderListErrors,
311311
V2ProviderListResponses,
312+
V2PtyConnectErrors,
313+
V2PtyConnectResponses,
314+
V2PtyConnectTokenErrors,
315+
V2PtyConnectTokenResponses,
316+
V2PtyCreateErrors,
317+
V2PtyCreateResponses,
318+
V2PtyGetErrors,
319+
V2PtyGetResponses,
320+
V2PtyListErrors,
321+
V2PtyListResponses,
322+
V2PtyRemoveErrors,
323+
V2PtyRemoveResponses,
324+
V2PtyUpdateErrors,
325+
V2PtyUpdateResponses,
312326
V2QuestionRequestListErrors,
313327
V2QuestionRequestListResponses,
314328
V2ReferenceListErrors,
@@ -6101,6 +6115,258 @@ export class Event2 extends HeyApiClient {
61016115
}
61026116
}
61036117

6118+
export class Pty2 extends HeyApiClient {
6119+
/**
6120+
* List PTY sessions
6121+
*
6122+
* List PTY sessions for a location, including exited sessions retained until removal.
6123+
*/
6124+
public list<ThrowOnError extends boolean = false>(
6125+
parameters?: {
6126+
location?: {
6127+
directory?: string
6128+
workspace?: string
6129+
}
6130+
},
6131+
options?: Options<never, ThrowOnError>,
6132+
) {
6133+
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }])
6134+
return (options?.client ?? this.client).get<V2PtyListResponses, V2PtyListErrors, ThrowOnError>({
6135+
url: "/api/pty",
6136+
...options,
6137+
...params,
6138+
})
6139+
}
6140+
6141+
/**
6142+
* Create PTY session
6143+
*
6144+
* Create a pseudo-terminal session for a location.
6145+
*/
6146+
public create<ThrowOnError extends boolean = false>(
6147+
parameters?: {
6148+
location?: {
6149+
directory?: string
6150+
workspace?: string
6151+
}
6152+
command?: string
6153+
args?: Array<string>
6154+
cwd?: string
6155+
title?: string
6156+
env?: {
6157+
[key: string]: string
6158+
}
6159+
},
6160+
options?: Options<never, ThrowOnError>,
6161+
) {
6162+
const params = buildClientParams(
6163+
[parameters],
6164+
[
6165+
{
6166+
args: [
6167+
{ in: "query", key: "location" },
6168+
{ in: "body", key: "command" },
6169+
{ in: "body", key: "args" },
6170+
{ in: "body", key: "cwd" },
6171+
{ in: "body", key: "title" },
6172+
{ in: "body", key: "env" },
6173+
],
6174+
},
6175+
],
6176+
)
6177+
return (options?.client ?? this.client).post<V2PtyCreateResponses, V2PtyCreateErrors, ThrowOnError>({
6178+
url: "/api/pty",
6179+
...options,
6180+
...params,
6181+
headers: {
6182+
"Content-Type": "application/json",
6183+
...options?.headers,
6184+
...params.headers,
6185+
},
6186+
})
6187+
}
6188+
6189+
/**
6190+
* Remove PTY session
6191+
*
6192+
* Terminate and remove one PTY session.
6193+
*/
6194+
public remove<ThrowOnError extends boolean = false>(
6195+
parameters: {
6196+
ptyID: string
6197+
location?: {
6198+
directory?: string
6199+
workspace?: string
6200+
}
6201+
},
6202+
options?: Options<never, ThrowOnError>,
6203+
) {
6204+
const params = buildClientParams(
6205+
[parameters],
6206+
[
6207+
{
6208+
args: [
6209+
{ in: "path", key: "ptyID" },
6210+
{ in: "query", key: "location" },
6211+
],
6212+
},
6213+
],
6214+
)
6215+
return (options?.client ?? this.client).delete<V2PtyRemoveResponses, V2PtyRemoveErrors, ThrowOnError>({
6216+
url: "/api/pty/{ptyID}",
6217+
...options,
6218+
...params,
6219+
})
6220+
}
6221+
6222+
/**
6223+
* Get PTY session
6224+
*
6225+
* Get one PTY session, including its exit code once exited.
6226+
*/
6227+
public get<ThrowOnError extends boolean = false>(
6228+
parameters: {
6229+
ptyID: string
6230+
location?: {
6231+
directory?: string
6232+
workspace?: string
6233+
}
6234+
},
6235+
options?: Options<never, ThrowOnError>,
6236+
) {
6237+
const params = buildClientParams(
6238+
[parameters],
6239+
[
6240+
{
6241+
args: [
6242+
{ in: "path", key: "ptyID" },
6243+
{ in: "query", key: "location" },
6244+
],
6245+
},
6246+
],
6247+
)
6248+
return (options?.client ?? this.client).get<V2PtyGetResponses, V2PtyGetErrors, ThrowOnError>({
6249+
url: "/api/pty/{ptyID}",
6250+
...options,
6251+
...params,
6252+
})
6253+
}
6254+
6255+
/**
6256+
* Update PTY session
6257+
*
6258+
* Update the title or viewport size of one PTY session.
6259+
*/
6260+
public update<ThrowOnError extends boolean = false>(
6261+
parameters: {
6262+
ptyID: string
6263+
location?: {
6264+
directory?: string
6265+
workspace?: string
6266+
}
6267+
title?: string
6268+
size?: {
6269+
rows: number
6270+
cols: number
6271+
}
6272+
},
6273+
options?: Options<never, ThrowOnError>,
6274+
) {
6275+
const params = buildClientParams(
6276+
[parameters],
6277+
[
6278+
{
6279+
args: [
6280+
{ in: "path", key: "ptyID" },
6281+
{ in: "query", key: "location" },
6282+
{ in: "body", key: "title" },
6283+
{ in: "body", key: "size" },
6284+
],
6285+
},
6286+
],
6287+
)
6288+
return (options?.client ?? this.client).put<V2PtyUpdateResponses, V2PtyUpdateErrors, ThrowOnError>({
6289+
url: "/api/pty/{ptyID}",
6290+
...options,
6291+
...params,
6292+
headers: {
6293+
"Content-Type": "application/json",
6294+
...options?.headers,
6295+
...params.headers,
6296+
},
6297+
})
6298+
}
6299+
6300+
/**
6301+
* Create PTY WebSocket token
6302+
*
6303+
* Create a short-lived single-use ticket for opening a PTY WebSocket connection.
6304+
*/
6305+
public connectToken<ThrowOnError extends boolean = false>(
6306+
parameters: {
6307+
ptyID: string
6308+
location?: {
6309+
directory?: string
6310+
workspace?: string
6311+
}
6312+
},
6313+
options?: Options<never, ThrowOnError>,
6314+
) {
6315+
const params = buildClientParams(
6316+
[parameters],
6317+
[
6318+
{
6319+
args: [
6320+
{ in: "path", key: "ptyID" },
6321+
{ in: "query", key: "location" },
6322+
],
6323+
},
6324+
],
6325+
)
6326+
return (options?.client ?? this.client).post<V2PtyConnectTokenResponses, V2PtyConnectTokenErrors, ThrowOnError>({
6327+
url: "/api/pty/{ptyID}/connect-token",
6328+
...options,
6329+
...params,
6330+
})
6331+
}
6332+
6333+
/**
6334+
* Connect to PTY session
6335+
*
6336+
* Establish a WebSocket connection streaming PTY output and accepting terminal input.
6337+
*/
6338+
public connect<ThrowOnError extends boolean = false>(
6339+
parameters: {
6340+
ptyID: string
6341+
"location[directory]"?: string
6342+
"location[workspace]"?: string
6343+
cursor?: string
6344+
ticket?: string
6345+
},
6346+
options?: Options<never, ThrowOnError>,
6347+
) {
6348+
const params = buildClientParams(
6349+
[parameters],
6350+
[
6351+
{
6352+
args: [
6353+
{ in: "path", key: "ptyID" },
6354+
{ in: "query", key: "location[directory]" },
6355+
{ in: "query", key: "location[workspace]" },
6356+
{ in: "query", key: "cursor" },
6357+
{ in: "query", key: "ticket" },
6358+
],
6359+
},
6360+
],
6361+
)
6362+
return (options?.client ?? this.client).get<V2PtyConnectResponses, V2PtyConnectErrors, ThrowOnError>({
6363+
url: "/api/pty/{ptyID}/connect",
6364+
...options,
6365+
...params,
6366+
})
6367+
}
6368+
}
6369+
61046370
export class Request2 extends HeyApiClient {
61056371
/**
61066372
* List pending question requests
@@ -6342,6 +6608,11 @@ export class V2 extends HeyApiClient {
63426608
return (this._event ??= new Event2({ client: this.client }))
63436609
}
63446610

6611+
private _pty?: Pty2
6612+
get pty(): Pty2 {
6613+
return (this._pty ??= new Pty2({ client: this.client }))
6614+
}
6615+
63456616
private _question?: Question3
63466617
get question(): Question3 {
63476618
return (this._question ??= new Question3({ client: this.client }))

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.