@agentconnect.md/daemon 1.0.0-rc.343 → 1.0.0-rc.345

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,10 +3,10 @@ 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 { _ as RESERVED_MCP_SERVER_NAME, a as RELAY_DAEMON_WS_PATH, c as SHARED_CONFIG_ACTION_ID, d as encode, f as MAX_FRAME_BYTES, h as HookReport, i as RELAY_DAEMON_SUBPROTOCOL, l as buildEnvelope, n as gitRepoLabel, o as buildRelayDaemonFrame, r as normalizeGitUrl, s as decodeRelayDaemonFrame, u as decodeEnvelope, v as ZodIssueCode } from "./dist-MrCr7fl1.js";
7
- import { a as agentChildEnv, c as persistRelays, i as selectAgent, n as findAgentFiles, o as loadConfig, r as loadAgents, s as persistDaemonId } from "./load-agents-BAQcjcVh.js";
6
+ import { _ as HookReport, a as RELAY_DAEMON_WS_PATH, b as ZodIssueCode, c as SHARED_CONFIG_ACTION_ID, d as buildEnvelope, f as decodeEnvelope, i as RELAY_DAEMON_SUBPROTOCOL, l as SLACK_STATUS_ACTION, m as MAX_FRAME_BYTES, n as gitRepoLabel, o as buildRelayDaemonFrame, p as encode, r as normalizeGitUrl, s as decodeRelayDaemonFrame, u as encodeSharedSlackStatusTarget, y as RESERVED_MCP_SERVER_NAME } from "./dist-CUolJeCB.js";
7
+ import { a as agentChildEnv, c as persistRelays, i as selectAgent, n as findAgentFiles, o as loadConfig, r as loadAgents, s as persistDaemonId } from "./load-agents-DnGX_xbK.js";
8
8
  import { l as resolveRoot, o as mcpSocketPath, u as statePath } from "./paths-DEcUO8lC.js";
9
- import { C as toolsForIntegrations, E as resolveRuntimes, S as MEMORY_TOOL_NAMES, T as cachedRuntimeVersions, _ as listMemory, a as prefetchWorkspace, b as ALL_TOOL_NAMES, c as probeGitVersion, d as createMemoryProvider, f as memoryKindOf, g as MemoryTooLargeError, h as MemoryPathError, i as installedRuntimes, l as sessionGitEnv, m as MemoryConflictError, n as turnFailureCode, o as prepareWorkspace, p as memoryProviderFor, r as turnFailureReason, s as initGitInjection, t as AcpHost, u as simpleGit, v as resolveInMemoryDir, w as cachedRuntimeNames, x as GITHUB_REVIEW_TOOLS, y as writeMemoryFile } from "./acp-host-rssqAAfr.js";
9
+ import { C as toolsForIntegrations, E as resolveRuntimes, S as MEMORY_TOOL_NAMES, T as cachedRuntimeVersions, _ as listMemory, a as prefetchWorkspace, b as ALL_TOOL_NAMES, c as probeGitVersion, d as createMemoryProvider, f as memoryKindOf, g as MemoryTooLargeError, h as MemoryPathError, i as installedRuntimes, l as sessionGitEnv, m as MemoryConflictError, n as turnFailureCode, o as prepareWorkspace, p as memoryProviderFor, r as turnFailureReason, s as initGitInjection, t as AcpHost, u as simpleGit, v as resolveInMemoryDir, w as cachedRuntimeNames, x as GITHUB_REVIEW_TOOLS, y as writeMemoryFile } from "./acp-host-DRUQVPb2.js";
10
10
  import { i as GitCredentialCache, n as gitcredSocketPath, r as writeGitcredShim, t as GitCredServer } from "./gitcred-server-Bu-Svl7L.js";
11
11
  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";
12
12
  import { createRequire } from "node:module";
@@ -68195,7 +68195,7 @@ function attributionMrkdwn(info) {
68195
68195
  const model = escapeMrkdwnLabel(info.model);
68196
68196
  return `sent by <${info.botUrl}|${botName}> (${runtime} · ${model}) · <${info.sessionUrl}|open in session>`;
68197
68197
  }
68198
- /** The classic per-turn footer is a compact secondary/gray Slack `context` block. */
68198
+ /** The per-turn footer is a compact secondary/gray Slack `context` block. */
68199
68199
  function attributionBlocks(info) {
68200
68200
  return {
68201
68201
  text: attributionText(info),
@@ -68208,29 +68208,6 @@ function attributionBlocks(info) {
68208
68208
  }]
68209
68209
  };
68210
68210
  }
68211
- /** The shared-bot variant uses the same text but a `section`, because only sections take
68212
- * the config button accessory. The click lands on the relay (it owns Socket Mode). */
68213
- function sharedFooterBlocks(info) {
68214
- return {
68215
- text: attributionText(info),
68216
- blocks: [{
68217
- type: "section",
68218
- text: {
68219
- type: "mrkdwn",
68220
- text: attributionMrkdwn(info)
68221
- },
68222
- accessory: {
68223
- type: "button",
68224
- text: {
68225
- type: "plain_text",
68226
- text: "👤",
68227
- emoji: true
68228
- },
68229
- action_id: SHARED_CONFIG_ACTION_ID
68230
- }
68231
- }]
68232
- };
68233
- }
68234
68211
  /** Pull human-readable output text out of an ACP tool_call/_update. Prefers the `content[]`
68235
68212
  * text blocks (the tool's reported output); falls back to a string `rawOutput`. diff /
68236
68213
  * terminal blocks and non-string rawOutput are skipped — they have no compact inline text. */
@@ -68288,18 +68265,9 @@ function renderStatusBar(info) {
68288
68265
  if (info.totalTokens !== void 0) parts.push(`${compactCount$2(info.totalTokens)} tok`);
68289
68266
  return `:bar_chart: ${parts.length ? parts.join(" · ") : "—"}`;
68290
68267
  }
68291
- /** Slack action_ids for the interactive status bar + modal (matched by the connection's
68292
- * handlers). Kept here so the builders and the handlers can't drift apart. */
68293
- const STATUS_ACTION = {
68294
- manage: "ac_manage",
68295
- setModel: "ac_set_model",
68296
- setEffort: "ac_set_effort",
68297
- setPermissionMode: "ac_set_permission_mode",
68298
- setFast: "ac_set_fast",
68299
- setOutput: "ac_set_output",
68300
- cancel: "ac_cancel",
68301
- view: "ac_view"
68302
- };
68268
+ /** Slack action_ids for the interactive status bar + modal. The protocol owns the
68269
+ * values because a shared bot receives the same actions on the relay first. */
68270
+ const STATUS_ACTION = SLACK_STATUS_ACTION;
68303
68271
  /** The modal view's callback_id — used if we ever handle a submit (controls apply on
68304
68272
  * interaction today, so there's no submit). */
68305
68273
  const STATUS_MODAL_CALLBACK = "ac_status_modal";
@@ -68486,16 +68454,47 @@ function buildElicitationResolvedCard(params, decision) {
68486
68454
  }
68487
68455
  }];
68488
68456
  }
68489
- /** Build the compact in-thread status message as one Slack row: status text with an
68490
- * inline View Session URL, plus one Configure accessory button. Slack sections allow
68491
- * only one accessory, and mrkdwn links cannot dispatch block_actions, so Cancel stays in
68492
- * the Configure modal rather than becoming a non-functional inline link. */
68493
- function buildStatusBlocks(info, sessionKey, link) {
68457
+ /** Build the compact in-thread status message. Dedicated bots retain the single
68458
+ * Configure accessory. A shared bot needs two independent controls, so its status
68459
+ * message uses one `actions` block: 👤 opens the relay's channel-agent picker and ⚙️
68460
+ * opens the daemon's existing session controls. Both buttons stay on the same row. */
68461
+ function buildStatusBlocks(info, sessionKey, link, shared) {
68462
+ const text = link ? `${renderStatusBar(info)} · <${link}|View Session>` : renderStatusBar(info);
68463
+ if (shared) return [{
68464
+ type: "section",
68465
+ text: {
68466
+ type: "mrkdwn",
68467
+ text
68468
+ }
68469
+ }, {
68470
+ type: "actions",
68471
+ elements: [{
68472
+ type: "button",
68473
+ action_id: SHARED_CONFIG_ACTION_ID,
68474
+ text: {
68475
+ type: "plain_text",
68476
+ text: "👤",
68477
+ emoji: true
68478
+ },
68479
+ accessibility_label: "Switch agent",
68480
+ value: sessionKey
68481
+ }, {
68482
+ type: "button",
68483
+ action_id: STATUS_ACTION.manage,
68484
+ text: {
68485
+ type: "plain_text",
68486
+ text: "⚙️",
68487
+ emoji: true
68488
+ },
68489
+ accessibility_label: "Configure agent session",
68490
+ value: shared.sessionTarget
68491
+ }]
68492
+ }];
68494
68493
  return [{
68495
68494
  type: "section",
68496
68495
  text: {
68497
68496
  type: "mrkdwn",
68498
- text: link ? `${renderStatusBar(info)} · <${link}|View Session>` : renderStatusBar(info)
68497
+ text
68499
68498
  },
68500
68499
  accessory: {
68501
68500
  type: "button",
@@ -68514,13 +68513,13 @@ function fmtCount(n) {
68514
68513
  }
68515
68514
  /**
68516
68515
  * Build the controls modal opened from Configure (a snapshot — Slack modals don't
68517
- * stream). `private_metadata` carries the session key so the modal's `block_actions`
68518
- * (model/effort/fast/output selects, Cancel) resolve the session. Blocks: the model /
68516
+ * stream). `private_metadata` carries either the direct session key or a shared-bot
68517
+ * routing target so the modal's `block_actions` resolve the session. Blocks: the model /
68519
68518
  * effort / fast / output selectors (each omitted when not applicable), a labeled usage
68520
68519
  * grid (context · tokens · cost · per-type breakdown), and Cancel + View-session (URL,
68521
68520
  * when `link`). The modal has room, so each metric gets its own labeled cell. Pure.
68522
68521
  */
68523
- function buildStatusModal(info, sessionKey, link) {
68522
+ function buildStatusModal(info, sessionKey, link, privateMetadata = sessionKey) {
68524
68523
  const blocks = [];
68525
68524
  const models = info.models ?? [];
68526
68525
  if (models.length > 0) {
@@ -68720,7 +68719,7 @@ function buildStatusModal(info, sessionKey, link) {
68720
68719
  return {
68721
68720
  type: "modal",
68722
68721
  callback_id: STATUS_MODAL_CALLBACK,
68723
- private_metadata: sessionKey,
68722
+ private_metadata: privateMetadata,
68724
68723
  title: {
68725
68724
  type: "plain_text",
68726
68725
  text: "Session"
@@ -68881,7 +68880,7 @@ var OutputConverger = class {
68881
68880
  };
68882
68881
  const attribution = info ? [{
68883
68882
  kind: "attribution",
68884
- ...info.shared ? sharedFooterBlocks(info) : attributionBlocks(info)
68883
+ ...attributionBlocks(info)
68885
68884
  }] : [];
68886
68885
  if (this.mode === "low") return [
68887
68886
  ...this.flush(),
@@ -69092,16 +69091,7 @@ var SlackConnection = class {
69092
69091
  const sessionKey = action.value;
69093
69092
  const triggerId = body?.trigger_id;
69094
69093
  if (!sessionKey || !triggerId) return;
69095
- const data = this.deps.onStatusInfo?.(sessionKey);
69096
- if (!data) return;
69097
- try {
69098
- await this.app.client.views.open({
69099
- trigger_id: triggerId,
69100
- view: buildStatusModal(data.info, sessionKey, data.link)
69101
- });
69102
- } catch (err) {
69103
- this.deps.log?.debug(`slack: views.open failed: ${err.message}`);
69104
- }
69094
+ await this.openStatusModal(triggerId, sessionKey);
69105
69095
  });
69106
69096
  this.app.action(STATUS_ACTION.setModel, async ({ ack, action, body }) => {
69107
69097
  await ack();
@@ -69188,6 +69178,22 @@ var SlackConnection = class {
69188
69178
  await this.app.start();
69189
69179
  log?.debug("slack: app.start resolved → socket established");
69190
69180
  }
69181
+ /** Open the existing per-session controls modal. Direct bots call this from their
69182
+ * local Socket Mode action handler; shared bots call it after the relay forwards the
69183
+ * click over `rd/msg(slack_action)`. `privateMetadata` stays opaque to Slack and lets the
69184
+ * relay route subsequent select/cancel interactions back to this daemon. */
69185
+ async openStatusModal(triggerId, sessionKey, privateMetadata = sessionKey) {
69186
+ const data = this.deps.onStatusInfo?.(sessionKey);
69187
+ if (!data) return;
69188
+ try {
69189
+ await this.app.client.views.open({
69190
+ trigger_id: triggerId,
69191
+ view: buildStatusModal(data.info, sessionKey, data.link, privateMetadata)
69192
+ });
69193
+ } catch (err) {
69194
+ this.deps.log?.debug(`slack: views.open failed: ${err.message}`);
69195
+ }
69196
+ }
69191
69197
  rememberAssistantThread(ev) {
69192
69198
  const channel = ev.assistant_thread?.channel_id;
69193
69199
  const threadTs = ev.assistant_thread?.thread_ts;
@@ -217352,11 +217358,11 @@ var Daemon = class Daemon {
217352
217358
  agentCallDeliveries = /* @__PURE__ */ new Map();
217353
217359
  orchestrationDeadlines = /* @__PURE__ */ new Map();
217354
217360
  /**
217355
- * Dispatch one inbound relay item (`rd/msg` — a webchat op or a hook fire) and
217361
+ * Dispatch one inbound relay item (`rd/msg` — webchat, shared IM/action, or hook) and
217356
217362
  * return the `rd/ack` verdict — the relay-path entry, reusing the SAME turn
217357
217363
  * engine + by-key cores as the (retiring) CP path. The `chat` callback streams
217358
217364
  * a webchat reply back as `rd/chat` over the relay socket the op arrived on
217359
- * (no-op for hooks — their outcome goes to the CP as `hook/report`).
217365
+ * (no-op outside webchat; hook outcomes go to the CP as `hook/report`).
217360
217366
  *
217361
217367
  * Deduped by the relay-minted (sessionKey, msgId): the wire is at-least-once, so a
217362
217368
  * retransmitted rd/msg (identical msgId) must NOT run the user's turn a second time —
@@ -217389,7 +217395,7 @@ var Daemon = class Daemon {
217389
217395
  this.pendingRelayMsgAcks.set(dedupKey, task);
217390
217396
  return task;
217391
217397
  }
217392
- const ack = msg.source === "webchat" ? this.dispatchRelayOp(msg, chat) : this.handleRelayIm(msg);
217398
+ const ack = msg.source === "webchat" ? this.dispatchRelayOp(msg, chat) : msg.source === "slack_action" ? this.handleRelaySlackAction(msg) : this.handleRelayIm(msg);
217393
217399
  if (this.relayMsgAcks.size >= 2e3) this.relayMsgAcks.clear();
217394
217400
  this.relayMsgAcks.set(dedupKey, ack);
217395
217401
  return ack;
@@ -217442,6 +217448,97 @@ var Daemon = class Daemon {
217442
217448
  accepted: true
217443
217449
  };
217444
217450
  }
217451
+ /** Apply one shared-bot status interaction after the relay has validated the opaque
217452
+ * target against its live bot assignment. Re-check every daemon-owned boundary before
217453
+ * opening or mutating anything: the agent, shared Slack integration, local connection,
217454
+ * session owner, and (when retained) exact delivery binding must all still agree. */
217455
+ handleRelaySlackAction(msg) {
217456
+ const agent = this.agents.get(msg.agentId);
217457
+ if (!agent) {
217458
+ this.log.warn(`relay: Slack action for unknown agent ${msg.agentId} — dropping`);
217459
+ return {
217460
+ msgId: msg.msgId,
217461
+ accepted: false,
217462
+ reason: "no_agent"
217463
+ };
217464
+ }
217465
+ if (!agent.integrations.find((candidate) => candidate.id === msg.integrationId && candidate.platform === "slack" && candidate.slack.mode === "shared")) {
217466
+ this.log.warn(`relay: Slack action for non-shared integration ${msg.integrationId} on agent ${msg.agentId} — dropping`);
217467
+ return {
217468
+ msgId: msg.msgId,
217469
+ accepted: false,
217470
+ reason: "not_found"
217471
+ };
217472
+ }
217473
+ const conn = this.connByIntegration.get(msg.integrationId);
217474
+ if (!conn) {
217475
+ this.log.warn(`relay: Slack action for unavailable integration ${msg.integrationId} — dropping`);
217476
+ return {
217477
+ msgId: msg.msgId,
217478
+ accepted: false,
217479
+ reason: "unavailable"
217480
+ };
217481
+ }
217482
+ const rec = this.store.getSession(msg.sessionKey);
217483
+ if (!rec || rec.agentId !== msg.agentId || rec.platform !== "slack") {
217484
+ this.log.warn(`relay: Slack action for stale or foreign session ${msg.sessionKey} — dropping`);
217485
+ return {
217486
+ msgId: msg.msgId,
217487
+ accepted: false,
217488
+ reason: "not_found"
217489
+ };
217490
+ }
217491
+ const binding = this.sessionDeliveryBindings.get(msg.sessionKey);
217492
+ if (binding && (binding.agentId !== msg.agentId || binding.platform !== "slack" || binding.integrationId !== msg.integrationId)) {
217493
+ this.log.warn(`relay: Slack action delivery binding mismatch for session ${msg.sessionKey} — dropping`);
217494
+ return {
217495
+ msgId: msg.msgId,
217496
+ accepted: false,
217497
+ reason: "stale"
217498
+ };
217499
+ }
217500
+ const payload = msg.payload;
217501
+ if (payload.kind === "open-config") {
217502
+ const privateMetadata = encodeSharedSlackStatusTarget({
217503
+ agentId: msg.agentId,
217504
+ integrationId: msg.integrationId,
217505
+ sessionKey: msg.sessionKey
217506
+ });
217507
+ conn.openStatusModal(payload.triggerId, msg.sessionKey, privateMetadata);
217508
+ } else if (payload.kind === "set-model") this.handleStatusAction({
217509
+ kind: payload.kind,
217510
+ sessionKey: msg.sessionKey,
217511
+ model: payload.model
217512
+ });
217513
+ else if (payload.kind === "set-effort") this.handleStatusAction({
217514
+ kind: payload.kind,
217515
+ sessionKey: msg.sessionKey,
217516
+ effort: payload.effort
217517
+ });
217518
+ else if (payload.kind === "set-permission-mode") this.handleStatusAction({
217519
+ kind: payload.kind,
217520
+ sessionKey: msg.sessionKey,
217521
+ permissionMode: payload.permissionMode
217522
+ });
217523
+ else if (payload.kind === "set-fast") this.handleStatusAction({
217524
+ kind: payload.kind,
217525
+ sessionKey: msg.sessionKey,
217526
+ fastMode: payload.fastMode
217527
+ });
217528
+ else if (payload.kind === "set-output") this.handleStatusAction({
217529
+ kind: payload.kind,
217530
+ sessionKey: msg.sessionKey,
217531
+ outputMode: payload.outputMode
217532
+ });
217533
+ else this.handleStatusAction({
217534
+ kind: "cancel",
217535
+ sessionKey: msg.sessionKey
217536
+ });
217537
+ return {
217538
+ msgId: msg.msgId,
217539
+ accepted: true
217540
+ };
217541
+ }
217445
217542
  relayAgentMsgAcks = /* @__PURE__ */ new Map();
217446
217543
  /**
217447
217544
  * TARGET side of a cross-daemon `messageAgent` (agent-collaboration §2.3/§6.2, P2) —
@@ -219517,6 +219614,7 @@ var Daemon = class Daemon {
219517
219614
  rec,
219518
219615
  agentId,
219519
219616
  agentName,
219617
+ ...integrationId !== void 0 ? { integrationId } : {},
219520
219618
  ...iconUrl ? { iconUrl } : {},
219521
219619
  platform: msg.platform,
219522
219620
  isDm: msg.isDm,
@@ -219631,8 +219729,7 @@ var Daemon = class Daemon {
219631
219729
  botUrl: this.agentLink(agentId),
219632
219730
  runtime: this.runtimeNames[agent.runtime] ?? agent.runtime,
219633
219731
  model: this.buildStatusInfo(p).model ?? turnModel ?? "default",
219634
- sessionUrl: link,
219635
- shared: this.isSharedSlackIntegration(agentId, integrationId)
219732
+ sessionUrl: link
219636
219733
  });
219637
219734
  for (const action of finals) this.enqueueApply(p, action);
219638
219735
  }
@@ -219970,7 +220067,8 @@ var Daemon = class Daemon {
219970
220067
  await conn.updateBlocks(p.channel, ts, action.blocks, action.text);
219971
220068
  } else if (!p.statusBarAttempted) {
219972
220069
  p.statusBarAttempted = true;
219973
- const posted = await conn.postBlocks(p.channel, action.blocks, action.text, p.thread, postOptions);
220070
+ const statusPostOptions = this.isSharedSlackIntegration(p.agentId, p.integrationId) ? void 0 : postOptions;
220071
+ const posted = await conn.postBlocks(p.channel, action.blocks, action.text, p.thread, statusPostOptions);
219974
220072
  if (posted) {
219975
220073
  p.statusBarTs = posted;
219976
220074
  this.store.setStatusBarTs(p.sessionKey, posted);
@@ -220144,15 +220242,14 @@ var Daemon = class Daemon {
220144
220242
  const orgSeg = this.cpOrgSlug ? `/${encodeURIComponent(this.cpOrgSlug)}` : "";
220145
220243
  return `${this.webAppBase()}${orgSeg}/sessions/${encodeURIComponent(acpSessionId)}`;
220146
220244
  }
220147
- /** The console deep link to an agent: `<base>/<orgSlug>/agents/<agentId>` — the
220148
- * shared-bot footer's "sent by <agent_name>" link (§10.1). Same org-seg rule as
220149
- * {@link sessionLink}. */
220245
+ /** The console deep link to an agent: `<base>/<orgSlug>/agents/<agentId>`. Same
220246
+ * org-segment rule as {@link sessionLink}. */
220150
220247
  agentLink(agentId) {
220151
220248
  const orgSeg = this.cpOrgSlug ? `/${encodeURIComponent(this.cpOrgSlug)}` : "";
220152
220249
  return `${this.webAppBase()}${orgSeg}/agents/${encodeURIComponent(agentId)}`;
220153
220250
  }
220154
- /** Whether this turn used a shared Slack integration. Shared mode renders the same
220155
- * dynamic footer text in a section so it can retain the config-button accessory. */
220251
+ /** Whether this turn's reply rides a shared Slack integration. The relay owns that
220252
+ * app's Socket Mode connection, so interactive actions must use relay-recognized ids. */
220156
220253
  isSharedSlackIntegration(agentId, integrationId) {
220157
220254
  if (!integrationId) return false;
220158
220255
  const int = this.agents.get(agentId)?.integrations.find((i) => i.id === integrationId);
@@ -220311,10 +220408,15 @@ var Daemon = class Daemon {
220311
220408
  else {
220312
220409
  p.lastStatusBar = key;
220313
220410
  const link = this.sessionLink(p.acpSessionId);
220411
+ const shared = p.integrationId && this.isSharedSlackIntegration(p.agentId, p.integrationId) ? { sessionTarget: encodeSharedSlackStatusTarget({
220412
+ agentId: p.agentId,
220413
+ integrationId: p.integrationId,
220414
+ sessionKey: p.sessionKey
220415
+ }) } : void 0;
220314
220416
  this.enqueueApply(p, {
220315
220417
  kind: "status-bar",
220316
220418
  text: renderStatusBar(info),
220317
- blocks: buildStatusBlocks(info, p.sessionKey, link)
220419
+ blocks: buildStatusBlocks(info, p.sessionKey, link, shared)
220318
220420
  });
220319
220421
  }
220320
220422
  }
@@ -221846,4 +221948,4 @@ async function runForeground(opts, deps = {}) {
221846
221948
  //#endregion
221847
221949
  export { ClientTransport as i, CP_SUBPROTOCOL as n, CP_WS_PATH as r, runForeground as t };
221848
221950
 
221849
- //# sourceMappingURL=run-foreground-BqC40mtd.js.map
221951
+ //# sourceMappingURL=run-foreground-BmZ1_4vI.js.map