@event4u/agent-config 17.3.0 → 17.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.
Files changed (137) hide show
  1. package/.augment-plugin/marketplace.json +3 -3
  2. package/.augment-plugin/plugin.json +1 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/CHANGELOG.md +164 -342
  5. package/CREDITS.md +2 -2
  6. package/README.md +1 -1
  7. package/dist/agent-src/skills/code-intelligence/SKILL.md +3 -0
  8. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  9. package/dist/cli/registry.js +2 -2
  10. package/dist/cli-delegate/{chunk-DHSSP7V3.js → chunk-5AYJGUA3.js} +0 -2
  11. package/dist/cli-delegate/chunk-DIFZBP4G.js +1336 -0
  12. package/dist/cli-delegate/{chunk-MT2WOOCY.js → chunk-WY5ZZPGL.js} +2 -2
  13. package/dist/cli-delegate/{chunk-ORJPBER2.js → chunk-X6LZ7W5A.js} +73 -10
  14. package/dist/cli-delegate/cmd_conformance.js +175 -183
  15. package/dist/cli-delegate/cmd_doctor.js +5 -5
  16. package/dist/cli-delegate/cmd_doctor_neighbours.js +3 -3
  17. package/dist/cli-delegate/cmd_explain.js +1 -1
  18. package/dist/cli-delegate/cmd_handoff.js +2 -2
  19. package/dist/cli-delegate/cmd_memory_get.js +1 -1
  20. package/dist/cli-delegate/cmd_route_audit.js +1 -1
  21. package/dist/cli-delegate/cmd_session_recycle.js +2 -2
  22. package/dist/cli-delegate/cmd_update.js +24 -13
  23. package/dist/cli-delegate/cmd_upgrade.js +2 -2
  24. package/dist/cli-delegate/dist-25AZAHOP.js +3240 -0
  25. package/dist/cli-delegate/dist-P7MFPMF3.js +411 -0
  26. package/dist/cli-delegate/dist-XAS5ZLQB.js +6 -0
  27. package/dist/cli-delegate/{upgrade_unattended-VVL6JLSX.js → upgrade_unattended-QCWOKTUN.js} +178 -163
  28. package/dist/discovery/deprecation-report.md +1 -1
  29. package/dist/discovery/discovery-manifest.json +3 -3
  30. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  31. package/dist/discovery/discovery-manifest.summary.md +1 -1
  32. package/dist/discovery/dormancy-report.md +1 -1
  33. package/dist/discovery/orphan-report.md +1 -1
  34. package/dist/discovery/packs.json +2 -2
  35. package/dist/discovery/trust-report.md +1 -1
  36. package/dist/discovery/workspaces.json +2 -2
  37. package/dist/hooks/code_graph_refresh.chunk.cjs +56 -27
  38. package/dist/hooks/code_graph_refresh.chunk.cjs.sha256 +1 -1
  39. package/dist/hooks/dispatch.js +982 -929
  40. package/dist/hooks/dispatch.sha256 +1 -1
  41. package/dist/hooks/egress_engine.chunk.cjs +56 -6
  42. package/dist/hooks/egress_engine.chunk.cjs.sha256 +1 -1
  43. package/dist/hooks/update_notice.chunk.cjs +914 -0
  44. package/dist/hooks/update_notice.chunk.cjs.sha256 +1 -0
  45. package/dist/mcp/registry-manifest.json +1 -1
  46. package/dist/mcp/server.json +2 -2
  47. package/dist/mcp/server.mjs +71259 -66437
  48. package/dist/scripts/condense.js +9 -6
  49. package/package.json +4 -1
  50. package/src/config/evaluator-budgets.json +9 -8
  51. package/src/config/gate-violation-baselines.json +2 -2
  52. package/src/config/hook-bundle-budget.json +31 -6
  53. package/src/config/packed-binary-manifest.json +9 -0
  54. package/src/config/sigstore/npm_keys.json +50 -0
  55. package/src/config/sigstore/trust-material.json +9 -0
  56. package/src/config/sigstore/trusted_root.json +126 -0
  57. package/src/config/skill-body-budget.json +7 -1
  58. package/src/scripts/_cli/cmd_update.ts +48 -20
  59. package/src/scripts/_cli/cmd_upgrade.ts +7 -1
  60. package/src/scripts/_cli/upgrade_unattended.ts +90 -76
  61. package/src/scripts/_dispatch.bash +3 -2
  62. package/src/scripts/_lib/confusables.ts +0 -19
  63. package/src/scripts/_lib/egress_normalize.ts +53 -23
  64. package/src/scripts/_lib/egress_text.ts +5 -3
  65. package/src/scripts/_lib/egress_token.ts +7 -5
  66. package/src/scripts/_lib/gate_collector_experimental.ts +633 -0
  67. package/src/scripts/_lib/git_common_dir.ts +10 -0
  68. package/src/scripts/_lib/graph_feeder_record.ts +3 -2
  69. package/src/scripts/_lib/install_reach_checks.ts +32 -2
  70. package/src/scripts/_lib/lineage_backfill.ts +136 -0
  71. package/src/scripts/_lib/lineage_ledger.ts +211 -0
  72. package/src/scripts/_lib/lineage_map.ts +55 -0
  73. package/src/scripts/_lib/lineage_query.ts +140 -0
  74. package/src/scripts/_lib/lineage_seed.ts +116 -0
  75. package/src/scripts/_lib/lineage_watch.ts +249 -0
  76. package/src/scripts/_lib/link_crypto.ts +8 -4
  77. package/src/scripts/_lib/production_reach.ts +3 -3
  78. package/src/scripts/_lib/project_registry.ts +227 -0
  79. package/src/scripts/_lib/provenance_verify.ts +14 -242
  80. package/src/scripts/_lib/sigstore_provenance.ts +177 -0
  81. package/src/scripts/_lib/source_id.ts +48 -0
  82. package/src/scripts/_lib/source_shape.ts +4 -0
  83. package/src/scripts/_lib/unattended_gates.ts +6 -1
  84. package/src/scripts/advisories.ts +26 -10
  85. package/src/scripts/ai_council/council_egress.ts +5 -6
  86. package/src/scripts/bench_graph_feeder_latency.ts +10 -3
  87. package/src/scripts/check_dependency_floors.ts +7 -0
  88. package/src/scripts/check_egress_mutations.ts +1 -0
  89. package/src/scripts/code_graph/build.ts +67 -3
  90. package/src/scripts/code_graph/cli.ts +131 -28
  91. package/src/scripts/code_graph/conventions_default.ts +20 -1
  92. package/src/scripts/code_graph/detect.ts +5 -5
  93. package/src/scripts/code_graph/estate_cli.ts +135 -0
  94. package/src/scripts/code_graph/estate_index.ts +394 -0
  95. package/src/scripts/code_graph/estate_manifests.ts +223 -0
  96. package/src/scripts/code_graph/estate_map.ts +141 -0
  97. package/src/scripts/code_graph/extract.ts +4 -1
  98. package/src/scripts/code_graph/extract_more.ts +137 -2
  99. package/src/scripts/code_graph/graph_budget.ts +158 -0
  100. package/src/scripts/code_graph/graph_home.ts +80 -0
  101. package/src/scripts/code_graph/lineage_cli.ts +315 -0
  102. package/src/scripts/code_graph/map.ts +22 -13
  103. package/src/scripts/code_graph/map_model.ts +67 -12
  104. package/src/scripts/code_graph/map_verify.ts +68 -5
  105. package/src/scripts/code_graph/map_viewer/viewer.css +12 -0
  106. package/src/scripts/code_graph/map_viewer/viewer.js +45 -15
  107. package/src/scripts/code_graph/project_ref.ts +25 -0
  108. package/src/scripts/code_graph/projects_cli.ts +254 -0
  109. package/src/scripts/code_graph/providers/catalog.ts +14 -5
  110. package/src/scripts/code_graph/providers/django.ts +52 -9
  111. package/src/scripts/code_graph/providers/index.ts +2 -0
  112. package/src/scripts/code_graph/providers/rails.ts +204 -0
  113. package/src/scripts/code_graph/providers/spring.ts +38 -1
  114. package/src/scripts/code_graph/query.ts +9 -9
  115. package/src/scripts/code_graph/refresh_lock.ts +12 -8
  116. package/src/scripts/code_graph/repo_identity.ts +169 -0
  117. package/src/scripts/code_graph/sqlite_store.ts +22 -25
  118. package/src/scripts/code_graph/types.ts +6 -2
  119. package/src/scripts/condense.ts +6 -6
  120. package/src/scripts/hook_chunks.mjs +7 -0
  121. package/src/scripts/hook_manifest.json +1 -1
  122. package/src/scripts/hook_manifest.yaml +20 -17
  123. package/src/scripts/hooks/code_graph_refresh_hook.ts +10 -7
  124. package/src/scripts/hooks/dispatch_hook.ts +6 -7
  125. package/src/scripts/hooks/host_semantics.ts +72 -0
  126. package/src/scripts/hooks/lazy_concern.ts +4 -0
  127. package/src/scripts/hooks/user_notice.ts +105 -0
  128. package/src/scripts/lint_harvest_provenance.ts +137 -11
  129. package/src/scripts/mcp_server/consumer_tool_catalog.json +69 -15
  130. package/src/scripts/mcp_server/graph_tools.ts +161 -41
  131. package/src/scripts/network_sources.ts +24 -6
  132. package/src/scripts/schemas/provenance-mechanism.schema.json +46 -0
  133. package/src/scripts/update_notice_hook.ts +75 -7
  134. package/src/vendor/grammars/README.md +7 -6
  135. package/src/vendor/grammars/tree-sitter-ruby.wasm +0 -0
  136. /package/dist/cli-delegate/{chunk-FKYZOWVD.js → chunk-QBAFP67O.js} +0 -0
  137. /package/dist/cli-delegate/{chunk-BMGUGSY6.js → chunk-TQG6UMPC.js} +0 -0
@@ -32,7 +32,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
32
32
  // src/scripts/hooks/code_graph_refresh_hook.ts
33
33
  var code_graph_refresh_hook_exports = {};
34
34
  __export(code_graph_refresh_hook_exports, {
35
- CACHE_REL: () => CACHE_REL,
36
35
  REFRESH_ARGS: () => REFRESH_ARGS,
37
36
  main: () => main,
38
37
  refreshFor: () => refreshFor,
@@ -41,8 +40,8 @@ __export(code_graph_refresh_hook_exports, {
41
40
  });
42
41
  module.exports = __toCommonJS(code_graph_refresh_hook_exports);
43
42
  var import_node_child_process = require("node:child_process");
44
- var fs4 = __toESM(require("node:fs"), 1);
45
- var path3 = __toESM(require("node:path"), 1);
43
+ var fs5 = __toESM(require("node:fs"), 1);
44
+ var path5 = __toESM(require("node:path"), 1);
46
45
  var import_node_url = require("node:url");
47
46
 
48
47
  // src/scripts/_lib/spawn_env.ts
@@ -158,19 +157,49 @@ function usableCli(root, envPath) {
158
157
  return cliIsCapable(cli) ? { cli } : { reason: "cli-too-old", cli };
159
158
  }
160
159
 
161
- // src/scripts/code_graph/refresh_lock.ts
160
+ // src/scripts/code_graph/graph_home.ts
162
161
  var fs2 = __toESM(require("node:fs"), 1);
163
- var os = __toESM(require("node:os"), 1);
162
+ var path3 = __toESM(require("node:path"), 1);
163
+
164
+ // src/scripts/_lib/user_global_paths.ts
164
165
  var path2 = __toESM(require("node:path"), 1);
165
- var LOCK_REL = path2.join("agents", "runtime", "state", "code-graph-refresh.lock");
166
- var AUTO_REFRESH_REL = path2.join("agents", "runtime", "state", "code-graph-auto-refresh.json");
166
+ var DEFAULT_EVENT4U_ROOT_RELATIVE = path2.join(".event4u", "agent-config");
167
+ var LEGACY_XDG_ROOT_RELATIVE = path2.join(".config", "agent-config");
168
+
169
+ // src/scripts/code_graph/graph_home.ts
170
+ var STATE_DIR_REL = path3.join("agents", "runtime", "state");
171
+ var NATIVE_CACHE_REL = path3.join(STATE_DIR_REL, "code-graph-v1.json");
172
+ var MAP_DIR_REL = path3.join("agents", "map");
173
+ var LOCK_REL = path3.join(STATE_DIR_REL, "code-graph-refresh.lock");
174
+ var AUTO_REFRESH_REL = path3.join(STATE_DIR_REL, "code-graph-auto-refresh.json");
175
+ function hasProjectHome(root) {
176
+ return fs2.existsSync(path3.join(root, "agents")) || fs2.existsSync(path3.join(root, ".agent-settings.yml"));
177
+ }
178
+ function projectHome(root) {
179
+ return {
180
+ kind: "project",
181
+ root,
182
+ dir: path3.join(root, "agents"),
183
+ stateDir: path3.join(root, STATE_DIR_REL),
184
+ cachePath: path3.join(root, NATIVE_CACHE_REL),
185
+ mapDir: path3.join(root, MAP_DIR_REL),
186
+ lockPath: path3.join(root, LOCK_REL),
187
+ autoRefreshPath: path3.join(root, AUTO_REFRESH_REL),
188
+ repoId: null,
189
+ instance: null
190
+ };
191
+ }
192
+
193
+ // src/scripts/code_graph/refresh_lock.ts
194
+ var fs3 = __toESM(require("node:fs"), 1);
195
+ var os = __toESM(require("node:os"), 1);
196
+ var path4 = __toESM(require("node:path"), 1);
167
197
  var STALE_LOCK_MS = 5 * 60 * 1e3;
168
198
  var MAX_LOCK_AGE_MS = 30 * 60 * 1e3;
169
199
  var ownerPath = (lock) => `${lock}.owner.json`;
170
- var refreshRecordPath = (root, by) => path2.join(root, path2.dirname(LOCK_REL), `code-graph-refresh.${by}.json`);
171
- function recordRefresh(root, rec) {
200
+ function recordRefreshIn(stateDir, rec) {
172
201
  try {
173
- fs2.writeFileSync(refreshRecordPath(root, rec.by), JSON.stringify({ at: (/* @__PURE__ */ new Date()).toISOString(), ...rec }));
202
+ fs3.writeFileSync(path4.join(stateDir, `code-graph-refresh.${rec.by}.json`), JSON.stringify({ at: (/* @__PURE__ */ new Date()).toISOString(), ...rec }));
174
203
  } catch {
175
204
  }
176
205
  }
@@ -186,7 +215,7 @@ var errno = (e) => e.code;
186
215
  function readOwner(lock) {
187
216
  let raw;
188
217
  try {
189
- raw = fs2.readFileSync(ownerPath(lock), "utf-8");
218
+ raw = fs3.readFileSync(ownerPath(lock), "utf-8");
190
219
  } catch (e) {
191
220
  return errno(e) === "ENOENT" ? "none" : "unreadable";
192
221
  }
@@ -205,7 +234,7 @@ function isStale(lock, now = Date.now()) {
205
234
  return !pidAlive(owner.pid);
206
235
  }
207
236
  try {
208
- return now - fs2.statSync(lock).mtimeMs > STALE_LOCK_MS;
237
+ return now - fs3.statSync(lock).mtimeMs > STALE_LOCK_MS;
209
238
  } catch (e) {
210
239
  return errno(e) === "ENOENT";
211
240
  }
@@ -251,7 +280,7 @@ var EXIT_CODES = Object.freeze([
251
280
  var tty = __toESM(require("node:tty"), 1);
252
281
 
253
282
  // src/scripts/_lib/stdin.ts
254
- var fs3 = __toESM(require("node:fs"), 1);
283
+ var fs4 = __toESM(require("node:fs"), 1);
255
284
  var CHUNK = 64 * 1024;
256
285
  var RETRY_SLEEP_MS = 5;
257
286
  var MAX_RETRIES = 2e3;
@@ -267,7 +296,7 @@ function readStdinText(fd = 0, opts = {}) {
267
296
  for (; ; ) {
268
297
  let read;
269
298
  try {
270
- read = fs3.readSync(fd, buf, 0, CHUNK, null);
299
+ read = fs4.readSync(fd, buf, 0, CHUNK, null);
271
300
  retries = 0;
272
301
  } catch (exc) {
273
302
  const code = exc.code;
@@ -322,23 +351,22 @@ function is_replay_mode() {
322
351
  }
323
352
 
324
353
  // src/scripts/hooks/code_graph_refresh_hook.ts
325
- var CACHE_REL = path3.join("agents", "runtime", "state", "code-graph-v1.json");
326
354
  var REFRESH_ARGS = ["code-graph", "refresh", "--single-flight", "--map", "--budget-seconds", "60"];
327
355
  function repoRoot(start) {
328
356
  let dir;
329
357
  try {
330
- dir = fs4.realpathSync(start);
358
+ dir = fs5.realpathSync(start);
331
359
  } catch {
332
360
  return null;
333
361
  }
334
362
  for (; ; ) {
335
363
  try {
336
- fs4.lstatSync(path3.join(dir, ".git"));
364
+ fs5.lstatSync(path5.join(dir, ".git"));
337
365
  return dir;
338
366
  } catch (e) {
339
367
  if (e.code !== "ENOENT") return null;
340
368
  }
341
- const up = path3.dirname(dir);
369
+ const up = path5.dirname(dir);
342
370
  if (up === dir) return null;
343
371
  dir = up;
344
372
  }
@@ -360,15 +388,17 @@ function refreshFor(cwd, spawnFn = import_node_child_process.spawn) {
360
388
  if (process.platform === "win32") return "unsupported";
361
389
  if (is_replay_mode()) return "replay";
362
390
  const root = repoRoot(cwd);
363
- if (root === null || !fs4.existsSync(path3.join(root, AUTO_REFRESH_REL))) return "not-opted-in";
364
- if (anyTracked(root, [AUTO_REFRESH_REL, CACHE_REL])) return "tracked";
391
+ if (root === null || !hasProjectHome(root)) return "not-opted-in";
392
+ const home = projectHome(root);
393
+ if (!fs5.existsSync(home.autoRefreshPath)) return "not-opted-in";
394
+ if (anyTracked(root, [home.autoRefreshPath, home.cachePath].map((p) => path5.relative(root, p)))) return "tracked";
365
395
  const done = (outcome, detail) => {
366
- recordRefresh(root, { by: "session-start", outcome, detail });
396
+ recordRefreshIn(home.stateDir, { by: "session-start", outcome, detail });
367
397
  return outcome;
368
398
  };
369
- if (!fs4.existsSync(path3.join(root, CACHE_REL))) return done("no-cache");
370
- const lock = path3.join(root, LOCK_REL);
371
- if (fs4.existsSync(lock) && !isStale(lock)) return done("locked");
399
+ if (!fs5.existsSync(home.cachePath)) return done("no-cache");
400
+ const lock = home.lockPath;
401
+ if (fs5.existsSync(lock) && !isStale(lock)) return done("locked");
372
402
  const verdict = usableCli(root);
373
403
  if ("reason" in verdict) return done(verdict.reason, verdict.cli);
374
404
  const child = spawnFn(verdict.cli, [...REFRESH_ARGS, "--root", root], {
@@ -395,9 +425,9 @@ function main() {
395
425
  function isCliEntry() {
396
426
  if (true) return false;
397
427
  if (process.argv[1] === void 0) return false;
398
- if (__acChunkMetaUrl === (0, import_node_url.pathToFileURL)(path3.resolve(process.argv[1])).href) return true;
428
+ if (__acChunkMetaUrl === (0, import_node_url.pathToFileURL)(path5.resolve(process.argv[1])).href) return true;
399
429
  try {
400
- return fs4.realpathSync((0, import_node_url.fileURLToPath)(__acChunkMetaUrl)) === fs4.realpathSync(path3.resolve(process.argv[1]));
430
+ return fs5.realpathSync((0, import_node_url.fileURLToPath)(__acChunkMetaUrl)) === fs5.realpathSync(path5.resolve(process.argv[1]));
401
431
  } catch {
402
432
  return false;
403
433
  }
@@ -405,7 +435,6 @@ function isCliEntry() {
405
435
  if (isCliEntry()) process.exit(main());
406
436
  // Annotate the CommonJS export names for ESM import in node:
407
437
  0 && (module.exports = {
408
- CACHE_REL,
409
438
  REFRESH_ARGS,
410
439
  main,
411
440
  refreshFor,
@@ -1 +1 @@
1
- 0374823b04e1d61f886025ef497df1565ae0973573a0b0a7032a73a4b501c2e5 code_graph_refresh.chunk.cjs
1
+ fdef0100152bef370980295f03f85f4c6ea3bab4376cecda0c83479b6c97ed4b code_graph_refresh.chunk.cjs