@counterfact-labs/cli 0.2.9 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/bundle/client-release.json +1 -1
  2. package/dist/adapters/relay-plan.js +7 -5
  3. package/dist/analysis-core/analysis/file-analysis-plan.js +1 -1
  4. package/dist/analysis-core/analysis/finding-quality/policy.js +1 -1
  5. package/dist/analysis-core/analysis/folder-analysis-plan.js +1 -1
  6. package/dist/analysis-core/analysis/passes/full-file-passes.js +1 -1
  7. package/dist/analysis-core/analysis/project-architecture.js +1 -1
  8. package/dist/analysis-core/analysis/schemas.js +1 -1
  9. package/dist/analysis-core/chunks/{33IGHOYT.js → 2CWULBP2.js} +1 -1
  10. package/dist/analysis-core/chunks/{2AASSZRO.js → 2M55DR2J.js} +1 -1
  11. package/dist/analysis-core/chunks/33EUZF25.js +1 -0
  12. package/dist/analysis-core/chunks/34NVU26H.js +1 -0
  13. package/dist/analysis-core/chunks/{S27Y2TP5.js → 5BTATES5.js} +1 -1
  14. package/dist/analysis-core/chunks/{LOBIDUCA.js → 5UWDUYHF.js} +1 -1
  15. package/dist/analysis-core/chunks/{5B5UCWD3.js → 5VQ4VYIP.js} +1 -1
  16. package/dist/analysis-core/chunks/{4UDQBDDE.js → 66JRJPJC.js} +1 -1
  17. package/dist/analysis-core/chunks/{4RXRAB5S.js → 6JTHFDH3.js} +1 -1
  18. package/dist/analysis-core/chunks/{CTLHKFPH.js → 6VHZNBII.js} +1 -1
  19. package/dist/analysis-core/chunks/{CQQ4TTXE.js → C77LGCKF.js} +1 -1
  20. package/dist/analysis-core/chunks/CNQZLSAP.js +1 -0
  21. package/dist/analysis-core/chunks/{33HRXJ5Q.js → DHVEGIU6.js} +1 -1
  22. package/dist/analysis-core/chunks/I4F56VMG.js +1 -0
  23. package/dist/analysis-core/chunks/JAPVLU4Z.js +1 -0
  24. package/dist/analysis-core/chunks/{HHFDNY6V.js → KBTM5MBC.js} +1 -1
  25. package/dist/analysis-core/chunks/{FRXOQ2M6.js → LFJQ4YLP.js} +1 -1
  26. package/dist/analysis-core/chunks/{MZOKZ3N6.js → N2L4JMJE.js} +1 -1
  27. package/dist/analysis-core/chunks/{F54DOWKN.js → NCW5LJ5O.js} +1 -1
  28. package/dist/analysis-core/chunks/{4PT5C4IT.js → P253B344.js} +1 -1
  29. package/dist/analysis-core/chunks/{W24SFYZM.js → QPIBHTON.js} +1 -1
  30. package/dist/analysis-core/chunks/{RQTNTIR4.js → TA2NIQAY.js} +1 -1
  31. package/dist/analysis-core/chunks/{JGK37AWN.js → UKX3A6AX.js} +1 -1
  32. package/dist/analysis-core/chunks/{YTHF2E2S.js → VC3PYT2B.js} +1 -1
  33. package/dist/analysis-core/chunks/{JEWBPIQI.js → VWRFSVLI.js} +1 -1
  34. package/dist/analysis-core/chunks/VX6LYNXV.js +1 -0
  35. package/dist/analysis-core/chunks/{2YREYGOG.js → W73WF226.js} +1 -1
  36. package/dist/analysis-core/chunks/{HVQJKPQ4.js → XVGLY4EO.js} +1 -1
  37. package/dist/analysis-core/contracts/execution-request.js +1 -1
  38. package/dist/analysis-core/contracts/intake-finding.js +1 -1
  39. package/dist/analysis-core/contracts/relay-analysis.js +1 -1
  40. package/dist/analysis-core/contracts/requests.js +1 -1
  41. package/dist/analysis-core/conventions/analysis-fit.js +1 -1
  42. package/dist/analysis-core/conventions/file-admission.js +1 -1
  43. package/dist/analysis-core/import/entry-selection.js +1 -1
  44. package/dist/analysis-core/import/outside-loader-sources.js +1 -1
  45. package/dist/analysis-core/index.js +1 -1
  46. package/dist/analysis-core/requests/answer-formats.js +1 -1
  47. package/dist/analysis-core/requests/local-plan.js +1 -1
  48. package/dist/analysis-core/requests/registry.js +1 -1
  49. package/dist/analysis-core/requests/template-version.js +1 -1
  50. package/dist/analysis-core/requests/tools.js +1 -1
  51. package/dist/analysis-core/settings.js +1 -1
  52. package/dist/analysis-core/stages/engine-entry.js +1 -1
  53. package/dist/cli/commands/analyze.js +3 -6
  54. package/dist/cli/intake-payload.js +1 -2
  55. package/dist/cli/relay-check.js +3 -7
  56. package/dist/cli/relay-preparation.js +3 -3
  57. package/dist/contract/cli-version.js +1 -1
  58. package/dist/gatekeeper/console.js +2 -13
  59. package/package.json +1 -1
  60. package/dist/adapters/source-relay-plan.js +0 -7
  61. package/dist/analysis-core/chunks/LFYTD7JF.js +0 -1
  62. package/dist/analysis-core/chunks/LMUXOKIM.js +0 -1
  63. package/dist/analysis-core/chunks/MGVIKA74.js +0 -1
  64. package/dist/analysis-core/chunks/NXHVBJL4.js +0 -1
  65. package/dist/analysis-core/chunks/OKBK3JL3.js +0 -1
@@ -1 +1 @@
1
- import{a,b}from"../chunks/S27Y2TP5.js";import"../chunks/W24SFYZM.js";import"../chunks/5B5UCWD3.js";import"../chunks/HHFDNY6V.js";import"../chunks/Y7JGSUOA.js";import"../chunks/3MTXB4MK.js";import"../chunks/MZOKZ3N6.js";import"../chunks/4RXRAB5S.js";import"../chunks/HTLIRVP7.js";import"../chunks/N7U5N42V.js";import"../chunks/QDYMR6KS.js";import"../chunks/E7TFIHC5.js";import"../chunks/4F6ZIHXU.js";import"../chunks/VGYWI4X2.js";import"../chunks/57M4OQJM.js";import"../chunks/J4AXGE5W.js";import"../chunks/IBCFGUHI.js";import"../chunks/DZZBQDGO.js";import"../chunks/CTLHKFPH.js";import"../chunks/FRXOQ2M6.js";import"../chunks/326F4XNG.js";import"../chunks/KU5DINLW.js";import"../chunks/SP6XFHNH.js";import"../chunks/HCPO6QPU.js";import"../chunks/F54DOWKN.js";import"../chunks/33IGHOYT.js";import"../chunks/LOBIDUCA.js";import"../chunks/YTHF2E2S.js";import"../chunks/4PT5C4IT.js";import"../chunks/2YREYGOG.js";import"../chunks/6YCABS5T.js";import"../chunks/M5YWJY7P.js";import"../chunks/M6HYSTQD.js";import"../chunks/4H23CSUM.js";import"../chunks/JEWBPIQI.js";import"../chunks/NXHVBJL4.js";import"../chunks/MJGB25S5.js";import"../chunks/RQTNTIR4.js";import"../chunks/LMUXOKIM.js";import"../chunks/QVXARKP7.js";import"../chunks/2AASSZRO.js";import"../chunks/74FPPPIG.js";import"../chunks/MKYLK6DB.js";import"../chunks/5TATKWLG.js";import"../chunks/OKBK3JL3.js";import"../chunks/JKWTHRUR.js";import"../chunks/3GUKUEEJ.js";import"../chunks/LFYTD7JF.js";import"../chunks/MGVIKA74.js";import"../chunks/YUY436SM.js";import"../chunks/C6X5GDG4.js";import"../chunks/724WZMYW.js";import"../chunks/YWL52FVW.js";import"../chunks/SJESFYBA.js";import"../chunks/RUVMFAST.js";import"../chunks/S27VIQMZ.js";import"../chunks/INVTU73D.js";import"../chunks/A7WJJMRY.js";import"../chunks/Q5WR6B2H.js";import"../chunks/VDUFPTDD.js";export{a as localCallPlan,b as localSourcePlan};
1
+ import{a,b}from"../chunks/5BTATES5.js";import"../chunks/QPIBHTON.js";import"../chunks/5VQ4VYIP.js";import"../chunks/KBTM5MBC.js";import"../chunks/Y7JGSUOA.js";import"../chunks/3MTXB4MK.js";import"../chunks/N2L4JMJE.js";import"../chunks/6JTHFDH3.js";import"../chunks/HTLIRVP7.js";import"../chunks/N7U5N42V.js";import"../chunks/QDYMR6KS.js";import"../chunks/E7TFIHC5.js";import"../chunks/4F6ZIHXU.js";import"../chunks/VGYWI4X2.js";import"../chunks/57M4OQJM.js";import"../chunks/J4AXGE5W.js";import"../chunks/IBCFGUHI.js";import"../chunks/DZZBQDGO.js";import"../chunks/6VHZNBII.js";import"../chunks/LFJQ4YLP.js";import"../chunks/326F4XNG.js";import"../chunks/KU5DINLW.js";import"../chunks/SP6XFHNH.js";import"../chunks/HCPO6QPU.js";import"../chunks/NCW5LJ5O.js";import"../chunks/2CWULBP2.js";import"../chunks/5UWDUYHF.js";import"../chunks/VC3PYT2B.js";import"../chunks/P253B344.js";import"../chunks/W73WF226.js";import"../chunks/6YCABS5T.js";import"../chunks/M5YWJY7P.js";import"../chunks/M6HYSTQD.js";import"../chunks/4H23CSUM.js";import"../chunks/VWRFSVLI.js";import"../chunks/VX6LYNXV.js";import"../chunks/MJGB25S5.js";import"../chunks/TA2NIQAY.js";import"../chunks/34NVU26H.js";import"../chunks/CNQZLSAP.js";import"../chunks/QVXARKP7.js";import"../chunks/2M55DR2J.js";import"../chunks/74FPPPIG.js";import"../chunks/MKYLK6DB.js";import"../chunks/5TATKWLG.js";import"../chunks/JKWTHRUR.js";import"../chunks/3GUKUEEJ.js";import"../chunks/JAPVLU4Z.js";import"../chunks/I4F56VMG.js";import"../chunks/33EUZF25.js";import"../chunks/YUY436SM.js";import"../chunks/C6X5GDG4.js";import"../chunks/724WZMYW.js";import"../chunks/YWL52FVW.js";import"../chunks/SJESFYBA.js";import"../chunks/RUVMFAST.js";import"../chunks/S27VIQMZ.js";import"../chunks/INVTU73D.js";import"../chunks/A7WJJMRY.js";import"../chunks/Q5WR6B2H.js";import"../chunks/VDUFPTDD.js";export{a as localCallPlan,b as localSourcePlan};
@@ -1 +1 @@
1
- import{k as a,l as b,m as c,n as d}from"../chunks/HHFDNY6V.js";import"../chunks/Y7JGSUOA.js";import"../chunks/3MTXB4MK.js";import"../chunks/4RXRAB5S.js";import"../chunks/HTLIRVP7.js";import"../chunks/QDYMR6KS.js";import"../chunks/E7TFIHC5.js";import"../chunks/YTHF2E2S.js";import"../chunks/6YCABS5T.js";import"../chunks/JEWBPIQI.js";import"../chunks/NXHVBJL4.js";import"../chunks/MJGB25S5.js";import"../chunks/RQTNTIR4.js";import"../chunks/LMUXOKIM.js";import"../chunks/QVXARKP7.js";import"../chunks/74FPPPIG.js";import"../chunks/OKBK3JL3.js";import"../chunks/JKWTHRUR.js";import"../chunks/3GUKUEEJ.js";import"../chunks/LFYTD7JF.js";import"../chunks/MGVIKA74.js";import"../chunks/INVTU73D.js";import"../chunks/A7WJJMRY.js";import"../chunks/VDUFPTDD.js";export{a as InputBudgetError,d as buildAnalysisCall,c as callInputBytes,b as createRequestRegistry};
1
+ import{k as a,l as b,m as c,n as d}from"../chunks/KBTM5MBC.js";import"../chunks/Y7JGSUOA.js";import"../chunks/3MTXB4MK.js";import"../chunks/6JTHFDH3.js";import"../chunks/HTLIRVP7.js";import"../chunks/QDYMR6KS.js";import"../chunks/E7TFIHC5.js";import"../chunks/VC3PYT2B.js";import"../chunks/6YCABS5T.js";import"../chunks/VWRFSVLI.js";import"../chunks/VX6LYNXV.js";import"../chunks/MJGB25S5.js";import"../chunks/TA2NIQAY.js";import"../chunks/34NVU26H.js";import"../chunks/CNQZLSAP.js";import"../chunks/QVXARKP7.js";import"../chunks/74FPPPIG.js";import"../chunks/JKWTHRUR.js";import"../chunks/3GUKUEEJ.js";import"../chunks/JAPVLU4Z.js";import"../chunks/I4F56VMG.js";import"../chunks/33EUZF25.js";import"../chunks/INVTU73D.js";import"../chunks/A7WJJMRY.js";import"../chunks/VDUFPTDD.js";export{a as InputBudgetError,d as buildAnalysisCall,c as callInputBytes,b as createRequestRegistry};
@@ -1 +1 @@
1
- import{a}from"../chunks/MZOKZ3N6.js";import"../chunks/E7TFIHC5.js";import"../chunks/YTHF2E2S.js";import"../chunks/LMUXOKIM.js";import"../chunks/LFYTD7JF.js";import"../chunks/MGVIKA74.js";import"../chunks/INVTU73D.js";export{a as createTemplateVersion};
1
+ import{a}from"../chunks/N2L4JMJE.js";import"../chunks/E7TFIHC5.js";import"../chunks/VC3PYT2B.js";import"../chunks/34NVU26H.js";import"../chunks/CNQZLSAP.js";import"../chunks/I4F56VMG.js";import"../chunks/33EUZF25.js";import"../chunks/INVTU73D.js";export{a as createTemplateVersion};
@@ -1 +1 @@
1
- import{a}from"../chunks/5B5UCWD3.js";import"../chunks/HHFDNY6V.js";import"../chunks/Y7JGSUOA.js";import"../chunks/3MTXB4MK.js";import"../chunks/MZOKZ3N6.js";import"../chunks/4RXRAB5S.js";import"../chunks/HTLIRVP7.js";import"../chunks/QDYMR6KS.js";import"../chunks/E7TFIHC5.js";import"../chunks/YTHF2E2S.js";import"../chunks/6YCABS5T.js";import"../chunks/JEWBPIQI.js";import"../chunks/NXHVBJL4.js";import"../chunks/MJGB25S5.js";import"../chunks/RQTNTIR4.js";import"../chunks/LMUXOKIM.js";import"../chunks/QVXARKP7.js";import"../chunks/74FPPPIG.js";import"../chunks/OKBK3JL3.js";import"../chunks/JKWTHRUR.js";import"../chunks/3GUKUEEJ.js";import"../chunks/LFYTD7JF.js";import"../chunks/MGVIKA74.js";import"../chunks/INVTU73D.js";import"../chunks/A7WJJMRY.js";import"../chunks/VDUFPTDD.js";export{a as createRequestTools};
1
+ import{a}from"../chunks/5VQ4VYIP.js";import"../chunks/KBTM5MBC.js";import"../chunks/Y7JGSUOA.js";import"../chunks/3MTXB4MK.js";import"../chunks/N2L4JMJE.js";import"../chunks/6JTHFDH3.js";import"../chunks/HTLIRVP7.js";import"../chunks/QDYMR6KS.js";import"../chunks/E7TFIHC5.js";import"../chunks/VC3PYT2B.js";import"../chunks/6YCABS5T.js";import"../chunks/VWRFSVLI.js";import"../chunks/VX6LYNXV.js";import"../chunks/MJGB25S5.js";import"../chunks/TA2NIQAY.js";import"../chunks/34NVU26H.js";import"../chunks/CNQZLSAP.js";import"../chunks/QVXARKP7.js";import"../chunks/74FPPPIG.js";import"../chunks/JKWTHRUR.js";import"../chunks/3GUKUEEJ.js";import"../chunks/JAPVLU4Z.js";import"../chunks/I4F56VMG.js";import"../chunks/33EUZF25.js";import"../chunks/INVTU73D.js";import"../chunks/A7WJJMRY.js";import"../chunks/VDUFPTDD.js";export{a as createRequestTools};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j}from"./chunks/YTHF2E2S.js";import"./chunks/LMUXOKIM.js";import"./chunks/LFYTD7JF.js";import"./chunks/MGVIKA74.js";export{a as fileScopeEnabled,c as findingHeadlinesEnabled,i as folderPartsEnabled,j as followupSettings,b as multiEntryEnabled,e as outsideLoadersEnabled,f as promptAgreementEnabled,d as resultSafetyCheckEnabled,h as skippedFilesEnabled,g as snapshotSettings};
1
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunks/VC3PYT2B.js";import"./chunks/34NVU26H.js";import"./chunks/CNQZLSAP.js";import"./chunks/I4F56VMG.js";import"./chunks/33EUZF25.js";export{a as fileScopeEnabled,c as findingHeadlinesEnabled,i as folderPartsEnabled,j as followupSettings,b as multiEntryEnabled,e as outsideLoadersEnabled,f as promptAgreementEnabled,d as resultSafetyCheckEnabled,h as skippedFilesEnabled,g as snapshotSettings};
@@ -1 +1 @@
1
- import{a as Y,b as C}from"../chunks/F3R4J3ND.js";import{b as X}from"../chunks/S27Y2TP5.js";import{b as z,c as _,d as H,e as S,f as j}from"../chunks/4UDQBDDE.js";import{O as Q,ba as D,ia as T,qa as B,sa as G,ta as V,ua as J,wa as U,ya as W}from"../chunks/W24SFYZM.js";import"../chunks/5B5UCWD3.js";import"../chunks/HHFDNY6V.js";import"../chunks/Y7JGSUOA.js";import"../chunks/3MTXB4MK.js";import"../chunks/MZOKZ3N6.js";import"../chunks/4RXRAB5S.js";import"../chunks/HTLIRVP7.js";import{c as N}from"../chunks/N7U5N42V.js";import"../chunks/QDYMR6KS.js";import"../chunks/E7TFIHC5.js";import"../chunks/4F6ZIHXU.js";import"../chunks/VGYWI4X2.js";import"../chunks/57M4OQJM.js";import"../chunks/J4AXGE5W.js";import"../chunks/IBCFGUHI.js";import"../chunks/DZZBQDGO.js";import"../chunks/HVQJKPQ4.js";import"../chunks/CTLHKFPH.js";import"../chunks/FRXOQ2M6.js";import"../chunks/326F4XNG.js";import{c as M}from"../chunks/JGK37AWN.js";import"../chunks/KU5DINLW.js";import"../chunks/SP6XFHNH.js";import"../chunks/PBHHWFR6.js";import"../chunks/HCPO6QPU.js";import{h as q}from"../chunks/F54DOWKN.js";import"../chunks/33HRXJ5Q.js";import"../chunks/33IGHOYT.js";import{a as K}from"../chunks/LOBIDUCA.js";import{c as I}from"../chunks/YTHF2E2S.js";import"../chunks/4PT5C4IT.js";import"../chunks/2YREYGOG.js";import"../chunks/6YCABS5T.js";import"../chunks/M5YWJY7P.js";import"../chunks/M6HYSTQD.js";import"../chunks/4H23CSUM.js";import"../chunks/JEWBPIQI.js";import"../chunks/NXHVBJL4.js";import"../chunks/MJGB25S5.js";import"../chunks/RQTNTIR4.js";import{m as k}from"../chunks/LMUXOKIM.js";import"../chunks/QVXARKP7.js";import{Ib as E,Ka as v}from"../chunks/2AASSZRO.js";import"../chunks/74FPPPIG.js";import"../chunks/MKYLK6DB.js";import"../chunks/5TATKWLG.js";import"../chunks/OKBK3JL3.js";import"../chunks/JKWTHRUR.js";import{b as O}from"../chunks/3GUKUEEJ.js";import"../chunks/LFYTD7JF.js";import"../chunks/MGVIKA74.js";import"../chunks/YUY436SM.js";import{e as P}from"../chunks/C6X5GDG4.js";import"../chunks/724WZMYW.js";import"../chunks/YWL52FVW.js";import"../chunks/SJESFYBA.js";import"../chunks/RUVMFAST.js";import"../chunks/S27VIQMZ.js";import"../chunks/INVTU73D.js";import"../chunks/A7WJJMRY.js";import"../chunks/Q5WR6B2H.js";import"../chunks/VDUFPTDD.js";function Z(r,s){return D(r,s,{codeInputs:!1,recall:!1,secondOpinion:!1})}function L(r,s,a,d){let n=s.findingQuality,w={...a.findingCheck?.state?.result??{kept:s.findings,dropped:[],warnings:[]}};n?.assessments&&w.qualityAudit&&(w.qualityAudit={coverage:n.coverage??[],verdicts:n.verdicts??[],assessments:n.assessments,...n.shadow?{shadow:n.shadow}:{}});let e=V(s.findings,s.structures,s.findingHeadlines??[],s.findingHeadlineDiagnostics),m=new Map(e.rows.filter(t=>t.target==="finding").map(t=>[t.index,{headline:t.headline,ifLeft:t.ifLeft}])),y=new Map(e.rows.filter(t=>t.target==="structure").map(t=>[t.index,{headline:t.headline,ifLeft:t.ifLeft}])),x=y.size?s.structures.map((t,c)=>y.has(c)?{...t,...y.get(c)}:t):s.structures,b=m.size?s.findings.map((t,c)=>m.has(c)?{...t,...m.get(c)}:t):s.findings,i=a.findingQuality?.config.switches.ranking?q(b,n?.assessments??[]):void 0,g=v(b),A=i?.ordered??[...g.active,...g.notActive],o=s.structuralFindingCount===void 0?void 0:b.slice(0,s.structuralFindingCount),p=v(o??[]),f=o&&(i?q(o,n?.assessments??[]).ordered:[...p.active,...p.notActive]),u=f?T(x,f.map(t=>A.indexOf(t))):x;return{repoKey:r,findings:A,structures:u,graph:s.graph,warnings:s.warnings,...d?{proposalCounts:d}:{},...e.diagnostics?{findingHeadlineDiagnostics:e.diagnostics}:{},skippedFiles:a.inspectPlan?.skipped??[],passes:a.inspectPlan?.passes.length??1,findingCheck:w,...i?{ranking:{defaultIds:i.defaultIds,hiddenIds:i.hiddenIds,emptyMessage:i.emptyMessage}}:{}}}async function $(r,s,a,d=Y){let n={...a.state,repos:a.repos,mapped:a.fragments.map(({fragment:e})=>e),findingsRaw:a.findings,warnings:a.state?.warnings??[],splitCheckPriced:!0,splitFindingsPriced:!0},w=C(s,d);for(;;){let e=await W({phase:"structuring",state:n,settings:r,execution:{scopeConcurrency:4,forLocal:!0}},w);if(n=S(n,e),e.next==="persisting")return{state:n,structures:n.structuresRaw??[],warnings:n.warnings??[]}}}function te(r,s){I(s)&&r.requestTools.headlinePlan(N([]))}async function ee(r,s,a={}){let{settings:d,qualityConfig:n}=r;te(s,d);let w=Q(d);if(!Object.keys(r.files).length)throw new O("empty_folder","No admitted source files were found.");let e={repos:[{key:r.repoKey,kind:"fs",files:r.files,...r.root!==void 0?{root:r.root}:{},...r.mechanicalInventory?{mechanicalInventory:r.mechanicalInventory}:{},...r.skippedFiles?.length?{refused:r.skippedFiles}:{}}],warnings:r.warnings??[],...r.fragment?{mapped:[r.fragment]}:{}},m=C(s,s.progress);for(;;){let i=await j({phase:"mapping",state:e,settings:d,execution:{scopeConcurrency:4,forLocal:!0,preparation:{capUsd:20,confirmPrice:!1,qualityConfig:n}}},m);if(e=S(e,i),i.next!=="mapping")break}e={...e,analysisFlags:{...w,sourceNotes:!a.findingsOnly&&w.sourceNotes},findingQuality:{config:n},warnings:[...e.warnings??[],...n.diagnostics]};let y="inspecting";for(m.progress.checkpoint=async(i,g)=>{e={...e,...i,...g?{passResults:{...e.passResults,[g.index]:g.result}}:{}},await s.progress.checkpoint(i,g)};y!=="structuring";){let g=await(y==="inspecting"?B:G)({phase:y,state:e,settings:d,execution:{scopeConcurrency:4,passConcurrency:4,forLocal:!0}},m);e=S(e,g),y=g.next}let x=(i=!0)=>J({phase:"persisting",state:e,settings:d,execution:{scopeConcurrency:4}},{mechanical:i});if(!a.findingsOnly){let i=L(r.repoKey,x(!1),e,r.proposalCounts),g=e.findingsRaw;e={...(await $(d,s,{repos:e.repos,fragments:[{repoKey:r.repoKey,fragment:e.mapped[0]}],graph:i.graph,findings:i.findings,state:e},m.progress)).state,findingsRaw:g}}e=S(e,await U({phase:"persisting",state:e,settings:d,execution:{scopeConcurrency:4,forLocal:!0}},m));let b=x();return await a.resultSink?.(b),L(r.repoKey,b,e,r.proposalCounts)}import{createHash as se}from"node:crypto";async function re(r,s,a){let d=new Map,n=new Map,w=[],e,m=[],y=()=>{if(a.signal?.throwIfAborted(),e)throw k(e)},x=async o=>{y();try{return await a.list(o)}catch{throw a.signal?.throwIfAborted(),k("unavailable")}},b=async o=>{let p=[],f=new Set,u=new Set,t=new Set,c=o;for(;;){if(y(),c.snapshot!==s.manifest.snapshot||c.commit!==s.manifest.commit)throw k("bad_request");for(let h of c.files){let F=d.get(h.id);if(f.has(h.path)||u.has(h.id)||F&&(F.hash!==h.hash||F.size!==h.size))throw k("bad_request");f.add(h.path),u.add(h.id);let l={...h};d.set(h.id,l),p.push(l)}if(c.complete)return p;if(!c.cursor||t.has(c.cursor))throw k("bad_request");t.add(c.cursor),c=await x(c.cursor)}},i=o=>o.map(({id:p,path:f,size:u})=>({path:f,size:u,ref:p})),g=_(async o=>{if(a.signal?.throwIfAborted(),e)return o.map(()=>null);let p=[...new Set(o.map(f=>f.ref))].filter(f=>!n.has(f)).map(f=>d.get(f));if(p.length){let f;try{f=await a.read(p)}catch{return a.signal?.throwIfAborted(),e="unavailable",o.map(()=>null)}a.signal?.throwIfAborted();let u=new Map(p.map(t=>[t.id,t]));for(let t of f){let c=u.get(t.id);if(!c||t.text!==null&&!t.refusal&&(Buffer.byteLength(t.text)!==c.size||se("sha256").update(t.text).digest("hex")!==c.hash)){e="bad_request";break}u.delete(t.id),n.set(t.id,{text:t.refusal?null:t.text,bytesRead:t.bytesRead,...t.refusal?{refusal:t.refusal}:{}})}if(u.size&&(e="bad_request"),e)return o.map(()=>null)}return o.map(f=>n.get(f.ref)?.text??null)}),A=async o=>{let p=await g(o);return p===null?null:E(r,o,async()=>p)};try{let o=await b(s.manifest),p=M(r,z(r,i(o)),{paths:K(r)}),f=await H(r,{repoKey:s.repoKey,entries:i(o),read:A,localListing:!0,...s.proposal?{proposal:s.proposal}:{},repository:{context:async()=>s.selectedRoot===null?null:{selectedRoot:s.selectedRoot},list:async()=>{let l=await x(null),R=await b(l);return w=R,{entries:i(R),truncated:l.truncated,entriesVisited:l.entriesVisited}},read:async l=>(await A(l),n.get(l.ref)??{text:null,bytesRead:0})}});y();let u={repoKey:s.repoKey,...f},t=new Map(o.map(l=>[P(l.path,u.root),l]));u.root!==void 0&&w.forEach(l=>t.set(l.path,l));let c=Object.keys(u.files).map(l=>{let R=t.get(l);if(!R)throw k("bad_request");return{source:{...R},resultPath:l}}),h=c.map(({source:l,resultPath:R})=>({...l,path:R})),{calls:F}=X(r,u);return m=h.map(l=>l.id),{source:u,finalFiles:h,calls:F,finalFileMapping:c,analysisSize:p}}finally{n.clear(),d.clear(),a.finish?.(m)}}async function He(r,s,a={}){let d=r.settings,n=Z(d,s.requestTools);return ee({...r,settings:d,qualityConfig:n},s,a)}export{re as prepareRelayAnalysis,He as runEngineAnalysis};
1
+ import{a as Y,b as C}from"../chunks/F3R4J3ND.js";import{b as X}from"../chunks/5BTATES5.js";import{b as z,c as _,d as H,e as S,f as j}from"../chunks/66JRJPJC.js";import{O as Q,ba as D,ia as T,qa as B,sa as G,ta as V,ua as J,wa as U,ya as W}from"../chunks/QPIBHTON.js";import"../chunks/5VQ4VYIP.js";import"../chunks/KBTM5MBC.js";import"../chunks/Y7JGSUOA.js";import"../chunks/3MTXB4MK.js";import"../chunks/N2L4JMJE.js";import"../chunks/6JTHFDH3.js";import"../chunks/HTLIRVP7.js";import{c as N}from"../chunks/N7U5N42V.js";import"../chunks/QDYMR6KS.js";import"../chunks/E7TFIHC5.js";import"../chunks/4F6ZIHXU.js";import"../chunks/VGYWI4X2.js";import"../chunks/57M4OQJM.js";import"../chunks/J4AXGE5W.js";import"../chunks/IBCFGUHI.js";import"../chunks/DZZBQDGO.js";import"../chunks/XVGLY4EO.js";import"../chunks/6VHZNBII.js";import"../chunks/LFJQ4YLP.js";import"../chunks/326F4XNG.js";import{c as M}from"../chunks/UKX3A6AX.js";import"../chunks/KU5DINLW.js";import"../chunks/SP6XFHNH.js";import"../chunks/PBHHWFR6.js";import"../chunks/HCPO6QPU.js";import{h as q}from"../chunks/NCW5LJ5O.js";import"../chunks/DHVEGIU6.js";import"../chunks/2CWULBP2.js";import{a as K}from"../chunks/5UWDUYHF.js";import{c as I}from"../chunks/VC3PYT2B.js";import"../chunks/P253B344.js";import"../chunks/W73WF226.js";import"../chunks/6YCABS5T.js";import"../chunks/M5YWJY7P.js";import"../chunks/M6HYSTQD.js";import"../chunks/4H23CSUM.js";import"../chunks/VWRFSVLI.js";import"../chunks/VX6LYNXV.js";import"../chunks/MJGB25S5.js";import"../chunks/TA2NIQAY.js";import{o as k}from"../chunks/34NVU26H.js";import"../chunks/CNQZLSAP.js";import"../chunks/QVXARKP7.js";import{Ib as E,Ka as v}from"../chunks/2M55DR2J.js";import"../chunks/74FPPPIG.js";import"../chunks/MKYLK6DB.js";import"../chunks/5TATKWLG.js";import"../chunks/JKWTHRUR.js";import{b as O}from"../chunks/3GUKUEEJ.js";import"../chunks/JAPVLU4Z.js";import"../chunks/I4F56VMG.js";import"../chunks/33EUZF25.js";import"../chunks/YUY436SM.js";import{e as P}from"../chunks/C6X5GDG4.js";import"../chunks/724WZMYW.js";import"../chunks/YWL52FVW.js";import"../chunks/SJESFYBA.js";import"../chunks/RUVMFAST.js";import"../chunks/S27VIQMZ.js";import"../chunks/INVTU73D.js";import"../chunks/A7WJJMRY.js";import"../chunks/Q5WR6B2H.js";import"../chunks/VDUFPTDD.js";function Z(r,s){return D(r,s,{codeInputs:!1,recall:!1,secondOpinion:!1})}function L(r,s,a,d){let n=s.findingQuality,w={...a.findingCheck?.state?.result??{kept:s.findings,dropped:[],warnings:[]}};n?.assessments&&w.qualityAudit&&(w.qualityAudit={coverage:n.coverage??[],verdicts:n.verdicts??[],assessments:n.assessments,...n.shadow?{shadow:n.shadow}:{}});let e=V(s.findings,s.structures,s.findingHeadlines??[],s.findingHeadlineDiagnostics),m=new Map(e.rows.filter(t=>t.target==="finding").map(t=>[t.index,{headline:t.headline,ifLeft:t.ifLeft}])),y=new Map(e.rows.filter(t=>t.target==="structure").map(t=>[t.index,{headline:t.headline,ifLeft:t.ifLeft}])),x=y.size?s.structures.map((t,c)=>y.has(c)?{...t,...y.get(c)}:t):s.structures,b=m.size?s.findings.map((t,c)=>m.has(c)?{...t,...m.get(c)}:t):s.findings,i=a.findingQuality?.config.switches.ranking?q(b,n?.assessments??[]):void 0,g=v(b),A=i?.ordered??[...g.active,...g.notActive],o=s.structuralFindingCount===void 0?void 0:b.slice(0,s.structuralFindingCount),p=v(o??[]),f=o&&(i?q(o,n?.assessments??[]).ordered:[...p.active,...p.notActive]),u=f?T(x,f.map(t=>A.indexOf(t))):x;return{repoKey:r,findings:A,structures:u,graph:s.graph,warnings:s.warnings,...d?{proposalCounts:d}:{},...e.diagnostics?{findingHeadlineDiagnostics:e.diagnostics}:{},skippedFiles:a.inspectPlan?.skipped??[],passes:a.inspectPlan?.passes.length??1,findingCheck:w,...i?{ranking:{defaultIds:i.defaultIds,hiddenIds:i.hiddenIds,emptyMessage:i.emptyMessage}}:{}}}async function $(r,s,a,d=Y){let n={...a.state,repos:a.repos,mapped:a.fragments.map(({fragment:e})=>e),findingsRaw:a.findings,warnings:a.state?.warnings??[],splitCheckPriced:!0,splitFindingsPriced:!0},w=C(s,d);for(;;){let e=await W({phase:"structuring",state:n,settings:r,execution:{scopeConcurrency:4,forLocal:!0}},w);if(n=S(n,e),e.next==="persisting")return{state:n,structures:n.structuresRaw??[],warnings:n.warnings??[]}}}function te(r,s){I(s)&&r.requestTools.headlinePlan(N([]))}async function ee(r,s,a={}){let{settings:d,qualityConfig:n}=r;te(s,d);let w=Q(d);if(!Object.keys(r.files).length)throw new O("empty_folder","No admitted source files were found.");let e={repos:[{key:r.repoKey,kind:"fs",files:r.files,...r.root!==void 0?{root:r.root}:{},...r.mechanicalInventory?{mechanicalInventory:r.mechanicalInventory}:{},...r.skippedFiles?.length?{refused:r.skippedFiles}:{}}],warnings:r.warnings??[],...r.fragment?{mapped:[r.fragment]}:{}},m=C(s,s.progress);for(;;){let i=await j({phase:"mapping",state:e,settings:d,execution:{scopeConcurrency:4,forLocal:!0,preparation:{capUsd:20,confirmPrice:!1,qualityConfig:n}}},m);if(e=S(e,i),i.next!=="mapping")break}e={...e,analysisFlags:{...w,sourceNotes:!a.findingsOnly&&w.sourceNotes},findingQuality:{config:n},warnings:[...e.warnings??[],...n.diagnostics]};let y="inspecting";for(m.progress.checkpoint=async(i,g)=>{e={...e,...i,...g?{passResults:{...e.passResults,[g.index]:g.result}}:{}},await s.progress.checkpoint(i,g)};y!=="structuring";){let g=await(y==="inspecting"?B:G)({phase:y,state:e,settings:d,execution:{scopeConcurrency:4,passConcurrency:4,forLocal:!0}},m);e=S(e,g),y=g.next}let x=(i=!0)=>J({phase:"persisting",state:e,settings:d,execution:{scopeConcurrency:4}},{mechanical:i});if(!a.findingsOnly){let i=L(r.repoKey,x(!1),e,r.proposalCounts),g=e.findingsRaw;e={...(await $(d,s,{repos:e.repos,fragments:[{repoKey:r.repoKey,fragment:e.mapped[0]}],graph:i.graph,findings:i.findings,state:e},m.progress)).state,findingsRaw:g}}e=S(e,await U({phase:"persisting",state:e,settings:d,execution:{scopeConcurrency:4,forLocal:!0}},m));let b=x();return await a.resultSink?.(b),L(r.repoKey,b,e,r.proposalCounts)}import{createHash as se}from"node:crypto";async function re(r,s,a){let d=new Map,n=new Map,w=[],e,m=[],y=()=>{if(a.signal?.throwIfAborted(),e)throw k(e)},x=async o=>{y();try{return await a.list(o)}catch{throw a.signal?.throwIfAborted(),k("unavailable")}},b=async o=>{let p=[],f=new Set,u=new Set,t=new Set,c=o;for(;;){if(y(),c.snapshot!==s.manifest.snapshot||c.commit!==s.manifest.commit)throw k("bad_request");for(let h of c.files){let F=d.get(h.id);if(f.has(h.path)||u.has(h.id)||F&&(F.hash!==h.hash||F.size!==h.size))throw k("bad_request");f.add(h.path),u.add(h.id);let l={...h};d.set(h.id,l),p.push(l)}if(c.complete)return p;if(!c.cursor||t.has(c.cursor))throw k("bad_request");t.add(c.cursor),c=await x(c.cursor)}},i=o=>o.map(({id:p,path:f,size:u})=>({path:f,size:u,ref:p})),g=_(async o=>{if(a.signal?.throwIfAborted(),e)return o.map(()=>null);let p=[...new Set(o.map(f=>f.ref))].filter(f=>!n.has(f)).map(f=>d.get(f));if(p.length){let f;try{f=await a.read(p)}catch{return a.signal?.throwIfAborted(),e="unavailable",o.map(()=>null)}a.signal?.throwIfAborted();let u=new Map(p.map(t=>[t.id,t]));for(let t of f){let c=u.get(t.id);if(!c||t.text!==null&&!t.refusal&&(Buffer.byteLength(t.text)!==c.size||se("sha256").update(t.text).digest("hex")!==c.hash)){e="bad_request";break}u.delete(t.id),n.set(t.id,{text:t.refusal?null:t.text,bytesRead:t.bytesRead,...t.refusal?{refusal:t.refusal}:{}})}if(u.size&&(e="bad_request"),e)return o.map(()=>null)}return o.map(f=>n.get(f.ref)?.text??null)}),A=async o=>{let p=await g(o);return p===null?null:E(r,o,async()=>p)};try{let o=await b(s.manifest),p=M(r,z(r,i(o)),{paths:K(r)}),f=await H(r,{repoKey:s.repoKey,entries:i(o),read:A,localListing:!0,...s.proposal?{proposal:s.proposal}:{},repository:{context:async()=>s.selectedRoot===null?null:{selectedRoot:s.selectedRoot},list:async()=>{let l=await x(null),R=await b(l);return w=R,{entries:i(R),truncated:l.truncated,entriesVisited:l.entriesVisited}},read:async l=>(await A(l),n.get(l.ref)??{text:null,bytesRead:0})}});y();let u={repoKey:s.repoKey,...f},t=new Map(o.map(l=>[P(l.path,u.root),l]));u.root!==void 0&&w.forEach(l=>t.set(l.path,l));let c=Object.keys(u.files).map(l=>{let R=t.get(l);if(!R)throw k("bad_request");return{source:{...R},resultPath:l}}),h=c.map(({source:l,resultPath:R})=>({...l,path:R})),{calls:F}=X(r,u);return m=h.map(l=>l.id),{source:u,finalFiles:h,calls:F,finalFileMapping:c,analysisSize:p}}finally{n.clear(),d.clear(),a.finish?.(m)}}async function He(r,s,a={}){let d=r.settings,n=Z(d,s.requestTools);return ee({...r,settings:d,qualityConfig:n},s,a)}export{re as prepareRelayAnalysis,He as runEngineAnalysis};
@@ -18,7 +18,6 @@ import { captureArchitectureSettings, scopeChoicesEnabled } from "../../adapters
18
18
  import { resolveRunSelection } from "../analysis-selection.js";
19
19
  import { renderScopeChoices } from "../scope-choices.js";
20
20
  import { progressLine } from "../../contract/scope-choice.js";
21
- import { consoleCapabilities } from "../../gatekeeper/console.js";
22
21
  // Only a real pause says "paused"; an unreviewed release or an upload-only server cannot start.
23
22
  const unavailable = START_FAILURE_MESSAGE;
24
23
  function requireLocal(value) {
@@ -38,7 +37,7 @@ function requireLocal(value) {
38
37
  // A local-capable client never falls back to sending source files to the hosted upload API.
39
38
  if (value.mode !== "local")
40
39
  throw new ApiError(503, "unavailable", unavailable);
41
- return consoleCapabilities(value);
40
+ return "skippedFiles" in value && value.skippedFiles === true;
42
41
  }
43
42
  export function parseAnalyzeOptions(args, choices = false, multiple = false) {
44
43
  let path, proposalFile, scopeFile;
@@ -101,7 +100,7 @@ export async function analyze(path, options, ctx) {
101
100
  const proposal = await loadAgentProposal(async () => options.proposalFile === undefined ? options.proposal
102
101
  : JSON.parse(await readFile(resolve(ctx.cwd ?? process.cwd(), options.proposalFile), "utf8")), startup.settings);
103
102
  const mode = await (ctx.consoleMode?.() ?? ctx.api.request("checks/mode"));
104
- const capabilities = requireLocal(mode);
103
+ const skippedFilesSupported = requireLocal(mode);
105
104
  const development = startup.transport.CF_RELAY_DEV === "1" ? await loadDevelopmentRelay(startup.transport) : undefined;
106
105
  const release = development?.release ?? ctx.relayRuntime?.release ?? await loadInstalledRelease();
107
106
  if (release.projectContext !== "checks")
@@ -126,9 +125,7 @@ export async function analyze(path, options, ctx) {
126
125
  try {
127
126
  const code = await (ctx.relayRuntime?.run ?? runRelayCheck)(folder, {
128
127
  analyzedFolder: options.analyzedFolder ?? path,
129
- settings: captureArchitectureSettings(settings, config), config, release, skippedFilesSupported: capabilities.skippedFiles,
130
- consoleSupportsActivity: capabilities.findingActivity, consoleSupportsArchitecture: capabilities.architecture,
131
- cwd: ctx.cwd, connect: development?.connect ?? ctx.relayRuntime?.connect,
128
+ settings: captureArchitectureSettings(settings, config), config, release, skippedFilesSupported, consoleSupportsActivity: !!mode && typeof mode === "object" && "findingActivity" in mode && mode.findingActivity === true, cwd: ctx.cwd, connect: development?.connect ?? ctx.relayRuntime?.connect,
132
129
  ...(ctx.relayRuntime?.selectionProvider ? { selectionProvider: ctx.relayRuntime.selectionProvider } : {}),
133
130
  ...(proposal ? { proposal } : {}),
134
131
  ...(selection ? { selection } : {}), ...(scope ? { scope } : {}),
@@ -38,8 +38,7 @@ export function buildIntakePayload(identity, agent, report, options = {}) {
38
38
  delete legacy.activity;
39
39
  return legacy;
40
40
  });
41
- const architecture = options.consoleSupportsArchitecture === true && options.settings?.CF_LOCAL_ARCHITECTURE === "1"
42
- ? projectArchitecture(report.graph) : undefined;
41
+ const architecture = options.settings?.CF_LOCAL_ARCHITECTURE === "1" ? projectArchitecture(report.graph) : undefined;
43
42
  let result = localFindingsPayloadSchema.safeParse({ ...identity, agent, findings, ...metadata, ...(architecture ? { architecture } : {}) });
44
43
  // Optional map metadata must not crowd otherwise valid findings out of the total upload allowance.
45
44
  if (!result.success && architecture)
@@ -187,12 +187,8 @@ async function runRelayLifecycle(folder, options, existing) {
187
187
  signal.throwIfAborted();
188
188
  if (options.retryUpload)
189
189
  throw new Error("The saved completion record is missing. Keep the local report and check the output directory.");
190
- // Negotiate once before paid work: older strict intake schemas cannot accept optional metadata.
191
- const capabilities = skippedFilesEnabled(settings) && options.skippedFilesSupported === undefined
192
- || settings.CF_LOCAL_ARCHITECTURE === "1" && options.consoleSupportsArchitecture === undefined
193
- ? await client.capabilities() : undefined;
194
- const consoleSupportsArchitecture = options.consoleSupportsArchitecture ?? capabilities?.architecture ?? false;
195
- if (skippedFilesEnabled(settings) && !(options.skippedFilesSupported ?? capabilities?.skippedFiles)) {
190
+ // Negotiate before paid work: older strict intake schemas cannot accept coverage or additions.
191
+ if (skippedFilesEnabled(settings) && !(options.skippedFilesSupported ?? await client.supportsSkippedFiles())) {
196
192
  if (options.addToAnalysisId || fileScopeOf(settings) !== undefined)
197
193
  throw new ConsoleError("unavailable", "start");
198
194
  settings = Object.freeze({ ...settings, CF_SKIPPED_FILES: "0" });
@@ -274,7 +270,7 @@ async function runRelayLifecycle(folder, options, existing) {
274
270
  // The retry off path saves the full report even when intake validation refuses it.
275
271
  let paths = retainUnsaved ? undefined : await saveReports();
276
272
  const { payload, resultCheck, findingIndexes, findingActivities } = buildIntakePayload({ checkId: reservation.checkId, projectId: projectId, reservationId,
277
- bundleVersion: bundle.version, relayVersion: options.release.relayVersion, counterfactLocalVersion: options.release.localVersion }, provenance, report, { settings, files: source.snapshot, consoleSupportsActivity: options.consoleSupportsActivity, consoleSupportsArchitecture,
273
+ bundleVersion: bundle.version, relayVersion: options.release.relayVersion, counterfactLocalVersion: options.release.localVersion }, provenance, report, { settings, files: source.snapshot, consoleSupportsActivity: options.consoleSupportsActivity,
278
274
  ...(!skippedFilesEnabled(settings) || !options.addToAnalysisId && !sizeSkippedFiles(skippedFiles).length ? {} : { coverage: { skippedFiles: sizeSkippedFiles(skippedFiles), readPaths: includedPaths },
279
275
  addToAnalysisId: options.addToAnalysisId, findingAssessments: report.findingCheck.qualityAudit?.assessments ?? [] }) });
280
276
  displayFindings = findingIndexes.map((index, acceptedIndex) => {
@@ -7,7 +7,7 @@ import { resolveFolderPath } from "../adapters/folder-path.js";
7
7
  import { readLocalFolder } from "../adapters/files.js";
8
8
  import { snapshotProvenance, sameFileHashes } from "../adapters/snapshot.js";
9
9
  import { validateClientRelease } from "../adapters/release.js";
10
- import { prepareRelayPlan } from "../adapters/source-relay-plan.js";
10
+ import { prepareRelayPlan } from "../adapters/relay-plan.js";
11
11
  import { readAnalysisSource } from "../adapters/selection.js";
12
12
  import { AgentChoiceError } from "../contract/agent-choice.js";
13
13
  import { COMMITTED_FILES_MESSAGE } from "../contract/cli-refusals.js";
@@ -66,7 +66,7 @@ export async function prepareFolderChoice(folder, options) {
66
66
  }
67
67
  /** Recovery can reuse signature validation without reading the folder again. */
68
68
  export async function prepareRelayCheck(folder, options, validated = validateClientRelease(options.release, options.settings)) {
69
- const { bundle } = validated;
69
+ const { bundle, tools } = validated;
70
70
  options.signal?.throwIfAborted();
71
71
  // Discovery must agree with Git before publishing repository-relative captures.
72
72
  const selection = options.selection;
@@ -95,7 +95,7 @@ export async function prepareRelayCheck(folder, options, validated = validateCli
95
95
  }
96
96
  else if (options.expectedCommit !== undefined && provenance.commit !== options.expectedCommit)
97
97
  throw new Error(COMMITTED_FILES_MESSAGE);
98
- const { plan, files } = prepareRelayPlan({ bundle, settings: validated.settings, relayVersion: options.release.relayVersion, source });
98
+ const { plan, files } = prepareRelayPlan({ bundle, tools, settings: validated.settings, relayVersion: options.release.relayVersion, source });
99
99
  options.signal?.throwIfAborted();
100
100
  const facts = earlyFacts ?? await (options.facts ?? repositoryFacts)(factsFolder);
101
101
  options.signal?.throwIfAborted();
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.2.9";
1
+ export const CLI_VERSION = "0.2.10";
@@ -50,14 +50,6 @@ export class ConsoleError extends Error {
50
50
  }
51
51
  }
52
52
  export const isConsoleToken = (token) => /^[\x21-\x7e]{1,4096}$/.test(token);
53
- /** Strict older consoles accept optional metadata only after explicitly advertising it. */
54
- export function consoleCapabilities(mode) {
55
- return {
56
- skippedFiles: "skippedFiles" in mode && mode.skippedFiles === true,
57
- findingActivity: "findingActivity" in mode && mode.findingActivity === true,
58
- architecture: "architecture" in mode && mode.architecture === true,
59
- };
60
- }
61
53
  /** Only this client may send repository metadata, content-free lifecycle or findings-only intake payloads to the console. */
62
54
  export class ConsoleClient {
63
55
  #url;
@@ -93,12 +85,9 @@ export class ConsoleClient {
93
85
  }
94
86
  return this.#send("/api/cli/checks", input, localStartRequestSchema, localStartResponseSchema, LOCAL_START_BODY_LIMIT, { statuses: [201], headers: { ...headers, [LOCAL_START_EXECUTION_HEADER.name]: LOCAL_START_EXECUTION_HEADER.value }, context: "start" });
95
87
  }
96
- async capabilities() {
97
- const mode = await this.#send("/api/cli/checks/mode", {}, z.object({}), z.object({ skippedFiles: z.boolean().optional() }).passthrough(), 1024, { method: "GET", context: "start" });
98
- return consoleCapabilities(mode);
99
- }
100
88
  async supportsSkippedFiles() {
101
- return (await this.capabilities()).skippedFiles;
89
+ const mode = await this.#send("/api/cli/checks/mode", {}, z.object({}), z.object({ skippedFiles: z.boolean().optional() }), 1024, { method: "GET", context: "start" });
90
+ return mode.skippedFiles === true;
102
91
  }
103
92
  create(input) {
104
93
  return this.#lifecycle({ ...input, action: "create" }, consoleCreatedSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@counterfact-labs/cli",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "homepage": "https://counterfactlabs.com",
5
5
  "relaySource": "https://github.com/counterfact-labs/sealed-relay",
6
6
  "type": "module",
@@ -1,7 +0,0 @@
1
- import { localSourcePlan } from "../analysis-core/requests/local-plan.js";
2
- import { prepareRelayPlanFromCalls } from "./relay-plan.js";
3
- /** Source preparation plans the captured view once and shares the public paid-plan owner. */
4
- export function prepareRelayPlan({ bundle, relayVersion, settings, source }) {
5
- const { files, calls } = localSourcePlan(settings, source);
6
- return { files, plan: prepareRelayPlanFromCalls({ bundle, relayVersion, calls }) };
7
- }
@@ -1 +0,0 @@
1
- import{e as m,h as u,i as b,j as f,k as d,l as p}from"./MGVIKA74.js";import{z as e}from"zod";var j=["system prompt","soul","knowledge","skill","config","tools","mcp","template","reference","code"],O=e.enum(["entry","agent","tool","store","exit"]),x=256*1024,a=r=>e.string().min(1).refine(o=>o.trim().length>0&&o.isWellFormed()&&!new RegExp("\\p{Cc}|\\u2028|\\u2029","u").test(o)&&Buffer.byteLength(o,"utf8")<=r),k=a(1024).refine(r=>!r.startsWith("/")&&!r.includes("\\")&&!r.includes(":")&&r.split("/").every(o=>o!=="."&&o!==".."&&o!=="")),v=e.strictObject({path:k,role:e.enum(j),label:a(256).optional()}),_=e.strictObject({label:a(256),source:e.literal("mcp").optional()}),w=e.strictObject({version:e.literal(1),nodes:e.array(e.strictObject({id:a(256),label:a(256),kind:O,files:e.array(v).max(256),tools:e.array(_).max(256)})).min(1).max(1e3),edges:e.array(e.strictObject({from:a(256),to:a(256),kind:m})).max(4e3)}).refine(r=>{let o=new Set(r.nodes.map(c=>c.id));return o.size===r.nodes.length&&r.edges.every(c=>o.has(c.from)&&o.has(c.to))}),R=e.unknown().refine(r=>{try{let o=JSON.stringify(r);return typeof o=="string"&&Buffer.byteLength(o,"utf8")<=x}catch{return!1}}).pipe(w),t=e.string(),n=t.nullable(),i=e.number().int().nonnegative().safe(),l=e.number().int().positive().safe(),y=e.strictObject({path:t.optional(),startLine:l,endLine:l}),s=e.number(),h=e.strictObject({subKind:e.enum(["split_monolith","single_source","fold_patches","extract_subagent","merge_subagents","move_rule","move_tool","reorder"]),kind:u,severity:b,title:t,cause:t,summary:t.optional(),evidence:e.array(e.strictObject({path:t,line:l,excerpt:t})),files:e.array(e.strictObject({path:t,action:e.enum(["create","shrink","edit","delete"]),role:e.enum(["system prompt","soul","knowledge","skill","config","tools","mcp","template","reference","log","code"]),unit:t,loadMode:e.enum(["always","on_demand","never"]),loadVia:n,purpose:t,frontmatter:e.strictObject({name:t,description:t,tools:e.array(t)}).nullable()})),segments:e.array(e.strictObject({path:t,startLine:s,endLine:s,to:t,disposition:e.enum(["move","fold_into","remove_duplicate","remove_superseded"]),into:e.strictObject({path:t,line:s}).nullable(),childRef:n,heading:n,reason:t})),additions:e.array(e.strictObject({path:t,text:t,kind:e.enum(["pointer","handoff","reference_update"]),heading:n})),reorder:e.strictObject({path:t,startLine:s,endLine:s,steps:e.array(e.strictObject({from:l,reason:n}))}).nullable(),toolMoves:e.array(e.strictObject({tool:t,fromUnit:t,toUnit:t,reason:t,fromPath:n,toPath:n})),motivation:e.array(e.strictObject({kind:t,reason:t,evidence:t})).optional(),outcomes:e.array(e.strictObject({improvement:t,measurement:t})).optional(),split:e.strictObject({root:t.optional(),frontDoor:e.strictObject({name:t.optional(),job:t,skills:e.array(t)}),subAgents:e.array(e.strictObject({name:t,job:t,description:t,path:t,handoff:t.optional(),resolves:e.array(t).optional(),skills:e.array(e.strictObject({name:t,from:t,to:t})),tools:e.array(t),noTools:e.boolean().optional(),movedKnowledge:e.array(y),neededKnowledge:e.array(y)}))}).optional()}),L=e.strictObject({nodes:e.array(d.shape.nodes.element.extend({change:e.enum(["added","edited","removed"]),label:n.optional()})),edges:e.array(d.shape.edges.element.extend({kind:e.enum(["invokes","delegates","reads","writes","emits"]),change:e.enum(["added","edited","removed"]),detail:n.optional()})),files:e.array(e.strictObject({path:t,role:h.shape.files.element.shape.role,node:t,change:e.enum(["added","removed","moved","shrunk","grown","reordered"]),fromNode:t.optional(),fromPath:t.optional(),segments:i})),tools:e.array(e.strictObject({label:t,fromNode:t,toNode:t}))}),S=e.strictObject({repo:t,children:e.array(e.strictObject({ref:t,how:t})),sourceHashes:e.record(t,t),body:h,delta:L,...f}),g=e.enum(["secret","secret-content","hidden","excluded","wrong-type","too-large","empty","out-of-scope","allowance","total","scan-limit","tool-limit","missing","unreadable"]),E=e.enum([...g.options,"coding-guide","duplicate"]),C=e.strictObject({fromProposal:i,fromRulesOnly:i,rejected:i,rejectedByReason:e.partialRecord(E,i)}),D=e.strictObject({repoKey:t,findings:e.array(p),structures:e.array(S),warnings:e.array(t),proposalCounts:C.optional(),refusedFiles:e.array(e.strictObject({path:t,reason:g})),architecture:R.optional()});export{j as a,O as b,x as c,R as d,S as e,g as f,E as g,D as h};
@@ -1 +0,0 @@
1
- import{d as w,e as Y,f as X,g as Z}from"./LFYTD7JF.js";import{g as V,l as K}from"./MGVIKA74.js";import{z as t}from"zod";function W(e){return{nodes:e.nodes.map(({id:s,change:n,label:i})=>({id:s,change:n,...i===void 0?{}:{label:i}})),edges:e.edges.map(({from:s,to:n,kind:i,change:o,detail:r})=>({from:s,to:n,kind:i,change:o,...r===void 0?{}:{detail:r}}))}}function Q(e,s=n=>n){let{kind:n,severity:i,title:o,cause:r,summary:u,category:_,question:p,excerpt:O}=e;return{kind:n,severity:i,title:o,cause:r,summary:u,category:_,question:p,excerpt:O,...e.activity===void 0?{}:{activity:V.parse(e.activity)},siteRepo:s(e.siteRepo),site:e.site&&{path:e.site.path,line:e.site.line},otherSites:e.otherSites.map(({repo:d,path:E,line:F,excerpt:I})=>({repo:s(d),path:E,line:F,excerpt:I})),fixes:e.fixes.map(({title:d,approach:E,kind:F,targetFiles:I,expectedOutcome:f,summary:N,impact:m,confidence:P,objective:y,status:b,blockedBy:h,alsoFixes:A,delta:L})=>({title:d,approach:E,kind:F,targetFiles:I.map(({path:D,create:U})=>({path:D,create:U})),expectedOutcome:f,summary:N,impact:m,confidence:P,objective:y,status:b,blockedBy:h,alsoFixes:A&&A.slice(),delta:L&&W(L)})),...e.sourceNotes===void 0?{}:{sourceNotes:e.sourceNotes&&{sites:e.sourceNotes.sites.map(({index:d,role:E,meaning:F,keyPhrase:I})=>({index:d,role:E,meaning:F,keyPhrase:I})),support:e.sourceNotes.support,supportNote:e.sourceNotes.supportNote,counterEvidence:e.sourceNotes.counterEvidence.map(({repo:d,path:E,line:F,excerpt:I,meaning:f})=>({repo:s(d),path:E,line:F,excerpt:I,meaning:f}))}}}}function J(e){return{...e.headline===void 0?{}:{headline:e.headline},...e.ifLeft===void 0?{}:{ifLeft:e.ifLeft}}}function Ce(e){let s=e.body;return{repo:e.repo,children:e.children.map(({ref:n,how:i})=>({ref:n,how:i})),sourceHashes:Object.fromEntries(Object.entries(e.sourceHashes)),body:{subKind:s.subKind,kind:s.kind,severity:s.severity,title:s.title,cause:s.cause,...s.summary===void 0?{}:{summary:s.summary},evidence:s.evidence.map(({path:n,line:i,excerpt:o})=>({path:n,line:i,excerpt:o})),files:s.files.map(({path:n,action:i,role:o,unit:r,loadMode:u,loadVia:_,purpose:p,frontmatter:O})=>({path:n,action:i,role:o,unit:r,loadMode:u,loadVia:_,purpose:p,frontmatter:O&&{name:O.name,description:O.description,tools:O.tools.slice()}})),segments:s.segments.map(({path:n,startLine:i,endLine:o,to:r,disposition:u,into:_,childRef:p,heading:O,reason:d})=>({path:n,startLine:i,endLine:o,to:r,disposition:u,into:_&&{path:_.path,line:_.line},childRef:p,heading:O,reason:d})),additions:s.additions.map(({path:n,text:i,kind:o,heading:r})=>({path:n,text:i,kind:o,heading:r})),reorder:s.reorder&&{path:s.reorder.path,startLine:s.reorder.startLine,endLine:s.reorder.endLine,steps:s.reorder.steps.map(({from:n,reason:i})=>({from:n,reason:i}))},toolMoves:s.toolMoves.map(({tool:n,fromUnit:i,toUnit:o,reason:r,fromPath:u,toPath:_})=>({tool:n,fromUnit:i,toUnit:o,reason:r,fromPath:u,toPath:_})),...s.motivation===void 0?{}:{motivation:s.motivation.map(({kind:n,reason:i,evidence:o})=>({kind:n,reason:i,evidence:o}))},...s.outcomes===void 0?{}:{outcomes:s.outcomes.map(({improvement:n,measurement:i})=>({improvement:n,measurement:i}))},...s.split===void 0?{}:{split:{...s.split.root===void 0?{}:{root:s.split.root},frontDoor:{...s.split.frontDoor.name===void 0?{}:{name:s.split.frontDoor.name},job:s.split.frontDoor.job,skills:s.split.frontDoor.skills.slice()},subAgents:s.split.subAgents.map(n=>({name:n.name,job:n.job,description:n.description,path:n.path,...n.handoff===void 0?{}:{handoff:n.handoff},...n.resolves===void 0?{}:{resolves:n.resolves.slice()},skills:n.skills.map(({name:i,from:o,to:r})=>({name:i,from:o,to:r})),tools:n.tools.slice(),...n.noTools===void 0?{}:{noTools:n.noTools},movedKnowledge:n.movedKnowledge.map($),neededKnowledge:n.neededKnowledge.map($)}))}}},delta:{...W(e.delta),files:e.delta.files.map(({path:n,role:i,node:o,change:r,fromNode:u,fromPath:_,segments:p})=>({path:n,role:i,node:o,change:r,segments:p,...u===void 0?{}:{fromNode:u},..._===void 0?{}:{fromPath:_}})),tools:e.delta.tools.map(({label:n,fromNode:i,toNode:o})=>({label:n,fromNode:i,toNode:o}))},...J(e)}}function $({path:e,startLine:s,endLine:n}){return{...e===void 0?{}:{path:e},startLine:s,endLine:n}}function ue(e,s){return{repoKey:e.repoKey,findings:e.findings.map(n=>({...Q(n),...J(n),...n.audience===void 0?{}:{audience:n.audience}})),structures:e.structures.map(Ce),warnings:e.warnings.slice(),...e.proposalCounts?{proposalCounts:{fromProposal:e.proposalCounts.fromProposal,fromRulesOnly:e.proposalCounts.fromRulesOnly,rejected:e.proposalCounts.rejected,rejectedByReason:Object.fromEntries(Z.options.filter(n=>e.proposalCounts.rejectedByReason[n]!==void 0).map(n=>[n,e.proposalCounts.rejectedByReason[n]]))}}:{},refusedFiles:s.map(({path:n,reason:i})=>({path:n,reason:i}))}}function de(e){if(e.redacted)throw new Error("Relay refused the request: leak_refused");return e.answer}import{z as T}from"zod";var R=1,ee=T.string().min(1).max(128),H=["file_reads","repository_listing","sealed_delivery"],v=T.strictObject({protocol:T.literal(R),bundleVersion:ee,engineVersion:ee,capabilities:T.array(T.enum(H)).refine(e=>e.length===H.length&&new Set(e).size===H.length)}),x=2;function te(){return T.strictObject({...v.shape,protocol:T.literal(x)}).refine(e=>v.safeParse({...e,protocol:R}).success)}var ne=Object.freeze(["CF_SKIPPED_FILES","CF_MECHANICAL_CHECKS","CF_MULTI_PASS","CF_SPLIT_CHECK","CF_FINDING_CHECK","CF_SOURCE_NOTES","CF_PARALLEL_PASSES","CF_PASS_CONCURRENCY","CF_PARALLEL_SCOPE_CHECK","CF_FINDING_QUALITY","CF_FINDING_FULL_CONTEXT","CF_FINDING_PRECISION_RULES","CF_PROMPT_AGREE","CF_FINDING_SECOND_OPINION","CF_FINDING_RANKING","CF_FINDING_SEMANTIC_MATCHING","CF_FINDING_CODE_INPUTS","CF_FINDING_RECALL","CF_FINDING_RECALL_VARIANT","CF_FINDING_SECOND_OPINION_MODEL","CF_FINDING_SECOND_OPINION_PROVIDER","CF_FIX_EXPECTED_OUTCOME","CF_UNTRUSTED_CONTENT_CHECK","CF_FINDING_BETTER_AS_CODE","CF_CODE_AGENTS","CF_CODE_AGENTS_MODEL","CF_FINDING_DEDUPE","CF_ANALYSIS_IMPORTED_AGENTS","CF_RECALL_SIGNALS","CF_READING_NOTE_AGENT_ONLY","CF_SPLIT_HELPER_TOOLS","CF_CODE_PROMPT_LOADERS","CF_CODE_PROMPT_FUNCTIONS","CF_READING_PRIORITY","CF_LOCAL_SYMLINK_GUARD","CF_IMPORT_EXAMPLE_FILTER","CF_IMPORT_OUTSIDE_LOADERS","CF_SECRET_SCAN","CF_RESPECT_GITIGNORE","CF_IMPORT_COVERAGE","CF_IMPORT_LEXICAL_FACTS","CF_IMPORT_PROMPT_FIELDS","CF_IMPORT_MANIFEST","CF_IMPORT_SCOPED_SCAN","CF_IMPORT_SCOPES","CF_IMPORT_AGENT_PAGES","CF_IMPORT_INCLUDE_EXAMPLES","CF_IMPORT_WEAK_CODE_FALLBACK","CF_FILE_SCOPE","CF_SCOPE_CHOICES","CF_FOLDER_PARTS","CF_PART_FILES","CF_LOCAL_IMPORT_RESOLUTION","CF_MULTI_ENTRY","CF_IMPORT_GUIDES_AS_PROMPT","CF_CONFIGURATION_GUIDE_PROMPT","CF_CHOOSE_AGENT","CF_IMPORT_PROPOSAL","CF_LOCAL_COMMITTED_ONLY","CF_LOCAL_GITIGNORE_OUTPUT","CF_LOCAL_ARCHITECTURE","CF_REFUSE_TOO_LARGE","CF_COST_FINDINGS","CF_FINDING_AUDIENCE","CF_NOT_ACTIVE_GROUP","CF_FINDING_HEADLINES","CF_IMPORT_LAYOUTS","CF_DISCOVERY_SKILLS","CF_IMPORT_CALLS","CF_PROMPT_CACHE","CF_MODEL_READER","CF_LEGACY_TOOL_LISTS","CF_RESULT_SAFETY_CHECK"]),q=ne.filter(e=>e!=="CF_SKIPPED_FILES"&&e!=="CF_RESULT_SAFETY_CHECK"&&e!=="CF_LOCAL_COMMITTED_ONLY"&&e!=="CF_LOCAL_GITIGNORE_OUTPUT"&&e!=="CF_LOCAL_ARCHITECTURE"&&e!=="CF_FOLDER_PARTS"&&e!=="CF_PART_FILES"&&e!=="CF_FILE_SCOPE"&&e!=="CF_SCOPE_CHOICES"&&e!=="CF_LOCAL_IMPORT_RESOLUTION"&&e!=="CF_MULTI_ENTRY"),ie=q.filter(e=>e!=="CF_IMPORT_OUTSIDE_LOADERS"&&e!=="CF_SECRET_SCAN"&&e!=="CF_RESPECT_GITIGNORE"&&e!=="CF_IMPORT_COVERAGE"&&e!=="CF_IMPORT_LEXICAL_FACTS"&&e!=="CF_IMPORT_PROMPT_FIELDS"&&e!=="CF_IMPORT_MANIFEST"&&e!=="CF_IMPORT_SCOPED_SCAN"&&e!=="CF_REFUSE_TOO_LARGE"&&e!=="CF_IMPORT_SCOPES"&&e!=="CF_IMPORT_AGENT_PAGES"&&e!=="CF_IMPORT_INCLUDE_EXAMPLES"&&e!=="CF_IMPORT_WEAK_CODE_FALLBACK"&&e!=="CF_IMPORT_GUIDES_AS_PROMPT"&&e!=="CF_CONFIGURATION_GUIDE_PROMPT"&&e!=="CF_CHOOSE_AGENT"&&e!=="CF_IMPORT_PROPOSAL"&&e!=="CF_FINDING_AUDIENCE"&&e!=="CF_MECHANICAL_CHECKS"&&e!=="CF_COST_FINDINGS"&&e!=="CF_NOT_ACTIVE_GROUP");function Ue(e,s="request"){return Object.freeze(Object.fromEntries((s==="saved"?ne:s==="engine"?q:ie).filter(i=>Object.hasOwn(e,i)&&e[i]!==void 0).map(i=>[i,e[i]])))}var ke=t.partialRecord(t.enum(ie),t.string()),re=t.partialRecord(t.enum(q),t.string()),C=t.string(),l=t.number().int().nonnegative().safe(),S=t.number().int().positive().safe(),G=t.enum(["bad_request","unavailable","reservation","leak_refused","cancelled"]);function Ye(e){let s=G.safeParse(e);return s.success?s.data:"unavailable"}function He(e){return Object.assign(new Error(e),{code:e})}var pe=1024*1024,se=C.min(1).max(128),M=C.regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/),g=C.regex(/^[a-f0-9]{64}$/),a={protocol:t.literal(R),analysisId:t.uuid(),nonce:C.min(16).max(256),bundleVersion:se,engineVersion:se};function c(e){return t.unknown().refine(s=>{try{let n=JSON.stringify(s);return typeof n=="string"&&new TextEncoder().encode(n).byteLength<=pe}catch{return!1}}).pipe(e)}var Oe=C.min(1).refine(e=>!/[\\\0\r\n]/.test(e)&&!/^(?:\/|[a-zA-Z]:)/.test(e)&&e.split("/").every(s=>s!==""&&s!=="."&&s!=="..")),Ee=t.strictObject({id:M,path:Oe,size:l,hash:g}),z=t.array(Ee).refine(e=>new Set(e.map(s=>s.id)).size===e.length&&new Set(e.map(s=>s.path)).size===e.length),B=t.strictObject({snapshot:g,commit:C.regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/),files:z,entriesVisited:l.optional(),truncated:t.boolean().optional(),complete:t.boolean(),cursor:C.min(1).max(256).optional()}).refine(e=>e.complete?e.cursor===void 0:e.cursor!==void 0),ve=c(t.strictObject({...a,settings:re,manifest:B})),qe=t.strictObject(a),Fe=t.strictObject({startByte:l,endByte:l}).refine(e=>e.endByte>e.startByte),Ie=t.strictObject({startLine:S,endLine:S}).refine(e=>e.endLine>=e.startLine),oe=c(t.strictObject({...a,type:t.literal("need_files"),sequence:l,reads:t.array(t.strictObject({id:M,range:t.union([Fe,Ie])})).min(1)})),ce=c(t.strictObject({...a,type:t.literal("need_listing"),sequence:l,cursor:C.min(1).max(256).nullable()})),Se=c(t.discriminatedUnion("type",[t.strictObject({...a,type:t.literal("files"),sequence:l,files:t.array(t.union([t.strictObject({id:M,startByte:l,text:C,complete:t.boolean(),hash:g}),t.strictObject({id:M,refused:X})])).min(1)}),t.strictObject({...a,type:t.literal("listing"),sequence:l,manifest:B}),t.strictObject({...a,type:t.literal("reservation"),sequence:l,reservationId:t.uuid(),reservationToken:C.min(1).max(256)}),t.strictObject({...a,type:t.literal("delivery"),sequence:l,callId:t.uuid(),attemptId:t.uuid().nullable()}),t.strictObject({...a,type:t.literal("chunk"),sequence:l,callId:t.uuid(),attemptId:t.uuid(),chunk:S})])),j={chunk:l,chunks:S},Te=t.strictObject({...a,type:t.literal("result"),finalFiles:z,findings:t.array(K),structures:t.array(Y),notices:t.array(C)}),Re=c(Te.extend(j).refine(e=>e.chunk<e.chunks)),fe=c(t.strictObject({...a,type:t.literal("result_chunk"),...j,text:C,hash:g}).refine(e=>e.chunk<e.chunks)),le=c(t.strictObject({...a,type:t.literal("call_failed"),sequence:l,callId:t.uuid(),attemptId:t.uuid().nullable(),code:G}));function Ae(e){let s=c(t.strictObject({...a,type:t.literal("plan"),sequence:l,...j,plan:e.plan,finalFiles:z}).refine(r=>r.chunk<r.chunks)),n=C.regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/).min(1).refine(r=>!/\s/.test(r)),i=c(t.strictObject({...a,type:t.literal("sealed_delivery"),sequence:l,callId:t.uuid(),attemptId:t.uuid(),algorithm:t.literal("AES-256-GCM"),iv:n.length(16),...j,ciphertext:n,tag:C.regex(/^[A-Za-z0-9+/]{21}[AQgw]==$/).length(24).optional(),delivery:t.strictObject({confirmation:e.deliveryConfirmation,deadlineMs:S}).optional()}).refine(r=>r.chunk<r.chunks&&(r.chunk===r.chunks-1?r.tag!==void 0&&r.delivery!==void 0&&r.delivery.confirmation.callId===r.callId&&r.delivery.confirmation.attemptId===r.attemptId:r.tag===void 0&&r.delivery===void 0))),o=t.strictObject({...a,type:t.literal("refused"),code:G});return{plan:s,sealedDelivery:i,response:t.union([oe,ce,s,i,le,Re,fe,o])}}var ze=t.strictObject({version:t.literal(1),serializedBytes:S,freeTextUtf8Bytes:S,fields:t.array(t.strictObject({pointer:C.regex(/^(?:\/(?:[^~/]|~[01])*)+$/),kind:t.enum(["string","array"]),max:S}))});function Be(e){let s={...a,protocol:t.literal(x)},n=e.context,i=c(t.strictObject({...s,settings:re,context:n.preparationContext,manifest:B})),o=t.strictObject(s),r=c(t.union([...Se.out.options.map(k=>k.extend(s)),t.strictObject({...s,type:t.literal("next"),sequence:l,stream:t.enum(["plan","result"]),chunk:S})])),u=t.strictObject({kind:t.literal("ready"),plan:e.plan,finalFiles:n.finalFiles,analysisSize:n.analysisSize,membership:n.membership}),_=t.strictObject({kind:t.literal("agent_choice"),choice:e.choice}),p=t.strictObject({kind:t.literal("proposal_refused")}),O=t.union([u,_,p]),d=t.strictObject({finalFiles:n.finalFiles,report:e.report,membership:n.membership,architecture:w.optional()}),E=d.extend({...s,type:t.literal("result")}),F=c(t.strictObject({...s,type:t.literal("plan"),sequence:l,plan:e.plan,finalFiles:n.finalFiles,analysisSize:n.analysisSize,membership:n.membership})),I=e.planChunks,f=e.resultChunks,N=c(I.chunk.safeExtend({...s,type:t.literal("plan_chunk"),sequence:l,stream:t.literal("plan")})),m=c(f.chunk.safeExtend({...s,type:t.literal("result_chunk"),sequence:l,stream:t.literal("result")})),P=Ae(e),y=c(t.strictObject({...P.sealedDelivery.out.shape,...s}).refine(k=>P.sealedDelivery.safeParse({...k,protocol:R}).success)),b=c(oe.out.extend(s)),h=c(ce.out.extend(s)),A=c(le.out.extend(s)),L=t.strictObject({...s,type:t.literal("refused"),code:G}),D=t.strictObject({...s,type:t.literal("cancelled")}),U=c(t.union([b,h,F,y,A,c(E),N,m,L,D,t.strictObject({...s,type:t.literal("agent_choice"),choice:e.choice}),t.strictObject({...s,type:t.literal("proposal_refused")})])),ae=t.union([d.extend({kind:t.literal("result")}),_,p]),_e=te();return{start:i,cancel:o,advance:r,needFiles:b,needListing:h,ready:u,preparationOutcome:O,resultBody:d,finalResult:E,plan:F,planChunk:N,resultChunk:m,sealedDelivery:y,callFailure:A,refused:L,cancelled:D,response:U,clientOutcome:ae,capabilities:_e}}export{Q as a,ue as b,de as c,R as d,v as e,x as f,ne as g,Ue as h,ke as i,re as j,G as k,Ye as l,He as m,pe as n,Ee as o,B as p,ve as q,qe as r,oe as s,ce as t,Se as u,Te as v,Re as w,fe as x,le as y,Ae as z,ze as A,Be as B};
@@ -1 +0,0 @@
1
- import{z as e}from"zod";import{z as n}from"zod";import{z as v}from"zod";var b=v.enum(["ready","needs_review","blocked"]);var S=n.enum(["users","team"]),C=n.enum(["high","medium","low"]),j=n.enum(["added","edited","removed"]),q=n.enum(["invokes","delegates","reads","writes","emits"]),m=n.object({nodes:n.array(n.object({id:n.string().min(1),change:j,label:n.string().nullable()})),edges:n.array(n.object({from:n.string().min(1),to:n.string().min(1),kind:q,change:j,detail:n.string().nullable()}))}),F=n.object({summary:n.string().nullable(),impact:n.string().nullable(),confidence:C.nullable(),objective:n.string().nullable(),status:b.nullable(),blockedBy:n.string().nullable(),alsoFixes:n.array(n.string()).default([]),delta:m.nullable()});import{z as c}from"zod";var k=c.strictObject({state:c.enum(["active","dead","switched_off"]),gate:c.string().nullable(),reason:c.string(),evidence:c.array(c.strictObject({path:c.string(),line:c.number(),excerpt:c.string()}))});var t=e.string(),r=t.nullable(),x=e.number().int().positive().safe(),D=e.enum(["ordering","reliability","coverage","cost","safety","correctness"]),R=e.enum(["low","medium","high","critical"]),A={headline:t.optional(),ifLeft:t.optional()},I=e.strictObject({nodes:e.array(e.strictObject({id:t,change:t,label:r})),edges:e.array(e.strictObject({from:t,to:t,kind:t,change:t,detail:r}))}),E=e.strictObject({sites:e.array(e.strictObject({index:e.number().int().nonnegative().safe(),role:e.enum(["Says","But also says","Unclear","Context","Requirement","What actually happens","Why it's a gap","Evidence"]),meaning:t,keyPhrase:t})),support:e.enum(["supported","partly","not_supported"]),supportNote:t,counterEvidence:e.array(e.strictObject({repo:t,path:t,line:x,excerpt:t,meaning:t}))}),h=e.strictObject({kind:D,severity:R,title:t,cause:t,summary:r,category:r,question:r,audience:S.optional(),activity:k.optional(),siteRepo:r,site:e.strictObject({path:t,line:x.nullable()}).nullable(),excerpt:r,otherSites:e.array(e.strictObject({repo:t,path:t,line:x,excerpt:t})),fixes:e.array(e.strictObject({title:t,approach:t,kind:e.enum(["code","prompt"]),targetFiles:e.array(e.strictObject({path:t,create:e.boolean().nullable()})),expectedOutcome:t,summary:r,impact:r,confidence:r,objective:r,status:r,blockedBy:r,alsoFixes:e.array(t).nullable(),delta:I.nullable()})),sourceNotes:E.nullable().optional(),...A}),d=Object.freeze({findings:2e4,textBytes:4096,quoteBytes:2e3,freeTextBytesPerFinding:16*1024}),Z=d.freeTextBytesPerFinding*d.findings;function T(i){return typeof i=="string"?!i.includes("\0")&&!/[\uD800-\uDFFF]/u.test(i):i===null||typeof i!="object"||Object.values(i).every(T)}function B(i,o){return new TextEncoder().encode(i).byteLength<=(o?d.quoteBytes:d.textBytes)}var L=new Set(["excerpt","keyPhrase"]);function w(i){return L.has(String(i.at(-1)))}function _(i,o=[]){return typeof i=="string"?B(i,w(o)&&o[0]!=="activity"):i===null||typeof i!="object"||Object.entries(i).every(([f,u])=>_(u,[...o,f]))}var s=h.shape,O=t.min(1).refine(i=>i.trim().length>0),z=m.extend({nodes:e.array(m.shape.nodes.element.strict()),edges:e.array(m.shape.edges.element.strict())}).strict(),p=s.fixes.element.shape,P=e.strictObject({title:p.title.min(1),approach:p.approach.min(1),kind:p.kind,targetFiles:e.array(p.targetFiles.element.extend({path:t.min(1)})),...F.shape,delta:z.nullable(),expectedOutcome:p.expectedOutcome}),$=e.strictObject({...h.pick({kind:!0,severity:!0}).shape,title:s.title.min(1),cause:s.cause.min(1),summary:s.summary,site:s.site.unwrap().extend({path:t.min(1)}).nullable(),excerpt:s.excerpt,category:s.category,otherSites:e.array(e.strictObject({path:t.min(1),line:x,excerpt:t.trim().min(1),repo:O})),question:s.question,fixes:e.array(P).min(1),activity:s.activity,audience:s.audience,siteRepo:O.nullable(),sourceNotes:E.nullable().optional()}).refine(i=>_(i)),K=h.superRefine((i,o)=>{let f=0;function u(a,g){if(typeof a=="string"){let l=w(g);l||(f+=new TextEncoder().encode(a).byteLength),(!B(a,l)||!T(a))&&o.addIssue({code:"custom",path:g,message:"Invalid result text"})}else Array.isArray(a)?a.forEach((l,y)=>u(l,[...g,y])):a!==null&&typeof a=="object"&&Object.entries(a).forEach(([l,y])=>u(y,[...g,l]))}u(i,[]),f>d.freeTextBytesPerFinding&&o.addIssue({code:"custom",message:"Result text exceeds the finding budget"})}),ee=e.array(K).max(d.findings);export{b as a,S as b,C as c,j as d,q as e,F as f,k as g,D as h,R as i,A as j,I as k,h as l,d as m,Z as n,T as o,O as p,$ as q,K as r,ee as s};
@@ -1 +0,0 @@
1
- import{a as u,c as a,e as g,g as h}from"./OKBK3JL3.js";import{b as o,g as f}from"./MGVIKA74.js";import{a as l}from"./INVTU73D.js";import{a as x}from"./A7WJJMRY.js";import{a as m,b as p}from"./VDUFPTDD.js";import{z as r}from"zod";import{z as e}from"zod";var _=["Says","But also says","Unclear","Context","Requirement","What actually happens","Why it's a gap","Evidence"],b=e.object({sites:e.array(e.object({index:e.number().int().nonnegative(),role:e.enum(_),meaning:e.string(),keyPhrase:e.string()})),support:e.enum(["supported","partly","not_supported"]),supportNote:e.string(),counterEvidence:e.array(e.object({repo:e.string(),path:e.string(),line:e.number().int().positive(),excerpt:e.string(),meaning:e.string()}))});var E={expectedOutcome:{setting:"CF_FIX_EXPECTED_OUTCOME",enabled:t=>t.CF_FIX_EXPECTED_OUTCOME!=="0",suffix:"-no-outcome",suffixWhen:!1},untrustedContent:{setting:"CF_UNTRUSTED_CONTENT_CHECK",enabled:m,suffix:"-no-untrusted",suffixWhen:!1},betterAsCode:{setting:"CF_FINDING_BETTER_AS_CODE",enabled:p,suffix:"-better-as-code",suffixWhen:!0},audience:{setting:"CF_FINDING_AUDIENCE",enabled:x,suffix:"-audience",suffixWhen:!0},activity:{setting:"CF_NOT_ACTIVE_GROUP",enabled:l,suffix:"-activity",suffixWhen:!0}};function C(t){let n=Object.entries(E).map(([i,s])=>({key:i,rule:s,enabled:s.enabled(t)}));return{name:`findings${n.map(({rule:i,enabled:s})=>s===i.suffixWhen?i.suffix:"").join("")}`,switches:Object.fromEntries(n.map(({key:i,enabled:s})=>[i,s])),settings:Object.fromEntries(n.map(({rule:i,enabled:s})=>[i.setting,s?"1":"0"]))}}function H(){let t=[{}];for(let{setting:n}of Object.values(E))t=t.flatMap(i=>["0","1"].map(s=>({...i,[n]:s})));return t.map(n=>({...C(n),schema:N(n)}))}function F(t){return r.object({findings:r.array(t.shape.findings.element.extend({fixes:r.array(a.omit({expectedOutcome:!0})).min(1)}))})}var O=r.string(),S=O.catch(void 0),v=a.extend({expectedOutcome:r.string().default("")}),A=r.array(g.extend({audience:o.optional().catch(void 0),activity:f.optional().catch(void 0),fixes:r.array(v).min(1),sourceNotes:b.nullable().optional().catch(null)}));function N(t){let n=C(t),i=h(n.settings),c=(n.switches.expectedOutcome?i:F(i)).shape.findings.element,y=o.describe(u("finding-audience")),d=n.switches.audience?c.extend({audience:y.catch(void 0)}):c;return r.object({findings:r.array(n.switches.activity?d.extend({activity:S}):d)})}function V(t){return T(t.findings)}function T(t){return A.parse(t)}export{b as a,C as b,H as c,N as d,V as e,T as f};
@@ -1 +0,0 @@
1
- import{a as l,b as h}from"./LFYTD7JF.js";import{a as m,c as u,d as s,e as c,f as i}from"./MGVIKA74.js";import{c as p,d as b}from"./VDUFPTDD.js";function a(n,x={}){return JSON.stringify({bundleDescription:n,inputs:x})}import{z as e}from"zod";import{z as t}from"zod";var r=t.object({motivation:t.array(t.object({kind:t.string(),reason:t.string(),evidence:t.string()})),outcomes:t.array(t.object({improvement:t.string(),measurement:t.string()}))}),N=r.extend({motivation:r.shape.motivation.default([]),outcomes:r.shape.outcomes.default([])});var d=e.object({path:e.string().min(1),line:e.number().int().positive().nullable()}),y=e.object({label:e.string(),source:e.literal("mcp").optional(),brand:e.string().nullable().default(()=>null)}),S=e.object({filledAtRunTime:e.boolean().optional(),role:e.enum(l),label:e.string().nullable().default(()=>null),path:e.string().min(1),span:e.object({from:e.number().int(),to:e.number().int()}).optional()}),j=e.object({id:e.string().min(1),label:e.string().min(1),kind:h,desc:e.string(),meta:e.string().nullable(),sourceRef:d.nullable(),sourcePaths:e.array(e.string()).optional(),files:e.array(S).default(()=>[]),tools:e.array(y).default(()=>[])}),v=e.object({from:e.string().min(1),to:e.string().min(1),kind:c,label:e.string().nullable(),sourceRef:d.nullable()}),T=e.object({nodes:e.array(j),edges:e.array(v),warnings:e.array(e.string())}),E=e.object({...r.shape,title:e.string().min(1).describe(a("analysis-wire-schemas-1")),approach:e.string().min(1).describe(a("analysis-wire-schemas-2")),kind:e.enum(["code","prompt"]),targetFiles:e.array(e.object({path:e.string().min(1),create:e.boolean().nullable()})),...i.shape});function o(n){return e.string().describe(a("analysis-wire-schemas-3",{v0:Object.values(n.enum).join(", ")}))}var w=e.object({nodes:e.array(e.object({id:e.string().min(1),change:o(s),label:e.string().nullable()})),edges:e.array(e.object({from:e.string().min(1),to:e.string().min(1),kind:o(c),change:o(s),detail:e.string().nullable()}))}),F=E.omit({motivation:!0,outcomes:!0}).extend({expectedOutcome:e.string().describe(a("analysis-wire-schemas-4")),summary:i.shape.summary.catch(null),impact:i.shape.impact.catch(null),objective:i.shape.objective.catch(null),blockedBy:i.shape.blockedBy.catch(null),confidence:o(u).nullable().catch(null),status:o(m).nullable().catch(null),alsoFixes:e.array(e.string()).nullable().default([]).catch(()=>[]),delta:w.nullable().catch(null)}),q=e.object({path:e.string().min(1),line:e.number().int().positive(),excerpt:e.string().trim().min(1)}),k=e.object({path:e.string(),line:e.number(),excerpt:e.string()}),g=n=>e.string().describe(a("analysis-wire-schemas-5",{v0:p(n).join(", ")})).nullable().catch(null),f=e.object({kind:e.enum(["ordering","reliability","coverage","cost","safety","correctness"]),severity:e.enum(["low","medium","high","critical"]),title:e.string().min(1).describe(a("analysis-wire-schemas-6")),cause:e.string().min(1),summary:e.string().describe(a("analysis-wire-schemas-7")).catch(""),site:e.object({path:e.string().min(1),line:e.number().int().positive().nullable()}).nullable(),excerpt:e.string().nullable(),category:g({}),otherSites:e.array(k).nullable().default([]).catch(()=>[]),question:e.string().describe(a("analysis-wire-schemas-8")).catch(""),fixes:e.array(F).min(1)}),O=e.object({findings:e.array(f)});function A(n){return b(n)?O:e.object({findings:e.array(f.extend({category:g(n)}))})}export{a,T as b,F as c,q as d,f as e,O as f,A as g};