@sentry/junior 0.257.0 → 0.259.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 (104) hide show
  1. package/dist/{actor-BTtLaeWy.js → actor-tlxzqaRe.js} +3 -6
  2. package/dist/adapter-Bn0gFVSF.js +270 -0
  3. package/dist/{admin-DgIkm6Vy.js → admin-C8xz2f10.js} +2 -3
  4. package/dist/{agent-hooks-BjtTzvru.js → agent-hooks-B00FaKdP.js} +70 -109
  5. package/dist/{agent-invocations-Bdu3ROfo.js → agent-invocations-Qfz7dWgU.js} +6 -12
  6. package/dist/{agent-runner-D7OboVb3.js → agent-runner-CPSd7rKm.js} +324 -742
  7. package/dist/api/schema.d.ts +442 -447
  8. package/dist/api/schema.js +6 -6
  9. package/dist/api.d.ts +2 -12
  10. package/dist/api.js +165 -158
  11. package/dist/{app-BsU5QNBd.d.ts → app-Bbxrehjf.d.ts} +25 -45
  12. package/dist/app.d.ts +3 -3
  13. package/dist/app.js +206 -321
  14. package/dist/{assistant-reply-CbTPebzL.js → assistant-reply-CqthTerd.js} +3 -5
  15. package/dist/{automation-CHdlHVZP.js → automation-DWBFBenG.js} +6 -11
  16. package/dist/{briefs-oLOldnDM.js → briefs-DNYbQ9cD.js} +8 -11
  17. package/dist/{cadence-D00SCzT1.js → cadence-R7Em4RjE.js} +1 -2
  18. package/dist/{catalog-runtime-CZzhGQ7F.js → catalog-runtime-B8SuFPGb.js} +3 -4
  19. package/dist/cli/chat.d.ts +2 -4
  20. package/dist/cli/chat.js +22 -24
  21. package/dist/cli/check.d.ts +1 -3
  22. package/dist/cli/check.js +4 -5
  23. package/dist/cli/env.d.ts +1 -3
  24. package/dist/cli/env.js +1 -2
  25. package/dist/cli/init.d.ts +1 -3
  26. package/dist/cli/init.js +3 -3
  27. package/dist/cli/main.d.ts +1 -3
  28. package/dist/cli/main.js +8 -5
  29. package/dist/cli/plugins.d.ts +2 -4
  30. package/dist/cli/plugins.js +7 -8
  31. package/dist/cli/run.d.ts +3 -3
  32. package/dist/cli/run.js +3 -3
  33. package/dist/cli/snapshot-create.d.ts +1 -3
  34. package/dist/cli/snapshot-create.js +5 -5
  35. package/dist/cli/upgrade.d.ts +3 -6
  36. package/dist/cli/upgrade.js +11 -17
  37. package/dist/{client-D8HnkOQX.js → client-BZdxgKyL.js} +64 -18
  38. package/dist/{config-CJRnWK9H.js → config-Deqpfpg9.js} +21 -15
  39. package/dist/{connections-ClYrKzpX.js → connections-9gJkfS85.js} +179 -20
  40. package/dist/{conversation-CKNLYBJt.js → conversation-DjN3mlog.js} +8 -15
  41. package/dist/{conversation-privacy-C8b1nphZ.js → conversation-privacy-CFhNKxp-.js} +2 -3
  42. package/dist/{conversation-work-C6y3T5Hx.js → conversation-work-BaT_T6EB.js} +1 -2
  43. package/dist/{credential-sync-BXfohNmJ.js → credential-sync-BABGymK3.js} +23 -190
  44. package/dist/{db-Ca9Nt5ci.d.ts → db-BnRqQ7G5.d.ts} +1 -1
  45. package/dist/{executor-Do0THDRR.js → executor-Bb3eQb8q.js} +30 -52
  46. package/dist/{experimental-CQIvMUO7.js → experimental-BNK1l1jv.js} +2 -4
  47. package/dist/{history-9pO1Zd4Y.js → history-AY8rs-FR.js} +5 -9
  48. package/dist/{history-DvqWZlYX.d.ts → history-BgI33Kie.d.ts} +12 -20
  49. package/dist/{images-BN_BiBXF.js → images-BbSdVHC6.js} +5 -6
  50. package/dist/instrumentation.d.ts +1 -3
  51. package/dist/instrumentation.js +6 -8
  52. package/dist/{job-queue-B6SV9uVa.js → job-queue-vdGU-5ge.js} +6 -12
  53. package/dist/{logging-CWxiIuCF.js → logging-BStXN56b.js} +7 -12
  54. package/dist/{message-TUOdbSBW.js → message-DRf6m4uO.js} +5 -6
  55. package/dist/{model-profile-BwU8mqwD.js → model-profile-Bg8EoCKD.js} +2 -4
  56. package/dist/nitro.d.ts +3 -5
  57. package/dist/nitro.js +12 -17
  58. package/dist/{oauth-authorization-BA4Dt6a7.js → oauth-authorization-djQn5Nhy.js} +2 -4
  59. package/dist/{oauth-callback-server-Dj5UJODo.js → oauth-callback-server-JmOgLcGl.js} +3 -4
  60. package/dist/{oauth-relay-CdCnu80W.js → oauth-relay-CTygMkNx.js} +2 -3
  61. package/dist/{package-discovery-BVvSnQBB.js → package-discovery-DJBompdd.js} +17 -21
  62. package/dist/{pending-auth-s_QFribU.js → pending-auth-rG5U_QS1.js} +92 -83
  63. package/dist/{plugin-module-CVvEUSMH.js → plugin-module-Cf5gVPWP.js} +1 -2
  64. package/dist/{plugins-CjfUP5gJ.d.ts → plugins-B_0Cr0MO.d.ts} +5 -5
  65. package/dist/{plugins-egKWjgue.js → plugins-DOm9Y6qI.js} +2 -3
  66. package/dist/{private-trace-result-BLvBjy_e.js → private-trace-result-CE7_lEdq.js} +1 -2
  67. package/dist/{profile-h-72wM78.js → profile-qBM6B_-V.js} +14 -295
  68. package/dist/{prompt-DyoEj9c2.js → prompt-xgpyMtg7.js} +5 -9
  69. package/dist/{queue-B5SnqRln.d.ts → queue-C37RbDVc.d.ts} +0 -2
  70. package/dist/{registry-sLTr-sV9.js → registry-B_M_x_iS.js} +56 -30
  71. package/dist/{resolve-ncQPZROQ.js → resolve-BzpuLh8c.js} +8 -12
  72. package/dist/{result-C883vngT.js → result-DEZH_AnZ.js} +13 -17
  73. package/dist/{rolldown-runtime-B4FMCO8f.js → rolldown-runtime-nwUcYXjP.js} +1 -2
  74. package/dist/{runner-CzYImdOF.js → runner-BqQlG10t.js} +12 -13
  75. package/dist/{sandbox-egress-signals-CZbMINHI.js → sandbox-egress-signals-DCq3WLs5.js} +2 -3
  76. package/dist/{schema-Dy69D4Ge.js → schema-CF9HqNRY.js} +30 -27
  77. package/dist/{sentry-CgWZM_kV.js → sentry-BBUlHih9.js} +2 -3
  78. package/dist/service-account-BqTBkyD7.js +120 -0
  79. package/dist/service-account-BzhW7kXu.js +661 -0
  80. package/dist/{session-stop-CQjKd4a2.js → session-stop-CV65ZlU3.js} +23 -33
  81. package/dist/{skills-C22SLruK.js → skills-CiWS5_Ub.js} +9 -9
  82. package/dist/{spawn-DY9CLXDL.js → spawn-BSAQ7UQZ.js} +4 -5
  83. package/dist/{store-DXFIQy-G.js → store-B1GES4gC.js} +13 -15
  84. package/dist/{store-DoewL5mG.d.ts → store-CG0VJyye.d.ts} +0 -14
  85. package/dist/{task-queue-B17vV0La.js → task-queue-BAeGEMjJ.js} +5 -7
  86. package/dist/{task-runner-DUjvzYXj.js → task-runner-BlGhcQPi.js} +22 -26
  87. package/dist/{tasks-D_WIJtvO.js → tasks-DieKX3d4.js} +63 -78
  88. package/dist/{thread-state-Ch4yuCqG.js → thread-state-DpSWS4Rr.js} +13 -19
  89. package/dist/{turn-failure-response-C5nBKC4S.js → turn-failure-response-DQljogGJ.js} +16 -22
  90. package/dist/{turn-lifecycle-CO-ylUmV.js → turn-lifecycle-BLgrkV_L.js} +2 -3
  91. package/dist/{turn-session-routing-B3LWooK5.js → turn-session-routing-BlajheOU.js} +2 -3
  92. package/dist/{validation-CXYxaNYx.js → validation-23d7K9tX.js} +3 -4
  93. package/dist/vercel.d.ts +1 -3
  94. package/dist/vercel.js +1 -2
  95. package/dist/{version-BcdZy2zg.js → version-B_XumRx-.js} +3 -5
  96. package/dist/{version-CnXZ614E.d.ts → version-Cc2OFd9G.d.ts} +0 -2
  97. package/dist/version.d.ts +1 -1
  98. package/dist/version.js +1 -2
  99. package/dist/{viewer-DSZXygMU.js → viewer-B2_ABsYi.js} +26 -57
  100. package/dist/{web-input-B9Bv0_lR.js → web-input-BZDyxpzR.js} +101 -158
  101. package/dist/{web-message-id-xPI_EFSC.js → web-message-id-CJSUiksE.js} +3 -6
  102. package/dist/{work-nAfDSUFP.js → work-D3QKiV0O.js} +14 -16
  103. package/dist/{worker-vGXZ6XFT.js → worker-C8mUjYf9.js} +7 -8
  104. package/package.json +10 -9
@@ -1,4 +1,2 @@
1
- //#region src/instrumentation.d.ts
2
1
  /** Initialize Sentry for the Junior runtime. Call at the top of your entry point. */
3
- export declare function initSentry(): void;
4
- //#endregion
2
+ export declare function initSentry(): void;
@@ -1,8 +1,8 @@
1
- import { F as getDeploymentTelemetryAttributes, P as getDeploymentServiceVersion } from "./logging-CWxiIuCF.js";
2
- import { _ as vercelAIIntegration, a as getClient, b as withStreamedSpan, c as init, o as getGlobalScope } from "./sentry-CgWZM_kV.js";
3
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-C8b1nphZ.js";
4
- import { t as consumePrivateTraceResultMarker } from "./private-trace-result-BLvBjy_e.js";
5
- //#region src/chat/sentry-payload-filter.ts
1
+ import { F as getDeploymentTelemetryAttributes, P as getDeploymentServiceVersion } from "./logging-BStXN56b.js";
2
+ import { _ as vercelAIIntegration, a as getClient, b as withStreamedSpan, c as init, o as getGlobalScope } from "./sentry-BBUlHih9.js";
3
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-CFhNKxp-.js";
4
+ import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
5
+ // src/chat/sentry-payload-filter.ts
6
6
  const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
7
7
  "app.message.input",
8
8
  "app.message.output",
@@ -106,8 +106,7 @@ function scrubPrivateSentryLog(log) {
106
106
  scrubContainer(log);
107
107
  return log;
108
108
  }
109
- //#endregion
110
- //#region src/instrumentation.ts
109
+ // src/instrumentation.ts
111
110
  function getSampleRate(value, fallback) {
112
111
  if (!value) return fallback;
113
112
  const parsed = Number(value);
@@ -160,5 +159,4 @@ function initSentry() {
160
159
  });
161
160
  getGlobalScope().setAttributes(deploymentSpanAttributes);
162
161
  }
163
- //#endregion
164
162
  export { initSentry };
@@ -1,4 +1,4 @@
1
- import { i as getChatConfig } from "./config-CJRnWK9H.js";
1
+ import { i as getChatConfig } from "./config-Deqpfpg9.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  import { z } from "zod";
4
4
  import { createHash, createHmac, timingSafeEqual } from "node:crypto";
@@ -22,8 +22,7 @@ var ConversationQueueMessageRejectedError = class extends Error {
22
22
  function isConversationQueueMessageRejectedError(error) {
23
23
  return error instanceof ConversationQueueMessageRejectedError;
24
24
  }
25
- //#endregion
26
- //#region src/chat/runtime/request-deadline.ts
25
+ // src/chat/runtime/request-deadline.ts
27
26
  const requestDeadlineStorage = new AsyncLocalStorage();
28
27
  function createTurnRequestDeadline(startedAtMs) {
29
28
  return {
@@ -40,8 +39,7 @@ function runWithTurnRequestDeadline(callback, startedAtMs = Date.now()) {
40
39
  if (requestDeadlineStorage.getStore()) return callback();
41
40
  return requestDeadlineStorage.run(createTurnRequestDeadline(startedAtMs), callback);
42
41
  }
43
- //#endregion
44
- //#region src/chat/vercel-queue-client.ts
42
+ // src/chat/vercel-queue-client.ts
45
43
  function defaultQueueClientOptions() {
46
44
  if (process.env.VERCEL_DEPLOYMENT_ID?.trim()) return {};
47
45
  return { deploymentId: null };
@@ -50,8 +48,7 @@ function defaultQueueClientOptions() {
50
48
  function createVercelQueueClient() {
51
49
  return new QueueClient(defaultQueueClientOptions());
52
50
  }
53
- //#endregion
54
- //#region src/chat/queue/sign.ts
51
+ // src/chat/queue/sign.ts
55
52
  /** Sign and check queue messages before public callbacks run them. */
56
53
  const QUEUE_SIGNATURE_MAX_AGE_MS = 36e5;
57
54
  function secret() {
@@ -137,8 +134,7 @@ function verifyQueueMessage(config, value, nowMs = Date.now()) {
137
134
  message: message.data
138
135
  };
139
136
  }
140
- //#endregion
141
- //#region src/chat/task-execution/queue-signing.ts
137
+ // src/chat/task-execution/queue-signing.ts
142
138
  const conversationQueueSign = {
143
139
  context: "junior.conversation_work_queue.v2",
144
140
  schema: conversationQueueMessageSchema,
@@ -183,8 +179,7 @@ function getVercelConversationWorkQueue() {
183
179
  defaultQueue ??= createVercelConversationWorkQueue();
184
180
  return defaultQueue;
185
181
  }
186
- //#endregion
187
- //#region src/chat/sandbox/snapshot/job-queue.ts
182
+ // src/chat/sandbox/snapshot/job-queue.ts
188
183
  /** Send Workspace snapshot build messages. */
189
184
  const SIGNATURE_CONTEXT = "junior.workspace_snapshot_queue.v1";
190
185
  const SIGNATURE_VERSION = "v1";
@@ -222,5 +217,4 @@ async function sendWorkspaceSnapshotJob(message) {
222
217
  async function sendNextWorkspaceSnapshotJob(message) {
223
218
  await send(message);
224
219
  }
225
- //#endregion
226
220
  export { getVercelConversationWorkQueue as a, QUEUE_SIGNATURE_MAX_AGE_MS as c, createVercelQueueClient as d, getTurnRequestDeadline as f, isConversationQueueMessageRejectedError as g, conversationQueueMessageSchema as h, verifyWorkspaceSnapshotJobMessage as i, signQueueMessage as l, ConversationQueueMessageRejectedError as m, sendNextWorkspaceSnapshotJob as n, resolveConversationWorkQueueTopic as o, runWithTurnRequestDeadline as p, sendWorkspaceSnapshotJob as r, verifyConversationQueueMessage as s, WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC as t, verifyQueueMessage as u };
@@ -1,10 +1,10 @@
1
- import { 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, y as withScope } from "./sentry-CgWZM_kV.js";
2
- import { t as JUNIOR_VERSION } from "./version-BcdZy2zg.js";
1
+ import { 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, y as withScope } from "./sentry-BBUlHih9.js";
2
+ import { t as JUNIOR_VERSION } from "./version-B_XumRx-.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";
6
6
  import { AsyncLocalStorage } from "node:async_hooks";
7
- //#region src/chat/coerce.ts
7
+ // src/chat/coerce.ts
8
8
  /** Narrow an unknown value to a non-empty string, or undefined. */
9
9
  function toOptionalString(value) {
10
10
  return typeof value === "string" && value.trim() ? value : void 0;
@@ -17,8 +17,7 @@ function toOptionalNumber(value) {
17
17
  function isRecord(value) {
18
18
  return typeof value === "object" && value !== null;
19
19
  }
20
- //#endregion
21
- //#region src/chat/identities/identity.ts
20
+ // src/chat/identities/identity.ts
22
21
  /**
23
22
  * Provider of the native Google identity. Core links it through Google
24
23
  * sign-in. Its tenant is empty and its subject is the Google OIDC `sub`.
@@ -37,8 +36,7 @@ function isNativeIdentityProvider(provider) {
37
36
  function normalizeIdentityEmail(email) {
38
37
  return email?.trim().toLowerCase() || void 0;
39
38
  }
40
- //#endregion
41
- //#region src/chat/log-context.ts
39
+ // src/chat/log-context.ts
42
40
  /** Async attribute domain consumed directly by LogTape. */
43
41
  const logContextStorage = new AsyncLocalStorage();
44
42
  /** Typed context domain retained for consumers such as native Sentry scope fields. */
@@ -101,8 +99,7 @@ function getBoundLogContext() {
101
99
  function getBoundLogAttributes() {
102
100
  return logContextStorage.getStore() ?? {};
103
101
  }
104
- //#endregion
105
- //#region src/deployment.ts
102
+ // src/deployment.ts
106
103
  const JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
107
104
  const JUNIOR_HEARTBEAT_CRON_SCHEDULE = "* * * * *";
108
105
  const JUNIOR_RETENTION_ROUTE = "/api/internal/retention";
@@ -132,8 +129,7 @@ function getDeploymentTelemetryAttributes() {
132
129
  if (deploymentId) attributes["deployment.id"] = deploymentId;
133
130
  return attributes;
134
131
  }
135
- //#endregion
136
- //#region src/chat/logging.ts
132
+ // src/chat/logging.ts
137
133
  /**
138
134
  * Structured logging for Junior runtime events.
139
135
  *
@@ -1241,5 +1237,4 @@ function extractGenAiUsageAttributes(...sources) {
1241
1237
  ...cost?.total !== void 0 ? { "app.cost.total_usd": cost.total } : void 0
1242
1238
  };
1243
1239
  }
1244
- //#endregion
1245
1240
  export { JUNIOR_RETENTION_CRON_SCHEDULE as A, toOptionalNumber as B, withContext as C, JUNIOR_HEARTBEAT_CRON_SCHEDULE as D, JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE as E, getDeploymentTelemetryAttributes as F, GOOGLE_IDENTITY_PROVIDER as I, isNativeIdentityProvider as L, JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE as M, LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION as N, JUNIOR_HEARTBEAT_ROUTE as O, getDeploymentServiceVersion as P, normalizeIdentityEmail as R, summarizeMessageText as S, withSpan as T, toOptionalString as V, serializeGenAiAttribute as _, extractGenAiUsageSummary as a, setSpanStatus as b, getLogContextAttributesForSpan as c, logError as d, logException as f, runBestEffort as g, normalizeGenAiFinishReason as h, extractGenAiUsageAttributes as i, JUNIOR_RETENTION_ROUTE as j, JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE as k, getTracePropagationHeaders as l, logWarn as m, createChatSdkLogger as n, getActiveTraceId as o, logInfo as p, createRequestContext as r, getLogContextAttributes as s, buildTurnFailureResponse as t, logAudit as u, setSentryUser as v, withLogContext as w, setTags as x, setSpanAttributes as y, isRecord as z };
@@ -1,8 +1,8 @@
1
- import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { Ht as actorFromRun, Q as getActiveAgentInvocationForConversation, Ut as toolInvocationDestination, Y as createAgentInvocationForMessage, Z as findChildAgentConversationId, _t as AgentMessageTargetError, vt as PARENT_AGENT_TARGET } from "./agent-runner-D7OboVb3.js";
3
- import { n as enqueueAgentMessageToParent } from "./result-C883vngT.js";
4
- import { r as enqueueAgentInvocation } from "./work-nAfDSUFP.js";
5
- //#region src/chat/agent-invocations/message.ts
1
+ import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
+ import { Bt as actorFromRun, Q as getActiveAgentInvocationForConversation, Vt as toolInvocationDestination, Y as createAgentInvocationForMessage, Z as findChildAgentConversationId, _t as AgentMessageTargetError, vt as PARENT_AGENT_TARGET } from "./agent-runner-CPSd7rKm.js";
3
+ import { n as enqueueAgentMessageToParent } from "./result-DEZH_AnZ.js";
4
+ import { r as enqueueAgentInvocation } from "./work-D3QKiV0O.js";
5
+ // src/chat/agent-invocations/message.ts
6
6
  var message_exports = /* @__PURE__ */ __exportAll({ bindMessageAgent: () => bindMessageAgent });
7
7
  /**
8
8
  * Bind a Run's Actor and credentials to messages for its parent and child
@@ -55,5 +55,4 @@ function bindMessageAgent(run, options) {
55
55
  };
56
56
  };
57
57
  }
58
- //#endregion
59
58
  export { message_exports as n, bindMessageAgent as t };
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- //#region src/chat/reasoning-level.ts
2
+ // src/chat/reasoning-level.ts
3
3
  const TURN_REASONING_LEVELS = [
4
4
  "none",
5
5
  "low",
@@ -11,8 +11,7 @@ const TURN_REASONING_LEVELS = [
11
11
  function parseTurnReasoningLevel(value) {
12
12
  return z.enum(TURN_REASONING_LEVELS).parse(value);
13
13
  }
14
- //#endregion
15
- //#region src/chat/model-profile.ts
14
+ // src/chat/model-profile.ts
16
15
  /** Keep durable profile names stable and safe to expose in tool schemas. */
17
16
  const modelProfileSchema = z.string().regex(/^[a-z][a-z0-9_-]*$/);
18
17
  /** Shared model profiles used when the app does not configure its own. */
@@ -58,5 +57,4 @@ function profileConfig(config, profile) {
58
57
  if (!profileConfig) throw new ModelProfileNotConfiguredError(profile);
59
58
  return profileConfig;
60
59
  }
61
- //#endregion
62
60
  export { formatModelProfiles as a, profileConfig as c, formatModelProfile as i, TURN_REASONING_LEVELS as l, ModelProfileNotConfiguredError as n, modelIdForProfile as o, defaultModelId as r, modelProfileSchema as s, DEFAULT_MODEL_PROFILES as t, parseTurnReasoningLevel as u };
package/dist/nitro.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { r as JuniorDashboardOptions } from "./app-BsU5QNBd.js";
2
- import { n as JuniorPluginSet } from "./plugins-CjfUP5gJ.js";
3
- //#region src/nitro.d.ts
1
+ import { r as JuniorDashboardOptions } from "./app-Bbxrehjf.js";
2
+ import { n as JuniorPluginSet } from "./plugins-B_0Cr0MO.js";
4
3
  export type JuniorNitroDashboardOptions = JuniorDashboardOptions;
5
4
  export interface JuniorPluginModuleReference {
6
5
  /** Runtime-safe module that exports a `defineJuniorPlugins(...)` set. */
@@ -31,5 +30,4 @@ export declare function juniorNitro(options?: JuniorNitroOptions): {
31
30
  nitro: {
32
31
  setup(nitro: unknown): void;
33
32
  };
34
- };
35
- //#endregion
33
+ };
package/dist/nitro.js CHANGED
@@ -1,12 +1,12 @@
1
- import { A as JUNIOR_RETENTION_CRON_SCHEDULE, D as JUNIOR_HEARTBEAT_CRON_SCHEDULE, E as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, M as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_HEARTBEAT_ROUTE, j as JUNIOR_RETENTION_ROUTE, k as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE } from "./logging-CWxiIuCF.js";
2
- import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-BVvSnQBB.js";
3
- import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-B6SV9uVa.js";
4
- import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-egKWjgue.js";
5
- import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-B17vV0La.js";
6
- import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-CVvEUSMH.js";
1
+ import { A as JUNIOR_RETENTION_CRON_SCHEDULE, D as JUNIOR_HEARTBEAT_CRON_SCHEDULE, E as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, M as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_HEARTBEAT_ROUTE, j as JUNIOR_RETENTION_ROUTE, k as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE } from "./logging-BStXN56b.js";
2
+ import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DJBompdd.js";
3
+ import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-vdGU-5ge.js";
4
+ import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-DOm9Y6qI.js";
5
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-BAeGEMjJ.js";
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";
9
- //#region src/build/rolldown-workarounds.ts
9
+ // src/build/rolldown-workarounds.ts
10
10
  /**
11
11
  * Override rolldown's treeshake config so that module side effects survive
12
12
  * bundling.
@@ -28,15 +28,13 @@ function applyRolldownTreeshakeWorkaround(nitro) {
28
28
  }
29
29
  };
30
30
  }
31
- //#endregion
32
- //#region src/build/glob-to-regex.ts
31
+ // src/build/glob-to-regex.ts
33
32
  /** Convert a simple file glob (supporting `*` wildcards) into a RegExp. */
34
33
  function globToRegex(pattern) {
35
34
  const escaped = pattern.replace(/[\\^$+?.()|[\]{}]/g, "\\$&").replace(/\*/g, ".*");
36
35
  return new RegExp(`^${escaped}$`);
37
36
  }
38
- //#endregion
39
- //#region src/build/copy-build-content.ts
37
+ // src/build/copy-build-content.ts
40
38
  const DASHBOARD_PACKAGE_NAME = "@sentry/junior-dashboard";
41
39
  const JUNIOR_PACKAGE_NAME = "@sentry/junior";
42
40
  const DASHBOARD_ASSET_NAMES = ["client.js", "tailwind.css"];
@@ -93,7 +91,7 @@ function parseIncludePattern(pattern) {
93
91
  const normalized = pattern.trim().replace(/^node_modules\//, "");
94
92
  const parts = normalized.split("/");
95
93
  if (!normalized || path.isAbsolute(normalized) || parts.some((part) => !part || part === "." || part === "..")) throw new Error(`includeFiles entry "${pattern}" must be a package subpath pattern`);
96
- const packagePartCount = parts[0].startsWith("@") ? 2 : 1;
94
+ const packagePartCount = parts[0]?.startsWith("@") ?? false ? 2 : 1;
97
95
  const pkgName = parts.slice(0, packagePartCount).join("/");
98
96
  const subpath = parts.slice(packagePartCount).join("/");
99
97
  if (!pkgName || !isValidPackageName(pkgName) || !subpath) throw new Error(`includeFiles entry "${pattern}" must include a package subpath`);
@@ -140,8 +138,7 @@ function nodeModulesRelativePath(sourcePath) {
140
138
  if (nodeModulesIndex === -1 || nodeModulesIndex === parts.length - 1) return null;
141
139
  return path.join("node_modules", ...parts.slice(nodeModulesIndex + 1));
142
140
  }
143
- //#endregion
144
- //#region src/build/virtual-config.ts
141
+ // src/build/virtual-config.ts
145
142
  function renderRuntimePluginImport(module) {
146
143
  if (module.exportName === "default") return `import juniorRuntimePluginSet from ${JSON.stringify(module.specifier)};`;
147
144
  return `import { ${module.exportName} as juniorRuntimePluginSet } from ${JSON.stringify(module.specifier)};`;
@@ -177,8 +174,7 @@ function injectVirtualConfig(nitro, options = {}) {
177
174
  });
178
175
  };
179
176
  }
180
- //#endregion
181
- //#region src/nitro.ts
177
+ // src/nitro.ts
182
178
  const DEFAULT_FUNCTION_MAX_DURATION_SECONDS = 300;
183
179
  const VERCEL_QUEUE_TRIGGER_TYPE = "queue/v2beta";
184
180
  function isPluginModuleReference(value) {
@@ -320,5 +316,4 @@ function juniorNitro(options = {}) {
320
316
  });
321
317
  } } };
322
318
  }
323
- //#endregion
324
319
  export { juniorNitro };
@@ -1,4 +1,4 @@
1
- //#region src/chat/runtime/turn.ts
1
+ // src/chat/runtime/turn.ts
2
2
  /** Classified Slack turn failure carrying the owning Sentry capture outward. */
3
3
  var ConversationTurnBoundaryError = class extends Error {
4
4
  eventId;
@@ -89,11 +89,9 @@ function markTurnFailed(args) {
89
89
  skippedReason: "reply failed"
90
90
  });
91
91
  }
92
- //#endregion
93
- //#region src/chat/oauth-authorization.ts
92
+ // src/chat/oauth-authorization.ts
94
93
  /** Build the stable event identity shared by authorization request and completion. */
95
94
  function authorizationId(args) {
96
95
  return `${args.sessionId}:${args.kind}:${args.provider}`;
97
96
  }
98
- //#endregion
99
97
  export { TurnInputDeferredError as a, isTurnInputCommitLostError as c, markTurnCompleted as d, markTurnFailed as f, TurnInputCommitLostError as i, isTurnInputDeferredError as l, ConversationTurnBoundaryError as n, getConversationTurnBoundaryError as o, startActiveTurn as p, CooperativeTurnYieldError as r, isCooperativeTurnYieldError as s, authorizationId as t, markTurnClosed as u };
@@ -1,7 +1,7 @@
1
- import { Rt as createUserTokenStore } from "./agent-runner-D7OboVb3.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-BXfohNmJ.js";
1
+ import { It as createUserTokenStore } from "./agent-runner-CPSd7rKm.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-BABGymK3.js";
3
3
  import { createServer } from "node:http";
4
- //#region src/chat/local/oauth-callback-server.ts
4
+ // src/chat/local/oauth-callback-server.ts
5
5
  const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
6
6
  const LOCAL_OAUTH_CALLBACK_TIMEOUT_MS = 6e4;
7
7
  function decodeProvider(value) {
@@ -126,5 +126,4 @@ async function startLocalOAuthCallbackServer() {
126
126
  }
127
127
  };
128
128
  }
129
- //#endregion
130
129
  export { startLocalOAuthCallbackServer };
@@ -1,8 +1,8 @@
1
- import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
2
  import { z } from "zod";
3
3
  import { randomBytes } from "node:crypto";
4
4
  import { SignJWT, jwtVerify } from "jose";
5
- //#region src/chat/local/oauth-relay.ts
5
+ // src/chat/local/oauth-relay.ts
6
6
  var oauth_relay_exports = /* @__PURE__ */ __exportAll({
7
7
  createLocalOAuthState: () => createLocalOAuthState,
8
8
  relayLocalOAuthCallback: () => relayLocalOAuthCallback
@@ -58,5 +58,4 @@ async function relayLocalOAuthCallback(request) {
58
58
  url.searchParams.set("jr_local_relay", "complete");
59
59
  return Response.redirect(url, 302);
60
60
  }
61
- //#endregion
62
61
  export { relayLocalOAuthCallback as n, oauth_relay_exports as t };
@@ -1,9 +1,9 @@
1
- import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
2
  import { createRequire } from "node:module";
3
3
  import path from "node:path";
4
4
  import fs, { statSync } from "node:fs";
5
5
  import { fileURLToPath } from "node:url";
6
- //#region src/package-resolution.ts
6
+ // src/package-resolution.ts
7
7
  function isDirectory$1(targetPath) {
8
8
  try {
9
9
  return statSync(targetPath).isDirectory();
@@ -51,9 +51,9 @@ function isValidPackageSegment(segment) {
51
51
  /** Return whether a string is shaped like an npm package name. */
52
52
  function isValidPackageName(packageName) {
53
53
  if (!packageName || packageName.includes("\\") || path.isAbsolute(packageName)) return false;
54
- const parts = packageName.split("/");
55
- if (parts[0].startsWith("@")) return parts.length === 2 && parts[0].length > 1 && isValidPackageSegment(parts[0].slice(1)) && isValidPackageSegment(parts[1]);
56
- return parts.length === 1 && isValidPackageSegment(parts[0]);
54
+ const [scopeOrName = "", name, ...rest] = packageName.split("/");
55
+ if (scopeOrName.startsWith("@")) return name !== void 0 && rest.length === 0 && scopeOrName.length > 1 && isValidPackageSegment(scopeOrName.slice(1)) && isValidPackageSegment(name);
56
+ return name === void 0 && isValidPackageSegment(scopeOrName);
57
57
  }
58
58
  function findPackageRoot(entryPath) {
59
59
  let dir = path.dirname(entryPath);
@@ -106,8 +106,7 @@ function resolvePackageLocation(cwd, packageName, options) {
106
106
  function resolvePackageDir(cwd, packageName) {
107
107
  return resolvePackageLocation(cwd, packageName)?.dir;
108
108
  }
109
- //#endregion
110
- //#region src/chat/discovery.ts
109
+ // src/chat/discovery.ts
111
110
  var discovery_exports = /* @__PURE__ */ __exportAll({
112
111
  builtInSkillsDir: () => builtInSkillsDir,
113
112
  dataDir: () => dataDir,
@@ -252,7 +251,6 @@ function resolveHomeDir(cwd = process.cwd(), options) {
252
251
  const directApp = path.resolve(resolvedCwd, "app");
253
252
  if (pathExists(directApp) && hasAnyDataMarkers(directApp)) return directApp;
254
253
  const candidates = resolveCandidateAppDirs(resolvedCwd, options?.projectRoots);
255
- if (candidates.length === 0) return directApp;
256
254
  candidates.sort((left, right) => {
257
255
  const leftScore = scoreAppCandidate(left);
258
256
  const rightScore = scoreAppCandidate(right);
@@ -262,11 +260,11 @@ function resolveHomeDir(cwd = process.cwd(), options) {
262
260
  if (leftDistance !== rightDistance) return leftDistance - rightDistance;
263
261
  return left.localeCompare(right);
264
262
  });
265
- return candidates[0];
263
+ return candidates[0] ?? directApp;
266
264
  }
267
- function resolveContentRoots(subdir) {
268
- if (subdir === "data") return [homeDir()];
269
- return [path.join(homeDir(), subdir)];
265
+ function resolveContentRoot(subdir) {
266
+ if (subdir === "data") return homeDir();
267
+ return path.join(homeDir(), subdir);
270
268
  }
271
269
  /** Return the built-in skills directory in source and packaged builds. */
272
270
  function builtInSkillsDir() {
@@ -278,7 +276,7 @@ function builtInSkillsDir() {
278
276
  }
279
277
  /** Return the data directory (same as homeDir). */
280
278
  function dataDir() {
281
- return resolveContentRoots("data")[0];
279
+ return resolveContentRoot("data");
282
280
  }
283
281
  /** Return the path to the SOUL.md file. */
284
282
  function soulPath() {
@@ -294,23 +292,23 @@ function descriptionPath() {
294
292
  }
295
293
  /** Return the skills directory path. */
296
294
  function skillsDir() {
297
- return resolveContentRoots("skills")[0];
295
+ return resolveContentRoot("skills");
298
296
  }
299
297
  /** Return the plugins directory path. */
300
298
  function pluginsDir() {
301
- return resolveContentRoots("plugins")[0];
299
+ return resolveContentRoot("plugins");
302
300
  }
303
301
  /** Return all unique data root directories. */
304
302
  function dataRoots() {
305
- return unique(resolveContentRoots("data"));
303
+ return unique([resolveContentRoot("data")]);
306
304
  }
307
305
  /** Return all unique skill root directories. */
308
306
  function skillRoots() {
309
- return unique([builtInSkillsDir(), ...resolveContentRoots("skills")]);
307
+ return unique([builtInSkillsDir(), resolveContentRoot("skills")]);
310
308
  }
311
309
  /** Return all unique plugin root directories. */
312
310
  function pluginRoots() {
313
- return unique(resolveContentRoots("plugins"));
311
+ return unique([resolveContentRoot("plugins")]);
314
312
  }
315
313
  /** Return candidate paths where SOUL.md might be found. */
316
314
  function soulPathCandidates() {
@@ -339,8 +337,7 @@ function listReferenceFiles() {
339
337
  return [];
340
338
  }
341
339
  }
342
- //#endregion
343
- //#region src/chat/plugins/package-discovery.ts
340
+ // src/chat/plugins/package-discovery.ts
344
341
  function normalizeForGlob(targetPath) {
345
342
  return targetPath.split(path.sep).join("/");
346
343
  }
@@ -451,5 +448,4 @@ function discoverInstalledPluginPackageContent(cwd = process.cwd(), options) {
451
448
  tracingIncludes: uniqueStringsInOrder(tracingIncludes)
452
449
  };
453
450
  }
454
- //#endregion
455
451
  export { listReferenceFiles as a, soulPathCandidates as c, resolvePackageDir as d, homeDir as i, worldPathCandidates as l, normalizePluginPackageNames as n, pluginRoots as o, discovery_exports as r, skillRoots as s, discoverInstalledPluginPackageContent as t, isValidPackageName as u };