@clear-capabilities/agentic-security-scanner 0.172.0 → 0.173.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/CHANGELOG.md +29 -0
- package/bin/agentic-security.js +37 -0
- package/dist/119.index.js +197 -0
- package/dist/128.index.js +129 -0
- package/dist/1293.index.js +5689 -0
- package/dist/1336.index.js +101 -101
- package/dist/1351.index.js +133 -0
- package/dist/1387.index.js +271 -0
- package/dist/1437.index.js +23 -0
- package/dist/1445.index.js +110 -0
- package/dist/1505.index.js +151 -0
- package/dist/1557.index.js +293 -0
- package/dist/1621.index.js +311 -0
- package/dist/1751.index.js +160 -0
- package/dist/1765.index.js +727 -0
- package/dist/1861.index.js +690 -0
- package/dist/1898.index.js +116 -0
- package/dist/1906.index.js +433 -0
- package/dist/1920.index.js +1 -291
- package/dist/208.index.js +1631 -0
- package/dist/2199.index.js +0 -239
- package/dist/2223.index.js +159 -0
- package/dist/2530.index.js +152 -0
- package/dist/2565.index.js +116 -0
- package/dist/2574.index.js +127 -0
- package/dist/2620.index.js +345 -0
- package/dist/2773.index.js +98 -0
- package/dist/2775.index.js +32 -0
- package/dist/2966.index.js +171 -0
- package/dist/2972.index.js +87 -0
- package/dist/2991.index.js +131 -0
- package/dist/3063.index.js +833 -0
- package/dist/3075.index.js +227 -0
- package/dist/3121.index.js +297 -0
- package/dist/3314.index.js +263 -0
- package/dist/3480.index.js +1822 -0
- package/dist/3481.index.js +24 -0
- package/dist/3506.index.js +268 -0
- package/dist/3533.index.js +591 -0
- package/dist/3653.index.js +450 -0
- package/dist/3822.index.js +131 -0
- package/dist/3868.index.js +292 -0
- package/dist/3917.index.js +152 -0
- package/dist/3918.index.js +192 -0
- package/dist/4090.index.js +288 -0
- package/dist/4121.index.js +1190 -0
- package/dist/4142.index.js +0 -239
- package/dist/4336.index.js +436 -0
- package/dist/4387.index.js +532 -0
- package/dist/4413.index.js +302 -0
- package/dist/4476.index.js +4510 -0
- package/dist/4491.index.js +133 -0
- package/dist/4538.index.js +185 -0
- package/dist/4684.index.js +319 -0
- package/dist/4740.index.js +165 -0
- package/dist/4780.index.js +209 -0
- package/dist/4802.index.js +225 -0
- package/dist/4812.index.js +379 -0
- package/dist/4835.index.js +126 -0
- package/dist/494.index.js +226 -0
- package/dist/4991.index.js +549 -0
- package/dist/5199.index.js +305 -0
- package/dist/5216.index.js +109 -0
- package/dist/5439.index.js +301 -0
- package/dist/5443.index.js +97 -0
- package/dist/5496.index.js +377 -0
- package/dist/550.index.js +2 -1
- package/dist/5801.index.js +588 -0
- package/dist/5858.index.js +223 -0
- package/dist/5933.index.js +143 -0
- package/dist/601.index.js +23 -0
- package/dist/6173.index.js +273 -0
- package/dist/6291.index.js +1871 -0
- package/dist/6312.index.js +666 -0
- package/dist/634.index.js +16182 -0
- package/dist/644.index.js +87 -0
- package/dist/6508.index.js +283 -0
- package/dist/6560.index.js +645 -0
- package/dist/6576.index.js +422 -0
- package/dist/6579.index.js +271 -0
- package/dist/6745.index.js +305 -0
- package/dist/6818.index.js +21642 -0
- package/dist/6972.index.js +167 -0
- package/dist/6995.index.js +163 -0
- package/dist/7249.index.js +191 -0
- package/dist/7372.index.js +1197 -0
- package/dist/7405.index.js +23 -6
- package/dist/7546.index.js +541 -0
- package/dist/76.index.js +448 -0
- package/dist/7879.index.js +163 -0
- package/dist/8025.index.js +130 -0
- package/dist/8054.index.js +248 -0
- package/dist/8097.index.js +201 -0
- package/dist/8126.index.js +191 -0
- package/dist/8178.index.js +78 -0
- package/dist/818.index.js +212 -0
- package/dist/8382.index.js +93 -0
- package/dist/8408.index.js +261 -0
- package/dist/8540.index.js +174 -0
- package/dist/8635.index.js +802 -0
- package/dist/8688.index.js +410 -0
- package/dist/8699.index.js +779 -0
- package/dist/8891.index.js +457 -0
- package/dist/8916.index.js +885 -0
- package/dist/9146.index.js +170 -0
- package/dist/9168.index.js +841 -0
- package/dist/9292.index.js +369 -0
- package/dist/9382.index.js +338 -48
- package/dist/9422.index.js +866 -0
- package/dist/9440.index.js +453 -0
- package/dist/9479.index.js +152 -0
- package/dist/9481.index.js +220 -0
- package/dist/9539.index.js +100 -0
- package/dist/9547.index.js +103 -0
- package/dist/9560.index.js +41 -61
- package/dist/9692.index.js +90 -0
- package/dist/9800.index.js +213 -1
- package/dist/9899.index.js +138 -0
- package/dist/9981.index.js +206 -0
- package/dist/999.index.js +117 -0
- package/dist/agentic-security.mjs +28 -28
- package/dist/agentic-security.mjs.sha256 +1 -1
- package/package.json +31 -6
- package/src/context-intelligence/CLAUDE.md +4 -0
- package/src/context-intelligence/adapters/haskell-hie.js +28 -1
- package/src/context-intelligence/candidates.js +2 -1
- package/src/context-intelligence/canonical.js +25 -0
- package/src/context-intelligence/capabilities.js +2 -1
- package/src/context-intelligence/cli.js +16 -10
- package/src/context-intelligence/config.js +4 -1
- package/src/context-intelligence/controls.js +108 -10
- package/src/context-intelligence/counterexample.js +200 -0
- package/src/context-intelligence/cross-route.js +111 -0
- package/src/context-intelligence/entrypoints.js +2 -2
- package/src/context-intelligence/evaluation/index.js +11 -4
- package/src/context-intelligence/evaluation/scripted-reader.js +12 -2
- package/src/context-intelligence/findings.js +166 -0
- package/src/context-intelligence/invariants.js +197 -0
- package/src/context-intelligence/queue.js +6 -1
- package/src/context-intelligence/reachability.js +10 -4
- package/src/context-intelligence/review.js +129 -16
- package/src/dataflow/access-paths.js +11 -0
- package/src/dataflow/analysis-limits.js +66 -0
- package/src/dataflow/engine.js +272 -20
- package/src/dataflow/service-edges.js +174 -0
- package/src/dataflow/summaries.js +7 -1
- package/src/discovery/judge.js +2 -1
- package/src/engine.js +82 -14
- package/src/fix/apply-fix-service.js +55 -8
- package/src/fix/batch-journal.js +84 -0
- package/src/fix/exploit-replay.js +51 -0
- package/src/fix/footprint.js +65 -0
- package/src/fix/patch-policy.js +49 -0
- package/src/fix/secret-persistence.js +39 -0
- package/src/fix/test-commands.js +84 -0
- package/src/fix/verification-adapters.js +97 -0
- package/src/fix/verification-record.js +243 -0
- package/src/fix/verify-patch.js +89 -0
- package/src/ir/CLAUDE.md +5 -0
- package/src/ir/callgraph.js +23 -1
- package/src/ir/module-resolver.js +315 -0
- package/src/ir/parser-js.js +21 -2
- package/src/ir/semantic-graph.js +245 -0
- package/src/lineage/build-attested-correlation.js +63 -0
- package/src/lineage/deployment-identity.js +76 -0
- package/src/mcp/tools.js +13 -34
- package/src/pipeline/canonical-output.js +64 -0
- package/src/pipeline/detector-runner.js +7 -0
- package/src/pipeline/scan-health.js +14 -0
- package/src/pipeline/supervised-analyzers.js +125 -0
- package/src/pipeline/supervised-child.js +17 -0
- package/src/pipeline/telemetry.js +79 -0
- package/src/posture/accuracy-scorecard.js +98 -9
- package/src/posture/artifact-registry.js +5 -0
- package/src/posture/assurance/evidence-registry.js +215 -0
- package/src/posture/assurance/release-package-verify.js +135 -0
- package/src/posture/assurance/release-package.js +118 -0
- package/src/posture/assurance/release-verdict.js +94 -0
- package/src/posture/assurance/waiver.js +200 -0
- package/src/posture/compliance-truth.js +100 -0
- package/src/posture/evaluation/scan-child.js +3 -1
- package/src/posture/evaluation/why-missed.js +3 -1
- package/src/posture/exploitability-evidence.js +141 -0
- package/src/posture/fix-verify.js +4 -2
- package/src/posture/fleet/exposure-ranking.js +115 -0
- package/src/posture/fleet/service-chain-graph.js +150 -0
- package/src/posture/graph-reconciliation.js +154 -0
- package/src/posture/provenance/coverage.js +103 -0
- package/src/posture/provenance/git-evidence.js +84 -0
- package/src/posture/provenance/origin-resolver.js +7 -1
- package/src/posture/provenance/predicate-replay.js +14 -4
- package/src/posture/runtime-correlation.js +61 -15
- package/src/posture/runtime-explanation.js +116 -0
- package/src/posture/runtime-trace-ingest.js +194 -0
- package/src/posture/scan-checkpoint.js +38 -10
- package/src/posture/waf-ingest.js +7 -2
- package/src/report/index.js +4 -0
- package/src/report/oscal.js +38 -0
- package/src/report/perspectives.js +150 -0
- package/src/sast/_comment-strip.js +8 -1
- package/src/sast/ruby.js +26 -0
- package/src/util/string-memo.js +38 -0
package/dist/1336.index.js
CHANGED
|
@@ -9069,107 +9069,107 @@ function dbg(...args) {
|
|
|
9069
9069
|
// === Body ===
|
|
9070
9070
|
|
|
9071
9071
|
var ASM_CONSTS = {
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9072
|
+
21603560: () => { return current_async_call_id; },
|
|
9073
|
+
21603594: ($0) => { reject_async($0, new Error("Memory allocation failed")); },
|
|
9074
|
+
21603655: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9075
|
+
21603710: () => { return current_async_call_id; },
|
|
9076
|
+
21603744: ($0) => { reject_async($0, new Error("Memory allocation failed")); },
|
|
9077
|
+
21603805: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9078
|
+
21603860: () => { return current_async_call_id; },
|
|
9079
|
+
21603894: ($0) => { reject_async($0, new Error("Memory allocation failed")); },
|
|
9080
|
+
21603955: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9081
|
+
21604010: () => { return current_async_call_id; },
|
|
9082
|
+
21604044: ($0) => { reject_async($0, new Error("Memory allocation failed")); },
|
|
9083
|
+
21604105: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9084
|
+
21604160: () => { return current_async_call_id; },
|
|
9085
|
+
21604194: ($0) => { reject_async($0, new Error("Memory allocation failed")); },
|
|
9086
|
+
21604255: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9087
|
+
21604310: ($0, $1) => { resolve_async($1, $0); },
|
|
9088
|
+
21604337: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9089
|
+
21604403: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9090
|
+
21604454: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9091
|
+
21604496: ($0, $1) => { resolve_async($1, $0); },
|
|
9092
|
+
21604523: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9093
|
+
21604589: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9094
|
+
21604640: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9095
|
+
21604682: ($0, $1) => { resolve_async($1, $0); },
|
|
9096
|
+
21604709: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9097
|
+
21604775: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9098
|
+
21604826: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9099
|
+
21604868: ($0, $1) => { resolve_async($1, $0); },
|
|
9100
|
+
21604895: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9101
|
+
21604961: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9102
|
+
21605012: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9103
|
+
21605054: ($0, $1) => { resolve_async($1, $0); },
|
|
9104
|
+
21605081: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9105
|
+
21605147: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9106
|
+
21605198: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9107
|
+
21605240: () => { return current_async_call_id; },
|
|
9108
|
+
21605274: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9109
|
+
21605329: ($0, $1) => { resolve_async($1, UTF8ToString($0)); },
|
|
9110
|
+
21605370: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9111
|
+
21605436: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9112
|
+
21605487: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9113
|
+
21605529: () => { return current_async_call_id; },
|
|
9114
|
+
21605563: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9115
|
+
21605618: ($0, $1) => { resolve_async($1, $0); },
|
|
9116
|
+
21605645: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9117
|
+
21605711: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9118
|
+
21605762: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9119
|
+
21605804: () => { return current_async_call_id; },
|
|
9120
|
+
21605838: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9121
|
+
21605893: ($0, $1) => { resolve_async($1, $0); },
|
|
9122
|
+
21605920: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9123
|
+
21605986: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9124
|
+
21606037: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9125
|
+
21606079: () => { return current_async_call_id; },
|
|
9126
|
+
21606113: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9127
|
+
21606168: ($0, $1) => { resolve_async($1, $0); },
|
|
9128
|
+
21606195: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9129
|
+
21606261: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9130
|
+
21606312: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9131
|
+
21606354: () => { return current_async_call_id; },
|
|
9132
|
+
21606388: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9133
|
+
21606443: ($0, $1) => { resolve_async($1, $0); },
|
|
9134
|
+
21606470: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9135
|
+
21606536: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9136
|
+
21606587: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9137
|
+
21606629: () => { return current_async_call_id; },
|
|
9138
|
+
21606663: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9139
|
+
21606718: ($0, $1) => { resolve_async($1, $0); },
|
|
9140
|
+
21606745: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9141
|
+
21606811: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9142
|
+
21606862: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9143
|
+
21606904: () => { return current_async_call_id; },
|
|
9144
|
+
21606938: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9145
|
+
21606993: ($0, $1) => { resolve_async($1, $0); },
|
|
9146
|
+
21607020: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9147
|
+
21607086: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9148
|
+
21607137: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9149
|
+
21607179: () => { return current_async_call_id; },
|
|
9150
|
+
21607213: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9151
|
+
21607268: ($0, $1) => { resolve_async($1, $0); },
|
|
9152
|
+
21607295: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9153
|
+
21607361: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9154
|
+
21607412: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9155
|
+
21607454: () => { return current_async_call_id; },
|
|
9156
|
+
21607488: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9157
|
+
21607543: ($0, $1) => { resolve_async($1, $0); },
|
|
9158
|
+
21607570: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9159
|
+
21607636: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9160
|
+
21607687: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9161
|
+
21607729: () => { return current_async_call_id; },
|
|
9162
|
+
21607763: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9163
|
+
21607818: ($0, $1) => { resolve_async($1, $0); },
|
|
9164
|
+
21607845: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9165
|
+
21607911: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9166
|
+
21607962: () => { clearTimeout(threadTimeouts.shift()); },
|
|
9167
|
+
21608004: () => { return current_async_call_id; },
|
|
9168
|
+
21608038: () => { threadTimeouts.push(setTimeout(() => {}, 600000)); },
|
|
9169
|
+
21608093: ($0, $1) => { resolve_async($1, $0); },
|
|
9170
|
+
21608120: ($0) => { reject_async($0, new Error('failed with unknown exception')); },
|
|
9171
|
+
21608186: ($0, $1) => { reject_async($1, new Error(UTF8ToString($0))); },
|
|
9172
|
+
21608237: () => { clearTimeout(threadTimeouts.shift()); }
|
|
9173
9173
|
};
|
|
9174
9174
|
|
|
9175
9175
|
// end include: preamble.js
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
export const id = 1351;
|
|
2
|
+
export const ids = [1351];
|
|
3
|
+
export const modules = {
|
|
4
|
+
|
|
5
|
+
/***/ 41351:
|
|
6
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
7
|
+
|
|
8
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
/* harmony export */ discoverHarnessConfigs: () => (/* binding */ discoverHarnessConfigs),
|
|
10
|
+
/* harmony export */ summarizeHarnessPresence: () => (/* binding */ summarizeHarnessPresence)
|
|
11
|
+
/* harmony export */ });
|
|
12
|
+
/* unused harmony export HARNESS_DIRS */
|
|
13
|
+
/* harmony import */ var node_fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51455);
|
|
14
|
+
/* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76760);
|
|
15
|
+
/* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(48161);
|
|
16
|
+
// Multi-harness configuration discovery.
|
|
17
|
+
//
|
|
18
|
+
// Finds every agent-harness configuration directory the user has, both at
|
|
19
|
+
// the project root AND under ~/. The discovered files feed the
|
|
20
|
+
// claude-settings / claude-md-prompt-injection / claude-hook-injection
|
|
21
|
+
// detectors so we audit Claude / Cursor / Codex / Gemini / Kiro / OpenCode /
|
|
22
|
+
// Trae / Qwen / Zed / Continue / Aider with one sweep.
|
|
23
|
+
//
|
|
24
|
+
// Used by the `/scan --harness` mode.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
const HARNESS_DIRS = [
|
|
31
|
+
'.claude', '.cursor', '.codex', '.gemini', '.kiro',
|
|
32
|
+
'.opencode', '.trae', '.qwen', '.zed', '.continue', '.aider',
|
|
33
|
+
'.codebuddy', '.copilot',
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const HARNESS_FILES = [
|
|
37
|
+
// settings + permissions
|
|
38
|
+
'settings.json', 'settings.local.json', 'config.json',
|
|
39
|
+
// instruction files (lifted into context every session)
|
|
40
|
+
'CLAUDE.md', 'AGENTS.md', 'GEMINI.md', 'CURSOR.md', 'CODEX.md',
|
|
41
|
+
'KIRO.md', 'QWEN.md', 'TRAE.md', 'OPENCODE.md', 'SYSTEM_PROMPT.md',
|
|
42
|
+
// mcp
|
|
43
|
+
'mcp.json', '.mcp.json', 'mcp_servers.json', 'claude_desktop_config.json',
|
|
44
|
+
// hooks
|
|
45
|
+
'hooks.json', 'hooks.yml', 'hooks.yaml',
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
const HARNESS_SUBDIRS = ['agents', 'skills', 'commands', 'hooks', 'rules'];
|
|
49
|
+
|
|
50
|
+
const MAX_FILE_SIZE = 1_000_000;
|
|
51
|
+
|
|
52
|
+
async function _readSafe(fp) {
|
|
53
|
+
try {
|
|
54
|
+
const stat = await node_fs_promises__WEBPACK_IMPORTED_MODULE_0__.stat(fp);
|
|
55
|
+
if (stat.size > MAX_FILE_SIZE) return null;
|
|
56
|
+
return await node_fs_promises__WEBPACK_IMPORTED_MODULE_0__.readFile(fp, 'utf8');
|
|
57
|
+
} catch { return null; }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function _walkHarnessDir(harnessRoot, harnessName, out) {
|
|
61
|
+
// Top-level config files.
|
|
62
|
+
for (const fn of HARNESS_FILES) {
|
|
63
|
+
const fp = node_path__WEBPACK_IMPORTED_MODULE_1__.join(harnessRoot, fn);
|
|
64
|
+
const content = await _readSafe(fp);
|
|
65
|
+
if (content !== null) out[fp] = content;
|
|
66
|
+
}
|
|
67
|
+
// Subdirs holding instruction-style files.
|
|
68
|
+
for (const sub of HARNESS_SUBDIRS) {
|
|
69
|
+
const dp = node_path__WEBPACK_IMPORTED_MODULE_1__.join(harnessRoot, sub);
|
|
70
|
+
try {
|
|
71
|
+
const entries = await node_fs_promises__WEBPACK_IMPORTED_MODULE_0__.readdir(dp, { withFileTypes: true });
|
|
72
|
+
for (const e of entries) {
|
|
73
|
+
if (!e.isFile()) continue;
|
|
74
|
+
if (!/\.(?:md|json|yaml|yml)$/i.test(e.name)) continue;
|
|
75
|
+
const fp = node_path__WEBPACK_IMPORTED_MODULE_1__.join(dp, e.name);
|
|
76
|
+
const content = await _readSafe(fp);
|
|
77
|
+
if (content !== null) out[fp] = content;
|
|
78
|
+
}
|
|
79
|
+
} catch { /* dir does not exist — fine */ }
|
|
80
|
+
}
|
|
81
|
+
// Project-root CLAUDE.md / AGENTS.md (some users put them outside .claude/).
|
|
82
|
+
// Only walked when the harness is .claude.
|
|
83
|
+
void harnessName;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Discover harness configs at one of:
|
|
87
|
+
// 1. The project root (e.g. /path/to/repo/.claude, /path/to/repo/.cursor)
|
|
88
|
+
// 2. Home directory (e.g. ~/.claude, ~/.cursor) — opt-in via includeHome=true
|
|
89
|
+
async function discoverHarnessConfigs(projectRoot, opts = {}) {
|
|
90
|
+
const includeHome = !!opts.includeHome;
|
|
91
|
+
const out = {};
|
|
92
|
+
|
|
93
|
+
// Project-rooted instruction files commonly placed at repo root.
|
|
94
|
+
for (const fn of ['CLAUDE.md', 'AGENTS.md', 'GEMINI.md', 'CURSOR.md', 'CODEX.md', 'KIRO.md', 'QWEN.md', 'TRAE.md', 'OPENCODE.md']) {
|
|
95
|
+
const fp = node_path__WEBPACK_IMPORTED_MODULE_1__.join(projectRoot, fn);
|
|
96
|
+
const content = await _readSafe(fp);
|
|
97
|
+
if (content !== null) out[fp] = content;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
for (const dir of HARNESS_DIRS) {
|
|
101
|
+
const harnessRoot = node_path__WEBPACK_IMPORTED_MODULE_1__.join(projectRoot, dir);
|
|
102
|
+
try { await node_fs_promises__WEBPACK_IMPORTED_MODULE_0__.access(harnessRoot); } catch { continue; }
|
|
103
|
+
await _walkHarnessDir(harnessRoot, dir, out);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (includeHome) {
|
|
107
|
+
const home = node_os__WEBPACK_IMPORTED_MODULE_2__.homedir();
|
|
108
|
+
if (home) {
|
|
109
|
+
for (const dir of HARNESS_DIRS) {
|
|
110
|
+
const harnessRoot = node_path__WEBPACK_IMPORTED_MODULE_1__.join(home, dir);
|
|
111
|
+
try { await node_fs_promises__WEBPACK_IMPORTED_MODULE_0__.access(harnessRoot); } catch { continue; }
|
|
112
|
+
await _walkHarnessDir(harnessRoot, dir, out);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Inventory of which harnesses are present (for grade / summary).
|
|
121
|
+
function summarizeHarnessPresence(fileContents) {
|
|
122
|
+
const present = new Set();
|
|
123
|
+
for (const fp of Object.keys(fileContents || {})) {
|
|
124
|
+
const m = /\.(claude|cursor|codex|gemini|kiro|opencode|trae|qwen|zed|continue|aider|codebuddy|copilot)[\\/]/.exec(fp);
|
|
125
|
+
if (m) present.add(m[1]);
|
|
126
|
+
}
|
|
127
|
+
return [...present].sort();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
/***/ })
|
|
132
|
+
|
|
133
|
+
};
|