Files
cindy/package.json
Dash 2080c69f53 feat(i18n): 建立术语表体系,统一 19 个产品术语
此前 i18n 只有 key 结构门禁(check-i18n.mjs),没有任何术语一致性保障。实测
162 个英文短语存在多种中文译法,反向 227 条:同一个 scheduler 面板里字段叫
「提示词」、它的校验报错叫「Prompt」;issueTracker 列表按钮写「新建议题」、
点进去页面标题写「新建工单」;中文「额度」同时对应 Balance / Credits / Quota
三个英文概念。

- i18n/glossary.json 为唯一事实源,i18n/GLOSSARY.md 自动生成供人和 agent 查阅
- status 双档:decided 阻断 CI,proposed 只告警,让未拍板的术语可见可讨论
- alsoAllowed 场景化译法:同一个词按语境有不同说法,每条必须写明 when
  (Automation 作模块名是「自动化」,指单条实例是「自动任务」,Computer Use
  语境是「自动操作」)
- checkCase 开关:Issue 这类同时是常用英语单词的术语关闭大小写检查,否则
  prompt 模板里的 "fix the issue" 会被误判
- glossary-baseline.json 冻结 565 条存量,只减不增;已修复却仍挂账会报错

- 新增 check:i18n-glossary(禁用译法 / 大小写形态 / zh-CN 标点 / 文档同步)
- check:i18n 与 check:brand-terminology 此前写好却从未在 CI 跑过,一并挂上
- scripts/shared/glossary-rules.mjs 抽出纯规则函数,26 个单测钉住边界

规则边界由现状数据定,不靠直觉:ja 实测半角冒号 124:78 才是主流(日文 UI
惯例),因此全角标点规则只对 zh-CN 生效。

Session / Chat / Thread 统一为「对话」(440 + 22 + 3 处);「代理」整体废弃,
Agent / Subagent / Proxy 均保留英文;Issue 保留英文(工单 32 + 议题 4);
Credits / Quota / Balance 拆为「点数 / 配额 / 余额」,「额度」退出;
Effort 定为「推理强度」——同类工具 i18n 中断层第一,且跨 provider 中立。

同形异义按 exempt 精确豁免,不做机械替换:ssh-agent 非产品 Agent;SSO 的
「身份提供方」非「模型供应商」;登录态与 WebSocket 语音连接的 session 非产品
「对话」。

6 个直接断言中文文案的测试同步更新期望值——它们是有意的文案锁,其中
mobileCindyVoiceSession.test.ts 正是靠断言抓出了漏网的「语音识别会话」。

验证:pnpm test:unit 全量通过;五个 guard 全 PASS;mobile typecheck 干净。
desktop typecheck 的 2 条错误为 origin/main 既有基线问题(main CI 同样为红),
与本次改动无关,未在本 commit 内修复。

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

Signed-off-by: Dash <dashhuang@gmail.com>
2026-07-25 16:25:18 +12:00

125 lines
6.5 KiB
JSON

{
"name": "cindy",
"private": true,
"description": "Cindy open-source client monorepo — desktop, mobile, and shared packages",
"license": "Apache-2.0",
"author": {
"name": "X.D. Network Inc.",
"email": "feedback@cindy.app"
},
"homepage": "https://cindy.app",
"repository": {
"type": "git",
"url": "git+https://github.com/makecindy/cindy.git"
},
"bugs": {
"url": "https://github.com/makecindy/cindy/issues"
},
"engines": {
"node": ">=22",
"pnpm": ">=10.7 <11"
},
"packageManager": "pnpm@10.33.2+sha512.a90faf6feeab71ad6c6e57f94e0fe1a12f5dcc22cd754db40ae9593eb6a3e0b6b12e3540218bb37ae083404b1f2ce6db2a4121e979829b4aff94b99f49da1cf8",
"pnpm": {
"onlyBuiltDependencies": [
"@parcel/watcher",
"better-sqlite3",
"electron",
"electron-winstaller",
"esbuild",
"node-pty",
"sharp"
],
"supportedArchitectures": {
"os": [
"win32",
"darwin",
"linux"
],
"cpu": [
"x64",
"arm64"
],
"libc": [
"glibc"
]
},
"overrides": {
"@electron/rebuild": "^4.0.3",
"protobufjs": "7.6.5",
"tar": "^7.5.19",
"js-yaml@^4.0.0": "^4.3.0",
"zod": "4.3.6",
"tmp": "^0.2.7",
"fast-uri": "^3.1.4",
"sharp": "^0.35.0"
},
"patchedDependencies": {
"harmonyos-sans-sc-webfont-splitted": "dependency-patches/harmonyos-sans-sc-webfont-splitted.patch",
"react-native@0.85.3": "dependency-patches/react-native@0.85.3.patch",
"react-native-uitextview@2.2.0": "dependency-patches/react-native-uitextview@2.2.0.patch",
"react-native-webview@13.16.1": "dependency-patches/react-native-webview@13.16.1.patch",
"expo-paste-input@0.2.2": "dependency-patches/expo-paste-input@0.2.2.patch"
},
"allowUnusedPatches": true
},
"scripts": {
"h": "node scripts/help.mjs",
"mobile:xcode": "node apps/mobile/scripts/open-ios-xcode.mjs",
"mobile:sim:rebuild": "node scripts/ensure-deps.mjs --workspace-only && node apps/mobile/scripts/sim-rebuild.mjs",
"mobile:sim:start": "node scripts/ensure-deps.mjs --workspace-only && node apps/mobile/scripts/sim-start.mjs",
"mobile:sim:whoami": "node scripts/ensure-deps.mjs --workspace-only && node apps/mobile/scripts/sim-whoami.mjs",
"mobile:release:check": "node apps/mobile/scripts/release-with-env.mjs check",
"mobile:release:prod": "node apps/mobile/scripts/release-with-env.mjs prod",
"mobile:build:ios": "node apps/mobile/scripts/build-ios.mjs",
"mobile:build:android": "node apps/mobile/scripts/build-android.mjs",
"ensure-deps": "node scripts/ensure-deps.mjs",
"sync:browser-runtime": "node scripts/browser-runtime/sync.mjs",
"repo:worktrees": "node scripts/repo-worktrees.mjs",
"update:claude": "node tools/claude/update.mjs",
"update:codex": "node tools/codex/update.mjs",
"update:ripgrep": "node tools/ripgrep/update.mjs",
"update:vendors": "node tools/claude/update.mjs && node tools/codex/update.mjs && node tools/ripgrep/update.mjs",
"install:claude": "node scripts/ensure-agent-binaries.mjs --kinds=claude",
"install:codex": "node scripts/ensure-agent-binaries.mjs --kinds=codex",
"install:ripgrep": "node scripts/ensure-agent-binaries.mjs --kinds=ripgrep",
"install:agent-binaries": "node scripts/ensure-agent-binaries.mjs",
"postinstall": "node scripts/ensure-agent-binaries.mjs --best-effort && node scripts/fix-node-pty-perms.mjs",
"dev:desktop": "node scripts/ensure-deps.mjs && node scripts/ensure-dev-runtime-assets.mjs && pnpm --filter desktop dev",
"dev:desktop:remote": "node scripts/ensure-deps.mjs && node scripts/ensure-dev-runtime-assets.mjs && pnpm --filter desktop dev:remote",
"restart:desktop:remote": "node scripts/desktop-restart-runner.mjs --wait-ready",
"restart:desktop:local": "node scripts/desktop-restart-runner.mjs --local --wait-ready",
"desktop:whoami": "node scripts/desktop-whoami.mjs",
"dev:desktop:inspect": "node scripts/ensure-deps.mjs && node scripts/ensure-dev-runtime-assets.mjs && pnpm --filter desktop dev:inspect",
"benchmark:voice-input": "node scripts/voice-input-benchmark.mjs",
"benchmark:browser": "node --import tsx scripts/browser-capability-benchmark.mjs",
"dev:embed:search": "node scripts/dev-embed-search.mjs",
"build": "node scripts/ensure-deps.mjs && pnpm --filter desktop build",
"release:package": "node scripts/ensure-deps.mjs && node apps/desktop/scripts/package-desktop.mjs",
"check:i18n": "node scripts/check-i18n.mjs",
"check:i18n-glossary": "node scripts/check-i18n-glossary.mjs",
"check:i18n-glossary:report": "node scripts/check-i18n-glossary.mjs --report",
"i18n:glossary-doc": "node scripts/generate-glossary-doc.mjs",
"check:brand-terminology": "node scripts/brand-terminology-guard.mjs",
"check:endpoints": "node scripts/check-endpoint-literals.mjs",
"check:dev-docs": "node --test scripts/__tests__/dev-docs-contract.test.mjs",
"licenses:generate": "node scripts/generate-third-party-notices.mjs",
"lint": "pnpm -r lint",
"format": "pnpm -r format",
"test:runner": "node --test scripts/__tests__/test-workspaces.test.mjs scripts/__tests__/dev-docs-contract.test.mjs scripts/__tests__/restart-desktop-remote.test.mjs scripts/__tests__/dev-migration-policy.test.mjs scripts/__tests__/ensure-deps.test.mjs scripts/__tests__/client-endpoint-build-env.test.mjs scripts/__tests__/endpoint-consistency.test.mjs scripts/__tests__/endpoint-local-file.test.mjs scripts/__tests__/ensure-agent-binaries.test.mjs scripts/__tests__/fetch-with-timeout.test.mjs scripts/__tests__/agent-binary-cdn-fallback.test.mjs scripts/__tests__/ensure-binary-fallback.test.mjs scripts/__tests__/verify-sha256.test.mjs scripts/__tests__/migration-freeze.test.mjs scripts/__tests__/third-party-notices.test.mjs scripts/__tests__/brand-identity-sync.test.mjs scripts/__tests__/glossary-rules.test.mjs",
"test:unit": "pnpm test:runner && node scripts/test-workspaces.mjs --tier unit",
"test:all": "pnpm test:runner && node scripts/test-workspaces.mjs --all",
"test:db": "pnpm test:runner && node scripts/test-workspaces.mjs --tier db",
"test:guard": "node scripts/test-workspaces.mjs --tier guard",
"ci:scheduler-guard": "node scripts/scheduler-ci-guard.mjs",
"pctx": "node packages/project-context/dist/cli.js",
"pctx:build": "pnpm --filter project-context build"
},
"dependencies": {
"gray-matter": "^4.0.3"
},
"devDependencies": {
"spdx-expression-parse": "3.0.1"
}
}