@sentry/junior 0.311.0 → 0.312.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 (118) hide show
  1. package/dist/{adapter-context-G2M0y6rP.js → adapter-context-BRjEWRy1.js} +2 -2
  2. package/dist/{adapter-B1wujchl.js → adapter-iIq7ihf7.js} +1 -1
  3. package/dist/{admin-DCiBhUT1.js → admin-DhInw5K9.js} +1 -1
  4. package/dist/{agent-runner-BVHPUIc8.js → agent-runner-C9iDurwX.js} +3423 -3477
  5. package/dist/api/schema.d.ts +2 -2
  6. package/dist/api/schema.js +6 -6
  7. package/dist/api.d.ts +2 -2
  8. package/dist/api.js +289 -306
  9. package/dist/{app-Cw5Vy6H6.d.ts → app-DRFrC8Mw.d.ts} +2 -9
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +338 -604
  12. package/dist/{background-compaction-queue-CJDnWVOJ.js → background-compaction-queue-DrKi7w3d.js} +10 -85
  13. package/dist/callback-mFlTUWWx.js +75 -0
  14. package/dist/{catalog-runtime-DMY3VV-D.js → catalog-runtime-D7xapBAX.js} +1 -1
  15. package/dist/channel-access-CJGfNTdn.js +221 -0
  16. package/dist/child-message-DcsritGf.js +179 -0
  17. package/dist/cli/chat.js +18 -19
  18. package/dist/cli/check.js +3 -3
  19. package/dist/cli/init.js +0 -1
  20. package/dist/cli/main.js +3 -7
  21. package/dist/cli/plugins.js +4 -4
  22. package/dist/cli/run.d.ts +1 -2
  23. package/dist/cli/run.js +1 -2
  24. package/dist/cli/snapshot-create.js +5 -5
  25. package/dist/cli/upgrade.d.ts +1 -1
  26. package/dist/cli/upgrade.js +3 -3
  27. package/dist/{config-BrXDQefC.js → config-kXB2Y5tl.js} +59 -27
  28. package/dist/{continue-in-slack-DNXSC9So.js → continue-in-slack-O6pV5004.js} +7 -8
  29. package/dist/{conversation-feed-DkinDu5o.js → conversation-feed-uNOv_x68.js} +74 -20
  30. package/dist/{conversation-privacy-DxttrKb9.js → conversation-privacy-L4ja1_W6.js} +1 -1
  31. package/dist/{conversation-turn-DWw7Xhdr.js → conversation-turn-CeLbHqdw.js} +31 -27
  32. package/dist/{credential-sync-Bk8wGb8Y.js → credential-sync-I8VBGk05.js} +16 -15
  33. package/dist/{projection-Cns7XwWa.js → credentialed-Cb6E2phL.js} +16308 -20732
  34. package/dist/{db-7ETESH44.d.ts → db-BbC5stfa.d.ts} +11 -6
  35. package/dist/{db-DTxzH7u5.js → db-LAyyX8tk.js} +174 -91
  36. package/dist/{executor-DqTiYj9S.js → executor-SCub-fAq.js} +117 -97
  37. package/dist/{html-B9Sl4Axb.js → html-BCZ3Xtb_.js} +6 -6
  38. package/dist/ingest-BDf3D50j.js +3836 -0
  39. package/dist/{install-Sg4ePfLl.js → install-DCFJFkC0.js} +2 -2
  40. package/dist/instrumentation.js +3 -3
  41. package/dist/{lineage-BHAMpNKr.js → lineage-B_m-4TJw.js} +2 -2
  42. package/dist/{stop-CYsfc0Ed.js → list-CN2QA2R9.js} +663 -442
  43. package/dist/{logging-FjclQsXu.js → logging-dQ9ZRGQ8.js} +1 -1
  44. package/dist/{schedule-BLJ476XQ.js → media-CYm1QD8T.js} +1055 -11
  45. package/dist/{message-CJ7_RL50.js → message-DSXGj1hM.js} +19 -26
  46. package/dist/{model-input-CMLh4Cwq.js → model-input--TrP9hYV.js} +3 -3
  47. package/dist/nitro.d.ts +1 -1
  48. package/dist/nitro.js +4 -3
  49. package/dist/{oauth-callback-server-RVcbiDjL.js → oauth-callback-server-DHCZC6B4.js} +2 -2
  50. package/dist/{oauth-relay-Bu9kkaQu.js → oauth-relay-pPMGnDZt.js} +1 -1
  51. package/dist/{registry-BPwuOP2O.js → registry-CZOzddwu.js} +1 -1
  52. package/dist/{resolve-BK29bBry.js → resolve-cKOQ14Dh.js} +3 -3
  53. package/dist/result-DcvEOe1r.js +574 -0
  54. package/dist/result-event-type-BdIJuZxg.js +48 -0
  55. package/dist/{runner-BcAE-cJm.js → runner-DBfUW44l.js} +14 -16
  56. package/dist/{sandbox-egress-signals-C-q0go5b.js → sandbox-egress-signals-BVF_xAm1.js} +1 -1
  57. package/dist/{schema-DYcJeV7d.d.ts → schema-BEHKxr4I.d.ts} +166 -242
  58. package/dist/{schema-BLgSZXcL.js → schema-Bk9Nm2E8.js} +106 -121
  59. package/dist/{service-account-iJoCtkHR.js → service-account-CVYsFjty.js} +3 -3
  60. package/dist/{service-account-gN0zqf0S.js → service-account-Ts4ulcrV.js} +5 -5
  61. package/dist/{skills-BoZ80epJ.js → skills-VTnhAJWm.js} +2 -2
  62. package/dist/{slack-conversation-unfurl-CogYrITA.js → slack-conversation-unfurl-fuLnF1jE.js} +9 -9
  63. package/dist/{spawn-Dk92r7mX.js → spawn-vxAarlX5.js} +6 -5
  64. package/dist/start-conversation-CEn2KH1A.js +941 -0
  65. package/dist/{state-DH3Cmgp3.js → state-C1P3_Ywk.js} +4 -4
  66. package/dist/statuses-_cRJHXK7.js +150 -0
  67. package/dist/store-DFZaN-Ix.js +492 -0
  68. package/dist/task-queue-Cx4Lmjyk.js +90 -0
  69. package/dist/task-runner-CbTwFA6k.js +1432 -0
  70. package/dist/{thread-context-BW2BsQbH.js → thread-context-BkAZDTX2.js} +7 -7
  71. package/dist/thread-state-DhPndWi1.js +5625 -0
  72. package/dist/{validation-DrJd0nnq.js → validation-nIzMtAVJ.js} +1 -1
  73. package/dist/{task-queue-C_zldF5J.js → vercel-queue-hW90XzbG.js} +93 -172
  74. package/dist/{version-CNKZ8owc.js → version-Brbtz4Qf.js} +1 -1
  75. package/dist/version.js +1 -1
  76. package/dist/{warmup-BWdHew2H.js → warmup-BDA5myRK.js} +6463 -12290
  77. package/dist/web-message-id-C6P83ans.js +10 -0
  78. package/dist/{worker-t9qpu_Zx.js → worker-D63RcaVD.js} +20 -7
  79. package/migrations/0143_todos.sql +14 -0
  80. package/migrations/0144_inbox_items.sql +32 -0
  81. package/migrations/0145_todo_changed_by_agent.sql +1 -0
  82. package/migrations/0146_inbox_item_subject_title_parts.sql +1 -0
  83. package/migrations/0147_inbox_snooze_wake_reason.sql +1 -0
  84. package/migrations/0148_authorization_request_index.sql +1 -0
  85. package/migrations/0149_conversation_metadata.sql +10 -0
  86. package/migrations/0150_conversation_metadata_fill.sql +39 -0
  87. package/migrations/0151_conversation_search_index.sql +1 -0
  88. package/migrations/0152_inbox_item_legacy_automation_keys.sql +21 -0
  89. package/migrations/0153_artifact_expiry.sql +1 -0
  90. package/migrations/0154_artifact_permanent_sha_index.sql +1 -0
  91. package/migrations/0155_artifact_drop_public_sha_index.sql +3 -0
  92. package/migrations/0156_conversation_kind_lead.sql +6 -0
  93. package/migrations/0157_conversation_lead_actor_index.sql +1 -0
  94. package/migrations/meta/0143_snapshot.json +6434 -0
  95. package/migrations/meta/0144_snapshot.json +6434 -0
  96. package/migrations/meta/0145_snapshot.json +6440 -0
  97. package/migrations/meta/0146_snapshot.json +6446 -0
  98. package/migrations/meta/0147_snapshot.json +6452 -0
  99. package/migrations/meta/0148_snapshot.json +6474 -0
  100. package/migrations/meta/0149_snapshot.json +6490 -0
  101. package/migrations/meta/0150_snapshot.json +6490 -0
  102. package/migrations/meta/0151_snapshot.json +6505 -0
  103. package/migrations/meta/0152_snapshot.json +6505 -0
  104. package/migrations/meta/0153_snapshot.json +6511 -0
  105. package/migrations/meta/0154_snapshot.json +6533 -0
  106. package/migrations/meta/0155_snapshot.json +6511 -0
  107. package/migrations/meta/0156_snapshot.json +6511 -0
  108. package/migrations/meta/0157_snapshot.json +6527 -0
  109. package/migrations/meta/_journal.json +106 -1
  110. package/package.json +6 -6
  111. package/skills/design-automation-skill/SKILL.md +108 -0
  112. package/dist/briefs-BDjnug6Y.js +0 -395
  113. package/dist/conversation-ca__NDQW.js +0 -1063
  114. package/dist/prompt-CDqcsDYC.js +0 -910
  115. package/dist/store-DmmMIrQi.js +0 -335
  116. package/dist/task-runner-C7oCJQIx.js +0 -294
  117. package/dist/turn-session-routing-Xh_2nSQe.js +0 -261
  118. package/dist/web-message-id-Ch5dPq-a.js +0 -306
@@ -1,9 +1,11 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { N as actorFromRun, P as toolInvocationDestination } from "./agent-runner-BVHPUIc8.js";
3
- import { In as enqueueAgentInvocation, Jn as getActiveAgentInvocationForConversation, On as enqueueAgentMessageToParent, Zn as getLatestAgentInvocationForConversation, fi as admitAutomatedTurn, ir as findChildAgentConversationId, jn as readChildConversationSender, nn as EVENT_WAIT_MS, nr as AgentMessagePausedError, or as PARENT_AGENT_TARGET, qn as createAgentInvocationForMessage, rr as AgentMessageTargetError, vn as postAutomatedTurnLimitNoticeForConversation } from "./warmup-BWdHew2H.js";
4
- import { Yt as SYSTEM_IDENTITY_ID, a as getConversationStore, dn as canAccessConversation, hn as readConversationAccessFromSql, o as getDb } from "./db-DTxzH7u5.js";
5
- import { at as renderUntrustedTag, n as botConfig } from "./config-BrXDQefC.js";
6
- import { r as appendAndEnqueueInboundMessage } from "./store-DmmMIrQi.js";
2
+ import { A as actorFromRun, j as toolInvocationDestination } from "./agent-runner-C9iDurwX.js";
3
+ import { $t as createAgentInvocationForMessage, Et as getActiveAgentInvocationForConversation, Zt as enqueueAgentInvocation, an as PARENT_AGENT_TARGET, kt as getLatestAgentInvocationForConversation, nn as AgentMessageTargetError, rn as findChildAgentConversationId, zt as readChildConversationSender } from "./warmup-BDA5myRK.js";
4
+ import { a as enqueueAgentMessageToParent } from "./result-DcvEOe1r.js";
5
+ import { Qt as SYSTEM_IDENTITY_ID, a as getConversationStore, mn as canAccessConversation, o as getDb, yn as readConversationAccessFromSql } from "./db-LAyyX8tk.js";
6
+ import { E as enqueueAutomatedInput, p as EVENT_WAIT_MS } from "./ingest-BDf3D50j.js";
7
+ import { it as renderUntrustedTag } from "./config-kXB2Y5tl.js";
8
+ import { i as leadPersonParticipates } from "./start-conversation-CEn2KH1A.js";
7
9
  // src/chat/agent-invocations/top-level-message.ts
8
10
  const AGENT_MESSAGE_EVENT_NAMESPACE = "junior";
9
11
  /** Event type of a message from another top-level agent. */
@@ -12,7 +14,9 @@ const TOP_LEVEL_AGENT_MESSAGE_EVENT_TYPE = "agent.top_level_message";
12
14
  * Check that a top-level agent can message another top-level agent under
13
15
  * `policies/conversation-access.md`. Public agents can message each other.
14
16
  * A private agent can message only agents at its own Destination, such as
15
- * another thread in the same private Slack channel.
17
+ * another thread in the same private Slack channel. A Lead can also message
18
+ * a public root where its person is a Participant, so it can steer the
19
+ * person's work.
16
20
  * Every target that the sender cannot reach gets the same error, so the
17
21
  * error does not show that a private Conversation exists.
18
22
  */
@@ -30,7 +34,10 @@ async function requireTopLevelAgentAccess(args) {
30
34
  requester: sender,
31
35
  target: receiver
32
36
  })) throw notReachable;
33
- if (receiver.visibility === "public" && sender.visibility !== "public") throw new AgentMessageTargetError(`"${args.to}" is a public conversation and this conversation is private. A private conversation can message only conversations in its own channel or DM`);
37
+ if (receiver.visibility === "public" && sender.visibility !== "public" && !await leadPersonParticipates({
38
+ leadConversationId: args.senderConversationId,
39
+ rootConversationId: args.to
40
+ })) throw new AgentMessageTargetError(`"${args.to}" is a public conversation and this conversation is private. A private conversation can message only conversations in its own channel or DM`);
34
41
  }
35
42
  function renderTopLevelMessageInput(args) {
36
43
  return renderUntrustedTag("agent-message", {
@@ -40,28 +47,14 @@ function renderTopLevelMessageInput(args) {
40
47
  }
41
48
  /**
42
49
  * Send one message from a top-level agent to another top-level agent and
43
- * wake the target. The access check runs on each call. A paused target
44
- * (automated-turn limit) takes no message, so two agents cannot keep each
45
- * other running. Repeat calls with the same `messageKey` are safe.
50
+ * wake the target. The access check runs on each call. A stopped target
51
+ * holds the message, so once the automated-turn limit stops one of two
52
+ * agents, they cannot keep each other running. Repeat calls with the same
53
+ * `messageKey` are safe.
46
54
  */
47
55
  async function enqueueTopLevelAgentMessage(args) {
48
56
  await requireTopLevelAgentAccess(args);
49
57
  const nowMs = args.nowMs ?? Date.now();
50
- const maxTurns = botConfig.maxConsecutiveAutomatedTurns;
51
- const decision = await admitAutomatedTurn({
52
- conversationId: args.to,
53
- maxTurns,
54
- nowMs,
55
- state: args.state
56
- });
57
- if (decision.status === "paused") {
58
- if (decision.shouldPostNotice) await postAutomatedTurnLimitNoticeForConversation({
59
- conversationId: args.to,
60
- maxTurns,
61
- nowMs
62
- });
63
- throw new AgentMessagePausedError(args.to);
64
- }
65
58
  const inboundMessageId = `agent-message:${args.senderConversationId}:${args.messageKey}`;
66
59
  const summary = `Top-level agent ${args.senderConversationId} sent a message.`;
67
60
  const metadata = {
@@ -74,7 +67,7 @@ async function enqueueTopLevelAgentMessage(args) {
74
67
  trustedSummary: summary
75
68
  }
76
69
  };
77
- await appendAndEnqueueInboundMessage({
70
+ await enqueueAutomatedInput({
78
71
  message: {
79
72
  conversationId: args.to,
80
73
  createdAtMs: nowMs,
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { s as getSqlExecutor } from "./db-DTxzH7u5.js";
3
- import { m as isVisionImageMediaType, p as detectImageMediaType } from "./web-message-id-Ch5dPq-a.js";
4
- import { Ja as readLiveAttachment } from "./projection-Cns7XwWa.js";
2
+ import { s as getSqlExecutor } from "./db-LAyyX8tk.js";
3
+ import { i as isVisionImageMediaType, r as detectImageMediaType } from "./media-CYm1QD8T.js";
4
+ import { i as readLiveAttachment } from "./store-DFZaN-Ix.js";
5
5
  import { escapeTagText, renderTag } from "@sentry/junior-plugin-api";
6
6
  // src/chat/attachments/model-input.ts
7
7
  var model_input_exports = /* @__PURE__ */ __exportAll({ loadInputAttachments: () => loadInputAttachments });
package/dist/nitro.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as JuniorPluginSet } from "./plugins-fBrz8PCV.js";
2
- import { i as JuniorDashboardOptions } from "./app-Cw5Vy6H6.js";
2
+ import { i as JuniorDashboardOptions } from "./app-DRFrC8Mw.js";
3
3
  import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
4
4
  type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
5
5
  type SentryNitroOptions = NonNullable<Parameters<typeof withSentryConfig$1>[1]>;
package/dist/nitro.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DD9vencX.js";
2
2
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-Bkk0XRo2.js";
3
- import { a as CACHE_WARMUP_QUEUE_TOPIC, h as resolveConversationWorkQueueTopic, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./background-compaction-queue-CJDnWVOJ.js";
4
- import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-C_zldF5J.js";
5
- import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, B as getDeploymentServiceVersion, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE } from "./logging-FjclQsXu.js";
3
+ import { a as CACHE_WARMUP_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./background-compaction-queue-DrKi7w3d.js";
4
+ import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-Cx4Lmjyk.js";
5
+ import { n as resolveConversationWorkQueueTopic } from "./vercel-queue-hW90XzbG.js";
6
+ import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, B as getDeploymentServiceVersion, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE } from "./logging-dQ9ZRGQ8.js";
6
7
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cv2ETe8Y.js";
7
8
  import path from "node:path";
8
9
  import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
@@ -1,5 +1,5 @@
1
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-Bk8wGb8Y.js";
2
- import { Cn as createUserTokenStore } from "./projection-Cns7XwWa.js";
1
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-I8VBGk05.js";
2
+ import { r as createUserTokenStore } from "./credentialed-Cb6E2phL.js";
3
3
  import { createServer } from "node:http";
4
4
  // src/chat/local/oauth-callback-server.ts
5
5
  const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { d as readJuniorSecret } from "./task-queue-C_zldF5J.js";
2
+ import { f as readJuniorSecret } from "./vercel-queue-hW90XzbG.js";
3
3
  import * as z from "zod";
4
4
  import { randomBytes } from "node:crypto";
5
5
  import { SignJWT, jwtVerify } from "jose";
@@ -1,5 +1,5 @@
1
1
  import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-DD9vencX.js";
2
- import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-FjclQsXu.js";
2
+ import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-dQ9ZRGQ8.js";
3
3
  import { o as isUserActor, s as parseActorUserId } from "./actor-BsBdxDXQ.js";
4
4
  import * as z from "zod";
5
5
  import path from "node:path";
@@ -1,6 +1,6 @@
1
- import { i as trace, n as postinstall, o as getSandboxResources, t as dependencies } from "./install-Sg4ePfLl.js";
2
- import { Ni as getSandboxProvider, ji as isStale, ki as create, os as sleep } from "./projection-Cns7XwWa.js";
3
- import { i as getStateAdapter } from "./adapter-B1wujchl.js";
1
+ import { i as trace, n as postinstall, o as getSandboxResources, t as dependencies } from "./install-DCFJFkC0.js";
2
+ import { Jt as create, Qt as getSandboxProvider, Xt as isStale, zo as sleep } from "./credentialed-Cb6E2phL.js";
3
+ import { i as getStateAdapter } from "./adapter-iIq7ihf7.js";
4
4
  import * as z from "zod";
5
5
  // src/chat/sandbox/snapshot/resolve.ts
6
6
  const SNAPSHOT_CACHE_PREFIX = "junior:sandbox_snapshot_profile:v2";