@event4u/agent-config 9.10.0 → 9.11.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 (121) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +59 -0
  3. package/README.md +12 -15
  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/rules/design-fidelity.md +1 -1
  7. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +15 -2
  8. package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
  9. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  10. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +30 -30
  11. package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
  12. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +20 -0
  13. package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +20 -1
  14. package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +179 -0
  15. package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +155 -4
  16. package/dist/agent-src/templates/scripts/work_engine/state.ts +21 -4
  17. package/dist/cli/initRouting.js +74 -11
  18. package/dist/cli/initRouting.js.map +1 -1
  19. package/dist/cli/main.js +14 -3
  20. package/dist/cli/main.js.map +1 -1
  21. package/dist/cli-delegate/chunk-4SV3XGFA.js +6910 -0
  22. package/dist/cli-delegate/chunk-736JCWLM.js +1104 -0
  23. package/dist/cli-delegate/chunk-7DSAMZFU.js +356 -0
  24. package/dist/cli-delegate/chunk-7HQ52DHU.js +74 -0
  25. package/dist/cli-delegate/chunk-BJGXZNPM.js +266 -0
  26. package/dist/cli-delegate/chunk-FTAISGDQ.js +117 -0
  27. package/dist/cli-delegate/chunk-GME3Q44L.js +82 -0
  28. package/dist/cli-delegate/chunk-GRRPEPRN.js +336 -0
  29. package/dist/cli-delegate/chunk-HJ6DAJHR.js +502 -0
  30. package/dist/cli-delegate/chunk-IR7P7JWA.js +872 -0
  31. package/dist/cli-delegate/chunk-J55WI3RR.js +47 -0
  32. package/dist/cli-delegate/chunk-MCJYCQPF.js +35 -0
  33. package/dist/cli-delegate/chunk-NDJLNC6Q.js +169 -0
  34. package/dist/cli-delegate/chunk-OMIVVCG2.js +26 -0
  35. package/dist/cli-delegate/chunk-OY53J6II.js +7336 -0
  36. package/dist/cli-delegate/chunk-RDGRHAAB.js +259 -0
  37. package/dist/cli-delegate/chunk-TFG57JJM.js +1969 -0
  38. package/dist/cli-delegate/chunk-XX6TOPD7.js +715 -0
  39. package/dist/cli-delegate/chunk-YMFO6FDN.js +10603 -0
  40. package/dist/cli-delegate/cmd_analyze_session.js +294 -0
  41. package/dist/cli-delegate/cmd_conformance.js +646 -0
  42. package/dist/cli-delegate/cmd_converge.js +326 -0
  43. package/dist/cli-delegate/cmd_doctor.js +144 -0
  44. package/dist/cli-delegate/cmd_explain.js +2508 -0
  45. package/dist/cli-delegate/cmd_export.js +296 -0
  46. package/dist/cli-delegate/cmd_fleet.js +332 -0
  47. package/dist/cli-delegate/cmd_memory_get.js +3878 -0
  48. package/dist/cli-delegate/cmd_migrate.js +11 -0
  49. package/dist/cli-delegate/cmd_preflight.js +270 -0
  50. package/dist/cli-delegate/cmd_prune.js +444 -0
  51. package/dist/cli-delegate/cmd_refresh.js +28 -0
  52. package/dist/cli-delegate/cmd_settings_check.js +574 -0
  53. package/dist/cli-delegate/cmd_settings_migrate.js +223 -0
  54. package/dist/cli-delegate/cmd_sync.js +264 -0
  55. package/dist/cli-delegate/cmd_uninstall.js +656 -0
  56. package/dist/cli-delegate/cmd_update.js +425 -0
  57. package/dist/cli-delegate/cmd_upgrade.js +444 -0
  58. package/dist/cli-delegate/cmd_validate.js +305 -0
  59. package/dist/cli-delegate/cmd_versions.js +370 -0
  60. package/dist/discovery/deprecation-report.md +1 -1
  61. package/dist/discovery/discovery-manifest.json +14 -7
  62. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  63. package/dist/discovery/discovery-manifest.summary.md +2 -2
  64. package/dist/discovery/orphan-report.md +1 -1
  65. package/dist/discovery/packs.json +12 -7
  66. package/dist/discovery/trust-report.md +1 -1
  67. package/dist/discovery/workspaces.json +4 -3
  68. package/dist/install/emit_host_rules_cli.js +2 -1
  69. package/dist/install/emit_host_rules_cli.js.map +1 -1
  70. package/dist/install/install.mjs +410 -378
  71. package/dist/install/rule_scope.js +5 -1
  72. package/dist/install/rule_scope.js.map +1 -1
  73. package/dist/install/toolDetection.js +40 -12
  74. package/dist/install/toolDetection.js.map +1 -1
  75. package/dist/install/wizard-plan.js +2 -2
  76. package/dist/install/wizard-plan.js.map +1 -1
  77. package/dist/mcp/registry-manifest.json +1 -1
  78. package/dist/mcp/server.json +2 -2
  79. package/dist/mcp/server.mjs +1614 -765
  80. package/dist/router.json +1 -1
  81. package/package.json +4 -2
  82. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +30 -30
  83. package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
  84. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +20 -0
  85. package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +20 -1
  86. package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +179 -0
  87. package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +155 -4
  88. package/src/agent-src/templates/scripts/work_engine/state.ts +21 -4
  89. package/src/config/discovery/packs.yml +7 -0
  90. package/src/config/evaluator-budgets.json +1 -1
  91. package/src/config/pack-size-budget.json +27 -0
  92. package/src/install/emit_host_rules_cli.ts +2 -1
  93. package/src/install/rule_scope.ts +5 -1
  94. package/src/install/toolDetection.ts +39 -8
  95. package/src/install/wizard-plan.ts +2 -2
  96. package/src/scripts/_cli/cmd_conformance.ts +2 -1
  97. package/src/scripts/_cli/cmd_converge.ts +2 -1
  98. package/src/scripts/_cli/cmd_doctor.ts +214 -13
  99. package/src/scripts/_cli/cmd_export.ts +2 -1
  100. package/src/scripts/_cli/cmd_fleet.ts +2 -1
  101. package/src/scripts/_cli/cmd_migrate.ts +2 -1
  102. package/src/scripts/_cli/cmd_preflight.ts +2 -1
  103. package/src/scripts/_cli/cmd_refresh.ts +2 -1
  104. package/src/scripts/_cli/cmd_update.ts +2 -1
  105. package/src/scripts/_cli/cmd_upgrade.ts +2 -1
  106. package/src/scripts/_cli/cmd_versions.ts +2 -1
  107. package/src/scripts/_cli/detection_report.ts +480 -0
  108. package/src/scripts/_dispatch.bash +52 -14
  109. package/src/scripts/_lib/changelog_eras.ts +103 -9
  110. package/src/scripts/_lib/environment_detector.ts +441 -0
  111. package/src/scripts/_lib/package_root.ts +72 -0
  112. package/src/scripts/ai_council/config.ts +15 -7
  113. package/src/scripts/ai_council/modes.ts +68 -2
  114. package/src/scripts/ai_council/transport_resolver.ts +331 -0
  115. package/src/scripts/check_bundle_path_leakage.ts +10 -4
  116. package/src/scripts/check_dependency_floors.ts +153 -0
  117. package/src/scripts/check_pack_size.ts +188 -0
  118. package/src/scripts/council_cli.ts +6 -2
  119. package/src/scripts/evaluator_umbrella.sh +34 -1
  120. package/src/scripts/lint_eval_fixture_citations.ts +113 -0
  121. package/src/scripts/lint_ui_stack_bundles.ts +170 -0
@@ -0,0 +1,305 @@
1
+ #!/usr/bin/env tsx
2
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
3
+ import {
4
+ PROJECT_BRIDGE_MARKERS,
5
+ USER_SCOPE_PATHS
6
+ } from "./chunk-YMFO6FDN.js";
7
+ import "./chunk-XX6TOPD7.js";
8
+ import {
9
+ manifest_path,
10
+ read_manifest
11
+ } from "./chunk-IR7P7JWA.js";
12
+ import {
13
+ current_package_version
14
+ } from "./chunk-GRRPEPRN.js";
15
+ import "./chunk-7DSAMZFU.js";
16
+ import {
17
+ resolve_project_root
18
+ } from "./chunk-HJ6DAJHR.js";
19
+ import "./chunk-NDJLNC6Q.js";
20
+ import "./chunk-MCJYCQPF.js";
21
+ import "./chunk-OY53J6II.js";
22
+ import "./chunk-J55WI3RR.js";
23
+
24
+ // src/scripts/_cli/cmd_validate.ts
25
+ import * as fs from "node:fs";
26
+ import * as os from "node:os";
27
+ import * as path from "node:path";
28
+ import process from "node:process";
29
+ import { fileURLToPath, pathToFileURL } from "node:url";
30
+ var _HERE = fileURLToPath(import.meta.url);
31
+ var ArgparseExit = class extends Error {
32
+ constructor(code) {
33
+ super(`argparse-exit-${code}`);
34
+ this.code = code;
35
+ }
36
+ code;
37
+ };
38
+ function pyPathStr(p) {
39
+ if (p === "") return ".";
40
+ const isAbs = p.startsWith("/");
41
+ const parts = p.split("/").filter((seg) => seg !== "");
42
+ const joined = parts.join("/");
43
+ if (isAbs) {
44
+ return "/" + joined;
45
+ }
46
+ return joined === "" ? "." : joined;
47
+ }
48
+ function expanduser(p) {
49
+ let expanded;
50
+ if (p === "~") {
51
+ expanded = os.homedir();
52
+ } else if (p.startsWith("~/") || p.startsWith("~\\")) {
53
+ expanded = path.join(os.homedir(), p.slice(2));
54
+ } else {
55
+ expanded = p;
56
+ }
57
+ return pyPathStr(expanded);
58
+ }
59
+ function pathExists(p) {
60
+ try {
61
+ fs.statSync(p);
62
+ return true;
63
+ } catch {
64
+ return false;
65
+ }
66
+ }
67
+ function print(line = "") {
68
+ process.stdout.write(line + "\n");
69
+ }
70
+ function pyRepr(value) {
71
+ if (value === null || value === void 0) return "None";
72
+ if (typeof value === "boolean") return value ? "True" : "False";
73
+ if (typeof value === "number") return String(value);
74
+ if (typeof value === "string") {
75
+ const escaped = value.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
76
+ return `'${escaped}'`;
77
+ }
78
+ return String(value);
79
+ }
80
+ function _resolve_marker(project_root, bridge_marker, scope) {
81
+ if (scope === "global") {
82
+ return expanduser(bridge_marker);
83
+ }
84
+ const candidate = bridge_marker;
85
+ if (path.isAbsolute(candidate)) {
86
+ return pyPathStr(candidate);
87
+ }
88
+ return pyPathStr(path.join(project_root, candidate));
89
+ }
90
+ function _counterpart_path(project_root, tool_id, scope) {
91
+ if (scope === "project") {
92
+ const anchor = USER_SCOPE_PATHS[tool_id];
93
+ return anchor ? expanduser(anchor) : null;
94
+ }
95
+ const rel = PROJECT_BRIDGE_MARKERS[tool_id];
96
+ return rel ? pyPathStr(path.join(project_root, rel)) : null;
97
+ }
98
+ function _check_entry(project_root, entry) {
99
+ const name = String(entry["name"] ?? "").trim();
100
+ const scope = String(entry["scope"] ?? "").trim();
101
+ const bridge_marker = String(entry["bridge_marker"] ?? "").trim();
102
+ const issues = [];
103
+ if (!name || scope !== "project" && scope !== "global" || !bridge_marker) {
104
+ issues.push({
105
+ kind: "manifest_corrupt",
106
+ name: name || "<unknown>",
107
+ detail: `entry missing required fields (scope=${pyRepr(scope)}, marker=${pyRepr(bridge_marker)})`
108
+ });
109
+ return issues;
110
+ }
111
+ const target = _resolve_marker(project_root, bridge_marker, scope);
112
+ if (!pathExists(target)) {
113
+ const counterpart = _counterpart_path(project_root, name, scope);
114
+ if (counterpart !== null && pathExists(counterpart)) {
115
+ const other_scope = scope === "project" ? "global" : "project";
116
+ issues.push({
117
+ kind: "scope_divergence",
118
+ name,
119
+ detail: `recorded scope=${scope} (${target}) is missing, but counterpart at scope=${other_scope} (${counterpart}) exists`
120
+ });
121
+ } else {
122
+ issues.push({
123
+ kind: "marker_missing",
124
+ name,
125
+ detail: `bridge_marker not found: ${target}`
126
+ });
127
+ }
128
+ }
129
+ return issues;
130
+ }
131
+ function _version_drift(manifest_version, current_version) {
132
+ if (!manifest_version || !current_version) {
133
+ return null;
134
+ }
135
+ if (manifest_version !== current_version) {
136
+ return {
137
+ kind: "version_drift",
138
+ name: "<manifest>",
139
+ detail: `manifest recorded agent_config_version=${manifest_version}; currently installed package is ${current_version}`
140
+ };
141
+ }
142
+ return null;
143
+ }
144
+ var PROG = "agent-config validate";
145
+ var USAGE = `usage: ${PROG} [-h] [--project PROJECT] [--quiet]
146
+ [--skip-version-check]
147
+ `;
148
+ function _argError(msg) {
149
+ process.stderr.write(USAGE);
150
+ process.stderr.write(`${PROG}: error: ${msg}
151
+ `);
152
+ throw new ArgparseExit(2);
153
+ }
154
+ function _parse(argv) {
155
+ const opts = { project: null, quiet: false, skip_version_check: false };
156
+ const positionals = [];
157
+ let i = 0;
158
+ while (i < argv.length) {
159
+ const a = argv[i];
160
+ if (a === "-h" || a === "--help") {
161
+ process.stdout.write(USAGE);
162
+ throw new ArgparseExit(0);
163
+ }
164
+ const eq = a.startsWith("--") ? a.indexOf("=") : -1;
165
+ const flag = eq >= 0 ? a.slice(0, eq) : a;
166
+ const inlineVal = eq >= 0 ? a.slice(eq + 1) : null;
167
+ if (flag === "--quiet") {
168
+ if (inlineVal !== null) {
169
+ _argError(`argument --quiet: ignored explicit argument '${inlineVal}'`);
170
+ }
171
+ opts.quiet = true;
172
+ i += 1;
173
+ continue;
174
+ }
175
+ if (flag === "--skip-version-check") {
176
+ if (inlineVal !== null) {
177
+ _argError(`argument --skip-version-check: ignored explicit argument '${inlineVal}'`);
178
+ }
179
+ opts.skip_version_check = true;
180
+ i += 1;
181
+ continue;
182
+ }
183
+ if (flag === "--project") {
184
+ let value;
185
+ if (inlineVal !== null) {
186
+ value = inlineVal;
187
+ } else {
188
+ if (i + 1 >= argv.length) {
189
+ _argError("argument --project: expected one argument");
190
+ }
191
+ value = argv[i + 1];
192
+ i += 1;
193
+ }
194
+ opts.project = value;
195
+ i += 1;
196
+ continue;
197
+ }
198
+ if (a.startsWith("-") && a !== "-") {
199
+ _argError(`unrecognized arguments: ${a}`);
200
+ }
201
+ positionals.push(a);
202
+ i += 1;
203
+ }
204
+ if (positionals.length > 0) {
205
+ _argError(`unrecognized arguments: ${positionals.join(" ")}`);
206
+ }
207
+ return opts;
208
+ }
209
+ function _emit(quiet, msg) {
210
+ if (!quiet) {
211
+ print(msg);
212
+ }
213
+ }
214
+ function _format(issue) {
215
+ return ` \u274C [${issue["kind"]}] ${issue["name"]}: ${issue["detail"]}`;
216
+ }
217
+ function main(argv) {
218
+ const opts = _parse(argv);
219
+ const arg = opts.project || process.env["PROJECT_ROOT"] || null;
220
+ const [project_root] = resolve_project_root(arg);
221
+ const manifest = manifest_path(project_root);
222
+ const data = read_manifest(manifest);
223
+ if (data === null) {
224
+ _emit(opts.quiet, `\u274C No manifest found at ${manifest}`);
225
+ _emit(opts.quiet, " Run `./agent-config init --tools=<id>` to create one.");
226
+ _emit(opts.quiet, " Diagnose: `./agent-config doctor --check manifest-integrity`");
227
+ return 1;
228
+ }
229
+ const entries = data["tools"] || [];
230
+ const issues = [];
231
+ for (const entry of entries) {
232
+ for (const issue of _check_entry(project_root, entry)) {
233
+ issues.push(issue);
234
+ }
235
+ }
236
+ if (!opts.skip_version_check) {
237
+ const manifest_version = String(data["agent_config_version"] ?? "").trim();
238
+ const current_version = current_package_version();
239
+ const drift = _version_drift(manifest_version, current_version);
240
+ if (drift !== null) {
241
+ issues.push(drift);
242
+ }
243
+ }
244
+ _emit(opts.quiet, `Manifest: ${manifest}`);
245
+ _emit(opts.quiet, `Tools: ${entries.length} entries`);
246
+ if (issues.length === 0) {
247
+ _emit(opts.quiet, "\u2705 No drift detected.");
248
+ return 0;
249
+ }
250
+ _emit(opts.quiet, `Drift: ${issues.length} issue(s)`);
251
+ for (const issue of issues) {
252
+ _emit(opts.quiet, _format(issue));
253
+ }
254
+ _emit(opts.quiet, "");
255
+ _emit(opts.quiet, "Run `./agent-config sync` to replay missing bridges, or");
256
+ _emit(opts.quiet, "`./agent-config init --tools=<id> --force` to refresh the manifest.");
257
+ const kinds = new Set(issues.map((issue) => issue["kind"]));
258
+ if (kinds.has("version_drift")) {
259
+ _emit(opts.quiet, "Diagnose: `./agent-config doctor --check lockfile-freshness`");
260
+ }
261
+ if (kinds.has("marker_missing") || kinds.has("scope_divergence")) {
262
+ _emit(opts.quiet, "Diagnose: `./agent-config doctor --check bridge-drift`");
263
+ }
264
+ if (kinds.has("manifest_corrupt")) {
265
+ _emit(opts.quiet, "Diagnose: `./agent-config doctor --check manifest-integrity`");
266
+ }
267
+ return 1;
268
+ }
269
+ function _isCliEntry() {
270
+ if (process.argv[1] === void 0) {
271
+ return false;
272
+ }
273
+ const argvUrl = pathToFileURL(path.resolve(process.argv[1])).href;
274
+ if (import.meta.url === argvUrl) {
275
+ return true;
276
+ }
277
+ try {
278
+ const here = fs.realpathSync(fileURLToPath(import.meta.url));
279
+ const argv = fs.realpathSync(path.resolve(process.argv[1]));
280
+ return here === argv;
281
+ } catch {
282
+ return false;
283
+ }
284
+ }
285
+ if (_isCliEntry() || process.argv[1] === _HERE) {
286
+ try {
287
+ process.exitCode = main(process.argv.slice(2));
288
+ } catch (e) {
289
+ if (e instanceof ArgparseExit) {
290
+ process.exitCode = e.code;
291
+ } else {
292
+ throw e;
293
+ }
294
+ }
295
+ }
296
+ export {
297
+ ArgparseExit,
298
+ _check_entry,
299
+ _counterpart_path,
300
+ _format,
301
+ _parse,
302
+ _resolve_marker,
303
+ _version_drift,
304
+ main
305
+ };
@@ -0,0 +1,370 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+ import {
3
+ project_settings_path,
4
+ resolve_project_root
5
+ } from "./chunk-HJ6DAJHR.js";
6
+ import "./chunk-NDJLNC6Q.js";
7
+ import {
8
+ resolvePackageRoot
9
+ } from "./chunk-MCJYCQPF.js";
10
+ import "./chunk-J55WI3RR.js";
11
+
12
+ // src/scripts/_cli/cmd_versions.ts
13
+ import process from "node:process";
14
+ import * as fs from "node:fs";
15
+ import * as path from "node:path";
16
+ import { spawnSync } from "node:child_process";
17
+ import { fileURLToPath, pathToFileURL } from "node:url";
18
+ var PACKAGE_NAME = "@event4u/agent-config";
19
+ var _HERE_DIR = path.dirname(fileURLToPath(import.meta.url));
20
+ var ArgparseExit = class extends Error {
21
+ code;
22
+ constructor(code) {
23
+ super(`ArgparseExit(${code})`);
24
+ this.name = "ArgparseExit";
25
+ this.code = code;
26
+ }
27
+ };
28
+ function _stdoutSink() {
29
+ return { write: (t) => process.stdout.write(t) };
30
+ }
31
+ function _stderrSink() {
32
+ return { write: (t) => process.stderr.write(t) };
33
+ }
34
+ function _print(out, line = "") {
35
+ out.write(line + "\n");
36
+ }
37
+ function _jsonStrAscii(s) {
38
+ let out = '"';
39
+ for (let i = 0; i < s.length; i++) {
40
+ const code = s.charCodeAt(i);
41
+ const ch = s[i];
42
+ switch (ch) {
43
+ case '"':
44
+ out += '\\"';
45
+ break;
46
+ case "\\":
47
+ out += "\\\\";
48
+ break;
49
+ case "\n":
50
+ out += "\\n";
51
+ break;
52
+ case "\r":
53
+ out += "\\r";
54
+ break;
55
+ case " ":
56
+ out += "\\t";
57
+ break;
58
+ case "\b":
59
+ out += "\\b";
60
+ break;
61
+ case "\f":
62
+ out += "\\f";
63
+ break;
64
+ default:
65
+ if (code < 32 || code > 126) {
66
+ out += "\\u" + code.toString(16).padStart(4, "0");
67
+ } else {
68
+ out += ch;
69
+ }
70
+ }
71
+ }
72
+ return out + '"';
73
+ }
74
+ function _jsonScalarAscii(value) {
75
+ if (value === null || value === void 0) return "null";
76
+ if (typeof value === "boolean") return value ? "true" : "false";
77
+ if (typeof value === "number") {
78
+ if (!Number.isFinite(value)) {
79
+ if (Number.isNaN(value)) return "NaN";
80
+ return value > 0 ? "Infinity" : "-Infinity";
81
+ }
82
+ return String(value);
83
+ }
84
+ if (typeof value === "string") return _jsonStrAscii(value);
85
+ return null;
86
+ }
87
+ function _dumpIndentAscii(value, indent, depth) {
88
+ const scalar = _jsonScalarAscii(value);
89
+ if (scalar !== null) return scalar;
90
+ const pad = " ".repeat(indent * (depth + 1));
91
+ const closePad = " ".repeat(indent * depth);
92
+ if (Array.isArray(value)) {
93
+ if (value.length === 0) return "[]";
94
+ const items = value.map((v) => pad + _dumpIndentAscii(v, indent, depth + 1));
95
+ return `[
96
+ ${items.join(",\n")}
97
+ ${closePad}]`;
98
+ }
99
+ if (typeof value === "object" && value !== null) {
100
+ const obj = value;
101
+ const keys = Object.keys(obj);
102
+ if (keys.length === 0) return "{}";
103
+ const items = keys.map(
104
+ (k) => `${pad}${_jsonStrAscii(k)}: ${_dumpIndentAscii(obj[k], indent, depth + 1)}`
105
+ );
106
+ return `{
107
+ ${items.join(",\n")}
108
+ ${closePad}}`;
109
+ }
110
+ return _jsonStrAscii(String(value));
111
+ }
112
+ function _jsonDumpsIndentAscii(value, indent) {
113
+ return _dumpIndentAscii(value, indent, 0);
114
+ }
115
+ function _project_root() {
116
+ const [root] = resolve_project_root(null);
117
+ return root;
118
+ }
119
+ function _local_package_version() {
120
+ const candidates = [
121
+ path.join(resolvePackageRoot(import.meta.url), "package.json"),
122
+ path.join(_project_root(), "package.json")
123
+ ];
124
+ for (const p of candidates) {
125
+ let exists;
126
+ try {
127
+ fs.statSync(p);
128
+ exists = true;
129
+ } catch {
130
+ exists = false;
131
+ }
132
+ if (exists) {
133
+ try {
134
+ const data = JSON.parse(fs.readFileSync(p, { encoding: "utf-8" }));
135
+ const v = data?.["version"];
136
+ return v === void 0 || v === null ? "" : String(v);
137
+ } catch {
138
+ continue;
139
+ }
140
+ }
141
+ }
142
+ return "";
143
+ }
144
+ function _pinned_version() {
145
+ const settings = project_settings_path(_project_root());
146
+ let exists;
147
+ try {
148
+ fs.statSync(settings);
149
+ exists = true;
150
+ } catch {
151
+ exists = false;
152
+ }
153
+ if (!exists) {
154
+ return "";
155
+ }
156
+ try {
157
+ const text = fs.readFileSync(settings, { encoding: "utf-8" });
158
+ for (const rawLine of _splitlines(text)) {
159
+ const line = _pyStrip(rawLine);
160
+ if (line.startsWith("agent_config_version")) {
161
+ const idx = line.indexOf(":");
162
+ const rhs = idx === -1 ? "" : line.slice(idx + 1);
163
+ return _pyStripChars(_pyStripChars(_pyStrip(rhs), '"'), "'");
164
+ }
165
+ }
166
+ } catch {
167
+ }
168
+ return "";
169
+ }
170
+ function _query_npm() {
171
+ const proc = spawnSync("npm", ["view", PACKAGE_NAME, "versions", "--json"], {
172
+ encoding: "utf8",
173
+ timeout: 15e3
174
+ });
175
+ if (proc.error) {
176
+ return [];
177
+ }
178
+ if (proc.status !== 0) {
179
+ return [];
180
+ }
181
+ let data;
182
+ try {
183
+ data = JSON.parse(proc.stdout ?? "");
184
+ } catch {
185
+ return [];
186
+ }
187
+ if (typeof data === "string") {
188
+ return [data];
189
+ }
190
+ if (Array.isArray(data)) {
191
+ return data.map((v) => String(v));
192
+ }
193
+ return [];
194
+ }
195
+ function _format_table(versions, current, pinned, limit) {
196
+ const rows = [];
197
+ const head = limit > 0 ? versions.slice(Math.max(0, versions.length - limit)) : versions;
198
+ for (const v of head) {
199
+ const marks = [];
200
+ if (v === pinned) {
201
+ marks.push("\u2190 pinned");
202
+ }
203
+ if (v === current) {
204
+ marks.push("\u2190 latest");
205
+ }
206
+ const suffix = marks.length ? " " + marks.join(" ") : "";
207
+ rows.push(` ${v}${suffix}`);
208
+ }
209
+ return rows.join("\n");
210
+ }
211
+ function _isPyWs(code) {
212
+ return code === 9 || code === 10 || code === 11 || code === 12 || code === 13 || code === 28 || code === 29 || code === 30 || code === 31 || code === 32 || code === 133 || code === 160 || code === 5760 || code >= 8192 && code <= 8202 || code === 8232 || code === 8233 || code === 8239 || code === 8287 || code === 12288;
213
+ }
214
+ function _pyStrip(s) {
215
+ let start = 0;
216
+ let end = s.length;
217
+ while (start < end && _isPyWs(s.charCodeAt(start))) start += 1;
218
+ while (end > start && _isPyWs(s.charCodeAt(end - 1))) end -= 1;
219
+ return s.slice(start, end);
220
+ }
221
+ function _pyStripChars(s, ch) {
222
+ let start = 0;
223
+ let end = s.length;
224
+ while (start < end && s[start] === ch) start += 1;
225
+ while (end > start && s[end - 1] === ch) end -= 1;
226
+ return s.slice(start, end);
227
+ }
228
+ function _splitlines(text) {
229
+ if (text === "") return [];
230
+ const out = [];
231
+ let cur = "";
232
+ for (let i = 0; i < text.length; i++) {
233
+ const ch = text[i];
234
+ const code = text.charCodeAt(i);
235
+ if (ch === "\r") {
236
+ if (text[i + 1] === "\n") i += 1;
237
+ out.push(cur);
238
+ cur = "";
239
+ } else if (ch === "\n" || code === 11 || code === 12 || code === 28 || code === 29 || code === 30 || code === 133 || code === 8232 || code === 8233) {
240
+ out.push(cur);
241
+ cur = "";
242
+ } else {
243
+ cur += ch;
244
+ }
245
+ }
246
+ if (cur !== "") out.push(cur);
247
+ return out;
248
+ }
249
+ function _parse(argv, out, err) {
250
+ const prog = "agent-config versions";
251
+ const usage = `usage: ${prog} [-h] [--offline] [--limit LIMIT] [--json]
252
+ `;
253
+ const emitError = (msg) => {
254
+ err.write(usage);
255
+ err.write(`${prog}: error: ${msg}
256
+ `);
257
+ throw new ArgparseExit(2);
258
+ };
259
+ const opts = { offline: false, limit: 20, as_json: false };
260
+ const parseLimit = (raw) => {
261
+ const t = _pyStrip(raw);
262
+ if (!/^[+-]?\d(?:_?\d)*$/.test(t)) {
263
+ emitError(`argument --limit: invalid int value: '${raw}'`);
264
+ }
265
+ return parseInt(t.replace(/_/g, ""), 10);
266
+ };
267
+ let i = 0;
268
+ while (i < argv.length) {
269
+ const tok = argv[i];
270
+ if (tok === "-h" || tok === "--help") {
271
+ out.write(usage);
272
+ throw new ArgparseExit(0);
273
+ } else if (tok === "--offline") {
274
+ opts.offline = true;
275
+ i += 1;
276
+ } else if (tok === "--json") {
277
+ opts.as_json = true;
278
+ i += 1;
279
+ } else if (tok === "--limit") {
280
+ const val = argv[i + 1];
281
+ if (val === void 0) {
282
+ emitError("argument --limit: expected one argument");
283
+ }
284
+ opts.limit = parseLimit(val);
285
+ i += 2;
286
+ } else if (tok.startsWith("--limit=")) {
287
+ opts.limit = parseLimit(tok.slice("--limit=".length));
288
+ i += 1;
289
+ } else {
290
+ emitError(`unrecognized arguments: ${tok}`);
291
+ }
292
+ }
293
+ return opts;
294
+ }
295
+ function main(argv = null, options = {}) {
296
+ const out = options.out ?? _stdoutSink();
297
+ const err = options.err ?? _stderrSink();
298
+ const opts = _parse(argv ?? process.argv.slice(2), out, err);
299
+ const offline = opts.offline || process.env["AGENT_CONFIG_OFFLINE"] === "1";
300
+ const local = _local_package_version();
301
+ const pinned = _pinned_version();
302
+ let versions = [];
303
+ if (!offline) {
304
+ versions = _query_npm();
305
+ }
306
+ const latest = versions.length ? versions[versions.length - 1] : local;
307
+ if (opts.as_json) {
308
+ _print(
309
+ out,
310
+ _jsonDumpsIndentAscii(
311
+ {
312
+ pinned,
313
+ local,
314
+ latest,
315
+ versions,
316
+ source: versions.length ? "npm" : "local"
317
+ },
318
+ 2
319
+ )
320
+ );
321
+ return 0;
322
+ }
323
+ _print(out, `package: ${PACKAGE_NAME}`);
324
+ _print(out, `pinned: ${pinned || "\u2014 (no .agent-settings.yml)"}`);
325
+ _print(out, `local: ${local || "\u2014"}`);
326
+ if (!versions.length) {
327
+ if (offline) {
328
+ _print(out, "offline mode \u2014 registry query skipped");
329
+ } else {
330
+ _print(out, "\u26A0\uFE0F npm registry unreachable; showing local only");
331
+ }
332
+ return 0;
333
+ }
334
+ _print(out, `latest: ${latest}`);
335
+ _print(out);
336
+ _print(out, `available versions (${opts.limit > 0 ? "last " + String(opts.limit) : "all"}):`);
337
+ _print(out, _format_table(versions, latest, pinned, opts.limit));
338
+ return 0;
339
+ }
340
+ var _HERE = fileURLToPath(import.meta.url);
341
+ function _isCliEntry() {
342
+ if (process.argv[1] === void 0) {
343
+ return false;
344
+ }
345
+ const argvUrl = pathToFileURL(path.resolve(process.argv[1])).href;
346
+ if (import.meta.url === argvUrl) {
347
+ return true;
348
+ }
349
+ try {
350
+ const here = fs.realpathSync(fileURLToPath(import.meta.url));
351
+ const argv = fs.realpathSync(path.resolve(process.argv[1]));
352
+ return here === argv;
353
+ } catch {
354
+ return false;
355
+ }
356
+ }
357
+ if (_isCliEntry() || process.argv[1] === _HERE) {
358
+ try {
359
+ process.exitCode = main();
360
+ } catch (exc) {
361
+ if (exc instanceof ArgparseExit) {
362
+ process.exitCode = exc.code;
363
+ } else {
364
+ throw exc;
365
+ }
366
+ }
367
+ }
368
+ export {
369
+ main
370
+ };
@@ -1,6 +1,6 @@
1
1
  # Discovery — Deprecation Report
2
2
 
3
- - Generated: `2026-07-31T05:51:11Z`
3
+ - Generated: `2026-07-31T12:04:17Z`
4
4
  - Deprecated artefacts: **0**
5
5
 
6
6
  _None. Tree is clean._