@falai/agent 1.2.8 → 2.0.1
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 +40 -886
- package/dist/adapters/MemoryAdapter.js +2 -2
- package/dist/adapters/MemoryAdapter.js.map +1 -1
- package/dist/adapters/MongoAdapter.js +2 -2
- package/dist/adapters/MongoAdapter.js.map +1 -1
- package/dist/adapters/OpenSearchAdapter.d.ts.map +1 -1
- package/dist/adapters/OpenSearchAdapter.js +9 -7
- package/dist/adapters/OpenSearchAdapter.js.map +1 -1
- package/dist/adapters/PostgreSQLAdapter.d.ts +14 -0
- package/dist/adapters/PostgreSQLAdapter.d.ts.map +1 -1
- package/dist/adapters/PostgreSQLAdapter.js +25 -9
- package/dist/adapters/PostgreSQLAdapter.js.map +1 -1
- package/dist/adapters/PrismaAdapter.js +5 -5
- package/dist/adapters/PrismaAdapter.js.map +1 -1
- package/dist/adapters/RedisAdapter.js +2 -2
- package/dist/adapters/RedisAdapter.js.map +1 -1
- package/dist/adapters/SQLiteAdapter.d.ts +17 -0
- package/dist/adapters/SQLiteAdapter.d.ts.map +1 -1
- package/dist/adapters/SQLiteAdapter.js +30 -11
- package/dist/adapters/SQLiteAdapter.js.map +1 -1
- package/dist/cjs/adapters/MemoryAdapter.js +2 -2
- package/dist/cjs/adapters/MemoryAdapter.js.map +1 -1
- package/dist/cjs/adapters/MongoAdapter.js +2 -2
- package/dist/cjs/adapters/MongoAdapter.js.map +1 -1
- package/dist/cjs/adapters/OpenSearchAdapter.d.ts.map +1 -1
- package/dist/cjs/adapters/OpenSearchAdapter.js +9 -7
- package/dist/cjs/adapters/OpenSearchAdapter.js.map +1 -1
- package/dist/cjs/adapters/PostgreSQLAdapter.d.ts +14 -0
- package/dist/cjs/adapters/PostgreSQLAdapter.d.ts.map +1 -1
- package/dist/cjs/adapters/PostgreSQLAdapter.js +25 -9
- package/dist/cjs/adapters/PostgreSQLAdapter.js.map +1 -1
- package/dist/cjs/adapters/PrismaAdapter.js +5 -5
- package/dist/cjs/adapters/PrismaAdapter.js.map +1 -1
- package/dist/cjs/adapters/RedisAdapter.js +2 -2
- package/dist/cjs/adapters/RedisAdapter.js.map +1 -1
- package/dist/cjs/adapters/SQLiteAdapter.d.ts +17 -0
- package/dist/cjs/adapters/SQLiteAdapter.d.ts.map +1 -1
- package/dist/cjs/adapters/SQLiteAdapter.js +30 -11
- package/dist/cjs/adapters/SQLiteAdapter.js.map +1 -1
- package/dist/cjs/constants/index.d.ts +0 -9
- package/dist/cjs/constants/index.d.ts.map +1 -1
- package/dist/cjs/constants/index.js +2 -11
- package/dist/cjs/constants/index.js.map +1 -1
- package/dist/cjs/core/Agent.d.ts +119 -153
- package/dist/cjs/core/Agent.d.ts.map +1 -1
- package/dist/cjs/core/Agent.js +471 -324
- package/dist/cjs/core/Agent.js.map +1 -1
- package/dist/cjs/core/AutoChainExecutor.d.ts +107 -0
- package/dist/cjs/core/AutoChainExecutor.d.ts.map +1 -0
- package/dist/cjs/core/AutoChainExecutor.js +297 -0
- package/dist/cjs/core/AutoChainExecutor.js.map +1 -0
- package/dist/cjs/core/BranchEvaluator.d.ts +54 -0
- package/dist/cjs/core/BranchEvaluator.d.ts.map +1 -0
- package/dist/cjs/core/BranchEvaluator.js +130 -0
- package/dist/cjs/core/BranchEvaluator.js.map +1 -0
- package/dist/cjs/core/DirectiveBus.d.ts +88 -0
- package/dist/cjs/core/DirectiveBus.d.ts.map +1 -0
- package/dist/cjs/core/DirectiveBus.js +196 -0
- package/dist/cjs/core/DirectiveBus.js.map +1 -0
- package/dist/cjs/core/DirectiveChainTracker.d.ts +49 -0
- package/dist/cjs/core/DirectiveChainTracker.d.ts.map +1 -0
- package/dist/cjs/core/DirectiveChainTracker.js +121 -0
- package/dist/cjs/core/DirectiveChainTracker.js.map +1 -0
- package/dist/cjs/core/Flow.d.ts +186 -0
- package/dist/cjs/core/Flow.d.ts.map +1 -0
- package/dist/cjs/core/Flow.js +550 -0
- package/dist/cjs/core/Flow.js.map +1 -0
- package/dist/cjs/core/FlowRouter.d.ts +182 -0
- package/dist/cjs/core/FlowRouter.d.ts.map +1 -0
- package/dist/cjs/core/{RoutingEngine.js → FlowRouter.js} +323 -306
- package/dist/cjs/core/FlowRouter.js.map +1 -0
- package/dist/cjs/core/PersistenceManager.d.ts +2 -2
- package/dist/cjs/core/PersistenceManager.d.ts.map +1 -1
- package/dist/cjs/core/PersistenceManager.js +7 -7
- package/dist/cjs/core/PersistenceManager.js.map +1 -1
- package/dist/cjs/core/PromptComposer.d.ts +21 -8
- package/dist/cjs/core/PromptComposer.d.ts.map +1 -1
- package/dist/cjs/core/PromptComposer.js +182 -105
- package/dist/cjs/core/PromptComposer.js.map +1 -1
- package/dist/cjs/core/PromptSectionCache.d.ts +1 -1
- package/dist/cjs/core/PromptSectionCache.js +1 -1
- package/dist/cjs/core/ResponseEngine.d.ts +18 -8
- package/dist/cjs/core/ResponseEngine.d.ts.map +1 -1
- package/dist/cjs/core/ResponseEngine.js +38 -36
- package/dist/cjs/core/ResponseEngine.js.map +1 -1
- package/dist/cjs/core/ResponseModal.d.ts +73 -56
- package/dist/cjs/core/ResponseModal.d.ts.map +1 -1
- package/dist/cjs/core/ResponseModal.js +1191 -1014
- package/dist/cjs/core/ResponseModal.js.map +1 -1
- package/dist/cjs/core/ResponsePipeline.d.ts +124 -26
- package/dist/cjs/core/ResponsePipeline.d.ts.map +1 -1
- package/dist/cjs/core/ResponsePipeline.js +509 -136
- package/dist/cjs/core/ResponsePipeline.js.map +1 -1
- package/dist/cjs/core/SignalEvaluator.d.ts +86 -0
- package/dist/cjs/core/SignalEvaluator.d.ts.map +1 -0
- package/dist/cjs/core/SignalEvaluator.js +333 -0
- package/dist/cjs/core/SignalEvaluator.js.map +1 -0
- package/dist/cjs/core/SignalProcessor.d.ts +152 -0
- package/dist/cjs/core/SignalProcessor.d.ts.map +1 -0
- package/dist/cjs/core/SignalProcessor.js +562 -0
- package/dist/cjs/core/SignalProcessor.js.map +1 -0
- package/dist/cjs/core/Step.d.ts +43 -32
- package/dist/cjs/core/Step.d.ts.map +1 -1
- package/dist/cjs/core/Step.js +221 -126
- package/dist/cjs/core/Step.js.map +1 -1
- package/dist/cjs/core/StreamingToolExecutor.d.ts +2 -2
- package/dist/cjs/core/StreamingToolExecutor.d.ts.map +1 -1
- package/dist/cjs/core/StreamingToolExecutor.js.map +1 -1
- package/dist/cjs/core/ToolManager.d.ts +44 -13
- package/dist/cjs/core/ToolManager.d.ts.map +1 -1
- package/dist/cjs/core/ToolManager.js +174 -91
- package/dist/cjs/core/ToolManager.js.map +1 -1
- package/dist/cjs/core/createAgent.d.ts +35 -0
- package/dist/cjs/core/createAgent.d.ts.map +1 -0
- package/dist/cjs/core/createAgent.js +39 -0
- package/dist/cjs/core/createAgent.js.map +1 -0
- package/dist/cjs/core/flow-namespace.d.ts +49 -0
- package/dist/cjs/core/flow-namespace.d.ts.map +1 -0
- package/dist/cjs/core/flow-namespace.js +171 -0
- package/dist/cjs/core/flow-namespace.js.map +1 -0
- package/dist/cjs/index.d.ts +11 -14
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +18 -22
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/providers/AnthropicProvider.d.ts +1 -1
- package/dist/cjs/providers/AnthropicProvider.js +1 -1
- package/dist/cjs/providers/GeminiProvider.d.ts +1 -1
- package/dist/cjs/providers/GeminiProvider.d.ts.map +1 -1
- package/dist/cjs/providers/GeminiProvider.js +1 -1
- package/dist/cjs/providers/GeminiProvider.js.map +1 -1
- package/dist/cjs/providers/OpenAIProvider.d.ts +1 -1
- package/dist/cjs/providers/OpenAIProvider.d.ts.map +1 -1
- package/dist/cjs/providers/OpenAIProvider.js +1 -1
- package/dist/cjs/providers/OpenAIProvider.js.map +1 -1
- package/dist/cjs/types/agent.d.ts +183 -54
- package/dist/cjs/types/agent.d.ts.map +1 -1
- package/dist/cjs/types/agent.js +0 -6
- package/dist/cjs/types/agent.js.map +1 -1
- package/dist/cjs/types/ai.d.ts +3 -3
- package/dist/cjs/types/ai.d.ts.map +1 -1
- package/dist/cjs/types/errors.d.ts +15 -0
- package/dist/cjs/types/errors.d.ts.map +1 -0
- package/dist/cjs/types/errors.js +22 -0
- package/dist/cjs/types/errors.js.map +1 -0
- package/dist/cjs/types/flow.d.ts +513 -0
- package/dist/cjs/types/flow.d.ts.map +1 -0
- package/dist/cjs/types/{route.js → flow.js} +2 -2
- package/dist/cjs/types/flow.js.map +1 -0
- package/dist/cjs/types/index.d.ts +7 -6
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +6 -2
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/persistence.d.ts +11 -7
- package/dist/cjs/types/persistence.d.ts.map +1 -1
- package/dist/cjs/types/routing.d.ts +1 -1
- package/dist/cjs/types/routing.d.ts.map +1 -1
- package/dist/cjs/types/session.d.ts +24 -23
- package/dist/cjs/types/session.d.ts.map +1 -1
- package/dist/cjs/types/signals.d.ts +248 -0
- package/dist/cjs/types/signals.d.ts.map +1 -0
- package/dist/cjs/types/signals.js +11 -0
- package/dist/cjs/types/signals.js.map +1 -0
- package/dist/cjs/types/template.d.ts +2 -8
- package/dist/cjs/types/template.d.ts.map +1 -1
- package/dist/cjs/types/tool.d.ts +36 -29
- package/dist/cjs/types/tool.d.ts.map +1 -1
- package/dist/cjs/types/tool.js +1 -1
- package/dist/cjs/types/tool.js.map +1 -1
- package/dist/cjs/utils/condition.d.ts +7 -1
- package/dist/cjs/utils/condition.d.ts.map +1 -1
- package/dist/cjs/utils/condition.js.map +1 -1
- package/dist/cjs/utils/id.d.ts +13 -5
- package/dist/cjs/utils/id.d.ts.map +1 -1
- package/dist/cjs/utils/id.js +24 -10
- package/dist/cjs/utils/id.js.map +1 -1
- package/dist/cjs/utils/index.d.ts +2 -2
- package/dist/cjs/utils/index.d.ts.map +1 -1
- package/dist/cjs/utils/index.js +7 -3
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/session.d.ts +44 -5
- package/dist/cjs/utils/session.d.ts.map +1 -1
- package/dist/cjs/utils/session.js +197 -38
- package/dist/cjs/utils/session.js.map +1 -1
- package/dist/constants/index.d.ts +0 -9
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +3 -9
- package/dist/constants/index.js.map +1 -1
- package/dist/core/Agent.d.ts +119 -153
- package/dist/core/Agent.d.ts.map +1 -1
- package/dist/core/Agent.js +472 -325
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/AutoChainExecutor.d.ts +107 -0
- package/dist/core/AutoChainExecutor.d.ts.map +1 -0
- package/dist/core/AutoChainExecutor.js +293 -0
- package/dist/core/AutoChainExecutor.js.map +1 -0
- package/dist/core/BranchEvaluator.d.ts +54 -0
- package/dist/core/BranchEvaluator.d.ts.map +1 -0
- package/dist/core/BranchEvaluator.js +126 -0
- package/dist/core/BranchEvaluator.js.map +1 -0
- package/dist/core/DirectiveBus.d.ts +88 -0
- package/dist/core/DirectiveBus.d.ts.map +1 -0
- package/dist/core/DirectiveBus.js +192 -0
- package/dist/core/DirectiveBus.js.map +1 -0
- package/dist/core/DirectiveChainTracker.d.ts +49 -0
- package/dist/core/DirectiveChainTracker.d.ts.map +1 -0
- package/dist/core/DirectiveChainTracker.js +117 -0
- package/dist/core/DirectiveChainTracker.js.map +1 -0
- package/dist/core/Flow.d.ts +186 -0
- package/dist/core/Flow.d.ts.map +1 -0
- package/dist/core/Flow.js +546 -0
- package/dist/core/Flow.js.map +1 -0
- package/dist/core/FlowRouter.d.ts +182 -0
- package/dist/core/FlowRouter.d.ts.map +1 -0
- package/dist/core/{RoutingEngine.js → FlowRouter.js} +322 -305
- package/dist/core/FlowRouter.js.map +1 -0
- package/dist/core/PersistenceManager.d.ts +2 -2
- package/dist/core/PersistenceManager.d.ts.map +1 -1
- package/dist/core/PersistenceManager.js +7 -7
- package/dist/core/PersistenceManager.js.map +1 -1
- package/dist/core/PromptComposer.d.ts +21 -8
- package/dist/core/PromptComposer.d.ts.map +1 -1
- package/dist/core/PromptComposer.js +183 -106
- package/dist/core/PromptComposer.js.map +1 -1
- package/dist/core/PromptSectionCache.d.ts +1 -1
- package/dist/core/PromptSectionCache.js +1 -1
- package/dist/core/ResponseEngine.d.ts +18 -8
- package/dist/core/ResponseEngine.d.ts.map +1 -1
- package/dist/core/ResponseEngine.js +38 -36
- package/dist/core/ResponseEngine.js.map +1 -1
- package/dist/core/ResponseModal.d.ts +73 -56
- package/dist/core/ResponseModal.d.ts.map +1 -1
- package/dist/core/ResponseModal.js +1193 -1016
- package/dist/core/ResponseModal.js.map +1 -1
- package/dist/core/ResponsePipeline.d.ts +124 -26
- package/dist/core/ResponsePipeline.d.ts.map +1 -1
- package/dist/core/ResponsePipeline.js +509 -137
- package/dist/core/ResponsePipeline.js.map +1 -1
- package/dist/core/SignalEvaluator.d.ts +86 -0
- package/dist/core/SignalEvaluator.d.ts.map +1 -0
- package/dist/core/SignalEvaluator.js +326 -0
- package/dist/core/SignalEvaluator.js.map +1 -0
- package/dist/core/SignalProcessor.d.ts +152 -0
- package/dist/core/SignalProcessor.d.ts.map +1 -0
- package/dist/core/SignalProcessor.js +555 -0
- package/dist/core/SignalProcessor.js.map +1 -0
- package/dist/core/Step.d.ts +43 -32
- package/dist/core/Step.d.ts.map +1 -1
- package/dist/core/Step.js +220 -126
- package/dist/core/Step.js.map +1 -1
- package/dist/core/StreamingToolExecutor.d.ts +2 -2
- package/dist/core/StreamingToolExecutor.d.ts.map +1 -1
- package/dist/core/StreamingToolExecutor.js.map +1 -1
- package/dist/core/ToolManager.d.ts +44 -13
- package/dist/core/ToolManager.d.ts.map +1 -1
- package/dist/core/ToolManager.js +174 -91
- package/dist/core/ToolManager.js.map +1 -1
- package/dist/core/createAgent.d.ts +35 -0
- package/dist/core/createAgent.d.ts.map +1 -0
- package/dist/core/createAgent.js +36 -0
- package/dist/core/createAgent.js.map +1 -0
- package/dist/core/flow-namespace.d.ts +49 -0
- package/dist/core/flow-namespace.d.ts.map +1 -0
- package/dist/core/flow-namespace.js +168 -0
- package/dist/core/flow-namespace.js.map +1 -0
- package/dist/index.d.ts +11 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -12
- package/dist/index.js.map +1 -1
- package/dist/providers/AnthropicProvider.d.ts +1 -1
- package/dist/providers/AnthropicProvider.js +1 -1
- package/dist/providers/GeminiProvider.d.ts +1 -1
- package/dist/providers/GeminiProvider.d.ts.map +1 -1
- package/dist/providers/GeminiProvider.js +1 -1
- package/dist/providers/GeminiProvider.js.map +1 -1
- package/dist/providers/OpenAIProvider.d.ts +1 -1
- package/dist/providers/OpenAIProvider.d.ts.map +1 -1
- package/dist/providers/OpenAIProvider.js +1 -1
- package/dist/providers/OpenAIProvider.js.map +1 -1
- package/dist/types/agent.d.ts +183 -54
- package/dist/types/agent.d.ts.map +1 -1
- package/dist/types/agent.js +0 -6
- package/dist/types/agent.js.map +1 -1
- package/dist/types/ai.d.ts +3 -3
- package/dist/types/ai.d.ts.map +1 -1
- package/dist/types/errors.d.ts +15 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +18 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/flow.d.ts +513 -0
- package/dist/types/flow.d.ts.map +1 -0
- package/dist/types/flow.js +5 -0
- package/dist/types/flow.js.map +1 -0
- package/dist/types/index.d.ts +7 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +4 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/persistence.d.ts +11 -7
- package/dist/types/persistence.d.ts.map +1 -1
- package/dist/types/routing.d.ts +1 -1
- package/dist/types/routing.d.ts.map +1 -1
- package/dist/types/session.d.ts +24 -23
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/signals.d.ts +248 -0
- package/dist/types/signals.d.ts.map +1 -0
- package/dist/types/signals.js +10 -0
- package/dist/types/signals.js.map +1 -0
- package/dist/types/template.d.ts +2 -8
- package/dist/types/template.d.ts.map +1 -1
- package/dist/types/tool.d.ts +36 -29
- package/dist/types/tool.d.ts.map +1 -1
- package/dist/types/tool.js +1 -1
- package/dist/types/tool.js.map +1 -1
- package/dist/utils/condition.d.ts +7 -1
- package/dist/utils/condition.d.ts.map +1 -1
- package/dist/utils/condition.js.map +1 -1
- package/dist/utils/id.d.ts +13 -5
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/id.js +22 -9
- package/dist/utils/id.js.map +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/session.d.ts +44 -5
- package/dist/utils/session.d.ts.map +1 -1
- package/dist/utils/session.js +193 -37
- package/dist/utils/session.js.map +1 -1
- package/docs/README.md +22 -200
- package/docs/concepts/architecture.md +281 -0
- package/docs/concepts/directives.md +400 -0
- package/docs/concepts/pipeline.md +399 -0
- package/docs/guides/branching.md +263 -0
- package/docs/guides/compaction.md +163 -0
- package/docs/guides/conditions.md +167 -0
- package/docs/guides/error-handling.md +176 -0
- package/docs/guides/flow-control.md +409 -0
- package/docs/guides/instructions.md +210 -0
- package/docs/guides/persistence.md +182 -0
- package/docs/guides/streaming.md +137 -0
- package/docs/migration/README.md +14 -0
- package/docs/migration/route-to-flow.md +561 -0
- package/docs/migration/v1-to-v2.md +909 -0
- package/docs/reference/adapters.md +481 -0
- package/docs/reference/branches.md +241 -0
- package/docs/reference/create-agent.md +186 -0
- package/docs/reference/directive.md +243 -0
- package/docs/reference/errors.md +122 -0
- package/docs/reference/flow.md +238 -0
- package/docs/reference/instruction.md +177 -0
- package/docs/reference/pre-directive.md +131 -0
- package/docs/reference/providers.md +227 -0
- package/docs/reference/signals.md +356 -0
- package/docs/reference/step.md +339 -0
- package/docs/reference/tool.md +269 -0
- package/docs/start/01-install.md +81 -0
- package/docs/start/02-first-agent.md +196 -0
- package/docs/start/03-collect-data.md +222 -0
- package/docs/start/04-add-tools.md +276 -0
- package/docs/start/05-go-to-production.md +216 -0
- package/examples/01-quickstart.ts +20 -0
- package/examples/02-data-extraction.ts +90 -0
- package/examples/03-tools.ts +136 -0
- package/examples/04-instructions.ts +100 -0
- package/examples/05-branching.ts +140 -0
- package/examples/06-flow-control.ts +103 -0
- package/examples/07-streaming.ts +69 -0
- package/examples/08-persistence.ts +98 -0
- package/examples/09-signals.ts +144 -0
- package/examples/tsconfig.json +30 -0
- package/package.json +2 -1
- package/src/adapters/MemoryAdapter.ts +3 -3
- package/src/adapters/MongoAdapter.ts +3 -3
- package/src/adapters/OpenSearchAdapter.ts +10 -8
- package/src/adapters/PostgreSQLAdapter.ts +26 -10
- package/src/adapters/PrismaAdapter.ts +6 -6
- package/src/adapters/RedisAdapter.ts +3 -3
- package/src/adapters/SQLiteAdapter.ts +31 -12
- package/src/constants/index.ts +2 -10
- package/src/core/Agent.ts +585 -374
- package/src/core/AutoChainExecutor.ts +440 -0
- package/src/core/BranchEvaluator.ts +167 -0
- package/src/core/DirectiveBus.ts +248 -0
- package/src/core/DirectiveChainTracker.ts +144 -0
- package/src/core/Flow.ts +666 -0
- package/src/core/{RoutingEngine.ts → FlowRouter.ts} +385 -365
- package/src/core/PersistenceManager.ts +8 -8
- package/src/core/PromptComposer.ts +209 -140
- package/src/core/PromptSectionCache.ts +1 -1
- package/src/core/ResponseEngine.ts +61 -46
- package/src/core/ResponseModal.ts +1453 -1240
- package/src/core/ResponsePipeline.ts +655 -175
- package/src/core/SignalEvaluator.ts +420 -0
- package/src/core/SignalProcessor.ts +723 -0
- package/src/core/Step.ts +279 -176
- package/src/core/StreamingToolExecutor.ts +4 -4
- package/src/core/ToolManager.ts +200 -97
- package/src/core/createAgent.ts +40 -0
- package/src/core/flow-namespace.ts +219 -0
- package/src/index.ts +42 -36
- package/src/providers/AnthropicProvider.ts +2 -2
- package/src/providers/GeminiProvider.ts +2 -2
- package/src/providers/OpenAIProvider.ts +2 -2
- package/src/types/agent.ts +182 -53
- package/src/types/ai.ts +3 -3
- package/src/types/errors.ts +18 -0
- package/src/types/flow.ts +590 -0
- package/src/types/index.ts +43 -16
- package/src/types/persistence.ts +12 -8
- package/src/types/routing.ts +1 -1
- package/src/types/session.ts +26 -23
- package/src/types/signals.ts +321 -0
- package/src/types/template.ts +3 -11
- package/src/types/tool.ts +50 -42
- package/src/utils/condition.ts +13 -4
- package/src/utils/id.ts +27 -9
- package/src/utils/index.ts +6 -2
- package/src/utils/session.ts +238 -42
- package/dist/cjs/core/BatchExecutor.d.ts +0 -359
- package/dist/cjs/core/BatchExecutor.d.ts.map +0 -1
- package/dist/cjs/core/BatchExecutor.js +0 -861
- package/dist/cjs/core/BatchExecutor.js.map +0 -1
- package/dist/cjs/core/BatchPromptBuilder.d.ts +0 -89
- package/dist/cjs/core/BatchPromptBuilder.d.ts.map +0 -1
- package/dist/cjs/core/BatchPromptBuilder.js +0 -223
- package/dist/cjs/core/BatchPromptBuilder.js.map +0 -1
- package/dist/cjs/core/Route.d.ts +0 -180
- package/dist/cjs/core/Route.d.ts.map +0 -1
- package/dist/cjs/core/Route.js +0 -542
- package/dist/cjs/core/Route.js.map +0 -1
- package/dist/cjs/core/RoutingEngine.d.ts +0 -185
- package/dist/cjs/core/RoutingEngine.d.ts.map +0 -1
- package/dist/cjs/core/RoutingEngine.js.map +0 -1
- package/dist/cjs/types/route.d.ts +0 -336
- package/dist/cjs/types/route.d.ts.map +0 -1
- package/dist/cjs/types/route.js.map +0 -1
- package/dist/core/BatchExecutor.d.ts +0 -359
- package/dist/core/BatchExecutor.d.ts.map +0 -1
- package/dist/core/BatchExecutor.js +0 -856
- package/dist/core/BatchExecutor.js.map +0 -1
- package/dist/core/BatchPromptBuilder.d.ts +0 -89
- package/dist/core/BatchPromptBuilder.d.ts.map +0 -1
- package/dist/core/BatchPromptBuilder.js +0 -219
- package/dist/core/BatchPromptBuilder.js.map +0 -1
- package/dist/core/Route.d.ts +0 -180
- package/dist/core/Route.d.ts.map +0 -1
- package/dist/core/Route.js +0 -538
- package/dist/core/Route.js.map +0 -1
- package/dist/core/RoutingEngine.d.ts +0 -185
- package/dist/core/RoutingEngine.d.ts.map +0 -1
- package/dist/core/RoutingEngine.js.map +0 -1
- package/dist/types/route.d.ts +0 -336
- package/dist/types/route.d.ts.map +0 -1
- package/dist/types/route.js +0 -5
- package/dist/types/route.js.map +0 -1
- package/docs/CONTRIBUTING.md +0 -521
- package/docs/api/README.md +0 -3299
- package/docs/api/overview.md +0 -1410
- package/docs/architecture/data-extraction-flow.md +0 -360
- package/docs/architecture/multi-step-execution.md +0 -277
- package/docs/core/agent/README.md +0 -938
- package/docs/core/agent/context-management.md +0 -796
- package/docs/core/agent/rules-and-prohibitions.md +0 -113
- package/docs/core/agent/session-management.md +0 -693
- package/docs/core/ai-integration/prompt-composition.md +0 -355
- package/docs/core/ai-integration/providers.md +0 -515
- package/docs/core/ai-integration/response-processing.md +0 -433
- package/docs/core/conversation-flows/data-collection.md +0 -772
- package/docs/core/conversation-flows/route-dsl.md +0 -509
- package/docs/core/conversation-flows/routes.md +0 -249
- package/docs/core/conversation-flows/step-transitions.md +0 -731
- package/docs/core/conversation-flows/steps.md +0 -268
- package/docs/core/error-handling.md +0 -830
- package/docs/core/persistence/adapters.md +0 -255
- package/docs/core/persistence/session-storage.md +0 -656
- package/docs/core/routing/intelligent-routing.md +0 -470
- package/docs/core/tools/enhanced-tool.md +0 -186
- package/docs/core/tools/streaming-execution.md +0 -161
- package/docs/core/tools/tool-definition.md +0 -970
- package/docs/core/tools/tool-scoping.md +0 -819
- package/docs/guides/advanced-patterns/publishing.md +0 -186
- package/docs/guides/context-compaction.md +0 -96
- package/docs/guides/error-handling-patterns.md +0 -578
- package/docs/guides/getting-started/README.md +0 -795
- package/docs/guides/migration/README.md +0 -101
- package/docs/guides/migration/flexible-routing-conditions.md +0 -375
- package/docs/guides/migration/multi-step-execution.md +0 -393
- package/docs/guides/migration/response-modal-refactor.md +0 -518
- package/docs/guides/prompt-optimization.md +0 -164
- package/examples/advanced-patterns/context-compaction.ts +0 -223
- package/examples/advanced-patterns/knowledge-based-agent.ts +0 -735
- package/examples/advanced-patterns/persistent-onboarding.ts +0 -728
- package/examples/advanced-patterns/route-lifecycle-hooks.ts +0 -556
- package/examples/advanced-patterns/streaming-responses.ts +0 -656
- package/examples/ai-providers/anthropic-integration.ts +0 -388
- package/examples/ai-providers/openai-integration.ts +0 -228
- package/examples/condition-patterns/function-only-conditions.ts +0 -365
- package/examples/condition-patterns/mixed-array-conditions.ts +0 -477
- package/examples/condition-patterns/route-skipif-patterns.ts +0 -468
- package/examples/condition-patterns/step-skipif-patterns.ts +0 -0
- package/examples/condition-patterns/string-only-conditions.ts +0 -296
- package/examples/conversation-flows/completion-transitions.ts +0 -318
- package/examples/core-concepts/basic-agent.ts +0 -503
- package/examples/core-concepts/modern-streaming-api.ts +0 -309
- package/examples/core-concepts/schema-driven-extraction.ts +0 -332
- package/examples/core-concepts/session-management.ts +0 -494
- package/examples/integrations/database-integration.ts +0 -631
- package/examples/integrations/healthcare-integration.ts +0 -595
- package/examples/integrations/search-integration.ts +0 -530
- package/examples/integrations/server-session-management.ts +0 -307
- package/examples/persistence/custom-adapter.ts +0 -526
- package/examples/persistence/database-persistence.ts +0 -583
- package/examples/persistence/memory-sessions.ts +0 -495
- package/examples/persistence/prisma-schema.example.prisma +0 -74
- package/examples/persistence/redis-persistence.ts +0 -488
- package/examples/tools/basic-tools.ts +0 -765
- package/examples/tools/data-enrichment-tools.ts +0 -593
- package/examples/tools/enhanced-tool-metadata.ts +0 -268
- package/examples/tools/streaming-tool-execution.ts +0 -283
- package/src/core/BatchExecutor.ts +0 -1187
- package/src/core/BatchPromptBuilder.ts +0 -299
- package/src/core/Route.ts +0 -678
- package/src/types/route.ts +0 -392
package/docs/CONTRIBUTING.md
DELETED
|
@@ -1,521 +0,0 @@
|
|
|
1
|
-
# Contributing to @falai/agent
|
|
2
|
-
|
|
3
|
-
First off, thank you for considering contributing to @falai/agent! 🎉
|
|
4
|
-
|
|
5
|
-
It's people like you that make @falai/agent such a great tool for building AI agents.
|
|
6
|
-
|
|
7
|
-
## Table of Contents
|
|
8
|
-
|
|
9
|
-
- [Code of Conduct](#code-of-conduct)
|
|
10
|
-
- [How Can I Contribute?](#how-can-i-contribute)
|
|
11
|
-
- [Getting Started](#getting-started)
|
|
12
|
-
- [Development Workflow](#development-workflow)
|
|
13
|
-
- [Style Guidelines](#style-guidelines)
|
|
14
|
-
- [Commit Guidelines](#commit-guidelines)
|
|
15
|
-
- [Pull Request Process](#pull-request-process)
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Code of Conduct
|
|
20
|
-
|
|
21
|
-
This project and everyone participating in it is governed by our commitment to fostering an open and welcoming environment. We pledge to make participation in our project a harassment-free experience for everyone.
|
|
22
|
-
|
|
23
|
-
### Our Standards
|
|
24
|
-
|
|
25
|
-
**Positive behavior includes:**
|
|
26
|
-
|
|
27
|
-
- Using welcoming and inclusive language
|
|
28
|
-
- Being respectful of differing viewpoints
|
|
29
|
-
- Gracefully accepting constructive criticism
|
|
30
|
-
- Focusing on what is best for the community
|
|
31
|
-
- Showing empathy towards other community members
|
|
32
|
-
|
|
33
|
-
**Unacceptable behavior includes:**
|
|
34
|
-
|
|
35
|
-
- Harassment, trolling, or insulting/derogatory comments
|
|
36
|
-
- Public or private harassment
|
|
37
|
-
- Publishing others' private information without permission
|
|
38
|
-
- Other conduct which could reasonably be considered inappropriate
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Tool System Overview
|
|
43
|
-
|
|
44
|
-
@falai/agent features a unified Tool interface that supports both simple return values and complex ToolResult patterns:
|
|
45
|
-
|
|
46
|
-
### Unified Tool Interface
|
|
47
|
-
|
|
48
|
-
```typescript
|
|
49
|
-
interface Tool<TContext = unknown, TData = unknown, TResult = unknown> {
|
|
50
|
-
id: string;
|
|
51
|
-
name?: string;
|
|
52
|
-
description?: string;
|
|
53
|
-
parameters?: unknown;
|
|
54
|
-
handler: (
|
|
55
|
-
context: ToolContext<TContext, TData>,
|
|
56
|
-
args?: Record<string, unknown>
|
|
57
|
-
) => Promise<TResult | ToolResult<TResult, TContext, TData>> | TResult | ToolResult<TResult, TContext, TData>;
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Tool Creation Methods
|
|
62
|
-
|
|
63
|
-
- **`agent.addTool()`** - Direct addition to agent scope
|
|
64
|
-
- **`agent.tool.register()`** - Registry for ID-based reference
|
|
65
|
-
- **`agent.tool.create()`** - Create without adding to scope
|
|
66
|
-
- **Pattern helpers** - `createDataEnrichment()`, `createValidation()`, etc.
|
|
67
|
-
|
|
68
|
-
### Return Value Flexibility
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
// Simple return value
|
|
72
|
-
handler: async () => "Simple result"
|
|
73
|
-
|
|
74
|
-
// Complex ToolResult object
|
|
75
|
-
handler: async () => ({
|
|
76
|
-
data: "Result data",
|
|
77
|
-
success: true,
|
|
78
|
-
contextUpdate: { lastAction: "completed" }
|
|
79
|
-
})
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## How Can I Contribute?
|
|
83
|
-
|
|
84
|
-
### 🐛 Reporting Bugs
|
|
85
|
-
|
|
86
|
-
Before creating bug reports, please check existing issues to avoid duplicates.
|
|
87
|
-
|
|
88
|
-
**When submitting a bug report, include:**
|
|
89
|
-
|
|
90
|
-
- A clear and descriptive title
|
|
91
|
-
- Steps to reproduce the behavior
|
|
92
|
-
- Expected vs actual behavior
|
|
93
|
-
- Code samples or test cases
|
|
94
|
-
- Your environment (Node/Bun version, OS, TypeScript version)
|
|
95
|
-
- Screenshots if applicable
|
|
96
|
-
|
|
97
|
-
**Template:**
|
|
98
|
-
|
|
99
|
-
```markdown
|
|
100
|
-
**Description**
|
|
101
|
-
A clear description of the bug.
|
|
102
|
-
|
|
103
|
-
**To Reproduce**
|
|
104
|
-
|
|
105
|
-
1. Create an agent with '...'
|
|
106
|
-
2. Call method '...'
|
|
107
|
-
3. See error
|
|
108
|
-
|
|
109
|
-
**Expected Behavior**
|
|
110
|
-
What you expected to happen.
|
|
111
|
-
|
|
112
|
-
**Actual Behavior**
|
|
113
|
-
What actually happened.
|
|
114
|
-
|
|
115
|
-
**Environment**
|
|
116
|
-
|
|
117
|
-
- Node/Bun version:
|
|
118
|
-
- TypeScript version:
|
|
119
|
-
- @falai/agent version:
|
|
120
|
-
- OS:
|
|
121
|
-
|
|
122
|
-
**Additional Context**
|
|
123
|
-
Any other relevant information.
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### 💡 Suggesting Enhancements
|
|
127
|
-
|
|
128
|
-
Enhancement suggestions are tracked as GitHub issues.
|
|
129
|
-
|
|
130
|
-
**When suggesting an enhancement, include:**
|
|
131
|
-
|
|
132
|
-
- A clear and descriptive title
|
|
133
|
-
- The current behavior vs proposed behavior
|
|
134
|
-
- Why this enhancement would be useful
|
|
135
|
-
- Examples of how it would work
|
|
136
|
-
- Potential implementation approach (optional)
|
|
137
|
-
|
|
138
|
-
### 📝 Documentation Improvements
|
|
139
|
-
|
|
140
|
-
Documentation is crucial! Feel free to:
|
|
141
|
-
|
|
142
|
-
- Fix typos or unclear wording
|
|
143
|
-
- Add examples
|
|
144
|
-
- Improve API documentation
|
|
145
|
-
- Create tutorials or guides
|
|
146
|
-
- Translate documentation
|
|
147
|
-
|
|
148
|
-
### 🔨 Code Contributions
|
|
149
|
-
|
|
150
|
-
Want to add a feature or fix a bug? Great!
|
|
151
|
-
|
|
152
|
-
---
|
|
153
|
-
|
|
154
|
-
## Getting Started
|
|
155
|
-
|
|
156
|
-
### Prerequisites
|
|
157
|
-
|
|
158
|
-
- **Node.js 18+** or **Bun 1.0+**
|
|
159
|
-
- **Git**
|
|
160
|
-
- **TypeScript knowledge**
|
|
161
|
-
- Familiarity with AI/LLM concepts (helpful but not required)
|
|
162
|
-
|
|
163
|
-
### Fork & Clone
|
|
164
|
-
|
|
165
|
-
```bash
|
|
166
|
-
# Fork the repository on GitHub, then:
|
|
167
|
-
git clone https://github.com/YOUR_USERNAME/falai.git
|
|
168
|
-
cd falai
|
|
169
|
-
|
|
170
|
-
# Add upstream remote
|
|
171
|
-
git remote add upstream https://github.com/falai-dev/agent.git
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### Install Dependencies
|
|
175
|
-
|
|
176
|
-
```bash
|
|
177
|
-
# Using bun (recommended)
|
|
178
|
-
bun install
|
|
179
|
-
|
|
180
|
-
# Or using npm
|
|
181
|
-
npm install
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### Set Up Development Environment
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
# Create .env file
|
|
188
|
-
echo "GEMINI_API_KEY=your_test_key_here" > .env
|
|
189
|
-
|
|
190
|
-
# Build the project
|
|
191
|
-
bun run build
|
|
192
|
-
|
|
193
|
-
# Run type checking
|
|
194
|
-
bun typecheck
|
|
195
|
-
|
|
196
|
-
# Run linting
|
|
197
|
-
bun lint
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
---
|
|
201
|
-
|
|
202
|
-
## Development Workflow
|
|
203
|
-
|
|
204
|
-
### 1. Create a Branch
|
|
205
|
-
|
|
206
|
-
```bash
|
|
207
|
-
# Update your main branch
|
|
208
|
-
git checkout main
|
|
209
|
-
git pull upstream main
|
|
210
|
-
|
|
211
|
-
# Create a feature branch
|
|
212
|
-
git checkout -b feature/your-feature-name
|
|
213
|
-
# or
|
|
214
|
-
git checkout -b fix/issue-description
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
**Branch naming conventions:**
|
|
218
|
-
|
|
219
|
-
- `feature/` - New features
|
|
220
|
-
- `fix/` - Bug fixes
|
|
221
|
-
- `docs/` - Documentation only
|
|
222
|
-
- `refactor/` - Code refactoring
|
|
223
|
-
- `test/` - Adding tests
|
|
224
|
-
- `chore/` - Maintenance tasks
|
|
225
|
-
|
|
226
|
-
### 2. Make Your Changes
|
|
227
|
-
|
|
228
|
-
#### Project Structure
|
|
229
|
-
|
|
230
|
-
```
|
|
231
|
-
src/
|
|
232
|
-
├── types/ # Type definitions
|
|
233
|
-
├── core/ # Core classes (Agent, Route, etc.)
|
|
234
|
-
├── providers/ # AI provider implementations
|
|
235
|
-
├── utils/ # Utility functions
|
|
236
|
-
├── constants/ # Constants
|
|
237
|
-
└── index.ts # Public exports
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
#### Key Principles
|
|
241
|
-
|
|
242
|
-
- **DRY** - Don't Repeat Yourself
|
|
243
|
-
- **Modular** - Keep code organized and reusable
|
|
244
|
-
- **Type-Safe** - Use TypeScript properly
|
|
245
|
-
- **Tested** - Add tests for new features
|
|
246
|
-
- **Documented** - Update docs for public APIs
|
|
247
|
-
|
|
248
|
-
### 3. Write Tests
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
# Run tests (when implemented)
|
|
252
|
-
bun test
|
|
253
|
-
|
|
254
|
-
# Run tests in watch mode
|
|
255
|
-
bun test --watch
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
**Test Guidelines:**
|
|
259
|
-
|
|
260
|
-
- Unit tests for individual functions
|
|
261
|
-
- Integration tests for features
|
|
262
|
-
- Add tests before fixing bugs
|
|
263
|
-
- Aim for >80% coverage
|
|
264
|
-
|
|
265
|
-
### 4. Check Your Code
|
|
266
|
-
|
|
267
|
-
```bash
|
|
268
|
-
# Type checking
|
|
269
|
-
bun typecheck
|
|
270
|
-
|
|
271
|
-
# Linting
|
|
272
|
-
bun lint
|
|
273
|
-
|
|
274
|
-
# Fix linting issues automatically
|
|
275
|
-
bun lint:fix
|
|
276
|
-
|
|
277
|
-
# Build to ensure no errors
|
|
278
|
-
bun run build
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
### 5. Commit Your Changes
|
|
282
|
-
|
|
283
|
-
Follow [Conventional Commits](https://www.conventionalcommits.org/):
|
|
284
|
-
|
|
285
|
-
```bash
|
|
286
|
-
git add .
|
|
287
|
-
git commit -m "feat: add support for routes"
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
**Commit types:**
|
|
291
|
-
|
|
292
|
-
- `feat:` - New feature
|
|
293
|
-
- `fix:` - Bug fix
|
|
294
|
-
- `docs:` - Documentation changes
|
|
295
|
-
- `style:` - Code style changes (formatting, etc.)
|
|
296
|
-
- `refactor:` - Code refactoring
|
|
297
|
-
- `test:` - Adding or updating tests
|
|
298
|
-
- `chore:` - Maintenance tasks
|
|
299
|
-
|
|
300
|
-
**Examples:**
|
|
301
|
-
|
|
302
|
-
```bash
|
|
303
|
-
git commit -m "feat: add retry logic to AI provider"
|
|
304
|
-
git commit -m "fix: resolve route reference memory leak"
|
|
305
|
-
git commit -m "docs: update API reference for Agent class"
|
|
306
|
-
git commit -m "refactor: simplify prompt builder logic"
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
### 6. Push and Create PR
|
|
310
|
-
|
|
311
|
-
```bash
|
|
312
|
-
# Push your branch
|
|
313
|
-
git push origin feature/your-feature-name
|
|
314
|
-
|
|
315
|
-
# Create a Pull Request on GitHub
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
---
|
|
319
|
-
|
|
320
|
-
## Style Guidelines
|
|
321
|
-
|
|
322
|
-
### TypeScript Style
|
|
323
|
-
|
|
324
|
-
```typescript
|
|
325
|
-
// ✅ Good
|
|
326
|
-
interface UserContext {
|
|
327
|
-
userId: string;
|
|
328
|
-
userName: string;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
const agent = new Agent<UserContext>({
|
|
332
|
-
name: "SupportBot",
|
|
333
|
-
provider: provider,
|
|
334
|
-
});
|
|
335
|
-
|
|
336
|
-
// ❌ Bad
|
|
337
|
-
interface user_context {
|
|
338
|
-
user_id: string;
|
|
339
|
-
user_name: string;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
const agent = new Agent<any>({
|
|
343
|
-
name: "SupportBot",
|
|
344
|
-
provider: provider,
|
|
345
|
-
});
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
### Code Style
|
|
349
|
-
|
|
350
|
-
- **Use TypeScript** - No `any` types unless absolutely necessary
|
|
351
|
-
- **camelCase** for variables and functions
|
|
352
|
-
- **PascalCase** for classes and interfaces
|
|
353
|
-
- **UPPER_SNAKE_CASE** for constants
|
|
354
|
-
- **Explicit return types** for public APIs
|
|
355
|
-
- **JSDoc comments** for public methods
|
|
356
|
-
- **No console.log** in production code (use proper logging)
|
|
357
|
-
|
|
358
|
-
### File Organization
|
|
359
|
-
|
|
360
|
-
```typescript
|
|
361
|
-
/**
|
|
362
|
-
* Brief description of the file
|
|
363
|
-
*/
|
|
364
|
-
|
|
365
|
-
// Imports - group by: external, internal types, internal code
|
|
366
|
-
import { ExternalLib } from "external-lib";
|
|
367
|
-
import type { MyType } from "@types/mytype";
|
|
368
|
-
import { MyClass } from "@core/MyClass";
|
|
369
|
-
|
|
370
|
-
// Constants
|
|
371
|
-
const DEFAULT_VALUE = 10;
|
|
372
|
-
|
|
373
|
-
// Types (if not in types/)
|
|
374
|
-
interface LocalType {
|
|
375
|
-
// ...
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
// Main code
|
|
379
|
-
export class MyClass {
|
|
380
|
-
// ...
|
|
381
|
-
}
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
### Documentation Style
|
|
385
|
-
|
|
386
|
-
````typescript
|
|
387
|
-
/**
|
|
388
|
-
* Creates a new agent with the specified configuration.
|
|
389
|
-
*
|
|
390
|
-
* @example
|
|
391
|
-
* ```typescript
|
|
392
|
-
* const agent = new Agent({
|
|
393
|
-
* name: "MyBot",
|
|
394
|
-
* provider: provider,
|
|
395
|
-
* });
|
|
396
|
-
* ```
|
|
397
|
-
*
|
|
398
|
-
* @param options - Configuration options for the agent
|
|
399
|
-
* @returns A new Agent instance
|
|
400
|
-
*/
|
|
401
|
-
export class Agent<TContext = unknown> {
|
|
402
|
-
constructor(options: AgentOptions<TContext>) {
|
|
403
|
-
// ...
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
````
|
|
407
|
-
|
|
408
|
-
---
|
|
409
|
-
|
|
410
|
-
## Commit Guidelines
|
|
411
|
-
|
|
412
|
-
### Commit Message Format
|
|
413
|
-
|
|
414
|
-
```
|
|
415
|
-
<type>(<scope>): <subject>
|
|
416
|
-
|
|
417
|
-
<body>
|
|
418
|
-
|
|
419
|
-
<footer>
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
**Example:**
|
|
423
|
-
|
|
424
|
-
```
|
|
425
|
-
feat(agent): add support for custom AI providers
|
|
426
|
-
|
|
427
|
-
- Implement AiProvider interface
|
|
428
|
-
- Add OpenAI provider example
|
|
429
|
-
- Update documentation
|
|
430
|
-
|
|
431
|
-
Closes #123
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
### Scopes
|
|
435
|
-
|
|
436
|
-
- `agent` - Agent core
|
|
437
|
-
- `route` - Route/Journey DSL
|
|
438
|
-
- `tools` - Tool system
|
|
439
|
-
- `types` - Type definitions
|
|
440
|
-
- `providers` - AI providers
|
|
441
|
-
- `docs` - Documentation
|
|
442
|
-
- `examples` - Example files
|
|
443
|
-
|
|
444
|
-
---
|
|
445
|
-
|
|
446
|
-
## Pull Request Process
|
|
447
|
-
|
|
448
|
-
### Before Submitting
|
|
449
|
-
|
|
450
|
-
- [ ] Code compiles without errors (`bun run build`)
|
|
451
|
-
- [ ] All tests pass (`bun test`)
|
|
452
|
-
- [ ] Linting passes (`bun lint`)
|
|
453
|
-
- [ ] Type checking passes (`bun typecheck`)
|
|
454
|
-
- [ ] Documentation updated (if needed)
|
|
455
|
-
- [ ] Examples added (if new feature)
|
|
456
|
-
- [ ] CHANGELOG updated (for significant changes)
|
|
457
|
-
|
|
458
|
-
### PR Template
|
|
459
|
-
|
|
460
|
-
```markdown
|
|
461
|
-
## Description
|
|
462
|
-
|
|
463
|
-
Brief description of changes.
|
|
464
|
-
|
|
465
|
-
## Type of Change
|
|
466
|
-
|
|
467
|
-
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
468
|
-
- [ ] New feature (non-breaking change which adds functionality)
|
|
469
|
-
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
470
|
-
- [ ] Documentation update
|
|
471
|
-
|
|
472
|
-
## How Has This Been Tested?
|
|
473
|
-
|
|
474
|
-
Describe the tests you ran.
|
|
475
|
-
|
|
476
|
-
## Checklist
|
|
477
|
-
|
|
478
|
-
- [ ] My code follows the style guidelines
|
|
479
|
-
- [ ] I have performed a self-review
|
|
480
|
-
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
481
|
-
- [ ] I have made corresponding changes to the documentation
|
|
482
|
-
- [ ] My changes generate no new warnings
|
|
483
|
-
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
484
|
-
- [ ] New and existing unit tests pass locally with my changes
|
|
485
|
-
|
|
486
|
-
## Related Issues
|
|
487
|
-
|
|
488
|
-
Closes #(issue number)
|
|
489
|
-
```
|
|
490
|
-
|
|
491
|
-
### Review Process
|
|
492
|
-
|
|
493
|
-
1. **Automated Checks** - CI must pass
|
|
494
|
-
2. **Code Review** - At least one maintainer approval required
|
|
495
|
-
3. **Testing** - Reviewers may test your changes
|
|
496
|
-
4. **Discussion** - Address feedback and questions
|
|
497
|
-
5. **Merge** - Once approved, maintainers will merge
|
|
498
|
-
|
|
499
|
-
---
|
|
500
|
-
|
|
501
|
-
## Questions?
|
|
502
|
-
|
|
503
|
-
- 💬 Open a [Discussion](https://github.com/falai-dev/agent/discussions)
|
|
504
|
-
- 🐛 Report an [Issue](https://github.com/falai-dev/agent/issues)
|
|
505
|
-
- 📧 Email: (if you want to add your email)
|
|
506
|
-
|
|
507
|
-
---
|
|
508
|
-
|
|
509
|
-
## Recognition
|
|
510
|
-
|
|
511
|
-
Contributors will be:
|
|
512
|
-
|
|
513
|
-
- Listed in our README
|
|
514
|
-
- Mentioned in release notes
|
|
515
|
-
- Part of our growing community! 🎉
|
|
516
|
-
|
|
517
|
-
---
|
|
518
|
-
|
|
519
|
-
**Thank you for contributing to @falai/agent!**
|
|
520
|
-
|
|
521
|
-
Made with ❤️ for the community
|