@riddledc/openclaw-riddledc 0.9.2 → 0.9.4
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/CHECKSUMS.txt +7 -2
- package/README.md +10 -0
- package/dist/chunk-SNGACMAL.js +858 -0
- package/dist/core.cjs +897 -0
- package/dist/core.d.cts +57 -0
- package/dist/core.d.ts +57 -0
- package/dist/core.js +36 -0
- package/dist/index.cjs +318 -175
- package/dist/index.js +36 -101
- package/openclaw.plugin.json +1 -1
- package/package.json +7 -2
package/dist/core.d.cts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
type RiddlePayload = Record<string, any>;
|
|
2
|
+
type RiddleCoreConfig = {
|
|
3
|
+
apiKey?: string;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
workspace?: string;
|
|
6
|
+
};
|
|
7
|
+
type RunResult = {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
mode?: "url" | "urls" | "steps" | "script";
|
|
10
|
+
sync?: boolean;
|
|
11
|
+
job_id?: string;
|
|
12
|
+
duration_ms?: number;
|
|
13
|
+
status?: string;
|
|
14
|
+
screenshot?: any;
|
|
15
|
+
console?: any;
|
|
16
|
+
har?: any;
|
|
17
|
+
result?: any;
|
|
18
|
+
error?: any;
|
|
19
|
+
rawContentType?: string;
|
|
20
|
+
rawPngBase64?: string;
|
|
21
|
+
};
|
|
22
|
+
type PreviewResult = Record<string, any> & {
|
|
23
|
+
ok: boolean;
|
|
24
|
+
};
|
|
25
|
+
declare function configFromOpenClawApi(api: any): RiddleCoreConfig;
|
|
26
|
+
declare function assertAllowedBaseUrl(baseUrl: string): void;
|
|
27
|
+
declare function describeError(err: unknown): string;
|
|
28
|
+
declare function fetchWithTimeout(url: string, init: RequestInit, timeoutMs: number, label: string): Promise<Response>;
|
|
29
|
+
declare function fetchWithRetry(url: string, init: RequestInit, timeoutMs: number, label: string, opts?: {
|
|
30
|
+
attempts?: number;
|
|
31
|
+
baseDelayMs?: number;
|
|
32
|
+
}): Promise<Response>;
|
|
33
|
+
declare function isAlreadyStartedResponse(status: number, body: string): boolean;
|
|
34
|
+
declare function writeArtifactBinary(workspace: string, subdir: string, filename: string, base64Content: string): Promise<{
|
|
35
|
+
path: string;
|
|
36
|
+
sizeBytes: number;
|
|
37
|
+
}>;
|
|
38
|
+
declare function applySafetySpec(result: RunResult, opts: {
|
|
39
|
+
workspace: string;
|
|
40
|
+
harInline?: boolean;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
declare function pollJobStatus(config: RiddleCoreConfig, jobId: string, maxWaitMs: number): Promise<any>;
|
|
43
|
+
declare function fetchArtifactsAndBuild(config: RiddleCoreConfig, jobId: string, include: string[]): Promise<Record<string, any>>;
|
|
44
|
+
declare function runWithDefaults(config: RiddleCoreConfig, payload: RiddlePayload, defaults?: {
|
|
45
|
+
include?: string[];
|
|
46
|
+
returnAsync?: boolean;
|
|
47
|
+
}): Promise<RunResult>;
|
|
48
|
+
declare function riddleApiFetch(config: RiddleCoreConfig, method: string, path: string, body?: any): Promise<any>;
|
|
49
|
+
declare function createStaticPreview(config: RiddleCoreConfig, params: {
|
|
50
|
+
directory: string;
|
|
51
|
+
framework?: string;
|
|
52
|
+
}): Promise<PreviewResult>;
|
|
53
|
+
declare function deleteStaticPreview(config: RiddleCoreConfig, id: string): Promise<PreviewResult>;
|
|
54
|
+
declare function createServerPreview(config: RiddleCoreConfig, params: Record<string, any>): Promise<PreviewResult>;
|
|
55
|
+
declare function createBuildPreview(config: RiddleCoreConfig, params: Record<string, any>): Promise<PreviewResult>;
|
|
56
|
+
|
|
57
|
+
export { type PreviewResult, type RiddleCoreConfig, type RiddlePayload, type RunResult, applySafetySpec, assertAllowedBaseUrl, configFromOpenClawApi, createBuildPreview, createServerPreview, createStaticPreview, deleteStaticPreview, describeError, fetchArtifactsAndBuild, fetchWithRetry, fetchWithTimeout, isAlreadyStartedResponse, pollJobStatus, riddleApiFetch, runWithDefaults, writeArtifactBinary };
|
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
type RiddlePayload = Record<string, any>;
|
|
2
|
+
type RiddleCoreConfig = {
|
|
3
|
+
apiKey?: string;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
workspace?: string;
|
|
6
|
+
};
|
|
7
|
+
type RunResult = {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
mode?: "url" | "urls" | "steps" | "script";
|
|
10
|
+
sync?: boolean;
|
|
11
|
+
job_id?: string;
|
|
12
|
+
duration_ms?: number;
|
|
13
|
+
status?: string;
|
|
14
|
+
screenshot?: any;
|
|
15
|
+
console?: any;
|
|
16
|
+
har?: any;
|
|
17
|
+
result?: any;
|
|
18
|
+
error?: any;
|
|
19
|
+
rawContentType?: string;
|
|
20
|
+
rawPngBase64?: string;
|
|
21
|
+
};
|
|
22
|
+
type PreviewResult = Record<string, any> & {
|
|
23
|
+
ok: boolean;
|
|
24
|
+
};
|
|
25
|
+
declare function configFromOpenClawApi(api: any): RiddleCoreConfig;
|
|
26
|
+
declare function assertAllowedBaseUrl(baseUrl: string): void;
|
|
27
|
+
declare function describeError(err: unknown): string;
|
|
28
|
+
declare function fetchWithTimeout(url: string, init: RequestInit, timeoutMs: number, label: string): Promise<Response>;
|
|
29
|
+
declare function fetchWithRetry(url: string, init: RequestInit, timeoutMs: number, label: string, opts?: {
|
|
30
|
+
attempts?: number;
|
|
31
|
+
baseDelayMs?: number;
|
|
32
|
+
}): Promise<Response>;
|
|
33
|
+
declare function isAlreadyStartedResponse(status: number, body: string): boolean;
|
|
34
|
+
declare function writeArtifactBinary(workspace: string, subdir: string, filename: string, base64Content: string): Promise<{
|
|
35
|
+
path: string;
|
|
36
|
+
sizeBytes: number;
|
|
37
|
+
}>;
|
|
38
|
+
declare function applySafetySpec(result: RunResult, opts: {
|
|
39
|
+
workspace: string;
|
|
40
|
+
harInline?: boolean;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
declare function pollJobStatus(config: RiddleCoreConfig, jobId: string, maxWaitMs: number): Promise<any>;
|
|
43
|
+
declare function fetchArtifactsAndBuild(config: RiddleCoreConfig, jobId: string, include: string[]): Promise<Record<string, any>>;
|
|
44
|
+
declare function runWithDefaults(config: RiddleCoreConfig, payload: RiddlePayload, defaults?: {
|
|
45
|
+
include?: string[];
|
|
46
|
+
returnAsync?: boolean;
|
|
47
|
+
}): Promise<RunResult>;
|
|
48
|
+
declare function riddleApiFetch(config: RiddleCoreConfig, method: string, path: string, body?: any): Promise<any>;
|
|
49
|
+
declare function createStaticPreview(config: RiddleCoreConfig, params: {
|
|
50
|
+
directory: string;
|
|
51
|
+
framework?: string;
|
|
52
|
+
}): Promise<PreviewResult>;
|
|
53
|
+
declare function deleteStaticPreview(config: RiddleCoreConfig, id: string): Promise<PreviewResult>;
|
|
54
|
+
declare function createServerPreview(config: RiddleCoreConfig, params: Record<string, any>): Promise<PreviewResult>;
|
|
55
|
+
declare function createBuildPreview(config: RiddleCoreConfig, params: Record<string, any>): Promise<PreviewResult>;
|
|
56
|
+
|
|
57
|
+
export { type PreviewResult, type RiddleCoreConfig, type RiddlePayload, type RunResult, applySafetySpec, assertAllowedBaseUrl, configFromOpenClawApi, createBuildPreview, createServerPreview, createStaticPreview, deleteStaticPreview, describeError, fetchArtifactsAndBuild, fetchWithRetry, fetchWithTimeout, isAlreadyStartedResponse, pollJobStatus, riddleApiFetch, runWithDefaults, writeArtifactBinary };
|
package/dist/core.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
applySafetySpec,
|
|
3
|
+
assertAllowedBaseUrl,
|
|
4
|
+
configFromOpenClawApi,
|
|
5
|
+
createBuildPreview,
|
|
6
|
+
createServerPreview,
|
|
7
|
+
createStaticPreview,
|
|
8
|
+
deleteStaticPreview,
|
|
9
|
+
describeError,
|
|
10
|
+
fetchArtifactsAndBuild,
|
|
11
|
+
fetchWithRetry,
|
|
12
|
+
fetchWithTimeout,
|
|
13
|
+
isAlreadyStartedResponse,
|
|
14
|
+
pollJobStatus,
|
|
15
|
+
riddleApiFetch,
|
|
16
|
+
runWithDefaults,
|
|
17
|
+
writeArtifactBinary
|
|
18
|
+
} from "./chunk-SNGACMAL.js";
|
|
19
|
+
export {
|
|
20
|
+
applySafetySpec,
|
|
21
|
+
assertAllowedBaseUrl,
|
|
22
|
+
configFromOpenClawApi,
|
|
23
|
+
createBuildPreview,
|
|
24
|
+
createServerPreview,
|
|
25
|
+
createStaticPreview,
|
|
26
|
+
deleteStaticPreview,
|
|
27
|
+
describeError,
|
|
28
|
+
fetchArtifactsAndBuild,
|
|
29
|
+
fetchWithRetry,
|
|
30
|
+
fetchWithTimeout,
|
|
31
|
+
isAlreadyStartedResponse,
|
|
32
|
+
pollJobStatus,
|
|
33
|
+
riddleApiFetch,
|
|
34
|
+
runWithDefaults,
|
|
35
|
+
writeArtifactBinary
|
|
36
|
+
};
|