mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
docs: document repository scripts
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// Cron Mcp Cleanup Docker Client script supports OpenClaw repository automation.
|
||||
import { execFile } from "node:child_process";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Cron Mcp Cleanup Seed script supports OpenClaw repository automation.
|
||||
import fs from "node:fs/promises";
|
||||
import { createRequire } from "node:module";
|
||||
import os from "node:os";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Session Log Mentions script supports OpenClaw repository automation.
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { readPositiveIntEnv } from "./env-limits.mjs";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Temp State Dir script supports OpenClaw repository automation.
|
||||
import { rmSync } from "node:fs";
|
||||
import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Mcp Channel Limits script supports OpenClaw repository automation.
|
||||
import { readPositiveIntEnv } from "./lib/env-limits.mjs";
|
||||
|
||||
export type McpChannelLimits = {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Mcp Channels Docker Client script supports OpenClaw repository automation.
|
||||
import { randomUUID } from "node:crypto";
|
||||
import {
|
||||
assert,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Mcp Channels Seed script supports OpenClaw repository automation.
|
||||
import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Mcp Client Temp State script supports OpenClaw repository automation.
|
||||
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Mcp Code Mode Gateway Client script supports OpenClaw repository automation.
|
||||
import path from "node:path";
|
||||
import { setTimeout as setNodeTimeout, clearTimeout as clearNodeTimeout } from "node:timers";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Mcp Code Mode Gateway Seed script supports OpenClaw repository automation.
|
||||
import fs from "node:fs/promises";
|
||||
import { createRequire } from "node:module";
|
||||
import os from "node:os";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Mcp Connect Timeout script supports OpenClaw repository automation.
|
||||
type McpConnectTransport = {
|
||||
close?(): Promise<void> | void;
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Mcp Websocket Open script supports OpenClaw repository automation.
|
||||
type WebSocketOpenHandle = {
|
||||
close?: () => void;
|
||||
off?: (event: "open" | "error" | "close", listener: (...args: unknown[]) => void) => void;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Openai Image Auth Docker Client script supports OpenClaw repository automation.
|
||||
import http from "node:http";
|
||||
import type { AddressInfo } from "node:net";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Agent Workspace script supports OpenClaw repository automation.
|
||||
export function posixAgentWorkspaceScript(purpose: string): string {
|
||||
return `set -eu
|
||||
workspace="\${OPENCLAW_WORKSPACE_DIR:-$HOME/.openclaw/workspace}"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Common helper supports OpenClaw script workflows.
|
||||
export * from "./filesystem.ts";
|
||||
export * from "./env-limits.ts";
|
||||
export * from "./host-command.ts";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Env Limits script supports OpenClaw repository automation.
|
||||
import { die } from "./host-command.ts";
|
||||
|
||||
const positiveIntPattern = /^[1-9]\d*$/u;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Filesystem script supports OpenClaw repository automation.
|
||||
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { access, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Guest Transports script supports OpenClaw repository automation.
|
||||
import { run } from "./host-command.ts";
|
||||
import type { PhaseRunner } from "./phase-runner.ts";
|
||||
import { encodePowerShell, psSingleQuote } from "./powershell.ts";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Host Command script supports OpenClaw repository automation.
|
||||
import { spawn, spawnSync, type SpawnOptions, type SpawnSyncReturns } from "node:child_process";
|
||||
import { writeFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Host Server script supports OpenClaw repository automation.
|
||||
import { spawn, type ChildProcessWithoutNullStreams } from "node:child_process";
|
||||
import { createServer } from "node:http";
|
||||
import { createConnection } from "node:net";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Lane Runner script supports OpenClaw repository automation.
|
||||
import { warn } from "./host-command.ts";
|
||||
|
||||
export type SmokeLane = "fresh" | "upgrade";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env -S pnpm tsx
|
||||
// Linux Smoke script supports OpenClaw repository automation.
|
||||
import { mkdir, readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Macos Discord script supports OpenClaw repository automation.
|
||||
import { readFile, writeFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import type { MacosGuest } from "./guest-transports.ts";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env -S pnpm tsx
|
||||
// Macos Smoke script supports OpenClaw repository automation.
|
||||
import { readFile, rm } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Npm Update Scripts script supports OpenClaw repository automation.
|
||||
import { posixAgentWorkspaceScript, windowsAgentWorkspaceScript } from "./agent-workspace.ts";
|
||||
import { shellQuote } from "./host-command.ts";
|
||||
import { posixProviderOnlyPluginIsolationScript } from "./plugin-isolation.ts";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env -S pnpm tsx
|
||||
// Npm Update Smoke script supports OpenClaw repository automation.
|
||||
import { spawn } from "node:child_process";
|
||||
import { appendFileSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { readFile, rm } from "node:fs/promises";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Package Artifact script supports OpenClaw repository automation.
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { copyFile, mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Parallels Vm script supports OpenClaw repository automation.
|
||||
import { die, run, say, warn } from "./host-command.ts";
|
||||
|
||||
const PRLCTL_STATUS_TIMEOUT_MS = 30_000;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Phase Runner script supports OpenClaw repository automation.
|
||||
import { appendFileSync } from "node:fs";
|
||||
import { writeFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Plugin Isolation script supports OpenClaw repository automation.
|
||||
import { shellQuote } from "./host-command.ts";
|
||||
import { providerIdFromModelId } from "./provider-auth.ts";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Powershell script supports OpenClaw repository automation.
|
||||
import {
|
||||
configPathMapKey,
|
||||
modelProviderConfigBatchJson,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Provider Auth script supports OpenClaw repository automation.
|
||||
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Smoke Common helper supports OpenClaw script workflows.
|
||||
import { readFile, rm } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { run, say } from "./host-command.ts";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Snapshots script supports OpenClaw repository automation.
|
||||
import { die, run } from "./host-command.ts";
|
||||
import type { SnapshotInfo } from "./types.ts";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Types script supports OpenClaw repository automation.
|
||||
export type Provider = "openai" | "anthropic" | "minimax";
|
||||
export type Mode = "fresh" | "upgrade" | "both";
|
||||
export type Platform = "macos" | "windows" | "linux";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Update Job Timeout script supports OpenClaw repository automation.
|
||||
interface TimedUpdateJobOptions {
|
||||
append(this: void, chunk: string): void;
|
||||
label: string;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Windows Git script supports OpenClaw repository automation.
|
||||
import path from "node:path";
|
||||
import type { WindowsGuest } from "./guest-transports.ts";
|
||||
import { die, run, say } from "./host-command.ts";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env -S pnpm tsx
|
||||
// Windows Smoke script supports OpenClaw repository automation.
|
||||
import path from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import { windowsAgentWorkspaceScript } from "./agent-workspace.ts";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Telegram Bot Api script supports OpenClaw repository automation.
|
||||
import { readBoundedResponseText } from "../lib/bounded-response.ts";
|
||||
import { readPositiveIntEnv } from "./lib/env-limits.mjs";
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env -S node --import tsx
|
||||
// Telegram User Crabbox Proof script supports OpenClaw repository automation.
|
||||
|
||||
import { type ChildProcess, spawn, type SpawnOptionsWithoutStdio } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Telegram User Credential Io script supports OpenClaw repository automation.
|
||||
import { spawn } from "node:child_process";
|
||||
import { readBoundedResponseText } from "../lib/bounded-response.ts";
|
||||
|
||||
@@ -36,11 +37,15 @@ function readKillGraceMs() {
|
||||
return 5_000;
|
||||
}
|
||||
if (!/^\d+$/u.test(raw)) {
|
||||
throw new Error(`OPENCLAW_QA_CREDENTIAL_KILL_GRACE_MS must be a non-negative integer; got: ${raw}`);
|
||||
throw new Error(
|
||||
`OPENCLAW_QA_CREDENTIAL_KILL_GRACE_MS must be a non-negative integer; got: ${raw}`,
|
||||
);
|
||||
}
|
||||
const parsed = Number(raw);
|
||||
if (!Number.isSafeInteger(parsed)) {
|
||||
throw new Error(`OPENCLAW_QA_CREDENTIAL_KILL_GRACE_MS must be a non-negative integer; got: ${raw}`);
|
||||
throw new Error(
|
||||
`OPENCLAW_QA_CREDENTIAL_KILL_GRACE_MS must be a non-negative integer; got: ${raw}`,
|
||||
);
|
||||
}
|
||||
return parsed;
|
||||
}
|
||||
@@ -183,7 +188,9 @@ export function runCommand(
|
||||
return;
|
||||
}
|
||||
if (forwardedSignalExitCode !== undefined) {
|
||||
activeChildTree.unregister({ finishForwardedSignal: !childProcessTreeMayStillExist(child) });
|
||||
activeChildTree.unregister({
|
||||
finishForwardedSignal: !childProcessTreeMayStillExist(child),
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (timedOutError && killTimer && childProcessTreeMayStillExist(child)) {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Telegram User Credential Paths script supports OpenClaw repository automation.
|
||||
import { chmod, mkdir, writeFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env -S node --import tsx
|
||||
// Telegram User Credential script supports OpenClaw repository automation.
|
||||
|
||||
import { createHash } from "node:crypto";
|
||||
import { copyFile, mkdir, mkdtemp, readFile, rm, unlink, writeFile } from "node:fs/promises";
|
||||
|
||||
Reference in New Issue
Block a user