@@ -31,6 +31,7 @@ import {
3131 IOutlineSchema ,
3232 IOutlineSchemaFormat ,
3333} from "../../../interfaces/Outline.interface" ;
34+ import CompletionSchemaService from "../schema/CompletionSchemaService" ;
3435
3536/**
3637 * Maximum number of concurrent threads for documentation generation tasks.
@@ -204,6 +205,16 @@ export class DocService {
204205 TYPES . stateSchemaService
205206 ) ;
206207
208+ /**
209+ * Completion schema service instance, injected via DI.
210+ * Provides completion details for writeAgentDoc, documenting completion resources used by agents.
211+ * @type {CompletionSchemaService }
212+ * @private
213+ */
214+ private readonly completionSchemaService = inject < CompletionSchemaService > (
215+ TYPES . completionSchemaService
216+ ) ;
217+
207218 /**
208219 * Compute schema service instance, injected via DI.
209220 * Provides compute details for writeAgentDoc, documenting compute resources used by agents.
@@ -437,6 +448,27 @@ export class DocService {
437448 result . push ( "" ) ;
438449 }
439450
451+
452+ if ( outlineSchema . completion ) {
453+ const { flags = [ ] } = this . completionSchemaService . get (
454+ outlineSchema . completion
455+ ) ;
456+
457+ if ( flags . length ) {
458+ result . push ( `## Completion flags` ) ;
459+ result . push ( "" ) ;
460+ for ( let i = 0 ; i !== flags . length ; i ++ ) {
461+ if ( ! flags [ i ] ) {
462+ continue ;
463+ }
464+ result . push ( `${ i + 1 } . \`${ sanitizeMarkdown ( flags [ i ] ) } \`` ) ;
465+ result . push ( "" ) ;
466+ }
467+ }
468+
469+ result . push ( "" ) ;
470+ }
471+
440472 const getPrompt = async ( ) => {
441473 try {
442474 if ( typeof outlineSchema . prompt === "string" ) {
@@ -487,12 +519,17 @@ export class DocService {
487519 }
488520 }
489521
490- const writeObjectFormat = ( object : IOutlineObjectFormat , strict : boolean ) => {
522+ const writeObjectFormat = (
523+ object : IOutlineObjectFormat ,
524+ strict : boolean
525+ ) => {
491526 if ( "properties" in object ) {
492527 result . push ( "" ) ;
493528 result . push ( "## Output format" ) ;
494529 result . push ( "" ) ;
495- result . push ( strict ? "*Strict template match*" : "*Partial template match*" ) ;
530+ result . push (
531+ strict ? "*Strict template match*" : "*Partial template match*"
532+ ) ;
496533 const entries = Object . entries ( object . properties ) ;
497534 entries . forEach ( ( [ key , { type, description, enum : e } ] , idx ) => {
498535 result . push ( "" ) ;
@@ -551,7 +588,7 @@ export class DocService {
551588 return ;
552589 }
553590 writeStrictFormat ( object ) ;
554- }
591+ } ;
555592
556593 writeFormat ( ) ;
557594
@@ -646,6 +683,7 @@ export class DocService {
646683 result . push (
647684 `**Completion:** \`${ sanitizeMarkdown ( agentSchema . completion ) } \``
648685 ) ;
686+
649687 result . push ( "" ) ;
650688 }
651689
@@ -654,6 +692,26 @@ export class DocService {
654692 result . push ( "" ) ;
655693 }
656694
695+ if ( agentSchema . completion ) {
696+ const { flags = [ ] } = this . completionSchemaService . get (
697+ agentSchema . completion
698+ ) ;
699+
700+ if ( flags . length ) {
701+ result . push ( `## Completion flags` ) ;
702+ result . push ( "" ) ;
703+ for ( let i = 0 ; i !== flags . length ; i ++ ) {
704+ if ( ! flags [ i ] ) {
705+ continue ;
706+ }
707+ result . push ( `${ i + 1 } . \`${ sanitizeMarkdown ( flags [ i ] ) } \`` ) ;
708+ result . push ( "" ) ;
709+ }
710+ }
711+
712+ result . push ( "" ) ;
713+ }
714+
657715 {
658716 const umlSchema = this . agentMetaService . toUML (
659717 agentSchema . agentName ,
0 commit comments