@riddledc/riddle-proof 0.8.36 → 0.8.38
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 +21 -0
- package/dist/advanced/index.d.cts +1 -1
- package/dist/advanced/index.d.ts +1 -1
- package/dist/advanced/proof-run-engine.d.cts +1 -1
- package/dist/advanced/proof-run-engine.d.ts +1 -1
- package/dist/chunk-6KYXX4OE.js +209 -0
- package/dist/{chunk-TWTEUS7R.js → chunk-DI2XNGEZ.js} +126 -1
- package/dist/{chunk-E25K5PDM.js → chunk-U44KBAPH.js} +168 -7
- package/dist/cli/index.js +3 -2
- package/dist/cli.cjs +488 -3
- package/dist/cli.js +3 -2
- package/dist/index.cjs +336 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +26 -18
- package/dist/pr-comment.cjs +235 -0
- package/dist/pr-comment.d.cts +41 -0
- package/dist/pr-comment.d.ts +41 -0
- package/dist/pr-comment.js +11 -0
- package/dist/{proof-run-engine-DYUu2mqY.d.cts → proof-run-engine-4dM37pEx.d.cts} +3 -3
- package/dist/{proof-run-engine-BmNYuOJ7.d.ts → proof-run-engine-BqaeqAze.d.ts} +3 -3
- package/dist/proof-run-engine.d.cts +1 -1
- package/dist/proof-run-engine.d.ts +1 -1
- package/dist/riddle-client.cjs +126 -1
- package/dist/riddle-client.d.cts +21 -1
- package/dist/riddle-client.d.ts +21 -1
- package/dist/riddle-client.js +1 -1
- package/dist/runtime/index.cjs +126 -1
- package/dist/runtime/index.d.cts +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/riddle-client.cjs +126 -1
- package/dist/runtime/riddle-client.d.cts +1 -1
- package/dist/runtime/riddle-client.d.ts +1 -1
- package/dist/runtime/riddle-client.js +1 -1
- package/package.json +7 -2
package/dist/runtime/index.cjs
CHANGED
|
@@ -132,10 +132,68 @@ function previewDeployResultFromRecord(input) {
|
|
|
132
132
|
function canRecoverPreviewPublish(error) {
|
|
133
133
|
return error instanceof RiddleApiError && PREVIEW_PUBLISH_RECOVERY_STATUSES.has(error.status);
|
|
134
134
|
}
|
|
135
|
+
function summarizePreviewDirectory(directory) {
|
|
136
|
+
const stack = [directory];
|
|
137
|
+
let fileCount = 0;
|
|
138
|
+
let totalBytes = 0;
|
|
139
|
+
while (stack.length) {
|
|
140
|
+
const current = stack.pop();
|
|
141
|
+
for (const entry of (0, import_node_fs.readdirSync)(current, { withFileTypes: true })) {
|
|
142
|
+
const fullPath = import_node_path.default.join(current, entry.name);
|
|
143
|
+
if (entry.isDirectory()) {
|
|
144
|
+
stack.push(fullPath);
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
if (!entry.isFile()) continue;
|
|
148
|
+
const stat = (0, import_node_fs.statSync)(fullPath);
|
|
149
|
+
fileCount += 1;
|
|
150
|
+
totalBytes += stat.size;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return { file_count: fileCount, total_bytes: totalBytes };
|
|
154
|
+
}
|
|
155
|
+
function previewProgressEmitter(config, base) {
|
|
156
|
+
return async (snapshot) => {
|
|
157
|
+
if (!config.onPreviewProgress) return;
|
|
158
|
+
await config.onPreviewProgress({
|
|
159
|
+
label: base.label,
|
|
160
|
+
framework: base.framework,
|
|
161
|
+
directory: base.directory,
|
|
162
|
+
elapsed_ms: Math.max(0, Date.now() - base.startedAt),
|
|
163
|
+
warnings: base.warnings?.length ? base.warnings : void 0,
|
|
164
|
+
...snapshot
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
}
|
|
135
168
|
async function waitForPublishedPreview(config, input) {
|
|
169
|
+
await input.emitProgress?.({
|
|
170
|
+
stage: "publish_recovering",
|
|
171
|
+
id: input.id,
|
|
172
|
+
file_count: input.localSummary?.file_count,
|
|
173
|
+
total_bytes: input.localSummary?.total_bytes,
|
|
174
|
+
publish_error: input.publishError.message,
|
|
175
|
+
message: `publish returned ${input.publishError.status}; polling preview status`
|
|
176
|
+
});
|
|
136
177
|
for (let attempt = 1; attempt <= PREVIEW_PUBLISH_RECOVERY_ATTEMPTS; attempt += 1) {
|
|
137
178
|
const status = await riddleRequestJson(config, `/v1/preview/${input.id}`);
|
|
179
|
+
await input.emitProgress?.({
|
|
180
|
+
stage: "checking_status",
|
|
181
|
+
id: input.id,
|
|
182
|
+
attempt,
|
|
183
|
+
attempts: PREVIEW_PUBLISH_RECOVERY_ATTEMPTS,
|
|
184
|
+
status: typeof status.status === "string" ? status.status : null,
|
|
185
|
+
preview_url: typeof status.preview_url === "string" ? status.preview_url : void 0,
|
|
186
|
+
file_count: typeof status.file_count === "number" ? status.file_count : input.localSummary?.file_count,
|
|
187
|
+
total_bytes: typeof status.total_bytes === "number" ? status.total_bytes : input.localSummary?.total_bytes
|
|
188
|
+
});
|
|
138
189
|
if (String(status.status || "") === "ready" && String(status.preview_url || "").trim()) {
|
|
190
|
+
await input.emitProgress?.({
|
|
191
|
+
stage: "ready",
|
|
192
|
+
id: input.id,
|
|
193
|
+
preview_url: String(status.preview_url),
|
|
194
|
+
file_count: typeof status.file_count === "number" ? status.file_count : input.localSummary?.file_count,
|
|
195
|
+
total_bytes: typeof status.total_bytes === "number" ? status.total_bytes : input.localSummary?.total_bytes
|
|
196
|
+
});
|
|
139
197
|
return previewDeployResultFromRecord({
|
|
140
198
|
record: status,
|
|
141
199
|
id: input.id,
|
|
@@ -157,7 +215,17 @@ async function deployRiddlePreview(config, directory, label, framework = "static
|
|
|
157
215
|
if (!directory?.trim()) throw new Error("directory is required");
|
|
158
216
|
if (!label?.trim()) throw new Error("label is required");
|
|
159
217
|
if (framework !== "spa" && framework !== "static") throw new Error("framework must be spa or static");
|
|
218
|
+
const startedAt = Date.now();
|
|
160
219
|
const warnings = collectRiddlePreviewDeployWarnings(directory, framework);
|
|
220
|
+
const emitProgress = previewProgressEmitter(config, { label, framework, directory, startedAt, warnings });
|
|
221
|
+
await emitProgress({ stage: "validating", message: "checking preview input directory" });
|
|
222
|
+
const localSummary = summarizePreviewDirectory(directory);
|
|
223
|
+
await emitProgress({
|
|
224
|
+
stage: "creating",
|
|
225
|
+
file_count: localSummary.file_count,
|
|
226
|
+
total_bytes: localSummary.total_bytes,
|
|
227
|
+
message: "creating preview upload target"
|
|
228
|
+
});
|
|
161
229
|
const created = await riddleRequestJson(config, "/v1/preview", {
|
|
162
230
|
method: "POST",
|
|
163
231
|
body: JSON.stringify({ framework, label })
|
|
@@ -165,10 +233,42 @@ async function deployRiddlePreview(config, directory, label, framework = "static
|
|
|
165
233
|
const id = String(created.id || "");
|
|
166
234
|
const uploadUrl = String(created.upload_url || "");
|
|
167
235
|
if (!id || !uploadUrl) throw new Error("Riddle preview create response was missing id or upload_url.");
|
|
236
|
+
await emitProgress({
|
|
237
|
+
stage: "created",
|
|
238
|
+
id,
|
|
239
|
+
file_count: localSummary.file_count,
|
|
240
|
+
total_bytes: localSummary.total_bytes,
|
|
241
|
+
message: "preview upload target created"
|
|
242
|
+
});
|
|
168
243
|
const scratch = (0, import_node_fs.mkdtempSync)(import_node_path.default.join((0, import_node_os.tmpdir)(), "riddle-preview-upload-"));
|
|
169
244
|
const tarball = import_node_path.default.join(scratch, `${id}.tar.gz`);
|
|
245
|
+
let tarballBytes = 0;
|
|
170
246
|
try {
|
|
247
|
+
await emitProgress({
|
|
248
|
+
stage: "archiving",
|
|
249
|
+
id,
|
|
250
|
+
file_count: localSummary.file_count,
|
|
251
|
+
total_bytes: localSummary.total_bytes,
|
|
252
|
+
message: "creating preview archive"
|
|
253
|
+
});
|
|
171
254
|
(0, import_node_child_process.execFileSync)("tar", ["czf", tarball, "-C", directory, "."], { stdio: "pipe" });
|
|
255
|
+
tarballBytes = (0, import_node_fs.statSync)(tarball).size;
|
|
256
|
+
await emitProgress({
|
|
257
|
+
stage: "archived",
|
|
258
|
+
id,
|
|
259
|
+
file_count: localSummary.file_count,
|
|
260
|
+
total_bytes: localSummary.total_bytes,
|
|
261
|
+
tarball_bytes: tarballBytes,
|
|
262
|
+
message: "preview archive created"
|
|
263
|
+
});
|
|
264
|
+
await emitProgress({
|
|
265
|
+
stage: "uploading",
|
|
266
|
+
id,
|
|
267
|
+
file_count: localSummary.file_count,
|
|
268
|
+
total_bytes: localSummary.total_bytes,
|
|
269
|
+
tarball_bytes: tarballBytes,
|
|
270
|
+
message: "uploading preview archive"
|
|
271
|
+
});
|
|
172
272
|
const upload = await fetchFor(config)(uploadUrl, {
|
|
173
273
|
method: "PUT",
|
|
174
274
|
headers: { "Content-Type": "application/gzip" },
|
|
@@ -177,14 +277,37 @@ async function deployRiddlePreview(config, directory, label, framework = "static
|
|
|
177
277
|
if (!upload.ok) {
|
|
178
278
|
throw new RiddleApiError(uploadUrl, upload.status, await upload.text());
|
|
179
279
|
}
|
|
280
|
+
await emitProgress({
|
|
281
|
+
stage: "uploaded",
|
|
282
|
+
id,
|
|
283
|
+
file_count: localSummary.file_count,
|
|
284
|
+
total_bytes: localSummary.total_bytes,
|
|
285
|
+
tarball_bytes: tarballBytes,
|
|
286
|
+
message: "preview archive uploaded"
|
|
287
|
+
});
|
|
180
288
|
} finally {
|
|
181
289
|
(0, import_node_fs.rmSync)(scratch, { recursive: true, force: true });
|
|
182
290
|
}
|
|
183
291
|
const expiresAt = typeof created.expires_at === "string" ? created.expires_at : void 0;
|
|
184
292
|
try {
|
|
293
|
+
await emitProgress({
|
|
294
|
+
stage: "publishing",
|
|
295
|
+
id,
|
|
296
|
+
file_count: localSummary.file_count,
|
|
297
|
+
total_bytes: localSummary.total_bytes,
|
|
298
|
+
tarball_bytes: tarballBytes || void 0,
|
|
299
|
+
message: "publishing preview"
|
|
300
|
+
});
|
|
185
301
|
const published = await riddleRequestJson(config, `/v1/preview/${id}/publish`, {
|
|
186
302
|
method: "POST"
|
|
187
303
|
});
|
|
304
|
+
await emitProgress({
|
|
305
|
+
stage: "ready",
|
|
306
|
+
id,
|
|
307
|
+
preview_url: String(published.preview_url || ""),
|
|
308
|
+
file_count: typeof published.file_count === "number" ? published.file_count : localSummary.file_count,
|
|
309
|
+
total_bytes: typeof published.total_bytes === "number" ? published.total_bytes : localSummary.total_bytes
|
|
310
|
+
});
|
|
188
311
|
return previewDeployResultFromRecord({ record: published, id, label, framework, expiresAt, warnings });
|
|
189
312
|
} catch (error) {
|
|
190
313
|
if (!canRecoverPreviewPublish(error)) throw error;
|
|
@@ -194,7 +317,9 @@ async function deployRiddlePreview(config, directory, label, framework = "static
|
|
|
194
317
|
framework,
|
|
195
318
|
expiresAt,
|
|
196
319
|
publishError: error,
|
|
197
|
-
warnings
|
|
320
|
+
warnings,
|
|
321
|
+
localSummary,
|
|
322
|
+
emitProgress
|
|
198
323
|
});
|
|
199
324
|
}
|
|
200
325
|
}
|
package/dist/runtime/index.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from '../riddle-client.cjs';
|
|
1
|
+
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployProgressSnapshot, RiddlePreviewDeployResult, RiddlePreviewDeployStage, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from '../riddle-client.cjs';
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from '../riddle-client.js';
|
|
1
|
+
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployProgressSnapshot, RiddlePreviewDeployResult, RiddlePreviewDeployStage, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from '../riddle-client.js';
|
package/dist/runtime/index.js
CHANGED
|
@@ -132,10 +132,68 @@ function previewDeployResultFromRecord(input) {
|
|
|
132
132
|
function canRecoverPreviewPublish(error) {
|
|
133
133
|
return error instanceof RiddleApiError && PREVIEW_PUBLISH_RECOVERY_STATUSES.has(error.status);
|
|
134
134
|
}
|
|
135
|
+
function summarizePreviewDirectory(directory) {
|
|
136
|
+
const stack = [directory];
|
|
137
|
+
let fileCount = 0;
|
|
138
|
+
let totalBytes = 0;
|
|
139
|
+
while (stack.length) {
|
|
140
|
+
const current = stack.pop();
|
|
141
|
+
for (const entry of (0, import_node_fs.readdirSync)(current, { withFileTypes: true })) {
|
|
142
|
+
const fullPath = import_node_path.default.join(current, entry.name);
|
|
143
|
+
if (entry.isDirectory()) {
|
|
144
|
+
stack.push(fullPath);
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
if (!entry.isFile()) continue;
|
|
148
|
+
const stat = (0, import_node_fs.statSync)(fullPath);
|
|
149
|
+
fileCount += 1;
|
|
150
|
+
totalBytes += stat.size;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return { file_count: fileCount, total_bytes: totalBytes };
|
|
154
|
+
}
|
|
155
|
+
function previewProgressEmitter(config, base) {
|
|
156
|
+
return async (snapshot) => {
|
|
157
|
+
if (!config.onPreviewProgress) return;
|
|
158
|
+
await config.onPreviewProgress({
|
|
159
|
+
label: base.label,
|
|
160
|
+
framework: base.framework,
|
|
161
|
+
directory: base.directory,
|
|
162
|
+
elapsed_ms: Math.max(0, Date.now() - base.startedAt),
|
|
163
|
+
warnings: base.warnings?.length ? base.warnings : void 0,
|
|
164
|
+
...snapshot
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
}
|
|
135
168
|
async function waitForPublishedPreview(config, input) {
|
|
169
|
+
await input.emitProgress?.({
|
|
170
|
+
stage: "publish_recovering",
|
|
171
|
+
id: input.id,
|
|
172
|
+
file_count: input.localSummary?.file_count,
|
|
173
|
+
total_bytes: input.localSummary?.total_bytes,
|
|
174
|
+
publish_error: input.publishError.message,
|
|
175
|
+
message: `publish returned ${input.publishError.status}; polling preview status`
|
|
176
|
+
});
|
|
136
177
|
for (let attempt = 1; attempt <= PREVIEW_PUBLISH_RECOVERY_ATTEMPTS; attempt += 1) {
|
|
137
178
|
const status = await riddleRequestJson(config, `/v1/preview/${input.id}`);
|
|
179
|
+
await input.emitProgress?.({
|
|
180
|
+
stage: "checking_status",
|
|
181
|
+
id: input.id,
|
|
182
|
+
attempt,
|
|
183
|
+
attempts: PREVIEW_PUBLISH_RECOVERY_ATTEMPTS,
|
|
184
|
+
status: typeof status.status === "string" ? status.status : null,
|
|
185
|
+
preview_url: typeof status.preview_url === "string" ? status.preview_url : void 0,
|
|
186
|
+
file_count: typeof status.file_count === "number" ? status.file_count : input.localSummary?.file_count,
|
|
187
|
+
total_bytes: typeof status.total_bytes === "number" ? status.total_bytes : input.localSummary?.total_bytes
|
|
188
|
+
});
|
|
138
189
|
if (String(status.status || "") === "ready" && String(status.preview_url || "").trim()) {
|
|
190
|
+
await input.emitProgress?.({
|
|
191
|
+
stage: "ready",
|
|
192
|
+
id: input.id,
|
|
193
|
+
preview_url: String(status.preview_url),
|
|
194
|
+
file_count: typeof status.file_count === "number" ? status.file_count : input.localSummary?.file_count,
|
|
195
|
+
total_bytes: typeof status.total_bytes === "number" ? status.total_bytes : input.localSummary?.total_bytes
|
|
196
|
+
});
|
|
139
197
|
return previewDeployResultFromRecord({
|
|
140
198
|
record: status,
|
|
141
199
|
id: input.id,
|
|
@@ -157,7 +215,17 @@ async function deployRiddlePreview(config, directory, label, framework = "static
|
|
|
157
215
|
if (!directory?.trim()) throw new Error("directory is required");
|
|
158
216
|
if (!label?.trim()) throw new Error("label is required");
|
|
159
217
|
if (framework !== "spa" && framework !== "static") throw new Error("framework must be spa or static");
|
|
218
|
+
const startedAt = Date.now();
|
|
160
219
|
const warnings = collectRiddlePreviewDeployWarnings(directory, framework);
|
|
220
|
+
const emitProgress = previewProgressEmitter(config, { label, framework, directory, startedAt, warnings });
|
|
221
|
+
await emitProgress({ stage: "validating", message: "checking preview input directory" });
|
|
222
|
+
const localSummary = summarizePreviewDirectory(directory);
|
|
223
|
+
await emitProgress({
|
|
224
|
+
stage: "creating",
|
|
225
|
+
file_count: localSummary.file_count,
|
|
226
|
+
total_bytes: localSummary.total_bytes,
|
|
227
|
+
message: "creating preview upload target"
|
|
228
|
+
});
|
|
161
229
|
const created = await riddleRequestJson(config, "/v1/preview", {
|
|
162
230
|
method: "POST",
|
|
163
231
|
body: JSON.stringify({ framework, label })
|
|
@@ -165,10 +233,42 @@ async function deployRiddlePreview(config, directory, label, framework = "static
|
|
|
165
233
|
const id = String(created.id || "");
|
|
166
234
|
const uploadUrl = String(created.upload_url || "");
|
|
167
235
|
if (!id || !uploadUrl) throw new Error("Riddle preview create response was missing id or upload_url.");
|
|
236
|
+
await emitProgress({
|
|
237
|
+
stage: "created",
|
|
238
|
+
id,
|
|
239
|
+
file_count: localSummary.file_count,
|
|
240
|
+
total_bytes: localSummary.total_bytes,
|
|
241
|
+
message: "preview upload target created"
|
|
242
|
+
});
|
|
168
243
|
const scratch = (0, import_node_fs.mkdtempSync)(import_node_path.default.join((0, import_node_os.tmpdir)(), "riddle-preview-upload-"));
|
|
169
244
|
const tarball = import_node_path.default.join(scratch, `${id}.tar.gz`);
|
|
245
|
+
let tarballBytes = 0;
|
|
170
246
|
try {
|
|
247
|
+
await emitProgress({
|
|
248
|
+
stage: "archiving",
|
|
249
|
+
id,
|
|
250
|
+
file_count: localSummary.file_count,
|
|
251
|
+
total_bytes: localSummary.total_bytes,
|
|
252
|
+
message: "creating preview archive"
|
|
253
|
+
});
|
|
171
254
|
(0, import_node_child_process.execFileSync)("tar", ["czf", tarball, "-C", directory, "."], { stdio: "pipe" });
|
|
255
|
+
tarballBytes = (0, import_node_fs.statSync)(tarball).size;
|
|
256
|
+
await emitProgress({
|
|
257
|
+
stage: "archived",
|
|
258
|
+
id,
|
|
259
|
+
file_count: localSummary.file_count,
|
|
260
|
+
total_bytes: localSummary.total_bytes,
|
|
261
|
+
tarball_bytes: tarballBytes,
|
|
262
|
+
message: "preview archive created"
|
|
263
|
+
});
|
|
264
|
+
await emitProgress({
|
|
265
|
+
stage: "uploading",
|
|
266
|
+
id,
|
|
267
|
+
file_count: localSummary.file_count,
|
|
268
|
+
total_bytes: localSummary.total_bytes,
|
|
269
|
+
tarball_bytes: tarballBytes,
|
|
270
|
+
message: "uploading preview archive"
|
|
271
|
+
});
|
|
172
272
|
const upload = await fetchFor(config)(uploadUrl, {
|
|
173
273
|
method: "PUT",
|
|
174
274
|
headers: { "Content-Type": "application/gzip" },
|
|
@@ -177,14 +277,37 @@ async function deployRiddlePreview(config, directory, label, framework = "static
|
|
|
177
277
|
if (!upload.ok) {
|
|
178
278
|
throw new RiddleApiError(uploadUrl, upload.status, await upload.text());
|
|
179
279
|
}
|
|
280
|
+
await emitProgress({
|
|
281
|
+
stage: "uploaded",
|
|
282
|
+
id,
|
|
283
|
+
file_count: localSummary.file_count,
|
|
284
|
+
total_bytes: localSummary.total_bytes,
|
|
285
|
+
tarball_bytes: tarballBytes,
|
|
286
|
+
message: "preview archive uploaded"
|
|
287
|
+
});
|
|
180
288
|
} finally {
|
|
181
289
|
(0, import_node_fs.rmSync)(scratch, { recursive: true, force: true });
|
|
182
290
|
}
|
|
183
291
|
const expiresAt = typeof created.expires_at === "string" ? created.expires_at : void 0;
|
|
184
292
|
try {
|
|
293
|
+
await emitProgress({
|
|
294
|
+
stage: "publishing",
|
|
295
|
+
id,
|
|
296
|
+
file_count: localSummary.file_count,
|
|
297
|
+
total_bytes: localSummary.total_bytes,
|
|
298
|
+
tarball_bytes: tarballBytes || void 0,
|
|
299
|
+
message: "publishing preview"
|
|
300
|
+
});
|
|
185
301
|
const published = await riddleRequestJson(config, `/v1/preview/${id}/publish`, {
|
|
186
302
|
method: "POST"
|
|
187
303
|
});
|
|
304
|
+
await emitProgress({
|
|
305
|
+
stage: "ready",
|
|
306
|
+
id,
|
|
307
|
+
preview_url: String(published.preview_url || ""),
|
|
308
|
+
file_count: typeof published.file_count === "number" ? published.file_count : localSummary.file_count,
|
|
309
|
+
total_bytes: typeof published.total_bytes === "number" ? published.total_bytes : localSummary.total_bytes
|
|
310
|
+
});
|
|
188
311
|
return previewDeployResultFromRecord({ record: published, id, label, framework, expiresAt, warnings });
|
|
189
312
|
} catch (error) {
|
|
190
313
|
if (!canRecoverPreviewPublish(error)) throw error;
|
|
@@ -194,7 +317,9 @@ async function deployRiddlePreview(config, directory, label, framework = "static
|
|
|
194
317
|
framework,
|
|
195
318
|
expiresAt,
|
|
196
319
|
publishError: error,
|
|
197
|
-
warnings
|
|
320
|
+
warnings,
|
|
321
|
+
localSummary,
|
|
322
|
+
emitProgress
|
|
198
323
|
});
|
|
199
324
|
}
|
|
200
325
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from '../riddle-client.cjs';
|
|
1
|
+
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployProgressSnapshot, RiddlePreviewDeployResult, RiddlePreviewDeployStage, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from '../riddle-client.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from '../riddle-client.js';
|
|
1
|
+
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployProgressSnapshot, RiddlePreviewDeployResult, RiddlePreviewDeployStage, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from '../riddle-client.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riddledc/riddle-proof",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.38",
|
|
4
4
|
"description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "RiddleDC",
|
|
@@ -119,6 +119,11 @@
|
|
|
119
119
|
"import": "./dist/profile.js",
|
|
120
120
|
"require": "./dist/profile.cjs"
|
|
121
121
|
},
|
|
122
|
+
"./pr-comment": {
|
|
123
|
+
"types": "./dist/pr-comment.d.ts",
|
|
124
|
+
"import": "./dist/pr-comment.js",
|
|
125
|
+
"require": "./dist/pr-comment.cjs"
|
|
126
|
+
},
|
|
122
127
|
"./openclaw": {
|
|
123
128
|
"types": "./dist/openclaw.d.ts",
|
|
124
129
|
"import": "./dist/openclaw.js",
|
|
@@ -224,7 +229,7 @@
|
|
|
224
229
|
"typescript": "^5.4.5"
|
|
225
230
|
},
|
|
226
231
|
"scripts": {
|
|
227
|
-
"build": "npm --workspace @riddledc/riddle-proof-app-contract run build --if-present && tsup src/index.ts src/types.ts src/result.ts src/state.ts src/checkpoint.ts src/run-card.ts src/runner.ts src/engine-harness.ts src/codex-exec-agent.ts src/local-agent.ts src/cli.ts src/cli/index.ts src/diagnostics.ts src/proof-session.ts src/playability.ts src/basic-gameplay.ts src/profile.ts src/profile/index.ts src/openclaw.ts src/proof-run-core.ts src/proof-run-engine.ts src/riddle-client.ts src/runtime/riddle-client.ts src/spec/index.ts src/spec/types.ts src/spec/result.ts src/spec/state.ts src/spec/checkpoint.ts src/spec/run-card.ts src/runtime/index.ts src/app-contract/index.ts src/advanced/index.ts src/advanced/runner.ts src/advanced/engine-harness.ts src/advanced/proof-run-core.ts src/advanced/proof-run-engine.ts src/adapters/openclaw.ts src/adapters/local-agent.ts src/adapters/codex-exec-agent.ts src/adapters/codex.ts --format cjs,esm --dts --out-dir dist --clean",
|
|
232
|
+
"build": "npm --workspace @riddledc/riddle-proof-app-contract run build --if-present && tsup src/index.ts src/types.ts src/result.ts src/state.ts src/checkpoint.ts src/run-card.ts src/runner.ts src/engine-harness.ts src/codex-exec-agent.ts src/local-agent.ts src/cli.ts src/cli/index.ts src/diagnostics.ts src/proof-session.ts src/playability.ts src/basic-gameplay.ts src/profile.ts src/profile/index.ts src/pr-comment.ts src/openclaw.ts src/proof-run-core.ts src/proof-run-engine.ts src/riddle-client.ts src/runtime/riddle-client.ts src/spec/index.ts src/spec/types.ts src/spec/result.ts src/spec/state.ts src/spec/checkpoint.ts src/spec/run-card.ts src/runtime/index.ts src/app-contract/index.ts src/advanced/index.ts src/advanced/runner.ts src/advanced/engine-harness.ts src/advanced/proof-run-core.ts src/advanced/proof-run-engine.ts src/adapters/openclaw.ts src/adapters/local-agent.ts src/adapters/codex-exec-agent.ts src/adapters/codex.ts --format cjs,esm --dts --out-dir dist --clean",
|
|
228
233
|
"clean": "rm -rf dist",
|
|
229
234
|
"lint": "echo 'lint: (not configured)'",
|
|
230
235
|
"test": "npm run build && node test.js && node proof-run.test.js && node trust-boundary.test.js && node regression-packs.test.js && python3 runtime/tests/trust_boundary_regression.py && python3 runtime/tests/ship_artifact_publication.py && (python3 runtime/tests/recon_verify_smoke.py >/tmp/riddle-proof-recon-verify-smoke.json || (tail -120 /tmp/riddle-proof-recon-verify-smoke.json; exit 1))"
|