chore: remove legacy moltbot/clawdbot compatibility
What: - drop MOLTBOT_* and CLAWDBOT_* env wiring from HM + wrappers - update gateway log-dir patch to target current upstream logger.ts - update config options generator to require OpenClawSchema only - update hello-world plugin example env var + module path - rename RFC filename to remove moltbot naming Why: - upstream is OpenClaw; keep nix-openclaw opinionated + clean Tests: - bash -n scripts/update-pins.sh
This commit is contained in:
parent
011898d676
commit
f9ad193d28
@ -3,5 +3,5 @@
|
||||
This plugin is intentionally tiny.
|
||||
|
||||
Knobs
|
||||
- MOLTBOT_USER (optional): name to greet
|
||||
- OPENCLAW_USER (optional): name to greet
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
module github.com/acme/hello-world-moltbot
|
||||
module github.com/acme/hello-world-openclaw
|
||||
|
||||
go 1.22
|
||||
|
||||
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
name := os.Getenv("MOLTBOT_USER")
|
||||
name := os.Getenv("OPENCLAW_USER")
|
||||
if name == "" {
|
||||
name = "human"
|
||||
}
|
||||
|
||||
@ -154,14 +154,6 @@ let
|
||||
OPENCLAW_STATE_DIR = inst.stateDir;
|
||||
OPENCLAW_IMAGE_BACKEND = "sips";
|
||||
OPENCLAW_NIX_MODE = "1";
|
||||
MOLTBOT_CONFIG_PATH = inst.configPath;
|
||||
MOLTBOT_STATE_DIR = inst.stateDir;
|
||||
MOLTBOT_IMAGE_BACKEND = "sips";
|
||||
MOLTBOT_NIX_MODE = "1";
|
||||
CLAWDBOT_CONFIG_PATH = inst.configPath;
|
||||
CLAWDBOT_STATE_DIR = inst.stateDir;
|
||||
CLAWDBOT_IMAGE_BACKEND = "sips";
|
||||
CLAWDBOT_NIX_MODE = "1";
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -182,12 +174,6 @@ let
|
||||
"OPENCLAW_CONFIG_PATH=${inst.configPath}"
|
||||
"OPENCLAW_STATE_DIR=${inst.stateDir}"
|
||||
"OPENCLAW_NIX_MODE=1"
|
||||
"MOLTBOT_CONFIG_PATH=${inst.configPath}"
|
||||
"MOLTBOT_STATE_DIR=${inst.stateDir}"
|
||||
"MOLTBOT_NIX_MODE=1"
|
||||
"CLAWDBOT_CONFIG_PATH=${inst.configPath}"
|
||||
"CLAWDBOT_STATE_DIR=${inst.stateDir}"
|
||||
"CLAWDBOT_NIX_MODE=1"
|
||||
];
|
||||
StandardOutput = "append:${inst.logPath}";
|
||||
StandardError = "append:${inst.logPath}";
|
||||
|
||||
@ -80,5 +80,4 @@ if [ -n "$hasown_src" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
bash -e -c '. "$STDENV_SETUP"; makeWrapper "$NODE_BIN" "$out/bin/openclaw" --add-flags "$out/lib/openclaw/dist/index.js" --set-default OPENCLAW_NIX_MODE "1" --set-default MOLTBOT_NIX_MODE "1" --set-default CLAWDBOT_NIX_MODE "1"'
|
||||
ln -s "$out/bin/openclaw" "$out/bin/moltbot"
|
||||
bash -e -c '. "$STDENV_SETUP"; makeWrapper "$NODE_BIN" "$out/bin/openclaw" --add-flags "$out/lib/openclaw/dist/index.js" --set-default OPENCLAW_NIX_MODE "1"'
|
||||
|
||||
@ -4,9 +4,9 @@ if [ -f package.json ]; then
|
||||
"$REMOVE_PACKAGE_MANAGER_FIELD_SH" package.json
|
||||
fi
|
||||
|
||||
if [ -f src/logging.ts ]; then
|
||||
if ! grep -q "OPENCLAW_LOG_DIR" src/logging.ts; then
|
||||
sed -i 's/export const DEFAULT_LOG_DIR = "\/tmp\/moltbot";/export const DEFAULT_LOG_DIR = process.env.OPENCLAW_LOG_DIR ?? "\/tmp\/moltbot";/' src/logging.ts
|
||||
if [ -f src/logging/logger.ts ]; then
|
||||
if ! grep -q "OPENCLAW_LOG_DIR" src/logging/logger.ts; then
|
||||
sed -i 's/export const DEFAULT_LOG_DIR = "\/tmp\/openclaw";/export const DEFAULT_LOG_DIR = process.env.OPENCLAW_LOG_DIR ?? "\/tmp\/openclaw";/' src/logging/logger.ts
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@ -13,7 +13,6 @@ export HOME="$(mktemp -d)"
|
||||
export TMPDIR="${HOME}/tmp"
|
||||
mkdir -p "$TMPDIR"
|
||||
export OPENCLAW_LOG_DIR="${TMPDIR}/openclaw-logs"
|
||||
export MOLTBOT_LOG_PATH="${OPENCLAW_LOG_DIR}/openclaw-gateway.log"
|
||||
mkdir -p "$OPENCLAW_LOG_DIR"
|
||||
mkdir -p /tmp/openclaw || true
|
||||
chmod 700 /tmp/openclaw || true
|
||||
|
||||
@ -17,9 +17,9 @@ const schemaUrl = pathToFileURL(schemaPath).href;
|
||||
|
||||
const loadSchema = async (): Promise<Record<string, unknown>> => {
|
||||
const mod = await import(schemaUrl);
|
||||
const schema = mod.OpenClawSchema ?? mod.MoltbotSchema;
|
||||
const schema = mod.OpenClawSchema;
|
||||
if (!schema || typeof schema.toJSONSchema !== "function") {
|
||||
console.error(`OpenClawSchema/MoltbotSchema not found at ${schemaPath}`);
|
||||
console.error(`OpenClawSchema not found at ${schemaPath}`);
|
||||
process.exit(1);
|
||||
}
|
||||
return schema.toJSONSchema({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user