/** * @signetai/connector-openclaw * * Signet connector for OpenClaw (and its earlier names: clawdbot, moltbot). * * Unlike Claude Code and OpenCode, OpenClaw reads ~/.agents/AGENTS.md * directly — so no generated output file is needed. Instead, this * connector can patch OpenClaw config to: * 1. Point `agents.defaults.workspace` at ~/.agents * 2. Enable the `signet-memory` internal hook entry * * It also installs hook handler files that OpenClaw loads for * /remember, /recall, and /context commands. * * @example * ```typescript * import { OpenClawConnector } from '@signetai/connector-openclaw'; * * const connector = new OpenClawConnector(); * await connector.install('~/.agents'); * ``` */ import { BaseConnector, type InstallResult, type UninstallResult } from "@signetai/connector-base"; export interface OpenClawInstallOptions { configureWorkspace?: boolean; configureHooks?: boolean; runtimePath?: "plugin" | "legacy"; } export type OpenClawRuntimeState = "plugin" | "legacy" | "dual" | null; /** * Connector for OpenClaw (and its historical names: clawdbot, moltbot). * * Idempotent — safe to run multiple times. */ export declare class OpenClawConnector extends BaseConnector { readonly name = "OpenClaw"; readonly harnessId = "openclaw"; /** * Install the connector. * * - Patches OpenClaw hook entries by default * - Patches OpenClaw workspace only when explicitly requested * - Installs hook handler files under `/hooks/agent-memory/` * * **`runtimePath` default changed in 0.53:** The default is now `"plugin"` * (automatic per-prompt memory injection via the OpenClaw plugin system) * instead of the old `"legacy"` (manual `/remember`/`/recall` commands * only). SDK callers that relied on the legacy path must now pass * `{ runtimePath: "legacy" }` explicitly. */ install(basePath: string, options?: OpenClawInstallOptions): Promise; /** * Patch OpenClaw configs to set workspace only. */ configureWorkspace(basePath: string): Promise; /** * Sync a multi-agent roster into the `agents.list` section of all * discovered OpenClaw configs. Only agents that include `"openclaw"` in * their `harnesses` array (or have no harnesses specified) are written. */ syncMultipleAgents(roster: ReadonlyArray<{ name: string; harnesses?: ReadonlyArray; skills?: ReadonlyArray; }>, basePath: string): Promise; /** * Return all existing OpenClaw config paths discovered on this machine. */ getDiscoveredConfigPaths(): string[]; /** * Return normalized workspace paths declared in discovered OpenClaw configs. * * Paths are expanded (`~` -> home) and de-duplicated. */ getDiscoveredWorkspacePaths(): string[]; /** * Uninstall the connector. * * Disables both legacy hooks and plugin entries, removes hook handler files. */ uninstall(): Promise; private removePluginFromAllow; /** * Check whether any OpenClaw config has signet enabled * (via legacy hooks or plugin entry). */ isInstalled(): boolean; getRuntimeState(): OpenClawRuntimeState; getConfiguredRuntimePath(): "plugin" | "legacy" | null; /** * Get the primary config path (first existing config, or default). */ getConfigPath(): string; /** * Reject workspace paths that point into temp directories. * Prevents accidental persistence of test/ephemeral paths * in production OpenClaw configs. */ private validateWorkspacePath; /** * Check that a resolved workspace path exists and belongs to * the current user's home directory. Returns warnings (non-fatal) * so callers can surface them without blocking the install. */ private checkWorkspaceOwnership; private getConfigCandidates; /** * Patch configs with plugin entry using the object format: * plugins.entries["signet-memory-openclaw"] = { enabled, hooks, config } * * Migrates: * - Legacy array-style plugins (["signet-memory"] -> { entries: {...} }) * - Top-level `signet: { daemonUrl }` key * - Old plugin name "signet-memory" -> "signet-memory-openclaw" */ private patchAllConfigsWithPlugin; private patchAllConfigs; private patchConfig; /** * Narrow config-only update: add `searchPath` to `plugins.load.paths` and * ensure `plugins.allow` trusts `signet-memory-openclaw` in all discovered * configs without re-running the full install flow. * * `searchPath` should be the **parent** directory of the plugin package * (e.g. `…/@signetai/`) so OpenClaw can find `signet-memory-openclaw` * as a subdirectory. */ patchLoadPaths(searchPath: string): { patched: string[]; warnings: string[]; }; /** * Create the hook handler files that OpenClaw loads for * /remember, /recall, and /context commands. * * This is the canonical implementation; cli.ts delegates here. */ installHookFiles(basePath: string): string[]; /** Detect the indentation style used in a JSON string. */ private detectIndent; private getHomeDir; } /** Create an OpenClaw connector instance. */ export declare function createConnector(): OpenClawConnector; export default OpenClawConnector; //# sourceMappingURL=index.d.ts.map