@sekuire/sdk 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -0
- package/dist/agent.d.ts +186 -0
- package/dist/client.d.ts +37 -0
- package/dist/compliance.d.ts +236 -0
- package/dist/config/loader.d.ts +138 -0
- package/dist/crypto.d.ts +60 -0
- package/dist/identity.d.ts +9 -0
- package/dist/index.d.ts +1987 -0
- package/dist/index.esm.js +20089 -0
- package/dist/index.js +20166 -0
- package/dist/llm/anthropic.d.ts +18 -0
- package/dist/llm/google.d.ts +18 -0
- package/dist/llm/index.d.ts +43 -0
- package/dist/llm/ollama.d.ts +17 -0
- package/dist/llm/openai.d.ts +18 -0
- package/dist/llm/types.d.ts +84 -0
- package/dist/logger.d.ts +92 -0
- package/dist/memory/base.d.ts +20 -0
- package/dist/memory/in-memory.d.ts +9 -0
- package/dist/memory/index.d.ts +14 -0
- package/dist/memory/postgres.d.ts +24 -0
- package/dist/memory/redis.d.ts +23 -0
- package/dist/new-agent.d.ts +134 -0
- package/dist/policy-enforcer.d.ts +20 -0
- package/dist/policy.d.ts +20 -0
- package/dist/server.d.ts +33 -0
- package/dist/tools/agent-delegation.d.ts +22 -0
- package/dist/tools/agent-invocation.d.ts +90 -0
- package/dist/tools/base.d.ts +40 -0
- package/dist/tools/calculator.d.ts +5 -0
- package/dist/tools/compliance-operations.d.ts +40 -0
- package/dist/tools/data-formats.d.ts +36 -0
- package/dist/tools/data-operations.d.ts +17 -0
- package/dist/tools/directory-operations.d.ts +46 -0
- package/dist/tools/file-operations.d.ts +46 -0
- package/dist/tools/http-request.d.ts +5 -0
- package/dist/tools/index.d.ts +96 -0
- package/dist/tools/network-operations.d.ts +52 -0
- package/dist/tools/pattern-parser.d.ts +25 -0
- package/dist/tools/system-operations.d.ts +24 -0
- package/dist/tools/utility-operations.d.ts +44 -0
- package/dist/tools/verification-status.d.ts +40 -0
- package/dist/tools/web-search.d.ts +5 -0
- package/dist/types/policy.d.ts +13 -0
- package/dist/types.d.ts +170 -0
- package/dist/utils.d.ts +68 -0
- package/package.json +99 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1987 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 🛡️ Sekuire Logger - Asynchronous Event Logging for TypeScript SDK
|
|
5
|
+
*
|
|
6
|
+
* Provides batched, fire-and-forget logging to Sekuire Registry API
|
|
7
|
+
*/
|
|
8
|
+
type EventType = "tool_execution" | "model_call" | "policy_violation" | "policy_check" | "network_access" | "file_access" | "health";
|
|
9
|
+
type Severity = "debug" | "info" | "warn" | "error";
|
|
10
|
+
interface LoggerConfig$1 {
|
|
11
|
+
sekuireId: string;
|
|
12
|
+
apiBaseUrl: string;
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
sessionId?: string;
|
|
15
|
+
workspaceId?: string;
|
|
16
|
+
environment?: string;
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
batchSize?: number;
|
|
19
|
+
flushInterval?: number;
|
|
20
|
+
}
|
|
21
|
+
interface EventLog {
|
|
22
|
+
sekuire_id: string;
|
|
23
|
+
session_id: string;
|
|
24
|
+
workspace_id?: string;
|
|
25
|
+
event_type: EventType;
|
|
26
|
+
severity: Severity;
|
|
27
|
+
event_timestamp: string;
|
|
28
|
+
event_data: Record<string, any>;
|
|
29
|
+
metadata: Record<string, any>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Asynchronous logger for Sekuire compliance events
|
|
33
|
+
*
|
|
34
|
+
* Features:
|
|
35
|
+
* - Buffered batching (flush every N events or X seconds)
|
|
36
|
+
* - Fire-and-forget (non-blocking)
|
|
37
|
+
* - Health heartbeat tracking
|
|
38
|
+
* - Graceful shutdown
|
|
39
|
+
*/
|
|
40
|
+
declare class SekuireLogger {
|
|
41
|
+
private config;
|
|
42
|
+
private buffer;
|
|
43
|
+
private flushTimer?;
|
|
44
|
+
private heartbeatTimer?;
|
|
45
|
+
private isFlushing;
|
|
46
|
+
private client;
|
|
47
|
+
private readonly sdkVersion;
|
|
48
|
+
constructor(config: LoggerConfig$1);
|
|
49
|
+
/**
|
|
50
|
+
* Log an event (buffered, non-blocking)
|
|
51
|
+
*/
|
|
52
|
+
logEvent(eventType: EventType, severity: Severity, eventData: Record<string, any>): void;
|
|
53
|
+
/**
|
|
54
|
+
* Flush buffer to API (fire-and-forget)
|
|
55
|
+
*/
|
|
56
|
+
flush(): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Send health heartbeat to API
|
|
59
|
+
*/
|
|
60
|
+
private sendHealthHeartbeat;
|
|
61
|
+
/**
|
|
62
|
+
* Start flush timer (every N milliseconds)
|
|
63
|
+
*/
|
|
64
|
+
private startFlushTimer;
|
|
65
|
+
/**
|
|
66
|
+
* Start heartbeat timer (every 30 seconds)
|
|
67
|
+
*/
|
|
68
|
+
private startHeartbeatTimer;
|
|
69
|
+
/**
|
|
70
|
+
* Stop timers
|
|
71
|
+
*/
|
|
72
|
+
private stopTimers;
|
|
73
|
+
/**
|
|
74
|
+
* Shutdown logger gracefully
|
|
75
|
+
* - Stops timers
|
|
76
|
+
* - Flushes remaining events
|
|
77
|
+
* - Safe to call multiple times
|
|
78
|
+
*/
|
|
79
|
+
shutdown(): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Get logger status for debugging
|
|
82
|
+
*/
|
|
83
|
+
getStatus(): {
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
bufferedEvents: number;
|
|
86
|
+
sessionId: string;
|
|
87
|
+
environment: string;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Enable/disable logging at runtime
|
|
91
|
+
*/
|
|
92
|
+
setEnabled(enabled: boolean): void;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 🛡️ Sekuire Compliance Enforcement System for TypeScript
|
|
97
|
+
*
|
|
98
|
+
* Runtime compliance enforcement that blocks all unauthorized behavior.
|
|
99
|
+
* Everything blocked unless explicitly allowed in sekuire.yaml.
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
interface ComplianceViolation {
|
|
103
|
+
timestamp: Date;
|
|
104
|
+
category: string;
|
|
105
|
+
message: string;
|
|
106
|
+
details: Record<string, any>;
|
|
107
|
+
agentId: string;
|
|
108
|
+
}
|
|
109
|
+
declare class ComplianceError extends Error {
|
|
110
|
+
readonly category: string;
|
|
111
|
+
readonly details: Record<string, any>;
|
|
112
|
+
constructor(message: string, category?: string, details?: Record<string, any>);
|
|
113
|
+
}
|
|
114
|
+
declare class NetworkComplianceError extends ComplianceError {
|
|
115
|
+
constructor(message: string, details?: Record<string, any>);
|
|
116
|
+
}
|
|
117
|
+
declare class FileAccessError extends ComplianceError {
|
|
118
|
+
constructor(message: string, details?: Record<string, any>);
|
|
119
|
+
}
|
|
120
|
+
declare class ToolUsageError extends ComplianceError {
|
|
121
|
+
constructor(message: string, details?: Record<string, any>);
|
|
122
|
+
}
|
|
123
|
+
declare class ContentPolicyError extends ComplianceError {
|
|
124
|
+
constructor(message: string, details?: Record<string, any>);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* 🔒 Runtime compliance enforcement system
|
|
128
|
+
*
|
|
129
|
+
* Enforces all rules defined in sekuire.yaml:
|
|
130
|
+
* - Network access control
|
|
131
|
+
* - File system restrictions
|
|
132
|
+
* - Tool usage limits
|
|
133
|
+
* - Content filtering
|
|
134
|
+
* - Environment variable access
|
|
135
|
+
*/
|
|
136
|
+
declare class ComplianceMonitor {
|
|
137
|
+
private configPath;
|
|
138
|
+
private config;
|
|
139
|
+
private violations;
|
|
140
|
+
private logger?;
|
|
141
|
+
private networkAllowSet;
|
|
142
|
+
private networkBlockSet;
|
|
143
|
+
private filesReadSet;
|
|
144
|
+
private filesWriteSet;
|
|
145
|
+
private filesBlockPatterns;
|
|
146
|
+
private envAllowSet;
|
|
147
|
+
private envBlockSet;
|
|
148
|
+
private allowedToolsSet;
|
|
149
|
+
private toolBlockPatterns;
|
|
150
|
+
private inputBlockPatterns;
|
|
151
|
+
private outputBlockPatterns;
|
|
152
|
+
private allowedModelsSet;
|
|
153
|
+
private networkCache;
|
|
154
|
+
private contentCache;
|
|
155
|
+
private readonly maxCacheSize;
|
|
156
|
+
constructor(configPath?: string, logger?: SekuireLogger);
|
|
157
|
+
private loadConfig;
|
|
158
|
+
private buildIndexes;
|
|
159
|
+
private loadAllowedTools;
|
|
160
|
+
/**
|
|
161
|
+
* 🌐 Check if network access is allowed
|
|
162
|
+
*
|
|
163
|
+
* @param url Target URL
|
|
164
|
+
* @param method HTTP method (GET, POST, etc.)
|
|
165
|
+
* @throws NetworkComplianceError If access is blocked
|
|
166
|
+
*/
|
|
167
|
+
checkNetworkAccess(url: string, method?: string): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Create a safe fetch function with compliance enforcement
|
|
170
|
+
*/
|
|
171
|
+
createSafeFetch(originalFetch?: typeof fetch): typeof fetch;
|
|
172
|
+
/**
|
|
173
|
+
* 📁 Check if file access is allowed
|
|
174
|
+
*
|
|
175
|
+
* @param filePath File path
|
|
176
|
+
* @param mode 'read', 'write', 'execute'
|
|
177
|
+
* @throws FileAccessError If access is blocked
|
|
178
|
+
*/
|
|
179
|
+
checkFileAccess(filePath: string, mode?: "read" | "write" | "execute"): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Safe file reading with compliance check
|
|
182
|
+
*/
|
|
183
|
+
safeReadFile(filePath: string, encoding?: BufferEncoding): string;
|
|
184
|
+
/**
|
|
185
|
+
* Safe file writing with compliance check
|
|
186
|
+
*/
|
|
187
|
+
safeWriteFile(filePath: string, data: string | Buffer, encoding?: BufferEncoding): void;
|
|
188
|
+
/**
|
|
189
|
+
* 🔐 Check if environment variable access is allowed
|
|
190
|
+
*
|
|
191
|
+
* @param varName Environment variable name
|
|
192
|
+
* @throws ComplianceError If access is blocked
|
|
193
|
+
*/
|
|
194
|
+
checkEnvAccess(varName: string): boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Safe environment variable access
|
|
197
|
+
*/
|
|
198
|
+
safeGetEnv(varName: string, defaultValue?: string): string | undefined;
|
|
199
|
+
/**
|
|
200
|
+
* 🛠️ Check if tool usage is allowed
|
|
201
|
+
*
|
|
202
|
+
* @param toolName Name of the tool
|
|
203
|
+
* @param codeSnippet Code snippet for pattern checking
|
|
204
|
+
* @throws ToolUsageError If tool usage is blocked
|
|
205
|
+
*/
|
|
206
|
+
checkToolUsage(toolName: string, codeSnippet?: string): boolean;
|
|
207
|
+
/**
|
|
208
|
+
* 💬 Check input content for policy violations
|
|
209
|
+
*
|
|
210
|
+
* @param content Input content to check
|
|
211
|
+
* @throws ContentPolicyError If content violates policy
|
|
212
|
+
*/
|
|
213
|
+
checkInputContent(content: string): boolean;
|
|
214
|
+
/**
|
|
215
|
+
* 📤 Check output content for policy violations
|
|
216
|
+
*
|
|
217
|
+
* @param content Output content to check
|
|
218
|
+
* @throws ContentPolicyError If content violates policy
|
|
219
|
+
*/
|
|
220
|
+
checkOutputContent(content: string): boolean;
|
|
221
|
+
private checkContent;
|
|
222
|
+
/**
|
|
223
|
+
* 🤖 Check AI model usage compliance
|
|
224
|
+
*
|
|
225
|
+
* @param model Model name
|
|
226
|
+
* @param temperature Temperature setting
|
|
227
|
+
* @param maxTokens Max tokens setting
|
|
228
|
+
* @throws ComplianceError If model usage violates rules
|
|
229
|
+
*/
|
|
230
|
+
checkModelUsage(model: string, temperature?: number, maxTokens?: number): boolean;
|
|
231
|
+
/**
|
|
232
|
+
* 🔢 Generate BLAKE3 hash for content integrity checking
|
|
233
|
+
*/
|
|
234
|
+
hashContent(content: string): string;
|
|
235
|
+
/**
|
|
236
|
+
* Verify file hasn't been modified
|
|
237
|
+
*/
|
|
238
|
+
checkFileIntegrity(filePath: string, expectedHash: string): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Log compliance violation
|
|
241
|
+
*/
|
|
242
|
+
private logViolation;
|
|
243
|
+
/**
|
|
244
|
+
* 🚨 Send security alert to monitoring systems
|
|
245
|
+
*/
|
|
246
|
+
private sendSecurityAlert;
|
|
247
|
+
/**
|
|
248
|
+
* 📊 Get current compliance status and statistics
|
|
249
|
+
*/
|
|
250
|
+
getComplianceStatus(): Record<string, any>;
|
|
251
|
+
/**
|
|
252
|
+
* Get recent violations
|
|
253
|
+
*/
|
|
254
|
+
getViolations(category?: string, limit?: number): ComplianceViolation[];
|
|
255
|
+
/**
|
|
256
|
+
* Clear violation log
|
|
257
|
+
*/
|
|
258
|
+
clearViolations(): void;
|
|
259
|
+
/**
|
|
260
|
+
* Set cache value with size limit
|
|
261
|
+
*/
|
|
262
|
+
private setCacheValue;
|
|
263
|
+
/**
|
|
264
|
+
* Pre-warm caches with common operations
|
|
265
|
+
*/
|
|
266
|
+
preWarmCaches(): void;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
declare class AgentIdentity {
|
|
270
|
+
readonly name: string;
|
|
271
|
+
readonly sekuireId: string;
|
|
272
|
+
private readonly privateKey?;
|
|
273
|
+
private readonly publicKey?;
|
|
274
|
+
constructor(name: string, sekuireId: string, privateKey?: string | undefined, publicKey?: string | undefined);
|
|
275
|
+
static load(manifestPath?: string): Promise<AgentIdentity>;
|
|
276
|
+
sign(payload: any): Promise<string>;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Sekuire Agent Framework
|
|
281
|
+
*
|
|
282
|
+
* High-level API for building compliant AI agents with automatic
|
|
283
|
+
* identity verification, compliance enforcement, and event logging.
|
|
284
|
+
*/
|
|
285
|
+
|
|
286
|
+
interface SekuireAgentConfig {
|
|
287
|
+
/** Agent identity (sekuire.json) */
|
|
288
|
+
identity?: AgentIdentity;
|
|
289
|
+
/** Compliance configuration file path */
|
|
290
|
+
configPath?: string;
|
|
291
|
+
/** Logger configuration */
|
|
292
|
+
logger?: {
|
|
293
|
+
apiBaseUrl?: string;
|
|
294
|
+
environment?: string;
|
|
295
|
+
enabled?: boolean;
|
|
296
|
+
};
|
|
297
|
+
/** Optional custom compliance monitor */
|
|
298
|
+
compliance?: ComplianceMonitor;
|
|
299
|
+
}
|
|
300
|
+
interface ToolDefinition$1<T extends z.ZodObject<any> = any> {
|
|
301
|
+
/** Unique tool name */
|
|
302
|
+
name: string;
|
|
303
|
+
/** Human-readable description */
|
|
304
|
+
description: string;
|
|
305
|
+
/** Zod schema for input validation */
|
|
306
|
+
schema: T;
|
|
307
|
+
/** Tool execution function */
|
|
308
|
+
execute: (input: z.infer<T>) => Promise<any> | any;
|
|
309
|
+
/** Optional: Additional compliance checks */
|
|
310
|
+
beforeExecute?: (input: z.infer<T>) => Promise<void> | void;
|
|
311
|
+
}
|
|
312
|
+
interface Message$1 {
|
|
313
|
+
role: "user" | "assistant" | "system";
|
|
314
|
+
content: string;
|
|
315
|
+
}
|
|
316
|
+
interface AgentInvokeOptions {
|
|
317
|
+
messages: Message$1[];
|
|
318
|
+
tools?: string[];
|
|
319
|
+
}
|
|
320
|
+
interface AgentResponse$1 {
|
|
321
|
+
message: string;
|
|
322
|
+
toolCalls?: ToolCall[];
|
|
323
|
+
metadata?: {
|
|
324
|
+
tokensUsed?: number;
|
|
325
|
+
toolsInvoked?: string[];
|
|
326
|
+
complianceViolations?: number;
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
interface ToolCall {
|
|
330
|
+
tool: string;
|
|
331
|
+
input: any;
|
|
332
|
+
output: any;
|
|
333
|
+
allowed: boolean;
|
|
334
|
+
reason?: string;
|
|
335
|
+
}
|
|
336
|
+
declare class SekuireAgent$1 {
|
|
337
|
+
private identity;
|
|
338
|
+
private compliance;
|
|
339
|
+
private logger;
|
|
340
|
+
private tools;
|
|
341
|
+
constructor(identity: AgentIdentity, compliance: ComplianceMonitor, logger: SekuireLogger);
|
|
342
|
+
/**
|
|
343
|
+
* Get agent identity
|
|
344
|
+
*/
|
|
345
|
+
getIdentity(): AgentIdentity;
|
|
346
|
+
/**
|
|
347
|
+
* Get compliance monitor
|
|
348
|
+
*/
|
|
349
|
+
getCompliance(): ComplianceMonitor;
|
|
350
|
+
/**
|
|
351
|
+
* Get logger
|
|
352
|
+
*/
|
|
353
|
+
getLogger(): SekuireLogger;
|
|
354
|
+
/**
|
|
355
|
+
* Register a tool with the agent
|
|
356
|
+
*/
|
|
357
|
+
registerTool<T extends z.ZodObject<any>>(tool: ToolDefinition$1<T>): this;
|
|
358
|
+
/**
|
|
359
|
+
* Register multiple tools at once
|
|
360
|
+
*/
|
|
361
|
+
registerTools(tools: ToolDefinition$1[]): this;
|
|
362
|
+
/**
|
|
363
|
+
* Get registered tools
|
|
364
|
+
*/
|
|
365
|
+
getTools(names?: string[]): ToolDefinition$1[];
|
|
366
|
+
/**
|
|
367
|
+
* Execute a tool by name
|
|
368
|
+
*/
|
|
369
|
+
executeTool(name: string, input: any): Promise<any>;
|
|
370
|
+
/**
|
|
371
|
+
* Invoke the agent (to be implemented by subclasses or plugins)
|
|
372
|
+
*/
|
|
373
|
+
invoke(options: AgentInvokeOptions): Promise<AgentResponse$1>;
|
|
374
|
+
/**
|
|
375
|
+
* Shutdown agent and flush logs
|
|
376
|
+
*/
|
|
377
|
+
shutdown(): Promise<void>;
|
|
378
|
+
}
|
|
379
|
+
declare class SekuireAgentBuilder {
|
|
380
|
+
private config;
|
|
381
|
+
private tools;
|
|
382
|
+
/**
|
|
383
|
+
* Set agent identity
|
|
384
|
+
*/
|
|
385
|
+
withIdentity(identity: AgentIdentity): this;
|
|
386
|
+
/**
|
|
387
|
+
* Load identity from disk
|
|
388
|
+
*/
|
|
389
|
+
loadIdentity(path?: string): Promise<this>;
|
|
390
|
+
/**
|
|
391
|
+
* Set compliance config path
|
|
392
|
+
*/
|
|
393
|
+
withConfig(path: string): this;
|
|
394
|
+
/**
|
|
395
|
+
* Set logger options
|
|
396
|
+
*/
|
|
397
|
+
withLogger(options: NonNullable<SekuireAgentConfig["logger"]>): this;
|
|
398
|
+
/**
|
|
399
|
+
* Add a tool
|
|
400
|
+
*/
|
|
401
|
+
withTool<T extends z.ZodObject<any>>(tool: ToolDefinition$1<T>): this;
|
|
402
|
+
/**
|
|
403
|
+
* Add multiple tools
|
|
404
|
+
*/
|
|
405
|
+
withTools(tools: ToolDefinition$1[]): this;
|
|
406
|
+
/**
|
|
407
|
+
* Build the agent
|
|
408
|
+
*/
|
|
409
|
+
build(): Promise<SekuireAgent$1>;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Create a new Sekuire agent with compliance and identity
|
|
413
|
+
*
|
|
414
|
+
* @example
|
|
415
|
+
* ```typescript
|
|
416
|
+
* const agent = await createAgent({
|
|
417
|
+
* configPath: './sekuire.yaml',
|
|
418
|
+
* tools: [weatherTool, calculatorTool],
|
|
419
|
+
* });
|
|
420
|
+
* ```
|
|
421
|
+
*/
|
|
422
|
+
declare function createAgent(config?: {
|
|
423
|
+
identity?: AgentIdentity;
|
|
424
|
+
configPath?: string;
|
|
425
|
+
tools?: ToolDefinition$1[];
|
|
426
|
+
logger?: SekuireAgentConfig["logger"];
|
|
427
|
+
}): Promise<SekuireAgent$1>;
|
|
428
|
+
/**
|
|
429
|
+
* Create a compliant tool definition
|
|
430
|
+
*
|
|
431
|
+
* @example
|
|
432
|
+
* ```typescript
|
|
433
|
+
* const weatherTool = tool({
|
|
434
|
+
* name: 'get_weather',
|
|
435
|
+
* description: 'Get weather for a city',
|
|
436
|
+
* schema: z.object({
|
|
437
|
+
* city: z.string(),
|
|
438
|
+
* }),
|
|
439
|
+
* execute: async ({ city }) => {
|
|
440
|
+
* return `Weather in ${city}: Sunny`;
|
|
441
|
+
* },
|
|
442
|
+
* });
|
|
443
|
+
* ```
|
|
444
|
+
*/
|
|
445
|
+
declare function tool<T extends z.ZodObject<any>>(definition: ToolDefinition$1<T>): ToolDefinition$1<T>;
|
|
446
|
+
/**
|
|
447
|
+
* Create multiple tools at once
|
|
448
|
+
*
|
|
449
|
+
* @example
|
|
450
|
+
* ```typescript
|
|
451
|
+
* const [weather, calc] = tools(
|
|
452
|
+
* { name: 'weather', ... },
|
|
453
|
+
* { name: 'calculator', ... }
|
|
454
|
+
* );
|
|
455
|
+
* ```
|
|
456
|
+
*/
|
|
457
|
+
declare function tools<T extends ToolDefinition$1[]>(...definitions: T): T;
|
|
458
|
+
/**
|
|
459
|
+
* Get tools registered with an agent
|
|
460
|
+
*/
|
|
461
|
+
declare function getTools$1(agent: SekuireAgent$1, names?: string[]): ToolDefinition$1[];
|
|
462
|
+
|
|
463
|
+
interface ActivePolicyResponse {
|
|
464
|
+
policy_id: string;
|
|
465
|
+
workspace_id: string;
|
|
466
|
+
version: string;
|
|
467
|
+
status: string;
|
|
468
|
+
hash: string;
|
|
469
|
+
content: unknown;
|
|
470
|
+
activated_at?: string;
|
|
471
|
+
updated_at?: string;
|
|
472
|
+
signature?: string;
|
|
473
|
+
signing_key_id?: string;
|
|
474
|
+
signing_public_key?: string;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
interface Manifest {
|
|
478
|
+
project: ProjectMetadata;
|
|
479
|
+
identity: IdentityConfig;
|
|
480
|
+
}
|
|
481
|
+
interface ProjectMetadata {
|
|
482
|
+
name: string;
|
|
483
|
+
version: string;
|
|
484
|
+
description?: string;
|
|
485
|
+
authors: string[];
|
|
486
|
+
license?: string;
|
|
487
|
+
}
|
|
488
|
+
interface IdentityConfig {
|
|
489
|
+
/** The model identifier (e.g., "gpt-4-0613") */
|
|
490
|
+
model: string;
|
|
491
|
+
/** Path to the system prompt file (relative to sekuire.json) */
|
|
492
|
+
systemPromptPath: string;
|
|
493
|
+
/** Path to the tools definition file (relative to sekuire.json) */
|
|
494
|
+
toolsPath: string;
|
|
495
|
+
/** The Blake3 hash of the system prompt content */
|
|
496
|
+
systemPromptHash?: string;
|
|
497
|
+
/** The Blake3 hash of the tools definition content */
|
|
498
|
+
toolsHash?: string;
|
|
499
|
+
}
|
|
500
|
+
interface PublishRequest {
|
|
501
|
+
manifest: Manifest;
|
|
502
|
+
sekuireId: string;
|
|
503
|
+
signature: string;
|
|
504
|
+
publicKey: string;
|
|
505
|
+
}
|
|
506
|
+
interface AgentResponse {
|
|
507
|
+
sekuireId: string;
|
|
508
|
+
name: string;
|
|
509
|
+
version: string;
|
|
510
|
+
description?: string;
|
|
511
|
+
authorKey: string;
|
|
512
|
+
createdAt: string;
|
|
513
|
+
verificationStatus: VerificationStatus;
|
|
514
|
+
reputationScore: number;
|
|
515
|
+
}
|
|
516
|
+
type VerificationStatus = 'unverified' | 'pending' | 'verified' | 'suspended';
|
|
517
|
+
interface ReputationResponse {
|
|
518
|
+
score: number;
|
|
519
|
+
taskCount: number;
|
|
520
|
+
verificationBadge?: string;
|
|
521
|
+
recentLogs: ReputationLog[];
|
|
522
|
+
}
|
|
523
|
+
interface ReputationLog {
|
|
524
|
+
id: string;
|
|
525
|
+
taskHash: string;
|
|
526
|
+
rating: number;
|
|
527
|
+
comment?: string;
|
|
528
|
+
timestamp: string;
|
|
529
|
+
}
|
|
530
|
+
interface SubmitReputationRequest {
|
|
531
|
+
sekuireId: string;
|
|
532
|
+
taskHash: string;
|
|
533
|
+
rating: number;
|
|
534
|
+
comment?: string;
|
|
535
|
+
signature: string;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
interface HandshakeHello {
|
|
539
|
+
clientNonce: string;
|
|
540
|
+
}
|
|
541
|
+
interface HandshakeWelcome {
|
|
542
|
+
agentId: string;
|
|
543
|
+
agentNonce: string;
|
|
544
|
+
signatureC: string;
|
|
545
|
+
credentials: string[];
|
|
546
|
+
}
|
|
547
|
+
interface HandshakeAuth {
|
|
548
|
+
signatureA: string;
|
|
549
|
+
}
|
|
550
|
+
interface VerifyAgentRequest {
|
|
551
|
+
sekuireId: string;
|
|
552
|
+
status: VerificationStatus;
|
|
553
|
+
badge?: string;
|
|
554
|
+
reason?: string;
|
|
555
|
+
}
|
|
556
|
+
interface DisputeRequest {
|
|
557
|
+
sekuireId: string;
|
|
558
|
+
accuserId: string;
|
|
559
|
+
reason: string;
|
|
560
|
+
evidenceLog: string;
|
|
561
|
+
}
|
|
562
|
+
interface CreateOrgRequest {
|
|
563
|
+
slug: string;
|
|
564
|
+
displayName: string;
|
|
565
|
+
billingEmail: string;
|
|
566
|
+
}
|
|
567
|
+
interface OrgResponse {
|
|
568
|
+
id: string;
|
|
569
|
+
slug: string;
|
|
570
|
+
role: string;
|
|
571
|
+
}
|
|
572
|
+
interface CreateWorkspaceRequest {
|
|
573
|
+
name: string;
|
|
574
|
+
policyPreset: string;
|
|
575
|
+
}
|
|
576
|
+
interface WorkspaceResponse {
|
|
577
|
+
id: string;
|
|
578
|
+
name: string;
|
|
579
|
+
}
|
|
580
|
+
interface InviteRequest {
|
|
581
|
+
email: string;
|
|
582
|
+
role: string;
|
|
583
|
+
}
|
|
584
|
+
interface InviteResponse {
|
|
585
|
+
id: string;
|
|
586
|
+
status: string;
|
|
587
|
+
}
|
|
588
|
+
interface UserContextResponse {
|
|
589
|
+
id: string;
|
|
590
|
+
email: string;
|
|
591
|
+
onboarded: boolean;
|
|
592
|
+
mfa_enabled: boolean;
|
|
593
|
+
role?: string;
|
|
594
|
+
full_name?: string;
|
|
595
|
+
avatar_url?: string;
|
|
596
|
+
onboarding_step?: number;
|
|
597
|
+
profile_completed?: boolean;
|
|
598
|
+
orgs: OrgSummary[];
|
|
599
|
+
workspaces: WorkspaceSummary[];
|
|
600
|
+
}
|
|
601
|
+
interface OrgSummary {
|
|
602
|
+
id: string;
|
|
603
|
+
slug: string;
|
|
604
|
+
workspaces?: WorkspaceSummary[];
|
|
605
|
+
}
|
|
606
|
+
interface WorkspaceSummary {
|
|
607
|
+
id: string;
|
|
608
|
+
name: string;
|
|
609
|
+
org_id: string;
|
|
610
|
+
}
|
|
611
|
+
interface SekuireClientConfig {
|
|
612
|
+
registryUrl: string;
|
|
613
|
+
timeout?: number;
|
|
614
|
+
retries?: number;
|
|
615
|
+
}
|
|
616
|
+
interface KeyPair {
|
|
617
|
+
publicKey: string;
|
|
618
|
+
privateKey: string;
|
|
619
|
+
}
|
|
620
|
+
interface HandshakeResult {
|
|
621
|
+
agentId: string;
|
|
622
|
+
verified: boolean;
|
|
623
|
+
credentials: string[];
|
|
624
|
+
}
|
|
625
|
+
declare class SekuireError extends Error {
|
|
626
|
+
readonly code: string;
|
|
627
|
+
readonly details?: any | undefined;
|
|
628
|
+
constructor(message: string, code: string, details?: any | undefined);
|
|
629
|
+
}
|
|
630
|
+
declare class NetworkError extends SekuireError {
|
|
631
|
+
readonly originalError?: Error | undefined;
|
|
632
|
+
constructor(message: string, originalError?: Error | undefined);
|
|
633
|
+
}
|
|
634
|
+
declare class ProtocolError extends SekuireError {
|
|
635
|
+
readonly statusCode?: number | undefined;
|
|
636
|
+
constructor(message: string, statusCode?: number | undefined);
|
|
637
|
+
}
|
|
638
|
+
declare class CryptoError extends SekuireError {
|
|
639
|
+
constructor(message: string);
|
|
640
|
+
}
|
|
641
|
+
declare class PolicyViolationError extends SekuireError {
|
|
642
|
+
readonly rule: string;
|
|
643
|
+
constructor(message: string, rule: string);
|
|
644
|
+
}
|
|
645
|
+
type HexString = string;
|
|
646
|
+
type AgentId = string;
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Sekuire client for verifying agents and performing handshakes
|
|
650
|
+
*/
|
|
651
|
+
declare class SekuireClient {
|
|
652
|
+
private readonly keyPair;
|
|
653
|
+
private readonly httpClient;
|
|
654
|
+
constructor(keyPair: KeyPair, config: SekuireClientConfig);
|
|
655
|
+
/**
|
|
656
|
+
* Perform the full handshake with a remote agent
|
|
657
|
+
*/
|
|
658
|
+
connect(agentUrl: string, expectedAgentId?: string): Promise<HandshakeResult>;
|
|
659
|
+
/**
|
|
660
|
+
* Verify an agent's signature
|
|
661
|
+
*/
|
|
662
|
+
private verifyAgentSignature;
|
|
663
|
+
/**
|
|
664
|
+
* Fetch agent's public key from the registry
|
|
665
|
+
*/
|
|
666
|
+
fetchAgentPublicKey(agentId: string): Promise<string>;
|
|
667
|
+
/**
|
|
668
|
+
* Get agent information from the registry
|
|
669
|
+
*/
|
|
670
|
+
getAgentInfo(agentId: string): Promise<AgentResponse>;
|
|
671
|
+
/**
|
|
672
|
+
* Search for agents in the registry
|
|
673
|
+
*/
|
|
674
|
+
searchAgents(query: string): Promise<AgentResponse[]>;
|
|
675
|
+
/**
|
|
676
|
+
* Sign data with the client's private key
|
|
677
|
+
*/
|
|
678
|
+
sign(data: string): string;
|
|
679
|
+
/**
|
|
680
|
+
* Get the client's public key
|
|
681
|
+
*/
|
|
682
|
+
getPublicKey(): string;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
interface SekuireConfig {
|
|
686
|
+
project: {
|
|
687
|
+
name: string;
|
|
688
|
+
version: string;
|
|
689
|
+
description?: string;
|
|
690
|
+
author?: string;
|
|
691
|
+
license?: string;
|
|
692
|
+
};
|
|
693
|
+
agents?: {
|
|
694
|
+
[key: string]: AgentConfig;
|
|
695
|
+
};
|
|
696
|
+
agent?: AgentConfig;
|
|
697
|
+
llm?: LLMConfig;
|
|
698
|
+
logger?: LoggerConfig;
|
|
699
|
+
permissions?: PermissionsConfig;
|
|
700
|
+
rate_limits?: RateLimitsConfig;
|
|
701
|
+
}
|
|
702
|
+
interface PermissionsConfig {
|
|
703
|
+
network?: {
|
|
704
|
+
enabled?: boolean;
|
|
705
|
+
require_tls?: boolean;
|
|
706
|
+
allowed_domains?: string[];
|
|
707
|
+
blocked_domains?: string[];
|
|
708
|
+
};
|
|
709
|
+
filesystem?: {
|
|
710
|
+
enabled?: boolean;
|
|
711
|
+
allowed_paths?: string[];
|
|
712
|
+
blocked_paths?: string[];
|
|
713
|
+
allowed_extensions?: string[];
|
|
714
|
+
};
|
|
715
|
+
api?: {
|
|
716
|
+
enabled?: boolean;
|
|
717
|
+
allowed_services?: Array<{
|
|
718
|
+
service_name: string;
|
|
719
|
+
endpoints?: string[];
|
|
720
|
+
}>;
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
interface RateLimitsConfig {
|
|
724
|
+
per_agent?: {
|
|
725
|
+
requests_per_minute?: number;
|
|
726
|
+
tokens_per_hour?: number;
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
interface AgentConfig {
|
|
730
|
+
name: string;
|
|
731
|
+
system_prompt: string;
|
|
732
|
+
tools: string;
|
|
733
|
+
llm: LLMConfig;
|
|
734
|
+
memory?: MemoryConfig;
|
|
735
|
+
compliance?: ComplianceConfig;
|
|
736
|
+
models?: {
|
|
737
|
+
allowed_models?: string[];
|
|
738
|
+
blocked_models?: string[];
|
|
739
|
+
};
|
|
740
|
+
toolsets?: {
|
|
741
|
+
allowed_tools?: Array<{
|
|
742
|
+
name: string;
|
|
743
|
+
description?: string;
|
|
744
|
+
}>;
|
|
745
|
+
blocked_tools?: string[];
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
interface LLMConfig {
|
|
749
|
+
provider: string;
|
|
750
|
+
model: string;
|
|
751
|
+
api_key_env: string;
|
|
752
|
+
temperature?: number;
|
|
753
|
+
max_tokens?: number;
|
|
754
|
+
streaming?: boolean;
|
|
755
|
+
base_url?: string;
|
|
756
|
+
}
|
|
757
|
+
interface MemoryConfig {
|
|
758
|
+
type: "in-memory" | "redis" | "postgres";
|
|
759
|
+
max_messages?: number;
|
|
760
|
+
redis?: {
|
|
761
|
+
url?: string;
|
|
762
|
+
host?: string;
|
|
763
|
+
port?: number;
|
|
764
|
+
password?: string;
|
|
765
|
+
db?: number;
|
|
766
|
+
keyPrefix?: string;
|
|
767
|
+
};
|
|
768
|
+
postgres?: {
|
|
769
|
+
connectionString?: string;
|
|
770
|
+
host?: string;
|
|
771
|
+
port?: number;
|
|
772
|
+
database?: string;
|
|
773
|
+
user?: string;
|
|
774
|
+
password?: string;
|
|
775
|
+
tableName?: string;
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
interface ComplianceConfig {
|
|
779
|
+
framework?: string;
|
|
780
|
+
audit_logging?: boolean;
|
|
781
|
+
sensitive_data_detection?: boolean;
|
|
782
|
+
require_approval?: string[];
|
|
783
|
+
}
|
|
784
|
+
interface LoggerConfig {
|
|
785
|
+
api_base_url?: string;
|
|
786
|
+
environment?: string;
|
|
787
|
+
enabled?: boolean;
|
|
788
|
+
}
|
|
789
|
+
interface ToolsSchema {
|
|
790
|
+
version: string;
|
|
791
|
+
tools: ToolDefinition[];
|
|
792
|
+
}
|
|
793
|
+
interface ToolDefinition {
|
|
794
|
+
name: string;
|
|
795
|
+
description: string;
|
|
796
|
+
category?: string;
|
|
797
|
+
schema: {
|
|
798
|
+
type: string;
|
|
799
|
+
properties: Record<string, unknown>;
|
|
800
|
+
required?: string[];
|
|
801
|
+
};
|
|
802
|
+
implementation: string;
|
|
803
|
+
permissions?: any;
|
|
804
|
+
compliance?: any;
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Load sekuire.yml configuration file
|
|
808
|
+
*/
|
|
809
|
+
declare function loadConfig(configPath?: string): Promise<SekuireConfig>;
|
|
810
|
+
/**
|
|
811
|
+
* Load system prompt from file
|
|
812
|
+
*/
|
|
813
|
+
declare function loadSystemPrompt(promptPath: string, basePath?: string): Promise<string>;
|
|
814
|
+
/**
|
|
815
|
+
* Load tools configuration from JSON file
|
|
816
|
+
*/
|
|
817
|
+
declare function loadTools(toolsPath: string, basePath?: string): Promise<ToolsSchema>;
|
|
818
|
+
/**
|
|
819
|
+
* Get agent configuration by name
|
|
820
|
+
* Supports both single agent and multi-agent configs
|
|
821
|
+
*/
|
|
822
|
+
declare function getAgentConfig(config: SekuireConfig, agentName?: string): AgentConfig;
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Cryptographic utilities for Sekuire protocol
|
|
826
|
+
*/
|
|
827
|
+
declare class SekuireCrypto {
|
|
828
|
+
/**
|
|
829
|
+
* Generate a new Ed25519 keypair
|
|
830
|
+
*/
|
|
831
|
+
static generateKeyPair(): KeyPair;
|
|
832
|
+
/**
|
|
833
|
+
* Sign a message with a private key
|
|
834
|
+
*/
|
|
835
|
+
static sign(message: string | Uint8Array, privateKeyHex: string): HexString;
|
|
836
|
+
/**
|
|
837
|
+
* Verify a signature
|
|
838
|
+
*/
|
|
839
|
+
static verify(message: string | Uint8Array, signatureHex: string, publicKeyHex: string): boolean;
|
|
840
|
+
/**
|
|
841
|
+
* Calculate Blake3 hash of data
|
|
842
|
+
*/
|
|
843
|
+
static hash(data: string | Uint8Array): HexString;
|
|
844
|
+
/**
|
|
845
|
+
* Calculate Sekuire ID from agent components
|
|
846
|
+
*/
|
|
847
|
+
static calculateSekuireId(params: {
|
|
848
|
+
model: string;
|
|
849
|
+
systemPrompt: string;
|
|
850
|
+
tools: string;
|
|
851
|
+
projectName: string;
|
|
852
|
+
projectVersion: string;
|
|
853
|
+
}): HexString;
|
|
854
|
+
/**
|
|
855
|
+
* Generate a cryptographically secure random nonce (32 bytes)
|
|
856
|
+
*/
|
|
857
|
+
static generateNonce(): HexString;
|
|
858
|
+
/**
|
|
859
|
+
* Convert hex string to Uint8Array
|
|
860
|
+
*/
|
|
861
|
+
static hexToBytes(hex: string): Uint8Array;
|
|
862
|
+
/**
|
|
863
|
+
* Convert Uint8Array to hex string
|
|
864
|
+
*/
|
|
865
|
+
static bytesToHex(bytes: Uint8Array): HexString;
|
|
866
|
+
/**
|
|
867
|
+
* Validate hex string format
|
|
868
|
+
*/
|
|
869
|
+
static isValidHex(hex: string): boolean;
|
|
870
|
+
/**
|
|
871
|
+
* Validate Ed25519 public key format (32 bytes)
|
|
872
|
+
*/
|
|
873
|
+
static isValidPublicKey(hex: string): boolean;
|
|
874
|
+
/**
|
|
875
|
+
* Validate Ed25519 private key format (64 bytes)
|
|
876
|
+
*/
|
|
877
|
+
static isValidPrivateKey(hex: string): boolean;
|
|
878
|
+
/**
|
|
879
|
+
* Validate nonce format (32 bytes)
|
|
880
|
+
*/
|
|
881
|
+
static isValidNonce(hex: string): boolean;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Message format for chat conversations
|
|
886
|
+
*/
|
|
887
|
+
interface Message {
|
|
888
|
+
role: "system" | "user" | "assistant" | "function" | "tool";
|
|
889
|
+
content: string | null;
|
|
890
|
+
name?: string;
|
|
891
|
+
tool_call_id?: string;
|
|
892
|
+
tool_calls?: any[];
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Options for chat completion
|
|
896
|
+
*/
|
|
897
|
+
interface ChatOptions {
|
|
898
|
+
temperature?: number;
|
|
899
|
+
max_tokens?: number;
|
|
900
|
+
top_p?: number;
|
|
901
|
+
frequency_penalty?: number;
|
|
902
|
+
presence_penalty?: number;
|
|
903
|
+
stop?: string[];
|
|
904
|
+
stream?: boolean;
|
|
905
|
+
tools?: any[];
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* Response from chat completion
|
|
909
|
+
*/
|
|
910
|
+
interface ChatResponse {
|
|
911
|
+
content: string;
|
|
912
|
+
model: string;
|
|
913
|
+
finish_reason?: string;
|
|
914
|
+
tool_calls?: any[];
|
|
915
|
+
usage?: {
|
|
916
|
+
prompt_tokens: number;
|
|
917
|
+
completion_tokens: number;
|
|
918
|
+
total_tokens: number;
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* Streaming chunk from chat completion
|
|
923
|
+
*/
|
|
924
|
+
interface ChatChunk {
|
|
925
|
+
content: string;
|
|
926
|
+
finish_reason?: string;
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* Base interface for LLM providers
|
|
930
|
+
*/
|
|
931
|
+
interface LLMProvider {
|
|
932
|
+
/**
|
|
933
|
+
* Send chat messages and get response
|
|
934
|
+
*/
|
|
935
|
+
chat(messages: Message[], options?: ChatOptions): Promise<ChatResponse>;
|
|
936
|
+
/**
|
|
937
|
+
* Stream chat response
|
|
938
|
+
*/
|
|
939
|
+
chatStream(messages: Message[], options?: ChatOptions): AsyncGenerator<ChatChunk>;
|
|
940
|
+
/**
|
|
941
|
+
* Count tokens in text (approximate)
|
|
942
|
+
*/
|
|
943
|
+
countTokens(text: string): number;
|
|
944
|
+
/**
|
|
945
|
+
* Get maximum context window size
|
|
946
|
+
*/
|
|
947
|
+
getMaxTokens(): number;
|
|
948
|
+
/**
|
|
949
|
+
* Get provider name
|
|
950
|
+
*/
|
|
951
|
+
getProviderName(): string;
|
|
952
|
+
/**
|
|
953
|
+
* Get model name
|
|
954
|
+
*/
|
|
955
|
+
getModelName(): string;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Configuration for creating LLM providers
|
|
959
|
+
*/
|
|
960
|
+
interface LLMProviderConfig {
|
|
961
|
+
apiKey: string;
|
|
962
|
+
model: string;
|
|
963
|
+
baseUrl?: string;
|
|
964
|
+
organization?: string;
|
|
965
|
+
temperature?: number;
|
|
966
|
+
maxTokens?: number;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* Anthropic LLM Provider
|
|
971
|
+
* Supports Claude models (Claude 3, Claude 3.5, etc.)
|
|
972
|
+
*/
|
|
973
|
+
declare class AnthropicProvider implements LLMProvider {
|
|
974
|
+
private client;
|
|
975
|
+
private model;
|
|
976
|
+
private maxTokens;
|
|
977
|
+
constructor(config: LLMProviderConfig);
|
|
978
|
+
chat(messages: Message[], options?: ChatOptions): Promise<ChatResponse>;
|
|
979
|
+
chatStream(messages: Message[], options?: ChatOptions): AsyncGenerator<ChatChunk>;
|
|
980
|
+
countTokens(text: string): number;
|
|
981
|
+
getMaxTokens(): number;
|
|
982
|
+
getProviderName(): string;
|
|
983
|
+
getModelName(): string;
|
|
984
|
+
private getMaxTokensForModel;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Google Gemini LLM Provider
|
|
989
|
+
* Supports Gemini Pro, Gemini Pro Vision, and other Google models
|
|
990
|
+
*/
|
|
991
|
+
declare class GoogleProvider implements LLMProvider {
|
|
992
|
+
private client;
|
|
993
|
+
private model;
|
|
994
|
+
private maxTokens;
|
|
995
|
+
constructor(config: LLMProviderConfig);
|
|
996
|
+
chat(messages: Message[], options?: ChatOptions): Promise<ChatResponse>;
|
|
997
|
+
chatStream(messages: Message[], options?: ChatOptions): AsyncGenerator<ChatChunk>;
|
|
998
|
+
countTokens(text: string): number;
|
|
999
|
+
getMaxTokens(): number;
|
|
1000
|
+
getProviderName(): string;
|
|
1001
|
+
getModelName(): string;
|
|
1002
|
+
private getMaxTokensForModel;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* Ollama LLM Provider
|
|
1007
|
+
* Supports local models via Ollama (Llama 2, Mistral, CodeLlama, etc.)
|
|
1008
|
+
*/
|
|
1009
|
+
declare class OllamaProvider implements LLMProvider {
|
|
1010
|
+
private baseUrl;
|
|
1011
|
+
private model;
|
|
1012
|
+
private maxTokens;
|
|
1013
|
+
constructor(config: LLMProviderConfig);
|
|
1014
|
+
chat(messages: Message[], options?: ChatOptions): Promise<ChatResponse>;
|
|
1015
|
+
chatStream(messages: Message[], options?: ChatOptions): AsyncGenerator<ChatChunk>;
|
|
1016
|
+
countTokens(text: string): number;
|
|
1017
|
+
getMaxTokens(): number;
|
|
1018
|
+
getProviderName(): string;
|
|
1019
|
+
getModelName(): string;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
/**
|
|
1023
|
+
* OpenAI LLM Provider
|
|
1024
|
+
* Supports GPT-3.5, GPT-4, and other OpenAI models
|
|
1025
|
+
*/
|
|
1026
|
+
declare class OpenAIProvider implements LLMProvider {
|
|
1027
|
+
private client;
|
|
1028
|
+
private model;
|
|
1029
|
+
private maxTokens;
|
|
1030
|
+
constructor(config: LLMProviderConfig);
|
|
1031
|
+
chat(messages: Message[], options?: ChatOptions): Promise<ChatResponse>;
|
|
1032
|
+
chatStream(messages: Message[], options?: ChatOptions): AsyncGenerator<ChatChunk>;
|
|
1033
|
+
countTokens(text: string): number;
|
|
1034
|
+
getMaxTokens(): number;
|
|
1035
|
+
getProviderName(): string;
|
|
1036
|
+
getModelName(): string;
|
|
1037
|
+
private getMaxTokensForModel;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Create an LLM provider based on provider name
|
|
1042
|
+
*/
|
|
1043
|
+
declare function createLLMProvider(provider: string, config: LLMProviderConfig): LLMProvider;
|
|
1044
|
+
/**
|
|
1045
|
+
* Factory functions for easy LLM instantiation
|
|
1046
|
+
*/
|
|
1047
|
+
declare const llm: {
|
|
1048
|
+
/**
|
|
1049
|
+
* Create OpenAI provider (GPT-4, GPT-3.5, etc.)
|
|
1050
|
+
*/
|
|
1051
|
+
openai: (config: Omit<LLMProviderConfig, "model"> & {
|
|
1052
|
+
model?: string;
|
|
1053
|
+
}) => OpenAIProvider;
|
|
1054
|
+
/**
|
|
1055
|
+
* Create Anthropic provider (Claude 3, Claude 3.5, etc.)
|
|
1056
|
+
*/
|
|
1057
|
+
anthropic: (config: Omit<LLMProviderConfig, "model"> & {
|
|
1058
|
+
model?: string;
|
|
1059
|
+
}) => AnthropicProvider;
|
|
1060
|
+
/**
|
|
1061
|
+
* Create Google provider (Gemini Pro, Gemini 1.5, etc.)
|
|
1062
|
+
*/
|
|
1063
|
+
google: (config: Omit<LLMProviderConfig, "model"> & {
|
|
1064
|
+
model?: string;
|
|
1065
|
+
}) => GoogleProvider;
|
|
1066
|
+
/**
|
|
1067
|
+
* Create Ollama provider (local models: Llama 2, Mistral, etc.)
|
|
1068
|
+
*/
|
|
1069
|
+
ollama: (config: Omit<LLMProviderConfig, "model"> & {
|
|
1070
|
+
model?: string;
|
|
1071
|
+
}) => OllamaProvider;
|
|
1072
|
+
};
|
|
1073
|
+
|
|
1074
|
+
interface ActivePolicy {
|
|
1075
|
+
policy_id: string;
|
|
1076
|
+
workspace_id: string;
|
|
1077
|
+
version: string;
|
|
1078
|
+
status: string;
|
|
1079
|
+
hash: string;
|
|
1080
|
+
content: any;
|
|
1081
|
+
activated_at?: string;
|
|
1082
|
+
updated_at?: string;
|
|
1083
|
+
signature?: string;
|
|
1084
|
+
signing_key_id?: string;
|
|
1085
|
+
signing_public_key?: string;
|
|
1086
|
+
}
|
|
1087
|
+
declare class PolicyClient {
|
|
1088
|
+
private readonly baseUrl;
|
|
1089
|
+
private cache;
|
|
1090
|
+
constructor(baseUrl: string);
|
|
1091
|
+
fetchActivePolicy(workspaceId: string): Promise<ActivePolicy>;
|
|
1092
|
+
verify(policy: ActivePolicy): void;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
type ViolationHandler = (rule: string, reason: string) => void;
|
|
1096
|
+
declare class PolicyEnforcer {
|
|
1097
|
+
private readonly policy;
|
|
1098
|
+
private readonly onViolation?;
|
|
1099
|
+
private readonly override;
|
|
1100
|
+
constructor(policy: ActivePolicy, override?: boolean, onViolation?: ViolationHandler | undefined);
|
|
1101
|
+
enforceNetwork(domain: string, protocol: string): void;
|
|
1102
|
+
enforceFilesystem(path: string, operation: string): void;
|
|
1103
|
+
enforceTool(toolName: string): void;
|
|
1104
|
+
private getCategoryPrefix;
|
|
1105
|
+
enforceModel(model: string): void;
|
|
1106
|
+
enforceApi(service: string): void;
|
|
1107
|
+
enforceRateLimit(type: "request" | "token", count?: number): void;
|
|
1108
|
+
private throw;
|
|
1109
|
+
private warnOnly;
|
|
1110
|
+
private matches;
|
|
1111
|
+
private pathMatch;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
interface MemoryMessage {
|
|
1115
|
+
role: "user" | "assistant" | "system";
|
|
1116
|
+
content: string;
|
|
1117
|
+
timestamp: number;
|
|
1118
|
+
metadata?: Record<string, unknown>;
|
|
1119
|
+
}
|
|
1120
|
+
interface MemoryStorage {
|
|
1121
|
+
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1122
|
+
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1123
|
+
clear(sessionId: string): Promise<void>;
|
|
1124
|
+
delete(sessionId: string): Promise<void>;
|
|
1125
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1126
|
+
}
|
|
1127
|
+
declare abstract class BaseMemoryStorage implements MemoryStorage {
|
|
1128
|
+
abstract add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1129
|
+
abstract get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1130
|
+
abstract clear(sessionId: string): Promise<void>;
|
|
1131
|
+
abstract delete(sessionId: string): Promise<void>;
|
|
1132
|
+
abstract exists(sessionId: string): Promise<boolean>;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
declare class InMemoryStorage extends BaseMemoryStorage {
|
|
1136
|
+
private storage;
|
|
1137
|
+
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1138
|
+
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1139
|
+
clear(sessionId: string): Promise<void>;
|
|
1140
|
+
delete(sessionId: string): Promise<void>;
|
|
1141
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
interface PostgresConfig {
|
|
1145
|
+
connectionString?: string;
|
|
1146
|
+
host?: string;
|
|
1147
|
+
port?: number;
|
|
1148
|
+
database?: string;
|
|
1149
|
+
user?: string;
|
|
1150
|
+
password?: string;
|
|
1151
|
+
tableName?: string;
|
|
1152
|
+
}
|
|
1153
|
+
declare class PostgresStorage extends BaseMemoryStorage {
|
|
1154
|
+
private pool;
|
|
1155
|
+
private tableName;
|
|
1156
|
+
private initialized;
|
|
1157
|
+
constructor(config: PostgresConfig);
|
|
1158
|
+
private initPool;
|
|
1159
|
+
private createTableIfNotExists;
|
|
1160
|
+
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1161
|
+
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1162
|
+
clear(sessionId: string): Promise<void>;
|
|
1163
|
+
delete(sessionId: string): Promise<void>;
|
|
1164
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1165
|
+
disconnect(): Promise<void>;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
interface RedisConfig {
|
|
1169
|
+
host?: string;
|
|
1170
|
+
port?: number;
|
|
1171
|
+
password?: string;
|
|
1172
|
+
db?: number;
|
|
1173
|
+
url?: string;
|
|
1174
|
+
keyPrefix?: string;
|
|
1175
|
+
}
|
|
1176
|
+
declare class RedisStorage extends BaseMemoryStorage {
|
|
1177
|
+
private client;
|
|
1178
|
+
private keyPrefix;
|
|
1179
|
+
private connected;
|
|
1180
|
+
constructor(config: RedisConfig);
|
|
1181
|
+
private initClient;
|
|
1182
|
+
private getKey;
|
|
1183
|
+
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1184
|
+
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1185
|
+
clear(sessionId: string): Promise<void>;
|
|
1186
|
+
delete(sessionId: string): Promise<void>;
|
|
1187
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1188
|
+
disconnect(): Promise<void>;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
type MemoryType = "in-memory" | "redis" | "postgres";
|
|
1192
|
+
interface MemoryFactoryConfig {
|
|
1193
|
+
type: MemoryType;
|
|
1194
|
+
redis?: RedisConfig;
|
|
1195
|
+
postgres?: PostgresConfig;
|
|
1196
|
+
}
|
|
1197
|
+
declare function createMemoryStorage(config: MemoryFactoryConfig): MemoryStorage;
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* Options for overriding agent configuration
|
|
1201
|
+
*/
|
|
1202
|
+
interface AgentOptions {
|
|
1203
|
+
llm?: LLMProvider;
|
|
1204
|
+
tools?: ToolDefinition[];
|
|
1205
|
+
memory?: MemoryStorage;
|
|
1206
|
+
systemPrompt?: string;
|
|
1207
|
+
policyPath?: string;
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Sekuire Agent - Config-first AI agent
|
|
1211
|
+
*/
|
|
1212
|
+
declare class SekuireAgent {
|
|
1213
|
+
readonly name: string;
|
|
1214
|
+
private llm;
|
|
1215
|
+
private systemPrompt;
|
|
1216
|
+
private tools;
|
|
1217
|
+
private sessionId;
|
|
1218
|
+
private memory?;
|
|
1219
|
+
private maxHistoryMessages;
|
|
1220
|
+
private policyEnforcer?;
|
|
1221
|
+
constructor(config: {
|
|
1222
|
+
name: string;
|
|
1223
|
+
llm: LLMProvider;
|
|
1224
|
+
systemPrompt: string;
|
|
1225
|
+
tools: ToolDefinition[];
|
|
1226
|
+
memory?: MemoryStorage;
|
|
1227
|
+
maxHistoryMessages?: number;
|
|
1228
|
+
policyEnforcer?: PolicyEnforcer;
|
|
1229
|
+
});
|
|
1230
|
+
setSessionId(sessionId: string): void;
|
|
1231
|
+
/**
|
|
1232
|
+
* Chat with the agent
|
|
1233
|
+
*/
|
|
1234
|
+
chat(userMessage: string, options?: ChatOptions): Promise<string>;
|
|
1235
|
+
/**
|
|
1236
|
+
* Execute a tool by name
|
|
1237
|
+
*/
|
|
1238
|
+
executeTool(name: string, args: any): Promise<any>;
|
|
1239
|
+
/**
|
|
1240
|
+
* Stream chat response
|
|
1241
|
+
*/
|
|
1242
|
+
chatStream(userMessage: string, options?: ChatOptions): AsyncGenerator<string>;
|
|
1243
|
+
/**
|
|
1244
|
+
* Clear conversation history
|
|
1245
|
+
*/
|
|
1246
|
+
clearHistory(): Promise<void>;
|
|
1247
|
+
/**
|
|
1248
|
+
* Get conversation history
|
|
1249
|
+
*/
|
|
1250
|
+
getHistory(): Promise<Message[]>;
|
|
1251
|
+
/**
|
|
1252
|
+
* Get LLM provider name
|
|
1253
|
+
*/
|
|
1254
|
+
getLLMProvider(): string;
|
|
1255
|
+
/**
|
|
1256
|
+
* Get LLM model name
|
|
1257
|
+
*/
|
|
1258
|
+
getModelName(): string;
|
|
1259
|
+
/**
|
|
1260
|
+
* Get available tools
|
|
1261
|
+
*/
|
|
1262
|
+
getTools(): ToolDefinition[];
|
|
1263
|
+
/**
|
|
1264
|
+
* Get the active policy enforcer
|
|
1265
|
+
*/
|
|
1266
|
+
getPolicyEnforcer(): PolicyEnforcer | undefined;
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* Load an agent from sekuire.yml configuration
|
|
1270
|
+
*
|
|
1271
|
+
* @param agentName - Name of the agent to load (for multi-agent configs)
|
|
1272
|
+
* @param overrides - Optional overrides for agent configuration
|
|
1273
|
+
* @param configPath - Path to sekuire.yml (defaults to './sekuire.yml')
|
|
1274
|
+
* @returns Initialized agent instance
|
|
1275
|
+
*
|
|
1276
|
+
* @example
|
|
1277
|
+
* ```typescript
|
|
1278
|
+
* // Load agent from config
|
|
1279
|
+
* const agent = await getAgent('my-agent-openai');
|
|
1280
|
+
*
|
|
1281
|
+
* // Chat with the agent
|
|
1282
|
+
* const response = await agent.chat('Hello!');
|
|
1283
|
+
* console.log(response);
|
|
1284
|
+
* ```
|
|
1285
|
+
*/
|
|
1286
|
+
declare function getAgent(agentName?: string, overrides?: AgentOptions, configPath?: string): Promise<SekuireAgent>;
|
|
1287
|
+
/**
|
|
1288
|
+
* Load all agents from configuration
|
|
1289
|
+
*
|
|
1290
|
+
* @param configPath - Path to sekuire.yml
|
|
1291
|
+
* @returns Map of agent name to agent instance
|
|
1292
|
+
*
|
|
1293
|
+
* @example
|
|
1294
|
+
* ```typescript
|
|
1295
|
+
* const agents = await getAgents();
|
|
1296
|
+
* const openai = agents.get('my-agent-openai');
|
|
1297
|
+
* const claude = agents.get('my-agent-claude');
|
|
1298
|
+
* ```
|
|
1299
|
+
*/
|
|
1300
|
+
declare function getAgents(configPath?: string): Promise<Map<string, SekuireAgent>>;
|
|
1301
|
+
/**
|
|
1302
|
+
* Get system prompt for a specific agent from configuration
|
|
1303
|
+
*
|
|
1304
|
+
* @param agentName - Name of the agent (optional for single-agent configs)
|
|
1305
|
+
* @param configPath - Path to sekuire.yml (defaults to './sekuire.yml')
|
|
1306
|
+
* @returns The system prompt content
|
|
1307
|
+
*
|
|
1308
|
+
* @example
|
|
1309
|
+
* ```typescript
|
|
1310
|
+
* const prompt = await getSystemPrompt('my-agent-openai');
|
|
1311
|
+
* console.log(prompt);
|
|
1312
|
+
* ```
|
|
1313
|
+
*/
|
|
1314
|
+
declare function getSystemPrompt(agentName?: string, configPath?: string): Promise<string>;
|
|
1315
|
+
/**
|
|
1316
|
+
* Get tools for a specific agent from configuration
|
|
1317
|
+
*
|
|
1318
|
+
* @param agentName - Name of the agent (optional for single-agent configs)
|
|
1319
|
+
* @param configPath - Path to sekuire.yml (defaults to './sekuire.yml')
|
|
1320
|
+
* @returns The tools schema with tool definitions
|
|
1321
|
+
*
|
|
1322
|
+
* @example
|
|
1323
|
+
* ```typescript
|
|
1324
|
+
* const toolsSchema = await getTools('my-agent-openai');
|
|
1325
|
+
* console.log(toolsSchema.tools);
|
|
1326
|
+
* ```
|
|
1327
|
+
*/
|
|
1328
|
+
declare function getTools(agentName?: string, configPath?: string): Promise<ToolDefinition[]>;
|
|
1329
|
+
|
|
1330
|
+
/**
|
|
1331
|
+
* Base class for implementing Sekuire protocol servers
|
|
1332
|
+
*/
|
|
1333
|
+
declare abstract class SekuireServer {
|
|
1334
|
+
protected readonly agentId: string;
|
|
1335
|
+
protected readonly keyPair: KeyPair;
|
|
1336
|
+
constructor(agentId: string, keyPair: KeyPair);
|
|
1337
|
+
/**
|
|
1338
|
+
* Handle the HELLO handshake message
|
|
1339
|
+
*/
|
|
1340
|
+
handleHello(hello: HandshakeHello): Promise<HandshakeWelcome>;
|
|
1341
|
+
/**
|
|
1342
|
+
* Handle the AUTH handshake message
|
|
1343
|
+
*/
|
|
1344
|
+
handleAuth(auth: HandshakeAuth, clientNonce: string): Promise<void>;
|
|
1345
|
+
/**
|
|
1346
|
+
* Get the agent's public key
|
|
1347
|
+
*/
|
|
1348
|
+
getPublicKey(): string;
|
|
1349
|
+
/**
|
|
1350
|
+
* Get the agent's ID
|
|
1351
|
+
*/
|
|
1352
|
+
getAgentId(): string;
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Express.js middleware for Sekuire protocol
|
|
1356
|
+
*/
|
|
1357
|
+
declare function createSekuireExpressMiddleware(server: SekuireServer): any[];
|
|
1358
|
+
/**
|
|
1359
|
+
* Fastify plugin for Sekuire protocol
|
|
1360
|
+
*/
|
|
1361
|
+
declare function createSekuireFastifyPlugin(server: SekuireServer): (fastify: any, options: any) => Promise<void>;
|
|
1362
|
+
|
|
1363
|
+
interface ToolInput {
|
|
1364
|
+
[key: string]: string | number | boolean | object;
|
|
1365
|
+
}
|
|
1366
|
+
interface ToolParameter {
|
|
1367
|
+
name: string;
|
|
1368
|
+
type: "string" | "number" | "boolean" | "object";
|
|
1369
|
+
description: string;
|
|
1370
|
+
required: boolean;
|
|
1371
|
+
default?: string | number | boolean | object;
|
|
1372
|
+
}
|
|
1373
|
+
interface ToolMetadata {
|
|
1374
|
+
name: string;
|
|
1375
|
+
description: string;
|
|
1376
|
+
parameters: ToolParameter[];
|
|
1377
|
+
category?: string;
|
|
1378
|
+
compliance_level?: "public" | "internal" | "restricted" | "system";
|
|
1379
|
+
requires_approval?: boolean;
|
|
1380
|
+
}
|
|
1381
|
+
declare abstract class Tool {
|
|
1382
|
+
abstract metadata: ToolMetadata;
|
|
1383
|
+
protected policyEnforcer?: PolicyEnforcer;
|
|
1384
|
+
abstract execute(input: ToolInput): Promise<string | object>;
|
|
1385
|
+
setPolicyEnforcer(enforcer: PolicyEnforcer): void;
|
|
1386
|
+
validate(input: ToolInput): boolean;
|
|
1387
|
+
toSchema(): object;
|
|
1388
|
+
}
|
|
1389
|
+
declare class ToolRegistry {
|
|
1390
|
+
private tools;
|
|
1391
|
+
private categories;
|
|
1392
|
+
register(tool: Tool): void;
|
|
1393
|
+
get(name: string): Tool | undefined;
|
|
1394
|
+
getTool(name: string): Tool | undefined;
|
|
1395
|
+
list(): Tool[];
|
|
1396
|
+
getAllTools(): Tool[];
|
|
1397
|
+
getSchemas(): object[];
|
|
1398
|
+
getToolsByCategory(category: string): string[];
|
|
1399
|
+
getAllCategories(): string[];
|
|
1400
|
+
hasCategory(category: string): boolean;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
/**
|
|
1404
|
+
* Agent Discovery Tool - Find other agents by capability
|
|
1405
|
+
*/
|
|
1406
|
+
declare class AgentDiscoveryTool extends Tool {
|
|
1407
|
+
metadata: ToolMetadata;
|
|
1408
|
+
execute(input: ToolInput): Promise<string>;
|
|
1409
|
+
}
|
|
1410
|
+
/**
|
|
1411
|
+
* Agent Delegation Tool - Delegate tasks to other agents
|
|
1412
|
+
*/
|
|
1413
|
+
declare class AgentDelegationTool extends Tool {
|
|
1414
|
+
metadata: ToolMetadata;
|
|
1415
|
+
execute(input: ToolInput): Promise<string>;
|
|
1416
|
+
}
|
|
1417
|
+
/**
|
|
1418
|
+
* Agent Status Check Tool - Check if an agent is available
|
|
1419
|
+
*/
|
|
1420
|
+
declare class AgentStatusTool extends Tool {
|
|
1421
|
+
metadata: ToolMetadata;
|
|
1422
|
+
execute(input: ToolInput): Promise<string>;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
/**
|
|
1426
|
+
* Tool for invoking other Sekuire agents
|
|
1427
|
+
* Performs handshake and sends requests to verified agents
|
|
1428
|
+
*/
|
|
1429
|
+
declare class InvokeAgentTool implements Tool {
|
|
1430
|
+
private readonly privateKey?;
|
|
1431
|
+
private readonly publicKey?;
|
|
1432
|
+
private readonly registryUrl;
|
|
1433
|
+
name: string;
|
|
1434
|
+
description: string;
|
|
1435
|
+
parameters: {
|
|
1436
|
+
type: "object";
|
|
1437
|
+
properties: {
|
|
1438
|
+
agent_url: {
|
|
1439
|
+
type: "string";
|
|
1440
|
+
description: string;
|
|
1441
|
+
};
|
|
1442
|
+
agent_id: {
|
|
1443
|
+
type: "string";
|
|
1444
|
+
description: string;
|
|
1445
|
+
};
|
|
1446
|
+
request: {
|
|
1447
|
+
type: "string";
|
|
1448
|
+
description: string;
|
|
1449
|
+
};
|
|
1450
|
+
parameters: {
|
|
1451
|
+
type: "object";
|
|
1452
|
+
description: string;
|
|
1453
|
+
};
|
|
1454
|
+
};
|
|
1455
|
+
required: string[];
|
|
1456
|
+
};
|
|
1457
|
+
metadata: ToolMetadata;
|
|
1458
|
+
private client;
|
|
1459
|
+
constructor(privateKey?: string | undefined, publicKey?: string | undefined, registryUrl?: string);
|
|
1460
|
+
execute(args: Record<string, any>): Promise<string>;
|
|
1461
|
+
}
|
|
1462
|
+
/**
|
|
1463
|
+
* Tool for searching the Sekuire registry for agents
|
|
1464
|
+
*/
|
|
1465
|
+
declare class SearchAgentsTool implements Tool {
|
|
1466
|
+
private readonly privateKey?;
|
|
1467
|
+
private readonly publicKey?;
|
|
1468
|
+
private readonly registryUrl;
|
|
1469
|
+
name: string;
|
|
1470
|
+
description: string;
|
|
1471
|
+
parameters: {
|
|
1472
|
+
type: "object";
|
|
1473
|
+
properties: {
|
|
1474
|
+
query: {
|
|
1475
|
+
type: "string";
|
|
1476
|
+
description: string;
|
|
1477
|
+
};
|
|
1478
|
+
limit: {
|
|
1479
|
+
type: "number";
|
|
1480
|
+
description: string;
|
|
1481
|
+
};
|
|
1482
|
+
};
|
|
1483
|
+
required: string[];
|
|
1484
|
+
};
|
|
1485
|
+
metadata: ToolMetadata;
|
|
1486
|
+
private client;
|
|
1487
|
+
constructor(privateKey?: string | undefined, publicKey?: string | undefined, registryUrl?: string);
|
|
1488
|
+
execute(args: Record<string, any>): Promise<string>;
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1491
|
+
* Tool for getting detailed information about a specific agent
|
|
1492
|
+
*/
|
|
1493
|
+
declare class GetAgentInfoTool implements Tool {
|
|
1494
|
+
private readonly privateKey?;
|
|
1495
|
+
private readonly publicKey?;
|
|
1496
|
+
private readonly registryUrl;
|
|
1497
|
+
name: string;
|
|
1498
|
+
description: string;
|
|
1499
|
+
parameters: {
|
|
1500
|
+
type: "object";
|
|
1501
|
+
properties: {
|
|
1502
|
+
agent_id: {
|
|
1503
|
+
type: "string";
|
|
1504
|
+
description: string;
|
|
1505
|
+
};
|
|
1506
|
+
};
|
|
1507
|
+
required: string[];
|
|
1508
|
+
};
|
|
1509
|
+
metadata: ToolMetadata;
|
|
1510
|
+
private client;
|
|
1511
|
+
constructor(privateKey?: string | undefined, publicKey?: string | undefined, registryUrl?: string);
|
|
1512
|
+
execute(args: Record<string, any>): Promise<string>;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
declare class CalculatorTool extends Tool {
|
|
1516
|
+
metadata: ToolMetadata;
|
|
1517
|
+
execute(input: ToolInput): Promise<string>;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
declare class AuditLogTool extends Tool {
|
|
1521
|
+
metadata: ToolMetadata;
|
|
1522
|
+
execute(input: {
|
|
1523
|
+
action: string;
|
|
1524
|
+
actor?: string;
|
|
1525
|
+
resource?: string;
|
|
1526
|
+
metadata?: any;
|
|
1527
|
+
}): Promise<{
|
|
1528
|
+
logged: boolean;
|
|
1529
|
+
}>;
|
|
1530
|
+
}
|
|
1531
|
+
declare class PiiDetectTool extends Tool {
|
|
1532
|
+
metadata: ToolMetadata;
|
|
1533
|
+
execute(input: {
|
|
1534
|
+
text: string;
|
|
1535
|
+
}): Promise<{
|
|
1536
|
+
detected: boolean;
|
|
1537
|
+
types: string[];
|
|
1538
|
+
matches: any[];
|
|
1539
|
+
}>;
|
|
1540
|
+
}
|
|
1541
|
+
declare class EncryptDataTool extends Tool {
|
|
1542
|
+
metadata: ToolMetadata;
|
|
1543
|
+
execute(input: {
|
|
1544
|
+
data: string;
|
|
1545
|
+
key?: string;
|
|
1546
|
+
}): Promise<{
|
|
1547
|
+
encrypted: string;
|
|
1548
|
+
iv: string;
|
|
1549
|
+
}>;
|
|
1550
|
+
}
|
|
1551
|
+
declare class DecryptDataTool extends Tool {
|
|
1552
|
+
metadata: ToolMetadata;
|
|
1553
|
+
execute(input: {
|
|
1554
|
+
encrypted: string;
|
|
1555
|
+
iv: string;
|
|
1556
|
+
key: string;
|
|
1557
|
+
}): Promise<string>;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
declare class JsonStringifyTool extends Tool {
|
|
1561
|
+
metadata: ToolMetadata;
|
|
1562
|
+
execute(input: {
|
|
1563
|
+
data: any;
|
|
1564
|
+
pretty?: boolean;
|
|
1565
|
+
}): Promise<string>;
|
|
1566
|
+
}
|
|
1567
|
+
declare class CsvParseTool extends Tool {
|
|
1568
|
+
metadata: ToolMetadata;
|
|
1569
|
+
execute(input: {
|
|
1570
|
+
csv: string;
|
|
1571
|
+
delimiter?: string;
|
|
1572
|
+
headers?: boolean;
|
|
1573
|
+
}): Promise<any[]>;
|
|
1574
|
+
}
|
|
1575
|
+
declare class CsvWriteTool extends Tool {
|
|
1576
|
+
metadata: ToolMetadata;
|
|
1577
|
+
execute(input: {
|
|
1578
|
+
data: any[];
|
|
1579
|
+
delimiter?: string;
|
|
1580
|
+
headers?: boolean;
|
|
1581
|
+
}): Promise<string>;
|
|
1582
|
+
}
|
|
1583
|
+
declare class YamlParseTool extends Tool {
|
|
1584
|
+
metadata: ToolMetadata;
|
|
1585
|
+
execute(input: {
|
|
1586
|
+
yaml: string;
|
|
1587
|
+
}): Promise<any>;
|
|
1588
|
+
}
|
|
1589
|
+
declare class XmlParseTool extends Tool {
|
|
1590
|
+
metadata: ToolMetadata;
|
|
1591
|
+
execute(input: {
|
|
1592
|
+
xml: string;
|
|
1593
|
+
}): Promise<any>;
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
declare class JsonParseTool extends Tool {
|
|
1597
|
+
metadata: ToolMetadata;
|
|
1598
|
+
execute(input: ToolInput): Promise<string>;
|
|
1599
|
+
}
|
|
1600
|
+
declare class Base64EncodeTool extends Tool {
|
|
1601
|
+
metadata: ToolMetadata;
|
|
1602
|
+
execute(input: ToolInput): Promise<string>;
|
|
1603
|
+
}
|
|
1604
|
+
declare class Base64DecodeTool extends Tool {
|
|
1605
|
+
metadata: ToolMetadata;
|
|
1606
|
+
execute(input: ToolInput): Promise<string>;
|
|
1607
|
+
}
|
|
1608
|
+
declare class HashTool extends Tool {
|
|
1609
|
+
metadata: ToolMetadata;
|
|
1610
|
+
execute(input: ToolInput): Promise<string>;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
declare class DirectoryListTool extends Tool {
|
|
1614
|
+
metadata: ToolMetadata;
|
|
1615
|
+
execute(input: ToolInput): Promise<string>;
|
|
1616
|
+
}
|
|
1617
|
+
declare class DirectoryMkdirTool extends Tool {
|
|
1618
|
+
metadata: ToolMetadata;
|
|
1619
|
+
execute(input: ToolInput): Promise<string>;
|
|
1620
|
+
}
|
|
1621
|
+
declare class DirectoryRmdirTool extends Tool {
|
|
1622
|
+
metadata: ToolMetadata;
|
|
1623
|
+
execute(input: ToolInput): Promise<string>;
|
|
1624
|
+
}
|
|
1625
|
+
declare class DirectoryRmRecursiveTool extends Tool {
|
|
1626
|
+
metadata: ToolMetadata;
|
|
1627
|
+
execute(input: ToolInput): Promise<string>;
|
|
1628
|
+
}
|
|
1629
|
+
declare class DirectoryExistsTool extends Tool {
|
|
1630
|
+
metadata: ToolMetadata;
|
|
1631
|
+
execute(input: ToolInput): Promise<string>;
|
|
1632
|
+
}
|
|
1633
|
+
declare class DirectoryMoveTool extends Tool {
|
|
1634
|
+
metadata: ToolMetadata;
|
|
1635
|
+
execute(input: {
|
|
1636
|
+
source: string;
|
|
1637
|
+
destination: string;
|
|
1638
|
+
}): Promise<{
|
|
1639
|
+
moved: boolean;
|
|
1640
|
+
}>;
|
|
1641
|
+
}
|
|
1642
|
+
declare class DirectoryCopyTool extends Tool {
|
|
1643
|
+
metadata: ToolMetadata;
|
|
1644
|
+
execute(input: {
|
|
1645
|
+
source: string;
|
|
1646
|
+
destination: string;
|
|
1647
|
+
}): Promise<{
|
|
1648
|
+
copied: boolean;
|
|
1649
|
+
}>;
|
|
1650
|
+
}
|
|
1651
|
+
declare class DirectoryTreeTool extends Tool {
|
|
1652
|
+
metadata: ToolMetadata;
|
|
1653
|
+
execute(input: {
|
|
1654
|
+
path: string;
|
|
1655
|
+
depth?: number;
|
|
1656
|
+
}): Promise<any>;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
declare class FileReadTool extends Tool {
|
|
1660
|
+
metadata: ToolMetadata;
|
|
1661
|
+
execute(input: ToolInput): Promise<string>;
|
|
1662
|
+
}
|
|
1663
|
+
declare class FileWriteTool extends Tool {
|
|
1664
|
+
metadata: ToolMetadata;
|
|
1665
|
+
execute(input: ToolInput): Promise<string>;
|
|
1666
|
+
}
|
|
1667
|
+
declare class FileListTool extends Tool {
|
|
1668
|
+
metadata: ToolMetadata;
|
|
1669
|
+
execute(input: ToolInput): Promise<string>;
|
|
1670
|
+
}
|
|
1671
|
+
declare class FileAppendTool extends Tool {
|
|
1672
|
+
metadata: ToolMetadata;
|
|
1673
|
+
execute(input: ToolInput): Promise<string>;
|
|
1674
|
+
}
|
|
1675
|
+
declare class FileDeleteTool extends Tool {
|
|
1676
|
+
metadata: ToolMetadata;
|
|
1677
|
+
execute(input: ToolInput): Promise<string>;
|
|
1678
|
+
}
|
|
1679
|
+
declare class FileMoveTool extends Tool {
|
|
1680
|
+
metadata: ToolMetadata;
|
|
1681
|
+
execute(input: ToolInput): Promise<string>;
|
|
1682
|
+
}
|
|
1683
|
+
declare class FileCopyTool extends Tool {
|
|
1684
|
+
metadata: ToolMetadata;
|
|
1685
|
+
execute(input: ToolInput): Promise<string>;
|
|
1686
|
+
}
|
|
1687
|
+
declare class FileStatTool extends Tool {
|
|
1688
|
+
metadata: ToolMetadata;
|
|
1689
|
+
execute(input: ToolInput): Promise<string>;
|
|
1690
|
+
}
|
|
1691
|
+
declare class FileExistsTool extends Tool {
|
|
1692
|
+
metadata: ToolMetadata;
|
|
1693
|
+
execute(input: ToolInput): Promise<string>;
|
|
1694
|
+
}
|
|
1695
|
+
declare class FileChmodTool extends Tool {
|
|
1696
|
+
metadata: ToolMetadata;
|
|
1697
|
+
execute(input: {
|
|
1698
|
+
path: string;
|
|
1699
|
+
mode: string | number;
|
|
1700
|
+
}): Promise<{
|
|
1701
|
+
changed: boolean;
|
|
1702
|
+
}>;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
declare class HttpRequestTool extends Tool {
|
|
1706
|
+
metadata: ToolMetadata;
|
|
1707
|
+
execute(input: ToolInput): Promise<string | object>;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
declare class HttpPostTool extends Tool {
|
|
1711
|
+
metadata: ToolMetadata;
|
|
1712
|
+
execute(input: {
|
|
1713
|
+
url: string;
|
|
1714
|
+
body?: any;
|
|
1715
|
+
headers?: Record<string, string>;
|
|
1716
|
+
}): Promise<any>;
|
|
1717
|
+
}
|
|
1718
|
+
declare class HttpPutTool extends Tool {
|
|
1719
|
+
metadata: ToolMetadata;
|
|
1720
|
+
execute(input: {
|
|
1721
|
+
url: string;
|
|
1722
|
+
body?: any;
|
|
1723
|
+
headers?: Record<string, string>;
|
|
1724
|
+
}): Promise<any>;
|
|
1725
|
+
}
|
|
1726
|
+
declare class HttpDeleteTool extends Tool {
|
|
1727
|
+
metadata: ToolMetadata;
|
|
1728
|
+
execute(input: {
|
|
1729
|
+
url: string;
|
|
1730
|
+
headers?: Record<string, string>;
|
|
1731
|
+
}): Promise<any>;
|
|
1732
|
+
}
|
|
1733
|
+
declare class DownloadFileTool extends Tool {
|
|
1734
|
+
metadata: ToolMetadata;
|
|
1735
|
+
execute(input: {
|
|
1736
|
+
url: string;
|
|
1737
|
+
destination: string;
|
|
1738
|
+
}): Promise<{
|
|
1739
|
+
path: string;
|
|
1740
|
+
size: number;
|
|
1741
|
+
}>;
|
|
1742
|
+
}
|
|
1743
|
+
declare class DnsLookupTool extends Tool {
|
|
1744
|
+
metadata: ToolMetadata;
|
|
1745
|
+
execute(input: {
|
|
1746
|
+
hostname: string;
|
|
1747
|
+
}): Promise<{
|
|
1748
|
+
addresses: string[];
|
|
1749
|
+
}>;
|
|
1750
|
+
}
|
|
1751
|
+
declare class PingTool extends Tool {
|
|
1752
|
+
metadata: ToolMetadata;
|
|
1753
|
+
execute(input: {
|
|
1754
|
+
host: string;
|
|
1755
|
+
count?: number;
|
|
1756
|
+
}): Promise<{
|
|
1757
|
+
alive: boolean;
|
|
1758
|
+
time?: number;
|
|
1759
|
+
}>;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
declare class ToolPatternParser {
|
|
1763
|
+
/**
|
|
1764
|
+
* Get the tool name prefix for a category
|
|
1765
|
+
* "files" -> "file"
|
|
1766
|
+
* "directories" -> "dir"
|
|
1767
|
+
* "network" -> "http" or "network"
|
|
1768
|
+
*/
|
|
1769
|
+
private static getCategoryPrefix;
|
|
1770
|
+
/**
|
|
1771
|
+
* Parse tool patterns:
|
|
1772
|
+
* "calculator" => ["calculator"]
|
|
1773
|
+
* "files:*" => ["file_read", "file_write", "file_delete", ...]
|
|
1774
|
+
* "files:[read,write]" => ["file_read", "file_write"]
|
|
1775
|
+
*/
|
|
1776
|
+
static parse(pattern: string, registry: ToolRegistry): string[];
|
|
1777
|
+
/**
|
|
1778
|
+
* Expand multiple patterns into unique tool names
|
|
1779
|
+
*/
|
|
1780
|
+
static expandPatterns(patterns: string[], registry: ToolRegistry): string[];
|
|
1781
|
+
/**
|
|
1782
|
+
* Filter allowed tools by removing blocked ones
|
|
1783
|
+
*/
|
|
1784
|
+
static filterBlocked(allowedTools: string[], blockedTools: string[]): string[];
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
declare class GetCwdTool extends Tool {
|
|
1788
|
+
metadata: ToolMetadata;
|
|
1789
|
+
execute(): Promise<string>;
|
|
1790
|
+
}
|
|
1791
|
+
declare class GetPlatformTool extends Tool {
|
|
1792
|
+
metadata: ToolMetadata;
|
|
1793
|
+
execute(): Promise<any>;
|
|
1794
|
+
}
|
|
1795
|
+
declare class EnvGetTool extends Tool {
|
|
1796
|
+
metadata: ToolMetadata;
|
|
1797
|
+
execute(input: {
|
|
1798
|
+
key: string;
|
|
1799
|
+
}): Promise<string>;
|
|
1800
|
+
}
|
|
1801
|
+
declare class EnvSetTool extends Tool {
|
|
1802
|
+
metadata: ToolMetadata;
|
|
1803
|
+
execute(input: {
|
|
1804
|
+
key: string;
|
|
1805
|
+
value: string;
|
|
1806
|
+
}): Promise<{
|
|
1807
|
+
set: boolean;
|
|
1808
|
+
}>;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
declare class DateFormatTool extends Tool {
|
|
1812
|
+
metadata: ToolMetadata;
|
|
1813
|
+
execute(input: {
|
|
1814
|
+
date?: string | number;
|
|
1815
|
+
format?: string;
|
|
1816
|
+
}): Promise<string>;
|
|
1817
|
+
}
|
|
1818
|
+
declare class GenerateUuidTool extends Tool {
|
|
1819
|
+
metadata: ToolMetadata;
|
|
1820
|
+
execute(): Promise<string>;
|
|
1821
|
+
}
|
|
1822
|
+
declare class RandomNumberTool extends Tool {
|
|
1823
|
+
metadata: ToolMetadata;
|
|
1824
|
+
execute(input: {
|
|
1825
|
+
min?: number;
|
|
1826
|
+
max?: number;
|
|
1827
|
+
}): Promise<string>;
|
|
1828
|
+
}
|
|
1829
|
+
declare class SleepTool extends Tool {
|
|
1830
|
+
metadata: ToolMetadata;
|
|
1831
|
+
execute(input: {
|
|
1832
|
+
milliseconds: number;
|
|
1833
|
+
}): Promise<{
|
|
1834
|
+
slept: number;
|
|
1835
|
+
}>;
|
|
1836
|
+
}
|
|
1837
|
+
declare class RegexMatchTool extends Tool {
|
|
1838
|
+
metadata: ToolMetadata;
|
|
1839
|
+
execute(input: {
|
|
1840
|
+
text: string;
|
|
1841
|
+
pattern: string;
|
|
1842
|
+
flags?: string;
|
|
1843
|
+
}): Promise<{
|
|
1844
|
+
matches: string[];
|
|
1845
|
+
groups?: any[];
|
|
1846
|
+
}>;
|
|
1847
|
+
}
|
|
1848
|
+
declare class UrlParseTool extends Tool {
|
|
1849
|
+
metadata: ToolMetadata;
|
|
1850
|
+
execute(input: {
|
|
1851
|
+
url: string;
|
|
1852
|
+
}): Promise<any>;
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* ⚠️ CRITICAL SYSTEM TOOL - DO NOT EDIT OR DELETE ⚠️
|
|
1857
|
+
*
|
|
1858
|
+
* This tool is automatically included by Sekuire to verify agent compliance
|
|
1859
|
+
* and verification status. Removing or modifying this tool will prevent your
|
|
1860
|
+
* agent from being properly verified and may result in trust protocol violations.
|
|
1861
|
+
*
|
|
1862
|
+
* This tool queries the Sekuire registry to check:
|
|
1863
|
+
* - Agent verification status (verified/unverified/pending)
|
|
1864
|
+
* - Compliance framework adherence
|
|
1865
|
+
* - Security score and reputation
|
|
1866
|
+
* - Code review status
|
|
1867
|
+
*/
|
|
1868
|
+
|
|
1869
|
+
declare class VerificationStatusTool extends Tool {
|
|
1870
|
+
metadata: ToolMetadata;
|
|
1871
|
+
private registryUrl;
|
|
1872
|
+
constructor(registryUrl?: string);
|
|
1873
|
+
execute(input: ToolInput): Promise<string>;
|
|
1874
|
+
/**
|
|
1875
|
+
* Get the current agent's Sekuire ID from environment or config
|
|
1876
|
+
*/
|
|
1877
|
+
private getAgentId;
|
|
1878
|
+
/**
|
|
1879
|
+
* Extract compliance frameworks from manifest
|
|
1880
|
+
*/
|
|
1881
|
+
private extractComplianceFrameworks;
|
|
1882
|
+
/**
|
|
1883
|
+
* Determine if agent is compliant based on verification status and checks
|
|
1884
|
+
*/
|
|
1885
|
+
private isCompliant;
|
|
1886
|
+
/**
|
|
1887
|
+
* Calculate overall compliance score
|
|
1888
|
+
*/
|
|
1889
|
+
private calculateComplianceScore;
|
|
1890
|
+
/**
|
|
1891
|
+
* Format the response for the agent
|
|
1892
|
+
*/
|
|
1893
|
+
private formatResponse;
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
declare class WebSearchTool extends Tool {
|
|
1897
|
+
metadata: ToolMetadata;
|
|
1898
|
+
execute(input: ToolInput): Promise<string>;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
interface ToolRegistryOptions {
|
|
1902
|
+
privateKey?: string;
|
|
1903
|
+
publicKey?: string;
|
|
1904
|
+
registryUrl?: string;
|
|
1905
|
+
}
|
|
1906
|
+
declare function createDefaultToolRegistry(options?: ToolRegistryOptions): ToolRegistry;
|
|
1907
|
+
declare const builtInTools: {
|
|
1908
|
+
FileReadTool: typeof FileReadTool;
|
|
1909
|
+
FileWriteTool: typeof FileWriteTool;
|
|
1910
|
+
FileAppendTool: typeof FileAppendTool;
|
|
1911
|
+
FileDeleteTool: typeof FileDeleteTool;
|
|
1912
|
+
FileMoveTool: typeof FileMoveTool;
|
|
1913
|
+
FileCopyTool: typeof FileCopyTool;
|
|
1914
|
+
FileStatTool: typeof FileStatTool;
|
|
1915
|
+
FileExistsTool: typeof FileExistsTool;
|
|
1916
|
+
FileListTool: typeof FileListTool;
|
|
1917
|
+
FileChmodTool: typeof FileChmodTool;
|
|
1918
|
+
DirectoryListTool: typeof DirectoryListTool;
|
|
1919
|
+
DirectoryMkdirTool: typeof DirectoryMkdirTool;
|
|
1920
|
+
DirectoryRmdirTool: typeof DirectoryRmdirTool;
|
|
1921
|
+
DirectoryRmRecursiveTool: typeof DirectoryRmRecursiveTool;
|
|
1922
|
+
DirectoryExistsTool: typeof DirectoryExistsTool;
|
|
1923
|
+
DirectoryMoveTool: typeof DirectoryMoveTool;
|
|
1924
|
+
DirectoryCopyTool: typeof DirectoryCopyTool;
|
|
1925
|
+
DirectoryTreeTool: typeof DirectoryTreeTool;
|
|
1926
|
+
WebSearchTool: typeof WebSearchTool;
|
|
1927
|
+
HttpRequestTool: typeof HttpRequestTool;
|
|
1928
|
+
HttpPostTool: typeof HttpPostTool;
|
|
1929
|
+
HttpPutTool: typeof HttpPutTool;
|
|
1930
|
+
HttpDeleteTool: typeof HttpDeleteTool;
|
|
1931
|
+
DownloadFileTool: typeof DownloadFileTool;
|
|
1932
|
+
DnsLookupTool: typeof DnsLookupTool;
|
|
1933
|
+
PingTool: typeof PingTool;
|
|
1934
|
+
JsonParseTool: typeof JsonParseTool;
|
|
1935
|
+
JsonStringifyTool: typeof JsonStringifyTool;
|
|
1936
|
+
CsvParseTool: typeof CsvParseTool;
|
|
1937
|
+
CsvWriteTool: typeof CsvWriteTool;
|
|
1938
|
+
YamlParseTool: typeof YamlParseTool;
|
|
1939
|
+
XmlParseTool: typeof XmlParseTool;
|
|
1940
|
+
Base64EncodeTool: typeof Base64EncodeTool;
|
|
1941
|
+
Base64DecodeTool: typeof Base64DecodeTool;
|
|
1942
|
+
HashTool: typeof HashTool;
|
|
1943
|
+
CalculatorTool: typeof CalculatorTool;
|
|
1944
|
+
DateFormatTool: typeof DateFormatTool;
|
|
1945
|
+
GenerateUuidTool: typeof GenerateUuidTool;
|
|
1946
|
+
RandomNumberTool: typeof RandomNumberTool;
|
|
1947
|
+
SleepTool: typeof SleepTool;
|
|
1948
|
+
RegexMatchTool: typeof RegexMatchTool;
|
|
1949
|
+
UrlParseTool: typeof UrlParseTool;
|
|
1950
|
+
GetCwdTool: typeof GetCwdTool;
|
|
1951
|
+
GetPlatformTool: typeof GetPlatformTool;
|
|
1952
|
+
EnvGetTool: typeof EnvGetTool;
|
|
1953
|
+
EnvSetTool: typeof EnvSetTool;
|
|
1954
|
+
SearchAgentsTool: typeof SearchAgentsTool;
|
|
1955
|
+
GetAgentInfoTool: typeof GetAgentInfoTool;
|
|
1956
|
+
InvokeAgentTool: typeof InvokeAgentTool;
|
|
1957
|
+
AgentDiscoveryTool: typeof AgentDiscoveryTool;
|
|
1958
|
+
AgentDelegationTool: typeof AgentDelegationTool;
|
|
1959
|
+
AgentStatusTool: typeof AgentStatusTool;
|
|
1960
|
+
VerificationStatusTool: typeof VerificationStatusTool;
|
|
1961
|
+
AuditLogTool: typeof AuditLogTool;
|
|
1962
|
+
PiiDetectTool: typeof PiiDetectTool;
|
|
1963
|
+
EncryptDataTool: typeof EncryptDataTool;
|
|
1964
|
+
DecryptDataTool: typeof DecryptDataTool;
|
|
1965
|
+
};
|
|
1966
|
+
|
|
1967
|
+
/**
|
|
1968
|
+
* Generate a new Ed25519 keypair for Sekuire operations
|
|
1969
|
+
*/
|
|
1970
|
+
declare function generateKeyPair(): KeyPair;
|
|
1971
|
+
/**
|
|
1972
|
+
* Calculate Sekuire ID from agent configuration
|
|
1973
|
+
*/
|
|
1974
|
+
declare function calculateSekuireId(params: {
|
|
1975
|
+
model: string;
|
|
1976
|
+
systemPrompt: string;
|
|
1977
|
+
tools: string;
|
|
1978
|
+
projectName: string;
|
|
1979
|
+
projectVersion: string;
|
|
1980
|
+
}): string;
|
|
1981
|
+
/**
|
|
1982
|
+
* Create a SekuireClient with sensible defaults
|
|
1983
|
+
*/
|
|
1984
|
+
declare function createSekuireClient(keyPair: KeyPair, registryUrl?: string, options?: Partial<SekuireClientConfig>): SekuireClient;
|
|
1985
|
+
|
|
1986
|
+
export { SekuireAgent as Agent, AgentIdentity, AnthropicProvider, ComplianceError, ComplianceMonitor, ContentPolicyError, CryptoError, FileAccessError, GoogleProvider, InMemoryStorage, NetworkComplianceError, NetworkError, OllamaProvider, OpenAIProvider, PolicyClient, PolicyEnforcer, PolicyViolationError, PostgresStorage, ProtocolError, RedisStorage, SekuireAgent$1 as SekuireAgent, SekuireAgentBuilder, SekuireClient, SekuireCrypto, SekuireError, SekuireLogger, SekuireServer, Tool, ToolPatternParser, ToolRegistry, ToolUsageError, builtInTools, calculateSekuireId, createAgent, createDefaultToolRegistry, createLLMProvider, createMemoryStorage, createSekuireClient, createSekuireExpressMiddleware, createSekuireFastifyPlugin, generateKeyPair, getAgent, getAgentConfig, getAgents, getTools$1 as getLegacyTools, getSystemPrompt, getTools, llm, loadConfig, loadSystemPrompt, loadTools, tool, tools };
|
|
1987
|
+
export type { ActivePolicy, ActivePolicyResponse, AgentConfig, AgentId, AgentInvokeOptions, AgentOptions, AgentResponse$1 as AgentResponse, ChatChunk, ChatOptions, ChatResponse, ComplianceConfig, ComplianceViolation, ToolDefinition as ConfigToolDefinition, CreateOrgRequest, CreateWorkspaceRequest, DisputeRequest, EventLog, EventType, HandshakeAuth, HandshakeHello, HandshakeResult, HandshakeWelcome, HexString, IdentityConfig, InviteRequest, InviteResponse, KeyPair, LLMConfig, Message as LLMMessage, LLMProvider, LLMProviderConfig, LoggerConfig$1 as LoggerConfig, Manifest, MemoryConfig, MemoryFactoryConfig, MemoryMessage, MemoryStorage, MemoryType, Message$1 as Message, OrgResponse, OrgSummary, PostgresConfig, ProjectMetadata, PublishRequest, RedisConfig, ReputationLog, ReputationResponse, SekuireAgentConfig, SekuireClientConfig, SekuireConfig, Severity, SubmitReputationRequest, ToolCall, ToolDefinition$1 as ToolDefinition, ToolInput, ToolMetadata, ToolParameter, ToolsSchema, UserContextResponse, VerificationStatus, VerifyAgentRequest, WorkspaceResponse, WorkspaceSummary };
|