Skip to content

Commit e9e1608

Browse files
committed
types
1 parent dfed426 commit e9e1608

1 file changed

Lines changed: 92 additions & 1 deletion

File tree

types.d.ts

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4736,6 +4736,41 @@ type IOutlineParam = any;
47364736
* @typedef {any} IOutlineData
47374737
*/
47384738
type IOutlineData = any;
4739+
/**
4740+
* Interface representing the format/schema definition for outline data.
4741+
* Specifies the structure, required fields, and property metadata for outline operations.
4742+
* Used to enforce and document the expected shape of outline data.
4743+
*/
4744+
interface IOutlineFormat {
4745+
/**
4746+
* The root type of the outline format (e.g., "object").
4747+
*/
4748+
type: string;
4749+
/**
4750+
* Array of property names that are required in the outline data.
4751+
*/
4752+
required: string[];
4753+
/**
4754+
* An object mapping property names to their type, description, and optional enum values.
4755+
* Each property describes a field in the outline data.
4756+
*/
4757+
properties: {
4758+
[key: string]: {
4759+
/**
4760+
* The type of the property (e.g., "string", "number", "boolean", etc.).
4761+
*/
4762+
type: string;
4763+
/**
4764+
* A human-readable description of the property.
4765+
*/
4766+
description: string;
4767+
/**
4768+
* Optional array of allowed values for the property.
4769+
*/
4770+
enum?: string[];
4771+
};
4772+
};
4773+
}
47394774
/**
47404775
* Interface defining callbacks for outline lifecycle events.
47414776
* Provides hooks for handling attempt initiation, document generation, and validation outcomes.
@@ -4832,6 +4867,10 @@ interface IOutlineArgs<Param extends IOutlineParam = IOutlineParam> {
48324867
* @type {number}
48334868
*/
48344869
attempt: number;
4870+
/**
4871+
* Format of output taken from outline schema
4872+
*/
4873+
format: IOutlineFormat;
48354874
/**
48364875
* The history management API for the outline operation.
48374876
* Provides access to message history for context or logging.
@@ -4947,6 +4986,14 @@ interface IOutlineResult<Data extends IOutlineData = IOutlineData, Param extends
49474986
* @interface IOutlineSchema
49484987
*/
49494988
interface IOutlineSchema<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam> {
4989+
/**
4990+
* The prompt or prompt generator for the outline operation.
4991+
* Can be a string, an array of strings, or a function that returns a string, array of strings, or a promise resolving to either.
4992+
* If a function is provided, it receives the outline name and can return a prompt dynamically.
4993+
* Used as the initial instruction or context for the outline process.
4994+
* @type {string | string[] | ((outlineName: OutlineName) => (string | string[] | Promise<string | string[]>))}
4995+
*/
4996+
prompt: string | string[] | ((outlineName: OutlineName) => (string | string[] | Promise<string | string[]>));
49504997
/**
49514998
* Optional description for documentation purposes.
49524999
* Aids in understanding the purpose or behavior of the outline.
@@ -4972,6 +5019,12 @@ interface IOutlineSchema<Data extends IOutlineData = IOutlineData, Param extends
49725019
* @type {(IOutlineValidation<Data, Param> | IOutlineValidationFn<Data, Param>)[]}
49735020
*/
49745021
validations?: (IOutlineValidation<Data, Param> | IOutlineValidationFn<Data, Param>)[];
5022+
/**
5023+
* The format/schema definition for the outline data.
5024+
* Specifies the expected structure, required fields, and property metadata for validation and documentation.
5025+
* @type {IOutlineFormat}
5026+
*/
5027+
format: IOutlineFormat;
49755028
/**
49765029
* Optional maximum number of attempts for the outline operation.
49775030
* Limits the number of retries if validations fail.
@@ -8457,6 +8510,13 @@ declare class DocService {
84578510
* @private
84588511
*/
84598512
private readonly agentValidationService;
8513+
/**
8514+
* Outline validation service instance, injected via DI.
8515+
* Used for validating and managing agent outline schemas, ensuring agent outlines conform to expected structure and constraints.
8516+
* @type {OutlineValidationService}
8517+
* @private
8518+
*/
8519+
private readonly outlineValidationService;
84608520
/**
84618521
* Swarm schema service instance, injected via DI.
84628522
* Retrieves ISwarmSchema objects for writeSwarmDoc, supplying swarm details like agents and policies.
@@ -8471,6 +8531,13 @@ declare class DocService {
84718531
* @private
84728532
*/
84738533
private readonly agentSchemaService;
8534+
/**
8535+
* Outline schema service instance, injected via DI.
8536+
* Retrieves and manages outline schema objects for agents, supporting documentation and validation of agent outlines.
8537+
* @type {OutlineSchemaService}
8538+
* @private
8539+
*/
8540+
private readonly outlineSchemaService;
84748541
/**
84758542
* Model context protocol service instance, injected via DI.
84768543
* Retrieves IMCPSchema objects for writeAgentDoc and agent descriptions in writeSwarmDoc, providing details like tools and prompts.
@@ -8551,6 +8618,24 @@ declare class DocService {
85518618
* @private
85528619
*/
85538620
private writeSwarmDoc;
8621+
/**
8622+
* Writes Markdown documentation for an outline schema, detailing its name, description, main prompt, output format, and callbacks.
8623+
* Executes in a thread pool (THREAD_POOL_SIZE) to manage concurrency, logging via loggerService if GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO is enabled.
8624+
* Outputs to dirName/[outlineName].md, sourced from outlineSchemaService.
8625+
*
8626+
* - The Markdown includes YAML frontmatter, outline name, description, prompt(s), output format (with types, descriptions, enums, and required fields), and callbacks.
8627+
* - Handles both string and function-based prompts, and supports array or string prompt types.
8628+
* - Output format section documents each property, its type, description, enum values, and required status.
8629+
* - Callback section lists all callback names used by the outline.
8630+
*
8631+
* @param {IOutlineSchema} outlineSchema - The outline schema to document, including properties like prompt, format, and callbacks.
8632+
* @param {string} prefix - The documentation group or prefix for organizing output.
8633+
* @param {string} dirName - The base directory for documentation output.
8634+
* @param {(text: string) => string} [sanitizeMarkdown=(t) => t] - Optional function to sanitize Markdown text.
8635+
* @returns {Promise<void>} A promise resolving when the outline documentation file is written.
8636+
* @private
8637+
*/
8638+
private writeOutlineDoc;
85548639
/**
85558640
* Writes Markdown documentation for an agent schema, detailing its name, description, UML diagram, prompts, tools, storages, states, and callbacks.
85568641
* Executes in a thread pool (THREAD_POOL_SIZE) to manage concurrency, logging via loggerService if GLOBAL_CONFIG.CC_LOGGER_ENABLE_INFO is enabled.
@@ -11151,6 +11236,12 @@ declare class OutlineValidationService {
1115111236
* @throws {Error} If an outline with the given name already exists in the map.
1115211237
*/
1115311238
addOutline: (outlineName: OutlineName, outlineSchema: IOutlineSchema) => void;
11239+
/**
11240+
* Retrieves a list of all registered outline names.
11241+
* Logs the retrieval operation if info logging is enabled.
11242+
* @returns {OutlineName[]} An array of registered outline names.
11243+
*/
11244+
getOutlineList: () => OutlineName[];
1115411245
/**
1115511246
* Validates the existence of an outline schema for the given outline name.
1115611247
* Memoized to cache results based on the outline name for performance.
@@ -15557,4 +15648,4 @@ declare const Utils: {
1555715648
PersistEmbeddingUtils: typeof PersistEmbeddingUtils;
1555815649
};
1555915650

15560-
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 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 };
15651+
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 };

0 commit comments

Comments
 (0)