oh-my-opencode-kikokikok 2.14.2 → 2.15.0

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 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.14.2",
2256
+ version: "2.15.0",
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",
@@ -22685,11 +22685,17 @@ var OpenSpecConfigSchema = exports_external.object({
22685
22685
  ]),
22686
22686
  rootDir: exports_external.string().default(".opencode/openspec")
22687
22687
  });
22688
+ var MCPTransportTypeSchema = exports_external.enum(["stdio", "sse"]);
22688
22689
  var MCPKnowledgeProviderConfigSchema = exports_external.object({
22689
22690
  name: exports_external.string(),
22690
- searchTool: exports_external.string(),
22691
- getTool: exports_external.string().optional(),
22692
- config: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
22691
+ transport: MCPTransportTypeSchema.optional().describe("Transport type: 'stdio' (default) or 'sse'"),
22692
+ command: exports_external.string().optional().describe("Command to start the MCP server (required for stdio transport)"),
22693
+ args: exports_external.array(exports_external.string()).optional().describe("Arguments for the command (stdio transport)"),
22694
+ env: exports_external.record(exports_external.string(), exports_external.string()).optional().describe("Environment variables (stdio transport)"),
22695
+ url: exports_external.string().optional().describe("SSE endpoint URL (required for sse transport, e.g., 'http://localhost:60062/sse')"),
22696
+ searchTool: exports_external.string().describe("MCP tool name for search operations"),
22697
+ getTool: exports_external.string().optional().describe("MCP tool name for get-by-id operations"),
22698
+ config: exports_external.record(exports_external.string(), exports_external.unknown()).optional().describe("Additional config passed to MCP tools")
22693
22699
  });
22694
22700
  var NotebookLMProviderConfigSchema = exports_external.object({
22695
22701
  enabled: exports_external.boolean().default(false),
@@ -22743,6 +22749,7 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
22743
22749
  skills: SkillsConfigSchema.optional(),
22744
22750
  ralph_loop: RalphLoopConfigSchema.optional(),
22745
22751
  mem0: Mem0ConfigSchema.optional(),
22752
+ letta: Mem0ConfigSchema.optional(),
22746
22753
  knowledge_repo: KnowledgeRepoConfigSchema.optional(),
22747
22754
  knowledge_provider: KnowledgeProviderConfigSchema.optional(),
22748
22755
  openspec: OpenSpecConfigSchema.optional()
@@ -1512,8 +1512,20 @@ export declare const OpenSpecConfigSchema: z.ZodObject<{
1512
1512
  }>>>;
1513
1513
  rootDir: z.ZodDefault<z.ZodString>;
1514
1514
  }, z.core.$strip>;
1515
+ export declare const MCPTransportTypeSchema: z.ZodEnum<{
1516
+ stdio: "stdio";
1517
+ sse: "sse";
1518
+ }>;
1515
1519
  export declare const MCPKnowledgeProviderConfigSchema: z.ZodObject<{
1516
1520
  name: z.ZodString;
1521
+ transport: z.ZodOptional<z.ZodEnum<{
1522
+ stdio: "stdio";
1523
+ sse: "sse";
1524
+ }>>;
1525
+ command: z.ZodOptional<z.ZodString>;
1526
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
1527
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1528
+ url: z.ZodOptional<z.ZodString>;
1517
1529
  searchTool: z.ZodString;
1518
1530
  getTool: z.ZodOptional<z.ZodString>;
1519
1531
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1551,6 +1563,14 @@ export declare const KnowledgeProviderConfigSchema: z.ZodObject<{
1551
1563
  enabled: z.ZodDefault<z.ZodBoolean>;
1552
1564
  servers: z.ZodDefault<z.ZodArray<z.ZodObject<{
1553
1565
  name: z.ZodString;
1566
+ transport: z.ZodOptional<z.ZodEnum<{
1567
+ stdio: "stdio";
1568
+ sse: "sse";
1569
+ }>>;
1570
+ command: z.ZodOptional<z.ZodString>;
1571
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
1572
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1573
+ url: z.ZodOptional<z.ZodString>;
1554
1574
  searchTool: z.ZodString;
1555
1575
  getTool: z.ZodOptional<z.ZodString>;
1556
1576
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -2878,6 +2898,28 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
2878
2898
  company: "company";
2879
2899
  }>>>;
2880
2900
  }, z.core.$strip>>;
2901
+ letta: z.ZodOptional<z.ZodObject<{
2902
+ enabled: z.ZodDefault<z.ZodBoolean>;
2903
+ apiKey: z.ZodOptional<z.ZodString>;
2904
+ endpoint: z.ZodOptional<z.ZodString>;
2905
+ userId: z.ZodOptional<z.ZodString>;
2906
+ sessionId: z.ZodOptional<z.ZodString>;
2907
+ projectId: z.ZodOptional<z.ZodString>;
2908
+ teamId: z.ZodOptional<z.ZodString>;
2909
+ orgId: z.ZodOptional<z.ZodString>;
2910
+ companyId: z.ZodOptional<z.ZodString>;
2911
+ agentId: z.ZodOptional<z.ZodString>;
2912
+ autoRehydrate: z.ZodDefault<z.ZodBoolean>;
2913
+ rehydrateLayers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
2914
+ user: "user";
2915
+ agent: "agent";
2916
+ session: "session";
2917
+ project: "project";
2918
+ team: "team";
2919
+ org: "org";
2920
+ company: "company";
2921
+ }>>>;
2922
+ }, z.core.$strip>>;
2881
2923
  knowledge_repo: z.ZodOptional<z.ZodObject<{
2882
2924
  enabled: z.ZodDefault<z.ZodBoolean>;
2883
2925
  rootDir: z.ZodDefault<z.ZodString>;
@@ -2921,6 +2963,14 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
2921
2963
  enabled: z.ZodDefault<z.ZodBoolean>;
2922
2964
  servers: z.ZodDefault<z.ZodArray<z.ZodObject<{
2923
2965
  name: z.ZodString;
2966
+ transport: z.ZodOptional<z.ZodEnum<{
2967
+ stdio: "stdio";
2968
+ sse: "sse";
2969
+ }>>;
2970
+ command: z.ZodOptional<z.ZodString>;
2971
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
2972
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2973
+ url: z.ZodOptional<z.ZodString>;
2924
2974
  searchTool: z.ZodString;
2925
2975
  getTool: z.ZodOptional<z.ZodString>;
2926
2976
  config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -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
+ }
@@ -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 (from .mcp.json) */
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 for the MCP */
265
+ /** Additional config passed to MCP tools */
246
266
  config?: Record<string, unknown>;
247
267
  }
248
268
  /**