workspai 0.43.0 → 0.44.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 +26 -13
- package/contracts/agent-customization-pack.v1.json +1 -1
- package/contracts/autopilot-release.v1.json +204 -0
- package/contracts/cli-operation-result.v1.json +119 -0
- package/contracts/command-capabilities.v1.json +138 -0
- package/contracts/compatibility-matrix.v1.json +37 -0
- package/contracts/create-planner-capabilities.v1.json +156 -65
- package/contracts/doctor-project-scan.v2.json +60 -0
- package/contracts/doctor-remediation-plan.v1.json +19 -4
- package/contracts/doctor-remediation-plan.v2.json +7 -0
- package/contracts/doctor-workspace-cache.v2.json +82 -0
- package/contracts/extension-cli-compatibility.v1.json +47 -3
- package/contracts/infra-plan.v1.json +189 -0
- package/contracts/private-product-manifest.v1.json +155 -0
- package/contracts/product-factory-plan.v1.json +200 -0
- package/contracts/project-archive.v1.json +40 -0
- package/contracts/project-entry-capability.v1.json +127 -0
- package/contracts/published-contract-catalog.v1.json +334 -0
- package/contracts/runtime-command-surface.v1.json +239 -10
- package/contracts/version.v1.json +48 -0
- package/contracts/workspace-archive-capabilities.v1.json +90 -0
- package/contracts/workspace-archive-manifest.v1.json +107 -0
- package/contracts/workspace-archive-operation-result.v1.json +565 -0
- package/contracts/workspace-intelligence/agent-customization-pack-report.v1.json +98 -0
- package/contracts/workspace-intelligence/agent-hooks.v1.json +38 -0
- package/contracts/workspace-intelligence/agent-reports-index.v1.json +56 -0
- package/contracts/workspace-intelligence/mcp-design.v1.json +42 -0
- package/contracts/workspace-intelligence/workspace-context.v1.json +12 -0
- package/contracts/workspace-intelligence/workspace-explain.v1.json +1 -0
- package/contracts/workspace-intelligence-architecture.v1.json +723 -0
- package/contracts/workspace-intelligence-chain.v1.json +1194 -0
- package/contracts/workspace-list.v1.json +56 -0
- package/contracts/workspace-model-cache.v1.json +55 -0
- package/contracts/workspace-snapshot.v1.json +58 -0
- package/contracts/workspace-snapshot.v2.json +97 -0
- package/contracts/workspace-sync.v1.json +30 -0
- package/contracts/workspace-watch-event.v1.json +112 -0
- package/dist/analyze-6OCBM4ID.js +1 -0
- package/dist/{artifact-remediation-plan-5GJWPPRS.js → artifact-remediation-plan-Z7OCSME3.js} +3 -3
- package/dist/autopilot-release-LI2WJCEW.js +1 -0
- package/dist/{chunk-LZQNVH7D.js → chunk-2K3GYCPS.js} +1 -1
- package/dist/chunk-2QN6BMM7.js +2 -0
- package/dist/chunk-2QOWRBQD.js +1 -0
- package/dist/chunk-5AKYMAIL.js +1 -0
- package/dist/{chunk-RE773WOX.js → chunk-5PVEQ6CZ.js} +5 -5
- package/dist/{chunk-AFSZHLQT.js → chunk-7EIMPQR3.js} +1 -1
- package/dist/{chunk-3KXW53QI.js → chunk-7IHLTPZ6.js} +1 -1
- package/dist/chunk-7RIWU5TZ.js +1 -0
- package/dist/{chunk-T6OR6YOI.js → chunk-7UZVOYF5.js} +1 -1
- package/dist/chunk-B66A4TVP.js +1 -0
- package/dist/chunk-CL6TGI4Q.js +8 -0
- package/dist/chunk-FWJV7CCI.js +2 -0
- package/dist/chunk-J4AICQFB.js +1 -0
- package/dist/chunk-JICOD2GI.js +1 -0
- package/dist/{chunk-OJEWQO3Z.js → chunk-JP25YL3J.js} +17 -17
- package/dist/chunk-L2Q7B2OJ.js +1 -0
- package/dist/chunk-L3E6IRUQ.js +8 -0
- package/dist/chunk-LG6RFLPZ.js +1 -0
- package/dist/chunk-LGP6WXS2.js +4 -0
- package/dist/{chunk-VRDF2J46.js → chunk-M4VITK6X.js} +52 -50
- package/dist/chunk-NTXO7BMH.js +4 -0
- package/dist/{chunk-LPZFK3Y6.js → chunk-OW4UNG27.js} +65 -66
- package/dist/{chunk-LUP4U6EE.js → chunk-P424XYHP.js} +1 -1
- package/dist/chunk-P4SWTY5X.js +33 -0
- package/dist/chunk-TQEMLBAG.js +1 -0
- package/dist/chunk-TRMDODFM.js +13 -0
- package/dist/chunk-UNF72FTB.js +1 -0
- package/dist/chunk-V5JN4TDX.js +2 -0
- package/dist/chunk-VA5MRHKM.js +2 -0
- package/dist/chunk-XIVFLY6G.js +1 -0
- package/dist/chunk-YUX4YFGL.js +78 -0
- package/dist/{create-WRZO4HK2.js → create-DFAWAS5C.js} +1 -1
- package/dist/demo-kit-DZ7TPG7K.js +149 -0
- package/dist/doctor-PVSWDBJL.js +1 -0
- package/dist/{dotnet-webapi-clean-IPY3MCGQ.js → dotnet-webapi-clean-BYUUHX5Y.js} +20 -20
- package/dist/{gofiber-standard-N5N3QGH3.js → gofiber-standard-B6UK5GR7.js} +31 -31
- package/dist/{gogin-standard-LAWQTBWL.js → gogin-standard-BXU44VEM.js} +31 -31
- package/dist/index.d.ts +250 -24
- package/dist/index.js +218 -182
- package/dist/pipeline-ND734AJM.js +5 -0
- package/dist/{platform-capabilities-XAVU4HSM.js → platform-capabilities-YICBF4FA.js} +1 -1
- package/dist/{pythonRapidkitExec-3L3XJBSY.js → pythonRapidkitExec-UJYIB6FL.js} +1 -1
- package/dist/{springboot-standard-OZYF7ZM7.js → springboot-standard-PEHDKH2L.js} +27 -27
- package/dist/{workspace-PR6VZRBG.js → workspace-FQT3QIRS.js} +1 -1
- package/dist/workspace-agent-sync-ZYCPXTU3.js +1 -0
- package/dist/workspace-archive-EEGLHZDW.js +10 -0
- package/dist/workspace-context-WAGGJCDL.js +1 -0
- package/dist/{workspace-contract-XUGMCUSQ.js → workspace-contract-SEI4SNSG.js} +1 -1
- package/dist/workspace-explain-MVGGRCDN.js +1 -0
- package/dist/workspace-explain-contract-KT757JGQ.js +1 -0
- package/dist/{workspace-feedback-R6H4UFZB.js → workspace-feedback-RCB25NFO.js} +1 -1
- package/dist/{workspace-foundation-KGSV4E6D.js → workspace-foundation-KXDL6P6X.js} +1 -1
- package/dist/{workspace-history-CGCK2DJI.js → workspace-history-M4QQBIPB.js} +1 -1
- package/dist/workspace-intelligence-QOGD2TZS.js +1 -0
- package/dist/workspace-mcp-serve-CEFKEMYG.js +3 -0
- package/dist/{workspace-model-PNXXOGPO.js → workspace-model-GMSRBICO.js} +1 -1
- package/dist/workspace-registry-summary-S52SEJAG.js +1 -0
- package/dist/workspace-run-VC4OUPRF.js +1 -0
- package/dist/{workspace-verify-WSDUUTR5.js → workspace-verify-NP4GMFSV.js} +1 -1
- package/dist/workspace-watch-IIBH3Y25.js +1 -0
- package/docs/AI_FEATURES.md +67 -34
- package/docs/README.md +2 -1
- package/docs/commands-reference.md +26 -14
- package/docs/contracts/ARTIFACT_CATALOG.md +60 -36
- package/docs/contracts/README.md +3 -2
- package/docs/create-planner-capabilities.md +36 -18
- package/docs/workspace-operations.md +25 -0
- package/package.json +35 -13
- package/scripts/enterprise-package-smoke.mjs +40 -8
- package/scripts/prepack-enterprise.mjs +8 -0
- package/templates/kits/fastapi-ddd/.gitignore.j2 +11 -0
- package/templates/kits/fastapi-ddd/README.md.j2 +23 -18
- package/templates/kits/fastapi-ddd/common/env.example.j2 +2 -2
- package/templates/kits/fastapi-ddd/pyproject.toml.j2 +7 -7
- package/templates/kits/fastapi-ddd/src/app/config/__init__.py.j2 +1 -1
- package/templates/kits/fastapi-ddd/src/cli.py.j2 +6 -9
- package/templates/kits/fastapi-ddd/src/main.py.j2 +1 -1
- package/templates/kits/fastapi-standard/.gitignore.j2 +11 -0
- package/templates/kits/fastapi-standard/README.md.j2 +35 -30
- package/templates/kits/fastapi-standard/common/env.example.j2 +2 -2
- package/templates/kits/fastapi-standard/pyproject.toml.j2 +7 -7
- package/templates/kits/fastapi-standard/src/cli.py.j2 +7 -10
- package/templates/kits/fastapi-standard/src/main.py.j2 +1 -1
- package/templates/kits/fastapi-standard/src/routing/examples.py.j2 +1 -1
- package/templates/kits/fastapi-standard/tests/test_examples.py.j2 +1 -1
- package/templates/kits/nestjs-standard/.dockerignore.j2 +11 -0
- package/templates/kits/nestjs-standard/.eslintrc.js.j2 +25 -0
- package/templates/kits/nestjs-standard/.gitignore.j2 +22 -0
- package/templates/kits/nestjs-standard/.node-version.j2 +1 -0
- package/templates/kits/nestjs-standard/.nvmrc.j2 +1 -0
- package/templates/kits/nestjs-standard/.prettierrc.j2 +7 -0
- package/templates/kits/nestjs-standard/README.md.j2 +23 -18
- package/templates/kits/nestjs-standard/docs/README.md.j2 +2 -2
- package/templates/kits/nestjs-standard/jest.config.ts.j2 +1 -7
- package/templates/kits/nestjs-standard/package.json.j2 +1 -1
- package/templates/kits/nestjs-standard/src/config/configuration.ts.j2 +4 -4
- package/templates/kits/nestjs-standard/src/main.ts.j2 +1 -1
- package/templates/kits/nestjs-standard/src/modules/index.ts.j2 +1 -1
- package/templates/kits/nestjs-standard/tsconfig.build.json.j2 +1 -1
- package/templates/kits/nestjs-standard/tsconfig.json.j2 +1 -1
- package/dist/analyze-5BU4QIPK.js +0 -1
- package/dist/autopilot-release-QYUOVB26.js +0 -1
- package/dist/chunk-54XJNLYC.js +0 -13
- package/dist/chunk-5SWNSJGW.js +0 -1
- package/dist/chunk-753LOKFZ.js +0 -2
- package/dist/chunk-AAKUNWPR.js +0 -78
- package/dist/chunk-AQ4XZZC6.js +0 -1
- package/dist/chunk-CVTCPPEF.js +0 -1
- package/dist/chunk-DNAY5ALC.js +0 -1
- package/dist/chunk-EWYYLJQY.js +0 -2
- package/dist/chunk-LO4C4VXR.js +0 -4
- package/dist/chunk-LYC6AIF2.js +0 -2
- package/dist/chunk-NAAQMSO3.js +0 -1
- package/dist/chunk-NFUXULIF.js +0 -1
- package/dist/chunk-OL64GWQC.js +0 -9
- package/dist/chunk-PI5KUXDA.js +0 -7
- package/dist/chunk-SI3AQKIP.js +0 -1
- package/dist/chunk-VZKSNUEE.js +0 -2
- package/dist/chunk-WU4ZRRA5.js +0 -4
- package/dist/chunk-XEJD4KCV.js +0 -33
- package/dist/demo-kit-AJ5LIM5G.js +0 -149
- package/dist/doctor-MF3M3FS3.js +0 -1
- package/dist/pipeline-QCUHFWDY.js +0 -5
- package/dist/workspace-agent-sync-KTYF3HQR.js +0 -1
- package/dist/workspace-archive-GCZNI44O.js +0 -3
- package/dist/workspace-context-QUTOP2XV.js +0 -1
- package/dist/workspace-explain-JEONEGZZ.js +0 -1
- package/dist/workspace-explain-contract-DNS2YEL7.js +0 -1
- package/dist/workspace-intelligence-QJGVL37U.js +0 -1
- package/dist/workspace-mcp-serve-AK4MYEHQ.js +0 -3
- package/dist/workspace-registry-summary-RUJE6RPH.js +0 -1
- package/dist/workspace-run-Y7YMUIHX.js +0 -1
- package/dist/workspace-watch-AGPOJ74Q.js +0 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": [
|
|
5
|
+
"schemaVersion",
|
|
6
|
+
"registryPath",
|
|
7
|
+
"workspaces",
|
|
8
|
+
"summary"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"schemaVersion": {
|
|
12
|
+
"const": "rapidkit-workspace-list-v1"
|
|
13
|
+
},
|
|
14
|
+
"registryPath": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"minLength": 1
|
|
17
|
+
},
|
|
18
|
+
"workspaces": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"items": {
|
|
21
|
+
"type": "object"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"summary": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"required": [
|
|
27
|
+
"total",
|
|
28
|
+
"missing",
|
|
29
|
+
"registryExists",
|
|
30
|
+
"registryValid",
|
|
31
|
+
"cleanupApplied"
|
|
32
|
+
],
|
|
33
|
+
"properties": {
|
|
34
|
+
"total": {
|
|
35
|
+
"type": "integer",
|
|
36
|
+
"minimum": 0
|
|
37
|
+
},
|
|
38
|
+
"missing": {
|
|
39
|
+
"type": "integer",
|
|
40
|
+
"minimum": 0
|
|
41
|
+
},
|
|
42
|
+
"registryExists": {
|
|
43
|
+
"type": "boolean"
|
|
44
|
+
},
|
|
45
|
+
"registryValid": {
|
|
46
|
+
"type": "boolean"
|
|
47
|
+
},
|
|
48
|
+
"cleanupApplied": {
|
|
49
|
+
"type": "boolean"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"additionalProperties": false
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"additionalProperties": true
|
|
56
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": [
|
|
5
|
+
"schemaVersion",
|
|
6
|
+
"cliVersion",
|
|
7
|
+
"inputsHash",
|
|
8
|
+
"generatedAt",
|
|
9
|
+
"model"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"schemaVersion": {
|
|
13
|
+
"const": "workspace-model-cache.v1"
|
|
14
|
+
},
|
|
15
|
+
"cliVersion": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"minLength": 1
|
|
18
|
+
},
|
|
19
|
+
"inputsHash": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
22
|
+
},
|
|
23
|
+
"generatedAt": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"format": "date-time"
|
|
26
|
+
},
|
|
27
|
+
"model": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": [
|
|
30
|
+
"schemaVersion"
|
|
31
|
+
],
|
|
32
|
+
"properties": {
|
|
33
|
+
"schemaVersion": {
|
|
34
|
+
"const": "workspace-model.v1"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"additionalProperties": true
|
|
38
|
+
},
|
|
39
|
+
"projectSignatures": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"additionalProperties": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"workspaceFileSignatures": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"additionalProperties": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"additionalProperties": true
|
|
55
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": [
|
|
5
|
+
"schema",
|
|
6
|
+
"name",
|
|
7
|
+
"mode",
|
|
8
|
+
"createdAt",
|
|
9
|
+
"workspaceName",
|
|
10
|
+
"workspacePath",
|
|
11
|
+
"copiedPaths",
|
|
12
|
+
"projects"
|
|
13
|
+
],
|
|
14
|
+
"properties": {
|
|
15
|
+
"schema": {
|
|
16
|
+
"const": "rapidkit-workspace-snapshot-v1"
|
|
17
|
+
},
|
|
18
|
+
"name": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1
|
|
21
|
+
},
|
|
22
|
+
"mode": {
|
|
23
|
+
"enum": [
|
|
24
|
+
"metadata",
|
|
25
|
+
"full"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"reason": {
|
|
29
|
+
"type": "string"
|
|
30
|
+
},
|
|
31
|
+
"createdAt": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"format": "date-time"
|
|
34
|
+
},
|
|
35
|
+
"workspaceName": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"minLength": 1
|
|
38
|
+
},
|
|
39
|
+
"workspacePath": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"minLength": 1
|
|
42
|
+
},
|
|
43
|
+
"copiedPaths": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"minLength": 1
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"projects": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "object"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"additionalProperties": false
|
|
58
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": [
|
|
5
|
+
"schema",
|
|
6
|
+
"name",
|
|
7
|
+
"mode",
|
|
8
|
+
"createdAt",
|
|
9
|
+
"workspaceName",
|
|
10
|
+
"workspacePath",
|
|
11
|
+
"copiedPaths",
|
|
12
|
+
"projects",
|
|
13
|
+
"recoveryScope"
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"schema": {
|
|
17
|
+
"const": "rapidkit-workspace-snapshot-v2"
|
|
18
|
+
},
|
|
19
|
+
"name": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"minLength": 1
|
|
22
|
+
},
|
|
23
|
+
"mode": {
|
|
24
|
+
"const": "project"
|
|
25
|
+
},
|
|
26
|
+
"reason": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
},
|
|
29
|
+
"createdAt": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"format": "date-time"
|
|
32
|
+
},
|
|
33
|
+
"workspaceName": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"minLength": 1
|
|
36
|
+
},
|
|
37
|
+
"workspacePath": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"minLength": 1
|
|
40
|
+
},
|
|
41
|
+
"copiedPaths": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"minItems": 1,
|
|
44
|
+
"maxItems": 1,
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"minLength": 1
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"projects": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"minItems": 1,
|
|
53
|
+
"maxItems": 1,
|
|
54
|
+
"items": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"required": [
|
|
57
|
+
"name",
|
|
58
|
+
"relativePath"
|
|
59
|
+
],
|
|
60
|
+
"properties": {
|
|
61
|
+
"name": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"minLength": 1
|
|
64
|
+
},
|
|
65
|
+
"relativePath": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"minLength": 1
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"additionalProperties": false
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"recoveryScope": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"required": [
|
|
76
|
+
"kind",
|
|
77
|
+
"projectName",
|
|
78
|
+
"relativePath"
|
|
79
|
+
],
|
|
80
|
+
"properties": {
|
|
81
|
+
"kind": {
|
|
82
|
+
"const": "project"
|
|
83
|
+
},
|
|
84
|
+
"projectName": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"minLength": 1
|
|
87
|
+
},
|
|
88
|
+
"relativePath": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"minLength": 1
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"additionalProperties": false
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"additionalProperties": false
|
|
97
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": [
|
|
5
|
+
"schemaVersion",
|
|
6
|
+
"workspacePath",
|
|
7
|
+
"registry",
|
|
8
|
+
"contractSynced",
|
|
9
|
+
"registrySummary"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"schemaVersion": {
|
|
13
|
+
"const": "rapidkit-workspace-sync-v1"
|
|
14
|
+
},
|
|
15
|
+
"workspacePath": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"minLength": 1
|
|
18
|
+
},
|
|
19
|
+
"registry": {
|
|
20
|
+
"type": "object"
|
|
21
|
+
},
|
|
22
|
+
"contractSynced": {
|
|
23
|
+
"type": "boolean"
|
|
24
|
+
},
|
|
25
|
+
"registrySummary": {
|
|
26
|
+
"type": "object"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"additionalProperties": true
|
|
30
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": [
|
|
5
|
+
"schemaVersion",
|
|
6
|
+
"kind",
|
|
7
|
+
"sequence",
|
|
8
|
+
"timestamp",
|
|
9
|
+
"mode",
|
|
10
|
+
"modelHash",
|
|
11
|
+
"modelHashChanged",
|
|
12
|
+
"changedProjects",
|
|
13
|
+
"addedProjects",
|
|
14
|
+
"removedProjects",
|
|
15
|
+
"graph",
|
|
16
|
+
"durationMs"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"schemaVersion": {
|
|
20
|
+
"const": "workspace-watch-event.v1"
|
|
21
|
+
},
|
|
22
|
+
"kind": {
|
|
23
|
+
"enum": [
|
|
24
|
+
"ready",
|
|
25
|
+
"changed",
|
|
26
|
+
"unchanged",
|
|
27
|
+
"error"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"sequence": {
|
|
31
|
+
"type": "integer",
|
|
32
|
+
"minimum": -1
|
|
33
|
+
},
|
|
34
|
+
"timestamp": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"format": "date-time"
|
|
37
|
+
},
|
|
38
|
+
"mode": {
|
|
39
|
+
"enum": [
|
|
40
|
+
"initial",
|
|
41
|
+
"full",
|
|
42
|
+
"incremental",
|
|
43
|
+
"unchanged"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"modelHash": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"pattern": "^(?:[a-f0-9]{64})?$"
|
|
49
|
+
},
|
|
50
|
+
"modelHashChanged": {
|
|
51
|
+
"type": "boolean"
|
|
52
|
+
},
|
|
53
|
+
"changedProjects": {
|
|
54
|
+
"type": "array",
|
|
55
|
+
"items": {
|
|
56
|
+
"type": "string"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"addedProjects": {
|
|
60
|
+
"type": "array",
|
|
61
|
+
"items": {
|
|
62
|
+
"type": "string"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"removedProjects": {
|
|
66
|
+
"type": "array",
|
|
67
|
+
"items": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"graph": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"required": [
|
|
74
|
+
"nodeCount",
|
|
75
|
+
"edgeCount",
|
|
76
|
+
"edgesAdded",
|
|
77
|
+
"edgesRemoved"
|
|
78
|
+
],
|
|
79
|
+
"properties": {
|
|
80
|
+
"nodeCount": {
|
|
81
|
+
"type": "integer",
|
|
82
|
+
"minimum": 0
|
|
83
|
+
},
|
|
84
|
+
"edgeCount": {
|
|
85
|
+
"type": "integer",
|
|
86
|
+
"minimum": 0
|
|
87
|
+
},
|
|
88
|
+
"edgesAdded": {
|
|
89
|
+
"type": "array",
|
|
90
|
+
"items": {
|
|
91
|
+
"type": "object"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"edgesRemoved": {
|
|
95
|
+
"type": "array",
|
|
96
|
+
"items": {
|
|
97
|
+
"type": "object"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"additionalProperties": false
|
|
102
|
+
},
|
|
103
|
+
"durationMs": {
|
|
104
|
+
"type": "number",
|
|
105
|
+
"minimum": 0
|
|
106
|
+
},
|
|
107
|
+
"error": {
|
|
108
|
+
"type": "string"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"additionalProperties": true
|
|
112
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as printAnalyzeReport,a as runAnalyze}from'./chunk-L3E6IRUQ.js';
|
package/dist/{artifact-remediation-plan-5GJWPPRS.js → artifact-remediation-plan-Z7OCSME3.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {a
|
|
2
|
-
`}function
|
|
3
|
-
`}function
|
|
1
|
+
import {a}from'./chunk-2E6WGUN6.js';import {c,g,d}from'./chunk-FWJV7CCI.js';import y from'path';import {existsSync}from'fs';import x from'fs-extra';var I=[{artifactKind:"bootstrap-compliance",cardId:"bootstrap",fileNames:["bootstrap-compliance.latest.json"]},{artifactKind:"doctor-workspace",cardId:"doctor",fileNames:["doctor-remediation-plan-last-run.json"]},{artifactKind:"analyze",cardId:"analyze",fileNames:["analyze-last-run.json"]},{artifactKind:"readiness",cardId:"readiness",fileNames:["release-readiness-last-run.json"]},{artifactKind:"pipeline",cardId:"pipeline",fileNames:["pipeline-last-run.json"]},{artifactKind:"workspace-run",cardId:"workspaceRun",fileNames:["workspace-run-last.json"]},{artifactKind:"workspace-verify",cardId:"workspaceVerify",fileNames:["workspace-verify-last-run.json"]}];function m(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function f(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0):[]}function u(e){return [...new Set(e.map(r=>r.trim()).filter(Boolean))]}function K(e,r,t){return t?r:y.relative(e,r)}function C(e){let r=e?.trim()||"npx workspai bootstrap";if(!/(?:^|\s)--ci(?:\s|$)/.test(r)&&/(?:^|\s)--json(?:\s|$)/.test(r))return r.replace(/(?:^|\s)--json(?:\s|$)/,i=>{let n=i.startsWith(" ")?" ":"",c=i.endsWith(" ")?" ":"";return `${n}--ci --json${c}`}).trim();let t=/(?:^|\s)--ci(?:\s|$)/.test(r)?r:`${r} --ci`;return /(?:^|\s)--json(?:\s|$)/.test(t)?t:`${t} --json`}function M(e){return `${JSON.stringify({schemaVersion:"rapidkit.compatibility-matrix.v1",generatedAt:e,source:"workspai workspace remediation-plan",runtimes:{},notes:["Minimal enterprise baseline. Add runtime and toolchain entries as governance matures."]},null,2)}
|
|
2
|
+
`}function N(e){return `${JSON.stringify({schema_version:"1.0",enabled:false,strategy:"on-demand",artifacts:[],created_at:e,note:"Minimal enterprise baseline. Set enabled: true and add artifact entries to activate mirroring."},null,2)}
|
|
3
|
+
`}function P(e){let r=e.payload,t=f(r.blockers),i=f(r.blockingReasons),n=f(r.failures),c=f(r.reasons),d=f(r.policyViolations),a=m(r.summary),l=f(a?.blockers);if(e.artifactKind==="analyze"){let o=(Array.isArray(r.findings)?r.findings:[]).map(s=>m(s)).filter(s=>!!s).map(s=>String(s.message??s.title??s.id??"").trim()).filter(Boolean);return u([...t,...o,...i])}if(e.artifactKind==="workspace-run"){let g=m(r.stages),o=Object.entries(g??{}).flatMap(([s,b])=>{let A=m(b);return (Array.isArray(A?.projects)?A.projects:[]).map(p=>m(p)).filter(p=>!!p).filter(p=>p.status==="failed"||p.ok===false).map(p=>`${s}: ${String(p.project??p.name??"project")} failed`)});return u([...t,...o,...i])}return u([...t,...i,...n,...c,...d,...l])}function k(e){return {id:e.id,artifactKind:e.artifactKind,cardId:e.cardId,title:e.title,order:e.order,phase:e.phase,scope:"workspace",status:e.status??"ready",mode:e.mode,risk:e.risk,requiresApproval:true,blocker:e.blocker,summary:e.summary,...e.command?{command:e.command}:{},verifyCommand:e.verifyCommand,cwd:"workspace",files:e.files??[],...e.operation?{operation:e.operation}:{},rollback:{available:!!e.operation,strategy:e.operation?"idempotent":"none"},notes:e.notes??[]}}function S(e){let r=[],t=C("npx workspai bootstrap --json");for(let i of e.blockers)i.includes("profile.enterprise.ci")&&r.push(k({id:"bootstrap.enterprise-ci",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Run bootstrap in deterministic CI mode",order:10,phase:"bootstrap-preflight",blocker:i,summary:"Enterprise bootstrap compliance requires --ci for deterministic execution.",mode:"run-command",risk:"safe",command:t,verifyCommand:t})),i.includes("profile.enterprise.compatibility-matrix")&&r.push(k({id:"bootstrap.compatibility-matrix",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Create enterprise compatibility matrix baseline",order:20,phase:"bootstrap-config",blocker:i,summary:"Create the missing compatibility matrix baseline without overwriting user data.",mode:"edit-file",risk:"safe",verifyCommand:t,files:[".workspai/compatibility-matrix.json"],operation:{type:"file-create",path:".workspai/compatibility-matrix.json",content:M(e.generatedAt),overwrite:false}})),i.includes("profile.enterprise.mirror-config")&&r.push(k({id:"bootstrap.mirror-config",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Create enterprise mirror config baseline",order:30,phase:"bootstrap-config",blocker:i,summary:"Create the missing mirror configuration baseline without enabling mirroring.",mode:"edit-file",risk:"safe",verifyCommand:t,files:[".workspai/mirror-config.json"],operation:{type:"file-create",path:".workspai/mirror-config.json",content:N(e.generatedAt),overwrite:false}}));return r}function $(e){let t={analyze:{title:"Refresh analyze evidence",phase:"analysis",command:"npx workspai analyze --strict --json",verify:"npx workspai analyze --strict --json"},readiness:{title:"Refresh release readiness",phase:"release-readiness",command:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",verify:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json"},pipeline:{title:"Rerun governance pipeline",phase:"governance-pipeline",command:"npx workspai pipeline --json --strict",verify:"npx workspai pipeline --json --strict"},"workspace-run":{title:"Rerun failed workspace stage",phase:"fleet-run",command:e.ciMode?"npx workspai workspace run test --strict --json":"npx workspai workspace run test --json",verify:e.ciMode?"npx workspai workspace run test --strict --json":"npx workspai workspace run test --json"},"workspace-verify":{title:"Refresh workspace verify gate",phase:"verification",command:e.ciMode?"npx workspai workspace verify --strict --json":"npx workspai workspace verify --json",verify:e.ciMode?"npx workspai workspace verify --strict --json":"npx workspai workspace verify --json"},"doctor-workspace":{title:"Use Doctor remediation plan",phase:"doctor-remediation",command:"npx workspai doctor workspace --plan --json",verify:"npx workspai doctor workspace --json"}}[e.report.artifactKind]??{title:"Refresh artifact evidence",phase:"evidence-refresh",command:"npx workspai pipeline --json --strict",verify:"npx workspai pipeline --json --strict"};return k({id:`${e.report.cardId}.refresh.${e.order}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:t.title,order:e.order,phase:t.phase,blocker:e.blocker,summary:"No deterministic file operation is available for this artifact yet; refresh the evidence and continue with the card-specific plan.",mode:e.report.artifactKind==="doctor-workspace"?"verify-before-fix":"run-command",risk:"guarded",status:e.report.artifactKind==="doctor-workspace"?"review-required":"ready",command:t.command,verifyCommand:t.verify,notes:e.report.artifactKind==="doctor-workspace"?["Read doctor-remediation-plan-last-run.json for ordered file-level steps."]:[]})}async function O(e){let r=[c(e,".workspai/reports"),d(e,".workspai/reports")],t=[],i=new Set;for(let n of I)for(let c of n.fileNames){let d=(await Promise.all(r.map(a=>y.join(a,c)))).find(a=>existsSync(a));if(!(!d||i.has(`${n.artifactKind}:${c}`))){i.add(`${n.artifactKind}:${c}`);try{let a=await x.readJSON(d),l=m(a);if(!l)continue;t.push({artifactKind:n.artifactKind,cardId:n.cardId,fileName:c,absolutePath:d,payload:l});}catch{t.push({artifactKind:n.artifactKind,cardId:n.cardId,fileName:c,absolutePath:d,payload:{blockers:[`${n.artifactKind}: report exists but could not be parsed.`]}});}}}return t}async function F(e){let r=y.resolve(e.workspacePath),t=e.includeAbsolutePaths===true,i=e.ciMode===true,n=new Date().toISOString(),c$1=c(r,".workspai/reports"),d=await O(r),a$1=[],l=1;for(let o of d){let s=P(o);if(s.length!==0){if(o.artifactKind==="bootstrap-compliance"){a$1.push(...S({blockers:s,generatedAt:n})),l=a$1.length+1;continue}for(let b of s.slice(0,8))a$1.push($({report:o,blocker:b,order:l,ciMode:i})),l+=1;}}let g={safe:a$1.filter(o=>o.risk==="safe").length,guarded:a$1.filter(o=>o.risk==="guarded").length,invasive:a$1.filter(o=>o.risk==="invasive").length};return {schemaVersion:a,generatedAt:n,workspace:{name:y.basename(r),...t?{path:r}:{}},source:{command:"workspace remediation-plan",reportsDir:K(r,c$1,t),includeAbsolutePaths:t,ciMode:i},summary:{artifactsScanned:d.length,cardsCovered:u(a$1.map(o=>o.cardId)).length,totalActions:a$1.length,executableActions:a$1.filter(o=>o.status==="ready").length,risk:g},actions:a$1}}async function W(e,r){return g(r,".workspai/reports/artifact-remediation-plan-last-run.json",e)}export{F as buildArtifactRemediationPlan,W as writeArtifactRemediationPlan};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-CL6TGI4Q.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import c from'os';import o from'path';import a from'fs-extra';function l(n=process.platform){return n==="win32"?"windows":n==="linux"?"linux":n==="darwin"?"macos":"other"}function s(n=process.platform){return l(n)==="windows"}function R(n=process.platform){return s(n)}var u=new Set(["npx","npm","yarn","pnpm"]);function P(n){return n==="npx"?"npx-cli.js":"npm-cli.js"}function g(n,r){let t=r.npm_execpath;if(!t)return null;let e=o.basename(t).toLowerCase();if(n==="npx"&&e!=="npx-cli.js"){let i=o.join(o.dirname(t),"npx-cli.js");return a.existsSync(i)?i:null}if(n==="npm"&&e==="npx-cli.js"){let i=o.join(o.dirname(t),"npm-cli.js");return a.existsSync(i)?i:null}return a.existsSync(t)?t:null}function x(n){if(n!=="npm"&&n!=="npx")return [];let r=P(n),t=o.dirname(process.execPath),e=o.dirname(t);return [o.join(e,"lib","node_modules","npm","bin",r),o.join(e,"lib64","node_modules","npm","bin",r),o.join("/usr","lib","node_modules","npm","bin",r),o.join("/usr","local","lib","node_modules","npm","bin",r),o.join("/usr","share","nodejs","npm","bin",r)]}function C(n,r=process.platform){return h(n,r).command}function h(n,r=process.platform,t=process.env){let e=n.trim();if(!u.has(e))return {command:e,prefixArgs:[]};let i=o.dirname(process.execPath),d=s(r)?".cmd":"",f=[o.join(i,`${e}${d}`),o.join(i,e)];for(let p of f)if(a.existsSync(p))return {command:p,prefixArgs:[]};let m=g(e,t);if(m)return {command:process.execPath,prefixArgs:[m]};for(let p of x(e))if(a.existsSync(p))return {command:process.execPath,prefixArgs:[p]};return e==="npm"?{command:"corepack",prefixArgs:["npm"]}:{command:e,prefixArgs:[]}}function S(n,r=process.platform){let t=s(r)?";":":",e=o.dirname(process.execPath),i=(n??process.env.PATH??"").split(t).filter(Boolean);return i.includes(e)||i.unshift(e),i.join(t)}var j=["npm_config_package","npm_config__package"];function _(n=process.env,r=process.platform){let t=o.join(c.tmpdir(),"rapidkit-corepack"),e={...n,PATH:S(n.PATH,r),COREPACK_HOME:n.COREPACK_HOME??t};for(let i of j)delete e[i];return e}function v(n=process.platform){return s(n)?"python":"python3"}function w(n=process.platform){return s(n)?["python","py","python3"]:["python3","python"]}function D(n=14,r=10,t=process.platform){let e=[];if(s(t)){for(let i=n;i>=r;i-=1)e.push({command:"py",args:[`-3.${i}`,"--version"]});return e.push({command:"py",args:["-3","--version"]}),e.push({command:"python",args:["--version"]}),e}for(let i=n;i>=r;i-=1)e.push({command:`python3.${i}`,args:["--version"]});return e.push({command:"python3",args:["--version"]}),e.push({command:"python",args:["--version"]}),e}function O(n,r=process.platform){return s(r)?o.join(n,"Scripts"):o.join(n,"bin")}function L(n,r=process.platform){return s(r)?o.join(n,"Scripts","python.exe"):o.join(n,"bin","python")}function H(n,r=process.platform){return s(r)?o.join(n,"Scripts","rapidkit.exe"):o.join(n,"bin","rapidkit")}function B(n,r=process.platform){return s(r)?o.join(n,"Scripts","activate"):o.join(n,"bin","activate")}function K(n,r=process.platform){return s(r)?[o.join(n,"workspai.cmd"),o.join(n,".workspai","rapidkit.cmd"),o.join(n,"rapidkit.cmd"),o.join(n,".rapidkit","rapidkit.cmd")]:[o.join(n,"workspai"),o.join(n,".workspai","rapidkit"),o.join(n,"rapidkit"),o.join(n,".rapidkit","rapidkit")]}function k(n=process.env,r=process.platform){let t=n.HOME||n.USERPROFILE||c.homedir();return o.join(t,".workspai")}function y(n=process.env,r=process.platform){let t=n.HOME||n.USERPROFILE||c.homedir();return o.join(t,".rapidkit")}function T(n=process.env,r=process.platform){let t=[o.join(k(n,r),"workspaces.json"),o.join(y(n,r),"workspaces.json")];if(s(r)){let e=n.XDG_CONFIG_HOME||n.APPDATA;e&&(t.push(o.join(e,"workspai","workspaces.json")),t.push(o.join(e,"rapidkit","workspaces.json")));}return [...new Set(t)]}function V(n=process.env,r=process.platform){let t=[];return s(r)?(n.USERPROFILE&&t.push(o.join(n.USERPROFILE,".local","bin")),n.APPDATA&&t.push(o.join(n.APPDATA,"Python","Scripts")),n.LOCALAPPDATA&&t.push(o.join(n.LOCALAPPDATA,"Programs","Python","Scripts"))):t.push(o.join(c.homedir(),".local","bin")),[...new Set(t.filter(Boolean))]}export{l as a,s as b,R as c,C as d,h as e,S as f,_ as g,v as h,w as i,D as j,O as k,L as l,H as m,B as n,K as o,k as p,y as q,T as r,V as s};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {c,g,f}from'./chunk-FWJV7CCI.js';import {l as l$1}from'./chunk-OCGZNSOE.js';import {a,b as b$1}from'./chunk-5AKYMAIL.js';import {e}from'./chunk-RO73VVHW.js';import {a as a$1}from'./chunk-XZGVNGRB.js';import {p,o}from'./chunk-5XATWNME.js';import l from'path';import h from'fs-extra';var K="unknown-run";function I(e$1){let r=e();return !r||r===K?e$1:{...e$1,runId:r}}var k=".workspai/workspace.contract.json",z=a.contractVerify,C=1,L=b$1.contractVerify;function T(e){return e.replace(/\\/g,"/")}function E(e){let r=T(e).trim();return !r||r.startsWith("/")||r.startsWith("~")||/^[a-zA-Z]:\//.test(r)||r.includes("\0")?false:!r.split("/").filter(Boolean).some(s=>s===".."||s===".")}function V(e,r){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^[-_.]+|[-_.]+$/g,"").slice(0,80)||r}function H(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0):[]}function B(e){let s=(Array.isArray(e.ports)?e.ports:[]).map(a=>{if(!a||typeof a!="object"||Array.isArray(a))return null;let c=a,p=Number(c.port);if(!Number.isInteger(p)||p<1||p>65535)return null;let t=c.protocol==="https"||c.protocol==="grpc"||c.protocol==="tcp"||c.protocol==="udp"?c.protocol:"http";return {name:typeof c.name=="string"&&c.name.trim()?c.name:"http",port:p,protocol:t}}).filter(a=>a!==null);if(s.length>0)return s;let n=e.frontend&&typeof e.frontend=="object"&&!Array.isArray(e.frontend)?e.frontend:void 0,i=Number(e.port??n?.default_port);return Number.isInteger(i)&&i>=1&&i<=65535?[{name:"http",port:i,protocol:"http"}]:[]}async function v(e){for(let r of e)if(await h.pathExists(r))return r;return null}async function U(e){for(let r of o(e,"workspace.json"))try{let s=await h.readJson(r);return {name:typeof s.workspace_name=="string"&&s.workspace_name.trim()||typeof s.name=="string"&&s.name.trim()||l.basename(e),profile:typeof s.profile=="string"?s.profile:void 0}}catch{}return {name:l.basename(e)}}async function Y(e){let r=[],s=[e],n=new Set,i=new Set([".git",".workspai",".rapidkit","node_modules",".venv","venv","dist","build","target",".next",".turbo",".cache"]);for(;s.length>0;){let a=s.shift();if(!a||n.has(a))continue;n.add(a);let c=await v(p(a,"project.json")),p$1=await v(p(a,"context.json"));if(c||p$1){r.push(c??p$1??"");continue}let t;try{t=await h.readdir(a,{withFileTypes:true});}catch{continue}for(let o of t)!o.isDirectory()||i.has(o.name)||s.push(l.join(a,o.name));}return r.sort()}function Z(e){let r=(e||"").toLowerCase();if(r.includes("fastapi"))return "fastapi";if(r.includes("nestjs"))return "nestjs";if(r.includes("springboot"))return "springboot";if(r.includes("gofiber"))return "fiber";if(r.includes("gogin"))return "gin"}function q(e,r){let s=(e||"").toLowerCase(),n=(r||"").toLowerCase();return s.includes("fastapi")?8e3:s.includes("nestjs")?3e3:s.includes("springboot")?8080:s.includes("gofiber")?3e3:s.includes("gogin")?8080:n==="node"?3e3:n==="python"?8e3:n==="java"||n==="go"?8080:null}function Q(e,r){let s=e;for(;r.has(s)&&s<65535;)s+=1;return s}function b(e,r,s){let n=e!==void 0&&e.source===void 0,i=q(r.kit,r.runtime),a=e?.ports||[],c=r.ports||[],p=a.length>0?a:c.length>0?c:i?[{name:"http",port:Q(i,s),protocol:"http"}]:[];for(let u of p)s.add(u.port);let t={...r,...e,slug:e?.slug||r.slug,relativePath:n&&e?.relativePath&&E(e.relativePath)?e.relativePath:r.relativePath,source:n&&e?.source||r.source,relationship:n&&e?.relationship||r.relationship,externalPath:n&&e?.externalPath||r.externalPath,runtime:e?.runtime||r.runtime,framework:e?.framework||r.framework,kit:e?.kit||r.kit,modules:e?.modules?.length?e.modules:r.modules,ports:p,contracts:{owns:e?.contracts?.owns||[],apis:e?.contracts?.apis||[],publishes:e?.contracts?.publishes||[],consumes:e?.contracts?.consumes||[],dependsOn:e?.contracts?.dependsOn||[],env:e?.contracts?.env||[]}},o=JSON.stringify(e||null)!==JSON.stringify(t);return {project:t,changed:o}}async function J(e){let r=l.resolve(e.workspacePath),s=await U(r),n=await Y(r),i=await a$1(r),a=[];for(let o of i){let u=l.resolve(o.path),d=await v(p(u,"project.json"))??await v(p(u,"context.json"));!d||n.some(P=>l.resolve(P)===l.resolve(d))||a.push({projectJsonPath:d,registryEntry:o});}let c=[],p$1=[...n.map(o=>({projectJsonPath:o})),...a];for(let{projectJsonPath:o,registryEntry:u}of p$1){let d=l.dirname(l.dirname(o)),P=T(l.relative(r,d)),j=u!==void 0&&!E(P),f=V(u?.name||l.basename(d),l.basename(d)),m=j?`external/${f}`:P||f,g=await h.readJson(o),R=typeof g.kit_name=="string"&&g.kit_name||typeof g.kit=="string"&&g.kit||void 0,D=typeof g.framework=="string"&&g.framework||Z(R);c.push({slug:u?.name||m||l.basename(d),relativePath:m,source:u?.source??"workspace",relationship:u?.relationship,externalPath:j?d:void 0,runtime:typeof g.runtime=="string"?g.runtime:void 0,framework:D,kit:R,modules:H(g.modules),ports:B(g),contracts:{owns:[],apis:[],publishes:[],consumes:[],dependsOn:[],env:[]}});}let t=new Map;for(let o of c){let u=V(o.slug,o.relativePath),d=t.get(u);(!d||d.source!=="workspace"&&o.source==="workspace")&&t.set(u,o);}return {schemaVersion:C,kind:"rapidkit.workspace.contract",generatedAt:(e.now??new Date).toISOString(),workspace:s,projects:[...t.values()]}}async function lt(e){let r=l.resolve(e.outputPath||c(e.workspacePath,k));if(await h.pathExists(r)&&e.force!==true)throw new Error(`Workspace contract already exists: ${r}. Use --force to overwrite.`);let s=await J({workspacePath:e.workspacePath,now:e.now}),n=new Set,i={...s,projects:s.projects.map(c=>b(void 0,c,n).project)};e.outputPath?(await h.ensureDir(l.dirname(r)),await h.writeJson(r,i,{spaces:2})):await g(e.workspacePath,k,i);let{publishWorkspaceRegistrySummary:a}=await import('./workspace-registry-summary-S52SEJAG.js');return await a(e.workspacePath,{now:e.now}),{contractPath:r,contract:i}}async function dt(e){let r=l.resolve(e.workspacePath),s=c(r,k),n=await f(r,k)??s,i=await J({workspacePath:r,now:e.now}),a=await h.pathExists(n)?await h.readJson(n):null,c$1=new Map((a?.projects||[]).map(f=>[f.slug,f])),p=new Set,t=[],o=[],u=[];for(let f of i.projects){let m=c$1.get(f.slug),g=b(m,f,p);m?g.changed&&o.push(f.slug):t.push(f.slug),u.push(g.project),c$1.delete(f.slug);}for(let f of c$1.values()){if(f.source)continue;let m=b(f,f,p);u.push(m.project);}let d={schemaVersion:C,kind:"rapidkit.workspace.contract",generatedAt:(e.now??new Date).toISOString(),workspace:{...i.workspace,...a?.workspace||{},name:a?.workspace?.name||i.workspace.name},projects:u.sort((f,m)=>f.slug.localeCompare(m.slug))};await g(r,k,d);let P=await X({workspacePath:r}),{publishWorkspaceRegistrySummary:j}=await import('./workspace-registry-summary-S52SEJAG.js');return await j(r,{now:e.now}),{contractPath:s,contract:d,addedProjects:t,updatedProjects:o,verification:P}}async function M(e){let r=e.contractPath??(await f(e.workspacePath,k)||c(e.workspacePath,k)),s=await h.readJson(r);return {contractPath:r,contract:s}}async function ft(e){let{contractPath:r,contract:s}=await M(e),n=s.projects.map(t=>({id:t.slug,label:t.slug,relativePath:t.relativePath,source:t.source,relationship:t.relationship,externalPath:t.externalPath,runtime:t.runtime,framework:t.framework,kit:t.kit,modules:t.modules,ports:t.ports,apis:t.contracts.apis,owns:t.contracts.owns,env:t.contracts.env})),i=new Set(n.map(t=>t.id)),a=new Map,c=[];for(let t of s.projects){for(let o of t.contracts.dependsOn||[])i.has(o)&&c.push({from:o,to:t.slug,type:"dependency",label:"dependsOn"});for(let o of t.contracts.publishes||[])a.has(o)||a.set(o,new Set),a.get(o)?.add(t.slug);}for(let t of s.projects)for(let o of t.contracts.consumes||[]){let u=a.get(o);if(u)for(let d of u)d!==t.slug&&c.push({from:d,to:t.slug,type:"event",label:o});}let p={schemaVersion:1,kind:"rapidkit.workspace.contract.graph",workspace:s.workspace,generatedAt:new Date().toISOString(),nodes:n.sort((t,o)=>t.id.localeCompare(o.id)),edges:c.sort((t,o)=>`${t.from}:${t.to}:${t.type}:${t.label}`.localeCompare(`${o.from}:${o.to}:${o.type}:${o.label}`)),summary:{projectCount:n.length,dependencyEdges:c.filter(t=>t.type==="dependency").length,eventEdges:c.filter(t=>t.type==="event").length,portCount:n.reduce((t,o)=>t+o.ports.length,0),apiCount:n.reduce((t,o)=>t+o.apis.length,0)}};return {contractPath:r,graph:p}}async function X(e){let{contractPath:r,contract:s}=await M(e),n=[],i=[];s.kind!=="rapidkit.workspace.contract"&&n.push("Contract kind must be rapidkit.workspace.contract."),s.schemaVersion!==C&&n.push(`Contract schemaVersion must be ${C}.`),s.workspace?.name||n.push("Contract workspace.name is required."),Array.isArray(s.projects)||n.push("Contract projects must be an array.");let a=new Set,c=new Map;for(let t of s.projects||[]){if(!t.slug){n.push("Every project must declare slug.");continue}a.has(t.slug)&&n.push(`Duplicate project slug: ${t.slug}.`),a.add(t.slug),t.relativePath?E(t.relativePath)||n.push(`Project ${t.slug} declares unsafe relativePath: ${t.relativePath}.`):n.push(`Project ${t.slug} must declare relativePath.`),t.externalPath&&(t.relationship==="adopted"||t.source==="adopted-local"||t.source==="local-folder"||t.source==="git-url"||n.push(`Project ${t.slug} declares externalPath without imported/adopted provenance.`),l.isAbsolute(t.externalPath)||n.push(`Project ${t.slug} declares non-absolute externalPath.`));for(let o of t.ports||[]){(!Number.isInteger(o.port)||o.port<1||o.port>65535)&&n.push(`Project ${t.slug} declares invalid port: ${o.port}.`);let u=c.get(o.port);u&&n.push(`Port ${o.port} is claimed by both ${u} and ${t.slug}.`),c.set(o.port,t.slug);}for(let o of t.contracts?.apis||[])(!o.name?.trim()||!o.basePath?.startsWith("/"))&&n.push(`Project ${t.slug} declares invalid API contract.`);for(let o of [...t.contracts?.publishes||[],...t.contracts?.consumes||[]])o.trim()||n.push(`Project ${t.slug} declares an empty event contract.`);for(let o of t.contracts?.env||[])/^[A-Z_][A-Z0-9_]*$/.test(o)||n.push(`Project ${t.slug} declares invalid env contract: ${o}.`);for(let o of t.contracts?.dependsOn||[])a.has(o);}for(let t of s.projects||[])for(let o of t.contracts?.dependsOn||[])a.has(o)||n.push(`Project ${t.slug} depends on unknown project: ${o}.`);i.push({id:"schema",status:s.kind==="rapidkit.workspace.contract"&&s.schemaVersion===C?"passed":"failed",message:"Contract schema and kind are valid."}),i.push({id:"projects",status:Array.isArray(s.projects)?"passed":"failed",message:`Contract declares ${Array.isArray(s.projects)?s.projects.length:0} project(s).`}),i.push({id:"ports",status:n.some(t=>t.toLowerCase().includes("port"))?"failed":"passed",message:"Project port declarations are valid and collision-free."}),i.push({id:"dependencies",status:n.some(t=>t.includes("depends on unknown project"))?"failed":"passed",message:"Project dependencies point to known project slugs."}),i.push({id:"contracts",status:n.some(t=>t.includes("unsafe relativePath")||t.includes("invalid API contract")||t.includes("event contract")||t.includes("env contract"))?"failed":"passed",message:"Project path, API, event, and env contracts are valid."});let p=await l$1(e.workspacePath);if(p.moduleCount>0){for(let t of p.issues)n.push(`${l.basename(t.projectRoot)}: ${t.message} (slug=${t.slug})`);i.push({id:"module-paths",status:p.status,message:p.status==="passed"?`All ${p.moduleCount} registered module(s) resolve under canonical paths.`:`${p.issues.length} registered module(s) missing canonical install paths.`});}else e.strict&&i.push({id:"module-paths",status:"passed",message:"No registry-backed modules declared in workspace projects."});return {status:n.length>0?"failed":"passed",contractPath:r,projectCount:Array.isArray(s.projects)?s.projects.length:0,checks:i,violations:n}}async function gt(e){let r=l.resolve(e.workspacePath),s={schemaVersion:L,generatedAt:e.generatedAt??new Date().toISOString(),status:e.result.status,contractPath:e.result.contractPath,projectCount:e.result.projectCount,checks:e.result.checks,violations:e.result.violations};return g(r,z,I(s))}
|
|
2
|
+
export{I as a,k as b,z as c,C as d,L as e,Y as f,J as g,lt as h,dt as i,M as j,ft as k,X as l,gt as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-5AKYMAIL.js';var i=b.doctor,s="doctor-project-evidence-v1";function f(r){return !r||typeof r!="object"||Array.isArray(r)?null:r}function u(r,n){let t=f(r);if(!t)return false;let o=t.schemaVersion,e=t.evidenceType;return !(typeof o=="string"&&(o!==i&&o!==s||n==="workspace"&&o!==i||n==="project"&&o!==s)||typeof e=="string"&&(e!=="workspace"&&e!=="project"||n&&e!==n))}export{i as a,s as b,u as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o={model:".workspai/reports/workspace-model.json",snapshot:".workspai/reports/workspace-model-snapshot.json",diff:".workspai/reports/workspace-model-diff-last-run.json",impact:".workspai/reports/workspace-impact-last-run.json",analyze:".workspai/reports/analyze-last-run.json",doctor:".workspai/reports/doctor-last-run.json",contractVerify:".workspai/reports/workspace-contract-verify-last-run.json",readiness:".workspai/reports/release-readiness-last-run.json",verify:".workspai/reports/workspace-verify-last-run.json",history:".workspai/reports/workspace-intelligence-history.json",agentContext:".workspai/reports/workspace-context-agent.json",agentIndex:".workspai/reports/INDEX.json",agentCustomizationPack:".workspai/reports/agent-customization-pack.json",skillsIndex:".workspai/reports/workspace-skills-index.json",agents:"AGENTS.md",explain:".workspai/reports/workspace-explain-last-run.json"},t={model:"workspace-model.v1",snapshot:"workspace-model-snapshot.v1",diff:"workspace-model-diff.v1",impact:"workspace-impact.v1",analyze:"rapidkit-analyze-v1",doctor:"doctor-workspace-evidence-v1",contractVerify:"workspace-contract-verify.v1",readiness:"release-readiness-v1",verify:"workspace-verify.v1",history:"workspace-intelligence-history.v1",agentContext:"workspace-context.v1",agentIndex:"rapidkit-agent-reports-index.v1",agentCustomizationPack:"rapidkit-agent-customization-pack.v1",skillsIndex:"workspace-skills-index.v1",agents:null,explain:"workspace-explain.v1"},a={model:"contracts/workspace-intelligence/workspace-model.v1.json",snapshot:"contracts/workspace-intelligence/workspace-model-snapshot.v1.json",diff:"contracts/workspace-intelligence/workspace-model-diff.v1.json",impact:"contracts/workspace-intelligence/workspace-impact.v1.json",analyze:"contracts/analyze-last-run.v1.json",doctor:"contracts/doctor-workspace-evidence.v1.json",contractVerify:"contracts/workspace-intelligence/workspace-contract-verify.v1.json",readiness:"contracts/release-readiness.v1.json",verify:"contracts/workspace-intelligence/workspace-verify.v1.json",history:"contracts/workspace-intelligence/workspace-intelligence-history.v1.json",agentContext:"contracts/workspace-intelligence/workspace-context.v1.json",agentIndex:"contracts/workspace-intelligence/agent-reports-index.v1.json",agentCustomizationPack:"contracts/workspace-intelligence/agent-customization-pack-report.v1.json",skillsIndex:"contracts/workspace-intelligence/workspace-skills-index.v1.json",agents:null,explain:"contracts/workspace-intelligence/workspace-explain.v1.json"},r={analyze:"analyze",workspace:"workspace <action> [subaction] [key] [value]",doctor:"doctor [scope]",readiness:"readiness"},c=["analyze","readiness","doctor","workspace"];var e=o,i={model:{command:["workspace","model","--json","--write"],produces:[e.model]},diff:{command:["workspace","diff","--from",e.snapshot,"--json"],produces:[e.diff]},impact:{command:["workspace","impact","--from",e.diff,"--json"],produces:[e.impact]},"doctor-evidence":{command:["doctor","workspace","--json"],produces:[e.doctor]},"contract-evidence":{command:["workspace","contract","verify","--strict","--json"],produces:[e.contractVerify]},"analyze-evidence":{command:["analyze","--json"],produces:[e.analyze]},"readiness-evidence":{command:["readiness","--json"],produces:[e.readiness]},verify:{command:["workspace","verify","--from-impact",e.impact,"--json"],produces:[e.verify,e.history]},context:{command:["workspace","context","--for-agent","--json","--write","--no-agent-sync"],produces:[e.agentContext]},"agent-sync":{command:["workspace","agent-sync","--write","--json","--preset","enterprise"],produces:[e.agentIndex,e.agentCustomizationPack,e.skillsIndex,e.agents]},explain:{command:["workspace","explain","release-blocked","--json","--write"],produces:[e.explain]}};export{o as a,t as b,a as c,r as d,c as e,i as f};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {c as c$1}from'./chunk-Y45WZR5N.js';import {e,g,c as c$2}from'./chunk-
|
|
1
|
+
import {c as c$1}from'./chunk-Y45WZR5N.js';import {b as b$1,a}from'./chunk-TQEMLBAG.js';import {e,g,c as c$2}from'./chunk-2K3GYCPS.js';import {q as q$1}from'./chunk-5XATWNME.js';import L from'validate-npm-package-name';import s from'path';import {spawn}from'child_process';import i from'chalk';import m from'fs-extra';var c=class extends Error{constructor(n,r,a){super(n);this.code=r;this.details=a;this.name="RapidKitError",Error.captureStackTrace(this,this.constructor);}code;details},E=class extends c{constructor(t,n){let r=n?`Python ${t}+ required, found ${n}`:`Python ${t}+ not found`;super(r,"PYTHON_NOT_FOUND","Please install Python from https://www.python.org/downloads/");}},D=class extends c{constructor(){super("Poetry is not installed","POETRY_NOT_FOUND","Install Poetry from https://python-poetry.org/docs/#installation");}},b=class extends c{constructor(){super("pipx is not installed","PIPX_NOT_FOUND","Install pipx from https://pypa.github.io/pipx/installation/");}},_=class extends c{constructor(t){super(`Directory "${t}" already exists`,"DIRECTORY_EXISTS","Please choose a different name or remove the existing directory");}},d=class extends c{constructor(t,n){super(`Invalid project name: "${t}"`,"INVALID_PROJECT_NAME",n);}},R=class extends c{constructor(t,n){let r=`Installation failed at: ${t}`,a=`${n.message}
|
|
2
2
|
|
|
3
3
|
Troubleshooting:
|
|
4
4
|
- Check your internet connection
|
|
5
5
|
- Verify Python/Poetry installation
|
|
6
|
-
- Try running with --debug flag for more details`;super(r,"INSTALLATION_ERROR",a);}},
|
|
6
|
+
- Try running with --debug flag for more details`;super(r,"INSTALLATION_ERROR",a);}},F=class extends c{constructor(){super("RapidKit Python package is not yet available on PyPI","RAPIDKIT_NOT_AVAILABLE",`Available options:
|
|
7
7
|
1. Install Python 3.10+ and retry the same command
|
|
8
8
|
2. Use the core workflow: npx workspai create workspace <name>
|
|
9
9
|
3. Offline fallback (limited): npx workspai create project fastapi.standard <name> --output .
|
|
10
10
|
|
|
11
|
-
Legacy: set RAPIDKIT_SHOW_LEGACY=1 to reveal template-mode flags in help.`);}};function
|
|
12
|
-
Workspai frontend create plan: ${e.definition.displayName}`)),console.log(i.gray(`Project: ${e.projectName}`)),console.log(i.gray(`Target: ${e.projectPath}`)),console.log(i.gray(`Show: ${
|
|
13
|
-
export{c as a,
|
|
11
|
+
Legacy: set RAPIDKIT_SHOW_LEGACY=1 to reveal template-mode flags in help.`);}};function C(e){let t=L(e);if(!t.validForNewPackages){let r=t.errors||[],a=t.warnings||[],o=[...r,...a];throw new d(e,`NPM validation failed: ${o.join(", ")}`)}if(!/^[a-z][a-z0-9_-]*$/.test(e))throw new d(e,"Must start with a lowercase letter and contain only lowercase letters, numbers, hyphens, and underscores");if(["test","tests","src","dist","build","lib","python","pip","poetry","node","npm","rapidkit","rapidkit"].includes(e.toLowerCase()))throw new d(e,`"${e}" is a reserved name. Please choose a different name.`);if(e.length<2)throw new d(e,"Name must be at least 2 characters long");if(e.length>214)throw new d(e,"Name must be less than 214 characters");return true}function fe(e){let t=U(e.workspacePath,e.result.projectPath)?"imported":"adopted";return {name:e.result.projectName,path:e.result.projectPath,relativePath:W(e.workspacePath,e.result.projectPath),relationship:t,stack:e.result.definition.framework,runtime:"node",framework:e.result.definition.framework,frameworkDisplayName:e.result.definition.displayName,supportTier:"extended",moduleSupport:false,confidence:"high",source:t==="adopted"?"adopted-local":"local-folder",importedAt:e.importedAt??new Date().toISOString()}}function U(e,t){let n=s.relative(s.resolve(e),s.resolve(t));return n===""||n.length>0&&!n.startsWith("..")&&!s.isAbsolute(n)}function W(e,t){return (s.relative(e,t)||".").split(s.sep).join("/")}var A=[{id:"nextjs",kitId:"frontend.nextjs",aliases:["frontend.nextjs","next","nextjs","next.js"],displayName:"Next.js",framework:"nextjs",defaultPort:3e3,commandDisplay:e=>`npx create-next-app@latest ${e}`,commandExec:(e,t)=>({command:"npx",args:["--yes","create-next-app@latest",e,"--yes",...t.skipGit?["--disable-git"]:[],...t.skipInstall?["--skip-install"]:[]]})},{id:"remix",kitId:"frontend.remix",aliases:["frontend.remix","remix","remix-run","react-router"],displayName:"React Router",framework:"remix",defaultPort:5173,commandDisplay:e=>`npx create-react-router@latest ${e}`,commandExec:(e,t)=>({command:"npx",args:["--yes","create-react-router@latest",e,"--yes",...t.skipInstall?["--no-install"]:["--install"],"--no-git-init"]})},{id:"vite-react",kitId:"frontend.vite-react",aliases:["frontend.vite-react","vite-react","react","vite.react"],displayName:"React + Vite",framework:"react",defaultPort:5173,commandDisplay:e=>`npm create vite@latest ${e} -- --template react-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","react-ts","--no-interactive"]})},{id:"vite-vue",kitId:"frontend.vite-vue",aliases:["frontend.vite-vue","vite-vue","vue","vite.vue"],displayName:"Vue + Vite",framework:"vue",defaultPort:5173,commandDisplay:e=>`npm create vite@latest ${e} -- --template vue-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","vue-ts","--no-interactive"]})},{id:"vite-svelte",kitId:"frontend.vite-svelte",aliases:["frontend.vite-svelte","vite-svelte","svelte","vite.svelte"],displayName:"Svelte + Vite",framework:"svelte",defaultPort:5173,commandDisplay:e=>`npm create vite@latest ${e} -- --template svelte-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","svelte-ts","--no-interactive"]})},{id:"vite-solid",kitId:"frontend.vite-solid",aliases:["frontend.vite-solid","vite-solid","solid","solidjs","vite.solid"],displayName:"Solid + Vite",framework:"solid",defaultPort:5173,commandDisplay:e=>`npm create vite@latest ${e} -- --template solid-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","solid-ts","--no-interactive"]})},{id:"vite-vanilla",kitId:"frontend.vite-vanilla",aliases:["frontend.vite-vanilla","vite","vanilla","vite-vanilla"],displayName:"Vite",framework:"vite",defaultPort:5173,commandDisplay:e=>`npm create vite@latest ${e} -- --template vanilla-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","vanilla-ts","--no-interactive"]})},{id:"nuxt",kitId:"frontend.nuxt",aliases:["frontend.nuxt","nuxt","nuxtjs","nuxt.js"],displayName:"Nuxt",framework:"nuxt",defaultPort:3e3,commandDisplay:(e,t)=>`npx create-nuxt@latest ${e} --template minimal --packageManager npm --gitInit ${t?.skipGit?"false":"true"}${t?.skipInstall?" --no-install":""}`,commandExec:(e,t)=>({command:"npx",args:["--yes","create-nuxt@latest",e,"--template","minimal","--packageManager","npm","--gitInit",t.skipGit?"false":"true",...t.skipInstall?["--no-install"]:[]]})},{id:"angular",kitId:"frontend.angular",aliases:["frontend.angular","angular","ng"],displayName:"Angular",framework:"angular",defaultPort:4200,minNodeMajor:18,minNodeMessage:"Angular scaffolding requires Node.js 18.19+ or 20.11+. Upgrade Node, or choose another frontend kit.",commandDisplay:e=>`npx @angular/cli@19 new ${e}`,commandExec:(e,t)=>({command:"npx",args:["--yes","@angular/cli@19","new",e,"--defaults","--skip-git",...t.skipInstall?["--skip-install"]:[]]})},{id:"astro",kitId:"frontend.astro",aliases:["frontend.astro","astro"],displayName:"Astro",framework:"astro",defaultPort:4321,commandDisplay:e=>`npm create astro@4 ${e}`,commandExec:(e,t)=>({command:"npm",args:["create","astro@4",e,"--","--yes",...t.skipInstall?["--no-install"]:[],...t.skipGit?["--no-git"]:[]]})},{id:"sveltekit",kitId:"frontend.sveltekit",aliases:["frontend.sveltekit","sveltekit","svelte-kit"],displayName:"SvelteKit",framework:"sveltekit",defaultPort:5173,commandDisplay:e=>`npx sv@latest create ${e}`,commandExec:(e,t)=>({command:"npx",args:["--yes","sv@latest","create",e,"--template","minimal","--types","ts","--no-add-ons",...t.skipInstall?["--no-install"]:["--install","npm"]]})}],x=new Map;for(let e of A){x.set(e.id,e),x.set(e.kitId,e);for(let t of e.aliases)x.set(t.toLowerCase(),e);}function ge(){return [...A]}function u(e){return e?x.get(e.trim().toLowerCase())??null:null}function ue(e){return !!u(e)}function ke(e){if(e[0]!=="create"||e[1]!=="frontend")return null;let t=e[2],n=e[3],r=e.slice(4),a=u(t);return a?["create","project",a.kitId,n??"",...r].filter(Boolean):["create","project",`frontend.${t??""}`,n??"",...r].filter(Boolean)}function S(e,t){return `workspai create project ${u(e)?.id??e.replace(/^frontend\./,"")} ${t}`}function T(e,t){return `npx ${S(e,t)}`}function z(e){let t=u(e);return t?`${S(t.id,"<name>")} [--output <dir>] [--skip-install] [--dry-run]`:"workspai create project <nextjs|remix|vite-react|vite-vue|vite-svelte|vite-solid|vite-vanilla|nuxt|angular|astro|sveltekit> <name> [--output <dir>] [--skip-install] [--dry-run]"}async function ve(e){let t=e.args;if(t[0]!=="create"||t[1]!=="project")throw new Error("Frontend create expects normalized args: create project <frontend.kit> <name>");let n=u(t[2]);if(!n)throw new Error(`Unknown frontend generator: ${t[2]??"(missing)"}`);let r=t[3];if(!r)throw new Error(`Usage: ${z(n.id)}`);C(r),K(n);let a=X(t,"--output")||process.cwd(),o=s.resolve(a,r),p=e.dryRun===true||t.includes("--dry-run"),g=t.includes("--skip-install"),f=t.includes("--skip-git")||t.includes("--no-git"),l=n.commandExec(r,{skipGit:f,skipInstall:g}),k=n.commandDisplay(r,{skipGit:f,skipInstall:g});if(await m.pathExists(o))throw new Error(`Directory "${o}" already exists`);if(p)return B({definition:n,projectName:r,projectPath:o,commandPlan:l}),{definition:n,projectName:r,projectPath:o,dryRun:p,commandDisplay:k,commandExec:[l.command,...l.args]};await m.ensureDir(s.dirname(o));let v=await M(l.command,l.args,s.dirname(o)),w=await q(o);if(v!==0&&!w)throw new Error(`Official ${n.displayName} generator failed with exit code ${v}`);return v!==0&&w&&console.log(i.yellow(`\u26A0\uFE0F Official ${n.displayName} generator exited with code ${v}, but the scaffold looks complete. Continuing Workspai project setup...`)),f||await H(o),await Y({definition:n,projectName:r,projectPath:o,commandDisplay:k,commandExec:[l.command,...l.args],skipGit:f,skipInstall:g}),console.log(i.green(`\u2705 ${n.displayName} project created at ${o}`)),console.log(i.gray(` Display command: ${T(n.id,r)}`)),console.log(i.gray(" Next: cd "+r+" && npx workspai dev")),{definition:n,projectName:r,projectPath:o,dryRun:p,commandDisplay:k,commandExec:[l.command,...l.args]}}async function Y(e){let t=new Date().toISOString(),n=await c$1(),r={schema_version:"1.0",name:e.projectName,slug:e.projectName,kind:"frontend",project_type:"frontend",runtime:"node",framework:e.definition.framework,framework_display_name:e.definition.displayName,kit_name:e.definition.kitId,kit:e.definition.kitId,engine:"npm",support_tier:"extended",module_support:false,modules:[],workspai_version:n,rapidkit_version:n,generated_by:"workspai",generated_at:t,frontend:{generator:e.definition.id,official_generator:true,default_port:e.definition.defaultPort,command_display:e.commandDisplay,command_exec:e.commandExec,skip_install:e.skipInstall,skip_git:e.skipGit},contracts:{owns:[],apis:[],publishes:[],consumes:[],dependsOn:[],env:[]}},a={project:e.projectName,runtime:"node",framework:e.definition.framework,kind:"frontend",source:"official-generator"},o={kind:"workspai.frontend_create",schema_version:"1.0",generated_at:t,project:{name:e.projectName,path:e.projectPath,kind:"frontend",runtime:"node",framework:e.definition.framework,framework_display_name:e.definition.displayName,kit_name:e.definition.kitId},generator:{id:e.definition.id,command_display:e.commandDisplay,command_exec:e.commandExec}};for(let[p,g]of [["project.json",r],["context.json",a],["frontend-create.json",o]]){let f=q$1(e.projectPath,p);await m.ensureDir(s.dirname(f)),await m.writeJson(f,g,{spaces:2});}}function B(e){console.log(i.bold(`
|
|
12
|
+
Workspai frontend create plan: ${e.definition.displayName}`)),console.log(i.gray(`Project: ${e.projectName}`)),console.log(i.gray(`Target: ${e.projectPath}`)),console.log(i.gray(`Show: ${T(e.definition.id,e.projectName)}`)),console.log(i.gray(`Run: ${[e.commandPlan.command,...e.commandPlan.args].join(" ")}`)),console.log(i.gray(`Default: http://localhost:${e.definition.defaultPort}`));}function J(){let e=Number.parseInt(process.versions.node.split(".")[0]??"",10);return Number.isFinite(e)?e:0}function K(e){if(!(!e.minNodeMajor||J()>=e.minNodeMajor))throw new Error(e.minNodeMessage??`${e.displayName} requires Node.js ${e.minNodeMajor}+ (current: ${process.versions.node}).`)}async function q(e){if(!await m.pathExists(e))return false;let t=s.join(e,"package.json");return await m.pathExists(t)?true:(await m.readdir(e)).length>0}async function H(e){let t=s.join(e,".git");if(await m.pathExists(t))return;if(await b$1(e)){console.log(i.gray(" Git initialization skipped; target is inside an existing git worktree."));return}if(await M("git",["init"],e)===0){console.log(i.gray(" Git repository initialized."));return}console.log(i.yellow("\u26A0\uFE0F Git initialization was skipped or failed. You can run `git init` manually inside the project."));}async function M(e$1,t,n){let r=e(e$1);return await new Promise(a$1=>{let o=spawn(r.command,[...r.prefixArgs,...t],{cwd:n,stdio:"inherit",shell:c$2(),env:e$1==="git"?a(g()):g()});o.on("close",p=>a$1(p??1)),o.on("error",()=>a$1(1));})}function X(e,t){let n=e.indexOf(t);if(n>=0&&n+1<e.length)return e[n+1];let r=e.find(a=>a.startsWith(`${t}=`));return r?r.slice(t.length+1):void 0}
|
|
13
|
+
export{c as a,E as b,D as c,b as d,_ as e,R as f,F as g,C as h,fe as i,ge as j,u as k,ue as l,ke as m,z as n,ve as o};
|