@sentry/junior 0.126.1 → 0.128.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 (124) hide show
  1. package/dist/{agent-hooks-U5YGLX6Y.js → agent-hooks-F75ANGBV.js} +9 -9
  2. package/dist/api/people/spend.d.ts +4 -0
  3. package/dist/api/people/spend.query.d.ts +3 -0
  4. package/dist/api/schema/person.d.ts +9 -0
  5. package/dist/api/schema.d.ts +2 -2
  6. package/dist/api/schema.js +3 -1
  7. package/dist/api.js +141 -40
  8. package/dist/app.js +289 -146
  9. package/dist/{catalog-runtime-OUPLWD7F.js → catalog-runtime-ZPSA5QM2.js} +6 -6
  10. package/dist/chat/agent-dispatch/context.d.ts +17 -0
  11. package/dist/chat/agent-dispatch/store.d.ts +1 -1
  12. package/dist/chat/agent-dispatch/work.d.ts +1 -1
  13. package/dist/chat/credentials/context.d.ts +27 -0
  14. package/dist/chat/credentials/subject.d.ts +15 -0
  15. package/dist/chat/event-tasks/ingest.d.ts +9 -0
  16. package/dist/chat/event-tasks/store.d.ts +15 -0
  17. package/dist/chat/event-tasks/tool-support.d.ts +140 -0
  18. package/dist/chat/event-tasks/types.d.ts +44 -0
  19. package/dist/chat/plugins/agent-hooks.d.ts +4 -2
  20. package/dist/chat/plugins/viewer.d.ts +16 -0
  21. package/dist/chat/resource-events/catalog.d.ts +21 -0
  22. package/dist/chat/resource-events/ingest.d.ts +2 -1
  23. package/dist/chat/resource-events/notification.d.ts +2 -2
  24. package/dist/chat/resource-events/store.d.ts +11 -9
  25. package/dist/chat/resource-events/tool-support.d.ts +10 -0
  26. package/dist/chat/resource-events/workspace.d.ts +4 -0
  27. package/dist/chat/sandbox/command-result.d.ts +3 -22
  28. package/dist/chat/sandbox/egress/schemas.d.ts +11 -0
  29. package/dist/chat/services/guardian-action-policy.d.ts +1 -1
  30. package/dist/chat/slack/dispatch-turn.d.ts +1 -1
  31. package/dist/chat/slack/tools/canvas/create.d.ts +0 -16
  32. package/dist/chat/slack/tools/canvas/edit.d.ts +0 -16
  33. package/dist/chat/slack/tools/canvas/read.d.ts +0 -16
  34. package/dist/chat/slack/tools/canvas/write.d.ts +0 -16
  35. package/dist/chat/slack/tools/channel-list-messages.d.ts +0 -16
  36. package/dist/chat/slack/tools/conversation-search.d.ts +0 -16
  37. package/dist/chat/slack/tools/list/add-items.d.ts +0 -16
  38. package/dist/chat/slack/tools/list/create.d.ts +0 -16
  39. package/dist/chat/slack/tools/list/get-items.d.ts +0 -16
  40. package/dist/chat/slack/tools/list/update-item.d.ts +0 -16
  41. package/dist/chat/slack/tools/message-add-reaction.d.ts +0 -16
  42. package/dist/chat/slack/tools/public-search.d.ts +0 -16
  43. package/dist/chat/slack/tools/send-files.d.ts +10 -28
  44. package/dist/chat/slack/tools/thread-read.d.ts +0 -16
  45. package/dist/chat/slack/tools/user-lookup.d.ts +0 -16
  46. package/dist/chat/task-execution/slack-work.d.ts +4 -4
  47. package/dist/chat/tool-support/action-review.d.ts +1 -1
  48. package/dist/chat/tool-support/structured-result.d.ts +17 -46
  49. package/dist/chat/tool-support/text-range-result.d.ts +8 -32
  50. package/dist/chat/tool-support/zod-tool.d.ts +6 -7
  51. package/dist/chat/tools/create-event-task.d.ts +65 -0
  52. package/dist/chat/tools/definition.d.ts +4 -0
  53. package/dist/chat/tools/delete-event-task.d.ts +57 -0
  54. package/dist/chat/tools/event-tasks.d.ts +5 -0
  55. package/dist/chat/tools/handoff/tool.d.ts +0 -16
  56. package/dist/chat/tools/list-event-tasks.d.ts +55 -0
  57. package/dist/chat/tools/list-resource-event-subscriptions.d.ts +42 -0
  58. package/dist/chat/tools/query-conversation-events.d.ts +0 -16
  59. package/dist/chat/tools/resource-events.d.ts +2 -1
  60. package/dist/chat/tools/runtime/report-progress.d.ts +0 -16
  61. package/dist/chat/tools/sandbox/edit-file.d.ts +0 -23
  62. package/dist/chat/tools/sandbox/file-utils.d.ts +2 -17
  63. package/dist/chat/tools/sandbox/find-files.d.ts +5 -8
  64. package/dist/chat/tools/sandbox/grep.d.ts +1 -4
  65. package/dist/chat/tools/sandbox/list-dir.d.ts +1 -4
  66. package/dist/chat/tools/search-resource-event-types.d.ts +44 -0
  67. package/dist/chat/tools/search-tools.d.ts +0 -16
  68. package/dist/chat/tools/skill/load-skill.d.ts +0 -20
  69. package/dist/chat/tools/skill/search-mcp-tools.d.ts +0 -16
  70. package/dist/chat/tools/stop-watching-resources.d.ts +28 -0
  71. package/dist/chat/tools/system-time.d.ts +0 -16
  72. package/dist/chat/tools/types.d.ts +8 -4
  73. package/dist/chat/tools/update-event-task.d.ts +66 -0
  74. package/dist/chat/tools/watch-resource-events.d.ts +59 -0
  75. package/dist/chat/tools/web/fetch-content.d.ts +0 -2
  76. package/dist/chat/tools/web/fetch-tool.d.ts +0 -16
  77. package/dist/chat/tools/web/image-generate.d.ts +0 -16
  78. package/dist/chat/tools/web/search.d.ts +0 -16
  79. package/dist/{chunk-QVSYR5CV.js → chunk-2HTHX6XV.js} +4 -4
  80. package/dist/{chunk-Y2QRKPI7.js → chunk-3PKF6YNU.js} +1 -1
  81. package/dist/{chunk-GLNB2R42.js → chunk-5KKIBIIP.js} +12 -12
  82. package/dist/{chunk-W3U3YQYI.js → chunk-77VDLF3Z.js} +18 -1
  83. package/dist/{chunk-YZHA2L7P.js → chunk-A76LKS5W.js} +230 -102
  84. package/dist/{chunk-6ZBSTNYN.js → chunk-AFJF3RGU.js} +9 -0
  85. package/dist/{chunk-PD6J33TO.js → chunk-B6E3YA2H.js} +1 -1
  86. package/dist/{chunk-S4LM6UB7.js → chunk-B7FPRGUJ.js} +3 -3
  87. package/dist/{chunk-R3GXQJEE.js → chunk-BY43CEXN.js} +2 -2
  88. package/dist/{chunk-HDSDCEPK.js → chunk-EPBBYMNE.js} +1 -1
  89. package/dist/{chunk-YFE6VNHU.js → chunk-FJEIX3AH.js} +2 -2
  90. package/dist/{chunk-F2ARYRKC.js → chunk-G6XQODHM.js} +1 -1
  91. package/dist/{chunk-KBW6J5GA.js → chunk-HBFQLSGV.js} +4 -4
  92. package/dist/{chunk-YUPNY2HZ.js → chunk-JDCPDJ54.js} +2 -2
  93. package/dist/{chunk-WIIPHGJY.js → chunk-K5ZB3WWH.js} +2 -2
  94. package/dist/{chunk-OG6E44DH.js → chunk-KNRODVH2.js} +6 -6
  95. package/dist/{chunk-W3JHZHAN.js → chunk-KTGJAWRO.js} +1 -1
  96. package/dist/{chunk-7VF3JAVF.js → chunk-NHWE6Y7G.js} +7 -7
  97. package/dist/{chunk-HXWOZ4HG.js → chunk-OLGB5Y7R.js} +2 -2
  98. package/dist/{chunk-QMK2VF6K.js → chunk-PBWUUVVG.js} +1 -1
  99. package/dist/{chunk-7ZMY4GCG.js → chunk-RYWMDDWK.js} +1 -1
  100. package/dist/{chunk-S4PUICSB.js → chunk-SHMHHXD5.js} +34 -5
  101. package/dist/{chunk-JKV244BI.js → chunk-WZ365SQC.js} +1 -1
  102. package/dist/{chunk-SD2VFSN6.js → chunk-YY6CVET7.js} +1428 -1116
  103. package/dist/{chunk-U36WL4OL.js → chunk-Z4KTQMWW.js} +1 -1
  104. package/dist/cli/chat.js +27 -27
  105. package/dist/cli/check.js +7 -7
  106. package/dist/cli/plugins.js +13 -13
  107. package/dist/cli/snapshot-create.js +10 -10
  108. package/dist/cli/upgrade.js +8 -8
  109. package/dist/db/schema/event-tasks.d.ts +161 -0
  110. package/dist/db/schema.d.ts +163 -1
  111. package/dist/{db-FQID26JW.js → db-FYJYPAKG.js} +7 -7
  112. package/dist/instrumentation.js +4 -4
  113. package/dist/nitro.js +2 -2
  114. package/dist/{oauth-callback-server-Z5MHHKFD.js → oauth-callback-server-W3PPIHCS.js} +18 -18
  115. package/dist/{runner-PGPGKYSF.js → runner-5NOFUYKR.js} +11 -11
  116. package/dist/{sandbox-egress-signals-CDFAP67O.js → sandbox-egress-signals-A5HWIQH4.js} +2 -2
  117. package/dist/{skills-BCQHR636.js → skills-ENIBKF5V.js} +7 -7
  118. package/dist/{validation-QP3FYBLZ.js → validation-BHLBOO6K.js} +7 -7
  119. package/dist/version.js +1 -1
  120. package/migrations/0015_magical_ezekiel_stane.sql +11 -0
  121. package/migrations/meta/0015_snapshot.json +1360 -0
  122. package/migrations/meta/_journal.json +7 -0
  123. package/package.json +5 -5
  124. package/dist/chat/plugins/viewer-actors.d.ts +0 -6
@@ -9,64 +9,35 @@ export declare const juniorToolBoundContinuationSchema: z.ZodObject<{
9
9
  reason: z.ZodOptional<z.ZodString>;
10
10
  tool_name: z.ZodString;
11
11
  }, z.core.$strict>;
12
- export declare const juniorToolErrorSchema: z.ZodObject<{
13
- kind: z.ZodString;
14
- message: z.ZodString;
15
- retryable: z.ZodOptional<z.ZodBoolean>;
16
- }, z.core.$strict>;
17
- export declare const juniorToolResultSchema: z.ZodObject<{
18
- ok: z.ZodBoolean;
19
- status: z.ZodEnum<{
20
- error: "error";
21
- success: "success";
22
- }>;
23
- target: z.ZodOptional<z.ZodString>;
24
- data: z.ZodOptional<z.ZodUnknown>;
25
- truncated: z.ZodOptional<z.ZodBoolean>;
26
- continuation: z.ZodOptional<z.ZodObject<{
27
- arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
28
- reason: z.ZodOptional<z.ZodString>;
29
- }, z.core.$strict>>;
30
- error: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
31
- kind: z.ZodString;
32
- message: z.ZodString;
33
- retryable: z.ZodOptional<z.ZodBoolean>;
34
- }, z.core.$strict>, z.ZodString]>>;
35
- }, z.core.$loose>;
36
- export declare const juniorToolResultWithBoundContinuationSchema: z.ZodObject<{
37
- ok: z.ZodBoolean;
38
- status: z.ZodEnum<{
39
- error: "error";
40
- success: "success";
41
- }>;
12
+ /** Shared optional fields for canonical Junior tool outputs. */
13
+ export declare const juniorToolOutputSchema: z.ZodObject<{
42
14
  target: z.ZodOptional<z.ZodString>;
43
- data: z.ZodOptional<z.ZodUnknown>;
44
15
  truncated: z.ZodOptional<z.ZodBoolean>;
45
- error: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
46
- kind: z.ZodString;
47
- message: z.ZodString;
48
- retryable: z.ZodOptional<z.ZodBoolean>;
49
- }, z.core.$strict>, z.ZodString]>>;
50
16
  continuation: z.ZodOptional<z.ZodObject<{
51
17
  arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
52
18
  reason: z.ZodOptional<z.ZodString>;
53
- tool_name: z.ZodString;
54
19
  }, z.core.$strict>>;
55
20
  }, z.core.$loose>;
56
- export type JuniorToolResult = z.output<typeof juniorToolResultSchema>;
57
- export type JuniorToolResultWithBoundContinuation = z.output<typeof juniorToolResultWithBoundContinuationSchema>;
58
- export interface JuniorToolResultEnvelope<TDetails extends JuniorToolResult = JuniorToolResult> {
21
+ export type JuniorToolOutput = z.output<typeof juniorToolOutputSchema>;
22
+ export interface JuniorToolOutputEnvelope<TDetails = unknown> {
59
23
  content: [TextContent, ...(TextContent | ImageContent)[]];
60
24
  details: TDetails;
61
25
  }
62
26
  /** Bind continuation metadata to the exposed runtime tool name. */
63
- export declare function injectContinuationToolName(details: JuniorToolResult, toolName: string): JuniorToolResult | JuniorToolResultWithBoundContinuation;
64
- export interface JuniorTextToolResultEnvelope<TDetails extends JuniorToolResult = JuniorToolResult> {
27
+ export declare function injectContinuationToolName(details: unknown, toolName: string): unknown;
28
+ export interface JuniorTextToolOutputEnvelope<TDetails = unknown> {
65
29
  content: [TextContent];
66
30
  details: TDetails;
67
31
  }
68
- /** Create the Pi-compatible transport envelope from one structured result object. */
69
- export declare function makeStructuredToolResult<TDetails extends JuniorToolResult>(details: TDetails): JuniorTextToolResultEnvelope<TDetails>;
70
- export declare function makeStructuredToolResult<TDetails extends JuniorToolResult>(details: TDetails, options: {
32
+ /**
33
+ * Project one canonical tool output onto Pi's native result channels.
34
+ *
35
+ * This follows the Codex tool-result model: `details` remains the authoritative
36
+ * typed value, while `content` is its model-facing serialization. Telemetry and
37
+ * execution success or failure are separate runtime projections and must not be
38
+ * embedded in the tool output.
39
+ */
40
+ export declare function makeStructuredToolOutput<TDetails>(details: TDetails): JuniorTextToolOutputEnvelope<TDetails>;
41
+ export declare function makeStructuredToolOutput<TDetails>(details: TDetails, options: {
71
42
  content: Array<TextContent | ImageContent>;
72
- }): JuniorToolResultEnvelope<TDetails>;
43
+ }): JuniorToolOutputEnvelope<TDetails>;
@@ -4,17 +4,13 @@ interface TextRangeResult {
4
4
  text: string;
5
5
  }];
6
6
  details: {
7
- ok: true;
8
- status: "success";
9
7
  target: string;
10
- data: {
11
- content: string;
12
- end_line?: number;
13
- path: string;
14
- start_line: number;
15
- total_lines: number;
16
- truncation_reasons?: string[];
17
- };
8
+ content: string;
9
+ end_line?: number;
10
+ path: string;
11
+ start_line: number;
12
+ total_lines: number;
13
+ truncation_reasons?: string[];
18
14
  truncated: boolean;
19
15
  character_limit_reached?: number;
20
16
  line_truncated?: boolean;
@@ -28,26 +24,6 @@ interface TextRangeResult {
28
24
  };
29
25
  };
30
26
  }
31
- interface TextRangeMissingPathResult {
32
- content: [{
33
- type: "text";
34
- text: string;
35
- }];
36
- details: {
37
- ok: false;
38
- status: "error";
39
- target: string;
40
- data: {
41
- content: "";
42
- path: string;
43
- };
44
- error: {
45
- kind: "not_found";
46
- message: string;
47
- };
48
- truncated: false;
49
- };
50
- }
51
27
  /** Return a bounded line window so large files can be read incrementally. */
52
28
  export declare function sliceFileContent(params: {
53
29
  content: string;
@@ -56,6 +32,6 @@ export declare function sliceFileContent(params: {
56
32
  offset?: unknown;
57
33
  path: string;
58
34
  }): TextRangeResult;
59
- /** Return a model-visible result for expected missing read targets. */
60
- export declare function missingFileResult(path: string): TextRangeMissingPathResult;
35
+ /** Reject an expected missing read target through the tool-error channel. */
36
+ export declare function missingFileResult(path: string): never;
61
37
  export {};
@@ -1,5 +1,4 @@
1
- import { z, type ZodType, type ZodTypeAny } from "zod";
2
- import { type JuniorToolResult } from "@/chat/tool-support/structured-result";
1
+ import { z, type ZodTypeAny } from "zod";
3
2
  import type { ImageContent, TextContent } from "@earendil-works/pi-ai";
4
3
  import type { AnyToolDefinition, JsonSchemaObject, ToolExecuteOptions } from "@/chat/tools/definition";
5
4
  type ZodToolDefinitionBase<TInputSchema extends ZodTypeAny> = Pick<AnyToolDefinition, "approvalMode" | "identity" | "source" | "description" | "exposure" | "annotations" | "promptSnippet" | "promptGuidelines" | "executionMode"> & {
@@ -8,7 +7,7 @@ type ZodToolDefinitionBase<TInputSchema extends ZodTypeAny> = Pick<AnyToolDefini
8
7
  prepareArguments?: (args: unknown) => z.input<TInputSchema>;
9
8
  resolveApprovalMetadata?(input: z.output<TInputSchema>): ReturnType<NonNullable<AnyToolDefinition["resolveApprovalMetadata"]>>;
10
9
  };
11
- type StructuredToolExecuteResult<TOutputSchema extends ZodType<JuniorToolResult>> = z.input<TOutputSchema> | StructuredToolResultEnvelope<z.input<TOutputSchema>>;
10
+ type StructuredToolExecuteResult<TOutputSchema extends ZodTypeAny> = z.input<TOutputSchema> | StructuredToolResultEnvelope<z.input<TOutputSchema>>;
12
11
  interface StructuredToolResultEnvelope<TDetails> {
13
12
  content: Array<TextContent | ImageContent>;
14
13
  details: TDetails;
@@ -17,7 +16,7 @@ export interface ContentOnlyToolResult {
17
16
  content: Array<TextContent | ImageContent>;
18
17
  details?: never;
19
18
  }
20
- type StructuredZodToolDefinition<TInputSchema extends ZodTypeAny, TOutputSchema extends ZodType<JuniorToolResult>, TExecuteResult extends StructuredToolExecuteResult<TOutputSchema>> = ZodToolDefinitionBase<TInputSchema> & {
19
+ type StructuredZodToolDefinition<TInputSchema extends ZodTypeAny, TOutputSchema extends ZodTypeAny, TExecuteResult extends StructuredToolExecuteResult<TOutputSchema>> = ZodToolDefinitionBase<TInputSchema> & {
21
20
  outputSchema: TOutputSchema;
22
21
  privateTraceResult?(result: z.output<TOutputSchema>): unknown;
23
22
  execute?: (input: z.output<TInputSchema>, options: ToolExecuteOptions) => Promise<TExecuteResult> | TExecuteResult;
@@ -26,8 +25,8 @@ type ContentZodToolDefinition<TInputSchema extends ZodTypeAny> = ZodToolDefiniti
26
25
  outputSchema?: undefined;
27
26
  execute?: (input: z.output<TInputSchema>, options: ToolExecuteOptions) => Promise<ContentOnlyToolResult> | ContentOnlyToolResult;
28
27
  };
29
- type ParsedStructuredToolExecuteResult<TOutputSchema extends ZodType<JuniorToolResult>, TExecuteResult> = TExecuteResult extends StructuredToolResultEnvelope<unknown> ? StructuredToolResultEnvelope<z.output<TOutputSchema>> : z.output<TOutputSchema>;
30
- type StructuredZodTool<TInputSchema extends ZodTypeAny, TOutputSchema extends ZodType<JuniorToolResult>, TExecuteResult> = Omit<AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
28
+ type ParsedStructuredToolExecuteResult<TOutputSchema extends ZodTypeAny, TExecuteResult> = TExecuteResult extends StructuredToolResultEnvelope<unknown> ? StructuredToolResultEnvelope<z.output<TOutputSchema>> : z.output<TOutputSchema>;
29
+ type StructuredZodTool<TInputSchema extends ZodTypeAny, TOutputSchema extends ZodTypeAny, TExecuteResult> = Omit<AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
31
30
  inputSchema: JsonSchemaObject;
32
31
  outputSchema: JsonSchemaObject;
33
32
  prepareArguments(args: unknown): z.output<TInputSchema>;
@@ -42,6 +41,6 @@ type ContentZodTool<TInputSchema extends ZodTypeAny> = Omit<AnyToolDefinition, "
42
41
  /**
43
42
  * Define a Junior-owned tool with Zod input parsing and JSON Schema parameters.
44
43
  */
45
- export declare function zodTool<TInputSchema extends ZodTypeAny, TOutputSchema extends ZodType<JuniorToolResult>, TExecuteResult extends StructuredToolExecuteResult<TOutputSchema>>(definition: StructuredZodToolDefinition<TInputSchema, TOutputSchema, TExecuteResult>): StructuredZodTool<TInputSchema, TOutputSchema, TExecuteResult>;
44
+ export declare function zodTool<TInputSchema extends ZodTypeAny, TOutputSchema extends ZodTypeAny, TExecuteResult extends StructuredToolExecuteResult<TOutputSchema>>(definition: StructuredZodToolDefinition<TInputSchema, TOutputSchema, TExecuteResult>): StructuredZodTool<TInputSchema, TOutputSchema, TExecuteResult>;
46
45
  export declare function zodTool<TInputSchema extends ZodTypeAny>(definition: ContentZodToolDefinition<TInputSchema>): ContentZodTool<TInputSchema>;
47
46
  export {};
@@ -0,0 +1,65 @@
1
+ import { type ResourceEventCatalog } from "@/chat/resource-events/catalog";
2
+ import type { ToolRuntimeContext } from "@/chat/tools/types";
3
+ /** Create the core tool that stores an event task. */
4
+ export declare function createEventTaskTool(context: ToolRuntimeContext, catalog: ResourceEventCatalog): Omit<import("./definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
5
+ inputSchema: import("./definition").JsonSchemaObject;
6
+ outputSchema: import("./definition").JsonSchemaObject;
7
+ prepareArguments(args: unknown): {
8
+ task: string;
9
+ trigger: {
10
+ namespace: string;
11
+ identifier: string;
12
+ resourceType: string;
13
+ label: string;
14
+ events: string[];
15
+ };
16
+ credentialMode?: "system" | "creator" | null | undefined;
17
+ };
18
+ execute?: ((input: unknown, options: import("./definition").ToolExecuteOptions) => {
19
+ task: {
20
+ id: string;
21
+ task: string;
22
+ namespace: string;
23
+ identifier: string;
24
+ resourceType: string;
25
+ label: string;
26
+ events: string[];
27
+ credentialMode: "system" | "creator";
28
+ createdBy: {
29
+ slackUserId: string;
30
+ fullName?: string | undefined;
31
+ userName?: string | undefined;
32
+ };
33
+ triggerAvailable: boolean;
34
+ };
35
+ target?: string | undefined;
36
+ truncated?: boolean | undefined;
37
+ continuation?: {
38
+ arguments: Record<string, unknown>;
39
+ reason?: string | undefined;
40
+ } | undefined;
41
+ } | Promise<{
42
+ task: {
43
+ id: string;
44
+ task: string;
45
+ namespace: string;
46
+ identifier: string;
47
+ resourceType: string;
48
+ label: string;
49
+ events: string[];
50
+ credentialMode: "system" | "creator";
51
+ createdBy: {
52
+ slackUserId: string;
53
+ fullName?: string | undefined;
54
+ userName?: string | undefined;
55
+ };
56
+ triggerAvailable: boolean;
57
+ };
58
+ target?: string | undefined;
59
+ truncated?: boolean | undefined;
60
+ continuation?: {
61
+ arguments: Record<string, unknown>;
62
+ reason?: string | undefined;
63
+ } | undefined;
64
+ }>) | undefined;
65
+ };
@@ -60,6 +60,8 @@ interface BaseToolDefinition<TInput, TInputSchema extends ToolInputSchema> exten
60
60
  * Return trusted host metadata for the exact dispatched action.
61
61
  *
62
62
  * Descriptions and annotations inform review; they do not grant authority.
63
+ * This projection runs before action review and must not activate providers
64
+ * or perform other external side effects.
63
65
  */
64
66
  resolveApprovalMetadata?(input: TInput): Promise<ToolApprovalResolution | undefined> | ToolApprovalResolution | undefined;
65
67
  executionMode?: ToolExecutionMode;
@@ -106,6 +108,8 @@ export interface AnyToolDefinition extends ToolApprovalMetadata {
106
108
  * Return trusted host metadata for the exact dispatched action.
107
109
  *
108
110
  * Descriptions and annotations inform review; they do not grant authority.
111
+ * This projection runs before action review and must not activate providers
112
+ * or perform other external side effects.
109
113
  */
110
114
  resolveApprovalMetadata?(input: unknown): Promise<ToolApprovalResolution | undefined> | ToolApprovalResolution | undefined;
111
115
  }
@@ -0,0 +1,57 @@
1
+ import type { ResourceEventCatalog } from "@/chat/resource-events/catalog";
2
+ import type { ToolRuntimeContext } from "@/chat/tools/types";
3
+ /** Create the core tool that deletes an event task in this destination. */
4
+ export declare function createDeleteEventTaskTool(context: ToolRuntimeContext, catalog: ResourceEventCatalog): Omit<import("./definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
5
+ inputSchema: import("./definition").JsonSchemaObject;
6
+ outputSchema: import("./definition").JsonSchemaObject;
7
+ prepareArguments(args: unknown): {
8
+ taskId: string;
9
+ };
10
+ execute?: ((input: unknown, options: import("./definition").ToolExecuteOptions) => {
11
+ task: {
12
+ id: string;
13
+ task: string;
14
+ namespace: string;
15
+ identifier: string;
16
+ resourceType: string;
17
+ label: string;
18
+ events: string[];
19
+ credentialMode: "system" | "creator";
20
+ createdBy: {
21
+ slackUserId: string;
22
+ fullName?: string | undefined;
23
+ userName?: string | undefined;
24
+ };
25
+ triggerAvailable: boolean;
26
+ };
27
+ target?: string | undefined;
28
+ truncated?: boolean | undefined;
29
+ continuation?: {
30
+ arguments: Record<string, unknown>;
31
+ reason?: string | undefined;
32
+ } | undefined;
33
+ } | Promise<{
34
+ task: {
35
+ id: string;
36
+ task: string;
37
+ namespace: string;
38
+ identifier: string;
39
+ resourceType: string;
40
+ label: string;
41
+ events: string[];
42
+ credentialMode: "system" | "creator";
43
+ createdBy: {
44
+ slackUserId: string;
45
+ fullName?: string | undefined;
46
+ userName?: string | undefined;
47
+ };
48
+ triggerAvailable: boolean;
49
+ };
50
+ target?: string | undefined;
51
+ truncated?: boolean | undefined;
52
+ continuation?: {
53
+ arguments: Record<string, unknown>;
54
+ reason?: string | undefined;
55
+ } | undefined;
56
+ }>) | undefined;
57
+ };
@@ -0,0 +1,5 @@
1
+ import type { ResourceEventCatalog } from "@/chat/resource-events/catalog";
2
+ import type { ToolRegistry } from "@/chat/tools/definition";
3
+ import type { ToolRuntimeContext } from "@/chat/tools/types";
4
+ /** Build event task tools for an interactive Slack actor. */
5
+ export declare function createEventTaskTools(context: ToolRuntimeContext, catalog: ResourceEventCatalog): ToolRegistry;
@@ -9,37 +9,21 @@ export declare function createHandoffTool(handoff: NonNullable<ToolRuntimeContex
9
9
  };
10
10
  execute?: ((input: unknown, options: import("../definition").ToolExecuteOptions) => {
11
11
  [x: string]: unknown;
12
- ok: boolean;
13
- status: "error" | "success";
14
12
  model_profile: string;
15
13
  target?: string | undefined;
16
- data?: unknown;
17
14
  truncated?: boolean | undefined;
18
15
  continuation?: {
19
16
  arguments: Record<string, unknown>;
20
17
  reason?: string | undefined;
21
18
  } | undefined;
22
- error?: string | {
23
- kind: string;
24
- message: string;
25
- retryable?: boolean | undefined;
26
- } | undefined;
27
19
  } | Promise<{
28
20
  [x: string]: unknown;
29
- ok: boolean;
30
- status: "error" | "success";
31
21
  model_profile: string;
32
22
  target?: string | undefined;
33
- data?: unknown;
34
23
  truncated?: boolean | undefined;
35
24
  continuation?: {
36
25
  arguments: Record<string, unknown>;
37
26
  reason?: string | undefined;
38
27
  } | undefined;
39
- error?: string | {
40
- kind: string;
41
- message: string;
42
- retryable?: boolean | undefined;
43
- } | undefined;
44
28
  }>) | undefined;
45
29
  };
@@ -0,0 +1,55 @@
1
+ import type { ResourceEventCatalog } from "@/chat/resource-events/catalog";
2
+ import type { ToolRuntimeContext } from "@/chat/tools/types";
3
+ /** Create the core tool that lists event tasks for this destination. */
4
+ export declare function createListEventTasksTool(context: ToolRuntimeContext, catalog: ResourceEventCatalog): Omit<import("./definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
5
+ inputSchema: import("./definition").JsonSchemaObject;
6
+ outputSchema: import("./definition").JsonSchemaObject;
7
+ prepareArguments(args: unknown): Record<string, never>;
8
+ execute?: ((input: unknown, options: import("./definition").ToolExecuteOptions) => {
9
+ tasks: {
10
+ id: string;
11
+ task: string;
12
+ namespace: string;
13
+ identifier: string;
14
+ resourceType: string;
15
+ label: string;
16
+ events: string[];
17
+ credentialMode: "system" | "creator";
18
+ createdBy: {
19
+ slackUserId: string;
20
+ fullName?: string | undefined;
21
+ userName?: string | undefined;
22
+ };
23
+ triggerAvailable: boolean;
24
+ }[];
25
+ truncated: boolean;
26
+ target?: string | undefined;
27
+ continuation?: {
28
+ arguments: Record<string, unknown>;
29
+ reason?: string | undefined;
30
+ } | undefined;
31
+ } | Promise<{
32
+ tasks: {
33
+ id: string;
34
+ task: string;
35
+ namespace: string;
36
+ identifier: string;
37
+ resourceType: string;
38
+ label: string;
39
+ events: string[];
40
+ credentialMode: "system" | "creator";
41
+ createdBy: {
42
+ slackUserId: string;
43
+ fullName?: string | undefined;
44
+ userName?: string | undefined;
45
+ };
46
+ triggerAvailable: boolean;
47
+ }[];
48
+ truncated: boolean;
49
+ target?: string | undefined;
50
+ continuation?: {
51
+ arguments: Record<string, unknown>;
52
+ reason?: string | undefined;
53
+ } | undefined;
54
+ }>) | undefined;
55
+ };
@@ -0,0 +1,42 @@
1
+ import type { ToolRuntimeContext } from "@/chat/tools/types";
2
+ /** Create the tool that lists active resource watches for this conversation. */
3
+ export declare function createListResourceEventSubscriptionsTool(context: ToolRuntimeContext): Omit<import("./definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
4
+ inputSchema: import("./definition").JsonSchemaObject;
5
+ outputSchema: import("./definition").JsonSchemaObject;
6
+ prepareArguments(args: unknown): Record<string, never>;
7
+ execute?: ((input: unknown, options: import("./definition").ToolExecuteOptions) => {
8
+ subscriptions: {
9
+ id: string;
10
+ label: string;
11
+ identifier: string;
12
+ namespace: string;
13
+ resourceType: string;
14
+ events: string[];
15
+ intent: string;
16
+ expiresAtMs: number;
17
+ }[];
18
+ target?: string | undefined;
19
+ truncated?: boolean | undefined;
20
+ continuation?: {
21
+ arguments: Record<string, unknown>;
22
+ reason?: string | undefined;
23
+ } | undefined;
24
+ } | Promise<{
25
+ subscriptions: {
26
+ id: string;
27
+ label: string;
28
+ identifier: string;
29
+ namespace: string;
30
+ resourceType: string;
31
+ events: string[];
32
+ intent: string;
33
+ expiresAtMs: number;
34
+ }[];
35
+ target?: string | undefined;
36
+ truncated?: boolean | undefined;
37
+ continuation?: {
38
+ arguments: Record<string, unknown>;
39
+ reason?: string | undefined;
40
+ } | undefined;
41
+ }>) | undefined;
42
+ };
@@ -13,8 +13,6 @@ export declare function createQueryConversationEventsTool(context: ToolRuntimeCo
13
13
  };
14
14
  execute?: ((input: unknown, options: import("./definition").ToolExecuteOptions) => {
15
15
  [x: string]: unknown;
16
- ok: boolean;
17
- status: "error" | "success";
18
16
  conversation_id: string;
19
17
  events: {
20
18
  seq: number;
@@ -26,22 +24,14 @@ export declare function createQueryConversationEventsTool(context: ToolRuntimeCo
26
24
  has_older: boolean;
27
25
  has_newer: boolean;
28
26
  target?: string | undefined;
29
- data?: unknown;
30
27
  truncated?: boolean | undefined;
31
28
  continuation?: {
32
29
  arguments: Record<string, unknown>;
33
30
  reason?: string | undefined;
34
31
  } | undefined;
35
- error?: string | {
36
- kind: string;
37
- message: string;
38
- retryable?: boolean | undefined;
39
- } | undefined;
40
32
  omitted_event_count?: number | undefined;
41
33
  } | Promise<{
42
34
  [x: string]: unknown;
43
- ok: boolean;
44
- status: "error" | "success";
45
35
  conversation_id: string;
46
36
  events: {
47
37
  seq: number;
@@ -53,17 +43,11 @@ export declare function createQueryConversationEventsTool(context: ToolRuntimeCo
53
43
  has_older: boolean;
54
44
  has_newer: boolean;
55
45
  target?: string | undefined;
56
- data?: unknown;
57
46
  truncated?: boolean | undefined;
58
47
  continuation?: {
59
48
  arguments: Record<string, unknown>;
60
49
  reason?: string | undefined;
61
50
  } | undefined;
62
- error?: string | {
63
- kind: string;
64
- message: string;
65
- retryable?: boolean | undefined;
66
- } | undefined;
67
51
  omitted_event_count?: number | undefined;
68
52
  }>) | undefined;
69
53
  };
@@ -1,4 +1,5 @@
1
+ import type { ResourceEventCatalog } from "@/chat/resource-events/catalog";
1
2
  import type { ToolRegistry } from "@/chat/tools/definition";
2
3
  import type { ToolRuntimeContext } from "@/chat/tools/types";
3
4
  /** Build the complete resource-watch tool set allowed by this runtime context. */
4
- export declare function createResourceEventTools(context: ToolRuntimeContext): ToolRegistry;
5
+ export declare function createResourceEventTools(context: ToolRuntimeContext, catalog: ResourceEventCatalog): ToolRegistry;
@@ -7,35 +7,19 @@ export declare function createReportProgressTool(): Omit<import("../definition")
7
7
  };
8
8
  execute?: ((input: unknown, options: import("../definition").ToolExecuteOptions) => {
9
9
  [x: string]: unknown;
10
- ok: boolean;
11
- status: "error" | "success";
12
10
  target?: string | undefined;
13
- data?: unknown;
14
11
  truncated?: boolean | undefined;
15
12
  continuation?: {
16
13
  arguments: Record<string, unknown>;
17
14
  reason?: string | undefined;
18
15
  } | undefined;
19
- error?: string | {
20
- kind: string;
21
- message: string;
22
- retryable?: boolean | undefined;
23
- } | undefined;
24
16
  } | Promise<{
25
17
  [x: string]: unknown;
26
- ok: boolean;
27
- status: "error" | "success";
28
18
  target?: string | undefined;
29
- data?: unknown;
30
19
  truncated?: boolean | undefined;
31
20
  continuation?: {
32
21
  arguments: Record<string, unknown>;
33
22
  reason?: string | undefined;
34
23
  } | undefined;
35
- error?: string | {
36
- kind: string;
37
- message: string;
38
- retryable?: boolean | undefined;
39
- } | undefined;
40
24
  }>) | undefined;
41
25
  };
@@ -1,41 +1,18 @@
1
1
  import { type SandboxFileSystem } from "@/chat/tools/sandbox/file-utils";
2
2
  import { type TextReplacement } from "@/chat/tools/sandbox/text-edits";
3
3
  type EditReplacement = TextReplacement;
4
- type EditFailureKind = "not_found" | "old_text_not_found" | "old_text_not_unique" | "overlapping_edits" | "no_change" | "invalid_edit";
5
4
  interface EditFileResult {
6
5
  content: [{
7
6
  type: "text";
8
7
  text: string;
9
8
  }];
10
9
  details: {
11
- data: {
12
- first_changed_line?: number;
13
- path: string;
14
- replacements: number;
15
- };
16
10
  diff: string;
17
11
  first_changed_line?: number;
18
- ok: true;
19
12
  path: string;
20
13
  replacements: number;
21
- status: "success";
22
14
  target: string;
23
15
  truncated: boolean;
24
- } | {
25
- data: {
26
- path: string;
27
- replacements: number;
28
- };
29
- error: {
30
- kind: EditFailureKind;
31
- message: string;
32
- retryable: true;
33
- };
34
- ok: false;
35
- path: string;
36
- replacements: number;
37
- status: "error";
38
- target: string;
39
16
  };
40
17
  }
41
18
  interface EditFileInput {
@@ -15,24 +15,9 @@ export declare const MAX_TEXT_CHARS = 60000;
15
15
  export declare const RIPGREP_EXCLUDED_GLOBS: readonly ["!**/.git/**", "!**/node_modules/**"];
16
16
  export declare const DEFAULT_SEARCH_COMMAND_TIMEOUT_MS = 30000;
17
17
  export type TextSearchResultDetails = {
18
- ok: true;
19
- status?: "success";
20
18
  target?: string;
21
19
  path: string;
22
20
  truncated: boolean;
23
- data?: unknown;
24
- } | {
25
- ok: false;
26
- status?: "error";
27
- target?: string;
28
- error: {
29
- kind: "not_found";
30
- message: string;
31
- };
32
- path: string;
33
- missing_path?: string;
34
- truncated: false;
35
- data?: unknown;
36
21
  };
37
22
  export interface TextSearchToolResult {
38
23
  content: [{
@@ -52,12 +37,12 @@ export declare function truncateText(value: string, maxChars?: number): {
52
37
  };
53
38
  /** Detect model-facing missing paths without swallowing sandbox lifecycle/API failures. */
54
39
  export declare function isMissingPathError(error: unknown): boolean;
55
- /** Build the shared model-visible result for expected missing search/list paths. */
40
+ /** Reject an expected missing search/list path through the tool-error channel. */
56
41
  export declare function missingPathSearchResult(params: {
57
42
  path: string;
58
43
  displayPath?: string;
59
44
  missingPath?: string;
60
- }): TextSearchToolResult;
45
+ }): never;
61
46
  /** Keep sandbox filesystem tools scoped to the mounted workspace root. */
62
47
  export declare function resolveWorkspacePath(input: string | undefined, fallback?: string): string;
63
48
  /** Anchor ripgrep paths and globs to the requested search root. */