@sentry/junior 0.228.0 → 0.230.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-DUQ3ASdp.js → agent-hooks-Im1UUKhZ.js} +10 -10
- package/dist/{agent-runner-CIesujf5.js → agent-runner-B9dvsdM8.js} +52 -37
- package/dist/api/schema.d.ts +20 -269
- package/dist/api/schema.js +3 -3
- package/dist/api.js +18 -18
- package/dist/{app-BRZB3MuD.d.ts → app-xk2-Id1T.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +22 -21
- package/dist/{briefs-BTrVMqUg.js → briefs-BC3DPfsh.js} +4 -4
- package/dist/{catalog-runtime-NOBDOyJi.js → catalog-runtime-Blx7IGY9.js} +1 -1
- package/dist/{checkpoint-CzN3gXoB.js → checkpoint-BDaS7x3C.js} +7 -9
- 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-C6VUBzL_.js → client-DucHsb6b.js} +3 -5
- package/dist/{config-BLPaWN1Q.js → config-HqsfInxG.js} +2 -2
- package/dist/{conversation-DOI6Y60M.js → conversation-DsuDtoYR.js} +96 -74
- package/dist/{conversation-privacy-DJ88ECSq.js → conversation-privacy-k2Ucs1Lg.js} +1 -1
- package/dist/{credential-sync-OKs419AB.js → credential-sync-DEF6P_Qr.js} +13 -13
- package/dist/{executor-DZVZBfmX.js → executor-C-LEhjeD.js} +1 -1
- package/dist/history-DvqWZlYX.d.ts +86 -0
- package/dist/{images-D3x6EemU.js → images-owPAu3eq.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-BuSPM0cX.js → job-queue-CpNnv-n1.js} +1 -1
- package/dist/{logging-Blgn76r3.js → logging-BO1fVUQe.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-t-NPqTNB.js → oauth-authorization-DPPpHxSI.js} +1 -1
- package/dist/{oauth-callback-server-BP7SgTcu.js → oauth-callback-server-BvVXBrQt.js} +2 -2
- package/dist/{pending-auth-CXLwmDaG.js → pending-auth-BWgfMCZE.js} +1 -1
- package/dist/{profile-a5xmeUHf.js → profile-DpHUuqjR.js} +4 -4
- package/dist/{prompt-9C-wUwwx.js → prompt-D5RPLy92.js} +1 -1
- package/dist/{registry-BUbczT2k.js → registry-CIi9NkkR.js} +1 -1
- package/dist/{resolve-3PhWSiEF.js → resolve-SohTTVYa.js} +2 -2
- package/dist/{runner-CsnuKcsq.js → runner-JhOJ60On.js} +9 -9
- package/dist/{sandbox-egress-signals-D34sI4J6.js → sandbox-egress-signals-DyO-LeUT.js} +1 -1
- package/dist/{schema-CXmCvVLn.js → schema-B-Taar1W.js} +1 -1
- package/dist/{skills-CLgyYrgF.js → skills-DElnSC0r.js} +2 -2
- package/dist/{spawn-CS56i7Nm.js → spawn-DrH6CP9W.js} +2 -2
- package/dist/{task-queue-C2sTDXqQ.js → task-queue-BEzJHMbQ.js} +3 -3
- package/dist/{task-runner-uSodiP4v.js → task-runner-DrC1UgCK.js} +9 -9
- package/dist/{thread-state-BurqeqMv.js → thread-state-BIXM2uhZ.js} +5 -5
- package/dist/{turn-failure-response-Bshcqa0a.js → turn-failure-response-9Ql2NYKh.js} +17 -15
- package/dist/{turn-lifecycle-foKlVl_T.js → turn-lifecycle-_YDXUFqj.js} +1 -1
- package/dist/{turn-session-routing-DDUMJ2GY.js → turn-session-routing-DYxwlqQl.js} +1 -1
- package/dist/{validation-DZc56dXw.js → validation-_gPdrVG7.js} +1 -1
- package/dist/{version-y4cRp5Y2.js → version-Y7rGnMXG.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-BfVYx0t1.js → web-authorization-COF8MUa5.js} +6 -6
- package/dist/{web-input-B6FZlrgg.js → web-input-BmLFoSUw.js} +49 -31
- package/dist/{work-Dy8sW9MZ.js → work-CP3L3bNf.js} +7 -7
- package/dist/{worker-BH0RP7Hj.js → worker-DlZMqtCm.js} +5 -5
- package/package.json +5 -5
- package/dist/history-H-SI5Dej.d.ts +0 -128
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Cn as createUserTokenStore, T as lookupSlackUserProfile, _ as putMcpStoredOAuthCredentials, d as deleteMcpAuthSession, dn as resolveBaseUrl, ft as getMcpProviderErrorAttributes, g as getMcpStoredOAuthCredentials, h as getMcpAuthSession, ln as formatProviderLabel, u as finalizeMcpAuthorization, un as parseOAuthStatePayload, x as resolvePluginOAuthAccount, yn as postSlackMessage } from "./agent-runner-
|
|
2
|
-
import {
|
|
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 createUserTokenStore, T as lookupSlackUserProfile, _ as putMcpStoredOAuthCredentials, d as deleteMcpAuthSession, dn as resolveBaseUrl, ft as getMcpProviderErrorAttributes, g as getMcpStoredOAuthCredentials, h as getMcpAuthSession, ln as formatProviderLabel, u as finalizeMcpAuthorization, un as parseOAuthStatePayload, x as resolvePluginOAuthAccount, yn as postSlackMessage } from "./agent-runner-B9dvsdM8.js";
|
|
2
|
+
import { f as escapeXml } from "./client-DucHsb6b.js";
|
|
3
|
+
import { d as logException, h as runBestEffort, p as logWarn } from "./logging-BO1fVUQe.js";
|
|
4
|
+
import { n as botConfig, o as getRuntimeMetadata } from "./config-HqsfInxG.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-Im1UUKhZ.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-CIi9NkkR.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Blx7IGY9.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-DElnSC0r.js";
|
|
11
|
+
import { B as recordAuthorizationCompleted, s as getTurnRecord, z as recordAuthenticationLinked } from "./checkpoint-BDaS7x3C.js";
|
|
12
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-DpHUuqjR.js";
|
|
13
|
+
import { i as getConversationPendingAuth } from "./pending-auth-BWgfMCZE.js";
|
|
14
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-BIXM2uhZ.js";
|
|
15
|
+
import { n as deleteWebAuthorization, o as wakeAuthorizedTurn, s as wakePausedTurn } from "./web-authorization-COF8MUa5.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-HqsfInxG.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";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ConversationAnnotation, OwnedObjectAnnotation } from "@sentry/junior-plugin-api";
|
|
3
|
+
//#region src/chat/attachments/input.d.ts
|
|
4
|
+
/** Bound JSON image input below the hosting platform's request size limit. */
|
|
5
|
+
declare const MAX_INPUT_IMAGE_BYTES: number;
|
|
6
|
+
declare const MAX_INPUT_IMAGES = 3;
|
|
7
|
+
/** Image bytes accepted with a web message, never stored in its mailbox row. */
|
|
8
|
+
declare const inputImageSchema: z.ZodObject<{
|
|
9
|
+
filename: z.ZodString;
|
|
10
|
+
contentType: z.ZodEnum<{
|
|
11
|
+
"image/png": "image/png";
|
|
12
|
+
"image/jpeg": "image/jpeg";
|
|
13
|
+
"image/gif": "image/gif";
|
|
14
|
+
"image/webp": "image/webp";
|
|
15
|
+
}>;
|
|
16
|
+
data: z.ZodString;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
type InputImage = z.output<typeof inputImageSchema>;
|
|
19
|
+
/** Safe attachment facts shared by mailbox input and transcript messages. */
|
|
20
|
+
declare const messageAttachmentSchema: z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
filename: z.ZodString;
|
|
23
|
+
contentType: z.ZodString;
|
|
24
|
+
bytes: z.ZodNumber;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
type MessageAttachment = z.output<typeof messageAttachmentSchema>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/chat/automations/card.d.ts
|
|
29
|
+
/** Saved automation facts shown with a Message, not a live status view. */
|
|
30
|
+
declare const automationCardSchema: z.ZodObject<{
|
|
31
|
+
kind: z.ZodLiteral<"automation">;
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
title: z.ZodString;
|
|
34
|
+
url: z.ZodNullable<z.ZodString>;
|
|
35
|
+
instruction: z.ZodString;
|
|
36
|
+
trigger: z.ZodString;
|
|
37
|
+
warning: z.ZodNullable<z.ZodString>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
type AutomationCard = z.output<typeof automationCardSchema>;
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/chat/conversations/cards.d.ts
|
|
42
|
+
/** Facts for delivery and display. Messages store only references. */
|
|
43
|
+
type MessageCard = OwnedObjectAnnotation | AutomationCard;
|
|
44
|
+
/** Render each built-in card with its own text format. */
|
|
45
|
+
declare function messageCardText(card: MessageCard): string;
|
|
46
|
+
/** Store only the annotation identity with a Message. */
|
|
47
|
+
declare const messageCardRefSchema: z.ZodObject<{
|
|
48
|
+
plugin: z.ZodString;
|
|
49
|
+
key: z.ZodString;
|
|
50
|
+
kind: z.ZodLiteral<"object">;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
type MessageCardRef = z.output<typeof messageCardRefSchema>;
|
|
53
|
+
/** Resolve current saved facts without fetching providers or changing history. */
|
|
54
|
+
declare function resolveMessageCards(refs: readonly MessageCardRef[], annotations: readonly ConversationAnnotation[]): OwnedObjectAnnotation[];
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/chat/conversations/history.d.ts
|
|
57
|
+
/** Where a failed turn stopped. */
|
|
58
|
+
declare const conversationTurnFailureCodeSchema: z.ZodEnum<{
|
|
59
|
+
agent_run_failed: "agent_run_failed";
|
|
60
|
+
delivery_failed: "delivery_failed";
|
|
61
|
+
model_execution_failed: "model_execution_failed";
|
|
62
|
+
persistence_failed: "persistence_failed";
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* Why a failed turn stopped.
|
|
66
|
+
* Values are fixed labels only. Do not store raw exception text.
|
|
67
|
+
*/
|
|
68
|
+
declare const conversationTurnFailureReasonSchema: z.ZodEnum<{
|
|
69
|
+
unknown: "unknown";
|
|
70
|
+
capacity: "capacity";
|
|
71
|
+
auth: "auth";
|
|
72
|
+
permission: "permission";
|
|
73
|
+
rate_limit: "rate_limit";
|
|
74
|
+
timeout: "timeout";
|
|
75
|
+
network: "network";
|
|
76
|
+
server: "server";
|
|
77
|
+
invalid_request: "invalid_request";
|
|
78
|
+
invalid_response: "invalid_response";
|
|
79
|
+
quota: "quota";
|
|
80
|
+
content_policy: "content_policy";
|
|
81
|
+
empty_output: "empty_output";
|
|
82
|
+
tool_errors: "tool_errors";
|
|
83
|
+
suppressed_output: "suppressed_output";
|
|
84
|
+
}>;
|
|
85
|
+
//#endregion
|
|
86
|
+
export { resolveMessageCards as a, MAX_INPUT_IMAGES as c, messageCardText as i, MAX_INPUT_IMAGE_BYTES as l, conversationTurnFailureReasonSchema as n, AutomationCard as o, MessageCard as r, InputImage as s, conversationTurnFailureCodeSchema as t, MessageAttachment as u };
|
|
@@ -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-B9dvsdM8.js";
|
|
3
|
+
import { tn as getSqlExecutor } from "./agent-hooks-Im1UUKhZ.js";
|
|
4
|
+
import "./conversation-DsuDtoYR.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-BO1fVUQe.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-k2Ucs1Lg.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-HqsfInxG.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-Y7rGnMXG.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-xk2-Id1T.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-BO1fVUQe.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-CpNnv-n1.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-BEzJHMbQ.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-BDaS7x3C.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 { Cn as createUserTokenStore } from "./agent-runner-
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { Cn as createUserTokenStore } from "./agent-runner-B9dvsdM8.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-DEF6P_Qr.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-BDaS7x3C.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 {
|
|
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-DucHsb6b.js";
|
|
2
|
+
import { v as setSpanAttributes, y as setSpanStatus } from "./logging-BO1fVUQe.js";
|
|
3
|
+
import { a as getChatConfig } from "./config-HqsfInxG.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Blx7IGY9.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 {
|
|
1
|
+
import { I as briefOutcomeStatusSchema, L as conversationBriefSchema, R as parseBriefInput } from "./conversation-DsuDtoYR.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-BO1fVUQe.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-BO1fVUQe.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-DpHUuqjR.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-BO1fVUQe.js";
|
|
2
2
|
import { t as credentialContextForActor } from "./context-0Et9iVSB.js";
|
|
3
|
-
import { $t as getConversationStore, Zt as getConversationEventStore } from "./agent-hooks-
|
|
4
|
-
import {
|
|
5
|
-
import { A as commitAcceptedReply, B as recordAuthorizationCompleted, J as hydrateConversationMessages, P as loadProjection, Y as persistConversationMessages, ct as markConversationMessage, ft as upsertConversationMessage, lt as normalizeConversationText, r as saveTurnCheckpoint, rt as buildConversationContext, u as persistWithRetry, ut as recordDeliveredAssistantMessage } 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 { $t as getConversationStore, Zt as getConversationEventStore } from "./agent-hooks-Im1UUKhZ.js";
|
|
4
|
+
import { V as messageCardText } from "./conversation-DsuDtoYR.js";
|
|
5
|
+
import { A as commitAcceptedReply, B as recordAuthorizationCompleted, J as hydrateConversationMessages, P as loadProjection, Y as persistConversationMessages, ct as markConversationMessage, ft as upsertConversationMessage, lt as normalizeConversationText, r as saveTurnCheckpoint, rt as buildConversationContext, u as persistWithRetry, ut as recordDeliveredAssistantMessage } from "./checkpoint-BDaS7x3C.js";
|
|
6
|
+
import { _ as markTurnFailed, r as getAssistantReplyText, t as authorizationId, v as startActiveTurn } from "./oauth-authorization-DPPpHxSI.js";
|
|
7
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-DrC1UgCK.js";
|
|
8
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-_YDXUFqj.js";
|
|
9
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-BIXM2uhZ.js";
|
|
10
|
+
import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-9Ql2NYKh.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 { cn as sandboxEgressSignalsResponseSchema } from "./agent-runner-
|
|
1
|
+
import { cn as sandboxEgressSignalsResponseSchema } from "./agent-runner-B9dvsdM8.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-DsuDtoYR.js";
|
|
3
3
|
import { a as fillUtcHours, c as sumUtcHoursIntoSixHours, i as fillUtcDays } from "./web-message-id-xPI_EFSC.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { codeChangeStateSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { p as logWarn } from "./logging-
|
|
2
|
+
import { p as logWarn } from "./logging-BO1fVUQe.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-Blx7IGY9.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 { Dn as toolInvocationDestination, En as actorFromRun } from "./agent-runner-
|
|
3
|
-
import { n as createAndEnqueueAgentInvocation } from "./work-
|
|
2
|
+
import { Dn as toolInvocationDestination, En as actorFromRun } from "./agent-runner-B9dvsdM8.js";
|
|
3
|
+
import { n as createAndEnqueueAgentInvocation } from "./work-CP3L3bNf.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-BO1fVUQe.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-CpNnv-n1.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-DrC1UgCK.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-BO1fVUQe.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 {
|
|
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-Im1UUKhZ.js";
|
|
5
|
+
import { E as juniorConversations, s as juniorAutomationExecutions } from "./executor-C-LEhjeD.js";
|
|
6
|
+
import { rt as sameActorIdentity } from "./conversation-DsuDtoYR.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-BDaS7x3C.js";
|
|
8
|
+
import { w as getStateAdapter } from "./profile-DpHUuqjR.js";
|
|
9
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-BIXM2uhZ.js";
|
|
10
|
+
import { t as resolveConversationRouting } from "./turn-session-routing-DYxwlqQl.js";
|
|
11
|
+
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-BEzJHMbQ.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 { 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-BO1fVUQe.js";
|
|
2
|
+
import { en as getDb, ht as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-Im1UUKhZ.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-C-LEhjeD.js";
|
|
5
|
+
import { Y as persistConversationMessages } from "./checkpoint-BDaS7x3C.js";
|
|
6
|
+
import { w as getStateAdapter } from "./profile-DpHUuqjR.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
import { and, eq, sql } from "drizzle-orm";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { _ as
|
|
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-DucHsb6b.js";
|
|
2
|
+
import { I as isRecord, t as buildTurnFailureResponse } from "./logging-BO1fVUQe.js";
|
|
3
3
|
import { b as parseSlackMessageTs } from "./context-0Et9iVSB.js";
|
|
4
|
-
import { Zt as getConversationEventStore } from "./agent-hooks-
|
|
5
|
-
import {
|
|
6
|
-
import { J as hydrateConversationMessages, ct 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 { Wt as listConversationAnnotations, Zt as getConversationEventStore, en as getDb } from "./agent-hooks-Im1UUKhZ.js";
|
|
5
|
+
import { H as readMessageCardRefs, U as removedCardSchema, W as resolveMessageCards } from "./conversation-DsuDtoYR.js";
|
|
6
|
+
import { J as hydrateConversationMessages, ct as markConversationMessage } from "./checkpoint-BDaS7x3C.js";
|
|
7
|
+
import { r as clearPendingAuth, s as buildDeterministicTurnId } from "./pending-auth-BWgfMCZE.js";
|
|
8
|
+
import { g as markTurnCompleted, h as markTurnClosed } from "./oauth-authorization-DPPpHxSI.js";
|
|
9
|
+
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-BIXM2uhZ.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) {
|
|
13
13
|
const cards = /* @__PURE__ */ new Map();
|
|
14
14
|
const deleted = /* @__PURE__ */ new Set();
|
|
15
15
|
let beforeSeq;
|
|
16
|
-
while (true) {
|
|
16
|
+
selection: while (true) {
|
|
17
17
|
const page = await getConversationEventStore().query(conversationId, {
|
|
18
18
|
beforeSeq,
|
|
19
19
|
limit: 100,
|
|
@@ -25,18 +25,20 @@ async function loadPendingMessageCards(conversationId) {
|
|
|
25
25
|
});
|
|
26
26
|
for (const event of [...page.events].reverse()) {
|
|
27
27
|
const data = event.data;
|
|
28
|
-
if (data.type === "turn_started" || data.type === "message" && data.role === "assistant")
|
|
28
|
+
if (data.type === "turn_started" || data.type === "message" && data.role === "assistant") break selection;
|
|
29
29
|
if (data.type !== "tool_result" || data.isError || typeof data.toolName !== "string" || !isRecord(data.details)) continue;
|
|
30
30
|
if (data.details.timed_out === true) continue;
|
|
31
|
-
if (Array.isArray(data.details.removedCards)) for (const ref of
|
|
32
|
-
for (const card of
|
|
33
|
-
const key =
|
|
31
|
+
if (Array.isArray(data.details.removedCards)) for (const ref of removedCardSchema.array().parse(data.details.removedCards)) deleted.add(JSON.stringify([ref.plugin, ref.key]));
|
|
32
|
+
for (const card of readMessageCardRefs(data.details)) {
|
|
33
|
+
const key = JSON.stringify([card.plugin, card.key]);
|
|
34
34
|
if (!deleted.has(key) && !cards.has(key)) cards.set(key, card);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
if (!page.hasOlder || page.events.length === 0)
|
|
37
|
+
if (!page.hasOlder || page.events.length === 0) break;
|
|
38
38
|
beforeSeq = page.events[0].seq;
|
|
39
39
|
}
|
|
40
|
+
if (cards.size === 0) return [];
|
|
41
|
+
return resolveMessageCards([...cards.values()].reverse(), await listConversationAnnotations(getDb(), conversationId));
|
|
40
42
|
}
|
|
41
43
|
//#endregion
|
|
42
44
|
//#region src/chat/interruption-marker.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Zt as getConversationEventStore } from "./agent-hooks-
|
|
1
|
+
import { Zt as getConversationEventStore } from "./agent-hooks-Im1UUKhZ.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-Im1UUKhZ.js").then((n) => n.Xt)).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-Blx7IGY9.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-Y7rGnMXG.js";
|
|
2
2
|
export { JUNIOR_VERSION };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Ht as requestConversationWork, Mt as ensureConversationWake } from "./agent-runner-
|
|
2
|
-
import { Zt as getConversationEventStore } from "./agent-hooks-
|
|
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 { Ht as requestConversationWork, Mt as ensureConversationWake } from "./agent-runner-B9dvsdM8.js";
|
|
2
|
+
import { Zt as getConversationEventStore } from "./agent-hooks-Im1UUKhZ.js";
|
|
3
|
+
import { n as loadTurnCheckpoint, o as failTurnRecord, s as getTurnRecord } from "./checkpoint-BDaS7x3C.js";
|
|
4
|
+
import { w as getStateAdapter } from "./profile-DpHUuqjR.js";
|
|
5
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-CpNnv-n1.js";
|
|
6
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-DYxwlqQl.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
//#region src/chat/task-execution/authorized-turn.ts
|