/** * SwarmOrchestrator - Standalone TypeScript Utilities * * This module provides TypeScript/Node.js utilities for the Swarm Orchestrator skill. * It can be used alongside the Python scripts or as an alternative implementation. * * NOTE: This is a standalone library - it does NOT import from 'openclaw-core'. * OpenClaw integration happens through the SKILL.md instructions and Python scripts. * * @module SwarmOrchestrator * @version 2.0.0 * @license MIT */ export interface TaskPayload { instruction: string; context?: Record; constraints?: string[]; expectedOutput?: string; } export interface HandoffMessage { handoffId: string; sourceAgent: string; targetAgent: string; taskType: 'delegate' | 'collaborate' | 'validate'; payload: TaskPayload; metadata: { priority: number; deadline: number; parentTaskId: string | null; }; } export interface PermissionGrant { granted: boolean; token: string | null; expiresAt: string | null; restrictions: string[]; reason?: string; scores?: { justification: number; trust: number | null; risk: number | null; weighted?: number; }; } export interface BlackboardEntry { key: string; value: unknown; source_agent: string; timestamp: string; ttl: number | null; } export interface ActiveGrant { token: string; agent_id: string; resource_type: string; scope: string | null; expires_at: string; restrictions: string[]; granted_at: string; } export type ResourceType = 'SAP_API' | 'FINANCIAL_API' | 'EXTERNAL_SERVICE' | 'DATA_EXPORT'; declare const CONFIG: { blackboardPath: string; dataDir: string; grantTokenTTLMinutes: number; defaultTrustLevels: Record; baseRisks: Record; restrictions: Record; }; export declare class SharedBlackboard { private path; private cache; constructor(basePath?: string); private initialize; private loadFromDisk; private persistToDisk; private isExpired; read(key: string): BlackboardEntry | null; write(key: string, value: unknown, sourceAgent: string, ttl?: number): BlackboardEntry; delete(key: string): boolean; exists(key: string): boolean; listKeys(): string[]; getSnapshot(): Record; } export declare class AuthGuardian { private basePath; private grantsFile; private auditLog; constructor(basePath?: string); private loadGrants; private saveGrants; private logAudit; private scoreJustification; private assessRisk; private generateToken; requestPermission(agentId: string, resourceType: ResourceType, justification: string, scope?: string): PermissionGrant; validateToken(token: string): { valid: boolean; grant?: ActiveGrant; reason?: string; }; revokeToken(token: string): boolean; getActiveGrants(): ActiveGrant[]; } export declare class DataEncryptor { private key; private algorithm; constructor(secretKey: string); encrypt(data: string): string; decrypt(encryptedData: string): string | null; encryptObject(obj: unknown): string; decryptObject(encryptedData: string): T | null; } export declare class HandoffBuilder { /** * Create a handoff message for task delegation */ static createHandoff(sourceAgent: string, targetAgent: string, payload: TaskPayload, options?: { taskType?: 'delegate' | 'collaborate' | 'validate'; priority?: number; timeoutMs?: number; parentTaskId?: string; }): HandoffMessage; /** * Format handoff message for sessions_send */ static formatForSessionSend(handoff: HandoffMessage): string; /** * Parse handoff message from text */ static parseHandoff(text: string): Partial | null; } export { CONFIG }; export declare function getBlackboard(basePath?: string): SharedBlackboard; export declare function getAuthGuardian(basePath?: string): AuthGuardian; //# sourceMappingURL=swarm-utils.d.ts.map