@sentry/junior 0.306.0 → 0.307.1

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 (91) hide show
  1. package/dist/{adapter-context-CnY-i32r.js → adapter-context-HrBTD8rJ.js} +2 -2
  2. package/dist/{admin-BLLdLnXh.js → admin-B78_KmfR.js} +2 -2
  3. package/dist/{agent-runner-BaLjEjPR.js → agent-runner-DxivxUYd.js} +226 -137
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +4 -4
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +328 -298
  8. package/dist/{app-DvYbM9UD.d.ts → app-EZur8cVC.d.ts} +12 -3
  9. package/dist/app.d.ts +2 -2
  10. package/dist/app.js +84 -44
  11. package/dist/background-compaction-queue-HlljT9ql.js +231 -0
  12. package/dist/{briefs-DvyzXfrF.js → briefs-DR8mp-TK.js} +2 -2
  13. package/dist/{catalog-runtime-B1R-nHd3.js → catalog-runtime-Se9idiDR.js} +1 -1
  14. package/dist/cli/chat.d.ts +1 -1
  15. package/dist/cli/chat.js +17 -16
  16. package/dist/cli/check.js +58 -48
  17. package/dist/cli/main.js +3 -3
  18. package/dist/cli/plugins.d.ts +1 -1
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +5 -5
  21. package/dist/cli/upgrade.d.ts +2 -2
  22. package/dist/cli/upgrade.js +3 -8
  23. package/dist/{config-DUD-zMvp.js → config-DY5c1E0l.js} +74 -38
  24. package/dist/{connections-CDhsqPcC.js → connections-C-SqzubG.js} +10 -8
  25. package/dist/{continue-in-slack-BXQizz9o.js → continue-in-slack-DNkrrWuQ.js} +5 -5
  26. package/dist/{conversation-privacy-YE54gMN8.js → conversation-privacy-CVj9vSrP.js} +1 -1
  27. package/dist/{conversation-turn-BzdmrHb0.js → conversation-turn-CkzrIfJ2.js} +19 -47
  28. package/dist/{credential-sync-Cdm-e1vJ.js → credential-sync-B9CIkgOT.js} +28 -28
  29. package/dist/{db-DV2ZUb1Y.js → db-C21CyyTE.js} +140 -11
  30. package/dist/{db-pH357Dkt.d.ts → db-C41UgdBj.d.ts} +1 -1
  31. package/dist/{executor-CjNhwwnj.js → executor-DfNoVVGd.js} +93 -32
  32. package/dist/{install-DbD7C5td.js → install-lYZs8UCL.js} +2 -2
  33. package/dist/instrumentation.js +2 -2
  34. package/dist/{lineage-BFdIPb3o.js → lineage-BJTSY53A.js} +2 -2
  35. package/dist/{logging-oYpJYr-S.js → logging-DjW7LjgJ.js} +1 -1
  36. package/dist/{message-BBPcMKJY.js → message-BPPZpdoZ.js} +8 -8
  37. package/dist/{model-input-DYYF3a8B.js → model-input-DKqiLFGa.js} +3 -3
  38. package/dist/nitro.d.ts +2 -2
  39. package/dist/nitro.js +12 -5
  40. package/dist/{oauth-callback-server-C7Q987su.js → oauth-callback-server-OJP8Y4Ca.js} +2 -2
  41. package/dist/{oauth-relay-DAmfVmJu.js → oauth-relay-KwDz41Z3.js} +1 -1
  42. package/dist/{plugins-B_0Cr0MO.d.ts → plugins-fBrz8PCV.d.ts} +2 -0
  43. package/dist/{projection-CWXDE0f6.js → projection-D47mlszd.js} +1112 -693
  44. package/dist/{prompt-P3eRqO8C.js → prompt-DuWH_YIb.js} +3 -3
  45. package/dist/{registry-1pzXmplY.js → registry-yht0oxq6.js} +19 -9
  46. package/dist/{resolve-n87oXY-d.js → resolve-gZ-hVMYl.js} +3 -3
  47. package/dist/{result-BmF9v9bv.js → result-CP99Ok0_.js} +13 -11
  48. package/dist/{runner-4j7ZsxP5.js → runner-eVlnUkY7.js} +9 -9
  49. package/dist/{sandbox-egress-signals-BRQI8HvT.js → sandbox-egress-signals-DZL_0lnG.js} +1 -1
  50. package/dist/{schedule-CHPWQn-x.js → schedule-BG1tEbRF.js} +34 -4
  51. package/dist/{schema-CVbIjrF3.d.ts → schema-CRXcj4fj.d.ts} +350 -143
  52. package/dist/{schema-D7iIEh6t.js → schema-D4jdesIu.js} +12 -4
  53. package/dist/{service-account-DzQiOmqa.js → service-account-CZneZHh7.js} +8 -6
  54. package/dist/{service-account-BDQ9xzta.js → service-account-tI3LBg2_.js} +3 -3
  55. package/dist/{session-stop-BQxgHR4X.js → session-stop-D3S7mSkX.js} +36 -23
  56. package/dist/{skills-CPf4vNuC.js → skills-Bm6uSO9V.js} +32 -28
  57. package/dist/{slack-conversation-unfurl-B1KEptUg.js → slack-conversation-unfurl-BeBvg3xU.js} +10 -10
  58. package/dist/{spawn-CjGddiAU.js → spawn-vhMAmLuh.js} +6 -6
  59. package/dist/{state-9wfj6aSD.js → state-3Yiy2FvP.js} +4 -4
  60. package/dist/{stop-CsQGuN5n.js → stop-Bh53GUoX.js} +146 -158
  61. package/dist/{store-Dz3YZ7gQ.js → store-BZJdHYR7.js} +5 -5
  62. package/dist/{background-compaction-queue-D2wzxtGU.js → task-queue-BEl5G38v.js} +164 -180
  63. package/dist/{task-runner-frzlUvFD.js → task-runner-C6Bujc6h.js} +11 -8
  64. package/dist/{thread-context-C4QuZlM8.js → thread-context-DxMQGGd_.js} +6 -6
  65. package/dist/{turn-session-routing-BXaubz2w.js → turn-session-routing-CmQY0T60.js} +24 -5
  66. package/dist/{turn-user-message-DNC0eRZ7.js → turn-user-message-Dfbr3Ud9.js} +3 -3
  67. package/dist/{users-XCCKn3xW.js → users-6rSdqXXk.js} +1 -1
  68. package/dist/{validation-L5fdjmFX.js → validation--hsjOLRL.js} +1 -1
  69. package/dist/{version-BFmuwgxP.js → version-9iMT25Hq.js} +1 -1
  70. package/dist/version.js +1 -1
  71. package/dist/{viewer-DKOeHpv3.js → viewer-De1vmuEA.js} +3 -3
  72. package/dist/{warmup-mTMIatCV.js → warmup-C0IblNtf.js} +596 -281
  73. package/dist/{web-message-id-CUaSiGme.js → web-message-id-BT8Mg8LL.js} +1 -1
  74. package/dist/{worker-Bz4KNxjI.js → worker-CiyRr2q7.js} +8 -7
  75. package/migrations/0115_automation_creator_slack_index.sql +1 -0
  76. package/migrations/0116_conversation_event_search.sql +25 -0
  77. package/migrations/0117_automation_last_run.sql +46 -0
  78. package/migrations/0118_automation_last_run_index.sql +1 -0
  79. package/migrations/0119_money_micro_usd.sql +29 -0
  80. package/migrations/0120_conversation_cost_micro_usd.sql +8 -0
  81. package/migrations/meta/0115_snapshot.json +5225 -0
  82. package/migrations/meta/0116_snapshot.json +5388 -0
  83. package/migrations/meta/0117_snapshot.json +5413 -0
  84. package/migrations/meta/0118_snapshot.json +5428 -0
  85. package/migrations/meta/0119_snapshot.json +5441 -0
  86. package/migrations/meta/0120_snapshot.json +5441 -0
  87. package/migrations/meta/_journal.json +42 -0
  88. package/package.json +10 -9
  89. package/dist/queue-7FSijgqG.js +0 -115
  90. package/dist/secrets-DHaJ5TTn.js +0 -18
  91. package/dist/task-queue-CFlrJguF.js +0 -89
@@ -1,6 +1,6 @@
1
- import { $ as ProviderError, A as searchWeb$1, C as completeObject$1, D as generateImages$1, E as gatewayCostUsd, S as completeDecision$1, T as embedTexts$1, b as GEN_AI_PROVIDER_NAME, ct as resolveGatewayCredential, ot as isProviderRetryError, tt as createProviderError, w as completeText$1, x as GEN_AI_SERVER_ADDRESS } from "./config-DUD-zMvp.js";
2
- import { E as withSpan, _ as runBestEffort, a as extractGenAiUsageSummary, i as extractGenAiUsageAttributes, p as logException } from "./logging-oYpJYr-S.js";
3
- import { r as getConversationEventStore, ut as agentTurnCostUsd } from "./db-DV2ZUb1Y.js";
1
+ import { $ as ProviderError, A as searchWeb$1, C as completeObject$1, D as generateImages$1, E as gatewayCostUsd, S as completeDecision$1, T as embedTexts$1, b as GEN_AI_PROVIDER_NAME, ct as resolveGatewayCredential, ot as isProviderRetryError, tt as createProviderError, w as completeText$1, x as GEN_AI_SERVER_ADDRESS } from "./config-DY5c1E0l.js";
2
+ import { E as withSpan, _ as runBestEffort, a as extractGenAiUsageSummary, i as extractGenAiUsageAttributes, p as logException } from "./logging-DjW7LjgJ.js";
3
+ import { _t as agentTurnCostUsd, r as getConversationEventStore } from "./db-C21CyyTE.js";
4
4
  import { I as conversationBriefSchema, L as parseBriefInput, P as briefOutcomeStatusSchema } from "./conversation--f85g4zL.js";
5
5
  import * as z from "zod";
6
6
  import { createGatewayProvider } from "@ai-sdk/gateway";
@@ -1,5 +1,5 @@
1
1
  import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-x4AvVhMj.js";
2
- import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-oYpJYr-S.js";
2
+ import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-DjW7LjgJ.js";
3
3
  import { o as isUserActor, s as parseActorUserId } from "./actor-D2iXzvlN.js";
4
4
  import * as z from "zod";
5
5
  import path from "node:path";
@@ -96,11 +96,13 @@ function inlineManifestSource(manifest) {
96
96
  setDefined$1(result, "name", manifest.name);
97
97
  setDefined$1(result, "display-name", manifest.displayName);
98
98
  setDefined$1(result, "description", manifest.description);
99
+ setDefined$1(result, "review-context", manifest.reviewContext);
99
100
  setDefined$1(result, "config-keys", inlineTokenListSource(manifest.name, manifest.configKeys));
100
101
  setDefined$1(result, "domains", manifest.domains);
101
102
  setDefined$1(result, "api-headers", manifest.apiHeaders);
102
103
  setDefined$1(result, "command-env", manifest.commandEnv);
103
104
  setDefined$1(result, "env-vars", manifest.envVars);
105
+ setDefined$1(result, "tools-send-no-credential", manifest.toolsSendNoCredential);
104
106
  setDefined$1(result, "credentials", inlineCredentialsSource(manifest.credentials));
105
107
  setDefined$1(result, "runtime-dependencies", manifest.runtimeDependencies);
106
108
  setDefined$1(result, "runtime-postinstall", manifest.runtimePostinstall);
@@ -279,6 +281,7 @@ const manifestSourceSchema = z.object({
279
281
  name: z.string().refine((value) => PLUGIN_NAME_RE.test(value), { error: "invalid" }),
280
282
  "display-name": nonEmptyTrimmedString,
281
283
  description: nonEmptyTrimmedString,
284
+ "review-context": nonEmptyTrimmedString.optional(),
282
285
  "config-keys": z.array(z.string(), { error: "must be an array when provided" }).optional(),
283
286
  domains: domainsSchema.optional(),
284
287
  "api-headers": stringMapSchema.optional(),
@@ -290,7 +293,8 @@ const manifestSourceSchema = z.object({
290
293
  mcp: z.record(z.string(), z.unknown(), { error: "must be an object" }).optional(),
291
294
  oauth: z.record(z.string(), z.unknown(), { error: "must be an object" }).optional(),
292
295
  accounts: z.record(z.string(), z.unknown(), { error: "must be an object" }).optional(),
293
- target: z.record(z.string(), z.unknown(), { error: "must be an object" }).optional()
296
+ target: z.record(z.string(), z.unknown(), { error: "must be an object" }).optional(),
297
+ "tools-send-no-credential": z.boolean({ error: "must be a boolean" }).optional()
294
298
  }).passthrough();
295
299
  function setDefined(target, key, value) {
296
300
  if (value !== void 0) target[key] = value;
@@ -299,11 +303,13 @@ function manifestConfigPatch(config) {
299
303
  const result = {};
300
304
  setDefined(result, "display-name", config.displayName);
301
305
  setDefined(result, "description", config.description);
306
+ setDefined(result, "review-context", config.reviewContext);
302
307
  setDefined(result, "config-keys", config.configKeys);
303
308
  setDefined(result, "domains", config.domains);
304
309
  setDefined(result, "api-headers", config.apiHeaders);
305
310
  setDefined(result, "command-env", config.commandEnv);
306
311
  setDefined(result, "env-vars", config.envVars);
312
+ setDefined(result, "tools-send-no-credential", config.toolsSendNoCredential);
307
313
  if (config.credentials !== void 0) {
308
314
  if (!config.credentials) result["credentials"] = null;
309
315
  else {
@@ -704,6 +710,7 @@ function parseManifestSource(parsedSource, dir, config, options) {
704
710
  name: data.name,
705
711
  displayName: data["display-name"],
706
712
  description: data.description,
713
+ ...data["review-context"] ? { reviewContext: data["review-context"] } : void 0,
707
714
  configKeys,
708
715
  ...domains ? { domains } : void 0,
709
716
  ...apiHeaders ? { apiHeaders } : void 0,
@@ -713,7 +720,8 @@ function parseManifestSource(parsedSource, dir, config, options) {
713
720
  ...runtimeDependencies ? { runtimeDependencies } : void 0,
714
721
  ...runtimePostinstall ? { runtimePostinstall } : void 0,
715
722
  ...mcp ? { mcp } : void 0,
716
- ...accounts ? { accounts } : void 0
723
+ ...accounts ? { accounts } : void 0,
724
+ ...data["tools-send-no-credential"] ? { toolsSendNoCredential: true } : void 0
717
725
  };
718
726
  if (data.oauth) {
719
727
  if (!credentials && options?.allowHookManagedEgress !== true) throw new Error(`Plugin ${data.name} oauth requires credentials`);
@@ -1080,10 +1088,14 @@ function resolvePluginCommandEnv(manifest) {
1080
1088
  return env;
1081
1089
  }
1082
1090
  // src/chat/plugins/auth/auth-token-placeholder.ts
1083
- const DEFAULT_PLACEHOLDERS = { "oauth-bearer": "host_managed_credential" };
1091
+ /**
1092
+ * The marker that every built-in Sandbox credential placeholder contains,
1093
+ * such as `host_managed_credential` or `ghp_host_managed_credential`.
1094
+ */
1095
+ const HOST_MANAGED_CREDENTIAL_PLACEHOLDER = "host_managed_credential";
1084
1096
  /** Resolve the non-secret sandbox token placeholder for token-backed credentials. */
1085
1097
  function resolveAuthTokenPlaceholder(credentials) {
1086
- return credentials.authTokenPlaceholder?.trim() || DEFAULT_PLACEHOLDERS[credentials.type];
1098
+ return credentials.authTokenPlaceholder?.trim() || "host_managed_credential";
1087
1099
  }
1088
1100
  // src/chat/plugins/auth/api-headers-broker.ts
1089
1101
  const MAX_LEASE_MS$1 = 36e5;
@@ -1166,9 +1178,7 @@ function buildOAuthTokenRequest(input) {
1166
1178
  }
1167
1179
  const contentType = headers.get("Content-Type") ?? DEFAULT_TOKEN_CONTENT_TYPE;
1168
1180
  const serializedHeaders = {};
1169
- headers.forEach((value, key) => {
1170
- serializedHeaders[key] = value;
1171
- });
1181
+ for (const [key, value] of headers) serializedHeaders[key] = value;
1172
1182
  return {
1173
1183
  headers: serializedHeaders,
1174
1184
  body: contentTypeToBody(contentType, payload)
@@ -1676,4 +1686,4 @@ function createPluginCatalogRuntime() {
1676
1686
  }
1677
1687
  };
1678
1688
  }
1679
- export { CredentialUnavailableError as _, resolveAuthTokenPlaceholder as a, fetchWithBoundedOAuthErrorBodies as c, actorLogContext as d, credentialContextForActor as f, credentialUserSubjectId as g, credentialSubjectSchema as h, resolvePluginHeaderEnvRefs as i, getOAuthProviderErrorAttributes as l, credentialLogContext as m, buildOAuthTokenRequest as n, resolvePluginCommandEnv as o, credentialContextSchema as p, parseOAuthTokenResponse as r, OAuthProviderError as s, createPluginCatalogRuntime as t, hasRequiredOAuthScope as u, parseInlinePluginManifest as v, parsePluginManifest as y };
1689
+ export { credentialUserSubjectId as _, HOST_MANAGED_CREDENTIAL_PLACEHOLDER as a, parsePluginManifest as b, OAuthProviderError as c, hasRequiredOAuthScope as d, actorLogContext as f, credentialSubjectSchema as g, credentialLogContext as h, resolvePluginHeaderEnvRefs as i, fetchWithBoundedOAuthErrorBodies as l, credentialContextSchema as m, buildOAuthTokenRequest as n, resolveAuthTokenPlaceholder as o, credentialContextForActor as p, parseOAuthTokenResponse as r, resolvePluginCommandEnv as s, createPluginCatalogRuntime as t, getOAuthProviderErrorAttributes as u, CredentialUnavailableError as v, parseInlinePluginManifest as y };
@@ -1,6 +1,6 @@
1
- import { i as trace, n as postinstall, o as getSandboxResources, t as dependencies } from "./install-DbD7C5td.js";
2
- import { Fi as create, Li as isStale, _s as sleep, zi as getSandboxProvider } from "./projection-CWXDE0f6.js";
3
- import { $ as getStateAdapter } from "./db-DV2ZUb1Y.js";
1
+ import { i as trace, n as postinstall, o as getSandboxResources, t as dependencies } from "./install-lYZs8UCL.js";
2
+ import { Ji as isStale, Ki as create, Ms as sleep, Xi as getSandboxProvider } from "./projection-D47mlszd.js";
3
+ import { $ as getStateAdapter } from "./db-C21CyyTE.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";
@@ -1,13 +1,14 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, k as turnBehavior } from "./db-DV2ZUb1Y.js";
3
- import { A as parseEventMessages, B as renderEventBatchInputs, D as getEventBatchDelayMs, F as EVENT_WAIT_MS, R as eventBatchMessageMeta, V as timerWatchCredentialSubject, j as resolveMailboxTurnWork, k as listActiveMailboxTurns, s as eventReviewItemInputs, t as getConversationStoppedAtMs } from "./session-stop-BQxgHR4X.js";
4
- import { a as EVENT_SYSTEM_ACTOR } from "./prompt-P3eRqO8C.js";
5
- import { f as credentialContextForActor } from "./registry-1pzXmplY.js";
6
- import { A as getAgentInvocationResultMessageId, C as ownAgentInvocation, D as getAgentInvocationIdForMessage, E as getAgentInvocationIdForEvents, F as getTurnReplyKey, M as getAgentReplyMessageId, O as getAgentInvocationIdForResult, R as buildDeterministicTurnId, S as listChildMessages, b as hasAgentInvocationReply, j as getAgentInvocationTurnId, y as childMessageSenderMetadata } from "./turn-user-message-DNC0eRZ7.js";
7
- import { _ as getConversationWorkState, r as appendAndEnqueueInboundMessage } from "./store-Dz3YZ7gQ.js";
8
- import { $t as readChildConversationSender, Gt as listAgentInvocationsForConversation, Jt as markAgentInvocationParentMailboxAppended, Lt as listUnreportedSiblingAgents, Qt as getChildAgentInputSender, Rt as NON_TERMINAL_AGENT_INVOCATION_STATUSES, Ut as getLatestAgentInvocationForConversation, Wt as isTerminalAgentInvocation, Xt as sendsResultToParent, Yt as reportReplacedWithoutOpenWork, Zt as childAgentInput, an as readParentMessage, cn as endActiveAgentInvocations, dn as resolveAgentInvocationId, en as routeChildInput, in as parentMessageText, ln as endAgentInvocationsOfStoppedWork, on as createAgentInvocationWorker, rn as logDroppedParentMessage, un as enqueueAgentInvocation, yn as createAgentInvocationFromLatest, zt as TERMINAL_AGENT_INVOCATION_STATUSES } from "./warmup-mTMIatCV.js";
9
- import { Z as renderUntrustedTag } from "./config-DUD-zMvp.js";
10
- import { C as AGENT_MESSAGE_EVENT_TYPE, E as agentInvocationResultEventType, S as AGENT_INVOCATION_EVENT_NAMESPACE, T as AGENT_REPLY_EVENT_TYPE } from "./web-message-id-CUaSiGme.js";
2
+ import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, k as turnBehavior } from "./db-C21CyyTE.js";
3
+ import { A as parseEventMessages, B as renderEventBatchInputs, D as getEventBatchDelayMs, F as EVENT_WAIT_MS, R as eventBatchMessageMeta, V as timerWatchCredentialSubject, j as resolveMailboxTurnWork, k as listActiveMailboxTurns, s as eventReviewItemInputs, t as getConversationStoppedAtMs } from "./session-stop-D3S7mSkX.js";
4
+ import { a as EVENT_SYSTEM_ACTOR } from "./prompt-DuWH_YIb.js";
5
+ import { p as credentialContextForActor } from "./registry-yht0oxq6.js";
6
+ import { A as getAgentInvocationResultMessageId, C as ownAgentInvocation, D as getAgentInvocationIdForMessage, E as getAgentInvocationIdForEvents, F as getTurnReplyKey, M as getAgentReplyMessageId, O as getAgentInvocationIdForResult, R as buildDeterministicTurnId, S as listChildMessages, b as hasAgentInvocationReply, j as getAgentInvocationTurnId, y as childMessageSenderMetadata } from "./turn-user-message-Dfbr3Ud9.js";
7
+ import { _ as getConversationWorkState, r as appendAndEnqueueInboundMessage } from "./store-BZJdHYR7.js";
8
+ import { $t as readChildConversationSender, Gt as listAgentInvocationsForConversation, Jt as markAgentInvocationParentMailboxAppended, Lt as listUnreportedSiblingAgents, Qt as getChildAgentInputSender, Rt as NON_TERMINAL_AGENT_INVOCATION_STATUSES, Ut as getLatestAgentInvocationForConversation, Wt as isTerminalAgentInvocation, Xt as sendsResultToParent, Yt as reportReplacedWithoutOpenWork, Zt as childAgentInput, an as readParentMessage, cn as endActiveAgentInvocations, dn as resolveAgentInvocationId, en as routeChildInput, in as parentMessageText, ln as endAgentInvocationsOfStoppedWork, on as createAgentInvocationWorker, rn as logDroppedParentMessage, un as enqueueAgentInvocation, yn as createAgentInvocationFromLatest, zt as TERMINAL_AGENT_INVOCATION_STATUSES } from "./warmup-C0IblNtf.js";
9
+ import { Z as renderUntrustedTag } from "./config-DY5c1E0l.js";
10
+ import { C as AGENT_MESSAGE_EVENT_TYPE, E as agentInvocationResultEventType, S as AGENT_INVOCATION_EVENT_NAMESPACE, T as AGENT_REPLY_EVENT_TYPE } from "./web-message-id-BT8Mg8LL.js";
11
+ import pLimit from "p-limit";
11
12
  import { actorSchema } from "@sentry/junior-plugin-api";
12
13
  // src/chat/agent-invocations/result.ts
13
14
  var result_exports = /* @__PURE__ */ __exportAll({
@@ -500,7 +501,8 @@ async function withAgentInvocationResultActors(work) {
500
501
  if (work.kind !== "mailbox") return work;
501
502
  const conversationId = work.batch[0]?.message.conversationId;
502
503
  const [latest, stoppedAtMs] = conversationId ? await Promise.all([getLatestAgentInvocationForConversation(conversationId), getConversationStoppedAtMs(conversationId)]) : [void 0, void 0];
503
- const kept = (await Promise.all(work.batch.map(async (entry) => {
504
+ const limit = pLimit(8);
505
+ const kept = (await Promise.all(work.batch.map((entry) => limit(async () => {
504
506
  const parentMessage = readParentMessage(entry.message);
505
507
  if (parentMessage) {
506
508
  if (await routeChildInput(entry.message, latest, stoppedAtMs) === "dropped") {
@@ -538,7 +540,7 @@ async function withAgentInvocationResultActors(work) {
538
540
  ...entry,
539
541
  actor
540
542
  };
541
- }))).filter((entry) => entry !== void 0);
543
+ })))).filter((entry) => entry !== void 0);
542
544
  return kept.length > 0 ? {
543
545
  kind: "mailbox",
544
546
  batch: kept
@@ -1,13 +1,13 @@
1
1
  import { q as messageCardText } from "./conversation--f85g4zL.js";
2
- import { a as buildDeliveredTurnStatePatch, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-C4QuZlM8.js";
3
- import { A as normalizeConversationText, H as authorizationId, O as latestConversationMessageSeq, P as upsertConversationMessage, a as loadProjection, b as persistConversationMessages, cn as getAssistantReplyText, d as recordAuthorizationCompleted, et as saveTurnCheckpoint, j as recordDeliveredAssistantMessage, k as markConversationMessage, t as commitAcceptedReply, v as hydrateConversationMessages, vn as persistWithRetry } from "./projection-CWXDE0f6.js";
4
- import { S as setTags, T as withLogContext, p as logException } from "./logging-oYpJYr-S.js";
5
- import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-frzlUvFD.js";
6
- import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, s as persistThreadStateById } from "./turn-session-routing-BXaubz2w.js";
7
- import { _ as ConversationTurnLifecycleService, g as startActiveTurn, h as markTurnFailed } from "./turn-user-message-DNC0eRZ7.js";
8
- import { N as finalizeFailedTurnReplyWithEvent } from "./agent-runner-BaLjEjPR.js";
9
- import { f as credentialContextForActor } from "./registry-1pzXmplY.js";
10
- import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore } from "./db-DV2ZUb1Y.js";
2
+ import { a as buildDeliveredTurnStatePatch, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-DxMQGGd_.js";
3
+ import { A as normalizeConversationText, H as authorizationId, O as latestConversationMessageSeq, P as upsertConversationMessage, a as loadProjection, b as persistConversationMessages, cn as getAssistantReplyText, d as recordAuthorizationCompleted, et as saveTurnCheckpoint, j as recordDeliveredAssistantMessage, k as markConversationMessage, t as commitAcceptedReply, v as hydrateConversationMessages, vn as persistWithRetry } from "./projection-D47mlszd.js";
4
+ import { S as setTags, T as withLogContext, p as logException } from "./logging-DjW7LjgJ.js";
5
+ import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-C6Bujc6h.js";
6
+ import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, s as persistThreadStateById } from "./turn-session-routing-CmQY0T60.js";
7
+ import { _ as ConversationTurnLifecycleService, g as startActiveTurn, h as markTurnFailed } from "./turn-user-message-Dfbr3Ud9.js";
8
+ import { L as finalizeFailedTurnReplyWithEvent } from "./agent-runner-DxivxUYd.js";
9
+ import { p as credentialContextForActor } from "./registry-yht0oxq6.js";
10
+ import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore } from "./db-C21CyyTE.js";
11
11
  import { randomUUID } from "node:crypto";
12
12
  import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
13
13
  // src/chat/local/runner.ts
@@ -1,4 +1,4 @@
1
- import { la as sandboxEgressSignalsResponseSchema } from "./projection-CWXDE0f6.js";
1
+ import { ba as sandboxEgressSignalsResponseSchema } from "./projection-D47mlszd.js";
2
2
  // src/chat/local/sandbox-egress-signals.ts
3
3
  const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
4
4
  const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
@@ -798,6 +798,18 @@ const eventAutomationSummarySchema = automationSummaryBaseSchema.extend({
798
798
  ])
799
799
  }).strict();
800
800
  const automationSummarySchema = z.discriminatedUnion("kind", [scheduledAutomationSummarySchema, eventAutomationSummarySchema]);
801
+ /**
802
+ * Totals that read every run of an Automation. Only the Automation page
803
+ * shows them, so list rows leave them out.
804
+ */
805
+ const AUTOMATION_TOTAL_FIELDS = {
806
+ costUsd: true,
807
+ runs: true,
808
+ totalCostUsd: true,
809
+ totalRuns: true
810
+ };
811
+ /** One list row: a summary without the totals that read every run. */
812
+ const automationListItemSchema = z.discriminatedUnion("kind", [scheduledAutomationSummarySchema.omit(AUTOMATION_TOTAL_FIELDS), eventAutomationSummarySchema.omit(AUTOMATION_TOTAL_FIELDS)]);
801
813
  /** UTC day (`YYYY-MM-DD`) or hour (`YYYY-MM-DDTHH`) execution bucket key. */
802
814
  const automationMetricBucketSchema = z.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/);
803
815
  const automationListQuerySchema = z.object({
@@ -827,11 +839,18 @@ const automationListQuerySchema = z.object({
827
839
  destination: z.string().max(300).optional(),
828
840
  /** Only Automations that run this skill. */
829
841
  skill: automationSkillNameSchema.optional(),
842
+ /**
843
+ * `activity` lists the latest run or creation first, and pages with
844
+ * `cursor`. The other orders page with `page`.
845
+ */
830
846
  sort: z.enum([
831
847
  "newest",
832
848
  "oldest",
833
- "title"
849
+ "title",
850
+ "activity"
834
851
  ]).default("newest"),
852
+ /** `nextCursor` of the page before, with `sort=activity`. */
853
+ cursor: z.string().min(1).max(1e3).optional(),
835
854
  page: z.coerce.number().int().min(1).max(1e6).default(1),
836
855
  pageSize: z.coerce.number().int().min(1).max(100).default(25)
837
856
  }).strict();
@@ -840,7 +859,9 @@ const automationFilterOptionSchema = z.object({
840
859
  label: z.string()
841
860
  }).strict();
842
861
  const automationListSchema = z.object({
843
- automations: z.array(automationSummarySchema),
862
+ automations: z.array(automationListItemSchema),
863
+ /** Set when more rows follow `sort=activity`. Pass it as `cursor`. */
864
+ nextCursor: z.string().min(1).optional(),
844
865
  total: z.number().int().nonnegative(),
845
866
  page: z.number().int().positive(),
846
867
  pageSize: z.number().int().positive(),
@@ -853,6 +874,16 @@ const automationListSchema = z.object({
853
874
  creators: z.array(automationFilterOptionSchema),
854
875
  destinations: z.array(automationFilterOptionSchema)
855
876
  }).strict();
877
+ /**
878
+ * One `sort=activity` page. A page after the first omits the total, counts,
879
+ * and filter options, because the first page already has them.
880
+ */
881
+ const automationListPageSchema = automationListSchema.partial({
882
+ total: true,
883
+ counts: true,
884
+ creators: true,
885
+ destinations: true
886
+ });
856
887
  const automationParamsSchema = z.object({ id: z.string().min(1) }).strict();
857
888
  const automationExecutionStatusSchema = z.enum([
858
889
  "blocked",
@@ -895,7 +926,6 @@ const automationExecutionListSchema = z.object({
895
926
  executionHours: z.array(automationExecutionStatusDaySchema).optional(),
896
927
  executionSixHours: z.array(automationExecutionStatusDaySchema).optional(),
897
928
  executions: z.array(automationExecutionSchema),
898
- automation: automationSummarySchema,
899
929
  truncated: z.boolean()
900
930
  }).strict();
901
931
  const automationRunSchema = automationExecutionSchema.extend({
@@ -1113,4 +1143,4 @@ function isWithinNotificationSchedule(schedule, timezone, nowMs) {
1113
1143
  if (minutes < end) return schedule.days.includes((weekday + 6) % 7);
1114
1144
  return false;
1115
1145
  }
1116
- export { automationTitleSchema as A, toolScheduleIntentSchema as B, automationVersionListSchema as C, scheduledAutomationSummarySchema as D, eventAutomationSummarySchema as E, scheduledAutomationSchema as F, isValidTimeZone as G, getFirstRunAtMs as H, scheduledRunSchema as I, automationTaskDescription as J, automationSkillNameSchema as K, ScheduleIntentError as L, eventAutomationSchema as M, eventAutomationTriggerSchema as N, automationContextToolSchema as O, SCHEDULED_AUTOMATION_SYSTEM_ACTOR as P, compileScheduleIntent as R, automationVersionActivateSchema as S, automationVersionSchema as T, getNextRunAtMs as U, weekdaySchema as V, getZonedDateTimeParts as W, automationTaskText as X, automationTaskSchema as Y, automationRunWindowsSchema as _, automationEditSchema as a, automationSummarySchema as b, automationExecutionSchema as c, automationLifecycleSchema as d, automationListQuerySchema as f, automationRunSchema as g, automationRunListSchema as h, automationEditErrorSchema as i, taskOutcomeInputSchema as j, automationInstructionToolSchema as k, automationExecutionStatusDaySchema as l, automationParamsSchema as m, isWithinNotificationSchedule as n, automationEventCatalogSchema as o, automationListSchema as p, automationTaskColumns as q, notificationScheduleSchema as r, automationExecutionListSchema as s, DEFAULT_NOTIFICATION_SCHEDULE as t, automationExecutionStatusSchema as u, automationScheduleIntentSchema as v, automationVersionParamsSchema as w, automationUpdateSchema as x, automationSchedulePreviewSchema as y, scheduleIntentFromTool as z };
1146
+ export { automationContextToolSchema as A, compileScheduleIntent as B, automationUpdateSchema as C, automationVersionSchema as D, automationVersionParamsSchema as E, eventAutomationTriggerSchema as F, getNextRunAtMs as G, toolScheduleIntentSchema as H, SCHEDULED_AUTOMATION_SYSTEM_ACTOR as I, automationSkillNameSchema as J, getZonedDateTimeParts as K, scheduledAutomationSchema as L, automationTitleSchema as M, taskOutcomeInputSchema as N, eventAutomationSummarySchema as O, eventAutomationSchema as P, automationTaskText as Q, scheduledRunSchema as R, automationSummarySchema as S, automationVersionListSchema as T, weekdaySchema as U, scheduleIntentFromTool as V, getFirstRunAtMs as W, automationTaskDescription as X, automationTaskColumns as Y, automationTaskSchema as Z, automationRunListSchema as _, automationEditSchema as a, automationScheduleIntentSchema as b, automationExecutionSchema as c, automationLifecycleSchema as d, automationListItemSchema as f, automationParamsSchema as g, automationListSchema as h, automationEditErrorSchema as i, automationInstructionToolSchema as j, scheduledAutomationSummarySchema as k, automationExecutionStatusDaySchema as l, automationListQuerySchema as m, isWithinNotificationSchedule as n, automationEventCatalogSchema as o, automationListPageSchema as p, isValidTimeZone as q, notificationScheduleSchema as r, automationExecutionListSchema as s, DEFAULT_NOTIFICATION_SCHEDULE as t, automationExecutionStatusSchema as u, automationRunSchema as v, automationVersionActivateSchema as w, automationSchedulePreviewSchema as x, automationRunWindowsSchema as y, ScheduleIntentError as z };