@fungi.computer/computer 0.14.4 → 0.14.6
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 +51 -1
- package/dist/team-candidate-builder.mjs +284 -17
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# Computer (`@fungi.computer/computer`)
|
|
2
2
|
|
|
3
|
+
A Fungi Computer is a workspace for AI agents: files that stay put, and a Linux
|
|
4
|
+
container to run commands in.
|
|
5
|
+
|
|
6
|
+
```mermaid
|
|
7
|
+
flowchart LR
|
|
8
|
+
Agent[Agent or App] -->|files, commands, ports| DO[ComputerDO]
|
|
9
|
+
DO --> Files[(Files in SQLite)]
|
|
10
|
+
DO -->|runs commands| Backend[Container or in-Worker shell]
|
|
11
|
+
Host[Oyster or the Hub] --> DO
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick start
|
|
15
|
+
|
|
16
|
+
Export the Computer from your Worker. It is the same line Oyster's standalone
|
|
17
|
+
host uses.
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
export { ComputerDO } from "@fungi.computer/computer";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The [Oyster README](https://github.com/fungi-computer/oyster) deploys the whole
|
|
24
|
+
thing, including the container.
|
|
25
|
+
|
|
26
|
+
## Common tasks
|
|
27
|
+
|
|
28
|
+
### Read and write files
|
|
29
|
+
|
|
30
|
+
Files belong to the workspace, not to a shell process. See
|
|
31
|
+
[Files and operation results](#files-and-operation-results).
|
|
32
|
+
|
|
33
|
+
### Run commands and expose ports
|
|
34
|
+
|
|
35
|
+
See [Processes, ports and lifetime](#processes-ports-and-lifetime).
|
|
36
|
+
|
|
37
|
+
### Pick where commands run
|
|
38
|
+
|
|
39
|
+
See [Choose an execution backend](#choose-an-execution-backend).
|
|
40
|
+
|
|
41
|
+
### Build the container image
|
|
42
|
+
|
|
43
|
+
See [Image and build inputs](#image-and-build-inputs).
|
|
44
|
+
|
|
45
|
+
## Reference
|
|
46
|
+
|
|
47
|
+
### Overview
|
|
48
|
+
|
|
3
49
|
A Fungi Computer is a durable workspace for Agents: files in SQLite inside a
|
|
4
50
|
Durable Object, with a Linux container or an in-Worker shell behind it to run
|
|
5
51
|
commands, processes and ports. Oyster's standalone host runs one; the Fungi Hub
|
|
@@ -165,7 +211,7 @@ egress data, plus opaque actor/invocation provenance. `checkComputerGrant`
|
|
|
165
211
|
returns `admitted` or `Refused`; grants impose no paid-usage budget. A caller's
|
|
166
212
|
per-command timeout remains a command parameter enforced by the operation
|
|
167
213
|
executor. Hub credit enforcement remains on its existing funded/unfunded
|
|
168
|
-
admission
|
|
214
|
+
admission path, which restates or stops a Computer when a Team's credit changes.
|
|
169
215
|
|
|
170
216
|
`createFleetBacking` accepts the maintained SQLite owner. Creation records a
|
|
171
217
|
plain backing decision once. Explicit fleet-default and Computer overrides
|
|
@@ -278,3 +324,7 @@ require a working local Docker/Workers environment. These commands do not deploy
|
|
|
278
324
|
a Hub, publish an App or replace a production Computer image.
|
|
279
325
|
|
|
280
326
|
MIT. See [`LICENSE`](LICENSE).
|
|
327
|
+
|
|
328
|
+
## Examples
|
|
329
|
+
|
|
330
|
+
The [Quick start](#quick-start) above is the maintained example.
|
|
@@ -952,7 +952,7 @@ var require_react_development = __commonJS({
|
|
|
952
952
|
}
|
|
953
953
|
return index.toString(36);
|
|
954
954
|
}
|
|
955
|
-
function mapIntoArray(children,
|
|
955
|
+
function mapIntoArray(children, array4, escapedPrefix, nameSoFar, callback3) {
|
|
956
956
|
var type2 = typeof children;
|
|
957
957
|
if (type2 === "undefined" || type2 === "boolean") {
|
|
958
958
|
children = null;
|
|
@@ -983,7 +983,7 @@ var require_react_development = __commonJS({
|
|
|
983
983
|
if (childKey != null) {
|
|
984
984
|
escapedChildKey = escapeUserProvidedKey(childKey) + "/";
|
|
985
985
|
}
|
|
986
|
-
mapIntoArray(mappedChild,
|
|
986
|
+
mapIntoArray(mappedChild, array4, escapedChildKey, "", function(c) {
|
|
987
987
|
return c;
|
|
988
988
|
});
|
|
989
989
|
} else if (mappedChild != null) {
|
|
@@ -1005,7 +1005,7 @@ var require_react_development = __commonJS({
|
|
|
1005
1005
|
) : "") + childKey
|
|
1006
1006
|
);
|
|
1007
1007
|
}
|
|
1008
|
-
|
|
1008
|
+
array4.push(mappedChild);
|
|
1009
1009
|
}
|
|
1010
1010
|
return 1;
|
|
1011
1011
|
}
|
|
@@ -1017,7 +1017,7 @@ var require_react_development = __commonJS({
|
|
|
1017
1017
|
for (var i2 = 0; i2 < children.length; i2++) {
|
|
1018
1018
|
child = children[i2];
|
|
1019
1019
|
nextName = nextNamePrefix + getElementKey(child, i2);
|
|
1020
|
-
subtreeCount += mapIntoArray(child,
|
|
1020
|
+
subtreeCount += mapIntoArray(child, array4, escapedPrefix, nextName, callback3);
|
|
1021
1021
|
}
|
|
1022
1022
|
} else {
|
|
1023
1023
|
var iteratorFn = getIteratorFn(children);
|
|
@@ -1037,7 +1037,7 @@ var require_react_development = __commonJS({
|
|
|
1037
1037
|
while (!(step = iterator.next()).done) {
|
|
1038
1038
|
child = step.value;
|
|
1039
1039
|
nextName = nextNamePrefix + getElementKey(child, ii++);
|
|
1040
|
-
subtreeCount += mapIntoArray(child,
|
|
1040
|
+
subtreeCount += mapIntoArray(child, array4, escapedPrefix, nextName, callback3);
|
|
1041
1041
|
}
|
|
1042
1042
|
} else if (type2 === "object") {
|
|
1043
1043
|
var childrenString = String(children);
|
|
@@ -14580,11 +14580,11 @@ function makeIsBetween(deriveOptions) {
|
|
|
14580
14580
|
});
|
|
14581
14581
|
};
|
|
14582
14582
|
}
|
|
14583
|
-
function encodeNumberPayload(
|
|
14584
|
-
if (!globalThis.Number.isFinite(
|
|
14585
|
-
throw new globalThis.RangeError(`Expected a finite number, got ${format(
|
|
14583
|
+
function encodeNumberPayload(number5) {
|
|
14584
|
+
if (!globalThis.Number.isFinite(number5)) {
|
|
14585
|
+
throw new globalThis.RangeError(`Expected a finite number, got ${format(number5)}`);
|
|
14586
14586
|
}
|
|
14587
|
-
return
|
|
14587
|
+
return number5;
|
|
14588
14588
|
}
|
|
14589
14589
|
var isGreaterThan2 = /* @__PURE__ */ makeIsGreaterThan({
|
|
14590
14590
|
order: Number2,
|
|
@@ -15090,8 +15090,8 @@ function getEnumValues(entries) {
|
|
|
15090
15090
|
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
15091
15091
|
return values;
|
|
15092
15092
|
}
|
|
15093
|
-
function joinValues(
|
|
15094
|
-
return
|
|
15093
|
+
function joinValues(array4, separator = "|") {
|
|
15094
|
+
return array4.map((val) => stringifyPrimitive(val)).join(separator);
|
|
15095
15095
|
}
|
|
15096
15096
|
function jsonStringifyReplacer(_, value) {
|
|
15097
15097
|
if (typeof value === "bigint")
|
|
@@ -15901,6 +15901,7 @@ var string3 = (params) => {
|
|
|
15901
15901
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
15902
15902
|
return new RegExp(`^${regex}$`);
|
|
15903
15903
|
};
|
|
15904
|
+
var integer = /^-?\d+$/;
|
|
15904
15905
|
var number3 = /^-?\d+(?:\.\d+)?$/;
|
|
15905
15906
|
var lowercase = /^[^A-Z]*$/;
|
|
15906
15907
|
var uppercase = /^[^a-z]*$/;
|
|
@@ -15912,6 +15913,146 @@ var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
|
15912
15913
|
inst._zod.def = def;
|
|
15913
15914
|
(_a3 = inst._zod).onattach ?? (_a3.onattach = []);
|
|
15914
15915
|
});
|
|
15916
|
+
var numericOriginMap = {
|
|
15917
|
+
number: "number",
|
|
15918
|
+
bigint: "bigint",
|
|
15919
|
+
object: "date"
|
|
15920
|
+
};
|
|
15921
|
+
var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
15922
|
+
$ZodCheck.init(inst, def);
|
|
15923
|
+
const origin = numericOriginMap[typeof def.value];
|
|
15924
|
+
inst._zod.onattach.push((inst2) => {
|
|
15925
|
+
const bag = inst2._zod.bag;
|
|
15926
|
+
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
15927
|
+
if (def.value < curr) {
|
|
15928
|
+
if (def.inclusive)
|
|
15929
|
+
bag.maximum = def.value;
|
|
15930
|
+
else
|
|
15931
|
+
bag.exclusiveMaximum = def.value;
|
|
15932
|
+
}
|
|
15933
|
+
});
|
|
15934
|
+
inst._zod.check = (payload) => {
|
|
15935
|
+
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
|
|
15936
|
+
return;
|
|
15937
|
+
}
|
|
15938
|
+
payload.issues.push({
|
|
15939
|
+
origin,
|
|
15940
|
+
code: "too_big",
|
|
15941
|
+
maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
15942
|
+
input: payload.value,
|
|
15943
|
+
inclusive: def.inclusive,
|
|
15944
|
+
inst,
|
|
15945
|
+
continue: !def.abort
|
|
15946
|
+
});
|
|
15947
|
+
};
|
|
15948
|
+
});
|
|
15949
|
+
var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
15950
|
+
$ZodCheck.init(inst, def);
|
|
15951
|
+
const origin = numericOriginMap[typeof def.value];
|
|
15952
|
+
inst._zod.onattach.push((inst2) => {
|
|
15953
|
+
const bag = inst2._zod.bag;
|
|
15954
|
+
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
15955
|
+
if (def.value > curr) {
|
|
15956
|
+
if (def.inclusive)
|
|
15957
|
+
bag.minimum = def.value;
|
|
15958
|
+
else
|
|
15959
|
+
bag.exclusiveMinimum = def.value;
|
|
15960
|
+
}
|
|
15961
|
+
});
|
|
15962
|
+
inst._zod.check = (payload) => {
|
|
15963
|
+
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
|
|
15964
|
+
return;
|
|
15965
|
+
}
|
|
15966
|
+
payload.issues.push({
|
|
15967
|
+
origin,
|
|
15968
|
+
code: "too_small",
|
|
15969
|
+
minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
15970
|
+
input: payload.value,
|
|
15971
|
+
inclusive: def.inclusive,
|
|
15972
|
+
inst,
|
|
15973
|
+
continue: !def.abort
|
|
15974
|
+
});
|
|
15975
|
+
};
|
|
15976
|
+
});
|
|
15977
|
+
var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => {
|
|
15978
|
+
$ZodCheck.init(inst, def);
|
|
15979
|
+
def.format = def.format || "float64";
|
|
15980
|
+
const isInt2 = def.format?.includes("int");
|
|
15981
|
+
const origin = isInt2 ? "int" : "number";
|
|
15982
|
+
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
15983
|
+
inst._zod.onattach.push((inst2) => {
|
|
15984
|
+
const bag = inst2._zod.bag;
|
|
15985
|
+
bag.format = def.format;
|
|
15986
|
+
bag.minimum = minimum;
|
|
15987
|
+
bag.maximum = maximum;
|
|
15988
|
+
if (isInt2)
|
|
15989
|
+
bag.pattern = integer;
|
|
15990
|
+
});
|
|
15991
|
+
inst._zod.check = (payload) => {
|
|
15992
|
+
const input = payload.value;
|
|
15993
|
+
if (isInt2) {
|
|
15994
|
+
if (!Number.isInteger(input)) {
|
|
15995
|
+
payload.issues.push({
|
|
15996
|
+
expected: origin,
|
|
15997
|
+
format: def.format,
|
|
15998
|
+
code: "invalid_type",
|
|
15999
|
+
continue: false,
|
|
16000
|
+
input,
|
|
16001
|
+
inst
|
|
16002
|
+
});
|
|
16003
|
+
return;
|
|
16004
|
+
}
|
|
16005
|
+
if (!Number.isSafeInteger(input)) {
|
|
16006
|
+
if (input > 0) {
|
|
16007
|
+
payload.issues.push({
|
|
16008
|
+
input,
|
|
16009
|
+
code: "too_big",
|
|
16010
|
+
maximum: Number.MAX_SAFE_INTEGER,
|
|
16011
|
+
note: "Integers must be within the safe integer range.",
|
|
16012
|
+
inst,
|
|
16013
|
+
origin,
|
|
16014
|
+
inclusive: true,
|
|
16015
|
+
continue: !def.abort
|
|
16016
|
+
});
|
|
16017
|
+
} else {
|
|
16018
|
+
payload.issues.push({
|
|
16019
|
+
input,
|
|
16020
|
+
code: "too_small",
|
|
16021
|
+
minimum: Number.MIN_SAFE_INTEGER,
|
|
16022
|
+
note: "Integers must be within the safe integer range.",
|
|
16023
|
+
inst,
|
|
16024
|
+
origin,
|
|
16025
|
+
inclusive: true,
|
|
16026
|
+
continue: !def.abort
|
|
16027
|
+
});
|
|
16028
|
+
}
|
|
16029
|
+
return;
|
|
16030
|
+
}
|
|
16031
|
+
}
|
|
16032
|
+
if (input < minimum) {
|
|
16033
|
+
payload.issues.push({
|
|
16034
|
+
origin: "number",
|
|
16035
|
+
input,
|
|
16036
|
+
code: "too_small",
|
|
16037
|
+
minimum,
|
|
16038
|
+
inclusive: true,
|
|
16039
|
+
inst,
|
|
16040
|
+
continue: !def.abort
|
|
16041
|
+
});
|
|
16042
|
+
}
|
|
16043
|
+
if (input > maximum) {
|
|
16044
|
+
payload.issues.push({
|
|
16045
|
+
origin: "number",
|
|
16046
|
+
input,
|
|
16047
|
+
code: "too_big",
|
|
16048
|
+
maximum,
|
|
16049
|
+
inclusive: true,
|
|
16050
|
+
inst,
|
|
16051
|
+
continue: !def.abort
|
|
16052
|
+
});
|
|
16053
|
+
}
|
|
16054
|
+
};
|
|
16055
|
+
});
|
|
15915
16056
|
var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
15916
16057
|
var _a3;
|
|
15917
16058
|
$ZodCheck.init(inst, def);
|
|
@@ -16594,6 +16735,34 @@ var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
|
|
|
16594
16735
|
});
|
|
16595
16736
|
};
|
|
16596
16737
|
});
|
|
16738
|
+
var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
16739
|
+
$ZodType.init(inst, def);
|
|
16740
|
+
inst._zod.pattern = inst._zod.bag.pattern ?? number3;
|
|
16741
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
16742
|
+
if (def.coerce)
|
|
16743
|
+
try {
|
|
16744
|
+
payload.value = Number(payload.value);
|
|
16745
|
+
} catch (_) {
|
|
16746
|
+
}
|
|
16747
|
+
const input = payload.value;
|
|
16748
|
+
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
|
|
16749
|
+
return payload;
|
|
16750
|
+
}
|
|
16751
|
+
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
|
|
16752
|
+
payload.issues.push({
|
|
16753
|
+
expected: "number",
|
|
16754
|
+
code: "invalid_type",
|
|
16755
|
+
input,
|
|
16756
|
+
inst,
|
|
16757
|
+
...received ? { received } : {}
|
|
16758
|
+
});
|
|
16759
|
+
return payload;
|
|
16760
|
+
};
|
|
16761
|
+
});
|
|
16762
|
+
var $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, def) => {
|
|
16763
|
+
$ZodCheckNumberFormat.init(inst, def);
|
|
16764
|
+
$ZodNumber.init(inst, def);
|
|
16765
|
+
});
|
|
16597
16766
|
var $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
|
|
16598
16767
|
$ZodType.init(inst, def);
|
|
16599
16768
|
inst._zod.parse = (payload) => payload;
|
|
@@ -18220,6 +18389,24 @@ function _isoDuration(Class5, params) {
|
|
|
18220
18389
|
});
|
|
18221
18390
|
}
|
|
18222
18391
|
// @__NO_SIDE_EFFECTS__
|
|
18392
|
+
function _number(Class5, params) {
|
|
18393
|
+
return new Class5({
|
|
18394
|
+
type: "number",
|
|
18395
|
+
checks: [],
|
|
18396
|
+
...normalizeParams(params)
|
|
18397
|
+
});
|
|
18398
|
+
}
|
|
18399
|
+
// @__NO_SIDE_EFFECTS__
|
|
18400
|
+
function _int(Class5, params) {
|
|
18401
|
+
return new Class5({
|
|
18402
|
+
type: "number",
|
|
18403
|
+
check: "number_format",
|
|
18404
|
+
abort: false,
|
|
18405
|
+
format: "safeint",
|
|
18406
|
+
...normalizeParams(params)
|
|
18407
|
+
});
|
|
18408
|
+
}
|
|
18409
|
+
// @__NO_SIDE_EFFECTS__
|
|
18223
18410
|
function _unknown(Class5) {
|
|
18224
18411
|
return new Class5({
|
|
18225
18412
|
type: "unknown"
|
|
@@ -18233,6 +18420,28 @@ function _never(Class5, params) {
|
|
|
18233
18420
|
});
|
|
18234
18421
|
}
|
|
18235
18422
|
// @__NO_SIDE_EFFECTS__
|
|
18423
|
+
function _lte(value, params) {
|
|
18424
|
+
return new $ZodCheckLessThan({
|
|
18425
|
+
check: "less_than",
|
|
18426
|
+
...normalizeParams(params),
|
|
18427
|
+
value,
|
|
18428
|
+
inclusive: true
|
|
18429
|
+
});
|
|
18430
|
+
}
|
|
18431
|
+
// @__NO_SIDE_EFFECTS__
|
|
18432
|
+
function _gt(value, params) {
|
|
18433
|
+
return new $ZodCheckGreaterThan({
|
|
18434
|
+
check: "greater_than",
|
|
18435
|
+
...normalizeParams(params),
|
|
18436
|
+
value,
|
|
18437
|
+
inclusive: false
|
|
18438
|
+
});
|
|
18439
|
+
}
|
|
18440
|
+
// @__NO_SIDE_EFFECTS__
|
|
18441
|
+
function _positive(params) {
|
|
18442
|
+
return /* @__PURE__ */ _gt(0, params);
|
|
18443
|
+
}
|
|
18444
|
+
// @__NO_SIDE_EFFECTS__
|
|
18236
18445
|
function _maxLength(maximum, params) {
|
|
18237
18446
|
const ch = new $ZodCheckMaxLength({
|
|
18238
18447
|
check: "max_length",
|
|
@@ -20032,6 +20241,22 @@ var ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) =>
|
|
|
20032
20241
|
function string5(params) {
|
|
20033
20242
|
return _string(ZodMiniString, params);
|
|
20034
20243
|
}
|
|
20244
|
+
var ZodMiniNumber = /* @__PURE__ */ $constructor("ZodMiniNumber", (inst, def) => {
|
|
20245
|
+
$ZodNumber.init(inst, def);
|
|
20246
|
+
ZodMiniType.init(inst, def);
|
|
20247
|
+
});
|
|
20248
|
+
// @__NO_SIDE_EFFECTS__
|
|
20249
|
+
function number4(params) {
|
|
20250
|
+
return _number(ZodMiniNumber, params);
|
|
20251
|
+
}
|
|
20252
|
+
var ZodMiniNumberFormat = /* @__PURE__ */ $constructor("ZodMiniNumberFormat", (inst, def) => {
|
|
20253
|
+
$ZodNumberFormat.init(inst, def);
|
|
20254
|
+
ZodMiniNumber.init(inst, def);
|
|
20255
|
+
});
|
|
20256
|
+
// @__NO_SIDE_EFFECTS__
|
|
20257
|
+
function int(params) {
|
|
20258
|
+
return _int(ZodMiniNumberFormat, params);
|
|
20259
|
+
}
|
|
20035
20260
|
var ZodMiniNever = /* @__PURE__ */ $constructor("ZodMiniNever", (inst, def) => {
|
|
20036
20261
|
$ZodNever.init(inst, def);
|
|
20037
20262
|
ZodMiniType.init(inst, def);
|
|
@@ -20040,6 +20265,18 @@ var ZodMiniNever = /* @__PURE__ */ $constructor("ZodMiniNever", (inst, def) => {
|
|
|
20040
20265
|
function never4(params) {
|
|
20041
20266
|
return _never(ZodMiniNever, params);
|
|
20042
20267
|
}
|
|
20268
|
+
var ZodMiniArray = /* @__PURE__ */ $constructor("ZodMiniArray", (inst, def) => {
|
|
20269
|
+
$ZodArray.init(inst, def);
|
|
20270
|
+
ZodMiniType.init(inst, def);
|
|
20271
|
+
});
|
|
20272
|
+
// @__NO_SIDE_EFFECTS__
|
|
20273
|
+
function array3(element, params) {
|
|
20274
|
+
return new ZodMiniArray({
|
|
20275
|
+
type: "array",
|
|
20276
|
+
element,
|
|
20277
|
+
...normalizeParams(params)
|
|
20278
|
+
});
|
|
20279
|
+
}
|
|
20043
20280
|
var ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
20044
20281
|
$ZodObject.init(inst, def);
|
|
20045
20282
|
ZodMiniType.init(inst, def);
|
|
@@ -20148,6 +20385,7 @@ var appApiReservedMethodNames = Object.freeze({
|
|
|
20148
20385
|
"onGitPush",
|
|
20149
20386
|
"syncRefused",
|
|
20150
20387
|
"authorizeGitPush",
|
|
20388
|
+
"onRegion",
|
|
20151
20389
|
"fetch",
|
|
20152
20390
|
"alarm",
|
|
20153
20391
|
"queue",
|
|
@@ -20238,6 +20476,31 @@ function validateCaller(context3) {
|
|
|
20238
20476
|
return context3;
|
|
20239
20477
|
}
|
|
20240
20478
|
var isAppApiMethodName = (name) => name.length <= 80 && /^[A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z][A-Za-z0-9_]*)*$/.test(name) && !Object.values(appApiReservedMethodNames).flat().some((reserved) => reserved === name);
|
|
20479
|
+
var maxAppRegionMessageBytes = 65536;
|
|
20480
|
+
var maxAppRegionReplyBytes = 1048576;
|
|
20481
|
+
var utf8Bytes = (data) => new TextEncoder().encode(data).byteLength;
|
|
20482
|
+
var regionConnection = string5().check(_minLength(1), _maxLength(64));
|
|
20483
|
+
var regionData = string5().check(refine3((data) => utf8Bytes(data) <= maxAppRegionMessageBytes));
|
|
20484
|
+
var appRegionEventSchema = discriminatedUnion("kind", [
|
|
20485
|
+
strictObject({
|
|
20486
|
+
kind: literal2("connect"),
|
|
20487
|
+
connection: regionConnection,
|
|
20488
|
+
caller: appMethodCallerSchema
|
|
20489
|
+
}),
|
|
20490
|
+
strictObject({
|
|
20491
|
+
kind: literal2("message"),
|
|
20492
|
+
connection: regionConnection,
|
|
20493
|
+
data: regionData
|
|
20494
|
+
}),
|
|
20495
|
+
strictObject({ kind: literal2("close"), connection: regionConnection }),
|
|
20496
|
+
strictObject({ kind: literal2("alarm") })
|
|
20497
|
+
]);
|
|
20498
|
+
var appRegionReplySchema = strictObject({
|
|
20499
|
+
send: optional4(array3(strictObject({ connection: regionConnection, data: regionData })).check(_maxLength(256), refine3((sends) => sends.reduce((total, { data }) => total + utf8Bytes(data), 0) <= maxAppRegionReplyBytes))),
|
|
20500
|
+
close: optional4(array3(regionConnection).check(_maxLength(256))),
|
|
20501
|
+
/** The App's next wake; null clears it, absent keeps it. */
|
|
20502
|
+
wakeAt: optional4(nullable2(number4().check(int(), _positive(), _lte(Number.MAX_SAFE_INTEGER))))
|
|
20503
|
+
});
|
|
20241
20504
|
|
|
20242
20505
|
// ../puffball/dist/app-method-context.js
|
|
20243
20506
|
var appMethodCallContextSchema = declareConstructor()([], () => (value, ast, options) => try_2({
|
|
@@ -21338,7 +21601,7 @@ var verifiedAppArtifactReferenceSchema = Struct({
|
|
|
21338
21601
|
});
|
|
21339
21602
|
var verifiedBackendProfileSchema = Struct({
|
|
21340
21603
|
runtime: Struct({
|
|
21341
|
-
kind:
|
|
21604
|
+
kind: Literals(["durable-facet", "region"]),
|
|
21342
21605
|
stateSchema: Number5.pipe(check(isInt()), check(isGreaterThan2(0)))
|
|
21343
21606
|
}),
|
|
21344
21607
|
compatibilityDate: String4.pipe(check(isPattern2(/^\d{4}-\d{2}-\d{2}$/))),
|
|
@@ -21595,9 +21858,13 @@ var appBuildSchema = Union2([
|
|
|
21595
21858
|
var appBuildJsonSchema = fromJsonString2(appBuildSchema);
|
|
21596
21859
|
|
|
21597
21860
|
// ../puffball/dist/backend.js
|
|
21861
|
+
var appBackendRuntimeKindSchema = Literals([
|
|
21862
|
+
"durable-facet",
|
|
21863
|
+
"region"
|
|
21864
|
+
]);
|
|
21598
21865
|
var durableBackendSchema = Struct({
|
|
21599
21866
|
runtime: Struct({
|
|
21600
|
-
kind:
|
|
21867
|
+
kind: appBackendRuntimeKindSchema,
|
|
21601
21868
|
stateSchema: Number5.pipe(check(isInt()), check(isGreaterThan2(0)))
|
|
21602
21869
|
}),
|
|
21603
21870
|
compatibilityDate: String4.pipe(check(isPattern2(/^\d{4}-\d{2}-\d{2}$/))),
|
|
@@ -32511,8 +32778,8 @@ function repeat(string6, count2) {
|
|
|
32511
32778
|
}
|
|
32512
32779
|
return result2;
|
|
32513
32780
|
}
|
|
32514
|
-
function isNegativeZero(
|
|
32515
|
-
return
|
|
32781
|
+
function isNegativeZero(number5) {
|
|
32782
|
+
return number5 === 0 && Number.NEGATIVE_INFINITY === 1 / number5;
|
|
32516
32783
|
}
|
|
32517
32784
|
var isNothing_1 = isNothing;
|
|
32518
32785
|
var isObject_1 = isObject3;
|
|
@@ -32940,7 +33207,7 @@ function constructYamlInteger(data) {
|
|
|
32940
33207
|
function isInteger(object3) {
|
|
32941
33208
|
return Object.prototype.toString.call(object3) === "[object Number]" && (object3 % 1 === 0 && !common.isNegativeZero(object3));
|
|
32942
33209
|
}
|
|
32943
|
-
var
|
|
33210
|
+
var int2 = new type("tag:yaml.org,2002:int", {
|
|
32944
33211
|
kind: "scalar",
|
|
32945
33212
|
resolve: resolveYamlInteger,
|
|
32946
33213
|
construct: constructYamlInteger,
|
|
@@ -33046,7 +33313,7 @@ var json = failsafe.extend({
|
|
|
33046
33313
|
implicit: [
|
|
33047
33314
|
_null3,
|
|
33048
33315
|
bool,
|
|
33049
|
-
|
|
33316
|
+
int2,
|
|
33050
33317
|
float
|
|
33051
33318
|
]
|
|
33052
33319
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/computer",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.6",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"description": "Cloudflare Computer host for one durable Fungi Computer",
|
|
6
6
|
"type": "module",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"@fungi.computer/capnweb": "0.12.0-fungi.0",
|
|
65
65
|
"@fungi.computer/cloudflare-computer": "0.2.1-fungi.2",
|
|
66
66
|
"@fungi.computer/cordyceps": "0.4.3",
|
|
67
|
-
"@fungi.computer/knapsack": "0.4.
|
|
67
|
+
"@fungi.computer/knapsack": "0.4.19",
|
|
68
68
|
"@fungi.computer/seam": "0.2.6",
|
|
69
69
|
"@fungi.computer/watchdog": "0.1.4",
|
|
70
|
-
"@fungi.computer/computer-contract": "0.5.
|
|
70
|
+
"@fungi.computer/computer-contract": "0.5.6",
|
|
71
71
|
"effect": "4.0.2",
|
|
72
72
|
"just-bash": "3.4.2",
|
|
73
73
|
"zod": "4.4.3",
|