@cryer/star-cli 0.3.8 → 0.3.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/README.md CHANGED
@@ -66,7 +66,7 @@ maxSteps = 100
66
66
  contextCompaction = "summary" # summary | truncate — how over-budget history is compacted
67
67
  streamMaxRetries = 5 # extra attempts per model request on transient failures
68
68
  # (network error, 429/5xx, idle cutoff, empty reply); 0 disables
69
- streamIdleTimeoutSec = 20 # seconds with no stream output before a stalled response is
69
+ streamIdleTimeoutSec = 60 # seconds with no stream output before a stalled response is
70
70
  # ended gracefully (some relays never close the stream)
71
71
  streamFirstChunkTimeoutSec = 300 # seconds to wait for the very first content part — slow
72
72
  # thinking-model endpoints can stay silent for minutes
@@ -116,6 +116,11 @@ model = "gpt-4o" # model id sent to the API
116
116
  # provider (low/medium/high are common; some add minimal/max...).
117
117
  # Unset = server default. Ignored for anthropic. The /model
118
118
  # picker also offers these levels after a model pick.
119
+ # vision = false # mark a text-only model: read_image/screenshot then decline with
120
+ # a text error instead of attaching images the endpoint would
121
+ # reject. Unset = images allowed. (Without it, a 4xx rejecting
122
+ # images outright still self-heals: the images are stripped from
123
+ # the history and the request retried once.)
119
124
  # streamIdleTimeoutSec = 60 # per-model overrides of the global stream watchdog timeouts
120
125
  # streamFirstChunkTimeoutSec = 600
121
126
  # optional per-model pricing in USD per 1M tokens — enables the $ estimate in /cost and /usage.
@@ -172,7 +177,7 @@ model = "kimi-for-coding"
172
177
  temperature = 1 # mandatory here — the endpoint rejects any other value
173
178
  contextMaxTokens = 128000
174
179
  # raise these when the relay buffers long generations:
175
- # streamIdleTimeoutSec = 60 # default 20
180
+ # streamIdleTimeoutSec = 120 # default 60
176
181
  # streamFirstChunkTimeoutSec = 600 # default 300
177
182
  ```
178
183
 
@@ -384,3 +389,12 @@ pnpm test:pipeline # layered pipeline incl. optional live LLM smoke (needs an
384
389
  CI runs lint, typecheck, tests, and build on Ubuntu + Windows against Node 20/22 (`.github/workflows/ci.yml`).
385
390
 
386
391
  Architecture: `src/cli` (Ink UI), `src/agent` (main loop), `src/llm` (Vercel AI SDK provider layer), `src/tools`, `src/context` (token budget + compaction), `src/permissions`, `src/session`, `src/config`.
392
+
393
+ ## Benchmark
394
+
395
+ [Terminal-Bench 2.0](https://github.com/laude-institute/terminal-bench), 20 randomly sampled tasks, same model for both agents:
396
+
397
+ | Agent | Model | Pass rate | Avg tokens | Avg duration |
398
+ |---|---|---|---|---|
399
+ | Star CLI 0.3.9 | Kimi K3 | 17/20 (85%) | 129.2K | 414s |
400
+ | terminus-2 2.0.0 | Kimi K3 | 9/20 (45%) | 49.5K | 484s |
package/README.zh-CN.md CHANGED
@@ -65,7 +65,7 @@ maxSteps = 100
65
65
  contextCompaction = "summary" # summary | truncate —— 历史超出预算时的压缩方式
66
66
  streamMaxRetries = 5 # 单次模型请求在瞬时失败(网络错误、429/5xx、idle 截断、
67
67
  # 空回复)时的额外重试次数;0 表示禁用
68
- streamIdleTimeoutSec = 20 # 流没有任何输出的秒数,超过后将停滞的响应优雅结束
68
+ streamIdleTimeoutSec = 60 # 流没有任何输出的秒数,超过后将停滞的响应优雅结束
69
69
  #(有些中转站从不关闭流)
70
70
  streamFirstChunkTimeoutSec = 300 # 等待第一个内容分片的秒数——慢速思考模型端点在接受请求后
71
71
  # 可能静默数分钟
@@ -114,6 +114,10 @@ model = "gpt-4o" # 发送给 API 的模型 id
114
114
  # minimal/max 等),因此接受任意字符串,由服务端校验。
115
115
  # 不设置 = 服务端默认。anthropic 协议下忽略。
116
116
  # /model 选完模型后也会接着让你选择推理强度。
117
+ # vision = false # 标记纯语言模型:read_image/screenshot 会直接返回文本错误,
118
+ # 不再把图片塞进历史导致端点报 4xx。不设置 = 允许图片。(即使
119
+ # 不设置,端点明确拒绝图片的 4xx 也会自愈:剥掉历史中的图片后
120
+ # 自动重试一次。)
117
121
  # streamIdleTimeoutSec = 60 # 按模型覆盖全局的流看门狗超时
118
122
  # streamFirstChunkTimeoutSec = 600
119
123
  # 可选的按模型定价(美元/1M token)——启用 /cost 和 /usage 中的美元估算。
@@ -168,7 +172,7 @@ model = "kimi-for-coding"
168
172
  temperature = 1 # 此处必须设置——该端点拒绝任何其他取值
169
173
  contextMaxTokens = 128000
170
174
  # 中转站长时间缓冲整段生成时可调大:
171
- # streamIdleTimeoutSec = 60 # 默认 20
175
+ # streamIdleTimeoutSec = 120 # 默认 60
172
176
  # streamFirstChunkTimeoutSec = 600 # 默认 300
173
177
  ```
174
178
 
@@ -380,3 +384,12 @@ pnpm test:pipeline # layered pipeline incl. optional live LLM smoke (needs an
380
384
  CI 在 Ubuntu + Windows 上、Node 20/22 下运行 lint、typecheck、测试和构建(`.github/workflows/ci.yml`)。
381
385
 
382
386
  架构:`src/cli`(Ink UI)、`src/agent`(主循环)、`src/llm`(Vercel AI SDK 服务商层)、`src/tools`、`src/context`(token 预算 + 压缩)、`src/permissions`、`src/session`、`src/config`。
387
+
388
+ ## 基准测试
389
+
390
+ [Terminal-Bench 2.0](https://github.com/laude-institute/terminal-bench),随机抽取 20 个任务,两个 agent 使用相同模型:
391
+
392
+ | Agent | 模型 | 通过率 | 平均 token 消耗 | 平均耗时 |
393
+ |---|---|---|---|---|
394
+ | Star CLI 0.3.9 | Kimi K3 | 17/20 (85%) | 129.2K | 414s |
395
+ | terminus-2 2.0.0 | Kimi K3 | 9/20 (45%) | 49.5K | 484s |
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/llm/registry.ts
4
+ function listModels(config) {
5
+ return config.models;
6
+ }
7
+ function resolveModelConfig(config, modelName) {
8
+ const name = modelName ?? config.defaultModel;
9
+ const model = config.models.find((m) => m.name === name);
10
+ if (!model) {
11
+ const available = config.models.map((m) => m.name).join(", ") || "(none)";
12
+ throw new Error(`Model "${name}" not found. Available models: ${available}`);
13
+ }
14
+ return model;
15
+ }
16
+ function resolveStartupModel(config, sessionModel) {
17
+ if (sessionModel) {
18
+ if (config.models.some((m) => m.name === sessionModel)) {
19
+ return { name: sessionModel, notice: null };
20
+ }
21
+ return {
22
+ name: config.defaultModel,
23
+ notice: `Session model "${sessionModel}" not found in config \u2014 using default model.`
24
+ };
25
+ }
26
+ return { name: config.defaultModel, notice: null };
27
+ }
28
+
29
+ export {
30
+ listModels,
31
+ resolveModelConfig,
32
+ resolveStartupModel
33
+ };
34
+ //# sourceMappingURL=chunk-4IRY44TG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/llm/registry.ts"],"sourcesContent":["import type { ModelConfig, StarConfig } from \"../config/schema\";\n\nexport function listModels(config: StarConfig): ModelConfig[] {\n return config.models;\n}\n\nexport function resolveModelConfig(config: StarConfig, modelName?: string): ModelConfig {\n const name = modelName ?? config.defaultModel;\n const model = config.models.find((m) => m.name === name);\n if (!model) {\n const available = config.models.map((m) => m.name).join(\", \") || \"(none)\";\n throw new Error(`Model \"${name}\" not found. Available models: ${available}`);\n }\n return model;\n}\n\n// Pick the model at startup. An explicit --model already sits in\n// config.defaultModel (loader override), so it wins naturally; otherwise a\n// resumed session's recorded model is restored when it still exists in the\n// config. A stale recorded model falls back to the default with a notice.\nexport function resolveStartupModel(\n config: StarConfig,\n sessionModel?: string | null,\n): { name: string | undefined; notice: string | null } {\n if (sessionModel) {\n if (config.models.some((m) => m.name === sessionModel)) {\n return { name: sessionModel, notice: null };\n }\n return {\n name: config.defaultModel,\n notice: `Session model \"${sessionModel}\" not found in config — using default model.`,\n };\n }\n return { name: config.defaultModel, notice: null };\n}\n"],"mappings":";;;AAEO,SAAS,WAAW,QAAmC;AAC5D,SAAO,OAAO;AAChB;AAEO,SAAS,mBAAmB,QAAoB,WAAiC;AACtF,QAAM,OAAO,aAAa,OAAO;AACjC,QAAM,QAAQ,OAAO,OAAO,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI;AACvD,MAAI,CAAC,OAAO;AACV,UAAM,YAAY,OAAO,OAAO,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,IAAI,KAAK;AACjE,UAAM,IAAI,MAAM,UAAU,IAAI,kCAAkC,SAAS,EAAE;AAAA,EAC7E;AACA,SAAO;AACT;AAMO,SAAS,oBACd,QACA,cACqD;AACrD,MAAI,cAAc;AAChB,QAAI,OAAO,OAAO,KAAK,CAAC,MAAM,EAAE,SAAS,YAAY,GAAG;AACtD,aAAO,EAAE,MAAM,cAAc,QAAQ,KAAK;AAAA,IAC5C;AACA,WAAO;AAAA,MACL,MAAM,OAAO;AAAA,MACb,QAAQ,kBAAkB,YAAY;AAAA,IACxC;AAAA,EACF;AACA,SAAO,EAAE,MAAM,OAAO,cAAc,QAAQ,KAAK;AACnD;","names":[]}