@sentry/junior 0.298.0 → 0.300.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 (95) hide show
  1. package/dist/{actor-6jsm_v96.js → actor-D2iXzvlN.js} +2 -1
  2. package/dist/{state-CSuA2J1V.js → adapter-S5UkjNK3.js} +53 -136
  3. package/dist/{admin-BF3DbYGf.js → admin-UrTniSPO.js} +2 -2
  4. package/dist/{agent-runner-Q9GkoerG.js → agent-runner-bY4_0UPm.js} +1444 -1478
  5. package/dist/api/schema.d.ts +2 -2
  6. package/dist/api/schema.js +7 -7
  7. package/dist/api.d.ts +1 -1
  8. package/dist/api.js +382 -68
  9. package/dist/{app-DOg_mCtV.d.ts → app-D-AcIcCV.d.ts} +17 -4
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +148 -483
  12. package/dist/{automation-Cn8qmbdr.js → automation-Dw82oQ-h.js} +2 -2
  13. package/dist/{background-compaction-queue-BZhGFOK6.js → background-compaction-queue-B6U3060-.js} +9 -5
  14. package/dist/{briefs-CQrCRF6-.js → briefs-DqiwWu-n.js} +4 -4
  15. package/dist/{catalog-runtime-DZeD2WbL.js → catalog-runtime-D1oYNv04.js} +1 -1
  16. package/dist/cli/chat.js +17 -17
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +5 -5
  20. package/dist/cli/snapshot-create.js +4 -4
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +4 -4
  23. package/dist/{config-BOByVnxe.js → config-9nHoFiJP.js} +117 -12
  24. package/dist/{connections-BNN5cJam.js → connections-DZjTN3JC.js} +6 -6
  25. package/dist/continue-in-slack-Dtv7_U42.js +176 -0
  26. package/dist/{conversation-DCkzvxqB.js → conversation-Dyjq2CZ8.js} +36 -13
  27. package/dist/{conversation-feed-CMA12Rjs.js → conversation-feed-CcDxlrlQ.js} +109 -3
  28. package/dist/{conversation-privacy-C0eRxsgb.js → conversation-privacy-D-5HTXjS.js} +1 -1
  29. package/dist/{conversation-turn-D9qvcDX6.js → conversation-turn-Cxl8WZD7.js} +85 -68
  30. package/dist/{credential-sync-B_iUpxGL.js → credential-sync-C49ClwDX.js} +18 -18
  31. package/dist/{db-DoMcnYol.d.ts → db-2resqBh1.d.ts} +1 -1
  32. package/dist/{db-CoMNr2Zm.js → db-BJNo6fK5.js} +176 -12
  33. package/dist/{executor-C-m8VrzX.js → executor-DBIaOeJ_.js} +47 -13
  34. package/dist/{media-BepyEUNm.js → history-IjdmO_r6.js} +1 -85
  35. package/dist/instrumentation.js +14 -5
  36. package/dist/lineage-0dereG7H.js +37 -0
  37. package/dist/{logging-CJTi5niy.js → logging-BIclibct.js} +1 -1
  38. package/dist/{message-Q6_5DAWR.js → message-dkOl-Iii.js} +9 -10
  39. package/dist/model-input-CLo9TaUd.js +82 -0
  40. package/dist/nitro.d.ts +1 -1
  41. package/dist/nitro.js +17 -9
  42. package/dist/{oauth-callback-server-CH5XAyo-.js → oauth-callback-server-WmpjfJgQ.js} +2 -2
  43. package/dist/{plugins-HYh_JOdw.js → plugins-BBX07Jzt.js} +1 -1
  44. package/dist/{projection-BgwEE36_.js → projection-w_X-zi7v.js} +1035 -692
  45. package/dist/{prompt-DXc9DYT9.js → prompt-B1Xw46-S.js} +4 -4
  46. package/dist/{registry-9XwqSnM-.js → registry-BmP5vnlj.js} +4 -4
  47. package/dist/{resolve-DUIAbcRL.js → resolve-goo34bJK.js} +3 -3
  48. package/dist/{result-C2Vn8QGn.js → result-PVBeU0Wf.js} +158 -69
  49. package/dist/{runner-CXGtw-Mc.js → runner-DKrfvNV6.js} +9 -9
  50. package/dist/{sandbox-egress-signals-Di3S_dO7.js → sandbox-egress-signals-DsUcqrI0.js} +1 -1
  51. package/dist/{schema-Dyp7racy.js → schema-C9iNFz5n.js} +51 -7
  52. package/dist/{schema-BnbZ-rKv.d.ts → schema-Dns-sTas.d.ts} +1285 -761
  53. package/dist/{service-account-DM3KBBeG.js → service-account-CMAAloAL.js} +3 -3
  54. package/dist/{service-account-GzAMUQ8a.js → service-account-CmowamcB.js} +4 -4
  55. package/dist/session-stop-BcAXze8a.js +3330 -0
  56. package/dist/{skills-DCK9SD_l.js → skills-DfsazET6.js} +3 -3
  57. package/dist/slack-conversation-unfurl-CzQonuWz.js +370 -0
  58. package/dist/spawn-C7o0FDDp.js +73 -0
  59. package/dist/state-zSilNpbi.js +132 -0
  60. package/dist/{user-input-request-CXNIov9n.js → statuses-Hn-HsOph.js} +115 -26
  61. package/dist/{stop-Dh2DfwpK.js → stop-CFOujp8C.js} +9105 -6007
  62. package/dist/{store-DrA17Fbz.js → store-Dkeis_8o.js} +10 -10
  63. package/dist/{store-B1zepKG8.js → store-E3x2Fg_F.js} +24 -4
  64. package/dist/{task-queue-D1rXWfFN.js → task-queue-D-hCqdZW.js} +4 -4
  65. package/dist/{task-runner-CT4M8oDz.js → task-runner-vohUPLHe.js} +10 -10
  66. package/dist/{thread-context-DnqUkbzN.js → thread-context-BzvdkgI9.js} +18 -18
  67. package/dist/{turn-session-routing-VXDVXLRl.js → turn-session-routing-Bo_LxFum.js} +5 -5
  68. package/dist/turn-user-message-D5RnVmxQ.js +355 -0
  69. package/dist/users-2bggndVg.js +424 -0
  70. package/dist/{validation-zxAJBDDy.js → validation-BbWikeSa.js} +1 -1
  71. package/dist/{version-DcZ40a0g.js → version-GVBMW2jA.js} +1 -1
  72. package/dist/version.js +1 -1
  73. package/dist/{viewer-CgiGjW10.js → viewer-BpxRliyO.js} +36 -163
  74. package/dist/{warmup-CwKbxQLl.js → warmup-BW2qwnal.js} +1140 -145
  75. package/dist/{worker-CbDUzaBA.js → worker-Cbd-iuwZ.js} +25 -20
  76. package/migrations/0104_code_change_draft.sql +1 -0
  77. package/migrations/0105_attachment_uploads.sql +14 -0
  78. package/migrations/0106_conversation_agent_config.sql +1 -0
  79. package/migrations/0107_attachment_deferred_download.sql +2 -0
  80. package/migrations/meta/0104_snapshot.json +4516 -0
  81. package/migrations/meta/0105_snapshot.json +4611 -0
  82. package/migrations/meta/0106_snapshot.json +4617 -0
  83. package/migrations/meta/0107_snapshot.json +4617 -0
  84. package/migrations/meta/_journal.json +28 -0
  85. package/package.json +10 -8
  86. package/dist/attempt-selection-ClP3MMPr.js +0 -61
  87. package/dist/locks-D-0h111u.js +0 -48
  88. package/dist/notification-Bv25xbj0.js +0 -1284
  89. package/dist/prompt-input-BUr4J9RO.js +0 -1424
  90. package/dist/session-stop-D4i7e6iT.js +0 -181
  91. package/dist/spawn-6cX6xE9G.js +0 -80
  92. package/dist/turn-cancel-l460pfGW.js +0 -201
  93. package/dist/turn-user-message-BSPmkm7X.js +0 -608
  94. package/dist/turn-wake-DVFVXyhX.js +0 -161
  95. package/dist/{oauth-relay-CsfIazeF.js → oauth-relay-DRzq73b6.js} +1 -1
@@ -0,0 +1,82 @@
1
+ import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
+ import { s as getSqlExecutor } from "./db-BJNo6fK5.js";
3
+ import { vt as readLiveAttachment } from "./agent-runner-bY4_0UPm.js";
4
+ import { m as isVisionImageMediaType, p as detectImageMediaType } from "./statuses-Hn-HsOph.js";
5
+ // src/chat/attachments/model-input.ts
6
+ var model_input_exports = /* @__PURE__ */ __exportAll({
7
+ MAX_MODEL_ATTACHMENTS: () => 3,
8
+ MAX_MODEL_ATTACHMENT_BYTES: () => MAX_MODEL_ATTACHMENT_BYTES,
9
+ buildStoredAttachmentPromptText: () => buildStoredAttachmentPromptText,
10
+ loadInputAttachments: () => loadInputAttachments
11
+ });
12
+ /** Largest file that Slack and web send to the model in the prompt. */
13
+ const MAX_MODEL_ATTACHMENT_BYTES = 5242880;
14
+ /** Tell the model how to read a stored file that the prompt does not carry. */
15
+ function buildStoredAttachmentPromptText(args) {
16
+ return [
17
+ "<attachment>",
18
+ `filename: ${args.filename ?? "unnamed"}`,
19
+ `media_type: ${args.mediaType}`,
20
+ `attachment_id: ${args.attachmentId}`,
21
+ "Use loadAttachment with this id to access the original file.",
22
+ "</attachment>"
23
+ ].join("\n");
24
+ }
25
+ async function readStoredBytes(args) {
26
+ const record = await readLiveAttachment({
27
+ attachmentId: args.attachment.id,
28
+ conversationId: args.conversationId,
29
+ db: getSqlExecutor()
30
+ });
31
+ if (!record || record.storageProvider !== args.storage.provider || record.storageKey === null) throw new Error("Input attachment is no longer available.");
32
+ const body = await args.storage.get(record.storageKey);
33
+ if (!body) throw new Error("Input attachment contents are unavailable.");
34
+ const data = Buffer.from(await new Response(body).arrayBuffer());
35
+ if (data.byteLength !== record.bytes) throw new Error("Input attachment size does not match stored metadata.");
36
+ return data;
37
+ }
38
+ /**
39
+ * Build model input for the stored files of one web Message.
40
+ *
41
+ * Like Slack, the first images within the size limit go to the model as
42
+ * images. Every other file gets a note that points to `loadAttachment`.
43
+ */
44
+ async function loadInputAttachments(args) {
45
+ let images = 0;
46
+ return await Promise.all(args.attachments.map(async (attachment) => {
47
+ const base = {
48
+ attachmentId: attachment.id,
49
+ filename: attachment.filename,
50
+ mediaType: attachment.contentType
51
+ };
52
+ if (!(isVisionImageMediaType(attachment.contentType) && attachment.bytes <= 5242880 && images < 3)) return {
53
+ ...base,
54
+ promptText: buildStoredAttachmentPromptText({
55
+ attachmentId: attachment.id,
56
+ filename: attachment.filename,
57
+ mediaType: attachment.contentType
58
+ })
59
+ };
60
+ images += 1;
61
+ const data = await readStoredBytes({
62
+ attachment,
63
+ conversationId: args.conversationId,
64
+ storage: args.storage
65
+ });
66
+ const mediaType = detectImageMediaType(data);
67
+ if (!mediaType) return {
68
+ ...base,
69
+ promptText: buildStoredAttachmentPromptText({
70
+ attachmentId: attachment.id,
71
+ filename: attachment.filename,
72
+ mediaType: attachment.contentType
73
+ })
74
+ };
75
+ return {
76
+ ...base,
77
+ data,
78
+ mediaType
79
+ };
80
+ }));
81
+ }
82
+ export { buildStoredAttachmentPromptText as n, model_input_exports as r, MAX_MODEL_ATTACHMENT_BYTES as t };
package/dist/nitro.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as JuniorDashboardOptions } from "./app-DOg_mCtV.js";
1
+ import { i as JuniorDashboardOptions } from "./app-D-AcIcCV.js";
2
2
  import { n as JuniorPluginSet } from "./plugins-B_0Cr0MO.js";
3
3
  import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
4
4
  type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
package/dist/nitro.js CHANGED
@@ -1,8 +1,8 @@
1
- import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, z as getDeploymentServiceVersion } from "./logging-CJTi5niy.js";
1
+ import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, z as getDeploymentServiceVersion } from "./logging-BIclibct.js";
2
2
  import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DJhGdS4c.js";
3
- import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, h as CACHE_WARMUP_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic } from "./background-compaction-queue-BZhGFOK6.js";
4
- import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-HYh_JOdw.js";
5
- import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-D1rXWfFN.js";
3
+ import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, g as CACHE_WARMUP_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic } from "./background-compaction-queue-B6U3060-.js";
4
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-D-hCqdZW.js";
5
+ import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-BBX07Jzt.js";
6
6
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cf5gVPWP.js";
7
7
  import path from "node:path";
8
8
  import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
@@ -14,12 +14,14 @@ import { sentryOrchestrionPlugin } from "@sentry/server-utils/orchestrion/rollup
14
14
  * bundling.
15
15
  *
16
16
  * pi-ai registers API providers via a top-level side-effect in
17
- * register-builtins.js. Nitro's default moduleSideEffects whitelist only
18
- * includes unenv polyfills, so rolldown tree-shakes the registration call
19
- * and the apiProviderRegistry Map stays empty at runtime.
17
+ * register-builtins.js. Older Nitro builds set a moduleSideEffects allowlist
18
+ * with only unenv polyfills, so rolldown tree-shook the registration call and
19
+ * the apiProviderRegistry Map stayed empty at runtime
20
+ * (https://github.com/nitrojs/nitro/issues/4085).
20
21
  *
21
- * TODO(upstream): Track https://github.com/nitrojs/nitro/issues/XXXX for
22
- * native moduleSideEffects configuration support.
22
+ * TODO(dcramer): Remove this override when a production build shows that
23
+ * pi-ai providers register without it. nitrojs/nitro#4164 removed the
24
+ * allowlist, and every Nitro version that Junior supports includes that fix.
23
25
  */
24
26
  function applyRolldownTreeshakeWorkaround(nitro) {
25
27
  nitro.options.rolldownConfig = {
@@ -260,11 +262,17 @@ function configureVercelDeployment(nitro, options) {
260
262
  addQueueTrigger(JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, BACKGROUND_COMPACTION_QUEUE_TOPIC);
261
263
  return defaultMaxDuration;
262
264
  }
265
+ function dropRoutedServerEntry(nitro) {
266
+ const serverEntry = nitro.options.serverEntry;
267
+ if (!serverEntry) return;
268
+ if (Object.values(nitro.options.routes).some((route) => (typeof route === "string" ? route : route.handler) === serverEntry.handler)) nitro.options.serverEntry = false;
269
+ }
263
270
  /** Nitro module that configures deployment wiring and copies app/plugin content into the Vercel build output. */
264
271
  function juniorNitro(options = {}) {
265
272
  return { nitro: { setup(nitro) {
266
273
  const cwd = path.resolve(options.cwd ?? nitro.options.rootDir ?? process.cwd());
267
274
  const functionMaxDurationSeconds = configureVercelDeployment(nitro, options);
275
+ dropRoutedServerEntry(nitro);
268
276
  applyRolldownTreeshakeWorkaround(nitro);
269
277
  if (dashboardEnabled(options.dashboard)) nitro.options.publicAssets.push({
270
278
  baseURL: "/_junior/dashboard/assets",
@@ -1,5 +1,5 @@
1
- import { Hn as createUserTokenStore } from "./projection-BgwEE36_.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-B_iUpxGL.js";
1
+ import { Zn as createUserTokenStore } from "./projection-w_X-zi7v.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-C49ClwDX.js";
3
3
  import { createServer } from "node:http";
4
4
  // src/chat/local/oauth-callback-server.ts
5
5
  const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
@@ -89,7 +89,7 @@ function pluginCatalogConfigFromEnv(env = process.env) {
89
89
  }
90
90
  /** Return registrations that expose in-process runtime code. */
91
91
  function pluginRuntimeRegistrationsFromPluginSet(pluginSet) {
92
- return pluginSet?.registrations.filter((plugin) => plugin.hooks || plugin.tasks || plugin.userPages?.length) ?? [];
92
+ return pluginSet?.registrations.filter((plugin) => plugin.hooks || plugin.images || plugin.tasks || plugin.userPages?.length || plugin.objectLinks?.length) ?? [];
93
93
  }
94
94
  /** Return registrations that expose host CLI commands. */
95
95
  function pluginCliRegistrationsFromPluginSet(pluginSet) {