@sekuire/sdk 0.1.9 → 0.1.11
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 +69 -5
- package/dist/a2a-client.d.ts +95 -0
- package/dist/a2a-delegator.d.ts +58 -0
- package/dist/a2a-server.d.ts +84 -0
- package/dist/agent.d.ts +1 -1
- package/dist/beacon.d.ts +100 -0
- package/dist/compliance.d.ts +3 -3
- package/dist/config/loader.d.ts +38 -1
- package/dist/crypto.d.ts +0 -3
- package/dist/http/base-client.d.ts +25 -0
- package/dist/http/index.d.ts +2 -0
- package/dist/identity.d.ts +11 -2
- package/dist/index.d.ts +1315 -175
- package/dist/index.esm.js +16151 -5209
- package/dist/index.js +16178 -5207
- package/dist/llm/anthropic.d.ts +4 -12
- package/dist/llm/base-provider.d.ts +13 -0
- package/dist/llm/google.d.ts +4 -12
- package/dist/llm/index.d.ts +0 -12
- package/dist/llm/ollama.d.ts +4 -11
- package/dist/llm/openai.d.ts +4 -12
- package/dist/llm/types.d.ts +19 -12
- package/dist/logger.d.ts +4 -0
- package/dist/memory/base.d.ts +7 -0
- package/dist/memory/cloudflare-d1.d.ts +24 -0
- package/dist/memory/cloudflare-kv.d.ts +25 -0
- package/dist/memory/convex.d.ts +21 -0
- package/dist/memory/dynamodb.d.ts +28 -0
- package/dist/memory/in-memory.d.ts +1 -0
- package/dist/memory/index.d.ts +28 -1
- package/dist/memory/postgres.d.ts +5 -1
- package/dist/memory/redis.d.ts +5 -1
- package/dist/memory/registry.d.ts +12 -0
- package/dist/memory/sqlite.d.ts +22 -0
- package/dist/memory/turso.d.ts +23 -0
- package/dist/memory/upstash.d.ts +22 -0
- package/dist/new-agent.d.ts +2 -2
- package/dist/platform-url.d.ts +1 -0
- package/dist/registry-client.d.ts +171 -0
- package/dist/sdk.d.ts +117 -0
- package/dist/telemetry/exporter.d.ts +21 -0
- package/dist/telemetry/index.d.ts +22 -0
- package/dist/tools/agent-invocation.d.ts +16 -68
- package/dist/tools/remote.d.ts +1 -1
- package/dist/types/a2a-types.d.ts +194 -0
- package/dist/types.d.ts +1 -0
- package/dist/utils.d.ts +0 -4
- package/dist/worker.d.ts +104 -0
- package/package.json +40 -2
package/README.md
CHANGED
|
@@ -48,11 +48,75 @@ console.log(response);
|
|
|
48
48
|
|
|
49
49
|
## Features
|
|
50
50
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
51
|
+
- **4 LLM Providers**: OpenAI, Anthropic, Google, Ollama
|
|
52
|
+
- **Built-in Tools**: Calculator, Web Search, HTTP, File Operations
|
|
53
|
+
- **Streaming**: Token-by-token responses
|
|
54
|
+
- **Config-First**: Declarative YAML configuration
|
|
55
|
+
- **Type-Safe**: Full TypeScript support
|
|
56
|
+
- **Beacon/Heartbeat**: Automatic registration and health reporting
|
|
57
|
+
|
|
58
|
+
## Deployment Registration (Beacon)
|
|
59
|
+
|
|
60
|
+
The SDK includes a Beacon system for registering deployed agents with Sekuire and sending periodic heartbeats.
|
|
61
|
+
|
|
62
|
+
### Getting an Install Token
|
|
63
|
+
|
|
64
|
+
Before deploying, generate an install token from the dashboard or CLI:
|
|
65
|
+
|
|
66
|
+
**From Dashboard:**
|
|
67
|
+
1. Go to your workspace
|
|
68
|
+
2. Click "Install Agent"
|
|
69
|
+
3. Generate an install token
|
|
70
|
+
|
|
71
|
+
**From CLI:**
|
|
72
|
+
```bash
|
|
73
|
+
sekuire install token --workspace ws_xxxx --agent <agent_id>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Using the SDK with Install Token
|
|
77
|
+
|
|
78
|
+
Set the required environment variables:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
export SEKUIRE_AGENT_ID="your-agent-sekuire-id"
|
|
82
|
+
export SEKUIRE_INSTALL_TOKEN="skt_xxxx" # From dashboard or CLI
|
|
83
|
+
export SEKUIRE_API_URL="https://api.sekuire.ai" # Optional, defaults to production
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Then initialize the SDK:
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
import { SekuireSDK } from '@sekuire/sdk';
|
|
90
|
+
|
|
91
|
+
// Create SDK from environment variables (recommended)
|
|
92
|
+
const sdk = SekuireSDK.fromEnv();
|
|
93
|
+
|
|
94
|
+
// Or with explicit config
|
|
95
|
+
const sdk = new SekuireSDK({
|
|
96
|
+
agentId: process.env.SEKUIRE_AGENT_ID,
|
|
97
|
+
installToken: process.env.SEKUIRE_INSTALL_TOKEN,
|
|
98
|
+
apiUrl: 'https://api.sekuire.ai',
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// Start the SDK (bootstraps and begins heartbeat loop)
|
|
102
|
+
await sdk.start();
|
|
103
|
+
|
|
104
|
+
// Check connection status
|
|
105
|
+
console.log('Connected:', sdk.isConnected());
|
|
106
|
+
|
|
107
|
+
// Graceful shutdown
|
|
108
|
+
await sdk.shutdown();
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Beacon Configuration Options
|
|
112
|
+
|
|
113
|
+
| Option | Environment Variable | Description |
|
|
114
|
+
|--------|---------------------|-------------|
|
|
115
|
+
| `installToken` | `SEKUIRE_INSTALL_TOKEN` | Install token from dashboard/CLI (required) |
|
|
116
|
+
| `agentId` | `SEKUIRE_AGENT_ID` | Your agent's sekuire_id (required) |
|
|
117
|
+
| `apiUrl` | `SEKUIRE_API_URL` | API base URL (default: https://api.sekuire.ai) |
|
|
118
|
+
| `heartbeatIntervalSeconds` | - | Heartbeat interval (default: 60) |
|
|
119
|
+
| `capabilities` | - | List of capabilities this agent provides |
|
|
56
120
|
|
|
57
121
|
## API Reference
|
|
58
122
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2A Protocol Client
|
|
3
|
+
*
|
|
4
|
+
* Client for interacting with A2A-compliant agents via the Sekuire API.
|
|
5
|
+
*/
|
|
6
|
+
import type { A2AMessage, A2ARouteRequest, A2ARouteResponse, A2ATask, AgentCard, TasksSendParams, TaskUpdateEvent } from "./types/a2a-types";
|
|
7
|
+
export interface A2AClientOptions {
|
|
8
|
+
/** Base URL for the Sekuire API */
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
/** Authentication token */
|
|
11
|
+
authToken: string;
|
|
12
|
+
/** Optional timeout in milliseconds (default: 30000) */
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A2A Protocol Client
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const client = new A2AClient({
|
|
21
|
+
* baseUrl: "https://api.sekuire.ai",
|
|
22
|
+
* authToken: "your-token",
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // Auto-discover and send task by skill
|
|
26
|
+
* const result = await client.sendBySkill({
|
|
27
|
+
* skill: "document:summarize",
|
|
28
|
+
* message: {
|
|
29
|
+
* role: "user",
|
|
30
|
+
* parts: [{ type: "text", text: "Summarize this document" }],
|
|
31
|
+
* },
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* // Stream task updates
|
|
35
|
+
* for await (const event of client.subscribe(result.taskId)) {
|
|
36
|
+
* console.log(event.status, event.artifacts);
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare class A2AClient {
|
|
41
|
+
private baseUrl;
|
|
42
|
+
private authToken;
|
|
43
|
+
private timeout;
|
|
44
|
+
constructor(options: A2AClientOptions);
|
|
45
|
+
/**
|
|
46
|
+
* Send a task by skill using auto-discovery routing.
|
|
47
|
+
* The API will find an agent with the matching skill and forward the task.
|
|
48
|
+
*/
|
|
49
|
+
sendBySkill(request: A2ARouteRequest): Promise<A2ARouteResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* Send a message directly to a specific agent.
|
|
52
|
+
*/
|
|
53
|
+
send(agentUrl: string, message: A2AMessage, taskId?: string): Promise<A2ATask>;
|
|
54
|
+
/**
|
|
55
|
+
* Send a task via JSON-RPC to the Sekuire API.
|
|
56
|
+
*/
|
|
57
|
+
sendTask(params: TasksSendParams): Promise<A2ATask>;
|
|
58
|
+
/**
|
|
59
|
+
* Get task status and details.
|
|
60
|
+
*/
|
|
61
|
+
getTask(taskId: string): Promise<A2ATask>;
|
|
62
|
+
/**
|
|
63
|
+
* Cancel a running task.
|
|
64
|
+
*/
|
|
65
|
+
cancelTask(taskId: string): Promise<A2ATask>;
|
|
66
|
+
/**
|
|
67
|
+
* Subscribe to task updates via SSE.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* for await (const event of client.subscribe(taskId)) {
|
|
72
|
+
* console.log(event.status);
|
|
73
|
+
* if (event.status === "completed") break;
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
subscribe(taskId: string): AsyncGenerator<TaskUpdateEvent>;
|
|
78
|
+
/**
|
|
79
|
+
* Get an agent's card (capabilities, skills).
|
|
80
|
+
*/
|
|
81
|
+
getAgentCard(agentId: string): Promise<AgentCard>;
|
|
82
|
+
/**
|
|
83
|
+
* Make a JSON-RPC call to the A2A endpoint.
|
|
84
|
+
*/
|
|
85
|
+
private jsonRpc;
|
|
86
|
+
private fetch;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A2A Protocol Error
|
|
90
|
+
*/
|
|
91
|
+
export declare class A2AError extends Error {
|
|
92
|
+
readonly code: string;
|
|
93
|
+
readonly jsonRpcCode?: number | undefined;
|
|
94
|
+
constructor(message: string, code: string, jsonRpcCode?: number | undefined);
|
|
95
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2A Task Delegator
|
|
3
|
+
*
|
|
4
|
+
* Enables agents to delegate tasks to other agents and receive completion callbacks.
|
|
5
|
+
* Provides a complete feedback loop for multi-agent orchestration.
|
|
6
|
+
*/
|
|
7
|
+
import type { A2AMessage, A2ATaskState, TaskUpdateEvent } from "./types/a2a-types";
|
|
8
|
+
export interface DelegatorConfig {
|
|
9
|
+
apiUrl: string;
|
|
10
|
+
authToken: string;
|
|
11
|
+
workspaceId: string;
|
|
12
|
+
agentId: string;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
pollInterval?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface DelegationRequest {
|
|
17
|
+
skill: string;
|
|
18
|
+
message: string | A2AMessage;
|
|
19
|
+
contextId?: string;
|
|
20
|
+
parentTaskId?: string;
|
|
21
|
+
traceId?: string;
|
|
22
|
+
timeout?: number;
|
|
23
|
+
onProgress?: (event: TaskUpdateEvent) => void;
|
|
24
|
+
}
|
|
25
|
+
export interface DelegationResult {
|
|
26
|
+
taskId: string;
|
|
27
|
+
agentId: string;
|
|
28
|
+
traceId?: string;
|
|
29
|
+
status: A2ATaskState;
|
|
30
|
+
result?: A2AMessage;
|
|
31
|
+
artifacts?: Array<{
|
|
32
|
+
name?: string;
|
|
33
|
+
parts: Array<{
|
|
34
|
+
type: string;
|
|
35
|
+
text?: string;
|
|
36
|
+
}>;
|
|
37
|
+
}>;
|
|
38
|
+
error?: string;
|
|
39
|
+
executionTimeMs: number;
|
|
40
|
+
}
|
|
41
|
+
export declare class A2ATaskDelegator {
|
|
42
|
+
private client;
|
|
43
|
+
private config;
|
|
44
|
+
private activeDelegations;
|
|
45
|
+
constructor(config: DelegatorConfig);
|
|
46
|
+
delegate(request: DelegationRequest): Promise<DelegationResult>;
|
|
47
|
+
delegateWithStreaming(request: DelegationRequest): AsyncGenerator<TaskUpdateEvent, DelegationResult>;
|
|
48
|
+
cancelDelegation(taskId: string): void;
|
|
49
|
+
cancelAllDelegations(): void;
|
|
50
|
+
discoverAgents(skill: string): Promise<Array<{
|
|
51
|
+
agentId: string;
|
|
52
|
+
name: string;
|
|
53
|
+
}>>;
|
|
54
|
+
private waitForCompletion;
|
|
55
|
+
private pollForCompletion;
|
|
56
|
+
private sleep;
|
|
57
|
+
}
|
|
58
|
+
export declare function createDelegator(config: DelegatorConfig): A2ATaskDelegator;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2A Protocol Server
|
|
3
|
+
*
|
|
4
|
+
* Server implementation for creating A2A-compliant agents with streaming support.
|
|
5
|
+
*/
|
|
6
|
+
import type { A2AArtifact, A2AMessage, A2ATask, A2ATaskState, AgentCard, AgentSkill, JsonRpcRequest, JsonRpcResponse, TaskUpdateEvent } from "./types/a2a-types";
|
|
7
|
+
import { AgentIdentity } from "./identity";
|
|
8
|
+
export interface A2AServerOptions {
|
|
9
|
+
card: AgentCard;
|
|
10
|
+
identity?: AgentIdentity;
|
|
11
|
+
port?: number;
|
|
12
|
+
handlers: Record<string, SkillHandler>;
|
|
13
|
+
streamingHandlers?: Record<string, StreamingSkillHandler>;
|
|
14
|
+
}
|
|
15
|
+
export type SkillHandler = (message: A2AMessage, context: SkillContext) => Promise<A2AMessage | A2AArtifact[]>;
|
|
16
|
+
export type StreamingSkillHandler = (message: A2AMessage, context: StreamingSkillContext) => AsyncGenerator<StreamingUpdate>;
|
|
17
|
+
export interface SkillContext {
|
|
18
|
+
taskId: string;
|
|
19
|
+
contextId?: string;
|
|
20
|
+
history: A2AMessage[];
|
|
21
|
+
}
|
|
22
|
+
export interface StreamingSkillContext extends SkillContext {
|
|
23
|
+
emit: (update: StreamingUpdate) => void;
|
|
24
|
+
}
|
|
25
|
+
export type StreamingUpdate = {
|
|
26
|
+
type: "progress";
|
|
27
|
+
message: string;
|
|
28
|
+
percent?: number;
|
|
29
|
+
} | {
|
|
30
|
+
type: "artifact";
|
|
31
|
+
artifact: A2AArtifact;
|
|
32
|
+
} | {
|
|
33
|
+
type: "message";
|
|
34
|
+
message: A2AMessage;
|
|
35
|
+
} | {
|
|
36
|
+
type: "status";
|
|
37
|
+
status: A2ATaskState;
|
|
38
|
+
};
|
|
39
|
+
export interface TaskState {
|
|
40
|
+
id: string;
|
|
41
|
+
contextId?: string;
|
|
42
|
+
status: A2ATaskState;
|
|
43
|
+
history: A2AMessage[];
|
|
44
|
+
artifacts: A2AArtifact[];
|
|
45
|
+
createdAt: Date;
|
|
46
|
+
updatedAt: Date;
|
|
47
|
+
subscribers: Set<(event: TaskUpdateEvent) => void>;
|
|
48
|
+
}
|
|
49
|
+
export declare class A2AServer {
|
|
50
|
+
private card;
|
|
51
|
+
private identity?;
|
|
52
|
+
private handlers;
|
|
53
|
+
private streamingHandlers;
|
|
54
|
+
private tasks;
|
|
55
|
+
private heartbeatInterval?;
|
|
56
|
+
constructor(options: A2AServerOptions);
|
|
57
|
+
/**
|
|
58
|
+
* Start sending heartbeats to the registry
|
|
59
|
+
* @param publicUrl The public URL where this agent is reachable
|
|
60
|
+
* @param registryUrl The registry API base URL (default: http://localhost:3000)
|
|
61
|
+
*/
|
|
62
|
+
startHeartbeat(publicUrl: string, registryUrl?: string): Promise<void>;
|
|
63
|
+
stopHeartbeat(): void;
|
|
64
|
+
getAgentCard(): AgentCard;
|
|
65
|
+
getTask(taskId: string): TaskState | undefined;
|
|
66
|
+
handleRequest(request: JsonRpcRequest): Promise<JsonRpcResponse>;
|
|
67
|
+
handleStreamingRequest(request: JsonRpcRequest): AsyncGenerator<TaskUpdateEvent>;
|
|
68
|
+
subscribeToTask(taskId: string): AsyncGenerator<TaskUpdateEvent> | null;
|
|
69
|
+
formatSSE(event: TaskUpdateEvent): string;
|
|
70
|
+
notifySubscribers(taskId: string): void;
|
|
71
|
+
private handleTasksSend;
|
|
72
|
+
private handleTasksGet;
|
|
73
|
+
private handleTasksCancel;
|
|
74
|
+
private findHandler;
|
|
75
|
+
private findStreamingHandler;
|
|
76
|
+
private findHandlerInMap;
|
|
77
|
+
private extractText;
|
|
78
|
+
private createUpdateEvent;
|
|
79
|
+
private taskToResponse;
|
|
80
|
+
private success;
|
|
81
|
+
private error;
|
|
82
|
+
private generateId;
|
|
83
|
+
}
|
|
84
|
+
export type { A2AArtifact, A2AMessage, A2ATask, AgentCard, AgentSkill, TaskUpdateEvent };
|
package/dist/agent.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface ToolDefinition<T extends z.ZodObject<any> = any> {
|
|
|
30
30
|
/** Zod schema for input validation */
|
|
31
31
|
schema: T;
|
|
32
32
|
/** Tool execution function */
|
|
33
|
-
execute: (input: z.infer<T>) => Promise<
|
|
33
|
+
execute: (input: z.infer<T>) => Promise<unknown> | unknown;
|
|
34
34
|
/** Optional: Additional compliance checks */
|
|
35
35
|
beforeExecute?: (input: z.infer<T>) => Promise<void> | void;
|
|
36
36
|
}
|
package/dist/beacon.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sekuire Beacon - Deployment Registration & Heartbeat
|
|
3
|
+
*
|
|
4
|
+
* Automatically registers the agent with Sekuire and sends periodic heartbeats
|
|
5
|
+
* to show online status in the Dashboard.
|
|
6
|
+
*
|
|
7
|
+
* Supports two authentication modes:
|
|
8
|
+
* 1. Install Token (recommended): Use an install token from the dashboard
|
|
9
|
+
* 2. API Key: Use an API key for SDK-initiated bootstrap (requires workspace)
|
|
10
|
+
*/
|
|
11
|
+
export interface BeaconConfig {
|
|
12
|
+
/** Sekuire Core API base URL */
|
|
13
|
+
apiBaseUrl: string;
|
|
14
|
+
/** Install token from dashboard (preferred for BYOC deployments) */
|
|
15
|
+
installToken?: string;
|
|
16
|
+
/** API key for authentication (reads from SEKUIRE_API_KEY if not set) */
|
|
17
|
+
apiKey?: string;
|
|
18
|
+
/** Agent ID to register */
|
|
19
|
+
agentId: string;
|
|
20
|
+
/** Workspace ID (required when using API key without install token) */
|
|
21
|
+
workspaceId?: string;
|
|
22
|
+
/** Heartbeat interval in seconds (default: 60) */
|
|
23
|
+
heartbeatIntervalSeconds?: number;
|
|
24
|
+
/** Optional explicit deployment URL (auto-detected if not set) */
|
|
25
|
+
deploymentUrl?: string;
|
|
26
|
+
/** Optional capabilities this agent provides */
|
|
27
|
+
capabilities?: string[];
|
|
28
|
+
/** Optional callback invoked on status changes */
|
|
29
|
+
onStatusChange?: (status: BeaconStatus) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface BeaconStatus {
|
|
32
|
+
isRunning: boolean;
|
|
33
|
+
installationId?: string;
|
|
34
|
+
runtimeToken?: string;
|
|
35
|
+
deploymentUrl?: string;
|
|
36
|
+
lastHeartbeat?: Date;
|
|
37
|
+
failedHeartbeats: number;
|
|
38
|
+
}
|
|
39
|
+
export interface BootstrapResponse {
|
|
40
|
+
installation_id: string;
|
|
41
|
+
runtime_token: string;
|
|
42
|
+
refresh_token: string;
|
|
43
|
+
expires_at: string;
|
|
44
|
+
heartbeat_interval: number;
|
|
45
|
+
}
|
|
46
|
+
export declare class Beacon {
|
|
47
|
+
private config;
|
|
48
|
+
private intervalId;
|
|
49
|
+
private installationId;
|
|
50
|
+
private runtimeToken;
|
|
51
|
+
private refreshToken;
|
|
52
|
+
private lastHeartbeat;
|
|
53
|
+
private failedHeartbeats;
|
|
54
|
+
constructor(config: BeaconConfig);
|
|
55
|
+
/**
|
|
56
|
+
* Start the beacon - registers with Sekuire and begins heartbeat loop
|
|
57
|
+
*/
|
|
58
|
+
start(): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Stop the beacon
|
|
61
|
+
*/
|
|
62
|
+
stop(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Get current beacon status
|
|
65
|
+
*/
|
|
66
|
+
getStatus(): BeaconStatus;
|
|
67
|
+
/**
|
|
68
|
+
* Bootstrap registration with Sekuire
|
|
69
|
+
*
|
|
70
|
+
* Exchanges an install token for runtime credentials (installation_id + runtime_token).
|
|
71
|
+
* The install token is obtained from the dashboard or CLI.
|
|
72
|
+
*/
|
|
73
|
+
private bootstrap;
|
|
74
|
+
/**
|
|
75
|
+
* Send heartbeat (lease renewal) to Sekuire
|
|
76
|
+
*
|
|
77
|
+
* Uses the installation-based lease endpoint with runtime token authentication.
|
|
78
|
+
*/
|
|
79
|
+
private heartbeat;
|
|
80
|
+
/**
|
|
81
|
+
* Refresh the runtime token using the refresh token
|
|
82
|
+
*/
|
|
83
|
+
private refreshRuntimeToken;
|
|
84
|
+
/**
|
|
85
|
+
* Notify status change callback
|
|
86
|
+
*/
|
|
87
|
+
private notifyStatusChange;
|
|
88
|
+
/**
|
|
89
|
+
* Get API key from environment
|
|
90
|
+
*/
|
|
91
|
+
private getApiKey;
|
|
92
|
+
/**
|
|
93
|
+
* Get install token from environment
|
|
94
|
+
*/
|
|
95
|
+
private getInstallToken;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Create a new beacon instance
|
|
99
|
+
*/
|
|
100
|
+
export declare function createBeacon(config: BeaconConfig): Beacon;
|
package/dist/compliance.d.ts
CHANGED
|
@@ -171,21 +171,21 @@ export declare class ComplianceMonitor {
|
|
|
171
171
|
* @param codeSnippet Code snippet for pattern checking
|
|
172
172
|
* @throws ToolUsageError If tool usage is blocked
|
|
173
173
|
*/
|
|
174
|
-
checkToolUsage(toolName: string, codeSnippet?: string):
|
|
174
|
+
checkToolUsage(toolName: string, codeSnippet?: string): void;
|
|
175
175
|
/**
|
|
176
176
|
* 💬 Check input content for policy violations
|
|
177
177
|
*
|
|
178
178
|
* @param content Input content to check
|
|
179
179
|
* @throws ContentPolicyError If content violates policy
|
|
180
180
|
*/
|
|
181
|
-
checkInputContent(content: string):
|
|
181
|
+
checkInputContent(content: string): void;
|
|
182
182
|
/**
|
|
183
183
|
* 📤 Check output content for policy violations
|
|
184
184
|
*
|
|
185
185
|
* @param content Output content to check
|
|
186
186
|
* @throws ContentPolicyError If content violates policy
|
|
187
187
|
*/
|
|
188
|
-
checkOutputContent(content: string):
|
|
188
|
+
checkOutputContent(content: string): void;
|
|
189
189
|
private checkContent;
|
|
190
190
|
/**
|
|
191
191
|
* 🤖 Check AI model usage compliance
|
package/dist/config/loader.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ export interface LLMConfig {
|
|
|
71
71
|
base_url?: string;
|
|
72
72
|
}
|
|
73
73
|
export interface MemoryConfig {
|
|
74
|
-
type: 'in-memory' | 'redis' | 'postgres';
|
|
74
|
+
type: 'in-memory' | 'buffer' | 'redis' | 'postgres' | 'sqlite' | 'upstash' | 'cloudflare-kv' | 'cloudflare-d1' | 'dynamodb' | 'turso' | 'convex' | string;
|
|
75
75
|
max_messages?: number;
|
|
76
76
|
redis?: {
|
|
77
77
|
url?: string;
|
|
@@ -90,6 +90,43 @@ export interface MemoryConfig {
|
|
|
90
90
|
password?: string;
|
|
91
91
|
tableName?: string;
|
|
92
92
|
};
|
|
93
|
+
sqlite?: {
|
|
94
|
+
filename: string;
|
|
95
|
+
tableName?: string;
|
|
96
|
+
};
|
|
97
|
+
upstash?: {
|
|
98
|
+
url: string;
|
|
99
|
+
token: string;
|
|
100
|
+
keyPrefix?: string;
|
|
101
|
+
};
|
|
102
|
+
cloudflareKV?: {
|
|
103
|
+
namespaceId?: string;
|
|
104
|
+
accountId?: string;
|
|
105
|
+
apiToken?: string;
|
|
106
|
+
keyPrefix?: string;
|
|
107
|
+
};
|
|
108
|
+
cloudflareD1?: {
|
|
109
|
+
databaseId?: string;
|
|
110
|
+
accountId?: string;
|
|
111
|
+
apiToken?: string;
|
|
112
|
+
tableName?: string;
|
|
113
|
+
};
|
|
114
|
+
dynamodb?: {
|
|
115
|
+
tableName: string;
|
|
116
|
+
region?: string;
|
|
117
|
+
endpoint?: string;
|
|
118
|
+
createTable?: boolean;
|
|
119
|
+
};
|
|
120
|
+
turso?: {
|
|
121
|
+
url: string;
|
|
122
|
+
authToken?: string;
|
|
123
|
+
tableName?: string;
|
|
124
|
+
};
|
|
125
|
+
convex?: {
|
|
126
|
+
url: string;
|
|
127
|
+
adminKey?: string;
|
|
128
|
+
};
|
|
129
|
+
config?: Record<string, unknown>;
|
|
93
130
|
}
|
|
94
131
|
export interface ComplianceConfig {
|
|
95
132
|
framework?: string;
|
package/dist/crypto.d.ts
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface HttpClientConfig {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
timeout?: number;
|
|
4
|
+
retries?: number;
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
authToken?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class HttpClient {
|
|
9
|
+
private baseUrl;
|
|
10
|
+
private timeout;
|
|
11
|
+
private retries;
|
|
12
|
+
private apiKey?;
|
|
13
|
+
private authToken?;
|
|
14
|
+
constructor(config: HttpClientConfig);
|
|
15
|
+
setAuthToken(token: string): void;
|
|
16
|
+
setApiKey(apiKey: string): void;
|
|
17
|
+
get<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
18
|
+
post<T>(path: string, data?: unknown): Promise<T>;
|
|
19
|
+
put<T>(path: string, data?: unknown): Promise<T>;
|
|
20
|
+
delete<T>(path: string): Promise<T>;
|
|
21
|
+
private resolveUrl;
|
|
22
|
+
private fetchWithRetry;
|
|
23
|
+
private shouldRetry;
|
|
24
|
+
private delay;
|
|
25
|
+
}
|
package/dist/identity.d.ts
CHANGED
|
@@ -2,8 +2,17 @@ export declare class AgentIdentity {
|
|
|
2
2
|
readonly name: string;
|
|
3
3
|
readonly sekuireId: string;
|
|
4
4
|
private readonly privateKey?;
|
|
5
|
-
|
|
5
|
+
readonly publicKey?: string | undefined;
|
|
6
6
|
constructor(name: string, sekuireId: string, privateKey?: string | undefined, publicKey?: string | undefined);
|
|
7
7
|
static load(manifestPath?: string): Promise<AgentIdentity>;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Sign a message using Ed25519
|
|
10
|
+
* @param message The message string to sign
|
|
11
|
+
* @returns Hex-encoded signature
|
|
12
|
+
*/
|
|
13
|
+
sign(message: string): Promise<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Verify a signature (useful for testing)
|
|
16
|
+
*/
|
|
17
|
+
verify(message: string, signatureHex: string): boolean;
|
|
9
18
|
}
|