@sentry/junior 0.145.0 → 0.147.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 (171) hide show
  1. package/dist/{agent-hooks-L7D2BDVV.js → agent-hooks-HS6VGUPM.js} +10 -10
  2. package/dist/api/conversations/detail.d.ts +1 -0
  3. package/dist/api/conversations/event-list.d.ts +1 -0
  4. package/dist/api/schema/conversation.d.ts +4 -0
  5. package/dist/api/schema.js +1 -1
  6. package/dist/api.js +26 -22
  7. package/dist/app.js +285 -290
  8. package/dist/{catalog-runtime-QLAC4Q3W.js → catalog-runtime-M6ZTPYRV.js} +5 -5
  9. package/dist/chat/agent/prompt.d.ts +0 -2
  10. package/dist/chat/agent/request.d.ts +2 -5
  11. package/dist/chat/agent/resume.d.ts +0 -3
  12. package/dist/chat/agent/sandbox.d.ts +2 -2
  13. package/dist/chat/agent/skills.d.ts +0 -1
  14. package/dist/chat/agent/tools.d.ts +0 -3
  15. package/dist/chat/agent-dispatch/types.d.ts +2 -2
  16. package/dist/chat/capabilities/jr-rpc-command.d.ts +2 -2
  17. package/dist/chat/configuration/service.d.ts +5 -2
  18. package/dist/chat/configuration/sql.d.ts +9 -0
  19. package/dist/chat/configuration/types.d.ts +17 -13
  20. package/dist/chat/conversations/history.d.ts +3 -0
  21. package/dist/chat/conversations/message-search.d.ts +32 -0
  22. package/dist/chat/conversations/projection.d.ts +10 -0
  23. package/dist/chat/conversations/sql/message-search.d.ts +4 -0
  24. package/dist/chat/conversations/tool-source.d.ts +5 -0
  25. package/dist/chat/credentials/unlink-provider.d.ts +2 -1
  26. package/dist/chat/credentials/user-token-store.d.ts +2 -0
  27. package/dist/chat/db.d.ts +2 -2
  28. package/dist/chat/event-tasks/tool-support.d.ts +2 -0
  29. package/dist/chat/identities/sql.d.ts +8 -0
  30. package/dist/chat/logging.d.ts +2 -0
  31. package/dist/chat/mcp/auth-store.d.ts +0 -2
  32. package/dist/chat/mcp/oauth.d.ts +0 -2
  33. package/dist/chat/oauth-flow.d.ts +3 -1
  34. package/dist/chat/pi/client.d.ts +2 -0
  35. package/dist/chat/plugins/credential-hooks.d.ts +2 -0
  36. package/dist/chat/prompt.d.ts +0 -2
  37. package/dist/chat/resource-events/notification.d.ts +2 -1
  38. package/dist/chat/runtime/delivered-turn-state.d.ts +1 -4
  39. package/dist/chat/runtime/thread-state.d.ts +8 -11
  40. package/dist/chat/runtime/turn-input.d.ts +4 -2
  41. package/dist/chat/runtime/turn-preparation.d.ts +2 -4
  42. package/dist/chat/sandbox/command-result.d.ts +2 -0
  43. package/dist/chat/sandbox/egress/schemas.d.ts +6 -0
  44. package/dist/chat/scheduled-tasks/tool-support.d.ts +2 -0
  45. package/dist/chat/scheduled-tasks/tools/create.d.ts +2 -0
  46. package/dist/chat/scheduled-tasks/tools/delete.d.ts +2 -0
  47. package/dist/chat/scheduled-tasks/tools/list.d.ts +2 -0
  48. package/dist/chat/scheduled-tasks/tools/run-now.d.ts +2 -0
  49. package/dist/chat/scheduled-tasks/tools/update.d.ts +2 -0
  50. package/dist/chat/services/mcp-auth-orchestration.d.ts +0 -3
  51. package/dist/chat/services/plugin-auth-orchestration.d.ts +2 -1
  52. package/dist/chat/services/provider-default-config.d.ts +2 -2
  53. package/dist/chat/services/subscribed-decision.d.ts +3 -0
  54. package/dist/chat/services/subscribed-reply-policy.d.ts +1 -0
  55. package/dist/chat/services/turn-result.d.ts +0 -3
  56. package/dist/chat/services/turn-router.d.ts +3 -0
  57. package/dist/chat/slack/assistant-thread/lifecycle.d.ts +0 -1
  58. package/dist/chat/slack/assistant-thread/title.d.ts +0 -3
  59. package/dist/chat/slack/dispatch-turn.d.ts +1 -1
  60. package/dist/chat/slack/message/attachments.d.ts +2 -0
  61. package/dist/chat/slack/message/blocks.d.ts +2 -0
  62. package/dist/chat/slack/message/content.d.ts +18 -0
  63. package/dist/chat/slack/message/identity.d.ts +7 -0
  64. package/dist/chat/slack/tools/canvas/context.d.ts +0 -10
  65. package/dist/chat/slack/tools/canvas/create.d.ts +2 -0
  66. package/dist/chat/slack/tools/canvas/edit.d.ts +2 -0
  67. package/dist/chat/slack/tools/canvas/read.d.ts +2 -0
  68. package/dist/chat/slack/tools/canvas/write.d.ts +2 -0
  69. package/dist/chat/slack/tools/channel-list-messages.d.ts +2 -0
  70. package/dist/chat/slack/tools/{conversation-search.d.ts → conversation-message-search.d.ts} +23 -14
  71. package/dist/chat/slack/tools/list/add-items.d.ts +4 -1
  72. package/dist/chat/slack/tools/list/api.d.ts +8 -1
  73. package/dist/chat/slack/tools/list/create.d.ts +2 -0
  74. package/dist/chat/slack/tools/list/get-items.d.ts +5 -3
  75. package/dist/chat/slack/tools/list/update-item.d.ts +5 -1
  76. package/dist/chat/slack/tools/message-add-reaction.d.ts +2 -0
  77. package/dist/chat/slack/tools/public-search.d.ts +2 -0
  78. package/dist/chat/slack/tools/send-files.d.ts +2 -0
  79. package/dist/chat/slack/tools/thread-read.d.ts +2 -0
  80. package/dist/chat/slack/vision-cache.d.ts +5 -0
  81. package/dist/chat/state/conversation.d.ts +4 -5
  82. package/dist/chat/task-execution/checkpoint.d.ts +1 -3
  83. package/dist/chat/task-execution/turn-cursor.d.ts +0 -9
  84. package/dist/chat/tool-support/structured-result.d.ts +1 -0
  85. package/dist/chat/tool-support/timed-out-tool-result.d.ts +11 -0
  86. package/dist/chat/tools/create-event-task.d.ts +2 -0
  87. package/dist/chat/tools/delete-event-task.d.ts +2 -0
  88. package/dist/chat/tools/handoff/tool.d.ts +2 -0
  89. package/dist/chat/tools/list-event-tasks.d.ts +2 -0
  90. package/dist/chat/tools/list-resource-event-subscriptions.d.ts +2 -0
  91. package/dist/chat/tools/runtime/report-progress.d.ts +2 -0
  92. package/dist/chat/tools/runtime/spawn-agent.d.ts +2 -0
  93. package/dist/chat/tools/{query-conversation-events.d.ts → search-conversation-events.d.ts} +5 -3
  94. package/dist/chat/tools/search-resource-event-types.d.ts +2 -0
  95. package/dist/chat/tools/search-tools.d.ts +2 -0
  96. package/dist/chat/tools/skill/load-skill.d.ts +2 -0
  97. package/dist/chat/tools/skill/search-mcp-tools.d.ts +2 -0
  98. package/dist/chat/tools/stop-watching-resources.d.ts +2 -0
  99. package/dist/chat/tools/system-time.d.ts +2 -0
  100. package/dist/chat/tools/types.d.ts +0 -6
  101. package/dist/chat/tools/update-event-task.d.ts +2 -0
  102. package/dist/chat/tools/user-lookup.d.ts +29 -0
  103. package/dist/chat/tools/watch-resource-events.d.ts +2 -0
  104. package/dist/chat/tools/web/fetch-tool.d.ts +2 -0
  105. package/dist/chat/tools/web/image-generate.d.ts +2 -0
  106. package/dist/chat/tools/web/search.d.ts +2 -0
  107. package/dist/{chunk-PJ4NMVQB.js → chunk-34GS7B6L.js} +2 -2
  108. package/dist/{chunk-2LWPFSB4.js → chunk-4LJO56OJ.js} +9 -1
  109. package/dist/{chunk-QJBDABQA.js → chunk-6H5SZR24.js} +16 -20
  110. package/dist/{chunk-LVVSIMBB.js → chunk-745QJ3ZA.js} +1 -1
  111. package/dist/{chunk-64SBYW2O.js → chunk-7A4M7PCV.js} +613 -561
  112. package/dist/{chunk-XFKIRN3Q.js → chunk-7NVJVJID.js} +4 -3
  113. package/dist/{chunk-FUBRJA5F.js → chunk-7UQIVT6G.js} +13 -6
  114. package/dist/{chunk-ZIAMN2UW.js → chunk-AIOK6LAG.js} +40 -513
  115. package/dist/{chunk-EIX2LQ6L.js → chunk-AVOCH2Z5.js} +3 -3
  116. package/dist/{chunk-GUWLDMGF.js → chunk-AVZDSUFB.js} +4 -4
  117. package/dist/{chunk-2XET6PKP.js → chunk-AYU72WO7.js} +102 -73
  118. package/dist/chunk-AZ7EAOBE.js +566 -0
  119. package/dist/{chunk-DXEQAIUV.js → chunk-CSZINQJ2.js} +1 -1
  120. package/dist/{chunk-HLOUZC5C.js → chunk-CWP5RHVX.js} +4 -4
  121. package/dist/{chunk-DS3J6WGY.js → chunk-DLDRQHG5.js} +1 -1
  122. package/dist/{chunk-27TEJTZO.js → chunk-DU74WPIC.js} +55 -37
  123. package/dist/{chunk-YD54Q45G.js → chunk-EFLJ2WJH.js} +6 -4
  124. package/dist/{chunk-CD2XFGYQ.js → chunk-GGB4WL5A.js} +1 -1
  125. package/dist/{chunk-GDV5LXRA.js → chunk-IIOOO4FQ.js} +1 -1
  126. package/dist/{chunk-SIN3MXH6.js → chunk-JUUKWRBE.js} +1 -1
  127. package/dist/{chunk-VTDMB7XX.js → chunk-K4SZAP3K.js} +1 -1
  128. package/dist/{chunk-QUG4JSZK.js → chunk-ORO3PWKQ.js} +1 -1
  129. package/dist/{chunk-RUSS62EN.js → chunk-PVNG6UMU.js} +3 -3
  130. package/dist/{chunk-I47UGQPJ.js → chunk-Q4R73I43.js} +365 -206
  131. package/dist/{chunk-JTGS3ZZE.js → chunk-RXBVB2JM.js} +1 -1
  132. package/dist/{chunk-TZRXYWRE.js → chunk-SGZO7UWH.js} +2 -2
  133. package/dist/{chunk-JLMVCNXL.js → chunk-SVHUEHUL.js} +1 -0
  134. package/dist/{chunk-B46ZMVOV.js → chunk-X5UY34KT.js} +6 -5
  135. package/dist/{chunk-5PNPQYTO.js → chunk-YBVXBNSV.js} +2 -2
  136. package/dist/{chunk-HISR3DTV.js → chunk-YEO3VX72.js} +10 -25
  137. package/dist/{chunk-ZIMRGFYL.js → chunk-YHDERDRO.js} +7 -6
  138. package/dist/{chunk-WF5HVH3M.js → chunk-YNTTROJT.js} +1 -1
  139. package/dist/{chunk-2UH3JI64.js → chunk-YSB2N563.js} +87 -34
  140. package/dist/{chunk-ZYAJMESY.js → chunk-Z4YU7Z4L.js} +3 -2
  141. package/dist/cli/chat.js +32 -32
  142. package/dist/cli/check.js +6 -6
  143. package/dist/cli/plugins.js +13 -13
  144. package/dist/cli/snapshot-create.js +9 -9
  145. package/dist/cli/upgrade.js +7 -7
  146. package/dist/db/schema/location-configurations.d.ts +127 -0
  147. package/dist/db/schema.d.ts +128 -1
  148. package/dist/{db-62PW6LM3.js → db-CSEW4RII.js} +9 -9
  149. package/dist/instrumentation.js +4 -4
  150. package/dist/nitro.js +2 -2
  151. package/dist/{oauth-callback-server-6NZNHJAM.js → oauth-callback-server-FUEV5HNG.js} +24 -24
  152. package/dist/{runner-GCRPG3GQ.js → runner-U3XHSKSH.js} +21 -41
  153. package/dist/{skills-2S3MDFIQ.js → skills-AKE6W3WI.js} +6 -6
  154. package/dist/spawn-B6GDTWJ4.js +39 -0
  155. package/dist/{validation-HAOLCJ5A.js → validation-WDTAULUF.js} +6 -6
  156. package/dist/version.js +1 -1
  157. package/dist/{work-R4XYKMUW.js → work-C3HAO2BG.js} +17 -17
  158. package/dist/{worker-U2UCVR7M.js → worker-LNP4YKBM.js} +10 -10
  159. package/migrations/0024_misty_typhoid_mary.sql +12 -0
  160. package/migrations/meta/0024_snapshot.json +2275 -0
  161. package/migrations/meta/_journal.json +7 -0
  162. package/package.json +4 -4
  163. package/dist/chat/conversations/search.d.ts +0 -24
  164. package/dist/chat/conversations/sql/search.d.ts +0 -4
  165. package/dist/chat/slack/legacy-attachments.d.ts +0 -4
  166. package/dist/chat/slack/message.d.ts +0 -12
  167. package/dist/chat/slack/tools/user-lookup.d.ts +0 -26
  168. package/dist/chat/state/artifacts.d.ts +0 -30
  169. package/dist/chat/tool-support/turn-deadline-result.d.ts +0 -3
  170. package/dist/chunk-Q6QZTTLS.js +0 -55
  171. package/dist/spawn-7WK37BTD.js +0 -39
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-SIN3MXH6.js";
4
- import "./chunk-CD2XFGYQ.js";
3
+ } from "./chunk-JUUKWRBE.js";
4
+ import "./chunk-GGB4WL5A.js";
5
5
  import "./chunk-RUIXF3YQ.js";
6
6
  import "./chunk-HZF5P5UN.js";
7
7
  import "./chunk-F3B2YJ76.js";
8
- import "./chunk-2LWPFSB4.js";
8
+ import "./chunk-4LJO56OJ.js";
9
9
  import "./chunk-6GWA276C.js";
10
10
  import "./chunk-OOUNJNMR.js";
11
11
  import "./chunk-H4HBKISO.js";
12
- import "./chunk-DS3J6WGY.js";
13
- import "./chunk-GDV5LXRA.js";
12
+ import "./chunk-DLDRQHG5.js";
13
+ import "./chunk-IIOOO4FQ.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
  export {
16
16
  pluginCatalogRuntime
@@ -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";
@@ -133,7 +132,7 @@ export interface AgentRunPolicy {
133
132
  /** Explicit per-agent reasoning level. When set, adaptive routing is disabled. */
134
133
  reasoningLevel?: TurnReasoningLevel;
135
134
  configuration?: Record<string, unknown>;
136
- channelConfiguration?: ChannelConfigurationService;
135
+ locationConfiguration?: LocationConfigurationService;
137
136
  skillDirs?: string[];
138
137
  /** Per-slice override for app-owned sandbox egress trace propagation. */
139
138
  sandboxTracePropagation?: SandboxEgressTracePropagationConfig;
@@ -148,7 +147,6 @@ export interface AgentRunPolicy {
148
147
  }
149
148
  /** Carries durable state snapshots already loaded by the caller. */
150
149
  export interface AgentRunState {
151
- artifactState?: ThreadArtifactsState;
152
150
  pendingAuth?: ConversationPendingAuthState;
153
151
  /** Persisted sandbox reuse state from prior slices of this conversation. */
154
152
  sandboxRef?: SandboxRef;
@@ -187,7 +185,6 @@ export interface AgentRunDurability {
187
185
  drainSteeringMessages?: (accept: (messages: AgentRunSteeringMessage[]) => Promise<void>) => Promise<AgentRunSteeringMessage[]>;
188
186
  recordPendingAuth?: (pendingAuth: ConversationPendingAuthState | undefined) => void | Promise<void>;
189
187
  onSandboxRefChanged?: (sandboxRef: SandboxRef) => void | Promise<void>;
190
- onArtifactStateUpdated?: (artifactState: ThreadArtifactsState) => void | Promise<void>;
191
188
  }
192
189
  /** Groups the per-slice run request by the runtime role each field serves. */
193
190
  export interface AgentRunRequest {
@@ -21,9 +21,6 @@ interface ResumeStateArgs {
21
21
  destinationVisibility?: ConversationPrivacy;
22
22
  dispatchId?: string;
23
23
  durability: AgentRunDurability;
24
- getLoadedSkillNames: () => string[];
25
- getModelId: () => string;
26
- getReasoningLevel: () => string | undefined;
27
24
  recordActiveMcpProviders: () => Promise<void>;
28
25
  actor?: Actor;
29
26
  runSource: Source;
@@ -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>;
@@ -13,5 +13,4 @@ export declare function restoreSkillRuntime(args: {
13
13
  invokedSkill: SkillMetadata | null;
14
14
  priorPiMessages: PiMessage[] | undefined;
15
15
  skillSandbox: SkillSandbox;
16
- syncLoadedSkillNamesForResume: () => void;
17
16
  }): 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>;
@@ -66,7 +64,6 @@ interface ToolWiringArgs {
66
64
  state: AgentRunState;
67
65
  supportsImageInput: () => boolean;
68
66
  surface: AgentTurnSurface;
69
- syncLoadedSkillNamesForResume: () => void;
70
67
  toolCalls: string[];
71
68
  userInput: string;
72
69
  }
@@ -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"]>;
@@ -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
  }
@@ -287,6 +287,7 @@ export declare const conversationEventDataSchema: z.ZodUnion<readonly [z.ZodUnio
287
287
  turnId: z.ZodString;
288
288
  modelProfile: z.ZodString;
289
289
  modelId: z.ZodString;
290
+ costUsd: z.ZodOptional<z.ZodNumber>;
290
291
  reasoningLevel: z.ZodEnum<{
291
292
  low: "low";
292
293
  medium: "medium";
@@ -569,6 +570,7 @@ export declare const conversationEventSchema: z.ZodUnion<readonly [z.ZodObject<{
569
570
  turnId: z.ZodString;
570
571
  modelProfile: z.ZodString;
571
572
  modelId: z.ZodString;
573
+ costUsd: z.ZodOptional<z.ZodNumber>;
572
574
  reasoningLevel: z.ZodEnum<{
573
575
  low: "low";
574
576
  medium: "medium";
@@ -874,6 +876,7 @@ export declare const newConversationEventSchema: z.ZodObject<{
874
876
  turnId: z.ZodString;
875
877
  modelProfile: z.ZodString;
876
878
  modelId: z.ZodString;
879
+ costUsd: z.ZodOptional<z.ZodNumber>;
877
880
  reasoningLevel: z.ZodEnum<{
878
881
  low: "low";
879
882
  medium: "medium";
@@ -0,0 +1,32 @@
1
+ /** One relevant chat-message match from a prior conversation. */
2
+ export interface ConversationMessageSearchResult {
3
+ channelName?: string;
4
+ conversationId: string;
5
+ excerpt: string;
6
+ messageCreatedAtMs: number;
7
+ messageId: string;
8
+ providerDestinationId: string;
9
+ role: "assistant" | "user";
10
+ }
11
+ /** Runtime-derived public workspace scope for cross-conversation search. */
12
+ export interface ConversationMessageSearchScope {
13
+ kind: "public_provider_tenant";
14
+ provider: "slack";
15
+ providerTenantId: string;
16
+ }
17
+ /** Optional filters that narrow retained public workspace search. */
18
+ export interface ConversationMessageSearchFilters {
19
+ /** Slack channel id of the conversation destination. */
20
+ channelId?: string;
21
+ /** Full-text query over retained visible message text. */
22
+ query?: string;
23
+ }
24
+ /** Search retained public messages within an authorized workspace. */
25
+ export interface ConversationMessageSearchStore {
26
+ search(args: {
27
+ currentConversationId: string;
28
+ filters: ConversationMessageSearchFilters;
29
+ limit: number;
30
+ scope: ConversationMessageSearchScope;
31
+ }): Promise<ConversationMessageSearchResult[]>;
32
+ }
@@ -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";
@@ -0,0 +1,4 @@
1
+ import type { JuniorSqlDatabase } from "@/db/db";
2
+ import type { ConversationMessageSearchStore } from "../message-search";
3
+ /** Create a SQL-backed public workspace message search store. */
4
+ export declare function createSqlConversationMessageSearchStore(executor: JuniorSqlDatabase): ConversationMessageSearchStore;
@@ -0,0 +1,5 @@
1
+ /** Deferred tool catalog source for retained Junior conversations. */
2
+ export declare const CONVERSATIONS_TOOL_SOURCE: {
3
+ readonly id: "conversations";
4
+ readonly description: "Search messages and events in retained Junior conversations.";
5
+ };
@@ -1,2 +1,3 @@
1
1
  import type { UserTokenStore } from "@/chat/credentials/user-token-store";
2
- export declare function unlinkProvider(userId: string, provider: string, userTokenStore: UserTokenStore): Promise<void>;
2
+ /** Remove one provider connection and its exact stored account identity. */
3
+ export declare function unlinkProvider(userId: string, provider: string, userTokenStore: UserTokenStore, slackTeamId?: string): Promise<void>;
@@ -1,6 +1,8 @@
1
1
  import { type PluginProviderAccount, type PluginStoredTokens } from "@sentry/junior-plugin-api";
2
2
  export declare const storedTokensSchema: import("zod").ZodObject<{
3
3
  account: import("zod").ZodOptional<import("zod").ZodObject<{
4
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
5
+ handle: import("zod").ZodOptional<import("zod").ZodString>;
4
6
  id: import("zod").ZodString;
5
7
  label: import("zod").ZodOptional<import("zod").ZodString>;
6
8
  url: import("zod").ZodOptional<import("zod").ZodString>;
package/dist/chat/db.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { ConversationStore } from "@/chat/conversations/store";
2
2
  import type { ConversationEventStore } from "@/chat/conversations/history";
3
- import type { ConversationSearchStore } from "@/chat/conversations/search";
3
+ import type { ConversationMessageSearchStore } from "@/chat/conversations/message-search";
4
4
  import type { JuniorDatabase, JuniorSqlExecutor } from "@/db/db";
5
5
  /** Return the process SQL executor for SQL-specific queries and transactions. */
6
6
  export declare function getSqlExecutor(): JuniorSqlExecutor;
@@ -11,6 +11,6 @@ export declare function getConversationStore(): ConversationStore;
11
11
  /** Return the canonical SQL-backed conversation event store. */
12
12
  export declare function getConversationEventStore(): ConversationEventStore;
13
13
  /** Return the SQL-backed public provider-tenant conversation search store. */
14
- export declare function getConversationSearchStore(): ConversationSearchStore;
14
+ export declare function getConversationMessageSearchStore(): ConversationMessageSearchStore;
15
15
  /** Close the process SQL database when it has been opened. */
16
16
  export declare function closeDb(): Promise<void>;
@@ -6,6 +6,7 @@ import type { ToolRuntimeContext } from "@/chat/tools/types";
6
6
  export declare const eventTaskToolResultSchema: z.ZodObject<{
7
7
  target: z.ZodOptional<z.ZodString>;
8
8
  truncated: z.ZodOptional<z.ZodBoolean>;
9
+ timed_out: z.ZodOptional<z.ZodBoolean>;
9
10
  continuation: z.ZodOptional<z.ZodObject<{
10
11
  arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
11
12
  reason: z.ZodOptional<z.ZodString>;
@@ -33,6 +34,7 @@ export declare const eventTaskToolResultSchema: z.ZodObject<{
33
34
  /** Validate one successful event-task list result. */
34
35
  export declare const eventTaskListToolResultSchema: z.ZodObject<{
35
36
  target: z.ZodOptional<z.ZodString>;
37
+ timed_out: z.ZodOptional<z.ZodBoolean>;
36
38
  continuation: z.ZodOptional<z.ZodObject<{
37
39
  arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
38
40
  reason: z.ZodOptional<z.ZodString>;
@@ -2,3 +2,11 @@ import type { JuniorSqlDatabase } from "@/db/db";
2
2
  import { type IdentityUpsert, type StoredIdentity } from "./identity";
3
3
  /** Persist one provider identity observation and link verified emails to users. */
4
4
  export declare function upsertIdentity(executor: JuniorSqlDatabase, identity: IdentityUpsert, nowMs?: number): Promise<StoredIdentity>;
5
+ /**
6
+ * Persist one provider identity after a trusted account-linking flow.
7
+ * Callers must use provider-verified account data, such as GitHub's authenticated
8
+ * user response, never identity claims inferred from content such as Git commits.
9
+ */
10
+ export declare function upsertLinkedIdentity(executor: JuniorSqlDatabase, userId: string, identity: IdentityUpsert, nowMs?: number): Promise<StoredIdentity>;
11
+ /** Remove one exact provider identity owned by a workspace Slack user. */
12
+ export declare function deleteProviderIdentityForSlackUser(executor: JuniorSqlDatabase, slackTeamId: string, slackUserId: string, provider: string, providerSubjectId: string): Promise<void>;
@@ -86,6 +86,8 @@ export declare function logError(eventName: string, attributes?: Record<string,
86
86
  * `.failed` outcome when the event also covers non-exception failures.
87
87
  */
88
88
  export declare function logException(error: unknown, eventName: string, attributes?: Record<string, unknown>): string | undefined;
89
+ /** Run an optional side effect without changing the successful primary outcome. */
90
+ export declare function runBestEffort(operation: () => Promise<void>, eventName: string, attributes?: Record<string, unknown>): Promise<void>;
89
91
  /** Add context to the current operation and Sentry scope. */
90
92
  export declare function setTags(context?: LogContext): void;
91
93
  /** Create a LogContext from an incoming HTTP request. */
@@ -1,7 +1,6 @@
1
1
  import type { OAuthClientInformationMixed, OAuthTokens } from "@modelcontextprotocol/sdk/shared/auth.js";
2
2
  import type { OAuthDiscoveryState } from "@modelcontextprotocol/sdk/client/auth.js";
3
3
  import { type Destination, type Source } from "@sentry/junior-plugin-api";
4
- import type { ThreadArtifactsState } from "@/chat/state/artifacts";
5
4
  export interface McpAuthSessionState {
6
5
  schemaVersion: 2;
7
6
  authSessionId: string;
@@ -16,7 +15,6 @@ export interface McpAuthSessionState {
16
15
  threadTs?: string;
17
16
  toolChannelId?: string;
18
17
  configuration?: Record<string, unknown>;
19
- artifactState?: ThreadArtifactsState;
20
18
  authorizationUrl?: string;
21
19
  codeVerifier?: string;
22
20
  createdAtMs: number;
@@ -1,5 +1,4 @@
1
1
  import type { Destination, Source } from "@sentry/junior-plugin-api";
2
- import type { ThreadArtifactsState } from "@/chat/state/artifacts";
3
2
  import { type McpAuthSessionState } from "./auth-store";
4
3
  import { StateBackedMcpOAuthClientProvider } from "./oauth-provider";
5
4
  export declare function getMcpOAuthCallbackPath(provider: string): string;
@@ -16,7 +15,6 @@ export declare function createMcpOAuthClientProvider(input: {
16
15
  threadTs?: string;
17
16
  toolChannelId?: string;
18
17
  configuration?: Record<string, unknown>;
19
- artifactState?: ThreadArtifactsState;
20
18
  createAuthorizationState?: () => Promise<string>;
21
19
  }): Promise<StateBackedMcpOAuthClientProvider>;
22
20
  /** Exchange a callback code while guarding every shared credential mutation. */
@@ -1,9 +1,10 @@
1
- import { type Destination, type Source } from "@sentry/junior-plugin-api";
1
+ import { type Actor, type Destination, type Source } from "@sentry/junior-plugin-api";
2
2
  import type { OAuthAuthorization, OAuthAuthorizationRequest } from "@/chat/oauth-authorization";
3
3
  type PrivateDeliveryResult = "in_context" | "fallback_dm" | false;
4
4
  export type OAuthStatePayload = {
5
5
  userId: string;
6
6
  provider: string;
7
+ actor?: Actor;
7
8
  channelId?: string;
8
9
  destination?: Destination;
9
10
  source?: Source;
@@ -14,6 +15,7 @@ export type OAuthStatePayload = {
14
15
  };
15
16
  type OAuthFlowInput = {
16
17
  actorId: string;
18
+ actor?: Actor;
17
19
  channelId?: string;
18
20
  destination?: Destination;
19
21
  source?: Source;
@@ -21,6 +21,7 @@ export declare function completeText(params: {
21
21
  maxTokens?: number;
22
22
  signal?: AbortSignal;
23
23
  metadata?: Record<string, unknown>;
24
+ promptName?: string;
24
25
  }): Promise<{
25
26
  message: import("@earendil-works/pi-ai").AssistantMessage;
26
27
  text: string;
@@ -41,6 +42,7 @@ export declare function completeObject<TSchema extends ZodTypeAny>(params: {
41
42
  recordTelemetryPayloads?: boolean;
42
43
  signal?: AbortSignal;
43
44
  metadata?: Record<string, unknown>;
45
+ promptName?: string;
44
46
  }): Promise<{
45
47
  costUsd?: number;
46
48
  object: z.infer<TSchema>;
@@ -40,6 +40,8 @@ export interface IssueCredentialInput {
40
40
  provider: string;
41
41
  userTokenStore: UserTokenStore;
42
42
  }
43
+ /** Return providers that can verify an OAuth account for identity storage. */
44
+ export declare function getOAuthAccountProviders(): string[];
43
45
  /** Ask a plugin which provider account belongs to an OAuth token. */
44
46
  export declare function resolvePluginOAuthAccount(input: {
45
47
  provider: string;
@@ -1,5 +1,4 @@
1
1
  import type { SlackConversationContext } from "@/chat/slack/conversation-context";
2
- import type { ThreadArtifactsState } from "@/chat/state/artifacts";
3
2
  import type { SkillMetadata } from "@/chat/skills";
4
3
  import type { ActiveMcpCatalogSummary } from "@/chat/tool-support/skill/mcp-tool-summary";
5
4
  import type { PluginPromptContributionContext } from "@/chat/plugins/prompt";
@@ -35,7 +34,6 @@ type TurnContextPromptInput = {
35
34
  fullName?: string;
36
35
  userId?: string;
37
36
  };
38
- artifactState?: ThreadArtifactsState;
39
37
  configuration?: Record<string, unknown>;
40
38
  };
41
39
  /** Return byte-stable platform instructions shared by every conversation and turn. */
@@ -9,10 +9,11 @@ export interface ResourceEventNotification {
9
9
  identifier: string;
10
10
  terminal?: boolean;
11
11
  trustedSummary: string;
12
+ data?: Record<string, unknown>;
12
13
  untrustedText?: string;
13
14
  }
14
15
  /** Render the runtime-owned conversation message for a subscribed event. */
15
- export declare function renderResourceEventNotificationText(subscription: Pick<ResourceEventSubscription, "intent" | "label">, event: Pick<ResourceEventNotification, "eventType" | "trustedSummary" | "untrustedText">): string;
16
+ export declare function renderResourceEventNotificationText(subscription: Pick<ResourceEventSubscription, "intent" | "label">, event: Pick<ResourceEventNotification, "eventType" | "trustedSummary" | "data" | "untrustedText">): string;
16
17
  /** Enqueue a resource event as normal conversation mailbox input. */
17
18
  export declare function enqueueResourceEventNotification(args: {
18
19
  event: ResourceEventNotification;
@@ -1,11 +1,8 @@
1
1
  import type { AgentRunResult } from "@/chat/services/turn-result";
2
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";
3
+ import type { ThreadStatePatch } from "@/chat/runtime/thread-state";
5
4
  /** Build state after destination delivery or intentional no-reply completion. */
6
5
  export declare function buildDeliveredTurnStatePatch(args: {
7
- artifactStatePatch?: Partial<ThreadArtifactsState>;
8
- artifacts: ThreadArtifactsState;
9
6
  conversation: ThreadConversationState;
10
7
  reply: AgentRunResult;
11
8
  sessionId: string;
@@ -1,15 +1,12 @@
1
1
  import type { Thread } from "chat";
2
- import type { ChannelConfigurationService } from "@/chat/configuration/types";
2
+ import type { Destination } from "@sentry/junior-plugin-api";
3
+ import type { LocationConfigurationService } from "@/chat/configuration/types";
3
4
  import type { ThreadConversationState } from "@/chat/state/conversation";
4
- import { type ThreadArtifactsState } from "@/chat/state/artifacts";
5
5
  import type { SandboxRef } from "@/chat/sandbox/ref";
6
6
  export interface ThreadStatePatch {
7
- artifacts?: ThreadArtifactsState;
8
7
  conversation?: ThreadConversationState;
9
8
  sandboxRef?: SandboxRef | null;
10
9
  }
11
- /** Merge an artifact patch while preserving per-list column mappings. */
12
- export declare function mergeArtifactsState(artifacts: ThreadArtifactsState, patch: Partial<ThreadArtifactsState> | undefined): ThreadArtifactsState;
13
10
  /** Extract persisted sandbox metadata from thread state payload. */
14
11
  export declare function getPersistedSandboxState(state: Record<string, unknown>): SandboxRef | undefined;
15
12
  /** Persist a thread-state patch for a Chat thread handle. */
@@ -18,11 +15,11 @@ export declare function persistThreadState(thread: Thread, patch: ThreadStatePat
18
15
  export declare function persistThreadRuntimeState(thread: Thread, patch: ThreadStatePatch): Promise<void>;
19
16
  /** Load the persisted state payload for a thread without requiring a Chat singleton. */
20
17
  export declare function getPersistedThreadState(threadId: string): Promise<Record<string, unknown>>;
21
- /** Load the persisted state payload for a channel without constructing a Chat channel. */
22
- export declare function getPersistedChannelState(channelId: string): Promise<Record<string, unknown>>;
23
18
  /** Persist a thread-state patch by thread id without constructing a Chat thread. */
24
19
  export declare function persistThreadStateById(threadId: string, patch: ThreadStatePatch): Promise<void>;
25
- /** Resolve channel configuration from a Chat thread and persist it with Junior's TTL. */
26
- export declare function getChannelConfigurationService(thread: Thread): ChannelConfigurationService;
27
- /** Resolve a channel configuration service by channel id without a Chat thread. */
28
- export declare function getChannelConfigurationServiceById(channelId: string): ChannelConfigurationService;
20
+ /**
21
+ * Resolve durable location configuration.
22
+ *
23
+ * Slack still reads the old channel-id Redis bag once during cutover.
24
+ */
25
+ export declare function getLocationConfigurationService(destination: Destination): LocationConfigurationService;
@@ -1,5 +1,6 @@
1
1
  import type { Message, Thread } from "chat";
2
- import type { ChannelConfigurationService } from "@/chat/configuration/types";
2
+ import type { Destination } from "@sentry/junior-plugin-api";
3
+ import type { LocationConfigurationService } from "@/chat/configuration/types";
3
4
  export interface TurnContext {
4
5
  channelId?: string;
5
6
  actorId?: string;
@@ -19,7 +20,8 @@ export interface QueuedTurnMessage extends TurnMessageText {
19
20
  message: Message;
20
21
  }
21
22
  export interface PrepareTurnStateInput {
22
- channelConfiguration?: ChannelConfigurationService;
23
+ destination: Destination;
24
+ locationConfiguration?: LocationConfigurationService;
23
25
  context: TurnContext;
24
26
  explicitMention: boolean;
25
27
  message: Message;
@@ -1,12 +1,10 @@
1
1
  import type { ThreadConversationState } from "@/chat/state/conversation";
2
2
  import type { SandboxRef } from "@/chat/sandbox/ref";
3
- import { type ThreadArtifactsState } from "@/chat/state/artifacts";
4
- import type { ChannelConfigurationService } from "@/chat/configuration/types";
3
+ import type { LocationConfigurationService } from "@/chat/configuration/types";
5
4
  import type { PrepareTurnStateInput, TurnContext } from "@/chat/runtime/turn-input";
6
5
  export interface PreparedTurnState {
7
- artifacts: ThreadArtifactsState;
8
6
  configuration?: Record<string, unknown>;
9
- channelConfiguration?: ChannelConfigurationService;
7
+ locationConfiguration?: LocationConfigurationService;
10
8
  conversation: ThreadConversationState;
11
9
  conversationContext?: string;
12
10
  sandboxRef?: SandboxRef;
@@ -33,6 +33,8 @@ export declare function formatSandboxCommandResult(params: SandboxCommandOutcome
33
33
  createdAtMs: number;
34
34
  account?: {
35
35
  id: string;
36
+ displayName?: string | undefined;
37
+ handle?: string | undefined;
36
38
  label?: string | undefined;
37
39
  url?: string | undefined;
38
40
  } | undefined;