@rulemetric/cli 0.9.0 → 0.11.0
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.
- package/README.md +1 -2
- package/dist/base-command.js +1 -1
- package/dist/chunk-35KBN23A.js +1 -0
- package/dist/{chunk-PQN2GAG4.js → chunk-7FWIIVMC.js} +1 -1
- package/dist/{chunk-X3VL5H24.js → chunk-AC2NUNFC.js} +1 -1
- package/dist/{chunk-7FZB65VH.js → chunk-AJN2BLMV.js} +1 -1
- package/dist/{chunk-HYDGERWD.js → chunk-BMDHPIW6.js} +1 -1
- package/dist/{chunk-IVDTORX5.js → chunk-BMN2WZM2.js} +1 -1
- package/dist/{chunk-UUZB4IKU.js → chunk-CLCRZWAG.js} +1 -1
- package/dist/chunk-DN2T3FXN.js +1 -0
- package/dist/chunk-E4U6AOTM.js +46 -0
- package/dist/{chunk-CBUTNIJA.js → chunk-EJZGGT52.js} +1 -1
- package/dist/{chunk-KHWG7ZG4.js → chunk-FAOSXPRO.js} +1 -1
- package/dist/{chunk-FWTYR36W.js → chunk-FF5TAMDH.js} +1 -1
- package/dist/chunk-FK73GD2X.js +2 -0
- package/dist/{chunk-YFQ4FOAS.js → chunk-FM4LTGMI.js} +1 -1
- package/dist/chunk-FOUGYDLH.js +11 -0
- package/dist/{chunk-GF76D2DU.js → chunk-GL3ZDOKJ.js} +1 -1
- package/dist/{chunk-5EDINFHF.js → chunk-HWZTQXNM.js} +1 -1
- package/dist/chunk-IOV2BEW7.js +13 -0
- package/dist/{chunk-VFYT3SC5.js → chunk-IPL2DHU4.js} +1 -1
- package/dist/{chunk-MO57LGGK.js → chunk-KDFBKYXK.js} +1 -1
- package/dist/{chunk-LLIHRQPH.js → chunk-LWUA3NUZ.js} +1 -1
- package/dist/chunk-LZO6YBUW.js +2 -0
- package/dist/{chunk-QAV4HW7D.js → chunk-MPDSQALK.js} +1 -1
- package/dist/{chunk-X23L2MF6.js → chunk-NBTC5FNV.js} +1 -1
- package/dist/{chunk-C2275MFP.js → chunk-NPNSUG3N.js} +1 -1
- package/dist/{chunk-S62MK372.js → chunk-OUXWBHCI.js} +1 -1
- package/dist/chunk-PK6PSCIP.js +1 -0
- package/dist/chunk-PZNWH4VQ.js +7 -0
- package/dist/{chunk-BPP7AEFW.js → chunk-R4SSIFKY.js} +1 -1
- package/dist/{chunk-3DGL2ZY3.js → chunk-R4W4QDTP.js} +1 -1
- package/dist/{chunk-EQHKCGSX.js → chunk-RE7DDQ3O.js} +1 -1
- package/dist/{chunk-E2NVNLFD.js → chunk-RS4LSJI2.js} +1 -1
- package/dist/{chunk-QTZPLAYC.js → chunk-RUIX6AZ6.js} +1 -1
- package/dist/{chunk-WKDXH7NO.js → chunk-SBFTRVZM.js} +1 -1
- package/dist/{chunk-SYTQDPPN.js → chunk-SBJNQ5Q6.js} +1 -1
- package/dist/{chunk-VA5DPQB4.js → chunk-SV7FDAKW.js} +1 -1
- package/dist/{chunk-B22HYCBV.js → chunk-TU2AR6XO.js} +1 -1
- package/dist/{chunk-CDDICCY2.js → chunk-UT3EQR4C.js} +1 -1
- package/dist/{chunk-KWNIKGAE.js → chunk-V5XRGRJC.js} +1 -1
- package/dist/{chunk-2B7Y6JNB.js → chunk-W44E3DYZ.js} +1 -1
- package/dist/{chunk-K4B24SMJ.js → chunk-W4ZDAJ6S.js} +1 -1
- package/dist/{chunk-PKLXZYBY.js → chunk-WOBFJCMO.js} +1 -1
- package/dist/chunk-XK52UAFB.js +17 -0
- package/dist/{chunk-6M74HH6Y.js → chunk-XVRQ5WUB.js} +1 -1
- package/dist/{chunk-X3RTCN6S.js → chunk-YWALNDT3.js} +1 -1
- package/dist/{chunk-SANYAPBK.js → chunk-YZNP4TW4.js} +1 -1
- package/dist/{chunk-3AZV7ZPJ.js → chunk-ZXOAI65J.js} +1 -1
- package/dist/commands/antigravity/backfill.js +1 -1
- package/dist/commands/auth/create-key.js +1 -1
- package/dist/commands/auth/login.js +1 -1
- package/dist/commands/auth/logout.js +1 -1
- package/dist/commands/auth/revoke-key.js +1 -1
- package/dist/commands/auth/signup.js +1 -1
- package/dist/commands/auth/status.js +1 -1
- package/dist/commands/capture/scope.js +1 -1
- package/dist/commands/catalog/index.js +1 -1
- package/dist/commands/catalog/recommend.js +1 -1
- package/dist/commands/crons/list.js +1 -1
- package/dist/commands/crons/run.js +1 -1
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/diagnostics.js +1 -1
- package/dist/commands/eval-targets/create.js +1 -1
- package/dist/commands/eval-targets/list.js +1 -1
- package/dist/commands/evals/agent.js +1 -1
- package/dist/commands/evals/auto-run.js +1 -1
- package/dist/commands/evals/benchmark.js +1 -1
- package/dist/commands/evals/compare.js +1 -1
- package/dist/commands/evals/create.js +1 -1
- package/dist/commands/evals/optimize-description.js +1 -1
- package/dist/commands/evals/optimize.js +1 -1
- package/dist/commands/evals/refine-cases.js +1 -1
- package/dist/commands/evals/run.js +1 -1
- package/dist/commands/evals/validate-judge.js +1 -1
- package/dist/commands/experiments/list.js +1 -1
- package/dist/commands/gateway/ensure.js +1 -1
- package/dist/commands/hooks/install.js +1 -1
- package/dist/commands/hooks/run.js +1 -1
- package/dist/commands/hooks/uninstall.js +1 -1
- package/dist/commands/instructions/create.js +1 -1
- package/dist/commands/instructions/dedupe.js +1 -0
- package/dist/commands/instructions/delete.js +1 -1
- package/dist/commands/instructions/fork.js +1 -1
- package/dist/commands/instructions/get.js +1 -1
- package/dist/commands/instructions/list.js +1 -1
- package/dist/commands/instructions/promote.js +1 -1
- package/dist/commands/instructions/pull.js +1 -1
- package/dist/commands/instructions/restore.js +1 -1
- package/dist/commands/instructions/retract.js +1 -1
- package/dist/commands/instructions/upstream.js +1 -1
- package/dist/commands/instructions/versions.js +1 -1
- package/dist/commands/launcher.js +1 -1
- package/dist/commands/local/down.js +1 -1
- package/dist/commands/local/up.js +1 -1
- package/dist/commands/org/current.js +1 -1
- package/dist/commands/org/list.js +1 -1
- package/dist/commands/org/switch.js +1 -1
- package/dist/commands/packs/add-instruction.js +1 -1
- package/dist/commands/packs/apply.js +1 -1
- package/dist/commands/packs/create.js +1 -1
- package/dist/commands/packs/fork.js +1 -1
- package/dist/commands/packs/get.js +1 -1
- package/dist/commands/packs/list.js +1 -1
- package/dist/commands/packs/remove-instruction.js +1 -1
- package/dist/commands/proxy/env.js +1 -1
- package/dist/commands/proxy/logs.js +1 -1
- package/dist/commands/proxy/restart.js +1 -1
- package/dist/commands/proxy/setup.js +1 -1
- package/dist/commands/proxy/start.js +1 -1
- package/dist/commands/proxy/status.js +1 -1
- package/dist/commands/proxy/stop.js +1 -1
- package/dist/commands/research/backfill.js +1 -1
- package/dist/commands/research/tail-transcript.js +1 -1
- package/dist/commands/service/install.js +1 -1
- package/dist/commands/service/status.js +1 -1
- package/dist/commands/service/uninstall.js +1 -1
- package/dist/commands/sessions/analyze.js +1 -1
- package/dist/commands/sessions/delete.js +1 -1
- package/dist/commands/sessions/end.js +1 -1
- package/dist/commands/sessions/import.js +1 -1
- package/dist/commands/sessions/list.js +1 -1
- package/dist/commands/sessions/start.js +1 -1
- package/dist/commands/setup.js +1 -1
- package/dist/commands/skills/export-approved.js +1 -1
- package/dist/commands/skills/install.js +4 -4
- package/dist/commands/skills/list.js +1 -1
- package/dist/commands/skills/publish.js +1 -1
- package/dist/commands/skills/search.js +1 -1
- package/dist/commands/skills/update.js +1 -1
- package/dist/commands/suggestions/accept.js +1 -1
- package/dist/commands/suggestions/auto.js +1 -1
- package/dist/commands/suggestions/dismiss.js +1 -1
- package/dist/commands/suggestions/list.js +1 -1
- package/dist/commands/suggestions/refresh.js +1 -1
- package/dist/commands/suggestions/undo.js +1 -1
- package/dist/dashboard/Dashboard.js +1 -1
- package/dist/dashboard/data.js +1 -1
- package/dist/dashboard/launcher/ActiveJobsList.js +1 -1
- package/dist/dashboard/launcher/LauncherOverlay.js +1 -1
- package/dist/dashboard/launcher/NewLaunchForm.js +1 -1
- package/dist/dashboard/launcher/api.js +1 -1
- package/dist/dashboard/launcher/useLaunchJobs.js +1 -1
- package/dist/lib/active-org-refresh.js +1 -1
- package/dist/lib/agent-loop.js +1 -1
- package/dist/lib/antigravity-transcript.js +1 -1
- package/dist/lib/api-client.js +1 -1
- package/dist/lib/auth.js +1 -1
- package/dist/lib/claude-md-blocks.js +1 -0
- package/dist/lib/ensure-api-key.js +1 -1
- package/dist/lib/ensure-fresh-token.js +1 -1
- package/dist/lib/eval-benchmark.js +1 -1
- package/dist/lib/eval-candidate-run.js +1 -1
- package/dist/lib/eval-conversation-handler.js +1 -1
- package/dist/lib/eval-resume.js +1 -1
- package/dist/lib/eval-run-batch.js +1 -1
- package/dist/lib/eval-workspace.js +1 -1
- package/dist/lib/evolution-enrolment.js +1 -1
- package/dist/lib/handlers/cron-auto-accept-suggestions.js +1 -1
- package/dist/lib/handlers/cron-eval-autorun.js +1 -1
- package/dist/lib/handlers/cron-instruction-evolution.js +1 -1
- package/dist/lib/handlers/cron-instruction-training.js +1 -1
- package/dist/lib/handlers/cron-refresh-pricing.js +1 -1
- package/dist/lib/handlers/cron-suggest-instructions.js +1 -1
- package/dist/lib/handlers/distill-memories.js +1 -1
- package/dist/lib/handlers/process-changelog.js +1 -1
- package/dist/lib/handlers/process-conversation.js +1 -1
- package/dist/lib/handlers/process-eval.js +1 -1
- package/dist/lib/handlers/process-insights.js +1 -1
- package/dist/lib/handlers/process-judge-review.js +1 -1
- package/dist/lib/handlers/process-launch.js +1 -1
- package/dist/lib/handlers/process-memory-ab.js +1 -1
- package/dist/lib/handlers/process-run-cleanup.js +1 -1
- package/dist/lib/handlers/process-session-goal.js +1 -1
- package/dist/lib/judge-review-runner.js +1 -1
- package/dist/lib/manual-tasks.js +1 -1
- package/dist/lib/research-client.js +1 -1
- package/dist/lib/retraction.js +1 -1
- package/dist/lib/setup-steps.js +1 -1
- package/dist/lib/skill-paths.js +1 -0
- package/dist/lib/suggestion-accept.js +1 -1
- package/dist/lib/telemetry.js +1 -1
- package/dist/lib/terminal-target-heartbeat.js +1 -1
- package/oclif.manifest.json +151 -257
- package/package.json +7 -7
- package/dist/chunk-3PUOJ6F2.js +0 -45
- package/dist/chunk-DZ3FBQYD.js +0 -17
- package/dist/chunk-FP6QAPNK.js +0 -1
- package/dist/chunk-JZ5Z2BRO.js +0 -7
- package/dist/chunk-L2CFSMBC.js +0 -1
- package/dist/chunk-MMPZIZYZ.js +0 -10
- package/dist/chunk-QWPWY3SW.js +0 -1
- package/dist/chunk-R6JXE273.js +0 -13
- package/dist/commands/convert.js +0 -1
- package/dist/commands/converters.js +0 -1
- package/dist/commands/import.js +0 -1
package/dist/lib/manual-tasks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l}from"../chunk-
|
|
1
|
+
import{a as l}from"../chunk-IPL2DHU4.js";import"../chunk-35KBN23A.js";import{e as g}from"../chunk-R4W4QDTP.js";import"../chunk-HOQPVOMF.js";import{a as u}from"../chunk-UF6US7VU.js";import"../chunk-GIRPEMTW.js";import"../chunk-MODXEGCU.js";import{a as i}from"../chunk-GY5IJ4RS.js";import"../chunk-B3BHB26P.js";import"../chunk-N7ODX6PO.js";import"../chunk-PJ3WHQ67.js";import"../chunk-MPDSQALK.js";import"../chunk-E4U6AOTM.js";import"../chunk-PZNWH4VQ.js";import{a as o}from"../chunk-ZLLER3HP.js";var c={cron_check_changelog:o(async(r,e)=>{let s=await l({logger:{info:o(t=>e.logger.info(t),"info"),warn:o(t=>e.logger.warn(t),"warn")}});e.logger.info(`[cron_check_changelog] result: created=${s.createdCount} skipped=${s.skippedCount}`)},"cron_check_changelog"),cron_suggest_instructions:o((r,e)=>g(r,e),"cron_suggest_instructions"),cron_refresh_skills:o((r,e)=>u(r,e),"cron_refresh_skills")},p=i.map(r=>{let e=c[r.name];if(!e)throw new Error(`manual-tasks: no handler registered for "${r.name}"`);return{...r,handler:e}});async function m(r){let e=p.find(n=>n.name===r);if(!e)return{name:r,durationMs:0,ok:!1,error:`Unknown task: ${r}`,logs:[]};let s=[],t={logger:{info:o(n=>s.push({level:"info",message:n}),"info"),warn:o(n=>s.push({level:"warn",message:n}),"warn"),error:o(n=>s.push({level:"error",message:n}),"error")},job:{attempts:0}},a=Date.now();try{return await e.handler({},t),{name:r,durationMs:Date.now()-a,ok:!0,logs:s}}catch(n){return{name:r,durationMs:Date.now()-a,ok:!1,error:n instanceof Error?n.message:String(n),logs:s}}}o(m,"runManualTask");export{p as MANUAL_TASKS,m as runManualTask};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-WOBFJCMO.js";import"../chunk-MPDSQALK.js";import"../chunk-E4U6AOTM.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as postObservation,b as postObservations};
|
package/dist/lib/retraction.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e}from"../chunk-IOV2BEW7.js";import"../chunk-LZO6YBUW.js";import"../chunk-E4U6AOTM.js";import"../chunk-ZLLER3HP.js";export{e as applyRetraction,a as backupPathFor,c as candidateSkillPaths,b as pathFromContextIdentity,d as planRetraction};
|
package/dist/lib/setup-steps.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j}from"../chunk-ZXOAI65J.js";import"../chunk-3QXRLIGC.js";import"../chunk-HFGO5762.js";import"../chunk-QWCEZEDO.js";import"../chunk-KKDHD4XA.js";import"../chunk-SZ62CP55.js";import"../chunk-NTKO4H2K.js";import"../chunk-B3BHB26P.js";import"../chunk-N7ODX6PO.js";import"../chunk-PJ3WHQ67.js";import"../chunk-MPDSQALK.js";import"../chunk-E4U6AOTM.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{c as ALL_STEP_IDS,a as CORE_STEP_IDS,b as OPTIONAL_STEP_IDS,g as STEPS,j as computeStatus,d as defaultContext,h as getStep,i as isStepId,e as maskToken,f as renderDiff};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"../chunk-LZO6YBUW.js";import"../chunk-ZLLER3HP.js";export{b as CLAUDE_SKILLS_DIR,a as NEUTRAL_SKILLS_DIR,e as buildSkillFile,h as linkOrCopy,c as skillDirName,f as skillTargets,d as validateSkillName,g as writeSkill};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-FOUGYDLH.js";import"../chunk-FK73GD2X.js";import"../chunk-LZO6YBUW.js";import"../chunk-MPDSQALK.js";import"../chunk-E4U6AOTM.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{d as acceptSuggestion,a as appendToCLAUDEmd,c as fetchSuggestion,b as removeFromCLAUDEmd};
|
package/dist/lib/telemetry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-CLCRZWAG.js";import"../chunk-MPDSQALK.js";import"../chunk-E4U6AOTM.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{d as emitErrorBeacon,c as emitSetupEvent,b as getDeviceId,a as telemetryDisabled};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-LWUA3NUZ.js";import"../chunk-N7ODX6PO.js";import"../chunk-MPDSQALK.js";import"../chunk-E4U6AOTM.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as probeAndReport,b as runOneHeartbeatCycle,c as startTerminalTargetHeartbeat};
|
package/oclif.manifest.json
CHANGED
|
@@ -1,123 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
-
"convert": {
|
|
4
|
-
"aliases": [],
|
|
5
|
-
"args": {
|
|
6
|
-
"id": {
|
|
7
|
-
"description": "Instruction ID",
|
|
8
|
-
"name": "id",
|
|
9
|
-
"required": true
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"description": "Convert an instruction to a target format",
|
|
13
|
-
"examples": [
|
|
14
|
-
"<%= config.bin %> convert <id> --format claude-md",
|
|
15
|
-
"<%= config.bin %> convert <id> -f cursorrules --score",
|
|
16
|
-
"<%= config.bin %> convert <id> -f copilot -o .github/copilot-instructions.md"
|
|
17
|
-
],
|
|
18
|
-
"flags": {
|
|
19
|
-
"api-url": {
|
|
20
|
-
"description": "Override API base URL",
|
|
21
|
-
"env": "RULEMETRIC_API_URL",
|
|
22
|
-
"hidden": true,
|
|
23
|
-
"name": "api-url",
|
|
24
|
-
"hasDynamicHelp": false,
|
|
25
|
-
"multiple": false,
|
|
26
|
-
"type": "option"
|
|
27
|
-
},
|
|
28
|
-
"format": {
|
|
29
|
-
"char": "f",
|
|
30
|
-
"description": "Target format (e.g., claude-md, cursorrules)",
|
|
31
|
-
"name": "format",
|
|
32
|
-
"required": true,
|
|
33
|
-
"hasDynamicHelp": false,
|
|
34
|
-
"multiple": false,
|
|
35
|
-
"type": "option"
|
|
36
|
-
},
|
|
37
|
-
"score": {
|
|
38
|
-
"description": "Include quality score",
|
|
39
|
-
"name": "score",
|
|
40
|
-
"allowNo": false,
|
|
41
|
-
"type": "boolean"
|
|
42
|
-
},
|
|
43
|
-
"output": {
|
|
44
|
-
"char": "o",
|
|
45
|
-
"description": "Write output to file",
|
|
46
|
-
"name": "output",
|
|
47
|
-
"hasDynamicHelp": false,
|
|
48
|
-
"multiple": false,
|
|
49
|
-
"type": "option"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"hasDynamicHelp": false,
|
|
53
|
-
"hiddenAliases": [],
|
|
54
|
-
"id": "convert",
|
|
55
|
-
"pluginAlias": "@rulemetric/cli",
|
|
56
|
-
"pluginName": "@rulemetric/cli",
|
|
57
|
-
"pluginType": "core",
|
|
58
|
-
"strict": true,
|
|
59
|
-
"enableJsonFlag": false,
|
|
60
|
-
"isESM": true,
|
|
61
|
-
"relativePath": [
|
|
62
|
-
"dist",
|
|
63
|
-
"commands",
|
|
64
|
-
"convert.js"
|
|
65
|
-
]
|
|
66
|
-
},
|
|
67
|
-
"converters": {
|
|
68
|
-
"aliases": [],
|
|
69
|
-
"args": {},
|
|
70
|
-
"description": "List all supported conversion formats",
|
|
71
|
-
"examples": [
|
|
72
|
-
"<%= config.bin %> converters",
|
|
73
|
-
"<%= config.bin %> converters --tier 1"
|
|
74
|
-
],
|
|
75
|
-
"flags": {
|
|
76
|
-
"json": {
|
|
77
|
-
"description": "Format output as json.",
|
|
78
|
-
"helpGroup": "GLOBAL",
|
|
79
|
-
"name": "json",
|
|
80
|
-
"allowNo": false,
|
|
81
|
-
"type": "boolean"
|
|
82
|
-
},
|
|
83
|
-
"api-url": {
|
|
84
|
-
"description": "Override API base URL",
|
|
85
|
-
"env": "RULEMETRIC_API_URL",
|
|
86
|
-
"hidden": true,
|
|
87
|
-
"name": "api-url",
|
|
88
|
-
"hasDynamicHelp": false,
|
|
89
|
-
"multiple": false,
|
|
90
|
-
"type": "option"
|
|
91
|
-
},
|
|
92
|
-
"tier": {
|
|
93
|
-
"char": "t",
|
|
94
|
-
"description": "Filter by tier",
|
|
95
|
-
"name": "tier",
|
|
96
|
-
"hasDynamicHelp": false,
|
|
97
|
-
"multiple": false,
|
|
98
|
-
"options": [
|
|
99
|
-
"1",
|
|
100
|
-
"2",
|
|
101
|
-
"3"
|
|
102
|
-
],
|
|
103
|
-
"type": "option"
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
"hasDynamicHelp": false,
|
|
107
|
-
"hiddenAliases": [],
|
|
108
|
-
"id": "converters",
|
|
109
|
-
"pluginAlias": "@rulemetric/cli",
|
|
110
|
-
"pluginName": "@rulemetric/cli",
|
|
111
|
-
"pluginType": "core",
|
|
112
|
-
"strict": true,
|
|
113
|
-
"enableJsonFlag": true,
|
|
114
|
-
"isESM": true,
|
|
115
|
-
"relativePath": [
|
|
116
|
-
"dist",
|
|
117
|
-
"commands",
|
|
118
|
-
"converters.js"
|
|
119
|
-
]
|
|
120
|
-
},
|
|
121
3
|
"dashboard": {
|
|
122
4
|
"aliases": [],
|
|
123
5
|
"args": {},
|
|
@@ -209,91 +91,6 @@
|
|
|
209
91
|
"diagnostics.js"
|
|
210
92
|
]
|
|
211
93
|
},
|
|
212
|
-
"import": {
|
|
213
|
-
"aliases": [],
|
|
214
|
-
"args": {
|
|
215
|
-
"file": {
|
|
216
|
-
"description": "Path to file to import",
|
|
217
|
-
"name": "file",
|
|
218
|
-
"required": true
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
"description": "Import an existing config file as a RuleMetric instruction",
|
|
222
|
-
"examples": [
|
|
223
|
-
"<%= config.bin %> import .cursorrules",
|
|
224
|
-
"<%= config.bin %> import CLAUDE.md --format claude-md --name \"My Rules\""
|
|
225
|
-
],
|
|
226
|
-
"flags": {
|
|
227
|
-
"api-url": {
|
|
228
|
-
"description": "Override API base URL",
|
|
229
|
-
"env": "RULEMETRIC_API_URL",
|
|
230
|
-
"hidden": true,
|
|
231
|
-
"name": "api-url",
|
|
232
|
-
"hasDynamicHelp": false,
|
|
233
|
-
"multiple": false,
|
|
234
|
-
"type": "option"
|
|
235
|
-
},
|
|
236
|
-
"format": {
|
|
237
|
-
"description": "Source format (auto-detected if not provided)",
|
|
238
|
-
"name": "format",
|
|
239
|
-
"hasDynamicHelp": false,
|
|
240
|
-
"multiple": false,
|
|
241
|
-
"type": "option"
|
|
242
|
-
},
|
|
243
|
-
"name": {
|
|
244
|
-
"char": "n",
|
|
245
|
-
"description": "Override instruction name",
|
|
246
|
-
"name": "name",
|
|
247
|
-
"hasDynamicHelp": false,
|
|
248
|
-
"multiple": false,
|
|
249
|
-
"type": "option"
|
|
250
|
-
},
|
|
251
|
-
"scope": {
|
|
252
|
-
"char": "s",
|
|
253
|
-
"description": "Instruction scope",
|
|
254
|
-
"name": "scope",
|
|
255
|
-
"default": "personal",
|
|
256
|
-
"hasDynamicHelp": false,
|
|
257
|
-
"multiple": false,
|
|
258
|
-
"options": [
|
|
259
|
-
"org",
|
|
260
|
-
"team",
|
|
261
|
-
"project",
|
|
262
|
-
"personal"
|
|
263
|
-
],
|
|
264
|
-
"type": "option"
|
|
265
|
-
},
|
|
266
|
-
"scope-ref": {
|
|
267
|
-
"description": "Scope reference UUID",
|
|
268
|
-
"name": "scope-ref",
|
|
269
|
-
"hasDynamicHelp": false,
|
|
270
|
-
"multiple": false,
|
|
271
|
-
"type": "option"
|
|
272
|
-
},
|
|
273
|
-
"tags": {
|
|
274
|
-
"char": "t",
|
|
275
|
-
"description": "Comma-separated tags",
|
|
276
|
-
"name": "tags",
|
|
277
|
-
"hasDynamicHelp": false,
|
|
278
|
-
"multiple": false,
|
|
279
|
-
"type": "option"
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
"hasDynamicHelp": false,
|
|
283
|
-
"hiddenAliases": [],
|
|
284
|
-
"id": "import",
|
|
285
|
-
"pluginAlias": "@rulemetric/cli",
|
|
286
|
-
"pluginName": "@rulemetric/cli",
|
|
287
|
-
"pluginType": "core",
|
|
288
|
-
"strict": true,
|
|
289
|
-
"enableJsonFlag": false,
|
|
290
|
-
"isESM": true,
|
|
291
|
-
"relativePath": [
|
|
292
|
-
"dist",
|
|
293
|
-
"commands",
|
|
294
|
-
"import.js"
|
|
295
|
-
]
|
|
296
|
-
},
|
|
297
94
|
"launcher": {
|
|
298
95
|
"aliases": [],
|
|
299
96
|
"args": {},
|
|
@@ -1161,56 +958,6 @@
|
|
|
1161
958
|
"list.js"
|
|
1162
959
|
]
|
|
1163
960
|
},
|
|
1164
|
-
"experiments:list": {
|
|
1165
|
-
"aliases": [],
|
|
1166
|
-
"args": {},
|
|
1167
|
-
"description": "Show instructions under randomised test and what each sample supports",
|
|
1168
|
-
"examples": [
|
|
1169
|
-
"<%= config.bin %> experiments list",
|
|
1170
|
-
"<%= config.bin %> experiments list --project /path/to/project",
|
|
1171
|
-
"<%= config.bin %> experiments list --all"
|
|
1172
|
-
],
|
|
1173
|
-
"flags": {
|
|
1174
|
-
"api-url": {
|
|
1175
|
-
"description": "Override API base URL",
|
|
1176
|
-
"env": "RULEMETRIC_API_URL",
|
|
1177
|
-
"hidden": true,
|
|
1178
|
-
"name": "api-url",
|
|
1179
|
-
"hasDynamicHelp": false,
|
|
1180
|
-
"multiple": false,
|
|
1181
|
-
"type": "option"
|
|
1182
|
-
},
|
|
1183
|
-
"project": {
|
|
1184
|
-
"char": "p",
|
|
1185
|
-
"description": "Project path (defaults to current directory)",
|
|
1186
|
-
"name": "project",
|
|
1187
|
-
"hasDynamicHelp": false,
|
|
1188
|
-
"multiple": false,
|
|
1189
|
-
"type": "option"
|
|
1190
|
-
},
|
|
1191
|
-
"all": {
|
|
1192
|
-
"description": "Every project, not just this one",
|
|
1193
|
-
"name": "all",
|
|
1194
|
-
"allowNo": false,
|
|
1195
|
-
"type": "boolean"
|
|
1196
|
-
}
|
|
1197
|
-
},
|
|
1198
|
-
"hasDynamicHelp": false,
|
|
1199
|
-
"hiddenAliases": [],
|
|
1200
|
-
"id": "experiments:list",
|
|
1201
|
-
"pluginAlias": "@rulemetric/cli",
|
|
1202
|
-
"pluginName": "@rulemetric/cli",
|
|
1203
|
-
"pluginType": "core",
|
|
1204
|
-
"strict": true,
|
|
1205
|
-
"enableJsonFlag": false,
|
|
1206
|
-
"isESM": true,
|
|
1207
|
-
"relativePath": [
|
|
1208
|
-
"dist",
|
|
1209
|
-
"commands",
|
|
1210
|
-
"experiments",
|
|
1211
|
-
"list.js"
|
|
1212
|
-
]
|
|
1213
|
-
},
|
|
1214
961
|
"evals:agent": {
|
|
1215
962
|
"aliases": [],
|
|
1216
963
|
"args": {},
|
|
@@ -1945,6 +1692,56 @@
|
|
|
1945
1692
|
"validate-judge.js"
|
|
1946
1693
|
]
|
|
1947
1694
|
},
|
|
1695
|
+
"experiments:list": {
|
|
1696
|
+
"aliases": [],
|
|
1697
|
+
"args": {},
|
|
1698
|
+
"description": "Show instructions under randomised test and what each sample supports",
|
|
1699
|
+
"examples": [
|
|
1700
|
+
"<%= config.bin %> experiments list",
|
|
1701
|
+
"<%= config.bin %> experiments list --project /path/to/project",
|
|
1702
|
+
"<%= config.bin %> experiments list --all"
|
|
1703
|
+
],
|
|
1704
|
+
"flags": {
|
|
1705
|
+
"api-url": {
|
|
1706
|
+
"description": "Override API base URL",
|
|
1707
|
+
"env": "RULEMETRIC_API_URL",
|
|
1708
|
+
"hidden": true,
|
|
1709
|
+
"name": "api-url",
|
|
1710
|
+
"hasDynamicHelp": false,
|
|
1711
|
+
"multiple": false,
|
|
1712
|
+
"type": "option"
|
|
1713
|
+
},
|
|
1714
|
+
"project": {
|
|
1715
|
+
"char": "p",
|
|
1716
|
+
"description": "Project path (defaults to current directory)",
|
|
1717
|
+
"name": "project",
|
|
1718
|
+
"hasDynamicHelp": false,
|
|
1719
|
+
"multiple": false,
|
|
1720
|
+
"type": "option"
|
|
1721
|
+
},
|
|
1722
|
+
"all": {
|
|
1723
|
+
"description": "Every project, not just this one",
|
|
1724
|
+
"name": "all",
|
|
1725
|
+
"allowNo": false,
|
|
1726
|
+
"type": "boolean"
|
|
1727
|
+
}
|
|
1728
|
+
},
|
|
1729
|
+
"hasDynamicHelp": false,
|
|
1730
|
+
"hiddenAliases": [],
|
|
1731
|
+
"id": "experiments:list",
|
|
1732
|
+
"pluginAlias": "@rulemetric/cli",
|
|
1733
|
+
"pluginName": "@rulemetric/cli",
|
|
1734
|
+
"pluginType": "core",
|
|
1735
|
+
"strict": true,
|
|
1736
|
+
"enableJsonFlag": false,
|
|
1737
|
+
"isESM": true,
|
|
1738
|
+
"relativePath": [
|
|
1739
|
+
"dist",
|
|
1740
|
+
"commands",
|
|
1741
|
+
"experiments",
|
|
1742
|
+
"list.js"
|
|
1743
|
+
]
|
|
1744
|
+
},
|
|
1948
1745
|
"gateway:ensure": {
|
|
1949
1746
|
"aliases": [],
|
|
1950
1747
|
"args": {},
|
|
@@ -2264,6 +2061,56 @@
|
|
|
2264
2061
|
"create.js"
|
|
2265
2062
|
]
|
|
2266
2063
|
},
|
|
2064
|
+
"instructions:dedupe": {
|
|
2065
|
+
"aliases": [],
|
|
2066
|
+
"args": {},
|
|
2067
|
+
"description": "Report instructions in this project that repeat each other in different words",
|
|
2068
|
+
"examples": [
|
|
2069
|
+
"<%= config.bin %> instructions dedupe",
|
|
2070
|
+
"<%= config.bin %> instructions dedupe --dir apps/cli"
|
|
2071
|
+
],
|
|
2072
|
+
"flags": {
|
|
2073
|
+
"api-url": {
|
|
2074
|
+
"description": "Override API base URL",
|
|
2075
|
+
"env": "RULEMETRIC_API_URL",
|
|
2076
|
+
"hidden": true,
|
|
2077
|
+
"name": "api-url",
|
|
2078
|
+
"hasDynamicHelp": false,
|
|
2079
|
+
"multiple": false,
|
|
2080
|
+
"type": "option"
|
|
2081
|
+
},
|
|
2082
|
+
"dir": {
|
|
2083
|
+
"description": "Directory whose CLAUDE.md to check (ancestors are included)",
|
|
2084
|
+
"name": "dir",
|
|
2085
|
+
"default": ".",
|
|
2086
|
+
"hasDynamicHelp": false,
|
|
2087
|
+
"multiple": false,
|
|
2088
|
+
"type": "option"
|
|
2089
|
+
},
|
|
2090
|
+
"threshold": {
|
|
2091
|
+
"description": "Similarity floor 0-1 for calling two asks the same (default 0.3)",
|
|
2092
|
+
"name": "threshold",
|
|
2093
|
+
"hasDynamicHelp": false,
|
|
2094
|
+
"multiple": false,
|
|
2095
|
+
"type": "option"
|
|
2096
|
+
}
|
|
2097
|
+
},
|
|
2098
|
+
"hasDynamicHelp": false,
|
|
2099
|
+
"hiddenAliases": [],
|
|
2100
|
+
"id": "instructions:dedupe",
|
|
2101
|
+
"pluginAlias": "@rulemetric/cli",
|
|
2102
|
+
"pluginName": "@rulemetric/cli",
|
|
2103
|
+
"pluginType": "core",
|
|
2104
|
+
"strict": true,
|
|
2105
|
+
"enableJsonFlag": false,
|
|
2106
|
+
"isESM": true,
|
|
2107
|
+
"relativePath": [
|
|
2108
|
+
"dist",
|
|
2109
|
+
"commands",
|
|
2110
|
+
"instructions",
|
|
2111
|
+
"dedupe.js"
|
|
2112
|
+
]
|
|
2113
|
+
},
|
|
2267
2114
|
"instructions:delete": {
|
|
2268
2115
|
"aliases": [],
|
|
2269
2116
|
"args": {
|
|
@@ -4290,8 +4137,8 @@
|
|
|
4290
4137
|
"description": "Install a skill from the registry into your project",
|
|
4291
4138
|
"examples": [
|
|
4292
4139
|
"<%= config.bin %> skills install tdd-workflow",
|
|
4293
|
-
"<%= config.bin %> skills install tdd-workflow --
|
|
4294
|
-
"<%= config.bin %> skills install tdd-workflow --
|
|
4140
|
+
"<%= config.bin %> skills install tdd-workflow --preview",
|
|
4141
|
+
"<%= config.bin %> skills install tdd-workflow --force"
|
|
4295
4142
|
],
|
|
4296
4143
|
"flags": {
|
|
4297
4144
|
"api-url": {
|
|
@@ -4304,7 +4151,8 @@
|
|
|
4304
4151
|
"type": "option"
|
|
4305
4152
|
},
|
|
4306
4153
|
"tool": {
|
|
4307
|
-
"description": "
|
|
4154
|
+
"description": "Deprecated and ignored — skills install to every agent path at once",
|
|
4155
|
+
"hidden": true,
|
|
4308
4156
|
"name": "tool",
|
|
4309
4157
|
"hasDynamicHelp": false,
|
|
4310
4158
|
"multiple": false,
|
|
@@ -4328,6 +4176,12 @@
|
|
|
4328
4176
|
"hasDynamicHelp": false,
|
|
4329
4177
|
"multiple": false,
|
|
4330
4178
|
"type": "option"
|
|
4179
|
+
},
|
|
4180
|
+
"force": {
|
|
4181
|
+
"description": "Replace an existing skill directory at the Claude Code path",
|
|
4182
|
+
"name": "force",
|
|
4183
|
+
"allowNo": false,
|
|
4184
|
+
"type": "boolean"
|
|
4331
4185
|
}
|
|
4332
4186
|
},
|
|
4333
4187
|
"hasDynamicHelp": false,
|
|
@@ -4655,6 +4509,12 @@
|
|
|
4655
4509
|
"hasDynamicHelp": false,
|
|
4656
4510
|
"multiple": false,
|
|
4657
4511
|
"type": "option"
|
|
4512
|
+
},
|
|
4513
|
+
"force": {
|
|
4514
|
+
"description": "Add the rule even if this project already says the same thing in other words",
|
|
4515
|
+
"name": "force",
|
|
4516
|
+
"allowNo": false,
|
|
4517
|
+
"type": "boolean"
|
|
4658
4518
|
}
|
|
4659
4519
|
},
|
|
4660
4520
|
"hasDynamicHelp": false,
|
|
@@ -4717,6 +4577,40 @@
|
|
|
4717
4577
|
"hasDynamicHelp": false,
|
|
4718
4578
|
"multiple": false,
|
|
4719
4579
|
"type": "option"
|
|
4580
|
+
},
|
|
4581
|
+
"max-per-window": {
|
|
4582
|
+
"description": "How many rules the loop may adopt per project per window (0 stops it adopting)",
|
|
4583
|
+
"name": "max-per-window",
|
|
4584
|
+
"hasDynamicHelp": false,
|
|
4585
|
+
"multiple": false,
|
|
4586
|
+
"type": "option"
|
|
4587
|
+
},
|
|
4588
|
+
"max-per-run": {
|
|
4589
|
+
"description": "How many rules one nightly run may adopt",
|
|
4590
|
+
"name": "max-per-run",
|
|
4591
|
+
"hasDynamicHelp": false,
|
|
4592
|
+
"multiple": false,
|
|
4593
|
+
"type": "option"
|
|
4594
|
+
},
|
|
4595
|
+
"window-days": {
|
|
4596
|
+
"description": "Length of the budget window, in days",
|
|
4597
|
+
"name": "window-days",
|
|
4598
|
+
"hasDynamicHelp": false,
|
|
4599
|
+
"multiple": false,
|
|
4600
|
+
"type": "option"
|
|
4601
|
+
},
|
|
4602
|
+
"min-score": {
|
|
4603
|
+
"description": "Minimum suggestion score the loop may adopt (0–1)",
|
|
4604
|
+
"name": "min-score",
|
|
4605
|
+
"hasDynamicHelp": false,
|
|
4606
|
+
"multiple": false,
|
|
4607
|
+
"type": "option"
|
|
4608
|
+
},
|
|
4609
|
+
"reset": {
|
|
4610
|
+
"description": "Clear the budget overrides at this level and fall back to the shipped defaults",
|
|
4611
|
+
"name": "reset",
|
|
4612
|
+
"allowNo": false,
|
|
4613
|
+
"type": "boolean"
|
|
4720
4614
|
}
|
|
4721
4615
|
},
|
|
4722
4616
|
"hasDynamicHelp": false,
|
|
@@ -4893,5 +4787,5 @@
|
|
|
4893
4787
|
]
|
|
4894
4788
|
}
|
|
4895
4789
|
},
|
|
4896
|
-
"version": "0.
|
|
4790
|
+
"version": "0.11.0"
|
|
4897
4791
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulemetric/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"postgres": "^3.4.0",
|
|
81
81
|
"react": "^19.0.0",
|
|
82
82
|
"zod": "^3.24.0",
|
|
83
|
-
"@rulemetric/
|
|
84
|
-
"@rulemetric/skills-registry": "0.
|
|
85
|
-
"@rulemetric/
|
|
83
|
+
"@rulemetric/proxy": "0.11.0",
|
|
84
|
+
"@rulemetric/skills-registry": "0.11.0",
|
|
85
|
+
"@rulemetric/hooks": "0.11.0"
|
|
86
86
|
},
|
|
87
87
|
"//deps": "Worker (`evals agent`) runtime deps: the @opentelemetry/* set, @sentry/node, and postgres are STATIC top-level imports loaded at worker startup (via bundled @rulemetric/{telemetry,db}) — they MUST be runtime deps or a clean `npm i -g` crashes with ModuleLoadError. `better-sqlite3` is optionalDependencies (below): it's a native module, lazy `require()`'d inside a try/catch (packages/session providers cursor/opencode) so a missing binary degrades gracefully — making it a hard dep would break `npm i -g` on platforms without prebuilt binaries. `resend` stays a devDep: lazy `await import('resend')` guarded by RESEND_API_KEY, which end-user workers never set (provider falls back to noop). Classification verified via import-graph scan of dist/commands/evals/agent.js + per-importer static/lazy check.",
|
|
88
88
|
"optionalDependencies": {
|
|
@@ -101,13 +101,13 @@
|
|
|
101
101
|
"typescript": "^5.9.0",
|
|
102
102
|
"vitest": "^3.2.0",
|
|
103
103
|
"@rulemetric/api": "0.0.1",
|
|
104
|
-
"@rulemetric/db": "0.0.1",
|
|
105
104
|
"@rulemetric/core": "0.0.1",
|
|
105
|
+
"@rulemetric/db": "0.0.1",
|
|
106
106
|
"@rulemetric/effectiveness": "0.0.1",
|
|
107
|
-
"@rulemetric/email": "0.0.1",
|
|
108
107
|
"@rulemetric/session": "0.2.1",
|
|
109
108
|
"@rulemetric/telemetry": "0.0.1",
|
|
110
|
-
"@rulemetric/typescript-config": "0.0.0"
|
|
109
|
+
"@rulemetric/typescript-config": "0.0.0",
|
|
110
|
+
"@rulemetric/email": "0.0.1"
|
|
111
111
|
},
|
|
112
112
|
"scripts": {
|
|
113
113
|
"build": "node scripts/build.mjs",
|
package/dist/chunk-3PUOJ6F2.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-ZLLER3HP.js";function I(e){if(!e||typeof e!="object")return e;let r=e,n=r.project_areas;if(n!==void 0&&!Array.isArray(n)){let t=n&&typeof n=="object"?n.areas:void 0;r.project_areas=Array.isArray(t)?t:void 0}return e}o(I,"normalizeRecommendations");import{z as l}from"zod";var x=["org","team","project","personal"],_=l.object({name:l.string().min(1),description:l.string().min(1),type:l.literal("instruction").default("instruction"),scope:l.enum(x),version:l.string().min(1),tags:l.array(l.string()).optional(),compatibility:l.array(l.string()).optional(),slots:l.record(l.string(),l.string()).optional(),metadata:l.record(l.string(),l.unknown()).optional()});import{z as p}from"zod";var C=p.object({name:p.string().min(1),description:p.string().min(1),type:p.literal("prompt"),version:p.string().min(1),tags:p.array(p.string()).optional(),variables:p.array(p.string()).optional(),metadata:p.record(p.string(),p.unknown()).optional()});function h(e,r){let n=r.map(t=>`- ID: ${t.id}
|
|
2
|
-
Name: ${t.name}
|
|
3
|
-
Description: ${t.description}
|
|
4
|
-
Tags: ${t.tags.join(", ")}
|
|
5
|
-
Preview: ${t.contentPreview}`).join(`
|
|
6
|
-
|
|
7
|
-
`);return`You are an expert at matching AI coding instructions to software projects.
|
|
8
|
-
|
|
9
|
-
## Project
|
|
10
|
-
- Name: ${e.name}
|
|
11
|
-
- Description: ${e.description??"No description"}
|
|
12
|
-
- Languages: ${e.languages.join(", ")||"Unknown"}
|
|
13
|
-
- Topics: ${e.topics.join(", ")||"None"}
|
|
14
|
-
- Dependencies: ${e.dependencies.join(", ")||"None"}
|
|
15
|
-
|
|
16
|
-
## Available Instructions
|
|
17
|
-
|
|
18
|
-
${n}
|
|
19
|
-
|
|
20
|
-
## Task
|
|
21
|
-
|
|
22
|
-
Analyze the project and recommend which instructions would be most useful. Consider:
|
|
23
|
-
1. Language and framework alignment
|
|
24
|
-
2. Project purpose and what standards/practices would help
|
|
25
|
-
3. Security, testing, and quality needs based on the project type
|
|
26
|
-
|
|
27
|
-
Return your response as JSON in this exact format:
|
|
28
|
-
{
|
|
29
|
-
"recommendations": [
|
|
30
|
-
{ "instructionId": "<id>", "score": <0.0-1.0>, "reason": "<one sentence explanation>" }
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
Only include instructions with a relevance score >= 0.5. Order by score descending. Return valid JSON only, no markdown fences.`}o(h,"buildRecommendationPrompt");var R=32e3,O={name:"x".repeat(64),description:"x".repeat(256),languages:["TypeScript","Python","Go"],topics:["x".repeat(32)],dependencies:["x".repeat(32)]};function T(e,r={}){if(e.length===0)return[];let n=r.charBudget??R,t=h(O,[]).length,s=[],i=[],u=0;for(let d of e){let m=L(d);i.length>0&&t+u+m>n&&(s.push(i),i=[],u=0),i.push(d),u+=m}return i.length>0&&s.push(i),s}o(T,"batchCandidatesForPrompt");function L(e){return`- ID: ${e.id}
|
|
35
|
-
Name: ${e.name}
|
|
36
|
-
Description: ${e.description}
|
|
37
|
-
Tags: ${e.tags.join(", ")}
|
|
38
|
-
Preview: ${e.contentPreview}`.length+2}o(L,"renderedSize");var b=["Added","Changed","Fixed","Removed","Deprecated","Security"],j=/^##\s+\[([^\]]+)\](?:\s*[-–]\s*(\d{4}-\d{2}-\d{2}))?\s*$/,A=/^###\s+(.+?)\s*$/,N=/^[-*]\s+(.*\S)\s*$/,E=/^ {2,}(\S.*)$/;function F(e){let r=e.split(/\r?\n/),n=[],t=null,s=null,i=null;for(let u of r){let d=u.match(j);if(d){t&&n.push(t);let c=d[1].trim();t={version:c,date:d[2]??null,unreleased:c.toLowerCase()==="unreleased",sections:{}},s=null,i=null;continue}if(!t)continue;let m=u.match(A);if(m){let c=m[1].trim();b.includes(c)?(s=c,t.sections[s]||(t.sections[s]=[]),i=t.sections[s]):(s=null,i=null);continue}if(!s||!i)continue;let f=u.match(N);if(f){i.push(f[1]);continue}let g=u.match(E);if(g&&i.length>0){i[i.length-1]+=" "+g[1].trim();continue}}return t&&n.push(t),{entries:n}}o(F,"parseChangelog");function D(e){return e.entries.filter(r=>r.unreleased?!1:Object.values(r.sections).some(n=>n&&n.length>0))}o(D,"announceableEntries");function w(e){let r=/^(#{1,6})\s+/.exec(e);return r?r[1].length:0}o(w,"headingLevel");function M(e){return e.replace(/^#{1,6}\s+/,"").replace(/[`*_~]/g,"").trim().toLowerCase()}o(M,"normaliseHeading");function $(e,r){let n=M(r);if(n.length===0)return{content:e,removed:!1,removedText:null,reason:"not-found"};let t=e.split(`
|
|
39
|
-
`),s=[];for(let c=0;c<t.length;c+=1)w(t[c])>0&&M(t[c])===n&&s.push(c);if(s.length===0)return{content:e,removed:!1,removedText:null,reason:"not-found"};if(s.length>1)return{content:e,removed:!1,removedText:null,reason:"ambiguous"};let i=s[0],u=w(t[i]),d=t.length;for(let c=i+1;c<t.length;c+=1){let v=w(t[c]);if(v>0&&v<=u){d=c;break}}let m=t.slice(i,d).join(`
|
|
40
|
-
`),f=[...t.slice(0,i),...t.slice(d)];return f.join("").trim().length===0?{content:e,removed:!1,removedText:null,reason:"would-empty-file"}:{content:f.join(`
|
|
41
|
-
`).replace(/\n{3,}/g,`
|
|
42
|
-
|
|
43
|
-
`),removed:!0,removedText:m}}o($,"removeMarkdownSection");function G(e,r){let n=r.trim();if(n.length===0)return{content:e,removed:!1,removedText:null,reason:"not-found"};let t=e.indexOf(n);if(t===-1)return{content:e,removed:!1,removedText:null,reason:"not-found"};if(e.indexOf(n,t+1)!==-1)return{content:e,removed:!1,removedText:null,reason:"ambiguous"};let s=(e.slice(0,t)+e.slice(t+n.length)).replace(/\n{3,}/g,`
|
|
44
|
-
|
|
45
|
-
`);return s.trim().length===0?{content:e,removed:!1,removedText:null,reason:"would-empty-file"}:{content:s,removed:!0,removedText:n}}o(G,"removeExactBlock");var k=["HTTPS_PROXY","HTTP_PROXY","NODE_EXTRA_CA_CERTS"];function U(e,r){if(!e||typeof e!="object")return{value:e,removed:!1,removedDescriptions:[],reason:"not-found"};let n=structuredClone(e);if(!n.hooks)return{value:n,removed:!1,removedDescriptions:[],reason:"not-found"};let t=[];for(let[s,i]of Object.entries(n.hooks)){if(!Array.isArray(i))continue;let u=i.filter(d=>{let m=(d.hooks??[]).some(f=>typeof f.command=="string"&&f.command.includes(r));return m&&t.push(`${s}: ${d.matcher??"*"} \u2192 ${(d.hooks??[]).map(f=>f.command).join(", ")}`),!m});u.length===0?delete n.hooks[s]:n.hooks[s]=u}return Object.keys(n.hooks).length===0&&delete n.hooks,{value:n,removed:t.length>0,removedDescriptions:t,...t.length===0?{reason:"not-found"}:{}}}o(U,"removeHookByCommand");function H(e,r){if(!e||typeof e!="object")return{value:e,removed:!1,removedDescriptions:[],reason:"not-found"};let n=structuredClone(e);return!n.mcpServers||!(r in n.mcpServers)?{value:n,removed:!1,removedDescriptions:[],reason:"not-found"}:(delete n.mcpServers[r],Object.keys(n.mcpServers).length===0&&delete n.mcpServers,{value:n,removed:!0,removedDescriptions:[`mcpServers.${r}`]})}o(H,"removeMcpServer");function y(e){if(!e||typeof e!="object")return[];let r=e.env;return r?k.filter(n=>n in r):[]}o(y,"protectedEnvKeysPresent");function z(e,r){let n=y(e),t=new Set(y(r));return n.filter(s=>!t.has(s))}o(z,"lostProtectedEnvKeys");function B(e,r){let n=`HTTP ${e}`;if(!r||typeof r!="object")return{message:n};let t=r,s=typeof t.error=="string"&&t.error?t.error:t.error?JSON.stringify(t.error):n,i=typeof t.code=="string"&&t.code?t.code:void 0;return i?{message:s,code:i}:{message:s}}o(B,"parseApiError");import Me from"gray-matter";import{z as S}from"zod";var Ie=S.object({type:S.enum(["instruction","prompt"])});export{I as a,h as b,T as c,F as d,D as e,$ as f,G as g,U as h,H as i,z as j,B as k};
|
package/dist/chunk-DZ3FBQYD.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{a as M,b as j,c as N,d as v}from"./chunk-4PWGV2OW.js";import{a as S}from"./chunk-5RBLIVBF.js";import{c as O,d as z,f as b}from"./chunk-B3BHB26P.js";import{e as _,f as A,h as p}from"./chunk-QAV4HW7D.js";import{a as E}from"./chunk-3PUOJ6F2.js";import{a as h}from"./chunk-ZLLER3HP.js";async function Z(g,c){let{mirrorId:o,projectPath:e,projectId:a,config:d}=g,s=h(t=>c.logger.info(t),"log");if(d?.sessionId)return L({mirrorId:o,sessionId:d.sessionId},s);s(`Processing insights job ${o}...`),await p(`/api/insights-jobs/${o}/progress`,{status:"running",progress:{step:"reading_data"}});try{let{repaired:t}=await A("/api/sessions/repair-analyzed-at",{});t>0&&s(` Repaired analyzed_at on ${t} orphan session(s).`)}catch(t){s(` Warning: analyzed_at repair failed: ${t instanceof Error?t.message:String(t)}`)}let r=await H(e,a);if(!r)throw new S("No session data found \u2014 ensure sessions are captured and enriched.");s(` Found ${r.stats.sessions} sessions, generating recommendations...`);let f=20,n=200;if(z()!=="none"){let t=0,i=0;try{for(;t<n;){let m=await _(`/api/sessions?hasAnalysis=false&limit=${f}&offset=${i}`);if(m.length===0)break;s(` Generating facets for ${m.length} un-analyzed sessions (drained ${t} so far)...`);for(let y of m){if(t>=n)break;try{let u=await _(`/api/sessions/${y.id}/events?limit=100`);if(u.length<2){t++,i++;continue}let I=u.filter(w=>w.eventType==="user_message"||w.eventType==="human").map(w=>w.content?.slice(0,200)??"").filter(Boolean).join(`
|
|
2
|
-
---
|
|
3
|
-
`);if(!I){t++,i++;continue}let P=await b(v,I,4096);if(P){let w=u.filter(C=>C.eventType==="user_message"||C.eventType==="human").length;await p(`/api/sessions/${y.id}/enrich`,{analysis:{source:"generated_facets",...P},analyzedEventCount:u.length,analyzedTurnCount:w}),s(` Generated facets for session ${y.id} (${y.tool})`)}else i++;t++}catch(u){s(` Failed to generate facets for session ${y.id}: ${u instanceof Error?u.message:String(u)}`),t++,i++}}if(m.length<f)break}}catch(m){s(` Warning: facet generation failed after ${t} sessions: ${m instanceof Error?m.message:String(m)}`)}}let k=await F(e,s);k&&s(` Generator memory: ${k.split(`
|
|
4
|
-
`).length} lines of prior-advice context`);let l={},$=j.length+1;for(let t=0;t<j.length;t++){let i=j[t];s(` [${t+1}/${$}] Generating ${i.name}...`);try{await p(`/api/insights-jobs/${o}/progress`,{status:"running",progress:{step:i.name,current:t+1,total:$,partial:{...l}}})}catch(u){s(` Warning: progress update failed for ${i.name}: ${u instanceof Error?u.message:String(u)}`)}s(` Running LLM prompt for ${i.name}...`);let m=i.usesGeneratorMemory&&k?`${r.summary}
|
|
5
|
-
${k}`:r.summary,y=await b(i.prompt,m,i.maxTokens);y?(l[i.name]=y,s(` Got result for ${i.name}`)):s(` No result for ${i.name} (LLM returned null)`)}s(` [${$}/${$}] Generating at_a_glance...`),await p(`/api/insights-jobs/${o}/progress`,{status:"running",progress:{step:"at_a_glance",current:$,total:$,partial:{...l}}});let G=[r.summary,l.what_works?`
|
|
6
|
-
## What Works
|
|
7
|
-
${JSON.stringify(l.what_works)}`:"",l.friction_analysis?`
|
|
8
|
-
## Friction
|
|
9
|
-
${JSON.stringify(l.friction_analysis)}`:"",l.suggestions?`
|
|
10
|
-
## Suggestions
|
|
11
|
-
${JSON.stringify(l.suggestions)}`:"",l.on_the_horizon?`
|
|
12
|
-
## On the Horizon
|
|
13
|
-
${JSON.stringify(l.on_the_horizon)}`:""].join(`
|
|
14
|
-
`),R=await b(N,G,8192);R&&(l.at_a_glance=R),s(" Uploading results..."),s(` Done! Recommendations generated for job ${o}`),E(l);let T={recommendations:l};return await p(`/api/insights-jobs/${o}/state`,{result:T}).catch(t=>{s(`result persist failed: ${t instanceof Error?t.message:String(t)}`)}),await J(l,e,s),T}h(Z,"processInsights");async function J(g,c,o){if(c)try{let e=g.suggestions,a=Array.isArray(e?.claude_md_additions)?e.claude_md_additions.filter(n=>typeof n?.addition=="string"&&n.addition.trim().length>=12).map(n=>({addition:String(n.addition).trim(),why:String(n.why??"")})):[],d=Array.isArray(g.recommended_skills)?g.recommended_skills.filter(n=>typeof n?.skillId=="string"&&n.skillId.length>0).map(n=>({skillId:String(n.skillId),reason:String(n.reason??"")})):[],s=Array.isArray(e?.features_to_try)?e.features_to_try.filter(n=>typeof n?.feature=="string"&&n.feature.trim().length>=2).map(n=>({feature:String(n.feature).trim(),one_liner:String(n.one_liner??""),why_for_you:String(n.why_for_you??""),example_code:String(n.example_code??"")})):[];if(a.length===0&&d.length===0&&s.length===0)return;let r=await A("/api/insights/recommendations/nominate",{projectPath:c,additions:a.slice(0,20),skills:d.slice(0,20),features:s.slice(0,20)}),f=r.additionsRejected??[];o(` ${r.nominated} recommendation(s) nominated into the suggestion feed (${r.additionsCreated} new instruction(s)`+((r.featuresCreated??0)>0?`, ${r.featuresCreated} feature proposal(s)`:"")+(r.skillsUnresolved>0?`, ${r.skillsUnresolved} skill slug(s) unresolved`:"")+(f.length>0?`, ${f.length} rejected as unfilled templates`:"")+")");for(let n of f)o(` rejected "${n.name}" \u2014 unfilled placeholder(s): ${n.placeholders.join(", ")}`)}catch(e){o(` nomination skipped: ${e instanceof Error?e.message:String(e)}`)}}h(J,"nominateRecommendations");async function L(g,c){let{mirrorId:o,sessionId:e}=g;c(`Analyzing session ${e} via tool CLI...`),await p(`/api/insights-jobs/${o}/progress`,{status:"running",progress:{step:"fetching_session"}});let a=await _(`/api/sessions/${e}`);if(a.analysis&&a.analysis.source==="session_analysis")return c(` Session ${e} already analyzed \u2014 skipping (idempotency guard)`),{sessionId:e,skipped:!0,reason:"already_analyzed"};let d=await _(`/api/sessions/${e}/events?limit=100`);if(d.length<2)throw new S("Session has too few events to analyze");let s=d.filter(n=>n.eventType==="user_message"||n.eventType==="human").map(n=>n.content?.slice(0,200)??"").filter(Boolean).join(`
|
|
15
|
-
---
|
|
16
|
-
`);if(!s)throw new S("No user messages found in session");await p(`/api/insights-jobs/${o}/progress`,{status:"running",progress:{step:"running_analysis",tool:a.tool}});let r=await O(a.tool,v,s);if(!r)throw new Error(`Analysis failed \u2014 ${a.tool} CLI returned no result`);let f=d.filter(n=>n.eventType==="user_message"||n.eventType==="human").length;return await p(`/api/sessions/${e}/enrich`,{analysis:{source:"session_analysis",tool:a.tool,...r},analyzedEventCount:d.length,analyzedTurnCount:f}),c(` Session ${e} analyzed via ${a.tool}`),{sessionId:e,tool:a.tool,facets:r}}h(L,"processSessionAnalysisInline");async function F(g,c,o=_){try{let e=await o(`/api/insights/recommendations/history?projectPath=${encodeURIComponent(g??"")}`);return!e||!Array.isArray(e.dismissed)||!Array.isArray(e.repeated)?"":M(e)}catch(e){return c(` Warning: generator memory unavailable (${e instanceof Error?e.message:String(e)}) \u2014 generating without it`),""}}h(F,"fetchGeneratorMemory");async function H(g,c){try{let o=new URLSearchParams;c?o.set("projectId",c):g&&o.set("projectPath",g);let e=await _(`/api/insights/compute?${o}`);if(!e||e.total_sessions===0)return null;let a=Object.entries(e.tool_counts??{}).sort((s,r)=>r[1]-s[1]).slice(0,10).map(([s,r])=>`${s}: ${r}`).join(", ");return{summary:[`Sessions: ${e.total_sessions}, Messages: ${e.total_messages}, Hours: ${Math.round(e.total_duration_hours)}`,`Top tools: ${a}`,e.goal_categories&&Object.keys(e.goal_categories).length>0?`Goals: ${JSON.stringify(e.goal_categories)}`:"",e.friction&&Object.keys(e.friction).length>0?`Friction: ${JSON.stringify(e.friction)}`:"",e.outcomes&&Object.keys(e.outcomes).length>0?`Outcomes: ${JSON.stringify(e.outcomes)}`:"",e.projects&&Object.keys(e.projects).length>0?`Projects: ${JSON.stringify(e.projects)}`:""].filter(Boolean).join(`
|
|
17
|
-
`),stats:{sessions:e.total_sessions,totalMessages:e.total_messages,totalHours:e.total_duration_hours,toolCounts:e.tool_counts,goalCounts:e.goal_categories,frictionCounts:e.friction}}}catch{return null}}h(H,"buildDataSummaryFromApi");export{Z as a,F as b};
|