@sentry/junior 0.146.0 → 0.148.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 (227) hide show
  1. package/dist/{agent-hooks-SLJADYE5.js → agent-hooks-VAUYT6PD.js} +10 -10
  2. package/dist/api/conversations/access.d.ts +2 -1
  3. package/dist/api/conversations/archive.d.ts +3 -5
  4. package/dist/api/conversations/create.d.ts +6 -0
  5. package/dist/api/conversations/detail.d.ts +2 -295
  6. package/dist/api/conversations/event-list.d.ts +2 -192
  7. package/dist/api/conversations/list.d.ts +4 -66
  8. package/dist/api/conversations/routes.d.ts +1 -1
  9. package/dist/api/conversations/stats.d.ts +0 -54
  10. package/dist/api/http.d.ts +2 -6
  11. package/dist/api/locations/detail.d.ts +3 -111
  12. package/dist/api/locations/list.d.ts +0 -45
  13. package/dist/api/locations/query.d.ts +2 -1
  14. package/dist/api/locations/routes.d.ts +1 -1
  15. package/dist/api/people/list.d.ts +0 -29
  16. package/dist/api/people/profile.d.ts +2 -106
  17. package/dist/api/people/profile.query.d.ts +2 -1
  18. package/dist/api/people/routes.d.ts +1 -1
  19. package/dist/api/people/shared.d.ts +1 -1
  20. package/dist/api/people/spend.d.ts +3 -4
  21. package/dist/api/personal-tokens/routes.d.ts +2 -2
  22. package/dist/api/route.d.ts +8 -14
  23. package/dist/api/schema/conversation.d.ts +64 -29
  24. package/dist/api/schema/location.d.ts +4 -0
  25. package/dist/api/schema/person.d.ts +7 -3
  26. package/dist/api/schema.d.ts +2 -2
  27. package/dist/api/schema.js +7 -1
  28. package/dist/api/stats.d.ts +0 -13
  29. package/dist/api/validation.d.ts +7 -0
  30. package/dist/api/viewer.d.ts +3 -0
  31. package/dist/api.d.ts +2 -1
  32. package/dist/api.js +630 -564
  33. package/dist/app.js +369 -309
  34. package/dist/{catalog-runtime-RQIMSDPR.js → catalog-runtime-WADOZVTB.js} +5 -5
  35. package/dist/chat/actor.d.ts +4 -1
  36. package/dist/chat/agent/prompt.d.ts +0 -2
  37. package/dist/chat/agent/request.d.ts +4 -5
  38. package/dist/chat/agent/resume.d.ts +1 -0
  39. package/dist/chat/agent/sandbox.d.ts +2 -2
  40. package/dist/chat/agent/tools.d.ts +0 -2
  41. package/dist/chat/agent-dispatch/context.d.ts +2 -2
  42. package/dist/chat/agent-dispatch/types.d.ts +2 -2
  43. package/dist/chat/agent-invocations/types.d.ts +52 -0
  44. package/dist/chat/api-turns/work.d.ts +103 -0
  45. package/dist/chat/capabilities/jr-rpc-command.d.ts +2 -2
  46. package/dist/chat/configuration/service.d.ts +5 -2
  47. package/dist/chat/configuration/sql.d.ts +9 -0
  48. package/dist/chat/configuration/types.d.ts +17 -13
  49. package/dist/chat/conversations/history.d.ts +63 -0
  50. package/dist/chat/conversations/projection.d.ts +10 -0
  51. package/dist/chat/conversations/provenance.d.ts +6 -0
  52. package/dist/chat/conversations/sql/actor-identity.d.ts +19 -0
  53. package/dist/chat/conversations/store.d.ts +1 -1
  54. package/dist/chat/credentials/unlink-provider.d.ts +2 -1
  55. package/dist/chat/credentials/user-token-store.d.ts +2 -0
  56. package/dist/chat/event-tasks/tool-support.d.ts +2 -0
  57. package/dist/chat/identities/sql.d.ts +8 -0
  58. package/dist/chat/logging.d.ts +2 -0
  59. package/dist/chat/mcp/auth-store.d.ts +0 -2
  60. package/dist/chat/mcp/oauth.d.ts +0 -2
  61. package/dist/chat/oauth-flow.d.ts +3 -1
  62. package/dist/chat/pi/client.d.ts +2 -0
  63. package/dist/chat/plugins/credential-hooks.d.ts +2 -0
  64. package/dist/chat/prompt.d.ts +0 -2
  65. package/dist/chat/resource-events/notification.d.ts +2 -1
  66. package/dist/chat/resource-events/store.d.ts +1 -1
  67. package/dist/chat/runtime/delivered-turn-state.d.ts +1 -4
  68. package/dist/chat/runtime/reply-executor.d.ts +1 -1
  69. package/dist/chat/runtime/slack-runtime.d.ts +2 -1
  70. package/dist/chat/runtime/thread-state.d.ts +8 -11
  71. package/dist/chat/runtime/turn-input.d.ts +4 -2
  72. package/dist/chat/runtime/turn-preparation.d.ts +11 -4
  73. package/dist/chat/sandbox/command-result.d.ts +2 -0
  74. package/dist/chat/sandbox/egress/schemas.d.ts +6 -0
  75. package/dist/chat/scheduled-tasks/tool-support.d.ts +7 -5
  76. package/dist/chat/scheduled-tasks/tools/create.d.ts +4 -2
  77. package/dist/chat/scheduled-tasks/tools/delete.d.ts +4 -2
  78. package/dist/chat/scheduled-tasks/tools/list.d.ts +4 -2
  79. package/dist/chat/scheduled-tasks/tools/run-now.d.ts +4 -2
  80. package/dist/chat/scheduled-tasks/tools/update.d.ts +4 -2
  81. package/dist/chat/services/mcp-auth-orchestration.d.ts +0 -3
  82. package/dist/chat/services/plugin-auth-orchestration.d.ts +2 -1
  83. package/dist/chat/services/provider-default-config.d.ts +2 -2
  84. package/dist/chat/services/subscribed-decision.d.ts +3 -0
  85. package/dist/chat/services/subscribed-reply-policy.d.ts +1 -0
  86. package/dist/chat/services/turn-result.d.ts +0 -3
  87. package/dist/chat/services/turn-router.d.ts +3 -0
  88. package/dist/chat/slack/assistant-thread/lifecycle.d.ts +0 -1
  89. package/dist/chat/slack/assistant-thread/title.d.ts +0 -3
  90. package/dist/chat/slack/channel.d.ts +26 -0
  91. package/dist/chat/slack/dispatch-turn.d.ts +2 -1
  92. package/dist/chat/slack/timestamp-param.d.ts +0 -2
  93. package/dist/chat/slack/{tools → tool-support}/canvas/api.d.ts +1 -1
  94. package/dist/chat/slack/tool-support/canvas/context.d.ts +11 -0
  95. package/dist/chat/slack/tool-support/channel-access.d.ts +42 -0
  96. package/dist/chat/slack/tool-support/channel-target.d.ts +27 -0
  97. package/dist/chat/slack/{tools → tool-support}/list/api.d.ts +8 -1
  98. package/dist/chat/slack/tool-support/list/params.d.ts +5 -0
  99. package/dist/chat/slack/tools/canvas/create.d.ts +3 -1
  100. package/dist/chat/slack/tools/canvas/edit.d.ts +2 -0
  101. package/dist/chat/slack/tools/canvas/read.d.ts +2 -0
  102. package/dist/chat/slack/tools/canvas/write.d.ts +2 -0
  103. package/dist/chat/slack/tools/{user-lookup.d.ts → channel-join.d.ts} +6 -5
  104. package/dist/chat/slack/tools/channel-list-messages.d.ts +5 -2
  105. package/dist/chat/slack/tools/conversation-message-search.d.ts +4 -8
  106. package/dist/chat/slack/tools/list/add-items.d.ts +4 -1
  107. package/dist/chat/slack/tools/list/create.d.ts +2 -0
  108. package/dist/chat/slack/tools/list/get-items.d.ts +5 -3
  109. package/dist/chat/slack/tools/list/update-item.d.ts +5 -1
  110. package/dist/chat/slack/tools/message-add-reaction.d.ts +3 -1
  111. package/dist/chat/slack/tools/public-search.d.ts +65 -2
  112. package/dist/chat/slack/tools/send-files.d.ts +3 -1
  113. package/dist/chat/slack/tools/thread-read.d.ts +4 -5
  114. package/dist/chat/slack/vision-cache.d.ts +5 -0
  115. package/dist/chat/source.d.ts +2 -0
  116. package/dist/chat/state/conversation.d.ts +4 -5
  117. package/dist/chat/task-execution/checkpoint.d.ts +1 -0
  118. package/dist/chat/task-execution/state.d.ts +9 -4
  119. package/dist/chat/task-execution/store.d.ts +3 -2
  120. package/dist/chat/task-execution/turn-cursor.d.ts +2 -0
  121. package/dist/chat/task-execution/worker.d.ts +2 -0
  122. package/dist/chat/tasks/read.d.ts +1 -1
  123. package/dist/chat/tool-support/structured-result.d.ts +1 -0
  124. package/dist/chat/tool-support/timed-out-tool-result.d.ts +11 -0
  125. package/dist/chat/tools/create-event-task.d.ts +2 -0
  126. package/dist/chat/tools/delete-event-task.d.ts +2 -0
  127. package/dist/chat/tools/handoff/tool.d.ts +2 -0
  128. package/dist/chat/tools/list-event-tasks.d.ts +2 -0
  129. package/dist/chat/tools/list-resource-event-subscriptions.d.ts +2 -0
  130. package/dist/chat/tools/runtime/report-progress.d.ts +2 -0
  131. package/dist/chat/tools/runtime/spawn-agent.d.ts +2 -0
  132. package/dist/chat/tools/search-conversation-events.d.ts +3 -1
  133. package/dist/chat/tools/search-resource-event-types.d.ts +2 -0
  134. package/dist/chat/tools/search-tools.d.ts +2 -0
  135. package/dist/chat/tools/skill/load-skill.d.ts +2 -0
  136. package/dist/chat/tools/skill/search-mcp-tools.d.ts +2 -0
  137. package/dist/chat/tools/stop-watching-resources.d.ts +2 -0
  138. package/dist/chat/tools/system-time.d.ts +2 -0
  139. package/dist/chat/tools/types.d.ts +11 -10
  140. package/dist/chat/tools/update-event-task.d.ts +2 -0
  141. package/dist/chat/tools/user-lookup.d.ts +29 -0
  142. package/dist/chat/tools/watch-resource-events.d.ts +4 -2
  143. package/dist/chat/tools/web/fetch-tool.d.ts +2 -0
  144. package/dist/chat/tools/web/image-generate.d.ts +2 -0
  145. package/dist/chat/tools/web/search.d.ts +2 -0
  146. package/dist/{chunk-GYEKOX7N.js → chunk-2B3PT3V2.js} +1 -1
  147. package/dist/{chunk-JLMVCNXL.js → chunk-45LOR4PU.js} +22 -4
  148. package/dist/{chunk-FGHADGIC.js → chunk-4AQZYNHM.js} +2 -2
  149. package/dist/{chunk-W65V465O.js → chunk-4EA2SFK2.js} +66 -4
  150. package/dist/{chunk-MKRIZ4VG.js → chunk-4GXJUYJV.js} +4 -2
  151. package/dist/{chunk-F7REGDKO.js → chunk-55F4QU2V.js} +2 -1
  152. package/dist/{chunk-M6ZWP4RI.js → chunk-7OEIXFC3.js} +2 -2
  153. package/dist/{chunk-MCFIXAV5.js → chunk-D3WPMGEX.js} +55 -37
  154. package/dist/{chunk-AISNSNDV.js → chunk-D6YX4NNN.js} +22 -10
  155. package/dist/chunk-DUY5CDAM.js +36 -0
  156. package/dist/{chunk-B63BF443.js → chunk-EAI67NTM.js} +9 -1
  157. package/dist/{chunk-FEKQHPVA.js → chunk-EINWQFXI.js} +9 -8
  158. package/dist/chunk-GDFF3BQG.js +136 -0
  159. package/dist/{chunk-X22KCSCO.js → chunk-GXYDVZKM.js} +7 -5
  160. package/dist/{chunk-X2WMBTS3.js → chunk-HLPLT3NY.js} +8 -5
  161. package/dist/{chunk-PB222GIA.js → chunk-HWQGBIH7.js} +1 -1
  162. package/dist/chunk-IL4EDBMV.js +566 -0
  163. package/dist/{chunk-HQE6EJS5.js → chunk-LAZGHEYU.js} +1 -1
  164. package/dist/{chunk-QG7OOKIN.js → chunk-LE5H7LMT.js} +1 -1
  165. package/dist/chunk-LNVEIJ2L.js +48 -0
  166. package/dist/{chunk-JUA6VU2Z.js → chunk-OJCP3C3J.js} +12 -23
  167. package/dist/{chunk-37JJDS4H.js → chunk-POSZWRGL.js} +1 -1
  168. package/dist/{chunk-TCEJ7XXM.js → chunk-QOWHHM3F.js} +1 -1
  169. package/dist/{chunk-H6U2U3EP.js → chunk-RRJV5UR5.js} +304 -65
  170. package/dist/{chunk-OFPYOC3M.js → chunk-ULAU5ZGU.js} +127 -120
  171. package/dist/{chunk-V6SRLKUB.js → chunk-V2FXMOEA.js} +2 -2
  172. package/dist/{chunk-GDQEU4I7.js → chunk-VCYSOXON.js} +296 -526
  173. package/dist/{chunk-BLETMLRX.js → chunk-VMNRXKAH.js} +1374 -989
  174. package/dist/{chunk-37EVZP66.js → chunk-VRHTNBA6.js} +167 -92
  175. package/dist/{chunk-FXDDDSPL.js → chunk-VY6W3T43.js} +4 -4
  176. package/dist/{chunk-ZDGHGY74.js → chunk-WCN4YSH7.js} +13 -6
  177. package/dist/{chunk-PH4Q3A6W.js → chunk-WOONT5ZP.js} +1 -1
  178. package/dist/{chunk-47OSH2ZO.js → chunk-XJ42NBP5.js} +395 -206
  179. package/dist/{chunk-SCGVWUZX.js → chunk-ZCHIC2GM.js} +92 -75
  180. package/dist/chunk-ZPL2RR7F.js +798 -0
  181. package/dist/cli/chat.js +33 -35
  182. package/dist/cli/check.js +6 -6
  183. package/dist/cli/plugins.js +13 -13
  184. package/dist/cli/snapshot-create.js +9 -9
  185. package/dist/cli/upgrade.js +7 -7
  186. package/dist/db/schema/agent-invocations.d.ts +20 -0
  187. package/dist/db/schema/conversation-annotations.d.ts +2 -2
  188. package/dist/db/schema/location-configurations.d.ts +127 -0
  189. package/dist/db/schema.d.ts +150 -3
  190. package/dist/{db-WWOMXWTT.js → db-XUKZRFFK.js} +7 -7
  191. package/dist/instrumentation.js +4 -4
  192. package/dist/nitro.js +2 -2
  193. package/dist/{oauth-callback-server-A6ZZX74U.js → oauth-callback-server-LPZMMGFI.js} +25 -26
  194. package/dist/{runner-KSGB2UAV.js → runner-DGKUTMPX.js} +22 -41
  195. package/dist/{skills-26QPWKVS.js → skills-P7YUFSXM.js} +6 -6
  196. package/dist/spawn-DSK3ZEVD.js +38 -0
  197. package/dist/{validation-OPSRGFGH.js → validation-S7U5M5NR.js} +6 -6
  198. package/dist/version.js +1 -1
  199. package/dist/{work-VMSW7STJ.js → work-GAA7TVAD.js} +18 -19
  200. package/dist/{worker-2JNFB7C7.js → worker-JXPJH3QB.js} +11 -10
  201. package/migrations/0024_misty_typhoid_mary.sql +12 -0
  202. package/migrations/meta/0024_snapshot.json +2275 -0
  203. package/migrations/meta/_journal.json +7 -0
  204. package/package.json +6 -5
  205. package/dist/api/health.d.ts +0 -7
  206. package/dist/api/personal-tokens/create.d.ts +0 -11
  207. package/dist/api/personal-tokens/list.d.ts +0 -12
  208. package/dist/api/personal-tokens/revoke.d.ts +0 -5
  209. package/dist/api/plugin-reports.d.ts +0 -63
  210. package/dist/api/plugins.d.ts +0 -8
  211. package/dist/api/runtime.d.ts +0 -24
  212. package/dist/api/skills.d.ts +0 -6
  213. package/dist/chat/slack/tools/canvas/context.d.ts +0 -18
  214. package/dist/chat/slack/tools/channel-access.d.ts +0 -30
  215. package/dist/chat/state/artifacts.d.ts +0 -30
  216. package/dist/chat/tool-support/turn-deadline-result.d.ts +0 -3
  217. package/dist/chunk-HLXXQI5Q.js +0 -238
  218. package/dist/chunk-LVW7BLLT.js +0 -115
  219. package/dist/chunk-Q6QZTTLS.js +0 -55
  220. package/dist/chunk-QSXZ42KX.js +0 -285
  221. package/dist/chunk-R776HKPK.js +0 -81
  222. package/dist/chunk-T5GXFFLA.js +0 -67
  223. package/dist/spawn-5LAJXZ2P.js +0 -39
  224. /package/dist/chat/slack/{tools → tool-support}/canvas/markdown.d.ts +0 -0
  225. /package/dist/chat/slack/{tools → tool-support}/channel-capabilities.d.ts +0 -0
  226. /package/dist/chat/slack/{tools → tool-support}/context.d.ts +0 -0
  227. /package/dist/chat/slack/{tools → tool-support}/slack-message-url.d.ts +0 -0
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-PB222GIA.js";
4
- import "./chunk-37JJDS4H.js";
3
+ } from "./chunk-HWQGBIH7.js";
4
+ import "./chunk-POSZWRGL.js";
5
5
  import "./chunk-RUIXF3YQ.js";
6
6
  import "./chunk-HZF5P5UN.js";
7
7
  import "./chunk-F3B2YJ76.js";
8
- import "./chunk-B63BF443.js";
8
+ import "./chunk-EAI67NTM.js";
9
9
  import "./chunk-6GWA276C.js";
10
10
  import "./chunk-OOUNJNMR.js";
11
11
  import "./chunk-H4HBKISO.js";
12
- import "./chunk-HQE6EJS5.js";
13
- import "./chunk-F7REGDKO.js";
12
+ import "./chunk-LAZGHEYU.js";
13
+ import "./chunk-55F4QU2V.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
  export {
16
16
  pluginCatalogRuntime
@@ -26,11 +26,14 @@ export interface SlackActor extends BaseActor {
26
26
  export interface LocalActor extends BaseActor {
27
27
  platform: "local";
28
28
  }
29
+ export interface WebActor extends BaseActor {
30
+ platform: "web";
31
+ }
29
32
  export interface SystemActor {
30
33
  platform: "system";
31
34
  name: string;
32
35
  }
33
- export type UserActor = SlackActor | LocalActor;
36
+ export type UserActor = SlackActor | LocalActor | WebActor;
34
37
  export type Actor = UserActor | SystemActor;
35
38
  export interface SlackActorProfile {
36
39
  email?: string;
@@ -6,7 +6,6 @@ import type { ActiveMcpCatalogSummary } from "@/chat/tool-support/skill/mcp-tool
6
6
  import type { ToolRuntimeContext } from "@/chat/tools/types";
7
7
  import type { AnyToolDefinition } from "@/chat/tools/definition";
8
8
  import { type Actor } from "@/chat/actor";
9
- import type { ThreadArtifactsState } from "@/chat/state/artifacts";
10
9
  import type { PluginTurnContext } from "@/chat/plugins/prompt";
11
10
  import type { AgentRunInput, AgentRunInstructionActor, AgentRunRouting, AgentRunSteeringMessage } from "@/chat/agent/request";
12
11
  export type UserContentPart = {
@@ -62,7 +61,6 @@ export declare function buildSteeringPiMessage(message: AgentRunSteeringMessage)
62
61
  export declare function assemblePrompt(args: {
63
62
  activeMcpCatalogs: ActiveMcpCatalogSummary[];
64
63
  currentActor?: Actor;
65
- artifactState?: ThreadArtifactsState;
66
64
  availableSkills: SkillMetadata[];
67
65
  configurationValues: Record<string, unknown>;
68
66
  contextContentParts: UserContentPart[];
@@ -8,7 +8,7 @@
8
8
  * boundaries.
9
9
  */
10
10
  import type { Destination, ReplyAttribution, Source, SystemActor } from "@sentry/junior-plugin-api";
11
- import type { ChannelConfigurationService } from "@/chat/configuration/types";
11
+ import type { LocationConfigurationService } from "@/chat/configuration/types";
12
12
  import type { ConversationPrivacy } from "@/chat/conversation-privacy";
13
13
  import type { CredentialContext } from "@/chat/credentials/context";
14
14
  import type { PiMessage } from "@/chat/pi/messages";
@@ -19,7 +19,6 @@ import type { SandboxEgressSignalTransport } from "@/chat/sandbox/egress/signals
19
19
  import type { OAuthAuthorization } from "@/chat/oauth-authorization";
20
20
  import type { AssistantStatusSpec } from "@/chat/slack/assistant-thread/status";
21
21
  import type { SlackConversationContext } from "@/chat/slack/conversation-context";
22
- import type { ThreadArtifactsState } from "@/chat/state/artifacts";
23
22
  import type { ConversationPendingAuthState } from "@/chat/state/conversation";
24
23
  import type { ConversationMessageProvenance } from "@/chat/conversations/provenance";
25
24
  import type { AgentTurnSurface } from "@/chat/task-execution/checkpoint";
@@ -97,6 +96,8 @@ export interface AgentRunRouting {
97
96
  */
98
97
  slackActionToken?: SlackActionToken;
99
98
  destination: Destination;
99
+ /** When true, also publish assistant output to the conversation destination. */
100
+ publishExternally?: boolean;
100
101
  /** Confirmed visibility of the destination where this run is delivered. */
101
102
  destinationVisibility?: ConversationPrivacy;
102
103
  surface?: AgentTurnSurface;
@@ -133,7 +134,7 @@ export interface AgentRunPolicy {
133
134
  /** Explicit per-agent reasoning level. When set, adaptive routing is disabled. */
134
135
  reasoningLevel?: TurnReasoningLevel;
135
136
  configuration?: Record<string, unknown>;
136
- channelConfiguration?: ChannelConfigurationService;
137
+ locationConfiguration?: LocationConfigurationService;
137
138
  skillDirs?: string[];
138
139
  /** Per-slice override for app-owned sandbox egress trace propagation. */
139
140
  sandboxTracePropagation?: SandboxEgressTracePropagationConfig;
@@ -148,7 +149,6 @@ export interface AgentRunPolicy {
148
149
  }
149
150
  /** Carries durable state snapshots already loaded by the caller. */
150
151
  export interface AgentRunState {
151
- artifactState?: ThreadArtifactsState;
152
152
  pendingAuth?: ConversationPendingAuthState;
153
153
  /** Persisted sandbox reuse state from prior slices of this conversation. */
154
154
  sandboxRef?: SandboxRef;
@@ -187,7 +187,6 @@ export interface AgentRunDurability {
187
187
  drainSteeringMessages?: (accept: (messages: AgentRunSteeringMessage[]) => Promise<void>) => Promise<AgentRunSteeringMessage[]>;
188
188
  recordPendingAuth?: (pendingAuth: ConversationPendingAuthState | undefined) => void | Promise<void>;
189
189
  onSandboxRefChanged?: (sandboxRef: SandboxRef) => void | Promise<void>;
190
- onArtifactStateUpdated?: (artifactState: ThreadArtifactsState) => void | Promise<void>;
191
190
  }
192
191
  /** Groups the per-slice run request by the runtime role each field serves. */
193
192
  export interface AgentRunRequest {
@@ -22,6 +22,7 @@ interface ResumeStateArgs {
22
22
  dispatchId?: string;
23
23
  durability: AgentRunDurability;
24
24
  recordActiveMcpProviders: () => Promise<void>;
25
+ publishExternally: boolean;
25
26
  actor?: Actor;
26
27
  runSource: Source;
27
28
  conversationId: string;
@@ -8,7 +8,7 @@
8
8
  import type { FileUpload } from "chat";
9
9
  import type { PluginSandbox } from "@sentry/junior-plugin-api";
10
10
  import { type Actor } from "@/chat/actor";
11
- import type { ChannelConfigurationService } from "@/chat/configuration/types";
11
+ import type { LocationConfigurationService } from "@/chat/configuration/types";
12
12
  import type { CredentialContext } from "@/chat/credentials/context";
13
13
  import type { LogContext } from "@/chat/logging";
14
14
  import type { SandboxEgressTracePropagationConfig } from "@/chat/sandbox/egress/tracing";
@@ -27,7 +27,7 @@ export interface AgentSandboxOptions {
27
27
  egressSignals?: SandboxEgressSignalTransport;
28
28
  credentialEgress?: CredentialContext;
29
29
  actor?: Actor;
30
- channelConfiguration?: ChannelConfigurationService;
30
+ locationConfiguration?: LocationConfigurationService;
31
31
  configurationValues: Record<string, unknown>;
32
32
  getActiveSkill(): Skill | null;
33
33
  prepareSandbox(workspace: SandboxWorkspace): void | Promise<void>;
@@ -23,7 +23,6 @@ import type { LogContext } from "@/chat/logging";
23
23
  import type { ConversationPrivacy } from "@/chat/conversation-privacy";
24
24
  import type { OAuthAuthorization } from "@/chat/oauth-authorization";
25
25
  import type { Actor } from "@/chat/actor";
26
- import type { ThreadArtifactsState } from "@/chat/state/artifacts";
27
26
  import type { AuthorizationPauseError } from "@/chat/services/auth-pause";
28
27
  import type { AgentTurnSurface } from "@/chat/task-execution/checkpoint";
29
28
  import { type AgentRunDurability, type AgentRunObservers, type AgentRunPolicy, type AgentRunRouting, type AgentRunState } from "@/chat/agent/request";
@@ -40,7 +39,6 @@ interface ToolWiringArgs {
40
39
  currentTurnMessages: readonly PiMessage[];
41
40
  /** Live same-actor instructions that authorize the pending action. */
42
41
  currentUserIntent: () => string;
43
- artifactStatePatch: Partial<ThreadArtifactsState>;
44
42
  availableSkills: SkillMetadata[];
45
43
  configurationValues: Record<string, unknown>;
46
44
  connectedMcpProviders: Set<string>;
@@ -21,7 +21,7 @@ export declare function dispatchEventTask(args: {
21
21
  };
22
22
  }): Promise<{
23
23
  id: string;
24
- status: "already_exists" | "created";
24
+ status: "created" | "already_exists";
25
25
  }>;
26
26
  /** Create and enqueue one core-owned scheduled task dispatch. */
27
27
  export declare function dispatchScheduledTask(args: {
@@ -37,7 +37,7 @@ export declare function dispatchScheduledTask(args: {
37
37
  };
38
38
  }): Promise<{
39
39
  id: string;
40
- status: "already_exists" | "created";
40
+ status: "created" | "already_exists";
41
41
  }>;
42
42
  /** Read the bounded outcome for one core-owned scheduled task dispatch. */
43
43
  export declare function getScheduledTaskDispatch(id: string): Promise<import("./types").DispatchProjection | undefined>;
@@ -2,7 +2,7 @@ import type { DispatchOptions, DestinationVisibility, ReplyAttribution, Source,
2
2
  import type { CredentialContext, CredentialSubject, CredentialSystemActor } from "@/chat/credentials/context";
3
3
  import type { AgentRunRouting } from "@/chat/agent/request";
4
4
  import type { AgentTurnSurface } from "@/chat/task-execution/checkpoint";
5
- import type { ChannelConfigurationService } from "@/chat/configuration/types";
5
+ import type { LocationConfigurationService } from "@/chat/configuration/types";
6
6
  export type DispatchStatus = "pending" | "running" | "awaiting_resume" | "completed" | "failed" | "blocked";
7
7
  export type SlackDispatchOptions = Omit<DispatchOptions, "destination"> & {
8
8
  destination: SlackDestination;
@@ -48,7 +48,7 @@ export interface DispatchTurnResult {
48
48
  /** Dispatch-owned authority supplied to the shared turn runtime. */
49
49
  export interface DispatchTurnContext {
50
50
  disabledFeatures: readonly ["interactive-auth"];
51
- channelConfiguration: ChannelConfigurationService;
51
+ locationConfiguration: LocationConfigurationService;
52
52
  credentialContext: CredentialContext;
53
53
  destinationVisibility: DestinationVisibility;
54
54
  dispatch: NonNullable<AgentRunRouting["dispatch"]>;
@@ -20,6 +20,12 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
20
20
  fullName: z.ZodOptional<z.ZodString>;
21
21
  userId: z.ZodString;
22
22
  userName: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strict>, z.ZodObject<{
24
+ platform: z.ZodLiteral<"web">;
25
+ email: z.ZodOptional<z.ZodString>;
26
+ fullName: z.ZodOptional<z.ZodString>;
27
+ userId: z.ZodString;
28
+ userName: z.ZodOptional<z.ZodString>;
23
29
  }, z.core.$strict>, z.ZodObject<{
24
30
  platform: z.ZodLiteral<"system">;
25
31
  name: z.ZodString;
@@ -111,6 +117,13 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
111
117
  platform: z.ZodLiteral<"local">;
112
118
  visibility: z.ZodLiteral<"private">;
113
119
  conversationId: z.ZodString;
120
+ }, z.core.$strict>, z.ZodObject<{
121
+ platform: z.ZodLiteral<"web">;
122
+ visibility: z.ZodEnum<{
123
+ public: "public";
124
+ private: "private";
125
+ }>;
126
+ conversationId: z.ZodString;
114
127
  }, z.core.$strict>], "platform">;
115
128
  updatedAtMs: z.ZodNumber;
116
129
  status: z.ZodEnum<{
@@ -132,6 +145,12 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
132
145
  fullName: z.ZodOptional<z.ZodString>;
133
146
  userId: z.ZodString;
134
147
  userName: z.ZodOptional<z.ZodString>;
148
+ }, z.core.$strict>, z.ZodObject<{
149
+ platform: z.ZodLiteral<"web">;
150
+ email: z.ZodOptional<z.ZodString>;
151
+ fullName: z.ZodOptional<z.ZodString>;
152
+ userId: z.ZodString;
153
+ userName: z.ZodOptional<z.ZodString>;
135
154
  }, z.core.$strict>, z.ZodObject<{
136
155
  platform: z.ZodLiteral<"system">;
137
156
  name: z.ZodString;
@@ -223,6 +242,13 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
223
242
  platform: z.ZodLiteral<"local">;
224
243
  visibility: z.ZodLiteral<"private">;
225
244
  conversationId: z.ZodString;
245
+ }, z.core.$strict>, z.ZodObject<{
246
+ platform: z.ZodLiteral<"web">;
247
+ visibility: z.ZodEnum<{
248
+ public: "public";
249
+ private: "private";
250
+ }>;
251
+ conversationId: z.ZodString;
226
252
  }, z.core.$strict>], "platform">;
227
253
  updatedAtMs: z.ZodNumber;
228
254
  result: z.ZodString;
@@ -242,6 +268,12 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
242
268
  fullName: z.ZodOptional<z.ZodString>;
243
269
  userId: z.ZodString;
244
270
  userName: z.ZodOptional<z.ZodString>;
271
+ }, z.core.$strict>, z.ZodObject<{
272
+ platform: z.ZodLiteral<"web">;
273
+ email: z.ZodOptional<z.ZodString>;
274
+ fullName: z.ZodOptional<z.ZodString>;
275
+ userId: z.ZodString;
276
+ userName: z.ZodOptional<z.ZodString>;
245
277
  }, z.core.$strict>, z.ZodObject<{
246
278
  platform: z.ZodLiteral<"system">;
247
279
  name: z.ZodString;
@@ -333,6 +365,13 @@ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject
333
365
  platform: z.ZodLiteral<"local">;
334
366
  visibility: z.ZodLiteral<"private">;
335
367
  conversationId: z.ZodString;
368
+ }, z.core.$strict>, z.ZodObject<{
369
+ platform: z.ZodLiteral<"web">;
370
+ visibility: z.ZodEnum<{
371
+ public: "public";
372
+ private: "private";
373
+ }>;
374
+ conversationId: z.ZodString;
336
375
  }, z.core.$strict>], "platform">;
337
376
  updatedAtMs: z.ZodNumber;
338
377
  errorMessage: z.ZodString;
@@ -356,6 +395,12 @@ export declare const createAgentInvocationSchema: z.ZodObject<{
356
395
  fullName: z.ZodOptional<z.ZodString>;
357
396
  userId: z.ZodString;
358
397
  userName: z.ZodOptional<z.ZodString>;
398
+ }, z.core.$strict>, z.ZodObject<{
399
+ platform: z.ZodLiteral<"web">;
400
+ email: z.ZodOptional<z.ZodString>;
401
+ fullName: z.ZodOptional<z.ZodString>;
402
+ userId: z.ZodString;
403
+ userName: z.ZodOptional<z.ZodString>;
359
404
  }, z.core.$strict>, z.ZodObject<{
360
405
  platform: z.ZodLiteral<"system">;
361
406
  name: z.ZodString;
@@ -441,6 +486,13 @@ export declare const createAgentInvocationSchema: z.ZodObject<{
441
486
  platform: z.ZodLiteral<"local">;
442
487
  visibility: z.ZodLiteral<"private">;
443
488
  conversationId: z.ZodString;
489
+ }, z.core.$strict>, z.ZodObject<{
490
+ platform: z.ZodLiteral<"web">;
491
+ visibility: z.ZodEnum<{
492
+ public: "public";
493
+ private: "private";
494
+ }>;
495
+ conversationId: z.ZodString;
444
496
  }, z.core.$strict>], "platform">;
445
497
  }, z.core.$strict>;
446
498
  export type AgentBinding = z.output<typeof agentBindingSchema>;
@@ -0,0 +1,103 @@
1
+ import { z } from "zod";
2
+ import type { StateAdapter } from "chat";
3
+ import { type Destination } from "@sentry/junior-plugin-api";
4
+ import type { WebActor } from "@/chat/actor";
5
+ import type { ConversationStore } from "@/chat/conversations/store";
6
+ import { type ConversationTurnLifecycle } from "@/chat/conversations/turn-lifecycle";
7
+ import type { AgentRunner } from "@/chat/runtime/agent-runner";
8
+ import { type InboundMessage } from "@/chat/task-execution/store";
9
+ import type { ConversationWorkQueue } from "@/chat/task-execution/queue";
10
+ import type { ConversationWorkerContext, ConversationWorkerResult } from "@/chat/task-execution/worker";
11
+ declare const apiTurnMailboxMetadataSchema: z.ZodObject<{
12
+ authorEmail: z.ZodString;
13
+ authorFullName: z.ZodOptional<z.ZodString>;
14
+ authorUserId: z.ZodString;
15
+ authorUserName: z.ZodOptional<z.ZodString>;
16
+ kind: z.ZodLiteral<"api_turn">;
17
+ messageId: z.ZodString;
18
+ }, z.core.$strict>;
19
+ type ApiTurnMailboxMetadata = z.output<typeof apiTurnMailboxMetadataSchema>;
20
+ type EnqueueOptions = {
21
+ conversationStore?: ConversationStore;
22
+ nowMs?: number;
23
+ queue: ConversationWorkQueue;
24
+ state?: StateAdapter;
25
+ };
26
+ export interface CreateApiConversationInput {
27
+ actor: WebActor;
28
+ message: string;
29
+ /** Client-supplied idempotency key for the first message. */
30
+ idempotencyKey: string;
31
+ }
32
+ export interface AppendApiConversationMessageInput {
33
+ actor: WebActor;
34
+ conversationId: string;
35
+ message: string;
36
+ idempotencyKey: string;
37
+ }
38
+ export interface ApiConversationMessageAccepted {
39
+ conversationId: string;
40
+ messageId: string;
41
+ status: "accepted" | "duplicate";
42
+ }
43
+ /**
44
+ * Build a durable API conversation id for one viewer + create key.
45
+ *
46
+ * Retries of POST /api/conversations with the same key must address the same
47
+ * conversation before the mailbox message id is derived.
48
+ */
49
+ export declare function createApiConversationId(args: {
50
+ actorEmail: string;
51
+ idempotencyKey: string;
52
+ }): string;
53
+ /** Stable turn id for one API mailbox message (matches getTurnUserMessage). */
54
+ export declare function apiTurnIdForMessage(messageId: string): string;
55
+ /** Rebuild the dashboard actor from durable conversation identity. */
56
+ export declare function webActorFromEmail(email: string, profile?: {
57
+ fullName?: string;
58
+ userName?: string;
59
+ }): WebActor;
60
+ /** Build one API mailbox entry with conversation-only publish. */
61
+ export declare function buildApiTurnInboundMessage(args: {
62
+ actor: WebActor;
63
+ conversationId: string;
64
+ createdAtMs?: number;
65
+ /** Existing conversation destination; required when continuing a provider root. */
66
+ destination?: Destination;
67
+ message: string;
68
+ messageId: string;
69
+ nowMs?: number;
70
+ }): InboundMessage;
71
+ /** Create a public root conversation and enqueue its first message. */
72
+ export declare function createAndEnqueueApiConversation(input: CreateApiConversationInput, options: EnqueueOptions): Promise<ApiConversationMessageAccepted>;
73
+ /** Append one API message to an existing conversation and wake the worker. */
74
+ export declare function appendAndEnqueueApiConversationMessage(input: AppendApiConversationMessageInput, options: EnqueueOptions): Promise<ApiConversationMessageAccepted>;
75
+ /**
76
+ * Resolve API turn work from mailbox metadata or an active API turn checkpoint.
77
+ *
78
+ * Empty resume wakes after yield carry no mailbox rows; match agent-invocation
79
+ * and look up durable active turn state instead of falling through to Slack.
80
+ */
81
+ export declare function resolveApiTurnWork(context: ConversationWorkerContext): Promise<{
82
+ kind: "mailbox";
83
+ batch: Array<{
84
+ message: InboundMessage;
85
+ metadata: ApiTurnMailboxMetadata;
86
+ }>;
87
+ } | {
88
+ kind: "resume";
89
+ turnId: string;
90
+ } | undefined>;
91
+ /** True when this leased attempt is API-authored root work. */
92
+ export declare function isApiTurnWork(context: ConversationWorkerContext): Promise<boolean>;
93
+ /** Build the mailbox consumer for API-authored root turns. */
94
+ export declare function createApiTurnWorker(options: {
95
+ agentRunner: AgentRunner;
96
+ turnLifecycle?: ConversationTurnLifecycle;
97
+ }): (context: ConversationWorkerContext) => Promise<ConversationWorkerResult>;
98
+ /** Route API turn work before falling through to other consumers. */
99
+ export declare function routeApiTurnWork(options: {
100
+ apiTurnWorker: (context: ConversationWorkerContext) => Promise<ConversationWorkerResult>;
101
+ fallbackWorker: (context: ConversationWorkerContext) => Promise<ConversationWorkerResult>;
102
+ }): (context: ConversationWorkerContext) => Promise<ConversationWorkerResult>;
103
+ export {};
@@ -1,8 +1,8 @@
1
- import type { ChannelConfigurationService } from "@/chat/configuration/types";
1
+ import type { LocationConfigurationService } from "@/chat/configuration/types";
2
2
  import type { Skill } from "@/chat/skills";
3
3
  type JrRpcDeps = {
4
4
  activeSkill: Skill | null;
5
- channelConfiguration?: ChannelConfigurationService;
5
+ locationConfiguration?: LocationConfigurationService;
6
6
  actorId?: string;
7
7
  onConfigurationValueChanged?: (key: string, value: unknown | undefined) => void;
8
8
  };
@@ -1,2 +1,5 @@
1
- import type { ChannelConfigurationService, ChannelConfigurationStorage } from "@/chat/configuration/types";
2
- export declare function createChannelConfigurationService(storage: ChannelConfigurationStorage): ChannelConfigurationService;
1
+ import type { ConfigEntry, LocationConfigurationService, LocationConfigurationStorage } from "@/chat/configuration/types";
2
+ /** Coerce legacy persisted configuration into current Location entries. */
3
+ export declare function coerceLegacyLocationConfig(raw: unknown): ConfigEntry[];
4
+ /** Create a Location configuration service over entry-level storage. */
5
+ export declare function createLocationConfigurationService(storage: LocationConfigurationStorage): LocationConfigurationService;
@@ -0,0 +1,9 @@
1
+ import type { SlackDestination } from "@sentry/junior-plugin-api";
2
+ import type { JuniorDatabase } from "@/db/db";
3
+ import type { LocationConfigurationService } from "@/chat/configuration/types";
4
+ /** Resolve SQL-owned Location configuration and copy live legacy entries once. */
5
+ export declare function createDurableLocationConfigurationService(args: {
6
+ destination: SlackDestination;
7
+ db: JuniorDatabase;
8
+ loadLegacy: () => Promise<unknown>;
9
+ }): LocationConfigurationService;
@@ -1,22 +1,26 @@
1
- export type ConfigScope = "conversation";
1
+ import { z } from "zod";
2
+ /** JSON value accepted by Location configuration. */
3
+ export declare const configValueSchema: z.ZodJSONSchema;
4
+ export type ConfigValue = z.output<typeof configValueSchema>;
5
+ /** One user-authored configuration value scoped to a Location. */
2
6
  export interface ConfigEntry {
3
7
  key: string;
4
- value: unknown;
5
- scope: ConfigScope;
8
+ value: ConfigValue;
9
+ scope: "location";
6
10
  updatedAt: string;
7
11
  updatedBy?: string;
8
12
  source?: string;
9
13
  expiresAt?: string;
10
14
  }
11
- export interface ChannelConfigState {
12
- schemaVersion: 1;
13
- entries: Record<string, ConfigEntry>;
14
- }
15
- export interface ChannelConfigurationStorage {
16
- load: () => Promise<unknown | null>;
17
- save: (state: ChannelConfigState) => Promise<void>;
15
+ /** Entry-level persistence used by Location configuration. */
16
+ export interface LocationConfigurationStorage {
17
+ get: (key: string) => Promise<ConfigEntry | undefined>;
18
+ list: () => Promise<ConfigEntry[]>;
19
+ set: (entry: ConfigEntry) => Promise<void>;
20
+ unset: (key: string) => Promise<boolean>;
18
21
  }
19
- export interface ChannelConfigurationService {
22
+ /** Read and update user-authored configuration for one Location. */
23
+ export interface LocationConfigurationService {
20
24
  get: (key: string) => Promise<ConfigEntry | undefined>;
21
25
  set: (input: {
22
26
  key: string;
@@ -29,9 +33,9 @@ export interface ChannelConfigurationService {
29
33
  list: (options?: {
30
34
  prefix?: string;
31
35
  }) => Promise<ConfigEntry[]>;
32
- resolve: (key: string) => Promise<unknown | undefined>;
36
+ resolve: (key: string) => Promise<ConfigValue | undefined>;
33
37
  resolveValues: (options?: {
34
38
  keys?: string[];
35
39
  prefix?: string;
36
- }) => Promise<Record<string, unknown>>;
40
+ }) => Promise<Record<string, ConfigValue>>;
37
41
  }
@@ -31,6 +31,12 @@ export declare const agentHistoryItemSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
31
31
  fullName: z.ZodOptional<z.ZodString>;
32
32
  userId: z.ZodString;
33
33
  userName: z.ZodOptional<z.ZodString>;
34
+ }, z.core.$strict>, z.ZodObject<{
35
+ platform: z.ZodLiteral<"web">;
36
+ email: z.ZodOptional<z.ZodString>;
37
+ fullName: z.ZodOptional<z.ZodString>;
38
+ userId: z.ZodString;
39
+ userName: z.ZodOptional<z.ZodString>;
34
40
  }, z.core.$strict>, z.ZodObject<{
35
41
  platform: z.ZodLiteral<"system">;
36
42
  name: z.ZodString;
@@ -73,6 +79,12 @@ export declare const historyReplacementSchema: z.ZodObject<{
73
79
  fullName: z.ZodOptional<z.ZodString>;
74
80
  userId: z.ZodString;
75
81
  userName: z.ZodOptional<z.ZodString>;
82
+ }, z.core.$strict>, z.ZodObject<{
83
+ platform: z.ZodLiteral<"web">;
84
+ email: z.ZodOptional<z.ZodString>;
85
+ fullName: z.ZodOptional<z.ZodString>;
86
+ userId: z.ZodString;
87
+ userName: z.ZodOptional<z.ZodString>;
76
88
  }, z.core.$strict>, z.ZodObject<{
77
89
  platform: z.ZodLiteral<"system">;
78
90
  name: z.ZodString;
@@ -121,6 +133,12 @@ export declare const historyReplacementSchema: z.ZodObject<{
121
133
  fullName: z.ZodOptional<z.ZodString>;
122
134
  userId: z.ZodString;
123
135
  userName: z.ZodOptional<z.ZodString>;
136
+ }, z.core.$strict>, z.ZodObject<{
137
+ platform: z.ZodLiteral<"web">;
138
+ email: z.ZodOptional<z.ZodString>;
139
+ fullName: z.ZodOptional<z.ZodString>;
140
+ userId: z.ZodString;
141
+ userName: z.ZodOptional<z.ZodString>;
124
142
  }, z.core.$strict>, z.ZodObject<{
125
143
  platform: z.ZodLiteral<"system">;
126
144
  name: z.ZodString;
@@ -192,6 +210,12 @@ export declare const conversationEventDataSchema: z.ZodUnion<readonly [z.ZodUnio
192
210
  fullName: z.ZodOptional<z.ZodString>;
193
211
  userId: z.ZodString;
194
212
  userName: z.ZodOptional<z.ZodString>;
213
+ }, z.core.$strict>, z.ZodObject<{
214
+ platform: z.ZodLiteral<"web">;
215
+ email: z.ZodOptional<z.ZodString>;
216
+ fullName: z.ZodOptional<z.ZodString>;
217
+ userId: z.ZodString;
218
+ userName: z.ZodOptional<z.ZodString>;
195
219
  }, z.core.$strict>, z.ZodObject<{
196
220
  platform: z.ZodLiteral<"system">;
197
221
  name: z.ZodString;
@@ -287,6 +311,7 @@ export declare const conversationEventDataSchema: z.ZodUnion<readonly [z.ZodUnio
287
311
  turnId: z.ZodString;
288
312
  modelProfile: z.ZodString;
289
313
  modelId: z.ZodString;
314
+ costUsd: z.ZodOptional<z.ZodNumber>;
290
315
  reasoningLevel: z.ZodEnum<{
291
316
  low: "low";
292
317
  medium: "medium";
@@ -356,6 +381,12 @@ export declare const conversationEventDataSchema: z.ZodUnion<readonly [z.ZodUnio
356
381
  fullName: z.ZodOptional<z.ZodString>;
357
382
  userId: z.ZodString;
358
383
  userName: z.ZodOptional<z.ZodString>;
384
+ }, z.core.$strict>, z.ZodObject<{
385
+ platform: z.ZodLiteral<"web">;
386
+ email: z.ZodOptional<z.ZodString>;
387
+ fullName: z.ZodOptional<z.ZodString>;
388
+ userId: z.ZodString;
389
+ userName: z.ZodOptional<z.ZodString>;
359
390
  }, z.core.$strict>, z.ZodObject<{
360
391
  platform: z.ZodLiteral<"system">;
361
392
  name: z.ZodString;
@@ -404,6 +435,12 @@ export declare const conversationEventDataSchema: z.ZodUnion<readonly [z.ZodUnio
404
435
  fullName: z.ZodOptional<z.ZodString>;
405
436
  userId: z.ZodString;
406
437
  userName: z.ZodOptional<z.ZodString>;
438
+ }, z.core.$strict>, z.ZodObject<{
439
+ platform: z.ZodLiteral<"web">;
440
+ email: z.ZodOptional<z.ZodString>;
441
+ fullName: z.ZodOptional<z.ZodString>;
442
+ userId: z.ZodString;
443
+ userName: z.ZodOptional<z.ZodString>;
407
444
  }, z.core.$strict>, z.ZodObject<{
408
445
  platform: z.ZodLiteral<"system">;
409
446
  name: z.ZodString;
@@ -474,6 +511,12 @@ export declare const conversationEventSchema: z.ZodUnion<readonly [z.ZodObject<{
474
511
  fullName: z.ZodOptional<z.ZodString>;
475
512
  userId: z.ZodString;
476
513
  userName: z.ZodOptional<z.ZodString>;
514
+ }, z.core.$strict>, z.ZodObject<{
515
+ platform: z.ZodLiteral<"web">;
516
+ email: z.ZodOptional<z.ZodString>;
517
+ fullName: z.ZodOptional<z.ZodString>;
518
+ userId: z.ZodString;
519
+ userName: z.ZodOptional<z.ZodString>;
477
520
  }, z.core.$strict>, z.ZodObject<{
478
521
  platform: z.ZodLiteral<"system">;
479
522
  name: z.ZodString;
@@ -569,6 +612,7 @@ export declare const conversationEventSchema: z.ZodUnion<readonly [z.ZodObject<{
569
612
  turnId: z.ZodString;
570
613
  modelProfile: z.ZodString;
571
614
  modelId: z.ZodString;
615
+ costUsd: z.ZodOptional<z.ZodNumber>;
572
616
  reasoningLevel: z.ZodEnum<{
573
617
  low: "low";
574
618
  medium: "medium";
@@ -638,6 +682,12 @@ export declare const conversationEventSchema: z.ZodUnion<readonly [z.ZodObject<{
638
682
  fullName: z.ZodOptional<z.ZodString>;
639
683
  userId: z.ZodString;
640
684
  userName: z.ZodOptional<z.ZodString>;
685
+ }, z.core.$strict>, z.ZodObject<{
686
+ platform: z.ZodLiteral<"web">;
687
+ email: z.ZodOptional<z.ZodString>;
688
+ fullName: z.ZodOptional<z.ZodString>;
689
+ userId: z.ZodString;
690
+ userName: z.ZodOptional<z.ZodString>;
641
691
  }, z.core.$strict>, z.ZodObject<{
642
692
  platform: z.ZodLiteral<"system">;
643
693
  name: z.ZodString;
@@ -686,6 +736,12 @@ export declare const conversationEventSchema: z.ZodUnion<readonly [z.ZodObject<{
686
736
  fullName: z.ZodOptional<z.ZodString>;
687
737
  userId: z.ZodString;
688
738
  userName: z.ZodOptional<z.ZodString>;
739
+ }, z.core.$strict>, z.ZodObject<{
740
+ platform: z.ZodLiteral<"web">;
741
+ email: z.ZodOptional<z.ZodString>;
742
+ fullName: z.ZodOptional<z.ZodString>;
743
+ userId: z.ZodString;
744
+ userName: z.ZodOptional<z.ZodString>;
689
745
  }, z.core.$strict>, z.ZodObject<{
690
746
  platform: z.ZodLiteral<"system">;
691
747
  name: z.ZodString;
@@ -779,6 +835,12 @@ export declare const newConversationEventSchema: z.ZodObject<{
779
835
  fullName: z.ZodOptional<z.ZodString>;
780
836
  userId: z.ZodString;
781
837
  userName: z.ZodOptional<z.ZodString>;
838
+ }, z.core.$strict>, z.ZodObject<{
839
+ platform: z.ZodLiteral<"web">;
840
+ email: z.ZodOptional<z.ZodString>;
841
+ fullName: z.ZodOptional<z.ZodString>;
842
+ userId: z.ZodString;
843
+ userName: z.ZodOptional<z.ZodString>;
782
844
  }, z.core.$strict>, z.ZodObject<{
783
845
  platform: z.ZodLiteral<"system">;
784
846
  name: z.ZodString;
@@ -874,6 +936,7 @@ export declare const newConversationEventSchema: z.ZodObject<{
874
936
  turnId: z.ZodString;
875
937
  modelProfile: z.ZodString;
876
938
  modelId: z.ZodString;
939
+ costUsd: z.ZodOptional<z.ZodNumber>;
877
940
  reasoningLevel: z.ZodEnum<{
878
941
  low: "low";
879
942
  medium: "medium";
@@ -132,6 +132,15 @@ type AgentsInstructionsTransitionArgs = {
132
132
  };
133
133
  /** Record one AGENTS.md bootstrap transition as host transcript metadata. */
134
134
  export declare function recordAgentsInstructionsUpdated(args: AgentsInstructionsTransitionArgs): Promise<void>;
135
+ /** Record a model-backed subscribed reply route, including no-reply outcomes. */
136
+ export declare function recordSubscribedReplyRoute(args: {
137
+ conversationId: string;
138
+ costUsd: number;
139
+ reason: string;
140
+ runId: string;
141
+ shouldReply: boolean;
142
+ shouldUnsubscribe?: boolean;
143
+ }): Promise<void>;
135
144
  /** Load a previously selected execution profile for a resumed turn. */
136
145
  export declare function loadTurnRoute(args: {
137
146
  conversationId: string;
@@ -145,6 +154,7 @@ export declare function recordTurnRoute(args: {
145
154
  turnId: string;
146
155
  modelProfile: ModelProfile;
147
156
  modelId: string;
157
+ costUsd?: number;
148
158
  reasoningLevel: TurnReasoningLevel;
149
159
  confidence?: number;
150
160
  source: "configured" | "inherited" | "router";