cabletidy 0.2.0 → 0.3.0-rc.2
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/README.md +77 -16
- package/bin/cabletidy.mjs +19 -1
- package/bin/native.mjs +110 -0
- package/native/darwin-arm64/build.json +6 -0
- package/native/darwin-arm64/cabletidy +0 -0
- package/native/darwin-x64/build.json +6 -0
- package/native/darwin-x64/cabletidy +0 -0
- package/native/linux-arm64/build.json +6 -0
- package/native/linux-arm64/cabletidy +0 -0
- package/native/linux-x64/build.json +6 -0
- package/native/linux-x64/cabletidy +0 -0
- package/native/win32-x64/build.json +6 -0
- package/native/win32-x64/cabletidy.exe +0 -0
- package/package.json +18 -14
- package/src/claude-config-file.mjs +0 -172
- package/src/cli.mjs +0 -146
- package/src/codex-catalog.mjs +0 -236
- package/src/codex-config-file.mjs +0 -67
- package/src/codex-native-provider.mjs +0 -311
- package/src/config.mjs +0 -341
- package/src/instance-lock.mjs +0 -129
- package/src/model-resolver.mjs +0 -185
- package/src/process-identity.mjs +0 -72
- package/src/server.mjs +0 -1335
- package/src/target-artifacts.mjs +0 -214
- package/src/validation.mjs +0 -393
- package/src/windows-codex.ps1 +0 -90
- package/web/app.js +0 -1782
- package/web/claude-models.js +0 -39
- package/web/config-identity.js +0 -73
- package/web/index.html +0 -48
- package/web/styles.css +0 -1132
package/web/claude-models.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Reviewed against Anthropic's public docs; update this snapshot with releases.
|
|
2
|
-
// Suggestions only: never use this catalog to validate or route model requests.
|
|
3
|
-
export const CLAUDE_MODEL_CATALOG = {
|
|
4
|
-
updatedAt: "2026-09-23",
|
|
5
|
-
sources: [
|
|
6
|
-
"https://platform.claude.com/docs/en/about-claude/models/overview",
|
|
7
|
-
"https://platform.claude.com/docs/en/about-claude/models/model-ids-and-versions",
|
|
8
|
-
"https://platform.claude.com/docs/en/models/opus-4-5/overview",
|
|
9
|
-
"https://platform.claude.com/docs/en/models/sonnet-4-5/overview",
|
|
10
|
-
"https://code.claude.com/docs/en/model-config",
|
|
11
|
-
],
|
|
12
|
-
models: [
|
|
13
|
-
"claude-opus-5-5",
|
|
14
|
-
"claude-opus-5",
|
|
15
|
-
"claude-opus-4-8",
|
|
16
|
-
"claude-opus-4-7",
|
|
17
|
-
"claude-opus-4-6",
|
|
18
|
-
"claude-opus-4-5-20251101",
|
|
19
|
-
"claude-opus-4-5",
|
|
20
|
-
"claude-sonnet-5",
|
|
21
|
-
"claude-sonnet-4-6",
|
|
22
|
-
"claude-sonnet-4-5-20250929",
|
|
23
|
-
"claude-sonnet-4-5",
|
|
24
|
-
"claude-fable-5-1",
|
|
25
|
-
"claude-fable-5",
|
|
26
|
-
"claude-haiku-4-5-20251001",
|
|
27
|
-
"claude-haiku-4-5",
|
|
28
|
-
],
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// Reviewed 2026-09-24. Keep startup modes separate from documented subagent aliases.
|
|
32
|
-
// https://code.claude.com/docs/en/model-config#model-aliases
|
|
33
|
-
// https://code.claude.com/docs/en/model-config#opusplan-model-setting
|
|
34
|
-
// https://code.claude.com/docs/en/sub-agents#choose-a-model
|
|
35
|
-
// `default` is a reset, and subagent `inherit` equals unset; the UI uses an empty value.
|
|
36
|
-
export const CLAUDE_MODEL_ALIASES = {
|
|
37
|
-
defaultModel: ["best", "opus", "sonnet", "fable", "haiku", "opusplan"],
|
|
38
|
-
subagent: ["opus", "sonnet", "fable", "haiku"],
|
|
39
|
-
};
|
package/web/config-identity.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
export function configurationId(name, fallback = "codex") {
|
|
2
|
-
const normalize = (value) => String(value || "")
|
|
3
|
-
.trim()
|
|
4
|
-
.toLowerCase()
|
|
5
|
-
.replace(/[^a-z0-9_-]+/g, "-")
|
|
6
|
-
.replace(/^[^a-z0-9]+|-+$/g, "")
|
|
7
|
-
.slice(0, 54)
|
|
8
|
-
.replace(/-+$/, "");
|
|
9
|
-
return normalize(name) || normalize(fallback) || "codex";
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function providerIdForConfiguration(id) {
|
|
13
|
-
return `cabletidy_${id}`;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function configurationBaseUrl(config, id) {
|
|
17
|
-
const host = String(config.web?.listenHost || "127.0.0.1");
|
|
18
|
-
const address = host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
|
|
19
|
-
return `http://${address}:${config.web?.port || 43100}/${encodeURIComponent(id)}`;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function isRecord(value) {
|
|
23
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function normalizeConfigurationIdentities(config) {
|
|
27
|
-
const bindings = Object.entries(config.bindings);
|
|
28
|
-
const bindingIds = new Map(bindings.map(([id, binding]) => [
|
|
29
|
-
id, isRecord(binding) ? configurationId(binding.name, id) : id,
|
|
30
|
-
]));
|
|
31
|
-
const providerIds = new Map(Object.entries(config.virtualProviders).map(([id, provider]) => {
|
|
32
|
-
if (!isRecord(provider)) return [id, id];
|
|
33
|
-
const owners = bindings.filter(([, binding]) => binding?.virtualProvider === id);
|
|
34
|
-
if (owners.length > 1) return [id, id];
|
|
35
|
-
const owner = owners[0];
|
|
36
|
-
const suffix = id.startsWith("cabletidy_") ? id.slice("cabletidy_".length) : id;
|
|
37
|
-
return [id, providerIdForConfiguration(owner ? bindingIds.get(owner[0]) : configurationId(suffix))];
|
|
38
|
-
}));
|
|
39
|
-
|
|
40
|
-
// Leave colliding records intact so validation can report them without
|
|
41
|
-
// losing either configuration or retargeting a reference to another one.
|
|
42
|
-
const uniqueRenames = (ids) => {
|
|
43
|
-
const counts = new Map();
|
|
44
|
-
for (const id of ids.values()) counts.set(id, (counts.get(id) || 0) + 1);
|
|
45
|
-
const result = new Map([...ids].map(([oldId, id]) => [oldId, counts.get(id) === 1 ? id : oldId]));
|
|
46
|
-
let changed;
|
|
47
|
-
do {
|
|
48
|
-
changed = false;
|
|
49
|
-
for (const [oldId, id] of result) {
|
|
50
|
-
if (id !== oldId && result.has(id) && result.get(id) === id) {
|
|
51
|
-
result.set(oldId, oldId);
|
|
52
|
-
changed = true;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
} while (changed);
|
|
56
|
-
return result;
|
|
57
|
-
};
|
|
58
|
-
const renamedBindings = uniqueRenames(bindingIds);
|
|
59
|
-
const renamedProviders = uniqueRenames(providerIds);
|
|
60
|
-
config.bindings = Object.fromEntries(bindings.map(([id, binding]) => [
|
|
61
|
-
renamedBindings.get(id),
|
|
62
|
-
isRecord(binding) ? {
|
|
63
|
-
...binding,
|
|
64
|
-
id: renamedBindings.get(id),
|
|
65
|
-
virtualProvider: renamedProviders.get(binding.virtualProvider) ?? binding.virtualProvider,
|
|
66
|
-
} : binding,
|
|
67
|
-
]));
|
|
68
|
-
config.virtualProviders = Object.fromEntries(Object.entries(config.virtualProviders).map(([id, provider]) => [
|
|
69
|
-
renamedProviders.get(id),
|
|
70
|
-
isRecord(provider) ? { ...provider, id: renamedProviders.get(id) } : provider,
|
|
71
|
-
]));
|
|
72
|
-
return { bindingIds: renamedBindings, providerIds: renamedProviders };
|
|
73
|
-
}
|
package/web/index.html
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="zh-CN">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<meta name="theme-color" content="#f5f6f7" />
|
|
7
|
-
<title>CableTidy 管理</title>
|
|
8
|
-
<link rel="stylesheet" href="/styles.css" />
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<div id="app" class="app-shell">
|
|
12
|
-
<aside class="rail">
|
|
13
|
-
<div class="brand">
|
|
14
|
-
<strong>CableTidy</strong>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="rail-status">
|
|
17
|
-
<span class="status-light" aria-hidden="true"></span>
|
|
18
|
-
<span id="rail-status">连接中</span>
|
|
19
|
-
</div>
|
|
20
|
-
<nav class="nav" aria-label="主导航">
|
|
21
|
-
<button class="nav-item is-active" data-page="overview">
|
|
22
|
-
配置套装
|
|
23
|
-
</button>
|
|
24
|
-
<button class="nav-item" data-page="diagnostics">
|
|
25
|
-
诊断
|
|
26
|
-
</button>
|
|
27
|
-
</nav>
|
|
28
|
-
<div class="rail-footer">
|
|
29
|
-
<span id="revision-label">版本 0</span>
|
|
30
|
-
</div>
|
|
31
|
-
</aside>
|
|
32
|
-
|
|
33
|
-
<main class="main" id="main-content">
|
|
34
|
-
<header class="topbar">
|
|
35
|
-
<div>
|
|
36
|
-
<h1 id="page-title">配置套装</h1>
|
|
37
|
-
</div>
|
|
38
|
-
<div class="topbar-actions">
|
|
39
|
-
<button class="button button-quiet" id="refresh-button">刷新</button>
|
|
40
|
-
</div>
|
|
41
|
-
</header>
|
|
42
|
-
<div id="toast-region" class="toast-region" aria-live="polite"></div>
|
|
43
|
-
<section id="page-content" class="page-content"></section>
|
|
44
|
-
</main>
|
|
45
|
-
</div>
|
|
46
|
-
<script type="module" src="/app.js"></script>
|
|
47
|
-
</body>
|
|
48
|
-
</html>
|