@sentry/junior 0.117.0 → 0.119.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 (73) hide show
  1. package/dist/{agent-hooks-5IK4LPLP.js → agent-hooks-NZSV4QQR.js} +9 -11
  2. package/dist/api/conversations/detail.d.ts +17 -0
  3. package/dist/api/conversations/event-list.d.ts +17 -0
  4. package/dist/api/schema/conversation.d.ts +68 -0
  5. package/dist/api/schema/stats.d.ts +22 -0
  6. package/dist/api/schema.d.ts +2 -0
  7. package/dist/api/schema.js +7 -3
  8. package/dist/api/stats.d.ts +16 -0
  9. package/dist/api/user-pages/routes.d.ts +4 -0
  10. package/dist/api.js +223 -20
  11. package/dist/app.js +43 -38
  12. package/dist/{catalog-runtime-MTUYW3AA.js → catalog-runtime-TAOYIZIZ.js} +5 -5
  13. package/dist/chat/agent/prompt.d.ts +4 -2
  14. package/dist/chat/plugins/user-pages.d.ts +15 -0
  15. package/dist/chat/plugins/viewer-actors.d.ts +6 -0
  16. package/dist/chat/prompt.d.ts +1 -2
  17. package/dist/chat/sandbox/paths.d.ts +2 -0
  18. package/dist/chat/sandbox/sandbox.d.ts +3 -1
  19. package/dist/chat/sandbox/workspace.d.ts +1 -0
  20. package/dist/chat/skills.d.ts +1 -2
  21. package/dist/chat/slack/tools/canvas/api.d.ts +2 -9
  22. package/dist/chat/slack/tools/canvas/markdown.d.ts +9 -0
  23. package/dist/chat/tools/index.d.ts +4 -1
  24. package/dist/chat/tools/sandbox/file-utils.d.ts +11 -0
  25. package/dist/chat/tools/sandbox/find-files.d.ts +2 -1
  26. package/dist/chat/tools/sandbox/grep.d.ts +2 -1
  27. package/dist/{chunk-6G45D3YG.js → chunk-4UIUDOOV.js} +16 -233
  28. package/dist/{chunk-LUMEBOWC.js → chunk-6ZR455DC.js} +2 -2
  29. package/dist/{chunk-STUI6NIL.js → chunk-BLQZACHV.js} +511 -14
  30. package/dist/{chunk-27KWTFP6.js → chunk-BNJEPYTC.js} +5 -14
  31. package/dist/{chunk-ZRQUQJUV.js → chunk-D3N4BPSL.js} +3 -3
  32. package/dist/{chunk-WKU7TY22.js → chunk-FIANEE7Z.js} +3 -1
  33. package/dist/{chunk-RXRQJF7Y.js → chunk-GCGJGSQL.js} +21 -0
  34. package/dist/{chunk-FAWBONPC.js → chunk-GKFDU3ZI.js} +5 -7
  35. package/dist/{chunk-FXOYURO4.js → chunk-HDFGNU5E.js} +1 -0
  36. package/dist/{chunk-3GE3F4LT.js → chunk-JLJLZS2N.js} +1 -1
  37. package/dist/{chunk-CU7HTGNI.js → chunk-JSTGI7TX.js} +1 -1
  38. package/dist/chunk-JXRAOOXQ.js +37 -0
  39. package/dist/{chunk-WUNPRM76.js → chunk-NUENIPQL.js} +1 -1
  40. package/dist/{chunk-BFIRIZPH.js → chunk-O2ULQJWR.js} +101 -2
  41. package/dist/{chunk-AKG4TZNH.js → chunk-QZ7XRJDB.js} +30 -9
  42. package/dist/{chunk-5O3JDQDG.js → chunk-R53UT2OI.js} +1 -1
  43. package/dist/{chunk-W5JEQQEA.js → chunk-TAGV4Z3J.js} +1 -1
  44. package/dist/{chunk-NHZEUHKH.js → chunk-TGIQN7QW.js} +388 -113
  45. package/dist/{chunk-KU6ALEJC.js → chunk-VJTWKJWQ.js} +30 -2
  46. package/dist/{chunk-DS27ZBSP.js → chunk-VLTWQQKH.js} +2 -2
  47. package/dist/{chunk-WEK3V5RI.js → chunk-YLYJIQRX.js} +226 -21
  48. package/dist/{chunk-LN765Y4N.js → chunk-ZFX4M743.js} +15 -9
  49. package/dist/{chunk-72Z3HNTQ.js → chunk-ZJ6IVZVO.js} +1 -1
  50. package/dist/cli/chat.js +24 -25
  51. package/dist/cli/check.js +6 -6
  52. package/dist/cli/init.js +2 -2
  53. package/dist/cli/plugins.js +13 -15
  54. package/dist/cli/snapshot-create.js +9 -10
  55. package/dist/cli/upgrade.js +8 -8
  56. package/dist/db/schema/stats.d.ts +93 -0
  57. package/dist/db/schema.d.ts +94 -1
  58. package/dist/{db-J2ITKS63.js → db-FWGP5CKY.js} +7 -7
  59. package/dist/instrumentation.js +3 -3
  60. package/dist/nitro.js +3 -3
  61. package/dist/{oauth-callback-server-NQYKBT24.js → oauth-callback-server-PM3QNXJQ.js} +16 -18
  62. package/dist/{plugins-IUJA4VBU.js → plugins-HW4VWW6G.js} +1 -1
  63. package/dist/{runner-53V5GIQM.js → runner-DV55N6ZB.js} +11 -13
  64. package/dist/{skills-BU3ZMLVB.js → skills-MANV5ZK6.js} +6 -6
  65. package/dist/stats.d.ts +18 -0
  66. package/dist/{validation-74EIKKE6.js → validation-QGB4INTI.js} +6 -6
  67. package/dist/version.js +1 -1
  68. package/migrations/0011_sour_golden_guardian.sql +8 -0
  69. package/migrations/meta/0011_snapshot.json +1195 -0
  70. package/migrations/meta/_journal.json +8 -1
  71. package/package.json +5 -5
  72. package/dist/chunk-4ZNGQH7C.js +0 -25
  73. package/dist/chunk-YRWJ3KEU.js +0 -517
package/dist/app.js CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  appendAndEnqueueInboundMessage,
9
9
  beginConversationResume,
10
10
  buildAuthPauseResponse,
11
+ buildSlackOutputMessage,
11
12
  checkInConversationWork,
12
13
  clearConsumedConversationWake,
13
14
  clearExpiredConversationLease,
@@ -45,10 +46,11 @@ import {
45
46
  scheduleAgentContinue,
46
47
  sendSlackReply,
47
48
  shouldKeepProcessingReactionForToolInvocation,
49
+ splitSlackReplyText,
48
50
  startConversationWork,
49
51
  startSlackProcessingReaction,
50
52
  stripLeadingBotMention
51
- } from "./chunk-WEK3V5RI.js";
53
+ } from "./chunk-YLYJIQRX.js";
52
54
  import "./chunk-FA6POGLH.js";
53
55
  import {
54
56
  ConversationTurnLifecycleService,
@@ -63,13 +65,13 @@ import {
63
65
  processPluginTask,
64
66
  requireTurnFailureEventId,
65
67
  scheduleSessionCompletedPluginTasks
66
- } from "./chunk-LN765Y4N.js";
68
+ } from "./chunk-ZFX4M743.js";
67
69
  import {
68
70
  GET,
69
71
  conversationVisibilityFromSlackChannelType,
70
72
  resolveSlackChannelTypeFromMessage,
71
73
  resolveSlackConversationContext
72
- } from "./chunk-LUMEBOWC.js";
74
+ } from "./chunk-6ZR455DC.js";
73
75
  import "./chunk-4CODA7P5.js";
74
76
  import "./chunk-PE44LDDQ.js";
75
77
  import {
@@ -88,13 +90,13 @@ import {
88
90
  import {
89
91
  validatePluginEgressCredentialHooks,
90
92
  validatePluginRegistrations
91
- } from "./chunk-W5JEQQEA.js";
93
+ } from "./chunk-TAGV4Z3J.js";
92
94
  import {
93
95
  defineJuniorPlugins,
94
96
  pluginCatalogConfigFromEnv,
95
97
  pluginCatalogConfigFromPluginSet,
96
98
  pluginRuntimeRegistrationsFromPluginSet
97
- } from "./chunk-WKU7TY22.js";
99
+ } from "./chunk-FIANEE7Z.js";
98
100
  import {
99
101
  AuthorizationFlowDisabledError,
100
102
  PluginCredentialFailureError,
@@ -121,20 +123,18 @@ import {
121
123
  setConfigDefaults,
122
124
  shouldEmitDevAgentTrace,
123
125
  shouldPropagateSandboxEgressTrace
124
- } from "./chunk-NHZEUHKH.js";
126
+ } from "./chunk-TGIQN7QW.js";
125
127
  import "./chunk-DIB4GX3G.js";
126
128
  import {
127
129
  RetryableDeliveryError,
128
- buildSlackOutputMessage,
129
130
  createUserTokenStore,
130
131
  deleteMcpAuthSessionsForUserProvider,
131
132
  deleteMcpServerSessionId,
132
133
  deleteMcpStoredOAuthCredentials,
133
134
  formatProviderLabel,
134
135
  postSlackMessage,
135
- splitSlackReplyText,
136
136
  startOAuthFlow
137
- } from "./chunk-6G45D3YG.js";
137
+ } from "./chunk-4UIUDOOV.js";
138
138
  import {
139
139
  ConversationTurnBoundaryError,
140
140
  CooperativeTurnYieldError,
@@ -188,40 +188,35 @@ import {
188
188
  trimTrailingAssistantMessages,
189
189
  updateConversationStats,
190
190
  upsertConversationMessage
191
- } from "./chunk-27KWTFP6.js";
191
+ } from "./chunk-BNJEPYTC.js";
192
192
  import "./chunk-HDSDCEPK.js";
193
- import "./chunk-FAWBONPC.js";
193
+ import "./chunk-GKFDU3ZI.js";
194
+ import "./chunk-JXRAOOXQ.js";
194
195
  import "./chunk-MU6HHZEN.js";
195
196
  import "./chunk-PDO5BLNM.js";
196
197
  import "./chunk-UIE3R5XU.js";
197
198
  import {
199
+ SlackActionError,
198
200
  bindScheduledTaskCredentialSubject,
199
201
  bindSlackDirectCredentialSubject,
200
202
  createPluginLogger,
201
203
  createPluginState,
204
+ downloadPrivateSlackFile,
202
205
  getPluginApiRoutes,
203
206
  getPluginRoutes,
204
207
  getPlugins,
205
- setDashboardConversationLinkOptions,
206
- setPlugins,
207
- validatePlugins,
208
- verifyScheduledTaskCredentialSubject,
209
- verifySlackDirectCredentialSubject
210
- } from "./chunk-STUI6NIL.js";
211
- import {
212
- acquireActiveLock,
213
- getStateAdapter
214
- } from "./chunk-KU6ALEJC.js";
215
- import {
216
- SlackActionError,
217
- downloadPrivateSlackFile,
218
208
  getSlackClient,
219
209
  getWorkspaceTeamId,
220
210
  isDmChannel,
221
211
  normalizeSlackConversationId,
222
212
  runWithSlackInstallationToken,
223
- runWithWorkspaceTeamId
224
- } from "./chunk-YRWJ3KEU.js";
213
+ runWithWorkspaceTeamId,
214
+ setDashboardConversationLinkOptions,
215
+ setPlugins,
216
+ validatePlugins,
217
+ verifyScheduledTaskCredentialSubject,
218
+ verifySlackDirectCredentialSubject
219
+ } from "./chunk-BLQZACHV.js";
225
220
  import {
226
221
  contextProvenance,
227
222
  createSlackDestination,
@@ -232,14 +227,16 @@ import {
232
227
  instructionProvenanceFor,
233
228
  requireSlackDestination,
234
229
  withConversationEventLock
235
- } from "./chunk-ZRQUQJUV.js";
230
+ } from "./chunk-D3N4BPSL.js";
236
231
  import {
237
232
  juniorConversationEvents,
238
233
  juniorConversations
239
- } from "./chunk-RXRQJF7Y.js";
234
+ } from "./chunk-GCGJGSQL.js";
240
235
  import {
236
+ acquireActiveLock,
237
+ getStateAdapter,
241
238
  sleep
242
- } from "./chunk-4ZNGQH7C.js";
239
+ } from "./chunk-VJTWKJWQ.js";
243
240
  import {
244
241
  STANDARD_MODEL_PROFILE,
245
242
  botConfig,
@@ -257,18 +254,18 @@ import {
257
254
  modelIdForProfile,
258
255
  setSlackReactionConfig,
259
256
  standardModelId
260
- } from "./chunk-DS27ZBSP.js";
257
+ } from "./chunk-VLTWQQKH.js";
261
258
  import {
262
259
  juniorDestinations
263
260
  } from "./chunk-VFUK3X5B.js";
264
261
  import {
265
262
  parseSlackThreadId
266
- } from "./chunk-FXOYURO4.js";
267
- import "./chunk-AKG4TZNH.js";
263
+ } from "./chunk-HDFGNU5E.js";
264
+ import "./chunk-QZ7XRJDB.js";
268
265
  import {
269
266
  pluginCatalogRuntime
270
- } from "./chunk-CU7HTGNI.js";
271
- import "./chunk-5O3JDQDG.js";
267
+ } from "./chunk-JSTGI7TX.js";
268
+ import "./chunk-R53UT2OI.js";
272
269
  import {
273
270
  credentialSubjectSchema
274
271
  } from "./chunk-W3U3YQYI.js";
@@ -294,7 +291,7 @@ import {
294
291
  setTags,
295
292
  withContext,
296
293
  withSpan
297
- } from "./chunk-72Z3HNTQ.js";
294
+ } from "./chunk-ZJ6IVZVO.js";
298
295
  import {
299
296
  toOptionalString
300
297
  } from "./chunk-OB42YVAE.js";
@@ -309,10 +306,10 @@ import "./chunk-B3IT5END.js";
309
306
  import "./chunk-3V7OFJZC.js";
310
307
  import {
311
308
  JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
312
- } from "./chunk-WUNPRM76.js";
309
+ } from "./chunk-NUENIPQL.js";
313
310
  import {
314
311
  JUNIOR_VERSION
315
- } from "./chunk-3GE3F4LT.js";
312
+ } from "./chunk-JLJLZS2N.js";
316
313
  import "./chunk-MLKGABMK.js";
317
314
 
318
315
  // src/app.ts
@@ -9440,7 +9437,10 @@ function dashboardHostRoutePaths(dashboard) {
9440
9437
  peoplePath,
9441
9438
  `${peoplePath}/*`,
9442
9439
  pagePath("system"),
9443
- `${pagePath("system")}/*`
9440
+ `${pagePath("system")}/*`,
9441
+ pagePath("settings/plugins"),
9442
+ `${pagePath("settings/plugins")}/*`,
9443
+ pagePath("settings/api-tokens")
9444
9444
  ];
9445
9445
  if (dashboard.componentGallery) {
9446
9446
  pagePaths.push(pagePath("dev"), `${pagePath("dev")}/*`);
@@ -9457,13 +9457,18 @@ function dashboardHostRoutePaths(dashboard) {
9457
9457
  "/api/plugins",
9458
9458
  "/api/plugins/*",
9459
9459
  "/api/plugin-reports",
9460
+ "/api/user-pages",
9461
+ "/api/user-pages/*",
9460
9462
  "/api/skills",
9463
+ "/api/stats",
9461
9464
  "/api/conversations",
9462
9465
  "/api/conversations/*",
9463
9466
  "/api/locations",
9464
9467
  "/api/locations/*",
9465
9468
  "/api/people",
9466
9469
  "/api/people/*",
9470
+ "/api/personal-tokens",
9471
+ "/api/personal-tokens/*",
9467
9472
  "/api/config",
9468
9473
  "/api/me",
9469
9474
  authPath,
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-CU7HTGNI.js";
4
- import "./chunk-5O3JDQDG.js";
3
+ } from "./chunk-JSTGI7TX.js";
4
+ import "./chunk-R53UT2OI.js";
5
5
  import "./chunk-W3U3YQYI.js";
6
6
  import "./chunk-HZF5P5UN.js";
7
- import "./chunk-72Z3HNTQ.js";
7
+ import "./chunk-ZJ6IVZVO.js";
8
8
  import "./chunk-OB42YVAE.js";
9
9
  import "./chunk-F3B2YJ76.js";
10
10
  import "./chunk-6GWA276C.js";
11
11
  import "./chunk-B3IT5END.js";
12
12
  import "./chunk-3V7OFJZC.js";
13
- import "./chunk-WUNPRM76.js";
14
- import "./chunk-3GE3F4LT.js";
13
+ import "./chunk-NUENIPQL.js";
14
+ import "./chunk-JLJLZS2N.js";
15
15
  import "./chunk-MLKGABMK.js";
16
16
  export {
17
17
  pluginCatalogRuntime
@@ -1,7 +1,7 @@
1
1
  import type { PiMessage } from "@/chat/pi/messages";
2
2
  import { type LogContext } from "@/chat/logging";
3
3
  import type { ConversationPrivacy } from "@/chat/conversation-privacy";
4
- import type { SkillInvocation, SkillMetadata } from "@/chat/skills";
4
+ import type { Skill, SkillMetadata } from "@/chat/skills";
5
5
  import type { ActiveMcpCatalogSummary } from "@/chat/tool-support/skill/mcp-tool-summary";
6
6
  import type { ToolRuntimeContext } from "@/chat/tools/types";
7
7
  import type { AnyToolDefinition } from "@/chat/tools/definition";
@@ -39,6 +39,8 @@ export interface PromptAssembly {
39
39
  * Keep thread text separate from the canonical active task boundary.
40
40
  */
41
41
  export declare function buildUserTurnText(userInput: string, conversationContext?: string, actor?: AgentRunInstructionActor): string;
42
+ /** Render an explicitly selected skill as instructions for the current turn. */
43
+ export declare function renderExplicitSkillInstructions(skill: Skill): string;
42
44
  /** Encode a non-image attachment as base64 XML for the prompt. */
43
45
  export declare function encodeNonImageAttachmentForPrompt(attachment: {
44
46
  data: Buffer;
@@ -65,7 +67,7 @@ export declare function assemblePrompt(args: {
65
67
  conversationPrivacy?: ConversationPrivacy;
66
68
  existingSessionPiMessages?: PiMessage[];
67
69
  existingTurnStartMessageIndex?: number;
68
- invocation: SkillInvocation | null;
70
+ explicitSkill: Skill | null;
69
71
  priorPiMessages?: PiMessage[];
70
72
  resumedFromSessionRecord: boolean;
71
73
  routing: AgentRunRouting;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Runtime ownership for plugin user pages.
3
+ *
4
+ * This module joins registered readers with the authenticated viewer and
5
+ * validates every plugin response before it reaches the dashboard.
6
+ */
7
+ import { type PluginUserPageContent, type PluginUserPageLink } from "@sentry/junior-plugin-api";
8
+ /** List safe navigation metadata for registered plugin user pages. */
9
+ export declare function readPluginUserPageLinks(): PluginUserPageLink[];
10
+ /** Read one registered plugin user page for the authenticated viewer. */
11
+ export declare function readPluginUserPage(input: {
12
+ email: string;
13
+ pageId: string;
14
+ pluginName: string;
15
+ }): Promise<PluginUserPageContent | undefined>;
@@ -0,0 +1,6 @@
1
+ import { type PluginUserPageActor } from "@sentry/junior-plugin-api";
2
+ import type { JuniorDatabase } from "@/db/db";
3
+ /** Resolve runtime-owned actors linked to a viewer email from SQL. */
4
+ export declare function readViewerActorsFromSql(db: JuniorDatabase, email: string): Promise<PluginUserPageActor[]>;
5
+ /** Resolve runtime-owned actors linked to the authenticated viewer. */
6
+ export declare function readViewerActors(email: string): Promise<PluginUserPageActor[]>;
@@ -1,6 +1,6 @@
1
1
  import type { SlackConversationContext } from "@/chat/slack/conversation-context";
2
2
  import type { ThreadArtifactsState } from "@/chat/state/artifacts";
3
- import type { SkillMetadata, SkillInvocation } from "@/chat/skills";
3
+ import type { SkillMetadata } from "@/chat/skills";
4
4
  import type { ActiveMcpCatalogSummary } from "@/chat/tool-support/skill/mcp-tool-summary";
5
5
  import type { PluginPromptContributionContext } from "@/chat/plugins/prompt";
6
6
  import type { Destination, Source, SystemActor } from "@sentry/junior-plugin-api";
@@ -30,7 +30,6 @@ type TurnContextPromptInput = {
30
30
  plugin?: string;
31
31
  source: Source;
32
32
  };
33
- invocation: SkillInvocation | null;
34
33
  actor?: {
35
34
  userName?: string;
36
35
  fullName?: string;
@@ -3,3 +3,5 @@ export declare const SANDBOX_SKILLS_ROOT: string;
3
3
  export declare const SANDBOX_DATA_ROOT: string;
4
4
  export declare function sandboxSkillDir(skillName: string): string;
5
5
  export declare function sandboxSkillFile(skillName: string): string;
6
+ /** Explain how the agent should resolve files and commands owned by a skill. */
7
+ export declare function sandboxSkillPathResolution(skillName: string): string;
@@ -1,4 +1,4 @@
1
- import { type LogContext } from "@/chat/logging";
1
+ import { type LogContext, type SetSpanAttributes } from "@/chat/logging";
2
2
  import type { SandboxEgressSignalTransport } from "@/chat/sandbox/egress/signals";
3
3
  import type { SandboxEgressTracePropagationConfig } from "@/chat/sandbox/egress/tracing";
4
4
  import type { CredentialContext } from "@/chat/credentials/context";
@@ -9,6 +9,8 @@ export interface SandboxToolCall {
9
9
  toolName: string;
10
10
  input: unknown;
11
11
  signal?: AbortSignal;
12
+ /** Add safe sandbox measurements to the caller-owned tool span. */
13
+ setToolCallSpanAttributes?: SetSpanAttributes;
12
14
  }
13
15
  export interface SandboxTools {
14
16
  supports(toolName: string): boolean;
@@ -11,6 +11,7 @@ export interface SandboxCommandInput {
11
11
  env?: Record<string, string>;
12
12
  signal?: AbortSignal;
13
13
  sudo?: boolean;
14
+ timeoutMs?: number;
14
15
  }
15
16
  export interface SandboxFileStat {
16
17
  isDirectory(): boolean;
@@ -31,7 +31,6 @@ export interface Skill extends SkillMetadata {
31
31
  }
32
32
  export interface SkillInvocation {
33
33
  skillName: string;
34
- args: string;
35
34
  }
36
35
  export interface DiscoverSkillsOptions {
37
36
  additionalRoots?: string[];
@@ -40,7 +39,7 @@ export interface DiscoverSkillsOptions {
40
39
  export declare function resetSkillDiscoveryCache(): void;
41
40
  /** Scan all configured skill roots and return discovered skill metadata, using a cache when roots match. */
42
41
  export declare function discoverSkills(options?: DiscoverSkillsOptions): Promise<SkillMetadata[]>;
43
- /** Extract a skill invocation (name + args) from a user message, or return null if none matches. */
42
+ /** Extract an explicit skill invocation from a user message. */
44
43
  export declare function parseSkillInvocation(messageText: string, availableSkills: SkillMetadata[]): SkillInvocation | null;
45
44
  /** Look up a skill by name from the available set. */
46
45
  export declare function findSkillByName(skillName: string, available: SkillMetadata[]): SkillMetadata | null;
@@ -1,3 +1,4 @@
1
+ import { type CanvasMarkdownNormalization } from "@/chat/slack/tools/canvas/markdown";
1
2
  export { extractCanvasId } from "@/chat/slack/canvas-references";
2
3
  export interface CanvasCreateInput {
3
4
  title: string;
@@ -13,11 +14,6 @@ export interface CanvasReadResult {
13
14
  content: string;
14
15
  byteLength: number;
15
16
  }
16
- /** Clamp headings deeper than h3 to h3 (Slack canvas limitation). */
17
- export declare function normalizeCanvasMarkdown(markdown: string): {
18
- markdown: string;
19
- normalizedHeadingCount: number;
20
- };
21
17
  /**
22
18
  * Create a standalone Slack canvas owned by the bot and best-effort grant write
23
19
  * access to the active channel. Standalone canvases (`canvases.create`) are not
@@ -32,10 +28,7 @@ export declare function createCanvas(input: CanvasCreateInput): Promise<{
32
28
  export declare function writeCanvasMarkdown(input: {
33
29
  canvasId: string;
34
30
  markdown: string;
35
- }): Promise<{
36
- markdown: string;
37
- normalizedHeadingCount: number;
38
- }>;
31
+ }): Promise<CanvasMarkdownNormalization>;
39
32
  /**
40
33
  * Read a Slack canvas the bot has access to and return its raw downloadable
41
34
  * content. Slack does not expose a structured canvas-read API, so we fetch
@@ -0,0 +1,9 @@
1
+ export interface CanvasMarkdownNormalization {
2
+ markdown: string;
3
+ normalizedCount: number;
4
+ normalizedHeadingCount: number;
5
+ normalizedMixedListCount: number;
6
+ unwrappedBlockquoteCount: number;
7
+ }
8
+ /** Normalize Markdown constructs known to be rejected by Slack Canvas. */
9
+ export declare function normalizeCanvasMarkdown(markdown: string): CanvasMarkdownNormalization;
@@ -2,5 +2,8 @@ import type { SkillMetadata } from "@/chat/skills";
2
2
  import type { ToolRegistry } from "@/chat/tools/definition";
3
3
  import type { ToolHooks, ToolRuntimeContext } from "@/chat/tools/types";
4
4
  export type { ToolHooks, ToolRuntimeContext };
5
+ export interface CreateToolsOptions {
6
+ includeLoadSkill?: boolean;
7
+ }
5
8
  /** Build the model-facing tool registry from runtime-owned context and capabilities. */
6
- export declare function createTools(availableSkills: SkillMetadata[], hooks: ToolHooks | undefined, context: ToolRuntimeContext): ToolRegistry;
9
+ export declare function createTools(availableSkills: SkillMetadata[], hooks: ToolHooks | undefined, context: ToolRuntimeContext, options?: CreateToolsOptions): ToolRegistry;
@@ -1,8 +1,19 @@
1
1
  import type { SandboxCommandInput, SandboxCommandResult, SandboxFileSystem } from "@/chat/sandbox/workspace";
2
2
  export type { SandboxFileSystem };
3
3
  export type SandboxCommandRunner = (input: SandboxCommandInput) => Promise<SandboxCommandResult>;
4
+ /** Safe measurements produced by one sandbox-backed search operation. */
5
+ export interface SandboxSearchTelemetry {
6
+ emittedLineCount: number;
7
+ limit: number;
8
+ limitReached: boolean;
9
+ parsedRecordCount: number;
10
+ rawOutputBytes: number;
11
+ resultCount: number;
12
+ resultBytes: number;
13
+ }
4
14
  export declare const MAX_TEXT_CHARS = 60000;
5
15
  export declare const RIPGREP_EXCLUDED_GLOBS: readonly ["!**/.git/**", "!**/node_modules/**"];
16
+ export declare const DEFAULT_SEARCH_COMMAND_TIMEOUT_MS = 30000;
6
17
  export type TextSearchResultDetails = {
7
18
  ok: true;
8
19
  status?: "success";
@@ -1,4 +1,4 @@
1
- import { type SandboxCommandRunner, type SandboxFileSystem, type TextSearchResultDetails, type TextSearchToolResult } from "@/chat/tools/sandbox/file-utils";
1
+ import { type SandboxCommandRunner, type SandboxFileSystem, type SandboxSearchTelemetry, type TextSearchResultDetails, type TextSearchToolResult } from "@/chat/tools/sandbox/file-utils";
2
2
  import { type JuniorToolResultEnvelope } from "@/chat/tool-support/structured-result";
3
3
  interface FindFilesSuccessResult {
4
4
  content: JuniorToolResultEnvelope["content"];
@@ -17,6 +17,7 @@ type FindFilesResult = FindFilesSuccessResult | TextSearchToolResult;
17
17
  export declare function findFiles(params: {
18
18
  fs: SandboxFileSystem;
19
19
  limit?: unknown;
20
+ onTelemetry?: (telemetry: SandboxSearchTelemetry) => void;
20
21
  path?: string;
21
22
  pattern: string;
22
23
  runCommand?: SandboxCommandRunner;
@@ -1,4 +1,4 @@
1
- import { type SandboxCommandRunner, type SandboxFileSystem, type TextSearchResultDetails, type TextSearchToolResult } from "@/chat/tools/sandbox/file-utils";
1
+ import { type SandboxCommandRunner, type SandboxFileSystem, type SandboxSearchTelemetry, type TextSearchResultDetails, type TextSearchToolResult } from "@/chat/tools/sandbox/file-utils";
2
2
  interface GrepResultData {
3
3
  context: number;
4
4
  glob?: string;
@@ -31,6 +31,7 @@ export declare function grepFiles(params: {
31
31
  ignoreCase?: boolean;
32
32
  limit?: unknown;
33
33
  literal?: boolean;
34
+ onTelemetry?: (telemetry: SandboxSearchTelemetry) => void;
34
35
  path?: string;
35
36
  pattern: string;
36
37
  runCommand?: SandboxCommandRunner;