@sentry/junior 0.255.0 → 0.257.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 (68) hide show
  1. package/dist/{admin-CeJh4SuR.js → admin-DgIkm6Vy.js} +1 -1
  2. package/dist/{agent-hooks-CDVx26Uu.js → agent-hooks-BjtTzvru.js} +13 -13
  3. package/dist/{agent-invocations-BY60iNw-.js → agent-invocations-Bdu3ROfo.js} +2 -1
  4. package/dist/{agent-runner-Caiof09f.js → agent-runner-D7OboVb3.js} +41 -33
  5. package/dist/api/schema.d.ts +41 -1
  6. package/dist/api/schema.js +2 -2
  7. package/dist/api.js +121 -33
  8. package/dist/{app-B0gT1Slp.d.ts → app-BsU5QNBd.d.ts} +7 -1
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +587 -210
  11. package/dist/{assistant-reply-BddmM66R.js → assistant-reply-CbTPebzL.js} +1 -1
  12. package/dist/{briefs-iVq_8-ft.js → briefs-oLOldnDM.js} +4 -4
  13. package/dist/{catalog-runtime-hKmI-iZa.js → catalog-runtime-CZzhGQ7F.js} +1 -1
  14. package/dist/cli/chat.js +16 -16
  15. package/dist/cli/check.js +3 -3
  16. package/dist/cli/main.js +2 -2
  17. package/dist/cli/plugins.js +4 -4
  18. package/dist/cli/snapshot-create.js +3 -3
  19. package/dist/cli/upgrade.js +3 -3
  20. package/dist/{client-Clj7onnT.js → client-D8HnkOQX.js} +2 -2
  21. package/dist/{config-BDAfLTI9.js → config-CJRnWK9H.js} +2 -2
  22. package/dist/{connections-BC0RTejT.js → connections-ClYrKzpX.js} +16 -11
  23. package/dist/{conversation-T18Xlkx9.js → conversation-CKNLYBJt.js} +3 -2
  24. package/dist/{conversation-privacy-1ERtieuM.js → conversation-privacy-C8b1nphZ.js} +1 -1
  25. package/dist/{credential-sync-BZuqqIHk.js → credential-sync-BXfohNmJ.js} +82 -40
  26. package/dist/{executor-Dh4Ofsnx.js → executor-Do0THDRR.js} +33 -23
  27. package/dist/{experimental-Qn9rKLgx.js → experimental-CQIvMUO7.js} +1 -0
  28. package/dist/{images-C-WOnTc_.js → images-BN_BiBXF.js} +3 -3
  29. package/dist/instrumentation.js +2 -2
  30. package/dist/{job-queue-BaCL36FY.js → job-queue-B6SV9uVa.js} +1 -1
  31. package/dist/{logging-D3aYP0aG.js → logging-CWxiIuCF.js} +50 -15
  32. package/dist/{message-B9xqD2BP.js → message-TUOdbSBW.js} +3 -3
  33. package/dist/nitro.d.ts +1 -1
  34. package/dist/nitro.js +3 -3
  35. package/dist/{oauth-callback-server-i5qdAou6.js → oauth-callback-server-Dj5UJODo.js} +2 -2
  36. package/dist/{pending-auth-D2t1Moxf.js → pending-auth-s_QFribU.js} +3 -3
  37. package/dist/{profile-DnkX3e2S.js → profile-h-72wM78.js} +4 -4
  38. package/dist/{prompt-C04mP1hu.js → prompt-DyoEj9c2.js} +1 -1
  39. package/dist/{registry-CmKmKHpp.js → registry-sLTr-sV9.js} +43 -3
  40. package/dist/{resolve-jfNHtEBx.js → resolve-ncQPZROQ.js} +2 -2
  41. package/dist/{result-Df5nEDX2.js → result-C883vngT.js} +7 -7
  42. package/dist/{runner-CmzoXEI4.js → runner-CzYImdOF.js} +10 -10
  43. package/dist/{sandbox-egress-signals-DjMNKLZz.js → sandbox-egress-signals-CZbMINHI.js} +1 -1
  44. package/dist/{schema-BBgv0MNf.js → schema-Dy69D4Ge.js} +4 -3
  45. package/dist/{session-stop-BEBfE97J.js → session-stop-CQjKd4a2.js} +46 -20
  46. package/dist/{skills-Dc-AMYi4.js → skills-C22SLruK.js} +2 -2
  47. package/dist/{spawn-OgTwBUj0.js → spawn-DY9CLXDL.js} +2 -2
  48. package/dist/{store-BashBewg.js → store-DXFIQy-G.js} +6 -6
  49. package/dist/{task-queue-VvIKqlQ4.js → task-queue-B17vV0La.js} +3 -3
  50. package/dist/{task-runner-D2CpD6GN.js → task-runner-DUjvzYXj.js} +11 -11
  51. package/dist/{tasks-dJooqiip.js → tasks-D_WIJtvO.js} +25 -10
  52. package/dist/{thread-state-CsMC-ob0.js → thread-state-Ch4yuCqG.js} +7 -7
  53. package/dist/{turn-failure-response-zB364t7_.js → turn-failure-response-C5nBKC4S.js} +8 -8
  54. package/dist/{turn-lifecycle-BfodfmiY.js → turn-lifecycle-CO-ylUmV.js} +1 -1
  55. package/dist/{turn-session-routing-BAh_qsBJ.js → turn-session-routing-B3LWooK5.js} +1 -1
  56. package/dist/{validation-LzIilOb6.js → validation-CXYxaNYx.js} +1 -1
  57. package/dist/{version-CDM8Rq6E.js → version-BcdZy2zg.js} +1 -1
  58. package/dist/version.js +1 -1
  59. package/dist/{viewer-Rnim7alE.js → viewer-DSZXygMU.js} +53 -5
  60. package/dist/{web-input-Dc1VwcT4.js → web-input-B9Bv0_lR.js} +73 -75
  61. package/dist/{work-BAn43SsN.js → work-nAfDSUFP.js} +9 -9
  62. package/dist/{worker-mBXq4_zg.js → worker-vGXZ6XFT.js} +5 -5
  63. package/migrations/0059_automation_run_version.sql +2 -0
  64. package/migrations/0060_identity_signed_in_at.sql +1 -0
  65. package/migrations/meta/0059_snapshot.json +3619 -0
  66. package/migrations/meta/0060_snapshot.json +3465 -0
  67. package/migrations/meta/_journal.json +15 -1
  68. package/package.json +6 -5
@@ -1,5 +1,5 @@
1
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-CDM8Rq6E.js";
2
+ import { t as JUNIOR_VERSION } from "./version-BcdZy2zg.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";
@@ -18,6 +18,26 @@ function isRecord(value) {
18
18
  return typeof value === "object" && value !== null;
19
19
  }
20
20
  //#endregion
21
+ //#region src/chat/identities/identity.ts
22
+ /**
23
+ * Provider of the native Google identity. Core links it through Google
24
+ * sign-in. Its tenant is empty and its subject is the Google OIDC `sub`.
25
+ */
26
+ const GOOGLE_IDENTITY_PROVIDER = "google";
27
+ const NATIVE_IDENTITY_PROVIDERS = /* @__PURE__ */ new Set(["slack", GOOGLE_IDENTITY_PROVIDER]);
28
+ /**
29
+ * Return whether only core may link identities for this provider. Plugin
30
+ * OAuth accounts must not link under these names, because other checks trust
31
+ * them.
32
+ */
33
+ function isNativeIdentityProvider(provider) {
34
+ return NATIVE_IDENTITY_PROVIDERS.has(provider);
35
+ }
36
+ /** Canonicalize email addresses for identity lookup and linking. */
37
+ function normalizeIdentityEmail(email) {
38
+ return email?.trim().toLowerCase() || void 0;
39
+ }
40
+ //#endregion
21
41
  //#region src/chat/log-context.ts
22
42
  /** Async attribute domain consumed directly by LogTape. */
23
43
  const logContextStorage = new AsyncLocalStorage();
@@ -38,11 +58,15 @@ function logContextToAttributes(context) {
38
58
  "messaging.system": context.platform === "slack" ? "slack" : context.platform,
39
59
  "messaging.message.conversation_id": context.messageConversationId,
40
60
  "messaging.destination.name": context.destinationName,
41
- "enduser.id": context.userId,
42
- "enduser.pseudo.id": context.userName,
61
+ "user.id": context.userId,
62
+ "user.name": context.userName,
63
+ "user.email": normalizeIdentityEmail(context.userEmail),
64
+ "user.full_name": context.userFullName,
43
65
  "app.run.id": context.runId,
44
66
  "app.actor.type": context.actorType,
45
67
  "app.actor.id": context.actorId,
68
+ "app.task.id": context.taskId,
69
+ "app.credential.allowed_when": context.credentialAllowedWhen,
46
70
  "gen_ai.agent.name": context.assistantUserName,
47
71
  "gen_ai.request.model": context.modelId,
48
72
  "app.skill.name": context.skillName,
@@ -78,12 +102,6 @@ function getBoundLogAttributes() {
78
102
  return logContextStorage.getStore() ?? {};
79
103
  }
80
104
  //#endregion
81
- //#region src/chat/identities/identity.ts
82
- /** Canonicalize email addresses for identity lookup and linking. */
83
- function normalizeIdentityEmail(email) {
84
- return email?.trim().toLowerCase() || void 0;
85
- }
86
- //#endregion
87
105
  //#region src/deployment.ts
88
106
  const JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
89
107
  const JUNIOR_HEARTBEAT_CRON_SCHEDULE = "* * * * *";
@@ -218,8 +236,10 @@ const CONSOLE_PRIORITY_INDEX = new Map([
218
236
  const CONSOLE_ALWAYS_HIDDEN_KEYS = /* @__PURE__ */ new Set([
219
237
  "gen_ai.agent.name",
220
238
  "app.platform",
221
- "enduser.id",
222
- "enduser.pseudo.id",
239
+ "user.id",
240
+ "user.name",
241
+ "user.email",
242
+ "user.full_name",
223
243
  "http.request.method",
224
244
  "messaging.system",
225
245
  "url.full",
@@ -246,8 +266,10 @@ const SENTRY_TAG_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
246
266
  function getSentryEnvironment() {
247
267
  return (process.env.SENTRY_ENVIRONMENT ?? process.env.VERCEL_ENV ?? process.env.NODE_ENV ?? "").trim().toLowerCase();
248
268
  }
249
- function shouldSuppressInfoLog(level) {
250
- return getSentryEnvironment() === "production" && level === "info";
269
+ /** Marks an audit event. Sentry keeps it in production. */
270
+ const AUDIT_LOG_ATTRIBUTE = "app.log.audit";
271
+ function shouldSuppressInfoLog(level, attributes) {
272
+ return getSentryEnvironment() === "production" && level === "info" && attributes[AUDIT_LOG_ATTRIBUTE] !== true;
251
273
  }
252
274
  function shouldEmitConsole(level) {
253
275
  if (process.env.NODE_ENV === "test") return level === "error";
@@ -516,7 +538,7 @@ function getLogTapeLogger(category = []) {
516
538
  return logger;
517
539
  }
518
540
  function emitSentry(level, body, attributes) {
519
- if (shouldSuppressInfoLog(level)) return;
541
+ if (shouldSuppressInfoLog(level, attributes)) return;
520
542
  const loggerFn = logger?.[level];
521
543
  if (typeof loggerFn === "function") {
522
544
  loggerFn(body, attributes);
@@ -946,6 +968,19 @@ function logInfo(eventName, attributes = {}) {
946
968
  log.info(eventName, attributes);
947
969
  }
948
970
  /**
971
+ * Emit an audit event: an info event that Sentry also keeps in production.
972
+ *
973
+ * Use it only to record who caused an external side effect and why. Other
974
+ * info events stay out of Sentry in production. Sentry log retention is not
975
+ * durable audit storage.
976
+ */
977
+ function logAudit(eventName, attributes = {}) {
978
+ log.info(eventName, {
979
+ ...attributes,
980
+ [AUDIT_LOG_ATTRIBUTE]: true
981
+ });
982
+ }
983
+ /**
949
984
  * Emit a warning event with occurrence-specific attributes.
950
985
  *
951
986
  * Bind correlation context at the owning operation boundary instead of
@@ -1207,4 +1242,4 @@ function extractGenAiUsageAttributes(...sources) {
1207
1242
  };
1208
1243
  }
1209
1244
  //#endregion
1210
- export { JUNIOR_RETENTION_ROUTE as A, withLogContext as C, JUNIOR_HEARTBEAT_ROUTE as D, JUNIOR_HEARTBEAT_CRON_SCHEDULE as E, normalizeIdentityEmail as F, isRecord as I, toOptionalNumber as L, LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION as M, getDeploymentServiceVersion as N, JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE as O, getDeploymentTelemetryAttributes as P, toOptionalString as R, withContext as S, JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE as T, setSentryUser as _, extractGenAiUsageSummary as a, setTags as b, getLogContextAttributesForSpan as c, logException as d, logInfo as f, serializeGenAiAttribute as g, runBestEffort as h, extractGenAiUsageAttributes as i, JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE as j, JUNIOR_RETENTION_CRON_SCHEDULE as k, getTracePropagationHeaders as l, normalizeGenAiFinishReason as m, createChatSdkLogger as n, getActiveTraceId as o, logWarn as p, createRequestContext as r, getLogContextAttributes as s, buildTurnFailureResponse as t, logError as u, setSpanAttributes as v, withSpan as w, summarizeMessageText as x, setSpanStatus as y };
1245
+ 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,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { Ht as toolInvocationDestination, Q as getActiveAgentInvocationForConversation, Vt as actorFromRun, Y as createAgentInvocationForMessage, Z as findChildAgentConversationId, _t as AgentMessageTargetError, vt as PARENT_AGENT_TARGET } from "./agent-runner-Caiof09f.js";
3
- import { n as enqueueAgentMessageToParent } from "./result-Df5nEDX2.js";
4
- import { r as enqueueAgentInvocation } from "./work-BAn43SsN.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
5
  //#region src/chat/agent-invocations/message.ts
6
6
  var message_exports = /* @__PURE__ */ __exportAll({ bindMessageAgent: () => bindMessageAgent });
7
7
  /**
package/dist/nitro.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { r as JuniorDashboardOptions } from "./app-B0gT1Slp.js";
1
+ import { r as JuniorDashboardOptions } from "./app-BsU5QNBd.js";
2
2
  import { n as JuniorPluginSet } from "./plugins-CjfUP5gJ.js";
3
3
  //#region src/nitro.d.ts
4
4
  export type JuniorNitroDashboardOptions = JuniorDashboardOptions;
package/dist/nitro.js CHANGED
@@ -1,8 +1,8 @@
1
- import { A as JUNIOR_RETENTION_ROUTE, D as JUNIOR_HEARTBEAT_ROUTE, E as JUNIOR_HEARTBEAT_CRON_SCHEDULE, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, k as JUNIOR_RETENTION_CRON_SCHEDULE } from "./logging-D3aYP0aG.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-CWxiIuCF.js";
2
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-BaCL36FY.js";
3
+ import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-B6SV9uVa.js";
4
4
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-egKWjgue.js";
5
- import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-VvIKqlQ4.js";
5
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-B17vV0La.js";
6
6
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-CVvEUSMH.js";
7
7
  import path from "node:path";
8
8
  import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
@@ -1,5 +1,5 @@
1
- import { Lt as createUserTokenStore } from "./agent-runner-Caiof09f.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-BZuqqIHk.js";
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";
3
3
  import { createServer } from "node:http";
4
4
  //#region src/chat/local/oauth-callback-server.ts
5
5
  const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
@@ -1,6 +1,6 @@
1
- import { v as isProviderRetryError } from "./client-Clj7onnT.js";
2
- import { cn as estimateTextTokens, q as abandonTurnRecord } from "./tasks-dJooqiip.js";
3
- import { r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
1
+ import { v as isProviderRetryError } from "./client-D8HnkOQX.js";
2
+ import { J as abandonTurnRecord, ln as estimateTextTokens } from "./tasks-D_WIJtvO.js";
3
+ import { r as isExperimentalFeatureEnabled } from "./experimental-CQIvMUO7.js";
4
4
  import { z } from "zod";
5
5
  //#region src/chat/state/turn-id.ts
6
6
  /** Build a stable turn identifier from a message ID. */
@@ -1,7 +1,7 @@
1
- import { S as toOptionalTrimmed } from "./client-Clj7onnT.js";
2
- import { v as setSpanAttributes, y as setSpanStatus } from "./logging-D3aYP0aG.js";
3
- import { i as getChatConfig } from "./config-BDAfLTI9.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-hKmI-iZa.js";
1
+ import { S as toOptionalTrimmed } from "./client-D8HnkOQX.js";
2
+ import { b as setSpanStatus, y as setSpanAttributes } from "./logging-CWxiIuCF.js";
3
+ import { i as getChatConfig } from "./config-CJRnWK9H.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-CZzhGQ7F.js";
5
5
  import { createHash } from "node:crypto";
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
7
7
  import { createRedisState } from "@chat-adapter/state-redis";
@@ -1,4 +1,4 @@
1
- import { H as conversationBriefSchema, U as parseBriefInput, V as briefOutcomeStatusSchema } from "./conversation-T18Xlkx9.js";
1
+ import { H as conversationBriefSchema, U as parseBriefInput, V as briefOutcomeStatusSchema } from "./conversation-CKNLYBJt.js";
2
2
  import { z } from "zod";
3
3
  //#region src/chat/briefs/generate.ts
4
4
  const MAX_INPUT_CHARS = 6e4;
@@ -1,5 +1,5 @@
1
- import { f as logInfo, p as logWarn, v as setSpanAttributes } from "./logging-D3aYP0aG.js";
2
- import { o as parseActorUserId } from "./actor-BTtLaeWy.js";
1
+ import { m as logWarn, p as logInfo, y as setSpanAttributes } from "./logging-CWxiIuCF.js";
2
+ import { a as isUserActor, o as parseActorUserId } from "./actor-BTtLaeWy.js";
3
3
  import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-BVvSnQBB.js";
4
4
  import path from "node:path";
5
5
  import { z } from "zod";
@@ -840,6 +840,46 @@ function credentialContextForActor(actor, subject) {
840
840
  userId: actor.userId
841
841
  } };
842
842
  }
843
+ /**
844
+ * Name the person accountable for credential authority in logs.
845
+ *
846
+ * `userId` is the user actor, or the owner of delegated credentials when the
847
+ * system acts for an Automation or Watch. `actorType` says who acted.
848
+ */
849
+ function credentialLogContext(context) {
850
+ if ("type" in context.actor) return {
851
+ userId: context.actor.userId,
852
+ actorType: "user",
853
+ actorId: context.actor.userId
854
+ };
855
+ const subject = "subject" in context ? context.subject : void 0;
856
+ return {
857
+ actorType: "system",
858
+ actorId: context.actor.name,
859
+ ...subject ? {
860
+ userId: subject.userId,
861
+ credentialAllowedWhen: subject.allowedWhen,
862
+ ..."taskId" in subject ? { taskId: subject.taskId } : void 0
863
+ } : void 0
864
+ };
865
+ }
866
+ /**
867
+ * Name the run's people in logs: the accountable person and who acted.
868
+ *
869
+ * A user actor is the accountable person. A system actor names the owner of
870
+ * delegated credentials, when the run has them.
871
+ */
872
+ function actorLogContext(actor, credentialContext) {
873
+ const credential = credentialContext ? credentialLogContext(credentialContext) : {};
874
+ if (!isUserActor(actor)) return credential;
875
+ return {
876
+ ...credential,
877
+ userId: actor.userId,
878
+ userName: actor.userName,
879
+ userEmail: actor.email,
880
+ userFullName: actor.fullName
881
+ };
882
+ }
843
883
  /** Return the user whose OAuth token may satisfy this credential request. */
844
884
  function credentialUserSubjectId(context) {
845
885
  if ("type" in context.actor) return context.actor.userId;
@@ -1604,4 +1644,4 @@ function createPluginCatalogRuntime() {
1604
1644
  };
1605
1645
  }
1606
1646
  //#endregion
1607
- export { parsePluginManifest as _, resolveAuthTokenPlaceholder as a, fetchWithBoundedOAuthErrorBodies as c, credentialContextForActor as d, credentialContextSchema as f, parseInlinePluginManifest as g, CredentialUnavailableError as h, resolvePluginHeaderEnvRefs as i, getOAuthProviderErrorAttributes as l, credentialUserSubjectId as m, buildOAuthTokenRequest as n, resolvePluginCommandEnv as o, credentialSubjectSchema as p, parseOAuthTokenResponse as r, OAuthProviderError as s, createPluginCatalogRuntime as t, hasRequiredOAuthScope as u };
1647
+ export { CredentialUnavailableError as _, resolveAuthTokenPlaceholder as a, fetchWithBoundedOAuthErrorBodies as c, actorLogContext as d, credentialContextForActor as f, credentialUserSubjectId as g, credentialSubjectSchema as h, resolvePluginHeaderEnvRefs as i, getOAuthProviderErrorAttributes as l, credentialLogContext as m, buildOAuthTokenRequest as n, resolvePluginCommandEnv as o, credentialContextSchema as p, parseOAuthTokenResponse as r, OAuthProviderError as s, createPluginCatalogRuntime as t, hasRequiredOAuthScope as u, parseInlinePluginManifest as v, parsePluginManifest as y };
@@ -1,5 +1,5 @@
1
- import { v as setSpanAttributes, w as withSpan } from "./logging-D3aYP0aG.js";
2
- import { N as SANDBOX_WORKSPACE_ROOT, k as sleep, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-DnkX3e2S.js";
1
+ import { T as withSpan, y as setSpanAttributes } from "./logging-CWxiIuCF.js";
2
+ import { N as SANDBOX_WORKSPACE_ROOT, k as sleep, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-h-72wM78.js";
3
3
  import { z } from "zod";
4
4
  import { FileSystem, Sandbox } from "@vercel/sandbox";
5
5
  //#region src/chat/sandbox/resources.ts
@@ -1,12 +1,12 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { $ as getAgentInvocation, X as createAgentInvocationFromLatest, ct as isTerminalAgentInvocation, et as getAgentInvocationIdForEvents, ft as markAgentInvocationParentMailboxAppended, it as getAgentInvocationResultMessageId, nt as getAgentInvocationIdForResult, st as getLatestAgentInvocationForConversation, tt as getAgentInvocationIdForMessage } from "./agent-runner-Caiof09f.js";
2
+ import { $ as getAgentInvocation, X as createAgentInvocationFromLatest, ct as isTerminalAgentInvocation, et as getAgentInvocationIdForEvents, ft as markAgentInvocationParentMailboxAppended, it as getAgentInvocationResultMessageId, nt as getAgentInvocationIdForResult, st as getLatestAgentInvocationForConversation, tt as getAgentInvocationIdForMessage } from "./agent-runner-D7OboVb3.js";
3
3
  import { t as createActor } from "./actor-BTtLaeWy.js";
4
- import { d as credentialContextForActor } from "./registry-CmKmKHpp.js";
5
- import { X as getTurnRecord, Z as listTurnSummaries } from "./tasks-dJooqiip.js";
6
- import { a as EVENT_WAIT_MS, c as timerWatchCredentialSubject, s as isEventMailboxMetadata } from "./session-stop-BEBfE97J.js";
7
- import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-C04mP1hu.js";
8
- import { r as appendAndEnqueueInboundMessage } from "./store-BashBewg.js";
9
- import { r as enqueueAgentInvocation } from "./work-BAn43SsN.js";
4
+ import { f as credentialContextForActor } from "./registry-sLTr-sV9.js";
5
+ import { Q as listTurnSummaries, Z as getTurnRecord } from "./tasks-D_WIJtvO.js";
6
+ import { a as EVENT_WAIT_MS, c as timerWatchCredentialSubject, s as isEventMailboxMetadata } from "./session-stop-CQjKd4a2.js";
7
+ import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-DyoEj9c2.js";
8
+ import { r as appendAndEnqueueInboundMessage } from "./store-DXFIQy-G.js";
9
+ import { r as enqueueAgentInvocation } from "./work-nAfDSUFP.js";
10
10
  import { z } from "zod";
11
11
  import { createEventSource, createLocalSource, createWebSource } from "@sentry/junior-plugin-api";
12
12
  //#region src/chat/task-execution/mailbox-input.ts
@@ -1,14 +1,14 @@
1
- import { C as withLogContext, b as setTags, d as logException } from "./logging-D3aYP0aG.js";
2
- import { c as getConversationEventStore, u as getConversationStore } from "./viewer-Rnim7alE.js";
3
- import { d as credentialContextForActor } from "./registry-CmKmKHpp.js";
4
- import { $ as persistWithRetry, Ct as commitAcceptedReply, Ft as recordAuthorizationCompleted, K as saveTurnCheckpoint, Ot as loadProjection, Qt as buildConversationContext, Ut as hydrateConversationMessages, Wt as persistConversationMessages, an as recordDeliveredAssistantMessage, in as normalizeConversationText, rn as markConversationMessage, sn as upsertConversationMessage } from "./tasks-dJooqiip.js";
5
- import { K as messageCardText } from "./conversation-T18Xlkx9.js";
1
+ import { f as logException, w as withLogContext, x as setTags } from "./logging-CWxiIuCF.js";
2
+ import { d as getConversationStore, l as getConversationEventStore } from "./viewer-DSZXygMU.js";
3
+ import { f as credentialContextForActor } from "./registry-sLTr-sV9.js";
4
+ import { $t as buildConversationContext, Gt as persistConversationMessages, It as recordAuthorizationCompleted, Wt as hydrateConversationMessages, an as normalizeConversationText, cn as upsertConversationMessage, et as persistWithRetry, in as markConversationMessage, kt as loadProjection, on as recordDeliveredAssistantMessage, q as saveTurnCheckpoint, wt as commitAcceptedReply } from "./tasks-D_WIJtvO.js";
5
+ import { K as messageCardText } from "./conversation-CKNLYBJt.js";
6
6
  import { f as markTurnFailed, p as startActiveTurn, t as authorizationId } from "./oauth-authorization-BA4Dt6a7.js";
7
- import { n as getAssistantReplyText } from "./assistant-reply-BddmM66R.js";
8
- import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-D2CpD6GN.js";
9
- import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-BfodfmiY.js";
10
- import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CsMC-ob0.js";
11
- import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-zB364t7_.js";
7
+ import { n as getAssistantReplyText } from "./assistant-reply-CbTPebzL.js";
8
+ import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-DUjvzYXj.js";
9
+ import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-CO-ylUmV.js";
10
+ import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-Ch4yuCqG.js";
11
+ import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-C5nBKC4S.js";
12
12
  import { randomUUID } from "node:crypto";
13
13
  import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
14
14
  //#region src/chat/local/runner.ts
@@ -1,4 +1,4 @@
1
- import { Mt as sandboxEgressSignalsResponseSchema } from "./agent-runner-Caiof09f.js";
1
+ import { Mt as sandboxEgressSignalsResponseSchema } from "./agent-runner-D7OboVb3.js";
2
2
  //#region src/chat/local/sandbox-egress-signals.ts
3
3
  const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
4
4
  const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
@@ -1,5 +1,5 @@
1
- import { r as AGENT_INVOCATION_STATUSES, u as juniorDestinationKindSchema } from "./agent-invocations-BY60iNw-.js";
2
- import { D as conversationUsageSchema, E as conversationSummaryReportSchema, M as conversationChildAgentTotalsSchema, l as conversationAuxiliaryCostsSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-T18Xlkx9.js";
1
+ import { r as AGENT_INVOCATION_STATUSES, u as juniorDestinationKindSchema } from "./agent-invocations-Bdu3ROfo.js";
2
+ import { D as conversationUsageSchema, E as conversationSummaryReportSchema, M as conversationChildAgentTotalsSchema, l as conversationAuxiliaryCostsSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-CKNLYBJt.js";
3
3
  import "./automation-CHdlHVZP.js";
4
4
  import { a as fillUtcHours, c as sumUtcHoursIntoSixHours, i as fillUtcDays } from "./web-message-id-xPI_EFSC.js";
5
5
  import { z } from "zod";
@@ -141,11 +141,12 @@ const codeRepositoryReportSchema = z.object({
141
141
  name: z.string().min(1)
142
142
  }).strict())
143
143
  }).strict();
144
- /** Person-scoped code activity for one People profile. */
144
+ /** Person-scoped code activity and recent code changes for one People profile. */
145
145
  const codePersonReportSchema = z.object({
146
146
  activityDays: z.array(codeActivityDaySchema),
147
147
  activityHours: z.array(codeActivityDaySchema).optional(),
148
148
  activitySixHours: z.array(codeActivityDaySchema).optional(),
149
+ changes: z.array(codeChangeSummaryReportSchema),
149
150
  generatedAt: z.string(),
150
151
  summary: codeChangeSummarySchema,
151
152
  windowEnd: z.string(),
@@ -1,19 +1,19 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { d as logException, f as logInfo, p as logWarn } from "./logging-D3aYP0aG.js";
3
- import { n as botConfig } from "./config-BDAfLTI9.js";
4
- import { f as getSqlExecutor, u as getConversationStore } from "./viewer-Rnim7alE.js";
5
- import { s as juniorConversations } from "./agent-invocations-BY60iNw-.js";
6
- import "./executor-Dh4Ofsnx.js";
7
- import { p as credentialSubjectSchema } from "./registry-CmKmKHpp.js";
8
- import { St as ToolInputError, _t as normalizeToolNameFromResult, gt as isToolResultMessage, ht as isToolResultError, pt as isAssistantMessage, z as postSlackMessage } from "./tasks-dJooqiip.js";
9
- import { it as JUNIOR_THREAD_STATE_TTL_MS, rt as verifyTimerWatchCredentialSubject, u as getPlugins } from "./agent-hooks-CDVx26Uu.js";
10
- import { w as getStateAdapter } from "./profile-DnkX3e2S.js";
11
- import { r as sanitizeAssistantText } from "./assistant-reply-BddmM66R.js";
12
- import { r as EVENT_AUTHOR_ID } from "./prompt-C04mP1hu.js";
13
- import { r as appendAndEnqueueInboundMessage } from "./store-BashBewg.js";
2
+ import { f as logException, m as logWarn, p as logInfo } from "./logging-CWxiIuCF.js";
3
+ import { n as botConfig } from "./config-CJRnWK9H.js";
4
+ import { d as getConversationStore, p as getSqlExecutor } from "./viewer-DSZXygMU.js";
5
+ import { s as juniorConversations } from "./agent-invocations-Bdu3ROfo.js";
6
+ import "./executor-Do0THDRR.js";
7
+ import { h as credentialSubjectSchema } from "./registry-sLTr-sV9.js";
8
+ import { B as postSlackMessage, Ct as ToolInputError, _t as isToolResultMessage, gt as isToolResultError, mt as isAssistantMessage, vt as normalizeToolNameFromResult } from "./tasks-D_WIJtvO.js";
9
+ import { it as JUNIOR_THREAD_STATE_TTL_MS, rt as verifyTimerWatchCredentialSubject, u as getPlugins } from "./agent-hooks-BjtTzvru.js";
10
+ import { w as getStateAdapter } from "./profile-h-72wM78.js";
11
+ import { r as sanitizeAssistantText } from "./assistant-reply-CbTPebzL.js";
12
+ import { r as EVENT_AUTHOR_ID } from "./prompt-DyoEj9c2.js";
13
+ import { r as appendAndEnqueueInboundMessage } from "./store-DXFIQy-G.js";
14
14
  import { z } from "zod";
15
15
  import { eq, inArray } from "drizzle-orm";
16
- import { eventMatchSchema, normalizeEventIdentifier, objectTypeSchema } from "@sentry/junior-plugin-api";
16
+ import { eventMatchFieldsSchema, eventMatchSchema, normalizeEventIdentifier, objectTypeSchema } from "@sentry/junior-plugin-api";
17
17
  //#region src/chat/automation-result.ts
18
18
  /**
19
19
  * Automation run result.
@@ -525,6 +525,13 @@ function workspaceSnapshotFinishedEvent(input) {
525
525
  }
526
526
  //#endregion
527
527
  //#region src/chat/slack/channel-message-events.ts
528
+ /**
529
+ * Slack channel-message Events for Event automations.
530
+ *
531
+ * Core publishes these Events from Slack ingress, so the `slack` namespace is
532
+ * core owned, like `junior`. Anyone in the channel writes the Event text, so an
533
+ * automation can watch only its own channel and always uses system credentials.
534
+ */
528
535
  /** Core-owned event namespace for Slack Events. Not a plugin publisher. */
529
536
  const SLACK_EVENT_NAMESPACE = "slack";
530
537
  /** The trigger identifier that names the channel of the automation. */
@@ -532,6 +539,10 @@ const SLACK_CURRENT_CHANNEL_IDENTIFIER = "current_channel";
532
539
  const CHANNEL_RESOURCE_TYPE = "channel";
533
540
  const MESSAGE_POSTED_EVENT = "message.posted";
534
541
  const CHANNEL_ID_PATTERN = /^[CG][A-Z0-9]{2,}$/;
542
+ const CHANNEL_MESSAGE_MATCH_FIELDS = eventMatchFieldsSchema.parse({ userId: {
543
+ kind: "string",
544
+ description: "Slack user ID of the message author. Required to run on bot posts, such as alert bots."
545
+ } });
535
546
  /** Event registration for new top-level Slack channel messages. */
536
547
  function slackChannelMessageEvents() {
537
548
  return { resourceTypes: [{
@@ -542,7 +553,8 @@ function slackChannelMessageEvents() {
542
553
  },
543
554
  supportedEvents: [MESSAGE_POSTED_EVENT],
544
555
  suggestedEvents: [],
545
- guidance: { [MESSAGE_POSTED_EVENT]: "A person posted a new top-level message in this channel. A reply goes in that message's thread. If the instructions do not apply to this message, end with no action." }
556
+ matchFields: CHANNEL_MESSAGE_MATCH_FIELDS,
557
+ guidance: { [MESSAGE_POSTED_EVENT]: "A person or bot posted a new top-level message in this channel. A bot post runs the automation only when match names the bot in userId. A reply goes in that message's thread. If the instructions do not apply to this message, end with no action." }
546
558
  }] };
547
559
  }
548
560
  /**
@@ -569,27 +581,41 @@ function requireSlackChannelMessageScope(automation) {
569
581
  /**
570
582
  * Build the Event for one new top-level channel message, or nothing.
571
583
  *
572
- * Thread replies and bot posts, including Slackbot, do not count. Bots can
573
- * post often and use up the run limit of the automation.
584
+ * Thread replies and Slackbot posts do not count. Other bot posts are marked
585
+ * with `postedByBot`, so only automations that name the bot can run on them.
574
586
  */
575
587
  function slackChannelMessageEvent(input) {
576
- if (input.botId || input.subtype === "bot_message" || input.userId === "USLACKBOT") return;
588
+ if (input.userId === "USLACKBOT") return void 0;
577
589
  if (input.threadTs && input.threadTs !== input.ts) return void 0;
578
590
  if (!CHANNEL_ID_PATTERN.test(input.channelId)) return void 0;
591
+ const postedByBot = Boolean(input.botId || input.subtype === "bot_message");
579
592
  return {
580
593
  eventKey: `${input.channelId}:${input.ts}`,
581
594
  eventType: MESSAGE_POSTED_EVENT,
582
595
  identifier: input.channelId,
583
596
  occurredAtMs: Math.floor(Number(input.ts) * 1e3),
584
- trustedSummary: `<@${input.userId}> posted a new message in <#${input.channelId}>.`,
597
+ trustedSummary: `${postedByBot ? "The bot " : ""}<@${input.userId}> posted a new message in <#${input.channelId}>.`,
585
598
  data: {
586
599
  channelId: input.channelId,
587
600
  messageTs: input.ts,
588
- userId: input.userId
601
+ userId: input.userId,
602
+ ...postedByBot ? { postedByBot: true } : void 0
589
603
  },
590
604
  ...input.text?.trim() ? { untrustedText: input.text } : void 0
591
605
  };
592
606
  }
607
+ /**
608
+ * Decide whether a channel-message Event may run one automation.
609
+ *
610
+ * A bot post runs only automations whose match names its author in `userId`.
611
+ * Bots can post often and would use up the run limit of every other
612
+ * automation in the channel.
613
+ */
614
+ function slackChannelMessageRunsAutomation(event, automation) {
615
+ if (event.namespace !== "slack") return true;
616
+ if (event.data?.postedByBot !== true) return true;
617
+ return automation.trigger.match?.userId !== void 0;
618
+ }
593
619
  /** Return the source message thread for a channel-message run. */
594
620
  function slackChannelMessageReplyThreadTs(event) {
595
621
  if (event.namespace !== "slack") return void 0;
@@ -782,4 +808,4 @@ async function skipInputBeforeConversationStop(context) {
782
808
  return { status: "completed" };
783
809
  }
784
810
  //#endregion
785
- export { recordFinishedTurnForAutomatedLimit as A, registeredEventMatchSchema as C, requireSupportedEventMatch as D, requireEventIdentifier as E, finishedRunReply as F, readAutomationResult as I, remindMissingAutomationResult as L, FINISH_AUTOMATION_RUN_TOOL_NAME as M, automationResultSchema as N, renderTaskInput as O, deliversFinalText as P, runDispatchOutcome as R, pluginSupportsEvent as S, registeredResourceTypeSchema as T, workspaceSnapshotWatch as _, EVENT_WAIT_MS as a, eventNamespaceSchema as b, timerWatchCredentialSubject as c, requireSlackChannelMessageScope as d, slackChannelMessageEvent as f, workspaceSnapshotFinishedEvent as g, WORKSPACE_SNAPSHOT_READY_EVENT as h, skipInputBeforeConversationStop as i, resetAutomatedTurnLimit as j, maybePostAutomatedTurnLimitNotice as k, getEventCatalog as l, WORKSPACE_SNAPSHOT_FAILED_EVENT as m, markConversationsStopped as n, enqueueEventNotification as o, slackChannelMessageReplyThreadTs as p, session_stop_exports as r, isEventMailboxMetadata as s, getConversationStoppedAtMs as t, SLACK_EVENT_NAMESPACE as u, automationEventCatalog as v, registeredEventTypeSchema as w, hasEventCatalogEntries as x, eventGuidance as y };
811
+ export { maybePostAutomatedTurnLimitNotice as A, pluginSupportsEvent as C, requireEventIdentifier as D, registeredResourceTypeSchema as E, deliversFinalText as F, finishedRunReply as I, readAutomationResult as L, resetAutomatedTurnLimit as M, FINISH_AUTOMATION_RUN_TOOL_NAME as N, requireSupportedEventMatch as O, automationResultSchema as P, remindMissingAutomationResult as R, hasEventCatalogEntries as S, registeredEventTypeSchema as T, workspaceSnapshotFinishedEvent as _, EVENT_WAIT_MS as a, eventGuidance as b, timerWatchCredentialSubject as c, requireSlackChannelMessageScope as d, slackChannelMessageEvent as f, WORKSPACE_SNAPSHOT_READY_EVENT as g, WORKSPACE_SNAPSHOT_FAILED_EVENT as h, skipInputBeforeConversationStop as i, recordFinishedTurnForAutomatedLimit as j, renderTaskInput as k, getEventCatalog as l, slackChannelMessageRunsAutomation as m, markConversationsStopped as n, enqueueEventNotification as o, slackChannelMessageReplyThreadTs as p, session_stop_exports as r, isEventMailboxMetadata as s, getConversationStoppedAtMs as t, SLACK_EVENT_NAMESPACE as u, workspaceSnapshotWatch as v, registeredEventMatchSchema as w, eventNamespaceSchema as x, automationEventCatalog as y, runDispatchOutcome as z };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { p as logWarn } from "./logging-D3aYP0aG.js";
2
+ import { m as logWarn } from "./logging-CWxiIuCF.js";
3
3
  import { s as skillRoots } from "./package-discovery-BVvSnQBB.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-hKmI-iZa.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-CZzhGQ7F.js";
5
5
  import path from "node:path";
6
6
  import { z } from "zod";
7
7
  import fs from "node:fs/promises";
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { Ht as toolInvocationDestination, Vt as actorFromRun } from "./agent-runner-Caiof09f.js";
3
- import { n as createAndEnqueueAgentInvocation } from "./work-BAn43SsN.js";
2
+ import { Ht as actorFromRun, Ut as toolInvocationDestination } from "./agent-runner-D7OboVb3.js";
3
+ import { n as createAndEnqueueAgentInvocation } from "./work-nAfDSUFP.js";
4
4
  //#region src/chat/agent-invocations/spawn.ts
5
5
  var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
6
6
  /** Bind a Run's Actor and credentials to new Agent invocations. */
@@ -1,10 +1,10 @@
1
- import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-D3aYP0aG.js";
2
- import { i as getChatConfig } from "./config-BDAfLTI9.js";
1
+ import { B as toOptionalNumber, V as toOptionalString, z as isRecord } from "./logging-CWxiIuCF.js";
2
+ import { i as getChatConfig } from "./config-CJRnWK9H.js";
3
3
  import { s as parseStoredSlackActor } from "./actor-BTtLaeWy.js";
4
- import { F as sameDestination, N as parseDestination, u as getConversationStore } from "./viewer-Rnim7alE.js";
5
- import { it as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-CDVx26Uu.js";
6
- import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-DnkX3e2S.js";
7
- import "./job-queue-BaCL36FY.js";
4
+ import { U as sameDestination, V as parseDestination, d as getConversationStore } from "./viewer-DSZXygMU.js";
5
+ import { it as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-BjtTzvru.js";
6
+ import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-h-72wM78.js";
7
+ import "./job-queue-B6SV9uVa.js";
8
8
  import { z } from "zod";
9
9
  import { randomUUID } from "node:crypto";
10
10
  import { destinationSchema } from "@sentry/junior-plugin-api";
@@ -1,5 +1,5 @@
1
- import { p as logWarn } from "./logging-D3aYP0aG.js";
2
- import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as createVercelQueueClient, l as signQueueMessage, p as runWithTurnRequestDeadline, u as verifyQueueMessage } from "./job-queue-BaCL36FY.js";
1
+ import { m as logWarn } from "./logging-CWxiIuCF.js";
2
+ import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as createVercelQueueClient, l as signQueueMessage, p as runWithTurnRequestDeadline, u as verifyQueueMessage } from "./job-queue-B6SV9uVa.js";
3
3
  import { z } from "zod";
4
4
  import { createHash } from "node:crypto";
5
5
  import { handleCallback, registerDevConsumer } from "@vercel/queue";
@@ -115,7 +115,7 @@ function pluginTaskCallback() {
115
115
  maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
116
116
  onRejected: logPluginTaskQueueMessageRejected,
117
117
  run: async (message) => {
118
- const { processPluginTask } = await import("./task-runner-D2CpD6GN.js").then((n) => n.r);
118
+ const { processPluginTask } = await import("./task-runner-DUjvzYXj.js").then((n) => n.r);
119
119
  await processPluginTask(message);
120
120
  },
121
121
  topic: PLUGIN_TASK_QUEUE_TOPIC,
@@ -1,17 +1,17 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { h as runBestEffort, p as logWarn } from "./logging-D3aYP0aG.js";
2
+ import { g as runBestEffort, m as logWarn } from "./logging-CWxiIuCF.js";
3
3
  import { g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
4
- import { C as agentTurnTotalTokens, S as agentTurnCostUsd, d as getDb, r as readActorIdentity, u as getConversationStore } from "./viewer-Rnim7alE.js";
5
- import { s as juniorConversations } from "./agent-invocations-BY60iNw-.js";
6
- import { o as juniorAutomationRuns, s as juniorAutomations } from "./executor-Dh4Ofsnx.js";
4
+ import { E as agentTurnTotalTokens, T as agentTurnCostUsd, d as getConversationStore, f as getDb, i as readActorIdentity } from "./viewer-DSZXygMU.js";
5
+ import { s as juniorConversations } from "./agent-invocations-Bdu3ROfo.js";
6
+ import { a as juniorAutomationRuns, s as juniorAutomations } from "./executor-Do0THDRR.js";
7
7
  import { m as sameActorIdentity } from "./history-9pO1Zd4Y.js";
8
- import { p as credentialSubjectSchema } from "./registry-CmKmKHpp.js";
9
- import { A as formatSlackLink, L as openSlackDirectMessage, Ut as hydrateConversationMessages, X as getTurnRecord, Yt as fallbackShortTitle, _t as normalizeToolNameFromResult, ct as getPiMessageRole, ft as instructionTextForProjection, gt as isToolResultMessage, ht as isToolResultError, i as readScheduledAutomation, k as escapeSlackMrkdwnText, l as blockEventAutomation, m as getEventAutomation, yt as stripRuntimeTurnContext, z as postSlackMessage } from "./tasks-dJooqiip.js";
10
- import { St as createPluginConversationEvents, dt as createPluginModel, ft as createPluginLogger, it as JUNIOR_THREAD_STATE_TTL_MS, lt as createPluginState, p as coreTaskRegistrations, st as getDashboardTaskLink, u as getPlugins, ut as createPluginEmbedder } from "./agent-hooks-CDVx26Uu.js";
11
- import { w as getStateAdapter } from "./profile-DnkX3e2S.js";
12
- import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CsMC-ob0.js";
13
- import { t as resolveConversationRouting } from "./turn-session-routing-BAh_qsBJ.js";
14
- import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-VvIKqlQ4.js";
8
+ import { h as credentialSubjectSchema } from "./registry-sLTr-sV9.js";
9
+ import { A as escapeSlackMrkdwnText, B as postSlackMessage, R as openSlackDirectMessage, Wt as hydrateConversationMessages, Xt as fallbackShortTitle, Z as getTurnRecord, _t as isToolResultMessage, bt as stripRuntimeTurnContext, gt as isToolResultError, i as readScheduledAutomation, j as formatSlackLink, l as blockEventAutomation, lt as getPiMessageRole, m as getEventAutomation, pt as instructionTextForProjection, vt as normalizeToolNameFromResult } from "./tasks-D_WIJtvO.js";
10
+ import { St as createPluginConversationEvents, dt as createPluginModel, ft as createPluginLogger, it as JUNIOR_THREAD_STATE_TTL_MS, lt as createPluginState, p as coreTaskRegistrations, st as getDashboardTaskLink, u as getPlugins, ut as createPluginEmbedder } from "./agent-hooks-BjtTzvru.js";
11
+ import { w as getStateAdapter } from "./profile-h-72wM78.js";
12
+ import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-Ch4yuCqG.js";
13
+ import { t as resolveConversationRouting } from "./turn-session-routing-B3LWooK5.js";
14
+ import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-B17vV0La.js";
15
15
  import { z } from "zod";
16
16
  import { createHash } from "node:crypto";
17
17
  import { and, asc, count, desc, eq, gte, inArray, isNotNull, lte, max, sql } from "drizzle-orm";