@rulemetric/cli 0.12.8 → 0.14.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/dist/base-command.js +1 -1
- package/dist/{chunk-CZTTW3MZ.js → chunk-2WQUOC6S.js} +20 -20
- package/dist/chunk-4VN5PG2S.js +1 -0
- package/dist/chunk-5MXZJWQS.js +2 -0
- package/dist/{chunk-NKJTNGXR.js → chunk-5XEGRU2R.js} +1 -1
- package/dist/chunk-6XTLP2G7.js +1 -0
- package/dist/chunk-74QIUVWY.js +1 -0
- package/dist/chunk-7ML2UCI7.js +1 -0
- package/dist/chunk-AHLVY52I.js +1 -0
- package/dist/{chunk-BTQQPQRG.js → chunk-AT2MMCOJ.js} +1 -1
- package/dist/{chunk-GOA5Q6TY.js → chunk-AXJAGWZB.js} +1 -1
- package/dist/{chunk-22ZDUL6H.js → chunk-BVOXWAJO.js} +1 -1
- package/dist/chunk-CT7FWSIU.js +3 -0
- package/dist/{chunk-RFISMWRW.js → chunk-DDYGA2DS.js} +1 -1
- package/dist/{chunk-OOFGV7EX.js → chunk-E5YE25QG.js} +1 -1
- package/dist/chunk-E7GQJML3.js +1 -0
- package/dist/{chunk-KJRMGTAO.js → chunk-E7RH43OS.js} +6 -6
- package/dist/{chunk-HQCPGDQE.js → chunk-ET7753IY.js} +1 -1
- package/dist/{chunk-INSKP5ED.js → chunk-EWGE7YTQ.js} +1 -1
- package/dist/chunk-EXVXKJ7Y.js +1 -0
- package/dist/chunk-FCTFHY3X.js +13 -0
- package/dist/chunk-FJX7WDPG.js +1 -0
- package/dist/{chunk-AGK5AUWT.js → chunk-FK55FXKQ.js} +1 -1
- package/dist/chunk-GH4EZK2O.js +1 -0
- package/dist/chunk-GN46S7T4.js +9 -0
- package/dist/{chunk-AFYZYXQ3.js → chunk-GQGGFHX7.js} +1 -1
- package/dist/chunk-GYNZ3OZF.js +1 -0
- package/dist/{chunk-GHWBW2IW.js → chunk-H4LUPIHJ.js} +1 -1
- package/dist/{chunk-YSLKV4XC.js → chunk-HAYO6JYI.js} +1 -1
- package/dist/{chunk-UKOI2Q4J.js → chunk-HFSISGCJ.js} +1 -1
- package/dist/chunk-HRJDKAJ4.js +1 -0
- package/dist/chunk-IC6VZHE6.js +1 -0
- package/dist/chunk-INAZLRY5.js +1 -0
- package/dist/{chunk-XFAFMYIP.js → chunk-IOX4VJPR.js} +2 -2
- package/dist/chunk-J4W6GNCF.js +2 -0
- package/dist/{chunk-PVPYLKB3.js → chunk-J7UZXRTH.js} +1 -1
- package/dist/{chunk-MILLBGCB.js → chunk-JKWB6UXA.js} +1 -1
- package/dist/chunk-JLBQKV4V.js +3 -0
- package/dist/{chunk-UTAETY5Z.js → chunk-JRAXWASH.js} +1 -1
- package/dist/{chunk-5PM4E27L.js → chunk-JRWQJZYQ.js} +1 -1
- package/dist/chunk-KINIFUZQ.js +1 -0
- package/dist/{chunk-E4RGYYBC.js → chunk-LDUJWJ6A.js} +1 -1
- package/dist/chunk-LMCICVE7.js +12 -0
- package/dist/chunk-MHVHGKDK.js +3 -0
- package/dist/chunk-MMM4B3KH.js +1 -0
- package/dist/{chunk-A2LHEUNW.js → chunk-MX34N7Y5.js} +1 -1
- package/dist/{chunk-TBU5SWA4.js → chunk-N26UEHI3.js} +1 -1
- package/dist/{chunk-DSJNZWCZ.js → chunk-N4RJ6CN7.js} +1 -1
- package/dist/{chunk-CPDMJGTC.js → chunk-N7SZWKCU.js} +1 -1
- package/dist/chunk-NRYVMGJN.js +1 -0
- package/dist/{chunk-FE2UWAIP.js → chunk-NSPDDSRR.js} +1 -1
- package/dist/{chunk-WCIX5KWG.js → chunk-O62OLKQL.js} +1 -1
- package/dist/{chunk-ARC4Q3GL.js → chunk-OLJF4K7L.js} +1 -1
- package/dist/{chunk-GRPUY2EZ.js → chunk-OMRH4JXS.js} +1 -1
- package/dist/{chunk-BJSVATVJ.js → chunk-OO2ZRKZY.js} +5 -5
- package/dist/chunk-OUK2AWEI.js +1 -0
- package/dist/chunk-OYAOLJUH.js +1 -0
- package/dist/chunk-PPAHIVG5.js +1 -0
- package/dist/{chunk-MJ5H7RDK.js → chunk-PPIZMPNI.js} +1 -1
- package/dist/chunk-PUX6P5KC.js +2 -0
- package/dist/chunk-QI3FJKGK.js +1 -0
- package/dist/chunk-RRM4HQG4.js +1 -0
- package/dist/{chunk-EZHL527S.js → chunk-S5CQSP35.js} +1 -1
- package/dist/chunk-S5U76YUI.js +1 -0
- package/dist/{chunk-NF2BIEAF.js → chunk-SBGXIPRN.js} +1 -1
- package/dist/chunk-SE3UKA3M.js +25 -0
- package/dist/chunk-SG4UDDHB.js +4 -0
- package/dist/chunk-SPJ73X7A.js +4 -0
- package/dist/chunk-SV73ASP2.js +1 -0
- package/dist/chunk-SWSOEYC7.js +1 -0
- package/dist/{chunk-DCH3QWB7.js → chunk-TTSDPDRH.js} +1 -1
- package/dist/chunk-TWPG3TEQ.js +48 -0
- package/dist/{chunk-AKXGUQ5B.js → chunk-U7BPWFOP.js} +1 -1
- package/dist/{chunk-L54TWWBY.js → chunk-UFQ43KXE.js} +1 -1
- package/dist/chunk-UJ7EPLKC.js +1 -0
- package/dist/{chunk-5N5S3NKS.js → chunk-UQDOOQCM.js} +1 -1
- package/dist/{chunk-G3HODHFN.js → chunk-V4PUYPTU.js} +1 -1
- package/dist/{chunk-SHYP27B7.js → chunk-VALRPZXH.js} +1 -1
- package/dist/{chunk-DPCAPIQB.js → chunk-VLWNSTYW.js} +1 -1
- package/dist/chunk-WSWZPNLG.js +1 -0
- package/dist/{chunk-UA5GEVGW.js → chunk-XAOLOR4Q.js} +1 -1
- package/dist/chunk-XAXEZI6Z.js +1 -0
- package/dist/{chunk-Z4YVOVMM.js → chunk-XFLKW6SJ.js} +1 -1
- package/dist/chunk-YNLHJHUP.js +1 -0
- package/dist/chunk-YP2CBUXH.js +5 -0
- package/dist/{chunk-VYZKKSX4.js → chunk-YUIRDBQQ.js} +1 -1
- package/dist/{chunk-2KJAM2NG.js → chunk-ZA6NXNPR.js} +1 -1
- package/dist/{chunk-UGACB66X.js → chunk-ZZHIBOMT.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 +2 -2
- 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 +3 -3
- 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/emit-instructions.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 -1
- 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 +18 -18
- 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 +1 -1
- 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/LauncherOverlay.js +1 -1
- package/dist/dashboard/launcher/api.js +1 -1
- package/dist/dashboard/launcher/useLaunchJobs.js +1 -1
- package/dist/dist-NHS7HY5Q.js +1 -0
- package/dist/harbor/cost_delta.py +377 -0
- package/dist/harbor/mcp_container_shell.py +156 -0
- package/dist/harbor/provenance.py +361 -0
- package/dist/harbor/rm-batch-task/environment/Dockerfile +6 -0
- package/dist/harbor/rm-batch-task/environment/items.jsonl +60 -0
- package/dist/harbor/rm-batch-task/inject.md +8 -0
- package/dist/harbor/rm-batch-task/instruction.md +8 -0
- package/dist/harbor/rm-batch-task/solution/solve.sh +68 -0
- package/dist/harbor/rm-batch-task/task.toml +30 -0
- package/dist/harbor/rm-batch-task/tests/test.sh +23 -0
- package/dist/harbor/rm-batch-task/tests/test_outputs.py +32 -0
- package/dist/harbor/rm-locality-task/environment/Dockerfile +8 -0
- package/dist/harbor/rm-locality-task/environment/workspace/deploy/prod/ingest.yaml +3 -0
- package/dist/harbor/rm-locality-task/environment/workspace/deploy/staging/ingest.yaml +3 -0
- package/dist/harbor/rm-locality-task/environment/workspace/docs/architecture/ingest.md +6 -0
- package/dist/harbor/rm-locality-task/environment/workspace/legacy/ingest_v1/config.yaml +2 -0
- package/dist/harbor/rm-locality-task/environment/workspace/packages/shared/defaults.py +4 -0
- package/dist/harbor/rm-locality-task/environment/workspace/services/ingest/config/limits.defaults.yaml +4 -0
- package/dist/harbor/rm-locality-task/environment/workspace/services/ingest/config/limits.yaml +3 -0
- package/dist/harbor/rm-locality-task/environment/workspace/services/ingest/loader.py +15 -0
- package/dist/harbor/rm-locality-task/environment/workspace/tests/fixtures/ingest_config.yaml +3 -0
- package/dist/harbor/rm-locality-task/inject.md +12 -0
- package/dist/harbor/rm-locality-task/instruction.md +4 -0
- package/dist/harbor/rm-locality-task/solution/solve.sh +14 -0
- package/dist/harbor/rm-locality-task/task.toml +30 -0
- package/dist/harbor/rm-locality-task/tests/test.sh +23 -0
- package/dist/harbor/rm-locality-task/tests/test_outputs.py +19 -0
- package/dist/harbor/rm-migrations-task/environment/Dockerfile +7 -0
- package/dist/harbor/rm-migrations-task/environment/applied.txt +2 -0
- package/dist/harbor/rm-migrations-task/environment/migrations/00001_init.sql +1 -0
- package/dist/harbor/rm-migrations-task/environment/migrations/00002_add_email.sql +1 -0
- package/dist/harbor/rm-migrations-task/inject.md +7 -0
- package/dist/harbor/rm-migrations-task/instruction.md +8 -0
- package/dist/harbor/rm-migrations-task/solution/solve.sh +8 -0
- package/dist/harbor/rm-migrations-task/task.toml +30 -0
- package/dist/harbor/rm-migrations-task/tests/test.sh +23 -0
- package/dist/harbor/rm-migrations-task/tests/test_outputs.py +36 -0
- package/dist/harbor/rm-pagination-task/environment/Dockerfile +6 -0
- package/dist/harbor/rm-pagination-task/environment/store.py +29 -0
- package/dist/harbor/rm-pagination-task/inject.md +8 -0
- package/dist/harbor/rm-pagination-task/instruction.md +5 -0
- package/dist/harbor/rm-pagination-task/solution/solve.sh +7 -0
- package/dist/harbor/rm-pagination-task/task.toml +30 -0
- package/dist/harbor/rm-pagination-task/tests/test.sh +23 -0
- package/dist/harbor/rm-pagination-task/tests/test_outputs.py +14 -0
- package/dist/harbor/rm_host_claude.py +264 -0
- package/dist/harbor/rm_host_codex.py +208 -0
- package/dist/harbor/run.sh +268 -0
- package/dist/harbor/summarize.py +248 -0
- 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/capture-scope-config.js +1 -1
- package/dist/lib/codex-capture-scope.js +1 -1
- package/dist/lib/codex-exec.js +1 -1
- package/dist/lib/ensure-api-key.js +1 -1
- package/dist/lib/ensure-fresh-token.js +1 -1
- package/dist/lib/eval-accumulation.js +1 -0
- package/dist/lib/eval-analyzer.js +1 -1
- package/dist/lib/eval-benchmark.js +1 -1
- package/dist/lib/eval-candidate-run.js +1 -1
- package/dist/lib/eval-case-generator.js +1 -1
- package/dist/lib/eval-conversation-handler.js +1 -1
- package/dist/lib/eval-executor.js +1 -1
- package/dist/lib/eval-grader.js +1 -1
- package/dist/lib/eval-meta-judge.js +1 -1
- package/dist/lib/eval-resume.js +1 -1
- package/dist/lib/eval-run-batch.js +1 -1
- package/dist/lib/eval-trigger-tester.js +1 -1
- package/dist/lib/evolution-enrolment.js +1 -1
- package/dist/lib/harbor-readiness.js +1 -0
- package/dist/lib/hooks-capture-gate.js +1 -1
- package/dist/lib/insights/generation/installed-asks.js +1 -1
- package/dist/lib/insights/nomination/nominate.js +1 -1
- package/dist/lib/instruction-proposer.js +1 -1
- package/dist/lib/instruction-snapshot.js +1 -1
- package/dist/lib/instructions/acceptance/accept-events.js +1 -1
- package/dist/lib/instructions/acceptance/accept-hook.js +1 -1
- package/dist/lib/instructions/acceptance/agent-instruction-files.js +1 -0
- package/dist/lib/instructions/acceptance/hook-install.js +1 -1
- package/dist/lib/instructions/acceptance/reverse-applications.js +1 -1
- package/dist/lib/instructions/acceptance/suggestion-accept.js +1 -1
- package/dist/lib/jobs/handlers/cron-auto-accept-suggestions.js +1 -1
- package/dist/lib/jobs/handlers/cron-eval-autorun.js +1 -1
- package/dist/lib/jobs/handlers/cron-instruction-evolution.js +1 -1
- package/dist/lib/jobs/handlers/cron-instruction-training.js +1 -1
- package/dist/lib/jobs/handlers/cron-reconcile-attribution.js +1 -1
- package/dist/lib/jobs/handlers/cron-refine-cases.js +1 -1
- package/dist/lib/jobs/handlers/cron-refresh-pricing.js +1 -1
- package/dist/lib/jobs/handlers/cron-retire-unused-skills.js +1 -1
- package/dist/lib/jobs/handlers/cron-suggest-instructions.js +1 -1
- package/dist/lib/jobs/handlers/distill-memories.js +1 -1
- package/dist/lib/jobs/handlers/harbor-ab-verdict.js +1 -0
- package/dist/lib/jobs/handlers/harbor-ab.js +1 -0
- package/dist/lib/jobs/handlers/process-changelog.js +1 -1
- package/dist/lib/jobs/handlers/process-conversation.js +1 -1
- package/dist/lib/jobs/handlers/process-eval.js +1 -1
- package/dist/lib/jobs/handlers/process-insights.js +1 -1
- package/dist/lib/jobs/handlers/process-judge-review.js +1 -1
- package/dist/lib/jobs/handlers/process-launch.js +1 -1
- package/dist/lib/jobs/handlers/process-memory-ab.js +1 -1
- package/dist/lib/jobs/handlers/process-run-cleanup.js +1 -1
- package/dist/lib/jobs/handlers/process-session-goal.js +1 -1
- package/dist/lib/jobs/shed-retry.js +1 -0
- package/dist/lib/judge-review-runner.js +1 -1
- package/dist/lib/llm-client.js +1 -1
- package/dist/lib/llm-json.js +1 -0
- package/dist/lib/llm-reply-parsers.js +1 -0
- package/dist/lib/machine-pause-detector.js +1 -1
- package/dist/lib/manual-tasks-meta.js +1 -1
- package/dist/lib/manual-tasks.js +1 -1
- package/dist/lib/measurement-llm.js +1 -0
- package/dist/lib/pi-exec.js +1 -0
- package/dist/lib/projects/workspace/eval-workspace.js +1 -1
- package/dist/lib/projects/workspace/worktree.js +1 -1
- package/dist/lib/refine-cases.js +1 -1
- package/dist/lib/research-client.js +1 -1
- package/dist/lib/retraction.js +1 -1
- package/dist/lib/reviewer-detect.js +1 -1
- package/dist/lib/service-environment.js +1 -0
- package/dist/lib/setup-steps.js +1 -1
- package/dist/lib/telemetry.js +1 -1
- package/dist/lib/terminal-target-heartbeat.js +1 -1
- package/dist/lib/tool-bin.js +1 -0
- package/dist/lib/tool-cli-map.js +1 -0
- package/dist/lib/transcript-instruction-linking.js +1 -0
- package/dist/lib/transcript-sync.js +1 -1
- package/dist/lib/work-report.js +1 -0
- package/oclif.manifest.json +17 -4
- package/package.json +10 -8
- package/dist/chunk-3DZD322E.js +0 -1
- package/dist/chunk-5OX6YKTR.js +0 -5
- package/dist/chunk-APXQLQZY.js +0 -1
- package/dist/chunk-C6GLNE6X.js +0 -1
- package/dist/chunk-CNQ5DTNC.js +0 -1
- package/dist/chunk-E7XOYGL5.js +0 -20
- package/dist/chunk-EVD5A3VI.js +0 -1
- package/dist/chunk-FUYR7CFD.js +0 -1
- package/dist/chunk-GN3ZHQ46.js +0 -1
- package/dist/chunk-GWDZNGUP.js +0 -2
- package/dist/chunk-LUCVMLHV.js +0 -1
- package/dist/chunk-O65AQZYB.js +0 -1
- package/dist/chunk-PWTTCSQA.js +0 -1
- package/dist/chunk-QBNLZJIR.js +0 -6
- package/dist/chunk-QXPYGN7I.js +0 -1
- package/dist/chunk-RIVEBBZC.js +0 -3
- package/dist/chunk-RLEMDKQ4.js +0 -12
- package/dist/chunk-S2SKT5PV.js +0 -1
- package/dist/chunk-TZA4HAVF.js +0 -1
- package/dist/chunk-UUFCTEBT.js +0 -1
- package/dist/chunk-UXB6DRR7.js +0 -3
- package/dist/chunk-W23MESHM.js +0 -1
- package/dist/chunk-W67DO5PT.js +0 -1
- package/dist/chunk-WMIUFMDI.js +0 -48
- package/dist/chunk-WO6MS654.js +0 -13
- package/dist/chunk-WTMJSL7R.js +0 -1
- package/dist/dist-XEWF3R3N.js +0 -1
package/dist/chunk-WMIUFMDI.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-ZLLER3HP.js";function X(e){return(e.trim().split(`
|
|
2
|
-
`)[0]?.replace(/^#+\s*/,"").trim()||"Suggested instruction").slice(0,120)}i(X,"recommendationTitle");function J(e){if(!e||typeof e!="object")return e;let t=e;if(Array.isArray(t.recommendation_candidates))return e;let n=t.suggestions;if(!n||typeof n!="object")return e;let o=n.claude_md_additions;return Array.isArray(o)&&(t.recommendation_candidates=o.flatMap(r=>{if(!r||typeof r!="object")return[];let s=r;if(typeof s.addition!="string"||s.addition.trim()==="")return[];let a=s.addition.trim();return[{title:X(a),artifact:"instruction",canonicalBody:a,rationale:typeof s.why=="string"?s.why:"",evidence:[],outcomeMetric:"session_outcome",renderings:[{harness:"claude_code",target:"CLAUDE.md",body:a},{harness:"codex",target:"AGENTS.md",body:a}]}]})),e}i(J,"normalizeRecommendationCandidates");var Z=new Set(["instruction"]);function Q(e){if(!e||typeof e!="object")return e;let t=e,n=t.recommendation_candidates;if(!Array.isArray(n)||n.length===0)return e;let o=n.filter(s=>!!s&&typeof s=="object"&&typeof s.canonicalBody=="string"&&s.canonicalBody.trim().length>0);for(let s of o){if(Array.isArray(s.renderings)&&s.renderings.length>0)continue;let a=s.canonicalBody.trim(),c=Z.has(String(s.artifact));s.renderings=c?[{harness:"claude_code",target:"CLAUDE.md",body:a},{harness:"codex",target:"AGENTS.md",body:a}]:[{harness:"claude_code",target:"manual",body:a},{harness:"codex",target:"manual",body:a}]}let r=t.suggestions&&typeof t.suggestions=="object"?t.suggestions:{};return(!Array.isArray(r.claude_md_additions)||r.claude_md_additions.length===0)&&(r.claude_md_additions=o.filter(s=>s.artifact==="instruction").map(s=>({addition:s.canonicalBody.trim(),why:typeof s.rationale=="string"?s.rationale:"",prompt_scaffold:"Add to CLAUDE.md (and AGENTS.md for Codex)."}))),(!Array.isArray(r.features_to_try)||r.features_to_try.length===0)&&(r.features_to_try=o.filter(s=>s.artifact!=="instruction").map(s=>({feature:typeof s.title=="string"?s.title:"Proposed change",one_liner:typeof s.rationale=="string"?s.rationale:"",why_for_you:typeof s.outcomeMetric=="string"?`Aimed at ${s.outcomeMetric}.`:"",example_code:s.canonicalBody.trim()}))),Array.isArray(r.usage_patterns)||(r.usage_patterns=[]),t.suggestions=r,e}i(Q,"deriveLegacyPresentation");function ee(e){if(!e||typeof e!="object")return e;let t=e,n=t.project_areas;if(n!==void 0&&!Array.isArray(n)){let o=n&&typeof n=="object"?n.areas:void 0;t.project_areas=Array.isArray(o)?o:void 0}return te(e),J(e),e}i(ee,"normalizeRecommendations");function te(e){if(!e||typeof e!="object")return;let t=e;if(Array.isArray(t.recommendation_candidates)&&t.recommendation_candidates.length>0)return;let n=t.suggestions;if(!n||typeof n!="object")return;let o=n.recommendation_candidates;!Array.isArray(o)||o.length===0||(t.recommendation_candidates=o)}i(te,"liftNestedCandidates");import{z as p}from"zod";var L=["org","team","project","personal"],R=p.object({name:p.string().min(1),description:p.string().min(1),type:p.literal("instruction").default("instruction"),scope:p.enum(L),version:p.string().min(1),tags:p.array(p.string()).optional(),compatibility:p.array(p.string()).optional(),slots:p.record(p.string(),p.string()).optional(),metadata:p.record(p.string(),p.unknown()).optional()});import{z as d}from"zod";var N=d.object({name:d.string().min(1),description:d.string().min(1),type:d.literal("prompt"),version:d.string().min(1),tags:d.array(d.string()).optional(),variables:d.array(d.string()).optional(),metadata:d.record(d.string(),d.unknown()).optional()});function v(e,t){let n=t.map(o=>`- ID: ${o.id}
|
|
3
|
-
Name: ${o.name}
|
|
4
|
-
Description: ${o.description}
|
|
5
|
-
Tags: ${o.tags.join(", ")}
|
|
6
|
-
Preview: ${o.contentPreview}`).join(`
|
|
7
|
-
|
|
8
|
-
`);return`You are an expert at matching AI coding instructions to software projects.
|
|
9
|
-
|
|
10
|
-
## Project
|
|
11
|
-
- Name: ${e.name}
|
|
12
|
-
- Description: ${e.description??"No description"}
|
|
13
|
-
- Languages: ${e.languages.join(", ")||"Unknown"}
|
|
14
|
-
- Topics: ${e.topics.join(", ")||"None"}
|
|
15
|
-
- Dependencies: ${e.dependencies.join(", ")||"None"}
|
|
16
|
-
|
|
17
|
-
## Available Instructions
|
|
18
|
-
|
|
19
|
-
${n}
|
|
20
|
-
|
|
21
|
-
## Task
|
|
22
|
-
|
|
23
|
-
Analyze the project and recommend which instructions would be most useful. Consider:
|
|
24
|
-
1. Language and framework alignment
|
|
25
|
-
2. Project purpose and what standards/practices would help
|
|
26
|
-
3. Security, testing, and quality needs based on the project type
|
|
27
|
-
|
|
28
|
-
Return your response as JSON in this exact format:
|
|
29
|
-
{
|
|
30
|
-
"recommendations": [
|
|
31
|
-
{ "instructionId": "<id>", "score": <0.0-1.0>, "reason": "<one sentence explanation>" }
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
Only include instructions with a relevance score >= ${.5}. Order by score descending. Return valid JSON only, no markdown fences.`}i(v,"buildRecommendationPrompt");var P=32e3,ne={name:"x".repeat(64),description:"x".repeat(256),languages:["TypeScript","Python","Go"],topics:["x".repeat(32)],dependencies:["x".repeat(32)]};function D(e,t={}){if(e.length===0)return[];let n=t.charBudget??P,o=v(ne,[]).length,r=[],s=[],a=0;for(let c of e){let l=oe(c);s.length>0&&o+a+l>n&&(r.push(s),s=[],a=0),s.push(c),a+=l}return s.length>0&&r.push(s),r}i(D,"batchCandidatesForPrompt");function oe(e){return`- ID: ${e.id}
|
|
36
|
-
Name: ${e.name}
|
|
37
|
-
Description: ${e.description}
|
|
38
|
-
Tags: ${e.tags.join(", ")}
|
|
39
|
-
Preview: ${e.contentPreview}`.length+2}i(oe,"renderedSize");var j=["Added","Changed","Fixed","Removed","Deprecated","Security"],re=/^##\s+\[([^\]]+)\](?:\s*[-–]\s*(\d{4}-\d{2}-\d{2}))?\s*$/,se=/^###\s+(.+?)\s*$/,ie=/^[-*]\s+(.*\S)\s*$/,ae=/^ {2,}(\S.*)$/;function ce(e){let t=e.split(/\r?\n/),n=[],o=null,r=null,s=null;for(let a of t){let c=a.match(re);if(c){o&&n.push(o);let m=c[1].trim();o={version:m,date:c[2]??null,unreleased:m.toLowerCase()==="unreleased",sections:{}},r=null,s=null;continue}if(!o)continue;let l=a.match(se);if(l){let m=l[1].trim();j.includes(m)?(r=m,o.sections[r]||(o.sections[r]=[]),s=o.sections[r]):(r=null,s=null);continue}if(!r||!s)continue;let u=a.match(ie);if(u){s.push(u[1]);continue}let f=a.match(ae);if(f&&s.length>0){s[s.length-1]+=" "+f[1].trim();continue}}return o&&n.push(o),{entries:n}}i(ce,"parseChangelog");function le(e){return e.entries.filter(t=>t.unreleased?!1:Object.values(t.sections).some(n=>n&&n.length>0))}i(le,"announceableEntries");function _(e){let t=/^(#{1,6})\s+/.exec(e);return t?t[1].length:0}i(_,"headingLevel");function $(e){return e.replace(/^#{1,6}\s+/,"").replace(/[`*_~]/g,"").trim().toLowerCase()}i($,"normaliseHeading");function ue(e,t){let n=$(t);if(n.length===0)return{content:e,removed:!1,removedText:null,reason:"not-found"};let o=e.split(`
|
|
40
|
-
`),r=[];for(let m=0;m<o.length;m+=1)_(o[m])>0&&$(o[m])===n&&r.push(m);if(r.length===0)return{content:e,removed:!1,removedText:null,reason:"not-found"};if(r.length>1)return{content:e,removed:!1,removedText:null,reason:"ambiguous"};let s=r[0],a=_(o[s]),c=o.length;for(let m=s+1;m<o.length;m+=1){let S=_(o[m]);if(S>0&&S<=a){c=m;break}}let l=o.slice(s,c).join(`
|
|
41
|
-
`),u=[...o.slice(0,s),...o.slice(c)];return u.join("").trim().length===0?{content:e,removed:!1,removedText:null,reason:"would-empty-file"}:{content:u.join(`
|
|
42
|
-
`).replace(/\n{3,}/g,`
|
|
43
|
-
|
|
44
|
-
`),removed:!0,removedText:l}}i(ue,"removeMarkdownSection");function me(e,t){let n=t.trim();if(n.length===0)return{content:e,removed:!1,removedText:null,reason:"not-found"};let o=e.indexOf(n);if(o===-1)return{content:e,removed:!1,removedText:null,reason:"not-found"};if(e.indexOf(n,o+1)!==-1)return{content:e,removed:!1,removedText:null,reason:"ambiguous"};let r=(e.slice(0,o)+e.slice(o+n.length)).replace(/\n{3,}/g,`
|
|
45
|
-
|
|
46
|
-
`);return r.trim().length===0?{content:e,removed:!1,removedText:null,reason:"would-empty-file"}:{content:r,removed:!0,removedText:n}}i(me,"removeExactBlock");var M=["HTTPS_PROXY","HTTP_PROXY","NODE_EXTRA_CA_CERTS"];function pe(e,t){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 o=[];for(let[r,s]of Object.entries(n.hooks)){if(!Array.isArray(s))continue;let a=s.filter(c=>{let l=(c.hooks??[]).some(u=>typeof u.command=="string"&&u.command.includes(t));return l&&o.push(`${r}: ${c.matcher??"*"} \u2192 ${(c.hooks??[]).map(u=>u.command).join(", ")}`),!l});a.length===0?delete n.hooks[r]:n.hooks[r]=a}return Object.keys(n.hooks).length===0&&delete n.hooks,{value:n,removed:o.length>0,removedDescriptions:o,...o.length===0?{reason:"not-found"}:{}}}i(pe,"removeHookByCommand");function de(e,t){if(!e||typeof e!="object")return{value:e,removed:!1,removedDescriptions:[],reason:"not-found"};let n=structuredClone(e);return!n.mcpServers||!(t in n.mcpServers)?{value:n,removed:!1,removedDescriptions:[],reason:"not-found"}:(delete n.mcpServers[t],Object.keys(n.mcpServers).length===0&&delete n.mcpServers,{value:n,removed:!0,removedDescriptions:[`mcpServers.${t}`]})}i(de,"removeMcpServer");function E(e){if(!e||typeof e!="object")return[];let t=e.env;return t?M.filter(n=>n in t):[]}i(E,"protectedEnvKeysPresent");function fe(e,t){let n=E(e),o=new Set(E(t));return n.filter(r=>!o.has(r))}i(fe,"lostProtectedEnvKeys");function he(e,t){let n=`HTTP ${e}`;if(!t||typeof t!="object")return{message:n};let o=t,r=typeof o.error=="string"&&o.error?o.error:o.error?JSON.stringify(o.error):n,s=typeof o.code=="string"&&o.code?o.code:void 0;return s?{message:r,code:s}:{message:r}}i(he,"parseApiError");var T=["inside","outside"];function y(e){return e.trim().toLowerCase()}i(y,"normalizeDependencyKey");function ge(e){let t=[];if(T.includes(e.boundaryClass)||t.push({field:"boundaryClass",message:`must be one of ${T.join(" | ")}`}),!Array.isArray(e.targets)||e.targets.length===0)t.push({field:"targets",message:"a proposal that cannot name the paths it writes cannot be applied"});else{for(let r of e.targets)if(typeof r!="string"||r.trim().length===0){t.push({field:"targets",message:"target paths must be non-empty"});break}let n=e.targets.filter(r=>typeof r=="string"&&(r.startsWith("/")||/^[A-Za-z]:[\\/]/.test(r)));n.length>0&&t.push({field:"targets",message:`targets must be project-relative (absolute: ${n.join(", ")})`});let o=e.targets.filter(r=>typeof r=="string"&&r.split(/[\\/]/).includes(".."));o.length>0&&t.push({field:"targets",message:`targets must not traverse outside the project (${o.join(", ")})`})}for(let n of["requires","provides"]){let o=e[n];if(!Array.isArray(o)){t.push({field:n,message:"must be an array of dependency keys"});continue}o.some(r=>typeof r!="string"||r.trim().length===0)&&t.push({field:n,message:"dependency keys must be non-empty strings"})}return t}i(ge,"validateArtifactSpec");function ye(e,t){let n=[],o=new Set(e.targets??[]);if(t.kind==="delete-paths"){e.boundaryClass!=="inside"&&n.push({field:"inverse",message:"deleting paths is only an inverse for `inside` artifacts; an `outside` path may hold text we did not write"}),t.paths.length===0&&n.push({field:"inverse.paths",message:"nothing to delete \u2014 this is not an inverse"});let r=t.paths.filter(s=>!o.has(s));return r.length>0&&n.push({field:"inverse.paths",message:`would delete paths the spec never declared: ${r.join(", ")}`}),n}return e.boundaryClass!=="outside"&&n.push({field:"inverse",message:"a compensation is only an inverse for `outside` artifacts; an `inside` path owes an exact undo"}),(!t.backupPath||t.backupPath.trim().length===0)&&n.push({field:"inverse.backupPath",message:"an `outside` write owes a backup"}),(!t.hashAtWrite||t.hashAtWrite.trim().length===0)&&n.push({field:"inverse.hashAtWrite",message:"without the post-write hash the undo cannot tell a drifted file from an untouched one"}),o.has(t.file)||n.push({field:"inverse.file",message:`wrote ${t.file}, which the spec did not declare as a target`}),t.kind==="remove-marked-region"?(!t.startMarker||!t.endMarker)&&n.push({field:"inverse",message:"an `outside` region needs both markers, or the undo cannot tell where our text ends"}):t.command.trim().length===0&&n.push({field:"inverse.command",message:"the exact command written is the identity of the entry; without it the undo is a search"}),n}i(ye,"validateArtifactInverse");var U="artifact";function A(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim().length>0):[]}i(A,"stringArray");function xe(e){if(!e||typeof e!="object")return null;let t=e[U];if(!t||typeof t!="object")return null;let n=t;return{boundaryClass:n.boundaryClass,targets:A(n.targets),requires:A(n.requires),provides:A(n.provides)}}i(xe,"parseArtifactSpec");var ve=["applied","measuring","improved","inconclusive","harmful","rollback_ready"];function H(e){return e.appliedAt?e.appliedAt instanceof Date?e.appliedAt.getTime():new Date(e.appliedAt).getTime():0}i(H,"appliedAtMs");function Se(e){return[...e].sort((t,n)=>{let o=H(n)-H(t);return o!==0?o:(n.applySeq??0)-(t.applySeq??0)})}i(Se,"orderForReversal");var z=["SessionStart","SessionEnd","UserPromptSubmit","PreToolUse","PostToolUse","PreCompact","Notification","Stop","SubagentStop"],b=".claude/settings.local.json";function F(e){return`# rm-artifact:${e}`}i(F,"hookTag");function _e(e,t){return`${e.trim()} ${F(t)}`}i(_e,"taggedHookCommand");var Ee=new Set(["if","then","else","elif","fi","for","while","until","do","done","case","esac","function","return","exit","cd","echo","test","true","false"]);function k(e){let t=e.trim().split(/\s+/)[0]??"";return!/^[a-z][a-z0-9_-]*$/.test(t)||Ee.has(t)?null:y(`cmd:${t}`)}i(k,"inferredCommandRequirement");function Ae(e,t){let n=new Set((t?.requires??[]).map(y).filter(Boolean)),o=k(e.command);return o&&n.add(o),{boundaryClass:"outside",targets:[b],requires:[...n],provides:(t?.provides??[]).map(y).filter(Boolean)}}i(Ae,"hookArtifactSpec");function x(e){let t=[];z.includes(e.event)||t.push({field:"event",message:`unknown hook event ${JSON.stringify(e.event)} \u2014 a hook on an event that never fires is indistinguishable from one that was never installed`});let n=(e.command??"").trim();return n.length===0?t.push({field:"command",message:"a hook with no command installs nothing"}):(/[\r\n]/.test(n)&&t.push({field:"command",message:"multi-line commands are refused: the identity tag is a trailing shell comment, which would silence only the final line, and a human reviewing an install should read one line"}),n.includes("\0")&&t.push({field:"command",message:"command contains a NUL byte"}),n.includes("rulemetric")&&t.push({field:"command",message:'refused: `rulemetric hooks uninstall` deletes every hook whose command contains "rulemetric", so installing one here would make this hook collateral damage of an unrelated command'}),n.includes("rm-artifact:")&&t.push({field:"command",message:"command already carries an artifact tag \u2014 installing it would produce two identities for one entry"})),e.matcher!==void 0&&(typeof e.matcher!="string"||e.matcher.trim().length===0)&&t.push({field:"matcher",message:"matcher must be a non-empty string when present"}),t}i(x,"validateHookSpec");function Te(e){let t=[`runs on: ${e.event}${e.matcher?` (tools matching ${e.matcher})`:""}`,`spawns: ${e.command.trim()}`,`writes: ${b} (one entry, tagged with this artifact's id)`],n=k(e.command);return n&&t.push(`needs: ${n} on PATH`),t}i(Te,"describeHookCapability");var Y="hook";function h(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}i(h,"asRecord");function K(e){let t=e.event,n=e.command;if(typeof t!="string"||typeof n!="string")return null;let o=typeof e.matcher=="string"?e.matcher:void 0;return{event:t,matcher:o,command:n}}i(K,"readBareSpec");function B(e){let t=h(e.hooks)??e,n=[];for(let[o,r]of Object.entries(t))if(Array.isArray(r))for(let s of r){let a=h(s);if(!a)continue;let c=typeof a.matcher=="string"&&a.matcher.length>0?a.matcher:void 0,l=Array.isArray(a.hooks)?a.hooks:[];for(let u of l){let f=h(u)?.command;typeof f=="string"&&n.push({event:o,matcher:c,command:f})}}return n.length===0?{spec:null,problems:[]}:n.length>1?{spec:null,problems:[{field:"hook",message:`proposal describes ${n.length} hook entries; one proposal installs exactly one hook, so its inverse stays exact and its review stays readable`}]}:{spec:n[0],problems:[]}}i(B,"readSettingsFragment");function be(e){let t=[],n=/```[a-zA-Z]*\n([\s\S]*?)```/g,o;for(;(o=n.exec(e))!==null;)t.push(o[1]);return t}i(be,"fencedBlocks");function ke(e){let t=h(h(e.frontmatter)?.artifact),n=t?h(t[Y]):null;if(n){let o=K(n);if(o)return{spec:o,problems:x(o),source:"envelope"};let r=B(n);if(r.spec)return{spec:r.spec,problems:x(r.spec),source:"envelope"};if(r.problems.length>0)return{spec:null,problems:r.problems,source:"envelope"}}for(let o of be(e.content??"")){let r;try{r=JSON.parse(o)}catch{continue}let s=h(r);if(!s)continue;let a=K(s);if(a)return{spec:a,problems:x(a),source:"content-fragment"};let c=B(s);if(c.spec)return{spec:c.spec,problems:x(c.spec),source:"content-fragment"};if(c.problems.length>0)return{spec:null,problems:c.problems,source:"content-fragment"}}return{spec:null,problems:[{field:"hook",message:"no hook spec found \u2014 a hook proposal must carry {event, command} in its artifact envelope or a JSON settings fragment in its body"}],source:"none"}}i(ke,"parseHookSpec");var Ce=/[\p{L}\p{N}]+/gu;function C(e){let t=new Set;for(let n of e.toLowerCase().matchAll(Ce)){let o=` ${n[0]} `;for(let r=0;r+3<=o.length;r+=1)t.add(o.slice(r,r+3))}return t}i(C,"trigrams");function g(e,t){let n=C(e),o=C(t);if(n.size===0||o.size===0)return 0;let r=0,[s,a]=n.size<=o.size?[n,o]:[o,n];for(let l of s)a.has(l)&&(r+=1);let c=n.size+o.size-r;return c===0?0:r/c}i(g,"trigramSimilarity");var w=.3,Oe=15;function O(e){let n=e.replace(/<!--[\s\S]*?-->/g," ").replace(/```[\s\S]*?```/g," "),o=[];for(let r of n.split(`
|
|
47
|
-
`)){let s=r.trim();if(s.length===0||s.startsWith("#"))continue;let a=s.replace(/^(?:[-*+]|\d+[.)])\s+/,"").trim();if(a.length!==0)for(let c of a.split(/(?<=[.!?])\s+(?=[A-Z(`"'*])/)){let l=c.trim();l.length>=Oe&&o.push(l)}}return o}i(O,"splitDirectives");function W(e,t,n=w){let o=O(e);if(o.length===0)return{redundant:!1,coverage:0,matches:[],novel:[]};let r=t.flatMap(c=>O(c.content).map(l=>({text:l,id:c.id,source:c.source}))),s=[],a=[];for(let c of o){let l=null;for(let u of r){let f=g(c,u.text);f<n||(l===null||f>l.similarity)&&(l={directive:c,matchedDirective:u.text,matchedId:u.id,matchedSource:u.source,similarity:f})}l?s.push(l):a.push(c)}return{redundant:a.length===0,coverage:s.length/o.length,matches:s,novel:a}}i(W,"assessRedundancy");function we(e,t=w){let n=[];for(let o=0;o<e.length;o+=1){let r=W(e[o].content,e.slice(0,o),t);r.matches.length>0&&n.push({instruction:e[o],verdict:r})}return n}i(we,"findInternalRedundancy");var G=.5,Ie=/-(?=[0-9a-f]{6}$)[0-9a-f]*[0-9][0-9a-f]*$/;function I(e){return e.trim().toLowerCase().replace(/^skills--/,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(Ie,"").replace(/-+$/,"")}i(I,"skillNameStem");function Le(e,t,n=G){let o=I(e.name);for(let s of t)if(o.length>0&&I(s.name)===o)return{name:s.name,similarity:g(e.content,s.content),reason:"name-stem"};let r=null;for(let s of t){let a=g(e.content,s.content);a<n||(r===null||a>r.similarity)&&(r={name:s.name,similarity:a,reason:"body"})}return r}i(Le,"assessSkillDuplication");var Re=new Set(["sh","bash","zsh","fish"]),Ne=new Set(["mjs","cjs","js","ts","py","rb","pl"]),Pe=/(?:^|[\s(`'"])(?:sudo\s+)?(?:node|npx|pnpm|npm|yarn|bun|deno|tsx|ts-node|vitest|jest|python3?|python|ruby|perl|bash|sh|zsh|exec|run|dlx)\s+(?:[-\w=@./]+\s+)*$/,De=/(?:\.\/)?(?:[\w.@-]+\/)+[\w.@-]+\.\w+/g;function je(e){return e.replace(/```[\w-]*\n?/g," ").replace(/`/g," ")}i(je,"stripCodeMarkers");function $e(e){let t=e.trim();return t=t.replace(/[.,;:)\]]+$/,""),t.startsWith("./")&&(t=t.slice(2)),t.length===0||t.startsWith("/")||t.startsWith("~")||t.startsWith("..")||/[<>{}*?]/.test(t)?null:t}i($e,"normalise");function q(e){let t=je(e),n=new Set,o=[];for(let r of t.matchAll(De)){let s=r[0],a=r.index??0,c=t.slice(Math.max(0,a-1),a);if(c.length>0&&!/[\s(['"=]/.test(c))continue;let l=$e(s);if(!l)continue;let u=l.slice(l.lastIndexOf(".")+1).toLowerCase();(Re.has(u)||Ne.has(u)&&(s.startsWith("./")||Pe.test(t.slice(t.lastIndexOf(`
|
|
48
|
-
`,Math.max(0,a-1))+1,a))))&&(n.has(l)||(n.add(l),o.push({reference:s,path:l})))}return o}i(q,"extractCommandReferences");function Me(e,t){return q(e).filter(n=>!t(n.path))}i(Me,"findUnresolvableReferences");import Nt from"gray-matter";import{z as V}from"zod";var $t=V.object({type:V.enum(["instruction","prompt"])});export{Q as a,ee as b,v as c,D as d,ce as e,le as f,ue as g,me as h,pe as i,de as j,fe as k,he as l,y as m,ge as n,ye as o,xe as p,ve as q,Se as r,b as s,F as t,_e as u,Ae as v,Te as w,ke as x,O as y,W as z,we as A,Le as B,Me as C};
|
package/dist/chunk-WO6MS654.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{a as I}from"./chunk-5RBLIVBF.js";import{a as W}from"./chunk-HQCPGDQE.js";import{a as j,d as O}from"./chunk-3UKZJAFS.js";import{c as U}from"./chunk-FE2UWAIP.js";import{a as T,b as P,c as H,d as A}from"./chunk-SJKS3PYX.js";import{c as x,d as L,f as S}from"./chunk-QBNLZJIR.js";import{e as _,f as J,h as d}from"./chunk-UGACB66X.js";import{a as z,b as F}from"./chunk-WMIUFMDI.js";import{a as f}from"./chunk-ZLLER3HP.js";var B=f((l,{limit:a,sort:n,eventTypes:s})=>_(`/api/sessions/${l}/events?limit=${a}&sort=${n}&eventType=${encodeURIComponent(s.join(","))}&hasContent=true`),"fetchTranscriptTurns");async function is(l,a){let{mirrorId:n,projectPath:s,projectId:r,config:g}=l,t=f(e=>a.logger.info(e),"log");if(g?.sessionId)return Y({mirrorId:n,sessionId:g.sessionId},t);t(`Processing insights job ${n}...`),await d(`/api/insights-jobs/${n}/progress`,{status:"running",progress:{step:"reading_data"}});try{let{repaired:e}=await J("/api/sessions/repair-analyzed-at",{});e>0&&t(` Repaired analyzed_at on ${e} orphan session(s).`)}catch(e){t(` Warning: analyzed_at repair failed: ${e instanceof Error?e.message:String(e)}`)}let p=20,w=200,v=15*6e4,D=3,C=Date.now()+v;if(L()!=="none"){let e=0,o=0;try{for(;e<w&&Date.now()<C;){let c=await _(`/api/sessions?needsFacets=true&graderVersion=${2}&limit=${p}&offset=${o}`);if(c.length===0)break;t(` Generating facets for ${c.length} un-analyzed sessions (drained ${e} so far)...`);for(let $=0;$<c.length&&!(e>=w||Date.now()>=C);$+=D){let R=c.slice($,$+D);await Promise.all(R.map(async m=>{if(!(e>=w||Date.now()>=C))try{let u=await O(q=>B(m.id,q));if(u.turnCount<2){e++,o++;return}let k=await S(A,u.text,4096);k&&typeof k.outcome=="string"?(await d(`/api/sessions/${m.id}/enrich`,{analysis:{source:"generated_facets",...k,graderVersion:2},...m.eventCount!=null?{analyzedEventCount:m.eventCount}:{},analyzedTurnCount:u.turnCount}),t(` Generated facets for session ${m.id} (${m.tool}, ${u.turnCount} turns)`)):o++,e++}catch(u){t(` Failed to generate facets for session ${m.id}: ${u instanceof Error?u.message:String(u)}`),e++,o++}}))}if(c.length<p)break}}catch(c){t(` Warning: facet generation failed after ${e} sessions: ${c instanceof Error?c.message:String(c)}`)}if(e>0){let c=Date.now()>=C?`time budget (${Math.round(v/6e4)}m)`:e>=w?`hard cap (${w})`:"queue empty";t(` Facet drain stopped on ${c} after ${e} session(s); the rest resume next run.`)}}let b=await K(s,r);if(!b)throw new I("No session data found \u2014 ensure sessions are captured and enriched.");t(` Found ${b.stats.sessions} sessions, generating recommendations...`);let E=await Z(s,t);E&&t(` Generator memory: ${E.split(`
|
|
2
|
-
`).length} lines of prior-advice context`);let i={},y=[],h=P.length+1;for(let e=0;e<P.length;e++){let o=P[e];t(` [${e+1}/${h}] Generating ${o.name}...`);try{await d(`/api/insights-jobs/${n}/progress`,{status:"running",progress:{step:o.name,current:e+1,total:h,partial:{...i}}})}catch(u){t(` Warning: progress update failed for ${o.name}: ${u instanceof Error?u.message:String(u)}`)}t(` Running LLM prompt for ${o.name}...`);let c=o.usesGeneratorMemory&&E?`${b.summary}
|
|
3
|
-
${E}`:b.summary,$=Date.now(),R=await S(o.prompt,c,o.maxTokens,{timeoutMs:o.timeoutMs}),m=Date.now()-$;R?(i[o.name]=R,t(` Got result for ${o.name} (${Math.round(m/1e3)}s)`)):(y.push(o.name),t(` No result for ${o.name} after ${Math.round(m/1e3)}s (budget ${Math.round((o.timeoutMs??12e4)/1e3)}s) \u2014 section DROPPED`))}t(` [${h}/${h}] Generating at_a_glance...`),await d(`/api/insights-jobs/${n}/progress`,{status:"running",progress:{step:"at_a_glance",current:h,total:h,partial:{...i}}});let V=[b.summary,i.what_works?`
|
|
4
|
-
## What Works
|
|
5
|
-
${JSON.stringify(i.what_works)}`:"",i.friction_analysis?`
|
|
6
|
-
## Friction
|
|
7
|
-
${JSON.stringify(i.friction_analysis)}`:"",i.suggestions?`
|
|
8
|
-
## Suggestions
|
|
9
|
-
${JSON.stringify(i.suggestions)}`:"",i.on_the_horizon?`
|
|
10
|
-
## On the Horizon
|
|
11
|
-
${JSON.stringify(i.on_the_horizon)}`:""].join(`
|
|
12
|
-
`),G=await S(H,V,8192);G&&(i.at_a_glance=G),t(" Uploading results..."),t(` Done! Recommendations generated for job ${n}`),F(i),z(i);let N={recommendations:i,...y.length>0?{sectionsFailed:y}:{}};return y.length>0&&t(` \u26A0 ${y.length} section(s) produced nothing: ${y.join(", ")}`),await d(`/api/insights-jobs/${n}/state`,{result:N}).catch(e=>{t(`result persist failed: ${e instanceof Error?e.message:String(e)}`)}),await W(i,s,t),N}f(is,"processInsights");async function Y(l,a){let{mirrorId:n,sessionId:s}=l;a(`Analyzing session ${s} via tool CLI...`),await d(`/api/insights-jobs/${n}/progress`,{status:"running",progress:{step:"fetching_session"}});let r=await _(`/api/sessions/${s}`);if(r.analysis&&r.analysis.source==="session_analysis")return a(` Session ${s} already analyzed \u2014 skipping (idempotency guard)`),{sessionId:s,skipped:!0,reason:"already_analyzed"};let g=await O(p=>B(s,p));if(g.turnCount<2)throw new I("Session has too few conversation turns to analyze");await d(`/api/insights-jobs/${n}/progress`,{status:"running",progress:{step:"running_analysis",tool:r.tool}});let t=await x(r.tool,A,g.text);if(!t)throw new Error(`Analysis failed \u2014 ${r.tool} CLI returned no result`);return await d(`/api/sessions/${s}/enrich`,{analysis:{source:"session_analysis",tool:r.tool,...t,graderVersion:2},...r.eventCount!=null?{analyzedEventCount:r.eventCount}:{},analyzedTurnCount:g.turnCount}),a(` Session ${s} analyzed via ${r.tool}`),{sessionId:s,tool:r.tool,facets:t}}f(Y,"processSessionAnalysisInline");async function Z(l,a,n=_,s=U){let{asks:r,omitted:g}=s(l);try{let t=await n(`/api/insights/recommendations/history?projectPath=${encodeURIComponent(l??"")}`);return!t||!Array.isArray(t.dismissed)||!Array.isArray(t.repeated)?T({dismissed:[],repeated:[],installed:r,installedOmitted:g}):T({...t,installed:r,installedOmitted:g})}catch(t){return a(` Warning: generator memory unavailable (${t instanceof Error?t.message:String(t)}) \u2014 generating without it`),T({dismissed:[],repeated:[],installed:r,installedOmitted:g})}}f(Z,"fetchGeneratorMemory");async function K(l,a){try{let n=new URLSearchParams;a?n.set("projectId",a):l&&n.set("projectPath",l);let s=await _(`/api/insights/compute?${n}`);if(!s||s.total_sessions===0)return null;let r=Object.entries(s.tool_counts??{}).sort((t,p)=>p[1]-t[1]).slice(0,10).map(([t,p])=>`${t}: ${p}`).join(", ");return{summary:[`Sessions: ${s.total_sessions}, Messages: ${s.total_messages}, Session-hours: ${Math.round(s.total_duration_hours)} (sum of per-session spans across ${s.sessions_with_meta} measured sessions; concurrent sessions counted separately, so this exceeds elapsed time)`,`Top tools: ${r}`,s.goal_categories&&Object.keys(s.goal_categories).length>0?`Goals: ${JSON.stringify(s.goal_categories)}`:"",s.friction&&Object.keys(s.friction).length>0?`Friction: ${JSON.stringify(s.friction)}`:"",s.outcomes&&Object.keys(s.outcomes).length>0?`Outcomes: ${JSON.stringify(s.outcomes)}`:"",s.projects&&Object.keys(s.projects).length>0?`Projects: ${JSON.stringify(s.projects)}`:""].filter(Boolean).join(`
|
|
13
|
-
`),stats:{sessions:s.total_sessions,totalMessages:s.total_messages,totalSessionHours:s.total_duration_hours,measuredSessions:s.sessions_with_meta,toolCounts:s.tool_counts,goalCounts:s.goal_categories,frictionCounts:s.friction}}}catch(n){throw new M(n instanceof Error?n.message:String(n))}}f(K,"buildDataSummaryFromApi");var M=class extends Error{static{f(this,"InsightsSummaryUnavailableError")}constructor(a){super(`Could not read session summary (retryable): ${a}`),this.name="InsightsSummaryUnavailableError"}};export{is as a,Z as b};
|
package/dist/chunk-WTMJSL7R.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as k}from"./chunk-GN3ZHQ46.js";import{a as f}from"./chunk-KGURGIZ2.js";import{a as $}from"./chunk-BJSVATVJ.js";import{d as v}from"./chunk-TZA4HAVF.js";import{f as p}from"./chunk-UGACB66X.js";import{a as c}from"./chunk-ZLLER3HP.js";async function x(m,t,s=()=>{}){let{eval_:r,configuration:i,targetContent:g,runNumber:o}=m;s(`[${i}] ${r.name} run#${o} \u2014 executing...`);let a=k({targetType:t.targetType,targetContent:g,targetName:t.targetName}),d={methodology:a.methodology,delivery:a.delivery,isolated:a.isWorktree,...t.candidateContentHash?{candidateContentHash:t.candidateContentHash}:{},...a.leakedFiles.length?{leakedFiles:a.leakedFiles}:{}};a.isWorktree||s(`[${i}] ${r.name} run#${o} \u2014 \u26A0 no git worktree; running without repo context`),a.leakedFiles.length&&s(`[${i}] ${r.name} run#${o} \u2014 \u26A0 CONTAMINATED: ${a.leakedFiles.join(", ")} survived the strip`);try{let n=await v({prompt:r.prompt,targetContent:a.systemPrompt,workDir:a.workDir,timeout:t.timeout,model:t.model});if(n.error){let e=f(n.error);return s(`[${i}] ${r.name} run#${o} \u2014 FAILED (${e.kind}): ${n.error}`),{evalId:r.id,evalTargetId:t.targetId,evalTargetVersion:t.targetVersion,configuration:i,runNumber:o,iteration:t.iteration,status:"failed",outputs:{error:n.error,failureKind:e.kind,failureClass:e.class,...d},timing:{duration_ms:n.durationMs,total_tokens:n.totalTokens},grading:{},failure:e}}s(`[${i}] ${r.name} run#${o} \u2014 completed in ${(n.durationMs/1e3).toFixed(1)}s`);let u={};if(!t.skipGrading&&r.expectations.length>0){s(`[${i}] ${r.name} run#${o} \u2014 grading...`);let e=await $({prompt:r.prompt,output:n.output,expectations:r.expectations,model:t.graderModel??t.model,timeout:t.timeout});u=e,s(`[${i}] ${r.name} run#${o} \u2014 grading done: pass_rate=${e.summary.pass_rate==null?"n/a (all assertions errored)":`${(e.summary.pass_rate*100).toFixed(0)}%`}`)}return{evalId:r.id,evalTargetId:t.targetId,evalTargetVersion:t.targetVersion,configuration:i,runNumber:o,iteration:t.iteration,status:"completed",outputs:{transcript:n.output,...d},timing:{duration_ms:n.durationMs,total_tokens:n.totalTokens,total_duration_seconds:n.durationMs/1e3},grading:u}}finally{a.cleanup()}}c(x,"executeAndGradeCase");async function R(m){let{cases:t,targetContent:s,concurrency:r,runNumber:i,opts:g,skipBaseline:o,onLog:a=c(()=>{},"onLog")}=m,d=o?["with_target"]:["with_target","without_target"],n=[];for(let e of t)for(let l of d)n.push({eval_:e,configuration:l,targetContent:l==="with_target"?s:void 0,runNumber:i});let u=[];for(let e=0;e<n.length;e+=Math.max(1,r)){let l=n.slice(e,e+Math.max(1,r)),h=await Promise.all(l.map(b=>x(b,g,a)));u.push(...h)}for(let e of u)try{await p("/api/eval-runs",e)}catch(l){a(` \u26A0 failed to post a run result: ${l instanceof Error?l.message:String(l)}`)}try{await p(`/api/eval-targets/${g.targetId}/label-state`,{})}catch(e){a(` \u26A0 label-state notification skipped: ${e instanceof Error?e.message:String(e)}`)}return{completed:u.filter(e=>e.status==="completed").length,failed:u.filter(e=>e.status==="failed").length,results:u}}c(R,"runBatchAndPost");export{x as a,R as b};
|
package/dist/dist-XEWF3R3N.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w}from"./chunk-E7XOYGL5.js";import"./chunk-ZLLER3HP.js";export{c as ClaudeCodeAdapter,i as CodexAdapter,f as CopilotAgentAdapter,d as CursorAdapter,g as RuleMetricMcpAdapter,b as SESSION_EVENT_TYPES,a as SESSION_TOOLS,e as VSCodeCopilotAdapter,s as buildTmuxAttachCommand,r as buildTmuxHasSessionArgs,p as buildTmuxLaunchArgs,q as buildTmuxSendKeysArgs,k as detectTool,m as discoverAllSessions,h as freshCodexState,j as getAdapter,l as getAllProviders,u as getAvailableLaunchers,t as getLauncher,n as getProvider,v as sanitizeBranch,o as sanitizeTmuxName,w as worktreePathFor};
|