homegraph 1.5.3 → 1.5.5

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 (151) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/README.md +55 -6
  3. package/dist/addons/dynamic-import.d.ts +18 -0
  4. package/dist/addons/dynamic-import.d.ts.map +1 -0
  5. package/dist/addons/dynamic-import.js +25 -0
  6. package/dist/addons/dynamic-import.js.map +1 -0
  7. package/dist/addons/init-template.d.ts +15 -0
  8. package/dist/addons/init-template.d.ts.map +1 -0
  9. package/dist/addons/init-template.js +290 -0
  10. package/dist/addons/init-template.js.map +1 -0
  11. package/dist/addons/loader.d.ts +18 -0
  12. package/dist/addons/loader.d.ts.map +1 -0
  13. package/dist/addons/loader.js +88 -0
  14. package/dist/addons/loader.js.map +1 -0
  15. package/dist/addons/manager.d.ts +106 -0
  16. package/dist/addons/manager.d.ts.map +1 -0
  17. package/dist/addons/manager.js +437 -0
  18. package/dist/addons/manager.js.map +1 -0
  19. package/dist/addons/paths.d.ts +22 -0
  20. package/dist/addons/paths.d.ts.map +1 -0
  21. package/dist/addons/paths.js +65 -0
  22. package/dist/addons/paths.js.map +1 -0
  23. package/dist/addons/registry.d.ts +38 -0
  24. package/dist/addons/registry.d.ts.map +1 -0
  25. package/dist/addons/registry.js +160 -0
  26. package/dist/addons/registry.js.map +1 -0
  27. package/dist/addons/semver.d.ts +21 -0
  28. package/dist/addons/semver.d.ts.map +1 -0
  29. package/dist/addons/semver.js +79 -0
  30. package/dist/addons/semver.js.map +1 -0
  31. package/dist/addons/types.d.ts +51 -0
  32. package/dist/addons/types.d.ts.map +1 -0
  33. package/dist/addons/types.js +14 -0
  34. package/dist/addons/types.js.map +1 -0
  35. package/dist/addons/validate.d.ts +38 -0
  36. package/dist/addons/validate.d.ts.map +1 -0
  37. package/dist/addons/validate.js +165 -0
  38. package/dist/addons/validate.js.map +1 -0
  39. package/dist/arkui/migrate-semantics.d.ts +8 -0
  40. package/dist/arkui/migrate-semantics.d.ts.map +1 -1
  41. package/dist/arkui/migrate-semantics.js +24 -1
  42. package/dist/arkui/migrate-semantics.js.map +1 -1
  43. package/dist/arkui/migrate-snapshot.d.ts.map +1 -1
  44. package/dist/arkui/migrate-snapshot.js +69 -38
  45. package/dist/arkui/migrate-snapshot.js.map +1 -1
  46. package/dist/bin/addon-commands.d.ts +27 -0
  47. package/dist/bin/addon-commands.d.ts.map +1 -0
  48. package/dist/bin/addon-commands.js +254 -0
  49. package/dist/bin/addon-commands.js.map +1 -0
  50. package/dist/bin/homegraph.js +6 -1
  51. package/dist/bin/homegraph.js.map +1 -1
  52. package/dist/bin/node-version-check.d.ts +1 -1
  53. package/dist/bin/node-version-check.js +1 -1
  54. package/dist/db/sqlite-adapter.d.ts +2 -3
  55. package/dist/db/sqlite-adapter.d.ts.map +1 -1
  56. package/dist/db/sqlite-adapter.js +2 -3
  57. package/dist/db/sqlite-adapter.js.map +1 -1
  58. package/dist/extraction/languages/arkts.d.ts +14 -0
  59. package/dist/extraction/languages/arkts.d.ts.map +1 -1
  60. package/dist/extraction/languages/arkts.js +78 -32
  61. package/dist/extraction/languages/arkts.js.map +1 -1
  62. package/dist/index.d.ts +1 -0
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js.map +1 -1
  65. package/dist/mcp/engine.d.ts.map +1 -1
  66. package/dist/mcp/engine.js +2 -14
  67. package/dist/mcp/engine.js.map +1 -1
  68. package/dist/mcp/explore-repeat-guard.d.ts +123 -0
  69. package/dist/mcp/explore-repeat-guard.d.ts.map +1 -0
  70. package/dist/mcp/explore-repeat-guard.js +540 -0
  71. package/dist/mcp/explore-repeat-guard.js.map +1 -0
  72. package/dist/mcp/explore-session-state.d.ts +20 -0
  73. package/dist/mcp/explore-session-state.d.ts.map +1 -1
  74. package/dist/mcp/explore-session-state.js +31 -0
  75. package/dist/mcp/explore-session-state.js.map +1 -1
  76. package/dist/mcp/memory-budget.d.ts +9 -22
  77. package/dist/mcp/memory-budget.d.ts.map +1 -1
  78. package/dist/mcp/memory-budget.js +9 -59
  79. package/dist/mcp/memory-budget.js.map +1 -1
  80. package/dist/mcp/proxy.d.ts.map +1 -1
  81. package/dist/mcp/proxy.js +15 -4
  82. package/dist/mcp/proxy.js.map +1 -1
  83. package/dist/mcp/query-pool.d.ts.map +1 -1
  84. package/dist/mcp/query-pool.js +10 -13
  85. package/dist/mcp/query-pool.js.map +1 -1
  86. package/dist/mcp/server-instructions.d.ts +5 -7
  87. package/dist/mcp/server-instructions.d.ts.map +1 -1
  88. package/dist/mcp/server-instructions.js +38 -99
  89. package/dist/mcp/server-instructions.js.map +1 -1
  90. package/dist/mcp/tools.d.ts +77 -5
  91. package/dist/mcp/tools.d.ts.map +1 -1
  92. package/dist/mcp/tools.js +2693 -320
  93. package/dist/mcp/tools.js.map +1 -1
  94. package/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  95. package/dist/resolution/callback-synthesizer.js +166 -0
  96. package/dist/resolution/callback-synthesizer.js.map +1 -1
  97. package/dist/search/query-utils.d.ts +57 -7
  98. package/dist/search/query-utils.d.ts.map +1 -1
  99. package/dist/search/query-utils.js +392 -113
  100. package/dist/search/query-utils.js.map +1 -1
  101. package/dist/spec/build/scan.js +1 -1
  102. package/dist/spec/build/scan.js.map +1 -1
  103. package/dist/spec/build/scope-resolver.d.ts +24 -5
  104. package/dist/spec/build/scope-resolver.d.ts.map +1 -1
  105. package/dist/spec/build/scope-resolver.js +76 -10
  106. package/dist/spec/build/scope-resolver.js.map +1 -1
  107. package/dist/spec/config.d.ts +8 -0
  108. package/dist/spec/config.d.ts.map +1 -1
  109. package/dist/spec/config.js +3 -0
  110. package/dist/spec/config.js.map +1 -1
  111. package/dist/spec/evolve/pipeline.d.ts.map +1 -1
  112. package/dist/spec/evolve/pipeline.js +2 -1
  113. package/dist/spec/evolve/pipeline.js.map +1 -1
  114. package/dist/spec/git/commits.d.ts +8 -3
  115. package/dist/spec/git/commits.d.ts.map +1 -1
  116. package/dist/spec/git/commits.js +12 -11
  117. package/dist/spec/git/commits.js.map +1 -1
  118. package/dist/spec/mine/addon/adapter.d.ts +45 -0
  119. package/dist/spec/mine/addon/adapter.d.ts.map +1 -0
  120. package/dist/spec/mine/addon/adapter.js +118 -0
  121. package/dist/spec/mine/addon/adapter.js.map +1 -0
  122. package/dist/spec/mine/addon/render.d.ts +20 -0
  123. package/dist/spec/mine/addon/render.d.ts.map +1 -0
  124. package/dist/spec/mine/addon/render.js +41 -0
  125. package/dist/spec/mine/addon/render.js.map +1 -0
  126. package/dist/spec/mine/addon/types.d.ts +70 -0
  127. package/dist/spec/mine/addon/types.d.ts.map +1 -0
  128. package/dist/spec/mine/addon/types.js +14 -0
  129. package/dist/spec/mine/addon/types.js.map +1 -0
  130. package/dist/spec/mine/generator.d.ts +5 -1
  131. package/dist/spec/mine/generator.d.ts.map +1 -1
  132. package/dist/spec/mine/generator.js +69 -7
  133. package/dist/spec/mine/generator.js.map +1 -1
  134. package/dist/spec/mine/pipeline.d.ts.map +1 -1
  135. package/dist/spec/mine/pipeline.js +5 -1
  136. package/dist/spec/mine/pipeline.js.map +1 -1
  137. package/dist/spec/mine/scanner.d.ts +1 -0
  138. package/dist/spec/mine/scanner.d.ts.map +1 -1
  139. package/dist/spec/mine/scanner.js +1 -1
  140. package/dist/spec/mine/scanner.js.map +1 -1
  141. package/dist/spec/types.d.ts +1 -1
  142. package/dist/spec/types.d.ts.map +1 -1
  143. package/dist/upgrade/index.d.ts +23 -12
  144. package/dist/upgrade/index.d.ts.map +1 -1
  145. package/dist/upgrade/index.js +42 -48
  146. package/dist/upgrade/index.js.map +1 -1
  147. package/dist/upgrade/update-check.d.ts +4 -4
  148. package/dist/upgrade/update-check.d.ts.map +1 -1
  149. package/dist/upgrade/update-check.js +6 -5
  150. package/dist/upgrade/update-check.js.map +1 -1
  151. package/package.json +6 -6
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Path resolution for the repository-level addon store.
3
+ *
4
+ * Layout (next to the spec feature's `commit4spec/` data directory):
5
+ *
6
+ * <repo>/.homegraph/
7
+ * ├── addons.json registry (see ./registry)
8
+ * ├── addons/ npm install --prefix target
9
+ * │ └── node_modules/
10
+ * │ └── @scope/name/ one directory per installed addon
11
+ * └── commit4spec/ spec data (SPEC_DATA_DIR)
12
+ *
13
+ * @module addons/paths
14
+ */
15
+ /** Directory holding all installed addon packages (npm install --prefix target). */
16
+ export declare function addonsRootDir(repoRoot: string): string;
17
+ /**
18
+ * Resolve an installed addon package directory from its registry name.
19
+ * Scoped names (`@scope/name`) nest naturally under `node_modules`.
20
+ */
21
+ export declare function addonPkgDir(repoRoot: string, name: string): string;
22
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/addons/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAElE"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ /**
3
+ * Path resolution for the repository-level addon store.
4
+ *
5
+ * Layout (next to the spec feature's `commit4spec/` data directory):
6
+ *
7
+ * <repo>/.homegraph/
8
+ * ├── addons.json registry (see ./registry)
9
+ * ├── addons/ npm install --prefix target
10
+ * │ └── node_modules/
11
+ * │ └── @scope/name/ one directory per installed addon
12
+ * └── commit4spec/ spec data (SPEC_DATA_DIR)
13
+ *
14
+ * @module addons/paths
15
+ */
16
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ var desc = Object.getOwnPropertyDescriptor(m, k);
19
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20
+ desc = { enumerable: true, get: function() { return m[k]; } };
21
+ }
22
+ Object.defineProperty(o, k2, desc);
23
+ }) : (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ o[k2] = m[k];
26
+ }));
27
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
29
+ }) : function(o, v) {
30
+ o["default"] = v;
31
+ });
32
+ var __importStar = (this && this.__importStar) || (function () {
33
+ var ownKeys = function(o) {
34
+ ownKeys = Object.getOwnPropertyNames || function (o) {
35
+ var ar = [];
36
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
37
+ return ar;
38
+ };
39
+ return ownKeys(o);
40
+ };
41
+ return function (mod) {
42
+ if (mod && mod.__esModule) return mod;
43
+ var result = {};
44
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
45
+ __setModuleDefault(result, mod);
46
+ return result;
47
+ };
48
+ })();
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.addonsRootDir = addonsRootDir;
51
+ exports.addonPkgDir = addonPkgDir;
52
+ const path = __importStar(require("path"));
53
+ const directory_1 = require("../directory");
54
+ /** Directory holding all installed addon packages (npm install --prefix target). */
55
+ function addonsRootDir(repoRoot) {
56
+ return path.join((0, directory_1.getHomeGraphDir)(repoRoot), 'addons');
57
+ }
58
+ /**
59
+ * Resolve an installed addon package directory from its registry name.
60
+ * Scoped names (`@scope/name`) nest naturally under `node_modules`.
61
+ */
62
+ function addonPkgDir(repoRoot, name) {
63
+ return path.join(addonsRootDir(repoRoot), 'node_modules', name);
64
+ }
65
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/addons/paths.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMH,sCAEC;AAMD,kCAEC;AAdD,2CAA6B;AAC7B,4CAA+C;AAE/C,oFAAoF;AACpF,SAAgB,aAAa,CAAC,QAAgB;IAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAA,2BAAe,EAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC;AAED;;;GAGG;AACH,SAAgB,WAAW,CAAC,QAAgB,EAAE,IAAY;IACxD,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Addon registry file I/O — read/write `${getHomeGraphDir(repoRoot)}/addons.json`.
3
+ *
4
+ * The registry is a small standalone file, deliberately separate from the
5
+ * spec feature's `configs.json`, so the top-level `homegraph addon` command
6
+ * never touches spec configuration. Writes are atomic (tmp file + rename).
7
+ *
8
+ * @module addons/registry
9
+ */
10
+ import { AddonRegistry, AddonRegistryEntry } from './types';
11
+ /** Absolute path of the registry file for a repository. */
12
+ export declare function registryFilePath(repoRoot: string): string;
13
+ /**
14
+ * Read the registry. A missing file yields an empty registry (the first
15
+ * `install` may be the very first addon operation); a corrupt file is
16
+ * ignored with a warning and treated as empty.
17
+ */
18
+ export declare function readRegistry(repoRoot: string): AddonRegistry;
19
+ /**
20
+ * Atomically write the registry (tmp file + rename). Creates the HomeGraph
21
+ * data directory if needed.
22
+ */
23
+ export declare function writeRegistry(repoRoot: string, registry: AddonRegistry): void;
24
+ /**
25
+ * Insert or replace an entry by name (re-install updates version/enabled,
26
+ * preserving the position).
27
+ */
28
+ export declare function upsertEntry(repoRoot: string, entry: AddonRegistryEntry): void;
29
+ /**
30
+ * Remove an entry by name. Returns `false` when the name was not registered.
31
+ */
32
+ export declare function removeEntry(repoRoot: string, name: string): boolean;
33
+ /**
34
+ * Toggle the `enabled` flag of an entry. Returns `false` when the name was
35
+ * not registered.
36
+ */
37
+ export declare function setEntryEnabled(repoRoot: string, name: string, enabled: boolean): boolean;
38
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/addons/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAK5D,2DAA2D;AAC3D,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEzD;AAcD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAiC5D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAM7E;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAS7E;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAMnE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GACf,OAAO,CAOT"}
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ /**
3
+ * Addon registry file I/O — read/write `${getHomeGraphDir(repoRoot)}/addons.json`.
4
+ *
5
+ * The registry is a small standalone file, deliberately separate from the
6
+ * spec feature's `configs.json`, so the top-level `homegraph addon` command
7
+ * never touches spec configuration. Writes are atomic (tmp file + rename).
8
+ *
9
+ * @module addons/registry
10
+ */
11
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
+ desc = { enumerable: true, get: function() { return m[k]; } };
16
+ }
17
+ Object.defineProperty(o, k2, desc);
18
+ }) : (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ }));
22
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
24
+ }) : function(o, v) {
25
+ o["default"] = v;
26
+ });
27
+ var __importStar = (this && this.__importStar) || (function () {
28
+ var ownKeys = function(o) {
29
+ ownKeys = Object.getOwnPropertyNames || function (o) {
30
+ var ar = [];
31
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32
+ return ar;
33
+ };
34
+ return ownKeys(o);
35
+ };
36
+ return function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
40
+ __setModuleDefault(result, mod);
41
+ return result;
42
+ };
43
+ })();
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.registryFilePath = registryFilePath;
46
+ exports.readRegistry = readRegistry;
47
+ exports.writeRegistry = writeRegistry;
48
+ exports.upsertEntry = upsertEntry;
49
+ exports.removeEntry = removeEntry;
50
+ exports.setEntryEnabled = setEntryEnabled;
51
+ const fs = __importStar(require("fs"));
52
+ const path = __importStar(require("path"));
53
+ const errors_1 = require("../errors");
54
+ const directory_1 = require("../directory");
55
+ /** Registry file name relative to the HomeGraph data dir. */
56
+ const REGISTRY_FILE = 'addons.json';
57
+ /** Absolute path of the registry file for a repository. */
58
+ function registryFilePath(repoRoot) {
59
+ return path.join((0, directory_1.getHomeGraphDir)(repoRoot), REGISTRY_FILE);
60
+ }
61
+ function isValidEntry(value) {
62
+ if (!value || typeof value !== 'object')
63
+ return false;
64
+ const entry = value;
65
+ return (typeof entry.name === 'string' &&
66
+ entry.name.length > 0 &&
67
+ typeof entry.version === 'string' &&
68
+ typeof entry.enabled === 'boolean' &&
69
+ (entry.source === 'registry' || entry.source === 'local'));
70
+ }
71
+ /**
72
+ * Read the registry. A missing file yields an empty registry (the first
73
+ * `install` may be the very first addon operation); a corrupt file is
74
+ * ignored with a warning and treated as empty.
75
+ */
76
+ function readRegistry(repoRoot) {
77
+ const file = registryFilePath(repoRoot);
78
+ let raw;
79
+ try {
80
+ raw = fs.readFileSync(file, 'utf-8');
81
+ }
82
+ catch {
83
+ return { addons: [] };
84
+ }
85
+ try {
86
+ const parsed = JSON.parse(raw);
87
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
88
+ throw new Error('top-level value must be an object');
89
+ }
90
+ const rawAddons = parsed.addons;
91
+ if (!Array.isArray(rawAddons))
92
+ return { addons: [] };
93
+ const addons = rawAddons.filter(isValidEntry);
94
+ if (addons.length !== rawAddons.length) {
95
+ // Entries from a pre-`source` registry are dropped outright (no
96
+ // compatibility path) — surface it so a vanishing addon is diagnosable.
97
+ (0, errors_1.logWarn)(`Dropped ${rawAddons.length - addons.length} entry(ies) from ${file}: ` +
98
+ 'missing "source" (registry format changed — reinstall them with "homegraph addon install")');
99
+ }
100
+ return { addons };
101
+ }
102
+ catch (err) {
103
+ (0, errors_1.logWarn)(`Ignoring ${file}: not a valid addon registry`, {
104
+ file,
105
+ error: err instanceof Error ? err.message : String(err),
106
+ });
107
+ return { addons: [] };
108
+ }
109
+ }
110
+ /**
111
+ * Atomically write the registry (tmp file + rename). Creates the HomeGraph
112
+ * data directory if needed.
113
+ */
114
+ function writeRegistry(repoRoot, registry) {
115
+ const file = registryFilePath(repoRoot);
116
+ fs.mkdirSync(path.dirname(file), { recursive: true });
117
+ const tmp = `${file}.tmp`;
118
+ fs.writeFileSync(tmp, JSON.stringify(registry, null, 2) + '\n', 'utf-8');
119
+ fs.renameSync(tmp, file);
120
+ }
121
+ /**
122
+ * Insert or replace an entry by name (re-install updates version/enabled,
123
+ * preserving the position).
124
+ */
125
+ function upsertEntry(repoRoot, entry) {
126
+ const registry = readRegistry(repoRoot);
127
+ const index = registry.addons.findIndex((e) => e.name === entry.name);
128
+ if (index >= 0) {
129
+ registry.addons[index] = entry;
130
+ }
131
+ else {
132
+ registry.addons.push(entry);
133
+ }
134
+ writeRegistry(repoRoot, registry);
135
+ }
136
+ /**
137
+ * Remove an entry by name. Returns `false` when the name was not registered.
138
+ */
139
+ function removeEntry(repoRoot, name) {
140
+ const registry = readRegistry(repoRoot);
141
+ const next = registry.addons.filter((e) => e.name !== name);
142
+ if (next.length === registry.addons.length)
143
+ return false;
144
+ writeRegistry(repoRoot, { addons: next });
145
+ return true;
146
+ }
147
+ /**
148
+ * Toggle the `enabled` flag of an entry. Returns `false` when the name was
149
+ * not registered.
150
+ */
151
+ function setEntryEnabled(repoRoot, name, enabled) {
152
+ const registry = readRegistry(repoRoot);
153
+ const entry = registry.addons.find((e) => e.name === name);
154
+ if (!entry)
155
+ return false;
156
+ entry.enabled = enabled;
157
+ writeRegistry(repoRoot, registry);
158
+ return true;
159
+ }
160
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/addons/registry.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYH,4CAEC;AAmBD,oCAiCC;AAMD,sCAMC;AAMD,kCASC;AAKD,kCAMC;AAMD,0CAWC;AAvHD,uCAAyB;AACzB,2CAA6B;AAC7B,sCAAoC;AACpC,4CAA+C;AAG/C,6DAA6D;AAC7D,MAAM,aAAa,GAAG,aAAa,CAAC;AAEpC,2DAA2D;AAC3D,SAAgB,gBAAgB,CAAC,QAAgB;IAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAA,2BAAe,EAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,CA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parison for addon version gating.
3
+ *
4
+ * HomeGraph deliberately does not depend on a semver library: the versions
5
+ * compared here always come from npm (`npm view`) or a package.json that
6
+ * `validateAddonPackage` already accepted, so they are well-formed semver.
7
+ * Only the comparisons needed for the install gate (`<`, `=`, `>`) are
8
+ * implemented — no ranges, no coercion, no build-metadata significance.
9
+ *
10
+ * @module addons/semver
11
+ */
12
+ /**
13
+ * Compare two semver strings: negative when `a < b`, zero when equal,
14
+ * positive when `a > b`. Build metadata (`+...`) is ignored.
15
+ *
16
+ * A version that does not parse as semver compares equal to anything
17
+ * (returns 0) — callers treat an unparseable version conservatively as
18
+ * "not a downgrade" rather than refusing the install.
19
+ */
20
+ export declare function compareSemver(a: string, b: string): number;
21
+ //# sourceMappingURL=semver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semver.d.ts","sourceRoot":"","sources":["../../src/addons/semver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAyCH;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAW1D"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ /**
3
+ * Minimal semver comparison for addon version gating.
4
+ *
5
+ * HomeGraph deliberately does not depend on a semver library: the versions
6
+ * compared here always come from npm (`npm view`) or a package.json that
7
+ * `validateAddonPackage` already accepted, so they are well-formed semver.
8
+ * Only the comparisons needed for the install gate (`<`, `=`, `>`) are
9
+ * implemented — no ranges, no coercion, no build-metadata significance.
10
+ *
11
+ * @module addons/semver
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.compareSemver = compareSemver;
15
+ /** x.y.z with optional prerelease and build metadata (build metadata ignored). */
16
+ const SEMVER_RE = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
17
+ /**
18
+ * Compare prerelease identifiers (semver §11.4).
19
+ *
20
+ * `undefined` (no prerelease) sorts after any prerelease: `1.0.0 > 1.0.0-alpha`.
21
+ * Numeric identifiers compare numerically, alphanumeric compare ASCII, and
22
+ * numeric < alphanumeric. A shorter list sorts first when otherwise equal.
23
+ */
24
+ function comparePrerelease(a, b) {
25
+ if (a === undefined && b === undefined)
26
+ return 0;
27
+ if (a === undefined)
28
+ return 1;
29
+ if (b === undefined)
30
+ return -1;
31
+ const as = a.split('.');
32
+ const bs = b.split('.');
33
+ const len = Math.max(as.length, bs.length);
34
+ for (let i = 0; i < len; i++) {
35
+ const x = as[i];
36
+ const y = bs[i];
37
+ if (x === undefined)
38
+ return -1;
39
+ if (y === undefined)
40
+ return 1;
41
+ const xn = /^\d+$/.test(x);
42
+ const yn = /^\d+$/.test(y);
43
+ if (xn && yn) {
44
+ const nx = parseInt(x, 10);
45
+ const ny = parseInt(y, 10);
46
+ if (nx !== ny)
47
+ return nx < ny ? -1 : 1;
48
+ }
49
+ else {
50
+ if (xn !== yn)
51
+ return xn ? -1 : 1;
52
+ if (x !== y)
53
+ return x < y ? -1 : 1;
54
+ }
55
+ }
56
+ return 0;
57
+ }
58
+ /**
59
+ * Compare two semver strings: negative when `a < b`, zero when equal,
60
+ * positive when `a > b`. Build metadata (`+...`) is ignored.
61
+ *
62
+ * A version that does not parse as semver compares equal to anything
63
+ * (returns 0) — callers treat an unparseable version conservatively as
64
+ * "not a downgrade" rather than refusing the install.
65
+ */
66
+ function compareSemver(a, b) {
67
+ const ma = SEMVER_RE.exec(a.trim());
68
+ const mb = SEMVER_RE.exec(b.trim());
69
+ if (!ma || !mb)
70
+ return 0;
71
+ for (let i = 1; i <= 3; i++) {
72
+ const x = parseInt(ma[i], 10);
73
+ const y = parseInt(mb[i], 10);
74
+ if (x !== y)
75
+ return x < y ? -1 : 1;
76
+ }
77
+ return comparePrerelease(ma[4], mb[4]);
78
+ }
79
+ //# sourceMappingURL=semver.js.map
@@ -0,0 +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,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * HomeGraph addon registry types.
3
+ *
4
+ * The addon registry is repository-level state stored in
5
+ * `${getHomeGraphDir(repoRoot)}/addons.json`. The loader only ever loads
6
+ * addons that are explicitly registered AND enabled — scanning installed
7
+ * packages is deliberately unsupported (an addon is executable code; loading
8
+ * it requires an explicit user action).
9
+ *
10
+ * @module addons/types
11
+ */
12
+ /** A single registered addon entry in `addons.json`. */
13
+ export interface AddonRegistryEntry {
14
+ /**
15
+ * npm package name — the registry primary key
16
+ * (e.g. `"@scope/homegraph-jira"`).
17
+ */
18
+ name: string;
19
+ /**
20
+ * Concrete version resolved at install time — never a range, so the
21
+ * registry stays reproducible and audit-friendly.
22
+ */
23
+ version: string;
24
+ /** Whether the addon is loaded at runtime. */
25
+ enabled: boolean;
26
+ /**
27
+ * Where the package was installed from. Drives the install version gate
28
+ * (a local path is re-pointed by npm, never downgraded by us) and
29
+ * `update --latest` (registry packages only — local paths have no dist-tag).
30
+ */
31
+ source: 'registry' | 'local';
32
+ }
33
+ /** Shape of the repository-level addon registry file. */
34
+ export interface AddonRegistry {
35
+ addons: AddonRegistryEntry[];
36
+ }
37
+ /**
38
+ * An addon that passed validation and was loaded at runtime. Consumers
39
+ * filter by export shape (e.g. spec-mine looks for `enrich`/`buildPrompt`);
40
+ * the generic layer does not know about any specific hook.
41
+ */
42
+ export interface LoadedAddon {
43
+ name: string;
44
+ version: string;
45
+ /**
46
+ * Module namespace. A `default` export is merged into the namespace so
47
+ * both `export default { ... }` and named exports work.
48
+ */
49
+ module: Record<string, unknown>;
50
+ }
51
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/addons/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;CAC9B;AAED,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /**
3
+ * HomeGraph addon registry types.
4
+ *
5
+ * The addon registry is repository-level state stored in
6
+ * `${getHomeGraphDir(repoRoot)}/addons.json`. The loader only ever loads
7
+ * addons that are explicitly registered AND enabled — scanning installed
8
+ * packages is deliberately unsupported (an addon is executable code; loading
9
+ * it requires an explicit user action).
10
+ *
11
+ * @module addons/types
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/addons/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Addon package validation.
3
+ *
4
+ * An addon package must:
5
+ * 1. have a parseable `package.json`,
6
+ * 2. declare `"homegraph": { "addon": true, "api": 1 }` (contract version),
7
+ * 3. resolve to a loadable entry point (exports / main / index.js),
8
+ * 4. export `enrich` or `buildPrompt` (at least one).
9
+ *
10
+ * Used both at install time (fail fast, before registering) and at runtime
11
+ * (skip with a warning, never crash the host flow).
12
+ *
13
+ * @module addons/validate
14
+ */
15
+ /** Result of validating an installed addon package. */
16
+ export interface AddonValidation {
17
+ ok: boolean;
18
+ /** Human-readable reason when `ok` is false. */
19
+ reason?: string;
20
+ /** Package version from package.json (set when `ok`). */
21
+ version?: string;
22
+ /** Resolved entry point relative to the package dir (set when `ok`). */
23
+ entryPoint?: string;
24
+ /** Loaded module namespace (set when `ok`). */
25
+ module?: Record<string, unknown>;
26
+ }
27
+ /**
28
+ * Resolve the addon entry point from package.json:
29
+ * `exports` (string | { "." | "import" | "default" | nested conditions })
30
+ * → `main` → `index.js`.
31
+ */
32
+ export declare function resolveEntryPoint(pkg: unknown): string | null;
33
+ /**
34
+ * Validate an installed addon package directory. Async because validation
35
+ * loads the module (which also double-checks the export shape).
36
+ */
37
+ export declare function validateAddonPackage(pkgDir: string): Promise<AddonValidation>;
38
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/addons/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,uDAAuD;AACvD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAsB7D;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,eAAe,CAAC,CA8E1B"}