Skip to content

Commit b89fc68

Browse files
committed
strict-format
1 parent 478e731 commit b89fc68

6 files changed

Lines changed: 68 additions & 9 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.122",
3+
"version": "1.1.123",
44
"description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
55
"author": {
66
"name": "Petr Tripolsky",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export { IPipelineSchema } from "./model/Pipeline.model";
160160

161161
export { IMCPSchema, IMCPTool, MCPToolProperties, IMCPToolCallDto } from './interfaces/MCP.interface';
162162

163-
export { IOutlineSchema, IOutlineMessage, IOutlineHistory, IOutlineValidationFn, IOutlineResult, IOutlineFormat } from "./interfaces/Outline.interface";
163+
export { IOutlineSchema, IOutlineMessage, IOutlineHistory, IOutlineValidationFn, IOutlineResult, IOutlineFormat, IOutlineSchemaFormat, IOutlineObjectFormat } from "./interfaces/Outline.interface";
164164

165165
export { IModelMessage } from "./model/ModelMessage.model";
166166
export { IIncomingMessage, IOutgoingMessage } from "./model/EmitMessage.model";

src/interfaces/Outline.interface.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,40 @@ export type IOutlineParam = any;
1515
*/
1616
export type IOutlineData = any;
1717

18+
/**
19+
* Type representing the format definition for outline data.
20+
* Can be either a full JSON schema format or an object-based format.
21+
* Used to specify the expected structure for outline operations.
22+
* @typedef {IOutlineSchemaFormat | IOutlineObjectFormat} IOutlineFormat
23+
*/
24+
export type IOutlineFormat = IOutlineSchemaFormat | IOutlineObjectFormat;
25+
26+
/**
27+
* Interface representing a format definition using a JSON schema.
28+
* Specifies the type and the associated JSON schema object for validation.
29+
* Used when the outline format is defined by a complete JSON schema.
30+
*/
31+
export interface IOutlineSchemaFormat {
32+
/**
33+
* The type of the outline format (e.g., "json_schema").
34+
*/
35+
type: string;
36+
37+
/**
38+
* The JSON schema object defining the structure and validation rules.
39+
*/
40+
json_schema: object;
41+
}
42+
1843
/**
1944
* Interface representing the format/schema definition for outline data.
2045
* Specifies the structure, required fields, and property metadata for outline operations.
2146
* Used to enforce and document the expected shape of outline data.
2247
*/
23-
export interface IOutlineFormat {
48+
export interface IOutlineObjectFormat {
2449
/**
2550
* The root type of the outline format (e.g., "object").
51+
* Should be "json_object" for partial JSON schemas or "json_schema" for full matching schemas.
2652
*/
2753
type: string;
2854

src/lib/services/base/DocService.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ export class DocService {
485485
}
486486
}
487487

488-
if (outlineSchema.format) {
488+
if ("properties" in outlineSchema.format) {
489489
result.push("");
490490
result.push("## Output format");
491491
const entries = Object.entries(outlineSchema.format.properties);
@@ -504,7 +504,7 @@ export class DocService {
504504
result.push("");
505505
result.push(`*Enum:* \`${e.map(sanitizeMarkdown).join(", ")}\``);
506506
}
507-
{
507+
if ("required" in outlineSchema.format) {
508508
result.push("");
509509
result.push(
510510
`*Required:* [${
@@ -520,6 +520,16 @@ export class DocService {
520520
result.push("");
521521
}
522522

523+
if (outlineSchema.format.type === "json_schema") {
524+
result.push("");
525+
result.push("## Output format");
526+
result.push("");
527+
result.push("```json");
528+
result.push(JSON.stringify(outlineSchema.format, null, 2));
529+
result.push("```");
530+
result.push("");
531+
}
532+
523533
const getValidations = () => {
524534
if (outlineSchema.validations) {
525535
return outlineSchema.validations

types.d.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3039,14 +3039,37 @@ type IOutlineParam = any;
30393039
* @typedef {any} IOutlineData
30403040
*/
30413041
type IOutlineData = any;
3042+
/**
3043+
* Type representing the format definition for outline data.
3044+
* Can be either a full JSON schema format or an object-based format.
3045+
* Used to specify the expected structure for outline operations.
3046+
* @typedef {IOutlineSchemaFormat | IOutlineObjectFormat} IOutlineFormat
3047+
*/
3048+
type IOutlineFormat = IOutlineSchemaFormat | IOutlineObjectFormat;
3049+
/**
3050+
* Interface representing a format definition using a JSON schema.
3051+
* Specifies the type and the associated JSON schema object for validation.
3052+
* Used when the outline format is defined by a complete JSON schema.
3053+
*/
3054+
interface IOutlineSchemaFormat {
3055+
/**
3056+
* The type of the outline format (e.g., "json_schema").
3057+
*/
3058+
type: string;
3059+
/**
3060+
* The JSON schema object defining the structure and validation rules.
3061+
*/
3062+
json_schema: object;
3063+
}
30423064
/**
30433065
* Interface representing the format/schema definition for outline data.
30443066
* Specifies the structure, required fields, and property metadata for outline operations.
30453067
* Used to enforce and document the expected shape of outline data.
30463068
*/
3047-
interface IOutlineFormat {
3069+
interface IOutlineObjectFormat {
30483070
/**
30493071
* The root type of the outline format (e.g., "object").
3072+
* Should be "json_object" for partial JSON schemas or "json_schema" for full matching schemas.
30503073
*/
30513074
type: string;
30523075
/**
@@ -15718,4 +15741,4 @@ declare const Utils: {
1571815741
PersistEmbeddingUtils: typeof PersistEmbeddingUtils;
1571915742
};
1572015743

15721-
export { Adapter, Chat, ChatInstance, Compute, type EventSource, ExecutionContextService, History, HistoryMemoryInstance, HistoryPersistInstance, type IAgentSchemaInternal, type IAgentTool, type IBaseEvent, type IBusEvent, type IBusEventContext, type IChatArgs, type IChatInstance, type IChatInstanceCallbacks, type ICompletionArgs, type ICompletionSchema, type IComputeSchema, type ICustomEvent, type IEmbeddingSchema, type IGlobalConfig, type IHistoryAdapter, type IHistoryControl, type IHistoryInstance, type IHistoryInstanceCallbacks, type IIncomingMessage, type ILoggerAdapter, type ILoggerInstance, type ILoggerInstanceCallbacks, type IMCPSchema, type IMCPTool, type IMCPToolCallDto, type IMakeConnectionConfig, type IMakeDisposeParams, type IModelMessage, type INavigateToAgentParams, type INavigateToTriageParams, type IOutgoingMessage, type IOutlineFormat, type IOutlineHistory, type IOutlineMessage, type IOutlineResult, type IOutlineSchema, type IOutlineValidationFn, type IPersistActiveAgentData, type IPersistAliveData, type IPersistBase, type IPersistEmbeddingData, type IPersistMemoryData, type IPersistNavigationStackData, type IPersistPolicyData, type IPersistStateData, type IPersistStorageData, type IPipelineSchema, type IPolicySchema, type ISessionConfig, type IStateSchema, type IStorageData, type IStorageSchema, type ISwarmSchema, type ITool, type IToolCall, type IWikiSchema, Logger, LoggerInstance, MCP, type MCPToolProperties, MethodContextService, Operator, OperatorInstance, PayloadContextService, PersistAlive, PersistBase, PersistEmbedding, PersistList, PersistMemory, PersistPolicy, PersistState, PersistStorage, PersistSwarm, Policy, type ReceiveMessageFn, RoundRobin, Schema, SchemaContextService, type SendMessageFn, SharedCompute, SharedState, SharedStorage, State, Storage, type THistoryInstanceCtor, type THistoryMemoryInstance, type THistoryPersistInstance, type TLoggerInstance, type TOperatorInstance, type TPersistBase, type TPersistBaseCtor, type TPersistList, type ToolValue, Utils, addAgent, addAgentNavigation, addCompletion, addCompute, addEmbedding, addMCP, addOutline, addPipeline, addPolicy, addState, addStorage, addSwarm, addTool, addTriageNavigation, addWiki, beginContext, cancelOutput, cancelOutputForce, changeToAgent, changeToDefaultAgent, changeToPrevAgent, commitAssistantMessage, commitAssistantMessageForce, commitFlush, commitFlushForce, commitStopTools, commitStopToolsForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitToolRequest, commitToolRequestForce, commitUserMessage, commitUserMessageForce, complete, createNavigateToAgent, createNavigateToTriageAgent, disposeConnection, dumpAgent, dumpClientPerformance, dumpDocs, dumpPerfomance, dumpSwarm, emit, emitForce, event, execute, executeForce, fork, getAgent, getAgentHistory, getAgentName, getAssistantHistory, getCheckBusy, getCompletion, getCompute, getEmbeding, getLastAssistantMessage, getLastSystemMessage, getLastUserMessage, getMCP, getNavigationRoute, getPayload, getPipeline, getPolicy, getRawHistory, getSessionContext, getSessionMode, getState, getStorage, getSwarm, getTool, getToolNameForModel, getUserHistory, getWiki, hasNavigation, hasSession, json, listenAgentEvent, listenAgentEventOnce, listenEvent, listenEventOnce, listenExecutionEvent, listenExecutionEventOnce, listenHistoryEvent, listenHistoryEventOnce, listenPolicyEvent, listenPolicyEventOnce, listenSessionEvent, listenSessionEventOnce, listenStateEvent, listenStateEventOnce, listenStorageEvent, listenStorageEventOnce, listenSwarmEvent, listenSwarmEventOnce, makeAutoDispose, makeConnection, markOffline, markOnline, notify, notifyForce, overrideAgent, overrideCompletion, overrideCompute, overrideEmbeding, overrideMCP, overrideOutline, overridePipeline, overridePolicy, overrideState, overrideStorage, overrideSwarm, overrideTool, overrideWiki, question, questionForce, runStateless, runStatelessForce, scope, session, setConfig, startPipeline, swarm };
15744+
export { Adapter, Chat, ChatInstance, Compute, type EventSource, ExecutionContextService, History, HistoryMemoryInstance, HistoryPersistInstance, type IAgentSchemaInternal, type IAgentTool, type IBaseEvent, type IBusEvent, type IBusEventContext, type IChatArgs, type IChatInstance, type IChatInstanceCallbacks, type ICompletionArgs, type ICompletionSchema, type IComputeSchema, type ICustomEvent, type IEmbeddingSchema, type IGlobalConfig, type IHistoryAdapter, type IHistoryControl, type IHistoryInstance, type IHistoryInstanceCallbacks, type IIncomingMessage, type ILoggerAdapter, type ILoggerInstance, type ILoggerInstanceCallbacks, type IMCPSchema, type IMCPTool, type IMCPToolCallDto, type IMakeConnectionConfig, type IMakeDisposeParams, type IModelMessage, type INavigateToAgentParams, type INavigateToTriageParams, type IOutgoingMessage, type IOutlineFormat, type IOutlineHistory, type IOutlineMessage, type IOutlineObjectFormat, type IOutlineResult, type IOutlineSchema, type IOutlineSchemaFormat, type IOutlineValidationFn, type IPersistActiveAgentData, type IPersistAliveData, type IPersistBase, type IPersistEmbeddingData, type IPersistMemoryData, type IPersistNavigationStackData, type IPersistPolicyData, type IPersistStateData, type IPersistStorageData, type IPipelineSchema, type IPolicySchema, type ISessionConfig, type IStateSchema, type IStorageData, type IStorageSchema, type ISwarmSchema, type ITool, type IToolCall, type IWikiSchema, Logger, LoggerInstance, MCP, type MCPToolProperties, MethodContextService, Operator, OperatorInstance, PayloadContextService, PersistAlive, PersistBase, PersistEmbedding, PersistList, PersistMemory, PersistPolicy, PersistState, PersistStorage, PersistSwarm, Policy, type ReceiveMessageFn, RoundRobin, Schema, SchemaContextService, type SendMessageFn, SharedCompute, SharedState, SharedStorage, State, Storage, type THistoryInstanceCtor, type THistoryMemoryInstance, type THistoryPersistInstance, type TLoggerInstance, type TOperatorInstance, type TPersistBase, type TPersistBaseCtor, type TPersistList, type ToolValue, Utils, addAgent, addAgentNavigation, addCompletion, addCompute, addEmbedding, addMCP, addOutline, addPipeline, addPolicy, addState, addStorage, addSwarm, addTool, addTriageNavigation, addWiki, beginContext, cancelOutput, cancelOutputForce, changeToAgent, changeToDefaultAgent, changeToPrevAgent, commitAssistantMessage, commitAssistantMessageForce, commitFlush, commitFlushForce, commitStopTools, commitStopToolsForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitToolRequest, commitToolRequestForce, commitUserMessage, commitUserMessageForce, complete, createNavigateToAgent, createNavigateToTriageAgent, disposeConnection, dumpAgent, dumpClientPerformance, dumpDocs, dumpPerfomance, dumpSwarm, emit, emitForce, event, execute, executeForce, fork, getAgent, getAgentHistory, getAgentName, getAssistantHistory, getCheckBusy, getCompletion, getCompute, getEmbeding, getLastAssistantMessage, getLastSystemMessage, getLastUserMessage, getMCP, getNavigationRoute, getPayload, getPipeline, getPolicy, getRawHistory, getSessionContext, getSessionMode, getState, getStorage, getSwarm, getTool, getToolNameForModel, getUserHistory, getWiki, hasNavigation, hasSession, json, listenAgentEvent, listenAgentEventOnce, listenEvent, listenEventOnce, listenExecutionEvent, listenExecutionEventOnce, listenHistoryEvent, listenHistoryEventOnce, listenPolicyEvent, listenPolicyEventOnce, listenSessionEvent, listenSessionEventOnce, listenStateEvent, listenStateEventOnce, listenStorageEvent, listenStorageEventOnce, listenSwarmEvent, listenSwarmEventOnce, makeAutoDispose, makeConnection, markOffline, markOnline, notify, notifyForce, overrideAgent, overrideCompletion, overrideCompute, overrideEmbeding, overrideMCP, overrideOutline, overridePipeline, overridePolicy, overrideState, overrideStorage, overrideSwarm, overrideTool, overrideWiki, question, questionForce, runStateless, runStatelessForce, scope, session, setConfig, startPipeline, swarm };

0 commit comments

Comments
 (0)