Commit Graph

319 Commits

Author SHA1 Message Date
y574444354
7806df4e3d Merge branch 'main' of https://github.com/y574444354/csc 2026-04-23 10:30:28 +08:00
Askhz
772739c6c9 fix: 在 CoStrict provider 下侧查询统一使用主循环模型
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-22 16:09:58 +08:00
Askhz
98c9f219f7 fix: pass through user-configured model name instead of overriding with first API model
CoStrict provider now directly passes the user's configured model name
to the API, instead of replacing it with the first model from the
/ai-gateway/api/v1/models list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-22 15:48:15 +08:00
yhf
3e8a82d01c
Merge pull request #36 from Askhz/fix/model-chat
fix: restrict ANTHROPIC_MODEL to anthropic-compatible providers in model picker
2026-04-22 11:39:13 +08:00
Askhz
c1b7bbc2d3 fix: restrict ANTHROPIC_MODEL to anthropic-compatible providers in model picker
- Only show ANTHROPIC_MODEL env var model for firstParty/bedrock/vertex/foundry
- Do not leak it into OpenAI/Gemini/Grok/CoStrict pickers
- Remove settings.model from custom model options

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-22 11:17:28 +08:00
yhf
2393020e62
Merge pull request #35 from Askhz/chore/change-logo
chore: change logo
2026-04-22 09:40:53 +08:00
yhf
f9378fc7d1
Merge pull request #34 from Askhz/fix/model-chat
fix: handle reasoning_content for thinking mode in OpenAI compatibility layer
2026-04-22 09:40:16 +08:00
yhangf
5197e2d7cb refactor(cli): rename command references from 'claude --resume' to 'csc --resume' 2026-04-22 09:34:58 +08:00
Askhz
3f7fa33aa1 fix: not login can not show model 2026-04-21 21:08:44 +08:00
yhangf
bd150468b0 chore(branding): replace Claude/Anthropic references with CoStrict in UI strings 2026-04-21 20:13:14 +08:00
Askhz
7ad764b5a4 chore: update changelog URL to y574444354/csc repository
- Changed CHANGELOG_URL and RAW_CHANGELOG_URL to point to y574444354/csc
- Updated both GitHub page and raw content URLs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 19:38:55 +08:00
Askhz
3afc49eb82 chore: change terminalTitle 2026-04-21 17:39:53 +08:00
Askhz
c28cd05d89 fix: handle reasoning_content for thinking mode in OpenAI compatibility layer
- Add reasoning_content field when thinking mode is enabled
- Set reasoning_content to empty string when no thinking content available
- Enable model auto-detection for kimi provider
- Add thinking mode support to costrict provider
2026-04-21 15:48:22 +08:00
y574444354
38a604e60e chore: comment out --allow-dangerously-skip-permissions option 2026-04-21 14:35:25 +08:00
geroge
83beec0b5e
Merge pull request #33 from Askhz/refactor/login-logic
refactor: 精简登录选项,保留 4 个主要登录方式
2026-04-21 09:39:06 +08:00
Askhz
7b5e1f382d feat: auto-set default model when switching provider
- Add setDefaultModel() in provider.ts to set sonnet as default when using /provider command
- Add model setting in ConsoleOAuthFlow.tsx for all provider save paths:
  - Anthropic OAuth login
  - Custom platform (Anthropic Compatible)
  - OpenAI
  - Gemini
- Fix modelOptions.ts to only show CoStrict models when provider IS costrict (not when creds exist)
- Add standard model options for non-costrict providers (Sonnet/Opus/Haiku)
2026-04-20 21:22:29 +08:00
Askhz
425ca6bb19 feat: cleanup CLAUDE_CODE_USE_COSTRICT env var after provider switch
- Remove env var in provider.ts unset/anthropic/openai/gemini/grok handlers
- Remove env var after OAuth login and model save success in ConsoleOAuthFlow
- Fix modelOptions.ts to only show CoStrict models when provider IS costrict
- Remove unused hasCoStrictCredentialsSync import and getCoStrictLoginOption
2026-04-20 21:08:25 +08:00
Askhz
d7bcf65968 feat: restore CoStrict login option in interactive login
- Added CoStrict option to the login Select component
- Implemented complete OAuth flow with browser opening and token polling
- Added costrict_waiting and costrict_model_select OAuth states
- Fixed TypeScript errors in fetch.ts and index.ts

The CoStrict login option was previously removed during login simplification.
This commit restores the full functionality including model selection after login.
2026-04-20 20:40:59 +08:00
yhangf
45575c4b18 Merge branch 'main' into dev 2026-04-20 20:09:58 +08:00
Askhz
662fda48f9 Merge branch 'main' into refactor/login-logic
# Conflicts:
#	src/components/ConsoleOAuthFlow.tsx
2026-04-20 20:04:05 +08:00
y574444354
ddb776cd5f refactor: 优化 Windows TTY 处理和代码风格统一
- scripts/dev.ts: 添加 CLAUDE_CODE_FORCE_INTERACTIVE 环境变量处理,优化 Windows 嵌套 Bun 启动时的交互模式检测
- cli.tsx: 统一代码风格(分号、引号),添加 ref/unref/setRawMode polyfill 以支持 Windows 环境
- model.ts: 优化模型选择逻辑,仅对 Anthropic 相关 provider 使用 ANTHROPIC_MODEL 环境变量
- sideQuery.ts: 更新导入路径,使用 @ant/model-provider 包
- README.md: 添加分隔线
2026-04-20 17:55:09 +08:00
yhangf
47b6a33ec2 refactor(skills): remove english description from strictSpec 2026-04-20 16:01:19 +08:00
Askhz
a2a3f59e1d refactor: 精简登录选项,保留 4 个主要登录方式 2026-04-20 16:00:52 +08:00
yhangf
cbf88c14ca refactor(agents): remove English description from StrictSpec whenToUse 2026-04-20 15:57:51 +08:00
yhangf
d74321180f feat(costrict): enable StrictSpec workflow and refine strict skills 2026-04-20 15:17:36 +08:00
y574444354
387029744d Merge branch 'upstream/main' into main
同步上游主仓库最新代码,包含以下更新:
- feat(remote-control): 优化 Web 展示、状态同步与桥接控制流程 (#288)
- build: CI 添加通过过滤
- fix: 解决 node 下 loading 按钮计算错误问题
- docs: 更新说明
- test: 修正 mock 的滥用情况
- fix: 修复 linux 端的安装问题
- feat: 重构供应商层次 (#286)
- Feat/integrate lint preview (#285)
- feat: 添加对 ACP 协议的支持 (#284)
- feat(langfuse): LLM generation 记录工具定义
- feat: 添加环境变量支持以覆盖 max_tokens 设置
- build: 新增 vite 构建流程
2026-04-17 17:59:48 +08:00
Cheng Zi Feng
72a2093cd6
feat(remote-control): 优化 Web 展示、状态同步与桥接控制流程 (#288)
Co-authored-by: chengzifeng <chengzifeng@meituan.com>
2026-04-17 16:21:27 +08:00
claude-code-best
ac42ce2d67 fix: 解决 node 下 loading 按钮计算错误问题 2026-04-17 10:42:40 +08:00
claude-code-best
a14b7f352b test: 修正 mock 的滥用情况 2026-04-17 10:13:09 +08:00
claude-code-best
bddd146f25
feat: 重构供应商层次 (#286)
* refactor: 创建 @anthropic-ai/model-provider 包骨架与类型定义

- 新建 workspace 包 packages/@anthropic-ai/model-provider
- 定义 ModelProviderHooks 接口(依赖注入:分析、成本、日志等)
- 定义 ClientFactories 接口(Anthropic/OpenAI/Gemini/Grok 客户端工厂)
- 搬入核心类型:Message 体系、NonNullableUsage、EMPTY_USAGE、SystemPrompt、错误常量
- 主项目 src/types/message.ts 等改为 re-export,保持向后兼容

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: 提升 OpenAI 转换器和模型映射到 model-provider 包

- 搬入 OpenAI 消息转换(convertMessages)、工具转换(convertTools)、流适配(streamAdapter)
- 搬入 OpenAI 和 Grok 模型映射(resolveOpenAIModel、resolveGrokModel)
- 主项目文件改为 thin re-export proxy

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: 搬入 Gemini 兼容层到 model-provider 包

- 搬入 Gemini 类型定义、消息转换、工具转换、流适配、模型映射
- 主项目 gemini/ 目录下文件改为 thin re-export proxy

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: 搬入 errorUtils 并迁移消费者导入到 model-provider

- 搬入 formatAPIError、extractConnectionErrorDetails 等 errorUtils
- 迁移 10 个消费者文件直接从 @anthropic-ai/model-provider 导入
- 更新 emptyUsage、sdkUtilityTypes、systemPromptType 为 re-export proxy

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: compact 模型降级为 -1 模式(Opus→Sonnet, Sonnet→Haiku)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: 添加 agent-loop 绘图

* Revert "feat: compact 模型降级为 -1 模式(Opus→Sonnet, Sonnet→Haiku)"

This reverts commit e458d6391d.

* docs: 添加简化版 agent loop

* fix: 修复 n 快捷键导致关闭的问题

* fix: 修复 node 下 ws 没打包问题

* docs: 修复链接

* test: 添加测试支持

* fix: 修复类型问题(#267) (#271)

* fix: 修复 Bun 的 polyfill 问题

* fix: 类型修复完成

* feat: 统一所有包的类型文件

* fix: 修复构建问题

* test: 修复类型校验 (#279)

* fix: 修复 Bun 的 polyfill 问题

* fix: 类型修复完成

* feat: 统一所有包的类型文件

* fix: 修复构建问题

* fix(remote-control): harden self-hosted session flows (#278)

Co-authored-by: chengzifeng <chengzifeng@meituan.com>

* docs: update contributors

* build: 新增 vite 构建流程

* feat: 添加环境变量支持以覆盖 max_tokens 设置

* feat(langfuse): LLM generation 记录工具定义

将 Anthropic 格式的工具定义转换为 Langfuse 兼容的 OpenAI 格式,
并在 generation 的 input 中以 { messages, tools } 结构传入,
以便在 Langfuse UI 中查看完整的工具定义信息。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: 添加对 ACP 协议的支持 (#284)

* feat: 适配 zed acp 协议

* docs: 完善 acp 文档

* chore: 1.4.0

* conflict: 解决冲突

* feat: 添加测试覆盖率上报

* style: 改名加移动文件夹位置

* refactor: 移动测试用例及实现

* test: 修复测试用例完成

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cheng Zi Feng <1154238323@qq.com>
Co-authored-by: chengzifeng <chengzifeng@meituan.com>
Co-authored-by: claude-code-best <272536312+claude-code-best@users.noreply.github.com>
2026-04-17 09:33:14 +08:00
claude-code-best
c8d08d235b
Feat/integrate lint preview (#285)
* feat: 适配 zed acp 协议

* docs: 完善 acp 文档

* feat: integrate feature branches + daemon/job 命令层级化 + 跨平台后台引擎

Cherry-picked from origin/lint/preview (637c908), excluding lint-only changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: correct detectMimeFromBase64 to decode raw bytes from base64

Cherry-picked from origin/lint/preview (ee36954).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: daemon 子进程 spawn 跨平台修复 + CliLaunchSpec 集中化重构

Cherry-picked from origin/lint/preview (c5f52cd), excluding lint-only formatting changes.

- 新建 src/utils/cliLaunch.ts: 集中化 CLI 子进程启动层
- 修复 --daemon-worker=kind 等号格式解析
- 修复 daemon/bg fast path 缺少 setShellIfWindows()
- 修复 checkPathExists 用 existsSync 替代 execSync('dir')
- 7 个 spawn 站点迁移到 CliLaunchSpec

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: merge tsconfig.base.json into tsconfig.json with full compiler options

The cherry-pick from 637c908 dropped jsx/strict/etc settings when removing
tsconfig.base.json. This commit restores them in a single tsconfig.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: merge tsconfig.base.json into tsconfig.json with full compiler options

The cherry-pick from 637c908 dropped jsx/strict/etc settings when removing
tsconfig.base.json. This commit restores them in a single tsconfig.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 20:59:29 +08:00
y574444354
d67b7e4010 fix: 修复 Windows nvm4w 路径下 upgrade 命令识别为 development 的问题
- doctorDiagnostic: 增加 Windows nvm4w/nodejs 路径检测
- 路径比较时统一规范化分隔符,确保跨平台匹配
- chore: bump version to 4.0.8
2026-04-16 20:38:26 +08:00
claude-code-best
3cb1e50b25
feat: 添加对 ACP 协议的支持 (#284)
* feat: 适配 zed acp 协议

* docs: 完善 acp 文档
2026-04-16 20:31:50 +08:00
y574444354
50109ff9f5 Merge branch 'pr-31' 2026-04-16 19:57:47 +08:00
y574444354
bd929f1db1 merge: 合并 main 分支,解决冲突 2026-04-16 19:53:05 +08:00
y574444354
fbeaf1395e fix: 修复 CoStrict provider 模型选择与 token 估算问题
- ConsoleOAuthFlow: 替换 ModelPicker 为直接 Select 组件,避免
  getAPIProvider() 竞态导致显示标准 Anthropic 模型列表
- modelOptions: 简化模型选项逻辑,CoStrict 凭证持有者统一走
  CoStrict 模型缓存路径,加载中显示提示而非标准模型列表
- provider/index: 回写 usage 和 stop_reason 到已 yield 的
  assistant messages,与 Anthropic 原生路径保持一致
- tokenEstimation: 非 Anthropic 原生 provider(costrict/openai/
  grok/gemini)统一使用粗略 token 估算
- 品牌文案: Claude → CoStrict 相关措辞修正
2026-04-16 19:12:01 +08:00
claude-code-best
cfab161e28 feat(langfuse): LLM generation 记录工具定义
将 Anthropic 格式的工具定义转换为 Langfuse 兼容的 OpenAI 格式,
并在 generation 的 input 中以 { messages, tools } 结构传入,
以便在 Langfuse UI 中查看完整的工具定义信息。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 15:31:18 +08:00
Askhz
13ec1d4510 chore: back fetch.ts 2026-04-16 15:29:09 +08:00
costrict
22fd08537a fix: 修复 fetch.ts preconnect 重复标识符类型错误
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 15:23:05 +08:00
Askhz
06be8bc88c fix: csc auth login 默认使用 CoStrict OAuth 登录
`csc auth login` 默认打开 CoStrict 登录页面而非 Claude OAuth 页面。
添加 --claudeai / --console 参数保留 Anthropic OAuth 作为备选。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 15:07:17 +08:00
claude-code-best
90027279e6 feat: 添加环境变量支持以覆盖 max_tokens 设置 2026-04-16 13:01:07 +08:00
claude-code-best
f166165691 fix: 修复 n 快捷键导致关闭的问题 2026-04-16 11:04:23 +08:00
xixingde
417a2ada18 Merge branch 'main' of https://github.com/y574444354/csc 2026-04-16 10:58:08 +08:00
xixingde
b58f5b72b0 feat(agents): restrict Agent tool to specific sub-agents and add allowedTools to skills 2026-04-16 10:37:38 +08:00
geroge
294289be5b
Merge pull request #29 from y574444354/feat/security-review-v2
Feat/security review v2
2026-04-16 10:17:29 +08:00
xixingde
1e1d32205d Merge branch 'dev' of https://github.com/y574444354/csc into dev 2026-04-16 09:43:10 +08:00
xixingde
48eca1f35b fix(slash-command): propagate Agent(x,y,z) allowedAgentTypes restriction to forked command context 2026-04-16 00:14:36 +08:00
xixingde
28b0ecfaf2 fix(agents): remove isMainThread flag and update agent descriptions and tool restrictions 2026-04-15 22:27:50 +08:00
y574444354
003ff2d6cd feat: 增强 Node.js 兼容性 — 扩展 Bun API polyfill 覆盖范围
- build.ts: 大幅扩展 Node.js Bun polyfill,新增 spawn、spawnSync、
  file、gc、generateHeapSnapshot、embeddedFiles、semver、YAML、
  version、stringWidth、wrapAnsi、listen 等 API 实现
- package.json: 更新描述为多模型终端 AI 编程助手,Node.js 为主要
  运行时依赖,ws/yaml 移至 dependencies,bin 入口指向 cli-node.js
- scripts/defines.ts: 版本号更新至 4.0.5.1
- fetch.ts: fetch.preconnect 添加 Node.js 降级实现(net.createConnection)
2026-04-15 18:22:44 +08:00
kingboung
1dfbf08c0e feat: 替换内置 security-review 为 CoStrict Security 版本
- 移除原版 security-review 内置命令(占位 plugin 迁移提示)
- 将 CoStrict Security skill 命令名从 strict-security-review 改为 security-review
- 更新 description 和 whenToUse 描述

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 17:09:18 +08:00