@sentry/junior 0.110.0 → 0.111.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 (66) hide show
  1. package/dist/{agent-hooks-ELT4ODFF.js → agent-hooks-QQ2IWKOP.js} +8 -8
  2. package/dist/api.js +11 -11
  3. package/dist/app.js +521 -394
  4. package/dist/build/virtual-config.d.ts +2 -0
  5. package/dist/{catalog-runtime-4GI22PXK.js → catalog-runtime-D22W6QEJ.js} +5 -5
  6. package/dist/chat/agent/request.d.ts +3 -6
  7. package/dist/chat/agent/sandbox.d.ts +36 -11
  8. package/dist/chat/agent/tools.d.ts +5 -8
  9. package/dist/chat/config.d.ts +8 -1
  10. package/dist/chat/pi/sdk.d.ts +1 -1
  11. package/dist/chat/plugins/agent-hooks.d.ts +2 -2
  12. package/dist/chat/runtime/agent-continue-runner.d.ts +7 -3
  13. package/dist/chat/runtime/slack-runtime.d.ts +1 -2
  14. package/dist/chat/runtime/thread-state.d.ts +3 -7
  15. package/dist/chat/runtime/turn-preparation.d.ts +2 -2
  16. package/dist/chat/sandbox/command-result.d.ts +91 -0
  17. package/dist/chat/sandbox/errors.d.ts +3 -1
  18. package/dist/chat/sandbox/ref.d.ts +5 -0
  19. package/dist/chat/sandbox/sandbox.d.ts +19 -46
  20. package/dist/chat/sandbox/session.d.ts +16 -20
  21. package/dist/chat/sandbox/skill-sync.d.ts +2 -2
  22. package/dist/chat/sandbox/workspace.d.ts +14 -12
  23. package/dist/chat/services/turn-result.d.ts +3 -4
  24. package/dist/chat/task-execution/slack-work.d.ts +3 -1
  25. package/dist/chat/task-execution/state.d.ts +75 -22
  26. package/dist/chat/task-execution/store.d.ts +34 -3
  27. package/dist/chat/task-execution/worker.d.ts +0 -1
  28. package/dist/chat/tool-support/normalize-result.d.ts +2 -2
  29. package/dist/chat/tool-support/pi-tool-adapter.d.ts +2 -2
  30. package/dist/chat/tool-support/structured-result.d.ts +1 -2
  31. package/dist/chat/tools/sandbox/file-uploads.d.ts +1 -1
  32. package/dist/chat/{runtime → tools/sandbox}/generated-artifacts.d.ts +3 -3
  33. package/dist/chat/tools/types.d.ts +1 -1
  34. package/dist/chat/tools/web/fetch-content.d.ts +5 -0
  35. package/dist/chat/tools/web/image-generate.d.ts +2 -1
  36. package/dist/chat/tools/web/search.d.ts +1 -1
  37. package/dist/{chunk-W6RJZG7F.js → chunk-B45FPP2A.js} +306 -31
  38. package/dist/{chunk-SBOBTS27.js → chunk-BTRNMS6A.js} +2 -2
  39. package/dist/{chunk-L5XQPJ7T.js → chunk-IFAHK54X.js} +2 -2
  40. package/dist/{chunk-IYKPU7H6.js → chunk-J7APPQIJ.js} +1 -1
  41. package/dist/{chunk-3S7YYHBI.js → chunk-L6JPKANW.js} +1 -1
  42. package/dist/{chunk-W75ZPAGG.js → chunk-MPVES2IC.js} +1 -1
  43. package/dist/{chunk-WNOVRQ67.js → chunk-NQLWOTY4.js} +46 -18
  44. package/dist/{chunk-RHHRKSPI.js → chunk-OOLU34J4.js} +8714 -9027
  45. package/dist/{chunk-GK47NBDE.js → chunk-PYKKM4MM.js} +1 -1
  46. package/dist/{chunk-3UBQI73J.js → chunk-PZELBSHC.js} +7 -8
  47. package/dist/{chunk-2T7TIEXI.js → chunk-QQIVLZW4.js} +11 -15
  48. package/dist/{chunk-C5XAFTHY.js → chunk-SL3ZKNLQ.js} +16 -13
  49. package/dist/{chunk-3TV7OEHL.js → chunk-WSRBFHPX.js} +1 -1
  50. package/dist/{chunk-Y3H2DN6F.js → chunk-XQAYFRWT.js} +1 -1
  51. package/dist/{chunk-Y5FK3CNG.js → chunk-Z2W4SJZ7.js} +1 -1
  52. package/dist/{chunk-ZKIOWEFL.js → chunk-Z4G3WCP3.js} +1 -1
  53. package/dist/{chunk-4QU44P7Q.js → chunk-ZRZ4SVWG.js} +2 -2
  54. package/dist/cli/chat.js +19 -19
  55. package/dist/cli/check.js +6 -6
  56. package/dist/cli/plugins.js +11 -11
  57. package/dist/cli/snapshot-warmup.js +8 -8
  58. package/dist/cli/upgrade.js +5 -5
  59. package/dist/{db-Y6W6CWWW.js → db-WXQOQESG.js} +5 -5
  60. package/dist/instrumentation.js +2 -2
  61. package/dist/nitro.js +14 -8
  62. package/dist/{runner-BBFV5GLR.js → runner-4QY4XH4B.js} +19 -28
  63. package/dist/{skills-AR4AF32L.js → skills-P5MU4EBX.js} +6 -6
  64. package/dist/{validation-FBIEPTC2.js → validation-PQF5OP6T.js} +6 -6
  65. package/dist/version.js +1 -1
  66. package/package.json +6 -6
@@ -3,6 +3,7 @@ import type { PiMessage } from "@/chat/pi/messages";
3
3
  import type { TurnRoute } from "@/chat/services/turn-router";
4
4
  import type { AgentTurnUsage } from "@/chat/usage";
5
5
  import type { ThreadArtifactsState } from "@/chat/state/artifacts";
6
+ import type { SandboxRef } from "@/chat/sandbox/ref";
6
7
  import { extractAssistantText } from "@/chat/pi/transcript";
7
8
  export interface AgentTurnDiagnostics {
8
9
  assistantMessageCount: number;
@@ -23,8 +24,7 @@ export interface AgentRunResult {
23
24
  /** Sanitized terminal text for diagnostics and failure fallback, not success delivery. */
24
25
  text: string;
25
26
  artifactStatePatch?: Partial<ThreadArtifactsState>;
26
- sandboxId?: string;
27
- sandboxDependencyProfileHash?: string;
27
+ sandboxRef?: SandboxRef;
28
28
  piMessages?: PiMessage[];
29
29
  diagnostics: AgentTurnDiagnostics;
30
30
  }
@@ -33,8 +33,7 @@ export interface TurnResultInput {
33
33
  userInput: string;
34
34
  artifactStatePatch: Partial<ThreadArtifactsState>;
35
35
  toolCalls: string[];
36
- sandboxId?: string;
37
- sandboxDependencyProfileHash?: string;
36
+ sandboxRef?: SandboxRef;
38
37
  piMessages?: PiMessage[];
39
38
  durationMs?: number;
40
39
  generatedFileCount: number;
@@ -272,7 +272,9 @@ interface SlackResourceEventInboundInput {
272
272
  export interface CreateSlackConversationWorkerOptions {
273
273
  getSlackAdapter: () => SlackAdapter;
274
274
  lookupSlackUser?: (teamId: string, userId: string) => Promise<SlackActorProfile | null | undefined>;
275
- resumeAwaitingContinuation: (conversationId: string) => Promise<boolean>;
275
+ resumeAwaitingContinuation: (conversationId: string, options: {
276
+ shouldYield: () => boolean;
277
+ }) => Promise<boolean>;
276
278
  conversationStore?: ConversationStore;
277
279
  runtime: SlackInboxTurnRuntime;
278
280
  state?: StateAdapter;
@@ -1,5 +1,6 @@
1
1
  import type { StateAdapter } from "chat";
2
- import type { Destination } from "@sentry/junior-plugin-api";
2
+ import { type Destination } from "@sentry/junior-plugin-api";
3
+ import { z } from "zod";
3
4
  import { type StoredSlackActor } from "@/chat/actor";
4
5
  declare class InvalidConversationRecordError extends Error {
5
6
  constructor(conversationId: string);
@@ -12,25 +13,67 @@ export declare const CONVERSATION_WORK_LEASE_TTL_MS = 90000;
12
13
  export declare const CONVERSATION_WORK_CHECK_IN_INTERVAL_MS = 15000;
13
14
  export declare const CONVERSATION_WORK_STALE_ENQUEUE_MS = 60000;
14
15
  export declare const CONVERSATION_WORK_MAX_DELIVERY_ATTEMPTS = 5;
15
- export type Source = "api" | "internal" | "local" | "plugin" | "resource_event" | "scheduler" | "slack";
16
+ declare const inboundMessageSourceSchema: z.ZodEnum<{
17
+ slack: "slack";
18
+ plugin: "plugin";
19
+ api: "api";
20
+ local: "local";
21
+ internal: "internal";
22
+ resource_event: "resource_event";
23
+ scheduler: "scheduler";
24
+ }>;
25
+ export type Source = z.output<typeof inboundMessageSourceSchema>;
16
26
  export type ExecutionStatus = "awaiting_resume" | "failed" | "idle" | "pending" | "running";
17
- export interface AgentInput {
18
- attachments?: unknown[];
19
- authorId?: string;
20
- metadata?: Record<string, unknown>;
21
- text: string;
22
- }
23
- export interface InboundMessage {
24
- attemptCount?: number;
25
- conversationId: string;
26
- createdAtMs: number;
27
- destination: Destination;
28
- inboundMessageId: string;
29
- injectedAtMs?: number;
30
- input: AgentInput;
31
- receivedAtMs: number;
32
- source: Source;
33
- }
27
+ declare const agentInputSchema: z.ZodObject<{
28
+ attachments: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
29
+ authorId: z.ZodOptional<z.ZodString>;
30
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
31
+ text: z.ZodString;
32
+ }, z.core.$strict>;
33
+ export type AgentInput = z.output<typeof agentInputSchema>;
34
+ /** Durable delivery modes for pending inbound mailbox work. */
35
+ export declare const inboundMessageDeliverySchema: z.ZodEnum<{
36
+ defer: "defer";
37
+ interrupt: "interrupt";
38
+ }>;
39
+ export type InboundMessageDelivery = z.output<typeof inboundMessageDeliverySchema>;
40
+ /** Canonical durable mailbox entry owned by task execution. */
41
+ export declare const inboundMessageSchema: z.ZodObject<{
42
+ attemptCount: z.ZodOptional<z.ZodNumber>;
43
+ conversationId: z.ZodString;
44
+ createdAtMs: z.ZodNumber;
45
+ delivery: z.ZodEnum<{
46
+ defer: "defer";
47
+ interrupt: "interrupt";
48
+ }>;
49
+ destination: z.ZodDiscriminatedUnion<[z.ZodObject<{
50
+ platform: z.ZodLiteral<"slack">;
51
+ teamId: z.ZodString;
52
+ channelId: z.ZodString;
53
+ }, z.core.$strict>, z.ZodObject<{
54
+ platform: z.ZodLiteral<"local">;
55
+ conversationId: z.ZodString;
56
+ }, z.core.$strict>], "platform">;
57
+ inboundMessageId: z.ZodString;
58
+ injectedAtMs: z.ZodOptional<z.ZodNumber>;
59
+ input: z.ZodObject<{
60
+ attachments: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
61
+ authorId: z.ZodOptional<z.ZodString>;
62
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
63
+ text: z.ZodString;
64
+ }, z.core.$strict>;
65
+ receivedAtMs: z.ZodNumber;
66
+ source: z.ZodEnum<{
67
+ slack: "slack";
68
+ plugin: "plugin";
69
+ api: "api";
70
+ local: "local";
71
+ internal: "internal";
72
+ resource_event: "resource_event";
73
+ scheduler: "scheduler";
74
+ }>;
75
+ }, z.core.$strict>;
76
+ export type InboundMessage = z.output<typeof inboundMessageSchema>;
34
77
  export interface Lease {
35
78
  acquiredAtMs: number;
36
79
  expiresAtMs: number;
@@ -56,7 +99,7 @@ export interface Conversation {
56
99
  execution: ConversationExecution;
57
100
  lastActivityAtMs: number;
58
101
  actor?: StoredSlackActor;
59
- schemaVersion: 1;
102
+ schemaVersion: 2;
60
103
  source?: Source;
61
104
  title?: string;
62
105
  updatedAtMs: number;
@@ -182,7 +225,7 @@ export declare function checkInConversationWork(args: {
182
225
  state?: StateAdapter;
183
226
  }): Promise<boolean>;
184
227
  /**
185
- * Drain pending mailbox entries after the caller acknowledges durable handling.
228
+ * Resolve pending mailbox entries after the caller accepts responsibility.
186
229
  *
187
230
  * Returning ids acknowledges only that subset; returning nothing acknowledges
188
231
  * every pending entry passed to the handler.
@@ -193,7 +236,10 @@ export declare function drainConversationMailbox(args: {
193
236
  leaseToken: string;
194
237
  nowMs?: number;
195
238
  state?: StateAdapter;
196
- }): Promise<InboundMessage[]>;
239
+ }): Promise<{
240
+ changed: boolean;
241
+ messages: InboundMessage[];
242
+ }>;
197
243
  /** Acknowledge leased mailbox entries after the handler accepts responsibility. */
198
244
  export declare function ackMessages(args: {
199
245
  conversationId: string;
@@ -210,6 +256,13 @@ export declare function requestConversationContinuation(args: {
210
256
  nowMs?: number;
211
257
  state?: StateAdapter;
212
258
  }): Promise<boolean>;
259
+ /** Begin a requested turn resume under the worker's existing lease. */
260
+ export declare function beginConversationResume(args: {
261
+ conversationId: string;
262
+ leaseToken: string;
263
+ nowMs?: number;
264
+ state?: StateAdapter;
265
+ }): Promise<boolean>;
213
266
  /** Release the durable execution lease without changing completion state. */
214
267
  export declare function releaseConversationWork(args: {
215
268
  conversationId: string;
@@ -2,13 +2,13 @@ import type { StateAdapter } from "chat";
2
2
  import type { ConversationStore } from "@/chat/conversations/store";
3
3
  import type { ConversationWorkQueue } from "./queue";
4
4
  import * as workState from "./state";
5
- export { CONVERSATION_ACTIVE_INDEX_KEY, CONVERSATION_BY_ACTIVITY_INDEX_KEY, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS, CONVERSATION_WORK_LEASE_TTL_MS, CONVERSATION_WORK_MAX_DELIVERY_ATTEMPTS, CONVERSATION_WORK_STALE_ENQUEUE_MS, isFinalAttempt, isInvalidConversationRecordError, type AgentInput, type AttemptFailure, type AppendAndEnqueueInboundMessageResult, type AppendInboundMessageResult, type Conversation, type ConversationExecution, type ConversationWorkLease, type ConversationWorkState, type ExecutionStatus, type InboundMessage, type Lease, type RequestConversationWorkResult, type Source, type StartConversationWorkAcquired, type StartConversationWorkActive, type StartConversationWorkNoWork, type StartConversationWorkResult, } from "@/chat/task-execution/state";
5
+ export { CONVERSATION_ACTIVE_INDEX_KEY, CONVERSATION_BY_ACTIVITY_INDEX_KEY, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS, CONVERSATION_WORK_LEASE_TTL_MS, CONVERSATION_WORK_MAX_DELIVERY_ATTEMPTS, CONVERSATION_WORK_STALE_ENQUEUE_MS, isFinalAttempt, isInvalidConversationRecordError, type AgentInput, type AttemptFailure, type AppendAndEnqueueInboundMessageResult, type AppendInboundMessageResult, type Conversation, type ConversationExecution, type ConversationWorkLease, type ConversationWorkState, type ExecutionStatus, type InboundMessage, type InboundMessageDelivery, type Lease, type RequestConversationWorkResult, type Source, type StartConversationWorkAcquired, type StartConversationWorkActive, type StartConversationWorkNoWork, type StartConversationWorkResult, } from "@/chat/task-execution/state";
6
6
  import type { AppendAndEnqueueInboundMessageResult, Conversation, InboundMessage } from "@/chat/task-execution/state";
7
7
  export type EnsureConversationWakeResult = {
8
8
  queueMessageId?: string;
9
9
  status: "enqueued";
10
10
  } | {
11
- status: "already_enqueued" | "no_work";
11
+ status: "already_enqueued" | "lease_active" | "no_work";
12
12
  };
13
13
  /** Return a persisted conversation record, if one exists. */
14
14
  export declare function getConversation(args: {
@@ -94,7 +94,30 @@ export declare function checkInConversationWork(args: {
94
94
  export declare function drainConversationMailbox(args: Parameters<typeof workState.drainConversationMailbox>[0] & {
95
95
  conversationStore?: ConversationStore;
96
96
  state?: StateAdapter;
97
- }): Promise<workState.InboundMessage[]>;
97
+ }): Promise<{
98
+ conversationId: string;
99
+ createdAtMs: number;
100
+ delivery: "defer" | "interrupt";
101
+ destination: {
102
+ platform: "slack";
103
+ teamId: string;
104
+ channelId: string;
105
+ } | {
106
+ platform: "local";
107
+ conversationId: string;
108
+ };
109
+ inboundMessageId: string;
110
+ input: {
111
+ text: string;
112
+ attachments?: unknown[] | undefined;
113
+ authorId?: string | undefined;
114
+ metadata?: Record<string, unknown> | undefined;
115
+ };
116
+ receivedAtMs: number;
117
+ source: "slack" | "plugin" | "api" | "local" | "internal" | "resource_event" | "scheduler";
118
+ attemptCount?: number | undefined;
119
+ injectedAtMs?: number | undefined;
120
+ }[]>;
98
121
  /** Acknowledge leased mailbox entries after the handler accepts responsibility. */
99
122
  export declare function ackMessages(args: {
100
123
  conversationId: string;
@@ -113,6 +136,14 @@ export declare function requestConversationContinuation(args: {
113
136
  nowMs?: number;
114
137
  state?: StateAdapter;
115
138
  }): Promise<boolean>;
139
+ /** Begin a requested turn resume without releasing the current lease. */
140
+ export declare function beginConversationResume(args: {
141
+ conversationId: string;
142
+ leaseToken: string;
143
+ conversationStore?: ConversationStore;
144
+ nowMs?: number;
145
+ state?: StateAdapter;
146
+ }): Promise<boolean>;
116
147
  /** Release the durable execution lease without changing completion state. */
117
148
  export declare function releaseConversationWork(args: {
118
149
  conversationId: string;
@@ -4,7 +4,6 @@ import type { ConversationStore } from "@/chat/conversations/store";
4
4
  import { type ConversationQueueMessage, type ConversationWorkQueue } from "./queue";
5
5
  import { type InboundMessage } from "./store";
6
6
  export declare const CONVERSATION_WORK_DEFER_DELAY_MS = 15000;
7
- export declare const CONVERSATION_WORK_SOFT_YIELD_AFTER_MS = 240000;
8
7
  export interface ConversationWorkerContext {
9
8
  attempt: InboxAttempt;
10
9
  checkIn(): Promise<boolean>;
@@ -1,6 +1,6 @@
1
1
  import type { ImageContent, TextContent } from "@earendil-works/pi-ai";
2
- /** Unwrap sandbox envelope and detect structured results. */
3
- export declare function normalizeToolResult(result: unknown, isSandboxResult: boolean, options?: {
2
+ /** Normalize raw tool output into Pi content and structured details. */
3
+ export declare function normalizeToolResult(result: unknown, options?: {
4
4
  requireStructuredResult?: boolean;
5
5
  toolName?: string;
6
6
  }): {
@@ -3,10 +3,10 @@ import { type ConversationPrivacy } from "@/chat/conversation-privacy";
3
3
  import { type LogContext } from "@/chat/logging";
4
4
  import type { PluginAuthOrchestration } from "@/chat/services/plugin-auth-orchestration";
5
5
  import type { AssistantStatusSpec } from "@/chat/slack/assistant-thread/status";
6
- import type { SandboxExecutor } from "@/chat/sandbox/sandbox";
6
+ import type { SandboxTools } from "@/chat/sandbox/sandbox";
7
7
  import type { SkillSandbox } from "@/chat/sandbox/skill-sandbox";
8
8
  import type { AnyToolDefinition } from "@/chat/tools/definition";
9
9
  import type { ToolExecutionReport } from "@/chat/tool-support/tool-execution-report";
10
10
  import type { PluginHookRunner } from "@/chat/plugins/agent-hooks";
11
11
  /** Wrap tool definitions into Pi Agent tool objects with logging, validation, and sandbox execution. */
12
- export declare function createPiAgentTools(tools: Record<string, AnyToolDefinition>, sandbox: SkillSandbox, spanContext: LogContext, onStatus?: (status: AssistantStatusSpec) => void | Promise<void>, sandboxExecutor?: SandboxExecutor, pluginAuthOrchestration?: PluginAuthOrchestration, onToolCall?: (toolCallId: string, toolName: string, params: Record<string, unknown>) => void | Promise<void>, agentHooks?: PluginHookRunner, conversationPrivacy?: ConversationPrivacy, onToolResult?: (report: ToolExecutionReport) => void | Promise<void>): AgentTool[];
12
+ export declare function createPiAgentTools(tools: Record<string, AnyToolDefinition>, sandbox: SkillSandbox, spanContext: LogContext, onStatus?: (status: AssistantStatusSpec) => void | Promise<void>, sandboxTools?: SandboxTools, pluginAuthOrchestration?: PluginAuthOrchestration, onToolCall?: (toolCallId: string, toolName: string, params: Record<string, unknown>) => void | Promise<void>, agentHooks?: PluginHookRunner, conversationPrivacy?: ConversationPrivacy, onToolResult?: (report: ToolExecutionReport) => void | Promise<void>): AgentTool[];
@@ -61,7 +61,7 @@ export interface JuniorToolResultEnvelope<TDetails extends JuniorToolResult = Ju
61
61
  }
62
62
  /** Bind continuation metadata to the exposed runtime tool name. */
63
63
  export declare function injectContinuationToolName(details: JuniorToolResult, toolName: string): JuniorToolResult | JuniorToolResultWithBoundContinuation;
64
- interface JuniorTextToolResultEnvelope<TDetails extends JuniorToolResult = JuniorToolResult> {
64
+ export interface JuniorTextToolResultEnvelope<TDetails extends JuniorToolResult = JuniorToolResult> {
65
65
  content: [TextContent];
66
66
  details: TDetails;
67
67
  }
@@ -70,4 +70,3 @@ export declare function makeStructuredToolResult<TDetails extends JuniorToolResu
70
70
  export declare function makeStructuredToolResult<TDetails extends JuniorToolResult>(details: TDetails, options: {
71
71
  content: Array<TextContent | ImageContent>;
72
72
  }): JuniorToolResultEnvelope<TDetails>;
73
- export {};
@@ -48,5 +48,5 @@ export declare function sandboxArtifactPath(filename: string): string;
48
48
  /** Infer upload MIME type from an explicit value or filename extension. */
49
49
  export declare function inferMimeType(filename: string, explicitMimeType?: string): string;
50
50
  /** Read and validate one sandbox file for Slack/file reply upload. */
51
- export declare function readSandboxFileUpload(sandbox: SandboxWorkspace, input: SandboxFileMaterializationInput): Promise<SandboxFileUpload>;
51
+ export declare function readSandboxFileUpload(workspace: SandboxWorkspace, input: SandboxFileMaterializationInput): Promise<SandboxFileUpload>;
52
52
  export {};
@@ -1,8 +1,8 @@
1
1
  import type { FileUpload } from "chat";
2
2
  import { type GeneratedArtifactFileRef } from "@/chat/tools/sandbox/file-uploads";
3
3
  import type { SandboxCommandResult } from "@/chat/sandbox/workspace";
4
- /** Sandbox operations needed to make generated artifacts visible to later tools. */
5
- export interface GeneratedArtifactSandbox {
4
+ /** Workspace operations needed to make generated artifacts visible to later tools. */
5
+ export interface GeneratedArtifactWorkspace {
6
6
  runCommand(input: {
7
7
  args?: string[];
8
8
  cmd: string;
@@ -13,4 +13,4 @@ export interface GeneratedArtifactSandbox {
13
13
  }>): Promise<void>;
14
14
  }
15
15
  /** Persist generated artifacts into the sandbox before returning model-visible handles. */
16
- export declare function writeSandboxGeneratedArtifacts(sandbox: GeneratedArtifactSandbox, files: FileUpload[]): Promise<GeneratedArtifactFileRef[]>;
16
+ export declare function writeSandboxGeneratedArtifacts(workspace: GeneratedArtifactWorkspace, files: FileUpload[]): Promise<GeneratedArtifactFileRef[]>;
@@ -69,7 +69,7 @@ interface BaseToolRuntimeContext {
69
69
  configuration?: Record<string, unknown>;
70
70
  egress: PluginEgress;
71
71
  mcpToolManager?: McpToolManager;
72
- sandbox: SandboxWorkspace;
72
+ workspace: SandboxWorkspace;
73
73
  }
74
74
  interface SlackToolRuntimeContext extends BaseToolRuntimeContext {
75
75
  destination: SlackDestination;
@@ -17,6 +17,11 @@ export type WebFetchResponse = {
17
17
  extracted_chars: number;
18
18
  truncated: boolean;
19
19
  } & Record<string, unknown>;
20
+ /** Apply the web-fetch character limit to already extracted text content. */
21
+ export declare function truncateWebFetchContent(content: string, maxChars: number): {
22
+ content: string;
23
+ truncated: boolean;
24
+ };
20
25
  /** Extract readable content and metadata from a fetched response body. */
21
26
  export declare function extractContentDetails(body: string, contentType: string, maxChars: number): WebFetchResponseContent;
22
27
  /** Extract readable content from a fetched response body, converting HTML to markdown. */
@@ -1,6 +1,7 @@
1
1
  import type { ImageGenerateToolDeps, ToolHooks } from "@/chat/tools/types";
2
2
  /** Create the image tool with sandbox artifact guidance matched to file-send capability. */
3
- export declare function createImageGenerateTool(hooks: Required<Pick<ToolHooks, "writeGeneratedArtifacts">>, options?: {
3
+ export declare function createImageGenerateTool(hooks: Required<Pick<ToolHooks, "writeGeneratedArtifacts">>, options: {
4
+ modelId: string;
4
5
  canSendFilesToActiveConversation?: boolean;
5
6
  }, deps?: ImageGenerateToolDeps): Omit<import("../definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
6
7
  inputSchema: import("../definition").JsonSchemaObject;
@@ -1,5 +1,5 @@
1
1
  import type { WebSearchToolDeps } from "@/chat/tools/types";
2
- export declare function createWebSearchTool(override?: WebSearchToolDeps): Omit<import("../definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
2
+ export declare function createWebSearchTool(modelId: string, override?: WebSearchToolDeps): Omit<import("../definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
3
3
  inputSchema: import("../definition").JsonSchemaObject;
4
4
  outputSchema: import("../definition").JsonSchemaObject;
5
5
  prepareArguments(args: unknown): {