@sentry/junior 0.286.0 → 0.288.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-JQZaJ-B_.js → adapter-Cikcqdty.js} +1 -1
- package/dist/{admin-Dm2bimJ-.js → admin-BcSxHuTB.js} +2 -1
- package/dist/{agent-runner-DGCwOEyL.js → agent-runner-9MXyWUL8.js} +784 -368
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +9 -8
- package/dist/api.d.ts +1 -1
- package/dist/api.js +411 -65
- package/dist/{app-BKq0JzWx.d.ts → app-BUklJVBe.d.ts} +4 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +555 -71
- package/dist/{assistant-reply-CAPafcUY.js → assistant-reply-mj47jMRV.js} +1 -1
- package/dist/{automation-B-jJN_gM.js → automation-DDXwHQs5.js} +4 -7
- package/dist/{background-compaction-queue-Btu2oab_.js → background-compaction-queue-CjllSPir.js} +161 -90
- package/dist/{briefs-UMeYehUe.js → briefs-DW9iuolG.js} +7 -5
- package/dist/{catalog-runtime-Bym8GVdh.js → catalog-runtime-B3gfH58M.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 +1762 -0
- package/dist/{connections-CQ7p0aNJ.js → connections-BtdJftow.js} +9 -9
- package/dist/{conversation-BusI2uzj.js → conversation-DhoqHtQ7.js} +30 -6
- package/dist/{conversation-pending-messages-DwehU0Fd.js → conversation-pending-messages-DHV0S4uF.js} +2 -5
- package/dist/{conversation-privacy-Cd_nZZBM.js → conversation-privacy-BPirIVlX.js} +1 -1
- package/dist/core-model-BTt5E5b0.js +182 -0
- package/dist/{credential-sync-DmiJi_At.js → credential-sync-Co8Q2xRW.js} +28 -20
- package/dist/{viewer-CH-ASQzh.js → db-Co7DTYYh.js} +62 -358
- package/dist/{db-C5zi4ecs.d.ts → db-zIs8-Ba3.d.ts} +6 -2
- package/dist/{executor-Dipi2Ixl.js → executor-m0kIN71Q.js} +102 -14
- package/dist/{media-B-BpXo41.js → history-IjdmO_r6.js} +8 -88
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-CMFhLLj4.js → logging-DbD-dErY.js} +3 -2
- package/dist/media-BAHvgkok.js +85 -0
- package/dist/{message-D1xLljUF.js → message-DKTdTYm-.js} +10 -10
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +19 -41
- package/dist/{oauth-callback-server-DCAFIUQr.js → oauth-callback-server-CpbepSbp.js} +2 -2
- package/dist/{projection-CoeMNxJ4.js → projection-BViECfYu.js} +361 -746
- package/dist/{prompt-C9OQEfan.js → prompt-KT6MaDHN.js} +1 -1
- package/dist/{registry-u-sFYtx_.js → registry-D-Acyjhh.js} +1 -1
- package/dist/{reporting-window-B4TwyuJo.js → reporting-window-B3Ze-Qnt.js} +4 -1
- package/dist/{resolve-DYqgL3Eo.js → resolve-gkT2R66z.js} +3 -3
- package/dist/{result-CescSwAw.js → result-DHmCFEt8.js} +8 -8
- package/dist/{runner-Cr67a8TB.js → runner-DBKjGjH-.js} +8 -8
- package/dist/{sandbox-egress-signals-DLOazy5W.js → sandbox-egress-signals-9n8hqx29.js} +1 -1
- package/dist/{schedule-BTp__wrw.js → schedule-cP0AACm1.js} +11 -2
- package/dist/{schema-Ih60j59-.d.ts → schema-B_6aOcx5.d.ts} +159 -3
- package/dist/{schema-BUSi3sgv.js → schema-DxicIQbc.js} +79 -14
- package/dist/{service-account-CsKxktLk.js → service-account-Bi0HsY6w.js} +3 -3
- package/dist/{service-account-CGEqz9wG.js → service-account-CDlC9ssy.js} +3 -3
- package/dist/{session-stop-CGz5DByb.js → session-stop-BWOsuo8p.js} +62 -20
- package/dist/{skills-COCqf61f.js → skills-DO5K68Rq.js} +2 -2
- package/dist/spawn-BBqZDcPa.js +79 -0
- package/dist/{stop-GyFZkHuQ.js → stop-WC97cmHz.js} +832 -552
- package/dist/{store-D0-8plWp.js → store-ByR1Lr7e.js} +4 -16
- package/dist/{task-runner-xPuQmEot.js → task-runner-B-Ewf8TX.js} +30 -21
- package/dist/{turn-failure-response-BOviBdT-.js → turn-failure-response-CpdPoZSl.js} +25 -11
- package/dist/{validation-DZDKorGz.js → validation-B4sbIoES.js} +1 -1
- package/dist/{version-BTIz7fGi.js → version-D6lpuAgL.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/viewer-CeP27tC3.js +337 -0
- package/dist/warmup-P_GJCL1c.js +767 -0
- package/dist/{work-C75_IM5e.js → work-DI7x1Slm.js} +32 -20
- package/dist/{worker-Dl47I729.js → worker-CYPTOT4j.js} +6 -7
- package/migrations/0088_conversation_unsubscribe.sql +1 -0
- package/migrations/0089_conversation_paused_status.sql +3 -0
- package/migrations/0090_guardian_review_time_index.sql +20 -0
- package/migrations/meta/0088_snapshot.json +4372 -0
- package/migrations/meta/0089_snapshot.json +4372 -0
- package/migrations/meta/0090_snapshot.json +4388 -0
- package/migrations/meta/_journal.json +21 -0
- package/package.json +5 -4
- package/dist/client-B0aAs7wC.js +0 -793
- package/dist/config-B9f9Lqo5.js +0 -579
- package/dist/spawn-C8F_iXWO.js +0 -42
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import {
|
|
4
|
-
import { g as juniorAgentInvocations, h as juniorAgentBindings } from "./executor-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
12
|
-
import { _t as getPersistedThreadState, bt as coerceThreadConversationState, gt as getPersistedSandboxState, yt as persistThreadStateById } from "./task-runner-
|
|
1
|
+
import { Cn as renderTag, U as PluginCredentialFailureError, Zt as isTurnExecutionLimitExceededError, fo as loadForkHistory, it as abandonTurnRecord, nn as getTerminalAssistantMessages, nt as pauseLostWorkerTurn, ot as failTurnRecord, q as AuthorizationFlowDisabledError, rt as saveTurnCheckpoint, s as openConversationProjection, st as getTurnRecord, tt as lostWorkerBeforeFirstSave, v as hydrateConversationMessages, yn as escapeClosingTags } from "./projection-BViECfYu.js";
|
|
2
|
+
import { n as botConfig } from "./config-CLJcyYEF.js";
|
|
3
|
+
import { T as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore, s as getSqlExecutor } from "./db-Co7DTYYh.js";
|
|
4
|
+
import { g as juniorAgentInvocations, h as juniorAgentBindings } from "./executor-m0kIN71Q.js";
|
|
5
|
+
import { d as contextProvenance, m as sameActorIdentity, u as agentInstructionProvenance } from "./history-IjdmO_r6.js";
|
|
6
|
+
import { At as recordSubagentStarted, Ft as executeTurn, Gt as AgentMessageQueueFullError, It as finishTurn, Nt as supersedeOpenMailboxTurns, Ot as stopChildAgentsOf, Pt as AgentRunError, Ut as AgentInvocationLimitError, kt as recordSubagentEnded, qt as AgentNameInUseError } from "./agent-runner-9MXyWUL8.js";
|
|
7
|
+
import { k as getTurnRequestDeadline } from "./background-compaction-queue-CjllSPir.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-CpdPoZSl.js";
|
|
9
|
+
import { n as getAssistantReplyText } from "./assistant-reply-mj47jMRV.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-BWOsuo8p.js";
|
|
11
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-ByR1Lr7e.js";
|
|
12
|
+
import { _t as getPersistedThreadState, bt as coerceThreadConversationState, gt as getPersistedSandboxState, yt as persistThreadStateById } from "./task-runner-B-Ewf8TX.js";
|
|
13
13
|
import { isDeepStrictEqual } from "node:util";
|
|
14
14
|
import * as z from "zod";
|
|
15
15
|
import { and, eq } from "drizzle-orm";
|
|
@@ -105,7 +105,8 @@ async function createAgentInvocation(rawInput, nowMs = Date.now()) {
|
|
|
105
105
|
return await getSqlExecutor().withLock(lockName, async () => {
|
|
106
106
|
const existing = await getAgentInvocation(invocationId);
|
|
107
107
|
if (existing) {
|
|
108
|
-
|
|
108
|
+
const child = await getConversationStore().get({ conversationId: existing.childConversationId });
|
|
109
|
+
if (!sameCreateInput(existing, input) || child?.kind !== input.kind) throw new Error(`Agent invocation idempotency key was reused with different input for ${invocationId}`);
|
|
109
110
|
return existing;
|
|
110
111
|
}
|
|
111
112
|
const open = await listOpenAgentInvocations(input.parentConversationId);
|
|
@@ -120,10 +121,11 @@ async function createAgentInvocation(rawInput, nowMs = Date.now()) {
|
|
|
120
121
|
});
|
|
121
122
|
await getConversationStore().createChild({
|
|
122
123
|
childConversationId,
|
|
123
|
-
kind:
|
|
124
|
+
kind: input.kind,
|
|
124
125
|
parentConversationId: input.parentConversationId,
|
|
125
126
|
nowMs,
|
|
126
|
-
source: "internal"
|
|
127
|
+
source: "internal",
|
|
128
|
+
...input.title ? { title: input.title } : void 0
|
|
127
129
|
});
|
|
128
130
|
if (input.agentName) await getSqlExecutor().db().insert(juniorAgentBindings).values({
|
|
129
131
|
childConversationId,
|
|
@@ -342,6 +344,13 @@ function agentInvocationInputText(invocation) {
|
|
|
342
344
|
const typeInstructions = agentTypeInstructions(invocation.agentType);
|
|
343
345
|
return renderTag("parent-agent-task", {}, [...typeInstructions ? [escapeClosingTags(typeInstructions), ""] : [], escapeClosingTags(invocation.input)]);
|
|
344
346
|
}
|
|
347
|
+
/**
|
|
348
|
+
* A parent agent task or message is the child's instruction. Another input,
|
|
349
|
+
* such as a result of the child's own child agent or an Event, is context.
|
|
350
|
+
*/
|
|
351
|
+
function agentInvocationProvenance(invocation) {
|
|
352
|
+
return invocation.parentToolCallId ? agentInstructionProvenance : contextProvenance;
|
|
353
|
+
}
|
|
345
354
|
/** Resolve invocation execution from mailbox input or durable active state. */
|
|
346
355
|
async function resolveAgentInvocationId(context) {
|
|
347
356
|
const mailboxInvocationId = invocationIdFromMessages(context.attempt.messages);
|
|
@@ -382,7 +391,7 @@ function createAgentMessageSteeringDrain(context, running) {
|
|
|
382
391
|
const saved = (await getTurnRecord(running.childConversationId, turnId))?.piMessages ?? [];
|
|
383
392
|
const messages = withoutSavedSteeringMessages(saved, joining.map((candidate) => ({
|
|
384
393
|
kind: "runtime",
|
|
385
|
-
provenance:
|
|
394
|
+
provenance: agentInvocationProvenance(candidate),
|
|
386
395
|
text: agentInvocationInputText(candidate),
|
|
387
396
|
timestampMs: candidate.createdAtMs
|
|
388
397
|
})), buildSteeringPiMessage);
|
|
@@ -675,10 +684,13 @@ function createAgentInvocationWorker(agentRunner, options = {}) {
|
|
|
675
684
|
parentConversationId: invocation.parentConversationId,
|
|
676
685
|
turnId,
|
|
677
686
|
runId: invocation.invocationId,
|
|
678
|
-
instruction:
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
687
|
+
instruction: {
|
|
688
|
+
...instructionForInputs([{
|
|
689
|
+
kind: "runtime",
|
|
690
|
+
text: agentInvocationInputText(invocation)
|
|
691
|
+
}]),
|
|
692
|
+
provenance: agentInvocationProvenance(invocation)
|
|
693
|
+
},
|
|
682
694
|
history,
|
|
683
695
|
actor: invocation.actor,
|
|
684
696
|
credentialContext: invocation.credentialContext,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { C as
|
|
7
|
-
import { E as startConversationWork, S as releaseConversationWork, _ as getConversationWorkState, b as recordAttemptFailure, c as clearConsumedConversationWake, d as completeConversationWork, f as countPendingConversationMessages, h as ensureConversationWake, i as beginConversationResume, m as drainConversationMailbox, o as checkInConversationWork, p as deadLetterAttempt, t as ackMessages, u as completeConversationStop, w as requestAnotherSlice, x as recordConversationRetry } from "./store-D0-8plWp.js";
|
|
2
|
+
import { At as isFinalAttempt, Ct as countPendingConversationMessages, Ot as hasConversationStop, jt as isInvalidConversationRecordError } from "./projection-BViECfYu.js";
|
|
3
|
+
import { G as isProviderRetryError, i as getChatConfig } from "./config-CLJcyYEF.js";
|
|
4
|
+
import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-DbD-dErY.js";
|
|
5
|
+
import { k as getTurnRequestDeadline, y as ConversationQueueMessageRejectedError } from "./background-compaction-queue-CjllSPir.js";
|
|
6
|
+
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-ByR1Lr7e.js";
|
|
8
7
|
// src/chat/task-execution/attempt-selection.ts
|
|
9
8
|
function selectContiguousTurnBatch(messages) {
|
|
10
9
|
const first = messages[0];
|
|
@@ -219,7 +218,7 @@ async function processConversationWorkInContext(message, options) {
|
|
|
219
218
|
}
|
|
220
219
|
const pendingCount = initial ? countPendingConversationMessages(initial) : 0;
|
|
221
220
|
setSpanAttributes({ "app.worker.pending_count": pendingCount });
|
|
222
|
-
if (!initial
|
|
221
|
+
if (!initial?.needsRun) {
|
|
223
222
|
if (initial) await clearConsumedConversationWake({
|
|
224
223
|
conversationId,
|
|
225
224
|
conversationStore: options.conversationStore,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "junior_conversation_participants" ADD COLUMN "unsubscribed_at" timestamp with time zone;
|
|
@@ -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_events_guardian_review_time_idx') IS NULL THEN
|
|
7
|
+
-- junior:concurrent-index
|
|
8
|
+
CREATE INDEX "junior_conversation_events_guardian_review_time_idx" ON "junior_conversation_events" USING btree ("created_at") WHERE "junior_conversation_events"."type" = 'guardian_action_reviewed';
|
|
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_events_guardian_review_time_idx'::regclass
|
|
15
|
+
AND indrelid = 'junior_conversation_events'::regclass
|
|
16
|
+
AND indisvalid AND indisready
|
|
17
|
+
) THEN
|
|
18
|
+
RAISE EXCEPTION 'The Guardian review time index is not valid and ready. Repair the concurrent build before running junior upgrade.';
|
|
19
|
+
END IF;
|
|
20
|
+
END $$;
|