@team-agent/installer 0.5.102 → 0.5.104

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.
Files changed (33) hide show
  1. package/Cargo.lock +1 -1
  2. package/Cargo.toml +1 -1
  3. package/crates/team-agent/src/cli/emit.rs +2 -1
  4. package/crates/team-agent/src/cli/models.rs +92 -226
  5. package/crates/team-agent/src/cli/spec.rs +2 -2
  6. package/crates/team-agent/src/compiler/tests.rs +19 -27
  7. package/crates/team-agent/src/compiler.rs +11 -105
  8. package/crates/team-agent/src/lifecycle/launch/add_agent_state.rs +4 -2
  9. package/crates/team-agent/src/lifecycle/launch/clone_agent.rs +2 -5
  10. package/crates/team-agent/src/lifecycle/launch/identity.rs +9 -13
  11. package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +37 -161
  12. package/crates/team-agent/src/lifecycle/launch/role_source.rs +1 -25
  13. package/crates/team-agent/src/lifecycle/launch/spawn.rs +1 -0
  14. package/crates/team-agent/src/lifecycle/profile_launch.rs +0 -12
  15. package/crates/team-agent/src/lifecycle/restart/avatar.rs +0 -1
  16. package/crates/team-agent/src/lifecycle/restart/common.rs +1 -1
  17. package/crates/team-agent/src/lifecycle/tests/cursor_require_explicit_model_red.rs +7 -19
  18. package/crates/team-agent/src/lifecycle/tests/grok_require_explicit_model_red.rs +8 -41
  19. package/crates/team-agent/src/lifecycle/tests/pi_compiler_red.rs +14 -8
  20. package/crates/team-agent/src/lifecycle/tests/pi_dual_entry_red.rs +8 -4
  21. package/crates/team-agent/src/lifecycle/worker_command_context.rs +4 -4
  22. package/crates/team-agent/src/messaging/results.rs +11 -42
  23. package/crates/team-agent/src/model/enums.rs +0 -9
  24. package/crates/team-agent/src/model/spec.rs +2 -2
  25. package/crates/team-agent/src/provider/adapters/cursor_agent.rs +7 -8
  26. package/crates/team-agent/src/provider/adapters/grok.rs +5 -18
  27. package/crates/team-agent/src/provider/mod.rs +1 -0
  28. package/crates/team-agent/src/provider/model_catalog.rs +650 -0
  29. package/crates/team-agent/src/provider/tests/adapter.rs +15 -24
  30. package/crates/team-agent/src/provider/wire.rs +2 -29
  31. package/package.json +4 -4
  32. package/skills/team-agent/SKILL.md +48 -33
  33. package/skills/team-agent/references/team-agent-operator.md +49 -526
@@ -308,21 +308,14 @@ fn test_grok_build_command_bypass_flag_when_dangerous() {
308
308
  }
309
309
 
310
310
  #[test]
311
- fn test_grok_build_command_refuses_missing_model() {
311
+ fn test_grok_build_command_omits_missing_model() {
312
312
  let adapter = get_adapter(Provider::Grok);
313
- let err = adapter
313
+ let argv = adapter
314
314
  .build_command(AuthMode::Subscription, None, None, None)
315
- .expect_err("grok must refuse to build argv without an explicit model");
316
- let text = err.to_string();
317
- assert!(
318
- text.to_ascii_lowercase().contains("model"),
319
- "error must name model; got {text}"
320
- );
315
+ .expect("missing model preserves the provider-native default");
321
316
  assert!(
322
- text.to_ascii_lowercase().contains("built-in")
323
- || text.to_ascii_lowercase().contains("builtin")
324
- || text.contains("内建"),
325
- "error must name the built-in default the framework would fill; got {text}"
317
+ !argv.iter().any(|arg| arg == "--model"),
318
+ "missing model must not fabricate a --model argument: {argv:?}"
326
319
  );
327
320
  assert!(
328
321
  argv_contains_adjacent(
@@ -348,12 +341,8 @@ fn test_cursor_agent_build_command_includes_workspace_flag() {
348
341
  "cursor argv must carry `--workspace {{workspace}}`: {argv:?}"
349
342
  );
350
343
  assert!(
351
- argv_contains_adjacent(&argv, &["--trust"]),
352
- "cursor argv must carry documented --trust: {argv:?}"
353
- );
354
- assert!(
355
- argv_contains_adjacent(&argv, &["--sandbox", "disabled"]),
356
- "cursor argv must carry documented --sandbox disabled: {argv:?}"
344
+ !argv.iter().any(|arg| arg == "--trust" || arg == "--sandbox"),
345
+ "safe Cursor command must not opt into trust or disabled sandbox: {argv:?}"
357
346
  );
358
347
  assert!(
359
348
  !argv.iter().any(|a| a == "--rules" || a == "--append-system-prompt"),
@@ -509,8 +498,11 @@ fn test_cursor_fresh_plan_has_no_session_id_and_no_resume() {
509
498
  plan.argv
510
499
  );
511
500
  assert!(
512
- argv_contains_adjacent(&plan.argv, &["--trust"]),
513
- "fresh cursor must keep --trust; argv={:?}",
501
+ !plan
502
+ .argv
503
+ .iter()
504
+ .any(|arg| arg == "--trust" || arg == "--sandbox"),
505
+ "default Cursor plan must not opt into trust or disabled sandbox; argv={:?}",
514
506
  plan.argv
515
507
  );
516
508
  }
@@ -550,10 +542,10 @@ fn test_cursor_resume_plan_requires_chat_id_and_never_emits_empty_resume() {
550
542
  }
551
543
 
552
544
  #[test]
553
- fn pi_wire_roundtrip_requires_backing_and_has_no_builtin_model() {
545
+ fn pi_wire_roundtrip_requires_backing() {
554
546
  use crate::provider::wire::{
555
- aliases, builtin_provider_model, command_name, parse_canonical_provider, parse_provider,
556
- provider_wire, requires_resume_backing,
547
+ aliases, command_name, parse_canonical_provider, parse_provider, provider_wire,
548
+ requires_resume_backing,
557
549
  };
558
550
 
559
551
  let provider = Provider::Pi;
@@ -563,7 +555,6 @@ fn pi_wire_roundtrip_requires_backing_and_has_no_builtin_model() {
563
555
  assert_eq!(aliases(provider), &["pi"]);
564
556
  assert_eq!(command_name(provider), "pi");
565
557
  assert!(requires_resume_backing(provider));
566
- assert_eq!(builtin_provider_model(provider), None);
567
558
  }
568
559
 
569
560
  #[test]
@@ -88,31 +88,6 @@ pub(crate) fn requires_resume_backing(provider: Provider) -> bool {
88
88
  )
89
89
  }
90
90
 
91
- pub(crate) fn provider_model_keys(provider: Provider) -> &'static [&'static str] {
92
- match provider {
93
- Provider::Claude => &["claude", "claude_code"],
94
- Provider::ClaudeCode => &["claude_code", "claude"],
95
- Provider::Codex => &["codex"],
96
- Provider::Copilot => &["copilot"],
97
- Provider::GeminiCli => &["gemini_cli"],
98
- Provider::Grok => &["grok"],
99
- Provider::CursorAgent => &["cursor_agent"],
100
- Provider::Pi => &["pi"],
101
- Provider::Fake => &["fake"],
102
- }
103
- }
104
-
105
- pub(crate) fn builtin_provider_model(provider: Provider) -> Option<&'static str> {
106
- match provider {
107
- Provider::Claude | Provider::ClaudeCode => Some("claude-sonnet-4-6"),
108
- Provider::Codex => Some("gpt-5.5"),
109
- // grok: compiler 另有缺 model 硬闸,这里的 builtin 不再被 grok 角色吃到。
110
- // cursor_agent: 禁止隐式默认(本机 shim 会剥 sonnet-4-thinking);缺 model 编译失败。
111
- Provider::Grok => Some("grok-4"),
112
- Provider::CursorAgent | Provider::Pi => None,
113
- Provider::Copilot | Provider::GeminiCli | Provider::Fake => None,
114
- }
115
- }
116
91
 
117
92
  /// All aliases (including the canonical wire form) that parse to `provider`.
118
93
  /// The canonical wire form is always the first entry, so callers that need
@@ -235,10 +210,8 @@ mod tests {
235
210
  "model spec must validate providers through typed helpers"
236
211
  );
237
212
  assert!(
238
- compiler_rs.contains("parse_canonical_provider")
239
- && compiler_rs.contains("provider_model_keys")
240
- && compiler_rs.contains("wire_builtin_provider_model"),
241
- "compiler effort/model defaults must use typed provider helpers"
213
+ compiler_rs.contains("parse_canonical_provider"),
214
+ "compiler must validate providers through typed helpers"
242
215
  );
243
216
  assert!(
244
217
  delivery_rs.contains("parse_canonical_provider")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-agent/installer",
3
- "version": "0.5.102",
3
+ "version": "0.5.104",
4
4
  "description": "npx installer for Team Agent",
5
5
  "keywords": [
6
6
  "codex",
@@ -20,9 +20,9 @@
20
20
  "team-agent-installer": "npm/install.mjs"
21
21
  },
22
22
  "optionalDependencies": {
23
- "@team-agent/cli-darwin-arm64": "0.5.102",
24
- "@team-agent/cli-darwin-x64": "0.5.102",
25
- "@team-agent/cli-linux-x64": "0.5.102"
23
+ "@team-agent/cli-darwin-arm64": "0.5.104",
24
+ "@team-agent/cli-darwin-x64": "0.5.104",
25
+ "@team-agent/cli-linux-x64": "0.5.104"
26
26
  },
27
27
  "scripts": {
28
28
  "postinstall": "node npm/bincheck.mjs",
@@ -1,39 +1,54 @@
1
1
  ---
2
2
  name: team-agent
3
- description: Use only when the user explicitly asks to start, operate, inspect, shutdown, or restart a Team Agent team. Treat the team-agent CLI as a sealed appliance.
3
+ description: Use when the user asks to create, operate, inspect, or stop a Team Agent team. Treat the CLI as the public interface.
4
4
  requires_team_agent: ">=0.5.0"
5
- last_verified_against: "0.5.66"
6
5
  ---
7
6
  # Team Agent
8
- Sealed appliance for someone who just got the CLI. Operator handbook (permissions, models, routing, recovery): `references/team-agent-operator.md`.
9
- If `team-agent --version` differs from `last_verified_against`, learn from the live CLI before copying examples:
10
- ```bash
11
- team-agent --version
12
- team-agent --help
13
- team-agent doctor --help
7
+
8
+ The current assistant is the **leader**. Workers use separate role files and report through Team Agent. Start from a tmux-addressable terminal or supported agent pane, in the workspace root (the parent of the team directory).
9
+
10
+ ## Create and start
11
+
12
+ A team can be plain text; no YAML frontmatter is required:
13
+
14
+ ```text
15
+ .team/current/
16
+ TEAM.md # the team's goal
17
+ agents/reviewer.md # the worker's instructions
14
18
  ```
15
- **Launch** from a tmux-addressable pane: `team-agent claude` or `team-agent codex`, then `team-agent quick-start .team/current`. For a plain-text team directory, use `team-agent quick-start <plain-text-team-dir>`. Do not start a real team from a naked terminal; workers use independent background windows on the workspace-scoped tmux server.
16
- **Operate**
17
- - Dispatch: `team-agent send TO MESSAGE` (positional TO; `--watch-result` is deprecated). After success, do not poll with `sleep` / `status` / `inbox` / `collect`. TO has two co-equal logical forms: an in-team short name (`team-agent send reviewer "..."`) and a fully qualified `<workspace>::<team>/<agent>`. Use the qualified form across workspaces.
18
- - Inspect: `team-agent status` / `status --json`; `ok: true` plus `ready: false` is not a crash.
19
- - Lifecycle: `restart .` resumes a stopped team; `add-agent NAME --role-file FILE` adds or `--force` recreates one worker; `shutdown --workspace .` stops. Do not shutdown the team to add a worker.
20
- - Documents: `TEAM.md` and `agents/*.md` may be plain text/Markdown with no frontmatter; the whole team body is its objective and the whole role body is the prompt. Default worker id is the filename stem, provider `pi`, model `openai-codex/gpt-6-luna`, effort `max`, and bypass enabled. Valid optional frontmatter can override supported metadata.
21
- - On a structured failure `action`, run that action first, then stop. Do not guess flags. `coordinator.session_missing` is self-healing; re-check `status --json`, do not shutdown.
22
- The current user-facing agent is the leader (orchestrate only). Worker MCP exposes exactly `send_message`, `report_result`, and optional `get_team_status`; lifecycle management stays on the authorized native CLI. Workers call `report_result` exactly once. Nested teams: `references/team-in-team.md`.
23
- ## Provider Capability Matrix
24
- See `references/team-agent-operator.md` for Claude / Codex / Copilot / Gemini / fake. `quick-start` / `restart` / `claim-leader` JSON is compact by default; pass `--detail` only for internal diagnostics.
25
- | Provider | Resume | Turn-state detection | Per-worker model override | Team Agent fork |
26
- |---|---|---|---|---|
27
- | `grok` | yes (`--resume <id>`, archive-gated) | no | yes (role `model` required) | yes (`--fork-session` + new `--session-id`) |
28
- | `cursor_agent` | yes (`--resume <chatId>`, archive-gated) | no | required on role; same-family catalog id may take effect; unknown id silent-fallback; pane chrome ≠ proof | **no — `CapabilityUnsupported`** |
29
- | `pi` | yes (exact `--session <backing-path>`, not selector/continue) | Unknown (no JSONL turn-state reader) | yes (role `model` / `effort`, catalog-validated) | yes (full snapshot into separate seat/session; exact backing resume) |
30
- Grok / `cursor_agent` have no JSONL turn-state reader (classify → Unknown). Pi `fork-agent SOURCE --as TARGET` requires a captured Pi subscription source and reports both session ids plus the target backing path; it does not mutate the source session.
31
- ## Provider Prep
32
- ### Cursor provider notes
33
- To opt into Cursor, use optional frontmatter with `provider: cursor_agent` (not `cursor`; launcher verb `team-agent cursor`) and `auth_mode: subscription`; no profile or bypass field is required. `agent_id` (legacy `name`) and `role` can be omitted, but Cursor still requires an explicit `model:`.
34
- The model flag stays on argv; same-family catalog ids can change pane chrome, while unknown ids silent-fallback without warning. Pick a catalog id; after spawn, `capture-pane` once for chrome. Pane chrome does not prove the live model.
35
- One `cursor_agent` per workspace; a second seat fail-closes because `.cursor/mcp.json` is directory-scoped and overwrites `TEAM_AGENT_ID`. Several Cursor seats need separate workspace directories. Same seat, fresh context: `reset-agent --discard-session`.
36
- `clone-agent` copies the source role but starts fresh. Runtime role replacement: `clone-agent` → `stop-agent` → `remove-agent --confirm` (deletes `.team/dynamic-role-files/`) → write role file → `add-agent --role-file` → dispatch.
37
- - Restart emits `--resume <chatId>` when `store.db` / `meta.json` exist; the gate does not read chat text. Persist anything that must survive restart.
38
- - Delivery sends one Enter; a second Enter interrupts the turn.
39
- - After spawn, the pane footer should show `Cursor Agent v<version>`. Do not use `strings` to probe the binary.
19
+
20
+ Put the goal in `TEAM.md` and the worker's instructions in each `agents/*.md` body. Use the filename stem as the worker id and in-team short name in commands such as `send` and `inbox`.
21
+
22
+ ```sh
23
+ team-agent quick-start .team/current
24
+ team-agent send reviewer "Review this change"
25
+ team-agent inbox reviewer -n 3
26
+ team-agent add-agent analyst --role-file /absolute/path/to/analyst.md
27
+ team-agent shutdown --workspace .
28
+ ```
29
+
30
+ The `reviewer` argument is an in-team short name; use `<workspace>::<team>/<agent>` when the recipient needs a fully qualified identity. A successful `send` may mean only queued; it is not the worker's reply. Wait for a natural response or result before treating the task as complete.
31
+
32
+ ## Role defaults
33
+
34
+ All role metadata is optional. With no overrides:
35
+
36
+ | Setting | Default |
37
+ |---|---|
38
+ | Provider | `pi` |
39
+ | Model | unset; let the provider choose |
40
+ | Effort | unset; let the provider choose |
41
+ | Permission bypass | `false`; keep provider-native permissions |
42
+
43
+ Add frontmatter only when a role needs an override. Supported fields include `agent_id` (legacy alias: `name`), `role`, `provider`, `model`, `effort`, `auth_mode`, `profile`, `dangerously_skip_permissions`, and `communication_mode`. Old `tools`, `permission_mode`, and `label` role keys do not configure a worker.
44
+
45
+ Profiles keep provider authentication, endpoint, and custom-model settings local. Never put secrets in `TEAM.md` or a role file. See [the operator reference](references/team-agent-operator.md) for profile setup and field details.
46
+
47
+ ## Inspect
48
+
49
+ Use `team-agent status --json` for readiness and `team-agent --help` for current command syntax. `ok: true` with `ready: false` means the command succeeded but the team is not ready; follow the reported action.
50
+
51
+ Worker MCP provides `send_message`, `report_result`, and `get_team_status`. Lifecycle actions remain on the authorized CLI. See [nested teams](references/team-in-team.md) only when the task needs them.
52
+
53
+ ---
54
+ This skill is a concise public guide. Do not infer a tested version from package metadata; verify the installed CLI with `team-agent --version` when version-specific behavior matters.