@botbotgo/runtime 1.0.0
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/.github/workflows/ci.yml +46 -0
- package/.github/workflows/release.yml +79 -0
- package/README.md +71 -0
- package/config/examples/memory.yaml +39 -0
- package/config/examples/model.yaml +21 -0
- package/config/examples/runtime.yaml +44 -0
- package/config/examples/skills.yaml +8 -0
- package/config/examples/tool.yaml +16 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +4 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +41 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +140 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/resolveRuntimeConfig.d.ts +83 -0
- package/dist/config/resolveRuntimeConfig.d.ts.map +1 -0
- package/dist/config/resolveRuntimeConfig.js +85 -0
- package/dist/config/resolveRuntimeConfig.js.map +1 -0
- package/dist/config/resources.d.ts +112 -0
- package/dist/config/resources.d.ts.map +1 -0
- package/dist/config/resources.js +20 -0
- package/dist/config/resources.js.map +1 -0
- package/dist/config/runtimeConfigLoader.d.ts +28 -0
- package/dist/config/runtimeConfigLoader.d.ts.map +1 -0
- package/dist/config/runtimeConfigLoader.js +38 -0
- package/dist/config/runtimeConfigLoader.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/agentMiddleware.d.ts +3 -0
- package/dist/runtime/agentMiddleware.d.ts.map +1 -0
- package/dist/runtime/agentMiddleware.js +2 -0
- package/dist/runtime/agentMiddleware.js.map +1 -0
- package/dist/runtime/bootstrap/runtimeFactory.d.ts +7 -0
- package/dist/runtime/bootstrap/runtimeFactory.d.ts.map +1 -0
- package/dist/runtime/bootstrap/runtimeFactory.js +139 -0
- package/dist/runtime/bootstrap/runtimeFactory.js.map +1 -0
- package/dist/runtime/bootstrap/runtimeModuleInitializer.d.ts +5 -0
- package/dist/runtime/bootstrap/runtimeModuleInitializer.d.ts.map +1 -0
- package/dist/runtime/bootstrap/runtimeModuleInitializer.js +32 -0
- package/dist/runtime/bootstrap/runtimeModuleInitializer.js.map +1 -0
- package/dist/runtime/context/agentContext.d.ts +5 -0
- package/dist/runtime/context/agentContext.d.ts.map +1 -0
- package/dist/runtime/context/agentContext.js +19 -0
- package/dist/runtime/context/agentContext.js.map +1 -0
- package/dist/runtime/context/globalContext.d.ts +19 -0
- package/dist/runtime/context/globalContext.d.ts.map +1 -0
- package/dist/runtime/context/globalContext.js +47 -0
- package/dist/runtime/context/globalContext.js.map +1 -0
- package/dist/runtime/events/eventPublisher.d.ts +15 -0
- package/dist/runtime/events/eventPublisher.d.ts.map +1 -0
- package/dist/runtime/events/eventPublisher.js +23 -0
- package/dist/runtime/events/eventPublisher.js.map +1 -0
- package/dist/runtime/execution/agentRunExecutor.d.ts +38 -0
- package/dist/runtime/execution/agentRunExecutor.d.ts.map +1 -0
- package/dist/runtime/execution/agentRunExecutor.js +378 -0
- package/dist/runtime/execution/agentRunExecutor.js.map +1 -0
- package/dist/runtime/execution/agentRunExecutor.types.d.ts +37 -0
- package/dist/runtime/execution/agentRunExecutor.types.d.ts.map +1 -0
- package/dist/runtime/execution/agentRunExecutor.types.js +2 -0
- package/dist/runtime/execution/agentRunExecutor.types.js.map +1 -0
- package/dist/runtime/execution/agentRunProgress.d.ts +8 -0
- package/dist/runtime/execution/agentRunProgress.d.ts.map +1 -0
- package/dist/runtime/execution/agentRunProgress.js +46 -0
- package/dist/runtime/execution/agentRunProgress.js.map +1 -0
- package/dist/runtime/execution/agentRunState.d.ts +44 -0
- package/dist/runtime/execution/agentRunState.d.ts.map +1 -0
- package/dist/runtime/execution/agentRunState.js +17 -0
- package/dist/runtime/execution/agentRunState.js.map +1 -0
- package/dist/runtime/execution/policies/runCompletionPolicy.d.ts +5 -0
- package/dist/runtime/execution/policies/runCompletionPolicy.d.ts.map +1 -0
- package/dist/runtime/execution/policies/runCompletionPolicy.js +30 -0
- package/dist/runtime/execution/policies/runCompletionPolicy.js.map +1 -0
- package/dist/runtime/execution/policies/runErrorPolicy.d.ts +7 -0
- package/dist/runtime/execution/policies/runErrorPolicy.d.ts.map +1 -0
- package/dist/runtime/execution/policies/runErrorPolicy.js +40 -0
- package/dist/runtime/execution/policies/runErrorPolicy.js.map +1 -0
- package/dist/runtime/execution/policies/runPromptBuilder.d.ts +10 -0
- package/dist/runtime/execution/policies/runPromptBuilder.d.ts.map +1 -0
- package/dist/runtime/execution/policies/runPromptBuilder.js +34 -0
- package/dist/runtime/execution/policies/runPromptBuilder.js.map +1 -0
- package/dist/runtime/execution/policies/runSummaryFormatter.d.ts +6 -0
- package/dist/runtime/execution/policies/runSummaryFormatter.d.ts.map +1 -0
- package/dist/runtime/execution/policies/runSummaryFormatter.js +47 -0
- package/dist/runtime/execution/policies/runSummaryFormatter.js.map +1 -0
- package/dist/runtime/execution/policies/runtimeDelay.d.ts +4 -0
- package/dist/runtime/execution/policies/runtimeDelay.d.ts.map +1 -0
- package/dist/runtime/execution/policies/runtimeDelay.js +6 -0
- package/dist/runtime/execution/policies/runtimeDelay.js.map +1 -0
- package/dist/runtime/execution/policies/toolConfigReader.d.ts +8 -0
- package/dist/runtime/execution/policies/toolConfigReader.d.ts.map +1 -0
- package/dist/runtime/execution/policies/toolConfigReader.js +91 -0
- package/dist/runtime/execution/policies/toolConfigReader.js.map +1 -0
- package/dist/runtime/human-loop/consoleHumanLoop.d.ts +21 -0
- package/dist/runtime/human-loop/consoleHumanLoop.d.ts.map +1 -0
- package/dist/runtime/human-loop/consoleHumanLoop.js +102 -0
- package/dist/runtime/human-loop/consoleHumanLoop.js.map +1 -0
- package/dist/runtime/human-loop/humanLoop.d.ts +44 -0
- package/dist/runtime/human-loop/humanLoop.d.ts.map +1 -0
- package/dist/runtime/human-loop/humanLoop.js +36 -0
- package/dist/runtime/human-loop/humanLoop.js.map +1 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +6 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/middleware/agentToolMiddleware.d.ts +30 -0
- package/dist/runtime/middleware/agentToolMiddleware.d.ts.map +1 -0
- package/dist/runtime/middleware/agentToolMiddleware.js +259 -0
- package/dist/runtime/middleware/agentToolMiddleware.js.map +1 -0
- package/dist/runtime/middleware/commandPolicy.d.ts +8 -0
- package/dist/runtime/middleware/commandPolicy.d.ts.map +1 -0
- package/dist/runtime/middleware/commandPolicy.js +55 -0
- package/dist/runtime/middleware/commandPolicy.js.map +1 -0
- package/dist/runtime/middleware/frameworkPrompt.d.ts +4 -0
- package/dist/runtime/middleware/frameworkPrompt.d.ts.map +1 -0
- package/dist/runtime/middleware/frameworkPrompt.js +44 -0
- package/dist/runtime/middleware/frameworkPrompt.js.map +1 -0
- package/dist/runtime/middleware/index.d.ts +4 -0
- package/dist/runtime/middleware/index.d.ts.map +1 -0
- package/dist/runtime/middleware/index.js +3 -0
- package/dist/runtime/middleware/index.js.map +1 -0
- package/dist/runtime/middleware/skillPathMap.d.ts +3 -0
- package/dist/runtime/middleware/skillPathMap.d.ts.map +1 -0
- package/dist/runtime/middleware/skillPathMap.js +44 -0
- package/dist/runtime/middleware/skillPathMap.js.map +1 -0
- package/dist/runtime/middleware/toolArgsNormalizer.d.ts +21 -0
- package/dist/runtime/middleware/toolArgsNormalizer.d.ts.map +1 -0
- package/dist/runtime/middleware/toolArgsNormalizer.js +227 -0
- package/dist/runtime/middleware/toolArgsNormalizer.js.map +1 -0
- package/dist/runtime/middleware/toolCallGuard.d.ts +8 -0
- package/dist/runtime/middleware/toolCallGuard.d.ts.map +1 -0
- package/dist/runtime/middleware/toolCallGuard.js +60 -0
- package/dist/runtime/middleware/toolCallGuard.js.map +1 -0
- package/dist/runtime/middleware/toolFsHandlers.d.ts +12 -0
- package/dist/runtime/middleware/toolFsHandlers.d.ts.map +1 -0
- package/dist/runtime/middleware/toolFsHandlers.js +79 -0
- package/dist/runtime/middleware/toolFsHandlers.js.map +1 -0
- package/dist/runtime/middleware/toolRequestParser.d.ts +14 -0
- package/dist/runtime/middleware/toolRequestParser.d.ts.map +1 -0
- package/dist/runtime/middleware/toolRequestParser.js +72 -0
- package/dist/runtime/middleware/toolRequestParser.js.map +1 -0
- package/dist/runtime/middleware/types.d.ts +87 -0
- package/dist/runtime/middleware/types.d.ts.map +1 -0
- package/dist/runtime/middleware/types.js +3 -0
- package/dist/runtime/middleware/types.js.map +1 -0
- package/dist/runtime/providers/backendResolver.d.ts +26 -0
- package/dist/runtime/providers/backendResolver.d.ts.map +1 -0
- package/dist/runtime/providers/backendResolver.js +73 -0
- package/dist/runtime/providers/backendResolver.js.map +1 -0
- package/dist/runtime/providers/index.d.ts +14 -0
- package/dist/runtime/providers/index.d.ts.map +1 -0
- package/dist/runtime/providers/index.js +10 -0
- package/dist/runtime/providers/index.js.map +1 -0
- package/dist/runtime/providers/langchainRuntime.d.ts +11 -0
- package/dist/runtime/providers/langchainRuntime.d.ts.map +1 -0
- package/dist/runtime/providers/langchainRuntime.js +45 -0
- package/dist/runtime/providers/langchainRuntime.js.map +1 -0
- package/dist/runtime/providers/localShellBackend.d.ts +10 -0
- package/dist/runtime/providers/localShellBackend.d.ts.map +1 -0
- package/dist/runtime/providers/localShellBackend.js +23 -0
- package/dist/runtime/providers/localShellBackend.js.map +1 -0
- package/dist/runtime/providers/openaiDeepAgent.d.ts +9 -0
- package/dist/runtime/providers/openaiDeepAgent.d.ts.map +1 -0
- package/dist/runtime/providers/openaiDeepAgent.js +7 -0
- package/dist/runtime/providers/openaiDeepAgent.js.map +1 -0
- package/dist/runtime/providers/openaiLocalAgent.d.ts +17 -0
- package/dist/runtime/providers/openaiLocalAgent.d.ts.map +1 -0
- package/dist/runtime/providers/openaiLocalAgent.js +26 -0
- package/dist/runtime/providers/openaiLocalAgent.js.map +1 -0
- package/dist/runtime/providers/openaiLocalAgentFactory.d.ts +36 -0
- package/dist/runtime/providers/openaiLocalAgentFactory.d.ts.map +1 -0
- package/dist/runtime/providers/openaiLocalAgentFactory.js +139 -0
- package/dist/runtime/providers/openaiLocalAgentFactory.js.map +1 -0
- package/dist/runtime/providers/shared/agentProbe.d.ts +4 -0
- package/dist/runtime/providers/shared/agentProbe.d.ts.map +1 -0
- package/dist/runtime/providers/shared/agentProbe.js +17 -0
- package/dist/runtime/providers/shared/agentProbe.js.map +1 -0
- package/dist/runtime/providers/shared/moduleFallback.d.ts +2 -0
- package/dist/runtime/providers/shared/moduleFallback.d.ts.map +1 -0
- package/dist/runtime/providers/shared/moduleFallback.js +34 -0
- package/dist/runtime/providers/shared/moduleFallback.js.map +1 -0
- package/dist/runtime/providers/shared/resourceCloser.d.ts +6 -0
- package/dist/runtime/providers/shared/resourceCloser.d.ts.map +1 -0
- package/dist/runtime/providers/shared/resourceCloser.js +30 -0
- package/dist/runtime/providers/shared/resourceCloser.js.map +1 -0
- package/dist/runtime/runtimeService.d.ts +109 -0
- package/dist/runtime/runtimeService.d.ts.map +1 -0
- package/dist/runtime/runtimeService.js +90 -0
- package/dist/runtime/runtimeService.js.map +1 -0
- package/dist/runtime/stream/agentMessages.d.ts +40 -0
- package/dist/runtime/stream/agentMessages.d.ts.map +1 -0
- package/dist/runtime/stream/agentMessages.js +44 -0
- package/dist/runtime/stream/agentMessages.js.map +1 -0
- package/dist/runtime/stream/agentStream.d.ts +31 -0
- package/dist/runtime/stream/agentStream.d.ts.map +1 -0
- package/dist/runtime/stream/agentStream.js +106 -0
- package/dist/runtime/stream/agentStream.js.map +1 -0
- package/dist/runtime/stream/messageSummary.d.ts +20 -0
- package/dist/runtime/stream/messageSummary.d.ts.map +1 -0
- package/dist/runtime/stream/messageSummary.js +150 -0
- package/dist/runtime/stream/messageSummary.js.map +1 -0
- package/dist/runtime/stream/runArtifacts.d.ts +9 -0
- package/dist/runtime/stream/runArtifacts.d.ts.map +1 -0
- package/dist/runtime/stream/runArtifacts.js +48 -0
- package/dist/runtime/stream/runArtifacts.js.map +1 -0
- package/dist/state/index.d.ts +7 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +4 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/runState.d.ts +36 -0
- package/dist/state/runState.d.ts.map +1 -0
- package/dist/state/runState.js +51 -0
- package/dist/state/runState.js.map +1 -0
- package/dist/state/todos.d.ts +19 -0
- package/dist/state/todos.d.ts.map +1 -0
- package/dist/state/todos.js +45 -0
- package/dist/state/todos.js.map +1 -0
- package/dist/state/workspaceRunSession.d.ts +32 -0
- package/dist/state/workspaceRunSession.d.ts.map +1 -0
- package/dist/state/workspaceRunSession.js +67 -0
- package/dist/state/workspaceRunSession.js.map +1 -0
- package/dist/state/workspaceState.d.ts +94 -0
- package/dist/state/workspaceState.d.ts.map +1 -0
- package/dist/state/workspaceState.js +119 -0
- package/dist/state/workspaceState.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/example/.tsbuildinfo +1 -0
- package/example/build/.tsbuildinfo +1 -0
- package/example/config/memory.yaml +35 -0
- package/example/config/model.yaml +14 -0
- package/example/config/runtime.yaml +46 -0
- package/example/config/tool.yaml +24 -0
- package/example/index.ts +159 -0
- package/example/package-lock.json +1396 -0
- package/example/package.json +26 -0
- package/example/serve-output.mjs +52 -0
- package/example/tsconfig.json +19 -0
- package/package.json +73 -0
- package/scripts/resolve-deps.js +40 -0
- package/src/config/index.ts +29 -0
- package/src/config/loader.ts +174 -0
- package/src/config/resolveRuntimeConfig.ts +160 -0
- package/src/config/resources.ts +152 -0
- package/src/config/runtimeConfigLoader.ts +68 -0
- package/src/external-modules.d.ts +20 -0
- package/src/index.ts +36 -0
- package/src/runtime/agentMiddleware.ts +6 -0
- package/src/runtime/bootstrap/runtimeFactory.ts +212 -0
- package/src/runtime/bootstrap/runtimeModuleInitializer.ts +34 -0
- package/src/runtime/context/agentContext.ts +24 -0
- package/src/runtime/context/globalContext.ts +70 -0
- package/src/runtime/events/eventPublisher.ts +45 -0
- package/src/runtime/execution/agentRunExecutor.ts +499 -0
- package/src/runtime/execution/agentRunExecutor.types.ts +39 -0
- package/src/runtime/execution/agentRunProgress.ts +67 -0
- package/src/runtime/execution/agentRunState.ts +66 -0
- package/src/runtime/execution/policies/runCompletionPolicy.ts +30 -0
- package/src/runtime/execution/policies/runErrorPolicy.ts +50 -0
- package/src/runtime/execution/policies/runPromptBuilder.ts +39 -0
- package/src/runtime/execution/policies/runSummaryFormatter.ts +57 -0
- package/src/runtime/execution/policies/runtimeDelay.ts +5 -0
- package/src/runtime/execution/policies/toolConfigReader.ts +107 -0
- package/src/runtime/human-loop/consoleHumanLoop.ts +113 -0
- package/src/runtime/human-loop/humanLoop.ts +90 -0
- package/src/runtime/index.ts +36 -0
- package/src/runtime/middleware/agentToolMiddleware.ts +329 -0
- package/src/runtime/middleware/commandPolicy.ts +65 -0
- package/src/runtime/middleware/frameworkPrompt.ts +51 -0
- package/src/runtime/middleware/index.ts +7 -0
- package/src/runtime/middleware/skillPathMap.ts +49 -0
- package/src/runtime/middleware/toolArgsNormalizer.ts +277 -0
- package/src/runtime/middleware/toolCallGuard.ts +73 -0
- package/src/runtime/middleware/toolFsHandlers.ts +94 -0
- package/src/runtime/middleware/toolRequestParser.ts +84 -0
- package/src/runtime/middleware/types.ts +91 -0
- package/src/runtime/providers/backendResolver.ts +127 -0
- package/src/runtime/providers/index.ts +19 -0
- package/src/runtime/providers/langchainRuntime.ts +67 -0
- package/src/runtime/providers/localShellBackend.ts +54 -0
- package/src/runtime/providers/openaiDeepAgent.ts +17 -0
- package/src/runtime/providers/openaiLocalAgent.ts +35 -0
- package/src/runtime/providers/openaiLocalAgentFactory.ts +185 -0
- package/src/runtime/providers/shared/agentProbe.ts +24 -0
- package/src/runtime/providers/shared/moduleFallback.ts +41 -0
- package/src/runtime/providers/shared/resourceCloser.ts +30 -0
- package/src/runtime/runtimeService.ts +205 -0
- package/src/runtime/stream/agentMessages.ts +72 -0
- package/src/runtime/stream/agentStream.ts +168 -0
- package/src/runtime/stream/messageSummary.ts +164 -0
- package/src/runtime/stream/runArtifacts.ts +72 -0
- package/src/state/index.ts +19 -0
- package/src/state/runState.ts +84 -0
- package/src/state/todos.ts +59 -0
- package/src/state/workspaceRunSession.ts +96 -0
- package/src/state/workspaceState.ts +199 -0
- package/src/types/easynet-agent-common.d.ts +62 -0
- package/src/types.ts +1 -0
- package/test/integration/runtime-live.integration.test.ts +30 -0
- package/test/unit/config/loader.test.ts +429 -0
- package/test/unit/runtime/agentContext.test.ts +23 -0
- package/test/unit/runtime/agentRuntime.test.ts +99 -0
- package/test/unit/runtime/consoleHumanLoop.test.ts +52 -0
- package/test/unit/runtime/events.test.ts +11 -0
- package/test/unit/runtime/globalContext.test.ts +34 -0
- package/test/unit/runtime/humanLoop.test.ts +104 -0
- package/test/unit/runtime/toolArgsNormalizer.test.ts +136 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map loaded K8s-style configs to options suitable for deepagents (createDeepAgent).
|
|
3
|
+
* Supports MemoryConfig, SkillsConfig, and AgentRuntimeConfig; memory shape is exposed for app use
|
|
4
|
+
* until deepagents exposes a matching memory API.
|
|
5
|
+
*/
|
|
6
|
+
import { isAgentRuntimeConfig, isMemoryConfig } from "./resources.js";
|
|
7
|
+
const DEFAULT_OBSERVABILITY = { trace: false };
|
|
8
|
+
const DEFAULT_PRIVACY = { forbiddenMetadataKeys: [] };
|
|
9
|
+
/**
|
|
10
|
+
* Reduce an array of loaded resources into a single ResolvedAgentConfig.
|
|
11
|
+
* - SkillsConfig: parsed for compatibility, but skill roots are resolved outside this module.
|
|
12
|
+
* - MemoryConfig: first one wins (by name order or array order); optional merge strategy could be added.
|
|
13
|
+
*/
|
|
14
|
+
export function resolveAgentConfig(resources) {
|
|
15
|
+
let skills = [];
|
|
16
|
+
let memory = null;
|
|
17
|
+
let observability = DEFAULT_OBSERVABILITY;
|
|
18
|
+
let privacy = DEFAULT_PRIVACY;
|
|
19
|
+
let runtime = {};
|
|
20
|
+
for (const r of resources) {
|
|
21
|
+
if (isMemoryConfig(r)) {
|
|
22
|
+
if (!memory) {
|
|
23
|
+
memory = {
|
|
24
|
+
thread: resolveStore(r.spec.memory.thread),
|
|
25
|
+
cross_thread: resolveStore(r.spec.memory.cross_thread),
|
|
26
|
+
knowledge: resolveStore(r.spec.memory.knowledge),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
if (r.spec.observability) {
|
|
30
|
+
observability = { trace: r.spec.observability.trace ?? false };
|
|
31
|
+
}
|
|
32
|
+
if (r.spec.privacy?.forbiddenMetadataKeys) {
|
|
33
|
+
privacy = { forbiddenMetadataKeys: [...r.spec.privacy.forbiddenMetadataKeys] };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (isAgentRuntimeConfig(r)) {
|
|
37
|
+
runtime = resolveRuntime(r.spec);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
skills,
|
|
42
|
+
memory,
|
|
43
|
+
observability,
|
|
44
|
+
privacy,
|
|
45
|
+
runtime,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function resolveStore(s) {
|
|
49
|
+
return {
|
|
50
|
+
store: { type: s.store.type, options: s.store.options },
|
|
51
|
+
allowWrite: s.allowWrite,
|
|
52
|
+
maxItems: s.maxItems,
|
|
53
|
+
sessionCompaction: s.sessionCompaction,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function resolveRuntime(s) {
|
|
57
|
+
return {
|
|
58
|
+
artifacts: s.artifacts,
|
|
59
|
+
stateDirName: s.stateDirName,
|
|
60
|
+
legacyOutputState: s.legacyOutputState,
|
|
61
|
+
executeTimeoutMs: s.executeTimeoutMs,
|
|
62
|
+
blockTaskTool: s.blockTaskTool,
|
|
63
|
+
systemPrompt: s.systemPrompt,
|
|
64
|
+
llmIdleTimeoutMs: s.llmIdleTimeoutMs,
|
|
65
|
+
backend: s.backend,
|
|
66
|
+
incompleteRunMaxRetries: s.incompleteRunMaxRetries,
|
|
67
|
+
emptyRunMaxRetries: s.emptyRunMaxRetries,
|
|
68
|
+
malformedToolCallMaxRetries: s.malformedToolCallMaxRetries,
|
|
69
|
+
idleTimeoutMaxRetries: s.idleTimeoutMaxRetries,
|
|
70
|
+
heartbeatIntervalMs: s.heartbeatIntervalMs,
|
|
71
|
+
debug: s.debug,
|
|
72
|
+
eventLogLevel: s.eventLogLevel,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Build options object for createDeepAgent from resolved config.
|
|
77
|
+
* Pass skills; use resolvedAgentConfig.memory / observability / privacy in your app as needed.
|
|
78
|
+
*/
|
|
79
|
+
export function buildDeepAgentOptions(resolved) {
|
|
80
|
+
return {
|
|
81
|
+
skills: resolved.skills.length > 0 ? resolved.skills : [],
|
|
82
|
+
_resolved: resolved,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=resolveRuntimeConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRuntimeConfig.js","sourceRoot":"","sources":["../../src/config/resolveRuntimeConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA4DtE,MAAM,qBAAqB,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC/C,MAAM,eAAe,GAAG,EAAE,qBAAqB,EAAE,EAAc,EAAE,CAAC;AAElE;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAA0B;IAC3D,IAAI,MAAM,GAAa,EAAE,CAAC;IAC1B,IAAI,MAAM,GAAgC,IAAI,CAAC;IAC/C,IAAI,aAAa,GAAG,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C,CAAC,KAAK,CAAC,OAAO,EAAE;QACvD,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,iBAAiB,EAAE,CAAC,CAAC,iBAAiB;KACvC,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,CAAqC;IAC3D,OAAO;QACL,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,iBAAiB,EAAE,CAAC,CAAC,iBAAiB;QACtC,gBAAgB,EAAE,CAAC,CAAC,gBAAgB;QACpC,aAAa,EAAE,CAAC,CAAC,aAAa;QAC9B,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,gBAAgB,EAAE,CAAC,CAAC,gBAAgB;QACpC,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,uBAAuB,EAAE,CAAC,CAAC,uBAAuB;QAClD,kBAAkB,EAAE,CAAC,CAAC,kBAAkB;QACxC,2BAA2B,EAAE,CAAC,CAAC,2BAA2B;QAC1D,qBAAqB,EAAE,CAAC,CAAC,qBAAqB;QAC9C,mBAAmB,EAAE,CAAC,CAAC,mBAAmB;QAC1C,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,aAAa,EAAE,CAAC,CAAC,aAAa;KAC/B,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAA6B;IAKjE,OAAO;QACL,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;QACzD,SAAS,EAAE,QAAQ;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* K8s-style resource base: apiVersion, kind, metadata, spec.
|
|
3
|
+
* Used for MemoryConfig, SkillsConfig, and future resource kinds.
|
|
4
|
+
*/
|
|
5
|
+
export declare const API_GROUP = "botbotgo.world";
|
|
6
|
+
export declare const API_VERSION = "v1";
|
|
7
|
+
export declare const API_VERSION_FULL = "botbotgo.world/v1";
|
|
8
|
+
/** Standard metadata for all resources */
|
|
9
|
+
export interface ObjectMeta {
|
|
10
|
+
name: string;
|
|
11
|
+
/** Optional labels (e.g. for filtering) */
|
|
12
|
+
labels?: Record<string, string>;
|
|
13
|
+
/** Optional annotations */
|
|
14
|
+
annotations?: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
/** Base resource: apiVersion, kind, metadata, spec */
|
|
17
|
+
export interface Resource<TKind extends string = string, TSpec = unknown> {
|
|
18
|
+
apiVersion: string;
|
|
19
|
+
kind: TKind;
|
|
20
|
+
metadata: ObjectMeta;
|
|
21
|
+
spec: TSpec;
|
|
22
|
+
}
|
|
23
|
+
export interface StoreSpec {
|
|
24
|
+
type: "in_memory" | string;
|
|
25
|
+
/** Backend-specific options (e.g. path for file store) */
|
|
26
|
+
options?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
export interface SessionCompactionSpec {
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
maxTokens: number;
|
|
31
|
+
keepRecentTurns: number;
|
|
32
|
+
summaryKey: string;
|
|
33
|
+
checkEveryTurns: number;
|
|
34
|
+
}
|
|
35
|
+
export interface MemoryStoreSpec {
|
|
36
|
+
store: StoreSpec;
|
|
37
|
+
allowWrite: boolean;
|
|
38
|
+
maxItems: number;
|
|
39
|
+
sessionCompaction?: SessionCompactionSpec;
|
|
40
|
+
}
|
|
41
|
+
export interface MemorySpec {
|
|
42
|
+
thread: MemoryStoreSpec;
|
|
43
|
+
cross_thread: MemoryStoreSpec;
|
|
44
|
+
knowledge: MemoryStoreSpec;
|
|
45
|
+
}
|
|
46
|
+
export interface ObservabilitySpec {
|
|
47
|
+
trace: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface PrivacySpec {
|
|
50
|
+
forbiddenMetadataKeys: string[];
|
|
51
|
+
}
|
|
52
|
+
export interface MemoryConfigSpec {
|
|
53
|
+
memory: MemorySpec;
|
|
54
|
+
observability?: ObservabilitySpec;
|
|
55
|
+
privacy?: PrivacySpec;
|
|
56
|
+
}
|
|
57
|
+
export type MemoryConfigResource = Resource<"MemoryConfig", MemoryConfigSpec>;
|
|
58
|
+
export interface SkillsConfigSpec {
|
|
59
|
+
/** Optional cache directory for downloaded remote skills. */
|
|
60
|
+
cacheDir?: string;
|
|
61
|
+
/** Unified skill sources: local paths, GitHub Releases, or JFrog descriptors. */
|
|
62
|
+
skills: Record<string, Record<string, unknown>>;
|
|
63
|
+
/** Optional: which agent name this config applies to (for multi-agent setups) */
|
|
64
|
+
agent?: string;
|
|
65
|
+
}
|
|
66
|
+
export type SkillsConfigResource = Resource<"SkillsConfig", SkillsConfigSpec>;
|
|
67
|
+
export interface AgentBackendConfigSpec {
|
|
68
|
+
type?: "local_shell" | "deepagents_export" | "module_export";
|
|
69
|
+
exportName?: string;
|
|
70
|
+
module?: string;
|
|
71
|
+
createMethod?: string;
|
|
72
|
+
options?: Record<string, unknown>;
|
|
73
|
+
inheritEnv?: boolean;
|
|
74
|
+
timeoutMs?: number;
|
|
75
|
+
maxOutputBytes?: number;
|
|
76
|
+
}
|
|
77
|
+
export interface AgentRuntimeConfigSpec {
|
|
78
|
+
artifacts?: Array<{
|
|
79
|
+
key: string;
|
|
80
|
+
path: string;
|
|
81
|
+
}>;
|
|
82
|
+
stateDirName?: string;
|
|
83
|
+
legacyOutputState?: boolean;
|
|
84
|
+
executeTimeoutMs?: number;
|
|
85
|
+
blockTaskTool?: boolean;
|
|
86
|
+
systemPrompt?: string;
|
|
87
|
+
llmIdleTimeoutMs?: number;
|
|
88
|
+
backend?: AgentBackendConfigSpec;
|
|
89
|
+
incompleteRunMaxRetries?: number;
|
|
90
|
+
emptyRunMaxRetries?: number;
|
|
91
|
+
malformedToolCallMaxRetries?: number;
|
|
92
|
+
idleTimeoutMaxRetries?: number;
|
|
93
|
+
heartbeatIntervalMs?: number;
|
|
94
|
+
debug?: {
|
|
95
|
+
run?: boolean;
|
|
96
|
+
workspace?: boolean;
|
|
97
|
+
toolCall?: boolean;
|
|
98
|
+
stream?: boolean;
|
|
99
|
+
close?: boolean;
|
|
100
|
+
};
|
|
101
|
+
eventLogLevel?: "silent" | "lifecycle" | "tools" | "verbose";
|
|
102
|
+
}
|
|
103
|
+
export type AgentRuntimeConfigResource = Resource<"AgentRuntimeConfig", AgentRuntimeConfigSpec>;
|
|
104
|
+
export type KnownResource = MemoryConfigResource | SkillsConfigResource | AgentRuntimeConfigResource;
|
|
105
|
+
export type KnownKind = KnownResource["kind"];
|
|
106
|
+
/** Type guard: resource is MemoryConfig */
|
|
107
|
+
export declare function isMemoryConfig(r: Resource<string, unknown>): r is MemoryConfigResource;
|
|
108
|
+
/** Type guard: resource is SkillsConfig */
|
|
109
|
+
export declare function isSkillsConfig(r: Resource<string, unknown>): r is SkillsConfigResource;
|
|
110
|
+
/** Type guard: resource is AgentRuntimeConfig */
|
|
111
|
+
export declare function isAgentRuntimeConfig(r: Resource<string, unknown>): r is AgentRuntimeConfigResource;
|
|
112
|
+
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../src/config/resources.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,SAAS,mBAAmB,CAAC;AAC1C,eAAO,MAAM,WAAW,OAAO,CAAC;AAChC,eAAO,MAAM,gBAAgB,sBAAgC,CAAC;AAE9D,0CAA0C;AAC1C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,sDAAsD;AACtD,MAAM,WAAW,QAAQ,CA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C,EAAE;QACN,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,CAAC;IACF,aAAa,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC;CAC9D;AAED,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;AAIhG,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAAG,oBAAoB,GAAG,0BAA0B,CAAC;AAErG,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAE9C,2CAA2C;AAC3C,wBAAgB,cAAc,CAC5B,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,CAAC,IAAI,oBAAoB,CAE3B;AAED,2CAA2C;AAC3C,wBAAgB,cAAc,CAC5B,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,CAAC,IAAI,oBAAoB,CAE3B;AAED,iDAAiD;AACjD,wBAAgB,oBAAoB,CAClC,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,CAAC,IAAI,0BAA0B,CAEjC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* K8s-style resource base: apiVersion, kind, metadata, spec.
|
|
3
|
+
* Used for MemoryConfig, SkillsConfig, and future resource kinds.
|
|
4
|
+
*/
|
|
5
|
+
export const API_GROUP = "botbotgo.world";
|
|
6
|
+
export const API_VERSION = "v1";
|
|
7
|
+
export const API_VERSION_FULL = `${API_GROUP}/${API_VERSION}`;
|
|
8
|
+
/** Type guard: resource is MemoryConfig */
|
|
9
|
+
export function isMemoryConfig(r) {
|
|
10
|
+
return r.kind === "MemoryConfig";
|
|
11
|
+
}
|
|
12
|
+
/** Type guard: resource is SkillsConfig */
|
|
13
|
+
export function isSkillsConfig(r) {
|
|
14
|
+
return r.kind === "SkillsConfig";
|
|
15
|
+
}
|
|
16
|
+
/** Type guard: resource is AgentRuntimeConfig */
|
|
17
|
+
export function isAgentRuntimeConfig(r) {
|
|
18
|
+
return r.kind === "AgentRuntimeConfig";
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/config/resources.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAC1C,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;AAChC,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,SAAS,IAAI,WAAW,EAAE,CAAC;AA6H9D,2CAA2C;AAC3C,MAAM,UAAU,cAAc,CAC5B,CAA4B;IAE5B,OAAO,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC;AACnC,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,cAAc,CAC5B,CAA4B;IAE5B,OAAO,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC;AACnC,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,oBAAoB,CAClC,CAA4B;IAE5B,OAAO,CAAC,CAAC,IAAI,KAAK,oBAAoB,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level API for agent-runtime2 config loading: aggregate YAML resources into
|
|
3
|
+
* runtime, memory, observability, and privacy settings. Skill root resolution
|
|
4
|
+
* lives in @botbotgo/kit and is intentionally kept separate.
|
|
5
|
+
*/
|
|
6
|
+
import { type ResolvedAgentConfig } from "./resolveRuntimeConfig.js";
|
|
7
|
+
import { type KnownResource } from "./resources.js";
|
|
8
|
+
export interface LoadAgentRuntimeConfigOptions {
|
|
9
|
+
/** Load a single YAML config file */
|
|
10
|
+
configPath?: string;
|
|
11
|
+
/** Load all YAML resources from this directory */
|
|
12
|
+
configDir?: string;
|
|
13
|
+
/** Pre-loaded resources (skip file loading) */
|
|
14
|
+
resources?: KnownResource[];
|
|
15
|
+
/** If true, skip invalid documents when loading from directory (default: true) */
|
|
16
|
+
ignoreInvalid?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface AgentRuntimeConfigResult {
|
|
19
|
+
resolved: ResolvedAgentConfig;
|
|
20
|
+
}
|
|
21
|
+
export declare class AgentRuntimeConfigService implements AgentRuntimeConfigResult {
|
|
22
|
+
readonly resolved: ResolvedAgentConfig;
|
|
23
|
+
private constructor();
|
|
24
|
+
static create(options: LoadAgentRuntimeConfigOptions): Promise<AgentRuntimeConfigService>;
|
|
25
|
+
private static loadResources;
|
|
26
|
+
}
|
|
27
|
+
export declare function loadAgentRuntimeConfig(options: LoadAgentRuntimeConfigOptions): Promise<AgentRuntimeConfigResult>;
|
|
28
|
+
//# sourceMappingURL=runtimeConfigLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeConfigLoader.d.ts","sourceRoot":"","sources":["../../src/config/runtimeConfigLoader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,WAAW,6BAA6B;IAC5C,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAC5B,kFAAkF;IAClF,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAED,qBAAa,yBAA0B,YAAW,wBAAwB;IACxE,SAAgB,QAAQ,EAAE,mBAAmB,CAAC;IAE9C,OAAO;WAIa,MAAM,CACxB,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,yBAAyB,CAAC;mBAMhB,aAAa;CAqBnC;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,wBAAwB,CAAC,CAEnC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level API for agent-runtime2 config loading: aggregate YAML resources into
|
|
3
|
+
* runtime, memory, observability, and privacy settings. Skill root resolution
|
|
4
|
+
* lives in @botbotgo/kit and is intentionally kept separate.
|
|
5
|
+
*/
|
|
6
|
+
import { loadFromFile, loadFromDirectory } from "./loader.js";
|
|
7
|
+
import { resolveAgentConfig } from "./resolveRuntimeConfig.js";
|
|
8
|
+
export class AgentRuntimeConfigService {
|
|
9
|
+
resolved;
|
|
10
|
+
constructor(resolved) {
|
|
11
|
+
this.resolved = resolved;
|
|
12
|
+
}
|
|
13
|
+
static async create(options) {
|
|
14
|
+
const resources = await AgentRuntimeConfigService.loadResources(options);
|
|
15
|
+
const resolved = resolveAgentConfig(resources);
|
|
16
|
+
return new AgentRuntimeConfigService(resolved);
|
|
17
|
+
}
|
|
18
|
+
static async loadResources(options) {
|
|
19
|
+
if (options.resources) {
|
|
20
|
+
return options.resources;
|
|
21
|
+
}
|
|
22
|
+
if (options.configDir) {
|
|
23
|
+
const raw = await loadFromDirectory(options.configDir, {
|
|
24
|
+
ignoreInvalid: options.ignoreInvalid ?? true,
|
|
25
|
+
});
|
|
26
|
+
return raw;
|
|
27
|
+
}
|
|
28
|
+
if (options.configPath) {
|
|
29
|
+
const single = await loadFromFile(options.configPath);
|
|
30
|
+
return [single];
|
|
31
|
+
}
|
|
32
|
+
throw new Error("loadAgentRuntimeConfig: provide one of configPath, configDir, or resources");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export async function loadAgentRuntimeConfig(options) {
|
|
36
|
+
return AgentRuntimeConfigService.create(options);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=runtimeConfigLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeConfigLoader.js","sourceRoot":"","sources":["../../src/config/runtimeConfigLoader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAA4B,MAAM,2BAA2B,CAAC;AAkBzF,MAAM,OAAO,yBAAyB;IACpB,QAAQ,CAAsB;IAE9C,YAAoB,QAA6B;QAC/C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,MAAM,CACxB,OAAsC;QAEtC,MAAM,SAAS,GAAG,MAAM,yBAAyB,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACzE,MAAM,QAAQ,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAC/C,OAAO,IAAI,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,OAAsC;QACvE,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACtB,OAAO,OAAO,CAAC,SAAS,CAAC;QAC3B,CAAC;QAED,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACtB,MAAM,GAAG,GAAG,MAAM,iBAAiB,CAAC,OAAO,CAAC,SAAS,EAAE;gBACrD,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,IAAI;aAC7C,CAAC,CAAC;YACH,OAAO,GAAsB,CAAC;QAChC,CAAC;QAED,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YACtD,OAAO,CAAC,MAAuB,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;IACJ,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAsC;IAEtC,OAAO,yBAAyB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACnD,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { AgentRuntimeService, createAgentRuntime2, initializeAgentRuntimeModules, } from "./runtime/index.js";
|
|
2
|
+
export type { ResolvedAgentRuntimeConfig } from "./config/index.js";
|
|
3
|
+
export type { CreateAgentRuntimeFrameworkOptions, HumanLoopDecision, HumanLoopRequest, HumanLoopService, HumanLoopToolCallContext, HumanLoopToolPolicy, } from "./runtime/index.js";
|
|
4
|
+
export { ConsoleHumanLoopService, createDefaultHumanLoopToolPolicy, } from "./runtime/index.js";
|
|
5
|
+
export { createRuntime2TreeEventListener } from "@botbotgo/common";
|
|
6
|
+
export type { Runtime2EventDebugConfig, Runtime2EventRuntimeConfig, Runtime2TreeEventListenerOptions, } from "@botbotgo/common";
|
|
7
|
+
export { clearAgentRuntimeGlobalContext, getAgentRuntimeGlobal, getAgentRuntimeGlobalContext, getOrRegisterAgentRuntimeGlobal, registerAgentRuntimeGlobal, requireAgentRuntimeChatModel, requireAgentRuntimeContextValue, requireAgentRuntimeMemory, requireAgentRuntimeTools, } from "./runtime/index.js";
|
|
8
|
+
export type { AgentRuntimeGlobalContext } from "./runtime/index.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACpE,YAAY,EACV,kCAAkC,EAClC,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,uBAAuB,EACvB,gCAAgC,GACjC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,+BAA+B,EAAE,MAAM,kBAAkB,CAAC;AACnE,YAAY,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,EACrB,4BAA4B,EAC5B,+BAA+B,EAC/B,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { AgentRuntimeService, createAgentRuntime2, initializeAgentRuntimeModules, } from "./runtime/index.js";
|
|
2
|
+
export { ConsoleHumanLoopService, createDefaultHumanLoopToolPolicy, } from "./runtime/index.js";
|
|
3
|
+
export { createRuntime2TreeEventListener } from "@botbotgo/common";
|
|
4
|
+
export { clearAgentRuntimeGlobalContext, getAgentRuntimeGlobal, getAgentRuntimeGlobalContext, getOrRegisterAgentRuntimeGlobal, registerAgentRuntimeGlobal, requireAgentRuntimeChatModel, requireAgentRuntimeContextValue, requireAgentRuntimeMemory, requireAgentRuntimeTools, } from "./runtime/index.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAU5B,OAAO,EACL,uBAAuB,EACvB,gCAAgC,GACjC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,+BAA+B,EAAE,MAAM,kBAAkB,CAAC;AAMnE,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,EACrB,4BAA4B,EAC5B,+BAA+B,EAC/B,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentMiddleware.d.ts","sourceRoot":"","sources":["../../src/runtime/agentMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,YAAY,EACV,gCAAgC,EAChC,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentMiddleware.js","sourceRoot":"","sources":["../../src/runtime/agentMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AgentRuntimeService, type CreateAgentRuntimeOptions } from "../runtimeService.js";
|
|
2
|
+
export declare class AgentRuntimeFactory {
|
|
3
|
+
static create(options: CreateAgentRuntimeOptions): Promise<AgentRuntimeService>;
|
|
4
|
+
private static createWorkspace;
|
|
5
|
+
private static createMiddleware;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=runtimeFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeFactory.d.ts","sourceRoot":"","sources":["../../../src/runtime/bootstrap/runtimeFactory.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mBAAmB,EAAE,KAAK,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAG3F,qBAAa,mBAAmB;WACV,MAAM,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAwD5F,OAAO,CAAC,MAAM,CAAC,eAAe;IAgB9B,OAAO,CAAC,MAAM,CAAC,gBAAgB;CA0BhC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { resolveAgentSkillRootsFromToolConfig } from "@botbotgo/kit";
|
|
3
|
+
import { AgentToolMiddlewareFactory } from "../middleware/index.js";
|
|
4
|
+
import { ToolConfigReader } from "../execution/policies/toolConfigReader.js";
|
|
5
|
+
import { createAgentWorkspaceState, } from "../../state/workspaceState.js";
|
|
6
|
+
import { OpenAILocalAgentService, LangchainRuntimeBindingsResolver, } from "../providers/index.js";
|
|
7
|
+
import { loadAgentRuntimeConfig } from "../../config/runtimeConfigLoader.js";
|
|
8
|
+
import { AgentRuntimeEventPublisher } from "../events/eventPublisher.js";
|
|
9
|
+
import { AgentRuntimeService } from "../runtimeService.js";
|
|
10
|
+
import { createDefaultHumanLoopToolPolicy } from "../human-loop/humanLoop.js";
|
|
11
|
+
export class AgentRuntimeFactory {
|
|
12
|
+
static async create(options) {
|
|
13
|
+
const runtimeOptions = new RuntimeOptionsResolver(options);
|
|
14
|
+
const toolConfigPath = runtimeOptions.resolveToolConfigPath();
|
|
15
|
+
const { resolved } = await loadAgentRuntimeConfig({
|
|
16
|
+
configDir: runtimeOptions.configDir,
|
|
17
|
+
ignoreInvalid: true,
|
|
18
|
+
});
|
|
19
|
+
const skillRoots = resolveAgentSkillRootsFromToolConfig({ configFilePath: toolConfigPath });
|
|
20
|
+
const runtimeConfig = resolved.runtime;
|
|
21
|
+
const runtimeDeps = runtimeOptions.resolve(runtimeConfig);
|
|
22
|
+
const { createMiddleware, ToolMessage } = LangchainRuntimeBindingsResolver.resolve(runtimeOptions.rootDir);
|
|
23
|
+
const events = new AgentRuntimeEventPublisher(runtimeOptions.eventBus);
|
|
24
|
+
const workspace = this.createWorkspace(runtimeOptions.rootDir, runtimeDeps, events, runtimeOptions.todosLogger);
|
|
25
|
+
const middleware = this.createMiddleware(runtimeOptions.rootDir, skillRoots, runtimeDeps, events, workspace, createMiddleware, ToolMessage);
|
|
26
|
+
const runtimeAgent = await OpenAILocalAgentService.create({
|
|
27
|
+
rootDir: runtimeOptions.rootDir,
|
|
28
|
+
configDir: runtimeOptions.configDir,
|
|
29
|
+
toolConfigPath: runtimeDeps.toolConfigPath,
|
|
30
|
+
allowedToolNames: runtimeDeps.allowedToolNames,
|
|
31
|
+
modelConfigPath: runtimeDeps.modelConfigPath,
|
|
32
|
+
modelCheckConnectivity: runtimeDeps.modelCheckConnectivity,
|
|
33
|
+
model: runtimeDeps.model,
|
|
34
|
+
systemPrompt: runtimeDeps.systemPrompt,
|
|
35
|
+
temperature: runtimeDeps.temperature,
|
|
36
|
+
maxTokens: runtimeDeps.maxTokens,
|
|
37
|
+
backend: runtimeDeps.backend,
|
|
38
|
+
middleware: [middleware],
|
|
39
|
+
logger: runtimeOptions.runLogger,
|
|
40
|
+
});
|
|
41
|
+
return new AgentRuntimeService({
|
|
42
|
+
rootDir: runtimeOptions.rootDir,
|
|
43
|
+
runLogger: runtimeOptions.runLogger,
|
|
44
|
+
events,
|
|
45
|
+
runtimeConfig,
|
|
46
|
+
middleware,
|
|
47
|
+
workspace,
|
|
48
|
+
runtimeAgent,
|
|
49
|
+
defaultIncompleteRunMaxRetries: runtimeDeps.defaultIncompleteRunMaxRetries,
|
|
50
|
+
defaultEmptyRunMaxRetries: runtimeDeps.defaultEmptyRunMaxRetries,
|
|
51
|
+
defaultMalformedToolCallMaxRetries: runtimeDeps.defaultMalformedToolCallMaxRetries,
|
|
52
|
+
defaultIdleTimeoutMaxRetries: runtimeDeps.defaultIdleTimeoutMaxRetries,
|
|
53
|
+
defaultHeartbeatIntervalMs: runtimeDeps.defaultHeartbeatIntervalMs,
|
|
54
|
+
defaultIdleTimeoutMs: runtimeDeps.defaultIdleTimeoutMs,
|
|
55
|
+
artifactValidator: runtimeDeps.artifactValidator,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
static createWorkspace(rootDir, runtimeDeps, events, todosLogger) {
|
|
59
|
+
return createAgentWorkspaceState({
|
|
60
|
+
rootDir,
|
|
61
|
+
artifacts: runtimeDeps.artifacts,
|
|
62
|
+
stateDirName: runtimeDeps.stateDirName,
|
|
63
|
+
legacyOutputState: runtimeDeps.legacyOutputState,
|
|
64
|
+
todosLogger,
|
|
65
|
+
events,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
static createMiddleware(rootDir, skillRoots, runtimeDeps, events, workspace, createMiddleware, ToolMessage) {
|
|
69
|
+
return new AgentToolMiddlewareFactory({
|
|
70
|
+
rootDir,
|
|
71
|
+
skillRoots,
|
|
72
|
+
createMiddleware,
|
|
73
|
+
ToolMessage,
|
|
74
|
+
events,
|
|
75
|
+
executeTimeoutMs: runtimeDeps.executeTimeoutMs,
|
|
76
|
+
blockTaskTool: runtimeDeps.blockTaskTool,
|
|
77
|
+
allowedToolNames: runtimeDeps.allowedToolNames,
|
|
78
|
+
logger: runtimeDeps.logger,
|
|
79
|
+
persistTodos: workspace.persistTodos.bind(workspace),
|
|
80
|
+
humanLoop: runtimeDeps.humanLoop,
|
|
81
|
+
humanLoopToolPolicy: runtimeDeps.humanLoopToolPolicy,
|
|
82
|
+
beforeToolCall: runtimeDeps.beforeToolCall,
|
|
83
|
+
afterToolCall: runtimeDeps.afterToolCall,
|
|
84
|
+
}).create();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
class RuntimeOptionsResolver {
|
|
88
|
+
rootDir;
|
|
89
|
+
configDir;
|
|
90
|
+
eventBus;
|
|
91
|
+
todosLogger;
|
|
92
|
+
runLogger;
|
|
93
|
+
options;
|
|
94
|
+
constructor(options) {
|
|
95
|
+
this.options = options;
|
|
96
|
+
this.rootDir = options.rootDir;
|
|
97
|
+
this.configDir = options.configDir ?? resolve(options.rootDir, "config");
|
|
98
|
+
this.eventBus = options.eventBus;
|
|
99
|
+
this.todosLogger = options.todosLogger;
|
|
100
|
+
this.runLogger = options.runLogger ?? (() => { });
|
|
101
|
+
}
|
|
102
|
+
resolve(runtimeConfig) {
|
|
103
|
+
const toolConfigPath = this.resolveToolConfigPath();
|
|
104
|
+
return {
|
|
105
|
+
artifacts: this.options.artifacts ?? runtimeConfig.artifacts,
|
|
106
|
+
stateDirName: this.options.stateDirName ?? runtimeConfig.stateDirName,
|
|
107
|
+
legacyOutputState: this.options.legacyOutputState ?? runtimeConfig.legacyOutputState,
|
|
108
|
+
executeTimeoutMs: this.options.executeTimeoutMs ?? runtimeConfig.executeTimeoutMs,
|
|
109
|
+
blockTaskTool: this.options.blockTaskTool ?? runtimeConfig.blockTaskTool,
|
|
110
|
+
systemPrompt: this.options.systemPrompt ?? runtimeConfig.systemPrompt,
|
|
111
|
+
toolConfigPath,
|
|
112
|
+
allowedToolNames: ToolConfigReader.readAllowedToolNames(toolConfigPath),
|
|
113
|
+
modelConfigPath: this.options.modelConfigPath ?? resolve(this.configDir, "model.yaml"),
|
|
114
|
+
modelCheckConnectivity: this.options.modelCheckConnectivity ?? false,
|
|
115
|
+
model: this.options.model,
|
|
116
|
+
temperature: this.options.temperature,
|
|
117
|
+
maxTokens: this.options.maxTokens,
|
|
118
|
+
backend: this.options.backend ?? runtimeConfig.backend,
|
|
119
|
+
logger: this.options.logger,
|
|
120
|
+
humanLoop: this.options.humanLoop,
|
|
121
|
+
humanLoopToolPolicy: this.options.humanLoop
|
|
122
|
+
? (this.options.humanLoopToolPolicy ?? createDefaultHumanLoopToolPolicy())
|
|
123
|
+
: this.options.humanLoopToolPolicy,
|
|
124
|
+
beforeToolCall: this.options.beforeToolCall,
|
|
125
|
+
afterToolCall: this.options.afterToolCall,
|
|
126
|
+
artifactValidator: this.options.artifactValidator,
|
|
127
|
+
defaultIncompleteRunMaxRetries: this.options.incompleteRunMaxRetries ?? runtimeConfig.incompleteRunMaxRetries,
|
|
128
|
+
defaultEmptyRunMaxRetries: this.options.emptyRunMaxRetries ?? runtimeConfig.emptyRunMaxRetries,
|
|
129
|
+
defaultMalformedToolCallMaxRetries: this.options.malformedToolCallMaxRetries ?? runtimeConfig.malformedToolCallMaxRetries,
|
|
130
|
+
defaultIdleTimeoutMaxRetries: this.options.idleTimeoutMaxRetries ?? runtimeConfig.idleTimeoutMaxRetries,
|
|
131
|
+
defaultHeartbeatIntervalMs: this.options.heartbeatIntervalMs ?? runtimeConfig.heartbeatIntervalMs,
|
|
132
|
+
defaultIdleTimeoutMs: this.options.idleTimeoutMs ?? runtimeConfig.llmIdleTimeoutMs,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
resolveToolConfigPath() {
|
|
136
|
+
return this.options.toolConfigPath ?? resolve(this.configDir, "tool.yaml");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=runtimeFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeFactory.js","sourceRoot":"","sources":["../../../src/runtime/bootstrap/runtimeFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAyC,MAAM,wBAAwB,CAAC;AAC3G,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EACL,yBAAyB,GAG1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,uBAAuB,EACvB,gCAAgC,GAEjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAsB,MAAM,6BAA6B,CAAC;AAE7F,OAAO,EAAE,mBAAmB,EAAkC,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAE9E,MAAM,OAAO,mBAAm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C,iBAAiB;YACjD,8BAA8B,EAC5B,IAAI,CAAC,OAAO,CAAC,uBAAuB,IAAI,aAAa,CAAC,uBAAuB;YAC/E,yBAAyB,EACvB,IAAI,CAAC,OAAO,CAAC,kBAAkB,IAAI,aAAa,CAAC,kBAAkB;YACrE,kCAAkC,EAChC,IAAI,CAAC,OAAO,CAAC,2BAA2B,IAAI,aAAa,CAAC,2BAA2B;YACvF,4BAA4B,EAC1B,IAAI,CAAC,OAAO,CAAC,qBAAqB,IAAI,aAAa,CAAC,qBAAqB;YAC3E,0BAA0B,EACxB,IAAI,CAAC,OAAO,CAAC,mBAAmB,IAAI,aAAa,CAAC,mBAAmB;YACvE,oBAAoB,EAClB,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,aAAa,CAAC,gBAAgB;SAC/D,CAAC;IACJ,CAAC;IAEM,qBAAqB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC7E,CAAC;CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CreateAgentRuntimeFrameworkOptions } from "../runtimeService.js";
|
|
2
|
+
export declare class AgentRuntimeModuleInitializer {
|
|
3
|
+
static initialize(options: CreateAgentRuntimeFrameworkOptions): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=runtimeModuleInitializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeModuleInitializer.d.ts","sourceRoot":"","sources":["../../../src/runtime/bootstrap/runtimeModuleInitializer.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,sBAAsB,CAAC;AAE/E,qBAAa,6BAA6B;WACpB,UAAU,CAAC,OAAO,EAAE,kCAAkC,GAAG,OAAO,CAAC,IAAI,CAAC;CAwB3F"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { AgentContextTokens, getDefaultAgentContext } from "@botbotgo/common/context";
|
|
3
|
+
import { createAgentEventBus } from "@botbotgo/common/events";
|
|
4
|
+
import { createAgentMemory } from "@botbotgo/memory";
|
|
5
|
+
import { createAgentModel } from "@botbotgo/model";
|
|
6
|
+
import { createAgentTools } from "@botbotgo/kit";
|
|
7
|
+
export class AgentRuntimeModuleInitializer {
|
|
8
|
+
static async initialize(options) {
|
|
9
|
+
const context = getDefaultAgentContext();
|
|
10
|
+
const configDir = options.configDir ?? resolve(options.rootDir, "config");
|
|
11
|
+
const modelConfigPath = options.modelConfigPath ?? resolve(configDir, "model.yaml");
|
|
12
|
+
const memoryConfigPath = options.memoryConfigPath ?? resolve(configDir, "memory.yaml");
|
|
13
|
+
const toolConfigPath = options.toolConfigPath ?? resolve(configDir, "tool.yaml");
|
|
14
|
+
const forceInitializeModules = options.forceInitializeModules ?? false;
|
|
15
|
+
if (forceInitializeModules || !context.has(AgentContextTokens.EventBus)) {
|
|
16
|
+
createAgentEventBus();
|
|
17
|
+
}
|
|
18
|
+
if (forceInitializeModules || !context.has(AgentContextTokens.ChatModel)) {
|
|
19
|
+
await createAgentModel({
|
|
20
|
+
configPath: modelConfigPath,
|
|
21
|
+
checkConnectivity: options.modelCheckConnectivity ?? false,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
if (forceInitializeModules || !context.has(AgentContextTokens.Memory)) {
|
|
25
|
+
await createAgentMemory(memoryConfigPath);
|
|
26
|
+
}
|
|
27
|
+
if (forceInitializeModules || !context.has(AgentContextTokens.Tools)) {
|
|
28
|
+
await createAgentTools(toolConfigPath);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=runtimeModuleInitializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeModuleInitializer.js","sourceRoot":"","sources":["../../../src/runtime/bootstrap/runtimeModuleInitializer.ts"],"names":[],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AAK;aAC3D,CAAC,CAAC;QACL,CAAC;QACD,IAAI,sBAAsB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;YACtE,MAAM,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;QAC5C,CAAC;QACD,IAAI,sBAAsB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;YACrE,MAAM,gBAAgB,CAAC,cAAc,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function requireAgentRuntimeContextValue<T>(token: symbol, label: string): T;
|
|
2
|
+
export declare function requireAgentRuntimeChatModel<T>(): T;
|
|
3
|
+
export declare function requireAgentRuntimeMemory<T>(): T;
|
|
4
|
+
export declare function requireAgentRuntimeTools<T>(): T;
|
|
5
|
+
//# sourceMappingURL=agentContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentContext.d.ts","sourceRoot":"","sources":["../../../src/runtime/context/agentContext.ts"],"names":[],"mappings":"AAEA,wBAAgB,+BAA+B,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CASlF;AAED,wBAAgB,4BAA4B,CAAC,CAAC,KAAK,CAAC,CAEnD;AAED,wBAAgB,yBAAyB,CAAC,CAAC,KAAK,CAAC,CAEhD;AAED,wBAAgB,wBAAwB,CAAC,CAAC,KAAK,CAAC,CAE/C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AgentContextTokens, getDefaultAgentContext } from "@botbotgo/common/context";
|
|
2
|
+
export function requireAgentRuntimeContextValue(token, label) {
|
|
3
|
+
const context = getDefaultAgentContext();
|
|
4
|
+
const value = context.tryGet(token);
|
|
5
|
+
if (value === undefined) {
|
|
6
|
+
throw new Error(`agent-runtime2 requires ${label} to be registered in AgentContext before runtime creation.`);
|
|
7
|
+
}
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
export function requireAgentRuntimeChatModel() {
|
|
11
|
+
return requireAgentRuntimeContextValue(AgentContextTokens.ChatModel, "ChatModel");
|
|
12
|
+
}
|
|
13
|
+
export function requireAgentRuntimeMemory() {
|
|
14
|
+
return requireAgentRuntimeContextValue(AgentContextTokens.Memory, "Memory");
|
|
15
|
+
}
|
|
16
|
+
export function requireAgentRuntimeTools() {
|
|
17
|
+
return requireAgentRuntimeContextValue(AgentContextTokens.Tools, "Tools");
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=agentContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentContext.js","sourceRoot":"","sources":["../../../src/runtime/context/agentContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,MAAM,UAAU,+BAA+B,CAAI,KAAa,EAAE,KAAa;IAC7E,MAAM,OAAO,GAAG,sBAAsB,EAAE,CAAC;IACzC,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAI,KAAK,CAAC,CAAC;IACvC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,2BAA2B,KAAK,4DAA4D,CAC7F,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,4BAA4B;IAC1C,OAAO,+BAA+B,CAAI,kBAAkB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACvF,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,OAAO,+BAA+B,CAAI,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,OAAO,+BAA+B,CAAI,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface AgentRuntimeGlobalContext {
|
|
2
|
+
register<T>(key: PropertyKey, value: T): T;
|
|
3
|
+
get<T>(key: PropertyKey): T | undefined;
|
|
4
|
+
getOrRegister<T>(key: PropertyKey, create: () => T): T;
|
|
5
|
+
has(key: PropertyKey): boolean;
|
|
6
|
+
remove(key: PropertyKey): boolean;
|
|
7
|
+
clear(): void;
|
|
8
|
+
}
|
|
9
|
+
type GlobalContextStore = Map<PropertyKey, unknown>;
|
|
10
|
+
declare global {
|
|
11
|
+
var __agent_runtime2_global_context__: GlobalContextStore | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare function getAgentRuntimeGlobalContext(): AgentRuntimeGlobalContext;
|
|
14
|
+
export declare function registerAgentRuntimeGlobal<T>(key: PropertyKey, value: T): T;
|
|
15
|
+
export declare function getAgentRuntimeGlobal<T>(key: PropertyKey): T | undefined;
|
|
16
|
+
export declare function getOrRegisterAgentRuntimeGlobal<T>(key: PropertyKey, create: () => T): T;
|
|
17
|
+
export declare function clearAgentRuntimeGlobalContext(): void;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=globalContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalContext.d.ts","sourceRoot":"","sources":["../../../src/runtime/context/globalContext.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IAC3C,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,GAAG,CAAC,GAAG,SAAS,CAAC;IACxC,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACvD,GAAG,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC;IAC/B,MAAM,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC;IAClC,KAAK,IAAI,IAAI,CAAC;CACf;AAED,KAAK,kBAAkB,GAAG,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAEpD,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,iCAAiC,EAAE,kBAAkB,GAAG,SAAS,CAAC;CACvE;AAOD,wBAAgB,4BAA4B,IAAI,yBAAyB,CA4BxE;AAED,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAE3E;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,GAAG,CAAC,GAAG,SAAS,CAExE;AAED,wBAAgB,+BAA+B,CAAC,CAAC,EAC/C,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,MAAM,CAAC,GACd,CAAC,CAEH;AAED,wBAAgB,8BAA8B,IAAI,IAAI,CAErD"}
|