workspai 0.55.1 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -8
- package/contracts/adopt-effects.v1.json +72 -0
- package/contracts/artifact-remediation-plan.v1.json +110 -2
- package/contracts/cli-runtime-command-inventory.v1.snapshot.json +33 -1
- package/contracts/doctor-project-evidence.v1.json +95 -2
- package/contracts/doctor-remediation-plan.v1.json +29 -2
- package/contracts/doctor-workspace-evidence.v1.json +97 -2
- package/contracts/extension-cli-compatibility.v1.json +7 -1
- package/contracts/published-contract-catalog.v1.json +30 -0
- package/contracts/runtime-command-surface.v1.json +63 -0
- package/contracts/workspace-intelligence/doctor-capabilities.v1.json +133 -0
- package/contracts/workspace-intelligence/doctor-diagnosis.v1.json +273 -0
- package/contracts/workspace-intelligence/doctor-graph-diagnosis.v1.json +3 -0
- package/contracts/workspace-intelligence/doctor-receipt.v1.json +136 -0
- package/contracts/workspace-intelligence/doctor-summary.v1.json +101 -0
- package/contracts/workspace-intelligence/doctor-validation.v1.json +109 -0
- package/contracts/workspace-intelligence/project-context-agent.v1.json +110 -0
- package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +25 -0
- package/contracts/workspace-intelligence/workspace-knowledge-graph.v1.json +36 -0
- package/contracts/workspace-intelligence/workspace-knowledge-search.v1.json +54 -0
- package/dist/analyze-HJ774J3E.js +1 -0
- package/dist/{artifact-remediation-plan-O3YIULQN.js → artifact-remediation-plan-BPLON5VX.js} +1 -1
- package/dist/autopilot-release-WIFFFQKW.js +1 -0
- package/dist/capabilities-command-44JVOE5S.js +1 -0
- package/dist/chunk-2647BYBC.js +1 -0
- package/dist/chunk-3U4VLIGW.js +1 -0
- package/dist/chunk-5EPPPMAS.js +1 -0
- package/dist/{chunk-AMB42V2F.js → chunk-64JUYYRC.js} +1 -1
- package/dist/chunk-6OFGLNFS.js +1 -0
- package/dist/chunk-75HOCFNH.js +1 -0
- package/dist/{chunk-M5ICGR55.js → chunk-7WUT5ZSO.js} +1 -1
- package/dist/chunk-AA4PNQKR.js +1 -0
- package/dist/{chunk-WIO6L24E.js → chunk-ADL3CK44.js} +1 -1
- package/dist/chunk-AO2ZI42U.js +4 -0
- package/dist/chunk-CNWUIXF3.js +1 -0
- package/dist/chunk-D4RST2HE.js +1 -0
- package/dist/chunk-DF4NWPB7.js +8 -0
- package/dist/chunk-DT4X7I5M.js +81 -0
- package/dist/{chunk-HY3RMPW5.js → chunk-E53BGUOW.js} +1 -1
- package/dist/chunk-GBMCHFOV.js +1 -0
- package/dist/chunk-GDKFN3CM.js +8 -0
- package/dist/chunk-GTJY55QK.js +5 -0
- package/dist/chunk-GXTCU4WF.js +1 -0
- package/dist/{chunk-WSAFBPS5.js → chunk-IUYZ3NHS.js} +4 -4
- package/dist/chunk-IXOLHPTN.js +6 -0
- package/dist/chunk-IZLEMTES.js +1 -0
- package/dist/chunk-L36ZASME.js +1 -0
- package/dist/chunk-LYVDRRDO.js +2 -0
- package/dist/chunk-N2BIIUDH.js +4 -0
- package/dist/{chunk-IBPPMOHM.js → chunk-NHTLE3WN.js} +1 -1
- package/dist/chunk-NS53IPAC.js +1 -0
- package/dist/{chunk-NWQ5VWUW.js → chunk-P475BOJW.js} +1 -1
- package/dist/chunk-PKIRVQLG.js +1 -0
- package/dist/chunk-QHY6F4SS.js +2 -0
- package/dist/chunk-QK5QOXOE.js +13 -0
- package/dist/chunk-RPHM7LQW.js +36 -0
- package/dist/chunk-SNO3WG4V.js +2 -0
- package/dist/chunk-T5YRFRJV.js +1 -0
- package/dist/chunk-TTFQWH55.js +91 -0
- package/dist/chunk-UQEQ6CXU.js +1 -0
- package/dist/chunk-V5EYVQ63.js +1 -0
- package/dist/{chunk-HUPLAFZQ.js → chunk-VL3APTVB.js} +1 -1
- package/dist/chunk-VUR7H2FU.js +2 -0
- package/dist/chunk-VZPWIILU.js +1 -0
- package/dist/{chunk-MRFN5ZQP.js → chunk-W5ZFXKSL.js} +1 -1
- package/dist/chunk-WP3CXMVA.js +2 -0
- package/dist/chunk-X7FYEKLI.js +1 -0
- package/dist/{chunk-KFKZOPZC.js → chunk-XMTLKDPP.js} +1 -1
- package/dist/chunk-YJTEMJFV.js +3 -0
- package/dist/chunk-YM77FQB3.js +8 -0
- package/dist/{chunk-FZCYTRBQ.js → chunk-Z57G62KE.js} +1 -1
- package/dist/chunk-ZCPT6KC3.js +6 -0
- package/dist/chunk-ZPA6ECBJ.js +7 -0
- package/dist/{create-3NSOY7CA.js → create-O2KLTN5H.js} +1 -1
- package/dist/doctor-AL5YWO5X.js +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +169 -167
- package/dist/pipeline-4ST4BQWY.js +5 -0
- package/dist/{project-intelligence-lens-ZOAWXYC5.js → project-intelligence-lens-JHYECYOK.js} +1 -1
- package/dist/project-test-coverage-FRMVYTFB.js +1 -0
- package/dist/verified-goal-KFNRGOKT.js +1 -0
- package/dist/{workspace-C4UETGY7.js → workspace-O4E5CCGK.js} +1 -1
- package/dist/{workspace-agent-sync-446AXPHJ.js → workspace-agent-sync-N5DPGU2E.js} +1 -1
- package/dist/{workspace-archive-VHUPOBAV.js → workspace-archive-BA3ONVXX.js} +1 -1
- package/dist/{workspace-context-XSECHC7O.js → workspace-context-ETZNEHOJ.js} +1 -1
- package/dist/workspace-contract-OSI7NBXS.js +1 -0
- package/dist/workspace-explain-EM7IUV6L.js +1 -0
- package/dist/workspace-explain-contract-KVQO57RC.js +1 -0
- package/dist/{workspace-feedback-WXE7NVMV.js → workspace-feedback-PCZKXG5R.js} +1 -1
- package/dist/{workspace-foundation-3EVAQ5X6.js → workspace-foundation-QQHX66KE.js} +1 -1
- package/dist/{workspace-graph-stream-AJPS45FD.js → workspace-graph-stream-UZJQ75XZ.js} +1 -1
- package/dist/workspace-graph-token-efficiency-TF23UYEF.js +1 -0
- package/dist/{workspace-history-YY7YRDOH.js → workspace-history-CHJOABME.js} +1 -1
- package/dist/{workspace-intelligence-FWRB47EJ.js → workspace-intelligence-A7O7MN6T.js} +1 -1
- package/dist/workspace-intelligence-evaluation-YMY3C5AW.js +1 -0
- package/dist/{workspace-intelligence-runner-SMEAB4CO.js → workspace-intelligence-runner-4EF66L66.js} +1 -1
- package/dist/workspace-intelligence-runtime-registry-NCVHKCMP.js +1 -0
- package/dist/workspace-knowledge-graph-BVN4NTJ6.js +1 -0
- package/dist/{workspace-knowledge-graph-query-EKHIE3E2.js → workspace-knowledge-graph-query-6DAOXGGT.js} +1 -1
- package/dist/workspace-knowledge-graph-snapshot-XSQADCNR.js +1 -0
- package/dist/workspace-mcp-serve-TKX4J3SX.js +3 -0
- package/dist/{workspace-model-MNJOGBPP.js → workspace-model-7ESEP366.js} +1 -1
- package/dist/{workspace-onboarding-5KO7Z7AD.js → workspace-onboarding-SY255V7L.js} +1 -1
- package/dist/{workspace-readme-4S6PJ74A.js → workspace-readme-IVJXSIBS.js} +1 -1
- package/dist/{workspace-registry-summary-GPJEL7K7.js → workspace-registry-summary-7ISKYEPM.js} +1 -1
- package/dist/workspace-repair-engine-GMA2YTCF.js +3 -0
- package/dist/workspace-run-ZZXVNFUS.js +1 -0
- package/dist/{workspace-verify-C6HWHRLJ.js → workspace-verify-CNXZPWS5.js} +1 -1
- package/dist/{workspace-watch-DLPHLF5R.js → workspace-watch-HGFL2EU3.js} +1 -1
- package/docs/From Code to Shared Understanding-B.png +0 -0
- package/docs/From Code to Shared Understanding.png +0 -0
- package/docs/README_CONTENT_CONTRACT.md +25 -12
- package/docs/ci-workflows.md +9 -1
- package/docs/commands-reference.md +36 -7
- package/docs/contracts/ARTIFACT_CATALOG.md +6 -1
- package/docs/contracts/README.md +21 -12
- package/docs/doctor-command.md +189 -14
- package/docs/from-code-to-shared-understanding.md +22 -17
- package/docs/graph-benchmark-methodology.md +13 -0
- package/docs/real-world-qualification.md +73 -0
- package/docs/workspace-intelligence-runner.md +4 -0
- package/docs/workspace-knowledge-graph.md +77 -7
- package/docs/workspace-operations.md +14 -2
- package/docs/workspace-run.md +30 -7
- package/package.json +14 -3
- package/dist/analyze-AAZEJ4FC.js +0 -1
- package/dist/autopilot-release-3H5FTF6H.js +0 -1
- package/dist/chunk-2PY65U6X.js +0 -5
- package/dist/chunk-3DONU3DU.js +0 -1
- package/dist/chunk-44VJHNZB.js +0 -1
- package/dist/chunk-5XDPQ3CB.js +0 -1
- package/dist/chunk-6HJJHEL6.js +0 -2
- package/dist/chunk-7AR5PDLD.js +0 -1
- package/dist/chunk-7KKP7RNB.js +0 -3
- package/dist/chunk-7S4QNH5A.js +0 -5
- package/dist/chunk-7T4TSV5C.js +0 -1
- package/dist/chunk-BYVTHIC3.js +0 -2
- package/dist/chunk-CEIJIFY7.js +0 -88
- package/dist/chunk-D37NEYV6.js +0 -1
- package/dist/chunk-DPMO4U3Z.js +0 -8
- package/dist/chunk-DS4UYMLX.js +0 -1
- package/dist/chunk-FQLB4BIC.js +0 -7
- package/dist/chunk-GDU7VP6G.js +0 -1
- package/dist/chunk-H7P7SSUW.js +0 -75
- package/dist/chunk-KVUYAYTY.js +0 -8
- package/dist/chunk-MQ73VS4E.js +0 -2
- package/dist/chunk-NYHVCFBT.js +0 -1
- package/dist/chunk-OUBBBC7T.js +0 -36
- package/dist/chunk-P7K5RHJC.js +0 -2
- package/dist/chunk-PS5F4DCT.js +0 -1
- package/dist/chunk-QZ7PNMVP.js +0 -1
- package/dist/chunk-RA24WQLF.js +0 -1
- package/dist/chunk-RMXXK64P.js +0 -4
- package/dist/chunk-S7Z4DP3P.js +0 -2
- package/dist/chunk-SJLUE6AY.js +0 -1
- package/dist/chunk-TEHQ7XKK.js +0 -3
- package/dist/chunk-UFOCUHG3.js +0 -1
- package/dist/chunk-WD2XDMGB.js +0 -1
- package/dist/chunk-XVRJVKOX.js +0 -1
- package/dist/chunk-YTLUT6IA.js +0 -13
- package/dist/doctor-UEFFNAUD.js +0 -1
- package/dist/pipeline-B5S6P36F.js +0 -5
- package/dist/project-test-coverage-44ZPCOPV.js +0 -1
- package/dist/verified-goal-KOU3WJYN.js +0 -1
- package/dist/workspace-contract-AYFTZIKM.js +0 -1
- package/dist/workspace-explain-ZEWVKDBF.js +0 -1
- package/dist/workspace-explain-contract-6CCC26QT.js +0 -1
- package/dist/workspace-graph-token-efficiency-5FNH4JZ5.js +0 -1
- package/dist/workspace-intelligence-evaluation-UP2K3L35.js +0 -1
- package/dist/workspace-intelligence-runtime-registry-MRSF7RTT.js +0 -1
- package/dist/workspace-knowledge-graph-BMMM2FUE.js +0 -1
- package/dist/workspace-mcp-serve-X6C3AWTA.js +0 -3
- package/dist/workspace-repair-engine-GWTXVVKB.js +0 -3
- package/dist/workspace-run-FJTBX4JQ.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {e,p,i,f as f$1,g}from'./chunk-5EPPPMAS.js';var l="workspai-workspace-intelligence-chain-v1",u="contracts/workspace-intelligence-chain.v1.json";function f(){let e$1=e,t=p,n=[{id:"model",ordinal:1,phase:"understand",label:"Model",command:[...t.model.command],consumes:["workspace markers","project metadata","registry","contract","policies"],inputRefs:["projects-repositories","runtime-dependencies","workspace-rules","existing-evidence"],consumesArtifacts:[],produces:[...t.model.produces],dependsOn:[],exitPolicy:"stop-on-error",purpose:"Build the canonical current model and its structurally bound, derived Knowledge Graph."},{id:"diff",ordinal:2,phase:"change",label:"Diff",command:[...t.diff.command],consumes:[e$1.model,e$1.snapshot],inputRefs:["changes","model-baseline"],consumesArtifacts:[e$1.model,e$1.snapshot],produces:[...t.diff.produces],dependsOn:["model"],exitPolicy:"stop-on-error",purpose:"Describe structural change against the selected baseline."},{id:"impact",ordinal:3,phase:"change",label:"Impact",command:[...t.impact.command],consumes:[e$1.model,e$1.diff],inputRefs:[],consumesArtifacts:[e$1.model,e$1.diff],produces:[...t.impact.produces],dependsOn:["diff"],exitPolicy:"stop-on-error",purpose:"Calculate transitive blast radius over the workspace graph."},{id:"doctor-evidence",ordinal:4,phase:"evidence",label:"Doctor Evidence",command:[...t["doctor-evidence"].command],consumes:["workspace runtime and project health signals"],inputRefs:["projects-repositories","runtime-dependencies","existing-evidence"],consumesArtifacts:[],produces:[...t["doctor-evidence"].produces],dependsOn:["impact"],exitPolicy:"continue-on-structured-verdict",purpose:"Refresh health evidence after the impact artifact exists."},{id:"contract-evidence",ordinal:5,phase:"evidence",label:"Contract Evidence",command:[...t["contract-evidence"].command],consumes:[i.workspaceContract],inputRefs:["workspace-rules"],consumesArtifacts:[],produces:[...t["contract-evidence"].produces],dependsOn:["impact"],exitPolicy:"continue-on-structured-verdict",purpose:"Refresh structural contract evidence without hiding failed verdicts."},{id:"analyze-evidence",ordinal:6,phase:"evidence",label:"Analyze Evidence",command:[...t["analyze-evidence"].command],consumes:[e$1.model,"workspace runtime and dependency signals"],inputRefs:["projects-repositories","runtime-dependencies","workspace-rules"],consumesArtifacts:[e$1.model],produces:[...t["analyze-evidence"].produces],dependsOn:["impact"],exitPolicy:"continue-on-structured-verdict",purpose:"Refresh analysis evidence required by the release-readiness gate."},{id:"readiness-evidence",ordinal:7,phase:"evidence",label:"Readiness Evidence",command:[...t["readiness-evidence"].command],consumes:["doctor, analysis, runtime, and release signals"],inputRefs:["runtime-dependencies","existing-evidence"],consumesArtifacts:[e$1.doctor,e$1.contractVerify,e$1.analyze],produces:[...t["readiness-evidence"].produces],dependsOn:["doctor-evidence","contract-evidence","analyze-evidence"],exitPolicy:"continue-on-structured-verdict",purpose:"Refresh release-readiness evidence before the definitive gate."},{id:"verify",ordinal:8,phase:"gate",label:"Verify",command:[...t.verify.command],consumes:[e$1.impact,e$1.doctor,e$1.contractVerify,e$1.readiness],inputRefs:[],consumesArtifacts:[e$1.impact,e$1.doctor,e$1.contractVerify,e$1.readiness],produces:[...t.verify.produces],dependsOn:["impact","doctor-evidence","contract-evidence","analyze-evidence","readiness-evidence"],exitPolicy:"continue-on-structured-verdict",purpose:"Emit the definitive evidence-backed workspace gate."},{id:"context",ordinal:9,phase:"ground",label:"Agent Context",command:[...t.context.command],consumes:[e$1.model,e$1.impact,e$1.verify],inputRefs:[],consumesArtifacts:[e$1.model,e$1.impact,e$1.verify],produces:[...t.context.produces],dependsOn:["verify"],exitPolicy:"stop-on-error",purpose:"Build compact agent context from the same verified evidence."},{id:"agent-sync",ordinal:10,phase:"distribute",label:"Agent Grounding",command:[...t["agent-sync"].command],consumerArgs:{vscode:["--target","vscode"]},consumes:[e$1.agentContext],inputRefs:[],consumesArtifacts:[e$1.agentContext],produces:[...t["agent-sync"].produces],dependsOn:["context"],exitPolicy:"stop-on-error",purpose:"Distribute one context into portable agent and IDE surfaces."},{id:"explain",ordinal:11,phase:"explain",label:"Explain",command:[...t.explain.command],consumes:[e$1.verify,e$1.impact],inputRefs:[],consumesArtifacts:[e$1.verify,e$1.impact],produces:[...t.explain.produces],dependsOn:["verify"],exitPolicy:"continue-on-structured-verdict",purpose:"Translate evidence and blockers into a human and agent-readable narrative."}];return {schemaVersion:l,name:"Workspace Intelligence Chain",contractPath:u,invariant:"Every consumer must preserve step identity, dependencies, artifact flow, and verdict semantics; presentation may change, chain meaning may not.",invariants:["Missing or unreadable input is unknown or unavailable; it must not be presented as verified absence.","Freshness and provenance travel with evidence and must not be discarded by projections.","The current graph is an evidence-backed workspace knowledge graph with bounded source intelligence, not a complete cross-language symbol or call graph.","Simple and standard presentations summarize the contract; their contractRefs must preserve complete traceability.","Conditional provider outputs must be resolved through their dedicated inventory contract.","Auxiliary capabilities expose or refresh intelligence but are not mandatory execution-chain steps.","Canonical step commands are stage-pure: they must not implicitly execute a downstream chain step or regenerate an upstream artifact.","Canonical JSON artifacts must satisfy their registered schema both when produced and when consumed across CLI, MCP, IDE, and CI trust boundaries.","Schema validity is necessary but not sufficient: hashes, embedded models, summaries, counts, graph statistics, and artifact references must remain semantically coherent.","Persisted impact evidence must be rejected as stale when the current workspace model or Git observation no longer matches its embedded diff.","Canonical artifact replacement must be atomic and workspace-contained; an interrupted or denied write must preserve the last valid artifact.","Concurrent history updates must be serialized without silently dropping entries, and invalid history must never be overwritten as if it were absent.","The canonical global registry is ~/.workspai/workspaces.json; ~/.rapidkit/workspaces.json is a non-authoritative compatibility mirror for legacy consumers and must not diverge after a CLI registry mutation."],semantics:{workspace:"The governed operating boundary that relates one or more projects and repositories to shared metadata, policies, contracts, evidence, and consumers.",repository:"A source-control boundary that may contain one or more projects and may live inside or outside the workspace root.",project:"A discoverable build or runtime unit with its own path, metadata or observable manifests, command capabilities, and evidence.",evidence:"A sourced observation or generated verification result with provenance and freshness; evidence may be consumed by a later run.",artifact:"A durable generated file that another command or consumer can read without parsing terminal prose.",gate:"A structured verdict with reasons and exit semantics derived from current evidence."},workspaceLifecycle:{ingestionRoutes:[{id:"create",label:"Create",commands:["create workspace","create project"],result:"Create a workspace or supported project and write canonical Workspai metadata."},{id:"adopt",label:"Adopt",commands:["adopt"],result:"Register an existing project in place without requiring source relocation."},{id:"import",label:"Import",commands:["import","workspace import"],result:"Attach an existing project or repository path to the workspace inventory."}],durableState:[{id:"workspace-identity",paths:[".workspai-workspace",".workspai/workspace.json"],purpose:"Identify the workspace boundary, profile, and canonical root."},{id:"project-inventory",paths:[".workspai/project.json",".workspai/context.json",".workspai/adopt.json","~/.workspai/workspaces.json","~/.rapidkit/workspaces.json (legacy compatibility mirror)"],purpose:"Record native, adopted, imported, and globally registered project locations while preserving a non-authoritative mirror for legacy extension discovery."},{id:"governance",paths:[".workspai/policies.yml",i.workspaceContract],purpose:"Define workspace policy and explicit structural relationships."},{id:"graph-overrides",paths:[".workspai/workspace-graph.overrides.json"],purpose:"Provide explicit dependency edges that override inferred relationships."}],rule:"Create, adopt, and import are ingestion routes, not intelligence facts. Their durable state becomes observable input to Model."},runtimeRegistry:{authority:"contracts/workspace-intelligence-runtime-registry.ts",artifacts:Object.entries(e).map(([r,s])=>({id:r,path:s,schemaVersion:f$1[r],schemaContract:g[r]}))},executionEnvelope:{rule:"Sync and baseline resolution are deterministic execution prerequisites, not canonical intelligence stages; every run reports them separately and preserves the exact canonical stage sequence.",operations:[{id:"sync",executionPoint:"before:model",artifacts:[i.workspaceContract,i.workspaceRegistry],failurePolicy:"stop-and-report",purpose:"Reconcile portable workspace inventory and contract inputs before modeling."},{id:"baseline",executionPoint:"after:model-before:diff",artifacts:[e$1.snapshot],failurePolicy:"stop-and-report",purpose:"Create an initial structural baseline when absent or reuse the existing baseline before Diff."}],report:{artifact:e$1.intelligenceRun,schemaVersion:f$1.intelligenceRun,invariant:"The report must preserve exact preflight and stage order, registry-owned artifacts, failure propagation, and aggregate status/exit semantics."}},boundaries:{inputs:[{id:"projects-repositories",label:"Projects and repositories",sources:["projects","repositories","services","modules","imported paths"],entersAt:"model"},{id:"runtime-dependencies",label:"Runtime and dependencies",sources:["runtime manifests","lockfiles","scripts","framework markers","package dependencies","bounded multi-language source observations for supported file extensions"],entersAt:"model"},{id:"workspace-rules",label:"Workspace rules",sources:["workspace markers","registry","project metadata","contracts","policies","ownership","graph overrides"],entersAt:"model"},{id:"changes",label:"Changes",sources:["repository state","git state","model baseline","workspace diff"],entersAt:"diff"},{id:"model-baseline",label:"Explicit model baseline",sources:[e$1.snapshot],entersAt:"diff"},{id:"existing-evidence",label:"Existing evidence",sources:["doctor reports","analysis reports","contract verification","release readiness","pipeline results","tests and runtime evidence","previous intelligence artifacts"],entersAt:"doctor-evidence"}],outputs:[{id:"understanding",label:"System understanding",artifacts:[e$1.model,e$1.knowledgeGraph,e$1.diff,e$1.impact],producedBy:["model","diff","impact"],inventory:"complete-for-chain"},{id:"governance-evidence",label:"Governance evidence",artifacts:[e$1.doctor,e$1.contractVerify,e$1.analyze,e$1.readiness,e$1.verify,e$1.history],producedBy:["doctor-evidence","contract-evidence","analyze-evidence","readiness-evidence","verify"],inventory:"complete-for-chain"},{id:"agent-grounding",label:"Agent grounding",artifacts:[e$1.agentContext,e$1.agentIndex,e$1.agentCustomizationPack,e$1.skillsIndex,e$1.agents],producedBy:["context","agent-sync"],inventory:"canonical-minimum",inventoryContract:"contracts/agent-customization-pack.v1.json"},{id:"explanations",label:"Explainable decisions",artifacts:[e$1.explain],producedBy:["explain"],inventory:"complete-for-chain"}],consumers:[{id:"developers",label:"Developers",channels:["CLI","reports","AGENTS.md"]},{id:"ci",label:"CI",channels:["JSON artifacts","exit codes","release gates"]},{id:"ides",label:"IDEs",channels:["synced contracts","extension","agent context"]},{id:"ai-agents",label:"AI agents",channels:["INDEX.json","context","skills","MCP"]}]},deliveryChannels:[{id:"artifacts",carries:["reports","models","context","grounding","skills"],authority:"canonical"},{id:"json-stdout",carries:["structured command results"],authority:"projection"},{id:"human-cli",carries:["summaries","diagnostics","next actions"],authority:"projection"},{id:"exit-codes",carries:["gate and command status"],authority:"projection"},{id:"watch-events",carries:["incremental workspace change events"],authority:"projection"},{id:"mcp",carries:["read-mostly access to current workspace artifacts"],authority:"projection"}],feedback:{from:["developers","ci","ides","ai-agents"],signals:["source commits","dependency updates","policy and contract edits","repairs","test and runtime results","agent action outcomes"],reentersThrough:["projects-repositories","runtime-dependencies","workspace-rules","changes","existing-evidence"],rule:"Consumer actions are not silently treated as truth. They re-enter as observable changes or evidence and must be modeled and verified again."},auxiliaryCapabilities:[{id:"graph",commands:["workspace graph emit","workspace graph explain","workspace graph entities","workspace graph evidence","workspace graph path","workspace graph search","workspace graph benchmark","workspace graph overlay","workspace graph dot","workspace graph mermaid","workspace graph jsonld","workspace graph graphml","workspace graph gexf"],reads:[e$1.model,e$1.knowledgeGraph],role:"Query the proof-backed graph derived from the canonical workspace model.",chainStep:false},{id:"evaluation",commands:["workspace eval init","workspace eval record","workspace eval status","workspace eval report","workspace eval compare"],reads:[e$1.evaluationLive,e$1.evaluationLastRun],produces:[e$1.evaluationLive,e$1.evaluationLastRun],role:"Measure model usage, activity, cost provenance, and verified outcomes without storing prompt or response bodies.",chainStep:false},{id:"watch",commands:["workspace watch"],reads:["workspace inputs",e$1.model],role:"Refresh the model incrementally and emit deterministic change events.",chainStep:false},{id:"mcp",commands:["workspace mcp serve"],reads:["workspace evidence artifacts"],role:"Expose read-mostly workspace evidence to compatible clients.",chainStep:false}],presentations:{simple:{layers:["inputs","intelligence","outputs","consumers"],nodes:[{id:"input-layer",kind:"inputs",label:"Input Layer",summary:"Projects \xB7 Repositories \xB7 Dependencies \xB7 Changes",contractRefs:["projects-repositories","runtime-dependencies","workspace-rules","changes","model-baseline","existing-evidence"]},{id:"workspace-intelligence",kind:"intelligence",label:"Workspace Intelligence",summary:"Model \xB7 Graph \xB7 Impact \xB7 Verify",contractRefs:n.map(r=>r.id)},{id:"agent-grounding",kind:"outputs",label:"Agent Grounding",summary:"AGENTS.md \xB7 Skills \xB7 Context",contractRefs:["agent-grounding"]},{id:"evidence-and-decisions",kind:"outputs",label:"Evidence Contracts",summary:"Reports \xB7 Artifacts \xB7 Gates",contractRefs:["understanding","governance-evidence","explanations"]},{id:"shared-consumers",kind:"consumers",label:"Shared Consumers",summary:"Developers \xB7 CI \xB7 IDEs \xB7 AI agents",contractRefs:["developers","ci","ides","ai-agents"]}],rule:"Use concrete user-facing language for first-contact explanations. Every input, output, consumer, and chain step must remain traceable through contractRefs even when details are summarized."},standard:{phases:["understand","change","evidence","gate","ground","distribute","explain"],nodes:[{id:"understand",label:"Understand",question:"What exists in the current workspace?",stepRefs:["model"]},{id:"change",label:"Change",question:"What changed, and what can it affect?",stepRefs:["diff","impact"]},{id:"evidence",label:"Evidence",question:"What health, contract, and readiness facts were observed?",stepRefs:["doctor-evidence","contract-evidence","analyze-evidence","readiness-evidence"]},{id:"gate",label:"Gate",question:"Is the current state acceptable and trustworthy?",stepRefs:["verify"]},{id:"ground",label:"Ground",question:"What should an agent know before acting?",stepRefs:["context"]},{id:"distribute",label:"Distribute",question:"Which durable agent and IDE surfaces receive that context?",stepRefs:["agent-sync"]},{id:"explain",label:"Explain",question:"Why did the system reach this result or verdict?",stepRefs:["explain"]}],rule:"Use for architecture education and product surfaces. Every phase must appear once and in order."},advanced:{steps:n.map(r=>r.id),requiredFields:["command","inputRefs","consumesArtifacts","produces","dependsOn","exitPolicy","purpose"],rule:"Use for implementers, adapters, IDEs, and CI. Preserve every step and its artifact and verdict semantics."}},steps:n,diagram:{direction:"TB",nodes:n.map(({id:r,label:s,phase:p})=>({id:r,label:s,phase:p})),edges:n.flatMap(r=>r.dependsOn.map(s=>({from:s,to:r.id,meaning:"required before"})))},consumers:{agents:{canonicalReadOrder:[e$1.agentIndex,e$1.agentContext,e$1.verify,e$1.impact,e$1.explain,e$1.model,e$1.knowledgeGraph,e$1.agentCustomizationPack,e$1.skillsIndex],entrypoints:[e$1.agents,".workspai/AGENT-GROUNDING.md"],rule:"Agents must cite current artifacts, preserve verified versus inferred status, and re-run the producing step when evidence is missing or stale."},ideAndCi:{requiredArtifacts:[e$1.model,e$1.knowledgeGraph,e$1.impact,e$1.verify],rule:"IDEs and CI must consume structured artifacts and verdict exit semantics rather than parse human help or terminal prose."},docsAndDiagrams:{rule:"Documentation and diagrams must derive labels, ordering, and edges from this contract and must not invent implemented steps."}}}}export{l as a,f as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {f}from'./chunk-5EPPPMAS.js';var o="model-usage-event.v1",s=f.evaluationLive,a="workspace-intelligence-evaluation-comparison.v1",i=["provider-reported","tokenizer-counted","estimated","unavailable"];export{o as a,s as b,a as c,i as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'path';import N from'fs-extra';import F from'chalk';async function K(n,o={}){let t=e.resolve(n),{WORKSPACE_CONTRACT_PATH:i,syncWorkspaceContract:c,verifyWorkspaceContract:m,writeWorkspaceContractVerifyEvidence:k}=await import('./workspace-contract-
|
|
1
|
+
import e from'path';import N from'fs-extra';import F from'chalk';async function K(n,o={}){let t=e.resolve(n),{WORKSPACE_CONTRACT_PATH:i,syncWorkspaceContract:c,verifyWorkspaceContract:m,writeWorkspaceContractVerifyEvidence:k}=await import('./workspace-contract-OSI7NBXS.js'),p=await c({workspacePath:t,strict:true}),{syncWorkspaceReadme:f,WORKSPACE_README_PATH:d}=await import('./workspace-readme-IVJXSIBS.js'),h=await f({workspacePath:t,workspaceName:p.contract.workspace.name,profile:p.contract.workspace.profile??"minimal",projectCount:p.contract.projects.length}),{buildWorkspaceModel:u,writeWorkspaceModel:g}=await import('./workspace-model-7ESEP366.js'),a=await u({workspacePath:t,includeEvidence:true}),P=await g(a,t),{buildWorkspaceImpact:W,buildWorkspaceModelSnapshot:C,diffWorkspaceModel:y,writeWorkspaceImpact:A,writeWorkspaceModelDiff:j,writeWorkspaceModelSnapshot:E}=await import('./workspace-intelligence-A7O7MN6T.js'),{WORKSPACE_INTELLIGENCE_ARTIFACTS:s}=await import('./workspace-intelligence-runtime-registry-NCVHKCMP.js'),R=e.join(t,s.snapshot),l=false;if(!await N.pathExists(R)){let r=await C({workspacePath:t,model:a});await E(r,t),l=true;}let S=await y({workspacePath:t,fromPath:s.snapshot,model:a}),b=await j(S,t),v=await W({workspacePath:t,fromPath:s.diff}),O=await A(v,t),T=await m({workspacePath:t,strict:true}),_=await k({workspacePath:t,result:T}),{syncWorkspaceAgentGrounding:M}=await import('./workspace-agent-sync-N5DPGU2E.js'),w=await M({workspacePath:t,model:a,write:true,refreshContext:true,strict:false,preset:"enterprise",targets:["all"],projectGrounding:o.projectGrounding??"managed"}),x=[i,(await import('./workspace-registry-summary-7ISKYEPM.js')).WORKSPACE_REGISTRY_SUMMARY_RELATIVE_PATH,e.relative(t,h).split(e.sep).join("/")||d,e.relative(t,P).split(e.sep).join("/"),s.knowledgeGraph,...l?[s.snapshot]:[],e.relative(t,b).split(e.sep).join("/"),e.relative(t,O).split(e.sep).join("/"),e.relative(t,_).split(e.sep).join("/"),...w.writtenFiles].filter((r,I,G)=>G.indexOf(r)===I);return o.silent||console.log(F.gray(`\u2713 Workspace Intelligence synced \xB7 ${a.summary.projectCount} project(s) \xB7 model + graph + agent grounding`)),{workspacePath:t,projectCount:a.summary.projectCount,baselineCreated:l,writtenFiles:x,warnings:w.projectLenses?.skipped.map(r=>`${r.name}: ${r.reason}`)??[]}}async function D(n,o={}){let t=e.resolve(n),i=o.workspaceName??e.basename(t),{registerWorkspaceStrict:c}=await import('./workspace-O4E5CCGK.js');return await c(t,i),K(t,{silent:o.silent})}export{K as a,D as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b}from'./chunk-UQEQ6CXU.js';import {c}from'./chunk-GDKFN3CM.js';import {p,h,i as i$1}from'./chunk-GXTCU4WF.js';import {a}from'./chunk-SNO3WG4V.js';import {e as e$1,d}from'./chunk-ADL3CK44.js';import {f,e}from'./chunk-5EPPPMAS.js';import I from'path';import R from'fs-extra';var G=f.agentContext,V=e.agentContext;function q(e){if(typeof e!="string"||!e.trim()||e==="true")return "generic";let t=e.trim().toLowerCase();return t==="codex"||t==="claude"||t==="cursor"||t==="orca"?t:"generic"}function M(e){return `npx --yes --package workspai workspai ${e}`.trim()}function l(e){return `npx workspai ${e}`.trim()}function i(e$1){return {id:e$1.id,scope:e$1.scope,display:l(e$1.args),execute:M(e$1.args),description:e$1.description,...e$1.project?{project:e$1.project}:{},freshness:h({id:`command.${e$1.id}`,label:`${e$1.id} command`,scope:"command",value:{display:l(e$1.args),execute:M(e$1.args)},...e$1.project?{project:e$1.project}:{},freshness:{kind:"derived",category:"structure",generatedAt:e$1.generatedAt,now:e$1.now,sourceArtifact:e.model,sourcePath:`safeCommands.${e$1.id}`,reason:"Safe command surfaces are derived from workspace model command capabilities."}}).freshness}}function F(e,t){return `workspace run ${t} --scope project:${e.name}`}function L(e){return (e.startsWith("project:")?e.slice(8):e).trim().toLowerCase()}function D(e){return [e.name,e.path,I.basename(e.path),e.absolutePath].filter(t=>typeof t=="string"&&t.trim().length>0).map(t=>t.trim().toLowerCase())}function K(e,t,n){let r={generatedAt:e.generatedAt,now:n},c=[i({id:"workspace.model",scope:"workspace",args:"workspace model --json",description:"Read the canonical workspace intelligence model.",...r}),i({id:"workspace.graph.entities",scope:"workspace",args:"workspace graph entities --json",description:"Query proof-backed workspace entities without loading the full graph.",...r}),i({id:"workspace.graph.evidence",scope:"workspace",args:"workspace graph evidence <entity-or-relation> --json",description:"Resolve portable evidence for a graph entity or relation.",...r}),i({id:"workspace.graph.path",scope:"workspace",args:"workspace graph path <from> <to> --json",description:"Find a shortest proof-carrying path between workspace entities.",...r}),i({id:"workspace.doctor",scope:"workspace",args:"doctor workspace --json",description:"Check workspace health before claiming verification.",...r}),i({id:"workspace.pipeline",scope:"workspace",args:"pipeline --json",description:"Run the governed sync, doctor, analyze, readiness, and autopilot loop.",...r}),i({id:"workspace.contract.verify",scope:"workspace",args:"workspace contract verify --json",description:"Verify workspace contract and dependency edges.",...r}),i({id:"workspace.verify",scope:"workspace",args:"workspace verify --json",description:"Evaluate evidence freshness and verification gates before release decisions.",...r})],a=t?[t]:e.projects;for(let s of a)s.commands.fleetStages.includes("test")&&c.push(i({id:`project.${s.name}.test`,scope:"project",project:s.name,args:F(s,"test"),description:`Run tests for ${s.name} through workspace orchestration.`,...r})),s.commands.fleetStages.includes("build")&&c.push(i({id:`project.${s.name}.build`,scope:"project",project:s.name,args:F(s,"build"),description:`Build ${s.name} through workspace orchestration.`,...r}));return c}function H(e){return e.commands.fleetStages.filter(t=>t==="test"||t==="build").map(t=>`workspace run ${t}`)}function z(e,t){if(!t?.startsWith("project:"))return;let n=L(t);if(n)return e.projects.find(r=>D(r).includes(n))}function B(e,t,n){let r=[...e.validation?.issues??[]];t?.startsWith("project:")&&!n&&r.push({severity:"error",code:"context.scope.project.missing",message:`Requested project scope was not found: ${t}`,target:t});let c=r.filter(s=>s.severity==="error").length,a=r.filter(s=>s.severity==="warning").length;return {status:c>0?"failed":a>0?"warning":"passed",errors:c,warnings:a,issues:r}}async function U(e,t){let n=[],r=[];for(let[c,a]of Object.entries(e.evidence))a&&await d(t,a.path)!==null?n.push(`${c}: ${a.path}`):r.push(c);return {available:n.sort(),missing:r.sort()}}function X(e){let t=e.summary.projectCount,n=e.summary.runtimes.length?`${e.summary.runtimes.join(", ")} runtime coverage`:"no runtime coverage",r=e.identity.surfaces.length?e.identity.surfaces.join(", "):"no detected surfaces";return `${e.workspace.name} is a ${e.identity.workspaceType} with ${t} project${t===1?"":"s"}, ${n}, and ${r}.`}function J(e){let t=["Do not claim a command passed unless a report or command output proves it.","Do not infer secrets or environment values from file names.","Do not change project scope without checking the selected project."];return e.contracts.exists||t.push("Workspace contract is missing; dependency and API edges may be incomplete."),e.summary.observedProjects>0&&t.push("Some projects are observed rather than first-class; command support may be partial."),t}async function pe(e$1){let t=e$1.model??await p({workspacePath:e$1.workspacePath,includeEvidence:e$1.includeEvidence===true,observableScanDepth:e$1.observableScanDepth,now:e$1.now}),n=q(e$1.agent),r=z(t,e$1.scope),c$1=B(t,e$1.scope,r);if(e$1.strict===true&&c$1.status!=="passed"){let o=c$1.issues.map(m=>`${m.severity}:${m.code}:${m.target}`).join(", ");throw new Error(`Workspace context strict validation failed: ${o}`)}let a=e$1.now??new Date,s=t.facts??[],T=new Set((r?[r]:t.projects).map(o=>o.name)),w=s.filter(o=>o.project?T.has(o.project):true),_=(r?[r]:t.projects).map(o=>{let m=w.filter(N=>N.project===o.name);return {name:o.name,path:o.path,kind:o.kind,category:o.category,runtime:o.runtime,framework:o.frameworkDisplayName,...o.generator?{generator:o.generator}:{},createCapability:o.createCapability,supportTier:o.supportTier,safeCommands:H(o),importantFiles:o.importantFiles,facts:m}}),u=await U(t,e$1.workspacePath),y=I.join(e$1.workspacePath,e.knowledgeGraph),d=await R.pathExists(y)?await R.readJson(y).catch(()=>null):null,C=false;if(d?.schemaVersion===f.knowledgeGraph)try{c(d,t),C=true;}catch{}let v=X(t),j=K(t,r,a),O=j.map(o=>h({id:`context.command.${o.id}`,label:`${o.id} safe command`,scope:"command",value:{display:o.display,execute:o.execute,scope:o.scope},...o.project?{project:o.project}:{},freshness:{kind:"derived",category:"structure",generatedAt:t.generatedAt,now:a,sourceArtifact:e.agentContext,sourcePath:`safeCommands.${o.id}`,reason:"Context safe commands are derived from workspace model command capabilities."}})),b$1=[...w,...O],f$1=i$1({facts:b$1,generatedAt:a.toISOString(),now:a}),h$1=b();return {schemaVersion:G,generatedAt:a.toISOString(),agent:n,workspaceSummary:v,modelRef:e.model,knowledgeGraph:{artifact:e.knowledgeGraph,schemaVersion:f.knowledgeGraph,available:C,...typeof d?.quality?.entityCount=="number"?{entityCount:d.quality.entityCount}:{},...typeof d?.quality?.relationCount=="number"?{relationCount:d.quality.relationCount}:{},...typeof d?.quality?.proofCount=="number"?{proofCount:d.quality.proofCount}:{},queryCommands:[l("workspace graph search <query> --limit 12 --json"),l("workspace graph entities [kind] --json"),l("workspace graph evidence <entity-or-relation> --json"),l("workspace graph path <from> <to> --json")]},intelligenceChain:{schemaVersion:h$1.schemaVersion,contractPath:h$1.contractPath,currentStep:"context",canonicalReadOrder:[...h$1.consumers.agents.canonicalReadOrder]},workspace:{name:t.workspace.name,root:t.workspace.root,type:t.identity.workspaceType,...t.workspace.profile?{profile:t.workspace.profile}:{}},scope:{requested:e$1.scope??"workspace",...r?{activeProject:r.name}:{}},projects:_,safeCommands:j,facts:b$1,factFreshness:f$1,evidence:u,policies:{mode:t.policies.mode,source:t.policies.source},contracts:{exists:t.contracts.exists,path:t.contracts.workspaceContractPath},validation:c$1,agentInstructions:[`Read \`${e.agentIndex}\` first, then this context pack and linked evidence reports.`,"Use `workspace graph search <query> --limit 12 --json` for bounded, proof-backed retrieval before loading the full graph.",`Load \`${e.knowledgeGraph}\` only when a complete graph export is explicitly required.`,"Use this context as the workspace source of truth before inspecting random files.","Prefer workspace-level evidence over generic framework assumptions.","Use `display` commands when explaining steps to a human.","Use `execute` commands when launching commands from automation or tooling.","Treat `facts[].freshness.verifyBeforeUse` as a hard refresh requirement before using that fact in advice, fixes, or release decisions.","Do not carry extracted facts beyond their freshness contract; re-read or regenerate evidence when the contract says stale, unknown, live, or verify-before-use.","Keep project-scoped advice tied to the active project scope.","Regenerate stale grounding with `npx workspai workspace agent-sync --write --refresh-context`."],unsafeAssumptions:[...J(t),...f$1.verifyBeforeUseFacts>0?[`${f$1.verifyBeforeUseFacts} fact(s) require verification before use; do not treat them as durable workspace structure.`]:[]],humanSummary:[v,`Evidence available: ${u.available.length}. Missing evidence groups: ${u.missing.join(", ")||"none"}.`,r?`Active project scope: ${r.name} (${r.frameworkDisplayName}).`:"Scope: whole workspace."].join(`
|
|
2
|
+
`)}}async function de(e,t){return e$1(t,V,a(e))}export{G as a,V as b,pe as c,de as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b,c as c$2}from'./chunk-QK5QOXOE.js';import {a as a$1}from'./chunk-YM77FQB3.js';import {r as r$1}from'./chunk-TTFQWH55.js';import {a as a$2}from'./chunk-N2BIIUDH.js';import {g}from'./chunk-IUYZ3NHS.js';import {j as j$1,e as e$2}from'./chunk-GBMCHFOV.js';import {j,l as l$2}from'./chunk-RPHM7LQW.js';import {c as c$1,d}from'./chunk-VUR7H2FU.js';import {a}from'./chunk-UQEQ6CXU.js';import {f as f$1,g as g$1,h as h$2}from'./chunk-6OFGLNFS.js';import {k,l as l$1,h as h$1,m as m$1,n,p as p$2,q}from'./chunk-QHY6F4SS.js';import {m,p as p$1,s}from'./chunk-GXTCU4WF.js';import {l,o as o$1,p as p$3}from'./chunk-SNO3WG4V.js';import {c,e as e$1}from'./chunk-ADL3CK44.js';import {b as b$1}from'./chunk-LYVDRRDO.js';import {e,f,o,p,n as n$1,m as m$2}from'./chunk-5EPPPMAS.js';import {d as d$1}from'./chunk-VRW6KXNK.js';import ue from'path';import de from'fs-extra';function r(t,s){if(!t)throw new Error(`Workspace Intelligence run semantic violation: ${s}`)}function ce(t,s){return t.length===s.length&&t.every((g,u)=>g===s[u])}function le(t){b$1(e.intelligenceRun,t,"Workspace Intelligence run report"),r(t.chainSchemaVersion===a,`chainSchemaVersion must be ${a}`),r(t.artifactPath===e.intelligenceRun,`artifactPath must be ${e.intelligenceRun}`),r(t.preflight.length===n$1.length,`preflight must contain exactly ${n$1.length} entries`);for(let[l,n]of n$1.entries()){let a=t.preflight[l];r(a?.id===n,`preflight[${l}].id must be ${n}`),r(ce(a.artifacts,o[n]),`${n} preflight artifacts must match the runtime registry`),n==="sync"?r(a.status==="passed"&&a.result==="synchronized"||a.status==="failed"&&a.result==="failed","sync preflight status and result are incoherent"):r(a.status==="passed"&&(a.result==="created"||a.result==="reused")||a.status==="failed"&&a.result==="failed"||a.status==="skipped"&&a.result==="skipped","baseline preflight status and result are incoherent");}let s=t.preflight[1];r(t.baselineCreated===(s?.result==="created"),"baselineCreated must match the baseline preflight result"),r(t.stages.length===m$2.length,`stages must contain exactly ${m$2.length} canonical steps`);let g=t.preflight[0],u=g?.status==="failed";for(let[l,n]of m$2.entries()){let a=t.stages[l];r(a?.id===n,`stages[${l}].id must be ${n}`),r(ce(a.artifacts,p[n].produces),`${n} artifacts must match the runtime registry`),u&&r(a.status==="skipped",`${n} must be skipped after a hard failure`),a.status==="passed"?r(a.exitCode===0,`${n} passed stage must have exitCode 0`):a.status==="blocked"?r(a.exitCode!==0,`${n} blocked stage must have a non-zero exitCode`):a.status==="failed"?(r(a.exitCode===1,`${n} failed stage must have exitCode 1`),u=true):(r(a.exitCode===0,`${n} skipped stage must have exitCode 0`),r(a.durationMs===0,`${n} skipped stage must have durationMs 0`)),l===0&&((g?.status==="failed"||a.status==="failed")&&r(s?.status==="skipped","baseline must be skipped when sync or model fails"),s?.status==="skipped"&&r(g?.status==="failed"||a.status==="failed"||a.status==="skipped","baseline may be skipped only after an upstream failure"),s?.status!=="passed"&&(u=true));}let m=t.preflight.some(l=>l.status==="failed")||t.stages.some(l=>l.status==="failed"),y=t.stages.some(l=>l.status==="blocked"),c=m?"failed":y?"blocked":"passed",f=c==="failed"?1:c==="blocked"?2:0;r(t.status===c,`status must be ${c}`),r(t.exitCode===f,`exitCode must be ${f}`);}var he=e.intelligenceRun,Ie=f.intelligenceRun,x=he;function h(t){d$1({action:"intelligence",status:t.status==="started"?"started":t.status==="passed"?"succeeded":t.status==="failed"?"failed":"warn",message:t.message,metadata:{phase:`workspace.intelligence.${t.kind}.${t.id}`,intelligenceMilestoneId:t.id,intelligenceMilestoneKind:t.kind,intelligenceMilestoneStatus:t.status}});}async function ze(t){let s=ue.resolve(t.workspacePath);return c(s,x,()=>Ee({...t,workspacePath:s}),{timeoutMs:15*6e4,staleAfterMs:3e4})}async function Ee(t){let s$1=t.workspacePath,g$2=[],u=[],m$2=false,y=async(e,i)=>{let o$1=[...o[e]];if(m$2){h({id:e,kind:"preflight",status:"skipped",message:`${e} prerequisite skipped after an upstream failure`}),g$2.push({id:e,status:"skipped",result:"skipped",durationMs:0,artifacts:o$1,message:"skipped because a required upstream operation failed"});return}let I=Date.now();h({id:e,kind:"preflight",status:"started",message:`${e} prerequisite started`});try{let d=await i();h({id:e,kind:"preflight",status:"passed",message:d.message}),g$2.push({id:e,status:"passed",result:d.result,durationMs:Date.now()-I,artifacts:o$1,message:d.message});}catch(d){m$2=true;let k=d instanceof Error?d.message:String(d);h({id:e,kind:"preflight",status:"failed",message:k}),g$2.push({id:e,status:"failed",result:"failed",durationMs:Date.now()-I,artifacts:o$1,message:k});}},c=async(e,i)=>{let o=[...p[e].produces];if(m$2){h({id:e,kind:"stage",status:"skipped",message:`${e} skipped after an upstream failure`}),u.push({id:e,status:"skipped",durationMs:0,artifacts:o,exitCode:0,message:"skipped because a required upstream stage failed"});return}let I=Date.now();h({id:e,kind:"stage",status:"started",message:`${e} started`});try{let d=await i(),k=d.exitCode??0,_=d.blocked||k!==0?"blocked":"passed";h({id:e,kind:"stage",status:_,message:d.message}),u.push({id:e,status:_,durationMs:Date.now()-I,artifacts:o,exitCode:k,message:d.message});}catch(d){m$2=true;let k=d instanceof Error?d.message:String(d);h({id:e,kind:"stage",status:"failed",message:k}),u.push({id:e,status:"failed",durationMs:Date.now()-I,artifacts:o,exitCode:1,message:k});}};await y("sync",async()=>{let e=await g(s$1,true),i=await l({workspacePath:s$1});return {result:"synchronized",message:`registry ${e.added.length} added/${e.skipped} existing; contract ${i.contract.projects.length} projects`}});let f,l$3=()=>{if(!f)throw new Error("canonical workspace model is unavailable");return f};await c("model",async()=>(f={...await p$1({workspacePath:s$1,includeEvidence:true}),build:m({mode:"full",engineStatus:"disabled"})},await s(f,s$1),{message:`${f.summary.projectCount} projects modeled`}));let n$1=ue.join(s$1,e.snapshot),a$3=false;await y("baseline",async()=>{if(!await de.pathExists(n$1)){let o=await k({workspacePath:s$1,model:l$3()});return await l$1(o,s$1),a$3=true,{result:"created",message:"initial structural baseline created"}}let e=await de.readJson(n$1),i=h$1(e);return i?(await l$1(i,s$1),{result:"reused",message:"legacy structural baseline migrated and reused"}):{result:"reused",message:"existing structural baseline reused"}}),await c("diff",async()=>{let e$1=await m$1({workspacePath:s$1,fromPath:e.snapshot,model:l$3()});return await n(e$1,s$1),{message:e$1.summary.changed?"workspace changes detected":"no workspace changes"}}),await c("impact",async()=>{let e$1=await p$2({workspacePath:s$1,fromPath:e.diff});return await q(e$1,s$1),{message:`${e$1.summary.risk} risk; ${e$1.summary.affectedProjects} affected`}}),await c("doctor-evidence",async()=>{let e=await r$1({workspace:s$1,json:true,quiet:true,profile:t.strict===true?"enterprise-strict":"local"});return {exitCode:e,blocked:e!==0,message:`doctor exit ${e}`}}),await c("contract-evidence",async()=>{let e=await o$1({workspacePath:s$1,strict:true});return await p$3({workspacePath:s$1,result:e}),{exitCode:e.status==="passed"?0:1,blocked:e.status!=="passed",message:`contract ${e.status}`}}),await c("analyze-evidence",async()=>{let e=await a$1({workspacePath:s$1,json:true,strict:t.strict===true});return {blocked:e.summary.verdict==="blocked"||t.strict===true&&e.summary.verdict==="needs-attention",exitCode:e.summary.verdict==="blocked"||t.strict===true&&e.summary.verdict==="needs-attention"?1:0,message:`analyze ${e.summary.verdict} (${e.summary.score}/100)`}}),await c("readiness-evidence",async()=>{let e=await a$2({startPath:s$1,writeReport:true,skipVerify:true});return {blocked:e.overallStatus==="fail"||t.strict===true&&e.overallStatus==="warn",exitCode:e.overallStatus==="fail"||t.strict===true&&e.overallStatus==="warn"?1:0,message:`pre-verify readiness ${e.overallStatus}`}}),await c("verify",async()=>{let e$1=await f$1({workspacePath:s$1,fromImpactPath:e.impact});await g$1(e$1,s$1);let i=h$2(e$1,{strict:t.strict===true});return await j$1(s$1,e$2(e$1,i.passed)),{blocked:!i.passed,exitCode:i.exitCode,message:`${e$1.summary.verdict}; gate ${i.passed?"passed":"blocked"}`}}),await c("context",async()=>{let e=await c$1({workspacePath:s$1,model:l$3(),agent:t.agent??"generic",includeEvidence:true});return await d(e,s$1),{message:`context grounded for ${e.agent}`}}),await c("agent-sync",async()=>{let e=await l$2({workspacePath:s$1,agent:t.agent??"generic",write:true,refreshContext:false,strict:t.strict===true,preset:"enterprise"}),i=e.strictViolations??[],o=t.strict===true&&i.length>0;return {blocked:o,exitCode:o?2:0,message:o?`${e.writtenFiles.length} grounding files written; ${i.length} strict grounding violation(s): ${i.join("; ")}`:`${e.writtenFiles.length} grounding files written`}}),await c("explain",async()=>{let e=await b({workspacePath:s$1,target:{kind:"release-blocked"}});await c$2(e,s$1);let i=t.strict===true?u.filter(o=>o.status==="blocked").map(o=>o.id):[];return {message:i.length>0&&e.blocking!==true?`Strict policy blocked advisory or incomplete evidence in ${i.join(", ")}. ${e.summary}`:e.summary}});let pe=u.some(e=>e.status==="blocked"),A=m$2?"failed":pe?"blocked":"passed",ge=m$2?1:A==="blocked"?2:0,R={schemaVersion:Ie,chainSchemaVersion:a,generatedAt:new Date().toISOString(),workspacePath:s$1,baselineCreated:a$3,preflight:g$2,status:A,exitCode:ge,stages:u,artifactPath:x};le(R),await e$1(s$1,x,R);let me=await j({workspacePath:s$1});return await e$1(s$1,e.agentIndex,me),R}export{he as a,Ie as b,ze as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-ZPA6ECBJ.js';import {c,d,a,b as b$1}from'./chunk-MOSXTVPU.js';import n from'fs';import o from'path';function _(t){return b({startPath:t})?.workspacePath??null}function k(t){let s=o.resolve(t),p=n.existsSync(o.join(s,c))||n.existsSync(o.join(s,d))||n.existsSync(o.join(s,a,"workspace.json"))||n.existsSync(o.join(s,b$1,"workspace.json")),A=n.existsSync(o.join(s,a,"project.json"))||n.existsSync(o.join(s,a,"context.json"))||n.existsSync(o.join(s,b$1,"project.json"))||n.existsSync(o.join(s,b$1,"context.json"));return p&&!A}export{_ as a,k as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1,c,j,i,g,h}from'./chunk-ZCPT6KC3.js';import {t,u}from'./chunk-MOSXTVPU.js';import B from'fs';import a from'path';import k from'fs-extra';var Z=[{id:"fastapi.standard",aliases:["fastapi","fastapi.standard"],label:"fastapi \u2014 FastAPI Standard Kit",description:"Core-backed FastAPI service scaffold.",owner:"core",runtime:"python",framework:"fastapi",category:"backend",moduleSupport:true,stability:"stable",versionPolicy:"tested-baseline"},{id:"fastapi.ddd",aliases:["fastapi.ddd","fastapi-ddd"],label:"fastapi \u2014 FastAPI DDD Kit",description:"Core-backed FastAPI DDD service scaffold.",owner:"core",runtime:"python",framework:"fastapi",category:"backend",moduleSupport:true,stability:"stable",versionPolicy:"tested-baseline"},{id:"nestjs.standard",aliases:["nestjs","nest","nestjs.standard"],label:"nestjs \u2014 NestJS Standard Kit",description:"Core-backed NestJS service scaffold.",owner:"core",runtime:"node",framework:"nestjs",category:"backend",moduleSupport:true,stability:"stable",versionPolicy:"tested-baseline"},{id:"springboot.standard",aliases:["spring","springboot","springboot.standard","java"],label:"spring \u2014 Spring Boot Standard Kit",description:"npm-backed Spring Boot service scaffold.",owner:"npm",runtime:"java",framework:"springboot",category:"backend",moduleSupport:false,stability:"stable",versionPolicy:"tested-baseline",generator:"springboot",createUsage:"workspai create project springboot.standard <name> [--java-version <major>] [--spring-boot-version <semver>] [--group-id <com.example>] [--package-name <com.example.app>] [--port <number>]"},{id:"gofiber.standard",aliases:["go","go.standard","fiber","gofiber","gofiber.standard","go/fiber"],label:"go/fiber \u2014 Go Fiber Standard Kit",description:"npm-backed Go Fiber service scaffold.",owner:"npm",runtime:"go",framework:"gofiber",category:"backend",moduleSupport:false,stability:"stable",versionPolicy:"tested-baseline",generator:"gofiber",createUsage:"workspai create project gofiber.standard <name> [--output <dir>]"},{id:"gogin.standard",aliases:["gin","gogin","gogin.standard","go/gin"],label:"go/gin \u2014 Go Gin Standard Kit",description:"npm-backed Go Gin service scaffold.",owner:"npm",runtime:"go",framework:"gogin",category:"backend",moduleSupport:false,stability:"stable",versionPolicy:"tested-baseline",generator:"gogin",createUsage:"workspai create project gogin.standard <name> [--output <dir>]"},{id:"dotnet.webapi.clean",aliases:["dotnet","dotnet.webapi","dotnet.webapi.clean","aspnet","aspnetcore","asp.net","asp.net-core","csharp","c#"],label:"dotnet \u2014 ASP.NET Core Clean Web API",description:"npm-backed ASP.NET Core Web API with clean architecture boundaries.",owner:"npm",runtime:"dotnet",framework:"dotnet",category:"backend",moduleSupport:false,stability:"preview",versionPolicy:"tested-baseline",generator:"dotnet-webapi-clean",createUsage:"workspai create project dotnet.webapi.clean <name> [--target-framework net8.0] [--root-namespace <Company.Product>] [--port <number>]"},{id:"rust.axum",aliases:["rust.axum","axum","rust-axum"],label:"rust/axum \u2014 Rust Axum API",description:"Workspai-owned Axum service with health, tests, CI, and container baseline.",owner:"npm",runtime:"rust",framework:"axum",category:"backend",moduleSupport:false,stability:"preview",versionPolicy:"tested-baseline",generator:"rust-axum",createUsage:"workspai create project rust.axum <name> [--port <number>] [--output <dir>] [--skip-git]"}],K=new Map;for(let e of Z){K.set(e.id.toLowerCase(),e);for(let t of e.aliases)K.set(t.toLowerCase(),e);}function _(e){return e?K.get(e.trim().toLowerCase())??null:null}function Ze(e){return _(e)?.id??e}function et(){return Z.filter(e=>e.owner==="core"||e.generator)}function tt(e){return _(e)?.owner==="npm"}async function rt(e,t){if(!e.generator)throw new Error(`Kit is not backed by an npm generator: ${e.id}`);if(e.generator==="gofiber"){let{generateGoFiberKit:r}=await import('./gofiber-standard-AQGSC7ON.js');await r(t.projectPath,{project_name:t.projectName,module_path:t.projectName,skipGit:t.skipGit,skipInstall:t.skipInstall});return}if(e.generator==="gogin"){let{generateGoGinKit:r}=await import('./gogin-standard-7DU3OCBX.js');await r(t.projectPath,{project_name:t.projectName,module_path:t.projectName,skipGit:t.skipGit,skipInstall:t.skipInstall});return}if(e.generator==="springboot"){let{generateSpringBootKit:r}=await import('./springboot-standard-EK6GYN5T.js');await r(t.projectPath,{project_name:t.projectName,artifact_id:t.projectName,java_version:m(t.args,"--java-version")?.trim(),spring_boot_version:m(t.args,"--spring-boot-version")?.trim(),springdoc_version:m(t.args,"--springdoc-version")?.trim(),group_id:m(t.args,"--group-id")?.trim(),package_name:m(t.args,"--package-name")?.trim(),description:m(t.args,"--description")?.trim(),port:m(t.args,"--port")?.trim(),skipGit:t.skipGit,skipInstall:t.skipInstall});return}if(e.generator==="dotnet-webapi-clean"){let{generateDotnetWebApiCleanKit:r}=await import('./dotnet-webapi-clean-VXEF4SHM.js');await r(t.projectPath,{project_name:t.projectName,target_framework:m(t.args,"--target-framework")?.trim(),root_namespace:m(t.args,"--root-namespace")?.trim(),description:m(t.args,"--description")?.trim(),port:m(t.args,"--port")?.trim(),skipGit:t.skipGit,skipInstall:t.skipInstall});return}if(e.generator==="rust-axum"){let{generateRustAxumKit:r}=await import('./rust-axum-4HXDICIB.js');await r(t.projectPath,{project_name:t.projectName,description:m(t.args,"--description")?.trim(),port:m(t.args,"--port")?.trim(),skipGit:t.skipGit,skipInstall:t.skipInstall});return}throw new Error(`Unhandled npm kit generator: ${e.generator}`)}function m(e,t){let r=e.indexOf(t);if(r>=0&&r+1<e.length)return e[r+1];let n=e.find(i=>i.startsWith(`${t}=`));return n?n.slice(t.length+1):void 0}var y=["init","dev","start","build","test","lint","format","help"],ee={python:{runtime:"python",displayName:"Python",tier:"first-class",scaffoldSupport:true,importSupport:true,lifecycleCommands:y,moduleCommands:true,doctorSupport:"full",notes:["Core-backed Python projects support RapidKit Core modules and lifecycle commands."]},node:{runtime:"node",displayName:"Node.js",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:y,moduleCommands:true,doctorSupport:"full",notes:["Node projects support npm-owned lifecycle commands; NestJS is the first-class Node framework."]},go:{runtime:"go",displayName:"Go",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:y,moduleCommands:false,doctorSupport:"readiness",notes:["Go projects support workspace governance and lifecycle commands via Go tooling."]},java:{runtime:"java",displayName:"Java / Spring Boot",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:y,moduleCommands:false,doctorSupport:"readiness",notes:["Java projects support Maven/Gradle lifecycle commands and workspace governance."]},dotnet:{runtime:"dotnet",displayName:".NET / ASP.NET Core",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:y,moduleCommands:false,doctorSupport:"readiness",notes:[".NET projects support dotnet CLI lifecycle commands and workspace governance."]},php:{runtime:"php",displayName:"PHP",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:y,moduleCommands:false,doctorSupport:"readiness",notes:["Laravel projects use the official Composer generator and PHP/Composer lifecycle adapter."]},ruby:{runtime:"ruby",displayName:"Ruby",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Ruby projects are importable and governed as observed projects until a kit exists."]},rust:{runtime:"rust",displayName:"Rust",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:y,moduleCommands:false,doctorSupport:"readiness",notes:["Rust projects support Axum and Tauri scaffolding plus Cargo lifecycle commands."]},elixir:{runtime:"elixir",displayName:"Elixir",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Elixir projects are importable and governed as observed projects until a kit exists."]},clojure:{runtime:"clojure",displayName:"Clojure",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Clojure projects are importable and governed as observed projects until a kit exists."]},scala:{runtime:"scala",displayName:"Scala",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Scala projects are importable and governed as observed projects until a kit exists."]},kotlin:{runtime:"kotlin",displayName:"Kotlin",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Kotlin projects are importable and governed as observed projects until a kit exists."]},deno:{runtime:"deno",displayName:"Deno",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Deno projects are importable and governed as observed projects until a kit exists."]},bun:{runtime:"bun",displayName:"Bun",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Bun projects are importable and governed as observed projects until a kit exists."]},c:{runtime:"c",displayName:"C",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["C projects are importable and receive manifest, test, quality, security, and coverage evidence without assuming a package manager."]},cpp:{runtime:"cpp",displayName:"C++",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["C++ projects are importable and receive manifest, test, quality, security, and coverage evidence without assuming a package manager."]},unknown:{runtime:"unknown",displayName:"Unknown",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Unknown projects are tracked safely but require manual command configuration."]}},Ce=["fastapi","nestjs"],ke=["django","flask","nextjs","remix","nuxt","react","vite","vue","sveltekit","svelte","angular","astro","solid","express","fastify","koa","echo","gofiber","gogin","springboot","dotnet","laravel","symfony","rails","sinatra","actix","axum","rocket","phoenix","clojure","scala","kotlin","deno","bun","tauri","electron","vscode-extension","c","cpp"];function x(e){return ee[e||"unknown"]??ee.unknown}function te(e){return Ce.includes(e)?"first-class":ke.includes(e)?"extended":"observed"}function re(e){let t=x(e.runtime);return {lifecycleCommands:t.lifecycleCommands,moduleCommands:e.moduleSupport&&t.moduleCommands,unsupportedLifecycleCommands:y.filter(r=>!t.lifecycleCommands.includes(r))}}var Se=["python","node","go","java","dotnet","rust","php"];function w(e){return !!e&&Se.includes(e)}function A(e,t){return t!=="lint"&&t!=="format"&&t!=="docs"?false:e==="python"}function ne(e){let t=x(e),r=w(t.runtime),n=je[t.runtime]??[],i=we[t.runtime]??[];return {runtime:t.runtime,displayName:t.displayName,lifecycleCommands:t.lifecycleCommands,hasExecutor:r,packageManagers:n,primaryFiles:i,notes:t.notes}}var je={python:["poetry","pip","uv"],node:["npm","pnpm","yarn","bun"],go:["go"],java:["maven","gradle"],dotnet:["dotnet"],php:["composer"],ruby:["bundle"],rust:["cargo"],elixir:["mix"],kotlin:["gradle"],deno:["deno"],bun:["bun"]},we={python:["pyproject.toml","requirements.txt","requirements.in"],node:["package.json"],go:["go.mod"],java:["pom.xml","build.gradle","build.gradle.kts"],dotnet:["*.csproj","*.sln"],php:["composer.json"],ruby:["Gemfile"],rust:["Cargo.toml"],elixir:["mix.exs"],kotlin:["settings.gradle.kts"],deno:["deno.json","deno.jsonc"],bun:["package.json","bunfig.toml"]};function v(e,t){let r=g({runtime:typeof e?.runtime=="string"?e.runtime:void 0,framework:typeof e?.framework=="string"?e.framework:void 0,kitName:typeof e?.kit_name=="string"?e.kit_name:typeof e?.kit=="string"?e.kit:void 0});return r.runtime!=="unknown"?r.runtime:j(t,e).runtime}function ie(e){let t$1=e;for(;;){for(let n of t(t$1,"project.json"))if(B.existsSync(n))try{return JSON.parse(B.readFileSync(n,"utf8"))}catch{return null}let r=a.dirname(t$1);if(r===t$1)break;t$1=r;}return null}function ft(e,t){return v(e,t)==="go"}function gt(e,t){return v(e,t)==="node"}function yt(e,t){return v(e,t)==="java"}function bt(e,t){return v(e,t)==="dotnet"}function Ct(e,t){return v(e,t)==="python"}var xe=["project.json","context.json","file-hashes.json"];async function Rt(e){let t=a.resolve(e),r=[];for(let n of xe){let i=u(t,n);if(await k.pathExists(i))continue;let c=a.join(t,".rapidkit",n);if(!await k.pathExists(c))continue;let C=await k.readJson(c);await k.ensureDir(a.dirname(i));let S=`${i}.${process.pid}.${Date.now()}.tmp`;try{await k.writeJson(S,C,{spaces:2}),await k.move(S,i,{overwrite:false}),r.push(i);}finally{await k.remove(S).catch(()=>{});}}return r}function ve(e){for(let t$1 of t(e,"context.json"))if(B.existsSync(t$1))try{return JSON.parse(B.readFileSync(t$1,"utf8"))}catch{return null}return null}function Ne(e){let t=e?.engine;return t==="npm"||t==="pip"||t==="python"?t:"unknown"}function Pe(e,t){if(e?.module_support===false||t?.module_support===false||!e&&t)return false;let r=typeof e?.kit_name=="string"?e.kit_name:typeof e?.kit=="string"?e.kit:typeof t?.kit=="string"?t.kit:void 0,n=r?_(r):void 0;return n?.owner==="core"&&n.moduleSupport===true}function Re(e,t,r){let n=g({runtime:typeof t?.runtime=="string"?t.runtime:typeof r?.runtime=="string"?r.runtime:void 0,framework:typeof t?.framework=="string"?t.framework:typeof r?.framework=="string"?r.framework:void 0,kitName:typeof t?.kit_name=="string"?t.kit_name:typeof t?.kit=="string"?t.kit:typeof r?.kit=="string"?r.kit:void 0});return n.key!=="unknown"?n:j(e,t)}function ae(e){let t$1=a.resolve(e);if(![...t(t$1,"project.json"),...t(t$1,"context.json")].some(C=>B.existsSync(C)))return null;let n=ie(t$1),i=ve(t$1),c=Re(t$1,n,i);return {projectRoot:t$1,projectJson:n,contextJson:i,detection:c,moduleSupport:Pe(n,i),engine:Ne(i)}}var Ee=["build","dev","start","test","lint","format"],G=["init","test","build","start"],_t=["lint","format","docs"];function At(e){return !!e&&Ee.includes(e)}var Me={dev:["dev","start:dev"],start:["start","start:prod","preview"],build:["build"],test:["test","test:unit","test:ci"],lint:["lint"],format:["format","prettier"]},ce={nestjs:{dev:["dev","start:dev"],start:["start","start:prod"],build:["build"],test:["test","test:e2e"],lint:["lint"],format:["format"]},express:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},fastify:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},koa:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]}};function _e(e){let t=a.join(e,"package.json");if(!B.existsSync(t))return {};try{let n=JSON.parse(B.readFileSync(t,"utf8")).scripts??{};return Object.fromEntries(Object.entries(n).filter(i=>typeof i[1]=="string"))}catch{return {}}}function Ae(e,t){let r=t?c(t):"unknown",n=r!=="unknown"?a$1(r,e):[],i=t?ce[t]?.[e]??[]:[],c$1=Me[e]??[],C=[...n,...i,...c$1];return [...new Set(C)]}function me(e,t,r){let n=_e(e),i=new Set(Object.keys(n));if(i.has(t))return {scriptName:t,source:"package.json"};for(let c$1 of Ae(t,r?.framework))if(i.has(c$1))return {scriptName:c$1,source:a$1(c(r?.framework??"unknown"),t).includes(c$1)||ce[r?.framework??""]?.[t]?.includes(c$1)?"framework-candidate":"generic-candidate"};return null}function W(e){return B.existsSync(a.join(e,"package.json"))}function de(e){let t=ne(e);return t.runtime==="unknown"&&e!=="unknown"?null:{runtime:t.runtime,displayName:t.displayName,supportedCommands:t.lifecycleCommands,packageManagers:t.packageManagers,primaryFiles:t.primaryFiles,notes:t.notes,hasExecutor:t.hasExecutor}}function s(e){try{return B.existsSync(e)}catch{return false}}function b(e){try{return s(e)?B.readFileSync(e,"utf8"):""}catch{return ""}}function f(e,t){let r=b(a.join(e,"Makefile"));return r?new RegExp(`^${t}\\s*:`).test(r):false}function Fe(e){let t=[e];for(;t.length>0;){let r=t.shift();if(!r)break;let n=[];try{n=B.readdirSync(r,{withFileTypes:true});}catch{continue}for(let i of n){if(i.name==="node_modules"||i.name===".git"||i.name==="dist")continue;let c=a.join(r,i.name);if(i.isFile()&&i.name.endsWith(".csproj"))return true;i.isDirectory()&&t.push(c);}}return false}function le(e,t){let r=s(a.join(e,"pyproject.toml")),n=s(a.join(e,"requirements.txt"))||s(a.join(e,"requirements.in")),i=s(a.join(e,"manage.py"));switch(t){case "init":return r||n;case "dev":case "start":return r||i||n;case "test":return r||n||s(a.join(e,"tests"));case "build":return r||n;case "lint":case "format":return r||n||i||s(a.join(e,"setup.py"))||s(a.join(e,"setup.cfg"));default:return false}}function Le(e,t){if(!s(a.join(e,"go.mod")))return false;switch(t){case "init":return true;case "dev":return f(e,"run")||s(a.join(e,"main.go"));case "test":return true;case "build":return true;case "start":return f(e,"run")||s(a.join(e,"main.go"))||s(a.join(e,"cmd"));case "lint":return s(a.join(e,".golangci.yml"))||s(a.join(e,".golangci.yaml"))||f(e,"lint");case "format":return f(e,"fmt")||f(e,"format");default:return false}}function De(e,t){let r=s(a.join(e,"pom.xml")),n=s(a.join(e,"build.gradle"))||s(a.join(e,"build.gradle.kts"));if(!r&&!n)return false;switch(t){case "init":case "test":case "build":case "dev":case "start":return true;case "lint":return f(e,"lint")||b(a.join(e,"pom.xml")).includes("checkstyle")||b(a.join(e,"build.gradle")).includes("checkstyle")||b(a.join(e,"build.gradle.kts")).includes("checkstyle");case "format":return f(e,"format")||b(a.join(e,"build.gradle")).includes("spotless")||b(a.join(e,"build.gradle.kts")).includes("spotless");default:return false}}function Oe(e,t){if(!Fe(e))return false;switch(t){case "init":case "dev":case "test":case "build":case "start":return true;case "lint":return f(e,"lint")||b(a.join(e,"Directory.Build.props")).includes("EnforceCodeStyleInBuild");case "format":return f(e,"format")||s(a.join(e,".editorconfig"));default:return false}}function Te(e,t,r){return t==="init"?W(e):me(e,t,{framework:r})!==null}function Ie(e,t,r){switch(t){case "php":return r==="init"&&s(a.join(e,"composer.json"));case "ruby":return r==="init"&&s(a.join(e,"Gemfile"));case "rust":return s(a.join(e,"Cargo.toml"))?r==="init"||r==="test"||r==="build"||r==="start":false;case "elixir":return r==="init"&&s(a.join(e,"mix.exs"));case "deno":return s(a.join(e,"deno.json"))||s(a.join(e,"deno.jsonc"))?r==="init"||r==="dev"||r==="test"||r==="start":r==="init"&&s(a.join(e,"package.json"));case "bun":return s(a.join(e,"bunfig.toml"))||s(a.join(e,"bun.lock"))?r==="init"||r==="dev"||r==="test"||r==="build"||r==="start":r==="init"&&s(a.join(e,"package.json"));default:return false}}function Ke(e){try{let t=JSON.parse(b(a.join(e,"composer.json")));return new Set(Object.keys(t.scripts??{}))}catch{return new Set}}function Be(e,t){if(!s(a.join(e,"composer.json")))return false;let r=Ke(e),n=s(a.join(e,"artisan"));switch(t){case "init":return true;case "dev":return n||r.has("dev");case "start":return n||r.has("start");case "test":return n||r.has("test");case "build":return r.has("build");case "lint":return r.has("lint")||r.has("analyse")||r.has("analyze");case "format":return r.has("format")||r.has("fmt")||s(a.join(e,"pint.json"))||s(a.join(e,"vendor","bin","pint"));default:return false}}function Ge(e,t){return s(a.join(e,"Cargo.toml"))?t==="init"||t==="dev"||t==="start"||t==="build"||t==="test"||t==="lint"||t==="format":false}function L(e,t,r,n){if(A(t,r))return le(e,r);if(!w(t))return Ie(e,t,r);switch(t){case "node":return Te(e,r,n);case "python":return le(e,r);case "go":return Le(e,r);case "java":return De(e,r);case "dotnet":return Oe(e,r);case "rust":return Ge(e,r);case "php":return Be(e,r);default:return false}}function Ue(e,t,r){return ["init","dev","start","build","test","lint","format"].filter(i=>L(e,t,i,r))}function pe(e){let t=re({runtime:e.runtime,moduleSupport:e.moduleSupport});if(!e.projectPath)return t;let r=Ue(e.projectPath,e.runtime,e.framework),n=new Set(["help"]);for(let c of r)t.lifecycleCommands.includes(c)&&n.add(c);e.runtime==="node"&&W(e.projectPath)&&n.add("init");let i=[...n].sort();return {lifecycleCommands:i,moduleCommands:t.moduleCommands,unsupportedLifecycleCommands:t.lifecycleCommands.filter(c=>!i.includes(c)).sort()}}var q=["version","commands","doctor","project","help"],P=["init","dev","start","build","test","lint","format"],Y=["add","modules","upgrade","diff","merge","reconcile","rollback","uninstall","checkpoint","snapshot","optimize"],H=["create","list","info","frameworks","license"];q.filter(e=>e!=="help");function $e(e){let t$1=a.resolve(e);for(;;){if([...t(t$1,"project.json"),...t(t$1,"context.json")].some(i=>B.existsSync(i)))return t$1;let n=a.dirname(t$1);if(n===t$1)break;t$1=n;}return null}function N(e,t){return {command:e,...t}}var Je=new Set(["dev","lint","format"]),qe=new Set(G);function Ye(e,t){return t?qe.has(e)?{executionScope:"fleet",fleetEligible:true}:Je.has(e)?{executionScope:"local-only",fleetEligible:false}:{executionScope:"local-only",fleetEligible:false}:{executionScope:"local-only",fleetEligible:false}}function He(e,t){return A(t.runtime,e)?"core":"runtime"}function ze(e,t,r,n){return !e||!n.lifecycleCommands.includes(t)?false:L(e,r.runtime,t,r.key)}function Ve(e,t){let r=!!e&&(t.runtime==="python"||w(t.runtime)&&L(e,t.runtime,"build",t.key));return N("docs",{owner:t.runtime==="python"?"core":"runtime",status:r?"supported":"unsupported",reason:r?t.runtime==="python"?"Documentation generation is delegated to Python Core for this project.":"Project documentation commands are available through the npm wrapper for this runtime.":"Documentation commands require a supported Python or npm-executor project manifest."})}function Xe(e){let t=a.resolve(e),r=$e(e);return r||(h(t).length>0?t:null)}function Qe(e=process.cwd()){let t=Xe(e),r=t?ae(t):null,n=r?.detection??j(e,r?.projectJson??null),i$1=r?.moduleSupport??false,c=r?.engine??"unknown",C=de(n.runtime),S=x(n.runtime),fe=t?i(t):[],h=[n.runtime,...fe.filter(o=>o!==n.runtime)].filter((o,d,E)=>o!=="unknown"&&E.indexOf(o)===d);h.length===0&&h.push("unknown");let D=h.filter(o=>o!=="unknown").length>1,ge=pe({runtime:n.runtime,moduleSupport:i$1,projectPath:t??void 0,framework:n.key}),g={};for(let o of q)g[o]=N(o,{owner:o==="project"?"core":"npm",status:"supported",reason:o==="project"?"Project detection is a Core contract; workspace project lifecycle remains npm-owned.":o==="help"?"Help is available for every Workspai project through the npm CLI.":"Universal command available across Workspai project types."});for(let o of P){let d=ze(t,o,n,ge),E=He(o,n),O=Ye(o,d);g[o]=N(o,{owner:E,status:d?"supported":"unsupported",executionScope:O.executionScope,fleetEligible:O.fleetEligible,reason:d?E==="core"?`Delegated to Python Core for ${n.displayName} projects.`:O.fleetEligible?`Handled by runtime adapter and eligible for workspace fleet stages (${o}).`:o==="dev"?"Local development command only; workspace fleet excludes dev by design.":n.runtime==="node"?`Handled by npm/pnpm/yarn via the resolved ${o} script in package.json.`:`Handled by the ${C?.displayName??n.displayName} runtime adapter for local project execution.`:t?n.runtime==="node"?`No ${o} script was found in package.json for this ${n.displayName} project.`:w(n.runtime)?`The ${n.displayName} runtime is tracked, but ${o} is not available from detected project manifests.`:`${n.displayName} is tracked as an observed runtime; ${o} requires project manifests or explicit scripts.`:"No Workspai project was detected."});}if(D)for(let o of P){let d=g[o];d&&(d.reason=`Composite runtime boundary detected (${h.join(", ")}). This capability describes only the primary ${n.runtime} adapter; nested runtime lifecycle coverage requires explicit project boundaries or command contracts. ${d.reason??""}`.trim());}g.docs=Ve(t,n);for(let o of Y)g[o]=N(o,{owner:i$1?"core":"none",status:i$1?"supported":"unsupported",reason:i$1?"Core module/template command supported for this project.":`Core module/template commands are not available for ${n.displayName} projects.`});for(let o of H)g[o]=N(o,{owner:o==="create"?"npm":"core",status:"global",reason:o==="create"?"Create is orchestrated by npm for multi-language workspace support.":"Engine catalog command; not specific to the selected project runtime."});let R=Object.values(g),z=R.filter(o=>P.includes(o.command)).filter(o=>o.status==="supported"),ye=G.filter(o=>z.some(d=>d.fleetEligible===true&&d.command===o)),be=z.filter(o=>o.executionScope==="local-only").map(o=>o.command).sort();return {schemaVersion:1,scope:"project",projectRoot:t,engine:c,runtime:n.runtime,runtimeCandidates:h,compositeRuntime:D,lifecycleCoverage:D?"primary-runtime-only":"complete",framework:n.key,frameworkDisplayName:n.displayName,frameworkConfidence:n.confidence,frameworkSupportTier:te(n.key),runtimeSupportTier:S.tier,runtimeDoctorSupport:S.doctorSupport,moduleSupport:i$1,fleetStages:ye,localOnlyCommands:be,commandMap:g,supportedCommands:R.filter(o=>o.status==="supported").map(o=>o.command).sort(),unsupportedCommands:R.filter(o=>o.status==="unsupported").map(o=>o.command).sort(),globalCommands:R.filter(o=>o.status==="global").map(o=>o.command).sort()}}function pr(e,t=process.cwd()){let r=e[0];return r?Qe(t).commandMap[r]??null:null}function ur(e){if(e[0]==="project"&&e[1]==="commands")return true;if(e[0]==="commands"&&e.includes("--scope")){let t=e.indexOf("--scope");return e[t+1]==="project"}return e.some(t=>t==="--scope=project")&&e[0]==="commands"}function fr(e,t){return [`Workspai command not supported for this project: ${e.command}`,"",`Project: ${t.projectRoot??"not detected"}`,`Runtime: ${t.runtime}`,`Framework: ${t.frameworkDisplayName}`,`Reason: ${e.reason??"Unsupported for this project type."}`,"","Run `workspai project commands` to inspect supported commands for this project."].join(`
|
|
2
|
+
`)}export{_ as a,Ze as b,et as c,tt as d,rt as e,x as f,te as g,w as h,ie as i,ft as j,gt as k,yt as l,bt as m,Ct as n,Rt as o,ae as p,Ee as q,_t as r,At as s,me as t,pe as u,$e as v,Qe as w,pr as x,ur as y,fr as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function i(s){return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function b(s){return Array.isArray(s)?s.map(i).filter(o=>o!==null):[]}function l(s){return typeof s=="number"&&Number.isInteger(s)&&s>=0?s:0}function C(s){return typeof s=="number"&&Number.isFinite(s)&&s>=0&&s<=100?s:null}function j(s){let o=b(s.projects),d=i(s.summary),g=i(s.healthScore),e=i(s.evidenceFreshness),m=i(s.contract),r=0,a=0,p=0,n=0,t=[],c=0;for(let h of o){let F=i(h.diagnosis),f=i(F?.coverage);if(!F||!f)continue;c+=1,r+=l(f.blockingFindings),a+=l(f.advisoryFindings),p+=l(f.unknownFindings),n+=l(f.contradictionCount);let k=C(f.diagnosisCompleteness);k!==null&&t.push(k);}let u=c>0||m?.scoringPolicyVersion==="doctor-score-policy-v2",y=u&&(o.length===0||c===o.length);return y||(r=Math.max(r,l(d?.blockingFindings),l(g?.errors)),a=Math.max(a,l(d?.advisoryFindings),l(g?.warnings))),{canonical:y,projectCount:o.length,diagnosedProjectCount:c,missingDiagnosisProjects:u?Math.max(0,o.length-c):0,blockingFindings:r,advisoryFindings:a,unknownFindings:p,contradictionCount:n,minimumDiagnosisCompleteness:t.length>0?Math.min(...t):o.length===0||!u?100:0,staleEvidence:e?.status==="stale",unknownFreshness:e?.status==="unknown",hasSystemErrors:d?.hasSystemErrors===true||l(g?.errors)>r}}function v(s){let o=b(s.projects),d=0,g=0,e=0,m=0,r=0,a=0,p=0;for(let n of o){n.depsInstalled===false&&(m+=1),p+=l(n.vulnerabilities);let t=i(n.dependencyAudit);t?.status==="tool-unavailable"||t?.status==="unsupported"?r+=1:t?.status==="failed"&&(a+=1);let c=i(n.diagnosis);for(let u of b(c?.findings))u.issueClass!=="dependency"&&u.issueClass!=="security"||(u.status==="blocking"?d+=1:u.status==="advisory"&&(g+=1),(u.status==="unknown"||u.diagnosisState==="unknown")&&(e+=1));}return {blockingFindings:d,advisoryFindings:g,unknownFindings:e,missingDependencies:m,auditUnavailable:r,auditFailed:a,vulnerableDependencies:p}}function A(s){let o=[],d=i(s.project),g=b(s.projects);d&&g.push(d);for(let e of g){let m=typeof e.name=="string"?e.name:"project",r=i(e.diagnosis),a=b(r?.findings);if(a.length>0){for(let n of a){let t=n.status;if(!["blocking","advisory","unknown"].includes(String(t)))continue;let c=typeof n.symptom=="string"?n.symptom.trim():typeof n.label=="string"?n.label.trim():"";c&&o.push({projectName:m,status:t,message:c,...typeof n.id=="string"?{id:n.id}:{},...typeof n.causalKey=="string"?{causalKey:n.causalKey}:{},...typeof n.issueClass=="string"?{issueClass:n.issueClass}:{}});}continue}let p=Array.isArray(e.issues)?e.issues.filter(n=>typeof n=="string"):[];for(let n of p)o.push({projectName:m,status:"blocking",message:n.trim()});for(let n of b(e.probes)){if(n.status!=="fail"&&n.status!=="warn")continue;let t=typeof n.reason=="string"?n.reason.trim():typeof n.label=="string"?n.label.trim():"";t&&o.push({projectName:m,status:n.status==="fail"?"blocking":"advisory",message:t,...typeof n.id=="string"?{id:n.id}:{}});}}return [...new Map(o.map(e=>[`${e.projectName}:${e.causalKey??e.id??""}:${e.status}:${e.message}`,e])).values()]}export{j as a,v as b,A as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {h}from'./chunk-5EPPPMAS.js';var i=h.doctorFixResult.schemaVersion,n="npx workspai workspace verify --from-impact .workspai/reports/workspace-impact-last-run.json --json";function a(t){return {schemaVersion:i,generatedAt:new Date().toISOString(),appliedFixes:t.appliedFixes,remainingBlockers:t.remainingBlockers,verifyRecommended:t.verifyRecommended??n}}var g="workspai.doctor-summary.v1";var m="doctor-graph-diagnosis.v1";export{i as a,n as b,a as c,m as d,g as e};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-D4RST2HE.js';import {b as b$1}from'./chunk-AO2ZI42U.js';import {a,e,b}from'./chunk-ADL3CK44.js';import {i,h}from'./chunk-5EPPPMAS.js';import w from'path';import {existsSync}from'fs';import Z from'fs-extra';var G=[{artifactKind:"bootstrap-compliance",cardId:"bootstrap",fileNames:["bootstrap-compliance.latest.json"]},{artifactKind:"doctor-workspace",cardId:"doctor",fileNames:["doctor-remediation-plan-last-run.json","doctor-last-run.json"]},{artifactKind:"analyze",cardId:"analyze",fileNames:["analyze-last-run.json"]},{artifactKind:"readiness",cardId:"readiness",fileNames:["release-readiness-last-run.json"]},{artifactKind:"pipeline",cardId:"pipeline",fileNames:["pipeline-last-run.json"]},{artifactKind:"workspace-run",cardId:"workspaceRun",fileNames:["workspace-run-last.json"]},{artifactKind:"workspace-verify",cardId:"workspaceVerify",fileNames:["workspace-verify-last-run.json"]}];function g(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function A(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0):[]}function I(e){return [...new Set(e.map(r=>r.trim()).filter(Boolean))]}function W(e){return (e.notes.includes("Doctor finding status: blocking")?16:0)+(e.transaction?8:0)+(e.operation?4:0)+(e.invocation?2:0)+(e.strategy?.length?1:0)}function Q(e){let r=W(e.incoming)>W(e.existing),o=structuredClone(r?e.incoming:e.existing),a=r?e.existing:e.incoming,t=a.sourceStepId;return o.order=e.existing.order,o.files=I([...o.files,...a.files]),o.notes=I([...o.notes,...a.notes.filter(i=>!i.startsWith("Source Doctor capability:")&&!i.startsWith("Doctor finding status:")),...t?[`Also satisfies Doctor capability: ${t}`]:[]]),o}function S(e,r,o){return o?r:w.relative(e,r).split(w.sep).join("/")}function X(e){let r=e?.trim()||"npx workspai bootstrap";if(!/(?:^|\s)--ci(?:\s|$)/.test(r)&&/(?:^|\s)--json(?:\s|$)/.test(r))return r.replace(/(?:^|\s)--json(?:\s|$)/,a=>{let t=a.startsWith(" ")?" ":"",i=a.endsWith(" ")?" ":"";return `${t}--ci --json${i}`}).trim();let o=/(?:^|\s)--ci(?:\s|$)/.test(r)?r:`${r} --ci`;return /(?:^|\s)--json(?:\s|$)/.test(o)?o:`${o} --json`}function Y(e){return `${JSON.stringify({schemaVersion:h.compatibilityMatrix.schemaVersion,generatedAt:e,source:"workspai workspace remediation-plan",runtimes:{},notes:["Minimal enterprise baseline. Add runtime and toolchain entries as governance matures."]},null,2)}
|
|
2
|
+
`}function ee(e){return `${JSON.stringify({schema_version:"1.0",enabled:false,strategy:"on-demand",artifacts:[],created_at:e,note:"Minimal enterprise baseline. Set enabled: true and add artifact entries to activate mirroring."},null,2)}
|
|
3
|
+
`}function te(e){let r=e.payload,o=A(r.blockers),a=A(r.blockingReasons),t=A(r.failures),i=A(r.reasons),d=A(r.policyViolations),s=g(r.summary),m=A(s?.blockers);if(e.artifactKind==="analyze"){let c=(Array.isArray(r.findings)?r.findings:[]).map(y=>g(y)).filter(y=>!!y).map(y=>String(y.message??y.title??y.id??"").trim()).filter(Boolean);return I([...o,...c,...a])}if(e.artifactKind==="workspace-run"){let b=g(r.stages),c=Object.entries(b??{}).flatMap(([y,f])=>{let n=g(f);return (Array.isArray(n?.projects)?n.projects:[]).map(l=>g(l)).filter(l=>!!l).filter(l=>l.status==="failed"||l.ok===false).map(l=>`${y}: ${String(l.project??l.name??"project")} failed`)});return I([...o,...c,...a])}return I([...o,...a,...t,...i,...d,...m])}function R(e){let r=e.findingId?.trim()||e.sourceStepId?.trim()||e.id,o=e.findingStatus??"blocking",a=e.causalKey?.trim()||[e.cardId,e.projectName??e.scope??"workspace",r].map(t=>String(t).trim().toLowerCase()).join(":");return {id:e.id,artifactKind:e.artifactKind,cardId:e.cardId,title:e.title,order:e.order,phase:e.phase,scope:e.scope??"workspace",...e.projectName?{projectName:e.projectName}:{},...e.projectPath?{projectPath:e.projectPath}:{},...e.sourceStepId?{sourceStepId:e.sourceStepId}:{},findingId:r,findingStatus:o,causalKey:a,...e.dependsOn?{dependsOn:e.dependsOn}:{},...e.strategy?{strategy:structuredClone(e.strategy)}:{},...e.transaction?{transaction:structuredClone(e.transaction)}:{},status:e.status??"ready",mode:e.mode,risk:e.risk,requiresApproval:true,blocker:e.blocker,summary:e.summary,...e.command?{command:e.command}:{},...e.invocation?{invocation:structuredClone(e.invocation)}:{},verifyCommand:e.verifyCommand,cwd:e.cwd??"workspace",files:e.files??[],...e.operation?{operation:e.operation}:{},rollback:e.rollback??(e.operation?{available:true,strategy:"idempotent"}:{available:false,strategy:"none"}),notes:e.notes??[]}}function re(e){return (Array.isArray(e.report.payload.steps)?e.report.payload.steps:[]).flatMap((o,a)=>{let t=g(o),i=typeof t?.id=="string"?t.id.trim():"",d=typeof t?.projectName=="string"?t.projectName.trim():"",s=typeof t?.projectPath=="string"?t.projectPath.trim():"",m=typeof t?.originalCommand=="string"?t.originalCommand.trim():"";if(!t||!i||!d||!s)return [];let b=g(t.studioStatus),c=b?.state==="ready"||b?.state==="review-required"||b?.state==="blocked"||b?.state==="guidance-only"?b.state:"guidance-only",y=t.risk==="safe"||t.risk==="guarded"||t.risk==="invasive"?t.risk:"guarded",f=g(t.preview),n=S(e.workspacePath,s,e.includeAbsolutePaths),u=z({capability:{...t,command:m},absoluteProjectPath:s,includeAbsolutePaths:e.includeAbsolutePaths}),l=q({capability:t,absoluteProjectPath:s,includeAbsolutePaths:e.includeAbsolutePaths}),v=E({operation:t.operation,absoluteProjectPath:s}),k=t.findingStatus==="blocking"||t.findingStatus==="advisory"||t.findingStatus==="informational"?t.findingStatus:"unknown",p=typeof t.diagnosisFindingId=="string"&&t.diagnosisFindingId.trim()?t.diagnosisFindingId.trim():typeof t.issueId=="string"&&t.issueId.trim()?t.issueId.trim():i,h=typeof t.causalKey=="string"&&t.causalKey.trim()?t.causalKey.trim():void 0,C=t.executableInCurrentEnvironment===true&&!!u,$=J({strategy:t.strategy,includeAbsolutePaths:e.includeAbsolutePaths}),j=g(t.transaction),x=j?.schemaVersion==="workspai.doctor-dependency-repair-transaction.v1"?structuredClone(j):void 0;return x&&(x.projectPath=n),[R({id:`doctor.${i}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:typeof f?.title=="string"&&f.title.trim()?f.title.trim():`Repair ${d}`,order:e.startOrder+a,phase:typeof t.phase=="string"?t.phase:"doctor-remediation",blocker:typeof f?.summary=="string"&&f.summary.trim()?f.summary.trim():`Doctor remediation is pending for ${d}.`,summary:typeof f?.summary=="string"&&f.summary.trim()?f.summary.trim():`Execute the CLI-authored Doctor step for ${d}.`,mode:C?"run-command":"manual-guidance",risk:y,status:c,...C&&u?{command:u}:{},...C&&l?{invocation:l}:{},...v?{operation:v}:{},verifyCommand:typeof t.verifyCommand=="string"&&t.verifyCommand.trim()?t.verifyCommand.trim():"npx workspai doctor project --json",files:A(t.files).map(P=>{let O=w.isAbsolute(P)?P:w.resolve(s,P);return S(e.workspacePath,O,e.includeAbsolutePaths)}),notes:[`Source Doctor step: ${i}`,`Doctor finding id: ${p}`,`Doctor finding status: ${k}`,...typeof b?.reason=="string"?[b.reason]:[]],scope:"project",projectName:d,projectPath:n,sourceStepId:i,findingId:p,findingStatus:k,causalKey:h,dependsOn:A(t.dependsOn).map(P=>`doctor.${P}`),strategy:$,transaction:x,cwd:"project",...g(t.rollback)?.available===true?{rollback:{available:true,strategy:"manual"}}:{}})]})}function z(e){let r=typeof e.capability.command=="string"?e.capability.command.trim():"";if(e.includeAbsolutePaths&&r)return r;let o=E({operation:e.capability.operation,absoluteProjectPath:e.absoluteProjectPath});if(o)return b$1(o);let a=g(e.capability.invocation),t=typeof a?.executable=="string"?a.executable.trim():"",i=A(a?.args);if(t)return [t,...i].map(s=>/^[a-zA-Z0-9_./:@=+-]+$/.test(s)?s:JSON.stringify(s)).join(" ");if(!r)return;let d=e.absoluteProjectPath.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return r.replace(new RegExp(`^cd\\s+["']?${d}["']?\\s*&&\\s*`,"i"),"").replaceAll(e.absoluteProjectPath,".")}function q(e){let r=g(e.capability.invocation),o=typeof r?.executable=="string"?r.executable.trim():"",a=A(r?.args);if(!(!o||a.length!==(Array.isArray(r?.args)?r.args.length:0)))return {cwd:e.includeAbsolutePaths?e.absoluteProjectPath:".",executable:o,args:a}}function E(e){let r=g(e.operation);if(!r||typeof r.type!="string")return;let o=structuredClone(r);for(let a of ["path","sourcePath"]){let t=o[a];if(typeof t!="string")continue;let i=w.isAbsolute(t)?w.relative(e.absoluteProjectPath,t):t;if(!i||i===".."||i.startsWith(`..${w.sep}`)||w.isAbsolute(i))return;o[a]=i.split(w.sep).join("/");}return o}function J(e){if(!Array.isArray(e.strategy))return;let r=structuredClone(e.strategy);if(!e.includeAbsolutePaths)for(let o of r)o.invocation&&(o.invocation.cwd=".");return r}function oe(e){let r=Array.isArray(e.report.payload.projects)?e.report.payload.projects:e.report.payload.project?[e.report.payload.project]:[],o=new Set,a=[];for(let t of r){let i=g(t);if(!i)continue;let d=typeof i.name=="string"?i.name.trim():"",s=typeof i.path=="string"?i.path.trim():"";if(!d||!s)continue;let m=Array.isArray(i.repairCapabilities)?i.repairCapabilities:Array.isArray(i.probes)?i.probes.map(f=>g(f)?.repairCapability).filter(f=>f!==void 0):[],b=new Map,c=new Map,y=g(i.diagnosis);for(let f of Array.isArray(y?.findings)?y.findings:[]){let n=g(f),u=g(n?.repair),l=typeof u?.capabilityId=="string"?u.capabilityId.trim():"",v=typeof n?.id=="string"?n.id.trim():"",k=typeof n?.causalKey=="string"?n.causalKey.trim():"",p=n?.status==="blocking"||n?.status==="advisory"||n?.status==="informational"||n?.status==="unknown"?n.status:"unknown";l&&v&&k&&c.set(l,{findingId:v,causalKey:k,findingStatus:p});}for(let f of Array.isArray(i.probes)?i.probes:[]){let n=g(f),u=g(n?.repairCapability),l=typeof u?.id=="string"?u.id.trim():"";l&&b.set(l,n?.status==="fail"?"blocking":"advisory");}for(let f of m){let n=g(f),u=typeof n?.id=="string"?n.id.trim():"";if(!n||!u)continue;let l=`${d}:${u}`;if(o.has(l))continue;o.add(l);let v=n.risk==="safe"||n.risk==="guarded"||n.risk==="invasive"?n.risk:"guarded",k=z({capability:n,absoluteProjectPath:s,includeAbsolutePaths:e.includeAbsolutePaths}),p=q({capability:n,absoluteProjectPath:s,includeAbsolutePaths:e.includeAbsolutePaths}),h=E({operation:n.operation,absoluteProjectPath:s}),C=n.status==="available"&&!!k,$=g(n.transaction),j=$?.schemaVersion==="workspai.doctor-dependency-repair-transaction.v1"?structuredClone($):void 0,x=c.get(u),P=x?.findingStatus??b.get(u)??(j?"blocking":"advisory");j&&(j.projectPath=S(e.workspacePath,s,e.includeAbsolutePaths));let O=J({strategy:n.strategy,includeAbsolutePaths:e.includeAbsolutePaths}),U=A(n.files).map(K=>S(e.workspacePath,K,e.includeAbsolutePaths)),T=R({id:`doctor.${d}.${u}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:typeof n.title=="string"&&n.title.trim()?n.title.trim():`Repair ${d}`,order:e.startOrder+a.length,phase:j?"dependency-remediation":"doctor-remediation",blocker:typeof n.reason=="string"&&n.reason.trim()?n.reason.trim():`Doctor remediation is pending for ${d}.`,summary:typeof n.reason=="string"&&n.reason.trim()?n.reason.trim():`Execute the Doctor-authored repair capability for ${d}.`,mode:C?n.canEditFiles===true?"edit-file":"run-command":"manual-guidance",risk:v,status:C?"ready":n.status==="manual"?"guidance-only":"blocked",...k?{command:k}:{},...p?{invocation:p}:{},verifyCommand:typeof n.verifyCommand=="string"&&n.verifyCommand.trim()?n.verifyCommand.trim():"npx workspai doctor project --json",files:U,notes:[`Source Doctor capability: ${u}`,`Doctor finding status: ${P}`,...A(n.limitations)],scope:"project",projectName:d,projectPath:S(e.workspacePath,s,e.includeAbsolutePaths),sourceStepId:u,findingId:x?.findingId??(typeof n.issueId=="string"&&n.issueId.trim()?n.issueId.trim():u),findingStatus:P,causalKey:x?.causalKey,strategy:O,transaction:j,cwd:"project",...h?{operation:h,rollback:{available:true,strategy:"manual"}}:{}}),M=k?a.findIndex(K=>K.projectName===d&&K.command===k&&K.cwd==="project"):-1;if(M>=0){a[M]=Q({existing:a[M],incoming:T});continue}a.push(T);}}return a}function ie(e){let r=[],o=X("npx workspai bootstrap --json");for(let a of e.blockers)a.includes("profile.enterprise.ci")&&r.push(R({id:"bootstrap.enterprise-ci",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Run bootstrap in deterministic CI mode",order:10,phase:"bootstrap-preflight",blocker:a,summary:"Enterprise bootstrap compliance requires --ci for deterministic execution.",mode:"run-command",risk:"safe",command:o,verifyCommand:o})),a.includes("profile.enterprise.compatibility-matrix")&&r.push(R({id:"bootstrap.compatibility-matrix",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Create enterprise compatibility matrix baseline",order:20,phase:"bootstrap-config",blocker:a,summary:"Create the missing compatibility matrix baseline without overwriting user data.",mode:"edit-file",risk:"safe",verifyCommand:o,files:[i.compatibilityMatrix],operation:{type:"file-create",path:i.compatibilityMatrix,content:Y(e.generatedAt),overwrite:false}})),a.includes("profile.enterprise.mirror-config")&&r.push(R({id:"bootstrap.mirror-config",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Create enterprise mirror config baseline",order:30,phase:"bootstrap-config",blocker:a,summary:"Create the missing mirror configuration baseline without enabling mirroring.",mode:"edit-file",risk:"safe",verifyCommand:o,files:[".workspai/mirror-config.json"],operation:{type:"file-create",path:".workspai/mirror-config.json",content:ee(e.generatedAt),overwrite:false}}));return r}function ae(e){let r=Array.isArray(e.report.payload.steps)?e.report.payload.steps:[],o=[],a=new Map;for(let t of r){let i=g(t),d=g(i?.command),s=typeof i?.id=="string"?i.id.trim():"",m=typeof i?.project=="string"?i.project.trim():"",b=typeof i?.status=="string"?i.status:"",c=typeof d?.display=="string"?d.display.trim():"",y=i?.required===true;if(!s.startsWith("project.")||!m||!y||b!=="fail"&&b!=="missing"||!/^npx\s+workspai\s+workspace\s+run\s+/i.test(c))continue;let f=s.split(".").at(-1)??"stage",n=`workspaceVerify.${s}`,u=a.get(m),l=/(?:^|\s)--no-gates(?:\s|$)/.test(c)?c:`${c} --no-gates`;o.push(R({id:n,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:typeof i.label=="string"&&i.label.trim()?i.label.trim():`Run ${f} for ${m}`,order:e.startOrder+o.length,phase:"fleet-run",blocker:typeof i.message=="string"&&i.message.trim()?i.message.trim():`${f} evidence is not current for ${m}.`,summary:`Produce fresh ${f} evidence for ${m} without re-entering the blocked aggregate gates.`,mode:"run-command",risk:f==="start"?"guarded":"safe",status:"ready",command:l,verifyCommand:e.ciMode?"npx workspai workspace verify --strict --json":"npx workspai workspace verify --json",scope:"project",projectName:m,projectPath:m,sourceStepId:s,...u?{dependsOn:[u]}:{},cwd:"workspace",notes:[`Source Workspace Verify step: ${s}`,"Aggregate verification must run only after this project evidence producer completes."]})),a.set(m,n);}return o}function ne(e){let r=I(e.blockers.flatMap(a=>{let t=a.match(/(?:project runtimes?|workspace)\s*\(([^)]+)\)\s+(?:is|are) not pinned/i);return t?.[1]?t[1].split(",").map(i=>i.trim().toLowerCase()).filter(i=>/^(python|node|go|java|dotnet|rust|php)$/.test(i)):[]})),o=[];for(let a of r){let t=`readiness.toolchain.${a}.setup`,i=e.blockers.find(d=>d.toLowerCase().includes(`(${a})`))??`The ${a} runtime is not pinned in the canonical workspace toolchain.`;o.push(R({id:t,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:`Pin ${a} in the workspace toolchain`,order:e.startOrder+o.length,phase:"toolchain-reconciliation",blocker:i,summary:`Detect and persist the current ${a} runtime in the canonical workspace toolchain lock.`,mode:"run-command",risk:"safe",command:`npx workspai setup ${a} --json`,verifyCommand:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",notes:["Run from the workspace root so the canonical toolchain.lock is updated."]})),o.push(R({id:`readiness.toolchain.${a}.bootstrap`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:`Reconcile the ${a} workspace foundation`,order:e.startOrder+o.length,phase:"toolchain-reconciliation",blocker:`The ${a} runtime pin must be reconciled with the workspace foundation.`,summary:"Refresh the workspace foundation after the runtime pin is written.",mode:"run-command",risk:"guarded",command:"npx workspai bootstrap --ci --json",verifyCommand:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",dependsOn:[t]}));}return o}function se(e){if(e.report.artifactKind==="readiness"&&/dependenc(?:y|ies).*vulnerabil|vulnerabil.*dependenc(?:y|ies)|security audit/i.test(e.blocker))return R({id:`${e.report.cardId}.doctor-owner.${e.order}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:"Resolve dependency vulnerability through Doctor",order:e.order,phase:"dependency-remediation",blocker:e.blocker,summary:"Release Readiness is the aggregate gate; use the project-scoped Doctor remediation capability that owns this dependency failure.",mode:"verify-before-fix",risk:"guarded",status:"review-required",command:"npx workspai doctor workspace --plan --json",verifyCommand:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",notes:["Read doctor-remediation-plan-last-run.json and execute the matching surface-security-hygiene capability before rerunning Readiness.","Do not treat a Readiness refresh as remediation for a source dependency vulnerability."]});let o={analyze:{title:"Refresh analyze evidence",phase:"analysis",command:"npx workspai analyze --strict --json",verify:"npx workspai analyze --strict --json"},readiness:{title:"Refresh release readiness",phase:"release-readiness",command:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",verify:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json"},pipeline:{title:"Rerun governance pipeline",phase:"governance-pipeline",command:"npx workspai pipeline --json --strict",verify:"npx workspai pipeline --json --strict"},"workspace-run":{title:"Rerun failed workspace stage",phase:"fleet-run",command:e.ciMode?"npx workspai workspace run test --strict --json":"npx workspai workspace run test --json",verify:e.ciMode?"npx workspai workspace run test --strict --json":"npx workspai workspace run test --json"},"workspace-verify":{title:"Refresh workspace verify gate",phase:"verification",command:e.ciMode?"npx workspai workspace verify --strict --json":"npx workspai workspace verify --json",verify:e.ciMode?"npx workspai workspace verify --strict --json":"npx workspai workspace verify --json"},"doctor-workspace":{title:"Use Doctor remediation plan",phase:"doctor-remediation",command:"npx workspai doctor workspace --plan --json",verify:"npx workspai doctor workspace --json"}}[e.report.artifactKind]??{title:"Refresh artifact evidence",phase:"evidence-refresh",command:"npx workspai pipeline --json --strict",verify:"npx workspai pipeline --json --strict"};return R({id:`${e.report.cardId}.refresh.${e.order}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:o.title,order:e.order,phase:o.phase,blocker:e.blocker,summary:"No deterministic file operation is available for this artifact yet; refresh the evidence and continue with the card-specific plan.",mode:e.report.artifactKind==="doctor-workspace"?"verify-before-fix":"run-command",risk:"guarded",status:e.report.artifactKind==="doctor-workspace"?"review-required":"ready",command:o.command,verifyCommand:o.verify,notes:e.report.artifactKind==="doctor-workspace"?["Read doctor-remediation-plan-last-run.json for ordered file-level steps."]:[]})}async function ce(e){let r=[a(e,".workspai/reports"),b(e,".workspai/reports")],o=[],a$1=new Set;for(let t of G)for(let i of t.fileNames){let d=(await Promise.all(r.map(s=>w.join(s,i)))).find(s=>existsSync(s));if(!(!d||a$1.has(`${t.artifactKind}:${i}`))){a$1.add(`${t.artifactKind}:${i}`);try{let s=await Z.readJSON(d),m=g(s);if(!m)continue;o.push({artifactKind:t.artifactKind,cardId:t.cardId,fileName:i,absolutePath:d,payload:m});break}catch{o.push({artifactKind:t.artifactKind,cardId:t.cardId,fileName:i,absolutePath:d,payload:{blockers:[`${t.artifactKind}: report exists but could not be parsed.`]}});break}}}return o}async function ke(e){let r=w.resolve(e.workspacePath),o=e.includeAbsolutePaths===true,a$2=e.ciMode===true,t=new Date().toISOString(),i=a(r,".workspai/reports"),d=await ce(r),s=[],m=1;for(let c of d){if(c.artifactKind==="doctor-workspace"){let p=Array.isArray(c.payload.steps)?re({report:c,workspacePath:r,includeAbsolutePaths:o,startOrder:m}):oe({report:c,workspacePath:r,includeAbsolutePaths:o,startOrder:m});s.push(...p),m+=p.length;continue}let y=te(c);if(y.length===0)continue;if(c.artifactKind==="bootstrap-compliance"){s.push(...ie({blockers:y,generatedAt:t})),m=s.length+1;continue}if(c.artifactKind==="workspace-verify"){let p=ae({report:c,startOrder:m,ciMode:a$2});if(p.length>0){s.push(...p),m+=p.length;continue}}if(c.artifactKind==="readiness"){let p=ne({report:c,blockers:y,startOrder:m,ciMode:a$2});if(p.length>0){s.push(...p),m+=p.length;continue}}let f=s.some(p=>p.transaction?.kind==="dependency-security"),n=c.artifactKind==="readiness"&&y.some(p=>/dependenc(?:y|ies).*vulnerabil|vulnerabil.*dependenc(?:y|ies)|security audit/i.test(p));if(f&&n)continue;let u=y[0],l=se({report:c,blocker:u,order:m,ciMode:a$2}),k={readiness:new Set(["bootstrap","doctor"]),pipeline:new Set(["bootstrap","doctor","analyze","readiness"]),workspaceVerify:new Set(["bootstrap","doctor","readiness","workspaceRun"])}[c.cardId];if(c.cardId==="pipeline"){let p=["doctor","analyze","readiness"].find(h=>u.toLowerCase().includes(h));p&&(k=new Set([p]));}if(k){let p=s.filter(h=>k.has(h.cardId)&&h.risk!=="invasive"&&h.status!=="blocked"&&h.status!=="guidance-only").map(h=>h.id);p.length>0&&(l.dependsOn=I([...l.dependsOn??[],...p]),l.notes.push("This aggregate gate must run after its contract-owned upstream remediation actions."));}y.length>1&&l.notes.push(...y.slice(1,8).map(p=>`Related blocker: ${p}`)),s.push(l),m+=1;}let b={safe:s.filter(c=>c.risk==="safe").length,guarded:s.filter(c=>c.risk==="guarded").length,invasive:s.filter(c=>c.risk==="invasive").length};return {schemaVersion:a$1,generatedAt:t,workspace:{name:w.basename(r),...o?{path:r}:{}},source:{command:"workspace remediation-plan",reportsDir:S(r,i,o),includeAbsolutePaths:o,ciMode:a$2},summary:{artifactsScanned:d.length,cardsCovered:I(s.map(c=>c.cardId)).length,totalActions:s.length,executableActions:s.filter(c=>c.status==="ready").length,risk:b},actions:s}}async function he(e$1,r){return e(r,i.artifactRemediationPlan,e$1)}export{ke as a,he as b};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {f as f$1,e as e$1}from'./chunk-T3GJ7YVG.js';import {a,b}from'./chunk-W5ZFXKSL.js';import {a as a$1}from'./chunk-27UR373Z.js';import {a as a$2}from'./chunk-T5YRFRJV.js';import {h,j as j$1}from'./chunk-ZCPT6KC3.js';import {e as e$2}from'./chunk-ADL3CK44.js';import {e,f}from'./chunk-5EPPPMAS.js';import {j,s,t}from'./chunk-MOSXTVPU.js';import w from'fs';import c from'path';import i from'chalk';var L=new Set([".git",".workspai",".rapidkit",".venv","node_modules","dist","build","target","coverage","htmlcov",".next"]);async function D(e){try{return await w.promises.access(e,w.constants.F_OK),true}catch{return false}}async function z(e){try{let t=JSON.parse(await w.promises.readFile(e,"utf-8"));return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}async function K(e){try{return await w.promises.readFile(e,"utf-8")}catch{return ""}}function B(e){return a(e)}async function U(e,t$1){return await M([...t(e,"project.json"),...t(e,"context.json")])?true:b(e)?false:c.resolve(e)===c.resolve(t$1)?h(e).length>0:h(e).length>0}async function V(e){let t=await a$1(e,{skipDirs:L,includeHiddenDirs:false,descendIntoMatchedProjects:false,isProjectDir:U}),r=(await a$2(e)).filter(o=>o.relationship==="adopted"||o.source==="adopted-local").map(o=>c.resolve(o.path)).filter(o=>w.existsSync(o)),s=[...new Set([...t.map(o=>c.resolve(o)),...r])];return s.length>0?s:b(e)?[]:h(e).length>0?[e]:[]}function q(e,t){return c.relative(e,t).replace(/\\/g,"/")||"."}async function A(e,t){for(let n of t)if(await D(c.join(e,n)))return true;return false}async function M(e){for(let t of e)if(await D(t))return true;return false}async function Q(e){if(await A(e,[".gitlab-ci.yml",".circleci/config.yml","azure-pipelines.yml","bitbucket-pipelines.yml","cloudbuild.yaml"]))return true;try{return (await w.promises.readdir(c.join(e,".github","workflows"),{withFileTypes:true})).some(n=>n.isFile()&&/\.(?:ya?ml)$/i.test(n.name)&&!n.name.startsWith("."))}catch{return false}}async function O(e){for(let t of e){let n=await z(t);if(n)return n}return null}async function X(e){return A(e,["health","health.ts","health.js","health.py","health.go","health.kt","health.rb","health.php","healthcheck","health-check","src/health.ts","src/health.js","src/health.py","src/health.go","src/health.kt","src/health.rb","src/health.php","src/healthcheck.ts","src/healthcheck.js","src/liveness.ts","src/readiness.ts","src/ping.ts"])}async function Y(e){if(await A(e,["tests","test","__tests__","src/__tests__","pytest.ini","vitest.config.ts","jest.config.ts"]))return true;let n=await z(c.join(e,"package.json")),r=n?.scripts&&typeof n.scripts=="object"?n.scripts:{};return typeof r.test=="string"&&r.test.trim().length>0}async function Z(e){let t=await z(c.join(e,"package.json")),n=t?.scripts&&typeof t.scripts=="object"?t.scripts:{};return Object.keys(n).sort()}function g(e,t,n,r,s,o){return {id:e,severity:t,target:n,title:r,detail:s,remediation:o}}function ee(e){let t=e.reduce((n,r)=>r.severity==="fail"?n+28:r.severity==="warn"?n+12:n+3,0);return Math.max(0,100-t)}async function ne(e,t$1){let n=await O(t(t$1,"project.json")),r=j$1(t$1,n),s=h(t$1),o=r.runtime==="unknown"?s[0]||"unknown":r.runtime,a=q(e,t$1),p=a,u=await Z(t$1),f=await M([...t(t$1,"project.json"),...t(t$1,"context.json")]),l=await Y(t$1),h$1=await A(t$1,["Dockerfile","dockerfile"]),k=await A(t$1,[".env.example","env.example","config/env.example"]),P=await Q(t$1),C=await X(t$1),m=[];return r.key==="unknown"&&m.push(g("project.stack.unknown","fail",p,"Project stack is unknown","Workspai cannot confidently classify this backend project.","Add .workspai/project.json metadata or import the project with `workspai import`.")),f||m.push(g("project.marker.missing","warn",p,"Workspai marker is missing","The project can be detected by files, but it is not registered with Workspai metadata.","Run `workspai import <path>` from a workspace or create the project through Workspai.")),l||m.push(g("project.tests.missing","warn",p,"Test entrypoint is missing","No common test folder, config, or package test script was found.","Add a test command so `workspai workspace run test --affected` can gate changes.")),k||m.push(g("project.env.example.missing","info",p,"Environment example is missing","No .env.example or env.example file was found.","Add an env example for onboarding and CI secret documentation.")),P||m.push(g("project.ci.missing","warn",p,"Continuous integration is missing","No recognized CI/CD configuration file was detected for this project.","Add CI configuration so tests and checks run automatically for every change.")),C||m.push(g("project.health.missing","info",p,"Health or readiness probe is missing","The project has no obvious health or readiness endpoint to support automated deployment and runtime checks.","Add a simple health endpoint and document it for readiness gates and observability.")),h$1||m.push(g("project.container.missing","info",p,"Container recipe is missing","No Dockerfile was found for this project.","Add a Dockerfile when the service is intended for containerized deployment.")),{name:typeof n?.name=="string"&&n.name.trim()?n.name.trim():c.basename(t$1),path:t$1,relativePath:a,runtime:o,framework:r.key,confidence:r.confidence,supportTier:r.supportTier,hasRapidKitMarker:f,hasTests:l,hasDockerfile:h$1,hasEnvExample:k,hasCiConfig:P,hasHealthEndpoint:C,scripts:u,findings:m,score:ee(m)}}function te(e){return e.name.toLowerCase()}async function re(e){let t=new Map(e.map(s=>[te(s),s])),n=[];for(let s of e){let o=await z(c.join(s.path,"package.json")),a={...o?.dependencies??{},...o?.devDependencies??{},...o?.peerDependencies??{}};for(let u of Object.keys(a)){let f=u.replace(/^@[^/]+\//,"").toLowerCase(),l=t.get(f);l&&l.relativePath!==s.relativePath&&n.push({from:s.relativePath,to:l.relativePath,kind:"package"});}let p=await K(c.join(s.path,"pyproject.toml"));for(let u of e)u.relativePath!==s.relativePath&&p.includes(u.name)&&n.push({from:s.relativePath,to:u.relativePath,kind:"workspace-reference"});}let r=new Set;return n.filter(s=>{let o=`${s.from}\0${s.to}\0${s.kind}`;return r.has(o)?false:(r.add(o),true)})}function se(e,t){let n=new Map;for(let r of e)n.set(r.relativePath,{project:r.relativePath,directDependents:0,directDependencies:0});for(let r of t){let s=n.get(r.from),o=n.get(r.to);s&&(s.directDependencies+=1),o&&(o.directDependents+=1);}return Array.from(n.values()).sort((r,s)=>s.directDependents-r.directDependents||s.directDependencies-r.directDependencies)}async function oe(e){let t=await O(s(e,"workspace.json"));return typeof t?.profile=="string"?t.profile:null}function ie(e){return {fail:e.filter(t=>t.severity==="fail").length,warn:e.filter(t=>t.severity==="warn").length,info:e.filter(t=>t.severity==="info").length}}function ae(e){if(e.projectCount===0)return e.workspaceDetected?["Add your first project: npx workspai create project <name> --kit <kit>","Import an existing service: npx workspai import <path>"]:["Create a Workspai workspace: npx workspai create workspace my-workspace --profile polyglot","Import an existing service: npx workspai import ../service"];let t=[];return e.findings.some(n=>n.id==="workspace.marker.missing")&&t.push("Initialize workspace metadata with `workspai bootstrap --profile polyglot`."),e.findings.some(n=>n.id==="project.marker.missing")&&t.push("Register detected projects with `workspai import <path>` or recreate them via `workspai create project`."),e.findings.some(n=>n.id==="project.tests.missing")&&t.push("Add test entrypoints, then gate changes with `workspai workspace run test --affected --strict`."),e.findings.some(n=>n.id==="project.ci.missing")&&t.push("Add CI/CD configuration to catch regressions early and make workspace health checks actionable."),e.findings.some(n=>n.id==="project.health.missing")&&t.push("Add a health/readiness endpoint so runtime probes and deployment checks can verify service health."),e.hasGraph||t.push("Create `.workspai/workspace-dependency-graph.json` or use analyze output as the first graph seed."),t.push("Run `workspai autopilot release --mode audit --json` before release."),Array.from(new Set(t))}async function ve(e$3={}){let t=c.resolve(e$3.workspacePath||process.cwd());if(!await D(t))throw new Error(`Workspace path does not exist: ${t}`);let n=B(t)??t,r=j(n),s=await oe(n),o=await V(n),a=await Promise.all(o.map(d=>ne(n,d))),p=await re(a),u=se(a,p),f$2=[];r||f$2.push(g("workspace.marker.missing","warn",".","Workspace metadata is missing","The directory can be analyzed, but it is not a registered Workspai workspace.","Run `workspai create workspace` or `workspai bootstrap --profile polyglot` in a workspace root.")),a.length===0&&f$2.push(g("workspace.projects.missing","warn",".","No backend projects detected","Workspai did not find runtime markers or project metadata under this root.","Create a project with `workspai create project` or import one with `workspai import <path>`."));let l=[...f$2,...a.flatMap(d=>d.findings)],h=ie(l),k={};for(let d of a)k[d.runtime]=(k[d.runtime]||0)+1;let P=a.length>0?Math.round(a.reduce((d,y)=>d+y.score,0)/a.length):0,C=f$2.reduce((d,y)=>d+(y.severity==="fail"?20:y.severity==="warn"?8:2),0),m=Math.max(0,P-C),J=a.length===0&&h.fail===0&&l.length>0&&l.every(d=>d.id==="workspace.projects.missing"&&d.severity==="warn"),H=h.fail>0||e$3.strict&&h.warn>0&&!J?"blocked":h.warn>0?"needs-attention":"ready",j$1={schemaVersion:f.analyze,generatedAt:new Date().toISOString(),workspacePath:n,workspaceDetected:r,profile:s,summary:{score:m,verdict:H,projectCount:a.length,runtimeCount:Object.keys(k).length,findings:h},runtimes:k,projects:a,dependencyGraph:{status:p.length>0?"generated":"empty",edges:p,topImpactedProjects:u.slice(0,5)},findings:l,nextActions:ae({findings:l,projectCount:a.length,hasGraph:p.length>0,workspaceDetected:r}),enterpriseControls:{jsonReady:true,ciGateCommand:"workspai analyze --json --strict",releaseGateCommand:"workspai autopilot release --mode enforce --json",evidencePath:e.analyze}};if(e$3.output&&(await w.promises.mkdir(c.dirname(c.resolve(e$3.output)),{recursive:true}),await w.promises.writeFile(c.resolve(e$3.output),`${JSON.stringify(j$1,null,2)}
|
|
2
|
+
`)),!e$3.output&&r){let d=f$1(j$1,{commandId:"workspaceAnalyze",exitCode:j$1.summary.verdict==="blocked"?2:j$1.summary.verdict==="needs-attention"?1:0,generatedAt:j$1.generatedAt,blockers:j$1.findings.filter(y=>y.severity==="fail").map(y=>y.title).slice(0,12),runId:e$1()});await e$2(n,e.analyze,d);}return j$1}function be(e){let t=e.summary.verdict==="ready"?i.green:e.summary.verdict==="needs-attention"?i.yellow:i.red;if(console.log(i.bold(`
|
|
3
|
+
Workspai Workspace Analysis
|
|
4
|
+
`)),console.log(i.cyan("Workspace:"),e.workspacePath),console.log(i.cyan("Profile:"),e.profile||"not configured"),console.log(i.cyan("Score:"),`${e.summary.score}/100`),console.log(i.cyan("Verdict:"),t(e.summary.verdict)),console.log(i.gray(`Projects: ${e.summary.projectCount}, runtimes: ${e.summary.runtimeCount}, findings: ${e.summary.findings.fail} fail / ${e.summary.findings.warn} warn / ${e.summary.findings.info} info`)),e.projects.length>0){console.log(i.bold(`
|
|
5
|
+
Projects`));for(let n of e.projects){let r=n.score>=85?i.green("pass"):n.score>=65?i.yellow("watch"):i.red("risk");console.log(` ${n.relativePath} ${i.gray(`${n.runtime}/${n.framework}`)} ${r} ${n.score}/100`);}}if(e.dependencyGraph.status==="generated"&&(console.log(i.bold(`
|
|
6
|
+
Dependency Graph`)),console.log(i.gray(` edges: ${e.dependencyGraph.edges.length}`)),e.dependencyGraph.topImpactedProjects.length>0)){console.log(i.gray(" Top impacted projects:"));for(let n of e.dependencyGraph.topImpactedProjects.slice(0,3))console.log(` ${n.project} (${n.directDependents} dependents, ${n.directDependencies} dependencies)`);}if(e.findings.length>0){console.log(i.bold(`
|
|
7
|
+
Top Findings`));for(let n of e.findings.slice(0,8)){let r=n.severity==="fail"?i.red:n.severity==="warn"?i.yellow:i.gray;console.log(` ${r(n.severity.toUpperCase())} ${n.target}: ${n.title}`),console.log(i.gray(` ${n.remediation}`));}}console.log(i.bold(`
|
|
8
|
+
Next Actions`));for(let n of e.nextActions.slice(0,5))console.log(i.gray(` - ${n}`));console.log();}export{ve as a,be as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f,l}from'./chunk-
|
|
1
|
+
import {f,l}from'./chunk-GXTCU4WF.js';import {a,b}from'./chunk-S5KTATOU.js';function u(r){let s=new Map;for(let n of r.projects)s.has(n.name)||s.set(n.name,f(n));return s}function w(r){let s=u(r),n=l(r)??{nodes:r.projects.map(t=>({id:t.name,path:t.path})),edges:[]},a$1=a(n),o=new Map;for(let t of n.nodes){let e=s.get(t.id)??f({missing:t.id}),l=[...b(a$1,[t.id],{direction:"dependencies"}).keys()].filter(c=>c!==t.id).sort((c,f)=>c.localeCompare(f)).map(c=>({id:c,hash:s.get(c)??"<unknown>"}));o.set(t.id,{id:t.id,ownHash:e,transitiveInputsHash:f({own:e,dependencies:l})});}return o}function y(r,s){if(!s||Object.keys(s).length===0)return {verdict:"unknown",baseline:"none",changed:[],added:[],removed:[]};let n=[],a=[];for(let[e,i]of r.entries())e in s?s[e]!==i.transitiveInputsHash&&n.push(e):a.push(e);let o=[];for(let e of Object.keys(s))r.has(e)||o.push(e);return n.sort((e,i)=>e.localeCompare(i)),a.sort((e,i)=>e.localeCompare(i)),o.sort((e,i)=>e.localeCompare(i)),{verdict:n.length>0||a.length>0||o.length>0?"stale":"fresh",baseline:"recorded",changed:n,added:a,removed:o}}function M(r){let s={};for(let[n,a]of [...r.entries()].sort((o,t)=>o[0].localeCompare(t[0])))s[n]=a.transitiveInputsHash;return s}export{u as a,w as b,y as c,M as d};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import {a}from'./chunk-GR6442P7.js';import o from'fs';import s from'path';var g={nextjs:{key:"nextjs",runtime:"node",displayName:"Next.js",supportTier:"extended",importStack:"nextjs",aliases:["next","nextjs","next.js"],dependencyHints:["next"],scriptHints:["next dev","next build","next start"],fileHints:["next.config.js","next.config.mjs","next.config.ts"]},remix:{key:"remix",runtime:"node",displayName:"Remix",supportTier:"extended",importStack:"remix",aliases:["remix"],dependencyHints:["@remix-run/react","@remix-run/node","@remix-run/dev"],scriptHints:["remix dev","remix vite:dev"],fileHints:["remix.config.js","remix.config.mjs"]},nuxt:{key:"nuxt",runtime:"node",displayName:"Nuxt",supportTier:"extended",importStack:"nuxt",aliases:["nuxt","nuxtjs","nuxt.js"],dependencyHints:["nuxt","nuxt3"],scriptHints:["nuxt dev","nuxt build","nuxi dev","nuxi build"],fileHints:["nuxt.config.js","nuxt.config.ts","nuxt.config.mjs"]},react:{key:"react",runtime:"node",displayName:"React",supportTier:"extended",importStack:"react",aliases:["react"],dependencyHints:["react","react-dom"],scriptHints:["react-scripts start","react-scripts build"],fileHints:[]},vite:{key:"vite",runtime:"node",displayName:"Vite",supportTier:"extended",importStack:"vite",aliases:["vite"],dependencyHints:["vite"],scriptHints:["vite","vite dev","vite build"],fileHints:["vite.config.js","vite.config.ts","vite.config.mjs"]},vue:{key:"vue",runtime:"node",displayName:"Vue",supportTier:"extended",importStack:"vue",aliases:["vue","vuejs","vue.js"],dependencyHints:["vue","@vue/cli-service"],scriptHints:["vue-cli-service serve","vue-cli-service build"],fileHints:["vue.config.js"]},sveltekit:{key:"sveltekit",runtime:"node",displayName:"SvelteKit",supportTier:"extended",importStack:"sveltekit",aliases:["sveltekit","svelte-kit"],dependencyHints:["@sveltejs/kit"],scriptHints:["svelte-kit dev","svelte-kit build"],fileHints:["svelte.config.js"]},svelte:{key:"svelte",runtime:"node",displayName:"Svelte",supportTier:"extended",importStack:"svelte",aliases:["svelte"],dependencyHints:["svelte"],scriptHints:["svelte"],fileHints:[]},angular:{key:"angular",runtime:"node",displayName:"Angular",supportTier:"extended",importStack:"angular",aliases:["angular","@angular/core"],dependencyHints:["@angular/core","@angular/cli"],scriptHints:["ng serve","ng build"],fileHints:["angular.json"]},astro:{key:"astro",runtime:"node",displayName:"Astro",supportTier:"extended",importStack:"astro",aliases:["astro"],dependencyHints:["astro"],scriptHints:["astro dev","astro build"],fileHints:["astro.config.js","astro.config.ts","astro.config.mjs"]},solid:{key:"solid",runtime:"node",displayName:"Solid",supportTier:"extended",importStack:"solid",aliases:["solid","solidjs","solid-js"],dependencyHints:["solid-js"],scriptHints:[],fileHints:[]},unknown:{key:"unknown",runtime:"unknown",displayName:"Unknown frontend",supportTier:"observed",importStack:"unknown",aliases:["unknown"],dependencyHints:[],scriptHints:[],fileHints:[]}},_={nextjs:{dev:["dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},remix:{dev:["dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},nuxt:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},react:{dev:["dev","start"],start:["serve"],build:["build"],test:["test"],lint:["lint"],format:["format"]},vite:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},vue:{dev:["dev","serve"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},sveltekit:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},svelte:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},angular:{dev:["start","serve"],start:["serve"],build:["build"],test:["test"],lint:["lint"],format:["format"]},astro:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},solid:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]}};function te(e,n){let t=typeof e=="string"?T(e):e;return t==="unknown"?[]:_[t]?.[n]??[]}function A(e){try{return o.existsSync(e)?JSON.parse(o.readFileSync(e,"utf8")):null}catch{return null}}function I(e){let n=A(s.join(e,"package.json"));if(!n)return {dependencies:{},scriptText:""};let t={...n.dependencies??{},...n.devDependencies??{},...n.peerDependencies??{}},i=n.scripts??{},l=Object.values(i).filter(d=>typeof d=="string").join(" ").toLowerCase();return {dependencies:t,scriptText:l}}function O(e,n){return n.some(t=>o.existsSync(s.join(e,t)))}function F(e){return e.vite?e.react||e["react-dom"]||e["@vitejs/plugin-react"]?"react":e.vue||e["@vitejs/plugin-vue"]?"vue":e.svelte||e["@sveltejs/vite-plugin-svelte"]?"svelte":e["solid-js"]||e["vite-plugin-solid"]?"solid":null:null}function y(e,n,t){let i=g[e]??g.unknown;return {key:i.key,runtime:i.runtime,displayName:i.displayName,supportTier:i.supportTier,importStack:i.importStack,confidence:n,source:t}}function ie(e){return g[e]??g.unknown}function T(e){let n=(e??"").trim().toLowerCase().replace(/[_\s]+/g,"-");if(!n)return "unknown";for(let t of Object.values(g))if(t.aliases.includes(n))return t.key;return "unknown"}function B(e,n){let t=T(typeof n?.framework=="string"?n.framework:typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0);if(t!=="unknown")return y(t,"high","framework");let{dependencies:i,scriptText:l}=I(e);for(let d of ["nextjs","remix","nuxt","sveltekit","angular","astro","vue","solid","vite","react","svelte"]){let c=g[d];if(c.dependencyHints.some(u=>i[u])){if(d==="vite"){let u=F(i);if(u)return y(u,"high","manifest")}return y(d,"high","manifest")}if(c.fileHints.length>0&&O(e,c.fileHints)){if(d==="vite"){let u=F(i);if(u)return y(u,"high","manifest")}return y(d,"high","manifest")}if(c.scriptHints.some(u=>l.includes(u)))return y(d,"medium","manifest")}return y("unknown","low","unknown")}var x={fastapi:{key:"fastapi",runtime:"python",displayName:"FastAPI",supportTier:"first-class",importStack:"fastapi",aliases:["fastapi"],kitPrefixes:["fastapi"]},django:{key:"django",runtime:"python",displayName:"Django",supportTier:"extended",importStack:"django",aliases:["django"]},flask:{key:"flask",runtime:"python",displayName:"Flask",supportTier:"extended",importStack:"flask",aliases:["flask"]},python:{key:"python",runtime:"python",displayName:"Python",supportTier:"observed",importStack:"unknown",aliases:["python"]},nestjs:{key:"nestjs",runtime:"node",displayName:"NestJS",supportTier:"first-class",importStack:"nestjs",aliases:["nestjs","nest"],kitPrefixes:["nestjs"]},nextjs:{key:"nextjs",runtime:"node",displayName:"Next.js",supportTier:"extended",importStack:"nextjs",aliases:["nextjs","next.js","next"]},remix:{key:"remix",runtime:"node",displayName:"Remix",supportTier:"extended",importStack:"remix",aliases:["remix"]},nuxt:{key:"nuxt",runtime:"node",displayName:"Nuxt",supportTier:"extended",importStack:"nuxt",aliases:["nuxt","nuxtjs","nuxt.js"]},react:{key:"react",runtime:"node",displayName:"React",supportTier:"extended",importStack:"react",aliases:["react"]},vite:{key:"vite",runtime:"node",displayName:"Vite",supportTier:"extended",importStack:"vite",aliases:["vite"]},vue:{key:"vue",runtime:"node",displayName:"Vue",supportTier:"extended",importStack:"vue",aliases:["vue","vuejs","vue.js"]},sveltekit:{key:"sveltekit",runtime:"node",displayName:"SvelteKit",supportTier:"extended",importStack:"sveltekit",aliases:["sveltekit","svelte-kit"]},svelte:{key:"svelte",runtime:"node",displayName:"Svelte",supportTier:"extended",importStack:"svelte",aliases:["svelte"]},angular:{key:"angular",runtime:"node",displayName:"Angular",supportTier:"extended",importStack:"angular",aliases:["angular","@angular/core"]},astro:{key:"astro",runtime:"node",displayName:"Astro",supportTier:"extended",importStack:"astro",aliases:["astro"]},solid:{key:"solid",runtime:"node",displayName:"Solid",supportTier:"extended",importStack:"solid",aliases:["solid","solidjs","solid-js"]},express:{key:"express",runtime:"node",displayName:"Express",supportTier:"extended",importStack:"express",aliases:["express"]},fastify:{key:"fastify",runtime:"node",displayName:"Fastify",supportTier:"extended",importStack:"unknown",aliases:["fastify"]},koa:{key:"koa",runtime:"node",displayName:"Koa",supportTier:"extended",importStack:"koa",aliases:["koa"]},node:{key:"node",runtime:"node",displayName:"Node.js",supportTier:"observed",importStack:"unknown",aliases:["node","nodejs","typescript","javascript"]},gofiber:{key:"gofiber",runtime:"go",displayName:"Go/Fiber",supportTier:"extended",importStack:"go",aliases:["gofiber","fiber","go-fiber","go/fiber"],kitPrefixes:["gofiber"]},gogin:{key:"gogin",runtime:"go",displayName:"Go/Gin",supportTier:"extended",importStack:"go",aliases:["gogin","gin","go-gin","go/gin"],kitPrefixes:["gogin"]},echo:{key:"echo",runtime:"go",displayName:"Echo",supportTier:"extended",importStack:"go",aliases:["echo"]},go:{key:"go",runtime:"go",displayName:"Go",supportTier:"observed",importStack:"go",aliases:["go","golang"],kitPrefixes:["go"]},springboot:{key:"springboot",runtime:"java",displayName:"Spring Boot",supportTier:"extended",importStack:"springboot",aliases:["springboot","spring","spring-boot"],kitPrefixes:["springboot"]},java:{key:"java",runtime:"java",displayName:"Java",supportTier:"observed",importStack:"unknown",aliases:["java"]},laravel:{key:"laravel",runtime:"php",displayName:"Laravel",supportTier:"extended",importStack:"unknown",aliases:["laravel"]},symfony:{key:"symfony",runtime:"php",displayName:"Symfony",supportTier:"extended",importStack:"unknown",aliases:["symfony"]},php:{key:"php",runtime:"php",displayName:"PHP",supportTier:"observed",importStack:"unknown",aliases:["php"]},rails:{key:"rails",runtime:"ruby",displayName:"Ruby on Rails",supportTier:"extended",importStack:"rails",aliases:["rails","ruby-on-rails","ruby on rails"]},sinatra:{key:"sinatra",runtime:"ruby",displayName:"Sinatra",supportTier:"extended",importStack:"unknown",aliases:["sinatra"]},ruby:{key:"ruby",runtime:"ruby",displayName:"Ruby",supportTier:"observed",importStack:"unknown",aliases:["ruby"]},dotnet:{key:"dotnet",runtime:"dotnet",displayName:"ASP.NET Core",supportTier:"extended",importStack:"dotnet",aliases:["dotnet","asp.net","aspnet","asp.net core","csharp","c#"],kitPrefixes:["dotnet","aspnet","aspnetcore"]},actix:{key:"actix",runtime:"rust",displayName:"Actix-web",supportTier:"extended",importStack:"unknown",aliases:["actix","actix-web"]},axum:{key:"axum",runtime:"rust",displayName:"Axum",supportTier:"extended",importStack:"unknown",aliases:["axum"]},rocket:{key:"rocket",runtime:"rust",displayName:"Rocket",supportTier:"extended",importStack:"unknown",aliases:["rocket"]},rust:{key:"rust",runtime:"rust",displayName:"Rust",supportTier:"observed",importStack:"unknown",aliases:["rust"]},phoenix:{key:"phoenix",runtime:"elixir",displayName:"Phoenix",supportTier:"extended",importStack:"unknown",aliases:["phoenix"]},elixir:{key:"elixir",runtime:"elixir",displayName:"Elixir",supportTier:"observed",importStack:"unknown",aliases:["elixir"]},clojure:{key:"clojure",runtime:"clojure",displayName:"Clojure",supportTier:"extended",importStack:"unknown",aliases:["clojure"]},scala:{key:"scala",runtime:"scala",displayName:"Scala",supportTier:"extended",importStack:"unknown",aliases:["scala"]},kotlin:{key:"kotlin",runtime:"kotlin",displayName:"Kotlin",supportTier:"extended",importStack:"unknown",aliases:["kotlin"]},deno:{key:"deno",runtime:"deno",displayName:"Deno",supportTier:"extended",importStack:"unknown",aliases:["deno"]},bun:{key:"bun",runtime:"bun",displayName:"Bun",supportTier:"extended",importStack:"unknown",aliases:["bun"]},tauri:{key:"tauri",runtime:"node",displayName:"Tauri",supportTier:"extended",importStack:"unknown",aliases:["tauri","tauri-app"],kitPrefixes:["desktop.tauri"]},electron:{key:"electron",runtime:"node",displayName:"Electron",supportTier:"extended",importStack:"unknown",aliases:["electron","electron-forge"],kitPrefixes:["desktop.electron"]},"vscode-extension":{key:"vscode-extension",runtime:"node",displayName:"VS Code Extension",supportTier:"extended",importStack:"unknown",aliases:["vscode-extension","visual-studio-code-extension"],kitPrefixes:["extension.vscode"]},c:{key:"c",runtime:"c",displayName:"C",supportTier:"observed",importStack:"unknown",aliases:["c","clang","gcc"]},cpp:{key:"cpp",runtime:"cpp",displayName:"C++",supportTier:"observed",importStack:"unknown",aliases:["cpp","c++","cplusplus","cc","clang++","g++"]},unknown:{key:"unknown",runtime:"unknown",displayName:"Unknown",supportTier:"observed",importStack:"unknown",aliases:["unknown"]}},C=new Map;for(let e of Object.values(x))for(let n of e.aliases)C.set(n,e.key);function r(e,n,t){let i=x[e]??x.unknown;return {key:i.key,runtime:i.runtime,displayName:i.displayName,supportTier:i.supportTier,importStack:i.importStack,confidence:n,source:t}}function H(e){return e.trim().toLowerCase().replace(/[_\s]+/g,"-")}function m(e){try{return o.existsSync(e)?o.readFileSync(e,"utf8").toLowerCase():""}catch{return ""}}function K(e){try{return o.existsSync(e)?JSON.parse(o.readFileSync(e,"utf8")):null}catch{return null}}var G=new Set([".git",".hg",".svn",".workspai",".rapidkit",".venv","venv","node_modules","vendor","dist","build","target","coverage",".next",".cache"]);function S(e,n){if(n<0||!o.existsSync(e))return [];let t=[],i=[];try{i=o.readdirSync(e,{withFileTypes:true});}catch{return []}for(let l of i){let d=s.join(e,l.name);l.isDirectory()?t.push(...S(d,n-1)):t.push(d);}return t}function D(e,n){if(n<0||!o.existsSync(e))return [];let t=[];try{t=o.readdirSync(e,{withFileTypes:true});}catch{return []}let i=[];for(let l of t){let d=s.join(e,l.name);if(l.isDirectory()){if(G.has(l.name)||a(l.name))continue;i.push(...D(d,n-1));}else i.push(d);}return i}function p(e,n,t=2){return S(e,t).some(i=>i.toLowerCase().endsWith(n.toLowerCase()))}function R(e,n,t=2){return S(e,t).filter(i=>i.toLowerCase().endsWith(n.toLowerCase()))}function M(e){let n=H(e??"");if(!n)return "unknown";for(let t of Object.values(x))if(t.kitPrefixes?.some(i=>n.startsWith(i)))return t.key;return "unknown"}function w(e){return e?C.get(H(e))??"unknown":"unknown"}function ce(e){return w(e)}function le(e){let n=w(e);return n!=="unknown"?x[n].runtime:"unknown"}function V(e){let n=M(e.kitName);if(n!=="unknown")return r(n,"high","kit");let t=w(e.framework);if(t!=="unknown")return r(t,"high","framework");let i=w(e.runtime);return i!=="unknown"?r(i,"medium","runtime"):r("unknown","low","unknown")}function z(e){let n=K(s.join(e,"package.json"));if(!n)return r("unknown","low","unknown");let t={...n.dependencies??{},...n.devDependencies??{}},i=n.scripts??{},l=Object.values(i).filter(d=>typeof d=="string").join(" ").toLowerCase();return t["@nestjs/core"]||l.includes("nest start")?r("nestjs","high","manifest"):t.express?r("express","high","manifest"):t.fastify?r("fastify","high","manifest"):t.koa?r("koa","high","manifest"):r("node","medium","marker")}function q(e){let n=K(s.join(e,"package.json"));if(!n)return r("unknown","low","unknown");let t={...n.dependencies??{},...n.devDependencies??{}},i=n.engines??{},l=n.scripts??{},d=Object.values(l).filter(c=>typeof c=="string").join(" ").toLowerCase();return t["@tauri-apps/api"]||t["@tauri-apps/cli"]||o.existsSync(s.join(e,"src-tauri","Cargo.toml"))?r("tauri","high","manifest"):t.electron||t["@electron-forge/cli"]||d.includes("electron-forge")||d.includes("electron ")?r("electron","high","manifest"):typeof i.vscode=="string"&&(n.activationEvents!==void 0||n.contributes!==void 0)?r("vscode-extension","high","manifest"):r("unknown","low","unknown")}function W(e){let n=[m(s.join(e,"pyproject.toml")),m(s.join(e,"requirements.txt")),m(s.join(e,"requirements.in"))].join(`
|
|
2
|
+
`);return n.includes("fastapi")?r("fastapi","high","manifest"):n.includes("django")?r("django","high","manifest"):n.includes("flask")?r("flask","high","manifest"):n.trim()?r("python","medium","marker"):r("unknown","low","unknown")}function U(e){let n=[m(s.join(e,"go.mod")),m(s.join(e,"main.go"))].join(`
|
|
3
|
+
`);return n.includes("github.com/gofiber/fiber")?r("gofiber","high","manifest"):n.includes("github.com/gin-gonic/gin")?r("gogin","high","manifest"):n.includes("github.com/labstack/echo")?r("echo","high","manifest"):n.trim()?r("go","medium","marker"):r("unknown","low","unknown")}function Y(e){let n=[m(s.join(e,"pom.xml")),m(s.join(e,"build.gradle")),m(s.join(e,"build.gradle.kts"))].join(`
|
|
4
|
+
`);return n.includes("spring-boot")||n.includes("org.springframework")?r("springboot","high","manifest"):n.trim()?r("java","medium","marker"):r("unknown","low","unknown")}function $(e){let n=m(s.join(e,"composer.json"));return n.includes("laravel/framework")?r("laravel","high","manifest"):n.includes("symfony/")?r("symfony","high","manifest"):n.trim()?r("php","medium","marker"):r("unknown","low","unknown")}function Q(e){let n=m(s.join(e,"Gemfile"));return n.includes("gem 'rails'")||n.includes('gem "rails"')?r("rails","high","manifest"):n.includes("gem 'sinatra'")||n.includes('gem "sinatra"')?r("sinatra","high","manifest"):n.trim()?r("ruby","medium","marker"):r("unknown","low","unknown")}function X(e){let t=[...R(e,".csproj",3),...R(e,".sln",2)].map(i=>m(i)).join(`
|
|
5
|
+
`);return t.includes("microsoft.net.sdk.web")||t.includes("microsoft.aspnetcore")||t.includes("swashbuckle.aspnetcore")?r("dotnet","high","manifest"):t.trim()?r("dotnet","medium","marker"):r("unknown","low","unknown")}function Z(e){let n=m(s.join(e,"Cargo.toml"));return n.includes("actix-web")?r("actix","high","manifest"):n.includes("axum")?r("axum","high","manifest"):n.includes("rocket")?r("rocket","high","manifest"):n.trim()?r("rust","medium","marker"):r("unknown","low","unknown")}function J(e){let n=m(s.join(e,"mix.exs"));return n.includes("phoenix")?r("phoenix","high","manifest"):n.trim()?r("elixir","medium","marker"):r("unknown","low","unknown")}function P(e){let n=[],t=i=>{n.includes(i)||n.push(i);};return o.existsSync(s.join(e,"go.mod"))&&t("go"),(o.existsSync(s.join(e,"Cargo.toml"))||o.existsSync(s.join(e,"src-tauri","Cargo.toml")))&&t("rust"),(o.existsSync(s.join(e,"pom.xml"))||o.existsSync(s.join(e,"build.gradle"))||o.existsSync(s.join(e,"build.gradle.kts")))&&t("java"),o.existsSync(s.join(e,"mix.exs"))&&t("elixir"),o.existsSync(s.join(e,"composer.json"))&&t("php"),(p(e,".csproj")||p(e,".sln"))&&t("dotnet"),o.existsSync(s.join(e,"package.json"))&&t("node"),o.existsSync(s.join(e,"Gemfile"))&&t("ruby"),(o.existsSync(s.join(e,"pyproject.toml"))||o.existsSync(s.join(e,"setup.py"))||o.existsSync(s.join(e,"requirements.txt"))||o.existsSync(s.join(e,"requirements.in")))&&t("python"),(o.existsSync(s.join(e,"deps.edn"))||o.existsSync(s.join(e,"project.clj")))&&t("clojure"),o.existsSync(s.join(e,"build.sbt"))&&t("scala"),(o.existsSync(s.join(e,"deno.json"))||o.existsSync(s.join(e,"deno.jsonc")))&&t("deno"),(o.existsSync(s.join(e,"bun.lockb"))||o.existsSync(s.join(e,"bun.lock")))&&t("bun"),(o.existsSync(s.join(e,"CMakeLists.txt"))||o.existsSync(s.join(e,"meson.build"))||p(e,".cpp",3)||p(e,".cc",3)||p(e,".cxx",3)||p(e,".hpp",3)||p(e,".hh",3)||p(e,".hxx",3))&&t("cpp"),(p(e,".c",3)||p(e,".h",3))&&t("c"),(o.existsSync(s.join(e,"settings.gradle.kts"))||p(s.join(e,"src"),".kt",3)||m(s.join(e,"build.gradle.kts")).includes("kotlin"))&&t("kotlin"),n}function me(e,n=4){let t=D(e,Math.max(0,Math.min(12,n))),i=new Set(t.map(k=>s.basename(k))),l=t.map(k=>k.toLowerCase()),d=[],c=k=>{d.includes(k)||d.push(k);},u=(...k)=>k.some(a=>i.has(a)),f=(...k)=>l.some(a=>k.some(v=>a.endsWith(v)));return u("go.mod")&&c("go"),u("Cargo.toml")&&c("rust"),u("pom.xml","build.gradle","build.gradle.kts")&&c("java"),u("mix.exs")&&c("elixir"),u("composer.json")&&c("php"),f(".csproj",".sln")&&c("dotnet"),u("package.json")&&c("node"),u("Gemfile")&&c("ruby"),u("pyproject.toml","setup.py","requirements.txt","requirements.in")&&c("python"),u("deps.edn","project.clj")&&c("clojure"),u("build.sbt")&&c("scala"),u("deno.json","deno.jsonc")&&c("deno"),u("bun.lockb","bun.lock")&&c("bun"),(u("CMakeLists.txt","meson.build")||f(".cpp",".cc",".cxx",".hpp",".hh",".hxx"))&&c("cpp"),f(".c",".h")&&c("c"),(u("settings.gradle.kts")||f(".kt")||t.some(k=>s.basename(k)==="build.gradle.kts"&&m(k).includes("kotlin")))&&c("kotlin"),d}function ke(e,n){let t=V({framework:typeof n?.framework=="string"?n.framework:void 0,runtime:typeof n?.runtime=="string"?n.runtime:void 0,kitName:typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0});if(t.key!=="unknown")return t;let i=P(e),l=m(s.join(e,"CMakeLists.txt")),d=m(s.join(e,"meson.build")),c=l.trim().length>0||d.trim().length>0,u=p(e,".cpp",3)||p(e,".cc",3)||p(e,".cxx",3),f=p(e,".c",3),k=/(?:\bcxx\b|\bcplusplus\b|\bc\+\+\b)/u.test(`${l}
|
|
6
|
+
${d}`);if(c&&i.includes("cpp")&&(u||k))return r("cpp","high","manifest");if(c&&i.includes("c")&&f&&!u&&!k)return r("c","high","manifest");if(i.includes("bun"))return r("bun","high","marker");if(i.includes("deno"))return r("deno","high","marker");if(i.includes("kotlin"))return r("kotlin","medium","marker");if(i.includes("node")){let a=q(e);if(a.key!=="unknown")return a;let v=B(e,n);if(v.key!=="unknown")return v;let j=z(e);if(j.key!=="unknown")return j}if(i.includes("python")){let a=W(e);if(a.key!=="unknown")return a}if(i.includes("go")){let a=U(e);if(a.key!=="unknown")return a}if(i.includes("java")){let a=Y(e);if(a.key!=="unknown")return a}if(i.includes("php")){let a=$(e);if(a.key!=="unknown")return a}if(i.includes("ruby")){let a=Q(e);if(a.key!=="unknown")return a}if(i.includes("rust")){let a=Z(e);if(a.key!=="unknown")return a}if(i.includes("elixir")){let a=J(e);if(a.key!=="unknown")return a}if(i.includes("dotnet")){let a=X(e);if(a.key!=="unknown")return a}return i.includes("clojure")?r("clojure","medium","marker"):i.includes("scala")?r("scala","medium","marker"):i.includes("c")&&f&&!u?r("c","medium","marker"):i.includes("cpp")?r("cpp","medium","marker"):i.includes("c")?r("c","medium","marker"):i.length>0?r(w(i[0]),"medium","runtime"):r("unknown","low","unknown")}export{te as a,ie as b,T as c,B as d,ce as e,le as f,V as g,P as h,me as i,ke as j};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {a}from'./chunk-A5FBGRJA.js';import {a as a$1}from'./chunk-AFIFZTOY.js';import {i as i$1,h}from'./chunk-5EPPPMAS.js';import {j,u,e,a as a$2,t,f as f$1}from'./chunk-MOSXTVPU.js';import {s}from'./chunk-RJIYCDVC.js';import b from'crypto';import P from'fs';import d from'fs/promises';import i from'path';import T from'fs-extra';var x=h.projectWorkspaceLink.schemaVersion,L="workspai.project-workspace-link",l=class extends Error{constructor(r,a,o={}){super(a);this.code=r;this.context=o;this.name="ProjectWorkspaceResolutionError";}code;context};function $(e){return P.existsSync(i.join(e,".workspai-workspace"))?".workspai-workspace":".workspai/workspace.json"}function _(e){return b.createHash("sha256").update([e.workspaceName,a(e.workspacePath),e.projectName,a(e.projectPath),e.relativePath.replace(/\\/g,"/"),e.relationship].join("\0")).digest("hex")}function I(e){let t=i.resolve(e);for(;;){if(j(t))return t;let r=i.dirname(t);if(r===t)return null;t=r;}}function J(e){let t$1=i.resolve(e);for(;;){if([...t(t$1,"project.json"),...t(t$1,"context.json")].some(a=>P.existsSync(a)))return t$1;let r=i.dirname(t$1);if(r===t$1)return null;t$1=r;}}function y(e){return JSON.parse(P.readFileSync(e,"utf8"))}function K(e){let t=y(e);if(!t||typeof t!="object"||Array.isArray(t))throw new l("project.workspace.link-invalid",`Project workspace link is not a JSON object: ${e}`,{linkPath:e});let r=t;if(r.schemaVersion!==x||r.kind!==L||r.state!=="active"||!r.workspace||typeof r.workspace.name!="string"||r.workspace.name.trim().length===0||typeof r.workspace.root!="string"||!i.isAbsolute(r.workspace.root)||![".workspai-workspace",".workspai/workspace.json"].includes(r.workspace.marker??"")||r.workspace.contract!==i$1.workspaceContract||!r.project||typeof r.project.name!="string"||r.project.name.trim().length===0||typeof r.project.relativePath!="string"||i.isAbsolute(r.project.relativePath)||r.project.relativePath.split(/[\\/]/).includes("..")||!["managed","adopted","imported","linked","restored"].includes(r.project.relationship??"")||!r.integrity||r.integrity.algorithm!=="sha256"||typeof r.integrity.binding!="string"||!/^[a-f0-9]{64}$/.test(r.integrity.binding))throw new l("project.workspace.link-invalid",`Project workspace link does not satisfy ${x}: ${e}`,{linkPath:e});try{a$1(t,"contracts/project-workspace-link.v1.json","Project workspace link");}catch(a){throw new l("project.workspace.link-invalid",`Project workspace link does not satisfy ${x}: ${e}`,{linkPath:e,validationError:a instanceof Error?a.message:String(a)})}return r}function f(e,t){let r=i.join(e,".workspai","workspace.contract.json");if(!P.existsSync(r))return null;try{let a$1=y(r);if(!Array.isArray(a$1.projects))return false;let o=a(t);return a$1.projects.some(n=>typeof n.externalPath=="string"?a(n.externalPath)===o:typeof n.relativePath!="string"||n.relativePath.startsWith("external/")?false:a(i.resolve(e,n.relativePath))===o)}catch{return false}}function M(e,t,r){let a$1=a(e),o=new Map;for(let n of s(t,r)){if(!P.existsSync(n))continue;let c;try{c=y(n);}catch{continue}if(Array.isArray(c.workspaces))for(let p of c.workspaces){if(!p||typeof p.name!="string"||typeof p.path!="string"||!Array.isArray(p.projects)||!p.projects.some(w=>w&&typeof w.path=="string"&&a(w.path)===a$1))continue;let s=a(p.path);!j(s)||f(s,e)!==true||o.set(s,{name:p.name,path:s});}}return [...o.values()].sort((n,c)=>n.path.localeCompare(c.path))}function m(e,t){if(e)throw t;return null}function te(e$1){let t=e$1.strict===true,r=i.resolve(e$1.startPath),a=e$1.explicitWorkspacePath?i.resolve(e$1.explicitWorkspacePath):null,o=J(r);if(a)return j(a)?e$1.requireProjectMembership===true&&o&&f(a,o)!==true?m(t,new l("project.workspace.membership-missing",`Project is not registered in the explicit workspace contract: ${a}`,{workspacePath:a,projectPath:o})):{workspacePath:a,projectPath:o,source:"explicit",linkPath:o?u(o,e):null,recovered:false}:m(t,new l("project.workspace.explicit-invalid",`Explicit workspace path is not a Workspai workspace: ${a}`,{workspacePath:a,projectPath:o}));let n=I(r);if(n)return e$1.requireProjectMembership===true&&o&&f(n,o)!==true?m(t,new l("project.workspace.membership-missing",`Project is not registered in its parent workspace contract: ${n}`,{workspacePath:n,projectPath:o})):{workspacePath:n,projectPath:o,source:"parent",linkPath:o?u(o,e):null,recovered:false};if(!o)return m(t,new l("project.workspace.unlinked","No Workspai project or workspace could be resolved from the current directory.",{startPath:r}));let c=u(o,e),p=null;if(P.existsSync(c)){let s;try{s=K(c);}catch(O){if(t)throw O;return null}let u=_({workspaceName:s.workspace.name,workspacePath:s.workspace.root,projectName:s.project.name,projectPath:o,relativePath:s.project.relativePath,relationship:s.project.relationship}),w=f(s.workspace.root,o);if(s.integrity.binding===u&&j(s.workspace.root)&&P.existsSync(i.join(s.workspace.root,s.workspace.marker))&&w===true)return {workspacePath:i.resolve(s.workspace.root),projectPath:o,source:"local-link",linkPath:c,recovered:false};p=s;}let h=M(o,e$1.env??process.env,e$1.platform??process.platform);return h.length>1?m(t,new l("project.workspace.ambiguous",`Project is registered in more than one valid workspace: ${h.map(s=>s.name).join(", ")}. Pass --workspace <path> or run project workspace relink.`,{projectPath:o,candidates:h})):h.length===1?{workspacePath:h[0].path,projectPath:o,source:"registry",linkPath:c,recovered:p!==null}:p?m(t,new l("project.workspace.link-stale",`Project workspace link is stale and no valid registry relocation was found: ${p.workspace.root}`,{projectPath:o,linkPath:c,linkedWorkspacePath:p.workspace.root})):m(t,new l("project.workspace.unlinked","This Workspai project is not linked to a valid workspace. Run `npx workspai adopt .` or `npx workspai project workspace relink --workspace <path>`.",{projectPath:o,linkPath:c}))}async function F(e,t){await d.mkdir(i.dirname(e),{recursive:true});let r=`${e}.${process.pid}.${b.randomUUID()}.tmp`;try{await d.writeFile(r,`${JSON.stringify(t,null,2)}
|
|
2
|
+
`,{encoding:"utf8",mode:384});try{await d.rename(r,e);}catch(a){let o=a.code;if(o!=="EEXIST"&&o!=="EPERM")throw a;await T.move(r,e,{overwrite:true});}}finally{await d.rm(r,{force:true}).catch(()=>{});}}async function D(e){let t=i.join(e,".gitignore"),r=await d.readFile(t,"utf8").catch(c=>{if(c.code==="ENOENT")return "";throw c});if(r.split(/\r?\n/).map(c=>c.trim()).includes(f$1))return;let n=`${r.length>0&&!r.endsWith(`
|
|
3
|
+
`)?`
|
|
4
|
+
`:""}
|
|
5
|
+
# Workspai machine-local workspace binding
|
|
6
|
+
${f$1}
|
|
7
|
+
`;await d.writeFile(t,`${r}${n}`,"utf8");}async function V(e$1){let t=i.resolve(e$1.workspacePath),r=i.resolve(e$1.projectPath);if(!j(t))throw new l("project.workspace.explicit-invalid",`Cannot link project to an invalid Workspai workspace: ${t}`,{workspacePath:t,projectPath:r});let a$3=i.join(t,".workspai","workspace.contract.json"),o=e$1.workspaceName??i.basename(t),n=e$1.relativePath;if(P.existsSync(a$3)){let h=y(a$3);typeof h.workspace?.name=="string"&&(o=h.workspace.name);let s=a(r),u=h.projects?.find(w=>typeof w.externalPath=="string"?a(w.externalPath)===s:typeof w.relativePath=="string"&&!w.relativePath.startsWith("external/")&&a(i.resolve(t,w.relativePath))===s);u&&typeof u.relativePath=="string"&&(n=u.relativePath);}if(n??=i.relative(t,r).replace(/\\/g,"/"),(!n||n.startsWith(".."))&&(n=`external/${e$1.projectName}`),f(t,r)!==true)throw new l("project.workspace.membership-missing",`Project is not registered in the canonical workspace contract: ${e$1.projectName}`,{workspacePath:t,projectPath:r,projectName:e$1.projectName});let c={schemaVersion:x,kind:L,generatedAt:(e$1.now??new Date).toISOString(),state:"active",workspace:{name:o,root:t,marker:$(t),contract:i$1.workspaceContract},project:{name:e$1.projectName,relativePath:n,relationship:e$1.relationship},integrity:{algorithm:"sha256",binding:_({workspaceName:o,workspacePath:t,projectName:e$1.projectName,projectPath:r,relativePath:n,relationship:e$1.relationship})}};a$1(c,"contracts/project-workspace-link.v1.json","Project workspace link");let p=i.join(r,a$2,e);return await D(r),await F(p,c),{linkPath:p,link:c}}async function oe(e,t$1="linked"){if(!e.projectPath)return null;let r=t(e.projectPath,"project.json").find(o=>P.existsSync(o)),a=i.basename(e.projectPath);if(r)try{let o=y(r);typeof o.name=="string"?a=o.name:typeof o.slug=="string"&&(a=o.slug);}catch{}return V({workspacePath:e.workspacePath,projectPath:e.projectPath,projectName:a,relationship:t$1})}export{l as a,te as b,V as c,oe as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as PYTHON_FREE_WORKSPACE_PROFILES,a as buildWorkspaceManifest,f as createProject,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,b as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-
|
|
1
|
+
export{c as PYTHON_FREE_WORKSPACE_PROFILES,a as buildWorkspaceManifest,f as createProject,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,b as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-P475BOJW.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as DOCTOR_WORKSPACE_REPORT_PATH,n as applyEnvKeyAddFix,j as applyFileAppendFix,k as applyFileCopyFix,i as applyFileCreateFix,m as applyJsonEditFix,o as applyMakefileTargetFix,h as applyPackageScriptFix,f as assertOperationPathInsideProject,g as assertOperationPathInsideProjectResolved,e as buildRepairOperationIdentity,q as computeDoctorFixAwareExitCode,p as computeDoctorGateExitCode,l as decodeJsonPointerSegment,d as parseInternalRepairCommand,c as parsePackageScriptFix,b as resolveDoctorPolicyProfile,r as runDoctor}from'./chunk-TTFQWH55.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ type ProjectGroundingMode = (typeof PROJECT_GROUNDING_MODE_VALUES)[number];
|
|
|
14
14
|
interface AdoptProjectFilePreimage {
|
|
15
15
|
path: string;
|
|
16
16
|
contents: Buffer | null;
|
|
17
|
+
preserve?: 'symbolic-link';
|
|
17
18
|
}
|
|
18
19
|
interface AdoptProjectRollbackSnapshot {
|
|
19
20
|
workspacePath: string;
|
|
@@ -48,6 +49,7 @@ declare function getPublishedContractVersions(): {
|
|
|
48
49
|
workspaceArchiveOperationResult: "workspai-workspace-archive-operation-result-v1";
|
|
49
50
|
ingestionPlan: "workspai.ingestion-plan.v1";
|
|
50
51
|
ingestionResult: "workspai.ingestion-result.v1";
|
|
52
|
+
adoptEffects: "workspai.adopt-effects.v1";
|
|
51
53
|
projectEntryCapability: string;
|
|
52
54
|
projectWorkspaceLink: "project-workspace-link.v1";
|
|
53
55
|
projectWorkspaceResolution: "project-workspace-resolution.v1";
|
|
@@ -55,6 +57,11 @@ declare function getPublishedContractVersions(): {
|
|
|
55
57
|
doctorProjectEvidence: "doctor-project-evidence-v1";
|
|
56
58
|
doctorWorkspaceEvidence: "doctor-workspace-evidence-v1";
|
|
57
59
|
doctorGraphDiagnosis: "doctor-graph-diagnosis.v1";
|
|
60
|
+
doctorDiagnosis: "workspai.doctor-diagnosis.v1";
|
|
61
|
+
doctorCapabilities: "workspai.doctor-capabilities.v1";
|
|
62
|
+
doctorValidation: "workspai.doctor-validation.v1";
|
|
63
|
+
doctorReceipt: "workspai.doctor-receipt.v1";
|
|
64
|
+
doctorSummary: "workspai.doctor-summary.v1";
|
|
58
65
|
projectTestCoverage: "workspai.project-test-coverage.v1";
|
|
59
66
|
verifiedGoal: string;
|
|
60
67
|
verifiedGoalStatus: "workspai.verified-goal-status.v1";
|
|
@@ -241,6 +248,7 @@ declare function getVersionContract(): {
|
|
|
241
248
|
workspaceArchiveOperationResult: "workspai-workspace-archive-operation-result-v1";
|
|
242
249
|
ingestionPlan: "workspai.ingestion-plan.v1";
|
|
243
250
|
ingestionResult: "workspai.ingestion-result.v1";
|
|
251
|
+
adoptEffects: "workspai.adopt-effects.v1";
|
|
244
252
|
projectEntryCapability: string;
|
|
245
253
|
projectWorkspaceLink: "project-workspace-link.v1";
|
|
246
254
|
projectWorkspaceResolution: "project-workspace-resolution.v1";
|
|
@@ -248,6 +256,11 @@ declare function getVersionContract(): {
|
|
|
248
256
|
doctorProjectEvidence: "doctor-project-evidence-v1";
|
|
249
257
|
doctorWorkspaceEvidence: "doctor-workspace-evidence-v1";
|
|
250
258
|
doctorGraphDiagnosis: "doctor-graph-diagnosis.v1";
|
|
259
|
+
doctorDiagnosis: "workspai.doctor-diagnosis.v1";
|
|
260
|
+
doctorCapabilities: "workspai.doctor-capabilities.v1";
|
|
261
|
+
doctorValidation: "workspai.doctor-validation.v1";
|
|
262
|
+
doctorReceipt: "workspai.doctor-receipt.v1";
|
|
263
|
+
doctorSummary: "workspai.doctor-summary.v1";
|
|
251
264
|
projectTestCoverage: "workspai.project-test-coverage.v1";
|
|
252
265
|
verifiedGoal: string;
|
|
253
266
|
verifiedGoalStatus: "workspai.verified-goal-status.v1";
|
|
@@ -428,6 +441,7 @@ declare function getGlobalCommandCapabilities(): {
|
|
|
428
441
|
workspaceArchiveOperationResult: "workspai-workspace-archive-operation-result-v1";
|
|
429
442
|
ingestionPlan: "workspai.ingestion-plan.v1";
|
|
430
443
|
ingestionResult: "workspai.ingestion-result.v1";
|
|
444
|
+
adoptEffects: "workspai.adopt-effects.v1";
|
|
431
445
|
projectEntryCapability: string;
|
|
432
446
|
projectWorkspaceLink: "project-workspace-link.v1";
|
|
433
447
|
projectWorkspaceResolution: "project-workspace-resolution.v1";
|
|
@@ -435,6 +449,11 @@ declare function getGlobalCommandCapabilities(): {
|
|
|
435
449
|
doctorProjectEvidence: "doctor-project-evidence-v1";
|
|
436
450
|
doctorWorkspaceEvidence: "doctor-workspace-evidence-v1";
|
|
437
451
|
doctorGraphDiagnosis: "doctor-graph-diagnosis.v1";
|
|
452
|
+
doctorDiagnosis: "workspai.doctor-diagnosis.v1";
|
|
453
|
+
doctorCapabilities: "workspai.doctor-capabilities.v1";
|
|
454
|
+
doctorValidation: "workspai.doctor-validation.v1";
|
|
455
|
+
doctorReceipt: "workspai.doctor-receipt.v1";
|
|
456
|
+
doctorSummary: "workspai.doctor-summary.v1";
|
|
438
457
|
projectTestCoverage: "workspai.project-test-coverage.v1";
|
|
439
458
|
verifiedGoal: string;
|
|
440
459
|
verifiedGoalStatus: "workspai.verified-goal-status.v1";
|