workspai 0.44.0 → 0.46.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 +243 -513
- package/contracts/cli-runtime-command-inventory.v1.snapshot.json +1372 -0
- package/contracts/command-capabilities.v1.json +166 -1
- package/contracts/extension-cli-compatibility.v1.json +4 -2
- package/contracts/published-contract-catalog.v1.json +12 -1
- package/contracts/runtime-command-surface.v1.json +1478 -3
- package/contracts/workspace-archive-capabilities.v1.json +17 -6
- package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +4 -0
- package/contracts/workspace-intelligence/workspace-intelligence-run.v1.json +207 -0
- package/contracts/workspace-intelligence-architecture.v1.json +1 -1
- package/contracts/workspace-intelligence-chain.v1.json +37 -1
- package/dist/analyze-BEBEZSZK.js +1 -0
- package/dist/{artifact-remediation-plan-Z7OCSME3.js → artifact-remediation-plan-FFQSESAM.js} +1 -1
- package/dist/autopilot-release-WUR4CQIT.js +1 -0
- package/dist/chunk-2G7FASAO.js +2 -0
- package/dist/{chunk-CL6TGI4Q.js → chunk-4EPHWD27.js} +1 -1
- package/dist/{chunk-J4AICQFB.js → chunk-4LGXSBCN.js} +1 -1
- package/dist/chunk-52PBRX7F.js +1 -0
- package/dist/{chunk-2QOWRBQD.js → chunk-6IIZJQLV.js} +1 -1
- package/dist/{chunk-JICOD2GI.js → chunk-CVHMUSRX.js} +1 -1
- package/dist/{chunk-7UZVOYF5.js → chunk-DIPD72H4.js} +1 -1
- package/dist/chunk-EFYHGCGX.js +2 -0
- package/dist/chunk-EYJ2CQSK.js +1 -0
- package/dist/chunk-FPJNWPKU.js +1 -0
- package/dist/{chunk-JP25YL3J.js → chunk-FTY7GGXJ.js} +2 -2
- package/dist/chunk-FWRXA435.js +2 -0
- package/dist/chunk-FXQJX34Z.js +1 -0
- package/dist/chunk-HDURFXW5.js +2 -0
- package/dist/chunk-HMUKBW2S.js +4 -0
- package/dist/{chunk-OW4UNG27.js → chunk-J5PIZCAU.js} +92 -78
- package/dist/{chunk-P4SWTY5X.js → chunk-K4WNYXKK.js} +7 -7
- package/dist/chunk-MER6ZBN2.js +13 -0
- package/dist/chunk-N7DV5L7C.js +1 -0
- package/dist/{chunk-JHC6SCJC.js → chunk-NHN4QXPP.js} +1 -1
- package/dist/{chunk-P424XYHP.js → chunk-PRBVYW3T.js} +1 -1
- package/dist/{chunk-NTXO7BMH.js → chunk-QA5BGEQW.js} +1 -1
- package/dist/chunk-QZLIURER.js +13 -0
- package/dist/{chunk-L3E6IRUQ.js → chunk-RIEF2DDX.js} +1 -1
- package/dist/{chunk-L2Q7B2OJ.js → chunk-SXMTSV5M.js} +1 -1
- package/dist/chunk-SXPY523X.js +1 -0
- package/dist/{chunk-XIVFLY6G.js → chunk-UQWOVV6V.js} +1 -1
- package/dist/chunk-V3LRQZ36.js +1 -0
- package/dist/chunk-VFDM65IE.js +80 -0
- package/dist/{chunk-B66A4TVP.js → chunk-WPEEC5BX.js} +1 -1
- package/dist/chunk-WYFPXTTS.js +2 -0
- package/dist/{chunk-M4VITK6X.js → chunk-YUATNVOT.js} +62 -51
- package/dist/{chunk-7IHLTPZ6.js → chunk-ZKAI3PJE.js} +1 -1
- package/dist/{create-DFAWAS5C.js → create-WCV3L6XH.js} +1 -1
- package/dist/doctor-5BWM2EMJ.js +1 -0
- package/dist/{dotnet-webapi-clean-BYUUHX5Y.js → dotnet-webapi-clean-6TVFBTVI.js} +20 -20
- package/dist/{gofiber-standard-B6UK5GR7.js → gofiber-standard-2BL7GWZB.js} +1 -1
- package/dist/{gogin-standard-BXU44VEM.js → gogin-standard-XGP3KBXA.js} +1 -1
- package/dist/index.d.ts +123 -15
- package/dist/index.js +337 -323
- package/dist/pipeline-ORIWVVYM.js +5 -0
- package/dist/{platform-capabilities-YICBF4FA.js → platform-capabilities-2B4QMZXE.js} +1 -1
- package/dist/{pythonRapidkitExec-UJYIB6FL.js → pythonRapidkitExec-CVCIK225.js} +1 -1
- package/dist/{springboot-standard-PEHDKH2L.js → springboot-standard-JJNUID6M.js} +6 -6
- package/dist/workspace-7OXW5YTJ.js +1 -0
- package/dist/{workspace-agent-sync-ZYCPXTU3.js → workspace-agent-sync-O4IA6VOA.js} +1 -1
- package/dist/workspace-archive-H74NBBNW.js +10 -0
- package/dist/{workspace-context-WAGGJCDL.js → workspace-context-R7IPUBPG.js} +1 -1
- package/dist/workspace-contract-HKCMOMFE.js +1 -0
- package/dist/workspace-explain-GOPQYTPQ.js +1 -0
- package/dist/workspace-explain-contract-SVFJAAEI.js +1 -0
- package/dist/{workspace-feedback-RCB25NFO.js → workspace-feedback-REOS36ZZ.js} +1 -1
- package/dist/{workspace-foundation-KXDL6P6X.js → workspace-foundation-KXT4QI5O.js} +1 -1
- package/dist/{workspace-history-M4QQBIPB.js → workspace-history-OGOVSKZG.js} +1 -1
- package/dist/{workspace-intelligence-QOGD2TZS.js → workspace-intelligence-7IESQSXY.js} +1 -1
- package/dist/workspace-intelligence-runner-6GJ5M4HB.js +1 -0
- package/dist/{workspace-mcp-serve-CEFKEMYG.js → workspace-mcp-serve-FRVWBO36.js} +1 -1
- package/dist/{workspace-model-GMSRBICO.js → workspace-model-PPYX7B4S.js} +1 -1
- package/dist/workspace-python-engine-state-2MLKJYQG.js +2 -0
- package/dist/workspace-registry-summary-SZ46R5PD.js +1 -0
- package/dist/workspace-run-V3KKHTVF.js +1 -0
- package/dist/{workspace-verify-NP4GMFSV.js → workspace-verify-MFQ7IXGD.js} +1 -1
- package/dist/{workspace-watch-IIBH3Y25.js → workspace-watch-SOPZHRWA.js} +1 -1
- package/docs/AI_DYNAMIC_INTEGRATION.md +29 -33
- package/docs/AI_FEATURES.md +18 -27
- package/docs/AI_QUICKSTART.md +7 -4
- package/docs/DEVELOPMENT.md +5 -5
- package/docs/From Code to Shared Understanding.png +0 -0
- package/docs/OPEN_SOURCE_USER_SCENARIOS.md +23 -2
- package/docs/OPTIMIZATION_GUIDE.md +19 -51
- package/docs/PACKAGE_MANAGER_POLICY.md +4 -1
- package/docs/README.md +30 -3
- package/docs/SECURITY.md +13 -6
- package/docs/SETUP.md +6 -3
- package/docs/UTILITIES.md +8 -20
- package/docs/WORKSPACE_MARKER_SPEC.md +27 -20
- package/docs/ci-workflows.md +19 -5
- package/docs/commands-reference.md +51 -10
- package/docs/config-file-guide.md +64 -247
- package/docs/contracts/ARTIFACT_CATALOG.md +14 -2
- package/docs/contracts/CLI_LOG_EVENT_STREAM.md +1 -1
- package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +27 -6
- package/docs/contracts/README.md +5 -2
- package/docs/contracts/RUNTIME_ACCEPTANCE_MATRIX.md +4 -4
- package/docs/contracts/RUNTIME_SUPPORT_MATRIX.md +14 -10
- package/docs/creating-workspaces-and-projects.md +649 -0
- package/docs/doctor-command.md +5 -4
- package/docs/examples/ci-agent-grounding.yml +16 -10
- package/docs/from-code-to-shared-understanding.md +69 -38
- package/docs/workspace-intelligence-runner.md +186 -0
- package/docs/workspace-operations.md +29 -11
- package/docs/workspace-run.md +4 -1
- package/package.json +10 -8
- package/rapidkit.config.example.cjs +5 -5
- package/scripts/enforce-package-manager.cjs +1 -1
- package/scripts/prepack-enterprise.mjs +8 -0
- package/workspai.config.example.cjs +12 -47
- package/dist/analyze-6OCBM4ID.js +0 -1
- package/dist/autopilot-release-LI2WJCEW.js +0 -1
- package/dist/chunk-2K3GYCPS.js +0 -1
- package/dist/chunk-2QN6BMM7.js +0 -2
- package/dist/chunk-5AKYMAIL.js +0 -1
- package/dist/chunk-5PVEQ6CZ.js +0 -13
- package/dist/chunk-7EIMPQR3.js +0 -1
- package/dist/chunk-7RIWU5TZ.js +0 -1
- package/dist/chunk-FWJV7CCI.js +0 -2
- package/dist/chunk-LGP6WXS2.js +0 -4
- package/dist/chunk-TRMDODFM.js +0 -13
- package/dist/chunk-UNF72FTB.js +0 -1
- package/dist/chunk-V5JN4TDX.js +0 -2
- package/dist/chunk-VA5MRHKM.js +0 -2
- package/dist/chunk-XZGVNGRB.js +0 -1
- package/dist/chunk-YUX4YFGL.js +0 -78
- package/dist/doctor-PVSWDBJL.js +0 -1
- package/dist/imported-projects-registry-FOIE27WT.js +0 -1
- package/dist/pipeline-ND734AJM.js +0 -5
- package/dist/workspace-FQT3QIRS.js +0 -1
- package/dist/workspace-archive-EEGLHZDW.js +0 -10
- package/dist/workspace-contract-SEI4SNSG.js +0 -1
- package/dist/workspace-explain-MVGGRCDN.js +0 -1
- package/dist/workspace-explain-contract-KT757JGQ.js +0 -1
- package/dist/workspace-python-engine-state-MTWIIZPY.js +0 -2
- package/dist/workspace-registry-summary-S52SEJAG.js +0 -1
- package/dist/workspace-run-VC4OUPRF.js +0 -1
|
@@ -28,10 +28,11 @@
|
|
|
28
28
|
"payloadBufferedInMemory": false
|
|
29
29
|
},
|
|
30
30
|
"sizePolicy": {
|
|
31
|
-
"workspacePayloadDefault": "
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
31
|
+
"workspacePayloadDefault": "20gb",
|
|
32
|
+
"remoteDownloadDefault": "5gb",
|
|
33
|
+
"safetyBudgets": "secure-defaults-with-explicit-overrides",
|
|
34
|
+
"manifestMemoryLimitBytes": 67108864,
|
|
35
|
+
"remoteDownloadTimeoutDefaultMs": 300000
|
|
35
36
|
},
|
|
36
37
|
"integrity": {
|
|
37
38
|
"algorithm": "sha256",
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
},
|
|
49
50
|
"maxDownloadSize": {
|
|
50
51
|
"signature": "--max-download-size <size>",
|
|
51
|
-
"description": "
|
|
52
|
+
"description": "Maximum remote archive download size (secure default: 5gb)",
|
|
52
53
|
"appliesTo": [
|
|
53
54
|
"inspect",
|
|
54
55
|
"verify",
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
},
|
|
59
60
|
"maxExpandedSize": {
|
|
60
61
|
"signature": "--max-expanded-size <size>",
|
|
61
|
-
"description": "
|
|
62
|
+
"description": "Maximum expanded archive payload size (secure default: 20gb)",
|
|
62
63
|
"appliesTo": [
|
|
63
64
|
"inspect",
|
|
64
65
|
"verify",
|
|
@@ -75,6 +76,16 @@
|
|
|
75
76
|
"doctor",
|
|
76
77
|
"hydrate"
|
|
77
78
|
]
|
|
79
|
+
},
|
|
80
|
+
"allowPrivateNetwork": {
|
|
81
|
+
"signature": "--allow-private-network",
|
|
82
|
+
"description": "Allow archive downloads from loopback/private networks (unsafe for untrusted input)",
|
|
83
|
+
"appliesTo": [
|
|
84
|
+
"inspect",
|
|
85
|
+
"verify",
|
|
86
|
+
"doctor",
|
|
87
|
+
"hydrate"
|
|
88
|
+
]
|
|
78
89
|
}
|
|
79
90
|
},
|
|
80
91
|
"contracts": {
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
"cardStatus": {
|
|
27
27
|
"enum": ["pass", "warn", "fail", "missing"]
|
|
28
28
|
},
|
|
29
|
+
"blocking": {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"description": "Contract-backed release posture. False means the card is advisory even when warnings or blocker-like guidance are present."
|
|
32
|
+
},
|
|
29
33
|
"blockers": {
|
|
30
34
|
"type": "array",
|
|
31
35
|
"items": { "type": "string" }
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://rapidkit.dev/contracts/workspace-intelligence/workspace-intelligence-run.v1.json",
|
|
4
|
+
"title": "Workspace Intelligence Run",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"schemaVersion",
|
|
9
|
+
"chainSchemaVersion",
|
|
10
|
+
"generatedAt",
|
|
11
|
+
"workspacePath",
|
|
12
|
+
"baselineCreated",
|
|
13
|
+
"preflight",
|
|
14
|
+
"status",
|
|
15
|
+
"exitCode",
|
|
16
|
+
"stages",
|
|
17
|
+
"artifactPath"
|
|
18
|
+
],
|
|
19
|
+
"properties": {
|
|
20
|
+
"schemaVersion": { "const": "workspace-intelligence-run.v1" },
|
|
21
|
+
"chainSchemaVersion": { "const": "workspai-workspace-intelligence-chain-v1" },
|
|
22
|
+
"generatedAt": { "type": "string", "format": "date-time" },
|
|
23
|
+
"workspacePath": { "type": "string", "minLength": 1 },
|
|
24
|
+
"baselineCreated": { "type": "boolean" },
|
|
25
|
+
"preflight": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"minItems": 2,
|
|
28
|
+
"maxItems": 2,
|
|
29
|
+
"prefixItems": [
|
|
30
|
+
{
|
|
31
|
+
"$ref": "#/$defs/preflight",
|
|
32
|
+
"type": "object",
|
|
33
|
+
"properties": {
|
|
34
|
+
"id": { "const": "sync" },
|
|
35
|
+
"status": { "enum": ["passed", "failed"] },
|
|
36
|
+
"result": { "enum": ["synchronized", "failed"] },
|
|
37
|
+
"artifacts": {
|
|
38
|
+
"const": [".workspai/workspace.contract.json", ".workspai/workspace-registry.v1.json"]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"$ref": "#/$defs/preflight",
|
|
44
|
+
"type": "object",
|
|
45
|
+
"properties": {
|
|
46
|
+
"id": { "const": "baseline" },
|
|
47
|
+
"status": { "enum": ["passed", "failed", "skipped"] },
|
|
48
|
+
"result": { "enum": ["created", "reused", "failed", "skipped"] },
|
|
49
|
+
"artifacts": {
|
|
50
|
+
"const": [".workspai/reports/workspace-model-snapshot.json"]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"items": false
|
|
56
|
+
},
|
|
57
|
+
"status": { "enum": ["passed", "blocked", "failed"] },
|
|
58
|
+
"exitCode": { "enum": [0, 1, 2] },
|
|
59
|
+
"artifactPath": {
|
|
60
|
+
"const": ".workspai/reports/workspace-intelligence-run-last-run.json"
|
|
61
|
+
},
|
|
62
|
+
"stages": {
|
|
63
|
+
"type": "array",
|
|
64
|
+
"minItems": 11,
|
|
65
|
+
"maxItems": 11,
|
|
66
|
+
"prefixItems": [
|
|
67
|
+
{
|
|
68
|
+
"$ref": "#/$defs/stage",
|
|
69
|
+
"type": "object",
|
|
70
|
+
"properties": {
|
|
71
|
+
"id": { "const": "model" },
|
|
72
|
+
"artifacts": { "const": [".workspai/reports/workspace-model.json"] }
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"$ref": "#/$defs/stage",
|
|
77
|
+
"type": "object",
|
|
78
|
+
"properties": {
|
|
79
|
+
"id": { "const": "diff" },
|
|
80
|
+
"artifacts": { "const": [".workspai/reports/workspace-model-diff-last-run.json"] }
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"$ref": "#/$defs/stage",
|
|
85
|
+
"type": "object",
|
|
86
|
+
"properties": {
|
|
87
|
+
"id": { "const": "impact" },
|
|
88
|
+
"artifacts": { "const": [".workspai/reports/workspace-impact-last-run.json"] }
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"$ref": "#/$defs/stage",
|
|
93
|
+
"type": "object",
|
|
94
|
+
"properties": {
|
|
95
|
+
"id": { "const": "doctor-evidence" },
|
|
96
|
+
"artifacts": { "const": [".workspai/reports/doctor-last-run.json"] }
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"$ref": "#/$defs/stage",
|
|
101
|
+
"type": "object",
|
|
102
|
+
"properties": {
|
|
103
|
+
"id": { "const": "contract-evidence" },
|
|
104
|
+
"artifacts": { "const": [".workspai/reports/workspace-contract-verify-last-run.json"] }
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"$ref": "#/$defs/stage",
|
|
109
|
+
"type": "object",
|
|
110
|
+
"properties": {
|
|
111
|
+
"id": { "const": "analyze-evidence" },
|
|
112
|
+
"artifacts": { "const": [".workspai/reports/analyze-last-run.json"] }
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"$ref": "#/$defs/stage",
|
|
117
|
+
"type": "object",
|
|
118
|
+
"properties": {
|
|
119
|
+
"id": { "const": "readiness-evidence" },
|
|
120
|
+
"artifacts": { "const": [".workspai/reports/release-readiness-last-run.json"] }
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"$ref": "#/$defs/stage",
|
|
125
|
+
"type": "object",
|
|
126
|
+
"properties": {
|
|
127
|
+
"id": { "const": "verify" },
|
|
128
|
+
"artifacts": {
|
|
129
|
+
"const": [
|
|
130
|
+
".workspai/reports/workspace-verify-last-run.json",
|
|
131
|
+
".workspai/reports/workspace-intelligence-history.json"
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"$ref": "#/$defs/stage",
|
|
138
|
+
"type": "object",
|
|
139
|
+
"properties": {
|
|
140
|
+
"id": { "const": "context" },
|
|
141
|
+
"artifacts": { "const": [".workspai/reports/workspace-context-agent.json"] }
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"$ref": "#/$defs/stage",
|
|
146
|
+
"type": "object",
|
|
147
|
+
"properties": {
|
|
148
|
+
"id": { "const": "agent-sync" },
|
|
149
|
+
"artifacts": {
|
|
150
|
+
"const": [
|
|
151
|
+
".workspai/reports/INDEX.json",
|
|
152
|
+
".workspai/reports/agent-customization-pack.json",
|
|
153
|
+
".workspai/reports/workspace-skills-index.json",
|
|
154
|
+
"AGENTS.md"
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"$ref": "#/$defs/stage",
|
|
161
|
+
"type": "object",
|
|
162
|
+
"properties": {
|
|
163
|
+
"id": { "const": "explain" },
|
|
164
|
+
"artifacts": { "const": [".workspai/reports/workspace-explain-last-run.json"] }
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"items": false
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"$defs": {
|
|
172
|
+
"preflight": {
|
|
173
|
+
"type": "object",
|
|
174
|
+
"additionalProperties": false,
|
|
175
|
+
"required": ["id", "status", "result", "durationMs", "artifacts", "message"],
|
|
176
|
+
"properties": {
|
|
177
|
+
"id": { "type": "string", "minLength": 1 },
|
|
178
|
+
"status": { "enum": ["passed", "failed", "skipped"] },
|
|
179
|
+
"result": { "enum": ["synchronized", "created", "reused", "failed", "skipped"] },
|
|
180
|
+
"durationMs": { "type": "integer", "minimum": 0 },
|
|
181
|
+
"artifacts": {
|
|
182
|
+
"type": "array",
|
|
183
|
+
"items": { "type": "string", "minLength": 1 },
|
|
184
|
+
"uniqueItems": true
|
|
185
|
+
},
|
|
186
|
+
"message": { "type": "string", "minLength": 1 }
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"stage": {
|
|
190
|
+
"type": "object",
|
|
191
|
+
"additionalProperties": false,
|
|
192
|
+
"required": ["id", "status", "durationMs", "artifacts", "exitCode", "message"],
|
|
193
|
+
"properties": {
|
|
194
|
+
"id": { "type": "string", "minLength": 1 },
|
|
195
|
+
"status": { "enum": ["passed", "blocked", "failed", "skipped"] },
|
|
196
|
+
"durationMs": { "type": "integer", "minimum": 0 },
|
|
197
|
+
"artifacts": {
|
|
198
|
+
"type": "array",
|
|
199
|
+
"items": { "type": "string", "minLength": 1 },
|
|
200
|
+
"uniqueItems": true
|
|
201
|
+
},
|
|
202
|
+
"exitCode": { "type": "integer", "minimum": 0 },
|
|
203
|
+
"message": { "type": "string", "minLength": 1 }
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
@@ -408,7 +408,7 @@
|
|
|
408
408
|
"status": "available",
|
|
409
409
|
"purpose": "Refresh release-readiness evidence before the definitive gate.",
|
|
410
410
|
"commands": [
|
|
411
|
-
"readiness --json"
|
|
411
|
+
"readiness --json --skip-verify"
|
|
412
412
|
],
|
|
413
413
|
"artifacts": [
|
|
414
414
|
".workspai/reports/release-readiness-last-run.json"
|
|
@@ -191,9 +191,44 @@
|
|
|
191
191
|
"path": ".workspai/reports/workspace-explain-last-run.json",
|
|
192
192
|
"schemaVersion": "workspace-explain.v1",
|
|
193
193
|
"schemaContract": "contracts/workspace-intelligence/workspace-explain.v1.json"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"id": "intelligenceRun",
|
|
197
|
+
"path": ".workspai/reports/workspace-intelligence-run-last-run.json",
|
|
198
|
+
"schemaVersion": "workspace-intelligence-run.v1",
|
|
199
|
+
"schemaContract": "contracts/workspace-intelligence/workspace-intelligence-run.v1.json"
|
|
194
200
|
}
|
|
195
201
|
]
|
|
196
202
|
},
|
|
203
|
+
"executionEnvelope": {
|
|
204
|
+
"rule": "Sync and baseline resolution are deterministic execution prerequisites, not canonical intelligence stages; every run reports them separately and preserves the exact canonical stage sequence.",
|
|
205
|
+
"operations": [
|
|
206
|
+
{
|
|
207
|
+
"id": "sync",
|
|
208
|
+
"executionPoint": "before:model",
|
|
209
|
+
"artifacts": [
|
|
210
|
+
".workspai/workspace.contract.json",
|
|
211
|
+
".workspai/workspace-registry.v1.json"
|
|
212
|
+
],
|
|
213
|
+
"failurePolicy": "stop-and-report",
|
|
214
|
+
"purpose": "Reconcile portable workspace inventory and contract inputs before modeling."
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"id": "baseline",
|
|
218
|
+
"executionPoint": "after:model-before:diff",
|
|
219
|
+
"artifacts": [
|
|
220
|
+
".workspai/reports/workspace-model-snapshot.json"
|
|
221
|
+
],
|
|
222
|
+
"failurePolicy": "stop-and-report",
|
|
223
|
+
"purpose": "Create an initial structural baseline when absent or reuse the existing baseline before Diff."
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
"report": {
|
|
227
|
+
"artifact": ".workspai/reports/workspace-intelligence-run-last-run.json",
|
|
228
|
+
"schemaVersion": "workspace-intelligence-run.v1",
|
|
229
|
+
"invariant": "The report must preserve exact preflight and stage order, registry-owned artifacts, failure propagation, and aggregate status/exit semantics."
|
|
230
|
+
}
|
|
231
|
+
},
|
|
197
232
|
"boundaries": {
|
|
198
233
|
"inputs": [
|
|
199
234
|
{
|
|
@@ -853,7 +888,8 @@
|
|
|
853
888
|
"label": "Readiness Evidence",
|
|
854
889
|
"command": [
|
|
855
890
|
"readiness",
|
|
856
|
-
"--json"
|
|
891
|
+
"--json",
|
|
892
|
+
"--skip-verify"
|
|
857
893
|
],
|
|
858
894
|
"consumes": [
|
|
859
895
|
"doctor, analysis, runtime, and release signals"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as printAnalyzeReport,a as runAnalyze}from'./chunk-RIEF2DDX.js';
|
package/dist/{artifact-remediation-plan-Z7OCSME3.js → artifact-remediation-plan-FFQSESAM.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {a}from'./chunk-2E6WGUN6.js';import {c,g,d}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-2E6WGUN6.js';import {c,g,d}from'./chunk-HDURFXW5.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
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-4EPHWD27.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b as b$1}from'./chunk-NHN4QXPP.js';import {i}from'./chunk-MER6ZBN2.js';import {c}from'./chunk-PRBVYW3T.js';import {a}from'./chunk-Y45WZR5N.js';import {f}from'./chunk-7YHK5NM3.js';import {b}from'./chunk-RO73VVHW.js';import {h,g as g$1}from'./chunk-5XATWNME.js';import {promises,constants}from'fs';import c$1 from'path';import T,{homedir}from'os';import {pathToFileURL}from'url';import g from'process';import E from'crypto';import s from'fs/promises';function q(t){let e=t.label.indexOf(" \u2014 ");return e>=0?t.label.slice(e+3).trim():t.label.trim()}function B(){let t=c().map(e=>({value:e.id,label:q(e),hint:e.description,name:e.label})),r=i().map(e=>({value:e.kitId,label:e.displayName,hint:e.commandDisplay("my-app"),name:`${e.displayName} \u2014 ${e.framework}`}));return [...t,...r]}var Q=".workspairc.json",z=".rapidkitrc.json",Z=["workspai.config.js","workspai.config.mjs","workspai.config.cjs","rapidkit.config.js","rapidkit.config.mjs","rapidkit.config.cjs"],ee=["workspai.config.json","rapidkit.config.json"];function I(t){return typeof t=="object"&&t!==null&&"code"in t&&t.code==="ENOENT"}function L(t,r){let e=r instanceof Error?r.message:String(r),i=t.endsWith(".js")&&/module is not defined in ES module scope/i.test(e)?' 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 ${t}.${i} Cause: ${e}`}async function _e(){for(let t of [c$1.join(T.homedir(),Q),c$1.join(T.homedir(),z)])try{let r=await promises.readFile(t,"utf-8"),e=JSON.parse(r);return f.debug(`Loaded config from ${t}`),e}catch{}return f.debug("No user config found, using defaults"),{}}async function Ke(t=process.cwd(),r={}){let e=t,i=c$1.parse(e).root;for(;e!==i;){for(let o of ee){let n=c$1.join(e,o);try{let a=await promises.readFile(n,"utf-8"),l=JSON.parse(a);if(!l||typeof l!="object"||Array.isArray(l))throw new Error("configuration root must be a JSON object");return f.debug(`Loaded data-only Workspai config from ${o}`),l}catch(a){if(I(a))continue;throw new Error(L(n,a))}}for(let o of Z){let n=c$1.join(e,o);try{await promises.access(n);}catch(a){if(I(a))continue;throw new Error(L(n,a))}if(f.debug(`Found config file: ${n}`),!r.trustExecutableConfig)throw new Error(`Refusing to execute Workspai config at ${n} without explicit trust. Use a data-only workspai.config.json file, pass --trust-config, or set WORKSPAI_TRUST_CONFIG=1.`);try{let l=await import(pathToFileURL(n).href),f$1=l.default||l;return f.debug(`Loaded Workspai config from ${o}`),f$1}catch(a){throw new Error(L(n,a))}}e=c$1.dirname(e);}return f.debug("No Workspai config file found, using defaults"),{}}function Me(t,r,e){return {author:e.author||r.workspace?.defaultAuthor||t.author,pythonVersion:e.pythonVersion||r.workspace?.pythonVersion||t.pythonVersion,defaultInstallMethod:e.defaultInstallMethod||r.workspace?.installMethod||t.defaultInstallMethod,defaultKit:e.defaultKit||r.projects?.defaultKit||t.defaultKit,skipGit:e.skipGit??r.projects?.skipGit??t.skipGit,license:e.license||t.license,testRapidKitPath:e.testRapidKitPath||t.testRapidKitPath}}function Ge(t){return a("DEV_PATH")||t.testRapidKitPath||void 0}function re(t,r){let e=t.indexOf(r);if(e>=0&&e+1<t.length)return t[e+1];let i=t.find(o=>o.startsWith(`${r}=`));if(i)return i.slice(r.length+1)}function ie(t){return t.includes("--here")}function U(t,r=g.cwd()){if(ie(t))return c$1.resolve(r);let e=re(t,"--output");if(e)return c$1.resolve(e)}function Ze(t,r=g.cwd()){let e=c$1.resolve(t),i=c$1.resolve(r),o=c$1.relative(i,e);return o.length>0&&!o.startsWith("..")&&!c$1.isAbsolute(o)?`cd ${o}`:`cd ${e}`}function et(t,r={}){let e=r.argv??[],i=r.outputParent??U(e,g.cwd());return h(t.trim(),{homeDir:r.homeDir,outputDir:i})}function tt(t,r,e={}){return t?c$1.resolve(t)===c$1.resolve(r)?true:e.outputParent===void 0:false}async function rt(t,r={}){let e=r.cwd??g.cwd(),i=r.homeDir??homedir(),o=U(t,e);if(o!==void 0)return o;let n=r.hasYes??(t.includes("--yes")||t.includes("-y"));if(!(r.interactive??(!n&&!!g.stdin.isTTY&&!b())))return;let l=g$1(i),{location:f}=await b$1([{type:"rawlist",name:"location",message:"Where should the workspace be created?",choices:[{value:"managed",label:"Managed home",hint:l},{value:"here",label:"Current directory",hint:e}],default:0}]);if(f==="here")return c$1.resolve(e)}var W="workspai.lifecycle-transaction",J=1,N="manifest.json",_="lifecycle-transaction-";async function w(t){try{return await s.lstat(t)}catch(r){if(r.code==="ENOENT")return null;throw r}}function K(t){let r=t?.code;return process.platform==="win32"&&(r==="EPERM"||r==="EINVAL"||r==="ENOSYS")}async function D(t){try{await t.sync();}catch(r){if(!K(r))throw r}}function oe(t){if(typeof t!="string"||!c$1.isAbsolute(t))throw new Error("Lifecycle transaction journal contains a non-absolute target path.")}function ne(t){if(typeof t!="string"||t.length===0||c$1.basename(t)!==t||t==="."||t==="..")throw new Error("Lifecycle transaction journal contains an unsafe backup reference.")}function ae(t){if(!t||typeof t!="object")throw new Error("Lifecycle transaction journal is not an object.");let r=t;if(r.kind!==W||r.version!==J)throw new Error("Lifecycle transaction journal has an unsupported format.");if(!Number.isInteger(r.ownerPid)||r.ownerPid<=0)throw new Error("Lifecycle transaction journal has an invalid owner process.");if(!["active","committed","rolling-back"].includes(r.phase))throw new Error("Lifecycle transaction journal has an invalid phase.");if(!Array.isArray(r.operations))throw new Error("Lifecycle transaction journal has invalid operations.");for(let e of r.operations){if(!e||typeof e!="object")throw new Error("Lifecycle transaction journal contains an invalid operation.");let i=e;if(oe(i.path),i.type!=="tree"){if(i.type!=="file"||!["absent","regular"].includes(i.state))throw new Error("Lifecycle transaction journal contains an invalid operation.");if(i.state==="regular"){if(!Number.isInteger(i.mode)||i.mode<0||i.mode>4095)throw new Error("Lifecycle transaction journal contains an invalid file mode.");ne(i.backup);}}}return r}async function x(t){let r;try{r=await s.open(t,constants.O_RDONLY);}catch(e){if(K(e))return;throw e}try{await D(r);}finally{await r.close();}}async function M(t,r){let e=c$1.join(c$1.dirname(t),`.${c$1.basename(t)}.${process.pid}.${E.randomUUID()}.tmp`);try{let i=await s.open(e,constants.O_WRONLY|constants.O_CREAT|constants.O_EXCL,384);try{await i.writeFile(r),await D(i);}finally{await i.close();}await s.rename(e,t),await x(c$1.dirname(t));}catch(i){throw await s.rm(e,{force:true}).catch(()=>{}),i}}async function G(t,r){await M(c$1.join(t,N),Buffer.from(`${JSON.stringify(r,null,2)}
|
|
2
|
+
`));}async function V(t,r){let e=await w(t.path);if(e?.isSymbolicLink()||e&&!e.isFile())throw new Error(`Refusing to restore over a non-regular file: ${t.path}`);if(t.state==="absent"){e&&await s.unlink(t.path);return}if(!r)throw new Error(`Missing durable backup for: ${t.path}`);if(!await w(c$1.dirname(t.path)))return;let i=c$1.join(r,t.backup),o=await s.lstat(i).catch(f=>{if(f.code==="ENOENT"&&e?.isFile())return e;throw f});if(o===e)return;if(!o.isFile()||o.isSymbolicLink())throw new Error(`Lifecycle transaction backup is not a regular file: ${i}`);let n=await s.readFile(i),a=c$1.join(c$1.dirname(t.path),`.${c$1.basename(t.path)}.${process.pid}.${E.randomUUID()}.rollback`),l=await s.open(a,constants.O_WRONLY|constants.O_CREAT|constants.O_EXCL,t.mode);try{await l.writeFile(n),await l.chmod(t.mode),await D(l);}finally{await l.close();}try{await s.rename(a,t.path),await x(c$1.dirname(t.path));}catch(f){throw await s.rm(a,{force:true}).catch(()=>{}),f}}async function Y(t){let r=await w(t.path);if(r){if(r.isSymbolicLink()||!r.isDirectory())throw new Error(`Refusing to remove a non-directory owned tree: ${t.path}`);await s.rm(t.path,{recursive:true});}}async function se(t,r){let e=[];for(let i of [...t].reverse())try{i.type==="file"?await V(i,r):await Y(i);}catch(o){e.push(o);}if(e.length>0)throw new AggregateError(e,"Lifecycle transaction rollback failed.")}var j=class t{constructor(r){this.transactionDirectory=r;this.journalPath=r?c$1.join(r,N):void 0;}transactionDirectory;journalPath;actions=[];durableOperations=[];phase="active";finished=false;static async create(r={}){if(!r.journalDirectory)return new t;let e=c$1.resolve(r.journalDirectory);await s.mkdir(e,{recursive:true});let i=await s.mkdtemp(c$1.join(e,_));await x(e);let o=new t(i);return await o.persist(),o}assertActive(){if(this.finished||this.phase!=="active")throw new Error("Lifecycle transaction is no longer active.")}async persist(r=this.durableOperations){this.transactionDirectory&&await G(this.transactionDirectory,{kind:W,version:J,ownerPid:process.pid,phase:this.phase,operations:r});}async addDurableOperation(r){let e=[...this.durableOperations,r];await this.persist(e),this.durableOperations.push(r),this.actions.push(r);}async captureFile(r){this.assertActive();let e=c$1.resolve(r),i=await w(e);if(!i){await this.addDurableOperation({type:"file",path:e,state:"absent"});return}if(i.isSymbolicLink()||!i.isFile())throw new Error(`Lifecycle transaction can only capture regular files: ${e}`);let o;try{o=await s.open(e,constants.O_RDONLY|(constants.O_NOFOLLOW??0));}catch(n){throw n.code==="ENOENT"?new Error(`File changed while being captured: ${e}`,{cause:n}):n}try{let n=await o.stat();if(!n.isFile())throw new Error(`Lifecycle transaction can only capture regular files: ${e}`);let a=await o.readFile(),l=n.mode&4095;if(this.transactionDirectory){let f=`file-${this.durableOperations.length}-${E.randomUUID()}.bin`;await M(c$1.join(this.transactionDirectory,f),a),await this.addDurableOperation({type:"file",path:e,state:"regular",mode:l,backup:f});}else {let f=`memory-${this.durableOperations.length}`,y={type:"file",path:e,state:"regular",mode:l,backup:f};this.durableOperations.push(y),this.actions.push({type:"compensation",run:async()=>{let d=await w(e);if(d?.isSymbolicLink()||d&&!d.isFile())throw new Error(`Refusing to restore over a non-regular file: ${e}`);let b=c$1.join(c$1.dirname(e),`.${c$1.basename(e)}.${process.pid}.${E.randomUUID()}.rollback`);await s.writeFile(b,a,{flag:"wx",mode:l}),await s.chmod(b,l);try{await s.rename(b,e);}catch(H){throw await s.rm(b,{force:true}).catch(()=>{}),H}}});}}finally{await o.close();}}async captureOwnedTree(r){this.assertActive();let e=c$1.resolve(r),i=await w(e);if(!i)return await this.addDurableOperation({type:"tree",path:e}),true;if(i.isSymbolicLink()||!i.isDirectory())throw new Error(`Lifecycle transaction tree must be absent or a directory: ${e}`);return false}registerCompensation(r){this.assertActive(),this.actions.push({type:"compensation",run:async()=>r()});}async commit(){if(!this.finished){this.assertActive(),this.phase="committed";try{await this.persist(),this.finished=true,this.actions.length=0,this.transactionDirectory&&await s.rm(this.transactionDirectory,{recursive:true}).catch(()=>{});}catch(r){throw this.phase="active",r}}}async rollback(){if(this.finished||this.phase==="committed")return;this.assertActive(),this.phase="rolling-back";try{await this.persist();}catch(e){throw this.phase="active",e}let r=[];for(let e of [...this.actions].reverse())try{e.type==="compensation"?await e.run():e.type==="file"?await V(e,this.transactionDirectory):await Y(e);}catch(i){r.push(i);}if(r.length>0)throw new AggregateError(r,"Lifecycle transaction rollback failed.");this.finished=true,this.transactionDirectory&&await s.rm(this.transactionDirectory,{recursive:true});}};async function lt(t={}){return j.create(t)}async function ft(t){let r=c$1.resolve(t),e=await s.readdir(r,{withFileTypes:true}).catch(n=>{if(n.code==="ENOENT")return [];throw n}),i=[],o=[];for(let n of e){if(!n.isDirectory()||!n.name.startsWith(_))continue;let a=c$1.join(r,n.name);try{let l;try{l=await s.readFile(c$1.join(a,N),"utf8");}catch(d){if(d.code==="ENOENT")continue;throw d}let f=ae(JSON.parse(l));if(f.phase==="committed"){await s.rm(a,{recursive:true});continue}let y=false;try{process.kill(f.ownerPid,0),y=true;}catch(d){y=d.code==="EPERM";}if(y)continue;f.phase==="active"&&(f.phase="rolling-back",await G(a,f)),await se(f.operations,a),await s.rm(a,{recursive:true}),i.push(a);}catch(l){o.push(l);}}if(o.length>0)throw new AggregateError(o,"Lifecycle transaction recovery failed.");return i}export{B as a,_e as b,Ke as c,Me as d,Ge as e,Ze as f,et as g,tt as h,rt as i,lt as j,ft as k};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-QA5BGEQW.js';import {a as a$4}from'./chunk-22DT744Z.js';import {a as a$2,e}from'./chunk-WPEEC5BX.js';import {f,c,g}from'./chunk-HDURFXW5.js';import {a}from'./chunk-N7DV5L7C.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
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
3
|
\u{1F680} Workspai Autopilot Release
|
|
4
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(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-N7DV5L7C.js';var i=b.explain,g=["project","release-blocked","blocker","trace"];function s(t){let r=t.trim();if(!r)return null;if(r==="release-blocked")return {kind:"release-blocked"};if(r.startsWith("project:")){let e=r.slice(8).trim();return e?{kind:"project",project:e}:null}if(r.startsWith("blocker:")){let e=r.slice(8).trim();return e?{kind:"blocker",blockerId:e}:null}if(r.startsWith("trace:")){let e=r.slice(6).trim();return e?{kind:"trace",diffRef:e}:null}return {kind:"project",project:r}}function u(t){let r=t.trim();if(!r)return null;if(r.startsWith("trace:")){let n=s(r);return n?.kind==="trace"?n:null}let e=r.replace(/\\/g,"/").trim().toLowerCase();return e.endsWith(".json")||e.includes("workspace-model-diff")||e.startsWith(".rapidkit/")||e.includes("/.rapidkit/")?{kind:"trace",diffRef:r}:null}function A(t){if(!t||typeof t!="object"||Array.isArray(t))return false;let r=t;return r.schemaVersion===i&&typeof r.generatedAt=="string"&&typeof r.summary=="string"&&Array.isArray(r.sections)&&r.target!=null&&typeof r.target=="object"&&!Array.isArray(r.target)&&typeof r.target.kind=="string"}export{i as a,g as b,s as c,u as d,A as e};
|
|
@@ -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:"Maximum remote archive download size (secure default: 5gb)",appliesTo:["inspect","verify","doctor","hydrate"]},maxExpandedSize:{signature:"--max-expanded-size <size>",description:"Maximum expanded archive payload size (secure default: 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"]},allowPrivateNetwork:{signature:"--allow-private-network",description:"Allow archive downloads from loopback/private networks (unsafe for untrusted input)",appliesTo:["inspect","verify","doctor","hydrate"]}};export{i as a,r as b,s as c,a as d,o as e,n as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-N7DV5L7C.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};
|