@sentry/junior 0.311.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 (120) hide show
  1. package/dist/{adapter-B1wujchl.js → adapter-CYAvJzZS.js} +1 -1
  2. package/dist/{adapter-context-G2M0y6rP.js → adapter-context-CVsHoVSf.js} +2 -2
  3. package/dist/{admin-DCiBhUT1.js → admin-Cyhb4TwZ.js} +1 -1
  4. package/dist/{agent-runner-BVHPUIc8.js → agent-runner-B5y9MsT-.js} +3487 -3493
  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 +294 -311
  9. package/dist/{app-Cw5Vy6H6.d.ts → app-DA8-hCMj.d.ts} +2 -9
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +336 -604
  12. package/dist/{background-compaction-queue-CJDnWVOJ.js → background-compaction-queue-iZXadLV3.js} +60 -85
  13. package/dist/{catalog-runtime-DMY3VV-D.js → catalog-runtime-kkE3hvCX.js} +1 -1
  14. package/dist/channel-access-mt7K6dPh.js +221 -0
  15. package/dist/cli/chat.js +18 -19
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/init.js +0 -1
  18. package/dist/cli/main.js +3 -7
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/run.d.ts +1 -2
  21. package/dist/cli/run.js +1 -2
  22. package/dist/cli/snapshot-create.js +5 -5
  23. package/dist/cli/upgrade.d.ts +1 -1
  24. package/dist/cli/upgrade.js +3 -3
  25. package/dist/{config-BrXDQefC.js → config-CWbwKj0j.js} +59 -27
  26. package/dist/{continue-in-slack-DNXSC9So.js → continue-in-slack-CxyFzdlF.js} +7 -8
  27. package/dist/{conversation-feed-DkinDu5o.js → conversation-feed-BEXLD3Me.js} +86 -21
  28. package/dist/{conversation-privacy-DxttrKb9.js → conversation-privacy-BrMiDN61.js} +1 -1
  29. package/dist/{conversation-turn-DWw7Xhdr.js → conversation-turn-B35eu0uz.js} +78 -56
  30. package/dist/{credential-sync-Bk8wGb8Y.js → credential-sync-DWTOEQrm.js} +15 -15
  31. package/dist/{projection-Cns7XwWa.js → credentialed-Dyv8b-lu.js} +16306 -20732
  32. package/dist/{db-7ETESH44.d.ts → db-DYGcXYl3.d.ts} +11 -6
  33. package/dist/{db-DTxzH7u5.js → db-PwSRzWWn.js} +181 -100
  34. package/dist/{executor-DqTiYj9S.js → executor-CgWyWfYz.js} +117 -99
  35. package/dist/{html-B9Sl4Axb.js → html-DidUcRhI.js} +6 -6
  36. package/dist/ingest-B0AggUEC.js +7931 -0
  37. package/dist/{install-Sg4ePfLl.js → install-2urLLXNt.js} +2 -2
  38. package/dist/instrumentation.js +3 -3
  39. package/dist/{lineage-BHAMpNKr.js → lineage-BXplQAVH.js} +2 -2
  40. package/dist/{stop-CYsfc0Ed.js → list-DyIyReSV.js} +709 -475
  41. package/dist/{logging-FjclQsXu.js → logging-DNt-qOIO.js} +1 -1
  42. package/dist/{schedule-BLJ476XQ.js → media-B0pZJ0bG.js} +1058 -11
  43. package/dist/{message-CJ7_RL50.js → message-Z5YKC-Af.js} +35 -28
  44. package/dist/{model-input-CMLh4Cwq.js → model-input-BhPJYdSV.js} +3 -3
  45. package/dist/nitro.d.ts +1 -1
  46. package/dist/nitro.js +4 -3
  47. package/dist/{oauth-callback-server-RVcbiDjL.js → oauth-callback-server-ByvDdcdY.js} +2 -2
  48. package/dist/{oauth-relay-Bu9kkaQu.js → oauth-relay-D-kK0yoN.js} +1 -1
  49. package/dist/{registry-BPwuOP2O.js → registry-POH4bZC4.js} +1 -1
  50. package/dist/reporting-window-C4dbzDiR.js +124 -0
  51. package/dist/request-deadline-BUiRYQYj.js +24 -0
  52. package/dist/{resolve-BK29bBry.js → resolve-CWtBNSKP.js} +3 -3
  53. package/dist/{runner-BcAE-cJm.js → runner-CsZ_VRxp.js} +14 -16
  54. package/dist/{sandbox-egress-signals-C-q0go5b.js → sandbox-egress-signals-FbCk1FkN.js} +1 -1
  55. package/dist/{schema-DYcJeV7d.d.ts → schema-DBf18QPS.d.ts} +2773 -3630
  56. package/dist/{schema-BLgSZXcL.js → schema-DojR2uCL.js} +106 -121
  57. package/dist/{service-account-iJoCtkHR.js → service-account-CDYb9hfX.js} +3 -3
  58. package/dist/{service-account-gN0zqf0S.js → service-account-o15pZWcJ.js} +5 -5
  59. package/dist/{skills-BoZ80epJ.js → skills-B0jP4whm.js} +2 -2
  60. package/dist/{slack-conversation-unfurl-CogYrITA.js → slack-conversation-unfurl-D26t9kBC.js} +9 -9
  61. package/dist/{spawn-Dk92r7mX.js → spawn-BjljgExZ.js} +14 -32
  62. package/dist/start-conversation-DbVujrwO.js +755 -0
  63. package/dist/{state-DH3Cmgp3.js → state-BTawTCme.js} +4 -4
  64. package/dist/statuses-BKwqCPhj.js +69 -0
  65. package/dist/store-CjXrp-Up.js +492 -0
  66. package/dist/task-queue-Cwlatjz3.js +90 -0
  67. package/dist/task-runner--Ke8KSMf.js +1432 -0
  68. package/dist/{thread-context-BW2BsQbH.js → thread-context-B8exINEe.js} +6 -7
  69. package/dist/turn-membership-DTR3SaKD.js +5859 -0
  70. package/dist/{validation-DrJd0nnq.js → validation-Ce0qbMlT.js} +1 -1
  71. package/dist/{task-queue-C_zldF5J.js → vercel-queue-q4z8w5QO.js} +93 -172
  72. package/dist/{version-CNKZ8owc.js → version-DFh4n9nr.js} +1 -1
  73. package/dist/version.js +1 -1
  74. package/dist/{warmup-BWdHew2H.js → warmup-D5hzqTcp.js} +4853 -13605
  75. package/dist/web-message-id-C6P83ans.js +10 -0
  76. package/dist/{worker-t9qpu_Zx.js → worker-CDg9Lbpg.js} +20 -7
  77. package/migrations/0143_todos.sql +14 -0
  78. package/migrations/0144_inbox_items.sql +32 -0
  79. package/migrations/0145_todo_changed_by_agent.sql +1 -0
  80. package/migrations/0146_inbox_item_subject_title_parts.sql +1 -0
  81. package/migrations/0147_inbox_snooze_wake_reason.sql +1 -0
  82. package/migrations/0148_authorization_request_index.sql +1 -0
  83. package/migrations/0149_conversation_metadata.sql +10 -0
  84. package/migrations/0150_conversation_metadata_fill.sql +39 -0
  85. package/migrations/0151_conversation_search_index.sql +1 -0
  86. package/migrations/0152_inbox_item_legacy_automation_keys.sql +21 -0
  87. package/migrations/0153_artifact_expiry.sql +1 -0
  88. package/migrations/0154_artifact_permanent_sha_index.sql +1 -0
  89. package/migrations/0155_artifact_drop_public_sha_index.sql +3 -0
  90. package/migrations/0156_conversation_kind_lead.sql +6 -0
  91. package/migrations/0157_conversation_lead_actor_index.sql +1 -0
  92. package/migrations/0158_keep_legacy_archive_columns.sql +5 -0
  93. package/migrations/0159_conversation_embeddings_fk_validate.sql +5 -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/0158_snapshot.json +6515 -0
  110. package/migrations/meta/0159_snapshot.json +6515 -0
  111. package/migrations/meta/_journal.json +120 -1
  112. package/package.json +6 -6
  113. package/skills/design-automation-skill/SKILL.md +108 -0
  114. package/dist/briefs-BDjnug6Y.js +0 -395
  115. package/dist/conversation-ca__NDQW.js +0 -1063
  116. package/dist/prompt-CDqcsDYC.js +0 -910
  117. package/dist/store-DmmMIrQi.js +0 -335
  118. package/dist/task-runner-C7oCJQIx.js +0 -294
  119. package/dist/turn-session-routing-Xh_2nSQe.js +0 -261
  120. package/dist/web-message-id-Ch5dPq-a.js +0 -306
@@ -1,7 +1,6 @@
1
- import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
1
  import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
3
- import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-FjclQsXu.js";
4
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-DxttrKb9.js";
2
+ import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-DNt-qOIO.js";
3
+ import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-BrMiDN61.js";
5
4
  import { t as gatewayOnlyProviders } from "./rule-DAxQY-1h.js";
6
5
  import { AwsClient } from "aws4fetch";
7
6
  import { del, get, issueSignedToken, presignUrl, put } from "@vercel/blob";
@@ -504,7 +503,7 @@ const PERMISSION_PATTERN = /permission denied|forbidden|not authorized|authoriza
504
503
  const INVALID_REQUEST_PATTERN = /context.?length|context.?window|validation (?:error|failed)|bad request|unsupported model|invalid model|unknown (?:ai gateway )?model|mismatched api/i;
505
504
  const CAPACITY_PATTERN = /overloaded|at capacity|capacity exceeded/i;
506
505
  const TIMEOUT_PATTERN = /timed? out|timeout|gateway timeout/i;
507
- const NETWORK_PATTERN = /network.?error|connection (?:error|refused|lost|closed)|fetch failed|socket (?:hang up|closed)|stream ended before/i;
506
+ const NETWORK_PATTERN = /network.?error|connection (?:error|refused|lost|closed)|fetch failed|cannot connect to api|socket (?:hang up|closed)|stream ended before/i;
508
507
  const SERVER_PATTERN = /service(?: temporarily)?[ _-]?unavailable|server.?error|internal.?error|bad gateway|upstream (?:request )?failed/i;
509
508
  const TERMINAL_KINDS = /* @__PURE__ */ new Set([
510
509
  "auth",
@@ -540,6 +539,7 @@ function extractTransportKind(error, depth = 0) {
540
539
  const code = typeof providerError.code === "string" ? providerError.code.toUpperCase() : void 0;
541
540
  if (code && TIMEOUT_ERROR_CODES.has(code)) return "timeout";
542
541
  if (code && NETWORK_ERROR_CODES.has(code)) return "network";
542
+ if (depth > 0 && NETWORK_PATTERN.test(providerError.message)) return "network";
543
543
  return extractTransportKind(providerError.cause, depth + 1);
544
544
  }
545
545
  function extractStatus(error, message) {
@@ -578,19 +578,27 @@ function classifyProviderError(status, message, transportKind) {
578
578
  if (status !== void 0 && status >= 400) return "invalid_request";
579
579
  return "unknown";
580
580
  }
581
+ /**
582
+ * The AI SDK retries a call and then throws `AI_RetryError`. The error of
583
+ * its last attempt has the status and the transport cause.
584
+ */
585
+ function lastAttemptError(error) {
586
+ return error instanceof Error && error.name === "AI_RetryError" && "lastError" in error ? error.lastError : error;
587
+ }
581
588
  /** Normalize SDK, Gateway, and Pi failures into one provider error contract. */
582
589
  function createProviderError(error, options = {}) {
583
590
  if (error instanceof ProviderError) return error;
584
591
  const message = providerMessage(error);
585
- const status = extractStatus(error, message);
586
- const kind = options.kind ?? classifyProviderError(status, message, extractTransportKind(error));
592
+ const attempt = lastAttemptError(error);
593
+ const status = extractStatus(attempt, message);
594
+ const kind = options.kind ?? classifyProviderError(status, message, extractTransportKind(attempt));
587
595
  const retryable = !TERMINAL_KINDS.has(kind) && (options.retryable ?? RETRYABLE_KINDS.has(kind));
588
596
  return new ProviderError({
589
597
  cause: error,
590
598
  kind,
591
599
  modelId: options.modelId,
592
600
  retryable,
593
- retryAfterMs: extractRetryAfterMs(error, message),
601
+ retryAfterMs: extractRetryAfterMs(attempt, message),
594
602
  status
595
603
  });
596
604
  }
@@ -620,25 +628,49 @@ function findProviderError(error) {
620
628
  current = current.cause;
621
629
  }
622
630
  }
623
- const TEMPORARY_PROVIDER_ERROR = "The model provider had a temporary connection problem. Please try again.";
631
+ const PROVIDER_NAMES = {
632
+ anthropic: "Anthropic",
633
+ google: "Google",
634
+ openai: "OpenAI",
635
+ xai: "xAI"
636
+ };
637
+ /**
638
+ * Name the failing model for user copy, such as `OpenAI (gpt-6-luna)`. A
639
+ * model that serves another step, such as action review, says so, because
640
+ * the person did not pick it.
641
+ */
642
+ function providerSubject(modelId, purpose) {
643
+ const slash = modelId?.indexOf("/") ?? -1;
644
+ if (!modelId || slash <= 0) return purpose ? `The model provider used for ${purpose}` : "The model provider";
645
+ const vendor = modelId.slice(0, slash);
646
+ const model = modelId.slice(slash + 1);
647
+ const details = purpose ? `${model}, used for ${purpose}` : model;
648
+ return `${PROVIDER_NAMES[vendor] ?? vendor} (${details})`;
649
+ }
650
+ const UPSTREAM = "This is an upstream provider problem, not something you did. Please try again shortly.";
624
651
  const PROVIDER_ERROR_MESSAGES = {
625
- capacity: "The selected model is temporarily unavailable because it is at capacity. Please try again shortly.",
626
- rate_limit: "The model is rate-limited. Please try again shortly.",
627
- timeout: TEMPORARY_PROVIDER_ERROR,
628
- network: TEMPORARY_PROVIDER_ERROR,
629
- server: TEMPORARY_PROVIDER_ERROR,
630
- auth: "The model provider rejected the configured credentials. This needs an administrator or configuration fix.",
631
- permission: "The model provider denied access to this model or request. Ask an administrator to check model access, organization policy, and region availability.",
632
- quota: "The model provider's usage quota has been exhausted. This needs an administrator or billing configuration fix.",
633
- content_policy: "The model provider blocked this request under its content policy. Please revise the request and try again.",
634
- invalid_request: "The model provider rejected this request as invalid. Please revise the request or ask an administrator to check the model configuration.",
635
- invalid_response: "The model provider returned an invalid response. Please try again.",
636
- unknown: "The model provider returned an error. Please try again."
652
+ capacity: (subject) => `${subject} is at capacity right now. ${UPSTREAM}`,
653
+ rate_limit: (subject) => `${subject} is rate-limiting requests right now. Please try again shortly.`,
654
+ timeout: (subject) => `${subject} is timing out right now. ${UPSTREAM}`,
655
+ network: (subject) => `${subject} cannot be reached right now. ${UPSTREAM}`,
656
+ server: (subject) => `${subject} is returning errors right now. ${UPSTREAM}`,
657
+ auth: (subject) => `${subject} rejected the configured credentials. This needs an administrator or configuration fix.`,
658
+ permission: (subject) => `${subject} denied access to this model or request. Ask an administrator to check model access, organization policy, and region availability.`,
659
+ quota: (subject) => `${subject} reports that the usage quota is exhausted. This needs an administrator or billing configuration fix.`,
660
+ content_policy: (subject) => `${subject} blocked this request under its content policy. Please revise the request and try again.`,
661
+ invalid_request: (subject) => `${subject} rejected this request as invalid. Please revise the request or ask an administrator to check the model configuration.`,
662
+ invalid_response: (subject) => `${subject} returned an invalid response. ${UPSTREAM}`,
663
+ unknown: (subject) => `${subject} returned an error. ${UPSTREAM}`
637
664
  };
638
- /** Return stable, sanitized copy suitable for a terminal user response. */
639
- function getProviderErrorUserMessage(error) {
640
- if (error.kind === "rate_limit" && error.retryAfterMs) return `The model is rate-limited. Please try again in about ${Math.max(1, Math.ceil(error.retryAfterMs / 1e3))} seconds.`;
641
- return PROVIDER_ERROR_MESSAGES[error.kind];
665
+ /**
666
+ * Return stable, sanitized copy suitable for a terminal user response. It
667
+ * names the provider and model, and `purpose` names the step that the model
668
+ * serves when it is not the agent model.
669
+ */
670
+ function getProviderErrorUserMessage(error, options = {}) {
671
+ const subject = providerSubject(error.modelId, options.purpose);
672
+ if (error.kind === "rate_limit" && error.retryAfterMs) return `${subject} is rate-limiting requests right now. Please try again in about ${Math.max(1, Math.ceil(error.retryAfterMs / 1e3))} seconds.`;
673
+ return PROVIDER_ERROR_MESSAGES[error.kind](subject);
642
674
  }
643
675
  /** Return safe structured fields for terminal failure telemetry. */
644
676
  function getProviderErrorAttributes(error) {
@@ -668,6 +700,7 @@ const RUNTIME_INPUT_TAGS = [
668
700
  "agent-result",
669
701
  "agent-message",
670
702
  "parent-agent-task",
703
+ "inbox-item-answer",
671
704
  "review-item-answer",
672
705
  "review-item-dismissed",
673
706
  "relayed-review-item-answer",
@@ -1328,7 +1361,7 @@ async function readServedProviders(state, modelId) {
1328
1361
  }));
1329
1362
  }
1330
1363
  async function gatewayOnlyForModel(modelId) {
1331
- const { getStateAdapter } = await import("./adapter-B1wujchl.js").then((n) => n.t);
1364
+ const { getStateAdapter } = await import("./adapter-CYAvJzZS.js").then((n) => n.t);
1332
1365
  const state = getStateAdapter();
1333
1366
  const enabled = await readLocal(localEnabledProviders, "enabled", () => readEnabledProviders(state));
1334
1367
  if (enabled === null) return void 0;
@@ -1965,7 +1998,6 @@ function toPiReasoningLevel(level) {
1965
1998
  return level === "none" ? "off" : level;
1966
1999
  }
1967
2000
  // src/chat/config.ts
1968
- var config_exports = /* @__PURE__ */ __exportAll({ botConfig: () => botConfig });
1969
2001
  const MIN_AGENT_TURN_TIMEOUT_MS = 1e4;
1970
2002
  const DEFAULT_AGENT_TURN_TIMEOUT_MS = 72e4;
1971
2003
  const MAX_SLICES_PER_TURN = 100;
@@ -2296,4 +2328,4 @@ function setSlackReactionConfig(overrides) {
2296
2328
  if (overrides.processingReactionEmoji !== void 0) chatConfig.slack.processingReactionEmoji = parseReactionEmoji("processingReactionEmoji", overrides.processingReactionEmoji, chatConfig.slack.processingReactionEmoji);
2297
2329
  if (overrides.completedReactionEmoji !== void 0) chatConfig.slack.completedReactionEmoji = parseReactionEmoji("completedReactionEmoji", overrides.completedReactionEmoji, chatConfig.slack.completedReactionEmoji);
2298
2330
  }
2299
- export { THREAD_CONTEXT_TAGS as $, searchWeb as A, withLock as B, completeObject as C, generateImages as D, gatewayCostUsd as E, createCache as F, textCharsForTokens as G, estimateMessagesTokens as H, ACTIVE_LOCK_TTL_MS as I, hasCompactedConversationContext as J, gatewayRoutingAttributes as K, MUTATION_LOCK_TTL_MS as L, readServedProviders as M, saveEnabledProviders as N, rerankTexts as O, cacheKeyPrefix as P, unwrapCurrentInstruction as Q, acquireActiveLock as R, completeDecision as S, embedTexts as T, estimateRequestOverheadTokens as U, requestPrefixAttributes as V, estimateTextTokens as W, hasCurrentInstruction as X, isCompactionSummaryText as Y, renderCurrentInstruction as Z, TURN_REASONING_LEVELS as _, getAttachmentStorage as _t, getRuntimeMetadata as a, renderUntrustedTag as at, GEN_AI_PROVIDER_NAME as b, getSlackClientSecret as c, createProviderError as ct, restoreRuntimeConfig as d, getProviderErrorUserMessage as dt, authorAttrs as et, setBotModelConfig as f, isProviderRefusal as ft, snapshotRuntimeConfig as g, bufferBody as gt, setSlackReactionConfig as h, resolveGatewayCredential as ht, getChatConfig as i, renderThreadContext as it, readEnabledProviders as j, resolveGatewayModel as k, getSlackSigningSecret as l, findProviderError as lt, setRuntimeLimits as m, getGatewayApiKey as mt, botConfig as n, readParentAgentTask as nt, getSlackBotToken as o, ProviderError as ot, setBotName as p, isProviderRetryError as pt, COMPACTION_SUMMARY_PREFIX as q, config_exports as r, renderParentAgentTask as rt, getSlackClientId as s, createAssistantProviderError as st, DEFAULT_SQL_STATEMENT_TIMEOUT_MS as t, isRuntimeInputText as tt, resetRuntimeConfig as u, getProviderErrorAttributes as ut, toPiReasoningLevel as v, toOptionalTrimmed as vt, completeText as w, GEN_AI_SERVER_ADDRESS as x, normalizeSlackEmojiName as y, fenceLock as z };
2331
+ export { authorAttrs as $, readEnabledProviders as A, requestPrefixAttributes as B, completeText as C, rerankTexts as D, generateImages as E, ACTIVE_LOCK_TTL_MS as F, gatewayRoutingAttributes as G, estimateRequestOverheadTokens as H, MUTATION_LOCK_TTL_MS as I, isCompactionSummaryText as J, COMPACTION_SUMMARY_PREFIX as K, acquireActiveLock as L, saveEnabledProviders as M, cacheKeyPrefix as N, resolveGatewayModel as O, createCache as P, THREAD_CONTEXT_TAGS as Q, fenceLock as R, completeObject as S, gatewayCostUsd as T, estimateTextTokens as U, estimateMessagesTokens as V, textCharsForTokens as W, renderCurrentInstruction as X, hasCurrentInstruction as Y, unwrapCurrentInstruction as Z, toPiReasoningLevel as _, toOptionalTrimmed as _t, getSlackBotToken as a, ProviderError as at, GEN_AI_SERVER_ADDRESS as b, getSlackSigningSecret as c, findProviderError as ct, setBotModelConfig as d, isProviderRefusal as dt, isRuntimeInputText as et, setBotName as f, isProviderRetryError as ft, TURN_REASONING_LEVELS as g, getAttachmentStorage as gt, snapshotRuntimeConfig as h, bufferBody as ht, getRuntimeMetadata as i, renderUntrustedTag as it, readServedProviders as j, searchWeb as k, resetRuntimeConfig as l, getProviderErrorAttributes as lt, setSlackReactionConfig as m, resolveGatewayCredential as mt, botConfig as n, renderParentAgentTask as nt, getSlackClientId as o, createAssistantProviderError as ot, setRuntimeLimits as p, getGatewayApiKey as pt, hasCompactedConversationContext as q, getChatConfig as r, renderThreadContext as rt, getSlackClientSecret as s, createProviderError as st, DEFAULT_SQL_STATEMENT_TIMEOUT_MS as t, readParentAgentTask as tt, restoreRuntimeConfig as u, getProviderErrorUserMessage as ut, normalizeSlackEmojiName as v, embedTexts as w, completeDecision as x, GEN_AI_PROVIDER_NAME as y, withLock as z };
@@ -1,10 +1,10 @@
1
- import { Bo as postSlackMessage, Fo as deleteSlackMessage, Io as getSlackMessagePermalink, Lt as moveIdleConversationDestination, ds as formatSlackLink, ja as readLatestConversationBrief, ks as getDashboardConversationLink, us as escapeSlackMrkdwnText } from "./projection-Cns7XwWa.js";
2
- import { I as setFirstConversationLocation, R as claimProviderConversation, a as getConversationStore, o as getDb, s as getSqlExecutor, w as withConversationMutationLock, z as getConversationIdByProviderConversation } from "./db-DTxzH7u5.js";
1
+ import { B as claimProviderConversation, R as setFirstConversationLocation, V as getConversationIdByProviderConversation, a as getConversationStore, o as getDb, s as getSqlExecutor, w as withConversationMutationLock } from "./db-PwSRzWWn.js";
2
+ import { Gr as deleteSlackMessage, Kr as getSlackMessagePermalink, Xr as postSlackMessage, ai as escapeSlackMrkdwnText, oi as formatSlackLink, wi as getDashboardConversationLink } from "./credentialed-Dyv8b-lu.js";
3
3
  import { u as parseSlackChannelId, v as parseSlackMessageTs } from "./actor-BsBdxDXQ.js";
4
- import { Hi as checkSlackChannelReadAccess, Ui as joinPublicChannelForRead } from "./warmup-BWdHew2H.js";
5
- import { i as getStateAdapter } from "./adapter-B1wujchl.js";
6
- import "./store-DmmMIrQi.js";
7
- import { q as juniorDestinations } from "./executor-DqTiYj9S.js";
4
+ import { n as joinPublicChannelForRead, t as checkSlackChannelReadAccess } from "./channel-access-mt7K6dPh.js";
5
+ import { i as getStateAdapter } from "./adapter-CYAvJzZS.js";
6
+ import { mn as moveIdleConversationDestination } from "./turn-membership-DTR3SaKD.js";
7
+ import { q as juniorDestinations } from "./executor-CgWyWfYz.js";
8
8
  import { and, eq } from "drizzle-orm";
9
9
  // src/chat/slack/continue-in-slack.ts
10
10
  /** Refusal for a move that cannot wait for the active Run. */
@@ -28,10 +28,9 @@ function canContinueInSlack(conversation, access) {
28
28
  async function movedMessageText(conversation, actorName) {
29
29
  const title = conversation.title ?? "Untitled conversation";
30
30
  const url = getDashboardConversationLink(conversation.conversationId);
31
- const brief = await readLatestConversationBrief(getDb(), conversation.conversationId);
32
31
  return [
33
32
  `*${url ? formatSlackLink(url, title) : escapeSlackMrkdwnText(title)}*`,
34
- ...brief ? [`> ${escapeSlackMrkdwnText(brief.content.summary)}`] : [],
33
+ ...conversation.summary ? [`> ${escapeSlackMrkdwnText(conversation.summary)}`] : [],
35
34
  `${escapeSlackMrkdwnText(actorName)} moved this conversation here from the dashboard. Mention me in this thread to continue.`
36
35
  ].join("\n");
37
36
  }
@@ -1,4 +1,4 @@
1
- import { F as briefOutcomeStatusSchema, K as reviewItemChangeRecordSchema, i as actorIdentitySchema, nt as messageAttachmentSchema, u as conversationDetailReportSchema, y as conversationSummaryReportSchema } from "./conversation-ca__NDQW.js";
1
+ import { G as conversationDetailReportSchema, Ot as messageAttachmentSchema, et as conversationSummaryReportSchema, vt as inboxItemChangeRecordSchema, z as actorIdentitySchema } from "./media-B0pZJ0bG.js";
2
2
  import * as z from "zod";
3
3
  // src/api/objects/cards.ts
4
4
  const MAX_LABEL_CHARS = 256;
@@ -12,8 +12,8 @@ function personName(person) {
12
12
  return person.fullName ?? person.slackUserName ?? person.email;
13
13
  }
14
14
  /**
15
- * Build the card of one Conversation that the viewer may read. Give `brief`
16
- * only when the viewer may see the Brief.
15
+ * Build the card of one Conversation that the viewer may read. Give
16
+ * `description` only when the viewer may see private content.
17
17
  */
18
18
  function conversationObjectCard(args) {
19
19
  const { summary } = args;
@@ -26,7 +26,7 @@ function conversationObjectCard(args) {
26
26
  title: summary.displayTitle.slice(0, 512),
27
27
  url: args.url,
28
28
  status: summary.archivedAt ? "archived" : conversationStates[summary.status],
29
- ...args.brief ? { description: args.brief.slice(0, 4e3) } : void 0,
29
+ ...args.description ? { description: args.description.slice(0, 4e3) } : void 0,
30
30
  facts: {
31
31
  type: "conversation",
32
32
  ...participants.length > 0 ? { participants } : void 0,
@@ -230,8 +230,8 @@ const conversationPendingMessageSchema = z.object({
230
230
  /** People mentioned in the text, resolved at read time. */
231
231
  mentions: z.array(actorIdentitySchema).optional(),
232
232
  attachments: z.array(messageAttachmentSchema).optional(),
233
- /** Review item change that this Message records. */
234
- reviewItemChange: reviewItemChangeRecordSchema.optional(),
233
+ /** Inbox item change that this Message records. */
234
+ reviewItemChange: inboxItemChangeRecordSchema.optional(),
235
235
  redacted: z.literal(true).optional()
236
236
  }).strict().superRefine((data, context) => {
237
237
  if (data.text === void 0 === (data.redacted !== true)) context.addIssue({
@@ -240,7 +240,7 @@ const conversationPendingMessageSchema = z.object({
240
240
  });
241
241
  if (data.redacted && (data.actorIdentity || data.attachments || data.mentions || data.reviewItemChange)) context.addIssue({
242
242
  code: "custom",
243
- message: "redacted pending messages must not expose actor identity, attachments, mentions, or a review item"
243
+ message: "redacted pending messages must not expose actor identity, attachments, mentions, or an inbox item"
244
244
  });
245
245
  });
246
246
  /** Participant-only authorization prompt for a parked web turn. */
@@ -268,12 +268,12 @@ const conversationUnchangedDetailWithMailboxSchema = z.object({
268
268
  }).strict();
269
269
  /** Optional filters for cancelling accepted mailbox rows. */
270
270
  const cancelConversationPendingMessagesBodySchema = z.object({
271
- inboundMessageIds: z.array(z.string().min(1)).min(1).optional(),
272
- receivedBefore: z.string().datetime().optional()
271
+ inboundMessageIds: z.array(z.string().min(1)).min(1).optional().describe("Drop only these waiting messages."),
272
+ receivedBefore: z.string().datetime().optional().describe("Drop only the waiting messages received before this time.")
273
273
  }).strict();
274
274
  /** Result of cancelling accepted human-facing mailbox rows. */
275
275
  const cancelConversationPendingMessagesResponseSchema = z.object({
276
- cancelledCount: z.number().int().nonnegative(),
276
+ cancelledCount: z.number().int().nonnegative().describe("Messages dropped."),
277
277
  cancelledInboundMessageIds: z.array(z.string().min(1)),
278
278
  conversationId: z.string().min(1)
279
279
  }).strict();
@@ -284,16 +284,71 @@ const steerConversationPendingMessagesResponseSchema = z.object({
284
284
  conversationId: z.string().min(1),
285
285
  steeredInboundMessageIds: z.array(z.string().min(1))
286
286
  }).strict();
287
- // src/api/schema/conversation-feed.ts
287
+ // src/api/schema/conversation-archive.ts
288
288
  /**
289
- * The part of a Conversation's latest Brief that a feed row shows: what the
290
- * work is about and how it stands.
289
+ * Archive or restore one conversation. `applyToChildren` applies to a child
290
+ * only: archive refuses while a descendant is unarchived unless it is true,
291
+ * and restore also restores the descendants archived with the child when it
292
+ * is true. A root archive is per viewer and writes no child rows.
291
293
  */
292
- const conversationFeedBriefSchema = z.object({
293
- intent: z.string(),
294
- status: briefOutcomeStatusSchema,
295
- summary: z.string()
294
+ const archiveConversationBodySchema = z.object({
295
+ applyToChildren: z.boolean().optional().describe("On archive, true also archives every child of this conversation at any depth; without it, the archive fails while any of its children is not archived. On restore, true also restores the children that were archived with this conversation."),
296
+ archived: z.boolean().default(true).describe("False restores an archived conversation."),
297
+ lastSeenAt: z.string().datetime().describe("`lastSeenAt` from searchConversations or getConversation. The archive fails when the conversation has newer activity.")
296
298
  }).strict();
299
+ const archiveConversationResponseSchema = z.object({ archivedAt: z.string().datetime().nullable().describe("Null when the conversation is not archived.") }).strict();
300
+ /** Viewer's auto-archive choice for one conversation. */
301
+ const conversationAutoArchiveSchema = z.object({ autoArchive: z.boolean().describe("True lets auto-archive archive the conversation for everyone after its work is done. False keeps it from auto-archive for everyone.") }).strict();
302
+ /** Result of archiving all of the viewer's done conversations once. */
303
+ const archiveDoneConversationsResponseSchema = z.object({ archived: z.number().int().nonnegative().describe("Conversations archived.") }).strict();
304
+ // src/api/schema/conversation-pin.ts
305
+ /** Pin or unpin one Conversation for the signed-in viewer. */
306
+ const pinConversationBodySchema = z.object({ pinned: z.boolean().default(true).describe("False unpins the conversation.") }).strict();
307
+ /** The viewer's pin time after the change, or null when unpinned. */
308
+ const pinConversationResponseSchema = z.object({ pinnedAt: z.string().datetime().nullable().describe("Null when the conversation is not pinned.") }).strict();
309
+ /**
310
+ * The viewer's full Pinned order, first to last. Each pin takes its index as
311
+ * its new place.
312
+ */
313
+ const reorderPinnedConversationsBodySchema = z.object({ conversationIds: z.array(z.string().min(1)).min(1).max(500).refine((ids) => new Set(ids).size === ids.length, { message: "Each Conversation can appear once." }) }).strict();
314
+ /** The pinned Conversations that got a new place, in order. */
315
+ const reorderPinnedConversationsResponseSchema = z.object({ conversationIds: z.array(z.string()) }).strict();
316
+ // src/api/schema/conversation-subscription.ts
317
+ /** Subscribe to or unsubscribe from one Conversation for the viewer. */
318
+ const conversationSubscriptionBodySchema = z.object({ subscribed: z.boolean().describe("False unsubscribes you.") }).strict();
319
+ /**
320
+ * The viewer's subscription after the change. `archivedAt` is set when the
321
+ * viewer was the last subscriber, so the unsubscribe archived the
322
+ * Conversation for everyone.
323
+ */
324
+ const conversationSubscriptionResponseSchema = z.object({
325
+ archivedAt: z.string().datetime().nullable().describe("Set when the conversation is archived for everyone."),
326
+ subscribed: z.boolean()
327
+ }).strict();
328
+ /** Invite one mentioned person, by Slack user id, to a public Conversation. */
329
+ const conversationInviteBodySchema = z.object({ slackUserId: z.string().min(1).max(64) }).strict();
330
+ /** `added` is false when the person was already a Participant. */
331
+ const conversationInviteResponseSchema = z.object({ added: z.boolean() }).strict();
332
+ // src/api/schema/conversation-stop.ts
333
+ /** One queued web message from the viewer that a stop removed. */
334
+ const stoppedConversationMessageSchema = z.object({
335
+ inboundMessageId: z.string().min(1),
336
+ text: z.string().min(1)
337
+ }).strict();
338
+ /**
339
+ * Result of stopping the active Turn.
340
+ *
341
+ * `stoppedInboundMessageIds` lists every queued human message the stop
342
+ * removes. `stoppedMessages` holds only the viewer's own web text, so the
343
+ * dashboard can return it to the composer.
344
+ */
345
+ const stopConversationTurnResponseSchema = z.object({
346
+ conversationId: z.string().min(1),
347
+ status: z.enum(["no_work", "requested"]).describe("`requested` when the running turn was asked to stop. `no_work` when no turn was running. Child agents are stopped in both cases."),
348
+ stoppedInboundMessageIds: z.array(z.string().min(1)).describe("Messages that waited for the turn and were dropped."),
349
+ stoppedMessages: z.array(stoppedConversationMessageSchema).describe("Your own dropped messages, with their text.")
350
+ }).strict();
351
+ // src/api/schema/conversation-feed.ts
297
352
  const conversationFeedIncludeSchema = z.enum(["links", "media"]);
298
353
  /** Query of `GET /api/conversations`. */
299
354
  const conversationFeedQuerySchema = z.object({
@@ -320,7 +375,7 @@ const conversationFeedMediaSchema = z.object({
320
375
  id: z.string().min(1)
321
376
  }).strict();
322
377
  /**
323
- * The viewer's newest answer to a Review item that the Conversation added:
378
+ * The viewer's newest answer to an Inbox item that the Conversation added:
324
379
  * when it closed and the options they picked. A text answer has no choices.
325
380
  */
326
381
  const conversationFeedViewerAnswerSchema = z.object({
@@ -332,7 +387,6 @@ const conversationFeedViewerAnswerSchema = z.object({
332
387
  * its nearest visible Thread ancestor, or under the root. Tasks never show.
333
388
  */
334
389
  const conversationFeedItemSchema = conversationSummaryReportSchema.extend({
335
- brief: conversationFeedBriefSchema.optional(),
336
390
  /**
337
391
  * Web links from the Conversation's recent messages, newest first, for
338
392
  * the row to resolve into cards. URLs only: never message text. Only
@@ -341,6 +395,11 @@ const conversationFeedItemSchema = conversationSummaryReportSchema.extend({
341
395
  links: z.array(z.url()).max(3).optional(),
342
396
  /** Only with `include=media`. */
343
397
  media: z.array(conversationFeedMediaSchema).max(3).optional(),
398
+ /**
399
+ * Threads that `CONVERSATION_FEED_THREAD_LIMIT` left out of `threads`.
400
+ * Only on a root, and only when the cap cut some.
401
+ */
402
+ omittedThreadCount: z.number().int().positive().optional(),
344
403
  threads: z.lazy(() => z.array(conversationFeedItemSchema)).optional(),
345
404
  /** Only on the viewer's own feed. */
346
405
  viewerAnswer: conversationFeedViewerAnswerSchema.optional()
@@ -350,6 +409,12 @@ const conversationFeedSchema = z.object({
350
409
  source: z.literal("conversation_index"),
351
410
  generatedAt: z.string(),
352
411
  /** Present when older conversations follow this page. */
353
- nextCursor: z.string().optional()
412
+ nextCursor: z.string().optional(),
413
+ /**
414
+ * Present when `CONVERSATION_FEED_WAITING_LIMIT` cut the waiting rows
415
+ * that this first page adds from outside it. The rest come on later
416
+ * pages.
417
+ */
418
+ waitingRowsTruncated: z.literal(true).optional()
354
419
  }).strict();
355
- export { skillReportSchema as C, personObjectCard as D, messageObjectCard as E, webPageObjectCard as O, skillDetailReportSchema as S, conversationObjectCard as T, pluginPackageContentItemReportSchema as _, cancelConversationPendingMessagesResponseSchema as a, pluginsSchema as b, conversationPendingMessageDeliverySchema as c, conversationUnchangedDetailWithMailboxSchema as d, steerConversationPendingMessagesBodySchema as f, pluginOperationalReportSchema as g, pluginOperationalReportFeedSchema as h, cancelConversationPendingMessagesBodySchema as i, conversationPendingMessageSchema as l, healthReportSchema as m, conversationFeedQuerySchema as n, conversationDetailWithMailboxReportSchema as o, steerConversationPendingMessagesResponseSchema as p, conversationFeedSchema as r, conversationPendingAuthorizationSchema as s, conversationFeedBriefSchema as t, conversationPendingMessagesReportSchema as u, pluginPackageContentReportSchema as v, skillReportsSchema as w, runtimeInfoReportSchema as x, pluginSchema as y };
420
+ export { pluginPackageContentReportSchema as A, webPageObjectCard as B, conversationUnchangedDetailWithMailboxSchema as C, pluginOperationalReportFeedSchema as D, healthReportSchema as E, skillReportSchema as F, skillReportsSchema as I, conversationObjectCard as L, pluginsSchema as M, runtimeInfoReportSchema as N, pluginOperationalReportSchema as O, skillDetailReportSchema as P, messageObjectCard as R, conversationPendingMessagesReportSchema as S, steerConversationPendingMessagesResponseSchema as T, cancelConversationPendingMessagesResponseSchema as _, conversationInviteResponseSchema as a, conversationPendingMessageDeliverySchema as b, pinConversationBodySchema as c, reorderPinnedConversationsResponseSchema as d, archiveConversationBodySchema as f, cancelConversationPendingMessagesBodySchema as g, conversationAutoArchiveSchema as h, conversationInviteBodySchema as i, pluginSchema as j, pluginPackageContentItemReportSchema as k, pinConversationResponseSchema as l, archiveDoneConversationsResponseSchema as m, conversationFeedSchema as n, conversationSubscriptionBodySchema as o, archiveConversationResponseSchema as p, stopConversationTurnResponseSchema as r, conversationSubscriptionResponseSchema as s, conversationFeedQuerySchema as t, reorderPinnedConversationsBodySchema as u, conversationDetailWithMailboxReportSchema as v, steerConversationPendingMessagesBodySchema as w, conversationPendingMessageSchema as x, conversationPendingAuthorizationSchema as y, personObjectCard as z };
@@ -1,4 +1,4 @@
1
- import { h as logWarn } from "./logging-FjclQsXu.js";
1
+ import { h as logWarn } from "./logging-DNt-qOIO.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  import { renderSystemMessageUpdate } from "@earendil-works/pi-ai";
4
4
  // src/chat/conversation-privacy.ts