maskweaver 0.9.4 → 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 (227) hide show
  1. package/dist/cli/doctor.js +5 -21
  2. package/dist/cli/install.d.ts +0 -8
  3. package/dist/cli/install.js +0 -39
  4. package/dist/context/config.d.ts +0 -22
  5. package/dist/context/config.js +0 -28
  6. package/dist/context/feature.d.ts +0 -39
  7. package/dist/context/feature.js +0 -77
  8. package/dist/context/files.d.ts +0 -13
  9. package/dist/context/files.js +1 -24
  10. package/dist/context/index.d.ts +0 -7
  11. package/dist/context/index.js +0 -12
  12. package/dist/context/project.d.ts +0 -21
  13. package/dist/context/project.js +0 -30
  14. package/dist/context/types.d.ts +0 -48
  15. package/dist/context/types.js +0 -12
  16. package/dist/context/utils.d.ts +0 -18
  17. package/dist/context/utils.js +0 -27
  18. package/dist/core/engine/promptBuilder.d.ts +0 -17
  19. package/dist/core/engine/promptBuilder.js +0 -28
  20. package/dist/core/index.d.ts +0 -6
  21. package/dist/core/index.js +0 -9
  22. package/dist/core/loader/MaskLoader.d.ts +0 -23
  23. package/dist/core/loader/MaskLoader.js +0 -29
  24. package/dist/core/schema/types.d.ts +0 -47
  25. package/dist/core/schema/types.js +0 -6
  26. package/dist/core/schema/validator.d.ts +0 -14
  27. package/dist/core/schema/validator.js +0 -18
  28. package/dist/i18n/index.d.ts +0 -18
  29. package/dist/i18n/index.js +4 -23
  30. package/dist/index.d.ts +0 -8
  31. package/dist/index.js +0 -8
  32. package/dist/lib.d.ts +0 -5
  33. package/dist/lib.js +0 -12
  34. package/dist/memory/chunking.d.ts +0 -22
  35. package/dist/memory/chunking.js +2 -37
  36. package/dist/memory/core.d.ts +0 -29
  37. package/dist/memory/core.js +1 -52
  38. package/dist/memory/index.d.ts +0 -5
  39. package/dist/memory/index.js +0 -10
  40. package/dist/memory/indexer.d.ts +0 -21
  41. package/dist/memory/indexer.js +0 -44
  42. package/dist/memory/providers/examples.d.ts +0 -5
  43. package/dist/memory/providers/examples.js +4 -64
  44. package/dist/memory/providers/factory.d.ts +0 -44
  45. package/dist/memory/providers/factory.js +0 -46
  46. package/dist/memory/providers/index.d.ts +0 -26
  47. package/dist/memory/providers/index.js +0 -28
  48. package/dist/memory/providers/ollama.d.ts +0 -6
  49. package/dist/memory/providers/ollama.js +1 -8
  50. package/dist/memory/providers/openai.d.ts +0 -6
  51. package/dist/memory/providers/openai.js +1 -8
  52. package/dist/memory/providers/openrouter.d.ts +0 -6
  53. package/dist/memory/providers/openrouter.js +0 -8
  54. package/dist/memory/providers/text-only.d.ts +0 -13
  55. package/dist/memory/providers/text-only.js +0 -17
  56. package/dist/memory/providers/types.d.ts +0 -39
  57. package/dist/memory/providers/types.js +0 -7
  58. package/dist/memory/providers/voyage.d.ts +0 -22
  59. package/dist/memory/providers/voyage.js +1 -24
  60. package/dist/memory/search/hybrid.d.ts +0 -12
  61. package/dist/memory/search/hybrid.js +1 -22
  62. package/dist/memory/store/sqlite.d.ts +0 -72
  63. package/dist/memory/store/sqlite.js +4 -127
  64. package/dist/plugin/config/index.d.ts +0 -112
  65. package/dist/plugin/config/index.js +0 -115
  66. package/dist/plugin/index.d.ts +0 -13
  67. package/dist/plugin/index.js +1 -123
  68. package/dist/plugin/tools/command-registry.d.ts +0 -6
  69. package/dist/plugin/tools/command-registry.js +0 -14
  70. package/dist/plugin/tools/context.d.ts +0 -12
  71. package/dist/plugin/tools/context.js +0 -58
  72. package/dist/plugin/tools/maskSave.d.ts +0 -3
  73. package/dist/plugin/tools/maskSave.js +0 -3
  74. package/dist/plugin/tools/memoryGet.d.ts +0 -3
  75. package/dist/plugin/tools/memoryGet.js +0 -3
  76. package/dist/plugin/tools/memoryIndexer.d.ts +0 -3
  77. package/dist/plugin/tools/memoryIndexer.js +0 -10
  78. package/dist/plugin/tools/memorySearch.d.ts +0 -31
  79. package/dist/plugin/tools/memorySearch.js +0 -79
  80. package/dist/plugin/tools/memoryWrite.d.ts +0 -8
  81. package/dist/plugin/tools/memoryWrite.js +0 -32
  82. package/dist/plugin/tools/retrospect.d.ts +0 -3
  83. package/dist/plugin/tools/retrospect.js +0 -3
  84. package/dist/plugin/tools/slashcommand.d.ts +0 -11
  85. package/dist/plugin/tools/slashcommand.js +0 -38
  86. package/dist/plugin/tools/squad.d.ts +0 -12
  87. package/dist/plugin/tools/squad.js +11 -83
  88. package/dist/plugin/tools/weave.d.ts +0 -6
  89. package/dist/plugin/tools/weave.js +0 -78
  90. package/dist/plugin/types.d.ts +0 -20
  91. package/dist/plugin/types.js +0 -7
  92. package/dist/retrospect/index.d.ts +0 -7
  93. package/dist/retrospect/index.js +0 -9
  94. package/dist/retrospect/mask-save.d.ts +0 -12
  95. package/dist/retrospect/mask-save.js +1 -80
  96. package/dist/retrospect/retrospect.d.ts +0 -18
  97. package/dist/retrospect/retrospect.js +0 -63
  98. package/dist/retrospect/strategies/base.d.ts +0 -15
  99. package/dist/retrospect/strategies/base.js +0 -7
  100. package/dist/retrospect/strategies/deep.d.ts +0 -12
  101. package/dist/retrospect/strategies/deep.js +0 -24
  102. package/dist/retrospect/strategies/index.d.ts +0 -12
  103. package/dist/retrospect/strategies/index.js +0 -12
  104. package/dist/retrospect/strategies/quick.d.ts +0 -12
  105. package/dist/retrospect/strategies/quick.js +0 -19
  106. package/dist/retrospect/strategies/standard.d.ts +0 -12
  107. package/dist/retrospect/strategies/standard.js +0 -15
  108. package/dist/retrospect/types.d.ts +0 -7
  109. package/dist/retrospect/types.js +0 -7
  110. package/dist/shared/config.d.ts +0 -105
  111. package/dist/shared/config.js +0 -33
  112. package/dist/shared/errors.d.ts +0 -18
  113. package/dist/shared/errors.js +0 -19
  114. package/dist/shared/generate-agents.d.ts +0 -69
  115. package/dist/shared/generate-agents.js +2 -86
  116. package/dist/shared/image.d.ts +0 -67
  117. package/dist/shared/image.js +6 -104
  118. package/dist/shared/index.d.ts +0 -5
  119. package/dist/shared/index.js +0 -7
  120. package/dist/shared/model-registry.d.ts +0 -72
  121. package/dist/shared/model-registry.js +5 -95
  122. package/dist/shared/types.d.ts +0 -15
  123. package/dist/shared/types.js +0 -3
  124. package/dist/shared-context/dag.d.ts +0 -105
  125. package/dist/shared-context/dag.js +3 -114
  126. package/dist/shared-context/index.d.ts +0 -5
  127. package/dist/shared-context/index.js +0 -15
  128. package/dist/shared-context/logger.d.ts +0 -37
  129. package/dist/shared-context/logger.js +0 -41
  130. package/dist/shared-context/parallel-executor.d.ts +0 -54
  131. package/dist/shared-context/parallel-executor.js +4 -56
  132. package/dist/shared-context/session.d.ts +0 -56
  133. package/dist/shared-context/session.js +0 -47
  134. package/dist/shared-context/squad.d.ts +0 -68
  135. package/dist/shared-context/squad.js +0 -63
  136. package/dist/shared-context/storage.d.ts +0 -132
  137. package/dist/shared-context/storage.js +0 -116
  138. package/dist/shared-context/task.d.ts +0 -120
  139. package/dist/shared-context/task.js +0 -152
  140. package/dist/shared-context/test/dag.test.js +9 -14
  141. package/dist/shared-context/test/logger.test.d.ts +0 -8
  142. package/dist/shared-context/test/logger.test.js +0 -52
  143. package/dist/shared-context/test/session.test.d.ts +0 -7
  144. package/dist/shared-context/test/session.test.js +0 -63
  145. package/dist/shared-context/test/squad.test.d.ts +0 -10
  146. package/dist/shared-context/test/squad.test.js +2 -68
  147. package/dist/shared-context/test/storage.test.d.ts +0 -8
  148. package/dist/shared-context/test/storage.test.js +0 -68
  149. package/dist/shared-context/test/task.test.d.ts +0 -7
  150. package/dist/shared-context/test/task.test.js +0 -54
  151. package/dist/shared-context/test/watchdog.test.d.ts +0 -7
  152. package/dist/shared-context/test/watchdog.test.js +3 -58
  153. package/dist/shared-context/types.d.ts +0 -215
  154. package/dist/shared-context/types.js +0 -125
  155. package/dist/shared-context/watchdog.d.ts +0 -127
  156. package/dist/shared-context/watchdog.js +0 -148
  157. package/dist/shared-context/worktree.d.ts +0 -68
  158. package/dist/shared-context/worktree.js +2 -34
  159. package/dist/verify/budget.d.ts +0 -29
  160. package/dist/verify/budget.js +0 -34
  161. package/dist/verify/critical-files.d.ts +0 -17
  162. package/dist/verify/critical-files.js +0 -37
  163. package/dist/verify/escalation.d.ts +0 -20
  164. package/dist/verify/escalation.js +0 -22
  165. package/dist/verify/index.d.ts +0 -5
  166. package/dist/verify/index.js +0 -11
  167. package/dist/verify/prompts.d.ts +0 -20
  168. package/dist/verify/prompts.js +0 -20
  169. package/dist/verify/types.d.ts +0 -26
  170. package/dist/verify/types.js +1 -12
  171. package/dist/verify/verifier.d.ts +0 -29
  172. package/dist/verify/verifier.js +0 -54
  173. package/dist/version.d.ts +1 -16
  174. package/dist/version.js +1 -16
  175. package/dist/weave/bridge.d.ts +0 -35
  176. package/dist/weave/bridge.js +0 -51
  177. package/dist/weave/environment/detector.d.ts +0 -6
  178. package/dist/weave/environment/detector.js +4 -45
  179. package/dist/weave/environment/index.d.ts +0 -19
  180. package/dist/weave/environment/index.js +1 -39
  181. package/dist/weave/environment/issues.d.ts +0 -35
  182. package/dist/weave/environment/issues.js +0 -59
  183. package/dist/weave/git.d.ts +0 -8
  184. package/dist/weave/git.js +0 -8
  185. package/dist/weave/index.d.ts +0 -13
  186. package/dist/weave/index.js +2 -28
  187. package/dist/weave/knowledge/global.d.ts +0 -39
  188. package/dist/weave/knowledge/global.js +2 -78
  189. package/dist/weave/loop.js +0 -3
  190. package/dist/weave/orchestrator.d.ts +0 -69
  191. package/dist/weave/orchestrator.js +1 -101
  192. package/dist/weave/phase-manager.d.ts +0 -64
  193. package/dist/weave/phase-manager.js +0 -89
  194. package/dist/weave/security/secret-scan.d.ts +0 -14
  195. package/dist/weave/security/secret-scan.js +0 -19
  196. package/dist/weave/stages/build.js +0 -15
  197. package/dist/weave/stages/execute.d.ts +0 -42
  198. package/dist/weave/stages/execute.js +4 -86
  199. package/dist/weave/stages/handoff.d.ts +0 -7
  200. package/dist/weave/stages/handoff.js +0 -43
  201. package/dist/weave/stages/index.d.ts +0 -3
  202. package/dist/weave/stages/index.js +0 -3
  203. package/dist/weave/stages/intake.d.ts +0 -8
  204. package/dist/weave/stages/intake.js +5 -65
  205. package/dist/weave/stages/map.d.ts +0 -1
  206. package/dist/weave/stages/openspec.d.ts +0 -1
  207. package/dist/weave/stages/plan.d.ts +0 -11
  208. package/dist/weave/stages/plan.js +1 -53
  209. package/dist/weave/stages/refine.d.ts +0 -7
  210. package/dist/weave/stages/refine.js +0 -7
  211. package/dist/weave/stages/research.d.ts +0 -6
  212. package/dist/weave/stages/research.js +0 -6
  213. package/dist/weave/stages/spec.d.ts +0 -12
  214. package/dist/weave/stages/spec.js +0 -17
  215. package/dist/weave/types.d.ts +0 -20
  216. package/dist/weave/types.js +0 -5
  217. package/dist/weave/verification/commands.d.ts +0 -12
  218. package/dist/weave/verification/commands.js +0 -19
  219. package/dist/weave/verification/index.d.ts +0 -6
  220. package/dist/weave/verification/index.js +1 -19
  221. package/dist/weave/verification/playwright.d.ts +0 -47
  222. package/dist/weave/verification/playwright.js +1 -90
  223. package/dist/weave/worktree.d.ts +0 -16
  224. package/dist/weave/worktree.js +0 -23
  225. package/dist/weave/yaml-repair.d.ts +0 -39
  226. package/dist/weave/yaml-repair.js +13 -116
  227. package/package.json +1 -1
@@ -1,13 +1,4 @@
1
- /**
2
- * Critical File Detection
3
- *
4
- * Identifies files that require extra scrutiny
5
- */
6
- /**
7
- * Default critical file patterns
8
- */
9
1
  export const DEFAULT_CRITICAL_PATTERNS = [
10
- // Authentication and authorization
11
2
  "**/auth/**",
12
3
  "**/authentication/**",
13
4
  "**/authorization/**",
@@ -15,70 +6,53 @@ export const DEFAULT_CRITICAL_PATTERNS = [
15
6
  "**/session/**",
16
7
  "**/jwt/**",
17
8
  "**/oauth/**",
18
- // Payment and billing
19
9
  "**/payment/**",
20
10
  "**/billing/**",
21
11
  "**/checkout/**",
22
12
  "**/stripe/**",
23
13
  "**/paypal/**",
24
- // Security-sensitive
25
14
  "**/security/**",
26
15
  "**/crypto/**",
27
16
  "**/encryption/**",
28
17
  "**/password/**",
29
- // Credentials and secrets
30
18
  "**/.env",
31
19
  "**/.env.*",
32
20
  "**/credentials.*",
33
21
  "**/secrets.*",
34
22
  "**/config/production.*",
35
23
  "**/keys/**",
36
- // Database migrations
37
24
  "**/migrations/**",
38
25
  "**/migrate/**",
39
- // Infrastructure
40
26
  "**/deploy/**",
41
27
  "**/deployment/**",
42
28
  "**/infrastructure/**",
43
- // Admin and privileged operations
44
29
  "**/admin/**",
45
30
  "**/superuser/**",
46
31
  "**/sudo/**",
47
32
  ];
48
- /**
49
- * Simple glob pattern matcher
50
- * Supports: * (any chars except /), ** (any path segments), ? (single char except /)
51
- */
52
33
  function matchGlob(pattern, path) {
53
- // Normalize paths
54
34
  const p = path.replace(/\\/g, "/");
55
35
  const pat = pattern.replace(/\\/g, "/");
56
- // Build regex character by character
57
36
  let r = "";
58
37
  let i = 0;
59
38
  while (i < pat.length) {
60
39
  if (pat.substring(i, i + 3) === "**/") {
61
- // **/ means optional directory prefix
62
40
  r += "(?:.*/)?";
63
41
  i += 3;
64
42
  }
65
43
  else if (pat.substring(i, i + 2) === "**") {
66
- // ** means any characters
67
44
  r += ".*";
68
45
  i += 2;
69
46
  }
70
47
  else if (pat[i] === "*") {
71
- // * means any non-slash characters
72
48
  r += "[^/]*";
73
49
  i++;
74
50
  }
75
51
  else if (pat[i] === "?") {
76
- // ? means one non-slash character
77
52
  r += "[^/]";
78
53
  i++;
79
54
  }
80
55
  else {
81
- // Regular character - escape if special regex char
82
56
  const ch = pat[i];
83
57
  if (".+^${}()|[]\\".includes(ch)) {
84
58
  r += "\\" + ch;
@@ -89,31 +63,20 @@ function matchGlob(pattern, path) {
89
63
  i++;
90
64
  }
91
65
  }
92
- // Anchor and compile
93
66
  const regex = new RegExp("^" + r + "$");
94
67
  return regex.test(p);
95
68
  }
96
- /**
97
- * Check if a file path matches critical file patterns
98
- */
99
69
  export function isCriticalFile(filePath, patterns = DEFAULT_CRITICAL_PATTERNS) {
100
70
  return patterns.some(pattern => matchGlob(pattern, filePath));
101
71
  }
102
- /**
103
- * Get matched critical patterns for a file
104
- */
105
72
  export function getMatchedPatterns(filePath, patterns = DEFAULT_CRITICAL_PATTERNS) {
106
73
  return patterns.filter(pattern => matchGlob(pattern, filePath));
107
74
  }
108
- /**
109
- * Categorize criticality level
110
- */
111
75
  export function getCriticalityLevel(filePath) {
112
76
  const matched = getMatchedPatterns(filePath);
113
77
  if (matched.length === 0) {
114
78
  return "normal";
115
79
  }
116
- // Check for highly critical patterns
117
80
  const highCritical = [
118
81
  "**/.env",
119
82
  "**/credentials.*",
@@ -1,26 +1,6 @@
1
- /**
2
- * Escalation System
3
- *
4
- * Handles escalation to higher-tier reviewers when issues are found
5
- */
6
1
  import type { ReviewerTier, VerifyConfig, VerifyResult } from "./types.js";
7
- /**
8
- * Determine if escalation is needed based on result and config
9
- */
10
2
  export declare function shouldEscalate(result: VerifyResult, config: VerifyConfig): boolean;
11
- /**
12
- * Get next reviewer in escalation chain
13
- */
14
3
  export declare function getNextReviewer(current: ReviewerTier, reason: "warn" | "fail", config: VerifyConfig): ReviewerTier | null;
15
- /**
16
- * Get full escalation path from current reviewer
17
- */
18
4
  export declare function getEscalationPath(from: ReviewerTier, config: VerifyConfig): ReviewerTier[];
19
- /**
20
- * Check if reviewer can escalate further
21
- */
22
5
  export declare function canEscalate(reviewer: ReviewerTier): boolean;
23
- /**
24
- * Get escalation reason message
25
- */
26
6
  export declare function getEscalationReason(result: VerifyResult, fromReviewer: ReviewerTier, toReviewer: ReviewerTier): string;
@@ -1,12 +1,4 @@
1
- /**
2
- * Escalation System
3
- *
4
- * Handles escalation to higher-tier reviewers when issues are found
5
- */
6
1
  import { ESCALATION_CHAIN } from "./types.js";
7
- /**
8
- * Determine if escalation is needed based on result and config
9
- */
10
2
  export function shouldEscalate(result, config) {
11
3
  if (result === "pass") {
12
4
  return false;
@@ -19,23 +11,15 @@ export function shouldEscalate(result, config) {
19
11
  }
20
12
  return false;
21
13
  }
22
- /**
23
- * Get next reviewer in escalation chain
24
- */
25
14
  export function getNextReviewer(current, reason, config) {
26
- // Check if config specifies explicit escalation target
27
15
  if (reason === "warn" && config.escalation.onWarn) {
28
16
  return config.escalation.onWarn;
29
17
  }
30
18
  if (reason === "fail" && config.escalation.onFail) {
31
19
  return config.escalation.onFail;
32
20
  }
33
- // Fall back to default escalation chain
34
21
  return ESCALATION_CHAIN[current];
35
22
  }
36
- /**
37
- * Get full escalation path from current reviewer
38
- */
39
23
  export function getEscalationPath(from, config) {
40
24
  const path = [from];
41
25
  let current = from;
@@ -48,15 +32,9 @@ export function getEscalationPath(from, config) {
48
32
  }
49
33
  return path;
50
34
  }
51
- /**
52
- * Check if reviewer can escalate further
53
- */
54
35
  export function canEscalate(reviewer) {
55
36
  return ESCALATION_CHAIN[reviewer] !== null;
56
37
  }
57
- /**
58
- * Get escalation reason message
59
- */
60
38
  export function getEscalationReason(result, fromReviewer, toReviewer) {
61
39
  const reasonMap = {
62
40
  pass: "No escalation needed",
@@ -1,8 +1,3 @@
1
- /**
2
- * @maskweaver/verify
3
- *
4
- * Complete verification system for code quality checks
5
- */
6
1
  export type { VerifyMode, ReviewerTier, VerifyTrigger, VerifyResult, VerifyConfig, VerifyRequest, VerifyResponse, VerifyIssue, BudgetState, } from "./types.js";
7
2
  export { COST_RATES, ESCALATION_CHAIN, } from "./types.js";
8
3
  export { Verifier, createVerifier, quickVerify, } from "./verifier.js";
@@ -1,17 +1,6 @@
1
- /**
2
- * @maskweaver/verify
3
- *
4
- * Complete verification system for code quality checks
5
- */
6
- // Constants
7
1
  export { COST_RATES, ESCALATION_CHAIN, } from "./types.js";
8
- // Verifier
9
2
  export { Verifier, createVerifier, quickVerify, } from "./verifier.js";
10
- // Budget tracking
11
3
  export { BudgetTracker, createBudgetTracker, } from "./budget.js";
12
- // Escalation
13
4
  export { shouldEscalate, getNextReviewer, getEscalationPath, canEscalate, getEscalationReason, } from "./escalation.js";
14
- // Critical file detection
15
5
  export { isCriticalFile, getMatchedPatterns, getCriticalityLevel, DEFAULT_CRITICAL_PATTERNS, } from "./critical-files.js";
16
- // Prompts
17
6
  export { getPromptForReviewer, fillPrompt, FLASH_REVIEW_PROMPT, HUMAN_REVIEW_PROMPT, PREMIUM_REVIEW_PROMPT, } from "./prompts.js";
@@ -1,26 +1,6 @@
1
- /**
2
- * Reviewer Prompts
3
- *
4
- * Different review prompts for each reviewer tier
5
- */
6
1
  import type { ReviewerTier } from "./types.js";
7
- /**
8
- * Flash reviewer prompt - Quick checks only
9
- */
10
2
  export declare const FLASH_REVIEW_PROMPT = "You are a fast code reviewer. Perform a quick check for:\n\n1. **Syntax errors** - obvious compilation/parsing issues\n2. **Critical bugs** - null pointer dereferences, infinite loops, etc.\n3. **Security vulnerabilities** - SQL injection, XSS, hardcoded credentials\n4. **Missing error handling** - unhandled exceptions, missing validation\n\nKeep it quick and focused. Only flag clear, serious issues.\n\nRespond in JSON format:\n{\n \"result\": \"pass\" | \"warn\" | \"fail\",\n \"summary\": \"Brief overall assessment\",\n \"issues\": [\n {\n \"severity\": \"error\" | \"warning\" | \"info\",\n \"message\": \"Description of the issue\",\n \"line\": 42,\n \"suggestion\": \"How to fix it\"\n }\n ],\n \"suggestions\": [\"Optional improvement suggestions\"]\n}\n\nResult guide:\n- \"pass\": No issues found\n- \"warn\": Minor issues or potential concerns\n- \"fail\": Critical issues that must be fixed\n\nCode to review:\n\n```\n{{CONTENT}}\n```\n\n{{CONTEXT}}";
11
- /**
12
- * Human reviewer prompt - Standard review
13
- */
14
3
  export declare const HUMAN_REVIEW_PROMPT = "You are an experienced code reviewer. Perform a thorough review:\n\n1. **Code quality** - readability, maintainability, style\n2. **Logic correctness** - algorithm correctness, edge cases\n3. **Best practices** - design patterns, SOLID principles\n4. **Error handling** - comprehensive error handling and validation\n5. **Security** - authentication, authorization, data validation\n6. **Performance** - obvious performance issues\n7. **Testing** - testability, missing test cases\n\nProvide constructive feedback with specific suggestions.\n\nRespond in JSON format:\n{\n \"result\": \"pass\" | \"warn\" | \"fail\",\n \"summary\": \"Comprehensive review summary\",\n \"issues\": [\n {\n \"severity\": \"error\" | \"warning\" | \"info\",\n \"message\": \"Detailed issue description\",\n \"line\": 42,\n \"suggestion\": \"Specific fix or improvement\"\n }\n ],\n \"suggestions\": [\"General improvement suggestions\"]\n}\n\nResult guide:\n- \"pass\": Code meets quality standards\n- \"warn\": Has issues but acceptable with improvements\n- \"fail\": Significant issues requiring fixes\n\nCode to review:\n\n```\n{{CONTENT}}\n```\n\n{{CONTEXT}}";
15
- /**
16
- * Premium reviewer prompt - Deep analysis
17
- */
18
4
  export declare const PREMIUM_REVIEW_PROMPT = "You are a senior architect and security expert. Perform a comprehensive, deep review:\n\n1. **Architecture** - system design, modularity, scalability\n2. **Security** - comprehensive security analysis (OWASP Top 10)\n3. **Performance** - algorithmic complexity, memory usage, bottlenecks\n4. **Maintainability** - long-term code health, technical debt\n5. **Reliability** - error recovery, fault tolerance, edge cases\n6. **Best practices** - industry standards, design patterns\n7. **Testing strategy** - test coverage, test quality\n8. **Documentation** - code clarity, comments, API documentation\n9. **Compliance** - licensing, regulatory requirements\n10. **Future-proofing** - extensibility, backward compatibility\n\nProvide expert-level analysis with architectural insights.\n\nRespond in JSON format:\n{\n \"result\": \"pass\" | \"warn\" | \"fail\",\n \"summary\": \"Expert architectural and security assessment\",\n \"issues\": [\n {\n \"severity\": \"error\" | \"warning\" | \"info\",\n \"message\": \"In-depth issue analysis\",\n \"line\": 42,\n \"suggestion\": \"Expert recommendation with rationale\"\n }\n ],\n \"suggestions\": [\"Strategic improvement recommendations\"]\n}\n\nResult guide:\n- \"pass\": Production-ready, meets enterprise standards\n- \"warn\": Acceptable but has architectural concerns\n- \"fail\": Requires significant redesign or security fixes\n\nCode to review:\n\n```\n{{CONTENT}}\n```\n\n{{CONTEXT}}";
19
- /**
20
- * Get prompt template for reviewer tier
21
- */
22
5
  export declare function getPromptForReviewer(reviewer: ReviewerTier): string;
23
- /**
24
- * Fill prompt template with content and context
25
- */
26
6
  export declare function fillPrompt(template: string, content: string, context?: string): string;
@@ -1,11 +1,3 @@
1
- /**
2
- * Reviewer Prompts
3
- *
4
- * Different review prompts for each reviewer tier
5
- */
6
- /**
7
- * Flash reviewer prompt - Quick checks only
8
- */
9
1
  export const FLASH_REVIEW_PROMPT = `You are a fast code reviewer. Perform a quick check for:
10
2
 
11
3
  1. **Syntax errors** - obvious compilation/parsing issues
@@ -42,9 +34,6 @@ Code to review:
42
34
  \`\`\`
43
35
 
44
36
  {{CONTEXT}}`;
45
- /**
46
- * Human reviewer prompt - Standard review
47
- */
48
37
  export const HUMAN_REVIEW_PROMPT = `You are an experienced code reviewer. Perform a thorough review:
49
38
 
50
39
  1. **Code quality** - readability, maintainability, style
@@ -84,9 +73,6 @@ Code to review:
84
73
  \`\`\`
85
74
 
86
75
  {{CONTEXT}}`;
87
- /**
88
- * Premium reviewer prompt - Deep analysis
89
- */
90
76
  export const PREMIUM_REVIEW_PROMPT = `You are a senior architect and security expert. Perform a comprehensive, deep review:
91
77
 
92
78
  1. **Architecture** - system design, modularity, scalability
@@ -129,9 +115,6 @@ Code to review:
129
115
  \`\`\`
130
116
 
131
117
  {{CONTEXT}}`;
132
- /**
133
- * Get prompt template for reviewer tier
134
- */
135
118
  export function getPromptForReviewer(reviewer) {
136
119
  switch (reviewer) {
137
120
  case "dummy-flash":
@@ -142,9 +125,6 @@ export function getPromptForReviewer(reviewer) {
142
125
  return PREMIUM_REVIEW_PROMPT;
143
126
  }
144
127
  }
145
- /**
146
- * Fill prompt template with content and context
147
- */
148
128
  export function fillPrompt(template, content, context) {
149
129
  let filled = template.replace("{{CONTENT}}", content);
150
130
  if (context) {
@@ -1,15 +1,7 @@
1
- /**
2
- * Verify Types
3
- *
4
- * Complete type definitions for the verification system
5
- */
6
1
  export type VerifyMode = "auto" | "manual" | "off";
7
2
  export type ReviewerTier = "dummy-flash" | "dummy-human" | "dummy-premium";
8
3
  export type VerifyTrigger = "onWrite" | "onTestFail" | "onRequest" | "onCriticalFile";
9
4
  export type VerifyResult = "pass" | "warn" | "fail";
10
- /**
11
- * Configuration for the verification system
12
- */
13
5
  export interface VerifyConfig {
14
6
  mode: VerifyMode;
15
7
  reviewer: ReviewerTier;
@@ -28,9 +20,6 @@ export interface VerifyConfig {
28
20
  };
29
21
  criticalFiles?: string[];
30
22
  }
31
- /**
32
- * Verification request
33
- */
34
23
  export interface VerifyRequest {
35
24
  trigger: VerifyTrigger;
36
25
  content: string;
@@ -38,9 +27,6 @@ export interface VerifyRequest {
38
27
  filePath?: string;
39
28
  previousResult?: VerifyResponse;
40
29
  }
41
- /**
42
- * Verification response
43
- */
44
30
  export interface VerifyResponse {
45
31
  result: VerifyResult;
46
32
  reviewer: ReviewerTier;
@@ -50,18 +36,12 @@ export interface VerifyResponse {
50
36
  cost: number;
51
37
  escalated: boolean;
52
38
  }
53
- /**
54
- * Individual verification issue
55
- */
56
39
  export interface VerifyIssue {
57
40
  severity: "error" | "warning" | "info";
58
41
  message: string;
59
42
  line?: number;
60
43
  suggestion?: string;
61
44
  }
62
- /**
63
- * Budget tracking state
64
- */
65
45
  export interface BudgetState {
66
46
  sessionTotal: number;
67
47
  sessionLimit: number;
@@ -69,11 +49,5 @@ export interface BudgetState {
69
49
  checkLimit: number;
70
50
  exceeded: boolean;
71
51
  }
72
- /**
73
- * Cost rates per reviewer tier (USD per 1K tokens)
74
- */
75
52
  export declare const COST_RATES: Record<ReviewerTier, number>;
76
- /**
77
- * Escalation chain configuration
78
- */
79
53
  export declare const ESCALATION_CHAIN: Record<ReviewerTier, ReviewerTier | null>;
@@ -1,21 +1,10 @@
1
- /**
2
- * Verify Types
3
- *
4
- * Complete type definitions for the verification system
5
- */
6
- /**
7
- * Cost rates per reviewer tier (USD per 1K tokens)
8
- */
9
1
  export const COST_RATES = {
10
2
  "dummy-flash": 0.0001,
11
3
  "dummy-human": 0.003,
12
4
  "dummy-premium": 0.015,
13
5
  };
14
- /**
15
- * Escalation chain configuration
16
- */
17
6
  export const ESCALATION_CHAIN = {
18
7
  "dummy-flash": "dummy-human",
19
8
  "dummy-human": "dummy-premium",
20
- "dummy-premium": null, // Cannot escalate further
9
+ "dummy-premium": null,
21
10
  };
@@ -1,44 +1,15 @@
1
- /**
2
- * Verifier System
3
- *
4
- * Main verification logic with reviewer orchestration
5
- */
6
1
  import type { VerifyConfig, VerifyRequest, VerifyResponse, ReviewerTier } from "./types.js";
7
- /**
8
- * Main Verifier class
9
- */
10
2
  export declare class Verifier {
11
3
  private config;
12
4
  private budgetTracker;
13
5
  constructor(config: VerifyConfig);
14
- /**
15
- * Verify code/content
16
- */
17
6
  verify(request: VerifyRequest): Promise<VerifyResponse>;
18
- /**
19
- * Verify with a specific reviewer
20
- */
21
7
  private verifyWithReviewer;
22
- /**
23
- * Determine starting reviewer based on trigger and file criticality
24
- */
25
8
  private getStartingReviewer;
26
- /**
27
- * Get budget state
28
- */
29
9
  getBudgetState(): import("./types.js").BudgetState;
30
- /**
31
- * Reset session budget
32
- */
33
10
  resetSessionBudget(): void;
34
11
  }
35
- /**
36
- * Create a verifier instance
37
- */
38
12
  export declare function createVerifier(config: VerifyConfig): Verifier;
39
- /**
40
- * Quick verify function for one-off checks
41
- */
42
13
  export declare function quickVerify(content: string, options?: {
43
14
  reviewer?: ReviewerTier;
44
15
  context?: string;
@@ -1,19 +1,9 @@
1
- /**
2
- * Verifier System
3
- *
4
- * Main verification logic with reviewer orchestration
5
- */
6
1
  import { createBudgetTracker } from "./budget.js";
7
2
  import { getPromptForReviewer, fillPrompt } from "./prompts.js";
8
3
  import { shouldEscalate, getNextReviewer } from "./escalation.js";
9
4
  import { isCriticalFile } from "./critical-files.js";
10
- /**
11
- * Parse reviewer response
12
- * In a real implementation, this would call the actual AI reviewer
13
- */
14
5
  function parseReviewerResponse(responseText) {
15
6
  try {
16
- // Try to parse as JSON
17
7
  const parsed = JSON.parse(responseText);
18
8
  return {
19
9
  result: parsed.result || "pass",
@@ -23,7 +13,6 @@ function parseReviewerResponse(responseText) {
23
13
  };
24
14
  }
25
15
  catch {
26
- // Fallback parsing logic
27
16
  return {
28
17
  result: "pass",
29
18
  summary: "Review completed (parsing fallback)",
@@ -32,14 +21,7 @@ function parseReviewerResponse(responseText) {
32
21
  };
33
22
  }
34
23
  }
35
- /**
36
- * Simulate calling a reviewer (placeholder for actual AI call)
37
- */
38
24
  async function callReviewer(prompt, reviewer) {
39
- // In real implementation, this would call:
40
- // - Task tool to spawn a dummy-{tier} agent
41
- // - Or direct API call to the appropriate model
42
- // For now, return a mock response
43
25
  return JSON.stringify({
44
26
  result: "pass",
45
27
  summary: `Mock review by ${reviewer}`,
@@ -47,9 +29,6 @@ async function callReviewer(prompt, reviewer) {
47
29
  suggestions: [],
48
30
  });
49
31
  }
50
- /**
51
- * Main Verifier class
52
- */
53
32
  export class Verifier {
54
33
  config;
55
34
  budgetTracker;
@@ -57,19 +36,12 @@ export class Verifier {
57
36
  this.config = config;
58
37
  this.budgetTracker = createBudgetTracker(config);
59
38
  }
60
- /**
61
- * Verify code/content
62
- */
63
39
  async verify(request) {
64
- // Check if critical file requires escalation
65
40
  const startingReviewer = this.getStartingReviewer(request);
66
- // Verify with initial reviewer
67
41
  let response = await this.verifyWithReviewer(request, startingReviewer);
68
- // Check if escalation is needed
69
42
  if (shouldEscalate(response.result, this.config)) {
70
43
  const nextReviewer = getNextReviewer(response.reviewer, response.result === "warn" ? "warn" : "fail", this.config);
71
44
  if (nextReviewer) {
72
- // Escalate
73
45
  const escalatedRequest = {
74
46
  ...request,
75
47
  previousResult: response,
@@ -82,11 +54,7 @@ export class Verifier {
82
54
  }
83
55
  return response;
84
56
  }
85
- /**
86
- * Verify with a specific reviewer
87
- */
88
57
  async verifyWithReviewer(request, reviewer) {
89
- // Check budget
90
58
  const estimatedCost = this.budgetTracker.estimateCost(request.content, request.context, reviewer);
91
59
  if (!this.budgetTracker.canProceed(estimatedCost)) {
92
60
  return {
@@ -102,14 +70,10 @@ export class Verifier {
102
70
  escalated: false,
103
71
  };
104
72
  }
105
- // Build prompt
106
73
  const promptTemplate = getPromptForReviewer(reviewer);
107
74
  const prompt = fillPrompt(promptTemplate, request.content, request.context);
108
- // Call reviewer
109
75
  const responseText = await callReviewer(prompt, reviewer);
110
- // Parse response
111
76
  const parsed = parseReviewerResponse(responseText);
112
- // Record actual cost
113
77
  this.budgetTracker.recordCost(estimatedCost);
114
78
  return {
115
79
  result: parsed.result,
@@ -121,43 +85,25 @@ export class Verifier {
121
85
  escalated: false,
122
86
  };
123
87
  }
124
- /**
125
- * Determine starting reviewer based on trigger and file criticality
126
- */
127
88
  getStartingReviewer(request) {
128
- // Critical files always start with human or premium
129
89
  if (request.filePath && isCriticalFile(request.filePath, this.config.criticalFiles)) {
130
90
  return this.config.escalation.onFail || "dummy-human";
131
91
  }
132
- // Test failures might need higher tier
133
92
  if (request.trigger === "onTestFail") {
134
93
  return this.config.escalation.onWarn || this.config.reviewer;
135
94
  }
136
- // Default to configured reviewer
137
95
  return this.config.reviewer;
138
96
  }
139
- /**
140
- * Get budget state
141
- */
142
97
  getBudgetState() {
143
98
  return this.budgetTracker.getState();
144
99
  }
145
- /**
146
- * Reset session budget
147
- */
148
100
  resetSessionBudget() {
149
101
  this.budgetTracker.resetSession();
150
102
  }
151
103
  }
152
- /**
153
- * Create a verifier instance
154
- */
155
104
  export function createVerifier(config) {
156
105
  return new Verifier(config);
157
106
  }
158
- /**
159
- * Quick verify function for one-off checks
160
- */
161
107
  export async function quickVerify(content, options) {
162
108
  const config = {
163
109
  mode: "manual",
package/dist/version.d.ts CHANGED
@@ -1,17 +1,2 @@
1
- /**
2
- * Maskweaver Version
3
- *
4
- * Single source of truth for the package version.
5
- * This value MUST match package.json "version" field.
6
- *
7
- * When bumping versions:
8
- * 1. Update package.json version
9
- * 2. Update this constant
10
- * 3. That's it — all other files import from here
11
- */
12
- export declare const VERSION = "0.9.4";
13
- /**
14
- * Returns a formatted version string for display.
15
- * @example "Maskweaver v0.7.29"
16
- */
1
+ export declare const VERSION = "0.9.5";
17
2
  export declare function getVersionString(): string;
package/dist/version.js CHANGED
@@ -1,19 +1,4 @@
1
- /**
2
- * Maskweaver Version
3
- *
4
- * Single source of truth for the package version.
5
- * This value MUST match package.json "version" field.
6
- *
7
- * When bumping versions:
8
- * 1. Update package.json version
9
- * 2. Update this constant
10
- * 3. That's it — all other files import from here
11
- */
12
- export const VERSION = '0.9.4';
13
- /**
14
- * Returns a formatted version string for display.
15
- * @example "Maskweaver v0.7.29"
16
- */
1
+ export const VERSION = '0.9.5';
17
2
  export function getVersionString() {
18
3
  return `Maskweaver v${VERSION}`;
19
4
  }
@@ -1,44 +1,12 @@
1
- /**
2
- * Weave-Squad Bridge
3
- *
4
- * Converts between Weave types (WeaveTask, WeavePhase) and Squad types (TaskState)
5
- * to enable parallel execution of Weave phase tasks through the Squad system.
6
- *
7
- * This is the missing link between the two systems:
8
- * - Weave: Project-level milestone tracking (YAML plans)
9
- * - Squad: Multi-agent parallel execution (JSON sessions)
10
- */
11
1
  import type { WeaveTask, PhaseExecutionPlan, TaskExecutionPlan } from './types.js';
12
2
  import type { TaskState, Priority } from '../shared-context/types.js';
13
- /**
14
- * Convert a WeaveTask to a TaskState for use in the Squad system.
15
- * Maps Weave concepts to Squad concepts:
16
- * - WeaveTask.id -> TaskState.taskId
17
- * - WeaveTask.status -> TaskState.status (with mapping)
18
- * - Complexity -> TaskState.priority
19
- */
20
3
  export declare function weaveTaskToSquadTask(task: WeaveTask, options: {
21
4
  assignee: string;
22
5
  priority?: Priority;
23
6
  dependencies?: string[];
24
7
  }): TaskState;
25
- /**
26
- * Map TaskComplexity to Squad Priority.
27
- */
28
8
  export declare function complexityToPriority(complexity: 'simple' | 'standard' | 'complex'): Priority;
29
- /**
30
- * Convert a PhaseExecutionPlan into a list of TaskStates for the Squad system.
31
- * Each TaskExecutionPlan determines the assignee (agent tier) and priority.
32
- */
33
9
  export declare function executionPlanToSquadTasks(plan: PhaseExecutionPlan): TaskState[];
34
- /**
35
- * Analyze a PhaseExecutionPlan for parallel execution opportunities.
36
- *
37
- * Uses task-level dependencies when available (`task.dependsOn`).
38
- * If there are no explicit dependencies, tasks are treated as fully parallel.
39
- *
40
- * Returns DAG analysis with wave grouping for parallel execution.
41
- */
42
10
  export declare function analyzeParallelOpportunities(plan: PhaseExecutionPlan): ParallelAnalysis;
43
11
  export interface WaveDetail {
44
12
  waveIndex: number;
@@ -52,7 +20,4 @@ export interface ParallelAnalysis {
52
20
  waves: WaveDetail[];
53
21
  criticalPath: string[];
54
22
  }
55
- /**
56
- * Format parallel analysis as markdown for the Mask Weaver.
57
- */
58
23
  export declare function formatParallelAnalysis(analysis: ParallelAnalysis): string;