@sentry/junior 0.288.0 → 0.289.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-Cikcqdty.js → adapter-tE1wnl0T.js} +1 -1
- package/dist/{admin-BcSxHuTB.js → admin-BmsPbmO_.js} +2 -2
- package/dist/{agent-runner-9MXyWUL8.js → agent-runner-bvl8U5uH.js} +343 -103
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -7
- package/dist/api.d.ts +1 -1
- package/dist/api.js +281 -254
- package/dist/{app-BUklJVBe.d.ts → app-Cu454FXq.d.ts} +2 -4
- package/dist/app.d.ts +1 -1
- package/dist/app.js +92 -64
- package/dist/assistant-reply-1N9oxyyb.js +58 -0
- package/dist/{automation-DDXwHQs5.js → automation-DWbjJltM.js} +1 -1
- package/dist/{background-compaction-queue-CjllSPir.js → background-compaction-queue-D36oCldp.js} +4 -4
- package/dist/{briefs-DW9iuolG.js → briefs-CV-1qkXa.js} +3 -4
- package/dist/{catalog-runtime-B3gfH58M.js → catalog-runtime-BNK4uJVZ.js} +1 -1
- package/dist/cli/chat.js +14 -14
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-CLJcyYEF.js → config-DHAy7XlP.js} +4 -41
- package/dist/{connections-BtdJftow.js → connections-C3VmH3cf.js} +7 -129
- package/dist/{conversation-DhoqHtQ7.js → conversation-CwC8K3RZ.js} +8 -8
- package/dist/{conversation-pending-messages-DHV0S4uF.js → conversation-pending-messages-B0cuLReP.js} +1 -1
- package/dist/{conversation-privacy-BPirIVlX.js → conversation-privacy-Bky_veSp.js} +1 -1
- package/dist/{credential-sync-Co8Q2xRW.js → credential-sync-dY9o0YSj.js} +13 -13
- package/dist/{db-Co7DTYYh.js → db-BS2Kql3j.js} +56 -31
- package/dist/{db-zIs8-Ba3.d.ts → db-BebRmhsH.d.ts} +5 -1
- package/dist/{executor-m0kIN71Q.js → executor-cc4nH86C.js} +35 -9
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-DbD-dErY.js → logging-CtCJmt9p.js} +2 -2
- package/dist/{history-IjdmO_r6.js → media-BepyEUNm.js} +85 -1
- package/dist/{message-DKTdTYm-.js → message-C5VuRcP9.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-CpbepSbp.js → oauth-callback-server-KRrYUZ35.js} +2 -2
- package/dist/{projection-BViECfYu.js → projection-BFJG58TG.js} +153 -119
- package/dist/{prompt-KT6MaDHN.js → prompt-D15oftoL.js} +183 -3
- package/dist/{registry-D-Acyjhh.js → registry-C_JrgqUz.js} +1 -1
- package/dist/{resolve-gkT2R66z.js → resolve-Cn_7JfP-.js} +3 -3
- package/dist/{result-DHmCFEt8.js → result-CIbQFLp6.js} +16 -10
- package/dist/{runner-DBKjGjH-.js → runner-BwmaMJVO.js} +8 -8
- package/dist/{sandbox-egress-signals-9n8hqx29.js → sandbox-egress-signals-BOQ8gn7i.js} +1 -1
- package/dist/{schema-DxicIQbc.js → schema-Bptz19Ja.js} +14 -9
- package/dist/{schema-B_6aOcx5.d.ts → schema-DQaFSkZZ.d.ts} +13 -5
- package/dist/{service-account-CDlC9ssy.js → service-account-AGw_pANb.js} +3 -3
- package/dist/{service-account-Bi0HsY6w.js → service-account-CLZfF8O1.js} +3 -3
- package/dist/{session-stop-BWOsuo8p.js → session-stop-CbzKf7UI.js} +41 -30
- package/dist/{skills-DO5K68Rq.js → skills-CcAJBquq.js} +2 -2
- package/dist/{spawn-BBqZDcPa.js → spawn-BvAk2vTI.js} +5 -5
- package/dist/{stop-WC97cmHz.js → stop-BQU4u7la.js} +123 -213
- package/dist/{store-ByR1Lr7e.js → store-DE7NJOvQ.js} +3 -3
- package/dist/{task-runner-B-Ewf8TX.js → task-runner-Q_7duP_T.js} +13 -17
- package/dist/{turn-failure-response-CpdPoZSl.js → turn-failure-response-aWZLfUM8.js} +8 -8
- package/dist/{validation-B4sbIoES.js → validation-BOoPeIJR.js} +1 -1
- package/dist/{version-D6lpuAgL.js → version-Db0MFy61.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-CeP27tC3.js → viewer-FFEFu9In.js} +4 -4
- package/dist/{warmup-P_GJCL1c.js → warmup-DDzrA9Gv.js} +260 -60
- package/dist/{work-DI7x1Slm.js → work-BBJK458E.js} +14 -14
- package/dist/{worker-CYPTOT4j.js → worker-2iU5RFyq.js} +6 -30
- package/migrations/0091_conversation_participant_unsubscribed_index.sql +20 -0
- package/migrations/0092_turn_metric_actor.sql +12 -0
- package/migrations/0093_participant_root_actor_backfill.sql +18 -0
- package/migrations/0094_conversation_delivery_paused_at.sql +1 -0
- package/migrations/meta/0091_snapshot.json +4410 -0
- package/migrations/meta/0092_snapshot.json +4446 -0
- package/migrations/meta/0093_snapshot.json +4446 -0
- package/migrations/meta/0094_snapshot.json +4452 -0
- package/migrations/meta/_journal.json +28 -0
- package/package.json +5 -5
- package/dist/assistant-reply-mj47jMRV.js +0 -65
- package/dist/core-model-BTt5E5b0.js +0 -182
- package/dist/media-BAHvgkok.js +0 -85
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { T as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore, s as getSqlExecutor } from "./db-
|
|
4
|
-
import { g as juniorAgentInvocations, h as juniorAgentBindings } from "./executor-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { k as getTurnRequestDeadline } from "./background-compaction-queue-
|
|
8
|
-
import { $ as getUnnamedAgentConversationId, A as markAgentInvocationPaused, C as isTerminalAgentInvocation, H as agentTypeStartsWithParentHistory, J as getAgentInvocationMessageId, L as agentBindingSchema, M as markAgentInvocationSteered, N as reportReplacedAgentInvocation, O as markAgentInvocationMailboxAppended, Q as getNamedAgentConversationId, T as listOpenAgentInvocations, V as agentTypeInstructions, W as getAgentInvocationId, X as getAgentInvocationTurnId, Z as getChildAgentLockName, _ as completeAgentInvocation, at as getConversationTurnBoundaryError, f as ConversationTurnLifecycleService, g as NON_TERMINAL_AGENT_INVOCATION_STATUSES, h as ACTIVE_AGENT_INVOCATION_STATUSES, j as markAgentInvocationRunning, rt as TurnInputCommitLostError, st as isTurnInputCommitLostError, v as getActiveAgentInvocationForConversation, w as listAgentInvocationsForConversation, x as getLatestAgentInvocationForConversation, y as getAgentInvocation, z as createAgentInvocationSchema } from "./turn-failure-response-
|
|
9
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
10
|
-
import { $ as withoutSavedSteeringMessages, B as maybePostAutomatedTurnLimitNotice, K as recordFinishedTurnForAutomatedLimit, X as buildSteeringPiMessage, Z as instructionForInputs, ct as readBlockedReport, h as parseWebMessages, i as resumeStoppedConversationTree, p as listActiveMailboxTurns, q as resetAutomatedTurnLimit, u as getActiveConversationTurnId } from "./session-stop-
|
|
11
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
12
|
-
import { _t as
|
|
1
|
+
import { H as PluginCredentialFailureError, K as AuthorizationFlowDisabledError, Sn as renderTag, Xt as isTurnExecutionLimitExceededError, at as failTurnRecord, et as lostWorkerBeforeFirstSave, ho as loadForkHistory, nt as saveTurnCheckpoint, ot as getTurnRecord, rt as abandonTurnRecord, s as openConversationProjection, tn as getTerminalAssistantMessages, tt as pauseLostWorkerTurn, v as hydrateConversationMessages, vn as escapeClosingTags } from "./projection-BFJG58TG.js";
|
|
2
|
+
import { n as botConfig } from "./config-DHAy7XlP.js";
|
|
3
|
+
import { T as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore, s as getSqlExecutor } from "./db-BS2Kql3j.js";
|
|
4
|
+
import { g as juniorAgentInvocations, h as juniorAgentBindings } from "./executor-cc4nH86C.js";
|
|
5
|
+
import { h as contextProvenance, m as agentInstructionProvenance, v as sameActorIdentity } from "./media-BepyEUNm.js";
|
|
6
|
+
import { Dt as stopChildAgentsOf, Gt as finishTurn, Mt as supersedeOpenMailboxTurns, Ot as recordSubagentEnded, Ut as AgentRunError, Wt as executeTurn, an as AgentNameInUseError, kt as recordSubagentStarted, rn as AgentMessageQueueFullError, tn as AgentInvocationLimitError } from "./agent-runner-bvl8U5uH.js";
|
|
7
|
+
import { k as getTurnRequestDeadline } from "./background-compaction-queue-D36oCldp.js";
|
|
8
|
+
import { $ as getUnnamedAgentConversationId, A as markAgentInvocationPaused, C as isTerminalAgentInvocation, H as agentTypeStartsWithParentHistory, J as getAgentInvocationMessageId, L as agentBindingSchema, M as markAgentInvocationSteered, N as reportReplacedAgentInvocation, O as markAgentInvocationMailboxAppended, Q as getNamedAgentConversationId, T as listOpenAgentInvocations, V as agentTypeInstructions, W as getAgentInvocationId, X as getAgentInvocationTurnId, Z as getChildAgentLockName, _ as completeAgentInvocation, at as getConversationTurnBoundaryError, f as ConversationTurnLifecycleService, g as NON_TERMINAL_AGENT_INVOCATION_STATUSES, h as ACTIVE_AGENT_INVOCATION_STATUSES, j as markAgentInvocationRunning, rt as TurnInputCommitLostError, st as isTurnInputCommitLostError, v as getActiveAgentInvocationForConversation, w as listAgentInvocationsForConversation, x as getLatestAgentInvocationForConversation, y as getAgentInvocation, z as createAgentInvocationSchema } from "./turn-failure-response-aWZLfUM8.js";
|
|
9
|
+
import { n as getAssistantReplyText } from "./assistant-reply-1N9oxyyb.js";
|
|
10
|
+
import { $ as withoutSavedSteeringMessages, B as maybePostAutomatedTurnLimitNotice, K as recordFinishedTurnForAutomatedLimit, X as buildSteeringPiMessage, Z as instructionForInputs, ct as readBlockedReport, h as parseWebMessages, i as resumeStoppedConversationTree, p as listActiveMailboxTurns, q as resetAutomatedTurnLimit, u as getActiveConversationTurnId } from "./session-stop-CbzKf7UI.js";
|
|
11
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-DE7NJOvQ.js";
|
|
12
|
+
import { _t as persistThreadStateById, ht as getPersistedThreadState, mt as getPersistedSandboxState, vt as coerceThreadConversationState } from "./task-runner-Q_7duP_T.js";
|
|
13
13
|
import { isDeepStrictEqual } from "node:util";
|
|
14
14
|
import * as z from "zod";
|
|
15
15
|
import { and, eq } from "drizzle-orm";
|
|
@@ -303,7 +303,7 @@ function buildAgentInvocationInboundMessage(invocation, nowMs = Date.now()) {
|
|
|
303
303
|
/** Append one invocation to its child mailbox and send the normal queue wake. */
|
|
304
304
|
async function enqueueAgentInvocation(invocation, options) {
|
|
305
305
|
if (invocation.mailboxStatus === "appended" || isTerminalAgentInvocation(invocation)) return;
|
|
306
|
-
await recordSubagentStarted(invocation);
|
|
306
|
+
await recordSubagentStarted(invocation, options.eventMeta);
|
|
307
307
|
if (invocation.parentToolCallId !== void 0) await resumeStoppedConversationTree(invocation.childConversationId, invocation.createdAtMs);
|
|
308
308
|
const nowMs = options.nowMs ?? Date.now();
|
|
309
309
|
await appendAndEnqueueInboundMessage({
|
|
@@ -570,7 +570,7 @@ async function saveAgentInvocationResult(args) {
|
|
|
570
570
|
errorMessage: args.result.blocked.missing,
|
|
571
571
|
status: "blocked"
|
|
572
572
|
} : {
|
|
573
|
-
result: args.result.text,
|
|
573
|
+
result: args.result.text || (args.result.noReply?.note ?? ""),
|
|
574
574
|
status: "completed"
|
|
575
575
|
}
|
|
576
576
|
});
|
|
@@ -1,34 +1,10 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { At as
|
|
3
|
-
import {
|
|
4
|
-
import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
function selectContiguousTurnBatch(messages) {
|
|
9
|
-
const first = messages[0];
|
|
10
|
-
if (!first) return [];
|
|
11
|
-
const nextTurnIndex = messages.findIndex((message) => message.input.authorId !== first.input.authorId || message.source !== first.source);
|
|
12
|
-
return messages.slice(0, nextTurnIndex === -1 ? messages.length : nextTurnIndex);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* True when an interrupt can start its own attempt.
|
|
16
|
-
*
|
|
17
|
-
* A steered web message must not start a second Turn while a yielded Turn
|
|
18
|
-
* waits to resume. It stays pending for that Turn's drain or the next attempt.
|
|
19
|
-
*/
|
|
20
|
-
function isAttemptInterrupt(message, work) {
|
|
21
|
-
return message.delivery === "interrupt" && !(work.execution.status === "paused" && message.source === "web");
|
|
22
|
-
}
|
|
23
|
-
/** Prioritize interrupts while keeping each attempt to one Actor and Source. */
|
|
24
|
-
function selectAttemptMessages(work) {
|
|
25
|
-
const messages = work.messages;
|
|
26
|
-
const interrupts = messages.filter((message) => isAttemptInterrupt(message, work));
|
|
27
|
-
if (interrupts.length > 0) return selectContiguousTurnBatch(interrupts);
|
|
28
|
-
if (work.execution.status === "paused") return [];
|
|
29
|
-
const nonEventMessages = messages.filter((message) => message.source !== "event");
|
|
30
|
-
return selectContiguousTurnBatch(nonEventMessages.length > 0 ? nonEventMessages : messages);
|
|
31
|
-
}
|
|
2
|
+
import { At as isInvalidConversationRecordError, Dt as hasConversationStop, St as countPendingConversationMessages, kt as isFinalAttempt } from "./projection-BFJG58TG.js";
|
|
3
|
+
import { W as isProviderRetryError, i as getChatConfig } from "./config-DHAy7XlP.js";
|
|
4
|
+
import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-CtCJmt9p.js";
|
|
5
|
+
import { Ht as selectAttemptMessages, Vt as isAttemptInterrupt } from "./agent-runner-bvl8U5uH.js";
|
|
6
|
+
import { k as getTurnRequestDeadline, y as ConversationQueueMessageRejectedError } from "./background-compaction-queue-D36oCldp.js";
|
|
7
|
+
import { C as startConversationWork, b as releaseConversationWork, c as clearConsumedConversationWake, d as completeConversationWork, f as deadLetterAttempt, g as getConversationWorkState, i as beginConversationResume, m as ensureConversationWake, o as checkInConversationWork, p as drainConversationMailbox, t as ackMessages, u as completeConversationStop, v as recordAttemptFailure, x as requestAnotherSlice, y as recordConversationRetry } from "./store-DE7NJOvQ.js";
|
|
32
8
|
// src/chat/task-execution/worker.ts
|
|
33
9
|
var worker_exports = /* @__PURE__ */ __exportAll({
|
|
34
10
|
CONVERSATION_WORK_DEFER_DELAY_MS: () => CONVERSATION_WORK_DEFER_DELAY_MS,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
-- Before this migration runs, junior upgrade builds the marked index with
|
|
2
|
+
-- CREATE INDEX CONCURRENTLY, so the build below does not block writes.
|
|
3
|
+
DO $$
|
|
4
|
+
BEGIN
|
|
5
|
+
-- Even CREATE INDEX IF NOT EXISTS takes a write-blocking table lock.
|
|
6
|
+
IF to_regclass('junior_conversation_participants_unsubscribed_idx') IS NULL THEN
|
|
7
|
+
-- junior:concurrent-index
|
|
8
|
+
CREATE INDEX "junior_conversation_participants_unsubscribed_idx" ON "junior_conversation_participants" USING btree ("user_id","root_conversation_id") WHERE "junior_conversation_participants"."unsubscribed_at" is not null;
|
|
9
|
+
END IF;
|
|
10
|
+
|
|
11
|
+
-- A failed concurrent build can leave an index that exists but cannot be used.
|
|
12
|
+
IF NOT EXISTS (
|
|
13
|
+
SELECT 1 FROM pg_index
|
|
14
|
+
WHERE indexrelid = 'junior_conversation_participants_unsubscribed_idx'::regclass
|
|
15
|
+
AND indrelid = 'junior_conversation_participants'::regclass
|
|
16
|
+
AND indisvalid AND indisready
|
|
17
|
+
) THEN
|
|
18
|
+
RAISE EXCEPTION 'The conversation participant unsubscribed index is not valid and ready. Repair the concurrent build before running junior upgrade.';
|
|
19
|
+
END IF;
|
|
20
|
+
END $$;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
ALTER TABLE "junior_conversation_metrics" ADD COLUMN "actor_identity_id" text;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "junior_conversation_metrics" ADD CONSTRAINT "junior_conversation_metrics_actor_identity_id_junior_identities_id_fk" FOREIGN KEY ("actor_identity_id") REFERENCES "public"."junior_identities"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
|
3
|
+
CREATE INDEX "junior_conversation_metrics_actor_identity_occurred_at_idx" ON "junior_conversation_metrics" USING btree ("actor_identity_id","occurred_at");--> statement-breakpoint
|
|
4
|
+
-- Old metric rows do not record their Turn Actor. Use the Actor of the
|
|
5
|
+
-- metric row's Conversation, else the Actor of its root.
|
|
6
|
+
UPDATE "junior_conversation_metrics" AS "m"
|
|
7
|
+
SET "actor_identity_id" = coalesce("c"."actor_identity_id", "r"."actor_identity_id")
|
|
8
|
+
FROM "junior_conversations" AS "c"
|
|
9
|
+
LEFT JOIN "junior_conversations" AS "r"
|
|
10
|
+
ON "r"."conversation_id" = coalesce("c"."root_conversation_id", "c"."conversation_id")
|
|
11
|
+
WHERE "c"."conversation_id" = "m"."conversation_id"
|
|
12
|
+
AND "m"."actor_identity_id" IS NULL;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
-- Access and feeds read only Participant rows. Add the root Actor of each
|
|
2
|
+
-- root whose Identity got its User after the root was written.
|
|
3
|
+
INSERT INTO "junior_conversation_participants" (
|
|
4
|
+
"user_id",
|
|
5
|
+
"root_conversation_id",
|
|
6
|
+
"last_message_at"
|
|
7
|
+
)
|
|
8
|
+
SELECT
|
|
9
|
+
i."user_id",
|
|
10
|
+
c."conversation_id",
|
|
11
|
+
c."last_activity_at"
|
|
12
|
+
FROM "junior_conversations" AS c
|
|
13
|
+
INNER JOIN "junior_identities" AS i
|
|
14
|
+
ON i."id" = c."actor_identity_id"
|
|
15
|
+
WHERE c."parent_conversation_id" IS NULL
|
|
16
|
+
AND i."user_id" IS NOT NULL
|
|
17
|
+
AND i."kind" = 'user'
|
|
18
|
+
ON CONFLICT ("user_id", "root_conversation_id") DO NOTHING;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "junior_conversations" ADD COLUMN "delivery_paused_at" timestamp with time zone;
|