@sekuire/sdk 0.1.10 → 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/beacon.d.ts +40 -5
- package/dist/config/loader.d.ts +38 -1
- package/dist/index.d.ts +297 -20
- package/dist/index.esm.js +1527 -277
- package/dist/index.js +1127 -133
- 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/sdk.d.ts +14 -9
- package/package.json +33 -2
package/dist/index.d.ts
CHANGED
|
@@ -8,34 +8,52 @@ import { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
|
8
8
|
*
|
|
9
9
|
* Automatically registers the agent with Sekuire and sends periodic heartbeats
|
|
10
10
|
* to show online status in the Dashboard.
|
|
11
|
+
*
|
|
12
|
+
* Supports two authentication modes:
|
|
13
|
+
* 1. Install Token (recommended): Use an install token from the dashboard
|
|
14
|
+
* 2. API Key: Use an API key for SDK-initiated bootstrap (requires workspace)
|
|
11
15
|
*/
|
|
12
16
|
interface BeaconConfig {
|
|
13
17
|
/** Sekuire Core API base URL */
|
|
14
18
|
apiBaseUrl: string;
|
|
19
|
+
/** Install token from dashboard (preferred for BYOC deployments) */
|
|
20
|
+
installToken?: string;
|
|
15
21
|
/** API key for authentication (reads from SEKUIRE_API_KEY if not set) */
|
|
16
22
|
apiKey?: string;
|
|
17
23
|
/** Agent ID to register */
|
|
18
24
|
agentId: string;
|
|
19
|
-
/**
|
|
20
|
-
|
|
25
|
+
/** Workspace ID (required when using API key without install token) */
|
|
26
|
+
workspaceId?: string;
|
|
27
|
+
/** Heartbeat interval in seconds (default: 60) */
|
|
28
|
+
heartbeatIntervalSeconds?: number;
|
|
21
29
|
/** Optional explicit deployment URL (auto-detected if not set) */
|
|
22
30
|
deploymentUrl?: string;
|
|
23
|
-
/** Optional
|
|
24
|
-
|
|
31
|
+
/** Optional capabilities this agent provides */
|
|
32
|
+
capabilities?: string[];
|
|
25
33
|
/** Optional callback invoked on status changes */
|
|
26
34
|
onStatusChange?: (status: BeaconStatus) => void;
|
|
27
35
|
}
|
|
28
36
|
interface BeaconStatus {
|
|
29
37
|
isRunning: boolean;
|
|
30
38
|
installationId?: string;
|
|
39
|
+
runtimeToken?: string;
|
|
31
40
|
deploymentUrl?: string;
|
|
32
41
|
lastHeartbeat?: Date;
|
|
33
42
|
failedHeartbeats: number;
|
|
34
43
|
}
|
|
44
|
+
interface BootstrapResponse {
|
|
45
|
+
installation_id: string;
|
|
46
|
+
runtime_token: string;
|
|
47
|
+
refresh_token: string;
|
|
48
|
+
expires_at: string;
|
|
49
|
+
heartbeat_interval: number;
|
|
50
|
+
}
|
|
35
51
|
declare class Beacon {
|
|
36
52
|
private config;
|
|
37
53
|
private intervalId;
|
|
38
54
|
private installationId;
|
|
55
|
+
private runtimeToken;
|
|
56
|
+
private refreshToken;
|
|
39
57
|
private lastHeartbeat;
|
|
40
58
|
private failedHeartbeats;
|
|
41
59
|
constructor(config: BeaconConfig);
|
|
@@ -53,16 +71,33 @@ declare class Beacon {
|
|
|
53
71
|
getStatus(): BeaconStatus;
|
|
54
72
|
/**
|
|
55
73
|
* Bootstrap registration with Sekuire
|
|
74
|
+
*
|
|
75
|
+
* Exchanges an install token for runtime credentials (installation_id + runtime_token).
|
|
76
|
+
* The install token is obtained from the dashboard or CLI.
|
|
56
77
|
*/
|
|
57
78
|
private bootstrap;
|
|
58
79
|
/**
|
|
59
|
-
* Send heartbeat to Sekuire
|
|
80
|
+
* Send heartbeat (lease renewal) to Sekuire
|
|
81
|
+
*
|
|
82
|
+
* Uses the installation-based lease endpoint with runtime token authentication.
|
|
60
83
|
*/
|
|
61
84
|
private heartbeat;
|
|
85
|
+
/**
|
|
86
|
+
* Refresh the runtime token using the refresh token
|
|
87
|
+
*/
|
|
88
|
+
private refreshRuntimeToken;
|
|
89
|
+
/**
|
|
90
|
+
* Notify status change callback
|
|
91
|
+
*/
|
|
92
|
+
private notifyStatusChange;
|
|
62
93
|
/**
|
|
63
94
|
* Get API key from environment
|
|
64
95
|
*/
|
|
65
96
|
private getApiKey;
|
|
97
|
+
/**
|
|
98
|
+
* Get install token from environment
|
|
99
|
+
*/
|
|
100
|
+
private getInstallToken;
|
|
66
101
|
}
|
|
67
102
|
/**
|
|
68
103
|
* Create a new beacon instance
|
|
@@ -197,11 +232,16 @@ interface SekuireSDKConfig {
|
|
|
197
232
|
agentName?: string;
|
|
198
233
|
apiUrl?: string;
|
|
199
234
|
apiKey?: string;
|
|
235
|
+
/** Install token from dashboard (preferred for BYOC deployments) */
|
|
236
|
+
installToken?: string;
|
|
200
237
|
workspaceId?: string;
|
|
201
238
|
environment?: string;
|
|
202
239
|
autoHeartbeat?: boolean;
|
|
203
|
-
|
|
240
|
+
/** Heartbeat interval in seconds (default: 60) */
|
|
241
|
+
heartbeatIntervalSeconds?: number;
|
|
204
242
|
loggingEnabled?: boolean;
|
|
243
|
+
/** Capabilities this agent provides */
|
|
244
|
+
capabilities?: string[];
|
|
205
245
|
}
|
|
206
246
|
declare class SekuireSDK {
|
|
207
247
|
private config;
|
|
@@ -216,10 +256,11 @@ declare class SekuireSDK {
|
|
|
216
256
|
*
|
|
217
257
|
* Required env vars:
|
|
218
258
|
* SEKUIRE_AGENT_ID - The agent's sekuire_id
|
|
259
|
+
* SEKUIRE_INSTALL_TOKEN - Install token from dashboard (required for heartbeat)
|
|
219
260
|
*
|
|
220
261
|
* Optional env vars:
|
|
221
262
|
* SEKUIRE_API_KEY - API key for authentication (X-API-Key header)
|
|
222
|
-
* SEKUIRE_PRIVATE_KEY - Private key for signing
|
|
263
|
+
* SEKUIRE_PRIVATE_KEY - Private key for signing
|
|
223
264
|
* SEKUIRE_AGENT_NAME - Human-readable agent name
|
|
224
265
|
* SEKUIRE_API_URL - API base URL (default: https://api.sekuire.ai)
|
|
225
266
|
* SEKUIRE_WORKSPACE_ID - Workspace ID for policy enforcement
|
|
@@ -232,19 +273,18 @@ declare class SekuireSDK {
|
|
|
232
273
|
/**
|
|
233
274
|
* Start the SDK.
|
|
234
275
|
*
|
|
235
|
-
* -
|
|
276
|
+
* - Bootstraps with Sekuire using the install token
|
|
236
277
|
* - Starts auto-heartbeat loop if enabled
|
|
278
|
+
*
|
|
279
|
+
* Requires SEKUIRE_INSTALL_TOKEN to be set (from dashboard or CLI).
|
|
237
280
|
*/
|
|
238
281
|
start(): Promise<void>;
|
|
239
282
|
/**
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
* The heartbeat proves the agent is running and has access to the private key.
|
|
283
|
+
* Check if the beacon is connected and sending heartbeats.
|
|
243
284
|
*
|
|
244
|
-
* @
|
|
245
|
-
* @returns True if heartbeat was acknowledged, False otherwise
|
|
285
|
+
* @returns True if the beacon has successfully bootstrapped
|
|
246
286
|
*/
|
|
247
|
-
|
|
287
|
+
isConnected(): boolean;
|
|
248
288
|
/**
|
|
249
289
|
* Log an event to Sekuire.
|
|
250
290
|
*
|
|
@@ -1120,7 +1160,7 @@ interface LLMConfig {
|
|
|
1120
1160
|
base_url?: string;
|
|
1121
1161
|
}
|
|
1122
1162
|
interface MemoryConfig {
|
|
1123
|
-
type: 'in-memory' | 'redis' | 'postgres';
|
|
1163
|
+
type: 'in-memory' | 'buffer' | 'redis' | 'postgres' | 'sqlite' | 'upstash' | 'cloudflare-kv' | 'cloudflare-d1' | 'dynamodb' | 'turso' | 'convex' | string;
|
|
1124
1164
|
max_messages?: number;
|
|
1125
1165
|
redis?: {
|
|
1126
1166
|
url?: string;
|
|
@@ -1139,6 +1179,43 @@ interface MemoryConfig {
|
|
|
1139
1179
|
password?: string;
|
|
1140
1180
|
tableName?: string;
|
|
1141
1181
|
};
|
|
1182
|
+
sqlite?: {
|
|
1183
|
+
filename: string;
|
|
1184
|
+
tableName?: string;
|
|
1185
|
+
};
|
|
1186
|
+
upstash?: {
|
|
1187
|
+
url: string;
|
|
1188
|
+
token: string;
|
|
1189
|
+
keyPrefix?: string;
|
|
1190
|
+
};
|
|
1191
|
+
cloudflareKV?: {
|
|
1192
|
+
namespaceId?: string;
|
|
1193
|
+
accountId?: string;
|
|
1194
|
+
apiToken?: string;
|
|
1195
|
+
keyPrefix?: string;
|
|
1196
|
+
};
|
|
1197
|
+
cloudflareD1?: {
|
|
1198
|
+
databaseId?: string;
|
|
1199
|
+
accountId?: string;
|
|
1200
|
+
apiToken?: string;
|
|
1201
|
+
tableName?: string;
|
|
1202
|
+
};
|
|
1203
|
+
dynamodb?: {
|
|
1204
|
+
tableName: string;
|
|
1205
|
+
region?: string;
|
|
1206
|
+
endpoint?: string;
|
|
1207
|
+
createTable?: boolean;
|
|
1208
|
+
};
|
|
1209
|
+
turso?: {
|
|
1210
|
+
url: string;
|
|
1211
|
+
authToken?: string;
|
|
1212
|
+
tableName?: string;
|
|
1213
|
+
};
|
|
1214
|
+
convex?: {
|
|
1215
|
+
url: string;
|
|
1216
|
+
adminKey?: string;
|
|
1217
|
+
};
|
|
1218
|
+
config?: Record<string, unknown>;
|
|
1142
1219
|
}
|
|
1143
1220
|
interface ComplianceConfig {
|
|
1144
1221
|
framework?: string;
|
|
@@ -1418,17 +1495,25 @@ interface MemoryStorage {
|
|
|
1418
1495
|
clear(sessionId: string): Promise<void>;
|
|
1419
1496
|
delete(sessionId: string): Promise<void>;
|
|
1420
1497
|
exists(sessionId: string): Promise<boolean>;
|
|
1498
|
+
connect?(): Promise<void>;
|
|
1499
|
+
disconnect?(): Promise<void>;
|
|
1500
|
+
isConnected?(): boolean;
|
|
1421
1501
|
}
|
|
1422
1502
|
declare abstract class BaseMemoryStorage implements MemoryStorage {
|
|
1503
|
+
protected _connected: boolean;
|
|
1423
1504
|
abstract add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1424
1505
|
abstract get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1425
1506
|
abstract clear(sessionId: string): Promise<void>;
|
|
1426
1507
|
abstract delete(sessionId: string): Promise<void>;
|
|
1427
1508
|
abstract exists(sessionId: string): Promise<boolean>;
|
|
1509
|
+
connect(): Promise<void>;
|
|
1510
|
+
disconnect(): Promise<void>;
|
|
1511
|
+
isConnected(): boolean;
|
|
1428
1512
|
}
|
|
1429
1513
|
|
|
1430
1514
|
declare class InMemoryStorage extends BaseMemoryStorage {
|
|
1431
1515
|
private storage;
|
|
1516
|
+
constructor();
|
|
1432
1517
|
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1433
1518
|
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1434
1519
|
clear(sessionId: string): Promise<void>;
|
|
@@ -1444,13 +1529,17 @@ interface PostgresConfig {
|
|
|
1444
1529
|
user?: string;
|
|
1445
1530
|
password?: string;
|
|
1446
1531
|
tableName?: string;
|
|
1532
|
+
lazyConnect?: boolean;
|
|
1447
1533
|
}
|
|
1448
1534
|
declare class PostgresStorage extends BaseMemoryStorage {
|
|
1449
1535
|
private pool;
|
|
1450
1536
|
private tableName;
|
|
1451
|
-
private
|
|
1537
|
+
private config;
|
|
1538
|
+
private connectionPromise;
|
|
1452
1539
|
constructor(config: PostgresConfig);
|
|
1540
|
+
connect(): Promise<void>;
|
|
1453
1541
|
private initPool;
|
|
1542
|
+
private ensureConnected;
|
|
1454
1543
|
private createTableIfNotExists;
|
|
1455
1544
|
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1456
1545
|
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
@@ -1467,13 +1556,17 @@ interface RedisConfig {
|
|
|
1467
1556
|
db?: number;
|
|
1468
1557
|
url?: string;
|
|
1469
1558
|
keyPrefix?: string;
|
|
1559
|
+
lazyConnect?: boolean;
|
|
1470
1560
|
}
|
|
1471
1561
|
declare class RedisStorage extends BaseMemoryStorage {
|
|
1472
1562
|
private client;
|
|
1473
1563
|
private keyPrefix;
|
|
1474
|
-
private
|
|
1564
|
+
private config;
|
|
1565
|
+
private connectionPromise;
|
|
1475
1566
|
constructor(config: RedisConfig);
|
|
1567
|
+
connect(): Promise<void>;
|
|
1476
1568
|
private initClient;
|
|
1569
|
+
private ensureConnected;
|
|
1477
1570
|
private getKey;
|
|
1478
1571
|
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1479
1572
|
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
@@ -1483,11 +1576,195 @@ declare class RedisStorage extends BaseMemoryStorage {
|
|
|
1483
1576
|
disconnect(): Promise<void>;
|
|
1484
1577
|
}
|
|
1485
1578
|
|
|
1486
|
-
|
|
1579
|
+
interface SQLiteConfig {
|
|
1580
|
+
filename: string;
|
|
1581
|
+
tableName?: string;
|
|
1582
|
+
readonly?: boolean;
|
|
1583
|
+
}
|
|
1584
|
+
declare class SQLiteStorage extends BaseMemoryStorage {
|
|
1585
|
+
private db;
|
|
1586
|
+
private config;
|
|
1587
|
+
private tableName;
|
|
1588
|
+
private connectionPromise;
|
|
1589
|
+
constructor(config: SQLiteConfig);
|
|
1590
|
+
connect(): Promise<void>;
|
|
1591
|
+
private ensureTableExists;
|
|
1592
|
+
private ensureConnected;
|
|
1593
|
+
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1594
|
+
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1595
|
+
clear(sessionId: string): Promise<void>;
|
|
1596
|
+
delete(sessionId: string): Promise<void>;
|
|
1597
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1598
|
+
disconnect(): Promise<void>;
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
interface UpstashConfig {
|
|
1602
|
+
url: string;
|
|
1603
|
+
token: string;
|
|
1604
|
+
keyPrefix?: string;
|
|
1605
|
+
}
|
|
1606
|
+
declare class UpstashStorage extends BaseMemoryStorage {
|
|
1607
|
+
private client;
|
|
1608
|
+
private keyPrefix;
|
|
1609
|
+
private config;
|
|
1610
|
+
private connectionPromise;
|
|
1611
|
+
constructor(config: UpstashConfig);
|
|
1612
|
+
connect(): Promise<void>;
|
|
1613
|
+
private ensureConnected;
|
|
1614
|
+
private getKey;
|
|
1615
|
+
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1616
|
+
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1617
|
+
clear(sessionId: string): Promise<void>;
|
|
1618
|
+
delete(sessionId: string): Promise<void>;
|
|
1619
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1620
|
+
disconnect(): Promise<void>;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
interface CloudflareKVConfig {
|
|
1624
|
+
binding?: any;
|
|
1625
|
+
accountId?: string;
|
|
1626
|
+
namespaceId?: string;
|
|
1627
|
+
apiToken?: string;
|
|
1628
|
+
keyPrefix?: string;
|
|
1629
|
+
}
|
|
1630
|
+
declare class CloudflareKVStorage extends BaseMemoryStorage {
|
|
1631
|
+
private binding;
|
|
1632
|
+
private config;
|
|
1633
|
+
private keyPrefix;
|
|
1634
|
+
private useRestApi;
|
|
1635
|
+
constructor(config: CloudflareKVConfig);
|
|
1636
|
+
private getKey;
|
|
1637
|
+
private kvGet;
|
|
1638
|
+
private kvPut;
|
|
1639
|
+
private kvDelete;
|
|
1640
|
+
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1641
|
+
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1642
|
+
clear(sessionId: string): Promise<void>;
|
|
1643
|
+
delete(sessionId: string): Promise<void>;
|
|
1644
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1645
|
+
disconnect(): Promise<void>;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
interface CloudflareD1Config {
|
|
1649
|
+
binding?: any;
|
|
1650
|
+
accountId?: string;
|
|
1651
|
+
databaseId?: string;
|
|
1652
|
+
apiToken?: string;
|
|
1653
|
+
tableName?: string;
|
|
1654
|
+
}
|
|
1655
|
+
declare class CloudflareD1Storage extends BaseMemoryStorage {
|
|
1656
|
+
private binding;
|
|
1657
|
+
private config;
|
|
1658
|
+
private tableName;
|
|
1659
|
+
private useRestApi;
|
|
1660
|
+
private tableInitialized;
|
|
1661
|
+
constructor(config: CloudflareD1Config);
|
|
1662
|
+
private executeQuery;
|
|
1663
|
+
private ensureTableExists;
|
|
1664
|
+
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1665
|
+
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1666
|
+
clear(sessionId: string): Promise<void>;
|
|
1667
|
+
delete(sessionId: string): Promise<void>;
|
|
1668
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1669
|
+
disconnect(): Promise<void>;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
interface DynamoDBConfig {
|
|
1673
|
+
tableName: string;
|
|
1674
|
+
region?: string;
|
|
1675
|
+
endpoint?: string;
|
|
1676
|
+
credentials?: {
|
|
1677
|
+
accessKeyId: string;
|
|
1678
|
+
secretAccessKey: string;
|
|
1679
|
+
};
|
|
1680
|
+
createTable?: boolean;
|
|
1681
|
+
}
|
|
1682
|
+
declare class DynamoDBStorage extends BaseMemoryStorage {
|
|
1683
|
+
private client;
|
|
1684
|
+
private docClient;
|
|
1685
|
+
private config;
|
|
1686
|
+
private connectionPromise;
|
|
1687
|
+
private tableReady;
|
|
1688
|
+
constructor(config: DynamoDBConfig);
|
|
1689
|
+
connect(): Promise<void>;
|
|
1690
|
+
private ensureTableExists;
|
|
1691
|
+
private ensureConnected;
|
|
1692
|
+
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1693
|
+
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1694
|
+
clear(sessionId: string): Promise<void>;
|
|
1695
|
+
delete(sessionId: string): Promise<void>;
|
|
1696
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1697
|
+
disconnect(): Promise<void>;
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
interface TursoConfig {
|
|
1701
|
+
url: string;
|
|
1702
|
+
authToken?: string;
|
|
1703
|
+
tableName?: string;
|
|
1704
|
+
}
|
|
1705
|
+
declare class TursoStorage extends BaseMemoryStorage {
|
|
1706
|
+
private client;
|
|
1707
|
+
private config;
|
|
1708
|
+
private tableName;
|
|
1709
|
+
private connectionPromise;
|
|
1710
|
+
private tableInitialized;
|
|
1711
|
+
constructor(config: TursoConfig);
|
|
1712
|
+
connect(): Promise<void>;
|
|
1713
|
+
private ensureTableExists;
|
|
1714
|
+
private ensureConnected;
|
|
1715
|
+
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1716
|
+
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1717
|
+
clear(sessionId: string): Promise<void>;
|
|
1718
|
+
delete(sessionId: string): Promise<void>;
|
|
1719
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1720
|
+
disconnect(): Promise<void>;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
interface ConvexConfig {
|
|
1724
|
+
url: string;
|
|
1725
|
+
adminKey?: string;
|
|
1726
|
+
}
|
|
1727
|
+
declare class ConvexStorage extends BaseMemoryStorage {
|
|
1728
|
+
private client;
|
|
1729
|
+
private config;
|
|
1730
|
+
private connectionPromise;
|
|
1731
|
+
constructor(config: ConvexConfig);
|
|
1732
|
+
connect(): Promise<void>;
|
|
1733
|
+
private ensureConnected;
|
|
1734
|
+
add(sessionId: string, message: MemoryMessage): Promise<void>;
|
|
1735
|
+
get(sessionId: string, limit?: number): Promise<MemoryMessage[]>;
|
|
1736
|
+
clear(sessionId: string): Promise<void>;
|
|
1737
|
+
delete(sessionId: string): Promise<void>;
|
|
1738
|
+
exists(sessionId: string): Promise<boolean>;
|
|
1739
|
+
disconnect(): Promise<void>;
|
|
1740
|
+
}
|
|
1741
|
+
declare const CONVEX_SCHEMA_TEMPLATE = "\n// convex/schema.ts\nimport { defineSchema, defineTable } from \"convex/server\";\nimport { v } from \"convex/values\";\n\nexport default defineSchema({\n sekuireMemory: defineTable({\n sessionId: v.string(),\n role: v.union(v.literal(\"user\"), v.literal(\"assistant\"), v.literal(\"system\")),\n content: v.string(),\n timestamp: v.number(),\n metadata: v.optional(v.any()),\n }).index(\"by_session\", [\"sessionId\", \"timestamp\"]),\n});\n";
|
|
1742
|
+
declare const CONVEX_FUNCTIONS_TEMPLATE = "\n// convex/sekuireMemory.ts\nimport { mutation, query } from \"./_generated/server\";\nimport { v } from \"convex/values\";\n\nexport const add = mutation({\n args: {\n sessionId: v.string(),\n role: v.union(v.literal(\"user\"), v.literal(\"assistant\"), v.literal(\"system\")),\n content: v.string(),\n timestamp: v.number(),\n metadata: v.optional(v.any()),\n },\n handler: async (ctx, args) => {\n await ctx.db.insert(\"sekuireMemory\", args);\n },\n});\n\nexport const get = query({\n args: {\n sessionId: v.string(),\n limit: v.optional(v.number()),\n },\n handler: async (ctx, args) => {\n let query = ctx.db\n .query(\"sekuireMemory\")\n .withIndex(\"by_session\", (q) => q.eq(\"sessionId\", args.sessionId))\n .order(\"asc\");\n\n const messages = await query.collect();\n\n if (args.limit) {\n return messages.slice(-args.limit);\n }\n return messages;\n },\n});\n\nexport const clear = mutation({\n args: {\n sessionId: v.string(),\n },\n handler: async (ctx, args) => {\n const messages = await ctx.db\n .query(\"sekuireMemory\")\n .withIndex(\"by_session\", (q) => q.eq(\"sessionId\", args.sessionId))\n .collect();\n\n for (const message of messages) {\n await ctx.db.delete(message._id);\n }\n },\n});\n\nexport const exists = query({\n args: {\n sessionId: v.string(),\n },\n handler: async (ctx, args) => {\n const message = await ctx.db\n .query(\"sekuireMemory\")\n .withIndex(\"by_session\", (q) => q.eq(\"sessionId\", args.sessionId))\n .first();\n return message !== null;\n },\n});\n";
|
|
1743
|
+
|
|
1744
|
+
type StorageFactory = (config: any) => MemoryStorage;
|
|
1745
|
+
declare function registerStorage(type: string, factory: StorageFactory, description?: string): void;
|
|
1746
|
+
declare function hasStorage(type: string): boolean;
|
|
1747
|
+
declare function listStorageTypes(): string[];
|
|
1748
|
+
declare function getStorageInfo(): Array<{
|
|
1749
|
+
type: string;
|
|
1750
|
+
description?: string;
|
|
1751
|
+
}>;
|
|
1752
|
+
|
|
1753
|
+
type BuiltInMemoryType = 'in-memory' | 'buffer' | 'redis' | 'postgres' | 'sqlite' | 'upstash' | 'cloudflare-kv' | 'cloudflare-d1' | 'dynamodb' | 'turso' | 'convex';
|
|
1754
|
+
type MemoryType = BuiltInMemoryType | string;
|
|
1487
1755
|
interface MemoryFactoryConfig {
|
|
1488
1756
|
type: MemoryType;
|
|
1489
1757
|
redis?: RedisConfig;
|
|
1490
1758
|
postgres?: PostgresConfig;
|
|
1759
|
+
sqlite?: SQLiteConfig;
|
|
1760
|
+
upstash?: UpstashConfig;
|
|
1761
|
+
cloudflareKV?: CloudflareKVConfig;
|
|
1762
|
+
cloudflareD1?: CloudflareD1Config;
|
|
1763
|
+
dynamodb?: DynamoDBConfig;
|
|
1764
|
+
turso?: TursoConfig;
|
|
1765
|
+
convex?: ConvexConfig;
|
|
1766
|
+
options?: Record<string, unknown>;
|
|
1767
|
+
instance?: MemoryStorage;
|
|
1491
1768
|
}
|
|
1492
1769
|
declare function createMemoryStorage(config: MemoryFactoryConfig): MemoryStorage;
|
|
1493
1770
|
|
|
@@ -2868,5 +3145,5 @@ declare class A2ATaskDelegator {
|
|
|
2868
3145
|
}
|
|
2869
3146
|
declare function createDelegator(config: DelegatorConfig): A2ATaskDelegator;
|
|
2870
3147
|
|
|
2871
|
-
export { A2AClient, A2AError, A2AServer, A2ATaskDelegator, SekuireAgent as Agent, AgentIdentity, AnthropicProvider, Beacon, ComplianceError, ComplianceMonitor, ContentPolicyError, CryptoError, DEFAULT_API_URL, FileAccessError, GoogleProvider, InMemoryStorage, NetworkComplianceError, NetworkError, OllamaProvider, OpenAIProvider, PolicyClient, PolicyEnforcer, PolicyViolationError, PostgresStorage, ProtocolError, RedisStorage, SekuireAgent$1 as SekuireAgent, SekuireAgentBuilder, SekuireClient, SekuireCrypto, SekuireError, SekuireLogger, SekuireRegistryClient, SekuireSDK, SekuireServer, SekuireSpanExporter, TaskWorker, Tool, ToolPatternParser, ToolRegistry, ToolUsageError, builtInTools, calculateSekuireId, createAgent, createBeacon, createDefaultToolRegistry, createDelegationTool, createDelegator, createDiscoveryTool, createLLMProvider, createMemoryStorage, createRegistryClient, createSekuireClient, createSekuireExpressMiddleware, createSekuireFastifyPlugin, createWorker, detectDeploymentUrl, generateKeyPair, getAgent, getAgentConfig, getAgents, getTools$1 as getLegacyTools, getSystemPrompt, getTools, getTracer, initTelemetry, llm, loadConfig, loadSystemPrompt, loadTools, shutdownTelemetry, tool, tools };
|
|
2872
|
-
export type { A2AArtifact, A2AClientOptions, A2AMessage, A2AMessagePart, A2ARouteRequest, A2ARouteResponse, A2AServerOptions, A2ATask, A2ATaskState, A2ATaskStatus, ActivePolicy, ActivePolicyResponse, AgentCapabilities, AgentCard, AgentConfig, AgentId, AgentInvokeOptions, AgentOptions, AgentProvider, AgentResponse$1 as AgentResponse, AgentSkill, BeaconConfig, BeaconStatus, ChatChunk, ChatOptions, ChatResponse, ComplianceConfig, ComplianceViolation, ToolDefinition$1 as ConfigToolDefinition, CreateOrgRequest, CreateWorkspaceRequest, DelegationRequest, DelegationResult, DelegatorConfig, DisputeRequest, DisputeResponse, EventLog, EventType, ExporterType, HandshakeAuth, HandshakeHello, HandshakeResult, HandshakeWelcome, HexString, IdentityConfig, InviteRequest, InviteResponse, JsonRpcError, JsonRpcRequest, JsonRpcResponse, KeyPair, LLMConfig, Message as LLMMessage, LLMProvider, LLMProviderConfig, ToolCallFunction as LLMToolCall, ToolDefinition as LLMToolDefinition, LeaderboardEntry, LoggerConfig$1 as LoggerConfig, Manifest, MemoryConfig, MemoryFactoryConfig, MemoryMessage, MemoryStorage, MemoryType, Message$1 as Message, OrgResponse, OrgSummary, PostgresConfig, ProjectMetadata, PublishAgentOptions, PublishRequest, PublishResponse, RedisConfig, RegistryClientConfig, ReputationLog, ReputationResponse, SearchAgentsOptions, SekuireAgentConfig, SekuireClientConfig, SekuireConfig, SekuireExporterConfig, SekuireSDKConfig, Severity, SkillContext, SkillHandler, StreamingSkillContext, StreamingSkillHandler, StreamingUpdate, SubmitReputationRequest, TaskCompletion, TaskContext, TaskEvent, TaskHandler, TaskState, TaskUpdateEvent, TasksCancelParams, TasksGetParams, TasksSendParams, TasksSendSubscribeParams, TelemetryConfig, ToolCall, ToolDefinition$2 as ToolDefinition, ToolInput, ToolMetadata, ToolParameter, ToolsSchema, TrustHeaders, TrustHeadersRequest, UpdateAgentOptions, UserContextResponse, VerificationIssue, VerificationRequest, VerificationResult, VerificationStatus, VerifyAgentRequest, WorkerConfig, WorkspaceResponse, WorkspaceSummary };
|
|
3148
|
+
export { A2AClient, A2AError, A2AServer, A2ATaskDelegator, SekuireAgent as Agent, AgentIdentity, AnthropicProvider, BaseMemoryStorage, Beacon, CONVEX_FUNCTIONS_TEMPLATE, CONVEX_SCHEMA_TEMPLATE, CloudflareD1Storage, CloudflareKVStorage, ComplianceError, ComplianceMonitor, ContentPolicyError, ConvexStorage, CryptoError, DEFAULT_API_URL, DynamoDBStorage, FileAccessError, GoogleProvider, InMemoryStorage, NetworkComplianceError, NetworkError, OllamaProvider, OpenAIProvider, PolicyClient, PolicyEnforcer, PolicyViolationError, PostgresStorage, ProtocolError, RedisStorage, SQLiteStorage, SekuireAgent$1 as SekuireAgent, SekuireAgentBuilder, SekuireClient, SekuireCrypto, SekuireError, SekuireLogger, SekuireRegistryClient, SekuireSDK, SekuireServer, SekuireSpanExporter, TaskWorker, Tool, ToolPatternParser, ToolRegistry, ToolUsageError, TursoStorage, UpstashStorage, builtInTools, calculateSekuireId, createAgent, createBeacon, createDefaultToolRegistry, createDelegationTool, createDelegator, createDiscoveryTool, createLLMProvider, createMemoryStorage, createRegistryClient, createSekuireClient, createSekuireExpressMiddleware, createSekuireFastifyPlugin, createWorker, detectDeploymentUrl, generateKeyPair, getAgent, getAgentConfig, getAgents, getTools$1 as getLegacyTools, getStorageInfo, getSystemPrompt, getTools, getTracer, hasStorage, initTelemetry, listStorageTypes, llm, loadConfig, loadSystemPrompt, loadTools, registerStorage, shutdownTelemetry, tool, tools };
|
|
3149
|
+
export type { A2AArtifact, A2AClientOptions, A2AMessage, A2AMessagePart, A2ARouteRequest, A2ARouteResponse, A2AServerOptions, A2ATask, A2ATaskState, A2ATaskStatus, ActivePolicy, ActivePolicyResponse, AgentCapabilities, AgentCard, AgentConfig, AgentId, AgentInvokeOptions, AgentOptions, AgentProvider, AgentResponse$1 as AgentResponse, AgentSkill, BeaconConfig, BeaconStatus, BootstrapResponse, BuiltInMemoryType, ChatChunk, ChatOptions, ChatResponse, CloudflareD1Config, CloudflareKVConfig, ComplianceConfig, ComplianceViolation, ToolDefinition$1 as ConfigToolDefinition, ConvexConfig, CreateOrgRequest, CreateWorkspaceRequest, DelegationRequest, DelegationResult, DelegatorConfig, DisputeRequest, DisputeResponse, DynamoDBConfig, EventLog, EventType, ExporterType, HandshakeAuth, HandshakeHello, HandshakeResult, HandshakeWelcome, HexString, IdentityConfig, InviteRequest, InviteResponse, JsonRpcError, JsonRpcRequest, JsonRpcResponse, KeyPair, LLMConfig, Message as LLMMessage, LLMProvider, LLMProviderConfig, ToolCallFunction as LLMToolCall, ToolDefinition as LLMToolDefinition, LeaderboardEntry, LoggerConfig$1 as LoggerConfig, Manifest, MemoryConfig, MemoryFactoryConfig, MemoryMessage, MemoryStorage, MemoryType, Message$1 as Message, OrgResponse, OrgSummary, PostgresConfig, ProjectMetadata, PublishAgentOptions, PublishRequest, PublishResponse, RedisConfig, RegistryClientConfig, ReputationLog, ReputationResponse, SQLiteConfig, SearchAgentsOptions, SekuireAgentConfig, SekuireClientConfig, SekuireConfig, SekuireExporterConfig, SekuireSDKConfig, Severity, SkillContext, SkillHandler, StreamingSkillContext, StreamingSkillHandler, StreamingUpdate, SubmitReputationRequest, TaskCompletion, TaskContext, TaskEvent, TaskHandler, TaskState, TaskUpdateEvent, TasksCancelParams, TasksGetParams, TasksSendParams, TasksSendSubscribeParams, TelemetryConfig, ToolCall, ToolDefinition$2 as ToolDefinition, ToolInput, ToolMetadata, ToolParameter, ToolsSchema, TrustHeaders, TrustHeadersRequest, TursoConfig, UpdateAgentOptions, UpstashConfig, UserContextResponse, VerificationIssue, VerificationRequest, VerificationResult, VerificationStatus, VerifyAgentRequest, WorkerConfig, WorkspaceResponse, WorkspaceSummary };
|