@sentry/junior 0.239.0 → 0.241.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.
- package/dist/{admin-Cc-iA6z9.js → admin-CJkjl-aN.js} +1 -1
- package/dist/{agent-hooks-DzfA5m3R.js → agent-hooks-C5zYOaJk.js} +1972 -1866
- package/dist/{agent-runner--1wC26S6.js → agent-runner-CMZ6lFQe.js} +377 -1227
- package/dist/api/schema.d.ts +9 -0
- package/dist/api/schema.js +2 -2
- package/dist/api.d.ts +1 -1
- package/dist/api.js +22 -21
- package/dist/{app-FB2hmHpZ.d.ts → app-MEd7wbF0.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +105 -31
- package/dist/{automation-CrQGQ2MT.js → automation-gznOMaQ2.js} +13 -255
- package/dist/{briefs-DGc2Thua.js → briefs-CsQbFjRi.js} +2 -2
- package/dist/cadence-D00SCzT1.js +256 -0
- package/dist/{catalog-runtime-DpB_hG_I.js → catalog-runtime-Tz0O2MZe.js} +1 -1
- package/dist/cli/chat.js +12 -12
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-DNf-sJmM.js → client-CRZ-i1tH.js} +2 -2
- package/dist/{config-B8QN-04U.js → config-CCI82OTD.js} +2 -2
- package/dist/{conversation-privacy-CrYizZM3.js → conversation-privacy-D5Byl5eC.js} +1 -1
- package/dist/{credential-sync-BG_Yvja8.js → credential-sync-DUpSxUum.js} +14 -14
- package/dist/{db-CWZP77Ex.d.ts → db-Ca9Nt5ci.d.ts} +1 -1
- package/dist/{executor-BQV1Zc1z.js → executor-CewKi7EG.js} +4 -2
- package/dist/{images-C_0iwPsW.js → images-DY6Pxq4w.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-D82gksYM.js → job-queue-C6o2aJQ6.js} +1 -1
- package/dist/{logging-Crg0e1jb.js → logging-LQnLlPf8.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-Bdu39G-H.js → oauth-authorization-Clzkm-Ts.js} +1 -1
- package/dist/{oauth-callback-server-eJfI6skP.js → oauth-callback-server-DcYAJSEz.js} +2 -2
- package/dist/{pending-auth-DauOaies.js → pending-auth-CT3ojhKe.js} +2 -2
- package/dist/{profile-XzHSfIah.js → profile-mWuVZ8ht.js} +4 -4
- package/dist/{registry-BJME30oR.js → registry-DPDH6s5G.js} +1 -1
- package/dist/{resolve-ZKXfsZuZ.js → resolve-BAN8BSGy.js} +2 -2
- package/dist/{runner-DkHL8vRA.js → runner-CqXZJfzk.js} +9 -9
- package/dist/{sandbox-egress-signals-BEQsK7ym.js → sandbox-egress-signals-DFUUokws.js} +1 -1
- package/dist/{schema-CxWAN2zq.js → schema-Cabm4jcj.js} +1 -1
- package/dist/{skills-CMl248J3.js → skills-BtHhSATy.js} +2 -2
- package/dist/{spawn-DrvZYrTQ.js → spawn-BszkFJKJ.js} +2 -2
- package/dist/{store-BxxbxBlm.d.ts → store-DoewL5mG.d.ts} +0 -7
- package/dist/{task-queue-BMzTARMo.js → task-queue-1LP6benz.js} +3 -3
- package/dist/{task-runner-CXTpWSmw.js → task-runner-kLN3HC-_.js} +54 -12
- package/dist/{checkpoint-CN7yMfSo.js → tasks-CO52vLkI.js} +1064 -18
- package/dist/{thread-state-BM1sLptE.js → thread-state-CaFRG5Mh.js} +6 -6
- package/dist/{turn-failure-response-ISrbka5I.js → turn-failure-response-Dmovuiq1.js} +9 -8
- package/dist/{turn-lifecycle-f7TPxQsc.js → turn-lifecycle-DGqZgU6J.js} +1 -1
- package/dist/{turn-session-routing-BcAD7onh.js → turn-session-routing-B_v8Wbn4.js} +1 -1
- package/dist/{validation-Bo6BHmig.js → validation-B4L2Rmiw.js} +1 -1
- package/dist/{version-Cv__n5ue.js → version-DiR36OaN.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-EftpWXcF.js → viewer-D6stAU7h.js} +9 -11
- package/dist/{web-authorization-BLDXKk2u.js → web-authorization-DLMBx2nL.js} +6 -6
- package/dist/{web-input-DSa6geKr.js → web-input---xuox1t.js} +136 -147
- package/dist/{work-WOk5DovU.js → work-G-HdoOSF.js} +7 -7
- package/dist/{worker-B7rtMFzw.js → worker-CDUDfL9P.js} +5 -5
- package/migrations/0049_event_automation_status_reason.sql +1 -0
- package/migrations/meta/0049_snapshot.json +3581 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +5 -5
package/dist/cli/upgrade.d.ts
CHANGED
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { i as getChatConfig } from "../config-CCI82OTD.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-CewKi7EG.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-DPDH6s5G.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-CVvEUSMH.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-LQnLlPf8.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-D5Byl5eC.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-B4FMCO8f.js";
|
|
2
|
-
import { S as toOptionalTrimmed, o as resolveGatewayModel } from "./client-
|
|
3
|
-
import { p as logWarn } from "./logging-
|
|
2
|
+
import { S as toOptionalTrimmed, o as resolveGatewayModel } from "./client-CRZ-i1tH.js";
|
|
3
|
+
import { p as logWarn } from "./logging-LQnLlPf8.js";
|
|
4
4
|
import { l as TURN_REASONING_LEVELS, s as modelProfileSchema, t as DEFAULT_MODEL_PROFILES, u as parseTurnReasoningLevel } from "./model-profile-BwU8mqwD.js";
|
|
5
5
|
//#region src/chat/slack/emoji.ts
|
|
6
6
|
const SLACK_EMOJI_NAME_RE = /^(?:[a-z0-9_+-]+)(?:::(?:skin-tone-[2-6]))?$/;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as escapeXml } from "./client-
|
|
3
|
-
import { d as logException, h as runBestEffort, p as logWarn } from "./logging-
|
|
4
|
-
import { a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
1
|
+
import { Jt as resolveBaseUrl, Kt as formatProviderLabel, Xt as createUserTokenStore, _ as resolvePluginOAuthAccount, d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, q as getMcpProviderErrorAttributes, qt as parseOAuthStatePayload, s as deleteMcpAuthSession, x as lookupSlackUserProfile } from "./agent-runner-CMZ6lFQe.js";
|
|
2
|
+
import { f as escapeXml } from "./client-CRZ-i1tH.js";
|
|
3
|
+
import { d as logException, h as runBestEffort, p as logWarn } from "./logging-LQnLlPf8.js";
|
|
4
|
+
import { a as getRuntimeMetadata, n as botConfig } from "./config-CCI82OTD.js";
|
|
5
5
|
import { f as parseSlackUserId } from "./actor-BTtLaeWy.js";
|
|
6
|
-
import { A as
|
|
6
|
+
import { A as upsertIdentity, f as getSqlExecutor, j as upsertLinkedIdentity } from "./viewer-D6stAU7h.js";
|
|
7
7
|
import { i as homeDir } from "./package-discovery-BVvSnQBB.js";
|
|
8
|
-
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
-
import { t as discoverSkills } from "./skills-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-
|
|
14
|
-
import { i as getConversationPendingAuth } from "./pending-auth-
|
|
15
|
-
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
16
|
-
import { n as deleteWebAuthorization, o as wakeAuthorizedTurn, s as wakePausedTurn } from "./web-authorization-
|
|
8
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-DPDH6s5G.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Tz0O2MZe.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-BtHhSATy.js";
|
|
11
|
+
import { At as recordAuthenticationLinked, X as getTurnRecord, jt as recordAuthorizationCompleted, z as postSlackMessage } from "./tasks-CO52vLkI.js";
|
|
12
|
+
import { zt as getSlackClient } from "./agent-hooks-C5zYOaJk.js";
|
|
13
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-mWuVZ8ht.js";
|
|
14
|
+
import { i as getConversationPendingAuth } from "./pending-auth-CT3ojhKe.js";
|
|
15
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CaFRG5Mh.js";
|
|
16
|
+
import { n as deleteWebAuthorization, o as wakeAuthorizedTurn, s as wakePausedTurn } from "./web-authorization-DLMBx2nL.js";
|
|
17
17
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import { z } from "zod";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as logException } from "./logging-
|
|
1
|
+
import { d as logException } from "./logging-LQnLlPf8.js";
|
|
2
2
|
import { g as startSpanManual } from "./sentry-CgWZM_kV.js";
|
|
3
|
-
import "./config-
|
|
3
|
+
import "./config-CCI82OTD.js";
|
|
4
4
|
import { n as juniorDestinations, r as timestamptz } from "./destinations-BeBiJeEM.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { getTableColumns, sql } from "drizzle-orm";
|
|
@@ -406,6 +406,8 @@ const juniorEventAutomations = pgTable("junior_event_tasks", {
|
|
|
406
406
|
createdAtMs: bigint("created_at_ms", { mode: "number" }).notNull(),
|
|
407
407
|
/** Retained row status. Deleted tasks keep history but stop matching. */
|
|
408
408
|
status: text("status").$type().notNull().default("active"),
|
|
409
|
+
/** Why a run blocked this automation. Kept while paused; cleared on resume. */
|
|
410
|
+
statusReason: text("status_reason"),
|
|
409
411
|
/** Short display title generated from the task instruction. */
|
|
410
412
|
title: text("title"),
|
|
411
413
|
task: jsonb("task_json").$type().notNull()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner
|
|
3
|
-
import { f as getSqlExecutor } from "./viewer-
|
|
2
|
+
import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner-CMZ6lFQe.js";
|
|
3
|
+
import { f as getSqlExecutor } from "./viewer-D6stAU7h.js";
|
|
4
4
|
import "./conversation-DwD-vquD.js";
|
|
5
5
|
//#region src/chat/attachments/images.ts
|
|
6
6
|
var images_exports = /* @__PURE__ */ __exportAll({
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as getDeploymentServiceVersion, P as getDeploymentTelemetryAttributes } from "./logging-
|
|
1
|
+
import { N as getDeploymentServiceVersion, P as getDeploymentTelemetryAttributes } from "./logging-LQnLlPf8.js";
|
|
2
2
|
import { _ as vercelAIIntegration, a as getClient, b as withStreamedSpan, c as init, o as getGlobalScope } from "./sentry-CgWZM_kV.js";
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-D5Byl5eC.js";
|
|
4
4
|
import { t as consumePrivateTraceResultMarker } from "./private-trace-result-BLvBjy_e.js";
|
|
5
5
|
//#region src/chat/sentry-payload-filter.ts
|
|
6
6
|
const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
1
|
+
import { i as getChatConfig } from "./config-CCI82OTD.js";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
@@ -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-
|
|
2
|
+
import { t as JUNIOR_VERSION } from "./version-DiR36OaN.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";
|
package/dist/nitro.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as JuniorDashboardOptions } from "./app-
|
|
1
|
+
import { r as JuniorDashboardOptions } from "./app-MEd7wbF0.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-
|
|
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-LQnLlPf8.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-
|
|
3
|
+
import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-C6o2aJQ6.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-
|
|
5
|
+
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-1LP6benz.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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { it as extractAssistantText } from "./tasks-CO52vLkI.js";
|
|
2
2
|
//#region src/chat/runtime/turn.ts
|
|
3
3
|
/** Classified Slack turn failure carrying the owning Sentry capture outward. */
|
|
4
4
|
var ConversationTurnBoundaryError = class extends Error {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { Xt as createUserTokenStore } from "./agent-runner-CMZ6lFQe.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-DUpSxUum.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,5 +1,5 @@
|
|
|
1
|
-
import { v as isProviderRetryError } from "./client-
|
|
2
|
-
import {
|
|
1
|
+
import { v as isProviderRetryError } from "./client-CRZ-i1tH.js";
|
|
2
|
+
import { in as estimateTextTokens, q as abandonTurnRecord } from "./tasks-CO52vLkI.js";
|
|
3
3
|
import { r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/chat/state/turn-id.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as toOptionalTrimmed } from "./client-
|
|
2
|
-
import { v as setSpanAttributes, y as setSpanStatus } from "./logging-
|
|
3
|
-
import { i as getChatConfig } from "./config-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
1
|
+
import { S as toOptionalTrimmed } from "./client-CRZ-i1tH.js";
|
|
2
|
+
import { v as setSpanAttributes, y as setSpanStatus } from "./logging-LQnLlPf8.js";
|
|
3
|
+
import { i as getChatConfig } from "./config-CCI82OTD.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Tz0O2MZe.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 { f as logInfo, p as logWarn, v as setSpanAttributes } from "./logging-
|
|
1
|
+
import { f as logInfo, p as logWarn, v as setSpanAttributes } from "./logging-LQnLlPf8.js";
|
|
2
2
|
import { 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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v as setSpanAttributes, w as withSpan } from "./logging-
|
|
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-
|
|
1
|
+
import { v as setSpanAttributes, w as withSpan } from "./logging-LQnLlPf8.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-mWuVZ8ht.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { FileSystem, Sandbox } from "@vercel/sandbox";
|
|
5
5
|
//#region src/chat/sandbox/resources.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { C as withLogContext, b as setTags, d as logException } from "./logging-
|
|
2
|
-
import { c as getConversationEventStore, u as getConversationStore } from "./viewer-
|
|
3
|
-
import { d as credentialContextForActor } from "./registry-
|
|
4
|
-
import {
|
|
1
|
+
import { C as withLogContext, b as setTags, d as logException } from "./logging-LQnLlPf8.js";
|
|
2
|
+
import { c as getConversationEventStore, u as getConversationStore } from "./viewer-D6stAU7h.js";
|
|
3
|
+
import { d as credentialContextForActor } from "./registry-DPDH6s5G.js";
|
|
4
|
+
import { $ as persistWithRetry, $t as markConversationMessage, Bt as persistConversationMessages, Jt as buildConversationContext, K as saveTurnCheckpoint, bt as commitAcceptedReply, en as normalizeConversationText, jt as recordAuthorizationCompleted, rn as upsertConversationMessage, tn as recordDeliveredAssistantMessage, wt as loadProjection, zt as hydrateConversationMessages } from "./tasks-CO52vLkI.js";
|
|
5
5
|
import { U as messageCardText } from "./conversation-DwD-vquD.js";
|
|
6
|
-
import { _ as markTurnFailed, r as getAssistantReplyText, t as authorizationId, v as startActiveTurn } from "./oauth-authorization-
|
|
7
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-
|
|
8
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
9
|
-
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
10
|
-
import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-
|
|
6
|
+
import { _ as markTurnFailed, r as getAssistantReplyText, t as authorizationId, v as startActiveTurn } from "./oauth-authorization-Clzkm-Ts.js";
|
|
7
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-kLN3HC-_.js";
|
|
8
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-DGqZgU6J.js";
|
|
9
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CaFRG5Mh.js";
|
|
10
|
+
import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-Dmovuiq1.js";
|
|
11
11
|
import { randomUUID } from "node:crypto";
|
|
12
12
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
13
13
|
//#region src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gt as sandboxEgressSignalsResponseSchema } from "./agent-runner-CMZ6lFQe.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,6 +1,6 @@
|
|
|
1
1
|
import { t as juniorDestinationKindSchema } from "./destinations-BeBiJeEM.js";
|
|
2
2
|
import { E as conversationSummaryReportSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-DwD-vquD.js";
|
|
3
|
-
import "./automation-
|
|
3
|
+
import "./automation-gznOMaQ2.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";
|
|
6
6
|
import { codeChangeStateSchema } from "@sentry/junior-plugin-api";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { p as logWarn } from "./logging-
|
|
2
|
+
import { p as logWarn } from "./logging-LQnLlPf8.js";
|
|
3
3
|
import { s as skillRoots } from "./package-discovery-BVvSnQBB.js";
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Tz0O2MZe.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 {
|
|
3
|
-
import { n as createAndEnqueueAgentInvocation } from "./work-
|
|
2
|
+
import { $t as actorFromRun, en as toolInvocationDestination } from "./agent-runner-CMZ6lFQe.js";
|
|
3
|
+
import { n as createAndEnqueueAgentInvocation } from "./work-G-HdoOSF.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. */
|
|
@@ -135,13 +135,6 @@ interface ConversationStore {
|
|
|
135
135
|
providerTenantId: string;
|
|
136
136
|
providerConversationId: string;
|
|
137
137
|
}): Promise<string | undefined>;
|
|
138
|
-
/** Return the first provider conversation bound in one destination. */
|
|
139
|
-
getFirstProviderConversationId(args: {
|
|
140
|
-
conversationId: string;
|
|
141
|
-
provider: string;
|
|
142
|
-
providerDestinationId: string;
|
|
143
|
-
providerTenantId: string;
|
|
144
|
-
}): Promise<string | undefined>;
|
|
145
138
|
/** Bind one provider conversation to its pre-existing durable conversation. */
|
|
146
139
|
bindProviderConversation(args: {
|
|
147
140
|
conversationId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as logWarn } from "./logging-
|
|
2
|
-
import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as createVercelQueueClient, l as signQueueMessage, p as runWithTurnRequestDeadline, u as verifyQueueMessage } from "./job-queue-
|
|
1
|
+
import { p as logWarn } from "./logging-LQnLlPf8.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-C6o2aJQ6.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-
|
|
118
|
+
const { processPluginTask } = await import("./task-runner-kLN3HC-_.js").then((n) => n.r);
|
|
119
119
|
await processPluginTask(message);
|
|
120
120
|
},
|
|
121
121
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { p as logWarn } from "./logging-
|
|
2
|
+
import { h as runBestEffort, p as logWarn } from "./logging-LQnLlPf8.js";
|
|
3
3
|
import { g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
|
|
4
|
-
import {
|
|
5
|
-
import { D as juniorConversations, c as juniorAutomationExecutions } from "./executor-
|
|
4
|
+
import { C as agentTurnTotalTokens, S as agentTurnCostUsd, d as getDb, r as readActorIdentity, u as getConversationStore } from "./viewer-D6stAU7h.js";
|
|
5
|
+
import { D as juniorConversations, c as juniorAutomationExecutions } from "./executor-CewKi7EG.js";
|
|
6
6
|
import { p as sameActorIdentity } from "./history-BLTUgFYO.js";
|
|
7
|
-
import { p as credentialSubjectSchema } from "./registry-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { w as getStateAdapter } from "./profile-
|
|
11
|
-
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
12
|
-
import { t as resolveConversationRouting } from "./turn-session-routing-
|
|
13
|
-
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-
|
|
7
|
+
import { p as credentialSubjectSchema } from "./registry-DPDH6s5G.js";
|
|
8
|
+
import { A as formatSlackLink, Gt as fallbackShortTitle, L as openSlackDirectMessage, X as getTurnRecord, a as readScheduledAutomation, at as getPiMessageRole, ft as isToolResultError, g as getEventAutomation, gt as stripRuntimeTurnContext, k as escapeSlackMrkdwnText, lt as instructionTextForProjection, mt as normalizeToolNameFromResult, pt as isToolResultMessage, u as blockEventAutomation, z as postSlackMessage, zt as hydrateConversationMessages } from "./tasks-CO52vLkI.js";
|
|
9
|
+
import { ct as createPluginModel, it as getDashboardTaskLink, lt as createPluginLogger, ot as createPluginState, p as coreTaskRegistrations, st as createPluginEmbedder, tt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, yt as createPluginConversationEvents } from "./agent-hooks-C5zYOaJk.js";
|
|
10
|
+
import { w as getStateAdapter } from "./profile-mWuVZ8ht.js";
|
|
11
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CaFRG5Mh.js";
|
|
12
|
+
import { t as resolveConversationRouting } from "./turn-session-routing-B_v8Wbn4.js";
|
|
13
|
+
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-1LP6benz.js";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
import { createHash } from "node:crypto";
|
|
16
16
|
import { and, asc, count, desc, eq, gte, inArray, lte, max, or, sql } from "drizzle-orm";
|
|
@@ -386,6 +386,36 @@ async function readAutomationExecutionStatusHours(args) {
|
|
|
386
386
|
return [...byHour.values()];
|
|
387
387
|
}
|
|
388
388
|
//#endregion
|
|
389
|
+
//#region src/chat/automations/blocked-notice.ts
|
|
390
|
+
function buildBlockedNoticeText(automationId, title, reason) {
|
|
391
|
+
const url = getDashboardTaskLink(automationId);
|
|
392
|
+
return [
|
|
393
|
+
`Your automation *${escapeSlackMrkdwnText(title)}* is blocked. It won't run again until you resume it.`,
|
|
394
|
+
`> ${escapeSlackMrkdwnText(reason.replace(/\s+/g, " ").trim())}`,
|
|
395
|
+
url ? `Fix the problem, then ${formatSlackLink(url, "resume it")}.` : "Fix the problem, then ask me to resume it."
|
|
396
|
+
].join("\n");
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Tell an Automation's creator in a direct message that a run blocked it,
|
|
400
|
+
* and why. Call this once, after the Automation itself is stored as blocked,
|
|
401
|
+
* so the dashboard matches the notice. The notice is best-effort: the reason
|
|
402
|
+
* also shows on the dashboard and in the Automation tools.
|
|
403
|
+
*/
|
|
404
|
+
async function notifyAutomationBlocked(ref) {
|
|
405
|
+
await runBestEffort(async () => {
|
|
406
|
+
const task = ref.kind === "scheduled" ? await readScheduledAutomation(getDb(), ref.automationId) : await getEventAutomation(getDb(), ref.automationId);
|
|
407
|
+
if (!task) return;
|
|
408
|
+
const title = task.title ?? fallbackShortTitle(task.task.text, ref.kind === "scheduled" ? "Scheduled automation" : "Event automation");
|
|
409
|
+
await postSlackMessage({
|
|
410
|
+
channelId: await openSlackDirectMessage(task.createdBy.slackUserId),
|
|
411
|
+
text: buildBlockedNoticeText(ref.automationId, title, ref.reason)
|
|
412
|
+
});
|
|
413
|
+
}, "automation.blocked_notice.failed", {
|
|
414
|
+
"app.task.type": ref.kind,
|
|
415
|
+
...ref.dispatchId ? { "app.dispatch.id": ref.dispatchId } : void 0
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
//#endregion
|
|
389
419
|
//#region src/chat/agent-dispatch/store.ts
|
|
390
420
|
const DISPATCH_PREFIX = "junior:agent_dispatch";
|
|
391
421
|
const DISPATCH_LOCK_TTL_MS = 6e5;
|
|
@@ -630,9 +660,21 @@ async function recordEventAutomationExecution(previous, next, status) {
|
|
|
630
660
|
status
|
|
631
661
|
});
|
|
632
662
|
}
|
|
633
|
-
/**
|
|
663
|
+
/**
|
|
664
|
+
* Project a blocked turn to the plugin API. An Event automation is blocked
|
|
665
|
+
* first, so a retry after a failed write still blocks it. Its creator is told
|
|
666
|
+
* when the block is first stored. The heartbeat blocks a Scheduled automation
|
|
667
|
+
* and tells its creator.
|
|
668
|
+
*/
|
|
634
669
|
async function markDispatchBlocked(id, errorMessage, resultMessageTs) {
|
|
635
670
|
const previous = await getDispatchRecord(id);
|
|
671
|
+
const eventAutomationId = previous?.metadata?.eventAutomationId;
|
|
672
|
+
if (previous?.plugin === "junior" && eventAutomationId && !isTerminalDispatchStatus(previous.status) && await blockEventAutomation(getDb(), eventAutomationId, errorMessage)) await notifyAutomationBlocked({
|
|
673
|
+
automationId: eventAutomationId,
|
|
674
|
+
dispatchId: id,
|
|
675
|
+
kind: "event",
|
|
676
|
+
reason: errorMessage
|
|
677
|
+
});
|
|
636
678
|
const next = await transitionDispatch(id, (record) => isTerminalDispatchStatus(record.status) ? record : {
|
|
637
679
|
...record,
|
|
638
680
|
errorMessage,
|
|
@@ -943,4 +985,4 @@ async function processPluginTask(message, options = {}) {
|
|
|
943
985
|
});
|
|
944
986
|
}
|
|
945
987
|
//#endregion
|
|
946
|
-
export {
|
|
988
|
+
export { conversationActiveDaysColumn as A, readAutomationExecutionHours as C, readAutomationExecutions as D, readAutomationExecutionSummaries as E, conversationRangeColumns as M, readAutomationRuns as O, readAutomationExecutionDays as S, readAutomationExecutionStatusHours as T, markDispatchFailed as _, confirmDispatchMailboxAppend as a, emptyAutomationRunWindows as b, getDispatchInputMessageId as c, getPluginDispatchProjection as d, isTerminalDispatchStatus as f, markDispatchCompleted as g, markDispatchBlocked as h, claimDispatchMailboxAppend as i, conversationAggregateColumns as j, recordAutomationExecution as k, getDispatchRecord as l, markDispatchAwaitingResume as m, scheduleSessionCompletedPluginTasks as n, createOrGetDispatch as o, listPendingDispatchMailboxAppends as p, task_runner_exports as r, getDispatchConversationId as s, processPluginTask as t, getDispatchTurnId as u, markDispatchRunning as v, readAutomationExecutionStatusDays as w, readAutomationExecutionByConversationId as x, notifyAutomationBlocked as y };
|