gennady 0.8.1 → 0.8.2

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 (29) hide show
  1. package/ai/agents/agent-resolve-conflicts.xml +0 -3
  2. package/ai/agents/agent-review-verifier.xml +0 -3
  3. package/ai/directives/coding/uikit-component-storybook.xml +0 -5
  4. package/ai/directives/coding/uikit-component-svelte.xml +0 -5
  5. package/ai/directives/coding/uikit-spec-drafting.xml +0 -5
  6. package/cli/cmd/orient/README.md +2 -1
  7. package/dist/ai/agents/agent-resolve-conflicts.xml +0 -3
  8. package/dist/ai/agents/agent-review-verifier.xml +0 -3
  9. package/dist/ai/directives/coding/uikit-component-storybook.xml +0 -5
  10. package/dist/ai/directives/coding/uikit-component-svelte.xml +0 -5
  11. package/dist/ai/directives/coding/uikit-spec-drafting.xml +0 -5
  12. package/dist/chunks/{help.cmd-BseRtoBF.js → help.cmd-BDO4k0_z.js} +3 -1
  13. package/dist/chunks/{index-ZM_FonZj.js → index-4fUNp3za.js} +1 -1
  14. package/dist/chunks/{index-CGsIRefC.js → index-9JlEjsvH.js} +1 -1
  15. package/dist/chunks/{index-k0nToACp.js → index-9e72uZq7.js} +1 -1
  16. package/dist/chunks/{index-BghL1-Nk.js → index-B4ODZbtC.js} +2 -2
  17. package/dist/chunks/{index-CDM74qdR.js → index-BmABG4HA.js} +2 -2
  18. package/dist/chunks/{index-CHaPz3Ol.js → index-C9UEDrqg.js} +1 -1
  19. package/dist/chunks/{index-BU1AXJGA.js → index-DICatQqS.js} +1 -1
  20. package/dist/chunks/{index-CIvkaAQ3.js → index-DQpmjvCj.js} +1 -1
  21. package/dist/chunks/{index-BlqEQEGy.js → index-DS_1ZX6G.js} +1 -1
  22. package/dist/chunks/{index-CkczJ__m.js → index-ZpU_VoI0.js} +1 -1
  23. package/dist/chunks/{index-DEzym4Ae.js → index-jOIhIHdS.js} +1 -1
  24. package/dist/chunks/{index-OtehG7uM.js → index-mkUNzixA.js} +1 -1
  25. package/dist/chunks/{run-review-command.logic-BeYQin-I.js → run-review-command.logic-CHVCVJWO.js} +1 -1
  26. package/dist/chunks/{shared-DL_1LG0K.js → shared-9J_oXE74.js} +260 -250
  27. package/dist/gennady.js +19 -18
  28. package/dist/index.js +2 -2
  29. package/package.json +1 -1
@@ -1,6 +1,3 @@
1
- <!-- @file: Agent directive for conflict resolution -->
2
- <!-- @consumers: resolve-conflicts command -->
3
- <!-- @tasks: TSK-33 -->
4
1
  <Agent name="agent-resolve-conflicts" type="directive" ver="0.1">
5
2
  <Mission>Resolve merge conflicts with confidence scoring.</Mission>
6
3
  </Agent>
@@ -1,6 +1,3 @@
1
- <!-- @file: Agent directive for review verification -->
2
- <!-- @consumers: review-verify command -->
3
- <!-- @tasks: TSK-33 -->
4
1
  <Agent name="agent-review-verifier" type="directive" ver="0.1">
5
2
  <Mission>Verify review results against code changes.</Mission>
6
3
  </Agent>
@@ -1,8 +1,3 @@
1
- <!--
2
- @file: Storybook rules for uikit components — hierarchy mirroring spec, play functions with a11y, ai-generated tagging.
3
- @consumers: SDD agents (story-writing phase of uikit-component tasks)
4
- @tasks: TSK-26
5
- -->
6
1
  <UiKitComponentStorybook keywords="uikit, storybook, hierarchy, play-function, a11y-audit, ai-generated, spec-mirror" type="testing-rules" ver="1.0">
7
2
  <Directive_Context>
8
3
  <Mission>
@@ -1,8 +1,3 @@
1
- <!--
2
- @file: Svelte component conventions for uikit — data attributes, CSS tokens, file structure, a11y, token overrides.
3
- @consumers: SDD agents (implementation phase of uikit-component tasks)
4
- @tasks: TSK-26
5
- -->
6
1
  <UiKitComponentSvelte keywords="uikit, svelte-component, data-attributes, css-tokens, file-structure, a11y, token-overrides" type="coding-rules" ver="1.0">
7
2
  <Directive_Context>
8
3
  <Mission>
@@ -1,8 +1,3 @@
1
- <!--
2
- @file: Drafting rules for converting ExtractionResult JSON to a draft .ui.spec.md UI component spec.
3
- @consumers: SDD agents (drafting phase of uikit-component tasks)
4
- @tasks: TSK-25
5
- -->
6
1
  <UiKitSpecDrafting keywords="uikit, spec-drafting, extraction-result, ui-spec, token-mapping, variant-grouping, bdd-generation, a11y-defaults" type="drafting-rules" ver="1.0">
7
2
  <Directive_Context>
8
3
  <Mission>
@@ -1,7 +1,8 @@
1
1
  # Agent Rules: orient
2
2
 
3
3
  `orient` — команда для навигации по репозиторию через file-header разметку
4
- (`@file:`, `@tasks:`, `@consumers:`) и DBC-контракты.
4
+ (`@file:`, `@tasks:`, `@consumers:`) и публичные сущности с их DBC-контрактами
5
+ (экспортируемые функции, классы, типы, интерфейсы).
5
6
 
6
7
  ## Когда использовать
7
8
 
@@ -1,6 +1,3 @@
1
- <!-- @file: Agent directive for conflict resolution -->
2
- <!-- @consumers: resolve-conflicts command -->
3
- <!-- @tasks: TSK-33 -->
4
1
  <Agent name="agent-resolve-conflicts" type="directive" ver="0.1">
5
2
  <Mission>Resolve merge conflicts with confidence scoring.</Mission>
6
3
  </Agent>
@@ -1,6 +1,3 @@
1
- <!-- @file: Agent directive for review verification -->
2
- <!-- @consumers: review-verify command -->
3
- <!-- @tasks: TSK-33 -->
4
1
  <Agent name="agent-review-verifier" type="directive" ver="0.1">
5
2
  <Mission>Verify review results against code changes.</Mission>
6
3
  </Agent>
@@ -1,8 +1,3 @@
1
- <!--
2
- @file: Storybook rules for uikit components — hierarchy mirroring spec, play functions with a11y, ai-generated tagging.
3
- @consumers: SDD agents (story-writing phase of uikit-component tasks)
4
- @tasks: TSK-26
5
- -->
6
1
  <UiKitComponentStorybook keywords="uikit, storybook, hierarchy, play-function, a11y-audit, ai-generated, spec-mirror" type="testing-rules" ver="1.0">
7
2
  <Directive_Context>
8
3
  <Mission>
@@ -1,8 +1,3 @@
1
- <!--
2
- @file: Svelte component conventions for uikit — data attributes, CSS tokens, file structure, a11y, token overrides.
3
- @consumers: SDD agents (implementation phase of uikit-component tasks)
4
- @tasks: TSK-26
5
- -->
6
1
  <UiKitComponentSvelte keywords="uikit, svelte-component, data-attributes, css-tokens, file-structure, a11y, token-overrides" type="coding-rules" ver="1.0">
7
2
  <Directive_Context>
8
3
  <Mission>
@@ -1,8 +1,3 @@
1
- <!--
2
- @file: Drafting rules for converting ExtractionResult JSON to a draft .ui.spec.md UI component spec.
3
- @consumers: SDD agents (drafting phase of uikit-component tasks)
4
- @tasks: TSK-25
5
- -->
6
1
  <UiKitSpecDrafting keywords="uikit, spec-drafting, extraction-result, ui-spec, token-mapping, variant-grouping, bdd-generation, a11y-defaults" type="drafting-rules" ver="1.0">
7
2
  <Directive_Context>
8
3
  <Mission>
@@ -30,7 +30,9 @@ console.info(
30
30
  console.info(
31
31
  " orient Navigate file headers and DBC contracts — project map, search, dependency graph"
32
32
  );
33
- console.info(" agents-rules Print orient usage instructions for AI agents");
33
+ console.info(
34
+ " agents-rules Print usage instructions for AI agents (navigate public entities, DBC contracts, file headers)"
35
+ );
34
36
  console.info("");
35
37
  console.info("Examples:");
36
38
  console.info(" npx gennady");
@@ -2,7 +2,7 @@ import { readdirSync as D, statSync as S, mkdirSync as F, writeFileSync as k, re
2
2
  import { join as d, sep as P } from "node:path";
3
3
  import { fileURLToPath as U } from "node:url";
4
4
  import { l as $ } from "./services-IgZptnTi.js";
5
- import { n as x, b as T, r as A, S as b, p as z, f as I } from "./shared-DL_1LG0K.js";
5
+ import { n as x, b as T, r as A, S as b, p as z, f as I } from "./shared-9J_oXE74.js";
6
6
  class Y {
7
7
  /** @purpose List of all synced file entries. */
8
8
  entries;
@@ -7,7 +7,7 @@ import { promisify as h } from "node:util";
7
7
  import z from "node:os";
8
8
  import g from "node:fs";
9
9
  import { Buffer as X } from "node:buffer";
10
- import { p as G } from "./shared-DL_1LG0K.js";
10
+ import { p as G } from "./shared-9J_oXE74.js";
11
11
  import { c as K } from "./services-IgZptnTi.js";
12
12
  let F;
13
13
  function q() {
@@ -1,4 +1,4 @@
1
- import { p as $, s as e, a as k } from "./shared-DL_1LG0K.js";
1
+ import { p as $, s as e, a as k } from "./shared-9J_oXE74.js";
2
2
  import I from "node:fs";
3
3
  import { V as S } from "./services-IgZptnTi.js";
4
4
  async function m(r = {}) {
@@ -1,5 +1,5 @@
1
- import { p as j, s as e, g as x } from "./shared-DL_1LG0K.js";
2
- import { p as T, A as E } from "./index-CIvkaAQ3.js";
1
+ import { p as j, s as e, g as x } from "./shared-9J_oXE74.js";
2
+ import { p as T, A as E } from "./index-DQpmjvCj.js";
3
3
  import { readdirSync as G, readFileSync as P } from "node:fs";
4
4
  import { join as h, dirname as k } from "node:path";
5
5
  import { fileURLToPath as N } from "node:url";
@@ -2,8 +2,8 @@ import u from "node:fs";
2
2
  import S from "node:os";
3
3
  import v from "node:path";
4
4
  import { execSync as P } from "node:child_process";
5
- import { p as d, A as E } from "./index-CIvkaAQ3.js";
6
- import { g as H, s as t, x as D, p as F } from "./shared-DL_1LG0K.js";
5
+ import { p as d, A as E } from "./index-DQpmjvCj.js";
6
+ import { g as H, s as t, x as D, p as F } from "./shared-9J_oXE74.js";
7
7
  import { l as N } from "./services-IgZptnTi.js";
8
8
  class U {
9
9
  /** @purpose Configuration with defaults for mode, prompts, timeout. */
@@ -2,7 +2,7 @@ import { execSync as z } from "node:child_process";
2
2
  import { existsSync as K, readFileSync as Y, readdirSync as P, statSync as X, lstatSync as q } from "node:fs";
3
3
  import { resolve as y, relative as H, extname as F, join as Q } from "node:path";
4
4
  import { l as C, D as ee, a as te, b as ne, s as se } from "./services-IgZptnTi.js";
5
- import { p as oe } from "./shared-DL_1LG0K.js";
5
+ import { p as oe } from "./shared-9J_oXE74.js";
6
6
  class w {
7
7
  /** @purpose Collected lint errors — empty array when clean. */
8
8
  errors;
@@ -8,7 +8,7 @@ import dt from "stream";
8
8
  import In from "events";
9
9
  import Qt from "fs";
10
10
  import { l as xe, p as Nn, V as qn, d as Fn } from "./services-IgZptnTi.js";
11
- import { p as Bn, s as ne } from "./shared-DL_1LG0K.js";
11
+ import { p as Bn, s as ne } from "./shared-9J_oXE74.js";
12
12
  var se = {}, ie = {}, Oe = {}, nr;
13
13
  function jn() {
14
14
  if (nr) return Oe;
@@ -1,5 +1,5 @@
1
1
  import { AiLegacyModel as h } from "../index.js";
2
- import { G as f, u as c } from "./shared-DL_1LG0K.js";
2
+ import { G as f, u as c } from "./shared-9J_oXE74.js";
3
3
  import { l as p } from "./services-IgZptnTi.js";
4
4
  import { readFileSync as l } from "node:fs";
5
5
  import { dirname as _, join as m } from "node:path";
@@ -1,4 +1,4 @@
1
- import { p as s, r as e } from "./run-review-command.logic-BeYQin-I.js";
1
+ import { p as s, r as e } from "./run-review-command.logic-CHVCVJWO.js";
2
2
  const r = s(process.argv), o = await e({
3
3
  mode: "issues",
4
4
  args: r
@@ -1,4 +1,4 @@
1
- import { p as D, e as o, h as M, a as H, i as B, l as U, j as k, k as O, s as F } from "./shared-DL_1LG0K.js";
1
+ import { p as D, e as o, h as M, a as H, i as B, l as U, j as k, k as O, s as F } from "./shared-9J_oXE74.js";
2
2
  import a from "node:fs";
3
3
  import P from "node:path";
4
4
  function C(e) {
@@ -2,7 +2,7 @@ import { readdirSync as $, statSync as v, readFileSync as N, rmdirSync as U, unl
2
2
  import { join as k, sep as W } from "node:path";
3
3
  import { fileURLToPath as K } from "node:url";
4
4
  import { l as I } from "./services-IgZptnTi.js";
5
- import { n as z, d as b, b as B, p as M, r as G } from "./shared-DL_1LG0K.js";
5
+ import { n as z, d as b, b as B, p as M, r as G } from "./shared-9J_oXE74.js";
6
6
  class j {
7
7
  /** @purpose List of all synced file entries, sorted lexicographically by skillName then relativePath. */
8
8
  entries;
@@ -1,4 +1,4 @@
1
- import { p as e, r } from "./run-review-command.logic-BeYQin-I.js";
1
+ import { p as e, r } from "./run-review-command.logic-CHVCVJWO.js";
2
2
  const s = e(process.argv), o = await r({
3
3
  mode: "verify",
4
4
  args: s
@@ -1,4 +1,4 @@
1
- import { p as v, a as g, h as R, i as b, l as j, j as y, k as _, s as u } from "./shared-DL_1LG0K.js";
1
+ import { p as v, a as g, h as R, i as b, l as j, j as y, k as _, s as u } from "./shared-9J_oXE74.js";
2
2
  import { V as A } from "./services-IgZptnTi.js";
3
3
  function H(r) {
4
4
  const e = v(r, {
@@ -1,35 +1,45 @@
1
- import { spawn as Y, execSync as j } from "node:child_process";
2
- import f, { mkdirSync as V, readFileSync as O, existsSync as x } from "node:fs";
3
- import d, { resolve as p, dirname as J, join as A } from "node:path";
4
- import { platform as w, homedir as k } from "node:os";
1
+ import { spawn as Y, execSync as O } from "node:child_process";
2
+ import f, { mkdirSync as J, readFileSync as I, existsSync as x } from "node:fs";
3
+ import d, { resolve as p, dirname as X, join as A } from "node:path";
4
+ import { platform as S, homedir as k } from "node:os";
5
5
  import { fileURLToPath as L } from "node:url";
6
- import { l as S } from "./services-IgZptnTi.js";
7
- const X = 864e5, z = 3e3, q = "update-check-worker.ts", Q = "update-check-cache.json";
8
- function Z(n) {
9
- return w() === "win32" ? p(process.env.LOCALAPPDATA ?? p(k(), "AppData", "Local"), "gennady") : w() === "darwin" ? p(k(), "Library", "Caches", "gennady") : p(k(), ".cache", "gennady");
6
+ import { l as w } from "./services-IgZptnTi.js";
7
+ const z = 864e5, q = 3e3, Q = "update-check-worker.ts", Z = "update-check-cache.json";
8
+ function ee(s) {
9
+ return S() === "win32" ? p(process.env.LOCALAPPDATA ?? p(k(), "AppData", "Local"), "gennady") : S() === "darwin" ? p(k(), "Library", "Caches", "gennady") : p(k(), ".cache", "gennady");
10
10
  }
11
- function ee(n) {
11
+ function te(s) {
12
12
  try {
13
- const t = O(n, "utf-8"), r = JSON.parse(t);
13
+ const n = I(s, "utf-8"), r = JSON.parse(n);
14
14
  return typeof r?.lastCheck != "string" || typeof r?.latestVersion != "string" ? null : r;
15
15
  } catch {
16
16
  return null;
17
17
  }
18
18
  }
19
- function te(n, t) {
20
- return Date.now() - new Date(n.lastCheck).getTime() < t;
19
+ function ne(s, n) {
20
+ return Date.now() - new Date(s.lastCheck).getTime() < n;
21
21
  }
22
- function D(n, t) {
22
+ function D(s, n) {
23
+ const r = (t) => t.split(".").map((i) => parseInt(i, 10)), e = r(s), o = r(n);
24
+ if (e.some(isNaN) || o.some(isNaN)) return !1;
25
+ for (let t = 0; t < Math.max(e.length, o.length); t++) {
26
+ const i = e[t] ?? 0, a = o[t] ?? 0;
27
+ if (a > i) return !0;
28
+ if (a < i) return !1;
29
+ }
30
+ return !1;
31
+ }
32
+ function b(s, n) {
23
33
  let r = !1;
24
34
  process.on("beforeExit", () => {
25
35
  r || (r = !0, process.stderr.write(`
26
- Update available: ${n} → ${t}
36
+ Update available: ${s} → ${n}
27
37
  `), process.stderr.write(`Run: npm i -g gennady@latest
28
38
 
29
39
  `));
30
40
  });
31
41
  }
32
- function je(n, t) {
42
+ function Oe(s, n) {
33
43
  if (process.env.GENNADY_NO_UPDATE_CHECK === "1" || process.argv.includes("--no-update-check")) {
34
44
  process.env.GENNADY_DEBUG === "1" && process.stderr.write(
35
45
  `[update-check] skipped: opt-out (GENNADY_NO_UPDATE_CHECK or --no-update-check)
@@ -42,24 +52,24 @@ function je(n, t) {
42
52
  `);
43
53
  return;
44
54
  }
45
- const r = Number(process.env.GENNADY_UPDATE_CHECK_INTERVAL) || X, e = Z(), o = p(e, Q);
46
- V(e, { recursive: !0 });
47
- const s = ee(o);
48
- if (s && te(s, r)) {
49
- s.latestVersion && s.latestVersion !== n.version && (process.stderr.isTTY || t?.skipNotificationIfNoTty === !1) && D(n.version, s.latestVersion);
55
+ const r = Number(process.env.GENNADY_UPDATE_CHECK_INTERVAL) || z, e = ee(), o = p(e, Z);
56
+ J(e, { recursive: !0 });
57
+ const t = te(o);
58
+ if (t && ne(t, r)) {
59
+ t.latestVersion && D(s.version, t.latestVersion) && (process.stderr.isTTY || n?.skipNotificationIfNoTty === !1) && b(s.version, t.latestVersion);
50
60
  return;
51
61
  }
52
- const i = p(J(L(import.meta.url)), q);
62
+ const i = p(X(L(import.meta.url)), Q);
53
63
  Y(
54
64
  process.execPath,
55
- [i, n.name, n.version, o, String(z)],
65
+ [i, s.name, s.version, o, String(q)],
56
66
  {
57
67
  stdio: "ignore"
58
68
  }
59
- ).unref(), s?.latestVersion && s.latestVersion !== n.version && (process.stderr.isTTY || t?.skipNotificationIfNoTty === !1) && D(n.version, s.latestVersion);
69
+ ).unref(), t?.latestVersion && D(s.version, t.latestVersion) && (process.stderr.isTTY || n?.skipNotificationIfNoTty === !1) && b(s.version, t.latestVersion);
60
70
  }
61
71
  const y = ["plain", "nocolor", "noColor", "no-color", "color=no", "color=never"].some(
62
- (n) => process.argv.includes(`-${n}`) || process.argv.includes(`--${n}`)
72
+ (s) => process.argv.includes(`-${s}`) || process.argv.includes(`--${s}`)
63
73
  ), h = {
64
74
  // Modifiers
65
75
  reset: "\x1B[0m",
@@ -106,29 +116,29 @@ const y = ["plain", "nocolor", "noColor", "no-color", "color=no", "color=never"]
106
116
  bgCyanBright: "\x1B[106m",
107
117
  bgWhiteBright: "\x1B[107m"
108
118
  };
109
- function I(n = []) {
110
- const t = (r) => y ? r : n.join("") + r + h.reset;
111
- return new Proxy(t, {
119
+ function M(s = []) {
120
+ const n = (r) => y ? r : s.join("") + r + h.reset;
121
+ return new Proxy(n, {
112
122
  get(r, e) {
113
123
  if (e === "toString")
114
- return () => y ? "%s" : n.join("") + "%s" + h.reset;
124
+ return () => y ? "%s" : s.join("") + "%s" + h.reset;
115
125
  if (e in h) {
116
126
  const o = h[e];
117
- return I(y ? [] : [...n, o].filter(Boolean));
127
+ return M(y ? [] : [...s, o].filter(Boolean));
118
128
  }
119
129
  },
120
130
  apply(r, e, o) {
121
- const s = o[0] ?? "";
122
- return y ? s : n.join("") + s + h.reset;
131
+ const t = o[0] ?? "";
132
+ return y ? t : s.join("") + t + h.reset;
123
133
  }
124
134
  });
125
135
  }
126
- const Oe = I(), Ie = (n, t = {}) => {
136
+ const Ie = M(), Me = (s, n = {}) => {
127
137
  const r = { _: [] };
128
- return n.slice(2).forEach((o) => {
138
+ return s.slice(2).forEach((o) => {
129
139
  if (o.startsWith("-")) {
130
- const s = o.replace(/^-+/, ""), [i, a] = s.split("=");
131
- for (const [c, l] of Object.entries(t))
140
+ const t = o.replace(/^-+/, ""), [i, a] = t.split("=");
141
+ for (const [c, l] of Object.entries(n))
132
142
  if (Array.isArray(l) && i && l.includes(i)) {
133
143
  const u = a ? a.replace(/^"|"$/g, "") : !0;
134
144
  c in r ? (Array.isArray(r[c]) || (r[c] = [r[c]]), r[c].push(u)) : r[c] = u;
@@ -137,7 +147,7 @@ const Oe = I(), Ie = (n, t = {}) => {
137
147
  } else
138
148
  r._.push(o);
139
149
  }), r;
140
- }, ne = {
150
+ }, se = {
141
151
  js: "JavaScript",
142
152
  jsx: "JavaScript",
143
153
  ts: "TypeScript",
@@ -163,16 +173,16 @@ const Oe = I(), Ie = (n, t = {}) => {
163
173
  sass: "Sass",
164
174
  md: "Markdown",
165
175
  mdc: "Markdown"
166
- }, b = (n) => ne[n] ?? void 0, Pe = () => {
176
+ }, v = (s) => se[s] ?? void 0, Pe = () => {
167
177
  try {
168
- return j("osascript -e 'user locale of (get system info)'").toString().trim().toLowerCase().split("_").filter((r) => r !== "en" && r !== "us")[0] ?? "en";
178
+ return O("osascript -e 'user locale of (get system info)'").toString().trim().toLowerCase().split("_").filter((r) => r !== "en" && r !== "us")[0] ?? "en";
169
179
  } catch {
170
180
  return "en";
171
181
  }
172
- }, v = (n) => {
173
- const t = n.match(/[\p{L}\p{N}_]+|[^\s\p{L}\p{N}_]/gu);
174
- return t ? t.length : 0;
175
- }, se = [
182
+ }, B = (s) => {
183
+ const n = s.match(/[\p{L}\p{N}_]+|[^\s\p{L}\p{N}_]/gu);
184
+ return n ? n.length : 0;
185
+ }, re = [
176
186
  "^package\\.json",
177
187
  "^tsconfig\\.json",
178
188
  "^babel\\.config\\.json",
@@ -182,7 +192,7 @@ const Oe = I(), Ie = (n, t = {}) => {
182
192
  "^\\.env(?:\\.[\\w]+)?",
183
193
  "^\\..+",
184
194
  ".*\\.(?:yml|yaml|rc|ini|conf)"
185
- ], re = [
195
+ ], oe = [
186
196
  "^package-lock\\.json",
187
197
  "^npm-shrinkwrap\\.json",
188
198
  "^yarn(?:-lock)?\\.(?:yaml|yml|toml)",
@@ -191,41 +201,41 @@ const Oe = I(), Ie = (n, t = {}) => {
191
201
  "^podfile\\.lock",
192
202
  "^go\\.sum",
193
203
  "^gemfile\\.lock"
194
- ], oe = {
204
+ ], ae = {
195
205
  doc: /\.(md|markdown|txt|rst)$/i,
196
- cfg: new RegExp(se.join("|"), "i"),
206
+ cfg: new RegExp(re.join("|"), "i"),
197
207
  img: /\.(png|jpe?g|gif|svg|bmp|tiff|ico)$/i,
198
208
  css: /\.(css|less|scss|sass|styl)$/i,
199
209
  html: /\.(html?)$/i,
200
210
  code: /\.(js|jsx|ts|tsx|java|py|c|cpp|cs|rb|php|go|swift|m|mm|kt|sh|bash)$/i,
201
211
  bin: /^(exe|dll|so|bin)\b/i,
202
- lock: new RegExp(re.join("|"), "i"),
212
+ lock: new RegExp(oe.join("|"), "i"),
203
213
  json: /\.json$/i
204
- }, B = (n, t) => {
205
- if (t?.extra && Array.isArray(t.extra)) {
206
- for (const e of t.extra)
214
+ }, R = (s, n) => {
215
+ if (n?.extra && Array.isArray(n.extra)) {
216
+ for (const e of n.extra)
207
217
  if (/^Binary files? /i.test(e) || /GIT binary patch/i.test(e))
208
218
  return "bin";
209
219
  }
210
- return Object.entries(oe).find(([, e]) => e.test(n))?.[0] ?? "other";
211
- }, ae = (n) => {
212
- const t = n.split(`
220
+ return Object.entries(ae).find(([, e]) => e.test(s))?.[0] ?? "other";
221
+ }, ie = (s) => {
222
+ const n = s.split(`
213
223
  `), r = [];
214
224
  let e = null, o = null;
215
- if (t.forEach((s) => {
216
- if (s.startsWith("diff --git")) {
225
+ if (n.forEach((t) => {
226
+ if (t.startsWith("diff --git")) {
217
227
  if (e) {
218
228
  e.diff.tokens = e.diff.hunks.reduce(
219
229
  (u, m) => u + m.tokens,
220
230
  0
221
231
  ), e.tokens = e.diff.tokens;
222
232
  const l = e.filename.match(/\.([^.]+)$/);
223
- e.ext = l?.[1]?.toLowerCase() ?? "", e.category = B(
233
+ e.ext = l?.[1]?.toLowerCase() ?? "", e.category = R(
224
234
  e.filename,
225
235
  e.metadata
226
- ), e.programmingLanguage = b(e.ext), r.push(e);
236
+ ), e.programmingLanguage = v(e.ext), r.push(e);
227
237
  }
228
- const i = s.match(/^diff --git a\/(.+?) b\/(.+)$/), a = i?.[1] ?? null;
238
+ const i = t.match(/^diff --git a\/(.+?) b\/(.+)$/), a = i?.[1] ?? null;
229
239
  e = {
230
240
  isNew: !1,
231
241
  isDeleted: !1,
@@ -244,113 +254,113 @@ const Oe = I(), Ie = (n, t = {}) => {
244
254
  category: "other",
245
255
  programmingLanguage: void 0
246
256
  }, o = null;
247
- } else if (e && s.startsWith("new file mode")) {
248
- const i = s.split(" ");
257
+ } else if (e && t.startsWith("new file mode")) {
258
+ const i = t.split(" ");
249
259
  e.isNew = !0, e.newFileMode = i[3] ?? null, e.metadata.newFileMode = e.newFileMode;
250
- } else if (e && s.startsWith("deleted file mode")) {
251
- const i = s.split(" ");
260
+ } else if (e && t.startsWith("deleted file mode")) {
261
+ const i = t.split(" ");
252
262
  e.isDeleted = !0, e.deletedFileMode = i[3] ?? null, e.metadata.deletedFileMode = e.deletedFileMode;
253
- } else if (e && s.startsWith("old mode")) {
254
- const i = s.split(" ");
263
+ } else if (e && t.startsWith("old mode")) {
264
+ const i = t.split(" ");
255
265
  e.metadata.oldMode = i[2] ?? null;
256
- } else if (e && s.startsWith("new mode")) {
257
- const i = s.split(" ");
266
+ } else if (e && t.startsWith("new mode")) {
267
+ const i = t.split(" ");
258
268
  e.metadata.newMode = i[2] ?? null;
259
- } else if (e && s.startsWith("similarity index")) {
260
- const i = s.split(" ");
269
+ } else if (e && t.startsWith("similarity index")) {
270
+ const i = t.split(" ");
261
271
  e.metadata.similarityIndex = i[2] ?? null;
262
- } else if (e && s.startsWith("rename from")) {
263
- const i = s.substring(11).trim();
272
+ } else if (e && t.startsWith("rename from")) {
273
+ const i = t.substring(11).trim();
264
274
  e.isRenamed = !0, e.oldFilename = i, e.metadata.renameFrom = i;
265
- } else if (e && s.startsWith("rename to")) {
266
- const i = s.substring(9).trim();
275
+ } else if (e && t.startsWith("rename to")) {
276
+ const i = t.substring(9).trim();
267
277
  e.isRenamed = !0, e.filename = i, e.metadata.renameTo = i;
268
- } else e && s.startsWith("index") ? e.metadata.index = s.substring(5).trim() : e && (s.startsWith("--- ") || s.startsWith("+++ ")) ? s.startsWith("--- ") ? e.metadata.oldFileMarker = s : e.metadata.newFileMarker = s : e && s.startsWith("@@") ? (o = {
269
- header: s,
270
- changes: [s],
271
- tokens: v(s)
272
- }, e.diff.hunks.push(o)) : o && (s.startsWith("+") || s.startsWith("-") || s.startsWith(" ")) ? (o.changes.push(s), o.tokens += v(s)) : e && (Array.isArray(e.metadata.extra) || (e.metadata.extra = []), e.metadata.extra.push(s));
278
+ } else e && t.startsWith("index") ? e.metadata.index = t.substring(5).trim() : e && (t.startsWith("--- ") || t.startsWith("+++ ")) ? t.startsWith("--- ") ? e.metadata.oldFileMarker = t : e.metadata.newFileMarker = t : e && t.startsWith("@@") ? (o = {
279
+ header: t,
280
+ changes: [t],
281
+ tokens: B(t)
282
+ }, e.diff.hunks.push(o)) : o && (t.startsWith("+") || t.startsWith("-") || t.startsWith(" ")) ? (o.changes.push(t), o.tokens += B(t)) : e && (Array.isArray(e.metadata.extra) || (e.metadata.extra = []), e.metadata.extra.push(t));
273
283
  }), e) {
274
- const s = e, i = s.filename.match(/\.([^.]+)$/);
275
- s.diff.tokens = s.diff.hunks.reduce(
284
+ const t = e, i = t.filename.match(/\.([^.]+)$/);
285
+ t.diff.tokens = t.diff.hunks.reduce(
276
286
  (a, c) => a + c.tokens,
277
287
  0
278
- ), s.tokens = s.diff.tokens, s.ext = i?.[1]?.toLowerCase() ?? "", s.category = B(s.filename, s.metadata), s.programmingLanguage = b(s.ext), r.push(s);
288
+ ), t.tokens = t.diff.tokens, t.ext = i?.[1]?.toLowerCase() ?? "", t.category = R(t.filename, t.metadata), t.programmingLanguage = v(t.ext), r.push(t);
279
289
  }
280
290
  return r;
281
- }, g = (n) => {
291
+ }, g = (s) => {
282
292
  try {
283
- return j(n, { encoding: "utf-8" });
284
- } catch (t) {
285
- return S.error("[execSyncSafe] [running → failed] Command failed", { cause: t }), "";
293
+ return O(s, { encoding: "utf-8" });
294
+ } catch (n) {
295
+ return w.error("[execSyncSafe] [running → failed] Command failed", { cause: n }), "";
286
296
  }
287
- }, R = (n) => /\.(test|spec)s?\./.test(n), ie = () => g("git branch --list 2>/dev/null")?.match(/\s*\*?\s*(master|main)$/m)?.[1] ?? "master", Me = () => g("git rev-parse --abbrev-ref HEAD 2>/dev/null").trim() || "HEAD", Ue = () => {
288
- const t = (g("git config --get remote.origin.url 2>/dev/null").trim() || g("git remote get-url origin 2>/dev/null").trim() || "").trim();
289
- if (!t) return null;
290
- if (/^[a-z]+:\/\//i.test(t))
297
+ }, N = (s) => /\.(test|spec)s?\./.test(s), ce = () => g("git branch --list 2>/dev/null")?.match(/\s*\*?\s*(master|main)$/m)?.[1] ?? "master", Ue = () => g("git rev-parse --abbrev-ref HEAD 2>/dev/null").trim() || "HEAD", Fe = () => {
298
+ const n = (g("git config --get remote.origin.url 2>/dev/null").trim() || g("git remote get-url origin 2>/dev/null").trim() || "").trim();
299
+ if (!n) return null;
300
+ if (/^[a-z]+:\/\//i.test(n))
291
301
  try {
292
- const e = new URL(t), o = (e.hostname || "").toLowerCase(), s = (e.protocol || "").replace(/:$/, "").toLowerCase(), i = (e.pathname || "").replace(/^\/+/, "").replace(/\.git$/i, "");
293
- return !o || !i ? null : { host: o, project: i, scheme: s };
302
+ const e = new URL(n), o = (e.hostname || "").toLowerCase(), t = (e.protocol || "").replace(/:$/, "").toLowerCase(), i = (e.pathname || "").replace(/^\/+/, "").replace(/\.git$/i, "");
303
+ return !o || !i ? null : { host: o, project: i, scheme: t };
294
304
  } catch (e) {
295
- S.debug("[getGitRemote] [parsing → skip] URL parse failed", { cause: e });
305
+ w.debug("[getGitRemote] [parsing → skip] URL parse failed", { cause: e });
296
306
  }
297
- const r = t.match(/^[\w.-]+@([^:\/]+)[:\/](.+)$/);
307
+ const r = n.match(/^[\w.-]+@([^:\/]+)[:\/](.+)$/);
298
308
  if (r) {
299
- const e = (r[1] || "").toLowerCase(), o = (r[2] || "").replace(/^\/+/, "").replace(/\.git$/i, ""), s = "ssh";
300
- return !e || !o ? null : { host: e, project: o, scheme: s };
309
+ const e = (r[1] || "").toLowerCase(), o = (r[2] || "").replace(/^\/+/, "").replace(/\.git$/i, ""), t = "ssh";
310
+ return !e || !o ? null : { host: e, project: o, scheme: t };
301
311
  }
302
312
  return null;
303
- }, ce = () => {
313
+ }, le = () => {
304
314
  try {
305
- const n = g(`git rev-list --count HEAD ^${ie()} 2>/dev/null`);
306
- return parseInt(n, 10) || 0;
307
- } catch (n) {
308
- return S.debug("[getGitCommitCount] [counting → fallback] Using 0", { cause: n }), 0;
315
+ const s = g(`git rev-list --count HEAD ^${ce()} 2>/dev/null`);
316
+ return parseInt(s, 10) || 0;
317
+ } catch (s) {
318
+ return w.debug("[getGitCommitCount] [counting → fallback] Using 0", { cause: s }), 0;
309
319
  }
310
- }, le = (n) => g(n ? `git diff ${n}` : "git diff HEAD"), Fe = (n) => {
311
- const t = le(n), r = ae(t).sort((a, c) => a.tokens - c.tokens), e = r.filter(
312
- (a) => !a.isDeleted && !a.isRenamed && !R(a.filename) && (a.category === "config" || a.programmingLanguage)
320
+ }, ue = (s) => g(s ? `git diff ${s}` : "git diff HEAD"), Ge = (s) => {
321
+ const n = ue(s), r = ie(n).sort((a, c) => a.tokens - c.tokens), e = r.filter(
322
+ (a) => !a.isDeleted && !a.isRenamed && !N(a.filename) && (a.category === "config" || a.programmingLanguage)
313
323
  );
314
324
  e.length || e.push(
315
325
  ...r.filter(
316
- (a) => !a.isDeleted && !a.isRenamed && (a.category === "doc" || R(a.filename))
326
+ (a) => !a.isDeleted && !a.isRenamed && (a.category === "doc" || N(a.filename))
317
327
  )
318
328
  );
319
- const o = e.reduce((a, c) => a + c.tokens, 0), s = e.at(-1)?.tokens ?? 0, i = [
329
+ const o = e.reduce((a, c) => a + c.tokens, 0), t = e.at(-1)?.tokens ?? 0, i = [
320
330
  ...new Set(e.map((a) => a.programmingLanguage).filter(Boolean))
321
331
  ];
322
332
  return {
323
- diff: t,
333
+ diff: n,
324
334
  parsedDiff: r,
325
335
  parsedCodeDiff: e,
326
336
  parsedCodeTokens: o,
327
- parsedCodeChunkMaxTokens: s,
337
+ parsedCodeChunkMaxTokens: t,
328
338
  programmingLanguages: i,
329
- commitCount: ce()
339
+ commitCount: le()
330
340
  };
331
- }, ue = (n) => {
332
- if (Array.isArray(n) && n.length === 2) {
333
- const t = n[1];
334
- if (t === null)
335
- return n[0];
336
- throw t instanceof Error ? t : new TypeError(`[UNGUARD_ERROR_TYPE] Error "${t}"`, { cause: t });
341
+ }, de = (s) => {
342
+ if (Array.isArray(s) && s.length === 2) {
343
+ const n = s[1];
344
+ if (n === null)
345
+ return s[0];
346
+ throw n instanceof Error ? n : new TypeError(`[UNGUARD_ERROR_TYPE] Error "${n}"`, { cause: n });
337
347
  }
338
348
  throw new SyntaxError(
339
349
  "[UNGUARD_ERROR_SYNTAX] Invalid input: not a valid [result, error] tuple.",
340
- { cause: n }
350
+ { cause: s }
341
351
  );
342
- }, Ge = async (n) => {
343
- const t = await n;
344
- return ue(t);
345
- }, N = "</think>", We = (n) => {
346
- const t = String(n ?? "").split(N).slice(-1).join(N).trim();
347
- return /^(Хорошо,|Okay,)/.test(t) ? t.split(`
352
+ }, We = async (s) => {
353
+ const n = await s;
354
+ return de(n);
355
+ }, T = "</think>", He = (s) => {
356
+ const n = String(s ?? "").split(T).slice(-1).join(T).trim();
357
+ return /^(Хорошо,|Okay,)/.test(n) ? n.split(`
348
358
 
349
359
 
350
360
  `).slice(-1).join(`
351
361
 
352
362
 
353
- `).trim() : t;
363
+ `).trim() : n;
354
364
  };
355
365
  class C {
356
366
  /** @purpose Default configuration filename. */
@@ -361,7 +371,7 @@ class C {
361
371
  * @sideEffect IO: file read at constructor.
362
372
  */
363
373
  static getDefaults() {
364
- return [process.cwd(), process.env.HOME].map((t) => new C(t));
374
+ return [process.cwd(), process.env.HOME].map((n) => new C(n));
365
375
  }
366
376
  /** @purpose Full path to the loaded rc config file. */
367
377
  _filename = "";
@@ -376,11 +386,11 @@ class C {
376
386
  * @param [dir] Directory to look for the rc file in (defaults to cwd).
377
387
  * @param [name] Config filename (defaults to .gennadyrc).
378
388
  */
379
- constructor(t = process.cwd(), r = C.DEFAULT_FILENAME) {
380
- this._filename = A(t, r);
389
+ constructor(n = process.cwd(), r = C.DEFAULT_FILENAME) {
390
+ this._filename = A(n, r);
381
391
  try {
382
392
  if (x(this._filename)) {
383
- const e = JSON.parse(O(this._filename).toString());
393
+ const e = JSON.parse(I(this._filename).toString());
384
394
  Array.isArray(e) ? this._data.models = e : e && typeof e == "object" && Array.isArray(e.models) ? this._data = {
385
395
  ...this._data,
386
396
  ...e
@@ -417,22 +427,22 @@ class C {
417
427
  return this._error;
418
428
  }
419
429
  }
420
- function He(n) {
421
- const t = String(n).match(/<message[\s\S]*?>[\s\S]*?<\/message>/)?.[0];
422
- if (!t)
430
+ function Ke(s) {
431
+ const n = String(s).match(/<message[\s\S]*?>[\s\S]*?<\/message>/)?.[0];
432
+ if (!n)
423
433
  return null;
424
- const r = (a) => t.match(a)?.[1] ?? "", e = r(/type="([^"]+)"/), o = r(/icon="([^"]+)"/), s = r(/<subject>([\s\S]*?)<\/subject>/), i = r(/<description>([\s\S]*?)<\/description>/).replace(/\n\s+-/g, `
434
+ const r = (a) => n.match(a)?.[1] ?? "", e = r(/type="([^"]+)"/), o = r(/icon="([^"]+)"/), t = r(/<subject>([\s\S]*?)<\/subject>/), i = r(/<description>([\s\S]*?)<\/description>/).replace(/\n\s+-/g, `
425
435
  -`);
426
436
  return {
427
437
  type: e,
428
438
  icon: o,
429
- subject: s?.trim() || null,
439
+ subject: t?.trim() || null,
430
440
  description: i?.trim() || null
431
441
  };
432
442
  }
433
- function _(n) {
434
- return n ? String(n).replace(/[<>&'"]/g, (t) => {
435
- switch (t) {
443
+ function _(s) {
444
+ return s ? String(s).replace(/[<>&'"]/g, (n) => {
445
+ switch (n) {
436
446
  case "<":
437
447
  return "&lt;";
438
448
  case ">":
@@ -444,33 +454,33 @@ function _(n) {
444
454
  case '"':
445
455
  return "&quot;";
446
456
  default:
447
- return t;
457
+ return n;
448
458
  }
449
459
  }) : "";
450
460
  }
451
- function T(n, t = 0) {
452
- const r = " ".repeat(t), { tag: e, attrs: o, children: s } = n;
461
+ function $(s, n = 0) {
462
+ const r = " ".repeat(n), { tag: e, attrs: o, children: t } = s;
453
463
  let i = "";
454
- if (o && (i = Object.entries(o).filter(([, c]) => c != null).map(([c, l]) => ` ${c}="${_(String(l))}"`).join("")), s == null)
464
+ if (o && (i = Object.entries(o).filter(([, c]) => c != null).map(([c, l]) => ` ${c}="${_(String(l))}"`).join("")), t == null)
455
465
  return `${r}<${e}${i} />`;
456
- if (Array.isArray(s) && s.length === 0)
466
+ if (Array.isArray(t) && t.length === 0)
457
467
  return `${r}<${e}${i} />`;
458
468
  let a = "";
459
- return Array.isArray(s) ? s.length > 0 && typeof s[0] == "string" ? a = s.map((l) => _(l)).join(`
469
+ return Array.isArray(t) ? t.length > 0 && typeof t[0] == "string" ? a = t.map((l) => _(l)).join(`
460
470
  `) : a = `
461
- ` + s.map((l) => T(l, t + 1)).join(`
471
+ ` + t.map((l) => $(l, n + 1)).join(`
462
472
  `) + `
463
- ` + r : typeof s == "string" ? a = _(s) : "cdata" in s ? a = `<![CDATA[${String(s.cdata).replaceAll("]]>", "]]]]><![CDATA[>")}]]>` : a = `
464
- ` + T(s, t + 1) + `
473
+ ` + r : typeof t == "string" ? a = _(t) : "cdata" in t ? a = `<![CDATA[${String(t.cdata).replaceAll("]]>", "]]]]><![CDATA[>")}]]>` : a = `
474
+ ` + $(t, n + 1) + `
465
475
  ` + r, `${r}<${e}${i}>${a}</${e}>`;
466
476
  }
467
- function Ke(n) {
468
- const t = [
477
+ function Ve(s) {
478
+ const n = [
469
479
  "ai.knowledge.md",
470
480
  "ai/ai.knowledge.md"
471
481
  ], r = [];
472
- for (const e of t) {
473
- const o = d.join(n, e);
482
+ for (const e of n) {
483
+ const o = d.join(s, e);
474
484
  try {
475
485
  f.existsSync(o) && f.statSync(o).isFile() && r.push(e);
476
486
  } catch {
@@ -478,7 +488,7 @@ function Ke(n) {
478
488
  }
479
489
  return r.length === 0 ? "" : `**MUST READ PROJECT KNOWLEDGE FILES**: ${r.join(", ")}.`;
480
490
  }
481
- const de = [
491
+ const fe = [
482
492
  {
483
493
  kind: "marker",
484
494
  relativePath: "go.mod",
@@ -517,37 +527,37 @@ const de = [
517
527
  commands: ["cargo test", "cargo clippy"]
518
528
  }
519
529
  ];
520
- function fe(n, t) {
521
- const r = d.join(n, t);
530
+ function me(s, n) {
531
+ const r = d.join(s, n);
522
532
  try {
523
533
  return f.existsSync(r) && f.statSync(r).isFile();
524
534
  } catch {
525
535
  return !1;
526
536
  }
527
537
  }
528
- function me(n, t) {
529
- const r = n.toLowerCase(), e = t.toLowerCase();
538
+ function ge(s, n) {
539
+ const r = s.toLowerCase(), e = n.toLowerCase();
530
540
  return /(^|:|-)watch($|:|-)/i.test(r) ? !0 : [
531
541
  /(^|\s)--watch(?:[=\s]|$)/i,
532
542
  /(^|\s)--watchall(?:[=\s]|$)/i,
533
543
  /(^|\s)watch(?:\s|$)/i,
534
544
  /(^|\s)nodemon(?:\s|$)/i
535
- ].some((s) => s.test(e));
545
+ ].some((t) => t.test(e));
536
546
  }
537
- function ge(n, t, r) {
538
- const e = Object.entries(n).filter(
539
- ([o, s]) => !r.has(o) && !me(o, s)
547
+ function pe(s, n, r) {
548
+ const e = Object.entries(s).filter(
549
+ ([o, t]) => !r.has(o) && !ge(o, t)
540
550
  );
541
- for (const o of t.preferredNames)
542
- if (e.some(([s]) => s === o))
551
+ for (const o of n.preferredNames)
552
+ if (e.some(([t]) => t === o))
543
553
  return o;
544
554
  for (const [o] of e)
545
- if (t.fallbackPatterns.some((s) => s.test(o)))
555
+ if (n.fallbackPatterns.some((t) => t.test(o)))
546
556
  return o;
547
557
  return null;
548
558
  }
549
- function pe(n, t) {
550
- const r = d.join(n, "package.json");
559
+ function he(s, n) {
560
+ const r = d.join(s, "package.json");
551
561
  let e;
552
562
  try {
553
563
  if (!f.existsSync(r) || !f.statSync(r).isFile())
@@ -562,192 +572,192 @@ function pe(n, t) {
562
572
  } catch {
563
573
  return null;
564
574
  }
565
- const s = o.scripts;
566
- if (!s || typeof s != "object")
575
+ const t = o.scripts;
576
+ if (!t || typeof t != "object")
567
577
  return null;
568
578
  const i = [], a = /* @__PURE__ */ new Set();
569
- for (const c of t.scriptGroups) {
570
- const l = ge(s, c, a);
571
- if (l && (i.push(`npm run ${l}`), a.add(l)), i.length >= t.maxCommands)
579
+ for (const c of n.scriptGroups) {
580
+ const l = pe(t, c, a);
581
+ if (l && (i.push(`npm run ${l}`), a.add(l)), i.length >= n.maxCommands)
572
582
  break;
573
583
  }
574
- return i.length === 0 ? null : i.slice(0, t.maxCommands);
584
+ return i.length === 0 ? null : i.slice(0, n.maxCommands);
575
585
  }
576
- function he(n) {
577
- for (const t of de) {
578
- if (t.kind === "marker") {
579
- if (fe(n, t.relativePath))
580
- return [...t.commands];
586
+ function ye(s) {
587
+ for (const n of fe) {
588
+ if (n.kind === "marker") {
589
+ if (me(s, n.relativePath))
590
+ return [...n.commands];
581
591
  continue;
582
592
  }
583
- if (t.kind === "npm-package-json") {
584
- const r = pe(n, t);
593
+ if (n.kind === "npm-package-json") {
594
+ const r = he(s, n);
585
595
  if (r != null && r.length > 0)
586
596
  return r;
587
597
  }
588
598
  }
589
599
  return [];
590
600
  }
591
- function ye(n) {
592
- return n.map((t) => `\`${t}\``).join(", ");
601
+ function Ee(s) {
602
+ return s.map((n) => `\`${n}\``).join(", ");
593
603
  }
594
- function Ye(n) {
595
- const t = he(n);
596
- if (t.length === 0)
604
+ function Ye(s) {
605
+ const n = ye(s);
606
+ if (n.length === 0)
597
607
  return {
598
608
  axiomHint: "как в README или CI принято проверять код (тесты, линтер, типы). Не подменяй это тяжёлой production-сборкой или публикацией, если это явно не описано как проверка",
599
609
  toolsExample: "команды из `package.json` → `scripts`, из Makefile или из CI-шагов, которые относятся к качеству кода; сначала прочитай README",
600
610
  verifyStep: "Прочитай README и при наличии — конфиг CI: какие команды запускают тесты, линтер и проверку типов. Выполни их из корня репозитория. Не запускай `build`/`publish`/полный `ci`, если не уверен, что это нужно для проверки изменений; при сомнении спроси пользователя."
601
611
  };
602
- const r = ye(t);
612
+ const r = Ee(n);
603
613
  return {
604
- axiomHint: `\`${t[0]}\` или следующую команду из того же набора проверок`,
614
+ axiomHint: `\`${n[0]}\` или следующую команду из того же набора проверок`,
605
615
  toolsExample: r,
606
616
  verifyStep: `Из корня репозитория выполни: ${r}. Не добавляй \`build\`, полный \`ci\` или публикацию, если они не перечислены здесь и не описаны в README как обязательная проверка.`
607
617
  };
608
618
  }
609
619
  const E = "ai/agents";
610
- function $(n) {
611
- return f.existsSync(n) ? f.promises.readFile(n, "utf-8") : null;
620
+ function j(s) {
621
+ return f.existsSync(s) ? f.promises.readFile(s, "utf-8") : null;
612
622
  }
613
- function Ee(n) {
614
- let t = n;
623
+ function ke(s) {
624
+ let n = s;
615
625
  for (; ; ) {
616
- const r = d.join(t, "package.json");
626
+ const r = d.join(n, "package.json");
617
627
  if (f.existsSync(r))
618
- return t;
619
- const e = d.dirname(t);
620
- if (e === t)
628
+ return n;
629
+ const e = d.dirname(n);
630
+ if (e === n)
621
631
  return null;
622
- t = e;
632
+ n = e;
623
633
  }
624
634
  }
625
- async function Ve(n) {
626
- const t = d.dirname(L(import.meta.url)), r = d.join(process.cwd(), E, n), e = $(r);
635
+ async function Je(s) {
636
+ const n = d.dirname(L(import.meta.url)), r = d.join(process.cwd(), E, s), e = j(r);
627
637
  if (e)
628
638
  return e;
629
- const o = Ee(t), s = [];
630
- o ? (s.push(d.join(o, E, n)), s.push(d.join(o, "dist", E, n))) : s.push(
631
- d.join(t, "../../../../../../dist", E, n)
639
+ const o = ke(n), t = [];
640
+ o ? (t.push(d.join(o, E, s)), t.push(d.join(o, "dist", E, s))) : t.push(
641
+ d.join(n, "../../../../../../dist", E, s)
632
642
  );
633
- for (const i of s) {
634
- const a = $(i);
643
+ for (const i of t) {
644
+ const a = j(i);
635
645
  if (a)
636
646
  return a;
637
647
  }
638
- throw new Error(`Не найден файл шаблона ${n}.`, {
648
+ throw new Error(`Не найден файл шаблона ${s}.`, {
639
649
  cause: {
640
650
  projectOverridePath: r,
641
- packageCandidates: s
651
+ packageCandidates: t
642
652
  }
643
653
  });
644
654
  }
645
- function Je(n, t) {
655
+ function Xe(s, n) {
646
656
  try {
647
- const r = A(n, "node_modules", "gennady", t);
657
+ const r = A(s, "node_modules", "gennady", n);
648
658
  if (x(r)) return r;
649
659
  } catch {
650
660
  }
651
661
  try {
652
- const r = import.meta.resolve("gennady"), o = L(r).replace(/[/\\]dist[/\\].*$/, ""), s = A(o, t);
653
- if (x(s)) return s;
662
+ const r = import.meta.resolve("gennady"), o = L(r).replace(/[/\\]dist[/\\].*$/, ""), t = A(o, n);
663
+ if (x(t)) return t;
654
664
  } catch {
655
665
  }
656
666
  return null;
657
667
  }
658
- function Xe(n, t) {
659
- return !Buffer.isBuffer(n) || !Buffer.isBuffer(t) ? !0 : Buffer.compare(n, t) !== 0;
668
+ function ze(s, n) {
669
+ return !Buffer.isBuffer(s) || !Buffer.isBuffer(n) ? !0 : Buffer.compare(s, n) !== 0;
660
670
  }
661
- function ze(n, t) {
662
- let r = n;
663
- for (const e of t)
671
+ function qe(s, n) {
672
+ let r = s;
673
+ for (const e of n)
664
674
  r = r.replace(e.from, e.to);
665
675
  return r;
666
676
  }
667
677
  const P = {
668
678
  from: /npx\s+tsx\s+~\/Developer\/gennady\/cli\/gennady\.ts\b/g,
669
679
  to: "npx gennady"
670
- }, M = {
680
+ }, U = {
671
681
  from: /npx tsx ~\/Developer\/gennady\/cli[ \t]+/g,
672
682
  to: "npx gennady "
673
- }, U = {
683
+ }, F = {
674
684
  from: /~\/Developer\/gennady\/cli\/gennady\.ts/g,
675
685
  to: "npx gennady"
676
- }, ke = {
686
+ }, _e = {
677
687
  from: /~\/Developer\/gennady\/ai\/skills\//g,
678
688
  to: ".claude/skills/"
679
- }, F = {
689
+ }, G = {
680
690
  from: /~\/Developer\/gennady\/ai\/directives\//g,
681
691
  to: "ai/directives/"
682
- }, G = {
692
+ }, W = {
683
693
  from: /\/Users\/k\.lebedev\/Developer\/gennady\/ai\//g,
684
694
  to: "ai/"
685
- }, W = {
695
+ }, H = {
686
696
  from: /\/Users\/k\.lebedev\/Developer\/gennady\/cli\/gennady\.ts/g,
687
697
  to: "npx gennady"
688
- }, H = {
698
+ }, K = {
689
699
  from: /\$HOME\/Developer\/gennady\/cli\/gennady\.ts\b/g,
690
700
  to: "~/Developer/gennady/cli/gennady.ts"
691
- }, qe = [
701
+ }, Qe = [
692
702
  P,
693
- M,
694
703
  U,
695
704
  F,
696
705
  G,
697
706
  W,
698
- H
699
- ], Qe = [
707
+ H,
708
+ K
709
+ ], Ze = [
700
710
  P,
701
- M,
702
711
  U,
703
- ke,
704
712
  F,
713
+ _e,
705
714
  G,
706
715
  W,
707
- H
708
- ], _e = "+", xe = "~", Ae = "-", Ce = "=", Le = "(unchanged)", Se = "(would add)", we = "(would update)", De = "(would delete)", be = "(unchanged, skip)";
709
- function Ze(n, t = {}) {
716
+ H,
717
+ K
718
+ ], xe = "+", Ae = "~", Ce = "-", Le = "=", we = "(unchanged)", Se = "(would add)", De = "(would update)", be = "(would delete)", ve = "(unchanged, skip)";
719
+ function et(s, n = {}) {
710
720
  const r = [];
711
- for (const a of n) {
721
+ for (const a of s) {
712
722
  const { relativePath: c, status: l } = a;
713
723
  let u, m;
714
- l === "added" ? (u = _e, m = t.dryRun ? Se : "") : l === "updated" ? (u = xe, m = t.dryRun ? we : "") : l === "deleted" ? (u = Ae, m = t.dryRun ? De : "") : (u = Ce, m = t.dryRun ? be : Le);
715
- const K = c.padEnd(64);
716
- m ? r.push(` ${u} ${K} ${m}`) : r.push(` ${u} ${c}`);
724
+ l === "added" ? (u = xe, m = n.dryRun ? Se : "") : l === "updated" ? (u = Ae, m = n.dryRun ? De : "") : l === "deleted" ? (u = Ce, m = n.dryRun ? be : "") : (u = Le, m = n.dryRun ? ve : we);
725
+ const V = c.padEnd(64);
726
+ m ? r.push(` ${u} ${V} ${m}`) : r.push(` ${u} ${c}`);
717
727
  }
718
- const e = n.filter((a) => a.status === "added").length, o = n.filter((a) => a.status === "updated").length, s = n.filter((a) => a.status === "unchanged").length, i = n.filter((a) => a.status === "deleted").length;
719
- if (t.dryRun)
728
+ const e = s.filter((a) => a.status === "added").length, o = s.filter((a) => a.status === "updated").length, t = s.filter((a) => a.status === "unchanged").length, i = s.filter((a) => a.status === "deleted").length;
729
+ if (n.dryRun)
720
730
  r.push("Dry-run: no files written.");
721
731
  else {
722
- let a = `Synced: ${e} added, ${o} updated, ${s} skipped (unchanged)`;
732
+ let a = `Synced: ${e} added, ${o} updated, ${t} skipped (unchanged)`;
723
733
  i > 0 && (a += `, ${i} deleted`), r.push(a);
724
734
  }
725
735
  return r;
726
736
  }
727
737
  export {
728
738
  C as G,
729
- qe as S,
730
- Ue as a,
731
- Xe as b,
732
- je as c,
733
- Qe as d,
739
+ Qe as S,
740
+ Fe as a,
741
+ ze as b,
742
+ Oe as c,
743
+ Ze as d,
734
744
  g as e,
735
- Ze as f,
736
- Fe as g,
737
- Me as h,
738
- T as i,
745
+ et as f,
746
+ Ge as g,
747
+ Ue as h,
748
+ $ as i,
739
749
  Ye as j,
740
- Ke as k,
741
- Ve as l,
742
- We as m,
743
- ze as n,
744
- b as o,
745
- Ie as p,
750
+ Ve as k,
751
+ Je as l,
752
+ He as m,
753
+ qe as n,
754
+ v as o,
755
+ Me as p,
746
756
  Pe as q,
747
- Je as r,
748
- Oe as s,
749
- ae as t,
750
- Ge as u,
751
- ue as v,
752
- He as x
757
+ Xe as r,
758
+ Ie as s,
759
+ ie as t,
760
+ We as u,
761
+ de as v,
762
+ Ke as x
753
763
  };
package/dist/gennady.js CHANGED
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import { c as i } from "./chunks/shared-DL_1LG0K.js";
2
+ import { c as s } from "./chunks/shared-9J_oXE74.js";
3
3
  import "node:fs";
4
4
  import "node:path";
5
5
  import "node:url";
6
- const s = "0.8.1", r = /* @__PURE__ */ new Set(["help", "--help", "-h"]), t = process.argv[2];
7
- (!t || r.has(t)) && (await import("./chunks/help.cmd-BseRtoBF.js"), process.exit(0));
8
- i({ name: "gennady", version: s });
9
- const o = process.argv.slice(3);
10
- if (o.some((a) => r.has(a))) {
6
+ const r = "0.8.2", i = /* @__PURE__ */ new Set(["help", "--help", "-h"]), o = /* @__PURE__ */ new Set(["--version", "-v"]), t = process.argv[2];
7
+ o.has(t) && (console.log(r), process.exit(0));
8
+ (!t || i.has(t)) && (await import("./chunks/help.cmd-BDO4k0_z.js"), process.exit(0));
9
+ s({ name: "gennady", version: r });
10
+ const p = process.argv.slice(3);
11
+ if (p.some((a) => i.has(a))) {
11
12
  let a = !1;
12
13
  switch (t) {
13
14
  case "cat":
@@ -54,31 +55,31 @@ if (o.some((a) => r.has(a))) {
54
55
  }
55
56
  switch (t) {
56
57
  case "cat":
57
- await import("./chunks/index-BU1AXJGA.js");
58
+ await import("./chunks/index-DICatQqS.js");
58
59
  break;
59
60
  case "review":
60
- await import("./chunks/index-BghL1-Nk.js");
61
+ await import("./chunks/index-B4ODZbtC.js");
61
62
  break;
62
63
  case "vcs-reply":
63
- await import("./chunks/index-k0nToACp.js");
64
+ await import("./chunks/index-9e72uZq7.js");
64
65
  break;
65
66
  case "review-verify":
66
- await import("./chunks/index-OtehG7uM.js");
67
+ await import("./chunks/index-mkUNzixA.js");
67
68
  break;
68
69
  case "review-issues":
69
- await import("./chunks/index-BlqEQEGy.js");
70
+ await import("./chunks/index-DS_1ZX6G.js");
70
71
  break;
71
72
  case "resolve-conflicts":
72
- await import("./chunks/index-CkczJ__m.js");
73
+ await import("./chunks/index-ZpU_VoI0.js");
73
74
  break;
74
75
  case "commit":
75
- await import("./chunks/index-CDM74qdR.js");
76
+ await import("./chunks/index-BmABG4HA.js");
76
77
  break;
77
78
  case "remote-console":
78
- await import("./chunks/index-CGsIRefC.js");
79
+ await import("./chunks/index-9JlEjsvH.js");
79
80
  break;
80
81
  case "lint":
81
- await import("./chunks/index-CHaPz3Ol.js");
82
+ await import("./chunks/index-C9UEDrqg.js");
82
83
  break;
83
84
  case "alt-opinion":
84
85
  await import("./chunks/index-BXWDYM_9.js");
@@ -87,10 +88,10 @@ switch (t) {
87
88
  await import("./chunks/index-DoaxOhQ8.js");
88
89
  break;
89
90
  case "sync":
90
- await import("./chunks/index-ZM_FonZj.js");
91
+ await import("./chunks/index-4fUNp3za.js");
91
92
  break;
92
93
  case "sync-skills":
93
- await import("./chunks/index-DEzym4Ae.js");
94
+ await import("./chunks/index-jOIhIHdS.js");
94
95
  break;
95
96
  case "orient":
96
97
  await import("./chunks/index-BgKyH0dB.js");
@@ -99,5 +100,5 @@ switch (t) {
99
100
  await import("./chunks/index-CtJKSOL0.js");
100
101
  break;
101
102
  default:
102
- await import("./chunks/help.cmd-BseRtoBF.js"), process.exit(0);
103
+ await import("./chunks/help.cmd-BDO4k0_z.js"), process.exit(0);
103
104
  }
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { u, m } from "./chunks/shared-DL_1LG0K.js";
2
- import { G as y, o as d, q as A, t as f, v as R } from "./chunks/shared-DL_1LG0K.js";
1
+ import { u, m } from "./chunks/shared-9J_oXE74.js";
2
+ import { G as y, o as d, q as A, t as f, v as R } from "./chunks/shared-9J_oXE74.js";
3
3
  import { R as C, f as O, r as T, g as L, c as $ } from "./chunks/services-IgZptnTi.js";
4
4
  class h {
5
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gennady",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "author": "Konstantin Lebedev <ibnrubaxa@gmail.com>",
5
5
  "description": "Gennady — General Extensible Neural Network Adaptive Data Yntelligence",
6
6
  "keywords": [