workspai 0.43.1 → 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 +23 -10
- 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-244S5K6I.js → artifact-remediation-plan-Z7OCSME3.js} +2 -2
- 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-FDDDQMJ2.js → chunk-5PVEQ6CZ.js} +1 -1
- package/dist/{chunk-DOCPUNWS.js → chunk-7EIMPQR3.js} +1 -1
- package/dist/{chunk-U6AXYUQY.js → chunk-7IHLTPZ6.js} +1 -1
- package/dist/chunk-7RIWU5TZ.js +1 -0
- 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-EMTQ6OKI.js → chunk-JP25YL3J.js} +1 -1
- 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-ONU457VN.js → chunk-M4VITK6X.js} +52 -50
- package/dist/chunk-NTXO7BMH.js +4 -0
- package/dist/{chunk-PPHTYJ7G.js → chunk-OW4UNG27.js} +36 -37
- package/dist/chunk-P4SWTY5X.js +33 -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-42RTNLH2.js → create-DFAWAS5C.js} +1 -1
- package/dist/doctor-PVSWDBJL.js +1 -0
- package/dist/index.d.ts +250 -24
- package/dist/index.js +194 -195
- package/dist/pipeline-ND734AJM.js +5 -0
- package/dist/{platform-capabilities-XAVU4HSM.js → platform-capabilities-YICBF4FA.js} +1 -1
- package/dist/{pythonRapidkitExec-GCQ3M46E.js → pythonRapidkitExec-UJYIB6FL.js} +1 -1
- package/dist/{workspace-DZHWB7BV.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-2TA27LGT.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-FQWHPQGX.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-F3B75TYT.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-OAATQV5T.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 +26 -14
- package/scripts/enterprise-package-smoke.mjs +40 -8
- package/scripts/prepack-enterprise.mjs +8 -0
- package/dist/analyze-5BU4QIPK.js +0 -1
- package/dist/autopilot-release-45YVOBQO.js +0 -1
- package/dist/chunk-3QVTWKUI.js +0 -4
- package/dist/chunk-753LOKFZ.js +0 -2
- package/dist/chunk-AMDKXXLP.js +0 -1
- package/dist/chunk-AQ4XZZC6.js +0 -1
- package/dist/chunk-CDE4Q77U.js +0 -2
- package/dist/chunk-DNAY5ALC.js +0 -1
- package/dist/chunk-FHSMY75W.js +0 -1
- package/dist/chunk-FM7GMFZA.js +0 -2
- package/dist/chunk-HV5ZFXAZ.js +0 -13
- package/dist/chunk-LRW2SAGL.js +0 -4
- package/dist/chunk-LTWYYP6E.js +0 -7
- package/dist/chunk-NAAQMSO3.js +0 -1
- package/dist/chunk-NFUXULIF.js +0 -1
- package/dist/chunk-OL64GWQC.js +0 -9
- package/dist/chunk-SI3AQKIP.js +0 -1
- package/dist/chunk-TH5Y3EMA.js +0 -33
- package/dist/chunk-UQKCCWUL.js +0 -78
- package/dist/chunk-XNGANEXM.js +0 -2
- package/dist/doctor-DK4BON3N.js +0 -1
- package/dist/pipeline-HQ57V6OZ.js +0 -5
- package/dist/workspace-agent-sync-5ADIQS7B.js +0 -1
- package/dist/workspace-archive-GCZNI44O.js +0 -3
- package/dist/workspace-context-GEXDHA7A.js +0 -1
- package/dist/workspace-explain-D5NNL3NG.js +0 -1
- package/dist/workspace-explain-contract-DNS2YEL7.js +0 -1
- package/dist/workspace-intelligence-BEM6WGCZ.js +0 -1
- package/dist/workspace-mcp-serve-OMBA5V3C.js +0 -3
- package/dist/workspace-registry-summary-6MFBRWDS.js +0 -1
- package/dist/workspace-run-3WJXIQKR.js +0 -1
- package/dist/workspace-watch-HU2OTQ52.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-244S5K6I.js → artifact-remediation-plan-Z7OCSME3.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {a
|
|
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
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=[
|
|
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,4 +1,4 @@
|
|
|
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-
|
|
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-JHC6SCJC.js';import {j as j$1}from'./chunk-
|
|
1
|
+
import {b as b$1}from'./chunk-JHC6SCJC.js';import {j as j$1}from'./chunk-5PVEQ6CZ.js';import {c}from'./chunk-P424XYHP.js';import {a}from'./chunk-Y45WZR5N.js';import {f}from'./chunk-7YHK5NM3.js';import {b}from'./chunk-RO73VVHW.js';import {h,g}from'./chunk-5XATWNME.js';import {promises}from'fs';import i from'path';import P,{homedir}from'os';import {pathToFileURL}from'url';import l from'process';function W(e){let t=e.label.indexOf(" \u2014 ");return t>=0?e.label.slice(t+3).trim():e.label.trim()}function j(){let e=c().map(t=>({value:t.id,label:W(t),hint:t.description,name:t.label})),o=j$1().map(t=>({value:t.kitId,label:t.displayName,hint:t.commandDisplay("my-app"),name:`${t.displayName} \u2014 ${t.framework}`}));return [...e,...o]}var E=".workspairc.json",D=".rapidkitrc.json",U=["workspai.config.js","workspai.config.mjs","workspai.config.cjs","rapidkit.config.js","rapidkit.config.mjs","rapidkit.config.cjs"];function I(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}function x(e,o){let t=o instanceof Error?o.message:String(o),n=e.endsWith(".js")&&/module is not defined in ES module scope/i.test(t)?' CommonJS syntax in a .js config is not valid when the project package uses "type": "module"; rename the file to .cjs or use export default.':"";return `Failed to load Workspai config at ${e}.${n} Cause: ${t}`}async function he(){for(let e of [i.join(P.homedir(),E),i.join(P.homedir(),D)])try{let o=await promises.readFile(e,"utf-8"),t=JSON.parse(o);return f.debug(`Loaded config from ${e}`),t}catch{}return f.debug("No user config found, using defaults"),{}}async function ke(e=process.cwd()){let o=e,t=i.parse(o).root;for(;o!==t;){for(let n of U){let r=i.join(o,n);try{await promises.access(r);}catch(s){if(I(s))continue;throw new Error(x(r,s))}f.debug(`Found config file: ${r}`);try{let d=await import(pathToFileURL(r).href),u=d.default||d;return f.debug(`Loaded Workspai config from ${n}`),u}catch(s){throw new Error(x(r,s))}}o=i.dirname(o);}return f.debug("No Workspai config file found, using defaults"),{}}function ye(e,o,t){return {author:t.author||o.workspace?.defaultAuthor||e.author,pythonVersion:t.pythonVersion||o.workspace?.pythonVersion||e.pythonVersion,defaultInstallMethod:t.defaultInstallMethod||o.workspace?.installMethod||e.defaultInstallMethod,defaultKit:t.defaultKit||o.projects?.defaultKit||e.defaultKit,skipGit:t.skipGit??o.projects?.skipGit??e.skipGit,license:t.license||e.license,testRapidKitPath:t.testRapidKitPath||e.testRapidKitPath}}function we(e){return a("DEV_PATH")||e.testRapidKitPath||void 0}function M(e,o){let t=e.indexOf(o);if(t>=0&&t+1<e.length)return e[t+1];let n=e.find(r=>r.startsWith(`${o}=`));if(n)return n.slice(o.length+1)}function S(e){return e.includes("--here")}function v(e,o=l.cwd()){if(S(e))return i.resolve(o);let t=M(e,"--output");if(t)return i.resolve(t)}function Fe(e,o=l.cwd()){let t=i.resolve(e),n=i.resolve(o),r=i.relative(n,t);return r.length>0&&!r.startsWith("..")&&!i.isAbsolute(r)?`cd ${r}`:`cd ${t}`}function Ee(e,o={}){let t=o.argv??[],n=o.outputParent??v(t,l.cwd());return h(e.trim(),{homeDir:o.homeDir,outputDir:n})}function De(e,o,t={}){return e?i.resolve(e)===i.resolve(o)?true:t.outputParent===void 0:false}async function Ue(e,o={}){let t=o.cwd??l.cwd(),n=o.homeDir??homedir(),r=v(e,t);if(r!==void 0)return r;let s=o.hasYes??(e.includes("--yes")||e.includes("-y"));if(!(o.interactive??(!s&&!!l.stdin.isTTY&&!b())))return;let u=g(n),{location:K}=await b$1([{type:"rawlist",name:"location",message:"Where should the workspace be created?",choices:[{value:"managed",label:"Managed home",hint:u},{value:"here",label:"Current directory",hint:t}],default:0}]);if(K==="here")return i.resolve(t)}export{j as a,he as b,ke as c,ye as d,we as e,Fe as f,Ee as g,De as h,Ue as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-JICOD2GI.js';import {a,b as b$1}from'./chunk-S5KTATOU.js';function f(r){let s=new Map;for(let n of r.projects)s.has(n.name)||s.set(n.name,b(n));return s}function j(r){let s=f(r),n=r.graph??{nodes:r.projects.map(t=>({id:t.name,path:t.path})),edges:[]},a$1=a(n),o=new Map;for(let t of n.nodes){let e=s.get(t.id)??b({missing:t.id}),g=[...b$1(a$1,[t.id],{direction:"dependencies"}).keys()].filter(c=>c!==t.id).sort((c,l)=>c.localeCompare(l)).map(c=>({id:c,hash:s.get(c)??"<unknown>"}));o.set(t.id,{id:t.id,ownHash:e,transitiveInputsHash:b({own:e,dependencies:g})});}return o}function v(r,s){if(!s||Object.keys(s).length===0)return {verdict:"unknown",baseline:"none",changed:[],added:[],removed:[]};let n=[],a=[];for(let[e,i]of r.entries())e in s?s[e]!==i.transitiveInputsHash&&n.push(e):a.push(e);let o=[];for(let e of Object.keys(s))r.has(e)||o.push(e);return n.sort((e,i)=>e.localeCompare(i)),a.sort((e,i)=>e.localeCompare(i)),o.sort((e,i)=>e.localeCompare(i)),{verdict:n.length>0||a.length>0||o.length>0?"stale":"fresh",baseline:"recorded",changed:n,added:a,removed:o}}function w(r){let s={};for(let[n,a]of [...r.entries()].sort((o,t)=>o[0].localeCompare(t[0])))s[n]=a.transitiveInputsHash;return s}export{f as a,j as b,v as c,w as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i="workspai-workspace-archive-capabilities-v1",r="workspai-workspace-archive-manifest-v1",s="workspai-workspace-archive-operation-result-v1";var a="contracts/workspace-archive-manifest.v1.json",o="contracts/workspace-archive-operation-result.v1.json",n={archiveCompression:{signature:"--archive-compression <mode>",description:"Archive compression: store (default) or deflate",appliesTo:["export"]},maxDownloadSize:{signature:"--max-download-size <size>",description:"Optional maximum remote archive download size (for example 8gb)",appliesTo:["inspect","verify","doctor","hydrate"]},maxExpandedSize:{signature:"--max-expanded-size <size>",description:"Optional maximum expanded archive payload size (for example 20gb)",appliesTo:["inspect","verify","doctor","hydrate"]},downloadTimeoutMs:{signature:"--download-timeout-ms <ms>",description:"Remote archive download timeout in milliseconds; 0 disables it",appliesTo:["inspect","verify","doctor","hydrate"]}};export{i as a,r as b,s as c,a as d,o as e,n as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {e,g}from'./chunk-FWJV7CCI.js';import {o as o$1}from'./chunk-5XATWNME.js';import u from'fs';import d from'path';var a="workspace-run-v1",p="workspace-run-last.json",o=`.workspai/reports/${p}`;var m=new Set(["init","test","build","start"]);function A(e){return m.has(e)}async function w(e){try{return await u.promises.access(e,u.constants.F_OK),true}catch{return false}}async function W(e){try{let r=await u.promises.readFile(e,"utf-8");return JSON.parse(r)}catch{return null}}function S(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function P(e){let r=e.stage;return typeof r!="string"||r.trim().length===0||!Array.isArray(e.projects)?false:A(r)||/^[a-z][a-z0-9_-]*$/i.test(r)}function _(e){let r=S(e);return !r||r.schemaVersion===a?false:P(r)}function h(e){let r=S(e);return r?r.schemaVersion===a&&r.stages!=null:false}function R(e){if(h(e))return e;if(_(e)){let r=e.stage;return {schemaVersion:a,generatedAt:e.generatedAt,workspacePath:e.workspacePath,latestStage:r,stages:{[r]:e},enterpriseControls:e.enterpriseControls??{jsonReady:true,evidencePath:o}}}return null}function x(e,r){let n=R(e);if(!n)return null;let t=r??n.latestStage;return n.stages[t]??null}async function L(e){let r=(await Promise.all(o$1(d.resolve(e),"reports",p).map(async t=>await w(t)?t:null))).find(t=>typeof t=="string");if(!r)return null;let n=await W(r);return R(n)}async function I(e$1,r){let n=d.resolve(e$1);return e(n,o,async()=>{let t=(await Promise.all(o$1(n,"reports",p).map(async s=>await w(s)?s:null))).find(s=>typeof s=="string"),l=t?await W(t):null,i=R(l);if(t&&!i)throw new Error(`Workspace run evidence is unreadable or invalid; refusing to overwrite: ${t}`);let g$1=i?{...i.stages}:{};g$1[r.stage]=r;let k={schemaVersion:a,generatedAt:r.generatedAt,workspacePath:r.workspacePath,latestStage:r.stage,stages:g$1,enterpriseControls:{jsonReady:true,evidencePath:o}};return await g(n,o,k),k})}export{p as a,o as b,x as c,L as d,I as e};
|