@sentry/junior 0.53.0 → 0.55.0

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 (239) hide show
  1. package/README.md +4 -3
  2. package/dist/api-reference.d.ts +7 -0
  3. package/dist/app.d.ts +14 -12
  4. package/dist/app.js +12977 -10333
  5. package/dist/build/copy-build-content.d.ts +4 -0
  6. package/dist/build/glob-to-regex.d.ts +2 -0
  7. package/dist/build/rolldown-workarounds.d.ts +14 -0
  8. package/dist/build/virtual-config.d.ts +4 -0
  9. package/dist/chat/agent-dispatch/context.d.ts +6 -0
  10. package/dist/chat/agent-dispatch/heartbeat.d.ts +14 -0
  11. package/dist/chat/agent-dispatch/runner.d.ts +9 -0
  12. package/dist/chat/agent-dispatch/signing.d.ts +5 -0
  13. package/dist/chat/agent-dispatch/store.d.ts +29 -0
  14. package/dist/chat/agent-dispatch/types.d.ts +57 -0
  15. package/dist/chat/agent-dispatch/validation.d.ts +3 -0
  16. package/dist/chat/app/factory.d.ts +10 -0
  17. package/dist/chat/app/production.d.ts +6 -0
  18. package/dist/chat/app/services.d.ts +17 -0
  19. package/dist/chat/capabilities/catalog.d.ts +16 -0
  20. package/dist/chat/capabilities/factory.d.ts +10 -0
  21. package/dist/chat/capabilities/jr-rpc-command.d.ts +26 -0
  22. package/dist/chat/capabilities/router.d.ts +19 -0
  23. package/dist/chat/coerce.d.ts +6 -0
  24. package/dist/chat/config.d.ts +47 -0
  25. package/dist/chat/configuration/defaults.d.ts +4 -0
  26. package/dist/chat/configuration/service.d.ts +2 -0
  27. package/dist/chat/configuration/types.d.ts +37 -0
  28. package/dist/chat/configuration/validation.d.ts +2 -0
  29. package/dist/chat/credentials/broker.d.ts +22 -0
  30. package/dist/chat/credentials/header-transforms.d.ts +3 -0
  31. package/dist/chat/credentials/oauth-scope.d.ts +4 -0
  32. package/dist/chat/credentials/state-adapter-token-store.d.ts +9 -0
  33. package/dist/chat/credentials/unlink-provider.d.ts +2 -0
  34. package/dist/chat/credentials/user-token-store.d.ts +11 -0
  35. package/dist/chat/discovery.d.ts +47 -0
  36. package/dist/chat/ingress/junior-chat.d.ts +26 -0
  37. package/dist/chat/ingress/message-changed.d.ts +50 -0
  38. package/dist/chat/ingress/message-router.d.ts +9 -0
  39. package/dist/chat/ingress/slash-command.d.ts +3 -0
  40. package/dist/chat/ingress/workspace-membership.d.ts +9 -0
  41. package/dist/chat/interruption-marker.d.ts +2 -0
  42. package/dist/chat/logging.d.ts +90 -0
  43. package/dist/chat/mcp/auth-store.d.ts +41 -0
  44. package/dist/chat/mcp/client.d.ts +34 -0
  45. package/dist/chat/mcp/errors.d.ts +8 -0
  46. package/dist/chat/mcp/oauth-provider.d.ts +27 -0
  47. package/dist/chat/mcp/oauth.d.ts +17 -0
  48. package/dist/chat/mcp/tool-manager.d.ts +60 -0
  49. package/dist/chat/oauth-flow.d.ts +45 -0
  50. package/dist/chat/optional-string.d.ts +5 -0
  51. package/dist/chat/pi/client.d.ts +49 -0
  52. package/dist/chat/pi/messages.d.ts +3 -0
  53. package/dist/chat/pi/traced-stream.d.ts +9 -0
  54. package/dist/chat/plugins/agent-hooks.d.ts +32 -0
  55. package/dist/chat/plugins/auth/api-headers-broker.d.ts +6 -0
  56. package/dist/chat/plugins/auth/auth-token-placeholder.d.ts +3 -0
  57. package/dist/chat/plugins/auth/github-app-broker.d.ts +4 -0
  58. package/dist/chat/plugins/auth/oauth-bearer-broker.d.ts +6 -0
  59. package/dist/chat/plugins/auth/oauth-request.d.ts +18 -0
  60. package/dist/chat/plugins/command-env.d.ts +3 -0
  61. package/dist/chat/plugins/logging.d.ts +3 -0
  62. package/dist/chat/plugins/manifest.d.ts +3 -0
  63. package/dist/chat/plugins/package-discovery.d.ts +14 -0
  64. package/dist/chat/plugins/registry.d.ts +23 -0
  65. package/dist/chat/plugins/state.d.ts +3 -0
  66. package/dist/chat/plugins/types.d.ts +146 -0
  67. package/dist/chat/prompt.d.ts +39 -0
  68. package/dist/chat/queue/thread-message-dispatcher.d.ts +33 -0
  69. package/dist/chat/respond-helpers.d.ts +77 -0
  70. package/dist/chat/respond.d.ts +75 -0
  71. package/dist/chat/runtime/auth-pause-state.d.ts +11 -0
  72. package/dist/chat/runtime/delivered-turn-state.d.ts +15 -0
  73. package/dist/chat/runtime/dev-agent-trace.d.ts +1 -0
  74. package/dist/chat/runtime/processing-reaction.d.ts +25 -0
  75. package/dist/chat/runtime/reply-executor.d.ts +56 -0
  76. package/dist/chat/runtime/report-progress.d.ts +3 -0
  77. package/dist/chat/runtime/slack-resume.d.ts +50 -0
  78. package/dist/chat/runtime/slack-runtime.d.ts +100 -0
  79. package/dist/chat/runtime/thread-context.d.ts +24 -0
  80. package/dist/chat/runtime/thread-state.d.ts +28 -0
  81. package/dist/chat/runtime/turn-preparation.d.ts +43 -0
  82. package/dist/chat/runtime/turn-user-message.d.ts +12 -0
  83. package/dist/chat/runtime/turn.d.ts +69 -0
  84. package/dist/chat/sandbox/credentials.d.ts +11 -0
  85. package/dist/chat/sandbox/egress-oidc.d.ts +3 -0
  86. package/dist/chat/sandbox/egress-policy.d.ts +11 -0
  87. package/dist/chat/sandbox/egress-proxy.d.ts +17 -0
  88. package/dist/chat/sandbox/egress-session.d.ts +27 -0
  89. package/dist/chat/sandbox/errors.d.ts +12 -0
  90. package/dist/chat/sandbox/http-error-details.d.ts +18 -0
  91. package/dist/chat/sandbox/noninteractive-command.d.ts +17 -0
  92. package/dist/chat/sandbox/paths.d.ts +5 -0
  93. package/dist/chat/sandbox/runtime-dependency-snapshots.d.ts +20 -0
  94. package/dist/chat/sandbox/sandbox.d.ts +54 -0
  95. package/dist/chat/sandbox/session.d.ts +54 -0
  96. package/dist/chat/sandbox/skill-sandbox.d.ts +42 -0
  97. package/dist/chat/sandbox/skill-sync.d.ts +16 -0
  98. package/dist/chat/sandbox/workspace.d.ts +55 -0
  99. package/dist/chat/scheduler/cadence.d.ts +24 -0
  100. package/dist/chat/scheduler/plugin.d.ts +2 -0
  101. package/dist/chat/scheduler/prompt.d.ts +7 -0
  102. package/dist/chat/scheduler/store.d.ts +49 -0
  103. package/dist/chat/scheduler/types.d.ts +86 -0
  104. package/dist/chat/sentry.d.ts +2 -0
  105. package/dist/chat/services/attachment-claims.d.ts +2 -0
  106. package/dist/chat/services/auth-pause-response.d.ts +2 -0
  107. package/dist/chat/services/auth-pause.d.ts +19 -0
  108. package/dist/chat/services/channel-intent.d.ts +2 -0
  109. package/dist/chat/services/conversation-memory.d.ts +33 -0
  110. package/dist/chat/services/mcp-auth-orchestration.d.ts +30 -0
  111. package/dist/chat/services/pending-auth.d.ts +27 -0
  112. package/dist/chat/services/plugin-auth-orchestration.d.ts +37 -0
  113. package/dist/chat/services/provider-default-config.d.ts +9 -0
  114. package/dist/chat/services/provider-retry.d.ts +6 -0
  115. package/dist/chat/services/reply-delivery-plan.d.ts +17 -0
  116. package/dist/chat/services/subscribed-decision.d.ts +63 -0
  117. package/dist/chat/services/subscribed-reply-policy.d.ts +23 -0
  118. package/dist/chat/services/timeout-resume.d.ts +17 -0
  119. package/dist/chat/services/turn-checkpoint.d.ts +74 -0
  120. package/dist/chat/services/turn-continuation-response.d.ts +2 -0
  121. package/dist/chat/services/turn-failure-response.d.ts +15 -0
  122. package/dist/chat/services/turn-result.d.ts +55 -0
  123. package/dist/chat/services/turn-thinking-level.d.ts +49 -0
  124. package/dist/chat/services/vision-context.d.ts +61 -0
  125. package/dist/chat/skills.d.ts +48 -0
  126. package/dist/chat/slack/adapter.d.ts +9 -0
  127. package/dist/chat/slack/app-home.d.ts +11 -0
  128. package/dist/chat/slack/assistant-thread/lifecycle.d.ts +13 -0
  129. package/dist/chat/slack/assistant-thread/status-render.d.ts +28 -0
  130. package/dist/chat/slack/assistant-thread/status-scheduler.d.ts +23 -0
  131. package/dist/chat/slack/assistant-thread/status-send.d.ts +31 -0
  132. package/dist/chat/slack/assistant-thread/status.d.ts +36 -0
  133. package/dist/chat/slack/assistant-thread/title.d.ts +28 -0
  134. package/dist/chat/slack/canvas-references.d.ts +2 -0
  135. package/dist/chat/slack/channel.d.ts +48 -0
  136. package/dist/chat/slack/client.d.ts +52 -0
  137. package/dist/chat/slack/context.d.ts +9 -0
  138. package/dist/chat/slack/emoji.d.ts +1 -0
  139. package/dist/chat/slack/errors.d.ts +6 -0
  140. package/dist/chat/slack/footer.d.ts +42 -0
  141. package/dist/chat/slack/ids.d.ts +4 -0
  142. package/dist/chat/slack/legacy-attachments.d.ts +4 -0
  143. package/dist/chat/slack/message.d.ts +6 -0
  144. package/dist/chat/slack/mrkdwn.d.ts +12 -0
  145. package/dist/chat/slack/outbound.d.ts +57 -0
  146. package/dist/chat/slack/output.d.ts +54 -0
  147. package/dist/chat/slack/reply.d.ts +33 -0
  148. package/dist/chat/slack/status-format.d.ts +2 -0
  149. package/dist/chat/slack/turn-continuation-notice.d.ts +8 -0
  150. package/dist/chat/slack/user.d.ts +8 -0
  151. package/dist/chat/slack/users.d.ts +39 -0
  152. package/dist/chat/slack/workspace-context.d.ts +4 -0
  153. package/dist/chat/state/adapter.d.ts +9 -0
  154. package/dist/chat/state/artifacts.d.ts +29 -0
  155. package/dist/chat/state/conversation.d.ts +81 -0
  156. package/dist/chat/state/pi-session-message-store.d.ts +15 -0
  157. package/dist/chat/state/turn-id.d.ts +2 -0
  158. package/dist/chat/state/turn-session-store.d.ts +49 -0
  159. package/dist/chat/tools/advisor/session-store.d.ts +9 -0
  160. package/dist/chat/tools/advisor/tool.d.ts +33 -0
  161. package/dist/chat/tools/agent-tools.d.ts +10 -0
  162. package/dist/chat/tools/channel-capabilities.d.ts +11 -0
  163. package/dist/chat/tools/definition.d.ts +17 -0
  164. package/dist/chat/tools/execution/build-sandbox-input.d.ts +2 -0
  165. package/dist/chat/tools/execution/normalize-result.d.ts +6 -0
  166. package/dist/chat/tools/execution/tool-error-handler.d.ts +3 -0
  167. package/dist/chat/tools/execution/tool-input-error.d.ts +6 -0
  168. package/dist/chat/tools/idempotency.d.ts +1 -0
  169. package/dist/chat/tools/index.d.ts +5 -0
  170. package/dist/chat/tools/runtime/report-progress.d.ts +4 -0
  171. package/dist/chat/tools/sandbox/attach-file.d.ts +7 -0
  172. package/dist/chat/tools/sandbox/bash.d.ts +5 -0
  173. package/dist/chat/tools/sandbox/edit-file.d.ts +37 -0
  174. package/dist/chat/tools/sandbox/file-utils.d.ts +52 -0
  175. package/dist/chat/tools/sandbox/find-files.d.ts +24 -0
  176. package/dist/chat/tools/sandbox/grep.d.ts +33 -0
  177. package/dist/chat/tools/sandbox/list-dir.d.ts +22 -0
  178. package/dist/chat/tools/sandbox/read-file.d.ts +32 -0
  179. package/dist/chat/tools/sandbox/text-edits.d.ts +28 -0
  180. package/dist/chat/tools/sandbox/write-file.d.ts +5 -0
  181. package/dist/chat/tools/skill/call-mcp-tool.d.ts +7 -0
  182. package/dist/chat/tools/skill/load-skill.d.ts +22 -0
  183. package/dist/chat/tools/skill/mcp-tool-summary.d.ts +31 -0
  184. package/dist/chat/tools/skill/search-mcp-tools.d.ts +8 -0
  185. package/dist/chat/tools/slack/canvas-tools.d.ts +29 -0
  186. package/dist/chat/tools/slack/canvases.d.ts +45 -0
  187. package/dist/chat/tools/slack/channel-list-messages.d.ts +9 -0
  188. package/dist/chat/tools/slack/channel-post-message.d.ts +4 -0
  189. package/dist/chat/tools/slack/list-tools.d.ts +21 -0
  190. package/dist/chat/tools/slack/lists.d.ts +42 -0
  191. package/dist/chat/tools/slack/message-add-reaction.d.ts +4 -0
  192. package/dist/chat/tools/slack/schedule-tools.d.ts +29 -0
  193. package/dist/chat/tools/slack/slack-message-url.d.ts +18 -0
  194. package/dist/chat/tools/slack/thread-read.d.ts +9 -0
  195. package/dist/chat/tools/slack/user-lookup.d.ts +8 -0
  196. package/dist/chat/tools/system-time.d.ts +1 -0
  197. package/dist/chat/tools/types.d.ts +61 -0
  198. package/dist/chat/tools/web/constants.d.ts +6 -0
  199. package/dist/chat/tools/web/fetch-content.d.ts +23 -0
  200. package/dist/chat/tools/web/fetch-tool.d.ts +5 -0
  201. package/dist/chat/tools/web/image-generate.d.ts +4 -0
  202. package/dist/chat/tools/web/network.d.ts +6 -0
  203. package/dist/chat/tools/web/search.d.ts +5 -0
  204. package/dist/chat/turn-context-tag.d.ts +6 -0
  205. package/dist/chat/usage.d.ts +24 -0
  206. package/dist/chat/xml.d.ts +1 -0
  207. package/dist/{chunk-XPXD3FCE.js → chunk-5LUISFEY.js} +189 -35
  208. package/dist/{chunk-ZNFNY53B.js → chunk-D3G3YOU4.js} +2 -2
  209. package/dist/chunk-SCQPBJAU.js +21 -0
  210. package/dist/{chunk-Q3FDONU7.js → chunk-TTUY467K.js} +47 -37
  211. package/dist/{chunk-KCOKQLBF.js → chunk-XI3CFWTA.js} +168 -15
  212. package/dist/cli/check.js +3 -3
  213. package/dist/cli/init.js +6 -1
  214. package/dist/cli/snapshot-warmup.js +3 -3
  215. package/dist/handlers/agent-dispatch.d.ts +3 -0
  216. package/dist/handlers/diagnostics-dashboard.d.ts +2 -0
  217. package/dist/handlers/diagnostics.d.ts +2 -0
  218. package/dist/handlers/health.d.ts +4 -0
  219. package/dist/handlers/heartbeat.d.ts +3 -0
  220. package/dist/handlers/mcp-oauth-callback.d.ts +2 -0
  221. package/dist/handlers/oauth-callback.d.ts +2 -0
  222. package/dist/handlers/oauth-html.d.ts +2 -0
  223. package/dist/handlers/sandbox-egress-proxy.d.ts +9 -0
  224. package/dist/handlers/turn-resume.d.ts +3 -0
  225. package/dist/handlers/types.d.ts +2 -0
  226. package/dist/handlers/webhooks.d.ts +15 -0
  227. package/dist/instrumentation.d.ts +1 -3
  228. package/dist/nitro.d.ts +4 -7
  229. package/dist/nitro.js +112 -54
  230. package/dist/package-resolution.d.ts +13 -0
  231. package/dist/vercel.d.ts +2 -4
  232. package/dist/vercel.js +3 -12
  233. package/package.json +32 -26
  234. package/dist/cli/check.d.ts +0 -8
  235. package/dist/cli/env.d.ts +0 -7
  236. package/dist/cli/init.d.ts +0 -3
  237. package/dist/cli/run.d.ts +0 -12
  238. package/dist/cli/snapshot-warmup.d.ts +0 -3
  239. package/dist/types-X_iCClPb.d.ts +0 -75
@@ -0,0 +1,146 @@
1
+ import type { UserTokenStore } from "@/chat/credentials/user-token-store";
2
+ export interface PluginOAuthConfig {
3
+ clientIdEnv: string;
4
+ clientSecretEnv: string;
5
+ authorizeEndpoint: string;
6
+ tokenEndpoint: string;
7
+ scope?: string;
8
+ authorizeParams?: Record<string, string>;
9
+ tokenAuthMethod?: "body" | "basic";
10
+ tokenExtraHeaders?: Record<string, string>;
11
+ }
12
+ export interface OAuthProviderConfig extends PluginOAuthConfig {
13
+ callbackPath: string;
14
+ }
15
+ export interface OAuthBearerCredentials {
16
+ type: "oauth-bearer";
17
+ domains: string[];
18
+ apiHeaders?: Record<string, string>;
19
+ authTokenEnv: string;
20
+ authTokenPlaceholder?: string;
21
+ }
22
+ export interface GitHubAppCredentials {
23
+ type: "github-app";
24
+ domains: string[];
25
+ apiHeaders?: Record<string, string>;
26
+ authTokenEnv: string;
27
+ authTokenPlaceholder?: string;
28
+ appIdEnv: string;
29
+ privateKeyEnv: string;
30
+ installationIdEnv: string;
31
+ }
32
+ export type PluginCredentials = OAuthBearerCredentials | GitHubAppCredentials;
33
+ export interface PluginNpmRuntimeDependency {
34
+ type: "npm";
35
+ package: string;
36
+ version: string;
37
+ }
38
+ export interface PluginSystemRuntimeDependency {
39
+ type: "system";
40
+ package: string;
41
+ }
42
+ export interface PluginSystemRuntimeDependencyFromUrl {
43
+ type: "system";
44
+ url: string;
45
+ sha256: string;
46
+ }
47
+ export type PluginRuntimeDependency = PluginNpmRuntimeDependency | PluginSystemRuntimeDependency | PluginSystemRuntimeDependencyFromUrl;
48
+ export interface PluginRuntimePostinstallCommand {
49
+ cmd: string;
50
+ args?: string[];
51
+ sudo?: boolean;
52
+ }
53
+ export interface PluginMcpHttpConfig {
54
+ transport: "http";
55
+ url: string;
56
+ headers?: Record<string, string>;
57
+ allowedTools?: string[];
58
+ }
59
+ export type PluginMcpConfig = PluginMcpHttpConfig;
60
+ export interface PluginEnvVarDeclaration {
61
+ default?: string;
62
+ }
63
+ export interface PluginManifest {
64
+ name: string;
65
+ description: string;
66
+ capabilities: string[];
67
+ configKeys: string[];
68
+ domains?: string[];
69
+ apiHeaders?: Record<string, string>;
70
+ commandEnv?: Record<string, string>;
71
+ envVars?: Record<string, PluginEnvVarDeclaration>;
72
+ credentials?: PluginCredentials;
73
+ runtimeDependencies?: PluginRuntimeDependency[];
74
+ runtimePostinstall?: PluginRuntimePostinstallCommand[];
75
+ mcp?: PluginMcpConfig;
76
+ oauth?: PluginOAuthConfig;
77
+ target?: {
78
+ type: string;
79
+ configKey: string;
80
+ commandFlags?: string[];
81
+ };
82
+ }
83
+ type PluginRuntimeDependencyConfig = {
84
+ type: "npm";
85
+ package: string;
86
+ version?: string;
87
+ } | {
88
+ type: "system";
89
+ package: string;
90
+ } | {
91
+ type: "system";
92
+ url: string;
93
+ sha256: string;
94
+ };
95
+ interface PluginOAuthConfigPatch extends Omit<Partial<PluginOAuthConfig>, "authorizeParams" | "tokenExtraHeaders"> {
96
+ authorizeParams?: Record<string, string | null> | null;
97
+ tokenExtraHeaders?: Record<string, string | null> | null;
98
+ }
99
+ /** Install-level changes applied to one plugin manifest before validation. */
100
+ export interface PluginManifestConfig {
101
+ description?: string;
102
+ capabilities?: string[];
103
+ configKeys?: string[];
104
+ domains?: string[] | null;
105
+ apiHeaders?: Record<string, string | null> | null;
106
+ commandEnv?: Record<string, string | null> | null;
107
+ envVars?: Record<string, PluginEnvVarDeclaration | null> | null;
108
+ credentials?: {
109
+ type?: "oauth-bearer" | "github-app";
110
+ domains?: string[];
111
+ apiHeaders?: Record<string, string | null> | null;
112
+ authTokenEnv?: string;
113
+ authTokenPlaceholder?: string | null;
114
+ appIdEnv?: string;
115
+ privateKeyEnv?: string;
116
+ installationIdEnv?: string;
117
+ } | null;
118
+ runtimeDependencies?: PluginRuntimeDependencyConfig[] | null;
119
+ runtimePostinstall?: PluginRuntimePostinstallCommand[] | null;
120
+ mcp?: {
121
+ transport?: "http";
122
+ url?: string;
123
+ headers?: Record<string, string | null> | null;
124
+ allowedTools?: string[] | null;
125
+ } | null;
126
+ oauth?: PluginOAuthConfigPatch | null;
127
+ target?: {
128
+ type?: string;
129
+ configKey?: string;
130
+ commandFlags?: string[] | null;
131
+ } | null;
132
+ }
133
+ /** Install-level plugin package list and manifest configuration. */
134
+ export interface PluginConfig {
135
+ packages?: string[];
136
+ manifests?: Record<string, PluginManifestConfig>;
137
+ }
138
+ export interface PluginBrokerDeps {
139
+ userTokenStore: UserTokenStore;
140
+ }
141
+ export interface PluginDefinition {
142
+ manifest: PluginManifest;
143
+ dir: string;
144
+ skillsDir: string;
145
+ }
146
+ export {};
@@ -0,0 +1,39 @@
1
+ import type { ThreadArtifactsState } from "@/chat/state/artifacts";
2
+ import type { Skill, SkillMetadata, SkillInvocation } from "@/chat/skills";
3
+ import type { ActiveMcpCatalogSummary } from "@/chat/tools/skill/mcp-tool-summary";
4
+ export declare const JUNIOR_PERSONALITY: string;
5
+ export declare const JUNIOR_WORLD: string | null;
6
+ interface ToolPromptContext {
7
+ name: string;
8
+ promptGuidelines?: string[];
9
+ promptSnippet?: string;
10
+ }
11
+ type TurnContextPromptInput = {
12
+ availableSkills: SkillMetadata[];
13
+ activeSkills: Skill[];
14
+ activeMcpCatalogs?: ActiveMcpCatalogSummary[];
15
+ toolGuidance?: ToolPromptContext[];
16
+ runtime?: {
17
+ conversationId?: string;
18
+ traceId?: string;
19
+ };
20
+ invocation: SkillInvocation | null;
21
+ requester?: {
22
+ userName?: string;
23
+ fullName?: string;
24
+ userId?: string;
25
+ };
26
+ artifactState?: ThreadArtifactsState;
27
+ configuration?: Record<string, unknown>;
28
+ /**
29
+ * Whether this turn is a fresh prompt or a resume from a prior checkpoint
30
+ * (OAuth pause or timeout-resume). Surfaced in <context> so the model knows
31
+ * it is continuing rather than starting fresh.
32
+ */
33
+ turnState?: "fresh" | "resumed";
34
+ };
35
+ /** Return byte-stable platform instructions shared by every conversation and turn. */
36
+ export declare function buildSystemPrompt(): string;
37
+ /** Build volatile runtime context that belongs in the user turn, not the system prompt. */
38
+ export declare function buildTurnContextPrompt(params: TurnContextPromptInput): string;
39
+ export {};
@@ -0,0 +1,33 @@
1
+ import type { Message, Thread } from "chat";
2
+ import type { SlackTurnRuntime } from "@/chat/runtime/slack-runtime";
3
+ import { downloadPrivateSlackFile as downloadPrivateSlackFileImpl } from "@/chat/slack/client";
4
+ export type ThreadMessageKind = "new_mention" | "subscribed_message";
5
+ export interface ThreadMessageDispatchArgs {
6
+ beforeFirstResponsePost?: () => Promise<void>;
7
+ kind: ThreadMessageKind;
8
+ message: Message;
9
+ thread: Thread;
10
+ }
11
+ export type ThreadMessageRuntime = Pick<SlackTurnRuntime<unknown>, "handleNewMention" | "handleSubscribedMessage">;
12
+ export type ThreadMessageDispatcher = (args: ThreadMessageDispatchArgs) => Promise<void>;
13
+ export interface CreateThreadMessageDispatcherOptions {
14
+ downloadPrivateSlackFile?: typeof downloadPrivateSlackFileImpl;
15
+ runtime: ThreadMessageRuntime;
16
+ }
17
+ /**
18
+ * Attach Slack private-file download functions to deserialized attachments.
19
+ *
20
+ * The Chat SDK's `concurrency: "queue"` strategy serializes queued messages
21
+ * via `Message.toJSON()`, which strips `fetchData` (a function) and `data`
22
+ * (a Buffer). When dequeued, attachments have a `url` but no fetcher.
23
+ * This re-attaches a bot-token-auth'd download callback.
24
+ *
25
+ * No-ops when `fetchData` is already present, so safe to call unconditionally.
26
+ */
27
+ export declare function rehydrateAttachmentFetchers(message: {
28
+ attachments: Array<{
29
+ fetchData?: unknown;
30
+ url?: string;
31
+ }>;
32
+ }, downloadPrivateSlackFile?: typeof downloadPrivateSlackFileImpl): void;
33
+ export declare function createThreadMessageDispatcher(options: CreateThreadMessageDispatcherOptions): ThreadMessageDispatcher;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Pure helper functions used by the agent reply orchestration in respond.ts.
3
+ *
4
+ * These are extracted to reduce the size of the main orchestration module and
5
+ * make individual helpers independently testable.
6
+ */
7
+ import type { AssistantMessage, ToolResultMessage } from "@earendil-works/pi-ai";
8
+ import type { PiMessage } from "@/chat/pi/messages";
9
+ import type { Skill } from "@/chat/skills";
10
+ /** Extract conversation and session identifiers from correlation context. */
11
+ export declare function getSessionIdentifiers(context: {
12
+ correlation?: {
13
+ conversationId?: string;
14
+ threadId?: string;
15
+ turnId?: string;
16
+ runId?: string;
17
+ };
18
+ }): {
19
+ conversationId?: string;
20
+ sessionId?: string;
21
+ };
22
+ /** Detect polite execution deferral phrases that signal the model is stalling. */
23
+ export declare function isExecutionDeferralResponse(text: string): boolean;
24
+ /** Detect disclaimers about missing tool access. */
25
+ export declare function isToolAccessDisclaimerResponse(text: string): boolean;
26
+ /** True when the model produced an escape response instead of executing. */
27
+ export declare function isExecutionEscapeResponse(text: string): boolean;
28
+ /** Best-effort JSON extraction from text that may contain fenced blocks. */
29
+ export declare function parseJsonCandidate(text: string): unknown;
30
+ /** Check whether a parsed object looks like a raw tool call/result payload. */
31
+ export declare function isToolPayloadShape(payload: unknown): boolean;
32
+ /** Detect responses that are raw tool payloads leaked as text. */
33
+ export declare function isRawToolPayloadResponse(text: string): boolean;
34
+ /** Redact image data from prompt content parts for observability. */
35
+ export declare function toObservablePromptPart(part: {
36
+ type: "text";
37
+ text: string;
38
+ } | {
39
+ type: "image";
40
+ data: string;
41
+ mimeType: string;
42
+ }): Record<string, unknown>;
43
+ /** Truncate message text for log attributes. */
44
+ export declare function summarizeMessageText(text: string): string;
45
+ /**
46
+ * Put prior thread text before the current instruction when no Pi history
47
+ * exists. These are top-level sibling blocks in the user message.
48
+ */
49
+ export declare function buildUserTurnText(userInput: string, conversationContext?: string): string;
50
+ /** Encode a non-image attachment as base64 XML for the prompt. */
51
+ export declare function encodeNonImageAttachmentForPrompt(attachment: {
52
+ data: Buffer;
53
+ mediaType: string;
54
+ filename?: string;
55
+ }): string;
56
+ /** Type guard for Pi SDK tool result messages. */
57
+ export declare function isToolResultMessage(value: unknown): value is ToolResultMessage<any>;
58
+ /** Extract the tool name from a raw tool result message. */
59
+ export declare function normalizeToolNameFromResult(result: unknown): string | undefined;
60
+ /** Check whether a tool result carries an error flag. */
61
+ export declare function isToolResultError(result: unknown): boolean;
62
+ /** Type guard for Pi SDK assistant messages. */
63
+ export declare function isAssistantMessage(value: unknown): value is AssistantMessage;
64
+ /** Extract role string from a raw Pi message. */
65
+ export declare function getPiMessageRole(value: unknown): string | undefined;
66
+ /** Refresh volatile runtime context in a checkpoint before continuing Pi. */
67
+ export declare function refreshRuntimeTurnContext(messages: PiMessage[], turnContextPrompt: string): PiMessage[];
68
+ /** Remove volatile runtime context before using checkpoint messages as history. */
69
+ export declare function stripRuntimeTurnContext(messages: PiMessage[]): PiMessage[];
70
+ /** Concatenate text content parts from an assistant message. */
71
+ export declare function extractAssistantText(message: AssistantMessage): string;
72
+ /** Return assistant messages that belong to the terminal post-tool reply phase. */
73
+ export declare function getTerminalAssistantMessages(messages: readonly unknown[]): AssistantMessage[];
74
+ /** Upsert a skill into the active skills list by name. */
75
+ export declare function upsertActiveSkill(activeSkills: Skill[], next: Skill): void;
76
+ /** Remove trailing assistant messages before checkpointing. */
77
+ export declare function trimTrailingAssistantMessages(messages: PiMessage[]): PiMessage[];
@@ -0,0 +1,75 @@
1
+ import type { ChannelConfigurationService } from "@/chat/configuration/types";
2
+ import type { ThreadArtifactsState } from "@/chat/state/artifacts";
3
+ import type { ConversationPendingAuthState } from "@/chat/state/conversation";
4
+ import type { ImageGenerateToolDeps, WebFetchToolDeps, WebSearchToolDeps } from "@/chat/tools/types";
5
+ import type { PiMessage } from "@/chat/pi/messages";
6
+ import { type SandboxAcquiredState } from "@/chat/sandbox/sandbox";
7
+ import type { AssistantStatusSpec } from "@/chat/slack/assistant-thread/status";
8
+ import { type AssistantReply, type AgentTurnDiagnostics } from "@/chat/services/turn-result";
9
+ import { type AuthorizationFlowMode } from "@/chat/services/auth-pause";
10
+ export type { AssistantReply, AgentTurnDiagnostics };
11
+ export interface ReplyRequestContext {
12
+ skillDirs?: string[];
13
+ credentialSubject?: {
14
+ type: "user";
15
+ userId: string;
16
+ allowedWhen: "private-direct-conversation";
17
+ };
18
+ requester?: {
19
+ userId?: string;
20
+ userName?: string;
21
+ fullName?: string;
22
+ email?: string;
23
+ };
24
+ correlation?: {
25
+ conversationId?: string;
26
+ threadId?: string;
27
+ turnId?: string;
28
+ runId?: string;
29
+ channelId?: string;
30
+ teamId?: string;
31
+ messageTs?: string;
32
+ threadTs?: string;
33
+ requesterId?: string;
34
+ actorType?: string;
35
+ actorId?: string;
36
+ };
37
+ toolChannelId?: string;
38
+ conversationContext?: string;
39
+ artifactState?: ThreadArtifactsState;
40
+ pendingAuth?: ConversationPendingAuthState;
41
+ authorizationFlowMode?: AuthorizationFlowMode;
42
+ configuration?: Record<string, unknown>;
43
+ /** Durable Pi transcript for this conversation, excluding ephemeral turn context. */
44
+ piMessages?: PiMessage[];
45
+ channelConfiguration?: ChannelConfigurationService;
46
+ userAttachments?: Array<{
47
+ data?: Buffer;
48
+ mediaType: string;
49
+ filename?: string;
50
+ promptText?: string;
51
+ }>;
52
+ inboundAttachmentCount?: number;
53
+ omittedImageAttachmentCount?: number;
54
+ sandbox?: {
55
+ sandboxId?: string;
56
+ sandboxDependencyProfileHash?: string;
57
+ };
58
+ onSandboxAcquired?: (sandbox: SandboxAcquiredState) => void | Promise<void>;
59
+ onArtifactStateUpdated?: (artifactState: ThreadArtifactsState) => void | Promise<void>;
60
+ toolOverrides?: {
61
+ imageGenerate?: ImageGenerateToolDeps;
62
+ webFetch?: WebFetchToolDeps;
63
+ webSearch?: WebSearchToolDeps;
64
+ };
65
+ onStatus?: (status: AssistantStatusSpec) => void | Promise<void>;
66
+ onAuthPending?: (pendingAuth: ConversationPendingAuthState) => void | Promise<void>;
67
+ onTextDelta?: (deltaText: string) => void | Promise<void>;
68
+ onAssistantMessageStart?: () => void | Promise<void>;
69
+ onToolInvocation?: (invocation: {
70
+ toolName: string;
71
+ params: Record<string, unknown>;
72
+ }) => void;
73
+ }
74
+ /** Run a full agent turn: discover skills, execute tools, and return the assistant reply. */
75
+ export declare function generateAssistantReply(messageText: string, context?: ReplyRequestContext): Promise<AssistantReply>;
@@ -0,0 +1,11 @@
1
+ import { type ThreadConversationState } from "@/chat/state/conversation";
2
+ /** Mark an auth-paused turn complete after private authorization link delivery. */
3
+ export declare function completeAuthPauseTurn(args: {
4
+ conversation: ThreadConversationState;
5
+ sessionId: string;
6
+ }): void;
7
+ /** Reload thread state, mark the auth pause as parked, and persist it. */
8
+ export declare function persistAuthPauseTurnState(args: {
9
+ sessionId: string;
10
+ threadStateId: string;
11
+ }): Promise<void>;
@@ -0,0 +1,15 @@
1
+ import type { AssistantReply } from "@/chat/respond";
2
+ import type { ThreadConversationState } from "@/chat/state/conversation";
3
+ import type { ThreadArtifactsState } from "@/chat/state/artifacts";
4
+ import { type ThreadStatePatch } from "@/chat/runtime/thread-state";
5
+ /** Build the canonical thread-state patch after final Slack delivery succeeds. */
6
+ export declare function buildDeliveredTurnStatePatch(args: {
7
+ artifactStatePatch?: Partial<ThreadArtifactsState>;
8
+ artifacts: ThreadArtifactsState;
9
+ conversation: ThreadConversationState;
10
+ reply: AssistantReply;
11
+ sessionId: string;
12
+ userMessageId?: string;
13
+ }): ThreadStatePatch & {
14
+ conversation: ThreadConversationState;
15
+ };
@@ -0,0 +1 @@
1
+ export declare function shouldEmitDevAgentTrace(): boolean;
@@ -0,0 +1,25 @@
1
+ import type { Message, Thread } from "chat";
2
+ /** Controls the automatic Slack processing reaction lifecycle for one message. */
3
+ export interface ProcessingReactionSession {
4
+ keep: () => void;
5
+ stop: () => Promise<void>;
6
+ }
7
+ /** Return true when a Slack reaction tool call should leave the processing reaction in place. */
8
+ export declare function shouldKeepProcessingReactionForToolInvocation(input: {
9
+ params: Record<string, unknown>;
10
+ toolName: string;
11
+ }): boolean;
12
+ /** Start Junior's automatic Slack processing reaction for one inbound message. */
13
+ export declare function startSlackProcessingReaction(args: {
14
+ logException: (error: unknown, eventName: string, context?: Record<string, unknown>, attributes?: Record<string, unknown>, body?: string) => string | undefined;
15
+ logContext: Record<string, unknown>;
16
+ message: Message;
17
+ thread: Thread;
18
+ }): Promise<ProcessingReactionSession>;
19
+ /** Start Junior's automatic Slack processing reaction for a known Slack message. */
20
+ export declare function startSlackProcessingReactionForMessage(args: {
21
+ channelId: string;
22
+ timestamp: string;
23
+ logException: (error: unknown, eventName: string, context?: Record<string, unknown>, attributes?: Record<string, unknown>, body?: string) => string | undefined;
24
+ logContext: Record<string, unknown>;
25
+ }): Promise<ProcessingReactionSession>;
@@ -0,0 +1,56 @@
1
+ import type { Message, Thread } from "chat";
2
+ import type { SlackAdapter } from "@chat-adapter/slack";
3
+ import { generateAssistantReply as generateAssistantReplyImpl } from "@/chat/respond";
4
+ import type { PreparedTurnState } from "@/chat/runtime/turn-preparation";
5
+ import { type ConversationMemoryService } from "@/chat/services/conversation-memory";
6
+ import { lookupSlackUser } from "@/chat/slack/user";
7
+ import type { TurnContinuationRequest } from "@/chat/services/timeout-resume";
8
+ export interface ReplyExecutorServices {
9
+ generateAssistantReply: typeof generateAssistantReplyImpl;
10
+ generateThreadTitle: ConversationMemoryService["generateThreadTitle"];
11
+ getAwaitingTurnContinuationRequest: (args: {
12
+ conversationId: string;
13
+ sessionId: string;
14
+ }) => Promise<TurnContinuationRequest | undefined>;
15
+ lookupSlackUser: typeof lookupSlackUser;
16
+ scheduleTurnTimeoutResume: (request: TurnContinuationRequest) => Promise<void>;
17
+ }
18
+ interface ReplyExecutorDeps {
19
+ getSlackAdapter: () => SlackAdapter;
20
+ resolveUserAttachments: (attachments: Message["attachments"] | undefined, context: {
21
+ threadId?: string;
22
+ requesterId?: string;
23
+ channelId?: string;
24
+ runId?: string;
25
+ conversation?: PreparedTurnState["conversation"];
26
+ messageTs?: string;
27
+ }) => Promise<Array<{
28
+ data?: Buffer;
29
+ mediaType: string;
30
+ filename?: string;
31
+ promptText?: string;
32
+ }>>;
33
+ prepareTurnState: (args: {
34
+ explicitMention: boolean;
35
+ message: Message;
36
+ thread: Thread;
37
+ userText: string;
38
+ context: {
39
+ threadId?: string;
40
+ requesterId?: string;
41
+ channelId?: string;
42
+ runId?: string;
43
+ };
44
+ }) => Promise<PreparedTurnState>;
45
+ services: ReplyExecutorServices;
46
+ }
47
+ export declare function createReplyToThread(deps: ReplyExecutorDeps): (thread: Thread, message: Message, options?: {
48
+ beforeFirstResponsePost?: () => Promise<void>;
49
+ explicitMention?: boolean;
50
+ onToolInvocation?: (invocation: {
51
+ params: Record<string, unknown>;
52
+ toolName: string;
53
+ }) => void;
54
+ preparedState?: PreparedTurnState;
55
+ }) => Promise<void>;
56
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { AssistantStatusSpec } from "@/chat/slack/assistant-thread/status-render";
2
+ /** Convert a `reportProgress` tool payload into assistant status text. */
3
+ export declare function buildReportedProgressStatus(input: unknown): AssistantStatusSpec | undefined;
@@ -0,0 +1,50 @@
1
+ import { generateAssistantReply, type AssistantReply, type ReplyRequestContext } from "@/chat/respond";
2
+ /** Error raised when another worker already owns the resume lock. */
3
+ export declare class ResumeTurnBusyError extends Error {
4
+ constructor(lockKey: string);
5
+ }
6
+ interface ResumeSlackTurnArgs {
7
+ messageText: string;
8
+ channelId: string;
9
+ threadTs: string;
10
+ messageTs?: string;
11
+ replyContext?: ReplyRequestContext;
12
+ lockKey?: string;
13
+ initialText?: string;
14
+ generateReply?: typeof generateAssistantReply;
15
+ onSuccess?: (reply: AssistantReply) => Promise<void>;
16
+ onFailure?: (error: unknown) => Promise<void>;
17
+ onAuthPause?: (error: unknown) => Promise<void>;
18
+ onTimeoutPause?: (error: unknown) => Promise<void>;
19
+ onPostDeliveryCommitFailure?: (error: unknown) => Promise<void>;
20
+ beforeStart?: () => Promise<Partial<ResumeSlackTurnArgs> | false | void>;
21
+ replyTimeoutMs?: number;
22
+ }
23
+ /**
24
+ * Resume a paused Slack turn under the normal thread lock.
25
+ *
26
+ * Success is defined by final reply delivery, not only by successful assistant
27
+ * generation. If the final visible Slack post fails, the resumed turn is
28
+ * treated as failed so thread state does not claim the user saw a reply that
29
+ * never arrived.
30
+ */
31
+ export declare function resumeSlackTurn(args: ResumeSlackTurnArgs): Promise<void>;
32
+ /** Resume an OAuth-paused Slack request through the shared resume runner. */
33
+ export declare function resumeAuthorizedRequest(args: {
34
+ messageText: string;
35
+ channelId: string;
36
+ threadTs: string;
37
+ messageTs?: string;
38
+ connectedText: string;
39
+ replyContext?: ReplyRequestContext;
40
+ lockKey?: string;
41
+ generateReply?: typeof generateAssistantReply;
42
+ onSuccess?: (reply: AssistantReply) => Promise<void>;
43
+ onFailure?: (error: unknown) => Promise<void>;
44
+ onAuthPause?: (error: unknown) => Promise<void>;
45
+ onTimeoutPause?: (error: unknown) => Promise<void>;
46
+ onPostDeliveryCommitFailure?: (error: unknown) => Promise<void>;
47
+ beforeStart?: () => Promise<Partial<ResumeSlackTurnArgs> | false | void>;
48
+ replyTimeoutMs?: number;
49
+ }): Promise<void>;
50
+ export {};
@@ -0,0 +1,100 @@
1
+ import type { Message, Thread } from "chat";
2
+ import type { SubscribedReplyDecision } from "@/chat/services/subscribed-reply-policy";
3
+ export interface AssistantLifecycleEvent {
4
+ channelId: string;
5
+ context?: {
6
+ channelId?: string;
7
+ };
8
+ threadId: string;
9
+ threadTs: string;
10
+ userId?: string;
11
+ }
12
+ export interface ThreadContext {
13
+ channelId?: string;
14
+ requesterId?: string;
15
+ threadId?: string;
16
+ runId?: string;
17
+ }
18
+ export interface ReplyHooks {
19
+ beforeFirstResponsePost?: () => Promise<void>;
20
+ onToolInvocation?: (invocation: {
21
+ params: Record<string, unknown>;
22
+ toolName: string;
23
+ }) => void;
24
+ }
25
+ export interface SlackTurnRuntimeDependencies<TPreparedState> {
26
+ assistantUserName: string;
27
+ getChannelId: (thread: Thread, message: Message) => string | undefined;
28
+ getPreparedConversationContext: (preparedState: TPreparedState) => string | undefined;
29
+ getThreadId: (thread: Thread, message: Message) => string | undefined;
30
+ getRunId: (thread: Thread, message: Message) => string | undefined;
31
+ initializeAssistantThread: (event: {
32
+ channelId: string;
33
+ sourceChannelId?: string;
34
+ threadId: string;
35
+ threadTs: string;
36
+ }) => Promise<void>;
37
+ refreshAssistantThreadContext: (event: {
38
+ channelId: string;
39
+ sourceChannelId?: string;
40
+ threadId: string;
41
+ threadTs: string;
42
+ }) => Promise<void>;
43
+ logException: (error: unknown, eventName: string, context?: Record<string, unknown>, attributes?: Record<string, unknown>, body?: string) => string | undefined;
44
+ logWarn: (eventName: string, context?: Record<string, unknown>, attributes?: Record<string, unknown>, body?: string) => void;
45
+ modelId: string;
46
+ now: () => number;
47
+ recordSkippedSubscribedMessage: (args: {
48
+ completedAtMs: number;
49
+ decision: SubscribedReplyDecision;
50
+ message: Message;
51
+ thread: Thread;
52
+ userText: string;
53
+ }) => Promise<void>;
54
+ onSubscribedMessageSkipped: (args: {
55
+ completedAtMs: number;
56
+ decision: SubscribedReplyDecision;
57
+ message: Message;
58
+ preparedState?: TPreparedState;
59
+ thread: Thread;
60
+ }) => Promise<void>;
61
+ persistPreparedState: (args: {
62
+ preparedState: TPreparedState;
63
+ thread: Thread;
64
+ }) => Promise<void>;
65
+ prepareTurnState: (args: {
66
+ context: ThreadContext;
67
+ explicitMention: boolean;
68
+ message: Message;
69
+ thread: Thread;
70
+ userText: string;
71
+ }) => Promise<TPreparedState>;
72
+ replyToThread: (thread: Thread, message: Message, options?: {
73
+ beforeFirstResponsePost?: () => Promise<void>;
74
+ explicitMention?: boolean;
75
+ onToolInvocation?: (invocation: {
76
+ params: Record<string, unknown>;
77
+ toolName: string;
78
+ }) => void;
79
+ preparedState?: TPreparedState;
80
+ }) => Promise<void>;
81
+ decideSubscribedReply: (args: {
82
+ context: ThreadContext;
83
+ conversationContext?: string;
84
+ hasAttachments?: boolean;
85
+ isExplicitMention?: boolean;
86
+ rawText: string;
87
+ text: string;
88
+ }) => Promise<SubscribedReplyDecision>;
89
+ stripLeadingBotMention: (text: string, options: {
90
+ stripLeadingSlackMentionToken?: boolean;
91
+ }) => string;
92
+ withSpan: (name: string, op: string, context: Record<string, unknown>, callback: () => Promise<void>) => Promise<void>;
93
+ }
94
+ export interface SlackTurnRuntime<_TPreparedState, TAssistantEvent extends AssistantLifecycleEvent = AssistantLifecycleEvent> {
95
+ handleAssistantContextChanged: (event: TAssistantEvent) => Promise<void>;
96
+ handleAssistantThreadStarted: (event: TAssistantEvent) => Promise<void>;
97
+ handleNewMention: (thread: Thread, message: Message, hooks?: ReplyHooks) => Promise<void>;
98
+ handleSubscribedMessage: (thread: Thread, message: Message, hooks?: ReplyHooks) => Promise<void>;
99
+ }
100
+ export declare function createSlackTurnRuntime<TPreparedState, TAssistantEvent extends AssistantLifecycleEvent = AssistantLifecycleEvent>(deps: SlackTurnRuntimeDependencies<TPreparedState>): SlackTurnRuntime<TPreparedState, TAssistantEvent>;
@@ -0,0 +1,24 @@
1
+ import type { Message, Thread } from "chat";
2
+ export declare function stripLeadingBotMention(text: string, options?: {
3
+ stripLeadingSlackMentionToken?: boolean;
4
+ }): string;
5
+ export declare function getThreadId(thread: Thread, _message: Message): string | undefined;
6
+ export declare function getRunId(thread: Thread, message: Message): string | undefined;
7
+ export declare function getChannelId(thread: Thread, message: Message): string | undefined;
8
+ export declare function getThreadTs(threadId: string | undefined): string | undefined;
9
+ /**
10
+ * Resolve Slack assistant-thread API context for the current turn.
11
+ *
12
+ * Slack assistant-thread methods must use the live inbound thread context
13
+ * Slack provided on the current message. Slack's assistant utilities build
14
+ * `setStatus`/`setTitle` from `message.channel` plus `message.thread_ts ?? message.ts`
15
+ * for non-DM message events, while `message.im` still requires an explicit
16
+ * `thread_ts`. Do not synthesize assistant-thread roots from persisted state.
17
+ */
18
+ export declare function getAssistantThreadContext(message: Message): {
19
+ channelId: string;
20
+ threadTs: string;
21
+ } | undefined;
22
+ export declare function getMessageTs(message: Message): string | undefined;
23
+ /** Resolve the Slack workspace/team id from the raw inbound message payload. */
24
+ export declare function getTeamId(message: Message): string | undefined;