@kalera/munin-gemini 0.1.0 → 1.0.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/.turbo/turbo-build.log +1 -1
- package/dist/cli.js +4 -2
- package/dist/index.d.ts +23 -4
- package/dist/index.js +42 -11
- package/gemini-extension.json +1 -1
- package/package.json +3 -3
- package/src/cli.ts +2 -2
- package/src/index.ts +38 -13
package/.turbo/turbo-build.log
CHANGED
package/dist/cli.js
CHANGED
|
@@ -7,14 +7,16 @@ async function main() {
|
|
|
7
7
|
const adapter = createGeminiCliMuninAdapter({
|
|
8
8
|
baseUrl: env.baseUrl,
|
|
9
9
|
apiKey: env.apiKey,
|
|
10
|
-
project: env.project,
|
|
11
10
|
timeoutMs: env.timeoutMs,
|
|
12
11
|
});
|
|
13
12
|
const result = await executeWithRetry(async () => {
|
|
14
13
|
if (action === "capabilities") {
|
|
15
14
|
return { ok: true, data: await adapter.capabilities() };
|
|
16
15
|
}
|
|
17
|
-
|
|
16
|
+
const { projectId, ...p } = payload;
|
|
17
|
+
if (!projectId)
|
|
18
|
+
throw new Error("projectId required in payload");
|
|
19
|
+
return adapter.callTool(projectId, action, p);
|
|
18
20
|
}, env.retries, env.backoffMs);
|
|
19
21
|
console.log(JSON.stringify(result, null, 2));
|
|
20
22
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export declare function createGeminiCliMuninAdapter(config: {
|
|
2
2
|
baseUrl: string;
|
|
3
3
|
apiKey?: string;
|
|
4
|
-
project: string;
|
|
5
4
|
timeoutMs?: number;
|
|
6
5
|
}): {
|
|
7
|
-
callTool: (name: string, args: Record<string, unknown>) => Promise<import("@kalera/munin-sdk").MuninResponse<unknown>>;
|
|
6
|
+
callTool: (projectId: string, name: string, args: Record<string, unknown>) => Promise<import("@kalera/munin-sdk").MuninResponse<unknown>>;
|
|
8
7
|
capabilities: () => Promise<import("@kalera/munin-sdk").MuninCapabilities>;
|
|
9
8
|
};
|
|
10
9
|
export declare const tools: ({
|
|
@@ -13,6 +12,10 @@ export declare const tools: ({
|
|
|
13
12
|
parameters: {
|
|
14
13
|
type: string;
|
|
15
14
|
properties: {
|
|
15
|
+
projectId: {
|
|
16
|
+
type: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
16
19
|
key: {
|
|
17
20
|
type: string;
|
|
18
21
|
description: string;
|
|
@@ -45,6 +48,10 @@ export declare const tools: ({
|
|
|
45
48
|
parameters: {
|
|
46
49
|
type: string;
|
|
47
50
|
properties: {
|
|
51
|
+
projectId: {
|
|
52
|
+
type: string;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
48
55
|
key: {
|
|
49
56
|
type: string;
|
|
50
57
|
description: string;
|
|
@@ -65,6 +72,10 @@ export declare const tools: ({
|
|
|
65
72
|
parameters: {
|
|
66
73
|
type: string;
|
|
67
74
|
properties: {
|
|
75
|
+
projectId: {
|
|
76
|
+
type: string;
|
|
77
|
+
description: string;
|
|
78
|
+
};
|
|
68
79
|
query: {
|
|
69
80
|
type: string;
|
|
70
81
|
description: string;
|
|
@@ -94,6 +105,10 @@ export declare const tools: ({
|
|
|
94
105
|
parameters: {
|
|
95
106
|
type: string;
|
|
96
107
|
properties: {
|
|
108
|
+
projectId: {
|
|
109
|
+
type: string;
|
|
110
|
+
description: string;
|
|
111
|
+
};
|
|
97
112
|
limit: {
|
|
98
113
|
type: string;
|
|
99
114
|
description?: undefined;
|
|
@@ -107,7 +122,7 @@ export declare const tools: ({
|
|
|
107
122
|
tags?: undefined;
|
|
108
123
|
query?: undefined;
|
|
109
124
|
};
|
|
110
|
-
required
|
|
125
|
+
required: string[];
|
|
111
126
|
};
|
|
112
127
|
execute: (args: any) => Promise<import("@kalera/munin-sdk").MuninResponse<unknown>>;
|
|
113
128
|
} | {
|
|
@@ -116,6 +131,10 @@ export declare const tools: ({
|
|
|
116
131
|
parameters: {
|
|
117
132
|
type: string;
|
|
118
133
|
properties: {
|
|
134
|
+
projectId: {
|
|
135
|
+
type: string;
|
|
136
|
+
description: string;
|
|
137
|
+
};
|
|
119
138
|
limit: {
|
|
120
139
|
type: string;
|
|
121
140
|
description?: undefined;
|
|
@@ -127,7 +146,7 @@ export declare const tools: ({
|
|
|
127
146
|
query?: undefined;
|
|
128
147
|
offset?: undefined;
|
|
129
148
|
};
|
|
130
|
-
required
|
|
149
|
+
required: string[];
|
|
131
150
|
};
|
|
132
151
|
execute: (args: any) => Promise<import("@kalera/munin-sdk").MuninResponse<unknown>>;
|
|
133
152
|
})[];
|
package/dist/index.js
CHANGED
|
@@ -2,15 +2,14 @@ import { MuninClient } from "@kalera/munin-sdk";
|
|
|
2
2
|
export function createGeminiCliMuninAdapter(config) {
|
|
3
3
|
const client = new MuninClient(config);
|
|
4
4
|
return {
|
|
5
|
-
callTool: async (name, args) => client.invoke(name, args, { ensureCapability: true }),
|
|
5
|
+
callTool: async (projectId, name, args) => client.invoke(projectId, name, args, { ensureCapability: true }),
|
|
6
6
|
capabilities: () => client.capabilities(),
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
9
|
// Ensure defaults for Gemini CLI if run as an extension
|
|
10
10
|
const baseUrl = process.env.MUNIN_BASE_URL || "http://127.0.0.1:3237";
|
|
11
|
-
const project = process.env.MUNIN_PROJECT || "default";
|
|
12
11
|
const apiKey = process.env.MUNIN_API_KEY;
|
|
13
|
-
const extensionClient = new MuninClient({ baseUrl,
|
|
12
|
+
const extensionClient = new MuninClient({ baseUrl, apiKey });
|
|
14
13
|
export const tools = [
|
|
15
14
|
{
|
|
16
15
|
name: "munin_store_memory",
|
|
@@ -18,6 +17,7 @@ export const tools = [
|
|
|
18
17
|
parameters: {
|
|
19
18
|
type: "object",
|
|
20
19
|
properties: {
|
|
20
|
+
projectId: { type: "string", description: "The Munin Project ID (get this from your instructions)" },
|
|
21
21
|
key: { type: "string", description: "Unique identifier for this memory" },
|
|
22
22
|
content: { type: "string", description: "The content to remember" },
|
|
23
23
|
title: { type: "string", description: "Optional title" },
|
|
@@ -27,9 +27,14 @@ export const tools = [
|
|
|
27
27
|
description: "List of tags, e.g. ['planning', 'frontend']"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
-
required: ["key", "content"],
|
|
30
|
+
required: ["projectId", "key", "content"],
|
|
31
|
+
},
|
|
32
|
+
execute: async (args) => {
|
|
33
|
+
const { projectId, ...payload } = args;
|
|
34
|
+
if (!projectId)
|
|
35
|
+
throw new Error("projectId is required");
|
|
36
|
+
return await extensionClient.store(projectId, payload);
|
|
31
37
|
},
|
|
32
|
-
execute: async (args) => await extensionClient.store(args),
|
|
33
38
|
},
|
|
34
39
|
{
|
|
35
40
|
name: "munin_retrieve_memory",
|
|
@@ -37,11 +42,17 @@ export const tools = [
|
|
|
37
42
|
parameters: {
|
|
38
43
|
type: "object",
|
|
39
44
|
properties: {
|
|
45
|
+
projectId: { type: "string", description: "The Munin Project ID" },
|
|
40
46
|
key: { type: "string", description: "Unique identifier" },
|
|
41
47
|
},
|
|
42
|
-
required: ["key"],
|
|
48
|
+
required: ["projectId", "key"],
|
|
49
|
+
},
|
|
50
|
+
execute: async (args) => {
|
|
51
|
+
const { projectId, ...payload } = args;
|
|
52
|
+
if (!projectId)
|
|
53
|
+
throw new Error("projectId is required");
|
|
54
|
+
return await extensionClient.retrieve(projectId, payload);
|
|
43
55
|
},
|
|
44
|
-
execute: async (args) => await extensionClient.retrieve(args),
|
|
45
56
|
},
|
|
46
57
|
{
|
|
47
58
|
name: "munin_search_memories",
|
|
@@ -49,13 +60,19 @@ export const tools = [
|
|
|
49
60
|
parameters: {
|
|
50
61
|
type: "object",
|
|
51
62
|
properties: {
|
|
63
|
+
projectId: { type: "string", description: "The Munin Project ID" },
|
|
52
64
|
query: { type: "string", description: "Search query" },
|
|
53
65
|
tags: { type: "array", items: { type: "string" } },
|
|
54
66
|
limit: { type: "number", description: "Max results (default: 10)" },
|
|
55
67
|
},
|
|
56
|
-
required: ["query"],
|
|
68
|
+
required: ["projectId", "query"],
|
|
69
|
+
},
|
|
70
|
+
execute: async (args) => {
|
|
71
|
+
const { projectId, ...payload } = args;
|
|
72
|
+
if (!projectId)
|
|
73
|
+
throw new Error("projectId is required");
|
|
74
|
+
return await extensionClient.search(projectId, payload);
|
|
57
75
|
},
|
|
58
|
-
execute: async (args) => await extensionClient.search(args),
|
|
59
76
|
},
|
|
60
77
|
{
|
|
61
78
|
name: "munin_list_memories",
|
|
@@ -63,11 +80,18 @@ export const tools = [
|
|
|
63
80
|
parameters: {
|
|
64
81
|
type: "object",
|
|
65
82
|
properties: {
|
|
83
|
+
projectId: { type: "string", description: "The Munin Project ID" },
|
|
66
84
|
limit: { type: "number" },
|
|
67
85
|
offset: { type: "number" },
|
|
68
86
|
},
|
|
87
|
+
required: ["projectId"]
|
|
88
|
+
},
|
|
89
|
+
execute: async (args) => {
|
|
90
|
+
const { projectId, ...payload } = args;
|
|
91
|
+
if (!projectId)
|
|
92
|
+
throw new Error("projectId is required");
|
|
93
|
+
return await extensionClient.list(projectId, payload);
|
|
69
94
|
},
|
|
70
|
-
execute: async (args) => await extensionClient.list(args),
|
|
71
95
|
},
|
|
72
96
|
{
|
|
73
97
|
name: "munin_recent_memories",
|
|
@@ -75,9 +99,16 @@ export const tools = [
|
|
|
75
99
|
parameters: {
|
|
76
100
|
type: "object",
|
|
77
101
|
properties: {
|
|
102
|
+
projectId: { type: "string", description: "The Munin Project ID" },
|
|
78
103
|
limit: { type: "number" },
|
|
79
104
|
},
|
|
105
|
+
required: ["projectId"]
|
|
106
|
+
},
|
|
107
|
+
execute: async (args) => {
|
|
108
|
+
const { projectId, ...payload } = args;
|
|
109
|
+
if (!projectId)
|
|
110
|
+
throw new Error("projectId is required");
|
|
111
|
+
return await extensionClient.recent(projectId, payload);
|
|
80
112
|
},
|
|
81
|
-
execute: async (args) => await extensionClient.recent(args),
|
|
82
113
|
},
|
|
83
114
|
];
|
package/gemini-extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kalera/munin-gemini",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"munin-gemini": "dist/cli.js"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@kalera/munin-sdk": "
|
|
10
|
-
"@kalera/munin-runtime": "
|
|
9
|
+
"@kalera/munin-sdk": "1.0.0",
|
|
10
|
+
"@kalera/munin-runtime": "1.0.0"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"typescript": "^5.9.2"
|
package/src/cli.ts
CHANGED
|
@@ -17,7 +17,7 @@ async function main() {
|
|
|
17
17
|
const adapter = createGeminiCliMuninAdapter({
|
|
18
18
|
baseUrl: env.baseUrl,
|
|
19
19
|
apiKey: env.apiKey,
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
timeoutMs: env.timeoutMs,
|
|
22
22
|
});
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ async function main() {
|
|
|
25
25
|
if (action === "capabilities") {
|
|
26
26
|
return { ok: true, data: await adapter.capabilities() };
|
|
27
27
|
}
|
|
28
|
-
return adapter.callTool(action,
|
|
28
|
+
const { projectId, ...p } = payload; if (!projectId) throw new Error("projectId required in payload"); return adapter.callTool(projectId as string, action, p);
|
|
29
29
|
}, env.retries, env.backoffMs);
|
|
30
30
|
|
|
31
31
|
console.log(JSON.stringify(result, null, 2));
|
package/src/index.ts
CHANGED
|
@@ -3,24 +3,22 @@ import { MuninClient } from "@kalera/munin-sdk";
|
|
|
3
3
|
export function createGeminiCliMuninAdapter(config: {
|
|
4
4
|
baseUrl: string;
|
|
5
5
|
apiKey?: string;
|
|
6
|
-
project: string;
|
|
7
6
|
timeoutMs?: number;
|
|
8
7
|
}) {
|
|
9
8
|
const client = new MuninClient(config);
|
|
10
9
|
|
|
11
10
|
return {
|
|
12
|
-
callTool: async (name: string, args: Record<string, unknown>) =>
|
|
13
|
-
client.invoke(name as any, args, { ensureCapability: true }),
|
|
11
|
+
callTool: async (projectId: string, name: string, args: Record<string, unknown>) =>
|
|
12
|
+
client.invoke(projectId, name as any, args, { ensureCapability: true }),
|
|
14
13
|
capabilities: () => client.capabilities(),
|
|
15
14
|
};
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
// Ensure defaults for Gemini CLI if run as an extension
|
|
19
18
|
const baseUrl = process.env.MUNIN_BASE_URL || "http://127.0.0.1:3237";
|
|
20
|
-
const project = process.env.MUNIN_PROJECT || "default";
|
|
21
19
|
const apiKey = process.env.MUNIN_API_KEY;
|
|
22
20
|
|
|
23
|
-
const extensionClient = new MuninClient({ baseUrl,
|
|
21
|
+
const extensionClient = new MuninClient({ baseUrl, apiKey });
|
|
24
22
|
|
|
25
23
|
export const tools = [
|
|
26
24
|
{
|
|
@@ -29,6 +27,7 @@ export const tools = [
|
|
|
29
27
|
parameters: {
|
|
30
28
|
type: "object",
|
|
31
29
|
properties: {
|
|
30
|
+
projectId: { type: "string", description: "The Munin Project ID (get this from your instructions)" },
|
|
32
31
|
key: { type: "string", description: "Unique identifier for this memory" },
|
|
33
32
|
content: { type: "string", description: "The content to remember" },
|
|
34
33
|
title: { type: "string", description: "Optional title" },
|
|
@@ -38,9 +37,13 @@ export const tools = [
|
|
|
38
37
|
description: "List of tags, e.g. ['planning', 'frontend']"
|
|
39
38
|
}
|
|
40
39
|
},
|
|
41
|
-
required: ["key", "content"],
|
|
40
|
+
required: ["projectId", "key", "content"],
|
|
41
|
+
},
|
|
42
|
+
execute: async (args: any) => {
|
|
43
|
+
const { projectId, ...payload } = args;
|
|
44
|
+
if (!projectId) throw new Error("projectId is required");
|
|
45
|
+
return await extensionClient.store(projectId, payload);
|
|
42
46
|
},
|
|
43
|
-
execute: async (args: any) => await extensionClient.store(args),
|
|
44
47
|
},
|
|
45
48
|
{
|
|
46
49
|
name: "munin_retrieve_memory",
|
|
@@ -48,11 +51,16 @@ export const tools = [
|
|
|
48
51
|
parameters: {
|
|
49
52
|
type: "object",
|
|
50
53
|
properties: {
|
|
54
|
+
projectId: { type: "string", description: "The Munin Project ID" },
|
|
51
55
|
key: { type: "string", description: "Unique identifier" },
|
|
52
56
|
},
|
|
53
|
-
required: ["key"],
|
|
57
|
+
required: ["projectId", "key"],
|
|
58
|
+
},
|
|
59
|
+
execute: async (args: any) => {
|
|
60
|
+
const { projectId, ...payload } = args;
|
|
61
|
+
if (!projectId) throw new Error("projectId is required");
|
|
62
|
+
return await extensionClient.retrieve(projectId, payload);
|
|
54
63
|
},
|
|
55
|
-
execute: async (args: any) => await extensionClient.retrieve(args),
|
|
56
64
|
},
|
|
57
65
|
{
|
|
58
66
|
name: "munin_search_memories",
|
|
@@ -60,13 +68,18 @@ export const tools = [
|
|
|
60
68
|
parameters: {
|
|
61
69
|
type: "object",
|
|
62
70
|
properties: {
|
|
71
|
+
projectId: { type: "string", description: "The Munin Project ID" },
|
|
63
72
|
query: { type: "string", description: "Search query" },
|
|
64
73
|
tags: { type: "array", items: { type: "string" } },
|
|
65
74
|
limit: { type: "number", description: "Max results (default: 10)" },
|
|
66
75
|
},
|
|
67
|
-
required: ["query"],
|
|
76
|
+
required: ["projectId", "query"],
|
|
77
|
+
},
|
|
78
|
+
execute: async (args: any) => {
|
|
79
|
+
const { projectId, ...payload } = args;
|
|
80
|
+
if (!projectId) throw new Error("projectId is required");
|
|
81
|
+
return await extensionClient.search(projectId, payload);
|
|
68
82
|
},
|
|
69
|
-
execute: async (args: any) => await extensionClient.search(args),
|
|
70
83
|
},
|
|
71
84
|
{
|
|
72
85
|
name: "munin_list_memories",
|
|
@@ -74,11 +87,17 @@ export const tools = [
|
|
|
74
87
|
parameters: {
|
|
75
88
|
type: "object",
|
|
76
89
|
properties: {
|
|
90
|
+
projectId: { type: "string", description: "The Munin Project ID" },
|
|
77
91
|
limit: { type: "number" },
|
|
78
92
|
offset: { type: "number" },
|
|
79
93
|
},
|
|
94
|
+
required: ["projectId"]
|
|
95
|
+
},
|
|
96
|
+
execute: async (args: any) => {
|
|
97
|
+
const { projectId, ...payload } = args;
|
|
98
|
+
if (!projectId) throw new Error("projectId is required");
|
|
99
|
+
return await extensionClient.list(projectId, payload);
|
|
80
100
|
},
|
|
81
|
-
execute: async (args: any) => await extensionClient.list(args),
|
|
82
101
|
},
|
|
83
102
|
{
|
|
84
103
|
name: "munin_recent_memories",
|
|
@@ -86,9 +105,15 @@ export const tools = [
|
|
|
86
105
|
parameters: {
|
|
87
106
|
type: "object",
|
|
88
107
|
properties: {
|
|
108
|
+
projectId: { type: "string", description: "The Munin Project ID" },
|
|
89
109
|
limit: { type: "number" },
|
|
90
110
|
},
|
|
111
|
+
required: ["projectId"]
|
|
112
|
+
},
|
|
113
|
+
execute: async (args: any) => {
|
|
114
|
+
const { projectId, ...payload } = args;
|
|
115
|
+
if (!projectId) throw new Error("projectId is required");
|
|
116
|
+
return await extensionClient.recent(projectId, payload);
|
|
91
117
|
},
|
|
92
|
-
execute: async (args: any) => await extensionClient.recent(args),
|
|
93
118
|
},
|
|
94
119
|
];
|