@smartergpt/lexrunner 1.2.1 → 1.4.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.
@@ -2026,7 +2026,7 @@ var require_thread_stream = __commonJS({
2026
2026
  var { version } = require_package();
2027
2027
  var { EventEmitter } = require("events");
2028
2028
  var { Worker } = require("worker_threads");
2029
- var { join: join9 } = require("path");
2029
+ var { join: join10 } = require("path");
2030
2030
  var { pathToFileURL } = require("url");
2031
2031
  var { wait } = require_wait();
2032
2032
  var {
@@ -2077,7 +2077,7 @@ var require_thread_stream = __commonJS({
2077
2077
  function createWorker(stream, opts) {
2078
2078
  const { filename, workerData } = opts;
2079
2079
  const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
2080
- const toExecute = bundlerOverrides["thread-stream-worker"] || join9(__dirname, "lib", "worker.js");
2080
+ const toExecute = bundlerOverrides["thread-stream-worker"] || join10(__dirname, "lib", "worker.js");
2081
2081
  const worker = new Worker(toExecute, {
2082
2082
  ...opts.workerOpts,
2083
2083
  name: opts.workerOpts?.name || "thread-stream",
@@ -2543,9 +2543,9 @@ var require_transport = __commonJS({
2543
2543
  "node_modules/pino/lib/transport.js"(exports2, module2) {
2544
2544
  "use strict";
2545
2545
  var { createRequire: createRequire2 } = require("module");
2546
- var { existsSync: existsSync12 } = require("fs");
2546
+ var { existsSync: existsSync13 } = require("fs");
2547
2547
  var getCallers = require_caller();
2548
- var { join: join9, isAbsolute: isAbsolute5, sep: sep2 } = require("path");
2548
+ var { join: join10, isAbsolute: isAbsolute5, sep: sep2 } = require("path");
2549
2549
  var { fileURLToPath: fileURLToPath3 } = require("url");
2550
2550
  var sleep = require_atomic_sleep();
2551
2551
  var onExit = require_on_exit_leak_free();
@@ -2617,7 +2617,7 @@ var require_transport = __commonJS({
2617
2617
  return false;
2618
2618
  }
2619
2619
  }
2620
- return isAbsolute5(path4) && !existsSync12(path4);
2620
+ return isAbsolute5(path4) && !existsSync13(path4);
2621
2621
  }
2622
2622
  function stripQuotes(value) {
2623
2623
  const first = value[0];
@@ -2698,7 +2698,7 @@ var require_transport = __commonJS({
2698
2698
  throw new Error("only one of target or targets can be specified");
2699
2699
  }
2700
2700
  if (targets) {
2701
- target = bundlerOverrides["pino-worker"] || join9(__dirname, "worker.js");
2701
+ target = bundlerOverrides["pino-worker"] || join10(__dirname, "worker.js");
2702
2702
  options.targets = targets.filter((dest) => dest.target).map((dest) => {
2703
2703
  return {
2704
2704
  ...dest,
@@ -2716,7 +2716,7 @@ var require_transport = __commonJS({
2716
2716
  });
2717
2717
  });
2718
2718
  } else if (pipeline) {
2719
- target = bundlerOverrides["pino-worker"] || join9(__dirname, "worker.js");
2719
+ target = bundlerOverrides["pino-worker"] || join10(__dirname, "worker.js");
2720
2720
  options.pipelines = [pipeline.map((dest) => {
2721
2721
  return {
2722
2722
  ...dest,
@@ -2739,7 +2739,7 @@ var require_transport = __commonJS({
2739
2739
  return origin;
2740
2740
  }
2741
2741
  if (origin === "pino/file") {
2742
- return join9(__dirname, "..", "file.js");
2742
+ return join10(__dirname, "..", "file.js");
2743
2743
  }
2744
2744
  let fixTarget2;
2745
2745
  for (const filePath of callers) {
@@ -3720,7 +3720,7 @@ var require_safe_stable_stringify = __commonJS({
3720
3720
  return circularValue;
3721
3721
  }
3722
3722
  let res = "";
3723
- let join9 = ",";
3723
+ let join10 = ",";
3724
3724
  const originalIndentation = indentation;
3725
3725
  if (Array.isArray(value)) {
3726
3726
  if (value.length === 0) {
@@ -3734,7 +3734,7 @@ var require_safe_stable_stringify = __commonJS({
3734
3734
  indentation += spacer;
3735
3735
  res += `
3736
3736
  ${indentation}`;
3737
- join9 = `,
3737
+ join10 = `,
3738
3738
  ${indentation}`;
3739
3739
  }
3740
3740
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -3742,13 +3742,13 @@ ${indentation}`;
3742
3742
  for (; i < maximumValuesToStringify - 1; i++) {
3743
3743
  const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
3744
3744
  res += tmp2 !== void 0 ? tmp2 : "null";
3745
- res += join9;
3745
+ res += join10;
3746
3746
  }
3747
3747
  const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
3748
3748
  res += tmp !== void 0 ? tmp : "null";
3749
3749
  if (value.length - 1 > maximumBreadth) {
3750
3750
  const removedKeys = value.length - maximumBreadth - 1;
3751
- res += `${join9}"... ${getItemCount(removedKeys)} not stringified"`;
3751
+ res += `${join10}"... ${getItemCount(removedKeys)} not stringified"`;
3752
3752
  }
3753
3753
  if (spacer !== "") {
3754
3754
  res += `
@@ -3769,7 +3769,7 @@ ${originalIndentation}`;
3769
3769
  let separator = "";
3770
3770
  if (spacer !== "") {
3771
3771
  indentation += spacer;
3772
- join9 = `,
3772
+ join10 = `,
3773
3773
  ${indentation}`;
3774
3774
  whitespace = " ";
3775
3775
  }
@@ -3783,13 +3783,13 @@ ${indentation}`;
3783
3783
  const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
3784
3784
  if (tmp !== void 0) {
3785
3785
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
3786
- separator = join9;
3786
+ separator = join10;
3787
3787
  }
3788
3788
  }
3789
3789
  if (keyLength > maximumBreadth) {
3790
3790
  const removedKeys = keyLength - maximumBreadth;
3791
3791
  res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
3792
- separator = join9;
3792
+ separator = join10;
3793
3793
  }
3794
3794
  if (spacer !== "" && separator.length > 1) {
3795
3795
  res = `
@@ -3830,7 +3830,7 @@ ${originalIndentation}`;
3830
3830
  }
3831
3831
  const originalIndentation = indentation;
3832
3832
  let res = "";
3833
- let join9 = ",";
3833
+ let join10 = ",";
3834
3834
  if (Array.isArray(value)) {
3835
3835
  if (value.length === 0) {
3836
3836
  return "[]";
@@ -3843,7 +3843,7 @@ ${originalIndentation}`;
3843
3843
  indentation += spacer;
3844
3844
  res += `
3845
3845
  ${indentation}`;
3846
- join9 = `,
3846
+ join10 = `,
3847
3847
  ${indentation}`;
3848
3848
  }
3849
3849
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -3851,13 +3851,13 @@ ${indentation}`;
3851
3851
  for (; i < maximumValuesToStringify - 1; i++) {
3852
3852
  const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
3853
3853
  res += tmp2 !== void 0 ? tmp2 : "null";
3854
- res += join9;
3854
+ res += join10;
3855
3855
  }
3856
3856
  const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
3857
3857
  res += tmp !== void 0 ? tmp : "null";
3858
3858
  if (value.length - 1 > maximumBreadth) {
3859
3859
  const removedKeys = value.length - maximumBreadth - 1;
3860
- res += `${join9}"... ${getItemCount(removedKeys)} not stringified"`;
3860
+ res += `${join10}"... ${getItemCount(removedKeys)} not stringified"`;
3861
3861
  }
3862
3862
  if (spacer !== "") {
3863
3863
  res += `
@@ -3870,7 +3870,7 @@ ${originalIndentation}`;
3870
3870
  let whitespace = "";
3871
3871
  if (spacer !== "") {
3872
3872
  indentation += spacer;
3873
- join9 = `,
3873
+ join10 = `,
3874
3874
  ${indentation}`;
3875
3875
  whitespace = " ";
3876
3876
  }
@@ -3879,7 +3879,7 @@ ${indentation}`;
3879
3879
  const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
3880
3880
  if (tmp !== void 0) {
3881
3881
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
3882
- separator = join9;
3882
+ separator = join10;
3883
3883
  }
3884
3884
  }
3885
3885
  if (spacer !== "" && separator.length > 1) {
@@ -3937,20 +3937,20 @@ ${originalIndentation}`;
3937
3937
  indentation += spacer;
3938
3938
  let res2 = `
3939
3939
  ${indentation}`;
3940
- const join10 = `,
3940
+ const join11 = `,
3941
3941
  ${indentation}`;
3942
3942
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
3943
3943
  let i = 0;
3944
3944
  for (; i < maximumValuesToStringify - 1; i++) {
3945
3945
  const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
3946
3946
  res2 += tmp2 !== void 0 ? tmp2 : "null";
3947
- res2 += join10;
3947
+ res2 += join11;
3948
3948
  }
3949
3949
  const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
3950
3950
  res2 += tmp !== void 0 ? tmp : "null";
3951
3951
  if (value.length - 1 > maximumBreadth) {
3952
3952
  const removedKeys = value.length - maximumBreadth - 1;
3953
- res2 += `${join10}"... ${getItemCount(removedKeys)} not stringified"`;
3953
+ res2 += `${join11}"... ${getItemCount(removedKeys)} not stringified"`;
3954
3954
  }
3955
3955
  res2 += `
3956
3956
  ${originalIndentation}`;
@@ -3966,16 +3966,16 @@ ${originalIndentation}`;
3966
3966
  return '"[Object]"';
3967
3967
  }
3968
3968
  indentation += spacer;
3969
- const join9 = `,
3969
+ const join10 = `,
3970
3970
  ${indentation}`;
3971
3971
  let res = "";
3972
3972
  let separator = "";
3973
3973
  let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
3974
3974
  if (isTypedArrayWithEntries(value)) {
3975
- res += stringifyTypedArray(value, join9, maximumBreadth);
3975
+ res += stringifyTypedArray(value, join10, maximumBreadth);
3976
3976
  keys = keys.slice(value.length);
3977
3977
  maximumPropertiesToStringify -= value.length;
3978
- separator = join9;
3978
+ separator = join10;
3979
3979
  }
3980
3980
  if (deterministic) {
3981
3981
  keys = sort(keys, comparator);
@@ -3986,13 +3986,13 @@ ${indentation}`;
3986
3986
  const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
3987
3987
  if (tmp !== void 0) {
3988
3988
  res += `${separator}${strEscape(key2)}: ${tmp}`;
3989
- separator = join9;
3989
+ separator = join10;
3990
3990
  }
3991
3991
  }
3992
3992
  if (keyLength > maximumBreadth) {
3993
3993
  const removedKeys = keyLength - maximumBreadth;
3994
3994
  res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
3995
- separator = join9;
3995
+ separator = join10;
3996
3996
  }
3997
3997
  if (separator !== "") {
3998
3998
  res = `
@@ -7564,7 +7564,7 @@ var require_dist = __commonJS({
7564
7564
  function parse(stream, callback) {
7565
7565
  const parser = new parser_1.Parser();
7566
7566
  stream.on("data", (buffer) => parser.parse(buffer, callback));
7567
- return new Promise((resolve7) => stream.on("end", () => resolve7()));
7567
+ return new Promise((resolve9) => stream.on("end", () => resolve9()));
7568
7568
  }
7569
7569
  }
7570
7570
  });
@@ -8326,12 +8326,12 @@ var require_client = __commonJS({
8326
8326
  this._connect(callback);
8327
8327
  return;
8328
8328
  }
8329
- return new this._Promise((resolve7, reject) => {
8329
+ return new this._Promise((resolve9, reject) => {
8330
8330
  this._connect((error) => {
8331
8331
  if (error) {
8332
8332
  reject(error);
8333
8333
  } else {
8334
- resolve7(this);
8334
+ resolve9(this);
8335
8335
  }
8336
8336
  });
8337
8337
  });
@@ -8678,8 +8678,8 @@ var require_client = __commonJS({
8678
8678
  } else {
8679
8679
  query = new Query2(config, values, callback);
8680
8680
  if (!query.callback) {
8681
- result = new this._Promise((resolve7, reject) => {
8682
- query.callback = (err, res) => err ? reject(err) : resolve7(res);
8681
+ result = new this._Promise((resolve9, reject) => {
8682
+ query.callback = (err, res) => err ? reject(err) : resolve9(res);
8683
8683
  }).catch((err) => {
8684
8684
  Error.captureStackTrace(err);
8685
8685
  throw err;
@@ -8763,8 +8763,8 @@ var require_client = __commonJS({
8763
8763
  if (cb) {
8764
8764
  this.connection.once("end", cb);
8765
8765
  } else {
8766
- return new this._Promise((resolve7) => {
8767
- this.connection.once("end", resolve7);
8766
+ return new this._Promise((resolve9) => {
8767
+ this.connection.once("end", resolve9);
8768
8768
  });
8769
8769
  }
8770
8770
  }
@@ -8813,8 +8813,8 @@ var require_pg_pool = __commonJS({
8813
8813
  const cb = function(err, client) {
8814
8814
  err ? rej(err) : res(client);
8815
8815
  };
8816
- const result = new Promise2(function(resolve7, reject) {
8817
- res = resolve7;
8816
+ const result = new Promise2(function(resolve9, reject) {
8817
+ res = resolve9;
8818
8818
  rej = reject;
8819
8819
  }).catch((err) => {
8820
8820
  Error.captureStackTrace(err);
@@ -8875,7 +8875,7 @@ var require_pg_pool = __commonJS({
8875
8875
  if (typeof Promise2.try === "function") {
8876
8876
  return Promise2.try(f);
8877
8877
  }
8878
- return new Promise2((resolve7) => resolve7(f()));
8878
+ return new Promise2((resolve9) => resolve9(f()));
8879
8879
  }
8880
8880
  _isFull() {
8881
8881
  return this._clients.length >= this.options.max;
@@ -9268,8 +9268,8 @@ var require_query2 = __commonJS({
9268
9268
  NativeQuery.prototype._getPromise = function() {
9269
9269
  if (this._promise) return this._promise;
9270
9270
  this._promise = new Promise(
9271
- function(resolve7, reject) {
9272
- this._once("end", resolve7);
9271
+ function(resolve9, reject) {
9272
+ this._once("end", resolve9);
9273
9273
  this._once("error", reject);
9274
9274
  }.bind(this)
9275
9275
  );
@@ -9447,12 +9447,12 @@ var require_client2 = __commonJS({
9447
9447
  this._connect(callback);
9448
9448
  return;
9449
9449
  }
9450
- return new this._Promise((resolve7, reject) => {
9450
+ return new this._Promise((resolve9, reject) => {
9451
9451
  this._connect((error) => {
9452
9452
  if (error) {
9453
9453
  reject(error);
9454
9454
  } else {
9455
- resolve7(this);
9455
+ resolve9(this);
9456
9456
  }
9457
9457
  });
9458
9458
  });
@@ -9476,8 +9476,8 @@ var require_client2 = __commonJS({
9476
9476
  query = new NativeQuery(config, values, callback);
9477
9477
  if (!query.callback) {
9478
9478
  let resolveOut, rejectOut;
9479
- result = new this._Promise((resolve7, reject) => {
9480
- resolveOut = resolve7;
9479
+ result = new this._Promise((resolve9, reject) => {
9480
+ resolveOut = resolve9;
9481
9481
  rejectOut = reject;
9482
9482
  }).catch((err) => {
9483
9483
  Error.captureStackTrace(err);
@@ -9540,8 +9540,8 @@ var require_client2 = __commonJS({
9540
9540
  }
9541
9541
  let result;
9542
9542
  if (!cb) {
9543
- result = new this._Promise(function(resolve7, reject) {
9544
- cb = (err) => err ? reject(err) : resolve7();
9543
+ result = new this._Promise(function(resolve9, reject) {
9544
+ cb = (err) => err ? reject(err) : resolve9();
9545
9545
  });
9546
9546
  }
9547
9547
  this.native.end(function() {
@@ -10413,6 +10413,10 @@ var RUNTIME_OPERATION_CAPABILITIES = Object.freeze({
10413
10413
  FRAME_WRITE: "frame:write",
10414
10414
  FRAME_DELETE: "frame:delete",
10415
10415
  FRAME_ADMIN: "frame:admin",
10416
+ BEHAVIOR_READ: "behavior:read",
10417
+ BEHAVIOR_WRITE: "behavior:write",
10418
+ BEHAVIOR_PROMOTE: "behavior:promote",
10419
+ BEHAVIOR_PROVENANCE: "behavior:provenance",
10416
10420
  WORKSPACE_BIND: "workspace:bind",
10417
10421
  WORKSPACE_INSPECT: "workspace:inspect",
10418
10422
  WORKSPACE_REBIND: "workspace:rebind",
@@ -10447,6 +10451,10 @@ var CLI_CAPABILITIES = Object.freeze({
10447
10451
  "instructions:init": Object.freeze([]),
10448
10452
  "instructions:generate": Object.freeze([]),
10449
10453
  "instructions:check": Object.freeze([]),
10454
+ "knowledge:check": Object.freeze([]),
10455
+ "knowledge:index": Object.freeze([]),
10456
+ "knowledge:context": Object.freeze([]),
10457
+ "knowledge:explain": Object.freeze([]),
10450
10458
  "code-atlas": Object.freeze([]),
10451
10459
  turncost: Object.freeze([RUNTIME_OPERATION_CAPABILITIES.FRAME_READ]),
10452
10460
  dedupe: Object.freeze([
@@ -10539,6 +10547,10 @@ var CAPABILITIES = Object.freeze([
10539
10547
  RUNTIME_OPERATION_CAPABILITIES.FRAME_READ,
10540
10548
  RUNTIME_OPERATION_CAPABILITIES.FRAME_WRITE,
10541
10549
  RUNTIME_OPERATION_CAPABILITIES.FRAME_DELETE,
10550
+ RUNTIME_OPERATION_CAPABILITIES.BEHAVIOR_READ,
10551
+ RUNTIME_OPERATION_CAPABILITIES.BEHAVIOR_WRITE,
10552
+ RUNTIME_OPERATION_CAPABILITIES.BEHAVIOR_PROMOTE,
10553
+ RUNTIME_OPERATION_CAPABILITIES.BEHAVIOR_PROVENANCE,
10542
10554
  RUNTIME_OPERATION_CAPABILITIES.WORKSPACE_BIND,
10543
10555
  RUNTIME_OPERATION_CAPABILITIES.WORKSPACE_INSPECT,
10544
10556
  RUNTIME_OPERATION_CAPABILITIES.WORKSPACE_REBIND,
@@ -10566,6 +10578,91 @@ var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.ex
10566
10578
  var import_node_crypto7 = require("crypto");
10567
10579
  var import_node_fs3 = require("fs");
10568
10580
 
10581
+ // node_modules/@smartergpt/lex/dist/knowledge/types.js
10582
+ var import_zod2 = require("zod");
10583
+ var KNOWLEDGE_FRAME_SCHEMA_VERSION = 1;
10584
+ var KnowledgeFrameTypeSchema = import_zod2.z.enum(["hypothesis", "evidence", "seam", "probe"]);
10585
+ var KnowledgeFrameLifecycleSchema = import_zod2.z.enum(["draft", "active", "retired"]);
10586
+ var KnowledgeFrameVisibilitySchema = import_zod2.z.literal("workspace");
10587
+ var KnowledgeConfidenceSchema = import_zod2.z.enum(["low", "medium", "high"]);
10588
+ var KnowledgeFrameIdSchema = import_zod2.z.string().min(1).max(200).regex(/^[a-z0-9][a-z0-9._/-]*$/, "must be a stable lowercase logical ID");
10589
+ var KnowledgeRelationSchema = import_zod2.z.object({
10590
+ type: import_zod2.z.string().min(1).max(80).regex(/^[a-z][a-z0-9-]*$/),
10591
+ target: KnowledgeFrameIdSchema
10592
+ }).strict();
10593
+ var KnowledgeProvenanceSchema = import_zod2.z.object({
10594
+ repositoryKey: import_zod2.z.string().min(1).max(200),
10595
+ path: import_zod2.z.string().min(1).max(512),
10596
+ anchor: KnowledgeFrameIdSchema,
10597
+ startLine: import_zod2.z.number().int().positive(),
10598
+ endLine: import_zod2.z.number().int().positive(),
10599
+ startByte: import_zod2.z.number().int().nonnegative(),
10600
+ endByte: import_zod2.z.number().int().nonnegative(),
10601
+ sourceDigest: import_zod2.z.string().regex(/^sha256:[a-f0-9]{64}$/),
10602
+ sourceLayer: import_zod2.z.enum(["commit", "working-tree"]),
10603
+ commitSha: import_zod2.z.string().regex(/^[a-f0-9]{40}$/),
10604
+ baseCommitSha: import_zod2.z.string().regex(/^[a-f0-9]{40}$/).optional(),
10605
+ branch: import_zod2.z.string().min(1).max(255).optional(),
10606
+ compilerVersion: import_zod2.z.string().min(1),
10607
+ snapshotId: import_zod2.z.string().regex(/^sha256:[a-f0-9]{64}$/)
10608
+ }).strict();
10609
+ var CommonKnowledgeFrameSchema = import_zod2.z.object({
10610
+ schemaVersion: import_zod2.z.literal(KNOWLEDGE_FRAME_SCHEMA_VERSION),
10611
+ id: KnowledgeFrameIdSchema,
10612
+ lifecycle: KnowledgeFrameLifecycleSchema,
10613
+ visibility: KnowledgeFrameVisibilitySchema,
10614
+ title: import_zod2.z.string().min(1).max(300),
10615
+ body: import_zod2.z.string().min(1).max(65536),
10616
+ relations: import_zod2.z.array(KnowledgeRelationSchema).max(100),
10617
+ provenance: KnowledgeProvenanceSchema,
10618
+ recordDigest: import_zod2.z.string().regex(/^sha256:[a-f0-9]{64}$/)
10619
+ });
10620
+ var HypothesisKnowledgeFrameSchema = CommonKnowledgeFrameSchema.extend({
10621
+ type: import_zod2.z.literal("hypothesis"),
10622
+ confidence: KnowledgeConfidenceSchema
10623
+ }).strict();
10624
+ var NonHypothesisKnowledgeFrameSchema = (type) => CommonKnowledgeFrameSchema.extend({ type: import_zod2.z.literal(type) }).strict();
10625
+ var KnowledgeFrameV1Schema = import_zod2.z.discriminatedUnion("type", [
10626
+ HypothesisKnowledgeFrameSchema,
10627
+ NonHypothesisKnowledgeFrameSchema("evidence"),
10628
+ NonHypothesisKnowledgeFrameSchema("seam"),
10629
+ NonHypothesisKnowledgeFrameSchema("probe")
10630
+ ]);
10631
+
10632
+ // node_modules/@smartergpt/lex/dist/knowledge/compiler.js
10633
+ var import_node_crypto8 = require("crypto");
10634
+ var import_node_path4 = require("path");
10635
+ var import_yaml = require("yaml");
10636
+ var import_zod3 = require("zod");
10637
+ var MarkerSchema = import_zod3.z.object({
10638
+ id: KnowledgeFrameIdSchema,
10639
+ type: KnowledgeFrameTypeSchema,
10640
+ lifecycle: KnowledgeFrameLifecycleSchema,
10641
+ confidence: KnowledgeConfidenceSchema.optional(),
10642
+ visibility: KnowledgeFrameVisibilitySchema.default("workspace"),
10643
+ relations: import_zod3.z.array(KnowledgeRelationSchema).max(100).default([])
10644
+ }).strict().superRefine((marker, context) => {
10645
+ if (marker.type === "hypothesis" && marker.confidence === void 0) {
10646
+ context.addIssue({
10647
+ code: "custom",
10648
+ path: ["confidence"],
10649
+ message: "is required for hypotheses"
10650
+ });
10651
+ }
10652
+ if (marker.type !== "hypothesis" && marker.confidence !== void 0) {
10653
+ context.addIssue({
10654
+ code: "custom",
10655
+ path: ["confidence"],
10656
+ message: `is not valid for ${marker.type} records`
10657
+ });
10658
+ }
10659
+ });
10660
+
10661
+ // node_modules/@smartergpt/lex/dist/knowledge/store.js
10662
+ var import_better_sqlite3_multiple_ciphers2 = __toESM(require("better-sqlite3-multiple-ciphers"), 1);
10663
+ var import_node_fs5 = require("fs");
10664
+ var import_node_path6 = require("path");
10665
+
10569
10666
  // node_modules/@smartergpt/lex/dist/memory/store/db.js
10570
10667
  var import_better_sqlite3_multiple_ciphers = __toESM(require("better-sqlite3-multiple-ciphers"), 1);
10571
10668
 
@@ -10727,7 +10824,7 @@ var fs = __toESM(require("fs"), 1);
10727
10824
 
10728
10825
  // node_modules/@smartergpt/lex/dist/shared/config/contained-path.js
10729
10826
  var import_node_fs4 = require("fs");
10730
- var import_node_path4 = require("path");
10827
+ var import_node_path5 = require("path");
10731
10828
 
10732
10829
  // node_modules/@smartergpt/lex/dist/shared/config/index.js
10733
10830
  var logger = getLogger("config");
@@ -10771,6 +10868,37 @@ function resolveCallerWorkspaceRoot(options = {}) {
10771
10868
  };
10772
10869
  }
10773
10870
 
10871
+ // node_modules/@smartergpt/lex/dist/knowledge/workspace.js
10872
+ var import_node_crypto9 = require("crypto");
10873
+ var import_node_fs6 = require("fs");
10874
+ var import_node_path7 = require("path");
10875
+ var import_node_child_process2 = require("child_process");
10876
+ var import_yaml2 = require("yaml");
10877
+
10878
+ // node_modules/@smartergpt/lex/dist/shared/config/lex-yaml-schema.js
10879
+ var import_zod4 = require("zod");
10880
+ var ProjectionsSchema = import_zod4.z.object({
10881
+ copilot: import_zod4.z.boolean().default(true),
10882
+ cursor: import_zod4.z.boolean().default(true)
10883
+ });
10884
+ var InstructionsSchema = import_zod4.z.object({
10885
+ canonical: import_zod4.z.string().default(".smartergpt/instructions/lex.md"),
10886
+ projections: ProjectionsSchema.optional()
10887
+ });
10888
+ var REPO_RELATIVE_SOURCE_PATH = /^(?!\/)(?![a-z]:\/)(?!.*(?:^|\/)\.\.(?:\/|$))(?!.*[*?\[\]{}!]).+\.md$/i;
10889
+ var KnowledgeSchema = import_zod4.z.object({
10890
+ sources: import_zod4.z.array(import_zod4.z.string().min(1).max(512).transform((value) => value.replaceAll("\\", "/")).refine((value) => REPO_RELATIVE_SOURCE_PATH.test(value), {
10891
+ message: "must be an exact repo-relative Markdown path without traversal or glob syntax"
10892
+ })).max(256).refine((sources) => new Set(sources).size === sources.length, {
10893
+ message: "must not contain duplicate source paths"
10894
+ })
10895
+ });
10896
+ var LexYamlSchema = import_zod4.z.object({
10897
+ version: import_zod4.z.literal(1),
10898
+ instructions: InstructionsSchema.optional(),
10899
+ knowledge: KnowledgeSchema.optional()
10900
+ });
10901
+
10774
10902
  // node_modules/@smartergpt/lex/dist/memory/store/scoped-frame-store.js
10775
10903
  var FRAME_STORE_CAPABILITIES = Object.freeze({
10776
10904
  READ: "frame:read",
@@ -10785,107 +10913,124 @@ var SCOPED_FRAME_STORE_ERROR_CODES = Object.freeze({
10785
10913
  STORE_CLOSED: "LEX_FRAME_STORE_CLOSED"
10786
10914
  });
10787
10915
 
10916
+ // node_modules/@smartergpt/lex/dist/memory/store/behavioral-store.js
10917
+ var import_node_crypto10 = require("crypto");
10918
+ var BEHAVIORAL_STORE_CAPABILITIES = Object.freeze({
10919
+ READ: "behavior:read",
10920
+ WRITE: "behavior:write",
10921
+ PROMOTE: "behavior:promote",
10922
+ PROVENANCE: "behavior:provenance"
10923
+ });
10924
+ var BEHAVIORAL_STORE_ERROR_CODES = Object.freeze({
10925
+ INVALID_BINDING: "LEX_BEHAVIORAL_INVALID_BINDING",
10926
+ CAPABILITY_MISSING: "LEX_BEHAVIORAL_CAPABILITY_MISSING",
10927
+ SCOPE_EXPIRED: "LEX_BEHAVIORAL_SCOPE_EXPIRED",
10928
+ STORE_CLOSED: "LEX_BEHAVIORAL_STORE_CLOSED",
10929
+ INVALID_INPUT: "LEX_BEHAVIORAL_INVALID_INPUT",
10930
+ REVISION_CONFLICT: "LEX_BEHAVIORAL_REVISION_CONFLICT"
10931
+ });
10932
+
10788
10933
  // node_modules/@smartergpt/lex/dist/memory/frames/types.js
10789
- var import_zod2 = require("zod");
10790
- var FrameSpendMetadata = import_zod2.z.object({
10791
- prompts: import_zod2.z.number().optional(),
10792
- tokens_estimated: import_zod2.z.number().optional()
10934
+ var import_zod5 = require("zod");
10935
+ var FrameSpendMetadata = import_zod5.z.object({
10936
+ prompts: import_zod5.z.number().optional(),
10937
+ tokens_estimated: import_zod5.z.number().optional()
10793
10938
  });
10794
- var ModuleAttribution = import_zod2.z.object({
10795
- mode: import_zod2.z.enum(["explicit", "inferred", "fallback"]),
10796
- confidence: import_zod2.z.enum(["high", "medium", "low"]),
10797
- evidence: import_zod2.z.array(import_zod2.z.string())
10939
+ var ModuleAttribution = import_zod5.z.object({
10940
+ mode: import_zod5.z.enum(["explicit", "inferred", "fallback"]),
10941
+ confidence: import_zod5.z.enum(["high", "medium", "low"]),
10942
+ evidence: import_zod5.z.array(import_zod5.z.string())
10798
10943
  });
10799
- var TurnCostComponent = import_zod2.z.object({
10800
- latency: import_zod2.z.number().describe("Response time in ms"),
10801
- contextReset: import_zod2.z.number().describe("Tokens for context re-establishment"),
10802
- renegotiation: import_zod2.z.number().describe("Count of clarification turns"),
10803
- tokenBloat: import_zod2.z.number().describe("Excess tokens beyond minimum"),
10804
- attentionSwitch: import_zod2.z.number().describe("Human intervention count")
10944
+ var TurnCostComponent = import_zod5.z.object({
10945
+ latency: import_zod5.z.number().describe("Response time in ms"),
10946
+ contextReset: import_zod5.z.number().describe("Tokens for context re-establishment"),
10947
+ renegotiation: import_zod5.z.number().describe("Count of clarification turns"),
10948
+ tokenBloat: import_zod5.z.number().describe("Excess tokens beyond minimum"),
10949
+ attentionSwitch: import_zod5.z.number().describe("Human intervention count")
10805
10950
  });
10806
- var TurnCostWeights = import_zod2.z.object({
10807
- lambda: import_zod2.z.number().default(0.1).describe("Latency weight"),
10808
- gamma: import_zod2.z.number().default(0.2).describe("Context reset weight"),
10809
- rho: import_zod2.z.number().default(0.3).describe("Renegotiation weight"),
10810
- tau: import_zod2.z.number().default(0.1).describe("Token bloat weight"),
10811
- alpha: import_zod2.z.number().default(0.3).describe("Attention switch weight")
10951
+ var TurnCostWeights = import_zod5.z.object({
10952
+ lambda: import_zod5.z.number().default(0.1).describe("Latency weight"),
10953
+ gamma: import_zod5.z.number().default(0.2).describe("Context reset weight"),
10954
+ rho: import_zod5.z.number().default(0.3).describe("Renegotiation weight"),
10955
+ tau: import_zod5.z.number().default(0.1).describe("Token bloat weight"),
10956
+ alpha: import_zod5.z.number().default(0.3).describe("Attention switch weight")
10812
10957
  });
10813
- var TurnCost = import_zod2.z.object({
10958
+ var TurnCost = import_zod5.z.object({
10814
10959
  components: TurnCostComponent,
10815
10960
  weights: TurnCostWeights.optional(),
10816
- weightedScore: import_zod2.z.number().optional().describe("Calculated weighted Turn Cost score"),
10817
- sessionId: import_zod2.z.string().optional().describe("Session identifier for Turn Cost tracking"),
10818
- timestamp: import_zod2.z.string().optional().describe("ISO 8601 timestamp of measurement")
10961
+ weightedScore: import_zod5.z.number().optional().describe("Calculated weighted Turn Cost score"),
10962
+ sessionId: import_zod5.z.string().optional().describe("Session identifier for Turn Cost tracking"),
10963
+ timestamp: import_zod5.z.string().optional().describe("ISO 8601 timestamp of measurement")
10819
10964
  });
10820
- var FrameStatusSnapshot = import_zod2.z.object({
10821
- next_action: import_zod2.z.string(),
10822
- blockers: import_zod2.z.array(import_zod2.z.string()).optional(),
10823
- merge_blockers: import_zod2.z.array(import_zod2.z.string()).optional(),
10824
- tests_failing: import_zod2.z.array(import_zod2.z.string()).optional()
10965
+ var FrameStatusSnapshot = import_zod5.z.object({
10966
+ next_action: import_zod5.z.string(),
10967
+ blockers: import_zod5.z.array(import_zod5.z.string()).optional(),
10968
+ merge_blockers: import_zod5.z.array(import_zod5.z.string()).optional(),
10969
+ tests_failing: import_zod5.z.array(import_zod5.z.string()).optional()
10825
10970
  });
10826
- var CapabilityTier = import_zod2.z.enum(["senior", "mid", "junior"]);
10827
- var TaskComplexity = import_zod2.z.object({
10971
+ var CapabilityTier = import_zod5.z.enum(["senior", "mid", "junior"]);
10972
+ var TaskComplexity = import_zod5.z.object({
10828
10973
  tier: CapabilityTier,
10829
- assignedModel: import_zod2.z.string().optional(),
10830
- actualModel: import_zod2.z.string().optional(),
10974
+ assignedModel: import_zod5.z.string().optional(),
10975
+ actualModel: import_zod5.z.string().optional(),
10831
10976
  // What model actually did the work
10832
- escalated: import_zod2.z.boolean().optional(),
10833
- escalationReason: import_zod2.z.string().optional(),
10834
- retryCount: import_zod2.z.number().optional(),
10835
- tierMismatch: import_zod2.z.boolean().optional()
10977
+ escalated: import_zod5.z.boolean().optional(),
10978
+ escalationReason: import_zod5.z.string().optional(),
10979
+ retryCount: import_zod5.z.number().optional(),
10980
+ tierMismatch: import_zod5.z.boolean().optional()
10836
10981
  // Did actual tier differ from suggested?
10837
10982
  });
10838
- var Frame = import_zod2.z.object({
10839
- id: import_zod2.z.string(),
10840
- timestamp: import_zod2.z.string(),
10983
+ var Frame = import_zod5.z.object({
10984
+ id: import_zod5.z.string(),
10985
+ timestamp: import_zod5.z.string(),
10841
10986
  // ISO 8601
10842
- branch: import_zod2.z.string(),
10843
- jira: import_zod2.z.string().optional(),
10844
- module_scope: import_zod2.z.array(import_zod2.z.string()),
10987
+ branch: import_zod5.z.string(),
10988
+ jira: import_zod5.z.string().optional(),
10989
+ module_scope: import_zod5.z.array(import_zod5.z.string()),
10845
10990
  // Must match lexmap.policy.json module IDs (THE CRITICAL RULE)
10846
- summary_caption: import_zod2.z.string(),
10847
- reference_point: import_zod2.z.string(),
10991
+ summary_caption: import_zod5.z.string(),
10992
+ reference_point: import_zod5.z.string(),
10848
10993
  // Human-memorable anchor phrase
10849
10994
  status_snapshot: FrameStatusSnapshot,
10850
- keywords: import_zod2.z.array(import_zod2.z.string()).optional(),
10851
- atlas_frame_id: import_zod2.z.string().optional(),
10995
+ keywords: import_zod5.z.array(import_zod5.z.string()).optional(),
10996
+ atlas_frame_id: import_zod5.z.string().optional(),
10852
10997
  // Link to Atlas Frame (spatial neighborhood)
10853
- feature_flags: import_zod2.z.array(import_zod2.z.string()).optional(),
10854
- permissions: import_zod2.z.array(import_zod2.z.string()).optional(),
10998
+ feature_flags: import_zod5.z.array(import_zod5.z.string()).optional(),
10999
+ permissions: import_zod5.z.array(import_zod5.z.string()).optional(),
10855
11000
  module_attribution: ModuleAttribution.optional(),
10856
- image_ids: import_zod2.z.array(import_zod2.z.string()).optional(),
11001
+ image_ids: import_zod5.z.array(import_zod5.z.string()).optional(),
10857
11002
  // Merge-weave metadata (v2)
10858
- runId: import_zod2.z.string().optional(),
10859
- planHash: import_zod2.z.string().optional(),
11003
+ runId: import_zod5.z.string().optional(),
11004
+ planHash: import_zod5.z.string().optional(),
10860
11005
  spend: FrameSpendMetadata.optional(),
10861
11006
  // OAuth2/JWT user isolation (v3)
10862
- userId: import_zod2.z.string().optional(),
11007
+ userId: import_zod5.z.string().optional(),
10863
11008
  // LexRunner structured metadata (v3)
10864
- executorRole: import_zod2.z.string().optional(),
10865
- toolCalls: import_zod2.z.array(import_zod2.z.string()).optional(),
10866
- guardrailProfile: import_zod2.z.string().optional(),
11009
+ executorRole: import_zod5.z.string().optional(),
11010
+ toolCalls: import_zod5.z.array(import_zod5.z.string()).optional(),
11011
+ guardrailProfile: import_zod5.z.string().optional(),
10867
11012
  // Turn Cost metrics (v4)
10868
11013
  turnCost: TurnCost.optional(),
10869
11014
  // Capability tier classification (v4)
10870
11015
  capabilityTier: CapabilityTier.optional(),
10871
11016
  taskComplexity: TaskComplexity.optional(),
10872
11017
  // Deduplication metadata (v5)
10873
- superseded_by: import_zod2.z.string().optional(),
10874
- merged_from: import_zod2.z.array(import_zod2.z.string()).optional(),
11018
+ superseded_by: import_zod5.z.string().optional(),
11019
+ merged_from: import_zod5.z.array(import_zod5.z.string()).optional(),
10875
11020
  // Contradiction metadata (v6)
10876
- contradiction_resolution: import_zod2.z.object({
10877
- type: import_zod2.z.enum(["supersede", "scope", "keep-both", "cancel"]),
10878
- contradicts_frame_id: import_zod2.z.string(),
10879
- scope: import_zod2.z.string().optional(),
10880
- note: import_zod2.z.string().optional()
11021
+ contradiction_resolution: import_zod5.z.object({
11022
+ type: import_zod5.z.enum(["supersede", "scope", "keep-both", "cancel"]),
11023
+ contradicts_frame_id: import_zod5.z.string(),
11024
+ scope: import_zod5.z.string().optional(),
11025
+ note: import_zod5.z.string().optional()
10881
11026
  }).optional()
10882
11027
  });
10883
11028
 
10884
11029
  // node_modules/@smartergpt/lex/dist/shared/config/store-identity.js
10885
- var import_node_crypto8 = require("crypto");
10886
- var import_node_fs5 = require("fs");
11030
+ var import_node_crypto11 = require("crypto");
11031
+ var import_node_fs7 = require("fs");
10887
11032
  var import_node_os = require("os");
10888
- var import_node_path5 = require("path");
11033
+ var import_node_path8 = require("path");
10889
11034
 
10890
11035
  // node_modules/@smartergpt/lex/dist/memory/store/code-unit-queries.js
10891
11036
  var logger2 = getNDJSONLogger("memory/store/code-unit-queries");
@@ -10894,7 +11039,7 @@ var logger2 = getNDJSONLogger("memory/store/code-unit-queries");
10894
11039
  var logger3 = getNDJSONLogger("memory/store/code-atlas-runs");
10895
11040
 
10896
11041
  // node_modules/@smartergpt/lex/dist/memory/store/durable-frame-metadata.js
10897
- var import_zod3 = require("zod");
11042
+ var import_zod6 = require("zod");
10898
11043
  var DURABLE_FRAME_METADATA_VERSION = 1;
10899
11044
  var DurableFrameMetadata = Frame.pick({
10900
11045
  image_ids: true,
@@ -10905,7 +11050,7 @@ var DurableFrameMetadata = Frame.pick({
10905
11050
  capabilityTier: true,
10906
11051
  taskComplexity: true,
10907
11052
  contradiction_resolution: true
10908
- }).extend({ schemaVersion: import_zod3.z.literal(DURABLE_FRAME_METADATA_VERSION) }).strict();
11053
+ }).extend({ schemaVersion: import_zod6.z.literal(DURABLE_FRAME_METADATA_VERSION) }).strict();
10909
11054
 
10910
11055
  // node_modules/@smartergpt/lex/dist/memory/store/sqlite/scoped-schema.js
10911
11056
  var SCOPED_SQLITE_ERROR_CODES = Object.freeze({
@@ -10990,9 +11135,14 @@ var FRAME_UPSERT_SQL = `
10990
11135
  frame_metadata = excluded.frame_metadata
10991
11136
  `;
10992
11137
 
11138
+ // node_modules/@smartergpt/lex/dist/memory/store/sqlite/behavioral-store.js
11139
+ var import_node_fs8 = require("fs");
11140
+ var import_node_path9 = require("path");
11141
+ var import_better_sqlite3_multiple_ciphers3 = __toESM(require("better-sqlite3-multiple-ciphers"), 1);
11142
+
10993
11143
  // node_modules/@smartergpt/lex/dist/memory/store/sqlite/scoped-migration.js
10994
- var import_node_crypto9 = require("crypto");
10995
- var import_node_fs6 = require("fs");
11144
+ var import_node_crypto12 = require("crypto");
11145
+ var import_node_fs9 = require("fs");
10996
11146
  var LEGACY_FRAME_COLUMNS = Object.freeze([
10997
11147
  "id",
10998
11148
  "timestamp",
@@ -11043,7 +11193,7 @@ var MIGRATION_ACTIONS = Object.freeze([
11043
11193
  ]);
11044
11194
 
11045
11195
  // node_modules/@smartergpt/lex/dist/memory/store/postgres/frame-store.js
11046
- var import_node_crypto10 = require("crypto");
11196
+ var import_node_crypto13 = require("crypto");
11047
11197
 
11048
11198
  // node_modules/pg/esm/index.mjs
11049
11199
  var import_lib = __toESM(require_lib2(), 1);
@@ -11067,7 +11217,56 @@ var COMPATIBILITY_OBJECTS = Object.freeze({
11067
11217
  });
11068
11218
 
11069
11219
  // node_modules/@smartergpt/lex/dist/memory/store/postgres/scoped-frame-store.js
11070
- var import_node_crypto11 = require("crypto");
11220
+ var import_node_crypto14 = require("crypto");
11221
+
11222
+ // node_modules/@smartergpt/lex/dist/memory/store/postgres/behavioral-store.js
11223
+ var import_node_crypto15 = require("crypto");
11224
+ var RELATIONS = Object.freeze([
11225
+ "lex_behavioral_persona_revisions",
11226
+ "lex_behavioral_rule_revisions",
11227
+ "lex_behavioral_evidence",
11228
+ "lex_behavioral_promotions",
11229
+ "lex_behavioral_write_receipts"
11230
+ ]);
11231
+
11232
+ // node_modules/@smartergpt/lex/dist/memory/store/postgres/quarantine-recovery.js
11233
+ var import_node_crypto16 = require("crypto");
11234
+ var QUARANTINE_RECOVERY_ERROR_CODES = Object.freeze({
11235
+ INVALID_INPUT: "LEX_QUARANTINE_RECOVERY_INVALID_INPUT",
11236
+ UNSUPPORTED_SCHEMA: "LEX_QUARANTINE_RECOVERY_UNSUPPORTED_SCHEMA",
11237
+ DUPLICATE_SOURCE: "LEX_QUARANTINE_RECOVERY_DUPLICATE_SOURCE",
11238
+ PARTIAL_SELECTION: "LEX_QUARANTINE_RECOVERY_PARTIAL_SELECTION",
11239
+ STALE_INVENTORY: "LEX_QUARANTINE_RECOVERY_STALE_INVENTORY",
11240
+ AUTHORITY_MISSING: "LEX_QUARANTINE_RECOVERY_AUTHORITY_MISSING",
11241
+ DESTINATION_COLLISION: "LEX_QUARANTINE_RECOVERY_DESTINATION_COLLISION",
11242
+ ADMINISTRATION_CLOSED: "LEX_QUARANTINE_RECOVERY_ADMINISTRATION_CLOSED",
11243
+ RECOVERY_NOT_FOUND: "LEX_QUARANTINE_RECOVERY_NOT_FOUND",
11244
+ RECOVERY_ALREADY_CLEANED: "LEX_QUARANTINE_RECOVERY_ALREADY_CLEANED"
11245
+ });
11246
+
11247
+ // node_modules/@smartergpt/lex/dist/memory/store/postgres/quarantine-recovery-administration.js
11248
+ var LEGACY_COLUMNS = Object.freeze([
11249
+ ["id", "text", "NO"],
11250
+ ["timestamp", "text", "NO"],
11251
+ ["branch", "text", "NO"],
11252
+ ["jira", "text", "YES"],
11253
+ ["module_scope", "_text", "NO"],
11254
+ ["summary_caption", "text", "NO"],
11255
+ ["reference_point", "text", "NO"],
11256
+ ["status_snapshot", "jsonb", "NO"],
11257
+ ["keywords", "_text", "YES"],
11258
+ ["atlas_frame_id", "text", "YES"],
11259
+ ["feature_flags", "_text", "YES"],
11260
+ ["permissions", "_text", "YES"],
11261
+ ["module_attribution", "jsonb", "YES"],
11262
+ ["run_id", "text", "YES"],
11263
+ ["plan_hash", "text", "YES"],
11264
+ ["spend", "jsonb", "YES"],
11265
+ ["user_id", "text", "YES"],
11266
+ ["superseded_by", "text", "YES"],
11267
+ ["merged_from", "_text", "YES"],
11268
+ ["search_vector", "tsvector", "NO"]
11269
+ ]);
11071
11270
 
11072
11271
  // node_modules/@smartergpt/lex/dist/memory/store/queries.js
11073
11272
  var logger4 = getNDJSONLogger("memory/store");
@@ -11103,28 +11302,28 @@ var import_fs3 = require("fs");
11103
11302
  var import_path3 = require("path");
11104
11303
 
11105
11304
  // node_modules/@smartergpt/lex/dist/shared/errors/ax-error.js
11106
- var import_zod4 = require("zod");
11107
- var AXErrorSchema = import_zod4.z.object({
11305
+ var import_zod7 = require("zod");
11306
+ var AXErrorSchema = import_zod7.z.object({
11108
11307
  /**
11109
11308
  * Stable error code in UPPER_SNAKE_CASE
11110
11309
  * Must be unique and documented in error-codes.ts
11111
11310
  */
11112
- code: import_zod4.z.string().regex(/^[A-Z][A-Z0-9_]*$/, "Error code must be UPPER_SNAKE_CASE (e.g., FRAME_NOT_FOUND)"),
11311
+ code: import_zod7.z.string().regex(/^[A-Z][A-Z0-9_]*$/, "Error code must be UPPER_SNAKE_CASE (e.g., FRAME_NOT_FOUND)"),
11113
11312
  /**
11114
11313
  * Human-readable error message
11115
11314
  * Should be concise but descriptive
11116
11315
  */
11117
- message: import_zod4.z.string().min(1, "Message is required"),
11316
+ message: import_zod7.z.string().min(1, "Message is required"),
11118
11317
  /**
11119
11318
  * Optional structured context about the error
11120
11319
  * Include relevant IDs, paths, or values that help diagnose
11121
11320
  */
11122
- context: import_zod4.z.record(import_zod4.z.string(), import_zod4.z.unknown()).optional(),
11321
+ context: import_zod7.z.record(import_zod7.z.string(), import_zod7.z.unknown()).optional(),
11123
11322
  /**
11124
11323
  * Recovery suggestions - at least one required
11125
11324
  * These tell the agent what to try next
11126
11325
  */
11127
- nextActions: import_zod4.z.array(import_zod4.z.string().min(1)).min(1, "At least one nextAction is required")
11326
+ nextActions: import_zod7.z.array(import_zod7.z.string().min(1)).min(1, "At least one nextAction is required")
11128
11327
  });
11129
11328
  function createAXError(code, message, nextActions, context) {
11130
11329
  return AXErrorSchema.parse({ code, message, nextActions, context });
@@ -11383,9 +11582,9 @@ function extractCanonicalIds(resolutions) {
11383
11582
  }
11384
11583
 
11385
11584
  // src/util/hash.ts
11386
- var import_node_crypto12 = require("crypto");
11387
- var import_node_fs7 = __toESM(require("fs"), 1);
11388
- var sha256 = (buf) => (0, import_node_crypto12.createHash)("sha256").update(buf).digest("hex");
11585
+ var import_node_crypto17 = require("crypto");
11586
+ var import_node_fs10 = __toESM(require("fs"), 1);
11587
+ var sha256 = (buf) => (0, import_node_crypto17.createHash)("sha256").update(buf).digest("hex");
11389
11588
 
11390
11589
  // src/frames/storage.ts
11391
11590
  var fs4 = __toESM(require("fs"), 1);