@finalai/agent-definition 0.5.1 → 0.6.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 (90) hide show
  1. package/HOSTING.md +4 -4
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/compiler-assets/{chunk-FU5VHNO4.ts → chunk-3R7MNW5L.ts} +1 -1
  4. package/dist/compiler-assets/{chunk-7KPWSOMK.ts → chunk-3SDZJK7K.ts} +1 -1
  5. package/dist/compiler-assets/{chunk-KTXTYIF4.ts → chunk-4A4EQHYK.ts} +57 -20
  6. package/dist/compiler-assets/{chunk-LZSLGWS7.ts → chunk-4MJF3ALN.ts} +5 -5
  7. package/dist/compiler-assets/{chunk-QVHDGZAN.ts → chunk-4T2URCJZ.ts} +2 -2
  8. package/dist/compiler-assets/{chunk-7MDGEPFT.ts → chunk-6K3WO73F.ts} +1 -1
  9. package/dist/compiler-assets/{chunk-KMBQVNAJ.ts → chunk-AMYJRTAC.ts} +3 -3
  10. package/dist/compiler-assets/{chunk-4T2XPIPH.ts → chunk-BHNF7BEJ.ts} +86 -17
  11. package/dist/compiler-assets/{chunk-U3MFLFVF.ts → chunk-CORCFNEY.ts} +3 -3
  12. package/dist/compiler-assets/{chunk-4ERFBLH7.ts → chunk-DRHDNSCQ.ts} +4 -4
  13. package/dist/compiler-assets/{chunk-O3JKMLDP.ts → chunk-EKR4AEM5.ts} +3 -3
  14. package/dist/compiler-assets/{chunk-MBX6PIN7.ts → chunk-FE7PIPSW.ts} +57 -10
  15. package/dist/compiler-assets/{chunk-YEKSPL76.ts → chunk-FFI2K5IJ.ts} +4 -4
  16. package/dist/compiler-assets/{chunk-36MVFRMA.ts → chunk-IZJMGIAH.ts} +2 -2
  17. package/dist/compiler-assets/{chunk-KTBNDKGJ.ts → chunk-JZTF36V2.ts} +2 -1
  18. package/dist/compiler-assets/{chunk-XJNO7EHQ.ts → chunk-KNYB36DW.ts} +2 -2
  19. package/dist/compiler-assets/{chunk-O2JWY454.ts → chunk-L7YJCQVB.ts} +4 -4
  20. package/dist/compiler-assets/{chunk-WJPAUIVM.ts → chunk-LGGJ6S3U.ts} +1 -1
  21. package/dist/compiler-assets/{chunk-BMX2HP6G.ts → chunk-LIRONA4O.ts} +6 -6
  22. package/dist/compiler-assets/{chunk-GIRUQ7QF.ts → chunk-MM4JCZSK.ts} +7 -7
  23. package/dist/compiler-assets/{chunk-VI5WBWUX.ts → chunk-MPZMRU56.ts} +4 -4
  24. package/dist/compiler-assets/chunk-PLQKTBKO.ts +27 -0
  25. package/dist/compiler-assets/{chunk-EAEQQT33.ts → chunk-Q26ZPNVB.ts} +25 -9
  26. package/dist/compiler-assets/{chunk-Z7HGOUC2.ts → chunk-RTC7AJBS.ts} +1 -1
  27. package/dist/compiler-assets/{chunk-OX46N5EP.ts → chunk-TCXQ4GLM.ts} +1 -1
  28. package/dist/compiler-assets/{chunk-R4IHPPTB.ts → chunk-UUQAHJRT.ts} +2 -2
  29. package/dist/compiler-assets/{chunk-KNFPKVUS.ts → chunk-XCX6VAK7.ts} +1 -1
  30. package/dist/compiler-assets/{chunk-OBFQTLWC.ts → chunk-Y73DOSSB.ts} +3 -3
  31. package/dist/compiler-assets/{chunk-VRW24MOJ.ts → chunk-YAO6DUQO.ts} +4 -4
  32. package/dist/compiler-assets/src/authoring/agent.ts +4 -4
  33. package/dist/compiler-assets/src/authoring/approval.ts +7 -7
  34. package/dist/compiler-assets/src/authoring/brand.ts +3 -3
  35. package/dist/compiler-assets/src/authoring/channels.ts +6 -8
  36. package/dist/compiler-assets/src/authoring/connections.ts +11 -11
  37. package/dist/compiler-assets/src/authoring/credentials.ts +7 -7
  38. package/dist/compiler-assets/src/authoring/dynamic.ts +8 -8
  39. package/dist/compiler-assets/src/authoring/harness.ts +9 -9
  40. package/dist/compiler-assets/src/authoring/hooks.ts +10 -10
  41. package/dist/compiler-assets/src/authoring/index.ts +27 -26
  42. package/dist/compiler-assets/src/authoring/instructions.ts +9 -9
  43. package/dist/compiler-assets/src/authoring/sandbox.ts +11 -11
  44. package/dist/compiler-assets/src/authoring/schedules.ts +4 -4
  45. package/dist/compiler-assets/src/authoring/skills.ts +4 -4
  46. package/dist/compiler-assets/src/authoring/tools.ts +9 -9
  47. package/dist/compiler-assets/src/compatibility.ts +6 -6
  48. package/dist/compiler-assets/src/hosted-bindings.ts +6 -6
  49. package/dist/compiler-assets/src/index.ts +28 -27
  50. package/dist/compiler-assets/src/manifest.ts +4 -4
  51. package/dist/compiler-assets/src/resolve.ts +5 -5
  52. package/dist/compiler-assets/src/runtime/bundle.ts +17 -18
  53. package/dist/compiler-assets/src/runtime/describe.ts +14 -14
  54. package/dist/compiler-assets/src/runtime/described.ts +28 -16
  55. package/dist/compiler-assets/src/runtime/isolate.ts +16 -17
  56. package/dist/compiler-assets/src/runtime/lower.ts +13 -13
  57. package/dist/compiler-assets/src/runtime/schema-validation.ts +4 -4
  58. package/dist/compiler-assets/src/runtime/values.ts +2 -2
  59. package/dist/modules/authoring/agent.d.mts +25 -1
  60. package/dist/modules/authoring/agent.mjs.map +2 -2
  61. package/dist/modules/authoring/brand.d.mts +1 -0
  62. package/dist/modules/authoring/brand.mjs +1 -0
  63. package/dist/modules/authoring/brand.mjs.map +2 -2
  64. package/dist/modules/authoring/channels.d.mts +13 -96
  65. package/dist/modules/authoring/channels.mjs +6 -52
  66. package/dist/modules/authoring/channels.mjs.map +3 -3
  67. package/dist/modules/authoring/index.d.mts +1 -1
  68. package/dist/modules/authoring/index.mjs +2 -0
  69. package/dist/modules/authoring/index.mjs.map +2 -2
  70. package/dist/modules/compiler/assemble.d.mts +0 -4
  71. package/dist/modules/compiler/assemble.mjs +55 -23
  72. package/dist/modules/compiler/assemble.mjs.map +2 -2
  73. package/dist/modules/compiler/bundle.mjs.map +1 -1
  74. package/dist/modules/compiler/index.d.mts +1 -4
  75. package/dist/modules/compiler/index.mjs +4 -3
  76. package/dist/modules/compiler/index.mjs.map +2 -2
  77. package/dist/modules/runtime/describe.mjs +49 -2
  78. package/dist/modules/runtime/describe.mjs.map +2 -2
  79. package/dist/modules/runtime/described.d.mts +94 -3
  80. package/dist/modules/runtime/described.mjs +14 -2
  81. package/dist/modules/runtime/described.mjs.map +2 -2
  82. package/dist/modules/runtime/isolate.d.mts +3 -2
  83. package/dist/modules/runtime/isolate.mjs +2 -0
  84. package/dist/modules/runtime/isolate.mjs.map +2 -2
  85. package/fixtures/release-scout/agent/channels/github.ts +2 -38
  86. package/fixtures/release-scout/agent/hooks/audit.ts +1 -1
  87. package/fixtures/release-scout/agent/instructions/org-context.ts +1 -1
  88. package/package.json +4 -4
  89. package/dist/compiler-assets/chunk-ISYIPH2T.ts +0 -120
  90. package/dist/compiler-assets/chunk-JRKGCYWA.ts +0 -87
package/HOSTING.md CHANGED
@@ -240,7 +240,7 @@ before running. Shared manifest resolution rejects null results for required slo
240
240
  even if a host catches a resolver exception and returns null. Hosts must propagate
241
241
  that failure to startup. Session-started values stay pinned across turns and resume.
242
242
 
243
- This PR adds no configuration UI. A host can use the compiled requirements to show
243
+ Hosts can use the compiled requirements to show
244
244
  which names need configuration and return an actionable deployment-specific error.
245
245
 
246
246
  ## Host integration
@@ -269,6 +269,6 @@ Optional readers preserve source compatibility with existing hosts. Definitions
269
269
  requesting bindings fail clearly if hosting does not provide them. Installing these
270
270
  packages alone does not change Final's deployed service wiring or provision secrets.
271
271
 
272
- New compiles emit manifest version 3, so older hosts reject them rather than
273
- stripping required-binding metadata. Updated readers still accept persisted
274
- version 2 revisions. Upgrade hosting before publishing newly compiled agents.
272
+ New compiles emit manifest version 4. Hosts and stored revisions must use v4;
273
+ recompile older definitions before loading them. Upgrade hosting before
274
+ publishing newly compiled agents.
@@ -839,7 +839,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
839
839
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
840
840
 
841
841
 
842
- ## zod@4.6.5
842
+ ## zod@4.6.6
843
843
 
844
844
  License: MIT
845
845
 
@@ -7,7 +7,7 @@ import {
7
7
  record,
8
8
  string,
9
9
  union
10
- } from "./chunk-KTXTYIF4.ts";
10
+ } from "./chunk-4A4EQHYK.ts";
11
11
 
12
12
  // ../agent-provider/src/json.ts
13
13
  var jsonValueSchema = lazy(
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  stamp
3
- } from "./chunk-KTBNDKGJ.ts";
3
+ } from "./chunk-JZTF36V2.ts";
4
4
 
5
5
  // src/authoring/agent.ts
6
6
  var defineAgent = (definition) => stamp({ ...definition }, "agent" /* Agent */);
@@ -2,7 +2,7 @@ import {
2
2
  __export
3
3
  } from "./chunk-32O3ODZE.ts";
4
4
 
5
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
5
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/util.js
6
6
  var util_exports = {};
7
7
  __export(util_exports, {
8
8
  BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
@@ -73,6 +73,7 @@ __export(util_exports, {
73
73
  required: () => required,
74
74
  safeExtend: () => safeExtend,
75
75
  shallowClone: () => shallowClone,
76
+ sizeCaps: () => sizeCaps,
76
77
  slugify: () => slugify,
77
78
  stringifyPrimitive: () => stringifyPrimitive,
78
79
  toZod: () => toZod,
@@ -82,7 +83,7 @@ __export(util_exports, {
82
83
  unwrapMessage: () => unwrapMessage
83
84
  });
84
85
 
85
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.js
86
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/core.js
86
87
  var _a;
87
88
  var NEVER = /* @__PURE__ */ Object.freeze({
88
89
  status: "aborted"
@@ -203,7 +204,7 @@ function config(newConfig) {
203
204
  return globalConfig;
204
205
  }
205
206
 
206
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
207
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/util.js
207
208
  function assertEqual(val) {
208
209
  return val;
209
210
  }
@@ -715,6 +716,18 @@ function prefixIssues(path, issues) {
715
716
  function unwrapMessage(message) {
716
717
  return typeof message === "string" ? message : message?.message;
717
718
  }
719
+ function sizeCaps(defChecks) {
720
+ const caps = [];
721
+ for (const ch of defChecks ?? []) {
722
+ const d = ch._zod.def;
723
+ if (!/_(length|size)$|_equals$/.test(d.check))
724
+ break;
725
+ const max = d.maximum ?? d.length ?? d.size;
726
+ if (max >= 0)
727
+ caps.push([max, ch]);
728
+ }
729
+ return caps;
730
+ }
718
731
  function attachSchema(issues, start, inst) {
719
732
  var _a3;
720
733
  for (let i = start; i < issues.length; i++) {
@@ -968,7 +981,7 @@ function constantCatch(value) {
968
981
  return fn;
969
982
  }
970
983
 
971
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.js
984
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/regexes.js
972
985
  var cuid = /^[cC][0-9a-z]{6,}$/;
973
986
  var cuid2 = /^[0-9a-z]+$/;
974
987
  var ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
@@ -1028,7 +1041,7 @@ var _null = /^null$/i;
1028
1041
  var lowercase = /^[^A-Z]*$/;
1029
1042
  var uppercase = /^[^a-z]*$/;
1030
1043
 
1031
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.js
1044
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/checks.js
1032
1045
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
1033
1046
  var _a3;
1034
1047
  inst._zod ?? (inst._zod = {});
@@ -1348,7 +1361,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
1348
1361
  };
1349
1362
  });
1350
1363
 
1351
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.js
1364
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/doc.js
1352
1365
  var Doc = class {
1353
1366
  constructor(args = [], closed = {}) {
1354
1367
  this.content = [];
@@ -1389,7 +1402,7 @@ ${content.join("\n")}
1389
1402
  }
1390
1403
  };
1391
1404
 
1392
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.js
1405
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/errors.js
1393
1406
  function _getMessage() {
1394
1407
  const internals = this._zod;
1395
1408
  internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
@@ -1504,7 +1517,7 @@ function formatError(error2, mapper = (issue2) => issue2.message) {
1504
1517
  return fieldErrors;
1505
1518
  }
1506
1519
 
1507
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.js
1520
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/parse.js
1508
1521
  function finalizeParams(callee, params) {
1509
1522
  return { callee: params?.callee ?? callee, Err: params?.Err };
1510
1523
  }
@@ -1654,14 +1667,14 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
1654
1667
  return _safeParseAsync(_Err)(schema, value, _ctx);
1655
1668
  };
1656
1669
 
1657
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
1670
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/versions.js
1658
1671
  var version = {
1659
1672
  major: 4,
1660
1673
  minor: 6,
1661
- patch: 5
1674
+ patch: 6
1662
1675
  };
1663
1676
 
1664
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.js
1677
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/schemas.js
1665
1678
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1666
1679
  var _a3;
1667
1680
  inst ?? (inst = {});
@@ -2280,6 +2293,29 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
2280
2293
  return payload;
2281
2294
  };
2282
2295
  });
2296
+ function capSize(inst, size) {
2297
+ const caps = sizeCaps(inst._zod.def.checks);
2298
+ if (!caps.length)
2299
+ return;
2300
+ const cap = Math.min(...caps.map((c) => c[0]));
2301
+ const parse3 = inst._zod.parse;
2302
+ inst._zod.parse = (payload, ctx) => {
2303
+ const n = size(payload.value);
2304
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
2305
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
2306
+ if (n > max && ch._zod.def.when(payload)) {
2307
+ const start = payload.issues.length;
2308
+ ch._zod.check(payload);
2309
+ payload.issues[start].continue = false;
2310
+ attachSchema(payload.issues, start, inst);
2311
+ return payload;
2312
+ }
2313
+ }
2314
+ }
2315
+ return parse3(payload, ctx);
2316
+ };
2317
+ }
2318
+ var arraySize = (input) => Array.isArray(input) ? input.length : -1;
2283
2319
  function handleArrayResult(result, final, index) {
2284
2320
  if (result.issues.length) {
2285
2321
  final.issues.push(...prefixIssues(index, result.issues));
@@ -2323,6 +2359,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
2323
2359
  }
2324
2360
  return payload;
2325
2361
  };
2362
+ capSize(inst, arraySize);
2326
2363
  });
2327
2364
  function handlePropertyResult(result, final, key, input, optin, optout) {
2328
2365
  const isPresent = key in input;
@@ -3569,7 +3606,7 @@ function handleRefineResult(result, payload, input, inst) {
3569
3606
  }
3570
3607
  }
3571
3608
 
3572
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.js
3609
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/registries.js
3573
3610
  var _a2;
3574
3611
  var $ZodRegistry = class {
3575
3612
  constructor() {
@@ -3617,7 +3654,7 @@ function registry() {
3617
3654
  (_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
3618
3655
  var globalRegistry = globalThis.__zod_globalRegistry;
3619
3656
 
3620
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.js
3657
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/to-json-schema.js
3621
3658
  function assignProps(target, ...sources) {
3622
3659
  for (const source of sources) {
3623
3660
  for (const key of Reflect.ownKeys(source)) {
@@ -4147,7 +4184,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
4147
4184
  return finalize(ctx, schema);
4148
4185
  };
4149
4186
 
4150
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.js
4187
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/json-schema-processors.js
4151
4188
  var narrowMin = (agg, key, value) => {
4152
4189
  if (agg[key] === void 0 || value > agg[key])
4153
4190
  agg[key] = value;
@@ -4895,7 +4932,7 @@ function toJSONSchema(input, params) {
4895
4932
  return finalize(ctx, input);
4896
4933
  }
4897
4934
 
4898
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.js
4935
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/memoizer.js
4899
4936
  var $ZodCyclicError = class extends Error {
4900
4937
  constructor() {
4901
4938
  super(`Cannot parse a reference cycle that closes through a transform`);
@@ -5169,7 +5206,7 @@ function isBackEdge(ctx, value) {
5169
5206
  return backEdges !== void 0 && isRef(value) && backEdges.has(value);
5170
5207
  }
5171
5208
 
5172
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.js
5209
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/locales/en.js
5173
5210
  var error = () => {
5174
5211
  const Sizable = {
5175
5212
  string: { unit: "characters", verb: "to have" },
@@ -5294,7 +5331,7 @@ function en_default() {
5294
5331
  };
5295
5332
  }
5296
5333
 
5297
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.js
5334
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/api.js
5298
5335
  function snapshotChecks(def) {
5299
5336
  if (def.checks)
5300
5337
  def.checks = [...def.checks];
@@ -5859,7 +5896,7 @@ function _check(fn, params) {
5859
5896
  return ch;
5860
5897
  }
5861
5898
 
5862
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.js
5899
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/errors.js
5863
5900
  var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
5864
5901
  function _lazyMethod(proto, key, make) {
5865
5902
  Object.defineProperty(proto, key, {
@@ -5904,7 +5941,7 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, void 0
5904
5941
  Parent: Error
5905
5942
  });
5906
5943
 
5907
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.js
5944
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/parse.js
5908
5945
  var parse2 = /* @__PURE__ */ _parse(ZodRealError);
5909
5946
  var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
5910
5947
  var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -5918,7 +5955,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
5918
5955
  var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
5919
5956
  var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
5920
5957
 
5921
- // ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.js
5958
+ // ../../../node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/schemas.js
5922
5959
  function _ensureDefaultLocale() {
5923
5960
  if (!globalConfig.localeError)
5924
5961
  config(en_default());
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  awaitableOpenRequest
3
- } from "./chunk-KNFPKVUS.ts";
3
+ } from "./chunk-XCX6VAK7.ts";
4
4
  import {
5
5
  ZodIssueCode,
6
6
  coerce_exports,
7
7
  iso_exports
8
- } from "./chunk-VI5WBWUX.ts";
8
+ } from "./chunk-MPZMRU56.ts";
9
9
  import {
10
10
  jsonValueSchema
11
- } from "./chunk-FU5VHNO4.ts";
11
+ } from "./chunk-3R7MNW5L.ts";
12
12
  import {
13
13
  stamp
14
- } from "./chunk-KTBNDKGJ.ts";
14
+ } from "./chunk-JZTF36V2.ts";
15
15
  import {
16
16
  NEVER,
17
17
  _enum,
@@ -36,7 +36,7 @@ import {
36
36
  union,
37
37
  unknown,
38
38
  url
39
- } from "./chunk-KTXTYIF4.ts";
39
+ } from "./chunk-4A4EQHYK.ts";
40
40
 
41
41
  // ../agent-provider/src/sandbox/file-kind.ts
42
42
  var SandboxEntryType = /* @__PURE__ */ ((SandboxEntryType2) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DynamicEvent
3
- } from "./chunk-R4IHPPTB.ts";
3
+ } from "./chunk-UUQAHJRT.ts";
4
4
  import {
5
5
  array,
6
6
  literal,
@@ -8,7 +8,7 @@ import {
8
8
  object,
9
9
  string,
10
10
  union
11
- } from "./chunk-KTXTYIF4.ts";
11
+ } from "./chunk-4A4EQHYK.ts";
12
12
 
13
13
  // ../agent-provider/src/credentials.ts
14
14
  var CredentialPayer = /* @__PURE__ */ ((CredentialPayer2) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  stamp
3
- } from "./chunk-KTBNDKGJ.ts";
3
+ } from "./chunk-JZTF36V2.ts";
4
4
 
5
5
  // src/authoring/schedules.ts
6
6
  var defineSchedule = (definition) => stamp({ ...definition }, "schedule" /* Schedule */);
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  stamp
3
- } from "./chunk-KTBNDKGJ.ts";
3
+ } from "./chunk-JZTF36V2.ts";
4
4
  import {
5
5
  authoredRecordSchema,
6
6
  isCallable
7
- } from "./chunk-OX46N5EP.ts";
7
+ } from "./chunk-TCXQ4GLM.ts";
8
8
  import {
9
9
  looseObject
10
- } from "./chunk-KTXTYIF4.ts";
10
+ } from "./chunk-4A4EQHYK.ts";
11
11
 
12
12
  // src/authoring/hooks.ts
13
13
  var HookEvent = /* @__PURE__ */ ((HookEvent2) => {
@@ -8,48 +8,44 @@ import {
8
8
  lowerSkill,
9
9
  lowerTool,
10
10
  toJson
11
- } from "./chunk-GIRUQ7QF.ts";
11
+ } from "./chunk-MM4JCZSK.ts";
12
12
  import {
13
13
  AUTHORED_SERVER_KEY
14
14
  } from "./chunk-NMYHO2QN.ts";
15
15
  import {
16
16
  hookHandlersFor
17
- } from "./chunk-KMBQVNAJ.ts";
17
+ } from "./chunk-AMYJRTAC.ts";
18
18
  import {
19
19
  unopenedRequestOf
20
- } from "./chunk-KNFPKVUS.ts";
20
+ } from "./chunk-XCX6VAK7.ts";
21
21
  import {
22
22
  registerToolName,
23
23
  toolLabelSchema
24
- } from "./chunk-4ERFBLH7.ts";
24
+ } from "./chunk-DRHDNSCQ.ts";
25
25
  import {
26
26
  lowerApproval
27
- } from "./chunk-O2JWY454.ts";
28
- import {
29
- ConversationKind,
30
- ParticipantKind
31
- } from "./chunk-JRKGCYWA.ts";
27
+ } from "./chunk-L7YJCQVB.ts";
32
28
  import {
33
29
  mcpServerBindingSchema,
34
30
  providerRefSchema
35
- } from "./chunk-EAEQQT33.ts";
31
+ } from "./chunk-Q26ZPNVB.ts";
36
32
  import {
37
33
  TranscriptRole
38
34
  } from "./chunk-RWUIMTBI.ts";
39
35
  import {
40
36
  validateSchemaValue
41
- } from "./chunk-O3JKMLDP.ts";
37
+ } from "./chunk-EKR4AEM5.ts";
42
38
  import {
43
39
  DynamicEvent
44
- } from "./chunk-R4IHPPTB.ts";
40
+ } from "./chunk-UUQAHJRT.ts";
45
41
  import {
46
42
  jsonObjectSchema,
47
43
  jsonValueSchema
48
- } from "./chunk-FU5VHNO4.ts";
44
+ } from "./chunk-3R7MNW5L.ts";
49
45
  import {
50
46
  authoredKindOf,
51
47
  stamp
52
- } from "./chunk-KTBNDKGJ.ts";
48
+ } from "./chunk-JZTF36V2.ts";
53
49
  import {
54
50
  authoredRecordSchema,
55
51
  callableSchema,
@@ -61,16 +57,87 @@ import {
61
57
  isPlainObject,
62
58
  messageOf,
63
59
  optionalValueSchema
64
- } from "./chunk-OX46N5EP.ts";
60
+ } from "./chunk-TCXQ4GLM.ts";
65
61
  import {
62
+ _null,
66
63
  array,
67
64
  boolean,
65
+ literal,
68
66
  looseObject,
69
67
  nativeEnum,
70
68
  number,
71
69
  object,
72
- string
73
- } from "./chunk-KTXTYIF4.ts";
70
+ string,
71
+ union
72
+ } from "./chunk-4A4EQHYK.ts";
73
+
74
+ // ../agent-provider/src/room-surface.ts
75
+ var ChannelPrincipalType = /* @__PURE__ */ ((ChannelPrincipalType2) => {
76
+ ChannelPrincipalType2["User"] = "user";
77
+ ChannelPrincipalType2["Service"] = "service";
78
+ return ChannelPrincipalType2;
79
+ })(ChannelPrincipalType || {});
80
+ var channelAuthSchema = object({
81
+ principalId: string().min(1),
82
+ principalType: nativeEnum(ChannelPrincipalType),
83
+ authenticator: string().min(1),
84
+ // How the agent and the people reading its reply name the principal.
85
+ displayName: string().min(1).max(200).optional(),
86
+ attributes: jsonObjectSchema.default({})
87
+ });
88
+ var ConversationKind = /* @__PURE__ */ ((ConversationKind2) => {
89
+ ConversationKind2["Direct"] = "direct";
90
+ ConversationKind2["Group"] = "group";
91
+ return ConversationKind2;
92
+ })(ConversationKind || {});
93
+ var ParticipantKind = /* @__PURE__ */ ((ParticipantKind2) => {
94
+ ParticipantKind2["User"] = "user";
95
+ ParticipantKind2["Agent"] = "agent";
96
+ return ParticipantKind2;
97
+ })(ParticipantKind || {});
98
+ var MessageKind = /* @__PURE__ */ ((MessageKind2) => {
99
+ MessageKind2["Message"] = "message";
100
+ MessageKind2["Card"] = "card";
101
+ return MessageKind2;
102
+ })(MessageKind || {});
103
+ var roomReceiveResultSchema = union([
104
+ object({ conversationId: string().min(1) }),
105
+ object({ sessionId: string().min(1) }),
106
+ _null()
107
+ ]);
108
+ var channelMessageInputSchema = object({
109
+ conversationId: string().min(1),
110
+ authorParticipantId: string().min(1),
111
+ kind: nativeEnum(MessageKind).default("message" /* Message */),
112
+ content: array(jsonObjectSchema).min(1),
113
+ clientMessageId: string().min(1).nullish(),
114
+ replyToMessageId: string().min(1).nullish(),
115
+ threadRootId: string().min(1).nullish(),
116
+ quotedMessageIds: array(string().min(1)).default([]),
117
+ mentionedParticipantIds: array(string().min(1)).default([])
118
+ });
119
+ var DecisionKind = /* @__PURE__ */ ((DecisionKind2) => {
120
+ DecisionKind2["Permission"] = "permission";
121
+ DecisionKind2["Elicitation"] = "elicitation";
122
+ return DecisionKind2;
123
+ })(DecisionKind || {});
124
+ var decisionCreatedDataSchema = object({
125
+ decisionId: string().min(1),
126
+ kind: nativeEnum(DecisionKind),
127
+ audienceParticipantIds: array(string()),
128
+ request: jsonValueSchema
129
+ });
130
+ var decisionResolvedDataSchema = object({
131
+ decisionId: string().min(1),
132
+ outcome: jsonValueSchema,
133
+ respondedBy: channelAuthSchema.nullable().default(null)
134
+ });
135
+ var turnEndSchema = looseObject({
136
+ sessionUpdate: literal("state_update"),
137
+ state: literal("idle"),
138
+ stopReason: string().nullish(),
139
+ _meta: looseObject({ "final.ai": looseObject({ stopReason: string().nullish() }).nullish() }).nullish()
140
+ });
74
141
 
75
142
  // src/runtime/isolate.ts
76
143
  var jsonOf = (value, path) => {
@@ -446,6 +513,7 @@ var createIsolateRuntime = (modules) => {
446
513
  );
447
514
  if (route == null) return null;
448
515
  const response = await route.handler({
516
+ ...args.context,
449
517
  request: args.request,
450
518
  secrets: args.secrets,
451
519
  receive: args.receive,
@@ -465,6 +533,7 @@ var createIsolateRuntime = (modules) => {
465
533
  );
466
534
  if (route == null) return null;
467
535
  const response = await route.handler({
536
+ ...args.context,
468
537
  request: args.request,
469
538
  secrets: args.secrets,
470
539
  receive: args.receive
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  harnessDescriptionSchema
3
- } from "./chunk-YEKSPL76.ts";
3
+ } from "./chunk-FFI2K5IJ.ts";
4
4
  import {
5
5
  bundleRef
6
- } from "./chunk-EAEQQT33.ts";
6
+ } from "./chunk-Q26ZPNVB.ts";
7
7
  import {
8
8
  registerPending
9
- } from "./chunk-KTBNDKGJ.ts";
9
+ } from "./chunk-JZTF36V2.ts";
10
10
 
11
11
  // src/authoring/harness.ts
12
12
  var completeHarnessDescription = (authored) => {
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  resultMatchesSchema
3
- } from "./chunk-O3JKMLDP.ts";
3
+ } from "./chunk-EKR4AEM5.ts";
4
4
  import {
5
5
  stamp
6
- } from "./chunk-KTBNDKGJ.ts";
6
+ } from "./chunk-JZTF36V2.ts";
7
7
  import {
8
8
  callableSchema,
9
9
  isObjectLike,
10
10
  optionalValueSchema
11
- } from "./chunk-OX46N5EP.ts";
11
+ } from "./chunk-TCXQ4GLM.ts";
12
12
  import {
13
13
  array,
14
14
  boolean,
@@ -16,7 +16,7 @@ import {
16
16
  object,
17
17
  string,
18
18
  union
19
- } from "./chunk-KTXTYIF4.ts";
19
+ } from "./chunk-4A4EQHYK.ts";
20
20
 
21
21
  // src/authoring/tools.ts
22
22
  var toolLabelSchema = union([
@@ -4,11 +4,11 @@ import {
4
4
  import {
5
5
  jsonObjectSchema,
6
6
  jsonValueSchema
7
- } from "./chunk-FU5VHNO4.ts";
7
+ } from "./chunk-3R7MNW5L.ts";
8
8
  import {
9
9
  callableSchema,
10
10
  fieldOf
11
- } from "./chunk-OX46N5EP.ts";
11
+ } from "./chunk-TCXQ4GLM.ts";
12
12
  import {
13
13
  array,
14
14
  boolean,
@@ -18,7 +18,7 @@ import {
18
18
  record,
19
19
  string,
20
20
  unknown
21
- } from "./chunk-KTXTYIF4.ts";
21
+ } from "./chunk-4A4EQHYK.ts";
22
22
  import {
23
23
  __commonJS,
24
24
  __toESM