agentschat-mcp 0.36.23 → 0.36.25

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.
@@ -340,12 +340,19 @@ export function detectRuntimeSession(
340
340
  return { sessionId: explicitSid, runtime: "custom" };
341
341
  }
342
342
 
343
- // 6. Antigravity parent language_server discovery (macOS & Linux)
344
- if (
345
- env === process.env ||
343
+ // 6. Antigravity parent language_server discovery (macOS & Linux).
344
+ // Skip expensive ps/lsof parent-tree probing when running against a loopback mock
345
+ // hub in tests with a stripped env (unless explicit Antigravity env vars are set).
346
+ const hasExplicitAgyEnv =
346
347
  env.__CFBundleIdentifier === "com.google.antigravity" ||
347
- Boolean(env.AGY_BROWSER_WS_URL)
348
- ) {
348
+ Boolean(env.AGY_BROWSER_WS_URL) ||
349
+ Boolean(env.ANTIGRAVITY_LS_ADDRESS) ||
350
+ Boolean(env.ANTIGRAVITY_CSRF_TOKEN);
351
+ const isMockHubSubprocess =
352
+ !hasExplicitAgyEnv &&
353
+ typeof env.AGENTCHAT_REST_URL === "string" &&
354
+ /^http:\/\/127\.0\.0\.1:\d+/.test(env.AGENTCHAT_REST_URL);
355
+ if (!isMockHubSubprocess && (env === process.env || hasExplicitAgyEnv)) {
349
356
  const agyHost = discoverAntigravityHost();
350
357
  if (agyHost && agyHost.openConversations.length === 1) {
351
358
  return { sessionId: agyHost.openConversations[0]!, runtime: "antigravity" };
@@ -441,6 +448,16 @@ export function discoverAntigravityHost(opts?: {
441
448
  .filter((s) => /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(s));
442
449
  return { lsPid: process.ppid, csrfToken: envCsrf, ports, openConversations };
443
450
  }
451
+ const hasExplicitAgyEnv =
452
+ process.env.__CFBundleIdentifier === "com.google.antigravity" ||
453
+ Boolean(process.env.AGY_BROWSER_WS_URL);
454
+ if (
455
+ !hasExplicitAgyEnv &&
456
+ typeof process.env.AGENTCHAT_REST_URL === "string" &&
457
+ /^http:\/\/127\.0\.0\.1:\d+/.test(process.env.AGENTCHAT_REST_URL)
458
+ ) {
459
+ return null;
460
+ }
444
461
  }
445
462
 
446
463
  const now = Date.now();
@@ -37,6 +37,7 @@ export const TOOL_ANNOTATIONS: Record<string, ToolAnnotation> = {
37
37
  react: W,
38
38
  thread_reply: W,
39
39
  pin: W,
40
+ list_pins: R,
40
41
  edit_message: W,
41
42
  delete_message: D,
42
43
  set_status: W,
@@ -56,6 +57,12 @@ export const TOOL_ANNOTATIONS: Record<string, ToolAnnotation> = {
56
57
  channel_brief: R,
57
58
  my_entitlements: R,
58
59
  list_loops: R,
60
+ create_loop: W,
61
+ pause_loop: W,
62
+ resume_loop: W,
63
+ set_loop_interval: W,
64
+ stop_loop: D,
65
+ cloud_agent_wake_health: R,
59
66
  list_skills: R,
60
67
  list_tool_groups: R,
61
68
 
@@ -69,6 +76,7 @@ export const TOOL_ANNOTATIONS: Record<string, ToolAnnotation> = {
69
76
  list_my_moderation_history: R,
70
77
 
71
78
  // ── proposals / votes ──
79
+ list_proposals: R,
72
80
  propose: W,
73
81
  vote: W,
74
82
 
@@ -78,6 +86,7 @@ export const TOOL_ANNOTATIONS: Record<string, ToolAnnotation> = {
78
86
  sync_skill: R,
79
87
  load_memory: R,
80
88
  save_memory: W,
89
+ delete_memory: D,
81
90
  load_tool_group: R,
82
91
  invoke_extended_tool: W, // opaque dispatch — treat as write
83
92
 
@@ -91,12 +100,14 @@ export const TOOL_ANNOTATIONS: Record<string, ToolAnnotation> = {
91
100
  // ── OKR / DAG ──
92
101
  okr_list: R,
93
102
  okr_create_objective: W,
103
+ okr_update_objective: W,
94
104
  okr_add_task: W,
95
105
  okr_update_task: W,
96
106
  okr_task_blockers: R,
97
107
  okr_task_blocks: R,
98
108
  okr_open_thread: W,
99
109
  okr_add_kr: W,
110
+ okr_update_kr: W,
100
111
  archive_objective: W,
101
112
  unarchive_objective: W,
102
113
  okr_reparent_objective: W,
@@ -111,6 +122,7 @@ export const TOOL_ANNOTATIONS: Record<string, ToolAnnotation> = {
111
122
  list_channel_docs: R,
112
123
  get_channel_doc: R,
113
124
  upsert_channel_doc: W,
125
+ archive_channel_doc: W,
114
126
  list_channel_doc_revisions: R,
115
127
  };
116
128
 
package/src/wake.ts CHANGED
@@ -27,6 +27,21 @@ import { redactSecrets } from "./redact.ts";
27
27
 
28
28
  /** Signature header the receiver reads to verify a wake POST. */
29
29
  export const WAKE_SIG_HEADER = "x-agentschat-signature";
30
+ /** Header forwarded on authenticated REST calls when AGENTSCHAT_WAKE_ID is present. */
31
+ export const WAKE_ID_HEADER = "X-AgentsChat-Wake-Id";
32
+ const SAFE_WAKE_ID_RE = /^[a-zA-Z0-9_-]{1,128}$/;
33
+ const CREDENTIAL_PREFIX_RE = /^(ac_|sk-|sk_|ghp_|gho_|ghu_|ghs_|ghr_|github_pat_)/i;
34
+
35
+ /**
36
+ * Validate `AGENTSCHAT_WAKE_ID` injected by Cloud Sandbox per wake turn so
37
+ * stdio MCP REST calls (`okr_update_task`, `okr_add_task_comment`) carry
38
+ * explicit process-level wake correlation without ever echoing unsafe tokens.
39
+ */
40
+ export function resolveEnvWakeId(env: Record<string, string | undefined> = process.env): string | undefined {
41
+ const raw = env.AGENTSCHAT_WAKE_ID?.trim();
42
+ if (!raw || !SAFE_WAKE_ID_RE.test(raw) || CREDENTIAL_PREFIX_RE.test(raw)) return undefined;
43
+ return raw;
44
+ }
30
45
 
31
46
  /** Cap the content excerpt for generic HTTP wake webhooks so a long message doesn't balloon the POST body. */
32
47
  export const WAKE_CONTENT_MAX = 500;