theclawbay 0.3.24 → 0.3.25
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/commands/setup.js
CHANGED
|
@@ -18,37 +18,18 @@ const paths_1 = require("../lib/config/paths");
|
|
|
18
18
|
const api_key_1 = require("../lib/managed/api-key");
|
|
19
19
|
const config_1 = require("../lib/managed/config");
|
|
20
20
|
const errors_1 = require("../lib/managed/errors");
|
|
21
|
+
const supported_models_1 = require("../lib/supported-models");
|
|
21
22
|
const DEFAULT_BACKEND_URL = "https://theclawbay.com";
|
|
22
23
|
const DEFAULT_PROVIDER_ID = "theclawbay";
|
|
23
24
|
const CLI_HTTP_USER_AGENT = "theclawbay-cli";
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"gpt-5.2",
|
|
33
|
-
"gpt-5.1-codex-max",
|
|
34
|
-
"gpt-5.1-codex-mini",
|
|
35
|
-
];
|
|
36
|
-
const PREFERRED_MODELS = [
|
|
37
|
-
"gpt-5.4",
|
|
38
|
-
"gpt-5.3-codex",
|
|
39
|
-
"gpt-5.2-codex",
|
|
40
|
-
"gpt-5.2",
|
|
41
|
-
"gpt-5.1-codex-max",
|
|
42
|
-
"gpt-5.1-codex-mini",
|
|
43
|
-
];
|
|
44
|
-
const MODEL_DISPLAY_NAMES = {
|
|
45
|
-
"gpt-5.4": "GPT-5.4",
|
|
46
|
-
"gpt-5.3-codex": "GPT-5.3 Codex",
|
|
47
|
-
"gpt-5.2-codex": "GPT-5.2 Codex",
|
|
48
|
-
"gpt-5.2": "GPT-5.2",
|
|
49
|
-
"gpt-5.1-codex-max": "GPT-5.1 Codex Max",
|
|
50
|
-
"gpt-5.1-codex-mini": "GPT-5.1 Codex Mini",
|
|
51
|
-
};
|
|
25
|
+
const SUPPORTED_MODEL_IDS = (0, supported_models_1.getSupportedModelIds)();
|
|
26
|
+
const MODEL_DISPLAY_NAMES = (0, supported_models_1.getSupportedModelDisplayNames)();
|
|
27
|
+
const DEFAULT_CODEX_MODEL = SUPPORTED_MODEL_IDS[0] ?? "gpt-5.4";
|
|
28
|
+
const DEFAULT_OPENCLAW_MODEL = DEFAULT_CODEX_MODEL;
|
|
29
|
+
const DEFAULT_KILO_MODEL = DEFAULT_CODEX_MODEL;
|
|
30
|
+
const DEFAULT_TRAE_MODEL = DEFAULT_CODEX_MODEL;
|
|
31
|
+
const DEFAULT_MODELS = [...SUPPORTED_MODEL_IDS];
|
|
32
|
+
const PREFERRED_MODELS = [...SUPPORTED_MODEL_IDS];
|
|
52
33
|
const ENV_KEY_NAME = "THECLAWBAY_API_KEY";
|
|
53
34
|
const ENV_FILE = node_path_1.default.join(node_os_1.default.homedir(), ".config", "theclawbay", "env");
|
|
54
35
|
const MIGRATION_STATE_FILE = node_path_1.default.join(paths_1.codexDir, "theclawbay.migration.json");
|
|
@@ -10,19 +10,14 @@ const promises_1 = __importDefault(require("node:fs/promises"));
|
|
|
10
10
|
const node_path_1 = __importDefault(require("node:path"));
|
|
11
11
|
const node_child_process_1 = require("node:child_process");
|
|
12
12
|
const node_os_1 = __importDefault(require("node:os"));
|
|
13
|
+
const supported_models_1 = require("./supported-models");
|
|
13
14
|
const MODELS_CACHE_FILE = "models_cache.json";
|
|
14
15
|
const MODELS_CACHE_STATE_FILE = "theclawbay.models-cache.json";
|
|
15
16
|
const STATE_DB_FILE_PATTERN = /^state_\d+\.sqlite$/;
|
|
16
17
|
const TARGET_MODEL_ID = "gpt-5.4";
|
|
17
18
|
const SEED_MARKER_KEY = "_theclawbay_seeded";
|
|
18
19
|
const SEED_MARKER_VALUE = "gpt-5.4";
|
|
19
|
-
const TEMPLATE_MODEL_IDS =
|
|
20
|
-
"gpt-5.3-codex",
|
|
21
|
-
"gpt-5.2-codex",
|
|
22
|
-
"gpt-5.2",
|
|
23
|
-
"gpt-5.1-codex-max",
|
|
24
|
-
"gpt-5.1-codex-mini",
|
|
25
|
-
];
|
|
20
|
+
const TEMPLATE_MODEL_IDS = (0, supported_models_1.getSupportedModelIds)().filter((id) => id !== TARGET_MODEL_ID);
|
|
26
21
|
const DEFAULT_REASONING_LEVELS = [
|
|
27
22
|
{ effort: "low", description: "Fast responses with lighter reasoning" },
|
|
28
23
|
{ effort: "medium", description: "Balances speed and reasoning depth for everyday tasks" },
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type SupportedModelTone = "coral" | "sea" | "ink";
|
|
2
|
+
export type SupportedModelConfig = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
note: string;
|
|
6
|
+
tone: SupportedModelTone;
|
|
7
|
+
inputPer1M: number;
|
|
8
|
+
cachedInputPer1M: number;
|
|
9
|
+
outputPer1M: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function getSupportedModels(): SupportedModelConfig[];
|
|
12
|
+
export declare function getSupportedModelIds(): string[];
|
|
13
|
+
export declare function getSupportedModelDisplayNames(): Record<string, string>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getSupportedModels = getSupportedModels;
|
|
7
|
+
exports.getSupportedModelIds = getSupportedModelIds;
|
|
8
|
+
exports.getSupportedModelDisplayNames = getSupportedModelDisplayNames;
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
11
|
+
function configPath() {
|
|
12
|
+
return node_path_1.default.resolve(__dirname, "..", "..", "theclawbay-supported-models.json");
|
|
13
|
+
}
|
|
14
|
+
function parseSupportedModels(raw) {
|
|
15
|
+
const parsed = JSON.parse(raw);
|
|
16
|
+
if (!Array.isArray(parsed)) {
|
|
17
|
+
throw new Error("supported-models config must be an array");
|
|
18
|
+
}
|
|
19
|
+
return parsed.map((entry) => {
|
|
20
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
21
|
+
throw new Error("supported-models config contains an invalid entry");
|
|
22
|
+
}
|
|
23
|
+
const record = entry;
|
|
24
|
+
const id = typeof record.id === "string" ? record.id.trim() : "";
|
|
25
|
+
const label = typeof record.label === "string" ? record.label.trim() : "";
|
|
26
|
+
const note = typeof record.note === "string" ? record.note.trim() : "";
|
|
27
|
+
const tone = record.tone;
|
|
28
|
+
const inputPer1M = typeof record.inputPer1M === "number" ? record.inputPer1M : NaN;
|
|
29
|
+
const cachedInputPer1M = typeof record.cachedInputPer1M === "number" ? record.cachedInputPer1M : NaN;
|
|
30
|
+
const outputPer1M = typeof record.outputPer1M === "number" ? record.outputPer1M : NaN;
|
|
31
|
+
if (!id || !label || !note) {
|
|
32
|
+
throw new Error("supported-models config is missing required text fields");
|
|
33
|
+
}
|
|
34
|
+
if (tone !== "coral" && tone !== "sea" && tone !== "ink") {
|
|
35
|
+
throw new Error(`unsupported tone for model ${id}`);
|
|
36
|
+
}
|
|
37
|
+
if (!Number.isFinite(inputPer1M) || !Number.isFinite(cachedInputPer1M) || !Number.isFinite(outputPer1M)) {
|
|
38
|
+
throw new Error(`unsupported pricing fields for model ${id}`);
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
id,
|
|
42
|
+
label,
|
|
43
|
+
note,
|
|
44
|
+
tone,
|
|
45
|
+
inputPer1M,
|
|
46
|
+
cachedInputPer1M,
|
|
47
|
+
outputPer1M,
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
let cachedModels = null;
|
|
52
|
+
function getSupportedModels() {
|
|
53
|
+
if (cachedModels)
|
|
54
|
+
return cachedModels;
|
|
55
|
+
cachedModels = parseSupportedModels((0, node_fs_1.readFileSync)(configPath(), "utf8"));
|
|
56
|
+
return cachedModels;
|
|
57
|
+
}
|
|
58
|
+
function getSupportedModelIds() {
|
|
59
|
+
return getSupportedModels().map((model) => model.id);
|
|
60
|
+
}
|
|
61
|
+
function getSupportedModelDisplayNames() {
|
|
62
|
+
return Object.fromEntries(getSupportedModels().map((model) => [model.id, model.label]));
|
|
63
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "theclawbay",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.25",
|
|
4
4
|
"description": "CLI for connecting Codex, OpenClaw, OpenCode, Kilo, and experimental Trae to The Claw Bay.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
|
25
|
+
"theclawbay-supported-models.json",
|
|
25
26
|
"README.md",
|
|
26
27
|
"LICENSE"
|
|
27
28
|
],
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "gpt-5.4",
|
|
4
|
+
"label": "GPT-5.4",
|
|
5
|
+
"note": "Frontier coding model with the widest headroom.",
|
|
6
|
+
"tone": "coral",
|
|
7
|
+
"inputPer1M": 2.5,
|
|
8
|
+
"cachedInputPer1M": 0.25,
|
|
9
|
+
"outputPer1M": 15.0
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "gpt-5.3-codex",
|
|
13
|
+
"label": "GPT-5.3 Codex",
|
|
14
|
+
"note": "Strong daily-driver Codex model for heavier work.",
|
|
15
|
+
"tone": "ink",
|
|
16
|
+
"inputPer1M": 1.75,
|
|
17
|
+
"cachedInputPer1M": 0.175,
|
|
18
|
+
"outputPer1M": 14.0
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "gpt-5.2-codex",
|
|
22
|
+
"label": "GPT-5.2 Codex",
|
|
23
|
+
"note": "Stable compatibility option for older Codex flows.",
|
|
24
|
+
"tone": "sea",
|
|
25
|
+
"inputPer1M": 1.75,
|
|
26
|
+
"cachedInputPer1M": 0.175,
|
|
27
|
+
"outputPer1M": 14.0
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "gpt-5.2",
|
|
31
|
+
"label": "GPT-5.2",
|
|
32
|
+
"note": "Balanced GPT-5 path when you want a non-Codex option.",
|
|
33
|
+
"tone": "ink",
|
|
34
|
+
"inputPer1M": 1.75,
|
|
35
|
+
"cachedInputPer1M": 0.175,
|
|
36
|
+
"outputPer1M": 14.0
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "gpt-5.1-codex-max",
|
|
40
|
+
"label": "GPT-5.1 Codex Max",
|
|
41
|
+
"note": "Higher-throughput option for longer coding sessions.",
|
|
42
|
+
"tone": "coral",
|
|
43
|
+
"inputPer1M": 1.25,
|
|
44
|
+
"cachedInputPer1M": 0.125,
|
|
45
|
+
"outputPer1M": 10.0
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "gpt-5.1-codex-mini",
|
|
49
|
+
"label": "GPT-5.1 Codex Mini",
|
|
50
|
+
"note": "Lower-cost Codex path for quick iterations.",
|
|
51
|
+
"tone": "sea",
|
|
52
|
+
"inputPer1M": 0.25,
|
|
53
|
+
"cachedInputPer1M": 0.025,
|
|
54
|
+
"outputPer1M": 2.0
|
|
55
|
+
}
|
|
56
|
+
]
|