Skip to main content

Recipes

@puddleworks/recipesv2026.11.04.2beta· MIT· 19d agoBEHAVIORSWORKFLOWSACCEPTED WARNINGS
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.

02Behaviors1
@puddleworks/recipesv2026.11.04.2recipes.ts
fn match(text: string, repoDir?: string, sessionId?: string)
Find the recipe that answers a text; store `match`.
ArgumentTypeDescription
textstringThe text to find a recipe for.
repoDir?stringThe swamp repo; its puddlerouter.yaml adds allowlist entries and recipes.
sessionId?stringThe 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`.
ArgumentTypeDescription
recipeIdstring
captures?array
repoDir?stringThe swamp repo the recipe's extension is pulled into.
sessionId?stringThe caller's session; a write recipe's plan is kept under it.
mode?enumshadow: 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`.
ArgumentTypeDescription
sessionIdstringThe session the plan was made in.
textstringThe session's next turn; only a bare yes, y or go runs the plan.
repoDir?stringThe 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`.
ArgumentTypeDescription
repoDir?stringThe 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.
03Workflows1
@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 Versions2
2026.11.04.2MIT
2026.11.04.1MIT
05Stats
B
87 / 100
Downloads
20
Archive size
41.0 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

07Platforms