@demath-ai/cli 0.1.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/LICENSE +21 -0
- package/README.md +214 -0
- package/SKILL.md +54 -0
- package/bin/demath.mjs +13 -0
- package/dist/cli.cjs +816 -0
- package/dist/cli.js +814 -0
- package/dist/index.cjs +823 -0
- package/dist/index.d.cts +88 -0
- package/dist/index.d.ts +88 -0
- package/dist/index.js +814 -0
- package/package.json +63 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
interface Problem {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
statement?: string;
|
|
5
|
+
classification?: string;
|
|
6
|
+
expected_difficulty?: string;
|
|
7
|
+
solved?: boolean;
|
|
8
|
+
[k: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
interface ProblemsResponse {
|
|
11
|
+
problems: Problem[];
|
|
12
|
+
}
|
|
13
|
+
interface ProbeResponse {
|
|
14
|
+
ok?: boolean;
|
|
15
|
+
provider?: string;
|
|
16
|
+
detail?: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
/** Machine-readable failure reason (e.g. "unsupported_prefix", "auth_failed"). */
|
|
19
|
+
reason?: string;
|
|
20
|
+
/** Upstream HTTP status from the provider (401, 403, 429, …). */
|
|
21
|
+
provider_status?: number;
|
|
22
|
+
/** Upstream provider's error message body. */
|
|
23
|
+
provider_message?: string;
|
|
24
|
+
[k: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
interface AttemptStartResponse {
|
|
27
|
+
attempt_id: string;
|
|
28
|
+
[k: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
interface AttemptIteration {
|
|
31
|
+
iteration?: number;
|
|
32
|
+
status?: string;
|
|
33
|
+
input_tokens?: number;
|
|
34
|
+
output_tokens?: number;
|
|
35
|
+
usd_cost?: number;
|
|
36
|
+
summary?: string;
|
|
37
|
+
body?: string;
|
|
38
|
+
[k: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
interface AttemptRecord {
|
|
41
|
+
attempt_id?: string;
|
|
42
|
+
status?: string;
|
|
43
|
+
iterations?: AttemptIteration[];
|
|
44
|
+
total_cost?: number;
|
|
45
|
+
total_input_tokens?: number;
|
|
46
|
+
total_output_tokens?: number;
|
|
47
|
+
ipfs_cid?: string;
|
|
48
|
+
error?: string;
|
|
49
|
+
[k: string]: unknown;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface ApiClientConfig {
|
|
53
|
+
apiUrl: string;
|
|
54
|
+
signal?: AbortSignal;
|
|
55
|
+
}
|
|
56
|
+
interface MineRequest {
|
|
57
|
+
problemId: string;
|
|
58
|
+
model: string;
|
|
59
|
+
apiKey: string;
|
|
60
|
+
walletAddress: string;
|
|
61
|
+
maxIterations?: number;
|
|
62
|
+
maxUsd?: number;
|
|
63
|
+
}
|
|
64
|
+
declare class DemathClient {
|
|
65
|
+
private readonly cfg;
|
|
66
|
+
constructor(cfg: ApiClientConfig);
|
|
67
|
+
listProblems(): Promise<ProblemsResponse>;
|
|
68
|
+
probe(model: string, apiKey: string): Promise<ProbeResponse>;
|
|
69
|
+
startAttempt(r: MineRequest): Promise<AttemptStartResponse>;
|
|
70
|
+
getAttempt(attemptId: string): Promise<AttemptRecord>;
|
|
71
|
+
stopAttempt(attemptId: string): Promise<unknown>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare class CliError extends Error {
|
|
75
|
+
readonly exitCode: number;
|
|
76
|
+
constructor(message: string, exitCode?: number);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare const CLI_VERSION = "0.1.0";
|
|
80
|
+
declare const USER_AGENT = "demath-cli-npm/0.1.0 (+https://github.com/demath-ai/proj-dmv0/tree/main/tools/demath-cli-npm)";
|
|
81
|
+
declare const DEFAULT_API_URL: string;
|
|
82
|
+
declare const APPROVED_MODELS: readonly ["anthropic/claude-opus-4-7", "openai/gpt-5.5", "google/gemini-3-deep-think"];
|
|
83
|
+
type ApprovedModel = (typeof APPROVED_MODELS)[number];
|
|
84
|
+
declare const POLL_INTERVAL_MS = 3000;
|
|
85
|
+
|
|
86
|
+
declare function main(argv: string[]): Promise<number>;
|
|
87
|
+
|
|
88
|
+
export { APPROVED_MODELS, type ApiClientConfig, type ApprovedModel, type AttemptIteration, type AttemptRecord, type AttemptStartResponse, CLI_VERSION, CliError, DEFAULT_API_URL, DemathClient, type MineRequest, POLL_INTERVAL_MS, type ProbeResponse, type Problem, type ProblemsResponse, USER_AGENT, main as runCli };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
interface Problem {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
statement?: string;
|
|
5
|
+
classification?: string;
|
|
6
|
+
expected_difficulty?: string;
|
|
7
|
+
solved?: boolean;
|
|
8
|
+
[k: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
interface ProblemsResponse {
|
|
11
|
+
problems: Problem[];
|
|
12
|
+
}
|
|
13
|
+
interface ProbeResponse {
|
|
14
|
+
ok?: boolean;
|
|
15
|
+
provider?: string;
|
|
16
|
+
detail?: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
/** Machine-readable failure reason (e.g. "unsupported_prefix", "auth_failed"). */
|
|
19
|
+
reason?: string;
|
|
20
|
+
/** Upstream HTTP status from the provider (401, 403, 429, …). */
|
|
21
|
+
provider_status?: number;
|
|
22
|
+
/** Upstream provider's error message body. */
|
|
23
|
+
provider_message?: string;
|
|
24
|
+
[k: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
interface AttemptStartResponse {
|
|
27
|
+
attempt_id: string;
|
|
28
|
+
[k: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
interface AttemptIteration {
|
|
31
|
+
iteration?: number;
|
|
32
|
+
status?: string;
|
|
33
|
+
input_tokens?: number;
|
|
34
|
+
output_tokens?: number;
|
|
35
|
+
usd_cost?: number;
|
|
36
|
+
summary?: string;
|
|
37
|
+
body?: string;
|
|
38
|
+
[k: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
interface AttemptRecord {
|
|
41
|
+
attempt_id?: string;
|
|
42
|
+
status?: string;
|
|
43
|
+
iterations?: AttemptIteration[];
|
|
44
|
+
total_cost?: number;
|
|
45
|
+
total_input_tokens?: number;
|
|
46
|
+
total_output_tokens?: number;
|
|
47
|
+
ipfs_cid?: string;
|
|
48
|
+
error?: string;
|
|
49
|
+
[k: string]: unknown;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface ApiClientConfig {
|
|
53
|
+
apiUrl: string;
|
|
54
|
+
signal?: AbortSignal;
|
|
55
|
+
}
|
|
56
|
+
interface MineRequest {
|
|
57
|
+
problemId: string;
|
|
58
|
+
model: string;
|
|
59
|
+
apiKey: string;
|
|
60
|
+
walletAddress: string;
|
|
61
|
+
maxIterations?: number;
|
|
62
|
+
maxUsd?: number;
|
|
63
|
+
}
|
|
64
|
+
declare class DemathClient {
|
|
65
|
+
private readonly cfg;
|
|
66
|
+
constructor(cfg: ApiClientConfig);
|
|
67
|
+
listProblems(): Promise<ProblemsResponse>;
|
|
68
|
+
probe(model: string, apiKey: string): Promise<ProbeResponse>;
|
|
69
|
+
startAttempt(r: MineRequest): Promise<AttemptStartResponse>;
|
|
70
|
+
getAttempt(attemptId: string): Promise<AttemptRecord>;
|
|
71
|
+
stopAttempt(attemptId: string): Promise<unknown>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare class CliError extends Error {
|
|
75
|
+
readonly exitCode: number;
|
|
76
|
+
constructor(message: string, exitCode?: number);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare const CLI_VERSION = "0.1.0";
|
|
80
|
+
declare const USER_AGENT = "demath-cli-npm/0.1.0 (+https://github.com/demath-ai/proj-dmv0/tree/main/tools/demath-cli-npm)";
|
|
81
|
+
declare const DEFAULT_API_URL: string;
|
|
82
|
+
declare const APPROVED_MODELS: readonly ["anthropic/claude-opus-4-7", "openai/gpt-5.5", "google/gemini-3-deep-think"];
|
|
83
|
+
type ApprovedModel = (typeof APPROVED_MODELS)[number];
|
|
84
|
+
declare const POLL_INTERVAL_MS = 3000;
|
|
85
|
+
|
|
86
|
+
declare function main(argv: string[]): Promise<number>;
|
|
87
|
+
|
|
88
|
+
export { APPROVED_MODELS, type ApiClientConfig, type ApprovedModel, type AttemptIteration, type AttemptRecord, type AttemptStartResponse, CLI_VERSION, CliError, DEFAULT_API_URL, DemathClient, type MineRequest, POLL_INTERVAL_MS, type ProbeResponse, type Problem, type ProblemsResponse, USER_AGENT, main as runCli };
|