@planu/cli 0.96.5 → 0.97.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 (215) hide show
  1. package/dist/cli/commands/install.d.ts.map +1 -1
  2. package/dist/cli/commands/install.js +3 -1
  3. package/dist/cli/commands/install.js.map +1 -1
  4. package/dist/config/compliance-profiles.json +62 -0
  5. package/dist/config/license-plans.json +18 -2
  6. package/dist/config/spec-templates/crud-rest-api/spec.md +35 -0
  7. package/dist/config/spec-templates/crud-rest-api/template.json +10 -0
  8. package/dist/config/spec-templates/email-notifications/spec.md +31 -0
  9. package/dist/config/spec-templates/email-notifications/template.json +10 -0
  10. package/dist/config/spec-templates/file-upload-s3/spec.md +31 -0
  11. package/dist/config/spec-templates/file-upload-s3/template.json +11 -0
  12. package/dist/config/spec-templates/jwt-auth/spec.md +35 -0
  13. package/dist/config/spec-templates/jwt-auth/template.json +10 -0
  14. package/dist/config/spec-templates/oauth-social-login/spec.md +31 -0
  15. package/dist/config/spec-templates/oauth-social-login/template.json +10 -0
  16. package/dist/config/spec-templates/rate-limiting/spec.md +31 -0
  17. package/dist/config/spec-templates/rate-limiting/template.json +10 -0
  18. package/dist/config/spec-templates/stripe-payments/spec.md +32 -0
  19. package/dist/config/spec-templates/stripe-payments/template.json +10 -0
  20. package/dist/config/spec-templates/webhook-system/spec.md +36 -0
  21. package/dist/config/spec-templates/webhook-system/template.json +10 -0
  22. package/dist/engine/agent-ready-exporter/formatters/devin.d.ts +7 -0
  23. package/dist/engine/agent-ready-exporter/formatters/devin.d.ts.map +1 -0
  24. package/dist/engine/agent-ready-exporter/formatters/devin.js +23 -0
  25. package/dist/engine/agent-ready-exporter/formatters/devin.js.map +1 -0
  26. package/dist/engine/agent-ready-exporter/formatters/generic.d.ts +7 -0
  27. package/dist/engine/agent-ready-exporter/formatters/generic.d.ts.map +1 -0
  28. package/dist/engine/agent-ready-exporter/formatters/generic.js +9 -0
  29. package/dist/engine/agent-ready-exporter/formatters/generic.js.map +1 -0
  30. package/dist/engine/agent-ready-exporter/formatters/kiro.d.ts +6 -0
  31. package/dist/engine/agent-ready-exporter/formatters/kiro.d.ts.map +1 -0
  32. package/dist/engine/agent-ready-exporter/formatters/kiro.js +34 -0
  33. package/dist/engine/agent-ready-exporter/formatters/kiro.js.map +1 -0
  34. package/dist/engine/agent-ready-exporter/formatters/swe-agent.d.ts +6 -0
  35. package/dist/engine/agent-ready-exporter/formatters/swe-agent.d.ts.map +1 -0
  36. package/dist/engine/agent-ready-exporter/formatters/swe-agent.js +40 -0
  37. package/dist/engine/agent-ready-exporter/formatters/swe-agent.js.map +1 -0
  38. package/dist/engine/agent-ready-exporter.d.ts +11 -0
  39. package/dist/engine/agent-ready-exporter.d.ts.map +1 -0
  40. package/dist/engine/agent-ready-exporter.js +86 -0
  41. package/dist/engine/agent-ready-exporter.js.map +1 -0
  42. package/dist/engine/compliance-checker.d.ts +19 -0
  43. package/dist/engine/compliance-checker.d.ts.map +1 -0
  44. package/dist/engine/compliance-checker.js +145 -0
  45. package/dist/engine/compliance-checker.js.map +1 -0
  46. package/dist/engine/generate-tests/generators/property-based-generator.d.ts +12 -0
  47. package/dist/engine/generate-tests/generators/property-based-generator.d.ts.map +1 -0
  48. package/dist/engine/generate-tests/generators/property-based-generator.js +159 -0
  49. package/dist/engine/generate-tests/generators/property-based-generator.js.map +1 -0
  50. package/dist/engine/jira-exporter.d.ts +39 -0
  51. package/dist/engine/jira-exporter.d.ts.map +1 -0
  52. package/dist/engine/jira-exporter.js +190 -0
  53. package/dist/engine/jira-exporter.js.map +1 -0
  54. package/dist/engine/linear-exporter.d.ts +32 -0
  55. package/dist/engine/linear-exporter.d.ts.map +1 -0
  56. package/dist/engine/linear-exporter.js +184 -0
  57. package/dist/engine/linear-exporter.js.map +1 -0
  58. package/dist/engine/property-test-generator.d.ts +14 -0
  59. package/dist/engine/property-test-generator.d.ts.map +1 -0
  60. package/dist/engine/property-test-generator.js +223 -0
  61. package/dist/engine/property-test-generator.js.map +1 -0
  62. package/dist/engine/skill-evaluator.d.ts +21 -0
  63. package/dist/engine/skill-evaluator.d.ts.map +1 -0
  64. package/dist/engine/skill-evaluator.js +126 -0
  65. package/dist/engine/skill-evaluator.js.map +1 -0
  66. package/dist/engine/spec-quality-scorer.d.ts +4 -0
  67. package/dist/engine/spec-quality-scorer.d.ts.map +1 -0
  68. package/dist/engine/spec-quality-scorer.js +334 -0
  69. package/dist/engine/spec-quality-scorer.js.map +1 -0
  70. package/dist/engine/spec-template-engine.d.ts +26 -0
  71. package/dist/engine/spec-template-engine.d.ts.map +1 -0
  72. package/dist/engine/spec-template-engine.js +127 -0
  73. package/dist/engine/spec-template-engine.js.map +1 -0
  74. package/dist/index.js +10 -0
  75. package/dist/index.js.map +1 -1
  76. package/dist/storage/compliance-store.d.ts +11 -0
  77. package/dist/storage/compliance-store.d.ts.map +1 -0
  78. package/dist/storage/compliance-store.js +30 -0
  79. package/dist/storage/compliance-store.js.map +1 -0
  80. package/dist/storage/jira-store.d.ts +30 -0
  81. package/dist/storage/jira-store.d.ts.map +1 -0
  82. package/dist/storage/jira-store.js +84 -0
  83. package/dist/storage/jira-store.js.map +1 -0
  84. package/dist/storage/linear-store.d.ts +30 -0
  85. package/dist/storage/linear-store.d.ts.map +1 -0
  86. package/dist/storage/linear-store.js +84 -0
  87. package/dist/storage/linear-store.js.map +1 -0
  88. package/dist/tools/check-readiness.d.ts.map +1 -1
  89. package/dist/tools/check-readiness.js +8 -2
  90. package/dist/tools/check-readiness.js.map +1 -1
  91. package/dist/tools/compliance-handler.d.ts +6 -0
  92. package/dist/tools/compliance-handler.d.ts.map +1 -0
  93. package/dist/tools/compliance-handler.js +99 -0
  94. package/dist/tools/compliance-handler.js.map +1 -0
  95. package/dist/tools/eval-skill-handler.d.ts +4 -0
  96. package/dist/tools/eval-skill-handler.d.ts.map +1 -0
  97. package/dist/tools/eval-skill-handler.js +26 -0
  98. package/dist/tools/eval-skill-handler.js.map +1 -0
  99. package/dist/tools/export-spec.d.ts.map +1 -1
  100. package/dist/tools/export-spec.js +42 -1
  101. package/dist/tools/export-spec.js.map +1 -1
  102. package/dist/tools/generate-tests/generators/property-based-generator.d.ts +11 -0
  103. package/dist/tools/generate-tests/generators/property-based-generator.d.ts.map +1 -0
  104. package/dist/tools/generate-tests/generators/property-based-generator.js +27 -0
  105. package/dist/tools/generate-tests/generators/property-based-generator.js.map +1 -0
  106. package/dist/tools/generate-tests/spec-dispatcher.d.ts +5 -0
  107. package/dist/tools/generate-tests/spec-dispatcher.d.ts.map +1 -1
  108. package/dist/tools/generate-tests/spec-dispatcher.js +18 -1
  109. package/dist/tools/generate-tests/spec-dispatcher.js.map +1 -1
  110. package/dist/tools/jira-sync-handler.d.ts +6 -0
  111. package/dist/tools/jira-sync-handler.d.ts.map +1 -0
  112. package/dist/tools/jira-sync-handler.js +220 -0
  113. package/dist/tools/jira-sync-handler.js.map +1 -0
  114. package/dist/tools/linear-sync-handler.d.ts +6 -0
  115. package/dist/tools/linear-sync-handler.d.ts.map +1 -0
  116. package/dist/tools/linear-sync-handler.js +212 -0
  117. package/dist/tools/linear-sync-handler.js.map +1 -0
  118. package/dist/tools/register-export-tools.d.ts.map +1 -1
  119. package/dist/tools/register-export-tools.js +10 -3
  120. package/dist/tools/register-export-tools.js.map +1 -1
  121. package/dist/tools/register-spec-314.d.ts +3 -0
  122. package/dist/tools/register-spec-314.d.ts.map +1 -0
  123. package/dist/tools/register-spec-314.js +38 -0
  124. package/dist/tools/register-spec-314.js.map +1 -0
  125. package/dist/tools/register-spec-316.d.ts +3 -0
  126. package/dist/tools/register-spec-316.d.ts.map +1 -0
  127. package/dist/tools/register-spec-316.js +71 -0
  128. package/dist/tools/register-spec-316.js.map +1 -0
  129. package/dist/tools/register-spec-317.d.ts +3 -0
  130. package/dist/tools/register-spec-317.d.ts.map +1 -0
  131. package/dist/tools/register-spec-317.js +158 -0
  132. package/dist/tools/register-spec-317.js.map +1 -0
  133. package/dist/tools/register-spec-319.d.ts +3 -0
  134. package/dist/tools/register-spec-319.d.ts.map +1 -0
  135. package/dist/tools/register-spec-319.js +59 -0
  136. package/dist/tools/register-spec-319.js.map +1 -0
  137. package/dist/tools/register-spec-320.d.ts +3 -0
  138. package/dist/tools/register-spec-320.d.ts.map +1 -0
  139. package/dist/tools/register-spec-320.js +60 -0
  140. package/dist/tools/register-spec-320.js.map +1 -0
  141. package/dist/tools/spec-marketplace-handler.d.ts +6 -0
  142. package/dist/tools/spec-marketplace-handler.d.ts.map +1 -0
  143. package/dist/tools/spec-marketplace-handler.js +113 -0
  144. package/dist/tools/spec-marketplace-handler.js.map +1 -0
  145. package/dist/tools/spec-quality-score-handler.d.ts +7 -0
  146. package/dist/tools/spec-quality-score-handler.d.ts.map +1 -0
  147. package/dist/tools/spec-quality-score-handler.js +106 -0
  148. package/dist/tools/spec-quality-score-handler.js.map +1 -0
  149. package/dist/tools/start-hooks/configure.d.ts +4 -0
  150. package/dist/tools/start-hooks/configure.d.ts.map +1 -0
  151. package/dist/tools/start-hooks/configure.js +122 -0
  152. package/dist/tools/start-hooks/configure.js.map +1 -0
  153. package/dist/tools/start-hooks/engine.d.ts +13 -0
  154. package/dist/tools/start-hooks/engine.d.ts.map +1 -0
  155. package/dist/tools/start-hooks/engine.js +314 -0
  156. package/dist/tools/start-hooks/engine.js.map +1 -0
  157. package/dist/tools/start-hooks.d.ts +2 -23
  158. package/dist/tools/start-hooks.d.ts.map +1 -1
  159. package/dist/tools/start-hooks.js +4 -516
  160. package/dist/tools/start-hooks.js.map +1 -1
  161. package/dist/types/agent-ready.d.ts +58 -0
  162. package/dist/types/agent-ready.d.ts.map +1 -0
  163. package/dist/types/agent-ready.js +3 -0
  164. package/dist/types/agent-ready.js.map +1 -0
  165. package/dist/types/compliance.d.ts +44 -0
  166. package/dist/types/compliance.d.ts.map +1 -0
  167. package/dist/types/compliance.js +3 -0
  168. package/dist/types/compliance.js.map +1 -0
  169. package/dist/types/export.d.ts +5 -1
  170. package/dist/types/export.d.ts.map +1 -1
  171. package/dist/types/export.js +1 -1
  172. package/dist/types/export.js.map +1 -1
  173. package/dist/types/index.d.ts +7 -0
  174. package/dist/types/index.d.ts.map +1 -1
  175. package/dist/types/index.js +7 -0
  176. package/dist/types/index.js.map +1 -1
  177. package/dist/types/jira-linear.d.ts +216 -0
  178. package/dist/types/jira-linear.d.ts.map +1 -0
  179. package/dist/types/jira-linear.js +3 -0
  180. package/dist/types/jira-linear.js.map +1 -0
  181. package/dist/types/property-testing.d.ts +50 -0
  182. package/dist/types/property-testing.d.ts.map +1 -0
  183. package/dist/types/property-testing.js +3 -0
  184. package/dist/types/property-testing.js.map +1 -0
  185. package/dist/types/skill-eval.d.ts +41 -0
  186. package/dist/types/skill-eval.d.ts.map +1 -0
  187. package/dist/types/skill-eval.js +3 -0
  188. package/dist/types/skill-eval.js.map +1 -0
  189. package/dist/types/spec-marketplace.d.ts +31 -0
  190. package/dist/types/spec-marketplace.d.ts.map +1 -0
  191. package/dist/types/spec-marketplace.js +3 -0
  192. package/dist/types/spec-marketplace.js.map +1 -0
  193. package/dist/types/spec-quality.d.ts +36 -0
  194. package/dist/types/spec-quality.d.ts.map +1 -0
  195. package/dist/types/spec-quality.js +3 -0
  196. package/dist/types/spec-quality.js.map +1 -0
  197. package/package.json +7 -2
  198. package/src/config/compliance-profiles.json +62 -0
  199. package/src/config/license-plans.json +18 -2
  200. package/src/config/spec-templates/crud-rest-api/spec.md +35 -0
  201. package/src/config/spec-templates/crud-rest-api/template.json +10 -0
  202. package/src/config/spec-templates/email-notifications/spec.md +31 -0
  203. package/src/config/spec-templates/email-notifications/template.json +10 -0
  204. package/src/config/spec-templates/file-upload-s3/spec.md +31 -0
  205. package/src/config/spec-templates/file-upload-s3/template.json +11 -0
  206. package/src/config/spec-templates/jwt-auth/spec.md +35 -0
  207. package/src/config/spec-templates/jwt-auth/template.json +10 -0
  208. package/src/config/spec-templates/oauth-social-login/spec.md +31 -0
  209. package/src/config/spec-templates/oauth-social-login/template.json +10 -0
  210. package/src/config/spec-templates/rate-limiting/spec.md +31 -0
  211. package/src/config/spec-templates/rate-limiting/template.json +10 -0
  212. package/src/config/spec-templates/stripe-payments/spec.md +32 -0
  213. package/src/config/spec-templates/stripe-payments/template.json +10 -0
  214. package/src/config/spec-templates/webhook-system/spec.md +36 -0
  215. package/src/config/spec-templates/webhook-system/template.json +10 -0
@@ -0,0 +1,59 @@
1
+ // tools/register-spec-319.ts — Registers compliance tools (SPEC-319)
2
+ import { z } from 'zod';
3
+ import { safeTracked } from './safe-handler.js';
4
+ import { handleCheckCompliance, handleConfigureCompliance } from './compliance-handler.js';
5
+ const FRAMEWORK_ENUM = ['gdpr', 'hipaa', 'pci-dss', 'soc2', 'ccpa'];
6
+ const frameworkSchema = z
7
+ .enum(FRAMEWORK_ENUM)
8
+ .describe('Compliance framework. Valid values: gdpr, hipaa, pci-dss, soc2, ccpa.');
9
+ export function registerComplianceTools(server) {
10
+ // -------------------------------------------------------------------------
11
+ // check_compliance — evaluate a spec's AC against compliance frameworks
12
+ // -------------------------------------------------------------------------
13
+ server.registerTool('check_compliance', {
14
+ description: 'Evaluate a spec\'s acceptance criteria against regulatory compliance requirements. ' +
15
+ 'Detects gaps for the specified frameworks (or auto-detects relevant frameworks from spec content). ' +
16
+ 'Supported frameworks: gdpr, hipaa, pci-dss, soc2, ccpa.',
17
+ inputSchema: {
18
+ specId: z
19
+ .string()
20
+ .min(1)
21
+ .max(500)
22
+ .describe('Spec ID to check (e.g. SPEC-042).'),
23
+ projectPath: z
24
+ .string()
25
+ .min(1)
26
+ .max(4096)
27
+ .describe('Absolute path to the project root.'),
28
+ frameworks: z
29
+ .array(frameworkSchema)
30
+ .optional()
31
+ .describe('Compliance frameworks to check. If omitted, auto-detects from spec content ' +
32
+ 'or uses project-level configuration. ' +
33
+ 'Valid values: gdpr, hipaa, pci-dss, soc2, ccpa.'),
34
+ },
35
+ annotations: { title: 'Check Compliance', readOnlyHint: true },
36
+ }, safeTracked('check_compliance', (args) => handleCheckCompliance(args)));
37
+ // -------------------------------------------------------------------------
38
+ // configure_compliance — set project-level compliance frameworks
39
+ // -------------------------------------------------------------------------
40
+ server.registerTool('configure_compliance', {
41
+ description: 'Configure project-level compliance frameworks. ' +
42
+ 'Once set, `check_compliance` uses these frameworks when none are specified. ' +
43
+ 'Supported frameworks: gdpr, hipaa, pci-dss, soc2, ccpa.',
44
+ inputSchema: {
45
+ projectPath: z
46
+ .string()
47
+ .min(1)
48
+ .max(4096)
49
+ .describe('Absolute path to the project root.'),
50
+ frameworks: z
51
+ .array(frameworkSchema)
52
+ .min(1)
53
+ .describe('Compliance frameworks to activate for this project. ' +
54
+ 'Valid values: gdpr, hipaa, pci-dss, soc2, ccpa.'),
55
+ },
56
+ annotations: { title: 'Configure Compliance', destructiveHint: false },
57
+ }, safeTracked('configure_compliance', (args) => handleConfigureCompliance(args)));
58
+ }
59
+ //# sourceMappingURL=register-spec-319.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-spec-319.js","sourceRoot":"","sources":["../../src/tools/register-spec-319.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAGrE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAG3F,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAE7E,MAAM,eAAe,GAAG,CAAC;KACtB,IAAI,CAAC,cAAc,CAAC;KACpB,QAAQ,CACP,uEAAuE,CACxE,CAAC;AAEJ,MAAM,UAAU,uBAAuB,CAAC,MAAiB;IACvD,4EAA4E;IAC5E,wEAAwE;IACxE,4EAA4E;IAE5E,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,WAAW,EACT,qFAAqF;YACrF,qGAAqG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IAAgC,CAAC,CAC5D,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerSpecMarketplaceTools(server: McpServer): void;
3
+ //# sourceMappingURL=register-spec-320.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-spec-320.d.ts","sourceRoot":"","sources":["../../src/tools/register-spec-320.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASzE,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiFpE"}
@@ -0,0 +1,60 @@
1
+ // tools/register-spec-320.ts — Registers spec marketplace tools (SPEC-320)
2
+ import { z } from 'zod';
3
+ import { safeTracked } from './safe-handler.js';
4
+ import { handleSearchSpecTemplates, handleApplySpecTemplate, handlePublishSpecTemplate, } from './spec-marketplace-handler.js';
5
+ export function registerSpecMarketplaceTools(server) {
6
+ // search_spec_templates — SPEC-320
7
+ server.registerTool('search_spec_templates', {
8
+ description: 'Search community spec templates by keyword or tag. Returns built-in templates (stripe-payments, oauth-social-login, crud-rest-api, file-upload-s3, jwt-auth, rate-limiting, email-notifications, webhook-system). Use apply_spec_template to instantiate one.',
9
+ annotations: { readOnlyHint: true },
10
+ inputSchema: {
11
+ projectPath: z.string().min(1).max(4096).describe('Absolute path to the project root.'),
12
+ query: z
13
+ .string()
14
+ .max(200)
15
+ .optional()
16
+ .describe('Optional keyword to search templates by name, description, or tags. Leave empty to list all templates.'),
17
+ },
18
+ }, safeTracked('search_spec_templates', async (args) => handleSearchSpecTemplates(args)));
19
+ // apply_spec_template — SPEC-320
20
+ server.registerTool('apply_spec_template', {
21
+ description: 'Instantiate a spec template by substituting variables into the template content. Returns the rendered spec.md content ready to pass to create_spec. Valid template names: stripe-payments, oauth-social-login, crud-rest-api, file-upload-s3, jwt-auth, rate-limiting, email-notifications, webhook-system.',
22
+ inputSchema: {
23
+ projectPath: z.string().min(1).max(4096).describe('Absolute path to the project root.'),
24
+ templateName: z
25
+ .string()
26
+ .min(1)
27
+ .max(100)
28
+ .describe('Name of the template to apply. Valid values: stripe-payments, oauth-social-login, crud-rest-api, file-upload-s3, jwt-auth, rate-limiting, email-notifications, webhook-system.'),
29
+ variables: z
30
+ .record(z.string(), z.string().max(500))
31
+ .describe('Key-value map of variable substitutions. Keys must match the template variable names (e.g. { "entity": "Product", "base_path": "/api/products" }).'),
32
+ },
33
+ }, safeTracked('apply_spec_template', async (args) => handleApplySpecTemplate({
34
+ projectPath: args.projectPath,
35
+ templateName: args.templateName,
36
+ variables: args.variables,
37
+ })));
38
+ // publish_spec_template — SPEC-320
39
+ server.registerTool('publish_spec_template', {
40
+ description: 'Publish an existing spec as a reusable template by extracting variable placeholders. Returns the template manifest JSON that can be shared with the team.',
41
+ annotations: { destructiveHint: false },
42
+ inputSchema: {
43
+ projectPath: z.string().min(1).max(4096).describe('Absolute path to the project root.'),
44
+ specId: z
45
+ .string()
46
+ .min(1)
47
+ .max(100)
48
+ .describe('ID of the spec to publish as a template (e.g. SPEC-042).'),
49
+ templateName: z
50
+ .string()
51
+ .min(1)
52
+ .max(100)
53
+ .describe('Slug name for the new template (e.g. stripe-payments-v2).'),
54
+ variables: z
55
+ .array(z.string().max(100))
56
+ .describe('List of variable names that will become template placeholders in the spec content (e.g. ["entity", "base_path"]).'),
57
+ },
58
+ }, safeTracked('publish_spec_template', async (args) => handlePublishSpecTemplate(args)));
59
+ }
60
+ //# sourceMappingURL=register-spec-320.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-spec-320.js","sourceRoot":"","sources":["../../src/tools/register-spec-320.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAG3E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,yBA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,CAAC;QACtB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;KAC1B,CAAC,CACH,CACF,CAAC;IAEF,mCAAmC;IACnC,MAAM,CAAC,YAAY,CACjB,uBAAuB,EACvB;QACE,WAAW,EACT,2JAA2J;QAC7J,WAAW,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE;QACvC,WAAW,EAAE;YACX,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,oCAAoC,CAAC;YACvF,MAAM,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,GAAG,CAAC,GAAG,CAAC;iBACR,QAAQ,CAAC,0DAA0D,CAAC;YACvE,YAAY,EAAE,CAAC;iBACZ,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,GAAG,CAAC,GAAG,CAAC;iBACR,QAAQ,CAAC,2DAA2D,CAAC;YACxE,SAAS,EAAE,CAAC;iBACT,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;iBAC1B,QAAQ,CACP,mHAAmH,CACpH;SACJ;KACF,EACD,WAAW,CAAC,uBAAuB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,CACtF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ToolResult } from '../types/index.js';
2
+ import type { SearchSpecTemplatesInput, ApplySpecTemplateInput, PublishSpecTemplateInput } from '../types/spec-marketplace.js';
3
+ export declare function handleSearchSpecTemplates(input: SearchSpecTemplatesInput): Promise<ToolResult>;
4
+ export declare function handleApplySpecTemplate(input: ApplySpecTemplateInput): Promise<ToolResult>;
5
+ export declare function handlePublishSpecTemplate(input: PublishSpecTemplateInput): Promise<ToolResult>;
6
+ //# sourceMappingURL=spec-marketplace-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-marketplace-handler.d.ts","sourceRoot":"","sources":["../../src/tools/spec-marketplace-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAetC,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,UAAU,CAAC,CA8BrB;AAMD,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,UAAU,CAAC,CAsCrB;AAMD,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,UAAU,CAAC,CAoCrB"}
@@ -0,0 +1,113 @@
1
+ // tools/spec-marketplace-handler.ts — MCP tool handlers for SPEC-320 Spec Marketplace
2
+ import { searchTemplates, applyTemplate, buildPublishManifest, } from '../engine/spec-template-engine.js';
3
+ import { getSpec } from '../storage/spec-store.js';
4
+ import { hashProjectPath } from '../storage/base-store.js';
5
+ import { readFile } from 'node:fs/promises';
6
+ import { existsSync } from 'node:fs';
7
+ // ---------------------------------------------------------------------------
8
+ // search_spec_templates
9
+ // ---------------------------------------------------------------------------
10
+ export async function handleSearchSpecTemplates(input) {
11
+ const query = input.query ?? '';
12
+ const templates = await searchTemplates(query);
13
+ if (templates.length === 0) {
14
+ const msg = query.length > 0
15
+ ? `No templates found matching "${query}". Try a different keyword.`
16
+ : 'No templates available.';
17
+ return { content: [{ type: 'text', text: msg }] };
18
+ }
19
+ const lines = [`Found ${String(templates.length)} template(s):`, ''];
20
+ for (const t of templates) {
21
+ const { manifest, source } = t;
22
+ const tags = manifest.tags.join(', ');
23
+ const varNames = manifest.variables.map((v) => v.name).join(', ');
24
+ lines.push(`### ${manifest.name} (${source})`);
25
+ lines.push(manifest.description);
26
+ lines.push(`**Tags:** ${tags}`);
27
+ if (varNames.length > 0) {
28
+ lines.push(`**Variables:** ${varNames}`);
29
+ }
30
+ lines.push('');
31
+ }
32
+ lines.push('Use `apply_spec_template` to instantiate a template.');
33
+ return { content: [{ type: 'text', text: lines.join('\n') }] };
34
+ }
35
+ // ---------------------------------------------------------------------------
36
+ // apply_spec_template
37
+ // ---------------------------------------------------------------------------
38
+ export async function handleApplySpecTemplate(input) {
39
+ const content = await applyTemplate(input.templateName, input.variables);
40
+ if (content === null) {
41
+ return {
42
+ content: [
43
+ {
44
+ type: 'text',
45
+ text: `Template "${input.templateName}" not found. Run \`search_spec_templates\` to see available templates.`,
46
+ },
47
+ ],
48
+ isError: true,
49
+ };
50
+ }
51
+ if (content.trim().length === 0) {
52
+ return {
53
+ content: [
54
+ {
55
+ type: 'text',
56
+ text: `Template "${input.templateName}" has no spec content. This is a misconfigured built-in template.`,
57
+ },
58
+ ],
59
+ isError: true,
60
+ };
61
+ }
62
+ const lines = [
63
+ `Template \`${input.templateName}\` applied successfully.`,
64
+ '',
65
+ 'Use the content below to create a spec with `create_spec`:',
66
+ '',
67
+ '```markdown',
68
+ content,
69
+ '```',
70
+ ];
71
+ return { content: [{ type: 'text', text: lines.join('\n') }] };
72
+ }
73
+ // ---------------------------------------------------------------------------
74
+ // publish_spec_template
75
+ // ---------------------------------------------------------------------------
76
+ export async function handlePublishSpecTemplate(input) {
77
+ const projectId = hashProjectPath(input.projectPath);
78
+ const spec = await getSpec(projectId, input.specId);
79
+ if (spec === null) {
80
+ return {
81
+ content: [
82
+ {
83
+ type: 'text',
84
+ text: `Spec "${input.specId}" not found in project. Verify the spec ID and project path.`,
85
+ },
86
+ ],
87
+ isError: true,
88
+ };
89
+ }
90
+ const specContent = await readSpecContent(spec.specPath);
91
+ const manifest = buildPublishManifest(input.specId, input.templateName, input.variables, specContent);
92
+ const lines = [
93
+ `Template \`${manifest.name}\` published from spec \`${input.specId}\`.`,
94
+ '',
95
+ '**Manifest:**',
96
+ '```json',
97
+ JSON.stringify(manifest, null, 2),
98
+ '```',
99
+ '',
100
+ 'Share the manifest with your team so they can use `apply_spec_template` to instantiate it.',
101
+ ];
102
+ return { content: [{ type: 'text', text: lines.join('\n') }] };
103
+ }
104
+ // ---------------------------------------------------------------------------
105
+ // Internal helpers
106
+ // ---------------------------------------------------------------------------
107
+ async function readSpecContent(specPath) {
108
+ if (existsSync(specPath)) {
109
+ return readFile(specPath, 'utf-8');
110
+ }
111
+ return '';
112
+ }
113
+ //# sourceMappingURL=spec-marketplace-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-marketplace-handler.js","sourceRoot":"","sources":["../../src/tools/spec-marketplace-handler.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAQtF,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,8EAA8E;AAC9E,wBAAwB;AACxB,8EAA8E;AAE9E,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,KAA+B;IAE/B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;IAChC,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,KAAK,CAAC,CAAC;IAE/C,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,GAAG,GACP,KAAK,CAAC,MAAM,GAAG,CAAC;YACd,CAAC,CAAC,gCAAgC,KAAK,6BAA6B;YACpE,CAAC,CAAC,yBAAyB,CAAC;QAChC,OAAO,E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E,SAAS,KAAK,CAAC,MAAM,8DAA8D;iBAC1F;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,oBAAoB,CACnC,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,SAAS,EACf,WAAW,CACZ,CAAC;IAEF,MAAM,KAAK,GAAG;QACZ,cAAc,QAAQ,CAAC,IAAI,4BAA4B,KAAK,CAAC,MAAM,KAAK;QACxE,EAAE;QACF,eAAe;QACf,SAAS;QACT,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QACjC,KAAK;QACL,EAAE;QACF,4FAA4F;KAC7F,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AACjE,CAAC;AAED,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,KAAK,UAAU,eAAe,CAAC,QAAgB;IAC7C,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzB,OAAO,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ToolResult } from '../types/index.js';
2
+ export declare function handleSpecQualityScore(args: {
3
+ specId: string;
4
+ projectPath?: string;
5
+ projectId?: string;
6
+ }): Promise<ToolResult>;
7
+ //# sourceMappingURL=spec-quality-score-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-quality-score-handler.d.ts","sourceRoot":"","sources":["../../src/tools/spec-quality-score-handler.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AA6FpD,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,UAAU,CAAC,CA0BtB"}
@@ -0,0 +1,106 @@
1
+ // tools/spec-quality-score-handler.ts — spec_quality_score tool handler (SPEC-314)
2
+ import { specStore } from '../storage/index.js';
3
+ import { scoreSpecQuality } from '../engine/spec-quality-scorer.js';
4
+ import { resolveProjectId, missingProjectIdError } from './resolve-project-id.js';
5
+ import { toolResult, errText } from './response-helpers.js';
6
+ // ── Formatting ───────────────────────────────────────────────────────────────
7
+ function gradeLabel(grade) {
8
+ switch (grade) {
9
+ case 'A': return 'Excellent';
10
+ case 'B': return 'Good';
11
+ case 'C': return 'Fair';
12
+ case 'D': return 'Poor';
13
+ case 'F': return 'Failing';
14
+ }
15
+ }
16
+ function scoreBar(score, max) {
17
+ const filled = Math.round((score / max) * 10);
18
+ const empty = 10 - filled;
19
+ return `[${'#'.repeat(filled)}${'.'.repeat(empty)}] ${String(score)}/${String(max)}`;
20
+ }
21
+ function formatReport(report) {
22
+ const { score, dimensions } = report;
23
+ const lines = [];
24
+ lines.push(`# Quality Score — ${report.specId}`);
25
+ lines.push('');
26
+ lines.push(`**Grade**: ${score.grade} (${gradeLabel(score.grade)}) — ${String(score.total)}/100`);
27
+ lines.push('');
28
+ lines.push('## Score Breakdown');
29
+ lines.push('');
30
+ lines.push(`| Dimension | Score | Bar |`);
31
+ lines.push(`|-----------|-------|-----|`);
32
+ lines.push(`| Completeness | ${String(score.completeness)}/25 | ${scoreBar(score.completeness, 25)} |`);
33
+ lines.push(`| Testability | ${String(score.testability)}/25 | ${scoreBar(score.testability, 25)} |`);
34
+ lines.push(`| Ambiguity | ${String(score.ambiguity)}/25 | ${scoreBar(score.ambiguity, 25)} |`);
35
+ lines.push(`| Risk | ${String(score.risk)}/25 | ${scoreBar(score.risk, 25)} |`);
36
+ lines.push(`| **Total** | **${String(score.total)}/100** | ${scoreBar(score.total, 100)} |`);
37
+ lines.push('');
38
+ // Per-dimension issues
39
+ const dimensionEntries = [
40
+ ['Completeness', dimensions.completeness],
41
+ ['Testability', dimensions.testability],
42
+ ['Ambiguity', dimensions.ambiguity],
43
+ ['Risk', dimensions.risk],
44
+ ];
45
+ const allIssues = [];
46
+ const allRecs = [];
47
+ for (const [name, detail] of dimensionEntries) {
48
+ if (detail.issues.length > 0) {
49
+ lines.push(`## ${name} Issues`);
50
+ lines.push('');
51
+ for (const issue of detail.issues) {
52
+ lines.push(`- ${issue}`);
53
+ allIssues.push(issue);
54
+ }
55
+ lines.push('');
56
+ }
57
+ for (const rec of detail.recommendations) {
58
+ allRecs.push(rec);
59
+ }
60
+ }
61
+ if (allRecs.length > 0) {
62
+ lines.push('## Recommendations');
63
+ lines.push('');
64
+ const deduped = [...new Set(allRecs)];
65
+ for (const rec of deduped) {
66
+ lines.push(`- ${rec}`);
67
+ }
68
+ lines.push('');
69
+ }
70
+ // Grade interpretation
71
+ lines.push('## Grade Interpretation');
72
+ lines.push('');
73
+ lines.push('| Grade | Range | Meaning |');
74
+ lines.push('|-------|-------|---------|');
75
+ lines.push('| A | 90-100 | Ready for implementation |');
76
+ lines.push('| B | 75-89 | Minor improvements recommended |');
77
+ lines.push('| C | 60-74 | Needs work before implementation |');
78
+ lines.push('| D | 45-59 | Significant gaps — do not implement yet |');
79
+ lines.push('| F | 0-44 | Spec requires major revision |');
80
+ return lines.join('\n');
81
+ }
82
+ // ── Handler ──────────────────────────────────────────────────────────────────
83
+ export async function handleSpecQualityScore(args) {
84
+ const projectId = resolveProjectId(args);
85
+ if (!projectId) {
86
+ return missingProjectIdError;
87
+ }
88
+ const { specId } = args;
89
+ const spec = await specStore.getSpec(projectId, specId);
90
+ if (!spec) {
91
+ return errText(`Spec '${specId}' not found in project '${projectId}'`);
92
+ }
93
+ const report = await scoreSpecQuality(spec);
94
+ const formatted = formatReport(report);
95
+ return toolResult(formatted, {
96
+ specId: report.specId,
97
+ score: report.score,
98
+ dimensions: {
99
+ completeness: { score: report.dimensions.completeness.score, issues: report.dimensions.completeness.issues },
100
+ testability: { score: report.dimensions.testability.score, issues: report.dimensions.testability.issues },
101
+ ambiguity: { score: report.dimensions.ambiguity.score, issues: report.dimensions.ambiguity.issues },
102
+ risk: { score: report.dimensions.risk.score, issues: report.dimensions.risk.issues },
103
+ },
104
+ });
105
+ }
106
+ //# sourceMappingURL=spec-quality-score-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-quality-score-handler.js","sourceRoot":"","sources":["../../src/tools/spec-quality-score-handler.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAEnF,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAI5D,gFAAgF;AAEhF,SAAS,UAAU,CAAC,KAAgC;IAClD,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,GAAG,CAAC,CAAC,OAAO,WAAW,CAAC;QAC7B,KAAK,GAAG,CAAC,CAAC,OAAO,MAAM,CAAC;QACxB,KAAK,GAAG,CAAC,CAAC,OAAO,MAAM,CAAC;QACxB,KAAK,GAAG,CAAC,CAAC,OAAO,MAAM,CAAC;QACxB,KAAK,GAAG,CAAC,CAAC,OAAO,SAAS,CAAC;IAC7B,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa,EAAE,GAAW;IAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;IAC9C,MAAM,KAAK,GAA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.js';
3
+ export declare function handleConfigureHooks(args: ConfigureHooksInput): Promise<ToolResult>;
4
+ //# sourceMappingURL=configure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../src/tools/start-hooks/configure.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAA6B,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAQrE,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC,CA6CzF"}
@@ -0,0 +1,122 @@
1
+ // tools/start-hooks/configure.ts — handleConfigureHooks + plan-mode integration + template apply.
2
+ import { readFile, writeFile, mkdir } from 'node:fs/promises';
3
+ import { join } from 'node:path';
4
+ import { generateHookTemplate, mergeHookConfig } from '../../engine/hooks/hook-templates.js';
5
+ import { buildPlanModeHookScripts } from '../../engine/hooks/plan-mode-scripts.js';
6
+ import { ConfigLoader } from '../../engine/hooks/config-loader.js';
7
+ import { getConfigLoaderInstance, getEngineInstance } from './engine.js';
8
+ export async function handleConfigureHooks(args) {
9
+ if (args.action === 'enable-plan-mode-integration') {
10
+ return enablePlanModeIntegration(args.projectPath);
11
+ }
12
+ if (args.template) {
13
+ return applyHookTemplate(args);
14
+ }
15
+ const configLoader = getConfigLoaderInstance();
16
+ if (!configLoader) {
17
+ const loader = new ConfigLoader(args.projectPath);
18
+ const config = await loader.load();
19
+ loader.close();
20
+ return {
21
+ content: [
22
+ {
23
+ type: 'text',
24
+ text: JSON.stringify({ message: 'Hook engine not running. Current config:', config }, null, 2),
25
+ },
26
+ ],
27
+ };
28
+ }
29
+ const config = await configLoader.load();
30
+ return {
31
+ content: [
32
+ {
33
+ type: 'text',
34
+ text: JSON.stringify({
35
+ message: 'Configuration reloaded',
36
+ config,
37
+ engineRunning: getEngineInstance()?.status().running ?? false,
38
+ }, null, 2),
39
+ },
40
+ ],
41
+ };
42
+ }
43
+ async function enablePlanModeIntegration(projectPath) {
44
+ const hooksDir = join(projectPath, '.claude', 'hooks');
45
+ await mkdir(hooksDir, { recursive: true });
46
+ const scripts = buildPlanModeHookScripts();
47
+ const preHookPath = join(hooksDir, 'planu-pre-plan.sh');
48
+ const postHookPath = join(hooksDir, 'planu-post-plan.sh');
49
+ await writeFile(preHookPath, scripts.preScript, { mode: 0o755 });
50
+ await writeFile(postHookPath, scripts.postScript, { mode: 0o755 });
51
+ const settingsPath = join(projectPath, '.claude', 'settings.json');
52
+ let existing = {};
53
+ try {
54
+ const raw = await readFile(settingsPath, 'utf-8');
55
+ existing = JSON.parse(raw);
56
+ }
57
+ catch {
58
+ // File doesn't exist yet — start from empty
59
+ }
60
+ const preEntry = {
61
+ matcher: 'Task',
62
+ hooks: [{ type: 'command', command: `bash "${preHookPath}"` }],
63
+ };
64
+ const postEntry = {
65
+ matcher: 'exit_plan_mode',
66
+ hooks: [{ type: 'command', command: `bash "${postHookPath}"` }],
67
+ };
68
+ const existingHooks = (existing.hooks ?? {});
69
+ const merged = {
70
+ ...existing,
71
+ hooks: {
72
+ ...existingHooks,
73
+ PreToolUse: [...(existingHooks.PreToolUse ?? []), preEntry],
74
+ PostToolUse: [...(existingHooks.PostToolUse ?? []), postEntry],
75
+ },
76
+ };
77
+ await writeFile(settingsPath, JSON.stringify(merged, null, 2) + '\n', 'utf-8');
78
+ const result = {
79
+ action: 'enable-plan-mode-integration',
80
+ preHookPath,
81
+ postHookPath,
82
+ settingsPath,
83
+ message: 'Plan Mode integration enabled. Planu context will be injected automatically when Claude enters Plan Mode.',
84
+ };
85
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
86
+ }
87
+ async function applyHookTemplate(args) {
88
+ /* c8 ignore next 3 */
89
+ if (!args.template) {
90
+ return { content: [{ type: 'text', text: 'template is required' }], isError: true };
91
+ }
92
+ const generated = generateHookTemplate({
93
+ template: args.template,
94
+ notificationMatcher: args.notificationMatcher,
95
+ });
96
+ const settingsPath = join(args.projectPath, '.claude', 'settings.json');
97
+ let existing = {};
98
+ try {
99
+ const raw = await readFile(settingsPath, 'utf-8');
100
+ existing = JSON.parse(raw);
101
+ }
102
+ catch {
103
+ // File doesn't exist yet or is not valid JSON — start from empty object
104
+ }
105
+ const merged = mergeHookConfig(existing, generated);
106
+ await writeFile(settingsPath, JSON.stringify(merged, null, 2) + '\n', 'utf-8');
107
+ return {
108
+ content: [
109
+ {
110
+ type: 'text',
111
+ text: JSON.stringify({
112
+ message: `Hook template '${args.template}' applied`,
113
+ settingsPath,
114
+ description: generated.description,
115
+ mergeInstructions: generated.mergeInstructions,
116
+ generatedConfig: generated.hooks,
117
+ }, null, 2),
118
+ },
119
+ ],
120
+ };
121
+ }
122
+ //# sourceMappingURL=configure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configure.js","sourceRoot":"","sources":["../../../src/tools/start-hooks/configure.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAIlG,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEzE,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,IAAyB;IAClE,IAAI,IAAI,CAAC,MAAM,KAAK,8BAA8B,EAAE,CAAC;QACnD,OAAO,yBAAyB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAA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AAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;IAE/E,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;oBACE,OAAO,EAAE,kBAAkB,IAAI,CAAC,QAAQ,WAAW;oBACnD,YAAY;oBACZ,WAAW,EAAE,SAAS,CAAC,WAAW;oBAClC,iBAAiB,EAAE,SAAS,CAAC,iBAAiB;oBAC9C,eAAe,EAAE,SAAS,CAAC,KAAK;iBACjC,EACD,IAAI,EACJ,CAAC,CACF;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { ToolResult } from '../../types/index.js';
2
+ import type { StartHooksInput, StopHooksInput } from '../../types/file-hooks.js';
3
+ import { HookEngine } from '../../engine/hooks/hook-engine.js';
4
+ import { FileWatcher } from '../../engine/hooks/file-watcher.js';
5
+ import { ConfigLoader } from '../../engine/hooks/config-loader.js';
6
+ export declare function getEngineInstance(): HookEngine | null;
7
+ export declare function getWatcherInstance(): FileWatcher | null;
8
+ export declare function getConfigLoaderInstance(): ConfigLoader | null;
9
+ export declare function ensureHooksStarted(projectPath: string): void;
10
+ export declare function handleStartHooks(args: StartHooksInput): Promise<ToolResult>;
11
+ export declare function handleStopHooks(_args: StopHooksInput): Promise<ToolResult>;
12
+ export declare function handleHookStatus(): Promise<ToolResult>;
13
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/tools/start-hooks/engine.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAQ,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAGV,eAAe,EACf,cAAc,EAGf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AA0BnE,wBAAgB,iBAAiB,IAAI,UAAU,GAAG,IAAI,CAErD;AAED,wBAAgB,kBAAkB,IAAI,WAAW,GAAG,IAAI,CAEvD;AAED,wBAAgB,uBAAuB,IAAI,YAAY,GAAG,IAAI,CAE7D;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAmB5D;AAMD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,CAwFjF;AAMD,wBAAsB,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAoBhF;AAMD,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,UAAU,CAAC,CAkC5D"}