@bolt-foundry/gambit-core 0.8.6-rc.7 → 1.0.0-rc.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 +4 -4
- package/esm/deps/jsr.io/@std/collections/{1.1.6 → 1.1.7}/deep_merge.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/yaml.js +1 -1
- package/esm/deps/jsr.io/@std/internal/1.0.13/_os.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/_os.js +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/os.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/os.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/basename.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/constants.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/dirname.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/extname.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/format.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/join.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/normalize.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/parse.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/relative.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/resolve.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.js +1 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.js +1 -1
- package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_chars.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_loader_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_loader_state.js +12 -12
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_schema.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/binary.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/bool.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/float.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/float.js +4 -4
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/int.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/map.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/merge.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/nil.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/omap.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/seq.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/set.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_type.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.1.0/parse.d.ts.map +1 -0
- package/esm/mod.d.ts +12 -4
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +7 -1
- package/esm/src/builtins.d.ts +0 -2
- package/esm/src/builtins.d.ts.map +1 -1
- package/esm/src/builtins.js +0 -35
- package/esm/src/loader.d.ts.map +1 -1
- package/esm/src/loader.js +17 -9
- package/esm/src/markdown.d.ts.map +1 -1
- package/esm/src/markdown.js +16 -5
- package/esm/src/runtime.d.ts +32 -1
- package/esm/src/runtime.d.ts.map +1 -1
- package/esm/src/runtime.js +205 -186
- package/esm/src/state.d.ts.map +1 -1
- package/esm/src/state.js +3 -2
- package/esm/src/text.d.ts +2 -0
- package/esm/src/text.d.ts.map +1 -0
- package/esm/src/text.js +3 -0
- package/esm/src/types.d.ts +93 -35
- package/esm/src/types.d.ts.map +1 -1
- package/esm/src/types.js +12 -1
- package/package.json +1 -1
- package/script/deps/jsr.io/@std/collections/{1.1.6 → 1.1.7}/deep_merge.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/front-matter/1.0.9/yaml.js +1 -1
- package/script/deps/jsr.io/@std/internal/1.0.13/_os.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/_os.js +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/os.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/os.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/basename.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/constants.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/dirname.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/extname.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/format.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/from_file_url.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/join.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/join_globs.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/normalize.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/normalize_glob.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/parse.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/relative.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/resolve.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.js +1 -1
- package/script/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.js +1 -1
- package/script/deps/jsr.io/@std/toml/1.0.11/_parser.js +1 -1
- package/script/deps/jsr.io/@std/yaml/1.1.0/_chars.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_loader_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_loader_state.js +12 -12
- package/script/deps/jsr.io/@std/yaml/1.1.0/_schema.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/binary.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/bool.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/float.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/float.js +4 -4
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/int.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/map.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/merge.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/nil.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/omap.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/pairs.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/regexp.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/seq.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/set.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/timestamp.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type/undefined.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_type.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.1.0/parse.d.ts.map +1 -0
- package/script/mod.d.ts +12 -4
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +14 -5
- package/script/src/builtins.d.ts +0 -2
- package/script/src/builtins.d.ts.map +1 -1
- package/script/src/builtins.js +0 -37
- package/script/src/loader.d.ts.map +1 -1
- package/script/src/loader.js +16 -8
- package/script/src/markdown.d.ts.map +1 -1
- package/script/src/markdown.js +16 -5
- package/script/src/runtime.d.ts +32 -1
- package/script/src/runtime.d.ts.map +1 -1
- package/script/src/runtime.js +207 -186
- package/script/src/state.d.ts.map +1 -1
- package/script/src/state.js +3 -2
- package/script/src/text.d.ts +2 -0
- package/script/src/text.d.ts.map +1 -0
- package/script/src/text.js +6 -0
- package/script/src/types.d.ts +93 -35
- package/script/src/types.d.ts.map +1 -1
- package/script/src/types.js +12 -1
- package/cards/context.card.md +0 -9
- package/cards/end.card.md +0 -10
- package/cards/generate-test-input.card.md +0 -12
- package/cards/respond.card.md +0 -10
- package/decks/anthropic/agent-sdk/PROMPT.md +0 -9
- package/decks/openai/codex-sdk/PROMPT.md +0 -9
- package/decks/openai/codex-sdk/codex_client.ts +0 -109
- package/decks/openai/codex-sdk/codex_sdk_bridge.deck.ts +0 -36
- package/esm/cards/context.card.md +0 -9
- package/esm/cards/end.card.md +0 -10
- package/esm/cards/generate-test-input.card.md +0 -12
- package/esm/cards/respond.card.md +0 -10
- package/esm/decks/anthropic/agent-sdk/PROMPT.md +0 -9
- package/esm/decks/openai/codex-sdk/PROMPT.md +0 -9
- package/esm/decks/openai/codex-sdk/codex_client.ts +0 -109
- package/esm/decks/openai/codex-sdk/codex_sdk_bridge.deck.ts +0 -36
- package/esm/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_chars.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_loader_state.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_schema.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/binary.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/bool.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/float.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/int.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/map.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/merge.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/nil.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/omap.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/pairs.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/regexp.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/seq.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/set.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/timestamp.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type/undefined.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_type.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_utils.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/yaml/1.0.12/parse.d.ts.map +0 -1
- package/script/cards/context.card.md +0 -9
- package/script/cards/end.card.md +0 -10
- package/script/cards/generate-test-input.card.md +0 -12
- package/script/cards/respond.card.md +0 -10
- package/script/decks/anthropic/agent-sdk/PROMPT.md +0 -9
- package/script/decks/openai/codex-sdk/PROMPT.md +0 -9
- package/script/decks/openai/codex-sdk/codex_client.ts +0 -109
- package/script/decks/openai/codex-sdk/codex_sdk_bridge.deck.ts +0 -36
- package/script/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_chars.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_loader_state.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_schema.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/binary.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/bool.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/float.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/int.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/map.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/merge.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/nil.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/omap.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/pairs.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/regexp.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/seq.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/set.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/str.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/timestamp.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type/undefined.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_type.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/_utils.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/yaml/1.0.12/parse.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/collections/{1.1.6 → 1.1.7}/deep_merge.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/collections/{1.1.6 → 1.1.7}/deep_merge.js +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/_os.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/os.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_chars.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_chars.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_loader_state.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_schema.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_schema.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/binary.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/binary.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/bool.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/bool.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/float.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/int.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/int.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/map.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/map.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/merge.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/merge.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/nil.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/nil.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/omap.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/omap.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/pairs.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/pairs.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/regexp.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/regexp.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/seq.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/seq.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/set.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/set.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/str.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/str.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/timestamp.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/timestamp.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/undefined.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/undefined.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_utils.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_utils.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/parse.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/parse.js +0 -0
- /package/script/deps/jsr.io/@std/collections/{1.1.6 → 1.1.7}/deep_merge.d.ts +0 -0
- /package/script/deps/jsr.io/@std/collections/{1.1.6 → 1.1.7}/deep_merge.js +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/_os.d.ts +0 -0
- /package/script/deps/jsr.io/@std/internal/{1.0.12 → 1.0.13}/os.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_chars.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_chars.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_loader_state.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_schema.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_schema.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/binary.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/binary.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/bool.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/bool.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/float.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/int.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/int.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/map.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/map.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/merge.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/merge.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/nil.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/nil.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/omap.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/omap.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/pairs.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/pairs.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/regexp.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/regexp.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/seq.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/seq.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/set.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/set.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/str.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/str.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/timestamp.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/timestamp.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/undefined.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type/undefined.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_type.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_utils.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/_utils.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/parse.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.12 → 1.1.0}/parse.js +0 -0
package/esm/src/runtime.js
CHANGED
|
@@ -3,6 +3,7 @@ import * as dntShim from "../_dnt.shims.js";
|
|
|
3
3
|
import * as path from "../deps/jsr.io/@std/path/1.1.4/mod.js";
|
|
4
4
|
import { DEFAULT_GUARDRAILS, DEFAULT_STATUS_DELAY_MS, GAMBIT_TOOL_CONTEXT, GAMBIT_TOOL_END, GAMBIT_TOOL_INIT, GAMBIT_TOOL_RESPOND, } from "./constants.js";
|
|
5
5
|
import { loadDeck } from "./loader.js";
|
|
6
|
+
import { joinTextParts } from "./text.js";
|
|
6
7
|
import { canReadPath, canRunCommand, canRunPath, canWritePath, intersectPermissions, resolveEffectivePermissions, } from "./permissions.js";
|
|
7
8
|
import { ExecToolUnsupportedHostError, executeBuiltinCommand, } from "./runtime_exec_host.js";
|
|
8
9
|
import { createWorkerSandboxBridge, isWorkerSandboxHostSupported, WorkerSandboxUnsupportedHostError, } from "./runtime_worker_host.js";
|
|
@@ -18,6 +19,19 @@ function randomId(prefix) {
|
|
|
18
19
|
// Keep IDs short enough for OpenAI/OpenRouter tool_call id limits (~40 chars).
|
|
19
20
|
return `${prefix}-${suffix}`;
|
|
20
21
|
}
|
|
22
|
+
export function stringifyResponseOutput(output) {
|
|
23
|
+
const parts = [];
|
|
24
|
+
for (const item of output) {
|
|
25
|
+
if (item.type !== "message" || item.role !== "assistant")
|
|
26
|
+
continue;
|
|
27
|
+
for (const content of item.content) {
|
|
28
|
+
if (content.type === "output_text") {
|
|
29
|
+
parts.push(content.text);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return parts.join("");
|
|
34
|
+
}
|
|
21
35
|
const WORKER_SANDBOX_ENV = "GAMBIT_DECK_WORKER_SANDBOX";
|
|
22
36
|
const WORKER_TIMEOUT_MESSAGE = "Timeout exceeded";
|
|
23
37
|
const RUN_CANCELED_MESSAGE = "Run canceled";
|
|
@@ -444,6 +458,7 @@ export async function runDeck(opts) {
|
|
|
444
458
|
initialUserMessage: opts.initialUserMessage,
|
|
445
459
|
parentActionCallId: opts.parentActionCallId,
|
|
446
460
|
modelProvider: opts.modelProvider,
|
|
461
|
+
modelResolver: opts.modelResolver,
|
|
447
462
|
input: resolvedInput,
|
|
448
463
|
defaultModel: opts.defaultModel,
|
|
449
464
|
modelOverride: opts.modelOverride,
|
|
@@ -476,6 +491,7 @@ export async function runDeck(opts) {
|
|
|
476
491
|
runId,
|
|
477
492
|
parentActionCallId: opts.parentActionCallId,
|
|
478
493
|
modelProvider: opts.modelProvider,
|
|
494
|
+
modelResolver: opts.modelResolver,
|
|
479
495
|
input: resolvedInput,
|
|
480
496
|
inputProvided: opts.inputProvided ?? true,
|
|
481
497
|
initialUserMessage: opts.initialUserMessage,
|
|
@@ -504,7 +520,13 @@ export async function runDeck(opts) {
|
|
|
504
520
|
});
|
|
505
521
|
}
|
|
506
522
|
}
|
|
507
|
-
const
|
|
523
|
+
const loadedDeck = await loadDeck(opts.path);
|
|
524
|
+
const deck = opts.runtimeTools?.length
|
|
525
|
+
? {
|
|
526
|
+
...loadedDeck,
|
|
527
|
+
tools: Array.from([...loadedDeck.tools, ...opts.runtimeTools].reduce((byName, tool) => byName.set(tool.name, tool), new Map()).values()),
|
|
528
|
+
}
|
|
529
|
+
: loadedDeck;
|
|
508
530
|
const permissions = resolveEffectivePermissions({
|
|
509
531
|
baseDir: path.dirname(deck.path),
|
|
510
532
|
parent: opts.parentPermissions,
|
|
@@ -563,6 +585,7 @@ export async function runDeck(opts) {
|
|
|
563
585
|
runId,
|
|
564
586
|
parentActionCallId: opts.parentActionCallId,
|
|
565
587
|
modelProvider: opts.modelProvider,
|
|
588
|
+
modelResolver: opts.modelResolver,
|
|
566
589
|
input: validatedInput,
|
|
567
590
|
inputProvided: opts.inputProvided ?? true,
|
|
568
591
|
initialUserMessage: opts.initialUserMessage,
|
|
@@ -609,6 +632,7 @@ export async function runDeck(opts) {
|
|
|
609
632
|
runId,
|
|
610
633
|
parentActionCallId: opts.parentActionCallId,
|
|
611
634
|
modelProvider: opts.modelProvider,
|
|
635
|
+
modelResolver: opts.modelResolver,
|
|
612
636
|
input: validatedInput,
|
|
613
637
|
inputProvided: opts.inputProvided ?? true,
|
|
614
638
|
initialUserMessage: opts.initialUserMessage,
|
|
@@ -646,6 +670,7 @@ export async function runDeck(opts) {
|
|
|
646
670
|
initialUserMessage: opts.initialUserMessage,
|
|
647
671
|
parentActionCallId: opts.parentActionCallId,
|
|
648
672
|
modelProvider: opts.modelProvider,
|
|
673
|
+
modelResolver: opts.modelResolver,
|
|
649
674
|
input: validatedInput,
|
|
650
675
|
defaultModel: opts.defaultModel,
|
|
651
676
|
modelOverride: opts.modelOverride,
|
|
@@ -686,11 +711,65 @@ export async function runDeck(opts) {
|
|
|
686
711
|
}
|
|
687
712
|
}
|
|
688
713
|
}
|
|
714
|
+
export async function runDeckResponses(opts) {
|
|
715
|
+
const runId = opts.runId ?? opts.state?.runId ?? randomId("run");
|
|
716
|
+
const traceEvents = [];
|
|
717
|
+
const responseEvents = [];
|
|
718
|
+
let output = [];
|
|
719
|
+
let state = opts.state;
|
|
720
|
+
let usage;
|
|
721
|
+
let finishReason;
|
|
722
|
+
const trace = (event) => {
|
|
723
|
+
traceEvents.push(event);
|
|
724
|
+
if (event.type === "model.result" &&
|
|
725
|
+
event.mode === "responses" &&
|
|
726
|
+
!event.parentActionCallId) {
|
|
727
|
+
output = event.responseItems ?? [];
|
|
728
|
+
usage = event.usage;
|
|
729
|
+
finishReason = event.finishReason;
|
|
730
|
+
}
|
|
731
|
+
if (event.type === "model.stream.event" ||
|
|
732
|
+
event.type.startsWith("response.")) {
|
|
733
|
+
responseEvents.push(event);
|
|
734
|
+
}
|
|
735
|
+
opts.trace?.(event);
|
|
736
|
+
};
|
|
737
|
+
const onStateUpdate = (nextState) => {
|
|
738
|
+
state = nextState;
|
|
739
|
+
opts.onStateUpdate?.(nextState);
|
|
740
|
+
};
|
|
741
|
+
const legacyResult = await runDeck({
|
|
742
|
+
...opts,
|
|
743
|
+
runId,
|
|
744
|
+
responsesMode: true,
|
|
745
|
+
trace,
|
|
746
|
+
onStateUpdate,
|
|
747
|
+
});
|
|
748
|
+
const effects = traceEvents.filter((event) => event.type === "action.start" ||
|
|
749
|
+
event.type === "action.end" ||
|
|
750
|
+
event.type === "tool.call" ||
|
|
751
|
+
event.type === "tool.result");
|
|
752
|
+
return {
|
|
753
|
+
runId,
|
|
754
|
+
status: "completed",
|
|
755
|
+
output,
|
|
756
|
+
traceEvents,
|
|
757
|
+
responseEvents,
|
|
758
|
+
state,
|
|
759
|
+
usage,
|
|
760
|
+
finishReason,
|
|
761
|
+
effects,
|
|
762
|
+
legacyResult,
|
|
763
|
+
};
|
|
764
|
+
}
|
|
689
765
|
function toProviderParams(params) {
|
|
690
766
|
if (!params)
|
|
691
767
|
return undefined;
|
|
692
|
-
const { model: _model, temperature, top_p, frequency_penalty, presence_penalty, max_tokens, verbosity, reasoning, } = params;
|
|
693
|
-
const out =
|
|
768
|
+
const { model: _model, temperature, top_p, frequency_penalty, presence_penalty, max_tokens, verbosity, reasoning, additionalParams, } = params;
|
|
769
|
+
const out = additionalParams &&
|
|
770
|
+
typeof additionalParams === "object" && !Array.isArray(additionalParams)
|
|
771
|
+
? { ...additionalParams }
|
|
772
|
+
: {};
|
|
694
773
|
if (temperature !== undefined)
|
|
695
774
|
out.temperature = temperature;
|
|
696
775
|
if (top_p !== undefined)
|
|
@@ -709,7 +788,7 @@ function toProviderParams(params) {
|
|
|
709
788
|
return Object.keys(out).length ? out : undefined;
|
|
710
789
|
}
|
|
711
790
|
async function resolveModelChoice(args) {
|
|
712
|
-
const resolver = args.
|
|
791
|
+
const resolver = args.modelResolver?.resolveModel;
|
|
713
792
|
if (resolver) {
|
|
714
793
|
return await resolver({
|
|
715
794
|
model: args.model,
|
|
@@ -729,6 +808,9 @@ async function resolveModelChoice(args) {
|
|
|
729
808
|
}
|
|
730
809
|
return { model: args.model, params: args.params };
|
|
731
810
|
}
|
|
811
|
+
function shouldExposeProviderToolArray(_model) {
|
|
812
|
+
return true;
|
|
813
|
+
}
|
|
732
814
|
function resolveContextSchema(deck) {
|
|
733
815
|
return deck.contextSchema ?? deck.inputSchema;
|
|
734
816
|
}
|
|
@@ -907,7 +989,7 @@ function messagesFromResponseItems(items) {
|
|
|
907
989
|
const callNameById = new Map();
|
|
908
990
|
for (const item of items) {
|
|
909
991
|
if (item.type === "message") {
|
|
910
|
-
const text = item.content.map((part) => part.text)
|
|
992
|
+
const text = joinTextParts(item.content.map((part) => part.text));
|
|
911
993
|
messages.push({
|
|
912
994
|
role: item.role,
|
|
913
995
|
content: text || null,
|
|
@@ -980,6 +1062,16 @@ const CORE_RESPONSE_ITEM_TYPES = new Set([
|
|
|
980
1062
|
"function_call",
|
|
981
1063
|
"function_call_output",
|
|
982
1064
|
"reasoning",
|
|
1065
|
+
"local_shell_call",
|
|
1066
|
+
"tool_search_call",
|
|
1067
|
+
"custom_tool_call",
|
|
1068
|
+
"custom_tool_call_output",
|
|
1069
|
+
"tool_search_output",
|
|
1070
|
+
"web_search_call",
|
|
1071
|
+
"image_generation_call",
|
|
1072
|
+
"ghost_snapshot",
|
|
1073
|
+
"compaction",
|
|
1074
|
+
"other",
|
|
983
1075
|
]);
|
|
984
1076
|
function isCoreResponseItemType(type) {
|
|
985
1077
|
return CORE_RESPONSE_ITEM_TYPES.has(type);
|
|
@@ -1950,7 +2042,7 @@ function mapResponseOutput(output) {
|
|
|
1950
2042
|
return {
|
|
1951
2043
|
message: {
|
|
1952
2044
|
role: "assistant",
|
|
1953
|
-
content: textParts.length ? textParts
|
|
2045
|
+
content: textParts.length ? joinTextParts(textParts) : null,
|
|
1954
2046
|
},
|
|
1955
2047
|
toolCalls: toolCalls.length ? toolCalls : undefined,
|
|
1956
2048
|
};
|
|
@@ -2014,6 +2106,7 @@ async function runComputeDeck(ctx) {
|
|
|
2014
2106
|
initialUserMessage: ctx.initialUserMessage,
|
|
2015
2107
|
parentActionCallId: ctx.parentActionCallId,
|
|
2016
2108
|
modelProvider: ctx.modelProvider,
|
|
2109
|
+
modelResolver: ctx.modelResolver,
|
|
2017
2110
|
input: ctx.input,
|
|
2018
2111
|
defaultModel: ctx.defaultModel,
|
|
2019
2112
|
modelOverride: ctx.modelOverride,
|
|
@@ -2724,11 +2817,13 @@ async function runLlmDeckInWorker(ctx) {
|
|
|
2724
2817
|
clearTimeout(timeoutId);
|
|
2725
2818
|
reject(err);
|
|
2726
2819
|
};
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2820
|
+
if (Number.isFinite(ctx.runDeadlineMs)) {
|
|
2821
|
+
const remainingMs = Math.max(0, Math.floor(ctx.runDeadlineMs - performance.now()));
|
|
2822
|
+
timeoutId = setTimeout(() => {
|
|
2823
|
+
finishReject(new Error(WORKER_TIMEOUT_MESSAGE));
|
|
2824
|
+
clearAndTerminate();
|
|
2825
|
+
}, remainingMs);
|
|
2826
|
+
}
|
|
2732
2827
|
worker.addEventListener("error", (event) => {
|
|
2733
2828
|
event.preventDefault?.();
|
|
2734
2829
|
finishReject(event.error ??
|
|
@@ -2768,54 +2863,11 @@ async function runLlmDeckInWorker(ctx) {
|
|
|
2768
2863
|
ctx.onStreamText?.(msg.chunk);
|
|
2769
2864
|
return;
|
|
2770
2865
|
}
|
|
2771
|
-
if (msg.type === "model.chat.request") {
|
|
2772
|
-
(async () => {
|
|
2773
|
-
const controller = new AbortController();
|
|
2774
|
-
modelRequestControllers.set(msg.requestId, controller);
|
|
2775
|
-
try {
|
|
2776
|
-
const result = await ctx.modelProvider.chat({
|
|
2777
|
-
...msg.input,
|
|
2778
|
-
signal: mergeAbortSignals(ctx.signal, controller.signal),
|
|
2779
|
-
onStreamText: (chunk) => {
|
|
2780
|
-
worker.postMessage({
|
|
2781
|
-
type: "model.chat.stream",
|
|
2782
|
-
requestId: msg.requestId,
|
|
2783
|
-
chunk,
|
|
2784
|
-
});
|
|
2785
|
-
},
|
|
2786
|
-
});
|
|
2787
|
-
worker.postMessage({
|
|
2788
|
-
type: "model.chat.result",
|
|
2789
|
-
requestId: msg.requestId,
|
|
2790
|
-
result,
|
|
2791
|
-
});
|
|
2792
|
-
}
|
|
2793
|
-
catch (err) {
|
|
2794
|
-
worker.postMessage({
|
|
2795
|
-
type: "model.chat.error",
|
|
2796
|
-
requestId: msg.requestId,
|
|
2797
|
-
error: {
|
|
2798
|
-
source: "model",
|
|
2799
|
-
name: err instanceof Error ? err.name : undefined,
|
|
2800
|
-
message: err instanceof Error ? err.message : String(err),
|
|
2801
|
-
code: err?.code,
|
|
2802
|
-
},
|
|
2803
|
-
});
|
|
2804
|
-
}
|
|
2805
|
-
finally {
|
|
2806
|
-
modelRequestControllers.delete(msg.requestId);
|
|
2807
|
-
}
|
|
2808
|
-
})();
|
|
2809
|
-
return;
|
|
2810
|
-
}
|
|
2811
2866
|
if (msg.type === "model.responses.request") {
|
|
2812
2867
|
(async () => {
|
|
2813
2868
|
const controller = new AbortController();
|
|
2814
2869
|
modelRequestControllers.set(msg.requestId, controller);
|
|
2815
2870
|
try {
|
|
2816
|
-
if (!ctx.modelProvider.responses) {
|
|
2817
|
-
throw new Error("Responses API unavailable for current model provider");
|
|
2818
|
-
}
|
|
2819
2871
|
const result = await ctx.modelProvider.responses({
|
|
2820
2872
|
...msg.input,
|
|
2821
2873
|
signal: mergeAbortSignals(ctx.signal, controller.signal),
|
|
@@ -2858,8 +2910,8 @@ async function runLlmDeckInWorker(ctx) {
|
|
|
2858
2910
|
if (msg.type === "model.resolveModel.request") {
|
|
2859
2911
|
(async () => {
|
|
2860
2912
|
try {
|
|
2861
|
-
const result = ctx.
|
|
2862
|
-
? await ctx.
|
|
2913
|
+
const result = ctx.modelResolver?.resolveModel
|
|
2914
|
+
? await ctx.modelResolver.resolveModel(msg.input)
|
|
2863
2915
|
: {
|
|
2864
2916
|
model: Array.isArray(msg.input.model)
|
|
2865
2917
|
? msg.input.model[0]
|
|
@@ -2991,11 +3043,13 @@ async function runComputeDeckInWorker(ctx) {
|
|
|
2991
3043
|
clearTimeout(timeoutId);
|
|
2992
3044
|
reject(err);
|
|
2993
3045
|
};
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
3046
|
+
if (Number.isFinite(ctx.runDeadlineMs)) {
|
|
3047
|
+
const remainingMs = Math.max(0, Math.floor(ctx.runDeadlineMs - performance.now()));
|
|
3048
|
+
timeoutId = setTimeout(() => {
|
|
3049
|
+
finishReject(new Error(WORKER_TIMEOUT_MESSAGE));
|
|
3050
|
+
clearAndTerminate();
|
|
3051
|
+
}, remainingMs);
|
|
3052
|
+
}
|
|
2999
3053
|
worker.addEventListener("error", (event) => {
|
|
3000
3054
|
event.preventDefault?.();
|
|
3001
3055
|
finishReject(event.error ??
|
|
@@ -3069,6 +3123,7 @@ async function runComputeDeckInWorker(ctx) {
|
|
|
3069
3123
|
path: req.payload.path,
|
|
3070
3124
|
input: req.payload.input,
|
|
3071
3125
|
modelProvider: ctx.modelProvider,
|
|
3126
|
+
modelResolver: ctx.modelResolver,
|
|
3072
3127
|
isRoot: false,
|
|
3073
3128
|
guardrails: ctx.guardrails,
|
|
3074
3129
|
depth: ctx.depth + 1,
|
|
@@ -3349,6 +3404,7 @@ async function runComputeDeckInProcess(ctx) {
|
|
|
3349
3404
|
path: childPath,
|
|
3350
3405
|
input: opts.input,
|
|
3351
3406
|
modelProvider: ctx.modelProvider,
|
|
3407
|
+
modelResolver: ctx.modelResolver,
|
|
3352
3408
|
isRoot: false,
|
|
3353
3409
|
guardrails: ctx.guardrails,
|
|
3354
3410
|
depth: ctx.depth + 1,
|
|
@@ -3412,8 +3468,7 @@ async function runLlmDeck(ctx) {
|
|
|
3412
3468
|
const { deck, guardrails, depth, modelProvider, input, runId, inputProvided, initialUserMessage, } = ctx;
|
|
3413
3469
|
const actionCallId = randomId("action");
|
|
3414
3470
|
const start = performance.now();
|
|
3415
|
-
const useResponses =
|
|
3416
|
-
ctx.state?.format === "responses";
|
|
3471
|
+
const useResponses = true;
|
|
3417
3472
|
const validateResponseItemEmission = createResponseItemEmissionValidator(deck);
|
|
3418
3473
|
const intermediateEmitter = ctx.parentActionCallId !== undefined
|
|
3419
3474
|
? createIntermediateChildResponseEmitter({
|
|
@@ -3568,10 +3623,15 @@ async function runLlmDeck(ctx) {
|
|
|
3568
3623
|
model: modelCandidate,
|
|
3569
3624
|
params: toProviderParams(deck.modelParams),
|
|
3570
3625
|
modelProvider,
|
|
3626
|
+
modelResolver: ctx.modelResolver,
|
|
3571
3627
|
deckPath: deck.path,
|
|
3572
3628
|
});
|
|
3573
3629
|
const model = resolved.model;
|
|
3574
3630
|
const providerParams = resolved.params;
|
|
3631
|
+
const providerTools = shouldExposeProviderToolArray(model) ? tools : [];
|
|
3632
|
+
const providerResponseTools = providerTools.length > 0
|
|
3633
|
+
? providerTools
|
|
3634
|
+
: undefined;
|
|
3575
3635
|
const stateMessages = ctx.state?.messages?.length;
|
|
3576
3636
|
ctx.trace?.({
|
|
3577
3637
|
type: "model.call",
|
|
@@ -3581,9 +3641,9 @@ async function runLlmDeck(ctx) {
|
|
|
3581
3641
|
model,
|
|
3582
3642
|
stream: ctx.stream,
|
|
3583
3643
|
messageCount: messages.length,
|
|
3584
|
-
toolCount:
|
|
3644
|
+
toolCount: providerTools.length,
|
|
3585
3645
|
messages: messages.map(sanitizeMessage),
|
|
3586
|
-
tools,
|
|
3646
|
+
tools: providerTools,
|
|
3587
3647
|
stateMessages,
|
|
3588
3648
|
mode: useResponses ? "responses" : "chat",
|
|
3589
3649
|
responseItems: useResponses
|
|
@@ -3592,144 +3652,93 @@ async function runLlmDeck(ctx) {
|
|
|
3592
3652
|
parentActionCallId: ctx.parentActionCallId,
|
|
3593
3653
|
});
|
|
3594
3654
|
let responseOutputItems;
|
|
3595
|
-
const responses = modelProvider.responses;
|
|
3596
3655
|
const projectedToolCalls = new Set();
|
|
3597
3656
|
const projectedToolResults = new Set();
|
|
3598
3657
|
const projectedToolNames = new Map();
|
|
3599
3658
|
const canonicalizeStreamEvent = createCanonicalStreamEventController();
|
|
3600
|
-
const result = (
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
},
|
|
3613
|
-
state: ctx.state,
|
|
3614
|
-
deckPath: deck.path,
|
|
3615
|
-
signal: ctx.signal,
|
|
3616
|
-
onStreamEvent: (ctx.trace || ctx.onStreamText || deck.handlers?.onIdle)
|
|
3617
|
-
? (event) => {
|
|
3618
|
-
const normalizedEvent = validateResponseEventItems(event, validateResponseItemEmission);
|
|
3619
|
-
const streamEvent = canonicalizeStreamEvent(normalizedEvent);
|
|
3620
|
-
if (!streamEvent)
|
|
3621
|
-
return;
|
|
3622
|
-
if (ctx.trace) {
|
|
3623
|
-
const handledAsResponse = traceOpenResponsesStreamEvent({
|
|
3624
|
-
streamEvent,
|
|
3625
|
-
runId,
|
|
3626
|
-
actionCallId,
|
|
3627
|
-
deckPath: deck.path,
|
|
3628
|
-
model,
|
|
3629
|
-
parentActionCallId: ctx.parentActionCallId,
|
|
3630
|
-
trace: ctx.trace,
|
|
3631
|
-
});
|
|
3632
|
-
if (!handledAsResponse) {
|
|
3633
|
-
ctx.trace({
|
|
3634
|
-
type: "model.stream.event",
|
|
3635
|
-
runId,
|
|
3636
|
-
actionCallId,
|
|
3637
|
-
deckPath: deck.path,
|
|
3638
|
-
model,
|
|
3639
|
-
event: streamEvent,
|
|
3640
|
-
parentActionCallId: ctx.parentActionCallId,
|
|
3641
|
-
});
|
|
3642
|
-
}
|
|
3643
|
-
projectStreamToolTraceEvents({
|
|
3644
|
-
streamEvent,
|
|
3645
|
-
runId,
|
|
3646
|
-
parentActionCallId: actionCallId,
|
|
3647
|
-
trace: ctx.trace,
|
|
3648
|
-
emittedCalls: projectedToolCalls,
|
|
3649
|
-
emittedResults: projectedToolResults,
|
|
3650
|
-
toolNames: projectedToolNames,
|
|
3651
|
-
});
|
|
3652
|
-
}
|
|
3653
|
-
const eventType = typeof streamEvent.type === "string"
|
|
3654
|
-
? streamEvent.type
|
|
3655
|
-
: "";
|
|
3656
|
-
if (eventType === "response.output_text.delta") {
|
|
3657
|
-
sawDelta = true;
|
|
3658
|
-
const delta = typeof streamEvent.delta === "string"
|
|
3659
|
-
? streamEvent.delta
|
|
3660
|
-
: "";
|
|
3661
|
-
if (delta)
|
|
3662
|
-
wrappedOnStreamText(delta);
|
|
3663
|
-
}
|
|
3664
|
-
else if (eventType === "response.output_text.done" && !sawDelta) {
|
|
3665
|
-
const text = typeof streamEvent.text === "string"
|
|
3666
|
-
? streamEvent.text
|
|
3667
|
-
: "";
|
|
3668
|
-
if (text)
|
|
3669
|
-
wrappedOnStreamText(text);
|
|
3670
|
-
}
|
|
3671
|
-
}
|
|
3672
|
-
: undefined,
|
|
3673
|
-
});
|
|
3674
|
-
responseOutputItems = validateResponseOutputItems(response.output ?? [], validateResponseItemEmission, "response.output");
|
|
3675
|
-
const mapped = mapResponseOutput(responseOutputItems);
|
|
3676
|
-
return {
|
|
3677
|
-
message: mapped.message,
|
|
3678
|
-
finishReason: mapped.toolCalls?.length ? "tool_calls" : "stop",
|
|
3679
|
-
toolCalls: mapped.toolCalls,
|
|
3680
|
-
usage: response.usage,
|
|
3681
|
-
updatedState: response.updatedState,
|
|
3682
|
-
};
|
|
3683
|
-
})()
|
|
3684
|
-
: await modelProvider.chat({
|
|
3685
|
-
model,
|
|
3686
|
-
messages,
|
|
3687
|
-
tools,
|
|
3688
|
-
stream: ctx.stream,
|
|
3659
|
+
const result = await (async () => {
|
|
3660
|
+
const responseItems = responseItemsFromMessages(messages);
|
|
3661
|
+
let sawDelta = false;
|
|
3662
|
+
const response = await modelProvider.responses({
|
|
3663
|
+
request: {
|
|
3664
|
+
model,
|
|
3665
|
+
input: responseItems,
|
|
3666
|
+
tools: providerResponseTools,
|
|
3667
|
+
text: responseTextConfig,
|
|
3668
|
+
stream: ctx.stream,
|
|
3669
|
+
params: providerParams,
|
|
3670
|
+
},
|
|
3689
3671
|
state: ctx.state,
|
|
3690
3672
|
deckPath: deck.path,
|
|
3691
3673
|
signal: ctx.signal,
|
|
3692
|
-
|
|
3693
|
-
onStreamText: (ctx.onStreamText || deck.handlers?.onIdle)
|
|
3694
|
-
? wrappedOnStreamText
|
|
3695
|
-
: undefined,
|
|
3696
|
-
onStreamEvent: ctx.trace
|
|
3674
|
+
onStreamEvent: (ctx.trace || ctx.onStreamText || deck.handlers?.onIdle)
|
|
3697
3675
|
? (event) => {
|
|
3698
|
-
const
|
|
3676
|
+
const normalizedEvent = validateResponseEventItems(event, validateResponseItemEmission);
|
|
3677
|
+
const streamEvent = canonicalizeStreamEvent(normalizedEvent);
|
|
3699
3678
|
if (!streamEvent)
|
|
3700
3679
|
return;
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
actionCallId,
|
|
3705
|
-
deckPath: deck.path,
|
|
3706
|
-
model,
|
|
3707
|
-
parentActionCallId: ctx.parentActionCallId,
|
|
3708
|
-
trace: ctx.trace,
|
|
3709
|
-
});
|
|
3710
|
-
if (!handledAsResponse) {
|
|
3711
|
-
ctx.trace?.({
|
|
3712
|
-
type: "model.stream.event",
|
|
3680
|
+
if (ctx.trace) {
|
|
3681
|
+
const handledAsResponse = traceOpenResponsesStreamEvent({
|
|
3682
|
+
streamEvent,
|
|
3713
3683
|
runId,
|
|
3714
3684
|
actionCallId,
|
|
3715
3685
|
deckPath: deck.path,
|
|
3716
3686
|
model,
|
|
3717
|
-
event: streamEvent,
|
|
3718
3687
|
parentActionCallId: ctx.parentActionCallId,
|
|
3688
|
+
trace: ctx.trace,
|
|
3719
3689
|
});
|
|
3690
|
+
if (!handledAsResponse) {
|
|
3691
|
+
ctx.trace({
|
|
3692
|
+
type: "model.stream.event",
|
|
3693
|
+
runId,
|
|
3694
|
+
actionCallId,
|
|
3695
|
+
deckPath: deck.path,
|
|
3696
|
+
model,
|
|
3697
|
+
event: streamEvent,
|
|
3698
|
+
parentActionCallId: ctx.parentActionCallId,
|
|
3699
|
+
});
|
|
3700
|
+
}
|
|
3701
|
+
projectStreamToolTraceEvents({
|
|
3702
|
+
streamEvent,
|
|
3703
|
+
runId,
|
|
3704
|
+
parentActionCallId: actionCallId,
|
|
3705
|
+
trace: ctx.trace,
|
|
3706
|
+
emittedCalls: projectedToolCalls,
|
|
3707
|
+
emittedResults: projectedToolResults,
|
|
3708
|
+
toolNames: projectedToolNames,
|
|
3709
|
+
});
|
|
3710
|
+
}
|
|
3711
|
+
const eventType = typeof streamEvent.type === "string"
|
|
3712
|
+
? streamEvent.type
|
|
3713
|
+
: "";
|
|
3714
|
+
if (eventType === "response.output_text.delta") {
|
|
3715
|
+
sawDelta = true;
|
|
3716
|
+
const delta = typeof streamEvent.delta === "string"
|
|
3717
|
+
? streamEvent.delta
|
|
3718
|
+
: "";
|
|
3719
|
+
if (delta)
|
|
3720
|
+
wrappedOnStreamText(delta);
|
|
3721
|
+
}
|
|
3722
|
+
else if (eventType === "response.output_text.done" && !sawDelta) {
|
|
3723
|
+
const text = typeof streamEvent.text === "string"
|
|
3724
|
+
? streamEvent.text
|
|
3725
|
+
: "";
|
|
3726
|
+
if (text)
|
|
3727
|
+
wrappedOnStreamText(text);
|
|
3720
3728
|
}
|
|
3721
|
-
projectStreamToolTraceEvents({
|
|
3722
|
-
streamEvent,
|
|
3723
|
-
runId,
|
|
3724
|
-
parentActionCallId: actionCallId,
|
|
3725
|
-
trace: ctx.trace,
|
|
3726
|
-
emittedCalls: projectedToolCalls,
|
|
3727
|
-
emittedResults: projectedToolResults,
|
|
3728
|
-
toolNames: projectedToolNames,
|
|
3729
|
-
});
|
|
3730
3729
|
}
|
|
3731
3730
|
: undefined,
|
|
3732
3731
|
});
|
|
3732
|
+
responseOutputItems = validateResponseOutputItems(response.output ?? [], validateResponseItemEmission, "response.output");
|
|
3733
|
+
const mapped = mapResponseOutput(responseOutputItems);
|
|
3734
|
+
return {
|
|
3735
|
+
message: mapped.message,
|
|
3736
|
+
finishReason: mapped.toolCalls?.length ? "tool_calls" : "stop",
|
|
3737
|
+
toolCalls: mapped.toolCalls,
|
|
3738
|
+
usage: response.usage,
|
|
3739
|
+
updatedState: response.updatedState,
|
|
3740
|
+
};
|
|
3741
|
+
})();
|
|
3733
3742
|
idleController.touch();
|
|
3734
3743
|
let message = result.message;
|
|
3735
3744
|
ctx.trace?.({
|
|
@@ -3925,9 +3934,10 @@ async function runLlmDeck(ctx) {
|
|
|
3925
3934
|
messages.push(...appendedMessages.map(sanitizeMessage));
|
|
3926
3935
|
idleController.touch();
|
|
3927
3936
|
}
|
|
3937
|
+
ensureRunActive(ctx.runDeadlineMs, ctx.signal);
|
|
3938
|
+
const state = computeState(result.updatedState);
|
|
3939
|
+
ctx.state = state;
|
|
3928
3940
|
if (ctx.onStateUpdate) {
|
|
3929
|
-
ensureRunActive(ctx.runDeadlineMs, ctx.signal);
|
|
3930
|
-
const state = computeState(result.updatedState);
|
|
3931
3941
|
ctx.onStateUpdate(state);
|
|
3932
3942
|
}
|
|
3933
3943
|
continue;
|
|
@@ -3947,8 +3957,9 @@ async function runLlmDeck(ctx) {
|
|
|
3947
3957
|
if (message.content !== null && message.content !== undefined) {
|
|
3948
3958
|
messages.push(sanitizeMessage(message));
|
|
3949
3959
|
ensureRunActive(ctx.runDeadlineMs, ctx.signal);
|
|
3960
|
+
const state = computeState(result.updatedState);
|
|
3961
|
+
ctx.state = state;
|
|
3950
3962
|
if (ctx.onStateUpdate) {
|
|
3951
|
-
const state = computeState(result.updatedState);
|
|
3952
3963
|
ctx.onStateUpdate(state);
|
|
3953
3964
|
}
|
|
3954
3965
|
if (ctx.parentActionCallId !== undefined &&
|
|
@@ -4630,6 +4641,7 @@ async function handleToolCall(call, ctx) {
|
|
|
4630
4641
|
path: action.path,
|
|
4631
4642
|
input: actionInput,
|
|
4632
4643
|
modelProvider: ctx.modelProvider,
|
|
4644
|
+
modelResolver: ctx.modelResolver,
|
|
4633
4645
|
isRoot: false,
|
|
4634
4646
|
guardrails: ctx.guardrails,
|
|
4635
4647
|
depth: ctx.depth + 1,
|
|
@@ -4729,6 +4741,7 @@ async function handleToolCall(call, ctx) {
|
|
|
4729
4741
|
path: action.path,
|
|
4730
4742
|
input: actionInput,
|
|
4731
4743
|
modelProvider: ctx.modelProvider,
|
|
4744
|
+
modelResolver: ctx.modelResolver,
|
|
4732
4745
|
isRoot: false,
|
|
4733
4746
|
guardrails: ctx.guardrails,
|
|
4734
4747
|
depth: ctx.depth + 1,
|
|
@@ -4778,6 +4791,7 @@ async function handleToolCall(call, ctx) {
|
|
|
4778
4791
|
parentActionCallId: ctx.parentActionCallId,
|
|
4779
4792
|
handlerPath: busyCfg.path,
|
|
4780
4793
|
modelProvider: ctx.modelProvider,
|
|
4794
|
+
modelResolver: ctx.modelResolver,
|
|
4781
4795
|
guardrails: ctx.guardrails,
|
|
4782
4796
|
depth: ctx.depth,
|
|
4783
4797
|
defaultModel: ctx.defaultModel,
|
|
@@ -4879,6 +4893,7 @@ async function handleToolCall(call, ctx) {
|
|
|
4879
4893
|
parentActionCallId: ctx.parentActionCallId,
|
|
4880
4894
|
handlerPath: busyCfg.path,
|
|
4881
4895
|
modelProvider: ctx.modelProvider,
|
|
4896
|
+
modelResolver: ctx.modelResolver,
|
|
4882
4897
|
guardrails: ctx.guardrails,
|
|
4883
4898
|
depth: ctx.depth,
|
|
4884
4899
|
defaultModel: ctx.defaultModel,
|
|
@@ -4968,6 +4983,7 @@ async function runBusyHandler(args) {
|
|
|
4968
4983
|
path: args.handlerPath,
|
|
4969
4984
|
input,
|
|
4970
4985
|
modelProvider: args.modelProvider,
|
|
4986
|
+
modelResolver: args.modelResolver,
|
|
4971
4987
|
isRoot: false,
|
|
4972
4988
|
guardrails: args.guardrails,
|
|
4973
4989
|
depth: args.depth + 1,
|
|
@@ -5061,6 +5077,7 @@ function createIdleController(args) {
|
|
|
5061
5077
|
runId: args.runId,
|
|
5062
5078
|
parentActionCallId: args.parentActionCallId,
|
|
5063
5079
|
modelProvider: args.modelProvider,
|
|
5080
|
+
modelResolver: args.modelResolver,
|
|
5064
5081
|
guardrails: args.guardrails,
|
|
5065
5082
|
depth: args.depth,
|
|
5066
5083
|
defaultModel: args.defaultModel,
|
|
@@ -5135,6 +5152,7 @@ async function runIdleHandler(args) {
|
|
|
5135
5152
|
path: args.handlerPath,
|
|
5136
5153
|
input,
|
|
5137
5154
|
modelProvider: args.modelProvider,
|
|
5155
|
+
modelResolver: args.modelResolver,
|
|
5138
5156
|
isRoot: false,
|
|
5139
5157
|
guardrails: args.guardrails,
|
|
5140
5158
|
depth: args.depth + 1,
|
|
@@ -5214,6 +5232,7 @@ async function maybeHandleError(args) {
|
|
|
5214
5232
|
path: handlerPath,
|
|
5215
5233
|
input: envelopeInput,
|
|
5216
5234
|
modelProvider: args.ctx.modelProvider,
|
|
5235
|
+
modelResolver: args.ctx.modelResolver,
|
|
5217
5236
|
isRoot: false,
|
|
5218
5237
|
guardrails: args.ctx.guardrails,
|
|
5219
5238
|
depth: args.ctx.depth + 1,
|
package/esm/src/state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/src/state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/src/state.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,WAAW,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,iBAAiB,CAAC,EAAE,aAAa,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC3B,MAAM,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AA2CF,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAsBlE;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,QAK5D"}
|