@sentry/junior 0.275.0 → 0.277.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 (80) hide show
  1. package/dist/{adapter-dE2BiWP_.js → adapter-BtfBHVM5.js} +1 -1
  2. package/dist/{admin-CkPaAYuZ.js → admin-DzAKbZsm.js} +1 -1
  3. package/dist/{agent-invocations-C1RNOCs8.js → agent-invocations-Crs3XHhg.js} +6 -1
  4. package/dist/{agent-runner-bE7aH7ew.js → agent-runner-BsYAbniN.js} +394 -244
  5. package/dist/api/schema.d.ts +2 -2
  6. package/dist/api/schema.js +4 -4
  7. package/dist/api.d.ts +13 -2
  8. package/dist/api.js +186 -68
  9. package/dist/{app-CgkquhZ8.d.ts → app-BjEQwNVP.d.ts} +11 -3
  10. package/dist/app.d.ts +2 -2
  11. package/dist/app.js +227 -112
  12. package/dist/{assistant-reply-CjRU9Z59.js → assistant-reply-NebRGG4G.js} +1 -1
  13. package/dist/{automation-BGrd03QO.js → automation-Cql9h2vO.js} +42 -13
  14. package/dist/{background-compaction-queue-BYuOt3qK.js → background-compaction-queue-hh18yCeU.js} +2 -2
  15. package/dist/{briefs-6xUvmGos.js → briefs-BBo0Eimi.js} +4 -4
  16. package/dist/{catalog-runtime-DcJ5NHDW.js → catalog-runtime-DE-F4Awo.js} +1 -1
  17. package/dist/cli/chat.d.ts +1 -1
  18. package/dist/cli/chat.js +14 -14
  19. package/dist/cli/check.js +3 -3
  20. package/dist/cli/main.js +3 -3
  21. package/dist/cli/plugins.d.ts +1 -1
  22. package/dist/cli/plugins.js +4 -4
  23. package/dist/cli/snapshot-create.js +4 -4
  24. package/dist/cli/upgrade.d.ts +2 -2
  25. package/dist/cli/upgrade.js +3 -3
  26. package/dist/{client-gnKpkpqP.js → client-DZ8HTnYH.js} +2 -2
  27. package/dist/{config-D0GKc9sC.js → config-D5uUtrCP.js} +2 -2
  28. package/dist/{connections-DLqP5Bp1.js → connections-Do24CGP5.js} +14 -14
  29. package/dist/{conversation-BjTo9ZFL.js → conversation-SsASlWL7.js} +35 -12
  30. package/dist/{conversation-privacy-BCXFshP9.js → conversation-privacy-VuylvlKr.js} +1 -1
  31. package/dist/{credential-sync-BjihXFF2.js → credential-sync-BGQK3pOa.js} +13 -13
  32. package/dist/{db-BMZhoYKj.d.ts → db-DEiwO5Sh.d.ts} +1 -1
  33. package/dist/{executor-j8VMt-To.js → executor-hPfFTH0C.js} +13 -5
  34. package/dist/instrumentation.d.ts +14 -0
  35. package/dist/instrumentation.js +29 -6
  36. package/dist/{logging-CFHIO4Vs.js → logging-cI3T1dNc.js} +4 -2
  37. package/dist/{message-DH0cqFRS.js → message-DBwsAl7O.js} +9 -9
  38. package/dist/nitro.d.ts +2 -2
  39. package/dist/nitro.js +7 -3
  40. package/dist/{oauth-callback-server-BgU4EZsJ.js → oauth-callback-server-DXrnbplb.js} +2 -2
  41. package/dist/{plugins-B_0Cr0MO.d.ts → plugins-DtmjkTza.d.ts} +1 -0
  42. package/dist/{projection-CTvLSwcm.js → projection-7EFIqzuj.js} +4108 -3898
  43. package/dist/{prompt-JEWUUpLW.js → prompt-oRfGsxd3.js} +1 -1
  44. package/dist/{registry-OsyWR4GO.js → registry-Bzefs7kT.js} +24 -8
  45. package/dist/{resolve-DCrKjmVP.js → resolve-CuiEY_2u.js} +3 -3
  46. package/dist/{result-Btdt5bSl.js → result-DrcUtFaD.js} +9 -9
  47. package/dist/{runner-C1AwS93W.js → runner-CDE4CZ52.js} +12 -12
  48. package/dist/{sandbox-egress-signals-C-5i7Zxm.js → sandbox-egress-signals-0tcmGd13.js} +1 -1
  49. package/dist/{schema-DfdHlBnb.d.ts → schema-B6N2nc6v.d.ts} +108 -15
  50. package/dist/{schema-CX9XGKCm.js → schema-Dzi3lkdP.js} +25 -8
  51. package/dist/{service-account-DZX1KlQl.js → service-account-BOz9pqOE.js} +3 -3
  52. package/dist/{service-account-CQIW6At4.js → service-account-DIyz_9Uh.js} +3 -3
  53. package/dist/{session-stop-DjIyORJw.js → session-stop-0juF_BP0.js} +159 -55
  54. package/dist/{skills-BEfAAT6p.js → skills-CU5Is147.js} +2 -2
  55. package/dist/{spawn-Dgj4xxvO.js → spawn-6C9jHH4b.js} +2 -2
  56. package/dist/{stop-DomyNvuv.js → stop-6FVG1c-r.js} +487 -203
  57. package/dist/{store-Dp3RMEQd.js → store-DKs1WwdB.js} +3 -3
  58. package/dist/{store-B7Z6zIc7.js → store-DtHZviJ1.js} +11 -9
  59. package/dist/{task-queue-CVQ9cWnC.js → task-queue-CcvFQE_p.js} +3 -3
  60. package/dist/{task-runner-DHBG47gS.js → task-runner-DBkNejLl.js} +6 -6
  61. package/dist/{thread-state-BF8VwIxd.js → thread-state-4hjEIkIq.js} +4 -4
  62. package/dist/{turn-failure-response-Di7TbgsF.js → turn-failure-response-BZNLydC3.js} +7 -7
  63. package/dist/{turn-lifecycle-DzXwXmLg.js → turn-lifecycle-BhqYjaa4.js} +6 -1
  64. package/dist/{turn-session-routing-CIWhXKeT.js → turn-session-routing-jnLOfBHJ.js} +17 -16
  65. package/dist/{validation-BRmwRaXc.js → validation-BUFmsnKs.js} +1 -1
  66. package/dist/{version-DBVMsgvA.js → version-DJTk0ZCE.js} +1 -1
  67. package/dist/version.js +1 -1
  68. package/dist/{viewer-BFADRGP8.js → viewer-WY0RYE4E.js} +53 -15
  69. package/dist/{work-DDaoxZAw.js → work-C5AKvXJV.js} +30 -12
  70. package/dist/{worker-Bub0fDtW.js → worker-BcYVDVUy.js} +6 -6
  71. package/migrations/0073_conversation_quick_question.sql +1 -0
  72. package/migrations/0074_conversation_participant_pins.sql +1 -0
  73. package/migrations/0075_conversation_detail_version.sql +1 -0
  74. package/migrations/0076_conversation_auto_archive.sql +5 -0
  75. package/migrations/meta/0073_snapshot.json +4070 -0
  76. package/migrations/meta/0074_snapshot.json +4076 -0
  77. package/migrations/meta/0075_snapshot.json +4299 -0
  78. package/migrations/meta/0076_snapshot.json +4363 -0
  79. package/migrations/meta/_journal.json +29 -1
  80. package/package.json +5 -4
@@ -1,6 +1,6 @@
1
- import { I as getDeploymentServiceVersion, L as getDeploymentTelemetryAttributes } from "./logging-CFHIO4Vs.js";
2
- import { a as getClient, c as init, i as getActiveSpan, o as getGlobalScope, p as spanToJSON } from "./sentry-MDkYAVPV.js";
3
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-BCXFshP9.js";
1
+ import { R as getDeploymentServiceVersion, z as getDeploymentTelemetryAttributes } from "./logging-cI3T1dNc.js";
2
+ import { a as getClient, c as init, i as getActiveSpan, o as getGlobalScope, p as spanToJSON, s as getTraceData } from "./sentry-MDkYAVPV.js";
3
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-VuylvlKr.js";
4
4
  import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
5
5
  import { performance } from "node:perf_hooks";
6
6
  import { subscribe, unsubscribe } from "node:diagnostics_channel";
@@ -262,6 +262,29 @@ function getBoolean(value, fallback) {
262
262
  ].includes(normalized)) return false;
263
263
  return fallback;
264
264
  }
265
+ function getEnvironment() {
266
+ return process.env.SENTRY_ENVIRONMENT ?? process.env.VERCEL_ENV ?? process.env.NODE_ENV;
267
+ }
268
+ function getTracesSampleRate() {
269
+ return getSampleRate(process.env.SENTRY_TRACES_SAMPLE_RATE, 1);
270
+ }
271
+ /**
272
+ * Read the settings a served page needs to send browser spans to the same
273
+ * project, continuing the trace of the request that rendered it.
274
+ */
275
+ function getBrowserSentryConfig() {
276
+ const dsn = process.env.SENTRY_DSN?.trim();
277
+ if (!dsn) return void 0;
278
+ const trace = getTraceData();
279
+ return {
280
+ baggage: trace.baggage,
281
+ dsn,
282
+ environment: getEnvironment(),
283
+ release: getDeploymentServiceVersion(),
284
+ sentryTrace: trace["sentry-trace"],
285
+ tracesSampleRate: getTracesSampleRate()
286
+ };
287
+ }
265
288
  /** Initialize Sentry for the Junior runtime. Call at the top of your entry point. */
266
289
  function initSentry() {
267
290
  if (getClient()) return;
@@ -271,9 +294,9 @@ function initSentry() {
271
294
  const deploymentSpanAttributes = getDeploymentTelemetryAttributes();
272
295
  init({
273
296
  dsn,
274
- environment: process.env.SENTRY_ENVIRONMENT ?? process.env.VERCEL_ENV ?? process.env.NODE_ENV,
297
+ environment: getEnvironment(),
275
298
  release: serviceVersion,
276
- tracesSampleRate: getSampleRate(process.env.SENTRY_TRACES_SAMPLE_RATE, 1),
299
+ tracesSampleRate: getTracesSampleRate(),
277
300
  ignoreSpans: [{
278
301
  op: "http.server",
279
302
  attributes: { "url.path": "/_vercel/ping" }
@@ -290,4 +313,4 @@ function initSentry() {
290
313
  getGlobalScope().setAttributes(deploymentSpanAttributes);
291
314
  subscribeGatewayRequestTiming();
292
315
  }
293
- export { initSentry };
316
+ export { getBrowserSentryConfig, initSentry };
@@ -1,5 +1,5 @@
1
1
  import { _ as withScope, d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException } from "./sentry-MDkYAVPV.js";
2
- import { t as JUNIOR_VERSION } from "./version-DBVMsgvA.js";
2
+ import { t as JUNIOR_VERSION } from "./version-DJTk0ZCE.js";
3
3
  import path from "node:path";
4
4
  import { styleText } from "node:util";
5
5
  import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
@@ -112,6 +112,8 @@ const JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
112
112
  const JUNIOR_HEARTBEAT_CRON_SCHEDULE = "* * * * *";
113
113
  const JUNIOR_RETENTION_ROUTE = "/api/internal/retention";
114
114
  const JUNIOR_RETENTION_CRON_SCHEDULE = "0 4 * * *";
115
+ const JUNIOR_AUTO_ARCHIVE_ROUTE = "/api/internal/auto-archive";
116
+ const JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE = "17 * * * *";
115
117
  const JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE = "/api/internal/agent/continue";
116
118
  const JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE = "/api/internal/plugin/tasks";
117
119
  const JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE = "/api/internal/workspace/snapshots";
@@ -1245,4 +1247,4 @@ function extractGenAiUsageAttributes(...sources) {
1245
1247
  ...cost?.total !== void 0 ? { "app.cost.total_usd": cost.total } : void 0
1246
1248
  };
1247
1249
  }
1248
- export { JUNIOR_HEARTBEAT_ROUTE as A, isNativeIdentityProvider as B, summarizeMessageText as C, JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE as D, withSpan as E, LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION as F, isRecord as H, getDeploymentServiceVersion as I, getDeploymentTelemetryAttributes as L, JUNIOR_RETENTION_CRON_SCHEDULE as M, JUNIOR_RETENTION_ROUTE as N, JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE as O, JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE as P, runWithLogAttributes as R, setTags as S, withLogContext as T, toOptionalNumber as U, normalizeIdentityEmail as V, toOptionalString as W, runBestEffort as _, extractGenAiUsageSummary as a, setSpanAttributes as b, getLogContextAttributes as c, logAudit as d, logError as f, normalizeGenAiFinishReason as g, logWarn as h, extractGenAiUsageAttributes as i, JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE as j, JUNIOR_HEARTBEAT_CRON_SCHEDULE as k, getLogContextAttributesForSpan as l, logInfo as m, createChatSdkLogger as n, getActiveTraceContext as o, logException as p, createRequestContext as r, getActiveTraceId as s, buildTurnFailureResponse as t, getTracePropagationHeaders as u, serializeGenAiAttribute as v, withContext as w, setSpanStatus as x, setSentryUser as y, GOOGLE_IDENTITY_PROVIDER as z };
1250
+ export { JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE as A, runWithLogAttributes as B, summarizeMessageText as C, JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE as D, withSpan as E, JUNIOR_RETENTION_ROUTE as F, toOptionalNumber as G, isNativeIdentityProvider as H, JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE as I, toOptionalString as K, LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION as L, JUNIOR_HEARTBEAT_ROUTE as M, JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE as N, JUNIOR_AUTO_ARCHIVE_ROUTE as O, JUNIOR_RETENTION_CRON_SCHEDULE as P, getDeploymentServiceVersion as R, setTags as S, withLogContext as T, normalizeIdentityEmail as U, GOOGLE_IDENTITY_PROVIDER as V, isRecord as W, runBestEffort as _, extractGenAiUsageSummary as a, setSpanAttributes as b, getLogContextAttributes as c, logAudit as d, logError as f, normalizeGenAiFinishReason as g, logWarn as h, extractGenAiUsageAttributes as i, JUNIOR_HEARTBEAT_CRON_SCHEDULE as j, JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE as k, getLogContextAttributesForSpan as l, logInfo as m, createChatSdkLogger as n, getActiveTraceContext as o, logException as p, createRequestContext as r, getActiveTraceId as s, buildTurnFailureResponse as t, getTracePropagationHeaders as u, serializeGenAiAttribute as v, withContext as w, setSpanStatus as x, setSentryUser as y, getDeploymentTelemetryAttributes as z };
@@ -1,13 +1,13 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { Oa as readConversationAccessFromSql } from "./projection-CTvLSwcm.js";
3
- import { n as botConfig } from "./config-D0GKc9sC.js";
4
- import { M as SYSTEM_IDENTITY_ID, S as getDb, i as readActorIdentity, x as getConversationStore } from "./viewer-BFADRGP8.js";
5
- import { Nt as actorFromRun, Pt as toolInvocationDestination } from "./agent-runner-bE7aH7ew.js";
6
- import { A as AgentMessagePausedError, I as PARENT_AGENT_TARGET, M as AgentMessageTargetError, P as findChildAgentConversationId, i as createAgentInvocationForMessage, o as getActiveAgentInvocationForConversation } from "./store-B7Z6zIc7.js";
7
- import { T as postAutomatedTurnLimitNoticeForConversation, a as EVENT_WAIT_MS, k as admitAutomatedTurn } from "./session-stop-DjIyORJw.js";
8
- import { r as appendAndEnqueueInboundMessage } from "./store-Dp3RMEQd.js";
9
- import { r as enqueueAgentMessageToParent } from "./result-Btdt5bSl.js";
10
- import { r as enqueueAgentInvocation } from "./work-DDaoxZAw.js";
2
+ import { Na as readConversationAccessFromSql } from "./projection-7EFIqzuj.js";
3
+ import { n as botConfig } from "./config-D5uUtrCP.js";
4
+ import { M as SYSTEM_IDENTITY_ID, S as getDb, i as readActorIdentity, x as getConversationStore } from "./viewer-WY0RYE4E.js";
5
+ import { Ft as toolInvocationDestination, Pt as actorFromRun } from "./agent-runner-BsYAbniN.js";
6
+ import { F as findChildAgentConversationId, L as PARENT_AGENT_TARGET, N as AgentMessageTargetError, a as createAgentInvocationForMessage, j as AgentMessagePausedError, s as getActiveAgentInvocationForConversation } from "./store-DtHZviJ1.js";
7
+ import { D as postAutomatedTurnLimitNoticeForConversation, a as EVENT_WAIT_MS, j as admitAutomatedTurn } from "./session-stop-0juF_BP0.js";
8
+ import { r as appendAndEnqueueInboundMessage } from "./store-DKs1WwdB.js";
9
+ import { r as enqueueAgentMessageToParent } from "./result-DrcUtFaD.js";
10
+ import { i as enqueueAgentInvocation } from "./work-C5AKvXJV.js";
11
11
  // src/chat/agent-invocations/top-level-message.ts
12
12
  const AGENT_MESSAGE_EVENT_NAMESPACE = "junior";
13
13
  /** Event type of a message from another top-level agent. */
package/dist/nitro.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { i as JuniorDashboardOptions } from "./app-CgkquhZ8.js";
2
- import { n as JuniorPluginSet } from "./plugins-B_0Cr0MO.js";
1
+ import { i as JuniorDashboardOptions } from "./app-BjEQwNVP.js";
2
+ import { n as JuniorPluginSet } from "./plugins-DtmjkTza.js";
3
3
  import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
4
4
  type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
5
5
  type SentryNitroOptions = NonNullable<Parameters<typeof withSentryConfig$1>[1]>;
package/dist/nitro.js CHANGED
@@ -1,8 +1,8 @@
1
- import { A as JUNIOR_HEARTBEAT_ROUTE, D as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, I as getDeploymentServiceVersion, M as JUNIOR_RETENTION_CRON_SCHEDULE, N as JUNIOR_RETENTION_ROUTE, O as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, P as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, j as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, k as JUNIOR_HEARTBEAT_CRON_SCHEDULE } from "./logging-CFHIO4Vs.js";
1
+ import { A as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_ROUTE, I as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_ROUTE, N as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_RETENTION_CRON_SCHEDULE, R as getDeploymentServiceVersion, j as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE } from "./logging-cI3T1dNc.js";
2
2
  import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DJBompdd.js";
3
- import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic } from "./background-compaction-queue-BYuOt3qK.js";
3
+ import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic } from "./background-compaction-queue-hh18yCeU.js";
4
4
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-DOm9Y6qI.js";
5
- import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-CVQ9cWnC.js";
5
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-CcvFQE_p.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";
@@ -234,6 +234,10 @@ function configureVercelDeployment(nitro, options) {
234
234
  path: JUNIOR_RETENTION_ROUTE,
235
235
  schedule: JUNIOR_RETENTION_CRON_SCHEDULE
236
236
  });
237
+ if (!nitro.options.vercel.config.crons.some((cron) => cron.path === "/api/internal/auto-archive")) nitro.options.vercel.config.crons.push({
238
+ path: JUNIOR_AUTO_ARCHIVE_ROUTE,
239
+ schedule: JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE
240
+ });
237
241
  nitro.options.vercel.functions ??= {};
238
242
  nitro.options.vercel.functions.maxDuration = defaultMaxDuration;
239
243
  nitro.options.vercel.functionRules ??= {};
@@ -1,5 +1,5 @@
1
- import { En as createUserTokenStore } from "./projection-CTvLSwcm.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-BjihXFF2.js";
1
+ import { Dn as createUserTokenStore } from "./projection-7EFIqzuj.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-BGQK3pOa.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;
@@ -66,6 +66,7 @@ interface PluginManifestConfig {
66
66
  oauthClient?: PluginMcpConfig["oauthClient"];
67
67
  allowedTools?: string[] | null;
68
68
  wrappedTools?: string[] | null;
69
+ auditTools?: string[] | null;
69
70
  } | null;
70
71
  oauth?: PluginOAuthConfigPatch | null;
71
72
  accounts?: {