@fungi.computer/mycelium 0.1.0 → 0.2.1
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/README.md +70 -7
- package/dist/access.d.ts +2 -7
- package/dist/access.js +0 -3
- package/dist/execute-tool.d.ts +3 -2
- package/dist/execute-tool.js +40 -11
- package/dist/image-collector.d.ts +1 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +2 -1
- package/dist/internal/build-identity.node.js +1 -1
- package/dist/internal/execution-lifecycle.d.ts +4 -2
- package/dist/internal/execution-lifecycle.js +94 -46
- package/dist/internal/host-cores.d.ts +2 -0
- package/dist/internal/host-cores.js +4 -0
- package/dist/internal/host-cores.node.d.ts +2 -0
- package/dist/internal/host-cores.node.js +5 -0
- package/dist/mcp-catalog.d.ts +0 -6
- package/dist/mcp-catalog.js +0 -1
- package/dist/mcp.d.ts +0 -1
- package/dist/mcp.js +0 -1
- package/dist/output-collector.d.ts +46 -0
- package/dist/output-collector.js +145 -0
- package/dist/runtime.js +1 -1
- package/dist/sandbox-admission.d.ts +19 -0
- package/dist/sandbox-admission.js +21 -0
- package/dist/sandbox-boundary.js +3 -1
- package/dist/sandbox-failure-event.d.ts +1 -1
- package/dist/sandbox-failure-event.js +1 -0
- package/dist/sandbox-failure.d.ts +12 -1
- package/dist/sandbox-failure.js +14 -0
- package/dist/sandbox-wire.d.ts +5 -0
- package/dist/sandbox-wire.js +20 -1
- package/docs/api/index.md +68 -5
- package/docs/api/mcp.md +0 -2
- package/docs/api/sandbox-failure.md +90 -0
- package/docs/api/sandbox-guest.md +36 -30
- package/docs/api/sandbox-wire.md +3 -3
- package/package.json +9 -5
|
@@ -312,6 +312,95 @@ Data.TaggedError("DeadlineExceeded").acknowledged;
|
|
|
312
312
|
|
|
313
313
|
---
|
|
314
314
|
|
|
315
|
+
### SandboxBusy
|
|
316
|
+
|
|
317
|
+
Admission expired before any sandbox work started.
|
|
318
|
+
|
|
319
|
+
#### Extends
|
|
320
|
+
|
|
321
|
+
- `YieldableError`\<`this`\> & `object` &
|
|
322
|
+
`Readonly`\<[`SandboxFailureReference`](#sandboxfailurereference) & `object`\>
|
|
323
|
+
|
|
324
|
+
#### Constructors
|
|
325
|
+
|
|
326
|
+
##### Constructor
|
|
327
|
+
|
|
328
|
+
```ts
|
|
329
|
+
new SandboxBusy(args): SandboxBusy;
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
###### Parameters
|
|
333
|
+
|
|
334
|
+
| Parameter | Type |
|
|
335
|
+
| --------------- | ------------------------------------------------------------------- |
|
|
336
|
+
| `args` | \{ `ref?`: `string`; `capacity`: `number`; `waitedMs`: `number`; \} |
|
|
337
|
+
| `args.ref?` | `string` |
|
|
338
|
+
| `args.capacity` | `number` |
|
|
339
|
+
| `args.waitedMs` | `number` |
|
|
340
|
+
|
|
341
|
+
###### Returns
|
|
342
|
+
|
|
343
|
+
[`SandboxBusy`](#sandboxbusy)
|
|
344
|
+
|
|
345
|
+
###### Inherited from
|
|
346
|
+
|
|
347
|
+
```ts
|
|
348
|
+
Data.TaggedError("SandboxBusy")<
|
|
349
|
+
SandboxFailureReference & {
|
|
350
|
+
readonly capacity: number;
|
|
351
|
+
readonly waitedMs: number;
|
|
352
|
+
}
|
|
353
|
+
>.constructor
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
#### Properties
|
|
357
|
+
|
|
358
|
+
##### ref?
|
|
359
|
+
|
|
360
|
+
```ts
|
|
361
|
+
readonly optional ref?: string;
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
###### Inherited from
|
|
365
|
+
|
|
366
|
+
```ts
|
|
367
|
+
Data.TaggedError("SandboxBusy").ref;
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
##### capacity
|
|
371
|
+
|
|
372
|
+
```ts
|
|
373
|
+
readonly capacity: number;
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
###### Inherited from
|
|
377
|
+
|
|
378
|
+
```ts
|
|
379
|
+
Data.TaggedError("SandboxBusy").capacity;
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
##### waitedMs
|
|
383
|
+
|
|
384
|
+
```ts
|
|
385
|
+
readonly waitedMs: number;
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
###### Inherited from
|
|
389
|
+
|
|
390
|
+
```ts
|
|
391
|
+
Data.TaggedError("SandboxBusy").waitedMs;
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
##### code
|
|
395
|
+
|
|
396
|
+
```ts
|
|
397
|
+
readonly code: "sandbox-busy" = "sandbox-busy";
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
Stable contention code, not a sandbox health failure.
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
315
404
|
### Cancelled
|
|
316
405
|
|
|
317
406
|
The invocation owner accepted cancellation.
|
|
@@ -1078,6 +1167,7 @@ type SandboxFailure =
|
|
|
1078
1167
|
| SourceInvalid
|
|
1079
1168
|
| GuestThrew
|
|
1080
1169
|
| DeadlineExceeded
|
|
1170
|
+
| SandboxBusy
|
|
1081
1171
|
| Cancelled
|
|
1082
1172
|
| DispatchLost
|
|
1083
1173
|
| SandboxCrashed
|
|
@@ -13,32 +13,34 @@
|
|
|
13
13
|
### sandboxGuestResultSchema
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
|
-
const sandboxGuestResultSchema:
|
|
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
|
-
|
|
16
|
+
const sandboxGuestResultSchema: ZodLazy<
|
|
17
|
+
ZodDiscriminatedUnion<
|
|
18
|
+
[
|
|
19
|
+
ZodObject<
|
|
20
|
+
{
|
|
21
|
+
ok: ZodLiteral<true>;
|
|
22
|
+
value: ZodUnknown;
|
|
23
|
+
},
|
|
24
|
+
$strict
|
|
25
|
+
>,
|
|
26
|
+
ZodObject<
|
|
27
|
+
{
|
|
28
|
+
ok: ZodLiteral<false>;
|
|
29
|
+
error: ZodObject<
|
|
30
|
+
{
|
|
31
|
+
kind: ZodLiteral<"guest_threw">;
|
|
32
|
+
name: ZodString;
|
|
33
|
+
message: ZodString;
|
|
34
|
+
transportMessage: ZodOptional<ZodString>;
|
|
35
|
+
},
|
|
36
|
+
$strict
|
|
37
|
+
>;
|
|
38
|
+
},
|
|
39
|
+
$strict
|
|
40
|
+
>,
|
|
41
|
+
],
|
|
42
|
+
"ok"
|
|
43
|
+
>
|
|
42
44
|
>;
|
|
43
45
|
```
|
|
44
46
|
|
|
@@ -49,7 +51,7 @@ Closed guest envelope: guest exceptions cannot masquerade as host failures.
|
|
|
49
51
|
### sandboxNamespaceSegmentSchema
|
|
50
52
|
|
|
51
53
|
```ts
|
|
52
|
-
const sandboxNamespaceSegmentSchema: ZodString
|
|
54
|
+
const sandboxNamespaceSegmentSchema: ZodLazy<ZodString>;
|
|
53
55
|
```
|
|
54
56
|
|
|
55
57
|
Parsed guest namespace segments; callbacks never cross this wire.
|
|
@@ -59,7 +61,7 @@ Parsed guest namespace segments; callbacks never cross this wire.
|
|
|
59
61
|
### sandboxTransportAliasSchema
|
|
60
62
|
|
|
61
63
|
```ts
|
|
62
|
-
const sandboxTransportAliasSchema: ZodString
|
|
64
|
+
const sandboxTransportAliasSchema: ZodLazy<ZodString>;
|
|
63
65
|
```
|
|
64
66
|
|
|
65
67
|
A transport alias is interpolated as a strict JavaScript binding identifier.
|
|
@@ -69,7 +71,9 @@ A transport alias is interpolated as a strict JavaScript binding identifier.
|
|
|
69
71
|
### sandboxNamespacePathsSchema
|
|
70
72
|
|
|
71
73
|
```ts
|
|
72
|
-
const sandboxNamespacePathsSchema:
|
|
74
|
+
const sandboxNamespacePathsSchema: ZodLazy<
|
|
75
|
+
ZodRecord<ZodLazy<ZodString>, ZodArray<ZodLazy<ZodString>>>
|
|
76
|
+
>;
|
|
73
77
|
```
|
|
74
78
|
|
|
75
79
|
Transport aliases mapped to their logical namespace paths.
|
|
@@ -79,7 +83,9 @@ Transport aliases mapped to their logical namespace paths.
|
|
|
79
83
|
### sandboxBindingNamesSchema
|
|
80
84
|
|
|
81
85
|
```ts
|
|
82
|
-
const sandboxBindingNamesSchema:
|
|
86
|
+
const sandboxBindingNamesSchema: ZodLazy<
|
|
87
|
+
ZodRecord<ZodLazy<ZodString>, ZodArray<ZodString>>
|
|
88
|
+
>;
|
|
83
89
|
```
|
|
84
90
|
|
|
85
91
|
Serializable flat transport table; operation keys may have any namespace depth.
|
package/docs/api/sandbox-wire.md
CHANGED
|
@@ -88,9 +88,9 @@ Convert one validated wire failure into the shared error channel.
|
|
|
88
88
|
|
|
89
89
|
#### Parameters
|
|
90
90
|
|
|
91
|
-
| Parameter | Type
|
|
92
|
-
| --------- |
|
|
93
|
-
| `error` | \| \{ `kind`: `"invalid_source"`; `line`: `number`; `column`: `number`; `excerpt`: `string`; \} \| \{ `kind`: `"guest_threw"`; `name`: `string`; `message`: `string`; `transportMessage?`: `string`; \} \| \{ `kind`: `"deadline_exceeded"`; `limitMs`: `number`; `elapsedMs`: `number`; \} \| \{ `kind`: `"result_not_json"`; `valueKind`: `string`; `rawCause`: `JSONType`; \} \| \{ `kind`: `"sandbox_crashed"`; `rawCause`: `JSONType`; \} \| \{ `kind`: `"bad_response"`; `reason`: `string`; `rawCause`: `JSONType`; \} \| \{ `kind`: `"dispatch_lost"`; `elapsedMs`: `number`; `transport`: `string`; `errno?`: `string`; `rawCause`: `JSONType`; \} \| \{ `kind`: `"cancelled"`; `by`: `"caller"` \| `"operator"`; \} \| \{ `kind`: `"result_too_large"`; `size`: `number`; \} \| \{ `kind`: `"capability_failed"`; `namespace`: `string`; `operation`: `string`; `cause`: \{ `kind`: `"Files"` \| `"Forage"` \| `"InvalidInput"` \| `"Unavailable"` \| `"OperationFailed"`; `message`: `string`; \}; `rawCause`: `JSONType`; \} \| \{ `kind`: `"unknown"`; `rawCause`: `JSONType`; \} |
|
|
91
|
+
| Parameter | Type |
|
|
92
|
+
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
93
|
+
| `error` | \| \{ `kind`: `"invalid_source"`; `line`: `number`; `column`: `number`; `excerpt`: `string`; \} \| \{ `kind`: `"guest_threw"`; `name`: `string`; `message`: `string`; `transportMessage?`: `string`; \} \| \{ `kind`: `"deadline_exceeded"`; `limitMs`: `number`; `elapsedMs`: `number`; \} \| \{ `kind`: `"sandbox_busy"`; `code`: `"sandbox-busy"`; `capacity`: `number`; `waitedMs`: `number`; \} \| \{ `kind`: `"result_not_json"`; `valueKind`: `string`; `rawCause`: `JSONType`; \} \| \{ `kind`: `"sandbox_crashed"`; `rawCause`: `JSONType`; \} \| \{ `kind`: `"bad_response"`; `reason`: `string`; `rawCause`: `JSONType`; \} \| \{ `kind`: `"dispatch_lost"`; `elapsedMs`: `number`; `transport`: `string`; `errno?`: `string`; `rawCause`: `JSONType`; \} \| \{ `kind`: `"cancelled"`; `by`: `"caller"` \| `"operator"`; \} \| \{ `kind`: `"result_too_large"`; `size`: `number`; \} \| \{ `kind`: `"capability_failed"`; `namespace`: `string`; `operation`: `string`; `cause`: \{ `kind`: `"Files"` \| `"Forage"` \| `"InvalidInput"` \| `"Unavailable"` \| `"OperationFailed"`; `message`: `string`; \}; `rawCause`: `JSONType`; \} \| \{ `kind`: `"unknown"`; `rawCause`: `JSONType`; \} |
|
|
94
94
|
|
|
95
95
|
#### Returns
|
|
96
96
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/mycelium",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"description": "Effect-native scoped capability lifecycle with a Zod-authored execute door",
|
|
6
6
|
"type": "module",
|
|
@@ -61,6 +61,10 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"imports": {
|
|
64
|
+
"#host-cores": {
|
|
65
|
+
"node": "./dist/internal/host-cores.node.js",
|
|
66
|
+
"default": "./dist/internal/host-cores.js"
|
|
67
|
+
},
|
|
64
68
|
"#build-identity": {
|
|
65
69
|
"node": "./dist/internal/build-identity.node.js",
|
|
66
70
|
"default": "./dist/internal/build-identity.js"
|
|
@@ -74,10 +78,10 @@
|
|
|
74
78
|
"THIRD_PARTY_NOTICES"
|
|
75
79
|
],
|
|
76
80
|
"dependencies": {
|
|
77
|
-
"@fungi.computer/cairn": "0.0
|
|
78
|
-
"@fungi.computer/forage": "0.
|
|
79
|
-
"@fungi.computer/mule": "0.
|
|
80
|
-
"@fungi.computer/puffball": "0.
|
|
81
|
+
"@fungi.computer/cairn": "0.1.0",
|
|
82
|
+
"@fungi.computer/forage": "0.2.0",
|
|
83
|
+
"@fungi.computer/mule": "0.1.1",
|
|
84
|
+
"@fungi.computer/puffball": "0.2.0",
|
|
81
85
|
"effect": "4.0.2",
|
|
82
86
|
"zod": "4.4.3",
|
|
83
87
|
"acorn": "8.18.0",
|