maskweaver 0.9.3 → 0.9.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 (246) hide show
  1. package/README.ko.md +279 -325
  2. package/README.md +109 -113
  3. package/assets/commands/meta/commands.json +34 -34
  4. package/assets/commands/weave-agents.md +12 -52
  5. package/assets/commands/weave-approve.md +12 -51
  6. package/assets/commands/weave-archive.md +21 -0
  7. package/assets/commands/weave-build.md +20 -89
  8. package/assets/commands/weave-craft.md +22 -43
  9. package/assets/commands/weave-help.md +37 -106
  10. package/assets/commands/weave-init.md +26 -108
  11. package/assets/commands/weave-interview.md +13 -111
  12. package/assets/commands/weave-map.md +13 -99
  13. package/assets/commands/weave-prepare.md +23 -69
  14. package/assets/commands/weave-refine-plan.md +26 -59
  15. package/assets/commands/weave-repair.md +22 -70
  16. package/assets/commands/weave-status.md +22 -155
  17. package/assets/commands/weave-troubleshoot.md +11 -47
  18. package/assets/commands/weave-verify.md +23 -44
  19. package/assets/commands/weave-worktree.md +27 -69
  20. package/dist/cli/doctor.js +5 -21
  21. package/dist/cli/install.d.ts +0 -8
  22. package/dist/cli/install.js +0 -39
  23. package/dist/context/config.d.ts +0 -22
  24. package/dist/context/config.js +0 -28
  25. package/dist/context/feature.d.ts +0 -39
  26. package/dist/context/feature.js +0 -77
  27. package/dist/context/files.d.ts +0 -13
  28. package/dist/context/files.js +1 -24
  29. package/dist/context/index.d.ts +0 -7
  30. package/dist/context/index.js +0 -12
  31. package/dist/context/project.d.ts +0 -21
  32. package/dist/context/project.js +0 -30
  33. package/dist/context/types.d.ts +0 -48
  34. package/dist/context/types.js +0 -12
  35. package/dist/context/utils.d.ts +0 -18
  36. package/dist/context/utils.js +0 -27
  37. package/dist/core/engine/promptBuilder.d.ts +0 -17
  38. package/dist/core/engine/promptBuilder.js +0 -28
  39. package/dist/core/index.d.ts +0 -6
  40. package/dist/core/index.js +0 -9
  41. package/dist/core/loader/MaskLoader.d.ts +0 -23
  42. package/dist/core/loader/MaskLoader.js +0 -29
  43. package/dist/core/schema/types.d.ts +0 -47
  44. package/dist/core/schema/types.js +0 -6
  45. package/dist/core/schema/validator.d.ts +0 -14
  46. package/dist/core/schema/validator.js +0 -18
  47. package/dist/i18n/index.d.ts +0 -18
  48. package/dist/i18n/index.js +4 -23
  49. package/dist/index.d.ts +0 -8
  50. package/dist/index.js +0 -8
  51. package/dist/lib.d.ts +0 -5
  52. package/dist/lib.js +0 -12
  53. package/dist/memory/chunking.d.ts +0 -22
  54. package/dist/memory/chunking.js +2 -37
  55. package/dist/memory/core.d.ts +0 -29
  56. package/dist/memory/core.js +1 -52
  57. package/dist/memory/index.d.ts +0 -5
  58. package/dist/memory/index.js +0 -10
  59. package/dist/memory/indexer.d.ts +0 -21
  60. package/dist/memory/indexer.js +0 -44
  61. package/dist/memory/providers/examples.d.ts +0 -5
  62. package/dist/memory/providers/examples.js +4 -64
  63. package/dist/memory/providers/factory.d.ts +0 -44
  64. package/dist/memory/providers/factory.js +0 -46
  65. package/dist/memory/providers/index.d.ts +0 -26
  66. package/dist/memory/providers/index.js +0 -28
  67. package/dist/memory/providers/ollama.d.ts +0 -6
  68. package/dist/memory/providers/ollama.js +1 -8
  69. package/dist/memory/providers/openai.d.ts +0 -6
  70. package/dist/memory/providers/openai.js +1 -8
  71. package/dist/memory/providers/openrouter.d.ts +0 -6
  72. package/dist/memory/providers/openrouter.js +0 -8
  73. package/dist/memory/providers/text-only.d.ts +0 -13
  74. package/dist/memory/providers/text-only.js +0 -17
  75. package/dist/memory/providers/types.d.ts +0 -39
  76. package/dist/memory/providers/types.js +0 -7
  77. package/dist/memory/providers/voyage.d.ts +0 -22
  78. package/dist/memory/providers/voyage.js +1 -24
  79. package/dist/memory/search/hybrid.d.ts +0 -12
  80. package/dist/memory/search/hybrid.js +1 -22
  81. package/dist/memory/store/sqlite.d.ts +0 -72
  82. package/dist/memory/store/sqlite.js +4 -127
  83. package/dist/plugin/config/index.d.ts +0 -112
  84. package/dist/plugin/config/index.js +0 -115
  85. package/dist/plugin/index.d.ts +0 -13
  86. package/dist/plugin/index.js +1 -124
  87. package/dist/plugin/tools/command-registry.d.ts +0 -6
  88. package/dist/plugin/tools/command-registry.js +0 -14
  89. package/dist/plugin/tools/context.d.ts +0 -12
  90. package/dist/plugin/tools/context.js +0 -58
  91. package/dist/plugin/tools/maskSave.d.ts +0 -3
  92. package/dist/plugin/tools/maskSave.js +0 -3
  93. package/dist/plugin/tools/memoryGet.d.ts +0 -3
  94. package/dist/plugin/tools/memoryGet.js +0 -3
  95. package/dist/plugin/tools/memoryIndexer.d.ts +0 -3
  96. package/dist/plugin/tools/memoryIndexer.js +0 -10
  97. package/dist/plugin/tools/memorySearch.d.ts +0 -31
  98. package/dist/plugin/tools/memorySearch.js +0 -79
  99. package/dist/plugin/tools/memoryWrite.d.ts +0 -8
  100. package/dist/plugin/tools/memoryWrite.js +0 -32
  101. package/dist/plugin/tools/retrospect.d.ts +0 -3
  102. package/dist/plugin/tools/retrospect.js +0 -3
  103. package/dist/plugin/tools/slashcommand.d.ts +0 -11
  104. package/dist/plugin/tools/slashcommand.js +0 -38
  105. package/dist/plugin/tools/squad.d.ts +0 -12
  106. package/dist/plugin/tools/squad.js +11 -83
  107. package/dist/plugin/tools/weave.d.ts +0 -6
  108. package/dist/plugin/tools/weave.js +0 -78
  109. package/dist/plugin/types.d.ts +0 -20
  110. package/dist/plugin/types.js +0 -7
  111. package/dist/retrospect/index.d.ts +0 -7
  112. package/dist/retrospect/index.js +0 -9
  113. package/dist/retrospect/mask-save.d.ts +0 -12
  114. package/dist/retrospect/mask-save.js +1 -80
  115. package/dist/retrospect/retrospect.d.ts +0 -18
  116. package/dist/retrospect/retrospect.js +0 -63
  117. package/dist/retrospect/strategies/base.d.ts +0 -15
  118. package/dist/retrospect/strategies/base.js +0 -7
  119. package/dist/retrospect/strategies/deep.d.ts +0 -12
  120. package/dist/retrospect/strategies/deep.js +0 -24
  121. package/dist/retrospect/strategies/index.d.ts +0 -12
  122. package/dist/retrospect/strategies/index.js +0 -12
  123. package/dist/retrospect/strategies/quick.d.ts +0 -12
  124. package/dist/retrospect/strategies/quick.js +0 -19
  125. package/dist/retrospect/strategies/standard.d.ts +0 -12
  126. package/dist/retrospect/strategies/standard.js +0 -15
  127. package/dist/retrospect/types.d.ts +0 -7
  128. package/dist/retrospect/types.js +0 -7
  129. package/dist/shared/config.d.ts +0 -105
  130. package/dist/shared/config.js +0 -33
  131. package/dist/shared/errors.d.ts +0 -18
  132. package/dist/shared/errors.js +0 -19
  133. package/dist/shared/generate-agents.d.ts +0 -69
  134. package/dist/shared/generate-agents.js +2 -86
  135. package/dist/shared/image.d.ts +0 -67
  136. package/dist/shared/image.js +6 -104
  137. package/dist/shared/index.d.ts +0 -5
  138. package/dist/shared/index.js +0 -7
  139. package/dist/shared/model-registry.d.ts +0 -72
  140. package/dist/shared/model-registry.js +5 -95
  141. package/dist/shared/types.d.ts +0 -15
  142. package/dist/shared/types.js +0 -3
  143. package/dist/shared-context/dag.d.ts +0 -105
  144. package/dist/shared-context/dag.js +3 -114
  145. package/dist/shared-context/index.d.ts +0 -5
  146. package/dist/shared-context/index.js +0 -15
  147. package/dist/shared-context/logger.d.ts +0 -37
  148. package/dist/shared-context/logger.js +0 -41
  149. package/dist/shared-context/parallel-executor.d.ts +0 -54
  150. package/dist/shared-context/parallel-executor.js +4 -56
  151. package/dist/shared-context/session.d.ts +0 -56
  152. package/dist/shared-context/session.js +0 -47
  153. package/dist/shared-context/squad.d.ts +0 -68
  154. package/dist/shared-context/squad.js +0 -63
  155. package/dist/shared-context/storage.d.ts +0 -132
  156. package/dist/shared-context/storage.js +0 -116
  157. package/dist/shared-context/task.d.ts +0 -120
  158. package/dist/shared-context/task.js +0 -152
  159. package/dist/shared-context/test/dag.test.js +9 -14
  160. package/dist/shared-context/test/logger.test.d.ts +0 -8
  161. package/dist/shared-context/test/logger.test.js +0 -52
  162. package/dist/shared-context/test/session.test.d.ts +0 -7
  163. package/dist/shared-context/test/session.test.js +0 -63
  164. package/dist/shared-context/test/squad.test.d.ts +0 -10
  165. package/dist/shared-context/test/squad.test.js +2 -68
  166. package/dist/shared-context/test/storage.test.d.ts +0 -8
  167. package/dist/shared-context/test/storage.test.js +0 -68
  168. package/dist/shared-context/test/task.test.d.ts +0 -7
  169. package/dist/shared-context/test/task.test.js +0 -54
  170. package/dist/shared-context/test/watchdog.test.d.ts +0 -7
  171. package/dist/shared-context/test/watchdog.test.js +3 -58
  172. package/dist/shared-context/types.d.ts +0 -215
  173. package/dist/shared-context/types.js +0 -125
  174. package/dist/shared-context/watchdog.d.ts +0 -127
  175. package/dist/shared-context/watchdog.js +0 -148
  176. package/dist/shared-context/worktree.d.ts +0 -68
  177. package/dist/shared-context/worktree.js +2 -34
  178. package/dist/verify/budget.d.ts +0 -29
  179. package/dist/verify/budget.js +0 -34
  180. package/dist/verify/critical-files.d.ts +0 -17
  181. package/dist/verify/critical-files.js +0 -37
  182. package/dist/verify/escalation.d.ts +0 -20
  183. package/dist/verify/escalation.js +0 -22
  184. package/dist/verify/index.d.ts +0 -5
  185. package/dist/verify/index.js +0 -11
  186. package/dist/verify/prompts.d.ts +0 -20
  187. package/dist/verify/prompts.js +0 -20
  188. package/dist/verify/types.d.ts +0 -26
  189. package/dist/verify/types.js +1 -12
  190. package/dist/verify/verifier.d.ts +0 -29
  191. package/dist/verify/verifier.js +0 -54
  192. package/dist/version.d.ts +1 -16
  193. package/dist/version.js +1 -16
  194. package/dist/weave/bridge.d.ts +0 -35
  195. package/dist/weave/bridge.js +0 -51
  196. package/dist/weave/environment/detector.d.ts +0 -6
  197. package/dist/weave/environment/detector.js +4 -45
  198. package/dist/weave/environment/index.d.ts +0 -19
  199. package/dist/weave/environment/index.js +1 -39
  200. package/dist/weave/environment/issues.d.ts +0 -35
  201. package/dist/weave/environment/issues.js +0 -59
  202. package/dist/weave/git.d.ts +0 -8
  203. package/dist/weave/git.js +0 -8
  204. package/dist/weave/index.d.ts +0 -13
  205. package/dist/weave/index.js +2 -28
  206. package/dist/weave/knowledge/global.d.ts +0 -39
  207. package/dist/weave/knowledge/global.js +2 -78
  208. package/dist/weave/loop.js +0 -3
  209. package/dist/weave/orchestrator.d.ts +0 -69
  210. package/dist/weave/orchestrator.js +1 -101
  211. package/dist/weave/phase-manager.d.ts +0 -64
  212. package/dist/weave/phase-manager.js +0 -89
  213. package/dist/weave/security/secret-scan.d.ts +0 -14
  214. package/dist/weave/security/secret-scan.js +0 -19
  215. package/dist/weave/stages/build.js +0 -15
  216. package/dist/weave/stages/execute.d.ts +0 -42
  217. package/dist/weave/stages/execute.js +4 -86
  218. package/dist/weave/stages/handoff.d.ts +0 -7
  219. package/dist/weave/stages/handoff.js +0 -43
  220. package/dist/weave/stages/index.d.ts +0 -3
  221. package/dist/weave/stages/index.js +0 -3
  222. package/dist/weave/stages/intake.d.ts +0 -8
  223. package/dist/weave/stages/intake.js +5 -65
  224. package/dist/weave/stages/map.d.ts +0 -1
  225. package/dist/weave/stages/openspec.d.ts +0 -1
  226. package/dist/weave/stages/plan.d.ts +0 -11
  227. package/dist/weave/stages/plan.js +1 -53
  228. package/dist/weave/stages/refine.d.ts +0 -7
  229. package/dist/weave/stages/refine.js +0 -7
  230. package/dist/weave/stages/research.d.ts +0 -6
  231. package/dist/weave/stages/research.js +0 -6
  232. package/dist/weave/stages/spec.d.ts +0 -12
  233. package/dist/weave/stages/spec.js +0 -17
  234. package/dist/weave/types.d.ts +0 -20
  235. package/dist/weave/types.js +0 -5
  236. package/dist/weave/verification/commands.d.ts +0 -12
  237. package/dist/weave/verification/commands.js +0 -19
  238. package/dist/weave/verification/index.d.ts +0 -6
  239. package/dist/weave/verification/index.js +1 -19
  240. package/dist/weave/verification/playwright.d.ts +0 -47
  241. package/dist/weave/verification/playwright.js +1 -90
  242. package/dist/weave/worktree.d.ts +0 -16
  243. package/dist/weave/worktree.js +0 -23
  244. package/dist/weave/yaml-repair.d.ts +0 -39
  245. package/dist/weave/yaml-repair.js +13 -116
  246. package/package.json +1 -1
@@ -1,13 +1,4 @@
1
- /**
2
- * Potential Issues Collector
3
- *
4
- * Combines hardcoded known issues with project history from Global Knowledge.
5
- * Provides proactive warnings based on environment + stack combinations.
6
- */
7
1
  const KNOWN_ISSUES = [
8
- // =========================================================================
9
- // Windows-Specific Issues
10
- // =========================================================================
11
2
  {
12
3
  id: 'WIN-BUN-SYMLINK',
13
4
  category: 'environment',
@@ -72,9 +63,6 @@ const KNOWN_ISSUES = [
72
63
  packageManager: ['pnpm', 'bun'],
73
64
  },
74
65
  },
75
- // =========================================================================
76
- // macOS-Specific Issues
77
- // =========================================================================
78
66
  {
79
67
  id: 'MAC-M1-NODEGYP',
80
68
  category: 'environment',
@@ -99,9 +87,6 @@ const KNOWN_ISSUES = [
99
87
  os: ['macos'],
100
88
  },
101
89
  },
102
- // =========================================================================
103
- // Framework Version Issues
104
- // =========================================================================
105
90
  {
106
91
  id: 'PRISMA-7-MIGRATION',
107
92
  category: 'version',
@@ -174,9 +159,6 @@ const KNOWN_ISSUES = [
174
159
  stack: ['TypeScript'],
175
160
  },
176
161
  },
177
- // =========================================================================
178
- // Shell-Specific Issues
179
- // =========================================================================
180
162
  {
181
163
  id: 'SHELL-ENV-QUOTES',
182
164
  category: 'shell',
@@ -200,29 +182,21 @@ const KNOWN_ISSUES = [
200
182
  },
201
183
  },
202
184
  ];
203
- // ============================================================================
204
- // Issue Matching Logic
205
- // ============================================================================
206
185
  function matchesConditions(context, conditions) {
207
- // OS check
208
186
  if (conditions.os && !conditions.os.includes(context.os)) {
209
187
  return false;
210
188
  }
211
- // Shell check
212
189
  if (conditions.shell && !conditions.shell.includes(context.shell)) {
213
190
  return false;
214
191
  }
215
- // Package manager check
216
192
  if (conditions.packageManager && !conditions.packageManager.includes(context.packageManager)) {
217
193
  return false;
218
194
  }
219
- // Stack check (ANY match)
220
195
  if (conditions.stack) {
221
196
  const hasAny = conditions.stack.some(s => context.stack.some(cs => cs.toLowerCase().includes(s.toLowerCase())));
222
197
  if (!hasAny)
223
198
  return false;
224
199
  }
225
- // Stack exact check (ALL match)
226
200
  if (conditions.stackExact) {
227
201
  const hasAll = conditions.stackExact.every(s => context.stack.some(cs => cs.toLowerCase().includes(s.toLowerCase())));
228
202
  if (!hasAll)
@@ -233,7 +207,6 @@ function matchesConditions(context, conditions) {
233
207
  export async function collectPotentialIssues(context, options = {}) {
234
208
  const { includeProjectHistory = true, historyLimit = 5 } = options;
235
209
  const issues = [];
236
- // 1. Collect matching built-in issues
237
210
  for (const known of KNOWN_ISSUES) {
238
211
  if (matchesConditions(context, known.conditions)) {
239
212
  issues.push({
@@ -248,31 +221,23 @@ export async function collectPotentialIssues(context, options = {}) {
248
221
  });
249
222
  }
250
223
  }
251
- // 2. Search project history from Global Knowledge (optional)
252
224
  if (includeProjectHistory) {
253
225
  try {
254
226
  const historyIssues = await searchProjectHistory(context, historyLimit);
255
227
  issues.push(...historyIssues);
256
228
  }
257
229
  catch (e) {
258
- // Project history is optional, don't fail
259
230
  console.log('[Issues] Project history search failed:', e);
260
231
  }
261
232
  }
262
- // Sort by severity (critical > warning > info)
263
233
  const severityOrder = { critical: 0, warning: 1, info: 2 };
264
234
  issues.sort((a, b) => severityOrder[a.severity] - severityOrder[b.severity]);
265
235
  return issues;
266
236
  }
267
- // ============================================================================
268
- // Project History Search (Global Knowledge Integration)
269
- // ============================================================================
270
237
  async function searchProjectHistory(context, limit) {
271
238
  const issues = [];
272
239
  try {
273
- // Dynamic import to avoid circular dependencies
274
240
  const { searchTroubleshooting } = await import('../knowledge/global.js');
275
- // Build search query from context
276
241
  const queryParts = [
277
242
  context.os,
278
243
  context.shell,
@@ -280,11 +245,9 @@ async function searchProjectHistory(context, limit) {
280
245
  ...context.stack.slice(0, 5),
281
246
  ].filter(Boolean);
282
247
  const query = queryParts.join(' ');
283
- // Search Global Knowledge
284
248
  const results = await searchTroubleshooting(query, { limit });
285
249
  for (const result of results) {
286
250
  const entry = result.entry;
287
- // Convert troubleshooting entry to potential issue
288
251
  issues.push({
289
252
  id: `HISTORY-${entry.id}`,
290
253
  category: 'compatibility',
@@ -298,13 +261,9 @@ async function searchProjectHistory(context, limit) {
298
261
  }
299
262
  }
300
263
  catch (e) {
301
- // Global Knowledge might not be available
302
264
  }
303
265
  return issues;
304
266
  }
305
- // ============================================================================
306
- // Utility: Get Issues by Category
307
- // ============================================================================
308
267
  export function filterIssuesByCategory(issues, category) {
309
268
  return issues.filter(i => i.category === category);
310
269
  }
@@ -313,16 +272,11 @@ export function filterIssuesBySeverity(issues, minSeverity) {
313
272
  const minOrder = severityOrder[minSeverity];
314
273
  return issues.filter(i => severityOrder[i.severity] <= minOrder);
315
274
  }
316
- /**
317
- * Search for issues relevant to a specific phase.
318
- * Combines phase metadata with environment context for targeted search.
319
- */
320
275
  export async function searchPhaseIssues(phaseContext, environmentContext, options = {}) {
321
276
  const { limit = 5 } = options;
322
277
  const results = [];
323
278
  try {
324
279
  const { searchTroubleshooting } = await import('../knowledge/global.js');
325
- // Build query from phase context
326
280
  const queryParts = [
327
281
  phaseContext.phaseName,
328
282
  ...(phaseContext.tasks || []),
@@ -333,7 +287,6 @@ export async function searchPhaseIssues(phaseContext, environmentContext, option
333
287
  const searchResults = await searchTroubleshooting(query, { limit });
334
288
  for (const result of searchResults) {
335
289
  const entry = result.entry;
336
- // Calculate relevance based on phase name match
337
290
  let relevance = result.score;
338
291
  const phaseNameLower = phaseContext.phaseName.toLowerCase();
339
292
  if (entry.context.toLowerCase().includes(phaseNameLower)) {
@@ -359,20 +312,14 @@ export async function searchPhaseIssues(phaseContext, environmentContext, option
359
312
  catch (e) {
360
313
  console.log('[Issues] Phase search failed:', e);
361
314
  }
362
- // Sort by relevance
363
315
  results.sort((a, b) => b.relevance - a.relevance);
364
316
  return results.slice(0, limit);
365
317
  }
366
- /**
367
- * Search for issues relevant to a specific feature request.
368
- * Useful when implementing new features to find similar past problems.
369
- */
370
318
  export async function searchFeatureIssues(featureContext, environmentContext, options = {}) {
371
319
  const { limit = 5 } = options;
372
320
  const results = [];
373
321
  try {
374
322
  const { searchTroubleshooting } = await import('../knowledge/global.js');
375
- // Build query from feature context
376
323
  const queryParts = [
377
324
  featureContext.featureName,
378
325
  ...(featureContext.keywords || []),
@@ -382,7 +329,6 @@ export async function searchFeatureIssues(featureContext, environmentContext, op
382
329
  const searchResults = await searchTroubleshooting(query, { limit });
383
330
  for (const result of searchResults) {
384
331
  const entry = result.entry;
385
- // Calculate relevance based on feature keyword match
386
332
  let relevance = result.score;
387
333
  const featureWords = featureContext.featureName.toLowerCase().split(/\s+/);
388
334
  for (const word of featureWords) {
@@ -390,7 +336,6 @@ export async function searchFeatureIssues(featureContext, environmentContext, op
390
336
  relevance = Math.min(1, relevance + 0.05);
391
337
  }
392
338
  }
393
- // Boost if tech stack matches
394
339
  if (featureContext.relatedStack && entry.techStack) {
395
340
  const stackMatch = featureContext.relatedStack.some(s => entry.techStack.some(es => es.toLowerCase().includes(s.toLowerCase())));
396
341
  if (stackMatch) {
@@ -414,13 +359,9 @@ export async function searchFeatureIssues(featureContext, environmentContext, op
414
359
  catch (e) {
415
360
  console.log('[Issues] Feature search failed:', e);
416
361
  }
417
- // Sort by relevance
418
362
  results.sort((a, b) => b.relevance - a.relevance);
419
363
  return results.slice(0, limit);
420
364
  }
421
- /**
422
- * Quick helper to format context search results as markdown.
423
- */
424
365
  export function formatContextResults(results, title = '관련 이슈') {
425
366
  if (results.length === 0) {
426
367
  return `### ✅ ${title}\n기록된 관련 이슈가 없습니다.\n`;
@@ -1,11 +1,3 @@
1
- /**
2
- * Git Utilities (Weave)
3
- *
4
- * Weave needs a small, safe subset of git operations for:
5
- * - staging files (optional)
6
- * - listing staged files
7
- * - creating commits (optional)
8
- */
9
1
  export interface GitCommandResult {
10
2
  stdout: string;
11
3
  stderr: string;
package/dist/weave/git.js CHANGED
@@ -1,11 +1,3 @@
1
- /**
2
- * Git Utilities (Weave)
3
- *
4
- * Weave needs a small, safe subset of git operations for:
5
- * - staging files (optional)
6
- * - listing staged files
7
- * - creating commits (optional)
8
- */
9
1
  import { execFile } from 'node:child_process';
10
2
  import { promisify } from 'node:util';
11
3
  const execFileAsync = promisify(execFile);
@@ -1,16 +1,3 @@
1
- /**
2
- * @maskweaver/weave
3
- *
4
- * Phase-Driven Development Workflow
5
- * "AI가 검증하고, 유저가 확인한다"
6
- *
7
- * Integrates with all Maskweaver modules:
8
- * - core: Expert mask auto-selection per task
9
- * - memory: Cross-project knowledge sharing (troubleshooting, patterns)
10
- * - context: Phase-based file tracking
11
- * - verify: Self-verification loop with 3-tier escalation
12
- * - retrospect: Phase completion analysis
13
- */
14
1
  export type { WeavePhase, WeavePlan, WeaveTask, WeaveStatus, WeaveConfig, TroubleshootingEntry, EnvironmentContext, EnvironmentAnalysis, PotentialIssue, } from './types.js';
15
2
  export { createWeaveWorktree, listWeaveWorktrees, resolveWeaveWorktree, removeWeaveWorktree, bootstrapWeaveArtifacts, } from './worktree.js';
16
3
  export { intake } from './stages/intake.js';
@@ -1,19 +1,4 @@
1
- /**
2
- * @maskweaver/weave
3
- *
4
- * Phase-Driven Development Workflow
5
- * "AI가 검증하고, 유저가 확인한다"
6
- *
7
- * Integrates with all Maskweaver modules:
8
- * - core: Expert mask auto-selection per task
9
- * - memory: Cross-project knowledge sharing (troubleshooting, patterns)
10
- * - context: Phase-based file tracking
11
- * - verify: Self-verification loop with 3-tier escalation
12
- * - retrospect: Phase completion analysis
13
- */
14
- // Worktree utilities (parallel development)
15
1
  export { createWeaveWorktree, listWeaveWorktrees, resolveWeaveWorktree, removeWeaveWorktree, bootstrapWeaveArtifacts, } from './worktree.js';
16
- // Core workflow stages
17
2
  export { intake } from './stages/intake.js';
18
3
  export { buildResearchReport, writeResearchReport } from './stages/research.js';
19
4
  export { refinePlanFromNotes } from './stages/refine.js';
@@ -21,22 +6,11 @@ export { spec } from './stages/spec.js';
21
6
  export { plan } from './stages/plan.js';
22
7
  export { execute } from './stages/execute.js';
23
8
  export { handoff } from './stages/handoff.js';
24
- // Orchestrator (mask auto-selection)
25
9
  export { WeaveOrchestrator } from './orchestrator.js';
26
- // Global Knowledge Base (cross-project RAG)
27
10
  export { GlobalKnowledge, recordTroubleshooting, searchTroubleshooting, getGlobalDbPath, } from './knowledge/global.js';
28
- // Environment Analysis (Proactive Knowledge)
29
- export { analyzeEnvironment, detectEnvironment, collectPotentialIssues, filterIssuesBySeverity, filterIssuesByCategory, hasCriticalIssues, getEnvironmentOneLiner,
30
- // Phase/Feature context search
31
- searchPhaseIssues, searchFeatureIssues, formatContextResults, } from './environment/index.js';
32
- // Phase management
11
+ export { analyzeEnvironment, detectEnvironment, collectPotentialIssues, filterIssuesBySeverity, filterIssuesByCategory, hasCriticalIssues, getEnvironmentOneLiner, searchPhaseIssues, searchFeatureIssues, formatContextResults, } from './environment/index.js';
33
12
  export { PhaseManager, createPhase, getPhase, updatePhaseStatus, listPhases, } from './phase-manager.js';
34
- // Git + Security
35
13
  export { execGit, ensureGitRepo, stageAllChanges, listStagedFiles, hasStagedChanges, commitStagedChanges, } from './git.js';
36
14
  export { scanFilesForSecrets, loadSecretScanConfig, shouldBlockOnFindings, formatSecretScanReport, } from './security/secret-scan.js';
37
- // YAML Repair
38
15
  export { yamlEscapeString, repairYamlContent, safeWriteFile, safeReadYaml, repairPlanFile, repairAllPlans, validatePlanStructure, } from './yaml-repair.js';
39
- // Verification System (Playwright, Visual, API)
40
- export {
41
- // Playwright E2E Testing
42
- checkPlaywrightSetup, initPlaywright, runPlaywrightTests, runPlaywrightTestFile, runVisualRegressionTests, capturePageScreenshot, getTestScreenshots, analyzePlaywrightError, generatePlaywrightConfig, generateExampleTest, } from './verification/index.js';
16
+ export { checkPlaywrightSetup, initPlaywright, runPlaywrightTests, runPlaywrightTestFile, runVisualRegressionTests, capturePageScreenshot, getTestScreenshots, analyzePlaywrightError, generatePlaywrightConfig, generateExampleTest, } from './verification/index.js';
@@ -1,18 +1,5 @@
1
- /**
2
- * Global Knowledge Base
3
- *
4
- * Cross-project RAG system for sharing troubleshooting knowledge.
5
- * This is the KEY differentiator - lessons learned in one project
6
- * benefit all future projects.
7
- *
8
- * Storage: ~/.maskweaver/knowledge.sqlite (global, not per-project)
9
- */
10
1
  import type { TroubleshootingEntry, KnowledgeSearchResult } from '../types.js';
11
2
  export declare function getGlobalDbPath(): string;
12
- /**
13
- * Normalize error messages to create searchable signatures.
14
- * Strips out project-specific paths, line numbers, etc.
15
- */
16
3
  export declare function normalizeErrorSignature(error: string): string;
17
4
  export declare class GlobalKnowledge {
18
5
  private db;
@@ -21,34 +8,16 @@ export declare class GlobalKnowledge {
21
8
  private sqlJsDb;
22
9
  private ftsAvailable;
23
10
  init(): Promise<void>;
24
- /**
25
- * Create a wrapper that mimics better-sqlite3 API using sql.js
26
- */
27
11
  private createSqlJsWrapper;
28
12
  private createTables;
29
- /**
30
- * Record a troubleshooting experience for future reference.
31
- */
32
13
  record(entry: Omit<TroubleshootingEntry, 'id' | 'errorSignature' | 'createdAt' | 'usedCount'>): Promise<number>;
33
- /**
34
- * Search for solutions to a similar error.
35
- */
36
14
  search(errorMessage: string, options?: {
37
15
  projectType?: string;
38
16
  limit?: number;
39
17
  minEffectiveness?: number;
40
18
  }): Promise<KnowledgeSearchResult[]>;
41
- /**
42
- * Mark a solution as used (increases its ranking).
43
- */
44
19
  markUsed(id: number): Promise<void>;
45
- /**
46
- * Update effectiveness rating after user feedback.
47
- */
48
20
  updateEffectiveness(id: number, effectiveness: number): Promise<void>;
49
- /**
50
- * Get statistics about the knowledge base.
51
- */
52
21
  getStats(): Promise<{
53
22
  totalEntries: number;
54
23
  topProjectTypes: {
@@ -63,15 +32,7 @@ export declare class GlobalKnowledge {
63
32
  }>;
64
33
  private rowToEntry;
65
34
  }
66
- /**
67
- * Record a troubleshooting experience.
68
- * Call this when an error is successfully resolved.
69
- */
70
35
  export declare function recordTroubleshooting(entry: Omit<TroubleshootingEntry, 'id' | 'errorSignature' | 'createdAt' | 'usedCount'>): Promise<number>;
71
- /**
72
- * Search for solutions to a similar error.
73
- * Call this when encountering an error during execution.
74
- */
75
36
  export declare function searchTroubleshooting(errorMessage: string, options?: {
76
37
  projectType?: string;
77
38
  limit?: number;
@@ -1,18 +1,6 @@
1
- /**
2
- * Global Knowledge Base
3
- *
4
- * Cross-project RAG system for sharing troubleshooting knowledge.
5
- * This is the KEY differentiator - lessons learned in one project
6
- * benefit all future projects.
7
- *
8
- * Storage: ~/.maskweaver/knowledge.sqlite (global, not per-project)
9
- */
10
1
  import * as fs from 'node:fs';
11
2
  import * as path from 'node:path';
12
3
  import * as os from 'node:os';
13
- // ============================================================================
14
- // Configuration
15
- // ============================================================================
16
4
  const GLOBAL_DIR = path.join(os.homedir(), '.maskweaver');
17
5
  const GLOBAL_DB_FILE = 'knowledge.sqlite';
18
6
  export function getGlobalDbPath() {
@@ -23,32 +11,18 @@ function ensureGlobalDir() {
23
11
  fs.mkdirSync(GLOBAL_DIR, { recursive: true });
24
12
  }
25
13
  }
26
- // ============================================================================
27
- // Error Signature Normalization
28
- // ============================================================================
29
- /**
30
- * Normalize error messages to create searchable signatures.
31
- * Strips out project-specific paths, line numbers, etc.
32
- */
33
14
  export function normalizeErrorSignature(error) {
34
15
  return error
35
- // Remove file paths
36
16
  .replace(/[A-Za-z]:\\[^\s:]+/g, '<PATH>')
37
17
  .replace(/\/[^\s:]+/g, '<PATH>')
38
- // Remove line/column numbers
39
18
  .replace(/:\d+:\d+/g, '')
40
19
  .replace(/line \d+/gi, 'line <N>')
41
20
  .replace(/column \d+/gi, 'column <N>')
42
- // Remove specific variable/function names that look generated
43
21
  .replace(/_[a-f0-9]{8,}/g, '_<HASH>')
44
- // Normalize whitespace
45
22
  .replace(/\s+/g, ' ')
46
23
  .trim()
47
24
  .toLowerCase();
48
25
  }
49
- // ============================================================================
50
- // Global Knowledge Class
51
- // ============================================================================
52
26
  export class GlobalKnowledge {
53
27
  db = null;
54
28
  initialized = false;
@@ -59,7 +33,6 @@ export class GlobalKnowledge {
59
33
  if (this.initialized)
60
34
  return;
61
35
  ensureGlobalDir();
62
- // Try better-sqlite3 first (fastest, native)
63
36
  try {
64
37
  const Database = await import('better-sqlite3').then(m => m.default);
65
38
  this.db = new Database(getGlobalDbPath());
@@ -68,14 +41,10 @@ export class GlobalKnowledge {
68
41
  return;
69
42
  }
70
43
  catch {
71
- // better-sqlite3 not available, try sql.js
72
44
  }
73
- // Fallback to sql.js (works everywhere, WASM-based)
74
45
  try {
75
- // @ts-ignore - sql.js doesn't have TypeScript types
76
46
  const initSqlJs = await import('sql.js').then(m => m.default);
77
47
  const SQL = await initSqlJs();
78
- // Try to load existing database file
79
48
  const dbPath = getGlobalDbPath();
80
49
  let data;
81
50
  try {
@@ -85,7 +54,6 @@ export class GlobalKnowledge {
85
54
  }
86
55
  }
87
56
  catch {
88
- // File doesn't exist or can't be read
89
57
  }
90
58
  this.sqlJsDb = data ? new SQL.Database(data) : new SQL.Database();
91
59
  this.db = this.createSqlJsWrapper(this.sqlJsDb, dbPath);
@@ -95,16 +63,11 @@ export class GlobalKnowledge {
95
63
  return;
96
64
  }
97
65
  catch {
98
- // sql.js also not available
99
66
  }
100
- // Final fallback: in-memory only (no persistence)
101
67
  console.warn('[GlobalKnowledge] No SQLite driver available. Knowledge will not persist between sessions.');
102
68
  this.db = null;
103
69
  this.initialized = true;
104
70
  }
105
- /**
106
- * Create a wrapper that mimics better-sqlite3 API using sql.js
107
- */
108
71
  createSqlJsWrapper(sqlJsDb, dbPath) {
109
72
  const saveToFile = () => {
110
73
  try {
@@ -113,7 +76,6 @@ export class GlobalKnowledge {
113
76
  fs.writeFileSync(dbPath, Buffer.from(data));
114
77
  }
115
78
  catch {
116
- // Ignore save errors
117
79
  }
118
80
  };
119
81
  return {
@@ -125,7 +87,6 @@ export class GlobalKnowledge {
125
87
  return {
126
88
  run: (...params) => {
127
89
  try {
128
- // Flatten params if first element is array
129
90
  const flatParams = params.length === 1 && Array.isArray(params[0])
130
91
  ? params[0]
131
92
  : params;
@@ -141,7 +102,6 @@ export class GlobalKnowledge {
141
102
  get: (...params) => {
142
103
  try {
143
104
  const stmt = sqlJsDb.prepare(sql);
144
- // Flatten params if first element is array
145
105
  const flatParams = params.length === 1 && Array.isArray(params[0])
146
106
  ? params[0]
147
107
  : params;
@@ -165,7 +125,6 @@ export class GlobalKnowledge {
165
125
  try {
166
126
  const results = [];
167
127
  const stmt = sqlJsDb.prepare(sql);
168
- // Flatten params if first element is array
169
128
  const flatParams = params.length === 1 && Array.isArray(params[0])
170
129
  ? params[0]
171
130
  : params;
@@ -194,7 +153,6 @@ export class GlobalKnowledge {
194
153
  createTables() {
195
154
  if (!this.db)
196
155
  return;
197
- // Core table and indexes — always works
198
156
  this.db.exec(`
199
157
  CREATE TABLE IF NOT EXISTS troubleshooting (
200
158
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -217,9 +175,6 @@ export class GlobalKnowledge {
217
175
  CREATE INDEX IF NOT EXISTS idx_project_type
218
176
  ON troubleshooting(project_type);
219
177
  `);
220
- // FTS5 virtual table and sync triggers — requires FTS5 extension
221
- // (available in better-sqlite3 but NOT in default sql.js WASM builds)
222
- // Skip FTS5 entirely for sql.js to avoid WASM-level warnings
223
178
  if (this.usingSqlJs) {
224
179
  this.ftsAvailable = false;
225
180
  }
@@ -256,14 +211,10 @@ export class GlobalKnowledge {
256
211
  this.ftsAvailable = true;
257
212
  }
258
213
  catch {
259
- // FTS5 not available — search falls back to exact matches only
260
214
  this.ftsAvailable = false;
261
215
  }
262
216
  }
263
217
  }
264
- /**
265
- * Record a troubleshooting experience for future reference.
266
- */
267
218
  async record(entry) {
268
219
  await this.init();
269
220
  if (!this.db) {
@@ -282,9 +233,6 @@ export class GlobalKnowledge {
282
233
  const result = stmt.run(signature, entry.errorMessage, entry.context, entry.solution, entry.projectType || null, entry.techStack ? JSON.stringify(entry.techStack) : null, entry.tags ? JSON.stringify(entry.tags) : null, entry.effectiveness || 5, now);
283
234
  return result.lastInsertRowid;
284
235
  }
285
- /**
286
- * Search for solutions to a similar error.
287
- */
288
236
  async search(errorMessage, options = {}) {
289
237
  await this.init();
290
238
  if (!this.db)
@@ -292,7 +240,6 @@ export class GlobalKnowledge {
292
240
  const { projectType, limit = 5, minEffectiveness = 3 } = options;
293
241
  const signature = normalizeErrorSignature(errorMessage);
294
242
  const results = [];
295
- // 1. Exact signature match (highest priority)
296
243
  const exactStmt = this.db.prepare(`
297
244
  SELECT * FROM troubleshooting
298
245
  WHERE error_signature = ?
@@ -308,11 +255,9 @@ export class GlobalKnowledge {
308
255
  matchType: 'exact',
309
256
  });
310
257
  }
311
- // 2. FTS search for similar errors (if not enough exact matches)
312
258
  if (this.ftsAvailable && results.length < limit) {
313
259
  const remaining = limit - results.length;
314
260
  const existingIds = results.map(r => r.entry.id);
315
- // Extract key terms from error
316
261
  const searchTerms = errorMessage
317
262
  .replace(/[^\w\s]/g, ' ')
318
263
  .split(/\s+/)
@@ -339,21 +284,17 @@ export class GlobalKnowledge {
339
284
  for (const row of ftsMatches) {
340
285
  results.push({
341
286
  entry: this.rowToEntry(row),
342
- score: Math.min(0.9, 1 / (1 - row.rank)), // BM25 score normalization
287
+ score: Math.min(0.9, 1 / (1 - row.rank)),
343
288
  matchType: 'similar',
344
289
  });
345
290
  }
346
291
  }
347
292
  catch (e) {
348
- // FTS query might fail with special characters
349
293
  }
350
294
  }
351
295
  }
352
296
  return results;
353
297
  }
354
- /**
355
- * Mark a solution as used (increases its ranking).
356
- */
357
298
  async markUsed(id) {
358
299
  await this.init();
359
300
  if (!this.db)
@@ -366,9 +307,6 @@ export class GlobalKnowledge {
366
307
  `);
367
308
  stmt.run(new Date().toISOString(), id);
368
309
  }
369
- /**
370
- * Update effectiveness rating after user feedback.
371
- */
372
310
  async updateEffectiveness(id, effectiveness) {
373
311
  await this.init();
374
312
  if (!this.db)
@@ -380,9 +318,6 @@ export class GlobalKnowledge {
380
318
  `);
381
319
  stmt.run(Math.max(1, Math.min(10, effectiveness)), id);
382
320
  }
383
- /**
384
- * Get statistics about the knowledge base.
385
- */
386
321
  async getStats() {
387
322
  await this.init();
388
323
  if (!this.db) {
@@ -409,7 +344,7 @@ export class GlobalKnowledge {
409
344
  return {
410
345
  totalEntries: total.count,
411
346
  topProjectTypes: projectTypes,
412
- topTags: [], // TODO: Parse JSON tags and aggregate
347
+ topTags: [],
413
348
  averageEffectiveness: avg.avg || 0,
414
349
  };
415
350
  }
@@ -430,9 +365,6 @@ export class GlobalKnowledge {
430
365
  };
431
366
  }
432
367
  }
433
- // ============================================================================
434
- // Convenience Functions
435
- // ============================================================================
436
368
  let globalInstance = null;
437
369
  async function getGlobalKnowledge() {
438
370
  if (!globalInstance) {
@@ -441,18 +373,10 @@ async function getGlobalKnowledge() {
441
373
  }
442
374
  return globalInstance;
443
375
  }
444
- /**
445
- * Record a troubleshooting experience.
446
- * Call this when an error is successfully resolved.
447
- */
448
376
  export async function recordTroubleshooting(entry) {
449
377
  const knowledge = await getGlobalKnowledge();
450
378
  return knowledge.record(entry);
451
379
  }
452
- /**
453
- * Search for solutions to a similar error.
454
- * Call this when encountering an error during execution.
455
- */
456
380
  export async function searchTroubleshooting(errorMessage, options) {
457
381
  const knowledge = await getGlobalKnowledge();
458
382
  return knowledge.search(errorMessage, options);
@@ -247,7 +247,6 @@ export async function acquireLoopOperatorLock(input) {
247
247
  }
248
248
  }
249
249
  catch {
250
- // Overwrite unreadable or partial lock files.
251
250
  }
252
251
  }
253
252
  await writeFile(lockPath, `${JSON.stringify({
@@ -277,7 +276,6 @@ export async function refreshLoopOperatorLock(input) {
277
276
  }, null, 2)}\n`, 'utf-8');
278
277
  }
279
278
  catch {
280
- // Ignore broken lock refresh attempts.
281
279
  }
282
280
  }
283
281
  export async function releaseLoopOperatorLock(input) {
@@ -294,7 +292,6 @@ export async function releaseLoopOperatorLock(input) {
294
292
  await rm(lockPath, { force: true });
295
293
  }
296
294
  catch {
297
- // Best-effort cleanup only.
298
295
  }
299
296
  }
300
297
  export async function requestLoopStop(input) {