@rulemetric/cli 0.5.2 → 0.5.4

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 (178) hide show
  1. package/bin/dev.js +7 -0
  2. package/dist/base-command.js +4 -4
  3. package/dist/{chunk-7DRLX3DN.js → chunk-3POYC5NA.js} +3 -3
  4. package/dist/{chunk-TJ2M5QVL.js → chunk-3QH73QOQ.js} +2 -2
  5. package/dist/{chunk-AOIY5RT6.js → chunk-4LHEN2FS.js} +17 -17
  6. package/dist/{chunk-LJ5OT5XN.js → chunk-7K4ILWS7.js} +6 -6
  7. package/dist/{chunk-5ZOLDIZQ.js → chunk-BCIUSUEV.js} +5 -5
  8. package/dist/{chunk-TDTHAOXO.js → chunk-DR5WLIOU.js} +2 -2
  9. package/dist/{chunk-K3BFZ7KG.js → chunk-E3BIT53W.js} +1 -1
  10. package/dist/chunk-E3BIT53W.js.map +7 -0
  11. package/dist/{chunk-4QGATD5Y.js → chunk-F5N6CLJJ.js} +1 -1
  12. package/dist/{chunk-4QGATD5Y.js.map → chunk-F5N6CLJJ.js.map} +2 -2
  13. package/dist/{chunk-7XDWLJJP.js → chunk-H3C6EGR2.js} +5 -5
  14. package/dist/{chunk-PHIAFGQ2.js → chunk-IATQXFJA.js} +7 -7
  15. package/dist/{chunk-IVOCDHWA.js → chunk-IPOO4IGF.js} +3 -3
  16. package/dist/{chunk-AUUHXCJU.js → chunk-JEJ3J5J6.js} +2 -2
  17. package/dist/{chunk-OAQG5WBV.js → chunk-LAKZUE35.js} +2 -2
  18. package/dist/{chunk-346TGPVR.js → chunk-LTT2YMYY.js} +2 -2
  19. package/dist/{chunk-CCSR73HF.js → chunk-N5A2IQAK.js} +2 -2
  20. package/dist/{chunk-IKEI4KNV.js → chunk-OTOWLUOJ.js} +4 -4
  21. package/dist/{chunk-YQFCUKNI.js → chunk-QNSVCSHG.js} +373 -414
  22. package/dist/chunk-QNSVCSHG.js.map +7 -0
  23. package/dist/{chunk-OKCFYPIQ.js → chunk-RCMXTLQF.js} +2 -2
  24. package/dist/{chunk-CGUV6TUA.js → chunk-RUCSRN7F.js} +2 -2
  25. package/dist/{chunk-4UJATBTG.js → chunk-SLL3OBKN.js} +4 -4
  26. package/dist/{chunk-CB43W53J.js → chunk-SZ7VDCD6.js} +3 -3
  27. package/dist/{chunk-N52AHNBH.js → chunk-W4MZXKZ2.js} +6 -2
  28. package/dist/chunk-W4MZXKZ2.js.map +7 -0
  29. package/dist/{chunk-DUR54APY.js → chunk-WLFX4PYR.js} +6 -6
  30. package/dist/{chunk-FUS5C4SB.js → chunk-Y4BJXXYV.js} +2 -2
  31. package/dist/{chunk-KHJUQFIK.js → chunk-YSEQWCN4.js} +2 -2
  32. package/dist/{chunk-CWFVBGX2.js → chunk-ZRLYHBPN.js} +4 -2
  33. package/dist/chunk-ZRLYHBPN.js.map +7 -0
  34. package/dist/{chunk-46LMTDRE.js → chunk-ZSGKRCKD.js} +7 -4
  35. package/dist/chunk-ZSGKRCKD.js.map +7 -0
  36. package/dist/commands/antigravity/backfill.js +5 -5
  37. package/dist/commands/auth/create-key.js +7 -5
  38. package/dist/commands/auth/create-key.js.map +2 -2
  39. package/dist/commands/auth/login.js +4 -4
  40. package/dist/commands/auth/logout.js +4 -4
  41. package/dist/commands/auth/revoke-key.js +4 -4
  42. package/dist/commands/auth/status.js +4 -4
  43. package/dist/commands/catalog/index.js +4 -4
  44. package/dist/commands/catalog/recommend.js +4 -4
  45. package/dist/commands/convert.js +6 -5
  46. package/dist/commands/convert.js.map +2 -2
  47. package/dist/commands/converters.js +4 -4
  48. package/dist/commands/crons/list.js +4 -4
  49. package/dist/commands/crons/run.js +4 -4
  50. package/dist/commands/dashboard.js +4 -4
  51. package/dist/commands/eval-targets/create.js +4 -4
  52. package/dist/commands/eval-targets/list.js +4 -4
  53. package/dist/commands/evals/agent.js +25 -28
  54. package/dist/commands/evals/agent.js.map +4 -4
  55. package/dist/commands/evals/benchmark.js +5 -5
  56. package/dist/commands/evals/compare.js +4 -4
  57. package/dist/commands/evals/create.js +4 -4
  58. package/dist/commands/evals/optimize-description.js +4 -4
  59. package/dist/commands/evals/optimize.js +4 -4
  60. package/dist/commands/evals/run.js +4 -4
  61. package/dist/commands/gateway/ensure.js +4 -4
  62. package/dist/commands/hooks/install.js +4 -4
  63. package/dist/commands/hooks/run.js +4 -4
  64. package/dist/commands/hooks/uninstall.js +4 -4
  65. package/dist/commands/import.js +4 -4
  66. package/dist/commands/instructions/create.js +4 -4
  67. package/dist/commands/instructions/delete.js +4 -4
  68. package/dist/commands/instructions/fork.js +4 -4
  69. package/dist/commands/instructions/get.js +4 -4
  70. package/dist/commands/instructions/list.js +4 -4
  71. package/dist/commands/instructions/promote.js +4 -4
  72. package/dist/commands/instructions/pull.js +4 -4
  73. package/dist/commands/instructions/upstream.js +4 -4
  74. package/dist/commands/instructions/versions.js +4 -4
  75. package/dist/commands/launcher.js +4 -4
  76. package/dist/commands/org/current.js +9 -9
  77. package/dist/commands/org/list.js +6 -6
  78. package/dist/commands/org/switch.js +7 -7
  79. package/dist/commands/packs/add-instruction.js +4 -4
  80. package/dist/commands/packs/apply.js +4 -4
  81. package/dist/commands/packs/create.js +4 -4
  82. package/dist/commands/packs/fork.js +4 -4
  83. package/dist/commands/packs/get.js +4 -4
  84. package/dist/commands/packs/list.js +4 -4
  85. package/dist/commands/packs/remove-instruction.js +4 -4
  86. package/dist/commands/proxy/env.js +4 -4
  87. package/dist/commands/proxy/logs.js +4 -4
  88. package/dist/commands/proxy/restart.js +4 -4
  89. package/dist/commands/proxy/setup.js +4 -4
  90. package/dist/commands/proxy/start.js +4 -4
  91. package/dist/commands/proxy/status.js +4 -4
  92. package/dist/commands/proxy/stop.js +4 -4
  93. package/dist/commands/research/backfill.js +7 -7
  94. package/dist/commands/research/tail-transcript.js +7 -7
  95. package/dist/commands/service/install.js +9 -4
  96. package/dist/commands/service/install.js.map +2 -2
  97. package/dist/commands/service/status.js +4 -4
  98. package/dist/commands/service/uninstall.js +4 -4
  99. package/dist/commands/sessions/analyze.js +4 -4
  100. package/dist/commands/sessions/end.js +4 -4
  101. package/dist/commands/sessions/import.js +4 -4
  102. package/dist/commands/sessions/list.js +4 -4
  103. package/dist/commands/sessions/start.js +6 -6
  104. package/dist/commands/setup.js +5 -5
  105. package/dist/commands/skills/export-approved.js +4 -4
  106. package/dist/commands/skills/install.js +4 -4
  107. package/dist/commands/skills/list.js +4 -4
  108. package/dist/commands/skills/publish.js +4 -4
  109. package/dist/commands/skills/search.js +4 -4
  110. package/dist/commands/skills/update.js +4 -4
  111. package/dist/commands/suggestions/accept.js +4 -4
  112. package/dist/commands/suggestions/dismiss.js +4 -4
  113. package/dist/commands/suggestions/list.js +4 -4
  114. package/dist/commands/suggestions/refresh.js +4 -4
  115. package/dist/dashboard/Dashboard.js +17 -15
  116. package/dist/dashboard/Dashboard.js.map +1 -1
  117. package/dist/dashboard/data.js +4 -2
  118. package/dist/dashboard/launcher/LauncherOverlay.js +6 -4
  119. package/dist/dashboard/launcher/api.js +3 -1
  120. package/dist/dashboard/launcher/useLaunchJobs.js +4 -2
  121. package/dist/{dist-NEECHU47.js → dist-UNYP5PJR.js} +2 -2
  122. package/dist/lib/active-org-refresh.js +3 -3
  123. package/dist/lib/agent-loop.js +19 -19
  124. package/dist/lib/antigravity-transcript.js +2 -2
  125. package/dist/lib/api-client.js +3 -1
  126. package/dist/lib/eval-benchmark.js +2 -2
  127. package/dist/lib/eval-conversation-handler.js +2 -2
  128. package/dist/lib/handlers/cron-suggest-instructions.js +4 -4
  129. package/dist/lib/handlers/process-announcement.js +3 -3
  130. package/dist/lib/handlers/process-changelog.js +3 -3
  131. package/dist/lib/handlers/process-conversation.js +3 -3
  132. package/dist/lib/handlers/process-eval.js +2 -2
  133. package/dist/lib/handlers/process-insights.js +2 -2
  134. package/dist/lib/handlers/process-launch.js +4 -4
  135. package/dist/lib/handlers/process-run-cleanup.js +4 -4
  136. package/dist/lib/handlers/process-session-goal.js +2 -2
  137. package/dist/lib/manual-tasks.js +7 -7
  138. package/dist/lib/research-client.js +2 -2
  139. package/dist/lib/setup-steps.js +2 -2
  140. package/dist/lib/terminal-target-heartbeat.js +2 -2
  141. package/dist/lib/worktree.js +2 -2
  142. package/oclif.manifest.json +1 -40
  143. package/package.json +7 -7
  144. package/dist/chunk-46LMTDRE.js.map +0 -7
  145. package/dist/chunk-CWFVBGX2.js.map +0 -7
  146. package/dist/chunk-K3BFZ7KG.js.map +0 -7
  147. package/dist/chunk-N52AHNBH.js.map +0 -7
  148. package/dist/chunk-YQFCUKNI.js.map +0 -7
  149. package/dist/commands/signals/report.js +0 -43
  150. package/dist/commands/signals/report.js.map +0 -7
  151. package/dist/lib/handlers/cron-close-stale-sessions.js +0 -19
  152. package/dist/lib/handlers/cron-close-stale-sessions.js.map +0 -7
  153. package/dist/lib/handlers/cron-data-integrity-audit.js +0 -22
  154. package/dist/lib/handlers/cron-data-integrity-audit.js.map +0 -7
  155. package/dist/lib/provider-aggregator.js +0 -59
  156. package/dist/lib/provider-aggregator.js.map +0 -7
  157. /package/dist/{chunk-7DRLX3DN.js.map → chunk-3POYC5NA.js.map} +0 -0
  158. /package/dist/{chunk-TJ2M5QVL.js.map → chunk-3QH73QOQ.js.map} +0 -0
  159. /package/dist/{chunk-AOIY5RT6.js.map → chunk-4LHEN2FS.js.map} +0 -0
  160. /package/dist/{chunk-LJ5OT5XN.js.map → chunk-7K4ILWS7.js.map} +0 -0
  161. /package/dist/{chunk-5ZOLDIZQ.js.map → chunk-BCIUSUEV.js.map} +0 -0
  162. /package/dist/{chunk-TDTHAOXO.js.map → chunk-DR5WLIOU.js.map} +0 -0
  163. /package/dist/{chunk-7XDWLJJP.js.map → chunk-H3C6EGR2.js.map} +0 -0
  164. /package/dist/{chunk-PHIAFGQ2.js.map → chunk-IATQXFJA.js.map} +0 -0
  165. /package/dist/{chunk-IVOCDHWA.js.map → chunk-IPOO4IGF.js.map} +0 -0
  166. /package/dist/{chunk-AUUHXCJU.js.map → chunk-JEJ3J5J6.js.map} +0 -0
  167. /package/dist/{chunk-OAQG5WBV.js.map → chunk-LAKZUE35.js.map} +0 -0
  168. /package/dist/{chunk-346TGPVR.js.map → chunk-LTT2YMYY.js.map} +0 -0
  169. /package/dist/{chunk-CCSR73HF.js.map → chunk-N5A2IQAK.js.map} +0 -0
  170. /package/dist/{chunk-IKEI4KNV.js.map → chunk-OTOWLUOJ.js.map} +0 -0
  171. /package/dist/{chunk-OKCFYPIQ.js.map → chunk-RCMXTLQF.js.map} +0 -0
  172. /package/dist/{chunk-CGUV6TUA.js.map → chunk-RUCSRN7F.js.map} +0 -0
  173. /package/dist/{chunk-4UJATBTG.js.map → chunk-SLL3OBKN.js.map} +0 -0
  174. /package/dist/{chunk-CB43W53J.js.map → chunk-SZ7VDCD6.js.map} +0 -0
  175. /package/dist/{chunk-DUR54APY.js.map → chunk-WLFX4PYR.js.map} +0 -0
  176. /package/dist/{chunk-FUS5C4SB.js.map → chunk-Y4BJXXYV.js.map} +0 -0
  177. /package/dist/{chunk-KHJUQFIK.js.map → chunk-YSEQWCN4.js.map} +0 -0
  178. /package/dist/{dist-NEECHU47.js.map → dist-UNYP5PJR.js.map} +0 -0
package/bin/dev.js CHANGED
@@ -1,3 +1,10 @@
1
1
  #!/usr/bin/env node --import tsx --no-warnings=ExperimentalWarning
2
2
  import {execute} from '@oclif/core'
3
+
4
+ // Dev entry point: default to the LOCAL API so a repo checkout talks to the
5
+ // dev server unless the developer overrides RULEMETRIC_API_URL. The production
6
+ // default (https://rulemetric.com) lives in api-client.ts and applies to the
7
+ // globally-installed CLI (bin/run.js), which end users hit on a fresh install.
8
+ process.env.RULEMETRIC_API_URL ||= 'http://localhost:3000'
9
+
3
10
  await execute({development: true, dir: import.meta.url})
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  BaseCommand
3
- } from "./chunk-CB43W53J.js";
3
+ } from "./chunk-SZ7VDCD6.js";
4
4
  import "./chunk-R56PH7YE.js";
5
- import "./chunk-4UJATBTG.js";
6
- import "./chunk-CWFVBGX2.js";
7
- import "./chunk-W2YERO7E.js";
5
+ import "./chunk-SLL3OBKN.js";
8
6
  import "./chunk-EKJ2CABV.js";
7
+ import "./chunk-ZRLYHBPN.js";
8
+ import "./chunk-W2YERO7E.js";
9
9
  import "./chunk-NSBPE2FW.js";
10
10
  export {
11
11
  BaseCommand
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  processConversationJob
3
- } from "./chunk-TDTHAOXO.js";
3
+ } from "./chunk-DR5WLIOU.js";
4
4
  import {
5
5
  apiPatch
6
- } from "./chunk-CWFVBGX2.js";
6
+ } from "./chunk-ZRLYHBPN.js";
7
7
 
8
8
  // src/lib/handlers/process-conversation.ts
9
9
  async function processConversation(payload, helpers) {
@@ -20,4 +20,4 @@ async function processConversation(payload, helpers) {
20
20
  export {
21
21
  processConversation
22
22
  };
23
- //# sourceMappingURL=chunk-7DRLX3DN.js.map
23
+ //# sourceMappingURL=chunk-3POYC5NA.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  apiGet,
3
3
  apiPost
4
- } from "./chunk-CWFVBGX2.js";
4
+ } from "./chunk-ZRLYHBPN.js";
5
5
 
6
6
  // src/lib/eval-benchmark.ts
7
7
  function computeStats(values) {
@@ -89,4 +89,4 @@ export {
89
89
  aggregateBenchmark,
90
90
  postBenchmark
91
91
  };
92
- //# sourceMappingURL=chunk-TJ2M5QVL.js.map
92
+ //# sourceMappingURL=chunk-3QH73QOQ.js.map
@@ -1,36 +1,36 @@
1
1
  import {
2
2
  startTerminalTargetHeartbeat
3
- } from "./chunk-AUUHXCJU.js";
4
- import {
5
- processConversation
6
- } from "./chunk-7DRLX3DN.js";
7
- import {
8
- processEval
9
- } from "./chunk-OKCFYPIQ.js";
10
- import {
11
- processInsights
12
- } from "./chunk-CCSR73HF.js";
3
+ } from "./chunk-JEJ3J5J6.js";
13
4
  import {
14
5
  processLaunch
15
- } from "./chunk-IKEI4KNV.js";
6
+ } from "./chunk-OTOWLUOJ.js";
16
7
  import {
17
8
  processRunCleanup
18
- } from "./chunk-DUR54APY.js";
9
+ } from "./chunk-WLFX4PYR.js";
19
10
  import {
20
11
  processSendMessage
21
12
  } from "./chunk-W53GKIZQ.js";
22
13
  import {
23
14
  processSessionGoal
24
- } from "./chunk-7XDWLJJP.js";
15
+ } from "./chunk-H3C6EGR2.js";
25
16
  import {
26
17
  cronRefreshSkills
27
18
  } from "./chunk-RQ2TMLKG.js";
28
19
  import {
29
20
  cronSuggestInstructions
30
- } from "./chunk-PHIAFGQ2.js";
21
+ } from "./chunk-IATQXFJA.js";
31
22
  import {
32
23
  processAnnouncement
33
- } from "./chunk-5ZOLDIZQ.js";
24
+ } from "./chunk-BCIUSUEV.js";
25
+ import {
26
+ processConversation
27
+ } from "./chunk-3POYC5NA.js";
28
+ import {
29
+ processEval
30
+ } from "./chunk-RCMXTLQF.js";
31
+ import {
32
+ processInsights
33
+ } from "./chunk-N5A2IQAK.js";
34
34
  import {
35
35
  isPermanentJobError
36
36
  } from "./chunk-DGHWRQXL.js";
@@ -38,7 +38,7 @@ import {
38
38
  ApiError,
39
39
  apiGet,
40
40
  apiPost
41
- } from "./chunk-CWFVBGX2.js";
41
+ } from "./chunk-ZRLYHBPN.js";
42
42
 
43
43
  // src/lib/agent-loop.ts
44
44
  var HANDLERS = {
@@ -267,4 +267,4 @@ export {
267
267
  pollForWork,
268
268
  runAgentLoop
269
269
  };
270
- //# sourceMappingURL=chunk-AOIY5RT6.js.map
270
+ //# sourceMappingURL=chunk-4LHEN2FS.js.map
@@ -1,17 +1,17 @@
1
- import {
2
- ActiveJobsList
3
- } from "./chunk-QD6X4L4L.js";
4
1
  import {
5
2
  NewLaunchForm
6
3
  } from "./chunk-DTFXCHHI.js";
7
4
  import {
8
5
  useLaunchJobs
9
- } from "./chunk-KHJUQFIK.js";
6
+ } from "./chunk-YSEQWCN4.js";
10
7
  import {
11
8
  cancelLaunchJob,
12
9
  createLaunchJob,
13
10
  listLaunchers
14
- } from "./chunk-N52AHNBH.js";
11
+ } from "./chunk-W4MZXKZ2.js";
12
+ import {
13
+ ActiveJobsList
14
+ } from "./chunk-QD6X4L4L.js";
15
15
  import {
16
16
  ORANGE
17
17
  } from "./chunk-QJQS6TUN.js";
@@ -158,4 +158,4 @@ function LauncherOverlay({
158
158
  export {
159
159
  LauncherOverlay
160
160
  };
161
- //# sourceMappingURL=chunk-LJ5OT5XN.js.map
161
+ //# sourceMappingURL=chunk-7K4ILWS7.js.map
@@ -1,6 +1,3 @@
1
- import {
2
- PermanentJobError
3
- } from "./chunk-DGHWRQXL.js";
4
1
  import {
5
2
  sendEmail
6
3
  } from "./chunk-QSN77T7C.js";
@@ -10,7 +7,10 @@ import {
10
7
  getDb,
11
8
  notificationPreferences,
12
9
  profiles
13
- } from "./chunk-YQFCUKNI.js";
10
+ } from "./chunk-QNSVCSHG.js";
11
+ import {
12
+ PermanentJobError
13
+ } from "./chunk-DGHWRQXL.js";
14
14
 
15
15
  // src/lib/handlers/process-announcement.ts
16
16
  import { and, asc, eq, gt, isNotNull } from "drizzle-orm";
@@ -154,4 +154,4 @@ async function sendOne(args) {
154
154
  export {
155
155
  processAnnouncement
156
156
  };
157
- //# sourceMappingURL=chunk-5ZOLDIZQ.js.map
157
+ //# sourceMappingURL=chunk-BCIUSUEV.js.map
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  apiGet,
12
12
  apiPost
13
- } from "./chunk-CWFVBGX2.js";
13
+ } from "./chunk-ZRLYHBPN.js";
14
14
 
15
15
  // src/lib/eval-conversation-handler.ts
16
16
  async function processConversationJob(jobConfig, evalTargetId, logger) {
@@ -217,4 +217,4 @@ async function handleAnalyzeAndPropose(target, evalCases, messages, userFeedback
217
217
  export {
218
218
  processConversationJob
219
219
  };
220
- //# sourceMappingURL=chunk-TDTHAOXO.js.map
220
+ //# sourceMappingURL=chunk-DR5WLIOU.js.map
@@ -151,4 +151,4 @@ export {
151
151
  parseChangelog,
152
152
  announceableEntries
153
153
  };
154
- //# sourceMappingURL=chunk-K3BFZ7KG.js.map
154
+ //# sourceMappingURL=chunk-E3BIT53W.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../packages/core/src/llm/recommend.ts", "../../../packages/core/src/changelog/parse.ts", "../../../packages/core/src/types/instruction.ts", "../../../packages/core/src/types/prompt.ts", "../../../packages/core/src/parser/frontmatter-parser.ts"],
4
+ "sourcesContent": ["import type { ProjectContext, InstructionCandidate, Recommendation } from './types.js';\n\nexport function buildRecommendationPrompt(project: ProjectContext, candidates: InstructionCandidate[]): string {\n const candidateList = candidates\n .map((c) => `- ID: ${c.id}\\n Name: ${c.name}\\n Description: ${c.description}\\n Tags: ${c.tags.join(', ')}\\n Preview: ${c.contentPreview}`)\n .join('\\n\\n');\n\n return `You are an expert at matching AI coding instructions to software projects.\n\n## Project\n- Name: ${project.name}\n- Description: ${project.description ?? 'No description'}\n- Languages: ${project.languages.join(', ') || 'Unknown'}\n- Topics: ${project.topics.join(', ') || 'None'}\n- Dependencies: ${project.dependencies.join(', ') || 'None'}\n\n## Available Instructions\n\n${candidateList}\n\n## Task\n\nAnalyze the project and recommend which instructions would be most useful. Consider:\n1. Language and framework alignment\n2. Project purpose and what standards/practices would help\n3. Security, testing, and quality needs based on the project type\n\nReturn your response as JSON in this exact format:\n{\n \"recommendations\": [\n { \"instructionId\": \"<id>\", \"score\": <0.0-1.0>, \"reason\": \"<one sentence explanation>\" }\n ]\n}\n\nOnly include instructions with a relevance score >= 0.5. Order by score descending. Return valid JSON only, no markdown fences.`;\n}\n\nexport function parseRecommendationResponse(response: string): Recommendation[] {\n try {\n // Try to extract JSON from the response (handle markdown fences if present)\n const jsonMatch = response.match(/\\{[\\s\\S]*\\}/);\n if (!jsonMatch) return [];\n\n const parsed = JSON.parse(jsonMatch[0]);\n if (!parsed.recommendations || !Array.isArray(parsed.recommendations)) return [];\n\n return parsed.recommendations.filter(\n (r: Record<string, unknown>) =>\n typeof r.instructionId === 'string' &&\n typeof r.score === 'number' &&\n typeof r.reason === 'string',\n ) as Recommendation[];\n } catch {\n return [];\n }\n}\n", "// Keep-a-Changelog parser. Pure function, no I/O.\n//\n// Grammar (the strict subset we accept):\n//\n// # Changelog\n// (any prose / front-matter before the first `## [` heading is ignored)\n//\n// ## [Unreleased]\n// ### Added\n// - item one\n// - item two\n//\n// ## [2026.06.05] - 2026-06-05\n// ### Added\n// - \u2026\n// ### Fixed\n// - \u2026\n//\n// Rules:\n// - Version headings MUST match `## [<version>]` with optional ` - <date>`.\n// - `[Unreleased]` is parsed but flagged so callers can skip it.\n// - Section headings MUST be `### <Name>` where Name is one of the\n// KNOWN_SECTIONS set. Unknown sections are dropped silently so a stray\n// `### Notes` doesn't end up in a customer email.\n// - List items are `- `-prefixed lines. Multi-line items (continuation\n// lines indented by 2+ spaces) are joined with a single space.\n// - Anything outside a recognized list is discarded.\n\nexport const KNOWN_SECTIONS = [\n 'Added',\n 'Changed',\n 'Fixed',\n 'Removed',\n 'Deprecated',\n 'Security',\n] as const;\n\nexport type SectionName = (typeof KNOWN_SECTIONS)[number];\n\nexport interface ChangelogEntry {\n /** Verbatim version string from the heading, e.g. \"2026.06.05\" or \"Unreleased\". */\n version: string;\n /** ISO date (YYYY-MM-DD) parsed from the heading. Null for Unreleased or when omitted. */\n date: string | null;\n /** True iff version === \"Unreleased\" (case-insensitive). */\n unreleased: boolean;\n /** Section name \u2192 list of items, preserving heading order. */\n sections: Partial<Record<SectionName, string[]>>;\n}\n\nexport interface ParsedChangelog {\n entries: ChangelogEntry[];\n}\n\nconst VERSION_HEADING = /^##\\s+\\[([^\\]]+)\\](?:\\s*[-\u2013]\\s*(\\d{4}-\\d{2}-\\d{2}))?\\s*$/;\nconst SECTION_HEADING = /^###\\s+(.+?)\\s*$/;\nconst LIST_ITEM = /^[-*]\\s+(.*\\S)\\s*$/;\nconst CONTINUATION = /^ {2,}(\\S.*)$/;\n\nexport function parseChangelog(markdown: string): ParsedChangelog {\n const lines = markdown.split(/\\r?\\n/);\n const entries: ChangelogEntry[] = [];\n let current: ChangelogEntry | null = null;\n let currentSection: SectionName | null = null;\n let lastItems: string[] | null = null;\n\n for (const raw of lines) {\n const versionMatch = raw.match(VERSION_HEADING);\n if (versionMatch) {\n if (current) entries.push(current);\n const version = versionMatch[1].trim();\n current = {\n version,\n date: versionMatch[2] ?? null,\n unreleased: version.toLowerCase() === 'unreleased',\n sections: {},\n };\n currentSection = null;\n lastItems = null;\n continue;\n }\n\n if (!current) continue;\n\n const sectionMatch = raw.match(SECTION_HEADING);\n if (sectionMatch) {\n const name = sectionMatch[1].trim();\n if ((KNOWN_SECTIONS as readonly string[]).includes(name)) {\n currentSection = name as SectionName;\n if (!current.sections[currentSection]) {\n current.sections[currentSection] = [];\n }\n lastItems = current.sections[currentSection]!;\n } else {\n currentSection = null;\n lastItems = null;\n }\n continue;\n }\n\n if (!currentSection || !lastItems) continue;\n\n const itemMatch = raw.match(LIST_ITEM);\n if (itemMatch) {\n lastItems.push(itemMatch[1]);\n continue;\n }\n\n const contMatch = raw.match(CONTINUATION);\n if (contMatch && lastItems.length > 0) {\n lastItems[lastItems.length - 1] += ' ' + contMatch[1].trim();\n continue;\n }\n\n // Blank line or unrelated content \u2014 terminates continuation for the\n // previous item but doesn't close the section.\n }\n\n if (current) entries.push(current);\n return { entries };\n}\n\n/**\n * Filter to entries worth announcing: skip `[Unreleased]` and any entry\n * whose sections are all empty. Caller does dedup against the DB.\n */\nexport function announceableEntries(parsed: ParsedChangelog): ChangelogEntry[] {\n return parsed.entries.filter((e) => {\n if (e.unreleased) return false;\n return Object.values(e.sections).some((items) => items && items.length > 0);\n });\n}\n", "import { z } from 'zod';\n\nexport const INSTRUCTION_SCOPES = ['org', 'team', 'project', 'personal'] as const;\nexport type InstructionScope = (typeof INSTRUCTION_SCOPES)[number];\n\nexport const instructionFrontmatterSchema = z.object({\n name: z.string().min(1),\n description: z.string().min(1),\n type: z.literal('instruction').default('instruction'),\n scope: z.enum(INSTRUCTION_SCOPES),\n version: z.string().min(1),\n tags: z.array(z.string()).optional(),\n compatibility: z.array(z.string()).optional(),\n slots: z.record(z.string(), z.string()).optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type InstructionFrontmatter = z.infer<typeof instructionFrontmatterSchema>;\n\nexport interface Instruction {\n id: string;\n name: string;\n description: string;\n type: 'instruction';\n scope: InstructionScope;\n scopeRef: string | null;\n version: string;\n content: string;\n frontmatter: InstructionFrontmatter;\n slots: Record<string, string> | null;\n tags: string[];\n compatibility: string[];\n createdBy: string;\n createdAt: Date;\n updatedAt: Date;\n archived: boolean;\n}\n\nexport interface CreateInstructionInput {\n name: string;\n description: string;\n scope: InstructionScope;\n scopeRef?: string;\n version: string;\n content: string;\n tags?: string[];\n compatibility?: string[];\n}\n", "import { z } from 'zod';\n\nexport const promptFrontmatterSchema = z.object({\n name: z.string().min(1),\n description: z.string().min(1),\n type: z.literal('prompt'),\n version: z.string().min(1),\n tags: z.array(z.string()).optional(),\n variables: z.array(z.string()).optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type PromptFrontmatter = z.infer<typeof promptFrontmatterSchema>;\n\nexport interface Prompt {\n id: string;\n name: string;\n description: string;\n type: 'prompt';\n version: string;\n content: string;\n frontmatter: PromptFrontmatter;\n variables: string[];\n tags: string[];\n createdBy: string;\n createdAt: Date;\n updatedAt: Date;\n}\n", "import matter from 'gray-matter';\nimport { z } from 'zod';\nimport { instructionFrontmatterSchema, type InstructionFrontmatter } from '../types/instruction.js';\nimport { promptFrontmatterSchema, type PromptFrontmatter } from '../types/prompt.js';\n\nexport interface ParsedInstruction {\n frontmatter: InstructionFrontmatter;\n content: string;\n slots: Record<string, string> | null;\n}\n\nexport interface ParsedPrompt {\n frontmatter: PromptFrontmatter;\n content: string;\n}\n\nexport type ParseResult =\n | { type: 'instruction'; data: ParsedInstruction }\n | { type: 'prompt'; data: ParsedPrompt };\n\nconst typeDetectorSchema = z.object({\n type: z.enum(['instruction', 'prompt']),\n});\n\nexport function parseInstruction(raw: string): ParsedInstruction {\n const { data, content } = matter(raw);\n const frontmatter = instructionFrontmatterSchema.parse(data);\n const slots = frontmatter.slots ?? null;\n\n return {\n frontmatter,\n content: content.trim(),\n slots,\n };\n}\n\nexport function parsePrompt(raw: string): ParsedPrompt {\n const { data, content } = matter(raw);\n const frontmatter = promptFrontmatterSchema.parse(data);\n\n return {\n frontmatter,\n content: content.trim(),\n };\n}\n\nexport function parse(raw: string): ParseResult {\n const { data } = matter(raw);\n const { type } = typeDetectorSchema.parse(data);\n\n if (type === 'instruction') {\n return { type: 'instruction', data: parseInstruction(raw) };\n }\n\n return { type: 'prompt', data: parsePrompt(raw) };\n}\n"],
5
+ "mappings": ";AAEM,SAAU,0BAA0B,SAAyB,YAAkC;AACjG,QAAM,gBAAgB,WACjB,IAAI,CAAC,MAAM,SAAS,EAAE,EAAE;UAAa,EAAE,IAAI;iBAAoB,EAAE,WAAW;UAAa,EAAE,KAAK,KAAK,IAAI,CAAC;aAAgB,EAAE,cAAc,EAAE,EAC5I,KAAK,MAAM;AAEhB,SAAO;;;UAGD,QAAQ,IAAI;iBACL,QAAQ,eAAe,gBAAgB;eACzC,QAAQ,UAAU,KAAK,IAAI,KAAK,SAAS;YAC5C,QAAQ,OAAO,KAAK,IAAI,KAAK,MAAM;kBAC7B,QAAQ,aAAa,KAAK,IAAI,KAAK,MAAM;;;;EAIzD,aAAa;;;;;;;;;;;;;;;;;AAiBf;;;ACPO,IAAM,iBAAiB;EAC5B;EACA;EACA;EACA;EACA;EACA;;AAoBF,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AACxB,IAAM,YAAY;AAClB,IAAM,eAAe;AAEf,SAAU,eAAe,UAAgB;AAC7C,QAAM,QAAQ,SAAS,MAAM,OAAO;AACpC,QAAM,UAA4B,CAAA;AAClC,MAAI,UAAiC;AACrC,MAAI,iBAAqC;AACzC,MAAI,YAA6B;AAEjC,aAAW,OAAO,OAAO;A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