agent-swarm-kit 1.1.147 → 1.1.149

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/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ <img src="./assets/saturn.svg" height="85px" align="right">
2
+
1
3
  # 🐝 Agent Swarm Kit
2
4
 
3
5
  > **A lightweight TypeScript library for building orchestrated, framework-agnostic multi-agent AI systems.**
package/build/index.cjs CHANGED
@@ -10,6 +10,26 @@ var crypto = require('crypto');
10
10
  var os = require('os');
11
11
  var getMomentStamp = require('get-moment-stamp');
12
12
 
13
+ function _interopNamespaceDefault(e) {
14
+ var n = Object.create(null);
15
+ if (e) {
16
+ Object.keys(e).forEach(function (k) {
17
+ if (k !== 'default') {
18
+ var d = Object.getOwnPropertyDescriptor(e, k);
19
+ Object.defineProperty(n, k, d.get ? d : {
20
+ enumerable: true,
21
+ get: function () { return e[k]; }
22
+ });
23
+ }
24
+ });
25
+ }
26
+ n.default = e;
27
+ return Object.freeze(n);
28
+ }
29
+
30
+ var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
31
+ var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
32
+
13
33
  /**
14
34
  * Scoped service class providing method call context information in the swarm system.
15
35
  * Stores and exposes an IMethodContext object (clientId, methodName, agentName, etc.) via dependency injection, scoped using di-scoped for method-specific instances.
@@ -19166,6 +19186,101 @@ dumpClientPerformance.runAfterExecute = beginContext(async (dirName = "./logs/cl
19166
19186
  });
19167
19187
  });
19168
19188
 
19189
+ /**
19190
+ * Dumps the outline result into a folder structure with markdown files.
19191
+ *
19192
+ * - Skips dumping if the result is invalid.
19193
+ * - Creates a subfolder for each result using its resultId.
19194
+ * - Writes a summary file including input parameters, generated data, and system messages.
19195
+ * - Writes each user message to a separate markdown file.
19196
+ * - Writes the full outline result to a markdown file.
19197
+ *
19198
+ * @function
19199
+ * @param {IOutlineResult} result - The outline result object to dump.
19200
+ * @param {string} [outputDir="./dump/outline"] - The base directory to dump results into.
19201
+ * @returns {Promise<void>}
19202
+ */
19203
+ const dumpOutlineResult = beginContext(async (result, outputDir = "./dump/outline") => {
19204
+ if (!result.isValid) {
19205
+ return;
19206
+ }
19207
+ // Extract system messages and system reminders from existing data
19208
+ const systemMessages = result.history.filter((m) => m.role === "system");
19209
+ const userMessages = result.history.filter((m) => m.role === "user");
19210
+ const subfolderPath = path__namespace.join(outputDir, result.resultId);
19211
+ try {
19212
+ await fs__namespace.access(subfolderPath);
19213
+ return;
19214
+ }
19215
+ catch {
19216
+ await fs__namespace.mkdir(subfolderPath, { recursive: true });
19217
+ }
19218
+ {
19219
+ let summary = `# Outline Result Summary\n`;
19220
+ {
19221
+ summary += `\n`;
19222
+ summary += `**ResultId**: ${result.resultId}\n`;
19223
+ summary += `**Generation Date**: ${new Date().toISOString()}\n`;
19224
+ summary += `\n`;
19225
+ }
19226
+ if (result.param) {
19227
+ summary += `## Input Parameters\n\n`;
19228
+ summary += "```json\n";
19229
+ summary += JSON.stringify(result.param, null, 2);
19230
+ summary += "\n```\n\n";
19231
+ }
19232
+ if (result.data) {
19233
+ summary += `## Generated Data\n\n`;
19234
+ summary += "```json\n";
19235
+ summary += JSON.stringify(result.data, null, 2);
19236
+ summary += "\n```\n\n";
19237
+ }
19238
+ // Add system messages to summary
19239
+ if (systemMessages.length > 0) {
19240
+ summary += `## System Messages\n\n`;
19241
+ systemMessages.forEach((msg, idx) => {
19242
+ summary += `### System Message ${idx + 1}\n\n`;
19243
+ summary += msg.content;
19244
+ summary += "\n";
19245
+ });
19246
+ }
19247
+ const summaryFile = path__namespace.join(subfolderPath, "00_system_prompt.md");
19248
+ await fs__namespace.writeFile(summaryFile, summary, "utf8");
19249
+ }
19250
+ {
19251
+ await Promise.all(Array.from(userMessages.entries()).map(async ([idx, message]) => {
19252
+ const messageNum = String(idx + 1).padStart(2, "0");
19253
+ const contentFileName = `${messageNum}_user_message.md`;
19254
+ const contentFilePath = path__namespace.join(subfolderPath, contentFileName);
19255
+ let content = `# User Input ${idx + 1}\n\n`;
19256
+ content += `**ResultId**: ${result.resultId}\n\n`;
19257
+ content += message.content;
19258
+ content += "\n";
19259
+ await fs__namespace.writeFile(contentFilePath, content, "utf8");
19260
+ }));
19261
+ }
19262
+ {
19263
+ const messageNum = String(userMessages.length + 1).padStart(2, "0");
19264
+ const contentFileName = `${messageNum}_llm_output.md`;
19265
+ const contentFilePath = path__namespace.join(subfolderPath, contentFileName);
19266
+ let content = `# Full Outline Result\n\n`;
19267
+ content += `**ResultId**: ${result.resultId}\n\n`;
19268
+ if (result.param) {
19269
+ content += `## Completion Input Data\n\n`;
19270
+ content += "```json\n";
19271
+ content += JSON.stringify(result.param, null, 2);
19272
+ content += "\n```\n\n";
19273
+ }
19274
+ if (result.data) {
19275
+ content += `## Completion Output Data\n\n`;
19276
+ content += "```json\n";
19277
+ content += JSON.stringify(result.data, null, 2);
19278
+ content += "\n```\n";
19279
+ }
19280
+ await fs__namespace.writeFile(contentFilePath, content, "utf8");
19281
+ }
19282
+ });
19283
+
19169
19284
  /** @private Constant defining the method name for logging and validation context */
19170
19285
  const METHOD_NAME$1v = "function.commit.commitFlushForce";
19171
19286
  /**
@@ -26442,6 +26557,7 @@ exports.disposeConnection = disposeConnection;
26442
26557
  exports.dumpAgent = dumpAgent;
26443
26558
  exports.dumpClientPerformance = dumpClientPerformance;
26444
26559
  exports.dumpDocs = dumpDocs;
26560
+ exports.dumpOutlineResult = dumpOutlineResult;
26445
26561
  exports.dumpPerfomance = dumpPerfomance;
26446
26562
  exports.dumpSwarm = dumpSwarm;
26447
26563
  exports.emit = emit;
package/build/index.mjs CHANGED
@@ -2,8 +2,10 @@ import { scoped } from 'di-scoped';
2
2
  import { createActivator } from 'di-kit';
3
3
  import { trycatch, makeExtendable, singleshot, getErrorMessage, not, queued, memoize, retry, Subject, str, randomString, ToolRegistry, createAwaiter, sleep, errorData, isObject as isObject$1, cancelable, CANCELED_PROMISE_SYMBOL, SortedArray, execpool, ttl, compose, LimitedSet, Source, and, singlerun, schedule, rate, fetchApi } from 'functools-kit';
4
4
  import xml2js from 'xml2js';
5
- import fs, { access, mkdir } from 'fs/promises';
6
- import path, { join } from 'path';
5
+ import * as fs from 'fs/promises';
6
+ import fs__default, { access, mkdir } from 'fs/promises';
7
+ import * as path from 'path';
8
+ import path__default, { join } from 'path';
7
9
  import crypto, { createHash } from 'crypto';
8
10
  import os from 'os';
9
11
  import { getMomentStamp, getTimeStamp } from 'get-moment-stamp';
@@ -382,7 +384,7 @@ async function writeFileAtomic(file, data, options = {}) {
382
384
  if (IS_WINDOWS || GLOBAL_CONFIG.CC_SKIP_POSIX_RENAME) {
383
385
  try {
384
386
  // Create and write to temporary file
385
- fileHandle = await fs.open(file, "w", mode);
387
+ fileHandle = await fs__default.open(file, "w", mode);
386
388
  // Write data to the temp file
387
389
  await fileHandle.writeFile(data, { encoding });
388
390
  // Ensure data is flushed to disk
@@ -400,12 +402,12 @@ async function writeFileAtomic(file, data, options = {}) {
400
402
  return;
401
403
  }
402
404
  // Create a temporary filename in the same directory
403
- const dir = path.dirname(file);
404
- const filename = path.basename(file);
405
- const tmpFile = path.join(dir, `${tmpPrefix}${crypto.randomBytes(6).toString("hex")}-${filename}`);
405
+ const dir = path__default.dirname(file);
406
+ const filename = path__default.basename(file);
407
+ const tmpFile = path__default.join(dir, `${tmpPrefix}${crypto.randomBytes(6).toString("hex")}-${filename}`);
406
408
  try {
407
409
  // Create and write to temporary file
408
- fileHandle = await fs.open(tmpFile, "w", mode);
410
+ fileHandle = await fs__default.open(tmpFile, "w", mode);
409
411
  // Write data to the temp file
410
412
  await fileHandle.writeFile(data, { encoding });
411
413
  // Ensure data is flushed to disk
@@ -414,7 +416,7 @@ async function writeFileAtomic(file, data, options = {}) {
414
416
  await fileHandle.close();
415
417
  fileHandle = null;
416
418
  // Atomically replace the target file with our temp file
417
- await fs.rename(tmpFile, file);
419
+ await fs__default.rename(tmpFile, file);
418
420
  }
419
421
  catch (error) {
420
422
  // Clean up if something went wrong
@@ -423,7 +425,7 @@ async function writeFileAtomic(file, data, options = {}) {
423
425
  }
424
426
  // Try to remove the temporary file
425
427
  try {
426
- await fs.unlink(tmpFile).catch(() => { });
428
+ await fs__default.unlink(tmpFile).catch(() => { });
427
429
  }
428
430
  catch (_) {
429
431
  // Ignore errors during cleanup
@@ -544,7 +546,7 @@ const BASE_UNLINK_RETRY_DELAY = 1000;
544
546
  */
545
547
  const BASE_WAIT_FOR_INIT_UNLINK_FN = async (filePath) => trycatch(retry(async () => {
546
548
  try {
547
- await fs.unlink(filePath);
549
+ await fs__default.unlink(filePath);
548
550
  return true;
549
551
  }
550
552
  catch (error) {
@@ -568,7 +570,7 @@ const BASE_WAIT_FOR_INIT_FN = async (self) => {
568
570
  entityName: self.entityName,
569
571
  directory: self._directory,
570
572
  });
571
- await fs.mkdir(self._directory, { recursive: true });
573
+ await fs__default.mkdir(self._directory, { recursive: true });
572
574
  for await (const key of self.keys()) {
573
575
  try {
574
576
  await self.readValue(key);
@@ -727,7 +729,7 @@ const PersistBase = makeExtendable(class {
727
729
  * @throws {Error} If reading the directory fails (e.g., permissions or directory not found).
728
730
  */
729
731
  async getCount() {
730
- const files = await fs.readdir(this._directory);
732
+ const files = await fs__default.readdir(this._directory);
731
733
  const { length } = files.filter((file) => file.endsWith(".json"));
732
734
  return length;
733
735
  }
@@ -747,7 +749,7 @@ const PersistBase = makeExtendable(class {
747
749
  });
748
750
  try {
749
751
  const filePath = this._getFilePath(entityId);
750
- const fileContent = await fs.readFile(filePath, "utf-8");
752
+ const fileContent = await fs__default.readFile(filePath, "utf-8");
751
753
  return JSON.parse(fileContent);
752
754
  }
753
755
  catch (error) {
@@ -772,7 +774,7 @@ const PersistBase = makeExtendable(class {
772
774
  });
773
775
  try {
774
776
  const filePath = this._getFilePath(entityId);
775
- await fs.access(filePath);
777
+ await fs__default.access(filePath);
776
778
  return true;
777
779
  }
778
780
  catch (error) {
@@ -821,7 +823,7 @@ const PersistBase = makeExtendable(class {
821
823
  });
822
824
  try {
823
825
  const filePath = this._getFilePath(entityId);
824
- await fs.unlink(filePath);
826
+ await fs__default.unlink(filePath);
825
827
  }
826
828
  catch (error) {
827
829
  if (error?.code === "ENOENT") {
@@ -842,10 +844,10 @@ const PersistBase = makeExtendable(class {
842
844
  entityName: this.entityName,
843
845
  });
844
846
  try {
845
- const files = await fs.readdir(this._directory);
847
+ const files = await fs__default.readdir(this._directory);
846
848
  const entityFiles = files.filter((file) => file.endsWith(".json"));
847
849
  for (const file of entityFiles) {
848
- await fs.unlink(join(this._directory, file));
850
+ await fs__default.unlink(join(this._directory, file));
849
851
  }
850
852
  }
851
853
  catch (error) {
@@ -865,7 +867,7 @@ const PersistBase = makeExtendable(class {
865
867
  entityName: this.entityName,
866
868
  });
867
869
  try {
868
- const files = await fs.readdir(this._directory);
870
+ const files = await fs__default.readdir(this._directory);
869
871
  const entityIds = files
870
872
  .filter((file) => file.endsWith(".json"))
871
873
  .map((file) => file.slice(0, -5))
@@ -894,7 +896,7 @@ const PersistBase = makeExtendable(class {
894
896
  entityName: this.entityName,
895
897
  });
896
898
  try {
897
- const files = await fs.readdir(this._directory);
899
+ const files = await fs__default.readdir(this._directory);
898
900
  const entityIds = files
899
901
  .filter((file) => file.endsWith(".json"))
900
902
  .map((file) => file.slice(0, -5))
@@ -19164,6 +19166,101 @@ dumpClientPerformance.runAfterExecute = beginContext(async (dirName = "./logs/cl
19164
19166
  });
19165
19167
  });
19166
19168
 
19169
+ /**
19170
+ * Dumps the outline result into a folder structure with markdown files.
19171
+ *
19172
+ * - Skips dumping if the result is invalid.
19173
+ * - Creates a subfolder for each result using its resultId.
19174
+ * - Writes a summary file including input parameters, generated data, and system messages.
19175
+ * - Writes each user message to a separate markdown file.
19176
+ * - Writes the full outline result to a markdown file.
19177
+ *
19178
+ * @function
19179
+ * @param {IOutlineResult} result - The outline result object to dump.
19180
+ * @param {string} [outputDir="./dump/outline"] - The base directory to dump results into.
19181
+ * @returns {Promise<void>}
19182
+ */
19183
+ const dumpOutlineResult = beginContext(async (result, outputDir = "./dump/outline") => {
19184
+ if (!result.isValid) {
19185
+ return;
19186
+ }
19187
+ // Extract system messages and system reminders from existing data
19188
+ const systemMessages = result.history.filter((m) => m.role === "system");
19189
+ const userMessages = result.history.filter((m) => m.role === "user");
19190
+ const subfolderPath = path.join(outputDir, result.resultId);
19191
+ try {
19192
+ await fs.access(subfolderPath);
19193
+ return;
19194
+ }
19195
+ catch {
19196
+ await fs.mkdir(subfolderPath, { recursive: true });
19197
+ }
19198
+ {
19199
+ let summary = `# Outline Result Summary\n`;
19200
+ {
19201
+ summary += `\n`;
19202
+ summary += `**ResultId**: ${result.resultId}\n`;
19203
+ summary += `**Generation Date**: ${new Date().toISOString()}\n`;
19204
+ summary += `\n`;
19205
+ }
19206
+ if (result.param) {
19207
+ summary += `## Input Parameters\n\n`;
19208
+ summary += "```json\n";
19209
+ summary += JSON.stringify(result.param, null, 2);
19210
+ summary += "\n```\n\n";
19211
+ }
19212
+ if (result.data) {
19213
+ summary += `## Generated Data\n\n`;
19214
+ summary += "```json\n";
19215
+ summary += JSON.stringify(result.data, null, 2);
19216
+ summary += "\n```\n\n";
19217
+ }
19218
+ // Add system messages to summary
19219
+ if (systemMessages.length > 0) {
19220
+ summary += `## System Messages\n\n`;
19221
+ systemMessages.forEach((msg, idx) => {
19222
+ summary += `### System Message ${idx + 1}\n\n`;
19223
+ summary += msg.content;
19224
+ summary += "\n";
19225
+ });
19226
+ }
19227
+ const summaryFile = path.join(subfolderPath, "00_system_prompt.md");
19228
+ await fs.writeFile(summaryFile, summary, "utf8");
19229
+ }
19230
+ {
19231
+ await Promise.all(Array.from(userMessages.entries()).map(async ([idx, message]) => {
19232
+ const messageNum = String(idx + 1).padStart(2, "0");
19233
+ const contentFileName = `${messageNum}_user_message.md`;
19234
+ const contentFilePath = path.join(subfolderPath, contentFileName);
19235
+ let content = `# User Input ${idx + 1}\n\n`;
19236
+ content += `**ResultId**: ${result.resultId}\n\n`;
19237
+ content += message.content;
19238
+ content += "\n";
19239
+ await fs.writeFile(contentFilePath, content, "utf8");
19240
+ }));
19241
+ }
19242
+ {
19243
+ const messageNum = String(userMessages.length + 1).padStart(2, "0");
19244
+ const contentFileName = `${messageNum}_llm_output.md`;
19245
+ const contentFilePath = path.join(subfolderPath, contentFileName);
19246
+ let content = `# Full Outline Result\n\n`;
19247
+ content += `**ResultId**: ${result.resultId}\n\n`;
19248
+ if (result.param) {
19249
+ content += `## Completion Input Data\n\n`;
19250
+ content += "```json\n";
19251
+ content += JSON.stringify(result.param, null, 2);
19252
+ content += "\n```\n\n";
19253
+ }
19254
+ if (result.data) {
19255
+ content += `## Completion Output Data\n\n`;
19256
+ content += "```json\n";
19257
+ content += JSON.stringify(result.data, null, 2);
19258
+ content += "\n```\n";
19259
+ }
19260
+ await fs.writeFile(contentFilePath, content, "utf8");
19261
+ }
19262
+ });
19263
+
19167
19264
  /** @private Constant defining the method name for logging and validation context */
19168
19265
  const METHOD_NAME$1v = "function.commit.commitFlushForce";
19169
19266
  /**
@@ -26362,4 +26459,4 @@ const Utils = {
26362
26459
  PersistEmbeddingUtils,
26363
26460
  };
26364
26461
 
26365
- export { Adapter, Chat, ChatInstance, Compute, ExecutionContextService, History, HistoryMemoryInstance, HistoryPersistInstance, Logger, LoggerInstance, MCP, MethodContextService, Operator, OperatorInstance, PayloadContextService, PersistAlive, PersistBase, PersistEmbedding, PersistList, PersistMemory, PersistPolicy, PersistState, PersistStorage, PersistSwarm, Policy, RoundRobin, Schema, SchemaContextService, SharedCompute, SharedState, SharedStorage, State, Storage, Utils, addAgent, addAgentNavigation, addCompletion, addCompute, addEmbedding, addMCP, addOutline, addPipeline, addPolicy, addState, addStorage, addSwarm, addTool, addTriageNavigation, addWiki, beginContext, cancelOutput, cancelOutputForce, changeToAgent, changeToDefaultAgent, changeToPrevAgent, commitAssistantMessage, commitAssistantMessageForce, commitDeveloperMessage, commitDeveloperMessageForce, 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, toJsonSchema, validate, validateToolArguments };
26462
+ export { Adapter, Chat, ChatInstance, Compute, ExecutionContextService, History, HistoryMemoryInstance, HistoryPersistInstance, Logger, LoggerInstance, MCP, MethodContextService, Operator, OperatorInstance, PayloadContextService, PersistAlive, PersistBase, PersistEmbedding, PersistList, PersistMemory, PersistPolicy, PersistState, PersistStorage, PersistSwarm, Policy, RoundRobin, Schema, SchemaContextService, SharedCompute, SharedState, SharedStorage, State, Storage, Utils, addAgent, addAgentNavigation, addCompletion, addCompute, addEmbedding, addMCP, addOutline, addPipeline, addPolicy, addState, addStorage, addSwarm, addTool, addTriageNavigation, addWiki, beginContext, cancelOutput, cancelOutputForce, changeToAgent, changeToDefaultAgent, changeToPrevAgent, commitAssistantMessage, commitAssistantMessageForce, commitDeveloperMessage, commitDeveloperMessageForce, commitFlush, commitFlushForce, commitStopTools, commitStopToolsForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitToolRequest, commitToolRequestForce, commitUserMessage, commitUserMessageForce, complete, createNavigateToAgent, createNavigateToTriageAgent, disposeConnection, dumpAgent, dumpClientPerformance, dumpDocs, dumpOutlineResult, 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, toJsonSchema, validate, validateToolArguments };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.1.147",
3
+ "version": "1.1.149",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -11885,6 +11885,22 @@ declare const dumpClientPerformance: {
11885
11885
  runAfterExecute: (dirName?: any) => Promise<() => void>;
11886
11886
  };
11887
11887
 
11888
+ /**
11889
+ * Dumps the outline result into a folder structure with markdown files.
11890
+ *
11891
+ * - Skips dumping if the result is invalid.
11892
+ * - Creates a subfolder for each result using its resultId.
11893
+ * - Writes a summary file including input parameters, generated data, and system messages.
11894
+ * - Writes each user message to a separate markdown file.
11895
+ * - Writes the full outline result to a markdown file.
11896
+ *
11897
+ * @function
11898
+ * @param {IOutlineResult} result - The outline result object to dump.
11899
+ * @param {string} [outputDir="./dump/outline"] - The base directory to dump results into.
11900
+ * @returns {Promise<void>}
11901
+ */
11902
+ declare const dumpOutlineResult: (result: IOutlineResult<any, any>, outputDir?: any) => Promise<void>;
11903
+
11888
11904
  /**
11889
11905
  * Configuration parameters for creating a navigation handler to a triage agent.
11890
11906
  * Defines optional messages or functions to handle flush, execution, and tool output scenarios during navigation.
@@ -12464,9 +12480,9 @@ type TSwarmSchema = {
12464
12480
  */
12465
12481
  declare function overrideSwarm(swarmSchema: TSwarmSchema): ISwarmSchema;
12466
12482
 
12467
- type TAgentTool = {
12468
- toolName: IAgentTool["toolName"];
12469
- } & Partial<IAgentTool>;
12483
+ type TAgentTool<T extends any = Record<string, ToolValue>> = {
12484
+ toolName: IAgentTool<T>["toolName"];
12485
+ } & Partial<IAgentTool<T>>;
12470
12486
  /**
12471
12487
  * Overrides an existing tool schema in the swarm system with a new or partial schema.
12472
12488
  * This function updates the configuration of a tool identified by its `toolName`, applying the provided schema properties.
@@ -12488,7 +12504,7 @@ type TAgentTool = {
12488
12504
  * });
12489
12505
  * // Logs the operation (if enabled) and updates the tool schema in the swarm.
12490
12506
  */
12491
- declare function overrideTool(toolSchema: TAgentTool): IAgentTool<Record<string, ToolValue>>;
12507
+ declare function overrideTool<T extends any = Record<string, ToolValue>>(toolSchema: TAgentTool<T>): IAgentTool<Record<string, ToolValue>>;
12492
12508
 
12493
12509
  /**
12494
12510
  * Type definition for a partial MCP schema, requiring at least an mcpName.
@@ -12538,15 +12554,15 @@ declare function overrideWiki(wikiSchema: TWikiSchema): IWikiSchema;
12538
12554
  * @type TComputeSchema
12539
12555
  * @description Type for partial compute schema updates, requiring computeName and allowing other IComputeSchema properties.
12540
12556
  */
12541
- type TComputeSchema = {
12542
- computeName: IComputeSchema["computeName"];
12543
- } & Partial<IComputeSchema>;
12557
+ type TComputeSchema<T extends IComputeData = any> = {
12558
+ computeName: IComputeSchema<T>["computeName"];
12559
+ } & Partial<IComputeSchema<T>>;
12544
12560
  /**
12545
12561
  * Overrides an existing compute schema with provided partial updates.
12546
12562
  * @param {TComputeSchema} computeSchema - The partial compute schema with updates.
12547
12563
  * @returns {IComputeSchema} The updated compute schema.
12548
12564
  */
12549
- declare function overrideCompute(computeSchema: TComputeSchema): IComputeSchema<any>;
12565
+ declare function overrideCompute<T extends IComputeData = any>(computeSchema: TComputeSchema<T>): IComputeSchema<any>;
12550
12566
 
12551
12567
  /**
12552
12568
  * @module overridePipeline
@@ -12568,16 +12584,16 @@ declare function overridePipeline<Payload extends object = any>(pipelineSchema:
12568
12584
  * @property {IOutlineSchema["outlineName"]} outlineName - The unique name of the outline to override.
12569
12585
  * @property {Partial<IOutlineSchema>} [partial] - Optional partial properties of the `IOutlineSchema` to override.
12570
12586
  */
12571
- type TOutlineSchema = {
12572
- outlineName: IOutlineSchema["outlineName"];
12573
- } & Partial<IOutlineSchema>;
12587
+ type TOutlineSchema<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam> = {
12588
+ outlineName: IOutlineSchema<Data, Param>["outlineName"];
12589
+ } & Partial<IOutlineSchema<Data, Param>>;
12574
12590
  /**
12575
12591
  * Overrides an existing outline schema in the swarm system by updating it with the provided partial schema.
12576
12592
  * Ensures the operation runs in a clean context using `beginContext` to avoid interference from existing method or execution contexts.
12577
12593
  * Logs the operation if logging is enabled in the global configuration.
12578
12594
  * @param {TOutlineSchema} outlineSchema - The partial outline schema containing the outline name and optional schema properties to override.
12579
12595
  */
12580
- declare function overrideOutline(outlineSchema: TOutlineSchema): IOutlineSchema<any, any>;
12596
+ declare function overrideOutline<Data extends IOutlineData = IOutlineData, Param extends IOutlineParam = IOutlineParam>(outlineSchema: TOutlineSchema<Data, Param>): IOutlineSchema<any, any>;
12581
12597
 
12582
12598
  /**
12583
12599
  * Marks a client as online in the specified swarm.
@@ -15975,4 +15991,4 @@ declare const Utils: {
15975
15991
  PersistEmbeddingUtils: typeof PersistEmbeddingUtils;
15976
15992
  };
15977
15993
 
15978
- 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, commitDeveloperMessage, commitDeveloperMessageForce, 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, toJsonSchema, validate, validateToolArguments };
15994
+ 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, commitDeveloperMessage, commitDeveloperMessageForce, commitFlush, commitFlushForce, commitStopTools, commitStopToolsForce, commitSystemMessage, commitSystemMessageForce, commitToolOutput, commitToolOutputForce, commitToolRequest, commitToolRequestForce, commitUserMessage, commitUserMessageForce, complete, createNavigateToAgent, createNavigateToTriageAgent, disposeConnection, dumpAgent, dumpClientPerformance, dumpDocs, dumpOutlineResult, 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, toJsonSchema, validate, validateToolArguments };