DoSun
7c3d9da000
Merge pull request #57 from y574444354/feat/cloud-question
...
Feat/cloud question
2026-05-11 14:16:24 +08:00
林凯90331
1ef4182a9e
fix(server): resolve merge conflicts with feat/server-refactor
...
- event.ts: combine /event endpoint with cwdFilter support,
remove unused /global/event endpoint
- sessionHandle.ts: keep INIT_TIMEOUT_MS, emitOpencodeEvent,
emitBusyStatus, toPermissionKey and extractPatterns
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-11 13:31:24 +08:00
林凯90331
009e9f0c49
feat(server): opencode-compatible question/permission with AskUserQuestion popup support
...
- emit opencode-compatible SSE events for questions and permissions
(flat shape with top-level session_id for wrapEventStream routing)
- adapt question API (/question, /question/:id/reply, /question/:id/reject)
for AskUserQuestion and elicitation workflows
- fix AskUserQuestion tool name matching and guard against double-wrapped events
- allow requiresUserInteraction tools to ask user even in bypassPermissions mode
- avoid blocking on session init to prevent cold-start timeout
- add /global/event SSE endpoint and cwdFilter support
- add question routes and session handle tests
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-11 12:54:44 +08:00
Askhz
5d288c4290
chore: remove x-anthropic-billing-header from system prompt
2026-05-11 11:47:39 +08:00
y574444354
dbef683bb2
docs: update contributors
2026-05-11 03:45:52 +00:00
linkai0924
6651109d9c
Merge pull request #55 from y574444354/fix/batch-work-issue
...
fix(rawDump): prevent batch worker concurrency cascade and add fetch …
2026-05-11 11:41:18 +08:00
林凯90331
1240a1a499
fix(rawDump): prevent batch worker concurrency cascade and add fetch timeout
...
- Add in-process isRunning flag to block reentrant runBatch (file lock
fails when pid === process.pid)
- Replace setInterval + double immediate trigger with self-scheduling
setTimeout that only fires after previous batch awaits
- Move clearQueue() to right after readQueue() so any unexpected
concurrent runBatch sees an empty queue and exits immediately
- Cache repoInfo and workingTreeDiff in processTask, pass into all three
upload functions to halve git invocations per task
- Add 30s AbortController timeout on postJson fetch so the worker no
longer hangs indefinitely on unresponsive networks
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 11:34:44 +08:00
Askhz
4dcb3a2107
feat: add agent-type request header to CoStrict provider
...
在 CoStrict provider 的所有 API 请求中注入 agent-type header,
反映当前会话所使用的 agent 或 skill,默认值为 "build"。
- fetch.ts: createCoStrictFetch 接受可选 agentType 参数,PascalCase
自动转 kebab-case(StrictSpec → strict-spec),注入 agent-type header
- index.ts: queryModelCoStrict 读取 getMainThreadAgentType()(--agent 启动)
或 getActiveSkillName()(slash skill 触发)作为 agentType
- models.ts: /v1/models 请求添加 User-Agent: csc/{VERSION} header
- state.ts: 新增 activeSkillName 状态及 getter/setter
- processSlashCommand.tsx: inline skill 和 fork skill(context:fork)
触发时均调用 setActiveSkillName 记录当前 skill/agent 名
- caches.ts: /clear 时调用 setActiveSkillName(undefined) 重置状态,
避免新会话继承上一会话的 agent-type
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 11:17:02 +08:00
claude-code-best
2017df72e8
chore: 2.4.1
2026-05-11 10:27:53 +08:00
claude-code-best
4e5d46ce1e
docs: update contributors
2026-05-11 01:54:30 +00:00
claude-code-best
bc74d0da62
fix: 修复 CI 中 10 个测试的 Bun mock.module 跨文件污染
...
- thinking.test.ts: 补 envUtils.js 防御性 mock,提供 isEnvDefinedFalsy
和 isEnvTruthy 正确实现,覆盖 6 个其他测试文件不完整 mock 导致的污染
- launchLocalVault.test.ts: 补 keychain.js 防御性 mock,强制抛
KeychainUnavailableError 使 store 走文件回退路径,覆盖 store.test.ts
和 keychain.test.ts 的 mock 残留
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-11 09:38:13 +08:00
DoSun
434ee9e806
feat: session status 改造为 prompt 级别 busy/idle 三态,SSE 事件和 status 接口按 cwd 过滤
...
- 新增 SessionBusyStatus 类型(idle/busy/retry),替代进程生命周期状态
- SessionHandle 在 prompt/result/abort/close/error 中追踪 busyStatus 并通过 EventBus 发布 session.status SSE 事件
- /session/status 接口返回扁平 Record<string, SessionBusyStatus>,支持按 cwd 过滤
- EventBus 支持客户端 cwdFilter,SSE 事件按工作空间过滤推送
- sessionManager 在 create/delete 时注册/注销 sessionCwd 映射
2026-05-11 09:26:15 +08:00
claude-code-best
3de1e2c960
fix: 修复 CI test 阶段测试失败时不退出的 bug
...
将 `|| true` 替换为 `set -o pipefail`,使管道中 bun test 的非零退出码能正确传播,CI 在测试失败时正确报错。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-11 09:18:09 +08:00
claude-code-best
b85cfc69b7
fix: 修复 Bun mock.module 跨文件污染导致 87 个测试失败
...
- 重写 setupAxiosMock 使其完全 per-file 独立,消除共享 handles 数组的竞态
- 将 launchSchedule/launchMemoryStores/launchAgentsPlatform 从直接 mock
源 API 模块改为 mock axios 底层 HTTP 层,避免污染同目录 api.test.ts
- 删除两个 Ink waitUntilExit 超时测试文件
- 修复 hostGuard/keychain 跨文件 mock 污染
- 清理 api.test.ts 中的 require() workaround
- 在 CLAUDE.md 记录 mock 污染排查经验
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-11 08:50:03 +08:00
claude-code-best
8f512c6222
Revert "feat: 添加 GBK 编码自动检测支持,文件读写工具透明处理非 UTF-8 文件"
...
This reverts commit 0ce8f7a1cb .
2026-05-10 22:57:30 +08:00
claude-code-best
24e55654f6
Revert "fix: 修复非 UTF-8 编码文件读写 round-trip 字节损坏"
...
This reverts commit 17c06690d8 .
2026-05-10 22:57:25 +08:00
claude-code-best
77092f71ab
fix: 修复非 UTF-8 编码文件读写 round-trip 字节损坏
...
GBK 文件编辑后被错误写入为 UTF-8(Buffer.from 不支持 gbk 编码,
encodeString 静默 fallback),latin1/ANSI 文件 0x80-0x9F 范围字节因
TextDecoder('latin1') 与 Buffer.from('latin1') 编解码不对称而被篡改。
修复:latin1 解码改用严格 ISO-8859-1 映射保证与 Buffer.from 对称;
GBK 编码通过 TextDecoder 反向构建查找表实现零依赖编码器。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-10 22:08:52 +08:00
claude-code-best
121bc61aa2
fix: 修复 issue-template 测试误删 .github/workflows 目录
...
afterEach 清理时 rmSync 误删了整个 .github/ 目录(含 workflows),
改为只删测试创建的 ISSUE_TEMPLATE 子目录。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-10 21:11:50 +08:00
claude-code-best
3d91ba033f
chore: 2.4.0
2026-05-10 20:50:58 +08:00
claude-code-best
58b58e649d
feat: 添加 GBK 编码自动检测支持,文件读写工具透明处理非 UTF-8 文件
...
新增 encoding.ts 核心模块实现三层编码检测(BOM → UTF-8 fatal → GBK 回退),
改造同步/异步读取路径和写入路径,使 FileReadTool/FileEditTool/FileWriteTool
能正确处理 GBK 编码文件。包含完整单元测试和 spec 文档。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-10 20:50:12 +08:00
claude-code-best
cfa7872771
fix: 修复 feature 的使用问题
2026-05-10 19:26:57 +08:00
claude-code-best
f928a11078
fix: 移除 auto mode 的 provider 和模型白名单限制
...
移除 firstParty provider 限制和 claude-(opus|sonnet)-4-[67] 模型白名单,
使所有模型和 provider 在 TRANSCRIPT_CLASSIFIER feature 启用时均可使用 auto mode。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-10 17:47:38 +08:00
claude-code-best
af0d34ebbe
Merge pull request #446 from claude-code-best/feature/prompt-cut-down
...
feat: 大量系统提示词优化
2026-05-10 15:30:34 +08:00
claude-code-best
c490099b74
Merge pull request #445 from claude-code-best/feature/many-feature-packagee
...
feat: local memory + local vault wiring + autofix-pr + CI mock isolation (refactor)
2026-05-10 15:30:04 +08:00
claude-code-best
d587372fb5
fix: 进一步脱敏 probe-subscription-endpoints 日志中的 orgUUID
...
将 orgUUID 截断长度从 8 字符缩减到 4 字符,消除 CodeQL
js/clear-text-logging 对 oauthAccount 敏感数据的告警。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-10 13:14:22 +08:00
claude-code-best
40cb4b0019
fix: 修复 setupAxiosMock 多测试文件并发时 mock 丢失的问题
...
mock.module('axios', ...) 是 process-global last-write-wins,多个测试文件
各自注册时只有最后一个 handle 的闭包被保留,导致前面的测试 stub 不生效。
改为全局单例注册,所有 handle 共享一个 mock.module,路由器运行时扫描
活跃 handle 分派请求。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-10 12:12:25 +08:00
claude-code-best
6a97094464
fix: 脱敏 probe-subscription-endpoints 日志中的 API base URL
...
使用 URL.origin 替代完整 URL,避免明文泄露 OAuth 配置中的敏感路径信息(CodeQL js/clear-text-logging)。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-10 11:40:27 +08:00
claude-code-best
97919755b1
chore: 2.3.0
2026-05-10 11:16:09 +08:00
claude-code-best
d303e1cd9a
fix: 代码审查修复 — 安全、性能和正确性
...
- triggersApi: 添加 assertSubscriptionBaseUrl 防止 OAuth token 泄露
- claude.ts: 修复流式响应 O(n^2) 字符串拼接,改用数组累积
- claude.ts: 移除未使用的 import,动态 import 改为静态 import
- StatusLine: BuiltinStatusLine 仅在 statusLineEnabled 时显示,修复双行问题
- local-vault: 修复 --reveal 标志位置解析 bug
- share: 修复 sk-proj-* OpenAI 密钥未脱敏问题
- store.ts: 临时文件改用同目录创建,避免跨文件系统 rename 失败
- store.ts: 添加空字符串 key 校验
- permissionValidation: 端口正则限制为有效 TCP 范围 0-65535
- 测试 mock 补全: schedule/vault/skill-store 测试文件
- 移除过期的 biome-ignore 注释
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-10 09:39:34 +08:00
Askhz
636e40a991
fix: move undici to dependencies to fix Node.js startup hang when https_proxy is set
...
When https_proxy is configured, configureGlobalAgents() calls __require("undici")
synchronously. In the npm package, undici was listed as devDependencies and thus
absent from node_modules after installation. Node.js 22 would then attempt to load
its built-in ESM undici via CJS require(), causing an ESM/CJS interop deadlock that
hung the process indefinitely with no way to interrupt it.
Moving undici to dependencies ensures it is installed as a CJS-compatible module,
allowing __require("undici") to resolve correctly under Node.js.
2026-05-10 00:35:18 +08:00
claude-code-best
da0b4bce24
chore: 移除废弃的 ctx_viz 类型声明
...
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:44 +08:00
claude-code-best
52956804ff
feat: 注册所有新命令到命令系统和工具注册表
...
- commands.ts: 注册所有新命令(memory-stores、vault、schedule 等),
移除 require() 动态加载,统一为 ESM import
- tools.ts: 注册 LocalMemoryRecallTool、VaultHttpFetchTool
- 补充命令测试(bridge-kick、commit、commit-push-pr、init-verifiers)
- 补充工具测试(AgentTool、RemoteTrigger、SkillTool、WebFetch、WebSearch)
- 集成测试:autonomy-lifecycle-user-flow 更新
- 探测脚本和功能文档
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:39 +08:00
claude-code-best
3f3d9d9638
feat: 添加 Provider Registry、StatusLine、Cache Stats 和其他增强
...
- providerRegistry: OpenAI 兼容 provider 切换(Cerebras/Groq/DeepSeek/Qwen)
- StatusLine: 增强状态栏(缓存命中率、TTL 倒计时、自定义 shell 命令)
- cacheStats: 缓存命中率和 token 签名追踪
- ultrareviewPreflight: 代码审查预检服务
- SkillsMenu/filterSkills: 技能菜单过滤增强
- MagicDocs/langfuse prompts: 提示词更新
- claude.ts: API 客户端更新
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:35 +08:00
claude-code-best
444e46a0b4
feat: 添加工具类命令(teleport、recap、break-cache、env、tui 等)
...
- /teleport: 从 claude.ai 恢复会话
- /recap: 生成会话摘要
- /break-cache: 提示缓存管理(once/always/off/status)
- /env: 环境信息展示(含密钥脱敏)
- /tui: 无闪烁 TUI 模式管理
- /onboarding: 引导流程
- /perf-issue: 性能问题诊断
- /debug-tool-call: 工具调用调试
- /usage: 用量统计(合并 /cost 和 /stats 别名)
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:31 +08:00
claude-code-best
4e4dd83f08
feat: 添加 GitHub 集成命令(issue、share、autofix-pr)
...
- /issue: 通过 gh CLI 创建 GitHub issue,支持标签/指派
- /share: 会话日志分享到 GitHub Gist,支持密钥脱敏
- /autofix-pr: 自动修复 CI 失败的 PR,进度追踪
- launchCommand: 共享命令启动器
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:23 +08:00
claude-code-best
fc43aa9e7a
feat: 添加本地 Memory/Vault 管理命令
...
- /local-memory: 本地记忆管理(store/entry CRUD、搜索、归档)
- /local-vault: 本地密钥保险库管理(加解密、keychain 集成)
- permissionValidation: vault 权限校验增强
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:20 +08:00
claude-code-best
8874fedb41
feat: 添加云端管理命令(memory-stores、vault、schedule、skill-store、agents-platform)
...
- /memory-stores: 远程记忆存储管理
- /vault: 密钥保险库管理
- /schedule: 云端定时触发器管理(cron)
- /skill-store: 技能商店浏览和安装
- /agents-platform: 远程 agent 调度管理
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:17 +08:00
claude-code-best
2d1ff66d9b
feat: 添加登录认证增强(workspace key、host guard、auth status)
...
- hostGuard: workspace API key 仅限 api.anthropic.com,OAuth 限定 subscription plane
- saveWorkspaceKey: sk-ant-api03- 前缀校验,安全写入缓存
- AuthPlaneSummary/WorkspaceKeyInput: 登录 UI 组件
- getAuthStatus: 认证状态查询
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:15 +08:00
claude-code-best
3114a82b89
feat: 添加 LocalMemoryRecallTool 和 VaultHttpFetchTool
...
- LocalMemoryRecallTool: 跨会话本地笔记召回,权限门控,大小限制
- VaultHttpFetchTool: 使用 vault 密钥的认证 HTTP 请求,ACL 规则
- agentToolFilter: 子 agent 工具继承过滤层
- ALL_AGENT_DISALLOWED_TOOLS 白名单更新
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:12 +08:00
claude-code-best
87f5107024
feat: 添加 Session Memory 多存储支持
...
Markdown 文件存储的本地记忆系统,支持多 store 管理、
entry 增删改查和归档,存储于 ~/.claude/local-memory/。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:09 +08:00
claude-code-best
bd054573a5
feat: 添加 Local Vault 加密存储服务
...
AES-256-GCM 加密 vault,支持 OS keychain 和加密文件回退,
scrypt KDF 密钥派生,64KB secret 上限。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:07 +08:00
claude-code-best
e6c14687f9
chore: 添加 CI 配置、codecov 和测试 mock 基础设施
...
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 23:04:04 +08:00
claude-code-best
907b8d1443
fix: 添加 React Error Boundary 防止生产环境渲染崩溃
...
增强 SentryErrorBoundary 组件,捕获渲染错误时输出诊断信息
(错误消息 + component stack)到 stderr 和终端,而非静默返回
null。在 replLauncher 根节点和 Messages 组件层级包裹 Error
Boundary,防止 Ink 内部的 Error Boundary 直接终止进程。
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 22:02:04 +08:00
林凯90331
59d3460554
Merge remote-tracking branch 'origin/feat/server-refactor' into feat/cloud-question
2026-05-09 18:18:55 +08:00
DoSun
7e04ca159b
Merge pull request #52 from Askhz/feat/serve-session-create
...
Feat/serve session create
2026-05-09 18:00:21 +08:00
Askhz
550dbb5532
feat: serve 模式支持 resume 历史会话继续对话
...
- prompt/prompt_async 接口找不到内存 session 时自动从磁盘历史恢复
- 从 transcript 读取历史 session 的原始 cwd,保证子进程在正确目录启动
- resume 时不传 --session-id 避免与 --resume 冲突(csc 限制)
- sessionManager.createSession 支持传入指定 sessionId,resume 时复用历史 id
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 17:54:25 +08:00
林凯90331
0b36424820
feat(server/question): adapt question API to opencode-compatible format
...
Refactor csc serve question endpoints to match opencode/app-ai-native
expected data models and request/response shapes:
- GET /question now returns QuestionRequest[] (direct array) instead of
{ questions: [...] }
- POST /question/:id/reply accepts { answers: string[][] } mapping to
selected option labels per question
- POST /question/:id/reject no longer requires a request body
- Support dual question sources:
- MCP Elicitation (converted to opencode format with enum→options)
- AskUserQuestionTool permissions exposed as questions
- Add conversion helpers: convertAskUserQuestionToOpencode,
convertElicitationToOpencode, buildElicitationContent
- Reply to AskUserQuestionTool via replyPermission('allow') with
constructed updatedInput.answers map
Also includes serve-mode infrastructure improvements:
- Session routes auto-create sessions on demand via getOrCreateSession
- Set CSC_SERVE_MODE env var in child process spawn
- Skip push-suggestion stream waiting in serve mode
Add comprehensive unit tests for question route opencode conversion.
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-09 17:52:43 +08:00
claude-code-best
90f861a7e1
docs: 更新 CLAUDE.md — 同步 workspace 包数量、feature flags、工具目录等变更
...
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 17:50:55 +08:00
claude-code-best
d7361457ec
fix: 提升 CLAUDE.md 指令权重 — 独立 project-instructions + deferred tools 位置调整
...
- prependUserContext: 将 claudeMd 从通用 <system-reminder> 提取为独立的
<project-instructions> 用户消息,不带免责声明,置于消息列表最前面
- queryModel: deferred tools 消息从 prepend 改为 append,避免抢占
project-instructions 的最高权重位置;标签规范化为 <system-reminder>
Co-Authored-By: glm-5-turbo <zai-org@claude-code-best.win>
2026-05-09 17:50:15 +08:00
Askhz
f34325f60a
feat: 修复 serve 模式新建会话及消息读取问题
...
- tsconfig.json 加 baseUrl 修复 dev 模式子进程 src/* 路径别名解析
- waitReady/initReject 修复:子进程退出时正确 reject,避免永久 pending
- POST /session 等待子进程 ready 后再返回,避免立即发 prompt 崩溃
- transcriptReader pathCache 不缓存 null,文件未写入时下次可重新查找
- session/status 用 prompting 判断 busy/idle,prompt 结束后正确变为 idle
- /agent 接口补充默认 build 模式
- message.ts 使用 spawnCwd 定位 transcript 文件
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 17:35:05 +08:00