managed-deepagents 0.5.0-dev.89 → 0.5.0-dev.90

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 (176) hide show
  1. package/dist/channels/index.d.ts +6 -5
  2. package/dist/channels/index.d.ts.map +1 -1
  3. package/dist/channels/index.js +6 -5
  4. package/dist/channels/index.js.map +1 -1
  5. package/dist/channels/messaging-registry.d.ts +8 -4
  6. package/dist/channels/messaging-registry.d.ts.map +1 -1
  7. package/dist/channels/messaging-registry.js +22 -16
  8. package/dist/channels/messaging-registry.js.map +1 -1
  9. package/dist/channels/registry-types.d.ts +1 -1
  10. package/dist/channels/registry-types.d.ts.map +1 -1
  11. package/dist/channels/registry.d.ts.map +1 -1
  12. package/dist/channels/registry.js +1 -3
  13. package/dist/channels/registry.js.map +1 -1
  14. package/dist/channels/schedule-delivery.js +1 -1
  15. package/dist/channels/schedule-delivery.js.map +1 -1
  16. package/dist/{connectors → channels}/slack/adapter-core.d.ts +1 -1
  17. package/dist/channels/slack/adapter-core.d.ts.map +1 -0
  18. package/dist/channels/slack/adapter-core.js.map +1 -0
  19. package/dist/{connectors → channels}/slack/adapter.d.ts +3 -3
  20. package/dist/channels/slack/adapter.d.ts.map +1 -0
  21. package/dist/channels/slack/adapter.js.map +1 -0
  22. package/dist/{connectors → channels}/slack/http.d.ts +4 -4
  23. package/dist/channels/slack/http.d.ts.map +1 -0
  24. package/dist/{connectors → channels}/slack/http.js +6 -6
  25. package/dist/channels/slack/http.js.map +1 -0
  26. package/dist/channels/slack/index.d.ts +89 -0
  27. package/dist/channels/slack/index.d.ts.map +1 -0
  28. package/dist/channels/slack/index.js +148 -0
  29. package/dist/channels/slack/index.js.map +1 -0
  30. package/dist/{connectors → channels}/slack/normalize.d.ts +3 -3
  31. package/dist/channels/slack/normalize.d.ts.map +1 -0
  32. package/dist/{connectors → channels}/slack/normalize.js +1 -1
  33. package/dist/channels/slack/normalize.js.map +1 -0
  34. package/dist/channels/slack/source-thread.d.ts.map +1 -0
  35. package/dist/channels/slack/source-thread.js.map +1 -0
  36. package/dist/{connectors → channels}/slack/transport.d.ts +1 -1
  37. package/dist/channels/slack/transport.d.ts.map +1 -0
  38. package/dist/{connectors → channels}/slack/transport.js +1 -1
  39. package/dist/channels/slack/transport.js.map +1 -0
  40. package/dist/connectors/slack/index.d.ts +10 -79
  41. package/dist/connectors/slack/index.d.ts.map +1 -1
  42. package/dist/connectors/slack/index.js +24 -127
  43. package/dist/connectors/slack/index.js.map +1 -1
  44. package/dist/connectors/toolserver/catalog.d.ts +4 -10
  45. package/dist/connectors/toolserver/catalog.d.ts.map +1 -1
  46. package/dist/connectors/toolserver/catalog.js +6 -54
  47. package/dist/connectors/toolserver/catalog.js.map +1 -1
  48. package/dist/connectors/toolserver/index.d.ts +5 -7
  49. package/dist/connectors/toolserver/index.d.ts.map +1 -1
  50. package/dist/connectors/toolserver/index.js +4 -6
  51. package/dist/connectors/toolserver/index.js.map +1 -1
  52. package/dist/connectors/toolserver/integrations.d.ts +4 -4
  53. package/dist/connectors/toolserver/integrations.d.ts.map +1 -1
  54. package/dist/extension.d.ts +1 -1
  55. package/dist/extension.js +1 -1
  56. package/dist/identity/connect-inference.d.ts +6 -7
  57. package/dist/identity/connect-inference.d.ts.map +1 -1
  58. package/dist/identity/connect-inference.js +7 -9
  59. package/dist/identity/connect-inference.js.map +1 -1
  60. package/dist/identity/github/connect-http.d.ts +4 -4
  61. package/dist/identity/github/connect-http.js +4 -4
  62. package/dist/identity/github/index.d.ts +0 -2
  63. package/dist/identity/github/index.d.ts.map +1 -1
  64. package/dist/identity/github/index.js +0 -2
  65. package/dist/identity/github/index.js.map +1 -1
  66. package/dist/identity/options.d.ts +2 -3
  67. package/dist/identity/options.d.ts.map +1 -1
  68. package/dist/identity/options.js.map +1 -1
  69. package/dist/identity/slack/connect-http.d.ts +3 -1
  70. package/dist/identity/slack/connect-http.d.ts.map +1 -1
  71. package/dist/identity/slack/connect-http.js +3 -1
  72. package/dist/identity/slack/connect-http.js.map +1 -1
  73. package/dist/identity/slack/links.d.ts +2 -1
  74. package/dist/identity/slack/links.d.ts.map +1 -1
  75. package/dist/identity/slack/links.js +2 -1
  76. package/dist/identity/slack/links.js.map +1 -1
  77. package/dist/identity/types.d.ts +1 -1
  78. package/dist/identity/types.d.ts.map +1 -1
  79. package/dist/index.d.ts +4 -6
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +1 -1
  82. package/dist/index.js.map +1 -1
  83. package/dist/namespaces.d.ts +45 -83
  84. package/dist/namespaces.d.ts.map +1 -1
  85. package/dist/namespaces.js +12 -21
  86. package/dist/namespaces.js.map +1 -1
  87. package/dist/runtime/auth.d.ts +1 -1
  88. package/dist/runtime/auth.d.ts.map +1 -1
  89. package/dist/runtime/auth.js +13 -3
  90. package/dist/runtime/auth.js.map +1 -1
  91. package/dist/runtime/channel.d.ts +91 -0
  92. package/dist/runtime/channel.d.ts.map +1 -0
  93. package/dist/runtime/channel.js +98 -0
  94. package/dist/runtime/channel.js.map +1 -0
  95. package/dist/runtime/connector.d.ts +1 -1
  96. package/dist/runtime/connector.js +5 -1
  97. package/dist/runtime/connector.js.map +1 -1
  98. package/dist/runtime/cors.d.ts +1 -1
  99. package/dist/runtime/cors.d.ts.map +1 -1
  100. package/dist/runtime/cors.js +5 -1
  101. package/dist/runtime/cors.js.map +1 -1
  102. package/dist/runtime/http.d.ts +1 -2
  103. package/dist/runtime/http.d.ts.map +1 -1
  104. package/dist/runtime/http.js +1 -2
  105. package/dist/runtime/http.js.map +1 -1
  106. package/dist/runtime/identity-http.d.ts +8 -3
  107. package/dist/runtime/identity-http.d.ts.map +1 -1
  108. package/dist/runtime/identity-http.js +50 -8
  109. package/dist/runtime/identity-http.js.map +1 -1
  110. package/dist/runtime/index.d.ts +2 -0
  111. package/dist/runtime/index.d.ts.map +1 -1
  112. package/dist/runtime/index.js +4 -0
  113. package/dist/runtime/index.js.map +1 -1
  114. package/dist/runtime/types.d.ts +8 -0
  115. package/dist/runtime/types.d.ts.map +1 -1
  116. package/package.json +7 -7
  117. package/dist/connectors/github/adapter-core.d.ts +0 -15
  118. package/dist/connectors/github/adapter-core.d.ts.map +0 -1
  119. package/dist/connectors/github/adapter-core.js +0 -52
  120. package/dist/connectors/github/adapter-core.js.map +0 -1
  121. package/dist/connectors/github/define.d.ts +0 -168
  122. package/dist/connectors/github/define.d.ts.map +0 -1
  123. package/dist/connectors/github/define.js +0 -72
  124. package/dist/connectors/github/define.js.map +0 -1
  125. package/dist/connectors/github/http.d.ts +0 -25
  126. package/dist/connectors/github/http.d.ts.map +0 -1
  127. package/dist/connectors/github/http.js +0 -146
  128. package/dist/connectors/github/http.js.map +0 -1
  129. package/dist/connectors/github/index.d.ts +0 -121
  130. package/dist/connectors/github/index.d.ts.map +0 -1
  131. package/dist/connectors/github/index.js +0 -192
  132. package/dist/connectors/github/index.js.map +0 -1
  133. package/dist/connectors/github/match.d.ts +0 -20
  134. package/dist/connectors/github/match.d.ts.map +0 -1
  135. package/dist/connectors/github/match.js +0 -41
  136. package/dist/connectors/github/match.js.map +0 -1
  137. package/dist/connectors/github/normalize.d.ts +0 -32
  138. package/dist/connectors/github/normalize.d.ts.map +0 -1
  139. package/dist/connectors/github/normalize.js +0 -152
  140. package/dist/connectors/github/normalize.js.map +0 -1
  141. package/dist/connectors/github/sandbox.d.ts +0 -54
  142. package/dist/connectors/github/sandbox.d.ts.map +0 -1
  143. package/dist/connectors/github/sandbox.js +0 -532
  144. package/dist/connectors/github/sandbox.js.map +0 -1
  145. package/dist/connectors/github/source-thread.d.ts +0 -24
  146. package/dist/connectors/github/source-thread.d.ts.map +0 -1
  147. package/dist/connectors/github/source-thread.js +0 -54
  148. package/dist/connectors/github/source-thread.js.map +0 -1
  149. package/dist/connectors/github/transport.d.ts +0 -25
  150. package/dist/connectors/github/transport.d.ts.map +0 -1
  151. package/dist/connectors/github/transport.js +0 -106
  152. package/dist/connectors/github/transport.js.map +0 -1
  153. package/dist/connectors/langsmith/index.d.ts +0 -397
  154. package/dist/connectors/langsmith/index.d.ts.map +0 -1
  155. package/dist/connectors/langsmith/index.js +0 -436
  156. package/dist/connectors/langsmith/index.js.map +0 -1
  157. package/dist/connectors/langsmith/routes.d.ts +0 -236
  158. package/dist/connectors/langsmith/routes.d.ts.map +0 -1
  159. package/dist/connectors/langsmith/routes.js +0 -1154
  160. package/dist/connectors/langsmith/routes.js.map +0 -1
  161. package/dist/connectors/slack/adapter-core.d.ts.map +0 -1
  162. package/dist/connectors/slack/adapter-core.js.map +0 -1
  163. package/dist/connectors/slack/adapter.d.ts.map +0 -1
  164. package/dist/connectors/slack/adapter.js.map +0 -1
  165. package/dist/connectors/slack/http.d.ts.map +0 -1
  166. package/dist/connectors/slack/http.js.map +0 -1
  167. package/dist/connectors/slack/normalize.d.ts.map +0 -1
  168. package/dist/connectors/slack/normalize.js.map +0 -1
  169. package/dist/connectors/slack/source-thread.d.ts.map +0 -1
  170. package/dist/connectors/slack/source-thread.js.map +0 -1
  171. package/dist/connectors/slack/transport.d.ts.map +0 -1
  172. package/dist/connectors/slack/transport.js.map +0 -1
  173. /package/dist/{connectors → channels}/slack/adapter-core.js +0 -0
  174. /package/dist/{connectors → channels}/slack/adapter.js +0 -0
  175. /package/dist/{connectors → channels}/slack/source-thread.d.ts +0 -0
  176. /package/dist/{connectors → channels}/slack/source-thread.js +0 -0
@@ -1,54 +0,0 @@
1
- /**
2
- * Provision GitHub connector state inside a managed sandbox.
3
- *
4
- * On first create: optionally install `gh`, inject credentials, and clone
5
- * declared repositories. When a thread starts against a reused sandbox, refresh
6
- * credentials and apply each checkout's `onReuse` policy (default `fetch`).
7
- */
8
- import type { SandboxBackendProtocolV2 } from "deepagents";
9
- import type { GitHubConnector } from "./index.js";
10
- import type { IdentityDefinition } from "../../identity/index.js";
11
- import type { ManagedRunConfig } from "../../runtime/types.js";
12
- /** Absolute paths used for GitHub provisioning artifacts inside the sandbox. */
13
- export declare const GITHUB_TOKEN_REMOTE_PATH = "/tmp/mda-gh-token";
14
- export declare const GITHUB_PROVISION_REMOTE_PATH = "/tmp/mda-github-provision.sh";
15
- /** Backend surface required for GitHub sandbox provisioning. */
16
- export type GitHubSandboxBackend = Pick<SandboxBackendProtocolV2, "execute"> & Partial<Pick<SandboxBackendProtocolV2, "uploadFiles">>;
17
- /** Options for {@link provisionGitHubSandbox}. */
18
- export interface ProvisionGitHubSandboxOptions {
19
- /**
20
- * `"create"` installs/clones; `"reuse"` refreshes credentials + onReuse;
21
- * `"credentials"` only re-injects the token / gh wrapper (same thread).
22
- */
23
- mode: "create" | "reuse" | "credentials";
24
- /** Per-run LangGraph config (identity + thread scoping). */
25
- config?: ManagedRunConfig;
26
- /** Root identity declaration, when the project opts into managed identity. */
27
- identity?: IdentityDefinition;
28
- }
29
- /**
30
- * Apply GitHub connector provisioning to a sandbox backend.
31
- *
32
- * Safe to call repeatedly: create installs/clones once; reuse refreshes
33
- * credentials and pulls declared refs when a thread starts.
34
- */
35
- export declare function provisionGitHubSandbox(backend: GitHubSandboxBackend, connector: GitHubConnector, options: ProvisionGitHubSandboxOptions): Promise<void>;
36
- /** Build the shell script that installs `gh`, wires credentials, and syncs repos. */
37
- export declare function buildGitHubProvisionScript(connector: GitHubConnector, options: {
38
- mode: "create" | "reuse" | "credentials";
39
- hasToken: boolean;
40
- }): string;
41
- /** Resolve a GitHub token for sandbox injection (actor → read → env). */
42
- export declare function resolveSandboxGitHubToken(connector: GitHubConnector, options: Pick<ProvisionGitHubSandboxOptions, "config" | "identity">): Promise<string | undefined>;
43
- /** Marker file written when a static checkout cannot be cloned. */
44
- export declare const CLONE_FAILED_MARKDOWN = "CLONE_FAILED.md";
45
- /**
46
- * Resolve an authoring-relative checkout path to the absolute sandbox location.
47
- *
48
- * Authoring forbids absolute paths; deepagents filesystem tools require them.
49
- * `workspace/...` maps to `/workspace/...` to match fixture/setup conventions.
50
- */
51
- export declare function absoluteCheckoutPath(relativePath: string): string;
52
- /** True when provision failed for a recoverable git checkout reason. */
53
- export declare function isBenignCheckoutFailure(output: string): boolean;
54
- //# sourceMappingURL=sandbox.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/connectors/github/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAmB,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,KAAK,EAAE,eAAe,EAA4B,MAAM,YAAY,CAAC;AAE5E,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,yBAAyB,CAAC;AAQjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,gFAAgF;AAChF,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAC5D,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAE3E,gEAAgE;AAChE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,wBAAwB,EAAE,SAAS,CAAC,GAC1E,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,aAAa,CAAC,CAAC,CAAC;AAEzD,kDAAkD;AAClD,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;IACzC,4DAA4D;IAC5D,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,oBAAoB,EAC7B,SAAS,EAAE,eAAe,EAC1B,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,IAAI,CAAC,CAgEf;AAED,qFAAqF;AACrF,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,eAAe,EAC1B,OAAO,EAAE;IAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GACvE,MAAM,CAuDR;AAED,yEAAyE;AACzE,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,eAAe,EAC1B,OAAO,EAAE,IAAI,CAAC,6BAA6B,EAAE,QAAQ,GAAG,UAAU,CAAC,GAClE,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAqD7B;AAuMD,mEAAmE;AACnE,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAiGvD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAMjE;AA0DD,wEAAwE;AACxE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAI/D"}
@@ -1,532 +0,0 @@
1
- /**
2
- * Provision GitHub connector state inside a managed sandbox.
3
- *
4
- * On first create: optionally install `gh`, inject credentials, and clone
5
- * declared repositories. When a thread starts against a reused sandbox, refresh
6
- * credentials and apply each checkout's `onReuse` policy (default `fetch`).
7
- */
8
- import { defaultResolveUserToken } from "../../identity/github/credentials.js";
9
- import { createCredentialsProvider } from "../../runtime/credentials.js";
10
- import { buildRuntimeIdentity, resolveRuntimeConfigurable, } from "../../runtime/identity-runtime.js";
11
- import { assertSetupSucceeded } from "../../runtime/setup-script.js";
12
- import { executeWithStreamRetry } from "../../runtime/sandbox-stream-retry.js";
13
- /** Absolute paths used for GitHub provisioning artifacts inside the sandbox. */
14
- export const GITHUB_TOKEN_REMOTE_PATH = "/tmp/mda-gh-token";
15
- export const GITHUB_PROVISION_REMOTE_PATH = "/tmp/mda-github-provision.sh";
16
- /**
17
- * Apply GitHub connector provisioning to a sandbox backend.
18
- *
19
- * Safe to call repeatedly: create installs/clones once; reuse refreshes
20
- * credentials and pulls declared refs when a thread starts.
21
- */
22
- export async function provisionGitHubSandbox(backend, connector, options) {
23
- const token = connector.injectCredentials
24
- ? await resolveSandboxGitHubToken(connector, options)
25
- : undefined;
26
- if (options.mode === "credentials") {
27
- if (!connector.injectCredentials) {
28
- return;
29
- }
30
- // Fail closed when this actor has no token: clear any prior injection so a
31
- // different Slack user in the same thread-scoped sandbox cannot reuse it.
32
- if (!token) {
33
- await uploadAndRun(backend, connector, buildGitHubProvisionScript(connector, {
34
- mode: "credentials",
35
- hasToken: false,
36
- }));
37
- return;
38
- }
39
- const script = buildGitHubProvisionScript(connector, {
40
- mode: "credentials",
41
- hasToken: true,
42
- });
43
- await uploadAndRun(backend, connector, script, [
44
- [GITHUB_TOKEN_REMOTE_PATH, new TextEncoder().encode(token)],
45
- ]);
46
- return;
47
- }
48
- const needsStaticClone = options.mode === "create" &&
49
- connector.repositories.some((repo) => Boolean(repo.repo));
50
- if (needsStaticClone && !token) {
51
- const configurable = resolveRuntimeConfigurable({
52
- configurable: options.config?.configurable,
53
- });
54
- const actorId = buildRuntimeIdentity(configurable)?.user.id;
55
- const slackHint = typeof actorId === "string" && actorId.startsWith("slack:")
56
- ? " Slack is running as an unlinked Slack actor — Connect Slack in the app UI while signed in, then Connect GitHub on that same account."
57
- : " Connect GitHub for this actor in the app UI (same account Slack is linked to), or set GITHUB_TOKEN.";
58
- throw new Error("connectors.github(...): cannot clone repositories without GitHub credentials" +
59
- ` (actor=${actorId ?? "none"}).${slackHint}`);
60
- }
61
- const script = buildGitHubProvisionScript(connector, {
62
- mode: options.mode,
63
- hasToken: Boolean(token),
64
- });
65
- if (token) {
66
- await uploadAndRun(backend, connector, script, [
67
- [GITHUB_TOKEN_REMOTE_PATH, new TextEncoder().encode(token)],
68
- ]);
69
- return;
70
- }
71
- await uploadAndRun(backend, connector, script);
72
- }
73
- /** Build the shell script that installs `gh`, wires credentials, and syncs repos. */
74
- export function buildGitHubProvisionScript(connector, options) {
75
- const lines = [
76
- "set -euo pipefail",
77
- 'export PATH="/usr/local/bin:${HOME:-/root}/.local/bin:${PATH:-/usr/bin:/bin}"',
78
- ];
79
- if (options.mode === "credentials") {
80
- // Same-thread refresh: rewrite token + gh wrapper only. Skip apt/git
81
- // install and `gh api user` identity probes so we don't add latency (or
82
- // another sandbox round-trip that can 502) on every message.
83
- if (connector.injectCredentials) {
84
- lines.push(...(options.hasToken
85
- ? injectCredentialsScriptLines({ light: true })
86
- : clearInjectedCredentialsScriptLines()));
87
- }
88
- return `${lines.join("\n")}\n`;
89
- }
90
- if (options.mode === "create" && connector.installCLI) {
91
- lines.push(...installCLIScriptLines());
92
- }
93
- const needsGit = (connector.injectCredentials && options.hasToken) ||
94
- connector.repositories.some((repo) => Boolean(repo.repo));
95
- if (needsGit) {
96
- lines.push(...ensureGitScriptLines());
97
- }
98
- // Fail closed on every mode: a sandbox reused by a new thread can still hold
99
- // the previous actor's token, so an actor without one must clear it before
100
- // any checkout sync runs.
101
- if (connector.injectCredentials) {
102
- lines.push(...(options.hasToken
103
- ? injectCredentialsScriptLines()
104
- : clearInjectedCredentialsScriptLines()));
105
- }
106
- for (const repo of connector.repositories) {
107
- if (!repo.repo) {
108
- // Dynamic event.repository bindings wait for channel ingress.
109
- continue;
110
- }
111
- if (options.mode === "create") {
112
- lines.push(...cloneRepositoryScriptLines(repo));
113
- }
114
- else {
115
- lines.push(...reuseRepositoryScriptLines(repo));
116
- }
117
- }
118
- return `${lines.join("\n")}\n`;
119
- }
120
- /** Resolve a GitHub token for sandbox injection (actor → read → env). */
121
- export async function resolveSandboxGitHubToken(connector, options) {
122
- const identityConfig = options.identity?.config;
123
- // Prefer the live run's auth user (ambient LangGraph configurable) when the
124
- // factory-closed config lacks `langgraph_auth_user` — same seam as actor memory.
125
- const configurable = resolveRuntimeConfigurable({
126
- configurable: options.config?.configurable,
127
- });
128
- const runtimeIdentity = buildRuntimeIdentity(configurable);
129
- const repoHint = firstStaticRepo(connector);
130
- if (identityConfig?.scope.credentials === "custom" &&
131
- identityConfig.credentials &&
132
- runtimeIdentity) {
133
- // Connect-with-GitHub vault first — same path tools use for write: ["actor"].
134
- // Do this before provider.for so a missing PAT / installation source cannot
135
- // mask a vault hit, and vault/store errors surface instead of being swallowed.
136
- try {
137
- const vaultToken = await defaultResolveUserToken({
138
- identity: runtimeIdentity,
139
- scopes: ["repo"],
140
- });
141
- if (vaultToken)
142
- return vaultToken;
143
- }
144
- catch (err) {
145
- const detail = err instanceof Error ? err.message : String(err);
146
- throw new Error(`connectors.github(...): failed to read Connect-with-GitHub credentials` +
147
- ` (actor=${runtimeIdentity.user.id}): ${detail}`);
148
- }
149
- const provider = createCredentialsProvider(identityConfig, runtimeIdentity);
150
- if (provider) {
151
- for (const intent of ["write", "read"]) {
152
- try {
153
- const credential = await provider.for({
154
- kind: "connection",
155
- name: "github",
156
- intent,
157
- ...(repoHint ? { metadata: { repo: repoHint } } : {}),
158
- });
159
- const token = tokenFromCredential(credential);
160
- if (token)
161
- return token;
162
- }
163
- catch {
164
- // Actor vault already tried; fall through to the other intent / env.
165
- }
166
- }
167
- }
168
- }
169
- return stringEnv("GITHUB_TOKEN") ?? stringEnv("GITHUB_PAT");
170
- }
171
- function firstStaticRepo(connector) {
172
- for (const repo of connector.repositories) {
173
- if (repo.repo)
174
- return repo.repo;
175
- }
176
- return undefined;
177
- }
178
- function tokenFromCredential(credential) {
179
- const auth = credential.headers?.Authorization ?? credential.headers?.authorization;
180
- if (typeof auth === "string") {
181
- const match = /^Bearer\s+(.+)$/i.exec(auth.trim());
182
- if (match?.[1])
183
- return match[1].trim();
184
- }
185
- return undefined;
186
- }
187
- function stringEnv(name) {
188
- const value = process.env[name];
189
- if (typeof value !== "string")
190
- return undefined;
191
- const trimmed = value.trim();
192
- return trimmed.length > 0 ? trimmed : undefined;
193
- }
194
- function installCLIScriptLines() {
195
- // Prefer a direct GitHub release binary — faster and more reliable in
196
- // sandboxes than apt repo setup. Fall back to apt/brew when curl/tar fail.
197
- return [
198
- "if ! command -v gh >/dev/null 2>&1; then",
199
- " GH_VERSION=2.74.2",
200
- ' ARCH="$(uname -m)"',
201
- ' case "$ARCH" in',
202
- " x86_64|amd64) GH_ARCH=amd64 ;;",
203
- " aarch64|arm64) GH_ARCH=arm64 ;;",
204
- ' *) GH_ARCH="" ;;',
205
- " esac",
206
- ' if [ -n "$GH_ARCH" ] && command -v curl >/dev/null 2>&1 && command -v tar >/dev/null 2>&1; then',
207
- ' TMP_GH="$(mktemp -d)"',
208
- ' curl -fsSL "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_${GH_ARCH}.tar.gz" -o "$TMP_GH/gh.tgz"',
209
- ' tar -xzf "$TMP_GH/gh.tgz" -C "$TMP_GH"',
210
- ' if install -m 0755 "$TMP_GH/gh_${GH_VERSION}_linux_${GH_ARCH}/bin/gh" /usr/local/bin/gh 2>/dev/null; then',
211
- " :",
212
- " else",
213
- ' mkdir -p "$HOME/.local/bin"',
214
- ' install -m 0755 "$TMP_GH/gh_${GH_VERSION}_linux_${GH_ARCH}/bin/gh" "$HOME/.local/bin/gh"',
215
- " fi",
216
- ' export PATH="/usr/local/bin:$HOME/.local/bin:$PATH"',
217
- ' rm -rf "$TMP_GH"',
218
- " fi",
219
- "fi",
220
- "if ! command -v gh >/dev/null 2>&1; then",
221
- " if command -v apt-get >/dev/null 2>&1; then",
222
- " export DEBIAN_FRONTEND=noninteractive",
223
- ' SUDO=""',
224
- ' if [ "$(id -u)" -ne 0 ] && command -v sudo >/dev/null 2>&1; then SUDO="sudo"; fi',
225
- " $SUDO apt-get update -qq",
226
- " $SUDO apt-get install -y -qq curl ca-certificates gnupg >/dev/null",
227
- " $SUDO install -d -m 0755 /etc/apt/keyrings",
228
- " curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg -o /tmp/githubcli-archive-keyring.gpg",
229
- " $SUDO mv /tmp/githubcli-archive-keyring.gpg /etc/apt/keyrings/githubcli-archive-keyring.gpg",
230
- " $SUDO chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg",
231
- ' echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | $SUDO tee /etc/apt/sources.list.d/github-cli.list >/dev/null',
232
- " $SUDO apt-get update -qq",
233
- " $SUDO apt-get install -y -qq gh >/dev/null",
234
- " elif command -v brew >/dev/null 2>&1; then",
235
- " brew install gh",
236
- " else",
237
- ' echo "connectors.github(...): unable to install gh CLI" >&2',
238
- " exit 1",
239
- " fi",
240
- "fi",
241
- "command -v gh >/dev/null 2>&1",
242
- ];
243
- }
244
- function ensureGitScriptLines() {
245
- return [
246
- "if ! command -v git >/dev/null 2>&1; then",
247
- " if command -v apt-get >/dev/null 2>&1; then",
248
- " export DEBIAN_FRONTEND=noninteractive",
249
- ' SUDO=""',
250
- ' if [ "$(id -u)" -ne 0 ] && command -v sudo >/dev/null 2>&1; then SUDO="sudo"; fi',
251
- " $SUDO apt-get update -qq",
252
- " $SUDO apt-get install -y -qq git ca-certificates >/dev/null",
253
- " elif command -v brew >/dev/null 2>&1; then",
254
- " brew install git",
255
- " else",
256
- ' echo "connectors.github(...): git is required to checkout repositories" >&2',
257
- " exit 1",
258
- " fi",
259
- "fi",
260
- ];
261
- }
262
- /**
263
- * Remove previously injected GitHub credentials from a reused sandbox.
264
- *
265
- * Thread-scoped sandboxes are shared across Slack users in the same thread, and
266
- * agent-scoped sandboxes are shared across every thread and actor; when the
267
- * current actor has no token we must clear any prior actor's token file / gh
268
- * auth / git helpers before returning.
269
- */
270
- function clearInjectedCredentialsScriptLines() {
271
- return [
272
- 'HOME="${HOME:-/root}"',
273
- 'rm -f "$HOME/.config/mda/github_token"',
274
- 'rm -f "$HOME/.config/mda/git-credential-mda.sh"',
275
- "unset GH_TOKEN GITHUB_TOKEN || true",
276
- "if command -v gh >/dev/null 2>&1; then",
277
- " gh auth logout --hostname github.com >/dev/null 2>&1 || true",
278
- "fi",
279
- "git config --global --unset-all credential.https://github.com.helper 2>/dev/null || true",
280
- // We also set the global helper to our file-based script on inject.
281
- "git config --global --unset-all credential.helper 2>/dev/null || true",
282
- "export GIT_TERMINAL_PROMPT=0",
283
- ];
284
- }
285
- function injectCredentialsScriptLines(options) {
286
- const lines = [
287
- 'HOME="${HOME:-/root}"',
288
- "test -f /tmp/mda-gh-token",
289
- "umask 077",
290
- 'mkdir -p "$HOME/.config/mda"',
291
- 'mv /tmp/mda-gh-token "$HOME/.config/mda/github_token"',
292
- 'chmod 600 "$HOME/.config/mda/github_token"',
293
- 'export GH_TOKEN="$(cat "$HOME/.config/mda/github_token")"',
294
- 'export GITHUB_TOKEN="$GH_TOKEN"',
295
- // File-based git credential helper (works without GH_TOKEN in execute env).
296
- "cat > \"$HOME/.config/mda/git-credential-mda.sh\" <<'EOF'",
297
- "#!/bin/sh",
298
- 'TOKEN_FILE="${HOME}/.config/mda/github_token"',
299
- 'if [ "$1" = "get" ] && [ -f "$TOKEN_FILE" ]; then',
300
- ' echo "protocol=https"',
301
- ' echo "host=github.com"',
302
- ' echo "username=x-access-token"',
303
- ' echo "password=$(cat "$TOKEN_FILE")"',
304
- "fi",
305
- "EOF",
306
- 'chmod 700 "$HOME/.config/mda/git-credential-mda.sh"',
307
- // Wrap `gh` so every later `execute` injects GH_TOKEN from the token file.
308
- // `gh auth login` / profile.d do not survive non-interactive sandbox shells.
309
- "if command -v gh >/dev/null 2>&1; then",
310
- ' REAL_GH="$(command -v gh)"',
311
- ' REAL_DIR="$(CDPATH= cd -- "$(dirname -- "$REAL_GH")" && pwd)"',
312
- ' REAL_BASE="$(basename -- "$REAL_GH")"',
313
- ' REAL_MOVED="$REAL_DIR/${REAL_BASE}.mda-real"',
314
- ' TOKEN_ABS="$HOME/.config/mda/github_token"',
315
- ' if [ -x "$REAL_GH" ] && [ -w "$REAL_DIR" ] && ! grep -q MDA_GH_WRAPPER "$REAL_GH" 2>/dev/null; then',
316
- ' mv "$REAL_GH" "$REAL_MOVED"',
317
- " {",
318
- " echo '#!/bin/sh'",
319
- " echo '# MDA_GH_WRAPPER'",
320
- " echo \"TOKEN_FILE='$TOKEN_ABS'\"",
321
- " echo 'if [ -f \"$TOKEN_FILE\" ]; then'",
322
- ' echo \' export GH_TOKEN="$(cat "$TOKEN_FILE")"\'',
323
- " echo ' export GITHUB_TOKEN=\"$GH_TOKEN\"'",
324
- " echo 'fi'",
325
- ' echo "exec \'$REAL_MOVED\' \\"\\$@\\""',
326
- ' } > "$REAL_GH"',
327
- ' chmod 755 "$REAL_GH"',
328
- " fi",
329
- ' gh auth login --hostname github.com --with-token < "$TOKEN_ABS" >/dev/null 2>&1 || true',
330
- " gh auth setup-git >/dev/null 2>&1 || true",
331
- "fi",
332
- // `gh auth setup-git` clears github.com helpers — re-force the file helper.
333
- "git config --global --unset-all credential.https://github.com.helper 2>/dev/null || true",
334
- 'git config --global credential.https://github.com.helper "$HOME/.config/mda/git-credential-mda.sh"',
335
- 'git config --global credential.helper "$HOME/.config/mda/git-credential-mda.sh"',
336
- "export GIT_TERMINAL_PROMPT=0",
337
- ];
338
- if (options?.light) {
339
- return lines;
340
- }
341
- return [
342
- ...lines,
343
- // Commit as the connected GitHub user when possible (create/reuse only).
344
- "if command -v gh >/dev/null 2>&1; then",
345
- ' GH_LOGIN="$(gh api user -q .login 2>/dev/null || true)"',
346
- ' GH_EMAIL="$(gh api user -q .email 2>/dev/null || true)"',
347
- ' if [ -z "$GH_EMAIL" ] || [ "$GH_EMAIL" = "null" ]; then',
348
- ' GH_EMAIL="${GH_LOGIN}@users.noreply.github.com"',
349
- " fi",
350
- ' if [ -n "$GH_LOGIN" ] && [ "$GH_LOGIN" != "null" ]; then',
351
- ' git config --global user.name "$GH_LOGIN"',
352
- ' git config --global user.email "$GH_EMAIL"',
353
- " fi",
354
- "fi",
355
- 'if [ -z "$(git config --global --get user.email 2>/dev/null || true)" ]; then',
356
- ' git config --global user.name "Managed Deep Agent"',
357
- ' git config --global user.email "agent@users.noreply.github.com"',
358
- "fi",
359
- ];
360
- }
361
- /** Marker file written when a static checkout cannot be cloned. */
362
- export const CLONE_FAILED_MARKDOWN = "CLONE_FAILED.md";
363
- function cloneRepositoryScriptLines(repo) {
364
- const absPath = absoluteCheckoutPath(repo.path);
365
- const path = shellSingleQuote(absPath);
366
- const noticePath = shellSingleQuote(`${absPath}/${CLONE_FAILED_MARKDOWN}`);
367
- const remote = shellSingleQuote(`https://github.com/${repo.repo}.git`);
368
- const repoLabel = repo.repo ?? "unknown";
369
- const ref = repo.ref && !repo.ref.startsWith("event.") ? repo.ref : undefined;
370
- const depth = typeof repo.depth === "number" && repo.depth >= 1 ? String(repo.depth) : "";
371
- const lines = [
372
- `mkdir -p "$(dirname -- ${path})"`,
373
- `if [ ! -d ${path}/.git ]; then`,
374
- ` CLONE_ARGS=()`,
375
- ];
376
- if (ref) {
377
- lines.push(` CLONE_ARGS+=(--branch ${shellSingleQuote(ref)})`);
378
- }
379
- if (depth) {
380
- lines.push(` CLONE_ARGS+=(--depth ${shellSingleQuote(depth)})`);
381
- }
382
- if (repo.sparsePaths && repo.sparsePaths.length > 0) {
383
- lines.push(` CLONE_ARGS+=(--filter=blob:none --sparse)`);
384
- }
385
- // Clone failures must not abort provisioning — leave a notice for the agent.
386
- // Use `if ! clone; then …; else …; fi` so the failure branch is valid even
387
- // when there is no post-clone work (empty `then` before `else` is a syntax error).
388
- lines.push(` if ! git clone "\${CLONE_ARGS[@]}" ${remote} ${path}; then`);
389
- lines.push(` rm -rf ${path}`, ` mkdir -p ${path}`, ` cat > ${noticePath} <<'MDA_CLONE_FAILED_EOF'`, "# Repository clone failed", "", `MDA could not clone ${repoLabel} into this directory.`, "", "Common causes:", "- the branch/ref does not exist on the remote (omit ref to use the default branch)", "- the repository is private and Connect-with-GitHub / GITHUB_TOKEN cannot access it", "- the repository name is wrong or was renamed", "- network / GitHub availability issues", "", "The agent run continued without this checkout. Fix access (or set", "MDA_GITHUB_CHECKOUT_REPO to a repo you can read), then start a new thread", "so the sandbox is reprovisioned.", "MDA_CLONE_FAILED_EOF", ` echo "connectors.github(...): clone failed for ${repoLabel}; wrote ${CLONE_FAILED_MARKDOWN}" >&2`);
390
- if ((repo.sparsePaths && repo.sparsePaths.length > 0) || repo.submodules) {
391
- lines.push(" else");
392
- if (repo.sparsePaths && repo.sparsePaths.length > 0) {
393
- lines.push(` git -C ${path} sparse-checkout set ${repo.sparsePaths
394
- .map((p) => shellSingleQuote(p))
395
- .join(" ")}`);
396
- }
397
- if (repo.submodules) {
398
- lines.push(` git -C ${path} submodule update --init --recursive`);
399
- }
400
- }
401
- lines.push(" fi", "fi");
402
- return lines;
403
- }
404
- function reuseRepositoryScriptLines(repo) {
405
- const onReuse = repo.onReuse ?? "fetch";
406
- if (onReuse === "keep") {
407
- return [];
408
- }
409
- const path = shellSingleQuote(absoluteCheckoutPath(repo.path));
410
- const ref = repo.ref && !repo.ref.startsWith("event.") ? repo.ref : "HEAD";
411
- const quotedRef = shellSingleQuote(ref);
412
- const lines = [
413
- `if [ -d ${path}/.git ]; then`,
414
- // Soft-fail refresh so a stale remote cannot abort the run.
415
- ` git -C ${path} fetch --prune origin ${quotedRef} || echo "connectors.github(...): fetch failed for ${path}" >&2`,
416
- ];
417
- if (onReuse === "reset") {
418
- lines.push(` git -C ${path} checkout -f ${quotedRef} || true`, ` git -C ${path} reset --hard FETCH_HEAD || true`);
419
- }
420
- else {
421
- lines.push(` git -C ${path} checkout ${quotedRef} || true`, ` git -C ${path} pull --ff-only origin ${quotedRef} || git -C ${path} merge --ff-only FETCH_HEAD || true`);
422
- }
423
- if (repo.submodules) {
424
- lines.push(` git -C ${path} submodule update --init --recursive || true`);
425
- }
426
- lines.push("fi");
427
- return lines;
428
- }
429
- /**
430
- * Resolve an authoring-relative checkout path to the absolute sandbox location.
431
- *
432
- * Authoring forbids absolute paths; deepagents filesystem tools require them.
433
- * `workspace/...` maps to `/workspace/...` to match fixture/setup conventions.
434
- */
435
- export function absoluteCheckoutPath(relativePath) {
436
- const stripped = relativePath.replace(/^\.?\//, "");
437
- if (stripped === "workspace" || stripped.startsWith("workspace/")) {
438
- return `/${stripped}`;
439
- }
440
- return `/workspace/${stripped}`;
441
- }
442
- async function uploadAndRun(backend, connector, script, extraFiles = []) {
443
- const files = [
444
- ...extraFiles,
445
- [GITHUB_PROVISION_REMOTE_PATH, new TextEncoder().encode(script)],
446
- ];
447
- const sandboxId = "id" in backend && typeof backend.id === "string"
448
- ? backend.id
449
- : null;
450
- let result;
451
- if (typeof backend.uploadFiles === "function") {
452
- console.info(`[mda] github sandbox provision: uploading ${files.length} file(s) ` +
453
- `sandbox_id=${JSON.stringify(sandboxId)} path=${GITHUB_PROVISION_REMOTE_PATH}`);
454
- await backend.uploadFiles(files);
455
- console.info(`[mda] github sandbox provision: starting execute ` +
456
- `sandbox_id=${JSON.stringify(sandboxId)} ` +
457
- `cmd=${JSON.stringify(`bash ${GITHUB_PROVISION_REMOTE_PATH}`)}`);
458
- // Fresh sandboxes often reject the first websocket execute; retry in place.
459
- result = (await executeWithStreamRetry((command) => backend.execute(command), `bash ${GITHUB_PROVISION_REMOTE_PATH}`, { label: "github-provision" }));
460
- }
461
- else {
462
- console.info(`[mda] github sandbox provision: starting inline execute ` +
463
- `sandbox_id=${JSON.stringify(sandboxId)}`);
464
- result = (await executeWithStreamRetry((command) => backend.execute(command), script, { label: "github-provision (inline)" }));
465
- }
466
- if (typeof result.exitCode === "number" && result.exitCode !== 0) {
467
- // Clone/ref failures must not abort the agent run. Leave notice files and
468
- // continue — the in-script soft-fail is the primary path; this is a belt
469
- // for shells/`set -e` edge cases and older provision scripts.
470
- if (isBenignCheckoutFailure(result.output ?? "")) {
471
- await writeCloneFailedNotices(backend, connector, result.output ?? "");
472
- return;
473
- }
474
- assertSetupSucceeded(result);
475
- }
476
- }
477
- /** True when provision failed for a recoverable git checkout reason. */
478
- export function isBenignCheckoutFailure(output) {
479
- return /Cloning into|git clone|CLONE_FAILED|Remote branch .+ not found|Repository not found|could not read Username|Authentication failed/i.test(output);
480
- }
481
- function cloneFailedMarkdown(repo, detail) {
482
- const trimmed = detail.trim();
483
- return [
484
- "# Repository clone failed",
485
- "",
486
- `MDA could not clone \`${repo}\` into this directory.`,
487
- "",
488
- "Common causes:",
489
- "- the branch/ref does not exist on the remote (omit `ref` to use the default branch)",
490
- "- the repository is private and Connect-with-GitHub / `GITHUB_TOKEN` cannot access it",
491
- "- the repository name is wrong or was renamed",
492
- "",
493
- "The agent run continued without this checkout. Fix the connector config",
494
- "and start a new thread so the sandbox is reprovisioned.",
495
- ...(trimmed
496
- ? ["", "## git output", "", "```", trimmed.slice(0, 2000), "```"]
497
- : []),
498
- "",
499
- ].join("\n");
500
- }
501
- async function writeCloneFailedNotices(backend, connector, detail) {
502
- const notices = [];
503
- for (const repo of connector.repositories) {
504
- if (!repo.repo)
505
- continue;
506
- const abs = absoluteCheckoutPath(repo.path);
507
- notices.push([
508
- `${abs}/${CLONE_FAILED_MARKDOWN}`,
509
- new TextEncoder().encode(cloneFailedMarkdown(repo.repo, detail)),
510
- ]);
511
- }
512
- if (notices.length === 0)
513
- return;
514
- if (typeof backend.uploadFiles === "function") {
515
- // Ensure parent dirs exist before upload when the backend requires it.
516
- for (const [remotePath] of notices) {
517
- const dir = remotePath.slice(0, remotePath.lastIndexOf("/"));
518
- await backend.execute(`mkdir -p ${shellSingleQuote(dir)}`);
519
- }
520
- await backend.uploadFiles(notices);
521
- return;
522
- }
523
- for (const [remotePath, bytes] of notices) {
524
- const dir = remotePath.slice(0, remotePath.lastIndexOf("/"));
525
- const content = new TextDecoder().decode(bytes);
526
- await backend.execute(`mkdir -p ${shellSingleQuote(dir)} && cat > ${shellSingleQuote(remotePath)} <<'MDA_CLONE_FAILED_EOF'\n${content}MDA_CLONE_FAILED_EOF`);
527
- }
528
- }
529
- function shellSingleQuote(value) {
530
- return `'${value.replace(/'/g, `'\\''`)}'`;
531
- }
532
- //# sourceMappingURL=sandbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../../src/connectors/github/sandbox.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAK/E,OAAO,EAAE,yBAAyB,EA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uE;QACvE,KAAK,MAAM,CAAC,UAAU,CAAC,IAAI,OAAO,EAAE,CAAC;YACnC,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;YAC7D,MAAM,OAAO,CAAC,OAAO,CAAC,YAAY,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC7D,CAAC;QACD,MAAM,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO;IACT,CAAC;IACD,KAAK,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC;QAC1C,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,OAAO,CAAC,OAAO,CACnB,YAAY,gBAAgB,CAAC,GAAG,CAAC,aAAa,gBAAgB,CAAC,UAAU,CAAC,8BAA8B,OAAO,sBAAsB,CACtI,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa;IACrC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;AAC7C,CAAC"}
@@ -1,24 +0,0 @@
1
- /**
2
- * Stable GitHub source-thread keys for trusted channel ingress.
3
- *
4
- * Prefer issue/PR scoped keys when a number is known:
5
- * `github:<installationId>:<owner>/<repo>#<number>`
6
- * Otherwise fall back to delivery-scoped keys:
7
- * `github:<installationId>:<owner>/<repo>:delivery:<deliveryId>`
8
- * `github:<installationId>:delivery:<deliveryId>`
9
- */
10
- export declare function encodeGitHubSourceThreadKey(input: {
11
- installationId: string;
12
- owner?: string;
13
- repo?: string;
14
- number?: number;
15
- deliveryId?: string;
16
- }): string;
17
- export declare function decodeGitHubSourceThreadKey(key: string): {
18
- installationId: string;
19
- owner?: string;
20
- repo?: string;
21
- number?: number;
22
- deliveryId?: string;
23
- } | null;
24
- //# sourceMappingURL=source-thread.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"source-thread.d.ts","sourceRoot":"","sources":["../../../src/connectors/github/source-thread.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,MAAM,CAiBT;AAED,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,GAAG;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,IAAI,CA6BP"}