workspai 0.43.1 → 0.45.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 +28 -11
- 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/cli-runtime-command-inventory.v1.snapshot.json +1368 -0
- package/contracts/command-capabilities.v1.json +303 -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 +48 -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 +339 -0
- package/contracts/runtime-command-surface.v1.json +1680 -11
- 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-YLV7NVLF.js +1 -0
- package/dist/{artifact-remediation-plan-244S5K6I.js → artifact-remediation-plan-WLZGROUU.js} +2 -2
- package/dist/autopilot-release-YBN3SWAA.js +1 -0
- package/dist/{chunk-LZQNVH7D.js → chunk-2K3GYCPS.js} +1 -1
- package/dist/chunk-2QOWRBQD.js +1 -0
- package/dist/chunk-42G2OK64.js +1 -0
- package/dist/chunk-5AKYMAIL.js +1 -0
- package/dist/chunk-5GNT4RJI.js +8 -0
- package/dist/{chunk-FDDDQMJ2.js → chunk-5PVEQ6CZ.js} +1 -1
- package/dist/chunk-6AA3WWQZ.js +2 -0
- package/dist/chunk-6ZENXBMG.js +33 -0
- package/dist/chunk-7RIWU5TZ.js +1 -0
- package/dist/chunk-BJLE5CH7.js +4 -0
- package/dist/{chunk-PPHTYJ7G.js → chunk-DXPU4DDV.js} +36 -37
- package/dist/{chunk-DOCPUNWS.js → chunk-G3H5R3RR.js} +1 -1
- package/dist/chunk-HYJK7W3B.js +1 -0
- package/dist/chunk-IMUU5Q2V.js +13 -0
- package/dist/chunk-J4AICQFB.js +1 -0
- package/dist/{chunk-EMTQ6OKI.js → chunk-JP25YL3J.js} +1 -1
- package/dist/{chunk-ONU457VN.js → chunk-K63BSU56.js} +52 -50
- package/dist/chunk-KPPGZCUW.js +78 -0
- package/dist/chunk-KU4S7RCM.js +1 -0
- package/dist/chunk-LCRROMRR.js +2 -0
- package/dist/chunk-LG6RFLPZ.js +1 -0
- package/dist/{chunk-JHC6SCJC.js → chunk-NHN4QXPP.js} +1 -1
- package/dist/{chunk-U6AXYUQY.js → chunk-OOOPYUL2.js} +1 -1
- package/dist/chunk-P7SCWJFG.js +8 -0
- package/dist/chunk-QWU2CZBG.js +2 -0
- package/dist/chunk-V2H2KRMZ.js +1 -0
- package/dist/chunk-WANW4QA4.js +4 -0
- package/dist/chunk-XIVFLY6G.js +1 -0
- package/dist/chunk-ZWO6K24C.js +2 -0
- package/dist/{create-42RTNLH2.js → create-KFR6FLRT.js} +1 -1
- package/dist/doctor-YJDM5XBH.js +1 -0
- package/dist/index.d.ts +284 -25
- package/dist/index.js +214 -204
- package/dist/pipeline-FEDYO3IA.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-PLXOO6ST.js} +1 -1
- package/dist/workspace-agent-sync-G5YVI3BJ.js +1 -0
- package/dist/workspace-archive-EEGLHZDW.js +10 -0
- package/dist/workspace-context-E3UFWL5X.js +1 -0
- package/dist/{workspace-contract-2TA27LGT.js → workspace-contract-LQJDZV36.js} +1 -1
- package/dist/workspace-explain-G74ZIF23.js +1 -0
- package/dist/workspace-explain-contract-KT757JGQ.js +1 -0
- package/dist/{workspace-feedback-R6H4UFZB.js → workspace-feedback-YY6WQPWQ.js} +1 -1
- package/dist/{workspace-foundation-FQWHPQGX.js → workspace-foundation-3C2DLCVI.js} +1 -1
- package/dist/{workspace-history-CGCK2DJI.js → workspace-history-VF3CHDYQ.js} +1 -1
- package/dist/workspace-intelligence-3GG7GEDQ.js +1 -0
- package/dist/workspace-mcp-serve-MJMUV4RY.js +3 -0
- package/dist/{workspace-model-F3B75TYT.js → workspace-model-NG45SRM5.js} +1 -1
- package/dist/workspace-registry-summary-JM2XY52C.js +1 -0
- package/dist/workspace-run-WEQYIERE.js +1 -0
- package/dist/{workspace-verify-OAATQV5T.js → workspace-verify-ZNT6JX7D.js} +1 -1
- package/dist/workspace-watch-W47T4RX2.js +1 -0
- package/docs/AI_FEATURES.md +67 -34
- package/docs/README.md +2 -1
- package/docs/commands-reference.md +39 -14
- package/docs/contracts/ARTIFACT_CATALOG.md +60 -36
- package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +27 -6
- 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 +27 -14
- package/scripts/enterprise-package-smoke.mjs +40 -8
- package/scripts/prepack-enterprise.mjs +12 -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-P7SCWJFG.js';
|
package/dist/{artifact-remediation-plan-244S5K6I.js → artifact-remediation-plan-WLZGROUU.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {a
|
|
1
|
+
import {a}from'./chunk-2E6WGUN6.js';import {c,g,d}from'./chunk-6AA3WWQZ.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-5GNT4RJI.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 @@
|
|
|
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
|
+
import {c as c$1}from'./chunk-KU4S7RCM.js';import {a as a$2,b as b$2}from'./chunk-PYCJWW4B.js';import {b as b$1,c,d}from'./chunk-OOOPYUL2.js';import {j,a as a$1,o,g as g$1,d as d$1,p,f as f$1}from'./chunk-ZWO6K24C.js';import {n,b as b$3}from'./chunk-HYJK7W3B.js';import {a as a$3}from'./chunk-QWU2CZBG.js';import {f,g}from'./chunk-6AA3WWQZ.js';import {a as a$4}from'./chunk-LG6RFLPZ.js';import {b,a}from'./chunk-5AKYMAIL.js';import m from'path';import v from'fs-extra';var re="rapidkit-blocker-resolution-v1";function ie(e){let t=e.blockers.map(s=>s.trim()).filter(Boolean).slice(0,12),r=e.stderrTail?.trim().slice(-400)??"";return b$3({blockers:t,exitCode:e.exitCode??null,stderrTail:r})}function me(e){let t=e.trim().toLowerCase();return t?t.includes("missing evidence")||t.includes(": missing")||t.includes("artifact missing")||t.includes("not found on disk")?"artifact-missing":t.includes("policy.")||t.includes("contract")?"config-fixable":t.includes("impact")||t.includes("untracked")||t.includes("grounding")?"semantic-attention":t.includes("failed")||t.includes("blocked")||t.includes(": fail")?"command-failed-repeat":"config-fixable":"unresolvable-without-human"}function ge(e){let t=me(e.reason),r=ie({blockers:[e.reason]}),s=t==="artifact-missing"?[{actionKind:"run-once",detail:e.sourceCommand?`Run the source command once: ${e.sourceCommand}`:"Run the mapped workspace intelligence command once to generate the missing artifact.",studioActionId:"run-analyze"}]:t==="semantic-attention"?[{actionKind:"commit-files",detail:"Review workspace-level grounding files (AGENTS.md, agent-sync outputs) and commit or refresh the impact baseline."},{actionKind:"refresh-baseline",detail:"Refresh snapshot + diff + impact before re-running verify."}]:[{actionKind:"edit-file",detail:"Apply the smallest safe file or policy fix for this blocker before re-running verification.",studioActionId:"fix-lens"}];return {schemaVersion:re,blockerId:e.blockerId,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,resolutionClass:t,blockerSignature:r,commandRetryHint:t==="artifact-missing"?"Run the source command once, then verify.":"Do not re-run the same failing command; fix the source issue first, then verify.",fixHints:s,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}}function ne(e){return Array.from(new Set(e.blockingReasons.map(r=>r.trim()).filter(Boolean))).slice(0,12).map((r,s)=>ge({reason:r,blockerId:`blocker-${s+1}`,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}))}function ke(e){let t=e.toLowerCase();return t.includes("stale")||t.includes("missing evidence")||t.includes("no projects")||t.includes("projects.empty")||t.includes("projects discovered")||t.includes("projects.missing")||t.includes("not yet run")||t.includes("doctor-last-run")||t.includes("doctor-project-last-run")||t.includes("doctor-remediation-plan-last-run")||t.includes("doctor-fix-result-last-run")||t.includes("pipeline-last-run")||t.includes("release-readiness")||t.includes("analyze-last-run")||t.includes("analyze reported")||t.includes("analyze verdict")||t.includes("analyze needs attention")||t.includes("toolchain.lock")||t.includes("not pinned")||t.includes("readiness:")||t.includes("env:")||t.includes("workspace-run-last")||t.includes("pre-project")||t.includes("before adding projects")||t.includes("workspace.projects.missing")||t.includes("no backend projects")||t.includes("index.json")||t.includes("workspace-intelligence-history")||t.includes("validation warning")||t.includes("workspace model validation")||t.includes("workspace.marker")||t.includes("no project roots")||t.includes("no infrastructure services")||t.includes("infra/overrides")||t.includes("infra dependencies")||t.includes("contract verify")||t.includes("contract inspect")||t.includes("publish verify evidence")}function he(e){return e.length===0||e.every(t=>ke(t))}function oe(e){return e.projectCount>0||e.policyErrorCount>0?{verdict:e.verdict,exitCode:e.exitCode}:e.verdict==="blocked"&&he(e.blockingReasons)?{verdict:"needs-attention",exitCode:1}:{verdict:e.verdict,exitCode:e.exitCode}}function Ge(e,t){let r=t&&t!=="ready"?` (${t.replace(/-/g," ")})`:"";return e===0?`Workspace scaffold ready${r} \u2014 add your first project to continue.`:`Workspace scaffold${r}: ${e} pre-project signal(s) \u2014 add your first project to continue.`}var ce=b.verify,T=a.verify;function ye(e,t){return m.isAbsolute(t)?t:m.join(e,t)}async function ae(e){let t=await v.readJson(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`Workspace impact input is not a JSON object: ${e}`);let r=t;if(r.schemaVersion!==f$1)throw new Error(`Unsupported workspace impact schema: ${String(r.schemaVersion)}`);a$4(t,"contracts/workspace-intelligence/workspace-impact.v1.json",`Workspace impact ${e}`);let s=r;a$4(s.diff,"contracts/workspace-intelligence/workspace-model-diff.v1.json",`Embedded workspace diff in ${e}`);let i=[];s.summary.affectedProjects!==s.affectedProjects.length&&i.push("summary.affectedProjects does not match affectedProjects.length"),s.summary.workspaceItems!==s.workspaceImpact.length&&i.push("summary.workspaceItems does not match workspaceImpact.length"),s.summary.recommendedCommands!==s.verificationPlan.length&&i.push("summary.recommendedCommands does not match verificationPlan.length"),s.summary.blastRadius.directlyAffected!==s.affectedProjects.length&&i.push("blastRadius.directlyAffected does not match affectedProjects.length"),s.summary.blastRadius.transitivelyAffected!==s.transitiveImpact.length&&i.push("blastRadius.transitivelyAffected does not match transitiveImpact.length");let n=s.transitiveImpact.reduce((a,l)=>Math.max(a,l.distance??0),0);s.summary.blastRadius.maxDistance!==n&&i.push("blastRadius.maxDistance does not match transitive impact distances");let g=s.diff.currentModel.graph?.edges.length??0;if(s.summary.blastRadius.graphEdges!==g&&i.push("blastRadius.graphEdges does not match the embedded model graph"),s.summary.changed!==s.diff.summary.changed&&i.push("summary.changed does not match embedded diff summary"),s.fromRef!==s.diff.fromRef&&i.push("fromRef does not match embedded diff fromRef"),s.workspace.name!==s.diff.currentModel.workspace.name&&i.push("workspace.name does not match the embedded model"),s.diff.toHash!==j(s.diff.currentModel)&&i.push("embedded diff current-model hash does not match toHash"),i.length>0)throw new Error(`Workspace impact semantic integrity failed: ${i.join("; ")} (${e})`);return s}function ve(e){let t=new Set,r=[];for(let s of e){let i=`${s.scope}:${s.project??""}:${s.display}`;t.has(i)||(t.add(i),r.push(s));}return r}function be(e,t){if(!e||e==="workspace")return true;let r=(e.startsWith("project:")?e.slice(8):e).trim().toLowerCase();return t.scope==="workspace"?true:(t.project??"").trim().toLowerCase()===r}function we(e,t){if(e.id==="workspace.doctor")return m.join(t,a.doctor);if(e.id==="workspace.contract.verify")return m.join(t,a.contractVerify);if(e.id==="workspace.readiness")return m.join(t,a.readiness);if(e.id==="workspace.analyze")return m.join(t,".workspai","reports","analyze-last-run.json");if(e.id==="workspace.pipeline")return m.join(t,".workspai","reports","pipeline-last-run.json");if(e.id==="workspace.doctor-fix")return m.join(t,".workspai","reports","doctor-fix-result-last-run.json");if(e.id.startsWith("project.")&&e.id.includes("."))return m.join(t,".workspai","reports","workspace-run-last.json")}function C(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function Re(e){let t=C(e.healthScore),r=typeof t?.errors=="number"?t.errors:0,s=typeof t?.percent=="number"?t.percent:void 0;return r>0?{status:"fail",message:`Doctor evidence reports ${r} error(s).`}:typeof s=="number"&&s<70?{status:"warn",message:`Doctor health score is ${s}%.`}:{status:"pass",message:"Doctor evidence is present and healthy."}}function Ce(e){let t=typeof e.overallStatus=="string"?e.overallStatus:"unknown";return t==="fail"?{status:"fail",message:"Release readiness evidence reports blocking failures."}:t==="warn"?{status:"warn",message:"Release readiness evidence reports warnings."}:t==="pass"?{status:"pass",message:"Release readiness evidence passed."}:{status:"warn",message:`Release readiness evidence status is ${t}.`}}function We(e){let t=typeof e.status=="string"?e.status:"unknown";return t==="failed"||t==="fail"?{status:"fail",message:"Workspace contract verify evidence failed."}:t==="passed"||t==="pass"?{status:"pass",message:"Workspace contract verify evidence passed."}:{status:"warn",message:`Workspace contract verify evidence status is ${t}.`}}function xe(e){let t=C(e.summary);if(t?.blocking===true||e.blocking===true)return {status:"fail",message:"Analyze evidence reports blocking findings."};let s=typeof t?.status=="string"?t.status:void 0;return s==="warn"||s==="warning"?{status:"warn",message:"Analyze evidence reports warnings."}:{status:"pass",message:"Analyze evidence is present."}}function je(e){let t=e.schemaVersion==="rapidkit-doctor-fix-result-v1"?e:e.fixResult;if(!t||typeof t!="object"||Array.isArray(t))return {status:"skipped",message:"Doctor fix result not present; run doctor workspace --fix --json to record fixes."};let r=t,s=Array.isArray(r.remainingBlockers)?r.remainingBlockers:[];if(s.length>0)return {status:"fail",message:`Doctor fix result reports ${s.length} remaining blocker(s).`};let i=Array.isArray(r.appliedFixes)?r.appliedFixes:[];return i.length===0?{status:"pass",message:"Doctor fix result recorded with no remaining blockers."}:{status:"pass",message:`Doctor fix result recorded ${i.length} applied fix(es) with no remaining blockers.`}}async function Ae(e,t){let r=await f(e,".workspai/reports/doctor-remediation-plan-last-run.json");if(!r)return false;try{let s=C(await v.readJson(r));if(!s||(Array.isArray(s.steps)?s.steps:[]).length>0)return false;let n=typeof s.generatedAt=="string"?s.generatedAt:void 0;if(!n||!t)return true;let g=Date.parse(n),a=Date.parse(t);return !Number.isFinite(g)||!Number.isFinite(a)?true:g>=a}catch{return false}}function Ee(e){return e.id.endsWith(".init")?"init":e.id.endsWith(".test")?"test":e.id.endsWith(".build")?"build":e.id.endsWith(".start")?"start":null}function Se(e){let t=C(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Pipeline evidence is blocked."}:r==="needs-attention"?{status:"warn",message:"Pipeline evidence needs attention."}:r==="ready"?{status:"pass",message:"Pipeline evidence is ready."}:{status:"warn",message:"Pipeline evidence status is unknown."}}function Pe(e,t,r){let s=Ee(t),i=c$1(e,s??void 0);if(!i)return {status:"missing",message:"Workspace run evidence is missing or unreadable."};let n=i.stage;if(s&&n!==s)return {status:"missing",message:`Workspace run evidence is for stage "${n}", expected "${s}".`};let g=Array.isArray(i.projects)?i.projects:[],a=t.project?.toLowerCase();if(!a)return {status:"missing",message:"Project-scoped workspace run evidence is missing a project identifier."};let l=g.find(d=>{let p=C(d);if(!p)return false;let c=typeof p.projectName=="string"?p.projectName.toLowerCase():"",o=["projectPath","relativePath","path"].map(f=>p[f]).filter(f=>typeof f=="string"&&f.trim().length>0).map(f=>f.replace(/\\/g,"/").toLowerCase());return c===a||o.some(f=>f.endsWith(`/${a}`)||f===a)});if(l){let d=R(i.generatedAt,r,`Workspace run evidence for ${t.project??t.id}`);if(d)return {status:"fail",message:d};let p=C(l),c=typeof p?.status=="string"?p.status:"unknown";return c==="failed"?{status:"fail",message:`Workspace run evidence failed for ${t.project}.`}:c==="passed"?{status:"pass",message:`Workspace run evidence passed for ${t.project}.`}:c==="skipped"?{status:"warn",message:`Workspace run evidence skipped for ${t.project}.`}:{status:"warn",message:`Workspace run evidence status is ${c} for ${t.project}.`}}return {status:"missing",message:`Workspace run evidence does not include project ${t.project}.`}}function R(e,t,r){if(!t)return null;if(typeof e!="string"||e.trim().length===0)return `${r} is stale: missing generatedAt timestamp (required after impact ${t}).`;let s=Date.parse(e),i=Date.parse(t);return Number.isFinite(s)?Number.isFinite(i)&&s<i?`${r} is stale: generated at ${e}, before impact ${t}.`:null:`${r} is stale: invalid generatedAt timestamp (required after impact ${t}).`}async function Ie(e,t,r,s){let i=we(e,t),n=i?m.relative(t,i).split(m.sep).join("/"):void 0;if(e.id==="workspace.contract.verify"&&!r)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"skipped",required:e.required,message:"Workspace contract is not present; contract verify skipped."};let g=i?await f(t,n??""):null;if(!i||!g)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"missing",required:e.required,evidencePath:n,message:n?`Missing evidence report: ${n}`:"No evidence mapping exists for this command."};let a=C(await v.readJson(g));if(!a)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:n,message:"Evidence report is not a JSON object."};let l;if(e.id==="workspace.doctor"){let d=R(a.generatedAt,s,"Doctor evidence");d?l={status:"fail",message:d}:l=Re(a);}else if(e.id==="workspace.readiness"){let d=R(a.generatedAt,s,"Release readiness evidence");d?l={status:"fail",message:d}:l=Ce(a);}else if(e.id==="workspace.contract.verify"){let d=R(a.generatedAt,s,"Workspace contract verify evidence");d?l={status:"fail",message:d}:l=We(a);}else if(e.id==="workspace.analyze"){let d=R(a.generatedAt,s,"Analyze evidence");d?l={status:"fail",message:d}:l=xe(a);}else if(e.id==="workspace.pipeline"){let d=R(a.generatedAt,s,"Pipeline evidence");d?l={status:"fail",message:d}:l=Se(a);}else if(e.id==="workspace.doctor-fix"){let d=a.schemaVersion==="rapidkit-doctor-fix-result-v1"?a:a.fixResult,p=C(d),c=typeof p?.generatedAt=="string"?p.generatedAt:void 0,o=R(c,s,"Doctor fix result");o?l={status:"fail",message:o}:await Ae(t,c)?l={status:"skipped",message:"No current doctor remediation steps are pending."}:l=je(a);}else if(e.id.startsWith("project."))l=Pe(a,e,s);else {let d=R(a.generatedAt,s,"Evidence report");d?l={status:"fail",message:d}:l={status:"pass",message:"Evidence report is present."};}return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:l.status,required:e.required,evidencePath:n,message:l.message}}function Ve(e,t={blockingReasons:[],needsAttention:false}){let r=e.filter(c=>c.status==="pass").length,s=e.filter(c=>c.status==="warn").length,i=e.filter(c=>c.status==="fail").length,n=e.filter(c=>c.status==="missing").length,g=e.filter(c=>c.status==="skipped").length,a=e.filter(c=>c.required&&(c.status==="fail"||c.status==="missing")).map(c=>`${c.id}: ${c.message}`),l=e.filter(c=>c.required&&c.status==="missing").length,d="ready",p=0;return a.length>0||t.blockingReasons.length>0?(d="blocked",p=2):(s>0||l>0||t.needsAttention)&&(d="needs-attention",p=1),{verdict:d,exitCode:p,stepsPassed:r,stepsWarn:s,stepsFailed:i,stepsMissing:n,stepsSkipped:g}}function $e(e,t){let r=x(e.affectedProjects.map(o=>o.project?.name).filter(o=>typeof o=="string")),s=new Set(r.map(o=>o.toLowerCase())),i=x(e.transitiveImpact.map(o=>o.project?.name).filter(o=>typeof o=="string").filter(o=>!s.has(o.toLowerCase()))),n=new Map;for(let o of t){if(o.scope!=="project"||!o.project)continue;let f=o.project.toLowerCase(),h=n.get(f)??[];h.push(o),n.set(f,h);}let g=[],a=[],l=[],d=[],p=false,c=(o,f)=>{let h=n.get(o.toLowerCase())??[];if(h.length===0){l.push(o);return}let j=h.filter(k=>k.status==="fail"),b=h.filter(k=>k.status==="missing"),A=b.filter(k=>k.required),E=h.some(k=>k.status==="pass"||k.status==="warn");if(j.length>0){a.push(o),d.push(`graph.subgraph.${o}: ${f} has failed verification evidence (${j.map(k=>k.id).join(", ")}).`);return}if(A.length>0){a.push(o),d.push(`graph.subgraph.${o}: ${f} has missing required verification evidence (${A.map(k=>k.id).join(", ")}).`);return}if(b.length>0){a.push(o),p=true;return}if(E){g.push(o);return}l.push(o);};for(let o of r)c(o,"directly-changed");for(let o of i)c(o,"transitive dependent");return {subgraph:{totalProjects:r.length+i.length,directlyChanged:r,transitiveDependents:i,covered:x(g),uncovered:x(a),unverifiable:x(l)},blockingReasons:d,needsAttention:p}}function x(e){return [...new Set(e)].sort((t,r)=>t.localeCompare(r))}async function Fe(e){let t=m.resolve(e.workspacePath);if(e.fromImpactPath){let n=ye(t,e.fromImpactPath);return {impact:await ae(n),fromImpactRef:m.relative(t,n).split(m.sep).join("/"),impactFromDisk:true}}let r=m.join(t,g$1);if(await v.pathExists(r))return {impact:await ae(r),fromImpactRef:g$1,impactFromDisk:true};let s=m.join(t,d$1);if(await v.pathExists(s))return {impact:await p({workspacePath:t,fromPath:d$1,scope:e.scope,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now}),fromImpactRef:d$1,impactFromDisk:false};let i=await n({workspacePath:t,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now});return {impact:{schemaVersion:f$1,generatedAt:(e.now??new Date).toISOString(),fromRef:"baseline",diffRef:a.diff,workspace:{name:i.workspace.name,profile:i.workspace.profile,type:i.workspace.type},summary:{changed:false,risk:"none",affectedProjects:0,workspaceItems:0,recommendedCommands:0,blastRadius:{directlyAffected:0,transitivelyAffected:0,maxDistance:0,graphEdges:i.graph?.edges.length??0}},affectedProjects:[],transitiveImpact:[],criticalPathHotspots:[],workspaceImpact:[],verificationPlan:[],agentBrief:{headline:"Baseline workspace verify run.",bullets:["No impact report or snapshot was available; baseline gates were evaluated."],unsafeAssumptions:["Do not claim runtime verification passed unless evidence exists."]},diff:{schemaVersion:b.diff,generatedAt:(e.now??new Date).toISOString(),fromRef:"baseline",toRef:a.model,fromHash:"baseline",toHash:"baseline",summary:{changed:false,addedProjects:0,removedProjects:0,changedProjects:0,workspaceChanges:0,validationChanges:0,gitChangedFiles:0},git:{available:false,dirty:false,changedFiles:0,untrackedFiles:0,deletedFiles:0},changes:[],currentModel:i}},impactFromDisk:false}}function Oe(e,t){if(t)return e.generatedAt}async function lt(e){let t=m.resolve(e.workspacePath),{impact:r,fromImpactRef:s,impactFromDisk:i}=await Fe(e),n$1=r.diff.currentModel,g=i?await n({workspacePath:t,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now}):n$1,a=[];i&&j(g)!==r.diff.toHash&&a.push("workspace.impact: Impact evidence is stale because the current workspace model no longer matches the embedded model. Regenerate diff and impact.");let l=r.diff.git;if(i&&l?.available){let u=a$1(t,{ref:l.ref}),pe=r.diff.changes.filter(y=>y.type.startsWith("git.")).map(y=>`${y.type}:${y.target.replace(/^git:/,"")}`).sort(),fe=[...u.changedFiles.map(y=>`git.file.changed:${y}`),...u.untrackedFiles.map(y=>`git.untracked:${y}`),...u.deletedFiles.map(y=>`git.deleted:${y}`)].sort();(!u.available||u.commit!==l.commit||JSON.stringify(fe)!==JSON.stringify(pe))&&a.push("workspace.impact: Impact evidence is stale because Git changes no longer match the diff observation. Regenerate diff and impact.");}let d$1=Oe(r,i),p=ve([...o(),...r.verificationPlan]).filter(u=>be(e.scope,u)),c$1=[];for(let u of p)c$1.push(await Ie(u,t,n$1.contracts.exists===true,d$1));let o$1=$e(r,c$1),f=a$2(n$1.graph??{nodes:[],edges:[]}),h=b$1(n$1),j$1=await _e(t),b=c(h,j$1?.freshness?.projectHashes),A={verdict:b.verdict,baseline:b.baseline,changed:b.changed,added:b.added,removed:b.removed,projectHashes:d(h)},E=b$2(f),k=n$1.policies?.mode??"warn",V=await Be(n$1,t),$=De(k,V),W=Ve(c$1,{blockingReasons:[...o$1.blockingReasons,...E,...$.blockingReasons,...a],needsAttention:o$1.needsAttention||$.needsAttention}),de=c$1.filter(u=>u.status==="missing"&&u.evidencePath).map(u=>u.evidencePath),S=[...c$1.filter(u=>u.required&&(u.status==="fail"||u.status==="missing")).map(u=>`${u.id}: ${u.message}`),...o$1.blockingReasons,...E,...$.blockingReasons,...a],le=V.filter(u=>u.severity==="error").length,ue=n$1.summary?.projectCount??n$1.projects.length,L=oe({projectCount:ue,verdict:W.verdict,exitCode:W.exitCode,blockingReasons:S,policyErrorCount:le});W.verdict=L.verdict,W.exitCode=L.exitCode;let K=S.length>0?ne({blockingReasons:S,verifyCommand:"npx workspai workspace verify --from-impact .workspai/reports/workspace-impact-last-run.json --json",verifyArtifact:T}):[];return {schemaVersion:ce,generatedAt:(e.now??new Date).toISOString(),workspacePath:t,mode:"evidence",fromImpactRef:s,scope:e.scope,impact:{changed:r.summary.changed,risk:r.summary.risk,affectedProjects:r.summary.affectedProjects,recommendedCommands:r.summary.recommendedCommands},summary:W,steps:c$1,missingEvidence:de,blockingReasons:S,...K.length>0?{resolutionHints:K}:{},verificationPlan:p,affectedSubgraph:o$1.subgraph,graphIntegrity:f,freshness:A,policyMode:k,policyViolations:V}}async function Be(e,t){let r=[];for(let i of e.validation?.issues??[])r.push({source:"model",severity:i.severity,code:i.code,message:i.message,target:i.target});let s=await f(t,a.contractVerify);try{if(s&&await v.pathExists(s)){let i=await v.readJson(s);if(Array.isArray(i.violations))for(let n of i.violations)typeof n=="string"&&n.trim().length>0&&r.push({source:"contract",severity:"error",code:"contract.violation",message:n});}}catch{}return r.sort((i,n)=>i.source!==n.source?i.source.localeCompare(n.source):i.code!==n.code?i.code.localeCompare(n.code):i.message.localeCompare(n.message))}function De(e,t){let r=t.filter(s=>s.severity==="error");return e==="enforce"&&r.length>0?{blockingReasons:r.map(s=>`policy.${s.code}: ${s.message}`),needsAttention:false}:{blockingReasons:[],needsAttention:r.length>0}}async function _e(e){let t=m.join(e,T);try{if(!await v.pathExists(t))return null;let r=await v.readJson(t);return r&&r.schemaVersion===ce?r:null}catch{return null}}async function ut(e,t){return g(t,T,a$3(e))}function Me(e,t){let r=t?.strict?"strict":"default",s=[];if(e.summary.verdict==="blocked")return s.push(...e.blockingReasons),s.length===0&&s.push("verify verdict is blocked."),{passed:false,mode:r,exitCode:2,reasons:s};if(r==="strict"){if(e.summary.verdict!=="ready"&&s.push(`verify verdict is ${e.summary.verdict} (strict requires ready).`),e.freshness.verdict==="stale"){let i=[...e.freshness.changed,...e.freshness.added].slice(0,5);s.push(`freshness is stale${i.length>0?`: ${i.join(", ")}`:""} (strict requires fresh).`);}if(s.length>0)return {passed:false,mode:r,exitCode:1,reasons:s}}return {passed:true,mode:r,exitCode:0,reasons:s}}function pt(e,t){return Me(e,t).exitCode}export{re as a,Ge as b,ce as c,T as d,$e as e,lt as f,ut as g,Me as h,pt as i};
|
|
@@ -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};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-WANW4QA4.js';import {a as a$4}from'./chunk-22DT744Z.js';import {a as a$2,e}from'./chunk-KU4S7RCM.js';import {f,c,g}from'./chunk-6AA3WWQZ.js';import {a}from'./chunk-5AKYMAIL.js';import a$3 from'chalk';import se from'fs';import b from'path';import {execa}from'execa';var G="autopilot-release-last-run.json",V="autopilot-release.json";function j(r){try{return JSON.parse(r)}catch{return null}}function Re(r){let e=b.resolve(r),n=a$4(e);if(!n)throw new Error("No Workspai workspace found in current directory or parents");return n}async function S(r,e){let n=process.argv[1];if(!n)return {exitCode:1,stdout:"",stderr:"RapidKit entrypoint is unavailable for autopilot execution.",crashed:true};try{let o=await execa(process.execPath,[n,...r],{cwd:e,reject:false,env:{...process.env,RAPIDKIT_AUTOPILOT_CHILD:"1"}});return {exitCode:Number(o.exitCode??1),stdout:o.stdout,stderr:o.stderr,crashed:false}}catch(o){return {exitCode:1,stdout:"",stderr:o instanceof Error?o.message:String(o),crashed:true}}}function re(r){let e=r.toLowerCase();return e==="pass"?"pass":e==="warn"?"warn":e==="fail"?"fail":"warn"}function oe(r){return r.summary.failed>0||r.gates.results.some(e=>e.status==="fail")?"fail":r.gates.results.some(e=>e.status==="warn")?"warn":"pass"}function Se(r){let e=r.filter(o=>o.status!=="skipped");if(e.length===0)return 100;let n=e.reduce((o,t)=>t.status==="pass"?o+1:t.status==="warn"?o+.6:o,0);return Math.round(n/e.length*100)}function be(r){return r.executionError?["Re-run: npx workspai autopilot release --mode audit --json","Inspect .workspai/reports/autopilot-release-last-run.json for execution failure details"]:r.blockers.length>0?["Run: npx workspai doctor workspace --plan","Run: npx workspai readiness --json --strict","Run: npx workspai workspace run test --affected --strict"]:r.hasWarnings&&r.mode!=="enforce"?["Review warning-level findings in autopilot report","Optionally run: npx workspai autopilot release --mode safe-fix"]:["Workspace is release-ready based on current autopilot policy"]}async function xe(r,e){await se.promises.mkdir(b.dirname(r),{recursive:true}),await se.promises.writeFile(r,`${JSON.stringify(e,null,2)}
|
|
2
|
+
`,"utf-8");}async function Me(r){let e$1=Re(r.workspacePath),n=r.mode,o=[],t=[],F,H,D,q,Q,X=0,f$1=false,T=0,L=0,N=-1,W=-1,c$1="skipped",d="skipped",ae=n==="enforce"?["doctor","workspace","--json","--strict"]:["doctor","workspace","--json","--ci"];if(r.skipPipelineStages)o.push({name:"doctor-workspace",status:"skipped",durationMs:0,summary:"doctor stage skipped (pipeline already executed)"},{name:"analyze",status:"skipped",durationMs:0,summary:"analyze stage skipped (pipeline already executed)"},{name:"readiness",status:"skipped",durationMs:0,summary:"readiness stage skipped (pipeline already executed)"});else {let s=Date.now(),l=await S([...ae],e$1),m=Date.now()-s;if(c$1="pass",l.crashed)c$1="fail",f$1=true,t.push(`doctor workspace execution error: ${l.stderr||"unknown error"}`);else if(l.exitCode===1)c$1="fail",t.push("doctor workspace command failed or reported errors");else if(l.exitCode===2)c$1="warn",t.push("doctor workspace reported warnings");else if(l.exitCode!==0)c$1="fail",t.push("doctor workspace command failed");else {let p=j(l.stdout),E=p&&p.healthScore&&typeof p.healthScore=="object"?p.healthScore:{},k=Number(E.errors??0),$=Number(E.warnings??0);Number.isFinite(k)&&k>0?(c$1="fail",t.push(`doctor workspace reports ${k} error(s)`)):Number.isFinite($)&&$>0&&(c$1="warn");}N=o.push({name:"doctor-workspace",status:c$1,durationMs:m,summary:c$1==="pass"?"doctor workspace passed":c$1==="warn"?"doctor workspace reported warnings":"doctor workspace reported errors"})-1,n==="enforce"&&c$1==="warn"&&t.push("doctor workspace reported warnings under enforce mode");let g=Date.now(),w=await S(["analyze","--json"],e$1),v=Date.now()-g;H=await f(e$1,a.analyze)??c(e$1,a.analyze);let i="pass";if(w.crashed)i="fail",f$1=true,t.push(`analyze execution error: ${w.stderr||"unknown error"}`);else if(w.exitCode!==0)i=w.exitCode===2?"warn":"fail",t.push(w.exitCode===2?"analyze reported needs-attention verdict":"analyze command failed or reported blocked verdict");else {let p=j(w.stdout),E=p&&p.summary&&typeof p.summary=="object"?p.summary:{},k=String(E.verdict??"ready");k==="blocked"?(i="fail",t.push("analyze reported blocked verdict")):k==="needs-attention"&&(i="warn");}o.push({name:"analyze",status:i,durationMs:v,summary:i==="pass"?"analyze passed":i==="warn"?"analyze reported needs-attention":"analyze reported blocked verdict"}),n==="enforce"&&i==="warn"&&t.push("analyze reported warnings under enforce mode");let P=Date.now(),h=await S(["readiness","--json"],e$1),y=Date.now()-P;if(d="fail",h.crashed)d="fail",f$1=true,t.push(`readiness execution error: ${h.stderr||"unknown error"}`);else if(h.exitCode!==0)d="fail",t.push("readiness command failed");else {let p=j(h.stdout),E=String(p?.overallStatus??"fail");if(d=re(E),typeof p?.evidencePath=="string"&&p.evidencePath.trim().length>0&&(F=p.evidencePath),d==="fail"){let k=Array.isArray(p?.blockingReasons)?p?.blockingReasons.filter($=>typeof $=="string"):[];k.length>0?t.push(...k.map($=>`readiness: ${$}`)):t.push("readiness overall status is fail");}}W=o.push({name:"readiness",status:d,durationMs:y,summary:`readiness overall status is ${d}`})-1,n==="enforce"&&d==="warn"&&t.push("readiness reported warnings under enforce mode");}let ne=Date.now(),z=await S(["doctor","workspace","--plan","--json"],e$1),ie=Date.now()-ne,R="warn";if(z.crashed)R="fail",f$1=true,t.push(`doctor remediation plan execution error: ${z.stderr||"unknown error"}`);else if(z.exitCode!==0)R="fail",t.push("doctor remediation plan command failed");else {let s=j(z.stdout),l=s&&s.remediationPlan&&typeof s.remediationPlan=="object"?s.remediationPlan:null,m=Number(l?.totalSteps??0),g=Number(l?.executableSteps??0);Number.isFinite(m)&&m>0&&(T=m),Number.isFinite(g)&&g>0&&(L=g),Number.isFinite(m)&&m===0?R="pass":R="warn";}if(o.push({name:"remediation-plan",status:R,durationMs:ie,summary:R==="pass"?"no remediation steps required":"remediation steps available"}),n==="enforce"&&R==="warn"&&t.push("remediation plan has pending steps under enforce mode"),n==="safe-fix"){let s=Date.now(),l=await S(["doctor","workspace","--apply"],e$1),m=Date.now()-s,g=l.crashed||l.exitCode!==0?"fail":"pass";if(l.crashed)f$1=true,t.push(`doctor remediation apply execution error: ${l.stderr||"unknown error"}`);else if(g==="fail")t.push("doctor remediation apply failed");else {X=L>0?L:T>0?T:1;let w=await S(["doctor","workspace","--json"],e$1);if(w.crashed)c$1="fail",f$1=true,t.push(`post-apply doctor execution error: ${w.stderr||"unknown error"}`);else if(w.exitCode!==0)c$1="fail",t.push("post-apply doctor workspace command failed");else {let i=j(w.stdout),P=i&&i.healthScore&&typeof i.healthScore=="object"?i.healthScore:{},h=Number(P.errors??0),y=Number(P.warnings??0);Number.isFinite(h)&&h>0?(c$1="fail",t.push(`post-apply doctor reports ${h} error(s)`)):Number.isFinite(y)&&y>0?c$1="warn":c$1="pass";}N>=0&&(o[N].status=c$1,o[N].summary=`doctor workspace post-apply status is ${c$1}`);let v=await S(["readiness","--json"],e$1);if(v.crashed)d="fail",f$1=true,t.push(`post-apply readiness execution error: ${v.stderr||"unknown error"}`);else if(v.exitCode!==0)d="fail",t.push("post-apply readiness command failed");else {let i=j(v.stdout),P=String(i?.overallStatus??"fail");if(d=re(P),typeof i?.evidencePath=="string"&&i.evidencePath.trim().length>0&&(F=i.evidencePath),d==="fail"){let h=Array.isArray(i?.blockingReasons)?i?.blockingReasons.filter(y=>typeof y=="string"):[];h.length>0?t.push(...h.map(y=>`post-apply readiness: ${y}`)):t.push("post-apply readiness overall status is fail");}}W>=0&&(o[W].status=d,o[W].summary=`readiness post-apply overall status is ${d}`);}o.push({name:"remediation-apply",status:g,durationMs:m,summary:g==="pass"?"safe remediation apply completed":"safe remediation apply failed"});}else o.push({name:"remediation-apply",status:"skipped",durationMs:0,summary:"remediation apply is skipped for this mode"});let le=Date.now(),x="pass",A="workspace test/build completed for selected projects";try{let s=await a$1({workspacePath:e$1,stage:"test",affected:true,since:r.since,parallel:r.parallel,maxWorkers:r.maxWorkers,strict:true,json:true,enforceGates:false});D=c(e$1,b.join(".workspai","reports",a$2)),await e(e$1,s),q=D;let l=oe(s);if(l==="fail")x="fail",A="workspace test stage failed for selected projects",t.push("workspace run test failed for selected projects");else {l==="warn"&&(x="warn",A="workspace test stage completed with warnings",n==="enforce"&&t.push("workspace run test reported warnings under enforce mode"));let m=await a$1({workspacePath:e$1,stage:"build",affected:true,since:r.since,parallel:r.parallel,maxWorkers:r.maxWorkers,strict:true,json:true,enforceGates:false});await e(e$1,m),Q=D;let g=oe(m);g==="fail"?(x="fail",A="workspace build stage failed for selected projects",t.push("workspace run build failed for selected projects")):g==="warn"&&(x="warn",A="workspace test/build completed with warnings",n==="enforce"&&t.push("workspace run test/build reported warnings under enforce mode"));}}catch(s){x="fail",A="workspace test/build orchestration failed",f$1=true,t.push(`workspace run orchestration error: ${s instanceof Error?s.message:String(s)}`);}let ce=Date.now()-le;o.push({name:"workspace-run-test-build",status:x,durationMs:ce,summary:A});let M=o.filter(s=>s.status==="warn").length,pe=o.filter(s=>s.status==="fail").length,_=n==="enforce"?o.some(s=>s.status==="warn"||s.status==="fail"):pe>0,C=[...new Set(t)],O=f$1||_?Math.max(1,C.length):0,ue=O>0?C:[],de=O===0?C:[],fe=Se(o),me=f$1||_?"blocked":M>0?"partial":"approved",ge=f$1?3:_?1:M>0?2:0,we=be({mode:n,executionError:f$1,blockers:C,hasWarnings:M>0}),Y=c(e$1,".workspai/reports"),he=b.join(Y,G),ke=b.join(Y,V),u={schemaVersion:"autopilot-release-v1",generatedAt:new Date().toISOString(),workspacePath:e$1,mode:n,summary:{releaseScore:fe,verdict:me,blockers:O,warnings:M,safeFixesApplied:X,manualActions:C.length,exitCode:ge},stages:o,blockingReasons:ue,warningReasons:de,nextActions:we,artifacts:{reportPath:he,aliasEvidencePath:ke,analyzeEvidencePath:H,readinessEvidencePath:F,workspaceRunEvidencePath:D,workspaceRunTestPath:q,workspaceRunBuildPath:Q},enterpriseControls:{jsonReady:true,evidencePath:`.workspai/reports/${G}`,aliasEvidencePath:`.workspai/reports/${V}`}};if(await g(e$1,`.workspai/reports/${G}`,u),await g(e$1,`.workspai/reports/${V}`,u),r.output&&await xe(b.resolve(r.output),u),!r.json){console.log(a$3.bold.cyan(`
|
|
3
|
+
\u{1F680} Workspai Autopilot Release
|
|
4
|
+
`)),console.log(a$3.bold(`Workspace: ${a$3.cyan(b.basename(e$1))}`)),console.log(a$3.gray(`Path: ${e$1}`)),console.log(a$3.white(`Mode: ${n}`)),console.log(a$3.white(`Verdict: ${u.summary.verdict==="approved"?a$3.green("approved"):u.summary.verdict==="partial"?a$3.yellow("partial"):a$3.red("blocked")}`)),console.log(a$3.white(`Release score: ${u.summary.releaseScore}`));for(let s of u.stages){let l=s.status==="pass"?a$3.green("PASS"):s.status==="warn"?a$3.yellow("WARN"):s.status==="skipped"?a$3.gray("SKIP"):a$3.red("FAIL");console.log(` - ${s.name}: ${l} ${s.summary} (${s.durationMs}ms)`);}if(u.blockingReasons.length>0){console.log(a$3.bold.red(`
|
|
5
|
+
Blocking reasons:`));for(let s of u.blockingReasons)console.log(a$3.red(` - ${s}`));}if(u.warningReasons.length>0){console.log(a$3.bold.yellow(`
|
|
6
|
+
Warning reasons:`));for(let s of u.warningReasons)console.log(a$3.yellow(` - ${s}`));}if(u.nextActions.length>0){console.log(a$3.bold(`
|
|
7
|
+
Next actions:`));for(let s of u.nextActions)console.log(a$3.gray(` - ${s}`));}console.log(a$3.gray(`
|
|
8
|
+
Report: ${u.artifacts.reportPath}`));}return u}export{G as a,V as b,Me as c};
|
|
@@ -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
|