@sentry/junior 0.310.0 → 0.311.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-B1wujchl.js +259 -0
- package/dist/{adapter-context-BhKpjpGD.js → adapter-context-G2M0y6rP.js} +2 -2
- package/dist/{admin-tgZEZAk2.js → admin-DCiBhUT1.js} +1 -2
- package/dist/{agent-runner-D9cvNlQl.js → agent-runner-BVHPUIc8.js} +543 -1703
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +7 -6
- package/dist/api.d.ts +21 -3
- package/dist/api.js +1479 -372
- package/dist/{app-B_7Wn0en.d.ts → app-Cw5Vy6H6.d.ts} +14 -3
- package/dist/app.d.ts +2 -2
- package/dist/app.js +232 -506
- package/dist/{background-compaction-queue-BGHqkhkY.js → background-compaction-queue-CJDnWVOJ.js} +4 -4
- package/dist/{briefs-DKxkoruh.js → briefs-BDjnug6Y.js} +3 -3
- package/dist/{catalog-runtime-BxwzbLKY.js → catalog-runtime-DMY3VV-D.js} +1 -1
- package/dist/cli/chat.js +16 -16
- package/dist/cli/check.js +23 -29
- package/dist/cli/init.js +1 -6
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +8 -7
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-Dkt2Le2b.js → config-BrXDQefC.js} +239 -5
- package/dist/{continue-in-slack-BWVwePKD.js → continue-in-slack-DNXSC9So.js} +6 -5
- package/dist/{conversation-M9KZ5JxF.js → conversation-ca__NDQW.js} +47 -8
- package/dist/{conversation-feed-Ci6YD1N-.js → conversation-feed-DkinDu5o.js} +15 -6
- package/dist/{conversation-privacy-C39g8BY4.js → conversation-privacy-DxttrKb9.js} +1 -1
- package/dist/{conversation-turn-CBlZIH02.js → conversation-turn-DWw7Xhdr.js} +41 -38
- package/dist/{credential-sync-vGnrB0BY.js → credential-sync-Bk8wGb8Y.js} +15 -16
- package/dist/{db-B4Hjxr-u.d.ts → db-7ETESH44.d.ts} +3 -1
- package/dist/{db-CFZggNoy.js → db-DTxzH7u5.js} +1609 -1040
- package/dist/{executor-BPkZDx5-.js → executor-DqTiYj9S.js} +450 -99
- package/dist/{html-2r2KmLwi.js → html-B9Sl4Axb.js} +6 -6
- package/dist/{install-C-oE6C_u.js → install-Sg4ePfLl.js} +2 -2
- package/dist/instrumentation.js +3 -3
- package/dist/{lineage-CsvrEFQe.js → lineage-BHAMpNKr.js} +2 -2
- package/dist/{logging-D5gkyvnK.js → logging-FjclQsXu.js} +47 -9
- package/dist/{message-DwvJ-I3w.js → message-CJ7_RL50.js} +5 -8
- package/dist/{model-input-MAq2881y.js → model-input-CMLh4Cwq.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-DIF6Li06.js → oauth-callback-server-RVcbiDjL.js} +2 -2
- package/dist/{oauth-relay-DPE-wrwO.js → oauth-relay-Bu9kkaQu.js} +1 -1
- package/dist/{projection-jZSlEAXG.js → projection-Cns7XwWa.js} +9445 -5574
- package/dist/{prompt-CaMyeCpA.js → prompt-CDqcsDYC.js} +4 -4
- package/dist/{registry-BBkWFCl8.js → registry-BPwuOP2O.js} +5 -8
- package/dist/{resolve-B38MkHXE.js → resolve-BK29bBry.js} +3 -3
- package/dist/rule-DAxQY-1h.js +20 -0
- package/dist/{runner-11h8PrHh.js → runner-BcAE-cJm.js} +10 -10
- package/dist/{sandbox-egress-signals-CTcACAtJ.js → sandbox-egress-signals-C-q0go5b.js} +1 -1
- package/dist/{schedule-DWxZ3kja.js → schedule-BLJ476XQ.js} +209 -43
- package/dist/{schema-obw5jvR4.js → schema-BLgSZXcL.js} +255 -49
- package/dist/{schema-DriSvB40.d.ts → schema-DYcJeV7d.d.ts} +701 -62
- package/dist/{service-account-Zc5bUcIJ.js → service-account-gN0zqf0S.js} +68 -68
- package/dist/{service-account-Bx93N1n1.js → service-account-iJoCtkHR.js} +3 -3
- package/dist/{skills-C8Npu5zO.js → skills-BoZ80epJ.js} +2 -2
- package/dist/{slack-conversation-unfurl-DlRVA02H.js → slack-conversation-unfurl-CogYrITA.js} +8 -10
- package/dist/{spawn-CXr58R0x.js → spawn-Dk92r7mX.js} +5 -6
- package/dist/{state-CGrGVeQC.js → state-DH3Cmgp3.js} +4 -4
- package/dist/{stop-DYzjRf2U.js → stop-CYsfc0Ed.js} +1063 -313
- package/dist/{store-D4FQ1Nml.js → store-DmmMIrQi.js} +5 -5
- package/dist/{task-queue-CaZffYaH.js → task-queue-C_zldF5J.js} +3 -3
- package/dist/{task-runner-Dm7BHbGp.js → task-runner-C7oCJQIx.js} +20 -13
- package/dist/{thread-context-Dyj1KWaY.js → thread-context-BW2BsQbH.js} +13 -11
- package/dist/{turn-session-routing-CD0BRCex.js → turn-session-routing-Xh_2nSQe.js} +52 -54
- package/dist/{validation-DxVNIxA0.js → validation-DrJd0nnq.js} +1 -1
- package/dist/{version-Cr7Z71yG.js → version-CNKZ8owc.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{warmup-C6LOZ2d2.js → warmup-BWdHew2H.js} +14287 -7195
- package/dist/{web-message-id-BT8Mg8LL.js → web-message-id-Ch5dPq-a.js} +32 -144
- package/dist/{worker-CUBtu1Li.js → worker-t9qpu_Zx.js} +7 -8
- package/migrations/0126_artifact_drop_public.sql +8 -0
- package/migrations/0127_artifact_path.sql +4 -0
- package/migrations/0128_artifact_path_index.sql +1 -0
- package/migrations/0129_review_item_answered_index.sql +1 -0
- package/migrations/0130_review_item_status_index.sql +1 -0
- package/migrations/0131_brief_outcome_status.sql +1 -0
- package/migrations/0132_brief_outcome_status_backfill.sql +7 -0
- package/migrations/0133_brief_created_at_index.sql +1 -0
- package/migrations/0134_slack_person_search_index.sql +1 -0
- package/migrations/0135_code_change_size.sql +3 -0
- package/migrations/0136_merge_conflict_notice_dismiss.sql +16 -0
- package/migrations/0137_inbox_snoozes.sql +27 -0
- package/migrations/0138_code_change_search_index.sql +2 -0
- package/migrations/0139_review_item_owner.sql +22 -0
- package/migrations/0140_review_item_owner_index.sql +1 -0
- package/migrations/0141_memory_core_adoption.sql +89 -0
- package/migrations/0142_memory_core_indexes.sql +17 -0
- package/migrations/meta/0126_snapshot.json +5488 -0
- package/migrations/meta/0127_snapshot.json +5519 -0
- package/migrations/meta/0128_snapshot.json +5519 -0
- package/migrations/meta/0129_snapshot.json +5547 -0
- package/migrations/meta/0130_snapshot.json +5563 -0
- package/migrations/meta/0131_snapshot.json +5569 -0
- package/migrations/meta/0132_snapshot.json +5569 -0
- package/migrations/meta/0133_snapshot.json +5590 -0
- package/migrations/meta/0134_snapshot.json +5606 -0
- package/migrations/meta/0135_snapshot.json +5624 -0
- package/migrations/meta/0136_snapshot.json +5624 -0
- package/migrations/meta/0137_snapshot.json +5864 -0
- package/migrations/meta/0138_snapshot.json +5894 -0
- package/migrations/meta/0139_snapshot.json +5898 -0
- package/migrations/meta/0140_snapshot.json +5919 -0
- package/migrations/meta/0141_snapshot.json +6429 -0
- package/migrations/meta/0142_snapshot.json +6457 -0
- package/migrations/meta/_journal.json +120 -1
- package/package.json +6 -7
- package/dist/result-BaqSZcJb.js +0 -548
- package/dist/session-stop-BfY4rhJs.js +0 -4255
- package/dist/turn-user-message-9IxeEv5v.js +0 -364
- package/dist/users-CaUAYMb3.js +0 -181
- package/dist/viewer-AHldghAD.js +0 -212
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as getConversationStore } from "./db-
|
|
2
|
-
import { p as logException } from "./logging-
|
|
3
|
-
import "./background-compaction-queue-
|
|
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-
|
|
1
|
+
import { a as getConversationStore } from "./db-DTxzH7u5.js";
|
|
2
|
+
import { p as logException } from "./logging-FjclQsXu.js";
|
|
3
|
+
import "./background-compaction-queue-CJDnWVOJ.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-Cns7XwWa.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-CogYrITA.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, m as logInfo, p as logException } from "./logging-
|
|
2
|
-
import { i as getChatConfig } from "./config-
|
|
1
|
+
import { h as logWarn, m as logInfo, p as logException } from "./logging-FjclQsXu.js";
|
|
2
|
+
import { i as getChatConfig } from "./config-BrXDQefC.js";
|
|
3
3
|
import "./fan-out-Cod-yEHG.js";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
import pLimit from "p-limit";
|
|
@@ -399,7 +399,7 @@ function pluginTaskCallback() {
|
|
|
399
399
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
400
400
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
401
401
|
run: async (message) => {
|
|
402
|
-
const { processPluginTask } = await import("./task-runner-
|
|
402
|
+
const { processPluginTask } = await import("./task-runner-C7oCJQIx.js").then((n) => n.r);
|
|
403
403
|
await processPluginTask(message);
|
|
404
404
|
},
|
|
405
405
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { E as withSpan } from "./logging-
|
|
5
|
-
import { a as getPersistedThreadState, c as coerceThreadConversationState, t as resolveConversationRouting } from "./turn-session-routing-
|
|
6
|
-
import { i as readActorIdentity } from "./viewer-AHldghAD.js";
|
|
2
|
+
import { Co as getDispatchRecord, Cr as isToolResultError, Da as createPluginLogger, Dr as stripRuntimeTurnContext, Ea as createPluginModelCostRecorder, Ln as getRegistrations, Oa as createPluginTurnEventReader, Tr as normalizeToolNameFromResult, b as hydrateConversationMessages, bl as createPluginCache, da as createPluginEmbedder, fa as createPluginModel, hi as createPluginState, ka as createPluginConversationEvents, mr as getPiMessageRole, st as getTurnRecord, wr as isToolResultMessage, yr as instructionTextForProjection } from "./projection-Cns7XwWa.js";
|
|
3
|
+
import { Pt as readActorIdentity, a as getConversationStore, o as getDb } from "./db-DTxzH7u5.js";
|
|
4
|
+
import { E as withSpan } from "./logging-FjclQsXu.js";
|
|
5
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, t as resolveConversationRouting } from "./turn-session-routing-Xh_2nSQe.js";
|
|
7
6
|
import { v as parseSlackMessageTs } from "./actor-BsBdxDXQ.js";
|
|
8
7
|
import { m as sameActorIdentity } from "./history-CYstOMKX.js";
|
|
9
|
-
import { i as pluginTaskParamsSchema, r as pluginTaskId } from "./task-queue-
|
|
8
|
+
import { i as pluginTaskParamsSchema, r as pluginTaskId } from "./task-queue-C_zldF5J.js";
|
|
9
|
+
import { i as getStateAdapter } from "./adapter-B1wujchl.js";
|
|
10
10
|
import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
|
|
11
|
+
import * as z from "zod";
|
|
11
12
|
import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
|
|
12
13
|
// src/chat/plugins/task-runner.ts
|
|
13
14
|
/**
|
|
@@ -20,11 +21,12 @@ import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
|
|
|
20
21
|
var task_runner_exports = /* @__PURE__ */ __exportAll({ processPluginTask: () => processPluginTask });
|
|
21
22
|
const PLUGIN_MESSAGE_SEND_CONCURRENCY = 5;
|
|
22
23
|
const PLUGIN_TASK_LOCK_TTL_MS = 3e5;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
const textPartSchema = z.object({
|
|
25
|
+
type: z.literal("text"),
|
|
26
|
+
text: z.string()
|
|
27
|
+
});
|
|
26
28
|
function textPart(value) {
|
|
27
|
-
|
|
29
|
+
return textPartSchema.safeParse(value).data?.text;
|
|
28
30
|
}
|
|
29
31
|
function messageText(message) {
|
|
30
32
|
const content = message.content;
|
|
@@ -238,11 +240,16 @@ function taskPluginContext(plugin, message, options = {}) {
|
|
|
238
240
|
run: { async load() {
|
|
239
241
|
return await loadPluginRun(sessionParams);
|
|
240
242
|
} },
|
|
241
|
-
state: createPluginState(pluginName)
|
|
243
|
+
state: createPluginState(pluginName),
|
|
244
|
+
turnEvents: createPluginTurnEventReader({
|
|
245
|
+
conversationId: sessionParams.conversationId,
|
|
246
|
+
plugin,
|
|
247
|
+
turnId: sessionParams.sessionId
|
|
248
|
+
})
|
|
242
249
|
};
|
|
243
250
|
}
|
|
244
251
|
function findPluginTask(message) {
|
|
245
|
-
const plugin =
|
|
252
|
+
const plugin = getRegistrations().find((candidate) => candidate.manifest.name === message.plugin);
|
|
246
253
|
if (!plugin?.tasks || !Object.hasOwn(plugin.tasks, message.name)) return;
|
|
247
254
|
return {
|
|
248
255
|
plugin,
|
|
@@ -252,7 +259,7 @@ function findPluginTask(message) {
|
|
|
252
259
|
/** Schedule all plugin tasks interested in a completed agent-run session. */
|
|
253
260
|
async function scheduleSessionCompletedPluginTasks(params, send) {
|
|
254
261
|
const coreParams = pluginTaskParamsSchema.parse(params);
|
|
255
|
-
const taskRegistrations =
|
|
262
|
+
const taskRegistrations = getRegistrations().flatMap((plugin) => Object.keys(plugin.tasks ?? {}).map((name) => ({
|
|
256
263
|
name,
|
|
257
264
|
plugin
|
|
258
265
|
})));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { E as buildConversationContext,
|
|
1
|
+
import { E as buildConversationContext, X as clearPendingAuth, b as hydrateConversationMessages, co as listConversationAnnotations, j as markConversationMessage } from "./projection-Cns7XwWa.js";
|
|
2
2
|
import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
|
|
3
|
-
import {
|
|
4
|
-
import { o as getDb, r as getConversationEventStore } from "./db-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { _ as getConversationWorkState } from "./store-
|
|
8
|
-
import { a as getPersistedThreadState, c as coerceThreadConversationState, s as persistThreadStateById } from "./turn-session-routing-
|
|
3
|
+
import { b as setSpanAttributes } from "./logging-FjclQsXu.js";
|
|
4
|
+
import { o as getDb, r as getConversationEventStore } from "./db-DTxzH7u5.js";
|
|
5
|
+
import { Q as resolveMessageCards, X as readMessageCardRefs, Z as removedCardSchema } from "./conversation-ca__NDQW.js";
|
|
6
|
+
import { Ar as markTurnClosed, Rr as isAgentInvocationResult, Un as getTurnUserMessageId, jr as markTurnCompleted, zr as listChildMessages } from "./warmup-BWdHew2H.js";
|
|
7
|
+
import { _ as getConversationWorkState } from "./store-DmmMIrQi.js";
|
|
8
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, s as persistThreadStateById } from "./turn-session-routing-Xh_2nSQe.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,12 @@ 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["isError"] || typeof data["toolName"] !== "string"
|
|
31
|
-
|
|
32
|
-
if (
|
|
33
|
-
|
|
30
|
+
if (data.type !== "tool_result" || data["isError"] || typeof data["toolName"] !== "string") continue;
|
|
31
|
+
const details = data["details"];
|
|
32
|
+
if (typeof details !== "object" || details === null) continue;
|
|
33
|
+
if ("timed_out" in details && details.timed_out === true) continue;
|
|
34
|
+
if ("removedCards" in details && Array.isArray(details.removedCards)) for (const ref of removedCardSchema.array().parse(details.removedCards)) selection.deleted.add(JSON.stringify([ref.plugin, ref.key]));
|
|
35
|
+
for (const card of readMessageCardRefs(details)) {
|
|
34
36
|
const key = JSON.stringify([card.plugin, card.key]);
|
|
35
37
|
if (!selection.deleted.has(key) && !selection.cards.has(key)) selection.cards.set(key, card);
|
|
36
38
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { o as getDb
|
|
1
|
+
import { Co as getDispatchRecord, S as persistConversationMessages, _l as JUNIOR_THREAD_STATE_TTL_MS, bo as getDispatchConversationId, xl as createDurableLocationConfigurationService } from "./projection-Cns7XwWa.js";
|
|
2
|
+
import { Y as toOptionalString } from "./logging-FjclQsXu.js";
|
|
3
|
+
import { o as getDb } from "./db-DTxzH7u5.js";
|
|
4
|
+
import { i as getStateAdapter } from "./adapter-B1wujchl.js";
|
|
5
|
+
import * as z from "zod";
|
|
4
6
|
// src/chat/state/conversation.ts
|
|
5
7
|
function defaultConversationState() {
|
|
6
8
|
return {
|
|
@@ -10,64 +12,60 @@ function defaultConversationState() {
|
|
|
10
12
|
vision: { byFileId: {} }
|
|
11
13
|
};
|
|
12
14
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
15
|
+
const nonEmptyString = z.string().refine((value) => value.trim().length > 0);
|
|
16
|
+
const optionalString = nonEmptyString.optional().catch(void 0);
|
|
17
|
+
const optionalNumber = z.number().optional().catch(void 0);
|
|
18
|
+
const pendingAuthCommonFields = {
|
|
19
|
+
provider: nonEmptyString,
|
|
20
|
+
actorId: nonEmptyString,
|
|
21
|
+
sessionId: nonEmptyString,
|
|
22
|
+
linkSentAtMs: z.number(),
|
|
23
|
+
scope: optionalString
|
|
24
|
+
};
|
|
25
|
+
const pendingAuthSchema = z.discriminatedUnion("kind", [z.object({
|
|
26
|
+
...pendingAuthCommonFields,
|
|
27
|
+
kind: z.literal("mcp"),
|
|
28
|
+
authSessionId: nonEmptyString
|
|
29
|
+
}), z.object({
|
|
30
|
+
...pendingAuthCommonFields,
|
|
31
|
+
kind: z.literal("plugin")
|
|
32
|
+
})]);
|
|
33
|
+
const visionSummarySchema = z.object({
|
|
34
|
+
summary: nonEmptyString,
|
|
35
|
+
analyzedAtMs: z.number().refine((value) => value !== 0)
|
|
36
|
+
});
|
|
37
|
+
const storedThreadStateSchema = z.object({ conversation: z.object({
|
|
38
|
+
processing: z.object({
|
|
39
|
+
activeTurnId: optionalString,
|
|
40
|
+
lastCompletedAtMs: optionalNumber,
|
|
41
|
+
pendingAuth: pendingAuthSchema.optional().catch(void 0)
|
|
42
|
+
}).catch({}),
|
|
43
|
+
vision: z.object({
|
|
44
|
+
backfillCompletedAtMs: optionalNumber,
|
|
45
|
+
byFileId: z.record(z.string(), z.unknown()).catch({})
|
|
46
|
+
}).catch({ byFileId: {} })
|
|
47
|
+
}).catch({
|
|
48
|
+
processing: {},
|
|
49
|
+
vision: { byFileId: {} }
|
|
50
|
+
}) });
|
|
39
51
|
/** Safely coerce an unknown persisted value into a ThreadConversationState. */
|
|
40
52
|
function coerceThreadConversationState(value) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
const messages = [];
|
|
45
|
-
const rawProcessing = isRecord(rawConversation["processing"]) ? rawConversation["processing"] : {};
|
|
46
|
-
const processing = {
|
|
47
|
-
activeTurnId: toOptionalString(rawProcessing["activeTurnId"]),
|
|
48
|
-
lastCompletedAtMs: toOptionalNumber(rawProcessing["lastCompletedAtMs"]),
|
|
49
|
-
pendingAuth: coercePendingAuthState(rawProcessing["pendingAuth"])
|
|
50
|
-
};
|
|
51
|
-
const rawVision = isRecord(rawConversation["vision"]) ? rawConversation["vision"] : {};
|
|
52
|
-
const rawVisionByFileId = isRecord(rawVision["byFileId"]) ? rawVision["byFileId"] : {};
|
|
53
|
+
const parsed = storedThreadStateSchema.safeParse(value);
|
|
54
|
+
if (!parsed.success) return defaultConversationState();
|
|
55
|
+
const { processing, vision } = parsed.data.conversation;
|
|
53
56
|
const byFileId = {};
|
|
54
|
-
for (const [fileId,
|
|
55
|
-
if (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (!summary || !analyzedAtMs) continue;
|
|
60
|
-
byFileId[fileId] = {
|
|
61
|
-
summary,
|
|
62
|
-
analyzedAtMs
|
|
63
|
-
};
|
|
57
|
+
for (const [fileId, entry] of Object.entries(vision.byFileId)) {
|
|
58
|
+
if (fileId.trim().length === 0) continue;
|
|
59
|
+
const summary = visionSummarySchema.safeParse(entry);
|
|
60
|
+
if (!summary.success) continue;
|
|
61
|
+
byFileId[fileId] = summary.data;
|
|
64
62
|
}
|
|
65
63
|
return {
|
|
66
64
|
schemaVersion: 1,
|
|
67
|
-
messages,
|
|
65
|
+
messages: [],
|
|
68
66
|
processing,
|
|
69
67
|
vision: {
|
|
70
|
-
backfillCompletedAtMs:
|
|
68
|
+
backfillCompletedAtMs: vision.backfillCompletedAtMs,
|
|
71
69
|
byFileId
|
|
72
70
|
}
|
|
73
71
|
};
|
|
@@ -202,7 +200,7 @@ function slackSourceForDestination(args) {
|
|
|
202
200
|
* Reads parent Conversations when this Conversation has no Destination.
|
|
203
201
|
*/
|
|
204
202
|
async function resolveConversationRouting(args) {
|
|
205
|
-
const conversationStore = args.conversationStore ?? (await import("./db-
|
|
203
|
+
const conversationStore = args.conversationStore ?? (await import("./db-DTxzH7u5.js").then((n) => n.n)).getConversationStore();
|
|
206
204
|
const chain = await loadConversationChain(args.conversationId, conversationStore);
|
|
207
205
|
let destination;
|
|
208
206
|
let source;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DMY3VV-D.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
// src/chat/plugins/validation.ts
|
|
5
5
|
var validation_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.311.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-CNKZ8owc.js";
|