@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
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Tool, ToolMetadata } from "./base";
|
|
2
|
+
/**
|
|
3
|
+
* Tool for invoking other Sekuire agents
|
|
4
|
+
* Performs handshake and sends requests to verified agents
|
|
5
|
+
*/
|
|
6
|
+
export declare class InvokeAgentTool implements Tool {
|
|
7
|
+
private readonly privateKey?;
|
|
8
|
+
private readonly publicKey?;
|
|
9
|
+
private readonly registryUrl;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
parameters: {
|
|
13
|
+
type: "object";
|
|
14
|
+
properties: {
|
|
15
|
+
agent_url: {
|
|
16
|
+
type: "string";
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
agent_id: {
|
|
20
|
+
type: "string";
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
request: {
|
|
24
|
+
type: "string";
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
parameters: {
|
|
28
|
+
type: "object";
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
required: string[];
|
|
33
|
+
};
|
|
34
|
+
metadata: ToolMetadata;
|
|
35
|
+
private client;
|
|
36
|
+
constructor(privateKey?: string | undefined, publicKey?: string | undefined, registryUrl?: string);
|
|
37
|
+
execute(args: Record<string, any>): Promise<string>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Tool for searching the Sekuire registry for agents
|
|
41
|
+
*/
|
|
42
|
+
export declare class SearchAgentsTool implements Tool {
|
|
43
|
+
private readonly privateKey?;
|
|
44
|
+
private readonly publicKey?;
|
|
45
|
+
private readonly registryUrl;
|
|
46
|
+
name: string;
|
|
47
|
+
description: string;
|
|
48
|
+
parameters: {
|
|
49
|
+
type: "object";
|
|
50
|
+
properties: {
|
|
51
|
+
query: {
|
|
52
|
+
type: "string";
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
limit: {
|
|
56
|
+
type: "number";
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
required: string[];
|
|
61
|
+
};
|
|
62
|
+
metadata: ToolMetadata;
|
|
63
|
+
private client;
|
|
64
|
+
constructor(privateKey?: string | undefined, publicKey?: string | undefined, registryUrl?: string);
|
|
65
|
+
execute(args: Record<string, any>): Promise<string>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Tool for getting detailed information about a specific agent
|
|
69
|
+
*/
|
|
70
|
+
export declare class GetAgentInfoTool implements Tool {
|
|
71
|
+
private readonly privateKey?;
|
|
72
|
+
private readonly publicKey?;
|
|
73
|
+
private readonly registryUrl;
|
|
74
|
+
name: string;
|
|
75
|
+
description: string;
|
|
76
|
+
parameters: {
|
|
77
|
+
type: "object";
|
|
78
|
+
properties: {
|
|
79
|
+
agent_id: {
|
|
80
|
+
type: "string";
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
required: string[];
|
|
85
|
+
};
|
|
86
|
+
metadata: ToolMetadata;
|
|
87
|
+
private client;
|
|
88
|
+
constructor(privateKey?: string | undefined, publicKey?: string | undefined, registryUrl?: string);
|
|
89
|
+
execute(args: Record<string, any>): Promise<string>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { PolicyEnforcer } from "../policy-enforcer";
|
|
2
|
+
export interface ToolInput {
|
|
3
|
+
[key: string]: string | number | boolean | object;
|
|
4
|
+
}
|
|
5
|
+
export interface ToolParameter {
|
|
6
|
+
name: string;
|
|
7
|
+
type: "string" | "number" | "boolean" | "object";
|
|
8
|
+
description: string;
|
|
9
|
+
required: boolean;
|
|
10
|
+
default?: string | number | boolean | object;
|
|
11
|
+
}
|
|
12
|
+
export interface ToolMetadata {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
parameters: ToolParameter[];
|
|
16
|
+
category?: string;
|
|
17
|
+
compliance_level?: "public" | "internal" | "restricted" | "system";
|
|
18
|
+
requires_approval?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare abstract class Tool {
|
|
21
|
+
abstract metadata: ToolMetadata;
|
|
22
|
+
protected policyEnforcer?: PolicyEnforcer;
|
|
23
|
+
abstract execute(input: ToolInput): Promise<string | object>;
|
|
24
|
+
setPolicyEnforcer(enforcer: PolicyEnforcer): void;
|
|
25
|
+
validate(input: ToolInput): boolean;
|
|
26
|
+
toSchema(): object;
|
|
27
|
+
}
|
|
28
|
+
export declare class ToolRegistry {
|
|
29
|
+
private tools;
|
|
30
|
+
private categories;
|
|
31
|
+
register(tool: Tool): void;
|
|
32
|
+
get(name: string): Tool | undefined;
|
|
33
|
+
getTool(name: string): Tool | undefined;
|
|
34
|
+
list(): Tool[];
|
|
35
|
+
getAllTools(): Tool[];
|
|
36
|
+
getSchemas(): object[];
|
|
37
|
+
getToolsByCategory(category: string): string[];
|
|
38
|
+
getAllCategories(): string[];
|
|
39
|
+
hasCategory(category: string): boolean;
|
|
40
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Tool, type ToolMetadata } from "./base";
|
|
2
|
+
export declare class AuditLogTool extends Tool {
|
|
3
|
+
metadata: ToolMetadata;
|
|
4
|
+
execute(input: {
|
|
5
|
+
action: string;
|
|
6
|
+
actor?: string;
|
|
7
|
+
resource?: string;
|
|
8
|
+
metadata?: any;
|
|
9
|
+
}): Promise<{
|
|
10
|
+
logged: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export declare class PiiDetectTool extends Tool {
|
|
14
|
+
metadata: ToolMetadata;
|
|
15
|
+
execute(input: {
|
|
16
|
+
text: string;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
detected: boolean;
|
|
19
|
+
types: string[];
|
|
20
|
+
matches: any[];
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
export declare class EncryptDataTool extends Tool {
|
|
24
|
+
metadata: ToolMetadata;
|
|
25
|
+
execute(input: {
|
|
26
|
+
data: string;
|
|
27
|
+
key?: string;
|
|
28
|
+
}): Promise<{
|
|
29
|
+
encrypted: string;
|
|
30
|
+
iv: string;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
export declare class DecryptDataTool extends Tool {
|
|
34
|
+
metadata: ToolMetadata;
|
|
35
|
+
execute(input: {
|
|
36
|
+
encrypted: string;
|
|
37
|
+
iv: string;
|
|
38
|
+
key: string;
|
|
39
|
+
}): Promise<string>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Tool, ToolMetadata } from './base';
|
|
2
|
+
export declare class JsonStringifyTool extends Tool {
|
|
3
|
+
metadata: ToolMetadata;
|
|
4
|
+
execute(input: {
|
|
5
|
+
data: any;
|
|
6
|
+
pretty?: boolean;
|
|
7
|
+
}): Promise<string>;
|
|
8
|
+
}
|
|
9
|
+
export declare class CsvParseTool extends Tool {
|
|
10
|
+
metadata: ToolMetadata;
|
|
11
|
+
execute(input: {
|
|
12
|
+
csv: string;
|
|
13
|
+
delimiter?: string;
|
|
14
|
+
headers?: boolean;
|
|
15
|
+
}): Promise<any[]>;
|
|
16
|
+
}
|
|
17
|
+
export declare class CsvWriteTool extends Tool {
|
|
18
|
+
metadata: ToolMetadata;
|
|
19
|
+
execute(input: {
|
|
20
|
+
data: any[];
|
|
21
|
+
delimiter?: string;
|
|
22
|
+
headers?: boolean;
|
|
23
|
+
}): Promise<string>;
|
|
24
|
+
}
|
|
25
|
+
export declare class YamlParseTool extends Tool {
|
|
26
|
+
metadata: ToolMetadata;
|
|
27
|
+
execute(input: {
|
|
28
|
+
yaml: string;
|
|
29
|
+
}): Promise<any>;
|
|
30
|
+
}
|
|
31
|
+
export declare class XmlParseTool extends Tool {
|
|
32
|
+
metadata: ToolMetadata;
|
|
33
|
+
execute(input: {
|
|
34
|
+
xml: string;
|
|
35
|
+
}): Promise<any>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Tool, type ToolInput, type ToolMetadata } from "./base";
|
|
2
|
+
export declare class JsonParseTool extends Tool {
|
|
3
|
+
metadata: ToolMetadata;
|
|
4
|
+
execute(input: ToolInput): Promise<string>;
|
|
5
|
+
}
|
|
6
|
+
export declare class Base64EncodeTool extends Tool {
|
|
7
|
+
metadata: ToolMetadata;
|
|
8
|
+
execute(input: ToolInput): Promise<string>;
|
|
9
|
+
}
|
|
10
|
+
export declare class Base64DecodeTool extends Tool {
|
|
11
|
+
metadata: ToolMetadata;
|
|
12
|
+
execute(input: ToolInput): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
export declare class HashTool extends Tool {
|
|
15
|
+
metadata: ToolMetadata;
|
|
16
|
+
execute(input: ToolInput): Promise<string>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Tool, type ToolInput, type ToolMetadata } from "./base";
|
|
2
|
+
export declare class DirectoryListTool extends Tool {
|
|
3
|
+
metadata: ToolMetadata;
|
|
4
|
+
execute(input: ToolInput): Promise<string>;
|
|
5
|
+
}
|
|
6
|
+
export declare class DirectoryMkdirTool extends Tool {
|
|
7
|
+
metadata: ToolMetadata;
|
|
8
|
+
execute(input: ToolInput): Promise<string>;
|
|
9
|
+
}
|
|
10
|
+
export declare class DirectoryRmdirTool extends Tool {
|
|
11
|
+
metadata: ToolMetadata;
|
|
12
|
+
execute(input: ToolInput): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
export declare class DirectoryRmRecursiveTool extends Tool {
|
|
15
|
+
metadata: ToolMetadata;
|
|
16
|
+
execute(input: ToolInput): Promise<string>;
|
|
17
|
+
}
|
|
18
|
+
export declare class DirectoryExistsTool extends Tool {
|
|
19
|
+
metadata: ToolMetadata;
|
|
20
|
+
execute(input: ToolInput): Promise<string>;
|
|
21
|
+
}
|
|
22
|
+
export declare class DirectoryMoveTool extends Tool {
|
|
23
|
+
metadata: ToolMetadata;
|
|
24
|
+
execute(input: {
|
|
25
|
+
source: string;
|
|
26
|
+
destination: string;
|
|
27
|
+
}): Promise<{
|
|
28
|
+
moved: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
export declare class DirectoryCopyTool extends Tool {
|
|
32
|
+
metadata: ToolMetadata;
|
|
33
|
+
execute(input: {
|
|
34
|
+
source: string;
|
|
35
|
+
destination: string;
|
|
36
|
+
}): Promise<{
|
|
37
|
+
copied: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
export declare class DirectoryTreeTool extends Tool {
|
|
41
|
+
metadata: ToolMetadata;
|
|
42
|
+
execute(input: {
|
|
43
|
+
path: string;
|
|
44
|
+
depth?: number;
|
|
45
|
+
}): Promise<any>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Tool, type ToolInput, type ToolMetadata } from "./base";
|
|
2
|
+
export declare class FileReadTool extends Tool {
|
|
3
|
+
metadata: ToolMetadata;
|
|
4
|
+
execute(input: ToolInput): Promise<string>;
|
|
5
|
+
}
|
|
6
|
+
export declare class FileWriteTool extends Tool {
|
|
7
|
+
metadata: ToolMetadata;
|
|
8
|
+
execute(input: ToolInput): Promise<string>;
|
|
9
|
+
}
|
|
10
|
+
export declare class FileListTool extends Tool {
|
|
11
|
+
metadata: ToolMetadata;
|
|
12
|
+
execute(input: ToolInput): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
export declare class FileAppendTool extends Tool {
|
|
15
|
+
metadata: ToolMetadata;
|
|
16
|
+
execute(input: ToolInput): Promise<string>;
|
|
17
|
+
}
|
|
18
|
+
export declare class FileDeleteTool extends Tool {
|
|
19
|
+
metadata: ToolMetadata;
|
|
20
|
+
execute(input: ToolInput): Promise<string>;
|
|
21
|
+
}
|
|
22
|
+
export declare class FileMoveTool extends Tool {
|
|
23
|
+
metadata: ToolMetadata;
|
|
24
|
+
execute(input: ToolInput): Promise<string>;
|
|
25
|
+
}
|
|
26
|
+
export declare class FileCopyTool extends Tool {
|
|
27
|
+
metadata: ToolMetadata;
|
|
28
|
+
execute(input: ToolInput): Promise<string>;
|
|
29
|
+
}
|
|
30
|
+
export declare class FileStatTool extends Tool {
|
|
31
|
+
metadata: ToolMetadata;
|
|
32
|
+
execute(input: ToolInput): Promise<string>;
|
|
33
|
+
}
|
|
34
|
+
export declare class FileExistsTool extends Tool {
|
|
35
|
+
metadata: ToolMetadata;
|
|
36
|
+
execute(input: ToolInput): Promise<string>;
|
|
37
|
+
}
|
|
38
|
+
export declare class FileChmodTool extends Tool {
|
|
39
|
+
metadata: ToolMetadata;
|
|
40
|
+
execute(input: {
|
|
41
|
+
path: string;
|
|
42
|
+
mode: string | number;
|
|
43
|
+
}): Promise<{
|
|
44
|
+
changed: boolean;
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export * from "./agent-delegation";
|
|
2
|
+
export * from "./agent-invocation";
|
|
3
|
+
export * from "./base";
|
|
4
|
+
export * from "./calculator";
|
|
5
|
+
export * from "./compliance-operations";
|
|
6
|
+
export * from "./data-formats";
|
|
7
|
+
export * from "./data-operations";
|
|
8
|
+
export * from "./directory-operations";
|
|
9
|
+
export * from "./file-operations";
|
|
10
|
+
export * from "./http-request";
|
|
11
|
+
export * from "./network-operations";
|
|
12
|
+
export * from "./pattern-parser";
|
|
13
|
+
export * from "./system-operations";
|
|
14
|
+
export * from "./utility-operations";
|
|
15
|
+
export * from "./verification-status";
|
|
16
|
+
export * from "./web-search";
|
|
17
|
+
import { AgentDelegationTool, AgentDiscoveryTool, AgentStatusTool } from "./agent-delegation";
|
|
18
|
+
import { GetAgentInfoTool, InvokeAgentTool, SearchAgentsTool } from "./agent-invocation";
|
|
19
|
+
import { ToolRegistry } from "./base";
|
|
20
|
+
import { CalculatorTool } from "./calculator";
|
|
21
|
+
import { AuditLogTool, DecryptDataTool, EncryptDataTool, PiiDetectTool } from "./compliance-operations";
|
|
22
|
+
import { CsvParseTool, CsvWriteTool, JsonStringifyTool, XmlParseTool, YamlParseTool } from "./data-formats";
|
|
23
|
+
import { Base64DecodeTool, Base64EncodeTool, HashTool, JsonParseTool } from "./data-operations";
|
|
24
|
+
import { DirectoryCopyTool, DirectoryExistsTool, DirectoryListTool, DirectoryMkdirTool, DirectoryMoveTool, DirectoryRmdirTool, DirectoryRmRecursiveTool, DirectoryTreeTool } from "./directory-operations";
|
|
25
|
+
import { FileAppendTool, FileChmodTool, FileCopyTool, FileDeleteTool, FileExistsTool, FileListTool, FileMoveTool, FileReadTool, FileStatTool, FileWriteTool } from "./file-operations";
|
|
26
|
+
import { HttpRequestTool } from "./http-request";
|
|
27
|
+
import { DnsLookupTool, DownloadFileTool, HttpDeleteTool, HttpPostTool, HttpPutTool, PingTool } from "./network-operations";
|
|
28
|
+
import { EnvGetTool, EnvSetTool, GetCwdTool, GetPlatformTool } from "./system-operations";
|
|
29
|
+
import { DateFormatTool, GenerateUuidTool, RandomNumberTool, RegexMatchTool, SleepTool, UrlParseTool } from "./utility-operations";
|
|
30
|
+
import { VerificationStatusTool } from "./verification-status";
|
|
31
|
+
import { WebSearchTool } from "./web-search";
|
|
32
|
+
export interface ToolRegistryOptions {
|
|
33
|
+
privateKey?: string;
|
|
34
|
+
publicKey?: string;
|
|
35
|
+
registryUrl?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function createDefaultToolRegistry(options?: ToolRegistryOptions): ToolRegistry;
|
|
38
|
+
export declare const builtInTools: {
|
|
39
|
+
FileReadTool: typeof FileReadTool;
|
|
40
|
+
FileWriteTool: typeof FileWriteTool;
|
|
41
|
+
FileAppendTool: typeof FileAppendTool;
|
|
42
|
+
FileDeleteTool: typeof FileDeleteTool;
|
|
43
|
+
FileMoveTool: typeof FileMoveTool;
|
|
44
|
+
FileCopyTool: typeof FileCopyTool;
|
|
45
|
+
FileStatTool: typeof FileStatTool;
|
|
46
|
+
FileExistsTool: typeof FileExistsTool;
|
|
47
|
+
FileListTool: typeof FileListTool;
|
|
48
|
+
FileChmodTool: typeof FileChmodTool;
|
|
49
|
+
DirectoryListTool: typeof DirectoryListTool;
|
|
50
|
+
DirectoryMkdirTool: typeof DirectoryMkdirTool;
|
|
51
|
+
DirectoryRmdirTool: typeof DirectoryRmdirTool;
|
|
52
|
+
DirectoryRmRecursiveTool: typeof DirectoryRmRecursiveTool;
|
|
53
|
+
DirectoryExistsTool: typeof DirectoryExistsTool;
|
|
54
|
+
DirectoryMoveTool: typeof DirectoryMoveTool;
|
|
55
|
+
DirectoryCopyTool: typeof DirectoryCopyTool;
|
|
56
|
+
DirectoryTreeTool: typeof DirectoryTreeTool;
|
|
57
|
+
WebSearchTool: typeof WebSearchTool;
|
|
58
|
+
HttpRequestTool: typeof HttpRequestTool;
|
|
59
|
+
HttpPostTool: typeof HttpPostTool;
|
|
60
|
+
HttpPutTool: typeof HttpPutTool;
|
|
61
|
+
HttpDeleteTool: typeof HttpDeleteTool;
|
|
62
|
+
DownloadFileTool: typeof DownloadFileTool;
|
|
63
|
+
DnsLookupTool: typeof DnsLookupTool;
|
|
64
|
+
PingTool: typeof PingTool;
|
|
65
|
+
JsonParseTool: typeof JsonParseTool;
|
|
66
|
+
JsonStringifyTool: typeof JsonStringifyTool;
|
|
67
|
+
CsvParseTool: typeof CsvParseTool;
|
|
68
|
+
CsvWriteTool: typeof CsvWriteTool;
|
|
69
|
+
YamlParseTool: typeof YamlParseTool;
|
|
70
|
+
XmlParseTool: typeof XmlParseTool;
|
|
71
|
+
Base64EncodeTool: typeof Base64EncodeTool;
|
|
72
|
+
Base64DecodeTool: typeof Base64DecodeTool;
|
|
73
|
+
HashTool: typeof HashTool;
|
|
74
|
+
CalculatorTool: typeof CalculatorTool;
|
|
75
|
+
DateFormatTool: typeof DateFormatTool;
|
|
76
|
+
GenerateUuidTool: typeof GenerateUuidTool;
|
|
77
|
+
RandomNumberTool: typeof RandomNumberTool;
|
|
78
|
+
SleepTool: typeof SleepTool;
|
|
79
|
+
RegexMatchTool: typeof RegexMatchTool;
|
|
80
|
+
UrlParseTool: typeof UrlParseTool;
|
|
81
|
+
GetCwdTool: typeof GetCwdTool;
|
|
82
|
+
GetPlatformTool: typeof GetPlatformTool;
|
|
83
|
+
EnvGetTool: typeof EnvGetTool;
|
|
84
|
+
EnvSetTool: typeof EnvSetTool;
|
|
85
|
+
SearchAgentsTool: typeof SearchAgentsTool;
|
|
86
|
+
GetAgentInfoTool: typeof GetAgentInfoTool;
|
|
87
|
+
InvokeAgentTool: typeof InvokeAgentTool;
|
|
88
|
+
AgentDiscoveryTool: typeof AgentDiscoveryTool;
|
|
89
|
+
AgentDelegationTool: typeof AgentDelegationTool;
|
|
90
|
+
AgentStatusTool: typeof AgentStatusTool;
|
|
91
|
+
VerificationStatusTool: typeof VerificationStatusTool;
|
|
92
|
+
AuditLogTool: typeof AuditLogTool;
|
|
93
|
+
PiiDetectTool: typeof PiiDetectTool;
|
|
94
|
+
EncryptDataTool: typeof EncryptDataTool;
|
|
95
|
+
DecryptDataTool: typeof DecryptDataTool;
|
|
96
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Tool, ToolMetadata } from './base';
|
|
2
|
+
export declare class HttpPostTool extends Tool {
|
|
3
|
+
metadata: ToolMetadata;
|
|
4
|
+
execute(input: {
|
|
5
|
+
url: string;
|
|
6
|
+
body?: any;
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
}): Promise<any>;
|
|
9
|
+
}
|
|
10
|
+
export declare class HttpPutTool extends Tool {
|
|
11
|
+
metadata: ToolMetadata;
|
|
12
|
+
execute(input: {
|
|
13
|
+
url: string;
|
|
14
|
+
body?: any;
|
|
15
|
+
headers?: Record<string, string>;
|
|
16
|
+
}): Promise<any>;
|
|
17
|
+
}
|
|
18
|
+
export declare class HttpDeleteTool extends Tool {
|
|
19
|
+
metadata: ToolMetadata;
|
|
20
|
+
execute(input: {
|
|
21
|
+
url: string;
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
}): Promise<any>;
|
|
24
|
+
}
|
|
25
|
+
export declare class DownloadFileTool extends Tool {
|
|
26
|
+
metadata: ToolMetadata;
|
|
27
|
+
execute(input: {
|
|
28
|
+
url: string;
|
|
29
|
+
destination: string;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
path: string;
|
|
32
|
+
size: number;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
export declare class DnsLookupTool extends Tool {
|
|
36
|
+
metadata: ToolMetadata;
|
|
37
|
+
execute(input: {
|
|
38
|
+
hostname: string;
|
|
39
|
+
}): Promise<{
|
|
40
|
+
addresses: string[];
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
export declare class PingTool extends Tool {
|
|
44
|
+
metadata: ToolMetadata;
|
|
45
|
+
execute(input: {
|
|
46
|
+
host: string;
|
|
47
|
+
count?: number;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
alive: boolean;
|
|
50
|
+
time?: number;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ToolRegistry } from "./base";
|
|
2
|
+
export declare class ToolPatternParser {
|
|
3
|
+
/**
|
|
4
|
+
* Get the tool name prefix for a category
|
|
5
|
+
* "files" -> "file"
|
|
6
|
+
* "directories" -> "dir"
|
|
7
|
+
* "network" -> "http" or "network"
|
|
8
|
+
*/
|
|
9
|
+
private static getCategoryPrefix;
|
|
10
|
+
/**
|
|
11
|
+
* Parse tool patterns:
|
|
12
|
+
* "calculator" => ["calculator"]
|
|
13
|
+
* "files:*" => ["file_read", "file_write", "file_delete", ...]
|
|
14
|
+
* "files:[read,write]" => ["file_read", "file_write"]
|
|
15
|
+
*/
|
|
16
|
+
static parse(pattern: string, registry: ToolRegistry): string[];
|
|
17
|
+
/**
|
|
18
|
+
* Expand multiple patterns into unique tool names
|
|
19
|
+
*/
|
|
20
|
+
static expandPatterns(patterns: string[], registry: ToolRegistry): string[];
|
|
21
|
+
/**
|
|
22
|
+
* Filter allowed tools by removing blocked ones
|
|
23
|
+
*/
|
|
24
|
+
static filterBlocked(allowedTools: string[], blockedTools: string[]): string[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Tool, type ToolMetadata } from "./base";
|
|
2
|
+
export declare class GetCwdTool extends Tool {
|
|
3
|
+
metadata: ToolMetadata;
|
|
4
|
+
execute(): Promise<string>;
|
|
5
|
+
}
|
|
6
|
+
export declare class GetPlatformTool extends Tool {
|
|
7
|
+
metadata: ToolMetadata;
|
|
8
|
+
execute(): Promise<any>;
|
|
9
|
+
}
|
|
10
|
+
export declare class EnvGetTool extends Tool {
|
|
11
|
+
metadata: ToolMetadata;
|
|
12
|
+
execute(input: {
|
|
13
|
+
key: string;
|
|
14
|
+
}): Promise<string>;
|
|
15
|
+
}
|
|
16
|
+
export declare class EnvSetTool extends Tool {
|
|
17
|
+
metadata: ToolMetadata;
|
|
18
|
+
execute(input: {
|
|
19
|
+
key: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
set: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Tool, type ToolMetadata } from "./base";
|
|
2
|
+
export declare class DateFormatTool extends Tool {
|
|
3
|
+
metadata: ToolMetadata;
|
|
4
|
+
execute(input: {
|
|
5
|
+
date?: string | number;
|
|
6
|
+
format?: string;
|
|
7
|
+
}): Promise<string>;
|
|
8
|
+
}
|
|
9
|
+
export declare class GenerateUuidTool extends Tool {
|
|
10
|
+
metadata: ToolMetadata;
|
|
11
|
+
execute(): Promise<string>;
|
|
12
|
+
}
|
|
13
|
+
export declare class RandomNumberTool extends Tool {
|
|
14
|
+
metadata: ToolMetadata;
|
|
15
|
+
execute(input: {
|
|
16
|
+
min?: number;
|
|
17
|
+
max?: number;
|
|
18
|
+
}): Promise<string>;
|
|
19
|
+
}
|
|
20
|
+
export declare class SleepTool extends Tool {
|
|
21
|
+
metadata: ToolMetadata;
|
|
22
|
+
execute(input: {
|
|
23
|
+
milliseconds: number;
|
|
24
|
+
}): Promise<{
|
|
25
|
+
slept: number;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
export declare class RegexMatchTool extends Tool {
|
|
29
|
+
metadata: ToolMetadata;
|
|
30
|
+
execute(input: {
|
|
31
|
+
text: string;
|
|
32
|
+
pattern: string;
|
|
33
|
+
flags?: string;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
matches: string[];
|
|
36
|
+
groups?: any[];
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
export declare class UrlParseTool extends Tool {
|
|
40
|
+
metadata: ToolMetadata;
|
|
41
|
+
execute(input: {
|
|
42
|
+
url: string;
|
|
43
|
+
}): Promise<any>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ⚠️ CRITICAL SYSTEM TOOL - DO NOT EDIT OR DELETE ⚠️
|
|
3
|
+
*
|
|
4
|
+
* This tool is automatically included by Sekuire to verify agent compliance
|
|
5
|
+
* and verification status. Removing or modifying this tool will prevent your
|
|
6
|
+
* agent from being properly verified and may result in trust protocol violations.
|
|
7
|
+
*
|
|
8
|
+
* This tool queries the Sekuire registry to check:
|
|
9
|
+
* - Agent verification status (verified/unverified/pending)
|
|
10
|
+
* - Compliance framework adherence
|
|
11
|
+
* - Security score and reputation
|
|
12
|
+
* - Code review status
|
|
13
|
+
*/
|
|
14
|
+
import { Tool, type ToolInput, type ToolMetadata } from "./base";
|
|
15
|
+
export declare class VerificationStatusTool extends Tool {
|
|
16
|
+
metadata: ToolMetadata;
|
|
17
|
+
private registryUrl;
|
|
18
|
+
constructor(registryUrl?: string);
|
|
19
|
+
execute(input: ToolInput): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Get the current agent's Sekuire ID from environment or config
|
|
22
|
+
*/
|
|
23
|
+
private getAgentId;
|
|
24
|
+
/**
|
|
25
|
+
* Extract compliance frameworks from manifest
|
|
26
|
+
*/
|
|
27
|
+
private extractComplianceFrameworks;
|
|
28
|
+
/**
|
|
29
|
+
* Determine if agent is compliant based on verification status and checks
|
|
30
|
+
*/
|
|
31
|
+
private isCompliant;
|
|
32
|
+
/**
|
|
33
|
+
* Calculate overall compliance score
|
|
34
|
+
*/
|
|
35
|
+
private calculateComplianceScore;
|
|
36
|
+
/**
|
|
37
|
+
* Format the response for the agent
|
|
38
|
+
*/
|
|
39
|
+
private formatResponse;
|
|
40
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ActivePolicyResponse {
|
|
2
|
+
policy_id: string;
|
|
3
|
+
workspace_id: string;
|
|
4
|
+
version: string;
|
|
5
|
+
status: string;
|
|
6
|
+
hash: string;
|
|
7
|
+
content: unknown;
|
|
8
|
+
activated_at?: string;
|
|
9
|
+
updated_at?: string;
|
|
10
|
+
signature?: string;
|
|
11
|
+
signing_key_id?: string;
|
|
12
|
+
signing_public_key?: string;
|
|
13
|
+
}
|