@kalera/munin-cursor 0.1.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.
@@ -0,0 +1,4 @@
1
+
2
+ > @kalera/munin-cursor@0.1.0 build /home/runner/work/munin-for-agents/munin-for-agents/adapters/cursor
3
+ > tsc -p tsconfig.json
4
+
package/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # Munin Adapter for Cursor
2
+
3
+ ## Status
4
+
5
+ - Phase: scaffold
6
+ - Core actions: wired through `munin/sdk`
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { createCursorMuninAdapter } from "@kalera/munin-cursor";
12
+
13
+ const adapter = createCursorMuninAdapter({
14
+ baseUrl: process.env.MUNIN_BASE_URL!,
15
+ apiKey: process.env.MUNIN_API_KEY,
16
+ project: process.env.MUNIN_PROJECT ?? "default",
17
+ });
18
+
19
+ await adapter.store({ key: "hello", content: "world" });
20
+ ```
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,36 @@
1
+ import { executeWithRetry, loadCliEnv, parseCliArgs, safeError, startMcpServer, } from "@kalera/munin-runtime";
2
+ import { createCursorMuninAdapter } from "./index.js";
3
+ async function main() {
4
+ try {
5
+ const args = process.argv.slice(2);
6
+ // Start MCP server if requested or empty args
7
+ if (args.length === 0 || args[0] === 'mcp') {
8
+ await startMcpServer();
9
+ return;
10
+ }
11
+ const { action, payload } = parseCliArgs(args, "Usage: munin-cursor <action> [payload-json] OR munin-cursor mcp");
12
+ const env = loadCliEnv();
13
+ const adapter = createCursorMuninAdapter({
14
+ baseUrl: env.baseUrl,
15
+ apiKey: env.apiKey,
16
+ project: env.project,
17
+ timeoutMs: env.timeoutMs,
18
+ });
19
+ const result = await executeWithRetry(async () => {
20
+ if (action === "capabilities") {
21
+ return { ok: true, data: await adapter.capabilities() };
22
+ }
23
+ const handler = adapter[action];
24
+ if (typeof handler !== "function") {
25
+ throw new Error(`Unsupported action: ${action}`);
26
+ }
27
+ return handler(payload);
28
+ }, env.retries, env.backoffMs);
29
+ console.log(JSON.stringify(result, null, 2));
30
+ }
31
+ catch (error) {
32
+ console.error(JSON.stringify({ ok: false, error: safeError(error) }));
33
+ process.exitCode = 1;
34
+ }
35
+ }
36
+ void main();
@@ -0,0 +1,13 @@
1
+ export declare function createCursorMuninAdapter(config: {
2
+ baseUrl: string;
3
+ apiKey?: string;
4
+ project: string;
5
+ timeoutMs?: number;
6
+ }): {
7
+ capabilities: () => Promise<import("@kalera/munin-sdk").MuninCapabilities>;
8
+ store: (payload: Record<string, unknown>) => Promise<import("@kalera/munin-sdk").MuninResponse<unknown>>;
9
+ retrieve: (payload: Record<string, unknown>) => Promise<import("@kalera/munin-sdk").MuninResponse<unknown>>;
10
+ search: (payload: Record<string, unknown>) => Promise<import("@kalera/munin-sdk").MuninResponse<unknown>>;
11
+ list: (payload?: Record<string, unknown>) => Promise<import("@kalera/munin-sdk").MuninResponse<unknown>>;
12
+ recent: (payload?: Record<string, unknown>) => Promise<import("@kalera/munin-sdk").MuninResponse<unknown>>;
13
+ };
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ import { MuninClient } from "@kalera/munin-sdk";
2
+ export function createCursorMuninAdapter(config) {
3
+ const client = new MuninClient(config);
4
+ return {
5
+ capabilities: () => client.capabilities(),
6
+ store: (payload) => client.store(payload),
7
+ retrieve: (payload) => client.retrieve(payload),
8
+ search: (payload) => client.search(payload),
9
+ list: (payload) => client.list(payload),
10
+ recent: (payload) => client.recent(payload),
11
+ };
12
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@kalera/munin-cursor",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "bin": {
6
+ "munin-cursor": "dist/cli.js"
7
+ },
8
+ "dependencies": {
9
+ "@kalera/munin-sdk": "0.1.0",
10
+ "@kalera/munin-runtime": "0.1.0"
11
+ },
12
+ "devDependencies": {
13
+ "typescript": "^5.9.2"
14
+ },
15
+ "scripts": {
16
+ "build": "tsc -p tsconfig.json",
17
+ "lint": "tsc -p tsconfig.json --noEmit",
18
+ "test": "echo 'adapter-cursor tests: pending'"
19
+ }
20
+ }
package/src/cli.ts ADDED
@@ -0,0 +1,55 @@
1
+ import {
2
+ executeWithRetry,
3
+ loadCliEnv,
4
+ parseCliArgs,
5
+ safeError,
6
+ startMcpServer,
7
+ } from "@kalera/munin-runtime";
8
+ import { createCursorMuninAdapter } from "./index.js";
9
+
10
+ async function main() {
11
+ try {
12
+ const args = process.argv.slice(2);
13
+
14
+ // Start MCP server if requested or empty args
15
+ if (args.length === 0 || args[0] === 'mcp') {
16
+ await startMcpServer();
17
+ return;
18
+ }
19
+
20
+ const { action, payload } = parseCliArgs(
21
+ args,
22
+ "Usage: munin-cursor <action> [payload-json] OR munin-cursor mcp",
23
+ );
24
+ const env = loadCliEnv();
25
+
26
+ const adapter = createCursorMuninAdapter({
27
+ baseUrl: env.baseUrl,
28
+ apiKey: env.apiKey,
29
+ project: env.project,
30
+ timeoutMs: env.timeoutMs,
31
+ });
32
+
33
+ const result = await executeWithRetry(async () => {
34
+ if (action === "capabilities") {
35
+ return { ok: true, data: await adapter.capabilities() };
36
+ }
37
+
38
+ const handler = (adapter as Record<string, unknown>)[action];
39
+ if (typeof handler !== "function") {
40
+ throw new Error(`Unsupported action: ${action}`);
41
+ }
42
+
43
+ return (handler as (arg: Record<string, unknown>) => Promise<unknown>)(
44
+ payload,
45
+ );
46
+ }, env.retries, env.backoffMs);
47
+
48
+ console.log(JSON.stringify(result, null, 2));
49
+ } catch (error) {
50
+ console.error(JSON.stringify({ ok: false, error: safeError(error) }));
51
+ process.exitCode = 1;
52
+ }
53
+ }
54
+
55
+ void main();
package/src/index.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { MuninClient } from "@kalera/munin-sdk";
2
+
3
+ export function createCursorMuninAdapter(config: {
4
+ baseUrl: string;
5
+ apiKey?: string;
6
+ project: string;
7
+ timeoutMs?: number;
8
+ }) {
9
+ const client = new MuninClient(config);
10
+
11
+ return {
12
+ capabilities: () => client.capabilities(),
13
+ store: (payload: Record<string, unknown>) => client.store(payload),
14
+ retrieve: (payload: Record<string, unknown>) => client.retrieve(payload),
15
+ search: (payload: Record<string, unknown>) => client.search(payload),
16
+ list: (payload?: Record<string, unknown>) => client.list(payload),
17
+ recent: (payload?: Record<string, unknown>) => client.recent(payload),
18
+ };
19
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist"
6
+ },
7
+ "include": ["src"]
8
+ }