@nylorun/runtime 0.16.0-beta → 0.19.0-beta
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/CHANGELOG.md +207 -0
- package/README.md +105 -63
- package/dist/adapters/execution/restate.d.ts +1 -3
- package/dist/adapters/execution/restate.js +4 -31
- package/dist/adapters/replication/pgoutput.js +1 -1
- package/dist/adapters/sandbox/local.js +1 -1
- package/dist/adapters/sandbox/virtual.js +1 -1
- package/dist/api/ag-ui/endpoint.js +1 -2
- package/dist/api/ag-ui/routes.d.ts +1 -1
- package/dist/api/ag-ui/routes.js +11 -13
- package/dist/api/ag-ui/translate.d.ts +1 -3
- package/dist/api/ag-ui/translate.js +2 -17
- package/dist/api/components.d.ts +4783 -2588
- package/dist/api/components.js +19 -21
- package/dist/api/gate/routes.d.ts +7 -8
- package/dist/api/gate/routes.js +58 -52
- package/dist/api/http/app.d.ts +6 -0
- package/dist/api/http/app.js +20 -14
- package/dist/api/http/define.d.ts +22 -13
- package/dist/api/http/define.js +43 -39
- package/dist/api/http/routes/access.d.ts +3 -19
- package/dist/api/http/routes/access.js +25 -184
- package/dist/api/http/routes/artifacts.js +3 -7
- package/dist/api/http/routes/files.d.ts +8 -0
- package/dist/api/http/routes/files.js +77 -0
- package/dist/api/http/routes/keys.d.ts +10 -0
- package/dist/api/http/routes/keys.js +64 -0
- package/dist/api/http/routes/me.d.ts +13 -0
- package/dist/api/http/routes/me.js +48 -0
- package/dist/api/http/routes/reads.d.ts +66 -0
- package/dist/api/http/routes/reads.js +127 -0
- package/dist/api/http/routes/sandboxes.d.ts +2 -2
- package/dist/api/http/routes/sandboxes.js +8 -7
- package/dist/api/http/routes/sessions.js +31 -20
- package/dist/api/http/routes/tenant.js +15 -18
- package/dist/api/http/routes/vaults.d.ts +13 -3
- package/dist/api/http/routes/vaults.js +136 -64
- package/dist/api/openapi.d.ts +10 -11
- package/dist/api/openapi.js +292 -68
- package/dist/artifacts/links.js +6 -6
- package/dist/artifacts/service.js +1 -1
- package/dist/core/flow-host.d.ts +44 -23
- package/dist/core/flow-host.js +88 -106
- package/dist/core/provider.d.ts +4 -1
- package/dist/core/provider.js +6 -1
- package/dist/core/sandbox-routes.d.ts +0 -9
- package/dist/core/sandbox-routes.js +2 -21
- package/dist/execution/memory.d.ts +4 -5
- package/dist/execution/memory.js +11 -25
- package/dist/execution/types.d.ts +3 -33
- package/dist/execution/types.js +2 -12
- package/dist/gates/http-tool.d.ts +86 -0
- package/dist/gates/http-tool.js +197 -0
- package/dist/gates/mcp-handler.d.ts +3 -0
- package/dist/gates/mcp-handler.js +6 -4
- package/dist/gates/meter.d.ts +2 -2
- package/dist/gates/meter.js +6 -0
- package/dist/gates/tenant-vaults.d.ts +19 -14
- package/dist/gates/tenant-vaults.js +17 -12
- package/dist/gates/tool-calls.d.ts +7 -15
- package/dist/gates/tool-calls.js +4 -4
- package/dist/gates/tool-client.d.ts +1 -1
- package/dist/gates/tool-client.js +23 -47
- package/dist/gates/tool-contract.d.ts +27 -39
- package/dist/gates/tool-contract.js +30 -21
- package/dist/gates/tool-gate.d.ts +25 -24
- package/dist/gates/tool-gate.js +11 -7
- package/dist/harness/calls.d.ts +10 -4
- package/dist/harness/calls.js +15 -6
- package/dist/harness/executors.d.ts +1 -1
- package/dist/harness/executors.js +17 -12
- package/dist/harness/main.d.ts +2 -2
- package/dist/harness/main.js +5 -13
- package/dist/harness/service.d.ts +4 -5
- package/dist/harness/service.js +9 -2
- package/dist/harness-api/in-process.js +2 -2
- package/dist/harness-api/record.d.ts +6 -3
- package/dist/harness-api/record.js +65 -72
- package/dist/harness-api/server.d.ts +1 -9
- package/dist/harness-api/server.js +19 -17
- package/dist/harness-api/start.js +1 -5
- package/dist/harness-api/workspace.js +2 -3
- package/dist/harness-api/ws-server.js +1 -1
- package/dist/host/app.d.ts +2 -10
- package/dist/host/app.js +24 -44
- package/dist/host/config-for.d.ts +5 -5
- package/dist/host/config-for.js +2 -3
- package/dist/host/config.d.ts +0 -11
- package/dist/host/create-host.d.ts +3 -40
- package/dist/host/create-host.js +18 -91
- package/dist/host/environment.d.ts +0 -3
- package/dist/host/environment.js +0 -9
- package/dist/host/gates.d.ts +4 -1
- package/dist/host/gates.js +9 -3
- package/dist/host/http.d.ts +1 -2
- package/dist/host/http.js +1 -7
- package/dist/host/index.d.ts +2 -2
- package/dist/host/index.js +2 -2
- package/dist/host/main.js +55 -40
- package/dist/host/operate.d.ts +29 -0
- package/dist/host/operate.js +223 -0
- package/dist/host/stack-config.d.ts +23 -20
- package/dist/host/stack-config.js +28 -44
- package/dist/index.d.ts +4 -1
- package/dist/index.js +3 -1
- package/dist/infra/workers.d.ts +1 -1
- package/dist/keys/client.js +9 -1
- package/dist/keys/keys.d.ts +12 -2
- package/dist/keys/keys.js +10 -2
- package/dist/management-openapi.json +6491 -0
- package/dist/mcp/connect.d.ts +8 -4
- package/dist/mcp/connect.js +8 -27
- package/dist/mcp/pool.d.ts +6 -9
- package/dist/mcp/pool.js +8 -18
- package/dist/mcp/snapshot.d.ts +8 -2
- package/dist/mcp/snapshot.js +29 -2
- package/dist/media.d.ts +1 -1
- package/dist/media.js +1 -1
- package/dist/model/pi-model.js +3 -0
- package/dist/openapi.json +6228 -15615
- package/dist/reads/access.d.ts +4 -0
- package/dist/reads/access.js +12 -0
- package/dist/reads/cursor.d.ts +11 -0
- package/dist/reads/cursor.js +80 -0
- package/dist/reads/types.d.ts +25 -0
- package/dist/reads/types.js +1 -0
- package/dist/sandbox/manager.d.ts +16 -0
- package/dist/sandbox/manager.js +40 -0
- package/dist/sandbox/session-sandbox.js +13 -3
- package/dist/sandbox/skills.d.ts +13 -0
- package/dist/sandbox/skills.js +46 -0
- package/dist/sandbox/types.d.ts +2 -2
- package/dist/store/ownership.d.ts +9 -0
- package/dist/store/ownership.js +13 -0
- package/dist/store/postgres/connect.d.ts +2 -0
- package/dist/store/postgres/connect.js +29 -0
- package/dist/store/postgres/drizzle/0008_installation_vaults.sql +2 -0
- package/dist/store/postgres/drizzle/0009_oauth_pending.sql +19 -0
- package/dist/store/postgres/drizzle/0010_oss_auth_removals.sql +3 -0
- package/dist/store/postgres/drizzle/0011_key_roles.sql +3 -0
- package/dist/store/postgres/drizzle/0012_session_reads.sql +8 -0
- package/dist/store/postgres/drizzle/0013_definition_files.sql +16 -0
- package/dist/store/postgres/drizzle/0014_action_endpoints_removed.sql +2 -0
- package/dist/store/postgres/drizzle/meta/_journal.json +49 -0
- package/dist/store/postgres/reads.d.ts +3 -0
- package/dist/store/postgres/reads.js +272 -0
- package/dist/store/postgres/schema.d.ts +423 -594
- package/dist/store/postgres/schema.js +84 -101
- package/dist/store/postgres/store.js +96 -248
- package/dist/store/postgres/tenant.d.ts +34 -2
- package/dist/store/postgres/tenant.js +16 -32
- package/dist/store/types.d.ts +44 -119
- package/dist/store/types.js +0 -1
- package/dist/streams/control.d.ts +0 -7
- package/dist/streams/control.js +0 -13
- package/dist/streams/types.d.ts +2 -20
- package/dist/streams/types.js +1 -1
- package/dist/tenant/advance.d.ts +3 -3
- package/dist/tenant/advance.js +10 -7
- package/dist/tenant/auth.d.ts +24 -15
- package/dist/tenant/auth.js +44 -55
- package/dist/tenant/cause.d.ts +3 -3
- package/dist/tenant/cause.js +1 -1
- package/dist/tenant/commands.d.ts +2 -18
- package/dist/tenant/commands.js +38 -179
- package/dist/tenant/context.d.ts +33 -45
- package/dist/tenant/definition-files.d.ts +24 -0
- package/dist/tenant/definition-files.js +103 -0
- package/dist/tenant/effects.d.ts +20 -18
- package/dist/tenant/effects.js +59 -133
- package/dist/tenant/ephemeral.d.ts +21 -8
- package/dist/tenant/ephemeral.js +11 -12
- package/dist/tenant/host-token.js +5 -5
- package/dist/tenant/identity-file.d.ts +75 -0
- package/dist/tenant/identity-file.js +202 -0
- package/dist/tenant/issuers.d.ts +48 -0
- package/dist/tenant/issuers.js +311 -0
- package/dist/tenant/jwt.js +3 -3
- package/dist/tenant/module.d.ts +1 -4
- package/dist/tenant/module.js +3 -12
- package/dist/tenant/operator-keys.d.ts +44 -0
- package/dist/tenant/operator-keys.js +87 -0
- package/dist/tenant/outbound.d.ts +40 -1
- package/dist/tenant/outbound.js +167 -18
- package/dist/tenant/paths.d.ts +1 -1
- package/dist/tenant/paths.js +1 -3
- package/dist/tenant/principals.d.ts +13 -13
- package/dist/tenant/principals.js +35 -36
- package/dist/tenant/run-token.js +6 -6
- package/dist/tenant/runtime.d.ts +5 -3
- package/dist/tenant/runtime.js +29 -15
- package/dist/tenant/sandboxes.d.ts +9 -6
- package/dist/tenant/sandboxes.js +16 -5
- package/dist/tenant/scheduler.d.ts +1 -5
- package/dist/tenant/scheduler.js +2 -5
- package/dist/tenant/session-streams.d.ts +8 -11
- package/dist/tenant/session-streams.js +48 -32
- package/dist/tenant/session.d.ts +8 -41
- package/dist/tenant/session.js +0 -37
- package/dist/tenant/sessions.d.ts +2 -2
- package/dist/tenant/sessions.js +17 -9
- package/dist/tenant/signing-keys.d.ts +3 -2
- package/dist/tenant/signing-keys.js +5 -5
- package/dist/tenant/skill-tool.d.ts +20 -0
- package/dist/tenant/skill-tool.js +72 -0
- package/dist/tenant/slim.d.ts +1 -1
- package/dist/tenant/slim.js +1 -1
- package/dist/tenant/status.js +7 -12
- package/dist/tenant/store-pg.d.ts +15 -0
- package/dist/tenant/store-pg.js +7 -3
- package/dist/tenant/streams.d.ts +3 -11
- package/dist/tenant/streams.js +2 -29
- package/dist/tenant/sweep.js +0 -5
- package/dist/tenant/transcript.d.ts +2 -2
- package/dist/tenant/transcript.js +2 -2
- package/dist/tenant/types.d.ts +33 -19
- package/dist/tenant/worker.d.ts +1 -3
- package/dist/tenant/worker.js +3 -8
- package/dist/vault/crypto.d.ts +7 -0
- package/dist/vault/crypto.js +16 -0
- package/dist/vault/oauth.d.ts +55 -0
- package/dist/vault/oauth.js +186 -0
- package/dist/vault/service.d.ts +54 -7
- package/dist/vault/service.js +261 -17
- package/dist/vault/sources.d.ts +60 -0
- package/dist/vault/sources.js +196 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -4
- package/dist/admin-openapi.json +0 -604
- package/dist/api/http/routes/actions.d.ts +0 -8
- package/dist/api/http/routes/actions.js +0 -76
- package/dist/api/http/routes/endpoints.d.ts +0 -7
- package/dist/api/http/routes/endpoints.js +0 -100
- package/dist/host/admin-api.d.ts +0 -23
- package/dist/host/admin-api.js +0 -74
- package/dist/host/cors.d.ts +0 -27
- package/dist/host/cors.js +0 -64
- package/dist/mcp/stdio.d.ts +0 -17
- package/dist/mcp/stdio.js +0 -82
- package/dist/tenant/access-policy.d.ts +0 -30
- package/dist/tenant/access-policy.js +0 -52
- package/dist/tenant/actions.d.ts +0 -14
- package/dist/tenant/actions.js +0 -29
- package/dist/tenant/browser.d.ts +0 -15
- package/dist/tenant/browser.js +0 -39
- package/dist/tenant/delivery-token.d.ts +0 -41
- package/dist/tenant/delivery-token.js +0 -104
- package/dist/tenant/delivery.d.ts +0 -62
- package/dist/tenant/delivery.js +0 -481
- package/dist/tenant/endpoints.d.ts +0 -67
- package/dist/tenant/endpoints.js +0 -90
- package/dist/tenant/subject-limits.d.ts +0 -16
- package/dist/tenant/subject-limits.js +0 -45
- package/dist/tenant/tokens.d.ts +0 -14
- package/dist/tenant/tokens.js +0 -187
package/dist/admin-openapi.json
DELETED
|
@@ -1,604 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"openapi": "3.2.0",
|
|
3
|
-
"info": {
|
|
4
|
-
"title": "Nylorun Runtime: Admin API",
|
|
5
|
-
"version": "0.16.0-beta",
|
|
6
|
-
"description": "The Host's status, its Tenant's state and shutdown, with the admin key. Served on the operator listener when the Host has one; the public listener answers these routes with the opaque 404.",
|
|
7
|
-
"x-nylorun-protocol": {
|
|
8
|
-
"min": 4,
|
|
9
|
-
"max": 6,
|
|
10
|
-
"features": [
|
|
11
|
-
"runtime-tenants",
|
|
12
|
-
"admin-status",
|
|
13
|
-
"studio-principal",
|
|
14
|
-
"action-endpoints",
|
|
15
|
-
"artifacts",
|
|
16
|
-
"tenant-fixture-model",
|
|
17
|
-
"transcript-events",
|
|
18
|
-
"derived-principals",
|
|
19
|
-
"subject-headers",
|
|
20
|
-
"subject-tokens",
|
|
21
|
-
"browser-access",
|
|
22
|
-
"ag-ui-endpoint",
|
|
23
|
-
"a2a-endpoint",
|
|
24
|
-
"action-endpoints",
|
|
25
|
-
"sandboxes",
|
|
26
|
-
"sandbox-pods"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"servers": [
|
|
31
|
-
{
|
|
32
|
-
"url": "{origin}",
|
|
33
|
-
"description": "The operator listener: a local Tenant's, or where yours runs",
|
|
34
|
-
"variables": {
|
|
35
|
-
"origin": {
|
|
36
|
-
"default": "http://localhost:8788"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
],
|
|
41
|
-
"components": {
|
|
42
|
-
"securitySchemes": {
|
|
43
|
-
"adminKey": {
|
|
44
|
-
"type": "http",
|
|
45
|
-
"scheme": "bearer",
|
|
46
|
-
"description": "The Host's admin key (`host-credentials.json`). Never a Tenant bearer."
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"schemas": {
|
|
50
|
-
"AdminStatus": {
|
|
51
|
-
"type": "object",
|
|
52
|
-
"properties": {
|
|
53
|
-
"service": {
|
|
54
|
-
"type": "string",
|
|
55
|
-
"minLength": 1
|
|
56
|
-
},
|
|
57
|
-
"version": {
|
|
58
|
-
"type": "string",
|
|
59
|
-
"minLength": 1
|
|
60
|
-
},
|
|
61
|
-
"protocol": {
|
|
62
|
-
"type": "object",
|
|
63
|
-
"properties": {
|
|
64
|
-
"min": {
|
|
65
|
-
"type": "integer"
|
|
66
|
-
},
|
|
67
|
-
"max": {
|
|
68
|
-
"type": "integer"
|
|
69
|
-
},
|
|
70
|
-
"features": {
|
|
71
|
-
"type": "array",
|
|
72
|
-
"items": {
|
|
73
|
-
"type": "string"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"required": [
|
|
78
|
-
"min",
|
|
79
|
-
"max",
|
|
80
|
-
"features"
|
|
81
|
-
],
|
|
82
|
-
"additionalProperties": false
|
|
83
|
-
},
|
|
84
|
-
"tenant": {
|
|
85
|
-
"type": "object",
|
|
86
|
-
"properties": {
|
|
87
|
-
"id": {
|
|
88
|
-
"type": [
|
|
89
|
-
"string",
|
|
90
|
-
"null"
|
|
91
|
-
],
|
|
92
|
-
"minLength": 1
|
|
93
|
-
},
|
|
94
|
-
"name": {
|
|
95
|
-
"type": [
|
|
96
|
-
"string",
|
|
97
|
-
"null"
|
|
98
|
-
]
|
|
99
|
-
},
|
|
100
|
-
"state": {
|
|
101
|
-
"type": "string",
|
|
102
|
-
"enum": [
|
|
103
|
-
"open",
|
|
104
|
-
"unavailable"
|
|
105
|
-
]
|
|
106
|
-
},
|
|
107
|
-
"envelope": {
|
|
108
|
-
"type": [
|
|
109
|
-
"object",
|
|
110
|
-
"null"
|
|
111
|
-
],
|
|
112
|
-
"properties": {
|
|
113
|
-
"id": {
|
|
114
|
-
"type": "string",
|
|
115
|
-
"minLength": 1
|
|
116
|
-
},
|
|
117
|
-
"name": {
|
|
118
|
-
"type": "string",
|
|
119
|
-
"minLength": 1
|
|
120
|
-
},
|
|
121
|
-
"createdAt": {
|
|
122
|
-
"type": "string",
|
|
123
|
-
"minLength": 1
|
|
124
|
-
},
|
|
125
|
-
"updatedAt": {
|
|
126
|
-
"type": "string",
|
|
127
|
-
"minLength": 1
|
|
128
|
-
},
|
|
129
|
-
"schemaVersion": {
|
|
130
|
-
"type": "integer"
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
"required": [
|
|
134
|
-
"id",
|
|
135
|
-
"name",
|
|
136
|
-
"createdAt",
|
|
137
|
-
"updatedAt",
|
|
138
|
-
"schemaVersion"
|
|
139
|
-
],
|
|
140
|
-
"additionalProperties": false
|
|
141
|
-
},
|
|
142
|
-
"cause": {
|
|
143
|
-
"type": "object",
|
|
144
|
-
"properties": {
|
|
145
|
-
"code": {
|
|
146
|
-
"type": "string",
|
|
147
|
-
"enum": [
|
|
148
|
-
"kek-missing",
|
|
149
|
-
"corrupt",
|
|
150
|
-
"schema-too-new",
|
|
151
|
-
"migration-failed",
|
|
152
|
-
"envelope-invalid",
|
|
153
|
-
"open-timeout",
|
|
154
|
-
"open-failed",
|
|
155
|
-
"database-layout-old"
|
|
156
|
-
]
|
|
157
|
-
},
|
|
158
|
-
"message": {
|
|
159
|
-
"type": "string"
|
|
160
|
-
},
|
|
161
|
-
"repair": {
|
|
162
|
-
"type": "string"
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
"required": [
|
|
166
|
-
"code",
|
|
167
|
-
"message",
|
|
168
|
-
"repair"
|
|
169
|
-
],
|
|
170
|
-
"additionalProperties": false
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
"required": [
|
|
174
|
-
"id",
|
|
175
|
-
"name",
|
|
176
|
-
"state",
|
|
177
|
-
"envelope"
|
|
178
|
-
],
|
|
179
|
-
"additionalProperties": false
|
|
180
|
-
},
|
|
181
|
-
"aggregate": {
|
|
182
|
-
"type": "object",
|
|
183
|
-
"properties": {
|
|
184
|
-
"runningSessions": {
|
|
185
|
-
"type": "integer",
|
|
186
|
-
"minimum": 0
|
|
187
|
-
},
|
|
188
|
-
"inFlightDeliveries": {
|
|
189
|
-
"type": "integer",
|
|
190
|
-
"minimum": 0
|
|
191
|
-
},
|
|
192
|
-
"pendingActions": {
|
|
193
|
-
"type": "integer",
|
|
194
|
-
"minimum": 0
|
|
195
|
-
},
|
|
196
|
-
"uncertainEffects": {
|
|
197
|
-
"type": "integer",
|
|
198
|
-
"minimum": 0
|
|
199
|
-
},
|
|
200
|
-
"relay": {
|
|
201
|
-
"type": "object",
|
|
202
|
-
"properties": {
|
|
203
|
-
"active": {
|
|
204
|
-
"type": "boolean"
|
|
205
|
-
},
|
|
206
|
-
"pendingTxs": {
|
|
207
|
-
"type": "integer",
|
|
208
|
-
"minimum": 0
|
|
209
|
-
},
|
|
210
|
-
"pendingRows": {
|
|
211
|
-
"type": "integer",
|
|
212
|
-
"minimum": 0
|
|
213
|
-
},
|
|
214
|
-
"confirmed": {
|
|
215
|
-
"type": [
|
|
216
|
-
"string",
|
|
217
|
-
"null"
|
|
218
|
-
]
|
|
219
|
-
},
|
|
220
|
-
"reconciliations": {
|
|
221
|
-
"type": "integer",
|
|
222
|
-
"minimum": 0
|
|
223
|
-
},
|
|
224
|
-
"lastError": {
|
|
225
|
-
"type": [
|
|
226
|
-
"string",
|
|
227
|
-
"null"
|
|
228
|
-
]
|
|
229
|
-
},
|
|
230
|
-
"lagBytes": {
|
|
231
|
-
"type": "number",
|
|
232
|
-
"minimum": 0
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
"required": [
|
|
236
|
-
"active",
|
|
237
|
-
"pendingTxs",
|
|
238
|
-
"pendingRows",
|
|
239
|
-
"confirmed",
|
|
240
|
-
"reconciliations",
|
|
241
|
-
"lastError"
|
|
242
|
-
],
|
|
243
|
-
"additionalProperties": false
|
|
244
|
-
},
|
|
245
|
-
"harness": {
|
|
246
|
-
"type": "object",
|
|
247
|
-
"properties": {
|
|
248
|
-
"mode": {
|
|
249
|
-
"type": "string",
|
|
250
|
-
"enum": [
|
|
251
|
-
"in-process",
|
|
252
|
-
"remote"
|
|
253
|
-
]
|
|
254
|
-
},
|
|
255
|
-
"connected": {
|
|
256
|
-
"type": "integer",
|
|
257
|
-
"minimum": 0
|
|
258
|
-
},
|
|
259
|
-
"workspace": {
|
|
260
|
-
"type": "boolean"
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
"required": [
|
|
264
|
-
"mode",
|
|
265
|
-
"connected",
|
|
266
|
-
"workspace"
|
|
267
|
-
],
|
|
268
|
-
"additionalProperties": false
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
"required": [
|
|
272
|
-
"runningSessions",
|
|
273
|
-
"inFlightDeliveries",
|
|
274
|
-
"pendingActions",
|
|
275
|
-
"uncertainEffects"
|
|
276
|
-
],
|
|
277
|
-
"additionalProperties": false
|
|
278
|
-
},
|
|
279
|
-
"host": {
|
|
280
|
-
"type": "object",
|
|
281
|
-
"properties": {
|
|
282
|
-
"hostId": {
|
|
283
|
-
"type": "string",
|
|
284
|
-
"minLength": 1
|
|
285
|
-
},
|
|
286
|
-
"url": {
|
|
287
|
-
"type": "string",
|
|
288
|
-
"minLength": 1
|
|
289
|
-
},
|
|
290
|
-
"pid": {
|
|
291
|
-
"type": "integer"
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
"required": [
|
|
295
|
-
"hostId",
|
|
296
|
-
"url",
|
|
297
|
-
"pid"
|
|
298
|
-
],
|
|
299
|
-
"additionalProperties": false
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
"required": [
|
|
303
|
-
"service",
|
|
304
|
-
"version",
|
|
305
|
-
"protocol",
|
|
306
|
-
"tenant",
|
|
307
|
-
"aggregate"
|
|
308
|
-
],
|
|
309
|
-
"additionalProperties": false
|
|
310
|
-
},
|
|
311
|
-
"Rejected": {
|
|
312
|
-
"type": "object",
|
|
313
|
-
"properties": {
|
|
314
|
-
"status": {
|
|
315
|
-
"type": "string",
|
|
316
|
-
"enum": [
|
|
317
|
-
"rejected"
|
|
318
|
-
]
|
|
319
|
-
},
|
|
320
|
-
"code": {
|
|
321
|
-
"type": "string",
|
|
322
|
-
"enum": [
|
|
323
|
-
"not_found",
|
|
324
|
-
"protocol_unsupported",
|
|
325
|
-
"host_rejected",
|
|
326
|
-
"origin_rejected",
|
|
327
|
-
"unsupported_media_type",
|
|
328
|
-
"connection_missing",
|
|
329
|
-
"incompatible_host",
|
|
330
|
-
"subject_invalid",
|
|
331
|
-
"scope_required",
|
|
332
|
-
"token_expired",
|
|
333
|
-
"limit_exceeded",
|
|
334
|
-
"request_rejected",
|
|
335
|
-
"invalid_request",
|
|
336
|
-
"subject_required",
|
|
337
|
-
"sandbox_not_granted",
|
|
338
|
-
"sandbox_busy",
|
|
339
|
-
"sandbox_unavailable",
|
|
340
|
-
"placement_refused",
|
|
341
|
-
"sandbox_lost",
|
|
342
|
-
"sandbox_expired",
|
|
343
|
-
"internal_error"
|
|
344
|
-
]
|
|
345
|
-
},
|
|
346
|
-
"message": {
|
|
347
|
-
"type": "string"
|
|
348
|
-
},
|
|
349
|
-
"details": {},
|
|
350
|
-
"activeTurnId": {
|
|
351
|
-
"type": "string"
|
|
352
|
-
},
|
|
353
|
-
"requestId": {
|
|
354
|
-
"type": "string"
|
|
355
|
-
}
|
|
356
|
-
},
|
|
357
|
-
"required": [
|
|
358
|
-
"status",
|
|
359
|
-
"code",
|
|
360
|
-
"message"
|
|
361
|
-
]
|
|
362
|
-
},
|
|
363
|
-
"ProtocolRejected": {
|
|
364
|
-
"type": "object",
|
|
365
|
-
"properties": {
|
|
366
|
-
"status": {
|
|
367
|
-
"type": "string",
|
|
368
|
-
"enum": [
|
|
369
|
-
"rejected"
|
|
370
|
-
]
|
|
371
|
-
},
|
|
372
|
-
"code": {
|
|
373
|
-
"type": "string",
|
|
374
|
-
"enum": [
|
|
375
|
-
"protocol_unsupported"
|
|
376
|
-
]
|
|
377
|
-
},
|
|
378
|
-
"protocol": {
|
|
379
|
-
"type": "object",
|
|
380
|
-
"properties": {
|
|
381
|
-
"min": {
|
|
382
|
-
"type": "integer"
|
|
383
|
-
},
|
|
384
|
-
"max": {
|
|
385
|
-
"type": "integer"
|
|
386
|
-
},
|
|
387
|
-
"features": {
|
|
388
|
-
"type": "array",
|
|
389
|
-
"items": {
|
|
390
|
-
"type": "string"
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
},
|
|
394
|
-
"required": [
|
|
395
|
-
"min",
|
|
396
|
-
"max",
|
|
397
|
-
"features"
|
|
398
|
-
],
|
|
399
|
-
"additionalProperties": false
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
"required": [
|
|
403
|
-
"status",
|
|
404
|
-
"code",
|
|
405
|
-
"protocol"
|
|
406
|
-
],
|
|
407
|
-
"additionalProperties": false
|
|
408
|
-
},
|
|
409
|
-
"HostShutdownResponse": {
|
|
410
|
-
"type": "object",
|
|
411
|
-
"properties": {
|
|
412
|
-
"status": {
|
|
413
|
-
"type": "string",
|
|
414
|
-
"enum": [
|
|
415
|
-
"shutting_down"
|
|
416
|
-
]
|
|
417
|
-
}
|
|
418
|
-
},
|
|
419
|
-
"required": [
|
|
420
|
-
"status"
|
|
421
|
-
],
|
|
422
|
-
"additionalProperties": false
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
"parameters": {}
|
|
426
|
-
},
|
|
427
|
-
"paths": {
|
|
428
|
-
"/v1/admin/status": {
|
|
429
|
-
"get": {
|
|
430
|
-
"summary": "Get the Host's status",
|
|
431
|
-
"tags": [
|
|
432
|
-
"Admin"
|
|
433
|
-
],
|
|
434
|
-
"security": [
|
|
435
|
-
{
|
|
436
|
-
"adminKey": []
|
|
437
|
-
}
|
|
438
|
-
],
|
|
439
|
-
"responses": {
|
|
440
|
-
"200": {
|
|
441
|
-
"description": "Version, protocol, the Tenant and the Host",
|
|
442
|
-
"content": {
|
|
443
|
-
"application/json": {
|
|
444
|
-
"schema": {
|
|
445
|
-
"$ref": "#/components/schemas/AdminStatus"
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
},
|
|
450
|
-
"404": {
|
|
451
|
-
"description": "Not found: an unknown admin key, or the public listener",
|
|
452
|
-
"content": {
|
|
453
|
-
"application/json": {
|
|
454
|
-
"schema": {
|
|
455
|
-
"$ref": "#/components/schemas/Rejected"
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
},
|
|
460
|
-
"426": {
|
|
461
|
-
"description": "`Nylorun-Protocol` missing or unsupported",
|
|
462
|
-
"content": {
|
|
463
|
-
"application/json": {
|
|
464
|
-
"schema": {
|
|
465
|
-
"$ref": "#/components/schemas/ProtocolRejected"
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
},
|
|
473
|
-
"/v1/admin/host": {
|
|
474
|
-
"get": {
|
|
475
|
-
"summary": "Get the Host's status (alias)",
|
|
476
|
-
"tags": [
|
|
477
|
-
"Admin"
|
|
478
|
-
],
|
|
479
|
-
"security": [
|
|
480
|
-
{
|
|
481
|
-
"adminKey": []
|
|
482
|
-
}
|
|
483
|
-
],
|
|
484
|
-
"responses": {
|
|
485
|
-
"200": {
|
|
486
|
-
"description": "Version, protocol, the Tenant and the Host",
|
|
487
|
-
"content": {
|
|
488
|
-
"application/json": {
|
|
489
|
-
"schema": {
|
|
490
|
-
"$ref": "#/components/schemas/AdminStatus"
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
},
|
|
495
|
-
"404": {
|
|
496
|
-
"description": "Not found: an unknown admin key, or the public listener",
|
|
497
|
-
"content": {
|
|
498
|
-
"application/json": {
|
|
499
|
-
"schema": {
|
|
500
|
-
"$ref": "#/components/schemas/Rejected"
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
},
|
|
505
|
-
"426": {
|
|
506
|
-
"description": "`Nylorun-Protocol` missing or unsupported",
|
|
507
|
-
"content": {
|
|
508
|
-
"application/json": {
|
|
509
|
-
"schema": {
|
|
510
|
-
"$ref": "#/components/schemas/ProtocolRejected"
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
},
|
|
518
|
-
"/v1/admin/host/shutdown": {
|
|
519
|
-
"post": {
|
|
520
|
-
"summary": "Shut the Host down",
|
|
521
|
-
"description": "Answers, then stops the Host. Served by a self-hosted Runtime only.",
|
|
522
|
-
"tags": [
|
|
523
|
-
"Admin"
|
|
524
|
-
],
|
|
525
|
-
"security": [
|
|
526
|
-
{
|
|
527
|
-
"adminKey": []
|
|
528
|
-
}
|
|
529
|
-
],
|
|
530
|
-
"responses": {
|
|
531
|
-
"200": {
|
|
532
|
-
"description": "The Host is stopping",
|
|
533
|
-
"content": {
|
|
534
|
-
"application/json": {
|
|
535
|
-
"schema": {
|
|
536
|
-
"$ref": "#/components/schemas/HostShutdownResponse"
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
},
|
|
541
|
-
"404": {
|
|
542
|
-
"description": "Not found: an unknown admin key, or the public listener",
|
|
543
|
-
"content": {
|
|
544
|
-
"application/json": {
|
|
545
|
-
"schema": {
|
|
546
|
-
"$ref": "#/components/schemas/Rejected"
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
},
|
|
551
|
-
"426": {
|
|
552
|
-
"description": "`Nylorun-Protocol` missing or unsupported",
|
|
553
|
-
"content": {
|
|
554
|
-
"application/json": {
|
|
555
|
-
"schema": {
|
|
556
|
-
"$ref": "#/components/schemas/ProtocolRejected"
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
},
|
|
564
|
-
"/v1/admin/openapi.json": {
|
|
565
|
-
"get": {
|
|
566
|
-
"summary": "Get this document",
|
|
567
|
-
"tags": [
|
|
568
|
-
"Admin"
|
|
569
|
-
],
|
|
570
|
-
"security": [
|
|
571
|
-
{
|
|
572
|
-
"adminKey": []
|
|
573
|
-
}
|
|
574
|
-
],
|
|
575
|
-
"responses": {
|
|
576
|
-
"200": {
|
|
577
|
-
"description": "The Admin API's OpenAPI document"
|
|
578
|
-
},
|
|
579
|
-
"404": {
|
|
580
|
-
"description": "Not found: an unknown admin key, or the public listener",
|
|
581
|
-
"content": {
|
|
582
|
-
"application/json": {
|
|
583
|
-
"schema": {
|
|
584
|
-
"$ref": "#/components/schemas/Rejected"
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
},
|
|
589
|
-
"426": {
|
|
590
|
-
"description": "`Nylorun-Protocol` missing or unsupported",
|
|
591
|
-
"content": {
|
|
592
|
-
"application/json": {
|
|
593
|
-
"schema": {
|
|
594
|
-
"$ref": "#/components/schemas/ProtocolRejected"
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
},
|
|
603
|
-
"webhooks": {}
|
|
604
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Session commands, and the callbacks an Action endpoint makes about the Action it was
|
|
3
|
-
* delivered: heartbeats and sandbox tools, with the Action's delivery token (Action endpoints).
|
|
4
|
-
* The background result is in `endpoints.ts`.
|
|
5
|
-
*/
|
|
6
|
-
import type { OpenAPIHono } from "@hono/zod-openapi";
|
|
7
|
-
import type { TenantEnv } from "../app.js";
|
|
8
|
-
export declare function actionRoutes(api: OpenAPIHono<TenantEnv>): void;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { SessionCommandSchema } from "@nylorun/core/contracts";
|
|
3
|
-
import { AcceptedResponse, DeliveryHeartbeatResponse, SandboxToolOutcome, SessionCommand, } from "../../components.js";
|
|
4
|
-
import { actionSandboxTool } from "../../../tenant/actions.js";
|
|
5
|
-
import { command } from "../../../tenant/commands.js";
|
|
6
|
-
import { deliveryHeartbeat } from "../../../tenant/delivery.js";
|
|
7
|
-
import { fail } from "../../../tenant/http.js";
|
|
8
|
-
import { readJson } from "../body.js";
|
|
9
|
-
import { tenantRoute } from "../define.js";
|
|
10
|
-
import { jsonResponse } from "../respond.js";
|
|
11
|
-
/** An Action's callbacks: only the delivery token of its current delivery. */
|
|
12
|
-
const CALLBACK = { credentials: ["delivery"], scopes: "never" };
|
|
13
|
-
const json = (schema, description) => ({
|
|
14
|
-
description,
|
|
15
|
-
content: { "application/json": { schema } },
|
|
16
|
-
});
|
|
17
|
-
const body = (schema) => ({
|
|
18
|
-
required: true,
|
|
19
|
-
content: { "application/json": { schema } },
|
|
20
|
-
});
|
|
21
|
-
const actionId = z.object({ actionId: z.string() });
|
|
22
|
-
const SANDBOX_TOOLS = ["bash", "read", "write", "edit", "grep", "glob"];
|
|
23
|
-
function deliveryOf(scope) {
|
|
24
|
-
if (scope.kind !== "delivery")
|
|
25
|
-
return fail(403, "A delivery token is required");
|
|
26
|
-
return scope;
|
|
27
|
-
}
|
|
28
|
-
export function actionRoutes(api) {
|
|
29
|
-
tenantRoute(api, CALLBACK, {
|
|
30
|
-
method: "post",
|
|
31
|
-
path: "/v1/actions/{actionId}/sandbox/{tool}",
|
|
32
|
-
tags: ["Action endpoints"],
|
|
33
|
-
summary: "Run a sandbox tool for an Action being delivered",
|
|
34
|
-
description: "Called by the Action endpoint with the Action's delivery token. The body is the tool's input.",
|
|
35
|
-
request: {
|
|
36
|
-
params: actionId.extend({ tool: z.enum(SANDBOX_TOOLS) }),
|
|
37
|
-
body: body(z.looseObject({}).meta({ description: "The tool's input" })),
|
|
38
|
-
},
|
|
39
|
-
responses: {
|
|
40
|
-
200: json(SandboxToolOutcome, "The tool's output, or why it failed"),
|
|
41
|
-
409: { description: "The delivery was cancelled, lost or sent again" },
|
|
42
|
-
},
|
|
43
|
-
}, async (c) => jsonResponse(200, await actionSandboxTool(c.env.tenant, deliveryOf(c.get("scope")), c.req.param("actionId"), c.req.param("tool"), () => readJson(c.req.raw), c.req.raw.signal)));
|
|
44
|
-
tenantRoute(api, CALLBACK, {
|
|
45
|
-
method: "post",
|
|
46
|
-
path: "/v1/actions/{actionId}/heartbeat",
|
|
47
|
-
tags: ["Action endpoints"],
|
|
48
|
-
summary: "Keep a background delivery alive",
|
|
49
|
-
description: "Called by an Action endpoint that answered a delivery with 202: extends the delivery by a " +
|
|
50
|
-
"lease and returns a fresh delivery token.",
|
|
51
|
-
request: { params: actionId },
|
|
52
|
-
responses: {
|
|
53
|
-
200: json(DeliveryHeartbeatResponse, "The delivery's new deadline, and a fresh token"),
|
|
54
|
-
409: { description: "The delivery was cancelled, lost or sent again" },
|
|
55
|
-
},
|
|
56
|
-
}, async (c) => jsonResponse(200, await deliveryHeartbeat(c.env.tenant, deliveryOf(c.get("scope")), c.req.param("actionId"))));
|
|
57
|
-
tenantRoute(api, {
|
|
58
|
-
credentials: ["application", "subject", "token"],
|
|
59
|
-
scopes: ["sessions:own"],
|
|
60
|
-
browser: true,
|
|
61
|
-
}, {
|
|
62
|
-
method: "post",
|
|
63
|
-
path: "/v1/sessions/{sessionId}/commands",
|
|
64
|
-
tags: ["Sessions"],
|
|
65
|
-
summary: "Send a command to a session",
|
|
66
|
-
description: "A message starts a turn; the others answer what the session waits on, or cancel. Idempotent on the command's `idempotencyKey`.",
|
|
67
|
-
request: {
|
|
68
|
-
params: z.object({ sessionId: z.string() }),
|
|
69
|
-
body: body(SessionCommand),
|
|
70
|
-
},
|
|
71
|
-
responses: {
|
|
72
|
-
200: json(AcceptedResponse, "The command, accepted"),
|
|
73
|
-
409: { description: "A turn is running, or the session does not wait on this" },
|
|
74
|
-
},
|
|
75
|
-
}, async (c) => jsonResponse(200, await command(c.env.tenant, c.req.param("sessionId"), SessionCommandSchema.parse(await readJson(c.req.raw)), c.get("scope"))));
|
|
76
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Action endpoints: where the Runtime delivers each agent's Actions (design: Action endpoints
|
|
3
|
-
* §4.2). Registered, listed and removed with the application key; no subject reaches them.
|
|
4
|
-
*/
|
|
5
|
-
import type { OpenAPIHono } from "@hono/zod-openapi";
|
|
6
|
-
import type { TenantEnv } from "../app.js";
|
|
7
|
-
export declare function endpointRoutes(api: OpenAPIHono<TenantEnv>): void;
|