aspectcode 0.4.1 → 1.0.1

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 (248) hide show
  1. package/README.md +2 -2
  2. package/dist/agentsMdRenderer.d.ts +16 -0
  3. package/dist/agentsMdRenderer.d.ts.map +1 -0
  4. package/dist/agentsMdRenderer.js +137 -0
  5. package/dist/agentsMdRenderer.js.map +1 -0
  6. package/dist/auth.d.ts +31 -0
  7. package/dist/auth.d.ts.map +1 -0
  8. package/dist/auth.js +386 -0
  9. package/dist/auth.js.map +1 -0
  10. package/dist/autoResolve.d.ts +41 -0
  11. package/dist/autoResolve.d.ts.map +1 -0
  12. package/dist/autoResolve.js +196 -0
  13. package/dist/autoResolve.js.map +1 -0
  14. package/dist/changeEvaluator.d.ts +56 -0
  15. package/dist/changeEvaluator.d.ts.map +1 -0
  16. package/dist/changeEvaluator.js +674 -0
  17. package/dist/changeEvaluator.js.map +1 -0
  18. package/dist/cli.d.ts +3 -1
  19. package/dist/cli.d.ts.map +1 -1
  20. package/dist/cli.js +1 -1
  21. package/dist/cli.js.map +1 -1
  22. package/dist/config.d.ts +37 -17
  23. package/dist/config.d.ts.map +1 -1
  24. package/dist/config.js +50 -2
  25. package/dist/config.js.map +1 -1
  26. package/dist/dreamCycle.d.ts +57 -0
  27. package/dist/dreamCycle.d.ts.map +1 -0
  28. package/dist/dreamCycle.js +334 -0
  29. package/dist/dreamCycle.js.map +1 -0
  30. package/dist/kbBuilder.d.ts +1 -2
  31. package/dist/kbBuilder.d.ts.map +1 -1
  32. package/dist/kbBuilder.js +1 -2
  33. package/dist/kbBuilder.js.map +1 -1
  34. package/dist/main.d.ts +2 -1
  35. package/dist/main.d.ts.map +1 -1
  36. package/dist/main.js +148 -7
  37. package/dist/main.js.map +1 -1
  38. package/dist/optimize.d.ts +13 -6
  39. package/dist/optimize.d.ts.map +1 -1
  40. package/dist/optimize.js +433 -142
  41. package/dist/optimize.js.map +1 -1
  42. package/dist/pipeline.d.ts +19 -21
  43. package/dist/pipeline.d.ts.map +1 -1
  44. package/dist/pipeline.js +1093 -160
  45. package/dist/pipeline.js.map +1 -1
  46. package/dist/preferences.d.ts +80 -0
  47. package/dist/preferences.d.ts.map +1 -0
  48. package/dist/preferences.js +238 -0
  49. package/dist/preferences.js.map +1 -0
  50. package/dist/runtimeState.d.ts +30 -0
  51. package/dist/runtimeState.d.ts.map +1 -0
  52. package/dist/runtimeState.js +39 -0
  53. package/dist/runtimeState.js.map +1 -0
  54. package/dist/scopedRules.d.ts +84 -0
  55. package/dist/scopedRules.d.ts.map +1 -0
  56. package/dist/scopedRules.js +449 -0
  57. package/dist/scopedRules.js.map +1 -0
  58. package/dist/ui/Dashboard.d.ts +4 -16
  59. package/dist/ui/Dashboard.d.ts.map +1 -1
  60. package/dist/ui/Dashboard.js +339 -140
  61. package/dist/ui/Dashboard.js.map +1 -1
  62. package/dist/ui/MemoryMap.d.ts +16 -0
  63. package/dist/ui/MemoryMap.d.ts.map +1 -0
  64. package/dist/ui/MemoryMap.js +266 -0
  65. package/dist/ui/MemoryMap.js.map +1 -0
  66. package/dist/ui/SettingsPanel.d.ts +18 -0
  67. package/dist/ui/SettingsPanel.d.ts.map +1 -0
  68. package/dist/ui/SettingsPanel.js +241 -0
  69. package/dist/ui/SettingsPanel.js.map +1 -0
  70. package/dist/ui/prompts.d.ts +7 -0
  71. package/dist/ui/prompts.d.ts.map +1 -1
  72. package/dist/ui/prompts.js +63 -0
  73. package/dist/ui/prompts.js.map +1 -1
  74. package/dist/ui/store.d.ts +154 -18
  75. package/dist/ui/store.d.ts.map +1 -1
  76. package/dist/ui/store.js +154 -24
  77. package/dist/ui/store.js.map +1 -1
  78. package/dist/ui/theme.d.ts +1 -8
  79. package/dist/ui/theme.d.ts.map +1 -1
  80. package/dist/ui/theme.js +2 -21
  81. package/dist/ui/theme.js.map +1 -1
  82. package/dist/updateChecker.d.ts +13 -0
  83. package/dist/updateChecker.d.ts.map +1 -0
  84. package/dist/updateChecker.js +66 -0
  85. package/dist/updateChecker.js.map +1 -0
  86. package/dist/usageTracker.d.ts +12 -0
  87. package/dist/usageTracker.d.ts.map +1 -0
  88. package/dist/usageTracker.js +89 -0
  89. package/dist/usageTracker.js.map +1 -0
  90. package/dist/writer.d.ts +1 -7
  91. package/dist/writer.d.ts.map +1 -1
  92. package/dist/writer.js +1 -11
  93. package/dist/writer.js.map +1 -1
  94. package/node_modules/@aspectcode/core/dist/analysis/repo.d.ts.map +1 -1
  95. package/node_modules/@aspectcode/core/dist/analysis/repo.js +13 -2
  96. package/node_modules/@aspectcode/core/dist/analysis/repo.js.map +1 -1
  97. package/node_modules/@aspectcode/core/dist/index.d.ts +1 -3
  98. package/node_modules/@aspectcode/core/dist/index.d.ts.map +1 -1
  99. package/node_modules/@aspectcode/core/dist/index.js +1 -3
  100. package/node_modules/@aspectcode/core/dist/index.js.map +1 -1
  101. package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.d.ts +14 -0
  102. package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.d.ts.map +1 -0
  103. package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.js +191 -0
  104. package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.js.map +1 -0
  105. package/node_modules/@aspectcode/core/dist/parsers/index.d.ts +1 -0
  106. package/node_modules/@aspectcode/core/dist/parsers/index.d.ts.map +1 -1
  107. package/node_modules/@aspectcode/core/dist/parsers/index.js +6 -1
  108. package/node_modules/@aspectcode/core/dist/parsers/index.js.map +1 -1
  109. package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts +20 -0
  110. package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts.map +1 -1
  111. package/node_modules/@aspectcode/core/dist/parsers/languages.js +25 -0
  112. package/node_modules/@aspectcode/core/dist/parsers/languages.js.map +1 -1
  113. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.d.ts.map +1 -1
  114. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js +4 -1
  115. package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js.map +1 -1
  116. package/node_modules/@aspectcode/core/package.json +2 -2
  117. package/node_modules/@aspectcode/core/parsers/cpp.wasm +0 -0
  118. package/node_modules/@aspectcode/core/parsers/go.wasm +0 -0
  119. package/node_modules/@aspectcode/core/parsers/php.wasm +0 -0
  120. package/node_modules/@aspectcode/core/parsers/ruby.wasm +0 -0
  121. package/node_modules/@aspectcode/core/parsers/rust.wasm +0 -0
  122. package/node_modules/@aspectcode/emitters/dist/index.d.ts +1 -17
  123. package/node_modules/@aspectcode/emitters/dist/index.d.ts.map +1 -1
  124. package/node_modules/@aspectcode/emitters/dist/index.js +2 -90
  125. package/node_modules/@aspectcode/emitters/dist/index.js.map +1 -1
  126. package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts +0 -2
  127. package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts.map +1 -1
  128. package/node_modules/@aspectcode/emitters/dist/instructions/index.js +1 -7
  129. package/node_modules/@aspectcode/emitters/dist/instructions/index.js.map +1 -1
  130. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts +0 -18
  131. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts.map +1 -1
  132. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js +0 -57
  133. package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js.map +1 -1
  134. package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts +0 -18
  135. package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts.map +1 -1
  136. package/node_modules/@aspectcode/emitters/dist/kb/conventions.js +0 -130
  137. package/node_modules/@aspectcode/emitters/dist/kb/conventions.js.map +1 -1
  138. package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts +2 -4
  139. package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts.map +1 -1
  140. package/node_modules/@aspectcode/emitters/dist/kb/index.js +1 -11
  141. package/node_modules/@aspectcode/emitters/dist/kb/index.js.map +1 -1
  142. package/node_modules/@aspectcode/emitters/package.json +3 -3
  143. package/node_modules/@aspectcode/evaluator/dist/apply.d.ts +55 -0
  144. package/node_modules/@aspectcode/evaluator/dist/apply.d.ts.map +1 -0
  145. package/node_modules/@aspectcode/evaluator/dist/apply.js +368 -0
  146. package/node_modules/@aspectcode/evaluator/dist/apply.js.map +1 -0
  147. package/node_modules/@aspectcode/evaluator/dist/diagnosis.d.ts +16 -25
  148. package/node_modules/@aspectcode/evaluator/dist/diagnosis.d.ts.map +1 -1
  149. package/node_modules/@aspectcode/evaluator/dist/diagnosis.js +115 -138
  150. package/node_modules/@aspectcode/evaluator/dist/diagnosis.js.map +1 -1
  151. package/node_modules/@aspectcode/evaluator/dist/index.d.ts +8 -43
  152. package/node_modules/@aspectcode/evaluator/dist/index.d.ts.map +1 -1
  153. package/node_modules/@aspectcode/evaluator/dist/index.js +15 -61
  154. package/node_modules/@aspectcode/evaluator/dist/index.js.map +1 -1
  155. package/node_modules/@aspectcode/evaluator/dist/judge.d.ts +32 -0
  156. package/node_modules/@aspectcode/evaluator/dist/judge.d.ts.map +1 -0
  157. package/node_modules/@aspectcode/evaluator/dist/judge.js +165 -0
  158. package/node_modules/@aspectcode/evaluator/dist/judge.js.map +1 -0
  159. package/node_modules/@aspectcode/evaluator/dist/llmUtil.d.ts +15 -0
  160. package/node_modules/@aspectcode/evaluator/dist/llmUtil.d.ts.map +1 -0
  161. package/node_modules/@aspectcode/evaluator/dist/llmUtil.js +41 -0
  162. package/node_modules/@aspectcode/evaluator/dist/llmUtil.js.map +1 -0
  163. package/node_modules/@aspectcode/evaluator/dist/probes.d.ts +20 -47
  164. package/node_modules/@aspectcode/evaluator/dist/probes.d.ts.map +1 -1
  165. package/node_modules/@aspectcode/evaluator/dist/probes.js +188 -278
  166. package/node_modules/@aspectcode/evaluator/dist/probes.js.map +1 -1
  167. package/node_modules/@aspectcode/evaluator/dist/runner.d.ts +7 -32
  168. package/node_modules/@aspectcode/evaluator/dist/runner.d.ts.map +1 -1
  169. package/node_modules/@aspectcode/evaluator/dist/runner.js +21 -146
  170. package/node_modules/@aspectcode/evaluator/dist/runner.js.map +1 -1
  171. package/node_modules/@aspectcode/evaluator/dist/types.d.ts +141 -99
  172. package/node_modules/@aspectcode/evaluator/dist/types.d.ts.map +1 -1
  173. package/node_modules/@aspectcode/evaluator/dist/types.js +10 -2
  174. package/node_modules/@aspectcode/evaluator/dist/types.js.map +1 -1
  175. package/node_modules/@aspectcode/evaluator/package.json +4 -4
  176. package/node_modules/@aspectcode/optimizer/dist/index.d.ts +3 -10
  177. package/node_modules/@aspectcode/optimizer/dist/index.d.ts.map +1 -1
  178. package/node_modules/@aspectcode/optimizer/dist/index.js +1 -19
  179. package/node_modules/@aspectcode/optimizer/dist/index.js.map +1 -1
  180. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.d.ts.map +1 -1
  181. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js +40 -0
  182. package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js.map +1 -1
  183. package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.d.ts +9 -0
  184. package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.d.ts.map +1 -0
  185. package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.js +83 -0
  186. package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.js.map +1 -0
  187. package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts +4 -3
  188. package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts.map +1 -1
  189. package/node_modules/@aspectcode/optimizer/dist/providers/index.js +24 -10
  190. package/node_modules/@aspectcode/optimizer/dist/providers/index.js.map +1 -1
  191. package/node_modules/@aspectcode/optimizer/dist/providers/openai.d.ts.map +1 -1
  192. package/node_modules/@aspectcode/optimizer/dist/providers/openai.js +22 -0
  193. package/node_modules/@aspectcode/optimizer/dist/providers/openai.js.map +1 -1
  194. package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts +14 -0
  195. package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts.map +1 -1
  196. package/node_modules/@aspectcode/optimizer/dist/providers/retry.js +1 -0
  197. package/node_modules/@aspectcode/optimizer/dist/providers/retry.js.map +1 -1
  198. package/node_modules/@aspectcode/optimizer/dist/types.d.ts +14 -0
  199. package/node_modules/@aspectcode/optimizer/dist/types.d.ts.map +1 -1
  200. package/node_modules/@aspectcode/optimizer/dist/types.js.map +1 -1
  201. package/node_modules/@aspectcode/optimizer/package.json +2 -2
  202. package/node_modules/web-tree-sitter/LICENSE +21 -0
  203. package/node_modules/web-tree-sitter/README.md +198 -0
  204. package/node_modules/web-tree-sitter/package.json +36 -0
  205. package/node_modules/web-tree-sitter/tree-sitter-web.d.ts +204 -0
  206. package/node_modules/web-tree-sitter/tree-sitter.js +1 -0
  207. package/node_modules/web-tree-sitter/tree-sitter.wasm +0 -0
  208. package/package.json +8 -8
  209. package/dist/complaintProcessor.d.ts +0 -16
  210. package/dist/complaintProcessor.d.ts.map +0 -1
  211. package/dist/complaintProcessor.js +0 -134
  212. package/dist/complaintProcessor.js.map +0 -1
  213. package/node_modules/@aspectcode/emitters/dist/emitter.d.ts +0 -72
  214. package/node_modules/@aspectcode/emitters/dist/emitter.d.ts.map +0 -1
  215. package/node_modules/@aspectcode/emitters/dist/emitter.js +0 -10
  216. package/node_modules/@aspectcode/emitters/dist/emitter.js.map +0 -1
  217. package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts +0 -26
  218. package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts.map +0 -1
  219. package/node_modules/@aspectcode/emitters/dist/instructions/content.js +0 -501
  220. package/node_modules/@aspectcode/emitters/dist/instructions/content.js.map +0 -1
  221. package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts +0 -13
  222. package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts.map +0 -1
  223. package/node_modules/@aspectcode/emitters/dist/instructions/detection.js +0 -55
  224. package/node_modules/@aspectcode/emitters/dist/instructions/detection.js.map +0 -1
  225. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts +0 -9
  226. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts.map +0 -1
  227. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js +0 -30
  228. package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js.map +0 -1
  229. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts +0 -21
  230. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts.map +0 -1
  231. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js +0 -125
  232. package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js.map +0 -1
  233. package/node_modules/@aspectcode/emitters/dist/manifest.d.ts +0 -37
  234. package/node_modules/@aspectcode/emitters/dist/manifest.d.ts.map +0 -1
  235. package/node_modules/@aspectcode/emitters/dist/manifest.js +0 -50
  236. package/node_modules/@aspectcode/emitters/dist/manifest.js.map +0 -1
  237. package/node_modules/@aspectcode/emitters/dist/report.d.ts +0 -22
  238. package/node_modules/@aspectcode/emitters/dist/report.d.ts.map +0 -1
  239. package/node_modules/@aspectcode/emitters/dist/report.js +0 -3
  240. package/node_modules/@aspectcode/emitters/dist/report.js.map +0 -1
  241. package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts +0 -14
  242. package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts.map +0 -1
  243. package/node_modules/@aspectcode/emitters/dist/stableJson.js +0 -40
  244. package/node_modules/@aspectcode/emitters/dist/stableJson.js.map +0 -1
  245. package/node_modules/@aspectcode/emitters/dist/transaction.d.ts +0 -29
  246. package/node_modules/@aspectcode/emitters/dist/transaction.d.ts.map +0 -1
  247. package/node_modules/@aspectcode/emitters/dist/transaction.js +0 -104
  248. package/node_modules/@aspectcode/emitters/dist/transaction.js.map +0 -1
@@ -1,501 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateCanonicalContentForMode = generateCanonicalContentForMode;
4
- exports.generateKbCustomContent = generateKbCustomContent;
5
- exports.generateCanonicalContentSafe = generateCanonicalContentSafe;
6
- exports.generateCanonicalContentPermissive = generateCanonicalContentPermissive;
7
- exports.generateCanonicalContentSafeKB = generateCanonicalContentSafeKB;
8
- exports.generateCanonicalContentPermissiveKB = generateCanonicalContentPermissiveKB;
9
- // ─────────────────────────────────────────────────────────────────────────────
10
- // Canonical instruction content - all exports derive from this
11
- //
12
- // Three tiers:
13
- // 1. Rules-only (no KB references) — default when kb.md is not generated
14
- // 2. KB-aware (references kb.md) — used when generateKb is enabled
15
- // 3. KB-custom (embeds KB facts) — used when KB exists but no LLM available
16
- // ─────────────────────────────────────────────────────────────────────────────
17
- /**
18
- * Generates the canonical instruction content.
19
- *
20
- * When `kbAvailable` is true, the content references the `kb.md` knowledge
21
- * base file. When false, it provides standalone rules and guidelines only.
22
- *
23
- * All assistant-specific exports are derived from this single source.
24
- */
25
- function generateCanonicalContentForMode(mode, kbAvailable = false) {
26
- if (mode === 'permissive') {
27
- return kbAvailable
28
- ? generateCanonicalContentPermissiveKB()
29
- : generateCanonicalContentPermissive();
30
- }
31
- return kbAvailable ? generateCanonicalContentSafeKB() : generateCanonicalContentSafe();
32
- }
33
- // ─────────────────────────────────────────────────────────────────────────────
34
- // KB-custom content — embeds extracted KB facts directly into instructions
35
- // ─────────────────────────────────────────────────────────────────────────────
36
- /**
37
- * Generate a project-customized AGENTS.md using actual KB content.
38
- *
39
- * Extracts key architectural facts (hubs, entry points, conventions, etc.)
40
- * from the KB string and embeds them directly into the instructions file.
41
- * This produces a useful, project-specific result even without an LLM.
42
- *
43
- * Falls back to the generic KB-aware template if no meaningful sections
44
- * can be extracted.
45
- */
46
- function generateKbCustomContent(kbContent, mode = 'safe') {
47
- const hubs = extractKbSection(kbContent, 'High-Risk Architectural Hubs');
48
- const entryPoints = extractKbSection(kbContent, 'Entry Points');
49
- const layout = extractKbSection(kbContent, 'Directory Layout');
50
- const conventions = extractKbSection(kbContent, 'Conventions');
51
- const integrations = extractKbSection(kbContent, 'External Integrations');
52
- const circularDeps = extractKbSection(kbContent, 'Circular Dependencies');
53
- const hasContent = hubs || entryPoints || layout || conventions || integrations;
54
- if (!hasContent) {
55
- return generateCanonicalContentForMode(mode, true);
56
- }
57
- if (mode === 'permissive') {
58
- return buildPermissiveKbCustom({ hubs, entryPoints, layout, conventions, integrations, circularDeps });
59
- }
60
- return buildSafeKbCustom({ hubs, entryPoints, layout, conventions, integrations, circularDeps });
61
- }
62
- /**
63
- * Extract a `## Heading` section from KB content.
64
- * Handles optional emoji prefixes (e.g. `## ⚠️ High-Risk Architectural Hubs`).
65
- * Returns the section body (without the heading or italic description line), or undefined.
66
- */
67
- function extractKbSection(kb, heading) {
68
- // Match "## " + optional non-word characters (emoji) + heading text
69
- const escaped = heading.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
70
- const pattern = new RegExp(`^##\\s+(?:[^\\w\\s]+\\s+)?${escaped}\\s*$`, 'mi');
71
- const match = pattern.exec(kb);
72
- if (!match)
73
- return undefined;
74
- const start = match.index + match[0].length;
75
- const rest = kb.slice(start);
76
- // Stop at next ## heading, --- separator, or # top-level heading
77
- const endMatch = /^(?:#{1,2}\s|---\s*$)/m.exec(rest);
78
- const section = endMatch ? rest.slice(0, endMatch.index) : rest;
79
- // Remove leading italic description lines (e.g. _Files with many dependents..._)
80
- const cleaned = section
81
- .replace(/^\s*_[^_]+_\s*\n?/gm, '')
82
- .trim();
83
- return cleaned || undefined;
84
- }
85
- function buildSafeKbCustom(s) {
86
- const parts = [];
87
- parts.push(`## Aspect Code — Project-Specific Guidelines
88
-
89
- **Aspect Code** analyzed your codebase and generated the project-specific guidelines below.
90
- The full Knowledge Base is in \`kb.md\` at the workspace root for detailed reference.`);
91
- // ── Project Architecture ────────────────────────────────
92
- const archParts = [];
93
- if (s.hubs) {
94
- archParts.push(`### High-Risk Hubs
95
-
96
- These files have many dependents — changes here ripple widely. Edit with care.
97
-
98
- ${s.hubs}`);
99
- }
100
- if (s.entryPoints) {
101
- archParts.push(`### Entry Points
102
-
103
- ${s.entryPoints}`);
104
- }
105
- if (s.layout) {
106
- archParts.push(`### Directory Layout
107
-
108
- ${s.layout}`);
109
- }
110
- if (s.circularDeps) {
111
- archParts.push(`### Circular Dependencies
112
-
113
- ${s.circularDeps}`);
114
- }
115
- if (archParts.length > 0) {
116
- parts.push(`## Project Architecture\n\n${archParts.join('\n\n')}`);
117
- }
118
- // ── Conventions & Integrations ─────────────────────────
119
- if (s.conventions) {
120
- parts.push(`## Coding Conventions
121
-
122
- ${s.conventions}`);
123
- }
124
- if (s.integrations) {
125
- parts.push(`## External Integrations
126
-
127
- ${s.integrations}`);
128
- }
129
- // ── Golden Rules ────────────────────────────────────────
130
- parts.push(`## Golden Rules
131
-
132
- 1. **Read before you write.** Open and read the relevant files before multi-file edits.
133
- 2. **Check high-risk hubs first.** Review the hubs listed above before editing widely-imported files.
134
- 3. **Think step-by-step.** Break complex tasks into smaller steps; reason through each before coding.
135
- 4. **Prefer minimal, local changes.** Small patches are safer than large refactors, especially in hub files.
136
- 5. **Never truncate code.** Don't use placeholders like \`// ...rest\` or \`# existing code...\`. Provide complete implementations.
137
- 6. **Don't touch tests, migrations, or third-party code** unless the user explicitly asks you to.
138
- 7. **Never remove referenced logic.** Check all callers before deleting a function, class, or symbol.
139
- 8. **Understand blast radius.** Trace relationships and dependents before refactoring.
140
- 9. **Follow conventions above.** Match the project's existing naming patterns and import styles.
141
- 10. **When unsure, go small.** Propose a minimal, reversible change instead of a sweeping refactor.`);
142
- // ── When Changing Code ──────────────────────────────────
143
- parts.push(`## When Changing Code
144
-
145
- - **Read the COMPLETE file** before modifying it. Preserve all existing exports/functions.
146
- - **Add, don't reorganize.** Unless the task says "refactor", avoid moving code around.
147
- - **Check high-risk hubs** listed above before editing widely-imported files.
148
- - **Avoid renaming** widely-used symbols without updating all callers.
149
- - **No new dependency cycles.** Before adding an import, verify it won't create a circular dependency.
150
- - **Match conventions** listed above (naming, imports, frameworks).
151
- - **Prefer small, localized changes** in the most relevant module.
152
- - Consult \`kb.md\` for the full symbol index, module clusters, and data models.`);
153
- // ── When Things Go Wrong ────────────────────────────────
154
- parts.push(`## When Things Go Wrong
155
-
156
- If you encounter repeated errors or unexpected behavior:
157
-
158
- 1. **Use git** to see what changed: \`git diff\`, \`git status\`
159
- 2. **Restore lost code** with \`git checkout -- <file>\` if needed
160
- 3. **Re-read the complete file** before making more changes
161
- 4. **Trace data flows** to understand execution paths
162
- 5. **Run actual tests** to verify behavior before assuming something works`);
163
- return parts.join('\n\n').trim();
164
- }
165
- function buildPermissiveKbCustom(s) {
166
- const parts = [];
167
- parts.push(`## Aspect Code — Project-Specific Guidelines
168
-
169
- **Aspect Code** analyzed your codebase and generated the project-specific guidelines below.
170
- The full Knowledge Base is in \`kb.md\` at the workspace root.
171
-
172
- Use these guidelines as orientation — not as constraints.`);
173
- // ── Project Architecture ────────────────────────────────
174
- const archParts = [];
175
- if (s.hubs) {
176
- archParts.push(`### High-Risk Hubs
177
-
178
- ${s.hubs}`);
179
- }
180
- if (s.entryPoints) {
181
- archParts.push(`### Entry Points
182
-
183
- ${s.entryPoints}`);
184
- }
185
- if (s.layout) {
186
- archParts.push(`### Directory Layout
187
-
188
- ${s.layout}`);
189
- }
190
- if (archParts.length > 0) {
191
- parts.push(`## Project Architecture\n\n${archParts.join('\n\n')}`);
192
- }
193
- if (s.conventions) {
194
- parts.push(`## Coding Conventions
195
-
196
- ${s.conventions}`);
197
- }
198
- if (s.integrations) {
199
- parts.push(`## External Integrations
200
-
201
- ${s.integrations}`);
202
- }
203
- // ── Operating Rules ─────────────────────────────────────
204
- parts.push(`### Operating Rules (Pragmatic, Not Rigid)
205
-
206
- - Read relevant code before large edits; use the architecture above for orientation
207
- - Treat the hubs and entry points above as the "structural spine" of the project
208
- - If your change conflicts with existing structure, either:
209
- - update the code in a way that keeps the existing intent valid, or
210
- - explicitly state the mismatch and proceed with a coherent new structure
211
-
212
- ### You May (Explicitly Allowed)
213
-
214
- - Refactor for clarity: extract functions, split files, consolidate duplicates
215
- - Reorganize modules/folders when it improves cohesion and discoverability
216
- - Touch multiple files when the change is conceptually one improvement
217
- - Change public/internal APIs when it simplifies the design (with follow-through updates)
218
- - Edit high-risk hubs when needed — do it deliberately, with dependency awareness
219
- - Rename symbols for consistency (types, functions, modules) and update references
220
-
221
- ### You Should
222
-
223
- - Explain the new structure in terms of the existing architecture
224
- - Keep changes "conceptually tight": one goal, end-to-end, fully wired
225
- - Update call sites and imports immediately when you move/rename things
226
- - Prefer simplification over novelty; remove unnecessary layers when justified
227
- - Validate that referenced symbols still exist and are still reachable from call sites
228
-
229
- ### Avoid
230
-
231
- - Deleting or renaming referenced symbols without updating all usages
232
- - Unnecessary scope creep (adding features unrelated to the request)
233
- - Blind rewrites that ignore the project's dependency structure and entry points
234
- - "Rebuild everything" refactors when a targeted restructure achieves the goal
235
- - Cosmetic churn that obscures meaningful changes`);
236
- parts.push(`## Suggested Workflow
237
-
238
- 1. Read the architecture above and relevant code for orientation.
239
- 2. Implement the change end-to-end.
240
- 3. Run tests / build.`);
241
- return parts.join('\n\n').trim();
242
- }
243
- // ─────────────────────────────────────────────────────────────────────────────
244
- // Rules-only content (no KB references)
245
- // ─────────────────────────────────────────────────────────────────────────────
246
- function generateCanonicalContentSafe() {
247
- return `## Aspect Code — Coding Guidelines
248
-
249
- **Aspect Code** provides coding guidelines to help you make safer, more informed code changes.
250
-
251
- ## Golden Rules
252
-
253
- 1. **Read before you write.** Open and read the relevant files before multi-file edits.
254
- 2. **Think step-by-step.** Break complex tasks into smaller steps; reason through each before coding.
255
- 3. **Prefer minimal, local changes.** Small patches are safer than large refactors, especially in widely-imported files.
256
- 4. **Never truncate code.** Don't use placeholders like \`// ...rest\` or \`# existing code...\`. Provide complete implementations.
257
- 5. **Don't touch tests, migrations, or third-party code** unless the user explicitly asks you to.
258
- 6. **Never remove referenced logic.** Check all callers before deleting a function, class, or symbol.
259
- 7. **Understand blast radius.** Trace relationships and dependents before refactoring.
260
- 8. **Follow existing naming patterns.** Match the project's existing naming patterns and import styles.
261
- 9. **When unsure, go small.** Propose a minimal, reversible change instead of a sweeping refactor.
262
-
263
- ## Recommended Workflow
264
-
265
- 1. **Understand the task.** Parse requirements; note which files or endpoints are involved.
266
- 2. **Find relevant code.** Locate data models, symbols, and naming conventions.
267
- 3. **Understand relationships.** See which files are commonly edited together and how they connect.
268
- 4. **Trace impact.** Review callers and dependents to gauge the blast radius of changes.
269
- 5. **Gather evidence.** If behavior is unclear, add targeted logging or traces to confirm assumptions.
270
- 6. **Make minimal edits.** Implement the smallest change that solves the task; run tests.
271
-
272
- ## When Changing Code
273
-
274
- - **Read the COMPLETE file** before modifying it. Preserve all existing exports/functions.
275
- - **Add, don't reorganize.** Unless the task says "refactor", avoid moving code around.
276
- - **Check widely-imported files** before editing them — changes ripple to all dependents.
277
- - **Avoid renaming** widely-used symbols without updating all callers.
278
- - **No new dependency cycles.** Before adding an import, verify it won't create a circular dependency.
279
- - **Match conventions.** Follow existing naming patterns (naming, imports, frameworks).
280
- - **Prefer small, localized changes** in the most relevant module.
281
-
282
- ## When Things Go Wrong
283
-
284
- If you encounter repeated errors or unexpected behavior:
285
-
286
- 1. **Use git** to see what changed: \`git diff\`, \`git status\`
287
- 2. **Restore lost code** with \`git checkout -- <file>\` if needed
288
- 3. **Re-read the complete file** before making more changes
289
- 4. **Trace data flows** to understand execution paths
290
- 5. **Run actual tests** to verify behavior before assuming something works
291
-
292
- ## General Guidelines
293
-
294
- - **Start with the most relevant file.** Understand the area before changing it.
295
- - **Check widely-imported modules.** Know which files have many dependents before editing.
296
- - **Follow existing conventions.** Match existing naming patterns and coding styles exactly.
297
- - **Minimal changes.** Make the smallest change that solves the problem correctly.
298
- - **Acknowledge risk.** If editing a widely-imported file, note the elevated risk.
299
- `.trim();
300
- }
301
- function generateCanonicalContentPermissive() {
302
- return `## Aspect Code — Coding Guidelines
303
-
304
- **Aspect Code** provides coding guidelines to help you make informed code changes.
305
-
306
- Use these guidelines as orientation — not as constraints.
307
-
308
- ### Operating Rules (Pragmatic, Not Rigid)
309
-
310
- - Read relevant code before large edits; understand boundaries, flows, and ownership
311
- - If your change creates a conflict with existing structure, either:
312
- - update the code in a way that keeps the existing intent valid, or
313
- - explicitly state the mismatch and proceed with a coherent new structure
314
-
315
- ### You May (Explicitly Allowed)
316
-
317
- - Refactor for clarity: extract functions, split files, consolidate duplicates
318
- - Reorganize modules/folders when it improves cohesion and discoverability
319
- - Touch multiple files when the change is conceptually one improvement
320
- - Change public/internal APIs when it simplifies the design (with follow-through updates)
321
- - Rename symbols for consistency (types, functions, modules) and update references
322
-
323
- ### You Should
324
-
325
- - Explain the new structure in terms of the existing architecture
326
- - Keep changes "conceptually tight": one goal, end-to-end, fully wired
327
- - Update call sites and imports immediately when you move/rename things
328
- - Prefer simplification over novelty; remove unnecessary layers when justified
329
- - Validate that referenced symbols still exist and are still reachable from call sites
330
-
331
- ### Avoid
332
-
333
- - Deleting or renaming referenced symbols without updating all usages
334
- - Unnecessary scope creep (adding features unrelated to the request)
335
- - Blind rewrites that ignore the project's dependency structure and entry points
336
- - "Rebuild everything" refactors when a targeted restructure achieves the goal
337
- - Cosmetic churn that obscures meaningful changes
338
-
339
- ## Suggested Workflow
340
-
341
- 1. Read the relevant code for orientation.
342
- 2. Implement the change end-to-end.
343
- 3. Run tests / build.
344
- `.trim();
345
- }
346
- // ─────────────────────────────────────────────────────────────────────────────
347
- // KB-aware content (references kb.md)
348
- // ─────────────────────────────────────────────────────────────────────────────
349
- function generateCanonicalContentSafeKB() {
350
- return `## Aspect Code Knowledge Base
351
-
352
- **Aspect Code** is a static-analysis tool that generates a Knowledge Base (KB) for your codebase. The KB is in \`kb.md\` at the workspace root and contains these sections:
353
-
354
- | Section | Purpose |
355
- |---------|---------|
356
- | **Architecture** | **Read first.** High-risk hubs, directory layout, entry points—the "Do Not Break" zones |
357
- | **Map** | Data models with signatures, symbol index, naming conventions |
358
- | **Context** | Module clusters (co-edited files), external integrations, data flow paths |
359
-
360
- **Key architectural intelligence:**
361
- - **High-Risk Hubs** in the Architecture section: Files with many dependents—changes here ripple widely
362
- - **Entry Points** in the Architecture section: HTTP handlers, CLI commands, event listeners
363
- - **External Integrations** in the Context section: API clients, database connections, message queues
364
- - **Data Models** in the Map section: ORM models, dataclasses, TypeScript interfaces with signatures
365
-
366
- Read the relevant sections of \`kb.md\` **before** making multi-file changes.
367
-
368
- ## Golden Rules
369
-
370
- 1. **Read the KB as a map, not a checklist.** Use \`kb.md\` to understand architecture, not as a to-do list.
371
- 2. **Read before you write.** Open the relevant KB sections before multi-file edits.
372
- 3. **Check architecture first.** Review the Architecture section to understand high-risk zones before coding.
373
- 4. **Think step-by-step.** Break complex tasks into smaller steps; reason through each before coding.
374
- 5. **Prefer minimal, local changes.** Small patches are safer than large refactors, especially in hub files.
375
- 6. **Never truncate code.** Don't use placeholders like \`// ...rest\` or \`# existing code...\`. Provide complete implementations.
376
- 7. **Don't touch tests, migrations, or third-party code** unless the user explicitly asks you to.
377
- 8. **Never remove referenced logic.** If a symbol appears in the Map section, check all callers before deleting.
378
- 9. **Understand blast radius.** Use the Context and Map sections to trace relationships before refactors.
379
- 10. **Follow naming patterns in the Map section.** Match the project's existing naming patterns and import styles.
380
- 11. **When unsure, go small.** Propose a minimal, reversible change instead of a sweeping refactor.
381
-
382
- ## Recommended Workflow
383
-
384
- 1. **Understand the task.** Parse requirements; note which files or endpoints are involved.
385
- 2. **Check architecture.** Open \`kb.md\` → review the Architecture section for high-risk hubs and entry points.
386
- 3. **Find relevant code.** Review the Map section → locate data models, symbols, and naming conventions.
387
- 4. **Understand relationships.** Review the Context section → see module clusters (co-edited files) and integrations.
388
- 5. **Trace impact.** Review "Called by" in the Map section to gauge the blast radius of changes.
389
- 6. **Gather evidence.** If behavior is unclear, add targeted logging or traces to confirm assumptions.
390
- 7. **Make minimal edits.** Implement the smallest change that solves the task; run tests.
391
-
392
- ## When Changing Code
393
-
394
- - **Read the COMPLETE file** before modifying it. Preserve all existing exports/functions.
395
- - **Add, don't reorganize.** Unless the task says "refactor", avoid moving code around.
396
- - **Check high-risk hubs** (Architecture section) before editing widely-imported files.
397
- - **Avoid renaming** widely-used symbols listed in the Map section without updating all callers.
398
- - **No new cycles.** Before adding an import, verify it won't create a circular dependency (Architecture section).
399
- - **Match conventions.** Follow naming patterns shown in the Map section (naming, imports, frameworks).
400
- - **Check module clusters** (Context section) to understand which files are commonly edited together.
401
- - **Prefer small, localized changes** in the most relevant app module identified by the KB.
402
- - **Use the Architecture, Map, and Context sections** to locate the smallest, safest place to make a change.
403
-
404
- ## How to Use kb.md
405
-
406
- | Section | When to Open | What to Look For |
407
- |---------|--------------|------------------|
408
- | Architecture | **First, always** | High-risk hubs, directory layout, entry points, circular dependencies |
409
- | Map | Before modifying a function | Data models with signatures, symbol index, naming conventions |
410
- | Context | Before architectural changes | Module clusters, external integrations, data flow patterns |
411
-
412
- ### Quick Reference
413
-
414
- - **High-risk hubs** → Files with 3+ dependents listed in the Architecture section—changes ripple widely
415
- - **Entry points** → HTTP handlers, CLI commands, event listeners in the Architecture section
416
- - **External integrations** → HTTP clients, DB connections, message queues in the Context section
417
- - **Data models** → ORM models, dataclasses, interfaces with signatures in the Map section
418
- - **Module clusters** → Files commonly edited together in the Context section
419
- - **High-impact symbol** → 5+ callers in the Map section "Called by" column
420
-
421
- ## When Things Go Wrong
422
-
423
- If you encounter repeated errors or unexpected behavior:
424
-
425
- 1. **Use git** to see what changed: \`git diff\`, \`git status\`
426
- 2. **Restore lost code** with \`git checkout -- <file>\` if needed
427
- 3. **Re-read the complete file** before making more changes
428
- 4. **Trace data flows** using the Context section to understand execution paths
429
- 5. **Run actual tests** to verify behavior before assuming something works
430
- 6. **Check module clusters** in the Context section for related files that may need updates
431
-
432
- ## General Guidelines
433
-
434
- - **Read kb.md first.** Before making changes, consult the relevant knowledge base sections.
435
- - **Start with the Architecture section.** Understand high-risk hubs and entry points.
436
- - **Check hub modules.** Know which files have many dependents before editing.
437
- - **Follow Map section conventions.** Match existing naming patterns and coding styles exactly.
438
- - **Minimal changes.** Make the smallest change that solves the problem correctly.
439
- - **Acknowledge risk.** If editing a hub module or high-impact file, note the elevated risk.
440
-
441
- ## Section Headers (Pattern-Matching)
442
-
443
- **Architecture:** \`## High-Risk Architectural Hubs\`, \`## Directory Layout\`, \`## Entry Points\`, \`## Circular Dependencies\`
444
- **Map:** \`## Data Models\` (with signatures), \`## Symbol Index\` (with Called By), \`## Conventions\`
445
- **Context:** \`## Module Clusters\` (co-edited files), \`## External Integrations\`, \`## Critical Flows\`
446
- `.trim();
447
- }
448
- function generateCanonicalContentPermissiveKB() {
449
- return `## Aspect Code Knowledge Base
450
-
451
- **Aspect Code** is a static-analysis tool that generates a Knowledge Base (KB) for your codebase. The KB is in \`kb.md\` at the workspace root and contains these sections:
452
-
453
- | Section | Purpose |
454
- |---------|---------|
455
- | **Architecture** | Hubs, directory layout, entry points |
456
- | **Map** | Data models with signatures, symbol index, naming conventions |
457
- | **Context** | Module clusters (co-edited files), external integrations, data flow paths |
458
-
459
- Use the Knowledge Base (KB) as orientation and ground truth for architecture and dependencies—not as a constraint.
460
-
461
- ### Operating Rules (KB-First, Not KB-Locked)
462
-
463
- - Read \`kb.md\` before large edits; use it to understand boundaries, flows, and ownership
464
- - Treat the KB as the source of "what connects to what" (entry points, hubs, key types)
465
- - If your change conflicts with the KB, either:
466
- - update the code in a way that keeps the KB's intent valid, or
467
- - explicitly state the mismatch and proceed with a coherent new structure
468
-
469
- ### You May (Explicitly Allowed)
470
-
471
- - Refactor for clarity: extract functions, split files, consolidate duplicates
472
- - Reorganize modules/folders when it improves cohesion and discoverability
473
- - Touch multiple files when the change is conceptually one improvement
474
- - Change public/internal APIs when it simplifies the design (with follow-through updates)
475
- - Edit high-risk hubs when needed—do it deliberately, with dependency awareness
476
- - Rename symbols for consistency (types, functions, modules) and update references
477
-
478
- ### You Should
479
-
480
- - Explain the new structure in terms of the existing architecture
481
- - Keep changes "conceptually tight": one goal, end-to-end, fully wired
482
- - Update call sites and imports immediately when you move/rename things
483
- - Prefer simplification over novelty; remove unnecessary layers when justified
484
- - Validate that referenced symbols still exist and are still reachable from call sites
485
-
486
- ### Avoid
487
-
488
- - Deleting or renaming referenced symbols without updating all usages
489
- - Unnecessary scope creep (adding features unrelated to the request)
490
- - Blind rewrites that ignore \`kb.md\`'s dependency map and entry points
491
- - "Rebuild everything" refactors when a targeted restructure achieves the goal
492
- - Cosmetic churn that obscures meaningful changes
493
-
494
- ## Suggested Workflow
495
-
496
- 1. Skim the relevant sections of \`kb.md\` for orientation.
497
- 2. Implement the change end-to-end.
498
- 3. Run tests / build.
499
- `.trim();
500
- }
501
- //# sourceMappingURL=content.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/instructions/content.ts"],"names":[],"mappings":";;AAmBA,0EAUC;AAgBD,0DAoBC;AAqOD,oEAsDC;AAED,gFA4CC;AAMD,wEAkGC;AAED,oFAoDC;AAtiBD,gFAAgF;AAChF,+DAA+D;AAC/D,EAAE;AACF,eAAe;AACf,2EAA2E;AAC3E,qEAAqE;AACrE,8EAA8E;AAC9E,gFAAgF;AAEhF;;;;;;;GAOG;AACH,SAAgB,+BAA+B,CAC7C,IAAsB,EACtB,WAAW,GAAG,KAAK;IAEnB,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;QAC1B,OAAO,WAAW;YAChB,CAAC,CAAC,oCAAoC,EAAE;YACxC,CAAC,CAAC,kCAAkC,EAAE,CAAC;IAC3C,CAAC;IACD,OAAO,WAAW,CAAC,CAAC,CAAC,8BAA8B,EAAE,CAAC,CAAC,CAAC,4BAA4B,EAAE,CAAC;AACzF,CAAC;AAED,gFAAgF;AAChF,2EAA2E;AAC3E,gFAAgF;AAEhF;;;;;;;;;GASG;AACH,SAAgB,uBAAuB,CACrC,SAAiB,EACjB,OAAyB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgGR,CAAC,IAAI,EAAE,CAAC;AACT,CAAC;AAED,SAAgB,oCAAoC;IAClD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDR,CAAC,IAAI,EAAE,CAAC;AACT,CAAC"}
@@ -1,13 +0,0 @@
1
- import type { EmitterHost } from '../host';
2
- import type { AiToolId } from './formats';
3
- export type AssistantId = 'aspectKB' | 'agentsMd';
4
- /**
5
- * Detects which Aspect Code artifacts exist (KB, instructions).
6
- */
7
- export declare function detectAssistants(host: EmitterHost, workspaceRoot: string): Promise<Set<AssistantId>>;
8
- /**
9
- * Detects which AI coding tools are present in the workspace by checking
10
- * for their config/instruction files on disk.
11
- */
12
- export declare function detectAiTools(host: EmitterHost, workspaceRoot: string): Promise<Set<AiToolId>>;
13
- //# sourceMappingURL=detection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detection.d.ts","sourceRoot":"","sources":["../../src/instructions/detection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAK1C,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,UAAU,CAAC;AAOlD;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,WAAW,EACjB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAuB3B;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,WAAW,EACjB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAuBxB"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.detectAssistants = detectAssistants;
4
- exports.detectAiTools = detectAiTools;
5
- const formats_1 = require("./formats");
6
- const ASSISTANT_DETECTION_PATHS = [
7
- { id: 'aspectKB', paths: ['.aspect'] },
8
- { id: 'agentsMd', paths: ['AGENTS.md'] },
9
- ];
10
- /**
11
- * Detects which Aspect Code artifacts exist (KB, instructions).
12
- */
13
- async function detectAssistants(host, workspaceRoot) {
14
- const detected = new Set();
15
- const allPromises = ASSISTANT_DETECTION_PATHS.flatMap((check) => check.paths.map(async (p) => {
16
- const abs = host.join(workspaceRoot, p);
17
- try {
18
- return (await host.exists(abs)) ? check.id : null;
19
- }
20
- catch {
21
- return null;
22
- }
23
- }));
24
- const results = await Promise.allSettled(allPromises);
25
- for (const result of results) {
26
- if (result.status === 'fulfilled' && result.value) {
27
- detected.add(result.value);
28
- }
29
- }
30
- return detected;
31
- }
32
- /**
33
- * Detects which AI coding tools are present in the workspace by checking
34
- * for their config/instruction files on disk.
35
- */
36
- async function detectAiTools(host, workspaceRoot) {
37
- const detected = new Set();
38
- const allPromises = formats_1.AI_TOOL_DETECTION_PATHS.flatMap((check) => check.paths.map(async (p) => {
39
- const abs = host.join(workspaceRoot, p);
40
- try {
41
- return (await host.exists(abs)) ? check.id : null;
42
- }
43
- catch {
44
- return null;
45
- }
46
- }));
47
- const results = await Promise.allSettled(allPromises);
48
- for (const result of results) {
49
- if (result.status === 'fulfilled' && result.value) {
50
- detected.add(result.value);
51
- }
52
- }
53
- return detected;
54
- }
55
- //# sourceMappingURL=detection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detection.js","sourceRoot":"","sources":["../../src/instructions/detection.ts"],"names":[],"mappings":";;AAgBA,4CA0BC;AAMD,sCA0BC;AAxED,uCAAoD;AAMpD,MAAM,yBAAyB,GAAwD;IACrF,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE;IACtC,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE;CACzC,CAAC;AAEF;;GAEG;AACI,KAAK,UAAU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;YACH,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACpD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAEtD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAClD,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Instructions emitter — writes AGENTS.md with full-file ownership.
3
- *
4
- * No markers, no merge logic. The entire file is owned by AspectCode.
5
- * Content comes from the static generator or from the optimizer.
6
- */
7
- import type { Emitter } from '../emitter';
8
- export declare function createInstructionsEmitter(): Emitter;
9
- //# sourceMappingURL=instructionsEmitter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instructionsEmitter.d.ts","sourceRoot":"","sources":["../../src/instructions/instructionsEmitter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAA2B,MAAM,YAAY,CAAC;AAInE,wBAAgB,yBAAyB,IAAI,OAAO,CAuBnD"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- /**
3
- * Instructions emitter — writes AGENTS.md with full-file ownership.
4
- *
5
- * No markers, no merge logic. The entire file is owned by AspectCode.
6
- * Content comes from the static generator or from the optimizer.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createInstructionsEmitter = createInstructionsEmitter;
10
- const content_1 = require("./content");
11
- function createInstructionsEmitter() {
12
- return {
13
- name: 'instructions',
14
- async emit(_model, host, options) {
15
- const outDir = options.outDir ?? options.workspaceRoot;
16
- const mode = options.instructionsMode ?? 'safe';
17
- const wrote = [];
18
- if (mode === 'off') {
19
- return { filesWritten: wrote };
20
- }
21
- // Generate canonical content — full-file, no markers
22
- const content = (0, content_1.generateCanonicalContentForMode)(mode, options.generateKb);
23
- const filePath = host.join(outDir, 'AGENTS.md');
24
- await host.writeFile(filePath, content);
25
- wrote.push(filePath);
26
- return { filesWritten: wrote };
27
- },
28
- };
29
- }
30
- //# sourceMappingURL=instructionsEmitter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instructionsEmitter.js","sourceRoot":"","sources":["../../src/instructions/instructionsEmitter.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAOH,8DAuBC;AAzBD,uCAA4D;AAE5D,SAAgB,yBAAyB;IACvC,OAAO;QACL,IAAI,EAAE,cAAc;QAEpB,KAAK,CAAC,IAAI,CAAC,MAAqB,EAAE,IAAiB,EAAE,OAAoB;YACvE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC;YACvD,MAAM,IAAI,GAAG,OAAO,CAAC,gBAAgB,IAAI,MAAM,CAAC;YAChD,MAAM,KAAK,GAAa,EAAE,CAAC;YAE3B,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;gBACnB,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;YACjC,CAAC;YAED,qDAAqD;YACrD,MAAM,OAAO,GAAG,IAAA,yCAA+B,EAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;YAE1E,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YAChD,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACxC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAErB,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;QACjC,CAAC;KACF,CAAC;AACJ,CAAC"}