linkai0924
96913f7ead
Merge pull request #100 from y574444354/feat/binary-archive
...
fix(workflow): correct download-artifact action SHA
2026-05-15 10:29:17 +08:00
林凯90331
a7bc970ece
fix(workflow): correct download-artifact action SHA
...
Use the proper commit SHA for actions/download-artifact@v4.
The previous SHA belonged to actions/upload-artifact, causing resolution failure.
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 10:25:04 +08:00
linkai0924
f328d69963
Merge pull request #99 from y574444354/feat/binary-archive
...
ci: add publish binary workflow
2026-05-15 10:20:32 +08:00
linkai0924
c207681816
Merge pull request #98 from y574444354/fix/centos-input
...
fix(ink): handle enter key on centos
2026-05-15 10:19:59 +08:00
林凯90331
beb268eca0
fix(ink): handle enter key on centos
...
Some terminals on CentOS emit 'enter' instead of 'return' for the Enter key.
Treat both names as the Return key to ensure consistent input behavior across platforms.
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 10:17:22 +08:00
林凯90331
332469c4e9
ci: add publish binary workflow
...
Add workflow_dispatch workflow for building and publishing cross-platform binaries.
Supports selecting branch/tag and target platform (all or specific).
Windows artifacts are zipped, Linux/macOS are tar.gz.
When triggered by a tag, artifacts are attached to the GitHub Release.
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-15 10:08:27 +08:00
github-actions[bot]
34903c97e8
chore(release): bump version to 4.0.23
2026-05-14 13:40:24 +00:00
linkai0924
19a6ed1c1d
Merge pull request #97 from y574444354/fix/compile-issue-0514-2
...
ci(publish-npm): pin bun version, add vite build, and ignore scripts
2026-05-14 21:39:28 +08:00
林凯90331
1e10473fb7
ci(publish-npm): pin bun version, add vite build, and ignore scripts on publish
...
Pin bun to 1.3.11 for reproducible builds. Add explicit vite build step before publishing. Add --ignore-scripts to npm publish for security.
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-14 21:37:15 +08:00
github-actions[bot]
49808bb967
chore(release): bump version to 4.0.22
2026-05-14 12:54:58 +00:00
linkai0924
4703b608a8
Merge pull request #96 from y574444354/fix/compile-issue-0514
...
fix(utils): replace using syntax with withDisposable for node v20 compatibility
2026-05-14 20:51:55 +08:00
林凯90331
f7a405f703
fix(utils): replace using syntax with withDisposable for node v20 compatibility
...
Node.js v20 does not support the syntax. Replace all patterns with a new helper that wraps the operation in try/finally and explicitly calls Symbol.dispose.
Also rename listBuiltinSkillNames to listBuiltinSkills in generate-review-builtin.ts.
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-14 20:48:37 +08:00
DoSun
0fb2ea4af5
fix: 修正 listBuiltinSkills 导入名称
...
Co-Authored-By: Auto <noreply@anthropic.com>
2026-05-14 20:05:48 +08:00
DoSun
f5d6814a01
feat: 恢复 cloud 子命令注册
...
从 feat/server-refactor 分支还原 cloud 命令的 CLI 注册逻辑,
动态导入 cloudHandler 并透传所有参数给 cs-cloud 二进制。
Co-Authored-By: Auto <noreply@anthropic.com>
2026-05-14 19:59:02 +08:00
github-actions[bot]
876dc94ed5
chore(release): bump version to 4.0.21
2026-05-14 11:25:31 +00:00
DoSun
f100568b46
Merge pull request #85 from y574444354/fix/serve-command-real-impl
...
fix: 替换假 server 命令为真实 serve 实现
2026-05-14 19:14:53 +08:00
DoSun
62de2ddc20
Merge pull request #95 from y574444354/feat/server-refactor
...
Feat/server refactor
2026-05-14 19:14:34 +08:00
IronRookieCoder
7512672684
Merge branch 'y574444354:main' into main
2026-05-14 19:11:06 +08:00
linkai0924
1c22fe8d2a
Merge pull request #94 from y574444354/feat/server-refactor-90331-2
...
feat(favorite): optimize list caching and expand MCP type support
2026-05-14 19:09:36 +08:00
林凯90331
fd36738e9e
feat(favorite): optimize list caching and expand MCP type support
...
Add 30s in-memory cache for favorite item list to reduce API calls
Expand supported MCP server types beyond local/remote to stdio/sse/ws/sdk and more
Change single MCP server conversion to use stdio type with separate command/args/env fields
Reduce page size from 100 to 20 for faster initial load
Switch parallel remote fetching to sequential to avoid rate limiting
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-14 18:56:44 +08:00
linkai0924
8b4d990489
Merge pull request #93 from y574444354/feat/workflow
...
ci(publish-npm): add debug output and fault tolerance to version bump…
2026-05-14 18:38:42 +08:00
林凯90331
6a55dcb38e
ci(publish-npm): add debug output and fault tolerance to version bump step
...
Add git status and git diff for debugging visibility during release.
Change git add to -A and append || true to commit/push to prevent workflow failures when there are no changes or push issues.
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-14 18:36:52 +08:00
linkai0924
a41232d294
Merge pull request #92 from y574444354/feat/workflow
...
fix(ci): recreate tag if it points to old commit
2026-05-14 18:18:08 +08:00
林凯90331
ca59e79568
fix(ci): recreate tag if it points to old commit
...
Add verification output after syncing package.json and defines.ts
so the logs clearly show whether the version bump succeeded.
Also replace 'Create tag if missing' with 'Create or recreate tag'
that deletes and recreates the tag when it points to a stale commit,
preventing checkout of outdated code from previous failed runs.
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-14 18:12:31 +08:00
IronRookieCoder
b528d378db
feat(config): add showMemoryPid setting to toggle footer memory/PID display
...
## 实现要点
新增全局配置项 showMemoryPid,允许用户通过 /config 面板关闭底部状态栏的内存值和 PID 显示(默认开启,行为不变)。
## 变更要点
- src/utils/config.ts:新增 showMemoryPid?: boolean 类型声明 + GLOBAL_CONFIG_KEYS 注册
- src/components/PromptInput/PromptInputFooterLeftSide.tsx:新增 isMemoryPidEnabled() 函数,RSS/PID 渲染受配置控制
- src/components/Settings/Config.tsx:/config UI 面板注册配置项,含 logEvent 埋点
- packages/builtin-tools/src/tools/ConfigTool/supportedSettings.ts:SUPPORTED_SETTINGS 注册
2026-05-14 17:41:13 +08:00
github-actions[bot]
04aa2dc662
chore(release): bump version to 4.0.20
2026-05-14 09:37:36 +00:00
linkai0924
390540dd78
Merge pull request #90 from y574444354/feat/workflow
...
fix(ci): correct boolean condition for workflow dispatch inputs
2026-05-14 17:33:53 +08:00
林凯90331
59269f381d
fix(ci): correct boolean condition for workflow dispatch inputs
...
GitHub Actions workflow_dispatch boolean inputs are strings in
expressions ('true'/'false'). Non-empty strings are always truthy,
so !inputs.dry_run always evaluated to false. Use explicit string
comparison to fix version sync and publish step gating.
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-14 17:25:05 +08:00
linkai0924
e8349395ed
Merge pull request #88 from y574444354/feat/workflow
...
ci: add manual npm publish workflow with dry-run and auto version sync
2026-05-14 17:18:38 +08:00
林凯90331
5890d776dd
ci(publish-npm): add ssh setup and review builtin generation
...
Add SSH agent setup before build so generate-review-builtin.ts
can clone the private costrict-review repo. Also run the
generator explicitly with continue-on-error to ensure the
bundled review skills file exists before Bun.build.
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-14 17:13:30 +08:00
IronRookieCoder
223b694965
fix(windows): prevent terminal startup failures
...
## Bug 详情
- issues.md #46:Windows MSYS2/UCRT64 下执行 csc,欢迎信息输出后在 stdin raw mode/终端输入初始化阶段崩溃,出现 native std::bad_weak_ptr 和后续 Bun mutex corrupt。
- issues.md #47:cmd.exe 可启动,但 PowerShell 运行 csc 会走 npm 生成的 csc.ps1;截图显示 node.exe 报错 "Input must be provided either through stdin or as a prompt argument when using --print",说明裸 csc 被误判成 print/non-interactive 模式。
## 根因
- MSYS2/Cygwin/mintty 等 Windows 终端对 Node/Bun stdin raw mode 和终端扩展控制序列兼容性不稳定,启动早期强行 setRawMode/查询终端能力会触发崩溃风险。
- npm 的 PowerShell shim 解析优先级高于 csc.cmd,且可能让 stdout TTY 状态不可用;原 main.tsx 只要 stdout 非 TTY 就自动进入 non-interactive/--print 路径,最终在没有 prompt/stdin 时触发 #47 的报错。
## 修复方案
- 为 Ink stdin raw mode 增加 Windows 风险终端检测,在 MSYS2/Cygwin/mintty 或显式禁用开关下跳过 raw mode,使用 cooked input fallback。
- early input 捕获在启动早期复用同类风险判断,避免 REPL 渲染前就触发 raw mode 崩溃。
- postinstall 在 Windows 上清理属于本包的 csc.ps1,让 PowerShell 回落到与 cmd.exe 一致的 csc.cmd 启动路径。
- 新增 non-interactive 判定工具,保留显式 -p/--print、--init-only、--sdk-url 的 headless 行为,但要求 stdin/stdout 都不是交互 TTY 才自动进入 non-interactive,避免 PowerShell shim 下裸 csc 被误判。
## 变更要点
- 新增 packages/@ant/ink/src/core/raw-mode-support.ts 及单元测试,覆盖普通 Windows shell、MSYS2/Cygwin/mintty 和禁用开关
- 调整 Ink App raw mode 生命周期,只在真正启用 raw mode 后写入/清理 bracketed paste、focus reporting、extended key 等终端控制序列
- 调整 component unmount/exit 清理逻辑,按 rawModeEnabledCount/rawModeActive 关闭实际启用的输入监听和 raw mode
- 调整 src/utils/earlyInput.ts,避免不安全 Windows 终端在启动阶段启用 stdin raw mode
- 调整 scripts/postinstall.cjs,立即和延迟清理 npm 生成的 csc.ps1 shim
- 调整 src/main.tsx 使用 shouldUseNonInteractiveSession,并新增对应测试覆盖 PowerShell shim 场景
## 自测
- bun test packages/@ant/ink/src/core/__tests__/raw-mode-support.test.ts src/utils/__tests__/earlyInput.test.ts src/utils/__tests__/nonInteractiveSession.test.ts
- node --check scripts/postinstall.cjs
- bun run src/entrypoints/cli.tsx --version
- bun run lint
- git diff --check
## 已知限制
- bun run typecheck 仍失败,错误来自仓库既有缺失声明/缺失模块和无关类型问题,不来自本次改动。
2026-05-14 17:07:51 +08:00
DoSun
481e6fc3c9
Merge remote-tracking branch 'origin/feat/server-refactor' into fix/serve-command-real-impl
2026-05-14 17:07:50 +08:00
林凯90331
86c68723a4
ci(publish-npm): drop v prefix from tags and skip tests
...
Use the exact input version for git tags without adding a v prefix.
Also comment out typecheck and test steps to speed up the publish flow.
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-14 17:07:16 +08:00
DoSun
025a4c8b34
Merge pull request #87 from Askhz/fix/serve-feature-flag-crash
...
fix: 编译后二进制 serve 子进程 crash 报 unknown option --feature
2026-05-14 17:05:29 +08:00
Askhz
4b7922d59b
fix: 更新凭证路径注释为 ~/.costrict/share/auth.json
...
Co-Authored-By: CoStrict-DeepSeek-V4-Pro <deepseek-ai@claude-code-best.win>
2026-05-14 17:03:12 +08:00
Askhz
195c23dbb2
fix: 编译后二进制 serve 子进程 crash 报 unknown option --feature
...
getScriptArgsForChild() 无法正确识别编译后的二进制:argv[1] 仍为原始入口
路径(如 src/entrypoints/cli.tsx),被误判为脚本模式,导致 saveChildSpawnPrefix()
生成 --feature Bun 专有参数传给子进程,子进程不识别直接 crash。
修复:在所有判断之前增加 execPath basename 检查,非 bun/node 的可执行文件
直接视为编译二进制,返回空数组。
Co-Authored-By: CoStrict-DeepSeek-V4-Pro <deepseek-ai@claude-code-best.win>
2026-05-14 17:00:43 +08:00
林凯90331
a23ebc0303
ci(publish-npm): restrict to manual trigger and auto-sync version
...
Remove push tag trigger so the workflow only runs on manual dispatch.
Add steps to automatically sync package.json and scripts/defines.ts
version before publishing, create the git tag, and skip typecheck.
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-14 16:57:09 +08:00
林凯90331
de53813db3
ci(publish-npm): auto-create missing tag on manual dispatch
...
When triggering the publish workflow manually with a version that does
not yet have a corresponding git tag, automatically create and push
the v-prefixed tag on the current HEAD instead of failing.
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-14 16:37:35 +08:00
林凯90331
5de3460884
ci(publish-npm): add dry-run support and normalize version input
...
Add optional dry-run flag to workflow dispatch for validating publishes
without uploading to the registry.
Support version inputs with or without the v prefix by resolving
the correct git ref automatically. Skip changelog generation and
GitHub release creation when running in dry-run mode.
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
2026-05-14 16:33:03 +08:00
xixingde
5a306c3ea7
feat(auth): update OAuth flow message to reference Costrict branding
2026-05-14 16:28:24 +08:00
xixingde
25ea4a0cf3
feat(auth): add remote API control config to gate third-party providers
2026-05-14 16:03:04 +08:00
IronRookieCoder
a8c8c533d0
fix(builtin-tools): handle undefined message_ids in SnipTool.call()
...
## Bug 详情
调用 Snip 工具时,若模型通过 ExecuteExtraTool 传入空 params,
SnipTool.call() 中访问 input.message_ids.length 会抛出
`Cannot read properties of undefined (reading 'length')`。
## 根因
Snip 是延迟工具(非 CORE_TOOLS),需通过 ExecuteExtraTool 间接调用。
ExecuteExtraTool 将 params 直接透传给目标工具,不做 Zod schema 验证。
当 params 为空对象 {} 时,input.message_ids 为 undefined。
## 修复方案
在 SnipTool.call() 中使用 optional chaining 安全访问 message_ids。
## 变更要点
- packages/builtin-tools/src/tools/SnipTool/SnipTool.ts: 防御性处理空 message_ids
- src/costrict/provider/auth.ts: 删除 unreachable continue(lint 自动修复)
- src/services/rawDump/worker.ts: Math.pow → **(lint 自动修复)
## 自测
- 已人工验证
Co-Authored-By: Auto <noreply@anthropic.com>
2026-05-14 15:47:35 +08:00
DoSun
b11826c21c
fix: 替换 main 分支的假 server 命令为真实 serve 实现
...
- 移除 DangerousBackend、lockfile、createServerLogger 等不存在的 import
- 使用 EventBus + SessionManager + startServer 真实实现
- 添加 serve 子命令作为 server 的别名
- 默认 host 改为 127.0.0.1,idle-timeout 改为 1800000ms
- 启动 probe session 并正确处理 SIGINT/SIGTERM 关闭
2026-05-14 15:36:27 +08:00
DoSun
cbc948b044
Merge branch 'feat/server-refactor'
...
# Conflicts:
# build.ts
# src/main.tsx
# src/services/rawDump/worker.ts
2026-05-14 15:21:25 +08:00
DoSun
fd509086f3
fix: serve 模式下权限事件被 shouldAvoidPermissionPrompts 吞没导致直接拒绝
...
- 当 --permission-prompt-tool 指定时不设置 shouldAvoidPermissionPrompts,允许 can_use_tool 控制消息正常发出
- serve 默认权限模式从 acceptEdits 改为 default,确保权限检查链路完整
2026-05-14 15:04:17 +08:00
IronRookieCoder
28f2e3a6ac
fix(agent-team): handle idle teammate coordination failures
...
## Bug 详情
Agent Team 在 CoStrict 环境下可能出现子代理无法执行、完成后主代理持续 Idle、shutdown 后 TeamDelete 被阻塞,以及 TeamCreate 参数错误时抛出 name.replace 深层异常。
## 根因
- Team teammate 默认模型路径未复用普通 subagent 的 CoStrict 继承逻辑,未配置 teammateDefaultModel 时会回退到 CoStrict 不可用的 claude-opus-4-6。
- in-process teammate 的 AsyncLocalStorage 上下文可能影响 team lead 的 inbox polling 身份判断。
- SendMessage 收到字符串形式的 shutdown_response JSON 时按普通消息转发,未进入 shutdown approval 分支。
- ExecuteExtraTool 调用 deferred tool 前未执行目标工具 validateInput,错误参数会绕过入口校验进入目标工具内部。
## 修复方案
- 将 teammate 模型解析集中到 teammateModel,并在 CoStrict 默认场景继承 leader model。
- 抽出 inbox poller 身份判断,基于 AppState 识别 team lead polling。
- 兼容字符串 JSON 协议响应,将 shutdown_response / plan_approval_response 路由到结构化处理逻辑。
- ExecuteExtraTool 在权限检查和实际执行前调用目标工具 validateInput。
## 变更要点
- 新增 teammate 模型解析和 CoStrict 继承测试。
- 新增 inbox poller identity helper 和 in-process 上下文回归测试。
- 新增 SendMessage 字符串 shutdown_response 回归测试。
- 新增 ExecuteExtraTool 目标工具校验回归测试。
## 自测
- bun test packages/builtin-tools/src/tools/ExecuteTool/__tests__/ExecuteTool.test.ts
- bun test packages/builtin-tools/src/tools/SendMessageTool/__tests__/udsRecipientSanitization.test.ts src/utils/swarm/__tests__/teammateModel.test.ts src/hooks/__tests__/useInboxPoller.test.ts
- bunx biome check 相关变更文件
- 变更文件相关 tsc 过滤检查无输出
2026-05-14 14:50:30 +08:00
IronRookieCoder
95a4430fa2
Revert "fix(bash): wake foreground task after auto-backgrounding"
...
This reverts commit 1a85db7ca8 .
2026-05-14 13:33:00 +08:00
IronRookieCoder
54bc918970
Merge branch 'y574444354:main' into main
2026-05-14 13:24:33 +08:00
IronRookieCoder
1a85db7ca8
fix(bash): wake foreground task after auto-backgrounding
...
## Bug 详情
用户升级 4.0.16 后,使用过程中 CLI 会话可能一直处于 busy 状态,表现为无法继续输入且没有响应。
## 根因
BashTool 的长命令在已经注册为 foreground task 后被自动后台化时,只设置了 backgroundShellId,但没有唤醒正在等待 progress/result 的 generator。若命令无输出或轮询没有再次触发,主 REPL 会继续等待,输入循环无法释放。
## 修复方案
在 foreground task 自动后台化成功后,立即 resolve 当前 progress 等待器,让 runShellCommand 能观察到 backgroundShellId 并返回后台任务结果。
## 变更要点
- 在 BashTool foreground auto-background 路径补齐 resolveProgress 唤醒逻辑
- 保持已有 spawnBackgroundTask 路径的唤醒行为一致
## 自测
- bun test packages/builtin-tools/src/tools/BashTool/__tests__ 通过
- bun run typecheck 当前仍有仓库既有无关错误,未涉及本次变更
2026-05-14 13:21:58 +08:00
IronRookieCoder
bec72babd8
fix(cursor): handle ANSI wrapped line offset recovery
...
## Bug 详情
issues.md #41 记录 ctrl+g 编辑长文本后偶现 TextInput 渲染报错,堆栈指向 MeasuredText.measureWrappedText 抛出 Failed to find wrapped line in text,导致输入组件崩溃并影响 ctrl+c 退出。
## 根因
measureWrappedText 依赖 wrapAnsi 输出的 wrapped line 通过 indexOf 反查原文偏移。wrapAnsi 在视觉换行处可能插入 ANSI reset/reopen 或 OSC 控制序列,使 wrapped line 不再是原文的字面切片,反查失败后直接抛错。
## 修复方案
保留原有 indexOf 快路径;当 wrapped line 无法字面匹配时,按原文顺序和显示宽度恢复 start/end offset,并在显示宽度与字符串 offset 的双向转换中跳过 ANSI/OSC 控制序列,避免光标定位落入控制序列内部。
## 变更要点
- 为 MeasuredText 增加 wrapped line fallback offset 恢复逻辑
- 增加 ANSI/OSC 控制序列识别与跳过逻辑
- 修正包含控制序列文本的 display width 与 string offset 双向转换
- 补充 ANSI reset 和 OSC 长文本换行回归测试
## 自测
- bun test src/utils/__tests__/Cursor.test.ts
- bunx biome lint src/utils/Cursor.ts src/utils/__tests__/Cursor.test.ts
- 手动验证 ANSI/OSC 边界 smoke 通过
Refs: #41
2026-05-14 13:11:05 +08:00