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.
- package/ai/agents/agent-resolve-conflicts.xml +0 -3
- package/ai/agents/agent-review-verifier.xml +0 -3
- package/ai/directives/coding/uikit-component-storybook.xml +0 -5
- package/ai/directives/coding/uikit-component-svelte.xml +0 -5
- package/ai/directives/coding/uikit-spec-drafting.xml +0 -5
- package/cli/cmd/orient/README.md +2 -1
- package/dist/ai/agents/agent-resolve-conflicts.xml +0 -3
- package/dist/ai/agents/agent-review-verifier.xml +0 -3
- package/dist/ai/directives/coding/uikit-component-storybook.xml +0 -5
- package/dist/ai/directives/coding/uikit-component-svelte.xml +0 -5
- package/dist/ai/directives/coding/uikit-spec-drafting.xml +0 -5
- package/dist/chunks/{help.cmd-BseRtoBF.js → help.cmd-BDO4k0_z.js} +3 -1
- package/dist/chunks/{index-ZM_FonZj.js → index-4fUNp3za.js} +1 -1
- package/dist/chunks/{index-CGsIRefC.js → index-9JlEjsvH.js} +1 -1
- package/dist/chunks/{index-k0nToACp.js → index-9e72uZq7.js} +1 -1
- package/dist/chunks/{index-BghL1-Nk.js → index-B4ODZbtC.js} +2 -2
- package/dist/chunks/{index-CDM74qdR.js → index-BmABG4HA.js} +2 -2
- package/dist/chunks/{index-CHaPz3Ol.js → index-C9UEDrqg.js} +1 -1
- package/dist/chunks/{index-BU1AXJGA.js → index-DICatQqS.js} +1 -1
- package/dist/chunks/{index-CIvkaAQ3.js → index-DQpmjvCj.js} +1 -1
- package/dist/chunks/{index-BlqEQEGy.js → index-DS_1ZX6G.js} +1 -1
- package/dist/chunks/{index-CkczJ__m.js → index-ZpU_VoI0.js} +1 -1
- package/dist/chunks/{index-DEzym4Ae.js → index-jOIhIHdS.js} +1 -1
- package/dist/chunks/{index-OtehG7uM.js → index-mkUNzixA.js} +1 -1
- package/dist/chunks/{run-review-command.logic-BeYQin-I.js → run-review-command.logic-CHVCVJWO.js} +1 -1
- package/dist/chunks/{shared-DL_1LG0K.js → shared-9J_oXE74.js} +260 -250
- package/dist/gennady.js +19 -18
- package/dist/index.js +2 -2
- 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,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>
|
package/cli/cmd/orient/README.md
CHANGED
|
@@ -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,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(
|
|
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-
|
|
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-
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { p as j, s as e, g as x } from "./shared-
|
|
2
|
-
import { p as T, A as E } from "./index-
|
|
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-
|
|
6
|
-
import { g as H, s as t, x as D, p as F } from "./shared-
|
|
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-
|
|
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-
|
|
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-
|
|
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 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-
|
|
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-
|
|
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;
|
package/dist/chunks/{run-review-command.logic-BeYQin-I.js → run-review-command.logic-CHVCVJWO.js}
RENAMED
|
@@ -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-
|
|
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
|
|
2
|
-
import f, { mkdirSync as
|
|
3
|
-
import d, { resolve as p, dirname as
|
|
4
|
-
import { platform as
|
|
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
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
return
|
|
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
|
|
11
|
+
function te(s) {
|
|
12
12
|
try {
|
|
13
|
-
const
|
|
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
|
|
20
|
-
return Date.now() - new Date(
|
|
19
|
+
function ne(s, n) {
|
|
20
|
+
return Date.now() - new Date(s.lastCheck).getTime() < n;
|
|
21
21
|
}
|
|
22
|
-
function D(
|
|
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: ${
|
|
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
|
|
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) ||
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
|
|
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(
|
|
62
|
+
const i = p(X(L(import.meta.url)), Q);
|
|
53
63
|
Y(
|
|
54
64
|
process.execPath,
|
|
55
|
-
[i,
|
|
65
|
+
[i, s.name, s.version, o, String(q)],
|
|
56
66
|
{
|
|
57
67
|
stdio: "ignore"
|
|
58
68
|
}
|
|
59
|
-
).unref(),
|
|
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
|
-
(
|
|
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
|
|
110
|
-
const
|
|
111
|
-
return new Proxy(
|
|
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" :
|
|
124
|
+
return () => y ? "%s" : s.join("") + "%s" + h.reset;
|
|
115
125
|
if (e in h) {
|
|
116
126
|
const o = h[e];
|
|
117
|
-
return
|
|
127
|
+
return M(y ? [] : [...s, o].filter(Boolean));
|
|
118
128
|
}
|
|
119
129
|
},
|
|
120
130
|
apply(r, e, o) {
|
|
121
|
-
const
|
|
122
|
-
return y ?
|
|
131
|
+
const t = o[0] ?? "";
|
|
132
|
+
return y ? t : s.join("") + t + h.reset;
|
|
123
133
|
}
|
|
124
134
|
});
|
|
125
135
|
}
|
|
126
|
-
const
|
|
136
|
+
const Ie = M(), Me = (s, n = {}) => {
|
|
127
137
|
const r = { _: [] };
|
|
128
|
-
return
|
|
138
|
+
return s.slice(2).forEach((o) => {
|
|
129
139
|
if (o.startsWith("-")) {
|
|
130
|
-
const
|
|
131
|
-
for (const [c, l] of Object.entries(
|
|
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
|
-
},
|
|
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
|
-
},
|
|
176
|
+
}, v = (s) => se[s] ?? void 0, Pe = () => {
|
|
167
177
|
try {
|
|
168
|
-
return
|
|
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
|
-
},
|
|
173
|
-
const
|
|
174
|
-
return
|
|
175
|
-
},
|
|
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
|
-
],
|
|
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
|
-
],
|
|
204
|
+
], ae = {
|
|
195
205
|
doc: /\.(md|markdown|txt|rst)$/i,
|
|
196
|
-
cfg: new RegExp(
|
|
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(
|
|
212
|
+
lock: new RegExp(oe.join("|"), "i"),
|
|
203
213
|
json: /\.json$/i
|
|
204
|
-
},
|
|
205
|
-
if (
|
|
206
|
-
for (const e of
|
|
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(
|
|
211
|
-
},
|
|
212
|
-
const
|
|
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 (
|
|
216
|
-
if (
|
|
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 =
|
|
233
|
+
e.ext = l?.[1]?.toLowerCase() ?? "", e.category = R(
|
|
224
234
|
e.filename,
|
|
225
235
|
e.metadata
|
|
226
|
-
), e.programmingLanguage =
|
|
236
|
+
), e.programmingLanguage = v(e.ext), r.push(e);
|
|
227
237
|
}
|
|
228
|
-
const i =
|
|
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 &&
|
|
248
|
-
const i =
|
|
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 &&
|
|
251
|
-
const i =
|
|
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 &&
|
|
254
|
-
const i =
|
|
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 &&
|
|
257
|
-
const i =
|
|
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 &&
|
|
260
|
-
const i =
|
|
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 &&
|
|
263
|
-
const i =
|
|
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 &&
|
|
266
|
-
const i =
|
|
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 &&
|
|
269
|
-
header:
|
|
270
|
-
changes: [
|
|
271
|
-
tokens:
|
|
272
|
-
}, e.diff.hunks.push(o)) : o && (
|
|
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
|
|
275
|
-
|
|
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
|
-
),
|
|
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 = (
|
|
291
|
+
}, g = (s) => {
|
|
282
292
|
try {
|
|
283
|
-
return
|
|
284
|
-
} catch (
|
|
285
|
-
return
|
|
293
|
+
return O(s, { encoding: "utf-8" });
|
|
294
|
+
} catch (n) {
|
|
295
|
+
return w.error("[execSyncSafe] [running → failed] Command failed", { cause: n }), "";
|
|
286
296
|
}
|
|
287
|
-
},
|
|
288
|
-
const
|
|
289
|
-
if (!
|
|
290
|
-
if (/^[a-z]+:\/\//i.test(
|
|
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(
|
|
293
|
-
return !o || !i ? null : { host: o, project: i, scheme:
|
|
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
|
-
|
|
305
|
+
w.debug("[getGitRemote] [parsing → skip] URL parse failed", { cause: e });
|
|
296
306
|
}
|
|
297
|
-
const r =
|
|
307
|
+
const r = n.match(/^[\w.-]+@([^:\/]+)[:\/](.+)$/);
|
|
298
308
|
if (r) {
|
|
299
|
-
const e = (r[1] || "").toLowerCase(), o = (r[2] || "").replace(/^\/+/, "").replace(/\.git$/i, ""),
|
|
300
|
-
return !e || !o ? null : { host: e, project: o, scheme:
|
|
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
|
-
},
|
|
313
|
+
}, le = () => {
|
|
304
314
|
try {
|
|
305
|
-
const
|
|
306
|
-
return parseInt(
|
|
307
|
-
} catch (
|
|
308
|
-
return
|
|
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
|
-
},
|
|
311
|
-
const
|
|
312
|
-
(a) => !a.isDeleted && !a.isRenamed && !
|
|
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" ||
|
|
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),
|
|
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:
|
|
333
|
+
diff: n,
|
|
324
334
|
parsedDiff: r,
|
|
325
335
|
parsedCodeDiff: e,
|
|
326
336
|
parsedCodeTokens: o,
|
|
327
|
-
parsedCodeChunkMaxTokens:
|
|
337
|
+
parsedCodeChunkMaxTokens: t,
|
|
328
338
|
programmingLanguages: i,
|
|
329
|
-
commitCount:
|
|
339
|
+
commitCount: le()
|
|
330
340
|
};
|
|
331
|
-
},
|
|
332
|
-
if (Array.isArray(
|
|
333
|
-
const
|
|
334
|
-
if (
|
|
335
|
-
return
|
|
336
|
-
throw
|
|
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:
|
|
350
|
+
{ cause: s }
|
|
341
351
|
);
|
|
342
|
-
},
|
|
343
|
-
const
|
|
344
|
-
return
|
|
345
|
-
},
|
|
346
|
-
const
|
|
347
|
-
return /^(Хорошо,|Okay,)/.test(
|
|
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() :
|
|
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((
|
|
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(
|
|
380
|
-
this._filename = A(
|
|
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(
|
|
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
|
|
421
|
-
const
|
|
422
|
-
if (!
|
|
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) =>
|
|
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:
|
|
439
|
+
subject: t?.trim() || null,
|
|
430
440
|
description: i?.trim() || null
|
|
431
441
|
};
|
|
432
442
|
}
|
|
433
|
-
function _(
|
|
434
|
-
return
|
|
435
|
-
switch (
|
|
443
|
+
function _(s) {
|
|
444
|
+
return s ? String(s).replace(/[<>&'"]/g, (n) => {
|
|
445
|
+
switch (n) {
|
|
436
446
|
case "<":
|
|
437
447
|
return "<";
|
|
438
448
|
case ">":
|
|
@@ -444,33 +454,33 @@ function _(n) {
|
|
|
444
454
|
case '"':
|
|
445
455
|
return """;
|
|
446
456
|
default:
|
|
447
|
-
return
|
|
457
|
+
return n;
|
|
448
458
|
}
|
|
449
459
|
}) : "";
|
|
450
460
|
}
|
|
451
|
-
function
|
|
452
|
-
const r = " ".repeat(
|
|
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("")),
|
|
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(
|
|
466
|
+
if (Array.isArray(t) && t.length === 0)
|
|
457
467
|
return `${r}<${e}${i} />`;
|
|
458
468
|
let a = "";
|
|
459
|
-
return Array.isArray(
|
|
469
|
+
return Array.isArray(t) ? t.length > 0 && typeof t[0] == "string" ? a = t.map((l) => _(l)).join(`
|
|
460
470
|
`) : a = `
|
|
461
|
-
` +
|
|
471
|
+
` + t.map((l) => $(l, n + 1)).join(`
|
|
462
472
|
`) + `
|
|
463
|
-
` + r : typeof
|
|
464
|
-
` +
|
|
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
|
|
468
|
-
const
|
|
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
|
|
473
|
-
const o = d.join(
|
|
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
|
|
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
|
|
521
|
-
const r = d.join(
|
|
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
|
|
529
|
-
const r =
|
|
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((
|
|
545
|
+
].some((t) => t.test(e));
|
|
536
546
|
}
|
|
537
|
-
function
|
|
538
|
-
const e = Object.entries(
|
|
539
|
-
([o,
|
|
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
|
|
542
|
-
if (e.some(([
|
|
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 (
|
|
555
|
+
if (n.fallbackPatterns.some((t) => t.test(o)))
|
|
546
556
|
return o;
|
|
547
557
|
return null;
|
|
548
558
|
}
|
|
549
|
-
function
|
|
550
|
-
const r = d.join(
|
|
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
|
|
566
|
-
if (!
|
|
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
|
|
570
|
-
const l =
|
|
571
|
-
if (l && (i.push(`npm run ${l}`), a.add(l)), i.length >=
|
|
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,
|
|
584
|
+
return i.length === 0 ? null : i.slice(0, n.maxCommands);
|
|
575
585
|
}
|
|
576
|
-
function
|
|
577
|
-
for (const
|
|
578
|
-
if (
|
|
579
|
-
if (
|
|
580
|
-
return [...
|
|
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 (
|
|
584
|
-
const r =
|
|
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
|
|
592
|
-
return
|
|
601
|
+
function Ee(s) {
|
|
602
|
+
return s.map((n) => `\`${n}\``).join(", ");
|
|
593
603
|
}
|
|
594
|
-
function Ye(
|
|
595
|
-
const
|
|
596
|
-
if (
|
|
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 =
|
|
612
|
+
const r = Ee(n);
|
|
603
613
|
return {
|
|
604
|
-
axiomHint: `\`${
|
|
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
|
|
611
|
-
return f.existsSync(
|
|
620
|
+
function j(s) {
|
|
621
|
+
return f.existsSync(s) ? f.promises.readFile(s, "utf-8") : null;
|
|
612
622
|
}
|
|
613
|
-
function
|
|
614
|
-
let
|
|
623
|
+
function ke(s) {
|
|
624
|
+
let n = s;
|
|
615
625
|
for (; ; ) {
|
|
616
|
-
const r = d.join(
|
|
626
|
+
const r = d.join(n, "package.json");
|
|
617
627
|
if (f.existsSync(r))
|
|
618
|
-
return
|
|
619
|
-
const e = d.dirname(
|
|
620
|
-
if (e ===
|
|
628
|
+
return n;
|
|
629
|
+
const e = d.dirname(n);
|
|
630
|
+
if (e === n)
|
|
621
631
|
return null;
|
|
622
|
-
|
|
632
|
+
n = e;
|
|
623
633
|
}
|
|
624
634
|
}
|
|
625
|
-
async function
|
|
626
|
-
const
|
|
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 =
|
|
630
|
-
o ? (
|
|
631
|
-
d.join(
|
|
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
|
|
634
|
-
const a =
|
|
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(`Не найден файл шаблона ${
|
|
648
|
+
throw new Error(`Не найден файл шаблона ${s}.`, {
|
|
639
649
|
cause: {
|
|
640
650
|
projectOverridePath: r,
|
|
641
|
-
packageCandidates:
|
|
651
|
+
packageCandidates: t
|
|
642
652
|
}
|
|
643
653
|
});
|
|
644
654
|
}
|
|
645
|
-
function
|
|
655
|
+
function Xe(s, n) {
|
|
646
656
|
try {
|
|
647
|
-
const r = A(
|
|
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[/\\].*$/, ""),
|
|
653
|
-
if (x(
|
|
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
|
|
659
|
-
return !Buffer.isBuffer(
|
|
668
|
+
function ze(s, n) {
|
|
669
|
+
return !Buffer.isBuffer(s) || !Buffer.isBuffer(n) ? !0 : Buffer.compare(s, n) !== 0;
|
|
660
670
|
}
|
|
661
|
-
function
|
|
662
|
-
let r =
|
|
663
|
-
for (const e of
|
|
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
|
-
},
|
|
680
|
+
}, U = {
|
|
671
681
|
from: /npx tsx ~\/Developer\/gennady\/cli[ \t]+/g,
|
|
672
682
|
to: "npx gennady "
|
|
673
|
-
},
|
|
683
|
+
}, F = {
|
|
674
684
|
from: /~\/Developer\/gennady\/cli\/gennady\.ts/g,
|
|
675
685
|
to: "npx gennady"
|
|
676
|
-
},
|
|
686
|
+
}, _e = {
|
|
677
687
|
from: /~\/Developer\/gennady\/ai\/skills\//g,
|
|
678
688
|
to: ".claude/skills/"
|
|
679
|
-
},
|
|
689
|
+
}, G = {
|
|
680
690
|
from: /~\/Developer\/gennady\/ai\/directives\//g,
|
|
681
691
|
to: "ai/directives/"
|
|
682
|
-
},
|
|
692
|
+
}, W = {
|
|
683
693
|
from: /\/Users\/k\.lebedev\/Developer\/gennady\/ai\//g,
|
|
684
694
|
to: "ai/"
|
|
685
|
-
},
|
|
695
|
+
}, H = {
|
|
686
696
|
from: /\/Users\/k\.lebedev\/Developer\/gennady\/cli\/gennady\.ts/g,
|
|
687
697
|
to: "npx gennady"
|
|
688
|
-
},
|
|
698
|
+
}, K = {
|
|
689
699
|
from: /\$HOME\/Developer\/gennady\/cli\/gennady\.ts\b/g,
|
|
690
700
|
to: "~/Developer/gennady/cli/gennady.ts"
|
|
691
|
-
},
|
|
701
|
+
}, Qe = [
|
|
692
702
|
P,
|
|
693
|
-
M,
|
|
694
703
|
U,
|
|
695
704
|
F,
|
|
696
705
|
G,
|
|
697
706
|
W,
|
|
698
|
-
H
|
|
699
|
-
|
|
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
|
-
|
|
709
|
-
|
|
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
|
|
721
|
+
for (const a of s) {
|
|
712
722
|
const { relativePath: c, status: l } = a;
|
|
713
723
|
let u, m;
|
|
714
|
-
l === "added" ? (u =
|
|
715
|
-
const
|
|
716
|
-
m ? r.push(` ${u} ${
|
|
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 =
|
|
719
|
-
if (
|
|
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, ${
|
|
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
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
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
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
745
|
+
et as f,
|
|
746
|
+
Ge as g,
|
|
747
|
+
Ue as h,
|
|
748
|
+
$ as i,
|
|
739
749
|
Ye as j,
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
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
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
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
|
|
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
|
|
7
|
-
|
|
8
|
-
i(
|
|
9
|
-
|
|
10
|
-
|
|
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-
|
|
58
|
+
await import("./chunks/index-DICatQqS.js");
|
|
58
59
|
break;
|
|
59
60
|
case "review":
|
|
60
|
-
await import("./chunks/index-
|
|
61
|
+
await import("./chunks/index-B4ODZbtC.js");
|
|
61
62
|
break;
|
|
62
63
|
case "vcs-reply":
|
|
63
|
-
await import("./chunks/index-
|
|
64
|
+
await import("./chunks/index-9e72uZq7.js");
|
|
64
65
|
break;
|
|
65
66
|
case "review-verify":
|
|
66
|
-
await import("./chunks/index-
|
|
67
|
+
await import("./chunks/index-mkUNzixA.js");
|
|
67
68
|
break;
|
|
68
69
|
case "review-issues":
|
|
69
|
-
await import("./chunks/index-
|
|
70
|
+
await import("./chunks/index-DS_1ZX6G.js");
|
|
70
71
|
break;
|
|
71
72
|
case "resolve-conflicts":
|
|
72
|
-
await import("./chunks/index-
|
|
73
|
+
await import("./chunks/index-ZpU_VoI0.js");
|
|
73
74
|
break;
|
|
74
75
|
case "commit":
|
|
75
|
-
await import("./chunks/index-
|
|
76
|
+
await import("./chunks/index-BmABG4HA.js");
|
|
76
77
|
break;
|
|
77
78
|
case "remote-console":
|
|
78
|
-
await import("./chunks/index-
|
|
79
|
+
await import("./chunks/index-9JlEjsvH.js");
|
|
79
80
|
break;
|
|
80
81
|
case "lint":
|
|
81
|
-
await import("./chunks/index-
|
|
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-
|
|
91
|
+
await import("./chunks/index-4fUNp3za.js");
|
|
91
92
|
break;
|
|
92
93
|
case "sync-skills":
|
|
93
|
-
await import("./chunks/index-
|
|
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-
|
|
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-
|
|
2
|
-
import { G as y, o as d, q as A, t as f, v as R } from "./chunks/shared-
|
|
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
|
/**
|