@event4u/agent-config 9.10.0 → 9.12.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 (142) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +111 -0
  3. package/README.md +20 -16
  4. package/agents/templates/.ai-council.yml.example +481 -0
  5. package/agents/templates/.ai-video.xml.example +247 -0
  6. package/dist/agent-src/commands/fix/ci.md +29 -0
  7. package/dist/agent-src/commands/pr/create.md +60 -0
  8. package/dist/agent-src/contexts/authority/kernel-rule-edits.md +18 -2
  9. package/dist/agent-src/rules/design-fidelity.md +2 -2
  10. package/dist/agent-src/skills/ai-code-blindspots/SKILL.md +1 -0
  11. package/dist/agent-src/skills/design-intelligence/SKILL.md +27 -1
  12. package/dist/agent-src/skills/design-intelligence/data/font-pairings-reference.csv +74 -74
  13. package/dist/agent-src/skills/design-intelligence/data/manifest.json +2 -0
  14. package/dist/agent-src/skills/design-tokens/scripts/tokens.ts +0 -7
  15. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +15 -2
  16. package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
  17. package/dist/agent-src/skills/typography-system/SKILL.md +55 -11
  18. package/dist/agent-src/skills/ui-apply-generic/SKILL.md +180 -0
  19. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  20. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +34 -30
  21. package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
  22. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +23 -0
  23. package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +24 -1
  24. package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +332 -0
  25. package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +449 -11
  26. package/dist/agent-src/templates/scripts/work_engine/state.ts +21 -4
  27. package/dist/cli/initRouting.js +74 -11
  28. package/dist/cli/initRouting.js.map +1 -1
  29. package/dist/cli/main.js +14 -3
  30. package/dist/cli/main.js.map +1 -1
  31. package/dist/cli-delegate/chunk-523HCFYO.js +90 -0
  32. package/dist/cli-delegate/chunk-736JCWLM.js +1104 -0
  33. package/dist/cli-delegate/chunk-7HQ52DHU.js +74 -0
  34. package/dist/cli-delegate/chunk-A3HJ6NTI.js +1084 -0
  35. package/dist/cli-delegate/chunk-EJYIGZ3T.js +125 -0
  36. package/dist/cli-delegate/chunk-FTAISGDQ.js +117 -0
  37. package/dist/cli-delegate/chunk-GME3Q44L.js +82 -0
  38. package/dist/cli-delegate/chunk-GRRPEPRN.js +336 -0
  39. package/dist/cli-delegate/chunk-HJ6DAJHR.js +502 -0
  40. package/dist/cli-delegate/chunk-HYWSRNUX.js +179 -0
  41. package/dist/cli-delegate/chunk-J55WI3RR.js +47 -0
  42. package/dist/cli-delegate/chunk-MCJYCQPF.js +35 -0
  43. package/dist/cli-delegate/chunk-NDJLNC6Q.js +169 -0
  44. package/dist/cli-delegate/chunk-OMIVVCG2.js +26 -0
  45. package/dist/cli-delegate/chunk-OY53J6II.js +7336 -0
  46. package/dist/cli-delegate/chunk-QFKQLQ7X.js +10835 -0
  47. package/dist/cli-delegate/chunk-TEGJU2JX.js +6908 -0
  48. package/dist/cli-delegate/chunk-TJIAM5FW.js +133 -0
  49. package/dist/cli-delegate/chunk-XX6TOPD7.js +715 -0
  50. package/dist/cli-delegate/cmd_analyze_session.js +294 -0
  51. package/dist/cli-delegate/cmd_conformance.js +643 -0
  52. package/dist/cli-delegate/cmd_converge.js +326 -0
  53. package/dist/cli-delegate/cmd_doctor.js +142 -0
  54. package/dist/cli-delegate/cmd_explain.js +2576 -0
  55. package/dist/cli-delegate/cmd_export.js +298 -0
  56. package/dist/cli-delegate/cmd_fleet.js +333 -0
  57. package/dist/cli-delegate/cmd_memory_get.js +3878 -0
  58. package/dist/cli-delegate/cmd_migrate.js +11 -0
  59. package/dist/cli-delegate/cmd_preflight.js +153 -0
  60. package/dist/cli-delegate/cmd_prune.js +446 -0
  61. package/dist/cli-delegate/cmd_refresh.js +28 -0
  62. package/dist/cli-delegate/cmd_settings_check.js +574 -0
  63. package/dist/cli-delegate/cmd_settings_migrate.js +225 -0
  64. package/dist/cli-delegate/cmd_sync.js +266 -0
  65. package/dist/cli-delegate/cmd_uninstall.js +657 -0
  66. package/dist/cli-delegate/cmd_update.js +425 -0
  67. package/dist/cli-delegate/cmd_upgrade.js +444 -0
  68. package/dist/cli-delegate/cmd_validate.js +307 -0
  69. package/dist/cli-delegate/cmd_versions.js +370 -0
  70. package/dist/discovery/deprecation-report.md +1 -1
  71. package/dist/discovery/discovery-manifest.json +45 -16
  72. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  73. package/dist/discovery/discovery-manifest.summary.md +3 -3
  74. package/dist/discovery/orphan-report.md +1 -1
  75. package/dist/discovery/packs.json +13 -7
  76. package/dist/discovery/trust-report.md +2 -2
  77. package/dist/discovery/workspaces.json +6 -4
  78. package/dist/install/emit_host_rules_cli.js +2 -1
  79. package/dist/install/emit_host_rules_cli.js.map +1 -1
  80. package/dist/install/install.mjs +634 -409
  81. package/dist/install/ruleInScope.js +123 -0
  82. package/dist/install/ruleInScope.js.map +1 -0
  83. package/dist/install/rule_scope.js +7 -3
  84. package/dist/install/rule_scope.js.map +1 -1
  85. package/dist/install/toolDetection.js +40 -12
  86. package/dist/install/toolDetection.js.map +1 -1
  87. package/dist/install/wizard-plan.js +12 -3
  88. package/dist/install/wizard-plan.js.map +1 -1
  89. package/dist/mcp/registry-manifest.json +3 -3
  90. package/dist/mcp/server.json +2 -2
  91. package/dist/mcp/server.mjs +1553 -2728
  92. package/dist/router.json +1 -1
  93. package/dist/scripts/condense.js +6 -22
  94. package/dist/scripts/condense.js.map +1 -1
  95. package/docs/guidelines/design-fidelity-mechanics.md +14 -0
  96. package/package.json +4 -2
  97. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +34 -30
  98. package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
  99. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +23 -0
  100. package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +24 -1
  101. package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +332 -0
  102. package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +449 -11
  103. package/src/agent-src/templates/scripts/work_engine/state.ts +21 -4
  104. package/src/config/discovery/packs.yml +7 -0
  105. package/src/config/evaluator-budgets.json +1 -1
  106. package/src/config/pack-size-budget.json +27 -0
  107. package/src/install/emit_host_rules_cli.ts +2 -1
  108. package/src/install/ruleInScope.ts +133 -0
  109. package/src/install/rule_scope.ts +7 -3
  110. package/src/install/toolDetection.ts +39 -8
  111. package/src/install/wizard-plan.ts +13 -3
  112. package/src/scripts/_cli/cmd_conformance.ts +2 -1
  113. package/src/scripts/_cli/cmd_converge.ts +2 -1
  114. package/src/scripts/_cli/cmd_doctor.ts +214 -13
  115. package/src/scripts/_cli/cmd_export.ts +2 -1
  116. package/src/scripts/_cli/cmd_fleet.ts +2 -1
  117. package/src/scripts/_cli/cmd_migrate.ts +2 -1
  118. package/src/scripts/_cli/cmd_preflight.ts +2 -1
  119. package/src/scripts/_cli/cmd_refresh.ts +2 -1
  120. package/src/scripts/_cli/cmd_update.ts +2 -1
  121. package/src/scripts/_cli/cmd_upgrade.ts +2 -1
  122. package/src/scripts/_cli/cmd_versions.ts +2 -1
  123. package/src/scripts/_cli/detection_report.ts +480 -0
  124. package/src/scripts/_dispatch.bash +52 -14
  125. package/src/scripts/_lib/changelog_eras.ts +103 -9
  126. package/src/scripts/_lib/environment_detector.ts +441 -0
  127. package/src/scripts/_lib/global_deploy_inventory.ts +38 -2
  128. package/src/scripts/_lib/package_root.ts +72 -0
  129. package/src/scripts/ai_council/config.ts +15 -7
  130. package/src/scripts/ai_council/modes.ts +68 -2
  131. package/src/scripts/ai_council/transport_resolver.ts +331 -0
  132. package/src/scripts/check_bundle_path_leakage.ts +10 -4
  133. package/src/scripts/check_dependency_floors.ts +153 -0
  134. package/src/scripts/check_installer_import_purity.ts +295 -0
  135. package/src/scripts/check_pack_size.ts +188 -0
  136. package/src/scripts/condense.ts +7 -28
  137. package/src/scripts/council_cli.ts +6 -2
  138. package/src/scripts/evaluator_umbrella.sh +34 -1
  139. package/src/scripts/install-hooks.sh +36 -4
  140. package/src/scripts/install.ts +210 -5
  141. package/src/scripts/lint_eval_fixture_citations.ts +113 -0
  142. package/src/scripts/lint_ui_stack_bundles.ts +201 -0
@@ -0,0 +1,294 @@
1
+ #!/usr/bin/env tsx
2
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
3
+ import {
4
+ StateLoadError,
5
+ load_state
6
+ } from "./chunk-GME3Q44L.js";
7
+ import {
8
+ ProjectRootError,
9
+ resolve_project_root
10
+ } from "./chunk-HJ6DAJHR.js";
11
+ import "./chunk-NDJLNC6Q.js";
12
+ import "./chunk-J55WI3RR.js";
13
+
14
+ // src/scripts/_cli/cmd_analyze_session.ts
15
+ import * as fs from "node:fs";
16
+ import * as path from "node:path";
17
+ import process from "node:process";
18
+ import { fileURLToPath, pathToFileURL } from "node:url";
19
+ var _HERE = fileURLToPath(import.meta.url);
20
+ var CONTEXT_HYGIENE_RELATIVE = path.join(
21
+ "agents",
22
+ "runtime",
23
+ "state",
24
+ "context-hygiene.json"
25
+ );
26
+ var SystemExitError = class extends Error {
27
+ constructor(code) {
28
+ super(`system-exit-${code}`);
29
+ this.code = code;
30
+ }
31
+ code;
32
+ };
33
+ var ArgparseExit = class extends Error {
34
+ constructor(code) {
35
+ super(`argparse-exit-${code}`);
36
+ this.code = code;
37
+ }
38
+ code;
39
+ };
40
+ function eprint(line = "") {
41
+ process.stderr.write(line + "\n");
42
+ }
43
+ function isPlainObject(value) {
44
+ return typeof value === "object" && value !== null && !Array.isArray(value);
45
+ }
46
+ function _resolve_root(arg) {
47
+ try {
48
+ const [root] = resolve_project_root(arg, { cwd: process.cwd() });
49
+ return root;
50
+ } catch (exc) {
51
+ if (exc instanceof ProjectRootError) {
52
+ eprint(`\u274C analyze-session: ${exc.message}`);
53
+ throw new SystemExitError(2);
54
+ }
55
+ throw exc;
56
+ }
57
+ }
58
+ function relativeToOrNull(p, base) {
59
+ const rel = path.relative(base, p);
60
+ if (rel === "") return rel;
61
+ if (rel.startsWith("..") || path.isAbsolute(rel)) {
62
+ return null;
63
+ }
64
+ return rel;
65
+ }
66
+ function _load_context_hygiene(project_root) {
67
+ const p = path.join(project_root, CONTEXT_HYGIENE_RELATIVE);
68
+ if (!fs.existsSync(p)) {
69
+ return null;
70
+ }
71
+ let text;
72
+ try {
73
+ text = fs.readFileSync(p, "utf-8");
74
+ } catch {
75
+ return null;
76
+ }
77
+ let payload;
78
+ try {
79
+ payload = JSON.parse(text);
80
+ } catch {
81
+ return null;
82
+ }
83
+ return isPlainObject(payload) ? payload : null;
84
+ }
85
+ function intOrUnknown(value) {
86
+ if (typeof value === "number" && Number.isFinite(value)) {
87
+ return String(Math.trunc(value));
88
+ }
89
+ return "?";
90
+ }
91
+ function render_report(state, hygiene) {
92
+ const lines = [];
93
+ lines.push("# Session analysis");
94
+ lines.push("");
95
+ const changes = Array.isArray(state["changes"]) ? state["changes"] : [];
96
+ lines.push(`## Files touched (${changes.length})`);
97
+ lines.push("");
98
+ if (changes.length === 0) {
99
+ lines.push("_No files recorded as changed._");
100
+ } else {
101
+ for (const change of changes) {
102
+ if (!isPlainObject(change)) continue;
103
+ const file = typeof change["file"] === "string" ? change["file"] : "(unknown file)";
104
+ const summary = typeof change["summary"] === "string" && change["summary"].length > 0 ? ` \u2014 ${change["summary"]}` : "";
105
+ lines.push(`- \`${file}\`${summary}`);
106
+ }
107
+ }
108
+ lines.push("");
109
+ const outcomes = isPlainObject(state["outcomes"]) ? state["outcomes"] : {};
110
+ const directives = Object.keys(outcomes).sort();
111
+ const blocked = directives.filter((d) => outcomes[d] === "blocked");
112
+ lines.push(`## Outcomes (${directives.length})`);
113
+ lines.push("");
114
+ if (directives.length === 0) {
115
+ lines.push("_No directive outcomes recorded._");
116
+ } else {
117
+ for (const directive of directives) {
118
+ const result = outcomes[directive];
119
+ const marker = result === "blocked" ? "\u26A0\uFE0F " : "";
120
+ lines.push(`- ${marker}\`${directive}\`: ${String(result)}`);
121
+ }
122
+ }
123
+ lines.push("");
124
+ if (blocked.length > 0) {
125
+ lines.push(`**Blocked directives (${blocked.length}):** ${blocked.join(", ")}`);
126
+ lines.push("");
127
+ }
128
+ const halts = Array.isArray(state["halts"]) ? state["halts"] : [];
129
+ lines.push(`## Halts (${halts.length})`);
130
+ lines.push("");
131
+ if (halts.length === 0) {
132
+ lines.push("_No halts recorded._");
133
+ } else {
134
+ lines.push(`This session recorded ${halts.length} halt(s).`);
135
+ }
136
+ lines.push("");
137
+ lines.push("## Tool activity");
138
+ lines.push("");
139
+ if (hygiene === null) {
140
+ lines.push("_Context-hygiene snapshot not available._");
141
+ } else {
142
+ const toolCalls = intOrUnknown(hygiene["tool_calls"]);
143
+ const consecutive = intOrUnknown(hygiene["consecutive_same_tool"]);
144
+ const loop = hygiene["loop_detected"] === true;
145
+ lines.push(`- Tool calls: ${toolCalls}`);
146
+ lines.push(`- Consecutive same-tool calls: ${consecutive}`);
147
+ lines.push(`- Loop detected: ${loop ? "yes" : "no"}`);
148
+ }
149
+ lines.push("");
150
+ lines.push("## Token / cost");
151
+ lines.push("");
152
+ lines.push("Token/cost: not tracked (no per-session source).");
153
+ lines.push("");
154
+ return lines.join("\n");
155
+ }
156
+ function _analyze_session(project_root, state_file) {
157
+ const target_state = state_file || path.join(project_root, ".work-state.json");
158
+ let state;
159
+ try {
160
+ state = load_state(target_state);
161
+ } catch (exc) {
162
+ if (exc instanceof StateLoadError) {
163
+ const rel = relativeToOrNull(target_state, project_root);
164
+ const shown = rel !== null ? rel : path.basename(target_state);
165
+ const msg = exc.message.split(target_state).join(shown);
166
+ eprint(`\u274C analyze-session: ${msg}`);
167
+ return exc.exitCode;
168
+ }
169
+ throw exc;
170
+ }
171
+ const hygiene = _load_context_hygiene(project_root);
172
+ process.stdout.write(render_report(state, hygiene));
173
+ return 0;
174
+ }
175
+ var PROG = "agent-config analyze-session";
176
+ var USAGE = `usage: ${PROG} [-h] [--project PROJECT] [--state-file STATE_FILE]
177
+ `;
178
+ var _HELP = `usage: ${PROG} [--project PATH] [--state-file PATH]
179
+
180
+ Print a post-session report from on-disk runtime state. Read-only;
181
+ no daemon, no network, no model calls.
182
+
183
+ Sources read:
184
+ .work-state.json (version 1)
185
+ \xB7 changes \u2014 files touched
186
+ \xB7 outcomes \u2014 per-directive success / blocked
187
+ \xB7 halts \u2014 recorded halts
188
+ agents/runtime/state/context-hygiene.json
189
+ \xB7 tool_calls \xB7 consecutive_same_tool \xB7 loop_detected
190
+
191
+ Token/cost is NOT reported \u2014 this package has no per-session token
192
+ source (only video-specific telemetry).
193
+
194
+ options:
195
+ --project PATH project root (defaults to anchor walk from cwd)
196
+ --state-file PATH .work-state.json path (default <root>/.work-state.json)
197
+ -h, --help show this help and exit
198
+
199
+ exit codes:
200
+ 0 report rendered (a missing source file is noted, not fatal)
201
+ 1 no recent run found (state file missing or unreadable)
202
+ 2 invocation error (bad project root, bad --state-file path)
203
+ `;
204
+ function _argError(msg) {
205
+ process.stderr.write(USAGE);
206
+ process.stderr.write(`${PROG}: error: ${msg}
207
+ `);
208
+ throw new ArgparseExit(2);
209
+ }
210
+ function _parse(argv) {
211
+ const opts = { project: null, state_file: null };
212
+ let i = 0;
213
+ while (i < argv.length) {
214
+ const a = argv[i];
215
+ if (a === "-h" || a === "--help") {
216
+ process.stdout.write(_HELP);
217
+ throw new ArgparseExit(0);
218
+ }
219
+ const eq = a.startsWith("--") ? a.indexOf("=") : -1;
220
+ const flag = eq >= 0 ? a.slice(0, eq) : a;
221
+ const inlineVal = eq >= 0 ? a.slice(eq + 1) : null;
222
+ if (flag === "--project" || flag === "--state-file") {
223
+ const dest = flag === "--project" ? "project" : "state_file";
224
+ let value;
225
+ if (inlineVal !== null) {
226
+ value = inlineVal;
227
+ } else {
228
+ if (i + 1 >= argv.length) {
229
+ _argError(`argument ${flag}: expected one argument`);
230
+ }
231
+ value = argv[i + 1];
232
+ i += 1;
233
+ }
234
+ opts[dest] = value;
235
+ i += 1;
236
+ continue;
237
+ }
238
+ _argError(`unrecognized arguments: ${a}`);
239
+ }
240
+ return opts;
241
+ }
242
+ function main(argv = null) {
243
+ const argv_list = argv !== null ? Array.from(argv) : process.argv.slice(2);
244
+ const opts = _parse(argv_list);
245
+ let project_root;
246
+ try {
247
+ project_root = _resolve_root(opts.project);
248
+ } catch (exc) {
249
+ if (exc instanceof SystemExitError) {
250
+ return exc.code;
251
+ }
252
+ throw exc;
253
+ }
254
+ return _analyze_session(project_root, opts.state_file);
255
+ }
256
+ function _isCliEntry() {
257
+ if (process.argv[1] === void 0) {
258
+ return false;
259
+ }
260
+ const argvUrl = pathToFileURL(path.resolve(process.argv[1])).href;
261
+ if (import.meta.url === argvUrl) {
262
+ return true;
263
+ }
264
+ try {
265
+ const here = fs.realpathSync(fileURLToPath(import.meta.url));
266
+ const argv = fs.realpathSync(path.resolve(process.argv[1]));
267
+ return here === argv;
268
+ } catch {
269
+ return false;
270
+ }
271
+ }
272
+ if (_isCliEntry() || process.argv[1] === _HERE) {
273
+ try {
274
+ process.exitCode = main(process.argv.slice(2));
275
+ } catch (e) {
276
+ if (e instanceof ArgparseExit) {
277
+ process.exitCode = e.code;
278
+ } else if (e instanceof SystemExitError) {
279
+ process.exitCode = e.code;
280
+ } else {
281
+ throw e;
282
+ }
283
+ }
284
+ }
285
+ export {
286
+ ArgparseExit,
287
+ SystemExitError,
288
+ _analyze_session,
289
+ _load_context_hygiene,
290
+ _parse,
291
+ _resolve_root,
292
+ main,
293
+ render_report
294
+ };