@sentry/junior 0.234.0 → 0.235.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/{agent-hooks-BcH6E48y.js → agent-hooks-DS7k0ZWY.js} +17 -10
- package/dist/{agent-runner-DUkGlK89.js → agent-runner-BlDI1zV2.js} +150 -64
- package/dist/api/schema.d.ts +66 -1
- package/dist/api/schema.js +3 -3
- package/dist/api.js +138 -54
- package/dist/{app-xk2-Id1T.d.ts → app-pGsR__aT.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +23 -21
- package/dist/{briefs-lyAQbDxJ.js → briefs-C3jhszOz.js} +4 -4
- package/dist/{catalog-runtime-BSgsPVnr.js → catalog-runtime-B9u_3-GW.js} +1 -1
- package/dist/{checkpoint-BNfXlq_1.js → checkpoint-DLcJ5mKL.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-BX5lJRqW.js → client-BSnNHO0R.js} +2 -2
- package/dist/{config-DuCzUoCo.js → config-Bmw4xTPK.js} +2 -2
- package/dist/{conversation-CPjHYOV5.js → conversation-C_aYrISI.js} +1 -0
- package/dist/{conversation-privacy-CSxvdSoV.js → conversation-privacy-BV2dtba2.js} +1 -1
- package/dist/{credential-sync-BO4DfH9a.js → credential-sync-CukzQJ1x.js} +13 -13
- package/dist/{executor--jWf-Nnm.js → executor-B9ksWZCv.js} +33 -1
- package/dist/{images-BaL19wFC.js → images-CEXcQ0Id.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-cwHVOwVZ.js → job-queue-CY1L2YRn.js} +1 -1
- package/dist/{logging-Cox1Mgcv.js → logging-F--48Q7Q.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-CC8a1JKP.js → oauth-authorization-LasSG3Qc.js} +1 -1
- package/dist/{oauth-callback-server-Z7QSt416.js → oauth-callback-server-D07ZzVMs.js} +2 -2
- package/dist/{pending-auth-DQhC3eSR.js → pending-auth-DrG9Mkje.js} +1 -1
- package/dist/{profile-BdApelHS.js → profile-DZ2DUdd1.js} +4 -4
- package/dist/{prompt-3D0sSbTC.js → prompt-BM_5mAU3.js} +1 -1
- package/dist/{registry-DiY6B8CN.js → registry-_JLY0x7b.js} +1 -1
- package/dist/{resolve-VpJoiDpc.js → resolve-Cuoj3MML.js} +2 -2
- package/dist/{runner-BIMegnPE.js → runner-BfelmbMv.js} +9 -9
- package/dist/{sandbox-egress-signals-Cbtxe492.js → sandbox-egress-signals-D5QUIO7Z.js} +1 -1
- package/dist/{schema-CxwnlTDN.js → schema-CrdDxGbx.js} +24 -2
- package/dist/{skills-WttpPJUy.js → skills-DAegjk5Y.js} +2 -2
- package/dist/{spawn-DhfMKt4y.js → spawn-DCfV7zGK.js} +2 -2
- package/dist/{task-queue-CZqUNJD0.js → task-queue-GcuFtzor.js} +3 -3
- package/dist/{task-runner-BZaqoUCT.js → task-runner-B0-P_3aq.js} +9 -9
- package/dist/{thread-state-8tXZhu0y.js → thread-state-TezcEhuH.js} +5 -5
- package/dist/{turn-failure-response-DFJ9L9NQ.js → turn-failure-response-Drhj_-t4.js} +8 -8
- package/dist/{turn-lifecycle-WbpTUQ_r.js → turn-lifecycle-BpIW3zOx.js} +1 -1
- package/dist/{turn-session-routing--EhI76rH.js → turn-session-routing-Dg8GDgyc.js} +1 -1
- package/dist/{validation-0F9IgG3b.js → validation-DAkYeKDT.js} +1 -1
- package/dist/{version-A7-RRBOE.js → version-9CB4Z-J4.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-BJggXofy.js → web-authorization-Cu33voNg.js} +6 -6
- package/dist/{web-input-B-siN5Dr.js → web-input-B3k0J7WB.js} +22 -22
- package/dist/{work-CNc0ejGG.js → work-PmkvcY9l.js} +7 -7
- package/dist/{worker-BHbqpUAu.js → worker-COcaq2J6.js} +5 -5
- package/package.json +5 -5
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-Bmw4xTPK.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-B9ksWZCv.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-_JLY0x7b.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 { 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-F--48Q7Q.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-BV2dtba2.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-BSnNHO0R.js";
|
|
3
|
+
import { p as logWarn } from "./logging-F--48Q7Q.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]))?$/;
|
|
@@ -786,6 +786,7 @@ const conversationEventsQuerySchema = z.object({
|
|
|
786
786
|
}).strict();
|
|
787
787
|
const conversationFeedQuerySchema = z.object({
|
|
788
788
|
actorEmail: z.string().trim().email().transform((value) => value.toLowerCase()).optional(),
|
|
789
|
+
codeRepositoryId: z.string().uuid().optional(),
|
|
789
790
|
q: z.string().trim().max(200).optional(),
|
|
790
791
|
status: z.enum(["active", "archived"]).default("active")
|
|
791
792
|
}).strict();
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Cn as postSlackMessage, Dn as createUserTokenStore, T as lookupSlackUserProfile, _ as
|
|
2
|
-
import { f as escapeXml } from "./client-
|
|
3
|
-
import { d as logException, h as runBestEffort, p as logWarn } from "./logging-
|
|
4
|
-
import { n as botConfig, o as getRuntimeMetadata } from "./config-
|
|
1
|
+
import { Cn as postSlackMessage, Dn as createUserTokenStore, T as lookupSlackUserProfile, _ as resolvePluginOAuthAccount, d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, hn as resolveBaseUrl, ht as getMcpProviderErrorAttributes, mn as parseOAuthStatePayload, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, pn as formatProviderLabel, s as deleteMcpAuthSession } from "./agent-runner-BlDI1zV2.js";
|
|
2
|
+
import { f as escapeXml } from "./client-BSnNHO0R.js";
|
|
3
|
+
import { d as logException, h as runBestEffort, p as logWarn } from "./logging-F--48Q7Q.js";
|
|
4
|
+
import { n as botConfig, o as getRuntimeMetadata } from "./config-Bmw4xTPK.js";
|
|
5
5
|
import { g as parseSlackUserId } from "./context-0Et9iVSB.js";
|
|
6
|
-
import {
|
|
6
|
+
import { W as getSlackClient, _n as upsertLinkedIdentity, gn as upsertIdentity, nn as getSqlExecutor } from "./agent-hooks-DS7k0ZWY.js";
|
|
7
7
|
import { i as homeDir } from "./package-discovery-7a9YqLhE.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 { B as recordAuthorizationCompleted, s as getTurnRecord, z as recordAuthenticationLinked } from "./checkpoint-
|
|
12
|
-
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-
|
|
13
|
-
import { i as getConversationPendingAuth } from "./pending-auth-
|
|
14
|
-
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
15
|
-
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-_JLY0x7b.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-B9u_3-GW.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-DAegjk5Y.js";
|
|
11
|
+
import { B as recordAuthorizationCompleted, s as getTurnRecord, z as recordAuthenticationLinked } from "./checkpoint-DLcJ5mKL.js";
|
|
12
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-DZ2DUdd1.js";
|
|
13
|
+
import { i as getConversationPendingAuth } from "./pending-auth-DrG9Mkje.js";
|
|
14
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-TezcEhuH.js";
|
|
15
|
+
import { n as deleteWebAuthorization, o as wakeAuthorizedTurn, s as wakePausedTurn } from "./web-authorization-Cu33voNg.js";
|
|
16
16
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
|
|
17
17
|
import path from "node:path";
|
|
18
18
|
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as startSpanManual } from "./sentry-CgWZM_kV.js";
|
|
2
|
-
import "./config-
|
|
2
|
+
import "./config-Bmw4xTPK.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";
|
|
@@ -850,6 +850,7 @@ var NeonExecutor = class {
|
|
|
850
850
|
connectionString;
|
|
851
851
|
transactionClient = new AsyncLocalStorage();
|
|
852
852
|
savepointId = 0;
|
|
853
|
+
isolatedQueryId = 0;
|
|
853
854
|
constructor(pool, connectionString) {
|
|
854
855
|
this.pool = pool;
|
|
855
856
|
this.connectionString = connectionString;
|
|
@@ -863,6 +864,21 @@ var NeonExecutor = class {
|
|
|
863
864
|
async query(statement, params = []) {
|
|
864
865
|
return (await this.queryClient().query(statement, [...params])).rows;
|
|
865
866
|
}
|
|
867
|
+
async queryIsolated(statement, params = []) {
|
|
868
|
+
const client = traceQueries(await this.pool.connect(), {
|
|
869
|
+
connectionString: this.connectionString,
|
|
870
|
+
driver: "neon"
|
|
871
|
+
});
|
|
872
|
+
try {
|
|
873
|
+
return (await client.query({
|
|
874
|
+
name: `junior_isolated_${++this.isolatedQueryId}`,
|
|
875
|
+
text: statement,
|
|
876
|
+
values: [...params]
|
|
877
|
+
})).rows;
|
|
878
|
+
} finally {
|
|
879
|
+
client.release(true);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
866
882
|
async migrate(config) {
|
|
867
883
|
await migrate(drizzle(this.queryClient(), { schema: juniorSqlSchema }), config);
|
|
868
884
|
}
|
|
@@ -955,6 +971,7 @@ var PostgresExecutor = class {
|
|
|
955
971
|
connectionString;
|
|
956
972
|
transactionClient = new AsyncLocalStorage();
|
|
957
973
|
savepointId = 0;
|
|
974
|
+
isolatedQueryId = 0;
|
|
958
975
|
constructor(pool, connectionString) {
|
|
959
976
|
this.pool = pool;
|
|
960
977
|
this.connectionString = connectionString;
|
|
@@ -968,6 +985,21 @@ var PostgresExecutor = class {
|
|
|
968
985
|
async query(statement, params = []) {
|
|
969
986
|
return (await this.queryClient().query(statement, [...params])).rows;
|
|
970
987
|
}
|
|
988
|
+
async queryIsolated(statement, params = []) {
|
|
989
|
+
const client = traceQueries(await this.pool.connect(), {
|
|
990
|
+
connectionString: this.connectionString,
|
|
991
|
+
driver: "postgres"
|
|
992
|
+
});
|
|
993
|
+
try {
|
|
994
|
+
return (await client.query({
|
|
995
|
+
name: `junior_isolated_${++this.isolatedQueryId}`,
|
|
996
|
+
text: statement,
|
|
997
|
+
values: [...params]
|
|
998
|
+
})).rows;
|
|
999
|
+
} finally {
|
|
1000
|
+
client.release(true);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
971
1003
|
async migrate(config) {
|
|
972
1004
|
await migrate$1(drizzle$1(this.queryClient(), { schema: juniorSqlSchema }), config);
|
|
973
1005
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { j as storeAttachment, k as readLiveAttachment } from "./agent-runner-
|
|
3
|
-
import {
|
|
4
|
-
import "./conversation-
|
|
2
|
+
import { j as storeAttachment, k as readLiveAttachment } from "./agent-runner-BlDI1zV2.js";
|
|
3
|
+
import { nn as getSqlExecutor } from "./agent-hooks-DS7k0ZWY.js";
|
|
4
|
+
import "./conversation-C_aYrISI.js";
|
|
5
5
|
//#region src/chat/attachments/images.ts
|
|
6
6
|
var images_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
decodeInputImages: () => decodeInputImages,
|
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-F--48Q7Q.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-BV2dtba2.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 { a as getChatConfig } from "./config-
|
|
1
|
+
import { a as getChatConfig } from "./config-Bmw4xTPK.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-9CB4Z-J4.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 { n as JuniorDashboardOptions } from "./app-
|
|
1
|
+
import { n as JuniorDashboardOptions } from "./app-pGsR__aT.js";
|
|
2
2
|
import { n as JuniorPluginSet } from "./plugins-BT2l4We3.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-F--48Q7Q.js";
|
|
2
2
|
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-7a9YqLhE.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-CY1L2YRn.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-GcuFtzor.js";
|
|
6
6
|
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-BKGOXca2.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 { h as extractAssistantText } from "./checkpoint-
|
|
1
|
+
import { h as extractAssistantText } from "./checkpoint-DLcJ5mKL.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 { Dn as createUserTokenStore } from "./agent-runner-
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { Dn as createUserTokenStore } from "./agent-runner-BlDI1zV2.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-CukzQJ1x.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,4 +1,4 @@
|
|
|
1
|
-
import { i as abandonTurnRecord } from "./checkpoint-
|
|
1
|
+
import { i as abandonTurnRecord } from "./checkpoint-DLcJ5mKL.js";
|
|
2
2
|
//#region src/chat/state/turn-id.ts
|
|
3
3
|
/** Build a stable turn identifier from a message ID. */
|
|
4
4
|
function buildDeterministicTurnId(messageId) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as toOptionalTrimmed } from "./client-
|
|
2
|
-
import { v as setSpanAttributes, y as setSpanStatus } from "./logging-
|
|
3
|
-
import { a as getChatConfig } from "./config-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
1
|
+
import { S as toOptionalTrimmed } from "./client-BSnNHO0R.js";
|
|
2
|
+
import { v as setSpanAttributes, y as setSpanStatus } from "./logging-F--48Q7Q.js";
|
|
3
|
+
import { a as getChatConfig } from "./config-Bmw4xTPK.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-B9u_3-GW.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 { I as briefOutcomeStatusSchema, L as conversationBriefSchema, R as parseBriefInput } from "./conversation-
|
|
1
|
+
import { I as briefOutcomeStatusSchema, L as conversationBriefSchema, R as parseBriefInput } from "./conversation-C_aYrISI.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/chat/briefs/generate.ts
|
|
4
4
|
const MAX_INPUT_CHARS = 6e4;
|
|
@@ -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-F--48Q7Q.js";
|
|
2
2
|
import { i as credentialUserSubjectId } from "./context-0Et9iVSB.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 { 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-F--48Q7Q.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-DZ2DUdd1.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-
|
|
1
|
+
import { C as withLogContext, b as setTags, d as logException } from "./logging-F--48Q7Q.js";
|
|
2
2
|
import { t as credentialContextForActor } from "./context-0Et9iVSB.js";
|
|
3
|
-
import {
|
|
4
|
-
import { V as messageCardText } from "./conversation-
|
|
5
|
-
import { A as commitAcceptedReply, B as recordAuthorizationCompleted, J as hydrateConversationMessages, P as loadProjection, Y as persistConversationMessages, ct as normalizeConversationText, dt as upsertConversationMessage, lt as recordDeliveredAssistantMessage, nt as buildConversationContext, r as saveTurnCheckpoint, st as markConversationMessage, u as persistWithRetry } from "./checkpoint-
|
|
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-
|
|
3
|
+
import { Qt as getConversationEventStore, en as getConversationStore } from "./agent-hooks-DS7k0ZWY.js";
|
|
4
|
+
import { V as messageCardText } from "./conversation-C_aYrISI.js";
|
|
5
|
+
import { A as commitAcceptedReply, B as recordAuthorizationCompleted, J as hydrateConversationMessages, P as loadProjection, Y as persistConversationMessages, ct as normalizeConversationText, dt as upsertConversationMessage, lt as recordDeliveredAssistantMessage, nt as buildConversationContext, r as saveTurnCheckpoint, st as markConversationMessage, u as persistWithRetry } from "./checkpoint-DLcJ5mKL.js";
|
|
6
|
+
import { _ as markTurnFailed, r as getAssistantReplyText, t as authorizationId, v as startActiveTurn } from "./oauth-authorization-LasSG3Qc.js";
|
|
7
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-B0-P_3aq.js";
|
|
8
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-BpIW3zOx.js";
|
|
9
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-TezcEhuH.js";
|
|
10
|
+
import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-Drhj_-t4.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 { fn as sandboxEgressSignalsResponseSchema } from "./agent-runner-
|
|
1
|
+
import { fn as sandboxEgressSignalsResponseSchema } from "./agent-runner-BlDI1zV2.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
1
|
import { t as juniorDestinationKindSchema } from "./destinations-BeBiJeEM.js";
|
|
2
|
-
import { E as conversationSummaryReportSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-
|
|
2
|
+
import { E as conversationSummaryReportSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-C_aYrISI.js";
|
|
3
3
|
import { a as fillUtcHours, c as sumUtcHoursIntoSixHours, i as fillUtcDays } from "./web-message-id-CVVCTWUb.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { codeChangeStateSchema } from "@sentry/junior-plugin-api";
|
|
@@ -61,6 +61,28 @@ const codeOverviewReportSchema = z.object({
|
|
|
61
61
|
windowEnd: z.string(),
|
|
62
62
|
windowStart: z.string()
|
|
63
63
|
}).strict();
|
|
64
|
+
const codeRepositoryParamsSchema = z.object({ repositoryId: z.string().uuid() }).strict();
|
|
65
|
+
/** Code activity, recent changes, and Workspaces for one repository. */
|
|
66
|
+
const codeRepositoryReportSchema = z.object({
|
|
67
|
+
activityDays: z.array(codeActivityDaySchema),
|
|
68
|
+
activityHours: z.array(codeActivityDaySchema).optional(),
|
|
69
|
+
activitySixHours: z.array(codeActivityDaySchema).optional(),
|
|
70
|
+
changes: z.array(codeChangeSummaryReportSchema),
|
|
71
|
+
generatedAt: z.string(),
|
|
72
|
+
repository: z.object({
|
|
73
|
+
id: z.string().uuid(),
|
|
74
|
+
name: z.string().min(1),
|
|
75
|
+
provider: z.string().min(1),
|
|
76
|
+
url: z.string().url().optional()
|
|
77
|
+
}).strict(),
|
|
78
|
+
summary: codeChangeSummarySchema,
|
|
79
|
+
windowEnd: z.string(),
|
|
80
|
+
windowStart: z.string(),
|
|
81
|
+
workspaces: z.array(z.object({
|
|
82
|
+
id: z.string().min(1),
|
|
83
|
+
name: z.string().min(1)
|
|
84
|
+
}).strict())
|
|
85
|
+
}).strict();
|
|
64
86
|
/** Person-scoped code activity for one People profile. */
|
|
65
87
|
const codePersonReportSchema = z.object({
|
|
66
88
|
activityDays: z.array(codeActivityDaySchema),
|
|
@@ -320,4 +342,4 @@ const statsReportSchema = z.object({
|
|
|
320
342
|
windowStart: z.string()
|
|
321
343
|
}).strict();
|
|
322
344
|
//#endregion
|
|
323
|
-
export { codeChangeSummarySchema as A, locationParamsSchema as C, dailyConversationActivitySchema as D, activitySixHours as E, codePersonReportSchema as M,
|
|
345
|
+
export { codeChangeSummarySchema as A, locationParamsSchema as C, dailyConversationActivitySchema as D, activitySixHours as E, codeRepositorySummarySchema as F, apiErrorSchema as I, codePersonReportSchema as M, codeRepositoryParamsSchema as N, codeActivityDaySchema as O, codeRepositoryReportSchema as P, locationDirectoryReportSchema as S, activityHours as T, actorProfileReportSchema as _, workspaceBodySchema as a, locationActivityDayReportSchema as b, workspaceRepoSchema as c, createdPersonalTokenSchema as d, personalTokenListSchema as f, actorDirectoryReportSchema as g, revokePersonalTokenResponseSchema as h, deleteWorkspaceResponseSchema as i, codeOverviewReportSchema as j, codeChangeSummaryReportSchema as k, workspaceSchema as l, personalTokenParamsSchema as m, statsReportSchema as n, workspaceListSchema as o, personalTokenMetadataSchema as p, baselineSnapshotSchema as r, workspaceParamsSchema as s, statSchema as t, createPersonalTokenBodySchema as u, personParamsSchema as v, activityDays as w, locationDetailReportSchema as x, personalSpendReportSchema as y };
|
|
@@ -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-F--48Q7Q.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-B9u_3-GW.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 { An as actorFromRun, jn as toolInvocationDestination } from "./agent-runner-
|
|
3
|
-
import { n as createAndEnqueueAgentInvocation } from "./work-
|
|
2
|
+
import { An as actorFromRun, jn as toolInvocationDestination } from "./agent-runner-BlDI1zV2.js";
|
|
3
|
+
import { n as createAndEnqueueAgentInvocation } from "./work-PmkvcY9l.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,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-F--48Q7Q.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-CY1L2YRn.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
import { handleCallback, registerDevConsumer } from "@vercel/queue";
|
|
@@ -109,7 +109,7 @@ function pluginTaskCallback() {
|
|
|
109
109
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
110
110
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
111
111
|
run: async (message) => {
|
|
112
|
-
const { processPluginTask } = await import("./task-runner-
|
|
112
|
+
const { processPluginTask } = await import("./task-runner-B0-P_3aq.js").then((n) => n.r);
|
|
113
113
|
await processPluginTask(message);
|
|
114
114
|
},
|
|
115
115
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,14 +1,14 @@
|
|
|
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-F--48Q7Q.js";
|
|
3
3
|
import { b as parseSlackMessageTs, r as credentialSubjectSchema } from "./context-0Et9iVSB.js";
|
|
4
|
-
import { $
|
|
5
|
-
import { E as juniorConversations, s as juniorAutomationExecutions } from "./executor
|
|
6
|
-
import { rt as sameActorIdentity } from "./conversation-
|
|
7
|
-
import { C as isToolResultError, D as stripRuntimeTurnContext, J as hydrateConversationMessages, T as normalizeToolNameFromResult, b as instructionTextForProjection, g as getPiMessageRole, s as getTurnRecord, w as isToolResultMessage } from "./checkpoint-
|
|
8
|
-
import { w as getStateAdapter } from "./profile-
|
|
9
|
-
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
10
|
-
import { t as resolveConversationRouting } from "./turn-session-routing
|
|
11
|
-
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-
|
|
4
|
+
import { $ as readActorIdentity, Ct as createPluginModel, Pt as createPluginConversationEvents, St as createPluginEmbedder, dn as agentTurnTotalTokens, en as getConversationStore, gt as JUNIOR_THREAD_STATE_TTL_MS, p as coreTaskRegistrations, tn as getDb, u as getPlugins, un as agentTurnCostUsd, wt as createPluginLogger, xt as createPluginState } from "./agent-hooks-DS7k0ZWY.js";
|
|
5
|
+
import { E as juniorConversations, s as juniorAutomationExecutions } from "./executor-B9ksWZCv.js";
|
|
6
|
+
import { rt as sameActorIdentity } from "./conversation-C_aYrISI.js";
|
|
7
|
+
import { C as isToolResultError, D as stripRuntimeTurnContext, J as hydrateConversationMessages, T as normalizeToolNameFromResult, b as instructionTextForProjection, g as getPiMessageRole, s as getTurnRecord, w as isToolResultMessage } from "./checkpoint-DLcJ5mKL.js";
|
|
8
|
+
import { w as getStateAdapter } from "./profile-DZ2DUdd1.js";
|
|
9
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-TezcEhuH.js";
|
|
10
|
+
import { t as resolveConversationRouting } from "./turn-session-routing-Dg8GDgyc.js";
|
|
11
|
+
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-GcuFtzor.js";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
import { createHash } from "node:crypto";
|
|
14
14
|
import { and, asc, count, desc, eq, gte, inArray, lte, max, or, sql } from "drizzle-orm";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-
|
|
2
|
-
import {
|
|
1
|
+
import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-F--48Q7Q.js";
|
|
2
|
+
import { gt as JUNIOR_THREAD_STATE_TTL_MS, tn as getDb } from "./agent-hooks-DS7k0ZWY.js";
|
|
3
3
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
4
|
-
import { u as juniorLocationConfigurations } from "./executor
|
|
5
|
-
import { Y as persistConversationMessages } from "./checkpoint-
|
|
6
|
-
import { w as getStateAdapter } from "./profile-
|
|
4
|
+
import { u as juniorLocationConfigurations } from "./executor-B9ksWZCv.js";
|
|
5
|
+
import { Y as persistConversationMessages } from "./checkpoint-DLcJ5mKL.js";
|
|
6
|
+
import { w as getStateAdapter } from "./profile-DZ2DUdd1.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
import { and, eq, sql } from "drizzle-orm";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { _ as getProviderErrorUserMessage, g as getProviderErrorAttributes, h as findProviderError, p as ProviderError } from "./client-
|
|
2
|
-
import { I as isRecord, t as buildTurnFailureResponse } from "./logging-
|
|
1
|
+
import { _ as getProviderErrorUserMessage, g as getProviderErrorAttributes, h as findProviderError, p as ProviderError } from "./client-BSnNHO0R.js";
|
|
2
|
+
import { I as isRecord, t as buildTurnFailureResponse } from "./logging-F--48Q7Q.js";
|
|
3
3
|
import { b as parseSlackMessageTs } from "./context-0Et9iVSB.js";
|
|
4
|
-
import {
|
|
5
|
-
import { H as readMessageCardRefs, U as removedCardSchema, W as resolveMessageCards } from "./conversation-
|
|
6
|
-
import { J as hydrateConversationMessages, st as markConversationMessage } from "./checkpoint-
|
|
7
|
-
import { r as clearPendingAuth, s as buildDeterministicTurnId } from "./pending-auth-
|
|
8
|
-
import { g as markTurnCompleted, h as markTurnClosed } from "./oauth-authorization-
|
|
9
|
-
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
4
|
+
import { Gt as listConversationAnnotations, Qt as getConversationEventStore, tn as getDb } from "./agent-hooks-DS7k0ZWY.js";
|
|
5
|
+
import { H as readMessageCardRefs, U as removedCardSchema, W as resolveMessageCards } from "./conversation-C_aYrISI.js";
|
|
6
|
+
import { J as hydrateConversationMessages, st as markConversationMessage } from "./checkpoint-DLcJ5mKL.js";
|
|
7
|
+
import { r as clearPendingAuth, s as buildDeterministicTurnId } from "./pending-auth-DrG9Mkje.js";
|
|
8
|
+
import { g as markTurnCompleted, h as markTurnClosed } from "./oauth-authorization-LasSG3Qc.js";
|
|
9
|
+
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-TezcEhuH.js";
|
|
10
10
|
//#region src/chat/conversations/pending-cards.ts
|
|
11
11
|
/** Select undelivered cards and load their latest saved facts. */
|
|
12
12
|
async function loadPendingMessageCards(conversationId) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Qt as getConversationEventStore } from "./agent-hooks-DS7k0ZWY.js";
|
|
2
2
|
//#region src/chat/conversations/turn-lifecycle.ts
|
|
3
3
|
/** Persist correlated turn lifecycle facts with retry-safe terminal exclusion. */
|
|
4
4
|
var ConversationTurnLifecycleService = class {
|
|
@@ -34,7 +34,7 @@ function slackSourceForDestination(args) {
|
|
|
34
34
|
* Reads parent Conversations when this Conversation has no Destination.
|
|
35
35
|
*/
|
|
36
36
|
async function resolveConversationRouting(args) {
|
|
37
|
-
const conversationStore = args.conversationStore ?? (await import("./agent-hooks-
|
|
37
|
+
const conversationStore = args.conversationStore ?? (await import("./agent-hooks-DS7k0ZWY.js").then((n) => n.Zt)).getConversationStore();
|
|
38
38
|
const chain = await loadConversationChain(args.conversationId, conversationStore);
|
|
39
39
|
let destination;
|
|
40
40
|
let source;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-B9u_3-GW.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
//#region src/chat/plugins/validation.ts
|
|
5
5
|
var validation_exports = /* @__PURE__ */ __exportAll({
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
1
|
+
import { t as JUNIOR_VERSION } from "./version-9CB4Z-J4.js";
|
|
2
2
|
export { JUNIOR_VERSION };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { It as ensureConversationWake, Kt as requestConversationWork } from "./agent-runner-
|
|
2
|
-
import {
|
|
3
|
-
import { n as loadTurnCheckpoint, o as failTurnRecord, s as getTurnRecord } from "./checkpoint-
|
|
4
|
-
import { w as getStateAdapter } from "./profile-
|
|
5
|
-
import { a as getVercelConversationWorkQueue } from "./job-queue-
|
|
6
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing
|
|
1
|
+
import { It as ensureConversationWake, Kt as requestConversationWork } from "./agent-runner-BlDI1zV2.js";
|
|
2
|
+
import { Qt as getConversationEventStore } from "./agent-hooks-DS7k0ZWY.js";
|
|
3
|
+
import { n as loadTurnCheckpoint, o as failTurnRecord, s as getTurnRecord } from "./checkpoint-DLcJ5mKL.js";
|
|
4
|
+
import { w as getStateAdapter } from "./profile-DZ2DUdd1.js";
|
|
5
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-CY1L2YRn.js";
|
|
6
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-Dg8GDgyc.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
//#region src/chat/task-execution/authorized-turn.ts
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { $ as deleteEventAutomation, Cn as postSlackMessage, D as renderBlockText, Dn as createUserTokenStore, E as renderAttachmentText, F as resolveSlackChannelIdFromThreadId, G as saveScheduledAutomationInLock, H as parseScheduledAutomationRow, I as listThreadReplies, M as parseSlackThreadId, Mn as AuthorizationFlowDisabledError, N as readSlackRawMessageContext, Nn as shouldEmitDevAgentTrace, On as buildSteeringPiMessage, P as resolveSlackChannelIdFromMessage, Rt as getConversationWorkState, Sn as addReactionToMessage, St as pluginEventCatalog, Tt as appendAndEnqueueInboundMessage, U as readScheduledAutomation, X as eventAutomationTriggerAvailable, Z as effectiveTaskOutcomes, _n as escapeSlackMrkdwnText,
|
|
2
|
-
import { f as escapeXml, i as completeText, r as completeObject, v as isProviderRetryError } from "./client-
|
|
3
|
-
import { C as withLogContext, I as isRecord, L as toOptionalNumber, R as toOptionalString, _ as setSentryUser, b as setTags, d as logException, f as logInfo, n as createChatSdkLogger, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, u as logError, v as setSpanAttributes, w as withSpan } from "./logging-
|
|
4
|
-
import { a as getChatConfig, c as getSlackClientId, d as getSlackSigningSecret, h as normalizeSlackEmojiName, l as getSlackClientSecret, n as botConfig, s as getSlackBotToken } from "./config-
|
|
1
|
+
import { $ as deleteEventAutomation, C as isExperimentalFeatureEnabled, Cn as postSlackMessage, D as renderBlockText, Dn as createUserTokenStore, E as renderAttachmentText, F as resolveSlackChannelIdFromThreadId, G as saveScheduledAutomationInLock, H as parseScheduledAutomationRow, I as listThreadReplies, M as parseSlackThreadId, Mn as AuthorizationFlowDisabledError, N as readSlackRawMessageContext, Nn as shouldEmitDevAgentTrace, On as buildSteeringPiMessage, P as resolveSlackChannelIdFromMessage, Rt as getConversationWorkState, Sn as addReactionToMessage, St as pluginEventCatalog, Tt as appendAndEnqueueInboundMessage, U as readScheduledAutomation, X as eventAutomationTriggerAvailable, Z as effectiveTaskOutcomes, _n as escapeSlackMrkdwnText, bn as normalizeSlackStatusText, bt as getEventCatalog, et as eventAutomationBelongsToUser, h as latestProgressStatus, i as createContextCompactor, it as parseEventAutomationRow, j as storeAttachment, kn as RetryableDeliveryError, m as PluginCredentialFailureError, nn as maybePostAutomatedTurnLimitNotice, nt as getEventAutomation, q as withScheduledAutomationLock, r as executeAgentRun, rn as recordFinishedTurnForAutomatedLimit, rt as listDeletedEventAutomationsCreatedBy, t as createAgentRunner, vn as formatSlackLink, vt as EVENT_WAIT_MS, wn as removeReactionFromMessage, wt as appendAndEnqueueExclusiveInboundMessage, xn as truncateStatusText, yn as normalizeSlackReplyMarkdown, yt as isEventMailboxMetadata } from "./agent-runner-BlDI1zV2.js";
|
|
2
|
+
import { f as escapeXml, i as completeText, r as completeObject, v as isProviderRetryError } from "./client-BSnNHO0R.js";
|
|
3
|
+
import { C as withLogContext, I as isRecord, L as toOptionalNumber, R as toOptionalString, _ as setSentryUser, b as setTags, d as logException, f as logInfo, n as createChatSdkLogger, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, u as logError, v as setSpanAttributes, w as withSpan } from "./logging-F--48Q7Q.js";
|
|
4
|
+
import { a as getChatConfig, c as getSlackClientId, d as getSlackSigningSecret, h as normalizeSlackEmojiName, l as getSlackClientSecret, n as botConfig, s as getSlackBotToken } from "./config-Bmw4xTPK.js";
|
|
5
5
|
import { o as modelIdForProfile, r as defaultModelId } from "./model-profile-BwU8mqwD.js";
|
|
6
6
|
import { a as createActor, b as parseSlackMessageTs, c as isActorUserId, l as isUserActor, o as createSlackActor, p as parseSlackChannelId, s as createSlackResumeActor, t as credentialContextForActor, u as parseActorUserId } from "./context-0Et9iVSB.js";
|
|
7
|
-
import {
|
|
7
|
+
import { B as SlackActionError, Bt as readAttachmentVisionSummary, J as runWithSlackInstallationToken, K as isDmChannel, Lt as buildSentryConversationUrl, Qt as getConversationEventStore, Rt as getSlackFileId, U as getHeaderString, V as downloadPrivateSlackFile, Vt as recordSlackAttachment, W as getSlackClient, _t as getDashboardConversationLink, bn as requireSlackDestination, en as getConversationStore, gt as JUNIOR_THREAD_STATE_TTL_MS, nn as getSqlExecutor, o as getPluginSlackConversationLink, q as normalizeSlackConversationId, st as cancelSubscriptions, tn as getDb, vn as createSlackDestination, vt as getDashboardObjectIconLink } from "./agent-hooks-DS7k0ZWY.js";
|
|
8
8
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
9
|
-
import { D as juniorIdentities, O as juniorUsers, l as juniorEventAutomations, o as juniorSchedulerTasks, s as juniorAutomationExecutions } from "./executor
|
|
10
|
-
import { N as isVisionImageMediaType, j as readMessageAttachments, nt as instructionProvenanceFor } from "./conversation-
|
|
11
|
-
import { $ as fallbackShortTitle, A as commitAcceptedReply, B as recordAuthorizationCompleted, J as hydrateConversationMessages, N as loadConversationProjection, O as trimTrailingAssistantMessages, P as loadProjection, Q as resolveConversationTitle, W as recordSubscribedReplyRoute, Y as persistConversationMessages, Z as persistConversationMessageSummaries, a as completeTurnRecord, at as getConversationMessageSlackTs, c as listTurnSummaries, ct as normalizeConversationText, dt as upsertConversationMessage, ft as estimateTextTokens, i as abandonTurnRecord, it as estimateConversationContextTokens, j as commitMessages, l as recordTurnSummary, lt as recordDeliveredAssistantMessage, n as loadTurnCheckpoint, nt as buildConversationContext, o as failTurnRecord, ot as isHumanConversationMessage, p as buildTurnErrorResponse, r as saveTurnCheckpoint, rt as createConversationMemoryService, s as getTurnRecord, st as markConversationMessage, tt as appendThreadContextMessages, u as persistWithRetry, ut as turnHasReply } from "./checkpoint-
|
|
12
|
-
import { E as acquireActiveLock, O as withLock, T as MUTATION_LOCK_TTL_MS, w as getStateAdapter } from "./profile-
|
|
13
|
-
import { a as isPendingAuthLatestRequest, o as buildDeterministicAssistantMessageId, r as clearPendingAuth, s as buildDeterministicTurnId } from "./pending-auth-
|
|
14
|
-
import { _ as markTurnFailed, c as CooperativeTurnYieldError, d as getConversationTurnBoundaryError, f as isCooperativeTurnYieldError, g as markTurnCompleted, h as markTurnClosed, l as TurnInputCommitLostError, m as isTurnInputDeferredError, p as isTurnInputCommitLostError, r as getAssistantReplyText, s as ConversationTurnBoundaryError, u as TurnInputDeferredError, v as startActiveTurn } from "./oauth-authorization-
|
|
15
|
-
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-
|
|
16
|
-
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-
|
|
9
|
+
import { D as juniorIdentities, O as juniorUsers, l as juniorEventAutomations, o as juniorSchedulerTasks, s as juniorAutomationExecutions } from "./executor-B9ksWZCv.js";
|
|
10
|
+
import { N as isVisionImageMediaType, j as readMessageAttachments, nt as instructionProvenanceFor } from "./conversation-C_aYrISI.js";
|
|
11
|
+
import { $ as fallbackShortTitle, A as commitAcceptedReply, B as recordAuthorizationCompleted, J as hydrateConversationMessages, N as loadConversationProjection, O as trimTrailingAssistantMessages, P as loadProjection, Q as resolveConversationTitle, W as recordSubscribedReplyRoute, Y as persistConversationMessages, Z as persistConversationMessageSummaries, a as completeTurnRecord, at as getConversationMessageSlackTs, c as listTurnSummaries, ct as normalizeConversationText, dt as upsertConversationMessage, ft as estimateTextTokens, i as abandonTurnRecord, it as estimateConversationContextTokens, j as commitMessages, l as recordTurnSummary, lt as recordDeliveredAssistantMessage, n as loadTurnCheckpoint, nt as buildConversationContext, o as failTurnRecord, ot as isHumanConversationMessage, p as buildTurnErrorResponse, r as saveTurnCheckpoint, rt as createConversationMemoryService, s as getTurnRecord, st as markConversationMessage, tt as appendThreadContextMessages, u as persistWithRetry, ut as turnHasReply } from "./checkpoint-DLcJ5mKL.js";
|
|
12
|
+
import { E as acquireActiveLock, O as withLock, T as MUTATION_LOCK_TTL_MS, w as getStateAdapter } from "./profile-DZ2DUdd1.js";
|
|
13
|
+
import { a as isPendingAuthLatestRequest, o as buildDeterministicAssistantMessageId, r as clearPendingAuth, s as buildDeterministicTurnId } from "./pending-auth-DrG9Mkje.js";
|
|
14
|
+
import { _ as markTurnFailed, c as CooperativeTurnYieldError, d as getConversationTurnBoundaryError, f as isCooperativeTurnYieldError, g as markTurnCompleted, h as markTurnClosed, l as TurnInputCommitLostError, m as isTurnInputDeferredError, p as isTurnInputCommitLostError, r as getAssistantReplyText, s as ConversationTurnBoundaryError, u as TurnInputDeferredError, v as startActiveTurn } from "./oauth-authorization-LasSG3Qc.js";
|
|
15
|
+
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-BM_5mAU3.js";
|
|
16
|
+
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-CY1L2YRn.js";
|
|
17
17
|
import { P as healthReportSchema, S as automationListQuerySchema, c as sumUtcHoursIntoSixHours, t as webMessageId } from "./web-message-id-CVVCTWUb.js";
|
|
18
|
-
import { C as readAutomationExecutionStatusDays, D as readAutomationRuns, E as readAutomationExecutions, S as readAutomationExecutionHours, T as readAutomationExecutionSummaries, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, b as readAutomationExecutionByConversationId, c as getDispatchInputMessageId, f as isTerminalDispatchStatus, g as markDispatchCompleted, h as markDispatchBlocked, i as claimDispatchMailboxAppend, l as getDispatchRecord, m as markDispatchAwaitingResume, n as scheduleSessionCompletedPluginTasks, s as getDispatchConversationId, t as processPluginTask, u as getDispatchTurnId, v as markDispatchRunning, w as readAutomationExecutionStatusHours, x as readAutomationExecutionDays, y as emptyAutomationRunWindows } from "./task-runner-
|
|
19
|
-
import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-
|
|
20
|
-
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
21
|
-
import { a as persistThreadState, c as configValueSchema, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-
|
|
22
|
-
import { a as getPausedTurnRequest, c as getTurnAuthorization, i as createPausedTurns, n as deleteWebAuthorization, s as wakePausedTurn, t as createWebAuthorization } from "./web-authorization-
|
|
23
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing
|
|
24
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
25
|
-
import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as getInterruptionMarker } from "./turn-failure-response-
|
|
26
|
-
import { r as storeInputImages } from "./images-
|
|
18
|
+
import { C as readAutomationExecutionStatusDays, D as readAutomationRuns, E as readAutomationExecutions, S as readAutomationExecutionHours, T as readAutomationExecutionSummaries, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, b as readAutomationExecutionByConversationId, c as getDispatchInputMessageId, f as isTerminalDispatchStatus, g as markDispatchCompleted, h as markDispatchBlocked, i as claimDispatchMailboxAppend, l as getDispatchRecord, m as markDispatchAwaitingResume, n as scheduleSessionCompletedPluginTasks, s as getDispatchConversationId, t as processPluginTask, u as getDispatchTurnId, v as markDispatchRunning, w as readAutomationExecutionStatusHours, x as readAutomationExecutionDays, y as emptyAutomationRunWindows } from "./task-runner-B0-P_3aq.js";
|
|
19
|
+
import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-PmkvcY9l.js";
|
|
20
|
+
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-BpIW3zOx.js";
|
|
21
|
+
import { a as persistThreadState, c as configValueSchema, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-TezcEhuH.js";
|
|
22
|
+
import { a as getPausedTurnRequest, c as getTurnAuthorization, i as createPausedTurns, n as deleteWebAuthorization, s as wakePausedTurn, t as createWebAuthorization } from "./web-authorization-Cu33voNg.js";
|
|
23
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-Dg8GDgyc.js";
|
|
24
|
+
import { t as bindSpawnAgent } from "./spawn-DCfV7zGK.js";
|
|
25
|
+
import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as getInterruptionMarker } from "./turn-failure-response-Drhj_-t4.js";
|
|
26
|
+
import { r as storeInputImages } from "./images-CEXcQ0Id.js";
|
|
27
27
|
import { z } from "zod";
|
|
28
28
|
import { createHash } from "node:crypto";
|
|
29
29
|
import { and, asc, count, desc, eq, exists, inArray, ne, or, sql } from "drizzle-orm";
|