@team-ai/teamai-cli 0.40.5 → 0.40.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -36,7 +36,7 @@ All notable changes to this project will be documented in this file. See [standa
36
36
 
37
37
  ### 💥 Breaking Changes
38
38
 
39
- - **An HTTP access token is enrolled for one agent at a time.** `teamai init --http --token <key> --agent claude,codebuddy`, or `--token` with no `--agent` on a machine whose endpoint already holds tokens for several agents, is refused with `An access token works for one agent only. Re-run with --agent <tool> naming the agent it is for`: the backend binds an access token to the first agent instance that reports with it, so one shared by several agents left all but the first at 401 while this machine still reported success. Run `init --http` (or `add-http`) once per tool, with `--agent <tool>` and that tool's own token; each agent then keeps its own, and an agent with no token of its own falls back to the shared token this machine already had. Members who set up several tools with one token in a single `init` have to run it once per tool.
39
+ - **An HTTP agent access token (`sk-`) is enrolled for one agent at a time.** `teamai init --http --token sk-<key> --agent claude,codebuddy`, or `--token` with no `--agent` on a machine whose endpoint already holds tokens for several agents, is refused with `An access token works for one agent only. Re-run with --agent <tool> naming the agent it is for`: the backend binds an access token to the first agent instance that reports with it, so one shared by several agents left all but the first at 401 while this machine still reported success. Run `init --http` (or `add-http`) once per tool, with `--agent <tool>` and that tool's own token; each agent then keeps its own, and an agent with no token of its own falls back to the shared token this machine already had. Members who set up several tools with one `sk-` token in a single `init` have to run it once per tool. A user token (`hk-`) still works for every agent: it stays shared, with any number of `--agent`, and each agent named with `--agent` drops a token of its own so it reports with the shared one.
40
40
  - **Sessions are archived on teamai-reports on every git-kind team.** `teamai session push`, `session migrate` and `workflow publish --sessions` archive there, as self mode already did. Members on 0.28.0 or earlier do not list, search or resume sessions archived there, and their `workflow resume` does not restore step sessions archived there, until they upgrade. Sessions archived on the default branch before stay readable to both (for [#1385](https://github.com/Tencent/teamai-cli/issues/1385)).
41
41
  - **Unattended runs now publish and score their sessions by default.** In CI, on a cloud VM or in a hosted job (`CI` or `TEAMAI_MODE=unattended`), `teamai score --drain`, which the local driver runs at the end of a run and every other driver runs before it ends, archives to teamai-reports, scrubbed: the captured sessions of this machine recorded as unattended, and the step sessions of the workflow runs driven here. Every scorer with `sessions: true` judges a sample of those captured sessions, within `daily_limit`. To keep the old behavior, set `unattended: off`: `sessions: { publish: { unattended: off } }` in `teamai.yaml` and `sessions: { unattended: off }` in `scorers/scoring.yaml` (for [#1385](https://github.com/Tencent/teamai-cli/issues/1385)).
42
42
  - **`teamai import --dir` names a checkout with an `origin` after its remote.** Its evidence goes to `teamwiki/evidence/code/<provider>__<owner>__<repo>/`, the slug `--from-repo` and `teamai ci extract-mr` use, instead of the directory name, so two checkouts named `svc` no longer overwrite each other. Evidence of the same repo under the directory name, including what the checkout published before it had an `origin`, moves there; directory-named evidence that names no repository stays, with a warning. Once the old name holds no evidence, a role or project whose `resources.wiki` lists it is named in a warning: change the entry to the slug the import prints as `project:`. An import over evidence that another repository or another directory of the same repository published, a checkout without an origin over a repository's evidence, and a checkout with an origin over the evidence of another checkout without one, now fail instead of replacing it, and `--skip-enrich` keeps the AI-written components. A checkout without an `origin` whose directory name already holds another such checkout's evidence, or evidence that names no source, is published under `<name>-<hash8>` with a warning, and the import (and `--dry-run`) prints that slug as `project:`. That includes a team's own evidence, written by 0.28.0 or earlier, of a checkout without an `origin` or of a directory outside git: its next import publishes a suffixed copy beside `<name>/` instead of updating it. Move the curated docs you want to keep from `<name>/` to the printed slug, remove `<name>/`, and change any `resources.wiki` entry naming `<name>` to that slug (for [#1422](https://github.com/Tencent/teamai-cli/issues/1422)).
package/dist/cli.js CHANGED
@@ -96110,18 +96110,22 @@ async function initLocalAgentHttp(options2) {
96110
96110
  const namedCount = options2.filterAgents?.length ?? 0;
96111
96111
  const namedAgent = namedCount === 1 ? normalizeAgentType(options2.filterAgents[0]) : void 0;
96112
96112
  const held = sameEndpoint ? Object.keys(existing2?.agentTokens ?? {}) : [];
96113
- const inferred = namedCount === 0 && token !== void 0 && held.length === 1;
96114
- const agent = namedAgent ?? (inferred ? held[0] : void 0);
96113
+ const agentScoped = token?.startsWith("sk-") === true;
96114
+ const inferred = namedCount === 0 && agentScoped && held.length === 1;
96115
+ const agent = agentScoped ? namedAgent ?? (inferred ? held[0] : void 0) : void 0;
96115
96116
  const perAgent = Boolean(agent && token);
96116
96117
  if (existing2 && configExisted && !options2.force && !(perAgent && sameEndpoint)) {
96117
96118
  throw new Error("HTTP local agent is already initialized. Re-run with --force to overwrite.");
96118
96119
  }
96119
- if (token && !agent && (namedCount > 1 || held.length > 1)) {
96120
+ if (agentScoped && !agent && (namedCount > 1 || held.length > 1)) {
96120
96121
  throw new Error(
96121
96122
  `An access token works for one agent only. Re-run with --agent <tool> naming the agent it is for${held.length > 1 ? `; this machine already holds credentials for ${held.join(", ")}` : ""}.`
96122
96123
  );
96123
96124
  }
96124
96125
  const agentTokens = { ...sameEndpoint ? existing2?.agentTokens : void 0 };
96126
+ if (token && !agentScoped) {
96127
+ for (const named2 of options2.filterAgents ?? []) delete agentTokens[normalizeAgentType(named2)];
96128
+ }
96125
96129
  let sharedToken = perAgent ? sameEndpoint ? existing2?.token : void 0 : token ?? (sameEndpoint ? existing2?.token : void 0);
96126
96130
  if (perAgent && sharedToken === token) sharedToken = void 0;
96127
96131
  if (perAgent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-ai/teamai-cli",
3
- "version": "0.40.5",
3
+ "version": "0.40.8",
4
4
  "description": "TeamAI — Make Every Team AI Native (skill sync + shared knowledge base, powered by Git)",
5
5
  "type": "module",
6
6
  "bin": {