@sentry/junior 0.206.0 → 0.207.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 (64) hide show
  1. package/dist/{agent-C9yuiZUF.js → agent-CmQlX68D.js} +375 -346
  2. package/dist/{agent-hooks-DNjlz2A-.js → agent-hooks-BBX9p6aG.js} +101 -96
  3. package/dist/{agent-runner-E67lFrDG.js → agent-runner-CQD4HKK2.js} +9 -9
  4. package/dist/api/schema.d.ts +39 -39
  5. package/dist/api/schema.js +2 -2
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +154 -154
  8. package/dist/{app-AxGmJHwK.d.ts → app-DfNrn_gS.d.ts} +2 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +185 -183
  11. package/dist/{auth-pause-state-MVZ6xvEK.js → auth-pause-state-uv8on6cT.js} +7 -7
  12. package/dist/{briefs-CvJFQvhJ.js → briefs-BXEmjD9D.js} +3 -3
  13. package/dist/{catalog-runtime-TBR8n4e1.js → catalog-runtime-1BZEOR8J.js} +1 -1
  14. package/dist/{checkpoint-BY47jJCB.js → checkpoint-B-JO5F3c.js} +8 -8
  15. package/dist/cli/chat.js +13 -13
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +1 -1
  18. package/dist/cli/plugins.js +3 -3
  19. package/dist/cli/snapshot-create.js +3 -3
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{client-ceE7NtvC.js → client-Bp297GA0.js} +4 -4
  23. package/dist/{config-CIE83sR2.js → config-G2gv97R1.js} +4 -4
  24. package/dist/{context-B45_WqVX.js → context-Bplcgypl.js} +13 -13
  25. package/dist/{conversation-privacy-Auyq26XQ.js → conversation-privacy-BUfel19D.js} +1 -1
  26. package/dist/{credential-sync-BO33aNQd.js → credential-sync-D04NWqMR.js} +21 -21
  27. package/dist/{db-BeyXKJOI.d.ts → db-D74z7BZH.d.ts} +1 -1
  28. package/dist/{execution-stats-SiS2FLcv.js → execution-stats-Ds4bSvam.js} +77 -77
  29. package/dist/{executor-BfbYPW63.js → executor-BZu1Ta06.js} +12 -12
  30. package/dist/instrumentation.js +2 -2
  31. package/dist/{job-queue-CyTc24Es.js → job-queue-rnAPfUhP.js} +1 -1
  32. package/dist/{logging-D37bayDc.js → logging-Dx0S5k2z.js} +1 -1
  33. package/dist/nitro.d.ts +1 -1
  34. package/dist/nitro.js +3 -3
  35. package/dist/{oauth-callback-server-BtfOeHTZ.js → oauth-callback-server-xGpwURIj.js} +2 -2
  36. package/dist/{pending-auth-BPUzcs7n.js → pending-auth-DIZ4iZjS.js} +2 -2
  37. package/dist/{profile-CSixooTi.js → profile-d-fKypxo.js} +4 -4
  38. package/dist/{prompt-3gqNY1Ka.js → prompt-x-0ZtTyb.js} +14 -14
  39. package/dist/{registry-DiR0-xRg.js → registry-CWKdLCTG.js} +2 -2
  40. package/dist/{resolve-Bn5q__9b.js → resolve-BhRB1s2A.js} +2 -2
  41. package/dist/{runner-DFx3dIJH.js → runner-DNml3owD.js} +10 -10
  42. package/dist/{sandbox-egress-signals-bwvjihxA.js → sandbox-egress-signals-DUIl3-gW.js} +1 -1
  43. package/dist/{schema-8GXFfclK.js → schema-CwTeb-BF.js} +39 -39
  44. package/dist/{skills-BhM5qyCF.js → skills-D9WesdJJ.js} +2 -2
  45. package/dist/{spawn-Dk0PqdH6.js → spawn-Eh_3-s0M.js} +2 -2
  46. package/dist/{stats-DKRP4rsY.js → stats-CFlUGqVA.js} +292 -268
  47. package/dist/{store-C5qxF2ac.d.ts → store-Det8MQ9g.d.ts} +1 -1
  48. package/dist/{task-queue-CdpTvu4R.js → task-queue-D8I1_5wP.js} +3 -3
  49. package/dist/{task-runner-alpjVSxQ.js → task-runner-DO79gdho.js} +15 -15
  50. package/dist/{thread-state-CRK7aA41.js → thread-state-DD6BA4xz.js} +5 -5
  51. package/dist/{turn-execution-XtyzIHog.js → turn-execution-BSIHxmQJ.js} +3 -3
  52. package/dist/{turn-lifecycle-VbwZLfBv.js → turn-lifecycle-DSBK4Ars.js} +1 -1
  53. package/dist/{usage-D4A48Bdl.js → usage-WRXkNOHp.js} +2 -2
  54. package/dist/{validation-jn_46o4U.js → validation-BbHZ4r4S.js} +1 -1
  55. package/dist/{version-DcfJxB4z.js → version-C71UcRWw.js} +1 -1
  56. package/dist/version.js +1 -1
  57. package/dist/{web-authorization-CsfLSfEs.js → web-authorization-C73gJV7l.js} +1 -1
  58. package/dist/{web-input-BPp_sc7t.js → web-input-Ce1FcNIM.js} +8 -8
  59. package/dist/{work-Di-ubSGg.js → work-BEzDU_2x.js} +9 -9
  60. package/dist/{worker-Cu_D5Mr8.js → worker-MK2ubOv-.js} +5 -5
  61. package/migrations/0041_automation_outcomes_backfill.sql +27 -0
  62. package/migrations/meta/0041_snapshot.json +3516 -0
  63. package/migrations/meta/_journal.json +7 -0
  64. package/package.json +5 -5
@@ -1,10 +1,10 @@
1
- import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-ceE7NtvC.js";
2
- import { t as buildTurnFailureResponse } from "./logging-D37bayDc.js";
3
- import { _ as parseSlackMessageTs } from "./context-B45_WqVX.js";
4
- import { Q as hydrateConversationMessages, lt as markConversationMessage } from "./checkpoint-BY47jJCB.js";
5
- import { Kt as buildDeterministicTurnId } from "./stats-DKRP4rsY.js";
6
- import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-BPUzcs7n.js";
7
- import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CRK7aA41.js";
1
+ import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-Bp297GA0.js";
2
+ import { t as buildTurnFailureResponse } from "./logging-Dx0S5k2z.js";
3
+ import { _ as parseSlackMessageTs } from "./context-Bplcgypl.js";
4
+ import { Q as hydrateConversationMessages, lt as markConversationMessage } from "./checkpoint-B-JO5F3c.js";
5
+ import { Kt as buildDeterministicTurnId } from "./stats-CFlUGqVA.js";
6
+ import { b as markTurnCompleted, r as clearPendingAuth, y as markTurnClosed } from "./pending-auth-DIZ4iZjS.js";
7
+ import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-DD6BA4xz.js";
8
8
  //#region src/chat/runtime/delivered-turn-state.ts
9
9
  /** Build state after destination delivery or intentional no-reply completion. */
10
10
  function buildDeliveredTurnStatePatch(args) {
@@ -1,7 +1,7 @@
1
- import { r as completeObject } from "./client-ceE7NtvC.js";
1
+ import { r as completeObject } from "./client-Bp297GA0.js";
2
2
  import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
3
3
  import { N as parseBriefInput, d as conversationDetailReportSchema, k as briefCodeChangeSchema, p as conversationEventPageSchema } from "./conversation-AA4R1VUn.js";
4
- import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-3gqNY1Ka.js";
4
+ import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-x-0ZtTyb.js";
5
5
  import { CLI_USAGE } from "./cli/run.js";
6
6
  import path from "node:path";
7
7
  import { z } from "zod";
@@ -269,7 +269,7 @@ async function parseRunOptions(argv) {
269
269
  * `DATABASE_URL` at import, and `briefs pull` must work with only a token.
270
270
  */
271
271
  async function configuredDefaultModelId() {
272
- const { botConfig } = await import("./config-CIE83sR2.js").then((n) => n.r);
272
+ const { botConfig } = await import("./config-G2gv97R1.js").then((n) => n.r);
273
273
  return defaultModelId(botConfig);
274
274
  }
275
275
  function apiUrl(baseUrl, pathname) {
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { t as createPluginCatalogRuntime } from "./registry-DiR0-xRg.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-CWKdLCTG.js";
3
3
  //#region src/chat/plugins/catalog-runtime.ts
4
4
  var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
5
5
  const pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -1,11 +1,11 @@
1
- import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-ceE7NtvC.js";
2
- import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-D37bayDc.js";
3
- import { n as botConfig } from "./config-CIE83sR2.js";
4
- import { _ as parseSlackMessageTs, f as toStoredSlackActor } from "./context-B45_WqVX.js";
5
- import { At as authenticationLinkedEvent, Bt as sanitizePostgresJson, Ft as getConversationStore, Lt as getSqlExecutor, Nt as getConversationEventStore, Ot as JUNIOR_NATIVE_EVENT_NAMESPACE, Rt as createSqlConversationEventStore, Ut as bindProviderConversation, jt as authenticationUnlinkedEvent, kt as agentsInstructionsUpdatedEvent, zt as withConversationEventLock } from "./agent-hooks-DNjlz2A-.js";
1
+ import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-Bp297GA0.js";
2
+ import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-Dx0S5k2z.js";
3
+ import { n as botConfig } from "./config-G2gv97R1.js";
4
+ import { _ as parseSlackMessageTs, f as toStoredSlackActor } from "./context-Bplcgypl.js";
5
+ import { At as authenticationLinkedEvent, Bt as sanitizePostgresJson, Ft as getConversationStore, Lt as getSqlExecutor, Nt as getConversationEventStore, Ot as JUNIOR_NATIVE_EVENT_NAMESPACE, Rt as createSqlConversationEventStore, Ut as bindProviderConversation, jt as authenticationUnlinkedEvent, kt as agentsInstructionsUpdatedEvent, zt as withConversationEventLock } from "./agent-hooks-BBX9p6aG.js";
6
6
  import { G as instructionProvenanceFor, I as agentHistoryItemSchema, U as contextProvenance, W as instructionActors } from "./conversation-AA4R1VUn.js";
7
- import { c as generateShortTitle, o as ToolInputError, s as fallbackShortTitle, t as addAgentTurnUsage } from "./usage-D4A48Bdl.js";
8
- import { A as sleep, D as fenceLock, M as SANDBOX_REPOS_ROOT, P as SANDBOX_WORKSPACE_ROOT, T as MUTATION_LOCK_TTL_MS, k as withLock, w as getStateAdapter } from "./profile-CSixooTi.js";
7
+ import { c as generateShortTitle, o as ToolInputError, s as fallbackShortTitle, t as addAgentTurnUsage } from "./usage-WRXkNOHp.js";
8
+ import { A as sleep, D as fenceLock, M as SANDBOX_REPOS_ROOT, P as SANDBOX_WORKSPACE_ROOT, T as MUTATION_LOCK_TTL_MS, k as withLock, w as getStateAdapter } from "./profile-d-fKypxo.js";
9
9
  import path from "node:path";
10
10
  import { isDeepStrictEqual } from "node:util";
11
11
  import { z } from "zod";
@@ -2135,7 +2135,7 @@ async function upsertTurnRecordLocked(args, fence) {
2135
2135
  const turnSource = args.source ?? existingRecord?.source;
2136
2136
  const dispatchId = args.dispatchId ?? existingRecord?.dispatchId;
2137
2137
  const hasProviderLocation = Boolean(conversation?.location) || args.destination?.platform === "slack";
2138
- const publishExternally = dispatchId || turnSource ? hasProviderLocation && (Boolean(dispatchId) || turnSource?.kind === "slack" || turnSource?.kind === "resource_event") : existingRecord?.publishExternally ?? false;
2138
+ const publishExternally = dispatchId || turnSource ? hasProviderLocation && (Boolean(dispatchId) || turnSource?.kind === "slack" || turnSource?.kind === "event") : existingRecord?.publishExternally ?? false;
2139
2139
  return await setStoredRecord({
2140
2140
  actor: existingRecord?.actor ?? args.actor,
2141
2141
  fence,
package/dist/cli/chat.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as executeAgentRun } from "../agent-C9yuiZUF.js";
2
- import { t as createAgentRunner } from "../agent-runner-E67lFrDG.js";
1
+ import { t as executeAgentRun } from "../agent-CmQlX68D.js";
2
+ import { t as createAgentRunner } from "../agent-runner-CQD4HKK2.js";
3
3
  import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
4
4
  import path from "node:path";
5
5
  import { createHash, randomUUID } from "node:crypto";
@@ -101,10 +101,10 @@ async function loadLocalPluginSet() {
101
101
  async function configureLocalChatPlugins(pluginSet) {
102
102
  const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
103
103
  import("../plugins-egKWjgue.js").then((n) => n.o),
104
- import("../agent-hooks-DNjlz2A-.js").then((n) => n.t),
105
- import("../catalog-runtime-TBR8n4e1.js").then((n) => n.t),
106
- import("../validation-jn_46o4U.js").then((n) => n.r),
107
- import("../agent-hooks-DNjlz2A-.js").then((n) => n.Mt)
104
+ import("../agent-hooks-BBX9p6aG.js").then((n) => n.t),
105
+ import("../catalog-runtime-1BZEOR8J.js").then((n) => n.t),
106
+ import("../validation-BbHZ4r4S.js").then((n) => n.r),
107
+ import("../agent-hooks-BBX9p6aG.js").then((n) => n.Mt)
108
108
  ]);
109
109
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
110
110
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -156,16 +156,16 @@ async function prepareLocalChatRun(io, pluginSet) {
156
156
  await configureLocalChatPlugins(pluginSet);
157
157
  const { setExperimentalFeatures } = await import("../experimental-CIXf7Uye.js").then((n) => n.t);
158
158
  setExperimentalFeatures({ subagents: true });
159
- const { setBriefsConfig } = await import("../agent-hooks-DNjlz2A-.js").then((n) => n.m);
159
+ const { setBriefsConfig } = await import("../agent-hooks-BBX9p6aG.js").then((n) => n.m);
160
160
  setBriefsConfig({ enabled: true });
161
- const { runLocalAgentTurn } = await import("../runner-DFx3dIJH.js");
162
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BtfOeHTZ.js");
161
+ const { runLocalAgentTurn } = await import("../runner-DNml3owD.js");
162
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-xGpwURIj.js");
163
163
  const { createLocalOAuthState } = await import("../oauth-relay-CdCnu80W.js").then((n) => n.t);
164
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-bwvjihxA.js");
165
- const { bindSpawnAgent } = await import("../spawn-Dk0PqdH6.js").then((n) => n.n);
166
- const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-Di-ubSGg.js").then((n) => n.a);
164
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-DUIl3-gW.js");
165
+ const { bindSpawnAgent } = await import("../spawn-Eh_3-s0M.js").then((n) => n.n);
166
+ const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-BEzDU_2x.js").then((n) => n.a);
167
167
  const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
168
- const { processConversationWork } = await import("../worker-Cu_D5Mr8.js").then((n) => n.n);
168
+ const { processConversationWork } = await import("../worker-MK2ubOv-.js").then((n) => n.n);
169
169
  let agentRunner;
170
170
  const localConversationWork = createLocalConversationWork(async (message) => {
171
171
  if (!agentRunner) throw new Error("Local agent runner is not ready");
package/dist/cli/check.js CHANGED
@@ -1,6 +1,6 @@
1
- import { E as JUNIOR_HEARTBEAT_ROUTE, j as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-D37bayDc.js";
2
- import { d as parseInlinePluginManifest, f as parsePluginManifest } from "../registry-DiR0-xRg.js";
3
- import { i as parseSkillFile } from "../skills-BhM5qyCF.js";
1
+ import { E as JUNIOR_HEARTBEAT_ROUTE, j as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-Dx0S5k2z.js";
2
+ import { d as parseInlinePluginManifest, f as parsePluginManifest } from "../registry-CWKdLCTG.js";
3
+ import { i as parseSkillFile } from "../skills-D9WesdJJ.js";
4
4
  import { pathToFileURL } from "node:url";
5
5
  import path from "node:path";
6
6
  import fs from "node:fs/promises";
package/dist/cli/main.js CHANGED
@@ -25,7 +25,7 @@ async function runChat(argv, pluginSet) {
25
25
  return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
26
26
  }
27
27
  async function runBriefs(argv) {
28
- return await (await import("../briefs-CvJFQvhJ.js")).runBriefs(argv);
28
+ return await (await import("../briefs-BXEmjD9D.js")).runBriefs(argv);
29
29
  }
30
30
  function topLevelCommand(argv) {
31
31
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,6 +1,6 @@
1
- import { It as getDb, bt as createPluginLogger, d as setPlugins, f as validatePlugins } from "../agent-hooks-DNjlz2A-.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-TBR8n4e1.js";
3
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-jn_46o4U.js";
1
+ import { It as getDb, bt as createPluginLogger, d as setPlugins, f as validatePlugins } from "../agent-hooks-BBX9p6aG.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-1BZEOR8J.js";
3
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BbHZ4r4S.js";
4
4
  import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-egKWjgue.js";
5
5
  import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
6
6
  import { stderr, stdout } from "node:process";
@@ -1,6 +1,6 @@
1
- import { n as pluginCatalogRuntime } from "../catalog-runtime-TBR8n4e1.js";
2
- import { S as disconnectStateAdapter, t as create } from "../profile-CSixooTi.js";
3
- import { r as resolve } from "../resolve-Bn5q__9b.js";
1
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-1BZEOR8J.js";
2
+ import { S as disconnectStateAdapter, t as create } from "../profile-d-fKypxo.js";
3
+ import { r as resolve } from "../resolve-BhRB1s2A.js";
4
4
  //#region src/cli/snapshot-create.ts
5
5
  const DEFAULT_RUNTIME = "node22";
6
6
  const DEFAULT_TIMEOUT_MS = 6e5;
@@ -1,4 +1,4 @@
1
- import "../db-BeyXKJOI.js";
1
+ import "../db-D74z7BZH.js";
2
2
  import { n as JuniorPluginSet } from "../plugins-BI9A1vKA.js";
3
3
  //#region src/cli/upgrade/types.d.ts
4
4
  interface UpgradeIo {
@@ -1,6 +1,6 @@
1
- import { a as getChatConfig } from "../config-CIE83sR2.js";
2
- import { t as createJuniorSqlExecutor } from "../executor-BfbYPW63.js";
3
- import { t as createPluginCatalogRuntime } from "../registry-DiR0-xRg.js";
1
+ import { a as getChatConfig } from "../config-G2gv97R1.js";
2
+ import { t as createJuniorSqlExecutor } from "../executor-BZu1Ta06.js";
3
+ import { t as createPluginCatalogRuntime } from "../registry-CWKdLCTG.js";
4
4
  import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-egKWjgue.js";
5
5
  import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
6
6
  import { fileURLToPath } from "node:url";
@@ -1,5 +1,5 @@
1
- import { C as withSpan, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, p as normalizeGenAiFinishReason, u as logException } from "./logging-D37bayDc.js";
2
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-Auyq26XQ.js";
1
+ import { C as withSpan, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, p as normalizeGenAiFinishReason, u as logException } from "./logging-Dx0S5k2z.js";
2
+ import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-BUfel19D.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";
@@ -82,7 +82,7 @@ const TIMEOUT_ERROR_CODES = /* @__PURE__ */ new Set([
82
82
  "ECONNABORTED",
83
83
  "ESOCKETTIMEDOUT"
84
84
  ]);
85
- const CONTENT_POLICY_PATTERN = /\b(?:content|safety)[ _-]?policy\b|\b(?:content|safety) (?:filter|violation)\b|\bmoderation (?:blocked|rejected|refused)\b/i;
85
+ const CONTENT_POLICY_PATTERN = /\b(?:content|safety|usage)[ _-]?policy\b|\b(?:content|safety) (?:filter|violation)\b|\bmoderation (?:blocked|rejected|refused)\b/i;
86
86
  const QUOTA_PATTERN = /insufficient.?quota|quota exceeded|usage limit|available balance|out of budget|billing (?:limit|quota|error)|payment required/i;
87
87
  const AUTH_PATTERN = /unauthenticated|invalid.?api.?key|no api key|authentication (?:failed|error|required)|(?:invalid|missing|expired|revoked).{0,24}\bcredentials?\b|\bcredentials?\b.{0,24}(?:invalid|missing|expired|revoked)|\bno\b.{0,16}\bcredentials?\b/i;
88
88
  const PERMISSION_PATTERN = /permission denied|forbidden|not authorized|authorization (?:failed|required|denied)/i;
@@ -210,7 +210,7 @@ function getProviderErrorUserMessage(error) {
210
210
  case "content_policy": return "The model provider blocked this request under its content policy. Please revise the request and try again.";
211
211
  case "invalid_request": return "The model provider rejected this request as invalid. Please revise the request or ask an administrator to check the model configuration.";
212
212
  case "invalid_response": return "The model provider returned an invalid response. Please try again.";
213
- default: return "";
213
+ default: return "The model provider returned an error. Please try again.";
214
214
  }
215
215
  }
216
216
  /** Return safe structured fields for terminal failure telemetry. */
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-ceE7NtvC.js";
3
- import { f as logWarn } from "./logging-D37bayDc.js";
2
+ import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-Bp297GA0.js";
3
+ import { f as logWarn } from "./logging-Dx0S5k2z.js";
4
4
  import { c as TURN_REASONING_LEVELS, l as parseTurnReasoningLevel, o as modelProfileSchema } from "./model-profile-CZmVoGdX.js";
5
5
  import { getModel } from "@earendil-works/pi-ai/compat";
6
6
  //#region src/chat/slack/emoji.ts
@@ -43,12 +43,12 @@ const MAX_SLICES_PER_TURN = 100;
43
43
  const MAX_TOOL_CALLS_PER_TURN = 250;
44
44
  /**
45
45
  * Max consecutive automated turns before event wakes stop until a user message.
46
- * Resource-event CI watches and event-task loops are the common runaway paths.
46
+ * Resource-event CI watches and event-automation loops are the common runaway paths.
47
47
  * Sentry telemetry has no direct instrumentation for how long real automated
48
48
  * chains run (only failure paths on the notice are logged, and those show zero
49
49
  * hits in the last 30d), so this is sized qualitatively: it stays well under
50
50
  * the runaway CI-watch-loop range noted for maxToolCallsPerTurn (hundreds of
51
- * tool calls) while giving multi-phase event-task/scheduled-task work enough
51
+ * tool calls) while giving multi-phase event-automation/scheduled-automation work enough
52
52
  * headroom to avoid pausing on legitimate longer-running automation.
53
53
  */
54
54
  const MAX_CONSECUTIVE_AUTOMATED_TURNS = 25;
@@ -209,22 +209,22 @@ const slackDirectCredentialSubjectBindingSchema = z.object({
209
209
  channelId: z.string().min(1),
210
210
  signature: z.string().min(1)
211
211
  }).strict();
212
- const scheduledTaskCredentialSubjectBindingSchema = z.object({
213
- type: z.literal("scheduled-task"),
212
+ const scheduledAutomationCredentialSubjectBindingSchema = z.object({
213
+ type: z.literal("scheduled-automation"),
214
214
  plugin: z.string().min(1),
215
215
  taskId: exactNonBlankStringSchema,
216
216
  signature: z.string().min(1)
217
217
  }).strict();
218
- const eventTaskCredentialSubjectBindingSchema = z.object({
219
- type: z.literal("event-task"),
218
+ const eventAutomationCredentialSubjectBindingSchema = z.object({
219
+ type: z.literal("event-automation"),
220
220
  plugin: z.string().min(1),
221
221
  taskId: exactNonBlankStringSchema,
222
222
  signature: z.string().min(1)
223
223
  }).strict();
224
224
  z.discriminatedUnion("type", [
225
225
  slackDirectCredentialSubjectBindingSchema,
226
- scheduledTaskCredentialSubjectBindingSchema,
227
- eventTaskCredentialSubjectBindingSchema
226
+ scheduledAutomationCredentialSubjectBindingSchema,
227
+ eventAutomationCredentialSubjectBindingSchema
228
228
  ]);
229
229
  const credentialUserActorSchema = z.object({
230
230
  type: z.literal("user"),
@@ -244,21 +244,21 @@ const credentialSubjectSchema = z.discriminatedUnion("allowedWhen", [
244
244
  z.object({
245
245
  type: z.literal("user"),
246
246
  userId: exactActorIdSchema,
247
- allowedWhen: z.literal("scheduled-task"),
247
+ allowedWhen: z.literal("scheduled-automation"),
248
248
  taskId: exactNonBlankStringSchema,
249
- binding: scheduledTaskCredentialSubjectBindingSchema
249
+ binding: scheduledAutomationCredentialSubjectBindingSchema
250
250
  }).strict().refine((subject) => subject.binding.taskId === subject.taskId, {
251
- message: "Scheduled task credential subject requires task binding",
251
+ message: "Scheduled automation credential subject requires task binding",
252
252
  path: ["binding"]
253
253
  }),
254
254
  z.object({
255
255
  type: z.literal("user"),
256
256
  userId: exactActorIdSchema,
257
- allowedWhen: z.literal("event-task"),
257
+ allowedWhen: z.literal("event-automation"),
258
258
  taskId: exactNonBlankStringSchema,
259
- binding: eventTaskCredentialSubjectBindingSchema
259
+ binding: eventAutomationCredentialSubjectBindingSchema
260
260
  }).strict().refine((subject) => subject.binding.taskId === subject.taskId, {
261
- message: "Event task credential subject requires task binding",
261
+ message: "Event automation credential subject requires task binding",
262
262
  path: ["binding"]
263
263
  })
264
264
  ]);
@@ -275,7 +275,7 @@ const credentialContextSchema = z.union([z.object({ actor: credentialUserActorSc
275
275
  * - system actor → `{ actor: systemActor, subject? }`
276
276
  *
277
277
  * They only diverge when a system run carries an explicit delegated `subject`
278
- * (scheduled/event-task creator credentials). Callers should set `actor` first,
278
+ * (scheduled/event-automation creator credentials). Callers should set `actor` first,
279
279
  * then derive this — do not hand-build parallel shapes.
280
280
  */
281
281
  function credentialContextForActor(actor, subject) {
@@ -1,4 +1,4 @@
1
- import { f as logWarn } from "./logging-D37bayDc.js";
1
+ import { f as logWarn } from "./logging-Dx0S5k2z.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  //#region src/chat/conversation-privacy.ts
4
4
  const SAFE_METADATA_KEY_LIMIT = 20;
@@ -1,28 +1,28 @@
1
- import { N as getMcpProviderErrorAttributes, Y as createUserTokenStore, a as deleteMcpAuthSession, d as putMcpStoredOAuthCredentials, h as resolvePluginOAuthAccount, i as finalizeMcpAuthorization, l as getMcpAuthSession, u as getMcpStoredOAuthCredentials, y as lookupSlackUserProfile } from "./agent-C9yuiZUF.js";
2
- import { m as escapeXml } from "./client-ceE7NtvC.js";
3
- import { L as toOptionalString, S as withLogContext, d as logInfo, f as logWarn, m as runBestEffort, u as logException, y as setTags } from "./logging-D37bayDc.js";
4
- import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig, o as getRuntimeMetadata } from "./config-CIE83sR2.js";
1
+ import { N as getMcpProviderErrorAttributes, Y as createUserTokenStore, a as deleteMcpAuthSession, d as putMcpStoredOAuthCredentials, h as resolvePluginOAuthAccount, i as finalizeMcpAuthorization, l as getMcpAuthSession, u as getMcpStoredOAuthCredentials, y as lookupSlackUserProfile } from "./agent-CmQlX68D.js";
2
+ import { m as escapeXml } from "./client-Bp297GA0.js";
3
+ import { L as toOptionalString, S as withLogContext, d as logInfo, f as logWarn, m as runBestEffort, u as logException, y as setTags } from "./logging-Dx0S5k2z.js";
4
+ import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig, o as getRuntimeMetadata } from "./config-G2gv97R1.js";
5
5
  import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
6
- import { _ as parseSlackMessageTs, g as parseSlackUserId, l as isUserActor, s as createSlackResumeActor } from "./context-B45_WqVX.js";
7
- import { Ft as getConversationStore, G as isDmChannel, H as getHeaderString, Jt as upsertLinkedIdentity, K as normalizeSlackConversationId, Lt as getSqlExecutor, U as getSlackClient, Zt as requireSlackDestination, mt as getDashboardConversationLink, o as getPluginSlackConversationLink, qt as upsertIdentity, wt as buildSentryConversationUrl, z as SlackActionError } from "./agent-hooks-DNjlz2A-.js";
6
+ import { _ as parseSlackMessageTs, g as parseSlackUserId, l as isUserActor, s as createSlackResumeActor } from "./context-Bplcgypl.js";
7
+ import { Ft as getConversationStore, G as isDmChannel, H as getHeaderString, Jt as upsertLinkedIdentity, K as normalizeSlackConversationId, Lt as getSqlExecutor, U as getSlackClient, Zt as requireSlackDestination, mt as getDashboardConversationLink, o as getPluginSlackConversationLink, qt as upsertIdentity, wt as buildSentryConversationUrl, z as SlackActionError } from "./agent-hooks-BBX9p6aG.js";
8
8
  import { i as homeDir } from "./package-discovery-7a9YqLhE.js";
9
- import { l as hasRequiredOAuthScope, n as buildOAuthTokenRequest, r as parseOAuthTokenResponse } from "./registry-DiR0-xRg.js";
10
- import { n as pluginCatalogRuntime } from "./catalog-runtime-TBR8n4e1.js";
11
- import { t as discoverSkills } from "./skills-BhM5qyCF.js";
12
- import { P as commitAcceptedReply, Q as hydrateConversationMessages, R as loadProjection, U as recordAuthenticationLinked, W as recordAuthorizationCompleted, d as persistWithRetry, dt as recordDeliveredAssistantMessage, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, lt as markConversationMessage, m as buildTurnErrorResponse, n as loadTurnCheckpoint, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord, u as recordTurnSummary } from "./checkpoint-BY47jJCB.js";
13
- import { E as acquireActiveLock, w as getStateAdapter } from "./profile-CSixooTi.js";
14
- import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats-DKRP4rsY.js";
15
- import { a as isPendingAuthLatestRequest, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, i as getConversationPendingAuth, r as clearPendingAuth, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-BPUzcs7n.js";
16
- import { a as parseOAuthStatePayload, c as escapeSlackMrkdwnText, d as normalizeSlackStatusText, f as truncateStatusText, g as removeReactionFromMessage, h as postSlackMessage, i as formatProviderLabel, l as formatSlackLink, o as resolveBaseUrl, p as addReactionToMessage, u as normalizeSlackReplyMarkdown, v as RetryableDeliveryError } from "./agent-runner-E67lFrDG.js";
9
+ import { l as hasRequiredOAuthScope, n as buildOAuthTokenRequest, r as parseOAuthTokenResponse } from "./registry-CWKdLCTG.js";
10
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-1BZEOR8J.js";
11
+ import { t as discoverSkills } from "./skills-D9WesdJJ.js";
12
+ import { P as commitAcceptedReply, Q as hydrateConversationMessages, R as loadProjection, U as recordAuthenticationLinked, W as recordAuthorizationCompleted, d as persistWithRetry, dt as recordDeliveredAssistantMessage, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, lt as markConversationMessage, m as buildTurnErrorResponse, n as loadTurnCheckpoint, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord, u as recordTurnSummary } from "./checkpoint-B-JO5F3c.js";
13
+ import { E as acquireActiveLock, w as getStateAdapter } from "./profile-d-fKypxo.js";
14
+ import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats-CFlUGqVA.js";
15
+ import { a as isPendingAuthLatestRequest, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, i as getConversationPendingAuth, r as clearPendingAuth, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-DIZ4iZjS.js";
16
+ import { a as parseOAuthStatePayload, c as escapeSlackMrkdwnText, d as normalizeSlackStatusText, f as truncateStatusText, g as removeReactionFromMessage, h as postSlackMessage, i as formatProviderLabel, l as formatSlackLink, o as resolveBaseUrl, p as addReactionToMessage, u as normalizeSlackReplyMarkdown, v as RetryableDeliveryError } from "./agent-runner-CQD4HKK2.js";
17
17
  import { t as getVercelConversationWorkQueue } from "./vercel-queue-DIkVcfK4.js";
18
- import { a as getTurnRequestDeadline } from "./job-queue-CyTc24Es.js";
19
- import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-alpjVSxQ.js";
20
- import { n as getTurnLifecycle } from "./turn-lifecycle-VbwZLfBv.js";
21
- import { n as executeTurn, t as AgentRunError } from "./turn-execution-XtyzIHog.js";
22
- import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-CRK7aA41.js";
23
- import { a as requireTurnFailureEventId, c as getTurnUserMessageId, d as buildDeliveredTurnStatePatch, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, o as getInterruptionMarker, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, u as getTurnUserSlackMessageTs } from "./auth-pause-state-MVZ6xvEK.js";
18
+ import { a as getTurnRequestDeadline } from "./job-queue-rnAPfUhP.js";
19
+ import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-DO79gdho.js";
20
+ import { n as getTurnLifecycle } from "./turn-lifecycle-DSBK4Ars.js";
21
+ import { n as executeTurn, t as AgentRunError } from "./turn-execution-BSIHxmQJ.js";
22
+ import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-DD6BA4xz.js";
23
+ import { a as requireTurnFailureEventId, c as getTurnUserMessageId, d as buildDeliveredTurnStatePatch, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, o as getInterruptionMarker, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, u as getTurnUserSlackMessageTs } from "./auth-pause-state-uv8on6cT.js";
24
24
  import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
25
- import { n as deleteWebAuthorization } from "./web-authorization-CsfLSfEs.js";
25
+ import { n as deleteWebAuthorization } from "./web-authorization-C73gJV7l.js";
26
26
  import path from "node:path";
27
27
  import { z } from "zod";
28
28
  import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
@@ -1,4 +1,4 @@
1
- import "./store-C5qxF2ac.js";
1
+ import "./store-Det8MQ9g.js";
2
2
  import { z } from "zod";
3
3
  import "drizzle-orm/pg-core";
4
4
  import "drizzle-orm/migrator";