docs: document code mode helpers · openclaw/openclaw@31a1034
steipete
·
2026-06-04
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +/** |
| 2 | + * Host-side Code Mode controller for isolated QuickJS execution with bridged |
| 3 | + * tool search/call/yield support. |
| 4 | + */ |
1 | 5 | import { randomUUID } from "node:crypto"; |
2 | 6 | import path from "node:path"; |
3 | 7 | import { fileURLToPath, pathToFileURL } from "node:url"; |
@@ -52,8 +56,6 @@ export {
|
52 | 56 | isCodeModeControlTool, |
53 | 57 | } from "./code-mode-control-tools.js"; |
54 | 58 | |
55 | | -// Host-side Code Mode controller. It compacts tool catalogs, starts the QuickJS |
56 | | -// worker, stores suspended snapshots, and resumes pending bridged tool calls. |
57 | 59 | const DEFAULT_TIMEOUT_MS = 10_000; |
58 | 60 | const DEFAULT_MEMORY_LIMIT_BYTES = 64 * 1024 * 1024; |
59 | 61 | const DEFAULT_MAX_OUTPUT_BYTES = 64 * 1024; |
@@ -194,6 +196,7 @@ function readLanguages(value: unknown): CodeModeLanguage[] {
|
194 | 196 | return languages.length > 0 ? uniqueValues(languages) : ["javascript", "typescript"]; |
195 | 197 | } |
196 | 198 | |
| 199 | +/** Resolves Code Mode runtime limits and language support from config. */ |
197 | 200 | export function resolveCodeModeConfig(config?: OpenClawConfig, agentId?: string): CodeModeConfig { |
198 | 201 | const raw = readCodeModeRawConfig(config, agentId); |
199 | 202 | const maxSearchLimit = clampInteger( |
@@ -1262,6 +1265,7 @@ export function addClientToolsToCodeModeCatalog(params: {
|
1262 | 1265 | }); |
1263 | 1266 | } |
1264 | 1267 | |
| 1268 | +/** Test-only hooks and state accessors for Code Mode worker orchestration. */ |
1265 | 1269 | export const testing = { |
1266 | 1270 | activeRuns, |
1267 | 1271 | resumingRunIds, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。