PerryLinkandPerryLink 1e2c029466 feat(agents): support Qoder CN via its .qoder-cn user directory (#695)
* feat(agents): support Qoder CN via its .qoder-cn user directory

Qoder CN keeps its user directory at ~/.qoder-cn instead of ~/.qoder, so a CN install saw none of TeamAI's synced resources and users worked around it with symlinks. Register qoder-cn as its own built-in target mirroring qoder: skills discovery, toolPaths defaults, the Claude-compatible agent/MCP formats, and the subagent render/reverse switches. Docs list the new paths.

* fix(agents): resolve Qoder CN paths by scope, not by one flat table

The first cut registered `qoder-cn` with `.qoder-cn/*` as every path, which
wrote project-scope resources into a directory Qoder CN does not read. Only the
*user* directory differs (`~/.qoder-cn`); project scope still uses `.qoder/`.
`scopedToolPaths` documents the contract -- top-level fields are the project
paths, `userScope` carries the user overrides -- so the entry now follows it:
top-level stays `.qoder/*`, `userScope` holds `.qoder-cn/*`, `mcp` is the
user-level MCP file and `mcpProject` the project-level one.

`userScope` did not admit `settings` at all, so a user-scope `qoder-cn` would
have had its hooks written to `~/.qoder/settings.json` -- the international
install's config. `settings` is now part of the userScope schema and its splice.

Hooks do not necessarily live at the config's scope: `resolveHookScope` maps a
non-self project scope to HOME (#264). Every caller that resolved paths from
`localConfig` while using that HOME base directory therefore looked under the
project prefix inside HOME. `resolveHookScope` and
`resolveLegacyProjectHookScope` now report the scope they resolved, and the
inject, remove and check paths use it -- `hooks.ts`, `pull.ts`, `hooks-cmd.ts`
and `doctor.ts`, the last of which is why `teamai doctor` reported "teamai hooks
in qoder-cn settings" as missing.

Verified with a real CLI end-to-end run, not only unit tests. Against
`teamai-hub/teamai-cli-dev` with a scratch HOME, `--scope project --agent
qoder-cn`:

- `~/.qoder-cn/settings.json` is written; `~/.qoder/settings.json` is not
- project scope delivers to `<project>/.qoder/skills`; `.qoder-cn/` is not created
- `teamai doctor` reports `qoder-cn is installed` and `teamai hooks in qoder-cn
  settings` both green (the latter failed before this change)

`npx tsc --noEmit` clean; full suite unchanged at 30 failed / 240 passed files
and 75 failed / 3655 passed tests, the pre-existing Windows failures.

* fix(agents): keep Qoder CN off the paths Qoder already owns

Registering `qoder-cn` with the project paths `.qoder/*` made two targets
resolve to the same project-scope hook file. `reconcileHooksToAllTools` iterates
per tool and `reconcileClaudeFormat` re-renders every built-in entry with the
current tool's dispatch identity, so the later `qoder-cn` pass rewrote a plain
international-Qoder install's file as `--tool qoder-cn` and dropped team hooks
scoped to `tools: [qoder]`. Reproduced with the default configuration (no agent
whitelist) in self mode with `<root>/.qoder` present: 6 built-ins all
`--tool qoder-cn`, 0 `--tool qoder`, and the `tools: [qoder]` hook gone.

Each settings file is now reconciled once, for the first target that reaches it.
The shipped table lists `qoder` before `qoder-cn`, so the existing target keeps
ownership of `<root>/.qoder/settings.json` and CN remains a user-scope addition
there; a CN-only pass still targets the file as `qoder-cn` because nothing else
claims it. `hooksList` mirrors the same rule, so the shared file is listed once
instead of reporting the CN row as missing.

Two user-scope consumers resolved their paths at the config's scope while using
the HOME base directory `resolveHookScope` reports, so they looked in
`~/.qoder/settings.json` for hooks that live in `~/.qoder-cn/settings.json`:
`hooksList` reported a healthy CN install as missing, and `uninstall` discovery
never found the CN hooks and left them behind. Both now use the hook scope.
Skills, rules, agents and claudemd stay at the config scope in uninstall — they
are real project resources, and resolving those to user paths would strand the
project copies.

Corrected the MCP table in both `docs/usage-guide.md` and
`docs/usage-guide.zh-CN.md`, which still said `<project>/.qoder-cn/settings.json`
while `mcpProject` and the surrounding prose use `<project>/.qoder/`.

Known limitation, documented rather than fixed: in project scope a team hook
scoped `tools: [qoder-cn]` no longer lands in the shared file. One physical file
can carry only one dispatch identity, so it is not representable there; teams can
scope to `qoder` or omit `tools:`. Union semantics would need engine support for
alias-aware definitions and is out of scope here.

`tsc --noEmit` clean; full suite 30 failed / 240 passed files unchanged, the
71-test failure set byte-identical, +4 tests from this change.

* fix(cli): resolve the shared hook file by the enabled set on the read path

`hooksList` iterated the whole tool table without applying the enabled set, so
for a self-scope config that enabled Qoder CN alone, `qoder` — disabled, but
earlier in the shipped table — claimed `<root>/.qoder/settings.json`, was probed
for Qoder's dispatch identity, and was reported `missing` while the enabled
`qoder-cn` target never appeared in the table at all.

The write path already got this right: `reconcileHooksToAllTools` skips any tool
outside `filterAgents`, which `reconcileTeamHooksForConfig` derives from
`enabledAgents` and `disabledAgents`. Only the read path was missing the same
rule, so the fix reuses the filter `doctor` already applies to this path table.

Ownership of the shared file therefore follows the enabled set rather than the
table order, and the two paths now agree.

---------

Co-authored-by: PerryLink <255665900+PerryLink@users.noreply.github.com>
2026-09-22 22:23:18 +08:00

teamai-cli

TeamAI — Make Every Team AI Native

Tencent%2Fteamai-cli | Trendshift

English | 中文 | 日本語 | 한국어 | ไทย

CI npm version npm downloads License: MIT

The shared foundation for how your team works, learns, and improves with AI.

TeamAI turns individual AI capabilities into shared team capabilities — across agents, machines, and team members.

Why TeamAI

Eight everyday scenarios, before and after TeamAI

Quick Start

Send this one line to your AI tool:

Install the teamai skill: https://github.com/Tencent/teamai-cli/tree/main/skills/teamai , load the teamai skill, then set up TeamAI for my team from scratch.

Once TeamAI is set up, just talk to the /teamai skill in your AI tool:

Set up a team from scratch

/teamai Help me set up TeamAI for my team from scratch

Join a team

/teamai Help me join my team's TeamAI, repo URL is https://github.com/your-org/your-repo

Share with the team

Skills, rules, MCP servers, and other agent resources can all be shared:

/teamai Share my xxx skill with the team

Open the dashboard

/teamai Open the TeamAI dashboard
Command-line install

Install

npm install -g teamai-cli

Team admin / solo user

Create a shared-experience repo on your git host (GitHub, GitLab, GitCode, CNB, TGit, or a private Git service), grant write access to team members, then run teamai init https://github.com/your-org/your-repo.

No team repo yet? Start from a template pre-loaded with production-ready skills, rules, and review agents. Browse the teamai-hub org, click Fork, then teamai init against your new repo.

Team members

# Choose one, depending on where you want resources installed

# Project-scope init (default, resources installed under the project directory)
cd /path/to/my-project
teamai init https://github.com/your-org/your-repo

# Or, user-scope init (resources installed under ~/)
teamai init https://github.com/your-org/your-repo --scope user

Once initialized, every AI session automatically pulls the latest skills / rules and other Harness updates published by admins — no manual sync needed.

Learn More

Contributors

Thanks to everyone who has contributed to TeamAI!

Contributors

Made with contrib.rocks.

Contributing

Join the conversation, or open an issue or PR. See CONTRIBUTING.md for how to contribute.

License

MIT

S
Description
GitHub Trending: Tencent/teamai-cli
Readme MIT
25 MiB
Languages
TypeScript 99.7%
Python 0.2%
JavaScript 0.1%