@memnexus-ai/mx-agent-cli 0.1.145 → 0.1.146

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.
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Mirror-drift guard for the agent-config → .claude config bundle.
3
+ *
4
+ * The repo keeps two copies of certain hook/skill/agent files:
5
+ * - mx-agent-system/agent-config/* — the source of truth that ships in the
6
+ * CLI's synced bundle (what `mx-agent` writes into new worktrees).
7
+ * - .claude/* — the copy that actually runs in this
8
+ * repo's own worktrees.
9
+ *
10
+ * These were hand-synced three separate times on 2026-07-02 (issue #3728,
11
+ * known-issues v68 / KI-HOOK-MIRROR-DRIFT-CHECK). When they drift, a worktree
12
+ * silently runs stale hook or skill logic. This test asserts byte-identity of
13
+ * the known mirror pairs so drift fails locally before it ships.
14
+ */
15
+ export {};
16
+ //# sourceMappingURL=config-mirror-integrity.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-mirror-integrity.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/config-mirror-integrity.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Mirror-drift guard for the agent-config → .claude config bundle.
3
+ *
4
+ * The repo keeps two copies of certain hook/skill/agent files:
5
+ * - mx-agent-system/agent-config/* — the source of truth that ships in the
6
+ * CLI's synced bundle (what `mx-agent` writes into new worktrees).
7
+ * - .claude/* — the copy that actually runs in this
8
+ * repo's own worktrees.
9
+ *
10
+ * These were hand-synced three separate times on 2026-07-02 (issue #3728,
11
+ * known-issues v68 / KI-HOOK-MIRROR-DRIFT-CHECK). When they drift, a worktree
12
+ * silently runs stale hook or skill logic. This test asserts byte-identity of
13
+ * the known mirror pairs so drift fails locally before it ships.
14
+ */
15
+ import { describe, it, expect } from 'vitest';
16
+ import { readFileSync, existsSync } from 'fs';
17
+ import { dirname, join } from 'path';
18
+ import { fileURLToPath } from 'url';
19
+ const __dirname = dirname(fileURLToPath(import.meta.url));
20
+ /**
21
+ * Ascend from this test file to the repo root — identified by the presence of
22
+ * the mx-agent-system/agent-config tree — instead of hard-coding a fixed number
23
+ * of `..` segments. Keeps the test correct if the file is ever relocated.
24
+ */
25
+ function findRepoRoot(start) {
26
+ let dir = start;
27
+ for (let i = 0; i < 20; i++) {
28
+ if (existsSync(join(dir, 'mx-agent-system', 'agent-config')))
29
+ return dir;
30
+ const parent = dirname(dir);
31
+ if (parent === dir)
32
+ break;
33
+ dir = parent;
34
+ }
35
+ throw new Error(`config-mirror-integrity: could not locate repo root from ${start}`);
36
+ }
37
+ const REPO_ROOT = findRepoRoot(__dirname);
38
+ // [ .claude runtime copy, agent-config source of truth ] — repo-root-relative.
39
+ const MIRROR_PAIRS = [
40
+ [
41
+ '.claude/hooks/deploy-verification-reminder.sh',
42
+ 'mx-agent-system/agent-config/hooks/deploy-verification-reminder.sh',
43
+ ],
44
+ [
45
+ '.claude/hooks/deploy-verification-reminder.test.sh',
46
+ 'mx-agent-system/agent-config/hooks/deploy-verification-reminder.test.sh',
47
+ ],
48
+ [
49
+ '.claude/skills/mx-post-merge-sync/SKILL.md',
50
+ 'mx-agent-system/agent-config/skills/mx-post-merge-sync/SKILL.md',
51
+ ],
52
+ [
53
+ '.claude/agents/git-expert.md',
54
+ 'mx-agent-system/agent-config/agents/git-expert.md',
55
+ ],
56
+ ];
57
+ describe('config mirror integrity', () => {
58
+ for (const [claudeRel, agentConfigRel] of MIRROR_PAIRS) {
59
+ const claudeAbs = join(REPO_ROOT, claudeRel);
60
+ const agentConfigAbs = join(REPO_ROOT, agentConfigRel);
61
+ // The .claude copy is not present in every checkout (e.g. a package-only
62
+ // export of the CLI). Skip rather than fail spuriously when it's absent.
63
+ if (!existsSync(claudeAbs)) {
64
+ it.skip(`${claudeRel} ↔ ${agentConfigRel} (SKIPPED: ${claudeRel} absent in this checkout)`, () => { });
65
+ continue;
66
+ }
67
+ it(`${claudeRel} is byte-identical to ${agentConfigRel}`, () => {
68
+ const claudeBytes = readFileSync(claudeAbs);
69
+ const agentConfigBytes = readFileSync(agentConfigAbs);
70
+ expect(claudeBytes.equals(agentConfigBytes)).toBe(true);
71
+ });
72
+ }
73
+ });
74
+ //# sourceMappingURL=config-mirror-integrity.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-mirror-integrity.test.js","sourceRoot":"","sources":["../../src/__tests__/config-mirror-integrity.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D;;;;GAIG;AACH,SAAS,YAAY,CAAC,KAAa;IACjC,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,EAAE,cAAc,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QACzE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,4DAA4D,KAAK,EAAE,CAAC,CAAC;AACvF,CAAC;AAED,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;AAE1C,+EAA+E;AAC/E,MAAM,YAAY,GAA6C;IAC7D;QACE,+CAA+C;QAC/C,oEAAoE;KACrE;IACD;QACE,oDAAoD;QACpD,yEAAyE;KAC1E;IACD;QACE,4CAA4C;QAC5C,iEAAiE;KAClE;IACD;QACE,8BAA8B;QAC9B,mDAAmD;KACpD;CACF,CAAC;AAEF,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,KAAK,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC,IAAI,YAAY,EAAE,CAAC;QACvD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC7C,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAEvD,yEAAyE;QACzE,yEAAyE;QACzE,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,EAAE,CAAC,IAAI,CAAC,GAAG,SAAS,MAAM,cAAc,cAAc,SAAS,2BAA2B,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YACtG,SAAS;QACX,CAAC;QAED,EAAE,CAAC,GAAG,SAAS,yBAAyB,cAAc,EAAE,EAAE,GAAG,EAAE;YAC7D,MAAM,WAAW,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;YAC5C,MAAM,gBAAgB,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;YACtD,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memnexus-ai/mx-agent-cli",
3
- "version": "0.1.145",
3
+ "version": "0.1.146",
4
4
  "description": "CLI for creating and managing AI agent teams",
5
5
  "type": "module",
6
6
  "bin": {