@riddledc/riddle-proof 0.7.91 → 0.7.92
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/{chunk-6RQGBHJ5.js → chunk-OI57LO6Y.js} +9 -2
- package/dist/cli.cjs +15 -4
- package/dist/cli.js +8 -3
- package/dist/index.cjs +10 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/riddle-client.cjs +10 -2
- package/dist/riddle-client.d.cts +5 -1
- package/dist/riddle-client.d.ts +5 -1
- package/dist/riddle-client.js +3 -1
- package/package.json +1 -1
|
@@ -48,12 +48,13 @@ async function riddleRequestJson(config, pathname, init = {}) {
|
|
|
48
48
|
if (!response.ok) throw new RiddleApiError(pathname, response.status, text);
|
|
49
49
|
return json ?? text;
|
|
50
50
|
}
|
|
51
|
-
async function
|
|
51
|
+
async function deployRiddlePreview(config, directory, label, framework = "static") {
|
|
52
52
|
if (!directory?.trim()) throw new Error("directory is required");
|
|
53
53
|
if (!label?.trim()) throw new Error("label is required");
|
|
54
|
+
if (framework !== "spa" && framework !== "static") throw new Error("framework must be spa or static");
|
|
54
55
|
const created = await riddleRequestJson(config, "/v1/preview", {
|
|
55
56
|
method: "POST",
|
|
56
|
-
body: JSON.stringify({ framework
|
|
57
|
+
body: JSON.stringify({ framework, label })
|
|
57
58
|
});
|
|
58
59
|
const id = String(created.id || "");
|
|
59
60
|
const uploadUrl = String(created.upload_url || "");
|
|
@@ -80,6 +81,7 @@ async function deployRiddleStaticPreview(config, directory, label) {
|
|
|
80
81
|
ok: true,
|
|
81
82
|
id: String(published.id || id),
|
|
82
83
|
label,
|
|
84
|
+
framework,
|
|
83
85
|
preview_url: String(published.preview_url || ""),
|
|
84
86
|
file_count: typeof published.file_count === "number" ? published.file_count : void 0,
|
|
85
87
|
total_bytes: typeof published.total_bytes === "number" ? published.total_bytes : void 0,
|
|
@@ -87,6 +89,9 @@ async function deployRiddleStaticPreview(config, directory, label) {
|
|
|
87
89
|
raw: published
|
|
88
90
|
};
|
|
89
91
|
}
|
|
92
|
+
async function deployRiddleStaticPreview(config, directory, label) {
|
|
93
|
+
return deployRiddlePreview(config, directory, label, "static");
|
|
94
|
+
}
|
|
90
95
|
function createTarball(directory, label, exclude = []) {
|
|
91
96
|
const scratch = mkdtempSync(path.join(tmpdir(), "riddle-upload-"));
|
|
92
97
|
const tarball = path.join(scratch, `${label}.tar.gz`);
|
|
@@ -318,6 +323,7 @@ async function pollRiddleJob(config, jobId, options = {}) {
|
|
|
318
323
|
function createRiddleApiClient(config = {}) {
|
|
319
324
|
return {
|
|
320
325
|
requestJson: (pathname, init) => riddleRequestJson(config, pathname, init),
|
|
326
|
+
deployPreview: (directory, label, framework = "static") => deployRiddlePreview(config, directory, label, framework),
|
|
321
327
|
deployStaticPreview: (directory, label) => deployRiddleStaticPreview(config, directory, label),
|
|
322
328
|
runScript: (input) => runRiddleScript(config, input),
|
|
323
329
|
runServerPreview: (input) => runRiddleServerPreview(config, input),
|
|
@@ -331,6 +337,7 @@ export {
|
|
|
331
337
|
RiddleApiError,
|
|
332
338
|
resolveRiddleApiKey,
|
|
333
339
|
riddleRequestJson,
|
|
340
|
+
deployRiddlePreview,
|
|
334
341
|
deployRiddleStaticPreview,
|
|
335
342
|
parseRiddleViewport,
|
|
336
343
|
runRiddleServerPreview,
|
package/dist/cli.cjs
CHANGED
|
@@ -6609,12 +6609,13 @@ async function riddleRequestJson(config, pathname, init = {}) {
|
|
|
6609
6609
|
if (!response.ok) throw new RiddleApiError(pathname, response.status, text);
|
|
6610
6610
|
return json ?? text;
|
|
6611
6611
|
}
|
|
6612
|
-
async function
|
|
6612
|
+
async function deployRiddlePreview(config, directory, label, framework = "static") {
|
|
6613
6613
|
if (!directory?.trim()) throw new Error("directory is required");
|
|
6614
6614
|
if (!label?.trim()) throw new Error("label is required");
|
|
6615
|
+
if (framework !== "spa" && framework !== "static") throw new Error("framework must be spa or static");
|
|
6615
6616
|
const created = await riddleRequestJson(config, "/v1/preview", {
|
|
6616
6617
|
method: "POST",
|
|
6617
|
-
body: JSON.stringify({ framework
|
|
6618
|
+
body: JSON.stringify({ framework, label })
|
|
6618
6619
|
});
|
|
6619
6620
|
const id = String(created.id || "");
|
|
6620
6621
|
const uploadUrl = String(created.upload_url || "");
|
|
@@ -6641,6 +6642,7 @@ async function deployRiddleStaticPreview(config, directory, label) {
|
|
|
6641
6642
|
ok: true,
|
|
6642
6643
|
id: String(published.id || id),
|
|
6643
6644
|
label,
|
|
6645
|
+
framework,
|
|
6644
6646
|
preview_url: String(published.preview_url || ""),
|
|
6645
6647
|
file_count: typeof published.file_count === "number" ? published.file_count : void 0,
|
|
6646
6648
|
total_bytes: typeof published.total_bytes === "number" ? published.total_bytes : void 0,
|
|
@@ -6648,6 +6650,9 @@ async function deployRiddleStaticPreview(config, directory, label) {
|
|
|
6648
6650
|
raw: published
|
|
6649
6651
|
};
|
|
6650
6652
|
}
|
|
6653
|
+
async function deployRiddleStaticPreview(config, directory, label) {
|
|
6654
|
+
return deployRiddlePreview(config, directory, label, "static");
|
|
6655
|
+
}
|
|
6651
6656
|
function createTarball(directory, label, exclude = []) {
|
|
6652
6657
|
const scratch = (0, import_node_fs5.mkdtempSync)(import_node_path5.default.join((0, import_node_os2.tmpdir)(), "riddle-upload-"));
|
|
6653
6658
|
const tarball = import_node_path5.default.join(scratch, `${label}.tar.gz`);
|
|
@@ -6879,6 +6884,7 @@ async function pollRiddleJob(config, jobId, options = {}) {
|
|
|
6879
6884
|
function createRiddleApiClient(config = {}) {
|
|
6880
6885
|
return {
|
|
6881
6886
|
requestJson: (pathname, init) => riddleRequestJson(config, pathname, init),
|
|
6887
|
+
deployPreview: (directory, label, framework = "static") => deployRiddlePreview(config, directory, label, framework),
|
|
6882
6888
|
deployStaticPreview: (directory, label) => deployRiddleStaticPreview(config, directory, label),
|
|
6883
6889
|
runScript: (input) => runRiddleScript(config, input),
|
|
6884
6890
|
runServerPreview: (input) => runRiddleServerPreview(config, input),
|
|
@@ -11821,7 +11827,7 @@ function usage() {
|
|
|
11821
11827
|
" riddle-proof-loop respond --state-path <path> --decision <decision> --summary <text> [--payload-json <file|json|->]",
|
|
11822
11828
|
" riddle-proof-loop status --state-path <path>",
|
|
11823
11829
|
" riddle-proof-loop run-profile --profile <file|json|-> --url <base-url> [--runner riddle] [--strict true|false] [--poll-attempts n] [--output <dir>|--output-dir <dir>] [--quiet]",
|
|
11824
|
-
" riddle-proof-loop riddle-preview-deploy <build-dir> <label>",
|
|
11830
|
+
" riddle-proof-loop riddle-preview-deploy <build-dir> <label> [--framework spa|static]",
|
|
11825
11831
|
" riddle-proof-loop riddle-server-preview <directory> --script-file <file> [--path /route] [--wait-for-selector selector]",
|
|
11826
11832
|
" riddle-proof-loop riddle-run-script --url <url> --script-file <file> [--viewport 1280x720] [--strict true|false]",
|
|
11827
11833
|
" riddle-proof-loop riddle-poll <job-id> [--wait] [--attempts n] [--quiet]",
|
|
@@ -11885,6 +11891,11 @@ function optionNumber(options, ...keys) {
|
|
|
11885
11891
|
function profileOutputDirOption(options) {
|
|
11886
11892
|
return optionString(options, "output") ?? optionString(options, "outputDir");
|
|
11887
11893
|
}
|
|
11894
|
+
function previewFrameworkOption(options) {
|
|
11895
|
+
const framework = optionString(options, "framework") ?? "static";
|
|
11896
|
+
if (framework === "spa" || framework === "static") return framework;
|
|
11897
|
+
throw new Error("--framework must be spa or static.");
|
|
11898
|
+
}
|
|
11888
11899
|
function readStdin() {
|
|
11889
11900
|
return (0, import_node_fs6.readFileSync)(0, "utf-8");
|
|
11890
11901
|
}
|
|
@@ -12597,7 +12608,7 @@ async function main() {
|
|
|
12597
12608
|
if (command === "riddle-preview-deploy") {
|
|
12598
12609
|
const buildDir = positional[1];
|
|
12599
12610
|
const label = positional[2];
|
|
12600
|
-
const result = await createRiddleApiClient(riddleClientConfig(options)).
|
|
12611
|
+
const result = await createRiddleApiClient(riddleClientConfig(options)).deployPreview(buildDir, label, previewFrameworkOption(options));
|
|
12601
12612
|
process.stdout.write(`${JSON.stringify(result, null, 2)}
|
|
12602
12613
|
`);
|
|
12603
12614
|
return;
|
package/dist/cli.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
createRiddleApiClient,
|
|
16
16
|
parseRiddleViewport
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-OI57LO6Y.js";
|
|
18
18
|
import {
|
|
19
19
|
createDisabledRiddleProofAgentAdapter,
|
|
20
20
|
readRiddleProofRunStatus,
|
|
@@ -45,7 +45,7 @@ function usage() {
|
|
|
45
45
|
" riddle-proof-loop respond --state-path <path> --decision <decision> --summary <text> [--payload-json <file|json|->]",
|
|
46
46
|
" riddle-proof-loop status --state-path <path>",
|
|
47
47
|
" riddle-proof-loop run-profile --profile <file|json|-> --url <base-url> [--runner riddle] [--strict true|false] [--poll-attempts n] [--output <dir>|--output-dir <dir>] [--quiet]",
|
|
48
|
-
" riddle-proof-loop riddle-preview-deploy <build-dir> <label>",
|
|
48
|
+
" riddle-proof-loop riddle-preview-deploy <build-dir> <label> [--framework spa|static]",
|
|
49
49
|
" riddle-proof-loop riddle-server-preview <directory> --script-file <file> [--path /route] [--wait-for-selector selector]",
|
|
50
50
|
" riddle-proof-loop riddle-run-script --url <url> --script-file <file> [--viewport 1280x720] [--strict true|false]",
|
|
51
51
|
" riddle-proof-loop riddle-poll <job-id> [--wait] [--attempts n] [--quiet]",
|
|
@@ -109,6 +109,11 @@ function optionNumber(options, ...keys) {
|
|
|
109
109
|
function profileOutputDirOption(options) {
|
|
110
110
|
return optionString(options, "output") ?? optionString(options, "outputDir");
|
|
111
111
|
}
|
|
112
|
+
function previewFrameworkOption(options) {
|
|
113
|
+
const framework = optionString(options, "framework") ?? "static";
|
|
114
|
+
if (framework === "spa" || framework === "static") return framework;
|
|
115
|
+
throw new Error("--framework must be spa or static.");
|
|
116
|
+
}
|
|
112
117
|
function readStdin() {
|
|
113
118
|
return readFileSync(0, "utf-8");
|
|
114
119
|
}
|
|
@@ -821,7 +826,7 @@ async function main() {
|
|
|
821
826
|
if (command === "riddle-preview-deploy") {
|
|
822
827
|
const buildDir = positional[1];
|
|
823
828
|
const label = positional[2];
|
|
824
|
-
const result = await createRiddleApiClient(riddleClientConfig(options)).
|
|
829
|
+
const result = await createRiddleApiClient(riddleClientConfig(options)).deployPreview(buildDir, label, previewFrameworkOption(options));
|
|
825
830
|
process.stdout.write(`${JSON.stringify(result, null, 2)}
|
|
826
831
|
`);
|
|
827
832
|
return;
|
package/dist/index.cjs
CHANGED
|
@@ -2968,6 +2968,7 @@ __export(index_exports, {
|
|
|
2968
2968
|
createRunResult: () => createRunResult,
|
|
2969
2969
|
createRunState: () => createRunState,
|
|
2970
2970
|
createRunStatusSnapshot: () => createRunStatusSnapshot,
|
|
2971
|
+
deployRiddlePreview: () => deployRiddlePreview,
|
|
2971
2972
|
deployRiddleStaticPreview: () => deployRiddleStaticPreview,
|
|
2972
2973
|
extractBasicGameplayEvidence: () => extractBasicGameplayEvidence,
|
|
2973
2974
|
extractPlayabilityEvidence: () => extractPlayabilityEvidence,
|
|
@@ -13718,12 +13719,13 @@ async function riddleRequestJson(config, pathname, init = {}) {
|
|
|
13718
13719
|
if (!response.ok) throw new RiddleApiError(pathname, response.status, text);
|
|
13719
13720
|
return json ?? text;
|
|
13720
13721
|
}
|
|
13721
|
-
async function
|
|
13722
|
+
async function deployRiddlePreview(config, directory, label, framework = "static") {
|
|
13722
13723
|
if (!directory?.trim()) throw new Error("directory is required");
|
|
13723
13724
|
if (!label?.trim()) throw new Error("label is required");
|
|
13725
|
+
if (framework !== "spa" && framework !== "static") throw new Error("framework must be spa or static");
|
|
13724
13726
|
const created = await riddleRequestJson(config, "/v1/preview", {
|
|
13725
13727
|
method: "POST",
|
|
13726
|
-
body: JSON.stringify({ framework
|
|
13728
|
+
body: JSON.stringify({ framework, label })
|
|
13727
13729
|
});
|
|
13728
13730
|
const id = String(created.id || "");
|
|
13729
13731
|
const uploadUrl = String(created.upload_url || "");
|
|
@@ -13750,6 +13752,7 @@ async function deployRiddleStaticPreview(config, directory, label) {
|
|
|
13750
13752
|
ok: true,
|
|
13751
13753
|
id: String(published.id || id),
|
|
13752
13754
|
label,
|
|
13755
|
+
framework,
|
|
13753
13756
|
preview_url: String(published.preview_url || ""),
|
|
13754
13757
|
file_count: typeof published.file_count === "number" ? published.file_count : void 0,
|
|
13755
13758
|
total_bytes: typeof published.total_bytes === "number" ? published.total_bytes : void 0,
|
|
@@ -13757,6 +13760,9 @@ async function deployRiddleStaticPreview(config, directory, label) {
|
|
|
13757
13760
|
raw: published
|
|
13758
13761
|
};
|
|
13759
13762
|
}
|
|
13763
|
+
async function deployRiddleStaticPreview(config, directory, label) {
|
|
13764
|
+
return deployRiddlePreview(config, directory, label, "static");
|
|
13765
|
+
}
|
|
13760
13766
|
function createTarball(directory, label, exclude = []) {
|
|
13761
13767
|
const scratch = (0, import_node_fs5.mkdtempSync)(import_node_path5.default.join((0, import_node_os2.tmpdir)(), "riddle-upload-"));
|
|
13762
13768
|
const tarball = import_node_path5.default.join(scratch, `${label}.tar.gz`);
|
|
@@ -13988,6 +13994,7 @@ async function pollRiddleJob(config, jobId, options = {}) {
|
|
|
13988
13994
|
function createRiddleApiClient(config = {}) {
|
|
13989
13995
|
return {
|
|
13990
13996
|
requestJson: (pathname, init) => riddleRequestJson(config, pathname, init),
|
|
13997
|
+
deployPreview: (directory, label, framework = "static") => deployRiddlePreview(config, directory, label, framework),
|
|
13991
13998
|
deployStaticPreview: (directory, label) => deployRiddleStaticPreview(config, directory, label),
|
|
13992
13999
|
runScript: (input) => runRiddleScript(config, input),
|
|
13993
14000
|
runServerPreview: (input) => runRiddleServerPreview(config, input),
|
|
@@ -14065,6 +14072,7 @@ function createRiddleApiClient(config = {}) {
|
|
|
14065
14072
|
createRunResult,
|
|
14066
14073
|
createRunState,
|
|
14067
14074
|
createRunStatusSnapshot,
|
|
14075
|
+
deployRiddlePreview,
|
|
14068
14076
|
deployRiddleStaticPreview,
|
|
14069
14077
|
extractBasicGameplayEvidence,
|
|
14070
14078
|
extractPlayabilityEvidence,
|
package/dist/index.d.cts
CHANGED
|
@@ -11,4 +11,4 @@ export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_V
|
|
|
11
11
|
export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.cjs';
|
|
12
12
|
export { AssessBasicGameplayOptions, AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, BasicGameplayActionResult, BasicGameplayActionType, BasicGameplayArtifactResolution, BasicGameplayAssessmentSummary, BasicGameplayBoundsOffender, BasicGameplayCanvasState, BasicGameplayCatchRecord, BasicGameplayChangeSummary, BasicGameplayFailureCode, BasicGameplayFixReference, BasicGameplayMetric, BasicGameplayMobileEvidence, BasicGameplayProgressCheckType, BasicGameplayProgressionCheck, BasicGameplayProofArtifact, BasicGameplayResponsiveViewportEvidence, BasicGameplayRouteReference, BasicGameplaySnapshot, BasicGameplaySuiteFailure, BasicGameplayWarningCode, CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, RiddleProofBasicGameplayAssessment, RiddleProofBasicGameplayCatchSummary, RiddleProofBasicGameplayEvidence, RiddleProofBasicGameplayRouteAssessment, RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString } from './basic-gameplay.cjs';
|
|
13
13
|
export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.cjs';
|
|
14
|
-
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, createRiddleApiClient, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.cjs';
|
|
14
|
+
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_V
|
|
|
11
11
|
export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.js';
|
|
12
12
|
export { AssessBasicGameplayOptions, AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, BasicGameplayActionResult, BasicGameplayActionType, BasicGameplayArtifactResolution, BasicGameplayAssessmentSummary, BasicGameplayBoundsOffender, BasicGameplayCanvasState, BasicGameplayCatchRecord, BasicGameplayChangeSummary, BasicGameplayFailureCode, BasicGameplayFixReference, BasicGameplayMetric, BasicGameplayMobileEvidence, BasicGameplayProgressCheckType, BasicGameplayProgressionCheck, BasicGameplayProofArtifact, BasicGameplayResponsiveViewportEvidence, BasicGameplayRouteReference, BasicGameplaySnapshot, BasicGameplaySuiteFailure, BasicGameplayWarningCode, CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, RiddleProofBasicGameplayAssessment, RiddleProofBasicGameplayCatchSummary, RiddleProofBasicGameplayEvidence, RiddleProofBasicGameplayRouteAssessment, RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString } from './basic-gameplay.js';
|
|
13
13
|
export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.js';
|
|
14
|
-
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, createRiddleApiClient, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.js';
|
|
14
|
+
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.js';
|
package/dist/index.js
CHANGED
|
@@ -64,6 +64,7 @@ import {
|
|
|
64
64
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
|
65
65
|
RiddleApiError,
|
|
66
66
|
createRiddleApiClient,
|
|
67
|
+
deployRiddlePreview,
|
|
67
68
|
deployRiddleStaticPreview,
|
|
68
69
|
isTerminalRiddleJobStatus,
|
|
69
70
|
parseRiddleViewport,
|
|
@@ -72,7 +73,7 @@ import {
|
|
|
72
73
|
riddleRequestJson,
|
|
73
74
|
runRiddleScript,
|
|
74
75
|
runRiddleServerPreview
|
|
75
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-OI57LO6Y.js";
|
|
76
77
|
import {
|
|
77
78
|
DEFAULT_DIAGNOSTIC_ARRAY_LIMIT,
|
|
78
79
|
DEFAULT_DIAGNOSTIC_HISTORY_LIMIT,
|
|
@@ -207,6 +208,7 @@ export {
|
|
|
207
208
|
createRunResult,
|
|
208
209
|
createRunState,
|
|
209
210
|
createRunStatusSnapshot,
|
|
211
|
+
deployRiddlePreview,
|
|
210
212
|
deployRiddleStaticPreview,
|
|
211
213
|
extractBasicGameplayEvidence,
|
|
212
214
|
extractPlayabilityEvidence,
|
package/dist/riddle-client.cjs
CHANGED
|
@@ -34,6 +34,7 @@ __export(riddle_client_exports, {
|
|
|
34
34
|
DEFAULT_RIDDLE_API_KEY_FILE: () => DEFAULT_RIDDLE_API_KEY_FILE,
|
|
35
35
|
RiddleApiError: () => RiddleApiError,
|
|
36
36
|
createRiddleApiClient: () => createRiddleApiClient,
|
|
37
|
+
deployRiddlePreview: () => deployRiddlePreview,
|
|
37
38
|
deployRiddleStaticPreview: () => deployRiddleStaticPreview,
|
|
38
39
|
isTerminalRiddleJobStatus: () => isTerminalRiddleJobStatus,
|
|
39
40
|
parseRiddleViewport: () => parseRiddleViewport,
|
|
@@ -93,12 +94,13 @@ async function riddleRequestJson(config, pathname, init = {}) {
|
|
|
93
94
|
if (!response.ok) throw new RiddleApiError(pathname, response.status, text);
|
|
94
95
|
return json ?? text;
|
|
95
96
|
}
|
|
96
|
-
async function
|
|
97
|
+
async function deployRiddlePreview(config, directory, label, framework = "static") {
|
|
97
98
|
if (!directory?.trim()) throw new Error("directory is required");
|
|
98
99
|
if (!label?.trim()) throw new Error("label is required");
|
|
100
|
+
if (framework !== "spa" && framework !== "static") throw new Error("framework must be spa or static");
|
|
99
101
|
const created = await riddleRequestJson(config, "/v1/preview", {
|
|
100
102
|
method: "POST",
|
|
101
|
-
body: JSON.stringify({ framework
|
|
103
|
+
body: JSON.stringify({ framework, label })
|
|
102
104
|
});
|
|
103
105
|
const id = String(created.id || "");
|
|
104
106
|
const uploadUrl = String(created.upload_url || "");
|
|
@@ -125,6 +127,7 @@ async function deployRiddleStaticPreview(config, directory, label) {
|
|
|
125
127
|
ok: true,
|
|
126
128
|
id: String(published.id || id),
|
|
127
129
|
label,
|
|
130
|
+
framework,
|
|
128
131
|
preview_url: String(published.preview_url || ""),
|
|
129
132
|
file_count: typeof published.file_count === "number" ? published.file_count : void 0,
|
|
130
133
|
total_bytes: typeof published.total_bytes === "number" ? published.total_bytes : void 0,
|
|
@@ -132,6 +135,9 @@ async function deployRiddleStaticPreview(config, directory, label) {
|
|
|
132
135
|
raw: published
|
|
133
136
|
};
|
|
134
137
|
}
|
|
138
|
+
async function deployRiddleStaticPreview(config, directory, label) {
|
|
139
|
+
return deployRiddlePreview(config, directory, label, "static");
|
|
140
|
+
}
|
|
135
141
|
function createTarball(directory, label, exclude = []) {
|
|
136
142
|
const scratch = (0, import_node_fs.mkdtempSync)(import_node_path.default.join((0, import_node_os.tmpdir)(), "riddle-upload-"));
|
|
137
143
|
const tarball = import_node_path.default.join(scratch, `${label}.tar.gz`);
|
|
@@ -363,6 +369,7 @@ async function pollRiddleJob(config, jobId, options = {}) {
|
|
|
363
369
|
function createRiddleApiClient(config = {}) {
|
|
364
370
|
return {
|
|
365
371
|
requestJson: (pathname, init) => riddleRequestJson(config, pathname, init),
|
|
372
|
+
deployPreview: (directory, label, framework = "static") => deployRiddlePreview(config, directory, label, framework),
|
|
366
373
|
deployStaticPreview: (directory, label) => deployRiddleStaticPreview(config, directory, label),
|
|
367
374
|
runScript: (input) => runRiddleScript(config, input),
|
|
368
375
|
runServerPreview: (input) => runRiddleServerPreview(config, input),
|
|
@@ -375,6 +382,7 @@ function createRiddleApiClient(config = {}) {
|
|
|
375
382
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
|
376
383
|
RiddleApiError,
|
|
377
384
|
createRiddleApiClient,
|
|
385
|
+
deployRiddlePreview,
|
|
378
386
|
deployRiddleStaticPreview,
|
|
379
387
|
isTerminalRiddleJobStatus,
|
|
380
388
|
parseRiddleViewport,
|
package/dist/riddle-client.d.cts
CHANGED
|
@@ -32,10 +32,12 @@ interface RiddlePollJobOptions {
|
|
|
32
32
|
progressEveryMs?: number;
|
|
33
33
|
onProgress?: (snapshot: RiddlePollProgressSnapshot) => void | Promise<void>;
|
|
34
34
|
}
|
|
35
|
+
type RiddlePreviewFramework = "spa" | "static";
|
|
35
36
|
interface RiddlePreviewDeployResult {
|
|
36
37
|
ok: true;
|
|
37
38
|
id: string;
|
|
38
39
|
label: string;
|
|
40
|
+
framework: RiddlePreviewFramework;
|
|
39
41
|
preview_url: string;
|
|
40
42
|
file_count?: number;
|
|
41
43
|
total_bytes?: number;
|
|
@@ -101,6 +103,7 @@ declare class RiddleApiError extends Error {
|
|
|
101
103
|
}
|
|
102
104
|
declare function resolveRiddleApiKey(config?: RiddleClientConfig): string;
|
|
103
105
|
declare function riddleRequestJson<T = unknown>(config: RiddleClientConfig, pathname: string, init?: RequestInit): Promise<T>;
|
|
106
|
+
declare function deployRiddlePreview(config: RiddleClientConfig, directory: string, label: string, framework?: RiddlePreviewFramework): Promise<RiddlePreviewDeployResult>;
|
|
104
107
|
declare function deployRiddleStaticPreview(config: RiddleClientConfig, directory: string, label: string): Promise<RiddlePreviewDeployResult>;
|
|
105
108
|
declare function parseRiddleViewport(value?: string): {
|
|
106
109
|
width: number;
|
|
@@ -112,10 +115,11 @@ declare function isTerminalRiddleJobStatus(status: unknown): boolean;
|
|
|
112
115
|
declare function pollRiddleJob(config: RiddleClientConfig, jobId: string, options?: RiddlePollJobOptions): Promise<RiddlePollJobResult>;
|
|
113
116
|
declare function createRiddleApiClient(config?: RiddleClientConfig): {
|
|
114
117
|
requestJson: <T = unknown>(pathname: string, init?: RequestInit) => Promise<T>;
|
|
118
|
+
deployPreview: (directory: string, label: string, framework?: RiddlePreviewFramework) => Promise<RiddlePreviewDeployResult>;
|
|
115
119
|
deployStaticPreview: (directory: string, label: string) => Promise<RiddlePreviewDeployResult>;
|
|
116
120
|
runScript: (input: RiddleRunScriptInput) => Promise<Record<string, unknown>>;
|
|
117
121
|
runServerPreview: (input: RiddleServerPreviewInput) => Promise<RiddleServerPreviewResult>;
|
|
118
122
|
pollJob: (jobId: string, options?: RiddlePollJobOptions) => Promise<RiddlePollJobResult>;
|
|
119
123
|
};
|
|
120
124
|
|
|
121
|
-
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, type RiddleClientConfig, type RiddleFetch, type RiddlePollJobOptions, type RiddlePollJobResult, type RiddlePollProgressSnapshot, type RiddlePollSummary, type RiddlePreviewDeployResult, type RiddleRunScriptInput, type RiddleServerPreviewInput, type RiddleServerPreviewResult, createRiddleApiClient, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview };
|
|
125
|
+
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, type RiddleClientConfig, type RiddleFetch, type RiddlePollJobOptions, type RiddlePollJobResult, type RiddlePollProgressSnapshot, type RiddlePollSummary, type RiddlePreviewDeployResult, type RiddlePreviewFramework, type RiddleRunScriptInput, type RiddleServerPreviewInput, type RiddleServerPreviewResult, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview };
|
package/dist/riddle-client.d.ts
CHANGED
|
@@ -32,10 +32,12 @@ interface RiddlePollJobOptions {
|
|
|
32
32
|
progressEveryMs?: number;
|
|
33
33
|
onProgress?: (snapshot: RiddlePollProgressSnapshot) => void | Promise<void>;
|
|
34
34
|
}
|
|
35
|
+
type RiddlePreviewFramework = "spa" | "static";
|
|
35
36
|
interface RiddlePreviewDeployResult {
|
|
36
37
|
ok: true;
|
|
37
38
|
id: string;
|
|
38
39
|
label: string;
|
|
40
|
+
framework: RiddlePreviewFramework;
|
|
39
41
|
preview_url: string;
|
|
40
42
|
file_count?: number;
|
|
41
43
|
total_bytes?: number;
|
|
@@ -101,6 +103,7 @@ declare class RiddleApiError extends Error {
|
|
|
101
103
|
}
|
|
102
104
|
declare function resolveRiddleApiKey(config?: RiddleClientConfig): string;
|
|
103
105
|
declare function riddleRequestJson<T = unknown>(config: RiddleClientConfig, pathname: string, init?: RequestInit): Promise<T>;
|
|
106
|
+
declare function deployRiddlePreview(config: RiddleClientConfig, directory: string, label: string, framework?: RiddlePreviewFramework): Promise<RiddlePreviewDeployResult>;
|
|
104
107
|
declare function deployRiddleStaticPreview(config: RiddleClientConfig, directory: string, label: string): Promise<RiddlePreviewDeployResult>;
|
|
105
108
|
declare function parseRiddleViewport(value?: string): {
|
|
106
109
|
width: number;
|
|
@@ -112,10 +115,11 @@ declare function isTerminalRiddleJobStatus(status: unknown): boolean;
|
|
|
112
115
|
declare function pollRiddleJob(config: RiddleClientConfig, jobId: string, options?: RiddlePollJobOptions): Promise<RiddlePollJobResult>;
|
|
113
116
|
declare function createRiddleApiClient(config?: RiddleClientConfig): {
|
|
114
117
|
requestJson: <T = unknown>(pathname: string, init?: RequestInit) => Promise<T>;
|
|
118
|
+
deployPreview: (directory: string, label: string, framework?: RiddlePreviewFramework) => Promise<RiddlePreviewDeployResult>;
|
|
115
119
|
deployStaticPreview: (directory: string, label: string) => Promise<RiddlePreviewDeployResult>;
|
|
116
120
|
runScript: (input: RiddleRunScriptInput) => Promise<Record<string, unknown>>;
|
|
117
121
|
runServerPreview: (input: RiddleServerPreviewInput) => Promise<RiddleServerPreviewResult>;
|
|
118
122
|
pollJob: (jobId: string, options?: RiddlePollJobOptions) => Promise<RiddlePollJobResult>;
|
|
119
123
|
};
|
|
120
124
|
|
|
121
|
-
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, type RiddleClientConfig, type RiddleFetch, type RiddlePollJobOptions, type RiddlePollJobResult, type RiddlePollProgressSnapshot, type RiddlePollSummary, type RiddlePreviewDeployResult, type RiddleRunScriptInput, type RiddleServerPreviewInput, type RiddleServerPreviewResult, createRiddleApiClient, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview };
|
|
125
|
+
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, type RiddleClientConfig, type RiddleFetch, type RiddlePollJobOptions, type RiddlePollJobResult, type RiddlePollProgressSnapshot, type RiddlePollSummary, type RiddlePreviewDeployResult, type RiddlePreviewFramework, type RiddleRunScriptInput, type RiddleServerPreviewInput, type RiddleServerPreviewResult, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview };
|
package/dist/riddle-client.js
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
|
4
4
|
RiddleApiError,
|
|
5
5
|
createRiddleApiClient,
|
|
6
|
+
deployRiddlePreview,
|
|
6
7
|
deployRiddleStaticPreview,
|
|
7
8
|
isTerminalRiddleJobStatus,
|
|
8
9
|
parseRiddleViewport,
|
|
@@ -11,12 +12,13 @@ import {
|
|
|
11
12
|
riddleRequestJson,
|
|
12
13
|
runRiddleScript,
|
|
13
14
|
runRiddleServerPreview
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-OI57LO6Y.js";
|
|
15
16
|
export {
|
|
16
17
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
17
18
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
|
18
19
|
RiddleApiError,
|
|
19
20
|
createRiddleApiClient,
|
|
21
|
+
deployRiddlePreview,
|
|
20
22
|
deployRiddleStaticPreview,
|
|
21
23
|
isTerminalRiddleJobStatus,
|
|
22
24
|
parseRiddleViewport,
|