@sentry/junior 0.302.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.
Files changed (100) hide show
  1. package/dist/{adapter-context-Cx9fn9B3.js → adapter-context-B1IpoELr.js} +2 -2
  2. package/dist/{admin-_poE5NKL.js → admin-BnVFGo_z.js} +5 -5
  3. package/dist/{agent-runner-CY9RvsTX.js → agent-runner-CoEeZSRh.js} +1461 -1248
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +6 -6
  6. package/dist/api.d.ts +13 -12
  7. package/dist/api.js +230 -105
  8. package/dist/{app-BpY3wtRP.d.ts → app-Cs157Zc5.d.ts} +17 -15
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +108 -96
  11. package/dist/{automation-Cva5ZOwW.js → automation-CuA3yEcD.js} +3 -1
  12. package/dist/{background-compaction-queue-CXFq1_Cz.js → background-compaction-queue-WLPNSF_b.js} +6 -6
  13. package/dist/{briefs-B3NG-pid.js → briefs-CagVVefw.js} +12 -9
  14. package/dist/{catalog-runtime-Dss0lSV6.js → catalog-runtime-B8ZXvXWm.js} +2 -2
  15. package/dist/cli/chat.d.ts +1 -1
  16. package/dist/cli/chat.js +21 -21
  17. package/dist/cli/check.js +10 -10
  18. package/dist/cli/env.d.ts +1 -0
  19. package/dist/cli/env.js +8 -7
  20. package/dist/cli/init.js +13 -4
  21. package/dist/cli/main.js +4 -4
  22. package/dist/cli/plugins.js +6 -6
  23. package/dist/cli/snapshot-create.js +7 -5
  24. package/dist/cli/upgrade.d.ts +2 -2
  25. package/dist/cli/upgrade.js +6 -6
  26. package/dist/{config-CzeZiMKs.js → config-DdO1BNcw.js} +142 -67
  27. package/dist/{connections-CDYhMfrs.js → connections-D20kp0j5.js} +6 -6
  28. package/dist/{continue-in-slack-7Uf05ndC.js → continue-in-slack-BKEVMBj1.js} +8 -8
  29. package/dist/{conversation-BNXfq6Lb.js → conversation-BOqdRtUx.js} +4 -12
  30. package/dist/{conversation-feed-Clf_cv0n.js → conversation-feed-CgpgP7yi.js} +35 -2
  31. package/dist/{conversation-privacy-D9xnM5mK.js → conversation-privacy-L1SK_v0V.js} +16 -8
  32. package/dist/{conversation-turn-D7SEZgTG.js → conversation-turn-BptVJylj.js} +20 -23
  33. package/dist/{credential-sync-DoD0gW-j.js → credential-sync-D1J1CGzL.js} +19 -19
  34. package/dist/{db-B-gtnNjr.js → db-EKJnkrIb.js} +180 -17
  35. package/dist/{db-BdsCzytP.d.ts → db-zbN5ZV_o.d.ts} +26 -26
  36. package/dist/{executor-DZg20EqU.js → executor-CoIZmFK8.js} +55 -15
  37. package/dist/{history-IjdmO_r6.js → history-m2-ceTTX.js} +21 -12
  38. package/dist/{install-t1KQyTUs.js → install-BT2Pf6HP.js} +3 -3
  39. package/dist/instrumentation.d.ts +4 -4
  40. package/dist/instrumentation.js +15 -11
  41. package/dist/{lineage-C79GjoQr.js → lineage-C5DGQCS_.js} +2 -2
  42. package/dist/{logging-C9oDAg4M.js → logging-QSZuMcvo.js} +19 -19
  43. package/dist/{message-BLUCzJXN.js → message-TtxftRHj.js} +9 -9
  44. package/dist/{model-input-5jwNC45G.js → model-input-BHXfA29g.js} +4 -9
  45. package/dist/nitro.d.ts +1 -1
  46. package/dist/nitro.js +8 -8
  47. package/dist/{oauth-callback-server-BBl66vCb.js → oauth-callback-server-B0enqHtZ.js} +5 -4
  48. package/dist/{oauth-relay-DRzq73b6.js → oauth-relay-DAmfVmJu.js} +3 -6
  49. package/dist/{package-discovery-DJhGdS4c.js → package-discovery-x4AvVhMj.js} +1 -1
  50. package/dist/{plugin-module-Cf5gVPWP.js → plugin-module-Cv2ETe8Y.js} +1 -1
  51. package/dist/{plugins-BBX07Jzt.js → plugins-Bkk0XRo2.js} +3 -3
  52. package/dist/{projection-CIBwgD3s.js → projection-CNKK7doO.js} +755 -221
  53. package/dist/{prompt-CRQbzp5e.js → prompt-DSjhoKu5.js} +185 -12
  54. package/dist/{queue-DtCDaIct.js → queue-CDxkit82.js} +4 -4
  55. package/dist/{queue-CZyYgPF0.d.ts → queue-CbEHUO0l.d.ts} +1 -1
  56. package/dist/{registry-DdFQHZ_d.js → registry-DBDNUUmz.js} +37 -37
  57. package/dist/{resolve-CdW4BdrK.js → resolve-CQLhMWSu.js} +3 -3
  58. package/dist/{result-oOMv1t4O.js → result-B-pauj42.js} +10 -15
  59. package/dist/rolldown-runtime-BKpuH2hG.js +26 -0
  60. package/dist/{runner-DqitLtm-.js → runner-B3KxKks5.js} +10 -10
  61. package/dist/{sandbox-egress-signals-Bw9I0yfJ.js → sandbox-egress-signals-DJJX9ClG.js} +1 -1
  62. package/dist/{schema-DnVQepWP.js → schema-Bx0Mlo32.js} +77 -13
  63. package/dist/{schema-BIFM-U1a.d.ts → schema-CKcu-IK6.d.ts} +562 -23
  64. package/dist/{secrets-DebYU866.js → secrets-DHaJ5TTn.js} +4 -4
  65. package/dist/{sentry-BRTJqumy.js → sentry-CPbZjomA.js} +3 -28
  66. package/dist/{sentry-route-name-BhwWnfqj.js → sentry-route-name-C6EIzAGP.js} +1 -1
  67. package/dist/{service-account-CrZftRTb.js → service-account-2HmlNPvy.js} +49 -48
  68. package/dist/{service-account-B6mKAPVo.js → service-account-DQLqkSVv.js} +5 -5
  69. package/dist/{session-stop-DW63Z3kj.js → session-stop-DEeZKqbX.js} +132 -74
  70. package/dist/{skills-C16fz60Z.js → skills-2UrD7JkN.js} +6 -9
  71. package/dist/{slack-conversation-unfurl-BHhefEb7.js → slack-conversation-unfurl-Dd129Uov.js} +14 -18
  72. package/dist/{spawn-D_RnFYfy.js → spawn-eMho9HDJ.js} +7 -7
  73. package/dist/{legacy-web-actor-id-C-cEeWqL.js → state-Bveuc4Zh.js} +32 -32
  74. package/dist/{stop-7p1i08CY.js → stop-D_ltJLDS.js} +359 -171
  75. package/dist/{store-C28I0CVW.js → store-COeYnPL_.js} +5 -5
  76. package/dist/{task-queue-BVUJbQ28.js → task-queue-CBIDXZpV.js} +3 -3
  77. package/dist/{task-runner-CWi8j7Z6.js → task-runner-CJF7zIJL.js} +15 -18
  78. package/dist/{thread-context-D3-yYUd0.js → thread-context-Cg0jt0aE.js} +12 -12
  79. package/dist/{turn-session-routing-BFMS9ATF.js → turn-session-routing-CaY3Tp8m.js} +32 -32
  80. package/dist/{turn-user-message-C3-O8Omt.js → turn-user-message-tcom1RYd.js} +3 -3
  81. package/dist/{validation-BSFKUIb4.js → validation-EU91JwIT.js} +2 -2
  82. package/dist/vercel.js +1 -1
  83. package/dist/{version-BHHXNi-0.js → version-BYRPhY5G.js} +1 -1
  84. package/dist/version.js +1 -1
  85. package/dist/{viewer-B1SO21Qa.js → viewer-Cf8ISkAc.js} +3 -3
  86. package/dist/{warmup-Bz9bzkzN.js → warmup-TgY4S1vx.js} +202 -577
  87. package/dist/{worker-BspReIIK.js → worker-C6Uq4OKD.js} +9 -12
  88. package/migrations/0109_user_preferences.sql +1 -0
  89. package/migrations/0110_code_change_repository_state_index.sql +1 -0
  90. package/migrations/0111_attachment_kinds.sql +14 -0
  91. package/migrations/0112_attachment_url_fill.sql +51 -0
  92. package/migrations/0113_attachment_url_index.sql +1 -0
  93. package/migrations/meta/0099_snapshot.json +102 -326
  94. package/migrations/meta/0109_snapshot.json +4925 -0
  95. package/migrations/meta/0110_snapshot.json +4952 -0
  96. package/migrations/meta/0111_snapshot.json +5011 -0
  97. package/migrations/meta/0112_snapshot.json +5011 -0
  98. package/migrations/meta/0113_snapshot.json +5033 -0
  99. package/migrations/meta/_journal.json +36 -1
  100. package/package.json +16 -19
@@ -1,11 +1,11 @@
1
- import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { Ct as countPendingConversationMessages, Nt as isFinalAttempt, Pt as isInvalidConversationRecordError, jt as hasConversationStop } from "./projection-CIBwgD3s.js";
3
- import { i as getChatConfig, q as isProviderRetryError } from "./config-CzeZiMKs.js";
4
- import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-C9oDAg4M.js";
5
- import { t as getConversationStoppedAtMs } from "./session-stop-DW63Z3kj.js";
6
- import { Bn as selectAttemptMessages, zn as isAttemptInterrupt } from "./warmup-Bz9bzkzN.js";
7
- import { _ as nudgeIdempotencyKey, m as ConversationQueueMessageRejectedError, p as getTurnRequestDeadline } from "./background-compaction-queue-CXFq1_Cz.js";
8
- 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-C28I0CVW.js";
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-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
@@ -59,10 +59,7 @@ async function requestLostLeaseRecovery(args) {
59
59
  });
60
60
  }
61
61
  // src/chat/task-execution/worker.ts
62
- var worker_exports = /* @__PURE__ */ __exportAll({
63
- CONVERSATION_WORK_DEFER_DELAY_MS: () => CONVERSATION_WORK_DEFER_DELAY_MS,
64
- processConversationWork: () => processConversationWork
65
- });
62
+ var worker_exports = /* @__PURE__ */ __exportAll({ processConversationWork: () => processConversationWork });
66
63
  const CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
67
64
  const CONVERSATION_STOP_CHECK_INTERVAL_MS = 500;
68
65
  function now(options) {
@@ -0,0 +1 @@
1
+ ALTER TABLE "junior_users" ADD COLUMN "preferences" jsonb DEFAULT '{}'::jsonb NOT NULL;
@@ -0,0 +1 @@
1
+ CREATE INDEX CONCURRENTLY IF NOT EXISTS "junior_code_changes_repository_state_idx" ON "junior_code_changes" USING btree ("repository_id","state","updated_at" DESC NULLS LAST);
@@ -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;