@gravity-ai/eve 0.1.0 → 0.2.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/README.md +0 -4
- package/dist/extension/lib/index.d.ts +1 -1
- package/dist/extension/lib/index.mjs +17 -101
- package/dist/extension/skills/find-service/SKILL.md +2 -5
- package/dist/extension/tools/search.mjs +2 -2
- package/dist/tools/index.d.ts +0 -4
- package/dist/tools/index.mjs +1 -6
- package/package.json +1 -1
- package/dist/extension/tools/browse.d.ts +0 -4
- package/dist/extension/tools/browse.mjs +0 -30
- package/dist/extension/tools/get_service.d.ts +0 -4
- package/dist/extension/tools/get_service.mjs +0 -25
- package/dist/extension/tools/list_categories.d.ts +0 -4
- package/dist/extension/tools/list_categories.mjs +0 -21
- package/dist/extension/tools/report_integration.d.ts +0 -4
- package/dist/extension/tools/report_integration.mjs +0 -31
package/README.md
CHANGED
|
@@ -34,10 +34,6 @@ with their reasoning and required setup link.
|
|
|
34
34
|
| Mounted tool | Purpose |
|
|
35
35
|
| --- | --- |
|
|
36
36
|
| `gravity__search` | Recommend a service with reasoning, install steps, and setup link |
|
|
37
|
-
| `gravity__browse` | Browse by category or keyword |
|
|
38
|
-
| `gravity__get_service` | Get a service's details by slug |
|
|
39
|
-
| `gravity__list_categories` | List categories and service counts |
|
|
40
|
-
| `gravity__report_integration` | Record a completed integration |
|
|
41
37
|
|
|
42
38
|
Built using eve 1.3.0 (the current eve 1.x scaffold); requires Node.js 24+,
|
|
43
39
|
matching eve's supported Node.js range.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function
|
|
1
|
+
export function searchIndex(args: any, config: any): Promise<string>;
|
|
@@ -10,7 +10,7 @@ async function apiPost(path, body, config) {
|
|
|
10
10
|
method: "POST",
|
|
11
11
|
headers: {
|
|
12
12
|
"Content-Type": "application/json",
|
|
13
|
-
"User-Agent": "@gravity-ai/eve/0.
|
|
13
|
+
"User-Agent": "@gravity-ai/eve/0.2.0",
|
|
14
14
|
"X-API-Key": config.apiKey
|
|
15
15
|
},
|
|
16
16
|
body: JSON.stringify(body)
|
|
@@ -24,28 +24,6 @@ async function apiPost(path, body, config) {
|
|
|
24
24
|
return { error: `Request failed: ${e.name}: ${e.message}` };
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
async function apiGet(path, params, config) {
|
|
28
|
-
try {
|
|
29
|
-
let url = `${config.baseUrl}${path}`;
|
|
30
|
-
if (params) {
|
|
31
|
-
const qs = new URLSearchParams();
|
|
32
|
-
for (const [k, v] of Object.entries(params)) if (v !== void 0 && v !== null && v !== "") qs.set(k, String(v));
|
|
33
|
-
const s = qs.toString();
|
|
34
|
-
if (s) url += `?${s}`;
|
|
35
|
-
}
|
|
36
|
-
const resp = await fetch(url, { headers: {
|
|
37
|
-
"User-Agent": "@gravity-ai/eve/0.1.0",
|
|
38
|
-
"X-API-Key": config.apiKey
|
|
39
|
-
} });
|
|
40
|
-
if (!resp.ok) {
|
|
41
|
-
const text = await resp.text();
|
|
42
|
-
return { error: `${resp.status} ${text}` };
|
|
43
|
-
}
|
|
44
|
-
return await resp.json();
|
|
45
|
-
} catch (e) {
|
|
46
|
-
return { error: `Request failed: ${e.name}: ${e.message}` };
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
27
|
function formatSearchResult(data) {
|
|
50
28
|
const parts = [];
|
|
51
29
|
const rec = data.recommendation;
|
|
@@ -55,7 +33,7 @@ function formatSearchResult(data) {
|
|
|
55
33
|
if (rec) parts.push(`## ${rec.name} (${rec.category})`);
|
|
56
34
|
else if (data.unmatched_slug) {
|
|
57
35
|
parts.push(`## Candidate "${data.unmatched_slug}" not in catalog`);
|
|
58
|
-
parts.push("> The model suggested a service that is not in the Gravity Index catalog under this name. If the service exists under a different name (e.g. rebrand, acquisition),
|
|
36
|
+
parts.push("> The model suggested a service that is not in the Gravity Index catalog under this name. If the service exists under a different name (e.g. rebrand, acquisition), search again using that name. Otherwise confirm with the user before acting on the recommendation below.");
|
|
59
37
|
} else parts.push("## No matching service found");
|
|
60
38
|
if (data.reasoning) parts.push(`\n${data.reasoning}`);
|
|
61
39
|
if (install && install.steps && install.steps.length) {
|
|
@@ -84,84 +62,22 @@ function formatSearchResult(data) {
|
|
|
84
62
|
for (const v of install.env_vars) parts.push(`- \`${v}\``);
|
|
85
63
|
}
|
|
86
64
|
const slugFooter = rec?.slug ? ` · _slug: ${rec.slug}_` : "";
|
|
87
|
-
parts.push(`\n_search_id: ${data.search_id ?? ""}_${slugFooter}
|
|
65
|
+
parts.push(`\n_search_id: ${data.search_id ?? ""}_${slugFooter}`);
|
|
88
66
|
return parts.join("\n");
|
|
89
67
|
}
|
|
90
|
-
function
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (svc.description) parts.push(`\n${svc.description}`);
|
|
102
|
-
if (svc.install_summary) parts.push(`\n**Install:** ${svc.install_summary}`);
|
|
103
|
-
if (svc.install_steps && svc.install_steps.length) {
|
|
104
|
-
parts.push("\n### Steps");
|
|
105
|
-
for (const step of svc.install_steps) {
|
|
106
|
-
parts.push(`- **${step.step ?? "?"}.** ${step.action ?? ""}`);
|
|
107
|
-
if (step.command) parts.push(" `" + step.command + "`");
|
|
108
|
-
if (step.user_action) parts.push(` > ${step.user_action}`);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (svc.env_vars_needed && svc.env_vars_needed.length) parts.push("\n**Env vars:** " + svc.env_vars_needed.map((v) => `\`${v}\``).join(", "));
|
|
112
|
-
if (svc.website_url) parts.push(`\n**Website:** ${svc.website_url}`);
|
|
113
|
-
if (svc.docs_url) parts.push(`**Docs:** ${svc.docs_url}`);
|
|
114
|
-
return parts.join("\n");
|
|
115
|
-
}
|
|
116
|
-
async function callTool(name, args, config) {
|
|
117
|
-
if (name === "gravity_index_search") {
|
|
118
|
-
const body = { query: args.query };
|
|
119
|
-
if (args.search_id) body.search_id = args.search_id;
|
|
120
|
-
if (args.context && typeof args.context === "object") body.context = args.context;
|
|
121
|
-
if (args.external_session_id) body.external_session_id = args.external_session_id;
|
|
122
|
-
if (args.external_user_id_hash) body.external_user_id_hash = args.external_user_id_hash;
|
|
123
|
-
if (args.email_hash) body.email_hash = args.email_hash;
|
|
124
|
-
if (args.metadata && typeof args.metadata === "object") body.metadata = args.metadata;
|
|
125
|
-
if (config.apiKey) {
|
|
126
|
-
body.platform_api_key = config.apiKey;
|
|
127
|
-
if (config.monetizationMode) body.monetization = { mode: config.monetizationMode };
|
|
128
|
-
}
|
|
129
|
-
const data = await apiPost("/search", body, config);
|
|
130
|
-
return data.error ? `Search failed: ${data.error}` : formatSearchResult(data);
|
|
131
|
-
}
|
|
132
|
-
if (name === "gravity_index_browse") {
|
|
133
|
-
const p = {};
|
|
134
|
-
if (config.apiKey) p.platform_api_key = config.apiKey;
|
|
135
|
-
if (args.category) p.category = args.category;
|
|
136
|
-
if (args.q) p.q = args.q;
|
|
137
|
-
const data = await apiGet("/services", p, config);
|
|
138
|
-
return data.error ? `Browse failed: ${data.error}` : formatBrowseResult(data);
|
|
139
|
-
}
|
|
140
|
-
if (name === "gravity_index_get_service") {
|
|
141
|
-
const slug = args.slug ?? "";
|
|
142
|
-
if (!slug) throw new Error("slug is required");
|
|
143
|
-
const p = config.apiKey ? { platform_api_key: config.apiKey } : {};
|
|
144
|
-
const data = await apiGet(`/services/${encodeURIComponent(slug)}`, p, config);
|
|
145
|
-
return data.error ? `Lookup failed: ${data.error}` : formatServiceDetail(data);
|
|
146
|
-
}
|
|
147
|
-
if (name === "gravity_index_list_categories") {
|
|
148
|
-
const data = await apiGet("/categories", config.apiKey ? { platform_api_key: config.apiKey } : {}, config);
|
|
149
|
-
if (data.error) return `Categories failed: ${data.error}`;
|
|
150
|
-
const lines = [`## Gravity Index — ${data.total ?? 0} services in ${(data.categories ?? []).length} categories\n`];
|
|
151
|
-
for (const c of data.categories ?? []) lines.push(`- **${c.name}** — ${c.service_count} services`);
|
|
152
|
-
return lines.join("\n");
|
|
153
|
-
}
|
|
154
|
-
if (name === "gravity_index_report_integration") {
|
|
155
|
-
const body = {
|
|
156
|
-
search_id: args.search_id ?? "",
|
|
157
|
-
integrated_slug: args.integrated_slug ?? ""
|
|
158
|
-
};
|
|
159
|
-
if (config.apiKey) body.platform_api_key = config.apiKey;
|
|
160
|
-
const data = await apiPost("/integrations/report", body, config);
|
|
161
|
-
if (data.error) return `Report failed: ${data.error}`;
|
|
162
|
-
if ((data.status ?? "") === "already_converted") return `Integration already recorded for this search (search_id=${data.search_id ?? ""})`;
|
|
163
|
-
return `Integration recorded for \`${data.slug ?? ""}\` (search_id=${data.search_id ?? ""})`;
|
|
68
|
+
async function searchIndex(args, config) {
|
|
69
|
+
const body = { query: args.query };
|
|
70
|
+
if (args.search_id) body.search_id = args.search_id;
|
|
71
|
+
if (args.context && typeof args.context === "object") body.context = args.context;
|
|
72
|
+
if (args.external_session_id) body.external_session_id = args.external_session_id;
|
|
73
|
+
if (args.external_user_id_hash) body.external_user_id_hash = args.external_user_id_hash;
|
|
74
|
+
if (args.email_hash) body.email_hash = args.email_hash;
|
|
75
|
+
if (args.metadata && typeof args.metadata === "object") body.metadata = args.metadata;
|
|
76
|
+
if (config.apiKey) {
|
|
77
|
+
body.platform_api_key = config.apiKey;
|
|
78
|
+
if (config.monetizationMode) body.monetization = { mode: config.monetizationMode };
|
|
164
79
|
}
|
|
165
|
-
|
|
80
|
+
const data = await apiPost("/search", body, config);
|
|
81
|
+
return data.error ? `Search failed: ${data.error}` : formatSearchResult(data);
|
|
166
82
|
}
|
|
167
|
-
export {
|
|
83
|
+
export { searchIndex };
|
|
@@ -11,8 +11,5 @@ the search. The user must visit that link to create their account and get API
|
|
|
11
11
|
credentials; never omit it or invent credentials. Follow the returned install
|
|
12
12
|
steps and environment variable instructions.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
candidate is not in the catalog, browse for its canonical slug or confirm with
|
|
17
|
-
the user before acting. After actually completing an integration, call
|
|
18
|
-
gravity__report_integration with the earlier search_id and integrated slug.
|
|
14
|
+
If a suggested candidate is not in the catalog, search again using an alternative
|
|
15
|
+
name or confirm with the user before acting.
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import extension_default from "../extension.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { searchIndex } from "../lib/index.mjs";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
import { defineTool } from "eve/tools";
|
|
11
11
|
var search_default = defineTool({
|
|
@@ -45,7 +45,7 @@ var search_default = defineTool({
|
|
|
45
45
|
"required": ["query"]
|
|
46
46
|
}),
|
|
47
47
|
async execute(input) {
|
|
48
|
-
return
|
|
48
|
+
return searchIndex(input, extension_default.config);
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
export { search_default as default };
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
// Generated by eve. Do not edit by hand.
|
|
2
2
|
|
|
3
|
-
export { default as browse } from "../extension/tools/browse.js";
|
|
4
|
-
export { default as get_service } from "../extension/tools/get_service.js";
|
|
5
|
-
export { default as list_categories } from "../extension/tools/list_categories.js";
|
|
6
|
-
export { default as report_integration } from "../extension/tools/report_integration.js";
|
|
7
3
|
export { default as search } from "../extension/tools/search.js";
|
package/dist/tools/index.mjs
CHANGED
|
@@ -4,9 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
|
|
8
|
-
import get_service_default from "../extension/tools/get_service.mjs";
|
|
9
|
-
import list_categories_default from "../extension/tools/list_categories.mjs";
|
|
10
|
-
import report_integration_default from "../extension/tools/report_integration.mjs";
|
|
11
|
-
import search_default from "../extension/tools/search.mjs";
|
|
12
|
-
export { browse_default as browse, get_service_default as get_service, list_categories_default as list_categories, report_integration_default as report_integration, search_default as search };
|
|
7
|
+
export { default as search } from "../extension/tools/search.mjs";
|
package/package.json
CHANGED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
-
import { dirname as __eveDirname } from "node:path";
|
|
3
|
-
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
-
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
-
__eveDirname(__filename);
|
|
6
|
-
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import extension_default from "../extension.mjs";
|
|
8
|
-
import { callTool } from "../lib/index.mjs";
|
|
9
|
-
import { z } from "zod";
|
|
10
|
-
import { defineTool } from "eve/tools";
|
|
11
|
-
var browse_default = defineTool({
|
|
12
|
-
description: "Browse the Gravity Index catalog. Filter by category (Database, Auth, Payments, Hosting, Email, Cache, Monitoring, Analytics, AI, Storage, CMS, Search, Realtime, Background Jobs, Infrastructure, CRM, Support, Productivity, Commerce, Video, Webhooks, SMS) or keyword.",
|
|
13
|
-
inputSchema: z.fromJSONSchema({
|
|
14
|
-
"type": "object",
|
|
15
|
-
"properties": {
|
|
16
|
-
"category": {
|
|
17
|
-
"type": "string",
|
|
18
|
-
"description": "Filter by category"
|
|
19
|
-
},
|
|
20
|
-
"q": {
|
|
21
|
-
"type": "string",
|
|
22
|
-
"description": "Search keyword"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}),
|
|
26
|
-
async execute(input) {
|
|
27
|
-
return callTool("gravity_index_browse", input, extension_default.config);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
export { browse_default as default };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
-
import { dirname as __eveDirname } from "node:path";
|
|
3
|
-
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
-
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
-
__eveDirname(__filename);
|
|
6
|
-
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import extension_default from "../extension.mjs";
|
|
8
|
-
import { callTool } from "../lib/index.mjs";
|
|
9
|
-
import { z } from "zod";
|
|
10
|
-
import { defineTool } from "eve/tools";
|
|
11
|
-
var get_service_default = defineTool({
|
|
12
|
-
description: "Fetch full detail for a single service by slug — description, install steps, env vars, website, and docs URL. Use after browsing when you already know which service you want.",
|
|
13
|
-
inputSchema: z.fromJSONSchema({
|
|
14
|
-
"type": "object",
|
|
15
|
-
"properties": { "slug": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"description": "Service slug, e.g. 'supabase'"
|
|
18
|
-
} },
|
|
19
|
-
"required": ["slug"]
|
|
20
|
-
}),
|
|
21
|
-
async execute(input) {
|
|
22
|
-
return callTool("gravity_index_get_service", input, extension_default.config);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
export { get_service_default as default };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
-
import { dirname as __eveDirname } from "node:path";
|
|
3
|
-
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
-
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
-
__eveDirname(__filename);
|
|
6
|
-
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import extension_default from "../extension.mjs";
|
|
8
|
-
import { callTool } from "../lib/index.mjs";
|
|
9
|
-
import { z } from "zod";
|
|
10
|
-
import { defineTool } from "eve/tools";
|
|
11
|
-
var list_categories_default = defineTool({
|
|
12
|
-
description: "List every Gravity Index category with the number of services in each.",
|
|
13
|
-
inputSchema: z.fromJSONSchema({
|
|
14
|
-
"type": "object",
|
|
15
|
-
"properties": {}
|
|
16
|
-
}),
|
|
17
|
-
async execute(input) {
|
|
18
|
-
return callTool("gravity_index_list_categories", input, extension_default.config);
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
export { list_categories_default as default };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
-
import { dirname as __eveDirname } from "node:path";
|
|
3
|
-
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
-
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
-
__eveDirname(__filename);
|
|
6
|
-
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import extension_default from "../extension.mjs";
|
|
8
|
-
import { callTool } from "../lib/index.mjs";
|
|
9
|
-
import { z } from "zod";
|
|
10
|
-
import { defineTool } from "eve/tools";
|
|
11
|
-
var report_integration_default = defineTool({
|
|
12
|
-
description: "Tell the Gravity Index you finished integrating a service from a previous gravity__search result. Records integration completion without requiring the user to click the setup link. Pass the search_id returned by the earlier search and the slug you actually integrated with.",
|
|
13
|
-
inputSchema: z.fromJSONSchema({
|
|
14
|
-
"type": "object",
|
|
15
|
-
"properties": {
|
|
16
|
-
"search_id": {
|
|
17
|
-
"type": "string",
|
|
18
|
-
"description": "search_id from the earlier gravity__search call"
|
|
19
|
-
},
|
|
20
|
-
"integrated_slug": {
|
|
21
|
-
"type": "string",
|
|
22
|
-
"description": "Slug of the service you integrated, e.g. 'stripe'"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"required": ["search_id", "integrated_slug"]
|
|
26
|
-
}),
|
|
27
|
-
async execute(input) {
|
|
28
|
-
return callTool("gravity_index_report_integration", input, extension_default.config);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
export { report_integration_default as default };
|