@kalera/munin-antigravity 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-antigravity@0.1.0 build /home/runner/work/munin-for-agents/munin-for-agents/adapters/antigravity
3
+ > tsc -p tsconfig.json
4
+
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/dist/cli.js ADDED
@@ -0,0 +1,26 @@
1
+ import { executeWithRetry, loadCliEnv, parseCliArgs, safeError, } from "@kalera/munin-runtime";
2
+ import { createAntigravityMuninAdapter } from "./index.js";
3
+ async function main() {
4
+ try {
5
+ const { action, payload } = parseCliArgs(process.argv.slice(2), "Usage: munin-antigravity <action> [payload-json]");
6
+ const env = loadCliEnv();
7
+ const adapter = createAntigravityMuninAdapter({
8
+ baseUrl: env.baseUrl,
9
+ apiKey: env.apiKey,
10
+ project: env.project,
11
+ timeoutMs: env.timeoutMs,
12
+ });
13
+ const result = await executeWithRetry(async () => {
14
+ if (action === "capabilities") {
15
+ return { ok: true, data: await adapter.capabilities() };
16
+ }
17
+ return adapter.invokeTool(action, payload);
18
+ }, env.retries, env.backoffMs);
19
+ console.log(JSON.stringify(result, null, 2));
20
+ }
21
+ catch (error) {
22
+ console.error(JSON.stringify({ ok: false, error: safeError(error) }));
23
+ process.exitCode = 1;
24
+ }
25
+ }
26
+ void main();
@@ -0,0 +1,9 @@
1
+ export declare function createAntigravityMuninAdapter(config: {
2
+ baseUrl: string;
3
+ apiKey?: string;
4
+ project: string;
5
+ timeoutMs?: number;
6
+ }): {
7
+ invokeTool: (action: string, payload: Record<string, unknown>) => Promise<import("@kalera/munin-sdk").MuninResponse<unknown>>;
8
+ capabilities: () => Promise<import("@kalera/munin-sdk").MuninCapabilities>;
9
+ };
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ import { MuninClient } from "@kalera/munin-sdk";
2
+ export function createAntigravityMuninAdapter(config) {
3
+ const client = new MuninClient(config);
4
+ return {
5
+ invokeTool: (action, payload) => client.invoke(action, payload, { ensureCapability: true }),
6
+ capabilities: () => client.capabilities(),
7
+ };
8
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@kalera/munin-antigravity",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "bin": {
6
+ "munin-antigravity": "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-google-antigravity tests: pending'"
19
+ }
20
+ }
package/src/cli.ts ADDED
@@ -0,0 +1,38 @@
1
+ import {
2
+ executeWithRetry,
3
+ loadCliEnv,
4
+ parseCliArgs,
5
+ safeError,
6
+ } from "@kalera/munin-runtime";
7
+ import { createAntigravityMuninAdapter } from "./index.js";
8
+
9
+ async function main() {
10
+ try {
11
+ const { action, payload } = parseCliArgs(
12
+ process.argv.slice(2),
13
+ "Usage: munin-antigravity <action> [payload-json]",
14
+ );
15
+ const env = loadCliEnv();
16
+
17
+ const adapter = createAntigravityMuninAdapter({
18
+ baseUrl: env.baseUrl,
19
+ apiKey: env.apiKey,
20
+ project: env.project,
21
+ timeoutMs: env.timeoutMs,
22
+ });
23
+
24
+ const result = await executeWithRetry(async () => {
25
+ if (action === "capabilities") {
26
+ return { ok: true, data: await adapter.capabilities() };
27
+ }
28
+ return adapter.invokeTool(action, payload);
29
+ }, env.retries, env.backoffMs);
30
+
31
+ console.log(JSON.stringify(result, null, 2));
32
+ } catch (error) {
33
+ console.error(JSON.stringify({ ok: false, error: safeError(error) }));
34
+ process.exitCode = 1;
35
+ }
36
+ }
37
+
38
+ void main();
package/src/index.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { MuninClient } from "@kalera/munin-sdk";
2
+
3
+ export function createAntigravityMuninAdapter(config: {
4
+ baseUrl: string;
5
+ apiKey?: string;
6
+ project: string;
7
+ timeoutMs?: number;
8
+ }) {
9
+ const client = new MuninClient(config);
10
+
11
+ return {
12
+ invokeTool: (action: string, payload: Record<string, unknown>) =>
13
+ client.invoke(action as any, payload, { ensureCapability: true }),
14
+ capabilities: () => client.capabilities(),
15
+ };
16
+ }
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
+ }