@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,30 @@
|
|
|
1
|
+
import { AgentMessageService } from "../../stream/agentMessages.js";
|
|
2
|
+
|
|
3
|
+
export class RunCompletionPolicy {
|
|
4
|
+
public static isToolCallSummary(summary: string): boolean {
|
|
5
|
+
return summary.startsWith("Tool call:");
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
public static hasAssistantFinalMessage(chunk: unknown): boolean {
|
|
9
|
+
if (!chunk) return false;
|
|
10
|
+
const messages = AgentMessageService.getAgentMessages(chunk);
|
|
11
|
+
const last = messages.length > 0 ? messages[messages.length - 1] : undefined;
|
|
12
|
+
if (!last) return false;
|
|
13
|
+
|
|
14
|
+
const role = String(last.role ?? "").toLowerCase();
|
|
15
|
+
const type = String(last.type ?? "").toLowerCase();
|
|
16
|
+
const kwargs = (last.kwargs ?? {}) as { tool_calls?: unknown; content?: unknown };
|
|
17
|
+
const hasToolCalls =
|
|
18
|
+
Array.isArray(last.tool_calls) && last.tool_calls.length > 0 ||
|
|
19
|
+
Array.isArray(kwargs.tool_calls) && kwargs.tool_calls.length > 0;
|
|
20
|
+
if (hasToolCalls) return false;
|
|
21
|
+
|
|
22
|
+
const content = typeof last.content === "string"
|
|
23
|
+
? last.content
|
|
24
|
+
: typeof kwargs.content === "string"
|
|
25
|
+
? kwargs.content
|
|
26
|
+
: "";
|
|
27
|
+
if (!content.trim()) return false;
|
|
28
|
+
return role === "assistant" || role === "ai" || type.includes("ai");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export class RunErrorPolicy {
|
|
2
|
+
public static isIdleTimeoutError(error: unknown): boolean {
|
|
3
|
+
const message = error instanceof Error ? error.message : String(error ?? "");
|
|
4
|
+
return message.includes("Agent stream idle timeout");
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
public static isTransientModelError(error: unknown): boolean {
|
|
8
|
+
const message = error instanceof Error ? error.message : String(error ?? "");
|
|
9
|
+
const normalized = message.toLowerCase();
|
|
10
|
+
return (
|
|
11
|
+
normalized.includes("middlewareerror: 502") ||
|
|
12
|
+
normalized.includes("middlewareerror: 503") ||
|
|
13
|
+
normalized.includes("middlewareerror: 504") ||
|
|
14
|
+
normalized.includes("bad gateway") ||
|
|
15
|
+
normalized.includes("gateway timeout") ||
|
|
16
|
+
normalized.includes("<!doctype html>")
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public static isRecoverableToolCallError(error: unknown): boolean {
|
|
21
|
+
const seen = new Set<unknown>();
|
|
22
|
+
let current: unknown = error;
|
|
23
|
+
|
|
24
|
+
while (current && typeof current === "object" && !seen.has(current)) {
|
|
25
|
+
seen.add(current);
|
|
26
|
+
const message = String((current as { message?: unknown }).message ?? "").toLowerCase();
|
|
27
|
+
if (
|
|
28
|
+
message.includes("error parsing tool call") ||
|
|
29
|
+
message.includes("invalid character") ||
|
|
30
|
+
message.includes("did not match expected schema") ||
|
|
31
|
+
message.includes("invalid input") ||
|
|
32
|
+
message.includes("error invoking tool") ||
|
|
33
|
+
message.includes("tool input")
|
|
34
|
+
) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
current = (current as { cause?: unknown }).cause;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public static createTransientModelError(error: unknown): Error {
|
|
44
|
+
return new Error(
|
|
45
|
+
`Model request failed with a transient upstream error. ` +
|
|
46
|
+
`Try reducing runtime config pressure (llmMaxTokens=1024, model timeout in config/model.yaml options.timeoutMs=60000) ` +
|
|
47
|
+
`and verify endpoint with scripts/verify-llm.sh. Original error: ${String(error)}`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export class RunPromptBuilder {
|
|
2
|
+
public static buildExecutionPrompt(prompt: string): string {
|
|
3
|
+
const guardrails = [
|
|
4
|
+
"Tool-call rules:",
|
|
5
|
+
'- Return strict JSON for tool args (example: {"offset":0}, never "offset=0").',
|
|
6
|
+
"- Use workspace-relative paths only; never construct absolute filesystem paths.",
|
|
7
|
+
"- Framework supports both tool calls and script commands; follow the SKILL whitelist per step.",
|
|
8
|
+
"- If a skill allows both tool and script for one step, prefer the tool path unless user asks for script.",
|
|
9
|
+
"- Do not inspect script source files unless the user explicitly asks for script code.",
|
|
10
|
+
"- Avoid redundant exploratory calls; use the shortest valid workflow.",
|
|
11
|
+
"- Complete the task in one uninterrupted run whenever possible; do not stop after intermediate reads or planning.",
|
|
12
|
+
"- If required output artifacts are missing, continue executing tool steps until they are written and validated.",
|
|
13
|
+
].join("\n");
|
|
14
|
+
return `${prompt}\n\n${guardrails}`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public static buildIncompleteRetryPrompt(params: {
|
|
18
|
+
prompt: string;
|
|
19
|
+
trackedPaths: string[];
|
|
20
|
+
requiredArtifactPaths: string[];
|
|
21
|
+
lastSummary: string;
|
|
22
|
+
}): string {
|
|
23
|
+
const missingOutputs = params.requiredArtifactPaths.length > 0
|
|
24
|
+
? params.requiredArtifactPaths.join(", ")
|
|
25
|
+
: "(none)";
|
|
26
|
+
const previousSummary = params.lastSummary?.trim() || "n/a";
|
|
27
|
+
return [
|
|
28
|
+
"The previous run ended before completion.",
|
|
29
|
+
`Last summary: ${previousSummary}.`,
|
|
30
|
+
"Continue in the current thread and do not restart from scratch.",
|
|
31
|
+
`Missing required outputs (write these first): ${missingOutputs}.`,
|
|
32
|
+
`Tracked state paths: ${params.trackedPaths.join(", ")}.`,
|
|
33
|
+
"After generating missing outputs, perform required validation and provide the final response.",
|
|
34
|
+
"",
|
|
35
|
+
"Original task:",
|
|
36
|
+
params.prompt,
|
|
37
|
+
].join("\n");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export class RunSummaryFormatter {
|
|
2
|
+
public static formatRunStep(summary: string, elapsedMs: number): string {
|
|
3
|
+
const { indent, marker, text } = this.classifyRunSummary(summary);
|
|
4
|
+
return `${" ".repeat(indent)}${marker} ${text} (${(elapsedMs / 1000).toFixed(1)}s)`;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
public static formatMergedRunStep(
|
|
8
|
+
toolSummary: string,
|
|
9
|
+
resultSummary: string,
|
|
10
|
+
resultElapsedMs: number,
|
|
11
|
+
): string {
|
|
12
|
+
const toolText = toolSummary.replace(/^Tool call:\s*/, "");
|
|
13
|
+
const { text } = this.classifyRunSummary(resultSummary);
|
|
14
|
+
return `- ${toolText} -> ${text} (${(resultElapsedMs / 1000).toFixed(1)}s)`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
private static classifyRunSummary(summary: string): { indent: number; marker: string; text: string } {
|
|
18
|
+
if (summary.startsWith("Tool call:")) {
|
|
19
|
+
return {
|
|
20
|
+
indent: 2,
|
|
21
|
+
marker: "-",
|
|
22
|
+
text: summary.replace(/^Tool call:\s*/, ""),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (
|
|
27
|
+
summary.startsWith("Saved file") ||
|
|
28
|
+
summary.startsWith("Command ") ||
|
|
29
|
+
summary.startsWith("Checked workspace files") ||
|
|
30
|
+
summary.startsWith("Rate limited") ||
|
|
31
|
+
summary === "Command returned a usage error" ||
|
|
32
|
+
summary === "Loaded instructions" ||
|
|
33
|
+
summary === "Reviewed generated content" ||
|
|
34
|
+
summary === "Command completed"
|
|
35
|
+
) {
|
|
36
|
+
return {
|
|
37
|
+
indent: 6,
|
|
38
|
+
marker: ">",
|
|
39
|
+
text: summary,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (summary === "Run completed") {
|
|
44
|
+
return {
|
|
45
|
+
indent: 0,
|
|
46
|
+
marker: "done",
|
|
47
|
+
text: summary,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
indent: 0,
|
|
53
|
+
marker: "*",
|
|
54
|
+
text: summary.replace(/^Message:\s*/, ""),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { parseYamlContent } from "@botbotgo/common/config";
|
|
3
|
+
|
|
4
|
+
export class ToolConfigReader {
|
|
5
|
+
public static readAllowedToolNames(toolConfigPath: string): string[] | undefined {
|
|
6
|
+
if (!existsSync(toolConfigPath)) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
const raw = readFileSync(toolConfigPath, "utf8");
|
|
10
|
+
const parsed = parseYamlContent<Record<string, unknown> | undefined>(raw, {
|
|
11
|
+
substituteEnv: false,
|
|
12
|
+
});
|
|
13
|
+
if (!parsed || typeof parsed !== "object") {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const source = parsed.spec && typeof parsed.spec === "object" && !Array.isArray(parsed.spec)
|
|
18
|
+
? parsed.spec as Record<string, unknown>
|
|
19
|
+
: parsed;
|
|
20
|
+
const toolsNode = source.tools && typeof source.tools === "object" && !Array.isArray(source.tools)
|
|
21
|
+
? source.tools as Record<string, unknown>
|
|
22
|
+
: undefined;
|
|
23
|
+
const deepagents = toolsNode?.deepagents;
|
|
24
|
+
const legacyDeepagents = source.deepagents && typeof source.deepagents === "object" && !Array.isArray(source.deepagents)
|
|
25
|
+
? source.deepagents as Record<string, unknown>
|
|
26
|
+
: undefined;
|
|
27
|
+
const names = new Set<string>();
|
|
28
|
+
|
|
29
|
+
this.collectDeepagentsNames(names, deepagents, legacyDeepagents, source);
|
|
30
|
+
this.collectCustomizedNames(names, toolsNode);
|
|
31
|
+
return names.size > 0 ? [...names] : undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private static collectDeepagentsNames(
|
|
35
|
+
names: Set<string>,
|
|
36
|
+
deepagents: unknown,
|
|
37
|
+
legacyDeepagents: Record<string, unknown> | undefined,
|
|
38
|
+
source: Record<string, unknown>,
|
|
39
|
+
): void {
|
|
40
|
+
if (Array.isArray(deepagents)) {
|
|
41
|
+
this.addStringItems(names, deepagents);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (
|
|
45
|
+
deepagents &&
|
|
46
|
+
typeof deepagents === "object" &&
|
|
47
|
+
!Array.isArray(deepagents) &&
|
|
48
|
+
Array.isArray((deepagents as Record<string, unknown>).tools)
|
|
49
|
+
) {
|
|
50
|
+
this.addStringItems(names, (deepagents as { tools: unknown[] }).tools);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (Array.isArray(legacyDeepagents?.tools)) {
|
|
54
|
+
this.addStringItems(names, legacyDeepagents.tools);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (Array.isArray(source.allowedToolNames)) {
|
|
58
|
+
this.addStringItems(names, source.allowedToolNames);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private static collectCustomizedNames(
|
|
63
|
+
names: Set<string>,
|
|
64
|
+
toolsNode: Record<string, unknown> | undefined,
|
|
65
|
+
): void {
|
|
66
|
+
const customized = toolsNode?.customized;
|
|
67
|
+
if (customized && typeof customized === "object" && !Array.isArray(customized)) {
|
|
68
|
+
const source = customized as Record<string, unknown>;
|
|
69
|
+
const descriptorGrouped = Object.keys(source).some((key) => /^(npm|file):/.test(key));
|
|
70
|
+
if (descriptorGrouped) {
|
|
71
|
+
for (const sourceValue of Object.values(source)) {
|
|
72
|
+
this.addObjectKeys(names, sourceValue);
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
this.addObjectKeys(names, source);
|
|
76
|
+
}
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (!toolsNode) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
for (const sourceValue of Object.values(toolsNode)) {
|
|
84
|
+
this.addObjectKeys(names, sourceValue);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
private static addStringItems(names: Set<string>, items: unknown[]): void {
|
|
89
|
+
for (const item of items) {
|
|
90
|
+
if (typeof item === "string" && item.trim().length > 0) {
|
|
91
|
+
names.add(item.trim());
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
private static addObjectKeys(names: Set<string>, sourceValue: unknown): void {
|
|
97
|
+
if (!sourceValue || typeof sourceValue !== "object" || Array.isArray(sourceValue)) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
for (const toolName of Object.keys(sourceValue as Record<string, unknown>)) {
|
|
101
|
+
const trimmed = toolName.trim();
|
|
102
|
+
if (trimmed.length > 0) {
|
|
103
|
+
names.add(trimmed);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as readline from "node:readline/promises";
|
|
2
|
+
import { stdin as defaultInput, stdout as defaultOutput } from "node:process";
|
|
3
|
+
import type { HumanLoopDecision, HumanLoopRequest, HumanLoopService } from "./humanLoop.js";
|
|
4
|
+
|
|
5
|
+
export interface ConsoleHumanLoopServiceOptions {
|
|
6
|
+
input?: NodeJS.ReadableStream;
|
|
7
|
+
output?: NodeJS.WritableStream;
|
|
8
|
+
prompt?: (question: string) => Promise<string>;
|
|
9
|
+
writer?: (line: string) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export class ConsoleHumanLoopService implements HumanLoopService {
|
|
13
|
+
private readonly input: NodeJS.ReadableStream;
|
|
14
|
+
private readonly output: NodeJS.WritableStream;
|
|
15
|
+
private readonly promptOverride?: ConsoleHumanLoopServiceOptions["prompt"];
|
|
16
|
+
private readonly writer: (line: string) => void;
|
|
17
|
+
|
|
18
|
+
public constructor(options: ConsoleHumanLoopServiceOptions = {}) {
|
|
19
|
+
this.input = options.input ?? defaultInput;
|
|
20
|
+
this.output = options.output ?? defaultOutput;
|
|
21
|
+
this.promptOverride = options.prompt;
|
|
22
|
+
this.writer = options.writer ?? ((line) => {
|
|
23
|
+
this.output.write(`${line}\n`);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public async request(request: HumanLoopRequest): Promise<HumanLoopDecision> {
|
|
28
|
+
this.printRequest(request);
|
|
29
|
+
|
|
30
|
+
const action = await this.askAction();
|
|
31
|
+
if (action === "approve") {
|
|
32
|
+
return { action, decidedAt: new Date().toISOString() };
|
|
33
|
+
}
|
|
34
|
+
if (action === "reject") {
|
|
35
|
+
const message = await this.askOptional("Rejection message (optional): ");
|
|
36
|
+
return {
|
|
37
|
+
action,
|
|
38
|
+
message: message || `Rejected in console for tool ${request.toolName}.`,
|
|
39
|
+
decidedAt: new Date().toISOString(),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const revisedArgs = await this.askRevisedArgs(request);
|
|
44
|
+
const message = await this.askOptional("Revision note (optional): ");
|
|
45
|
+
return {
|
|
46
|
+
action: "revise",
|
|
47
|
+
revisedArgs,
|
|
48
|
+
message: message || "Args revised in console.",
|
|
49
|
+
decidedAt: new Date().toISOString(),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private printRequest(request: HumanLoopRequest): void {
|
|
54
|
+
this.writer("");
|
|
55
|
+
this.writer(`[human-loop] ${request.title}`);
|
|
56
|
+
this.writer(`kind: ${request.kind}`);
|
|
57
|
+
this.writer(`tool: ${request.toolName}`);
|
|
58
|
+
if (request.threadId) this.writer(`thread: ${request.threadId}`);
|
|
59
|
+
if (request.riskLevel) this.writer(`risk: ${request.riskLevel}`);
|
|
60
|
+
this.writer(request.description);
|
|
61
|
+
this.writer("args:");
|
|
62
|
+
this.writer(JSON.stringify(request.args, null, 2));
|
|
63
|
+
this.writer("");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private async askAction(): Promise<HumanLoopDecision["action"]> {
|
|
67
|
+
while (true) {
|
|
68
|
+
const answer = (await this.ask("Approve, reject, or revise? [a/r/e]: ")).trim().toLowerCase();
|
|
69
|
+
if (answer === "a" || answer === "approve") return "approve";
|
|
70
|
+
if (answer === "r" || answer === "reject") return "reject";
|
|
71
|
+
if (answer === "e" || answer === "edit" || answer === "revise") return "revise";
|
|
72
|
+
this.writer("Please enter a, r, or e.");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private async askRevisedArgs(request: HumanLoopRequest): Promise<Record<string, unknown>> {
|
|
77
|
+
this.writer("Enter revised args as one-line JSON.");
|
|
78
|
+
this.writer(`Current args: ${JSON.stringify(request.args)}`);
|
|
79
|
+
while (true) {
|
|
80
|
+
const answer = (await this.ask("revised args JSON: ")).trim();
|
|
81
|
+
try {
|
|
82
|
+
const parsed = JSON.parse(answer);
|
|
83
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
84
|
+
this.writer("Expected a JSON object.");
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
return parsed as Record<string, unknown>;
|
|
88
|
+
} catch {
|
|
89
|
+
this.writer("Invalid JSON. Try again.");
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private async askOptional(question: string): Promise<string> {
|
|
95
|
+
return (await this.ask(question)).trim();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private async ask(question: string): Promise<string> {
|
|
99
|
+
if (this.promptOverride) {
|
|
100
|
+
return this.promptOverride(question);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const rl = readline.createInterface({
|
|
104
|
+
input: this.input,
|
|
105
|
+
output: this.output,
|
|
106
|
+
});
|
|
107
|
+
try {
|
|
108
|
+
return await rl.question(question);
|
|
109
|
+
} finally {
|
|
110
|
+
rl.close();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import type { ToolArgs } from "../middleware/types.js";
|
|
3
|
+
|
|
4
|
+
export type HumanLoopRequestKind = "tool_approval";
|
|
5
|
+
export type HumanLoopDecisionAction = "approve" | "reject" | "revise";
|
|
6
|
+
export type HumanLoopRiskLevel = "low" | "medium" | "high";
|
|
7
|
+
|
|
8
|
+
export interface HumanLoopToolCallContext {
|
|
9
|
+
threadId?: string;
|
|
10
|
+
toolCallId?: string;
|
|
11
|
+
toolName: string;
|
|
12
|
+
args: ToolArgs;
|
|
13
|
+
rootDir: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface HumanLoopRequest {
|
|
17
|
+
id: string;
|
|
18
|
+
kind: HumanLoopRequestKind;
|
|
19
|
+
threadId?: string;
|
|
20
|
+
toolCallId?: string;
|
|
21
|
+
toolName: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
args: ToolArgs;
|
|
25
|
+
rootDir: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
riskLevel?: HumanLoopRiskLevel;
|
|
28
|
+
metadata?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface HumanLoopDecision {
|
|
32
|
+
action: HumanLoopDecisionAction;
|
|
33
|
+
message?: string;
|
|
34
|
+
revisedArgs?: ToolArgs;
|
|
35
|
+
actor?: string;
|
|
36
|
+
decidedAt?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface HumanLoopService {
|
|
40
|
+
request(request: HumanLoopRequest): Promise<HumanLoopDecision>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface HumanLoopToolPolicy {
|
|
44
|
+
buildRequest(context: HumanLoopToolCallContext): HumanLoopRequest | null | undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface CreateDefaultHumanLoopToolPolicyOptions {
|
|
48
|
+
toolNames?: string[];
|
|
49
|
+
riskLevel?: HumanLoopRiskLevel;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function createDefaultHumanLoopToolPolicy(
|
|
53
|
+
options: CreateDefaultHumanLoopToolPolicyOptions = {},
|
|
54
|
+
): HumanLoopToolPolicy {
|
|
55
|
+
const riskyToolNames = new Set(options.toolNames ?? ["execute", "write_file", "edit_file"]);
|
|
56
|
+
const riskLevel = options.riskLevel ?? "high";
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
buildRequest(context) {
|
|
60
|
+
if (!riskyToolNames.has(context.toolName)) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
id: randomUUID(),
|
|
66
|
+
kind: "tool_approval",
|
|
67
|
+
threadId: context.threadId,
|
|
68
|
+
toolCallId: context.toolCallId,
|
|
69
|
+
toolName: context.toolName,
|
|
70
|
+
title: `Approval required for ${context.toolName}`,
|
|
71
|
+
description: buildDefaultDescription(context.toolName, context.args),
|
|
72
|
+
args: context.args,
|
|
73
|
+
rootDir: context.rootDir,
|
|
74
|
+
createdAt: new Date().toISOString(),
|
|
75
|
+
riskLevel,
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function buildDefaultDescription(toolName: string, args: ToolArgs): string {
|
|
82
|
+
if (toolName === "execute" && typeof args.command === "string") {
|
|
83
|
+
return `Command: ${args.command}`;
|
|
84
|
+
}
|
|
85
|
+
if ((toolName === "write_file" || toolName === "edit_file") &&
|
|
86
|
+
typeof (args.file_path ?? args.path) === "string") {
|
|
87
|
+
return `File: ${String(args.file_path ?? args.path)}`;
|
|
88
|
+
}
|
|
89
|
+
return `Tool args: ${JSON.stringify(args)}`;
|
|
90
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export {
|
|
2
|
+
AgentRuntimeService,
|
|
3
|
+
createAgentRuntime2,
|
|
4
|
+
initializeAgentRuntimeModules,
|
|
5
|
+
} from "./runtimeService.js";
|
|
6
|
+
export { ConsoleHumanLoopService } from "./human-loop/consoleHumanLoop.js";
|
|
7
|
+
export type { CreateAgentRuntimeFrameworkOptions } from "./runtimeService.js";
|
|
8
|
+
export {
|
|
9
|
+
createDefaultHumanLoopToolPolicy,
|
|
10
|
+
} from "./human-loop/humanLoop.js";
|
|
11
|
+
export type {
|
|
12
|
+
HumanLoopDecision,
|
|
13
|
+
HumanLoopRequest,
|
|
14
|
+
HumanLoopService,
|
|
15
|
+
HumanLoopToolCallContext,
|
|
16
|
+
HumanLoopToolPolicy,
|
|
17
|
+
} from "./human-loop/humanLoop.js";
|
|
18
|
+
export type {
|
|
19
|
+
AgentEvent,
|
|
20
|
+
AgentEventBus,
|
|
21
|
+
AgentEventListener,
|
|
22
|
+
} from "./events/eventPublisher.js";
|
|
23
|
+
export {
|
|
24
|
+
clearAgentRuntimeGlobalContext,
|
|
25
|
+
getAgentRuntimeGlobal,
|
|
26
|
+
getAgentRuntimeGlobalContext,
|
|
27
|
+
getOrRegisterAgentRuntimeGlobal,
|
|
28
|
+
registerAgentRuntimeGlobal,
|
|
29
|
+
} from "./context/globalContext.js";
|
|
30
|
+
export type { AgentRuntimeGlobalContext } from "./context/globalContext.js";
|
|
31
|
+
export {
|
|
32
|
+
requireAgentRuntimeChatModel,
|
|
33
|
+
requireAgentRuntimeContextValue,
|
|
34
|
+
requireAgentRuntimeMemory,
|
|
35
|
+
requireAgentRuntimeTools,
|
|
36
|
+
} from "./context/agentContext.js";
|