@yolo-labs/yolo-cli 0.31.1 → 0.32.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/dist/deploy-client.js +31 -3
- package/package.json +1 -1
package/dist/deploy-client.js
CHANGED
|
@@ -92,6 +92,26 @@ export async function uploadAssetBucket(ctx, projectId, shipId, files) {
|
|
|
92
92
|
* success | 409 awaiting-approval (T3 prod gate — NOT an error)
|
|
93
93
|
* | 410 upload-expired (ship session lapsed → rerun)
|
|
94
94
|
*/
|
|
95
|
+
/**
|
|
96
|
+
* Best-effort substrate run-context headers for the finalize leg. When `yolo
|
|
97
|
+
* deploy` runs inside a Plan-Run lane the pod env carries the run ids, so we
|
|
98
|
+
* forward them and the server stamps release PROVENANCE — letting an auditor
|
|
99
|
+
* walk a live URL back to the run that shipped it. These are CLIENT-ASSERTED
|
|
100
|
+
* over the user JWT (NOT cryptographically bound like the MCP token path), so
|
|
101
|
+
* the server records them as `source: 'cli-env'`: unverified audit metadata,
|
|
102
|
+
* never authorizing. Omitted entirely for an interactive `yolo deploy` run
|
|
103
|
+
* outside a lane (none of the vars set).
|
|
104
|
+
*/
|
|
105
|
+
export function runContextHeaders(env) {
|
|
106
|
+
const headers = {};
|
|
107
|
+
if (env.YOLO_RUN_PLAN_ID)
|
|
108
|
+
headers['X-Yolo-Run-Plan-Id'] = env.YOLO_RUN_PLAN_ID;
|
|
109
|
+
if (env.YOLO_RUN_STEP_RUN_ID)
|
|
110
|
+
headers['X-Yolo-Run-Step-Run-Id'] = env.YOLO_RUN_STEP_RUN_ID;
|
|
111
|
+
if (env.SESSION_ID)
|
|
112
|
+
headers['X-Yolo-Session-Id'] = env.SESSION_ID;
|
|
113
|
+
return headers;
|
|
114
|
+
}
|
|
95
115
|
export async function finalizeShip(ctx, projectId, shipId, modules = [], sourceMap) {
|
|
96
116
|
// NOT auto-retried (unlike ship/start + assets). finalize is single-shot per
|
|
97
117
|
// ship session: if the first request reached the server and created the
|
|
@@ -107,6 +127,8 @@ export async function finalizeShip(ctx, projectId, shipId, modules = [], sourceM
|
|
|
107
127
|
if (!fetchImpl)
|
|
108
128
|
return noFetchFailure();
|
|
109
129
|
const url = `${stripTrailingSlash(ctx.commonApiUrl)}/v1/deploy/projects/${enc(projectId)}/ship/${enc(shipId)}/finalize`;
|
|
130
|
+
// Substrate run-context provenance headers (best-effort; empty outside a lane).
|
|
131
|
+
const runHeaders = runContextHeaders(ctx.env);
|
|
110
132
|
let response;
|
|
111
133
|
try {
|
|
112
134
|
if (modules.length > 0) {
|
|
@@ -122,14 +144,14 @@ export async function finalizeShip(ctx, projectId, shipId, modules = [], sourceM
|
|
|
122
144
|
// No explicit Content-Type — fetch sets the multipart boundary itself.
|
|
123
145
|
response = await fetchImpl(url, {
|
|
124
146
|
method: 'POST',
|
|
125
|
-
headers: { Authorization: `Bearer ${token}
|
|
147
|
+
headers: { Authorization: `Bearer ${token}`, ...runHeaders },
|
|
126
148
|
body: form,
|
|
127
149
|
});
|
|
128
150
|
}
|
|
129
151
|
else {
|
|
130
152
|
response = await fetchImpl(url, {
|
|
131
153
|
method: 'POST',
|
|
132
|
-
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
|
|
154
|
+
headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json', ...runHeaders },
|
|
133
155
|
body: JSON.stringify({}),
|
|
134
156
|
});
|
|
135
157
|
}
|
|
@@ -210,7 +232,13 @@ export async function listProjects(ctx) {
|
|
|
210
232
|
}
|
|
211
233
|
/** POST /v1/deploy/projects/:id/rollback */
|
|
212
234
|
export async function rollbackProject(ctx, projectId, request = {}) {
|
|
213
|
-
|
|
235
|
+
// Rollback is a prod re-activation — forward run-context so the server can
|
|
236
|
+
// stamp `rollback.provenance` (same audit basis as a ship's finalize leg).
|
|
237
|
+
return jsonLeg(ctx, `/deploy/projects/${enc(projectId)}/rollback`, {
|
|
238
|
+
method: 'POST',
|
|
239
|
+
jsonBody: request,
|
|
240
|
+
headers: runContextHeaders(ctx.env),
|
|
241
|
+
});
|
|
214
242
|
}
|
|
215
243
|
/** POST /v1/deploy/projects/:id/unpublish — take a live project offline (reversible). */
|
|
216
244
|
export async function unpublishProject(ctx, projectId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yolo-labs/yolo-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "YOLO Studio substrate CLI — owns yolo plan/workspace/artifact substrate-tooling commands. Distinct from yolo-code (the agent CLI) and yolo-router (the LLM gateway client).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|