neuron-inspector 0.1.2 → 0.2.1
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 +31 -0
- package/dist/recipe-tools.d.ts +8 -0
- package/dist/recipe-tools.js +259 -0
- package/dist/recipe-tools.js.map +1 -0
- package/dist/recipes.d.ts +59 -0
- package/dist/recipes.js +306 -0
- package/dist/recipes.js.map +1 -0
- package/dist/server.js +19 -3
- package/dist/server.js.map +1 -1
- package/package.json +6 -4
- package/recipes/job-applicant/agent.md +142 -0
- package/recipes/job-applicant/learnings.md +15 -0
- package/recipes/job-applicant/recipe.yaml +87 -0
- package/recipes/qa-engineer/agent.md +197 -0
- package/recipes/qa-engineer/learnings.md +15 -0
- package/recipes/qa-engineer/recipe.yaml +95 -0
- package/recipes/web-researcher/agent.md +126 -0
- package/recipes/web-researcher/learnings.md +3 -0
- package/recipes/web-researcher/recipe.yaml +69 -0
package/README.md
CHANGED
|
@@ -220,6 +220,36 @@ The agent calls `neuron_perf_snapshot` and gets back Core Web Vitals, render-blo
|
|
|
220
220
|
|
|
221
221
|
---
|
|
222
222
|
|
|
223
|
+
## Recipes — purpose-built agents
|
|
224
|
+
|
|
225
|
+
The 51 tools are primitives. A **recipe** turns them into a purpose-built agent — a QA engineer, a job applicant, a web researcher. Recipes are shareable, and they get better with every run.
|
|
226
|
+
|
|
227
|
+
### Built-in recipes
|
|
228
|
+
|
|
229
|
+
| Recipe | What it does |
|
|
230
|
+
|--------|-------------|
|
|
231
|
+
| **[Web Researcher](recipes/web-researcher/)** | Deep-dives into topics, cross-references sources, produces reports with citations |
|
|
232
|
+
| **[Job Applicant](recipes/job-applicant/)** | Searches job boards, evaluates fit, writes cover letters, fills forms, tracks outcomes |
|
|
233
|
+
| **[QA Engineer](recipes/qa-engineer/)** | Tests web apps — finds bugs, checks a11y, audits security, builds regression suites |
|
|
234
|
+
|
|
235
|
+
### How recipes work
|
|
236
|
+
|
|
237
|
+
A recipe is a folder with instructions (`agent.md`) and config (`recipe.yaml`). The instructions tell the AI *how* to use the browser tools for a specific purpose. The config declares variables you fill in (your resume, your target URL, your preferences).
|
|
238
|
+
|
|
239
|
+
**Recipes are alive.** Each run captures outcomes to `memory/`. After enough runs, the agent reviews what worked and updates its own strategy in `learnings.md`. A job applicant that discovers technical-tone cover letters get 3x more responses will start writing technical-tone cover letters by default.
|
|
240
|
+
|
|
241
|
+
**Recipes feed each other.** The web researcher produces reports that the job applicant reads to tailor cover letters. The QA engineer reads its own previous reports to re-check if old bugs are fixed. Output from one recipe is input to another.
|
|
242
|
+
|
|
243
|
+
### Use a recipe
|
|
244
|
+
|
|
245
|
+
Copy a recipe's `agent.md` into your project as a CLAUDE.md (or append it), fill in the `{{variables}}` from `recipe.yaml`, and run. The recipe tells your AI agent exactly how to use the 51 tools for that purpose.
|
|
246
|
+
|
|
247
|
+
### Build your own
|
|
248
|
+
|
|
249
|
+
See [RECIPE-SPEC.md](RECIPE-SPEC.md) for the full format. The core idea: write the instructions you'd give a skilled human, reference the tools by name, add reflect/evolve sections so the agent improves itself, and declare your variables so others can import and customize.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
223
253
|
## Requirements
|
|
224
254
|
|
|
225
255
|
- Node.js 18+
|
|
@@ -230,6 +260,7 @@ The agent calls `neuron_perf_snapshot` and gets back Core Web Vitals, render-blo
|
|
|
230
260
|
|
|
231
261
|
- **Extension download:** [neuron.ng/extension](https://neuron.ng/extension)
|
|
232
262
|
- **npm:** [npmjs.com/package/neuron-inspector](https://www.npmjs.com/package/neuron-inspector)
|
|
263
|
+
- **Recipe spec:** [RECIPE-SPEC.md](RECIPE-SPEC.md)
|
|
233
264
|
|
|
234
265
|
## License
|
|
235
266
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recipe MCP tools — same ToolDef shape as browser tools so they register
|
|
3
|
+
* through the same mcp.tool() overload. Handled locally (no extension needed).
|
|
4
|
+
*/
|
|
5
|
+
import type { ToolDef } from "./tools.js";
|
|
6
|
+
export declare const RECIPE_TOOLS: ToolDef[];
|
|
7
|
+
/** Handle a recipe tool call locally (no extension needed). */
|
|
8
|
+
export declare function handleRecipeTool(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recipe MCP tools — same ToolDef shape as browser tools so they register
|
|
3
|
+
* through the same mcp.tool() overload. Handled locally (no extension needed).
|
|
4
|
+
*/
|
|
5
|
+
import * as recipes from "./recipes.js";
|
|
6
|
+
/** Track the active recipe so neuron_recipe_complete knows what to log. */
|
|
7
|
+
let activeRecipe = null;
|
|
8
|
+
export const RECIPE_TOOLS = [
|
|
9
|
+
{
|
|
10
|
+
name: "neuron_recipe_run",
|
|
11
|
+
description: "Start a recipe run. Loads the recipe's agent.md with variables interpolated, its learnings, and resolved variables (auto-filled from profile). Returns everything the AI needs to execute the recipe. Call neuron_recipe_complete when done to auto-log the outcome to memory.",
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
slug: { type: "string", description: "Recipe slug (e.g. 'web-researcher', 'qa-engineer')" },
|
|
16
|
+
variables: { type: "object", description: "Variable overrides — keys matching recipe.yaml variable names. Merged on top of profile defaults." },
|
|
17
|
+
},
|
|
18
|
+
required: ["slug"],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "neuron_recipe_complete",
|
|
23
|
+
description: "End a recipe run started with neuron_recipe_run. Logs the outcome to the recipe's memory automatically. Provide the outcome data matching the recipe's Reflect section. If the recipe has 5+ memory entries, also return the learnings so the evolve phase can update strategy.",
|
|
24
|
+
inputSchema: {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
outcome: { type: "object", description: "Run outcome — structure varies per recipe, see the Reflect section in agent.md" },
|
|
28
|
+
updated_learnings: { type: "string", description: "If you ran the evolve phase, provide the updated learnings.md content here to persist it" },
|
|
29
|
+
},
|
|
30
|
+
required: ["outcome"],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "neuron_recipe_list",
|
|
35
|
+
description: "List all available recipes (bundled + user-installed). Shows name, description, whether it has accumulated learnings, and run count.",
|
|
36
|
+
inputSchema: { type: "object", properties: {} },
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "neuron_recipe_get",
|
|
40
|
+
description: "Get a recipe's full contents — agent instructions (agent.md), configuration (recipe.yaml), accumulated learnings, and variable definitions. Use this to understand what a recipe does before running it.",
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: "object",
|
|
43
|
+
properties: {
|
|
44
|
+
slug: { type: "string", description: "Recipe slug (e.g. 'web-researcher', 'qa-engineer')" },
|
|
45
|
+
},
|
|
46
|
+
required: ["slug"],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "neuron_recipe_create",
|
|
51
|
+
description: "Create a new recipe from scratch. Provide the slug, name, description, agent instructions (agent.md content with Strategy/Reflect/Evolve sections), and configuration (recipe.yaml content with variables/tools/pipes/limits). Saved to ~/.neuron/recipes/<slug>/.",
|
|
52
|
+
inputSchema: {
|
|
53
|
+
type: "object",
|
|
54
|
+
properties: {
|
|
55
|
+
slug: { type: "string", description: "URL-safe identifier (e.g. 'grant-scraper')" },
|
|
56
|
+
name: { type: "string", description: "Display name" },
|
|
57
|
+
description: { type: "string", description: "One-line description" },
|
|
58
|
+
agent_md: { type: "string", description: "Full agent.md content — strategy, reflect, evolve sections" },
|
|
59
|
+
recipe_yaml: { type: "string", description: "Full recipe.yaml content — variables, tools, pipes, limits" },
|
|
60
|
+
},
|
|
61
|
+
required: ["slug", "name", "description", "agent_md", "recipe_yaml"],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "neuron_recipe_update",
|
|
66
|
+
description: "Update a recipe's agent instructions, learnings, or configuration. If updating a bundled recipe, it's forked to ~/.neuron/recipes/ first. Use this after the evolve phase to persist improved strategy.",
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: "object",
|
|
69
|
+
properties: {
|
|
70
|
+
slug: { type: "string", description: "Recipe slug" },
|
|
71
|
+
agent_md: { type: "string", description: "Updated agent.md content" },
|
|
72
|
+
learnings: { type: "string", description: "Updated learnings.md content" },
|
|
73
|
+
recipe_yaml: { type: "string", description: "Updated recipe.yaml content" },
|
|
74
|
+
},
|
|
75
|
+
required: ["slug"],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "neuron_recipe_log",
|
|
80
|
+
description: "Log a run outcome to a recipe's memory. Each entry captures what happened — success/failure, sources found, dead ends, quality score. The recipe's evolve phase reads these to improve its strategy.",
|
|
81
|
+
inputSchema: {
|
|
82
|
+
type: "object",
|
|
83
|
+
properties: {
|
|
84
|
+
slug: { type: "string", description: "Recipe slug" },
|
|
85
|
+
entry: { type: "object", description: "Run outcome data — structure varies per recipe, see the Reflect section in agent.md" },
|
|
86
|
+
},
|
|
87
|
+
required: ["slug", "entry"],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "neuron_recipe_memory",
|
|
92
|
+
description: "Read a recipe's run history — the outcomes captured by neuron_recipe_log. Returns the most recent entries. Use during the evolve phase to analyze what's working and what's not.",
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
slug: { type: "string", description: "Recipe slug" },
|
|
97
|
+
limit: { type: "number", description: "Max entries to return (default: 20)" },
|
|
98
|
+
},
|
|
99
|
+
required: ["slug"],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "neuron_recipe_import",
|
|
104
|
+
description: "Import a recipe from GitHub or a local path. GitHub: 'github:user/repo' imports all recipes from the repo's recipes/ subdir. Local: absolute path to a folder with recipe.yaml. Saved to ~/.neuron/recipes/. Memory is stripped on import (local-only).",
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: "object",
|
|
107
|
+
properties: {
|
|
108
|
+
source: { type: "string", description: "GitHub repo (github:user/repo) or absolute local path to recipe folder" },
|
|
109
|
+
},
|
|
110
|
+
required: ["source"],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "neuron_recipe_export",
|
|
115
|
+
description: "Export a recipe's shareable contents — agent.md, recipe.yaml, and optionally learnings. The recipient imports this with neuron_recipe_import. Memory (run history) is never exported.",
|
|
116
|
+
inputSchema: {
|
|
117
|
+
type: "object",
|
|
118
|
+
properties: {
|
|
119
|
+
slug: { type: "string", description: "Recipe slug" },
|
|
120
|
+
include_learnings: { type: "boolean", description: "Include accumulated learnings (default: true)" },
|
|
121
|
+
},
|
|
122
|
+
required: ["slug"],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "neuron_recipe_delete",
|
|
127
|
+
description: "Delete a user-installed recipe and all its memory/learnings. Bundled recipes cannot be deleted.",
|
|
128
|
+
inputSchema: {
|
|
129
|
+
type: "object",
|
|
130
|
+
properties: {
|
|
131
|
+
slug: { type: "string", description: "Recipe slug to delete" },
|
|
132
|
+
},
|
|
133
|
+
required: ["slug"],
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "neuron_profile_get",
|
|
138
|
+
description: "Read the user's profile (~/.neuron/profile.yaml). Profiles auto-fill recipe variables — name, email, location, tone, timezone, etc.",
|
|
139
|
+
inputSchema: { type: "object", properties: {} },
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "neuron_profile_save",
|
|
143
|
+
description: "Save or update the user's profile (~/.neuron/profile.yaml). Common fields: name, email, location, timezone, tone, linkedin, github. Recipe variables with matching keys are auto-filled from this profile.",
|
|
144
|
+
inputSchema: {
|
|
145
|
+
type: "object",
|
|
146
|
+
properties: {
|
|
147
|
+
data: { type: "object", description: "Profile key-value pairs (e.g. {name: 'Jane', email: 'jane@co.com', timezone: 'US/Eastern'})" },
|
|
148
|
+
},
|
|
149
|
+
required: ["data"],
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
];
|
|
153
|
+
/** Handle a recipe tool call locally (no extension needed). */
|
|
154
|
+
export async function handleRecipeTool(name, args) {
|
|
155
|
+
switch (name) {
|
|
156
|
+
case "neuron_recipe_run": {
|
|
157
|
+
const slug = args.slug;
|
|
158
|
+
const recipe = recipes.getRecipe(slug);
|
|
159
|
+
if (!recipe)
|
|
160
|
+
throw new Error(`Recipe "${slug}" not found.`);
|
|
161
|
+
// Merge user-provided variables on top of profile-resolved defaults
|
|
162
|
+
const userVars = args.variables ?? {};
|
|
163
|
+
const resolved = { ...recipe.resolved_variables, ...userVars };
|
|
164
|
+
// Interpolate variables into agent.md
|
|
165
|
+
let instructions = recipe.agent_md;
|
|
166
|
+
for (const [key, value] of Object.entries(resolved)) {
|
|
167
|
+
instructions = instructions.replaceAll(`{{${key}}}`, String(value ?? ""));
|
|
168
|
+
}
|
|
169
|
+
// Track active run
|
|
170
|
+
activeRecipe = { slug, startedAt: new Date().toISOString(), variables: resolved };
|
|
171
|
+
// Get memory stats for evolve hint
|
|
172
|
+
const memory = recipes.getMemory(slug, 1);
|
|
173
|
+
const shouldEvolve = memory.total >= 5;
|
|
174
|
+
return {
|
|
175
|
+
recipe: recipe.meta.name,
|
|
176
|
+
slug,
|
|
177
|
+
instructions,
|
|
178
|
+
learnings: recipe.learnings,
|
|
179
|
+
resolved_variables: resolved,
|
|
180
|
+
unfilled_variables: Object.entries(recipe.variables)
|
|
181
|
+
.filter(([key]) => !(key in resolved) || resolved[key] === undefined || resolved[key] === "")
|
|
182
|
+
.map(([key, def]) => ({ key, ...def })),
|
|
183
|
+
memory_count: memory.total,
|
|
184
|
+
evolve_hint: shouldEvolve
|
|
185
|
+
? `This recipe has ${memory.total} past runs. After completing this run, read memory with neuron_recipe_memory, analyze patterns, and update learnings with neuron_recipe_complete (include updated_learnings).`
|
|
186
|
+
: null,
|
|
187
|
+
pipes: recipe.recipe_yaml.includes("inputs:")
|
|
188
|
+
? "This recipe has input pipes — check resolved_variables for data from other recipes."
|
|
189
|
+
: null,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
case "neuron_recipe_complete": {
|
|
193
|
+
if (!activeRecipe)
|
|
194
|
+
throw new Error("No active recipe run. Call neuron_recipe_run first.");
|
|
195
|
+
const { slug, startedAt, variables } = activeRecipe;
|
|
196
|
+
const outcome = args.outcome ?? {};
|
|
197
|
+
// Auto-log memory
|
|
198
|
+
const entry = {
|
|
199
|
+
started_at: startedAt,
|
|
200
|
+
completed_at: new Date().toISOString(),
|
|
201
|
+
variables_used: variables,
|
|
202
|
+
...outcome,
|
|
203
|
+
};
|
|
204
|
+
const memResult = recipes.logMemory(slug, entry);
|
|
205
|
+
// Persist updated learnings if provided (evolve phase)
|
|
206
|
+
const updatedLearnings = args.updated_learnings;
|
|
207
|
+
if (updatedLearnings) {
|
|
208
|
+
recipes.updateRecipe(slug, { learnings: updatedLearnings });
|
|
209
|
+
}
|
|
210
|
+
// Get updated memory count
|
|
211
|
+
const memory = recipes.getMemory(slug, 1);
|
|
212
|
+
activeRecipe = null;
|
|
213
|
+
return {
|
|
214
|
+
logged_to: memResult.path,
|
|
215
|
+
total_runs: memory.total,
|
|
216
|
+
learnings_updated: !!updatedLearnings,
|
|
217
|
+
next_evolve_at: memory.total < 5 ? `${5 - memory.total} more runs until first evolve` : "Ready to evolve — review memory and update learnings on next run",
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
case "neuron_recipe_list":
|
|
221
|
+
return recipes.listRecipes();
|
|
222
|
+
case "neuron_recipe_get": {
|
|
223
|
+
const result = recipes.getRecipe(args.slug);
|
|
224
|
+
if (!result)
|
|
225
|
+
throw new Error(`Recipe "${args.slug}" not found.`);
|
|
226
|
+
return result;
|
|
227
|
+
}
|
|
228
|
+
case "neuron_recipe_create":
|
|
229
|
+
return recipes.createRecipe(args.slug, args.name, args.description, args.agent_md, args.recipe_yaml);
|
|
230
|
+
case "neuron_recipe_update":
|
|
231
|
+
return recipes.updateRecipe(args.slug, {
|
|
232
|
+
agent_md: args.agent_md,
|
|
233
|
+
learnings: args.learnings,
|
|
234
|
+
recipe_yaml: args.recipe_yaml,
|
|
235
|
+
});
|
|
236
|
+
case "neuron_recipe_log":
|
|
237
|
+
return recipes.logMemory(args.slug, args.entry);
|
|
238
|
+
case "neuron_recipe_memory":
|
|
239
|
+
return recipes.getMemory(args.slug, args.limit || 20);
|
|
240
|
+
case "neuron_recipe_import":
|
|
241
|
+
return recipes.importRecipe(args.source);
|
|
242
|
+
case "neuron_recipe_export":
|
|
243
|
+
return recipes.exportRecipe(args.slug, args.include_learnings ?? true);
|
|
244
|
+
case "neuron_recipe_delete":
|
|
245
|
+
recipes.deleteRecipe(args.slug);
|
|
246
|
+
return { deleted: args.slug };
|
|
247
|
+
case "neuron_profile_get": {
|
|
248
|
+
const profile = recipes.getProfile();
|
|
249
|
+
if (!profile)
|
|
250
|
+
return { message: "No profile found. Create one with neuron_profile_save." };
|
|
251
|
+
return profile;
|
|
252
|
+
}
|
|
253
|
+
case "neuron_profile_save":
|
|
254
|
+
return recipes.saveProfile(args.data);
|
|
255
|
+
default:
|
|
256
|
+
throw new Error(`Unknown recipe tool: ${name}`);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=recipe-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipe-tools.js","sourceRoot":"","sources":["../src/recipe-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,2EAA2E;AAC3E,IAAI,YAAY,GAAmF,IAAI,CAAC;AAExG,MAAM,CAAC,MAAM,YAAY,GAAc;IACrC;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,gRAAgR;QA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AC,wBAAwB,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recipe manager — list, read, create, import, export, and log memory
|
|
3
|
+
* for self-improving agent recipes. All file operations are local.
|
|
4
|
+
*/
|
|
5
|
+
interface RecipeSummary {
|
|
6
|
+
name: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
version: string;
|
|
9
|
+
description: string;
|
|
10
|
+
author: string;
|
|
11
|
+
tags: string[];
|
|
12
|
+
location: "bundled" | "user";
|
|
13
|
+
path: string;
|
|
14
|
+
has_learnings: boolean;
|
|
15
|
+
has_memory: boolean;
|
|
16
|
+
memory_count: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function listRecipes(): RecipeSummary[];
|
|
19
|
+
export declare function getRecipe(slug: string): {
|
|
20
|
+
meta: RecipeSummary;
|
|
21
|
+
agent_md: string;
|
|
22
|
+
recipe_yaml: string;
|
|
23
|
+
learnings: string | null;
|
|
24
|
+
variables: Record<string, unknown>;
|
|
25
|
+
profile: Record<string, unknown> | null;
|
|
26
|
+
resolved_variables: Record<string, unknown>;
|
|
27
|
+
} | null;
|
|
28
|
+
export declare function createRecipe(slug: string, name: string, description: string, agentMd: string, recipeYaml: string): {
|
|
29
|
+
path: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function updateRecipe(slug: string, updates: {
|
|
32
|
+
agent_md?: string;
|
|
33
|
+
learnings?: string;
|
|
34
|
+
recipe_yaml?: string;
|
|
35
|
+
}): {
|
|
36
|
+
path: string;
|
|
37
|
+
};
|
|
38
|
+
export declare function logMemory(slug: string, entry: Record<string, unknown>): {
|
|
39
|
+
path: string;
|
|
40
|
+
};
|
|
41
|
+
export declare function getMemory(slug: string, limit?: number): {
|
|
42
|
+
entries: Record<string, unknown>[];
|
|
43
|
+
total: number;
|
|
44
|
+
};
|
|
45
|
+
export declare function importRecipe(source: string): {
|
|
46
|
+
slug: string;
|
|
47
|
+
path: string;
|
|
48
|
+
};
|
|
49
|
+
export declare function exportRecipe(slug: string, includeLearnings?: boolean): {
|
|
50
|
+
agent_md: string;
|
|
51
|
+
recipe_yaml: string;
|
|
52
|
+
learnings: string | null;
|
|
53
|
+
};
|
|
54
|
+
export declare function deleteRecipe(slug: string): void;
|
|
55
|
+
export declare function getProfile(): Record<string, unknown> | null;
|
|
56
|
+
export declare function saveProfile(data: Record<string, string>): {
|
|
57
|
+
path: string;
|
|
58
|
+
};
|
|
59
|
+
export {};
|