@fungi.computer/oyster 0.37.1 → 0.38.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.
Files changed (86) hide show
  1. package/README.md +5 -4
  2. package/dist/agents.js +9 -2
  3. package/dist/app-builds.d.ts +1 -1
  4. package/dist/app-region.d.ts +94 -0
  5. package/dist/app-region.js +316 -0
  6. package/dist/authorization.d.ts +58 -9
  7. package/dist/authorization.js +56 -11
  8. package/dist/boot-host-script.js +1 -1
  9. package/dist/build/candidate-builder.d.ts +1 -1
  10. package/dist/build/candidate-cli.mjs +284 -17
  11. package/dist/build/effect.d.ts +3 -3
  12. package/dist/build/submission-contract.d.ts +1 -1
  13. package/dist/build/workspace-build.d.ts +2 -2
  14. package/dist/channels/discord-replies.d.ts +8 -1
  15. package/dist/channels/discord-replies.js +80 -29
  16. package/dist/cloudflare.d.ts +1 -0
  17. package/dist/cloudflare.js +11 -0
  18. package/dist/credential-migration-001.d.ts +14 -0
  19. package/dist/credential-migration-001.js +13 -0
  20. package/dist/credential-migration-002.d.ts +38 -0
  21. package/dist/credential-migration-002.js +74 -0
  22. package/dist/embed-metafiles.js +2 -2
  23. package/dist/embed-scripts.js +1 -1
  24. package/dist/host.d.ts +2 -0
  25. package/dist/host.js +20 -1
  26. package/dist/index.d.ts +15 -1
  27. package/dist/index.js +19 -0
  28. package/dist/invocation.d.ts +165 -0
  29. package/dist/invocation.js +67 -0
  30. package/dist/keys.d.ts +4 -3
  31. package/dist/keys.js +5 -4
  32. package/dist/mcp-owner.d.ts +4 -3
  33. package/dist/mcp-owner.js +3 -2
  34. package/dist/page/mount.js +5 -1
  35. package/dist/page/region.d.ts +6 -0
  36. package/dist/page/region.js +12 -0
  37. package/dist/page-config.d.ts +2 -0
  38. package/dist/page-config.js +2 -0
  39. package/dist/page-script.js +3 -3
  40. package/dist/source/seed-receipt.d.ts +1 -1
  41. package/dist/source/template-seed.d.ts +1 -1
  42. package/dist/standalone/agent-connections.d.ts +49 -1
  43. package/dist/standalone/agent-connections.js +101 -12
  44. package/dist/standalone/agent-self.js +2 -1
  45. package/dist/standalone/agents.d.ts +7 -3
  46. package/dist/standalone/agents.js +42 -19
  47. package/dist/standalone/computer-fleet.d.ts +12 -6
  48. package/dist/standalone/computer-fleet.js +70 -29
  49. package/dist/standalone/computer.js +39 -14
  50. package/dist/standalone/instance.d.ts +3 -1
  51. package/dist/standalone/instance.js +8 -0
  52. package/dist/standalone/model-key-vault.d.ts +33 -4
  53. package/dist/standalone/model-key-vault.js +74 -17
  54. package/dist/standalone/preview.js +11 -10
  55. package/dist/standalone/try-cli.d.ts +12 -2
  56. package/dist/standalone/try-cli.js +170 -32
  57. package/dist/standalone/try-worker.d.ts +2 -0
  58. package/dist/standalone/try-worker.js +15 -0
  59. package/dist/standalone/worker.js +3 -3
  60. package/dist/standalone/workflow-host.d.ts +1 -1
  61. package/dist/standalone/workflows.d.ts +3 -3
  62. package/dist/standalone/workflows.js +7 -0
  63. package/dist/testing/capabilities.d.ts +2 -0
  64. package/dist/testing/capabilities.js +2 -0
  65. package/dist/webhook-custody.d.ts +14 -3
  66. package/dist/webhook-custody.js +165 -43
  67. package/dist/webhooks.d.ts +1 -1
  68. package/dist/webhooks.js +15 -3
  69. package/dist/workers-git.d.ts +24 -8
  70. package/dist/workers-git.js +105 -15
  71. package/dist/workers.d.ts +16 -0
  72. package/dist/workers.js +95 -5
  73. package/docs/api/apps.md +31 -31
  74. package/docs/api/authorization.md +119 -17
  75. package/docs/api/build-contract.md +8 -8
  76. package/docs/api/build.md +163 -174
  77. package/docs/api/cloudflare.md +171 -0
  78. package/docs/api/host.md +1 -0
  79. package/docs/api/index.md +23 -0
  80. package/docs/api/invocation.md +623 -23
  81. package/docs/api/keys.md +6 -6
  82. package/docs/api/pack.md +3 -3
  83. package/docs/api/page/mount.md +22 -20
  84. package/docs/api/workers-git.md +273 -157
  85. package/docs/api/workers.md +257 -175
  86. package/package.json +19 -18
@@ -27,7 +27,7 @@ export declare const teamCandidateConfigurationSchema: Schema.Struct<{
27
27
  readonly backend: Schema.Union<readonly [Schema.Null, Schema.Struct<{
28
28
  readonly entry: Schema.optional<Schema.String>;
29
29
  readonly runtime: Schema.Struct<{
30
- readonly kind: Schema.Literal<"durable-facet">;
30
+ readonly kind: Schema.Literals<readonly ["durable-facet", "region"]>;
31
31
  readonly stateSchema: Schema.Number;
32
32
  }>;
33
33
  readonly compatibilityDate: Schema.String;
@@ -952,7 +952,7 @@ var require_react_development = __commonJS({
952
952
  }
953
953
  return index.toString(36);
954
954
  }
955
- function mapIntoArray(children, array3, escapedPrefix, nameSoFar, callback3) {
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, array3, escapedChildKey, "", function(c) {
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
- array3.push(mappedChild);
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, array3, escapedPrefix, nextName, callback3);
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, array3, escapedPrefix, nextName, callback3);
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(number4) {
14584
- if (!globalThis.Number.isFinite(number4)) {
14585
- throw new globalThis.RangeError(`Expected a finite number, got ${format(number4)}`);
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 number4;
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(array3, separator = "|") {
15094
- return array3.map((val) => stringifyPrimitive(val)).join(separator);
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: Literal2("durable-facet"),
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: Literal2("durable-facet"),
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(number4) {
32515
- return number4 === 0 && Number.NEGATIVE_INFINITY === 1 / number4;
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 int = new type("tag:yaml.org,2002:int", {
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
- int,
33316
+ int2,
33050
33317
  float
33051
33318
  ]
33052
33319
  });
@@ -18,7 +18,7 @@ export declare const pinnedRecipeSchema: Schema.Struct<{
18
18
  readonly backend: Schema.Union<readonly [Schema.Null, Schema.Struct<{
19
19
  readonly entry: Schema.optional<Schema.String>;
20
20
  readonly runtime: Schema.Struct<{
21
- readonly kind: Schema.Literal<"durable-facet">;
21
+ readonly kind: Schema.Literals<readonly ["durable-facet", "region"]>;
22
22
  readonly stateSchema: Schema.Number;
23
23
  }>;
24
24
  readonly compatibilityDate: Schema.String;
@@ -42,7 +42,7 @@ export declare const AppPublisherCoreConfigSchema: Schema.Struct<{
42
42
  readonly backend: Schema.Union<readonly [Schema.Null, Schema.Struct<{
43
43
  readonly entry: Schema.optional<Schema.String>;
44
44
  readonly runtime: Schema.Struct<{
45
- readonly kind: Schema.Literal<"durable-facet">;
45
+ readonly kind: Schema.Literals<readonly ["durable-facet", "region"]>;
46
46
  readonly stateSchema: Schema.Number;
47
47
  }>;
48
48
  readonly compatibilityDate: Schema.String;
@@ -74,7 +74,7 @@ export declare const capturedPinnedRecipeSchema: Schema.Struct<{
74
74
  readonly backend: Schema.Union<readonly [Schema.Null, Schema.Struct<{
75
75
  readonly entry: Schema.optional<Schema.String>;
76
76
  readonly runtime: Schema.Struct<{
77
- readonly kind: Schema.Literal<"durable-facet">;
77
+ readonly kind: Schema.Literals<readonly ["durable-facet", "region"]>;
78
78
  readonly stateSchema: Schema.Number;
79
79
  }>;
80
80
  readonly compatibilityDate: Schema.String;
@@ -819,7 +819,7 @@ export declare function candidateManifestObjects(output: CandidateOutputManifest
819
819
  /** Decode a stored backend descriptor; a manifest's backend must be one. */
820
820
  export declare function decodeCandidateBackend(bytes: Uint8Array): {
821
821
  readonly runtime: {
822
- readonly kind: "durable-facet";
822
+ readonly kind: "durable-facet" | "region";
823
823
  readonly stateSchema: number;
824
824
  };
825
825
  readonly compatibilityDate: string;
@@ -19,7 +19,7 @@ export declare const workspaceBuildPolicySchema: Schema.Struct<{
19
19
  readonly backend: Schema.optional<Schema.Union<readonly [Schema.Null, Schema.Struct<{
20
20
  readonly entry: Schema.optional<Schema.String>;
21
21
  readonly runtime: Schema.Struct<{
22
- readonly kind: Schema.Literal<"durable-facet">;
22
+ readonly kind: Schema.Literals<readonly ["durable-facet", "region"]>;
23
23
  readonly stateSchema: Schema.Number;
24
24
  }>;
25
25
  readonly compatibilityDate: Schema.String;
@@ -55,7 +55,7 @@ export declare function readBuildManifest(packageJson: string): {
55
55
  readonly kind?: "bundled-html" | "source-html" | undefined;
56
56
  readonly backend?: {
57
57
  readonly runtime: {
58
- readonly kind: "durable-facet";
58
+ readonly kind: "durable-facet" | "region";
59
59
  readonly stateSchema: number;
60
60
  };
61
61
  readonly compatibilityDate: string;
@@ -1,5 +1,6 @@
1
1
  import type { DiscordAsk } from "./discord-interactions.js";
2
2
  import type { ConversationSql } from "./conversations.js";
3
+ import type { SealedTable002, SecretSealer } from "../credential-migration-002.js";
3
4
  /** What one delivery attempt found. */
4
5
  export type DiscordDelivery =
5
6
  /** The answer, or a refusal, reached Discord; the debt is paid. */
@@ -35,10 +36,16 @@ export type DiscordClosedReply = Readonly<{
35
36
  state: "expired" | "failed";
36
37
  closedAt: number;
37
38
  }>;
39
+ /** Migration 002's step: an open row's token is sealed; a closed row holds none. */
40
+ export declare const discordReplies002: SealedTable002;
38
41
  /** The pending-reply store and the host work that pays it off. */
39
42
  export declare function createDiscordReplies(options: Readonly<{
40
43
  sql: ConversationSql;
41
44
  now: () => number;
45
+ /** Absent without a configured keyring: recording and delivery refuse. */
46
+ sealer: SecretSealer | undefined;
47
+ /** The host's migration 002; it runs before any row is read or written. */
48
+ ready: () => Promise<void>;
42
49
  /** One delivery attempt; it may itself call `attach`. */
43
50
  deliver: (reply: DiscordPendingReply & Readonly<{
44
51
  interactionId: string;
@@ -46,7 +53,7 @@ export declare function createDiscordReplies(options: Readonly<{
46
53
  onExpired: (interactionId: string) => void;
47
54
  }>): {
48
55
  /** Owe one reply. A second record of the same interaction is the first. */
49
- record: (bindingId: string, ask: DiscordAsk) => void;
56
+ record: (bindingId: string, ask: DiscordAsk) => Promise<void>;
50
57
  /** The member has been told the run is still going. */
51
58
  markStillWorking: (interactionId: string) => void;
52
59
  /** Discord no longer knows the token: only the channel reaches the member now. */