@sentry/junior 0.155.0 → 0.156.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 (79) hide show
  1. package/dist/{agent-hooks-AWVTLAV2.js → agent-hooks-CCAR46PQ.js} +10 -10
  2. package/dist/api/locations/detail.d.ts +1 -0
  3. package/dist/api/schema/conversation.d.ts +19 -4
  4. package/dist/api/schema/location.d.ts +1 -0
  5. package/dist/api/schema/person.d.ts +1 -0
  6. package/dist/api/schema.js +1 -1
  7. package/dist/api.js +48 -36
  8. package/dist/app.js +147 -44
  9. package/dist/{catalog-runtime-V6YD6KH5.js → catalog-runtime-3SNKYCBG.js} +5 -5
  10. package/dist/chat/agent/types.d.ts +2 -0
  11. package/dist/chat/attachments/storage.d.ts +12 -0
  12. package/dist/chat/attachments/store.d.ts +52 -0
  13. package/dist/chat/attachments/vercel.d.ts +3 -0
  14. package/dist/chat/conversations/retention.d.ts +4 -0
  15. package/dist/chat/ingress/bot-mention.d.ts +13 -0
  16. package/dist/chat/plugins/unfinished-work.d.ts +6 -0
  17. package/dist/chat/runtime/agent-runner.d.ts +2 -0
  18. package/dist/chat/services/conversation-memory.d.ts +1 -1
  19. package/dist/chat/slack/tools/send-files.d.ts +17 -11
  20. package/dist/chat/state/conversation.d.ts +2 -1
  21. package/dist/chat/tools/types.d.ts +2 -0
  22. package/dist/{chunk-V57LZDHN.js → chunk-3FFUC32L.js} +6 -6
  23. package/dist/{chunk-J2SYI36O.js → chunk-3L2PMOSR.js} +4 -4
  24. package/dist/{chunk-2AHVM3HK.js → chunk-4ZZDTHFC.js} +10 -8
  25. package/dist/{chunk-AENPRXCG.js → chunk-53W3LZEW.js} +381 -55
  26. package/dist/{chunk-ELOTIL5F.js → chunk-6CINHXIL.js} +4 -4
  27. package/dist/{chunk-37G5HJ2X.js → chunk-6JUU7J2B.js} +4 -4
  28. package/dist/{chunk-KBT2I5ER.js → chunk-7RAETIYO.js} +6 -6
  29. package/dist/{chunk-NWSKFYOH.js → chunk-A6WPDFHQ.js} +1 -1
  30. package/dist/{chunk-773XC7P4.js → chunk-AIJRG227.js} +159 -128
  31. package/dist/{chunk-APHDJYN7.js → chunk-CK2H7CFO.js} +1 -1
  32. package/dist/{chunk-Y7ZUBP2K.js → chunk-CN2XSVKF.js} +6 -6
  33. package/dist/{chunk-TVXAN43I.js → chunk-EDJ64P2P.js} +1 -1
  34. package/dist/{chunk-XFZLQANQ.js → chunk-GKC43TLS.js} +2 -2
  35. package/dist/{chunk-UWTXAYBP.js → chunk-GSBPZHLQ.js} +9 -9
  36. package/dist/{chunk-JJX77MB7.js → chunk-IIO5PFZX.js} +3 -3
  37. package/dist/{chunk-RQ62VKM7.js → chunk-IZEBHYI4.js} +1 -1
  38. package/dist/{chunk-J7MWZFFP.js → chunk-JUJR6WTL.js} +4 -4
  39. package/dist/{chunk-JFZBGFNX.js → chunk-KBGMYLSV.js} +2 -1
  40. package/dist/{chunk-LQT3SWFA.js → chunk-KCA5MKHU.js} +5 -5
  41. package/dist/{chunk-SDRJ2LE3.js → chunk-MC57E5U5.js} +1 -1
  42. package/dist/{chunk-2WLJDM23.js → chunk-MJE7XKWP.js} +1 -1
  43. package/dist/{chunk-TKJ7277U.js → chunk-NTNU6T2D.js} +2 -2
  44. package/dist/{chunk-EORR34UB.js → chunk-OGZPRMZA.js} +1 -1
  45. package/dist/{chunk-NKFRRZIT.js → chunk-OMQJB7YN.js} +19 -18
  46. package/dist/{chunk-Y6MVGU7L.js → chunk-PMFGVLDU.js} +10 -10
  47. package/dist/{chunk-KTVHAHUV.js → chunk-SE3D225X.js} +1 -1
  48. package/dist/{chunk-JIC33O5L.js → chunk-SRJA6QLM.js} +2 -2
  49. package/dist/{chunk-4K5N6HTX.js → chunk-TN4LVILT.js} +5 -5
  50. package/dist/{chunk-MLBH7J7J.js → chunk-TNXGMFWV.js} +1 -1
  51. package/dist/{chunk-RN3AWYEP.js → chunk-WD7SEUZO.js} +1 -1
  52. package/dist/{chunk-ZLSFOSDK.js → chunk-X5NZQH5U.js} +2 -1
  53. package/dist/{chunk-7NYEB2TM.js → chunk-X7W45B5G.js} +1 -1
  54. package/dist/{chunk-CPQBTTI6.js → chunk-ZNWRYNCA.js} +5 -5
  55. package/dist/cli/chat.js +30 -30
  56. package/dist/cli/check.js +6 -6
  57. package/dist/cli/plugins.js +13 -13
  58. package/dist/cli/snapshot-create.js +9 -9
  59. package/dist/cli/upgrade.js +7 -7
  60. package/dist/db/schema/attachments.d.ts +178 -0
  61. package/dist/db/schema.d.ts +179 -1
  62. package/dist/{db-WT7P56AH.js → db-TYUUKGJX.js} +7 -7
  63. package/dist/handlers/retention.d.ts +4 -1
  64. package/dist/instrumentation.js +4 -4
  65. package/dist/nitro.js +2 -2
  66. package/dist/{oauth-callback-server-R2PK2MCA.js → oauth-callback-server-AWVDKPR5.js} +23 -23
  67. package/dist/{runner-O7YYUIHT.js → runner-JUQXMACC.js} +13 -13
  68. package/dist/{skills-S6HLQRH7.js → skills-4GZTZX4V.js} +6 -6
  69. package/dist/spawn-32SSRWU4.js +37 -0
  70. package/dist/{validation-46WD2OAR.js → validation-DRLNJRND.js} +6 -6
  71. package/dist/version.js +1 -1
  72. package/dist/{work-YT5QUBS3.js → work-TGIXRRJY.js} +17 -17
  73. package/dist/worker-IFXZOYED.js +24 -0
  74. package/migrations/0027_attachment_storage.sql +16 -0
  75. package/migrations/meta/0027_snapshot.json +2554 -0
  76. package/migrations/meta/_journal.json +8 -1
  77. package/package.json +5 -4
  78. package/dist/spawn-B4SBFFA2.js +0 -37
  79. package/dist/worker-4C5BEDWN.js +0 -24
@@ -1,10 +1,16 @@
1
+ import type { AttachmentStorage } from "@/chat/attachments/storage";
2
+ import type { JuniorSqlDatabase } from "@/db/db";
1
3
  import type { SlackToolContext } from "@/chat/slack/tool-support/context";
2
4
  import { type SandboxFileMaterializationInput, type SandboxFileUpload } from "@/chat/tools/sandbox/file-uploads";
3
5
  import type { ToolState } from "@/chat/tools/types";
4
6
  /** Convert a model-supplied sandbox file path into bytes safe for Slack upload. */
5
7
  export type MaterializeFile = (input: SandboxFileMaterializationInput) => Promise<SandboxFileUpload>;
6
8
  /** Create the Slack side-effect tool for active-conversation file messages. */
7
- export declare function createSendFilesTool(context: SlackToolContext, state: ToolState, materializeFile: MaterializeFile): Omit<import("../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
9
+ export declare function createSendFilesTool(context: SlackToolContext, state: ToolState, materializeFile: MaterializeFile, attachments?: {
10
+ conversationId: string;
11
+ db: JuniorSqlDatabase;
12
+ storage: AttachmentStorage;
13
+ }): Omit<import("../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
8
14
  inputSchema: import("../../tools/definition").JsonSchemaObject;
9
15
  outputSchema: import("../../tools/definition").JsonSchemaObject;
10
16
  prepareArguments(args: unknown): {
@@ -17,10 +23,11 @@ export declare function createSendFilesTool(context: SlackToolContext, state: To
17
23
  };
18
24
  execute?: ((input: unknown, options: import("../../tools/definition").ToolExecuteOptions) => {
19
25
  [x: string]: unknown;
20
- target: string;
21
- channel_id: string;
22
- file_count: number;
23
- thread_ts: string;
26
+ attachment_refs: {
27
+ id: string;
28
+ name: string;
29
+ }[];
30
+ target?: string | undefined;
24
31
  truncated?: boolean | undefined;
25
32
  timed_out?: boolean | undefined;
26
33
  continuation?: {
@@ -28,13 +35,13 @@ export declare function createSendFilesTool(context: SlackToolContext, state: To
28
35
  reason?: string | undefined;
29
36
  } | undefined;
30
37
  deduplicated?: boolean | undefined;
31
- file_ids?: string[] | undefined;
32
38
  } | Promise<{
33
39
  [x: string]: unknown;
34
- target: string;
35
- channel_id: string;
36
- file_count: number;
37
- thread_ts: string;
40
+ attachment_refs: {
41
+ id: string;
42
+ name: string;
43
+ }[];
44
+ target?: string | undefined;
38
45
  truncated?: boolean | undefined;
39
46
  timed_out?: boolean | undefined;
40
47
  continuation?: {
@@ -42,6 +49,5 @@ export declare function createSendFilesTool(context: SlackToolContext, state: To
42
49
  reason?: string | undefined;
43
50
  } | undefined;
44
51
  deduplicated?: boolean | undefined;
45
- file_ids?: string[] | undefined;
46
52
  }>) | undefined;
47
53
  };
@@ -8,7 +8,8 @@ export interface ConversationAuthor {
8
8
  }
9
9
  export interface ConversationMessageMeta {
10
10
  attachmentCount?: number;
11
- source?: "web";
11
+ /** Known message provenance. Omit when unknown; never invent a default. */
12
+ source?: "slack" | "web";
12
13
  eventType?: string;
13
14
  explicitMention?: boolean;
14
15
  imageAttachmentCount?: number;
@@ -10,6 +10,7 @@ import type { SlackActionToken } from "@/chat/slack/action-token";
10
10
  import type { ModelProfile } from "@/chat/model-profile";
11
11
  import type { GeneratedArtifactFileRef } from "@/chat/tools/sandbox/file-uploads";
12
12
  import type { SpawnAgent } from "@/chat/agent/types";
13
+ import type { AttachmentStorage } from "@/chat/attachments/storage";
13
14
  interface HandoffControl {
14
15
  /** Non-empty catalog of configured targets. */
15
16
  profiles: readonly [ModelProfile, ...ModelProfile[]];
@@ -52,6 +53,7 @@ export interface ToolHooks {
52
53
  };
53
54
  }
54
55
  interface BaseToolRuntimeContext {
56
+ attachmentStorage?: AttachmentStorage;
55
57
  handoff?: HandoffControl;
56
58
  spawnAgent?: SpawnAgent;
57
59
  /**
@@ -4,30 +4,30 @@ import {
4
4
  isConversationScopedChannel,
5
5
  isDmChannel,
6
6
  normalizeSlackConversationId
7
- } from "./chunk-TKJ7277U.js";
7
+ } from "./chunk-NTNU6T2D.js";
8
8
  import {
9
9
  getConversationEventStore,
10
10
  getDb
11
- } from "./chunk-JJX77MB7.js";
11
+ } from "./chunk-IIO5PFZX.js";
12
12
  import {
13
13
  juniorConversationAnnotations,
14
14
  juniorConversationEvents,
15
15
  juniorIdentities,
16
16
  juniorUsers
17
- } from "./chunk-773XC7P4.js";
17
+ } from "./chunk-AIJRG227.js";
18
18
  import {
19
19
  SANDBOX_WORKSPACE_ROOT
20
20
  } from "./chunk-EM225ITJ.js";
21
21
  import {
22
22
  getStateAdapter
23
- } from "./chunk-SDRJ2LE3.js";
23
+ } from "./chunk-MC57E5U5.js";
24
24
  import {
25
25
  botConfig,
26
26
  completeObject,
27
27
  embedTexts,
28
28
  getSlackBotToken,
29
29
  standardModelId
30
- } from "./chunk-XFZLQANQ.js";
30
+ } from "./chunk-GKC43TLS.js";
31
31
  import {
32
32
  isActorUserId,
33
33
  parseActorUserId,
@@ -40,7 +40,7 @@ import {
40
40
  logInfo,
41
41
  logWarn,
42
42
  normalizeIdentityEmail
43
- } from "./chunk-7NYEB2TM.js";
43
+ } from "./chunk-X7W45B5G.js";
44
44
 
45
45
  // src/chat/plugins/agent-hooks.ts
46
46
  import {
@@ -13,7 +13,7 @@ import {
13
13
  instructionProvenanceFor,
14
14
  sanitizePostgresJson,
15
15
  withConversationEventLock
16
- } from "./chunk-JJX77MB7.js";
16
+ } from "./chunk-IIO5PFZX.js";
17
17
  import {
18
18
  SANDBOX_WORKSPACE_ROOT,
19
19
  sleep
@@ -23,14 +23,14 @@ import {
23
23
  fenceLock,
24
24
  getStateAdapter,
25
25
  withLock
26
- } from "./chunk-SDRJ2LE3.js";
26
+ } from "./chunk-MC57E5U5.js";
27
27
  import {
28
28
  botConfig,
29
29
  completeText,
30
30
  escapeXml,
31
31
  resolveGatewayModel,
32
32
  unwrapCurrentInstruction
33
- } from "./chunk-XFZLQANQ.js";
33
+ } from "./chunk-GKC43TLS.js";
34
34
  import {
35
35
  parseSlackMessageTs,
36
36
  toStoredSlackActor
@@ -40,7 +40,7 @@ import {
40
40
  logException,
41
41
  logWarn,
42
42
  setSpanAttributes
43
- } from "./chunk-7NYEB2TM.js";
43
+ } from "./chunk-X7W45B5G.js";
44
44
 
45
45
  // src/chat/turn-context-tag.ts
46
46
  var TURN_CONTEXT_TAG = "runtime-turn-context";
@@ -3,38 +3,38 @@ import {
3
3
  } from "./chunk-RF6J3DIO.js";
4
4
  import {
5
5
  resolveBaseUrl
6
- } from "./chunk-KBT2I5ER.js";
6
+ } from "./chunk-7RAETIYO.js";
7
7
  import {
8
8
  isExperimentalFeatureEnabled
9
9
  } from "./chunk-5IDFPCON.js";
10
10
  import {
11
11
  createPluginLogger,
12
12
  getPlugins
13
- } from "./chunk-V57LZDHN.js";
13
+ } from "./chunk-3FFUC32L.js";
14
14
  import {
15
15
  getSlackClient,
16
16
  withSlackRetries
17
- } from "./chunk-TKJ7277U.js";
17
+ } from "./chunk-NTNU6T2D.js";
18
18
  import {
19
19
  getDb,
20
20
  parseDestination
21
- } from "./chunk-JJX77MB7.js";
21
+ } from "./chunk-IIO5PFZX.js";
22
22
  import {
23
23
  sleep
24
24
  } from "./chunk-EM225ITJ.js";
25
25
  import {
26
26
  acquireActiveLock,
27
27
  getStateAdapter
28
- } from "./chunk-SDRJ2LE3.js";
28
+ } from "./chunk-MC57E5U5.js";
29
29
  import {
30
30
  pluginCatalogRuntime
31
- } from "./chunk-TVXAN43I.js";
31
+ } from "./chunk-EDJ64P2P.js";
32
32
  import {
33
33
  fetchWithBoundedOAuthErrorBodies
34
- } from "./chunk-RN3AWYEP.js";
34
+ } from "./chunk-WD7SEUZO.js";
35
35
  import {
36
36
  isRecord
37
- } from "./chunk-7NYEB2TM.js";
37
+ } from "./chunk-X7W45B5G.js";
38
38
 
39
39
  // src/chat/capabilities/router.ts
40
40
  var ProviderCredentialRouter = class {
@@ -149,6 +149,7 @@ async function issueProviderCredentialLease(input) {
149
149
  // src/chat/runtime/agent-runner.ts
150
150
  var AGENT_ABORT_SETTLE_GRACE_MS = 5e3;
151
151
  function createAgentRunner(execute, options) {
152
+ const attachmentStorage = options?.attachmentStorage;
152
153
  const streamFn = options?.streamFn;
153
154
  const tracePropagation = options?.tracePropagation;
154
155
  const bindSpawnAgent = options?.bindSpawnAgent;
@@ -160,6 +161,7 @@ function createAgentRunner(execute, options) {
160
161
  ...run,
161
162
  environment: {
162
163
  ...run.environment,
164
+ attachmentStorage: run.environment?.attachmentStorage ?? attachmentStorage,
163
165
  sandboxTracePropagation: run.environment?.sandboxTracePropagation ?? tracePropagation
164
166
  },
165
167
  ...spawnAgent ? {