@sentry/junior 0.288.0 → 0.290.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-CHMVy-j0.js} +1 -1
- package/dist/{admin-BcSxHuTB.js → admin-C45Ap5Tn.js} +2 -2
- package/dist/{agent-runner-9MXyWUL8.js → agent-runner-CZjf6MOQ.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-BB1j2krL.d.ts} +2 -4
- package/dist/app.d.ts +1 -1
- package/dist/app.js +92 -64
- package/dist/assistant-reply-BtIV0hq6.js +58 -0
- package/dist/{automation-DDXwHQs5.js → automation-DWbjJltM.js} +1 -1
- package/dist/{background-compaction-queue-CjllSPir.js → background-compaction-queue-2gKhjRD3.js} +4 -4
- package/dist/{briefs-DW9iuolG.js → briefs-BGke_Cz5.js} +3 -4
- package/dist/{catalog-runtime-B3gfH58M.js → catalog-runtime-BSOlVfXi.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 +4 -4
- package/dist/{config-CLJcyYEF.js → config-DHDub41t.js} +4 -41
- package/dist/{connections-BtdJftow.js → connections-BAb0fedk.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-QRdLPH-9.js} +1 -1
- package/dist/{credential-sync-Co8Q2xRW.js → credential-sync-YIMGiRk7.js} +13 -13
- package/dist/{db-Co7DTYYh.js → db-DBHig2sI.js} +56 -31
- package/dist/{db-zIs8-Ba3.d.ts → db-DCSmv9tz.d.ts} +6 -2
- package/dist/{executor-m0kIN71Q.js → executor-DKrtH0k_.js} +62 -13
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-DbD-dErY.js → logging-f24cZPEj.js} +2 -2
- package/dist/{history-IjdmO_r6.js → media-BepyEUNm.js} +85 -1
- package/dist/{message-DKTdTYm-.js → message-BbBOajiX.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-rHJYjFoz.js} +2 -2
- package/dist/{projection-BViECfYu.js → projection-D-9aVaHj.js} +153 -119
- package/dist/{prompt-KT6MaDHN.js → prompt-C7SZhNDy.js} +183 -3
- package/dist/{registry-D-Acyjhh.js → registry-CwA-kSjW.js} +1 -1
- package/dist/{resolve-gkT2R66z.js → resolve-B5WJgt9k.js} +3 -3
- package/dist/{result-DHmCFEt8.js → result-B2sCVIwl.js} +16 -10
- package/dist/{runner-DBKjGjH-.js → runner-CZq7wyIh.js} +8 -8
- package/dist/{sandbox-egress-signals-9n8hqx29.js → sandbox-egress-signals-C4d6Pa9a.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-B6OJtplS.js} +3 -3
- package/dist/{service-account-Bi0HsY6w.js → service-account-BC73M8rj.js} +3 -3
- package/dist/{session-stop-BWOsuo8p.js → session-stop-1cku9Vm3.js} +41 -30
- package/dist/{skills-DO5K68Rq.js → skills-BFopj5ID.js} +2 -2
- package/dist/{spawn-BBqZDcPa.js → spawn-B-1JlJwH.js} +5 -5
- package/dist/{stop-WC97cmHz.js → stop-CJweYiOH.js} +123 -213
- package/dist/{store-ByR1Lr7e.js → store-CK869JpC.js} +3 -3
- package/dist/{task-runner-B-Ewf8TX.js → task-runner-XmXL9E-k.js} +13 -17
- package/dist/{turn-failure-response-CpdPoZSl.js → turn-failure-response-hhpek6Fn.js} +8 -8
- package/dist/{validation-B4sbIoES.js → validation-DHQjCRFx.js} +1 -1
- package/dist/{version-D6lpuAgL.js → version-DQgCf4FE.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-CeP27tC3.js → viewer-DG97nzP4.js} +4 -4
- package/dist/{warmup-P_GJCL1c.js → warmup-C00-jOoN.js} +272 -78
- package/dist/{work-DI7x1Slm.js → work-Ch3EWO6u.js} +14 -14
- package/dist/{worker-CYPTOT4j.js → worker-B8kyM1fB.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,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-D-9aVaHj.js";
|
|
3
|
+
import { W as isProviderRetryError, i as getChatConfig } from "./config-DHDub41t.js";
|
|
4
|
+
import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-f24cZPEj.js";
|
|
5
|
+
import { Ht as selectAttemptMessages, Vt as isAttemptInterrupt } from "./agent-runner-CZjf6MOQ.js";
|
|
6
|
+
import { k as getTurnRequestDeadline, y as ConversationQueueMessageRejectedError } from "./background-compaction-queue-2gKhjRD3.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-CK869JpC.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;
|