@agentconnect.md/daemon 1.0.0-rc.303 → 1.0.0-rc.304

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.
Files changed (26) hide show
  1. package/dist/{acp-host-DezWSmEG.js → acp-host-D_rGwxE5.js} +2 -2
  2. package/dist/{acp-host-DezWSmEG.js.map → acp-host-D_rGwxE5.js.map} +1 -1
  3. package/dist/{agent-list-Da9Osn4O.js → agent-list-Drju-EDG.js} +2 -2
  4. package/dist/{agent-list-Da9Osn4O.js.map → agent-list-Drju-EDG.js.map} +1 -1
  5. package/dist/{chat-D8QIIHor.js → chat-CsR5oJP2.js} +3 -3
  6. package/dist/{chat-D8QIIHor.js.map → chat-CsR5oJP2.js.map} +1 -1
  7. package/dist/{dist-Cq1Kimg_.js → dist-CO_RU4EO.js} +8 -4
  8. package/dist/dist-CO_RU4EO.js.map +1 -0
  9. package/dist/{gh-token-BfPlYQav.js → gh-token-CppI9sti.js} +3 -3
  10. package/dist/{gh-token-BfPlYQav.js.map → gh-token-CppI9sti.js.map} +1 -1
  11. package/dist/{git-credential-DhWn1IBJ.js → git-credential-BJUvnCyW.js} +2 -2
  12. package/dist/{git-credential-DhWn1IBJ.js.map → git-credential-BJUvnCyW.js.map} +1 -1
  13. package/dist/{gitcred-server-KXxLyYxc.js → gitcred-server-Bu-Svl7L.js} +29 -9
  14. package/dist/gitcred-server-Bu-Svl7L.js.map +1 -0
  15. package/dist/index.js +6 -6
  16. package/dist/{load-agents-gTqVkOwl.js → load-agents-BC4zZ0xL.js} +2 -2
  17. package/dist/{load-agents-gTqVkOwl.js.map → load-agents-BC4zZ0xL.js.map} +1 -1
  18. package/dist/{login-BqF1z9wE.js → login-D1KMrVDs.js} +4 -4
  19. package/dist/{login-BqF1z9wE.js.map → login-D1KMrVDs.js.map} +1 -1
  20. package/dist/{run-foreground-syksXj_b.js → run-foreground-CN_44eeH.js} +37 -26
  21. package/dist/{run-foreground-syksXj_b.js.map → run-foreground-CN_44eeH.js.map} +1 -1
  22. package/dist/run-foreground-PrZ6IyPn.js +2 -0
  23. package/package.json +1 -1
  24. package/dist/dist-Cq1Kimg_.js.map +0 -1
  25. package/dist/gitcred-server-KXxLyYxc.js.map +0 -1
  26. package/dist/run-foreground-DEmppQGW.js +0 -2
@@ -3,11 +3,11 @@ 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 { a as RELAY_DAEMON_WS_PATH, c as SHARED_CONFIG_ACTION_ID, d as encode, f as MAX_FRAME_BYTES, g as ZodIssueCode, h as RESERVED_MCP_SERVER_NAME, i as RELAY_DAEMON_SUBPROTOCOL, l as buildEnvelope, n as gitRepoLabel, o as buildRelayDaemonFrame, r as normalizeGitUrl, s as decodeRelayDaemonFrame, u as decodeEnvelope } from "./dist-Cq1Kimg_.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-gTqVkOwl.js";
6
+ import { a as RELAY_DAEMON_WS_PATH, c as SHARED_CONFIG_ACTION_ID, d as encode, f as MAX_FRAME_BYTES, g as ZodIssueCode, h as RESERVED_MCP_SERVER_NAME, i as RELAY_DAEMON_SUBPROTOCOL, l as buildEnvelope, n as gitRepoLabel, o as buildRelayDaemonFrame, r as normalizeGitUrl, s as decodeRelayDaemonFrame, u as decodeEnvelope } from "./dist-CO_RU4EO.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-BC4zZ0xL.js";
8
8
  import { l as resolveRoot, o as mcpSocketPath, u as statePath } from "./paths-DEcUO8lC.js";
9
- 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-DezWSmEG.js";
10
- import { i as GitCredentialCache, n as gitcredSocketPath, r as writeGitcredShim, t as GitCredServer } from "./gitcred-server-KXxLyYxc.js";
9
+ 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-D_rGwxE5.js";
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";
13
13
  import { URL as URL$1 } from "url";
@@ -197689,27 +197689,36 @@ var GithubFinalPoster = class {
197689
197689
  }
197690
197690
  async post(text, deadlineAt) {
197691
197691
  const body = this.render(text);
197692
- const token = await this.deps.token();
197693
- if (this.abandoned) return;
197694
- if (this.sched.now() >= deadlineAt) {
197695
- this.abandonTimedOut();
197696
- return;
197692
+ const doFetch = this.deps.fetchImpl ?? fetch;
197693
+ for (let attempt = 0; attempt < 2; attempt += 1) {
197694
+ const token = await this.deps.token();
197695
+ if (this.abandoned) return;
197696
+ if (this.sched.now() >= deadlineAt) {
197697
+ this.abandonTimedOut();
197698
+ return;
197699
+ }
197700
+ const res = await doFetch(`${this.deps.baseUrl ?? "https://api.github.com"}/repos/${this.repo}/issues/${this.issueNumber}/comments`, {
197701
+ method: "POST",
197702
+ headers: {
197703
+ authorization: `Bearer ${token}`,
197704
+ accept: "application/vnd.github+json",
197705
+ "content-type": "application/json",
197706
+ "x-github-api-version": "2022-11-28"
197707
+ },
197708
+ signal: this.abort.signal,
197709
+ body: JSON.stringify({ body })
197710
+ });
197711
+ try {
197712
+ await res.body?.cancel();
197713
+ } catch {}
197714
+ if (res.ok) return;
197715
+ if (!(attempt === 0 && (res.status === 401 || res.status === 403) && this.deps.invalidateToken)) throw new Error(`GitHub POST ${res.status}`);
197716
+ try {
197717
+ this.deps.invalidateToken(token);
197718
+ } catch {
197719
+ throw new Error(`GitHub POST ${res.status}`);
197720
+ }
197697
197721
  }
197698
- const res = await (this.deps.fetchImpl ?? fetch)(`${this.deps.baseUrl ?? "https://api.github.com"}/repos/${this.repo}/issues/${this.issueNumber}/comments`, {
197699
- method: "POST",
197700
- headers: {
197701
- authorization: `Bearer ${token}`,
197702
- accept: "application/vnd.github+json",
197703
- "content-type": "application/json",
197704
- "x-github-api-version": "2022-11-28"
197705
- },
197706
- signal: this.abort.signal,
197707
- body: JSON.stringify({ body })
197708
- });
197709
- try {
197710
- await res.body?.cancel();
197711
- } catch {}
197712
- if (!res.ok) throw new Error(`GitHub POST ${res.status}`);
197713
197722
  }
197714
197723
  render(text) {
197715
197724
  if (text.length + this.footer.length <= MAX_COMMENT_CHARS) {
@@ -216696,6 +216705,7 @@ var Daemon = class Daemon {
216696
216705
  }
216697
216706
  }
216698
216707
  const githubReply = c?.source === "github" && c.repo && c.number !== void 0 ? {
216708
+ hookId: msg.hookId,
216699
216709
  repo: c.repo,
216700
216710
  number: c.number
216701
216711
  } : void 0;
@@ -218916,7 +218926,8 @@ var Daemon = class Daemon {
218916
218926
  return {
218917
218927
  collector: new GithubReplyCollector(),
218918
218928
  poster: new GithubFinalPoster({
218919
- token: async () => (await this.gitCreds.getPostToken(agentId, ref.repo)).token,
218929
+ token: async () => (await this.gitCreds.getPostToken(agentId, ref.repo, ref.hookId)).token,
218930
+ invalidateToken: (token) => this.gitCreds.invalidatePost(agentId, ref.repo, token),
218920
218931
  log: { warn: (m) => this.log.warn(m) }
218921
218932
  }, ref.repo, ref.number, {
218922
218933
  agentName: agent?.name ?? agentId,
@@ -219211,4 +219222,4 @@ async function runForeground(opts, deps = {}) {
219211
219222
  //#endregion
219212
219223
  export { ClientTransport as i, CP_SUBPROTOCOL as n, CP_WS_PATH as r, runForeground as t };
219213
219224
 
219214
- //# sourceMappingURL=run-foreground-syksXj_b.js.map
219225
+ //# sourceMappingURL=run-foreground-CN_44eeH.js.map