@team-agent/installer 0.5.73 → 0.5.74
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/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/crates/team-agent/src/cli/adapters.rs +19 -13
- package/crates/team-agent/src/cli/emit.rs +6 -3
- package/crates/team-agent/src/cli/mod.rs +151 -0
- package/crates/team-agent/src/cli/tests/leader_watch.rs +28 -0
- package/crates/team-agent/src/cli/tests/run_delegation.rs +3 -0
- package/crates/team-agent/src/cli/types.rs +6 -0
- package/crates/team-agent/src/compiler.rs +14 -1
- package/crates/team-agent/src/leader/lease.rs +106 -21
- package/crates/team-agent/src/leader/registry.rs +0 -89
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +457 -73
- package/crates/team-agent/src/lifecycle/launch/quick_start_transport.rs +16 -6
- package/crates/team-agent/src/lifecycle/launch/state_projection.rs +5 -3
- package/crates/team-agent/src/lifecycle/restart/common.rs +0 -11
- package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +60 -0
- package/crates/team-agent/src/lifecycle/tests/pi_compiler_red.rs +31 -0
- package/crates/team-agent/src/lifecycle/tests/pi_dual_entry_red.rs +25 -23
- package/crates/team-agent/src/messaging/delivery.rs +26 -8
- package/crates/team-agent/src/messaging/tests/runtime.rs +234 -0
- package/crates/team-agent/src/model/spec.rs +81 -7
- package/crates/team-agent/src/provider/adapters/pi.rs +14 -0
- package/crates/team-agent/src/state/persist.rs +272 -3
- package/crates/team-agent/src/state/repository.rs +9 -2
- package/crates/team-agent/src/tmux_backend/tests.rs +64 -0
- package/crates/team-agent/src/tmux_backend.rs +57 -0
- package/package.json +4 -4
- package/skills/team-agent/SKILL.md +3 -0
- package/skills/team-agent/command-coverage.json +21 -0
- package/skills/team-agent/references/team-agent-operator.md +9 -2
|
@@ -378,6 +378,63 @@ impl TmuxBackend {
|
|
|
378
378
|
self.run_ok(&argv)
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
+
/// Set the pane-instance nonce only when the pane option is unset. tmux
|
|
382
|
+
/// serializes commands at the server, so concurrent first claims have one
|
|
383
|
+
/// winner; losers read back that winner instead of persisting a stale nonce.
|
|
384
|
+
pub(crate) fn set_pane_binding_nonce_if_unset(
|
|
385
|
+
&self,
|
|
386
|
+
pane: &PaneId,
|
|
387
|
+
nonce: &str,
|
|
388
|
+
) -> Result<String, TransportError> {
|
|
389
|
+
let argv = self.tmux_argv(&[
|
|
390
|
+
"tmux".to_string(),
|
|
391
|
+
"set-option".to_string(),
|
|
392
|
+
"-p".to_string(),
|
|
393
|
+
"-o".to_string(),
|
|
394
|
+
"-t".to_string(),
|
|
395
|
+
pane.as_str().to_string(),
|
|
396
|
+
TMUX_PANE_BINDING_NONCE_OPTION.to_string(),
|
|
397
|
+
nonce.to_string(),
|
|
398
|
+
]);
|
|
399
|
+
let output = self.runner.run(&argv)?;
|
|
400
|
+
if output.success {
|
|
401
|
+
return Ok(nonce.to_string());
|
|
402
|
+
}
|
|
403
|
+
if output
|
|
404
|
+
.stderr
|
|
405
|
+
.to_ascii_lowercase()
|
|
406
|
+
.contains("already set")
|
|
407
|
+
{
|
|
408
|
+
return self.read_pane_binding_nonce(pane);
|
|
409
|
+
}
|
|
410
|
+
Err(subprocess_error(argv, output))
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
fn read_pane_binding_nonce(&self, pane: &PaneId) -> Result<String, TransportError> {
|
|
414
|
+
let argv = self.tmux_argv(&[
|
|
415
|
+
"tmux".to_string(),
|
|
416
|
+
"show-options".to_string(),
|
|
417
|
+
"-p".to_string(),
|
|
418
|
+
"-v".to_string(),
|
|
419
|
+
"-t".to_string(),
|
|
420
|
+
pane.as_str().to_string(),
|
|
421
|
+
TMUX_PANE_BINDING_NONCE_OPTION.to_string(),
|
|
422
|
+
]);
|
|
423
|
+
let output = self.runner.run(&argv)?;
|
|
424
|
+
if !output.success {
|
|
425
|
+
return Err(subprocess_error(argv, output));
|
|
426
|
+
}
|
|
427
|
+
let nonce = output.stdout.trim();
|
|
428
|
+
if nonce.is_empty() {
|
|
429
|
+
return Err(TransportError::Subprocess {
|
|
430
|
+
argv,
|
|
431
|
+
code: output.code,
|
|
432
|
+
stderr: "pane binding nonce remained unset after conditional write".to_string(),
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
Ok(nonce.to_string())
|
|
436
|
+
}
|
|
437
|
+
|
|
381
438
|
/// Backend with an injected runner (tests: canned/recording tmux output). Shared default socket.
|
|
382
439
|
/// ---
|
|
383
440
|
/// purpose: 用注入的 runner 构造后端(测试用录制/罐装 tmux 输出),绑共享默认 socket
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@team-agent/installer",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.74",
|
|
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.
|
|
24
|
-
"@team-agent/cli-darwin-x64": "0.5.
|
|
25
|
-
"@team-agent/cli-linux-x64": "0.5.
|
|
23
|
+
"@team-agent/cli-darwin-arm64": "0.5.74",
|
|
24
|
+
"@team-agent/cli-darwin-x64": "0.5.74",
|
|
25
|
+
"@team-agent/cli-linux-x64": "0.5.74"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"postinstall": "node npm/bincheck.mjs",
|
|
@@ -27,10 +27,13 @@ For a Pi worker, use this existing three-step flow:
|
|
|
27
27
|
|
|
28
28
|
Pi roles preserve the direct Pi login, model defaults, extensions/plugins, skills, context, trust, and tools. Team Agent adds only per-seat identity/session isolation. `model` and `effort` are optional explicit pass-throughs. Use the shared role schema, a block-style `tools` list containing `mcp_team`, and the required boolean `dangerously_skip_permissions`.
|
|
29
29
|
|
|
30
|
+
Pi tool contract: use only `mcp_team`, `fs_read`, `fs_list`, `fs_write`, and `execute_bash`. Do not copy `provider_builtin`, `git_diff`, or `network` from a generic Codex role; Pi cannot map those categories. `compile`/`validate` rejects unsupported Pi categories before quick-start persists runtime state.
|
|
31
|
+
|
|
30
32
|
## Operate
|
|
31
33
|
|
|
32
34
|
- Send: `team-agent send TO MESSAGE` using an in-team short name or fully qualified `<workspace>::<team>/<agent>`; these are co-equal positional TO forms. For example, `team-agent send reviewer "..."` uses an in-team short name. Do not poll after success.
|
|
33
35
|
- Inspect: `team-agent status` or `team-agent status --json`; `ok: true` with `ready: false` is not a crash.
|
|
36
|
+
- `quick-start` / `restart` / `claim-leader` JSON is compact by default (`ok`, `status`/`reason`, next action, attach/send, and `readiness.all_workers_spawned`); pass `--detail` only for internal diagnostics.
|
|
34
37
|
- On a structured failure with an `action`, run that action first, then stop. Never guess flags.
|
|
35
38
|
- Never rewrite a user-supplied model id or read `.env` files.
|
|
36
39
|
|
|
@@ -67,6 +67,13 @@
|
|
|
67
67
|
"owner": "runtime-owner:leader-channel",
|
|
68
68
|
"plan": "Execute in a hermetic leader fixture and bind assertions to owner/receiver persistence or a precise zero-write refusal."
|
|
69
69
|
},
|
|
70
|
+
{
|
|
71
|
+
"command": "team-agent claim-leader --detail",
|
|
72
|
+
"bucket": "declared_gap",
|
|
73
|
+
"covered": false,
|
|
74
|
+
"owner": "runtime-owner:leader-channel",
|
|
75
|
+
"plan": "Execute the exact argv and bind assertions to detail-only topology_convergence, owner_epoch, and checked_paths fields."
|
|
76
|
+
},
|
|
70
77
|
{
|
|
71
78
|
"command": "team-agent claude",
|
|
72
79
|
"bucket": "declared_gap",
|
|
@@ -233,6 +240,13 @@
|
|
|
233
240
|
}
|
|
234
241
|
}
|
|
235
242
|
},
|
|
243
|
+
{
|
|
244
|
+
"command": "team-agent quick-start --json --detail",
|
|
245
|
+
"bucket": "declared_gap",
|
|
246
|
+
"covered": false,
|
|
247
|
+
"owner": "runtime-owner:lifecycle",
|
|
248
|
+
"plan": "Execute the exact argv and bind assertions to detail-only receiver, topology, and coordinator diagnostics while keeping compact default JSON."
|
|
249
|
+
},
|
|
236
250
|
{
|
|
237
251
|
"command": "team-agent quick-start <dir>",
|
|
238
252
|
"bucket": "covered",
|
|
@@ -308,6 +322,13 @@
|
|
|
308
322
|
"owner": "runtime-owner:restart",
|
|
309
323
|
"plan": "Execute a representative team selector and bind assertions to selected-team restart and sibling preservation."
|
|
310
324
|
},
|
|
325
|
+
{
|
|
326
|
+
"command": "team-agent restart --json --detail",
|
|
327
|
+
"bucket": "declared_gap",
|
|
328
|
+
"covered": false,
|
|
329
|
+
"owner": "runtime-owner:restart",
|
|
330
|
+
"plan": "Execute the exact argv and bind assertions to detail-only coordinator diagnostics while keeping compact default JSON."
|
|
331
|
+
},
|
|
311
332
|
{
|
|
312
333
|
"command": "team-agent send --task task_initial \"Start\"",
|
|
313
334
|
"bucket": "declared_gap",
|
|
@@ -96,6 +96,8 @@ EOF
|
|
|
96
96
|
team-agent quick-start .team/current
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
+
That copy-paste role is Codex-specific. Provider tool categories are not portable: Pi roles must contain `mcp_team` and may use only `fs_read`, `fs_list`, `fs_write`, and `execute_bash`; do not carry `provider_builtin`, `git_diff`, or `network` into a Pi role. `team-agent compile`/`validate` rejects an unsupported Pi category before quick-start persists runtime state, and the error names the category to remove.
|
|
100
|
+
|
|
99
101
|
YAML lists must be block style. Use `tools:\n - fs_read`; do not use `tools: [fs_read, mcp_team]`.
|
|
100
102
|
|
|
101
103
|
Display choices (set `display_backend:` in `TEAM.md` to opt in):
|
|
@@ -122,9 +124,11 @@ team-agent claim-leader --help
|
|
|
122
124
|
Observed (exit 0):
|
|
123
125
|
|
|
124
126
|
```text
|
|
125
|
-
usage: team-agent claim-leader [--workspace WORKSPACE] [--team TEAM] [--confirm] [--json]
|
|
127
|
+
usage: team-agent claim-leader [--workspace WORKSPACE] [--team TEAM] [--confirm] [--json] [--detail]
|
|
126
128
|
```
|
|
127
129
|
|
|
130
|
+
Default JSON for `quick-start`, `restart`, and `claim-leader` is compact: `ok`, `status`/`reason`, next action, attach/send. `quick-start` keeps a short `readiness` object with `all_workers_spawned`. Pass `--detail` for internal receiver/topology/coordinator diagnostics.
|
|
131
|
+
|
|
128
132
|
Run `claim-leader` only from the **leader** pane. From a worker pane it refuses and prints a structured `action` (see Failure Rules).
|
|
129
133
|
|
|
130
134
|
## Provider Capability Matrix
|
|
@@ -264,7 +268,7 @@ team-agent shutdown --help
|
|
|
264
268
|
Observed (all exit 0):
|
|
265
269
|
|
|
266
270
|
```text
|
|
267
|
-
usage: team-agent restart [WORKSPACE] [--team TEAM] [--allow-fresh] [--session-converge-deadline SECONDS] [--json]
|
|
271
|
+
usage: team-agent restart [WORKSPACE] [--team TEAM] [--allow-fresh] [--session-converge-deadline SECONDS] [--json] [--detail]
|
|
268
272
|
usage: team-agent add-agent AGENT --role-file FILE [--force] [--workspace WORKSPACE] [--team TEAM] [--no-display] [--json]
|
|
269
273
|
usage: team-agent shutdown [--workspace WORKSPACE] [--team TEAM] [--keep-logs] [--json]
|
|
270
274
|
```
|
|
@@ -480,6 +484,7 @@ team-agent approvals <agent_id>
|
|
|
480
484
|
team-agent approvals [coder]
|
|
481
485
|
team-agent attach-leader
|
|
482
486
|
team-agent claim-leader
|
|
487
|
+
team-agent claim-leader --detail
|
|
483
488
|
team-agent claude
|
|
484
489
|
team-agent clone-agent <source> --as <new>
|
|
485
490
|
team-agent codex
|
|
@@ -501,12 +506,14 @@ team-agent quick-start ./roles --team-id alpha
|
|
|
501
506
|
team-agent quick-start .team/alpha
|
|
502
507
|
team-agent quick-start .team/current
|
|
503
508
|
team-agent quick-start <dir>
|
|
509
|
+
team-agent quick-start --json --detail
|
|
504
510
|
team-agent remove-agent <agent> --workspace . --confirm
|
|
505
511
|
team-agent reset-agent <agent> --discard-session
|
|
506
512
|
team-agent restart
|
|
507
513
|
team-agent restart .
|
|
508
514
|
team-agent restart . --allow-fresh
|
|
509
515
|
team-agent restart . --team <session_name_or_team_name>
|
|
516
|
+
team-agent restart --json --detail
|
|
510
517
|
team-agent send --task task_initial "Start"
|
|
511
518
|
team-agent send --watch-result
|
|
512
519
|
team-agent send --watch-result coder "Do the bounded task"
|