@prismer/sdk 1.7.1 → 1.7.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/dist/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ export { AIPIdentity, DIDDocument, SignedPayload } from '@prismer/aip-sdk';
2
+
1
3
  /**
2
4
  * Prismer Cloud Real-Time Client — WebSocket & SSE transports.
3
5
  *
@@ -36,6 +38,19 @@ interface MessageNewPayload {
36
38
  metadata?: Record<string, any>;
37
39
  createdAt: string;
38
40
  }
41
+ interface MessageEditPayload {
42
+ id: string;
43
+ conversationId: string;
44
+ content: string;
45
+ type: string;
46
+ editedAt: string;
47
+ editedBy: string;
48
+ metadata?: Record<string, any>;
49
+ }
50
+ interface MessageDeletedPayload {
51
+ id: string;
52
+ conversationId: string;
53
+ }
39
54
  interface TypingIndicatorPayload {
40
55
  conversationId: string;
41
56
  userId: string;
@@ -62,6 +77,8 @@ interface ReconnectingPayload {
62
77
  interface RealtimeEventMap {
63
78
  'authenticated': AuthenticatedPayload;
64
79
  'message.new': MessageNewPayload;
80
+ 'message.edit': MessageEditPayload;
81
+ 'message.deleted': MessageDeletedPayload;
65
82
  'typing.indicator': TypingIndicatorPayload;
66
83
  'presence.changed': PresenceChangedPayload;
67
84
  'pong': PongPayload;
@@ -122,7 +139,11 @@ declare class RealtimeWSClient extends TypedEmitter {
122
139
  connect(): Promise<void>;
123
140
  disconnect(code?: number, reason?: string): void;
124
141
  joinConversation(conversationId: string): void;
125
- sendMessage(conversationId: string, content: string, type?: string): void;
142
+ sendMessage(conversationId: string, content: string, options?: string | {
143
+ type?: string;
144
+ metadata?: Record<string, any>;
145
+ parentId?: string;
146
+ }): void;
126
147
  startTyping(conversationId: string): void;
127
148
  stopTyping(conversationId: string): void;
128
149
  updatePresence(status: string): void;
@@ -913,8 +934,410 @@ interface OfflineConfig {
913
934
  warningThreshold?: number;
914
935
  };
915
936
  }
937
+ type TaskStatus = 'pending' | 'assigned' | 'running' | 'completed' | 'failed' | 'cancelled';
938
+ type ScheduleType = 'once' | 'interval' | 'cron';
939
+ interface IMCreateTaskOptions {
940
+ title: string;
941
+ description?: string;
942
+ capability?: string;
943
+ input?: Record<string, unknown>;
944
+ contextUri?: string;
945
+ assigneeId?: string;
946
+ scheduleType?: ScheduleType;
947
+ scheduleAt?: string;
948
+ scheduleCron?: string;
949
+ intervalMs?: number;
950
+ maxRuns?: number;
951
+ timeoutMs?: number;
952
+ deadline?: string;
953
+ maxRetries?: number;
954
+ retryDelayMs?: number;
955
+ budget?: number;
956
+ metadata?: Record<string, unknown>;
957
+ }
958
+ interface IMUpdateTaskOptions {
959
+ assigneeId?: string;
960
+ status?: TaskStatus;
961
+ metadata?: Record<string, unknown>;
962
+ }
963
+ interface IMTaskListOptions {
964
+ status?: TaskStatus;
965
+ capability?: string;
966
+ assigneeId?: string;
967
+ creatorId?: string;
968
+ scheduleType?: ScheduleType;
969
+ limit?: number;
970
+ cursor?: string;
971
+ }
972
+ interface IMCompleteTaskOptions {
973
+ result?: unknown;
974
+ resultUri?: string;
975
+ cost?: number;
976
+ }
977
+ interface IMTask {
978
+ id: string;
979
+ title: string;
980
+ description: string | null;
981
+ capability: string | null;
982
+ input: Record<string, unknown>;
983
+ contextUri: string | null;
984
+ creatorId: string;
985
+ assigneeId: string | null;
986
+ status: TaskStatus;
987
+ scheduleType: ScheduleType | null;
988
+ scheduleCron: string | null;
989
+ intervalMs: number | null;
990
+ nextRunAt: string | null;
991
+ lastRunAt: string | null;
992
+ runCount: number;
993
+ maxRuns: number | null;
994
+ result: unknown | null;
995
+ resultUri: string | null;
996
+ error: string | null;
997
+ budget: number | null;
998
+ cost: number;
999
+ timeoutMs: number;
1000
+ deadline: string | null;
1001
+ maxRetries: number;
1002
+ retryDelayMs: number;
1003
+ retryCount: number;
1004
+ metadata: Record<string, unknown>;
1005
+ createdAt: string;
1006
+ updatedAt: string;
1007
+ }
1008
+ interface IMTaskLog {
1009
+ id: string;
1010
+ taskId: string;
1011
+ actorId: string | null;
1012
+ action: string;
1013
+ message: string | null;
1014
+ metadata: Record<string, unknown>;
1015
+ createdAt: string;
1016
+ }
1017
+ interface IMTaskDetail {
1018
+ task: IMTask;
1019
+ logs: IMTaskLog[];
1020
+ }
1021
+ interface IMCreateMemoryFileOptions {
1022
+ path: string;
1023
+ content: string;
1024
+ scope?: string;
1025
+ ownerType?: 'user' | 'agent';
1026
+ }
1027
+ interface IMUpdateMemoryFileOptions {
1028
+ operation: 'append' | 'replace' | 'replace_section';
1029
+ content: string;
1030
+ section?: string;
1031
+ version?: number;
1032
+ }
1033
+ interface IMCompactOptions {
1034
+ conversationId: string;
1035
+ summary: string;
1036
+ messageRangeStart?: string;
1037
+ messageRangeEnd?: string;
1038
+ }
1039
+ interface IMMemoryFile {
1040
+ id: string;
1041
+ ownerId: string;
1042
+ ownerType: 'user' | 'agent';
1043
+ scope: string;
1044
+ path: string;
1045
+ version: number;
1046
+ contentLength: number;
1047
+ createdAt: string;
1048
+ updatedAt: string;
1049
+ }
1050
+ interface IMMemoryFileDetail extends IMMemoryFile {
1051
+ content: string;
1052
+ }
1053
+ interface IMCompactionSummary {
1054
+ id: string;
1055
+ conversationId: string;
1056
+ summary: string;
1057
+ messageRangeStart: string | null;
1058
+ messageRangeEnd: string | null;
1059
+ tokenCount: number;
1060
+ createdAt: string;
1061
+ }
1062
+ interface IMMemoryLoadResult {
1063
+ content: string | null;
1064
+ totalLines: number;
1065
+ totalBytes: number;
1066
+ version: number;
1067
+ id: string | null;
1068
+ scope: string;
1069
+ path: string;
1070
+ template: string;
1071
+ }
1072
+ type DerivationMode = 'generated' | 'derived' | 'imported';
1073
+ interface IMRegisterKeyOptions {
1074
+ publicKey: string;
1075
+ derivationMode?: DerivationMode;
1076
+ }
1077
+ interface IMIdentityKey {
1078
+ imUserId: string;
1079
+ publicKey: string;
1080
+ keyId: string;
1081
+ attestation: string | null;
1082
+ derivationMode: DerivationMode;
1083
+ registeredAt: string;
1084
+ revokedAt: string | null;
1085
+ serverPublicKey?: string;
1086
+ }
1087
+ interface IMKeyAuditEntry {
1088
+ id: number;
1089
+ imUserId: string;
1090
+ action: 'register' | 'rotate' | 'revoke';
1091
+ publicKey: string;
1092
+ keyId: string;
1093
+ attestation: string;
1094
+ prevLogHash: string | null;
1095
+ createdAt: string;
1096
+ }
1097
+ interface IMKeyVerifyResult {
1098
+ valid: boolean;
1099
+ invalidAt?: number;
1100
+ }
1101
+ type GeneCategory = 'repair' | 'optimize' | 'innovate' | 'diagnostic';
1102
+ type GeneVisibility = 'private' | 'canary' | 'published' | 'quarantined' | 'seed';
1103
+ /** v0.3.0 SignalTag — hierarchical label for a trigger dimension */
1104
+ interface SignalTag {
1105
+ type: string;
1106
+ provider?: string;
1107
+ stage?: string;
1108
+ severity?: string;
1109
+ [key: string]: string | undefined;
1110
+ }
1111
+ interface IMCreateGeneOptions {
1112
+ category: GeneCategory;
1113
+ signals_match: string[] | SignalTag[];
1114
+ strategy: string[];
1115
+ title?: string;
1116
+ preconditions?: string[];
1117
+ constraints?: Record<string, unknown>;
1118
+ }
1119
+ interface IMAnalyzeOptions {
1120
+ context?: string;
1121
+ signals?: string[] | SignalTag[];
1122
+ task_status?: string;
1123
+ task_capability?: string;
1124
+ error?: string;
1125
+ tags?: string[];
1126
+ custom_signals?: string[];
1127
+ provider?: string;
1128
+ stage?: string;
1129
+ severity?: string;
1130
+ }
1131
+ interface IMRecordOutcomeOptions {
1132
+ gene_id: string;
1133
+ signals: string[] | SignalTag[];
1134
+ outcome: 'success' | 'failed';
1135
+ score?: number;
1136
+ summary: string;
1137
+ cost_credits?: number;
1138
+ metadata?: Record<string, unknown>;
1139
+ strategy_used?: string[];
1140
+ }
1141
+ interface IMGene {
1142
+ type: string;
1143
+ id: string;
1144
+ category: GeneCategory;
1145
+ title?: string;
1146
+ description?: string;
1147
+ visibility?: GeneVisibility;
1148
+ signals_match: SignalTag[];
1149
+ preconditions: string[];
1150
+ strategy: string[];
1151
+ constraints: Record<string, unknown>;
1152
+ success_count: number;
1153
+ failure_count: number;
1154
+ last_used_at: string | null;
1155
+ created_by: string;
1156
+ distilled_from?: string[];
1157
+ parentGeneId?: string | null;
1158
+ forkCount?: number;
1159
+ generation?: number;
1160
+ }
1161
+ interface IMAnalyzeResult {
1162
+ action: 'apply_gene' | 'explore' | 'none' | 'create_suggested';
1163
+ gene_id?: string;
1164
+ gene?: IMGene;
1165
+ strategy?: string[];
1166
+ confidence: number;
1167
+ coverageScore?: number;
1168
+ signals: SignalTag[];
1169
+ alternatives?: Array<{
1170
+ gene_id: string;
1171
+ confidence: number;
1172
+ }>;
1173
+ reason?: string;
1174
+ suggestion?: {
1175
+ category: GeneCategory;
1176
+ signals_match: SignalTag[];
1177
+ title: string;
1178
+ description: string;
1179
+ similar_genes: Array<{
1180
+ gene_id: string;
1181
+ title: string;
1182
+ similarity: number;
1183
+ }>;
1184
+ };
1185
+ }
1186
+ interface IMEvolutionStats {
1187
+ total_genes: number;
1188
+ total_capsules: number;
1189
+ avg_success_rate: number;
1190
+ active_agents: number;
1191
+ }
1192
+ interface IMCapsule {
1193
+ id: string;
1194
+ gene_id: string;
1195
+ agent_id: string;
1196
+ signals: string[];
1197
+ outcome: string;
1198
+ score: number;
1199
+ summary: string;
1200
+ created_at: string;
1201
+ }
1202
+ interface IMEvolutionEdge {
1203
+ signal_key: string;
1204
+ gene_id: string;
1205
+ success_count: number;
1206
+ failure_count: number;
1207
+ confidence: number;
1208
+ last_score: number | null;
1209
+ last_used_at: string | null;
1210
+ }
1211
+ interface IMAgentPersonality {
1212
+ rigor: number;
1213
+ creativity: number;
1214
+ risk_tolerance: number;
1215
+ }
1216
+ interface IMGeneListOptions {
1217
+ category?: GeneCategory;
1218
+ search?: string;
1219
+ sort?: 'newest' | 'most_used' | 'highest_success';
1220
+ page?: number;
1221
+ limit?: number;
1222
+ }
1223
+ interface IMForkGeneOptions {
1224
+ gene_id: string;
1225
+ modifications?: Record<string, unknown>;
1226
+ }
1227
+ interface IMSkillInfo {
1228
+ id: string;
1229
+ slug: string;
1230
+ name: string;
1231
+ description: string;
1232
+ category: string;
1233
+ tags: string[];
1234
+ author: string;
1235
+ source: string;
1236
+ sourceUrl: string;
1237
+ installs: number;
1238
+ stars: number;
1239
+ status: string;
1240
+ version: string;
1241
+ compatibility: string[];
1242
+ signals: SignalTag[];
1243
+ geneId: string | null;
1244
+ hasPackage: boolean;
1245
+ fileCount: number;
1246
+ }
1247
+ interface IMSkillInstallResult {
1248
+ agentSkill: {
1249
+ id: string;
1250
+ status: string;
1251
+ version: string;
1252
+ installedAt: string;
1253
+ };
1254
+ gene: IMGene | null;
1255
+ skill: IMSkillInfo & {
1256
+ content: string;
1257
+ };
1258
+ installGuide: Record<string, {
1259
+ auto?: string;
1260
+ manual?: string;
1261
+ command?: string;
1262
+ [key: string]: any;
1263
+ }>;
1264
+ }
1265
+ interface IMAgentSkillRecord {
1266
+ agentSkill: {
1267
+ id: string;
1268
+ skillId: string;
1269
+ geneId: string | null;
1270
+ status: string;
1271
+ version: string;
1272
+ installedAt: string;
1273
+ };
1274
+ skill: IMSkillInfo;
1275
+ gene: IMGene | null;
1276
+ }
1277
+ interface IMSkillContent {
1278
+ content: string;
1279
+ packageUrl: string | null;
1280
+ files: Array<{
1281
+ path: string;
1282
+ size: number;
1283
+ }>;
1284
+ checksum: string | null;
1285
+ }
916
1286
  /** Internal request function type */
917
1287
  type RequestFn = <T>(method: string, path: string, body?: unknown, query?: Record<string, string>) => Promise<T>;
1288
+ interface ExecutionContext {
1289
+ error?: string;
1290
+ provider?: string;
1291
+ stage?: string;
1292
+ severity?: string;
1293
+ taskStatus?: string;
1294
+ taskCapability?: string;
1295
+ tags?: string[];
1296
+ [key: string]: unknown;
1297
+ }
1298
+ interface SignalEnrichmentConfig {
1299
+ mode: 'rules' | 'llm';
1300
+ llmExtract?: (ctx: ExecutionContext) => Promise<SignalTag[]>;
1301
+ timeoutMs?: number;
1302
+ cacheTtlMs?: number;
1303
+ }
1304
+ interface GeneSelectionResult {
1305
+ action: 'apply_gene' | 'create_suggested' | 'none';
1306
+ gene_id?: string;
1307
+ gene?: IMGene;
1308
+ strategy?: string[];
1309
+ confidence: number;
1310
+ coverageScore?: number;
1311
+ alternatives?: Array<{
1312
+ gene_id: string;
1313
+ confidence: number;
1314
+ title?: string;
1315
+ }>;
1316
+ reason?: string;
1317
+ fromCache: boolean;
1318
+ }
1319
+ interface EvolutionSyncSnapshot {
1320
+ genes: IMGene[];
1321
+ edges: IMEvolutionEdge[];
1322
+ globalPrior: Record<string, {
1323
+ alpha: number;
1324
+ beta: number;
1325
+ }>;
1326
+ cursor: number;
1327
+ }
1328
+ interface EvolutionSyncDelta {
1329
+ pulled: {
1330
+ genes: IMGene[];
1331
+ edges: IMEvolutionEdge[];
1332
+ globalPrior: Record<string, {
1333
+ alpha: number;
1334
+ beta: number;
1335
+ }>;
1336
+ promotions: string[];
1337
+ quarantines: string[];
1338
+ cursor: number;
1339
+ };
1340
+ }
918
1341
 
919
1342
  /**
920
1343
  * Prismer SDK — Offline Manager, Outbox Queue, and Sync Engine.
@@ -1200,8 +1623,17 @@ declare class E2EEncryption {
1200
1623
  /**
1201
1624
  * Initialize encryption with user passphrase.
1202
1625
  * Derives a master key via PBKDF2 and generates an ECDH key pair.
1626
+ *
1627
+ * @param passphrase - User passphrase for master key derivation
1628
+ * @param salt - Optional Base64-encoded salt. If omitted, a random 16-byte salt is generated.
1629
+ * Store the salt (via exportSalt()) so you can re-derive the same master key later.
1630
+ */
1631
+ init(passphrase: string, salt?: string): Promise<void>;
1632
+ /**
1633
+ * Export the salt as Base64 string for persistent storage.
1634
+ * You must store this and pass it back to init() to re-derive the same master key.
1203
1635
  */
1204
- init(passphrase: string): Promise<void>;
1636
+ exportSalt(): string;
1205
1637
  /**
1206
1638
  * Export public key for sharing with conversation peers.
1207
1639
  */
@@ -1243,6 +1675,357 @@ declare class E2EEncryption {
1243
1675
  * Clear all keys and reset state.
1244
1676
  */
1245
1677
  destroy(): void;
1678
+ private messageCount;
1679
+ private static readonly KEY_ROTATION_THRESHOLD;
1680
+ private static readonly KEY_ROTATION_INTERVAL_MS;
1681
+ private lastRotation;
1682
+ /**
1683
+ * High-level encrypt-for-send pipeline.
1684
+ * Encrypts content, builds metadata, and handles key rotation.
1685
+ *
1686
+ * Returns { encryptedContent, metadata } ready to send.
1687
+ */
1688
+ encryptForSend(conversationId: string, content: string): Promise<{
1689
+ encryptedContent: string;
1690
+ metadata: Record<string, any>;
1691
+ }>;
1692
+ /**
1693
+ * High-level decrypt-on-receive pipeline.
1694
+ * Decrypts content and validates metadata.
1695
+ */
1696
+ decryptOnReceive(conversationId: string, encryptedContent: string, metadata?: Record<string, any>): Promise<string>;
1697
+ /**
1698
+ * High-level file encryption pipeline.
1699
+ */
1700
+ encryptFile(conversationId: string, fileData: ArrayBuffer): Promise<{
1701
+ encryptedData: string;
1702
+ metadata: Record<string, any>;
1703
+ }>;
1704
+ /**
1705
+ * High-level file decryption pipeline.
1706
+ */
1707
+ decryptFile(conversationId: string, encryptedData: string): Promise<ArrayBuffer>;
1708
+ /**
1709
+ * Check if key rotation is needed (1000 messages or 24 hours).
1710
+ */
1711
+ private shouldRotateKey;
1712
+ /**
1713
+ * Perform key rotation: generate new ECDH keypair and reset counters.
1714
+ * The caller is responsible for re-exchanging keys with peers.
1715
+ */
1716
+ rotateKeys(): Promise<JsonWebKey>;
1717
+ }
1718
+
1719
+ /**
1720
+ * Encryption Pipeline — wraps message send/receive with automatic E2E.
1721
+ *
1722
+ * This is a HELPER module — it does not modify existing client behavior.
1723
+ * Users opt-in by calling pipeline functions explicitly before send / after receive.
1724
+ *
1725
+ * Usage:
1726
+ * import { E2EEncryption } from '@prismer/sdk';
1727
+ * import { encryptForSend, decryptOnReceive } from '@prismer/sdk';
1728
+ *
1729
+ * const e2e = new E2EEncryption();
1730
+ * await e2e.init('passphrase');
1731
+ * await e2e.generateSessionKey('conv-123');
1732
+ *
1733
+ * // Before sending
1734
+ * const enc = await encryptForSend(e2e, 'conv-123', 'Hello!');
1735
+ * await client.im.messages.send('conv-123', enc.content, { metadata: enc.metadata });
1736
+ *
1737
+ * // After receiving
1738
+ * const dec = await decryptOnReceive(e2e, msg.conversationId, msg.content, msg.metadata);
1739
+ * if (dec.decrypted) console.log('Plaintext:', dec.content);
1740
+ */
1741
+
1742
+ interface EncryptedMessage {
1743
+ content: string;
1744
+ metadata: Record<string, unknown>;
1745
+ }
1746
+ interface DecryptResult {
1747
+ content: string;
1748
+ decrypted: boolean;
1749
+ error?: string;
1750
+ }
1751
+ interface EncryptedFileResult {
1752
+ data: string;
1753
+ metadata: {
1754
+ encrypted: true;
1755
+ encKeyId: string;
1756
+ };
1757
+ }
1758
+ interface EncryptedContextResult {
1759
+ content: string;
1760
+ encrypted: true;
1761
+ }
1762
+ /**
1763
+ * Encrypt a message before sending.
1764
+ * Returns modified content + metadata with encrypted flag.
1765
+ *
1766
+ * If no session key exists for the conversation, returns plaintext unchanged.
1767
+ */
1768
+ declare function encryptForSend(e2e: E2EEncryption, conversationId: string, content: string, metadata?: Record<string, unknown>): Promise<EncryptedMessage>;
1769
+ /**
1770
+ * Decrypt a received message.
1771
+ * Returns the plaintext content, or the original content if:
1772
+ * - The message is not encrypted (metadata.encrypted !== true)
1773
+ * - No session key is available for the conversation
1774
+ * - Decryption fails (returns original content + error string)
1775
+ */
1776
+ declare function decryptOnReceive(e2e: E2EEncryption, conversationId: string, content: string, metadata?: Record<string, unknown>): Promise<DecryptResult>;
1777
+ /**
1778
+ * Encrypt a file buffer before upload.
1779
+ *
1780
+ * Converts the file bytes to base64, encrypts as text using the conversation
1781
+ * session key, and returns the ciphertext string + metadata.
1782
+ *
1783
+ * Returns null if no session key exists for the conversation.
1784
+ *
1785
+ * Note: File size increases ~33% due to base64 encoding + GCM overhead.
1786
+ * The server stores opaque bytes and cannot inspect the content.
1787
+ */
1788
+ declare function encryptFile(e2e: E2EEncryption, conversationId: string, data: Uint8Array): Promise<EncryptedFileResult | null>;
1789
+ /**
1790
+ * Decrypt a file that was encrypted with encryptFile().
1791
+ *
1792
+ * Returns the original file bytes, or null if no session key or decryption fails.
1793
+ */
1794
+ declare function decryptFile(e2e: E2EEncryption, conversationId: string, ciphertext: string): Promise<Uint8Array | null>;
1795
+ /**
1796
+ * Encrypt context cache content (HQCC) before saving.
1797
+ *
1798
+ * Uses a special context ID for key management (default: 'context-cache').
1799
+ * The agent must have a session key for this context ID — generate one with:
1800
+ * await e2e.generateSessionKey('context-cache');
1801
+ *
1802
+ * Returns null if no session key exists.
1803
+ *
1804
+ * Note: Encrypted context CANNOT be server-side compressed or indexed.
1805
+ * The HQCC field becomes opaque. Agents must handle their own compression
1806
+ * before encryption.
1807
+ */
1808
+ declare function encryptContext(e2e: E2EEncryption, content: string, contextId?: string): Promise<EncryptedContextResult | null>;
1809
+ /**
1810
+ * Decrypt context cache content that was encrypted with encryptContext().
1811
+ *
1812
+ * Returns the plaintext HQCC, or null if no session key or decryption fails.
1813
+ */
1814
+ declare function decryptContext(e2e: E2EEncryption, ciphertext: string, contextId?: string): Promise<string | null>;
1815
+ /**
1816
+ * Decrypt an array of messages in-place (mutates the array).
1817
+ * Useful for processing message history after fetching.
1818
+ *
1819
+ * Returns the count of successfully decrypted messages.
1820
+ */
1821
+ declare function decryptMessages<T extends {
1822
+ conversationId?: string;
1823
+ content: string;
1824
+ metadata?: Record<string, unknown>;
1825
+ }>(e2e: E2EEncryption, messages: T[], conversationId?: string): Promise<{
1826
+ decryptedCount: number;
1827
+ errors: Array<{
1828
+ index: number;
1829
+ error: string;
1830
+ }>;
1831
+ }>;
1832
+
1833
+ /**
1834
+ * EvolutionCache — local gene cache with Thompson Sampling selection.
1835
+ * Enables <1ms gene selection without network calls.
1836
+ */
1837
+
1838
+ declare class EvolutionCache {
1839
+ private _genes;
1840
+ private _edges;
1841
+ private _globalPrior;
1842
+ private _cursor;
1843
+ get cursor(): number;
1844
+ get geneCount(): number;
1845
+ /** Load from a full snapshot */
1846
+ loadSnapshot(snapshot: EvolutionSyncSnapshot): void;
1847
+ /** Apply incremental delta (alias: loadDelta) */
1848
+ applyDelta(delta: EvolutionSyncDelta): void;
1849
+ /** Apply incremental delta (alias for applyDelta) */
1850
+ loadDelta(delta: EvolutionSyncDelta): void;
1851
+ /** Select best gene locally using Thompson Sampling — pure CPU, <1ms */
1852
+ selectGene(signals: SignalTag[]): GeneSelectionResult;
1853
+ }
1854
+
1855
+ /**
1856
+ * Signal Enrichment Layer — SDK-side signal extraction.
1857
+ * Migrated from server's signal-extractor.ts regex patterns.
1858
+ * Supports pure-rules mode (zero deps) and optional LLM injection.
1859
+ */
1860
+
1861
+ /**
1862
+ * Extract signals from execution context using regex rules.
1863
+ * Zero dependencies, synchronous, <0.1ms.
1864
+ */
1865
+ declare function extractSignals(ctx: ExecutionContext): SignalTag[];
1866
+ /**
1867
+ * Create an enriched signal extractor with optional LLM injection.
1868
+ * LLM mode: calls the agent's LLM for high-precision extraction.
1869
+ * Falls back to rules mode on timeout or error.
1870
+ */
1871
+ declare function createEnrichedExtractor(config: SignalEnrichmentConfig): (ctx: ExecutionContext) => Promise<SignalTag[]>;
1872
+
1873
+ /**
1874
+ * EvolutionRuntime — High-level evolution API for agents.
1875
+ *
1876
+ * Composes EvolutionCache + SignalEnrichment + async outbox into two simple methods:
1877
+ * - suggest(error, context?) → strategy recommendation (<1ms local, fallback to server)
1878
+ * - learned(error, outcome, summary, geneId?) → fire-and-forget outcome recording
1879
+ *
1880
+ * Also handles:
1881
+ * - Bootstrap: auto-load sync snapshot on init
1882
+ * - Periodic sync: pull delta every N seconds
1883
+ * - Session tracking: correlates suggest → learned within a task
1884
+ *
1885
+ * Usage:
1886
+ * const runtime = new EvolutionRuntime(client.im.evolution);
1887
+ * await runtime.start();
1888
+ *
1889
+ * const fix = await runtime.suggest('ETIMEDOUT: connection timed out');
1890
+ * // ... agent applies fix.strategy ...
1891
+ * runtime.learned('ETIMEDOUT', 'success', 'Fixed by increasing timeout to 30s');
1892
+ */
1893
+
1894
+ /** Minimal interface for the evolution client — avoids circular import */
1895
+ interface EvolutionClientLike {
1896
+ getSyncSnapshot(since?: number): Promise<{
1897
+ data?: any;
1898
+ }>;
1899
+ analyze(options: Record<string, any>): Promise<{
1900
+ data?: any;
1901
+ }>;
1902
+ record(options: Record<string, any>): Promise<{
1903
+ data?: any;
1904
+ }>;
1905
+ sync(options: Record<string, any>): Promise<{
1906
+ data?: any;
1907
+ }>;
1908
+ }
1909
+ interface EvolutionRuntimeConfig {
1910
+ /** Sync interval in ms (default: 60000 = 1 min) */
1911
+ syncIntervalMs?: number;
1912
+ /** Signal enrichment mode */
1913
+ enrichment?: SignalEnrichmentConfig;
1914
+ /** Scope for all operations (default: 'global') */
1915
+ scope?: string;
1916
+ /** Max outbox queue size before force flush */
1917
+ outboxMaxSize?: number;
1918
+ /** Outbox flush interval in ms (default: 5000) */
1919
+ outboxFlushMs?: number;
1920
+ }
1921
+ interface Suggestion {
1922
+ action: 'apply_gene' | 'create_suggested' | 'none';
1923
+ geneId?: string;
1924
+ gene?: IMGene;
1925
+ strategy?: string[];
1926
+ confidence: number;
1927
+ signals: SignalTag[];
1928
+ fromCache: boolean;
1929
+ reason?: string;
1930
+ alternatives?: Array<{
1931
+ gene_id: string;
1932
+ confidence: number;
1933
+ title?: string;
1934
+ }>;
1935
+ }
1936
+ /** Tracks a single suggest→learned cycle within a task. */
1937
+ interface EvolutionSession {
1938
+ /** Unique session ID */
1939
+ id: string;
1940
+ /** When suggest() was called */
1941
+ suggestedAt: number;
1942
+ /** What gene was recommended */
1943
+ suggestedGeneId?: string;
1944
+ /** What gene the agent actually used (may differ from suggested) */
1945
+ usedGeneId?: string;
1946
+ /** Signals that triggered the suggest */
1947
+ signals: SignalTag[];
1948
+ /** Whether agent adopted the recommended strategy */
1949
+ adopted: boolean;
1950
+ /** When learned() was called (null if not yet) */
1951
+ completedAt?: number;
1952
+ /** Outcome */
1953
+ outcome?: 'success' | 'failed';
1954
+ /** Duration from suggest to learned (ms) */
1955
+ durationMs?: number;
1956
+ /** Confidence of the suggestion */
1957
+ confidence: number;
1958
+ /** Whether suggestion came from cache or server */
1959
+ fromCache: boolean;
1960
+ }
1961
+ /** Aggregate session metrics for benchmarking. */
1962
+ interface SessionMetrics {
1963
+ /** Total suggest() calls */
1964
+ totalSuggestions: number;
1965
+ /** suggest() calls that returned a gene */
1966
+ suggestionsWithGene: number;
1967
+ /** learned() calls */
1968
+ totalLearned: number;
1969
+ /** Sessions where agent used the suggested gene */
1970
+ adoptedCount: number;
1971
+ /** Gene Utilization Rate = adoptedCount / suggestionsWithGene */
1972
+ geneUtilizationRate: number;
1973
+ /** Average suggest→learned duration (ms) */
1974
+ avgDurationMs: number;
1975
+ /** Success rate of adopted recommendations */
1976
+ adoptedSuccessRate: number;
1977
+ /** Success rate without adoption (agent did it alone) */
1978
+ nonAdoptedSuccessRate: number;
1979
+ /** Cache hit rate */
1980
+ cacheHitRate: number;
1981
+ }
1982
+ declare class EvolutionRuntime {
1983
+ private client;
1984
+ private cache;
1985
+ private enricher;
1986
+ private outbox;
1987
+ private syncTimer?;
1988
+ private flushTimer?;
1989
+ private lastSuggestedGeneId?;
1990
+ private started;
1991
+ private readonly scope;
1992
+ private readonly config;
1993
+ private _sessions;
1994
+ private _activeSession?;
1995
+ private _sessionCounter;
1996
+ constructor(client: EvolutionClientLike, config?: EvolutionRuntimeConfig);
1997
+ /** Initialize: load snapshot + start sync + start outbox flush */
1998
+ start(): Promise<void>;
1999
+ /** Stop: clear timers + flush remaining outbox */
2000
+ stop(): Promise<void>;
2001
+ /**
2002
+ * Get a strategy recommendation for an error/context.
2003
+ *
2004
+ * Flow: extract signals → try local cache (<1ms) → fallback to server (~30ms)
2005
+ *
2006
+ * @param error - Error message or Error object
2007
+ * @param context - Optional additional context (provider, stage, etc.)
2008
+ */
2009
+ suggest(error: string | Error, context?: Partial<ExecutionContext>): Promise<Suggestion>;
2010
+ /**
2011
+ * Record an outcome. Fire-and-forget — never blocks, never throws.
2012
+ *
2013
+ * @param error - The error that was encountered
2014
+ * @param outcome - 'success' or 'failed'
2015
+ * @param summary - One-line summary of what happened
2016
+ * @param geneId - Gene that was used (auto-detected from last suggest() if omitted)
2017
+ */
2018
+ learned(error: string | Error, outcome: 'success' | 'failed', summary: string, geneId?: string, metadata?: Record<string, any>): void;
2019
+ /** Get all completed sessions. */
2020
+ get sessions(): readonly EvolutionSession[];
2021
+ /** Get aggregate metrics for benchmarking. */
2022
+ getMetrics(): SessionMetrics;
2023
+ /** Reset session history. */
2024
+ resetMetrics(): void;
2025
+ /** Sync cache with server */
2026
+ private sync;
2027
+ /** Flush outbox to server */
2028
+ private flush;
1246
2029
  }
1247
2030
 
1248
2031
  /**
@@ -1329,7 +2112,9 @@ declare class MessagesClient {
1329
2112
  /** Get message history for a conversation */
1330
2113
  getHistory(conversationId: string, options?: IMPaginationOptions): Promise<IMResult<IMMessage[]>>;
1331
2114
  /** Edit a message */
1332
- edit(conversationId: string, messageId: string, content: string): Promise<IMResult<void>>;
2115
+ edit(conversationId: string, messageId: string, content: string, options?: {
2116
+ metadata?: Record<string, any>;
2117
+ }): Promise<IMResult<void>>;
1333
2118
  /** Delete a message */
1334
2119
  delete(conversationId: string, messageId: string): Promise<IMResult<void>>;
1335
2120
  }
@@ -1379,6 +2164,312 @@ declare class WorkspaceClient {
1379
2164
  /** @mention autocomplete */
1380
2165
  mentionAutocomplete(conversationId: string, query?: string): Promise<IMResult<IMAutocompleteResult[]>>;
1381
2166
  }
2167
+ /** Task management: create, list, claim, progress, complete, fail */
2168
+ declare class TasksClient {
2169
+ private _r;
2170
+ constructor(_r: RequestFn);
2171
+ /** Create a new task */
2172
+ create(options: IMCreateTaskOptions): Promise<IMResult<IMTask>>;
2173
+ /** List tasks with optional filters */
2174
+ list(options?: IMTaskListOptions): Promise<IMResult<IMTask[]>>;
2175
+ /** Get task details with logs */
2176
+ get(taskId: string): Promise<IMResult<IMTaskDetail>>;
2177
+ /** Update a task */
2178
+ update(taskId: string, options: IMUpdateTaskOptions): Promise<IMResult<IMTask>>;
2179
+ /** Claim a pending task */
2180
+ claim(taskId: string): Promise<IMResult<IMTask>>;
2181
+ /** Report progress on a task */
2182
+ progress(taskId: string, options?: {
2183
+ message?: string;
2184
+ metadata?: Record<string, unknown>;
2185
+ }): Promise<IMResult<void>>;
2186
+ /** Complete a task with result */
2187
+ complete(taskId: string, options?: IMCompleteTaskOptions): Promise<IMResult<IMTask>>;
2188
+ /** Fail a task with error */
2189
+ fail(taskId: string, error: string, metadata?: Record<string, unknown>): Promise<IMResult<IMTask>>;
2190
+ }
2191
+ /** Memory management: files, compaction, session load */
2192
+ declare class MemoryClient {
2193
+ private _r;
2194
+ constructor(_r: RequestFn);
2195
+ /** Create a memory file */
2196
+ createFile(options: IMCreateMemoryFileOptions): Promise<IMResult<IMMemoryFile>>;
2197
+ /** List memory files */
2198
+ listFiles(options?: {
2199
+ scope?: string;
2200
+ path?: string;
2201
+ }): Promise<IMResult<IMMemoryFile[]>>;
2202
+ /** Get a memory file by ID */
2203
+ getFile(fileId: string): Promise<IMResult<IMMemoryFileDetail>>;
2204
+ /** Update a memory file (append, replace, or replace_section) */
2205
+ updateFile(fileId: string, options: IMUpdateMemoryFileOptions): Promise<IMResult<IMMemoryFileDetail>>;
2206
+ /** Delete a memory file */
2207
+ deleteFile(fileId: string): Promise<IMResult<void>>;
2208
+ /** Compact conversation messages into a summary */
2209
+ compact(options: IMCompactOptions): Promise<IMResult<IMCompactionSummary>>;
2210
+ /** Get compaction summaries for a conversation */
2211
+ getCompaction(conversationId: string): Promise<IMResult<IMCompactionSummary[]>>;
2212
+ /** Load memory for session context */
2213
+ load(scope?: string): Promise<IMResult<IMMemoryLoadResult>>;
2214
+ }
2215
+ /** Identity key management: Ed25519 keys, attestation, audit */
2216
+ declare class IdentityClient {
2217
+ private _r;
2218
+ constructor(_r: RequestFn);
2219
+ /** Get server public key */
2220
+ getServerKey(): Promise<IMResult<{
2221
+ publicKey: string;
2222
+ }>>;
2223
+ /** Register or rotate an identity key */
2224
+ registerKey(options: IMRegisterKeyOptions): Promise<IMResult<IMIdentityKey>>;
2225
+ /** Get a user's identity key */
2226
+ getKey(userId: string): Promise<IMResult<IMIdentityKey>>;
2227
+ /** Revoke own identity key */
2228
+ revokeKey(): Promise<IMResult<void>>;
2229
+ /** Get key audit log for a user */
2230
+ getAuditLog(userId: string): Promise<IMResult<IMKeyAuditEntry[]>>;
2231
+ /** Verify key audit log integrity */
2232
+ verifyAuditLog(userId: string): Promise<IMResult<IMKeyVerifyResult>>;
2233
+ }
2234
+ /** Conversation security: E2E encryption settings and key management */
2235
+ declare class SecurityClient {
2236
+ private _r;
2237
+ constructor(_r: RequestFn);
2238
+ /** Get conversation security settings */
2239
+ getConversationSecurity(conversationId: string): Promise<IMResult<any>>;
2240
+ /** Update conversation security settings */
2241
+ setConversationSecurity(conversationId: string, options: {
2242
+ signingPolicy?: string;
2243
+ encryptionMode?: string;
2244
+ }): Promise<IMResult<any>>;
2245
+ /** Upload a public key for a conversation */
2246
+ uploadKey(conversationId: string, publicKey: string, algorithm?: string): Promise<IMResult<any>>;
2247
+ /** Get keys for a conversation */
2248
+ getKeys(conversationId: string): Promise<IMResult<any[]>>;
2249
+ /** Revoke a key for a specific user in a conversation */
2250
+ revokeKey(conversationId: string, keyUserId: string): Promise<IMResult<any>>;
2251
+ }
2252
+ /** Skill Evolution: gene management, analysis, recording, distillation */
2253
+ declare class EvolutionClient {
2254
+ private _r;
2255
+ constructor(_r: RequestFn);
2256
+ /** Get evolution stats */
2257
+ getStats(): Promise<IMResult<IMEvolutionStats>>;
2258
+ /** Get hot/trending genes */
2259
+ getHotGenes(limit?: number): Promise<IMResult<IMGene[]>>;
2260
+ /** Browse published genes */
2261
+ browseGenes(options?: IMGeneListOptions): Promise<IMResult<IMGene[]>>;
2262
+ /** Get a public gene by ID */
2263
+ getPublicGene(geneId: string): Promise<IMResult<IMGene>>;
2264
+ /** Get capsules for a public gene */
2265
+ getGeneCapsules(geneId: string, limit?: number): Promise<IMResult<IMCapsule[]>>;
2266
+ /** Get gene lineage (parent + children) */
2267
+ getGeneLineage(geneId: string): Promise<IMResult<{
2268
+ geneId: string;
2269
+ parent?: IMGene;
2270
+ children: IMGene[];
2271
+ generation: number;
2272
+ }>>;
2273
+ /** Get public evolution feed */
2274
+ getFeed(limit?: number): Promise<IMResult<any[]>>;
2275
+ /** Analyze signals and get gene recommendation */
2276
+ analyze(options: IMAnalyzeOptions & {
2277
+ scope?: string;
2278
+ }): Promise<IMResult<IMAnalyzeResult>>;
2279
+ /** Record an outcome (success/failure) for a gene */
2280
+ record(options: IMRecordOutcomeOptions & {
2281
+ scope?: string;
2282
+ }): Promise<IMResult<any>>;
2283
+ /**
2284
+ * One-step evolution: analyze context → get gene recommendation → auto-record outcome.
2285
+ * Combines analyze() + record() into a single call for the common case.
2286
+ *
2287
+ * Usage:
2288
+ * const result = await client.evolution.evolve({
2289
+ * error: 'Connection timeout after 10s',
2290
+ * outcome: 'success',
2291
+ * score: 0.85,
2292
+ * summary: 'Fixed with exponential backoff',
2293
+ * });
2294
+ */
2295
+ evolve(options: {
2296
+ error?: string;
2297
+ task_status?: string;
2298
+ task_capability?: string;
2299
+ tags?: string[];
2300
+ signals?: Array<string | {
2301
+ type: string;
2302
+ provider?: string;
2303
+ stage?: string;
2304
+ severity?: string;
2305
+ }>;
2306
+ provider?: string;
2307
+ stage?: string;
2308
+ severity?: string;
2309
+ outcome: 'success' | 'failed';
2310
+ score?: number;
2311
+ summary?: string;
2312
+ strategy_used?: string[];
2313
+ scope?: string;
2314
+ }): Promise<IMResult<{
2315
+ analysis: IMAnalyzeResult;
2316
+ recorded: boolean;
2317
+ edge_updated?: boolean;
2318
+ }>>;
2319
+ /** Trigger gene distillation */
2320
+ distill(dryRun?: boolean): Promise<IMResult<any>>;
2321
+ /** List own genes */
2322
+ listGenes(signals?: string, scope?: string): Promise<IMResult<IMGene[]>>;
2323
+ /** Create a new gene */
2324
+ createGene(options: IMCreateGeneOptions & {
2325
+ scope?: string;
2326
+ }): Promise<IMResult<IMGene>>;
2327
+ /** Delete a gene */
2328
+ deleteGene(geneId: string): Promise<IMResult<void>>;
2329
+ /** Publish a gene. Pass skipCanary=true to bypass canary validation (MVP/admin). */
2330
+ publishGene(geneId: string, options?: {
2331
+ skipCanary?: boolean;
2332
+ }): Promise<IMResult<IMGene>>;
2333
+ /** Import a published gene */
2334
+ importGene(geneId: string): Promise<IMResult<IMGene>>;
2335
+ /** Fork a gene with modifications */
2336
+ forkGene(options: IMForkGeneOptions): Promise<IMResult<IMGene>>;
2337
+ /** Get signal-gene edges */
2338
+ getEdges(options?: {
2339
+ signalKey?: string;
2340
+ geneId?: string;
2341
+ limit?: number;
2342
+ scope?: string;
2343
+ }): Promise<IMResult<IMEvolutionEdge[]>>;
2344
+ /** Get agent personality profile */
2345
+ getPersonality(agentId: string): Promise<IMResult<{
2346
+ personality: IMAgentPersonality;
2347
+ stats: any;
2348
+ }>>;
2349
+ /** Get own capsule history */
2350
+ getCapsules(options?: {
2351
+ page?: number;
2352
+ limit?: number;
2353
+ scope?: string;
2354
+ }): Promise<IMResult<IMCapsule[]>>;
2355
+ /** Get evolution report */
2356
+ getReport(agentId?: string, scope?: string): Promise<IMResult<any>>;
2357
+ /** List available evolution scopes */
2358
+ listScopes(): Promise<IMResult<string[]>>;
2359
+ /** Get recent evolution stories (for L1 narrative embedding) */
2360
+ getStories(options?: {
2361
+ limit?: number;
2362
+ since?: number;
2363
+ }): Promise<IMResult<any[]>>;
2364
+ /** Get north-star metrics comparison (standard vs hypergraph) */
2365
+ getMetrics(): Promise<IMResult<{
2366
+ standard: any;
2367
+ hypergraph: any;
2368
+ verdict: string;
2369
+ }>>;
2370
+ /** Trigger metrics collection snapshot */
2371
+ collectMetrics(windowHours?: number): Promise<IMResult<{
2372
+ standard: any;
2373
+ hypergraph: any;
2374
+ }>>;
2375
+ /** Search skills catalog */
2376
+ searchSkills(options?: {
2377
+ query?: string;
2378
+ category?: string;
2379
+ limit?: number;
2380
+ }): Promise<IMResult<any[]>>;
2381
+ /** Get skill catalog stats */
2382
+ getSkillStats(): Promise<IMResult<any>>;
2383
+ /** Install a skill — creates Gene + returns content + install guide */
2384
+ installSkill(slugOrId: string): Promise<IMResult<IMSkillInstallResult>>;
2385
+ /** Uninstall a skill */
2386
+ uninstallSkill(slugOrId: string): Promise<IMResult<{
2387
+ uninstalled: boolean;
2388
+ }>>;
2389
+ /** List installed skills for this agent */
2390
+ installedSkills(): Promise<IMResult<IMAgentSkillRecord[]>>;
2391
+ /** Get full skill content (SKILL.md + package info) */
2392
+ getSkillContent(slugOrId: string): Promise<IMResult<IMSkillContent>>;
2393
+ /** Create/submit a community skill */
2394
+ createSkill(input: {
2395
+ name: string;
2396
+ description: string;
2397
+ category: string;
2398
+ tags?: string[];
2399
+ content?: string;
2400
+ signals?: Array<{
2401
+ type: string;
2402
+ }>;
2403
+ author?: string;
2404
+ }): Promise<IMResult<any>>;
2405
+ /** Star a skill (increment community rating) */
2406
+ starSkill(skillId: string): Promise<IMResult<{
2407
+ stars: number;
2408
+ }>>;
2409
+ /**
2410
+ * Install a skill and write SKILL.md to local filesystem.
2411
+ * Combines cloud install + local file sync for Claude Code / OpenClaw / OpenCode.
2412
+ * @param slugOrId - Skill slug or ID
2413
+ * @param options - Local install options
2414
+ */
2415
+ installSkillLocal(slugOrId: string, options?: {
2416
+ /** Target platforms (default: all detected) */
2417
+ platforms?: Array<'claude-code' | 'openclaw' | 'opencode' | 'plugin'>;
2418
+ /** Write to project-level paths instead of global */
2419
+ project?: boolean;
2420
+ /** Project root directory (for project-level installs) */
2421
+ projectRoot?: string;
2422
+ }): Promise<IMResult<IMSkillInstallResult & {
2423
+ localPaths: string[];
2424
+ }>>;
2425
+ /**
2426
+ * Uninstall a skill and remove local SKILL.md files.
2427
+ */
2428
+ uninstallSkillLocal(slugOrId: string): Promise<IMResult<{
2429
+ uninstalled: boolean;
2430
+ removedPaths: string[];
2431
+ }>>;
2432
+ /**
2433
+ * Sync all installed skills to local filesystem.
2434
+ */
2435
+ syncSkillsLocal(options?: {
2436
+ platforms?: Array<'claude-code' | 'openclaw' | 'opencode' | 'plugin'>;
2437
+ }): Promise<{
2438
+ synced: number;
2439
+ failed: number;
2440
+ paths: string[];
2441
+ }>;
2442
+ /** Export a Gene as a Skill */
2443
+ exportAsSkill(geneId: string, options?: {
2444
+ slug?: string;
2445
+ displayName?: string;
2446
+ changelog?: string;
2447
+ }): Promise<IMResult<any>>;
2448
+ /** Submit a raw-context evolution report (auto-creates signals + gene match) */
2449
+ submitReport(options: {
2450
+ rawContext: string;
2451
+ outcome: 'success' | 'failed';
2452
+ taskContext?: string;
2453
+ taskError?: string;
2454
+ taskId?: string;
2455
+ metadata?: Record<string, unknown>;
2456
+ }): Promise<IMResult<any>>;
2457
+ /** Get status of a submitted report by traceId */
2458
+ getReportStatus(traceId: string): Promise<IMResult<any>>;
2459
+ /** Get evolution achievements for the current agent */
2460
+ getAchievements(): Promise<IMResult<any[]>>;
2461
+ /** Get a sync snapshot (global gene/edge state since a sequence number) */
2462
+ getSyncSnapshot(since?: number): Promise<IMResult<any>>;
2463
+ /** Bidirectional sync: push local outcomes and pull remote updates */
2464
+ sync(options?: {
2465
+ pushOutcomes?: any[];
2466
+ pullSince?: number;
2467
+ }): Promise<IMResult<any>>;
2468
+ }
2469
+ /** Sanitize a slug/id to prevent path traversal (removes slashes, .., and null bytes) */
2470
+ declare function safeSlug(input: string): string;
2471
+ /** Map file extension to MIME type (no external deps) */
2472
+ declare function guessMimeType(fileName: string): string;
1382
2473
  /** File upload management (presign → upload → confirm) */
1383
2474
  declare class FilesClient {
1384
2475
  private _r;
@@ -1451,6 +2542,11 @@ declare class IMClient {
1451
2542
  readonly bindings: BindingsClient;
1452
2543
  readonly credits: CreditsClient;
1453
2544
  readonly workspace: WorkspaceClient;
2545
+ readonly tasks: TasksClient;
2546
+ readonly memory: MemoryClient;
2547
+ readonly identity: IdentityClient;
2548
+ readonly security: SecurityClient;
2549
+ readonly evolution: EvolutionClient;
1454
2550
  readonly files: FilesClient;
1455
2551
  readonly realtime: IMRealtimeClient;
1456
2552
  /** Offline manager (null if offline mode not enabled) */
@@ -1504,4 +2600,4 @@ declare class PrismerClient {
1504
2600
 
1505
2601
  declare function createClient(config: PrismerConfig): PrismerClient;
1506
2602
 
1507
- export { AccountClient, AttachmentQueue, type AuthenticatedPayload, type BatchSummary, type BatchUrlCost, BindingsClient, ContactsClient, ConversationsClient, CreditsClient, DirectClient, type DisconnectedPayload, E2EEncryption, ENVIRONMENTS, type Environment, type ErrorPayload, type FileInput, FilesClient, GroupsClient, type IMAgentCard, type IMAutocompleteResult, type IMBinding, type IMBindingData, IMClient, type IMConfirmResult, type IMContact, type IMConversation, type IMConversationsOptions, type IMCreateBindingOptions, type IMCreateGroupOptions, type IMCreditsData, type IMDiscoverAgent, type IMDiscoverOptions, type IMFileQuota, type IMGroupData, type IMGroupMember, type IMMeData, type IMMessage, type IMMessageData, type IMMultipartInitResult, type IMPaginationOptions, type IMPresignOptions, type IMPresignResult, IMRealtimeClient, type IMRegisterData, type IMRegisterOptions, type IMResult, type IMRouting, type IMSendOptions, type IMTokenData, type IMTransaction, type IMUser, type IMWorkspaceData, type IMWorkspaceInitGroupOptions, type IMWorkspaceInitOptions, IndexedDBStorage, type LoadOptions, type LoadResult, type LoadResultItem, MemoryStorage, type MessageNewPayload, MessagesClient, type OfflineConfig, type OfflineEventMap, type OfflineEventType, OfflineManager, type OutboxOperation, type ParseCost, type ParseCostBreakdown, type ParseDocument, type ParseDocumentImage, type ParseOptions, type ParseResult, type ParseUsage, type PongPayload, type PresenceChangedPayload, PrismerClient, type PrismerConfig, type QueryCost, type QuerySummary, type QueuedAttachment, type RankingFactors, type RealtimeCommand, type RealtimeConfig, type RealtimeEventMap, type RealtimeEventType, RealtimeSSEClient, type RealtimeState, RealtimeWSClient, type ReconnectingPayload, type RequestFn, SQLiteStorage, type SaveBatchOptions, type SaveOptions, type SaveResult, type SendFileOptions, type SendFileResult, type SingleUrlCost, type StorageAdapter, type StoredContact, type StoredConversation, type StoredMessage, type SyncEvent, type SyncResult, TabCoordinator, type TypingIndicatorPayload, type UploadOptions, type UploadResult, WorkspaceClient, createClient, PrismerClient as default };
2603
+ export { AccountClient, AttachmentQueue, type AuthenticatedPayload, type BatchSummary, type BatchUrlCost, BindingsClient, ContactsClient, ConversationsClient, CreditsClient, type DecryptResult, type DerivationMode, DirectClient, type DisconnectedPayload, E2EEncryption, ENVIRONMENTS, type EncryptedContextResult, type EncryptedFileResult, type EncryptedMessage, type Environment, type ErrorPayload, EvolutionCache, EvolutionClient, EvolutionRuntime, type EvolutionRuntimeConfig, type EvolutionSession, type EvolutionSyncDelta, type EvolutionSyncSnapshot, type ExecutionContext, type FileInput, FilesClient, type GeneCategory, type GeneSelectionResult, type GeneVisibility, GroupsClient, type IMAgentCard, type IMAgentPersonality, type IMAgentSkillRecord, type IMAnalyzeOptions, type IMAnalyzeResult, type IMAutocompleteResult, type IMBinding, type IMBindingData, type IMCapsule, IMClient, type IMCompactOptions, type IMCompactionSummary, type IMCompleteTaskOptions, type IMConfirmResult, type IMContact, type IMConversation, type IMConversationsOptions, type IMCreateBindingOptions, type IMCreateGeneOptions, type IMCreateGroupOptions, type IMCreateMemoryFileOptions, type IMCreateTaskOptions, type IMCreditsData, type IMDiscoverAgent, type IMDiscoverOptions, type IMEvolutionEdge, type IMEvolutionStats, type IMFileQuota, type IMForkGeneOptions, type IMGene, type IMGeneListOptions, type IMGroupData, type IMGroupMember, type IMIdentityKey, type IMKeyAuditEntry, type IMKeyVerifyResult, type IMMeData, type IMMemoryFile, type IMMemoryFileDetail, type IMMemoryLoadResult, type IMMessage, type IMMessageData, type IMMultipartInitResult, type IMPaginationOptions, type IMPresignOptions, type IMPresignResult, IMRealtimeClient, type IMRecordOutcomeOptions, type IMRegisterData, type IMRegisterKeyOptions, type IMRegisterOptions, type IMResult, type IMRouting, type IMSendOptions, type IMSkillContent, type IMSkillInfo, type IMSkillInstallResult, type IMTask, type IMTaskDetail, type IMTaskListOptions, type IMTaskLog, type IMTokenData, type IMTransaction, type IMUpdateMemoryFileOptions, type IMUpdateTaskOptions, type IMUser, type IMWorkspaceData, type IMWorkspaceInitGroupOptions, type IMWorkspaceInitOptions, IdentityClient, IndexedDBStorage, type LoadOptions, type LoadResult, type LoadResultItem, MemoryClient, MemoryStorage, type MessageDeletedPayload, type MessageEditPayload, type MessageNewPayload, MessagesClient, type OfflineConfig, type OfflineEventMap, type OfflineEventType, OfflineManager, type OutboxOperation, type ParseCost, type ParseCostBreakdown, type ParseDocument, type ParseDocumentImage, type ParseOptions, type ParseResult, type ParseUsage, type PongPayload, type PresenceChangedPayload, PrismerClient, type PrismerConfig, type QueryCost, type QuerySummary, type QueuedAttachment, type RankingFactors, type RealtimeCommand, type RealtimeConfig, type RealtimeEventMap, type RealtimeEventType, RealtimeSSEClient, type RealtimeState, RealtimeWSClient, type ReconnectingPayload, type RequestFn, SQLiteStorage, type SaveBatchOptions, type SaveOptions, type SaveResult, type ScheduleType, SecurityClient, type SendFileOptions, type SendFileResult, type SessionMetrics, type SignalEnrichmentConfig, type SignalTag, type SingleUrlCost, type StorageAdapter, type StoredContact, type StoredConversation, type StoredMessage, type Suggestion, type SyncEvent, type SyncResult, TabCoordinator, type TaskStatus, TasksClient, type TypingIndicatorPayload, type UploadOptions, type UploadResult, WorkspaceClient, createClient, createEnrichedExtractor, decryptContext, decryptFile, decryptMessages, decryptOnReceive, PrismerClient as default, encryptContext, encryptFile, encryptForSend, extractSignals, guessMimeType, safeSlug };