managed-deepagents 0.9.6-dev.15 → 0.9.6-dev.17

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 (343) hide show
  1. package/README.md +57 -953
  2. package/dist/agent-auth.d.ts +1 -1
  3. package/dist/agent-auth.d.ts.map +1 -1
  4. package/dist/agent-auth.js +12 -36
  5. package/dist/agent-auth.js.map +1 -1
  6. package/dist/channels/assistant-text.d.ts +0 -24
  7. package/dist/channels/assistant-text.d.ts.map +1 -1
  8. package/dist/channels/assistant-text.js +1 -65
  9. package/dist/channels/assistant-text.js.map +1 -1
  10. package/dist/channels/binding.d.ts +1 -20
  11. package/dist/channels/binding.d.ts.map +1 -1
  12. package/dist/channels/binding.js +10 -39
  13. package/dist/channels/binding.js.map +1 -1
  14. package/dist/channels/http/http.d.ts.map +1 -1
  15. package/dist/channels/http/http.js +65 -386
  16. package/dist/channels/http/http.js.map +1 -1
  17. package/dist/channels/http/index.d.ts +1 -2
  18. package/dist/channels/http/index.d.ts.map +1 -1
  19. package/dist/channels/http/index.js +10 -14
  20. package/dist/channels/http/index.js.map +1 -1
  21. package/dist/channels/http/ingress.d.ts +5 -65
  22. package/dist/channels/http/ingress.d.ts.map +1 -1
  23. package/dist/channels/http/ingress.js +33 -149
  24. package/dist/channels/http/ingress.js.map +1 -1
  25. package/dist/channels/http/types.d.ts +2 -143
  26. package/dist/channels/http/types.d.ts.map +1 -1
  27. package/dist/channels/message-schema.d.ts +0 -2
  28. package/dist/channels/message-schema.d.ts.map +1 -1
  29. package/dist/channels/message-schema.js +0 -4
  30. package/dist/channels/message-schema.js.map +1 -1
  31. package/dist/channels/messaging-registry.d.ts +0 -16
  32. package/dist/channels/messaging-registry.d.ts.map +1 -1
  33. package/dist/channels/messaging-registry.js +0 -29
  34. package/dist/channels/messaging-registry.js.map +1 -1
  35. package/dist/channels/runtime.d.ts +1 -1
  36. package/dist/channels/runtime.d.ts.map +1 -1
  37. package/dist/channels/runtime.js +1 -1
  38. package/dist/channels/runtime.js.map +1 -1
  39. package/dist/channels/schedule-delivery.d.ts +1 -1
  40. package/dist/channels/schedule-delivery.d.ts.map +1 -1
  41. package/dist/channels/schedule-delivery.js +23 -12
  42. package/dist/channels/schedule-delivery.js.map +1 -1
  43. package/dist/channels/slack/api.d.ts +0 -2
  44. package/dist/channels/slack/api.d.ts.map +1 -1
  45. package/dist/channels/slack/api.js +0 -6
  46. package/dist/channels/slack/api.js.map +1 -1
  47. package/dist/channels/slack/files.d.ts.map +1 -1
  48. package/dist/channels/slack/files.js +3 -2
  49. package/dist/channels/slack/files.js.map +1 -1
  50. package/dist/channels/slack/index.d.ts +2 -76
  51. package/dist/channels/slack/index.d.ts.map +1 -1
  52. package/dist/channels/slack/index.js +6 -177
  53. package/dist/channels/slack/index.js.map +1 -1
  54. package/dist/channels/slack/message-content.d.ts.map +1 -1
  55. package/dist/channels/slack/message-content.js +28 -23
  56. package/dist/channels/slack/message-content.js.map +1 -1
  57. package/dist/channels/source-providers.js +1 -1
  58. package/dist/channels/source-providers.js.map +1 -1
  59. package/dist/channels/trigger/client.d.ts.map +1 -1
  60. package/dist/channels/trigger/client.js +12 -6
  61. package/dist/channels/trigger/client.js.map +1 -1
  62. package/dist/channels/trigger/http.d.ts +3 -114
  63. package/dist/channels/trigger/http.d.ts.map +1 -1
  64. package/dist/channels/trigger/http.js +82 -314
  65. package/dist/channels/trigger/http.js.map +1 -1
  66. package/dist/channels/trigger/identity-context.d.ts +1 -1
  67. package/dist/channels/trigger/identity-context.d.ts.map +1 -1
  68. package/dist/channels/trigger/identity-context.js +3 -5
  69. package/dist/channels/trigger/identity-context.js.map +1 -1
  70. package/dist/channels/trigger/ingress.d.ts +1 -38
  71. package/dist/channels/trigger/ingress.d.ts.map +1 -1
  72. package/dist/channels/trigger/ingress.js +24 -49
  73. package/dist/channels/trigger/ingress.js.map +1 -1
  74. package/dist/channels/trigger/types.d.ts +3 -82
  75. package/dist/channels/trigger/types.d.ts.map +1 -1
  76. package/dist/channels/trigger/types.js +0 -36
  77. package/dist/channels/trigger/types.js.map +1 -1
  78. package/dist/channels/types.d.ts +3 -19
  79. package/dist/channels/types.d.ts.map +1 -1
  80. package/dist/channels/types.js +0 -2
  81. package/dist/channels/types.js.map +1 -1
  82. package/dist/concurrency/batch-processor.d.ts +51 -0
  83. package/dist/concurrency/batch-processor.d.ts.map +1 -0
  84. package/dist/concurrency/batch-processor.js +99 -0
  85. package/dist/concurrency/batch-processor.js.map +1 -0
  86. package/dist/connections.d.ts +1 -42
  87. package/dist/connections.d.ts.map +1 -1
  88. package/dist/connections.js +14 -127
  89. package/dist/connections.js.map +1 -1
  90. package/dist/credential-gate.d.ts +0 -2
  91. package/dist/credential-gate.d.ts.map +1 -1
  92. package/dist/credential-gate.js +3 -37
  93. package/dist/credential-gate.js.map +1 -1
  94. package/dist/define-deep-agent.d.ts.map +1 -1
  95. package/dist/define-deep-agent.js +0 -6
  96. package/dist/define-deep-agent.js.map +1 -1
  97. package/dist/identity/loopback.d.ts +7 -2
  98. package/dist/identity/loopback.d.ts.map +1 -1
  99. package/dist/identity/loopback.js +15 -4
  100. package/dist/identity/loopback.js.map +1 -1
  101. package/dist/identity/slack/links.js +3 -2
  102. package/dist/identity/slack/links.js.map +1 -1
  103. package/dist/index.d.ts +4 -15
  104. package/dist/index.d.ts.map +1 -1
  105. package/dist/index.js +1 -2
  106. package/dist/index.js.map +1 -1
  107. package/dist/ingress/index.d.ts +8 -0
  108. package/dist/ingress/index.d.ts.map +1 -1
  109. package/dist/ingress/index.js +32 -2
  110. package/dist/ingress/index.js.map +1 -1
  111. package/dist/ingress/loopback.js +4 -3
  112. package/dist/ingress/loopback.js.map +1 -1
  113. package/dist/ingress/runs.d.ts +1 -74
  114. package/dist/ingress/runs.d.ts.map +1 -1
  115. package/dist/ingress/runs.js +16 -176
  116. package/dist/ingress/runs.js.map +1 -1
  117. package/dist/managed-composition.d.ts.map +1 -1
  118. package/dist/managed-composition.js +13 -8
  119. package/dist/managed-composition.js.map +1 -1
  120. package/dist/memory/instructions-middleware.d.ts.map +1 -1
  121. package/dist/memory/instructions-middleware.js +6 -5
  122. package/dist/memory/instructions-middleware.js.map +1 -1
  123. package/dist/namespaces.d.ts +21 -21
  124. package/dist/namespaces.d.ts.map +1 -1
  125. package/dist/namespaces.js +29 -4
  126. package/dist/namespaces.js.map +1 -1
  127. package/dist/resilience/retry.d.ts +21 -0
  128. package/dist/resilience/retry.d.ts.map +1 -0
  129. package/dist/resilience/retry.js +40 -0
  130. package/dist/resilience/retry.js.map +1 -0
  131. package/dist/runtime/auth.d.ts.map +1 -1
  132. package/dist/runtime/auth.js +21 -151
  133. package/dist/runtime/auth.js.map +1 -1
  134. package/dist/runtime/channel.d.ts +0 -6
  135. package/dist/runtime/channel.d.ts.map +1 -1
  136. package/dist/runtime/channel.js.map +1 -1
  137. package/dist/runtime/graph-build-timing.d.ts +30 -0
  138. package/dist/runtime/graph-build-timing.d.ts.map +1 -0
  139. package/dist/runtime/graph-build-timing.js +50 -0
  140. package/dist/runtime/graph-build-timing.js.map +1 -0
  141. package/dist/runtime/http.d.ts +15 -0
  142. package/dist/runtime/http.d.ts.map +1 -1
  143. package/dist/runtime/http.js +37 -0
  144. package/dist/runtime/http.js.map +1 -1
  145. package/dist/runtime/identity-http.d.ts +0 -2
  146. package/dist/runtime/identity-http.d.ts.map +1 -1
  147. package/dist/runtime/identity-http.js +16 -40
  148. package/dist/runtime/identity-http.js.map +1 -1
  149. package/dist/runtime/identity-runtime.d.ts +0 -10
  150. package/dist/runtime/identity-runtime.d.ts.map +1 -1
  151. package/dist/runtime/identity-runtime.js +0 -22
  152. package/dist/runtime/identity-runtime.js.map +1 -1
  153. package/dist/runtime/index.d.ts.map +1 -1
  154. package/dist/runtime/index.js +47 -46
  155. package/dist/runtime/index.js.map +1 -1
  156. package/dist/runtime/langsmith-env.d.ts +19 -0
  157. package/dist/runtime/langsmith-env.d.ts.map +1 -0
  158. package/dist/runtime/langsmith-env.js +38 -0
  159. package/dist/runtime/langsmith-env.js.map +1 -0
  160. package/dist/runtime/log.d.ts +8 -14
  161. package/dist/runtime/log.d.ts.map +1 -1
  162. package/dist/runtime/log.js +16 -7
  163. package/dist/runtime/log.js.map +1 -1
  164. package/dist/runtime/managed-middleware.d.ts.map +1 -1
  165. package/dist/runtime/managed-middleware.js +1 -14
  166. package/dist/runtime/managed-middleware.js.map +1 -1
  167. package/dist/runtime/managed-tools.d.ts +10 -10
  168. package/dist/runtime/managed-tools.d.ts.map +1 -1
  169. package/dist/runtime/managed-tools.js +24 -24
  170. package/dist/runtime/managed-tools.js.map +1 -1
  171. package/dist/runtime/memory/mounts.d.ts +82 -11
  172. package/dist/runtime/memory/mounts.d.ts.map +1 -1
  173. package/dist/runtime/memory/mounts.js +173 -34
  174. package/dist/runtime/memory/mounts.js.map +1 -1
  175. package/dist/runtime/memory/policy.d.ts.map +1 -1
  176. package/dist/runtime/memory/policy.js +3 -1
  177. package/dist/runtime/memory/policy.js.map +1 -1
  178. package/dist/runtime/run-input.d.ts +0 -10
  179. package/dist/runtime/run-input.d.ts.map +1 -1
  180. package/dist/runtime/run-input.js +19 -47
  181. package/dist/runtime/run-input.js.map +1 -1
  182. package/dist/runtime/sandbox-manager.d.ts +1 -1
  183. package/dist/runtime/sandbox-manager.d.ts.map +1 -1
  184. package/dist/runtime/sandbox-manager.js +10 -15
  185. package/dist/runtime/sandbox-manager.js.map +1 -1
  186. package/dist/runtime/schedule-auth.d.ts +0 -17
  187. package/dist/runtime/schedule-auth.d.ts.map +1 -1
  188. package/dist/runtime/schedule-auth.js +3 -40
  189. package/dist/runtime/schedule-auth.js.map +1 -1
  190. package/dist/runtime/selected-skills-backend.d.ts +3 -3
  191. package/dist/runtime/selected-skills-backend.d.ts.map +1 -1
  192. package/dist/runtime/selected-skills-backend.js +5 -5
  193. package/dist/runtime/selected-skills-backend.js.map +1 -1
  194. package/dist/runtime/types.d.ts +1 -5
  195. package/dist/runtime/types.d.ts.map +1 -1
  196. package/dist/runtime-schedules.d.ts +0 -13
  197. package/dist/runtime-schedules.d.ts.map +1 -1
  198. package/dist/runtime-schedules.js +22 -86
  199. package/dist/runtime-schedules.js.map +1 -1
  200. package/dist/sandbox.d.ts +6 -0
  201. package/dist/sandbox.d.ts.map +1 -1
  202. package/dist/sandbox.js +7 -3
  203. package/dist/sandbox.js.map +1 -1
  204. package/dist/schedule-channel.d.ts +2 -5
  205. package/dist/schedule-channel.d.ts.map +1 -1
  206. package/dist/schedule-channel.js +12 -13
  207. package/dist/schedule-channel.js.map +1 -1
  208. package/dist/telemetry/lifecycle.d.ts +26 -0
  209. package/dist/telemetry/lifecycle.d.ts.map +1 -0
  210. package/dist/telemetry/lifecycle.js +49 -0
  211. package/dist/telemetry/lifecycle.js.map +1 -0
  212. package/dist/telemetry/metadata.d.ts.map +1 -1
  213. package/dist/telemetry/metadata.js +4 -4
  214. package/dist/telemetry/metadata.js.map +1 -1
  215. package/dist/telemetry/otel/context.d.ts +57 -0
  216. package/dist/telemetry/otel/context.d.ts.map +1 -0
  217. package/dist/telemetry/otel/context.js +122 -0
  218. package/dist/telemetry/otel/context.js.map +1 -0
  219. package/dist/telemetry/otel/exporter.d.ts +53 -0
  220. package/dist/telemetry/otel/exporter.d.ts.map +1 -0
  221. package/dist/telemetry/otel/exporter.js +190 -0
  222. package/dist/telemetry/otel/exporter.js.map +1 -0
  223. package/dist/telemetry/otel/index.d.ts +6 -0
  224. package/dist/telemetry/otel/index.d.ts.map +1 -0
  225. package/dist/telemetry/otel/index.js +3 -0
  226. package/dist/telemetry/otel/index.js.map +1 -0
  227. package/dist/telemetry/otel/otlp.d.ts +44 -0
  228. package/dist/telemetry/otel/otlp.d.ts.map +1 -0
  229. package/dist/telemetry/otel/otlp.js +7 -0
  230. package/dist/telemetry/otel/otlp.js.map +1 -0
  231. package/dist/telemetry/otel/truncate.d.ts +10 -0
  232. package/dist/telemetry/otel/truncate.d.ts.map +1 -0
  233. package/dist/telemetry/otel/truncate.js +39 -0
  234. package/dist/telemetry/otel/truncate.js.map +1 -0
  235. package/dist/telemetry/run-listener.d.ts +1 -1
  236. package/dist/telemetry/run-listener.d.ts.map +1 -1
  237. package/dist/telemetry/run-listener.js +32 -2
  238. package/dist/telemetry/run-listener.js.map +1 -1
  239. package/dist/telemetry/transport/posthog.d.ts +13 -1
  240. package/dist/telemetry/transport/posthog.d.ts.map +1 -1
  241. package/dist/telemetry/transport/posthog.js +68 -30
  242. package/dist/telemetry/transport/posthog.js.map +1 -1
  243. package/package.json +11 -11
  244. package/dist/channels/actor.d.ts +0 -43
  245. package/dist/channels/actor.d.ts.map +0 -1
  246. package/dist/channels/actor.js +0 -2
  247. package/dist/channels/actor.js.map +0 -1
  248. package/dist/channels/delivery.d.ts +0 -21
  249. package/dist/channels/delivery.d.ts.map +0 -1
  250. package/dist/channels/delivery.js +0 -196
  251. package/dist/channels/delivery.js.map +0 -1
  252. package/dist/channels/github/connections.d.ts +0 -11
  253. package/dist/channels/github/connections.d.ts.map +0 -1
  254. package/dist/channels/github/connections.js +0 -14
  255. package/dist/channels/github/connections.js.map +0 -1
  256. package/dist/channels/github/index.d.ts +0 -8
  257. package/dist/channels/github/index.d.ts.map +0 -1
  258. package/dist/channels/github/index.js +0 -274
  259. package/dist/channels/github/index.js.map +0 -1
  260. package/dist/channels/github/mentions.d.ts +0 -12
  261. package/dist/channels/github/mentions.d.ts.map +0 -1
  262. package/dist/channels/github/mentions.js +0 -185
  263. package/dist/channels/github/mentions.js.map +0 -1
  264. package/dist/channels/github/schema.d.ts +0 -4165
  265. package/dist/channels/github/schema.d.ts.map +0 -1
  266. package/dist/channels/github/schema.js +0 -221
  267. package/dist/channels/github/schema.js.map +0 -1
  268. package/dist/channels/github/types.d.ts +0 -163
  269. package/dist/channels/github/types.d.ts.map +0 -1
  270. package/dist/channels/github/types.js +0 -2
  271. package/dist/channels/github/types.js.map +0 -1
  272. package/dist/channels/http/endpoint.d.ts +0 -95
  273. package/dist/channels/http/endpoint.d.ts.map +0 -1
  274. package/dist/channels/http/endpoint.js +0 -276
  275. package/dist/channels/http/endpoint.js.map +0 -1
  276. package/dist/channels/http/provider.d.ts +0 -119
  277. package/dist/channels/http/provider.d.ts.map +0 -1
  278. package/dist/channels/http/provider.js +0 -227
  279. package/dist/channels/http/provider.js.map +0 -1
  280. package/dist/channels/http/studio.d.ts +0 -24
  281. package/dist/channels/http/studio.d.ts.map +0 -1
  282. package/dist/channels/http/studio.js +0 -95
  283. package/dist/channels/http/studio.js.map +0 -1
  284. package/dist/channels/http/threads.d.ts +0 -7
  285. package/dist/channels/http/threads.d.ts.map +0 -1
  286. package/dist/channels/http/threads.js +0 -10
  287. package/dist/channels/http/threads.js.map +0 -1
  288. package/dist/channels/linear/connections.d.ts +0 -11
  289. package/dist/channels/linear/connections.d.ts.map +0 -1
  290. package/dist/channels/linear/connections.js +0 -14
  291. package/dist/channels/linear/connections.js.map +0 -1
  292. package/dist/channels/linear/graphql.d.ts +0 -57
  293. package/dist/channels/linear/graphql.d.ts.map +0 -1
  294. package/dist/channels/linear/graphql.js +0 -167
  295. package/dist/channels/linear/graphql.js.map +0 -1
  296. package/dist/channels/linear/index.d.ts +0 -9
  297. package/dist/channels/linear/index.d.ts.map +0 -1
  298. package/dist/channels/linear/index.js +0 -489
  299. package/dist/channels/linear/index.js.map +0 -1
  300. package/dist/channels/linear/schema.d.ts +0 -1050
  301. package/dist/channels/linear/schema.d.ts.map +0 -1
  302. package/dist/channels/linear/schema.js +0 -255
  303. package/dist/channels/linear/schema.js.map +0 -1
  304. package/dist/channels/linear/types.d.ts +0 -162
  305. package/dist/channels/linear/types.d.ts.map +0 -1
  306. package/dist/channels/linear/types.js +0 -2
  307. package/dist/channels/linear/types.js.map +0 -1
  308. package/dist/channels/reserved-connections.d.ts +0 -12
  309. package/dist/channels/reserved-connections.d.ts.map +0 -1
  310. package/dist/channels/reserved-connections.js +0 -55
  311. package/dist/channels/reserved-connections.js.map +0 -1
  312. package/dist/channels/run-input.d.ts +0 -71
  313. package/dist/channels/run-input.d.ts.map +0 -1
  314. package/dist/channels/run-input.js +0 -155
  315. package/dist/channels/run-input.js.map +0 -1
  316. package/dist/channels/slack/connections.d.ts +0 -6
  317. package/dist/channels/slack/connections.d.ts.map +0 -1
  318. package/dist/channels/slack/connections.js +0 -6
  319. package/dist/channels/slack/connections.js.map +0 -1
  320. package/dist/channels/slack/events.d.ts +0 -272
  321. package/dist/channels/slack/events.d.ts.map +0 -1
  322. package/dist/channels/slack/events.js +0 -235
  323. package/dist/channels/slack/events.js.map +0 -1
  324. package/dist/channels/slack/status.d.ts +0 -76
  325. package/dist/channels/slack/status.d.ts.map +0 -1
  326. package/dist/channels/slack/status.js +0 -427
  327. package/dist/channels/slack/status.js.map +0 -1
  328. package/dist/runtime/channel-icon.d.ts +0 -22
  329. package/dist/runtime/channel-icon.d.ts.map +0 -1
  330. package/dist/runtime/channel-icon.js +0 -70
  331. package/dist/runtime/channel-icon.js.map +0 -1
  332. package/dist/runtime/managed-thread.d.ts +0 -60
  333. package/dist/runtime/managed-thread.d.ts.map +0 -1
  334. package/dist/runtime/managed-thread.js +0 -76
  335. package/dist/runtime/managed-thread.js.map +0 -1
  336. package/dist/runtime/thread-record.d.ts +0 -81
  337. package/dist/runtime/thread-record.d.ts.map +0 -1
  338. package/dist/runtime/thread-record.js +0 -205
  339. package/dist/runtime/thread-record.js.map +0 -1
  340. package/dist/values.d.ts +0 -15
  341. package/dist/values.d.ts.map +0 -1
  342. package/dist/values.js +0 -31
  343. package/dist/values.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/channels/github/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,eAAO,MAAM,sBAAsB,aAA8B,CAAC;AAElE,gFAAgF;AAChF,eAAO,MAAM,mBAAm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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAEF,CAAC"}
@@ -1,221 +0,0 @@
1
- import { z } from "zod";
2
- import { eventMentions } from "./mentions.js";
3
- import { nonblankStringSchema } from "../message-schema.js";
4
- // Shared scalar constraints. Dispatch IDs are positive safe integers.
5
- const nullableTextSchema = z.string().nullable();
6
- export const githubIdentifierSchema = z.number().int().positive();
7
- /** Receipt metadata only, not a complete GitHub event payload specification. */
8
- export const githubReceiptSchema = z.object({
9
- event: nonblankStringSchema,
10
- deliveryId: nonblankStringSchema,
11
- payload: z.looseObject({
12
- action: z.string().optional(),
13
- repository: z.looseObject({ id: z.number().int().optional() }).optional(),
14
- issue: z.looseObject({ number: z.number().int().optional() }).optional(),
15
- pull_request: z
16
- .looseObject({ number: z.number().int().optional() })
17
- .optional(),
18
- }),
19
- });
20
- // Payload subjects. Loose objects retain unmodeled provider fields.
21
- const issueSchema = z.looseObject({
22
- number: githubIdentifierSchema,
23
- title: nonblankStringSchema,
24
- body: nullableTextSchema,
25
- pull_request: z.record(z.string(), z.unknown()).optional(),
26
- });
27
- const pullRequestSchema = issueSchema.extend({
28
- draft: z.boolean().optional(),
29
- merged: z.boolean().optional(),
30
- });
31
- const commentSchema = z.looseObject({
32
- id: githubIdentifierSchema,
33
- body: z.string(),
34
- });
35
- const labelSchema = z.looseObject({ name: nonblankStringSchema });
36
- const reviewSchema = z.looseObject({
37
- id: githubIdentifierSchema,
38
- body: nullableTextSchema,
39
- state: nonblankStringSchema,
40
- });
41
- const workflowRunSchema = z.looseObject({
42
- id: githubIdentifierSchema,
43
- conclusion: nullableTextSchema,
44
- pull_requests: z.array(z.record(z.string(), z.unknown())),
45
- });
46
- const checkRunSchema = z.looseObject({
47
- id: githubIdentifierSchema,
48
- name: nonblankStringSchema,
49
- head_sha: nonblankStringSchema,
50
- conclusion: nullableTextSchema,
51
- pull_requests: z.array(z.record(z.string(), z.unknown())),
52
- });
53
- const checkSuiteSchema = z.looseObject({
54
- id: githubIdentifierSchema,
55
- head_sha: nonblankStringSchema,
56
- conclusion: nullableTextSchema,
57
- pull_requests: z.array(z.record(z.string(), z.unknown())),
58
- });
59
- // Common dispatch context and reusable payload families.
60
- const senderSchema = z.looseObject({
61
- id: githubIdentifierSchema,
62
- login: nonblankStringSchema,
63
- type: z.enum(["User", "Bot", "Organization"]),
64
- });
65
- const repositorySchema = z.looseObject({
66
- id: githubIdentifierSchema,
67
- owner: z.looseObject({ login: nonblankStringSchema }),
68
- name: nonblankStringSchema,
69
- full_name: nonblankStringSchema,
70
- private: z.boolean(),
71
- });
72
- const dispatchPayloadSchema = z.looseObject({
73
- repository: repositorySchema,
74
- sender: senderSchema,
75
- installation: z.looseObject({ id: githubIdentifierSchema }),
76
- });
77
- const issuePayloadSchema = dispatchPayloadSchema.extend({ issue: issueSchema });
78
- const pullRequestPayloadSchema = dispatchPayloadSchema.extend({
79
- pull_request: pullRequestSchema,
80
- });
81
- function dispatchEventSchema(key, payloadSchema) {
82
- return z.object({
83
- key: z.literal(key),
84
- deliveryId: nonblankStringSchema,
85
- payload: payloadSchema,
86
- });
87
- }
88
- /** Each supported event key requires its exact payload action and subject. */
89
- export const githubDispatchSchema = z.discriminatedUnion("key", [
90
- dispatchEventSchema("issues.opened", issuePayloadSchema.extend({ action: z.literal("opened") })),
91
- dispatchEventSchema("issues.edited", issuePayloadSchema.extend({ action: z.literal("edited") })),
92
- dispatchEventSchema("issues.reopened", issuePayloadSchema.extend({ action: z.literal("reopened") })),
93
- dispatchEventSchema("issues.labeled", issuePayloadSchema.extend({
94
- action: z.literal("labeled"),
95
- label: labelSchema,
96
- })),
97
- dispatchEventSchema("issue_comment.created", issuePayloadSchema.extend({
98
- action: z.literal("created"),
99
- comment: commentSchema,
100
- })),
101
- dispatchEventSchema("issue_comment.edited", issuePayloadSchema.extend({
102
- action: z.literal("edited"),
103
- comment: commentSchema,
104
- })),
105
- dispatchEventSchema("pull_request.opened", pullRequestPayloadSchema.extend({ action: z.literal("opened") })),
106
- dispatchEventSchema("pull_request.edited", pullRequestPayloadSchema.extend({ action: z.literal("edited") })),
107
- dispatchEventSchema("pull_request.reopened", pullRequestPayloadSchema.extend({ action: z.literal("reopened") })),
108
- dispatchEventSchema("pull_request.ready_for_review", pullRequestPayloadSchema.extend({ action: z.literal("ready_for_review") })),
109
- dispatchEventSchema("pull_request.converted_to_draft", pullRequestPayloadSchema.extend({
110
- action: z.literal("converted_to_draft"),
111
- })),
112
- dispatchEventSchema("pull_request.synchronize", pullRequestPayloadSchema.extend({ action: z.literal("synchronize") })),
113
- dispatchEventSchema("pull_request.labeled", pullRequestPayloadSchema.extend({
114
- action: z.literal("labeled"),
115
- label: labelSchema,
116
- })),
117
- dispatchEventSchema("pull_request.closed", pullRequestPayloadSchema.extend({ action: z.literal("closed") })),
118
- dispatchEventSchema("pull_request_review.submitted", pullRequestPayloadSchema.extend({
119
- action: z.literal("submitted"),
120
- review: reviewSchema,
121
- })),
122
- dispatchEventSchema("pull_request_review.edited", pullRequestPayloadSchema.extend({
123
- action: z.literal("edited"),
124
- review: reviewSchema,
125
- })),
126
- dispatchEventSchema("pull_request_review.dismissed", pullRequestPayloadSchema.extend({
127
- action: z.literal("dismissed"),
128
- review: reviewSchema,
129
- })),
130
- dispatchEventSchema("pull_request_review_comment.created", pullRequestPayloadSchema.extend({
131
- action: z.literal("created"),
132
- comment: commentSchema,
133
- })),
134
- dispatchEventSchema("pull_request_review_comment.edited", pullRequestPayloadSchema.extend({
135
- action: z.literal("edited"),
136
- comment: commentSchema,
137
- })),
138
- // Events without an action are keyed by their name alone.
139
- dispatchEventSchema("push", dispatchPayloadSchema.extend({
140
- action: z.never().optional(),
141
- ref: nonblankStringSchema,
142
- before: nonblankStringSchema,
143
- after: nonblankStringSchema,
144
- })),
145
- dispatchEventSchema("status", dispatchPayloadSchema.extend({
146
- action: z.never().optional(),
147
- id: githubIdentifierSchema,
148
- sha: nonblankStringSchema,
149
- state: nonblankStringSchema,
150
- context: nonblankStringSchema,
151
- })),
152
- dispatchEventSchema("check_run.completed", dispatchPayloadSchema.extend({
153
- action: z.literal("completed"),
154
- check_run: checkRunSchema,
155
- })),
156
- dispatchEventSchema("check_suite.completed", dispatchPayloadSchema.extend({
157
- action: z.literal("completed"),
158
- check_suite: checkSuiteSchema,
159
- })),
160
- dispatchEventSchema("workflow_run.completed", dispatchPayloadSchema.extend({
161
- action: z.literal("completed"),
162
- workflow_run: workflowRunSchema,
163
- })),
164
- ]);
165
- /**
166
- * The fields of a GitHub event its endpoints are sent beside its key, delivery
167
- * ID and payload: what a handler gets that the payload doesn't say as plainly.
168
- * The one list of them; `GitHubEndpointRequest` is typed by it.
169
- */
170
- export const ENDPOINT_EVENT_FIELDS = [
171
- "action",
172
- "repository",
173
- "sender",
174
- "actor",
175
- "mentions",
176
- ];
177
- export const SUPPORTED_EVENT_KEYS = githubDispatchSchema.options.map((option) => option.shape.key.value);
178
- /** A webhook's `sender`, as a channel's actor; its login is its name. */
179
- function senderActor(sender) {
180
- return {
181
- provider: "github",
182
- id: String(sender.id),
183
- name: sender.login,
184
- type: sender.type,
185
- };
186
- }
187
- // Expose common routing metadata while preserving the original payload.
188
- export const githubEventSchema = githubDispatchSchema.transform((event) => ({
189
- ...event,
190
- name: event.key.split(".")[0],
191
- // `push` and `status` have no action, and an absent field keeps the
192
- // event JSON.
193
- ...(event.payload.action !== undefined && {
194
- action: event.payload.action,
195
- }),
196
- installationId: event.payload.installation.id,
197
- repository: {
198
- id: event.payload.repository.id,
199
- owner: event.payload.repository.owner.login,
200
- name: event.payload.repository.name,
201
- fullName: event.payload.repository.full_name,
202
- private: event.payload.repository.private,
203
- },
204
- sender: {
205
- id: event.payload.sender.id,
206
- login: event.payload.sender.login,
207
- type: event.payload.sender.type,
208
- },
209
- /** The `sender`, in the shape every channel's `actor` has. */
210
- actor: senderActor(event.payload.sender),
211
- /**
212
- * The handles the text this event wrote mentions, such as `@octocat` or a
213
- * text tag like `@openswe`: lowercased, each once, in order. The text is a
214
- * new or edited comment's or review's body, or an opened or edited issue's
215
- * or pull request's title and body; an edit lists only the handles it
216
- * added. As on GitHub, code, quotes and HTML comments mention no one. Empty
217
- * for events that write no text, such as a push or a label.
218
- */
219
- mentions: eventMentions(event),
220
- }));
221
- //# sourceMappingURL=schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/channels/github/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,sEAAsE;AACtE,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC;AACjD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;AAElE,gFAAgF;AAChF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,oBAAoB;IAC3B,UAAU,EAAE,oBAAoB;IAChC,OAAO,EAAE,CAAC,CAAC,WAAW,CAAC;QACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,UAAU,EAAE,CAAC,CAAC,WAAW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K,EAAE,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;IACxC;;;;;;;OAOG;IACH,QAAQ,EAAE,aAAa,CAAC,KAAK,CAAC;CAC/B,CAAC,CAAC,CAAC"}
@@ -1,163 +0,0 @@
1
- import type { z } from "zod";
2
- import type { MultitaskStrategy } from "../../ingress/runs.js";
3
- import type { ENDPOINT_EVENT_FIELDS, githubEventSchema } from "./schema.js";
4
- import type { ChannelRunResult } from "../run-input.js";
5
- import type { EventFinished, EventReceived } from "../http/provider.js";
6
- import type { EndpointRequest, EventEndpoint } from "../http/endpoint.js";
7
- /** Handwritten schema subsets; unmodeled provider fields remain unknown. */
8
- type EventUnion = z.output<typeof githubEventSchema>;
9
- export type SupportedEventKey = EventUnion["key"];
10
- export type GitHubEvent<K extends SupportedEventKey = SupportedEventKey> = Extract<EventUnion, {
11
- key: K;
12
- }>;
13
- export type PayloadFor<K extends SupportedEventKey> = GitHubEvent<K>["payload"];
14
- /**
15
- * The conversation's thread an event belongs to. A handler runs before any
16
- * run exists, so this is not a run's runtime.
17
- */
18
- export interface GitHubChannelThread {
19
- /**
20
- * The thread's ID: the one a run the handler starts runs on, or, when
21
- * `interrupted`, the one that waits. Useful for run context that names the
22
- * thread, such as a token a backend signs for it.
23
- */
24
- id: string;
25
- channel: {
26
- name: string;
27
- };
28
- /**
29
- * Set when the thread waits on an interrupt. No run starts: what the
30
- * handler returns only decides whether the App tells the issue or pull
31
- * request that a decision is pending, so skip side effects such as
32
- * reactions.
33
- */
34
- interrupted?: true;
35
- }
36
- /**
37
- * What an event handler returns: a run's input, as `agent.invoke` takes it —
38
- * a string, a message such as `new HumanMessage(...)`, state such as
39
- * `{ messages: [...] }`, or `[input, { context, metadata }]`. `null` or `undefined`
40
- * starts nothing.
41
- */
42
- export type GitHubEventResult = ChannelRunResult | null | undefined | void;
43
- export type GitHubEventCallback<K extends SupportedEventKey> = (event: GitHubEvent<K>, thread: GitHubChannelThread) => GitHubEventResult | Promise<GitHubEventResult>;
44
- /**
45
- * What the agent may do with the GitHub App `mda deploy` sets up. Deploy
46
- * applies changes to these on every run, except to the App's own
47
- * permissions (see `permissions`).
48
- */
49
- export interface GitHubAppOptions {
50
- /**
51
- * Permissions the agent's GitHub token needs beyond those the handled
52
- * events need, e.g. `{ contents: "read" }`. A new App asks for both.
53
- *
54
- * Handled events set their own level: read to receive an event, write to
55
- * also reply where it happened. These can raise that level but not lower
56
- * it.
57
- *
58
- * Deploy renews the agent's token with changed permissions, but it cannot
59
- * change the App itself: GitHub reads an App's permissions from its
60
- * manifest only when the App is created, and has no API to change them
61
- * later. The App's owner grants added permissions, and removes dropped or
62
- * lowered ones, in the App's settings on GitHub. Deploy names both and
63
- * links there; until a dropped permission is removed, the App keeps it
64
- * even though the agent's token no longer has it.
65
- */
66
- permissions?: Record<string, "read" | "write">;
67
- /**
68
- * Repositories (`owner/name`, one owner) the channel is limited to: events
69
- * from other repositories start nothing, and deploy reports listed ones the
70
- * App is not installed on. Defaults to every repository the App is
71
- * installed on. The agent's token still reaches every repository of the
72
- * installation, so install the App only on the ones the agent may change.
73
- */
74
- repositories?: string[];
75
- }
76
- /** Options for `channels.github(...)`: App scope and event handlers that start runs. */
77
- export interface GitHubChannelOptions {
78
- /** App `mda deploy` creates; permissions and repository allowlist. */
79
- app?: GitHubAppOptions;
80
- /**
81
- * What an event that starts a run does while its conversation already
82
- * runs: `enqueue` (the default) waits for the run and starts after it,
83
- * `interrupt` cancels the run, keeping its progress, and starts at once,
84
- * `rollback` cancels it and discards its progress, and `reject` starts
85
- * nothing. Events on a conversation that waits on an interrupt start
86
- * nothing either way.
87
- *
88
- * @example
89
- * ```ts
90
- * // A newer comment replaces the work on an older one.
91
- * channels.github({ multitaskStrategy: "interrupt", onEvent })
92
- * ```
93
- */
94
- multitaskStrategy?: MultitaskStrategy;
95
- /**
96
- * Event handlers that start runs. Return a prompt (string, message, or
97
- * state), or nothing to skip. While a thread waits on an interrupt, events
98
- * start nothing: the handler still runs, with `thread.interrupted` set, to
99
- * decide whether the issue or pull request is told to continue it in
100
- * LangSmith Studio.
101
- *
102
- * A handler may also be an endpoint, a URL or a `Request` carrying headers,
103
- * to have a service of yours decide: MDA POSTs it the event and its thread,
104
- * and starts the run it answers with. See the README's "Asking your service
105
- * what to start".
106
- *
107
- * @example
108
- * ```ts
109
- * {
110
- * "issues.opened": (e) => `Help with #${e.payload.issue.number}`,
111
- * "issue_comment.created": new Request(`${BACKEND}/github/runs`, {
112
- * headers: { "x-api-key": process.env.BACKEND_KEY! },
113
- * }),
114
- * }
115
- * ```
116
- */
117
- onEvent?: {
118
- [K in SupportedEventKey]?: GitHubEventCallback<K> | EventEndpoint;
119
- };
120
- /**
121
- * A delivery of a handled event is done, once, with how, to switch on by
122
- * `type`: the run it started and how that run ended, as LangGraph names it
123
- * (`run`), why it started none (`skipped`, such as a handler that returned
124
- * nothing), or that MDA lost it (`failed`); and the decisions the thread
125
- * waits on. Called after the App's own notices, such
126
- * as the comment that a decision is pending, in the background; failures
127
- * are logged. See `channels.http`'s `onFinish` for its limits.
128
- *
129
- * @example
130
- * ```ts
131
- * onFinish: async (event, thread, finished) => {
132
- * if (finished.type === "run" && finished.run.status === "success")
133
- * await reportRun(thread.id, finished.run.id);
134
- * }
135
- * ```
136
- */
137
- onFinish?: EventFinished<GitHubEvent, GitHubChannelThread>;
138
- /**
139
- * A delivery of a handled event reached its thread, once, with the event
140
- * and its thread, before MDA reads the thread or asks the handler: the
141
- * moment to acknowledge it, such as with a 👀 reaction. It fires even when
142
- * the thread then waits on an interrupt, or the handler declines, so apply
143
- * your own filters, such as a mention check. In the background, before
144
- * `onFinish`; failures are logged and don't stop the run.
145
- *
146
- * @example
147
- * ```ts
148
- * onReceived: async (event) => {
149
- * if (event.name === "issue_comment") await reactEyes(event);
150
- * }
151
- * ```
152
- */
153
- onReceived?: EventReceived<GitHubEvent, GitHubChannelThread>;
154
- }
155
- /**
156
- * What a GitHub channel POSTs an endpoint, for one event key or any: the
157
- * event's key, delivery ID and payload, and, as a handler gets them, its
158
- * `action`, `repository`, `sender` and the handles it `mentions`. Those are
159
- * optional, so a receiver takes requests from older deployments.
160
- */
161
- export type GitHubEndpointRequest<K extends SupportedEventKey = SupportedEventKey> = EndpointRequest<GitHubEvent<K>, (typeof ENDPOINT_EVENT_FIELDS)[number]>;
162
- export {};
163
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/channels/github/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE1E,4EAA4E;AAC5E,KAAK,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACrD,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAClD,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,IACrE,OAAO,CAAC,UAAU,EAAE;IAAE,GAAG,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAClC,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,iBAAiB,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAEhF;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE;QAAE,IAAI,EA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AC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/channels/github/types.ts"],"names":[],"mappings":""}
@@ -1,95 +0,0 @@
1
- import { z } from "zod";
2
- import type { ChannelRunResult } from "../run-input.js";
3
- /**
4
- * The deployment's env var holding the secret it shares with your services:
5
- * every event endpoint request is signed with it, as Standard Webhooks does.
6
- * Several, separated by whitespace or commas, each sign the request, for
7
- * rotation.
8
- */
9
- export declare const SERVICE_SECRET_ENV = "MDA_SERVICE_SECRET";
10
- /**
11
- * Where an `onEvent` key's events go when a service of yours decides what
12
- * they start: its URL, or a `Request` that also carries headers, such as a
13
- * credential the service checks. See {@link endpointHandler}.
14
- */
15
- export type EventEndpoint = string | URL | Request;
16
- /** The key a Standard Webhooks secret stands for; a malformed one throws. */
17
- export declare function signingKey(secret: string): Buffer;
18
- /**
19
- * The Standard Webhooks headers that sign one request with `keys`: none
20
- * without a key. Each key signs `<id>.<timestamp>.<body>`.
21
- */
22
- export declare function signatureHeaders(keys: readonly Buffer[], id: string, timestamp: number, body: string): Record<string, string>;
23
- /** A channel's event, by the fields every endpoint is sent. */
24
- type ChannelEvent = {
25
- key: string;
26
- deliveryId: string;
27
- payload: unknown;
28
- };
29
- /** The fields of an event every endpoint is sent. */
30
- declare const EVENT_FIELDS: readonly ["key", "deliveryId", "payload"];
31
- /** A field any of a union of events has, such as a field of one kind only. */
32
- export type EventField<E> = E extends unknown ? keyof E : never;
33
- /**
34
- * The event a channel sends its endpoint: the event key, the provider's
35
- * delivery ID and its payload, and the channel's own fields `X`, such as
36
- * GitHub's `repository` and `mentions`. A channel's own fields are optional,
37
- * so a receiver takes requests from a deployment that sends fewer. For a
38
- * union of events, each is typed by the key, with the fields of `X` it has.
39
- */
40
- export type EndpointEvent<E extends ChannelEvent = ChannelEvent, X extends PropertyKey = never> = E extends unknown ? Pick<E, (typeof EVENT_FIELDS)[number]> & Partial<Pick<E, Extract<X, keyof E>>> : never;
41
- /** The conversation's thread an endpoint request is about. */
42
- export interface EndpointThread {
43
- /** The thread the run starts on, or that waits on an interrupt. */
44
- id: string;
45
- channel: {
46
- name: string;
47
- };
48
- /** Set when the thread waits on an interrupt: no run starts, whatever the answer. */
49
- interrupted?: true;
50
- }
51
- /** What a channel POSTs its endpoint: the event, and the thread it belongs to. */
52
- export interface EndpointRequest<E extends ChannelEvent = ChannelEvent, X extends PropertyKey = never> {
53
- event: EndpointEvent<E, X>;
54
- thread: EndpointThread;
55
- }
56
- declare const answerSchema: z.ZodObject<{
57
- input: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodCustom<import("../types.js").JsonValue, import("../types.js").JsonValue>>]>;
58
- context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodCustom<import("../types.js").JsonValue, import("../types.js").JsonValue>>>;
59
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodCustom<import("../types.js").JsonValue, import("../types.js").JsonValue>>>;
60
- webhook: z.ZodOptional<z.ZodString>;
61
- }, z.core.$strict>;
62
- /**
63
- * What an endpoint answers: the run's input, as a handler returns it (text,
64
- * or state such as `{ messages }`), with the run options a handler may set,
65
- * all JSON. An endpoint answers `null` (or HTTP 204) instead to start nothing.
66
- * The channel checks an answer against the same schema.
67
- */
68
- export type EndpointAnswer = z.infer<typeof answerSchema>;
69
- /** The handler an endpoint stands for; see {@link endpointHandler}. */
70
- export type EndpointCallback<E extends ChannelEvent = ChannelEvent> = (event: E, thread: EndpointThread) => Promise<ChannelRunResult | null>;
71
- /** Whether a handler is one an endpoint stands for. */
72
- export declare function isEndpointCallback(handler: unknown): boolean;
73
- /** Whether an `onEvent` value is an endpoint rather than a handler function. */
74
- export declare function isEventEndpoint(value: unknown): value is EventEndpoint;
75
- /**
76
- * The handler an endpoint stands for. When the event's thread takes a turn,
77
- * MDA POSTs `{ event: { key, deliveryId, payload }, thread: { id, channel,
78
- * interrupted? } }` as JSON to the endpoint's URL, with the event's `fields`,
79
- * the channel's own, beside the payload, and a `Request`'s headers,
80
- * signed when the deployment has `MDA_SERVICE_SECRET`, and starts the
81
- * run the service answers with: `{ input, context?, metadata?, webhook? }`.
82
- * `null` or HTTP 204 starts nothing. A network error before the answer, HTTP
83
- * 429 or a 5xx is tried again, up to three attempts. Any other answer, one cut
84
- * off, a redirect, or no answer within 60 seconds fails the handler, as a
85
- * handler that throws does.
86
- * The URL is https, or http to a loopback host for local development, without
87
- * credentials in it.
88
- *
89
- * The webhook ID is `msg_<deliveryId>` for the call that starts the run, and
90
- * `msg_<deliveryId>_interrupted` for the one that asks whether to tell the
91
- * conversation its thread waits on a decision.
92
- */
93
- export declare function endpointHandler<E extends ChannelEvent = ChannelEvent, X extends EventField<E> & string = never>(endpoint: EventEndpoint, label: string, fields?: readonly X[]): EndpointCallback<E>;
94
- export {};
95
- //# sourceMappingURL=endpoint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../../src/channels/http/endpoint.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAcxD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAQvD;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC;AAmBnD,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAejD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,MAAM,EAAE,MA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