gennady 0.9.0-next.1 → 0.9.0-next.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 (51) hide show
  1. package/ai/directives/knowledge.xml +6 -0
  2. package/ai/directives/sdd/scaffold.directive.xml +1 -1
  3. package/dist/ai/directives/knowledge.xml +6 -0
  4. package/dist/ai/directives/sdd/scaffold.directive.xml +1 -1
  5. package/dist/chunks/{classify-mr-stage.logic-DZGjUv_X.js → classify-mr-stage.logic-CEWSA1Jl.js} +2 -2
  6. package/dist/chunks/{help-6U1C7MaJ.js → help-DChMR8rJ.js} +1 -1
  7. package/dist/chunks/{help-CrH7JbkQ.js → help-E0wfuWTc.js} +1 -1
  8. package/dist/chunks/{index-C00OiAOa.js → index-B-Kqbxe7.js} +1 -1
  9. package/dist/chunks/{index-DYLeydbi.js → index-B02QRkwN.js} +2 -2
  10. package/dist/chunks/{index-DYC3I17s.js → index-B6d3tYIy.js} +2 -2
  11. package/dist/chunks/{index-D-bCkBnI.js → index-B7z8zrzj.js} +2 -2
  12. package/dist/chunks/{index-BDRz3lXA.js → index-BGpYU6Ee.js} +3 -3
  13. package/dist/chunks/{index-Byfv0STQ.js → index-BJWl0XoV.js} +1 -1
  14. package/dist/chunks/{index-FutEl5bP.js → index-BVCQO200.js} +2 -2
  15. package/dist/chunks/{index-C4WjBAwj.js → index-BdELNZg2.js} +2 -2
  16. package/dist/chunks/{index-DhhVvfCC.js → index-Bek_xxd8.js} +2 -2
  17. package/dist/chunks/{index-C18rETLO.js → index-Bt_oiNCe.js} +1 -1
  18. package/dist/chunks/{index-DAKO8NzT.js → index-BuNK0c2F.js} +1 -1
  19. package/dist/chunks/{index-rYwVVnXg.js → index-BykdvpnE.js} +2 -2
  20. package/dist/chunks/{index-DRnLPx14.js → index-CGONqEEt.js} +2 -2
  21. package/dist/chunks/{index-UX--GLfC.js → index-CMMGX61a.js} +1 -1
  22. package/dist/chunks/{index-hGDyrnx1.js → index-CtVIt7SG.js} +2 -2
  23. package/dist/chunks/{index-BOqtpzbY.js → index-CtuxwDWG.js} +2 -2
  24. package/dist/chunks/{index-DJb5pC6J.js → index-Cx5_KMZX.js} +2 -2
  25. package/dist/chunks/{index-DZ2uzr_h.js → index-D5tq4LQi.js} +2 -2
  26. package/dist/chunks/{index-BFGmZ-nA.js → index-D7rRoEob.js} +2 -2
  27. package/dist/chunks/{index-jJJoXOgC.js → index-D8KziiJs.js} +3 -3
  28. package/dist/chunks/{index-D_d1SoKI.js → index-DNwi9NTq.js} +2 -2
  29. package/dist/chunks/{index-Dge9xC5p.js → index-DQFOqG0r.js} +2 -2
  30. package/dist/chunks/{index-CMJ-BeNB.js → index-DgjDfBG8.js} +2 -2
  31. package/dist/chunks/{index-DMZvxXla.js → index-DjH89P75.js} +3 -3
  32. package/dist/chunks/{index-CK21WzHk.js → index-KHSwB44W.js} +2 -2
  33. package/dist/chunks/{index-BBZ2sZIQ.js → index-QCiPd_Kt.js} +2 -2
  34. package/dist/chunks/{index-BaRqlR5Z.js → index-UBx-NlzB.js} +2 -2
  35. package/dist/chunks/index-YmithrR9.js +209 -0
  36. package/dist/chunks/{index-BxGNUOe7.js → index-ZDjWSSGn.js} +2 -2
  37. package/dist/chunks/{index-Do8Rkc9u.js → index-gG_F0Y7h.js} +2 -2
  38. package/dist/chunks/{index-B2e5IkOV.js → index-h4Cb4-hD.js} +1 -1
  39. package/dist/chunks/{index-BEqwjJ3g.js → index-jQXvIlvQ.js} +2 -2
  40. package/dist/chunks/{index-DLw0rhBC.js → index-m5Yk2pbw.js} +2 -2
  41. package/dist/chunks/{run-review-command.logic-mUOnwzxi.js → run-review-command.logic-CWGkij0q.js} +2 -2
  42. package/dist/chunks/{services-CLhhJf0J.js → services-Blgu2q_P.js} +1 -1
  43. package/dist/chunks/{shared-Bh29rPvY.js → shared-CCgxBhk_.js} +162 -162
  44. package/dist/cli/cmd/sync/sync-core.d.ts +2 -0
  45. package/dist/cli/cmd/sync/sync.types.d.ts +5 -3
  46. package/dist/gennady.js +36 -36
  47. package/dist/index.js +3 -3
  48. package/dist/shared/common/sync/sync-formatter.shared.d.ts +1 -1
  49. package/dist/stack.js +2 -2
  50. package/package.json +1 -1
  51. package/dist/chunks/index-Pj9AcyYF.js +0 -205
@@ -1,4 +1,10 @@
1
1
  <AiKnowledge ver="2.0">
2
+ <!--
3
+ PROJECT-OWNED. This registry lists the directives and rule files THIS project activates. A
4
+ non-Node project rewrites the rule set for its own stack (Python, Go, Swift, …). `gennady sync`
5
+ seeds this file when absent but never overwrites an existing one, so your edits survive upgrades.
6
+ The shipped copy is a TypeScript-oriented starting point, not a fixed contract.
7
+ -->
2
8
  <Directives>
3
9
  <Sdd>
4
10
  <SddSetup>
@@ -71,7 +71,7 @@
71
71
  </Axiom>
72
72
 
73
73
  <Axiom id="AX_RULES_RESOLUTION_HARD_FAIL">
74
- **All rule references must resolve; missing rule = abort.** Sources: scope spec (5 Effective Rules for infra; 4.5 Rules for product/library), module spec (9 Handoff Module Rules Additions), task (operator-supplied at STEP_4). Each ref must exist as `ai/directives/<category>/<rule>.xml`. On miss: abort with explicit list. A placeholder rule reference (TBD, `<rule>`, "to be authored", any unresolved name) = abort, never write a ticket against it.
74
+ **All rule references must resolve; missing rule = abort.** Sources: scope spec (5 Effective Rules for infra; 4.5 Rules for product/library), module spec (9 Handoff Module Rules Additions), task (operator-supplied at STEP_4). Each ref must exist as `ai/directives/<category>/<rule>.xml`. On miss: abort with explicit list. A placeholder rule reference (TBD, `<rule>`, "to be authored", any unresolved name) = abort, never write a ticket against it. The rule set is PROJECT-OWNED (`ai/directives/knowledge.xml`, kept across sync): the shipped rules are TypeScript-oriented, so a non-Node scope authors its own rule files for its stack and lists them — do NOT invent references to package rules that do not exist for the project's language. A scope that legitimately activates no rules yet declares an empty set (valid); this is distinct from a dangling reference (abort).
75
75
  </Axiom>
76
76
 
77
77
  <Axiom id="AX_RULES_CASCADE_RESOLUTION">
@@ -1,4 +1,10 @@
1
1
  <AiKnowledge ver="2.0">
2
+ <!--
3
+ PROJECT-OWNED. This registry lists the directives and rule files THIS project activates. A
4
+ non-Node project rewrites the rule set for its own stack (Python, Go, Swift, …). `gennady sync`
5
+ seeds this file when absent but never overwrites an existing one, so your edits survive upgrades.
6
+ The shipped copy is a TypeScript-oriented starting point, not a fixed contract.
7
+ -->
2
8
  <Directives>
3
9
  <Sdd>
4
10
  <SddSetup>
@@ -71,7 +71,7 @@
71
71
  </Axiom>
72
72
 
73
73
  <Axiom id="AX_RULES_RESOLUTION_HARD_FAIL">
74
- **All rule references must resolve; missing rule = abort.** Sources: scope spec (5 Effective Rules for infra; 4.5 Rules for product/library), module spec (9 Handoff Module Rules Additions), task (operator-supplied at STEP_4). Each ref must exist as `ai/directives/<category>/<rule>.xml`. On miss: abort with explicit list. A placeholder rule reference (TBD, `<rule>`, "to be authored", any unresolved name) = abort, never write a ticket against it.
74
+ **All rule references must resolve; missing rule = abort.** Sources: scope spec (5 Effective Rules for infra; 4.5 Rules for product/library), module spec (9 Handoff Module Rules Additions), task (operator-supplied at STEP_4). Each ref must exist as `ai/directives/<category>/<rule>.xml`. On miss: abort with explicit list. A placeholder rule reference (TBD, `<rule>`, "to be authored", any unresolved name) = abort, never write a ticket against it. The rule set is PROJECT-OWNED (`ai/directives/knowledge.xml`, kept across sync): the shipped rules are TypeScript-oriented, so a non-Node scope authors its own rule files for its stack and lists them — do NOT invent references to package rules that do not exist for the project's language. A scope that legitimately activates no rules yet declares an empty set (valid); this is distinct from a dangling reference (abort).
75
75
  </Axiom>
76
76
 
77
77
  <Axiom id="AX_RULES_CASCADE_RESOLUTION">
@@ -1,5 +1,5 @@
1
- import { a as c } from "./shared-Bh29rPvY.js";
2
- import { V as h } from "./services-CLhhJf0J.js";
1
+ import { a as c } from "./shared-CCgxBhk_.js";
2
+ import { V as h } from "./services-Blgu2q_P.js";
3
3
  function f(s) {
4
4
  const e = s?.trim().replace(/^https?:\/\//, "").replace(/\/+$/, "");
5
5
  if (e) return e;
@@ -1,4 +1,4 @@
1
- import { B as n } from "./services-CLhhJf0J.js";
1
+ import { B as n } from "./services-Blgu2q_P.js";
2
2
  function t() {
3
3
  console.info("gennady verify — stack-agnostic verification gates (one command for every stack)"), console.info(""), console.info("Usage:"), console.info(" npx gennady verify [path...] [options]"), console.info(""), console.info("Stacks (auto-detected by root marker file; all detected stacks run together):");
4
4
  for (const o of n)
@@ -1,4 +1,4 @@
1
- import { s as o } from "./shared-Bh29rPvY.js";
1
+ import { s as o } from "./shared-CCgxBhk_.js";
2
2
  function n() {
3
3
  console.info(o.bold("gennady inbox-context — атомарный сбор контекста MR")), console.info(""), console.info(" gennady inbox-context --ref <group/project!iid> [флаги]"), console.info(""), console.info(o.bold("Флаги:")), console.info(" --ref <ref> MR ref (обязателен)"), console.info(" --vcs-host=<host> GitLab host (автодетект из origin)"), console.info(" --skip-worktree Без клона — changeset и worktree пусты"), console.info(" --skip-threads Без обсуждений — threads/stage пусты"), console.info(" --repos-base=<dir> База поиска клонов (default ~/Developer)"), console.info(" --state-dir=<dir> Директория состояния (default ~/.gennady)"), console.info(" --json Вывод в JSON (по умолчанию)"), console.info(""), console.info(o.bold("Вывод (JSON):")), console.info(" ref, title, webUrl — идентификация MR"), console.info(" worktree — path, base, diffRefs, repoLayout"), console.info(" changeset — files [{path, status, plus, minus}], totals, byCategory"), console.info(" stage — review_needed | reply_needed | awaiting_reply | idle"), console.info(" openQuestions, lastAuthor — из обсуждений"), console.info(" threads — { all, drafts } — полные треды и черновики"), console.info(" package — role, author, reviewers, description, approvedBy");
4
4
  }
@@ -10,7 +10,7 @@ import tS from "node:tty";
10
10
  import AS from "node:os";
11
11
  import { EventEmitter as Wh } from "node:events";
12
12
  import eS from "module";
13
- import { l as Ei, C as nS, O as aS, x as lS, y as uS } from "./services-CLhhJf0J.js";
13
+ import { l as Ei, C as nS, O as aS, x as lS, y as uS } from "./services-Blgu2q_P.js";
14
14
  import "node:path";
15
15
  var FB = { exports: {} }, CA = {};
16
16
  /**
@@ -1,5 +1,5 @@
1
- import { p as k, V as $, r as V } from "./shared-Bh29rPvY.js";
2
- import { l as x, a as R, V as I } from "./services-CLhhJf0J.js";
1
+ import { p as k, V as $, r as V } from "./shared-CCgxBhk_.js";
2
+ import { l as x, a as R, V as I } from "./services-Blgu2q_P.js";
3
3
  const f = {
4
4
  "👍": { gitlab: "thumbsup", github: "+1" },
5
5
  "👎": { gitlab: "thumbsdown", github: "-1" },
@@ -1,5 +1,5 @@
1
- import { p as j, s as e, g as x } from "./shared-Bh29rPvY.js";
2
- import { p as T, A as E } from "./index-rYwVVnXg.js";
1
+ import { p as j, s as e, g as x } from "./shared-CCgxBhk_.js";
2
+ import { p as T, A as E } from "./index-BykdvpnE.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";
@@ -1,5 +1,5 @@
1
- import { p as w, V as y, r as m } from "./shared-Bh29rPvY.js";
2
- import { l as o, b as R, a as g, V as b } from "./services-CLhhJf0J.js";
1
+ import { p as w, V as y, r as m } from "./shared-CCgxBhk_.js";
2
+ import { l as o, b as R, a as g, V as b } from "./services-Blgu2q_P.js";
3
3
  function A() {
4
4
  return {
5
5
  resolveVcsContext: m,
@@ -2,9 +2,9 @@ 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-rYwVVnXg.js";
6
- import { g as H, s as t, x as D, p as F } from "./shared-Bh29rPvY.js";
7
- import { l as N } from "./services-CLhhJf0J.js";
5
+ import { p as d, A as E } from "./index-BykdvpnE.js";
6
+ import { g as H, s as t, x as D, p as F } from "./shared-CCgxBhk_.js";
7
+ import { l as N } from "./services-Blgu2q_P.js";
8
8
  class U {
9
9
  /** @purpose Configuration with defaults for mode, prompts, timeout. */
10
10
  init;
@@ -1,4 +1,4 @@
1
- import { p as e, r } from "./run-review-command.logic-mUOnwzxi.js";
1
+ import { p as e, r } from "./run-review-command.logic-CWGkij0q.js";
2
2
  const s = e(process.argv), o = await r({
3
3
  mode: "verify",
4
4
  args: s
@@ -1,5 +1,5 @@
1
- import { p as b, V as p, r as w } from "./shared-Bh29rPvY.js";
2
- import { l as r, a as j, V as v } from "./services-CLhhJf0J.js";
1
+ import { p as b, V as p, r as w } from "./shared-CCgxBhk_.js";
2
+ import { l as r, a as j, V as v } from "./services-Blgu2q_P.js";
3
3
  function h() {
4
4
  return {
5
5
  resolveVcsContext: w,
@@ -1,8 +1,8 @@
1
1
  import { readdirSync as P, statSync as R, readFileSync as A, rmSync as M, unlinkSync as W, mkdirSync as b, writeFileSync as z } from "node:fs";
2
2
  import { join as m, sep as K } from "node:path";
3
3
  import { fileURLToPath as j } from "node:url";
4
- import { l as B, n as G } from "./services-CLhhJf0J.js";
5
- import { n as H, j as J, b as V, p as X, h as Y } from "./shared-Bh29rPvY.js";
4
+ import { l as B, n as G } from "./services-Blgu2q_P.js";
5
+ import { n as H, j as J, b as V, p as X, h as Y } from "./shared-CCgxBhk_.js";
6
6
  class q {
7
7
  /** @purpose List of all synced file entries, sorted lexicographically by skillName then relativePath. */
8
8
  entries;
@@ -1,5 +1,5 @@
1
- import { p as w, V as k, r as D } from "./shared-Bh29rPvY.js";
2
- import { l as s, a as u, V as f } from "./services-CLhhJf0J.js";
1
+ import { p as w, V as k, r as D } from "./shared-CCgxBhk_.js";
2
+ import { l as s, a as u, V as f } from "./services-Blgu2q_P.js";
3
3
  function y() {
4
4
  return {
5
5
  resolveVcsContext: D,
@@ -1,7 +1,7 @@
1
1
  import { execSync as Te } from "node:child_process";
2
2
  import { existsSync as R, readFileSync as D, lstatSync as te, readdirSync as E } from "node:fs";
3
3
  import { resolve as ge, join as g, basename as B, relative as Q, extname as I } from "node:path";
4
- import { p as $e } from "./shared-Bh29rPvY.js";
4
+ import { p as $e } from "./shared-CCgxBhk_.js";
5
5
  const p = ge(process.cwd()), C = g(p, "coverage", "coverage-final.json"), se = g(p, "coverage", ".tree-results.json"), h = $e(process.argv, {
6
6
  files: ["files"],
7
7
  run: ["run"],
@@ -1,4 +1,4 @@
1
- import { p as D, k as o, l as M, a as H, m as B, o as U, q as k, t as O, s as F } from "./shared-Bh29rPvY.js";
1
+ import { p as D, k as o, l as M, a as H, m as B, o as U, q as k, t as O, s as F } from "./shared-CCgxBhk_.js";
2
2
  import a from "node:fs";
3
3
  import P from "node:path";
4
4
  function C(e) {
@@ -1,6 +1,6 @@
1
1
  import { AiLegacyModel as h } from "../index.js";
2
- import { G as f, u as c } from "./shared-Bh29rPvY.js";
3
- import { l as p } from "./services-CLhhJf0J.js";
2
+ import { G as f, u as c } from "./shared-CCgxBhk_.js";
3
+ import { l as p } from "./services-Blgu2q_P.js";
4
4
  import { readFileSync as l } from "node:fs";
5
5
  import { dirname as _, join as m } from "node:path";
6
6
  import { fileURLToPath as k } from "node:url";
@@ -1,6 +1,6 @@
1
- import { p as D, r as N, s as o } from "./shared-Bh29rPvY.js";
1
+ import { p as D, r as N, s as o } from "./shared-CCgxBhk_.js";
2
2
  import R from "node:fs";
3
- import { a as j, V as A } from "./services-CLhhJf0J.js";
3
+ import { a as j, V as A } from "./services-Blgu2q_P.js";
4
4
  function _(s, r) {
5
5
  const t = r?.above ?? 0, y = r?.below ?? 0;
6
6
  return ["```suggestion:-", t, "+", y, `
@@ -1,7 +1,7 @@
1
1
  import { readFileSync as As } from "node:fs";
2
2
  import { fileURLToPath as Wu } from "node:url";
3
3
  import { performance as It } from "node:perf_hooks";
4
- import { l as ze } from "./services-CLhhJf0J.js";
4
+ import { l as ze } from "./services-Blgu2q_P.js";
5
5
  var $s = "vercel.ai.error", Hu = Symbol.for($s), br, wr, J = class Rs extends (wr = Error, br = Hu, wr) {
6
6
  /**
7
7
  * Creates an AI SDK Error.
@@ -1,5 +1,5 @@
1
- import { p as e, r as t } from "./run-review-command.logic-mUOnwzxi.js";
2
- import { r as i } from "./shared-Bh29rPvY.js";
1
+ import { p as e, r as t } from "./run-review-command.logic-CWGkij0q.js";
2
+ import { r as i } from "./shared-CCgxBhk_.js";
3
3
  const r = e(process.argv), c = {
4
4
  ref: r.ref,
5
5
  branch: r.branch,
@@ -1,5 +1,5 @@
1
- import { a as v, V as k, l as t } from "./services-CLhhJf0J.js";
2
- import { p as m, r as b, s as r, a as I } from "./shared-Bh29rPvY.js";
1
+ import { a as v, V as k, l as t } from "./services-Blgu2q_P.js";
2
+ import { p as m, r as b, s as r, a as I } from "./shared-CCgxBhk_.js";
3
3
  function $(o) {
4
4
  return o ? o.replace(/^https?:\/\//, "").replace(/\/+$/, "") : I()?.host;
5
5
  }
@@ -1,5 +1,5 @@
1
- import { p as N, V as A, r as C } from "./shared-Bh29rPvY.js";
2
- import { l as M, a as q, V as L } from "./services-CLhhJf0J.js";
1
+ import { p as N, V as A, r as C } from "./shared-CCgxBhk_.js";
2
+ import { l as M, a as q, V as L } from "./services-Blgu2q_P.js";
3
3
  function U() {
4
4
  return {
5
5
  resolveVcsContext: C,
@@ -1,8 +1,8 @@
1
1
  import { mkdirSync as R } from "node:fs";
2
2
  import { homedir as B } from "node:os";
3
3
  import { join as w } from "node:path";
4
- import { s as o, r as C } from "./shared-Bh29rPvY.js";
5
- import { V as W } from "./services-CLhhJf0J.js";
4
+ import { s as o, r as C } from "./shared-CCgxBhk_.js";
5
+ import { V as W } from "./services-Blgu2q_P.js";
6
6
  import { r as x, d as A, w as b, e as D, c as M, a as j, g as V, p as E, b as T } from "./worktree-ops.logic-BmJ0w0WS.js";
7
7
  import { e as O } from "./locate-clone.logic-CeMtgud4.js";
8
8
  const q = 10800 * 1e3;
@@ -1,5 +1,5 @@
1
- import { p as m, f as v, V as p, r as x } from "./shared-Bh29rPvY.js";
2
- import { l as r, a as j, V as C } from "./services-CLhhJf0J.js";
1
+ import { p as m, f as v, V as p, r as x } from "./shared-CCgxBhk_.js";
2
+ import { l as r, a as j, V as C } from "./services-Blgu2q_P.js";
3
3
  import { mkdtempSync as V, writeFileSync as y } from "node:fs";
4
4
  import { tmpdir as F } from "node:os";
5
5
  import { join as h } from "node:path";
@@ -1,6 +1,6 @@
1
1
  import F from "node:path";
2
- import { p as V, e as A } from "./shared-Bh29rPvY.js";
3
- import { c as M, B as j, d as B, p as x, e as L, u as b, f as G, g as q, t as K, h as U, i as X, j as H, k as J } from "./services-CLhhJf0J.js";
2
+ import { p as V, e as A } from "./shared-CCgxBhk_.js";
3
+ import { c as M, B as j, d as B, p as x, e as L, u as b, f as G, g as q, t as K, h as U, i as X, j as H, k as J } from "./services-Blgu2q_P.js";
4
4
  const R = 1, p = 4, z = 5;
5
5
  function I(a) {
6
6
  return typeof a != "string" || a.length === 0 ? [] : a.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
@@ -23,7 +23,7 @@ async function P(a) {
23
23
  help: ["help", "h"]
24
24
  });
25
25
  if (s.help === !0) {
26
- const { printHelp: e } = await import("./help-6U1C7MaJ.js");
26
+ const { printHelp: e } = await import("./help-DChMR8rJ.js");
27
27
  return e(), 0;
28
28
  }
29
29
  const d = I(s.only), E = I(s.skip), c = F.resolve(typeof s.root == "string" ? s.root : process.cwd()), C = s._.slice(s._[0] === "verify" ? 1 : 0), n = M(c, J);
@@ -7,8 +7,8 @@ import Pn from "util";
7
7
  import dt from "stream";
8
8
  import In from "events";
9
9
  import Qt from "fs";
10
- import { l as xe, w as Nn, V as qn, a as Fn } from "./services-CLhhJf0J.js";
11
- import { p as Bn, s as ne } from "./shared-Bh29rPvY.js";
10
+ import { l as xe, w as Nn, V as qn, a as Fn } from "./services-Blgu2q_P.js";
11
+ import { p as Bn, s as ne } from "./shared-CCgxBhk_.js";
12
12
  var se = {}, ie = {}, Oe = {}, nr;
13
13
  function jn() {
14
14
  if (nr) return Oe;
@@ -7,8 +7,8 @@ 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-Bh29rPvY.js";
11
- import { s as K } from "./services-CLhhJf0J.js";
10
+ import { p as G } from "./shared-CCgxBhk_.js";
11
+ import { s as K } from "./services-Blgu2q_P.js";
12
12
  let F;
13
13
  function q() {
14
14
  try {
@@ -1,6 +1,6 @@
1
1
  import C from "node:path";
2
- import { p as w } from "./shared-Bh29rPvY.js";
3
- import { c as E, d as O, B as T, p as N, e as A, u as S, m as y, i as F, k as M } from "./services-CLhhJf0J.js";
2
+ import { p as w } from "./shared-CCgxBhk_.js";
3
+ import { c as E, d as O, B as T, p as N, e as A, u as S, m as y, i as F, k as M } from "./services-Blgu2q_P.js";
4
4
  const D = 1, p = 4, G = 5;
5
5
  function k(t, n) {
6
6
  return t.includes(":") ? t === `${n.stack}:${n.id}` : t === n.id;
@@ -2,10 +2,10 @@ import { execFileSync as V } from "node:child_process";
2
2
  import { mkdirSync as G, readdirSync as H } from "node:fs";
3
3
  import { homedir as q } from "node:os";
4
4
  import { join as R } from "node:path";
5
- import { s as N, r as J } from "./shared-Bh29rPvY.js";
6
- import { V as K } from "./services-CLhhJf0J.js";
5
+ import { s as N, r as J } from "./shared-CCgxBhk_.js";
6
+ import { V as K } from "./services-Blgu2q_P.js";
7
7
  import { r as Q, c as Y, a as z, w as X, g as Z, p as tt, b as et } from "./worktree-ops.logic-BmJ0w0WS.js";
8
- import { b as st, f as ot, c as rt, a as nt, l as it } from "./classify-mr-stage.logic-DZGjUv_X.js";
8
+ import { b as st, f as ot, c as rt, a as nt, l as it } from "./classify-mr-stage.logic-CEWSA1Jl.js";
9
9
  import { e as ct } from "./locate-clone.logic-CeMtgud4.js";
10
10
  const at = 10800 * 1e3;
11
11
  function b(t, s) {
@@ -1,5 +1,5 @@
1
- import { p as $, V as w, r as y } from "./shared-Bh29rPvY.js";
2
- import { l as n, a as f, V as h } from "./services-CLhhJf0J.js";
1
+ import { p as $, V as w, r as y } from "./shared-CCgxBhk_.js";
2
+ import { l as n, a as f, V as h } from "./services-Blgu2q_P.js";
3
3
  function b() {
4
4
  return {
5
5
  resolveVcsContext: y,
@@ -1,7 +1,7 @@
1
1
  import { readdirSync as T, lstatSync as P, existsSync as z, readFileSync as D, statSync as q } from "node:fs";
2
2
  import { resolve as w, join as R, extname as H, basename as N, relative as b, sep as E } from "node:path";
3
- import { l as S, o as G } from "./services-CLhhJf0J.js";
4
- import { d as W } from "./shared-Bh29rPvY.js";
3
+ import { l as S, o as G } from "./services-Blgu2q_P.js";
4
+ import { d as W } from "./shared-CCgxBhk_.js";
5
5
  const U = [".ts", ".tsx"], J = /* @__PURE__ */ new Set([
6
6
  "node_modules",
7
7
  ".git",
@@ -1,5 +1,5 @@
1
- import { s as i } from "./shared-Bh29rPvY.js";
2
- import { b as E, f as B, c as L, l as C, a as _ } from "./classify-mr-stage.logic-DZGjUv_X.js";
1
+ import { s as i } from "./shared-CCgxBhk_.js";
2
+ import { b as E, f as B, c as L, l as C, a as _ } from "./classify-mr-stage.logic-CEWSA1Jl.js";
3
3
  import { existsSync as U, rmSync as k, readFileSync as F, mkdirSync as J, writeFileSync as Q, renameSync as V } from "node:fs";
4
4
  import { dirname as z } from "node:path";
5
5
  import { r as G, f as D, o as T, d as K, w as Y } from "./worktree-ops.logic-BmJ0w0WS.js";
@@ -0,0 +1,209 @@
1
+ import { readdirSync as v, statSync as m, mkdirSync as F, writeFileSync as O, readFileSync as R } from "node:fs";
2
+ import { join as a, sep as P } from "node:path";
3
+ import { fileURLToPath as x } from "node:url";
4
+ import { l as U, n as T } from "./services-Blgu2q_P.js";
5
+ import { n as b, b as A, h as j, S as I, p as z, i as Y } from "./shared-CCgxBhk_.js";
6
+ class B {
7
+ /** @purpose List of all synced file entries. */
8
+ entries;
9
+ /**
10
+ * @purpose Construct a SyncResult from a list of entries.
11
+ * @param entries File entries.
12
+ */
13
+ constructor(e) {
14
+ this.entries = e;
15
+ }
16
+ /** @purpose Files with status "added". | @returns Array of added entries. */
17
+ get added() {
18
+ return this.entries.filter((e) => e.status === "added");
19
+ }
20
+ /** @purpose Files with status "updated". | @returns Array of updated entries. */
21
+ get updated() {
22
+ return this.entries.filter((e) => e.status === "updated");
23
+ }
24
+ /** @purpose Files with status "unchanged". | @returns Array of unchanged entries. */
25
+ get unchanged() {
26
+ return this.entries.filter((e) => e.status === "unchanged");
27
+ }
28
+ /** @purpose Project-owned files kept as-is (not overwritten). | @returns Array of preserved entries. */
29
+ get preserved() {
30
+ return this.entries.filter((e) => e.status === "preserved");
31
+ }
32
+ /** @purpose Human-readable summary of added/updated/unchanged/preserved counts. | @returns Summary string. */
33
+ get summary() {
34
+ const e = this.added.length, s = this.updated.length, c = this.unchanged.length, t = this.preserved.length, r = `Synced: ${e} added, ${s} updated, ${c} skipped (unchanged)`;
35
+ return t > 0 ? `${r}, ${t} preserved (project-owned)` : r;
36
+ }
37
+ /** @purpose Dry-run summary message. | @returns Dry-run message. */
38
+ get dryRunSummary() {
39
+ return "Dry-run: no files written.";
40
+ }
41
+ }
42
+ const w = "ERR_SYNC_SUBDIR_NOT_FOUND", W = "ERR_SYNC_SOURCE_NOT_FOUND", _ = /* @__PURE__ */ new Set([
43
+ "architecture",
44
+ "dbc-audit.directive.xml",
45
+ "dev-review.directive.xml",
46
+ "semantic-change-extractor.directive.xml"
47
+ ]), L = /* @__PURE__ */ new Set(["knowledge.xml"]);
48
+ function J(n, e = "ai/directives") {
49
+ return j(n, e);
50
+ }
51
+ function M(n, e) {
52
+ const s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
53
+ for (const t of n) {
54
+ let r = [];
55
+ try {
56
+ r = v(t).filter((o) => {
57
+ if (_.has(o))
58
+ return !1;
59
+ try {
60
+ return m(a(t, o)).isDirectory();
61
+ } catch {
62
+ return !1;
63
+ }
64
+ });
65
+ } catch {
66
+ continue;
67
+ }
68
+ for (const o of r)
69
+ c.add(o);
70
+ const i = e === void 0 ? void 0 : e.filter((o) => r.includes(o));
71
+ if (!(e !== void 0 && i.length === 0))
72
+ for (const o of H(t, i))
73
+ s.has(o) || s.set(o, a(t, o));
74
+ }
75
+ for (const t of e ?? [])
76
+ if (!c.has(t)) {
77
+ const r = new Error(
78
+ `[scanSourceRoots] ai/directives/${t}/ not found in package.
79
+ Available: ${[...c].sort().join(", ")}`
80
+ );
81
+ throw r.code = w, r;
82
+ }
83
+ return new Map([...s].sort(([t], [r]) => t.localeCompare(r)));
84
+ }
85
+ function H(n, e) {
86
+ if (e && e.length > 0) {
87
+ const c = v(n).filter((r) => {
88
+ if (_.has(r))
89
+ return !1;
90
+ try {
91
+ return m(a(n, r)).isDirectory();
92
+ } catch {
93
+ return !1;
94
+ }
95
+ });
96
+ for (const r of e)
97
+ if (!c.includes(r)) {
98
+ const i = `[scanDirectives] ai/directives/${r}/ not found in package.
99
+ Available: ${c.join(", ")}`, o = new Error(i);
100
+ throw o.code = w, o;
101
+ }
102
+ const t = [];
103
+ for (const r of e)
104
+ D(a(n, r), r, t);
105
+ return t.sort();
106
+ }
107
+ const s = [];
108
+ return D(n, "", s), s.sort();
109
+ }
110
+ function D(n, e, s) {
111
+ let c;
112
+ try {
113
+ c = v(n);
114
+ } catch {
115
+ return;
116
+ }
117
+ for (const t of c) {
118
+ if (t.startsWith(".") || _.has(t)) continue;
119
+ const r = a(n, t), i = e ? a(e, t) : t, o = m(r, { throwIfNoEntry: !1 });
120
+ o && (o.isDirectory() ? D(r, i, s) : o.isFile() && s.push(i.split(P).join("/")));
121
+ }
122
+ }
123
+ function V(n, e) {
124
+ try {
125
+ n.stat(e.sourceDir);
126
+ } catch {
127
+ const t = `[collectAndCompare] Source directory not found: ${e.sourceDir}`, r = new Error(t);
128
+ throw r.code = W, r;
129
+ }
130
+ const s = M([e.sourceDir, ...e.extraSourceDirs ?? []], e.subdirs), c = [];
131
+ for (const [t, r] of s) {
132
+ const i = a(e.targetDir, t), o = n.readFile(r), y = b(o.toString("utf-8"), I), l = Buffer.from(y, "utf-8"), f = l.length;
133
+ let d = null;
134
+ try {
135
+ d = n.readFile(i);
136
+ } catch {
137
+ }
138
+ let u;
139
+ d === null ? u = "added" : A(l, d) ? L.has(t) ? u = "preserved" : u = "updated" : u = "unchanged", c.push({
140
+ relativePath: t,
141
+ status: u,
142
+ sourceSize: f,
143
+ targetSize: d?.length
144
+ }), !e.dryRun && u !== "unchanged" && u !== "preserved" && (n.mkdir(a(e.targetDir, t, ".."), { recursive: !0 }), n.writeFile(i, l));
145
+ }
146
+ return new B(c);
147
+ }
148
+ function X(n) {
149
+ try {
150
+ const e = a(n, "..", ".."), s = R(a(e, "package.json"), "utf-8");
151
+ return JSON.parse(s).version ?? "0.0.0";
152
+ } catch {
153
+ return "0.0.0";
154
+ }
155
+ }
156
+ function q(n, e, s, c, t) {
157
+ s.write(`Sync (v${t})${e ? " (dry-run)" : ""}: ${c}
158
+ `);
159
+ const r = Y(n, { dryRun: e });
160
+ for (const i of r)
161
+ s.write(i + `
162
+ `);
163
+ }
164
+ function E(n, e) {
165
+ const s = R, c = O, t = F, r = m, i = v, o = J, y = process.stdout, l = process.stderr, f = z(n, {
166
+ dryRun: ["dry-run"]
167
+ }), d = f.dryRun === !0 || f.dryRun === "true", u = f._.filter(
168
+ (h) => typeof h == "string" && h !== "sync"
169
+ ), g = process.cwd(), S = o(g, "ai/directives");
170
+ if (!S)
171
+ return l.write(`Error: gennady package not found. Install it locally: npm i -D gennady
172
+ `), 1;
173
+ const N = X(S), k = a(g, "ai", "directives"), C = {
174
+ sourceDir: S,
175
+ extraSourceDirs: T(o(g, "plugins"), "directives"),
176
+ targetDir: k,
177
+ subdirs: u.length > 0 ? u : void 0,
178
+ dryRun: d
179
+ };
180
+ try {
181
+ const p = V({
182
+ readFile: s,
183
+ writeFile: c,
184
+ mkdir: t,
185
+ stat: ($) => r($),
186
+ readdir: i,
187
+ cwd: g
188
+ }, C);
189
+ return q(p.entries, d, y, g, N), 0;
190
+ } catch (h) {
191
+ const p = h;
192
+ if (p.code === w)
193
+ return l.write(`Error: ${p.message}
194
+ `), 1;
195
+ throw p;
196
+ }
197
+ }
198
+ if (process.argv[1]) {
199
+ const n = x(import.meta.url);
200
+ if (n === process.argv[1] || n.endsWith(process.argv[1]))
201
+ try {
202
+ const e = E(process.argv);
203
+ process.exit(e);
204
+ } catch (e) {
205
+ const s = new Error("[syncCmd] Self-execution failed", { cause: e });
206
+ U.error("[syncCmd#run] [self-executing → failed]", { error: s }), process.exit(1);
207
+ }
208
+ }
209
+ process.exit(E(process.argv));
@@ -1,5 +1,5 @@
1
- import { p as y, f as j, V as x, r as C } from "./shared-Bh29rPvY.js";
2
- import { l as i, a as $, V as w } from "./services-CLhhJf0J.js";
1
+ import { p as y, f as j, V as x, r as C } from "./shared-CCgxBhk_.js";
2
+ import { l as i, a as $, V as w } from "./services-Blgu2q_P.js";
3
3
  function M() {
4
4
  return {
5
5
  resolveVcsContext: C,
@@ -1,8 +1,8 @@
1
1
  import { execSync as ue } from "node:child_process";
2
2
  import { existsSync as ee, readFileSync as te, readdirSync as P, statSync as ne, lstatSync as fe } from "node:fs";
3
3
  import { resolve as A, relative as B, extname as G, join as he } from "node:path";
4
- import { l as N, D as de, o as me, q as ge, v as _e } from "./services-CLhhJf0J.js";
5
- import { p as pe } from "./shared-Bh29rPvY.js";
4
+ import { l as N, D as de, o as me, q as ge, v as _e } from "./services-Blgu2q_P.js";
5
+ import { p as pe } from "./shared-CCgxBhk_.js";
6
6
  class F {
7
7
  /** @purpose Collected lint errors — empty array when clean. */
8
8
  errors;
@@ -1,5 +1,5 @@
1
1
  import { parseArgs as c } from "node:util";
2
- import { l as d, r as l, A as p } from "./services-CLhhJf0J.js";
2
+ import { l as d, r as l, A as p } from "./services-Blgu2q_P.js";
3
3
  function f(i) {
4
4
  const { positionals: e, values: n } = c({
5
5
  args: i.slice(3),
@@ -1,5 +1,5 @@
1
- import { p as R, V as _, r as C } from "./shared-Bh29rPvY.js";
2
- import { l as S, a as D, V as U } from "./services-CLhhJf0J.js";
1
+ import { p as R, V as _, r as C } from "./shared-CCgxBhk_.js";
2
+ import { l as S, a as D, V as U } from "./services-Blgu2q_P.js";
3
3
  function q() {
4
4
  return {
5
5
  resolveVcsContext: C,
@@ -1,5 +1,5 @@
1
- import { p as V, V as k, r as y } from "./shared-Bh29rPvY.js";
2
- import { a as p, V as x, l as $ } from "./services-CLhhJf0J.js";
1
+ import { p as V, V as k, r as y } from "./shared-CCgxBhk_.js";
2
+ import { a as p, V as x, l as $ } from "./services-Blgu2q_P.js";
3
3
  import { execFile as A } from "node:child_process";
4
4
  import { promisify as j } from "node:util";
5
5
  const I = j(A);
@@ -1,5 +1,5 @@
1
- import { p as R, a as y, l as _, m as j, o as A, q as x, t as E, s as u } from "./shared-Bh29rPvY.js";
2
- import { V as w } from "./services-CLhhJf0J.js";
1
+ import { p as R, a as y, l as _, m as j, o as A, q as x, t as E, s as u } from "./shared-CCgxBhk_.js";
2
+ import { V as w } from "./services-Blgu2q_P.js";
3
3
  function z(t) {
4
4
  const e = R(t, {
5
5
  branch: ["branch", "b"],
@@ -1,4 +1,4 @@
1
- import { d as vi, e as ke } from "./shared-Bh29rPvY.js";
1
+ import { d as vi, e as ke } from "./shared-CCgxBhk_.js";
2
2
  import N, { readFileSync as Ve, writeFileSync as ps, existsSync as hs, readdirSync as ms, statSync as Ii, mkdtempSync as ki } from "node:fs";
3
3
  import * as st from "node:path";
4
4
  import k, { join as ce } from "node:path";