@fungi.computer/shiitake 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +454 -2
- package/dist/agar-extension.d.ts +9 -0
- package/dist/agar-extension.js +38 -0
- package/dist/agent-control.d.ts +77 -0
- package/dist/agent-control.js +434 -0
- package/dist/client-entry.d.ts +211 -0
- package/dist/client-entry.js +101 -0
- package/dist/client-wire.d.ts +199 -0
- package/dist/client-wire.js +271 -0
- package/dist/client.d.ts +439 -0
- package/dist/client.js +4 -0
- package/dist/cloudflare.d.ts +220 -0
- package/dist/cloudflare.js +531 -0
- package/dist/effect.d.ts +42 -0
- package/dist/effect.js +20 -0
- package/dist/errors.d.ts +50 -0
- package/dist/errors.js +81 -0
- package/dist/extension-client.d.ts +38 -0
- package/dist/extension-client.js +56 -0
- package/dist/extension-contract.d.ts +73 -0
- package/dist/extension-contract.js +11 -0
- package/dist/extensions.d.ts +589 -0
- package/dist/extensions.js +263 -0
- package/dist/fleet.d.ts +313 -0
- package/dist/fleet.js +540 -0
- package/dist/hosted.d.ts +133 -0
- package/dist/hosted.js +265 -0
- package/dist/http-routes.d.ts +772 -0
- package/dist/http-routes.js +242 -0
- package/dist/http.d.ts +1 -0
- package/dist/http.js +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +13 -0
- package/dist/internal/accepted-run-executor.d.ts +23 -0
- package/dist/internal/accepted-run-executor.js +129 -0
- package/dist/internal/admission-door.d.ts +75 -0
- package/dist/internal/admission-door.js +105 -0
- package/dist/internal/agent-close.d.ts +4 -0
- package/dist/internal/agent-close.js +42 -0
- package/dist/internal/browser-sessions.d.ts +31 -0
- package/dist/internal/browser-sessions.js +173 -0
- package/dist/internal/client-boundary.d.ts +262 -0
- package/dist/internal/client-boundary.js +202 -0
- package/dist/internal/compaction/compaction.d.ts +54 -0
- package/dist/internal/compaction/compaction.js +291 -0
- package/dist/internal/compaction/session-compaction.d.ts +69 -0
- package/dist/internal/compaction/session-compaction.js +330 -0
- package/dist/internal/compaction/settings.d.ts +11 -0
- package/dist/internal/compaction/settings.js +40 -0
- package/dist/internal/compaction/utils.d.ts +45 -0
- package/dist/internal/compaction/utils.js +319 -0
- package/dist/internal/contracts.d.ts +235 -0
- package/dist/internal/contracts.js +1 -0
- package/dist/internal/coordinator.d.ts +18 -0
- package/dist/internal/coordinator.js +362 -0
- package/dist/internal/document-codec.d.ts +11 -0
- package/dist/internal/document-codec.js +39 -0
- package/dist/internal/effect-client.d.ts +13 -0
- package/dist/internal/effect-client.js +102 -0
- package/dist/internal/effect-contracts.d.ts +236 -0
- package/dist/internal/effect-contracts.js +2 -0
- package/dist/internal/extension-command-registry.d.ts +11 -0
- package/dist/internal/extension-command-registry.js +29 -0
- package/dist/internal/extension-command-tools.d.ts +17 -0
- package/dist/internal/extension-command-tools.js +50 -0
- package/dist/internal/extension-context.d.ts +25 -0
- package/dist/internal/extension-context.js +35 -0
- package/dist/internal/extension-definitions.d.ts +5 -0
- package/dist/internal/extension-definitions.js +6 -0
- package/dist/internal/extension-hook.d.ts +25 -0
- package/dist/internal/extension-hook.js +46 -0
- package/dist/internal/extension-roster.d.ts +23 -0
- package/dist/internal/extension-roster.js +228 -0
- package/dist/internal/extension-runtime.d.ts +63 -0
- package/dist/internal/extension-runtime.js +1004 -0
- package/dist/internal/failure.d.ts +2 -0
- package/dist/internal/failure.js +9 -0
- package/dist/internal/host-meta.d.ts +41 -0
- package/dist/internal/host-meta.js +39 -0
- package/dist/internal/json-value.d.ts +4 -0
- package/dist/internal/json-value.js +3 -0
- package/dist/internal/model-acquisition.d.ts +21 -0
- package/dist/internal/model-acquisition.js +98 -0
- package/dist/internal/model-preference.d.ts +21 -0
- package/dist/internal/model-preference.js +20 -0
- package/dist/internal/observation-kernel.d.ts +28 -0
- package/dist/internal/observation-kernel.js +169 -0
- package/dist/internal/promise-facade.d.ts +18 -0
- package/dist/internal/promise-facade.js +172 -0
- package/dist/internal/run-scope.d.ts +27 -0
- package/dist/internal/run-scope.js +214 -0
- package/dist/internal/runtime-coordinator.d.ts +34 -0
- package/dist/internal/runtime-coordinator.js +233 -0
- package/dist/internal/runtime-core.d.ts +19 -0
- package/dist/internal/runtime-core.js +39 -0
- package/dist/internal/runtime-reconciliation.d.ts +18 -0
- package/dist/internal/runtime-reconciliation.js +162 -0
- package/dist/internal/session-context.d.ts +11 -0
- package/dist/internal/session-context.js +67 -0
- package/dist/internal/session-status.d.ts +10 -0
- package/dist/internal/session-status.js +52 -0
- package/dist/internal/woodstock/agent-reply.d.ts +25 -0
- package/dist/internal/woodstock/agent-reply.js +67 -0
- package/dist/internal/woodstock/client-projection.d.ts +29 -0
- package/dist/internal/woodstock/client-projection.js +512 -0
- package/dist/internal/woodstock/compaction-activity.d.ts +17 -0
- package/dist/internal/woodstock/compaction-activity.js +32 -0
- package/dist/internal/woodstock/cursor.d.ts +9 -0
- package/dist/internal/woodstock/cursor.js +44 -0
- package/dist/internal/woodstock/extension-store.d.ts +72 -0
- package/dist/internal/woodstock/extension-store.js +262 -0
- package/dist/internal/woodstock/fleet-store.d.ts +36 -0
- package/dist/internal/woodstock/fleet-store.js +100 -0
- package/dist/internal/woodstock/identities.d.ts +6 -0
- package/dist/internal/woodstock/identities.js +11 -0
- package/dist/internal/woodstock/index.d.ts +170 -0
- package/dist/internal/woodstock/index.js +546 -0
- package/dist/internal/woodstock/progress.d.ts +32 -0
- package/dist/internal/woodstock/progress.js +89 -0
- package/dist/internal/woodstock/run-recovery.d.ts +8 -0
- package/dist/internal/woodstock/run-recovery.js +95 -0
- package/dist/internal/woodstock/session-attention.d.ts +16 -0
- package/dist/internal/woodstock/session-attention.js +88 -0
- package/dist/internal/woodstock/session-documents.d.ts +18 -0
- package/dist/internal/woodstock/session-documents.js +51 -0
- package/dist/internal/woodstock/session-entry.d.ts +478 -0
- package/dist/internal/woodstock/session-entry.js +484 -0
- package/dist/internal/woodstock/session-grants.d.ts +24 -0
- package/dist/internal/woodstock/session-grants.js +84 -0
- package/dist/internal/woodstock/session-inbox.d.ts +56 -0
- package/dist/internal/woodstock/session-inbox.js +307 -0
- package/dist/internal/woodstock/session-store.d.ts +432 -0
- package/dist/internal/woodstock/session-store.js +2006 -0
- package/dist/internal/woodstock/storage-admission.d.ts +14 -0
- package/dist/internal/woodstock/storage-admission.js +44 -0
- package/dist/model-preference.d.ts +20 -0
- package/dist/model-preference.js +30 -0
- package/dist/node.d.ts +64 -0
- package/dist/node.js +256 -0
- package/dist/remote-client.d.ts +11 -0
- package/dist/remote-client.js +298 -0
- package/dist/session-attention.d.ts +35 -0
- package/dist/session-attention.js +22 -0
- package/dist/session-documents.d.ts +28 -0
- package/dist/session-documents.js +1 -0
- package/dist/testing.d.ts +54 -0
- package/dist/testing.js +215 -0
- package/docs/api/README.md +26 -0
- package/docs/api/agar-extension.md +40 -0
- package/docs/api/agent-control.md +151 -0
- package/docs/api/client-entry.md +344 -0
- package/docs/api/client.md +1112 -0
- package/docs/api/cloudflare.md +500 -0
- package/docs/api/effect.md +884 -0
- package/docs/api/extensions.md +2003 -0
- package/docs/api/fleet.md +734 -0
- package/docs/api/hosted.md +382 -0
- package/docs/api/http.md +111 -0
- package/docs/api/index.md +1116 -0
- package/docs/api/model-preference.md +151 -0
- package/docs/api/node.md +142 -0
- package/docs/api/testing.md +250 -0
- package/package.json +130 -3
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
<!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
|
|
2
|
+
|
|
3
|
+
[**@fungi.computer/shiitake**](README.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
[@fungi.computer/shiitake](README.md) / hosted
|
|
8
|
+
|
|
9
|
+
# hosted
|
|
10
|
+
|
|
11
|
+
## Type Aliases
|
|
12
|
+
|
|
13
|
+
### HostedRun
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type HostedRun = z.output<typeof hostedRunSchema>;
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
A parsed [hostedRunSchema](#hostedrunschema) value.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
### HostedPromptInput
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
type HostedPromptInput = z.output<typeof hostedPromptInputSchema>;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
A parsed [hostedPromptInputSchema](#hostedpromptinputschema) value.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### HostedPromptOutput
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
type HostedPromptOutput = z.output<typeof hostedPromptOutputSchema>;
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
A parsed [hostedPromptOutputSchema](#hostedpromptoutputschema) value.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
### HostedModuleDescriptor
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
type HostedModuleDescriptor = z.output<typeof hostedModuleDescriptorSchema>;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
A parsed [hostedModuleDescriptorSchema](#hostedmoduledescriptorschema) value.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### HostedToolsInput
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
type HostedToolsInput = z.output<typeof hostedToolsInputSchema>;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
A parsed [hostedToolsInputSchema](#hostedtoolsinputschema) value.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### HostedToolsOutput
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
type HostedToolsOutput = z.output<typeof hostedToolsOutputSchema>;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
A parsed [hostedToolsOutputSchema](#hostedtoolsoutputschema) value.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### HostedCallInput
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
type HostedCallInput = z.output<typeof hostedCallInputSchema>;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
A parsed [hostedCallInputSchema](#hostedcallinputschema) value.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### HostedCallOutput
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
type HostedCallOutput = z.output<typeof hostedCallOutputSchema>;
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
A parsed [hostedCallOutputSchema](#hostedcalloutputschema) value.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### HostedAgentExtension
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
type HostedAgentExtension = Readonly<{
|
|
97
|
+
manifest: ExtensionManifestV0;
|
|
98
|
+
prompt: (input) => Promise<HostedPromptOutput>;
|
|
99
|
+
tools: (input) => Promise<HostedToolsOutput>;
|
|
100
|
+
call: (input) => Promise<HostedCallOutput>;
|
|
101
|
+
}>;
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The guest side of one hosted extension. Inputs are already parsed by the App
|
|
105
|
+
method door with the schemas above; outputs are bounded here.
|
|
106
|
+
|
|
107
|
+
## Variables
|
|
108
|
+
|
|
109
|
+
### agentExtensionMethodNames
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
const agentExtensionMethodNames: Readonly<{
|
|
113
|
+
prompt: "agentExtensionPrompt";
|
|
114
|
+
tools: "agentExtensionTools";
|
|
115
|
+
call: "agentExtensionCall";
|
|
116
|
+
}>;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
App method names a hosted extension's backend serves.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### hostedExtensionCapabilities
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
const hostedExtensionCapabilities: readonly ExtensionCapabilityV0[];
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Capabilities a hosted extension may request in this protocol version.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
### hostedRunSchema
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
const hostedRunSchema: ZodObject<
|
|
137
|
+
{
|
|
138
|
+
sessionId: ZodString;
|
|
139
|
+
workId: ZodString;
|
|
140
|
+
origin: ZodNullable<
|
|
141
|
+
ZodObject<
|
|
142
|
+
{
|
|
143
|
+
extensionId: ZodString;
|
|
144
|
+
correlation: ZodNullable<ZodString>;
|
|
145
|
+
},
|
|
146
|
+
$strict
|
|
147
|
+
>
|
|
148
|
+
>;
|
|
149
|
+
},
|
|
150
|
+
$strict
|
|
151
|
+
>;
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
The run a hosted call is made for; the host derives it, never the model.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
### hostedPromptInputSchema
|
|
159
|
+
|
|
160
|
+
```ts
|
|
161
|
+
const hostedPromptInputSchema: ZodObject<
|
|
162
|
+
{
|
|
163
|
+
run: ZodObject<
|
|
164
|
+
{
|
|
165
|
+
sessionId: ZodString;
|
|
166
|
+
workId: ZodString;
|
|
167
|
+
origin: ZodNullable<
|
|
168
|
+
ZodObject<
|
|
169
|
+
{
|
|
170
|
+
extensionId: ZodString;
|
|
171
|
+
correlation: ZodNullable<ZodString>;
|
|
172
|
+
},
|
|
173
|
+
$strict
|
|
174
|
+
>
|
|
175
|
+
>;
|
|
176
|
+
},
|
|
177
|
+
$strict
|
|
178
|
+
>;
|
|
179
|
+
},
|
|
180
|
+
$strict
|
|
181
|
+
>;
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
`agentExtensionPrompt` input: the run whose model request needs sections.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
### hostedPromptOutputSchema
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
const hostedPromptOutputSchema: ZodObject<
|
|
192
|
+
{
|
|
193
|
+
sections: ZodArray<
|
|
194
|
+
ZodObject<
|
|
195
|
+
{
|
|
196
|
+
name: ZodString;
|
|
197
|
+
text: ZodString;
|
|
198
|
+
},
|
|
199
|
+
$strict
|
|
200
|
+
>
|
|
201
|
+
>;
|
|
202
|
+
},
|
|
203
|
+
$strict
|
|
204
|
+
>;
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
`agentExtensionPrompt` output: at most 16 named sections of at most 8 KiB each.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
### hostedModuleDescriptorSchema
|
|
212
|
+
|
|
213
|
+
```ts
|
|
214
|
+
const hostedModuleDescriptorSchema: ZodObject<
|
|
215
|
+
{
|
|
216
|
+
description: ZodOptional<ZodString>;
|
|
217
|
+
operations: ZodRecord<
|
|
218
|
+
ZodString,
|
|
219
|
+
ZodObject<
|
|
220
|
+
{
|
|
221
|
+
replay: ZodEnum<{
|
|
222
|
+
unsafe: "unsafe";
|
|
223
|
+
safe: "safe";
|
|
224
|
+
}>;
|
|
225
|
+
description: ZodOptional<ZodString>;
|
|
226
|
+
input: ZodJSONSchema;
|
|
227
|
+
output: ZodNullable<ZodJSONSchema>;
|
|
228
|
+
},
|
|
229
|
+
$strict
|
|
230
|
+
>
|
|
231
|
+
>;
|
|
232
|
+
},
|
|
233
|
+
$strict
|
|
234
|
+
>;
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
A run's tool module as at most 64 dotted operations with bounded JSON Schemas.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
### hostedToolsInputSchema
|
|
242
|
+
|
|
243
|
+
```ts
|
|
244
|
+
const hostedToolsInputSchema: ZodObject<
|
|
245
|
+
{
|
|
246
|
+
run: ZodObject<
|
|
247
|
+
{
|
|
248
|
+
sessionId: ZodString;
|
|
249
|
+
workId: ZodString;
|
|
250
|
+
origin: ZodNullable<
|
|
251
|
+
ZodObject<
|
|
252
|
+
{
|
|
253
|
+
extensionId: ZodString;
|
|
254
|
+
correlation: ZodNullable<ZodString>;
|
|
255
|
+
},
|
|
256
|
+
$strict
|
|
257
|
+
>
|
|
258
|
+
>;
|
|
259
|
+
},
|
|
260
|
+
$strict
|
|
261
|
+
>;
|
|
262
|
+
},
|
|
263
|
+
$strict
|
|
264
|
+
> = hostedPromptInputSchema;
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
`agentExtensionTools` input: the run the tools are captured for.
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
### hostedToolsOutputSchema
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
const hostedToolsOutputSchema: ZodObject<
|
|
275
|
+
{
|
|
276
|
+
module: ZodNullable<
|
|
277
|
+
ZodObject<
|
|
278
|
+
{
|
|
279
|
+
description: ZodOptional<ZodString>;
|
|
280
|
+
operations: ZodRecord<
|
|
281
|
+
ZodString,
|
|
282
|
+
ZodObject<
|
|
283
|
+
{
|
|
284
|
+
replay: ZodEnum<{
|
|
285
|
+
unsafe: "unsafe";
|
|
286
|
+
safe: "safe";
|
|
287
|
+
}>;
|
|
288
|
+
description: ZodOptional<ZodString>;
|
|
289
|
+
input: ZodJSONSchema;
|
|
290
|
+
output: ZodNullable<ZodJSONSchema>;
|
|
291
|
+
},
|
|
292
|
+
$strict
|
|
293
|
+
>
|
|
294
|
+
>;
|
|
295
|
+
},
|
|
296
|
+
$strict
|
|
297
|
+
>
|
|
298
|
+
>;
|
|
299
|
+
},
|
|
300
|
+
$strict
|
|
301
|
+
>;
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
`agentExtensionTools` output: the run's module, or null when it has none.
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
### hostedCallInputSchema
|
|
309
|
+
|
|
310
|
+
```ts
|
|
311
|
+
const hostedCallInputSchema: ZodObject<
|
|
312
|
+
{
|
|
313
|
+
run: ZodObject<
|
|
314
|
+
{
|
|
315
|
+
sessionId: ZodString;
|
|
316
|
+
workId: ZodString;
|
|
317
|
+
origin: ZodNullable<
|
|
318
|
+
ZodObject<
|
|
319
|
+
{
|
|
320
|
+
extensionId: ZodString;
|
|
321
|
+
correlation: ZodNullable<ZodString>;
|
|
322
|
+
},
|
|
323
|
+
$strict
|
|
324
|
+
>
|
|
325
|
+
>;
|
|
326
|
+
},
|
|
327
|
+
$strict
|
|
328
|
+
>;
|
|
329
|
+
operation: ZodString;
|
|
330
|
+
input: ZodJSONSchema;
|
|
331
|
+
invocation: ZodObject<
|
|
332
|
+
{
|
|
333
|
+
executionId: ZodString;
|
|
334
|
+
toolCallId: ZodOptional<ZodString>;
|
|
335
|
+
deadlineAt: ZodNullable<ZodNumber>;
|
|
336
|
+
},
|
|
337
|
+
$strict
|
|
338
|
+
>;
|
|
339
|
+
},
|
|
340
|
+
$strict
|
|
341
|
+
>;
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
`agentExtensionCall` input: one operation, its input, and the host's call
|
|
345
|
+
identity.
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
### hostedCallOutputSchema
|
|
350
|
+
|
|
351
|
+
```ts
|
|
352
|
+
const hostedCallOutputSchema: ZodObject<
|
|
353
|
+
{
|
|
354
|
+
value: ZodJSONSchema;
|
|
355
|
+
},
|
|
356
|
+
$strict
|
|
357
|
+
>;
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
`agentExtensionCall` output: the operation's JSON result.
|
|
361
|
+
|
|
362
|
+
## Functions
|
|
363
|
+
|
|
364
|
+
### hostAgentExtension()
|
|
365
|
+
|
|
366
|
+
```ts
|
|
367
|
+
function hostAgentExtension(rostered): HostedAgentExtension;
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
Serve one extension's prompt sections and tools to a remote Agent. Throws when
|
|
371
|
+
the extension requests a capability hosting does not provide yet, so a build
|
|
372
|
+
fails instead of silently dropping it.
|
|
373
|
+
|
|
374
|
+
#### Parameters
|
|
375
|
+
|
|
376
|
+
| Parameter | Type |
|
|
377
|
+
| ---------- | ---------------------------------------------------------- |
|
|
378
|
+
| `rostered` | [`RosteredExtensionV0`](extensions.md#rosteredextensionv0) |
|
|
379
|
+
|
|
380
|
+
#### Returns
|
|
381
|
+
|
|
382
|
+
[`HostedAgentExtension`](#hostedagentextension)
|
package/docs/api/http.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
|
|
2
|
+
|
|
3
|
+
[**@fungi.computer/shiitake**](README.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
[@fungi.computer/shiitake](README.md) / http
|
|
8
|
+
|
|
9
|
+
# http
|
|
10
|
+
|
|
11
|
+
## Type Aliases
|
|
12
|
+
|
|
13
|
+
### ShiitakeHttpEnv
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type ShiitakeHttpEnv = object;
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Hono variables Shiitake's routes read. Only the host's own middleware sets
|
|
20
|
+
`shiitakeMeta`; no request body can, because every body schema is closed.
|
|
21
|
+
|
|
22
|
+
#### Properties
|
|
23
|
+
|
|
24
|
+
##### Variables
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
Variables: object;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
###### shiitakeMeta
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
shiitakeMeta: Json | undefined;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Opaque host metadata for prompts and operator lines on this request.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
### ShiitakeSessionResolver
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
type ShiitakeSessionResolver = (
|
|
44
|
+
sessionId,
|
|
45
|
+
meta,
|
|
46
|
+
) => Promise<ShiitakeSession> | ShiitakeSession;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Resolve one addressed Session for Shiitake's HTTP transport. `meta` is what the
|
|
50
|
+
host's middleware attached to this request; a host that attaches none may ignore
|
|
51
|
+
it.
|
|
52
|
+
|
|
53
|
+
#### Parameters
|
|
54
|
+
|
|
55
|
+
| Parameter | Type |
|
|
56
|
+
| ----------- | ------------------------------------------- |
|
|
57
|
+
| `sessionId` | `string` |
|
|
58
|
+
| `meta` | [`Json`](extensions.md#json) \| `undefined` |
|
|
59
|
+
|
|
60
|
+
#### Returns
|
|
61
|
+
|
|
62
|
+
\| `Promise`\<[`ShiitakeSession`](client.md#shiitakesession)\> \|
|
|
63
|
+
[`ShiitakeSession`](client.md#shiitakesession)
|
|
64
|
+
|
|
65
|
+
## Functions
|
|
66
|
+
|
|
67
|
+
### createShiitakeHttpRoutes()
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
function createShiitakeHttpRoutes(
|
|
71
|
+
resolveSession,
|
|
72
|
+
listSessions,
|
|
73
|
+
createSession,
|
|
74
|
+
deleteSession,
|
|
75
|
+
resolveExtensions,
|
|
76
|
+
): Hono<
|
|
77
|
+
ShiitakeHttpEnv,
|
|
78
|
+
object &
|
|
79
|
+
object &
|
|
80
|
+
object &
|
|
81
|
+
object &
|
|
82
|
+
object &
|
|
83
|
+
object &
|
|
84
|
+
object &
|
|
85
|
+
object &
|
|
86
|
+
object &
|
|
87
|
+
object &
|
|
88
|
+
object &
|
|
89
|
+
object,
|
|
90
|
+
"/",
|
|
91
|
+
"/sessions/:sessionId/events"
|
|
92
|
+
>;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Build Shiitake's typed HTTP routes around an existing Session owner.
|
|
96
|
+
|
|
97
|
+
#### Parameters
|
|
98
|
+
|
|
99
|
+
| Parameter | Type |
|
|
100
|
+
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
101
|
+
| `resolveSession` | [`ShiitakeSessionResolver`](#shiitakesessionresolver) |
|
|
102
|
+
| `listSessions` | (`after?`) => `Promise`\<`Readonly`\<\{ `sessions`: readonly [`SessionSummaryRow`](client.md#sessionsummaryrow)[]; `next`: `string` \| `undefined`; \}\>\> |
|
|
103
|
+
| `createSession` | (`requestId`) => `Promise`\<`string`\> |
|
|
104
|
+
| `deleteSession` | (`sessionId`) => `Promise`\<`boolean`\> |
|
|
105
|
+
| `resolveExtensions` | () => \| `Readonly`\<\{ `list`: () => `Promise`\<readonly `Readonly`\<\{ `id`: `string`; `version`: `string`; `revision`: `string`; `status`: `"running"` \| `"stopped"`; `reason`: `string` \| `null`; `stoppedAt`: `number` \| `null`; \}\>[]\>; `resume`: (`extensionId`) => `Promise`\<`Readonly`\<\{ `id`: `string`; `version`: `string`; `revision`: `string`; `status`: `"running"` \| `"stopped"`; `reason`: `string` \| `null`; `stoppedAt`: `number` \| `null`; \}\>\>; `call`: (`extensionId`, `command`, `input`) => `Promise`\<[`Json`](extensions.md#json)\>; \}\> \| `Promise`\<`Readonly`\<\{ `list`: () => `Promise`\<readonly `Readonly`\<\{ `id`: `string`; `version`: `string`; `revision`: `string`; `status`: ... \| ...; `reason`: ... \| ...; `stoppedAt`: ... \| ...; \}\>[]\>; `resume`: (`extensionId`) => `Promise`\<`Readonly`\<\{ `id`: `string`; `version`: `string`; `revision`: `string`; `status`: `"running"` \| `"stopped"`; `reason`: `string` \| `null`; `stoppedAt`: `number` \| `null`; \}\>\>; `call`: (`extensionId`, `command`, `input`) => `Promise`\<[`Json`](extensions.md#json)\>; \}\>\> |
|
|
106
|
+
|
|
107
|
+
#### Returns
|
|
108
|
+
|
|
109
|
+
`Hono`\<[`ShiitakeHttpEnv`](#shiitakehttpenv), `object` & `object` & `object` &
|
|
110
|
+
`object` & `object` & `object` & `object` & `object` & `object` & `object` &
|
|
111
|
+
`object` & `object`, `"/"`, `"/sessions/:sessionId/events"`\>
|