惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google Online Security Blog
Google Online Security Blog
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
W
WeLiveSecurity
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
博客园 - 司徒正美
雷峰网
雷峰网
L
LINUX DO - 最新话题
博客园 - 叶小钗
云风的 BLOG
云风的 BLOG
The Last Watchdog
The Last Watchdog
V2EX - 技术
V2EX - 技术
S
Security Affairs
有赞技术团队
有赞技术团队
月光博客
月光博客
T
Threatpost
T
Tor Project blog
O
OpenAI News
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V
V2EX
Know Your Adversary
Know Your Adversary
Project Zero
Project Zero
博客园 - 三生石上(FineUI控件)
D
Docker
AWS News Blog
AWS News Blog
AI
AI
P
Proofpoint News Feed
K
Kaspersky official blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Darknet – Hacking Tools, Hacker News & Cyber Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
S
Securelist
F
Fortinet All Blogs
F
Full Disclosure
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
量子位
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Palo Alto Networks Blog
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
美团技术团队
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
build(docs): finish PowerShell-safe docs formatting (#93512) · openclaw/openclaw@add00d7
vincentkoc · 2026-06-16 · via Recent Commits to openclaw:main
11

#!/usr/bin/env node

2233

// Formats docs Markdown/MDX and repairs Mintlify accordion indentation.

4-

import { execFileSync, spawnSync } from "node:child_process";

4+

import { spawnSync } from "node:child_process";

55

import fs from "node:fs";

66

import os from "node:os";

77

import path from "node:path";

8+

import { pathToFileURL } from "node:url";

89

import { repairMintlifyAccordionIndentation } from "./lib/mintlify-accordion.mjs";

10+

import { buildCmdExeCommandLine } from "./windows-cmd-helpers.mjs";

9111012

const ROOT = path.resolve(import.meta.dirname, "..");

1113

const CHECK = process.argv.includes("--check");

12-

const OXFMT_BIN = path.join(ROOT, "node_modules", "oxfmt", "bin", "oxfmt");

13-

const OXFMT_CONFIG = path.join(ROOT, ".oxfmtrc.jsonc");

14+

const DOCS_FORMAT_MAX_BUFFER_BYTES = 1024 * 1024 * 16;

15+

export const DOCS_FORMAT_MAX_COMMAND_LINE_BYTES = 24 * 1024;

16+

const FAILURE_OUTPUT_TAIL_BYTES = 16 * 1024;

141715-

function docsFiles() {

16-

const output = execFileSync("git", ["ls-files", "docs/**/*.md", "docs/**/*.mdx", "README.md"], {

17-

cwd: ROOT,

18+

function outputText(value) {

19+

if (typeof value === "string") {

20+

return value;

21+

}

22+

if (Buffer.isBuffer(value)) {

23+

return value.toString("utf8");

24+

}

25+

return "";

26+

}

27+28+

function outputTail(value) {

29+

const text = outputText(value).trim();

30+

if (!text) {

31+

return "";

32+

}

33+

const bytes = Buffer.from(text, "utf8");

34+

if (bytes.byteLength <= FAILURE_OUTPUT_TAIL_BYTES) {

35+

return text;

36+

}

37+

return bytes.subarray(bytes.byteLength - FAILURE_OUTPUT_TAIL_BYTES).toString("utf8");

38+

}

39+40+

function commandFailureMessage(label, result, invocation) {

41+

const details = [];

42+

if (invocation) {

43+

details.push(`command: ${invocation.command}`);

44+

if (invocation.args.length > 0) {

45+

const previewArgs = invocation.args.slice(0, 12).join(" ");

46+

const suffix = invocation.args.length > 12 ? ` ... (${invocation.args.length} args)` : "";

47+

details.push(`args: ${previewArgs}${suffix}`);

48+

}

49+

}

50+

if (result.error?.message) {

51+

details.push(result.error.message);

52+

}

53+

if (result.status !== null && result.status !== undefined && result.status !== 0) {

54+

details.push(`exit status: ${result.status}`);

55+

}

56+

if (result.signal) {

57+

details.push(`signal: ${result.signal}`);

58+

}

59+

const stderrTail = outputTail(result.stderr);

60+

if (stderrTail) {

61+

details.push(`stderr tail:\n${stderrTail}`);

62+

}

63+

const stdoutTail = outputTail(result.stdout);

64+

if (stdoutTail) {

65+

details.push(`stdout tail:\n${stdoutTail}`);

66+

}

67+

return `${label} failed${details.length > 0 ? `:\n${details.join("\n")}` : ""}`;

68+

}

69+70+

export function docsFiles(root = ROOT, deps = {}) {

71+

const spawnSyncImpl = deps.spawnSync ?? spawnSync;

72+

const result = spawnSyncImpl("git", ["ls-files", "docs/**/*.md", "docs/**/*.mdx", "README.md"], {

73+

cwd: root,

1874

encoding: "utf8",

75+

maxBuffer: DOCS_FORMAT_MAX_BUFFER_BYTES,

1976

});

20-

return output

77+

if (result.error || result.status !== 0) {

78+

throw new Error(

79+

commandFailureMessage("git ls-files", result, {

80+

command: "git",

81+

args: ["ls-files", "docs/**/*.md", "docs/**/*.mdx", "README.md"],

82+

}),

83+

);

84+

}

85+

return outputText(result.stdout)

2186

.split("\n")

2287

.filter(Boolean)

23-

.filter((relativePath) => fs.existsSync(path.join(ROOT, relativePath)));

88+

.filter((relativePath) => (deps.existsSync ?? fs.existsSync)(path.join(root, relativePath)));

89+

}

90+91+

function commandLineBytes(args) {

92+

return args.reduce((total, arg) => total + Buffer.byteLength(arg, "utf8") + 3, 0);

2493

}

259426-

function runOxfmt(files) {

27-

const result = spawnSync(

28-

process.execPath,

29-

[OXFMT_BIN, "--write", "--threads=1", "--config", OXFMT_CONFIG, ...files],

30-

{

31-

cwd: ROOT,

95+

export function chunkFilesForCommand(

96+

files,

97+

prefixArgs,

98+

maxBytes = DOCS_FORMAT_MAX_COMMAND_LINE_BYTES,

99+

) {

100+

const chunks = [];

101+

let chunk = [];

102+

let chunkBytes = commandLineBytes(prefixArgs);

103+104+

for (const file of files) {

105+

const fileBytes = Buffer.byteLength(file, "utf8") + 3;

106+

if (chunk.length > 0 && chunkBytes + fileBytes > maxBytes) {

107+

chunks.push(chunk);

108+

chunk = [];

109+

chunkBytes = commandLineBytes(prefixArgs);

110+

}

111+

chunk.push(file);

112+

chunkBytes += fileBytes;

113+

}

114+115+

if (chunk.length > 0) {

116+

chunks.push(chunk);

117+

}

118+119+

return chunks;

120+

}

121+122+

export function resolveOxfmtInvocation(args, params = {}) {

123+

const repoRoot = params.repoRoot ?? ROOT;

124+

const platform = params.platform ?? process.platform;

125+

const existsSync = params.existsSync ?? fs.existsSync;

126+

const shimName = platform === "win32" ? "oxfmt.cmd" : "oxfmt";

127+

const shimPath = path.join(repoRoot, "node_modules", ".bin", shimName);

128+129+

if (existsSync(shimPath)) {

130+

if (platform === "win32") {

131+

const comSpec = params.comSpec ?? process.env.ComSpec ?? "cmd.exe";

132+

return {

133+

command: comSpec,

134+

args: ["/d", "/s", "/c", buildCmdExeCommandLine(shimPath, args)],

135+

shell: false,

136+

windowsVerbatimArguments: true,

137+

};

138+

}

139+

return {

140+

command: shimPath,

141+

args,

142+

shell: false,

143+

};

144+

}

145+146+

return {

147+

command: params.nodeExecPath ?? process.execPath,

148+

args: [path.join(repoRoot, "node_modules", "oxfmt", "bin", "oxfmt"), ...args],

149+

shell: false,

150+

};

151+

}

152+153+

export function runOxfmt(files, params = {}, deps = {}) {

154+

if (files.length === 0) {

155+

return;

156+

}

157+

const repoRoot = params.repoRoot ?? ROOT;

158+

const spawnSyncImpl = deps.spawnSync ?? spawnSync;

159+

const prefixArgs = ["--write", "--threads=1", "--config", path.join(repoRoot, ".oxfmtrc.jsonc")];

160+

for (const chunk of chunkFilesForCommand(

161+

files,

162+

prefixArgs,

163+

params.maxCommandLineBytes ?? DOCS_FORMAT_MAX_COMMAND_LINE_BYTES,

164+

)) {

165+

const invocation = resolveOxfmtInvocation([...prefixArgs, ...chunk], {

166+

comSpec: params.comSpec,

167+

existsSync: deps.existsSync,

168+

nodeExecPath: params.nodeExecPath,

169+

platform: params.platform,

170+

repoRoot,

171+

});

172+

const result = spawnSyncImpl(invocation.command, invocation.args, {

173+

cwd: repoRoot,

32174

encoding: "utf8",

33-

maxBuffer: 1024 * 1024 * 16,

34-

},

35-

);

175+

maxBuffer: DOCS_FORMAT_MAX_BUFFER_BYTES,

176+

shell: invocation.shell,

177+

windowsVerbatimArguments: invocation.windowsVerbatimArguments,

178+

});

3617937-

if (result.status !== 0) {

38-

const stderr = result.stderr.trim();

39-

throw new Error(`oxfmt failed${stderr ? `:\n${stderr}` : ""}`);

180+

if (result.error || result.status !== 0) {

181+

throw new Error(commandFailureMessage("oxfmt", result, invocation));

182+

}

40183

}

41184

}

4218543-

function repairFiles(root, files) {

186+

export function repairFiles(root, files) {

44187

const changed = [];

45188

for (const relativePath of files) {

46189

const absolutePath = path.join(root, relativePath);

@@ -55,50 +198,71 @@ function repairFiles(root, files) {

55198

return changed;

56199

}

5720058-

function copyDocsToTemp(files) {

201+

function copyDocsToTemp(root, files) {

59202

const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-docs-format-"));

60203

for (const relativePath of files) {

61-

const source = path.join(ROOT, relativePath);

204+

const source = path.join(root, relativePath);

62205

const target = path.join(tempRoot, relativePath);

63206

fs.mkdirSync(path.dirname(target), { recursive: true });

64207

fs.copyFileSync(source, target);

65208

}

66209

return tempRoot;

67210

}

6821169-

const changed = [];

70-

const files = docsFiles();

71-72-

if (CHECK) {

73-

const tempRoot = copyDocsToTemp(files);

74-

try {

75-

runOxfmt(files.map((relativePath) => path.join(tempRoot, relativePath)));

76-

repairFiles(tempRoot, files);

77-

for (const relativePath of files) {

78-

const raw = fs.readFileSync(path.join(ROOT, relativePath), "utf8");

79-

const formatted = fs.readFileSync(path.join(tempRoot, relativePath), "utf8");

80-

if (formatted !== raw) {

81-

changed.push(relativePath);

212+

export function formatDocs(params = {}, deps = {}) {

213+

const root = params.root ?? ROOT;

214+

const check = params.check ?? false;

215+

const changed = [];

216+

const files = docsFiles(root, deps);

217+218+

if (check) {

219+

const tempRoot = copyDocsToTemp(root, files);

220+

try {

221+

runOxfmt(

222+

files.map((relativePath) => path.join(tempRoot, relativePath)),

223+

{ ...params, repoRoot: root },

224+

deps,

225+

);

226+

repairFiles(tempRoot, files);

227+

for (const relativePath of files) {

228+

const raw = fs.readFileSync(path.join(root, relativePath), "utf8");

229+

const formatted = fs.readFileSync(path.join(tempRoot, relativePath), "utf8");

230+

if (formatted !== raw) {

231+

changed.push(relativePath);

232+

}

82233

}

234+

} finally {

235+

fs.rmSync(tempRoot, { recursive: true, force: true });

83236

}

84-

} finally {

85-

fs.rmSync(tempRoot, { recursive: true, force: true });

237+

} else {

238+

runOxfmt(files, { ...params, repoRoot: root }, deps);

239+

changed.push(...repairFiles(root, files));

86240

}

87-

} else {

88-

runOxfmt(files);

89-

changed.push(...repairFiles(ROOT, files));

241+242+

return {

243+

changed,

244+

fileCount: files.length,

245+

};

90246

}

9124792-

if (CHECK && changed.length > 0) {

93-

console.error(`Format issues found in ${changed.length} docs file(s):`);

94-

for (const relativePath of changed) {

95-

console.error(`- ${relativePath}`);

248+

function main() {

249+

const { changed, fileCount } = formatDocs({ check: CHECK, root: ROOT });

250+251+

if (CHECK && changed.length > 0) {

252+

console.error(`Format issues found in ${changed.length} docs file(s):`);

253+

for (const relativePath of changed) {

254+

console.error(`- ${relativePath}`);

255+

}

256+

process.exit(1);

257+

}

258+259+

if (changed.length > 0) {

260+

console.log(`Formatted ${changed.length} docs file(s).`);

261+

} else {

262+

console.log(`Docs formatting clean (${fileCount} files).`);

96263

}

97-

process.exit(1);

98264

}

99265100-

if (changed.length > 0) {

101-

console.log(`Formatted ${changed.length} docs file(s).`);

102-

} else {

103-

console.log(`Docs formatting clean (${files.length} files).`);

266+

if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {

267+

main();

104268

}