import crypto from "node:crypto"; import fs from "node:fs/promises"; import path from "node:path"; import { SILENT_REPLY_TOKEN } from "../auto-reply/tokens.js"; import type { CliDeps } from "../cli/deps.types.js"; import { agentCommand } from "../commands/agent.js"; import {
resolveAgentIdFromSessionKey,
resolveAgentMainSessionKey,
resolveMainSessionKey,
} from "../config/sessions/main-session.js"; import { resolveStorePath } from "../config/sessions/paths.js"; import { loadSessionStore, updateSessionStore } from "../config/sessions/store.js"; import type { SessionEntry } from "../config/sessions/types.js"; import type { OpenClawConfig } from "../config/types.openclaw.js"; import { formatErrorMessage } from "../infra/errors.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; import { type RuntimeEnv, defaultRuntime } from "../runtime.js";
function generateBootSessionId(): string { const now = new Date(); const ts = now.toISOString().replace(/[:.]/g, "-").replace("T", "_").replace("Z", ""); const suffix = crypto.randomUUID().slice(0, 8); return `boot-${ts}-${suffix}`;
}
function buildBootPrompt(content: string) { return [ "You are running a boot check. Follow BOOT.md instructions exactly.", "", "BOOT.md:",
content, "", "If BOOT.md asks you to send a message, use the message tool (action=send with channel + target).", "Use the `target` field (not `to`) for message tool destinations.",
`After sending with the message tool, reply with ONLY: ${SILENT_REPLY_TOKEN}.`,
`If nothing needs attention, reply with ONLY: ${SILENT_REPLY_TOKEN}.`,
].join("\n");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.