workspai 0.48.0 → 0.50.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 +151 -75
- package/contracts/analyze-last-run.v1.json +2 -2
- package/contracts/artifact-remediation-plan.v1.json +3 -9
- package/contracts/autopilot-release.v1.json +2 -0
- package/contracts/bootstrap-compliance.v1.json +2 -1
- package/contracts/cli-log-event.v1.json +1 -1
- package/contracts/cli-runtime-command-inventory.v1.snapshot.json +84 -0
- package/contracts/compatibility-matrix.v1.json +2 -0
- package/contracts/create-planner-capabilities.v1.json +144 -32
- package/contracts/doctor-project-evidence.v1.json +191 -11
- package/contracts/doctor-project-scan.v2.json +2 -0
- package/contracts/doctor-remediation-plan.v1.json +2 -2
- package/contracts/doctor-remediation-plan.v2.json +2 -2
- package/contracts/doctor-workspace-cache.v2.json +2 -0
- package/contracts/doctor-workspace-evidence.v1.json +189 -10
- package/contracts/extension-cli-compatibility.v1.json +11 -1
- package/contracts/infra-plan.v1.json +2 -0
- package/contracts/ingestion-plan.v1.json +85 -0
- package/contracts/ingestion-result.v1.json +59 -0
- package/contracts/mirror-ops.v1.json +2 -1
- package/contracts/pipeline-last-run.v1.json +2 -2
- package/contracts/private-product-manifest.v1.json +2 -0
- package/contracts/product-factory-plan.v1.json +2 -0
- package/contracts/project-archive.v1.json +2 -0
- package/contracts/project-entry-capability.v1.json +2 -3
- package/contracts/project-test-coverage.v1.json +189 -0
- package/contracts/project-workspace-link.v1.json +66 -0
- package/contracts/project-workspace-resolution.v1.json +28 -0
- package/contracts/published-contract-catalog.v1.json +50 -0
- package/contracts/release-readiness.v1.json +2 -2
- package/contracts/runtime-command-surface.v1.json +1456 -123
- package/contracts/transparency-evidence.v1.json +2 -1
- package/contracts/workspace-archive-capabilities.v1.json +11 -5
- package/contracts/workspace-archive-manifest.v1.json +236 -0
- package/contracts/workspace-archive-operation-result.v1.json +236 -0
- package/contracts/workspace-contract.v1.json +1 -1
- package/contracts/workspace-intelligence/agent-action-outcome.v1.json +2 -2
- package/contracts/workspace-intelligence/agent-customization-pack-report.v1.json +1 -1
- package/contracts/workspace-intelligence/agent-hooks.v1.json +2 -0
- package/contracts/workspace-intelligence/agent-reports-index.v1.json +1 -1
- package/contracts/workspace-intelligence/blocker-resolution.v1.json +3 -9
- package/contracts/workspace-intelligence/doctor-fix-result.v1.json +2 -2
- package/contracts/workspace-intelligence/doctor-graph-diagnosis.v1.json +208 -0
- package/contracts/workspace-intelligence/fact-freshness.v1.json +2 -2
- package/contracts/workspace-intelligence/mcp-design.v1.json +2 -0
- package/contracts/workspace-intelligence/model-usage-event.v1.json +1 -1
- package/contracts/workspace-intelligence/project-context-agent.v1.json +360 -0
- package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-context.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-contract-verify.v1.json +2 -2
- package/contracts/workspace-intelligence/workspace-dependency-graph.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-explain.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-graph-stream.v1.json +262 -0
- package/contracts/workspace-intelligence/workspace-graph-token-efficiency.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-impact.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-intelligence-evaluation-comparison.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-intelligence-history.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-intelligence-run.v1.json +2 -2
- package/contracts/workspace-intelligence/workspace-knowledge-graph-change-overlay.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-knowledge-graph.v1.json +48 -5
- package/contracts/workspace-intelligence/workspace-knowledge-search.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-model-diff.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-model-snapshot.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-model.v1.json +97 -5
- package/contracts/workspace-intelligence/workspace-operational-skill.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-skills-index.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-verify.v1.json +1 -1
- package/contracts/workspace-intelligence-architecture.v1.json +33 -7
- package/contracts/workspace-intelligence-chain.v1.json +1 -1
- package/contracts/workspace-list.v1.json +2 -0
- package/contracts/workspace-model-cache.v1.json +2 -0
- package/contracts/workspace-registry.v1.json +1 -1
- package/contracts/workspace-run-last.v1.json +1 -1
- package/contracts/workspace-share-bundle.v1.json +2 -1
- package/contracts/workspace-snapshot.v1.json +2 -0
- package/contracts/workspace-snapshot.v2.json +2 -0
- package/contracts/workspace-sync.v1.json +2 -0
- package/contracts/workspace-watch-event.v1.json +2 -0
- package/dist/analyze-ZFQWTCJQ.js +1 -0
- package/dist/{artifact-remediation-plan-SPOUHMK5.js → artifact-remediation-plan-ICN3KOFG.js} +1 -1
- package/dist/autopilot-release-VKXQ7BS7.js +1 -0
- package/dist/chunk-2AXEGYPL.js +1 -0
- package/dist/chunk-2D4UOYOJ.js +1 -0
- package/dist/chunk-2OIBHUVH.js +1 -0
- package/dist/chunk-3GRKUP5W.js +33 -0
- package/dist/{managed-agent-markers-AXUM75OE.js → chunk-3RBUSW7H.js} +1 -1
- package/dist/chunk-5EXZBCAZ.js +4 -0
- package/dist/chunk-6UTM5AJI.js +1 -0
- package/dist/chunk-AFIFZTOY.js +2 -0
- package/dist/{chunk-BMWFQXGW.js → chunk-AHLMIL2T.js} +1 -1
- package/dist/chunk-AL237TSJ.js +7 -0
- package/dist/chunk-AL2A7Q4X.js +86 -0
- package/dist/{chunk-VU7NZHPM.js → chunk-BHYTI3RH.js} +1 -1
- package/dist/{chunk-ESLPI3XZ.js → chunk-BQGBU2Y3.js} +1 -1
- package/dist/chunk-C35UXTDM.js +2 -0
- package/dist/chunk-C3FLCDRN.js +2 -0
- package/dist/chunk-CZC5P2MF.js +1 -0
- package/dist/{chunk-Y5UJLPS4.js → chunk-DDQ3XK3H.js} +13 -13
- package/dist/{chunk-CRHYBQI3.js → chunk-DQ3PI7EP.js} +1 -1
- package/dist/chunk-EWZZUQBR.js +1 -0
- package/dist/{chunk-4KUIFXHM.js → chunk-GNQRYISX.js} +3 -3
- package/dist/chunk-I42F552T.js +2 -0
- package/dist/chunk-IDQKVJUF.js +2 -0
- package/dist/{chunk-3VFA7D5T.js → chunk-IND3TUVU.js} +1 -1
- package/dist/chunk-IPJ5URDF.js +1 -0
- package/dist/{chunk-I46XEIPL.js → chunk-JFUD73OZ.js} +52 -52
- package/dist/chunk-KKAOTTYO.js +8 -0
- package/dist/chunk-KMLPHFLD.js +2 -0
- package/dist/{chunk-NHN4QXPP.js → chunk-KVSYBHUR.js} +1 -1
- package/dist/chunk-KXG6E5VK.js +1 -0
- package/dist/chunk-L2YK5RV2.js +1 -0
- package/dist/chunk-LAJM2SBP.js +15 -0
- package/dist/{chunk-5S3DJQEP.js → chunk-LZQUZGXB.js} +1 -1
- package/dist/chunk-MOSXTVPU.js +1 -0
- package/dist/chunk-MV7KF75Q.js +13 -0
- package/dist/chunk-MVLIONQD.js +1 -0
- package/dist/chunk-RJIYCDVC.js +1 -0
- package/dist/{chunk-BGPXQQNY.js → chunk-RTVRZFIJ.js} +1 -1
- package/dist/chunk-RVQLMTTI.js +2 -0
- package/dist/chunk-SHXJ2GDR.js +75 -0
- package/dist/{chunk-32OJDBIG.js → chunk-SS2VV3D5.js} +1 -1
- package/dist/chunk-TDTCMZK7.js +10 -0
- package/dist/chunk-UETZ7USY.js +36 -0
- package/dist/chunk-VKTUWUS6.js +1 -0
- package/dist/chunk-VRW6KXNK.js +6 -0
- package/dist/chunk-Y5YAP4F3.js +2 -0
- package/dist/chunk-YPKNQCLK.js +2 -0
- package/dist/{create-DBQNAMKP.js → create-I23DC7SN.js} +1 -1
- package/dist/{demo-kit-DZ7TPG7K.js → demo-kit-KHH63TNA.js} +2 -2
- package/dist/{doctor-4NNUDNGZ.js → doctor-DOOMYLIH.js} +1 -1
- package/dist/{dotnet-webapi-clean-A6MVDYXX.js → dotnet-webapi-clean-VXEF4SHM.js} +5 -5
- package/dist/{gofiber-standard-I5YPQG5V.js → gofiber-standard-AQGSC7ON.js} +3 -3
- package/dist/{gogin-standard-VY2L4QT5.js → gogin-standard-7DU3OCBX.js} +3 -3
- package/dist/index.d.ts +41 -6
- package/dist/index.js +268 -356
- package/dist/managed-agent-markers-COE5DJ3W.js +1 -0
- package/dist/pipeline-U77HSINC.js +5 -0
- package/dist/platform-capabilities-PR6YL4KC.js +1 -0
- package/dist/project-intelligence-lens-BKKVPCLC.js +1 -0
- package/dist/project-test-coverage-4TEHZJFC.js +1 -0
- package/dist/{pythonRapidkitExec-CVCIK225.js → pythonRapidkitExec-YR7P5LWG.js} +1 -1
- package/dist/rust-axum-4HXDICIB.js +140 -0
- package/dist/{springboot-standard-55XKCBIZ.js → springboot-standard-EK6GYN5T.js} +7 -7
- package/dist/workspace-ZEYUVR26.js +1 -0
- package/dist/{workspace-agent-sync-662QHXGF.js → workspace-agent-sync-DKYJLUDP.js} +1 -1
- package/dist/workspace-archive-4JNT4S7N.js +1 -0
- package/dist/{workspace-context-23YYCUCP.js → workspace-context-IHUFMZT3.js} +1 -1
- package/dist/workspace-contract-PVLGPBBV.js +1 -0
- package/dist/workspace-explain-64HNKAHO.js +1 -0
- package/dist/workspace-explain-contract-H7O26QJU.js +1 -0
- package/dist/{workspace-feedback-SUVH2LUJ.js → workspace-feedback-RATRXFUC.js} +1 -1
- package/dist/{workspace-foundation-WXJ6I7ES.js → workspace-foundation-D33LJLGT.js} +1 -1
- package/dist/workspace-graph-stream-THNG2T7R.js +1 -0
- package/dist/{workspace-history-BANOJRQ2.js → workspace-history-EWFPT74O.js} +1 -1
- package/dist/workspace-intelligence-MCNSWWDV.js +1 -0
- package/dist/{workspace-intelligence-evaluation-IPH7M3WV.js → workspace-intelligence-evaluation-7CABG5Y6.js} +1 -1
- package/dist/workspace-intelligence-runner-TG2VLHNZ.js +1 -0
- package/dist/workspace-intelligence-runtime-registry-ZZ3GRAL2.js +1 -0
- package/dist/{workspace-knowledge-graph-ARDC6HHG.js → workspace-knowledge-graph-2EYR7N56.js} +1 -1
- package/dist/{workspace-marker-SMBC3Z2Q.js → workspace-marker-7NHMDIRL.js} +1 -1
- package/dist/workspace-mcp-serve-FLAVKWYW.js +3 -0
- package/dist/workspace-model-FMFYLHE4.js +1 -0
- package/dist/workspace-model-hash-ZXYPIGCW.js +1 -0
- package/dist/workspace-onboarding-MYROZDI2.js +1 -0
- package/dist/{workspace-python-engine-state-2MLKJYQG.js → workspace-python-engine-state-J4QKW55K.js} +1 -1
- package/dist/{workspace-registry-summary-ORDK7A36.js → workspace-registry-summary-6VXIAQLX.js} +1 -1
- package/dist/workspace-run-2ZI5UMJ2.js +1 -0
- package/dist/{workspace-verify-EBVL7FWT.js → workspace-verify-FKYI65UQ.js} +1 -1
- package/dist/workspace-watch-RP5KMVP2.js +1 -0
- package/docs/GLOSSARY.md +17 -16
- package/docs/OPEN_SOURCE_USER_SCENARIOS.md +18 -10
- package/docs/README.md +49 -14
- package/docs/README_CONTENT_CONTRACT.md +19 -10
- package/docs/ci-workflows.md +3 -3
- package/docs/commands-reference.md +41 -10
- package/docs/contracts/ARTIFACT_CATALOG.md +72 -27
- package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +2 -0
- package/docs/contracts/RUNTIME_SUPPORT_MATRIX.md +3 -3
- package/docs/contracts/rapidkit-cli-contracts.json +2 -2
- package/docs/create-planner-capabilities.md +36 -5
- package/docs/creating-workspaces-and-projects.md +75 -15
- package/docs/doctor-command.md +148 -39
- package/docs/examples/ci-agent-grounding.yml +1 -1
- package/docs/from-code-to-shared-understanding.md +6 -3
- package/docs/graph-benchmark-methodology.md +2 -2
- package/docs/workspace-intelligence-evaluation.md +13 -6
- package/docs/workspace-intelligence-runner.md +17 -6
- package/docs/workspace-knowledge-graph.md +102 -7
- package/docs/workspace-operations.md +154 -10
- package/package.json +10 -5
- package/scripts/enterprise-package-smoke.mjs +13 -1
- package/templates/kits/fastapi-ddd/README.md.j2 +1 -1
- package/dist/analyze-EEEU3MIF.js +0 -1
- package/dist/autopilot-release-XGVXPOZI.js +0 -1
- package/dist/chunk-22DT744Z.js +0 -1
- package/dist/chunk-37CVKXBD.js +0 -1
- package/dist/chunk-3NU32T4A.js +0 -2
- package/dist/chunk-3ZK2GU7C.js +0 -1
- package/dist/chunk-4HDYADHT.js +0 -13
- package/dist/chunk-52PBRX7F.js +0 -1
- package/dist/chunk-54EP5CEV.js +0 -8
- package/dist/chunk-5XATWNME.js +0 -1
- package/dist/chunk-7YHK5NM3.js +0 -2
- package/dist/chunk-AFL3ACCR.js +0 -2
- package/dist/chunk-BFLJ2R4D.js +0 -80
- package/dist/chunk-EYJ2CQSK.js +0 -1
- package/dist/chunk-FTY7GGXJ.js +0 -33
- package/dist/chunk-FXQJX34Z.js +0 -1
- package/dist/chunk-GSWPGELT.js +0 -2
- package/dist/chunk-GZTYAEWX.js +0 -1
- package/dist/chunk-HDXNIN4N.js +0 -1
- package/dist/chunk-HZDXO65G.js +0 -36
- package/dist/chunk-J5ENLXDF.js +0 -1
- package/dist/chunk-KB44JP4M.js +0 -2
- package/dist/chunk-LHOZXC2M.js +0 -2
- package/dist/chunk-MER6ZBN2.js +0 -13
- package/dist/chunk-NAJCUQ4X.js +0 -2
- package/dist/chunk-OA537ZQ5.js +0 -1
- package/dist/chunk-OW42TZFB.js +0 -1
- package/dist/chunk-P3D5YQB2.js +0 -1
- package/dist/chunk-PHXQR6PX.js +0 -2
- package/dist/chunk-PRTR2DQ2.js +0 -1
- package/dist/chunk-QNONOO4F.js +0 -4
- package/dist/chunk-RHQW3DTP.js +0 -1
- package/dist/chunk-T4YR4RAI.js +0 -2
- package/dist/chunk-Y45WZR5N.js +0 -5
- package/dist/chunk-YJZOMRAS.js +0 -1
- package/dist/pipeline-TQM43A3K.js +0 -5
- package/dist/platform-capabilities-2B4QMZXE.js +0 -1
- package/dist/workspace-NCWRINEF.js +0 -1
- package/dist/workspace-archive-P76EDIUG.js +0 -10
- package/dist/workspace-contract-TU2I7GC2.js +0 -1
- package/dist/workspace-dependency-graph-BP4EXYQ5.js +0 -1
- package/dist/workspace-explain-MWUEN643.js +0 -1
- package/dist/workspace-explain-contract-ZPI3JXJU.js +0 -1
- package/dist/workspace-intelligence-MFJE7W67.js +0 -1
- package/dist/workspace-intelligence-runner-THYLHHMF.js +0 -1
- package/dist/workspace-mcp-serve-EZR6O76D.js +0 -3
- package/dist/workspace-model-7OU2M3LE.js +0 -1
- package/dist/workspace-model-hash-MHXK5MEI.js +0 -1
- package/dist/workspace-run-RLIYSOTN.js +0 -1
- package/dist/workspace-watch-3BPGLFLB.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {c as c$1}from'./chunk-YPKNQCLK.js';import {p,h,i as i$1}from'./chunk-L2YK5RV2.js';import {d as d$1}from'./chunk-KMLPHFLD.js';import {e,d as d$2}from'./chunk-SS2VV3D5.js';import {b,a,i,c}from'./chunk-AHLMIL2T.js';import G from'path';import O from'fs-extra';var V="workspai-workspace-intelligence-chain-v1",z="contracts/workspace-intelligence-chain.v1.json";function T(){let e=a,t=i,s=[{id:"model",ordinal:1,phase:"understand",label:"Model",command:[...t.model.command],consumes:["workspace markers","project metadata","registry","contract","policies"],inputRefs:["projects-repositories","runtime-dependencies","workspace-rules","existing-evidence"],consumesArtifacts:[],produces:[...t.model.produces],dependsOn:[],exitPolicy:"stop-on-error",purpose:"Build the canonical current model and its structurally bound, derived Knowledge Graph."},{id:"diff",ordinal:2,phase:"change",label:"Diff",command:[...t.diff.command],consumes:[e.model,e.snapshot],inputRefs:["changes","model-baseline"],consumesArtifacts:[e.model,e.snapshot],produces:[...t.diff.produces],dependsOn:["model"],exitPolicy:"stop-on-error",purpose:"Describe structural change against the selected baseline."},{id:"impact",ordinal:3,phase:"change",label:"Impact",command:[...t.impact.command],consumes:[e.model,e.diff],inputRefs:[],consumesArtifacts:[e.model,e.diff],produces:[...t.impact.produces],dependsOn:["diff"],exitPolicy:"stop-on-error",purpose:"Calculate transitive blast radius over the workspace graph."},{id:"doctor-evidence",ordinal:4,phase:"evidence",label:"Doctor Evidence",command:[...t["doctor-evidence"].command],consumes:["workspace runtime and project health signals"],inputRefs:["projects-repositories","runtime-dependencies","existing-evidence"],consumesArtifacts:[],produces:[...t["doctor-evidence"].produces],dependsOn:["impact"],exitPolicy:"continue-on-structured-verdict",purpose:"Refresh health evidence after the impact artifact exists."},{id:"contract-evidence",ordinal:5,phase:"evidence",label:"Contract Evidence",command:[...t["contract-evidence"].command],consumes:[".workspai/workspace.contract.json"],inputRefs:["workspace-rules"],consumesArtifacts:[],produces:[...t["contract-evidence"].produces],dependsOn:["impact"],exitPolicy:"continue-on-structured-verdict",purpose:"Refresh structural contract evidence without hiding failed verdicts."},{id:"analyze-evidence",ordinal:6,phase:"evidence",label:"Analyze Evidence",command:[...t["analyze-evidence"].command],consumes:[e.model,"workspace runtime and dependency signals"],inputRefs:["projects-repositories","runtime-dependencies","workspace-rules"],consumesArtifacts:[e.model],produces:[...t["analyze-evidence"].produces],dependsOn:["impact"],exitPolicy:"continue-on-structured-verdict",purpose:"Refresh analysis evidence required by the release-readiness gate."},{id:"readiness-evidence",ordinal:7,phase:"evidence",label:"Readiness Evidence",command:[...t["readiness-evidence"].command],consumes:["doctor, analysis, runtime, and release signals"],inputRefs:["runtime-dependencies","existing-evidence"],consumesArtifacts:[e.doctor,e.contractVerify,e.analyze],produces:[...t["readiness-evidence"].produces],dependsOn:["doctor-evidence","contract-evidence","analyze-evidence"],exitPolicy:"continue-on-structured-verdict",purpose:"Refresh release-readiness evidence before the definitive gate."},{id:"verify",ordinal:8,phase:"gate",label:"Verify",command:[...t.verify.command],consumes:[e.impact,e.doctor,e.contractVerify,e.readiness],inputRefs:[],consumesArtifacts:[e.impact,e.doctor,e.contractVerify,e.readiness],produces:[...t.verify.produces],dependsOn:["impact","doctor-evidence","contract-evidence","analyze-evidence","readiness-evidence"],exitPolicy:"continue-on-structured-verdict",purpose:"Emit the definitive evidence-backed workspace gate."},{id:"context",ordinal:9,phase:"ground",label:"Agent Context",command:[...t.context.command],consumes:[e.model,e.impact,e.verify],inputRefs:[],consumesArtifacts:[e.model,e.impact,e.verify],produces:[...t.context.produces],dependsOn:["verify"],exitPolicy:"stop-on-error",purpose:"Build compact agent context from the same verified evidence."},{id:"agent-sync",ordinal:10,phase:"distribute",label:"Agent Grounding",command:[...t["agent-sync"].command],consumerArgs:{vscode:["--target","vscode"]},consumes:[e.agentContext],inputRefs:[],consumesArtifacts:[e.agentContext],produces:[...t["agent-sync"].produces],dependsOn:["context"],exitPolicy:"stop-on-error",purpose:"Distribute one context into portable agent and IDE surfaces."},{id:"explain",ordinal:11,phase:"explain",label:"Explain",command:[...t.explain.command],consumes:[e.verify,e.impact],inputRefs:[],consumesArtifacts:[e.verify,e.impact],produces:[...t.explain.produces],dependsOn:["verify"],exitPolicy:"continue-on-structured-verdict",purpose:"Translate evidence and blockers into a human and agent-readable narrative."}];return {schemaVersion:V,name:"Workspace Intelligence Chain",contractPath:z,invariant:"Every consumer must preserve step identity, dependencies, artifact flow, and verdict semantics; presentation may change, chain meaning may not.",invariants:["Missing or unreadable input is unknown or unavailable; it must not be presented as verified absence.","Freshness and provenance travel with evidence and must not be discarded by projections.","The current graph is an evidence-backed workspace knowledge graph with bounded source intelligence, not a complete cross-language symbol or call graph.","Simple and standard presentations summarize the contract; their contractRefs must preserve complete traceability.","Conditional provider outputs must be resolved through their dedicated inventory contract.","Auxiliary capabilities expose or refresh intelligence but are not mandatory execution-chain steps.","Canonical step commands are stage-pure: they must not implicitly execute a downstream chain step or regenerate an upstream artifact.","Canonical JSON artifacts must satisfy their registered schema both when produced and when consumed across CLI, MCP, IDE, and CI trust boundaries.","Schema validity is necessary but not sufficient: hashes, embedded models, summaries, counts, graph statistics, and artifact references must remain semantically coherent.","Persisted impact evidence must be rejected as stale when the current workspace model or Git observation no longer matches its embedded diff.","Canonical artifact replacement must be atomic and workspace-contained; an interrupted or denied write must preserve the last valid artifact.","Concurrent history updates must be serialized without silently dropping entries, and invalid history must never be overwritten as if it were absent.","The canonical global registry is ~/.workspai/workspaces.json; ~/.rapidkit/workspaces.json is a non-authoritative compatibility mirror for legacy consumers and must not diverge after a CLI registry mutation."],semantics:{workspace:"The governed operating boundary that relates one or more projects and repositories to shared metadata, policies, contracts, evidence, and consumers.",repository:"A source-control boundary that may contain one or more projects and may live inside or outside the workspace root.",project:"A discoverable build or runtime unit with its own path, metadata or observable manifests, command capabilities, and evidence.",evidence:"A sourced observation or generated verification result with provenance and freshness; evidence may be consumed by a later run.",artifact:"A durable generated file that another command or consumer can read without parsing terminal prose.",gate:"A structured verdict with reasons and exit semantics derived from current evidence."},workspaceLifecycle:{ingestionRoutes:[{id:"create",label:"Create",commands:["create workspace","create project"],result:"Create a workspace or supported project and write canonical Workspai metadata."},{id:"adopt",label:"Adopt",commands:["adopt"],result:"Register an existing project in place without requiring source relocation."},{id:"import",label:"Import",commands:["import","workspace import"],result:"Attach an existing project or repository path to the workspace inventory."}],durableState:[{id:"workspace-identity",paths:[".workspai-workspace",".workspai/workspace.json"],purpose:"Identify the workspace boundary, profile, and canonical root."},{id:"project-inventory",paths:[".workspai/project.json",".workspai/context.json",".workspai/adopt.json","~/.workspai/workspaces.json","~/.rapidkit/workspaces.json (legacy compatibility mirror)"],purpose:"Record native, adopted, imported, and globally registered project locations while preserving a non-authoritative mirror for legacy extension discovery."},{id:"governance",paths:[".workspai/policies.yml",".workspai/workspace.contract.json"],purpose:"Define workspace policy and explicit structural relationships."},{id:"graph-overrides",paths:[".workspai/workspace-graph.overrides.json"],purpose:"Provide explicit dependency edges that override inferred relationships."}],rule:"Create, adopt, and import are ingestion routes, not intelligence facts. Their durable state becomes observable input to Model."},runtimeRegistry:{authority:"contracts/workspace-intelligence-runtime-registry.ts",artifacts:Object.entries(a).map(([r,a])=>({id:r,path:a,schemaVersion:b[r],schemaContract:c[r]}))},executionEnvelope:{rule:"Sync and baseline resolution are deterministic execution prerequisites, not canonical intelligence stages; every run reports them separately and preserves the exact canonical stage sequence.",operations:[{id:"sync",executionPoint:"before:model",artifacts:[".workspai/workspace.contract.json",".workspai/workspace-registry.v1.json"],failurePolicy:"stop-and-report",purpose:"Reconcile portable workspace inventory and contract inputs before modeling."},{id:"baseline",executionPoint:"after:model-before:diff",artifacts:[e.snapshot],failurePolicy:"stop-and-report",purpose:"Create an initial structural baseline when absent or reuse the existing baseline before Diff."}],report:{artifact:e.intelligenceRun,schemaVersion:b.intelligenceRun,invariant:"The report must preserve exact preflight and stage order, registry-owned artifacts, failure propagation, and aggregate status/exit semantics."}},boundaries:{inputs:[{id:"projects-repositories",label:"Projects and repositories",sources:["projects","repositories","services","modules","imported paths"],entersAt:"model"},{id:"runtime-dependencies",label:"Runtime and dependencies",sources:["runtime manifests","lockfiles","scripts","framework markers","package dependencies","bounded multi-language source observations for supported file extensions"],entersAt:"model"},{id:"workspace-rules",label:"Workspace rules",sources:["workspace markers","registry","project metadata","contracts","policies","ownership","graph overrides"],entersAt:"model"},{id:"changes",label:"Changes",sources:["repository state","git state","model baseline","workspace diff"],entersAt:"diff"},{id:"model-baseline",label:"Explicit model baseline",sources:[e.snapshot],entersAt:"diff"},{id:"existing-evidence",label:"Existing evidence",sources:["doctor reports","analysis reports","contract verification","release readiness","pipeline results","tests and runtime evidence","previous intelligence artifacts"],entersAt:"doctor-evidence"}],outputs:[{id:"understanding",label:"System understanding",artifacts:[e.model,e.knowledgeGraph,e.diff,e.impact],producedBy:["model","diff","impact"],inventory:"complete-for-chain"},{id:"governance-evidence",label:"Governance evidence",artifacts:[e.doctor,e.contractVerify,e.analyze,e.readiness,e.verify,e.history],producedBy:["doctor-evidence","contract-evidence","analyze-evidence","readiness-evidence","verify"],inventory:"complete-for-chain"},{id:"agent-grounding",label:"Agent grounding",artifacts:[e.agentContext,e.agentIndex,e.agentCustomizationPack,e.skillsIndex,e.agents],producedBy:["context","agent-sync"],inventory:"canonical-minimum",inventoryContract:"contracts/agent-customization-pack.v1.json"},{id:"explanations",label:"Explainable decisions",artifacts:[e.explain],producedBy:["explain"],inventory:"complete-for-chain"}],consumers:[{id:"developers",label:"Developers",channels:["CLI","reports","AGENTS.md"]},{id:"ci",label:"CI",channels:["JSON artifacts","exit codes","release gates"]},{id:"ides",label:"IDEs",channels:["synced contracts","extension","agent context"]},{id:"ai-agents",label:"AI agents",channels:["INDEX.json","context","skills","MCP"]}]},deliveryChannels:[{id:"artifacts",carries:["reports","models","context","grounding","skills"],authority:"canonical"},{id:"json-stdout",carries:["structured command results"],authority:"projection"},{id:"human-cli",carries:["summaries","diagnostics","next actions"],authority:"projection"},{id:"exit-codes",carries:["gate and command status"],authority:"projection"},{id:"watch-events",carries:["incremental workspace change events"],authority:"projection"},{id:"mcp",carries:["read-mostly access to current workspace artifacts"],authority:"projection"}],feedback:{from:["developers","ci","ides","ai-agents"],signals:["source commits","dependency updates","policy and contract edits","repairs","test and runtime results","agent action outcomes"],reentersThrough:["projects-repositories","runtime-dependencies","workspace-rules","changes","existing-evidence"],rule:"Consumer actions are not silently treated as truth. They re-enter as observable changes or evidence and must be modeled and verified again."},auxiliaryCapabilities:[{id:"graph",commands:["workspace graph emit","workspace graph explain","workspace graph entities","workspace graph evidence","workspace graph path","workspace graph search","workspace graph benchmark","workspace graph overlay","workspace graph dot","workspace graph mermaid","workspace graph jsonld","workspace graph graphml","workspace graph gexf"],reads:[e.model,e.knowledgeGraph],role:"Query the proof-backed graph derived from the canonical workspace model.",chainStep:false},{id:"evaluation",commands:["workspace eval init","workspace eval record","workspace eval status","workspace eval report","workspace eval compare"],reads:[e.evaluationLive,e.evaluationLastRun],produces:[e.evaluationLive,e.evaluationLastRun],role:"Measure model usage, activity, cost provenance, and verified outcomes without storing prompt or response bodies.",chainStep:false},{id:"watch",commands:["workspace watch"],reads:["workspace inputs",e.model],role:"Refresh the model incrementally and emit deterministic change events.",chainStep:false},{id:"mcp",commands:["workspace mcp serve"],reads:["workspace evidence artifacts"],role:"Expose read-mostly workspace evidence to compatible clients.",chainStep:false}],presentations:{simple:{layers:["inputs","intelligence","outputs","consumers"],nodes:[{id:"input-layer",kind:"inputs",label:"Input Layer",summary:"Projects \xB7 Repositories \xB7 Dependencies \xB7 Changes",contractRefs:["projects-repositories","runtime-dependencies","workspace-rules","changes","model-baseline","existing-evidence"]},{id:"workspace-intelligence",kind:"intelligence",label:"Workspace Intelligence",summary:"Model \xB7 Graph \xB7 Impact \xB7 Verify",contractRefs:s.map(r=>r.id)},{id:"agent-grounding",kind:"outputs",label:"Agent Grounding",summary:"AGENTS.md \xB7 Skills \xB7 Context",contractRefs:["agent-grounding"]},{id:"evidence-and-decisions",kind:"outputs",label:"Evidence Contracts",summary:"Reports \xB7 Artifacts \xB7 Gates",contractRefs:["understanding","governance-evidence","explanations"]},{id:"shared-consumers",kind:"consumers",label:"Shared Consumers",summary:"Developers \xB7 CI \xB7 IDEs \xB7 AI agents",contractRefs:["developers","ci","ides","ai-agents"]}],rule:"Use concrete user-facing language for first-contact explanations. Every input, output, consumer, and chain step must remain traceable through contractRefs even when details are summarized."},standard:{phases:["understand","change","evidence","gate","ground","distribute","explain"],nodes:[{id:"understand",label:"Understand",question:"What exists in the current workspace?",stepRefs:["model"]},{id:"change",label:"Change",question:"What changed, and what can it affect?",stepRefs:["diff","impact"]},{id:"evidence",label:"Evidence",question:"What health, contract, and readiness facts were observed?",stepRefs:["doctor-evidence","contract-evidence","analyze-evidence","readiness-evidence"]},{id:"gate",label:"Gate",question:"Is the current state acceptable and trustworthy?",stepRefs:["verify"]},{id:"ground",label:"Ground",question:"What should an agent know before acting?",stepRefs:["context"]},{id:"distribute",label:"Distribute",question:"Which durable agent and IDE surfaces receive that context?",stepRefs:["agent-sync"]},{id:"explain",label:"Explain",question:"Why did the system reach this result or verdict?",stepRefs:["explain"]}],rule:"Use for architecture education and product surfaces. Every phase must appear once and in order."},advanced:{steps:s.map(r=>r.id),requiredFields:["command","inputRefs","consumesArtifacts","produces","dependsOn","exitPolicy","purpose"],rule:"Use for implementers, adapters, IDEs, and CI. Preserve every step and its artifact and verdict semantics."}},steps:s,diagram:{direction:"TB",nodes:s.map(({id:r,label:a,phase:o})=>({id:r,label:a,phase:o})),edges:s.flatMap(r=>r.dependsOn.map(a=>({from:a,to:r.id,meaning:"required before"})))},consumers:{agents:{canonicalReadOrder:[e.agentIndex,e.agentContext,e.verify,e.impact,e.explain,e.model,e.knowledgeGraph,e.agentCustomizationPack,e.skillsIndex],entrypoints:[e.agents,".workspai/AGENT-GROUNDING.md"],rule:"Agents must cite current artifacts, preserve verified versus inferred status, and re-run the producing step when evidence is missing or stale."},ideAndCi:{requiredArtifacts:[e.model,e.knowledgeGraph,e.impact,e.verify],rule:"IDEs and CI must consume structured artifacts and verdict exit semantics rather than parse human help or terminal prose."},docsAndDiagrams:{rule:"Documentation and diagrams must derive labels, ordering, and edges from this contract and must not invent implemented steps."}}}}var K=b.agentContext,H=a.agentContext;function B(e){if(typeof e!="string"||!e.trim()||e==="true")return "generic";let t=e.trim().toLowerCase();return t==="codex"||t==="claude"||t==="cursor"||t==="orca"?t:"generic"}function N(e){return `npx --yes --package workspai workspai ${e}`.trim()}function u(e){return `npx workspai ${e}`.trim()}function d(e){return {id:e.id,scope:e.scope,display:u(e.args),execute:N(e.args),description:e.description,...e.project?{project:e.project}:{},freshness:h({id:`command.${e.id}`,label:`${e.id} command`,scope:"command",value:{display:u(e.args),execute:N(e.args)},...e.project?{project:e.project}:{},freshness:{kind:"derived",category:"structure",generatedAt:e.generatedAt,now:e.now,sourceArtifact:a.model,sourcePath:`safeCommands.${e.id}`,reason:"Safe command surfaces are derived from workspace model command capabilities."}}).freshness}}function _(e,t){return `workspace run ${t} --scope project:${e.name}`}function U(e){return (e.startsWith("project:")?e.slice(8):e).trim().toLowerCase()}function J(e){return [e.name,e.path,G.basename(e.path),e.absolutePath].filter(t=>typeof t=="string"&&t.trim().length>0).map(t=>t.trim().toLowerCase())}function X(e,t,s){let r={generatedAt:e.generatedAt,now:s},a=[d({id:"workspace.model",scope:"workspace",args:"workspace model --json",description:"Read the canonical workspace intelligence model.",...r}),d({id:"workspace.graph.entities",scope:"workspace",args:"workspace graph entities --json",description:"Query proof-backed workspace entities without loading the full graph.",...r}),d({id:"workspace.graph.evidence",scope:"workspace",args:"workspace graph evidence <entity-or-relation> --json",description:"Resolve portable evidence for a graph entity or relation.",...r}),d({id:"workspace.graph.path",scope:"workspace",args:"workspace graph path <from> <to> --json",description:"Find a shortest proof-carrying path between workspace entities.",...r}),d({id:"workspace.doctor",scope:"workspace",args:"doctor workspace --json",description:"Check workspace health before claiming verification.",...r}),d({id:"workspace.pipeline",scope:"workspace",args:"pipeline --json",description:"Run the governed sync, doctor, analyze, readiness, and autopilot loop.",...r}),d({id:"workspace.contract.verify",scope:"workspace",args:"workspace contract verify --json",description:"Verify workspace contract and dependency edges.",...r}),d({id:"workspace.verify",scope:"workspace",args:"workspace verify --json",description:"Evaluate evidence freshness and verification gates before release decisions.",...r})],o=t?[t]:e.projects;for(let i of o)i.commands.fleetStages.includes("test")&&a.push(d({id:`project.${i.name}.test`,scope:"project",project:i.name,args:_(i,"test"),description:`Run tests for ${i.name} through workspace orchestration.`,...r})),i.commands.fleetStages.includes("build")&&a.push(d({id:`project.${i.name}.build`,scope:"project",project:i.name,args:_(i,"build"),description:`Build ${i.name} through workspace orchestration.`,...r}));return a}function Q(e){return e.commands.fleetStages.filter(t=>t==="test"||t==="build").map(t=>`workspace run ${t}`)}function Y(e,t){if(!t?.startsWith("project:"))return;let s=U(t);if(s)return e.projects.find(r=>J(r).includes(s))}function Z(e,t,s){let r=[...e.validation?.issues??[]];t?.startsWith("project:")&&!s&&r.push({severity:"error",code:"context.scope.project.missing",message:`Requested project scope was not found: ${t}`,target:t});let a=r.filter(i=>i.severity==="error").length,o=r.filter(i=>i.severity==="warning").length;return {status:a>0?"failed":o>0?"warning":"passed",errors:a,warnings:o,issues:r}}async function ee(e,t){let s=[],r=[];for(let[a,o]of Object.entries(e.evidence))o&&await d$2(t,o.path)!==null?s.push(`${a}: ${o.path}`):r.push(a);return {available:s.sort(),missing:r.sort()}}function te(e){let t=e.summary.projectCount,s=e.summary.runtimes.length?`${e.summary.runtimes.join(", ")} runtime coverage`:"no runtime coverage",r=e.identity.surfaces.length?e.identity.surfaces.join(", "):"no detected surfaces";return `${e.workspace.name} is a ${e.identity.workspaceType} with ${t} project${t===1?"":"s"}, ${s}, and ${r}.`}function re(e){let t=["Do not claim a command passed unless a report or command output proves it.","Do not infer secrets or environment values from file names.","Do not change project scope without checking the selected project."];return e.contracts.exists||t.push("Workspace contract is missing; dependency and API edges may be incomplete."),e.summary.observedProjects>0&&t.push("Some projects are observed rather than first-class; command support may be partial."),t}async function fe(e){let t=e.model??await p({workspacePath:e.workspacePath,includeEvidence:e.includeEvidence===true,observableScanDepth:e.observableScanDepth,now:e.now}),s=B(e.agent),r=Y(t,e.scope),a$1=Z(t,e.scope,r);if(e.strict===true&&a$1.status!=="passed"){let n=a$1.issues.map(m=>`${m.severity}:${m.code}:${m.target}`).join(", ");throw new Error(`Workspace context strict validation failed: ${n}`)}let o=e.now??new Date,i=t.facts??[],M=new Set((r?[r]:t.projects).map(n=>n.name)),v=i.filter(n=>n.project?M.has(n.project):true),L=(r?[r]:t.projects).map(n=>{let m=v.filter($=>$.project===n.name);return {name:n.name,path:n.path,kind:n.kind,category:n.category,runtime:n.runtime,framework:n.frameworkDisplayName,...n.generator?{generator:n.generator}:{},createCapability:n.createCapability,supportTier:n.supportTier,safeCommands:Q(n),importantFiles:n.importantFiles,facts:m}}),g=await ee(t,e.workspacePath),k=G.join(e.workspacePath,a.knowledgeGraph),p$1=await O.pathExists(k)?await O.readJson(k).catch(()=>null):null,w=false;if(p$1?.schemaVersion===b.knowledgeGraph)try{c$1(p$1,t),w=true;}catch{}let b$1=te(t),C=X(t,r,o),F=C.map(n=>h({id:`context.command.${n.id}`,label:`${n.id} safe command`,scope:"command",value:{display:n.display,execute:n.execute,scope:n.scope},...n.project?{project:n.project}:{},freshness:{kind:"derived",category:"structure",generatedAt:t.generatedAt,now:o,sourceArtifact:a.agentContext,sourcePath:`safeCommands.${n.id}`,reason:"Context safe commands are derived from workspace model command capabilities."}})),x=[...v,...F],h$1=i$1({facts:x,generatedAt:o.toISOString(),now:o}),f=T();return {schemaVersion:K,generatedAt:o.toISOString(),agent:s,workspaceSummary:b$1,modelRef:a.model,knowledgeGraph:{artifact:a.knowledgeGraph,schemaVersion:b.knowledgeGraph,available:w,...typeof p$1?.quality?.entityCount=="number"?{entityCount:p$1.quality.entityCount}:{},...typeof p$1?.quality?.relationCount=="number"?{relationCount:p$1.quality.relationCount}:{},...typeof p$1?.quality?.proofCount=="number"?{proofCount:p$1.quality.proofCount}:{},queryCommands:[u("workspace graph search <query> --limit 12 --json"),u("workspace graph entities [kind] --json"),u("workspace graph evidence <entity-or-relation> --json"),u("workspace graph path <from> <to> --json")]},intelligenceChain:{schemaVersion:f.schemaVersion,contractPath:f.contractPath,currentStep:"context",canonicalReadOrder:[...f.consumers.agents.canonicalReadOrder]},workspace:{name:t.workspace.name,root:t.workspace.root,type:t.identity.workspaceType,...t.workspace.profile?{profile:t.workspace.profile}:{}},scope:{requested:e.scope??"workspace",...r?{activeProject:r.name}:{}},projects:L,safeCommands:C,facts:x,factFreshness:h$1,evidence:g,policies:{mode:t.policies.mode,source:t.policies.source},contracts:{exists:t.contracts.exists,path:t.contracts.workspaceContractPath},validation:a$1,agentInstructions:[`Read \`${a.agentIndex}\` first, then this context pack and linked evidence reports.`,"Use `workspace graph search <query> --limit 12 --json` for bounded, proof-backed retrieval before loading the full graph.",`Load \`${a.knowledgeGraph}\` only when a complete graph export is explicitly required.`,"Use this context as the workspace source of truth before inspecting random files.","Prefer workspace-level evidence over generic framework assumptions.","Use `display` commands when explaining steps to a human.","Use `execute` commands when launching commands from automation or tooling.","Treat `facts[].freshness.verifyBeforeUse` as a hard refresh requirement before using that fact in advice, fixes, or release decisions.","Do not carry extracted facts beyond their freshness contract; re-read or regenerate evidence when the contract says stale, unknown, live, or verify-before-use.","Keep project-scoped advice tied to the active project scope.","Regenerate stale grounding with `npx workspai workspace agent-sync --write --refresh-context`."],unsafeAssumptions:[...re(t),...h$1.verifyBeforeUseFacts>0?[`${h$1.verifyBeforeUseFacts} fact(s) require verification before use; do not treat them as durable workspace structure.`]:[]],humanSummary:[b$1,`Evidence available: ${g.available.length}. Missing evidence groups: ${g.missing.join(", ")||"none"}.`,r?`Active project scope: ${r.name} (${r.frameworkDisplayName}).`:"Scope: whole workspace."].join(`
|
|
2
|
+
`)}}async function ye(e$1,t){return e(t,H,d$1(e$1))}export{V as a,T as b,K as c,H as d,fe as e,ye as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-AHLMIL2T.js';var o="model-usage-event.v1",s=b.evaluationLive,a="workspace-intelligence-evaluation-comparison.v1",i=["provider-reported","tokenizer-counted","estimated","unavailable"];export{o as a,s as b,a as c,i as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-A5FBGRJA.js';import {g,p}from'./chunk-KMLPHFLD.js';import {d,e}from'./chunk-SS2VV3D5.js';import {s}from'./chunk-MOSXTVPU.js';import {s as s$1,q}from'./chunk-RJIYCDVC.js';import a from'path';import {existsSync}from'fs';import u from'fs-extra';var f=".workspai/workspace-registry.v1.json",w="workspace-registry.v1";function x(r){return {slug:r.slug,relativePath:r.relativePath,framework:r.framework,kit:r.kit,source:r.source}}async function A(r){let e=s(r,"workspace.json").find(t=>existsSync(t));if(!e)return {exists:false,legacyProjectCount:0};try{let t=await u.readJson(e),c=Array.isArray(t.projects)?t.projects.length:0,o=typeof t.workspace_name=="string"&&t.workspace_name.trim()||typeof t.name=="string"&&t.name.trim()||a.basename(r);return {exists:true,manifestPath:e,workspaceName:o,profile:typeof t.profile=="string"?t.profile:void 0,legacyProjectCount:c}}catch{return {exists:true,manifestPath:e,legacyProjectCount:0,workspaceName:a.basename(r)}}}async function b(r){let e=a$1(r);for(let t of s$1())if(await u.pathExists(t))try{let o=((await u.readJson(t)).workspaces||[]).find(s=>a$1(s.path)===e);if(o)return {exists:true,projectCount:Array.isArray(o.projects)?o.projects.length:0,registryPath:t}}catch{continue}return {exists:false,projectCount:0,registryPath:a.join(q(),"workspaces.json")}}async function E(r,e){let t=a.resolve(r),c=await d(t,g),o=await A(t),s=await b(t),i=e?.contract!==void 0||!!c,n=[];if(e?.contract)n=e.contract.projects||[];else if(i)try{let{contract:d}=await p({workspacePath:t});n=d.projects||[];}catch{n=[];}let S={contract:{exists:i,projectCount:n.length,path:g},globalRegistry:{exists:s.exists,projectCount:s.projectCount,path:s.registryPath},legacyWorkspaceJson:{exists:o.exists,projectCount:o.legacyProjectCount,path:o.manifestPath?a.relative(t,o.manifestPath):void 0}},p$1="none",m=[],y=0;return i?(p$1="workspace.contract.json",m=n.map(x),y=m.length):s.projectCount>0?(p$1="global-registry",y=s.projectCount):o.legacyProjectCount>0&&(p$1="legacy-workspace.json",y=o.legacyProjectCount),{contractExists:i,summary:{schemaVersion:w,kind:"rapidkit.workspace.registry",workspacePath:t,workspaceName:o.workspaceName||a.basename(t),profile:o.profile,projectCount:y,authority:p$1,contractPath:g,projects:m,sources:S}}}async function Y(r){let e=await d(r,f);if(!e)return null;try{let t=await u.readJson(e);return t?.schemaVersion!==w?null:t}catch{return null}}async function D(r,e$1){let t=await _(r,e$1);return await e(r,f,t),t}async function _(r,e){return {...(await E(r,{contract:e?.contract})).summary,generatedAt:(e?.now??new Date).toISOString(),registrySummaryPath:f}}function H(r,e=""){return r.projectCount>0?r.authority==="workspace.contract.json"?`${r.projectCount} project(s) registered in workspace contract${e}.`:r.authority==="global-registry"?`${r.projectCount} project(s) registered in global workspace registry${e}.`:`${r.projectCount} project(s) registered in legacy workspace manifest${e}.`:`Workspace state exists, but no projects are registered yet${e}.`}export{f as a,w as b,E as c,Y as d,D as e,_ as f,H as g};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {f
|
|
1
|
+
import {f,g,e as e$2}from'./chunk-C35UXTDM.js';import {b as b$3}from'./chunk-KVSYBHUR.js';import {b as b$7,a as a$3}from'./chunk-THIOE2PB.js';import {b as b$4}from'./chunk-2AXEGYPL.js';import {a as a$2}from'./chunk-IPJ5URDF.js';import {e,g as g$1,f as f$2,b as b$6,c as c$2,d as d$2}from'./chunk-LAJM2SBP.js';import {d,b as b$2}from'./chunk-Y5YAP4F3.js';import {g as g$2}from'./chunk-KMLPHFLD.js';import {i,f as f$1,c as c$1,e as e$3}from'./chunk-VRW6KXNK.js';import {a as a$1}from'./chunk-TQEMLBAG.js';import {b as b$1,a,c,d as d$1}from'./chunk-MOSXTVPU.js';import {b as b$5,k,j,m,i as i$1,t,s,q as q$1}from'./chunk-RJIYCDVC.js';import {promises}from'fs';import*as b from'fs-extra';import p from'path';import e$1 from'chalk';import {execa}from'execa';function N(){return i$1()}var rt="transactions";function st(){return p.join(q$1(),rt)}async function We(){let t=st();return await b$7(t),a$3({journalDirectory:t})}async function Oe(t){for(let o of s())await t.captureFile(o);}async function ie(t){let o=await We();try{return await Oe(o),await o.captureOwnedTree(t),o}catch(n){return F(o,n)}}async function lt(t){let o=await We();try{await Oe(o),await o.captureOwnedTree(p.join(t,a)),await o.captureOwnedTree(p.join(t,".venv"));let n=[c,".gitignore",p.join(a,"workspace.json"),p.join(a,"toolchain.lock"),p.join(a,"policies.yml"),p.join(a,"cache-config.yml"),g$2,a$2,"pyproject.toml","poetry.toml","poetry.lock","rapidkit","rapidkit.cmd","README.md",".rapidkit-global"];for(let s of n)await o.captureFile(p.join(t,s));return o}catch(n){return F(o,n)}}async function B(t){await t.commit(),t.journalPath&&await promises.rm(p.dirname(t.journalPath),{recursive:true,force:true}).catch(o=>f$1.debug(`Could not remove committed lifecycle journal: ${o}`));}async function F(t,o){try{await t.rollback();}catch(n){throw new AggregateError([o,n],"Workspace lifecycle failed and rollback was incomplete.")}throw o}async function J(t,o,n,s,r){let l=d(o,i(),n,r?.pythonEngine?{coreStatus:r.pythonEngine,...r.pythonEngineReason?{coreReason:r.pythonEngineReason}:{},...s?{pythonVersion:s}:{}}:void 0);s&&!r?.pythonEngine&&(l.metadata||(l.metadata={}),l.metadata.python={pythonVersion:s}),await b$2(t,l);}async function U(t){await b.outputFile(p.join(t,".gitignore"),`.venv/
|
|
2
2
|
__pycache__/
|
|
3
3
|
*.pyc
|
|
4
4
|
.env
|
|
5
5
|
${d$1}
|
|
6
6
|
${b$1}/
|
|
7
7
|
|
|
8
|
-
`,"utf-8");}async function
|
|
8
|
+
`,"utf-8");}async function Fe(t){try{let o=await execa("git",["rev-parse","--show-toplevel"],{cwd:t,env:a$1()});return o.stdout.trim()?p.resolve(t,o.stdout.trim()):null}catch{return null}}async function Q(t,o,n){if(await Fe(t)){o.warn("Git initialization skipped because target is already inside a git worktree");return}o.start("Initializing git repository");try{await execa("git",["init"],{cwd:t,env:a$1()}),await execa("git",["add","."],{cwd:t,env:a$1()}),await execa("git",["-c","user.name=Workspai","-c","user.email=workspai@localhost","commit","-m",n],{cwd:t,env:a$1()}),o.succeed("Git repository initialized");}catch{o.warn("Could not initialize git repository");}}async function Le(t,o){let n=o.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await b.outputFile(p.join(t,"poetry.toml"),`[virtualenvs]
|
|
9
9
|
in-project = true
|
|
10
10
|
`,"utf-8"),await b.outputFile(p.join(t,"pyproject.toml"),`[tool.poetry]
|
|
11
11
|
name = "${n}"
|
|
@@ -21,7 +21,7 @@ rapidkit-core = "*"
|
|
|
21
21
|
[build-system]
|
|
22
22
|
requires = ["poetry-core"]
|
|
23
23
|
build-backend = "poetry.core.masonry.api"
|
|
24
|
-
`,"utf-8");}function
|
|
24
|
+
`,"utf-8");}function Ve(t,o,n,s,r){return JSON.stringify({schema_version:"1.0",workspace_name:t,workspai_version:i(),rapidkit_version:i(),created_at:new Date().toISOString(),created_by:"workspai",profile:s||"minimal",...r?.profileRequested?{profile_requested:r.profileRequested}:{},...r?.bootstrapNote?{bootstrap_note:r.bootstrapNote}:{},engine:{install_method:o,python_version:n||null,...r?.pythonEngine?{python_core:{status:r.pythonEngine,...r.pythonEngineReason?{reason:r.pythonEngineReason}:{}}}:{}}},null,2)}function Ge(t,o,n,s,r,l){return JSON.stringify({schema_version:"1.0",generated_by:"workspai",generated_at:new Date().toISOString(),runtime:{python:{version:o||null,install_method:t,...l?.pythonEngine?{core:{status:l.pythonEngine,...l.pythonEngineReason?{reason:l.pythonEngineReason}:{}}}:{}},node:{version:n||process.version},go:{version:s||null},java:{version:null,build_tool:null,build_tool_version:null},dotnet:{version:r||null,sdk:r||null}}},null,2)}function He(){return `version: "1.0"
|
|
25
25
|
mode: warn # "warn" or "strict"
|
|
26
26
|
dependency_sharing_mode: isolated # "isolated" or "shared-runtime-caches" or "shared-node-deps"
|
|
27
27
|
# change profile (recommended): npx workspai bootstrap --profile polyglot
|
|
@@ -30,20 +30,20 @@ rules:
|
|
|
30
30
|
enforce_workspace_marker: true
|
|
31
31
|
enforce_toolchain_lock: false
|
|
32
32
|
disallow_untrusted_tool_sources: false
|
|
33
|
-
`}function
|
|
33
|
+
`}function Ue(){return `version: "1.0"
|
|
34
34
|
cache:
|
|
35
35
|
strategy: shared # "shared" or "on-demand"
|
|
36
36
|
prune_on_bootstrap: false
|
|
37
37
|
self_heal: true
|
|
38
38
|
verify_integrity: false
|
|
39
|
-
`}async function
|
|
40
|
-
`,"utf-8"),f.debug(`Created .python-version with ${o}`);}catch(n){f.warn(`Failed to create .python-version: ${n}`);}}function q(){let n=[...(process.env.PATH||"").split(p.delimiter).filter(Boolean)];for(let s
|
|
39
|
+
`}async function Ye(){try{let{stdout:t}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),o=t.match(/go(\d+\.\d+(?:\.\d+)?)/i);return o?o[1]:void 0}catch{return}}async function qe(){try{let{stdout:t}=await execa("dotnet",["--version"],{timeout:3e3,stdio:"pipe"}),o=t.trim();return o.length>0?o:void 0}catch{return}}async function X(t,o,n,s,r,l){let[d,g]=await Promise.all([Ye(),qe()]),c=[{fileName:"workspace.json",content:Ve(o,n,s,r,l)},{fileName:"toolchain.lock",content:Ge(n,s,process.version,d,g,l)},{fileName:"policies.yml",content:He()},{fileName:"cache-config.yml",content:Ue()}];for(let m of c)await b.outputFile(p.join(t,a,m.fileName),m.content,"utf-8");}async function Ut(t,o){let{workspaceName:n=p.basename(t),installMethod:s="venv",pythonVersion:r,profile:l,writeMarker:d$1=true,writeGitignore:g=true,onlyIfMissing:c$1=true}=o||{},m=[],[y,h]=await Promise.all([Ye(),qe()]),a$1=[{relPath:p.join(a,"workspace.json"),legacyRelPath:p.join(b$1,"workspace.json"),content:Ve(n,s,r,l)},{relPath:p.join(a,"toolchain.lock"),legacyRelPath:p.join(b$1,"toolchain.lock"),content:Ge(s,r,process.version,y,h)},{relPath:p.join(a,"policies.yml"),legacyRelPath:p.join(b$1,"policies.yml"),content:He()},{relPath:p.join(a,"cache-config.yml"),legacyRelPath:p.join(b$1,"cache-config.yml"),content:Ue()}];for(let i of a$1){let x=p.join(t,i.relPath),w=p.join(t,i.legacyRelPath),A=await b.pathExists(x),I=await b.pathExists(w);c$1&&A||(c$1&&I?(await b.copy(w,x),m.push(i.relPath)):(await b.outputFile(x,i.content,"utf-8"),m.push(i.relPath)));}if(d$1&&(!await b.pathExists(p.join(t,c))||!c$1)){let x=d(n,i(),s);r&&(x.metadata||(x.metadata={}),x.metadata.python={pythonVersion:r}),await b$2(t,x),m.push(c);}if(g){let i=p.join(t,".gitignore");(!c$1||!await b.pathExists(i))&&(await U(t),m.push(".gitignore"));}return m}var ze=new Set(["go-only","java-only","dotnet-only","node-only","minimal"]),ct={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"};function pt(t){let o=t,n=new Set;for(;!ze.has(o);){if(n.has(o))return "minimal";n.add(o);let s=ct[o];if(!s)return "minimal";o=s;}return o}var H="3.10",Be=["3.10","3.11","3.12"];async function Ne(t){try{let{stdout:o}=await execa(t,["--version"],{timeout:3e3}),n=o.match(/Python (\d+\.\d+\.\d+)/);if(n)return n[1]}catch{}return null}async function dt(t,o){try{await promises.writeFile(p.join(t,".python-version"),`${o}
|
|
40
|
+
`,"utf-8"),f$1.debug(`Created .python-version with ${o}`);}catch(n){f$1.warn(`Failed to create .python-version: ${n}`);}}function q(){let n=[...(process.env.PATH||"").split(p.delimiter).filter(Boolean)];for(let s of t())n.includes(s)||n.unshift(s);process.env.PATH=n.join(p.delimiter);}async function de(t,o){q(),t.start("Checking pipx installation");try{return await execa("pipx",["--version"]),t.succeed("pipx found"),{kind:"binary"}}catch{}let n=N();try{return await execa(n,["-m","pipx","--version"]),t.succeed("pipx found"),{kind:"python-module",pythonCmd:n}}catch{}if(o)throw new d$2;t.stop?.();let{installPipx:s}=await b$3([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!s)throw new d$2;t.start("Installing pipx (user install)");try{try{await execa(n,["-m","pip","install","--user","--upgrade","pip"]);}catch{}await execa(n,["-m","pip","install","--user","--upgrade","pipx"]);}catch(r){let l=r,d=String(l?.stderr||l?.shortMessage||l?.message||"");throw new f$2("Install pipx with python -m pip",r instanceof Error?r:new Error(d))}t.succeed("pipx installed"),q();try{return await execa(n,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:n}}catch(r){let l=r,d=String(l?.stderr||l?.shortMessage||l?.message||"pipx not runnable after install");throw new f$2("Verify pipx after install",new Error(`${d}
|
|
41
41
|
|
|
42
|
-
Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function Y(t,o){return t.kind==="binary"?execa("pipx",o):execa(t.pythonCmd,["-m","pipx",...o])}function
|
|
43
|
-
${
|
|
44
|
-
${
|
|
42
|
+
Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function Y(t,o){return t.kind==="binary"?execa("pipx",o):execa(t.pythonCmd,["-m","pipx",...o])}function ut(t){let o=t.match(/^(\d+)\.(\d+)/);return o?`${o[1]}.${o[2]}`:null}function Ke(t){if(!t)return null;let o=t.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return o?`${o[1]}.${o[2]}`:null}function Pe(t,o){let[n,s]=t.split(".").map(d=>Number(d)),[r,l]=o.split(".").map(d=>Number(d));return n!==r?n-r:s-l}function Z(t,o){return Pe(t,o)>=0}async function yt(t){let o=new Set,n=k(14,10);for(let h of n)try{let a=await execa(h.command,h.args,{timeout:2500}),i=Ke(`${a.stdout||""}
|
|
43
|
+
${a.stderr||""}`);i&&Z(i,H)&&o.add(i);}catch{}let s=null;try{let h=await execa(N(),["--version"],{timeout:2500}),a=Ke(`${h.stdout||""}
|
|
44
|
+
${h.stderr||""}`);a&&Z(a,H)&&(s=a,o.add(a));}catch{}let r=Be.filter(h=>Z(h,H)),l=new Set([...r,...o]),d=Array.from(l).sort((h,a)=>Pe(a,h)),g=t?ut(t):null,c=g&&Z(g,H)?g:s||d[0]||H;return l.has(c)||l.add(c),{choices:Array.from(l).sort((h,a)=>Pe(a,h)).map(h=>{let a=[];return h===s&&a.push("current system"),h===H&&a.push("minimum supported"),o.has(h)&&h!==s&&a.push("detected"),{name:a.length>0?`${h} (${a.join(", ")})`:h,value:h}}),defaultValue:c}}async function gt(){q();let t=false,o=false;try{await execa("poetry",["--version"],{timeout:2500}),t=true;}catch{t=false;}try{await execa("pipx",["--version"],{timeout:2500}),o=true;}catch{let n=i$1();try{await execa(n,["-m","pipx","--version"],{timeout:2500}),o=true;}catch{o=false;}}return {poetry:t,pipx:o}}async function Je(){q();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function mt(t,o){return t==="poetry"&&o.poetry?"poetry":t==="pipx"&&o.pipx?"pipx":t==="venv"?"venv":o.poetry?"poetry":"venv"}async function ht(t,o){q(),t.start("Checking Poetry installation");try{await execa("poetry",["--version"]),t.succeed("Poetry found");return}catch{}if(o)throw new c$2;let{installPoetry:n}=await b$3([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!n)throw new c$2;let s=await de(t,o);t.start("Installing Poetry with pipx");try{await Y(s,["install","poetry"]);}catch(r){let l=r,d=String(l?.stderr||l?.shortMessage||l?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(d))try{await Y(s,["upgrade","poetry"]);}catch{}else throw new f$2("Install Poetry with pipx",r instanceof Error?r:new Error(d))}t.succeed("Poetry installed"),q();try{await execa("poetry",["--version"]);}catch(r){let l=r,d=String(l?.stderr||l?.shortMessage||l?.message||"Poetry not found on PATH");throw new f$2("Verify Poetry after pipx install",new Error(`${d}
|
|
45
45
|
|
|
46
|
-
Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function
|
|
46
|
+
Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function wt(t,o={}){let n=t==="poetry",s=o.pythonEngineSkipped?`echo "- Python engine installation was intentionally skipped for this workspace." 1>&2
|
|
47
47
|
echo "- For npm-owned workspace commands, run: npx workspai <command>" 1>&2
|
|
48
48
|
echo "- To install the local Python engine later, create a RapidKit Core module-enabled project, then run: npx workspai workspace run init" 1>&2
|
|
49
49
|
`:`echo "- If you used venv: ensure .venv exists (or re-run the installer)." 1>&2
|
|
@@ -79,7 +79,7 @@ ${s}${o.pythonEngineSkipped?"":n?`echo "- If you used Poetry: run 'poetry instal
|
|
|
79
79
|
`:""}${o.pythonEngineSkipped?`echo "Tip: use 'npx workspai workspace model --json' for Workspace Intelligence without the Python engine." 1>&2
|
|
80
80
|
`:`echo "Tip: you can also run: ./.venv/bin/rapidkit --help" 1>&2
|
|
81
81
|
`}exit 1
|
|
82
|
-
`}function
|
|
82
|
+
`}function ft(t,o={}){let n=t==="poetry",s=o.pythonEngineSkipped?`echo - Python engine installation was intentionally skipped for this workspace. 1>&2
|
|
83
83
|
echo - For npm-owned workspace commands, run: npx workspai ^<command^> 1>&2
|
|
84
84
|
echo - To install the local Python engine later, create a RapidKit Core module-enabled project, then run: npx workspai workspace run init 1>&2
|
|
85
85
|
`:`echo Tip: run .venv\\Scripts\\rapidkit.exe --help 1>&2
|
|
@@ -119,8 +119,8 @@ for %%R in ("%USERPROFILE%\\.local\\bin\\rapidkit.exe" "%APPDATA%\\Python\\Scrip
|
|
|
119
119
|
echo RapidKit launcher could not find a local Python CLI. 1>&2
|
|
120
120
|
${s}echo Tip: for npm-owned workspace commands, run npx --yes --package workspai workspai %* from a shell where npm is on PATH. 1>&2
|
|
121
121
|
exit /b 1
|
|
122
|
-
`}async function
|
|
123
|
-
\u{1F4CC} Configuration notes:`)),R.pythonVersion==="3.10"?console.log(e$1.gray(" \u2022 Python 3.10: Latest stable with widespread compatibility")):R.pythonVersion==="3.11"?console.log(e$1.gray(" \u2022 Python 3.11: Newer, faster (3.10-3.11: ~10% speed improvement)")):R.pythonVersion==="3.12"&&console.log(e$1.gray(" \u2022 Python 3.12: Cutting edge, excellent for performance")),R.installMethod==="poetry"?console.log(e$1.gray(" \u2022 Poetry: Dependency management + virtual env (recommended for teams)")):R.installMethod==="venv"?console.log(e$1.gray(" \u2022 venv: Standard library approach, lightweight, zero dependencies")):console.log(e$1.gray(" \u2022 pipx: Global isolated, RapidKit Core only, no local venv")),console.log(""));let
|
|
122
|
+
`}async function pe(t,o,n={}){await b.outputFile(p.join(t,"rapidkit"),wt(o,n),{encoding:"utf-8",mode:493}),await b.outputFile(p.join(t,"rapidkit.cmd"),ft(o,n),"utf-8");}async function Yt(t,o){let{skipGit:n=false,skipPythonEngine:s=false,testMode:r=false,demoMode:l=false,dryRun:d=false,yes:g$1=false,userConfig:c={},installMethod:m,profile:y,parentDirectory:h}=o,a=t||"rapidkit",i=h?p.resolve(h,a):p.resolve(process.cwd(),a);if(await b.pathExists(i))throw new e(a);if(await f(i),d){let k=y||(g$1?"minimal":void 0),_=m||c.defaultInstallMethod||"poetry",v=c.pythonVersion||"3.10";await vt(i,a,l,c,k,_,v,n,s);return}if(l){await kt(i,a,n);return}let x=new Set(["python-only","polyglot","enterprise"]),w=y||"";if(!g$1&&!y){let{selectedProfile:k}=await b$3([{type:"rawlist",name:"selectedProfile",message:"Select workspace profile:",choices:[{name:"minimal \u2014 Foundation files only (fastest bootstrap, mixed projects)",value:"minimal"},{name:"java-only \u2014 Java runtime (Spring Boot services)",value:"java-only"},{name:"python-only \u2014 Python + Poetry (FastAPI, Django, ML pipelines)",value:"python-only"},{name:"node-only \u2014 Node.js runtime (NestJS, Express, Next.js)",value:"node-only"},{name:"go-only \u2014 Go runtime (Fiber, Gin, gRPC, microservices)",value:"go-only"},{name:"dotnet-only \u2014 .NET runtime (ASP.NET Core services)",value:"dotnet-only"},{name:"polyglot \u2014 Python + Node.js + Go + Java + .NET multi-runtime workspace",value:"polyglot"},{name:"enterprise \u2014 Polyglot + governance + Sigstore verification",value:"enterprise"}],default:1}]);w=k;}else w||(w="minimal");let A=!g$1&&x.has(w),I=x.has(w)?s?"skip":A?(await b$3([{type:"confirm",name:"installPythonEngine",message:"Install the optional RapidKit Python engine now? (needed for Python-backed kits/modules)",default:true}])).installPythonEngine!==false?"install":"skip":"install":"skip",L=A&&I==="install",ue=typeof c.pythonVersion=="string"&&c.pythonVersion.trim().length>0?c.pythonVersion.trim():void 0,tt=m||c.defaultInstallMethod||"poetry",ye=L?await gt():{poetry:true,pipx:true},xe=L?await yt(ue):{choices:Be.map(k=>({name:k,value:k})),defaultValue:H},ot=mt(tt,ye),nt=[{name:ye.poetry?"\u{1F3AF} Poetry (Recommended - includes virtual env + dependency mgmt)":"\u{1F3AF} Poetry (Recommended) \u2014 not detected (we can install it)",value:"poetry"},{name:"\u{1F4E6} pip with venv (Standard, zero extra tools)",value:"venv"},{name:ye.pipx?"\u{1F527} pipx (Global isolated - RapidKit Core only, no local venv)":"\u{1F527} pipx (Global isolated) \u2014 not detected (we can install it)",value:"pipx"}],R=L?await b$3([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:xe.choices,default:xe.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:nt,default:ot}]):await(async()=>{if(I==="skip")return {pythonVersion:c.pythonVersion||"3.10",installMethod:"venv"};let k=m||c.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return f$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:c.pythonVersion||"3.10",installMethod:k}})();L&&(console.log(e$1.gray(`
|
|
123
|
+
\u{1F4CC} Configuration notes:`)),R.pythonVersion==="3.10"?console.log(e$1.gray(" \u2022 Python 3.10: Latest stable with widespread compatibility")):R.pythonVersion==="3.11"?console.log(e$1.gray(" \u2022 Python 3.11: Newer, faster (3.10-3.11: ~10% speed improvement)")):R.pythonVersion==="3.12"&&console.log(e$1.gray(" \u2022 Python 3.12: Cutting edge, excellent for performance")),R.installMethod==="poetry"?console.log(e$1.gray(" \u2022 Poetry: Dependency management + virtual env (recommended for teams)")):R.installMethod==="venv"?console.log(e$1.gray(" \u2022 venv: Standard library approach, lightweight, zero dependencies")):console.log(e$1.gray(" \u2022 pipx: Global isolated, RapidKit Core only, no local venv")),console.log(""));let ge=ze;if(ge.has(w)){let k=c$1("Creating workspace",{component:"create",phase:"workspace.python-free"}),_=await ie(i);try{await b.ensureDir(i),k.succeed("Directory created"),await J(i,a,"venv",void 0),await X(i,a,"venv",void 0,w),await U(i);let v={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await b.outputFile(p.join(i,"README.md"),`# ${a}
|
|
124
124
|
|
|
125
125
|
Workspai **${v[w]}** workspace.
|
|
126
126
|
|
|
@@ -147,11 +147,11 @@ npx workspai dev
|
|
|
147
147
|
cd <project-name>
|
|
148
148
|
npx workspai init
|
|
149
149
|
npx workspai dev
|
|
150
|
-
`)+"```\n\n## Workspace Intelligence\n\n```bash\nnpx workspai workspace model --json --write\nnpx workspai workspace context --for-agent --json --write\nnpx workspai pipeline --json --strict\n```\n\nDurable evidence is written to `.workspai/reports/`; generated agent instructions start at `AGENTS.md`.\n","utf-8"),await
|
|
150
|
+
`)+"```\n\n## Workspace Intelligence\n\n```bash\nnpx workspai workspace model --json --write\nnpx workspai workspace context --for-agent --json --write\nnpx workspai pipeline --json --strict\n```\n\nDurable evidence is written to `.workspai/reports/`; generated agent instructions start at `AGENTS.md`.\n","utf-8"),await b$4(i,{workspaceName:a,silent:r}),await B(_),n||await Q(i,k,"Initial commit: Workspai workspace"),console.log(e$1.green(`
|
|
151
151
|
\u2728 Workspace created!
|
|
152
152
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan(`
|
|
153
153
|
\u{1F680} Get started:
|
|
154
|
-
`)),console.log(e$1.white(` ${
|
|
154
|
+
`)),console.log(e$1.white(` ${g(i)}`)),w==="go-only"){console.log(e$1.white(" npx workspai create project gofiber.standard my-api")),console.log(e$1.white(" cd my-api")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
155
155
|
`)),console.log(e$1.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:f}=await execa("go",["version"],{timeout:3e3}),M=f.match(/go version go(\d+\.\d+(?:\.\d+)?)/),C=M?M[1]:"unknown";console.log(e$1.gray(`\u{1F439} Go ${C} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(e$1.yellow(`
|
|
156
156
|
\u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else if(w==="java-only")console.log(e$1.white(" npx workspai create project springboot.standard my-service")),console.log(e$1.white(" cd my-service")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
157
157
|
`)),console.log(e$1.gray("\u{1F4A1} No Python required \u2014 Spring Boot kit runs through the npm package with Java tooling."));else if(w==="dotnet-only"){console.log(e$1.white(" npx workspai create project dotnet.webapi.clean my-api")),console.log(e$1.white(" cd my-api")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
@@ -159,8 +159,8 @@ npx workspai dev
|
|
|
159
159
|
\u26A0\uFE0F .NET SDK is not installed \u2014 install it from https://dotnet.microsoft.com/download`));}}else w==="node-only"?(console.log(e$1.white(" npx workspai create project nestjs.standard my-app")),console.log(e$1.white(" cd my-app")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
160
160
|
`)),console.log(e$1.gray("\u{1F4A1} Node lifecycle commands run through Node tooling. RapidKit Core module commands for module-enabled kits can install the local Python engine later with workspace run init."))):(console.log(e$1.white(" npx workspai create project")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
161
161
|
`)),console.log(e$1.gray("\u{1F4A1} Bootstrap a specific runtime: workspai bootstrap --profile java-only|python-only|node-only|go-only|dotnet-only|polyglot|enterprise")));console.log(e$1.cyan(`
|
|
162
|
-
\u{1F4DA} More info:`)),console.log(e$1.gray(" \u2022 Change profile anytime: workspai bootstrap --profile <profile>")),console.log(e$1.gray(" \u2022 View config: cat "+
|
|
163
|
-
\u274C Error:`),v),F(_,v)}return}if(x.has(w)&&I==="skip"){let k=c$
|
|
162
|
+
\u{1F4DA} More info:`)),console.log(e$1.gray(" \u2022 Change profile anytime: workspai bootstrap --profile <profile>")),console.log(e$1.gray(" \u2022 View config: cat "+a+"/.workspai-workspace")),console.log(e$1.gray(" \u2022 Check health: workspai doctor")),console.log("");}catch(v){return k.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
163
|
+
\u274C Error:`),v),F(_,v)}return}if(x.has(w)&&I==="skip"){let k=c$1("Creating workspace",{component:"create",phase:"workspace.python-engine-skipped"}),_=await ie(i);try{await b.ensureDir(i),k.succeed("Directory created");let v={bootstrapNote:"python-engine-skipped",pythonEngine:"skipped",pythonEngineReason:"user-opted-out"};await J(i,a,"venv",void 0,v),await X(i,a,"venv",void 0,w,v),await U(i),await pe(i,"venv",{pythonEngineSkipped:true});let f={"python-only":"Python-aware",polyglot:"Polyglot",enterprise:"Enterprise"};await b.outputFile(p.join(i,"README.md"),`# ${a}
|
|
164
164
|
|
|
165
165
|
Workspai **${f[w]??w}** workspace with Workspace Intelligence enabled and Python engine installation skipped.
|
|
166
166
|
|
|
@@ -182,31 +182,31 @@ Durable evidence is written to \`.workspai/reports/\`; generated agent instructi
|
|
|
182
182
|
npx workspai create project fastapi.standard api --yes
|
|
183
183
|
npx workspai workspace run init
|
|
184
184
|
\`\`\`
|
|
185
|
-
`,"utf-8"),await
|
|
185
|
+
`,"utf-8"),await b$4(i,{workspaceName:a,silent:r}),await B(_),n||await Q(i,k,`Initial commit: Workspai workspace (${w})`),console.log(e$1.green(`
|
|
186
186
|
\u2728 Workspace created!
|
|
187
187
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan("\u2699\uFE0F Configuration:")),console.log(e$1.gray(` \u2022 Profile: ${w}`)),console.log(e$1.gray(" \u2022 Python engine: skipped")),console.log(e$1.gray(" \u2022 Workspace Intelligence: enabled")),console.log(e$1.cyan(`
|
|
188
188
|
\u{1F680} Get started:
|
|
189
|
-
`)),console.log(e$1.white(` ${
|
|
189
|
+
`)),console.log(e$1.white(` ${g(i)}`)),console.log(e$1.white(" npx workspai workspace model --json")),console.log(e$1.white(" npx workspai adopt /path/to/project")),console.log(e$1.white(` npx workspai workspace verify --json
|
|
190
190
|
`)),console.log(e$1.cyan(`\u{1F4A1} Add Python-backed kits/modules later:
|
|
191
191
|
`)),console.log(e$1.gray(" npx workspai create project fastapi.standard api --yes")),console.log(e$1.gray(` npx workspai workspace run init
|
|
192
192
|
`));return}catch(v){return k.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
193
|
-
\u274C Error:`),v),F(_,v)}}{let k=N(),_=false;try{await execa(k,["--version"],{timeout:5e3}),_=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),_=true;}catch{_=false;}}if(!_){let v=w,f=
|
|
193
|
+
\u274C Error:`),v),F(_,v)}}{let k=N(),_=false;try{await execa(k,["--version"],{timeout:5e3}),_=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),_=true;}catch{_=false;}}if(!_){let v=w,f=pt(w);if(A&&!g$1){console.log(e$1.yellow(`
|
|
194
194
|
\u26A0\uFE0F Python 3.10+ is not detected on this system.
|
|
195
195
|
`)),console.log(e$1.cyan(`You have 3 options:
|
|
196
196
|
`));let{pythonAction:C}=await b$3([{type:"rawlist",name:"pythonAction",message:"What would you like to do?",choices:[{name:"\u{1F4E5} Install Python now (I'll show you the command for your OS)",value:"install"},{name:`\u{1F504} Switch to "${f}" profile (no Python required)`,value:"fallback"},{name:"\u274C Cancel and install Python manually",value:"cancel"}]}]);if(C==="cancel"&&(console.log(e$1.cyan(`
|
|
197
197
|
\u{1F4A1} How to install Python:
|
|
198
198
|
`)),console.log(e$1.white(" Ubuntu / Debian: sudo apt install python3.10")),console.log(e$1.white(" macOS (Homebrew): brew install python@3.10")),console.log(e$1.white(` Windows: https://python.org/downloads
|
|
199
|
-
`)),console.log(e$1.gray(` After installing Python, run: npx workspai ${
|
|
199
|
+
`)),console.log(e$1.gray(` After installing Python, run: npx workspai ${a}
|
|
200
200
|
`)),process.exit(1)),C==="install"){console.log(e$1.cyan(`
|
|
201
201
|
\u{1F4A1} Install Python on your system:
|
|
202
202
|
`));let $=process.platform;$==="linux"?console.log(e$1.white(` sudo apt update && sudo apt install python3.10 python3.10-venv
|
|
203
203
|
`)):$==="darwin"?console.log(e$1.white(` brew install python@3.10
|
|
204
204
|
`)):$==="win32"&&(console.log(e$1.white(` Download: https://python.org/downloads
|
|
205
205
|
`)),console.log(e$1.white(` Run the installer and check "Add Python to PATH"
|
|
206
|
-
`))),console.log(e$1.gray(` After installing, run: npx workspai ${
|
|
206
|
+
`))),console.log(e$1.gray(` After installing, run: npx workspai ${a}
|
|
207
207
|
`)),process.exit(0);}if(C==="fallback"&&(console.log(e$1.green(`
|
|
208
208
|
\u2705 Switching to "${f}" profile (no Python required).
|
|
209
|
-
`)),w=f,
|
|
209
|
+
`)),w=f,ge.has(f))){let $=c$1("Creating workspace",{component:"create",phase:"workspace.python-free"}),ee=await ie(i);try{await b.ensureDir(i),$.succeed("Directory created"),await J(i,a,"venv",void 0),await X(i,a,"venv",void 0,f,{profileRequested:v,bootstrapNote:"python-free-fallback"}),await U(i);let ae={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};await b.outputFile(p.join(i,"README.md"),`# ${a}
|
|
210
210
|
|
|
211
211
|
Workspai **${ae[f]}** workspace (switched from ${v} due to missing Python).
|
|
212
212
|
|
|
@@ -233,29 +233,29 @@ npx workspai dev
|
|
|
233
233
|
cd <project-name>
|
|
234
234
|
npx workspai init
|
|
235
235
|
npx workspai dev
|
|
236
|
-
`)+"```\n","utf-8"),await
|
|
236
|
+
`)+"```\n","utf-8"),await b$4(i,{workspaceName:a,silent:r}),await B(ee),n||await Q(i,$,`Initial commit: Workspai workspace (${f} profile)`),console.log(e$1.green(`
|
|
237
237
|
\u2728 Workspace created with fallback profile!
|
|
238
238
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan(`
|
|
239
239
|
\u{1F680} Get started:
|
|
240
|
-
`)),console.log(e$1.white(` ${
|
|
240
|
+
`)),console.log(e$1.white(` ${g(i)}`)),console.log(e$1.white(" npx workspai create project")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
241
241
|
`)),console.log(e$1.cyan(`\u{1F4A1} To use Python later:
|
|
242
242
|
`)),console.log(e$1.gray(" 1. Install Python 3.10+")),console.log(e$1.gray(` 2. Run: workspai bootstrap --profile ${v}
|
|
243
243
|
`)),console.log("");return}catch(ae){return $.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
244
244
|
\u274C Error:`),ae),F(ee,ae)}}}else if(console.log(e$1.yellow(`
|
|
245
245
|
\u26A0\uFE0F Python not detected. Auto-switching to "${f}" profile (no Python required).
|
|
246
|
-
`)),w=f,
|
|
246
|
+
`)),w=f,ge.has(f)){let C=c$1("Creating workspace",{component:"create",phase:"workspace.python-free"}),$=await ie(i);try{await b.ensureDir(i),C.succeed("Directory created"),await J(i,a,"venv",void 0),await X(i,a,"venv",void 0,f,{profileRequested:v,bootstrapNote:"python-free-fallback"}),await U(i),await b$4(i,{workspaceName:a,silent:r}),await B($),n||await Q(i,C,`Initial commit: Workspai workspace (${f})`),console.log(e$1.green(`
|
|
247
247
|
\u2728 Workspace created (auto-fallback profile)!
|
|
248
248
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan("\u{1F4E6} Profile:"),e$1.yellow(f)),console.log(e$1.cyan("\u{1F4A1} Reason:"),e$1.gray(`Python not detected; switched from ${v}`)),console.log(e$1.cyan(`
|
|
249
249
|
\u{1F680} Get started:
|
|
250
|
-
`)),console.log(e$1.white(` ${
|
|
250
|
+
`)),console.log(e$1.white(` ${g(i)}`)),console.log(e$1.white(" npx workspai create project")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
251
251
|
`)),console.log(e$1.cyan(`\u{1F4A1} Add Python later:
|
|
252
|
-
`)),console.log(e$1.gray(" 1. Install Python 3.10+")),console.log(e$1.gray(` 2. Run: ${
|
|
252
|
+
`)),console.log(e$1.gray(" 1. Install Python 3.10+")),console.log(e$1.gray(` 2. Run: ${g(i)} && workspai bootstrap --profile ${v}
|
|
253
253
|
`)),console.log("");return}catch(ee){return C.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
254
|
-
\u274C Error:`),ee),F($,ee)}}}}f.step(1,3,"Setting up Workspai environment");let E=c$
|
|
254
|
+
\u274C Error:`),ee),F($,ee)}}}}f$1.step(1,3,"Setting up Workspai environment");let E=c$1("Creating directory",{component:"create",phase:"workspace.directory"}),Re=await ie(i);try{await b.ensureDir(i),E.succeed("Directory created"),E.start("Detecting Python version");let k=null,_=await Qe(R.pythonVersion);if(_)k=await Ne(_),k?(f$1.info(` Detected Python ${k}`),E.succeed(`Python ${k} detected`)):E.warn("Could not detect exact Python version");else {let v=N();k=await Ne(v),k?E.succeed(`Python ${k} detected`):E.warn("Could not detect Python version, proceeding with defaults");}if(R.installMethod==="poetry"&&!await Je()&&(E.warn("Poetry not found \u2014 auto-fallback to pip + venv"),R.installMethod="venv"),await J(i,a,R.installMethod,k||void 0),k&&await dt(i,k),await X(i,a,R.installMethod,k||R.pythonVersion,w||y),await U(i),await Le(i,a),R.installMethod==="poetry")try{await Xe(i,R.pythonVersion,E,r,c,g$1);}catch(v){let f=v?.details||v?.message||String(v);if(f.includes("pyenv")||f.includes("exit status 127")||f.includes("returned non-zero exit status 127")){E.warn("Poetry encountered Python discovery issues, trying venv method"),f$1.debug(`Poetry error (attempting venv fallback): ${f}`);try{await be(i,R.pythonVersion,E,r,c),R.installMethod="venv";}catch(C){throw C}}else throw v}else R.installMethod==="venv"?await be(i,R.pythonVersion,E,r,c):await Ze(i,E,r,c,g$1);if(await pe(i,R.installMethod),await et(i,R.installMethod),E.succeed("Workspai environment ready!"),await b$4(i,{workspaceName:a,silent:r}),await B(Re),o.skipGit||await Q(i,E,"Initial commit: Workspai environment"),console.log(e$1.green(`
|
|
255
255
|
\u2728 Workspai environment created successfully!
|
|
256
256
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan("\u2699\uFE0F Configuration:")),console.log(e$1.gray(` \u2022 Profile: ${w}`)),console.log(e$1.gray(` \u2022 Python: ${R.pythonVersion}`)),console.log(e$1.gray(` \u2022 Install method: ${R.installMethod}`)),console.log(e$1.cyan(`
|
|
257
257
|
\u{1F680} Get started:
|
|
258
|
-
`)),console.log(e$1.white(` ${
|
|
258
|
+
`)),console.log(e$1.white(` ${g(i)}`)),R.installMethod==="poetry"){let v="source $(poetry env info --path)/bin/activate";try{q();let{stdout:f}=await execa("poetry",["--version"]),M=f.match(/Poetry.*?(\d+)\.(\d+)/);M&&(parseInt(M[1])>=2?v="source $(poetry env info --path)/bin/activate":v="poetry shell");}catch{}console.log(e$1.white(` ${v} # Or: poetry run rapidkit`)),console.log(e$1.white(" workspai create # Interactive mode")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" workspai init")),console.log(e$1.white(" workspai dev")),console.log(e$1.gray(`
|
|
259
259
|
\u{1F4E6} Why Poetry? Includes dependency management + virtual environment`));}else R.installMethod==="venv"?(console.log(e$1.white(" source .venv/bin/activate # On Windows: .venv\\Scripts\\activate")),console.log(e$1.white(" workspai create # Interactive mode")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" workspai init")),console.log(e$1.white(" workspai dev")),console.log(e$1.gray(`
|
|
260
260
|
\u{1F4E6} Why venv? Standard, zero extra tools, lightweight`))):(console.log(e$1.white(" workspai create # Interactive mode")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" workspai init")),console.log(e$1.white(" workspai dev")),console.log(e$1.gray(`
|
|
261
261
|
\u{1F4E6} Why pipx? Global isolated install, no local venv`)));console.log(e$1.cyan(`
|
|
@@ -263,7 +263,7 @@ npx workspai dev
|
|
|
263
263
|
\u{1F4A1} Profile management:`)),console.log(e$1.gray(" \u2022 Add Python? \u2192 workspai bootstrap --profile python-only|polyglot")),console.log(e$1.gray(" \u2022 Add Node.js? \u2192 workspai bootstrap --profile node-only|polyglot")),console.log(e$1.gray(" \u2022 Add Go? \u2192 workspai bootstrap --profile go-only|polyglot")),console.log(e$1.gray(" \u2022 Add .NET? \u2192 workspai bootstrap --profile dotnet-only|polyglot")),console.log(e$1.gray(" \u2022 Full setup? \u2192 workspai bootstrap --profile enterprise")),console.log(e$1.cyan(`
|
|
264
264
|
\u{1F4D6} Common commands:`)),console.log(e$1.white(" workspai create - Create a new project (interactive)")),console.log(e$1.white(" workspai list - List available kits")),console.log(e$1.white(" workspai modules - List available modules")),console.log(e$1.white(" workspai doctor - Check workspace health")),console.log(e$1.white(` workspai bootstrap --help - Advanced workspace configuration
|
|
265
265
|
`));try{let{stdout:v}=await execa("go",["version"],{timeout:3e3}),f=v.match(/go version go(\d+\.\d+(?:\.\d+)?)/),M=f?f[1]:"unknown";console.log(e$1.gray(`\u{1F439} Go ${M} detected \u2014 ready for gofiber.standard projects`));}catch{console.log(e$1.yellow("\u26A0\uFE0F Go not installed \u2014 needed for gofiber.standard/gogin.standard projects")),console.log(e$1.gray(" Install: https://go.dev/dl/"));}console.log("");}catch(k){return E.fail("Failed to create Workspai environment"),console.error(e$1.red(`
|
|
266
|
-
\u274C Error:`),k),F(Re,k)}}async function
|
|
266
|
+
\u274C Error:`),k),F(Re,k)}}async function Qe(t){let o=[];if(!b$5())try{let{stdout:l}=await execa("pyenv",["which","python"]),d=l.trim();d&&o.push(d);}catch{}let n=Number(t.split(".")[1]),s=k(n,10).map(l=>l.command).filter(Boolean);o.push(`python${t}`,...s,...j());let r=[...new Set(o)];for(let l of r)try{let d=l==="py"?["-3","--version"]:["--version"],g=l==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:c}=await execa(l,d,{timeout:2e3}),m=c.match(/Python (\d+\.\d+)/)?.[1];if(m&&Z(m,t))return await execa(l,g,{timeout:2e3}),l}catch{continue}return null}async function Xe(t,o,n,s,r,l=false){await ht(n,l),n.start("Finding Python interpreter");let d=await Qe(o);d?(f$1.debug(`Found working Python: ${d}`),n.succeed("Python found")):n.warn("Could not verify Python path, proceeding with default"),n.start("Initializing Poetry project");let g=p.join(t,"pyproject.toml"),m$1=(await b.pathExists(g)?await promises.readFile(g,"utf-8"):"").includes("rapidkit-core");if(m$1)n.succeed("Poetry project initialized");else {await execa("poetry",["init","--no-interaction","--python",`^${o}`],{cwd:t}),n.succeed("Poetry project initialized");let i=await promises.readFile(g,"utf-8");i.includes("[tool.poetry]")?i=i.replace("[tool.poetry]",`[tool.poetry]
|
|
267
267
|
package-mode = false`):i.includes("[project]")&&(i.includes("[build-system]")?i=i.replace("[build-system]",`
|
|
268
268
|
[tool.poetry]
|
|
269
269
|
package-mode = false
|
|
@@ -272,33 +272,33 @@ package-mode = false
|
|
|
272
272
|
|
|
273
273
|
[tool.poetry]
|
|
274
274
|
package-mode = false
|
|
275
|
-
`),await promises.writeFile(
|
|
275
|
+
`),await promises.writeFile(g,i,"utf-8");}n.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:t}),n.succeed("Poetry configured");}catch{n.warn("Could not configure Poetry virtualenvs.in-project");}n.start("Creating virtualenv");let y=d||N(),h=m(p.join(t,".venv"));try{await execa(y,["-m","venv",".venv"],{cwd:t,timeout:6e4}),n.succeed("Virtualenv created");}catch(a){f$1.debug(`python -m venv failed: ${a}`),n.warn("Could not pre-create virtualenv, Poetry will try"),h=d||N();}try{await execa("poetry",["env","use",h||N()],{cwd:t}),f$1.debug(`Poetry env set to: ${h}`);}catch(a){f$1.debug(`Could not set Poetry env: ${a}`);}if(n.start("Installing RapidKit"),m$1&&!s){let a=e$2(r||{}),i=a?await b.pathExists(a):false,x=i&&a?a:"rapidkit-core";a&&!i&&f$1.warn(`WORKSPAI_DEV_PATH/RAPIDKIT_DEV_PATH points to a path that does not exist: ${a}. Falling back to PyPI.`),n.text=i?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let w=false,A=null;for(let I=1;I<=3;I++)try{i||e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:I,maxAttempts:3}),await execa(h,["-m","pip","install",x,"--quiet"],{cwd:t,timeout:18e4}),w=true,i||e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:I,maxAttempts:3});break}catch(L){A=L,f$1.debug(`pip install rapidkit-core attempt ${I} failed: ${L}`),I<3&&(n.text=`Retrying installation (attempt ${I+1}/3)`,await new Promise(ue=>setTimeout(ue,2e3)));}if(!w){let I=A?.stderr||A?.message||"Unknown error";throw f$1.debug(`All pip install attempts failed. Last error: ${I}`),I.includes("Could not find")||I.includes("No matching distribution")?new g$1:new f$2("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
276
276
|
Error: ${I}
|
|
277
277
|
|
|
278
278
|
Possible solutions:
|
|
279
279
|
1. Check your internet connection
|
|
280
280
|
2. Try installing manually: cd ${p.basename(t)} && poetry add rapidkit-core
|
|
281
|
-
3. Use venv method instead: npx workspai ${p.basename(t)} --install-method=venv`))}}else {n.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:t,timeout:12e4}),n.succeed("Poetry environment synced");}catch(
|
|
281
|
+
3. Use venv method instead: npx workspai ${p.basename(t)} --install-method=venv`))}}else {n.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:t,timeout:12e4}),n.succeed("Poetry environment synced");}catch(a){f$1.debug(`poetry install --no-root failed: ${a}`),n.warn("Could not sync Poetry environment, proceeding with add command");}if(n.start("Installing RapidKit"),s){let a=e$2(r||{});if(!a)throw new f$2("Test mode installation",new Error("No local RapidKit path configured. Set WORKSPAI_DEV_PATH (or legacy RAPIDKIT_DEV_PATH)."));f$1.debug(`Installing from local path: ${a}`),n.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",a],{cwd:t});}else {n.text="Installing RapidKit from PyPI";let a=false,i=null;for(let x=1;x<=3;x++)try{e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:x,maxAttempts:3}),await execa("poetry",["add","rapidkit-core"],{cwd:t,timeout:6e4*x}),a=true,e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:x,maxAttempts:3});break}catch(w){i=w,f$1.debug(`Poetry add attempt ${x} failed: ${w}`),x<3&&(n.text=`Retrying installation (attempt ${x+1}/3)`,await new Promise(A=>setTimeout(A,2e3)));}if(!a){let x=i?.stderr||i?.message||"Unknown error";throw f$1.debug(`All Poetry install attempts failed. Last error: ${x}`),x.includes("Could not find")||x.includes("No matching distribution")?new g$1:new f$2("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
282
282
|
Error: ${x}
|
|
283
283
|
|
|
284
284
|
Possible solutions:
|
|
285
285
|
1. Check your internet connection
|
|
286
286
|
2. Try installing manually: cd ${p.basename(t)} && poetry add rapidkit-core
|
|
287
|
-
3. Use venv method instead: npx workspai ${p.basename(t)} --install-method=venv`))}}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:
|
|
287
|
+
3. Use venv method instead: npx workspai ${p.basename(t)} --install-method=venv`))}}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:a}=await import('./pythonRapidkitExec-YR7P5LWG.js');if(!await a()&&!s){n.start("Checking optional global pipx installation");let x=await de(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await Y(x,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(w){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),f$1.debug(`pipx install failed: ${w}`);}}}catch(a){n.succeed("Skipped optional global pipx installation"),f$1.debug(`Global install check skipped: ${a}`);}}async function be(t,o,n,s,r,l=false){n.start(`Checking Python ${o}`);let d=N();try{let{stdout:c}=await execa(d,["--version"]),m=c.match(/Python (\d+\.\d+)/)?.[1];if(m&&!Z(m,o))throw new b$6(o,m);n.succeed(`Python ${m} found`);}catch(c){throw c instanceof b$6?c:new b$6(o)}n.start("Creating virtual environment");try{await execa(d,["-m","venv",".venv"],{cwd:t}),n.succeed("Virtual environment created");}catch(c){if(n.fail("Failed to create virtual environment"),(y=>typeof y=="object"&&y!==null&&"stdout"in y&&typeof y.stdout=="string")(c)&&c.stdout.includes("ensurepip is not")){let y=c.stdout.match(/apt install (python[\d.]+-venv)/),h=y?y[1]:"python3-venv";throw new f$2("Python venv module not available",new Error(`Virtual environment creation failed.
|
|
288
288
|
|
|
289
289
|
On Debian/Ubuntu systems, install the venv package:
|
|
290
|
-
sudo apt install ${
|
|
290
|
+
sudo apt install ${h}
|
|
291
291
|
|
|
292
292
|
Or use Poetry instead (recommended):
|
|
293
|
-
npx workspai create workspace ${p.basename(t)} --yes --install-method poetry`))}throw new f$2("Virtual environment creation",c instanceof Error?c:new Error(String(c)))}n.start("Installing RapidKit");let
|
|
294
|
-
Error: ${
|
|
293
|
+
npx workspai create workspace ${p.basename(t)} --yes --install-method poetry`))}throw new f$2("Virtual environment creation",c instanceof Error?c:new Error(String(c)))}n.start("Installing RapidKit");let g=m(p.join(t,".venv"));if(await execa(g,["-m","pip","install","--upgrade","pip"],{cwd:t}),s){let c=e$2(r||{});if(!c)throw new f$2("Test mode installation",new Error("No local RapidKit path configured. Set WORKSPAI_DEV_PATH (or legacy RAPIDKIT_DEV_PATH)."));f$1.debug(`Installing from local path: ${c}`),n.text="Installing RapidKit from local path (test mode)",await execa(g,["-m","pip","install","-e",c],{cwd:t});}else {n.text="Installing RapidKit from PyPI";let c=false,m$1=null;for(let y=1;y<=3;y++)try{e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"venv",attempt:y,maxAttempts:3}),await execa(g,["-m","pip","install","rapidkit-core"],{cwd:t,timeout:6e4*y}),c=true,e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"venv",attempt:y,maxAttempts:3});break}catch(h){m$1=h,f$1.debug(`pip install attempt ${y} failed: ${h}`),y<3&&(n.text=`Retrying installation (attempt ${y+1}/3)`,await new Promise(a=>setTimeout(a,2e3)));}if(!c){let y=m$1?.stderr||m$1?.message||"Unknown error";throw f$1.debug(`All pip install attempts failed. Last error: ${y}`),y.includes("Could not find")||y.includes("No matching distribution")?new g$1:new f$2("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
294
|
+
Error: ${y}
|
|
295
295
|
|
|
296
296
|
Possible solutions:
|
|
297
297
|
1. Check your internet connection
|
|
298
|
-
2. Try installing manually: cd ${p.basename(t)} && ${
|
|
299
|
-
3. Use Poetry instead: npx workspai ${p.basename(t)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:c}=await import('./pythonRapidkitExec-
|
|
300
|
-
`,"utf-8");return}
|
|
301
|
-
`,"utf-8");}async function
|
|
298
|
+
2. Try installing manually: cd ${p.basename(t)} && ${m(".venv")} -m pip install rapidkit-core
|
|
299
|
+
3. Use Poetry instead: npx workspai ${p.basename(t)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:c}=await import('./pythonRapidkitExec-YR7P5LWG.js');if(!await c()&&!s){n.start("Checking optional global pipx installation");let y=await de(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await Y(y,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(h){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),f$1.debug(`pipx install failed: ${h}`);}}}catch(c){n.succeed("Skipped optional global pipx installation"),f$1.debug(`Global install check skipped: ${c}`);}}async function Ze(t,o,n,s,r=false){if(!n)try{let{checkRapidkitCoreVersionCompatible:d}=await import('./pythonRapidkitExec-YR7P5LWG.js'),g=await d();if(g.isCompatible){o.succeed(`RapidKit ${g.installedVersion??""} already compatible globally; skipping pipx installation`),await b.outputFile(p.join(t,".rapidkit-global"),`RapidKit already available globally (version ${g.installedVersion??"unknown"}) and satisfies expected constraint ${g.expectedConstraint??"n/a"}; workspace will reuse the existing installation
|
|
300
|
+
`,"utf-8");return}g.reason==="constraint-missing"?o.warn('Version-aware global reuse skipped: no explicit rapidkit-core version constraint found. Set RAPIDKIT_CORE_PYTHON_PACKAGE (example: RAPIDKIT_CORE_PYTHON_PACKAGE="rapidkit-core>=0.4.0,<0.9.0") to enable version-aware reuse. Proceeding with pipx install/upgrade.'):g.reason==="constraint-unsupported"&&o.warn('Version-aware global reuse skipped: RAPIDKIT_CORE_PYTHON_PACKAGE uses an unsupported spec (path/url/git). Use a version range instead (example: RAPIDKIT_CORE_PYTHON_PACKAGE="rapidkit-core==0.4.0" or "rapidkit-core>=0.4.0,<0.9.0"). Proceeding with pipx install/upgrade.'),f$1.debug(`Global RapidKit install is not reusable via version-aware policy (reason=${g.reason}, installed=${g.installedVersion??"unknown"}, expected=${g.expectedConstraint??"none"}). Proceeding with pipx install/upgrade.`);}catch(d){f$1.debug(`Global RapidKit version-aware check failed before pipx install: ${d}`);}let l=await de(o,r);if(o.start("Installing RapidKit globally with pipx"),n){let d=e$2(s||{});if(!d)throw new f$2("Test mode installation",new Error("No local RapidKit path configured. Set WORKSPAI_DEV_PATH (or legacy RAPIDKIT_DEV_PATH)."));f$1.debug(`Installing from local path: ${d}`),o.text="Installing RapidKit from local path (test mode)",await Y(l,["install","-e",d]);}else {o.text="Installing RapidKit from PyPI",e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"pipx"});try{await Y(l,["install","rapidkit-core"]),e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"pipx"});}catch(d){try{o.text="RapidKit already installed globally, upgrading to match expected version",await Y(l,["upgrade","rapidkit-core"]),e$3({status:"succeeded",message:"RapidKit upgraded from PyPI",installMethod:"pipx"});}catch(g){throw f$1.debug(`pipx install/upgrade failed: install=${d}, upgrade=${g}`),new g$1}}}o.succeed("RapidKit installed globally"),await b.outputFile(p.join(t,".rapidkit-global"),`RapidKit installed globally with pipx
|
|
301
|
+
`,"utf-8");}async function qt(t,o){let{skipGit:n=false,installPythonEngine:s=false,testMode:r=false,userConfig:l={},yes:d=false,installMethod:g,pythonVersion:c="3.10"}=o||{},m="venv";if(s){let a=g||l.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return f$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();m=a==="poetry"&&!await Je()?"venv":a;}let y=c$1("Registering workspace",{component:"create",phase:"workspace.register"}),h=await lt(t);try{let a=p.basename(t),i=s?void 0:{bootstrapNote:"python-engine-skipped",pythonEngine:"skipped",pythonEngineReason:"project-workspace-foundation"};await J(t,a,m,s?c:void 0,i),await U(t),await X(t,a,m,s?c:void 0,o?.profile??"minimal",i),s?m==="poetry"?(await Le(t,a),await Xe(t,c,y,r,l,d)):m==="venv"?await be(t,c,y,r,l):await Ze(t,y,r,l,d):await pe(t,m,{pythonEngineSkipped:true}),s&&(await pe(t,m),await et(t,m)),y.succeed(s?"Workspace registered":"Workspace registered (Python engine skipped)"),await b$4(t,{workspaceName:p.basename(t),silent:r}),await B(h),n||await Q(t,y,"Initial commit: Workspai workspace");}catch(a){return y.fail("Failed to register workspace"),F(h,a)}}async function et(t,o){let n=o==="poetry"?`source $(poetry env info --path)/bin/activate
|
|
302
302
|
# Or simply use: poetry run rapidkit <command>`:o==="venv"?"source .venv/bin/activate # On Windows: .venv\\Scripts\\activate":"N/A (globally installed)",s=o==="poetry"?`# No activation needed (recommended):
|
|
303
303
|
./rapidkit --help
|
|
304
304
|
# or:
|
|
@@ -307,7 +307,7 @@ poetry run rapidkit --help`:o==="venv"?`# No activation needed (recommended):
|
|
|
307
307
|
# or direct:
|
|
308
308
|
./.venv/bin/rapidkit --help`:`# Optional: use the local launcher
|
|
309
309
|
./rapidkit --help
|
|
310
|
-
# (pipx installs may require Poetry/venv to be present in this folder)`,
|
|
310
|
+
# (pipx installs may require Poetry/venv to be present in this folder)`,r=b$5()?"python --version (or: py -3 --version)":"python3 --version (or: python --version)",l=`# Workspai Workspace
|
|
311
311
|
|
|
312
312
|
This directory contains a Workspai development environment.
|
|
313
313
|
|
|
@@ -415,11 +415,11 @@ README.md # This file
|
|
|
415
415
|
|
|
416
416
|
If you encounter issues:
|
|
417
417
|
|
|
418
|
-
1. Ensure Python 3.10+ is installed: \`${
|
|
418
|
+
1. Ensure Python 3.10+ is installed: \`${r}\`
|
|
419
419
|
2. Check Workspai installation: \`workspai --version\`
|
|
420
420
|
3. Run diagnostics: \`workspai doctor\`
|
|
421
421
|
4. Visit Workspai documentation or GitHub issues
|
|
422
|
-
`;await promises.writeFile(p.join(t,"README.md"),l,"utf-8");}async function
|
|
422
|
+
`;await promises.writeFile(p.join(t,"README.md"),l,"utf-8");}async function kt(t,o,n){let s=c$1("Creating demo workspace",{component:"create",phase:"workspace.demo"});try{await b.ensureDir(t),s.succeed("Directory created"),s.start("Setting up demo kit generator");let r=JSON.stringify({name:`${o}-workspace`,version:"1.0.0",private:true,description:"Workspai demo workspace",scripts:{generate:"node generate-demo.js"}},null,2);await promises.writeFile(p.join(t,"package.json"),r,"utf-8"),await promises.writeFile(p.join(t,"generate-demo.js"),`#!/usr/bin/env node
|
|
423
423
|
/**
|
|
424
424
|
* Demo Kit Generator - Create FastAPI demo projects
|
|
425
425
|
*
|
|
@@ -903,8 +903,8 @@ ${o}/
|
|
|
903
903
|
|
|
904
904
|
---
|
|
905
905
|
|
|
906
|
-
**Generated with Workspai** | [GitHub](https://github.com/
|
|
907
|
-
`;if(await promises.writeFile(p.join(t,"README.md"),d,"utf-8"),s.succeed("Demo workspace setup complete"),!n)if(await
|
|
906
|
+
**Generated with Workspai** | [GitHub](https://github.com/chistiq/workspai)
|
|
907
|
+
`;if(await promises.writeFile(p.join(t,"README.md"),d,"utf-8"),s.succeed("Demo workspace setup complete"),!n)if(await Fe(t))s.warn("Git initialization skipped because target is already inside a git worktree");else {s.start("Initializing git repository");try{await execa("git",["init"],{cwd:t,env:a$1()}),await b.outputFile(p.join(t,".gitignore"),`# Dependencies
|
|
908
908
|
node_modules/
|
|
909
909
|
|
|
910
910
|
# Generated projects
|
|
@@ -920,14 +920,14 @@ __pycache__/
|
|
|
920
920
|
`,"utf-8"),await execa("git",["add","."],{cwd:t,env:a$1()}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:t,env:a$1()}),s.succeed("Git repository initialized");}catch{s.warn("Could not initialize git repository");}}console.log(e$1.green(`
|
|
921
921
|
\u2728 Demo workspace created successfully!
|
|
922
922
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(t)),console.log(e$1.cyan(`\u{1F680} Get started:
|
|
923
|
-
`)),console.log(e$1.white(` ${
|
|
923
|
+
`)),console.log(e$1.white(` ${g(t)}`)),console.log(e$1.white(" node generate-demo.js my-api")),console.log(e$1.white(" cd my-api")),console.log(e$1.white(" workspai init")),console.log(e$1.white(" workspai dev")),console.log(),console.log(e$1.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For Python engine features:"),console.log(e$1.cyan(" pipx install rapidkit-core")),console.log();}catch(r){throw s.fail("Failed to create demo workspace"),r}}async function vt(t,o,n,s,r,l,d,g$1=false,c=false){if(console.log(e$1.cyan(`
|
|
924
924
|
\u{1F50D} Dry-run mode - what would be created:
|
|
925
925
|
`)),console.log(e$1.white("\u{1F4C2} Workspace path:"),t),console.log(e$1.white("\u{1F4DB} Name:"),e$1.cyan(o)),n)console.log(e$1.white("\u{1F4E6} Type:"),"Demo environment"),console.log(e$1.white(`
|
|
926
926
|
\u{1F4DD} Files to create:`)),console.log(e$1.gray(" - package.json")),console.log(e$1.gray(" - generate-demo.js (project generator)")),console.log(e$1.gray(" - README.md")),console.log(e$1.gray(" - .gitignore")),console.log(e$1.white(`
|
|
927
|
-
\u{1F3AF} Capabilities:`)),console.log(e$1.gray(" - Generate FastAPI/NestJS demo projects")),console.log(e$1.gray(" - No Python RapidKit installation required")),console.log(e$1.gray(" - Bundled templates"));else {let
|
|
928
|
-
\u{1F4CB} Files to create:`)),console.log(e$1.gray(" - .workspai-workspace (workspace marker)")),console.log(e$1.gray(" - .workspai/ (workspace config directory)")),console.log(e$1.gray(" - README.md")),console.log(e$1.gray(" - .gitignore")),i&&!c&&console.log(e$1.gray(` - ${
|
|
929
|
-
\u2699\uFE0F Environment setup:`)),i&&c?console.log(e$1.gray(" - Python engine setup skipped")):i&&console.log(
|
|
930
|
-
\u{1F680} Next steps:`)),console.log(e$1.gray(` 1. ${
|
|
927
|
+
\u{1F3AF} Capabilities:`)),console.log(e$1.gray(" - Generate FastAPI/NestJS demo projects")),console.log(e$1.gray(" - No Python RapidKit installation required")),console.log(e$1.gray(" - Bundled templates"));else {let m=r||"minimal",y=l,h=d,i=new Set(["python-only","polyglot","enterprise"]).has(m);console.log(e$1.white("\u{1F4E6} Profile:"),e$1.cyan(m)),console.log(e$1.white("\u{1F4DD} Configuration:")),i?(console.log(e$1.gray(` - Python version: ${h}`)),console.log(e$1.gray(` - Python engine: ${c?"Skipped":`Install with ${y}`}`)),console.log(e$1.gray(` - Git init: ${g$1?"No":"Yes"}`))):(console.log(e$1.gray(" - Python-free profile (no Python needed)")),console.log(e$1.gray(` - Git init: ${g$1?"No":"Yes"}`))),console.log(e$1.white(`
|
|
928
|
+
\u{1F4CB} Files to create:`)),console.log(e$1.gray(" - .workspai-workspace (workspace marker)")),console.log(e$1.gray(" - .workspai/ (workspace config directory)")),console.log(e$1.gray(" - README.md")),console.log(e$1.gray(" - .gitignore")),i&&!c&&console.log(e$1.gray(` - ${y==="poetry"?"pyproject.toml + poetry.lock":".venv/ (virtual environment)"}`)),console.log(e$1.white(`
|
|
929
|
+
\u2699\uFE0F Environment setup:`)),i&&c?console.log(e$1.gray(" - Python engine setup skipped")):i&&console.log(y==="poetry"?e$1.gray(" - Poetry virtual environment created (recommended, includes dependency management)"):y==="venv"?e$1.gray(" - Python venv created in .venv/ (standard, zero extra tools)"):e$1.gray(" - Global pipx install (isolated, not local to workspace)")),console.log(e$1.white(`
|
|
930
|
+
\u{1F680} Next steps:`)),console.log(e$1.gray(` 1. ${g(t)}`)),console.log(e$1.gray(" 2. npx workspai create project")),console.log(e$1.gray(" 3. npx workspai init")),console.log(e$1.gray(" 4. npx workspai dev")),console.log(e$1.white(`
|
|
931
931
|
\u{1F4A1} Learn more:`)),console.log(e$1.gray(" \u2022 Change profile later: workspai bootstrap --profile <profile>")),console.log(e$1.gray(" \u2022 Profile options: minimal|java-only|python-only|node-only|go-only|dotnet-only|polyglot|enterprise")),console.log(e$1.gray(" \u2022 Help: npx workspai --help"));}console.log(e$1.white(`
|
|
932
932
|
\u2728 To proceed: remove --dry-run flag
|
|
933
|
-
`));}export{
|
|
933
|
+
`));}export{Ve as a,Ut as b,ze as c,pt as d,pe as e,Yt as f,qt as g};
|