@team-agent/installer 0.5.48 → 0.5.50

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.
@@ -417,21 +417,6 @@ fn tool_properties(tool: McpTool) -> serde_json::Map<String, Value> {
417
417
  string_property("Target agent id, 'leader', or '*' for broadcast."),
418
418
  );
419
419
  insert_property(&mut properties, "content", string_property("Message body."));
420
- insert_property(
421
- &mut properties,
422
- "task_id",
423
- string_property("Optional task id to associate with the message."),
424
- );
425
- insert_property(
426
- &mut properties,
427
- "sender",
428
- string_property("Optional sender override."),
429
- );
430
- insert_property(
431
- &mut properties,
432
- "requires_ack",
433
- boolean_property("Whether the recipient should acknowledge delivery."),
434
- );
435
420
  }
436
421
  McpTool::ReportResult => {
437
422
  insert_property(
@@ -609,9 +594,8 @@ pub(crate) fn dispatch_tool(
609
594
  let outcome = tools.send_message(
610
595
  &target,
611
596
  content,
612
- args.get("task_id").and_then(Value::as_str),
613
- args.get("sender").and_then(Value::as_str),
614
- args.get("requires_ack").and_then(Value::as_bool),
597
+ None,
598
+ None,
615
599
  None,
616
600
  )?;
617
601
  match outcome {
@@ -96,6 +96,7 @@ pub use scheduler::{detect_stuck_agents, fire_due_scheduled_events, stuck_cancel
96
96
  pub use selftest::{evaluate_idle_behavior, run_comms_selftest, CommsSelftestDriver};
97
97
  pub use send::{
98
98
  apply_worker_sender_bypass, send_message, session_drift_refusal, MessageTarget, SendOptions,
99
+ TrustedSender,
99
100
  };
100
101
  pub use trust::{attempt_trust_auto_answer, TrustAnswerOutcome};
101
102
  pub use types::{
@@ -5,7 +5,7 @@ use std::path::Path;
5
5
  use crate::coordinator::{CoordinatorHealthStatus, WorkspacePath};
6
6
  use crate::event_log::EventLog;
7
7
  use crate::model::enums::PaneLiveness;
8
- use crate::model::ids::{TaskId, TeamKey};
8
+ use crate::model::ids::{AgentId, TaskId, TeamKey};
9
9
  use crate::transport::{PaneId, Transport};
10
10
 
11
11
  use super::helpers::{status_wire, MessageStatusShadow};
@@ -23,6 +23,29 @@ pub enum MessageTarget {
23
23
  Fanout(Vec<String>),
24
24
  }
25
25
 
26
+ /// Sender identity captured from a framework-owned runtime context.
27
+ ///
28
+ /// Public CLI/MCP inputs never construct this value from a caller-supplied
29
+ /// string. The wrapper keeps that trust boundary visible throughout delivery
30
+ /// instead of degrading the identity back to an untyped option field.
31
+ #[derive(Debug, Clone, PartialEq, Eq, serde::Serialize)]
32
+ #[serde(transparent)]
33
+ pub struct TrustedSender(AgentId);
34
+
35
+ impl TrustedSender {
36
+ pub fn from_runtime_identity(agent_id: AgentId) -> Self {
37
+ Self(agent_id)
38
+ }
39
+
40
+ pub fn leader() -> Self {
41
+ Self(AgentId::new("leader"))
42
+ }
43
+
44
+ pub fn as_str(&self) -> &str {
45
+ self.0.as_str()
46
+ }
47
+ }
48
+
26
49
  /// `send_message` 选项 (`send.py:36`:Python 大量默认参数 → typed 选项 struct)。
27
50
  #[derive(Debug, Clone)]
28
51
  pub struct SendOptions {
@@ -31,7 +54,7 @@ pub struct SendOptions {
31
54
  /// `task_id` 当真任务校验/路由。**投递/fanout/internal/coordinator** 路径传 `false`
32
55
  /// (`internal_delivery.py:44`、`send.py:412/481`),此时 `task_id` 只是标签,**不校验 state.tasks**。
33
56
  pub route_task_id: bool,
34
- pub sender: String,
57
+ pub sender: TrustedSender,
35
58
  pub requires_ack: bool,
36
59
  pub confirm_human: bool,
37
60
  pub wait_visible: bool,
@@ -52,7 +75,7 @@ impl Default for SendOptions {
52
75
  Self {
53
76
  task_id: None,
54
77
  route_task_id: true,
55
- sender: "leader".to_string(),
78
+ sender: TrustedSender::leader(),
56
79
  requires_ack: true,
57
80
  confirm_human: false,
58
81
  wait_visible: true,
@@ -95,7 +118,7 @@ pub fn send_message(
95
118
  "leader",
96
119
  content,
97
120
  opts.task_id.as_ref(),
98
- &opts.sender,
121
+ opts.sender.as_str(),
99
122
  opts.requires_ack,
100
123
  None,
101
124
  opts.message_id.as_deref(),
@@ -119,7 +142,7 @@ pub fn send_message(
119
142
  }
120
143
  MessageTarget::Single(target) => target,
121
144
  MessageTarget::Broadcast => {
122
- let recipients = broadcast_recipients(&state, &opts.sender, opts.team.as_ref());
145
+ let recipients = broadcast_recipients(&state, opts.sender.as_str(), opts.team.as_ref());
123
146
  return fanout_send(
124
147
  workspace,
125
148
  &state,
@@ -163,13 +186,13 @@ pub fn send_message(
163
186
  &state,
164
187
  recipient,
165
188
  "leader",
166
- &opts.sender,
189
+ opts.sender.as_str(),
167
190
  opts.task_id.as_ref(),
168
191
  &event_log,
169
192
  )? {
170
193
  return Ok(outcome);
171
194
  }
172
- if let Some(outcome) = send_owner_gate_refusal(workspace, &state, &opts.sender)? {
195
+ if let Some(outcome) = send_owner_gate_refusal(workspace, &state, opts.sender.as_str())? {
173
196
  return Ok(outcome);
174
197
  }
175
198
  if opts.route_task_id {
@@ -206,7 +229,7 @@ pub fn send_message(
206
229
  store.create_message_with_id(
207
230
  requested,
208
231
  task_id,
209
- &opts.sender,
232
+ opts.sender.as_str(),
210
233
  recipient,
211
234
  content,
212
235
  None,
@@ -216,7 +239,7 @@ pub fn send_message(
216
239
  } else {
217
240
  store.create_message(
218
241
  task_id,
219
- &opts.sender,
242
+ opts.sender.as_str(),
220
243
  recipient,
221
244
  content,
222
245
  None,
@@ -690,7 +713,7 @@ fn fanout_send(
690
713
  let mut delivered_count = 0usize;
691
714
  let mut attempted_count = 0usize;
692
715
  for recipient in recipients {
693
- if recipient.is_empty() || recipient == &opts.sender {
716
+ if recipient.is_empty() || recipient == opts.sender.as_str() {
694
717
  continue;
695
718
  }
696
719
  attempted_count = attempted_count.saturating_add(1);
@@ -701,7 +724,7 @@ fn fanout_send(
701
724
  recipient,
702
725
  content,
703
726
  opts.task_id.as_ref(),
704
- &opts.sender,
727
+ opts.sender.as_str(),
705
728
  opts.requires_ack,
706
729
  None,
707
730
  event_log,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-agent/installer",
3
- "version": "0.5.48",
3
+ "version": "0.5.50",
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.48",
24
- "@team-agent/cli-darwin-x64": "0.5.48",
25
- "@team-agent/cli-linux-x64": "0.5.48"
23
+ "@team-agent/cli-darwin-arm64": "0.5.50",
24
+ "@team-agent/cli-darwin-x64": "0.5.50",
25
+ "@team-agent/cli-linux-x64": "0.5.50"
26
26
  },
27
27
  "scripts": {
28
28
  "postinstall": "node npm/bincheck.mjs",