Skip to content

Commit bd9bdf6

Browse files
committed
docs
1 parent ec9dc01 commit bd9bdf6

4 files changed

Lines changed: 71 additions & 6 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "agent-swarm-kit",
3-
"version": "1.1.132",
3+
"version": "1.1.133",
44
"description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
55
"author": {
66
"name": "Petr Tripolsky",

src/lib/services/base/DocService.ts

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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,

types.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8658,6 +8658,13 @@ declare class DocService {
86588658
* @private
86598659
*/
86608660
private readonly stateSchemaService;
8661+
/**
8662+
* Completion schema service instance, injected via DI.
8663+
* Provides completion details for writeAgentDoc, documenting completion resources used by agents.
8664+
* @type {CompletionSchemaService}
8665+
* @private
8666+
*/
8667+
private readonly completionSchemaService;
86618668
/**
86628669
* Compute schema service instance, injected via DI.
86638670
* Provides compute details for writeAgentDoc, documenting compute resources used by agents.

0 commit comments

Comments
 (0)