@sentry/junior 0.312.0 → 0.313.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 (82) hide show
  1. package/dist/{adapter-iIq7ihf7.js → adapter-CYAvJzZS.js} +1 -1
  2. package/dist/{adapter-context-BRjEWRy1.js → adapter-context-CVsHoVSf.js} +2 -2
  3. package/dist/{admin-DhInw5K9.js → admin-Cyhb4TwZ.js} +1 -1
  4. package/dist/{agent-runner-C9iDurwX.js → agent-runner-B5y9MsT-.js} +93 -45
  5. package/dist/api/schema.d.ts +1 -1
  6. package/dist/api/schema.js +4 -4
  7. package/dist/api.d.ts +1 -1
  8. package/dist/api.js +40 -40
  9. package/dist/{app-DRFrC8Mw.d.ts → app-DA8-hCMj.d.ts} +2 -2
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +31 -33
  12. package/dist/{background-compaction-queue-DrKi7w3d.js → background-compaction-queue-iZXadLV3.js} +56 -6
  13. package/dist/{catalog-runtime-D7xapBAX.js → catalog-runtime-kkE3hvCX.js} +1 -1
  14. package/dist/{channel-access-CJGfNTdn.js → channel-access-mt7K6dPh.js} +2 -2
  15. package/dist/cli/chat.js +16 -16
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +2 -2
  18. package/dist/cli/plugins.js +4 -4
  19. package/dist/cli/snapshot-create.js +5 -5
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{config-kXB2Y5tl.js → config-CWbwKj0j.js} +3 -3
  23. package/dist/{continue-in-slack-O6pV5004.js → continue-in-slack-CxyFzdlF.js} +6 -6
  24. package/dist/{conversation-feed-uNOv_x68.js → conversation-feed-BEXLD3Me.js} +13 -2
  25. package/dist/{conversation-privacy-L4ja1_W6.js → conversation-privacy-BrMiDN61.js} +1 -1
  26. package/dist/{conversation-turn-CeLbHqdw.js → conversation-turn-B35eu0uz.js} +63 -45
  27. package/dist/{credential-sync-I8VBGk05.js → credential-sync-DWTOEQrm.js} +15 -16
  28. package/dist/{credentialed-Cb6E2phL.js → credentialed-Dyv8b-lu.js} +12 -14
  29. package/dist/{db-BbC5stfa.d.ts → db-DYGcXYl3.d.ts} +1 -1
  30. package/dist/{db-LAyyX8tk.js → db-PwSRzWWn.js} +17 -19
  31. package/dist/{executor-SCub-fAq.js → executor-CgWyWfYz.js} +2 -4
  32. package/dist/{html-BCZ3Xtb_.js → html-DidUcRhI.js} +6 -6
  33. package/dist/ingest-B0AggUEC.js +7931 -0
  34. package/dist/{install-DCFJFkC0.js → install-2urLLXNt.js} +2 -2
  35. package/dist/instrumentation.js +2 -2
  36. package/dist/{lineage-B_m-4TJw.js → lineage-BXplQAVH.js} +2 -2
  37. package/dist/{list-CN2QA2R9.js → list-DyIyReSV.js} +82 -69
  38. package/dist/{logging-dQ9ZRGQ8.js → logging-DNt-qOIO.js} +1 -1
  39. package/dist/{media-CYm1QD8T.js → media-B0pZJ0bG.js} +9 -6
  40. package/dist/{message-DSXGj1hM.js → message-Z5YKC-Af.js} +23 -9
  41. package/dist/{model-input--TrP9hYV.js → model-input-BhPJYdSV.js} +3 -3
  42. package/dist/nitro.d.ts +1 -1
  43. package/dist/nitro.js +4 -4
  44. package/dist/{oauth-callback-server-DHCZC6B4.js → oauth-callback-server-ByvDdcdY.js} +2 -2
  45. package/dist/{oauth-relay-pPMGnDZt.js → oauth-relay-D-kK0yoN.js} +1 -1
  46. package/dist/{registry-CZOzddwu.js → registry-POH4bZC4.js} +1 -1
  47. package/dist/{statuses-_cRJHXK7.js → reporting-window-C4dbzDiR.js} +1 -27
  48. package/dist/request-deadline-BUiRYQYj.js +24 -0
  49. package/dist/{resolve-cKOQ14Dh.js → resolve-CWtBNSKP.js} +3 -3
  50. package/dist/{runner-DBfUW44l.js → runner-CsZ_VRxp.js} +8 -8
  51. package/dist/{sandbox-egress-signals-BVF_xAm1.js → sandbox-egress-signals-FbCk1FkN.js} +1 -1
  52. package/dist/{schema-BEHKxr4I.d.ts → schema-DBf18QPS.d.ts} +131 -912
  53. package/dist/{schema-Bk9Nm2E8.js → schema-DojR2uCL.js} +4 -4
  54. package/dist/{service-account-CVYsFjty.js → service-account-CDYb9hfX.js} +3 -3
  55. package/dist/{service-account-Ts4ulcrV.js → service-account-o15pZWcJ.js} +5 -5
  56. package/dist/{skills-VTnhAJWm.js → skills-B0jP4whm.js} +2 -2
  57. package/dist/{slack-conversation-unfurl-fuLnF1jE.js → slack-conversation-unfurl-D26t9kBC.js} +8 -8
  58. package/dist/{spawn-vxAarlX5.js → spawn-BjljgExZ.js} +14 -33
  59. package/dist/{start-conversation-CEn2KH1A.js → start-conversation-DbVujrwO.js} +10 -196
  60. package/dist/{state-C1P3_Ywk.js → state-BTawTCme.js} +4 -4
  61. package/dist/{result-event-type-BdIJuZxg.js → statuses-BKwqCPhj.js} +25 -4
  62. package/dist/{store-DFZaN-Ix.js → store-CjXrp-Up.js} +3 -3
  63. package/dist/{task-queue-Cx4Lmjyk.js → task-queue-Cwlatjz3.js} +4 -4
  64. package/dist/{task-runner-CbTwFA6k.js → task-runner--Ke8KSMf.js} +11 -11
  65. package/dist/{thread-context-BkAZDTX2.js → thread-context-B8exINEe.js} +6 -7
  66. package/dist/{thread-state-DhPndWi1.js → turn-membership-DTR3SaKD.js} +251 -17
  67. package/dist/{validation-nIzMtAVJ.js → validation-Ce0qbMlT.js} +1 -1
  68. package/dist/{vercel-queue-hW90XzbG.js → vercel-queue-q4z8w5QO.js} +2 -2
  69. package/dist/{version-Brbtz4Qf.js → version-DFh4n9nr.js} +1 -1
  70. package/dist/version.js +1 -1
  71. package/dist/{warmup-BDA5myRK.js → warmup-D5hzqTcp.js} +44 -2969
  72. package/dist/{worker-D63RcaVD.js → worker-CDg9Lbpg.js} +6 -6
  73. package/migrations/0158_keep_legacy_archive_columns.sql +5 -0
  74. package/migrations/0159_conversation_embeddings_fk_validate.sql +5 -0
  75. package/migrations/meta/0158_snapshot.json +6515 -0
  76. package/migrations/meta/0159_snapshot.json +6515 -0
  77. package/migrations/meta/_journal.json +14 -0
  78. package/package.json +5 -5
  79. package/dist/callback-mFlTUWWx.js +0 -75
  80. package/dist/child-message-DcsritGf.js +0 -179
  81. package/dist/ingest-BDf3D50j.js +0 -3836
  82. package/dist/result-DcvEOe1r.js +0 -574
@@ -1,7 +1,7 @@
1
- import { Dt as inputFileSchema, Jt as inboxItemRequestSchema, U as conversationAuxiliaryCostsSchema, Y as conversationParamsSchema, at as idempotencyKeySchema, et as conversationSummaryReportSchema, nt as conversationUsageSchema, s as notificationScheduleSchema, st as conversationChildAgentTotalsSchema, z as actorIdentitySchema } from "./media-CYm1QD8T.js";
2
- import { f as TODO_STATUSES } from "./result-event-type-BdIJuZxg.js";
3
- import "./conversation-feed-uNOv_x68.js";
4
- import { o as fillUtcDays, r as AGENT_INVOCATION_STATUSES, s as fillUtcHours, u as sumUtcHoursIntoSixHours } from "./statuses-_cRJHXK7.js";
1
+ import { Dt as inputFileSchema, Jt as inboxItemRequestSchema, U as conversationAuxiliaryCostsSchema, Y as conversationParamsSchema, at as idempotencyKeySchema, et as conversationSummaryReportSchema, nt as conversationUsageSchema, s as notificationScheduleSchema, st as conversationChildAgentTotalsSchema, z as actorIdentitySchema } from "./media-B0pZJ0bG.js";
2
+ import { m as TODO_STATUSES, r as AGENT_INVOCATION_STATUSES } from "./statuses-BKwqCPhj.js";
3
+ import "./conversation-feed-BEXLD3Me.js";
4
+ import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours } from "./reporting-window-C4dbzDiR.js";
5
5
  import { t as isPushServiceEndpoint } from "./push-endpoint-CO-nomUd.js";
6
6
  import * as z from "zod";
7
7
  import { codeChangeSizeSchema, codeChangeStateSchema, eventMatchSchema, objectTypeSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
@@ -1,6 +1,6 @@
1
- import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-Ts4ulcrV.js";
2
- import { n as pluginCatalogRuntime } from "./catalog-runtime-D7xapBAX.js";
3
- import { n as disconnectStateAdapter } from "./adapter-iIq7ihf7.js";
1
+ import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-o15pZWcJ.js";
2
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-kkE3hvCX.js";
3
+ import { n as disconnectStateAdapter } from "./adapter-CYAvJzZS.js";
4
4
  import { CLI_USAGE } from "./cli/run.js";
5
5
  import { createServer } from "node:http";
6
6
  // src/cli/service-account.ts
@@ -1,8 +1,8 @@
1
- import { b as setSpanAttributes, h as logWarn } from "./logging-dQ9ZRGQ8.js";
2
- import { i as resolvePluginHeaderEnvRefs, l as fetchWithBoundedOAuthErrorBodies } from "./registry-CZOzddwu.js";
3
- import { i as getStateAdapter } from "./adapter-iIq7ihf7.js";
4
- import { I as MUTATION_LOCK_TTL_MS, R as fenceLock, n as botConfig, z as withLock } from "./config-kXB2Y5tl.js";
5
- import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-C1P3_Ywk.js";
1
+ import { b as setSpanAttributes, h as logWarn } from "./logging-DNt-qOIO.js";
2
+ import { i as resolvePluginHeaderEnvRefs, l as fetchWithBoundedOAuthErrorBodies } from "./registry-POH4bZC4.js";
3
+ import { i as getStateAdapter } from "./adapter-CYAvJzZS.js";
4
+ import { I as MUTATION_LOCK_TTL_MS, R as fenceLock, n as botConfig, z as withLock } from "./config-CWbwKj0j.js";
5
+ import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-BTawTCme.js";
6
6
  import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
7
7
  import * as z from "zod";
8
8
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
2
  import { s as skillRoots } from "./package-discovery-DD9vencX.js";
3
- import { h as logWarn } from "./logging-dQ9ZRGQ8.js";
4
- import { n as pluginCatalogRuntime } from "./catalog-runtime-D7xapBAX.js";
3
+ import { h as logWarn } from "./logging-DNt-qOIO.js";
4
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-kkE3hvCX.js";
5
5
  import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
6
6
  import * as z from "zod";
7
7
  import path from "node:path";
@@ -1,13 +1,13 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { Lt as readActorIdentity, V as getConversationIdByProviderConversation, a as getConversationStore, o as getDb, s as getSqlExecutor, yn as readConversationAccessFromSql } from "./db-LAyyX8tk.js";
2
+ import { It as readActorIdentity, V as getConversationIdByProviderConversation, a as getConversationStore, o as getDb, s as getSqlExecutor, vn as readConversationAccessFromSql } from "./db-PwSRzWWn.js";
3
3
  import { _ as slackUserIdSchema, b as slackMessageTsSchema, f as parseSlackTeamId, g as slackTeamIdSchema, h as slackChannelIdSchema, m as slackBotIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-BsBdxDXQ.js";
4
- import { Bo as getWorkspaceTeamId, Ni as parseDashboardConversationLink, Qr as unfurlSlackLinks, Yr as postSlackEphemeralMessage, ai as escapeSlackMrkdwnText, oi as formatSlackLink, or as lookupSlackBot, sr as lookupSlackUserProfile } from "./credentialed-Cb6E2phL.js";
5
- import { P as createCache, n as botConfig } from "./config-kXB2Y5tl.js";
6
- import { E as withSpan } from "./logging-dQ9ZRGQ8.js";
7
- import { t as runWithSlackInstallation } from "./adapter-context-BRjEWRy1.js";
8
- import { a as isMovableToSlack, i as continueConversationInSlack, n as alreadyContinuesInSlackMessage, t as BUSY } from "./continue-in-slack-O6pV5004.js";
9
- import { t as checkSlackChannelReadAccess } from "./channel-access-CJGfNTdn.js";
10
- import { tn as deferConversationMove } from "./thread-state-DhPndWi1.js";
4
+ import { Bo as getWorkspaceTeamId, Ni as parseDashboardConversationLink, Qr as unfurlSlackLinks, Yr as postSlackEphemeralMessage, ai as escapeSlackMrkdwnText, oi as formatSlackLink, or as lookupSlackBot, sr as lookupSlackUserProfile } from "./credentialed-Dyv8b-lu.js";
5
+ import { P as createCache, n as botConfig } from "./config-CWbwKj0j.js";
6
+ import { E as withSpan } from "./logging-DNt-qOIO.js";
7
+ import { t as runWithSlackInstallation } from "./adapter-context-CVsHoVSf.js";
8
+ import { a as isMovableToSlack, i as continueConversationInSlack, n as alreadyContinuesInSlackMessage, t as BUSY } from "./continue-in-slack-CxyFzdlF.js";
9
+ import { t as checkSlackChannelReadAccess } from "./channel-access-mt7K6dPh.js";
10
+ import { ln as deferConversationMove } from "./turn-membership-DTR3SaKD.js";
11
11
  import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
12
12
  import * as z from "zod";
13
13
  // src/chat/ingress/workspace-membership.ts
@@ -1,10 +1,8 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { A as actorFromRun, j as toolInvocationDestination } from "./agent-runner-C9iDurwX.js";
3
- import { n as botConfig } from "./config-kXB2Y5tl.js";
4
- import { t as readConversationLineage } from "./lineage-B_m-4TJw.js";
5
- import { w as getConversationWorkState } from "./thread-state-DhPndWi1.js";
6
- import { Dt as getAgentInvocation, Jt as createAndEnqueueAgentInvocation, in as getAgentBinding, tn as AgentDepthLimitError } from "./warmup-BDA5myRK.js";
7
- import { c as getAgentInvocationId, f as getAgentInvocationMessageId, y as getUnnamedAgentConversationId } from "./child-message-DcsritGf.js";
2
+ import { A as actorFromRun, j as toolInvocationDestination } from "./agent-runner-B5y9MsT-.js";
3
+ import { n as botConfig } from "./config-CWbwKj0j.js";
4
+ import { t as readConversationLineage } from "./lineage-BXplQAVH.js";
5
+ import { G as AgentDepthLimitError, W as spawnChildAgent, bt as getAgentInvocationId, g as createAndEnqueueAgentInvocation, rt as getAgentInvocation } from "./ingest-B0AggUEC.js";
8
6
  // src/chat/agent-invocations/spawn.ts
9
7
  var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
10
8
  /**
@@ -16,24 +14,6 @@ async function assertCanStartChildAgent(conversationId, maxAgentDepth) {
16
14
  const root = lineage[0];
17
15
  if (!root || root.parentConversationId || lineage.length - 1 > maxAgentDepth) throw new AgentDepthLimitError(maxAgentDepth);
18
16
  }
19
- /**
20
- * Return the child of a spawn that already ran without an agent invocation.
21
- * Its idempotency key keys the task in the child's mailbox. A spawn with an
22
- * agent invocation replays through that row instead.
23
- */
24
- async function findSpawnedChildAgent(args) {
25
- const invocationId = getAgentInvocationId(args.parentConversationId, args.idempotencyKey);
26
- if (await getAgentInvocation(invocationId)) return;
27
- const childConversationId = args.agentName ? (await getAgentBinding({
28
- name: args.agentName,
29
- parentConversationId: args.parentConversationId
30
- }))?.childConversationId : getUnnamedAgentConversationId(invocationId);
31
- if (!childConversationId) return;
32
- return (await getConversationWorkState({
33
- conversationId: childConversationId,
34
- state: args.state
35
- }))?.execution.inboundMessageIds.includes(getAgentInvocationMessageId(invocationId)) ? childConversationId : void 0;
36
- }
37
17
  /** Bind a Run's Actor and credentials to new Agent invocations. */
38
18
  function bindSpawnAgent(run, options) {
39
19
  const actor = actorFromRun(run);
@@ -42,15 +22,8 @@ function bindSpawnAgent(run, options) {
42
22
  call.signal?.throwIfAborted();
43
23
  await assertCanStartChildAgent(run.conversationId, options.maxAgentDepth ?? botConfig.maxAgentDepth);
44
24
  const idempotencyKey = `${run.turnId}:${call.toolCallId}`;
45
- const spawned = await findSpawnedChildAgent({
46
- ...input.name ? { agentName: input.name } : void 0,
47
- idempotencyKey,
48
- parentConversationId: run.conversationId,
49
- state: options.state
50
- });
51
- if (spawned) return { childConversationId: spawned };
52
25
  const queue = typeof options.queue === "function" ? options.queue() : options.queue;
53
- return { childConversationId: (await createAndEnqueueAgentInvocation({
26
+ const createInput = {
54
27
  actor,
55
28
  ...input.name ? { agentName: input.name } : void 0,
56
29
  ...input.agentType ? { agentType: input.agentType } : void 0,
@@ -64,10 +37,18 @@ function bindSpawnAgent(run, options) {
64
37
  parentToolCallId: call.toolCallId,
65
38
  ...input.reasoningLevel ? { reasoningLevel: input.reasoningLevel } : void 0,
66
39
  ...input.title ? { title: input.title } : void 0
67
- }, {
40
+ };
41
+ if (await getAgentInvocation(getAgentInvocationId(run.conversationId, idempotencyKey))) return { childConversationId: (await createAndEnqueueAgentInvocation(createInput, {
68
42
  ...options,
69
43
  queue
70
44
  })).childConversationId };
45
+ return await spawnChildAgent({
46
+ ...createInput,
47
+ parentTurnId: run.turnId
48
+ }, {
49
+ ...options,
50
+ queue
51
+ });
71
52
  };
72
53
  }
73
54
  export { spawn_exports as n, bindSpawnAgent as t };
@@ -1,15 +1,14 @@
1
- import { Ar as getDispatchConversationId, Eo as SlackActionError, Fo as readPrivateSlackFile, Lo as streamPrivateSlackFile, Nr as getDispatchRecord, io as conversationWatch, wi as getDashboardConversationLink } from "./credentialed-Cb6E2phL.js";
2
- import { ht as bufferBody } from "./config-kXB2Y5tl.js";
1
+ import { Eo as SlackActionError, Fo as readPrivateSlackFile, Lo as streamPrivateSlackFile, io as conversationWatch, wi as getDashboardConversationLink } from "./credentialed-Dyv8b-lu.js";
2
+ import { ht as bufferBody } from "./config-CWbwKj0j.js";
3
3
  import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
4
- import { o as getActiveTraceContext } from "./logging-dQ9ZRGQ8.js";
4
+ import { o as getActiveTraceContext } from "./logging-DNt-qOIO.js";
5
5
  import "./actor-BsBdxDXQ.js";
6
- import { $t as resolveActorIdentityId, A as isTopLevelKind, Fn as conversationDetailTouch, Vn as sameDestination, a as getConversationStore, fn as ToolInputError, nt as conversationKindSql, o as getDb, s as getSqlExecutor } from "./db-LAyyX8tk.js";
7
- import { B as juniorAttachments, C as juniorConversationParticipants, H as juniorConversations, K as juniorUsers, M as juniorConversationEvents, U as juniorIdentities, n as isPostgresErrorCode, z as juniorAttachmentUploads } from "./executor-SCub-fAq.js";
8
- import { d as contextProvenance } from "./history-CYstOMKX.js";
9
- import { L as buildDeterministicTurnId, W as openConversationProjection, c as appendAndEnqueueExclusiveInboundMessage, l as appendAndEnqueueInboundMessage, z as commitMessages } from "./thread-state-DhPndWi1.js";
10
- import { i as isVisionImageMediaType, r as detectImageMediaType } from "./media-CYm1QD8T.js";
11
- import { t as getVercelConversationWorkQueue } from "./vercel-queue-hW90XzbG.js";
12
- import { a as recordUploadedAttachment, i as readLiveAttachment, n as fileFields, u as AttachmentSourceUnavailableError } from "./store-DFZaN-Ix.js";
6
+ import { A as isTopLevelKind, Bn as sameDestination, Pn as conversationDetailTouch, Qt as resolveActorIdentityId, a as getConversationStore, dn as ToolInputError, nt as conversationKindSql, o as getDb, s as getSqlExecutor } from "./db-PwSRzWWn.js";
7
+ import { B as juniorAttachments, C as juniorConversationParticipants, H as juniorConversations, K as juniorUsers, U as juniorIdentities, n as isPostgresErrorCode, z as juniorAttachmentUploads } from "./executor-CgWyWfYz.js";
8
+ import { K as buildDeterministicTurnId, _ as appendAndEnqueueInboundMessage, g as appendAndEnqueueExclusiveInboundMessage } from "./turn-membership-DTR3SaKD.js";
9
+ import { i as isVisionImageMediaType, r as detectImageMediaType } from "./media-B0pZJ0bG.js";
10
+ import { t as getVercelConversationWorkQueue } from "./vercel-queue-q4z8w5QO.js";
11
+ import { a as recordUploadedAttachment, i as readLiveAttachment, n as fileFields, u as AttachmentSourceUnavailableError } from "./store-CjXrp-Up.js";
13
12
  import { t as webMessageId } from "./web-message-id-C6P83ans.js";
14
13
  import * as z from "zod";
15
14
  import { createHash, randomUUID } from "node:crypto";
@@ -194,191 +193,6 @@ const readSlackAttachmentSource = async (source) => {
194
193
  }
195
194
  };
196
195
  };
197
- // src/chat/agent-invocations/fork-history.ts
198
- /** Instructions that a fork child reads with its first task. */
199
- const FORK_INSTRUCTIONS = "You are a fork of your parent agent. The messages before your first parent task are copied from the parent's conversation so you have its context. They are not your job: your job is the parent task below. Sandbox files, approvals, and credentials of the parent were not copied, and your sandbox is separate. Verify files in your own sandbox before you use them.";
200
- /**
201
- * Cut parent history for a fork: everything before the parent's message that
202
- * started the fork, through the last point where every tool call has its
203
- * result. A model request with an unanswered tool call fails, and the parent
204
- * can commit its history in the middle of a tool round.
205
- */
206
- function forkHistoryFrom(messages, parentToolCallId) {
207
- const spawnIndex = parentToolCallId ? messages.findIndex((message) => message.role === "assistant" && message.content.some((part) => part.type === "toolCall" && part.id === parentToolCallId)) : -1;
208
- const before = spawnIndex >= 0 ? messages.slice(0, spawnIndex) : messages;
209
- const pending = /* @__PURE__ */ new Set();
210
- let end = 0;
211
- for (const [index, message] of before.entries()) {
212
- if (message.role === "assistant") {
213
- for (const part of message.content) if (part.type === "toolCall") pending.add(part.id);
214
- } else if (message.role === "toolResult") pending.delete(message.toolCallId);
215
- if (pending.size === 0) end = index + 1;
216
- }
217
- return before.slice(0, end);
218
- }
219
- /**
220
- * Load the start history of a fork child from its parent Conversation.
221
- */
222
- async function loadForkHistory(invocation) {
223
- return forkHistoryFrom((await openConversationProjection({ conversationId: invocation.parentConversationId })).messages, invocation.parentToolCallId);
224
- }
225
- async function hasTurnStarted(conversationId) {
226
- const [row] = await getSqlExecutor().db().select({ seq: juniorConversationEvents.seq }).from(juniorConversationEvents).where(and(eq(juniorConversationEvents.conversationId, conversationId), eq(juniorConversationEvents.type, "turn_started"))).limit(1);
227
- return row !== void 0;
228
- }
229
- /**
230
- * Commit the start history of a fork child before its first Turn starts, so
231
- * the history is below the Turn start. A child that already has agent
232
- * history, such as on a retry, commits nothing. A child whose Turn already
233
- * started commits nothing too: the history would be Turn messages, and a
234
- * parent `reply` in it would read as the Turn's answer. Only a worker that
235
- * committed fork history after the Turn start leaves such a child.
236
- */
237
- async function commitForkHistory(args) {
238
- if ((await openConversationProjection({ conversationId: args.childConversationId })).messages.length > 0 || await hasTurnStarted(args.childConversationId)) return;
239
- const messages = await loadForkHistory(args);
240
- if (messages.length === 0) return;
241
- await commitMessages({
242
- conversationId: args.childConversationId,
243
- messages,
244
- provenance: messages.map(() => contextProvenance)
245
- });
246
- }
247
- /** True for agent history that a fork child inherited from its parent. */
248
- function isInheritedForkHistory(event, firstEvent) {
249
- return firstEvent !== void 0 && event.seq > firstEvent.seq && event.createdAtMs < firstEvent.createdAtMs && (event.data.type === "assistant_message" || event.data.type === "tool_result");
250
- }
251
- const firstRow = alias(juniorConversationEvents, "first_event");
252
- /**
253
- * SQL filter for event rows that a fork child did not inherit from its
254
- * parent. Usage reports use it, so inherited model calls count only in the
255
- * parent. It reads only a lower seq, the Conversation's first event, so a
256
- * counted row never changes whether it counts.
257
- */
258
- function notInheritedByForkChild() {
259
- return sql`not coalesce(${juniorConversationEvents.createdAt} < (
260
- select ${firstRow.createdAt}
261
- from ${juniorConversationEvents} as ${sql.identifier("first_event")}
262
- where ${firstRow.conversationId} = ${juniorConversationEvents.conversationId}
263
- and ${firstRow.seq} < ${juniorConversationEvents.seq}
264
- order by ${firstRow.seq}
265
- limit 1
266
- ), false)`;
267
- }
268
- // src/chat/services/turn-session-routing.ts
269
- async function loadConversationChain(conversationId, conversationStore) {
270
- const chain = [];
271
- const seen = /* @__PURE__ */ new Set();
272
- let cursor = conversationId;
273
- while (cursor && !seen.has(cursor)) {
274
- seen.add(cursor);
275
- const conversation = await conversationStore.get({ conversationId: cursor });
276
- if (!conversation) break;
277
- chain.push(conversation);
278
- cursor = conversation.parentConversationId;
279
- }
280
- return chain;
281
- }
282
- /**
283
- * Normalize a stored Slack session source against the conversation destination.
284
- *
285
- * Does not create channel or thread values from the conversation id.
286
- */
287
- function slackSourceForDestination(args) {
288
- if (args.source?.kind !== "slack" || args.source.channelId !== args.destination.channelId) return;
289
- const threadTs = args.source.threadTs?.trim();
290
- return {
291
- kind: "slack",
292
- visibility: args.source.visibility ?? "public",
293
- teamId: args.source.teamId?.trim() || args.destination.teamId,
294
- channelId: args.source.channelId,
295
- ...threadTs ? { threadTs } : void 0
296
- };
297
- }
298
- /**
299
- * Resolve the Conversation Location, Destination, and session Source.
300
- *
301
- * Reads parent Conversations when this Conversation has no Destination.
302
- */
303
- async function resolveConversationRouting(args) {
304
- const conversationStore = args.conversationStore ?? (await import("./db-LAyyX8tk.js").then((n) => n.n)).getConversationStore();
305
- const chain = await loadConversationChain(args.conversationId, conversationStore);
306
- let destination;
307
- let source;
308
- let location;
309
- for (const conversation of chain) {
310
- destination ??= conversation.destination;
311
- source ??= conversation.sessionSource;
312
- location ??= conversation.location;
313
- if (destination && source) break;
314
- }
315
- if (!destination) return;
316
- if (destination.platform === "slack") {
317
- const slackSource = slackSourceForDestination({
318
- destination,
319
- source
320
- });
321
- return {
322
- destination,
323
- ...location ? { location } : void 0,
324
- ...slackSource ? { source: slackSource } : void 0
325
- };
326
- }
327
- return {
328
- destination,
329
- ...location ? { location } : void 0,
330
- ...source ? { source } : void 0
331
- };
332
- }
333
- /** Require the Conversation Destination and Source from SQL. */
334
- async function resolveTurnSessionRouting(args) {
335
- const routing = await resolveConversationRouting(args);
336
- if (!routing?.destination || !routing.source) throw new Error(`Conversation ${args.conversationId} is missing durable routing metadata`);
337
- return {
338
- destination: routing.destination,
339
- ...routing.location ? { location: routing.location } : void 0,
340
- source: routing.source
341
- };
342
- }
343
- /**
344
- * Require the Destination and Source to resume a Turn.
345
- *
346
- * A dispatch Conversation stores the dispatch Source, which has no session
347
- * Source. Its dispatch record owns the Destination and Source.
348
- */
349
- async function resolveTurnResumeRouting(args) {
350
- if (!args.dispatchId) return await resolveTurnSessionRouting(args);
351
- const dispatch = await getDispatchRecord(args.dispatchId);
352
- if (!dispatch) throw new Error(`Dispatch record is missing for ${args.dispatchId}`);
353
- const dispatchConversationId = getDispatchConversationId(dispatch);
354
- if (dispatchConversationId !== args.conversationId) throw new Error(`Dispatch ${dispatch.id} belongs to ${dispatchConversationId}, not ${args.conversationId}`);
355
- const location = (await resolveConversationRouting(args))?.location;
356
- return {
357
- destination: dispatch.destination,
358
- ...location ? { location } : void 0,
359
- source: dispatch.source
360
- };
361
- }
362
- // src/chat/task-execution/turn-membership.ts
363
- /** True when the committed message at `seq` belongs to the Turn. */
364
- function isTurnMessage(start, seq, message) {
365
- return seq > start.seq && message.role !== "system";
366
- }
367
- /**
368
- * The messages of a saved Turn with their provenance. Without a
369
- * `turn_started` event, nothing tells this Turn from earlier history, so it
370
- * has no messages.
371
- */
372
- function savedTurnMessages(record, start) {
373
- if (!start) return [];
374
- return record.piMessages.flatMap((message, index) => {
375
- const seq = record.piMessageSeqs[index];
376
- return seq !== void 0 && isTurnMessage(start, seq, message) ? [{
377
- message,
378
- provenance: record.piMessageProvenance[index] ?? { authority: "context" }
379
- }] : [];
380
- });
381
- }
382
196
  // src/chat/attachments/uploads.ts
383
197
  const MINUTE_MS = 6e4;
384
198
  /** Time that a browser has to write the bytes after it asks to upload. */
@@ -938,4 +752,4 @@ function createStartConversationTool(context) {
938
752
  }
939
753
  });
940
754
  }
941
- export { readSlackAttachmentSource as A, FORK_INSTRUCTIONS as C, getSlackFileId as D, notInheritedByForkChild as E, zodToolDefinition as F, injectContinuationToolName as I, juniorToolOutputSchema as L, slackAttachmentsVersionQuery as M, parseToolInput as N, matchSlackAttachments as O, zodTool as P, makeStructuredToolOutput as R, resolveTurnResumeRouting as S, isInheritedForkHistory as T, verifyAttachmentUploads as _, readLeadUser as a, savedTurnMessages as b, conversationTurnIdForMessage as c, recordWebConversationActivity as d, webActorFromUser as f, createAttachmentUpload as g, collectAttachmentUploadGarbage as h, leadPersonParticipates as i, recordSlackAttachment as j, readAttachmentVisionSummary as k, createAndEnqueueConversation as l, AttachmentUploadError as m, startConversationToolDefinition as n, acceptsWebMessages as o, resolveConversationDestination as p, getLeadConversation as r, appendAndEnqueueWebMessage as s, createStartConversationTool as t, createConversationId as u, writeAttachmentUpload as v, commitForkHistory as w, resolveConversationRouting as x, isTurnMessage as y };
755
+ export { makeStructuredToolOutput as A, recordSlackAttachment as C, zodToolDefinition as D, zodTool as E, injectContinuationToolName as O, readSlackAttachmentSource as S, parseToolInput as T, verifyAttachmentUploads as _, readLeadUser as a, matchSlackAttachments as b, conversationTurnIdForMessage as c, recordWebConversationActivity as d, webActorFromUser as f, createAttachmentUpload as g, collectAttachmentUploadGarbage as h, leadPersonParticipates as i, juniorToolOutputSchema as k, createAndEnqueueConversation as l, AttachmentUploadError as m, startConversationToolDefinition as n, acceptsWebMessages as o, resolveConversationDestination as p, getLeadConversation as r, appendAndEnqueueWebMessage as s, createStartConversationTool as t, createConversationId as u, writeAttachmentUpload as v, slackAttachmentsVersionQuery as w, readAttachmentVisionSummary as x, getSlackFileId as y };
@@ -1,7 +1,7 @@
1
- import { r as getChatConfig } from "./config-kXB2Y5tl.js";
2
- import { h as logWarn } from "./logging-dQ9ZRGQ8.js";
3
- import { o as getDb } from "./db-LAyyX8tk.js";
4
- import { K as juniorUsers } from "./executor-SCub-fAq.js";
1
+ import { r as getChatConfig } from "./config-CWbwKj0j.js";
2
+ import { h as logWarn } from "./logging-DNt-qOIO.js";
3
+ import { o as getDb } from "./db-PwSRzWWn.js";
4
+ import { K as juniorUsers } from "./executor-CgWyWfYz.js";
5
5
  import { createCipheriv, createDecipheriv, createHash, randomBytes } from "node:crypto";
6
6
  import { eq } from "drizzle-orm";
7
7
  // src/chat/conversations/legacy-web-actor-id.ts
@@ -40,9 +40,30 @@ function isAgentInvocationResultEventType(eventType) {
40
40
  const AGENT_REPLY_EVENT_TYPE = "agent.reply";
41
41
  /** Event type of a message that a child agent sends to its parent. */
42
42
  const AGENT_MESSAGE_EVENT_TYPE = "agent.message";
43
+ // src/chat/agent-invocations/statuses.ts
44
+ const AGENT_INVOCATION_STATUSES = [
45
+ "pending",
46
+ "running",
47
+ "paused",
48
+ "blocked",
49
+ "completed",
50
+ "failed",
51
+ "stopped"
52
+ ];
53
+ const AGENT_INVOCATION_MAILBOX_STATUSES = ["pending", "appended"];
43
54
  /**
44
- * Event type of a parent agent task or message to a child that no agent
45
- * invocation names.
55
+ * Parent mailbox append state. Only terminal invocations have a value.
56
+ * `replaced` means the child still had open work, so a later agent invocation
57
+ * on the same child sends the result instead. `skipped` means a stop ended
58
+ * the work, so the result is never used. `steered` means the agent invocation
59
+ * that was running read the input as a steering message, so its result covers
60
+ * this one.
46
61
  */
47
- const AGENT_PARENT_MESSAGE_EVENT_TYPE = "agent.parent_message";
48
- export { agentInvocationResultEventType as a, userCustomizationSchema as c, SELF_TODO_ASSIGNEE as d, TODO_STATUSES as f, AGENT_REPLY_EVENT_TYPE as i, userCustomizationTextSchema as l, isOpenTodoStatus as m, AGENT_MESSAGE_EVENT_TYPE as n, isAgentInvocationResultEventType as o, UPDATE_TODOS_TOOL_NAME as p, AGENT_PARENT_MESSAGE_EVENT_TYPE as r, USER_CUSTOMIZATION_MAX_CHARS as s, AGENT_INVOCATION_EVENT_NAMESPACE as t, OPEN_TODO_STATUSES as u };
62
+ const AGENT_INVOCATION_PARENT_MAILBOX_STATUSES = [
63
+ "pending",
64
+ "appended",
65
+ "replaced",
66
+ "skipped",
67
+ "steered"
68
+ ];
69
+ export { AGENT_MESSAGE_EVENT_TYPE as a, isAgentInvocationResultEventType as c, userCustomizationTextSchema as d, OPEN_TODO_STATUSES as f, isOpenTodoStatus as g, UPDATE_TODOS_TOOL_NAME as h, AGENT_INVOCATION_EVENT_NAMESPACE as i, USER_CUSTOMIZATION_MAX_CHARS as l, TODO_STATUSES as m, AGENT_INVOCATION_PARENT_MAILBOX_STATUSES as n, AGENT_REPLY_EVENT_TYPE as o, SELF_TODO_ASSIGNEE as p, AGENT_INVOCATION_STATUSES as r, agentInvocationResultEventType as s, AGENT_INVOCATION_MAILBOX_STATUSES as t, userCustomizationSchema as u };
@@ -1,7 +1,7 @@
1
- import { B as juniorAttachments, H as juniorConversations, V as juniorMessageAttachments } from "./executor-SCub-fAq.js";
2
- import { Fn as conversationDetailTouch, Ln as touchConversationDetail } from "./db-LAyyX8tk.js";
1
+ import { B as juniorAttachments, H as juniorConversations, V as juniorMessageAttachments } from "./executor-CgWyWfYz.js";
2
+ import { In as touchConversationDetail, Pn as conversationDetailTouch } from "./db-PwSRzWWn.js";
3
3
  import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
4
- import { ht as bufferBody } from "./config-kXB2Y5tl.js";
4
+ import { ht as bufferBody } from "./config-CWbwKj0j.js";
5
5
  import { createHash, randomUUID } from "node:crypto";
6
6
  import { and, asc, eq, inArray, isNotNull, isNull, lte, notExists, or } from "drizzle-orm";
7
7
  // src/chat/attachments/source.ts
@@ -1,6 +1,6 @@
1
- import { h as logWarn } from "./logging-dQ9ZRGQ8.js";
2
- import { t as queueCallback } from "./callback-mFlTUWWx.js";
3
- import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as getQueueProvider, l as signQueueMessage, u as verifyQueueMessage } from "./vercel-queue-hW90XzbG.js";
1
+ import { h as logWarn } from "./logging-DNt-qOIO.js";
2
+ import { u as queueCallback } from "./background-compaction-queue-iZXadLV3.js";
3
+ import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as getQueueProvider, l as signQueueMessage, u as verifyQueueMessage } from "./vercel-queue-q4z8w5QO.js";
4
4
  import * as z from "zod";
5
5
  import { createHash } from "node:crypto";
6
6
  // src/chat/plugins/task-queue.ts
@@ -61,7 +61,7 @@ function pluginTaskCallback() {
61
61
  maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
62
62
  onRejected: logPluginTaskQueueMessageRejected,
63
63
  run: async (message) => {
64
- const { processPluginTask } = await import("./task-runner-CbTwFA6k.js").then((n) => n.r);
64
+ const { processPluginTask } = await import("./task-runner--Ke8KSMf.js").then((n) => n.r);
65
65
  await processPluginTask(message);
66
66
  },
67
67
  topic: PLUGIN_TASK_QUEUE_TOPIC,
@@ -1,17 +1,17 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { Bn as readConversationMetadata, Fn as createPluginTurnEventReader, Hn as resolveRootVisibility, In as createPluginConversationEvents, Kn as storeConversationEmbedding, Ln as renderPluginConversationEvent, Mn as createPluginEmbedder, Nn as createPluginModel, Nr as getDispatchRecord, Pn as createPluginModelCostRecorder, Pt as createPluginState, Vn as writeConversationMetadata, Wn as createConversationEmbedder, Yn as listConversationAnnotations, _s as renderJuniorNativeConversationEvent, as as createPluginCache, at as getPiMessageRole, g as getRegistrations, gt as normalizeToolNameFromResult, ht as isToolResultMessage, mt as isToolResultError, ss as completeObject, st as getUserMessageInstructionText, ut as instructionTextForProjection, vt as stripRuntimeTurnContext, wr as createPluginLogger } from "./credentialed-Cb6E2phL.js";
3
- import { C as createSqlStore, D as hasConversationMetadata, Lt as readActorIdentity, Mn as hasAgentTurnUsage, a as getConversationStore, d as eventFromRow, o as getDb, s as getSqlExecutor } from "./db-LAyyX8tk.js";
4
- import { E as withSpan, U as buildSentryEventUrl, a as extractGenAiUsageSummary, m as logInfo } from "./logging-dQ9ZRGQ8.js";
5
- import { Ct as isEventAuthorId, Yt as getTurnRecord, gn as loadTurnStart, nt as hydrateConversationMessages, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-DhPndWi1.js";
6
- import { O as matchSlackAttachments, T as isInheritedForkHistory, b as savedTurnMessages, n as startConversationToolDefinition, x as resolveConversationRouting } from "./start-conversation-CEn2KH1A.js";
2
+ import { Bn as readConversationMetadata, Fn as createPluginTurnEventReader, Hn as resolveRootVisibility, In as createPluginConversationEvents, Kn as storeConversationEmbedding, Ln as renderPluginConversationEvent, Mn as createPluginEmbedder, Nn as createPluginModel, Nr as getDispatchRecord, Pn as createPluginModelCostRecorder, Pt as createPluginState, Vn as writeConversationMetadata, Wn as createConversationEmbedder, Yn as listConversationAnnotations, _s as renderJuniorNativeConversationEvent, as as createPluginCache, at as getPiMessageRole, g as getRegistrations, gt as normalizeToolNameFromResult, ht as isToolResultMessage, mt as isToolResultError, ss as completeObject, st as getUserMessageInstructionText, ut as instructionTextForProjection, vt as stripRuntimeTurnContext, wr as createPluginLogger } from "./credentialed-Dyv8b-lu.js";
3
+ import { C as createSqlStore, D as hasConversationMetadata, It as readActorIdentity, a as getConversationStore, d as eventFromRow, jn as hasAgentTurnUsage, o as getDb, s as getSqlExecutor } from "./db-PwSRzWWn.js";
4
+ import { E as withSpan, U as buildSentryEventUrl, a as extractGenAiUsageSummary, m as logInfo } from "./logging-DNt-qOIO.js";
5
+ import { Tn as loadTurnStart, d as getPersistedThreadState, jt as isEventAuthorId, m as coerceThreadConversationState, n as savedTurnMessages, r as resolveConversationRouting, rn as getTurnRecord, s as isInheritedForkHistory, ut as hydrateConversationMessages } from "./turn-membership-DTR3SaKD.js";
7
6
  import { v as parseSlackMessageTs } from "./actor-BsBdxDXQ.js";
8
7
  import { m as sameActorIdentity } from "./history-CYstOMKX.js";
9
- import { H as juniorConversations, L as juniorCodeChanges, M as juniorConversationEvents, R as juniorCodeRepositories } from "./executor-SCub-fAq.js";
10
- import { n as botConfig, z as withLock } from "./config-kXB2Y5tl.js";
11
- import { i as getStateAdapter } from "./adapter-iIq7ihf7.js";
12
- import { Q as conversationReportMessageEventSchema, St as readMessageCardRefs, Z as conversationReportEventSchema, kt as readMessageAttachments, vt as inboxItemChangeRecordSchema } from "./media-CYm1QD8T.js";
8
+ import { H as juniorConversations, L as juniorCodeChanges, M as juniorConversationEvents, R as juniorCodeRepositories } from "./executor-CgWyWfYz.js";
9
+ import { n as botConfig, z as withLock } from "./config-CWbwKj0j.js";
10
+ import { i as getStateAdapter } from "./adapter-CYAvJzZS.js";
11
+ import { b as matchSlackAttachments, n as startConversationToolDefinition } from "./start-conversation-DbVujrwO.js";
12
+ import { Q as conversationReportMessageEventSchema, St as readMessageCardRefs, Z as conversationReportEventSchema, kt as readMessageAttachments, vt as inboxItemChangeRecordSchema } from "./media-B0pZJ0bG.js";
13
13
  import { h as startSpan } from "./sentry-CPbZjomA.js";
14
- import { i as pluginTaskParamsSchema, r as pluginTaskId } from "./task-queue-Cx4Lmjyk.js";
14
+ import { i as pluginTaskParamsSchema, r as pluginTaskId } from "./task-queue-Cwlatjz3.js";
15
15
  import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
16
16
  import * as z from "zod";
17
17
  import { objectTypeSchema, pluginRunContextSchema, renderTag, tagJson } from "@sentry/junior-plugin-api";
@@ -1375,7 +1375,7 @@ function taskPluginContext(plugin, message, options = {}) {
1375
1375
  };
1376
1376
  }
1377
1377
  function isConversationMetadataTask(message) {
1378
- return message.plugin === CONVERSATION_METADATA_TASK.plugin && message.name === CONVERSATION_METADATA_TASK.name || message.plugin === "briefs" && message.name === "updateBrief";
1378
+ return message.plugin === CONVERSATION_METADATA_TASK.plugin && message.name === CONVERSATION_METADATA_TASK.name;
1379
1379
  }
1380
1380
  function findPluginTask(message) {
1381
1381
  const plugin = getRegistrations().find((candidate) => candidate.manifest.name === message.plugin);
@@ -1,11 +1,10 @@
1
- import { Yn as listConversationAnnotations } from "./credentialed-Cb6E2phL.js";
1
+ import { Yn as listConversationAnnotations } from "./credentialed-Dyv8b-lu.js";
2
2
  import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
3
- import { b as setSpanAttributes } from "./logging-dQ9ZRGQ8.js";
4
- import { o as getDb, r as getConversationEventStore } from "./db-LAyyX8tk.js";
5
- import { Rt as clearPendingAuth, a as persistThreadStateById, ct as buildConversationContext, nt as hydrateConversationMessages, o as coerceThreadConversationState, pt as markConversationMessage, r as getPersistedThreadState, w as getConversationWorkState } from "./thread-state-DhPndWi1.js";
6
- import { Ct as removedCardSchema, St as readMessageCardRefs, wt as resolveMessageCards } from "./media-CYm1QD8T.js";
7
- import { F as getTurnUserMessageId, K as markTurnClosed, q as markTurnCompleted } from "./ingest-BDf3D50j.js";
8
- import { i as listChildMessages, r as isAgentInvocationResult } from "./child-message-DcsritGf.js";
3
+ import { b as setSpanAttributes } from "./logging-DNt-qOIO.js";
4
+ import { o as getDb, r as getConversationEventStore } from "./db-PwSRzWWn.js";
5
+ import { Kt as clearPendingAuth, N as getConversationWorkState, d as getPersistedThreadState, gt as buildConversationContext, m as coerceThreadConversationState, p as persistThreadStateById, ut as hydrateConversationMessages, xt as markConversationMessage } from "./turn-membership-DTR3SaKD.js";
6
+ import { Ct as removedCardSchema, St as readMessageCardRefs, wt as resolveMessageCards } from "./media-B0pZJ0bG.js";
7
+ import { $t as markTurnCompleted, Qt as markTurnClosed, Vt as getTurnUserMessageId, ht as listChildMessages, mt as isAgentInvocationResult } from "./ingest-B0AggUEC.js";
9
8
  // src/chat/conversations/pending-cards.ts
10
9
  /**
11
10
  * Add the cards that tool results selected since the last visible assistant