File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class SoftIssue extends Error {
2727 }
2828}
2929
30- export function validateArgs ( args : CompressMessageToolArgs ) : void {
30+ export function validateArgs ( args : CompressMessageToolArgs , delegated = false ) : void {
3131 if ( typeof args . topic !== "string" || args . topic . trim ( ) . length === 0 ) {
3232 throw new Error ( "topic is required and must be a non-empty string" )
3333 }
@@ -48,7 +48,7 @@ export function validateArgs(args: CompressMessageToolArgs): void {
4848 throw new Error ( `${ prefix } .topic is required and must be a non-empty string` )
4949 }
5050
51- if ( typeof entry ?. summary !== "string" || entry . summary . trim ( ) . length === 0 ) {
51+ if ( ! delegated && ( typeof entry ?. summary !== "string" || entry . summary . trim ( ) . length === 0 ) ) {
5252 throw new Error ( `${ prefix } .summary is required and must be a non-empty string` )
5353 }
5454 }
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export function createCompressMessageTool(ctx: ToolContext): ReturnType<typeof t
5151 args : buildSchema ( ) ,
5252 async execute ( args , toolCtx ) {
5353 const input = args as CompressMessageToolArgs
54- validateArgs ( input )
54+ validateArgs ( input , delegated )
5555 const callId =
5656 typeof ( toolCtx as unknown as { callID ?: unknown } ) . callID === "string"
5757 ? ( toolCtx as unknown as { callID : string } ) . callID
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import type {
1111
1212const BLOCK_PLACEHOLDER_REGEX = / \( b ( \d + ) \) | \{ b l o c k _ ( \d + ) \} / gi
1313
14- export function validateArgs ( args : CompressRangeToolArgs ) : void {
14+ export function validateArgs ( args : CompressRangeToolArgs , delegated = false ) : void {
1515 if ( typeof args . topic !== "string" || args . topic . trim ( ) . length === 0 ) {
1616 throw new Error ( "topic is required and must be a non-empty string" )
1717 }
@@ -32,7 +32,7 @@ export function validateArgs(args: CompressRangeToolArgs): void {
3232 throw new Error ( `${ prefix } .endId is required and must be a non-empty string` )
3333 }
3434
35- if ( typeof entry ?. summary !== "string" || entry . summary . trim ( ) . length === 0 ) {
35+ if ( ! delegated && ( typeof entry ?. summary !== "string" || entry . summary . trim ( ) . length === 0 ) ) {
3636 throw new Error ( `${ prefix } .summary is required and must be a non-empty string` )
3737 }
3838 }
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export function createCompressRangeTool(ctx: ToolContext): ReturnType<typeof too
6666 args : buildSchema ( ) ,
6767 async execute ( args , toolCtx ) {
6868 const input = args as CompressRangeToolArgs
69- validateArgs ( input )
69+ validateArgs ( input , delegated )
7070 const callId =
7171 typeof ( toolCtx as unknown as { callID ?: unknown } ) . callID === "string"
7272 ? ( toolCtx as unknown as { callID : string } ) . callID
You can’t perform that action at this time.
0 commit comments