@sentry/junior 0.303.0 → 0.304.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-BdVnSuY5.js → adapter-context-B1IpoELr.js} +2 -2
- package/dist/{admin-AfeAdS3J.js → admin-BnVFGo_z.js} +5 -5
- package/dist/{agent-runner-BP8_DLUv.js → agent-runner-CoEeZSRh.js} +546 -372
- package/dist/api/schema.d.ts +1 -1
- package/dist/api/schema.js +5 -5
- package/dist/api.d.ts +1 -1
- package/dist/api.js +59 -61
- package/dist/{app-Dd9v1mNx.d.ts → app-Cs157Zc5.d.ts} +5 -3
- package/dist/app.d.ts +1 -1
- package/dist/app.js +77 -64
- package/dist/{automation-D9MvhOWY.js → automation-CuA3yEcD.js} +1 -1
- package/dist/{background-compaction-queue-xaE05jxH.js → background-compaction-queue-WLPNSF_b.js} +2 -2
- package/dist/{briefs-D8i-dKTp.js → briefs-CagVVefw.js} +11 -8
- package/dist/{catalog-runtime-d1EM6Z0V.js → catalog-runtime-B8ZXvXWm.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +5 -5
- package/dist/cli/init.js +1 -1
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +4 -4
- package/dist/{config-oGM7KA9M.js → config-DdO1BNcw.js} +101 -7
- package/dist/{connections-BlikzEJv.js → connections-D20kp0j5.js} +6 -6
- package/dist/{continue-in-slack-BZnYifiG.js → continue-in-slack-BKEVMBj1.js} +8 -8
- package/dist/{conversation-CY1jnBiC.js → conversation-BOqdRtUx.js} +4 -12
- package/dist/{conversation-feed-BZJRk6UV.js → conversation-feed-CgpgP7yi.js} +35 -2
- package/dist/{conversation-privacy-Cx515ddM.js → conversation-privacy-L1SK_v0V.js} +10 -2
- package/dist/{conversation-turn-DAhRdX4m.js → conversation-turn-BptVJylj.js} +17 -17
- package/dist/{credential-sync-DfhmWFeo.js → credential-sync-D1J1CGzL.js} +14 -14
- package/dist/{db-C-2tFxk3.js → db-EKJnkrIb.js} +169 -6
- package/dist/{db-DPqcEM9_.d.ts → db-zbN5ZV_o.d.ts} +2 -2
- package/dist/{executor-NVfS8aQ2.js → executor-CoIZmFK8.js} +43 -9
- package/dist/{history-UZ3M2M9r.js → history-m2-ceTTX.js} +8 -2
- package/dist/{install-CHLrpRZc.js → install-BT2Pf6HP.js} +2 -2
- package/dist/instrumentation.js +7 -3
- package/dist/{lineage-HGLhd_-N.js → lineage-C5DGQCS_.js} +2 -2
- package/dist/{logging-DiyqRLBx.js → logging-QSZuMcvo.js} +1 -1
- package/dist/{message-CkCOcbFH.js → message-TtxftRHj.js} +8 -8
- package/dist/{model-input-DmoPPtPE.js → model-input-BHXfA29g.js} +2 -2
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +5 -5
- package/dist/{oauth-callback-server-CIf_6YmA.js → oauth-callback-server-B0enqHtZ.js} +2 -2
- package/dist/{projection-DBq8tsA5.js → projection-CNKK7doO.js} +547 -61
- package/dist/{prompt-D2KlJopL.js → prompt-DSjhoKu5.js} +185 -12
- package/dist/{queue-DFaOscp5.js → queue-CDxkit82.js} +4 -4
- package/dist/{registry-Bu0Z9BEO.js → registry-DBDNUUmz.js} +1 -1
- package/dist/{resolve-DXuA3G0g.js → resolve-CQLhMWSu.js} +3 -3
- package/dist/{result-DpiNseDA.js → result-B-pauj42.js} +8 -8
- package/dist/{runner-iu1heRFv.js → runner-B3KxKks5.js} +9 -9
- package/dist/{sandbox-egress-signals-2HFYDcQf.js → sandbox-egress-signals-DJJX9ClG.js} +1 -1
- package/dist/{schema-DvfX3Gq_.js → schema-Bx0Mlo32.js} +3 -3
- package/dist/{schema-DHMOaRzC.d.ts → schema-CKcu-IK6.d.ts} +43 -11
- package/dist/{service-account-BcT5LR7V.js → service-account-2HmlNPvy.js} +6 -5
- package/dist/{service-account-xYkaQTrw.js → service-account-DQLqkSVv.js} +5 -5
- package/dist/{session-stop-BLLp1IP_.js → session-stop-DEeZKqbX.js} +114 -49
- package/dist/{skills-CNAGH4ju.js → skills-2UrD7JkN.js} +2 -2
- package/dist/{slack-conversation-unfurl-DYnqe5ci.js → slack-conversation-unfurl-Dd129Uov.js} +12 -11
- package/dist/{spawn-cGasWW33.js → spawn-eMho9HDJ.js} +6 -6
- package/dist/{state-CDS6h_Wv.js → state-Bveuc4Zh.js} +4 -4
- package/dist/{stop-DMMA67yT.js → stop-D_ltJLDS.js} +170 -64
- package/dist/{store-Dgs7Oe44.js → store-COeYnPL_.js} +5 -5
- package/dist/{task-queue-DcF0nhhz.js → task-queue-CBIDXZpV.js} +3 -3
- package/dist/{task-runner-BGXF7Fo7.js → task-runner-CJF7zIJL.js} +7 -7
- package/dist/{thread-context-BPky1KBe.js → thread-context-Cg0jt0aE.js} +8 -8
- package/dist/{turn-session-routing-DGvn9MSl.js → turn-session-routing-CaY3Tp8m.js} +8 -8
- package/dist/{turn-user-message-19CkuUvM.js → turn-user-message-tcom1RYd.js} +3 -3
- package/dist/{validation-lu1DgjNQ.js → validation-EU91JwIT.js} +1 -1
- package/dist/{version-Uo3c94Dx.js → version-BYRPhY5G.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-BPQHMx3-.js → viewer-Cf8ISkAc.js} +3 -3
- package/dist/{warmup-H8uLvW9e.js → warmup-TgY4S1vx.js} +75 -469
- package/dist/{worker-B-pM_-3K.js → worker-C6Uq4OKD.js} +7 -7
- package/migrations/0111_attachment_kinds.sql +14 -0
- package/migrations/0112_attachment_url_fill.sql +51 -0
- package/migrations/0113_attachment_url_index.sql +1 -0
- package/migrations/meta/0099_snapshot.json +102 -326
- package/migrations/meta/0111_snapshot.json +5011 -0
- package/migrations/meta/0112_snapshot.json +5011 -0
- package/migrations/meta/0113_snapshot.json +5033 -0
- package/migrations/meta/_journal.json +21 -0
- package/package.json +7 -7
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { Ct as countPendingConversationMessages, Nt as isFinalAttempt, Pt as isInvalidConversationRecordError, jt as hasConversationStop } from "./projection-
|
|
3
|
-
import {
|
|
4
|
-
import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-
|
|
5
|
-
import { t as getConversationStoppedAtMs } from "./session-stop-
|
|
6
|
-
import { _ as nudgeIdempotencyKey, m as ConversationQueueMessageRejectedError, p as getTurnRequestDeadline } from "./background-compaction-queue-
|
|
7
|
-
import { C as requestAnotherSlice, S as releaseConversationWork, T as startConversationWork, _ as getConversationWorkState, b as recordAttemptFailure, c as clearConsumedConversationWake, d as completeConversationWork, f as deadLetterAttempt, h as ensureConversationWake, i as beginConversationResume, o as checkInConversationWork, p as drainConversationMailbox, t as ackMessages, u as completeConversationStop, x as recordConversationRetry } from "./store-
|
|
8
|
-
import {
|
|
2
|
+
import { Ct as countPendingConversationMessages, Nt as isFinalAttempt, Pt as isInvalidConversationRecordError, jt as hasConversationStop } from "./projection-CNKK7doO.js";
|
|
3
|
+
import { X as isProviderRetryError, i as getChatConfig } from "./config-DdO1BNcw.js";
|
|
4
|
+
import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-QSZuMcvo.js";
|
|
5
|
+
import { t as getConversationStoppedAtMs } from "./session-stop-DEeZKqbX.js";
|
|
6
|
+
import { _ as nudgeIdempotencyKey, m as ConversationQueueMessageRejectedError, p as getTurnRequestDeadline } from "./background-compaction-queue-WLPNSF_b.js";
|
|
7
|
+
import { C as requestAnotherSlice, S as releaseConversationWork, T as startConversationWork, _ as getConversationWorkState, b as recordAttemptFailure, c as clearConsumedConversationWake, d as completeConversationWork, f as deadLetterAttempt, h as ensureConversationWake, i as beginConversationResume, o as checkInConversationWork, p as drainConversationMailbox, t as ackMessages, u as completeConversationStop, x as recordConversationRetry } from "./store-COeYnPL_.js";
|
|
8
|
+
import { Ln as isAttemptInterrupt, Rn as selectAttemptMessages } from "./warmup-TgY4S1vx.js";
|
|
9
9
|
// src/chat/task-execution/lost-lease.ts
|
|
10
10
|
/**
|
|
11
11
|
* Count a slice that lost its Conversation Lease as a failed attempt, then
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
CREATE TABLE "junior_message_attachments" (
|
|
2
|
+
"conversation_id" text NOT NULL,
|
|
3
|
+
"seq" integer NOT NULL,
|
|
4
|
+
"attachment_id" text NOT NULL,
|
|
5
|
+
"position" integer,
|
|
6
|
+
CONSTRAINT "junior_message_attachments_pk" PRIMARY KEY("conversation_id","seq","attachment_id")
|
|
7
|
+
);
|
|
8
|
+
--> statement-breakpoint
|
|
9
|
+
ALTER TABLE "junior_attachments" ALTER COLUMN "storage_provider" DROP NOT NULL;--> statement-breakpoint
|
|
10
|
+
ALTER TABLE "junior_attachments" ALTER COLUMN "filename" DROP NOT NULL;--> statement-breakpoint
|
|
11
|
+
ALTER TABLE "junior_attachments" ALTER COLUMN "content_type" DROP NOT NULL;--> statement-breakpoint
|
|
12
|
+
ALTER TABLE "junior_attachments" ALTER COLUMN "bytes" DROP NOT NULL;--> statement-breakpoint
|
|
13
|
+
ALTER TABLE "junior_attachments" ADD COLUMN "kind" text DEFAULT 'file' NOT NULL;--> statement-breakpoint
|
|
14
|
+
ALTER TABLE "junior_attachments" ADD COLUMN "url" text;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
-- Fill `url` Attachments and where messages use them, for Conversations
|
|
2
|
+
-- active in the last 30 days, with the rules of `batchMessageLinks` in
|
|
3
|
+
-- src/chat/conversations/message-links.ts: the text of the newest save of
|
|
4
|
+
-- each message, at the seq of its first save, first match of each link only,
|
|
5
|
+
-- and no link over 2048 bytes.
|
|
6
|
+
-- Ids are `urlAttachmentId`. It runs apart from 0111, so it holds no lock
|
|
7
|
+
-- from that migration's ALTER TABLE. It reads the event tables, and its
|
|
8
|
+
-- inserts into `junior_attachments` take only a row-exclusive lock, so app
|
|
9
|
+
-- reads and writes keep running. Older Conversations show no links in the
|
|
10
|
+
-- feed until they get new messages.
|
|
11
|
+
WITH "messages" AS (
|
|
12
|
+
SELECT
|
|
13
|
+
"events"."conversation_id",
|
|
14
|
+
min("events"."seq") FILTER (WHERE "events"."type" = 'message') AS "seq",
|
|
15
|
+
(array_agg("events"."payload" ORDER BY "events"."seq" DESC))[1] AS "payload",
|
|
16
|
+
max("events"."created_at") AS "created_at"
|
|
17
|
+
FROM "junior_conversations" AS "conversations"
|
|
18
|
+
INNER JOIN "junior_conversation_events" AS "events"
|
|
19
|
+
ON "events"."conversation_id" = "conversations"."conversation_id"
|
|
20
|
+
AND "events"."type" IN ('message', 'message_updated')
|
|
21
|
+
WHERE "conversations"."last_activity_at" >= now() - interval '30 days'
|
|
22
|
+
GROUP BY "events"."conversation_id", coalesce("events"."payload"->>'messageId', 'seq:' || "events"."seq")
|
|
23
|
+
), "links" AS (
|
|
24
|
+
SELECT
|
|
25
|
+
"messages"."conversation_id",
|
|
26
|
+
"messages"."seq",
|
|
27
|
+
"messages"."created_at",
|
|
28
|
+
min("matches"."position") AS "position",
|
|
29
|
+
regexp_replace("matches"."match"[1], '[.,;:!?)\]}*_~]+$', '') AS "url"
|
|
30
|
+
FROM "messages"
|
|
31
|
+
CROSS JOIN LATERAL regexp_matches("messages"."payload"->>'text', 'https?://[^\t\n\v\f\r \u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff<>|"''\u0060]+', 'g') WITH ORDINALITY AS "matches"("match", "position")
|
|
32
|
+
WHERE "messages"."seq" IS NOT NULL
|
|
33
|
+
AND coalesce("messages"."payload"->'meta'->>'explicitMention', 'true') <> 'false'
|
|
34
|
+
GROUP BY 1, 2, 3, 5
|
|
35
|
+
), "ids" AS (
|
|
36
|
+
SELECT
|
|
37
|
+
"links".*,
|
|
38
|
+
encode(sha256(convert_to("links"."conversation_id" || ' ' || "links"."url", 'UTF8')), 'hex') AS "attachment_id"
|
|
39
|
+
FROM "links"
|
|
40
|
+
WHERE octet_length("links"."url") <= 2048
|
|
41
|
+
), "attachments" AS (
|
|
42
|
+
INSERT INTO "junior_attachments" ("id", "kind", "conversation_id", "url", "created_at")
|
|
43
|
+
SELECT DISTINCT ON ("attachment_id") "attachment_id", 'url', "conversation_id", "url", "created_at"
|
|
44
|
+
FROM "ids"
|
|
45
|
+
ORDER BY "attachment_id", "created_at"
|
|
46
|
+
ON CONFLICT ("id") DO NOTHING
|
|
47
|
+
)
|
|
48
|
+
INSERT INTO "junior_message_attachments" ("conversation_id", "seq", "attachment_id", "position")
|
|
49
|
+
SELECT "conversation_id", "seq", "attachment_id", "position"
|
|
50
|
+
FROM "ids"
|
|
51
|
+
ON CONFLICT DO NOTHING;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS "junior_attachments_conversation_url_idx" ON "junior_attachments" USING btree ("conversation_id","url") WHERE "junior_attachments"."url" IS NOT NULL;
|