Skip to content

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

Merged
claude-code-best merged 4 commits intomainfrom
types/fix-some-bugs
Apr 15, 2026
Merged

fix: 修复类型问题(#267)#271
claude-code-best merged 4 commits intomainfrom
types/fix-some-bugs

Conversation

@claude-code-best
Copy link
Copy Markdown
Owner

@claude-code-best claude-code-best commented Apr 15, 2026

Summary by CodeRabbit

  • New Features

    • Added typecheck npm script for TypeScript validation.
    • Added window-target screenshot capture capability to the API.
  • Bug Fixes

    • Improved Node.js compatibility by removing Bun-specific runtime polyfills and replacing them with native alternatives.
  • Chores

    • Consolidated TypeScript configuration across all packages using a shared base configuration.
    • Bumped version to 1.3.7.
    • Updated dependencies including @types/bun and added @types/node.

@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 15, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ccb-863780bf 🟢 Ready View Preview Apr 15, 2026, 2:52 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request standardizes TypeScript configuration across packages, migrates Bun-specific APIs to Node.js alternatives for better compatibility, adds type safety through non-null assertions in route handlers, and introduces new screenshot capture method stubs to platform backends.

Changes

Cohort / File(s) Summary
TypeScript Configuration
tsconfig.base.json, tsconfig.json, packages/**/tsconfig.json
Added centralized tsconfig.base.json with shared compiler options (ESNext, strict mode, React JSX), refactored root tsconfig.json to extend base config and broadened include glob to all packages, and added package-specific tsconfig.json files across ~15 packages.
Build System & Package Configuration
build.ts, package.json, CLAUDE.md
Updated build post-processing to patch Bun destructuring in bundled code; removed old Bun polyfill generation; bumped version to 1.3.7; added typecheck npm script; updated @types/bun and added @types/node dependencies; documented new typecheck step in CLI workflow.
macOS Backend Migration
packages/@ant/computer-use-input/src/backends/darwin.ts
Replaced Bun $ template execution with Node.js child_process (execFile, execFileSync, promisify) for osascript and jxa invocations, maintaining same function signatures and behavior.
Screenshot API Extension
packages/@ant/computer-use-swift/src/types.ts, packages/@ant/computer-use-swift/src/backends/darwin.ts, packages/@ant/computer-use-swift/src/backends/linux.ts
Added `captureWindowTarget(titleOrHwnd: string
Route Handler Type Safety
packages/remote-control-server/src/routes/v1/*.ts, packages/remote-control-server/src/routes/v2/*.ts, packages/remote-control-server/src/routes/web/*.ts
Applied non-null assertions (!) to route parameters (c.req.param("id"), c.req.param("workId")) and context values (c.get("uuid")) across ~10 route handlers to eliminate undefined typing from path and context variables.
Test Updates
packages/agent-tools/src/__tests__/compat.test.ts, packages/mcp-client/src/__tests__/*.test.ts, packages/color-diff-napi/src/__tests__/*.test.ts, packages/remote-control-server/src/__tests__/*.test.ts
Updated type casts in compatibility tests (as unknown as CoreTool), added parameters to tool method calls (isReadOnly, description), and adjusted test setup (empty session creation object).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

v6

Poem

🐰 TypeScript bundles gather tight,
Bun gives way to Node's light,
Non-null assertions mark the way,
Cross-platform screenshots here to stay! 📸

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title 'fix: 修复类型问题(#267)' is vague and uses non-descriptive language. While it mentions 'types' (类型问题), it doesn't convey the specific nature of the changes, which include TypeScript config consolidation, Bun destructuring patches, Node.js compatibility fixes, and API additions. Provide a more specific title that captures the main technical change, such as 'fix: consolidate TypeScript configuration and fix Bun/Node.js compatibility' or 'fix: add tsconfig.base.json and update package TypeScript configs'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch types/fix-some-bugs

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude-code-best claude-code-best merged commit 1a4e970 into main Apr 15, 2026
7 of 8 checks passed
y574444354 added a commit to y574444354/csc that referenced this pull request Apr 15, 2026
同步上游 4 个新提交:
- fix: 修复类型问题(claude-code-best#267) (claude-code-best#271)
- docs: 修复链接
- fix: 修复 node 下 ws 没打包问题
- fix: 修复 n 快捷键导致关闭的问题

冲突解决:
- README.md: 保留上游特性表格 + 保留 fork 品牌内容
- package.json: 保留 @costrict/csc 名称和版本,接纳上游 typecheck 脚本
@coderabbitai coderabbitai bot mentioned this pull request Apr 16, 2026
@claude-code-best claude-code-best deleted the types/fix-some-bugs branch April 16, 2026 02:51
y574444354 pushed a commit to y574444354/csc that referenced this pull request Apr 16, 2026
* fix: 修复 Bun 的 polyfill 问题

* fix: 类型修复完成

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

* fix: 修复构建问题
y574444354 pushed a commit to y574444354/csc that referenced this pull request Apr 16, 2026
* fix: 修复 Bun 的 polyfill 问题

* fix: 类型修复完成

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

* fix: 修复构建问题
claude-code-best added a commit that referenced this pull request Apr 16, 2026
* fix: 修复 Bun 的 polyfill 问题

* fix: 类型修复完成

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

* fix: 修复构建问题
claude-code-best added a commit that referenced this pull request Apr 17, 2026
* 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 e458d63.

* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant