@@ -83,6 +83,7 @@ import {
8383 SKILL_PROPOSAL_STATUSES ,
8484 SKILL_WORKSHOP_ACTIONS ,
8585} from "./skill-workshop-tool-schema.js" ;
86+ import { textResult } from "./tool-results.js" ;
8687
8788const SKILL_WORKSHOP_MUTATION_ACTIONS = new Set ( [ "create" , "patch" , "update" , "revise" ] ) ;
8889function requireProposalContent ( content : string | undefined ) : string {
@@ -279,10 +280,11 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA
279280 readMaxChars ,
280281 )
281282 : skill . content ;
282- return {
283- content : [ { type : "text" , text } ] ,
284- details : { skillKey : skill . skillKey , sizeBytes, contentIncluded : ! truncated } ,
285- } ;
283+ return textResult ( text , {
284+ skillKey : skill . skillKey ,
285+ sizeBytes,
286+ contentIncluded : ! truncated ,
287+ } ) ;
286288 }
287289
288290 if ( action === "prepare_patch" ) {
@@ -335,12 +337,7 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA
335337 query,
336338 limit,
337339 } ) ;
338- return {
339- content : [ { type : "text" , text : formatProposalList ( proposals ) } ] ,
340- details : {
341- proposals,
342- } ,
343- } ;
340+ return textResult ( formatProposalList ( proposals ) , { proposals } ) ;
344341 }
345342
346343 if ( action === "inspect" ) {
@@ -392,20 +389,12 @@ export function createSkillWorkshopTool(options: SkillWorkshopToolOptions): AnyA
392389 expectedRevisionHash : readToolStringParam ( params , "expected_revision_hash" ) ,
393390 correlationId : readToolStringParam ( params , "correlation_id" ) ,
394391 } ) ;
395- return {
396- content : [
397- {
398- type : "text" ,
399- text : formatProposalEvaluation ( evaluated . evaluation , evaluated . record . id ) ,
400- } ,
401- ] ,
402- details : {
403- id : evaluated . record . id ,
404- proposedVersion : evaluated . evaluation . proposedVersion ,
405- revisionHash : evaluated . evaluation . revisionHash ,
406- evaluation : evaluated . evaluation ,
407- } ,
408- } ;
392+ return textResult ( formatProposalEvaluation ( evaluated . evaluation , evaluated . record . id ) , {
393+ id : evaluated . record . id ,
394+ proposedVersion : evaluated . evaluation . proposedVersion ,
395+ revisionHash : evaluated . evaluation . revisionHash ,
396+ evaluation : evaluated . evaluation ,
397+ } ) ;
409398 }
410399
411400 if ( action === "apply" ) {
0 commit comments