@agentconnect.md/daemon 1.0.0-rc.271 → 1.0.0-rc.273

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.
@@ -9775,19 +9775,37 @@ var AcpHost = class {
9775
9775
  this.conn = client({ name: "agentconnect" }).onNotification(methods.client.session.update, (ctx) => {
9776
9776
  if (self.loadingSessions.has(ctx.params.sessionId)) return;
9777
9777
  self.opts.onUpdate(ctx.params.sessionId, ctx.params.update);
9778
- }).onRequest(methods.client.session.requestPermission, (ctx) => {
9778
+ }).onRequest(methods.client.session.requestPermission, async (ctx) => {
9779
+ if (self.opts.onPermission) try {
9780
+ const res = await self.opts.onPermission(ctx.params.sessionId, ctx.params);
9781
+ if (res) return res;
9782
+ } catch (err) {
9783
+ self.opts.log?.debug(`acp: onPermission failed, auto-allowing: ${err.message}`);
9784
+ }
9779
9785
  const optionId = (ctx.params.options.find((o) => o.kind === "allow_once" || o.kind === "allow_always") ?? ctx.params.options[0])?.optionId;
9780
9786
  return { outcome: optionId ? {
9781
9787
  outcome: "selected",
9782
9788
  optionId
9783
9789
  } : { outcome: "cancelled" } };
9790
+ }).onRequest(methods.client.elicitation.create, async (ctx) => {
9791
+ const sessionId = ctx.params.sessionId;
9792
+ if (self.opts.onElicit && sessionId) try {
9793
+ const res = await self.opts.onElicit(sessionId, ctx.params);
9794
+ if (res) return res;
9795
+ } catch (err) {
9796
+ self.opts.log?.debug(`acp: onElicit failed, declining: ${err.message}`);
9797
+ }
9798
+ return { action: "decline" };
9784
9799
  }).connect(stream);
9785
9800
  const init = await this.conn.agent.request(methods.agent.initialize, {
9786
9801
  protocolVersion: PROTOCOL_VERSION,
9787
- clientCapabilities: { fs: {
9788
- readTextFile: false,
9789
- writeTextFile: false
9790
- } }
9802
+ clientCapabilities: {
9803
+ fs: {
9804
+ readTextFile: false,
9805
+ writeTextFile: false
9806
+ },
9807
+ elicitation: { form: {} }
9808
+ }
9791
9809
  });
9792
9810
  this.negotiatedProtocolVersion = init.protocolVersion;
9793
9811
  this.canLoad = init.agentCapabilities?.loadSession ?? false;
@@ -10035,4 +10053,4 @@ var AcpHost = class {
10035
10053
  //#endregion
10036
10054
  export { resolveRuntimes as S, writeMemoryFile as _, initGitInjection as a, cachedRuntimeNames as b, simpleGit as c, memoryProviderFor as d, MemoryConflictError as f, resolveInMemoryDir as g, listMemory as h, prepareWorkspace as i, createMemoryProvider as l, MemoryTooLargeError as m, installedRuntimes as n, probeGitVersion as o, MemoryPathError as p, prefetchWorkspace as r, sessionGitEnv as s, AcpHost as t, memoryKindOf as u, MEMORY_TOOL_NAMES as v, cachedRuntimeVersions as x, toolsForIntegrations as y };
10037
10055
 
10038
- //# sourceMappingURL=acp-host-Da9dMauw.js.map
10056
+ //# sourceMappingURL=acp-host-BfCc6AlK.js.map