@riddledc/riddle-proof 0.5.34 → 0.5.36
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/openclaw.cjs +24 -0
- package/dist/openclaw.d.cts +7 -1
- package/dist/openclaw.d.ts +7 -1
- package/dist/openclaw.js +23 -0
- package/package.json +1 -1
- package/runtime/lib/riddle_core_call.mjs +12 -0
- package/runtime/lib/util.py +2 -0
package/dist/openclaw.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var openclaw_exports = {};
|
|
|
22
22
|
__export(openclaw_exports, {
|
|
23
23
|
openClawIntegrationContext: () => openClawIntegrationContext,
|
|
24
24
|
parseOpenClawAssertions: () => parseOpenClawAssertions,
|
|
25
|
+
parseOpenClawJsonObjectOrArray: () => parseOpenClawJsonObjectOrArray,
|
|
25
26
|
toRiddleProofRunParams: () => toRiddleProofRunParams
|
|
26
27
|
});
|
|
27
28
|
module.exports = __toCommonJS(openclaw_exports);
|
|
@@ -111,6 +112,23 @@ function parseOpenClawAssertions(value) {
|
|
|
111
112
|
return trimmed;
|
|
112
113
|
}
|
|
113
114
|
}
|
|
115
|
+
function parseOpenClawJsonObjectOrArray(value, name) {
|
|
116
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
117
|
+
if (typeof value !== "string") return value;
|
|
118
|
+
const trimmed = value.trim();
|
|
119
|
+
if (!trimmed) return void 0;
|
|
120
|
+
let parsed;
|
|
121
|
+
try {
|
|
122
|
+
parsed = JSON.parse(trimmed);
|
|
123
|
+
} catch (error) {
|
|
124
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
125
|
+
throw new Error(`${name} is not valid JSON: ${message}`);
|
|
126
|
+
}
|
|
127
|
+
if (parsed === null || typeof parsed !== "object" && !Array.isArray(parsed)) {
|
|
128
|
+
throw new Error(`${name} must decode to a JSON object or array.`);
|
|
129
|
+
}
|
|
130
|
+
return parsed;
|
|
131
|
+
}
|
|
114
132
|
function normalizeOpenClawReference(value) {
|
|
115
133
|
if (value !== "prod" && value !== "before" && value !== "both") return void 0;
|
|
116
134
|
return value;
|
|
@@ -145,6 +163,11 @@ function toRiddleProofRunParams(params) {
|
|
|
145
163
|
success_criteria: params.success_criteria,
|
|
146
164
|
assertions: parseOpenClawAssertions(params.assertions_json),
|
|
147
165
|
verification_mode: params.verification_mode,
|
|
166
|
+
resume_session: params.resume_session,
|
|
167
|
+
target_image_url: params.target_image_url,
|
|
168
|
+
target_image_hash: params.target_image_hash,
|
|
169
|
+
viewport_matrix: parseOpenClawJsonObjectOrArray(params.viewport_matrix_json, "viewport_matrix_json"),
|
|
170
|
+
deterministic_setup: parseOpenClawJsonObjectOrArray(params.deterministic_setup_json, "deterministic_setup_json"),
|
|
148
171
|
reference: normalizeOpenClawReference(params.reference),
|
|
149
172
|
base_branch: params.base_branch,
|
|
150
173
|
before_ref: params.before_ref,
|
|
@@ -178,5 +201,6 @@ function toRiddleProofRunParams(params) {
|
|
|
178
201
|
0 && (module.exports = {
|
|
179
202
|
openClawIntegrationContext,
|
|
180
203
|
parseOpenClawAssertions,
|
|
204
|
+
parseOpenClawJsonObjectOrArray,
|
|
181
205
|
toRiddleProofRunParams
|
|
182
206
|
});
|
package/dist/openclaw.d.cts
CHANGED
|
@@ -10,6 +10,11 @@ interface OpenClawProofedChangeParams {
|
|
|
10
10
|
success_criteria?: string;
|
|
11
11
|
assertions_json?: string;
|
|
12
12
|
verification_mode?: string;
|
|
13
|
+
resume_session?: string;
|
|
14
|
+
target_image_url?: string;
|
|
15
|
+
target_image_hash?: string;
|
|
16
|
+
viewport_matrix_json?: string;
|
|
17
|
+
deterministic_setup_json?: string;
|
|
13
18
|
reference?: "prod" | "before" | "both" | (string & {});
|
|
14
19
|
base_branch?: string;
|
|
15
20
|
before_ref?: string;
|
|
@@ -43,7 +48,8 @@ interface OpenClawProofedChangeParams {
|
|
|
43
48
|
discord_source_url?: string;
|
|
44
49
|
}
|
|
45
50
|
declare function parseOpenClawAssertions(value: unknown): JsonValue | undefined;
|
|
51
|
+
declare function parseOpenClawJsonObjectOrArray(value: unknown, name: string): JsonValue | undefined;
|
|
46
52
|
declare function openClawIntegrationContext(params: OpenClawProofedChangeParams): IntegrationContext;
|
|
47
53
|
declare function toRiddleProofRunParams(params: OpenClawProofedChangeParams): RiddleProofRunParams;
|
|
48
54
|
|
|
49
|
-
export { type OpenClawProofedChangeParams, openClawIntegrationContext, parseOpenClawAssertions, toRiddleProofRunParams };
|
|
55
|
+
export { type OpenClawProofedChangeParams, openClawIntegrationContext, parseOpenClawAssertions, parseOpenClawJsonObjectOrArray, toRiddleProofRunParams };
|
package/dist/openclaw.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ interface OpenClawProofedChangeParams {
|
|
|
10
10
|
success_criteria?: string;
|
|
11
11
|
assertions_json?: string;
|
|
12
12
|
verification_mode?: string;
|
|
13
|
+
resume_session?: string;
|
|
14
|
+
target_image_url?: string;
|
|
15
|
+
target_image_hash?: string;
|
|
16
|
+
viewport_matrix_json?: string;
|
|
17
|
+
deterministic_setup_json?: string;
|
|
13
18
|
reference?: "prod" | "before" | "both" | (string & {});
|
|
14
19
|
base_branch?: string;
|
|
15
20
|
before_ref?: string;
|
|
@@ -43,7 +48,8 @@ interface OpenClawProofedChangeParams {
|
|
|
43
48
|
discord_source_url?: string;
|
|
44
49
|
}
|
|
45
50
|
declare function parseOpenClawAssertions(value: unknown): JsonValue | undefined;
|
|
51
|
+
declare function parseOpenClawJsonObjectOrArray(value: unknown, name: string): JsonValue | undefined;
|
|
46
52
|
declare function openClawIntegrationContext(params: OpenClawProofedChangeParams): IntegrationContext;
|
|
47
53
|
declare function toRiddleProofRunParams(params: OpenClawProofedChangeParams): RiddleProofRunParams;
|
|
48
54
|
|
|
49
|
-
export { type OpenClawProofedChangeParams, openClawIntegrationContext, parseOpenClawAssertions, toRiddleProofRunParams };
|
|
55
|
+
export { type OpenClawProofedChangeParams, openClawIntegrationContext, parseOpenClawAssertions, parseOpenClawJsonObjectOrArray, toRiddleProofRunParams };
|
package/dist/openclaw.js
CHANGED
|
@@ -18,6 +18,23 @@ function parseOpenClawAssertions(value) {
|
|
|
18
18
|
return trimmed;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
function parseOpenClawJsonObjectOrArray(value, name) {
|
|
22
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
23
|
+
if (typeof value !== "string") return value;
|
|
24
|
+
const trimmed = value.trim();
|
|
25
|
+
if (!trimmed) return void 0;
|
|
26
|
+
let parsed;
|
|
27
|
+
try {
|
|
28
|
+
parsed = JSON.parse(trimmed);
|
|
29
|
+
} catch (error) {
|
|
30
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
31
|
+
throw new Error(`${name} is not valid JSON: ${message}`);
|
|
32
|
+
}
|
|
33
|
+
if (parsed === null || typeof parsed !== "object" && !Array.isArray(parsed)) {
|
|
34
|
+
throw new Error(`${name} must decode to a JSON object or array.`);
|
|
35
|
+
}
|
|
36
|
+
return parsed;
|
|
37
|
+
}
|
|
21
38
|
function normalizeOpenClawReference(value) {
|
|
22
39
|
if (value !== "prod" && value !== "before" && value !== "both") return void 0;
|
|
23
40
|
return value;
|
|
@@ -52,6 +69,11 @@ function toRiddleProofRunParams(params) {
|
|
|
52
69
|
success_criteria: params.success_criteria,
|
|
53
70
|
assertions: parseOpenClawAssertions(params.assertions_json),
|
|
54
71
|
verification_mode: params.verification_mode,
|
|
72
|
+
resume_session: params.resume_session,
|
|
73
|
+
target_image_url: params.target_image_url,
|
|
74
|
+
target_image_hash: params.target_image_hash,
|
|
75
|
+
viewport_matrix: parseOpenClawJsonObjectOrArray(params.viewport_matrix_json, "viewport_matrix_json"),
|
|
76
|
+
deterministic_setup: parseOpenClawJsonObjectOrArray(params.deterministic_setup_json, "deterministic_setup_json"),
|
|
55
77
|
reference: normalizeOpenClawReference(params.reference),
|
|
56
78
|
base_branch: params.base_branch,
|
|
57
79
|
before_ref: params.before_ref,
|
|
@@ -84,5 +106,6 @@ function toRiddleProofRunParams(params) {
|
|
|
84
106
|
export {
|
|
85
107
|
openClawIntegrationContext,
|
|
86
108
|
parseOpenClawAssertions,
|
|
109
|
+
parseOpenClawJsonObjectOrArray,
|
|
87
110
|
toRiddleProofRunParams
|
|
88
111
|
};
|
package/package.json
CHANGED
|
@@ -94,6 +94,10 @@ function normalizeBuildArgs(args) {
|
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
function normalizeJobId(args) {
|
|
98
|
+
return args.job_id ?? args.jobId ?? args.id;
|
|
99
|
+
}
|
|
100
|
+
|
|
97
101
|
async function run(tool, args) {
|
|
98
102
|
const core = await loadCore();
|
|
99
103
|
const config = buildConfig();
|
|
@@ -113,10 +117,18 @@ async function run(tool, args) {
|
|
|
113
117
|
return core.createServerPreview(config, normalizeServerArgs(args));
|
|
114
118
|
}
|
|
115
119
|
|
|
120
|
+
if (tool === "riddle_server_preview_status") {
|
|
121
|
+
return core.getServerPreviewStatus(config, normalizeJobId(args));
|
|
122
|
+
}
|
|
123
|
+
|
|
116
124
|
if (tool === "riddle_build_preview") {
|
|
117
125
|
return core.createBuildPreview(config, normalizeBuildArgs(args));
|
|
118
126
|
}
|
|
119
127
|
|
|
128
|
+
if (tool === "riddle_build_preview_status") {
|
|
129
|
+
return core.getBuildPreviewStatus(config, normalizeJobId(args));
|
|
130
|
+
}
|
|
131
|
+
|
|
120
132
|
if (tool === "riddle_script") {
|
|
121
133
|
return core.runWithDefaults(config, args, {
|
|
122
134
|
include: TOOL_DEFAULT_INCLUDE,
|
package/runtime/lib/util.py
CHANGED