Recipes
@puddleworks/recipesv2026.11.10.1
01README
Answers a phrasing with one swamp method call: a recipe is a regex, the extension method it runs and how the data is shown as text. match finds the recipe, execute runs it, or asks first if the extension makes changes, and confirm runs it after a yes.
02Behaviors
@puddleworks/recipesv2026.11.10.1recipes.ts
fn match(text: string, repoDir?: string, sessionId?: string)
Find the recipe that answers a text; store `match`.
| Argument | Type | Description |
|---|---|---|
| text | string | The text to find a recipe for. |
| repoDir? | string | The swamp repo; its puddlerouter.yaml adds allowlist entries and recipes. |
| sessionId? | string | The caller's session; if given and the text is not a yes, drops the session's plan. |
fn execute(recipeId: string, captures?: array, repoDir?: string, sessionId?: string, mode?: enum)
Run a read recipe, or store a plan and ask for a write one; store `result`.
| Argument | Type | Description |
|---|---|---|
| recipeId | string | |
| captures? | array | |
| repoDir? | string | The swamp repo the recipe's extension is pulled into. |
| sessionId? | string | The caller's session; a write recipe's plan is kept under it. |
| mode? | enum | shadow: a write recipe says it would ask, and stores nothing to run. |
fn confirm(sessionId: string, text: string, repoDir?: string)
Run the session's plan once if the text is only a yes; any other text drops it. Store `result`.
| Argument | Type | Description |
|---|---|---|
| sessionId | string | The session the plan was made in. |
| text | string | The session's next turn; only a bare yes, y or go runs the plan. |
| repoDir? | string | The swamp repo the recipe's extension is pulled into. |
fn sync(repoDir?: string)
Pull the recipe packs the allowlist covers and store their recipes as `recipeIndex`.
| Argument | Type | Description |
|---|---|---|
| repoDir? | string | The swamp repo the packs are pulled into; its puddlerouter.yaml sets the allowlist. |
Resources
match(infinite)— The recipe that matched the last text, if any.
result(infinite)— The last recipe's answer.
recipeIndex(infinite)— The recipes of the synced packs; `sync` writes it.
resultCache(1d)— Answers kept for a recipe's `cacheFor`.
plan(1d)— A write recipe waiting for one yes, one instance per session.
03Workflows
@puddleworks/recipes-sync791214a1-9761-4a0e-b5a3-44f2174f1f5f
Pull the recipe packs (extensions labelled puddlerouter-recipe) that the allowlist covers and store their recipes as the recipeIndex that the recipes model's match and execute methods read. match never pulls, so a fresh checkout answers from packs only after this has run once. The schedule only fires under swamp serve; otherwise run it by hand. An index older than a day is still used.
main
1.syncrecipes.sync— Pull the packs and store the recipe index.
04Previous Versions
2026.11.09.1MIT
2026.11.06.1MIT
2026.11.05.1MIT
05Stats
B
87 / 100
Downloads
20
Archive size
43.3 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Docs keep secrets in a vault1/1earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository0/2missing
deno-command1 accepted
Spawns a subprocess with Deno.Command().
- models/recipes.ts:549 — no reason given
07Platforms