oh-my-opencode-kikokikok 2.14.2 → 2.15.1
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/cli/index.js +26 -4
- package/dist/config/schema.d.ts +75 -0
- package/dist/features/knowledge-provider/index.d.ts +1 -0
- package/dist/features/knowledge-provider/mcp-manager.d.ts +67 -0
- package/dist/features/knowledge-provider/mcp-manager.test.d.ts +1 -0
- package/dist/features/knowledge-provider/types.d.ts +22 -2
- package/dist/features/letta-memory/adapter.d.ts +24 -0
- package/dist/features/letta-memory/adapter.test.d.ts +1 -0
- package/dist/features/letta-memory/index.d.ts +2 -0
- package/dist/features/letta-memory/types.d.ts +140 -0
- package/dist/hooks/memory-rehydration/index.d.ts +2 -2
- package/dist/index.js +3630 -631
- package/dist/plugin-config.test.d.ts +1 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/knowledge/index.d.ts +1 -0
- package/dist/tools/knowledge/provider-tools.d.ts +3 -0
- package/dist/tools/knowledge/provider-tools.test.d.ts +1 -0
- package/dist/tools/memory/index.d.ts +1 -1
- package/dist/tools/memory/tools.d.ts +2 -2
- package/dist/tools/memory/types.d.ts +41 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2253,7 +2253,7 @@ var require_picocolors = __commonJS((exports, module) => {
|
|
|
2253
2253
|
var require_package = __commonJS((exports, module) => {
|
|
2254
2254
|
module.exports = {
|
|
2255
2255
|
name: "oh-my-opencode-kikokikok",
|
|
2256
|
-
version: "2.
|
|
2256
|
+
version: "2.15.1",
|
|
2257
2257
|
description: "OpenCode plugin - custom agents (oracle, librarian) and enhanced features",
|
|
2258
2258
|
main: "dist/index.js",
|
|
2259
2259
|
types: "dist/index.d.ts",
|
|
@@ -22646,6 +22646,21 @@ var Mem0ConfigSchema = exports_external.object({
|
|
|
22646
22646
|
autoRehydrate: exports_external.boolean().default(true),
|
|
22647
22647
|
rehydrateLayers: exports_external.array(MemoryLayerSchema).default(["user", "project", "team"])
|
|
22648
22648
|
});
|
|
22649
|
+
var LettaConfigSchema = exports_external.object({
|
|
22650
|
+
enabled: exports_external.boolean().default(false),
|
|
22651
|
+
endpoint: exports_external.string().url().optional().describe("Letta server endpoint (default: http://localhost:8283)"),
|
|
22652
|
+
apiKey: exports_external.string().optional().describe("Optional API key for cloud Letta (not needed for self-hosted)"),
|
|
22653
|
+
userId: exports_external.string().optional(),
|
|
22654
|
+
projectId: exports_external.string().optional(),
|
|
22655
|
+
teamId: exports_external.string().optional(),
|
|
22656
|
+
orgId: exports_external.string().optional(),
|
|
22657
|
+
companyId: exports_external.string().optional(),
|
|
22658
|
+
agentPrefix: exports_external.string().optional().describe("Agent name prefix (default: opencode)"),
|
|
22659
|
+
llmModel: exports_external.string().optional().describe("LLM model for agent (e.g., openai/gpt-4.1)"),
|
|
22660
|
+
embeddingModel: exports_external.string().optional().describe("Embedding model for semantic search"),
|
|
22661
|
+
autoRehydrate: exports_external.boolean().default(true),
|
|
22662
|
+
rehydrateLayers: exports_external.array(MemoryLayerSchema).default(["user", "project", "team"])
|
|
22663
|
+
});
|
|
22649
22664
|
var CentralHubConfigSchema = exports_external.object({
|
|
22650
22665
|
url: exports_external.string().url(),
|
|
22651
22666
|
branch: exports_external.string().default("main"),
|
|
@@ -22685,11 +22700,17 @@ var OpenSpecConfigSchema = exports_external.object({
|
|
|
22685
22700
|
]),
|
|
22686
22701
|
rootDir: exports_external.string().default(".opencode/openspec")
|
|
22687
22702
|
});
|
|
22703
|
+
var MCPTransportTypeSchema = exports_external.enum(["stdio", "sse"]);
|
|
22688
22704
|
var MCPKnowledgeProviderConfigSchema = exports_external.object({
|
|
22689
22705
|
name: exports_external.string(),
|
|
22690
|
-
|
|
22691
|
-
|
|
22692
|
-
|
|
22706
|
+
transport: MCPTransportTypeSchema.optional().describe("Transport type: 'stdio' (default) or 'sse'"),
|
|
22707
|
+
command: exports_external.string().optional().describe("Command to start the MCP server (required for stdio transport)"),
|
|
22708
|
+
args: exports_external.array(exports_external.string()).optional().describe("Arguments for the command (stdio transport)"),
|
|
22709
|
+
env: exports_external.record(exports_external.string(), exports_external.string()).optional().describe("Environment variables (stdio transport)"),
|
|
22710
|
+
url: exports_external.string().optional().describe("SSE endpoint URL (required for sse transport, e.g., 'http://localhost:60062/sse')"),
|
|
22711
|
+
searchTool: exports_external.string().describe("MCP tool name for search operations"),
|
|
22712
|
+
getTool: exports_external.string().optional().describe("MCP tool name for get-by-id operations"),
|
|
22713
|
+
config: exports_external.record(exports_external.string(), exports_external.unknown()).optional().describe("Additional config passed to MCP tools")
|
|
22693
22714
|
});
|
|
22694
22715
|
var NotebookLMProviderConfigSchema = exports_external.object({
|
|
22695
22716
|
enabled: exports_external.boolean().default(false),
|
|
@@ -22743,6 +22764,7 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
|
22743
22764
|
skills: SkillsConfigSchema.optional(),
|
|
22744
22765
|
ralph_loop: RalphLoopConfigSchema.optional(),
|
|
22745
22766
|
mem0: Mem0ConfigSchema.optional(),
|
|
22767
|
+
letta: LettaConfigSchema.optional(),
|
|
22746
22768
|
knowledge_repo: KnowledgeRepoConfigSchema.optional(),
|
|
22747
22769
|
knowledge_provider: KnowledgeProviderConfigSchema.optional(),
|
|
22748
22770
|
openspec: OpenSpecConfigSchema.optional()
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -1455,6 +1455,29 @@ export declare const Mem0ConfigSchema: z.ZodObject<{
|
|
|
1455
1455
|
company: "company";
|
|
1456
1456
|
}>>>;
|
|
1457
1457
|
}, z.core.$strip>;
|
|
1458
|
+
export declare const LettaConfigSchema: z.ZodObject<{
|
|
1459
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1460
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
1461
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
1462
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
1463
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
1464
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
1465
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
1466
|
+
companyId: z.ZodOptional<z.ZodString>;
|
|
1467
|
+
agentPrefix: z.ZodOptional<z.ZodString>;
|
|
1468
|
+
llmModel: z.ZodOptional<z.ZodString>;
|
|
1469
|
+
embeddingModel: z.ZodOptional<z.ZodString>;
|
|
1470
|
+
autoRehydrate: z.ZodDefault<z.ZodBoolean>;
|
|
1471
|
+
rehydrateLayers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
1472
|
+
user: "user";
|
|
1473
|
+
agent: "agent";
|
|
1474
|
+
session: "session";
|
|
1475
|
+
project: "project";
|
|
1476
|
+
team: "team";
|
|
1477
|
+
org: "org";
|
|
1478
|
+
company: "company";
|
|
1479
|
+
}>>>;
|
|
1480
|
+
}, z.core.$strip>;
|
|
1458
1481
|
export declare const CentralHubConfigSchema: z.ZodObject<{
|
|
1459
1482
|
url: z.ZodString;
|
|
1460
1483
|
branch: z.ZodDefault<z.ZodString>;
|
|
@@ -1512,8 +1535,20 @@ export declare const OpenSpecConfigSchema: z.ZodObject<{
|
|
|
1512
1535
|
}>>>;
|
|
1513
1536
|
rootDir: z.ZodDefault<z.ZodString>;
|
|
1514
1537
|
}, z.core.$strip>;
|
|
1538
|
+
export declare const MCPTransportTypeSchema: z.ZodEnum<{
|
|
1539
|
+
stdio: "stdio";
|
|
1540
|
+
sse: "sse";
|
|
1541
|
+
}>;
|
|
1515
1542
|
export declare const MCPKnowledgeProviderConfigSchema: z.ZodObject<{
|
|
1516
1543
|
name: z.ZodString;
|
|
1544
|
+
transport: z.ZodOptional<z.ZodEnum<{
|
|
1545
|
+
stdio: "stdio";
|
|
1546
|
+
sse: "sse";
|
|
1547
|
+
}>>;
|
|
1548
|
+
command: z.ZodOptional<z.ZodString>;
|
|
1549
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1550
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1551
|
+
url: z.ZodOptional<z.ZodString>;
|
|
1517
1552
|
searchTool: z.ZodString;
|
|
1518
1553
|
getTool: z.ZodOptional<z.ZodString>;
|
|
1519
1554
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1551,6 +1586,14 @@ export declare const KnowledgeProviderConfigSchema: z.ZodObject<{
|
|
|
1551
1586
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1552
1587
|
servers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1553
1588
|
name: z.ZodString;
|
|
1589
|
+
transport: z.ZodOptional<z.ZodEnum<{
|
|
1590
|
+
stdio: "stdio";
|
|
1591
|
+
sse: "sse";
|
|
1592
|
+
}>>;
|
|
1593
|
+
command: z.ZodOptional<z.ZodString>;
|
|
1594
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1595
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1596
|
+
url: z.ZodOptional<z.ZodString>;
|
|
1554
1597
|
searchTool: z.ZodString;
|
|
1555
1598
|
getTool: z.ZodOptional<z.ZodString>;
|
|
1556
1599
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -2878,6 +2921,29 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
2878
2921
|
company: "company";
|
|
2879
2922
|
}>>>;
|
|
2880
2923
|
}, z.core.$strip>>;
|
|
2924
|
+
letta: z.ZodOptional<z.ZodObject<{
|
|
2925
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2926
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
2927
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
2928
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
2929
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
2930
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
2931
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
2932
|
+
companyId: z.ZodOptional<z.ZodString>;
|
|
2933
|
+
agentPrefix: z.ZodOptional<z.ZodString>;
|
|
2934
|
+
llmModel: z.ZodOptional<z.ZodString>;
|
|
2935
|
+
embeddingModel: z.ZodOptional<z.ZodString>;
|
|
2936
|
+
autoRehydrate: z.ZodDefault<z.ZodBoolean>;
|
|
2937
|
+
rehydrateLayers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
2938
|
+
user: "user";
|
|
2939
|
+
agent: "agent";
|
|
2940
|
+
session: "session";
|
|
2941
|
+
project: "project";
|
|
2942
|
+
team: "team";
|
|
2943
|
+
org: "org";
|
|
2944
|
+
company: "company";
|
|
2945
|
+
}>>>;
|
|
2946
|
+
}, z.core.$strip>>;
|
|
2881
2947
|
knowledge_repo: z.ZodOptional<z.ZodObject<{
|
|
2882
2948
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2883
2949
|
rootDir: z.ZodDefault<z.ZodString>;
|
|
@@ -2921,6 +2987,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
2921
2987
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2922
2988
|
servers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2923
2989
|
name: z.ZodString;
|
|
2990
|
+
transport: z.ZodOptional<z.ZodEnum<{
|
|
2991
|
+
stdio: "stdio";
|
|
2992
|
+
sse: "sse";
|
|
2993
|
+
}>>;
|
|
2994
|
+
command: z.ZodOptional<z.ZodString>;
|
|
2995
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2996
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2997
|
+
url: z.ZodOptional<z.ZodString>;
|
|
2924
2998
|
searchTool: z.ZodString;
|
|
2925
2999
|
getTool: z.ZodOptional<z.ZodString>;
|
|
2926
3000
|
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -2977,6 +3051,7 @@ export type SkillsConfig = z.infer<typeof SkillsConfigSchema>;
|
|
|
2977
3051
|
export type SkillDefinition = z.infer<typeof SkillDefinitionSchema>;
|
|
2978
3052
|
export type RalphLoopConfig = z.infer<typeof RalphLoopConfigSchema>;
|
|
2979
3053
|
export type Mem0Config = z.infer<typeof Mem0ConfigSchema>;
|
|
3054
|
+
export type LettaConfig = z.infer<typeof LettaConfigSchema>;
|
|
2980
3055
|
export type CentralHubConfig = z.infer<typeof CentralHubConfigSchema>;
|
|
2981
3056
|
export type KnowledgeRepoConfig = z.infer<typeof KnowledgeRepoConfigSchema>;
|
|
2982
3057
|
export type OpenSpecConfig = z.infer<typeof OpenSpecConfigSchema>;
|
|
@@ -6,3 +6,4 @@ export { MCPKnowledgeProvider } from "./providers/mcp";
|
|
|
6
6
|
export type { MCPInvoker } from "./providers/mcp";
|
|
7
7
|
export { NotebookLMKnowledgeProvider } from "./providers/notebooklm";
|
|
8
8
|
export type { NotebookLMProviderConfig } from "./providers/notebooklm";
|
|
9
|
+
export { KnowledgeMcpManager } from "./mcp-manager";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { MCPInvoker } from "./providers/mcp";
|
|
2
|
+
import type { MCPProviderConfig } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Manages MCP server connections for knowledge providers.
|
|
5
|
+
* Implements MCPInvoker interface to allow MCPKnowledgeProvider to invoke tools.
|
|
6
|
+
*
|
|
7
|
+
* Based on SkillMcpManager pattern but simplified for knowledge provider use case.
|
|
8
|
+
*/
|
|
9
|
+
export declare class KnowledgeMcpManager implements MCPInvoker {
|
|
10
|
+
private clients;
|
|
11
|
+
private pendingConnections;
|
|
12
|
+
private serverConfigs;
|
|
13
|
+
private cleanupRegistered;
|
|
14
|
+
private cleanupInterval;
|
|
15
|
+
private readonly IDLE_TIMEOUT;
|
|
16
|
+
/**
|
|
17
|
+
* Register an MCP server configuration.
|
|
18
|
+
* The server will be started lazily on first invoke.
|
|
19
|
+
*/
|
|
20
|
+
registerServer(config: MCPProviderConfig): void;
|
|
21
|
+
/**
|
|
22
|
+
* Unregister an MCP server and disconnect if connected.
|
|
23
|
+
*/
|
|
24
|
+
unregisterServer(serverName: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Check if an MCP server is available (registered and can connect).
|
|
27
|
+
*/
|
|
28
|
+
isServerAvailable(serverName: string): Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* Invoke a tool on an MCP server.
|
|
31
|
+
*/
|
|
32
|
+
invoke(serverName: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* Get or create a client for the given server.
|
|
35
|
+
*/
|
|
36
|
+
private getOrCreateClient;
|
|
37
|
+
/**
|
|
38
|
+
* Create a new MCP client connection.
|
|
39
|
+
*/
|
|
40
|
+
private createClient;
|
|
41
|
+
private createStdioTransport;
|
|
42
|
+
private createSseTransport;
|
|
43
|
+
/**
|
|
44
|
+
* Disconnect a specific server.
|
|
45
|
+
*/
|
|
46
|
+
private disconnectServer;
|
|
47
|
+
/**
|
|
48
|
+
* Disconnect all servers and clean up.
|
|
49
|
+
*/
|
|
50
|
+
disconnectAll(): Promise<void>;
|
|
51
|
+
private registerProcessCleanup;
|
|
52
|
+
private startCleanupTimer;
|
|
53
|
+
private stopCleanupTimer;
|
|
54
|
+
private cleanupIdleClients;
|
|
55
|
+
/**
|
|
56
|
+
* Get list of registered server names.
|
|
57
|
+
*/
|
|
58
|
+
getRegisteredServers(): string[];
|
|
59
|
+
/**
|
|
60
|
+
* Get list of connected server names.
|
|
61
|
+
*/
|
|
62
|
+
getConnectedServers(): string[];
|
|
63
|
+
/**
|
|
64
|
+
* Check if a server is currently connected.
|
|
65
|
+
*/
|
|
66
|
+
isConnected(serverName: string): boolean;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -232,17 +232,37 @@ export interface Mem0ProviderConfig {
|
|
|
232
232
|
/** Layers to search */
|
|
233
233
|
searchLayers?: MemoryLayer[];
|
|
234
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Transport type for MCP connections.
|
|
237
|
+
* - stdio: Spawns a local process and communicates via stdin/stdout (default)
|
|
238
|
+
* - sse: Connects to an HTTP/SSE endpoint (for servers like Dust CLI that run as HTTP servers)
|
|
239
|
+
*/
|
|
240
|
+
export type MCPTransportType = "stdio" | "sse";
|
|
235
241
|
/**
|
|
236
242
|
* Configuration for an MCP knowledge provider.
|
|
237
243
|
*/
|
|
238
244
|
export interface MCPProviderConfig {
|
|
239
|
-
/** MCP server name (
|
|
245
|
+
/** MCP server name (unique identifier) */
|
|
240
246
|
name: string;
|
|
247
|
+
/**
|
|
248
|
+
* Transport type for connecting to the MCP server.
|
|
249
|
+
* - "stdio" (default): Spawn a local process
|
|
250
|
+
* - "sse": Connect to an HTTP/SSE endpoint
|
|
251
|
+
*/
|
|
252
|
+
transport?: MCPTransportType;
|
|
253
|
+
/** Command to start the MCP server (e.g., 'npx'). Required for stdio transport. */
|
|
254
|
+
command?: string;
|
|
255
|
+
/** Arguments for the command */
|
|
256
|
+
args?: string[];
|
|
257
|
+
/** Environment variables for the MCP process */
|
|
258
|
+
env?: Record<string, string>;
|
|
259
|
+
/** URL for SSE transport (e.g., 'http://localhost:60062/sse'). Required for sse transport. */
|
|
260
|
+
url?: string;
|
|
241
261
|
/** Tool name for search operations */
|
|
242
262
|
searchTool: string;
|
|
243
263
|
/** Tool name for get-by-id operations */
|
|
244
264
|
getTool?: string;
|
|
245
|
-
/** Additional config
|
|
265
|
+
/** Additional config passed to MCP tools */
|
|
246
266
|
config?: Record<string, unknown>;
|
|
247
267
|
}
|
|
248
268
|
/**
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { LettaConfig, Memory, MemorySearchResult, AddMemoryInput, SearchMemoryInput, UpdateMemoryInput, MemoryStats, MemoryLayer } from "./types";
|
|
2
|
+
export declare class LettaAdapter {
|
|
3
|
+
private config;
|
|
4
|
+
private endpoint;
|
|
5
|
+
private agentCache;
|
|
6
|
+
constructor(config: LettaConfig);
|
|
7
|
+
add(input: AddMemoryInput): Promise<Memory>;
|
|
8
|
+
search(input: SearchMemoryInput): Promise<MemorySearchResult[]>;
|
|
9
|
+
get(id: string): Promise<Memory | null>;
|
|
10
|
+
update(input: UpdateMemoryInput): Promise<Memory>;
|
|
11
|
+
delete(id: string): Promise<void>;
|
|
12
|
+
getAll(layer?: MemoryLayer): Promise<Memory[]>;
|
|
13
|
+
getStats(): Promise<MemoryStats>;
|
|
14
|
+
isAvailable(): Promise<boolean>;
|
|
15
|
+
private getOrCreateAgent;
|
|
16
|
+
private getAgent;
|
|
17
|
+
private listAgents;
|
|
18
|
+
private request;
|
|
19
|
+
private getAgentName;
|
|
20
|
+
private getUserId;
|
|
21
|
+
private normalizeLayers;
|
|
22
|
+
private getAllLayers;
|
|
23
|
+
private passageToMemory;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Letta (formerly MemGPT) Memory Types
|
|
3
|
+
*
|
|
4
|
+
* Letta organizes memory around Agents with:
|
|
5
|
+
* - Core Memory (Blocks): Always in-context, editable by agent
|
|
6
|
+
* - Archival Memory (Passages): Out-of-context, searchable via embeddings
|
|
7
|
+
*/
|
|
8
|
+
export type MemoryLayer = "user" | "session" | "project" | "team" | "org" | "company" | "agent";
|
|
9
|
+
export interface LettaConfig {
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
/** Letta server endpoint (default: http://localhost:8283) */
|
|
12
|
+
endpoint?: string;
|
|
13
|
+
/** Optional API key for cloud Letta (not needed for self-hosted) */
|
|
14
|
+
apiKey?: string;
|
|
15
|
+
/** User identifier for scoping agents */
|
|
16
|
+
userId?: string;
|
|
17
|
+
/** Project identifier */
|
|
18
|
+
projectId?: string;
|
|
19
|
+
/** Team identifier */
|
|
20
|
+
teamId?: string;
|
|
21
|
+
/** Organization identifier */
|
|
22
|
+
orgId?: string;
|
|
23
|
+
/** Company identifier */
|
|
24
|
+
companyId?: string;
|
|
25
|
+
/** Default agent name prefix */
|
|
26
|
+
agentPrefix?: string;
|
|
27
|
+
/** LLM model for agent (e.g., "openai/gpt-4.1") */
|
|
28
|
+
llmModel?: string;
|
|
29
|
+
/** Embedding model for semantic search */
|
|
30
|
+
embeddingModel?: string;
|
|
31
|
+
/** Auto-rehydrate memories on session start */
|
|
32
|
+
autoRehydrate?: boolean;
|
|
33
|
+
/** Layers to rehydrate */
|
|
34
|
+
rehydrateLayers?: MemoryLayer[];
|
|
35
|
+
}
|
|
36
|
+
/** Letta Agent representation */
|
|
37
|
+
export interface LettaAgent {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
created_at: string;
|
|
42
|
+
user_id?: string;
|
|
43
|
+
metadata?: Record<string, unknown>;
|
|
44
|
+
memory_blocks?: LettaBlock[];
|
|
45
|
+
tools?: string[];
|
|
46
|
+
}
|
|
47
|
+
/** Letta Memory Block (Core Memory - always in-context) */
|
|
48
|
+
export interface LettaBlock {
|
|
49
|
+
id: string;
|
|
50
|
+
label: string;
|
|
51
|
+
value: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
limit?: number;
|
|
54
|
+
metadata?: Record<string, unknown>;
|
|
55
|
+
created_at?: string;
|
|
56
|
+
updated_at?: string;
|
|
57
|
+
}
|
|
58
|
+
/** Letta Passage (Archival Memory - searchable) */
|
|
59
|
+
export interface LettaPassage {
|
|
60
|
+
id: string;
|
|
61
|
+
text: string;
|
|
62
|
+
agent_id?: string;
|
|
63
|
+
tags?: string[];
|
|
64
|
+
metadata?: Record<string, unknown>;
|
|
65
|
+
created_at: string;
|
|
66
|
+
embedding?: number[];
|
|
67
|
+
}
|
|
68
|
+
/** Letta Archive container for passages */
|
|
69
|
+
export interface LettaArchive {
|
|
70
|
+
id: string;
|
|
71
|
+
name: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
agent_id?: string;
|
|
74
|
+
created_at: string;
|
|
75
|
+
}
|
|
76
|
+
/** Unified memory representation (compatible with existing tools) */
|
|
77
|
+
export interface Memory {
|
|
78
|
+
id: string;
|
|
79
|
+
content: string;
|
|
80
|
+
layer: MemoryLayer;
|
|
81
|
+
metadata?: Record<string, unknown>;
|
|
82
|
+
createdAt: string;
|
|
83
|
+
updatedAt?: string;
|
|
84
|
+
/** Letta-specific: source type */
|
|
85
|
+
source?: "block" | "passage";
|
|
86
|
+
/** Letta-specific: agent ID */
|
|
87
|
+
agentId?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface MemorySearchResult {
|
|
90
|
+
memory: Memory;
|
|
91
|
+
score: number;
|
|
92
|
+
}
|
|
93
|
+
export interface AddMemoryInput {
|
|
94
|
+
content: string;
|
|
95
|
+
layer: MemoryLayer;
|
|
96
|
+
metadata?: Record<string, unknown>;
|
|
97
|
+
/** Store as block (core memory) or passage (archival). Default: passage */
|
|
98
|
+
type?: "block" | "passage";
|
|
99
|
+
/** Block label if storing as block */
|
|
100
|
+
blockLabel?: string;
|
|
101
|
+
/** Tags for passage search */
|
|
102
|
+
tags?: string[];
|
|
103
|
+
}
|
|
104
|
+
export interface SearchMemoryInput {
|
|
105
|
+
query: string;
|
|
106
|
+
layer?: MemoryLayer | MemoryLayer[];
|
|
107
|
+
limit?: number;
|
|
108
|
+
threshold?: number;
|
|
109
|
+
/** Filter by tags */
|
|
110
|
+
tags?: string[];
|
|
111
|
+
/** Tag match mode */
|
|
112
|
+
tagMatchMode?: "any" | "all";
|
|
113
|
+
}
|
|
114
|
+
export interface UpdateMemoryInput {
|
|
115
|
+
id: string;
|
|
116
|
+
content?: string;
|
|
117
|
+
metadata?: Record<string, unknown>;
|
|
118
|
+
tags?: string[];
|
|
119
|
+
}
|
|
120
|
+
export interface MemoryStats {
|
|
121
|
+
totalMemories: number;
|
|
122
|
+
byLayer: Record<MemoryLayer, number>;
|
|
123
|
+
/** Letta-specific stats */
|
|
124
|
+
totalAgents?: number;
|
|
125
|
+
totalBlocks?: number;
|
|
126
|
+
totalPassages?: number;
|
|
127
|
+
}
|
|
128
|
+
/** Letta API response types */
|
|
129
|
+
export interface LettaApiResponse<T> {
|
|
130
|
+
data?: T;
|
|
131
|
+
error?: string;
|
|
132
|
+
message?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface LettaSearchResponse {
|
|
135
|
+
passages: LettaPassage[];
|
|
136
|
+
total?: number;
|
|
137
|
+
}
|
|
138
|
+
export interface LettaAgentListResponse {
|
|
139
|
+
agents: LettaAgent[];
|
|
140
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MemoryAdapter } from "../../tools/memory/types";
|
|
2
2
|
import type { MemoryRehydrationConfig, RehydrationResult } from "./types";
|
|
3
3
|
import { HOOK_NAME } from "./constants";
|
|
4
4
|
export interface MemoryRehydrationHook {
|
|
@@ -12,6 +12,6 @@ export interface MemoryRehydrationHook {
|
|
|
12
12
|
forceRehydrate: (sessionID: string) => Promise<RehydrationResult>;
|
|
13
13
|
clearSession: (sessionID: string) => void;
|
|
14
14
|
}
|
|
15
|
-
export declare function createMemoryRehydrationHook(adapter:
|
|
15
|
+
export declare function createMemoryRehydrationHook(adapter: MemoryAdapter, config?: MemoryRehydrationConfig): MemoryRehydrationHook;
|
|
16
16
|
export { HOOK_NAME };
|
|
17
17
|
export type { MemoryRehydrationConfig } from "./types";
|