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 — opencode-mobile/api/opencode-shells.openapi.yaml at main · opencode-mobile/opencode-mobile

Expand file tree

/

opencode-shells.openapi.yaml

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
215 lines (213 loc) · 6.19 KB
/

opencode-shells.openapi.yaml

Copy path

File metadata and controls

215 lines (213 loc) · 6.19 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
openapi: 3.1.0
info:
title: opencode shells (v2, mobile subset)
version: 1.0.0
description: |
Agent-run shell commands on v2 servers (`/api/shell`), as the background work
pill reads them. v1 servers have no shell routes: the app derives running
shells from `bash` tool parts there.
Every agent `shell` tool call, foreground or background, creates one shell
with `metadata.sessionID` set to the calling session. Routes are scoped by
`location[directory]`; responses are `{location, data}` envelopes.
There is no output event. Poll `GET /api/shell/{id}/output` with the cursor
while output is on screen.
servers:
- url: http://127.0.0.1:4096
paths:
/api/shell:
get:
operationId: listShells
summary: List running shell commands for a location (exited ones are not included)
parameters:
- $ref: "#/components/parameters/LocationDirectory"
responses:
"200":
description: Running shells
content:
application/json:
schema:
type: object
properties:
location:
$ref: "#/components/schemas/Location"
data:
type: array
items:
$ref: "#/components/schemas/ShellInfo"
required: [data]
/api/shell/{id}:
get:
operationId: getShell
parameters:
- $ref: "#/components/parameters/ShellId"
- $ref: "#/components/parameters/LocationDirectory"
responses:
"200":
description: One shell, including its exit code once exited
content:
application/json:
schema:
type: object
properties:
location:
$ref: "#/components/schemas/Location"
data:
$ref: "#/components/schemas/ShellInfo"
required: [data]
"404":
description: Shell not found (removed)
delete:
operationId: removeShell
summary: Kill and remove one shell and its output
description: Publishes `shell.exited` with status `killed`, then `shell.deleted`. Unknown ids also answer 204.
parameters:
- $ref: "#/components/parameters/ShellId"
- $ref: "#/components/parameters/LocationDirectory"
responses:
"204":
description: Removed
/api/shell/{id}/output:
get:
operationId: readShellOutput
summary: Page through combined stdout and stderr by absolute byte cursor
description: |
Without `limit` a page holds at most 64 KiB from `cursor` (default 0).
A cursor at or past the end answers an empty page whose `cursor` and
`size` are the current total. Output stays readable after the shell
exits, until it is removed.
parameters:
- $ref: "#/components/parameters/ShellId"
- $ref: "#/components/parameters/LocationDirectory"
- name: cursor
in: query
schema:
type: integer
minimum: 0
- name: limit
in: query
schema:
type: integer
minimum: 1
responses:
"200":
description: One page of output
content:
application/json:
schema:
type: object
properties:
location:
$ref: "#/components/schemas/Location"
data:
$ref: "#/components/schemas/ShellOutput"
required: [data]
"404":
description: Shell not found (removed)
components:
parameters:
ShellId:
name: id
in: path
required: true
schema:
type: string
pattern: "^sh_"
LocationDirectory:
name: location[directory]
in: query
required: false
schema:
type: string
schemas:
Location:
type: object
properties:
directory:
type: string
ShellStatus:
type: string
enum: [running, exited, timeout, killed]
ShellInfo:
type: object
properties:
id:
type: string
status:
$ref: "#/components/schemas/ShellStatus"
command:
type: string
cwd:
type: string
shell:
type: string
file:
type: string
pid:
type: integer
exit:
type: number
signal:
type: string
metadata:
type: object
description: Caller tags. The shell tool sets `sessionID` to the calling session.
additionalProperties: true
time:
type: object
properties:
started:
type: number
description: Milliseconds since the Unix epoch
completed:
type: number
required: [started]
required: [id, status, command, cwd, shell, file, metadata, time]
ShellOutput:
type: object
properties:
output:
type: string
cursor:
type: integer
description: Absolute byte cursor after this page; equals size once caught up
size:
type: integer
description: Total bytes captured so far
truncated:
type: boolean
required: [output, cursor, size, truncated]
# Events on GET /api/event (data line: {id, created, type, location, data}).
ShellCreatedEvent:
type: object
properties:
type:
const: shell.created
data:
type: object
properties:
info:
$ref: "#/components/schemas/ShellInfo"
ShellExitedEvent:
type: object
properties:
type:
const: shell.exited
data:
type: object
properties:
id:
type: string
exit:
type: number
status:
$ref: "#/components/schemas/ShellStatus"
ShellDeletedEvent:
type: object
properties:
type:
const: shell.deleted
data:
type: object
properties:
id:
type: string
You are visitor 01402775 — 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.