@sentry/junior 0.220.0 → 0.221.1
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/{agent-CJ_-GRPT.js → agent-CY49A4pN.js} +63 -69
- package/dist/{agent-hooks-DsFlR7gi.js → agent-hooks-BnZBgDPe.js} +6 -6
- package/dist/{agent-runner-D82gVT0O.js → agent-runner-BC8iSAfE.js} +5 -5
- package/dist/api.js +15 -15
- package/dist/app.js +31 -31
- package/dist/{auth-pause-state-DL5YJXnT.js → auth-pause-state-CJwPs1cT.js} +6 -6
- package/dist/{briefs-CvXfErSa.js → briefs-BSOhy23c.js} +2 -2
- package/dist/{catalog-runtime-DSEzvNVT.js → catalog-runtime-0oMD2jas.js} +1 -1
- package/dist/{checkpoint-DfpPyo-x.js → checkpoint-Bl47qAIY.js} +6 -6
- package/dist/cli/chat.js +13 -13
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +1 -1
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-pBijNHYx.js → client-BrThxuRI.js} +2 -2
- package/dist/{config-DYi2mx6N.js → config-CEuC6CFj.js} +2 -2
- package/dist/{conversation-privacy-TiU3SGZh.js → conversation-privacy-aHn1OwXL.js} +1 -1
- package/dist/{credential-sync-hBiu11zS.js → credential-sync-Dht95TJQ.js} +21 -21
- package/dist/{execution-stats-DAWGg9WH.js → execution-stats-D9m2kmmg.js} +3 -3
- package/dist/{executor-t2OCqFgz.js → executor-3IasVOqK.js} +1 -1
- package/dist/instrumentation.js +8 -6
- package/dist/{job-queue-Deruj7qS.js → job-queue-36liupTq.js} +1 -1
- package/dist/{logging-wngKXw7u.js → logging-gR24QCo_.js} +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-D1jNG0lr.js → oauth-callback-server-BvNIWVA3.js} +2 -2
- package/dist/{pending-auth-DJa76b68.js → pending-auth-Cl4BsopG.js} +2 -2
- package/dist/{profile-Mv2uNsKJ.js → profile-VmUpQuOm.js} +4 -4
- package/dist/{registry-6_Zog2YF.js → registry-BATk1X_v.js} +1 -1
- package/dist/{resolve-BI3Dfm9p.js → resolve-Cf79l1H8.js} +2 -2
- package/dist/{runner-CzrmejYr.js → runner-DNN4EPj_.js} +10 -10
- package/dist/{sandbox-egress-signals-BcSCyPKx.js → sandbox-egress-signals-C-HUJW1G.js} +1 -1
- package/dist/{short-title-Bs3wWE1M.js → short-title-Cy3D8vg1.js} +2 -2
- package/dist/{skills-DOE_QPVJ.js → skills-DMQkR1Yu.js} +2 -2
- package/dist/{spawn-DylJoJnT.js → spawn-BHk7RpYw.js} +2 -2
- package/dist/{stats--FeHjGJ1.js → stats-8Bzht8zO.js} +33 -8
- package/dist/{task-queue-CSEo5Ly9.js → task-queue-Cm4FhC0n.js} +3 -3
- package/dist/{task-runner-BDwZj8OX.js → task-runner-dQwOhCYs.js} +7 -7
- package/dist/{thread-state-CpZAVpdG.js → thread-state-D0Ktlch_.js} +5 -5
- package/dist/{turn-execution-AROC0tUZ.js → turn-execution-BfLZfabf.js} +3 -3
- package/dist/{turn-lifecycle-CGNjfgbT.js → turn-lifecycle-D75pWL8e.js} +1 -1
- package/dist/{validation-QFwh6qzp.js → validation-D5fdtuzG.js} +1 -1
- package/dist/{version-FAS9qrpM.js → version-DErORHQC.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-ZAQcIE4e.js → web-authorization-IHMPbDay.js} +1 -1
- package/dist/{web-input-C5nhIX0j.js → web-input-DskRJhrK.js} +4 -4
- package/dist/{work-BNw2Vmxi.js → work-CaaSjlNk.js} +9 -9
- package/dist/{worker-9Us77-te.js → worker-Eom9CfBl.js} +5 -5
- package/migrations/0043_scheduled_automation_channel_destinations.sql +36 -0
- package/migrations/meta/0043_snapshot.json +3610 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as completeObject } from "./client-
|
|
1
|
+
import { r as completeObject } from "./client-BrThxuRI.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-BSRGzJmY.js";
|
|
4
4
|
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-BkaHwBW0.js";
|
|
@@ -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-
|
|
272
|
+
const { botConfig } = await import("./config-CEuC6CFj.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-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-BATk1X_v.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-
|
|
2
|
-
import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
1
|
+
import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-BrThxuRI.js";
|
|
2
|
+
import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-gR24QCo_.js";
|
|
3
|
+
import { n as botConfig } from "./config-CEuC6CFj.js";
|
|
4
4
|
import { _ as parseSlackMessageTs, f as toStoredSlackActor } from "./context-Bplcgypl.js";
|
|
5
|
-
import { Bt as authenticationUnlinkedEvent, Ht as getConversationEventStore, Jt as withConversationEventLock, Kt as getSqlExecutor, Lt as JUNIOR_NATIVE_EVENT_NAMESPACE, Qt as bindProviderConversation, Rt as agentsInstructionsUpdatedEvent, Wt as getConversationStore, Yt as sanitizePostgresJson, en as addAgentTurnUsage, qt as createSqlConversationEventStore, zt as authenticationLinkedEvent } from "./agent-hooks-
|
|
5
|
+
import { Bt as authenticationUnlinkedEvent, Ht as getConversationEventStore, Jt as withConversationEventLock, Kt as getSqlExecutor, Lt as JUNIOR_NATIVE_EVENT_NAMESPACE, Qt as bindProviderConversation, Rt as agentsInstructionsUpdatedEvent, Wt as getConversationStore, Yt as sanitizePostgresJson, en as addAgentTurnUsage, qt as createSqlConversationEventStore, zt as authenticationLinkedEvent } from "./agent-hooks-BnZBgDPe.js";
|
|
6
6
|
import { F as agentHistoryItemSchema, H as contextProvenance, U as instructionActors, W as instructionProvenanceFor } from "./conversation-BSRGzJmY.js";
|
|
7
|
-
import { n as generateShortTitle, t as fallbackShortTitle } from "./short-title-
|
|
8
|
-
import { A as sleep, D as fenceLock, T as MUTATION_LOCK_TTL_MS, k as withLock, w as getStateAdapter } from "./profile-
|
|
7
|
+
import { n as generateShortTitle, t as fallbackShortTitle } from "./short-title-Cy3D8vg1.js";
|
|
8
|
+
import { A as sleep, D as fenceLock, T as MUTATION_LOCK_TTL_MS, k as withLock, w as getStateAdapter } from "./profile-VmUpQuOm.js";
|
|
9
9
|
import { isDeepStrictEqual } from "node:util";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { createHash } from "node:crypto";
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as executeAgentRun } from "../agent-
|
|
2
|
-
import { t as createAgentRunner } from "../agent-runner-
|
|
1
|
+
import { t as executeAgentRun } from "../agent-CY49A4pN.js";
|
|
2
|
+
import { t as createAgentRunner } from "../agent-runner-BC8iSAfE.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-
|
|
105
|
-
import("../catalog-runtime-
|
|
106
|
-
import("../validation-
|
|
107
|
-
import("../agent-hooks-
|
|
104
|
+
import("../agent-hooks-BnZBgDPe.js").then((n) => n.t),
|
|
105
|
+
import("../catalog-runtime-0oMD2jas.js").then((n) => n.t),
|
|
106
|
+
import("../validation-D5fdtuzG.js").then((n) => n.r),
|
|
107
|
+
import("../agent-hooks-BnZBgDPe.js").then((n) => n.Vt)
|
|
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-
|
|
159
|
+
const { setBriefsConfig } = await import("../agent-hooks-BnZBgDPe.js").then((n) => n.m);
|
|
160
160
|
setBriefsConfig({ enabled: true });
|
|
161
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
162
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
161
|
+
const { runLocalAgentTurn } = await import("../runner-DNN4EPj_.js");
|
|
162
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BvNIWVA3.js");
|
|
163
163
|
const { createLocalOAuthState } = await import("../oauth-relay-CdCnu80W.js").then((n) => n.t);
|
|
164
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
165
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
166
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
164
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-C-HUJW1G.js");
|
|
165
|
+
const { bindSpawnAgent } = await import("../spawn-BHk7RpYw.js").then((n) => n.n);
|
|
166
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-CaaSjlNk.js").then((n) => n.a);
|
|
167
167
|
const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
|
|
168
|
-
const { processConversationWork } = await import("../worker-
|
|
168
|
+
const { processConversationWork } = await import("../worker-Eom9CfBl.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-
|
|
2
|
-
import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { E as JUNIOR_HEARTBEAT_ROUTE, j as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-gR24QCo_.js";
|
|
2
|
+
import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-BATk1X_v.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-DMQkR1Yu.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-
|
|
28
|
+
return await (await import("../briefs-BSOhy23c.js")).runBriefs(argv);
|
|
29
29
|
}
|
|
30
30
|
function topLevelCommand(argv) {
|
|
31
31
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Gt as getDb, bt as createPluginLogger, d as setPlugins, f as validatePlugins } from "../agent-hooks-
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { Gt as getDb, bt as createPluginLogger, d as setPlugins, f as validatePlugins } from "../agent-hooks-BnZBgDPe.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-0oMD2jas.js";
|
|
3
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-D5fdtuzG.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-
|
|
2
|
-
import { S as disconnectStateAdapter, t as create } from "../profile-
|
|
3
|
-
import { r as resolve } from "../resolve-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-0oMD2jas.js";
|
|
2
|
+
import { S as disconnectStateAdapter, t as create } from "../profile-VmUpQuOm.js";
|
|
3
|
+
import { r as resolve } from "../resolve-Cf79l1H8.js";
|
|
4
4
|
//#region src/cli/snapshot-create.ts
|
|
5
5
|
const DEFAULT_RUNTIME = "node22";
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { a as getChatConfig } from "../config-CEuC6CFj.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-3IasVOqK.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-BATk1X_v.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-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { C as withSpan, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, p as normalizeGenAiFinishReason, u as logException } from "./logging-gR24QCo_.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-aHn1OwXL.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 { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-
|
|
3
|
-
import { f as logWarn } from "./logging-
|
|
2
|
+
import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-BrThxuRI.js";
|
|
3
|
+
import { f as logWarn } from "./logging-gR24QCo_.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
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { N as getMcpProviderErrorAttributes, X 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-
|
|
2
|
-
import { m as escapeXml } from "./client-
|
|
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-
|
|
4
|
-
import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig, o as getRuntimeMetadata } from "./config-
|
|
1
|
+
import { N as getMcpProviderErrorAttributes, X 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-CY49A4pN.js";
|
|
2
|
+
import { m as escapeXml } from "./client-BrThxuRI.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-gR24QCo_.js";
|
|
4
|
+
import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig, o as getRuntimeMetadata } from "./config-CEuC6CFj.js";
|
|
5
5
|
import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
|
|
6
6
|
import { _ as parseSlackMessageTs, g as parseSlackUserId, l as isUserActor, s as createSlackResumeActor } from "./context-Bplcgypl.js";
|
|
7
|
-
import { G as isDmChannel, H as getHeaderString, K as normalizeSlackConversationId, Kt as getSqlExecutor, Nt as buildSentryConversationUrl, U as getSlackClient, Wt as getConversationStore, cn as upsertLinkedIdentity, dn as requireSlackDestination, mt as getDashboardConversationLink, o as getPluginSlackConversationLink, sn as upsertIdentity, z as SlackActionError } from "./agent-hooks-
|
|
7
|
+
import { G as isDmChannel, H as getHeaderString, K as normalizeSlackConversationId, Kt as getSqlExecutor, Nt as buildSentryConversationUrl, U as getSlackClient, Wt as getConversationStore, cn as upsertLinkedIdentity, dn as requireSlackDestination, mt as getDashboardConversationLink, o as getPluginSlackConversationLink, sn as upsertIdentity, z as SlackActionError } from "./agent-hooks-BnZBgDPe.js";
|
|
8
8
|
import { i as homeDir } from "./package-discovery-7a9YqLhE.js";
|
|
9
|
-
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-
|
|
10
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
11
|
-
import { t as discoverSkills } from "./skills-
|
|
12
|
-
import { B as recordAuthenticationLinked, F as loadProjection, V as recordAuthorizationCompleted, Y as hydrateConversationMessages, ct as recordDeliveredAssistantMessage, d as persistWithRetry, i as abandonTurnRecord, j as commitAcceptedReply, lt as turnHasReply, m as buildTurnErrorResponse, n as loadTurnCheckpoint, o as failTurnRecord, ot as markConversationMessage, r as saveTurnCheckpoint, s as getTurnRecord, tt as buildConversationContext, u as recordTurnSummary } from "./checkpoint-
|
|
13
|
-
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-
|
|
14
|
-
import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats
|
|
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-
|
|
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-
|
|
9
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-BATk1X_v.js";
|
|
10
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-0oMD2jas.js";
|
|
11
|
+
import { t as discoverSkills } from "./skills-DMQkR1Yu.js";
|
|
12
|
+
import { B as recordAuthenticationLinked, F as loadProjection, V as recordAuthorizationCompleted, Y as hydrateConversationMessages, ct as recordDeliveredAssistantMessage, d as persistWithRetry, i as abandonTurnRecord, j as commitAcceptedReply, lt as turnHasReply, m as buildTurnErrorResponse, n as loadTurnCheckpoint, o as failTurnRecord, ot as markConversationMessage, r as saveTurnCheckpoint, s as getTurnRecord, tt as buildConversationContext, u as recordTurnSummary } from "./checkpoint-Bl47qAIY.js";
|
|
13
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-VmUpQuOm.js";
|
|
14
|
+
import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats-8Bzht8zO.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-Cl4BsopG.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-BC8iSAfE.js";
|
|
17
17
|
import { t as getVercelConversationWorkQueue } from "./vercel-queue-DIkVcfK4.js";
|
|
18
|
-
import { a as getTurnRequestDeadline } from "./job-queue-
|
|
19
|
-
import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-
|
|
20
|
-
import { n as getTurnLifecycle } from "./turn-lifecycle-
|
|
21
|
-
import { n as executeTurn, t as AgentRunError } from "./turn-execution-
|
|
22
|
-
import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-
|
|
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-
|
|
18
|
+
import { a as getTurnRequestDeadline } from "./job-queue-36liupTq.js";
|
|
19
|
+
import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-dQwOhCYs.js";
|
|
20
|
+
import { n as getTurnLifecycle } from "./turn-lifecycle-D75pWL8e.js";
|
|
21
|
+
import { n as executeTurn, t as AgentRunError } from "./turn-execution-BfLZfabf.js";
|
|
22
|
+
import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-D0Ktlch_.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-CJwPs1cT.js";
|
|
24
24
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
|
|
25
|
-
import { n as deleteWebAuthorization } from "./web-authorization-
|
|
25
|
+
import { n as deleteWebAuthorization } from "./web-authorization-IHMPbDay.js";
|
|
26
26
|
import path from "node:path";
|
|
27
27
|
import { z } from "zod";
|
|
28
28
|
import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
|
|
@@ -1152,7 +1152,7 @@ async function resumeSlackTurnInContext(args) {
|
|
|
1152
1152
|
})) } : void 0
|
|
1153
1153
|
}));
|
|
1154
1154
|
} catch (error) {
|
|
1155
|
-
logException(
|
|
1155
|
+
logException(error, "slack.resume.assistant_message_post_delivery_persist.failed");
|
|
1156
1156
|
}
|
|
1157
1157
|
const dispatchId = savedRun.dispatch?.id;
|
|
1158
1158
|
if (messageTs && dispatchId) try {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { f as logWarn } from "./logging-
|
|
2
|
-
import { Gt as getDb, nn as agentTurnTotalTokens, tn as agentTurnCostUsd } from "./agent-hooks-
|
|
3
|
-
import { E as juniorConversations, s as juniorAutomationExecutions } from "./executor-
|
|
1
|
+
import { f as logWarn } from "./logging-gR24QCo_.js";
|
|
2
|
+
import { Gt as getDb, nn as agentTurnTotalTokens, tn as agentTurnCostUsd } from "./agent-hooks-BnZBgDPe.js";
|
|
3
|
+
import { E as juniorConversations, s as juniorAutomationExecutions } from "./executor-3IasVOqK.js";
|
|
4
4
|
import { and, asc, count, desc, eq, gte, inArray, lte, max, or, sql } from "drizzle-orm";
|
|
5
5
|
//#region src/api/conversations/aggregate.ts
|
|
6
6
|
function usageTokenValue(source, field) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as startSpanManual } from "./sentry-CgWZM_kV.js";
|
|
2
|
-
import "./config-
|
|
2
|
+
import "./config-CEuC6CFj.js";
|
|
3
3
|
import { n as juniorDestinations, r as timestamptz } from "./destinations-BeBiJeEM.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { getTableColumns, sql } from "drizzle-orm";
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as getDeploymentServiceVersion, N as getDeploymentTelemetryAttributes } from "./logging-
|
|
1
|
+
import { M as getDeploymentServiceVersion, N as getDeploymentTelemetryAttributes } from "./logging-gR24QCo_.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-aHn1OwXL.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([
|
|
@@ -151,10 +151,12 @@ function initSentry() {
|
|
|
151
151
|
beforeSendLog: scrubPrivateSentryLog,
|
|
152
152
|
beforeSendSpan: withStreamedSpan(scrubPrivateSentrySpan),
|
|
153
153
|
beforeSendTransaction: scrubPrivateSentryTransaction,
|
|
154
|
-
integrations
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
integrations(defaultIntegrations) {
|
|
155
|
+
return [...defaultIntegrations, vercelAIIntegration({
|
|
156
|
+
recordInputs: true,
|
|
157
|
+
recordOutputs: true
|
|
158
|
+
})];
|
|
159
|
+
}
|
|
158
160
|
});
|
|
159
161
|
getGlobalScope().setAttributes(deploymentSpanAttributes);
|
|
160
162
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getChatConfig } from "./config-
|
|
1
|
+
import { a as getChatConfig } from "./config-CEuC6CFj.js";
|
|
2
2
|
import { a as signQueueMessage, i as QUEUE_SIGNATURE_MAX_AGE_MS, o as verifyQueueMessage, s as createVercelQueueClient } from "./vercel-queue-DIkVcfK4.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -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-DErORHQC.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.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_RETENTION_CRON_SCHEDULE, T as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_RETENTION_ROUTE, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "./logging-
|
|
1
|
+
import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_RETENTION_CRON_SCHEDULE, T as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_RETENTION_ROUTE, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "./logging-gR24QCo_.js";
|
|
2
2
|
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-7a9YqLhE.js";
|
|
3
3
|
import { n as resolveConversationWorkQueueTopic } from "./vercel-queue-DIkVcfK4.js";
|
|
4
|
-
import { t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
4
|
+
import { t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-36liupTq.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-egKWjgue.js";
|
|
6
|
-
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-
|
|
6
|
+
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-Cm4FhC0n.js";
|
|
7
7
|
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-BKGOXca2.js";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { X as createUserTokenStore } from "./agent-
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { X as createUserTokenStore } from "./agent-CY49A4pN.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-Dht95TJQ.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 { g as extractAssistantText, i as abandonTurnRecord } from "./checkpoint-
|
|
2
|
-
import { qt as buildDeterministicTurnId } from "./stats
|
|
1
|
+
import { g as extractAssistantText, i as abandonTurnRecord } from "./checkpoint-Bl47qAIY.js";
|
|
2
|
+
import { qt as buildDeterministicTurnId } from "./stats-8Bzht8zO.js";
|
|
3
3
|
//#region src/chat/runtime/turn.ts
|
|
4
4
|
/** Classified Slack turn failure carrying the owning Sentry capture outward. */
|
|
5
5
|
var ConversationTurnBoundaryError = class extends Error {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { w as toOptionalTrimmed } from "./client-
|
|
2
|
-
import { _ as setSpanAttributes, v as setSpanStatus } from "./logging-
|
|
3
|
-
import { a as getChatConfig } from "./config-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
1
|
+
import { w as toOptionalTrimmed } from "./client-BrThxuRI.js";
|
|
2
|
+
import { _ as setSpanAttributes, v as setSpanStatus } from "./logging-gR24QCo_.js";
|
|
3
|
+
import { a as getChatConfig } from "./config-CEuC6CFj.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-0oMD2jas.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 { _ as setSpanAttributes, d as logInfo, f as logWarn } from "./logging-
|
|
1
|
+
import { _ as setSpanAttributes, d as logInfo, f as logWarn } from "./logging-gR24QCo_.js";
|
|
2
2
|
import { i as credentialUserSubjectId } from "./context-Bplcgypl.js";
|
|
3
3
|
import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-7a9YqLhE.js";
|
|
4
4
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as withSpan, _ as setSpanAttributes } from "./logging-
|
|
2
|
-
import { A as sleep, P as SANDBOX_WORKSPACE_ROOT, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-
|
|
1
|
+
import { C as withSpan, _ as setSpanAttributes } from "./logging-gR24QCo_.js";
|
|
2
|
+
import { A as sleep, P as SANDBOX_WORKSPACE_ROOT, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-VmUpQuOm.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 { p as authorizationId } from "./agent-
|
|
2
|
-
import { S as withLogContext, u as logException, y as setTags } from "./logging-
|
|
1
|
+
import { p as authorizationId } from "./agent-CY49A4pN.js";
|
|
2
|
+
import { S as withLogContext, u as logException, y as setTags } from "./logging-gR24QCo_.js";
|
|
3
3
|
import { t as credentialContextForActor } from "./context-Bplcgypl.js";
|
|
4
|
-
import { Ht as getConversationEventStore, Wt as getConversationStore } from "./agent-hooks-
|
|
5
|
-
import { F as loadProjection, V as recordAuthorizationCompleted, X as persistConversationMessages, Y as hydrateConversationMessages, ct as recordDeliveredAssistantMessage, d as persistWithRetry, j as commitAcceptedReply, ot as markConversationMessage, r as saveTurnCheckpoint, st as normalizeConversationText, tt as buildConversationContext, ut as upsertConversationMessage } from "./checkpoint-
|
|
6
|
-
import { S as startActiveTurn, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-
|
|
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 buildDeliveredTurnStatePatch, r as finalizeFailedTurnReplyWithEvent, t as completeAuthPauseTurn } from "./auth-pause-state-
|
|
4
|
+
import { Ht as getConversationEventStore, Wt as getConversationStore } from "./agent-hooks-BnZBgDPe.js";
|
|
5
|
+
import { F as loadProjection, V as recordAuthorizationCompleted, X as persistConversationMessages, Y as hydrateConversationMessages, ct as recordDeliveredAssistantMessage, d as persistWithRetry, j as commitAcceptedReply, ot as markConversationMessage, r as saveTurnCheckpoint, st as normalizeConversationText, tt as buildConversationContext, ut as upsertConversationMessage } from "./checkpoint-Bl47qAIY.js";
|
|
6
|
+
import { S as startActiveTurn, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-Cl4BsopG.js";
|
|
7
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-dQwOhCYs.js";
|
|
8
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-D75pWL8e.js";
|
|
9
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-D0Ktlch_.js";
|
|
10
|
+
import { d as buildDeliveredTurnStatePatch, r as finalizeFailedTurnReplyWithEvent, t as completeAuthPauseTurn } from "./auth-pause-state-CJwPs1cT.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
|
|
@@ -151,7 +151,7 @@ async function runLocalAgentTurnInContext(input, deps) {
|
|
|
151
151
|
conversationId: input.conversationId
|
|
152
152
|
}));
|
|
153
153
|
} catch (error) {
|
|
154
|
-
logException(
|
|
154
|
+
logException(error, "local.assistant.message_post_delivery_persist.failed");
|
|
155
155
|
}
|
|
156
156
|
failureCode = "agent_run_failed";
|
|
157
157
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Y as sandboxEgressSignalsResponseSchema } from "./agent-
|
|
1
|
+
import { Y as sandboxEgressSignalsResponseSchema } from "./agent-CY49A4pN.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 { f as logWarn } from "./logging-
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
1
|
+
import { f as logWarn } from "./logging-gR24QCo_.js";
|
|
2
|
+
import { n as botConfig } from "./config-CEuC6CFj.js";
|
|
3
3
|
const TITLE_PROMPTS = {
|
|
4
4
|
conversation: [
|
|
5
5
|
"Generate a concise 5-8 word conversation title from the first user message below.",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { f as logWarn } from "./logging-
|
|
2
|
+
import { f as logWarn } from "./logging-gR24QCo_.js";
|
|
3
3
|
import { s as skillRoots } from "./package-discovery-7a9YqLhE.js";
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-0oMD2jas.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 { C as toolInvocationDestination, y as actorFromRun } from "./agent-runner-
|
|
3
|
-
import { n as createAndEnqueueAgentInvocation } from "./work-
|
|
2
|
+
import { C as toolInvocationDestination, y as actorFromRun } from "./agent-runner-BC8iSAfE.js";
|
|
3
|
+
import { n as createAndEnqueueAgentInvocation } from "./work-CaaSjlNk.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 { F as isRecord$1, I as toOptionalNumber, L as toOptionalString } from "./logging-
|
|
2
|
-
import { a as getChatConfig } from "./config-
|
|
1
|
+
import { F as isRecord$1, I as toOptionalNumber, L as toOptionalString } from "./logging-gR24QCo_.js";
|
|
2
|
+
import { a as getChatConfig } from "./config-CEuC6CFj.js";
|
|
3
3
|
import { _ as parseSlackMessageTs, d as parseStoredSlackActor, h as parseSlackTeamId, p as parseSlackChannelId } from "./context-Bplcgypl.js";
|
|
4
|
-
import { Gt as getDb, J as withSlackRetries, U as getSlackClient, Wt as getConversationStore, fn as sameDestination, pt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, un as parseDestination } from "./agent-hooks-
|
|
4
|
+
import { Gt as getDb, J as withSlackRetries, U as getSlackClient, Wt as getConversationStore, fn as sameDestination, pt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, un as parseDestination } from "./agent-hooks-BnZBgDPe.js";
|
|
5
5
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
6
|
-
import { E as juniorConversations, a as juniorSchedulerRuns, c as juniorStats, l as juniorEventAutomations, o as juniorSchedulerTasks, w as juniorAttachments } from "./executor-
|
|
7
|
-
import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-
|
|
6
|
+
import { E as juniorConversations, a as juniorSchedulerRuns, c as juniorStats, l as juniorEventAutomations, o as juniorSchedulerTasks, w as juniorAttachments } from "./executor-3IasVOqK.js";
|
|
7
|
+
import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-VmUpQuOm.js";
|
|
8
8
|
import "./vercel-queue-DIkVcfK4.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -2060,6 +2060,12 @@ const scheduledAutomationExecutionActorSchema = z.object({
|
|
|
2060
2060
|
platform: z.literal("system"),
|
|
2061
2061
|
name: z.string()
|
|
2062
2062
|
}).strict();
|
|
2063
|
+
/** Scheduled automations target a Slack conversation, never one message thread. */
|
|
2064
|
+
const scheduledAutomationDestinationSchema = slackDestinationSchema.omit({ threadTs: true });
|
|
2065
|
+
const scheduledAutomationOutcomeSchema = z.object({
|
|
2066
|
+
action: z.literal("send_message"),
|
|
2067
|
+
destination: scheduledAutomationDestinationSchema
|
|
2068
|
+
}).strict();
|
|
2063
2069
|
/** Validate the current scheduled-automation domain shape. */
|
|
2064
2070
|
const scheduledAutomationSchema = z.object({
|
|
2065
2071
|
id: z.string(),
|
|
@@ -2077,7 +2083,7 @@ const scheduledAutomationSchema = z.object({
|
|
|
2077
2083
|
creatorIdentityId: z.string(),
|
|
2078
2084
|
/** Selects system credentials or task-bound creator credential delegation. */
|
|
2079
2085
|
credentialMode: scheduledAutomationCredentialModeSchema,
|
|
2080
|
-
destination:
|
|
2086
|
+
destination: scheduledAutomationDestinationSchema,
|
|
2081
2087
|
executionActor: scheduledAutomationExecutionActorSchema.optional(),
|
|
2082
2088
|
lastRunAtMs: z.number().optional(),
|
|
2083
2089
|
nextRunAtMs: z.number().optional(),
|
|
@@ -2087,7 +2093,7 @@ const scheduledAutomationSchema = z.object({
|
|
|
2087
2093
|
status: scheduledAutomationStatusSchema,
|
|
2088
2094
|
statusReason: z.string().optional(),
|
|
2089
2095
|
/** Explicit visible effects after successful work. An empty list is silent. */
|
|
2090
|
-
outcomes: z.array(
|
|
2096
|
+
outcomes: z.array(scheduledAutomationOutcomeSchema).max(5),
|
|
2091
2097
|
task: z.object({ text: z.string() }).strict(),
|
|
2092
2098
|
/** SQL-backed short display title generated from the task instruction. */
|
|
2093
2099
|
title: z.string().optional(),
|
|
@@ -2118,6 +2124,8 @@ const retainedScheduledAutomationSchema = scheduledAutomationSchema.omit({
|
|
|
2118
2124
|
creatorIdentityId: true,
|
|
2119
2125
|
title: true
|
|
2120
2126
|
}).extend({
|
|
2127
|
+
destination: slackDestinationSchema,
|
|
2128
|
+
outcomes: z.array(taskOutcomeSchema).max(5),
|
|
2121
2129
|
status: z.enum([
|
|
2122
2130
|
"active",
|
|
2123
2131
|
"blocked",
|
|
@@ -2141,7 +2149,24 @@ function parseScheduledAutomationRow(row) {
|
|
|
2141
2149
|
} : retained;
|
|
2142
2150
|
const parsed = retainedScheduledAutomationSchema.safeParse(current);
|
|
2143
2151
|
if (!parsed.success) return void 0;
|
|
2144
|
-
const { status, version: _version, ...
|
|
2152
|
+
const { status, version: _version, ...retainedTask } = parsed.data;
|
|
2153
|
+
const destination = {
|
|
2154
|
+
platform: "slack",
|
|
2155
|
+
teamId: retainedTask.destination.teamId,
|
|
2156
|
+
channelId: retainedTask.destination.channelId
|
|
2157
|
+
};
|
|
2158
|
+
const task = {
|
|
2159
|
+
...retainedTask,
|
|
2160
|
+
destination,
|
|
2161
|
+
outcomes: retainedTask.outcomes.map((outcome) => ({
|
|
2162
|
+
...outcome,
|
|
2163
|
+
destination: {
|
|
2164
|
+
platform: "slack",
|
|
2165
|
+
teamId: outcome.destination.teamId,
|
|
2166
|
+
channelId: outcome.destination.channelId
|
|
2167
|
+
}
|
|
2168
|
+
}))
|
|
2169
|
+
};
|
|
2145
2170
|
const fallbackIdentity = row.creatorIdentityId === null ? z.string().safeParse(legacyCreatorIdentityId) : void 0;
|
|
2146
2171
|
const creatorIdentityId = row.creatorIdentityId ?? (fallbackIdentity?.success ? fallbackIdentity.data : void 0);
|
|
2147
2172
|
if (creatorIdentityId === void 0) return void 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { f as logWarn } from "./logging-
|
|
1
|
+
import { f as logWarn } from "./logging-gR24QCo_.js";
|
|
2
2
|
import { a as signQueueMessage, i as QUEUE_SIGNATURE_MAX_AGE_MS, o as verifyQueueMessage, s as createVercelQueueClient } from "./vercel-queue-DIkVcfK4.js";
|
|
3
|
-
import { o as runWithTurnRequestDeadline } from "./job-queue-
|
|
3
|
+
import { o as runWithTurnRequestDeadline } from "./job-queue-36liupTq.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { handleCallback, registerDevConsumer } from "@vercel/queue";
|
|
@@ -110,7 +110,7 @@ function pluginTaskCallback() {
|
|
|
110
110
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
111
111
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
112
112
|
run: async (message) => {
|
|
113
|
-
const { processPluginTask } = await import("./task-runner-
|
|
113
|
+
const { processPluginTask } = await import("./task-runner-dQwOhCYs.js").then((n) => n.r);
|
|
114
114
|
await processPluginTask(message);
|
|
115
115
|
},
|
|
116
116
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
2
|
import { _ as parseSlackMessageTs, r as credentialSubjectSchema } from "./context-Bplcgypl.js";
|
|
3
|
-
import { At as createPluginConversationEvents, Gt as getDb, Q as readActorIdentity, Wt as getConversationStore, _t as createPluginState, bt as createPluginLogger, p as coreTaskRegistrations, pt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, vt as createPluginEmbedder, yt as createPluginModel } from "./agent-hooks-
|
|
3
|
+
import { At as createPluginConversationEvents, Gt as getDb, Q as readActorIdentity, Wt as getConversationStore, _t as createPluginState, bt as createPluginLogger, p as coreTaskRegistrations, pt as JUNIOR_THREAD_STATE_TTL_MS, u as getPlugins, vt as createPluginEmbedder, yt as createPluginModel } from "./agent-hooks-BnZBgDPe.js";
|
|
4
4
|
import { G as sameActorIdentity } from "./conversation-BSRGzJmY.js";
|
|
5
|
-
import { E as normalizeToolNameFromResult, O as stripRuntimeTurnContext, T as isToolResultMessage, Y as hydrateConversationMessages, _ as getPiMessageRole, s as getTurnRecord, w as isToolResultError, x as instructionTextForProjection } from "./checkpoint-
|
|
6
|
-
import { w as getStateAdapter } from "./profile-
|
|
7
|
-
import { u as recordAutomationExecution } from "./execution-stats-
|
|
8
|
-
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
9
|
-
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-
|
|
5
|
+
import { E as normalizeToolNameFromResult, O as stripRuntimeTurnContext, T as isToolResultMessage, Y as hydrateConversationMessages, _ as getPiMessageRole, s as getTurnRecord, w as isToolResultError, x as instructionTextForProjection } from "./checkpoint-Bl47qAIY.js";
|
|
6
|
+
import { w as getStateAdapter } from "./profile-VmUpQuOm.js";
|
|
7
|
+
import { u as recordAutomationExecution } from "./execution-stats-D9m2kmmg.js";
|
|
8
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-D0Ktlch_.js";
|
|
9
|
+
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-Cm4FhC0n.js";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
12
12
|
import { destinationSchema, destinationVisibilitySchema, isSlackDestination, pluginRunContextSchema, replyAttributionSchema, sourceSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
@@ -345,7 +345,7 @@ function slackSourceForDestination(args) {
|
|
|
345
345
|
* Reads parent Conversations when this Conversation has no Destination.
|
|
346
346
|
*/
|
|
347
347
|
async function resolveConversationRouting(args) {
|
|
348
|
-
const conversationStore = args.conversationStore ?? (await import("./agent-hooks-
|
|
348
|
+
const conversationStore = args.conversationStore ?? (await import("./agent-hooks-BnZBgDPe.js").then((n) => n.Vt)).getConversationStore();
|
|
349
349
|
const chain = await loadConversationChain(args.conversationId, conversationStore);
|
|
350
350
|
let destination;
|
|
351
351
|
let source;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { F as isRecord, I as toOptionalNumber, L as toOptionalString } from "./logging-
|
|
2
|
-
import { Gt as getDb, pt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-
|
|
1
|
+
import { F as isRecord, I as toOptionalNumber, L as toOptionalString } from "./logging-gR24QCo_.js";
|
|
2
|
+
import { Gt as getDb, pt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-BnZBgDPe.js";
|
|
3
3
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
4
|
-
import { u as juniorLocationConfigurations } from "./executor-
|
|
5
|
-
import { X as persistConversationMessages } from "./checkpoint-
|
|
6
|
-
import { w as getStateAdapter } from "./profile-
|
|
4
|
+
import { u as juniorLocationConfigurations } from "./executor-3IasVOqK.js";
|
|
5
|
+
import { X as persistConversationMessages } from "./checkpoint-Bl47qAIY.js";
|
|
6
|
+
import { w as getStateAdapter } from "./profile-VmUpQuOm.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
import { and, eq, sql } from "drizzle-orm";
|