agent-swarm-kit 1.1.183 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.cjs CHANGED
@@ -17308,10 +17308,10 @@ const dumpOutlineResult = beginContext(async (result, outputDir = "./dump/outlin
17308
17308
  summary += `**ResultId**: ${result.resultId}\n`;
17309
17309
  summary += `\n`;
17310
17310
  }
17311
- if (result.param) {
17311
+ if (result.params) {
17312
17312
  summary += `## Input Parameters\n\n`;
17313
17313
  summary += "```json\n";
17314
- summary += JSON.stringify(result.param, null, 2);
17314
+ summary += JSON.stringify(result.params, null, 2);
17315
17315
  summary += "\n```\n\n";
17316
17316
  }
17317
17317
  if (result.data) {
@@ -17357,10 +17357,10 @@ const dumpOutlineResult = beginContext(async (result, outputDir = "./dump/outlin
17357
17357
  const contentFilePath = path__namespace.join(subfolderPath, contentFileName);
17358
17358
  let content = `# Full Outline Result\n\n`;
17359
17359
  content += `**ResultId**: ${result.resultId}\n\n`;
17360
- if (result.param) {
17360
+ if (result.params) {
17361
17361
  content += `## Completion Input Data\n\n`;
17362
17362
  content += "```json\n";
17363
- content += JSON.stringify(result.param, null, 2);
17363
+ content += JSON.stringify(result.params, null, 2);
17364
17364
  content += "\n```\n\n";
17365
17365
  }
17366
17366
  if (result.data) {
@@ -20268,7 +20268,7 @@ class OutlineHistory {
20268
20268
  * @private
20269
20269
  * @async
20270
20270
  */
20271
- const jsonInternal = beginContext(async (outlineName, param) => {
20271
+ const jsonInternal = beginContext(async (outlineName, ...params) => {
20272
20272
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20273
20273
  swarm$1.loggerService.log(METHOD_NAME$F, {});
20274
20274
  swarm$1.outlineValidationService.validate(outlineName, METHOD_NAME$F);
@@ -20309,13 +20309,12 @@ const jsonInternal = beginContext(async (outlineName, param) => {
20309
20309
  const inputArgs = {
20310
20310
  attempt,
20311
20311
  format,
20312
- param,
20313
20312
  history,
20314
20313
  };
20315
20314
  if (outlineCallbacks?.onAttempt) {
20316
20315
  outlineCallbacks.onAttempt(inputArgs);
20317
20316
  }
20318
- await getOutlineHistory(inputArgs);
20317
+ await getOutlineHistory(inputArgs, ...params);
20319
20318
  const messages = await history.list();
20320
20319
  try {
20321
20320
  let output;
@@ -20358,7 +20357,7 @@ const jsonInternal = beginContext(async (outlineName, param) => {
20358
20357
  const result = {
20359
20358
  isValid: true,
20360
20359
  attempt,
20361
- param,
20360
+ params,
20362
20361
  history: await history.list(),
20363
20362
  data,
20364
20363
  resultId,
@@ -20380,7 +20379,7 @@ const jsonInternal = beginContext(async (outlineName, param) => {
20380
20379
  isValid: false,
20381
20380
  error: errorMessage ?? "Unknown error",
20382
20381
  attempt: maxAttempts,
20383
- param,
20382
+ params,
20384
20383
  history: await history.list(),
20385
20384
  data: null,
20386
20385
  resultId,
@@ -20396,7 +20395,7 @@ const jsonInternal = beginContext(async (outlineName, param) => {
20396
20395
  * @async
20397
20396
  *
20398
20397
  * @param outlineName The outlineName parameter.
20399
- * @param param The param parameter.
20398
+ * @param params The spread params passed to getOutlineHistory.
20400
20399
  * @template Data - The type of the outline data, extending IOutlineData.
20401
20400
  * @template Param - The type of the input param, extending IOutlineParam.
20402
20401
  * @example
@@ -20404,8 +20403,8 @@ const jsonInternal = beginContext(async (outlineName, param) => {
20404
20403
  * const result = await json<"MyOutline", { query: string }>("MyOutline", { query: "example" });
20405
20404
  * console.log(result.isValid, result.data); // Logs validation status and data
20406
20405
  */
20407
- async function json(outlineName, param = {}) {
20408
- return await jsonInternal(outlineName, param);
20406
+ async function json(outlineName, ...params) {
20407
+ return await jsonInternal(outlineName, ...params);
20409
20408
  }
20410
20409
 
20411
20410
  const METHOD_NAME$E = "function.target.chat";
package/build/index.mjs CHANGED
@@ -17288,10 +17288,10 @@ const dumpOutlineResult = beginContext(async (result, outputDir = "./dump/outlin
17288
17288
  summary += `**ResultId**: ${result.resultId}\n`;
17289
17289
  summary += `\n`;
17290
17290
  }
17291
- if (result.param) {
17291
+ if (result.params) {
17292
17292
  summary += `## Input Parameters\n\n`;
17293
17293
  summary += "```json\n";
17294
- summary += JSON.stringify(result.param, null, 2);
17294
+ summary += JSON.stringify(result.params, null, 2);
17295
17295
  summary += "\n```\n\n";
17296
17296
  }
17297
17297
  if (result.data) {
@@ -17337,10 +17337,10 @@ const dumpOutlineResult = beginContext(async (result, outputDir = "./dump/outlin
17337
17337
  const contentFilePath = path.join(subfolderPath, contentFileName);
17338
17338
  let content = `# Full Outline Result\n\n`;
17339
17339
  content += `**ResultId**: ${result.resultId}\n\n`;
17340
- if (result.param) {
17340
+ if (result.params) {
17341
17341
  content += `## Completion Input Data\n\n`;
17342
17342
  content += "```json\n";
17343
- content += JSON.stringify(result.param, null, 2);
17343
+ content += JSON.stringify(result.params, null, 2);
17344
17344
  content += "\n```\n\n";
17345
17345
  }
17346
17346
  if (result.data) {
@@ -20248,7 +20248,7 @@ class OutlineHistory {
20248
20248
  * @private
20249
20249
  * @async
20250
20250
  */
20251
- const jsonInternal = beginContext(async (outlineName, param) => {
20251
+ const jsonInternal = beginContext(async (outlineName, ...params) => {
20252
20252
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_LOG &&
20253
20253
  swarm$1.loggerService.log(METHOD_NAME$F, {});
20254
20254
  swarm$1.outlineValidationService.validate(outlineName, METHOD_NAME$F);
@@ -20289,13 +20289,12 @@ const jsonInternal = beginContext(async (outlineName, param) => {
20289
20289
  const inputArgs = {
20290
20290
  attempt,
20291
20291
  format,
20292
- param,
20293
20292
  history,
20294
20293
  };
20295
20294
  if (outlineCallbacks?.onAttempt) {
20296
20295
  outlineCallbacks.onAttempt(inputArgs);
20297
20296
  }
20298
- await getOutlineHistory(inputArgs);
20297
+ await getOutlineHistory(inputArgs, ...params);
20299
20298
  const messages = await history.list();
20300
20299
  try {
20301
20300
  let output;
@@ -20338,7 +20337,7 @@ const jsonInternal = beginContext(async (outlineName, param) => {
20338
20337
  const result = {
20339
20338
  isValid: true,
20340
20339
  attempt,
20341
- param,
20340
+ params,
20342
20341
  history: await history.list(),
20343
20342
  data,
20344
20343
  resultId,
@@ -20360,7 +20359,7 @@ const jsonInternal = beginContext(async (outlineName, param) => {
20360
20359
  isValid: false,
20361
20360
  error: errorMessage ?? "Unknown error",
20362
20361
  attempt: maxAttempts,
20363
- param,
20362
+ params,
20364
20363
  history: await history.list(),
20365
20364
  data: null,
20366
20365
  resultId,
@@ -20376,7 +20375,7 @@ const jsonInternal = beginContext(async (outlineName, param) => {
20376
20375
  * @async
20377
20376
  *
20378
20377
  * @param outlineName The outlineName parameter.
20379
- * @param param The param parameter.
20378
+ * @param params The spread params passed to getOutlineHistory.
20380
20379
  * @template Data - The type of the outline data, extending IOutlineData.
20381
20380
  * @template Param - The type of the input param, extending IOutlineParam.
20382
20381
  * @example
@@ -20384,8 +20383,8 @@ const jsonInternal = beginContext(async (outlineName, param) => {
20384
20383
  * const result = await json<"MyOutline", { query: string }>("MyOutline", { query: "example" });
20385
20384
  * console.log(result.isValid, result.data); // Logs validation status and data
20386
20385
  */
20387
- async function json(outlineName, param = {}) {
20388
- return await jsonInternal(outlineName, param);
20386
+ async function json(outlineName, ...params) {
20387
+ return await jsonInternal(outlineName, ...params);
20389
20388
  }
20390
20389
 
20391
20390
  const METHOD_NAME$E = "function.target.chat";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.1.183",
3
+ "version": "1.2.3",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
@@ -80,7 +80,7 @@
80
80
  },
81
81
  "dependencies": {
82
82
  "di-kit": "^1.0.18",
83
- "di-scoped": "^1.0.20",
83
+ "di-scoped": "^1.0.21",
84
84
  "functools-kit": "^1.0.95",
85
85
  "get-moment-stamp": "^1.1.1",
86
86
  "lodash-es": "4.17.21",
package/types.d.ts CHANGED
@@ -3899,27 +3899,27 @@ interface IOutlineObjectFormat {
3899
3899
  * @template Param - The type of the input param, defaults to IOutlineParam.
3900
3900
  * @interface IOutlineCallbacks
3901
3901
  */
3902
- interface IOutlineCallbacks<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam> {
3902
+ interface IOutlineCallbacks<Data extends IOutlineData = IOutlineData, Params extends IOutlineParam[] = IOutlineParam[]> {
3903
3903
  /**
3904
3904
  * Optional callback triggered when an outline attempt is initiated.
3905
3905
  * Useful for logging or tracking attempt starts.
3906
3906
  */
3907
- onAttempt?: (args: IOutlineArgs<Param>) => void;
3907
+ onAttempt?: (args: IOutlineArgs) => void;
3908
3908
  /**
3909
3909
  * Optional callback triggered when an outline document is generated.
3910
3910
  * Useful for processing or logging the generated document.
3911
3911
  */
3912
- onDocument?: (result: IOutlineResult<Data, Param>) => void;
3912
+ onDocument?: (result: IOutlineResult<Data, Params>) => void;
3913
3913
  /**
3914
3914
  * Optional callback triggered when a document passes validation.
3915
3915
  * Useful for handling successful validation outcomes.
3916
3916
  */
3917
- onValidDocument?: (result: IOutlineResult<Data, Param>) => void;
3917
+ onValidDocument?: (result: IOutlineResult<Data, Params>) => void;
3918
3918
  /**
3919
3919
  * Optional callback triggered when a document fails validation.
3920
3920
  * Useful for handling failed validation outcomes or retries.
3921
3921
  */
3922
- onInvalidDocument?: (result: IOutlineResult<Data, Param>) => void;
3922
+ onInvalidDocument?: (result: IOutlineResult<Data, Params>) => void;
3923
3923
  }
3924
3924
  /**
3925
3925
  * Interface representing the history management API for outline operations.
@@ -3948,12 +3948,7 @@ interface IOutlineHistory {
3948
3948
  * @template Param - The type of the input param, defaults to IOutlineParam.
3949
3949
  * @interface IOutlineArgs
3950
3950
  */
3951
- interface IOutlineArgs<Param extends IOutlineParam = IOutlineParam> {
3952
- /**
3953
- * The input param for the outline operation.
3954
- * Contains the raw or structured param to be processed.
3955
- */
3956
- param: Param;
3951
+ interface IOutlineArgs {
3957
3952
  /**
3958
3953
  * The current attempt number for the outline operation.
3959
3954
  * Tracks the number of retries or iterations, useful for validation or retry logic.
@@ -3977,7 +3972,7 @@ interface IOutlineArgs<Param extends IOutlineParam = IOutlineParam> {
3977
3972
  * @interface IOutlineValidationArgs
3978
3973
  * @extends {IOutlineArgs<Param>}
3979
3974
  */
3980
- interface IOutlineValidationArgs<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam> extends IOutlineArgs<Param> {
3975
+ interface IOutlineValidationArgs<Data extends IOutlineData = IOutlineData> extends IOutlineArgs {
3981
3976
  /**
3982
3977
  * The data param generated by the outline operation.
3983
3978
  * Contains the result to be validated, typically structured param.
@@ -3990,8 +3985,8 @@ interface IOutlineValidationArgs<Data extends IOutlineData = IOutlineData, Param
3990
3985
  * @template Data - The type of the data param, defaults to IOutlineData.
3991
3986
  * @template Param - The type of the input param, defaults to IOutlineParam.
3992
3987
  */
3993
- interface IOutlineValidationFn<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam> {
3994
- (args: IOutlineValidationArgs<Data, Param>): void | Promise<void>;
3988
+ interface IOutlineValidationFn<Data extends IOutlineData = IOutlineData> {
3989
+ (args: IOutlineValidationArgs<Data>): void | Promise<void>;
3995
3990
  }
3996
3991
  /**
3997
3992
  * Interface representing a validation configuration for outline operations.
@@ -4000,12 +3995,12 @@ interface IOutlineValidationFn<Data extends IOutlineData = IOutlineData, Param e
4000
3995
  * @template Param - The type of the input param, defaults to IOutlineParam.
4001
3996
  * @interface IOutlineValidation
4002
3997
  */
4003
- interface IOutlineValidation<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam> {
3998
+ interface IOutlineValidation<Data extends IOutlineData = IOutlineData> {
4004
3999
  /**
4005
4000
  * The validation function or configuration to apply to the outline data.
4006
4001
  * Can reference itself or another validation for chained or reusable logic.
4007
4002
  */
4008
- validate: IOutlineValidationFn<Data, Param>;
4003
+ validate: IOutlineValidationFn<Data>;
4009
4004
  /**
4010
4005
  * Optional description for documentation purposes.
4011
4006
  * Aids in understanding the purpose or behavior of the validation.
@@ -4019,7 +4014,7 @@ interface IOutlineValidation<Data extends IOutlineData = IOutlineData, Param ext
4019
4014
  * @template Param - The type of the input param, defaults to IOutlineParam.
4020
4015
  * @interface IOutlineResult
4021
4016
  */
4022
- interface IOutlineResult<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam> {
4017
+ interface IOutlineResult<Data extends IOutlineData = IOutlineData, Params extends IOutlineParam[] = IOutlineParam[]> {
4023
4018
  /**
4024
4019
  * Indicates whether the outline data is valid based on validation checks.
4025
4020
  * True if all validations pass, false otherwise.
@@ -4041,10 +4036,10 @@ interface IOutlineResult<Data extends IOutlineData = IOutlineData, Param extends
4041
4036
  */
4042
4037
  error?: string | null;
4043
4038
  /**
4044
- * The input param used for the outline operation.
4045
- * Reflects the original param provided in the arguments.
4039
+ * The input params used for the outline operation.
4040
+ * Reflects the original params provided to json().
4046
4041
  */
4047
- param: Param;
4042
+ params: Params;
4048
4043
  /**
4049
4044
  * The data param generated by the outline operation.
4050
4045
  * Null if the operation fails or no data is produced.
@@ -4063,7 +4058,7 @@ interface IOutlineResult<Data extends IOutlineData = IOutlineData, Param extends
4063
4058
  * @template Param - The type of the input param, defaults to IOutlineParam.
4064
4059
  * @interface IOutlineSchema
4065
4060
  */
4066
- interface IOutlineSchema<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam> {
4061
+ interface IOutlineSchema<Data extends IOutlineData = IOutlineData, Params extends IOutlineParam[] = IOutlineParam[]> {
4067
4062
  /** The name of the completion for JSON*/
4068
4063
  completion: CompletionName;
4069
4064
  /**
@@ -4091,14 +4086,14 @@ interface IOutlineSchema<Data extends IOutlineData = IOutlineData, Param extends
4091
4086
  outlineName: OutlineName;
4092
4087
  /**
4093
4088
  * Function to generate structured data for the outline operation.
4094
- * Processes input param and history to produce the desired data.
4089
+ * Receives spread arguments: attempt, format, history, plus any additional params passed to json().
4095
4090
  */
4096
- getOutlineHistory(args: IOutlineArgs<Param>): Promise<void>;
4091
+ getOutlineHistory(arg: IOutlineArgs, ...params: Params): Promise<void>;
4097
4092
  /**
4098
4093
  * Array of validation functions or configurations to apply to the outline data.
4099
4094
  * Supports both direct validation functions and structured validation configurations.
4100
4095
  */
4101
- validations?: (IOutlineValidation<Data, Param> | IOutlineValidationFn<Data, Param>)[];
4096
+ validations?: (IOutlineValidation<Data> | IOutlineValidationFn<Data>)[];
4102
4097
  /**
4103
4098
  * The format/schema definition for the outline data.
4104
4099
  * Specifies the expected structure, required fields, and property metadata for validation and documentation.
@@ -9065,7 +9060,7 @@ declare class OutlineSchemaService {
9065
9060
  * Overrides an existing outline schema with partial updates for the specified key.
9066
9061
  * Logs the operation if `CC_LOGGER_ENABLE_INFO` is enabled and returns the updated schema.
9067
9062
  */
9068
- override: (key: OutlineName, value: Partial<IOutlineSchema>) => IOutlineSchema<any, any>;
9063
+ override: (key: OutlineName, value: Partial<IOutlineSchema>) => IOutlineSchema<any, any[]>;
9069
9064
  /**
9070
9065
  * Retrieves an outline schema by its key from the active registry.
9071
9066
  * Logs the operation if `CC_LOGGER_ENABLE_INFO` is enabled.
@@ -9540,7 +9535,7 @@ declare const dumpClientPerformance: {
9540
9535
  *
9541
9536
  * @function
9542
9537
  */
9543
- declare const dumpOutlineResult: (result: IOutlineResult<any, any>, outputDir?: any) => Promise<void>;
9538
+ declare const dumpOutlineResult: (result: IOutlineResult<any, any[]>, outputDir?: any) => Promise<void>;
9544
9539
 
9545
9540
  /**
9546
9541
  * Dumps the advisor result into a folder structure with markdown files.
@@ -10417,7 +10412,7 @@ declare function addPipeline<Payload extends object = any>(pipelineSchema: IPipe
10417
10412
  * @param outlineSchema Partial outline schema with updates to be applied to the existing outline configuration.
10418
10413
  * @param Param> The Param> parameter.
10419
10414
  */
10420
- declare function addOutline<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam>(outlineSchema: IOutlineSchema<Data, Param>): string;
10415
+ declare function addOutline<Data extends IOutlineData = IOutlineData, Params extends IOutlineParam[] = IOutlineParam[]>(outlineSchema: IOutlineSchema<Data, Params>): string;
10421
10416
 
10422
10417
  /**
10423
10418
  * Type representing a partial agent schema with required agentName.
@@ -10742,9 +10737,9 @@ declare function overridePipeline<Payload extends object = any>(pipelineSchema:
10742
10737
  * @property {IOutlineSchema["outlineName"]} outlineName - The unique name of the outline to override.
10743
10738
  * @property {Partial<IOutlineSchema>} [partial] - Optional partial properties of the `IOutlineSchema` to override.
10744
10739
  */
10745
- type TOutlineSchema<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam> = {
10746
- outlineName: IOutlineSchema<Data, Param>["outlineName"];
10747
- } & Partial<IOutlineSchema<Data, Param>>;
10740
+ type TOutlineSchema<Data extends IOutlineData = IOutlineData, Params extends IOutlineParam[] = IOutlineParam[]> = {
10741
+ outlineName: IOutlineSchema<Data, Params>["outlineName"];
10742
+ } & Partial<IOutlineSchema<Data, Params>>;
10748
10743
  /**
10749
10744
  * Overrides an existing outline schema in the swarm system by updating it with the provided partial schema.
10750
10745
  * Ensures the operation runs in a clean context using `beginContext` to avoid interference from existing method or execution contexts.
@@ -10753,7 +10748,7 @@ type TOutlineSchema<Data extends IOutlineData = IOutlineData, Param extends IOut
10753
10748
  * @param outlineSchema Partial outline schema with updates to be applied to the existing outline configuration.
10754
10749
  * @param Param> The Param> parameter.
10755
10750
  */
10756
- declare function overrideOutline<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam>(outlineSchema: TOutlineSchema<Data, Param>): Promise<IOutlineSchema<any, any>>;
10751
+ declare function overrideOutline<Data extends IOutlineData = IOutlineData, Params extends IOutlineParam[] = IOutlineParam[]>(outlineSchema: TOutlineSchema<Data, Params>): Promise<IOutlineSchema<any, any[]>>;
10757
10752
 
10758
10753
  /**
10759
10754
  * Marks a client as online in the specified swarm.
@@ -11159,7 +11154,7 @@ declare function ask<T = string>(message: T, advisorName: AdvisorName): Promise<
11159
11154
  * @async
11160
11155
  *
11161
11156
  * @param outlineName The outlineName parameter.
11162
- * @param param The param parameter.
11157
+ * @param params The spread params passed to getOutlineHistory.
11163
11158
  * @template Data - The type of the outline data, extending IOutlineData.
11164
11159
  * @template Param - The type of the input param, extending IOutlineParam.
11165
11160
  * @example
@@ -11167,7 +11162,7 @@ declare function ask<T = string>(message: T, advisorName: AdvisorName): Promise<
11167
11162
  * const result = await json<"MyOutline", { query: string }>("MyOutline", { query: "example" });
11168
11163
  * console.log(result.isValid, result.data); // Logs validation status and data
11169
11164
  */
11170
- declare function json<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam>(outlineName: OutlineName, param?: Param): Promise<IOutlineResult<Data, Param>>;
11165
+ declare function json<Data extends IOutlineData = IOutlineData, Params extends IOutlineParam[] = IOutlineParam[]>(outlineName: OutlineName, ...params: Params): Promise<IOutlineResult<Data, Params>>;
11171
11166
 
11172
11167
  /**
11173
11168
  * Processes a chat completion request by sending messages to a specified completion service.