@sentry/junior 0.139.0 → 0.140.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 (65) hide show
  1. package/dist/{agent-hooks-MJXMD7JP.js → agent-hooks-BFTDRFUO.js} +10 -10
  2. package/dist/api/schema/task.d.ts +4 -0
  3. package/dist/api/schema.js +1 -1
  4. package/dist/api.js +19 -19
  5. package/dist/app.js +116 -35
  6. package/dist/{catalog-runtime-GCCFYPIK.js → catalog-runtime-RK664S5T.js} +5 -5
  7. package/dist/chat/scheduled-tasks/telemetry.d.ts +7 -0
  8. package/dist/chat/scheduled-tasks/tool-support.d.ts +10 -2
  9. package/dist/chat/scheduled-tasks/tools/create.d.ts +4 -2
  10. package/dist/chat/scheduled-tasks/tools/delete.d.ts +4 -2
  11. package/dist/chat/scheduled-tasks/tools/list.d.ts +4 -2
  12. package/dist/chat/scheduled-tasks/tools/run-now.d.ts +4 -2
  13. package/dist/chat/scheduled-tasks/tools/update.d.ts +4 -2
  14. package/dist/chat/scheduled-tasks/types.d.ts +1 -1
  15. package/dist/chat/slack/dashboard-link.d.ts +2 -0
  16. package/dist/chat/state/turn-session-keys.d.ts +2 -2
  17. package/dist/chat/state/turn-session.d.ts +15 -9
  18. package/dist/{chunk-GI52BW74.js → chunk-3B7O3GNU.js} +3 -3
  19. package/dist/{chunk-ZQCGQMF2.js → chunk-3CUBAGA3.js} +7 -7
  20. package/dist/{chunk-IIESAYDL.js → chunk-4PIT6O7A.js} +17 -8
  21. package/dist/{chunk-UDBUS533.js → chunk-557HLSNH.js} +1 -1
  22. package/dist/{chunk-U27DSXKB.js → chunk-5KAZMR5U.js} +6 -6
  23. package/dist/{chunk-AEQISMMU.js → chunk-5YAWB2AX.js} +5 -5
  24. package/dist/{chunk-5GSZWRE2.js → chunk-A6BI25J3.js} +8 -8
  25. package/dist/{chunk-MQ5RYATN.js → chunk-AA2EPMUF.js} +4 -4
  26. package/dist/{chunk-PJW6U46K.js → chunk-BMFRFSTM.js} +60 -68
  27. package/dist/{chunk-U7CMWQ7Z.js → chunk-CPPTBHQN.js} +1 -1
  28. package/dist/{chunk-GWQSZT4C.js → chunk-D3X2PI3D.js} +2 -2
  29. package/dist/{chunk-WZH4JV7R.js → chunk-DMDOKRPC.js} +5 -5
  30. package/dist/{chunk-6SU2DT27.js → chunk-HEFBGCCU.js} +2 -2
  31. package/dist/{chunk-CXH25EL4.js → chunk-I3OZR3HG.js} +1 -1
  32. package/dist/{chunk-MXTVUV3I.js → chunk-J5H65GY2.js} +1 -1
  33. package/dist/{chunk-ZYQSPQYR.js → chunk-MYVCHWDG.js} +31 -18
  34. package/dist/{chunk-6OHTDR4F.js → chunk-N2I7W2VS.js} +1 -1
  35. package/dist/{chunk-2ECYPYKP.js → chunk-NPL66ZWL.js} +1 -1
  36. package/dist/{chunk-G52UXKGO.js → chunk-OGNL2QY7.js} +4 -4
  37. package/dist/{chunk-75I3UBIL.js → chunk-S3FAOKQU.js} +2 -2
  38. package/dist/{chunk-3T2JAGRH.js → chunk-TGIKZJ3Y.js} +2 -2
  39. package/dist/{chunk-J3S57AXY.js → chunk-TKTZ4L4Z.js} +1 -1
  40. package/dist/{chunk-YGZ2OLXL.js → chunk-UXMRN2ZX.js} +1 -1
  41. package/dist/{chunk-WQRX57EA.js → chunk-VRDHAITB.js} +3 -3
  42. package/dist/{chunk-QTBKPZDA.js → chunk-WSWM6A3R.js} +3 -3
  43. package/dist/{chunk-MXVD2BDS.js → chunk-WTGLUX4K.js} +1 -1
  44. package/dist/{chunk-4V4QIYJH.js → chunk-XROWZSOY.js} +1 -1
  45. package/dist/{chunk-DW4PMHNW.js → chunk-XX2QNQN4.js} +147 -86
  46. package/dist/{chunk-C2N6MNO4.js → chunk-YB363QGA.js} +1 -1
  47. package/dist/{chunk-YCTDA7BD.js → chunk-YWM6MJT4.js} +1 -1
  48. package/dist/{chunk-J6EJQCHY.js → chunk-Z2A7BDHT.js} +15 -15
  49. package/dist/cli/chat.js +30 -30
  50. package/dist/cli/check.js +6 -6
  51. package/dist/cli/plugins.js +13 -13
  52. package/dist/cli/snapshot-create.js +9 -9
  53. package/dist/cli/upgrade.js +7 -7
  54. package/dist/{db-UXPPGHDF.js → db-QOGYDDQM.js} +7 -7
  55. package/dist/instrumentation.js +4 -4
  56. package/dist/nitro.js +2 -2
  57. package/dist/{oauth-callback-server-4ZYMD5UA.js → oauth-callback-server-CT4RMGCP.js} +21 -21
  58. package/dist/{runner-MZSEONRZ.js → runner-PHMLHNLX.js} +13 -13
  59. package/dist/{skills-IMVPXSQ7.js → skills-AYRM4QGF.js} +6 -6
  60. package/dist/{spawn-S5LSVOCE.js → spawn-OGRQFUNK.js} +17 -17
  61. package/dist/{validation-ZKCY2BVR.js → validation-M5JNGRGL.js} +6 -6
  62. package/dist/version.js +1 -1
  63. package/dist/{work-GG3XDYRX.js → work-LZWE6HK4.js} +16 -16
  64. package/dist/{worker-23AUELCJ.js → worker-KOGPXFYK.js} +10 -10
  65. package/package.json +4 -4
@@ -21,20 +21,20 @@ import {
21
21
  instructionProvenanceFor,
22
22
  sanitizePostgresJson,
23
23
  withConversationEventLock
24
- } from "./chunk-QTBKPZDA.js";
24
+ } from "./chunk-WSWM6A3R.js";
25
25
  import {
26
26
  SANDBOX_WORKSPACE_ROOT,
27
27
  sleep
28
28
  } from "./chunk-EM225ITJ.js";
29
29
  import {
30
30
  getStateAdapter
31
- } from "./chunk-MXTVUV3I.js";
31
+ } from "./chunk-J5H65GY2.js";
32
32
  import {
33
33
  botConfig,
34
34
  escapeXml,
35
35
  resolveGatewayModel,
36
36
  unwrapCurrentInstruction
37
- } from "./chunk-75I3UBIL.js";
37
+ } from "./chunk-S3FAOKQU.js";
38
38
  import {
39
39
  toStoredSlackActor
40
40
  } from "./chunk-HZF5P5UN.js";
@@ -49,7 +49,7 @@ import {
49
49
  setSpanAttributes,
50
50
  toOptionalNumber,
51
51
  toOptionalString
52
- } from "./chunk-2ECYPYKP.js";
52
+ } from "./chunk-NPL66ZWL.js";
53
53
 
54
54
  // src/chat/turn-context-tag.ts
55
55
  var TURN_CONTEXT_TAG = "runtime-turn-context";
@@ -1402,7 +1402,6 @@ function getAssistantReplyText(message) {
1402
1402
  }
1403
1403
 
1404
1404
  // src/chat/state/turn-session.ts
1405
- import { THREAD_STATE_TTL_MS } from "chat";
1406
1405
  import {
1407
1406
  actorSchema
1408
1407
  } from "@sentry/junior-plugin-api";
@@ -1766,9 +1765,8 @@ function agentTurnSessionConversationIndexKey(conversationId) {
1766
1765
  }
1767
1766
 
1768
1767
  // src/chat/state/turn-session.ts
1769
- var AGENT_TURN_SESSION_INDEX_KEY = `${AGENT_TURN_SESSION_PREFIX}:index`;
1770
- var AGENT_TURN_SESSION_INDEX_MAX_LENGTH = 5e3;
1771
- var AGENT_TURN_SESSION_TTL_MS = THREAD_STATE_TTL_MS;
1768
+ var AGENT_TURN_SESSION_RESUME_TTL_MS = 24 * 60 * 60 * 1e3;
1769
+ var AGENT_TURN_SESSION_TERMINAL_TTL_MS = 60 * 60 * 1e3;
1772
1770
  function definedProps(values) {
1773
1771
  return Object.fromEntries(
1774
1772
  Object.entries(values).filter(([, value]) => value !== void 0)
@@ -1796,6 +1794,19 @@ var agentTurnResumeReasonSchema = z2.enum([
1796
1794
  var nonNegativeNumberSchema = z2.number().finite().nonnegative();
1797
1795
  var seqCursorSchema = z2.number().int().min(-1);
1798
1796
  var agentTurnSessionSummarySchema = z2.object({
1797
+ version: z2.number().int().nonnegative(),
1798
+ conversationId: z2.string().min(1),
1799
+ dispatchId: z2.string().min(1).optional(),
1800
+ dispatchOutcome: z2.enum(["blocked", "completed", "failed"]).optional(),
1801
+ resultMessageId: z2.string().min(1).optional(),
1802
+ resumeReason: agentTurnResumeReasonSchema.optional(),
1803
+ sessionId: z2.string().min(1),
1804
+ sliceId: z2.number().int().nonnegative(),
1805
+ state: agentTurnSessionStatusSchema,
1806
+ surface: agentTurnSurfaceSchema.optional(),
1807
+ updatedAtMs: nonNegativeNumberSchema
1808
+ }).strip();
1809
+ var storedAgentTurnSessionRecordSchema = z2.object({
1799
1810
  channelName: z2.string().min(1).optional(),
1800
1811
  version: z2.number().int().nonnegative(),
1801
1812
  conversationId: z2.string().min(1),
@@ -1816,9 +1827,7 @@ var agentTurnSessionSummarySchema = z2.object({
1816
1827
  state: agentTurnSessionStatusSchema,
1817
1828
  surface: agentTurnSurfaceSchema.optional(),
1818
1829
  traceId: z2.string().optional(),
1819
- updatedAtMs: nonNegativeNumberSchema
1820
- }).strip();
1821
- var storedAgentTurnSessionRecordSchema = agentTurnSessionSummarySchema.extend({
1830
+ updatedAtMs: nonNegativeNumberSchema,
1822
1831
  actors: z2.array(actorSchema).optional(),
1823
1832
  committedSeq: seqCursorSchema,
1824
1833
  historyVersion: z2.number().int().nonnegative().optional(),
@@ -1843,20 +1852,25 @@ function parseAgentTurnSessionRecord(value) {
1843
1852
  function parseAgentTurnSessionSummary(value) {
1844
1853
  return agentTurnSessionSummarySchema.parse(value);
1845
1854
  }
1855
+ function agentTurnSessionRecordTtlMs(state, ttlMs) {
1856
+ if (ttlMs !== void 0) {
1857
+ return Math.max(1, ttlMs);
1858
+ }
1859
+ return state === "running" || state === "awaiting_resume" ? AGENT_TURN_SESSION_RESUME_TTL_MS : AGENT_TURN_SESSION_TERMINAL_TTL_MS;
1860
+ }
1861
+ function agentTurnSessionIndexTtlMs(ttlMs) {
1862
+ return Math.max(1, ttlMs ?? AGENT_TURN_SESSION_RESUME_TTL_MS);
1863
+ }
1864
+ function projectAgentTurnSessionSummary(record) {
1865
+ return agentTurnSessionSummarySchema.parse(record);
1866
+ }
1846
1867
  async function appendAgentTurnSessionSummary(summary, ttlMs) {
1847
- const projectedSummary = agentTurnSessionSummarySchema.parse(summary);
1848
1868
  const stateAdapter = getStateAdapter();
1849
- await Promise.all([
1850
- stateAdapter.appendToList(AGENT_TURN_SESSION_INDEX_KEY, projectedSummary, {
1851
- maxLength: AGENT_TURN_SESSION_INDEX_MAX_LENGTH,
1852
- ttlMs
1853
- }),
1854
- stateAdapter.appendToList(
1855
- agentTurnSessionConversationIndexKey(projectedSummary.conversationId),
1856
- projectedSummary,
1857
- { ttlMs }
1858
- )
1859
- ]);
1869
+ await stateAdapter.appendToList(
1870
+ agentTurnSessionConversationIndexKey(summary.conversationId),
1871
+ agentTurnSessionSummarySchema.parse(summary),
1872
+ { ttlMs }
1873
+ );
1860
1874
  }
1861
1875
  async function recordConversationActivityMetadata(args) {
1862
1876
  const conversationStore = args.conversationStore ?? getConversationStore();
@@ -2067,16 +2081,10 @@ async function setStoredRecord(args) {
2067
2081
  storedRecord,
2068
2082
  args.ttlMs
2069
2083
  );
2070
- const {
2071
- actors: _actors,
2072
- committedSeq: _committedSeq,
2073
- historyVersion: _historyVersion,
2074
- errorMessage: _errorMessage,
2075
- turnStartSeq: _turnStartSeq,
2076
- runtimeContext: _runtimeContext,
2077
- ...summary
2078
- } = storedRecord;
2079
- await appendAgentTurnSessionSummary(summary, args.ttlMs);
2084
+ await appendAgentTurnSessionSummary(
2085
+ projectAgentTurnSessionSummary(storedRecord),
2086
+ agentTurnSessionIndexTtlMs(args.indexTtlMs)
2087
+ );
2080
2088
  return materializeAgentTurnSessionRecord(
2081
2089
  storedRecord,
2082
2090
  {
@@ -2097,7 +2105,7 @@ async function updateAgentTurnSessionState(args) {
2097
2105
  return await setStoredRecord({
2098
2106
  piMessages: args.existing.piMessages,
2099
2107
  piMessageProvenance: args.existing.piMessageProvenance,
2100
- ttlMs: AGENT_TURN_SESSION_TTL_MS,
2108
+ ttlMs: agentTurnSessionRecordTtlMs(args.state),
2101
2109
  ...definedProps({
2102
2110
  turnStartMessageIndex: args.existing.turnStartMessageIndex
2103
2111
  }),
@@ -2125,7 +2133,6 @@ async function updateAgentTurnSessionState(args) {
2125
2133
  resumeReason: args.existing.resumeReason,
2126
2134
  resultMessageId: args.existing.resultMessageId,
2127
2135
  resumedFromSliceId: args.existing.resumedFromSliceId,
2128
- runtimeContext: parsed.runtimeContext,
2129
2136
  surface: args.existing.surface,
2130
2137
  traceId: args.existing.traceId,
2131
2138
  turnStartSeq: parsed.turnStartSeq
@@ -2144,7 +2151,7 @@ async function upsertAgentTurnSessionRecord(args) {
2144
2151
  `Turn session ${args.sessionId} dispatchId cannot be changed`
2145
2152
  );
2146
2153
  }
2147
- const ttlMs = Math.max(1, args.ttlMs ?? AGENT_TURN_SESSION_TTL_MS);
2154
+ const ttlMs = agentTurnSessionRecordTtlMs(args.state, args.ttlMs);
2148
2155
  const instructionActor = args.actor;
2149
2156
  const commit = await commitMessages({
2150
2157
  conversationId: args.conversationId,
@@ -2174,6 +2181,9 @@ async function upsertAgentTurnSessionRecord(args) {
2174
2181
  piMessages: commit.messages,
2175
2182
  piMessageProvenance: commit.provenance,
2176
2183
  ttlMs,
2184
+ // Pass through only an explicit override so indexes stay on the resume window
2185
+ // by default even when the record takes a short terminal TTL.
2186
+ ...definedProps({ indexTtlMs: args.ttlMs }),
2177
2187
  turnStartMessageIndex,
2178
2188
  record: buildStoredRecord({
2179
2189
  conversationId: args.conversationId,
@@ -2202,7 +2212,7 @@ async function upsertAgentTurnSessionRecord(args) {
2202
2212
  resumeReason: args.resumeReason,
2203
2213
  resultMessageId: args.resultMessageId ?? existingRecord?.resultMessageId,
2204
2214
  resumedFromSliceId: args.resumedFromSliceId,
2205
- runtimeContext: retainedRuntimeContext,
2215
+ runtimeContext: args.state === "running" || args.state === "awaiting_resume" ? retainedRuntimeContext : void 0,
2206
2216
  startedAtMs: existingRecord?.startedAtMs,
2207
2217
  surface: args.surface ?? existingRecord?.surface,
2208
2218
  traceId: args.traceId ?? existingRecord?.traceId,
@@ -2227,29 +2237,20 @@ async function recordAgentTurnSessionSummary(args) {
2227
2237
  );
2228
2238
  }
2229
2239
  const nowMs = Date.now();
2230
- const ttlMs = Math.max(1, args.ttlMs ?? AGENT_TURN_SESSION_TTL_MS);
2240
+ const ttlMs = agentTurnSessionIndexTtlMs(args.ttlMs);
2231
2241
  const summary = {
2232
2242
  version: existing?.version ?? 0,
2233
2243
  conversationId: args.conversationId,
2234
2244
  sessionId: args.sessionId,
2235
2245
  sliceId: args.sliceId,
2236
- startedAtMs: existing?.startedAtMs ?? args.startedAtMs ?? nowMs,
2237
- lastProgressAtMs: args.lastProgressAtMs ?? nowMs,
2238
2246
  state: args.state,
2239
2247
  updatedAtMs: nowMs,
2240
- cumulativeDurationMs: args.cumulativeDurationMs ?? existing?.cumulativeDurationMs ?? 0,
2241
2248
  ...definedProps({
2242
- channelName: args.channelName ?? existing?.channelName,
2243
- cumulativeUsage: args.cumulativeUsage ?? existing?.cumulativeUsage,
2244
2249
  dispatchId: args.dispatchId ?? existingDispatchId,
2245
2250
  dispatchOutcome: args.dispatchOutcome ?? existingDispatchOutcome,
2246
- loadedSkillNames: args.loadedSkillNames ?? existing?.loadedSkillNames,
2247
- modelId: args.modelId ?? existing?.modelId,
2248
- reasoningLevel: args.reasoningLevel ?? existing?.reasoningLevel,
2249
2251
  resumeReason: args.resumeReason,
2250
2252
  resultMessageId: args.resultMessageId ?? existingResultMessageId,
2251
- surface: args.surface ?? existing?.surface,
2252
- traceId: args.traceId ?? existing?.traceId
2253
+ surface: args.surface ?? existing?.surface
2253
2254
  })
2254
2255
  };
2255
2256
  await recordConversationActivityMetadata({
@@ -2259,11 +2260,18 @@ async function recordAgentTurnSessionSummary(args) {
2259
2260
  destinationVisibility: args.destinationVisibility,
2260
2261
  nowMs,
2261
2262
  source: args.source,
2262
- summary
2263
+ summary: {
2264
+ ...summary,
2265
+ channelName: args.channelName ?? stored?.channelName,
2266
+ cumulativeDurationMs: args.cumulativeDurationMs ?? stored?.cumulativeDurationMs ?? 0,
2267
+ cumulativeUsage: args.cumulativeUsage ?? stored?.cumulativeUsage,
2268
+ startedAtMs: stored?.startedAtMs ?? args.startedAtMs ?? nowMs
2269
+ }
2263
2270
  });
2264
2271
  await appendAgentTurnSessionSummary(summary, ttlMs);
2265
2272
  }
2266
- async function readAgentTurnSessionSummariesFromIndex(key, stateAdapter) {
2273
+ async function readAgentTurnSessionSummariesFromIndex(key) {
2274
+ const stateAdapter = getStateAdapter();
2267
2275
  await stateAdapter.connect();
2268
2276
  const values = await stateAdapter.getList(key);
2269
2277
  const summaries = /* @__PURE__ */ new Map();
@@ -2271,11 +2279,7 @@ async function readAgentTurnSessionSummariesFromIndex(key, stateAdapter) {
2271
2279
  let summary;
2272
2280
  try {
2273
2281
  summary = parseAgentTurnSessionSummary(value);
2274
- } catch (error) {
2275
- logWarn("agent.turn.session_summary_parse.failed", {
2276
- "app.state.key": key,
2277
- "exception.message": error instanceof Error ? error.message : String(error)
2278
- });
2282
+ } catch {
2279
2283
  continue;
2280
2284
  }
2281
2285
  const summaryKey = `${summary.conversationId}:${summary.sessionId}`;
@@ -2288,20 +2292,8 @@ async function readAgentTurnSessionSummariesFromIndex(key, stateAdapter) {
2288
2292
  );
2289
2293
  }
2290
2294
  async function listAgentTurnSessionSummariesForConversation(conversationId) {
2291
- const stateAdapter = getStateAdapter();
2292
- const summaries = await listBoundedAgentTurnSessionSummariesForConversation(conversationId);
2293
- if (summaries.length > 0) {
2294
- return summaries;
2295
- }
2296
- return (await readAgentTurnSessionSummariesFromIndex(
2297
- AGENT_TURN_SESSION_INDEX_KEY,
2298
- stateAdapter
2299
- )).filter((summary) => summary.conversationId === conversationId);
2300
- }
2301
- async function listBoundedAgentTurnSessionSummariesForConversation(conversationId) {
2302
2295
  return readAgentTurnSessionSummariesFromIndex(
2303
- agentTurnSessionConversationIndexKey(conversationId),
2304
- getStateAdapter()
2296
+ agentTurnSessionConversationIndexKey(conversationId)
2305
2297
  );
2306
2298
  }
2307
2299
  async function abandonAgentTurnSessionRecord(args) {
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@sentry/junior",
4
- version: "0.139.0",
4
+ version: "0.140.0",
5
5
  private: false,
6
6
  publishConfig: {
7
7
  access: "public"
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-6OHTDR4F.js";
3
+ } from "./chunk-N2I7W2VS.js";
4
4
  import {
5
5
  logWarn
6
- } from "./chunk-2ECYPYKP.js";
6
+ } from "./chunk-NPL66ZWL.js";
7
7
  import {
8
8
  skillRoots
9
9
  } from "./chunk-H4HBKISO.js";
@@ -4,24 +4,24 @@ import {
4
4
  import {
5
5
  formatProviderLabel,
6
6
  startOAuthFlow
7
- } from "./chunk-U27DSXKB.js";
7
+ } from "./chunk-5KAZMR5U.js";
8
8
  import {
9
9
  abandonReplacedPendingAuth,
10
10
  canReusePendingAuthLink,
11
11
  recordAuthorizationRequested
12
- } from "./chunk-PJW6U46K.js";
12
+ } from "./chunk-BMFRFSTM.js";
13
13
  import {
14
14
  parseSandboxEgressAuthRequiredSignal
15
15
  } from "./chunk-HUO3UTAQ.js";
16
16
  import {
17
17
  AGENT_INVOCATION_MAILBOX_STATUSES
18
- } from "./chunk-UDBUS533.js";
18
+ } from "./chunk-557HLSNH.js";
19
19
  import {
20
20
  TURN_REASONING_LEVELS
21
- } from "./chunk-75I3UBIL.js";
21
+ } from "./chunk-S3FAOKQU.js";
22
22
  import {
23
23
  pluginCatalogRuntime
24
- } from "./chunk-6OHTDR4F.js";
24
+ } from "./chunk-N2I7W2VS.js";
25
25
  import {
26
26
  credentialContextSchema
27
27
  } from "./chunk-RUIXF3YQ.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-EM225ITJ.js";
4
4
  import {
5
5
  getSlackBotToken
6
- } from "./chunk-75I3UBIL.js";
6
+ } from "./chunk-S3FAOKQU.js";
7
7
  import {
8
8
  parseSlackChannelReferenceId
9
9
  } from "./chunk-F3B2YJ76.js";
@@ -12,7 +12,7 @@ import {
12
12
  setSpanAttributes,
13
13
  setSpanStatus,
14
14
  withSpan
15
- } from "./chunk-2ECYPYKP.js";
15
+ } from "./chunk-NPL66ZWL.js";
16
16
 
17
17
  // src/chat/slack/client.ts
18
18
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
@@ -5,7 +5,7 @@ import {
5
5
  logInfo,
6
6
  logWarn,
7
7
  setSpanAttributes
8
- } from "./chunk-2ECYPYKP.js";
8
+ } from "./chunk-NPL66ZWL.js";
9
9
  import {
10
10
  discoverInstalledPluginPackageContent,
11
11
  normalizePluginPackageNames
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-75I3UBIL.js";
3
+ } from "./chunk-S3FAOKQU.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -7,7 +7,7 @@ import {
7
7
  PluginCredentialFailureError,
8
8
  agentNameSchema,
9
9
  createPluginAuthOrchestration
10
- } from "./chunk-WZH4JV7R.js";
10
+ } from "./chunk-DMDOKRPC.js";
11
11
  import {
12
12
  authorizationId
13
13
  } from "./chunk-DIB4GX3G.js";
@@ -28,7 +28,7 @@ import {
28
28
  patchMcpAuthSession,
29
29
  selectPluginGrant,
30
30
  toMcpProviderError
31
- } from "./chunk-ZQCGQMF2.js";
31
+ } from "./chunk-3CUBAGA3.js";
32
32
  import {
33
33
  RetryableDeliveryError,
34
34
  actorFromRouting,
@@ -44,7 +44,7 @@ import {
44
44
  getSlackMessagePermalink,
45
45
  resolveBaseUrl,
46
46
  uploadFilesToConversation
47
- } from "./chunk-U27DSXKB.js";
47
+ } from "./chunk-5KAZMR5U.js";
48
48
  import {
49
49
  AGENTS_REMOVAL_NOTICE,
50
50
  AGENTS_REPLACEMENT_NOTICE,
@@ -111,7 +111,7 @@ import {
111
111
  trimTrailingAssistantMessages,
112
112
  truncateText,
113
113
  updateConversationStats
114
- } from "./chunk-PJW6U46K.js";
114
+ } from "./chunk-BMFRFSTM.js";
115
115
  import {
116
116
  JUNIOR_THREAD_STATE_TTL_MS
117
117
  } from "./chunk-3Y47VMHV.js";
@@ -143,7 +143,7 @@ import {
143
143
  runNonInteractiveCommand,
144
144
  throwSandboxOperationError,
145
145
  wrapSandboxSetupError
146
- } from "./chunk-G52UXKGO.js";
146
+ } from "./chunk-OGNL2QY7.js";
147
147
  import {
148
148
  SCHEDULED_TASK_SYSTEM_ACTOR,
149
149
  compactEventTask,
@@ -173,11 +173,12 @@ import {
173
173
  requireSupportedEventTaskTrigger,
174
174
  resolveLocalScheduleAtMs,
175
175
  saveEventTask,
176
+ scheduledTaskAttributes,
176
177
  writableEventTask
177
- } from "./chunk-DW4PMHNW.js";
178
+ } from "./chunk-XX2QNQN4.js";
178
179
  import {
179
180
  parseSlackThreadId
180
- } from "./chunk-MXVD2BDS.js";
181
+ } from "./chunk-WTGLUX4K.js";
181
182
  import {
182
183
  ToolInputError,
183
184
  addAgentTurnUsage,
@@ -188,13 +189,14 @@ import {
188
189
  } from "./chunk-UIE3R5XU.js";
189
190
  import {
190
191
  createPluginHookRunner,
192
+ getDashboardTaskLink,
191
193
  getPluginSystemPromptContributions,
192
194
  getPluginTools,
193
195
  getPluginUserPromptContributions,
194
196
  getSlackToolContext,
195
197
  readActorIdentity,
196
198
  resolveChannelCapabilities
197
- } from "./chunk-IIESAYDL.js";
199
+ } from "./chunk-4PIT6O7A.js";
198
200
  import {
199
201
  SlackActionError,
200
202
  downloadPrivateSlackFile,
@@ -203,7 +205,7 @@ import {
203
205
  isConversationScopedChannel,
204
206
  normalizeSlackConversationId,
205
207
  withSlackRetries
206
- } from "./chunk-6SU2DT27.js";
208
+ } from "./chunk-HEFBGCCU.js";
207
209
  import {
208
210
  KNOWN_CONVERSATION_EVENT_TYPES,
209
211
  contextProvenance,
@@ -214,7 +216,7 @@ import {
214
216
  instructionActors,
215
217
  instructionProvenanceFor,
216
218
  sameActorIdentity
217
- } from "./chunk-QTBKPZDA.js";
219
+ } from "./chunk-WSWM6A3R.js";
218
220
  import {
219
221
  SANDBOX_DATA_ROOT,
220
222
  SANDBOX_SKILLS_ROOT,
@@ -226,7 +228,7 @@ import {
226
228
  } from "./chunk-EM225ITJ.js";
227
229
  import {
228
230
  getStateAdapter
229
- } from "./chunk-MXTVUV3I.js";
231
+ } from "./chunk-J5H65GY2.js";
230
232
  import {
231
233
  ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX,
232
234
  COMPACTION_SUMMARY_PREFIX,
@@ -260,7 +262,7 @@ import {
260
262
  resolveGatewayCredential,
261
263
  resolveGatewayModel,
262
264
  unwrapCurrentInstruction
263
- } from "./chunk-75I3UBIL.js";
265
+ } from "./chunk-S3FAOKQU.js";
264
266
  import {
265
267
  canExposeConversationPayload,
266
268
  resolveConversationPrivacy,
@@ -270,16 +272,16 @@ import {
270
272
  toGenAiMessagesTraceAttributes,
271
273
  toGenAiPayloadMetadata,
272
274
  toGenAiPayloadTraceAttributes
273
- } from "./chunk-YGZ2OLXL.js";
275
+ } from "./chunk-UXMRN2ZX.js";
274
276
  import {
275
277
  discoverSkills,
276
278
  findSkillByName,
277
279
  loadSkillsByName,
278
280
  parseSkillInvocation
279
- } from "./chunk-GWQSZT4C.js";
281
+ } from "./chunk-D3X2PI3D.js";
280
282
  import {
281
283
  pluginCatalogRuntime
282
- } from "./chunk-6OHTDR4F.js";
284
+ } from "./chunk-N2I7W2VS.js";
283
285
  import {
284
286
  CredentialUnavailableError,
285
287
  OAuthProviderError,
@@ -287,7 +289,7 @@ import {
287
289
  getOAuthProviderErrorAttributes,
288
290
  resolveAuthTokenPlaceholder,
289
291
  resolvePluginCommandEnv
290
- } from "./chunk-CXH25EL4.js";
292
+ } from "./chunk-I3OZR3HG.js";
291
293
  import {
292
294
  credentialUserSubjectId
293
295
  } from "./chunk-RUIXF3YQ.js";
@@ -316,7 +318,7 @@ import {
316
318
  summarizeMessageText,
317
319
  withLogContext,
318
320
  withSpan
319
- } from "./chunk-2ECYPYKP.js";
321
+ } from "./chunk-NPL66ZWL.js";
320
322
  import {
321
323
  startInactiveSpan,
322
324
  withActiveSpan
@@ -8918,7 +8920,7 @@ var MAX_LISTED_TASKS = 50;
8918
8920
  var DEFAULT_SCHEDULE_TIMEZONE = "America/Los_Angeles";
8919
8921
  var compactTaskResultSchema = z28.object({
8920
8922
  id: z28.string(),
8921
- status: z28.enum(["active", "blocked", "deleted"]),
8923
+ status: z28.enum(["active", "blocked", "completed", "deleted"]),
8922
8924
  task: z28.string(),
8923
8925
  schedule: z28.string(),
8924
8926
  timezone: z28.string(),
@@ -8929,6 +8931,7 @@ var compactTaskResultSchema = z28.object({
8929
8931
  visibility: z28.enum(["private", "public"])
8930
8932
  }).strict(),
8931
8933
  credential_mode: z28.enum(["system", "creator"]),
8934
+ dashboard_url: z28.string().url().nullable(),
8932
8935
  last_run_at: z28.string().nullable(),
8933
8936
  run_now_at: z28.string().nullable()
8934
8937
  }).strict();
@@ -9041,6 +9044,7 @@ function compactTask(task) {
9041
9044
  next_run_at: task.nextRunAtMs ? new Date(task.nextRunAtMs).toISOString() : null,
9042
9045
  conversation_access: task.conversationAccess,
9043
9046
  credential_mode: task.credentialMode,
9047
+ dashboard_url: getDashboardTaskLink(task.id) ?? null,
9044
9048
  last_run_at: task.lastRunAtMs ? new Date(task.lastRunAtMs).toISOString() : null,
9045
9049
  run_now_at: task.runNowAtMs ? new Date(task.runNowAtMs).toISOString() : null
9046
9050
  });
@@ -9182,6 +9186,10 @@ function createSlackScheduleCreateTaskTool(context) {
9182
9186
  if (!sameDestination(committed, destination) || committed.createdBy.slackUserId !== actor.slackUserId) {
9183
9187
  throwToolInputError("Scheduled task operation identity is invalid.");
9184
9188
  }
9189
+ logInfo(
9190
+ "scheduled_task.create.completed",
9191
+ scheduledTaskAttributes(committed)
9192
+ );
9185
9193
  return scheduleTaskToolResult(
9186
9194
  "slackScheduleCreateTask",
9187
9195
  compactTask(committed)
@@ -9331,6 +9339,11 @@ function createSlackScheduleUpdateTaskTool(context) {
9331
9339
  context,
9332
9340
  taskId: input.task_id
9333
9341
  });
9342
+ if (lookup.status === "completed") {
9343
+ throwToolInputError(
9344
+ "Completed scheduled tasks cannot be updated. Create a new task instead."
9345
+ );
9346
+ }
9334
9347
  const actor = requireActor(context, lookup.destination);
9335
9348
  const isCreator = actor.slackUserId === lookup.createdBy.slackUserId;
9336
9349
  if (input.credential_mode === "creator" && !isCreator) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-CXH25EL4.js";
3
+ } from "./chunk-I3OZR3HG.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-6GWA276C.js";
10
10
  import {
11
11
  getDeploymentTelemetryAttributes
12
- } from "./chunk-C2N6MNO4.js";
12
+ } from "./chunk-YB363QGA.js";
13
13
 
14
14
  // src/chat/logging.ts
15
15
  import path from "path";
@@ -4,18 +4,18 @@ import {
4
4
  } from "./chunk-EM225ITJ.js";
5
5
  import {
6
6
  getStateAdapter
7
- } from "./chunk-MXTVUV3I.js";
7
+ } from "./chunk-J5H65GY2.js";
8
8
  import {
9
9
  toOptionalTrimmed
10
- } from "./chunk-75I3UBIL.js";
10
+ } from "./chunk-S3FAOKQU.js";
11
11
  import {
12
12
  pluginCatalogRuntime
13
- } from "./chunk-6OHTDR4F.js";
13
+ } from "./chunk-N2I7W2VS.js";
14
14
  import {
15
15
  setSpanAttributes,
16
16
  setSpanStatus,
17
17
  withSpan
18
- } from "./chunk-2ECYPYKP.js";
18
+ } from "./chunk-NPL66ZWL.js";
19
19
 
20
20
  // src/chat/sandbox/resources.ts
21
21
  var configuredResources;
@@ -3,7 +3,7 @@ import {
3
3
  toCanonicalInputMessage,
4
4
  toCanonicalOutputMessage,
5
5
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-YGZ2OLXL.js";
6
+ } from "./chunk-UXMRN2ZX.js";
7
7
  import {
8
8
  extractGenAiUsageAttributes,
9
9
  logException,
@@ -11,7 +11,7 @@ import {
11
11
  normalizeGenAiFinishReason,
12
12
  serializeGenAiAttribute,
13
13
  withSpan
14
- } from "./chunk-2ECYPYKP.js";
14
+ } from "./chunk-NPL66ZWL.js";
15
15
 
16
16
  // src/chat/services/provider-error.ts
17
17
  var ProviderError = class extends Error {
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-UTL3MHPC.js";
4
4
  import {
5
5
  parseSlackThreadId
6
- } from "./chunk-MXVD2BDS.js";
6
+ } from "./chunk-WTGLUX4K.js";
7
7
  import {
8
8
  normalizeSlackConversationId
9
- } from "./chunk-6SU2DT27.js";
9
+ } from "./chunk-HEFBGCCU.js";
10
10
 
11
11
  // src/handlers/health.ts
12
12
  function readHealthReport() {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-6OHTDR4F.js";
3
+ } from "./chunk-N2I7W2VS.js";
4
4
 
5
5
  // src/chat/plugins/validation.ts
6
6
  import { isDeepStrictEqual } from "util";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logWarn
3
- } from "./chunk-2ECYPYKP.js";
3
+ } from "./chunk-NPL66ZWL.js";
4
4
 
5
5
  // src/chat/conversation-privacy.ts
6
6
  import { AsyncLocalStorage } from "async_hooks";
@@ -18,20 +18,20 @@ import {
18
18
  releaseConversationWork,
19
19
  requestConversationContinuation,
20
20
  startConversationWork
21
- } from "./chunk-MQ5RYATN.js";
21
+ } from "./chunk-AA2EPMUF.js";
22
22
  import {
23
23
  ConversationQueueMessageRejectedError
24
24
  } from "./chunk-IUFM5JWV.js";
25
25
  import {
26
26
  getChatConfig,
27
27
  isProviderRetryError
28
- } from "./chunk-75I3UBIL.js";
28
+ } from "./chunk-S3FAOKQU.js";
29
29
  import {
30
30
  logException,
31
31
  logInfo,
32
32
  logWarn,
33
33
  withLogContext
34
- } from "./chunk-2ECYPYKP.js";
34
+ } from "./chunk-NPL66ZWL.js";
35
35
 
36
36
  // src/chat/task-execution/worker.ts
37
37
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;