@bolt-foundry/gambit-core 0.7.0 → 0.8.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 +228 -0
- package/cards/context.card.md +9 -0
- package/cards/end.card.md +10 -0
- package/cards/respond.card.md +10 -0
- package/esm/_dnt.polyfills.d.ts +99 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +127 -1
- package/esm/deps/jsr.io/@std/collections/{1.1.3 → 1.1.4}/_utils.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/collections/{1.1.3 → 1.1.4}/_utils.js +1 -1
- package/esm/deps/jsr.io/@std/collections/{1.1.3 → 1.1.4}/deep_merge.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/collections/{1.1.3 → 1.1.4}/deep_merge.js +1 -1
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/yaml.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/constants.d.ts +1 -1
- package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_chars.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_chars.js +1 -1
- package/{script/deps/jsr.io/@std/yaml/1.0.10 → esm/deps/jsr.io/@std/yaml/1.0.11}/_loader_state.d.ts +21 -18
- package/esm/deps/jsr.io/@std/yaml/1.0.11/_loader_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_loader_state.js +250 -273
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_schema.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_schema.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/binary.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/bool.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/bool.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/float.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/float.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/int.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/int.js +1 -1
- package/{script/deps/jsr.io/@std/yaml/1.0.10 → esm/deps/jsr.io/@std/yaml/1.0.11}/_type/map.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/map.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/merge.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/merge.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/nil.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/nil.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/omap.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/omap.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/pairs.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/pairs.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/regexp.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/regexp.js +1 -1
- package/{script/deps/jsr.io/@std/yaml/1.0.10 → esm/deps/jsr.io/@std/yaml/1.0.11}/_type/seq.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/seq.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/set.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/set.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/str.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/str.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/timestamp.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/timestamp.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/undefined.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/undefined.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_utils.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_utils.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/parse.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/parse.js +1 -1
- package/esm/src/builtins.d.ts +3 -0
- package/esm/src/builtins.d.ts.map +1 -0
- package/esm/src/builtins.js +26 -0
- package/esm/src/loader.d.ts.map +1 -1
- package/esm/src/loader.js +6 -3
- package/esm/src/markdown.d.ts.map +1 -1
- package/esm/src/markdown.js +25 -4
- package/package.json +1 -1
- package/schemas/graders/contexts/conversation.ts +17 -0
- package/schemas/graders/contexts/turn.ts +10 -0
- package/schemas/graders/respond.ts +9 -0
- package/script/_dnt.polyfills.d.ts +99 -0
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +128 -0
- package/script/deps/jsr.io/@std/collections/{1.1.3 → 1.1.4}/_utils.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/collections/{1.1.3 → 1.1.4}/_utils.js +1 -1
- package/script/deps/jsr.io/@std/collections/{1.1.3 → 1.1.4}/deep_merge.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/collections/{1.1.3 → 1.1.4}/deep_merge.js +1 -1
- package/script/deps/jsr.io/@std/front-matter/1.0.9/yaml.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/constants.d.ts +1 -1
- package/script/deps/jsr.io/@std/toml/1.0.11/_parser.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_chars.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_chars.js +1 -1
- package/{esm/deps/jsr.io/@std/yaml/1.0.10 → script/deps/jsr.io/@std/yaml/1.0.11}/_loader_state.d.ts +21 -18
- package/script/deps/jsr.io/@std/yaml/1.0.11/_loader_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_loader_state.js +250 -273
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_schema.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_schema.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/binary.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/bool.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/bool.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/float.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/float.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/int.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/int.js +1 -1
- package/{esm/deps/jsr.io/@std/yaml/1.0.10 → script/deps/jsr.io/@std/yaml/1.0.11}/_type/map.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/map.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/merge.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/merge.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/nil.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/nil.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/omap.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/omap.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/pairs.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/pairs.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/regexp.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/regexp.js +1 -1
- package/{esm/deps/jsr.io/@std/yaml/1.0.10 → script/deps/jsr.io/@std/yaml/1.0.11}/_type/seq.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/seq.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/set.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/set.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/str.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/str.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/timestamp.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/timestamp.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/undefined.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/undefined.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_utils.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_utils.js +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/parse.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/parse.js +1 -1
- package/script/src/builtins.d.ts +3 -0
- package/script/src/builtins.d.ts.map +1 -0
- package/script/src/builtins.js +63 -0
- package/script/src/loader.d.ts.map +1 -1
- package/script/src/loader.js +6 -3
- package/script/src/markdown.d.ts.map +1 -1
- package/script/src/markdown.js +25 -4
- package/esm/deps/jsr.io/@std/yaml/1.0.10/_loader_state.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.10/_loader_state.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/collections/{1.1.3 → 1.1.4}/_utils.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/collections/{1.1.3 → 1.1.4}/deep_merge.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_chars.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_schema.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/binary.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/binary.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/bool.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/float.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/int.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/map.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/merge.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/nil.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/omap.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/pairs.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/regexp.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/seq.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/set.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/str.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/timestamp.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/undefined.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_utils.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/parse.d.ts +0 -0
- /package/script/deps/jsr.io/@std/collections/{1.1.3 → 1.1.4}/_utils.d.ts +0 -0
- /package/script/deps/jsr.io/@std/collections/{1.1.3 → 1.1.4}/deep_merge.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_chars.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_schema.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/binary.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/binary.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/bool.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/float.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/int.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/map.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/merge.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/nil.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/omap.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/pairs.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/regexp.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/seq.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/set.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/str.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/timestamp.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type/undefined.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_type.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/_utils.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.10 → 1.0.11}/parse.d.ts +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# @bolt-foundry/gambit-core
|
|
2
|
+
|
|
3
|
+
Core runtime, definitions, and utilities for building Gambit decks outside of
|
|
4
|
+
the CLI. It includes the loader for Markdown/TypeScript decks, guardrail-aware
|
|
5
|
+
execution, OpenAI-compatible adapters, and helpers for persisting local run
|
|
6
|
+
state. The [`@bolt-foundry/gambit`](../gambit/README.md) package re-exports
|
|
7
|
+
these APIs plus the CLI, but `gambit-core` stays focused on the
|
|
8
|
+
authoring/runtime pieces that can live in any host.
|
|
9
|
+
|
|
10
|
+
> **Gambit vs. Gambit Core**
|
|
11
|
+
>
|
|
12
|
+
> `@bolt-foundry/gambit-core` is the lightweight runtime + authoring toolkit
|
|
13
|
+
> (deck definitions, loaders, runtime, provider helpers).
|
|
14
|
+
> [`@bolt-foundry/gambit`](../gambit/README.md) bundles those same exports
|
|
15
|
+
> **plus** the CLI, simulator server, and higher-level developer experience. If
|
|
16
|
+
> you need just the runtime inside another application or service, depend on
|
|
17
|
+
> `gambit-core`. If you also want the CLI commands (`run`, `serve`, `repl`,
|
|
18
|
+
> etc.) stick with [`@bolt-foundry/gambit`](../gambit/README.md), which already
|
|
19
|
+
> depends on this package.
|
|
20
|
+
|
|
21
|
+
## Highlights
|
|
22
|
+
|
|
23
|
+
- Typed deck/card definitions with [`defineDeck`](src/definitions.ts) and
|
|
24
|
+
[`defineCard`](src/definitions.ts) that enforce Zod
|
|
25
|
+
`inputSchema`/`outputSchema`.
|
|
26
|
+
- Loader that understands Markdown decks/cards, inline embeds, and companion
|
|
27
|
+
decks (`actionDecks`, `testDecks`, `graderDecks`).
|
|
28
|
+
- Guardrail-aware runtime (`runDeck`) that can mix LLM actions and pure compute
|
|
29
|
+
decks with structured tracing and execution context helpers.
|
|
30
|
+
- Compatibility helpers for OpenAI Chat Completions plus a ready-to-use
|
|
31
|
+
OpenRouter provider factory.
|
|
32
|
+
- State utilities (`loadState`/`saveState`) used by the Gambit simulator for
|
|
33
|
+
local-first transcripts, feedback, and notes.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
### Deno
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
deno add jsr:@bolt-foundry/gambit-core
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Import directly from JSR:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
import { defineDeck, runDeck } from "jsr:@bolt-foundry/gambit-core";
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Node.js / bundlers
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
npm install @bolt-foundry/gambit-core
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
All exports are ESM and align with what the CLI package (`@bolt-foundry/gambit`)
|
|
56
|
+
surfaces. Use any runtime that supports modern ES modules (Node 18+, Bun, Deno,
|
|
57
|
+
etc.).
|
|
58
|
+
|
|
59
|
+
## Core concepts
|
|
60
|
+
|
|
61
|
+
- **Decks**: The primary executable unit. Decks declare a label, `inputSchema`,
|
|
62
|
+
`outputSchema`, optional `body`/`prompt`, handler hooks, and companion decks
|
|
63
|
+
(actions/tests/graders). Decks with `modelParams` render prompts, while decks
|
|
64
|
+
with `run`/`execute` are compute-only.
|
|
65
|
+
- **Cards**: Reusable prompt fragments or schema fragments that can be embedded
|
|
66
|
+
within decks or other cards. Cards can contribute
|
|
67
|
+
`inputFragment`/`outputFragment` that merge into a parent deck’s schema.
|
|
68
|
+
- **Guardrails**: Limit recursion with `maxDepth`, `maxPasses`, and `timeoutMs`.
|
|
69
|
+
Decks can override guardrails per definition; `runDeck` enforces them while
|
|
70
|
+
spawning child decks.
|
|
71
|
+
- **Handlers**: Background decks triggered on busy/idle/error intervals. Paths
|
|
72
|
+
are resolved relative to the parent deck file.
|
|
73
|
+
- **Companion decks**: `actionDecks` expose tools (function calls) to the model,
|
|
74
|
+
`testDecks` house personas or scripted tests, and `graderDecks` evaluate saved
|
|
75
|
+
transcripts.
|
|
76
|
+
|
|
77
|
+
All actual type definitions live under [`src/types.ts`](src/types.ts). Use them
|
|
78
|
+
when scripting tooling or writing custom providers.
|
|
79
|
+
|
|
80
|
+
## Define a deck in TypeScript
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
// hello.deck.ts
|
|
84
|
+
import { defineDeck } from "jsr:@bolt-foundry/gambit-core";
|
|
85
|
+
import { z } from "zod";
|
|
86
|
+
|
|
87
|
+
export default defineDeck({
|
|
88
|
+
label: "Hello World",
|
|
89
|
+
inputSchema: z.object({ user: z.string() }),
|
|
90
|
+
outputSchema: z.object({ reply: z.string() }),
|
|
91
|
+
body: `
|
|
92
|
+
You are a helpful assistant that greets the user by name.
|
|
93
|
+
`,
|
|
94
|
+
respond: true,
|
|
95
|
+
modelParams: {
|
|
96
|
+
model: "openrouter/anthropic/claude-3.5-sonnet",
|
|
97
|
+
temperature: 0.2,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Cards look similar:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
import { defineCard } from "jsr:@bolt-foundry/gambit-core";
|
|
106
|
+
import { z } from "zod";
|
|
107
|
+
|
|
108
|
+
export default defineCard({
|
|
109
|
+
label: "Shared context",
|
|
110
|
+
inputFragment: z.object({ customerId: z.string().uuid() }),
|
|
111
|
+
body: "Always double check the account number before responding.",
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Running decks programmatically
|
|
116
|
+
|
|
117
|
+
The runtime loads the deck (Markdown or TS) and steps through each pass. Provide
|
|
118
|
+
any `ModelProvider` implementation; the OpenRouter adapter lives in
|
|
119
|
+
`@bolt-foundry/gambit`.
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
import { runDeck } from "jsr:@bolt-foundry/gambit-core";
|
|
123
|
+
import { createOpenRouterProvider } from "jsr:@bolt-foundry/gambit";
|
|
124
|
+
|
|
125
|
+
const provider = createOpenRouterProvider({
|
|
126
|
+
apiKey: Deno.env.get("OPENROUTER_API_KEY")!,
|
|
127
|
+
referer: "https://example.com",
|
|
128
|
+
title: "My Gambit Runner",
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const result = await runDeck({
|
|
132
|
+
path: "./hello.deck.ts",
|
|
133
|
+
input: { user: "Casey" },
|
|
134
|
+
modelProvider: provider,
|
|
135
|
+
isRoot: true,
|
|
136
|
+
trace: (event) => console.log(event),
|
|
137
|
+
stream: true,
|
|
138
|
+
onStreamText: (chunk) => Deno.stdout.write(new TextEncoder().encode(chunk)),
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
console.log(result);
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
When the deck defines `run`/`execute`, the runtime hands you an
|
|
145
|
+
[`ExecutionContext`](src/types.ts) with:
|
|
146
|
+
|
|
147
|
+
- `ctx.input`: validated input (narrowable when you type the schema).
|
|
148
|
+
- `ctx.spawnAndWait({ path, input })`: call another deck and await the result.
|
|
149
|
+
- `ctx.return(payload)`: respond early without running guards again.
|
|
150
|
+
- `ctx.fail({ message, code?, details? })`: aborts the run (throws).
|
|
151
|
+
- `ctx.log(...)`: emit structured trace entries for observability.
|
|
152
|
+
|
|
153
|
+
Pass `guardrails`, `initialUserMessage`, `modelOverride`, and
|
|
154
|
+
`allowRootStringInput` to `runDeck` when scripting custom runtimes.
|
|
155
|
+
|
|
156
|
+
## Loading Markdown decks and cards
|
|
157
|
+
|
|
158
|
+
Markdown files use front matter for metadata, with the body becoming the prompt.
|
|
159
|
+
Embedded cards or system hints can be referenced with markdown image syntax.
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
---
|
|
163
|
+
label: Support Triage
|
|
164
|
+
inputSchema: ./schemas/triage_input.ts
|
|
165
|
+
outputSchema: ./schemas/triage_output.ts
|
|
166
|
+
actionDecks:
|
|
167
|
+
- name: escalate
|
|
168
|
+
description: Escalate to a manager
|
|
169
|
+
path: ./actions/escalate.deck.md
|
|
170
|
+
testDecks:
|
|
171
|
+
- path: ./personas/test_bot.deck.md
|
|
172
|
+
---
|
|
173
|
+

|
|
174
|
+
|
|
175
|
+
You are the front door for support tickets. Summarize the ticket and ask
|
|
176
|
+
clarifying questions before choosing an action.
|
|
177
|
+
|
|
178
|
+

|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
`loadDeck` normalizes relative paths, merges card fragments, enforces unique
|
|
182
|
+
action names, and warns about deprecated fields (`actions`,
|
|
183
|
+
`handlers.onInterval`, `intervalMs`). The Markdown loader also injects helper
|
|
184
|
+
text for built-in tools like `gambit_init`, `gambit_respond`, and `gambit_end`
|
|
185
|
+
when you add `gambit://` markers.
|
|
186
|
+
|
|
187
|
+
## Compatibility and utilities
|
|
188
|
+
|
|
189
|
+
- **Chat Completions bridge**: [`chatCompletionsWithDeck`](src/openai_compat.ts)
|
|
190
|
+
lets you present a single deck as an OpenAI-compatible endpoint. It normalizes
|
|
191
|
+
tool calls, enforces deck schemas, and returns Chat Completions–shaped
|
|
192
|
+
responses with a `gambit` metadata extension.
|
|
193
|
+
- **Request rendering**: [`renderDeck`](src/render.ts) merges an existing Chat
|
|
194
|
+
Completions request with the deck’s system prompt and tool schema, so you can
|
|
195
|
+
debug what will actually reach the model or feed it into another orchestrator.
|
|
196
|
+
- **Model providers**: the OpenRouter adapter lives in `@bolt-foundry/gambit`
|
|
197
|
+
(see `packages/gambit/src/providers/openrouter.ts`). Implement your own
|
|
198
|
+
provider by conforming to the `responses()` signature in `ModelProvider`.
|
|
199
|
+
- **Constants**:
|
|
200
|
+
[`GAMBIT_TOOL_INIT`, `GAMBIT_TOOL_RESPOND`, `GAMBIT_TOOL_END`](src/constants.ts)
|
|
201
|
+
define the reserved tool names the runtime expects when the assistant starts,
|
|
202
|
+
responds, and explicitly ends runs.
|
|
203
|
+
|
|
204
|
+
## Persisted state and traces
|
|
205
|
+
|
|
206
|
+
[`loadState`](src/state.ts) and [`saveState`](src/state.ts) read/write JSON
|
|
207
|
+
session files that include transcript messages, message references, feedback,
|
|
208
|
+
trace events, notes, and optional conversation scores. The CLI stores them under
|
|
209
|
+
`.gambit/`, but the API works anywhere.
|
|
210
|
+
|
|
211
|
+
Use the `trace` callback offered by `runDeck` to collect
|
|
212
|
+
[`TraceEvent`](src/types.ts) entries, then persist them via `saveState` or
|
|
213
|
+
stream them to your own observability stack.
|
|
214
|
+
|
|
215
|
+
## Local development
|
|
216
|
+
|
|
217
|
+
From `packages/gambit-core/`:
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
deno task fmt # format sources
|
|
221
|
+
deno task lint # lint with the repo-standard rules
|
|
222
|
+
deno task test # run unit tests (allowing net/fs as required)
|
|
223
|
+
deno task build_npm # emit the npm bundle via dnt
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Tests exercise the Markdown loader, renderer, OpenAI compatibility layer, and
|
|
227
|
+
runtime guardrails. Update snapshots/fixtures via `deno test -- --update` when
|
|
228
|
+
necessary.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
+++
|
|
2
|
+
label = "Gambit context primer"
|
|
3
|
+
+++
|
|
4
|
+
|
|
5
|
+
You will automatically receive a `gambit_init` tool result at the start of the
|
|
6
|
+
run whenever the caller supplies `--context` (formerly `--init`). This payload
|
|
7
|
+
contains run metadata or seeded inputs. Read it before you respond, treat it as
|
|
8
|
+
trusted context, and keep it on hand throughout the workflow so downstream
|
|
9
|
+
actions have the right data.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
+++
|
|
2
|
+
label = "Explicitly end the run"
|
|
3
|
+
allowEnd = true
|
|
4
|
+
+++
|
|
5
|
+
|
|
6
|
+
If the entire conversation/workflow is complete and you must stop all further
|
|
7
|
+
turns, call the `gambit_end` tool with an optional `message`, `payload`,
|
|
8
|
+
`status`, `code`, or `meta`. Only use this when you want Gambit to halt entirely
|
|
9
|
+
(no more user messages). Otherwise continue with normal responses or
|
|
10
|
+
`gambit_respond`.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
+++
|
|
2
|
+
label = "Call gambit_respond"
|
|
3
|
+
respond = true
|
|
4
|
+
+++
|
|
5
|
+
|
|
6
|
+
When you finish this workflow, do **not** emit a normal assistant reply.
|
|
7
|
+
Instead, call the `gambit_respond` tool exactly once with a JSON envelope that
|
|
8
|
+
includes your validated `payload` plus optional `status`, `message`, `code`, or
|
|
9
|
+
`meta` fields. This keeps outputs structured and lets Gambit capture the result
|
|
10
|
+
even when guardrails stop the run early.
|
package/esm/_dnt.polyfills.d.ts
CHANGED
|
@@ -1,3 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
3
|
+
* but instead of using npm to install additional dependencies,
|
|
4
|
+
* this approach manually consolidates cjs/mjs/d.ts into a single file.
|
|
5
|
+
*
|
|
6
|
+
* Note that this code might be imported multiple times
|
|
7
|
+
* (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
|
|
8
|
+
* or Node.js might dynamically clear the cache and then force a require).
|
|
9
|
+
* Therefore, it's important to avoid redundant writes to global objects.
|
|
10
|
+
* Additionally, consider that commonjs is used alongside esm,
|
|
11
|
+
* so the two ponyfill functions are stored independently in two separate global objects.
|
|
12
|
+
*/
|
|
13
|
+
import { createRequire } from "node:module";
|
|
14
|
+
import { type URL } from "node:url";
|
|
15
|
+
declare global {
|
|
16
|
+
interface ImportMeta {
|
|
17
|
+
/** A string representation of the fully qualified module URL. When the
|
|
18
|
+
* module is loaded locally, the value will be a file URL (e.g.
|
|
19
|
+
* `file:///path/module.ts`).
|
|
20
|
+
*
|
|
21
|
+
* You can also parse the string as a URL to determine more information about
|
|
22
|
+
* how the current module was loaded. For example to determine if a module was
|
|
23
|
+
* local or not:
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* const url = new URL(import.meta.url);
|
|
27
|
+
* if (url.protocol === "file:") {
|
|
28
|
+
* console.log("this module was loaded locally");
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
url: string;
|
|
33
|
+
/**
|
|
34
|
+
* A function that returns resolved specifier as if it would be imported
|
|
35
|
+
* using `import(specifier)`.
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* console.log(import.meta.resolve("./foo.js"));
|
|
39
|
+
* // file:///dev/foo.js
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @param specifier The module specifier to resolve relative to `parent`.
|
|
43
|
+
* @param parent The absolute parent module URL to resolve from.
|
|
44
|
+
* @returns The absolute (`file:`) URL string for the resolved module.
|
|
45
|
+
*/
|
|
46
|
+
resolve(specifier: string, parent?: string | URL | undefined): string;
|
|
47
|
+
/** A flag that indicates if the current module is the main module that was
|
|
48
|
+
* called when starting the program under Deno.
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* if (import.meta.main) {
|
|
52
|
+
* // this was loaded as the main module, maybe do some bootstrapping
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
main: boolean;
|
|
57
|
+
/** The absolute path of the current module.
|
|
58
|
+
*
|
|
59
|
+
* This property is only provided for local modules (ie. using `file://` URLs).
|
|
60
|
+
*
|
|
61
|
+
* Example:
|
|
62
|
+
* ```
|
|
63
|
+
* // Unix
|
|
64
|
+
* console.log(import.meta.filename); // /home/alice/my_module.ts
|
|
65
|
+
*
|
|
66
|
+
* // Windows
|
|
67
|
+
* console.log(import.meta.filename); // C:\alice\my_module.ts
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
filename: string;
|
|
71
|
+
/** The absolute path of the directory containing the current module.
|
|
72
|
+
*
|
|
73
|
+
* This property is only provided for local modules (ie. using `file://` URLs).
|
|
74
|
+
*
|
|
75
|
+
* * Example:
|
|
76
|
+
* ```
|
|
77
|
+
* // Unix
|
|
78
|
+
* console.log(import.meta.dirname); // /home/alice
|
|
79
|
+
*
|
|
80
|
+
* // Windows
|
|
81
|
+
* console.log(import.meta.dirname); // C:\alice
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
dirname: string;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
type NodeRequest = ReturnType<typeof createRequire>;
|
|
88
|
+
type NodeModule = NonNullable<NodeRequest["main"]>;
|
|
89
|
+
interface ImportMetaPonyfillCommonjs {
|
|
90
|
+
(require: NodeRequest, module: NodeModule): ImportMeta;
|
|
91
|
+
}
|
|
92
|
+
interface ImportMetaPonyfillEsmodule {
|
|
93
|
+
(importMeta: ImportMeta): ImportMeta;
|
|
94
|
+
}
|
|
95
|
+
interface ImportMetaPonyfill extends ImportMetaPonyfillCommonjs, ImportMetaPonyfillEsmodule {
|
|
96
|
+
}
|
|
97
|
+
export declare let import_meta_ponyfill_commonjs: ImportMetaPonyfillCommonjs;
|
|
98
|
+
export declare let import_meta_ponyfill_esmodule: ImportMetaPonyfillEsmodule;
|
|
99
|
+
export declare let import_meta_ponyfill: ImportMetaPonyfill;
|
|
1
100
|
declare global {
|
|
2
101
|
interface Object {
|
|
3
102
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAgC,KAAK,GAAG,EAAE,MAAM,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ill),
|
|
3
|
+
* but instead of using npm to install additional dependencies,
|
|
4
|
+
* this approach manually consolidates cjs/mjs/d.ts into a single file.
|
|
5
|
+
*
|
|
6
|
+
* Note that this code might be imported multiple times
|
|
7
|
+
* (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
|
|
8
|
+
* or Node.js might dynamically clear the cache and then force a require).
|
|
9
|
+
* Therefore, it's important to avoid redundant writes to global objects.
|
|
10
|
+
* Additionally, consider that commonjs is used alongside esm,
|
|
11
|
+
* so the two ponyfill functions are stored independently in two separate global objects.
|
|
12
|
+
*/
|
|
13
|
+
//@ts-ignore
|
|
14
|
+
import { createRequire } from "node:module";
|
|
15
|
+
//@ts-ignore
|
|
16
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
17
|
+
//@ts-ignore
|
|
18
|
+
import { dirname } from "node:path";
|
|
19
|
+
const defineGlobalPonyfill = (symbolFor, fn) => {
|
|
20
|
+
if (!Reflect.has(globalThis, Symbol.for(symbolFor))) {
|
|
21
|
+
Object.defineProperty(globalThis, Symbol.for(symbolFor), {
|
|
22
|
+
configurable: true,
|
|
23
|
+
get() {
|
|
24
|
+
return fn;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export let import_meta_ponyfill_commonjs = (Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-commonjs")) ??
|
|
30
|
+
(() => {
|
|
31
|
+
const moduleImportMetaWM = new WeakMap();
|
|
32
|
+
return (require, module) => {
|
|
33
|
+
let importMetaCache = moduleImportMetaWM.get(module);
|
|
34
|
+
if (importMetaCache == null) {
|
|
35
|
+
const importMeta = Object.assign(Object.create(null), {
|
|
36
|
+
url: pathToFileURL(module.filename).href,
|
|
37
|
+
main: require.main == module,
|
|
38
|
+
resolve: (specifier, parentURL = importMeta.url) => {
|
|
39
|
+
return pathToFileURL((importMeta.url === parentURL
|
|
40
|
+
? require
|
|
41
|
+
: createRequire(parentURL))
|
|
42
|
+
.resolve(specifier)).href;
|
|
43
|
+
},
|
|
44
|
+
filename: module.filename,
|
|
45
|
+
dirname: module.path,
|
|
46
|
+
});
|
|
47
|
+
moduleImportMetaWM.set(module, importMeta);
|
|
48
|
+
importMetaCache = importMeta;
|
|
49
|
+
}
|
|
50
|
+
return importMetaCache;
|
|
51
|
+
};
|
|
52
|
+
})());
|
|
53
|
+
defineGlobalPonyfill("import-meta-ponyfill-commonjs", import_meta_ponyfill_commonjs);
|
|
54
|
+
export let import_meta_ponyfill_esmodule = (Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-esmodule")) ??
|
|
55
|
+
((importMeta) => {
|
|
56
|
+
const resolveFunStr = String(importMeta.resolve);
|
|
57
|
+
const shimWs = new WeakSet();
|
|
58
|
+
//@ts-ignore
|
|
59
|
+
const mainUrl = ("file:///" + process.argv[1].replace(/\\/g, "/"))
|
|
60
|
+
.replace(/\/{3,}/, "///");
|
|
61
|
+
const commonShim = (importMeta) => {
|
|
62
|
+
if (typeof importMeta.main !== "boolean") {
|
|
63
|
+
importMeta.main = importMeta.url === mainUrl;
|
|
64
|
+
}
|
|
65
|
+
if (typeof importMeta.filename !== "string") {
|
|
66
|
+
importMeta.filename = fileURLToPath(importMeta.url);
|
|
67
|
+
importMeta.dirname = dirname(importMeta.filename);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
if (
|
|
71
|
+
// v16.2.0+, v14.18.0+: Add support for WHATWG URL object to parentURL parameter.
|
|
72
|
+
resolveFunStr === "undefined" ||
|
|
73
|
+
// v20.0.0+, v18.19.0+"" This API now returns a string synchronously instead of a Promise.
|
|
74
|
+
resolveFunStr.startsWith("async")
|
|
75
|
+
// enable by --experimental-import-meta-resolve flag
|
|
76
|
+
) {
|
|
77
|
+
import_meta_ponyfill_esmodule = (importMeta) => {
|
|
78
|
+
if (!shimWs.has(importMeta)) {
|
|
79
|
+
shimWs.add(importMeta);
|
|
80
|
+
const importMetaUrlRequire = {
|
|
81
|
+
url: importMeta.url,
|
|
82
|
+
require: createRequire(importMeta.url),
|
|
83
|
+
};
|
|
84
|
+
importMeta.resolve = function resolve(specifier, parentURL = importMeta.url) {
|
|
85
|
+
return pathToFileURL((importMetaUrlRequire.url === parentURL
|
|
86
|
+
? importMetaUrlRequire.require
|
|
87
|
+
: createRequire(parentURL)).resolve(specifier)).href;
|
|
88
|
+
};
|
|
89
|
+
commonShim(importMeta);
|
|
90
|
+
}
|
|
91
|
+
return importMeta;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
/// native support
|
|
96
|
+
import_meta_ponyfill_esmodule = (importMeta) => {
|
|
97
|
+
if (!shimWs.has(importMeta)) {
|
|
98
|
+
shimWs.add(importMeta);
|
|
99
|
+
commonShim(importMeta);
|
|
100
|
+
}
|
|
101
|
+
return importMeta;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return import_meta_ponyfill_esmodule(importMeta);
|
|
105
|
+
}));
|
|
106
|
+
defineGlobalPonyfill("import-meta-ponyfill-esmodule", import_meta_ponyfill_esmodule);
|
|
107
|
+
export let import_meta_ponyfill = ((...args) => {
|
|
108
|
+
const _MODULE = (() => {
|
|
109
|
+
if (typeof require === "function" && typeof module === "object") {
|
|
110
|
+
return "commonjs";
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
// eval("typeof import.meta");
|
|
114
|
+
return "esmodule";
|
|
115
|
+
}
|
|
116
|
+
})();
|
|
117
|
+
if (_MODULE === "commonjs") {
|
|
118
|
+
//@ts-ignore
|
|
119
|
+
import_meta_ponyfill = (r, m) => import_meta_ponyfill_commonjs(r, m);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
//@ts-ignore
|
|
123
|
+
import_meta_ponyfill = (im) => import_meta_ponyfill_esmodule(im);
|
|
124
|
+
}
|
|
125
|
+
//@ts-ignore
|
|
126
|
+
return import_meta_ponyfill(...args);
|
|
127
|
+
});
|
|
1
128
|
// https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
|
|
2
129
|
if (!Object.hasOwn) {
|
|
3
130
|
Object.defineProperty(Object, "hasOwn", {
|
|
@@ -12,4 +139,3 @@ if (!Object.hasOwn) {
|
|
|
12
139
|
writable: true,
|
|
13
140
|
});
|
|
14
141
|
}
|
|
15
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_utils.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.1.
|
|
1
|
+
{"version":3,"file":"_utils.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.1.4/_utils.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EACf,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,OAAO,GAC5B,KAAK,CAAC,CAAC,CAAC,CAeV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deep_merge.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.1.
|
|
1
|
+
{"version":3,"file":"deep_merge.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.1.4/deep_merge.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,wBAAgB,SAAS,CACvB,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAEtC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC5B,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC3B,OAAO,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GACnC,CAAC,CAAC;AACL;;;;;;;;;;;;;;;;;;;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AE,GAClC,aAAa,CAAC,CAAC,EAAE,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,GACvC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IACvB,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAEzB,+BAA+B;AAC/B,MAAM,MAAM,SAAS,CACnB,CAAC,EACD,CAAC,EACD,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,IAGzC;IAAC,CAAC;IAAE,CAAC;CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,GACvE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,GAEpB,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
2
|
// This module is browser compatible.
|
|
3
3
|
import { extractFrontMatter } from "./_shared.js";
|
|
4
|
-
import { parse } from "../../yaml/1.0.
|
|
4
|
+
import { parse } from "../../yaml/1.0.11/parse.js";
|
|
5
5
|
import { EXTRACT_YAML_REGEXP } from "./_formats.js";
|
|
6
6
|
/**
|
|
7
7
|
* Extracts and parses {@link https://yaml.org | YAML} from the metadata of
|
|
@@ -7,7 +7,7 @@ export declare const DELIMITER: ";" | ":";
|
|
|
7
7
|
* The character used to separate components of a file path.
|
|
8
8
|
* On Windows, this is `\`. On all other platforms, this is `/`.
|
|
9
9
|
*/
|
|
10
|
-
export declare const SEPARATOR: "
|
|
10
|
+
export declare const SEPARATOR: "/" | "\\";
|
|
11
11
|
/**
|
|
12
12
|
* A regular expression that matches one or more path separators.
|
|
13
13
|
*/
|
|
@@ -12,7 +12,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
12
12
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
13
13
|
};
|
|
14
14
|
var _Scanner_whitespace, _Scanner_position, _Scanner_source;
|
|
15
|
-
import { deepMerge } from "../../collections/1.1.
|
|
15
|
+
import { deepMerge } from "../../collections/1.1.4/deep_merge.js";
|
|
16
16
|
/**
|
|
17
17
|
* Copy of `import { isLeap } from "@std/datetime";` because it cannot be impoted as long as it is unstable.
|
|
18
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_chars.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/yaml/1.0.
|
|
1
|
+
{"version":3,"file":"_chars.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/yaml/1.0.11/_chars.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,GAAG,QAAS,CAAC;AAC1B,eAAO,MAAM,GAAG,IAAO,CAAC;AACxB,eAAO,MAAM,SAAS,KAAO,CAAC;AAC9B,eAAO,MAAM,eAAe,KAAO,CAAC;AACpC,eAAO,MAAM,KAAK,KAAO,CAAC;AAC1B,eAAO,MAAM,WAAW,KAAO,CAAC;AAChC,eAAO,MAAM,YAAY,KAAO,CAAC;AACjC,eAAO,MAAM,KAAK,KAAO,CAAC;AAC1B,eAAO,MAAM,OAAO,KAAO,CAAC;AAC5B,eAAO,MAAM,SAAS,KAAO,CAAC;AAC9B,eAAO,MAAM,YAAY,KAAO,CAAC;AACjC,eAAO,MAAM,QAAQ,KAAO,CAAC;AAC7B,eAAO,MAAM,IAAI,KAAO,CAAC;AACzB,eAAO,MAAM,KAAK,KAAO,CAAC;AAC1B,eAAO,MAAM,KAAK,KAAO,CAAC;AAC1B,eAAO,MAAM,GAAG,KAAO,CAAC;AACxB,eAAO,MAAM,KAAK,KAAO,CAAC;AAC1B,eAAO,MAAM,YAAY,KAAO,CAAC;AACjC,eAAO,MAAM,YAAY,KAAO,CAAC;AACjC,eAAO,MAAM,QAAQ,KAAO,CAAC;AAC7B,eAAO,MAAM,aAAa,KAAO,CAAC;AAClC,eAAO,MAAM,mBAAmB,KAAO,CAAC;AACxC,eAAO,MAAM,SAAS,KAAO,CAAC;AAC9B,eAAO,MAAM,oBAAoB,KAAO,CAAC;AACzC,eAAO,MAAM,YAAY,KAAO,CAAC;AACjC,eAAO,MAAM,kBAAkB,MAAO,CAAC;AACvC,eAAO,MAAM,aAAa,MAAO,CAAC;AAClC,eAAO,MAAM,mBAAmB,MAAO,CAAC;AAExC,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAExC;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAQlD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Ported from js-yaml v3.13.1:
|
|
2
2
|
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
|
|
3
3
|
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
|
-
// Copyright 2018-
|
|
4
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
5
|
export const BOM = 0xfeff; /* BOM */
|
|
6
6
|
export const TAB = 0x09; /* Tab */
|
|
7
7
|
export const LINE_FEED = 0x0a; /* LF */
|