| |
| import { |
| Agent as CoreAgent, |
| type AgentOptions as CoreAgentOptions, |
| } from "../../packages/agent-core/src/agent.js"; |
| import type { AgentCoreRuntimeDeps } from "../../packages/agent-core/src/runtime-deps.js"; |
| import type { CompleteSimpleFn, StreamFn } from "../../packages/llm-core/src/index.js"; |
| import { runPluginStreamConsumer } from "../plugins/plugin-instance-scope.js"; |
| import { completeSimple, streamSimple } from "./llm.js"; |
|
|
| |
| export const openClawAgentCoreRuntime = { |
| runStream: runPluginStreamConsumer, |
| completeSimple: ((model, context, options) => |
| completeSimple(model, context, options)) satisfies CompleteSimpleFn, |
| streamSimple: ((model, context, options) => |
| streamSimple(model, context, options)) satisfies StreamFn, |
| } satisfies AgentCoreRuntimeDeps; |
|
|
| |
| export class Agent extends CoreAgent { |
| constructor(options: CoreAgentOptions = {}) { |
| super({ runtime: openClawAgentCoreRuntime, ...options }); |
| } |
| } |
|
|
| |
| export { runAgentLoop } from "../../packages/agent-core/src/index.js"; |
| |
| |
| export { streamProxy } from "../agents/runtime/proxy.js"; |
| export type { ProxyAssistantMessageEvent, ProxyStreamOptions } from "../agents/runtime/proxy.js"; |
| export { |
| bashExecutionToText, |
| buildSessionContext, |
| calculateContextTokens, |
| collectEntriesForBranchSummaryFromBranches, |
| compact, |
| estimateContextTokens, |
| estimateTokens, |
| findCutPoint, |
| findTurnStartIndex, |
| generateBranchSummary, |
| generateSummary, |
| getLastAssistantUsage, |
| prepareBranchEntries, |
| prepareCompaction, |
| serializeConversation, |
| shouldCompact, |
| uuidv7, |
| BRANCH_SUMMARY_PREFIX, |
| BRANCH_SUMMARY_SUFFIX, |
| COMPACTION_SUMMARY_PREFIX, |
| COMPACTION_SUMMARY_SUFFIX, |
| DEFAULT_COMPACTION_SETTINGS, |
| IMAGE_BLOCK_TOKENS, |
| } from "../../packages/agent-core/src/index.js"; |
| export type { |
| AfterToolCallResult, |
| AfterToolOutcomeContext, |
| AgentEvent, |
| AgentMessage, |
| AfterToolCallContext, |
| AgentOptions, |
| AgentState, |
| AgentTool, |
| AgentToolProgress, |
| AgentToolResult, |
| AgentToolUpdateCallback, |
| BashExecutionMessage, |
| BranchPreparation, |
| BranchSummaryDetails, |
| BranchSummaryResult, |
| CompactionDetails, |
| CompactionPreparation, |
| CompactionResult, |
| CompactionSettings, |
| CompactionSummaryPrompt, |
| ContextUsageEstimate, |
| FileOperations, |
| Result, |
| SessionTreeEntry, |
| StreamFn, |
| ThinkingLevel, |
| ToolExecutionMode, |
| } from "../../packages/agent-core/src/index.js"; |
| |
|
|