@sentry/junior 0.267.0 → 0.268.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/{actor-DZSokpwj.js → actor-CP9K2Idu.js} +2 -1
  2. package/dist/{adapter-BybMEezj.js → adapter-04AcD2SO.js} +4 -6
  3. package/dist/{admin-DOs1_EiW.js → admin-DIU1QyG3.js} +1 -1
  4. package/dist/{agent-invocations-CxKldAeB.js → agent-invocations-C1RNOCs8.js} +2 -0
  5. package/dist/{agent-runner-DgNATN4D.js → agent-runner-CAYfFmU7.js} +4409 -3020
  6. package/dist/api/schema.d.ts +2 -5629
  7. package/dist/api/schema.js +4 -4
  8. package/dist/api.d.ts +1 -1
  9. package/dist/api.js +154 -32
  10. package/dist/{app-DAB3fzyp.d.ts → app-z6Uuyq3j.d.ts} +3 -2
  11. package/dist/app.d.ts +1 -1
  12. package/dist/app.js +332 -98
  13. package/dist/{briefs-CWKjka7v.js → briefs-DQbV2jNr.js} +2 -2
  14. package/dist/{catalog-runtime-cMlAI5LY.js → catalog-runtime-BD9GSpc6.js} +1 -1
  15. package/dist/cli/chat.js +15 -15
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +3 -3
  18. package/dist/cli/plugins.js +4 -4
  19. package/dist/cli/snapshot-create.js +4 -4
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{client-BjgbMawj.js → client-C1yDYjoS.js} +2 -2
  23. package/dist/{config-CdB6yJj5.js → config-DrTeF80T.js} +2 -2
  24. package/dist/{connections-RE_65jzK.js → connections-D46f8vvi.js} +10 -11
  25. package/dist/{conversation-privacy-BzgJC5k0.js → conversation-privacy-CxlOCiUo.js} +1 -1
  26. package/dist/{credential-sync-DhEGEpgq.js → credential-sync-sm9fegLY.js} +29 -34
  27. package/dist/{credentialed-CIGwoLU2.js → credentialed-lukuD-cc.js} +39 -13
  28. package/dist/db-BU4LQD8s.d.ts +6 -0
  29. package/dist/{executor-VYrx_K4w.js → executor-4vhvsMZJ.js} +78 -4
  30. package/dist/instrumentation.js +2 -2
  31. package/dist/{assistant-reply-CT7VcXQe.js → interruption-marker-CkncDT8d.js} +8 -2
  32. package/dist/{job-queue-C0BZSa7r.js → job-queue-In9QKz-I.js} +2 -2
  33. package/dist/{list-1XQP-o6K.js → list-BkgnXEEB.js} +298 -807
  34. package/dist/{logging-DuZ1A4ab.js → logging-DLSpkSSr.js} +1 -1
  35. package/dist/{message-NKSbbnA6.js → message-BObyg59s.js} +4 -4
  36. package/dist/nitro.d.ts +1 -1
  37. package/dist/nitro.js +3 -3
  38. package/dist/{oauth-callback-server-qAHLPtml.js → oauth-callback-server-B-WbSdoH.js} +2 -2
  39. package/dist/{registry-FQutO926.js → registry-BgecKva0.js} +2 -2
  40. package/dist/{web-message-id-CJSUiksE.js → reporting-window-DVCD_10C.js} +1 -10
  41. package/dist/{resolve-Bk4yeuHy.js → resolve-Cpa4Bu1O.js} +3 -3
  42. package/dist/{result-B9e9ATOU.js → result-D3TSmZZ8.js} +8 -8
  43. package/dist/{runner-C3S2ObH-.js → runner-DS5OKhEp.js} +10 -10
  44. package/dist/{sandbox-egress-signals-DqpGzzMB.js → sandbox-egress-signals-CnDjY5rx.js} +1 -1
  45. package/dist/{schema-X7Fj4fv1.js → schema-0050HFnB.js} +80 -4
  46. package/dist/schema-ZngqcOWM.d.ts +5813 -0
  47. package/dist/{service-account-Do30HUNv.js → service-account-CKV2WTY7.js} +3 -3
  48. package/dist/{service-account-BQasl-qq.js → service-account-DGjnDw9y.js} +3 -3
  49. package/dist/{session-stop-DkOjt46_.js → session-stop-Dam1EI7B.js} +494 -18
  50. package/dist/{skills-CQHrwfOa.js → skills-CfAnfImD.js} +2 -2
  51. package/dist/{spawn-BHuqN14f.js → spawn-cmq9p4Ly.js} +2 -2
  52. package/dist/{store-6EetVP-m.js → store-C5PN02QO.js} +4 -4
  53. package/dist/{store-B8CABbmR.d.ts → store-xMuuXRE0.d.ts} +13 -7
  54. package/dist/{store-DvNZIsCr.js → store-zPEoJPBB.js} +3 -3
  55. package/dist/{task-queue-B0DLgd2P.js → task-queue-_mf28dSu.js} +3 -3
  56. package/dist/{task-runner-B-PD_JOj.js → task-runner-DMI2prDO.js} +11 -12
  57. package/dist/{tasks-0ilmuCux.js → tasks-SB9z-VTU.js} +124 -21
  58. package/dist/{thread-state-DRmdJ2QN.js → thread-state-BbbPh0Sn.js} +8 -18
  59. package/dist/{turn-failure-response-G11cs2gE.js → turn-failure-response-BKKmnMB5.js} +10 -15
  60. package/dist/{turn-lifecycle-OzLIwvi1.js → turn-lifecycle-oP0kVeGz.js} +1 -1
  61. package/dist/{validation-CxEmt1id.js → validation--JsAGLwc.js} +1 -1
  62. package/dist/{version-Bapedn4A.js → version-jHwJp4hC.js} +1 -1
  63. package/dist/version.js +1 -1
  64. package/dist/{viewer-DrN3oC2X.js → viewer-CpXTGlep.js} +323 -235
  65. package/dist/{user-input-request-BDFBdF8r.js → web-message-id-DlHNANtd.js} +17 -1
  66. package/dist/{work-DUQoNcqP.js → work-3N-GHY9m.js} +10 -10
  67. package/dist/{worker-D1l4Ugk0.js → worker-CCdbcItd.js} +6 -6
  68. package/migrations/0065_user_customization.sql +1 -0
  69. package/migrations/0066_review_items.sql +53 -0
  70. package/migrations/0067_review_item_dedupe_tenant.sql +2 -0
  71. package/migrations/0068_review_item_slack_cards.sql +10 -0
  72. package/migrations/meta/0065_snapshot.json +3511 -0
  73. package/migrations/meta/0066_snapshot.json +4099 -0
  74. package/migrations/meta/0067_snapshot.json +3921 -0
  75. package/migrations/meta/0068_snapshot.json +4176 -0
  76. package/migrations/meta/_journal.json +29 -1
  77. package/package.json +5 -5
  78. package/dist/db-Bg-zC3r5.d.ts +0 -5
  79. package/dist/images-CecjXAAz.js +0 -64
  80. package/dist/turn-session-routing-Dyut9l7Y.js +0 -76
package/dist/cli/chat.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-DgNATN4D.js";
1
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-CAYfFmU7.js";
2
2
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
3
3
  import path from "node:path";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -99,10 +99,10 @@ async function loadLocalPluginSet() {
99
99
  async function configureLocalChatPlugins(pluginSet) {
100
100
  const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
101
101
  import("../plugins-DOm9Y6qI.js").then((n) => n.o),
102
- import("../credentialed-CIGwoLU2.js").then((n) => n.a),
103
- import("../catalog-runtime-cMlAI5LY.js").then((n) => n.t),
104
- import("../validation-CxEmt1id.js").then((n) => n.r),
105
- import("../viewer-DrN3oC2X.js").then((n) => n.l)
102
+ import("../credentialed-lukuD-cc.js").then((n) => n.a),
103
+ import("../catalog-runtime-BD9GSpc6.js").then((n) => n.t),
104
+ import("../validation--JsAGLwc.js").then((n) => n.r),
105
+ import("../viewer-CpXTGlep.js").then((n) => n.u)
106
106
  ]);
107
107
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
108
108
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -152,19 +152,19 @@ function localDevServerUrl() {
152
152
  async function prepareLocalChatRun(io, pluginSet) {
153
153
  defaultStateAdapterForLocalChat();
154
154
  await configureLocalChatPlugins(pluginSet);
155
- const { setBriefsConfig } = await import("../credentialed-CIGwoLU2.js").then((n) => n._);
155
+ const { setBriefsConfig } = await import("../credentialed-lukuD-cc.js").then((n) => n._);
156
156
  setBriefsConfig({ enabled: true });
157
- const { runLocalAgentTurn } = await import("../runner-C3S2ObH-.js");
158
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-qAHLPtml.js");
157
+ const { runLocalAgentTurn } = await import("../runner-DS5OKhEp.js");
158
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-B-WbSdoH.js");
159
159
  const { createLocalOAuthState } = await import("../oauth-relay-CTygMkNx.js").then((n) => n.t);
160
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-DqpGzzMB.js");
161
- const { bindSpawnAgent } = await import("../spawn-BHuqN14f.js").then((n) => n.n);
162
- const { bindMessageAgent } = await import("../message-NKSbbnA6.js").then((n) => n.n);
163
- const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-DUQoNcqP.js").then((n) => n.a);
164
- const { startAgentInvocationsForChildInput } = await import("../result-B9e9ATOU.js").then((n) => n.r);
165
- const { skipInputBeforeConversationStop } = await import("../session-stop-DkOjt46_.js").then((n) => n.r);
160
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-CnDjY5rx.js");
161
+ const { bindSpawnAgent } = await import("../spawn-cmq9p4Ly.js").then((n) => n.n);
162
+ const { bindMessageAgent } = await import("../message-BObyg59s.js").then((n) => n.n);
163
+ const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-3N-GHY9m.js").then((n) => n.a);
164
+ const { startAgentInvocationsForChildInput } = await import("../result-D3TSmZZ8.js").then((n) => n.r);
165
+ const { skipInputBeforeConversationStop } = await import("../session-stop-Dam1EI7B.js").then((n) => n.r);
166
166
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
167
- const { processConversationWork } = await import("../worker-D1l4Ugk0.js").then((n) => n.n);
167
+ const { processConversationWork } = await import("../worker-CCdbcItd.js").then((n) => n.n);
168
168
  let agentRunner;
169
169
  const localConversationWork = createLocalConversationWork(async (message) => {
170
170
  if (!agentRunner) throw new Error("Local agent runner is not ready");
package/dist/cli/check.js CHANGED
@@ -1,6 +1,6 @@
1
- import { D as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, P as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, k as JUNIOR_HEARTBEAT_ROUTE } from "../logging-DuZ1A4ab.js";
2
- import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-FQutO926.js";
3
- import { i as parseSkillFile } from "../skills-CQHrwfOa.js";
1
+ import { D as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, P as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, k as JUNIOR_HEARTBEAT_ROUTE } from "../logging-DLSpkSSr.js";
2
+ import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-BgecKva0.js";
3
+ import { i as parseSkillFile } from "../skills-CfAnfImD.js";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs/promises";
6
6
  import { pathToFileURL } from "node:url";
package/dist/cli/main.js CHANGED
@@ -25,13 +25,13 @@ async function runChat(argv, pluginSet) {
25
25
  return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
26
26
  }
27
27
  async function runAdmin(argv) {
28
- return await (await import("../admin-DOs1_EiW.js")).runAdmin(argv);
28
+ return await (await import("../admin-DIU1QyG3.js")).runAdmin(argv);
29
29
  }
30
30
  async function runServiceAccount(argv) {
31
- return await (await import("../service-account-BQasl-qq.js")).runServiceAccount(argv);
31
+ return await (await import("../service-account-DGjnDw9y.js")).runServiceAccount(argv);
32
32
  }
33
33
  async function runBriefs(argv) {
34
- return await (await import("../briefs-CWKjka7v.js")).runBriefs(argv);
34
+ return await (await import("../briefs-DQbV2jNr.js")).runBriefs(argv);
35
35
  }
36
36
  function topLevelCommand(argv) {
37
37
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,7 +1,7 @@
1
- import { p as getDb } from "../viewer-DrN3oC2X.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-cMlAI5LY.js";
3
- import { Nn as createPluginLogger, h as validatePlugins, m as setPlugins } from "../credentialed-CIGwoLU2.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-CxEmt1id.js";
1
+ import { m as getDb } from "../viewer-CpXTGlep.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-BD9GSpc6.js";
3
+ import { In as createPluginLogger, h as validatePlugins, m as setPlugins } from "../credentialed-lukuD-cc.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation--JsAGLwc.js";
5
5
  import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-DOm9Y6qI.js";
6
6
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
7
7
  import { stderr, stdout } from "node:process";
@@ -1,7 +1,7 @@
1
- import { n as pluginCatalogRuntime } from "../catalog-runtime-cMlAI5LY.js";
2
- import { j as create } from "../credentialed-CIGwoLU2.js";
3
- import { t as disconnectStateAdapter } from "../adapter-BybMEezj.js";
4
- import { n as resolve } from "../resolve-Bk4yeuHy.js";
1
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-BD9GSpc6.js";
2
+ import { j as create } from "../credentialed-lukuD-cc.js";
3
+ import { t as disconnectStateAdapter } from "../adapter-04AcD2SO.js";
4
+ import { n as resolve } from "../resolve-Cpa4Bu1O.js";
5
5
  // src/cli/snapshot-create.ts
6
6
  const DEFAULT_RUNTIME = "node22";
7
7
  const DEFAULT_TIMEOUT_MS = 6e5;
@@ -1,4 +1,4 @@
1
- import "../db-Bg-zC3r5.js";
1
+ import "../db-BU4LQD8s.js";
2
2
  import { n as JuniorPluginSet } from "../plugins-B_0Cr0MO.js";
3
3
  interface UpgradeIo {
4
4
  info: (line: string) => void;
@@ -1,6 +1,6 @@
1
- import { i as getChatConfig } from "../config-CdB6yJj5.js";
2
- import { t as createJuniorSqlExecutor } from "../executor-VYrx_K4w.js";
3
- import { t as createPluginCatalogRuntime } from "../registry-FQutO926.js";
1
+ import { i as getChatConfig } from "../config-DrTeF80T.js";
2
+ import { t as createJuniorSqlExecutor } from "../executor-4vhvsMZJ.js";
3
+ import { t as createPluginCatalogRuntime } from "../registry-BgecKva0.js";
4
4
  import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-DOm9Y6qI.js";
5
5
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
6
6
  import { basename, dirname, join, resolve } from "node:path";
@@ -1,5 +1,5 @@
1
- import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-DuZ1A4ab.js";
2
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-BzgJC5k0.js";
1
+ import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-DLSpkSSr.js";
2
+ import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-CxlOCiUo.js";
3
3
  import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
4
4
  import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
5
5
  import { createGatewayProvider } from "@ai-sdk/gateway";
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { C as toOptionalTrimmed, s as resolveGatewayModel } from "./client-BjgbMawj.js";
3
- import { h as logWarn } from "./logging-DuZ1A4ab.js";
2
+ import { C as toOptionalTrimmed, s as resolveGatewayModel } from "./client-C1yDYjoS.js";
3
+ import { h as logWarn } from "./logging-DLSpkSSr.js";
4
4
  import { l as TURN_REASONING_LEVELS, s as modelProfileSchema, t as DEFAULT_MODEL_PROFILES, u as parseTurnReasoningLevel } from "./model-profile-Bg8EoCKD.js";
5
5
  import { AwsClient } from "aws4fetch";
6
6
  // src/chat/attachments/s3.ts
@@ -1,14 +1,13 @@
1
- import { Ht as loadTurnCheckpoint, Kt as failTurnRecord, qt as getTurnRecord } from "./tasks-0ilmuCux.js";
2
- import { n as botConfig } from "./config-CdB6yJj5.js";
3
- import { M as deleteProviderIdentityForUser, j as deleteProviderIdentityForSlackUser, m as getSqlExecutor, u as getConversationEventStore } from "./viewer-DrN3oC2X.js";
4
- import { u as hasRequiredOAuthScope } from "./registry-FQutO926.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-cMlAI5LY.js";
6
- import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-DgNATN4D.js";
7
- import { H as startOAuthFlow } from "./credentialed-CIGwoLU2.js";
8
- import { i as getStateAdapter } from "./adapter-BybMEezj.js";
9
- import { a as getVercelConversationWorkQueue } from "./job-queue-C0BZSa7r.js";
10
- import { m as ensureConversationWake, w as requestConversationWork } from "./store-DvNZIsCr.js";
11
- import { n as resolveTurnSessionRouting } from "./turn-session-routing-Dyut9l7Y.js";
1
+ import { Jt as failTurnRecord, Wt as loadTurnCheckpoint, Yt as getTurnRecord, j as resolveTurnSessionRouting } from "./tasks-SB9z-VTU.js";
2
+ import { n as botConfig } from "./config-DrTeF80T.js";
3
+ import { T as deleteProviderIdentityForUser, d as getConversationEventStore, h as getSqlExecutor, w as deleteProviderIdentityForSlackUser } from "./viewer-CpXTGlep.js";
4
+ import { u as hasRequiredOAuthScope } from "./registry-BgecKva0.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BD9GSpc6.js";
6
+ import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-CAYfFmU7.js";
7
+ import { H as startOAuthFlow } from "./credentialed-lukuD-cc.js";
8
+ import { i as getStateAdapter } from "./adapter-04AcD2SO.js";
9
+ import { a as getVercelConversationWorkQueue } from "./job-queue-In9QKz-I.js";
10
+ import { m as ensureConversationWake, w as requestConversationWork } from "./store-zPEoJPBB.js";
12
11
  import { z } from "zod";
13
12
  import { randomBytes, randomUUID } from "node:crypto";
14
13
  // src/chat/task-execution/authorized-turn.ts
@@ -1,4 +1,4 @@
1
- import { h as logWarn } from "./logging-DuZ1A4ab.js";
1
+ import { h as logWarn } from "./logging-DLSpkSSr.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  // src/chat/conversation-privacy.ts
4
4
  const SAFE_METADATA_KEY_LIMIT = 20;
@@ -1,19 +1,19 @@
1
- import { nt as recordAuthorizationCompleted, qt as getTurnRecord, tt as recordAuthenticationLinked, zt as getConversationPendingAuth } from "./tasks-0ilmuCux.js";
2
- import { p as escapeXml } from "./client-BjgbMawj.js";
3
- import { a as getRuntimeMetadata, n as botConfig } from "./config-CdB6yJj5.js";
4
- import { R as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-DuZ1A4ab.js";
5
- import { f as parseSlackUserId } from "./actor-DZSokpwj.js";
6
- import { L as upsertIdentity, N as findUserByVerifiedEmails, R as upsertLinkedIdentity, S as identityFromActor, m as getSqlExecutor } from "./viewer-DrN3oC2X.js";
1
+ import { Vt as getConversationPendingAuth, Yt as getTurnRecord, it as recordAuthorizationCompleted, rt as recordAuthenticationLinked } from "./tasks-SB9z-VTU.js";
2
+ import { p as escapeXml } from "./client-C1yDYjoS.js";
3
+ import { a as getRuntimeMetadata, n as botConfig } from "./config-DrTeF80T.js";
4
+ import { R as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-DLSpkSSr.js";
5
+ import { p as parseSlackUserId } from "./actor-CP9K2Idu.js";
6
+ import { A as upsertLinkedIdentity, C as resolveActorIdentityId, E as findUserByVerifiedEmails, a as readIdentityById, h as getSqlExecutor } from "./viewer-CpXTGlep.js";
7
7
  import { i as homeDir } from "./package-discovery-DJBompdd.js";
8
- import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-FQutO926.js";
9
- import { n as pluginCatalogRuntime } from "./catalog-runtime-cMlAI5LY.js";
10
- import { t as discoverSkills } from "./skills-CQHrwfOa.js";
11
- import { a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, v as lookupSlackUserProfile } from "./agent-runner-DgNATN4D.js";
12
- import { $ as postSlackMessage, B as parseOAuthStatePayload, V as resolveBaseUrl, i as resolvePluginOAuthAccount, n as createUserTokenStore, nn as getSlackClient, z as formatProviderLabel } from "./credentialed-CIGwoLU2.js";
13
- import { i as getStateAdapter, o as acquireActiveLock } from "./adapter-BybMEezj.js";
14
- import { _ as getMcpProviderErrorAttributes } from "./service-account-Do30HUNv.js";
15
- import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-DRmdJ2QN.js";
16
- import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-RE_65jzK.js";
8
+ import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-BgecKva0.js";
9
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BD9GSpc6.js";
10
+ import { t as discoverSkills } from "./skills-CfAnfImD.js";
11
+ import { a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, v as lookupSlackUserProfile } from "./agent-runner-CAYfFmU7.js";
12
+ import { B as parseOAuthStatePayload, V as resolveBaseUrl, i as resolvePluginOAuthAccount, in as getSlackClient, n as createUserTokenStore, tt as postSlackMessage, z as formatProviderLabel } from "./credentialed-lukuD-cc.js";
13
+ import { i as getStateAdapter, o as acquireActiveLock } from "./adapter-04AcD2SO.js";
14
+ import { _ as getMcpProviderErrorAttributes } from "./service-account-CKV2WTY7.js";
15
+ import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BbbPh0Sn.js";
16
+ import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-D46f8vvi.js";
17
17
  import { n as relayLocalOAuthCallback } from "./oauth-relay-CTygMkNx.js";
18
18
  import path from "node:path";
19
19
  import { z } from "zod";
@@ -394,28 +394,23 @@ function pluginAuthorizationId(args) {
394
394
  }
395
395
  /** Return the Junior user of the person who started the OAuth connection. */
396
396
  async function resolveOAuthActorUserId(actor) {
397
- if (actor.platform === "web") {
398
- const observation = identityFromActor(actor.email ? {
399
- email: actor.email,
400
- ...actor.fullName ? { fullName: actor.fullName } : void 0
401
- } : void 0);
402
- return observation ? (await upsertIdentity(getSqlExecutor(), observation)).userId : void 0;
403
- }
397
+ const identityActor = actor.platform === "web" ? actor : await slackProfileActor(actor);
398
+ const identityId = await resolveActorIdentityId(getSqlExecutor(), identityActor);
399
+ return identityId ? (await readIdentityById(identityId))?.user?.id : void 0;
400
+ }
401
+ /** Refresh a Slack actor with the profile Slack returns for that user. */
402
+ async function slackProfileActor(actor) {
404
403
  const slackUserId = parseSlackUserId(actor.userId);
405
404
  if (!slackUserId) throw new Error("OAuth Slack actor user id is invalid");
406
405
  const profile = await lookupSlackUserProfile(slackUserId);
407
- return (await upsertIdentity(getSqlExecutor(), {
408
- kind: "user",
409
- provider: "slack",
410
- providerTenantId: actor.teamId,
411
- providerSubjectId: profile.id,
412
- displayName: profile.real_name || profile.display_name,
413
- handle: profile.name,
414
- ...profile.email ? {
415
- email: profile.email,
416
- emailVerified: true
417
- } : void 0
418
- })).userId;
406
+ return {
407
+ platform: "slack",
408
+ teamId: actor.teamId,
409
+ userId: profile.id,
410
+ ...profile.real_name || profile.display_name ? { fullName: profile.real_name || profile.display_name } : void 0,
411
+ ...profile.name ? { userName: profile.name } : void 0,
412
+ ...profile.email ? { email: profile.email } : void 0
413
+ };
419
414
  }
420
415
  /**
421
416
  * Link a connected provider account to the person who connected it.
@@ -1,18 +1,18 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
- import { C as toOptionalTrimmed, i as completeObject, o as embedTexts } from "./client-BjgbMawj.js";
3
- import { i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName } from "./config-CdB6yJj5.js";
4
- import { B as isRecord$2, E as withSpan, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, p as logException, y as setSentryUser } from "./logging-DuZ1A4ab.js";
2
+ import { C as toOptionalTrimmed, i as completeObject, o as embedTexts } from "./client-C1yDYjoS.js";
3
+ import { i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName } from "./config-DrTeF80T.js";
4
+ import { B as isRecord$2, E as withSpan, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, p as logException, y as setSentryUser } from "./logging-DLSpkSSr.js";
5
5
  import { a as getClient$1, n as captureMessage, r as continueTrace } from "./sentry-MDkYAVPV.js";
6
- import { t as canExposeConversationPayload } from "./conversation-privacy-BzgJC5k0.js";
6
+ import { t as canExposeConversationPayload } from "./conversation-privacy-CxlOCiUo.js";
7
7
  import { r as defaultModelId } from "./model-profile-Bg8EoCKD.js";
8
- import { d as parseSlackTeamId, f as parseSlackUserId, i as isActorUserId, o as parseActorUserId, p as parseSlackMessageTs, u as parseSlackChannelReferenceId } from "./actor-DZSokpwj.js";
9
- import { B as parseDestination, I as saveUserTimezone, P as readUserTimezone, a as resolveViewerUser, i as readIdentityById, k as hasAgentTurnUsage, m as getSqlExecutor, p as getDb, r as readActorIdentity, u as getConversationEventStore, v as createSqlStore } from "./viewer-DrN3oC2X.js";
10
- import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, s as juniorConversations } from "./agent-invocations-CxKldAeB.js";
11
- import { _ as juniorConversationAnnotations, b as juniorAttachments, f as juniorConversationBriefs, h as juniorConversationEvents, i as juniorWorkspaces, n as juniorSnapshots, r as juniorWorkspaceRepos, u as juniorConversationParticipants, v as juniorCodeChanges, y as juniorCodeRepositories } from "./executor-VYrx_K4w.js";
8
+ import { d as parseSlackChannelReferenceId, f as parseSlackTeamId, i as isActorUserId, m as parseSlackMessageTs, p as parseSlackUserId, s as parseActorUserId } from "./actor-CP9K2Idu.js";
9
+ import { B as parseDestination, D as readUserTimezone, L as hasAgentTurnUsage, a as readIdentityById, d as getConversationEventStore, h as getSqlExecutor, i as readActorIdentity, k as saveUserTimezone, m as getDb, o as resolveViewerUser, y as createSqlStore } from "./viewer-CpXTGlep.js";
10
+ import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
11
+ import { C as juniorCodeRepositories, S as juniorCodeChanges, g as juniorConversationBriefs, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, w as juniorAttachments, x as juniorConversationAnnotations, y as juniorConversationEvents } from "./executor-4vhvsMZJ.js";
12
12
  import { o as decodeStoredConversationEvent } from "./history-C84mlAwO.js";
13
- import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-FQutO926.js";
14
- import { n as pluginCatalogRuntime } from "./catalog-runtime-cMlAI5LY.js";
15
- import { c as withLock, i as getStateAdapter, o as acquireActiveLock, r as getDefaultRedisStateAdapterFor } from "./adapter-BybMEezj.js";
13
+ import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-BgecKva0.js";
14
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-BD9GSpc6.js";
15
+ import { c as withLock, i as getStateAdapter, o as acquireActiveLock, r as getDefaultRedisStateAdapterFor } from "./adapter-04AcD2SO.js";
16
16
  import { i as isValidTimeZone } from "./cadence-R7Em4RjE.js";
17
17
  import { C as conversationReportEventSchema, Q as parseBriefInput, W as readMessageAttachments, Z as conversationBriefSchema, w as conversationReportMessageEventSchema, z as readMessageCardRefs } from "./conversation-DSo310Ps.js";
18
18
  import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-BW9jFsqZ.js";
@@ -1599,6 +1599,8 @@ async function readConversationAccessFromSql(db, conversationIds, viewer) {
1599
1599
  rootParentConversationId: rootConversation.parentConversationId,
1600
1600
  rootRootConversationId: rootConversation.rootConversationId,
1601
1601
  visibility: rootDestination.visibility,
1602
+ provider: rootDestination.provider,
1603
+ providerTenantId: rootDestination.providerTenantId,
1602
1604
  rootEmailNormalized: rootIdentity.emailNormalized,
1603
1605
  rootEmailVerified: rootIdentity.emailVerified,
1604
1606
  rootUserId: rootIdentity.userId
@@ -1619,7 +1621,11 @@ async function readConversationAccessFromSql(db, conversationIds, viewer) {
1619
1621
  return [row.conversationId, {
1620
1622
  canViewPrivateContent,
1621
1623
  isParticipant,
1622
- visibility
1624
+ visibility,
1625
+ ...validRootConversationId !== void 0 && row.provider !== null && row.providerTenantId ? { tenant: {
1626
+ provider: row.provider,
1627
+ providerTenantId: row.providerTenantId
1628
+ } } : void 0
1623
1629
  }];
1624
1630
  }));
1625
1631
  }
@@ -2030,6 +2036,10 @@ function getDashboardConversationLink(conversationId) {
2030
2036
  function getDashboardTaskLink(taskId) {
2031
2037
  return resolveDashboardPath(`/automations/${encodeURIComponent(taskId)}`);
2032
2038
  }
2039
+ /** Build the review desk URL that selects one Review item. */
2040
+ function getDashboardReviewItemLink(itemId) {
2041
+ return resolveDashboardPath(`/review?item=${encodeURIComponent(itemId)}`);
2042
+ }
2033
2043
  /** Public icon asset URL. Headless and local installs keep text-only identity. */
2034
2044
  function getDashboardObjectIconLink(icon) {
2035
2045
  if (!dashboardConversationLinkOptions) return void 0;
@@ -5812,6 +5822,22 @@ async function postSlackMessage(input) {
5812
5822
  }) } : void 0
5813
5823
  };
5814
5824
  }
5825
+ /** Delete a previously posted Slack message through the shared outbound boundary. */
5826
+ async function deleteSlackMessage(input) {
5827
+ const channelId = requireSlackConversationId(input.channelId, "Slack message deletion");
5828
+ const timestamp = requireSlackMessageTimestamp(input.timestamp, "Slack message deletion");
5829
+ await withSlackRetries(() => getSlackClient().chat.delete({
5830
+ channel: channelId,
5831
+ ts: timestamp
5832
+ }), 3, {
5833
+ action: "chat.delete",
5834
+ idempotent: true,
5835
+ spanAttributes: {
5836
+ "app.slack.channel_id": channelId,
5837
+ "app.slack.message_ts": timestamp
5838
+ }
5839
+ });
5840
+ }
5815
5841
  /** Replace the text and blocks of a message that Junior posted. */
5816
5842
  async function updateSlackMessage(input) {
5817
5843
  const channelId = requireSlackConversationId(input.channelId, "Slack message update");
@@ -9457,4 +9483,4 @@ async function executeCredentialedEgressRequest(input) {
9457
9483
  });
9458
9484
  }
9459
9485
  }
9460
- export { postSlackMessage as $, createPluginAnnotations as $n, downloadPrivateSlackFile as $t, setWorkspaceSnapshotBuild as A, createPluginState as An, slackMessageTurnDisabledReason as At, parseOAuthStatePayload as B, conversationNotArchivedForEmail as Bn, deliverWatch as Bt, listWorkspaces as C, SANDBOX_JUNIOR_ROOT as Cn, normalizeSandboxEgressTracePropagationDomains as Ct, invalidateReadySnapshot as D, sandboxSkillDir as Dn, resolveChannelCapabilities as Dt, WorkspaceValidationError as E, SANDBOX_WORKSPACE_ROOT as En, workspaceRepoCheckoutPath as Et, getSandboxProvider as F, conversationArchiveTimes as Fn, cancelSubscriptions as Ft, normalizeSlackReplyMarkdown as G, readConversationEventPage as Gn, bindEventAutomationCredentialSubject as Gt, startOAuthFlow as H, viewerConversationMembership as Hn, getWatch as Ht, isVercelSandboxEgressRequest as I, conversationArchivedForEmail as In, cancelWatch as It, truncateStatusText as J, matchSlackAttachments as Jn, verifyEventAutomationCredentialSubject as Jt, normalizeSlackStatusText as K, buildSentryConversationUrl as Kn, bindScheduledAutomationCredentialSubject as Kt, proxyVercelSandboxEgressRequest as L, conversationArchivedForUser as Ln, collectEventMatchKeys as Lt, hash as M, createPluginModel as Mn, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as Mt, isStale as N, createPluginLogger as Nn, RESOURCE_WATCH_TOOL_SOURCE as Nt, loadSnapshotsForProfile as O, sandboxSkillFile as On, getSlackToolContext as Ot, ensureDockerDaemon as P, readConversationAccessFromSql as Pn, STOP_WATCHING_TOOL_NAME as Pt, openSlackModal as Q, saveObjectAnnotations as Qn, SlackActionError as Qt, deliverOAuthAuthorization as R, conversationHasParticipantUser as Rn, createTimerWatch as Rt, getWorkspaceByName as S, SANDBOX_DATA_ROOT as Sn, resolveSandboxEgressProviderForHost as St, updateWorkspace as T, SANDBOX_SKILLS_ROOT as Tn, tryWorkspaceRepoCheckoutPath as Tt, escapeSlackMrkdwnText as U, createPluginConversationEvents as Un, listWatches as Ut, resolveBaseUrl as V, conversationNotArchivedForUser as Vn, findMatchingWatches as Vt, formatSlackLink as W, readLatestConversationBrief as Wn, takeDueTimerWatches as Wt, getSlackMessagePermalink as X, recordSlackAttachment as Xn, verifySlackDirectCredentialSubject as Xt, addReactionToMessage as Y, readAttachmentVisionSummary as Yn, verifyScheduledAutomationCredentialSubject as Yt, openSlackDirectMessage as Z, resolveRootVisibility as Zn, verifyTimerWatchCredentialSubject as Zt, registration_exports as _, PluginToolDeniedError as _n, parseSandboxEgressCredentialToken as _t, agent_hooks_exports as a, normalizeSlackConversationId as an, createPluginCache as ar, isAbortError as at, deleteWorkspace as b, runNonInteractiveCommand as bn, buildSandboxEgressNetworkPolicy as bt, getPluginRoutes as c, sleep$1 as cn, agentsInstructionsUpdatedEvent as cr, wrapSandboxSetupError as ct, getPluginTools as d, JUNIOR_THREAD_STATE_TTL_MS as dn, conversationNoteEvent as dr, isWorkspaceSnapshotNotReadyError as dt, getFilePermalink as en, listConversationAnnotations as er, removeReactionFromMessage as et, getPluginUserPromptContributions as f, getDashboardConversationLink as fn, workspaceSnapshotNotReadyUserMessage as ft, coreTaskRegistrations as g, ToolInputError as gn, createSandboxEgressCredentialToken as gt, validatePlugins as h, setDashboardConversationLinkOptions as hn, consumeSandboxEgressPermissionDeniedSignal as ht, resolvePluginOAuthAccount as i, isDmChannel as in, lookupSlackUser as ir, slackExternalRefIdSchema as it, create as j, createPluginEmbedder as jn, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as jt, setWorkspaceSnapshot as k, sandboxSkillPathResolution as kn, isSlackMessageTurn as kt, getPluginSlackConversationLink as l, getWorkspaceTeamId as ln, authenticationLinkedEvent as lr, WorkspaceSnapshotNotReadyError as lt, setPlugins as m, getDashboardTaskLink as mn, consumeSandboxEgressAuthRequiredSignal as mt, createUserTokenStore as n, getSlackClient as nn, defaultTimezone as nr, uploadFilesToConversation as nt, createPluginHookRunner as o, runWithSlackInstallationToken as on, createCache as or, isAlreadyExistsError as ot, getPlugins as p, getDashboardObjectIconLink as pn, clearSandboxEgressSignals as pt, slackMention as q, getSlackFileId as qn, bindSlackDirectCredentialSubject as qt, getOAuthAccountProviders as r, isConversationScopedChannel as rn, resolveUserTimezone as rr, slackEntitySchema as rt, getPluginApiRoutes as s, withSlackRetries as sn, JUNIOR_NATIVE_EVENT_NAMESPACE as sr, throwSandboxOperationError as st, executeCredentialedEgressRequest as t, getHeaderString as tn, listConversationAnnotationsById as tr, updateSlackMessage as tt, getPluginSystemPromptContributions as u, runWithWorkspaceTeamId as un, authenticationUnlinkedEvent as ur, getWorkspaceSnapshotNotReadyError as ut, setBriefsConfig as v, buildCommandScript as vn, parseSandboxEgressAuthRequiredSignal as vt, listWorkspacesByRepository as w, SANDBOX_REPOS_ROOT as wn, SANDBOX_RUNTIME as wt, getWorkspace as x, SANDBOX_COMMAND_PATH as xn, resolveSandboxCommandEnvironment as xt, createWorkspace as y, buildNonInteractiveShellScript as yn, sandboxEgressSignalsResponseSchema as yt, formatProviderLabel as z, conversationIsMemberRoot as zn, createWatch as zt };
9486
+ export { openSlackModal as $, recordSlackAttachment as $n, verifyTimerWatchCredentialSubject as $t, setWorkspaceSnapshotBuild as A, sandboxSkillDir as An, getSlackToolContext as At, parseOAuthStatePayload as B, conversationArchivedForUser as Bn, createTimerWatch as Bt, listWorkspaces as C, runNonInteractiveCommand as Cn, resolveSandboxCommandEnvironment as Ct, invalidateReadySnapshot as D, SANDBOX_REPOS_ROOT as Dn, tryWorkspaceRepoCheckoutPath as Dt, WorkspaceValidationError as E, SANDBOX_JUNIOR_ROOT as En, SANDBOX_RUNTIME as Et, getSandboxProvider as F, createPluginModel as Fn, RESOURCE_WATCH_TOOL_SOURCE as Ft, normalizeSlackReplyMarkdown as G, viewerConversationMembership as Gn, listWatches as Gt, startOAuthFlow as H, conversationIsMemberRoot as Hn, deliverWatch as Ht, isVercelSandboxEgressRequest as I, createPluginLogger as In, STOP_WATCHING_TOOL_NAME as It, truncateStatusText as J, readConversationEventPage as Jn, bindScheduledAutomationCredentialSubject as Jt, normalizeSlackStatusText as K, createPluginConversationEvents as Kn, takeDueTimerWatches as Kt, proxyVercelSandboxEgressRequest as L, readConversationAccessFromSql as Ln, cancelSubscriptions as Lt, hash as M, sandboxSkillPathResolution as Mn, slackMessageTurnDisabledReason as Mt, isStale as N, createPluginState as Nn, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as Nt, loadSnapshotsForProfile as O, SANDBOX_SKILLS_ROOT as On, workspaceRepoCheckoutPath as Ot, ensureDockerDaemon as P, createPluginEmbedder as Pn, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as Pt, openSlackDirectMessage as Q, readAttachmentVisionSummary as Qn, verifySlackDirectCredentialSubject as Qt, deliverOAuthAuthorization as R, conversationArchiveTimes as Rn, cancelWatch as Rt, getWorkspaceByName as S, buildNonInteractiveShellScript as Sn, buildSandboxEgressNetworkPolicy as St, updateWorkspace as T, SANDBOX_DATA_ROOT as Tn, normalizeSandboxEgressTracePropagationDomains as Tt, escapeSlackMrkdwnText as U, conversationNotArchivedForEmail as Un, findMatchingWatches as Ut, resolveBaseUrl as V, conversationHasParticipantUser as Vn, createWatch as Vt, formatSlackLink as W, conversationNotArchivedForUser as Wn, getWatch as Wt, deleteSlackMessage as X, getSlackFileId as Xn, verifyEventAutomationCredentialSubject as Xt, addReactionToMessage as Y, buildSentryConversationUrl as Yn, bindSlackDirectCredentialSubject as Yt, getSlackMessagePermalink as Z, matchSlackAttachments as Zn, verifyScheduledAutomationCredentialSubject as Zt, registration_exports as _, getDashboardTaskLink as _n, consumeSandboxEgressPermissionDeniedSignal as _t, agent_hooks_exports as a, isConversationScopedChannel as an, defaultTimezone as ar, slackEntitySchema as at, deleteWorkspace as b, PluginToolDeniedError as bn, parseSandboxEgressAuthRequiredSignal as bt, getPluginRoutes as c, runWithSlackInstallationToken as cn, createPluginCache as cr, isAlreadyExistsError as ct, getPluginTools as d, getWorkspaceTeamId as dn, agentsInstructionsUpdatedEvent as dr, WorkspaceSnapshotNotReadyError as dt, SlackActionError as en, resolveRootVisibility as er, postSlackEphemeralMessage as et, getPluginUserPromptContributions as f, runWithWorkspaceTeamId as fn, authenticationLinkedEvent as fr, getWorkspaceSnapshotNotReadyError as ft, coreTaskRegistrations as g, getDashboardReviewItemLink as gn, consumeSandboxEgressAuthRequiredSignal as gt, validatePlugins as h, getDashboardObjectIconLink as hn, clearSandboxEgressSignals as ht, resolvePluginOAuthAccount as i, getSlackClient as in, listConversationAnnotationsById as ir, uploadFilesToConversation as it, create as j, sandboxSkillFile as jn, isSlackMessageTurn as jt, setWorkspaceSnapshot as k, SANDBOX_WORKSPACE_ROOT as kn, resolveChannelCapabilities as kt, getPluginSlackConversationLink as l, withSlackRetries as ln, createCache as lr, throwSandboxOperationError as lt, setPlugins as m, getDashboardConversationLink as mn, conversationNoteEvent as mr, workspaceSnapshotNotReadyUserMessage as mt, createUserTokenStore as n, getFilePermalink as nn, createPluginAnnotations as nr, removeReactionFromMessage as nt, createPluginHookRunner as o, isDmChannel as on, resolveUserTimezone as or, slackExternalRefIdSchema as ot, getPlugins as p, JUNIOR_THREAD_STATE_TTL_MS as pn, authenticationUnlinkedEvent as pr, isWorkspaceSnapshotNotReadyError as pt, slackMention as q, readLatestConversationBrief as qn, bindEventAutomationCredentialSubject as qt, getOAuthAccountProviders as r, getHeaderString as rn, listConversationAnnotations as rr, updateSlackMessage as rt, getPluginApiRoutes as s, normalizeSlackConversationId as sn, lookupSlackUser as sr, isAbortError as st, executeCredentialedEgressRequest as t, downloadPrivateSlackFile as tn, saveObjectAnnotations as tr, postSlackMessage as tt, getPluginSystemPromptContributions as u, sleep$1 as un, JUNIOR_NATIVE_EVENT_NAMESPACE as ur, wrapSandboxSetupError as ut, setBriefsConfig as v, setDashboardConversationLinkOptions as vn, createSandboxEgressCredentialToken as vt, listWorkspacesByRepository as w, SANDBOX_COMMAND_PATH as wn, resolveSandboxEgressProviderForHost as wt, getWorkspace as x, buildCommandScript as xn, sandboxEgressSignalsResponseSchema as xt, createWorkspace as y, ToolInputError as yn, parseSandboxEgressCredentialToken as yt, formatProviderLabel as z, conversationArchivedForEmail as zn, collectEventMatchKeys as zt };
@@ -0,0 +1,6 @@
1
+ import "./store-xMuuXRE0.js";
2
+ import "./schema-ZngqcOWM.js";
3
+ import { z } from "zod";
4
+ import "drizzle-orm/pg-core";
5
+ import "drizzle-orm/migrator";
6
+ import "drizzle-orm/pg-core/session";
@@ -1,6 +1,6 @@
1
- import "./config-CdB6yJj5.js";
2
- import { p as logException } from "./logging-DuZ1A4ab.js";
3
- import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-CxKldAeB.js";
1
+ import "./config-DrTeF80T.js";
2
+ import { p as logException } from "./logging-DLSpkSSr.js";
3
+ import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  import { sql } from "drizzle-orm";
6
6
  import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, uniqueIndex, uuid } from "drizzle-orm/pg-core";
@@ -382,6 +382,76 @@ const juniorAutomationRuns = pgTable("junior_automation_runs", {
382
382
  index("junior_automation_runs_completed_idx").on(table.completedAtMs),
383
383
  index("junior_automation_runs_incomplete_idx").on(table.automationId, table.scheduledForMs).where(sql`${table.status} in ('pending', 'running')`)
384
384
  ]);
385
+ // src/db/schema/review-items.ts
386
+ /**
387
+ * One Review item: something that needs a person. See
388
+ * `chat/review-items/README.md`. An action item stores its `request`, and
389
+ * its `answer` after an assignee submits it. `closed_at` is set for `done`
390
+ * and `dismissed`. `closed_by_user_id` is null when an agent closed it.
391
+ */
392
+ const juniorReviewItems = pgTable("junior_review_items", {
393
+ id: text("id").primaryKey(),
394
+ kind: text("kind").$type().notNull(),
395
+ status: text("status").$type().notNull(),
396
+ /**
397
+ * `private` when the Conversation that added it is not public. A private
398
+ * item stays private and links only to that Conversation.
399
+ */
400
+ visibility: text("visibility").$type().notNull(),
401
+ title: text("title").notNull(),
402
+ body: text("body").notNull(),
403
+ request: jsonb("request").$type(),
404
+ answer: jsonb("answer").$type(),
405
+ assignedToEveryone: boolean("assigned_to_everyone").notNull().default(false),
406
+ dedupeKey: text("dedupe_key").notNull(),
407
+ subjectId: text("subject_id"),
408
+ subjectTitle: text("subject_title"),
409
+ subjectUrl: text("subject_url"),
410
+ /** Conversation of the agent that added the item. */
411
+ addedByConversationId: text("added_by_conversation_id").notNull(),
412
+ /**
413
+ * Provider tenant, such as a Slack workspace, of the Conversation that
414
+ * added the item. A public item is visible only inside it.
415
+ */
416
+ provider: text("provider"),
417
+ providerTenantId: text("provider_tenant_id"),
418
+ automationId: text("automation_id").references(() => juniorAutomations.id, { onDelete: "set null" }),
419
+ closedAt: timestamptz("closed_at"),
420
+ closedByUserId: text("closed_by_user_id").references(() => juniorUsers.id),
421
+ closeReason: text("close_reason"),
422
+ createdAt: timestamptz("created_at").notNull(),
423
+ updatedAt: timestamptz("updated_at").notNull()
424
+ }, (table) => [
425
+ check("junior_review_items_kind_check", sql`(${table.kind} = 'notice' and ${table.request} is null and ${table.answer} is null) or (${table.kind} = 'action' and ${table.request} is not null)`),
426
+ check("junior_review_items_status_check", sql`(${table.status} = 'open' and ${table.closedAt} is null) or (${table.status} in ('done', 'dismissed') and ${table.closedAt} is not null)`),
427
+ check("junior_review_items_tenant_check", sql`(${table.provider} is null) = (${table.providerTenantId} is null)`),
428
+ check("junior_review_items_visibility_check", sql`${table.visibility} = 'public' or not ${table.assignedToEveryone}`),
429
+ uniqueIndex("junior_review_items_open_dedupe_uidx").on(sql`coalesce(${table.provider}, '')`, sql`coalesce(${table.providerTenantId}, '')`, table.dedupeKey).where(sql`${table.status} = 'open'`),
430
+ index("junior_review_items_status_idx").on(table.status, table.updatedAt, table.id),
431
+ index("junior_review_items_subject_idx").on(table.subjectId, table.status),
432
+ index("junior_review_items_automation_idx").on(table.automationId, table.status)
433
+ ]);
434
+ /** The assigned Users of a Review item. Everyone is a flag on the item. */
435
+ const juniorReviewItemAssignees = pgTable("junior_review_item_assignees", {
436
+ itemId: text("item_id").notNull().references(() => juniorReviewItems.id, { onDelete: "cascade" }),
437
+ userId: text("user_id").notNull().references(() => juniorUsers.id, { onDelete: "cascade" })
438
+ }, (table) => [primaryKey({ columns: [table.itemId, table.userId] }), index("junior_review_item_assignees_user_idx").on(table.userId)]);
439
+ /** The Conversations linked to a Review item. */
440
+ const juniorReviewItemConversations = pgTable("junior_review_item_conversations", {
441
+ itemId: text("item_id").notNull().references(() => juniorReviewItems.id, { onDelete: "cascade" }),
442
+ conversationId: text("conversation_id").notNull().references(() => juniorConversations.conversationId, { onDelete: "cascade" })
443
+ }, (table) => [primaryKey({ columns: [table.itemId, table.conversationId] }), index("junior_review_item_conversations_conversation_idx").on(table.conversationId)]);
444
+ /**
445
+ * The Slack message that shows a Review item in one linked Slack thread.
446
+ * Junior updates it in place after each change.
447
+ */
448
+ const juniorReviewItemSlackCards = pgTable("junior_review_item_slack_cards", {
449
+ itemId: text("item_id").notNull().references(() => juniorReviewItems.id, { onDelete: "cascade" }),
450
+ conversationId: text("conversation_id").notNull(),
451
+ teamId: text("team_id").notNull(),
452
+ channelId: text("channel_id").notNull(),
453
+ messageTs: text("message_ts").notNull()
454
+ }, (table) => [primaryKey({ columns: [table.itemId, table.conversationId] })]);
385
455
  // src/db/schema/workspaces.ts
386
456
  /** Named recipe used to prepare a reusable Sandbox. */
387
457
  const juniorWorkspaces = pgTable("junior_workspaces", {
@@ -455,6 +525,10 @@ const juniorSqlSchema = {
455
525
  juniorLocationConfigurations,
456
526
  juniorDestinations,
457
527
  juniorIdentities,
528
+ juniorReviewItemAssignees,
529
+ juniorReviewItemConversations,
530
+ juniorReviewItemSlackCards,
531
+ juniorReviewItems,
458
532
  juniorSnapshots,
459
533
  juniorStats,
460
534
  juniorAutomationRuns,
@@ -709,4 +783,4 @@ function createJuniorSqlExecutor(args) {
709
783
  statementTimeoutMs
710
784
  });
711
785
  }
712
- export { juniorConversationAnnotations as _, juniorAutomationRuns as a, juniorAttachments as b, juniorStats as c, juniorConversationBindings as d, juniorConversationBriefs as f, juniorApiTokens as g, juniorConversationEvents as h, juniorWorkspaces as i, juniorLocationConfigurations as l, juniorConversationMetrics as m, juniorSnapshots as n, juniorAutomationVersions as o, CONVERSATION_METRICS as p, juniorWorkspaceRepos as r, juniorAutomations as s, createJuniorSqlExecutor as t, juniorConversationParticipants as u, juniorCodeChanges as v, juniorArtifacts as x, juniorCodeRepositories as y };
786
+ export { juniorCodeRepositories as C, juniorCodeChanges as S, juniorArtifacts as T, CONVERSATION_METRICS as _, juniorReviewItemAssignees as a, juniorApiTokens as b, juniorReviewItems as c, juniorAutomations as d, juniorStats as f, juniorConversationBriefs as g, juniorConversationBindings as h, juniorWorkspaces as i, juniorAutomationRuns as l, juniorConversationParticipants as m, juniorSnapshots as n, juniorReviewItemConversations as o, juniorLocationConfigurations as p, juniorWorkspaceRepos as r, juniorReviewItemSlackCards as s, createJuniorSqlExecutor as t, juniorAutomationVersions as u, juniorConversationMetrics as v, juniorAttachments as w, juniorConversationAnnotations as x, juniorConversationEvents as y };
@@ -1,6 +1,6 @@
1
- import { F as getDeploymentServiceVersion, I as getDeploymentTelemetryAttributes } from "./logging-DuZ1A4ab.js";
1
+ import { F as getDeploymentServiceVersion, I as getDeploymentTelemetryAttributes } from "./logging-DLSpkSSr.js";
2
2
  import { a as getClient, c as init, o as getGlobalScope } from "./sentry-MDkYAVPV.js";
3
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-BzgJC5k0.js";
3
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-CxlOCiUo.js";
4
4
  import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
5
5
  // src/chat/sentry-payload-filter.ts
6
6
  const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
@@ -1,4 +1,4 @@
1
- import { Fn as extractAssistantText } from "./tasks-0ilmuCux.js";
1
+ import { Ln as extractAssistantText } from "./tasks-SB9z-VTU.js";
2
2
  // src/chat/no-reply.ts
3
3
  const NO_REPLY_MARKER = "[[NO_REPLY]]";
4
4
  /**
@@ -40,4 +40,10 @@ function getAssistantReplyText(message) {
40
40
  const decision = decideReply(message);
41
41
  return decision.kind === "deliver" ? decision.text : void 0;
42
42
  }
43
- export { isNoReplyMarker as a, NO_REPLY_MARKER as i, getAssistantReplyText as n, sanitizeAssistantText as r, decideReply as t };
43
+ // src/chat/interruption-marker.ts
44
+ const INTERRUPTED_MARKER = "\n\n[Response interrupted before completion]";
45
+ /** Return the marker added when a visible reply ended mid-execution. */
46
+ function getInterruptionMarker() {
47
+ return INTERRUPTED_MARKER;
48
+ }
49
+ export { NO_REPLY_MARKER as a, sanitizeAssistantText as i, decideReply as n, isNoReplyMarker as o, getAssistantReplyText as r, getInterruptionMarker as t };
@@ -1,5 +1,5 @@
1
- import { i as getChatConfig } from "./config-CdB6yJj5.js";
2
- import { E as withSpan, m as logInfo, p as logException } from "./logging-DuZ1A4ab.js";
1
+ import { i as getChatConfig } from "./config-DrTeF80T.js";
2
+ import { E as withSpan, m as logInfo, p as logException } from "./logging-DLSpkSSr.js";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
4
  import { z } from "zod";
5
5
  import { createHash, createHmac, timingSafeEqual } from "node:crypto";