workspai 0.70.0 → 0.72.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 +43 -80
- package/contracts/artifact-remediation-plan.v1.json +49 -0
- package/contracts/workspace-intelligence/goal-lifecycle-result.v1.json +19 -0
- package/contracts/workspace-repair-capabilities.v1.json +7 -1
- package/dist/analyze-5ENZTHOT.js +1 -0
- package/dist/{artifact-remediation-plan-URQL5MBN.js → artifact-remediation-plan-WDK5ISRU.js} +1 -1
- package/dist/autopilot-release-PNSWAVZG.js +1 -0
- package/dist/{chunk-EP6Q2QBU.js → chunk-2RF75G5T.js} +1 -1
- package/dist/{chunk-4R7STECB.js → chunk-5OLNT6YD.js} +63 -63
- package/dist/{chunk-GED7JURY.js → chunk-5PFFR5S7.js} +1 -1
- package/dist/{chunk-QZODGRAI.js → chunk-5TKRCE6F.js} +1 -1
- package/dist/{chunk-IGJA6GBQ.js → chunk-62YBFWHY.js} +1 -1
- package/dist/chunk-6WOFOOM7.js +7 -0
- package/dist/{chunk-ZLCLGIM6.js → chunk-7LKCWDX6.js} +1 -1
- package/dist/chunk-7Q7X4X5I.js +1 -0
- package/dist/chunk-BVWDG66W.js +1 -0
- package/dist/{chunk-DNZHKBQ3.js → chunk-COBU44T5.js} +1 -1
- package/dist/chunk-CQBM6BBP.js +2 -0
- package/dist/chunk-CY4QZ3PE.js +3 -0
- package/dist/{chunk-LE2I2E6R.js → chunk-D5RUGSBC.js} +2 -2
- package/dist/chunk-EDPUQXP6.js +5 -0
- package/dist/{chunk-IBJEQHJR.js → chunk-HV6EQMUJ.js} +24 -7
- package/dist/{chunk-V52R2W2Q.js → chunk-IX5Z6EK6.js} +1 -1
- package/dist/{chunk-N6FJZ62B.js → chunk-JQINCVK5.js} +1 -1
- package/dist/{chunk-GL3KLNIG.js → chunk-KVPTZMEV.js} +1 -1
- package/dist/{chunk-UT57IFS4.js → chunk-LDNX2R6V.js} +6 -6
- package/dist/{chunk-WUXJCSYO.js → chunk-LLEKVSMX.js} +1 -1
- package/dist/{chunk-ZPOZ6MDX.js → chunk-N2PAAQKI.js} +1 -1
- package/dist/{chunk-S2TOSHQW.js → chunk-ONV6WW7A.js} +1 -1
- package/dist/{chunk-TEMFNVO2.js → chunk-QVUVJU56.js} +1 -1
- package/dist/{chunk-AGZWDYMF.js → chunk-QYXX6G5O.js} +8 -8
- package/dist/{chunk-S42KDOGG.js → chunk-S66NO5BX.js} +1 -1
- package/dist/{chunk-KFTJVVJR.js → chunk-SATPH22S.js} +1 -1
- package/dist/{chunk-IFHM2SI6.js → chunk-SG3QRCMM.js} +1 -1
- package/dist/{chunk-Z7JIUA6I.js → chunk-SS7X2YF5.js} +1 -1
- package/dist/{chunk-IET57ZKN.js → chunk-T6KHOIEY.js} +1 -1
- package/dist/{chunk-TLMP2MGH.js → chunk-T6LCDLJ7.js} +1 -1
- package/dist/{chunk-QNHKUSBH.js → chunk-TDQ2PRHV.js} +1 -1
- package/dist/{chunk-3S2U7WRM.js → chunk-TQQEZQLC.js} +1 -1
- package/dist/{chunk-LU6CYDLN.js → chunk-UHAPXPGW.js} +1 -1
- package/dist/chunk-V4LCPLV6.js +1 -0
- package/dist/{chunk-GYN6RPNU.js → chunk-WMC2H7MJ.js} +1 -1
- package/dist/{chunk-PTSEDZIV.js → chunk-WPZUKU2B.js} +1 -1
- package/dist/chunk-X5ZNFXFI.js +1 -0
- package/dist/{create-BBALBC3U.js → create-7CWWGDXQ.js} +1 -1
- package/dist/{doctor-WWVY7NB6.js → doctor-WYBSI3GC.js} +1 -1
- package/dist/{dotnet-webapi-clean-XL4IBUQV.js → dotnet-webapi-clean-VJX6SGGP.js} +39 -33
- package/dist/{goal-lifecycle-CEUTKUNV.js → goal-lifecycle-PSPYQ4TR.js} +1 -1
- package/dist/{goal-pack-JQL3YOKT.js → goal-pack-G7SAYDIC.js} +1 -1
- package/dist/{gofiber-standard-OHHMCNMJ.js → gofiber-standard-I6ASLOEE.js} +77 -66
- package/dist/{gogin-standard-BAZXPOKL.js → gogin-standard-U2LSRLIP.js} +78 -67
- package/dist/index.js +121 -121
- package/dist/{pipeline-V46WWMP4.js → pipeline-NDV7DBB7.js} +1 -1
- package/dist/{project-agent-entry-MRAYG7QD.js → project-agent-entry-HEBGPLMX.js} +1 -1
- package/dist/{project-intelligence-lens-4BKPN4PE.js → project-intelligence-lens-QTQEZXUY.js} +1 -1
- package/dist/{project-test-coverage-4RRCHY5W.js → project-test-coverage-4BGDDBBL.js} +1 -1
- package/dist/{proof-carrying-change-B7ONTBYO.js → proof-carrying-change-SHO2E3DX.js} +1 -1
- package/dist/{rust-axum-CCJ6UCBW.js → rust-axum-JMV7UPO7.js} +25 -20
- package/dist/{springboot-standard-M5JQEJML.js → springboot-standard-OC2RS3KC.js} +41 -39
- package/dist/verified-goal-BSREU6R7.js +1 -0
- package/dist/{workspace-FJ6JRYWA.js → workspace-E3MM3AIE.js} +1 -1
- package/dist/{workspace-agent-sync-V33UGII3.js → workspace-agent-sync-NBIOSXCG.js} +1 -1
- package/dist/{workspace-context-O6UBCBEA.js → workspace-context-ZDXF6S7S.js} +1 -1
- package/dist/{workspace-contract-S2JYDA4K.js → workspace-contract-E7GVWM7W.js} +1 -1
- package/dist/{workspace-explain-RP6VJ6QM.js → workspace-explain-YB66UFAS.js} +1 -1
- package/dist/{workspace-foundation-7QXEJJKZ.js → workspace-foundation-LRLYPR36.js} +1 -1
- package/dist/{workspace-graph-stream-YY65R5EC.js → workspace-graph-stream-SJUCBPS4.js} +1 -1
- package/dist/workspace-graph-token-efficiency-BTIS6JXL.js +1 -0
- package/dist/{workspace-intelligence-LMR42ICR.js → workspace-intelligence-3IAAM3H3.js} +1 -1
- package/dist/{workspace-intelligence-benchmark-S5OXVNLC.js → workspace-intelligence-benchmark-UCGDKMDF.js} +1 -1
- package/dist/{workspace-intelligence-runner-FXFSTCHC.js → workspace-intelligence-runner-FPPKTSNK.js} +1 -1
- package/dist/{workspace-knowledge-graph-3564KQXT.js → workspace-knowledge-graph-WNQMNAVL.js} +1 -1
- package/dist/{workspace-knowledge-graph-query-WHCGPBGS.js → workspace-knowledge-graph-query-3GPXGWYN.js} +1 -1
- package/dist/workspace-knowledge-graph-snapshot-MTFTCVFF.js +1 -0
- package/dist/{workspace-mcp-serve-ZK46EZUD.js → workspace-mcp-serve-KSZ2O66S.js} +1 -1
- package/dist/{workspace-model-6UMQAGUK.js → workspace-model-5FA2636K.js} +1 -1
- package/dist/{workspace-onboarding-C57OQ7XZ.js → workspace-onboarding-RJMTHN7Z.js} +1 -1
- package/dist/{workspace-registry-summary-GLQO4ZUF.js → workspace-registry-summary-WKENOFEA.js} +1 -1
- package/dist/workspace-repair-engine-4JTNNDZL.js +3 -0
- package/dist/workspace-run-HFOY2UYT.js +1 -0
- package/dist/{workspace-verify-LQHXBH2D.js → workspace-verify-37QL2JYE.js} +1 -1
- package/dist/{workspace-watch-Z32443UP.js → workspace-watch-P5X6TAFK.js} +1 -1
- package/docs/README.md +5 -2
- package/docs/README_CONTENT_CONTRACT.md +14 -9
- package/docs/ci-workflows.md +1 -1
- package/docs/commands-reference.md +53 -34
- package/docs/contracts/ARTIFACT_CATALOG.md +4 -1
- package/docs/doctor-command.md +13 -0
- package/docs/native-kit-baselines.md +82 -0
- package/docs/workspace-knowledge-graph.md +17 -2
- package/docs/workspace-repair-engine.md +9 -1
- package/docs/workspace-run.md +29 -0
- package/package.json +1 -1
- package/dist/analyze-OGWDSPXQ.js +0 -1
- package/dist/autopilot-release-QQDFEPT7.js +0 -1
- package/dist/chunk-DWL3PPLA.js +0 -1
- package/dist/chunk-EZPLMAW2.js +0 -1
- package/dist/chunk-IHKG5C6G.js +0 -1
- package/dist/chunk-IRLKWRLP.js +0 -3
- package/dist/chunk-TKXRP2B4.js +0 -1
- package/dist/chunk-U5ENEDJA.js +0 -7
- package/dist/chunk-WCJU3CFG.js +0 -1
- package/dist/chunk-XSSNM4F5.js +0 -5
- package/dist/verified-goal-YNSBL7L3.js +0 -1
- package/dist/workspace-graph-token-efficiency-WNAFAN2F.js +0 -1
- package/dist/workspace-knowledge-graph-snapshot-P27RPMV5.js +0 -1
- package/dist/workspace-repair-engine-5ZSSF3T5.js +0 -3
- package/dist/workspace-run-UGWGT3K2.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-LPCWROQ3.js';import {q,p,r as r$1,t}from'./chunk-ODK4LCEL.js';var R=q.repairTransaction,x=p.repairTransaction,C=r$1.repairTransaction,S=["approve-guarded","approve-invasive","allow-breaking","allow-force","replan","manual-repair","rollback","cancel"];var y="workspai.workspace-repair-proposal.v1",j="contracts/workspace-intelligence/workspace-repair-proposal.v1.json";var A="workspai.workspace-repair-capabilities.v1",w="workspai.workspace-repair-consumer-protocol.v1",v=["project","workspace","linked-project","polyglot-project"],d=["missing-tool","stale-evidence","missing-artifact","no-op-proposal","source-drift","validation-failure","producer-failure","provider-outage","interrupted-rollback","unsupported-runtime"],u=["automatic-refresh","bounded-replan","decision-required","checkpoint-rollback","durable-resume","manual-repair"],h={"missing-tool":"decision-required","stale-evidence":"automatic-refresh","missing-artifact":"automatic-refresh","no-op-proposal":"bounded-replan","source-drift":"bounded-replan","validation-failure":"checkpoint-rollback","producer-failure":"bounded-replan","provider-outage":"durable-resume","interrupted-rollback":"durable-resume","unsupported-runtime":"manual-repair"};function P(){let i=[],s=c.map(o=>o.id);new Set(s).size!==s.length&&i.push("adapter ids are not unique"),v.length<4&&i.push("scope matrix is incomplete"),d.length<10&&i.push("failure-family matrix is incomplete"),u.length<6&&i.push("recovery-path matrix is incomplete");for(let o of d){let t=h[o];u.includes(t)||i.push(`${o} has no bounded recovery policy`);}for(let o of c)for(let t of ["reconcile","audit","test","build"])o.stages[t]||i.push(`${o.id}.${t} is undeclared`);return i}var c=[{id:"node",ecosystem:"JavaScript / TypeScript",manifests:["package.json"],lockfiles:["package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb"],packageManagers:["npm","pnpm","yarn","bun"],support:"full",stages:{reconcile:"native",audit:"native",test:"declared",build:"declared"},requiredToolFamilies:["selected package manager"]},{id:"python",ecosystem:"Python",manifests:["pyproject.toml","requirements.txt"],lockfiles:["uv.lock","poetry.lock","requirements.txt"],packageManagers:["uv","poetry","pip"],support:"conditional",stages:{reconcile:"conditional",audit:"conditional",test:"conditional",build:"declared"},requiredToolFamilies:["isolated Python","selected environment manager","pip-audit or governed Doctor audit"],limitation:"A bounded isolated environment and an installed audit surface are required."},{id:"go",ecosystem:"Go",manifests:["go.mod"],lockfiles:["go.sum"],packageManagers:["go modules"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["go","govulncheck"],limitation:"govulncheck must be installed; the engine never fetches an unreviewed tool."},{id:"rust",ecosystem:"Rust",manifests:["Cargo.toml"],lockfiles:["Cargo.lock"],packageManagers:["cargo"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["cargo","cargo-audit"],limitation:"The cargo-audit subcommand must already be installed."},{id:"php-composer",ecosystem:"PHP",manifests:["composer.json"],lockfiles:["composer.lock"],packageManagers:["composer"],support:"full",stages:{reconcile:"native",audit:"native",test:"declared",build:"declared"},requiredToolFamilies:["composer"]},{id:"ruby-bundler",ecosystem:"Ruby",manifests:["Gemfile"],lockfiles:["Gemfile.lock"],packageManagers:["bundler"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"declared",build:"declared"},requiredToolFamilies:["bundle","bundle-audit"],limitation:"bundle-audit and the declared Rake tasks must already exist."},{id:"elixir-mix",ecosystem:"Elixir",manifests:["mix.exs"],lockfiles:["mix.lock"],packageManagers:["mix"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["mix","Hex audit task"],limitation:"The project must expose the Hex audit task used by its dependency policy."},{id:"deno",ecosystem:"Deno",manifests:["deno.json","deno.jsonc"],lockfiles:["deno.lock"],packageManagers:["deno"],support:"full",stages:{reconcile:"native",audit:"native",test:"declared",build:"declared"},requiredToolFamilies:["deno"]},{id:"dotnet",ecosystem:".NET",manifests:["*.sln","*.csproj","*.fsproj","*.vbproj"],lockfiles:["Directory.Packages.props","packages.lock.json"],packageManagers:["NuGet / dotnet"],support:"full",stages:{reconcile:"native",audit:"native",test:"native",build:"native"},requiredToolFamilies:["dotnet"]},{id:"jvm-maven",ecosystem:"JVM / Maven",manifests:["pom.xml"],lockfiles:[],packageManagers:["Maven Wrapper","Maven"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["mvnw or mvn","governed Doctor audit"],limitation:"A project-specific dependency audit command must be declared by Doctor evidence."},{id:"jvm-gradle",ecosystem:"JVM / Gradle",manifests:["build.gradle.kts","build.gradle"],lockfiles:["gradle.lockfile","gradle/libs.versions.toml"],packageManagers:["Gradle Wrapper","Gradle"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["gradlew or gradle","governed Doctor audit"],limitation:"A project-specific dependency audit command must be declared by Doctor evidence."},{id:"clojure",ecosystem:"Clojure",manifests:["deps.edn","project.clj"],lockfiles:[],packageManagers:["Clojure CLI","Leiningen"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"conditional",build:"conditional"},requiredToolFamilies:["clojure or lein","governed project audit"],limitation:"Tests and builds run only when the selected Clojure project surface declares a deterministic entrypoint."},{id:"scala-sbt",ecosystem:"Scala / sbt",manifests:["build.sbt"],lockfiles:[],packageManagers:["sbt"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["sbt","governed project audit"],limitation:"A project-specific dependency audit command must be declared by Doctor evidence."}];function N(){let i=P();if(i.length>0)throw new Error(`Workspace Repair qualification matrix is incomplete: ${i.join("; ")}`);return {schemaVersion:A,owner:"Workspai CLI",workflow:["plan","preconditions","approval","target-precondition","checkpoint","execute","reconcile","audit","test","build","target-producer-verify","canonical-verify","close-or-rollback-or-decision"],invariants:{multiAdapterProjects:true,missingTools:"decision-required",missingToolSameGenerationRetry:false,missingToolResumeBoundary:"environment-change-and-fresh-plan",plannerExecutorAvailabilityProbe:"shared-launchability-check",setupInstallsHostRuntimes:false,unsupportedEcosystems:"decision-required",silentFallbackToModelExecution:false,mutationAuthority:"cli-only",targetClosure:"selected-causal-action-set",changeReceipt:"checkpoint-hash-delta",consumerTimeline:"durable-transaction-events",typedDecisionCauses:true,registeredLinkedProjectMutationBoundary:true,sourceProposalIntegrity:"project-bound-hash-pinned",completionAuthority:"cli-verification-receipt",goalSourceTransition:"closed-integrity-bound-v1",goalAttemptBudget:"durable-serialized-v1",consumerHandshakeRequired:true,ephemeralProposalsAreEvidence:false,approvalBoundToPlanHash:true,canonicalVerificationRequired:true,rollbackConflictDetection:true},consumerProtocol:{protocolVersion:w,versionProbe:{args:["--version","--json"],schemaVersion:"rapidkit-version-v1"},capabilityProbe:{args:["workspace","repair","capabilities","--json"],schemaVersion:A},invocation:{command:"workspace repair",workspaceResolution:["process-cwd","--workspace"],actions:["capabilities","plan","propose","approve","decide","execute","resume","status","list","rollback","cancel"]},contracts:{operationResult:a$1,proposal:y,transaction:R},transientPaths:[".workspai/repair/inbox/*.json",".workspai/repair/engine.lock"]},qualificationMatrix:{schemaVersion:"workspai.workspace-repair-qualification-matrix.v1",status:"contract-enforced",dimensions:{adapters:c.map(s=>s.id),scopes:v,failureFamilies:d,recoveryPaths:u,failureRecoveryPolicy:h},invariants:{everyAdapterDeclaresClosureStages:true,everyFailureTerminates:true,everyMutationIsCheckpointed:true,workspaceAndProjectScopesUseTheSameEngine:true,linkedProjectsRemainBoundaryChecked:true,missingToolsBlockExecutionBeforeApproval:true,polyglotActionsDeclareIndependentExecutablePrerequisites:true}},adapters:c}}var V="workspai.studio-card-repair-capabilities.v1",b="npx workspai workspace verify --json",r=p,a=t;function e(i,s,o,t={}){return {cardId:i,scope:t.scope??"workspace",producerCommand:s,producerArtifact:o,verifyCommand:s,verifyArtifact:o,aggregateVerifyCommand:b,targetClosure:"exact-producer-and-causal-action-set",aggregateRepair:"sequential-causal-queue",transactionScope:"one-causal-finding-family",workspacePosture:"reported-separately",repairPolicy:t.repairPolicy??"refresh-producer",remediationArtifacts:t.remediationArtifacts??[]}}var D=[e("doctor","npx workspai doctor workspace --json",r.doctor,{repairPolicy:"diagnose-and-repair",remediationArtifacts:[a.doctorRemediationPlan,a.artifactRemediationPlan]}),e("projectDoctor","npx workspai doctor project --json",a.doctorProject,{scope:"project",repairPolicy:"diagnose-and-repair",remediationArtifacts:[a.doctorRemediationPlan,a.artifactRemediationPlan]}),e("pipeline","npx workspai pipeline --json --strict",a.pipelineLastRun,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[a.artifactRemediationPlan]}),e("analyze","npx workspai analyze --json",r.analyze,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[a.artifactRemediationPlan]}),e("readiness","npx workspai readiness --json",r.readiness,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[a.artifactRemediationPlan]}),e("bootstrap","npx workspai bootstrap --ci --json",a.bootstrapCompliance,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[a.artifactRemediationPlan]}),e("workspaceSync","npx workspai workspace sync --json",a.workspaceRegistry),e("foundation","npx workspai workspace foundation ensure --json",".workspai/workspace.json"),e("contract","npx workspai workspace contract verify --strict --json",r.contractVerify,{repairPolicy:"source-repair-then-produce"}),e("autopilot","npx workspai autopilot release --json",a.autopilotReleaseLastRun,{repairPolicy:"source-repair-then-produce"}),e("workspaceRun","npx workspai workspace run test --json",a.workspaceRunLast,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[a.artifactRemediationPlan]}),e("setup","npx workspai setup --json",".workspai/toolchain.lock",{repairPolicy:"source-repair-then-produce"}),e("importReadiness","npx workspai doctor project --json",a.doctorProject,{scope:"project",repairPolicy:"diagnose-and-repair",remediationArtifacts:[a.artifactRemediationPlan]}),e("snapshot","npx workspai snapshot create --json",".workspai/reports/snapshot-last-run.json"),e("workspaceModel","npx workspai workspace model --json --write",r.model),e("intelligenceSnapshot","npx workspai workspace snapshot --json",r.snapshot),e("workspaceDiff",`npx workspai workspace diff --from ${r.snapshot} --json`,r.diff),e("workspaceImpact",`npx workspai workspace impact --from ${r.diff} --json`,r.impact),e("workspaceIntelligenceRun","npx workspai workspace intelligence run --for-agent generic --strict --json",r.intelligenceRun,{repairPolicy:"source-repair-then-produce"}),e("workspaceVerify",b,r.verify,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[a.artifactRemediationPlan]}),e("workspaceExplain","npx workspai workspace explain release-blocked --json --write",r.explain),e("workspaceWhy","npx workspai workspace why release-blocked --json --write",a.workspaceWhy),e("workspaceTrace",`npx workspai workspace trace --from ${r.diff} --json --write`,a.workspaceTrace),e("workspaceWatch","npx workspai workspace watch --once --json",r.model),e("workspaceContextAgent","npx workspai workspace context --for-agent --json --write",r.agentContext),e("agentGrounding","npx workspai workspace agent-sync --write --refresh-context --json --preset enterprise --target vscode",r.agentCustomizationPack),e("share",`npx workspai workspace share --output ${a.workspaceShareBundle} --json`,a.workspaceShareBundle),e("archive","npx workspai workspace export --output team-workspace.workspai-archive.zip --json",".workspai/archive-manifest.json"),e("mirror","npx workspai mirror status --json",a.mirrorOps),e("cache","npx workspai cache status --json",".workspai/cache-config.yml"),e("policy","npx workspai workspace policy show --json",".workspai/policies.yml",{repairPolicy:"source-repair-then-produce"}),e("infra","npx workspai infra plan --json",a.infraPlan,{repairPolicy:"source-repair-then-produce"})];export{R as a,x as b,C as c,S as d,y as e,j as f,A as g,c as h,N as i,V as j,D as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-62YBFWHY.js';import {m,j,e}from'./chunk-UNXG3ZFV.js';import {a as a$1}from'./chunk-AFIFZTOY.js';import {a}from'./chunk-2LIVMG5C.js';import {s}from'./chunk-ODK4LCEL.js';import x from'crypto';import l from'path';import g from'fs-extra';var L=s.workspaceIntelligenceBenchmark.schemaVersion,O=s.workspaceIntelligenceBenchmark.artifactPath,S=s.workspaceIntelligenceBenchmark.contractPath,q={"agent-core.v1":{id:"agent-core.v1",version:1,title:"Cross-project agent retrieval core",scenarios:[{id:"architecture",title:"Architecture and runtime discovery",preferredKinds:["service","runtime-unit","language","project","workspace"]},{id:"ownership",title:"Dependency and ownership discovery",preferredKinds:["package","module","owner","project","workspace"]},{id:"interfaces",title:"Interface and contract discovery",preferredKinds:["api","endpoint","protocol","schema","project","workspace"]},{id:"change-safety",title:"Change safety and verification discovery",preferredKinds:["test-suite","lifecycle-stage","pipeline","module","project","workspace"]},{id:"delivery",title:"Build and delivery discovery",preferredKinds:["pipeline","deployment","container","lifecycle-stage","project","workspace"]}]}};function y(e,t){if(e.length===0)return 0;let n=[...e].sort((a,r)=>a-r),i=Math.min(n.length-1,Math.max(0,Math.ceil(t*n.length)-1));return n[i]??0}function G(e,t){let n=new Map;for(let a of e.entities){let r=a.label.trim().toLowerCase();n.set(r,(n.get(r)??0)+1);}for(let a of t){let r=e.entities.filter(s=>s.kind===a).sort((s,m)=>s.id.localeCompare(m.id)),o=r.find(s=>n.get(s.label.trim().toLowerCase())===1);if(o)return {entity:o,query:o.label};let u=r[0];if(u)return {entity:u,query:u.identity.key}}let i=[...e.entities].sort((a,r)=>a.id.localeCompare(r.id))[0];if(!i)throw new Error("Workspace benchmark requires at least one graph entity.");return {entity:i,query:i.identity.key}}function R(e){if(!e||e.summary.modelCalls===0)return "unavailable";let t=e.summary.tokenSources,n=t.providerReported+t.tokenizerCounted;return n+t.estimated+t.unavailable!==e.summary.modelCalls?"mixed":n===e.summary.modelCalls?"measured":t.estimated===e.summary.modelCalls?"estimated":t.unavailable===e.summary.modelCalls?"unavailable":"mixed"}function H(e){return e.comparison?.taskAligned===true&&e.comparison.comparableOutcome===true&&e.currentProvenance==="measured"&&e.baselineProvenance==="measured"?e.comparison.delta.reductionPercent:null}async function W(e,t){try{return await j(e,t)}catch{return}}async function Y(e$1){let t=l.resolve(e$1.workspacePath),n=e$1.suite??"agent-core.v1",i=q[n],a$2=[],r;for(let c of i.scenarios){let v=G(e$1.graph,c.preferredKinds),h=v.entity,d=await b({workspacePath:t,graph:e$1.graph,query:v.query,limit:e$1.limit??12,...r?{corpus:r}:{},now:e$1.now});r=d.corpus;let C=d.retrieval.payload.entities.some(M=>M.id===h.id);a$2.push({id:c.id,title:c.title,query:v.query,queryOrigin:"graph-derived",targetEntityId:h.id,targetKind:h.kind,targetRetrieved:C,result:C?"matched":"empty",matchCount:d.retrieval.matchCount,truncated:d.retrieval.truncated,retrievalCharacterCount:d.retrieval.characterCount,retrievalEstimatedTokens:d.retrieval.estimatedTokens,estimatedTokensAvoided:d.savings.estimatedTokensAvoided,estimatedReductionPercent:d.savings.reductionPercent});}r??={artifactCount:0,characterCount:0,estimatedTokens:0,unreadableArtifacts:[]};let o=await W(t,e$1.evaluationPath??e),u=e$1.baselineEvaluationPath?await W(t,e$1.baselineEvaluationPath):void 0,s=o&&u?m(o,u):void 0,m$1=R(o),_=R(u),K=H({comparison:s,currentProvenance:m$1,baselineProvenance:_}),N=await a(t),f=a$2.filter(c=>c.result==="matched").length,E=a$2.map(c=>c.retrievalEstimatedTokens),B=a$2.map(c=>c.estimatedReductionPercent),b$1={schemaVersion:L,generatedAt:(e$1.now??new Date).toISOString(),workspace:{name:N?.name||l.basename(t),path:t},suite:{id:i.id,version:i.version,title:i.title},graph:{schemaVersion:e$1.graph.schemaVersion,sourceArtifact:e$1.graph.source.artifact,sourceHash:e$1.graph.source.hash,entityCount:e$1.graph.entities.length,relationCount:e$1.graph.relations.length,proofCount:e$1.graph.proofs.length},methodology:{id:"multi-scenario-bounded-retrieval.v1",charsPerEstimatedToken:4,deterministic:true,networkRequired:false,scenarioTargetPolicy:"evidence-backed-representative.v1",claimBoundary:"Retrieval values estimate payload size against readable proof-source text across fixed scenario categories with deterministic evidence-backed representative targets. They do not establish answer equivalence, model billing savings, or task success."},corpus:r,scenarios:a$2,retrievalSummary:{provenance:"estimated",scenarioCount:a$2.length,matchedScenarioCount:f,medianRetrievalEstimatedTokens:y(E,.5),p95RetrievalEstimatedTokens:y(E,.95),medianEstimatedReductionPercent:y(B,.5),status:r.estimatedTokens===0?"unavailable":f===a$2.length?"passed":"partial"},evaluation:{availability:o?"available":"unavailable",provenance:m$1,...o?{current:{runId:o.runId,taskId:o.configuration.taskId,strategy:o.configuration.strategy,status:o.status,summary:o.summary}}:{},...s?{comparison:s}:{},trustedMeasuredReductionPercent:K,claimBoundary:"A measured reduction is reported only for task-aligned runs with comparable verified outcomes when every model call in both runs uses provider-reported or tokenizer-counted usage."}};return a$1(b$1,S,"workspace intelligence benchmark"),b$1}async function Z(e,t,n=O){a$1(t,S,n);let i=l.isAbsolute(n)?n:l.join(l.resolve(e),n),a=l.relative(l.resolve(e),i);if(a.startsWith("..")||l.isAbsolute(a))throw new Error("Workspace benchmark output must remain inside the workspace.");await g.ensureDir(l.dirname(i));let r=`${i}.${process.pid}.${x.randomUUID()}.tmp`;try{await g.writeJson(r,t,{spaces:2}),await g.rename(r,i);}finally{await g.remove(r).catch(()=>{});}return i}export{L as a,O as b,S as c,q as d,R as e,H as f,Y as g,Z as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {z as z$1}from'./chunk-KFTJVVJR.js';import {j,m as m$1}from'./chunk-U5ENEDJA.js';import {a as a$1}from'./chunk-GR6442P7.js';import {a as a$2,g,f,h}from'./chunk-FE5R6EUV.js';import {b}from'./chunk-K33JJVQZ.js';import {l}from'./chunk-OCGZNSOE.js';import {t,p,s,q}from'./chunk-ODK4LCEL.js';import {c}from'./chunk-64XWHDZ3.js';import {a}from'./chunk-XWKGZRHN.js';import {t as t$1,u,q as q$1}from'./chunk-VQZ5PI5J.js';import*as m from'path';import m__default from'path';import k from'fs-extra';import Ce from'crypto';var ye="unknown-run";function se(e){let t=c();return !t||t===ye?e:{...e,runId:t}}async function ce(e,t){await k.ensureDir(m.dirname(e));let r=`${e}.${process.pid}.${Date.now()}.${Ce.randomUUID()}.tmp`;try{await k.writeJSON(r,t,{spaces:2}),await k.move(r,e,{overwrite:true});}finally{await k.remove(r).catch(()=>{});}}function ie(e){return q$1(e,"imported-projects.json")}async function I(e){let t=(await Promise.all(t$1(e,"imported-projects.json").map(async r=>await k.pathExists(r)?r:null))).find(r=>typeof r=="string");if(!t)return [];try{let r=await k.readJSON(t);if(!r||typeof r!="object"||r.version!==1||!Array.isArray(r.projects))throw new Error("expected a version 1 registry with a projects array");let o=r.projects,n=o.filter(i=>{if(!i||typeof i!="object")return false;let c=i;return typeof c.name=="string"&&typeof c.path=="string"&&typeof c.stack=="string"&&typeof c.confidence=="string"&&typeof c.importedAt=="string"});if(n.length!==o.length)throw new Error("one or more project entries are invalid");return n}catch(r){throw new Error(`Imported-project registry is invalid: ${t}`,{cause:r})}}async function He(e,t){if(t.length===0)return;let r=ie(e);await a(`${r}.lock`,async()=>{let o=await I(e),n=new Map;for(let c of o)n.set(c.path,c);for(let c of t)n.set(c.path,c);let i=Array.from(n.values()).sort((c,u)=>c.name.localeCompare(u.name)).map(c=>({...c}));await ce(r,{version:1,updatedAt:new Date().toISOString(),projects:i});},{timeoutMs:3e4,staleMs:6e4,purpose:"imported-projects-registry-upsert"});}async function Je(e,t){if(t.length===0)return;let r=ie(e);await a(`${r}.lock`,async()=>{let o=await I(e),n=new Set(t.map(c=>m.resolve(c))),i=o.filter(c=>!n.has(m.resolve(c.path)));await ce(r,{version:1,updatedAt:new Date().toISOString(),projects:i});},{timeoutMs:3e4,staleMs:6e4,purpose:"imported-projects-registry-remove"});}var ze="workspace-dependency-graph.v1",pe=["code-import","package-dep","event-pub-sub","service-dependsOn","shared-resource"],de=["inferred","contract","manual"];var v=t.workspaceContract,Ee=p.contractVerify,_=s.workspaceContract.schemaVersion,ve=q.contractVerify,N=class extends Error{constructor(r){super(`Workspace contract verification failed: ${r.violations.join("; ")}`);this.verification=r;this.name="WorkspaceContractVerificationError";}verification};function fe(e){return e.replace(/\\/g,"/")}function z(e){let t=fe(e).trim();return !t||t.startsWith("/")||t.startsWith("~")||/^[a-zA-Z]:\//.test(t)||t.includes("\0")?false:!t.split("/").filter(Boolean).some(r=>r===".."||r===".")}function le(e,t){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^[-_.]+|[-_.]+$/g,"").slice(0,80)||t}function je(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim().length>0):[]}function ue(e){let r=(Array.isArray(e.ports)?e.ports:[]).map(i=>{if(!i||typeof i!="object"||Array.isArray(i))return null;let c=i,u=Number(c.port);if(!Number.isInteger(u)||u<1||u>65535)return null;let g=c.protocol==="https"||c.protocol==="grpc"||c.protocol==="tcp"||c.protocol==="udp"?c.protocol:"http";return {name:typeof c.name=="string"&&c.name.trim()?c.name:"http",port:u,protocol:g}}).filter(i=>i!==null);if(r.length>0)return r;let o=e.frontend&&typeof e.frontend=="object"&&!Array.isArray(e.frontend)?e.frontend:void 0,n=Number(e.port??o?.default_port);return Number.isInteger(n)&&n>=1&&n<=65535?[{name:"http",port:n,protocol:"http"}]:[]}async function be(e){let t=m__default.join(e,"Dockerfile");if(!await k.pathExists(t))return [];try{let r=await k.readFile(t,"utf8"),o=new Map;for(let n of r.matchAll(/^\s*EXPOSE\s+(.+)$/gim))for(let i of n[1].split(/\s+/)){let c=i.match(/^(\d{1,5})(?:\/(tcp|udp))?$/i),u=Number(c?.[1]);if(!c||!Number.isInteger(u)||u<1||u>65535)continue;let g=c[2]?.toLowerCase();o.set(u,{name:"http",port:u,protocol:g==="udp"?"udp":"http"});}return [...o.values()].sort((n,i)=>n.port-i.port)}catch{return []}}async function D(e){for(let t of e)if(await k.pathExists(t))return t;return null}async function We(e){for(let t of t$1(e,"workspace.json"))try{let r=await k.readJson(t);return {name:typeof r.workspace_name=="string"&&r.workspace_name.trim()||typeof r.name=="string"&&r.name.trim()||m__default.basename(e),profile:typeof r.profile=="string"?r.profile:void 0}}catch{}return {name:m__default.basename(e)}}async function Se(e){let t=[],r=[e],o=new Set,n=new Set([".git",".workspai",".rapidkit","node_modules",".venv","venv","dist","build","target",".next",".turbo",".cache"]);for(;r.length>0;){let i=r.shift();if(!i||o.has(i))continue;o.add(i);let c=await D(u(i,"project.json")),u$1=await D(u(i,"context.json"));if(c||u$1){t.push(c??u$1??"");continue}let g;try{g=await k.readdir(i,{withFileTypes:true});}catch{continue}for(let d of g)!d.isDirectory()||n.has(d.name)||a$1(d.name)||r.push(m__default.join(i,d.name));}return t.sort()}function Ae(e){let t=(e||"").toLowerCase();if(t.includes("fastapi"))return "fastapi";if(t.includes("nestjs"))return "nestjs";if(t.includes("springboot"))return "springboot";if(t.includes("gofiber"))return "fiber";if(t.includes("gogin"))return "gin"}function Re(e,t){let r=(e||"").toLowerCase(),o=(t||"").toLowerCase();return r.includes("vscode-extension")?null:r.includes("fastapi")?8e3:r.includes("nestjs")?3e3:r.includes("springboot")?8080:r.includes("gofiber")?3e3:r.includes("gogin")?8080:r.startsWith("adopted.")?null:o==="node"?3e3:o==="python"?8e3:o==="java"||o==="go"?8080:null}function U(e,t){let r=e;for(;t.has(r)&&r<65535;)r+=1;return r}function B(e,t,r){let o=e!==void 0&&e.source===void 0,n=Re(t.kit,t.runtime),i=e?.ports||[],c=t.ports||[],u=(t.kit||"").toLowerCase().includes("vscode-extension"),g=t.source==="adopted-local"&&e?.source!==void 0,d=t.source!==void 0&&e?.source!==void 0,p=(u&&c.length===0?[]:g?c.length>0?c:n?[{name:"http",port:U(n,r),protocol:"http"}]:[]:i.length>0?i:c.length>0?c:n?[{name:"http",port:U(n,r),protocol:"http"}]:[]).map(w=>({...w,port:U(w.port,r)}));for(let w of p)r.add(w.port);let f={...t,...e,slug:e?.slug||t.slug,relativePath:o&&e?.relativePath&&z(e.relativePath)?e.relativePath:t.relativePath,source:o&&e?.source||t.source,relationship:o&&e?.relationship||t.relationship,externalPath:o&&e?.externalPath||t.externalPath,runtime:d?t.runtime:e?.runtime||t.runtime,framework:d?t.framework:e?.framework||t.framework,kit:d?t.kit:e?.kit||t.kit,modules:e?.modules?.length?e.modules:t.modules,ports:p,contracts:{owns:e?.contracts?.owns||[],apis:e?.contracts?.apis||[],publishes:e?.contracts?.publishes||[],consumes:e?.contracts?.consumes||[],dependsOn:e?.contracts?.dependsOn||[],env:e?.contracts?.env||[]}},h=JSON.stringify(e||null)!==JSON.stringify(f);return {project:f,changed:h}}async function he(e){let t=m__default.resolve(e.workspacePath),r=await We(t),o=await Se(t),n=await I(t),i=new Map(n.map(s=>[m__default.resolve(s.path),s])),c=[];for(let s of n){let p=m__default.resolve(s.path),f=await D(u(p,"project.json"))??await D(u(p,"context.json"));!f||o.some(h=>m__default.resolve(h)===m__default.resolve(f))||c.push({projectJsonPath:f,registryEntry:s});}let u$1=[],g=[...o.map(s=>({projectJsonPath:s,registryEntry:i.get(m__default.resolve(m__default.dirname(m__default.dirname(s))))})),...c];for(let{projectJsonPath:s,registryEntry:p}of g){let f=m__default.dirname(m__default.dirname(s)),h=fe(m__default.relative(t,f)),w=p!==void 0&&!z(h),C=le(p?.name||m__default.basename(f),m__default.basename(f)),b=w?`external/${C}`:h||C,P=await k.readJson(s),a=typeof P.kit_name=="string"&&P.kit_name||typeof P.kit=="string"&&P.kit||void 0,E=j(P)?m$1(f,P):void 0,j$1=E!==void 0&&E.key!=="unknown",T=j$1?E.runtime:typeof P.runtime=="string"?P.runtime:void 0,y=j$1?E.key:typeof P.framework=="string"&&P.framework||Ae(a),$=p?.relationship==="adopted"?"adopted":"imported",K=j$1?`${$}.${E.key}`:a;u$1.push({slug:p?.name||b||m__default.basename(f),relativePath:b,source:p?.source??"workspace",relationship:p?.relationship,externalPath:w?f:void 0,runtime:T,framework:y,kit:K,modules:je(P.modules),ports:ue(P).length>0?ue(P):await be(f),contracts:{owns:[],apis:[],publishes:[],consumes:[],dependsOn:[],env:[]}});}let d=new Map;for(let s of u$1){let p=le(s.slug,s.relativePath),f=d.get(p);(!f||f.source!=="workspace"&&s.source==="workspace")&&d.set(p,s);}return {schemaVersion:_,kind:"rapidkit.workspace.contract",generatedAt:(e.now??new Date).toISOString(),workspace:r,projects:[...d.values()]}}async function dt(e){let t=m__default.resolve(e.outputPath||a$2(e.workspacePath,v));if(await k.pathExists(t)&&e.force!==true)throw new Error(`Workspace contract already exists: ${t}. Use --force to overwrite.`);let r=await he({workspacePath:e.workspacePath,now:e.now}),o=new Set,n={...r,projects:r.projects.map(c=>B(void 0,c,o).project)},i=await Pe({workspacePath:e.workspacePath,contractPath:t,contract:n});if(e.strict&&i.status==="failed")throw new N(i);return await ke({workspacePath:e.workspacePath,contractPath:t,contract:n,now:e.now}),{contractPath:t,contract:n}}async function lt(e){let t=m__default.resolve(e.workspacePath),r=a$2(t,v),o=await g(t,v)??r,n=await he({workspacePath:t,now:e.now}),i=await k.pathExists(o)?await k.readJson(o):null,c=new Map((i?.projects||[]).map(h=>[h.slug,h])),u=new Set,g$1=[],d=[],s=[];for(let h of n.projects){let w=c.get(h.slug),C=B(w,h,u);w?C.changed&&d.push(h.slug):g$1.push(h.slug),s.push(C.project),c.delete(h.slug);}for(let h of c.values()){if(h.source)continue;let w=B(h,h,u);s.push(w.project);}let p={schemaVersion:_,kind:"rapidkit.workspace.contract",generatedAt:(e.now??new Date).toISOString(),workspace:{...i?.workspace||{},...n.workspace,name:n.workspace.name||i?.workspace?.name||m__default.basename(t)},projects:s.sort((h,w)=>h.slug.localeCompare(w.slug))},f=await Pe({workspacePath:t,contractPath:r,contract:p});if(e.strict&&f.status==="failed")throw new N(f);return await ke({workspacePath:t,contractPath:r,contract:p,now:e.now}),{contractPath:r,contract:p,addedProjects:g$1,updatedProjects:d,verification:f}}async function me(e){return await k.pathExists(e)?{exists:true,contents:await k.readFile(e)}:{exists:false}}async function ge(e,t){if(!t.exists){await k.remove(e);return}await k.outputFile(e,t.contents);}async function ke(e){let{buildWorkspaceRegistrySummary:t,WORKSPACE_REGISTRY_SUMMARY_RELATIVE_PATH:r}=await import('./workspace-registry-summary-GLQO4ZUF.js'),o=await t(e.workspacePath,{now:e.now,contract:e.contract}),n=a$2(e.workspacePath,r),i=c=>{if(!c||typeof c!="object"||Array.isArray(c))return JSON.stringify(c);let{generatedAt:u,...g}=c;return JSON.stringify(g)};if(await k.pathExists(e.contractPath)&&await k.pathExists(n)){let[c,u]=await Promise.all([k.readJson(e.contractPath),k.readJson(n)]);if(i(c)===i(e.contract)&&i(u)===i(o))return}b(v,e.contract),b(r,o),await f(e.workspacePath,v,async()=>{let[c,u]=await Promise.all([me(e.contractPath),me(n)]);try{if(e.contractPath===a$2(e.workspacePath,v)?await h(e.workspacePath,v,e.contract):(await k.ensureDir(m__default.dirname(e.contractPath)),await k.writeJson(e.contractPath,e.contract,{spaces:2})),process.env.WORKSPAI_TEST_FAIL_WORKSPACE_REGISTRY_PUBLISH==="1")throw new Error("Injected workspace registry summary publication failure.");await h(e.workspacePath,r,o);}catch(g){let s=(await Promise.allSettled([ge(e.contractPath,c),ge(n,u)])).filter(p=>p.status==="rejected");throw s.length>0?new AggregateError([g,...s.map(p=>p.reason)],"Workspace contract publication failed and rollback was incomplete."):g}});}async function we(e){let t=e.contractPath??(await g(e.workspacePath,v)||a$2(e.workspacePath,v)),r=await k.readJson(t);return {contractPath:t,contract:r}}var xe={metadata:[".workspai/project.json",".workspai/context.json",".rapidkit/project.json",".rapidkit/context.json"],manifests:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","pyproject.toml","poetry.lock","requirements.txt","go.mod","go.sum","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","Gemfile","composer.json"],entrypoints:["src/main.ts","src/index.ts","src/app.ts","src/main.js","src/index.js","main.py","app/main.py","manage.py","main.go","cmd/main.go","Program.cs"],apiSpecifications:["openapi.yaml","openapi.yml","openapi.json","swagger.yaml","swagger.yml","swagger.json"],infrastructure:["Dockerfile","docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml","k8s","kubernetes","terraform"],documentation:["README.md","ARCHITECTURE.md","CONTRIBUTING.md","docs"]};function _e(e,t){return t.externalPath?m__default.resolve(t.externalPath):m__default.resolve(e,t.relativePath)}async function Ge(e){let t={metadata:[],manifests:[],entrypoints:[],apiSpecifications:[],infrastructure:[],documentation:[]};for(let[r,o]of Object.entries(xe))for(let n of o)await k.pathExists(m__default.join(e,n))&&t[r].push(n);try{let r=await k.readdir(e,{withFileTypes:true});for(let o of r)o.isFile()&&(o.name.endsWith(".csproj")||o.name.endsWith(".sln"))&&t.manifests.push(o.name),o.isFile()&&o.name.endsWith(".tf")&&t.infrastructure.push(o.name);}catch{}for(let r of Object.values(t))r.sort((o,n)=>o.localeCompare(n));return t}function x(e){return !e||typeof e!="object"||Array.isArray(e)?[]:Object.keys(e).sort((t,r)=>t.localeCompare(r))}async function Oe(e){try{let t=await k.readJson(m__default.join(e,"package.json")),r={runtime:x(t.dependencies),development:x(t.devDependencies),peer:x(t.peerDependencies),optional:x(t.optionalDependencies)};return {...typeof t.name=="string"?{name:t.name}:{},...typeof t.version=="string"?{version:t.version}:{},...typeof t.private=="boolean"?{private:t.private}:{},scripts:x(t.scripts),dependencies:r,dependencyCount:new Set(Object.values(r).flat()).size}}catch{return}}async function Ie(e){for(let t of [".env.example",".env.sample",".env.template"])try{return (await k.readFile(m__default.join(e,t),"utf8")).split(/\r?\n/).map(o=>o.trim()).filter(o=>o.length>0&&!o.startsWith("#")&&o.includes("=")).map(o=>o.slice(0,o.indexOf("=")).trim()).filter(o=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(o)).sort((o,n)=>o.localeCompare(n))}catch{}return []}function Ne(e,t){try{let r=z$1(e);if(r.engine!=="unknown")return r;let o=k.pathExistsSync(m__default.join(e,"package.json"))?"npm":k.pathExistsSync(m__default.join(e,"pyproject.toml"))?"python":k.pathExistsSync(m__default.join(e,"requirements.txt"))?"pip":"unknown";return {...r,engine:o,runtime:t.runtime??r.runtime,framework:t.framework??r.framework,frameworkDisplayName:t.framework??r.frameworkDisplayName}}catch{return {schemaVersion:1,scope:"project",projectRoot:null,engine:"unknown",runtime:"unknown",runtimeCandidates:["unknown"],compositeRuntime:false,lifecycleCoverage:"complete",framework:"unknown",frameworkDisplayName:"Unknown",frameworkConfidence:"low",frameworkSupportTier:"observed",runtimeSupportTier:"observed",runtimeDoctorSupport:"observed",moduleSupport:false,fleetStages:[],localOnlyCommands:[],commandMap:{},supportedCommands:[],unsupportedCommands:[],globalCommands:[]}}}function De(e,t,r){let o=e.projects.map(n=>({id:n.slug,path:n.relativePath,runtime:n.runtime,framework:n.framework}));return {schemaVersion:"workspace-dependency-graph.v1",generatedAt:t,nodes:o,edges:[],stats:{nodeCount:o.length,edgeCount:0,inferredEdges:0,contractEdges:0,manualEdges:0,authoritativeEdges:0,lowConfidenceEdges:0,orphanCount:o.length,connectedNodeCount:0,density:0,edgeCoverageRatio:o.length===0?1:0,evidenceCoverageRatio:1,hotspotCount:0,hasCycle:false},diagnostics:[{code:"graph.enrichment.failed",severity:"warning",message:r,recommendation:"Review project manifests and graph overrides, then rerun workspace contract graph."}]}}async function ut(e){let{contractPath:t,contract:r}=await we(e),o=e.now??new Date,n=o.toISOString(),{buildWorkspaceModel:i,workspaceModelProjectTopology:c}=await import('./workspace-model-6UMQAGUK.js'),{hashWorkspaceModel:u}=await import('./workspace-model-hash-ZXYPIGCW.js'),g=await i({workspacePath:e.workspacePath,includeEvidence:false,now:o}),d=c(g)??De(r,n,"The canonical Workspace Model did not provide a project dependency topology."),s=new Map(d.nodes.map(a=>[a.id,a.operationalProfile])),{buildWorkspaceKnowledgeGraph:p$1}=await import('./workspace-knowledge-graph-3564KQXT.js'),f=await p$1({workspacePath:e.workspacePath,workspace:{name:g.workspace.name,...g.workspace.profile?{profile:g.workspace.profile}:{}},contract:r,projectTopology:d,now:o,projects:g.projects.map(a=>({id:a.name,path:a.path,...a.absolutePath?{absolutePath:a.absolutePath}:{},runtime:a.runtime,runtimeCandidates:a.runtimeCandidates,framework:a.framework,...a.kit?{kit:a.kit}:{}})),source:{kind:"workspace-model",artifact:p.model,hashAlgorithm:"sha256",hash:u(g)}}),h=await Promise.all(r.projects.map(async a=>{let l=_e(e.workspacePath,a),[E,j,T]=await Promise.all([Ge(l),Oe(l),Ie(l)]),y=Ne(l,a);return {id:a.slug,label:a.slug,relativePath:a.relativePath,source:a.source,relationship:a.relationship,externalPath:a.externalPath,runtime:a.runtime??y.runtime,framework:a.framework??y.framework,kit:a.kit,modules:a.modules,ports:a.ports,apis:a.contracts.apis,owns:a.contracts.owns,env:[...new Set([...a.contracts.env,...T])].sort(($,K)=>$.localeCompare(K)),contracts:{owns:[...a.contracts.owns],apis:[...a.contracts.apis],publishes:[...a.contracts.publishes],consumes:[...a.contracts.consumes],dependsOn:[...a.contracts.dependsOn],env:[...a.contracts.env]},capabilities:{engine:y.engine,supportTier:y.frameworkSupportTier,runtimeSupportTier:y.runtimeSupportTier,doctorSupport:y.runtimeDoctorSupport,moduleSupport:y.moduleSupport,fleetStages:[...y.fleetStages],localOnlyCommands:[...y.localOnlyCommands],supportedCommands:[...y.supportedCommands]},files:E,...j?{package:j}:{},...s.get(a.slug)?{operationalProfile:s.get(a.slug)}:{}}})),w=new Set(h.map(a=>a.id)),C=new Map,b=[];for(let a of r.projects){for(let l of a.contracts.dependsOn||[])w.has(l)&&b.push({from:l,to:a.slug,type:"dependency",label:"dependsOn"});for(let l of a.contracts.publishes||[])C.has(l)||C.set(l,new Set),C.get(l)?.add(a.slug);}for(let a of r.projects)for(let l of a.contracts.consumes||[]){let E=C.get(l);if(E)for(let j of E)j!==a.slug&&b.push({from:j,to:a.slug,type:"event",label:l});}let P={schemaVersion:1,kind:"rapidkit.workspace.contract.graph",workspace:r.workspace,generatedAt:n,nodes:h.sort((a,l)=>a.id.localeCompare(l.id)),edges:b.sort((a,l)=>`${a.from}:${a.to}:${a.type}:${a.label}`.localeCompare(`${l.from}:${l.to}:${l.type}:${l.label}`)),dependencyGraph:d,knowledgeGraph:f,semantics:{legacyEdges:"producer-to-consumer",dependencyGraphEdges:"consumer-to-dependency"},summary:{projectCount:h.length,dependencyEdges:b.filter(a=>a.type==="dependency").length,eventEdges:b.filter(a=>a.type==="event").length,portCount:h.reduce((a,l)=>a+l.ports.length,0),apiCount:h.reduce((a,l)=>a+l.apis.length,0),relationshipEdges:d.stats.edgeCount,inferredEdges:d.stats.inferredEdges,authoritativeEdges:d.stats.authoritativeEdges,orphanProjects:d.stats.orphanCount,hotspotProjects:d.stats.hotspotCount,evidenceCoverageRatio:d.stats.evidenceCoverageRatio,edgeCoverageRatio:d.stats.edgeCoverageRatio,connectedProjects:d.stats.connectedNodeCount,lowConfidenceEdges:d.stats.lowConfidenceEdges,hasCycle:d.stats.hasCycle,manifestCount:h.reduce((a,l)=>a+l.files.manifests.length,0),entrypointCount:h.reduce((a,l)=>a+l.files.entrypoints.length,0),diagnostics:d.diagnostics?.length??0,relationshipKinds:Object.fromEntries(pe.map(a=>[a,d.edges.filter(l=>l.kind===a).length])),relationshipSources:Object.fromEntries(de.map(a=>[a,d.edges.filter(l=>l.source===a).length])),entityCount:f.quality.entityCount,knowledgeRelations:f.quality.relationCount,proofCount:f.quality.proofCount,providerCount:f.providers.length,knowledgeUnknowns:f.quality.unknownCount}};return {contractPath:t,graph:P}}async function Pe(e){let t=e.contract?{contractPath:e.contractPath??a$2(e.workspacePath,v),contract:e.contract}:await we(e),{contractPath:r,contract:o}=t,n=[],i=[];o.kind!=="rapidkit.workspace.contract"&&n.push("Contract kind must be rapidkit.workspace.contract."),o.schemaVersion!==_&&n.push(`Contract schemaVersion must be ${_}.`),o.workspace?.name||n.push("Contract workspace.name is required."),Array.isArray(o.projects)||n.push("Contract projects must be an array.");let c=new Set,u=new Map;for(let s of o.projects||[]){if(!s.slug){n.push("Every project must declare slug.");continue}c.has(s.slug)&&n.push(`Duplicate project slug: ${s.slug}.`),c.add(s.slug),s.relativePath?z(s.relativePath)||n.push(`Project ${s.slug} declares unsafe relativePath: ${s.relativePath}.`):n.push(`Project ${s.slug} must declare relativePath.`),s.externalPath&&(s.relationship==="adopted"||s.source==="adopted-local"||s.source==="local-folder"||s.source==="git-url"||n.push(`Project ${s.slug} declares externalPath without imported/adopted provenance.`),m__default.isAbsolute(s.externalPath)||n.push(`Project ${s.slug} declares non-absolute externalPath.`));for(let p of s.ports||[]){(!Number.isInteger(p.port)||p.port<1||p.port>65535)&&n.push(`Project ${s.slug} declares invalid port: ${p.port}.`);let f=u.get(p.port);f&&n.push(`Port ${p.port} is claimed by both ${f} and ${s.slug}.`),u.set(p.port,s.slug);}for(let p of s.contracts?.apis||[])(!p.name?.trim()||!p.basePath?.startsWith("/"))&&n.push(`Project ${s.slug} declares invalid API contract.`);for(let p of [...s.contracts?.publishes||[],...s.contracts?.consumes||[]])p.trim()||n.push(`Project ${s.slug} declares an empty event contract.`);for(let p of s.contracts?.env||[])/^[A-Z_][A-Z0-9_]*$/.test(p)||n.push(`Project ${s.slug} declares invalid env contract: ${p}.`);for(let p of s.contracts?.dependsOn||[])c.has(p);}for(let s of o.projects||[])for(let p of s.contracts?.dependsOn||[])c.has(p)||n.push(`Project ${s.slug} depends on unknown project: ${p}.`);i.push({id:"schema",status:o.kind==="rapidkit.workspace.contract"&&o.schemaVersion===_?"passed":"failed",message:"Contract schema and kind are valid."}),i.push({id:"projects",status:Array.isArray(o.projects)?"passed":"failed",message:`Contract declares ${Array.isArray(o.projects)?o.projects.length:0} project(s).`}),i.push({id:"ports",status:n.some(s=>s.toLowerCase().includes("port"))?"failed":"passed",message:"Project port declarations are valid and collision-free."}),i.push({id:"dependencies",status:n.some(s=>s.includes("depends on unknown project"))?"failed":"passed",message:"Project dependencies point to known project slugs."}),i.push({id:"contracts",status:n.some(s=>s.includes("unsafe relativePath")||s.includes("invalid API contract")||s.includes("event contract")||s.includes("env contract"))?"failed":"passed",message:"Project path, API, event, and env contracts are valid."});let g=await l(e.workspacePath);if(g.moduleCount>0){for(let s of g.issues)n.push(`${m__default.basename(s.projectRoot)}: ${s.message} (slug=${s.slug})`);i.push({id:"module-paths",status:g.status,message:g.status==="passed"?`All ${g.moduleCount} registered module(s) resolve under canonical paths.`:`${g.issues.length} registered module(s) missing canonical install paths.`});}else e.strict&&i.push({id:"module-paths",status:"passed",message:"No registry-backed modules declared in workspace projects."});return {status:n.length>0?"failed":"passed",contractPath:r,projectCount:Array.isArray(o.projects)?o.projects.length:0,checks:i,violations:n}}async function mt(e){let t=m__default.resolve(e.workspacePath),r={schemaVersion:ve,generatedAt:e.generatedAt??new Date().toISOString(),status:e.result.status,contractPath:e.result.contractPath,projectCount:e.result.projectCount,checks:e.result.checks,violations:e.result.violations};return h(t,Ee,se(r))}
|
|
1
|
+
import {z as z$1}from'./chunk-SATPH22S.js';import {j,m as m$1}from'./chunk-6WOFOOM7.js';import {a as a$1}from'./chunk-GR6442P7.js';import {a as a$2,g,f,h}from'./chunk-FE5R6EUV.js';import {b}from'./chunk-K33JJVQZ.js';import {l}from'./chunk-OCGZNSOE.js';import {t,p,s,q}from'./chunk-ODK4LCEL.js';import {c}from'./chunk-64XWHDZ3.js';import {a}from'./chunk-XWKGZRHN.js';import {t as t$1,u,q as q$1}from'./chunk-VQZ5PI5J.js';import*as m from'path';import m__default from'path';import k from'fs-extra';import Ce from'crypto';var ye="unknown-run";function se(e){let t=c();return !t||t===ye?e:{...e,runId:t}}async function ce(e,t){await k.ensureDir(m.dirname(e));let r=`${e}.${process.pid}.${Date.now()}.${Ce.randomUUID()}.tmp`;try{await k.writeJSON(r,t,{spaces:2}),await k.move(r,e,{overwrite:true});}finally{await k.remove(r).catch(()=>{});}}function ie(e){return q$1(e,"imported-projects.json")}async function I(e){let t=(await Promise.all(t$1(e,"imported-projects.json").map(async r=>await k.pathExists(r)?r:null))).find(r=>typeof r=="string");if(!t)return [];try{let r=await k.readJSON(t);if(!r||typeof r!="object"||r.version!==1||!Array.isArray(r.projects))throw new Error("expected a version 1 registry with a projects array");let o=r.projects,n=o.filter(i=>{if(!i||typeof i!="object")return false;let c=i;return typeof c.name=="string"&&typeof c.path=="string"&&typeof c.stack=="string"&&typeof c.confidence=="string"&&typeof c.importedAt=="string"});if(n.length!==o.length)throw new Error("one or more project entries are invalid");return n}catch(r){throw new Error(`Imported-project registry is invalid: ${t}`,{cause:r})}}async function He(e,t){if(t.length===0)return;let r=ie(e);await a(`${r}.lock`,async()=>{let o=await I(e),n=new Map;for(let c of o)n.set(c.path,c);for(let c of t)n.set(c.path,c);let i=Array.from(n.values()).sort((c,u)=>c.name.localeCompare(u.name)).map(c=>({...c}));await ce(r,{version:1,updatedAt:new Date().toISOString(),projects:i});},{timeoutMs:3e4,staleMs:6e4,purpose:"imported-projects-registry-upsert"});}async function Je(e,t){if(t.length===0)return;let r=ie(e);await a(`${r}.lock`,async()=>{let o=await I(e),n=new Set(t.map(c=>m.resolve(c))),i=o.filter(c=>!n.has(m.resolve(c.path)));await ce(r,{version:1,updatedAt:new Date().toISOString(),projects:i});},{timeoutMs:3e4,staleMs:6e4,purpose:"imported-projects-registry-remove"});}var ze="workspace-dependency-graph.v1",pe=["code-import","package-dep","event-pub-sub","service-dependsOn","shared-resource"],de=["inferred","contract","manual"];var v=t.workspaceContract,Ee=p.contractVerify,_=s.workspaceContract.schemaVersion,ve=q.contractVerify,N=class extends Error{constructor(r){super(`Workspace contract verification failed: ${r.violations.join("; ")}`);this.verification=r;this.name="WorkspaceContractVerificationError";}verification};function fe(e){return e.replace(/\\/g,"/")}function z(e){let t=fe(e).trim();return !t||t.startsWith("/")||t.startsWith("~")||/^[a-zA-Z]:\//.test(t)||t.includes("\0")?false:!t.split("/").filter(Boolean).some(r=>r===".."||r===".")}function le(e,t){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^[-_.]+|[-_.]+$/g,"").slice(0,80)||t}function je(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.trim().length>0):[]}function ue(e){let r=(Array.isArray(e.ports)?e.ports:[]).map(i=>{if(!i||typeof i!="object"||Array.isArray(i))return null;let c=i,u=Number(c.port);if(!Number.isInteger(u)||u<1||u>65535)return null;let g=c.protocol==="https"||c.protocol==="grpc"||c.protocol==="tcp"||c.protocol==="udp"?c.protocol:"http";return {name:typeof c.name=="string"&&c.name.trim()?c.name:"http",port:u,protocol:g}}).filter(i=>i!==null);if(r.length>0)return r;let o=e.frontend&&typeof e.frontend=="object"&&!Array.isArray(e.frontend)?e.frontend:void 0,n=Number(e.port??o?.default_port);return Number.isInteger(n)&&n>=1&&n<=65535?[{name:"http",port:n,protocol:"http"}]:[]}async function be(e){let t=m__default.join(e,"Dockerfile");if(!await k.pathExists(t))return [];try{let r=await k.readFile(t,"utf8"),o=new Map;for(let n of r.matchAll(/^\s*EXPOSE\s+(.+)$/gim))for(let i of n[1].split(/\s+/)){let c=i.match(/^(\d{1,5})(?:\/(tcp|udp))?$/i),u=Number(c?.[1]);if(!c||!Number.isInteger(u)||u<1||u>65535)continue;let g=c[2]?.toLowerCase();o.set(u,{name:"http",port:u,protocol:g==="udp"?"udp":"http"});}return [...o.values()].sort((n,i)=>n.port-i.port)}catch{return []}}async function D(e){for(let t of e)if(await k.pathExists(t))return t;return null}async function We(e){for(let t of t$1(e,"workspace.json"))try{let r=await k.readJson(t);return {name:typeof r.workspace_name=="string"&&r.workspace_name.trim()||typeof r.name=="string"&&r.name.trim()||m__default.basename(e),profile:typeof r.profile=="string"?r.profile:void 0}}catch{}return {name:m__default.basename(e)}}async function Se(e){let t=[],r=[e],o=new Set,n=new Set([".git",".workspai",".rapidkit","node_modules",".venv","venv","dist","build","target",".next",".turbo",".cache"]);for(;r.length>0;){let i=r.shift();if(!i||o.has(i))continue;o.add(i);let c=await D(u(i,"project.json")),u$1=await D(u(i,"context.json"));if(c||u$1){t.push(c??u$1??"");continue}let g;try{g=await k.readdir(i,{withFileTypes:true});}catch{continue}for(let d of g)!d.isDirectory()||n.has(d.name)||a$1(d.name)||r.push(m__default.join(i,d.name));}return t.sort()}function Ae(e){let t=(e||"").toLowerCase();if(t.includes("fastapi"))return "fastapi";if(t.includes("nestjs"))return "nestjs";if(t.includes("springboot"))return "springboot";if(t.includes("gofiber"))return "fiber";if(t.includes("gogin"))return "gin"}function Re(e,t){let r=(e||"").toLowerCase(),o=(t||"").toLowerCase();return r.includes("vscode-extension")?null:r.includes("fastapi")?8e3:r.includes("nestjs")?3e3:r.includes("springboot")?8080:r.includes("gofiber")?3e3:r.includes("gogin")?8080:r.startsWith("adopted.")?null:o==="node"?3e3:o==="python"?8e3:o==="java"||o==="go"?8080:null}function U(e,t){let r=e;for(;t.has(r)&&r<65535;)r+=1;return r}function B(e,t,r){let o=e!==void 0&&e.source===void 0,n=Re(t.kit,t.runtime),i=e?.ports||[],c=t.ports||[],u=(t.kit||"").toLowerCase().includes("vscode-extension"),g=t.source==="adopted-local"&&e?.source!==void 0,d=t.source!==void 0&&e?.source!==void 0,p=(u&&c.length===0?[]:g?c.length>0?c:n?[{name:"http",port:U(n,r),protocol:"http"}]:[]:i.length>0?i:c.length>0?c:n?[{name:"http",port:U(n,r),protocol:"http"}]:[]).map(w=>({...w,port:U(w.port,r)}));for(let w of p)r.add(w.port);let f={...t,...e,slug:e?.slug||t.slug,relativePath:o&&e?.relativePath&&z(e.relativePath)?e.relativePath:t.relativePath,source:o&&e?.source||t.source,relationship:o&&e?.relationship||t.relationship,externalPath:o&&e?.externalPath||t.externalPath,runtime:d?t.runtime:e?.runtime||t.runtime,framework:d?t.framework:e?.framework||t.framework,kit:d?t.kit:e?.kit||t.kit,modules:e?.modules?.length?e.modules:t.modules,ports:p,contracts:{owns:e?.contracts?.owns||[],apis:e?.contracts?.apis||[],publishes:e?.contracts?.publishes||[],consumes:e?.contracts?.consumes||[],dependsOn:e?.contracts?.dependsOn||[],env:e?.contracts?.env||[]}},h=JSON.stringify(e||null)!==JSON.stringify(f);return {project:f,changed:h}}async function he(e){let t=m__default.resolve(e.workspacePath),r=await We(t),o=await Se(t),n=await I(t),i=new Map(n.map(s=>[m__default.resolve(s.path),s])),c=[];for(let s of n){let p=m__default.resolve(s.path),f=await D(u(p,"project.json"))??await D(u(p,"context.json"));!f||o.some(h=>m__default.resolve(h)===m__default.resolve(f))||c.push({projectJsonPath:f,registryEntry:s});}let u$1=[],g=[...o.map(s=>({projectJsonPath:s,registryEntry:i.get(m__default.resolve(m__default.dirname(m__default.dirname(s))))})),...c];for(let{projectJsonPath:s,registryEntry:p}of g){let f=m__default.dirname(m__default.dirname(s)),h=fe(m__default.relative(t,f)),w=p!==void 0&&!z(h),C=le(p?.name||m__default.basename(f),m__default.basename(f)),b=w?`external/${C}`:h||C,P=await k.readJson(s),a=typeof P.kit_name=="string"&&P.kit_name||typeof P.kit=="string"&&P.kit||void 0,E=j(P)?m$1(f,P):void 0,j$1=E!==void 0&&E.key!=="unknown",T=j$1?E.runtime:typeof P.runtime=="string"?P.runtime:void 0,y=j$1?E.key:typeof P.framework=="string"&&P.framework||Ae(a),$=p?.relationship==="adopted"?"adopted":"imported",K=j$1?`${$}.${E.key}`:a;u$1.push({slug:p?.name||b||m__default.basename(f),relativePath:b,source:p?.source??"workspace",relationship:p?.relationship,externalPath:w?f:void 0,runtime:T,framework:y,kit:K,modules:je(P.modules),ports:ue(P).length>0?ue(P):await be(f),contracts:{owns:[],apis:[],publishes:[],consumes:[],dependsOn:[],env:[]}});}let d=new Map;for(let s of u$1){let p=le(s.slug,s.relativePath),f=d.get(p);(!f||f.source!=="workspace"&&s.source==="workspace")&&d.set(p,s);}return {schemaVersion:_,kind:"rapidkit.workspace.contract",generatedAt:(e.now??new Date).toISOString(),workspace:r,projects:[...d.values()]}}async function dt(e){let t=m__default.resolve(e.outputPath||a$2(e.workspacePath,v));if(await k.pathExists(t)&&e.force!==true)throw new Error(`Workspace contract already exists: ${t}. Use --force to overwrite.`);let r=await he({workspacePath:e.workspacePath,now:e.now}),o=new Set,n={...r,projects:r.projects.map(c=>B(void 0,c,o).project)},i=await Pe({workspacePath:e.workspacePath,contractPath:t,contract:n});if(e.strict&&i.status==="failed")throw new N(i);return await ke({workspacePath:e.workspacePath,contractPath:t,contract:n,now:e.now}),{contractPath:t,contract:n}}async function lt(e){let t=m__default.resolve(e.workspacePath),r=a$2(t,v),o=await g(t,v)??r,n=await he({workspacePath:t,now:e.now}),i=await k.pathExists(o)?await k.readJson(o):null,c=new Map((i?.projects||[]).map(h=>[h.slug,h])),u=new Set,g$1=[],d=[],s=[];for(let h of n.projects){let w=c.get(h.slug),C=B(w,h,u);w?C.changed&&d.push(h.slug):g$1.push(h.slug),s.push(C.project),c.delete(h.slug);}for(let h of c.values()){if(h.source)continue;let w=B(h,h,u);s.push(w.project);}let p={schemaVersion:_,kind:"rapidkit.workspace.contract",generatedAt:(e.now??new Date).toISOString(),workspace:{...i?.workspace||{},...n.workspace,name:n.workspace.name||i?.workspace?.name||m__default.basename(t)},projects:s.sort((h,w)=>h.slug.localeCompare(w.slug))},f=await Pe({workspacePath:t,contractPath:r,contract:p});if(e.strict&&f.status==="failed")throw new N(f);return await ke({workspacePath:t,contractPath:r,contract:p,now:e.now}),{contractPath:r,contract:p,addedProjects:g$1,updatedProjects:d,verification:f}}async function me(e){return await k.pathExists(e)?{exists:true,contents:await k.readFile(e)}:{exists:false}}async function ge(e,t){if(!t.exists){await k.remove(e);return}await k.outputFile(e,t.contents);}async function ke(e){let{buildWorkspaceRegistrySummary:t,WORKSPACE_REGISTRY_SUMMARY_RELATIVE_PATH:r}=await import('./workspace-registry-summary-WKENOFEA.js'),o=await t(e.workspacePath,{now:e.now,contract:e.contract}),n=a$2(e.workspacePath,r),i=c=>{if(!c||typeof c!="object"||Array.isArray(c))return JSON.stringify(c);let{generatedAt:u,...g}=c;return JSON.stringify(g)};if(await k.pathExists(e.contractPath)&&await k.pathExists(n)){let[c,u]=await Promise.all([k.readJson(e.contractPath),k.readJson(n)]);if(i(c)===i(e.contract)&&i(u)===i(o))return}b(v,e.contract),b(r,o),await f(e.workspacePath,v,async()=>{let[c,u]=await Promise.all([me(e.contractPath),me(n)]);try{if(e.contractPath===a$2(e.workspacePath,v)?await h(e.workspacePath,v,e.contract):(await k.ensureDir(m__default.dirname(e.contractPath)),await k.writeJson(e.contractPath,e.contract,{spaces:2})),process.env.WORKSPAI_TEST_FAIL_WORKSPACE_REGISTRY_PUBLISH==="1")throw new Error("Injected workspace registry summary publication failure.");await h(e.workspacePath,r,o);}catch(g){let s=(await Promise.allSettled([ge(e.contractPath,c),ge(n,u)])).filter(p=>p.status==="rejected");throw s.length>0?new AggregateError([g,...s.map(p=>p.reason)],"Workspace contract publication failed and rollback was incomplete."):g}});}async function we(e){let t=e.contractPath??(await g(e.workspacePath,v)||a$2(e.workspacePath,v)),r=await k.readJson(t);return {contractPath:t,contract:r}}var xe={metadata:[".workspai/project.json",".workspai/context.json",".rapidkit/project.json",".rapidkit/context.json"],manifests:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","pyproject.toml","poetry.lock","requirements.txt","go.mod","go.sum","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","Gemfile","composer.json"],entrypoints:["src/main.ts","src/index.ts","src/app.ts","src/main.js","src/index.js","main.py","app/main.py","manage.py","main.go","cmd/main.go","Program.cs"],apiSpecifications:["openapi.yaml","openapi.yml","openapi.json","swagger.yaml","swagger.yml","swagger.json"],infrastructure:["Dockerfile","docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml","k8s","kubernetes","terraform"],documentation:["README.md","ARCHITECTURE.md","CONTRIBUTING.md","docs"]};function _e(e,t){return t.externalPath?m__default.resolve(t.externalPath):m__default.resolve(e,t.relativePath)}async function Ge(e){let t={metadata:[],manifests:[],entrypoints:[],apiSpecifications:[],infrastructure:[],documentation:[]};for(let[r,o]of Object.entries(xe))for(let n of o)await k.pathExists(m__default.join(e,n))&&t[r].push(n);try{let r=await k.readdir(e,{withFileTypes:true});for(let o of r)o.isFile()&&(o.name.endsWith(".csproj")||o.name.endsWith(".sln"))&&t.manifests.push(o.name),o.isFile()&&o.name.endsWith(".tf")&&t.infrastructure.push(o.name);}catch{}for(let r of Object.values(t))r.sort((o,n)=>o.localeCompare(n));return t}function x(e){return !e||typeof e!="object"||Array.isArray(e)?[]:Object.keys(e).sort((t,r)=>t.localeCompare(r))}async function Oe(e){try{let t=await k.readJson(m__default.join(e,"package.json")),r={runtime:x(t.dependencies),development:x(t.devDependencies),peer:x(t.peerDependencies),optional:x(t.optionalDependencies)};return {...typeof t.name=="string"?{name:t.name}:{},...typeof t.version=="string"?{version:t.version}:{},...typeof t.private=="boolean"?{private:t.private}:{},scripts:x(t.scripts),dependencies:r,dependencyCount:new Set(Object.values(r).flat()).size}}catch{return}}async function Ie(e){for(let t of [".env.example",".env.sample",".env.template"])try{return (await k.readFile(m__default.join(e,t),"utf8")).split(/\r?\n/).map(o=>o.trim()).filter(o=>o.length>0&&!o.startsWith("#")&&o.includes("=")).map(o=>o.slice(0,o.indexOf("=")).trim()).filter(o=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(o)).sort((o,n)=>o.localeCompare(n))}catch{}return []}function Ne(e,t){try{let r=z$1(e);if(r.engine!=="unknown")return r;let o=k.pathExistsSync(m__default.join(e,"package.json"))?"npm":k.pathExistsSync(m__default.join(e,"pyproject.toml"))?"python":k.pathExistsSync(m__default.join(e,"requirements.txt"))?"pip":"unknown";return {...r,engine:o,runtime:t.runtime??r.runtime,framework:t.framework??r.framework,frameworkDisplayName:t.framework??r.frameworkDisplayName}}catch{return {schemaVersion:1,scope:"project",projectRoot:null,engine:"unknown",runtime:"unknown",runtimeCandidates:["unknown"],compositeRuntime:false,lifecycleCoverage:"complete",framework:"unknown",frameworkDisplayName:"Unknown",frameworkConfidence:"low",frameworkSupportTier:"observed",runtimeSupportTier:"observed",runtimeDoctorSupport:"observed",moduleSupport:false,fleetStages:[],localOnlyCommands:[],commandMap:{},supportedCommands:[],unsupportedCommands:[],globalCommands:[]}}}function De(e,t,r){let o=e.projects.map(n=>({id:n.slug,path:n.relativePath,runtime:n.runtime,framework:n.framework}));return {schemaVersion:"workspace-dependency-graph.v1",generatedAt:t,nodes:o,edges:[],stats:{nodeCount:o.length,edgeCount:0,inferredEdges:0,contractEdges:0,manualEdges:0,authoritativeEdges:0,lowConfidenceEdges:0,orphanCount:o.length,connectedNodeCount:0,density:0,edgeCoverageRatio:o.length===0?1:0,evidenceCoverageRatio:1,hotspotCount:0,hasCycle:false},diagnostics:[{code:"graph.enrichment.failed",severity:"warning",message:r,recommendation:"Review project manifests and graph overrides, then rerun workspace contract graph."}]}}async function ut(e){let{contractPath:t,contract:r}=await we(e),o=e.now??new Date,n=o.toISOString(),{buildWorkspaceModel:i,workspaceModelProjectTopology:c}=await import('./workspace-model-5FA2636K.js'),{hashWorkspaceModel:u}=await import('./workspace-model-hash-ZXYPIGCW.js'),g=await i({workspacePath:e.workspacePath,includeEvidence:false,now:o}),d=c(g)??De(r,n,"The canonical Workspace Model did not provide a project dependency topology."),s=new Map(d.nodes.map(a=>[a.id,a.operationalProfile])),{buildWorkspaceKnowledgeGraph:p$1}=await import('./workspace-knowledge-graph-WNQMNAVL.js'),f=await p$1({workspacePath:e.workspacePath,workspace:{name:g.workspace.name,...g.workspace.profile?{profile:g.workspace.profile}:{}},contract:r,projectTopology:d,now:o,projects:g.projects.map(a=>({id:a.name,path:a.path,...a.absolutePath?{absolutePath:a.absolutePath}:{},runtime:a.runtime,runtimeCandidates:a.runtimeCandidates,framework:a.framework,...a.kit?{kit:a.kit}:{}})),source:{kind:"workspace-model",artifact:p.model,hashAlgorithm:"sha256",hash:u(g)}}),h=await Promise.all(r.projects.map(async a=>{let l=_e(e.workspacePath,a),[E,j,T]=await Promise.all([Ge(l),Oe(l),Ie(l)]),y=Ne(l,a);return {id:a.slug,label:a.slug,relativePath:a.relativePath,source:a.source,relationship:a.relationship,externalPath:a.externalPath,runtime:a.runtime??y.runtime,framework:a.framework??y.framework,kit:a.kit,modules:a.modules,ports:a.ports,apis:a.contracts.apis,owns:a.contracts.owns,env:[...new Set([...a.contracts.env,...T])].sort(($,K)=>$.localeCompare(K)),contracts:{owns:[...a.contracts.owns],apis:[...a.contracts.apis],publishes:[...a.contracts.publishes],consumes:[...a.contracts.consumes],dependsOn:[...a.contracts.dependsOn],env:[...a.contracts.env]},capabilities:{engine:y.engine,supportTier:y.frameworkSupportTier,runtimeSupportTier:y.runtimeSupportTier,doctorSupport:y.runtimeDoctorSupport,moduleSupport:y.moduleSupport,fleetStages:[...y.fleetStages],localOnlyCommands:[...y.localOnlyCommands],supportedCommands:[...y.supportedCommands]},files:E,...j?{package:j}:{},...s.get(a.slug)?{operationalProfile:s.get(a.slug)}:{}}})),w=new Set(h.map(a=>a.id)),C=new Map,b=[];for(let a of r.projects){for(let l of a.contracts.dependsOn||[])w.has(l)&&b.push({from:l,to:a.slug,type:"dependency",label:"dependsOn"});for(let l of a.contracts.publishes||[])C.has(l)||C.set(l,new Set),C.get(l)?.add(a.slug);}for(let a of r.projects)for(let l of a.contracts.consumes||[]){let E=C.get(l);if(E)for(let j of E)j!==a.slug&&b.push({from:j,to:a.slug,type:"event",label:l});}let P={schemaVersion:1,kind:"rapidkit.workspace.contract.graph",workspace:r.workspace,generatedAt:n,nodes:h.sort((a,l)=>a.id.localeCompare(l.id)),edges:b.sort((a,l)=>`${a.from}:${a.to}:${a.type}:${a.label}`.localeCompare(`${l.from}:${l.to}:${l.type}:${l.label}`)),dependencyGraph:d,knowledgeGraph:f,semantics:{legacyEdges:"producer-to-consumer",dependencyGraphEdges:"consumer-to-dependency"},summary:{projectCount:h.length,dependencyEdges:b.filter(a=>a.type==="dependency").length,eventEdges:b.filter(a=>a.type==="event").length,portCount:h.reduce((a,l)=>a+l.ports.length,0),apiCount:h.reduce((a,l)=>a+l.apis.length,0),relationshipEdges:d.stats.edgeCount,inferredEdges:d.stats.inferredEdges,authoritativeEdges:d.stats.authoritativeEdges,orphanProjects:d.stats.orphanCount,hotspotProjects:d.stats.hotspotCount,evidenceCoverageRatio:d.stats.evidenceCoverageRatio,edgeCoverageRatio:d.stats.edgeCoverageRatio,connectedProjects:d.stats.connectedNodeCount,lowConfidenceEdges:d.stats.lowConfidenceEdges,hasCycle:d.stats.hasCycle,manifestCount:h.reduce((a,l)=>a+l.files.manifests.length,0),entrypointCount:h.reduce((a,l)=>a+l.files.entrypoints.length,0),diagnostics:d.diagnostics?.length??0,relationshipKinds:Object.fromEntries(pe.map(a=>[a,d.edges.filter(l=>l.kind===a).length])),relationshipSources:Object.fromEntries(de.map(a=>[a,d.edges.filter(l=>l.source===a).length])),entityCount:f.quality.entityCount,knowledgeRelations:f.quality.relationCount,proofCount:f.quality.proofCount,providerCount:f.providers.length,knowledgeUnknowns:f.quality.unknownCount}};return {contractPath:t,graph:P}}async function Pe(e){let t=e.contract?{contractPath:e.contractPath??a$2(e.workspacePath,v),contract:e.contract}:await we(e),{contractPath:r,contract:o}=t,n=[],i=[];o.kind!=="rapidkit.workspace.contract"&&n.push("Contract kind must be rapidkit.workspace.contract."),o.schemaVersion!==_&&n.push(`Contract schemaVersion must be ${_}.`),o.workspace?.name||n.push("Contract workspace.name is required."),Array.isArray(o.projects)||n.push("Contract projects must be an array.");let c=new Set,u=new Map;for(let s of o.projects||[]){if(!s.slug){n.push("Every project must declare slug.");continue}c.has(s.slug)&&n.push(`Duplicate project slug: ${s.slug}.`),c.add(s.slug),s.relativePath?z(s.relativePath)||n.push(`Project ${s.slug} declares unsafe relativePath: ${s.relativePath}.`):n.push(`Project ${s.slug} must declare relativePath.`),s.externalPath&&(s.relationship==="adopted"||s.source==="adopted-local"||s.source==="local-folder"||s.source==="git-url"||n.push(`Project ${s.slug} declares externalPath without imported/adopted provenance.`),m__default.isAbsolute(s.externalPath)||n.push(`Project ${s.slug} declares non-absolute externalPath.`));for(let p of s.ports||[]){(!Number.isInteger(p.port)||p.port<1||p.port>65535)&&n.push(`Project ${s.slug} declares invalid port: ${p.port}.`);let f=u.get(p.port);f&&n.push(`Port ${p.port} is claimed by both ${f} and ${s.slug}.`),u.set(p.port,s.slug);}for(let p of s.contracts?.apis||[])(!p.name?.trim()||!p.basePath?.startsWith("/"))&&n.push(`Project ${s.slug} declares invalid API contract.`);for(let p of [...s.contracts?.publishes||[],...s.contracts?.consumes||[]])p.trim()||n.push(`Project ${s.slug} declares an empty event contract.`);for(let p of s.contracts?.env||[])/^[A-Z_][A-Z0-9_]*$/.test(p)||n.push(`Project ${s.slug} declares invalid env contract: ${p}.`);for(let p of s.contracts?.dependsOn||[])c.has(p);}for(let s of o.projects||[])for(let p of s.contracts?.dependsOn||[])c.has(p)||n.push(`Project ${s.slug} depends on unknown project: ${p}.`);i.push({id:"schema",status:o.kind==="rapidkit.workspace.contract"&&o.schemaVersion===_?"passed":"failed",message:"Contract schema and kind are valid."}),i.push({id:"projects",status:Array.isArray(o.projects)?"passed":"failed",message:`Contract declares ${Array.isArray(o.projects)?o.projects.length:0} project(s).`}),i.push({id:"ports",status:n.some(s=>s.toLowerCase().includes("port"))?"failed":"passed",message:"Project port declarations are valid and collision-free."}),i.push({id:"dependencies",status:n.some(s=>s.includes("depends on unknown project"))?"failed":"passed",message:"Project dependencies point to known project slugs."}),i.push({id:"contracts",status:n.some(s=>s.includes("unsafe relativePath")||s.includes("invalid API contract")||s.includes("event contract")||s.includes("env contract"))?"failed":"passed",message:"Project path, API, event, and env contracts are valid."});let g=await l(e.workspacePath);if(g.moduleCount>0){for(let s of g.issues)n.push(`${m__default.basename(s.projectRoot)}: ${s.message} (slug=${s.slug})`);i.push({id:"module-paths",status:g.status,message:g.status==="passed"?`All ${g.moduleCount} registered module(s) resolve under canonical paths.`:`${g.issues.length} registered module(s) missing canonical install paths.`});}else e.strict&&i.push({id:"module-paths",status:"passed",message:"No registry-backed modules declared in workspace projects."});return {status:n.length>0?"failed":"passed",contractPath:r,projectCount:Array.isArray(o.projects)?o.projects.length:0,checks:i,violations:n}}async function mt(e){let t=m__default.resolve(e.workspacePath),r={schemaVersion:ve,generatedAt:e.generatedAt??new Date().toISOString(),status:e.result.status,contractPath:e.result.contractPath,projectCount:e.result.projectCount,checks:e.result.checks,violations:e.result.violations};return h(t,Ee,se(r))}
|
|
2
2
|
export{I as a,He as b,Je as c,se as d,ze as e,pe as f,v as g,Ee as h,_ as i,ve as j,N as k,Se as l,he as m,dt as n,lt as o,we as p,ut as q,Pe as r,mt as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ne="workspace-knowledge-search.v1";function m(e){return e.trim().toLowerCase()}var U=new WeakMap;function B(e){let t=U.get(e);if(t)return t;let a=new Map(e.relations.map(o=>[o.id,o])),s=new Map(e.entities.map(o=>[o.id,o])),r=new Map(e.proofs.map(o=>[o.id,o])),i=new Map,l=new Map,p=(o,u)=>{let g=l.get(o)??[];g.push(u),l.set(o,g);};for(let o of e.entities){let u=[o.id,o.label,o.identity.key,...o.kind==="project"&&o.projectId?[o.projectId]:[],...o.identity.aliases];for(let g of new Set(u.map(m))){let y=i.get(g)??[];y.push(o),i.set(g,y);}}for(let o of e.relations)p(o.from,{from:o.from,to:o.to,relationId:o.id,kind:o.kind,direction:"forward",proofIds:o.proofIds}),p(o.to,{from:o.to,to:o.from,relationId:o.id,kind:o.kind,direction:"reverse",proofIds:o.proofIds});for(let o of i.values())o.sort((u,g)=>u.id.localeCompare(g.id));for(let o of l.values())o.sort((u,g)=>u.to.localeCompare(g.to)||u.relationId.localeCompare(g.relationId));let d={entitiesById:s,relationsById:a,entitiesByAlias:i,proofsById:r,adjacency:l};return U.set(e,d),d}function D(e,t,a){let s=B(e),r=s.relationsById.get(t);if(r)return {found:true,targetType:"relation",relation:r};let i=m(t),l=(s.entitiesByAlias.get(i)??[]).filter(p=>!a||p.projectId===a);return l.length===1?{found:true,targetType:"entity",entity:l[0]}:{found:false,query:t,candidates:l.map(p=>p.id).sort()}}function Se(e,t,a){let s=D(e,t,a);if(!s.found)return {query:t,found:false,target:null,proofs:[],candidates:s.candidates};let r=s.targetType==="entity"?s.entity:s.relation,i=new Set(r.proofIds);return {query:t,found:true,target:r,candidates:[],proofs:[...i].map(l=>B(e).proofsById.get(l)).filter(l=>!!l).sort((l,p)=>l.id.localeCompare(p.id))}}function Ee(e,t,a,s){let r=D(e,t,s),i=D(e,a,s);if(!r.found||r.targetType!=="entity"||!i.found||i.targetType!=="entity")return {from:t,to:a,found:false,resolvedFrom:r.found&&r.targetType==="entity"?r.entity.id:null,resolvedTo:i.found&&i.targetType==="entity"?i.entity.id:null,entityPath:[],hops:[],proofs:[]};let l=B(e),p=[r.entity.id],d=new Map,o=new Set(p),u=0;for(;u<p.length&&!o.has(i.entity.id);){let f=p[u++];for(let h of l.adjacency.get(f)??[])o.has(h.to)||(o.add(h.to),d.set(h.to,h),p.push(h.to));}if(!o.has(i.entity.id))return {from:t,to:a,found:false,resolvedFrom:r.entity.id,resolvedTo:i.entity.id,entityPath:[],hops:[],proofs:[]};let g=[],y=i.entity.id;for(;y!==r.entity.id;){let f=d.get(y);if(!f)break;g.push(f),y=f.from;}g.reverse();let I=new Set(g.flatMap(f=>f.proofIds));return {from:t,to:a,found:true,resolvedFrom:r.entity.id,resolvedTo:i.entity.id,entityPath:[r.entity.id,...g.map(f=>f.to)],hops:g,proofs:[...I].map(f=>l.proofsById.get(f)).filter(f=>!!f).sort((f,h)=>f.id.localeCompare(h.id))}}function We(e,t,a){return e.entities.filter(s=>(!t||s.kind===t)&&(!a||s.projectId===a)).sort((s,r)=>s.kind.localeCompare(r.kind)||s.label.localeCompare(r.label))}var k={relations:12,relatedEntities:12,proofs:8,proofIdsPerItem:4,aliasesPerEntity:8,attributeArrayItems:8,attributeStringCharacters:256};function oe(e){let t=[],a=new Set;for(let s=0;s<k.proofIdsPerItem&&t.length<k.proofs;s+=1)for(let r of e){let i=r.proofIds[s];if(!(!i||a.has(i))&&(a.add(i),t.push(i),t.length>=k.proofs))break}return t}function se(e,t,a){let s=e.identity.aliases.slice(0,k.aliasesPerEntity);a.aliases+=e.identity.aliases.length-s.length;let r=Object.fromEntries(Object.entries(e.attributes).map(([l,p])=>{if(Array.isArray(p)){let d=p.slice(0,k.attributeArrayItems);return a.attributeValues+=p.length-d.length,[l,d]}return typeof p=="string"&&p.length>k.attributeStringCharacters?(a.attributeValues+=1,[l,p.slice(0,k.attributeStringCharacters)]):[l,p]})),i=e.proofIds.filter(l=>t.has(l)).slice(0,k.proofIdsPerItem);return a.proofReferences+=e.proofIds.length-i.length,{...e,identity:{...e.identity,aliases:s},attributes:r,proofIds:i}}function ae(e){let t=Object.values(e.attributes).flatMap(a=>Array.isArray(a)?a:[a]);return [e.id,e.kind,e.label,e.projectId??"",e.identity.key,...e.identity.aliases,...t.map(a=>String(a??""))].join(" ").toLowerCase()}var re=new Set(["a","an","and","are","as","at","be","been","being","by","can","check","could","did","do","does","find","for","from","give","had","has","have","how","i","in","into","is","it","its","may","might","of","on","or","our","show","should","that","the","their","them","then","there","these","they","this","those","tell","to","was","we","were","what","when","where","which","who","why","will","with","would","you","your"]),ie=new Map([["authenticate","auth"],["authenticated","auth"],["authentication","auth"],["authorization","auth"],["authorizing","auth"],["config","configuration"],["configs","configuration"],["dependencies","dependency"],["connected","connect"],["connecting","connect"],["connection","connect"],["connections","connect"],["diagnostics","diagnostic"],["reliable","reliability"],["tested","test"],["testing","test"],["tests","test"],["verification","verify"],["verified","verify"],["verifies","verify"],["verifying","verify"]]);function v(e){let t=a=>m(a).replace(/\bc\+\+/gu," cplusplus ").replace(/\bc#/gu," csharp ").split(/[^a-z0-9]+/u).filter(s=>s.length>1||s==="c"||s==="r").map(s=>ie.get(s)??s);return [...new Set([...t(e),...t(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2"))])]}function ce(e){let t=m(e.label),a=m(e.identity.key),s=e.identity.aliases.map(m),r=ae(e);return {entity:e,label:t,identity:a,aliases:s,haystack:r,labelTokens:new Set(v(e.label)),identityTokens:new Set(v(e.identity.key)),aliasTokens:new Set(e.identity.aliases.flatMap(v)),allTokens:new Set(v(r))}}function E(e,t){return e.has(t)||t.length>=3&&[...e].some(a=>a.startsWith(t))}function A(e,t){return E(e.labelTokens,t)||E(e.identityTokens,t)||E(e.aliasTokens,t)||E(e.allTokens,t)}function le(e,t,a,s){let{label:r,identity:i,aliases:l,haystack:p}=e,d=0;(r===t||i===t||l.includes(t))&&(d+=1e4),(r.startsWith(t)||i.startsWith(t))&&(d+=250),p.includes(t)&&(d+=100);let o=0;for(let u of a){let g=s.get(u)??1,y=E(e.labelTokens,u),I=E(e.identityTokens,u),f=E(e.aliasTokens,u),h=A(e,u);h&&(o+=1),r===u?d+=80*g:y&&(d+=36*g),I&&(d+=24*g),f&&(d+=20*g),h&&(d+=10*g);}return a.length>0&&(d+=o/a.length*120),d}function de(e,t){if(["build","compiled","dist","generated","fixture","fixtures","testdata","target","third","vendor","vendored"].some(i=>t.has(i)))return 0;let s=typeof e.attributes.artifact=="string"?e.attributes.artifact:"",r=`${e.label}/${e.identity.key}/${s}`.toLowerCase();return /(?:^|\/)(?:__fixtures__|__testfixtures__|build|compiled|dist|fixture|fixtures|generated|node_modules|target|testdata|third_party|vendor)(?:\/|$)/u.test(r)?5e3:0}function F(e,t){let a=new Set;for(let s of t){let r=e.allTokens.has(s)?s:void 0,i=r===void 0&&s.length>=3?[...e.allTokens].find(p=>p.startsWith(s)&&!a.has(p)):void 0,l=r??i;l&&!a.has(l)&&a.add(l);}return a.size}var pe=new Map([["c","c"],["clojure","clojure"],["cplusplus","cpp"],["cpp","cpp"],["typescript","typescript"],["ts","typescript"],["javascript","javascript"],["js","javascript"],["nodejs","javascript"],["python","python"],["py","python"],["go","go"],["golang","go"],["csharp","csharp"],["ada","ada"],["assembly","assembly"],["asm","assembly"],["cuda","cuda"],["dotnet","csharp"],["dart","dart"],["elixir","elixir"],["fsharp","fsharp"],["fortran","fortran"],["java","java"],["kotlin","kotlin"],["hlsl","hlsl"],["llvmir","llvm-ir"],["mlir","mlir"],["lua","lua"],["php","php"],["r","r"],["ruby","ruby"],["rust","rust"],["tablegen","tablegen"],["scala","scala"],["svelte","svelte"],["swift","swift"],["vue","vue"]]);function ge(e){return new Set(e.map(t=>pe.get(t)).filter(t=>!!t))}function $(e){let t=e.attributes.language;return typeof t=="string"?m(t):null}function he(e){return {project:1e3,service:900,api:900,package:850,endpoint:800,container:700,deployment:700,environment:650,pipeline:600,"test-suite":550,owner:500,decision:450,document:400}[e.kind]??0}var ue=new Set(["language","languages","binding","bindings","bridge","bridges","dependency","dependencies","depends","core","runtime","owner","owners","ownership","maintainer","ci","pipeline","pipelines","workflow","deploy","deployment","infrastructure","container","doc","docs","document","documentation","service","services","api","rpc","schema","schemas","message","protobuf","proto","contract"]),fe=new Set(["app","application","applications","call","calls","code","communicate","communication","connect","define","defined","expose","exposed","handle","handled","implement","implementation","integrate","integration","interact","interaction","project","provide","provided","system","use","used","uses","using"]);function ye(e){return ue.has(e)||fe.has(e)}function we(e,t){let a=t.has("language")||t.has("languages"),s=t.has("binding")||t.has("bindings")||t.has("bridge")||t.has("bridges"),r=t.has("dependency")||t.has("dependencies")||t.has("depends"),i=t.has("core")||t.has("runtime"),l=t.has("owner")||t.has("owners")||t.has("ownership")||t.has("maintainer"),p=t.has("ci")||t.has("pipeline")||t.has("pipelines")||t.has("workflow"),d=t.has("deploy")||t.has("deployment")||t.has("infrastructure")||t.has("container"),o=t.has("doc")||t.has("docs")||t.has("document")||t.has("documentation"),u=t.has("service")||t.has("services")||t.has("api")||t.has("rpc"),g=t.has("schema")||t.has("schemas")||t.has("message")||t.has("protobuf")||t.has("proto")||t.has("contract"),y=typeof e.attributes.mechanism=="string"?m(e.attributes.mechanism):"",I=typeof e.attributes.specification=="string"?m(e.attributes.specification):"",f=m(e.label),h=0;if(a&&e.kind==="language"){let O=typeof e.attributes.fileCount=="number"?e.attributes.fileCount:0;h+=900+Math.min(O,1e4)/10;}return s&&e.kind==="protocol"&&(h+=800),r&&e.kind==="package"&&(h+=650),i&&e.kind==="package"&&/(?:^|[_-])core(?:$|[_-])/u.test(f)&&(h+=700),i&&e.kind==="protocol"&&y.includes("core")&&(h+=300),l&&e.kind==="owner"&&(h+=850),p&&e.kind==="pipeline"&&(h+=800),d&&["deployment","container","environment"].includes(e.kind)&&(h+=775),o&&["document","decision"].includes(e.kind)&&(h+=725),u&&["api","endpoint","service"].includes(e.kind)&&(h+=700),g&&(e.kind==="schema"||(e.kind==="api"||e.kind==="protocol")&&(I.includes("protobuf")||y.includes("protobuf")))&&(h+=750),h}function ke(e){return [e.has("language")||e.has("languages"),e.has("binding")||e.has("bindings")||e.has("bridge")||e.has("bridges"),e.has("dependency")||e.has("dependencies")||e.has("depends"),e.has("core")||e.has("runtime"),e.has("owner")||e.has("ownership")||e.has("maintainer"),e.has("ci")||e.has("pipeline")||e.has("workflow"),e.has("deploy")||e.has("deployment")||e.has("infrastructure"),e.has("doc")||e.has("docs")||e.has("documentation"),e.has("service")||e.has("api")||e.has("rpc"),e.has("schema")||e.has("protobuf")||e.has("proto")||e.has("contract")].filter(Boolean).length>=3}function Te(e,t){let a=m(t.query),s=[...new Set(v(t.query))],r=new Set(v(t.projectId??"")),i=t.projectId?s.filter(n=>!r.has(n)):s,l=!!(t.projectId&&s.length>0&&i.length===0),p=i.filter(n=>!re.has(n)),d=p.length>0?p:i,o=ge(d),u=new Set(d),g=d.filter(n=>!ye(n)),y=ke(u),I=d.length<=1?d.length:Math.min(2,Math.ceil(d.length/3)),f=t.minimumTermMatches===void 0?I:Math.min(I,Math.max(1,Math.trunc(t.minimumTermMatches))),h=Math.max(1,Math.min(Math.trunc(t.limit??12),100)),O=Math.max(0,Math.min(Math.trunc(t.relationsPerEntity??4),20)),G=new Set;if(t.projectId){let n=new Set(e.entities.filter(c=>c.kind==="project"&&(c.projectId===t.projectId||c.label===t.projectId)).map(c=>c.id));for(let c of e.relations)n.has(c.from)&&G.add(c.to),n.has(c.to)&&G.add(c.from);}let P=e.entities.filter(n=>(!t.kind||n.kind===t.kind)&&(!t.projectId||n.projectId===t.projectId||n.projectId===void 0&&G.has(n.id))).map(ce),Y=new Map(d.map(n=>{let c=P.filter(w=>A(w,n)).length;return [n,Math.log((P.length+1)/(c+1))+1]})),X=g.some(n=>P.some(c=>A(c,n))),M=P.map(n=>{let c=F(n,d),w=F(n,g),b=$(n.entity),S=b&&o.has(b)?400:0,_=we(n.entity,u),j=g.length===0||g.some(te=>A(n,te))?_:0;return {entity:n.entity,matchedTerms:c,matchedQualifiers:w,intentScore:j,score:l?he(n.entity):le(n,a,d,Y)+w*300+S+j-de(n.entity,u)}}).filter(n=>{let c=$(n.entity);return (o.size===0||c===null||o.has(c))&&(a.length===0||n.score>0&&(!X||g.length===0||n.matchedQualifiers>0)&&(l||n.matchedTerms>=f||n.intentScore>0&&(y||d.length<=2)))}).sort((n,c)=>c.score-n.score||n.entity.kind.localeCompare(c.entity.kind)||n.entity.label.localeCompare(c.entity.label)),W=(y?(()=>{let n=[],c=[],w=new Map,b=new Set;for(let S of M){let _=w.get(S.entity.kind)??0,j=m(S.entity.label);_<2&&!b.has(j)?(n.push(S),w.set(S.entity.kind,_+1),b.add(j)):c.push(S);}return [...n,...c]})():M).slice(0,h).map(n=>n.entity),R=new Set(W.map(n=>n.id)),L=new Map,H=e.relations.filter(n=>{if(!(R.has(n.from)||R.has(n.to)))return false;let w=R.has(n.from)?n.from:n.to,b=L.get(w)??0;return b>=O?false:(L.set(w,b+1),true)}),K=t.projection==="agent",T=K?H.slice(0,k.relations):H,z=B(e),N=[...new Set(T.flatMap(n=>[n.from,n.to]).filter(n=>!R.has(n)))].map(n=>z.entitiesById.get(n)).filter(n=>!!n).map(({id:n,kind:c,label:w,projectId:b})=>({id:n,kind:c,label:w,...b?{projectId:b}:{}})).sort((n,c)=>n.kind.localeCompare(c.kind)||n.label.localeCompare(c.label)),Q=K?N.slice(0,k.relatedEntities):N,q=new Set([...W.flatMap(n=>n.proofIds),...T.flatMap(n=>n.proofIds)]),Z=K?oe([...W,...T]):[...q],x=new Set(Z),C={entities:M.length-W.length,relations:H.length-T.length,relatedEntities:N.length-Q.length,proofs:q.size-x.size,proofReferences:0,aliases:0,attributeValues:0},V=K?W.map(n=>se(n,x,C)):W,J=K?T.map(n=>{let c=n.proofIds.filter(w=>x.has(w)).slice(0,k.proofIdsPerItem);return C.proofReferences+=n.proofIds.length-c.length,{...n,proofIds:c}}):T,ee=[...x].map(n=>z.proofsById.get(n)).filter(n=>!!n).sort((n,c)=>n.id.localeCompare(c.id));return {schemaVersion:ne,graphSourceHash:e.source.hash,query:t.query,kind:t.kind??null,...t.projectId?{projectId:t.projectId}:{},limit:h,totalMatches:M.length,truncated:M.length>V.length||K&&Object.values(C).some(n=>n>0),entities:V,relatedEntities:Q,relations:J,proofs:ee,...K?{budget:{mode:"agent",limits:{...k},omitted:C}}:{}}}export{ne as a,D as b,Se as c,Ee as d,We as e,Te as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as buildWorkspaceManifest,f as createProject,a as initializeStandaloneGitRepository,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,c as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-
|
|
1
|
+
export{b as buildWorkspaceManifest,f as createProject,a as initializeStandaloneGitRepository,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,c as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-TQQEZQLC.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{d as DOCTOR_WORKSPACE_REPORT_PATH,q as applyEnvKeyAddFix,m as applyFileAppendFix,n as applyFileCopyFix,l as applyFileCreateFix,p as applyJsonEditFix,r as applyMakefileTargetFix,k as applyPackageScriptFix,i as assertOperationPathInsideProject,j as assertOperationPathInsideProjectResolved,h as buildRepairOperationIdentity,t as computeDoctorFixAwareExitCode,s as computeDoctorGateExitCode,o as decodeJsonPointerSegment,g as parseInternalRepairCommand,f as parsePackageScriptFix,e as resolveDoctorPolicyProfile,u as runDoctor}from'./chunk-
|
|
1
|
+
export{d as DOCTOR_WORKSPACE_REPORT_PATH,q as applyEnvKeyAddFix,m as applyFileAppendFix,n as applyFileCopyFix,l as applyFileCreateFix,p as applyJsonEditFix,r as applyMakefileTargetFix,k as applyPackageScriptFix,i as assertOperationPathInsideProject,j as assertOperationPathInsideProjectResolved,h as buildRepairOperationIdentity,t as computeDoctorFixAwareExitCode,s as computeDoctorGateExitCode,o as decodeJsonPointerSegment,g as parseInternalRepairCommand,f as parsePackageScriptFix,e as resolveDoctorPolicyProfile,u as runDoctor}from'./chunk-5OLNT6YD.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b
|
|
1
|
+
import {a,d,e,b}from'./chunk-HV6EQMUJ.js';import {h as h$1}from'./chunk-PKKSRXUS.js';import {b as b$1,a as a$1}from'./chunk-TQEMLBAG.js';import {promises}from'fs';import n from'path';import s from'chalk';import y from'ora';import {execa}from'execa';var l=a.dotnet.targetFramework,_="8080";function $(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")}function E(e,r){return e.trim().replace(/[^A-Za-z0-9_.]+/g,".").replace(/^\.+|\.+$/g,"").replace(/\.{2,}/g,".").split(".").map(c=>c.replace(/^[^A-Za-z_]+/,"").replace(/[^A-Za-z0-9_]/g,"")).filter(Boolean).join(".")||r}function D(e,r){return e.replace(/[\r\n\t]+/g," ").trim()||r}function I(e){return e.trim()===l}function P(){return JSON.stringify({engine:"npm",runtime:"dotnet"},null,2)}function k(e,r){return JSON.stringify({kit_name:"dotnet.webapi.clean",runtime:"dotnet",framework:"dotnet",module_support:false,project_name:e.project_name,root_namespace:e.root_namespace,target_framework:e.target_framework,app_version:e.app_version,created_by:"workspai",workspai_version:r,rapidkit_version:r,created_at:new Date().toISOString()},null,2)}function T(e){return `<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
2
2
|
<PropertyGroup>
|
|
3
3
|
<TargetFramework>${e.target_framework}</TargetFramework>
|
|
4
4
|
<Nullable>enable</Nullable>
|
|
@@ -12,11 +12,11 @@ import {b as b$1,c}from'./chunk-IBJEQHJR.js';import {h as h$1}from'./chunk-PKKSR
|
|
|
12
12
|
</PropertyGroup>
|
|
13
13
|
|
|
14
14
|
<ItemGroup>
|
|
15
|
-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="
|
|
16
|
-
<PackageReference Include="Swashbuckle.AspNetCore" Version="
|
|
15
|
+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="${a.dotnet.aspnetPatch}" />
|
|
16
|
+
<PackageReference Include="Swashbuckle.AspNetCore" Version="${a.dotnet.swashbuckle}" />
|
|
17
17
|
</ItemGroup>
|
|
18
18
|
</Project>
|
|
19
|
-
`}function
|
|
19
|
+
`}function w(e){return `<Project Sdk="Microsoft.NET.Sdk">
|
|
20
20
|
<PropertyGroup>
|
|
21
21
|
<TargetFramework>${e.target_framework}</TargetFramework>
|
|
22
22
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
@@ -25,18 +25,18 @@ import {b as b$1,c}from'./chunk-IBJEQHJR.js';import {h as h$1}from'./chunk-PKKSR
|
|
|
25
25
|
</PropertyGroup>
|
|
26
26
|
|
|
27
27
|
<ItemGroup>
|
|
28
|
-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="
|
|
29
|
-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="
|
|
30
|
-
<PackageReference Include="xunit" Version="
|
|
31
|
-
<PackageReference Include="xunit.runner.visualstudio" Version="
|
|
32
|
-
<PackageReference Include="coverlet.collector" Version="
|
|
28
|
+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="${a.dotnet.aspnetPatch}" />
|
|
29
|
+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="${a.dotnet.testSdk}" />
|
|
30
|
+
<PackageReference Include="xunit" Version="${a.dotnet.xunit}" />
|
|
31
|
+
<PackageReference Include="xunit.runner.visualstudio" Version="${a.dotnet.xunitRunner}" />
|
|
32
|
+
<PackageReference Include="coverlet.collector" Version="${a.dotnet.coverlet}" />
|
|
33
33
|
</ItemGroup>
|
|
34
34
|
|
|
35
35
|
<ItemGroup>
|
|
36
36
|
<ProjectReference Include="..\\src\\${e.project_name}.csproj" />
|
|
37
37
|
</ItemGroup>
|
|
38
38
|
</Project>
|
|
39
|
-
`}function
|
|
39
|
+
`}function x(e){return `using ${e.root_namespace}.Application;
|
|
40
40
|
using ${e.root_namespace}.Infrastructure;
|
|
41
41
|
using ${e.root_namespace}.Presentation;
|
|
42
42
|
|
|
@@ -69,7 +69,7 @@ app.Run();
|
|
|
69
69
|
public partial class Program
|
|
70
70
|
{
|
|
71
71
|
}
|
|
72
|
-
`}function
|
|
72
|
+
`}function v(e){return `namespace ${e.root_namespace}.Application;
|
|
73
73
|
|
|
74
74
|
public sealed class ApplicationInfoOptions
|
|
75
75
|
{
|
|
@@ -81,7 +81,7 @@ public sealed class ApplicationInfoOptions
|
|
|
81
81
|
|
|
82
82
|
public string Description { get; init; } = "${e.description}";
|
|
83
83
|
}
|
|
84
|
-
`}function
|
|
84
|
+
`}function N(e){return `using Microsoft.Extensions.DependencyInjection;
|
|
85
85
|
|
|
86
86
|
namespace ${e.root_namespace}.Application;
|
|
87
87
|
|
|
@@ -93,7 +93,7 @@ public static class ApplicationServiceRegistration
|
|
|
93
93
|
return services;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
`}function
|
|
96
|
+
`}function h(e){return `using Microsoft.Extensions.Options;
|
|
97
97
|
|
|
98
98
|
namespace ${e.root_namespace}.Application;
|
|
99
99
|
|
|
@@ -117,7 +117,7 @@ public sealed class SystemInfoService(IOptions<ApplicationInfoOptions> options)
|
|
|
117
117
|
DateTimeOffset.UtcNow);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
`}function
|
|
120
|
+
`}function V(e){return `using Microsoft.Extensions.DependencyInjection;
|
|
121
121
|
|
|
122
122
|
namespace ${e.root_namespace}.Infrastructure;
|
|
123
123
|
|
|
@@ -128,7 +128,7 @@ public static class InfrastructureServiceRegistration
|
|
|
128
128
|
return services;
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
`}function
|
|
131
|
+
`}function U(e){return `using Microsoft.AspNetCore.Diagnostics;
|
|
132
132
|
using Microsoft.AspNetCore.Http;
|
|
133
133
|
using Microsoft.Extensions.DependencyInjection;
|
|
134
134
|
|
|
@@ -162,7 +162,7 @@ internal sealed class GlobalExceptionHandler : IExceptionHandler
|
|
|
162
162
|
return true;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
`}function
|
|
165
|
+
`}function O(e){return `using ${e.root_namespace}.Application;
|
|
166
166
|
|
|
167
167
|
namespace ${e.root_namespace}.Presentation;
|
|
168
168
|
|
|
@@ -180,7 +180,7 @@ public static class SystemEndpoints
|
|
|
180
180
|
return app;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
`}function
|
|
183
|
+
`}function C(e){return JSON.stringify({Workspai:{Name:e.project_name,Version:e.app_version,Description:e.description},Logging:{LogLevel:{Default:"Information","Microsoft.AspNetCore":"Warning"}},AllowedHosts:"*",Kestrel:{Endpoints:{Http:{Url:`http://0.0.0.0:${e.port}`}}}},null,2)}function W(e){return `FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
|
184
184
|
WORKDIR /src
|
|
185
185
|
COPY src/*.csproj ./src/
|
|
186
186
|
COPY tests/*.csproj ./tests/
|
|
@@ -188,7 +188,7 @@ RUN dotnet restore ./src/${e.project_name}.csproj
|
|
|
188
188
|
COPY . .
|
|
189
189
|
RUN dotnet publish ./src/${e.project_name}.csproj -c Release -o /app/publish --no-restore
|
|
190
190
|
|
|
191
|
-
FROM mcr.microsoft.com/dotnet/aspnet:
|
|
191
|
+
FROM mcr.microsoft.com/dotnet/aspnet:10.0
|
|
192
192
|
WORKDIR /app
|
|
193
193
|
RUN apt-get update \\
|
|
194
194
|
&& apt-get install -y --no-install-recommends curl \\
|
|
@@ -196,8 +196,9 @@ RUN apt-get update \\
|
|
|
196
196
|
ENV ASPNETCORE_URLS=http://+:${e.port}
|
|
197
197
|
COPY --from=build /app/publish .
|
|
198
198
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD curl -fsS http://localhost:${e.port}/health/live || exit 1
|
|
199
|
+
USER $APP_UID
|
|
199
200
|
ENTRYPOINT ["dotnet", "${e.root_namespace}.dll"]
|
|
200
|
-
`}function
|
|
201
|
+
`}function M(e){return `services:
|
|
201
202
|
api:
|
|
202
203
|
build: .
|
|
203
204
|
ports:
|
|
@@ -210,7 +211,7 @@ ENTRYPOINT ["dotnet", "${e.root_namespace}.dll"]
|
|
|
210
211
|
interval: 30s
|
|
211
212
|
timeout: 5s
|
|
212
213
|
retries: 3
|
|
213
|
-
`}function
|
|
214
|
+
`}function G(e){return `.PHONY: init dev start build test lint format docker-up docker-down
|
|
214
215
|
|
|
215
216
|
init:
|
|
216
217
|
dotnet restore src/${e.project_name}.csproj
|
|
@@ -241,7 +242,7 @@ docker-up:
|
|
|
241
242
|
|
|
242
243
|
docker-down:
|
|
243
244
|
docker compose down
|
|
244
|
-
`}function
|
|
245
|
+
`}function F(e){return `#!/usr/bin/env sh
|
|
245
246
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
246
247
|
CMD="\${1:-help}"
|
|
247
248
|
shift 2>/dev/null || true
|
|
@@ -270,7 +271,7 @@ case "$CMD" in
|
|
|
270
271
|
;;
|
|
271
272
|
*) echo "rapidkit: unknown command: $CMD" >&2; exit 1 ;;
|
|
272
273
|
esac
|
|
273
|
-
`}function
|
|
274
|
+
`}function L(e){return `@echo off
|
|
274
275
|
set CMD=%1
|
|
275
276
|
if "%CMD%"=="" set CMD=help
|
|
276
277
|
shift
|
|
@@ -300,12 +301,15 @@ if "%CMD%"=="format" (
|
|
|
300
301
|
|
|
301
302
|
echo Available: init, dev, start, build, test, lint, format
|
|
302
303
|
exit /b 1
|
|
303
|
-
`}function
|
|
304
|
+
`}function H(e){return `name: CI
|
|
304
305
|
|
|
305
306
|
on:
|
|
306
307
|
push:
|
|
307
308
|
pull_request:
|
|
308
309
|
|
|
310
|
+
permissions:
|
|
311
|
+
contents: read
|
|
312
|
+
|
|
309
313
|
jobs:
|
|
310
314
|
verify:
|
|
311
315
|
runs-on: \${{ matrix.os }}
|
|
@@ -314,10 +318,10 @@ jobs:
|
|
|
314
318
|
matrix:
|
|
315
319
|
os: [ubuntu-latest, windows-latest]
|
|
316
320
|
steps:
|
|
317
|
-
- uses: actions/checkout
|
|
318
|
-
- uses: actions/setup-dotnet
|
|
321
|
+
- uses: actions/checkout@${a.actions.checkout}
|
|
322
|
+
- uses: actions/setup-dotnet@${a.actions.setupDotnet}
|
|
319
323
|
with:
|
|
320
|
-
dotnet-version:
|
|
324
|
+
dotnet-version: ${a.dotnet.sdkChannel}
|
|
321
325
|
- name: Restore
|
|
322
326
|
run: |
|
|
323
327
|
dotnet restore src/${e.project_name}.csproj
|
|
@@ -328,9 +332,11 @@ jobs:
|
|
|
328
332
|
dotnet format tests/${e.project_name}.Tests.csproj --verify-no-changes
|
|
329
333
|
- name: Build
|
|
330
334
|
run: dotnet build tests/${e.project_name}.Tests.csproj -c Release --no-restore
|
|
335
|
+
- name: Vulnerability audit
|
|
336
|
+
run: dotnet list tests/${e.project_name}.Tests.csproj package --vulnerable --include-transitive
|
|
331
337
|
- name: Test
|
|
332
338
|
run: dotnet test tests/${e.project_name}.Tests.csproj -c Release --no-build --collect:"XPlat Code Coverage"
|
|
333
|
-
`}function
|
|
339
|
+
`}function B(e){return `using System.Net;
|
|
334
340
|
using Microsoft.AspNetCore.Mvc.Testing;
|
|
335
341
|
using Xunit;
|
|
336
342
|
|
|
@@ -361,7 +367,7 @@ public sealed class RuntimeSmokeTests : IClassFixture<WebApplicationFactory<Prog
|
|
|
361
367
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
|
362
368
|
}
|
|
363
369
|
}
|
|
364
|
-
`}function
|
|
370
|
+
`}function q(e){return `
|
|
365
371
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
366
372
|
# Visual Studio Version 17
|
|
367
373
|
VisualStudioVersion = 17.0.31903.59
|
|
@@ -417,9 +423,9 @@ Global
|
|
|
417
423
|
{22222222-2222-2222-2222-222222222222} = {44444444-4444-4444-4444-444444444444}
|
|
418
424
|
EndGlobalSection
|
|
419
425
|
EndGlobal
|
|
420
|
-
`.trimStart()}async function
|
|
421
|
-
PORT=${
|
|
422
|
-
`),await
|
|
426
|
+
`.trimStart()}async function K(e,r){if(!r)try{if(await b$1(e)){console.log(s.gray("\u26A0 git init skipped (target is inside an existing git worktree)"));return}await execa("git",["init"],{cwd:e,stdio:"ignore",env:a$1()});}catch{console.log(s.gray("\u26A0 git init skipped (git not found or error)"));}}async function z(e){try{await execa("dotnet",["--version"],{cwd:e,timeout:3e3,stdio:"pipe"});}catch{console.log(s.yellow(`\u26A0 .NET SDK not found in PATH - project scaffolded, but init/build need ${l}`)),console.log(s.gray(" Install: https://dotnet.microsoft.com/download"));}}async function se(e$1,r){let a=$(r.project_name)||"dotnet-api",p=E(r.root_namespace||`Workspai.${d(a)}`,"Workspai.App"),c=r.target_framework?.trim(),A=c&&I(c)?c:l,S=r.port&&/^\d+$/.test(r.port)?r.port:_,o={project_name:a,root_namespace:p,description:D(r.description||"","Production-ready ASP.NET Core Web API scaffolded by Workspai."),target_framework:A,app_version:r.app_version||"0.1.0",port:S,skipGit:r.skipGit??false,skipInstall:r.skipInstall??false},j=y(`Creating ASP.NET Core Web API project ${a}`).start();await promises.mkdir(e$1,{recursive:true}),await e(n.join(e$1,`${a}.sln`),q(o)),await e(n.join(e$1,"src",`${a}.csproj`),T(o)),await e(n.join(e$1,"src","Program.cs"),x(o)),await e(n.join(e$1,"src","Application","ApplicationInfoOptions.cs"),v(o)),await e(n.join(e$1,"src","Application","ApplicationServiceRegistration.cs"),N(o)),await e(n.join(e$1,"src","Application","SystemInfoService.cs"),h(o)),await e(n.join(e$1,"src","Infrastructure","InfrastructureServiceRegistration.cs"),V(o)),await e(n.join(e$1,"src","Presentation","PresentationServiceRegistration.cs"),U(o)),await e(n.join(e$1,"src","Presentation","SystemEndpoints.cs"),O(o)),await e(n.join(e$1,"src","appsettings.json"),C(o)),await e(n.join(e$1,"src","appsettings.Development.json"),C(o)),await e(n.join(e$1,"tests",`${a}.Tests.csproj`),w(o)),await e(n.join(e$1,"tests","RuntimeSmokeTests.cs"),B(o)),await e(n.join(e$1,"Dockerfile"),W(o)),await e(n.join(e$1,"docker-compose.yml"),M(o)),await e(n.join(e$1,"Makefile"),G(o)),await e(n.join(e$1,"rapidkit"),F(o)),await e(n.join(e$1,"rapidkit.cmd"),L(o)),await e(n.join(e$1,".env.example"),`ASPNETCORE_ENVIRONMENT=Development
|
|
427
|
+
PORT=${o.port}
|
|
428
|
+
`),await e(n.join(e$1,".github","workflows","ci.yml"),H(o)),await e(n.join(e$1,".github","dependabot.yml"),b("nuget")),await e(n.join(e$1,".workspai","context.json"),P()),await e(n.join(e$1,".workspai","project.json"),k(o,h$1())),process.platform!=="win32"&&await promises.chmod(n.join(e$1,"rapidkit"),493),await K(e$1,o.skipGit),j.succeed("ASP.NET Core Web API project ready"),o.skipInstall||await z(e$1),console.log(s.green(`
|
|
423
429
|
\u2705 ASP.NET Core project ready!
|
|
424
|
-
`)),console.log(
|
|
425
|
-
Endpoints: /health/live, /health/ready, /api/v1/system/info, /docs`)),console.log(
|
|
430
|
+
`)),console.log(s.gray("Next steps:")),console.log(s.white(` cd ${a}`)),console.log(s.white(" npx workspai init")),console.log(s.white(" npx workspai dev")),console.log(s.gray(`
|
|
431
|
+
Endpoints: /health/live, /health/ready, /api/v1/system/info, /docs`)),console.log(s.gray("\u2139 RapidKit Core modules are not available for .NET projects yet."));}export{_ as DEFAULT_DOTNET_PORT,l as DEFAULT_DOTNET_TARGET_FRAMEWORK,se as generateDotnetWebApiCleanKit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{f as GOAL_INDEX_PATH,e as GOAL_INDEX_SCHEMA_VERSION,k as buildGoalLifecycleResult,l as inspectGoalLifecycle,q as linkGoalChangeTransaction,p as linkGoalRepairTransaction,n as prepareGoalVerification,m as transitionGoalLifecycle,o as verifyGoalLifecycle}from'./chunk-
|
|
1
|
+
export{f as GOAL_INDEX_PATH,e as GOAL_INDEX_SCHEMA_VERSION,k as buildGoalLifecycleResult,l as inspectGoalLifecycle,q as linkGoalChangeTransaction,p as linkGoalRepairTransaction,n as prepareGoalVerification,m as transitionGoalLifecycle,o as verifyGoalLifecycle}from'./chunk-UHAPXPGW.js';
|