import { ContextGraph, type Session, type ChainOpts } from "@clawtrail/context-graph"; import { MapperRegistry } from "./mappers/MapperRegistry.js"; import { type OpenClawSessionContext } from "./hooks/lifecycle.js"; import { type ToolCallEvent } from "./hooks/toolCall.js"; import { summarizeSession } from "./tools/summarize.js"; export interface AdapterConfig { /** Enable/disable the adapter */ enabled?: boolean; /** Path to context-graph storage */ contextGraphRoot?: string; /** Agent ID */ agentId?: string; /** Path to policy file */ policyPath?: string; /** Enable test detection from shell output */ detectTests?: boolean; /** Enable build detection from shell output */ detectBuilds?: boolean; /** Enable HTTP request detection from shell output (curl, wget, httpie) */ detectHttp?: boolean; /** Path to signing key (Ed25519 PEM). Auto-generated if missing. */ signingKeyPath?: string; } export interface SignedSubmission { /** The public graph payload */ payload: object; /** SHA-256 hash of the JSON-serialized payload */ payloadHash: string; /** Ed25519 signature of the payload hash */ signature: string; /** Public key (PEM) for verification */ publicKey: string; /** Agent ID */ agentId: string; /** Session ID */ sessionId: string; } export declare class OpenClawAdapter { readonly cg: ContextGraph; readonly mappers: MapperRegistry; private lifecycleHandlers; private toolCallHandlers; private llmOutputHandlers; private config; private privateKey; private publicKey; constructor(config?: AdapterConfig); /** * Initialize signing keys. If a key path is configured and exists, * load it. Otherwise, generate a new Ed25519 keypair. */ initSigning(): Promise; /** * Sign a submission payload — produces a SignedSubmission that can * be sent to the ClawTrail API. */ signSubmission(sessionId: string, payload: object): Promise; /** * Verify a signed submission. */ static verifySubmission(submission: SignedSubmission): boolean; /** Called when an OpenClaw session starts */ onSessionStart(ctx: OpenClawSessionContext): Promise; /** Called when an OpenClaw session ends */ onSessionEnd(ctx: OpenClawSessionContext): Promise; /** Called before a tool call */ onBeforeToolCall(event: ToolCallEvent, ctx: OpenClawSessionContext): Promise; /** Called after a tool call */ onAfterToolCall(event: ToolCallEvent, ctx: OpenClawSessionContext): Promise; /** Called when LLM produces output — extracts HTTP references */ onLlmOutput(content: string, ctx: OpenClawSessionContext): Promise; /** * Log an external event into an active session. * Used by register.ts to inject AGENT_ACTION events fetched from * the ClawTrail decisions API at session summary time. */ logExternalEvent(sessionId: string, input: import("@clawtrail/context-graph").EventInput): Promise; /** Get current session status */ getStatus(sessionId?: string): Promise; /** Summarize and optionally sign the current session */ summarizeAndSign(sessionId: string, chainOpts?: ChainOpts): Promise<{ summary: Awaited>; signed?: SignedSubmission; }>; } //# sourceMappingURL=OpenClawAdapter.d.ts.map