dimcode 0.0.66 → 0.0.67-beta.10

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/cli.mjs DELETED
@@ -1,99 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { spawn, spawnSync } from 'node:child_process'
4
- import { existsSync } from 'node:fs'
5
- import path from 'node:path'
6
- import process from 'node:process'
7
- import { fileURLToPath } from 'node:url'
8
-
9
- const cliPath = fileURLToPath(import.meta.url)
10
- const cliDir = path.dirname(cliPath)
11
- const sourceEntry = path.join(cliDir, 'src', 'cli.ts')
12
- const bundledEntry = path.join(cliDir, 'dist', 'cli.mjs')
13
- const sourceEntryUrl = new URL('./src/cli.ts', import.meta.url).href
14
- const bundledEntryUrl = new URL('./dist/cli.mjs', import.meta.url).href
15
-
16
- function resolveBunCommand() {
17
- return process.env.BUN_BIN?.trim() || 'bun'
18
- }
19
-
20
- function canRelayToBunSource() {
21
- if (typeof globalThis.Bun !== 'undefined')
22
- return false
23
- if (!existsSync(sourceEntry))
24
- return false
25
-
26
- const probe = spawnSync(resolveBunCommand(), ['--version'], { stdio: 'ignore' })
27
- return probe.status === 0
28
- }
29
-
30
- async function installEnvProxyDispatcher() {
31
- // Node's native fetch (undici) ignores HTTP_PROXY/HTTPS_PROXY env vars unless
32
- // a proxy-aware dispatcher is installed. Bun's fetch honors them natively, so
33
- // this is only needed on the Node-bundled path. Skip silently if no proxy env
34
- // is set, or if undici is unavailable.
35
- const env = process.env
36
- const hasProxyEnv = Boolean(
37
- env.HTTP_PROXY || env.http_proxy
38
- || env.HTTPS_PROXY || env.https_proxy
39
- || env.NO_PROXY || env.no_proxy,
40
- )
41
- if (!hasProxyEnv)
42
- return
43
- try {
44
- const { setGlobalDispatcher, EnvHttpProxyAgent } = await import('undici')
45
- setGlobalDispatcher(new EnvHttpProxyAgent())
46
- }
47
- catch (err) {
48
- if (env.DIMCODE_DEBUG === '1' || env.DIMCODE_DEBUG === 'true') {
49
- console.error(
50
- '[dimcode] failed to install EnvHttpProxyAgent:',
51
- err instanceof Error ? err.message : String(err),
52
- )
53
- }
54
- }
55
- }
56
-
57
- async function relayToBunSource() {
58
- const child = spawn(resolveBunCommand(), [cliPath, ...process.argv.slice(2)], {
59
- stdio: 'inherit',
60
- env: process.env,
61
- })
62
-
63
- const forwardSignal = (signal) => {
64
- if (!child.killed)
65
- child.kill(signal)
66
- }
67
-
68
- for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP'])
69
- process.on(signal, () => forwardSignal(signal))
70
-
71
- child.on('error', (error) => {
72
- console.error(error)
73
- process.exit(1)
74
- })
75
-
76
- await new Promise((resolve) => {
77
- child.on('exit', (code) => {
78
- process.exit(code ?? 1)
79
- })
80
- child.on('close', () => resolve())
81
- })
82
- }
83
-
84
- if (typeof globalThis.Bun !== 'undefined') {
85
- if (existsSync(bundledEntry))
86
- await import(bundledEntryUrl)
87
- else {
88
- const { main } = await import(sourceEntryUrl)
89
- await main()
90
- }
91
- }
92
- else if (canRelayToBunSource()) {
93
- // In source checkouts, prefer Bun so `node .../cli.mjs` uses the current TS sources.
94
- await relayToBunSource()
95
- }
96
- else {
97
- await installEnvProxyDispatcher()
98
- await import(bundledEntryUrl)
99
- }
@@ -1 +0,0 @@
1
- {"id":"aihubmix","name":"Aihubmix","api":"https://aihubmix.com/v1","adapter":"openai","modelsFile":"models/aihubmix.json","defaultModelId":"gpt-5.5"}
@@ -1 +0,0 @@
1
- {"id":"anthropic","name":"Anthropic","api":"https://api.anthropic.com","adapter":"anthropic","models":[{"id":"claude-opus-4-20250514","name":"Claude Opus 4","family":"claude-opus","attachment":true,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"limit":{"context":200000,"output":32000},"display_name":"Claude Opus 4","type":"chat"},{"id":"claude-3-sonnet-20240229","name":"Claude Sonnet 3","family":"claude-sonnet","attachment":true,"reasoning":{"supported":false},"tool_call":true,"temperature":true,"knowledge":"2023-08-31","release_date":"2024-03-04","last_updated":"2024-03-04","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":0.3},"limit":{"context":200000,"output":4096},"display_name":"Claude Sonnet 3","type":"chat"},{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","family":"claude-sonnet","attachment":true,"reasoning":{"supported":true,"default":false},"tool_call":true,"temperature":true,"knowledge":"2025-08-31","release_date":"2026-02-17","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"limit":{"context":1000000,"output":64000},"display_name":"Claude Sonnet 4.6","type":"chat","extra_capabilities":{"reasoning":{"supported":true,"default_enabled":false,"mode":"mixed","budget":{"min":1024,"unit":"tokens"},"effort":"medium","effort_options":["low","medium","high","max"],"interleaved":true,"summaries":true,"visibility":"summary","continuation":["thinking_blocks"],"notes":["Anthropic recommends adaptive thinking with effort for Claude 4.6; budget_tokens remains a deprecated compatibility path."]}}},{"id":"claude-3-5-haiku-20241022","name":"Claude Haiku 3.5","family":"claude-haiku","attachment":true,"reasoning":{"supported":false},"tool_call":true,"temperature":true,"knowledge":"2024-07-31","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":0.8,"output":4,"cache_read":0.08,"cache_write":1},"limit":{"context":200000,"output":8192},"display_name":"Claude Haiku 3.5","type":"chat"},{"id":"claude-opus-4-1-20250805","name":"Claude Opus 4.1","family":"claude-opus","attachment":true,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"limit":{"context":200000,"output":32000},"display_name":"Claude Opus 4.1","type":"chat"},{"id":"claude-opus-4-0","name":"Claude Opus 4 (latest)","family":"claude-opus","attachment":true,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"limit":{"context":200000,"output":32000},"display_name":"Claude Opus 4 (latest)","type":"chat"},{"id":"claude-opus-4-5","name":"Claude Opus 4.5 (latest)","family":"claude-opus","attachment":true,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-11-24","last_updated":"2025-11-24","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"limit":{"context":200000,"output":64000},"display_name":"Claude Opus 4.5 (latest)","type":"chat","extra_capabilities":{"reasoning":{"supported":true}}},{"id":"claude-3-7-sonnet-20250219","name":"Claude Sonnet 3.7","family":"claude-sonnet","attachment":true,"reasoning":{"supported":true,"default":false},"tool_call":true,"temperature":true,"knowledge":"2024-10-31","release_date":"2025-02-19","last_updated":"2025-02-19","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"limit":{"context":200000,"output":64000},"display_name":"Claude Sonnet 3.7","type":"chat","extra_capabilities":{"reasoning":{"supported":true,"default_enabled":false,"mode":"budget","budget":{"min":1024,"unit":"tokens"},"interleaved":false,"summaries":false,"visibility":"full","continuation":["thinking_blocks"],"notes":["Anthropic uses thinking budget tokens"]}}},{"id":"claude-3-haiku-20240307","name":"Claude Haiku 3","family":"claude-haiku","attachment":true,"reasoning":{"supported":false},"tool_call":true,"temperature":true,"knowledge":"2023-08-31","release_date":"2024-03-13","last_updated":"2024-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":0.25,"output":1.25,"cache_read":0.03,"cache_write":0.3},"limit":{"context":200000,"output":4096},"display_name":"Claude Haiku 3","type":"chat"},{"id":"claude-haiku-4-5-20251001","name":"Claude Haiku 4.5","family":"claude-haiku","attachment":true,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"limit":{"context":200000,"output":64000},"display_name":"Claude Haiku 4.5","type":"chat"},{"id":"claude-opus-4-1","name":"Claude Opus 4.1 (latest)","family":"claude-opus","attachment":true,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-08-05","last_updated":"2025-08-05","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"limit":{"context":200000,"output":32000},"display_name":"Claude Opus 4.1 (latest)","type":"chat","extra_capabilities":{"reasoning":{"supported":true}}},{"id":"claude-sonnet-4-0","name":"Claude Sonnet 4 (latest)","family":"claude-sonnet","attachment":true,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"limit":{"context":200000,"output":64000},"display_name":"Claude Sonnet 4 (latest)","type":"chat","extra_capabilities":{"reasoning":{"supported":true}}},{"id":"claude-opus-4-6","name":"Claude Opus 4.6","family":"claude-opus","attachment":true,"reasoning":{"supported":true,"default":false},"tool_call":true,"temperature":true,"knowledge":"2025-05-31","release_date":"2026-02-05","last_updated":"2026-03-13","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"limit":{"context":1000000,"output":128000},"experimental":{"modes":{"fast":{"cost":{"input":30,"output":150,"cache_read":3,"cache_write":37.5},"provider":{"body":{"speed":"fast"},"headers":{"anthropic-beta":"fast-mode-2026-02-01"}}}}},"display_name":"Claude Opus 4.6","type":"chat","extra_capabilities":{"reasoning":{"supported":true,"default_enabled":false,"mode":"mixed","budget":{"min":1024,"unit":"tokens"},"effort":"medium","effort_options":["low","medium","high","max"],"interleaved":true,"summaries":true,"visibility":"summary","continuation":["thinking_blocks"],"notes":["Anthropic recommends adaptive thinking with effort for Claude 4.6; budget_tokens remains a deprecated compatibility path."]}}},{"id":"claude-3-5-haiku-latest","name":"Claude Haiku 3.5 (latest)","family":"claude-haiku","attachment":true,"reasoning":{"supported":false},"tool_call":true,"temperature":true,"knowledge":"2024-07-31","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":0.8,"output":4,"cache_read":0.08,"cache_write":1},"limit":{"context":200000,"output":8192},"display_name":"Claude Haiku 3.5 (latest)","type":"chat"},{"id":"claude-sonnet-4-20250514","name":"Claude Sonnet 4","family":"claude-sonnet","attachment":true,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-05-22","last_updated":"2025-05-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"limit":{"context":200000,"output":64000},"display_name":"Claude Sonnet 4","type":"chat"},{"id":"claude-opus-4-5-20251101","name":"Claude Opus 4.5","family":"claude-opus","attachment":true,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-03-31","release_date":"2025-11-01","last_updated":"2025-11-01","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"limit":{"context":200000,"output":64000},"display_name":"Claude Opus 4.5","type":"chat"},{"id":"claude-sonnet-4-5-20250929","name":"Claude Sonnet 4.5","family":"claude-sonnet","attachment":true,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"limit":{"context":200000,"output":64000},"display_name":"Claude Sonnet 4.5","type":"chat"},{"id":"claude-opus-4-7","name":"Claude Opus 4.7","family":"claude-opus","attachment":true,"reasoning":{"supported":true,"default":false},"tool_call":true,"temperature":false,"knowledge":"2026-01-31","release_date":"2026-04-16","last_updated":"2026-04-16","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":5,"output":25,"cache_read":0.5,"cache_write":6.25},"limit":{"context":1000000,"output":128000},"display_name":"Claude Opus 4.7","type":"chat","extra_capabilities":{"reasoning":{"supported":true,"default_enabled":false,"mode":"effort","effort":"high","effort_options":["low","medium","high","xhigh","max"],"interleaved":true,"summaries":true,"visibility":"omitted","continuation":["thinking_blocks"],"notes":["Claude Opus 4.7 requires thinking.type = \"adaptive\" to enable thinking explicitly.","Manual budget_tokens requests return 400 on Claude Opus 4.7.","task_budget is separate from thinking control and should not be treated as a thinking budget."]}}},{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5 (latest)","family":"claude-sonnet","attachment":true,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-07-31","release_date":"2025-09-29","last_updated":"2025-09-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"limit":{"context":200000,"output":64000},"display_name":"Claude Sonnet 4.5 (latest)","type":"chat","extra_capabilities":{"reasoning":{"supported":true}}},{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5 (latest)","family":"claude-haiku","attachment":true,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-02-28","release_date":"2025-10-15","last_updated":"2025-10-15","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":1,"output":5,"cache_read":0.1,"cache_write":1.25},"limit":{"context":200000,"output":64000},"display_name":"Claude Haiku 4.5 (latest)","type":"chat","extra_capabilities":{"reasoning":{"supported":true}}},{"id":"claude-3-5-sonnet-20241022","name":"Claude Sonnet 3.5 v2","family":"claude-sonnet","attachment":true,"reasoning":{"supported":false},"tool_call":true,"temperature":true,"knowledge":"2024-04-30","release_date":"2024-10-22","last_updated":"2024-10-22","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"limit":{"context":200000,"output":8192},"display_name":"Claude Sonnet 3.5 v2","type":"chat"},{"id":"claude-3-opus-20240229","name":"Claude Opus 3","family":"claude-opus","attachment":true,"reasoning":{"supported":false},"tool_call":true,"temperature":true,"knowledge":"2023-08-31","release_date":"2024-02-29","last_updated":"2024-02-29","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":15,"output":75,"cache_read":1.5,"cache_write":18.75},"limit":{"context":200000,"output":4096},"display_name":"Claude Opus 3","type":"chat"},{"id":"claude-3-5-sonnet-20240620","name":"Claude Sonnet 3.5","family":"claude-sonnet","attachment":true,"reasoning":{"supported":false},"tool_call":true,"temperature":true,"knowledge":"2024-04-30","release_date":"2024-06-20","last_updated":"2024-06-20","modalities":{"input":["text","image","pdf"],"output":["text"]},"open_weights":false,"cost":{"input":3,"output":15,"cache_read":0.3,"cache_write":3.75},"limit":{"context":200000,"output":8192},"display_name":"Claude Sonnet 3.5","type":"chat"}],"defaultModelId":"claude-opus-4-20250514"}
@@ -1 +0,0 @@
1
- {"id":"ark-code","name":"Ark Code","api":"https://ark.cn-beijing.volces.com/api/coding/v3","models":[{"id":"ark-code-latest","name":"ark-code-latest","tool_call":true,"temperature":true,"modalities":{"input":["text"],"output":["text"]},"open_weights":true,"cost":{"input":0,"output":0,"cache_read":0,"cache_write":0},"limit":{"context":204800,"output":60000},"display_name":"ark code","type":"chat"}]}
@@ -1 +0,0 @@
1
- {"id":"bailian-coding-plan","name":"Model Studio Coding Plan","api":"https://coding.dashscope.aliyuncs.com/v1","adapter":"openai","models":[{"id":"qwen3.5-plus","name":"Qwen3.5 Plus","family":"qwen","attachment":false,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-16","last_updated":"2026-02-16","modalities":{"input":["text","image"],"output":["text"]},"open_weights":false,"cost":{"input":0.1096,"output":0.6576,"cache_read":0.01096},"limit":{"context":991000,"output":991000},"display_name":"Qwen3.5 Plus","type":"chat"},{"id":"qwen3-max-2026-01-23","name":"Qwen3 Max 2026-01-23","family":"qwen","attachment":false,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"modalities":{"input":["text"],"output":["text"]},"open_weights":false,"cost":{"input":0.34246,"output":1.36984,"cache_read":0.34246},"limit":{"context":252000,"output":252000},"display_name":"Qwen3 Max 2026-01-23","type":"chat"},{"id":"qwen3-coder-next","name":"Qwen3 Coder Next","family":"qwen","attachment":false,"reasoning":{"supported":false},"tool_call":true,"temperature":true,"release_date":"2026-02-02","last_updated":"2026-02-08","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"cost":{"input":0.137,"output":0.548,"cache_read":0.137},"limit":{"context":2000000,"output":2000000},"display_name":"Qwen3 Coder Next","type":"chat"},{"id":"qwen3-coder-plus","name":"Qwen3 Coder Plus","family":"qwen","attachment":false,"reasoning":{"supported":false},"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-07-23","last_updated":"2025-07-23","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"cost":{"input":0.54,"output":2.16,"cache_read":0.108},"limit":{"context":1048576,"output":1048576},"display_name":"Qwen3 Coder Plus","type":"chat"},{"id":"MiniMax-M2.5","name":"MiniMax M2.5","family":"minimax","attachment":false,"reasoning":{"supported":true,"default":true},"tool_call":false,"temperature":true,"knowledge":"2025-01","release_date":"2026-02-12","last_updated":"2026-02-12","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"cost":{"input":0.288,"output":1.152},"limit":{"context":204800,"output":204800},"display_name":"MiniMax M2.5","type":"chat"},{"id":"glm-5","name":"GLM-5","family":"glm","attachment":false,"reasoning":{"supported":true,"default":true},"tool_call":false,"temperature":true,"knowledge":"2025-04","release_date":"2026-02-11","last_updated":"2026-02-11","modalities":{"input":["text"],"output":["text"]},"open_weights":false,"cost":{"input":0.88,"output":2.816,"cache_read":0.176},"limit":{"context":202752,"output":202752},"display_name":"GLM-5","type":"chat"},{"id":"glm-4.7","name":"GLM-4.7","family":"glm","attachment":false,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":true,"knowledge":"2025-04","release_date":"2025-12-22","last_updated":"2025-12-22","modalities":{"input":["text"],"output":["text"]},"open_weights":true,"cost":{"input":0.273974,"output":1.095896,"cache_read":0.054795},"limit":{"context":200000,"output":200000},"display_name":"GLM-4.7","type":"chat"},{"id":"kimi-k2.5","name":"Kimi K2.5","family":"kimi","attachment":false,"reasoning":{"supported":true,"default":true},"tool_call":true,"temperature":false,"knowledge":"2025-01","release_date":"2026-01","last_updated":"2026-01","modalities":{"input":["text","image"],"output":["text"]},"open_weights":true,"cost":{"input":0.6,"output":3,"cache_read":0.105},"limit":{"context":256000,"output":256000},"display_name":"Kimi K2.5","type":"chat"}],"defaultModelId":"qwen3.5-plus"}