@@ -8,8 +8,8 @@ verification.
88
99- Decks are single units of work. They can be LLM-powered (via ` modelParams ` ) or
1010 compute-only (via ` run ` /` execute ` ).
11- - Cards are reusable prompt fragments. Embedding cards merges their deck
12- references (action/test /grader) and schema fragments into the parent deck.
11+ - Snippets are reusable prompt fragments. Embedding snippets merges their deck
12+ references (action/scenario /grader) and schema fragments into the parent deck.
1313- Action decks are child decks exposed as model tools. Names must match
1414 ` ^[A-Za-z_][A-Za-z0-9_]*$ ` and avoid the ` gambit_ ` prefix (reserved).
1515- Persona/scenario decks may accept free-form user turns. Use the
@@ -19,12 +19,12 @@ verification.
1919
2020## Pick a format
2121
22- - Markdown deck/card : great for quick prompt-first flows. Front matter declares
23- label/model/actions/scenarios/graders/handlers; body is the prompt. Embeds via
24- image syntax pull in cards or special markers.
25- - TypeScript deck/card : best when you need compute logic or co-locate schemas.
26- Export ` defineDeck ` /` defineCard ` with Zod schemas and a ` run ` / ` execute ` for
27- compute decks.
22+ - Markdown deck/snippet : great for quick prompt-first flows. Front matter
23+ declares label/model/actions/scenarios/graders/handlers; body is the prompt.
24+ Embeds via image syntax pull in snippets or special markers.
25+ - TypeScript deck/snippet : best when you need compute logic or co-locate
26+ schemas. Export ` defineDeck ` /` defineCard ` with Zod schemas and a
27+ ` run ` / ` execute ` for compute decks.
2828
2929## Minimal examples
3030
@@ -36,7 +36,7 @@ label = "hello_world"
3636modelParams = { model = "openai/gpt-4o-mini", temperature = 0 }
3737+++
3838
39- ![ init] ( gambit://cards /context.card .md ) # seed input if provided via CLI
39+ ![ init] ( gambit://snippets /context.md ) # seed input if provided via CLI
4040
4141Rules:
4242
@@ -64,8 +64,8 @@ export default defineDeck({
6464
6565- Non-root decks must declare ` contextSchema ` and ` responseSchema ` (Zod). Roots
6666 default to permissive string-ish input/output if omitted.
67- - Card ` contextFragment ` /` responseFragment ` merge into the deck’s schemas;
68- deck-level definitions win on conflicts.
67+ - Snippet ` contextFragment ` /` responseFragment ` values merge into the deck’s
68+ schemas; deck-level definitions win on conflicts.
6969- LLM outputs are validated against ` responseSchema ` ; compute decks validate
7070 returned payloads as well.
7171
@@ -81,7 +81,7 @@ deno run -A packages/gambit/scripts/migrate-schema-terms.ts <repo-root>
8181
8282- Add action decks in front matter or TS definitions:
8383 ` actions = [{ name = "get_time", path = "./get_time.deck.ts" }] ` .
84- - Action decks defined on embedded cards are merged into the deck; duplicates
84+ - Action decks defined on embedded snippets are merged into the deck; duplicates
8585 are overridden by the deck’s own entries.
8686- In compute decks, call child decks with ` ctx.spawnAndWait({ path, input }) ` .
8787- In LLM decks, the model chooses action decks via tool calls. Provide clear
@@ -152,15 +152,16 @@ deno run -A packages/gambit/scripts/migrate-schema-terms.ts <repo-root>
152152 ` handlers.onError ` point to other decks. Inputs are structured (see
153153 ` ../reference/handlers.md ` ); errors inside handlers are swallowed.
154154
155- ## Embeds (cards )
155+ ## Embeds (snippets )
156156
157- - In Markdown, use image syntax to embed:
158- `  ` . Special markers:
159- ` gambit://cards/context.card.md ` hints init tool,
160- ` gambit://cards/respond.card.md ` injects respond instructions, and
161- ` gambit://cards/end.card.md ` enables the ` gambit_end ` hang-up tool.
162- - Cards can also be TS files exported with ` defineCard ` . They may contain
163- action/test/grader deck references and schema fragments, but no handlers.
157+ - In Markdown, use image syntax to embed snippets:
158+ `  ` . Local snippet files often still live
159+ under ` cards/ ` with a ` .card.md ` suffix for legacy compatibility. Special
160+ markers: ` gambit://snippets/context.md ` hints init tool,
161+ ` gambit://snippets/respond.md ` injects respond instructions, and
162+ ` gambit://snippets/end.md ` enables the ` gambit_end ` hang-up tool.
163+ - Snippets can also be TS files exported with ` defineCard ` . They may contain
164+ action/scenario/grader deck references and schema fragments, but no handlers.
164165
165166## Running and debugging
166167
0 commit comments