@team-agent/installer 0.5.84 → 0.5.86
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/mod.rs +0 -1
- package/crates/team-agent/src/cli/profile.rs +4 -12
- package/crates/team-agent/src/cli/tests/verb_profile.rs +66 -0
- package/crates/team-agent/src/compiler/tests.rs +13 -24
- package/crates/team-agent/src/compiler.rs +1 -50
- package/crates/team-agent/src/leader/start.rs +0 -2
- package/crates/team-agent/src/lifecycle/launch/add_agent.rs +0 -1
- package/crates/team-agent/src/lifecycle/launch/add_agent_state.rs +0 -1
- package/crates/team-agent/src/lifecycle/launch/agent_state.rs +0 -6
- package/crates/team-agent/src/lifecycle/launch/identity.rs +0 -1
- package/crates/team-agent/src/lifecycle/launch/layout.rs +0 -1
- package/crates/team-agent/src/lifecycle/launch/leader_context.rs +0 -1
- package/crates/team-agent/src/lifecycle/launch/mcp_config.rs +1 -89
- package/crates/team-agent/src/lifecycle/launch/ownership.rs +0 -1
- package/crates/team-agent/src/lifecycle/launch/pi_mcp.rs +0 -3
- package/crates/team-agent/src/lifecycle/launch/quick_start.rs +14 -24
- package/crates/team-agent/src/lifecycle/launch/quick_start_transport.rs +0 -1
- package/crates/team-agent/src/lifecycle/launch/readiness.rs +0 -1
- package/crates/team-agent/src/lifecycle/launch/spawn.rs +4 -8
- package/crates/team-agent/src/lifecycle/launch/spec_state.rs +0 -1
- package/crates/team-agent/src/lifecycle/launch/state_projection.rs +0 -1
- package/crates/team-agent/src/lifecycle/launch/worker_env.rs +0 -1
- package/crates/team-agent/src/lifecycle/launch.rs +0 -9
- package/crates/team-agent/src/lifecycle/profile_launch.rs +1 -1
- package/crates/team-agent/src/lifecycle/restart/common.rs +6 -9
- package/crates/team-agent/src/lifecycle/tests/claude_compatible_config_red.rs +1 -3
- package/crates/team-agent/src/lifecycle/tests/clone_agent_preserves_source_tools.rs +42 -46
- package/crates/team-agent/src/lifecycle/tests/copilot_provider_red.rs +209 -52
- package/crates/team-agent/src/lifecycle/tests/core_034_real_red.rs +32 -77
- package/crates/team-agent/src/lifecycle/tests/launch_spawn.rs +2 -13
- package/crates/team-agent/src/lifecycle/tests/pi_catalog_red.rs +0 -1
- package/crates/team-agent/src/lifecycle/tests/pi_command_red.rs +0 -2
- package/crates/team-agent/src/lifecycle/tests/pi_compiler_red.rs +14 -85
- package/crates/team-agent/src/lifecycle/tests/pi_dual_entry_red.rs +1 -1
- package/crates/team-agent/src/lifecycle/tests/pi_executable_mcp_red.rs +0 -5
- package/crates/team-agent/src/lifecycle/tests/pi_session_delivery_red.rs +0 -1
- package/crates/team-agent/src/lifecycle/tests/restart_rebind_hotfix_252_red.rs +4 -4
- package/crates/team-agent/src/lifecycle/tests.rs +0 -1
- package/crates/team-agent/src/lifecycle/types.rs +0 -10
- package/crates/team-agent/src/lifecycle/worker_command_context.rs +4 -248
- package/crates/team-agent/src/messaging/results/collection_tests.rs +719 -0
- package/crates/team-agent/src/messaging/results.rs +104 -27
- package/crates/team-agent/src/model/enums.rs +0 -35
- package/crates/team-agent/src/model/mod.rs +0 -1
- package/crates/team-agent/src/model/spec.rs +23 -84
- package/crates/team-agent/src/provider/adapter.rs +48 -50
- package/crates/team-agent/src/provider/adapters/claude.rs +5 -30
- package/crates/team-agent/src/provider/adapters/codex.rs +5 -25
- package/crates/team-agent/src/provider/adapters/copilot.rs +9 -42
- package/crates/team-agent/src/provider/adapters/cursor_agent.rs +4 -8
- package/crates/team-agent/src/provider/adapters/grok.rs +5 -58
- package/crates/team-agent/src/provider/adapters/mod.rs +5 -7
- package/crates/team-agent/src/provider/adapters/pi.rs +1 -56
- package/crates/team-agent/src/provider/bypass_flags.rs +1 -2
- package/crates/team-agent/src/provider/session/capture.rs +4 -4
- package/crates/team-agent/src/provider/tests/adapter.rs +7 -24
- package/crates/team-agent/src/provider/types.rs +1 -1
- package/crates/team-agent/src/state/persist.rs +15 -1
- package/package.json +4 -4
- package/schemas/team.schema.json +4 -9
- package/crates/team-agent/src/lifecycle/tests/g1_silent_faces.rs +0 -784
- package/crates/team-agent/src/model/permissions.rs +0 -721
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
//! 这是 Provider::Grok 的能力边界,不是框架对所有 provider 的限制。
|
|
10
10
|
//! boundary: 只服务 Provider::Grok。不改 claude/codex/copilot 路径
|
|
11
11
|
//!
|
|
12
|
-
//! Grok CLI provider-local command builders
|
|
12
|
+
//! Grok CLI provider-local command builders.
|
|
13
13
|
//!
|
|
14
14
|
//! Mirrors `adapters/claude.rs` (0.5.67 provider-adapter step). Pure
|
|
15
15
|
//! flag-name adaptation over the claude skeleton — no new abstraction
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
//! fork → `--fork-session` (with --resume)
|
|
25
25
|
//! effort → `--effort <level>` (alias of `--reasoning-effort`)
|
|
26
26
|
//! grok accepts low|medium|high|xhigh; CLI rejects `max`
|
|
27
|
-
//! deny → `--disallowed-tools` (compat alias `--disallowedTools`)
|
|
28
27
|
//! cwd → `--cwd <CWD>` / `-w, --worktree [<WORKTREE>]`
|
|
29
28
|
//!
|
|
30
29
|
//! No native `--mcp-config` flag on the Grok CLI (`grok mcp` is a subcommand)
|
|
@@ -41,7 +40,7 @@ pub(crate) fn grok_launch_command(
|
|
|
41
40
|
mcp_config: Option<&McpConfig>,
|
|
42
41
|
system_prompt: Option<&str>,
|
|
43
42
|
model: Option<&str>,
|
|
44
|
-
|
|
43
|
+
dangerously_skip_permissions: bool,
|
|
45
44
|
) -> Result<Vec<String>, ProviderError> {
|
|
46
45
|
let mut argv = grok_base_command(
|
|
47
46
|
adapter,
|
|
@@ -49,7 +48,7 @@ pub(crate) fn grok_launch_command(
|
|
|
49
48
|
mcp_config,
|
|
50
49
|
system_prompt,
|
|
51
50
|
model,
|
|
52
|
-
|
|
51
|
+
dangerously_skip_permissions,
|
|
53
52
|
false,
|
|
54
53
|
None,
|
|
55
54
|
)?;
|
|
@@ -64,12 +63,12 @@ pub(crate) fn grok_base_command(
|
|
|
64
63
|
mcp_config: Option<&McpConfig>,
|
|
65
64
|
system_prompt: Option<&str>,
|
|
66
65
|
model: Option<&str>,
|
|
67
|
-
|
|
66
|
+
dangerously_skip_permissions: bool,
|
|
68
67
|
managed_mcp_config: bool,
|
|
69
68
|
effort: Option<crate::model::enums::ProviderEffort>,
|
|
70
69
|
) -> Result<Vec<String>, ProviderError> {
|
|
71
70
|
let mut argv = vec!["grok".to_string()];
|
|
72
|
-
if
|
|
71
|
+
if dangerously_skip_permissions {
|
|
73
72
|
argv.push("--always-approve".to_string());
|
|
74
73
|
}
|
|
75
74
|
let model = match model.map(str::trim).filter(|value| !value.is_empty()) {
|
|
@@ -101,57 +100,5 @@ model: grok-4.6"
|
|
|
101
100
|
// Grok CLI has no `--mcp-config` flag — the claude inline-MCP block is
|
|
102
101
|
// intentionally absent. Launch writes `<cwd>/.grok/config.toml`.
|
|
103
102
|
let _ = (adapter, auth_mode, mcp_config, managed_mcp_config);
|
|
104
|
-
for tool in grok_disallowed_tools(tools) {
|
|
105
|
-
argv.push("--disallowedTools".to_string());
|
|
106
|
-
argv.push(tool.to_string());
|
|
107
|
-
}
|
|
108
103
|
Ok(argv)
|
|
109
104
|
}
|
|
110
|
-
|
|
111
|
-
pub(crate) fn grok_dangerous_auto_approve(tools: &[&str]) -> bool {
|
|
112
|
-
tools.contains(&"dangerous_auto_approve")
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
pub(crate) fn grok_disallowed_tools(tools: &[&str]) -> Vec<&'static str> {
|
|
116
|
-
let mut disallowed = Vec::new();
|
|
117
|
-
for tool in [
|
|
118
|
-
"execute_bash",
|
|
119
|
-
"fs_read",
|
|
120
|
-
"fs_write",
|
|
121
|
-
"fs_list",
|
|
122
|
-
"network",
|
|
123
|
-
"git_diff",
|
|
124
|
-
"mcp_team",
|
|
125
|
-
"provider_builtin",
|
|
126
|
-
] {
|
|
127
|
-
if tools.contains(&tool) {
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
match grok_tool_mapping(tool) {
|
|
131
|
-
GrokToolMapping::Deny(names) => disallowed.extend(names),
|
|
132
|
-
GrokToolMapping::Unsupported | GrokToolMapping::Bypass => {}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
disallowed
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/// Canonical tool → grok CLI deny names. Unknown tools stay Unsupported
|
|
139
|
-
/// (no invented `--disallowedTools` token).
|
|
140
|
-
pub(crate) fn grok_tool_mapping(tool: &str) -> GrokToolMapping {
|
|
141
|
-
match tool {
|
|
142
|
-
"execute_bash" => GrokToolMapping::Deny(&["Bash"]),
|
|
143
|
-
"fs_read" => GrokToolMapping::Deny(&["Read"]),
|
|
144
|
-
"fs_write" => GrokToolMapping::Deny(&["Edit", "Write", "MultiEdit", "NotebookEdit"]),
|
|
145
|
-
"fs_list" => GrokToolMapping::Deny(&["Glob", "Grep"]),
|
|
146
|
-
"dangerous_auto_approve" => GrokToolMapping::Bypass,
|
|
147
|
-
"network" | "git_diff" | "mcp_team" | "provider_builtin" => GrokToolMapping::Unsupported,
|
|
148
|
-
_ => GrokToolMapping::Unsupported,
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
153
|
-
pub(crate) enum GrokToolMapping {
|
|
154
|
-
Deny(&'static [&'static str]),
|
|
155
|
-
Bypass,
|
|
156
|
-
Unsupported,
|
|
157
|
-
}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
//!
|
|
2
2
|
//! Provider-local adapter implementations. Split from the monolithic
|
|
3
3
|
//! `provider/adapter.rs` as 0.4.x decoupling step 2. Each file owns its
|
|
4
|
-
//! provider's command builders
|
|
4
|
+
//! provider's command builders and auth helpers,
|
|
5
5
|
//! anything else that varies by provider but doesn't need shared
|
|
6
6
|
//! capture/scan utilities. The `ProviderAdapter` trait and the
|
|
7
7
|
//! `BasicProviderAdapter` registry stay in `adapter.rs`; the trait impl
|
|
8
8
|
//! dispatches into these helpers exactly as the inline forms did.
|
|
9
9
|
//!
|
|
10
10
|
//! Per-file scope:
|
|
11
|
-
//! * `claude` — Claude/ClaudeCode argv,
|
|
12
|
-
//!
|
|
13
|
-
//!
|
|
14
|
-
//! with 600s tool_timeout, developer-instructions escaping.
|
|
11
|
+
//! * `claude` — Claude/ClaudeCode argv, bypass flag, auth hint, model passthrough.
|
|
12
|
+
//! * `codex` — Codex argv, profile flags, MCP `-c` injection with 600s
|
|
13
|
+
//! tool_timeout, developer-instructions escaping.
|
|
15
14
|
//! * `copilot` — Copilot argv (no-color/no-remote/disable-builtin-mcps),
|
|
16
|
-
//!
|
|
17
|
-
//! base, weak auth hint.
|
|
15
|
+
//! MCP `type→transport` translation, resume base, weak auth hint.
|
|
18
16
|
//! * `fake` — Built-in scripted worker exec path.
|
|
19
17
|
//!
|
|
20
18
|
//! Behavior is byte-identical to pre-split. Future steps may move
|
|
@@ -15,42 +15,6 @@ use std::path::Path;
|
|
|
15
15
|
use crate::model::enums::ProviderEffort;
|
|
16
16
|
use crate::provider::ProviderError;
|
|
17
17
|
|
|
18
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
19
|
-
pub(crate) enum PiToolMapping {
|
|
20
|
-
Mcp,
|
|
21
|
-
Builtin(&'static [&'static str]),
|
|
22
|
-
Unsupported,
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/// ---
|
|
26
|
-
/// purpose: 把 Team tool category 映射为 exact Pi builtin/proxy names
|
|
27
|
-
/// returns: 单个或多个 builtin、MCP proxy 或 Unsupported
|
|
28
|
-
/// ---
|
|
29
|
-
pub(crate) fn pi_tool_mapping(category: &str) -> PiToolMapping {
|
|
30
|
-
match category {
|
|
31
|
-
"mcp_team" => PiToolMapping::Mcp,
|
|
32
|
-
"fs_read" => PiToolMapping::Builtin(&["read"]),
|
|
33
|
-
"fs_list" => PiToolMapping::Builtin(&["grep", "find", "ls"]),
|
|
34
|
-
"fs_write" => PiToolMapping::Builtin(&["edit", "write"]),
|
|
35
|
-
"execute_bash" => PiToolMapping::Builtin(&["bash"]),
|
|
36
|
-
_ => PiToolMapping::Unsupported,
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/// Return the first canonical category that Pi cannot map. Callers own alias
|
|
41
|
-
/// expansion and generic unknown-category validation; this keeps the provider
|
|
42
|
-
/// mapping itself as the only Pi capability contract.
|
|
43
|
-
pub(crate) fn first_unsupported_pi_tool_category<'a, I>(
|
|
44
|
-
categories: I,
|
|
45
|
-
) -> Option<&'a str>
|
|
46
|
-
where
|
|
47
|
-
I: IntoIterator<Item = &'a str>,
|
|
48
|
-
{
|
|
49
|
-
categories
|
|
50
|
-
.into_iter()
|
|
51
|
-
.find(|category| matches!(pi_tool_mapping(category), PiToolMapping::Unsupported))
|
|
52
|
-
}
|
|
53
|
-
|
|
54
18
|
#[derive(Debug, Clone, Copy)]
|
|
55
19
|
pub(crate) enum PiSessionSelector<'a> {
|
|
56
20
|
Fresh { session_id: &'a str },
|
|
@@ -62,7 +26,6 @@ pub(crate) struct PiCommandRequest<'a> {
|
|
|
62
26
|
pub model: Option<&'a str>,
|
|
63
27
|
pub effort: Option<ProviderEffort>,
|
|
64
28
|
pub system_prompt: &'a str,
|
|
65
|
-
pub tool_categories: &'a [&'a str],
|
|
66
29
|
/// Team-owned session root for isolated seats; `None` preserves Pi's native default.
|
|
67
30
|
pub session_dir: Option<&'a Path>,
|
|
68
31
|
pub session: PiSessionSelector<'a>,
|
|
@@ -72,7 +35,7 @@ pub(crate) struct PiCommandRequest<'a> {
|
|
|
72
35
|
/// ---
|
|
73
36
|
/// purpose: 从已验证 semantic request 构造仅追加 Team Agent MCP/提示/session 的 Pi argv
|
|
74
37
|
/// returns: exact ordered fresh/resume argv,argv[0] 固定为裸 `pi`
|
|
75
|
-
/// errors:
|
|
38
|
+
/// errors: 必需字段时返回 ProviderError
|
|
76
39
|
/// ---
|
|
77
40
|
pub(crate) fn build_pi_command_argv(
|
|
78
41
|
request: PiCommandRequest<'_>,
|
|
@@ -90,24 +53,6 @@ pub(crate) fn build_pi_command_argv(
|
|
|
90
53
|
));
|
|
91
54
|
}
|
|
92
55
|
|
|
93
|
-
let mut has_mcp = false;
|
|
94
|
-
for category in request.tool_categories {
|
|
95
|
-
match pi_tool_mapping(category) {
|
|
96
|
-
PiToolMapping::Mcp => has_mcp = true,
|
|
97
|
-
PiToolMapping::Builtin(_) => {}
|
|
98
|
-
PiToolMapping::Unsupported => {
|
|
99
|
-
return Err(ProviderError::Command(format!(
|
|
100
|
-
"Pi does not support Team Agent tool category {category:?}"
|
|
101
|
-
)));
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
if !has_mcp {
|
|
106
|
-
return Err(ProviderError::Command(
|
|
107
|
-
"Pi command requires mcp_team".to_string(),
|
|
108
|
-
));
|
|
109
|
-
}
|
|
110
|
-
|
|
111
56
|
// Executable discovery/preflight belongs to the lifecycle materializer;
|
|
112
57
|
// the actual command must remain PATH-resolved at spawn time.
|
|
113
58
|
let mut argv = vec![
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
//! - grok → `--always-approve`
|
|
12
12
|
//! - cursor_agent → `--force`
|
|
13
13
|
//!
|
|
14
|
-
//! 未定义(返回 None)的 provider:调用侧必须 fail-loud
|
|
15
|
-
//! `resolved_tool_strings_for_command`),不得静默 fallback。
|
|
14
|
+
//! 未定义(返回 None)的 provider:调用侧必须 fail-loud,不得静默 fallback。
|
|
16
15
|
|
|
17
16
|
use crate::model::enums::Provider;
|
|
18
17
|
|
|
@@ -1607,13 +1607,13 @@ pub(crate) mod test_support {
|
|
|
1607
1607
|
))
|
|
1608
1608
|
}
|
|
1609
1609
|
|
|
1610
|
-
fn
|
|
1610
|
+
fn build_command_with_permissions(
|
|
1611
1611
|
&self,
|
|
1612
1612
|
_auth_mode: crate::provider::AuthMode,
|
|
1613
1613
|
_mcp_config: Option<&crate::provider::McpConfig>,
|
|
1614
1614
|
_system_prompt: Option<&str>,
|
|
1615
1615
|
_model: Option<&str>,
|
|
1616
|
-
|
|
1616
|
+
_dangerously_skip_permissions: bool,
|
|
1617
1617
|
) -> Result<Vec<String>, ProviderError> {
|
|
1618
1618
|
Err(ProviderError::CapabilityUnsupported(
|
|
1619
1619
|
"test adapter".to_string(),
|
|
@@ -1683,7 +1683,7 @@ pub(crate) mod test_support {
|
|
|
1683
1683
|
_mcp_config: Option<&crate::provider::McpConfig>,
|
|
1684
1684
|
_system_prompt: Option<&str>,
|
|
1685
1685
|
_model: Option<&str>,
|
|
1686
|
-
|
|
1686
|
+
_dangerously_skip_permissions: bool,
|
|
1687
1687
|
) -> Result<Vec<String>, ProviderError> {
|
|
1688
1688
|
Err(ProviderError::CapabilityUnsupported(
|
|
1689
1689
|
"test adapter".to_string(),
|
|
@@ -1708,7 +1708,7 @@ pub(crate) mod test_support {
|
|
|
1708
1708
|
_mcp_config: Option<&crate::provider::McpConfig>,
|
|
1709
1709
|
_system_prompt: Option<&str>,
|
|
1710
1710
|
_model: Option<&str>,
|
|
1711
|
-
|
|
1711
|
+
_dangerously_skip_permissions: bool,
|
|
1712
1712
|
) -> Result<Vec<String>, ProviderError> {
|
|
1713
1713
|
Err(ProviderError::CapabilityUnsupported(
|
|
1714
1714
|
"test adapter".to_string(),
|
|
@@ -286,12 +286,12 @@ fn test_grok_build_command_includes_rules_flag_when_system_prompt_set() {
|
|
|
286
286
|
fn test_grok_build_command_bypass_flag_when_dangerous() {
|
|
287
287
|
let adapter = get_adapter(Provider::Grok);
|
|
288
288
|
let dangerous = adapter
|
|
289
|
-
.
|
|
289
|
+
.build_command_with_permissions(
|
|
290
290
|
AuthMode::Subscription,
|
|
291
291
|
None,
|
|
292
292
|
None,
|
|
293
293
|
Some("grok-4"),
|
|
294
|
-
|
|
294
|
+
true,
|
|
295
295
|
)
|
|
296
296
|
.expect("dangerous build_command ok");
|
|
297
297
|
assert!(
|
|
@@ -369,12 +369,12 @@ fn test_cursor_agent_build_command_includes_workspace_flag() {
|
|
|
369
369
|
fn test_cursor_agent_build_command_bypass_flag_when_dangerous() {
|
|
370
370
|
let adapter = get_adapter(Provider::CursorAgent);
|
|
371
371
|
let dangerous = adapter
|
|
372
|
-
.
|
|
372
|
+
.build_command_with_permissions(
|
|
373
373
|
AuthMode::Subscription,
|
|
374
374
|
None,
|
|
375
375
|
None,
|
|
376
376
|
None,
|
|
377
|
-
|
|
377
|
+
true,
|
|
378
378
|
)
|
|
379
379
|
.expect("dangerous build_command ok");
|
|
380
380
|
assert!(
|
|
@@ -443,7 +443,7 @@ fn test_grok_build_command_plan_binds_expected_session_id_to_argv() {
|
|
|
443
443
|
mcp_config: None,
|
|
444
444
|
system_prompt: None,
|
|
445
445
|
model: Some("grok-4.6"),
|
|
446
|
-
|
|
446
|
+
dangerously_skip_permissions: false,
|
|
447
447
|
profile_launch: None,
|
|
448
448
|
agent_id_hint: Some("w1"),
|
|
449
449
|
effort: None,
|
|
@@ -492,7 +492,7 @@ fn test_cursor_fresh_plan_has_no_session_id_and_no_resume() {
|
|
|
492
492
|
mcp_config: None,
|
|
493
493
|
system_prompt: None,
|
|
494
494
|
model: Some("sonnet-4-thinking"),
|
|
495
|
-
|
|
495
|
+
dangerously_skip_permissions: false,
|
|
496
496
|
profile_launch: None,
|
|
497
497
|
agent_id_hint: Some("w1"),
|
|
498
498
|
effort: None,
|
|
@@ -523,7 +523,7 @@ fn test_cursor_resume_plan_requires_chat_id_and_never_emits_empty_resume() {
|
|
|
523
523
|
mcp_config: None,
|
|
524
524
|
system_prompt: None,
|
|
525
525
|
model: Some("sonnet-4-thinking"),
|
|
526
|
-
|
|
526
|
+
dangerously_skip_permissions: false,
|
|
527
527
|
profile_launch: None,
|
|
528
528
|
agent_id_hint: Some("w1"),
|
|
529
529
|
effort: None,
|
|
@@ -549,23 +549,6 @@ fn test_cursor_resume_plan_requires_chat_id_and_never_emits_empty_resume() {
|
|
|
549
549
|
);
|
|
550
550
|
}
|
|
551
551
|
|
|
552
|
-
#[test]
|
|
553
|
-
fn test_grok_unknown_tool_mapping_is_explicitly_unsupported() {
|
|
554
|
-
use crate::provider::adapters::grok::{grok_tool_mapping, GrokToolMapping};
|
|
555
|
-
assert_eq!(
|
|
556
|
-
grok_tool_mapping("network"),
|
|
557
|
-
GrokToolMapping::Unsupported
|
|
558
|
-
);
|
|
559
|
-
assert_eq!(
|
|
560
|
-
grok_tool_mapping("not_a_real_tool"),
|
|
561
|
-
GrokToolMapping::Unsupported
|
|
562
|
-
);
|
|
563
|
-
assert!(
|
|
564
|
-
!matches!(grok_tool_mapping("execute_bash"), GrokToolMapping::Unsupported),
|
|
565
|
-
"known tools must stay mapped"
|
|
566
|
-
);
|
|
567
|
-
}
|
|
568
|
-
|
|
569
552
|
#[test]
|
|
570
553
|
fn pi_wire_roundtrip_requires_backing_and_has_no_builtin_model() {
|
|
571
554
|
use crate::provider::wire::{
|
|
@@ -341,7 +341,7 @@ pub struct ProviderCommandContext<'a> {
|
|
|
341
341
|
pub mcp_config: Option<&'a McpConfig>,
|
|
342
342
|
pub system_prompt: Option<&'a str>,
|
|
343
343
|
pub model: Option<&'a str>,
|
|
344
|
-
pub
|
|
344
|
+
pub dangerously_skip_permissions: bool,
|
|
345
345
|
pub profile_launch: Option<&'a ProviderProfileLaunch>,
|
|
346
346
|
/// Optional agent id, used as a launch-time display-name hint for
|
|
347
347
|
/// providers that accept `--name <name>` (Claude, Copilot). Codex has
|
|
@@ -157,7 +157,7 @@ fn errno_name(errno: Option<i32>) -> Option<&'static str> {
|
|
|
157
157
|
/// semantic mapping. The Batch 0 non-Unix `not_yet_implemented`
|
|
158
158
|
/// fallback is now removed (CR C-2 fallback burn-down; grep guard
|
|
159
159
|
/// `platform_fallback_burndown_batch0.rs` flipped in this batch).
|
|
160
|
-
struct RuntimeLock {
|
|
160
|
+
pub(crate) struct RuntimeLock {
|
|
161
161
|
#[allow(dead_code)]
|
|
162
162
|
file: std::fs::File,
|
|
163
163
|
}
|
|
@@ -204,6 +204,20 @@ impl Drop for RuntimeLock {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
pub(crate) fn acquire_result_collection_lock(
|
|
208
|
+
run_workspace: &Path,
|
|
209
|
+
) -> Result<RuntimeLock, StateError> {
|
|
210
|
+
RuntimeLock::acquire(run_workspace, "result-collection", 2.0)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
#[cfg(test)]
|
|
214
|
+
pub(crate) fn acquire_state_save_lock(
|
|
215
|
+
workspace: &Path,
|
|
216
|
+
timeout: f64,
|
|
217
|
+
) -> Result<RuntimeLock, StateError> {
|
|
218
|
+
RuntimeLock::acquire(workspace, "state-save", timeout)
|
|
219
|
+
}
|
|
220
|
+
|
|
207
221
|
///
|
|
208
222
|
/// `save_runtime_state`(bug-084)。`state` 是 state.json 的内存 Value(插入序保留)。
|
|
209
223
|
/// 注:Python 在此还调 `_migrate_state_identity`(identity slice 落地后接入;本 slice 不改 state 内容)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@team-agent/installer",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.86",
|
|
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.86",
|
|
24
|
+
"@team-agent/cli-darwin-x64": "0.5.86",
|
|
25
|
+
"@team-agent/cli-linux-x64": "0.5.86"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"postinstall": "node npm/bincheck.mjs",
|
package/schemas/team.schema.json
CHANGED
|
@@ -108,14 +108,14 @@
|
|
|
108
108
|
"$defs": {
|
|
109
109
|
"leader": {
|
|
110
110
|
"type": "object",
|
|
111
|
-
"required": ["id", "role", "provider", "model", "
|
|
111
|
+
"required": ["id", "role", "provider", "model", "context_policy"],
|
|
112
112
|
"additionalProperties": false,
|
|
113
113
|
"properties": {
|
|
114
114
|
"id": { "type": "string", "minLength": 1 },
|
|
115
115
|
"role": { "type": "string", "minLength": 1 },
|
|
116
116
|
"provider": { "type": "string", "minLength": 1 },
|
|
117
117
|
"model": { "type": ["string", "null"] },
|
|
118
|
-
"tools": {
|
|
118
|
+
"tools": {},
|
|
119
119
|
"context_policy": {
|
|
120
120
|
"type": "object",
|
|
121
121
|
"required": ["keep_user_thread", "receive_worker_outputs", "max_worker_result_tokens"],
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
},
|
|
131
131
|
"agent": {
|
|
132
132
|
"type": "object",
|
|
133
|
-
"required": ["id", "role", "provider", "model", "working_directory", "system_prompt", "
|
|
133
|
+
"required": ["id", "role", "provider", "model", "working_directory", "system_prompt", "permission_mode", "preferred_for", "avoid_for", "output_contract"],
|
|
134
134
|
"additionalProperties": false,
|
|
135
135
|
"properties": {
|
|
136
136
|
"id": { "type": "string", "minLength": 1 },
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"file": { "type": ["string", "null"] }
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
|
-
"tools": {
|
|
155
|
+
"tools": {},
|
|
156
156
|
"permission_mode": { "enum": ["restricted", "ask", "trusted"] },
|
|
157
157
|
"preferred_for": {
|
|
158
158
|
"type": "array",
|
|
@@ -233,11 +233,6 @@
|
|
|
233
233
|
"human_confirmation": { "type": "boolean" }
|
|
234
234
|
}
|
|
235
235
|
},
|
|
236
|
-
"tools": {
|
|
237
|
-
"type": "array",
|
|
238
|
-
"items": { "type": "string" },
|
|
239
|
-
"uniqueItems": true
|
|
240
|
-
},
|
|
241
236
|
"stringOrList": {
|
|
242
237
|
"oneOf": [
|
|
243
238
|
{ "type": "string" },
|