@agentconnect.md/daemon 1.0.0-rc.269 → 1.0.0-rc.270

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.
@@ -3,9 +3,9 @@ import { n as require_ms, t as require_src$3 } from "./src-DDtlVutj.js";
3
3
  import { n as init_esm_shims, t as __dirname } from "./esm-shims-DxGcm4Hw.js";
4
4
  import { t as DAEMON_VERSION } from "./version-DGaRXjBK.js";
5
5
  import { C as _coercedNumber, T as NEVER, a as array, d as literal, f as looseObject, i as any, m as object, o as boolean, p as number$1, t as ZodNumber, v as string, x as url$4 } from "./schemas-CQkO9hC5.js";
6
- import { C as ZodIssueCode, S as RESERVED_MCP_SERVER_NAME, _ as buildEnvelope, a as agentChildEnv, b as MAX_FRAME_BYTES, c as persistRelays, d as normalizeGitUrl, f as RELAY_DAEMON_SUBPROTOCOL, g as SHARED_CONFIG_ACTION_ID, h as decodeRelayDaemonFrame, i as selectAgent, m as buildRelayDaemonFrame, n as findAgentFiles, o as loadConfig, p as RELAY_DAEMON_WS_PATH, r as loadAgents, s as persistDaemonId, v as decodeEnvelope, y as encode } from "./load-agents-BcaxKtWB.js";
6
+ import { C as ZodIssueCode, S as RESERVED_MCP_SERVER_NAME, _ as buildEnvelope, a as agentChildEnv, b as MAX_FRAME_BYTES, c as persistRelays, d as normalizeGitUrl, f as RELAY_DAEMON_SUBPROTOCOL, g as SHARED_CONFIG_ACTION_ID, h as decodeRelayDaemonFrame, i as selectAgent, m as buildRelayDaemonFrame, n as findAgentFiles, o as loadConfig, p as RELAY_DAEMON_WS_PATH, r as loadAgents, s as persistDaemonId, v as decodeEnvelope, y as encode } from "./load-agents-DhUBoDuc.js";
7
7
  import { l as resolveRoot, o as mcpSocketPath, u as statePath } from "./paths-DEcUO8lC.js";
8
- import { S as resolveRuntimes, _ as writeMemoryFile, a as initGitInjection, b as cachedRuntimeNames, c as simpleGit, d as memoryProviderFor, f as MemoryConflictError, g as resolveInMemoryDir, h as listMemory, i as prepareWorkspace, l as createMemoryProvider, m as MemoryTooLargeError, n as installedRuntimes, o as probeGitVersion, p as MemoryPathError, r as prefetchWorkspace, s as sessionGitEnv, t as AcpHost, u as memoryKindOf, v as MEMORY_TOOL_NAMES, x as cachedRuntimeVersions, y as toolsForIntegrations } from "./acp-host-htcdepjb.js";
8
+ import { S as resolveRuntimes, _ as writeMemoryFile, a as initGitInjection, b as cachedRuntimeNames, c as simpleGit, d as memoryProviderFor, f as MemoryConflictError, g as resolveInMemoryDir, h as listMemory, i as prepareWorkspace, l as createMemoryProvider, m as MemoryTooLargeError, n as installedRuntimes, o as probeGitVersion, p as MemoryPathError, r as prefetchWorkspace, s as sessionGitEnv, t as AcpHost, u as memoryKindOf, v as MEMORY_TOOL_NAMES, x as cachedRuntimeVersions, y as toolsForIntegrations } from "./acp-host-xCr--GKm.js";
9
9
  import { i as GitCredentialCache, n as gitcredSocketPath, r as writeGitcredShim, t as GitCredServer } from "./gitcred-server-CMC80O_1.js";
10
10
  import { B as ToolListChangedNotificationSchema, D as ListPromptsResultSchema, E as ListChangedOptionsBaseSchema, F as PromptListChangedNotificationSchema, G as isZ4Schema, H as isJSONRPCRequest, I as ReadResourceResultSchema, J as encodeFrame, K as safeParse, L as ResourceListChangedNotificationSchema, M as ListToolsResultSchema, O as ListResourceTemplatesResultSchema, P as McpError, R as SUPPORTED_PROTOCOL_VERSIONS, S as InitializeResultSchema, T as LATEST_PROTOCOL_VERSION, U as isJSONRPCResultResponse, V as isInitializedNotification, W as getObjectShape, _ as ElicitResultSchema, a as AjvJsonSchemaValidator, b as GetPromptResultSchema, c as mergeCapabilities, d as CompleteResultSchema, f as CreateMessageRequestSchema, g as ElicitRequestSchema, h as CreateTaskResultSchema, i as assertToolsCallTaskCapability, k as ListResourcesResultSchema, m as CreateMessageResultWithToolsSchema, n as serializeMessage, o as require_fast_deep_equal, p as CreateMessageResultSchema, q as decodeFrames, r as assertClientRequestTaskCapability, s as Protocol, t as ReadBuffer, u as CallToolResultSchema, v as EmptyResultSchema, w as JSONRPCMessageSchema, y as ErrorCode } from "./stdio-DnS8WcXi.js";
11
11
  import { URL as URL$1 } from "url";
@@ -4400,6 +4400,21 @@ var CpClient = class {
4400
4400
  if (rep.type !== "gitcred/grant") throw new WireError("INTERNAL", `expected gitcred/grant, got ${rep.type}`, false);
4401
4401
  return rep.payload;
4402
4402
  }
4403
+ /**
4404
+ * `channel/agents` (D→C REQ) → the channel's agent roster. The peer-discovery
4405
+ * half of agent collaboration: the daemon asks the CP (the only authority for
4406
+ * the full cross-daemon roster) who else is in a channel. State-GATED like
4407
+ * `requestGitCred` (outside READY/DRAINING it fails fast, never queues on a dead
4408
+ * socket). `requesterAgentId` is set by the caller from the trusted MCP session
4409
+ * context — the CP uses it for membership + call-policy filtering.
4410
+ */
4411
+ async channelAgents(payload) {
4412
+ if (this.state !== "READY" && this.state !== "DRAINING" || !this.transport) throw new WireError("INTERNAL", `control plane unreachable (client ${this.state})`, true);
4413
+ const frame = buildEnvelope("channel/agents", payload);
4414
+ const rep = await this.correlator.request(frame, (e) => this.transport.send(e));
4415
+ if (rep.type !== "channel/agents/ok") throw new WireError("INTERNAL", `expected channel/agents/ok, got ${rep.type}`, false);
4416
+ return rep.payload;
4417
+ }
4403
4418
  async onText(text) {
4404
4419
  const decoded = decodeEnvelope(text);
4405
4420
  if (!decoded.ok) {
@@ -6832,6 +6847,7 @@ var SessionManager = class {
6832
6847
  const cwd = await prepareWorkspace(agent);
6833
6848
  const mcpServers = this.deps.mcpServersFor?.({
6834
6849
  agent,
6850
+ platform: msg.platform,
6835
6851
  channel: msg.channel,
6836
6852
  thread
6837
6853
  }) ?? [];
@@ -6854,6 +6870,7 @@ var SessionManager = class {
6854
6870
  const cwd = await prepareWorkspace(agent);
6855
6871
  const mcpServers = this.deps.mcpServersFor?.({
6856
6872
  agent,
6873
+ platform: msg.platform,
6857
6874
  channel: msg.channel,
6858
6875
  thread
6859
6876
  }) ?? [];
@@ -7086,6 +7103,19 @@ async function executeTool(ctx, name, args, deps) {
7086
7103
  throw err;
7087
7104
  }
7088
7105
  }
7106
+ if (name === "listChannelAgents") {
7107
+ const channel = optionalString(args, "channel") ?? ctx.channel;
7108
+ const res = await deps.channelAgents({
7109
+ platform: ctx.platform,
7110
+ channel,
7111
+ requesterAgentId: ctx.agentId
7112
+ });
7113
+ return {
7114
+ platform: res.platform,
7115
+ channel: res.channel,
7116
+ agents: res.agents
7117
+ };
7118
+ }
7089
7119
  const gw = ctx.integrationId ? deps.gatewayFor(ctx.integrationId) : void 0;
7090
7120
  if (!gw) throw new Error(`no live platform connection for integration ${ctx.integrationId ?? "(none)"}`);
7091
7121
  switch (name) {
@@ -213826,6 +213856,11 @@ var Daemon = class Daemon {
213826
213856
  log: this.log,
213827
213857
  now: () => Date.now(),
213828
213858
  gatewayFor: (integrationId) => this.connByIntegration.get(integrationId) ?? this.tgConnByIntegration.get(integrationId) ?? this.dcConnByIntegration.get(integrationId),
213859
+ channelAgents: (req) => {
213860
+ const client = this.cpClient;
213861
+ if (!client) throw Object.assign(/* @__PURE__ */ new Error("control plane is not connected"), { code: "INTERNAL" });
213862
+ return client.channelAgents(req);
213863
+ },
213829
213864
  memory: this.memory,
213830
213865
  recordOutbound: (ctx, channel, thread, text, ts) => this.store.appendTranscript({
213831
213866
  channel,
@@ -213844,7 +213879,7 @@ var Daemon = class Daemon {
213844
213879
  hostFor: (agentId) => this.ensureHostAsync(agentId),
213845
213880
  agentById: (id) => this.agents.get(id),
213846
213881
  memory: this.memory,
213847
- mcpServersFor: ({ agent, channel, thread }) => {
213882
+ mcpServersFor: ({ agent, platform, channel, thread }) => {
213848
213883
  const servers = [];
213849
213884
  let tools = toolsForIntegrations(agent.integrations);
213850
213885
  if (memoryKindOf(agent) === "native") tools = tools.filter((t) => !MEMORY_TOOL_NAMES.has(t.name));
@@ -213852,6 +213887,7 @@ var Daemon = class Daemon {
213852
213887
  if (tools.length > 0) {
213853
213888
  const token = this.mcp.register({
213854
213889
  agentId: agent.id,
213890
+ platform,
213855
213891
  ...integrationId ? { integrationId } : {},
213856
213892
  channel,
213857
213893
  thread,
@@ -216646,4 +216682,4 @@ async function runForeground(opts, deps = {}) {
216646
216682
  //#endregion
216647
216683
  export { ClientTransport as i, CP_SUBPROTOCOL as n, CP_WS_PATH as r, runForeground as t };
216648
216684
 
216649
- //# sourceMappingURL=run-foreground-9ZCCs2Tm.js.map
216685
+ //# sourceMappingURL=run-foreground-BQ2MBshl.js.map