@sentry/junior 0.294.0 → 0.296.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 (79) hide show
  1. package/dist/{admin-vt8aSiCD.js → admin-z_lgDi-z.js} +2 -2
  2. package/dist/{agent-runner-DJu7w6mI.js → agent-runner-HoQiUKLL.js} +318 -199
  3. package/dist/api/schema.d.ts +2 -2
  4. package/dist/api/schema.js +5 -5
  5. package/dist/api.d.ts +1 -1
  6. package/dist/api.js +321 -331
  7. package/dist/{app--a5RLOrr.d.ts → app-C75Ft-A_.d.ts} +3 -3
  8. package/dist/app.d.ts +2 -2
  9. package/dist/app.js +33 -34
  10. package/dist/{automation-BM-OBsKW.js → automation-yJX3C7i3.js} +3 -3
  11. package/dist/{background-compaction-queue-D2j-0XkH.js → background-compaction-queue-Cre1wFt9.js} +7 -9
  12. package/dist/{briefs-JOAoCb6d.js → briefs-BXECHduJ.js} +3 -3
  13. package/dist/{catalog-runtime-CLMA9AXd.js → catalog-runtime-CpCmlD9L.js} +1 -1
  14. package/dist/cli/chat.d.ts +1 -1
  15. package/dist/cli/chat.js +15 -15
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/init.js +2 -0
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.d.ts +1 -1
  20. package/dist/cli/plugins.js +4 -4
  21. package/dist/cli/snapshot-create.js +4 -4
  22. package/dist/cli/upgrade.d.ts +2 -2
  23. package/dist/cli/upgrade.js +3 -3
  24. package/dist/{config-mIZeGEWv.js → config-CCPHvTqx.js} +59 -2
  25. package/dist/{connections-XhdVg7OR.js → connections-B5pWh8e2.js} +6 -6
  26. package/dist/{conversation-CDWejM4R.js → conversation-CMkSmi02.js} +2 -11
  27. package/dist/{conversation-pending-messages-Dh2tfbaw.js → conversation-feed-BVAOga0H.js} +27 -2
  28. package/dist/{conversation-privacy-C6h-X2cZ.js → conversation-privacy-CZD5soDW.js} +1 -1
  29. package/dist/{credential-sync-zigBlXS3.js → credential-sync-DwLkIvXI.js} +16 -15
  30. package/dist/{db-DV5AbcGM.d.ts → db-B3iyr_Or.d.ts} +6 -1
  31. package/dist/{db--xuNV7g6.js → db-C1M1y-bh.js} +64 -26
  32. package/dist/{executor-BItuRqAR.js → executor-DUSEwXaO.js} +16 -5
  33. package/dist/instrumentation.js +19 -2
  34. package/dist/{logging-Cb6MGvdt.js → logging-D0svFM8r.js} +2 -1
  35. package/dist/{message-BTGgSmaH.js → message-BFnIwKpx.js} +9 -9
  36. package/dist/nitro.d.ts +2 -2
  37. package/dist/nitro.js +2 -2
  38. package/dist/{oauth-callback-server-Dvh1aOIi.js → oauth-callback-server-BXRtD6Fk.js} +2 -2
  39. package/dist/{oauth-relay-D6xxVywK.js → oauth-relay-CsfIazeF.js} +2 -1
  40. package/dist/{plugins-DtmjkTza.d.ts → plugins-B_0Cr0MO.d.ts} +0 -1
  41. package/dist/{projection-DLQgfO5N.js → projection-B6VS7kbo.js} +386 -108
  42. package/dist/{prompt-qp_LdxLX.js → prompt-CD11tfG8.js} +4 -4
  43. package/dist/{registry-MtwokaqW.js → registry-CHewwYEo.js} +3 -13
  44. package/dist/{resolve-BnJA0UNE.js → resolve-1owMH4qo.js} +3 -3
  45. package/dist/{result-ChL-1KyW.js → result-CEqQFrEf.js} +8 -8
  46. package/dist/{runner-BONN7Dp2.js → runner-BtWvJslp.js} +8 -8
  47. package/dist/{sandbox-egress-signals-nmlmI5Ab.js → sandbox-egress-signals-ByftwJVt.js} +1 -1
  48. package/dist/{schema-DgvcyJ1y.d.ts → schema-Ct1Zf2xy.d.ts} +66 -14
  49. package/dist/{schema-yr0ccDni.js → schema-D2iGyYIp.js} +24 -6
  50. package/dist/secrets-DebYU866.js +18 -0
  51. package/dist/{service-account-Bd0lBaGr.js → service-account-BZEuMKdo.js} +3 -3
  52. package/dist/{service-account-kio5nXSD.js → service-account-DLoeoHww.js} +42 -26
  53. package/dist/{session-stop-CeCXL3j9.js → session-stop-hYNTNpVf.js} +23 -778
  54. package/dist/{skills-e3DDNlKO.js → skills-DXgd5Inh.js} +3 -3
  55. package/dist/{spawn--cRxITWQ.js → spawn-YeqlNDv8.js} +5 -5
  56. package/dist/{adapter-DxLhJEnO.js → state-C3CbtD_m.js} +132 -2
  57. package/dist/{stop-Iai5N2PU.js → stop-Cze_pEL8.js} +351 -255
  58. package/dist/{store-C8LsaJwS.js → store-CZ9vqR4P.js} +3 -3
  59. package/dist/{task-runner-Dw7exu0-.js → task-runner-CMiNGsER.js} +275 -251
  60. package/dist/{turn-failure-response-BqTTx3XG.js → turn-failure-response-pXhZ2wMK.js} +12 -9
  61. package/dist/{validation-BrGahtnv.js → validation-Du7NdkOR.js} +1 -1
  62. package/dist/{version-Bdqhx8Qh.js → version-EN3Wnq-R.js} +1 -1
  63. package/dist/version.js +1 -1
  64. package/dist/{viewer-CjRFHR5U.js → viewer-Agxi_o5c.js} +3 -3
  65. package/dist/warmup-CY2ArYag.js +2017 -0
  66. package/dist/{work-BWBG1EGV.js → work-EA98F0ia.js} +11 -11
  67. package/dist/{worker-DAnBIVMs.js → worker-BALVdWbv.js} +6 -6
  68. package/migrations/0098_review_item_plugin_actions.sql +5 -0
  69. package/migrations/0099_conversation_last_message_at.sql +1 -0
  70. package/migrations/0100_automation_task_kind_repair.sql +48 -0
  71. package/migrations/0101_drop_legacy_columns.sql +12 -0
  72. package/migrations/meta/0098_snapshot.json +4490 -0
  73. package/migrations/meta/0099_snapshot.json +4720 -0
  74. package/migrations/meta/0100_snapshot.json +4496 -0
  75. package/migrations/meta/0101_snapshot.json +4496 -0
  76. package/migrations/meta/_journal.json +28 -0
  77. package/package.json +6 -5
  78. package/dist/assistant-reply-iTtEdDyc.js +0 -58
  79. package/dist/warmup-DuxCtzKC.js +0 -1039
@@ -1,15 +1,15 @@
1
- import { H as PluginCredentialFailureError, K as AuthorizationFlowDisabledError, Sn as renderTag, Xt as isTurnExecutionLimitExceededError, at as failTurnRecord, et as lostWorkerBeforeFirstSave, go 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-DLQgfO5N.js";
2
- import { n as botConfig } from "./config-mIZeGEWv.js";
3
- import { A as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore, s as getSqlExecutor } from "./db--xuNV7g6.js";
4
- import { g as juniorAgentInvocations, h as juniorAgentBindings } from "./executor-BItuRqAR.js";
1
+ import { H as PluginCredentialFailureError, K as AuthorizationFlowDisabledError, Sn as renderTag, Xt as isTurnExecutionLimitExceededError, at as failTurnRecord, et as lostWorkerBeforeFirstSave, go 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-B6VS7kbo.js";
2
+ import { n as botConfig } from "./config-CCPHvTqx.js";
3
+ import { M as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore, s as getSqlExecutor } from "./db-C1M1y-bh.js";
4
+ import { g as juniorAgentInvocations, h as juniorAgentBindings } from "./executor-DUSEwXaO.js";
5
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-DJu7w6mI.js";
7
- import { k as getTurnRequestDeadline } from "./background-compaction-queue-D2j-0XkH.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-BqTTx3XG.js";
9
- import { n as getAssistantReplyText } from "./assistant-reply-iTtEdDyc.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-CeCXL3j9.js";
11
- import { r as appendAndEnqueueInboundMessage } from "./store-C8LsaJwS.js";
12
- import { ft as getPersistedSandboxState, gt as coerceThreadConversationState, ht as persistThreadStateById, pt as getPersistedThreadState } from "./task-runner-Dw7exu0-.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-HoQiUKLL.js";
7
+ import { M as readBlockedReport, T as getAssistantReplyText } from "./warmup-CY2ArYag.js";
8
+ import { k as getTurnRequestDeadline } from "./background-compaction-queue-Cre1wFt9.js";
9
+ 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-pXhZ2wMK.js";
10
+ import { $ as withoutSavedSteeringMessages, B as maybePostAutomatedTurnLimitNotice, K as recordFinishedTurnForAutomatedLimit, X as buildSteeringPiMessage, Z as instructionForInputs, h as parseWebMessages, i as resumeStoppedConversationTree, p as listActiveMailboxTurns, q as resetAutomatedTurnLimit, u as getActiveConversationTurnId } from "./session-stop-hYNTNpVf.js";
11
+ import { r as appendAndEnqueueInboundMessage } from "./store-CZ9vqR4P.js";
12
+ import { c as getPersistedThreadState, d as coerceThreadConversationState, s as getPersistedSandboxState, u as persistThreadStateById } from "./task-runner-CMiNGsER.js";
13
13
  import { isDeepStrictEqual } from "node:util";
14
14
  import * as z from "zod";
15
15
  import { and, eq } from "drizzle-orm";
@@ -1,10 +1,10 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { At as isInvalidConversationRecordError, Dt as hasConversationStop, St as countPendingConversationMessages, kt as isFinalAttempt } from "./projection-DLQgfO5N.js";
3
- import { K as isProviderRetryError, i as getChatConfig } from "./config-mIZeGEWv.js";
4
- import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-Cb6MGvdt.js";
5
- import { Ht as selectAttemptMessages, Vt as isAttemptInterrupt } from "./agent-runner-DJu7w6mI.js";
6
- import { k as getTurnRequestDeadline, y as ConversationQueueMessageRejectedError } from "./background-compaction-queue-D2j-0XkH.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-C8LsaJwS.js";
2
+ import { At as isInvalidConversationRecordError, Dt as hasConversationStop, St as countPendingConversationMessages, kt as isFinalAttempt } from "./projection-B6VS7kbo.js";
3
+ import { K as isProviderRetryError, i as getChatConfig } from "./config-CCPHvTqx.js";
4
+ import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-D0svFM8r.js";
5
+ import { Ht as selectAttemptMessages, Vt as isAttemptInterrupt } from "./agent-runner-HoQiUKLL.js";
6
+ import { k as getTurnRequestDeadline, y as ConversationQueueMessageRejectedError } from "./background-compaction-queue-Cre1wFt9.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-CZ9vqR4P.js";
8
8
  // src/chat/task-execution/worker.ts
9
9
  var worker_exports = /* @__PURE__ */ __exportAll({
10
10
  CONVERSATION_WORK_DEFER_DELAY_MS: () => CONVERSATION_WORK_DEFER_DELAY_MS,
@@ -0,0 +1,5 @@
1
+ ALTER TABLE "junior_review_items" DROP CONSTRAINT "junior_review_items_kind_check";--> statement-breakpoint
2
+ -- The new check only allows more rows than the old one, so every row passes.
3
+ -- NOT VALID skips the scan under lock and still checks every new write. A
4
+ -- later migration validates it.
5
+ ALTER TABLE "junior_review_items" ADD CONSTRAINT "junior_review_items_kind_check" CHECK (("junior_review_items"."kind" = 'notice' and "junior_review_items"."request" is null and "junior_review_items"."answer" is null) or ("junior_review_items"."kind" = 'action' and ("junior_review_items"."request" is not null or ("junior_review_items"."dedupe_key" like 'plugin:%' and "junior_review_items"."answer" is null)))) NOT VALID;
@@ -0,0 +1 @@
1
+ ALTER TABLE "junior_conversations" ADD COLUMN "last_message_at" timestamp with time zone;
@@ -0,0 +1,48 @@
1
+ -- Repeat the `{ text }` task rewrite of 0096_automation_task_kind.
2
+ -- `junior upgrade` runs migrations before the new runtime takes traffic. In
3
+ -- that window the old runtime still created Automations, and it wrote the old
4
+ -- `{ text }` task and an `instruction` version definition after 0096 ran.
5
+ -- The new runtime cannot read those rows. Each statement changes only rows
6
+ -- with the old shape, so this migration is safe to run again.
7
+ -- junior:bounded-backfill: changes only active or paused Automations with an old, blank task, which cannot run, so few rows match.
8
+ UPDATE "junior_automations"
9
+ SET
10
+ "status" = 'blocked',
11
+ "status_reason" = 'This automation has no instruction. Write one or choose a skill, then resume it.'
12
+ WHERE "record"->'task' ? 'text'
13
+ AND btrim("record"->'task'->>'text', E' \t\r\n') = ''
14
+ AND "status" IN ('active', 'paused');--> statement-breakpoint
15
+ -- junior:bounded-backfill: changes only Automations with an old task, which the old runtime wrote during one rollout, so few rows match.
16
+ WITH "old" AS (
17
+ SELECT
18
+ "id",
19
+ coalesce(
20
+ nullif(btrim("record"->'task'->>'text', E' \t\r\n'), ''),
21
+ 'No instruction was saved.'
22
+ ) AS "instruction"
23
+ FROM "junior_automations"
24
+ WHERE "record"->'task' ? 'text'
25
+ )
26
+ UPDATE "junior_automations"
27
+ SET
28
+ "instruction" = "old"."instruction",
29
+ "record" = jsonb_set(
30
+ "record",
31
+ '{task}',
32
+ jsonb_build_object('kind', 'instruction', 'instruction', "old"."instruction")
33
+ )
34
+ FROM "old"
35
+ WHERE "junior_automations"."id" = "old"."id";--> statement-breakpoint
36
+ -- junior:bounded-backfill: changes only saved versions with an old definition, which the old runtime wrote during one rollout, so few rows match.
37
+ UPDATE "junior_automation_versions"
38
+ SET "definition" = ("definition" - 'instruction') || jsonb_build_object(
39
+ 'task',
40
+ jsonb_build_object(
41
+ 'kind', 'instruction',
42
+ 'instruction', coalesce(
43
+ nullif(btrim("definition"->>'instruction', E' \t\r\n'), ''),
44
+ 'No instruction was saved.'
45
+ )
46
+ )
47
+ )
48
+ WHERE "definition" ? 'instruction';
@@ -0,0 +1,12 @@
1
+ -- Repeat the awaiting_resume rename of 0089_conversation_paused_status.
2
+ -- Workers before 0.288.0 still wrote awaiting_resume after 0089 ran, and
3
+ -- readers no longer accept that name.
4
+ -- junior:bounded-backfill: changes only Conversations that an old worker paused and that did not resume, so few rows match.
5
+ UPDATE "junior_conversations" SET "execution_status" = 'paused' WHERE "execution_status" = 'awaiting_resume';--> statement-breakpoint
6
+ -- 0057_drop_legacy_automation_tables removed these from the snapshot and kept
7
+ -- them in the database for one release.
8
+ DROP INDEX IF EXISTS "junior_conversations_origin_idx";--> statement-breakpoint
9
+ ALTER TABLE "junior_conversations" DROP COLUMN IF EXISTS "origin_type";--> statement-breakpoint
10
+ ALTER TABLE "junior_conversations" DROP COLUMN IF EXISTS "origin_id";--> statement-breakpoint
11
+ ALTER TABLE "junior_conversations" DROP COLUMN IF EXISTS "origin_run_id";--> statement-breakpoint
12
+ ALTER TABLE "junior_automation_versions" DROP COLUMN IF EXISTS "kind";