@agentconnect.md/daemon 1.0.0-rc.317 → 1.0.0-rc.319

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.
@@ -180,6 +180,22 @@ const obj = (properties, required = []) => ({
180
180
  additionalProperties: false
181
181
  });
182
182
  /**
183
+ * Session metadata tools are available to every agent, independently of the
184
+ * platform and memory backend. The title is deliberately model-authored: ACP
185
+ * runtimes do not all generate a semantic session title themselves, while the
186
+ * agent already has the context needed to choose one without a second LLM call.
187
+ */
188
+ const SESSION_TOOLS = [{
189
+ name: "setSessionTitle",
190
+ description: "Set the user-facing title for this AgentConnect session. Before your first substantive answer, after you understand the first meaningful request (ignore greetings and acknowledgements), call this once with a concise, specific title of about 3-8 words or a similarly short phrase. Call it again only if the task focus materially changes. If the user asks what the title is, set the exact title you give them. Do not mention this housekeeping call in your response.",
191
+ inputSchema: obj({ title: {
192
+ type: "string",
193
+ minLength: 1,
194
+ maxLength: 80,
195
+ description: "A concise, specific session title (maximum 80 characters)."
196
+ } }, ["title"])
197
+ }];
198
+ /**
183
199
  * Tools injected when an agent has a Slack integration. `sendSlackMessage` is
184
200
  * the active-messaging tool from the design (token held by the daemon, invisible
185
201
  * to the model); the rest are channel/user read helpers.
@@ -431,16 +447,17 @@ const COLLABORATION_TOOLS = [
431
447
  }
432
448
  ];
433
449
  const ALL_TOOL_NAMES = [...new Set([
450
+ ...SESSION_TOOLS,
434
451
  ...SLACK_TOOLS,
435
452
  ...TELEGRAM_TOOLS,
436
453
  ...MEMORY_TOOLS,
437
454
  ...COLLABORATION_TOOLS
438
455
  ].map((t) => t.name))];
439
456
  /**
440
- * The default MCP tool set for an agent. The memory tools are always present
441
- * (every agent has memory); the platform tools are gated by the agent's
442
- * integrations. Deduped by name so an agent bridging both platforms doesn't get
443
- * the shared read helpers (getCurrentChannel/listChannelMembers/getUserProfile)
457
+ * The default MCP tool set for an agent. Session metadata, memory, and
458
+ * collaboration tools are always present; platform tools are gated by the
459
+ * agent's integrations. Deduped by name so an agent bridging both platforms
460
+ * doesn't get the shared read helpers (getCurrentChannel/listChannelMembers/getUserProfile)
444
461
  * twice — the first platform's variant wins, and both behave identically.
445
462
  */
446
463
  function toolsForIntegrations(integrations) {
@@ -453,6 +470,7 @@ function toolsForIntegrations(integrations) {
453
470
  tools.push(t);
454
471
  }
455
472
  };
473
+ add(SESSION_TOOLS);
456
474
  add(MEMORY_TOOLS);
457
475
  add(COLLABORATION_TOOLS);
458
476
  if (integrations.some((i) => i.platform === "slack")) add(SLACK_TOOLS);
@@ -9647,6 +9665,12 @@ function installedRuntimes(runtimes, env = process.env) {
9647
9665
  //#endregion
9648
9666
  //#region src/acp/acp-host.ts
9649
9667
  const PROTOCOL_VERSION = 1;
9668
+ /** A session/load may replay the historical conversation stream. Keep that off
9669
+ * platform transports, but preserve latest-wins metadata needed to converge the
9670
+ * local/CP session projection after a restart. */
9671
+ function shouldForwardUpdateDuringLoad(update) {
9672
+ return update.sessionUpdate === "session_info_update" || update.sessionUpdate === "usage_update";
9673
+ }
9650
9674
  /**
9651
9675
  * Distill the human-actionable reason from a failed ACP request. Adapters wrap
9652
9676
  * their runtime's own message in a JSON-RPC error whose `message` is often just
@@ -9843,7 +9867,7 @@ var AcpHost = class {
9843
9867
  const stream = ndJsonStream(Writable.toWeb(child.stdin), Readable.toWeb(child.stdout));
9844
9868
  const self = this;
9845
9869
  this.conn = client({ name: "agentconnect" }).onNotification(methods.client.session.update, (ctx) => {
9846
- if (self.loadingSessions.has(ctx.params.sessionId)) return;
9870
+ if (self.loadingSessions.has(ctx.params.sessionId) && !shouldForwardUpdateDuringLoad(ctx.params.update)) return;
9847
9871
  self.opts.onUpdate(ctx.params.sessionId, ctx.params.update);
9848
9872
  }).onRequest(methods.client.session.requestPermission, async (ctx) => {
9849
9873
  if (self.opts.onPermission) try {
@@ -10052,9 +10076,9 @@ var AcpHost = class {
10052
10076
  return this.canLoad;
10053
10077
  }
10054
10078
  /** Resume a previously-created session by id (ACP `session/load`). The agent
10055
- * restores its own history server-side; its replayed session/update stream is
10056
- * suppressed so it isn't re-posted. `mcpServers` must be re-attached here — the
10057
- * agent doesn't persist them across processes. `systemAppend` (the agent meta
10079
+ * restores its own history server-side; replayed conversation/tool output is
10080
+ * suppressed while metadata updates still converge. `mcpServers` must be
10081
+ * re-attached here — the agent doesn't persist them across processes. `systemAppend` (the agent meta
10058
10082
  * object) is re-asserted via `_meta.systemPrompt` so a session resumed in a fresh
10059
10083
  * agent process keeps its system prompt. Throws if the agent can't load the id
10060
10084
  * (caller falls back to newSession). */
@@ -10140,4 +10164,4 @@ var AcpHost = class {
10140
10164
  //#endregion
10141
10165
  export { cachedRuntimeVersions as C, cachedRuntimeNames as S, resolveInMemoryDir as _, prepareWorkspace as a, MEMORY_TOOL_NAMES as b, sessionGitEnv as c, memoryKindOf as d, memoryProviderFor as f, listMemory as g, MemoryTooLargeError as h, prefetchWorkspace as i, simpleGit as l, MemoryPathError as m, turnFailureReason as n, initGitInjection as o, MemoryConflictError as p, installedRuntimes as r, probeGitVersion as s, AcpHost as t, createMemoryProvider as u, writeMemoryFile as v, resolveRuntimes as w, toolsForIntegrations as x, ALL_TOOL_NAMES as y };
10142
10166
 
10143
- //# sourceMappingURL=acp-host-4pA0zUPK.js.map
10167
+ //# sourceMappingURL=acp-host-Dsm0i9DH.js.map