@sentry/junior 0.232.0 → 0.234.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-n9qfV697.js → agent-hooks-BcH6E48y.js} +89 -12
- package/dist/{agent-runner-D_FVvrwA.js → agent-runner-DUkGlK89.js} +224 -768
- package/dist/api/schema.d.ts +538 -2
- package/dist/api/schema.js +4 -4
- package/dist/api.js +230 -19
- package/dist/app.js +31 -21
- package/dist/{briefs-B7wDx-LM.js → briefs-lyAQbDxJ.js} +4 -4
- package/dist/{catalog-runtime-FU8TmK-W.js → catalog-runtime-BSgsPVnr.js} +1 -1
- package/dist/{checkpoint-DuA1tIcd.js → checkpoint-BNfXlq_1.js} +7 -7
- 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-BMqP14EE.js → client-BX5lJRqW.js} +2 -2
- package/dist/{config-Q7ayKDYh.js → config-DuCzUoCo.js} +2 -2
- package/dist/{conversation-DsuDtoYR.js → conversation-CPjHYOV5.js} +13 -2
- package/dist/{conversation-privacy-DNNsgprf.js → conversation-privacy-CSxvdSoV.js} +1 -1
- package/dist/{credential-sync-DbgAGIhd.js → credential-sync-BO4DfH9a.js} +13 -13
- package/dist/{executor-DDonSWxn.js → executor--jWf-Nnm.js} +1 -1
- package/dist/{images-Bj8PcvZ5.js → images-BaL19wFC.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-Dqc7qQbR.js → job-queue-cwHVOwVZ.js} +1 -1
- package/dist/{logging-X4U7SInw.js → logging-Cox1Mgcv.js} +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-CetcZcwQ.js → oauth-authorization-CC8a1JKP.js} +1 -1
- package/dist/{oauth-callback-server-o34WSoGm.js → oauth-callback-server-Z7QSt416.js} +2 -2
- package/dist/{pending-auth-XoxEa4O5.js → pending-auth-DQhC3eSR.js} +1 -1
- package/dist/{profile-DzqqgpDo.js → profile-BdApelHS.js} +4 -4
- package/dist/{prompt-D5RPLy92.js → prompt-3D0sSbTC.js} +1 -1
- package/dist/{registry-RrIfDnkS.js → registry-DiY6B8CN.js} +1 -1
- package/dist/{resolve-Ccu6uGtp.js → resolve-VpJoiDpc.js} +2 -2
- package/dist/{runner-DDQCEV1P.js → runner-BIMegnPE.js} +9 -9
- package/dist/{sandbox-egress-signals-CT3xOtNG.js → sandbox-egress-signals-Cbtxe492.js} +1 -1
- package/dist/{schema-B-Taar1W.js → schema-CxwnlTDN.js} +4 -117
- package/dist/{skills-NB_I9BuR.js → skills-WttpPJUy.js} +2 -2
- package/dist/{spawn-DmwIhiNu.js → spawn-DhfMKt4y.js} +2 -2
- package/dist/{task-queue-B5CERq_E.js → task-queue-CZqUNJD0.js} +3 -3
- package/dist/{task-runner-COivEGS3.js → task-runner-BZaqoUCT.js} +16 -13
- package/dist/{thread-state-C7yyfiVM.js → thread-state-8tXZhu0y.js} +5 -5
- package/dist/{turn-failure-response-D990svo-.js → turn-failure-response-DFJ9L9NQ.js} +8 -8
- package/dist/{turn-lifecycle-C-LUNJC6.js → turn-lifecycle-WbpTUQ_r.js} +1 -1
- package/dist/{turn-session-routing-CoF0GbaY.js → turn-session-routing--EhI76rH.js} +1 -1
- package/dist/types-Du-HbEun.js +621 -0
- package/dist/{validation-f0y71ety.js → validation-0F9IgG3b.js} +1 -1
- package/dist/{version-CkRTIRkV.js → version-A7-RRBOE.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-BBwQsNCZ.js → web-authorization-BJggXofy.js} +6 -6
- package/dist/{web-input-Bkn-JGWd.js → web-input-B-siN5Dr.js} +212 -164
- package/dist/web-message-id-CVVCTWUb.js +464 -0
- package/dist/{work-vWPq9P5x.js → work-CNc0ejGG.js} +7 -7
- package/dist/{worker-BgZog5Jp.js → worker-BHbqpUAu.js} +5 -5
- package/package.json +5 -5
- package/dist/web-message-id-xPI_EFSC.js +0 -239
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-DuCzUoCo.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor--jWf-Nnm.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-DiY6B8CN.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-Cox1Mgcv.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-CSxvdSoV.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-BX5lJRqW.js";
|
|
3
|
+
import { p as logWarn } from "./logging-Cox1Mgcv.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]))?$/;
|
|
@@ -1025,7 +1025,7 @@ const conversationReportToolCallsEventDataSchema = z.object({
|
|
|
1025
1025
|
});
|
|
1026
1026
|
const conversationReportAssistantMessageEventDataSchema = z.object({
|
|
1027
1027
|
type: z.literal("assistant_message"),
|
|
1028
|
-
parts: z.array(conversationReportReasoningPartSchema)
|
|
1028
|
+
parts: z.array(conversationReportReasoningPartSchema)
|
|
1029
1029
|
}).strict();
|
|
1030
1030
|
const conversationReportTurnLifecycleEventDataSchema = z.discriminatedUnion("state", [
|
|
1031
1031
|
z.object({
|
|
@@ -1164,7 +1164,18 @@ const conversationReportEventDataSchema = z.discriminatedUnion("type", [
|
|
|
1164
1164
|
const conversationReportEventSchema = z.object({
|
|
1165
1165
|
seq: z.number().int().nonnegative(),
|
|
1166
1166
|
createdAt: z.string().datetime(),
|
|
1167
|
-
data: conversationReportEventDataSchema
|
|
1167
|
+
data: conversationReportEventDataSchema,
|
|
1168
|
+
model: z.object({
|
|
1169
|
+
modelId: z.string().min(1),
|
|
1170
|
+
modelProfile: z.string().min(1).optional(),
|
|
1171
|
+
reasoningLevel: z.string().min(1).optional()
|
|
1172
|
+
}).strict().optional(),
|
|
1173
|
+
modelCall: z.object({
|
|
1174
|
+
provider: z.string().min(1).optional(),
|
|
1175
|
+
api: z.string().min(1).optional(),
|
|
1176
|
+
stopReason: z.string().min(1).optional(),
|
|
1177
|
+
usage: conversationUsageSchema.optional()
|
|
1178
|
+
}).strict().optional()
|
|
1168
1179
|
}).strict();
|
|
1169
1180
|
/** Availability of the canonical event history attached to a detail report. */
|
|
1170
1181
|
const conversationEventHistorySchema = z.discriminatedUnion("status", [
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Cn as createUserTokenStore, T as lookupSlackUserProfile, _ as putMcpStoredOAuthCredentials, d as deleteMcpAuthSession,
|
|
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 putMcpStoredOAuthCredentials, d as deleteMcpAuthSession, g as getMcpStoredOAuthCredentials, h as getMcpAuthSession, hn as resolveBaseUrl, ht as getMcpProviderErrorAttributes, mn as parseOAuthStatePayload, pn as formatProviderLabel, u as finalizeMcpAuthorization, x as resolvePluginOAuthAccount } from "./agent-runner-DUkGlK89.js";
|
|
2
|
+
import { f as escapeXml } from "./client-BX5lJRqW.js";
|
|
3
|
+
import { d as logException, h as runBestEffort, p as logWarn } from "./logging-Cox1Mgcv.js";
|
|
4
|
+
import { n as botConfig, o as getRuntimeMetadata } from "./config-DuCzUoCo.js";
|
|
5
5
|
import { g as parseSlackUserId } from "./context-0Et9iVSB.js";
|
|
6
|
-
import { U as getSlackClient, gn as upsertLinkedIdentity, hn as upsertIdentity, tn as getSqlExecutor } from "./agent-hooks-
|
|
6
|
+
import { U as getSlackClient, gn as upsertLinkedIdentity, hn as upsertIdentity, tn as getSqlExecutor } from "./agent-hooks-BcH6E48y.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-DiY6B8CN.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BSgsPVnr.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-WttpPJUy.js";
|
|
11
|
+
import { B as recordAuthorizationCompleted, s as getTurnRecord, z as recordAuthenticationLinked } from "./checkpoint-BNfXlq_1.js";
|
|
12
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-BdApelHS.js";
|
|
13
|
+
import { i as getConversationPendingAuth } from "./pending-auth-DQhC3eSR.js";
|
|
14
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-8tXZhu0y.js";
|
|
15
|
+
import { n as deleteWebAuthorization, o as wakeAuthorizedTurn, s as wakePausedTurn } from "./web-authorization-BJggXofy.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-DuCzUoCo.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";
|
|
@@ -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 { tn as getSqlExecutor } from "./agent-hooks-
|
|
4
|
-
import "./conversation-
|
|
2
|
+
import { j as storeAttachment, k as readLiveAttachment } from "./agent-runner-DUkGlK89.js";
|
|
3
|
+
import { tn as getSqlExecutor } from "./agent-hooks-BcH6E48y.js";
|
|
4
|
+
import "./conversation-CPjHYOV5.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-Cox1Mgcv.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-CSxvdSoV.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-DuCzUoCo.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-A7-RRBOE.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,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-Cox1Mgcv.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-cwHVOwVZ.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-CZqUNJD0.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-BNfXlq_1.js";
|
|
2
2
|
//#region src/chat/runtime/turn.ts
|
|
3
3
|
/** Classified Slack turn failure carrying the owning Sentry capture outward. */
|
|
4
4
|
var ConversationTurnBoundaryError = class extends Error {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { Dn as createUserTokenStore } from "./agent-runner-DUkGlK89.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-BO4DfH9a.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-BNfXlq_1.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-BX5lJRqW.js";
|
|
2
|
+
import { v as setSpanAttributes, y as setSpanStatus } from "./logging-Cox1Mgcv.js";
|
|
3
|
+
import { a as getChatConfig } from "./config-DuCzUoCo.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BSgsPVnr.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-CPjHYOV5.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-Cox1Mgcv.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-Cox1Mgcv.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-BdApelHS.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-Cox1Mgcv.js";
|
|
2
2
|
import { t as credentialContextForActor } from "./context-0Et9iVSB.js";
|
|
3
|
-
import { $t as getConversationStore, Zt as getConversationEventStore } from "./agent-hooks-
|
|
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
|
|
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 { $t as getConversationStore, Zt as getConversationEventStore } from "./agent-hooks-BcH6E48y.js";
|
|
4
|
+
import { V as messageCardText } from "./conversation-CPjHYOV5.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-BNfXlq_1.js";
|
|
6
|
+
import { _ as markTurnFailed, r as getAssistantReplyText, t as authorizationId, v as startActiveTurn } from "./oauth-authorization-CC8a1JKP.js";
|
|
7
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-BZaqoUCT.js";
|
|
8
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-WbpTUQ_r.js";
|
|
9
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-8tXZhu0y.js";
|
|
10
|
+
import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-DFJ9L9NQ.js";
|
|
11
11
|
import { randomUUID } from "node:crypto";
|
|
12
12
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
13
13
|
//#region src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fn as sandboxEgressSignalsResponseSchema } from "./agent-runner-DUkGlK89.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,8 +1,8 @@
|
|
|
1
1
|
import { t as juniorDestinationKindSchema } from "./destinations-BeBiJeEM.js";
|
|
2
|
-
import { E as conversationSummaryReportSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-
|
|
3
|
-
import { a as fillUtcHours, c as sumUtcHoursIntoSixHours, i as fillUtcDays } from "./web-message-id-
|
|
2
|
+
import { E as conversationSummaryReportSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-CPjHYOV5.js";
|
|
3
|
+
import { a as fillUtcHours, c as sumUtcHoursIntoSixHours, i as fillUtcDays } from "./web-message-id-CVVCTWUb.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
import { codeChangeStateSchema
|
|
5
|
+
import { codeChangeStateSchema } from "@sentry/junior-plugin-api";
|
|
6
6
|
//#region src/api/schema/common.ts
|
|
7
7
|
/** Stable error body returned by Junior-owned REST endpoints. */
|
|
8
8
|
const apiErrorSchema = z.object({ error: z.string().min(1) }).strict();
|
|
@@ -263,119 +263,6 @@ const createdPersonalTokenSchema = personalTokenMetadataSchema.extend({ token: z
|
|
|
263
263
|
const personalTokenParamsSchema = z.object({ id: z.string().uuid() }).strict();
|
|
264
264
|
const revokePersonalTokenResponseSchema = z.object({ revoked: z.literal(true) }).strict();
|
|
265
265
|
//#endregion
|
|
266
|
-
//#region src/api/schema/automation.ts
|
|
267
|
-
const automationDestinationSchema = z.object({
|
|
268
|
-
channelId: z.string().min(1),
|
|
269
|
-
label: z.string().min(1),
|
|
270
|
-
teamId: z.string().min(1),
|
|
271
|
-
visibility: z.enum(["private", "public"])
|
|
272
|
-
}).strict();
|
|
273
|
-
/** Automation run counts for the dashboard range control (24h/7d/30d/90d). */
|
|
274
|
-
const automationRunWindowsSchema = z.object({
|
|
275
|
-
1: z.number().int().nonnegative(),
|
|
276
|
-
7: z.number().int().nonnegative(),
|
|
277
|
-
30: z.number().int().nonnegative(),
|
|
278
|
-
90: z.number().int().nonnegative()
|
|
279
|
-
}).strict();
|
|
280
|
-
const automationSummaryBaseSchema = z.object({
|
|
281
|
-
createdAt: z.string().datetime(),
|
|
282
|
-
createdBy: z.string().min(1),
|
|
283
|
-
createdByEmail: z.string().trim().email().optional(),
|
|
284
|
-
destination: automationDestinationSchema,
|
|
285
|
-
id: z.string().min(1),
|
|
286
|
-
instruction: z.string().min(1),
|
|
287
|
-
lastConversationId: z.string().min(1).optional(),
|
|
288
|
-
lastRunAt: z.string().datetime().optional(),
|
|
289
|
-
ownedByViewer: z.boolean(),
|
|
290
|
-
runs: automationRunWindowsSchema,
|
|
291
|
-
outcomes: z.array(taskOutcomeSchema).max(5),
|
|
292
|
-
/** Short display title; falls back from instruction when unset. */
|
|
293
|
-
title: z.string().min(1),
|
|
294
|
-
totalRuns: z.number().int().nonnegative()
|
|
295
|
-
});
|
|
296
|
-
const scheduledAutomationSummarySchema = automationSummaryBaseSchema.extend({
|
|
297
|
-
kind: z.literal("scheduled"),
|
|
298
|
-
nextRunAt: z.string().datetime().optional(),
|
|
299
|
-
schedule: z.string().min(1),
|
|
300
|
-
status: z.enum([
|
|
301
|
-
"active",
|
|
302
|
-
"blocked",
|
|
303
|
-
"completed"
|
|
304
|
-
])
|
|
305
|
-
}).strict();
|
|
306
|
-
const eventAutomationSummarySchema = automationSummaryBaseSchema.extend({
|
|
307
|
-
events: z.array(z.string().min(1)).min(1),
|
|
308
|
-
kind: z.literal("event"),
|
|
309
|
-
resource: z.string().min(1),
|
|
310
|
-
source: z.string().min(1),
|
|
311
|
-
triggerAvailable: z.boolean()
|
|
312
|
-
}).strict();
|
|
313
|
-
const automationSummarySchema = z.discriminatedUnion("kind", [scheduledAutomationSummarySchema, eventAutomationSummarySchema]);
|
|
314
|
-
/** UTC day (`YYYY-MM-DD`) or hour (`YYYY-MM-DDTHH`) execution bucket key. */
|
|
315
|
-
const automationMetricBucketSchema = z.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/);
|
|
316
|
-
/** One UTC day/hour of completed automation executions stacked by automation type. */
|
|
317
|
-
const automationExecutionDaySchema = z.object({
|
|
318
|
-
/** Linked conversation spend for executions in this bucket. */
|
|
319
|
-
costUsd: z.number().finite().nonnegative(),
|
|
320
|
-
date: automationMetricBucketSchema,
|
|
321
|
-
event: z.number().int().nonnegative(),
|
|
322
|
-
scheduled: z.number().int().nonnegative()
|
|
323
|
-
}).strict();
|
|
324
|
-
const automationListQuerySchema = z.object({ q: z.string().trim().max(200).optional() }).strict();
|
|
325
|
-
const automationListSchema = z.object({
|
|
326
|
-
executionDays: z.array(automationExecutionDaySchema),
|
|
327
|
-
executionHours: z.array(automationExecutionDaySchema).optional(),
|
|
328
|
-
executionSixHours: z.array(automationExecutionDaySchema).optional(),
|
|
329
|
-
automations: z.array(automationSummarySchema),
|
|
330
|
-
truncated: z.boolean()
|
|
331
|
-
}).strict();
|
|
332
|
-
const automationParamsSchema = z.object({
|
|
333
|
-
id: z.string().min(1),
|
|
334
|
-
kind: z.enum(["scheduled", "event"])
|
|
335
|
-
}).strict();
|
|
336
|
-
const automationExecutionStatusSchema = z.enum([
|
|
337
|
-
"blocked",
|
|
338
|
-
"completed",
|
|
339
|
-
"failed"
|
|
340
|
-
]);
|
|
341
|
-
const automationExecutionSchema = z.object({
|
|
342
|
-
conversationId: z.string().min(1).optional(),
|
|
343
|
-
/** Estimated model cost for the linked conversation, when known. */
|
|
344
|
-
costUsd: z.number().finite().nonnegative().optional(),
|
|
345
|
-
/** Cumulative conversation runtime in milliseconds, when known. */
|
|
346
|
-
durationMs: z.number().finite().nonnegative().optional(),
|
|
347
|
-
executedAt: z.string().datetime(),
|
|
348
|
-
executionId: z.string().min(1),
|
|
349
|
-
status: automationExecutionStatusSchema,
|
|
350
|
-
title: z.string().min(1).optional(),
|
|
351
|
-
/** Cumulative conversation token total, when known. */
|
|
352
|
-
totalTokens: z.number().int().nonnegative().optional()
|
|
353
|
-
}).strict();
|
|
354
|
-
/** One UTC day/hour of terminal executions for a single automation, stacked by status. */
|
|
355
|
-
const automationExecutionStatusDaySchema = z.object({
|
|
356
|
-
blocked: z.number().int().nonnegative(),
|
|
357
|
-
completed: z.number().int().nonnegative(),
|
|
358
|
-
date: automationMetricBucketSchema,
|
|
359
|
-
failed: z.number().int().nonnegative()
|
|
360
|
-
}).strict();
|
|
361
|
-
const automationExecutionListSchema = z.object({
|
|
362
|
-
executionDays: z.array(automationExecutionStatusDaySchema),
|
|
363
|
-
executionHours: z.array(automationExecutionStatusDaySchema).optional(),
|
|
364
|
-
executionSixHours: z.array(automationExecutionStatusDaySchema).optional(),
|
|
365
|
-
executions: z.array(automationExecutionSchema),
|
|
366
|
-
automation: automationSummarySchema,
|
|
367
|
-
truncated: z.boolean()
|
|
368
|
-
}).strict();
|
|
369
|
-
const automationRunSchema = automationExecutionSchema.extend({
|
|
370
|
-
kind: z.enum(["scheduled", "event"]),
|
|
371
|
-
automationId: z.string().min(1),
|
|
372
|
-
automationTitle: z.string().min(1)
|
|
373
|
-
}).strict();
|
|
374
|
-
const automationRunListSchema = z.object({
|
|
375
|
-
runs: z.array(automationRunSchema),
|
|
376
|
-
truncated: z.boolean()
|
|
377
|
-
}).strict();
|
|
378
|
-
//#endregion
|
|
379
266
|
//#region src/api/schema/workspace.ts
|
|
380
267
|
const workspaceRepoInputSchema = z.object({
|
|
381
268
|
provider: z.string(),
|
|
@@ -433,4 +320,4 @@ const statsReportSchema = z.object({
|
|
|
433
320
|
windowStart: z.string()
|
|
434
321
|
}).strict();
|
|
435
322
|
//#endregion
|
|
436
|
-
export {
|
|
323
|
+
export { codeChangeSummarySchema as A, locationParamsSchema as C, dailyConversationActivitySchema as D, activitySixHours as E, codePersonReportSchema as M, codeRepositorySummarySchema as N, codeActivityDaySchema as O, apiErrorSchema 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-Cox1Mgcv.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-BSgsPVnr.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as createAndEnqueueAgentInvocation } from "./work-
|
|
2
|
+
import { An as actorFromRun, jn as toolInvocationDestination } from "./agent-runner-DUkGlK89.js";
|
|
3
|
+
import { n as createAndEnqueueAgentInvocation } from "./work-CNc0ejGG.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-Cox1Mgcv.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-cwHVOwVZ.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-BZaqoUCT.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-Cox1Mgcv.js";
|
|
3
3
|
import { b as parseSlackMessageTs, r as credentialSubjectSchema } from "./context-0Et9iVSB.js";
|
|
4
|
-
import { $t as getConversationStore, Ct as createPluginLogger, Nt as createPluginConversationEvents, Q as readActorIdentity, St as createPluginModel, bt as createPluginState, en as getDb, ht as JUNIOR_THREAD_STATE_TTL_MS, ln as agentTurnCostUsd, p as coreTaskRegistrations, u as getPlugins, un as agentTurnTotalTokens, xt as createPluginEmbedder } from "./agent-hooks-
|
|
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 { $t as getConversationStore, Ct as createPluginLogger, Nt as createPluginConversationEvents, Q as readActorIdentity, St as createPluginModel, bt as createPluginState, en as getDb, ht as JUNIOR_THREAD_STATE_TTL_MS, ln as agentTurnCostUsd, p as coreTaskRegistrations, u as getPlugins, un as agentTurnTotalTokens, xt as createPluginEmbedder } from "./agent-hooks-BcH6E48y.js";
|
|
5
|
+
import { E as juniorConversations, s as juniorAutomationExecutions } from "./executor--jWf-Nnm.js";
|
|
6
|
+
import { rt as sameActorIdentity } from "./conversation-CPjHYOV5.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-BNfXlq_1.js";
|
|
8
|
+
import { w as getStateAdapter } from "./profile-BdApelHS.js";
|
|
9
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-8tXZhu0y.js";
|
|
10
|
+
import { t as resolveConversationRouting } from "./turn-session-routing--EhI76rH.js";
|
|
11
|
+
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-CZqUNJD0.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";
|
|
@@ -174,10 +174,12 @@ async function readAutomationExecutionSummaries(type, namespace, options = {}) {
|
|
|
174
174
|
const ninetyDaysAgoMs = nowMs - 7776e6;
|
|
175
175
|
const db = getDb();
|
|
176
176
|
const latest = db.selectDistinctOn([juniorAutomationExecutions.automationId], {
|
|
177
|
+
status: juniorAutomationExecutions.status,
|
|
177
178
|
conversationId: juniorAutomationExecutions.conversationId,
|
|
178
179
|
automationId: juniorAutomationExecutions.automationId
|
|
179
|
-
}).from(juniorAutomationExecutions).where(and(eq(juniorAutomationExecutions.kind, type), eq(juniorAutomationExecutions.namespace, namespace))).orderBy(juniorAutomationExecutions.automationId, desc(juniorAutomationExecutions.executedAtMs), desc(juniorAutomationExecutions.executionId)).as("latest_task_execution");
|
|
180
|
+
}).from(juniorAutomationExecutions).where(and(eq(juniorAutomationExecutions.kind, type), eq(juniorAutomationExecutions.namespace, namespace), options.automationIds ? inArray(juniorAutomationExecutions.automationId, options.automationIds) : void 0)).orderBy(juniorAutomationExecutions.automationId, desc(juniorAutomationExecutions.executedAtMs), desc(juniorAutomationExecutions.executionId)).as("latest_task_execution");
|
|
180
181
|
const rows = await db.select({
|
|
182
|
+
lastRunStatus: latest.status,
|
|
181
183
|
lastConversationId: latest.conversationId,
|
|
182
184
|
lastExecutedAtMs: max(juniorAutomationExecutions.executedAtMs),
|
|
183
185
|
runsLast1Day: sql`count(*) filter (where ${juniorAutomationExecutions.executedAtMs} >= ${oneDayAgoMs})::int`,
|
|
@@ -186,8 +188,9 @@ async function readAutomationExecutionSummaries(type, namespace, options = {}) {
|
|
|
186
188
|
runsLast90Days: sql`count(*) filter (where ${juniorAutomationExecutions.executedAtMs} >= ${ninetyDaysAgoMs})::int`,
|
|
187
189
|
automationId: juniorAutomationExecutions.automationId,
|
|
188
190
|
totalRuns: sql`count(*)::int`
|
|
189
|
-
}).from(juniorAutomationExecutions).innerJoin(latest, eq(latest.automationId, juniorAutomationExecutions.automationId)).where(and(eq(juniorAutomationExecutions.kind, type), eq(juniorAutomationExecutions.namespace, namespace))).groupBy(juniorAutomationExecutions.automationId, latest.conversationId);
|
|
191
|
+
}).from(juniorAutomationExecutions).innerJoin(latest, eq(latest.automationId, juniorAutomationExecutions.automationId)).where(and(eq(juniorAutomationExecutions.kind, type), eq(juniorAutomationExecutions.namespace, namespace), options.automationIds ? inArray(juniorAutomationExecutions.automationId, options.automationIds) : void 0)).groupBy(juniorAutomationExecutions.automationId, latest.conversationId, latest.status);
|
|
190
192
|
return new Map(rows.map((row) => [row.automationId, {
|
|
193
|
+
lastRunStatus: row.lastRunStatus,
|
|
191
194
|
...row.lastConversationId ? { lastConversationId: row.lastConversationId } : void 0,
|
|
192
195
|
...row.lastExecutedAtMs !== null ? { lastExecutedAtMs: row.lastExecutedAtMs } : void 0,
|
|
193
196
|
runs: {
|
|
@@ -211,7 +214,7 @@ async function readAutomationExecutionDays(dayCount = 90, options = {}) {
|
|
|
211
214
|
costUsd: sql`SUM(${conversationCost})::double precision`,
|
|
212
215
|
date: executionDate,
|
|
213
216
|
kind: juniorAutomationExecutions.kind
|
|
214
|
-
}).from(juniorAutomationExecutions).leftJoin(juniorConversations, eq(juniorConversations.conversationId, juniorAutomationExecutions.conversationId)).where(and(gte(juniorAutomationExecutions.executedAtMs, startMs), lte(juniorAutomationExecutions.executedAtMs, endMs), eq(juniorAutomationExecutions.status, "completed"))).groupBy(executionDate, juniorAutomationExecutions.kind).orderBy(asc(executionDate), asc(juniorAutomationExecutions.kind));
|
|
217
|
+
}).from(juniorAutomationExecutions).leftJoin(juniorConversations, eq(juniorConversations.conversationId, juniorAutomationExecutions.conversationId)).where(and(gte(juniorAutomationExecutions.executedAtMs, startMs), lte(juniorAutomationExecutions.executedAtMs, endMs), eq(juniorAutomationExecutions.status, "completed"), options.access)).groupBy(executionDate, juniorAutomationExecutions.kind).orderBy(asc(executionDate), asc(juniorAutomationExecutions.kind));
|
|
215
218
|
const byDate = /* @__PURE__ */ new Map();
|
|
216
219
|
for (let offset = 0; offset < dayCount; offset += 1) {
|
|
217
220
|
const date = utcDate(startMs + offset * 864e5);
|
|
@@ -240,7 +243,7 @@ async function readAutomationExecutionHours(hourCount = 168, options = {}) {
|
|
|
240
243
|
costUsd: sql`SUM(${conversationCost})::double precision`,
|
|
241
244
|
date: executionHour,
|
|
242
245
|
kind: juniorAutomationExecutions.kind
|
|
243
|
-
}).from(juniorAutomationExecutions).leftJoin(juniorConversations, eq(juniorConversations.conversationId, juniorAutomationExecutions.conversationId)).where(and(gte(juniorAutomationExecutions.executedAtMs, startMs), lte(juniorAutomationExecutions.executedAtMs, endMs), eq(juniorAutomationExecutions.status, "completed"))).groupBy(executionHour, juniorAutomationExecutions.kind).orderBy(asc(executionHour), asc(juniorAutomationExecutions.kind));
|
|
246
|
+
}).from(juniorAutomationExecutions).leftJoin(juniorConversations, eq(juniorConversations.conversationId, juniorAutomationExecutions.conversationId)).where(and(gte(juniorAutomationExecutions.executedAtMs, startMs), lte(juniorAutomationExecutions.executedAtMs, endMs), eq(juniorAutomationExecutions.status, "completed"), options.access)).groupBy(executionHour, juniorAutomationExecutions.kind).orderBy(asc(executionHour), asc(juniorAutomationExecutions.kind));
|
|
244
247
|
const byHour = /* @__PURE__ */ new Map();
|
|
245
248
|
for (let offset = 0; offset < hourCount; offset += 1) {
|
|
246
249
|
const date = new Date(startMs + offset * 36e5).toISOString().slice(0, 13);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-
|
|
2
|
-
import { en as getDb, ht as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-
|
|
1
|
+
import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-Cox1Mgcv.js";
|
|
2
|
+
import { en as getDb, ht as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-BcH6E48y.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--jWf-Nnm.js";
|
|
5
|
+
import { Y as persistConversationMessages } from "./checkpoint-BNfXlq_1.js";
|
|
6
|
+
import { w as getStateAdapter } from "./profile-BdApelHS.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-BX5lJRqW.js";
|
|
2
|
+
import { I as isRecord, t as buildTurnFailureResponse } from "./logging-Cox1Mgcv.js";
|
|
3
3
|
import { b as parseSlackMessageTs } from "./context-0Et9iVSB.js";
|
|
4
|
-
import { Wt as listConversationAnnotations, Zt as getConversationEventStore, en as getDb } from "./agent-hooks-
|
|
5
|
-
import { H as readMessageCardRefs, U as removedCardSchema, W as resolveMessageCards } from "./conversation-
|
|
6
|
-
import { J as hydrateConversationMessages,
|
|
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 { Wt as listConversationAnnotations, Zt as getConversationEventStore, en as getDb } from "./agent-hooks-BcH6E48y.js";
|
|
5
|
+
import { H as readMessageCardRefs, U as removedCardSchema, W as resolveMessageCards } from "./conversation-CPjHYOV5.js";
|
|
6
|
+
import { J as hydrateConversationMessages, st as markConversationMessage } from "./checkpoint-BNfXlq_1.js";
|
|
7
|
+
import { r as clearPendingAuth, s as buildDeterministicTurnId } from "./pending-auth-DQhC3eSR.js";
|
|
8
|
+
import { g as markTurnCompleted, h as markTurnClosed } from "./oauth-authorization-CC8a1JKP.js";
|
|
9
|
+
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-8tXZhu0y.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 { Zt as getConversationEventStore } from "./agent-hooks-
|
|
1
|
+
import { Zt as getConversationEventStore } from "./agent-hooks-BcH6E48y.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-BcH6E48y.js").then((n) => n.Xt)).getConversationStore();
|
|
38
38
|
const chain = await loadConversationChain(args.conversationId, conversationStore);
|
|
39
39
|
let destination;
|
|
40
40
|
let source;
|