@aigne/core 1.73.0-beta → 1.74.0-beta
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 +11 -11
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/agents/agent.cjs +874 -0
- package/dist/agents/agent.d.cts +967 -0
- package/dist/agents/agent.d.cts.map +1 -0
- package/dist/agents/agent.d.mts +967 -0
- package/dist/agents/agent.d.mts.map +1 -0
- package/dist/agents/agent.mjs +863 -0
- package/dist/agents/agent.mjs.map +1 -0
- package/dist/agents/ai-agent.cjs +524 -0
- package/dist/agents/ai-agent.d.cts +401 -0
- package/dist/agents/ai-agent.d.cts.map +1 -0
- package/dist/agents/ai-agent.d.mts +401 -0
- package/dist/agents/ai-agent.d.mts.map +1 -0
- package/dist/agents/ai-agent.mjs +519 -0
- package/dist/agents/ai-agent.mjs.map +1 -0
- package/dist/agents/chat-model.cjs +397 -0
- package/dist/agents/chat-model.d.cts +674 -0
- package/dist/agents/chat-model.d.cts.map +1 -0
- package/dist/agents/chat-model.d.mts +674 -0
- package/dist/agents/chat-model.d.mts.map +1 -0
- package/dist/agents/chat-model.mjs +391 -0
- package/dist/agents/chat-model.mjs.map +1 -0
- package/dist/agents/guide-rail-agent.cjs +17 -0
- package/dist/agents/guide-rail-agent.d.cts +67 -0
- package/dist/agents/guide-rail-agent.d.cts.map +1 -0
- package/dist/agents/guide-rail-agent.d.mts +67 -0
- package/dist/agents/guide-rail-agent.d.mts.map +1 -0
- package/dist/agents/guide-rail-agent.mjs +17 -0
- package/dist/agents/guide-rail-agent.mjs.map +1 -0
- package/dist/agents/image-agent.cjs +74 -0
- package/dist/agents/image-agent.d.cts +44 -0
- package/dist/agents/image-agent.d.cts.map +1 -0
- package/dist/agents/image-agent.d.mts +44 -0
- package/dist/agents/image-agent.d.mts.map +1 -0
- package/dist/agents/image-agent.mjs +72 -0
- package/dist/agents/image-agent.mjs.map +1 -0
- package/dist/agents/image-model.cjs +83 -0
- package/dist/agents/image-model.d.cts +276 -0
- package/dist/agents/image-model.d.cts.map +1 -0
- package/dist/agents/image-model.d.mts +276 -0
- package/dist/agents/image-model.d.mts.map +1 -0
- package/dist/agents/image-model.mjs +81 -0
- package/dist/agents/image-model.mjs.map +1 -0
- package/dist/agents/mcp-agent.cjs +307 -0
- package/dist/agents/mcp-agent.d.cts +235 -0
- package/dist/agents/mcp-agent.d.cts.map +1 -0
- package/dist/agents/mcp-agent.d.mts +235 -0
- package/dist/agents/mcp-agent.d.mts.map +1 -0
- package/dist/agents/mcp-agent.mjs +303 -0
- package/dist/agents/mcp-agent.mjs.map +1 -0
- package/dist/agents/model.cjs +143 -0
- package/dist/agents/model.d.cts +257 -0
- package/dist/agents/model.d.cts.map +1 -0
- package/dist/agents/model.d.mts +257 -0
- package/dist/agents/model.d.mts.map +1 -0
- package/dist/agents/model.mjs +136 -0
- package/dist/agents/model.mjs.map +1 -0
- package/dist/agents/team-agent.cjs +342 -0
- package/dist/agents/team-agent.d.cts +390 -0
- package/dist/agents/team-agent.d.cts.map +1 -0
- package/dist/agents/team-agent.d.mts +390 -0
- package/dist/agents/team-agent.d.mts.map +1 -0
- package/dist/agents/team-agent.mjs +339 -0
- package/dist/agents/team-agent.mjs.map +1 -0
- package/dist/agents/transform-agent.cjs +77 -0
- package/dist/agents/transform-agent.d.cts +99 -0
- package/dist/agents/transform-agent.d.cts.map +1 -0
- package/dist/agents/transform-agent.d.mts +99 -0
- package/dist/agents/transform-agent.d.mts.map +1 -0
- package/dist/agents/transform-agent.mjs +76 -0
- package/dist/agents/transform-agent.mjs.map +1 -0
- package/dist/agents/types.cjs +30 -0
- package/dist/agents/types.d.cts +34 -0
- package/dist/agents/types.d.cts.map +1 -0
- package/dist/agents/types.d.mts +34 -0
- package/dist/agents/types.d.mts.map +1 -0
- package/dist/agents/types.mjs +25 -0
- package/dist/agents/types.mjs.map +1 -0
- package/dist/agents/user-agent.cjs +87 -0
- package/dist/agents/user-agent.d.cts +32 -0
- package/dist/agents/user-agent.d.cts.map +1 -0
- package/dist/agents/user-agent.d.mts +32 -0
- package/dist/agents/user-agent.d.mts.map +1 -0
- package/dist/agents/user-agent.mjs +88 -0
- package/dist/agents/user-agent.mjs.map +1 -0
- package/dist/agents/video-model.cjs +66 -0
- package/dist/agents/video-model.d.cts +286 -0
- package/dist/agents/video-model.d.cts.map +1 -0
- package/dist/agents/video-model.d.mts +286 -0
- package/dist/agents/video-model.d.mts.map +1 -0
- package/dist/agents/video-model.mjs +64 -0
- package/dist/agents/video-model.mjs.map +1 -0
- package/dist/aigne/aigne.cjs +235 -0
- package/dist/aigne/aigne.d.cts +340 -0
- package/dist/aigne/aigne.d.cts.map +1 -0
- package/dist/aigne/aigne.d.mts +340 -0
- package/dist/aigne/aigne.d.mts.map +1 -0
- package/dist/aigne/aigne.mjs +235 -0
- package/dist/aigne/aigne.mjs.map +1 -0
- package/dist/aigne/context.cjs +377 -0
- package/dist/aigne/context.d.cts +226 -0
- package/dist/aigne/context.d.cts.map +1 -0
- package/dist/aigne/context.d.mts +226 -0
- package/dist/aigne/context.d.mts.map +1 -0
- package/dist/aigne/context.mjs +376 -0
- package/dist/aigne/context.mjs.map +1 -0
- package/dist/aigne/index.cjs +4 -0
- package/dist/aigne/index.d.mts +5 -0
- package/dist/aigne/index.mjs +6 -0
- package/dist/aigne/message-queue.cjs +102 -0
- package/dist/aigne/message-queue.d.cts +52 -0
- package/dist/aigne/message-queue.d.cts.map +1 -0
- package/dist/aigne/message-queue.d.mts +52 -0
- package/dist/aigne/message-queue.d.mts.map +1 -0
- package/dist/aigne/message-queue.mjs +99 -0
- package/dist/aigne/message-queue.mjs.map +1 -0
- package/dist/aigne/type.d.cts +32 -0
- package/dist/aigne/type.d.cts.map +1 -0
- package/dist/aigne/type.d.mts +32 -0
- package/dist/aigne/type.d.mts.map +1 -0
- package/dist/aigne/usage.cjs +29 -0
- package/dist/aigne/usage.d.cts +32 -0
- package/dist/aigne/usage.d.cts.map +1 -0
- package/dist/aigne/usage.d.mts +32 -0
- package/dist/aigne/usage.d.mts.map +1 -0
- package/dist/aigne/usage.mjs +28 -0
- package/dist/aigne/usage.mjs.map +1 -0
- package/dist/index.cjs +142 -0
- package/dist/index.d.cts +29 -0
- package/dist/index.d.mts +31 -0
- package/dist/index.mjs +31 -0
- package/dist/loader/agent-js.cjs +23 -0
- package/dist/loader/agent-js.d.cts +9 -0
- package/dist/loader/agent-js.d.cts.map +1 -0
- package/dist/loader/agent-js.d.mts +10 -0
- package/dist/loader/agent-js.d.mts.map +1 -0
- package/dist/loader/agent-js.mjs +23 -0
- package/dist/loader/agent-js.mjs.map +1 -0
- package/dist/loader/agent-yaml.cjs +109 -0
- package/dist/loader/agent-yaml.d.cts +87 -0
- package/dist/loader/agent-yaml.d.cts.map +1 -0
- package/dist/loader/agent-yaml.d.mts +87 -0
- package/dist/loader/agent-yaml.d.mts.map +1 -0
- package/dist/loader/agent-yaml.mjs +106 -0
- package/dist/loader/agent-yaml.mjs.map +1 -0
- package/dist/loader/agents.cjs +19 -0
- package/dist/loader/agents.d.cts +9 -0
- package/dist/loader/agents.d.cts.map +1 -0
- package/dist/loader/agents.d.mts +9 -0
- package/dist/loader/agents.d.mts.map +1 -0
- package/dist/loader/agents.mjs +20 -0
- package/dist/loader/agents.mjs.map +1 -0
- package/dist/loader/error.cjs +6 -0
- package/dist/loader/error.d.cts +5 -0
- package/dist/loader/error.d.cts.map +1 -0
- package/dist/loader/error.d.mts +5 -0
- package/dist/loader/error.d.mts.map +1 -0
- package/dist/loader/error.mjs +6 -0
- package/dist/loader/error.mjs.map +1 -0
- package/dist/loader/function-agent.cjs +9 -0
- package/dist/loader/function-agent.d.cts +7 -0
- package/dist/loader/function-agent.d.cts.map +1 -0
- package/dist/loader/function-agent.d.mts +7 -0
- package/dist/loader/function-agent.d.mts.map +1 -0
- package/dist/loader/function-agent.mjs +9 -0
- package/dist/loader/function-agent.mjs.map +1 -0
- package/dist/loader/index.cjs +233 -0
- package/dist/loader/index.d.cts +255 -0
- package/dist/loader/index.d.cts.map +1 -0
- package/dist/loader/index.d.mts +255 -0
- package/dist/loader/index.d.mts.map +1 -0
- package/dist/loader/index.mjs +228 -0
- package/dist/loader/index.mjs.map +1 -0
- package/dist/loader/schema.cjs +135 -0
- package/dist/loader/schema.d.cts +177 -0
- package/dist/loader/schema.d.cts.map +1 -0
- package/dist/loader/schema.d.mts +177 -0
- package/dist/loader/schema.d.mts.map +1 -0
- package/dist/loader/schema.mjs +127 -0
- package/dist/loader/schema.mjs.map +1 -0
- package/dist/memory/index.cjs +3 -0
- package/dist/memory/index.d.mts +3 -0
- package/dist/memory/index.mjs +5 -0
- package/dist/memory/memory.cjs +134 -0
- package/dist/memory/memory.d.cts +103 -0
- package/dist/memory/memory.d.cts.map +1 -0
- package/dist/memory/memory.d.mts +103 -0
- package/dist/memory/memory.d.mts.map +1 -0
- package/dist/memory/memory.mjs +133 -0
- package/dist/memory/memory.mjs.map +1 -0
- package/dist/memory/recorder.cjs +61 -0
- package/dist/memory/recorder.d.cts +98 -0
- package/dist/memory/recorder.d.cts.map +1 -0
- package/dist/memory/recorder.d.mts +98 -0
- package/dist/memory/recorder.d.mts.map +1 -0
- package/dist/memory/recorder.mjs +59 -0
- package/dist/memory/recorder.mjs.map +1 -0
- package/dist/memory/retriever.cjs +60 -0
- package/dist/memory/retriever.d.cts +111 -0
- package/dist/memory/retriever.d.cts.map +1 -0
- package/dist/memory/retriever.d.mts +111 -0
- package/dist/memory/retriever.d.mts.map +1 -0
- package/dist/memory/retriever.mjs +58 -0
- package/dist/memory/retriever.mjs.map +1 -0
- package/dist/prompt/agent-session.cjs +700 -0
- package/dist/prompt/agent-session.d.cts +167 -0
- package/dist/prompt/agent-session.d.cts.map +1 -0
- package/dist/prompt/agent-session.d.mts +167 -0
- package/dist/prompt/agent-session.d.mts.map +1 -0
- package/dist/prompt/agent-session.mjs +700 -0
- package/dist/prompt/agent-session.mjs.map +1 -0
- package/dist/prompt/compact/compactor.cjs +50 -0
- package/dist/prompt/compact/compactor.mjs +50 -0
- package/dist/prompt/compact/compactor.mjs.map +1 -0
- package/dist/prompt/compact/session-memory-extractor.cjs +137 -0
- package/dist/prompt/compact/session-memory-extractor.mjs +137 -0
- package/dist/prompt/compact/session-memory-extractor.mjs.map +1 -0
- package/dist/prompt/compact/types.cjs +59 -0
- package/dist/prompt/compact/types.d.cts +341 -0
- package/dist/prompt/compact/types.d.cts.map +1 -0
- package/dist/prompt/compact/types.d.mts +341 -0
- package/dist/prompt/compact/types.d.mts.map +1 -0
- package/dist/prompt/compact/types.mjs +49 -0
- package/dist/prompt/compact/types.mjs.map +1 -0
- package/dist/prompt/compact/user-memory-extractor.cjs +118 -0
- package/dist/prompt/compact/user-memory-extractor.mjs +118 -0
- package/dist/prompt/compact/user-memory-extractor.mjs.map +1 -0
- package/dist/prompt/context/afs/history.cjs +30 -0
- package/dist/prompt/context/afs/history.mjs +30 -0
- package/dist/prompt/context/afs/history.mjs.map +1 -0
- package/dist/prompt/context/afs/index.cjs +60 -0
- package/dist/prompt/context/afs/index.mjs +61 -0
- package/dist/prompt/context/afs/index.mjs.map +1 -0
- package/dist/prompt/context/index.cjs +18 -0
- package/dist/prompt/context/index.mjs +19 -0
- package/dist/prompt/context/index.mjs.map +1 -0
- package/dist/prompt/filters/index.cjs +22 -0
- package/dist/prompt/filters/index.mjs +21 -0
- package/dist/prompt/filters/index.mjs.map +1 -0
- package/dist/prompt/prompt-builder.cjs +291 -0
- package/dist/prompt/prompt-builder.d.cts +57 -0
- package/dist/prompt/prompt-builder.d.cts.map +1 -0
- package/dist/prompt/prompt-builder.d.mts +57 -0
- package/dist/prompt/prompt-builder.d.mts.map +1 -0
- package/dist/prompt/prompt-builder.mjs +291 -0
- package/dist/prompt/prompt-builder.mjs.map +1 -0
- package/dist/prompt/prompts/afs-builtin-prompt.cjs +12 -0
- package/dist/prompt/prompts/afs-builtin-prompt.mjs +13 -0
- package/dist/prompt/prompts/afs-builtin-prompt.mjs.map +1 -0
- package/dist/prompt/prompts/memory-message-template.cjs +10 -0
- package/dist/prompt/prompts/memory-message-template.mjs +10 -0
- package/dist/prompt/prompts/memory-message-template.mjs.map +1 -0
- package/dist/prompt/prompts/structured-stream-instructions.cjs +30 -0
- package/dist/prompt/prompts/structured-stream-instructions.mjs +30 -0
- package/dist/prompt/prompts/structured-stream-instructions.mjs.map +1 -0
- package/dist/prompt/skills/afs/agent-skill/agent-skill.cjs +66 -0
- package/dist/prompt/skills/afs/agent-skill/agent-skill.mjs +66 -0
- package/dist/prompt/skills/afs/agent-skill/agent-skill.mjs.map +1 -0
- package/dist/prompt/skills/afs/agent-skill/skill-loader.cjs +42 -0
- package/dist/prompt/skills/afs/agent-skill/skill-loader.mjs +41 -0
- package/dist/prompt/skills/afs/agent-skill/skill-loader.mjs.map +1 -0
- package/dist/prompt/skills/afs/base.cjs +9 -0
- package/dist/prompt/skills/afs/base.mjs +10 -0
- package/dist/prompt/skills/afs/base.mjs.map +1 -0
- package/dist/prompt/skills/afs/delete.cjs +50 -0
- package/dist/prompt/skills/afs/delete.mjs +50 -0
- package/dist/prompt/skills/afs/delete.mjs.map +1 -0
- package/dist/prompt/skills/afs/edit.cjs +92 -0
- package/dist/prompt/skills/afs/edit.mjs +92 -0
- package/dist/prompt/skills/afs/edit.mjs.map +1 -0
- package/dist/prompt/skills/afs/exec.cjs +36 -0
- package/dist/prompt/skills/afs/exec.mjs +36 -0
- package/dist/prompt/skills/afs/exec.mjs.map +1 -0
- package/dist/prompt/skills/afs/index.cjs +28 -0
- package/dist/prompt/skills/afs/index.mjs +29 -0
- package/dist/prompt/skills/afs/index.mjs.map +1 -0
- package/dist/prompt/skills/afs/list.cjs +69 -0
- package/dist/prompt/skills/afs/list.mjs +69 -0
- package/dist/prompt/skills/afs/list.mjs.map +1 -0
- package/dist/prompt/skills/afs/read.cjs +86 -0
- package/dist/prompt/skills/afs/read.mjs +86 -0
- package/dist/prompt/skills/afs/read.mjs.map +1 -0
- package/dist/prompt/skills/afs/rename.cjs +53 -0
- package/dist/prompt/skills/afs/rename.mjs +53 -0
- package/dist/prompt/skills/afs/rename.mjs.map +1 -0
- package/dist/prompt/skills/afs/search.cjs +63 -0
- package/dist/prompt/skills/afs/search.mjs +63 -0
- package/dist/prompt/skills/afs/search.mjs.map +1 -0
- package/dist/prompt/skills/afs/write.cjs +51 -0
- package/dist/prompt/skills/afs/write.mjs +51 -0
- package/dist/prompt/skills/afs/write.mjs.map +1 -0
- package/dist/prompt/template.cjs +229 -0
- package/dist/prompt/template.d.cts +247 -0
- package/dist/prompt/template.d.cts.map +1 -0
- package/dist/prompt/template.d.mts +247 -0
- package/dist/prompt/template.d.mts.map +1 -0
- package/dist/prompt/template.mjs +219 -0
- package/dist/prompt/template.mjs.map +1 -0
- package/dist/utils/agent-utils.cjs +49 -0
- package/dist/utils/agent-utils.d.cts +22 -0
- package/dist/utils/agent-utils.d.cts.map +1 -0
- package/dist/utils/agent-utils.d.mts +22 -0
- package/dist/utils/agent-utils.d.mts.map +1 -0
- package/dist/utils/agent-utils.mjs +46 -0
- package/dist/utils/agent-utils.mjs.map +1 -0
- package/dist/utils/camelize.cjs +34 -0
- package/dist/utils/camelize.d.cts +9 -0
- package/dist/utils/camelize.d.cts.map +1 -0
- package/dist/utils/camelize.d.mts +9 -0
- package/dist/utils/camelize.d.mts.map +1 -0
- package/dist/utils/camelize.mjs +33 -0
- package/dist/utils/camelize.mjs.map +1 -0
- package/dist/utils/event-stream.cjs +136 -0
- package/dist/utils/event-stream.d.cts +20 -0
- package/dist/utils/event-stream.d.cts.map +1 -0
- package/dist/utils/event-stream.d.mts +20 -0
- package/dist/utils/event-stream.d.mts.map +1 -0
- package/dist/utils/event-stream.mjs +133 -0
- package/dist/utils/event-stream.mjs.map +1 -0
- package/dist/utils/fetch.cjs +32 -0
- package/dist/utils/fetch.d.cts +8 -0
- package/dist/utils/fetch.d.cts.map +1 -0
- package/dist/utils/fetch.d.mts +8 -0
- package/dist/utils/fetch.d.mts.map +1 -0
- package/dist/utils/fetch.mjs +32 -0
- package/dist/utils/fetch.mjs.map +1 -0
- package/dist/utils/json-schema.cjs +107 -0
- package/dist/utils/json-schema.d.cts +20 -0
- package/dist/utils/json-schema.d.cts.map +1 -0
- package/dist/utils/json-schema.d.mts +20 -0
- package/dist/utils/json-schema.d.mts.map +1 -0
- package/dist/utils/json-schema.mjs +102 -0
- package/dist/utils/json-schema.mjs.map +1 -0
- package/dist/utils/json-utils.cjs +46 -0
- package/dist/utils/json-utils.d.cts +28 -0
- package/dist/utils/json-utils.d.cts.map +1 -0
- package/dist/utils/json-utils.d.mts +28 -0
- package/dist/utils/json-utils.d.mts.map +1 -0
- package/dist/utils/json-utils.mjs +44 -0
- package/dist/utils/json-utils.mjs.map +1 -0
- package/dist/utils/logger.cjs +72 -0
- package/dist/utils/logger.d.cts +41 -0
- package/dist/utils/logger.d.cts.map +1 -0
- package/dist/utils/logger.d.mts +41 -0
- package/dist/utils/logger.d.mts.map +1 -0
- package/dist/utils/logger.mjs +68 -0
- package/dist/utils/logger.mjs.map +1 -0
- package/dist/utils/mcp-utils.cjs +53 -0
- package/dist/utils/mcp-utils.d.cts +10 -0
- package/dist/utils/mcp-utils.d.cts.map +1 -0
- package/dist/utils/mcp-utils.d.mts +10 -0
- package/dist/utils/mcp-utils.d.mts.map +1 -0
- package/dist/utils/mcp-utils.mjs +51 -0
- package/dist/utils/mcp-utils.mjs.map +1 -0
- package/dist/utils/model-utils.cjs +12 -0
- package/dist/utils/model-utils.d.cts +8 -0
- package/dist/utils/model-utils.d.cts.map +1 -0
- package/dist/utils/model-utils.d.mts +8 -0
- package/dist/utils/model-utils.d.mts.map +1 -0
- package/dist/utils/model-utils.mjs +12 -0
- package/dist/utils/model-utils.mjs.map +1 -0
- package/dist/utils/promise.cjs +17 -0
- package/dist/utils/promise.d.cts +10 -0
- package/dist/utils/promise.d.cts.map +1 -0
- package/dist/utils/promise.d.mts +10 -0
- package/dist/utils/promise.d.mts.map +1 -0
- package/dist/utils/promise.mjs +17 -0
- package/dist/utils/promise.mjs.map +1 -0
- package/dist/utils/prompts.cjs +19 -0
- package/dist/utils/prompts.d.cts +6 -0
- package/dist/utils/prompts.d.cts.map +1 -0
- package/dist/utils/prompts.d.mts +6 -0
- package/dist/utils/prompts.d.mts.map +1 -0
- package/dist/utils/prompts.mjs +18 -0
- package/dist/utils/prompts.mjs.map +1 -0
- package/dist/utils/queue.cjs +273 -0
- package/dist/utils/queue.d.cts +60 -0
- package/dist/utils/queue.d.cts.map +1 -0
- package/dist/utils/queue.d.mts +60 -0
- package/dist/utils/queue.d.mts.map +1 -0
- package/dist/utils/queue.mjs +271 -0
- package/dist/utils/queue.mjs.map +1 -0
- package/dist/utils/role-utils.cjs +40 -0
- package/dist/utils/role-utils.d.cts +32 -0
- package/dist/utils/role-utils.d.cts.map +1 -0
- package/dist/utils/role-utils.d.mts +32 -0
- package/dist/utils/role-utils.d.mts.map +1 -0
- package/dist/utils/role-utils.mjs +38 -0
- package/dist/utils/role-utils.mjs.map +1 -0
- package/dist/utils/stream-polyfill.cjs +37 -0
- package/dist/utils/stream-polyfill.d.cts +1 -0
- package/dist/utils/stream-polyfill.d.mts +1 -0
- package/dist/utils/stream-polyfill.mjs +38 -0
- package/dist/utils/stream-polyfill.mjs.map +1 -0
- package/dist/utils/stream-utils.cjs +187 -0
- package/dist/utils/stream-utils.d.cts +30 -0
- package/dist/utils/stream-utils.d.cts.map +1 -0
- package/dist/utils/stream-utils.d.mts +30 -0
- package/dist/utils/stream-utils.d.mts.map +1 -0
- package/dist/utils/stream-utils.mjs +174 -0
- package/dist/utils/stream-utils.mjs.map +1 -0
- package/dist/utils/structured-stream-extractor.cjs +63 -0
- package/dist/utils/structured-stream-extractor.d.cts +23 -0
- package/dist/utils/structured-stream-extractor.d.cts.map +1 -0
- package/dist/utils/structured-stream-extractor.d.mts +23 -0
- package/dist/utils/structured-stream-extractor.d.mts.map +1 -0
- package/dist/utils/structured-stream-extractor.mjs +64 -0
- package/dist/utils/structured-stream-extractor.mjs.map +1 -0
- package/dist/utils/test/agent-response.cjs +16 -0
- package/dist/utils/test/agent-response.d.cts +12 -0
- package/dist/utils/test/agent-response.d.cts.map +1 -0
- package/dist/utils/test/agent-response.d.mts +13 -0
- package/dist/utils/test/agent-response.d.mts.map +1 -0
- package/dist/utils/test/agent-response.mjs +17 -0
- package/dist/utils/test/agent-response.mjs.map +1 -0
- package/dist/utils/test/openai-like-utils.cjs +73 -0
- package/dist/utils/test/openai-like-utils.d.cts +13 -0
- package/dist/utils/test/openai-like-utils.d.cts.map +1 -0
- package/dist/utils/test/openai-like-utils.d.mts +14 -0
- package/dist/utils/test/openai-like-utils.d.mts.map +1 -0
- package/dist/utils/test/openai-like-utils.mjs +68 -0
- package/dist/utils/test/openai-like-utils.mjs.map +1 -0
- package/dist/utils/token-estimator.cjs +57 -0
- package/dist/utils/token-estimator.d.cts +13 -0
- package/dist/utils/token-estimator.d.cts.map +1 -0
- package/dist/utils/token-estimator.d.mts +13 -0
- package/dist/utils/token-estimator.d.mts.map +1 -0
- package/dist/utils/token-estimator.mjs +57 -0
- package/dist/utils/token-estimator.mjs.map +1 -0
- package/dist/utils/type-utils.cjs +159 -0
- package/dist/utils/type-utils.d.cts +32 -0
- package/dist/utils/type-utils.d.cts.map +1 -0
- package/dist/utils/type-utils.d.mts +32 -0
- package/dist/utils/type-utils.d.mts.map +1 -0
- package/dist/utils/type-utils.mjs +141 -0
- package/dist/utils/type-utils.mjs.map +1 -0
- package/dist/utils/typed-event-emitter.cjs +0 -0
- package/dist/utils/typed-event-emitter.d.cts +13 -0
- package/dist/utils/typed-event-emitter.d.cts.map +1 -0
- package/dist/utils/typed-event-emitter.d.mts +13 -0
- package/dist/utils/typed-event-emitter.d.mts.map +1 -0
- package/dist/utils/typed-event-emitter.mjs +1 -0
- package/package.json +143 -62
- package/CHANGELOG.md +0 -2603
- package/lib/cjs/agents/agent.d.ts +0 -961
- package/lib/cjs/agents/agent.js +0 -961
- package/lib/cjs/agents/ai-agent.d.ts +0 -395
- package/lib/cjs/agents/ai-agent.js +0 -572
- package/lib/cjs/agents/chat-model.d.ts +0 -672
- package/lib/cjs/agents/chat-model.js +0 -457
- package/lib/cjs/agents/guide-rail-agent.d.ts +0 -62
- package/lib/cjs/agents/guide-rail-agent.js +0 -14
- package/lib/cjs/agents/image-agent.d.ts +0 -38
- package/lib/cjs/agents/image-agent.js +0 -71
- package/lib/cjs/agents/image-model.d.ts +0 -270
- package/lib/cjs/agents/image-model.js +0 -91
- package/lib/cjs/agents/mcp-agent.d.ts +0 -231
- package/lib/cjs/agents/mcp-agent.js +0 -366
- package/lib/cjs/agents/model.d.ts +0 -252
- package/lib/cjs/agents/model.js +0 -180
- package/lib/cjs/agents/team-agent.d.ts +0 -382
- package/lib/cjs/agents/team-agent.js +0 -386
- package/lib/cjs/agents/transform-agent.d.ts +0 -94
- package/lib/cjs/agents/transform-agent.js +0 -80
- package/lib/cjs/agents/types.d.ts +0 -31
- package/lib/cjs/agents/types.js +0 -40
- package/lib/cjs/agents/user-agent.d.ts +0 -27
- package/lib/cjs/agents/user-agent.js +0 -90
- package/lib/cjs/agents/video-model.d.ts +0 -280
- package/lib/cjs/agents/video-model.js +0 -67
- package/lib/cjs/aigne/aigne.d.ts +0 -335
- package/lib/cjs/aigne/aigne.js +0 -248
- package/lib/cjs/aigne/context.d.ts +0 -220
- package/lib/cjs/aigne/context.js +0 -423
- package/lib/cjs/aigne/index.d.ts +0 -4
- package/lib/cjs/aigne/index.js +0 -20
- package/lib/cjs/aigne/message-queue.d.ts +0 -48
- package/lib/cjs/aigne/message-queue.js +0 -109
- package/lib/cjs/aigne/type.d.ts +0 -27
- package/lib/cjs/aigne/type.js +0 -2
- package/lib/cjs/aigne/usage.d.ts +0 -28
- package/lib/cjs/aigne/usage.js +0 -34
- package/lib/cjs/index.d.ts +0 -21
- package/lib/cjs/index.js +0 -37
- package/lib/cjs/loader/agent-js.d.ts +0 -2
- package/lib/cjs/loader/agent-js.js +0 -21
- package/lib/cjs/loader/agent-yaml.d.ts +0 -78
- package/lib/cjs/loader/agent-yaml.js +0 -120
- package/lib/cjs/loader/agents.d.ts +0 -4
- package/lib/cjs/loader/agents.js +0 -17
- package/lib/cjs/loader/error.d.ts +0 -2
- package/lib/cjs/loader/error.js +0 -6
- package/lib/cjs/loader/function-agent.d.ts +0 -2
- package/lib/cjs/loader/function-agent.js +0 -7
- package/lib/cjs/loader/index.d.ts +0 -251
- package/lib/cjs/loader/index.js +0 -268
- package/lib/cjs/loader/schema.d.ts +0 -167
- package/lib/cjs/loader/schema.js +0 -162
- package/lib/cjs/memory/index.d.ts +0 -3
- package/lib/cjs/memory/index.js +0 -19
- package/lib/cjs/memory/memory.d.ts +0 -93
- package/lib/cjs/memory/memory.js +0 -147
- package/lib/cjs/memory/recorder.d.ts +0 -93
- package/lib/cjs/memory/recorder.js +0 -63
- package/lib/cjs/memory/retriever.d.ts +0 -106
- package/lib/cjs/memory/retriever.js +0 -60
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/prompt/agent-session.d.ts +0 -163
- package/lib/cjs/prompt/agent-session.js +0 -1008
- package/lib/cjs/prompt/compact/compactor.d.ts +0 -7
- package/lib/cjs/prompt/compact/compactor.js +0 -52
- package/lib/cjs/prompt/compact/session-memory-extractor.d.ts +0 -7
- package/lib/cjs/prompt/compact/session-memory-extractor.js +0 -143
- package/lib/cjs/prompt/compact/types.d.ts +0 -336
- package/lib/cjs/prompt/compact/types.js +0 -53
- package/lib/cjs/prompt/compact/user-memory-extractor.d.ts +0 -7
- package/lib/cjs/prompt/compact/user-memory-extractor.js +0 -124
- package/lib/cjs/prompt/context/afs/history.d.ts +0 -9
- package/lib/cjs/prompt/context/afs/history.js +0 -33
- package/lib/cjs/prompt/context/afs/index.d.ts +0 -20
- package/lib/cjs/prompt/context/afs/index.js +0 -54
- package/lib/cjs/prompt/context/index.d.ts +0 -31
- package/lib/cjs/prompt/context/index.js +0 -18
- package/lib/cjs/prompt/filters/index.d.ts +0 -2
- package/lib/cjs/prompt/filters/index.js +0 -51
- package/lib/cjs/prompt/prompt-builder.d.ts +0 -50
- package/lib/cjs/prompt/prompt-builder.js +0 -352
- package/lib/cjs/prompt/prompts/afs-builtin-prompt.d.ts +0 -4
- package/lib/cjs/prompt/prompts/afs-builtin-prompt.js +0 -36
- package/lib/cjs/prompt/prompts/memory-message-template.d.ts +0 -1
- package/lib/cjs/prompt/prompts/memory-message-template.js +0 -8
- package/lib/cjs/prompt/prompts/structured-stream-instructions.d.ts +0 -7
- package/lib/cjs/prompt/prompts/structured-stream-instructions.js +0 -27
- package/lib/cjs/prompt/skills/afs/agent-skill/agent-skill.d.ts +0 -19
- package/lib/cjs/prompt/skills/afs/agent-skill/agent-skill.js +0 -69
- package/lib/cjs/prompt/skills/afs/agent-skill/skill-loader.d.ts +0 -12
- package/lib/cjs/prompt/skills/afs/agent-skill/skill-loader.js +0 -50
- package/lib/cjs/prompt/skills/afs/base.d.ts +0 -4
- package/lib/cjs/prompt/skills/afs/base.js +0 -8
- package/lib/cjs/prompt/skills/afs/delete.d.ts +0 -19
- package/lib/cjs/prompt/skills/afs/delete.js +0 -55
- package/lib/cjs/prompt/skills/afs/edit.d.ts +0 -24
- package/lib/cjs/prompt/skills/afs/edit.js +0 -122
- package/lib/cjs/prompt/skills/afs/exec.d.ts +0 -16
- package/lib/cjs/prompt/skills/afs/exec.js +0 -43
- package/lib/cjs/prompt/skills/afs/index.d.ts +0 -3
- package/lib/cjs/prompt/skills/afs/index.js +0 -26
- package/lib/cjs/prompt/skills/afs/list.d.ts +0 -24
- package/lib/cjs/prompt/skills/afs/list.js +0 -82
- package/lib/cjs/prompt/skills/afs/read.d.ts +0 -28
- package/lib/cjs/prompt/skills/afs/read.js +0 -105
- package/lib/cjs/prompt/skills/afs/rename.d.ts +0 -21
- package/lib/cjs/prompt/skills/afs/rename.js +0 -60
- package/lib/cjs/prompt/skills/afs/search.d.ts +0 -24
- package/lib/cjs/prompt/skills/afs/search.js +0 -74
- package/lib/cjs/prompt/skills/afs/write.d.ts +0 -20
- package/lib/cjs/prompt/skills/afs/write.js +0 -60
- package/lib/cjs/prompt/template.d.ts +0 -243
- package/lib/cjs/prompt/template.js +0 -265
- package/lib/cjs/utils/agent-utils.d.ts +0 -13
- package/lib/cjs/utils/agent-utils.js +0 -60
- package/lib/cjs/utils/camelize.d.ts +0 -7
- package/lib/cjs/utils/camelize.js +0 -38
- package/lib/cjs/utils/event-stream.d.ts +0 -15
- package/lib/cjs/utils/event-stream.js +0 -158
- package/lib/cjs/utils/fetch.d.ts +0 -4
- package/lib/cjs/utils/fetch.js +0 -36
- package/lib/cjs/utils/json-schema.d.ts +0 -15
- package/lib/cjs/utils/json-schema.js +0 -123
- package/lib/cjs/utils/json-utils.d.ts +0 -24
- package/lib/cjs/utils/json-utils.js +0 -48
- package/lib/cjs/utils/logger.d.ts +0 -39
- package/lib/cjs/utils/logger.js +0 -81
- package/lib/cjs/utils/mcp-utils.d.ts +0 -5
- package/lib/cjs/utils/mcp-utils.js +0 -52
- package/lib/cjs/utils/model-utils.d.ts +0 -3
- package/lib/cjs/utils/model-utils.js +0 -10
- package/lib/cjs/utils/promise.d.ts +0 -6
- package/lib/cjs/utils/promise.js +0 -12
- package/lib/cjs/utils/prompts.d.ts +0 -2
- package/lib/cjs/utils/prompts.js +0 -22
- package/lib/cjs/utils/queue.d.ts +0 -57
- package/lib/cjs/utils/queue.js +0 -318
- package/lib/cjs/utils/role-utils.d.ts +0 -31
- package/lib/cjs/utils/role-utils.js +0 -37
- package/lib/cjs/utils/stream-polyfill.d.ts +0 -1
- package/lib/cjs/utils/stream-polyfill.js +0 -38
- package/lib/cjs/utils/stream-utils.d.ts +0 -26
- package/lib/cjs/utils/stream-utils.js +0 -235
- package/lib/cjs/utils/structured-stream-extractor.d.ts +0 -14
- package/lib/cjs/utils/structured-stream-extractor.js +0 -68
- package/lib/cjs/utils/token-estimator.d.ts +0 -9
- package/lib/cjs/utils/token-estimator.js +0 -66
- package/lib/cjs/utils/type-utils.d.ts +0 -31
- package/lib/cjs/utils/type-utils.js +0 -202
- package/lib/cjs/utils/typed-event-emitter.d.ts +0 -10
- package/lib/cjs/utils/typed-event-emitter.js +0 -2
- package/lib/dts/agents/agent.d.ts +0 -961
- package/lib/dts/agents/ai-agent.d.ts +0 -395
- package/lib/dts/agents/chat-model.d.ts +0 -672
- package/lib/dts/agents/guide-rail-agent.d.ts +0 -62
- package/lib/dts/agents/image-agent.d.ts +0 -38
- package/lib/dts/agents/image-model.d.ts +0 -270
- package/lib/dts/agents/mcp-agent.d.ts +0 -231
- package/lib/dts/agents/model.d.ts +0 -252
- package/lib/dts/agents/team-agent.d.ts +0 -382
- package/lib/dts/agents/transform-agent.d.ts +0 -94
- package/lib/dts/agents/types.d.ts +0 -31
- package/lib/dts/agents/user-agent.d.ts +0 -27
- package/lib/dts/agents/video-model.d.ts +0 -280
- package/lib/dts/aigne/aigne.d.ts +0 -335
- package/lib/dts/aigne/context.d.ts +0 -220
- package/lib/dts/aigne/index.d.ts +0 -4
- package/lib/dts/aigne/message-queue.d.ts +0 -48
- package/lib/dts/aigne/type.d.ts +0 -27
- package/lib/dts/aigne/usage.d.ts +0 -28
- package/lib/dts/index.d.ts +0 -21
- package/lib/dts/loader/agent-js.d.ts +0 -2
- package/lib/dts/loader/agent-yaml.d.ts +0 -78
- package/lib/dts/loader/agents.d.ts +0 -4
- package/lib/dts/loader/error.d.ts +0 -2
- package/lib/dts/loader/function-agent.d.ts +0 -2
- package/lib/dts/loader/index.d.ts +0 -251
- package/lib/dts/loader/schema.d.ts +0 -167
- package/lib/dts/memory/index.d.ts +0 -3
- package/lib/dts/memory/memory.d.ts +0 -93
- package/lib/dts/memory/recorder.d.ts +0 -93
- package/lib/dts/memory/retriever.d.ts +0 -106
- package/lib/dts/prompt/agent-session.d.ts +0 -163
- package/lib/dts/prompt/compact/compactor.d.ts +0 -7
- package/lib/dts/prompt/compact/session-memory-extractor.d.ts +0 -7
- package/lib/dts/prompt/compact/types.d.ts +0 -336
- package/lib/dts/prompt/compact/user-memory-extractor.d.ts +0 -7
- package/lib/dts/prompt/context/afs/history.d.ts +0 -9
- package/lib/dts/prompt/context/afs/index.d.ts +0 -20
- package/lib/dts/prompt/context/index.d.ts +0 -31
- package/lib/dts/prompt/filters/index.d.ts +0 -2
- package/lib/dts/prompt/prompt-builder.d.ts +0 -50
- package/lib/dts/prompt/prompts/afs-builtin-prompt.d.ts +0 -4
- package/lib/dts/prompt/prompts/memory-message-template.d.ts +0 -1
- package/lib/dts/prompt/prompts/structured-stream-instructions.d.ts +0 -7
- package/lib/dts/prompt/skills/afs/agent-skill/agent-skill.d.ts +0 -19
- package/lib/dts/prompt/skills/afs/agent-skill/skill-loader.d.ts +0 -12
- package/lib/dts/prompt/skills/afs/base.d.ts +0 -4
- package/lib/dts/prompt/skills/afs/delete.d.ts +0 -19
- package/lib/dts/prompt/skills/afs/edit.d.ts +0 -24
- package/lib/dts/prompt/skills/afs/exec.d.ts +0 -16
- package/lib/dts/prompt/skills/afs/index.d.ts +0 -3
- package/lib/dts/prompt/skills/afs/list.d.ts +0 -24
- package/lib/dts/prompt/skills/afs/read.d.ts +0 -28
- package/lib/dts/prompt/skills/afs/rename.d.ts +0 -21
- package/lib/dts/prompt/skills/afs/search.d.ts +0 -24
- package/lib/dts/prompt/skills/afs/write.d.ts +0 -20
- package/lib/dts/prompt/template.d.ts +0 -243
- package/lib/dts/utils/agent-utils.d.ts +0 -13
- package/lib/dts/utils/camelize.d.ts +0 -7
- package/lib/dts/utils/event-stream.d.ts +0 -15
- package/lib/dts/utils/fetch.d.ts +0 -4
- package/lib/dts/utils/json-schema.d.ts +0 -15
- package/lib/dts/utils/json-utils.d.ts +0 -24
- package/lib/dts/utils/logger.d.ts +0 -39
- package/lib/dts/utils/mcp-utils.d.ts +0 -5
- package/lib/dts/utils/model-utils.d.ts +0 -3
- package/lib/dts/utils/promise.d.ts +0 -6
- package/lib/dts/utils/prompts.d.ts +0 -2
- package/lib/dts/utils/queue.d.ts +0 -57
- package/lib/dts/utils/role-utils.d.ts +0 -31
- package/lib/dts/utils/stream-polyfill.d.ts +0 -1
- package/lib/dts/utils/stream-utils.d.ts +0 -26
- package/lib/dts/utils/structured-stream-extractor.d.ts +0 -14
- package/lib/dts/utils/token-estimator.d.ts +0 -9
- package/lib/dts/utils/type-utils.d.ts +0 -31
- package/lib/dts/utils/typed-event-emitter.d.ts +0 -10
- package/lib/esm/agents/agent.d.ts +0 -961
- package/lib/esm/agents/agent.js +0 -911
- package/lib/esm/agents/ai-agent.d.ts +0 -395
- package/lib/esm/agents/ai-agent.js +0 -535
- package/lib/esm/agents/chat-model.d.ts +0 -672
- package/lib/esm/agents/chat-model.js +0 -419
- package/lib/esm/agents/guide-rail-agent.d.ts +0 -62
- package/lib/esm/agents/guide-rail-agent.js +0 -11
- package/lib/esm/agents/image-agent.d.ts +0 -38
- package/lib/esm/agents/image-agent.js +0 -64
- package/lib/esm/agents/image-model.d.ts +0 -270
- package/lib/esm/agents/image-model.js +0 -87
- package/lib/esm/agents/mcp-agent.d.ts +0 -231
- package/lib/esm/agents/mcp-agent.js +0 -325
- package/lib/esm/agents/model.d.ts +0 -252
- package/lib/esm/agents/model.js +0 -143
- package/lib/esm/agents/team-agent.d.ts +0 -382
- package/lib/esm/agents/team-agent.js +0 -346
- package/lib/esm/agents/transform-agent.d.ts +0 -94
- package/lib/esm/agents/transform-agent.js +0 -73
- package/lib/esm/agents/types.d.ts +0 -31
- package/lib/esm/agents/types.js +0 -30
- package/lib/esm/agents/user-agent.d.ts +0 -27
- package/lib/esm/agents/user-agent.js +0 -86
- package/lib/esm/agents/video-model.d.ts +0 -280
- package/lib/esm/agents/video-model.js +0 -63
- package/lib/esm/aigne/aigne.d.ts +0 -335
- package/lib/esm/aigne/aigne.js +0 -244
- package/lib/esm/aigne/context.d.ts +0 -220
- package/lib/esm/aigne/context.js +0 -416
- package/lib/esm/aigne/index.d.ts +0 -4
- package/lib/esm/aigne/index.js +0 -4
- package/lib/esm/aigne/message-queue.d.ts +0 -48
- package/lib/esm/aigne/message-queue.js +0 -104
- package/lib/esm/aigne/type.d.ts +0 -27
- package/lib/esm/aigne/type.js +0 -1
- package/lib/esm/aigne/usage.d.ts +0 -28
- package/lib/esm/aigne/usage.js +0 -30
- package/lib/esm/index.d.ts +0 -21
- package/lib/esm/index.js +0 -21
- package/lib/esm/loader/agent-js.d.ts +0 -2
- package/lib/esm/loader/agent-js.js +0 -18
- package/lib/esm/loader/agent-yaml.d.ts +0 -78
- package/lib/esm/loader/agent-yaml.js +0 -113
- package/lib/esm/loader/agents.d.ts +0 -4
- package/lib/esm/loader/agents.js +0 -14
- package/lib/esm/loader/error.d.ts +0 -2
- package/lib/esm/loader/error.js +0 -2
- package/lib/esm/loader/function-agent.d.ts +0 -2
- package/lib/esm/loader/function-agent.js +0 -4
- package/lib/esm/loader/index.d.ts +0 -251
- package/lib/esm/loader/index.js +0 -260
- package/lib/esm/loader/schema.d.ts +0 -167
- package/lib/esm/loader/schema.js +0 -153
- package/lib/esm/memory/index.d.ts +0 -3
- package/lib/esm/memory/index.js +0 -3
- package/lib/esm/memory/memory.d.ts +0 -93
- package/lib/esm/memory/memory.js +0 -142
- package/lib/esm/memory/recorder.d.ts +0 -93
- package/lib/esm/memory/recorder.js +0 -59
- package/lib/esm/memory/retriever.d.ts +0 -106
- package/lib/esm/memory/retriever.js +0 -56
- package/lib/esm/package.json +0 -3
- package/lib/esm/prompt/agent-session.d.ts +0 -163
- package/lib/esm/prompt/agent-session.js +0 -968
- package/lib/esm/prompt/compact/compactor.d.ts +0 -7
- package/lib/esm/prompt/compact/compactor.js +0 -48
- package/lib/esm/prompt/compact/session-memory-extractor.d.ts +0 -7
- package/lib/esm/prompt/compact/session-memory-extractor.js +0 -139
- package/lib/esm/prompt/compact/types.d.ts +0 -336
- package/lib/esm/prompt/compact/types.js +0 -50
- package/lib/esm/prompt/compact/user-memory-extractor.d.ts +0 -7
- package/lib/esm/prompt/compact/user-memory-extractor.js +0 -120
- package/lib/esm/prompt/context/afs/history.d.ts +0 -9
- package/lib/esm/prompt/context/afs/history.js +0 -30
- package/lib/esm/prompt/context/afs/index.d.ts +0 -20
- package/lib/esm/prompt/context/afs/index.js +0 -51
- package/lib/esm/prompt/context/index.d.ts +0 -31
- package/lib/esm/prompt/context/index.js +0 -15
- package/lib/esm/prompt/filters/index.d.ts +0 -2
- package/lib/esm/prompt/filters/index.js +0 -15
- package/lib/esm/prompt/prompt-builder.d.ts +0 -50
- package/lib/esm/prompt/prompt-builder.js +0 -348
- package/lib/esm/prompt/prompts/afs-builtin-prompt.d.ts +0 -4
- package/lib/esm/prompt/prompts/afs-builtin-prompt.js +0 -32
- package/lib/esm/prompt/prompts/memory-message-template.d.ts +0 -1
- package/lib/esm/prompt/prompts/memory-message-template.js +0 -5
- package/lib/esm/prompt/prompts/structured-stream-instructions.d.ts +0 -7
- package/lib/esm/prompt/prompts/structured-stream-instructions.js +0 -24
- package/lib/esm/prompt/skills/afs/agent-skill/agent-skill.d.ts +0 -19
- package/lib/esm/prompt/skills/afs/agent-skill/agent-skill.js +0 -65
- package/lib/esm/prompt/skills/afs/agent-skill/skill-loader.d.ts +0 -12
- package/lib/esm/prompt/skills/afs/agent-skill/skill-loader.js +0 -43
- package/lib/esm/prompt/skills/afs/base.d.ts +0 -4
- package/lib/esm/prompt/skills/afs/base.js +0 -4
- package/lib/esm/prompt/skills/afs/delete.d.ts +0 -19
- package/lib/esm/prompt/skills/afs/delete.js +0 -51
- package/lib/esm/prompt/skills/afs/edit.d.ts +0 -24
- package/lib/esm/prompt/skills/afs/edit.js +0 -118
- package/lib/esm/prompt/skills/afs/exec.d.ts +0 -16
- package/lib/esm/prompt/skills/afs/exec.js +0 -39
- package/lib/esm/prompt/skills/afs/index.d.ts +0 -3
- package/lib/esm/prompt/skills/afs/index.js +0 -23
- package/lib/esm/prompt/skills/afs/list.d.ts +0 -24
- package/lib/esm/prompt/skills/afs/list.js +0 -78
- package/lib/esm/prompt/skills/afs/read.d.ts +0 -28
- package/lib/esm/prompt/skills/afs/read.js +0 -101
- package/lib/esm/prompt/skills/afs/rename.d.ts +0 -21
- package/lib/esm/prompt/skills/afs/rename.js +0 -56
- package/lib/esm/prompt/skills/afs/search.d.ts +0 -24
- package/lib/esm/prompt/skills/afs/search.js +0 -70
- package/lib/esm/prompt/skills/afs/write.d.ts +0 -20
- package/lib/esm/prompt/skills/afs/write.js +0 -56
- package/lib/esm/prompt/template.d.ts +0 -243
- package/lib/esm/prompt/template.js +0 -249
- package/lib/esm/utils/agent-utils.d.ts +0 -13
- package/lib/esm/utils/agent-utils.js +0 -54
- package/lib/esm/utils/camelize.d.ts +0 -7
- package/lib/esm/utils/camelize.js +0 -34
- package/lib/esm/utils/event-stream.d.ts +0 -15
- package/lib/esm/utils/event-stream.js +0 -151
- package/lib/esm/utils/fetch.d.ts +0 -4
- package/lib/esm/utils/fetch.js +0 -33
- package/lib/esm/utils/json-schema.d.ts +0 -15
- package/lib/esm/utils/json-schema.js +0 -114
- package/lib/esm/utils/json-utils.d.ts +0 -24
- package/lib/esm/utils/json-utils.js +0 -41
- package/lib/esm/utils/logger.d.ts +0 -39
- package/lib/esm/utils/logger.js +0 -73
- package/lib/esm/utils/mcp-utils.d.ts +0 -5
- package/lib/esm/utils/mcp-utils.js +0 -47
- package/lib/esm/utils/model-utils.d.ts +0 -3
- package/lib/esm/utils/model-utils.js +0 -7
- package/lib/esm/utils/promise.d.ts +0 -6
- package/lib/esm/utils/promise.js +0 -9
- package/lib/esm/utils/prompts.d.ts +0 -2
- package/lib/esm/utils/prompts.js +0 -18
- package/lib/esm/utils/queue.d.ts +0 -57
- package/lib/esm/utils/queue.js +0 -315
- package/lib/esm/utils/role-utils.d.ts +0 -31
- package/lib/esm/utils/role-utils.js +0 -33
- package/lib/esm/utils/stream-polyfill.d.ts +0 -1
- package/lib/esm/utils/stream-polyfill.js +0 -37
- package/lib/esm/utils/stream-utils.d.ts +0 -26
- package/lib/esm/utils/stream-utils.js +0 -217
- package/lib/esm/utils/structured-stream-extractor.d.ts +0 -14
- package/lib/esm/utils/structured-stream-extractor.js +0 -64
- package/lib/esm/utils/token-estimator.d.ts +0 -9
- package/lib/esm/utils/token-estimator.js +0 -63
- package/lib/esm/utils/type-utils.d.ts +0 -31
- package/lib/esm/utils/type-utils.js +0 -181
- package/lib/esm/utils/typed-event-emitter.d.ts +0 -10
- package/lib/esm/utils/typed-event-emitter.js +0 -1
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { Agent, type AgentInvokeOptions, type AgentOptions, type Message } from "./agent.js";
|
|
3
|
-
export declare abstract class Model<I extends Message = any, O extends Message = any> extends Agent<I, O> {
|
|
4
|
-
options?: (Omit<AgentOptions<I, O>, "model"> & {
|
|
5
|
-
modelOptions?: Record<string, unknown>;
|
|
6
|
-
}) | undefined;
|
|
7
|
-
constructor(options?: (Omit<AgentOptions<I, O>, "model"> & {
|
|
8
|
-
modelOptions?: Record<string, unknown>;
|
|
9
|
-
}) | undefined);
|
|
10
|
-
/**
|
|
11
|
-
* Resolves model options by merging instance-level and input-level options,
|
|
12
|
-
* and recursively resolving getter patterns
|
|
13
|
-
*
|
|
14
|
-
* @param input - The input message containing potential modelOptions
|
|
15
|
-
* @param options - The agent invocation options containing context
|
|
16
|
-
* @returns Resolved model options with all getters replaced by actual values
|
|
17
|
-
*/
|
|
18
|
-
getModelOptions(input: Message, options: AgentInvokeOptions): Promise<Record<string, unknown>>;
|
|
19
|
-
protected preprocess(input: I, options: AgentInvokeOptions): Promise<void>;
|
|
20
|
-
transformFileType(fileType: "file", data: FileUnionContent): Promise<FileContent>;
|
|
21
|
-
transformFileType(fileType: "local" | undefined, data: FileUnionContent): Promise<LocalContent>;
|
|
22
|
-
transformFileType(fileType: FileType | undefined, data: FileUnionContent): Promise<FileUnionContent>;
|
|
23
|
-
static getFileExtension(type: string): Promise<string | undefined>;
|
|
24
|
-
static getMimeType(filename: string): Promise<string | undefined>;
|
|
25
|
-
downloadFile(url: string): Promise<Response>;
|
|
26
|
-
}
|
|
27
|
-
export type FileType = "local" | "file" | "url";
|
|
28
|
-
export declare const fileTypeSchema: z.ZodEnum<["local", "file", "url"]>;
|
|
29
|
-
export interface FileContentBase {
|
|
30
|
-
filename?: string;
|
|
31
|
-
mimeType?: string;
|
|
32
|
-
}
|
|
33
|
-
export declare const fileContentBaseSchema: z.ZodObject<{
|
|
34
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
35
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
36
|
-
}, "strip", z.ZodTypeAny, {
|
|
37
|
-
filename?: string | undefined;
|
|
38
|
-
mimeType?: string | undefined;
|
|
39
|
-
}, {
|
|
40
|
-
filename?: string | undefined;
|
|
41
|
-
mimeType?: string | undefined;
|
|
42
|
-
}>;
|
|
43
|
-
export interface UrlContent extends FileContentBase {
|
|
44
|
-
type: "url";
|
|
45
|
-
url: string;
|
|
46
|
-
}
|
|
47
|
-
export declare const urlContentSchema: z.ZodObject<{
|
|
48
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
49
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
50
|
-
} & {
|
|
51
|
-
type: z.ZodLiteral<"url">;
|
|
52
|
-
url: z.ZodString;
|
|
53
|
-
}, "strip", z.ZodTypeAny, {
|
|
54
|
-
type: "url";
|
|
55
|
-
url: string;
|
|
56
|
-
filename?: string | undefined;
|
|
57
|
-
mimeType?: string | undefined;
|
|
58
|
-
}, {
|
|
59
|
-
type: "url";
|
|
60
|
-
url: string;
|
|
61
|
-
filename?: string | undefined;
|
|
62
|
-
mimeType?: string | undefined;
|
|
63
|
-
}>;
|
|
64
|
-
export interface FileContent extends FileContentBase {
|
|
65
|
-
type: "file";
|
|
66
|
-
data: string;
|
|
67
|
-
}
|
|
68
|
-
export declare const fileContentSchema: z.ZodObject<{
|
|
69
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
70
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
71
|
-
} & {
|
|
72
|
-
type: z.ZodLiteral<"file">;
|
|
73
|
-
data: z.ZodString;
|
|
74
|
-
}, "strip", z.ZodTypeAny, {
|
|
75
|
-
type: "file";
|
|
76
|
-
data: string;
|
|
77
|
-
filename?: string | undefined;
|
|
78
|
-
mimeType?: string | undefined;
|
|
79
|
-
}, {
|
|
80
|
-
type: "file";
|
|
81
|
-
data: string;
|
|
82
|
-
filename?: string | undefined;
|
|
83
|
-
mimeType?: string | undefined;
|
|
84
|
-
}>;
|
|
85
|
-
export interface LocalContent extends FileContentBase {
|
|
86
|
-
type: "local";
|
|
87
|
-
path: string;
|
|
88
|
-
}
|
|
89
|
-
export declare const localContentSchema: z.ZodObject<{
|
|
90
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
91
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
92
|
-
} & {
|
|
93
|
-
type: z.ZodLiteral<"local">;
|
|
94
|
-
path: z.ZodString;
|
|
95
|
-
}, "strip", z.ZodTypeAny, {
|
|
96
|
-
path: string;
|
|
97
|
-
type: "local";
|
|
98
|
-
filename?: string | undefined;
|
|
99
|
-
mimeType?: string | undefined;
|
|
100
|
-
}, {
|
|
101
|
-
path: string;
|
|
102
|
-
type: "local";
|
|
103
|
-
filename?: string | undefined;
|
|
104
|
-
mimeType?: string | undefined;
|
|
105
|
-
}>;
|
|
106
|
-
export type FileUnionContent = LocalContent | UrlContent | FileContent;
|
|
107
|
-
export declare const fileUnionContentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
108
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
109
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
110
|
-
} & {
|
|
111
|
-
type: z.ZodLiteral<"local">;
|
|
112
|
-
path: z.ZodString;
|
|
113
|
-
}, "strip", z.ZodTypeAny, {
|
|
114
|
-
path: string;
|
|
115
|
-
type: "local";
|
|
116
|
-
filename?: string | undefined;
|
|
117
|
-
mimeType?: string | undefined;
|
|
118
|
-
}, {
|
|
119
|
-
path: string;
|
|
120
|
-
type: "local";
|
|
121
|
-
filename?: string | undefined;
|
|
122
|
-
mimeType?: string | undefined;
|
|
123
|
-
}>, z.ZodObject<{
|
|
124
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
125
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
126
|
-
} & {
|
|
127
|
-
type: z.ZodLiteral<"url">;
|
|
128
|
-
url: z.ZodString;
|
|
129
|
-
}, "strip", z.ZodTypeAny, {
|
|
130
|
-
type: "url";
|
|
131
|
-
url: string;
|
|
132
|
-
filename?: string | undefined;
|
|
133
|
-
mimeType?: string | undefined;
|
|
134
|
-
}, {
|
|
135
|
-
type: "url";
|
|
136
|
-
url: string;
|
|
137
|
-
filename?: string | undefined;
|
|
138
|
-
mimeType?: string | undefined;
|
|
139
|
-
}>, z.ZodObject<{
|
|
140
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
141
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
142
|
-
} & {
|
|
143
|
-
type: z.ZodLiteral<"file">;
|
|
144
|
-
data: z.ZodString;
|
|
145
|
-
}, "strip", z.ZodTypeAny, {
|
|
146
|
-
type: "file";
|
|
147
|
-
data: string;
|
|
148
|
-
filename?: string | undefined;
|
|
149
|
-
mimeType?: string | undefined;
|
|
150
|
-
}, {
|
|
151
|
-
type: "file";
|
|
152
|
-
data: string;
|
|
153
|
-
filename?: string | undefined;
|
|
154
|
-
mimeType?: string | undefined;
|
|
155
|
-
}>]>;
|
|
156
|
-
export declare const fileUnionContentsSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
157
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
158
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
159
|
-
} & {
|
|
160
|
-
type: z.ZodLiteral<"local">;
|
|
161
|
-
path: z.ZodString;
|
|
162
|
-
}, "strip", z.ZodTypeAny, {
|
|
163
|
-
path: string;
|
|
164
|
-
type: "local";
|
|
165
|
-
filename?: string | undefined;
|
|
166
|
-
mimeType?: string | undefined;
|
|
167
|
-
}, {
|
|
168
|
-
path: string;
|
|
169
|
-
type: "local";
|
|
170
|
-
filename?: string | undefined;
|
|
171
|
-
mimeType?: string | undefined;
|
|
172
|
-
}>, z.ZodObject<{
|
|
173
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
174
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
175
|
-
} & {
|
|
176
|
-
type: z.ZodLiteral<"url">;
|
|
177
|
-
url: z.ZodString;
|
|
178
|
-
}, "strip", z.ZodTypeAny, {
|
|
179
|
-
type: "url";
|
|
180
|
-
url: string;
|
|
181
|
-
filename?: string | undefined;
|
|
182
|
-
mimeType?: string | undefined;
|
|
183
|
-
}, {
|
|
184
|
-
type: "url";
|
|
185
|
-
url: string;
|
|
186
|
-
filename?: string | undefined;
|
|
187
|
-
mimeType?: string | undefined;
|
|
188
|
-
}>, z.ZodObject<{
|
|
189
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
190
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
191
|
-
} & {
|
|
192
|
-
type: z.ZodLiteral<"file">;
|
|
193
|
-
data: z.ZodString;
|
|
194
|
-
}, "strip", z.ZodTypeAny, {
|
|
195
|
-
type: "file";
|
|
196
|
-
data: string;
|
|
197
|
-
filename?: string | undefined;
|
|
198
|
-
mimeType?: string | undefined;
|
|
199
|
-
}, {
|
|
200
|
-
type: "file";
|
|
201
|
-
data: string;
|
|
202
|
-
filename?: string | undefined;
|
|
203
|
-
mimeType?: string | undefined;
|
|
204
|
-
}>]>, z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
205
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
206
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
207
|
-
} & {
|
|
208
|
-
type: z.ZodLiteral<"local">;
|
|
209
|
-
path: z.ZodString;
|
|
210
|
-
}, "strip", z.ZodTypeAny, {
|
|
211
|
-
path: string;
|
|
212
|
-
type: "local";
|
|
213
|
-
filename?: string | undefined;
|
|
214
|
-
mimeType?: string | undefined;
|
|
215
|
-
}, {
|
|
216
|
-
path: string;
|
|
217
|
-
type: "local";
|
|
218
|
-
filename?: string | undefined;
|
|
219
|
-
mimeType?: string | undefined;
|
|
220
|
-
}>, z.ZodObject<{
|
|
221
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
222
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
223
|
-
} & {
|
|
224
|
-
type: z.ZodLiteral<"url">;
|
|
225
|
-
url: z.ZodString;
|
|
226
|
-
}, "strip", z.ZodTypeAny, {
|
|
227
|
-
type: "url";
|
|
228
|
-
url: string;
|
|
229
|
-
filename?: string | undefined;
|
|
230
|
-
mimeType?: string | undefined;
|
|
231
|
-
}, {
|
|
232
|
-
type: "url";
|
|
233
|
-
url: string;
|
|
234
|
-
filename?: string | undefined;
|
|
235
|
-
mimeType?: string | undefined;
|
|
236
|
-
}>, z.ZodObject<{
|
|
237
|
-
filename: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
238
|
-
mimeType: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
239
|
-
} & {
|
|
240
|
-
type: z.ZodLiteral<"file">;
|
|
241
|
-
data: z.ZodString;
|
|
242
|
-
}, "strip", z.ZodTypeAny, {
|
|
243
|
-
type: "file";
|
|
244
|
-
data: string;
|
|
245
|
-
filename?: string | undefined;
|
|
246
|
-
mimeType?: string | undefined;
|
|
247
|
-
}, {
|
|
248
|
-
type: "file";
|
|
249
|
-
data: string;
|
|
250
|
-
filename?: string | undefined;
|
|
251
|
-
mimeType?: string | undefined;
|
|
252
|
-
}>]>, "many">]>;
|
|
@@ -1,382 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { AgentLoadOptions } from "../loader/index.js";
|
|
3
|
-
import { type PromiseOrValue } from "../utils/type-utils.js";
|
|
4
|
-
import { Agent, type AgentInvokeOptions, type AgentOptions, type AgentProcessResult, type Message } from "./agent.js";
|
|
5
|
-
/**
|
|
6
|
-
* Defines the processing modes available for a TeamAgent.
|
|
7
|
-
*
|
|
8
|
-
* The processing mode determines how the agents within a team are executed
|
|
9
|
-
* and how their outputs are combined.
|
|
10
|
-
*/
|
|
11
|
-
export declare enum ProcessMode {
|
|
12
|
-
/**
|
|
13
|
-
* Process the agents one by one, passing the output of each agent to the next.
|
|
14
|
-
*
|
|
15
|
-
* In sequential mode, agents execute in order, with each agent receiving the
|
|
16
|
-
* combined output from all previous agents as part of its input.
|
|
17
|
-
*/
|
|
18
|
-
sequential = "sequential",
|
|
19
|
-
/**
|
|
20
|
-
* Process all agents in parallel, merging the output of all agents.
|
|
21
|
-
*
|
|
22
|
-
* In parallel mode, all agents execute simultaneously, each receiving the same
|
|
23
|
-
* initial input. Their outputs are then combined based on output key ownership.
|
|
24
|
-
*/
|
|
25
|
-
parallel = "parallel"
|
|
26
|
-
}
|
|
27
|
-
export declare const DEFAULT_REFLECTION_MAX_ITERATIONS = 3;
|
|
28
|
-
/**
|
|
29
|
-
* Configuration for reflection mode processing in TeamAgent.
|
|
30
|
-
*
|
|
31
|
-
* Reflection mode enables iterative refinement of agent outputs through a review process.
|
|
32
|
-
* The team agent will repeatedly process the input and have a reviewer agent evaluate
|
|
33
|
-
* the output until it meets approval criteria or reaches the maximum iteration limit.
|
|
34
|
-
*
|
|
35
|
-
* This is particularly useful for:
|
|
36
|
-
* - Quality assurance workflows where outputs need validation
|
|
37
|
-
* - Iterative improvement processes where initial results can be refined
|
|
38
|
-
* - Self-correcting agent systems that learn from feedback
|
|
39
|
-
*/
|
|
40
|
-
export interface ReflectionMode {
|
|
41
|
-
/**
|
|
42
|
-
* The agent responsible for reviewing and providing feedback on the team's output.
|
|
43
|
-
*
|
|
44
|
-
* The reviewer agent receives the combined output from the team's processing
|
|
45
|
-
* and should provide feedback or evaluation that can be used to determine
|
|
46
|
-
* whether the output meets the required standards.
|
|
47
|
-
*/
|
|
48
|
-
reviewer: Agent;
|
|
49
|
-
/**
|
|
50
|
-
* Function or field name that determines whether the reviewer's output indicates approval.
|
|
51
|
-
*
|
|
52
|
-
* This can be either:
|
|
53
|
-
* - A function that receives the reviewer agent's output message and should return:
|
|
54
|
-
* - `true` or truthy value: The output is approved and processing should stop
|
|
55
|
-
* - `false` or falsy value: The output needs improvement and another iteration should run
|
|
56
|
-
* - A string representing a field name in the reviewer's output message to check for approval
|
|
57
|
-
*
|
|
58
|
-
* When using a function, it can be synchronous or asynchronous, allowing for complex approval logic
|
|
59
|
-
* including external validation, scoring systems, or human-in-the-loop approval.
|
|
60
|
-
*
|
|
61
|
-
* When using a string, the specified field in the reviewer's output will be evaluated for truthiness
|
|
62
|
-
* to determine approval status.
|
|
63
|
-
*
|
|
64
|
-
* @param output - The message output from the reviewer agent (when using function form)
|
|
65
|
-
* @returns A boolean or truthy/falsy value indicating approval status (when using function form)
|
|
66
|
-
*/
|
|
67
|
-
isApproved: ((output: Message) => PromiseOrValue<boolean | unknown>) | string;
|
|
68
|
-
/**
|
|
69
|
-
* Maximum number of reflection iterations before giving up.
|
|
70
|
-
*
|
|
71
|
-
* This prevents infinite loops when the approval criteria cannot be met.
|
|
72
|
-
* If the maximum iterations are reached without approval, the process will
|
|
73
|
-
* throw an error indicating the reflection failed to converge.
|
|
74
|
-
*
|
|
75
|
-
* @default 3
|
|
76
|
-
*/
|
|
77
|
-
maxIterations?: number;
|
|
78
|
-
/**
|
|
79
|
-
* Controls the behavior when maximum iterations are reached without approval.
|
|
80
|
-
*
|
|
81
|
-
* When set to `true`, the TeamAgent will return the last generated output
|
|
82
|
-
* instead of throwing an error when the maximum number of reflection iterations
|
|
83
|
-
* is reached without the reviewer's approval.
|
|
84
|
-
*
|
|
85
|
-
* When set to `false` or undefined, the TeamAgent will throw an error
|
|
86
|
-
* indicating that the reflection process failed to converge within the
|
|
87
|
-
* maximum iteration limit.
|
|
88
|
-
*
|
|
89
|
-
* This option is useful for scenarios where:
|
|
90
|
-
* - You want to get the best available result even if it's not perfect
|
|
91
|
-
* - The approval criteria might be too strict for the given context
|
|
92
|
-
* - You prefer graceful degradation over complete failure
|
|
93
|
-
* - You want to implement custom error handling based on the returned result
|
|
94
|
-
*
|
|
95
|
-
* @default false
|
|
96
|
-
*/
|
|
97
|
-
returnLastOnMaxIterations?: boolean;
|
|
98
|
-
customErrorMessage?: string;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Configuration options for creating a TeamAgent.
|
|
102
|
-
*
|
|
103
|
-
* These options extend the base AgentOptions and add team-specific settings.
|
|
104
|
-
*/
|
|
105
|
-
export interface TeamAgentOptions<I extends Message, O extends Message> extends AgentOptions<I, O> {
|
|
106
|
-
/**
|
|
107
|
-
* The method to process the agents in the team.
|
|
108
|
-
* @default {ProcessMode.sequential}
|
|
109
|
-
*/
|
|
110
|
-
mode?: ProcessMode;
|
|
111
|
-
/**
|
|
112
|
-
* Configuration for reflection mode processing.
|
|
113
|
-
*
|
|
114
|
-
* When enabled, the TeamAgent will use an iterative refinement process where:
|
|
115
|
-
* 1. The team processes the input normally
|
|
116
|
-
* 2. A reviewer agent evaluates the output
|
|
117
|
-
* 3. If not approved, the process repeats with the previous output as context
|
|
118
|
-
* 4. This continues until approval or maximum iterations are reached
|
|
119
|
-
*
|
|
120
|
-
* This enables self-improving agent workflows that can iteratively refine
|
|
121
|
-
* their outputs based on feedback from a specialized reviewer agent.
|
|
122
|
-
*
|
|
123
|
-
* @see ReflectionMode for detailed configuration options
|
|
124
|
-
*/
|
|
125
|
-
reflection?: ReflectionMode;
|
|
126
|
-
/**
|
|
127
|
-
* Specifies which input field should be treated as an array for iterative processing.
|
|
128
|
-
*
|
|
129
|
-
* When this property is set, the TeamAgent will iterate over the array values in the
|
|
130
|
-
* specified input field, processing each element individually through the team's agents.
|
|
131
|
-
* The results from each iteration are accumulated and returned as a streaming response.
|
|
132
|
-
*
|
|
133
|
-
* This is particularly useful for batch processing scenarios where you need to apply
|
|
134
|
-
* the same agent workflow to multiple similar data items.
|
|
135
|
-
*
|
|
136
|
-
* @remarks
|
|
137
|
-
* - The specified field must contain an array or array-like value
|
|
138
|
-
* - Each array element should be an object that can be merged with the base input
|
|
139
|
-
* - Non-array values will be treated as single-element arrays
|
|
140
|
-
* - The processing results are streamed incrementally as each iteration completes
|
|
141
|
-
*/
|
|
142
|
-
iterateOn?: keyof I;
|
|
143
|
-
/**
|
|
144
|
-
* The maximum number of concurrent operations when processing array items with `iterateOn`.
|
|
145
|
-
*
|
|
146
|
-
* This property controls how many array elements are processed simultaneously when
|
|
147
|
-
* iterating over an array field. A higher concurrency value allows for faster
|
|
148
|
-
* parallel processing but may consume more resources.
|
|
149
|
-
*
|
|
150
|
-
* @remarks
|
|
151
|
-
* - Only applies when `iterateOn` is specified
|
|
152
|
-
* - Cannot be used together with `iterateWithPreviousOutput` (concurrency > 1)
|
|
153
|
-
* - Uses a queue-based approach to limit concurrent operations
|
|
154
|
-
* - Each concurrent operation processes one array element through the entire agent workflow
|
|
155
|
-
*
|
|
156
|
-
* @default 1
|
|
157
|
-
*/
|
|
158
|
-
concurrency?: number;
|
|
159
|
-
/**
|
|
160
|
-
* Controls whether to merge the output from each iteration back into the array items
|
|
161
|
-
* for subsequent iterations when using `iterateOn`.
|
|
162
|
-
*
|
|
163
|
-
* When set to `true`, the output from processing each array element is merged back
|
|
164
|
-
* into that element, making it available for the next iteration. This creates a
|
|
165
|
-
* cumulative effect where each iteration builds upon the results of previous ones.
|
|
166
|
-
*
|
|
167
|
-
* When set to `false` or undefined, each array element is processed independently
|
|
168
|
-
* without any cross-iteration data sharing.
|
|
169
|
-
*
|
|
170
|
-
* This is particularly useful for scenarios where:
|
|
171
|
-
* - You need to progressively enrich data across iterations
|
|
172
|
-
* - Later iterations depend on the results of earlier ones
|
|
173
|
-
* - You want to build a chain of transformations on array data
|
|
174
|
-
*
|
|
175
|
-
* @default false
|
|
176
|
-
*/
|
|
177
|
-
iterateWithPreviousOutput?: boolean;
|
|
178
|
-
/**
|
|
179
|
-
* Controls whether to include output from all intermediate steps in sequential processing.
|
|
180
|
-
*
|
|
181
|
-
* @see TeamAgent.includeAllStepsOutput for detailed documentation
|
|
182
|
-
* @default false
|
|
183
|
-
*/
|
|
184
|
-
includeAllStepsOutput?: boolean;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* TeamAgent coordinates a group of agents working together to accomplish tasks.
|
|
188
|
-
*
|
|
189
|
-
* A TeamAgent manages a collection of agents (its skills) and orchestrates their
|
|
190
|
-
* execution according to a specified processing mode. It provides mechanisms for
|
|
191
|
-
* agents to work either sequentially (one after another) or in parallel (all at once),
|
|
192
|
-
* with appropriate handling of their outputs.
|
|
193
|
-
*
|
|
194
|
-
* TeamAgent is particularly useful for:
|
|
195
|
-
* - Creating agent workflows where output from one agent feeds into another
|
|
196
|
-
* - Executing multiple agents simultaneously and combining their results
|
|
197
|
-
* - Building complex agent systems with specialized components working together
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* Here's an example of creating a sequential TeamAgent:
|
|
201
|
-
* {@includeCode ../../test/agents/team-agent.test.ts#example-team-agent-sequential}
|
|
202
|
-
*/
|
|
203
|
-
export declare class TeamAgent<I extends Message, O extends Message> extends Agent<I, O> {
|
|
204
|
-
tag: string;
|
|
205
|
-
static schema({ filepath }: {
|
|
206
|
-
filepath: string;
|
|
207
|
-
}): z.ZodObject<{
|
|
208
|
-
mode: z.ZodType<ProcessMode | undefined, z.ZodTypeDef, ProcessMode | undefined>;
|
|
209
|
-
iterateOn: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
210
|
-
concurrency: z.ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
|
|
211
|
-
iterateWithPreviousOutput: z.ZodType<boolean | undefined, z.ZodTypeDef, boolean | undefined>;
|
|
212
|
-
includeAllStepsOutput: z.ZodType<boolean | undefined, z.ZodTypeDef, boolean | undefined>;
|
|
213
|
-
reflection: z.ZodType<{
|
|
214
|
-
reviewer: import("../loader/agent-yaml.js").NestAgentSchema;
|
|
215
|
-
isApproved: string;
|
|
216
|
-
maxIterations?: number | undefined;
|
|
217
|
-
returnLastOnMaxIterations?: boolean | undefined;
|
|
218
|
-
customErrorMessage?: string | undefined;
|
|
219
|
-
} | undefined, z.ZodTypeDef, {
|
|
220
|
-
reviewer: import("../loader/agent-yaml.js").NestAgentSchema;
|
|
221
|
-
isApproved: string;
|
|
222
|
-
maxIterations?: number | undefined;
|
|
223
|
-
returnLastOnMaxIterations?: boolean | undefined;
|
|
224
|
-
customErrorMessage?: string | undefined;
|
|
225
|
-
} | undefined>;
|
|
226
|
-
}, "strip", z.ZodTypeAny, {
|
|
227
|
-
mode?: ProcessMode | undefined;
|
|
228
|
-
reflection?: {
|
|
229
|
-
reviewer: import("../loader/agent-yaml.js").NestAgentSchema;
|
|
230
|
-
isApproved: string;
|
|
231
|
-
maxIterations?: number | undefined;
|
|
232
|
-
returnLastOnMaxIterations?: boolean | undefined;
|
|
233
|
-
customErrorMessage?: string | undefined;
|
|
234
|
-
} | undefined;
|
|
235
|
-
iterateOn?: string | undefined;
|
|
236
|
-
concurrency?: number | undefined;
|
|
237
|
-
iterateWithPreviousOutput?: boolean | undefined;
|
|
238
|
-
includeAllStepsOutput?: boolean | undefined;
|
|
239
|
-
}, {
|
|
240
|
-
mode?: ProcessMode | undefined;
|
|
241
|
-
reflection?: {
|
|
242
|
-
reviewer: import("../loader/agent-yaml.js").NestAgentSchema;
|
|
243
|
-
isApproved: string;
|
|
244
|
-
maxIterations?: number | undefined;
|
|
245
|
-
returnLastOnMaxIterations?: boolean | undefined;
|
|
246
|
-
customErrorMessage?: string | undefined;
|
|
247
|
-
} | undefined;
|
|
248
|
-
iterateOn?: string | undefined;
|
|
249
|
-
concurrency?: number | undefined;
|
|
250
|
-
iterateWithPreviousOutput?: boolean | undefined;
|
|
251
|
-
includeAllStepsOutput?: boolean | undefined;
|
|
252
|
-
}>;
|
|
253
|
-
static load<I extends Message = any, O extends Message = any>(options: {
|
|
254
|
-
filepath: string;
|
|
255
|
-
parsed: object;
|
|
256
|
-
options: AgentLoadOptions;
|
|
257
|
-
}): Promise<Agent<I, O>>;
|
|
258
|
-
/**
|
|
259
|
-
* Create a TeamAgent from the provided options.
|
|
260
|
-
*
|
|
261
|
-
* @param options Configuration options for the TeamAgent
|
|
262
|
-
* @returns A new TeamAgent instance
|
|
263
|
-
*
|
|
264
|
-
* @example
|
|
265
|
-
* Here's an example of creating a sequential TeamAgent:
|
|
266
|
-
* {@includeCode ../../test/agents/team-agent.test.ts#example-team-agent-sequential}
|
|
267
|
-
*
|
|
268
|
-
* @example
|
|
269
|
-
* Here's an example of creating a parallel TeamAgent:
|
|
270
|
-
* {@includeCode ../../test/agents/team-agent.test.ts#example-team-agent-parallel}
|
|
271
|
-
*/
|
|
272
|
-
static from<I extends Message, O extends Message>(options: TeamAgentOptions<I, O>): TeamAgent<I, O>;
|
|
273
|
-
/**
|
|
274
|
-
* Create a new TeamAgent instance.
|
|
275
|
-
*
|
|
276
|
-
* @param options Configuration options for the TeamAgent
|
|
277
|
-
*/
|
|
278
|
-
constructor(options: TeamAgentOptions<I, O>);
|
|
279
|
-
/**
|
|
280
|
-
* The processing mode that determines how agents in the team are executed.
|
|
281
|
-
*
|
|
282
|
-
* This can be either sequential (one after another) or parallel (all at once).
|
|
283
|
-
*/
|
|
284
|
-
mode: ProcessMode;
|
|
285
|
-
/**
|
|
286
|
-
* The reflection mode configuration with guaranteed maxIterations value.
|
|
287
|
-
*
|
|
288
|
-
* This is the internal representation after processing the user-provided
|
|
289
|
-
* reflection configuration, ensuring that maxIterations always has a value
|
|
290
|
-
* (defaulting to DEFAULT_REFLECTION_MAX_ITERATIONS if not specified).
|
|
291
|
-
*/
|
|
292
|
-
reflection?: ReflectionMode & Required<Pick<ReflectionMode, "maxIterations">>;
|
|
293
|
-
/**
|
|
294
|
-
* The input field key to iterate over when processing array inputs.
|
|
295
|
-
*
|
|
296
|
-
* When set, this property enables the TeamAgent to process array values iteratively,
|
|
297
|
-
* where each array element is processed individually through the team's agent workflow.
|
|
298
|
-
* The accumulated results are returned via streaming response chunks.
|
|
299
|
-
*
|
|
300
|
-
* @see TeamAgentOptions.iterateOn for detailed documentation
|
|
301
|
-
*/
|
|
302
|
-
iterateOn?: keyof I;
|
|
303
|
-
/**
|
|
304
|
-
* The maximum number of concurrent operations when processing array items.
|
|
305
|
-
*
|
|
306
|
-
* This property controls the concurrency level for iterative processing when `iterateOn`
|
|
307
|
-
* is used. It determines how many array elements are processed simultaneously.
|
|
308
|
-
*
|
|
309
|
-
* @see TeamAgentOptions.concurrency for detailed documentation
|
|
310
|
-
* @default 1
|
|
311
|
-
*/
|
|
312
|
-
concurrency: number;
|
|
313
|
-
/**
|
|
314
|
-
* Controls whether to merge the output from each iteration back into the array items
|
|
315
|
-
* for subsequent iterations when using `iterateOn`.
|
|
316
|
-
*
|
|
317
|
-
* @see TeamAgentOptions.iterateWithPreviousOutput for detailed documentation
|
|
318
|
-
*
|
|
319
|
-
* @default false
|
|
320
|
-
*/
|
|
321
|
-
iterateWithPreviousOutput?: boolean;
|
|
322
|
-
/**
|
|
323
|
-
* Controls whether to include output from all intermediate steps in sequential processing.
|
|
324
|
-
*
|
|
325
|
-
* When `true`, yields output chunks from every agent in the sequential chain.
|
|
326
|
-
* When `false`, only yields output from the final agent.
|
|
327
|
-
*
|
|
328
|
-
* Only affects sequential processing mode. Useful for debugging and monitoring
|
|
329
|
-
* multi-step agent workflows.
|
|
330
|
-
*
|
|
331
|
-
* @default false
|
|
332
|
-
*/
|
|
333
|
-
includeAllStepsOutput?: boolean;
|
|
334
|
-
/**
|
|
335
|
-
* Process an input message by routing it through the team's agents.
|
|
336
|
-
*
|
|
337
|
-
* Depending on the team's processing mode, this will either:
|
|
338
|
-
* - In sequential mode: Pass input through each agent in sequence, with each agent
|
|
339
|
-
* receiving the combined output from previous agents
|
|
340
|
-
* - In parallel mode: Process input through all agents simultaneously and combine their outputs
|
|
341
|
-
*
|
|
342
|
-
* @param input The message to process
|
|
343
|
-
* @param options The invocation options
|
|
344
|
-
* @returns A stream of message chunks that collectively form the response
|
|
345
|
-
*/
|
|
346
|
-
process(input: I, options: AgentInvokeOptions): PromiseOrValue<AgentProcessResult<O>>;
|
|
347
|
-
private _processNonReflection;
|
|
348
|
-
private _processReflection;
|
|
349
|
-
private _processIterator;
|
|
350
|
-
private _processNonIterator;
|
|
351
|
-
/**
|
|
352
|
-
* Process input sequentially through each agent in the team.
|
|
353
|
-
*
|
|
354
|
-
* This method:
|
|
355
|
-
* 1. Executes each agent in order
|
|
356
|
-
* 2. Passes the combined output from previous agents to the next agent
|
|
357
|
-
* 3. Yields output chunks as they become available
|
|
358
|
-
* 4. Updates the team's agent list with any changes that occurred during processing
|
|
359
|
-
*
|
|
360
|
-
* @param input The message to process
|
|
361
|
-
* @param options The invocation options
|
|
362
|
-
* @returns A stream of message chunks from all agents
|
|
363
|
-
*
|
|
364
|
-
* @private
|
|
365
|
-
*/
|
|
366
|
-
_processSequential(input: Message, options: AgentInvokeOptions): PromiseOrValue<AgentProcessResult<O>>;
|
|
367
|
-
/**
|
|
368
|
-
* Process input in parallel through all agents in the team.
|
|
369
|
-
*
|
|
370
|
-
* This method:
|
|
371
|
-
* 1. Executes all agents simultaneously with the same input
|
|
372
|
-
* 2. Yields combined output chunks
|
|
373
|
-
* 3. Updates the team's agent list with any changes that occurred during processing
|
|
374
|
-
*
|
|
375
|
-
* @param input The message to process
|
|
376
|
-
* @param options The invocation options
|
|
377
|
-
* @returns A stream of combined message chunks from all agents
|
|
378
|
-
*
|
|
379
|
-
* @private
|
|
380
|
-
*/
|
|
381
|
-
_processParallel(input: Message, options: AgentInvokeOptions): PromiseOrValue<AgentProcessResult<O>>;
|
|
382
|
-
}
|