@sentry/junior 0.179.0 → 0.181.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 (137) hide show
  1. package/dist/{agent-hooks-32IDCLMW.js → agent-hooks-IQUW6ERD.js} +16 -18
  2. package/dist/api/schema/workspace.d.ts +2 -0
  3. package/dist/api/schema.js +1 -2
  4. package/dist/api.js +202 -199
  5. package/dist/app.d.ts +4 -0
  6. package/dist/app.js +300 -1259
  7. package/dist/catalog-runtime-PMQWNIXA.js +14 -0
  8. package/dist/chat/agent/sandbox.d.ts +0 -2
  9. package/dist/chat/api-turns/routing.d.ts +4 -0
  10. package/dist/chat/api-turns/work.d.ts +5 -0
  11. package/dist/chat/config.d.ts +5 -2
  12. package/dist/chat/configuration/defaults.d.ts +1 -1
  13. package/dist/chat/conversations/projection.d.ts +6 -4
  14. package/dist/chat/ingress/message-router.d.ts +3 -0
  15. package/dist/chat/model-profile.d.ts +8 -10
  16. package/dist/chat/pi/conversation-events.d.ts +3 -2
  17. package/dist/chat/plugins/agent-hooks.d.ts +1 -1
  18. package/dist/chat/plugins/task-queue.d.ts +40 -3
  19. package/dist/chat/plugins/task-runner.d.ts +1 -1
  20. package/dist/chat/queue/callback.d.ts +26 -0
  21. package/dist/chat/queue/sign.d.ts +30 -0
  22. package/dist/chat/sandbox/sandbox.d.ts +0 -2
  23. package/dist/chat/sandbox/session.d.ts +0 -2
  24. package/dist/chat/sandbox/skill-sync.d.ts +1 -1
  25. package/dist/chat/sandbox/snapshot/events.d.ts +23 -0
  26. package/dist/chat/sandbox/snapshot/job-callback.d.ts +5 -0
  27. package/dist/chat/sandbox/snapshot/job-queue.d.ts +26 -0
  28. package/dist/chat/sandbox/snapshot/job-runner.d.ts +11 -0
  29. package/dist/chat/sandbox/snapshot/not-ready-error.d.ts +6 -0
  30. package/dist/chat/sandbox/snapshot/workspace.d.ts +9 -3
  31. package/dist/chat/services/turn-router.d.ts +4 -3
  32. package/dist/chat/services/turn-session-routing.d.ts +1 -0
  33. package/dist/chat/task-execution/queue-signing.d.ts +10 -21
  34. package/dist/chat/task-execution/state.d.ts +48 -0
  35. package/dist/chat/task-execution/store.d.ts +28 -2
  36. package/dist/chat/task-execution/worker.d.ts +4 -1
  37. package/dist/chat/tools/handoff/tool.d.ts +1 -1
  38. package/dist/chat/tools/types.d.ts +2 -0
  39. package/dist/chat/workspaces/types.d.ts +2 -0
  40. package/dist/{chunk-Q5B3WTGG.js → chunk-3KCQEG6W.js} +42 -41
  41. package/dist/{chunk-XZY6G5YZ.js → chunk-3KSSALN4.js} +180 -87
  42. package/dist/{chunk-3AFVR5UC.js → chunk-3X55QRAG.js} +18 -16
  43. package/dist/{chunk-SLGGOASN.js → chunk-4IX32NSL.js} +46 -46
  44. package/dist/{chunk-6ZWRNC4D.js → chunk-6Y5B5PEX.js} +1 -1
  45. package/dist/chunk-7H2VZTWN.js +103 -0
  46. package/dist/{chunk-CGA4ERJ5.js → chunk-CEMMLV5L.js} +1 -1
  47. package/dist/{chunk-FIANEE7Z.js → chunk-CM5HNV2W.js} +6 -6
  48. package/dist/{chunk-TKB25A3L.js → chunk-CZYNWPWD.js} +2 -1
  49. package/dist/{chunk-3I7XE3PA.js → chunk-D6ZD7VXP.js} +49 -38
  50. package/dist/chunk-DKIJ2RP5.js +68 -0
  51. package/dist/{chunk-G2CAC4CV.js → chunk-DSA6WTRP.js} +74 -68
  52. package/dist/{chunk-OOUNJNMR.js → chunk-DWPN6SCH.js} +1 -1
  53. package/dist/{chunk-HQNE5APD.js → chunk-EBMRB6Z6.js} +100 -79
  54. package/dist/{chunk-ZQMG3CL5.js → chunk-EM7EECT5.js} +16 -16
  55. package/dist/{chunk-XSPSCWLH.js → chunk-ETJTXYHY.js} +4 -4
  56. package/dist/{chunk-FTGD2FBP.js → chunk-EU7KJDOG.js} +2 -2
  57. package/dist/{chunk-CJLBLELR.js → chunk-FWILPBVQ.js} +8 -61
  58. package/dist/{chunk-4GWXAILB.js → chunk-GPA3ZSYY.js} +1 -1
  59. package/dist/{chunk-U4TKB6F6.js → chunk-GREV5PJK.js} +108 -5
  60. package/dist/{chunk-KJLHIHFF.js → chunk-GWFRPQNP.js} +43 -230
  61. package/dist/{chunk-YFNAMRGE.js → chunk-HEBMSITT.js} +1 -1
  62. package/dist/chunk-HJ27A6YB.js +218 -0
  63. package/dist/{chunk-R5NWWYIS.js → chunk-HZHUMCNV.js} +5 -5
  64. package/dist/{chunk-RTRBYSF3.js → chunk-IJ6SS4WB.js} +1 -1
  65. package/dist/{chunk-B6ECUSVX.js → chunk-IKKETMQC.js} +8 -8
  66. package/dist/{chunk-R6U7N4FS.js → chunk-KKSVCHDO.js} +10 -3
  67. package/dist/{chunk-JMJNFEDC.js → chunk-KMBU4PJP.js} +9 -54
  68. package/dist/chunk-KQZX24QQ.js +164 -0
  69. package/dist/{chunk-GPLAT6H7.js → chunk-LCNPXLE7.js} +22 -18
  70. package/dist/{chunk-2HIPYNQI.js → chunk-LG5MYY6U.js} +33 -32
  71. package/dist/chunk-LZOQFC5F.js +209 -0
  72. package/dist/chunk-M3QYTBQ6.js +55 -0
  73. package/dist/{chunk-M63DETLL.js → chunk-N7TMSOZH.js} +6 -6
  74. package/dist/{chunk-FIDMHAO6.js → chunk-NQTA72Q3.js} +84 -274
  75. package/dist/{chunk-RZRYOLCE.js → chunk-PBKZQAUA.js} +2315 -1150
  76. package/dist/chunk-PEQXYSSE.js +45 -0
  77. package/dist/{chunk-3TM3FYLQ.js → chunk-PL57B6NC.js} +1 -1
  78. package/dist/{chunk-JT4WMD3C.js → chunk-PPYDHUEL.js} +144 -218
  79. package/dist/{chunk-5IRROPA5.js → chunk-Q2KY27IX.js} +129 -31
  80. package/dist/{chunk-VP4OVRDD.js → chunk-RNMASWLP.js} +69 -73
  81. package/dist/{chunk-FAS6AIMF.js → chunk-TDT2R77B.js} +8 -8
  82. package/dist/{chunk-TIEKUH4Q.js → chunk-TJHSAHQN.js} +4 -3
  83. package/dist/{chunk-H4HBKISO.js → chunk-TXKUKMVO.js} +1 -1
  84. package/dist/chunk-X6GDDWQH.js +60 -0
  85. package/dist/{chunk-GENV6KF2.js → chunk-XYTJUHRZ.js} +108 -76
  86. package/dist/cli/chat.js +47 -43
  87. package/dist/cli/check.js +13 -15
  88. package/dist/cli/env.js +0 -1
  89. package/dist/cli/init.js +0 -1
  90. package/dist/cli/main.js +2 -3
  91. package/dist/cli/plugins.js +18 -20
  92. package/dist/cli/run.js +0 -1
  93. package/dist/cli/snapshot-create.js +14 -16
  94. package/dist/cli/upgrade.js +16 -18
  95. package/dist/{conversation-work-KATFHLG3.js → conversation-work-VIOQ5ZF3.js} +0 -2
  96. package/dist/db/schema/snapshots.d.ts +17 -0
  97. package/dist/db/schema.d.ts +17 -0
  98. package/dist/{db-EJAV7JL6.js → db-QNPVCQPT.js} +8 -10
  99. package/dist/deployment.d.ts +1 -0
  100. package/dist/{discovery-GUFTFBTL.js → discovery-DWVDM7UK.js} +1 -2
  101. package/dist/{experimental-XVDOSRBS.js → experimental-SIJSRDJD.js} +0 -1
  102. package/dist/instrumentation.js +7 -9
  103. package/dist/nitro.js +39 -13
  104. package/dist/{oauth-callback-server-GAVSUBTQ.js → oauth-callback-server-KYMPJOTC.js} +34 -32
  105. package/dist/{oauth-relay-3ZU72UGL.js → oauth-relay-5XPVRPYB.js} +0 -1
  106. package/dist/{plugins-HW4VWW6G.js → plugins-YTYJMMJF.js} +1 -2
  107. package/dist/{runner-34JL64JF.js → runner-3RS2D2ZR.js} +39 -33
  108. package/dist/{sandbox-egress-signals-DXOOBSBI.js → sandbox-egress-signals-FIL7EGPR.js} +5 -6
  109. package/dist/{sentry-JMWTS32N.js → sentry-MB3NL3IR.js} +1 -2
  110. package/dist/skills-5B3Y6XX6.js +27 -0
  111. package/dist/spawn-VYARS3DU.js +37 -0
  112. package/dist/task-runner-4IXKKZHL.js +32 -0
  113. package/dist/validation-Q65QD27B.js +17 -0
  114. package/dist/vercel.js +0 -1
  115. package/dist/version.js +1 -2
  116. package/dist/work-DCMQWAAP.js +45 -0
  117. package/dist/worker-QL3CHLZL.js +22 -0
  118. package/migrations/0035_workspace_snapshot_size_bytes.sql +2 -0
  119. package/migrations/meta/0035_snapshot.json +3048 -0
  120. package/migrations/meta/_journal.json +7 -0
  121. package/package.json +7 -6
  122. package/dist/catalog-runtime-FBVA6WAQ.js +0 -16
  123. package/dist/chat/plugins/task-callback.d.ts +0 -5
  124. package/dist/chat/plugins/task-message.d.ts +0 -23
  125. package/dist/chat/plugins/task-signing.d.ts +0 -31
  126. package/dist/chat/sandbox/snapshot/waiting-error.d.ts +0 -15
  127. package/dist/chat/services/workspace-snapshot-wait.d.ts +0 -27
  128. package/dist/chunk-5I6ORJUY.js +0 -127
  129. package/dist/chunk-6GWA276C.js +0 -72
  130. package/dist/chunk-MLKGABMK.js +0 -9
  131. package/dist/chunk-UT6X7XN7.js +0 -51
  132. package/dist/chunk-WR76IVA5.js +0 -130
  133. package/dist/skills-U545HALM.js +0 -29
  134. package/dist/spawn-I2S4IDUQ.js +0 -37
  135. package/dist/validation-EVXVGA44.js +0 -19
  136. package/dist/work-QOAUPDBU.js +0 -45
  137. package/dist/worker-5GX2IKLZ.js +0 -24
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  credentialUserSubjectId
3
- } from "./chunk-CGA4ERJ5.js";
4
- import {
5
- logInfo,
6
- logWarn,
7
- setSpanAttributes
8
- } from "./chunk-HQNE5APD.js";
3
+ } from "./chunk-CEMMLV5L.js";
9
4
  import {
10
5
  discoverInstalledPluginPackageContent,
11
6
  normalizePluginPackageNames
12
- } from "./chunk-OOUNJNMR.js";
7
+ } from "./chunk-DWPN6SCH.js";
13
8
  import {
14
9
  pluginRoots
15
- } from "./chunk-H4HBKISO.js";
10
+ } from "./chunk-TXKUKMVO.js";
11
+ import {
12
+ logInfo,
13
+ logWarn,
14
+ setSpanAttributes
15
+ } from "./chunk-EBMRB6Z6.js";
16
16
 
17
17
  // src/chat/plugins/manifest.ts
18
18
  import { z } from "zod";
@@ -626,9 +626,9 @@ function normalizeCredentials(data, name) {
626
626
  return {
627
627
  type: "oauth-bearer",
628
628
  domains,
629
- ...apiHeaders ? { apiHeaders } : {},
629
+ ...apiHeaders ? { apiHeaders } : void 0,
630
630
  authTokenEnv: result.data["auth-token-env"],
631
- ...result.data["auth-token-placeholder"] ? { authTokenPlaceholder: result.data["auth-token-placeholder"] } : {}
631
+ ...result.data["auth-token-placeholder"] ? { authTokenPlaceholder: result.data["auth-token-placeholder"] } : void 0
632
632
  };
633
633
  }
634
634
  function normalizeRuntimeDependencies(entries, name) {
@@ -751,8 +751,8 @@ function normalizeRuntimePostinstall(commands, name) {
751
751
  const normalizedArgs = result.data.args?.map((arg) => arg.trim()).filter((arg) => arg.length > 0);
752
752
  parsed.push({
753
753
  cmd: result.data.cmd,
754
- ...normalizedArgs && normalizedArgs.length > 0 ? { args: normalizedArgs } : {},
755
- ...typeof result.data.sudo === "boolean" ? { sudo: result.data.sudo } : {}
754
+ ...normalizedArgs && normalizedArgs.length > 0 ? { args: normalizedArgs } : void 0,
755
+ ...typeof result.data.sudo === "boolean" ? { sudo: result.data.sudo } : void 0
756
756
  });
757
757
  }
758
758
  return parsed.length > 0 ? parsed : void 0;
@@ -831,9 +831,9 @@ function normalizeMcp(data, envVars, name) {
831
831
  return {
832
832
  transport: "http",
833
833
  url: result.data.url,
834
- ...headers ? { headers } : {},
835
- ...result.data["allowed-tools"] ? { allowedTools: result.data["allowed-tools"] } : {},
836
- ...result.data["wrapped-tools"] ? { wrappedTools: result.data["wrapped-tools"] } : {}
834
+ ...headers ? { headers } : void 0,
835
+ ...result.data["allowed-tools"] ? { allowedTools: result.data["allowed-tools"] } : void 0,
836
+ ...result.data["wrapped-tools"] ? { wrappedTools: result.data["wrapped-tools"] } : void 0
837
837
  };
838
838
  }
839
839
  function parseManifestSource(parsedSource, dir, config, options) {
@@ -941,14 +941,14 @@ function parseManifestSource(parsedSource, dir, config, options) {
941
941
  displayName: data["display-name"],
942
942
  description: data.description,
943
943
  configKeys,
944
- ...domains ? { domains } : {},
945
- ...apiHeaders ? { apiHeaders } : {},
946
- ...commandEnv ? { commandEnv } : {},
947
- ...Object.keys(envVars).length > 0 ? { envVars } : {},
948
- ...credentials ? { credentials } : {},
949
- ...runtimeDependencies ? { runtimeDependencies } : {},
950
- ...runtimePostinstall ? { runtimePostinstall } : {},
951
- ...mcp ? { mcp } : {}
944
+ ...domains ? { domains } : void 0,
945
+ ...apiHeaders ? { apiHeaders } : void 0,
946
+ ...commandEnv ? { commandEnv } : void 0,
947
+ ...Object.keys(envVars).length > 0 ? { envVars } : void 0,
948
+ ...credentials ? { credentials } : void 0,
949
+ ...runtimeDependencies ? { runtimeDependencies } : void 0,
950
+ ...runtimePostinstall ? { runtimePostinstall } : void 0,
951
+ ...mcp ? { mcp } : void 0
952
952
  };
953
953
  if (data.oauth) {
954
954
  if (!credentials && options?.allowHookManagedEgress !== true) {
@@ -977,11 +977,11 @@ function parseManifestSource(parsedSource, dir, config, options) {
977
977
  clientSecretEnv: result.data["client-secret-env"],
978
978
  authorizeEndpoint: result.data["authorize-endpoint"],
979
979
  tokenEndpoint: result.data["token-endpoint"],
980
- ...result.data.scope ? { scope: result.data.scope } : {},
981
- ...authorizeParams ? { authorizeParams } : {},
982
- ...result.data["token-auth-method"] ? { tokenAuthMethod: result.data["token-auth-method"] } : {},
983
- ...tokenExtraHeaders ? { tokenExtraHeaders } : {},
984
- ...result.data["treat-empty-scope-as-unreported"] ? { treatEmptyScopeAsUnreported: true } : {}
980
+ ...result.data.scope ? { scope: result.data.scope } : void 0,
981
+ ...authorizeParams ? { authorizeParams } : void 0,
982
+ ...result.data["token-auth-method"] ? { tokenAuthMethod: result.data["token-auth-method"] } : void 0,
983
+ ...tokenExtraHeaders ? { tokenExtraHeaders } : void 0,
984
+ ...result.data["treat-empty-scope-as-unreported"] ? { treatEmptyScopeAsUnreported: true } : void 0
985
985
  };
986
986
  }
987
987
  assertCommandEnvDoesNotExposeHostSecretRefs(
@@ -1021,7 +1021,7 @@ function parseManifestSource(parsedSource, dir, config, options) {
1021
1021
  manifest.target = {
1022
1022
  type: result.data.type,
1023
1023
  configKey: qualifiedKey,
1024
- ...commandFlags ? { commandFlags } : {}
1024
+ ...commandFlags ? { commandFlags } : void 0
1025
1025
  };
1026
1026
  }
1027
1027
  return manifest;
@@ -1152,7 +1152,7 @@ function getOAuthProviderErrorAttributes(error) {
1152
1152
  "app.credential.provider": error.provider,
1153
1153
  "app.oauth.error.phase": error.phase,
1154
1154
  "server.address": error.resourceHost,
1155
- ...error.status !== void 0 ? { "http.response.status_code": error.status } : {}
1155
+ ...error.status !== void 0 ? { "http.response.status_code": error.status } : void 0
1156
1156
  };
1157
1157
  }
1158
1158
  async function readBoundedOAuthErrorBody(response) {
@@ -1393,7 +1393,7 @@ function parseOAuthTokenResponse(data, requestedScope, options) {
1393
1393
  const result = {
1394
1394
  accessToken,
1395
1395
  refreshToken: resolvedRefreshToken,
1396
- ...scope ? { scope } : {}
1396
+ ...scope ? { scope } : void 0
1397
1397
  };
1398
1398
  if (expiresIn !== void 0) {
1399
1399
  if (typeof expiresIn !== "number" || !Number.isFinite(expiresIn) || expiresIn <= 0) {
@@ -1593,9 +1593,9 @@ function createOAuthBearerBroker(manifest, credentials, deps) {
1593
1593
  );
1594
1594
  }
1595
1595
  const refreshedTokens = {
1596
- ...latest.refreshTokenExpiresAt ? { refreshTokenExpiresAt: latest.refreshTokenExpiresAt } : {},
1596
+ ...latest.refreshTokenExpiresAt ? { refreshTokenExpiresAt: latest.refreshTokenExpiresAt } : void 0,
1597
1597
  ...refreshed,
1598
- ...latest.account ? { account: latest.account } : {}
1598
+ ...latest.account ? { account: latest.account } : void 0
1599
1599
  };
1600
1600
  await deps.userTokenStore.set(
1601
1601
  userSubjectId,
@@ -1690,8 +1690,8 @@ function registerPluginManifest(state, manifest, pluginDir, skillsDir, migration
1690
1690
  const definition = {
1691
1691
  manifest,
1692
1692
  dir: pluginDir,
1693
- ...migrationsDir ? { migrationsDir } : {},
1694
- ...skillsDir ? { skillsDir } : {}
1693
+ ...migrationsDir ? { migrationsDir } : void 0,
1694
+ ...skillsDir ? { skillsDir } : void 0
1695
1695
  };
1696
1696
  state.pluginDefinitions.push(definition);
1697
1697
  state.pluginsByName.set(manifest.name, definition);
@@ -1775,7 +1775,7 @@ function normalizePluginCatalogConfig(config) {
1775
1775
  return {
1776
1776
  inlineManifests: config.inlineManifests ? structuredClone(config.inlineManifests) : void 0,
1777
1777
  packages: normalizePluginPackageNames(config.packages),
1778
- ...config.manifests ? { manifests: structuredClone(config.manifests) } : {}
1778
+ ...config.manifests ? { manifests: structuredClone(config.manifests) } : void 0
1779
1779
  };
1780
1780
  }
1781
1781
  function clonePluginCatalogConfig(config) {
@@ -1783,9 +1783,9 @@ function clonePluginCatalogConfig(config) {
1783
1783
  return void 0;
1784
1784
  }
1785
1785
  return {
1786
- ...config.inlineManifests ? { inlineManifests: structuredClone(config.inlineManifests) } : {},
1786
+ ...config.inlineManifests ? { inlineManifests: structuredClone(config.inlineManifests) } : void 0,
1787
1787
  packages: [...config.packages ?? []],
1788
- ...config.manifests ? { manifests: structuredClone(config.manifests) } : {}
1788
+ ...config.manifests ? { manifests: structuredClone(config.manifests) } : void 0
1789
1789
  };
1790
1790
  }
1791
1791
  function packageContentByName(packagedContent, packageName) {
@@ -1907,7 +1907,7 @@ function logLoadedPlugins(state) {
1907
1907
  "app.plugin.config_key_count": plugin.manifest.configKeys.length,
1908
1908
  "app.plugin.has_mcp": Boolean(plugin.manifest.mcp),
1909
1909
  "file.directory": plugin.dir,
1910
- ...plugin.skillsDir ? { "app.file.skill_directory": plugin.skillsDir } : {}
1910
+ ...plugin.skillsDir ? { "app.file.skill_directory": plugin.skillsDir } : void 0
1911
1911
  });
1912
1912
  }
1913
1913
  }
@@ -1986,8 +1986,8 @@ function createPluginCatalogRuntime() {
1986
1986
  for (const command of plugin.manifest.runtimePostinstall ?? []) {
1987
1987
  commands.push({
1988
1988
  cmd: command.cmd,
1989
- ...command.args ? { args: [...command.args] } : {},
1990
- ...command.sudo !== void 0 ? { sudo: command.sudo } : {}
1989
+ ...command.args ? { args: [...command.args] } : void 0,
1990
+ ...command.sudo !== void 0 ? { sudo: command.sudo } : void 0
1991
1991
  });
1992
1992
  }
1993
1993
  }
@@ -2002,11 +2002,11 @@ function createPluginCatalogRuntime() {
2002
2002
  clientSecretEnv: oauth.clientSecretEnv,
2003
2003
  authorizeEndpoint: oauth.authorizeEndpoint,
2004
2004
  tokenEndpoint: oauth.tokenEndpoint,
2005
- ...oauth.scope ? { scope: oauth.scope } : {},
2006
- ...oauth.authorizeParams ? { authorizeParams: { ...oauth.authorizeParams } } : {},
2007
- ...oauth.tokenAuthMethod ? { tokenAuthMethod: oauth.tokenAuthMethod } : {},
2008
- ...oauth.tokenExtraHeaders ? { tokenExtraHeaders: { ...oauth.tokenExtraHeaders } } : {},
2009
- ...oauth.treatEmptyScopeAsUnreported ? { treatEmptyScopeAsUnreported: true } : {},
2005
+ ...oauth.scope ? { scope: oauth.scope } : void 0,
2006
+ ...oauth.authorizeParams ? { authorizeParams: { ...oauth.authorizeParams } } : void 0,
2007
+ ...oauth.tokenAuthMethod ? { tokenAuthMethod: oauth.tokenAuthMethod } : void 0,
2008
+ ...oauth.tokenExtraHeaders ? { tokenExtraHeaders: { ...oauth.tokenExtraHeaders } } : void 0,
2009
+ ...oauth.treatEmptyScopeAsUnreported ? { treatEmptyScopeAsUnreported: true } : void 0,
2010
2010
  callbackPath: `/api/oauth/callback/${plugin.manifest.name}`
2011
2011
  };
2012
2012
  },
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  credentialContextSchema
3
- } from "./chunk-CGA4ERJ5.js";
3
+ } from "./chunk-CEMMLV5L.js";
4
4
 
5
5
  // src/chat/sandbox/egress/schemas.ts
6
6
  import { z } from "zod";
@@ -0,0 +1,103 @@
1
+ // src/chat/vercel-queue-client.ts
2
+ import { QueueClient } from "@vercel/queue";
3
+ function defaultQueueClientOptions() {
4
+ if (process.env.VERCEL_DEPLOYMENT_ID?.trim()) {
5
+ return {};
6
+ }
7
+ return { deploymentId: null };
8
+ }
9
+ function createVercelQueueClient() {
10
+ return new QueueClient(defaultQueueClientOptions());
11
+ }
12
+
13
+ // src/chat/queue/sign.ts
14
+ import { createHmac, timingSafeEqual } from "crypto";
15
+ import { z } from "zod";
16
+ var QUEUE_SIGNATURE_MAX_AGE_MS = 60 * 60 * 1e3;
17
+ function secret() {
18
+ return process.env.JUNIOR_SECRET?.trim() || void 0;
19
+ }
20
+ function digest(args) {
21
+ return createHmac("sha256", args.secret).update(
22
+ [args.context, args.signedAtMs, ...args.parts].join(args.separator)
23
+ ).digest("hex");
24
+ }
25
+ function sameHex(expected, actual) {
26
+ const left = Buffer.from(expected);
27
+ const right = Buffer.from(actual);
28
+ return left.length === right.length && timingSafeEqual(left, right);
29
+ }
30
+ function body(value) {
31
+ const {
32
+ signature: _signature,
33
+ signatureVersion: _signatureVersion,
34
+ signedAtMs: _signedAtMs,
35
+ ...message
36
+ } = value;
37
+ return message;
38
+ }
39
+ function signQueueMessage(config, message, nowMs = Date.now()) {
40
+ const key = secret();
41
+ if (!key) {
42
+ throw new Error("Cannot sign queue message without JUNIOR_SECRET");
43
+ }
44
+ if (!Number.isFinite(nowMs)) {
45
+ throw new Error("Cannot sign queue message with an invalid clock");
46
+ }
47
+ const separator = config.separator ?? "\0";
48
+ return {
49
+ ...message,
50
+ signedAtMs: nowMs,
51
+ signatureVersion: config.signatureVersion,
52
+ signature: digest({
53
+ context: config.context,
54
+ parts: config.parts(message),
55
+ secret: key,
56
+ separator,
57
+ signedAtMs: nowMs
58
+ })
59
+ };
60
+ }
61
+ function verifyQueueMessage(config, value, nowMs = Date.now()) {
62
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
63
+ return { status: "rejected", reason: "malformed" };
64
+ }
65
+ const signed = z.object({
66
+ signature: z.string().trim().min(1),
67
+ signatureVersion: z.literal(config.signatureVersion),
68
+ signedAtMs: z.number().finite()
69
+ }).safeParse(value);
70
+ const message = config.schema.safeParse(body(value));
71
+ if (!signed.success || !message.success) {
72
+ return { status: "rejected", reason: "malformed" };
73
+ }
74
+ const key = secret();
75
+ if (!key) {
76
+ return { status: "unavailable", reason: "missing_secret" };
77
+ }
78
+ if (!Number.isFinite(nowMs)) {
79
+ return { status: "unavailable", reason: "invalid_clock" };
80
+ }
81
+ const maxAgeMs = config.maxAgeMs ?? QUEUE_SIGNATURE_MAX_AGE_MS;
82
+ if (Math.abs(nowMs - signed.data.signedAtMs) > maxAgeMs) {
83
+ return { status: "rejected", reason: "expired" };
84
+ }
85
+ const expected = digest({
86
+ context: config.context,
87
+ parts: config.parts(message.data),
88
+ secret: key,
89
+ separator: config.separator ?? "\0",
90
+ signedAtMs: signed.data.signedAtMs
91
+ });
92
+ if (!sameHex(expected, signed.data.signature)) {
93
+ return { status: "rejected", reason: "signature_mismatch" };
94
+ }
95
+ return { status: "verified", message: message.data };
96
+ }
97
+
98
+ export {
99
+ createVercelQueueClient,
100
+ QUEUE_SIGNATURE_MAX_AGE_MS,
101
+ signQueueMessage,
102
+ verifyQueueMessage
103
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseActorUserId
3
- } from "./chunk-M63DETLL.js";
3
+ } from "./chunk-N7TMSOZH.js";
4
4
 
5
5
  // src/chat/credentials/context.ts
6
6
  import { z } from "zod";
@@ -16,9 +16,9 @@ function cloneInlineManifests(registrations) {
16
16
  ...plugin.manifest.target,
17
17
  configKey: plugin.manifest.target.configKey.includes(".") ? plugin.manifest.target.configKey : `${plugin.manifest.name}.${plugin.manifest.target.configKey}`
18
18
  }
19
- } : {}
19
+ } : void 0
20
20
  },
21
- ...plugin.packageName ? { packageName: plugin.packageName } : {}
21
+ ...plugin.packageName ? { packageName: plugin.packageName } : void 0
22
22
  }
23
23
  ] : []
24
24
  );
@@ -63,7 +63,7 @@ function defineJuniorPlugins(inputs, options = {}) {
63
63
  return {
64
64
  packageNames,
65
65
  registrations: registrations.map((plugin) => ({ ...plugin })),
66
- ...manifests ? { manifests } : {}
66
+ ...manifests ? { manifests } : void 0
67
67
  };
68
68
  }
69
69
  function pluginCatalogConfigFromPluginSet(pluginSet) {
@@ -84,9 +84,9 @@ function pluginCatalogConfigFromPluginSet(pluginSet) {
84
84
  return void 0;
85
85
  }
86
86
  return {
87
- ...inlineManifests ? { inlineManifests } : {},
88
- ...packages.length > 0 ? { packages } : {},
89
- ...manifests ? { manifests } : {}
87
+ ...inlineManifests ? { inlineManifests } : void 0,
88
+ ...packages.length > 0 ? { packages } : void 0,
89
+ ...manifests ? { manifests } : void 0
90
90
  };
91
91
  }
92
92
  function readEnvPluginPackages(env = process.env) {
@@ -732,7 +732,8 @@ var workspaceRepoSchema = z7.object({
732
732
  var workspaceSnapshotSchema = z7.object({
733
733
  id: z7.string(),
734
734
  generatedAt: z7.iso.datetime(),
735
- buildDurationMs: z7.number().int().nonnegative()
735
+ buildDurationMs: z7.number().int().nonnegative(),
736
+ sizeBytes: z7.number().int().nonnegative().nullable()
736
737
  }).strict();
737
738
  var baselineSnapshotSchema = z7.object({
738
739
  id: z7.string(),
@@ -5,7 +5,7 @@ import {
5
5
  getConversationEventStore,
6
6
  getDb,
7
7
  getSqlExecutor
8
- } from "./chunk-VP4OVRDD.js";
8
+ } from "./chunk-RNMASWLP.js";
9
9
  import {
10
10
  juniorConversationAnnotations,
11
11
  juniorConversationEvents,
@@ -14,7 +14,7 @@ import {
14
14
  juniorUsers,
15
15
  juniorWorkspaceRepos,
16
16
  juniorWorkspaces
17
- } from "./chunk-R6U7N4FS.js";
17
+ } from "./chunk-KKSVCHDO.js";
18
18
  import {
19
19
  SANDBOX_WORKSPACE_ROOT,
20
20
  getVercelSandboxCredentials,
@@ -22,24 +22,24 @@ import {
22
22
  isSandboxMissingError,
23
23
  runNonInteractiveCommand,
24
24
  sleep
25
- } from "./chunk-JMJNFEDC.js";
25
+ } from "./chunk-KMBU4PJP.js";
26
26
  import {
27
27
  getStateAdapter
28
- } from "./chunk-3TM3FYLQ.js";
28
+ } from "./chunk-PL57B6NC.js";
29
29
  import {
30
30
  botConfig,
31
31
  completeObject,
32
+ defaultModelId,
32
33
  embedTexts,
33
- getSlackBotToken,
34
- standardModelId
35
- } from "./chunk-GENV6KF2.js";
34
+ getSlackBotToken
35
+ } from "./chunk-XYTJUHRZ.js";
36
36
  import {
37
37
  isActorUserId,
38
38
  parseActorUserId,
39
39
  parseSlackChannelReferenceId,
40
40
  parseSlackMessageTs,
41
41
  parseSlackTeamId
42
- } from "./chunk-M63DETLL.js";
42
+ } from "./chunk-N7TMSOZH.js";
43
43
  import {
44
44
  logException,
45
45
  logInfo,
@@ -48,15 +48,15 @@ import {
48
48
  setSpanAttributes,
49
49
  setSpanStatus,
50
50
  withSpan
51
- } from "./chunk-HQNE5APD.js";
51
+ } from "./chunk-EBMRB6Z6.js";
52
52
 
53
53
  // src/chat/plugins/agent-hooks.ts
54
54
  import {
55
55
  missingToolAnnotationKeys,
56
56
  normalizeResourceEventIdentifier,
57
+ pluginResourceEventsSchema,
57
58
  promptContextSchema,
58
59
  promptMessageSchema,
59
- pluginResourceEventsSchema,
60
60
  resourceEventInputSchema
61
61
  } from "@sentry/junior-plugin-api";
62
62
 
@@ -300,13 +300,13 @@ function createPluginLogger(plugin) {
300
300
  function createPluginModel(pluginName, options = {}, runtime = {}) {
301
301
  return {
302
302
  async completeObject(input) {
303
- const modelId = options.structuredModelId ?? (options.structuredModel === "default" ? standardModelId(botConfig) : botConfig.fastModelId);
303
+ const modelId = options.structuredModelId ?? (options.structuredModel === "default" ? defaultModelId(botConfig) : botConfig.fastModelId);
304
304
  const result = await completeObject({
305
305
  modelId,
306
306
  schema: input.schema,
307
307
  prompt: input.prompt,
308
- ...input.system !== void 0 ? { system: input.system } : {},
309
- ...input.maxTokens !== void 0 ? { maxTokens: input.maxTokens } : {},
308
+ ...input.system !== void 0 ? { system: input.system } : void 0,
309
+ ...input.maxTokens !== void 0 ? { maxTokens: input.maxTokens } : void 0,
310
310
  signal: runtime.signal,
311
311
  promptName: `${pluginName}.structured_completion`,
312
312
  metadata: {
@@ -316,7 +316,7 @@ function createPluginModel(pluginName, options = {}, runtime = {}) {
316
316
  });
317
317
  return {
318
318
  object: result.object,
319
- ...result.costUsd !== void 0 ? { costUsd: result.costUsd } : {}
319
+ ...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0
320
320
  };
321
321
  }
322
322
  };
@@ -766,7 +766,7 @@ async function withSlackRetries(task, maxAttempts = 3, context = {}) {
766
766
  "url.path": `/api/${action}`,
767
767
  "app.slack.method": action,
768
768
  "app.retry.max_attempts": maxAttempts,
769
- ...attemptNumber > 1 ? { "http.request.resend_count": attemptNumber - 1 } : {},
769
+ ...attemptNumber > 1 ? { "http.request.resend_count": attemptNumber - 1 } : void 0,
770
770
  ...context.attributes ?? {},
771
771
  ...context.spanAttributes ?? {}
772
772
  }
@@ -779,18 +779,18 @@ async function withSlackRetries(task, maxAttempts = 3, context = {}) {
779
779
  const baseLogAttributes = {
780
780
  "app.slack.action": action,
781
781
  "app.slack.error_code": mapped.code,
782
- ...mapped.apiError ? { "app.slack.api_error": mapped.apiError } : {},
783
- ...mapped.detail ? { "app.slack.detail": mapped.detail } : {},
784
- ...mapped.detailLine !== void 0 ? { "app.slack.detail_line": mapped.detailLine } : {},
785
- ...mapped.detailRule ? { "app.slack.detail_rule": mapped.detailRule } : {},
786
- ...mapped.requestId ? { "app.slack.request_id": mapped.requestId } : {},
787
- ...mapped.statusCode !== void 0 ? { "http.response.status_code": mapped.statusCode } : {},
782
+ ...mapped.apiError ? { "app.slack.api_error": mapped.apiError } : void 0,
783
+ ...mapped.detail ? { "app.slack.detail": mapped.detail } : void 0,
784
+ ...mapped.detailLine !== void 0 ? { "app.slack.detail_line": mapped.detailLine } : void 0,
785
+ ...mapped.detailRule ? { "app.slack.detail_rule": mapped.detailRule } : void 0,
786
+ ...mapped.requestId ? { "app.slack.request_id": mapped.requestId } : void 0,
787
+ ...mapped.statusCode !== void 0 ? { "http.response.status_code": mapped.statusCode } : void 0,
788
788
  ...context.attributes ?? {}
789
789
  };
790
790
  if (!isRetryable || attempt >= maxAttempts || remainingDelayBudgetMs <= 0) {
791
791
  logWarn("slack.action.failed", {
792
792
  ...baseLogAttributes,
793
- ...mapped.errorData ? { "app.slack.error_data": mapped.errorData } : {}
793
+ ...mapped.errorData ? { "app.slack.error_data": mapped.errorData } : void 0
794
794
  });
795
795
  throw mapped;
796
796
  }
@@ -1381,9 +1381,9 @@ function identityFromRow(row) {
1381
1381
  id: row.id,
1382
1382
  provider: row.provider,
1383
1383
  providerSubjectId: row.providerSubjectId,
1384
- ...row.providerTenantId ? { providerTenantId: row.providerTenantId } : {},
1385
- ...row.displayName ? { displayName: row.displayName } : {},
1386
- ...row.handle ? { handle: row.handle } : {}
1384
+ ...row.providerTenantId ? { providerTenantId: row.providerTenantId } : void 0,
1385
+ ...row.displayName ? { displayName: row.displayName } : void 0,
1386
+ ...row.handle ? { handle: row.handle } : void 0
1387
1387
  });
1388
1388
  }
1389
1389
  async function readUserById(db, userRow) {
@@ -1401,7 +1401,7 @@ async function readUserById(db, userRow) {
1401
1401
  email: userRow.primaryEmail,
1402
1402
  id: userRow.id,
1403
1403
  identities: identityRows.map(identityFromRow),
1404
- ...userRow.displayName ? { displayName: userRow.displayName } : {}
1404
+ ...userRow.displayName ? { displayName: userRow.displayName } : void 0
1405
1405
  });
1406
1406
  }
1407
1407
  async function resolveViewerUserFromSql(db, email) {
@@ -1457,7 +1457,7 @@ async function readActorIdentityFromSql(db, actor) {
1457
1457
  if (!row) return void 0;
1458
1458
  return {
1459
1459
  identity: identityFromRow(row.identity),
1460
- ...row.user ? { user: await readUserById(db, row.user) } : {}
1460
+ ...row.user ? { user: await readUserById(db, row.user) } : void 0
1461
1461
  };
1462
1462
  }
1463
1463
  async function readActorIdentity(actor) {
@@ -1733,6 +1733,7 @@ function snapshotFromRow(row) {
1733
1733
  id: row.snapshotId,
1734
1734
  generatedAt: row.generatedAt,
1735
1735
  buildDurationMs: row.buildDurationMs,
1736
+ sizeBytes: row.sizeBytes,
1736
1737
  profileHash: row.profileHash
1737
1738
  };
1738
1739
  }
@@ -1799,6 +1800,7 @@ async function setWorkspaceSnapshot(workspaceId, snapshot, options) {
1799
1800
  status: "ready",
1800
1801
  snapshotId: snapshot.id,
1801
1802
  buildDurationMs: snapshot.buildDurationMs,
1803
+ sizeBytes: snapshot.sizeBytes,
1802
1804
  generatedAt: snapshot.generatedAt,
1803
1805
  buildStartedAt: null,
1804
1806
  buildPhase: null,
@@ -1877,6 +1879,7 @@ async function setWorkspaceSnapshotBuild(workspaceId, build, options = {}) {
1877
1879
  status: build.status,
1878
1880
  snapshotId: null,
1879
1881
  buildDurationMs: null,
1882
+ sizeBytes: null,
1880
1883
  generatedAt: null,
1881
1884
  buildStartedAt: build.startedAt,
1882
1885
  buildPhase: build.phase,
@@ -2221,7 +2224,10 @@ function systemPromptPluginContext(plugin) {
2221
2224
  };
2222
2225
  }
2223
2226
  function pluginInvocationContext(context) {
2224
- const common = { conversationId: context.conversationId };
2227
+ const common = {
2228
+ conversationId: context.conversationId,
2229
+ locationId: context.locationId
2230
+ };
2225
2231
  switch (context.source.platform) {
2226
2232
  case "slack": {
2227
2233
  if (context.destination.platform !== "slack") {
@@ -2259,6 +2265,7 @@ function invocationPluginContext(plugin, context, turnId) {
2259
2265
  const common = {
2260
2266
  ...base,
2261
2267
  conversationId: context.conversationId,
2268
+ locationId: context.locationId,
2262
2269
  embedder: createPluginEmbedder(plugin.manifest.name),
2263
2270
  ...context.conversationId && turnId ? {
2264
2271
  events: createPluginConversationEvents({
@@ -2267,11 +2274,14 @@ function invocationPluginContext(plugin, context, turnId) {
2267
2274
  plugin,
2268
2275
  turnId
2269
2276
  })
2270
- } : {},
2277
+ } : void 0,
2271
2278
  model: createPluginModel(plugin.manifest.name, plugin.model),
2272
2279
  source: context.source,
2273
2280
  text: context.userText ?? "",
2274
- state: createPluginState(plugin.manifest.name)
2281
+ state: createPluginState(plugin.manifest.name),
2282
+ users: {
2283
+ resolveActor: context.resolveActorIdentity ?? (async () => void 0)
2284
+ }
2275
2285
  };
2276
2286
  return {
2277
2287
  ...common,
@@ -2567,8 +2577,8 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
2567
2577
  channelCapabilities: resolveChannelCapabilities(
2568
2578
  slackToolContext.sourceChannelId
2569
2579
  ),
2570
- ...dashboardConversationUrl ? { conversationLink: { url: dashboardConversationUrl } } : {},
2571
- ...credentialSubject ? { credentialSubject } : {}
2580
+ ...dashboardConversationUrl ? { conversationLink: { url: dashboardConversationUrl } } : void 0,
2581
+ ...credentialSubject ? { credentialSubject } : void 0
2572
2582
  } : void 0;
2573
2583
  const annotations = context.conversationId ? createPluginAnnotations({
2574
2584
  conversationId: context.conversationId,
@@ -2619,12 +2629,13 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
2619
2629
  const resolveActor = context.resolveActorIdentity ?? (async () => void 0);
2620
2630
  const common = {
2621
2631
  ...basePluginContext(plugin),
2622
- ...annotations ? { annotations } : {},
2632
+ ...annotations ? { annotations } : void 0,
2623
2633
  conversationId: context.conversationId,
2634
+ locationId: context.locationId,
2624
2635
  userText: context.userText,
2625
2636
  embedder: createPluginEmbedder(pluginName),
2626
2637
  egress: context.egress,
2627
- ...mcp ? { mcp } : {},
2638
+ ...mcp ? { mcp } : void 0,
2628
2639
  model: createPluginModel(pluginName, plugin.model),
2629
2640
  resourceEvents,
2630
2641
  sandbox,
@@ -3213,7 +3224,7 @@ function createSandboxCapability(workspace, ownerSignal) {
3213
3224
  const signal = preparationSignal(input.signal, ownerSignal);
3214
3225
  const result = await runNonInteractiveCommand(workspace, {
3215
3226
  ...input,
3216
- ...signal ? { signal } : {}
3227
+ ...signal ? { signal } : void 0
3217
3228
  });
3218
3229
  return {
3219
3230
  exitCode: result.exitCode,
@@ -3226,7 +3237,7 @@ function createSandboxCapability(workspace, ownerSignal) {
3226
3237
  {
3227
3238
  path: input.path,
3228
3239
  content: input.content,
3229
- ...input.mode !== void 0 ? { mode: input.mode } : {}
3240
+ ...input.mode !== void 0 ? { mode: input.mode } : void 0
3230
3241
  }
3231
3242
  ]);
3232
3243
  }
@@ -3252,8 +3263,8 @@ function createPluginHookRunner(input = {}) {
3252
3263
  try {
3253
3264
  await hook({
3254
3265
  ...basePluginContext(plugin),
3255
- ...tool.conversationId ? { conversationId: tool.conversationId } : {},
3256
- ...annotations ? { annotations } : {},
3266
+ ...tool.conversationId ? { conversationId: tool.conversationId } : void 0,
3267
+ ...annotations ? { annotations } : void 0,
3257
3268
  result: tool.structuredContent !== void 0 ? { structuredContent: tool.structuredContent } : {},
3258
3269
  tool: {
3259
3270
  arguments: tool.arguments,