/** * OpenClaw Skill - AgentPulse Gate Integration * * Main implementation of the OpenClaw skill framework integration. * Provides startup hook, gate activation, and status reporting. * * @module openclaw-skill */ import { type Address } from "viem"; import { AgentPulseGate } from "@agent-pulse/sdk"; import type { GateConfig, ParsedThreshold, GateRuntimeStatus, GateStats, GateStatusOutput, OpenClawGate as IOpenClawGate, SkillStartupResult } from "./types.js"; /** * Validate gate configuration against JSON Schema */ export declare function validateGateConfig(config: unknown): config is GateConfig; /** * Parse duration string to seconds * @param threshold - Duration string (e.g., "24h", "30m") * @returns Parsed threshold or null if invalid */ export declare function parseThreshold(threshold: string): ParsedThreshold | null; /** * OpenClaw Gate implementation wrapping AgentPulse SDK */ declare class OpenClawGate implements IOpenClawGate { private gate; private config; private _status; private _stats; constructor(gate: AgentPulseGate, config: GateConfig); /** * Gate an incoming request * @param requesterAddr - Address of the requesting agent * @returns true if allowed, throws in strict mode if rejected */ gateIncoming(requesterAddr: Address): Promise; /** * Gate an outgoing request * @param targetAddr - Address of the target agent * @returns true if allowed, throws in strict mode if rejected */ gateOutgoing(targetAddr: Address): Promise; /** * Internal check implementation */ private performCheck; /** * Get current gate status */ getStatus(): GateRuntimeStatus; /** * Get gate statistics */ getStats(): GateStats; /** * Get full status output for orchestrator queries */ getStatusOutput(): GateStatusOutput; } /** * Skill startup hook - initializes AgentPulse SDK * * This MUST be called before any skill action/evaluator runs. * Gate initialization failure is surfaced based on mode: * - strict: Throws error, skill startup fails * - warn: Logs warning, continues without gating * - log: Silent, continues without gating * * @param config - Gate configuration from skill YAML * @returns Skill startup result with gate instance */ export declare function startup(config: unknown): Promise; /** * Middleware that activates gate BEFORE any skill action/evaluator * * Usage in skill definition: * ```typescript * actions: { * myAction: withGate((ctx, input) => { ... }) * } * ``` */ export declare function withGate(action: (ctx: { gate?: IOpenClawGate; }, input: TInput) => Promise, options?: { direction?: "incoming" | "outgoing"; address?: Address; }): (ctx: { gate?: IOpenClawGate; }, input: TInput & { from?: Address; to?: Address; }) => Promise; /** * Get gate status for orchestrator queries * @param gate - Gate instance (if initialized) * @returns Gate status output */ export declare function getGateStatus(gate?: IOpenClawGate): GateStatusOutput | null; export { OpenClawGate }; export type { GateConfig, GateStatusOutput, SkillStartupResult }; //# sourceMappingURL=index.d.ts.map