@counterfact-labs/cli 0.2.6 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/bundle/client-release.json +1 -1
- package/dist/adapters/analysis-results.js +87 -0
- package/dist/adapters/combined-results.js +27 -0
- package/dist/adapters/completion-lock.js +95 -0
- package/dist/adapters/completion.js +132 -17
- package/dist/adapters/entry-files.js +129 -0
- package/dist/adapters/entry-packing.js +161 -0
- package/dist/adapters/entry-selection.js +57 -0
- package/dist/adapters/files.js +111 -5
- package/dist/adapters/git.js +10 -1
- package/dist/adapters/relay-plan.js +5 -7
- package/dist/adapters/release.js +4 -1
- package/dist/adapters/results.js +18 -3
- package/dist/adapters/selection.js +114 -0
- package/dist/adapters/settings.js +62 -4
- package/dist/adapters/source-relay-plan.js +7 -0
- package/dist/analysis-core/analysis/code-agents/skipped-files.js +1 -1
- package/dist/analysis-core/analysis/file-analysis-plan.js +1 -0
- package/dist/analysis-core/analysis/file-dependencies.js +1 -0
- package/dist/analysis-core/analysis/finding-activity-switch.js +1 -0
- package/dist/analysis-core/analysis/finding-identity.js +1 -0
- package/dist/analysis-core/analysis/finding-quality/policy.js +1 -0
- package/dist/analysis-core/analysis/folder-analysis-plan.js +1 -0
- package/dist/analysis-core/analysis/passes/full-file-passes.js +1 -0
- package/dist/analysis-core/analysis/project-architecture.js +1 -0
- package/dist/analysis-core/analysis/schemas.js +1 -1
- package/dist/analysis-core/chunks/2AASSZRO.js +35 -0
- package/dist/analysis-core/chunks/2YREYGOG.js +1 -0
- package/dist/analysis-core/chunks/33HRXJ5Q.js +1 -0
- package/dist/analysis-core/chunks/33IGHOYT.js +1 -0
- package/dist/analysis-core/chunks/4PT5C4IT.js +7 -0
- package/dist/analysis-core/chunks/4RXRAB5S.js +1 -0
- package/dist/analysis-core/chunks/4UDQBDDE.js +1 -0
- package/dist/analysis-core/chunks/{OPMA32A6.js → 5B5UCWD3.js} +1 -1
- package/dist/analysis-core/chunks/6YCABS5T.js +1 -0
- package/dist/analysis-core/chunks/CQQ4TTXE.js +1 -0
- package/dist/analysis-core/chunks/CTLHKFPH.js +19 -0
- package/dist/analysis-core/chunks/F54DOWKN.js +6 -0
- package/dist/analysis-core/chunks/FRXOQ2M6.js +3 -0
- package/dist/analysis-core/chunks/HCPO6QPU.js +1 -0
- package/dist/analysis-core/chunks/HHFDNY6V.js +14 -0
- package/dist/analysis-core/chunks/{3JWEFCTJ.js → HVQJKPQ4.js} +1 -1
- package/dist/analysis-core/chunks/INVTU73D.js +1 -0
- package/dist/analysis-core/chunks/JEWBPIQI.js +1 -0
- package/dist/analysis-core/chunks/JGK37AWN.js +1 -0
- package/dist/analysis-core/chunks/LFYTD7JF.js +1 -0
- package/dist/analysis-core/chunks/LMUXOKIM.js +1 -0
- package/dist/analysis-core/chunks/LOBIDUCA.js +1 -0
- package/dist/analysis-core/chunks/M5YWJY7P.js +1 -0
- package/dist/analysis-core/chunks/MGVIKA74.js +1 -0
- package/dist/analysis-core/chunks/MKYLK6DB.js +1 -0
- package/dist/analysis-core/chunks/MZOKZ3N6.js +1 -0
- package/dist/analysis-core/chunks/NXHVBJL4.js +1 -0
- package/dist/analysis-core/chunks/OKBK3JL3.js +1 -0
- package/dist/analysis-core/chunks/PBHHWFR6.js +1 -0
- package/dist/analysis-core/chunks/Q5WR6B2H.js +2 -0
- package/dist/analysis-core/chunks/QVXARKP7.js +1 -0
- package/dist/analysis-core/chunks/RQTNTIR4.js +1 -0
- package/dist/analysis-core/chunks/RUVMFAST.js +1 -0
- package/dist/analysis-core/chunks/S27VIQMZ.js +1 -0
- package/dist/analysis-core/chunks/{YDBO7P4X.js → S27Y2TP5.js} +1 -1
- package/dist/analysis-core/chunks/SJESFYBA.js +10 -0
- package/dist/analysis-core/chunks/SP6XFHNH.js +1 -0
- package/dist/analysis-core/chunks/VDUFPTDD.js +1 -0
- package/dist/analysis-core/chunks/W24SFYZM.js +67 -0
- package/dist/analysis-core/chunks/YTHF2E2S.js +1 -0
- package/dist/analysis-core/chunks/YWL52FVW.js +2 -0
- package/dist/analysis-core/contracts/analysis-selection.js +1 -0
- package/dist/analysis-core/contracts/analysis-size.js +1 -0
- package/dist/analysis-core/contracts/execution-request.js +1 -0
- package/dist/analysis-core/contracts/intake-finding.js +1 -0
- package/dist/analysis-core/contracts/model-call-identity.js +1 -0
- package/dist/analysis-core/contracts/module-resolution.js +1 -0
- package/dist/analysis-core/contracts/relay-analysis.js +1 -1
- package/dist/analysis-core/contracts/requests.js +1 -1
- package/dist/analysis-core/contracts/selection-paths.js +1 -0
- package/dist/analysis-core/conventions/analysis-fit.js +1 -1
- package/dist/analysis-core/conventions/file-admission.js +1 -1
- package/dist/analysis-core/conventions/read-limits.js +1 -0
- package/dist/analysis-core/import/calls/modules.js +1 -0
- package/dist/analysis-core/import/entry-selection.js +1 -0
- package/dist/analysis-core/import/outside-loader-sources.js +1 -1
- package/dist/analysis-core/index.js +3 -3
- package/dist/analysis-core/requests/answer-formats.js +1 -1
- package/dist/analysis-core/requests/local-plan.js +1 -1
- package/dist/analysis-core/requests/planned-limits.js +1 -0
- package/dist/analysis-core/requests/registry.js +1 -1
- package/dist/analysis-core/requests/template-version.js +1 -1
- package/dist/analysis-core/requests/tools.js +1 -1
- package/dist/analysis-core/settings.js +1 -1
- package/dist/analysis-core/stages/engine-entry.js +1 -1
- package/dist/bundle/seal/engine.js +1 -1
- package/dist/cli/analysis-selection.js +133 -0
- package/dist/cli/api.js +1 -1
- package/dist/cli/commands/analyze.js +82 -14
- package/dist/cli/commands/skipped.js +65 -0
- package/dist/cli/completion-delivery.js +63 -0
- package/dist/cli/completion-recovery.js +68 -14
- package/dist/cli/context.js +4 -2
- package/dist/cli/finding-display.js +102 -7
- package/dist/cli/finding-settings.js +3 -1
- package/dist/cli/intake-payload.js +26 -2
- package/dist/cli/main.js +37 -11
- package/dist/cli/mcp-failure.js +6 -5
- package/dist/cli/mcp.js +191 -26
- package/dist/cli/prior-completion.js +35 -0
- package/dist/cli/relay-check.js +260 -110
- package/dist/cli/relay-failure.js +32 -0
- package/dist/cli/relay-preparation.js +72 -21
- package/dist/cli/result-check.js +31 -12
- package/dist/cli/results-upload.js +131 -0
- package/dist/cli/saved-results.js +10 -0
- package/dist/cli/scope-choices.js +57 -0
- package/dist/cli/sign-in.js +2 -2
- package/dist/cli/skipped-files.js +22 -0
- package/dist/cli/summary.js +15 -1
- package/dist/contract/agent-choice.js +25 -2
- package/dist/contract/cli-api-messages.js +3 -0
- package/dist/contract/cli-refusals.js +39 -5
- package/dist/contract/cli-version.js +1 -1
- package/dist/contract/console-url.js +3 -0
- package/dist/contract/console.js +24 -40
- package/dist/contract/engine.js +1 -1
- package/dist/contract/messages.js +4 -3
- package/dist/contract/project-architecture.js +1 -0
- package/dist/contract/scope-choice.js +98 -0
- package/dist/contract/selection-metadata.js +9 -0
- package/dist/contract/selection-offer.js +40 -0
- package/dist/gatekeeper/cli-api.js +70 -4
- package/dist/gatekeeper/console.js +55 -28
- package/dist/gatekeeper/model.js +5 -23
- package/dist/gatekeeper/trust/policy.js +2 -1
- package/package.json +5 -3
- package/dist/analysis-core/analysis/source-notes/types.js +0 -1
- package/dist/analysis-core/chunks/2PSNOSJ2.js +0 -1
- package/dist/analysis-core/chunks/377MLK4M.js +0 -21
- package/dist/analysis-core/chunks/5DGPLXYB.js +0 -1
- package/dist/analysis-core/chunks/6B2HILSY.js +0 -1
- package/dist/analysis-core/chunks/6QY5BV5B.js +0 -14
- package/dist/analysis-core/chunks/6U2IR4XB.js +0 -1
- package/dist/analysis-core/chunks/DLPVYWHZ.js +0 -1
- package/dist/analysis-core/chunks/FOKDE64Y.js +0 -1
- package/dist/analysis-core/chunks/FSLWD2PE.js +0 -1
- package/dist/analysis-core/chunks/K2GNDX3W.js +0 -1
- package/dist/analysis-core/chunks/KTNA2KTN.js +0 -7
- package/dist/analysis-core/chunks/KWECQJ6X.js +0 -1
- package/dist/analysis-core/chunks/NIOS7U6C.js +0 -41
- package/dist/analysis-core/chunks/PECX3OXB.js +0 -1
- package/dist/analysis-core/chunks/PYKAERZZ.js +0 -1
- package/dist/analysis-core/chunks/QFY6A3MS.js +0 -66
- package/dist/analysis-core/chunks/SKVEBOGA.js +0 -1
- package/dist/analysis-core/chunks/STI4JE7L.js +0 -1
- package/dist/analysis-core/chunks/SVMEWGD3.js +0 -1
- package/dist/analysis-core/chunks/X7WZAA7S.js +0 -1
- package/dist/analysis-core/chunks/ZTOVBAG7.js +0 -1
- package/dist/analysis-core/data/finding-types.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as s}from"zod";import{z as t}from"zod";var n=t.string(),l=n.nullable(),R=t.number().int().nonnegative().safe(),F=t.number().int().positive().safe(),z=t.enum(["ordering","reliability","coverage","cost","safety","correctness"]),H=t.enum(["low","medium","high","critical"]),V={headline:n.optional(),ifLeft:n.optional()},_e=t.strictObject({path:n,line:F.nullable()}),G=t.strictObject({nodes:t.array(t.strictObject({id:n,change:n,label:l})),edges:t.array(t.strictObject({from:n,to:n,kind:n,change:n,detail:l}))}),Oe=t.strictObject({sites:t.array(t.strictObject({index:R,role:t.enum(["Says","But also says","Unclear","Context","Requirement","What actually happens","Why it's a gap","Evidence"]),meaning:n,keyPhrase:n})),support:t.enum(["supported","partly","not_supported"]),supportNote:n,counterEvidence:t.array(t.strictObject({repo:n,path:n,line:F,excerpt:n,meaning:n}))}),S=t.strictObject({kind:z,severity:H,title:n,cause:n,summary:l,category:l,question:l,audience:t.enum(["users","team"]).optional(),siteRepo:l,site:_e.nullable(),excerpt:l,otherSites:t.array(t.strictObject({repo:n,path:n,line:F,excerpt:n})),fixes:t.array(t.strictObject({title:n,approach:n,kind:t.enum(["code","prompt"]),targetFiles:t.array(t.strictObject({path:n,create:t.boolean().nullable()})),expectedOutcome:n,summary:l,impact:l,confidence:l,objective:l,status:l,blockedBy:l,alsoFixes:t.array(n).nullable(),delta:G.nullable()})),sourceNotes:Oe.nullable().optional(),...V}),Y=t.strictObject({path:n.optional(),startLine:F,endLine:F}),N=t.number(),X=t.strictObject({subKind:t.enum(["split_monolith","single_source","fold_patches","extract_subagent","merge_subagents","move_rule","move_tool","reorder"]),kind:z,severity:H,title:n,cause:n,summary:n.optional(),evidence:t.array(t.strictObject({path:n,line:F,excerpt:n})),files:t.array(t.strictObject({path:n,action:t.enum(["create","shrink","edit","delete"]),role:t.enum(["system prompt","soul","knowledge","skill","config","tools","mcp","template","reference","log","code"]),unit:n,loadMode:t.enum(["always","on_demand","never"]),loadVia:l,purpose:n,frontmatter:t.strictObject({name:n,description:n,tools:t.array(n)}).nullable()})),segments:t.array(t.strictObject({path:n,startLine:N,endLine:N,to:n,disposition:t.enum(["move","fold_into","remove_duplicate","remove_superseded"]),into:t.strictObject({path:n,line:N}).nullable(),childRef:l,heading:l,reason:n})),additions:t.array(t.strictObject({path:n,text:n,kind:t.enum(["pointer","handoff","reference_update"]),heading:l})),reorder:t.strictObject({path:n,startLine:N,endLine:N,steps:t.array(t.strictObject({from:F,reason:l}))}).nullable(),toolMoves:t.array(t.strictObject({tool:n,fromUnit:n,toUnit:n,reason:n,fromPath:l,toPath:l})),motivation:t.array(t.strictObject({kind:n,reason:n,evidence:n})).optional(),outcomes:t.array(t.strictObject({improvement:n,measurement:n})).optional(),split:t.strictObject({root:n.optional(),frontDoor:t.strictObject({name:n.optional(),job:n,skills:t.array(n)}),subAgents:t.array(t.strictObject({name:n,job:n,description:n,path:n,handoff:n.optional(),resolves:t.array(n).optional(),skills:t.array(t.strictObject({name:n,from:n,to:n})),tools:t.array(n),noTools:t.boolean().optional(),movedKnowledge:t.array(Y),neededKnowledge:t.array(Y)}))}).optional()}),Ce=t.strictObject({nodes:t.array(G.shape.nodes.element.extend({change:t.enum(["added","edited","removed"]),label:l.optional()})),edges:t.array(G.shape.edges.element.extend({kind:t.enum(["invokes","delegates","reads","writes","emits"]),change:t.enum(["added","edited","removed"]),detail:l.optional()})),files:t.array(t.strictObject({path:n,role:X.shape.files.element.shape.role,node:n,change:t.enum(["added","removed","moved","shrunk","grown","reordered"]),fromNode:n.optional(),fromPath:n.optional(),segments:R})),tools:t.array(t.strictObject({label:n,fromNode:n,toNode:n}))}),L=t.strictObject({repo:n,children:t.array(t.strictObject({ref:n,how:n})),sourceHashes:t.record(n,n),body:X,delta:Ce,...V}),P=t.enum(["secret","secret-content","hidden","excluded","wrong-type","too-large","empty","out-of-scope","allowance","total","scan-limit","tool-limit","missing","unreadable"]),k=t.enum([...P.options,"coding-guide","duplicate"]),me=t.strictObject({fromProposal:R,fromRulesOnly:R,rejected:R,rejectedByReason:t.partialRecord(k,R)}),fe=t.strictObject({repoKey:n,findings:t.array(S),structures:t.array(L),warnings:t.array(n),proposalCounts:me.optional(),refusedFiles:t.array(t.strictObject({path:n,reason:P}))});function W(e){return{nodes:e.nodes.map(({id:o,change:r,label:i})=>({id:o,change:r,...i===void 0?{}:{label:i}})),edges:e.edges.map(({from:o,to:r,kind:i,change:c,detail:a})=>({from:o,to:r,kind:i,change:c,...a===void 0?{}:{detail:a}}))}}function $(e,o=r=>r){let{kind:r,severity:i,title:c,cause:a,summary:u,category:d,question:E,excerpt:f}=e;return{kind:r,severity:i,title:c,cause:a,summary:u,category:d,question:E,excerpt:f,siteRepo:o(e.siteRepo),site:e.site&&{path:e.site.path,line:e.site.line},otherSites:e.otherSites.map(({repo:C,path:y,line:I,excerpt:b})=>({repo:o(C),path:y,line:I,excerpt:b})),fixes:e.fixes.map(({title:C,approach:y,kind:I,targetFiles:b,expectedOutcome:M,summary:oe,impact:ie,confidence:ae,objective:ce,status:le,blockedBy:de,alsoFixes:B,delta:q})=>({title:C,approach:y,kind:I,targetFiles:b.map(({path:ue,create:pe})=>({path:ue,create:pe})),expectedOutcome:M,summary:oe,impact:ie,confidence:ae,objective:ce,status:le,blockedBy:de,alsoFixes:B&&B.slice(),delta:q&&W(q)})),...e.sourceNotes===void 0?{}:{sourceNotes:e.sourceNotes&&{sites:e.sourceNotes.sites.map(({index:C,role:y,meaning:I,keyPhrase:b})=>({index:C,role:y,meaning:I,keyPhrase:b})),support:e.sourceNotes.support,supportNote:e.sourceNotes.supportNote,counterEvidence:e.sourceNotes.counterEvidence.map(({repo:C,path:y,line:I,excerpt:b,meaning:M})=>({repo:o(C),path:y,line:I,excerpt:b,meaning:M}))}}}}function Q(e){return{...e.headline===void 0?{}:{headline:e.headline},...e.ifLeft===void 0?{}:{ifLeft:e.ifLeft}}}function Ee(e){let o=e.body;return{repo:e.repo,children:e.children.map(({ref:r,how:i})=>({ref:r,how:i})),sourceHashes:Object.fromEntries(Object.entries(e.sourceHashes)),body:{subKind:o.subKind,kind:o.kind,severity:o.severity,title:o.title,cause:o.cause,...o.summary===void 0?{}:{summary:o.summary},evidence:o.evidence.map(({path:r,line:i,excerpt:c})=>({path:r,line:i,excerpt:c})),files:o.files.map(({path:r,action:i,role:c,unit:a,loadMode:u,loadVia:d,purpose:E,frontmatter:f})=>({path:r,action:i,role:c,unit:a,loadMode:u,loadVia:d,purpose:E,frontmatter:f&&{name:f.name,description:f.description,tools:f.tools.slice()}})),segments:o.segments.map(({path:r,startLine:i,endLine:c,to:a,disposition:u,into:d,childRef:E,heading:f,reason:C})=>({path:r,startLine:i,endLine:c,to:a,disposition:u,into:d&&{path:d.path,line:d.line},childRef:E,heading:f,reason:C})),additions:o.additions.map(({path:r,text:i,kind:c,heading:a})=>({path:r,text:i,kind:c,heading:a})),reorder:o.reorder&&{path:o.reorder.path,startLine:o.reorder.startLine,endLine:o.reorder.endLine,steps:o.reorder.steps.map(({from:r,reason:i})=>({from:r,reason:i}))},toolMoves:o.toolMoves.map(({tool:r,fromUnit:i,toUnit:c,reason:a,fromPath:u,toPath:d})=>({tool:r,fromUnit:i,toUnit:c,reason:a,fromPath:u,toPath:d})),...o.motivation===void 0?{}:{motivation:o.motivation.map(({kind:r,reason:i,evidence:c})=>({kind:r,reason:i,evidence:c}))},...o.outcomes===void 0?{}:{outcomes:o.outcomes.map(({improvement:r,measurement:i})=>({improvement:r,measurement:i}))},...o.split===void 0?{}:{split:{...o.split.root===void 0?{}:{root:o.split.root},frontDoor:{...o.split.frontDoor.name===void 0?{}:{name:o.split.frontDoor.name},job:o.split.frontDoor.job,skills:o.split.frontDoor.skills.slice()},subAgents:o.split.subAgents.map(r=>({name:r.name,job:r.job,description:r.description,path:r.path,...r.handoff===void 0?{}:{handoff:r.handoff},...r.resolves===void 0?{}:{resolves:r.resolves.slice()},skills:r.skills.map(({name:i,from:c,to:a})=>({name:i,from:c,to:a})),tools:r.tools.slice(),...r.noTools===void 0?{}:{noTools:r.noTools},movedKnowledge:r.movedKnowledge.map(Z),neededKnowledge:r.neededKnowledge.map(Z)}))}}},delta:{...W(e.delta),files:e.delta.files.map(({path:r,role:i,node:c,change:a,fromNode:u,fromPath:d,segments:E})=>({path:r,role:i,node:c,change:a,segments:E,...u===void 0?{}:{fromNode:u},...d===void 0?{}:{fromPath:d}})),tools:e.delta.tools.map(({label:r,fromNode:i,toNode:c})=>({label:r,fromNode:i,toNode:c}))},...Q(e)}}function Z({path:e,startLine:o,endLine:r}){return{...e===void 0?{}:{path:e},startLine:o,endLine:r}}function ye(e,o){return{repoKey:e.repoKey,findings:e.findings.map(r=>({...$(r),...Q(r),...r.audience===void 0?{}:{audience:r.audience}})),structures:e.structures.map(Ee),warnings:e.warnings.slice(),...e.proposalCounts?{proposalCounts:{fromProposal:e.proposalCounts.fromProposal,fromRulesOnly:e.proposalCounts.fromRulesOnly,rejected:e.proposalCounts.rejected,rejectedByReason:Object.fromEntries(k.options.filter(r=>e.proposalCounts.rejectedByReason[r]!==void 0).map(r=>[r,e.proposalCounts.rejectedByReason[r]]))}}:{},refusedFiles:o.map(({path:r,reason:i})=>({path:r,reason:i}))}}function Ie(e){if(e.redacted)throw new Error("Relay refused the request: leak_refused");return e.answer}import{z as A}from"zod";var g=1,J=A.string().min(1).max(128),U=["file_reads","repository_listing","sealed_delivery"],be=A.strictObject({protocol:A.literal(g),bundleVersion:J,engineVersion:J,capabilities:A.array(A.enum(U)).refine(e=>e.length===U.length&&new Set(e).size===U.length)});var te=Object.freeze(["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_IMPORT_GUIDES_AS_PROMPT","CF_CONFIGURATION_GUIDE_PROMPT","CF_CHOOSE_AGENT","CF_IMPORT_PROPOSAL","CF_LOCAL_COMMITTED_ONLY","CF_LOCAL_GITIGNORE_OUTPUT","CF_REFUSE_TOO_LARGE","CF_FINDING_AUDIENCE","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"]),w=te.filter(e=>e!=="CF_RESULT_SAFETY_CHECK"&&e!=="CF_LOCAL_COMMITTED_ONLY"&&e!=="CF_LOCAL_GITIGNORE_OUTPUT"),ne=w.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");function qe(e,o="request"){return Object.freeze(Object.fromEntries((o==="saved"?te:o==="engine"?w:ne).filter(i=>Object.hasOwn(e,i)&&e[i]!==void 0).map(i=>[i,e[i]])))}var Ye=s.partialRecord(s.enum(ne),s.string()),Fe=s.partialRecord(s.enum(w),s.string()),T=Object.freeze({findings:2e4,textBytes:4096,quoteBytes:2e3,freeTextBytesPerFinding:16*1024}),ze=T.freeTextBytesPerFinding*T.findings;function se(e){return typeof e=="string"?!e.includes("\0")&&!/[\uD800-\uDFFF]/u.test(e):e===null||typeof e!="object"||Object.values(e).every(se)}var Re=S.superRefine((e,o)=>{let r=0;function i(c,a){if(typeof c=="string"){let u=a.at(-1)==="excerpt"||a.at(-1)==="keyPhrase",d=new TextEncoder().encode(c).byteLength;u||(r+=d),(d>(u?T.quoteBytes:T.textBytes)||!se(c))&&o.addIssue({code:"custom",path:a,message:"Invalid result text"})}else Array.isArray(c)?c.forEach((u,d)=>i(u,[...a,d])):c!==null&&typeof c=="object"&&Object.entries(c).forEach(([u,d])=>i(d,[...a,u]))}i(e,[]),r>T.freeTextBytesPerFinding&&o.addIssue({code:"custom",message:"Result text exceeds the finding budget"})}),He=s.array(Re).max(T.findings),O=s.string(),p=s.number().int().nonnegative().safe(),h=s.number().int().positive().safe(),v=s.enum(["bad_request","unavailable","reservation","leak_refused","cancelled"]);function Xe(e){let o=v.safeParse(e);return o.success?o.data:"unavailable"}function Ze(e){return Object.assign(new Error(e),{code:e})}var Te=1024*1024,ee=O.min(1).max(128),j=O.regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/),D=O.regex(/^[a-f0-9]{64}$/),_={protocol:s.literal(g),analysisId:s.uuid(),nonce:O.min(16).max(256),bundleVersion:ee,engineVersion:ee};function m(e){return s.unknown().refine(o=>{try{let r=JSON.stringify(o);return typeof r=="string"&&new TextEncoder().encode(r).byteLength<=Te}catch{return!1}}).pipe(e)}var Ne=O.min(1).refine(e=>!/[\\\0\r\n]/.test(e)&&!/^(?:\/|[a-zA-Z]:)/.test(e)&&e.split("/").every(o=>o!==""&&o!=="."&&o!=="..")),Se=s.strictObject({id:j,path:Ne,size:p,hash:D}),K=s.array(Se).refine(e=>new Set(e.map(o=>o.id)).size===e.length&&new Set(e.map(o=>o.path)).size===e.length),re=s.strictObject({snapshot:D,commit:O.regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/),files:K,entriesVisited:p.optional(),truncated:s.boolean().optional(),complete:s.boolean(),cursor:O.min(1).max(256).optional()}).refine(e=>e.complete?e.cursor===void 0:e.cursor!==void 0),We=m(s.strictObject({..._,settings:Fe,manifest:re})),$e=s.strictObject(_),Ae=s.strictObject({startByte:p,endByte:p}).refine(e=>e.endByte>e.startByte),he=s.strictObject({startLine:h,endLine:h}).refine(e=>e.endLine>=e.startLine),Le=m(s.strictObject({..._,type:s.literal("need_files"),sequence:p,reads:s.array(s.strictObject({id:j,range:s.union([Ae,he])})).min(1)})),Pe=m(s.strictObject({..._,type:s.literal("need_listing"),sequence:p,cursor:O.min(1).max(256).nullable()})),Qe=m(s.discriminatedUnion("type",[s.strictObject({..._,type:s.literal("files"),sequence:p,files:s.array(s.union([s.strictObject({id:j,startByte:p,text:O,complete:s.boolean(),hash:D}),s.strictObject({id:j,refused:P})])).min(1)}),s.strictObject({..._,type:s.literal("listing"),sequence:p,manifest:re}),s.strictObject({..._,type:s.literal("reservation"),sequence:p,reservationId:s.uuid(),reservationToken:O.min(1).max(256)}),s.strictObject({..._,type:s.literal("delivery"),sequence:p,callId:s.uuid(),attemptId:s.uuid().nullable()}),s.strictObject({..._,type:s.literal("chunk"),sequence:p,callId:s.uuid(),attemptId:s.uuid(),chunk:h})])),x={chunk:p,chunks:h},ge=s.strictObject({..._,type:s.literal("result"),finalFiles:K,findings:s.array(S),structures:s.array(L),notices:s.array(O)}),je=m(ge.extend(x).refine(e=>e.chunk<e.chunks)),xe=m(s.strictObject({..._,type:s.literal("result_chunk"),...x,text:O,hash:D}).refine(e=>e.chunk<e.chunks)),De=m(s.strictObject({..._,type:s.literal("call_failed"),sequence:p,callId:s.uuid(),attemptId:s.uuid().nullable(),code:v}));function Je(e){let o=m(s.strictObject({..._,type:s.literal("plan"),sequence:p,...x,plan:e.plan,finalFiles:K}).refine(a=>a.chunk<a.chunks)),r=O.regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/).min(1).refine(a=>!/\s/.test(a)),i=m(s.strictObject({..._,type:s.literal("sealed_delivery"),sequence:p,callId:s.uuid(),attemptId:s.uuid(),algorithm:s.literal("AES-256-GCM"),iv:r.length(16),...x,ciphertext:r,tag:O.regex(/^[A-Za-z0-9+/]{21}[AQgw]==$/).length(24).optional(),delivery:s.strictObject({confirmation:e.deliveryConfirmation,deadlineMs:h}).optional()}).refine(a=>a.chunk<a.chunks&&(a.chunk===a.chunks-1?a.tag!==void 0&&a.delivery!==void 0&&a.delivery.confirmation.callId===a.callId&&a.delivery.confirmation.attemptId===a.attemptId:a.tag===void 0&&a.delivery===void 0))),c=s.strictObject({..._,type:s.literal("refused"),code:v});return{plan:o,sealedDelivery:i,response:s.union([Le,Pe,o,i,De,je,xe,c])}}export{S as a,L as b,fe as c,$ as d,ye as e,Ie as f,g,be as h,te as i,qe as j,Ye as k,Fe as l,T as m,ze as n,se as o,Re as p,He as q,v as r,Xe as s,Ze as t,Te as u,Se as v,re as w,We as x,$e as y,Le as z,Pe as A,Qe as B,ge as C,je as D,xe as E,De as F,Je as G};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./X7WZAA7S.js";function r(e){return e.CF_FINDING_HEADLINES==="1"}function o(e){return e.CF_RESULT_SAFETY_CHECK==="1"}function i(e){return e.CF_IMPORT_OUTSIDE_LOADERS==="1"}function E(e){return e.CF_PROMPT_AGREE==="1"}function u(e){return n(e,"saved")}export{r as a,o as b,i as c,E as d,u as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g}from"../chunks/SKVEBOGA.js";export{b as findingAudienceSchema,c as fixConfidenceSchema,d as fixDeltaChangeSchema,e as fixDeltaEdgeKindSchema,f as fixDeltaSchema,g as fixFactsSchema,a as fixStatusSchema};
|