@sentry/junior 0.277.0 → 0.279.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 (91) hide show
  1. package/dist/{adapter-BtfBHVM5.js → adapter-phTTgw7H.js} +1 -1
  2. package/dist/{admin-DzAKbZsm.js → admin-PcpJDugZ.js} +1 -1
  3. package/dist/{agent-invocations-Crs3XHhg.js → agent-invocations-CUg_SODU.js} +0 -1
  4. package/dist/{agent-runner-BsYAbniN.js → agent-runner-DwvT1BY0.js} +321 -847
  5. package/dist/api/schema.d.ts +2 -2
  6. package/dist/api/schema.js +6 -6
  7. package/dist/api.d.ts +1 -1
  8. package/dist/api.js +46 -414
  9. package/dist/{app-BjEQwNVP.d.ts → app-DVs6noo7.d.ts} +6 -27
  10. package/dist/app.d.ts +2 -2
  11. package/dist/app.js +460 -78
  12. package/dist/{assistant-reply-NebRGG4G.js → assistant-reply-BXfxczd7.js} +28 -6
  13. package/dist/{automation-Cql9h2vO.js → automation-BehArCcq.js} +1 -1
  14. package/dist/{background-compaction-queue-hh18yCeU.js → background-compaction-queue-CcbuLJrZ.js} +2 -2
  15. package/dist/{briefs-BBo0Eimi.js → briefs-Dd_ezwED.js} +10 -10
  16. package/dist/{catalog-runtime-DE-F4Awo.js → catalog-runtime-BWVMeZhW.js} +2 -2
  17. package/dist/cli/chat.js +16 -16
  18. package/dist/cli/check.js +3 -3
  19. package/dist/cli/init.js +0 -2
  20. package/dist/cli/main.js +4 -4
  21. package/dist/cli/plugins.js +5 -5
  22. package/dist/cli/snapshot-create.js +4 -4
  23. package/dist/cli/upgrade.d.ts +1 -1
  24. package/dist/cli/upgrade.js +4 -4
  25. package/dist/{client-DZ8HTnYH.js → client-Bpxe4vKa.js} +8 -4
  26. package/dist/{config-D5uUtrCP.js → config-C_bmRhrJ.js} +25 -100
  27. package/dist/{connections-Do24CGP5.js → connections-B2rHe5W5.js} +10 -10
  28. package/dist/{conversation-SsASlWL7.js → conversation-CIiJtx5q.js} +56 -104
  29. package/dist/conversation-pending-messages-CnBvE6-6.js +173 -0
  30. package/dist/{conversation-privacy-VuylvlKr.js → conversation-privacy-CzOfcz0U.js} +1 -1
  31. package/dist/{credential-sync-BGQK3pOa.js → credential-sync-Dal_unpv.js} +15 -15
  32. package/dist/{db-DEiwO5Sh.d.ts → db-CyLrV9C7.d.ts} +1 -1
  33. package/dist/{executor-hPfFTH0C.js → executor-BfYH-Wws.js} +6 -4
  34. package/dist/instrumentation.d.ts +12 -0
  35. package/dist/instrumentation.js +56 -23
  36. package/dist/{logging-cI3T1dNc.js → logging-CkT3_Xxp.js} +2 -2
  37. package/dist/{media-DstkkoNP.js → media-DTAA8Qs_.js} +21 -23
  38. package/dist/{message-DBwsAl7O.js → message-Q5dkgaJ5.js} +23 -29
  39. package/dist/nitro.d.ts +1 -1
  40. package/dist/nitro.js +18 -6
  41. package/dist/{oauth-callback-server-DXrnbplb.js → oauth-callback-server-BDRaqe8O.js} +2 -2
  42. package/dist/{oauth-relay-C6ZAyJgf.js → oauth-relay-D0G3T16m.js} +1 -1
  43. package/dist/{package-discovery-DJBompdd.js → package-discovery-DJhGdS4c.js} +1 -1
  44. package/dist/{plugins-DOm9Y6qI.js → plugins-HYh_JOdw.js} +1 -1
  45. package/dist/{projection-7EFIqzuj.js → projection-DWxX7pb1.js} +214 -138
  46. package/dist/{prompt-oRfGsxd3.js → prompt--dwus7Y-.js} +1 -1
  47. package/dist/proxy-path-BHYoKZdq.js +15 -0
  48. package/dist/{registry-Bzefs7kT.js → registry-DnrdeO4s.js} +2 -2
  49. package/dist/{resolve-CuiEY_2u.js → resolve-C_QXfqD_.js} +3 -3
  50. package/dist/{result-DrcUtFaD.js → result-DNmOxT-N.js} +10 -10
  51. package/dist/{runner-CDE4CZ52.js → runner-zd_noJ1l.js} +11 -11
  52. package/dist/{sandbox-egress-signals-0tcmGd13.js → sandbox-egress-signals-DQjv-nbG.js} +1 -1
  53. package/dist/{schema-Dzi3lkdP.js → schema-CNJNzvr8.js} +4 -4
  54. package/dist/{schema-B6N2nc6v.d.ts → schema-e90H5FIN.d.ts} +2176 -967
  55. package/dist/sentry-BRTJqumy.js +51 -0
  56. package/dist/sentry-DrKC2NeM.d.ts +1 -0
  57. package/dist/sentry-route-name-BhwWnfqj.js +51 -0
  58. package/dist/{service-account-BOz9pqOE.js → service-account-BK26XlHo.js} +3 -3
  59. package/dist/{service-account-DIyz_9Uh.js → service-account-CCH2Hv4h.js} +3 -3
  60. package/dist/{session-stop-0juF_BP0.js → session-stop-6Tf--T7G.js} +23 -16
  61. package/dist/{skills-CU5Is147.js → skills-BNrk8gi4.js} +4 -4
  62. package/dist/{spawn-6C9jHH4b.js → spawn-C75hAB9l.js} +3 -4
  63. package/dist/{stop-6FVG1c-r.js → stop-RYbf7PWi.js} +742 -207
  64. package/dist/{store-DtHZviJ1.js → store-CO5vGjwD.js} +9 -16
  65. package/dist/{store-DKs1WwdB.js → store-G3h2djJU.js} +3 -3
  66. package/dist/{task-queue-CcvFQE_p.js → task-queue-DlN58XeM.js} +3 -3
  67. package/dist/{task-runner-DBkNejLl.js → task-runner-B-Bdm23d.js} +22 -10
  68. package/dist/{thread-state-4hjEIkIq.js → thread-state-Cj_7Slru.js} +4 -4
  69. package/dist/{turn-failure-response-BZNLydC3.js → turn-failure-response-CE7gaoC7.js} +7 -7
  70. package/dist/{turn-lifecycle-BhqYjaa4.js → turn-lifecycle-7sXwXLJ6.js} +1 -1
  71. package/dist/{turn-session-routing-jnLOfBHJ.js → turn-session-routing-FBdaH1zf.js} +10 -10
  72. package/dist/{validation-BUFmsnKs.js → validation-DLWxEzWW.js} +2 -2
  73. package/dist/{version-DJTk0ZCE.js → version-DtQ8WFIZ.js} +1 -1
  74. package/dist/version.js +1 -1
  75. package/dist/{viewer-WY0RYE4E.js → viewer-vsM8_90o.js} +53 -22
  76. package/dist/{work-C5AKvXJV.js → work-DsoFRO_0.js} +12 -17
  77. package/dist/{worker-BcYVDVUy.js → worker-6kZEsCXs.js} +7 -7
  78. package/migrations/0077_drop_agent_invocation_model_profile.sql +1 -0
  79. package/migrations/0078_plugin_conversation_index.sql +20 -0
  80. package/migrations/0079_conversation_event_author_index.sql +20 -0
  81. package/migrations/meta/0075_snapshot.json +98 -314
  82. package/migrations/meta/0076_snapshot.json +98 -314
  83. package/migrations/meta/0077_snapshot.json +4141 -0
  84. package/migrations/meta/0078_snapshot.json +4175 -0
  85. package/migrations/meta/0079_snapshot.json +4203 -0
  86. package/migrations/meta/_journal.json +22 -1
  87. package/package.json +5 -5
  88. package/dist/common-Eu6sx09c.js +0 -107
  89. package/dist/model-profile-B998sjVd.js +0 -67
  90. package/dist/rolldown-runtime-nwUcYXjP.js +0 -27
  91. package/dist/sentry-MDkYAVPV.js +0 -23
@@ -0,0 +1,51 @@
1
+ import "node:module";
2
+ import { captureException, captureMessage, continueTrace, flush, getActiveSpan, getClient, getGlobalScope, getTraceData, init, logger, setTag, setUser, spanToJSON, startInactiveSpan, startSpan, startSpanManual, withActiveSpan, withScope } from "@sentry/node";
3
+ // \0rolldown/runtime.js
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __exportAll = (all, no_symbols) => {
9
+ let target = {};
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
15
+ return target;
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
19
+ key = keys[i];
20
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
21
+ get: ((k) => from[k]).bind(null, key),
22
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
23
+ });
24
+ }
25
+ return to;
26
+ };
27
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
28
+ // src/chat/sentry.ts
29
+ var sentry_exports = /* @__PURE__ */ __exportAll({
30
+ captureException: () => captureException,
31
+ captureMessage: () => captureMessage,
32
+ continueTrace: () => continueTrace,
33
+ flush: () => flush,
34
+ getActiveSpan: () => getActiveSpan,
35
+ getClient: () => getClient,
36
+ getGlobalScope: () => getGlobalScope,
37
+ getTraceData: () => getTraceData,
38
+ init: () => init,
39
+ logger: () => logger,
40
+ setTag: () => setTag,
41
+ setUser: () => setUser,
42
+ spanToJSON: () => spanToJSON,
43
+ startInactiveSpan: () => startInactiveSpan,
44
+ startSpan: () => startSpan,
45
+ startSpanManual: () => startSpanManual,
46
+ withActiveSpan: () => withActiveSpan,
47
+ withScope: () => withScope
48
+ });
49
+ import * as import__sentry_node from "@sentry/node";
50
+ __reExport(sentry_exports, import__sentry_node);
51
+ export { withScope as _, getClient as a, init as c, setTag as d, setUser as f, withActiveSpan as g, startSpan as h, getActiveSpan as i, logger as l, startInactiveSpan as m, captureMessage as n, getGlobalScope as o, spanToJSON as p, continueTrace as r, getTraceData as s, captureException as t, sentry_exports as u, __exportAll as v };
@@ -0,0 +1 @@
1
+ import "@sentry/node";
@@ -0,0 +1,51 @@
1
+ import { i as getActiveSpan, u as sentry_exports } from "./sentry-BRTJqumy.js";
2
+ import { matchedRoutes } from "hono/route";
3
+ // src/chat/sentry-route-name.ts
4
+ const HTTP_ROUTE_ATTRIBUTE = "app.http.route";
5
+ const COMPOSED_HANDLER = "__COMPOSED_HANDLER";
6
+ /**
7
+ * Name the current request span after a route pattern. Spans that end during
8
+ * the request take this name as their segment name.
9
+ */
10
+ function nameRequestRoute(method, route) {
11
+ const activeSpan = getActiveSpan();
12
+ if (!activeSpan) return;
13
+ const rootSpan = sentry_exports.getRootSpan(activeSpan);
14
+ const name = `${method} ${route}`;
15
+ sentry_exports.updateSpanName(rootSpan, name);
16
+ rootSpan.setAttribute(HTTP_ROUTE_ATTRIBUTE, route);
17
+ sentry_exports.getIsolationScope().setTransactionName(name);
18
+ }
19
+ function isMiddleware(handler) {
20
+ if (typeof handler !== "function") return false;
21
+ const composed = COMPOSED_HANDLER in handler ? handler[COMPOSED_HANDLER] : void 0;
22
+ return (typeof composed === "function" ? composed : handler).length >= 2;
23
+ }
24
+ /**
25
+ * Name the request span after the first route handler that matches in this
26
+ * app. Register it first in an app that another app calls through `fetch()`.
27
+ */
28
+ function routeNameMiddleware() {
29
+ return async function routeName(c, next) {
30
+ const route = matchedRoutes(c).find(({ handler }) => !isMiddleware(handler));
31
+ if (route) nameRequestRoute(c.req.method, route.path);
32
+ await next();
33
+ };
34
+ }
35
+ /**
36
+ * Restore the inner route name on a sent `http.server` segment. The outer
37
+ * Hono app renames the span to its own pattern after the inner app returns.
38
+ */
39
+ function promoteHttpRouteName(span) {
40
+ const { attributes } = span;
41
+ const route = attributes[HTTP_ROUTE_ATTRIBUTE];
42
+ const method = attributes["http.request.method"];
43
+ if (!span.is_segment || attributes["sentry.op"] !== "http.server") return;
44
+ if (typeof route !== "string" || typeof method !== "string") return;
45
+ const name = `${method} ${route}`;
46
+ span.name = name;
47
+ attributes["http.route"] = route;
48
+ attributes["sentry.segment.name"] = name;
49
+ delete attributes[HTTP_ROUTE_ATTRIBUTE];
50
+ }
51
+ export { promoteHttpRouteName as n, routeNameMiddleware as r, nameRequestRoute as t };
@@ -1,6 +1,6 @@
1
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DE-F4Awo.js";
2
- import { t as disconnectStateAdapter } from "./adapter-BtfBHVM5.js";
3
- import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-DIyz_9Uh.js";
1
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BWVMeZhW.js";
2
+ import { t as disconnectStateAdapter } from "./adapter-phTTgw7H.js";
3
+ import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-CCH2Hv4h.js";
4
4
  import { CLI_USAGE } from "./cli/run.js";
5
5
  import { createServer } from "node:http";
6
6
  // src/cli/service-account.ts
@@ -1,7 +1,7 @@
1
- import { W as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-cI3T1dNc.js";
2
- import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-Bzefs7kT.js";
1
+ import { W as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-CkT3_Xxp.js";
2
+ import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-DnrdeO4s.js";
3
3
  import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
4
- import { r as getStateAdapter } from "./adapter-BtfBHVM5.js";
4
+ import { r as getStateAdapter } from "./adapter-phTTgw7H.js";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
6
6
  import { randomUUID } from "node:crypto";
7
7
  import { UnauthorizedError, auth } from "@modelcontextprotocol/sdk/client/auth.js";
@@ -1,17 +1,17 @@
1
- import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { Bn as getPlugins, Br as verifyTimerWatchCredentialSubject, Hr as getDashboardConversationLink, I as normalizeConversationText, In as getPluginSlackConversationLink, Mi as postSlackMessage, Si as normalizeSlackReplyMarkdown, Ur as getDashboardObjectIconLink, Vr as JUNIOR_THREAD_STATE_TTL_MS, an as normalizeToolNameFromResult, bi as escapeSlackMrkdwnText, en as isAssistantMessage, in as isToolResultMessage, qa as buildSentryConversationUrl, qr as ToolInputError, rn as isToolResultError, xi as formatSlackLink } from "./projection-7EFIqzuj.js";
3
- import { n as botConfig } from "./config-D5uUtrCP.js";
4
- import { h as logWarn, m as logInfo, p as logException } from "./logging-cI3T1dNc.js";
5
- import { C as getSqlExecutor, G as nextDetailVersion, M as SYSTEM_IDENTITY_ID, x as getConversationStore } from "./viewer-WY0RYE4E.js";
6
- import { s as juniorConversations } from "./agent-invocations-Crs3XHhg.js";
7
- import "./executor-hPfFTH0C.js";
8
- import { h as credentialSubjectSchema } from "./registry-Bzefs7kT.js";
9
- import { r as getStateAdapter } from "./adapter-BtfBHVM5.js";
10
- import { W as readMessageAttachments } from "./conversation-SsASlWL7.js";
11
- import { r as EVENT_AUTHOR_ID } from "./prompt-oRfGsxd3.js";
12
- import { r as sanitizeAssistantText } from "./assistant-reply-NebRGG4G.js";
13
- import { r as appendAndEnqueueInboundMessage } from "./store-DKs1WwdB.js";
14
- import { dt as CORE_EVENT_NAMESPACE, ht as eventGuidance, mt as eventCatalogEntry } from "./turn-session-routing-jnLOfBHJ.js";
1
+ import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
+ import { Br as getDashboardObjectIconLink, Ln as getPlugins, Lr as verifyTimerWatchCredentialSubject, N as normalizeConversationText, Nn as getPluginSlackConversationLink, Rr as JUNIOR_THREAD_STATE_TTL_MS, Wr as ToolInputError, Xa as buildSentryConversationUrl, Zt as isAssistantMessage, _i as escapeSlackMrkdwnText, en as isToolResultError, ki as postSlackMessage, nn as normalizeToolNameFromResult, tn as isToolResultMessage, vi as formatSlackLink, yi as normalizeSlackReplyMarkdown, zr as getDashboardConversationLink } from "./projection-DWxX7pb1.js";
3
+ import { n as botConfig } from "./config-C_bmRhrJ.js";
4
+ import { h as logWarn, m as logInfo, p as logException } from "./logging-CkT3_Xxp.js";
5
+ import { C as getSqlExecutor, F as SYSTEM_IDENTITY_ID, J as nextDetailVersion, x as getConversationStore } from "./viewer-vsM8_90o.js";
6
+ import { s as juniorConversations } from "./agent-invocations-CUg_SODU.js";
7
+ import "./executor-BfYH-Wws.js";
8
+ import { h as credentialSubjectSchema } from "./registry-DnrdeO4s.js";
9
+ import { r as getStateAdapter } from "./adapter-phTTgw7H.js";
10
+ import { R as readMessageAttachments } from "./conversation-CIiJtx5q.js";
11
+ import { r as EVENT_AUTHOR_ID } from "./prompt--dwus7Y-.js";
12
+ import { a as QUIET_MARKER, r as sanitizeAssistantText } from "./assistant-reply-BXfxczd7.js";
13
+ import { r as appendAndEnqueueInboundMessage } from "./store-G3h2djJU.js";
14
+ import { dt as CORE_EVENT_NAMESPACE, ht as eventGuidance, mt as eventCatalogEntry } from "./turn-session-routing-FBdaH1zf.js";
15
15
  import { z } from "zod";
16
16
  import { eq, inArray } from "drizzle-orm";
17
17
  import { agentEventKeys, eventMatchFieldsSchema, objectFactFields, objectPresentation, objectTypeSchema } from "@sentry/junior-plugin-api";
@@ -715,10 +715,17 @@ async function maybePostAutomatedTurnLimitNotice(args) {
715
715
  */
716
716
  /**
717
717
  * Shared closing lines. Automations pass outcomes and end with a declared
718
- * result. Watches follow the Conversation's reply rules.
718
+ * result. Watches follow the Conversation's reply rules. A Watch reply goes
719
+ * only to the Conversation, so a question asked in the provider must also get
720
+ * its answer there. Watch instructions often say to stay silent, so this rule
721
+ * sits in the contract, not in plugin guidance.
719
722
  */
720
723
  function replyContractLines(outcomes) {
721
- if (!outcomes) return ["When you reply, follow any reply format in the instructions."];
724
+ if (!outcomes) return [
725
+ "When an Event asks you a question, answer it where it was asked, with that provider's tool. Then reply with the answer and a link to it.",
726
+ "When you reply, follow any reply format in the instructions.",
727
+ `When the outcome needs nobody's attention, such as a routine fix that worked or feedback that you handled, end the reply with exactly ${QUIET_MARKER}. The reply stays in the Conversation but notifies nobody. Do not use it when a person must decide or act, or when something failed.`
728
+ ];
722
729
  return [`End with \`${FINISH_AUTOMATION_RUN_TOOL_NAME}\`.`];
723
730
  }
724
731
  function verifiedDetailsJson(details) {
@@ -1,7 +1,7 @@
1
- import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { h as logWarn } from "./logging-cI3T1dNc.js";
3
- import { s as skillRoots } from "./package-discovery-DJBompdd.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DE-F4Awo.js";
1
+ import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
+ import { h as logWarn } from "./logging-CkT3_Xxp.js";
3
+ import { s as skillRoots } from "./package-discovery-DJhGdS4c.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BWVMeZhW.js";
5
5
  import path from "node:path";
6
6
  import { z } from "zod";
7
7
  import fs from "node:fs/promises";
@@ -1,6 +1,6 @@
1
- import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { Ft as toolInvocationDestination, Pt as actorFromRun } from "./agent-runner-BsYAbniN.js";
3
- import { n as createAndEnqueueAgentInvocation } from "./work-C5AKvXJV.js";
1
+ import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
+ import { Ft as toolInvocationDestination, Pt as actorFromRun } from "./agent-runner-DwvT1BY0.js";
3
+ import { n as createAndEnqueueAgentInvocation } from "./work-DsoFRO_0.js";
4
4
  // src/chat/agent-invocations/spawn.ts
5
5
  var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
6
6
  /** Bind a Run's Actor and credentials to new Agent invocations. */
@@ -18,7 +18,6 @@ function bindSpawnAgent(run, options) {
18
18
  destination: toolInvocationDestination(run),
19
19
  idempotencyKey: `${run.turnId}:${call.toolCallId}`,
20
20
  input: input.task,
21
- modelProfile: input.profile,
22
21
  parentConversationId: run.conversationId,
23
22
  parentToolCallId: call.toolCallId,
24
23
  ...input.reasoningLevel ? { reasoningLevel: input.reasoningLevel } : void 0,