@sentry/junior 0.302.0 → 0.303.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/{adapter-context-Cx9fn9B3.js → adapter-context-BdVnSuY5.js} +2 -2
- package/dist/{admin-_poE5NKL.js → admin-AfeAdS3J.js} +2 -2
- package/dist/{agent-runner-CY9RvsTX.js → agent-runner-BP8_DLUv.js} +2987 -2948
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api.d.ts +13 -12
- package/dist/api.js +207 -80
- package/dist/{app-BpY3wtRP.d.ts → app-Dd9v1mNx.d.ts} +15 -15
- package/dist/app.d.ts +1 -1
- package/dist/app.js +63 -64
- package/dist/{automation-Cva5ZOwW.js → automation-D9MvhOWY.js} +3 -1
- package/dist/{background-compaction-queue-CXFq1_Cz.js → background-compaction-queue-xaE05jxH.js} +6 -6
- package/dist/{briefs-B3NG-pid.js → briefs-D8i-dKTp.js} +4 -4
- package/dist/{catalog-runtime-Dss0lSV6.js → catalog-runtime-d1EM6Z0V.js} +2 -2
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +21 -21
- package/dist/cli/check.js +8 -8
- package/dist/cli/env.d.ts +1 -0
- package/dist/cli/env.js +8 -7
- package/dist/cli/init.js +13 -4
- package/dist/cli/main.js +4 -4
- package/dist/cli/plugins.js +6 -6
- package/dist/cli/snapshot-create.js +7 -5
- package/dist/cli/upgrade.d.ts +2 -2
- package/dist/cli/upgrade.js +5 -5
- package/dist/{config-CzeZiMKs.js → config-oGM7KA9M.js} +44 -63
- package/dist/{connections-CDYhMfrs.js → connections-BlikzEJv.js} +6 -6
- package/dist/{continue-in-slack-7Uf05ndC.js → continue-in-slack-BZnYifiG.js} +5 -5
- package/dist/{conversation-BNXfq6Lb.js → conversation-CY1jnBiC.js} +1 -1
- package/dist/{conversation-feed-Clf_cv0n.js → conversation-feed-BZJRk6UV.js} +1 -1
- package/dist/{conversation-privacy-D9xnM5mK.js → conversation-privacy-Cx515ddM.js} +7 -7
- package/dist/{conversation-turn-D7SEZgTG.js → conversation-turn-DAhRdX4m.js} +20 -23
- package/dist/{credential-sync-DoD0gW-j.js → credential-sync-DfhmWFeo.js} +18 -18
- package/dist/{db-B-gtnNjr.js → db-C-2tFxk3.js} +15 -15
- package/dist/{db-BdsCzytP.d.ts → db-DPqcEM9_.d.ts} +25 -25
- package/dist/{executor-DZg20EqU.js → executor-NVfS8aQ2.js} +14 -8
- package/dist/{history-IjdmO_r6.js → history-UZ3M2M9r.js} +13 -10
- package/dist/{install-t1KQyTUs.js → install-CHLrpRZc.js} +3 -3
- package/dist/instrumentation.d.ts +4 -4
- package/dist/instrumentation.js +10 -10
- package/dist/{lineage-C79GjoQr.js → lineage-HGLhd_-N.js} +2 -2
- package/dist/{logging-C9oDAg4M.js → logging-DiyqRLBx.js} +19 -19
- package/dist/{message-BLUCzJXN.js → message-CkCOcbFH.js} +9 -9
- package/dist/{model-input-5jwNC45G.js → model-input-DmoPPtPE.js} +4 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +7 -7
- package/dist/{oauth-callback-server-BBl66vCb.js → oauth-callback-server-CIf_6YmA.js} +5 -4
- package/dist/{oauth-relay-DRzq73b6.js → oauth-relay-DAmfVmJu.js} +3 -6
- package/dist/{package-discovery-DJhGdS4c.js → package-discovery-x4AvVhMj.js} +1 -1
- package/dist/{plugin-module-Cf5gVPWP.js → plugin-module-Cv2ETe8Y.js} +1 -1
- package/dist/{plugins-BBX07Jzt.js → plugins-Bkk0XRo2.js} +3 -3
- package/dist/{projection-CIBwgD3s.js → projection-DBq8tsA5.js} +221 -173
- package/dist/{prompt-CRQbzp5e.js → prompt-D2KlJopL.js} +4 -4
- package/dist/{queue-CZyYgPF0.d.ts → queue-CbEHUO0l.d.ts} +1 -1
- package/dist/{queue-DtCDaIct.js → queue-DFaOscp5.js} +4 -4
- package/dist/{registry-DdFQHZ_d.js → registry-Bu0Z9BEO.js} +37 -37
- package/dist/{resolve-CdW4BdrK.js → resolve-DXuA3G0g.js} +3 -3
- package/dist/{result-oOMv1t4O.js → result-DpiNseDA.js} +10 -15
- package/dist/rolldown-runtime-BKpuH2hG.js +26 -0
- package/dist/{runner-DqitLtm-.js → runner-iu1heRFv.js} +10 -10
- package/dist/{sandbox-egress-signals-Bw9I0yfJ.js → sandbox-egress-signals-2HFYDcQf.js} +1 -1
- package/dist/{schema-BIFM-U1a.d.ts → schema-DHMOaRzC.d.ts} +520 -13
- package/dist/{schema-DnVQepWP.js → schema-DvfX3Gq_.js} +77 -13
- package/dist/{secrets-DebYU866.js → secrets-DHaJ5TTn.js} +4 -4
- package/dist/{sentry-BRTJqumy.js → sentry-CPbZjomA.js} +3 -28
- package/dist/{sentry-route-name-BhwWnfqj.js → sentry-route-name-C6EIzAGP.js} +1 -1
- package/dist/{service-account-CrZftRTb.js → service-account-BcT5LR7V.js} +47 -47
- package/dist/{service-account-B6mKAPVo.js → service-account-xYkaQTrw.js} +3 -3
- package/dist/{session-stop-DW63Z3kj.js → session-stop-BLLp1IP_.js} +28 -35
- package/dist/{skills-C16fz60Z.js → skills-CNAGH4ju.js} +6 -9
- package/dist/{slack-conversation-unfurl-BHhefEb7.js → slack-conversation-unfurl-DYnqe5ci.js} +10 -15
- package/dist/{spawn-D_RnFYfy.js → spawn-cGasWW33.js} +7 -7
- package/dist/{legacy-web-actor-id-C-cEeWqL.js → state-CDS6h_Wv.js} +32 -32
- package/dist/{stop-7p1i08CY.js → stop-DMMA67yT.js} +221 -139
- package/dist/{store-C28I0CVW.js → store-Dgs7Oe44.js} +5 -5
- package/dist/{task-queue-BVUJbQ28.js → task-queue-DcF0nhhz.js} +3 -3
- package/dist/{task-runner-CWi8j7Z6.js → task-runner-BGXF7Fo7.js} +15 -18
- package/dist/{thread-context-D3-yYUd0.js → thread-context-BPky1KBe.js} +12 -12
- package/dist/{turn-session-routing-BFMS9ATF.js → turn-session-routing-DGvn9MSl.js} +32 -32
- package/dist/{turn-user-message-C3-O8Omt.js → turn-user-message-19CkuUvM.js} +3 -3
- package/dist/{validation-BSFKUIb4.js → validation-lu1DgjNQ.js} +2 -2
- package/dist/vercel.js +1 -1
- package/dist/{version-BHHXNi-0.js → version-Uo3c94Dx.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-B1SO21Qa.js → viewer-BPQHMx3-.js} +3 -3
- package/dist/{warmup-Bz9bzkzN.js → warmup-H8uLvW9e.js} +149 -130
- package/dist/{worker-BspReIIK.js → worker-B-pM_-3K.js} +9 -12
- package/migrations/0109_user_preferences.sql +1 -0
- package/migrations/0110_code_change_repository_state_index.sql +1 -0
- package/migrations/meta/0109_snapshot.json +4925 -0
- package/migrations/meta/0110_snapshot.json +4952 -0
- package/migrations/meta/_journal.json +15 -1
- package/package.json +16 -19
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { p as logException } from "./logging-
|
|
3
|
-
import
|
|
4
|
-
import "./
|
|
1
|
+
import { a as getConversationStore } from "./db-C-2tFxk3.js";
|
|
2
|
+
import { p as logException } from "./logging-DiyqRLBx.js";
|
|
3
|
+
import "./background-compaction-queue-xaE05jxH.js";
|
|
4
|
+
import { At as getConversationWorkStates$1, Bt as recordConversationRetry$1, Dt as dropPendingMessages$1, Et as drainConversationMailbox$1, Ft as listActiveConversationIds$1, Gt as startConversationWork$1, Ht as releaseInboundMessage, It as markConversationWorkEnqueued$1, Jt as takeDeferredConversationMove, Kt as steerWebPendingMessages$1, Mt as hasRunnableConversationWork, Ot as getConversation$1, St as completeConversationWork$1, Ut as requestAnotherSlice$1, Vt as releaseConversationWork$1, Wt as requestConversationWork$1, _t as checkInConversationWork$1, bt as clearExpiredConversationLease$1, ft as ackMessages$1, gt as cancelHumanFacingPendingMessages$1, ht as beginConversationResume$1, kt as getConversationWorkState$1, mt as appendInboundMessage, pt as appendExclusiveInboundMessage, qt as stopConversationWork$1, vt as claimInboundMessage$1, wt as deadLetterAttempt$1, xt as completeConversationStop$1, yt as clearConsumedConversationWake$1, zt as recordAttemptFailure$1 } from "./projection-DBq8tsA5.js";
|
|
5
5
|
// src/chat/task-execution/store.ts
|
|
6
6
|
function metadataStore(options) {
|
|
7
7
|
return options.conversationStore ?? getConversationStore();
|
|
@@ -304,7 +304,7 @@ async function runDeferredMove(args) {
|
|
|
304
304
|
const move = await takeDeferredConversationMove(args);
|
|
305
305
|
if (move === void 0) return;
|
|
306
306
|
try {
|
|
307
|
-
const { continueDeferredSlackClick } = await import("./slack-conversation-unfurl-
|
|
307
|
+
const { continueDeferredSlackClick } = await import("./slack-conversation-unfurl-DYnqe5ci.js").then((n) => n.r);
|
|
308
308
|
await continueDeferredSlackClick(move, args.getSlackAdapter);
|
|
309
309
|
} catch (error) {
|
|
310
310
|
logException(error, "slack.continue_here.deferred.failed", { "gen_ai.conversation.id": args.conversationId });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as logWarn } from "./logging-
|
|
2
|
-
import { a as queueCallback, d as verifyQueueMessage, f as getQueueProvider, l as QUEUE_SIGNATURE_MAX_AGE_MS, u as signQueueMessage } from "./background-compaction-queue-
|
|
1
|
+
import { h as logWarn } from "./logging-DiyqRLBx.js";
|
|
2
|
+
import { a as queueCallback, d as verifyQueueMessage, f as getQueueProvider, l as QUEUE_SIGNATURE_MAX_AGE_MS, u as signQueueMessage } from "./background-compaction-queue-xaE05jxH.js";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
// src/chat/plugins/task-queue.ts
|
|
@@ -60,7 +60,7 @@ function pluginTaskCallback() {
|
|
|
60
60
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
61
61
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
62
62
|
run: async (message) => {
|
|
63
|
-
const { processPluginTask } = await import("./task-runner-
|
|
63
|
+
const { processPluginTask } = await import("./task-runner-BGXF7Fo7.js").then((n) => n.r);
|
|
64
64
|
await processPluginTask(message);
|
|
65
65
|
},
|
|
66
66
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
+
import { Ao as createPluginConversationEvents, Cs as createPluginCache, Dn as instructionTextForProjection, Hi as createPluginState, In as stripRuntimeTurnContext, Mn as isToolResultMessage, Pn as normalizeToolNameFromResult, Sn as getPiMessageRole, ao as createPluginEmbedder, jn as isToolResultError, mr as coreTaskRegistrations, oo as createPluginModel, st as getTurnRecord, ur as getPlugins, v as hydrateConversationMessages, vo as createPluginModelCostRecorder, yo as createPluginLogger } from "./projection-DBq8tsA5.js";
|
|
3
|
+
import { J as getStateAdapter, a as getConversationStore, o as getDb } from "./db-C-2tFxk3.js";
|
|
4
|
+
import { E as withSpan } from "./logging-DiyqRLBx.js";
|
|
5
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, g as getDispatchRecord, t as resolveConversationRouting } from "./turn-session-routing-DGvn9MSl.js";
|
|
6
|
+
import { i as readActorIdentity } from "./viewer-BPQHMx3-.js";
|
|
4
7
|
import { v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { i as readActorIdentity } from "./viewer-B1SO21Qa.js";
|
|
8
|
-
import { a as getPersistedThreadState, c as coerceThreadConversationState, g as getDispatchRecord, t as resolveConversationRouting } from "./turn-session-routing-BFMS9ATF.js";
|
|
9
|
-
import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-BVUJbQ28.js";
|
|
8
|
+
import { m as sameActorIdentity } from "./history-UZ3M2M9r.js";
|
|
9
|
+
import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-DcF0nhhz.js";
|
|
10
10
|
import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
|
|
11
11
|
// src/chat/plugins/task-runner.ts
|
|
12
12
|
/**
|
|
@@ -16,16 +16,13 @@ import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
|
|
|
16
16
|
* bounded run projection rather than live runtime internals or queue
|
|
17
17
|
* payloads.
|
|
18
18
|
*/
|
|
19
|
-
var task_runner_exports = /* @__PURE__ */ __exportAll({
|
|
20
|
-
processPluginTask: () => processPluginTask,
|
|
21
|
-
scheduleSessionCompletedPluginTasks: () => scheduleSessionCompletedPluginTasks
|
|
22
|
-
});
|
|
19
|
+
var task_runner_exports = /* @__PURE__ */ __exportAll({ processPluginTask: () => processPluginTask });
|
|
23
20
|
const PLUGIN_TASK_LOCK_TTL_MS = 3e5;
|
|
24
21
|
function isRecord(value) {
|
|
25
22
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
26
23
|
}
|
|
27
24
|
function textPart(value) {
|
|
28
|
-
if (isRecord(value) && value
|
|
25
|
+
if (isRecord(value) && value["type"] === "text" && typeof value["text"] === "string") return value["text"];
|
|
29
26
|
}
|
|
30
27
|
function messageText(message) {
|
|
31
28
|
const content = message.content;
|
|
@@ -37,11 +34,11 @@ function toolResultText(message) {
|
|
|
37
34
|
const record = message;
|
|
38
35
|
return sanitizeText([
|
|
39
36
|
messageText(message),
|
|
40
|
-
record
|
|
41
|
-
record
|
|
42
|
-
record
|
|
43
|
-
record
|
|
44
|
-
record
|
|
37
|
+
record["output"],
|
|
38
|
+
record["result"],
|
|
39
|
+
record["stdout"],
|
|
40
|
+
record["stderr"],
|
|
41
|
+
record["toolResult"]
|
|
45
42
|
].filter((value) => typeof value === "string" && value.length > 0).join("\n"));
|
|
46
43
|
}
|
|
47
44
|
function sanitizeText(text) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { E as buildConversationContext, X as clearPendingAuth,
|
|
2
|
-
import { B as ProviderError, G as getProviderErrorUserMessage, U as findProviderError, W as getProviderErrorAttributes } from "./config-
|
|
3
|
-
import { K as isRecord, b as setSpanAttributes, t as buildTurnFailureResponse } from "./logging-
|
|
4
|
-
import { o as getDb, r as getConversationEventStore } from "./db-
|
|
5
|
-
import { H as readMessageCardRefs, U as removedCardSchema, W as resolveMessageCards } from "./conversation-
|
|
6
|
-
import { a as getPersistedThreadState, c as coerceThreadConversationState, s as persistThreadStateById } from "./turn-session-routing-
|
|
7
|
-
import { S as listChildMessages, m as markTurnCompleted, n as getTurnUserMessageId, p as markTurnClosed, x as isAgentInvocationResult } from "./turn-user-message-
|
|
8
|
-
import { _ as getConversationWorkState } from "./store-
|
|
1
|
+
import { E as buildConversationContext, X as clearPendingAuth, hs as listConversationAnnotations, j as markConversationMessage, v as hydrateConversationMessages } from "./projection-DBq8tsA5.js";
|
|
2
|
+
import { B as ProviderError, G as getProviderErrorUserMessage, U as findProviderError, W as getProviderErrorAttributes } from "./config-oGM7KA9M.js";
|
|
3
|
+
import { K as isRecord, b as setSpanAttributes, t as buildTurnFailureResponse } from "./logging-DiyqRLBx.js";
|
|
4
|
+
import { o as getDb, r as getConversationEventStore } from "./db-C-2tFxk3.js";
|
|
5
|
+
import { H as readMessageCardRefs, U as removedCardSchema, W as resolveMessageCards } from "./conversation-CY1jnBiC.js";
|
|
6
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, s as persistThreadStateById } from "./turn-session-routing-DGvn9MSl.js";
|
|
7
|
+
import { S as listChildMessages, m as markTurnCompleted, n as getTurnUserMessageId, p as markTurnClosed, x as isAgentInvocationResult } from "./turn-user-message-19CkuUvM.js";
|
|
8
|
+
import { _ as getConversationWorkState } from "./store-Dgs7Oe44.js";
|
|
9
9
|
// src/chat/conversations/pending-cards.ts
|
|
10
10
|
/**
|
|
11
11
|
* Add the cards that tool results selected since the last visible assistant
|
|
@@ -27,10 +27,10 @@ async function selectTurnCards(conversationId, selection, beforeSeq) {
|
|
|
27
27
|
const data = event.data;
|
|
28
28
|
if (data.type === "turn_started") return data.inputMessageIds;
|
|
29
29
|
if (data.type === "message" && data.role === "assistant") return [];
|
|
30
|
-
if (data.type !== "tool_result" || data
|
|
31
|
-
if (data
|
|
32
|
-
if (Array.isArray(data
|
|
33
|
-
for (const card of readMessageCardRefs(data
|
|
30
|
+
if (data.type !== "tool_result" || data["isError"] || typeof data["toolName"] !== "string" || !isRecord(data["details"])) continue;
|
|
31
|
+
if (data["details"]["timed_out"] === true) continue;
|
|
32
|
+
if (Array.isArray(data["details"]["removedCards"])) for (const ref of removedCardSchema.array().parse(data["details"]["removedCards"])) selection.deleted.add(JSON.stringify([ref.plugin, ref.key]));
|
|
33
|
+
for (const card of readMessageCardRefs(data["details"])) {
|
|
34
34
|
const key = JSON.stringify([card.plugin, card.key]);
|
|
35
35
|
if (!selection.deleted.has(key) && !selection.cards.has(key)) selection.cards.set(key, card);
|
|
36
36
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { J as toOptionalString, K as isRecord, _ as runBestEffort, h as logWarn, q as toOptionalNumber } from "./logging-
|
|
4
|
-
import { J as getStateAdapter, at as agentTurnCostUsd, o as getDb, ot as agentTurnTotalTokens } from "./db-
|
|
5
|
-
import { M as juniorConversations, d as juniorAutomationVersions, f as juniorAutomations, u as juniorAutomationRuns } from "./executor-
|
|
6
|
-
import { h as credentialSubjectSchema } from "./registry-
|
|
7
|
-
import { B as automationTaskColumns, H as automationTaskSchema, M as scheduledAutomationSchema, S as automationVersionSchema, V as automationTaskDescription, k as eventAutomationSchema, z as automationSkillNameSchema } from "./automation-
|
|
1
|
+
import { Ai as JUNIOR_THREAD_STATE_TTL_MS, Ea as openSlackDirectMessage, Li as getDashboardTaskLink, b as persistConversationMessages, ga as formatSlackLink, ha as escapeSlackMrkdwnText, ka as postSlackMessage, no as ToolInputError, w as fallbackShortTitle, ws as createDurableLocationConfigurationService } from "./projection-DBq8tsA5.js";
|
|
2
|
+
import { n as botConfig } from "./config-oGM7KA9M.js";
|
|
3
|
+
import { J as toOptionalString, K as isRecord, _ as runBestEffort, h as logWarn, q as toOptionalNumber } from "./logging-DiyqRLBx.js";
|
|
4
|
+
import { J as getStateAdapter, at as agentTurnCostUsd, o as getDb, ot as agentTurnTotalTokens } from "./db-C-2tFxk3.js";
|
|
5
|
+
import { M as juniorConversations, d as juniorAutomationVersions, f as juniorAutomations, u as juniorAutomationRuns } from "./executor-NVfS8aQ2.js";
|
|
6
|
+
import { h as credentialSubjectSchema } from "./registry-Bu0Z9BEO.js";
|
|
7
|
+
import { B as automationTaskColumns, H as automationTaskSchema, M as scheduledAutomationSchema, S as automationVersionSchema, V as automationTaskDescription, k as eventAutomationSchema, z as automationSkillNameSchema } from "./automation-D9MvhOWY.js";
|
|
8
8
|
import * as z from "zod";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
import { and, asc, count, desc, eq, gte, inArray, isNotNull, isNull, lte, max, ne, or, sql } from "drizzle-orm";
|
|
@@ -1466,7 +1466,7 @@ async function markDispatchAwaitingResume(id) {
|
|
|
1466
1466
|
async function recordEventAutomationExecution(previous, next, status) {
|
|
1467
1467
|
if (!next || next.status !== status || previous?.status === status) return;
|
|
1468
1468
|
if (next.plugin !== "junior") return;
|
|
1469
|
-
const eventAutomationId = next.metadata?.eventAutomationId;
|
|
1469
|
+
const eventAutomationId = next.metadata?.["eventAutomationId"];
|
|
1470
1470
|
if (!eventAutomationId) return;
|
|
1471
1471
|
await recordAutomationExecution(eventAutomationId, {
|
|
1472
1472
|
conversationId: getDispatchConversationId(next),
|
|
@@ -1484,7 +1484,7 @@ async function recordEventAutomationExecution(previous, next, status) {
|
|
|
1484
1484
|
*/
|
|
1485
1485
|
async function markDispatchBlocked(id, errorMessage, resultMessageTs) {
|
|
1486
1486
|
const previous = await getDispatchRecord(id);
|
|
1487
|
-
const eventAutomationId = previous?.metadata?.eventAutomationId;
|
|
1487
|
+
const eventAutomationId = previous?.metadata?.["eventAutomationId"];
|
|
1488
1488
|
if (previous?.plugin === "junior" && eventAutomationId && !isTerminalDispatchStatus(previous.status) && await blockEventAutomation(getDb(), eventAutomationId, errorMessage)) await notifyAutomationBlocked({
|
|
1489
1489
|
automationId: eventAutomationId,
|
|
1490
1490
|
dispatchId: id,
|
|
@@ -1560,13 +1560,13 @@ function defaultConversationState() {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
function coercePendingAuthState(value) {
|
|
1562
1562
|
if (!isRecord(value)) return;
|
|
1563
|
-
const kind = value
|
|
1564
|
-
const provider = toOptionalString(value
|
|
1565
|
-
const actorId = toOptionalString(value
|
|
1566
|
-
const authSessionId = toOptionalString(value
|
|
1567
|
-
const scope = toOptionalString(value
|
|
1568
|
-
const sessionId = toOptionalString(value
|
|
1569
|
-
const linkSentAtMs = toOptionalNumber(value
|
|
1563
|
+
const kind = value["kind"];
|
|
1564
|
+
const provider = toOptionalString(value["provider"]);
|
|
1565
|
+
const actorId = toOptionalString(value["actorId"]);
|
|
1566
|
+
const authSessionId = toOptionalString(value["authSessionId"]);
|
|
1567
|
+
const scope = toOptionalString(value["scope"]);
|
|
1568
|
+
const sessionId = toOptionalString(value["sessionId"]);
|
|
1569
|
+
const linkSentAtMs = toOptionalNumber(value["linkSentAtMs"]);
|
|
1570
1570
|
if (kind !== "mcp" && kind !== "plugin" || !provider || !actorId || kind === "mcp" && !authSessionId || !sessionId || typeof linkSentAtMs !== "number") return;
|
|
1571
1571
|
const base = {
|
|
1572
1572
|
provider,
|
|
@@ -1590,20 +1590,20 @@ function coerceThreadConversationState(value) {
|
|
|
1590
1590
|
const root = value;
|
|
1591
1591
|
const rawConversation = isRecord(root.conversation) ? root.conversation : {};
|
|
1592
1592
|
const messages = [];
|
|
1593
|
-
const rawProcessing = isRecord(rawConversation
|
|
1593
|
+
const rawProcessing = isRecord(rawConversation["processing"]) ? rawConversation["processing"] : {};
|
|
1594
1594
|
const processing = {
|
|
1595
|
-
activeTurnId: toOptionalString(rawProcessing
|
|
1596
|
-
lastCompletedAtMs: toOptionalNumber(rawProcessing
|
|
1597
|
-
pendingAuth: coercePendingAuthState(rawProcessing
|
|
1595
|
+
activeTurnId: toOptionalString(rawProcessing["activeTurnId"]),
|
|
1596
|
+
lastCompletedAtMs: toOptionalNumber(rawProcessing["lastCompletedAtMs"]),
|
|
1597
|
+
pendingAuth: coercePendingAuthState(rawProcessing["pendingAuth"])
|
|
1598
1598
|
};
|
|
1599
|
-
const rawVision = isRecord(rawConversation
|
|
1600
|
-
const rawVisionByFileId = isRecord(rawVision
|
|
1599
|
+
const rawVision = isRecord(rawConversation["vision"]) ? rawConversation["vision"] : {};
|
|
1600
|
+
const rawVisionByFileId = isRecord(rawVision["byFileId"]) ? rawVision["byFileId"] : {};
|
|
1601
1601
|
const byFileId = {};
|
|
1602
1602
|
for (const [fileId, value] of Object.entries(rawVisionByFileId)) {
|
|
1603
1603
|
if (typeof fileId !== "string" || fileId.trim().length === 0) continue;
|
|
1604
1604
|
if (!isRecord(value)) continue;
|
|
1605
|
-
const summary = toOptionalString(value
|
|
1606
|
-
const analyzedAtMs = toOptionalNumber(value
|
|
1605
|
+
const summary = toOptionalString(value["summary"]);
|
|
1606
|
+
const analyzedAtMs = toOptionalNumber(value["analyzedAtMs"]);
|
|
1607
1607
|
if (!summary || !analyzedAtMs) continue;
|
|
1608
1608
|
byFileId[fileId] = {
|
|
1609
1609
|
summary,
|
|
@@ -1615,7 +1615,7 @@ function coerceThreadConversationState(value) {
|
|
|
1615
1615
|
messages,
|
|
1616
1616
|
processing,
|
|
1617
1617
|
vision: {
|
|
1618
|
-
backfillCompletedAtMs: toOptionalNumber(rawVision
|
|
1618
|
+
backfillCompletedAtMs: toOptionalNumber(rawVision["backfillCompletedAtMs"]),
|
|
1619
1619
|
byFileId
|
|
1620
1620
|
}
|
|
1621
1621
|
};
|
|
@@ -1643,9 +1643,9 @@ function buildThreadStatePayload(patch) {
|
|
|
1643
1643
|
const payload = {};
|
|
1644
1644
|
if (patch.conversation) Object.assign(payload, buildConversationStatePatch(patch.conversation));
|
|
1645
1645
|
if (patch.sandboxRef !== void 0) {
|
|
1646
|
-
payload
|
|
1647
|
-
payload
|
|
1648
|
-
payload
|
|
1646
|
+
payload["app_sandbox_id"] = patch.sandboxRef?.id ?? "";
|
|
1647
|
+
payload["app_sandbox_dependency_profile_hash"] = patch.sandboxRef?.profileHash ?? "";
|
|
1648
|
+
payload["app_sandbox_workspace_id"] = patch.sandboxRef?.workspaceId ?? "";
|
|
1649
1649
|
}
|
|
1650
1650
|
return payload;
|
|
1651
1651
|
}
|
|
@@ -1667,10 +1667,10 @@ async function mergePersistedState(key, payload) {
|
|
|
1667
1667
|
}
|
|
1668
1668
|
/** Extract persisted sandbox metadata from thread state payload. */
|
|
1669
1669
|
function getPersistedSandboxState(state) {
|
|
1670
|
-
const id = toOptionalString(state
|
|
1670
|
+
const id = toOptionalString(state["app_sandbox_id"]);
|
|
1671
1671
|
if (!id) return;
|
|
1672
|
-
const profileHash = toOptionalString(state
|
|
1673
|
-
const workspaceId = toOptionalString(state
|
|
1672
|
+
const profileHash = toOptionalString(state["app_sandbox_dependency_profile_hash"]);
|
|
1673
|
+
const workspaceId = toOptionalString(state["app_sandbox_workspace_id"]);
|
|
1674
1674
|
return {
|
|
1675
1675
|
id,
|
|
1676
1676
|
...profileHash ? { profileHash } : void 0,
|
|
@@ -1750,7 +1750,7 @@ function slackSourceForDestination(args) {
|
|
|
1750
1750
|
* Reads parent Conversations when this Conversation has no Destination.
|
|
1751
1751
|
*/
|
|
1752
1752
|
async function resolveConversationRouting(args) {
|
|
1753
|
-
const conversationStore = args.conversationStore ?? (await import("./db-
|
|
1753
|
+
const conversationStore = args.conversationStore ?? (await import("./db-C-2tFxk3.js").then((n) => n.n)).getConversationStore();
|
|
1754
1754
|
const chain = await loadConversationChain(args.conversationId, conversationStore);
|
|
1755
1755
|
let destination;
|
|
1756
1756
|
let source;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Yt as readInboundMessageSender } from "./projection-
|
|
1
|
+
import { Yt as readInboundMessageSender } from "./projection-DBq8tsA5.js";
|
|
2
2
|
import { v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
|
|
3
|
-
import { r as getConversationEventStore, s as getSqlExecutor } from "./db-
|
|
4
|
-
import { g as juniorAgentInvocations } from "./executor-
|
|
3
|
+
import { r as getConversationEventStore, s as getSqlExecutor } from "./db-C-2tFxk3.js";
|
|
4
|
+
import { g as juniorAgentInvocations } from "./executor-NVfS8aQ2.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { inArray } from "drizzle-orm";
|
|
7
7
|
// src/chat/state/turn-id.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-d1EM6Z0V.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
// src/chat/plugins/validation.ts
|
|
5
5
|
var validation_exports = /* @__PURE__ */ __exportAll({
|
package/dist/vercel.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
function juniorVercelConfig(options = {}) {
|
|
8
8
|
const buildCommand = options.buildCommand === void 0 ? "pnpm exec junior upgrade && pnpm build" : options.buildCommand;
|
|
9
9
|
const config = { framework: "nitro" };
|
|
10
|
-
if (buildCommand !== null) config
|
|
10
|
+
if (buildCommand !== null) config["buildCommand"] = buildCommand;
|
|
11
11
|
return config;
|
|
12
12
|
}
|
|
13
13
|
export { juniorVercelConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.303.0";
|
|
3
3
|
// src/version.ts
|
|
4
4
|
/** Installed Junior package version, or `unknown` when package metadata is unavailable. */
|
|
5
5
|
const JUNIOR_VERSION = typeof version === "string" && version.trim() ? version : "unknown";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as JUNIOR_VERSION } from "./version-
|
|
1
|
+
export { t as JUNIOR_VERSION } from "./version-Uo3c94Dx.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { N as
|
|
3
|
-
import {
|
|
1
|
+
import { N as findActorIdentityId, U as clearCachedUser, W as readCachedUserByEmail, o as getDb } from "./db-C-2tFxk3.js";
|
|
2
|
+
import { N as juniorIdentities, P as juniorUsers } from "./executor-NVfS8aQ2.js";
|
|
3
|
+
import { G as normalizeIdentityEmail, U as GOOGLE_IDENTITY_PROVIDER } from "./logging-DiyqRLBx.js";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
5
|
import { and, asc, eq, inArray, isNotNull } from "drizzle-orm";
|
|
6
6
|
import { identitySchema, userSchema } from "@sentry/junior-plugin-api";
|