neuron-inspector 0.8.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/README.md +345 -42
- package/dist/automations/executor.d.ts +21 -0
- package/dist/automations/executor.js +835 -0
- package/dist/automations/executor.js.map +1 -0
- package/dist/automations/index.d.ts +7 -0
- package/dist/automations/index.js +21 -0
- package/dist/automations/index.js.map +1 -0
- package/dist/automations/store.d.ts +15 -0
- package/dist/automations/store.js +193 -0
- package/dist/automations/store.js.map +1 -0
- package/dist/automations/tools.d.ts +14 -0
- package/dist/automations/tools.js +735 -0
- package/dist/automations/tools.js.map +1 -0
- package/dist/automations/types.d.ts +211 -0
- package/dist/automations/types.js +4 -0
- package/dist/automations/types.js.map +1 -0
- package/dist/business-tools.d.ts +17 -0
- package/dist/business-tools.js +3065 -0
- package/dist/business-tools.js.map +1 -0
- package/dist/collections/__tests__/assertions.test.js +203 -0
- package/dist/collections/__tests__/assertions.test.js.map +1 -0
- package/dist/collections/__tests__/dynamic-vars.test.d.ts +1 -0
- package/dist/collections/__tests__/dynamic-vars.test.js +169 -0
- package/dist/collections/__tests__/dynamic-vars.test.js.map +1 -0
- package/dist/collections/__tests__/execution.test.d.ts +1 -0
- package/dist/collections/__tests__/execution.test.js +271 -0
- package/dist/collections/__tests__/execution.test.js.map +1 -0
- package/dist/collections/__tests__/integration.test.d.ts +1 -0
- package/dist/collections/__tests__/integration.test.js +478 -0
- package/dist/collections/__tests__/integration.test.js.map +1 -0
- package/dist/collections/__tests__/resolver.test.d.ts +1 -0
- package/dist/collections/__tests__/resolver.test.js +282 -0
- package/dist/collections/__tests__/resolver.test.js.map +1 -0
- package/dist/collections/__tests__/scenario.test.d.ts +1 -0
- package/dist/collections/__tests__/scenario.test.js +367 -0
- package/dist/collections/__tests__/scenario.test.js.map +1 -0
- package/dist/collections/__tests__/scripts.test.d.ts +1 -0
- package/dist/collections/__tests__/scripts.test.js +245 -0
- package/dist/collections/__tests__/scripts.test.js.map +1 -0
- package/dist/collections/__tests__/store.test.d.ts +1 -0
- package/dist/collections/__tests__/store.test.js +313 -0
- package/dist/collections/__tests__/store.test.js.map +1 -0
- package/dist/collections/assertions.d.ts +16 -0
- package/dist/collections/assertions.js +107 -0
- package/dist/collections/assertions.js.map +1 -0
- package/dist/collections/dynamic-vars.d.ts +75 -0
- package/dist/collections/dynamic-vars.js +187 -0
- package/dist/collections/dynamic-vars.js.map +1 -0
- package/dist/collections/executor.d.ts +100 -0
- package/dist/collections/executor.js +301 -0
- package/dist/collections/executor.js.map +1 -0
- package/dist/collections/http.d.ts +9 -0
- package/dist/collections/http.js +194 -0
- package/dist/collections/http.js.map +1 -0
- package/dist/collections/index.d.ts +12 -0
- package/dist/collections/index.js +27 -0
- package/dist/collections/index.js.map +1 -0
- package/dist/collections/postman.d.ts +10 -0
- package/dist/collections/postman.js +288 -0
- package/dist/collections/postman.js.map +1 -0
- package/dist/collections/resolver.d.ts +74 -0
- package/dist/collections/resolver.js +330 -0
- package/dist/collections/resolver.js.map +1 -0
- package/dist/collections/scripts.d.ts +20 -0
- package/dist/collections/scripts.js +225 -0
- package/dist/collections/scripts.js.map +1 -0
- package/dist/collections/store.d.ts +68 -0
- package/dist/collections/store.js +507 -0
- package/dist/collections/store.js.map +1 -0
- package/dist/collections/tools.d.ts +8 -0
- package/dist/collections/tools.js +1276 -0
- package/dist/collections/tools.js.map +1 -0
- package/dist/collections/types.d.ts +226 -0
- package/dist/collections/types.js +3 -0
- package/dist/collections/types.js.map +1 -0
- package/dist/compound-tools.js +136 -2
- package/dist/compound-tools.js.map +1 -1
- package/dist/killswitch.d.ts +8 -0
- package/dist/killswitch.js +304 -0
- package/dist/killswitch.js.map +1 -0
- package/dist/monitor.d.ts +36 -2
- package/dist/monitor.js +213 -38
- package/dist/monitor.js.map +1 -1
- package/dist/paths.d.ts +16 -0
- package/dist/paths.js +39 -0
- package/dist/paths.js.map +1 -0
- package/dist/recipe-tools.js +67 -9
- package/dist/recipe-tools.js.map +1 -1
- package/dist/recipes.d.ts +6 -0
- package/dist/recipes.js +83 -8
- package/dist/recipes.js.map +1 -1
- package/dist/resilience.d.ts +112 -0
- package/dist/resilience.js +319 -0
- package/dist/resilience.js.map +1 -0
- package/dist/scheduler.js +4 -8
- package/dist/scheduler.js.map +1 -1
- package/dist/server.js +221 -60
- package/dist/server.js.map +1 -1
- package/dist/session-state.js +2 -2
- package/dist/session-state.js.map +1 -1
- package/dist/tools.js +54 -0
- package/dist/tools.js.map +1 -1
- package/package.json +4 -3
- package/recipes/autopilot/agent.md +316 -0
- package/recipes/autopilot/learnings.md +33 -0
- package/recipes/autopilot/recipe.yaml +96 -0
- package/recipes/inbox-responder/agent.md +268 -0
- package/recipes/inbox-responder/learnings.md +25 -0
- package/recipes/inbox-responder/recipe.yaml +82 -0
- package/recipes/linkedin-job-scraper/agent.md +144 -0
- package/recipes/linkedin-job-scraper/learnings.md +3 -0
- package/recipes/linkedin-job-scraper/recipe.yaml +71 -0
- package/recipes/linkedin-outreach/learnings.md +17 -1
- package/recipes/planner/agent.md +66 -1
- package/recipes/planner/learnings.md +49 -1
- package/recipes/sheets-data-entry/agent.md +166 -0
- package/recipes/sheets-data-entry/learnings.md +3 -0
- package/recipes/sheets-data-entry/recipe.yaml +78 -0
- package/recipes/social-ops/learnings.md +33 -13
- package/recipes/x-job-scraper/agent.md +156 -0
- package/recipes/x-job-scraper/learnings.md +3 -0
- package/recipes/x-job-scraper/recipe.yaml +72 -0
- package/dist/__tests__/correlation.test.js +0 -53
- package/dist/__tests__/correlation.test.js.map +0 -1
- /package/dist/{__tests__/correlation.test.d.ts → collections/__tests__/assertions.test.d.ts} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Collection, CollectionStore, CollectionSummary, Defaults, Endpoint, Folder, ScenarioStep } from "./types.js";
|
|
2
|
+
/** Slugify a string: lowercase, replace non-alphanumeric with hyphens, collapse runs, trim. */
|
|
3
|
+
export declare function slugify(input: string): string;
|
|
4
|
+
/** Generate a human-readable name from method + path. */
|
|
5
|
+
export declare function generateEndpointName(method: string, path: string): string;
|
|
6
|
+
export declare class YamlCollectionStore implements CollectionStore {
|
|
7
|
+
private globalDir;
|
|
8
|
+
private projectDir;
|
|
9
|
+
constructor(globalDir?: string, projectDir?: string);
|
|
10
|
+
private ensureDir;
|
|
11
|
+
private scanDir;
|
|
12
|
+
list(): Promise<CollectionSummary[]>;
|
|
13
|
+
resolve(id: string): Promise<{
|
|
14
|
+
path: string;
|
|
15
|
+
location: "global" | "project";
|
|
16
|
+
} | null>;
|
|
17
|
+
get(id: string): Promise<{
|
|
18
|
+
collection: Collection;
|
|
19
|
+
summary: CollectionSummary;
|
|
20
|
+
} | null>;
|
|
21
|
+
save(id: string, collection: Collection, location?: "global" | "project"): Promise<string>;
|
|
22
|
+
delete(id: string): Promise<boolean>;
|
|
23
|
+
upsertEndpoint(id: string, folderName: string, endpoint: Partial<Endpoint> & {
|
|
24
|
+
method: string;
|
|
25
|
+
path: string;
|
|
26
|
+
}): Promise<{
|
|
27
|
+
action: "created" | "updated";
|
|
28
|
+
collection: Collection;
|
|
29
|
+
}>;
|
|
30
|
+
removeEndpoint(id: string, folderName: string, method: string, path: string): Promise<Collection>;
|
|
31
|
+
moveEndpoint(id: string, fromFolder: string, toFolder: string, method: string, path: string): Promise<Collection>;
|
|
32
|
+
setEnvironment(id: string, envName: string, env: {
|
|
33
|
+
base_url: string;
|
|
34
|
+
variables?: Record<string, string>;
|
|
35
|
+
headers?: Record<string, string>;
|
|
36
|
+
timeout_ms?: number;
|
|
37
|
+
}): Promise<Collection>;
|
|
38
|
+
removeEnvironment(id: string, envName: string): Promise<Collection>;
|
|
39
|
+
switchEnvironment(id: string, envName: string): Promise<Collection>;
|
|
40
|
+
updateMetadata(id: string, updates: {
|
|
41
|
+
name?: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
version?: string;
|
|
44
|
+
}): Promise<Collection>;
|
|
45
|
+
setDefaults(id: string, defaults: Partial<Defaults>): Promise<Collection>;
|
|
46
|
+
createFolder(id: string, folderName: string, meta?: {
|
|
47
|
+
description?: string;
|
|
48
|
+
headers?: Record<string, string>;
|
|
49
|
+
variables?: Record<string, string>;
|
|
50
|
+
auth?: Folder["auth"];
|
|
51
|
+
}): Promise<Collection>;
|
|
52
|
+
updateFolder(id: string, folderName: string, updates: {
|
|
53
|
+
description?: string;
|
|
54
|
+
headers?: Record<string, string>;
|
|
55
|
+
variables?: Record<string, string>;
|
|
56
|
+
auth?: Folder["auth"] | null;
|
|
57
|
+
}): Promise<Collection>;
|
|
58
|
+
deleteFolder(id: string, folderName: string): Promise<Collection>;
|
|
59
|
+
createScenario(id: string, scenarioName: string, scenario: {
|
|
60
|
+
description?: string;
|
|
61
|
+
steps: ScenarioStep[];
|
|
62
|
+
}): Promise<Collection>;
|
|
63
|
+
updateScenario(id: string, scenarioName: string, updates: {
|
|
64
|
+
description?: string;
|
|
65
|
+
steps?: ScenarioStep[];
|
|
66
|
+
}): Promise<Collection>;
|
|
67
|
+
deleteScenario(id: string, scenarioName: string): Promise<Collection>;
|
|
68
|
+
}
|
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { readFile, writeFile, mkdir, readdir, unlink } from "node:fs/promises";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import * as YAML from "yaml";
|
|
5
|
+
import { NEURON_DIR } from "../paths.js";
|
|
6
|
+
// ── Helpers ─────────────────────────────────────────────────────
|
|
7
|
+
/** Slugify a string: lowercase, replace non-alphanumeric with hyphens, collapse runs, trim. */
|
|
8
|
+
export function slugify(input) {
|
|
9
|
+
return input
|
|
10
|
+
.toLowerCase()
|
|
11
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
12
|
+
.replace(/^-+|-+$/g, "");
|
|
13
|
+
}
|
|
14
|
+
/** Count all endpoints across all folders in a collection. */
|
|
15
|
+
function countEndpoints(c) {
|
|
16
|
+
if (!c.folders)
|
|
17
|
+
return 0;
|
|
18
|
+
return Object.values(c.folders).reduce((sum, f) => sum + (f.endpoints?.length ?? 0), 0);
|
|
19
|
+
}
|
|
20
|
+
/** Generate a human-readable name from method + path. */
|
|
21
|
+
export function generateEndpointName(method, path) {
|
|
22
|
+
// Strip variable placeholders and leading/trailing slashes
|
|
23
|
+
const clean = path
|
|
24
|
+
.replace(/\{\{[^}]+\}\}/g, "")
|
|
25
|
+
.replace(/^\/+|\/+$/g, "");
|
|
26
|
+
// Take the last meaningful segment
|
|
27
|
+
const segments = clean.split("/").filter(Boolean);
|
|
28
|
+
const last = segments[segments.length - 1] ?? "root";
|
|
29
|
+
// Title-case method + last segment
|
|
30
|
+
const title = last.replace(/[-_]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
31
|
+
const methodTitle = method.charAt(0).toUpperCase() + method.slice(1).toLowerCase();
|
|
32
|
+
return `${methodTitle} ${title}`.trim();
|
|
33
|
+
}
|
|
34
|
+
/** Validate that an object looks like a Collection. Returns an error message or null. */
|
|
35
|
+
function validateCollection(obj) {
|
|
36
|
+
if (typeof obj !== "object" || obj === null)
|
|
37
|
+
return "Collection must be an object";
|
|
38
|
+
const c = obj;
|
|
39
|
+
if (typeof c.name !== "string" || !c.name)
|
|
40
|
+
return "Collection must have a non-empty 'name' string";
|
|
41
|
+
if (c.folders !== undefined) {
|
|
42
|
+
if (typeof c.folders !== "object" || c.folders === null)
|
|
43
|
+
return "'folders' must be an object";
|
|
44
|
+
for (const [key, folder] of Object.entries(c.folders)) {
|
|
45
|
+
if (typeof folder !== "object" || folder === null)
|
|
46
|
+
return `Folder '${key}' must be an object`;
|
|
47
|
+
const f = folder;
|
|
48
|
+
if (f.endpoints !== undefined && !Array.isArray(f.endpoints)) {
|
|
49
|
+
return `Folder '${key}' endpoints must be an array`;
|
|
50
|
+
}
|
|
51
|
+
if (Array.isArray(f.endpoints)) {
|
|
52
|
+
for (let i = 0; i < f.endpoints.length; i++) {
|
|
53
|
+
const ep = f.endpoints[i];
|
|
54
|
+
if (typeof ep !== "object" || ep === null)
|
|
55
|
+
return `Folder '${key}' endpoint[${i}] must be an object`;
|
|
56
|
+
if (typeof ep.method !== "string")
|
|
57
|
+
return `Folder '${key}' endpoint[${i}] must have a 'method' string`;
|
|
58
|
+
if (typeof ep.path !== "string")
|
|
59
|
+
return `Folder '${key}' endpoint[${i}] must have a 'path' string`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (c.environments !== undefined) {
|
|
65
|
+
if (typeof c.environments !== "object" || c.environments === null)
|
|
66
|
+
return "'environments' must be an object";
|
|
67
|
+
for (const [key, env] of Object.entries(c.environments)) {
|
|
68
|
+
if (typeof env !== "object" || env === null)
|
|
69
|
+
return `Environment '${key}' must be an object`;
|
|
70
|
+
const e = env;
|
|
71
|
+
if (typeof e.base_url !== "string")
|
|
72
|
+
return `Environment '${key}' must have a 'base_url' string`;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (c.scenarios !== undefined) {
|
|
76
|
+
if (typeof c.scenarios !== "object" || c.scenarios === null)
|
|
77
|
+
return "'scenarios' must be an object";
|
|
78
|
+
for (const [key, scenario] of Object.entries(c.scenarios)) {
|
|
79
|
+
if (typeof scenario !== "object" || scenario === null)
|
|
80
|
+
return `Scenario '${key}' must be an object`;
|
|
81
|
+
const s = scenario;
|
|
82
|
+
if (!Array.isArray(s.steps))
|
|
83
|
+
return `Scenario '${key}' must have a 'steps' array`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
// ── YamlCollectionStore ─────────────────────────────────────────
|
|
89
|
+
export class YamlCollectionStore {
|
|
90
|
+
globalDir;
|
|
91
|
+
projectDir;
|
|
92
|
+
constructor(globalDir, projectDir) {
|
|
93
|
+
this.globalDir = globalDir ?? join(NEURON_DIR, "collections");
|
|
94
|
+
this.projectDir = projectDir ?? join(process.cwd(), ".neuron", "collections");
|
|
95
|
+
}
|
|
96
|
+
async ensureDir(dir) {
|
|
97
|
+
if (!existsSync(dir)) {
|
|
98
|
+
await mkdir(dir, { recursive: true });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async scanDir(dir, location) {
|
|
102
|
+
if (!existsSync(dir))
|
|
103
|
+
return [];
|
|
104
|
+
const files = await readdir(dir);
|
|
105
|
+
const results = [];
|
|
106
|
+
for (const file of files) {
|
|
107
|
+
if (!file.endsWith(".yaml") && !file.endsWith(".yml"))
|
|
108
|
+
continue;
|
|
109
|
+
const id = file.replace(/\.(yaml|yml)$/, "");
|
|
110
|
+
const path = join(dir, file);
|
|
111
|
+
try {
|
|
112
|
+
const content = await readFile(path, "utf-8");
|
|
113
|
+
const c = YAML.parse(content);
|
|
114
|
+
if (!c || typeof c.name !== "string")
|
|
115
|
+
continue;
|
|
116
|
+
results.push({
|
|
117
|
+
id,
|
|
118
|
+
name: c.name,
|
|
119
|
+
location,
|
|
120
|
+
path,
|
|
121
|
+
folder_count: c.folders ? Object.keys(c.folders).length : 0,
|
|
122
|
+
endpoint_count: countEndpoints(c),
|
|
123
|
+
environment_count: c.environments ? Object.keys(c.environments).length : 0,
|
|
124
|
+
scenario_count: c.scenarios ? Object.keys(c.scenarios).length : 0,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
// Skip files that can't be parsed
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return results;
|
|
132
|
+
}
|
|
133
|
+
async list() {
|
|
134
|
+
const [global, project] = await Promise.all([
|
|
135
|
+
this.scanDir(this.globalDir, "global"),
|
|
136
|
+
this.scanDir(this.projectDir, "project"),
|
|
137
|
+
]);
|
|
138
|
+
// Project-local wins on name collision
|
|
139
|
+
const seen = new Set();
|
|
140
|
+
const merged = [];
|
|
141
|
+
for (const s of project) {
|
|
142
|
+
seen.add(s.id);
|
|
143
|
+
merged.push(s);
|
|
144
|
+
}
|
|
145
|
+
for (const s of global) {
|
|
146
|
+
if (!seen.has(s.id))
|
|
147
|
+
merged.push(s);
|
|
148
|
+
}
|
|
149
|
+
return merged;
|
|
150
|
+
}
|
|
151
|
+
async resolve(id) {
|
|
152
|
+
// Project-local first
|
|
153
|
+
for (const ext of [".yaml", ".yml"]) {
|
|
154
|
+
const projectPath = join(this.projectDir, `${id}${ext}`);
|
|
155
|
+
if (existsSync(projectPath))
|
|
156
|
+
return { path: projectPath, location: "project" };
|
|
157
|
+
}
|
|
158
|
+
for (const ext of [".yaml", ".yml"]) {
|
|
159
|
+
const globalPath = join(this.globalDir, `${id}${ext}`);
|
|
160
|
+
if (existsSync(globalPath))
|
|
161
|
+
return { path: globalPath, location: "global" };
|
|
162
|
+
}
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
async get(id) {
|
|
166
|
+
const resolved = await this.resolve(id);
|
|
167
|
+
if (!resolved)
|
|
168
|
+
return null;
|
|
169
|
+
const content = await readFile(resolved.path, "utf-8");
|
|
170
|
+
let parsed;
|
|
171
|
+
try {
|
|
172
|
+
parsed = YAML.parse(content);
|
|
173
|
+
}
|
|
174
|
+
catch (e) {
|
|
175
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
176
|
+
throw new Error(`Failed to parse collection '${id}': ${msg}`);
|
|
177
|
+
}
|
|
178
|
+
const err = validateCollection(parsed);
|
|
179
|
+
if (err)
|
|
180
|
+
throw new Error(`Invalid collection '${id}': ${err}`);
|
|
181
|
+
const c = parsed;
|
|
182
|
+
return {
|
|
183
|
+
collection: c,
|
|
184
|
+
summary: {
|
|
185
|
+
id,
|
|
186
|
+
name: c.name,
|
|
187
|
+
location: resolved.location,
|
|
188
|
+
path: resolved.path,
|
|
189
|
+
folder_count: c.folders ? Object.keys(c.folders).length : 0,
|
|
190
|
+
endpoint_count: countEndpoints(c),
|
|
191
|
+
environment_count: c.environments ? Object.keys(c.environments).length : 0,
|
|
192
|
+
scenario_count: c.scenarios ? Object.keys(c.scenarios).length : 0,
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
async save(id, collection, location = "global") {
|
|
197
|
+
const err = validateCollection(collection);
|
|
198
|
+
if (err)
|
|
199
|
+
throw new Error(`Cannot save collection '${id}': ${err}`);
|
|
200
|
+
const dir = location === "project" ? this.projectDir : this.globalDir;
|
|
201
|
+
await this.ensureDir(dir);
|
|
202
|
+
const filePath = join(dir, `${id}.yaml`);
|
|
203
|
+
const content = YAML.stringify(collection, { lineWidth: 120 });
|
|
204
|
+
await writeFile(filePath, content, "utf-8");
|
|
205
|
+
return filePath;
|
|
206
|
+
}
|
|
207
|
+
async delete(id) {
|
|
208
|
+
const resolved = await this.resolve(id);
|
|
209
|
+
if (!resolved)
|
|
210
|
+
return false;
|
|
211
|
+
await unlink(resolved.path);
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
// ── Endpoint operations ─────────────────────────────────────
|
|
215
|
+
async upsertEndpoint(id, folderName, endpoint) {
|
|
216
|
+
const result = await this.get(id);
|
|
217
|
+
if (!result)
|
|
218
|
+
throw new Error(`Collection '${id}' not found`);
|
|
219
|
+
const { collection } = result;
|
|
220
|
+
const folderKey = slugify(folderName);
|
|
221
|
+
if (!collection.folders)
|
|
222
|
+
collection.folders = {};
|
|
223
|
+
if (!collection.folders[folderKey]) {
|
|
224
|
+
collection.folders[folderKey] = { endpoints: [] };
|
|
225
|
+
}
|
|
226
|
+
const folder = collection.folders[folderKey];
|
|
227
|
+
if (!folder.endpoints)
|
|
228
|
+
folder.endpoints = [];
|
|
229
|
+
const method = endpoint.method.toUpperCase();
|
|
230
|
+
const idx = folder.endpoints.findIndex((ep) => ep.method.toUpperCase() === method && ep.path === endpoint.path);
|
|
231
|
+
const full = {
|
|
232
|
+
name: endpoint.name ?? generateEndpointName(method, endpoint.path),
|
|
233
|
+
method,
|
|
234
|
+
path: endpoint.path,
|
|
235
|
+
...(endpoint.description !== undefined && { description: endpoint.description }),
|
|
236
|
+
...(endpoint.headers !== undefined && { headers: endpoint.headers }),
|
|
237
|
+
...(endpoint.cookies !== undefined && { cookies: endpoint.cookies }),
|
|
238
|
+
...(endpoint.body !== undefined && { body: endpoint.body }),
|
|
239
|
+
...(endpoint.body_mode !== undefined && { body_mode: endpoint.body_mode }),
|
|
240
|
+
...(endpoint.variables !== undefined && { variables: endpoint.variables }),
|
|
241
|
+
...(endpoint.tests !== undefined && { tests: endpoint.tests }),
|
|
242
|
+
...(endpoint.extract !== undefined && { extract: endpoint.extract }),
|
|
243
|
+
...(endpoint.pre_request !== undefined && { pre_request: endpoint.pre_request }),
|
|
244
|
+
...(endpoint.post_response !== undefined && { post_response: endpoint.post_response }),
|
|
245
|
+
...(endpoint.auth !== undefined && { auth: endpoint.auth }),
|
|
246
|
+
...(endpoint.tags !== undefined && { tags: endpoint.tags }),
|
|
247
|
+
...(endpoint.timeout_ms !== undefined && { timeout_ms: endpoint.timeout_ms }),
|
|
248
|
+
...(endpoint.settings !== undefined && { settings: endpoint.settings }),
|
|
249
|
+
};
|
|
250
|
+
let action;
|
|
251
|
+
if (idx >= 0) {
|
|
252
|
+
// Merge: keep existing fields, overlay provided ones
|
|
253
|
+
const existing = folder.endpoints[idx];
|
|
254
|
+
folder.endpoints[idx] = { ...existing, ...full };
|
|
255
|
+
action = "updated";
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
folder.endpoints.push(full);
|
|
259
|
+
action = "created";
|
|
260
|
+
}
|
|
261
|
+
const resolved = await this.resolve(id);
|
|
262
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
263
|
+
return { action, collection };
|
|
264
|
+
}
|
|
265
|
+
async removeEndpoint(id, folderName, method, path) {
|
|
266
|
+
const result = await this.get(id);
|
|
267
|
+
if (!result)
|
|
268
|
+
throw new Error(`Collection '${id}' not found`);
|
|
269
|
+
const { collection } = result;
|
|
270
|
+
const folderKey = slugify(folderName);
|
|
271
|
+
const folder = collection.folders?.[folderKey];
|
|
272
|
+
if (!folder?.endpoints)
|
|
273
|
+
throw new Error(`Folder '${folderName}' not found in collection '${id}'`);
|
|
274
|
+
const upperMethod = method.toUpperCase();
|
|
275
|
+
const idx = folder.endpoints.findIndex((ep) => ep.method.toUpperCase() === upperMethod && ep.path === path);
|
|
276
|
+
if (idx < 0) {
|
|
277
|
+
throw new Error(`Endpoint ${method} ${path} not found in folder '${folderName}'`);
|
|
278
|
+
}
|
|
279
|
+
folder.endpoints.splice(idx, 1);
|
|
280
|
+
const resolved = await this.resolve(id);
|
|
281
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
282
|
+
return collection;
|
|
283
|
+
}
|
|
284
|
+
async moveEndpoint(id, fromFolder, toFolder, method, path) {
|
|
285
|
+
const result = await this.get(id);
|
|
286
|
+
if (!result)
|
|
287
|
+
throw new Error(`Collection '${id}' not found`);
|
|
288
|
+
const { collection } = result;
|
|
289
|
+
const fromKey = slugify(fromFolder);
|
|
290
|
+
const toKey = slugify(toFolder);
|
|
291
|
+
const srcFolder = collection.folders?.[fromKey];
|
|
292
|
+
if (!srcFolder?.endpoints) {
|
|
293
|
+
throw new Error(`Source folder '${fromFolder}' not found in collection '${id}'`);
|
|
294
|
+
}
|
|
295
|
+
const upperMethod = method.toUpperCase();
|
|
296
|
+
const idx = srcFolder.endpoints.findIndex((ep) => ep.method.toUpperCase() === upperMethod && ep.path === path);
|
|
297
|
+
if (idx < 0) {
|
|
298
|
+
throw new Error(`Endpoint ${method} ${path} not found in folder '${fromFolder}'`);
|
|
299
|
+
}
|
|
300
|
+
const [endpoint] = srcFolder.endpoints.splice(idx, 1);
|
|
301
|
+
if (!collection.folders)
|
|
302
|
+
collection.folders = {};
|
|
303
|
+
if (!collection.folders[toKey]) {
|
|
304
|
+
collection.folders[toKey] = { endpoints: [] };
|
|
305
|
+
}
|
|
306
|
+
if (!collection.folders[toKey].endpoints) {
|
|
307
|
+
collection.folders[toKey].endpoints = [];
|
|
308
|
+
}
|
|
309
|
+
collection.folders[toKey].endpoints.push(endpoint);
|
|
310
|
+
const resolved = await this.resolve(id);
|
|
311
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
312
|
+
return collection;
|
|
313
|
+
}
|
|
314
|
+
// ── Environment operations ──────────────────────────────────
|
|
315
|
+
async setEnvironment(id, envName, env) {
|
|
316
|
+
const result = await this.get(id);
|
|
317
|
+
if (!result)
|
|
318
|
+
throw new Error(`Collection '${id}' not found`);
|
|
319
|
+
const { collection } = result;
|
|
320
|
+
const envKey = slugify(envName);
|
|
321
|
+
if (!collection.environments)
|
|
322
|
+
collection.environments = {};
|
|
323
|
+
collection.environments[envKey] = env;
|
|
324
|
+
const resolved = await this.resolve(id);
|
|
325
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
326
|
+
return collection;
|
|
327
|
+
}
|
|
328
|
+
async removeEnvironment(id, envName) {
|
|
329
|
+
const result = await this.get(id);
|
|
330
|
+
if (!result)
|
|
331
|
+
throw new Error(`Collection '${id}' not found`);
|
|
332
|
+
const { collection } = result;
|
|
333
|
+
const envKey = slugify(envName);
|
|
334
|
+
if (!collection.environments?.[envKey]) {
|
|
335
|
+
throw new Error(`Environment '${envName}' not found in collection '${id}'`);
|
|
336
|
+
}
|
|
337
|
+
delete collection.environments[envKey];
|
|
338
|
+
if (collection.active_environment === envKey) {
|
|
339
|
+
collection.active_environment = undefined;
|
|
340
|
+
}
|
|
341
|
+
const resolved = await this.resolve(id);
|
|
342
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
343
|
+
return collection;
|
|
344
|
+
}
|
|
345
|
+
async switchEnvironment(id, envName) {
|
|
346
|
+
const result = await this.get(id);
|
|
347
|
+
if (!result)
|
|
348
|
+
throw new Error(`Collection '${id}' not found`);
|
|
349
|
+
const { collection } = result;
|
|
350
|
+
const envKey = slugify(envName);
|
|
351
|
+
if (!collection.environments?.[envKey]) {
|
|
352
|
+
throw new Error(`Environment '${envName}' not found in collection '${id}'`);
|
|
353
|
+
}
|
|
354
|
+
collection.active_environment = envKey;
|
|
355
|
+
const resolved = await this.resolve(id);
|
|
356
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
357
|
+
return collection;
|
|
358
|
+
}
|
|
359
|
+
// ── Collection metadata ────────────────────────────────────
|
|
360
|
+
async updateMetadata(id, updates) {
|
|
361
|
+
const result = await this.get(id);
|
|
362
|
+
if (!result)
|
|
363
|
+
throw new Error(`Collection '${id}' not found`);
|
|
364
|
+
const { collection } = result;
|
|
365
|
+
if (updates.name !== undefined)
|
|
366
|
+
collection.name = updates.name;
|
|
367
|
+
if (updates.description !== undefined)
|
|
368
|
+
collection.description = updates.description || undefined;
|
|
369
|
+
if (updates.version !== undefined)
|
|
370
|
+
collection.version = updates.version || undefined;
|
|
371
|
+
const resolved = await this.resolve(id);
|
|
372
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
373
|
+
return collection;
|
|
374
|
+
}
|
|
375
|
+
// ── Defaults operations ────────────────────────────────────
|
|
376
|
+
async setDefaults(id, defaults) {
|
|
377
|
+
const result = await this.get(id);
|
|
378
|
+
if (!result)
|
|
379
|
+
throw new Error(`Collection '${id}' not found`);
|
|
380
|
+
const { collection } = result;
|
|
381
|
+
if (!collection.defaults)
|
|
382
|
+
collection.defaults = {};
|
|
383
|
+
Object.assign(collection.defaults, defaults);
|
|
384
|
+
// Clean undefined keys
|
|
385
|
+
for (const key of Object.keys(collection.defaults)) {
|
|
386
|
+
if (collection.defaults[key] === undefined || collection.defaults[key] === null) {
|
|
387
|
+
delete collection.defaults[key];
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
if (Object.keys(collection.defaults).length === 0) {
|
|
391
|
+
collection.defaults = undefined;
|
|
392
|
+
}
|
|
393
|
+
const resolved = await this.resolve(id);
|
|
394
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
395
|
+
return collection;
|
|
396
|
+
}
|
|
397
|
+
// ── Folder operations ──────────────────────────────────────
|
|
398
|
+
async createFolder(id, folderName, meta) {
|
|
399
|
+
const result = await this.get(id);
|
|
400
|
+
if (!result)
|
|
401
|
+
throw new Error(`Collection '${id}' not found`);
|
|
402
|
+
const { collection } = result;
|
|
403
|
+
const folderKey = slugify(folderName);
|
|
404
|
+
if (!collection.folders)
|
|
405
|
+
collection.folders = {};
|
|
406
|
+
if (collection.folders[folderKey]) {
|
|
407
|
+
throw new Error(`Folder '${folderName}' already exists in collection '${id}'`);
|
|
408
|
+
}
|
|
409
|
+
const folder = { endpoints: [] };
|
|
410
|
+
if (meta?.description)
|
|
411
|
+
folder.description = meta.description;
|
|
412
|
+
if (meta?.headers && Object.keys(meta.headers).length)
|
|
413
|
+
folder.headers = meta.headers;
|
|
414
|
+
if (meta?.variables && Object.keys(meta.variables).length)
|
|
415
|
+
folder.variables = meta.variables;
|
|
416
|
+
if (meta?.auth)
|
|
417
|
+
folder.auth = meta.auth;
|
|
418
|
+
collection.folders[folderKey] = folder;
|
|
419
|
+
const resolved = await this.resolve(id);
|
|
420
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
421
|
+
return collection;
|
|
422
|
+
}
|
|
423
|
+
async updateFolder(id, folderName, updates) {
|
|
424
|
+
const result = await this.get(id);
|
|
425
|
+
if (!result)
|
|
426
|
+
throw new Error(`Collection '${id}' not found`);
|
|
427
|
+
const { collection } = result;
|
|
428
|
+
const folderKey = slugify(folderName);
|
|
429
|
+
const folder = collection.folders?.[folderKey];
|
|
430
|
+
if (!folder)
|
|
431
|
+
throw new Error(`Folder '${folderName}' not found in collection '${id}'`);
|
|
432
|
+
if (updates.description !== undefined)
|
|
433
|
+
folder.description = updates.description || undefined;
|
|
434
|
+
if (updates.headers !== undefined)
|
|
435
|
+
folder.headers = Object.keys(updates.headers).length ? updates.headers : undefined;
|
|
436
|
+
if (updates.variables !== undefined)
|
|
437
|
+
folder.variables = Object.keys(updates.variables).length ? updates.variables : undefined;
|
|
438
|
+
if (updates.auth !== undefined)
|
|
439
|
+
folder.auth = updates.auth === null ? undefined : updates.auth;
|
|
440
|
+
const resolved = await this.resolve(id);
|
|
441
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
442
|
+
return collection;
|
|
443
|
+
}
|
|
444
|
+
async deleteFolder(id, folderName) {
|
|
445
|
+
const result = await this.get(id);
|
|
446
|
+
if (!result)
|
|
447
|
+
throw new Error(`Collection '${id}' not found`);
|
|
448
|
+
const { collection } = result;
|
|
449
|
+
const folderKey = slugify(folderName);
|
|
450
|
+
if (!collection.folders?.[folderKey]) {
|
|
451
|
+
throw new Error(`Folder '${folderName}' not found in collection '${id}'`);
|
|
452
|
+
}
|
|
453
|
+
delete collection.folders[folderKey];
|
|
454
|
+
const resolved = await this.resolve(id);
|
|
455
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
456
|
+
return collection;
|
|
457
|
+
}
|
|
458
|
+
// ── Scenario operations ────────────────────────────────────
|
|
459
|
+
async createScenario(id, scenarioName, scenario) {
|
|
460
|
+
const result = await this.get(id);
|
|
461
|
+
if (!result)
|
|
462
|
+
throw new Error(`Collection '${id}' not found`);
|
|
463
|
+
const { collection } = result;
|
|
464
|
+
if (!collection.scenarios)
|
|
465
|
+
collection.scenarios = {};
|
|
466
|
+
if (collection.scenarios[scenarioName]) {
|
|
467
|
+
throw new Error(`Scenario '${scenarioName}' already exists in collection '${id}'`);
|
|
468
|
+
}
|
|
469
|
+
const s = { steps: scenario.steps };
|
|
470
|
+
if (scenario.description)
|
|
471
|
+
s.description = scenario.description;
|
|
472
|
+
collection.scenarios[scenarioName] = s;
|
|
473
|
+
const resolved = await this.resolve(id);
|
|
474
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
475
|
+
return collection;
|
|
476
|
+
}
|
|
477
|
+
async updateScenario(id, scenarioName, updates) {
|
|
478
|
+
const result = await this.get(id);
|
|
479
|
+
if (!result)
|
|
480
|
+
throw new Error(`Collection '${id}' not found`);
|
|
481
|
+
const { collection } = result;
|
|
482
|
+
const scenario = collection.scenarios?.[scenarioName];
|
|
483
|
+
if (!scenario)
|
|
484
|
+
throw new Error(`Scenario '${scenarioName}' not found in collection '${id}'`);
|
|
485
|
+
if (updates.description !== undefined)
|
|
486
|
+
scenario.description = updates.description || undefined;
|
|
487
|
+
if (updates.steps !== undefined)
|
|
488
|
+
scenario.steps = updates.steps;
|
|
489
|
+
const resolved = await this.resolve(id);
|
|
490
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
491
|
+
return collection;
|
|
492
|
+
}
|
|
493
|
+
async deleteScenario(id, scenarioName) {
|
|
494
|
+
const result = await this.get(id);
|
|
495
|
+
if (!result)
|
|
496
|
+
throw new Error(`Collection '${id}' not found`);
|
|
497
|
+
const { collection } = result;
|
|
498
|
+
if (!collection.scenarios?.[scenarioName]) {
|
|
499
|
+
throw new Error(`Scenario '${scenarioName}' not found in collection '${id}'`);
|
|
500
|
+
}
|
|
501
|
+
delete collection.scenarios[scenarioName];
|
|
502
|
+
const resolved = await this.resolve(id);
|
|
503
|
+
await this.save(id, collection, resolved?.location ?? "global");
|
|
504
|
+
return collection;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/collections/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAYzC,mEAAmE;AAEnE,+FAA+F;AAC/F,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,OAAO,KAAK;SACT,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE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AAC,CAAC;QACxC,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,IAAI,QAAQ,CAAC,CAAC;QAChE,OAAO,UAAU,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CollectionStore, HttpExecutor, ResolverStep, AssertionEvaluator, ScriptRunner } from "./types.js";
|
|
2
|
+
export interface CollectionToolDef {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export declare function buildCollectionTools(): CollectionToolDef[];
|
|
8
|
+
export declare function buildCollectionHandler(store: CollectionStore, httpExecutor?: HttpExecutor, pipeline?: ResolverStep[], assertionEvaluator?: AssertionEvaluator, scriptRunner?: ScriptRunner): (name: string, args: Record<string, unknown>) => Promise<unknown>;
|