@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/script/src/runtime.js
CHANGED
|
@@ -35,13 +35,16 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.RunCanceledError = void 0;
|
|
37
37
|
exports.isGambitEndSignal = isGambitEndSignal;
|
|
38
|
+
exports.stringifyResponseOutput = stringifyResponseOutput;
|
|
38
39
|
exports.isRunCanceledError = isRunCanceledError;
|
|
39
40
|
exports.runDeck = runDeck;
|
|
41
|
+
exports.runDeckResponses = runDeckResponses;
|
|
40
42
|
// deno-lint-ignore-file gambit/no-unexplained-as-unknown
|
|
41
43
|
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
42
44
|
const path = __importStar(require("../deps/jsr.io/@std/path/1.1.4/mod.js"));
|
|
43
45
|
const constants_js_1 = require("./constants.js");
|
|
44
46
|
const loader_js_1 = require("./loader.js");
|
|
47
|
+
const text_js_1 = require("./text.js");
|
|
45
48
|
const permissions_js_1 = require("./permissions.js");
|
|
46
49
|
const runtime_exec_host_js_1 = require("./runtime_exec_host.js");
|
|
47
50
|
const runtime_worker_host_js_1 = require("./runtime_worker_host.js");
|
|
@@ -57,6 +60,19 @@ function randomId(prefix) {
|
|
|
57
60
|
// Keep IDs short enough for OpenAI/OpenRouter tool_call id limits (~40 chars).
|
|
58
61
|
return `${prefix}-${suffix}`;
|
|
59
62
|
}
|
|
63
|
+
function stringifyResponseOutput(output) {
|
|
64
|
+
const parts = [];
|
|
65
|
+
for (const item of output) {
|
|
66
|
+
if (item.type !== "message" || item.role !== "assistant")
|
|
67
|
+
continue;
|
|
68
|
+
for (const content of item.content) {
|
|
69
|
+
if (content.type === "output_text") {
|
|
70
|
+
parts.push(content.text);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return parts.join("");
|
|
75
|
+
}
|
|
60
76
|
const WORKER_SANDBOX_ENV = "GAMBIT_DECK_WORKER_SANDBOX";
|
|
61
77
|
const WORKER_TIMEOUT_MESSAGE = "Timeout exceeded";
|
|
62
78
|
const RUN_CANCELED_MESSAGE = "Run canceled";
|
|
@@ -484,6 +500,7 @@ async function runDeck(opts) {
|
|
|
484
500
|
initialUserMessage: opts.initialUserMessage,
|
|
485
501
|
parentActionCallId: opts.parentActionCallId,
|
|
486
502
|
modelProvider: opts.modelProvider,
|
|
503
|
+
modelResolver: opts.modelResolver,
|
|
487
504
|
input: resolvedInput,
|
|
488
505
|
defaultModel: opts.defaultModel,
|
|
489
506
|
modelOverride: opts.modelOverride,
|
|
@@ -516,6 +533,7 @@ async function runDeck(opts) {
|
|
|
516
533
|
runId,
|
|
517
534
|
parentActionCallId: opts.parentActionCallId,
|
|
518
535
|
modelProvider: opts.modelProvider,
|
|
536
|
+
modelResolver: opts.modelResolver,
|
|
519
537
|
input: resolvedInput,
|
|
520
538
|
inputProvided: opts.inputProvided ?? true,
|
|
521
539
|
initialUserMessage: opts.initialUserMessage,
|
|
@@ -544,7 +562,13 @@ async function runDeck(opts) {
|
|
|
544
562
|
});
|
|
545
563
|
}
|
|
546
564
|
}
|
|
547
|
-
const
|
|
565
|
+
const loadedDeck = await (0, loader_js_1.loadDeck)(opts.path);
|
|
566
|
+
const deck = opts.runtimeTools?.length
|
|
567
|
+
? {
|
|
568
|
+
...loadedDeck,
|
|
569
|
+
tools: Array.from([...loadedDeck.tools, ...opts.runtimeTools].reduce((byName, tool) => byName.set(tool.name, tool), new Map()).values()),
|
|
570
|
+
}
|
|
571
|
+
: loadedDeck;
|
|
548
572
|
const permissions = (0, permissions_js_1.resolveEffectivePermissions)({
|
|
549
573
|
baseDir: path.dirname(deck.path),
|
|
550
574
|
parent: opts.parentPermissions,
|
|
@@ -603,6 +627,7 @@ async function runDeck(opts) {
|
|
|
603
627
|
runId,
|
|
604
628
|
parentActionCallId: opts.parentActionCallId,
|
|
605
629
|
modelProvider: opts.modelProvider,
|
|
630
|
+
modelResolver: opts.modelResolver,
|
|
606
631
|
input: validatedInput,
|
|
607
632
|
inputProvided: opts.inputProvided ?? true,
|
|
608
633
|
initialUserMessage: opts.initialUserMessage,
|
|
@@ -649,6 +674,7 @@ async function runDeck(opts) {
|
|
|
649
674
|
runId,
|
|
650
675
|
parentActionCallId: opts.parentActionCallId,
|
|
651
676
|
modelProvider: opts.modelProvider,
|
|
677
|
+
modelResolver: opts.modelResolver,
|
|
652
678
|
input: validatedInput,
|
|
653
679
|
inputProvided: opts.inputProvided ?? true,
|
|
654
680
|
initialUserMessage: opts.initialUserMessage,
|
|
@@ -686,6 +712,7 @@ async function runDeck(opts) {
|
|
|
686
712
|
initialUserMessage: opts.initialUserMessage,
|
|
687
713
|
parentActionCallId: opts.parentActionCallId,
|
|
688
714
|
modelProvider: opts.modelProvider,
|
|
715
|
+
modelResolver: opts.modelResolver,
|
|
689
716
|
input: validatedInput,
|
|
690
717
|
defaultModel: opts.defaultModel,
|
|
691
718
|
modelOverride: opts.modelOverride,
|
|
@@ -726,11 +753,65 @@ async function runDeck(opts) {
|
|
|
726
753
|
}
|
|
727
754
|
}
|
|
728
755
|
}
|
|
756
|
+
async function runDeckResponses(opts) {
|
|
757
|
+
const runId = opts.runId ?? opts.state?.runId ?? randomId("run");
|
|
758
|
+
const traceEvents = [];
|
|
759
|
+
const responseEvents = [];
|
|
760
|
+
let output = [];
|
|
761
|
+
let state = opts.state;
|
|
762
|
+
let usage;
|
|
763
|
+
let finishReason;
|
|
764
|
+
const trace = (event) => {
|
|
765
|
+
traceEvents.push(event);
|
|
766
|
+
if (event.type === "model.result" &&
|
|
767
|
+
event.mode === "responses" &&
|
|
768
|
+
!event.parentActionCallId) {
|
|
769
|
+
output = event.responseItems ?? [];
|
|
770
|
+
usage = event.usage;
|
|
771
|
+
finishReason = event.finishReason;
|
|
772
|
+
}
|
|
773
|
+
if (event.type === "model.stream.event" ||
|
|
774
|
+
event.type.startsWith("response.")) {
|
|
775
|
+
responseEvents.push(event);
|
|
776
|
+
}
|
|
777
|
+
opts.trace?.(event);
|
|
778
|
+
};
|
|
779
|
+
const onStateUpdate = (nextState) => {
|
|
780
|
+
state = nextState;
|
|
781
|
+
opts.onStateUpdate?.(nextState);
|
|
782
|
+
};
|
|
783
|
+
const legacyResult = await runDeck({
|
|
784
|
+
...opts,
|
|
785
|
+
runId,
|
|
786
|
+
responsesMode: true,
|
|
787
|
+
trace,
|
|
788
|
+
onStateUpdate,
|
|
789
|
+
});
|
|
790
|
+
const effects = traceEvents.filter((event) => event.type === "action.start" ||
|
|
791
|
+
event.type === "action.end" ||
|
|
792
|
+
event.type === "tool.call" ||
|
|
793
|
+
event.type === "tool.result");
|
|
794
|
+
return {
|
|
795
|
+
runId,
|
|
796
|
+
status: "completed",
|
|
797
|
+
output,
|
|
798
|
+
traceEvents,
|
|
799
|
+
responseEvents,
|
|
800
|
+
state,
|
|
801
|
+
usage,
|
|
802
|
+
finishReason,
|
|
803
|
+
effects,
|
|
804
|
+
legacyResult,
|
|
805
|
+
};
|
|
806
|
+
}
|
|
729
807
|
function toProviderParams(params) {
|
|
730
808
|
if (!params)
|
|
731
809
|
return undefined;
|
|
732
|
-
const { model: _model, temperature, top_p, frequency_penalty, presence_penalty, max_tokens, verbosity, reasoning, } = params;
|
|
733
|
-
const out =
|
|
810
|
+
const { model: _model, temperature, top_p, frequency_penalty, presence_penalty, max_tokens, verbosity, reasoning, additionalParams, } = params;
|
|
811
|
+
const out = additionalParams &&
|
|
812
|
+
typeof additionalParams === "object" && !Array.isArray(additionalParams)
|
|
813
|
+
? { ...additionalParams }
|
|
814
|
+
: {};
|
|
734
815
|
if (temperature !== undefined)
|
|
735
816
|
out.temperature = temperature;
|
|
736
817
|
if (top_p !== undefined)
|
|
@@ -749,7 +830,7 @@ function toProviderParams(params) {
|
|
|
749
830
|
return Object.keys(out).length ? out : undefined;
|
|
750
831
|
}
|
|
751
832
|
async function resolveModelChoice(args) {
|
|
752
|
-
const resolver = args.
|
|
833
|
+
const resolver = args.modelResolver?.resolveModel;
|
|
753
834
|
if (resolver) {
|
|
754
835
|
return await resolver({
|
|
755
836
|
model: args.model,
|
|
@@ -769,6 +850,9 @@ async function resolveModelChoice(args) {
|
|
|
769
850
|
}
|
|
770
851
|
return { model: args.model, params: args.params };
|
|
771
852
|
}
|
|
853
|
+
function shouldExposeProviderToolArray(_model) {
|
|
854
|
+
return true;
|
|
855
|
+
}
|
|
772
856
|
function resolveContextSchema(deck) {
|
|
773
857
|
return deck.contextSchema ?? deck.inputSchema;
|
|
774
858
|
}
|
|
@@ -947,7 +1031,7 @@ function messagesFromResponseItems(items) {
|
|
|
947
1031
|
const callNameById = new Map();
|
|
948
1032
|
for (const item of items) {
|
|
949
1033
|
if (item.type === "message") {
|
|
950
|
-
const text = item.content.map((part) => part.text)
|
|
1034
|
+
const text = (0, text_js_1.joinTextParts)(item.content.map((part) => part.text));
|
|
951
1035
|
messages.push({
|
|
952
1036
|
role: item.role,
|
|
953
1037
|
content: text || null,
|
|
@@ -1020,6 +1104,16 @@ const CORE_RESPONSE_ITEM_TYPES = new Set([
|
|
|
1020
1104
|
"function_call",
|
|
1021
1105
|
"function_call_output",
|
|
1022
1106
|
"reasoning",
|
|
1107
|
+
"local_shell_call",
|
|
1108
|
+
"tool_search_call",
|
|
1109
|
+
"custom_tool_call",
|
|
1110
|
+
"custom_tool_call_output",
|
|
1111
|
+
"tool_search_output",
|
|
1112
|
+
"web_search_call",
|
|
1113
|
+
"image_generation_call",
|
|
1114
|
+
"ghost_snapshot",
|
|
1115
|
+
"compaction",
|
|
1116
|
+
"other",
|
|
1023
1117
|
]);
|
|
1024
1118
|
function isCoreResponseItemType(type) {
|
|
1025
1119
|
return CORE_RESPONSE_ITEM_TYPES.has(type);
|
|
@@ -1990,7 +2084,7 @@ function mapResponseOutput(output) {
|
|
|
1990
2084
|
return {
|
|
1991
2085
|
message: {
|
|
1992
2086
|
role: "assistant",
|
|
1993
|
-
content: textParts.length ?
|
|
2087
|
+
content: textParts.length ? (0, text_js_1.joinTextParts)(textParts) : null,
|
|
1994
2088
|
},
|
|
1995
2089
|
toolCalls: toolCalls.length ? toolCalls : undefined,
|
|
1996
2090
|
};
|
|
@@ -2054,6 +2148,7 @@ async function runComputeDeck(ctx) {
|
|
|
2054
2148
|
initialUserMessage: ctx.initialUserMessage,
|
|
2055
2149
|
parentActionCallId: ctx.parentActionCallId,
|
|
2056
2150
|
modelProvider: ctx.modelProvider,
|
|
2151
|
+
modelResolver: ctx.modelResolver,
|
|
2057
2152
|
input: ctx.input,
|
|
2058
2153
|
defaultModel: ctx.defaultModel,
|
|
2059
2154
|
modelOverride: ctx.modelOverride,
|
|
@@ -2764,11 +2859,13 @@ async function runLlmDeckInWorker(ctx) {
|
|
|
2764
2859
|
clearTimeout(timeoutId);
|
|
2765
2860
|
reject(err);
|
|
2766
2861
|
};
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2862
|
+
if (Number.isFinite(ctx.runDeadlineMs)) {
|
|
2863
|
+
const remainingMs = Math.max(0, Math.floor(ctx.runDeadlineMs - performance.now()));
|
|
2864
|
+
timeoutId = setTimeout(() => {
|
|
2865
|
+
finishReject(new Error(WORKER_TIMEOUT_MESSAGE));
|
|
2866
|
+
clearAndTerminate();
|
|
2867
|
+
}, remainingMs);
|
|
2868
|
+
}
|
|
2772
2869
|
worker.addEventListener("error", (event) => {
|
|
2773
2870
|
event.preventDefault?.();
|
|
2774
2871
|
finishReject(event.error ??
|
|
@@ -2808,54 +2905,11 @@ async function runLlmDeckInWorker(ctx) {
|
|
|
2808
2905
|
ctx.onStreamText?.(msg.chunk);
|
|
2809
2906
|
return;
|
|
2810
2907
|
}
|
|
2811
|
-
if (msg.type === "model.chat.request") {
|
|
2812
|
-
(async () => {
|
|
2813
|
-
const controller = new AbortController();
|
|
2814
|
-
modelRequestControllers.set(msg.requestId, controller);
|
|
2815
|
-
try {
|
|
2816
|
-
const result = await ctx.modelProvider.chat({
|
|
2817
|
-
...msg.input,
|
|
2818
|
-
signal: mergeAbortSignals(ctx.signal, controller.signal),
|
|
2819
|
-
onStreamText: (chunk) => {
|
|
2820
|
-
worker.postMessage({
|
|
2821
|
-
type: "model.chat.stream",
|
|
2822
|
-
requestId: msg.requestId,
|
|
2823
|
-
chunk,
|
|
2824
|
-
});
|
|
2825
|
-
},
|
|
2826
|
-
});
|
|
2827
|
-
worker.postMessage({
|
|
2828
|
-
type: "model.chat.result",
|
|
2829
|
-
requestId: msg.requestId,
|
|
2830
|
-
result,
|
|
2831
|
-
});
|
|
2832
|
-
}
|
|
2833
|
-
catch (err) {
|
|
2834
|
-
worker.postMessage({
|
|
2835
|
-
type: "model.chat.error",
|
|
2836
|
-
requestId: msg.requestId,
|
|
2837
|
-
error: {
|
|
2838
|
-
source: "model",
|
|
2839
|
-
name: err instanceof Error ? err.name : undefined,
|
|
2840
|
-
message: err instanceof Error ? err.message : String(err),
|
|
2841
|
-
code: err?.code,
|
|
2842
|
-
},
|
|
2843
|
-
});
|
|
2844
|
-
}
|
|
2845
|
-
finally {
|
|
2846
|
-
modelRequestControllers.delete(msg.requestId);
|
|
2847
|
-
}
|
|
2848
|
-
})();
|
|
2849
|
-
return;
|
|
2850
|
-
}
|
|
2851
2908
|
if (msg.type === "model.responses.request") {
|
|
2852
2909
|
(async () => {
|
|
2853
2910
|
const controller = new AbortController();
|
|
2854
2911
|
modelRequestControllers.set(msg.requestId, controller);
|
|
2855
2912
|
try {
|
|
2856
|
-
if (!ctx.modelProvider.responses) {
|
|
2857
|
-
throw new Error("Responses API unavailable for current model provider");
|
|
2858
|
-
}
|
|
2859
2913
|
const result = await ctx.modelProvider.responses({
|
|
2860
2914
|
...msg.input,
|
|
2861
2915
|
signal: mergeAbortSignals(ctx.signal, controller.signal),
|
|
@@ -2898,8 +2952,8 @@ async function runLlmDeckInWorker(ctx) {
|
|
|
2898
2952
|
if (msg.type === "model.resolveModel.request") {
|
|
2899
2953
|
(async () => {
|
|
2900
2954
|
try {
|
|
2901
|
-
const result = ctx.
|
|
2902
|
-
? await ctx.
|
|
2955
|
+
const result = ctx.modelResolver?.resolveModel
|
|
2956
|
+
? await ctx.modelResolver.resolveModel(msg.input)
|
|
2903
2957
|
: {
|
|
2904
2958
|
model: Array.isArray(msg.input.model)
|
|
2905
2959
|
? msg.input.model[0]
|
|
@@ -3031,11 +3085,13 @@ async function runComputeDeckInWorker(ctx) {
|
|
|
3031
3085
|
clearTimeout(timeoutId);
|
|
3032
3086
|
reject(err);
|
|
3033
3087
|
};
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3088
|
+
if (Number.isFinite(ctx.runDeadlineMs)) {
|
|
3089
|
+
const remainingMs = Math.max(0, Math.floor(ctx.runDeadlineMs - performance.now()));
|
|
3090
|
+
timeoutId = setTimeout(() => {
|
|
3091
|
+
finishReject(new Error(WORKER_TIMEOUT_MESSAGE));
|
|
3092
|
+
clearAndTerminate();
|
|
3093
|
+
}, remainingMs);
|
|
3094
|
+
}
|
|
3039
3095
|
worker.addEventListener("error", (event) => {
|
|
3040
3096
|
event.preventDefault?.();
|
|
3041
3097
|
finishReject(event.error ??
|
|
@@ -3109,6 +3165,7 @@ async function runComputeDeckInWorker(ctx) {
|
|
|
3109
3165
|
path: req.payload.path,
|
|
3110
3166
|
input: req.payload.input,
|
|
3111
3167
|
modelProvider: ctx.modelProvider,
|
|
3168
|
+
modelResolver: ctx.modelResolver,
|
|
3112
3169
|
isRoot: false,
|
|
3113
3170
|
guardrails: ctx.guardrails,
|
|
3114
3171
|
depth: ctx.depth + 1,
|
|
@@ -3389,6 +3446,7 @@ async function runComputeDeckInProcess(ctx) {
|
|
|
3389
3446
|
path: childPath,
|
|
3390
3447
|
input: opts.input,
|
|
3391
3448
|
modelProvider: ctx.modelProvider,
|
|
3449
|
+
modelResolver: ctx.modelResolver,
|
|
3392
3450
|
isRoot: false,
|
|
3393
3451
|
guardrails: ctx.guardrails,
|
|
3394
3452
|
depth: ctx.depth + 1,
|
|
@@ -3452,8 +3510,7 @@ async function runLlmDeck(ctx) {
|
|
|
3452
3510
|
const { deck, guardrails, depth, modelProvider, input, runId, inputProvided, initialUserMessage, } = ctx;
|
|
3453
3511
|
const actionCallId = randomId("action");
|
|
3454
3512
|
const start = performance.now();
|
|
3455
|
-
const useResponses =
|
|
3456
|
-
ctx.state?.format === "responses";
|
|
3513
|
+
const useResponses = true;
|
|
3457
3514
|
const validateResponseItemEmission = createResponseItemEmissionValidator(deck);
|
|
3458
3515
|
const intermediateEmitter = ctx.parentActionCallId !== undefined
|
|
3459
3516
|
? createIntermediateChildResponseEmitter({
|
|
@@ -3608,10 +3665,15 @@ async function runLlmDeck(ctx) {
|
|
|
3608
3665
|
model: modelCandidate,
|
|
3609
3666
|
params: toProviderParams(deck.modelParams),
|
|
3610
3667
|
modelProvider,
|
|
3668
|
+
modelResolver: ctx.modelResolver,
|
|
3611
3669
|
deckPath: deck.path,
|
|
3612
3670
|
});
|
|
3613
3671
|
const model = resolved.model;
|
|
3614
3672
|
const providerParams = resolved.params;
|
|
3673
|
+
const providerTools = shouldExposeProviderToolArray(model) ? tools : [];
|
|
3674
|
+
const providerResponseTools = providerTools.length > 0
|
|
3675
|
+
? providerTools
|
|
3676
|
+
: undefined;
|
|
3615
3677
|
const stateMessages = ctx.state?.messages?.length;
|
|
3616
3678
|
ctx.trace?.({
|
|
3617
3679
|
type: "model.call",
|
|
@@ -3621,9 +3683,9 @@ async function runLlmDeck(ctx) {
|
|
|
3621
3683
|
model,
|
|
3622
3684
|
stream: ctx.stream,
|
|
3623
3685
|
messageCount: messages.length,
|
|
3624
|
-
toolCount:
|
|
3686
|
+
toolCount: providerTools.length,
|
|
3625
3687
|
messages: messages.map(sanitizeMessage),
|
|
3626
|
-
tools,
|
|
3688
|
+
tools: providerTools,
|
|
3627
3689
|
stateMessages,
|
|
3628
3690
|
mode: useResponses ? "responses" : "chat",
|
|
3629
3691
|
responseItems: useResponses
|
|
@@ -3632,144 +3694,93 @@ async function runLlmDeck(ctx) {
|
|
|
3632
3694
|
parentActionCallId: ctx.parentActionCallId,
|
|
3633
3695
|
});
|
|
3634
3696
|
let responseOutputItems;
|
|
3635
|
-
const responses = modelProvider.responses;
|
|
3636
3697
|
const projectedToolCalls = new Set();
|
|
3637
3698
|
const projectedToolResults = new Set();
|
|
3638
3699
|
const projectedToolNames = new Map();
|
|
3639
3700
|
const canonicalizeStreamEvent = createCanonicalStreamEventController();
|
|
3640
|
-
const result = (
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
},
|
|
3653
|
-
state: ctx.state,
|
|
3654
|
-
deckPath: deck.path,
|
|
3655
|
-
signal: ctx.signal,
|
|
3656
|
-
onStreamEvent: (ctx.trace || ctx.onStreamText || deck.handlers?.onIdle)
|
|
3657
|
-
? (event) => {
|
|
3658
|
-
const normalizedEvent = validateResponseEventItems(event, validateResponseItemEmission);
|
|
3659
|
-
const streamEvent = canonicalizeStreamEvent(normalizedEvent);
|
|
3660
|
-
if (!streamEvent)
|
|
3661
|
-
return;
|
|
3662
|
-
if (ctx.trace) {
|
|
3663
|
-
const handledAsResponse = traceOpenResponsesStreamEvent({
|
|
3664
|
-
streamEvent,
|
|
3665
|
-
runId,
|
|
3666
|
-
actionCallId,
|
|
3667
|
-
deckPath: deck.path,
|
|
3668
|
-
model,
|
|
3669
|
-
parentActionCallId: ctx.parentActionCallId,
|
|
3670
|
-
trace: ctx.trace,
|
|
3671
|
-
});
|
|
3672
|
-
if (!handledAsResponse) {
|
|
3673
|
-
ctx.trace({
|
|
3674
|
-
type: "model.stream.event",
|
|
3675
|
-
runId,
|
|
3676
|
-
actionCallId,
|
|
3677
|
-
deckPath: deck.path,
|
|
3678
|
-
model,
|
|
3679
|
-
event: streamEvent,
|
|
3680
|
-
parentActionCallId: ctx.parentActionCallId,
|
|
3681
|
-
});
|
|
3682
|
-
}
|
|
3683
|
-
projectStreamToolTraceEvents({
|
|
3684
|
-
streamEvent,
|
|
3685
|
-
runId,
|
|
3686
|
-
parentActionCallId: actionCallId,
|
|
3687
|
-
trace: ctx.trace,
|
|
3688
|
-
emittedCalls: projectedToolCalls,
|
|
3689
|
-
emittedResults: projectedToolResults,
|
|
3690
|
-
toolNames: projectedToolNames,
|
|
3691
|
-
});
|
|
3692
|
-
}
|
|
3693
|
-
const eventType = typeof streamEvent.type === "string"
|
|
3694
|
-
? streamEvent.type
|
|
3695
|
-
: "";
|
|
3696
|
-
if (eventType === "response.output_text.delta") {
|
|
3697
|
-
sawDelta = true;
|
|
3698
|
-
const delta = typeof streamEvent.delta === "string"
|
|
3699
|
-
? streamEvent.delta
|
|
3700
|
-
: "";
|
|
3701
|
-
if (delta)
|
|
3702
|
-
wrappedOnStreamText(delta);
|
|
3703
|
-
}
|
|
3704
|
-
else if (eventType === "response.output_text.done" && !sawDelta) {
|
|
3705
|
-
const text = typeof streamEvent.text === "string"
|
|
3706
|
-
? streamEvent.text
|
|
3707
|
-
: "";
|
|
3708
|
-
if (text)
|
|
3709
|
-
wrappedOnStreamText(text);
|
|
3710
|
-
}
|
|
3711
|
-
}
|
|
3712
|
-
: undefined,
|
|
3713
|
-
});
|
|
3714
|
-
responseOutputItems = validateResponseOutputItems(response.output ?? [], validateResponseItemEmission, "response.output");
|
|
3715
|
-
const mapped = mapResponseOutput(responseOutputItems);
|
|
3716
|
-
return {
|
|
3717
|
-
message: mapped.message,
|
|
3718
|
-
finishReason: mapped.toolCalls?.length ? "tool_calls" : "stop",
|
|
3719
|
-
toolCalls: mapped.toolCalls,
|
|
3720
|
-
usage: response.usage,
|
|
3721
|
-
updatedState: response.updatedState,
|
|
3722
|
-
};
|
|
3723
|
-
})()
|
|
3724
|
-
: await modelProvider.chat({
|
|
3725
|
-
model,
|
|
3726
|
-
messages,
|
|
3727
|
-
tools,
|
|
3728
|
-
stream: ctx.stream,
|
|
3701
|
+
const result = await (async () => {
|
|
3702
|
+
const responseItems = responseItemsFromMessages(messages);
|
|
3703
|
+
let sawDelta = false;
|
|
3704
|
+
const response = await modelProvider.responses({
|
|
3705
|
+
request: {
|
|
3706
|
+
model,
|
|
3707
|
+
input: responseItems,
|
|
3708
|
+
tools: providerResponseTools,
|
|
3709
|
+
text: responseTextConfig,
|
|
3710
|
+
stream: ctx.stream,
|
|
3711
|
+
params: providerParams,
|
|
3712
|
+
},
|
|
3729
3713
|
state: ctx.state,
|
|
3730
3714
|
deckPath: deck.path,
|
|
3731
3715
|
signal: ctx.signal,
|
|
3732
|
-
|
|
3733
|
-
onStreamText: (ctx.onStreamText || deck.handlers?.onIdle)
|
|
3734
|
-
? wrappedOnStreamText
|
|
3735
|
-
: undefined,
|
|
3736
|
-
onStreamEvent: ctx.trace
|
|
3716
|
+
onStreamEvent: (ctx.trace || ctx.onStreamText || deck.handlers?.onIdle)
|
|
3737
3717
|
? (event) => {
|
|
3738
|
-
const
|
|
3718
|
+
const normalizedEvent = validateResponseEventItems(event, validateResponseItemEmission);
|
|
3719
|
+
const streamEvent = canonicalizeStreamEvent(normalizedEvent);
|
|
3739
3720
|
if (!streamEvent)
|
|
3740
3721
|
return;
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
actionCallId,
|
|
3745
|
-
deckPath: deck.path,
|
|
3746
|
-
model,
|
|
3747
|
-
parentActionCallId: ctx.parentActionCallId,
|
|
3748
|
-
trace: ctx.trace,
|
|
3749
|
-
});
|
|
3750
|
-
if (!handledAsResponse) {
|
|
3751
|
-
ctx.trace?.({
|
|
3752
|
-
type: "model.stream.event",
|
|
3722
|
+
if (ctx.trace) {
|
|
3723
|
+
const handledAsResponse = traceOpenResponsesStreamEvent({
|
|
3724
|
+
streamEvent,
|
|
3753
3725
|
runId,
|
|
3754
3726
|
actionCallId,
|
|
3755
3727
|
deckPath: deck.path,
|
|
3756
3728
|
model,
|
|
3757
|
-
event: streamEvent,
|
|
3758
3729
|
parentActionCallId: ctx.parentActionCallId,
|
|
3730
|
+
trace: ctx.trace,
|
|
3759
3731
|
});
|
|
3732
|
+
if (!handledAsResponse) {
|
|
3733
|
+
ctx.trace({
|
|
3734
|
+
type: "model.stream.event",
|
|
3735
|
+
runId,
|
|
3736
|
+
actionCallId,
|
|
3737
|
+
deckPath: deck.path,
|
|
3738
|
+
model,
|
|
3739
|
+
event: streamEvent,
|
|
3740
|
+
parentActionCallId: ctx.parentActionCallId,
|
|
3741
|
+
});
|
|
3742
|
+
}
|
|
3743
|
+
projectStreamToolTraceEvents({
|
|
3744
|
+
streamEvent,
|
|
3745
|
+
runId,
|
|
3746
|
+
parentActionCallId: actionCallId,
|
|
3747
|
+
trace: ctx.trace,
|
|
3748
|
+
emittedCalls: projectedToolCalls,
|
|
3749
|
+
emittedResults: projectedToolResults,
|
|
3750
|
+
toolNames: projectedToolNames,
|
|
3751
|
+
});
|
|
3752
|
+
}
|
|
3753
|
+
const eventType = typeof streamEvent.type === "string"
|
|
3754
|
+
? streamEvent.type
|
|
3755
|
+
: "";
|
|
3756
|
+
if (eventType === "response.output_text.delta") {
|
|
3757
|
+
sawDelta = true;
|
|
3758
|
+
const delta = typeof streamEvent.delta === "string"
|
|
3759
|
+
? streamEvent.delta
|
|
3760
|
+
: "";
|
|
3761
|
+
if (delta)
|
|
3762
|
+
wrappedOnStreamText(delta);
|
|
3763
|
+
}
|
|
3764
|
+
else if (eventType === "response.output_text.done" && !sawDelta) {
|
|
3765
|
+
const text = typeof streamEvent.text === "string"
|
|
3766
|
+
? streamEvent.text
|
|
3767
|
+
: "";
|
|
3768
|
+
if (text)
|
|
3769
|
+
wrappedOnStreamText(text);
|
|
3760
3770
|
}
|
|
3761
|
-
projectStreamToolTraceEvents({
|
|
3762
|
-
streamEvent,
|
|
3763
|
-
runId,
|
|
3764
|
-
parentActionCallId: actionCallId,
|
|
3765
|
-
trace: ctx.trace,
|
|
3766
|
-
emittedCalls: projectedToolCalls,
|
|
3767
|
-
emittedResults: projectedToolResults,
|
|
3768
|
-
toolNames: projectedToolNames,
|
|
3769
|
-
});
|
|
3770
3771
|
}
|
|
3771
3772
|
: undefined,
|
|
3772
3773
|
});
|
|
3774
|
+
responseOutputItems = validateResponseOutputItems(response.output ?? [], validateResponseItemEmission, "response.output");
|
|
3775
|
+
const mapped = mapResponseOutput(responseOutputItems);
|
|
3776
|
+
return {
|
|
3777
|
+
message: mapped.message,
|
|
3778
|
+
finishReason: mapped.toolCalls?.length ? "tool_calls" : "stop",
|
|
3779
|
+
toolCalls: mapped.toolCalls,
|
|
3780
|
+
usage: response.usage,
|
|
3781
|
+
updatedState: response.updatedState,
|
|
3782
|
+
};
|
|
3783
|
+
})();
|
|
3773
3784
|
idleController.touch();
|
|
3774
3785
|
let message = result.message;
|
|
3775
3786
|
ctx.trace?.({
|
|
@@ -3965,9 +3976,10 @@ async function runLlmDeck(ctx) {
|
|
|
3965
3976
|
messages.push(...appendedMessages.map(sanitizeMessage));
|
|
3966
3977
|
idleController.touch();
|
|
3967
3978
|
}
|
|
3979
|
+
ensureRunActive(ctx.runDeadlineMs, ctx.signal);
|
|
3980
|
+
const state = computeState(result.updatedState);
|
|
3981
|
+
ctx.state = state;
|
|
3968
3982
|
if (ctx.onStateUpdate) {
|
|
3969
|
-
ensureRunActive(ctx.runDeadlineMs, ctx.signal);
|
|
3970
|
-
const state = computeState(result.updatedState);
|
|
3971
3983
|
ctx.onStateUpdate(state);
|
|
3972
3984
|
}
|
|
3973
3985
|
continue;
|
|
@@ -3987,8 +3999,9 @@ async function runLlmDeck(ctx) {
|
|
|
3987
3999
|
if (message.content !== null && message.content !== undefined) {
|
|
3988
4000
|
messages.push(sanitizeMessage(message));
|
|
3989
4001
|
ensureRunActive(ctx.runDeadlineMs, ctx.signal);
|
|
4002
|
+
const state = computeState(result.updatedState);
|
|
4003
|
+
ctx.state = state;
|
|
3990
4004
|
if (ctx.onStateUpdate) {
|
|
3991
|
-
const state = computeState(result.updatedState);
|
|
3992
4005
|
ctx.onStateUpdate(state);
|
|
3993
4006
|
}
|
|
3994
4007
|
if (ctx.parentActionCallId !== undefined &&
|
|
@@ -4670,6 +4683,7 @@ async function handleToolCall(call, ctx) {
|
|
|
4670
4683
|
path: action.path,
|
|
4671
4684
|
input: actionInput,
|
|
4672
4685
|
modelProvider: ctx.modelProvider,
|
|
4686
|
+
modelResolver: ctx.modelResolver,
|
|
4673
4687
|
isRoot: false,
|
|
4674
4688
|
guardrails: ctx.guardrails,
|
|
4675
4689
|
depth: ctx.depth + 1,
|
|
@@ -4769,6 +4783,7 @@ async function handleToolCall(call, ctx) {
|
|
|
4769
4783
|
path: action.path,
|
|
4770
4784
|
input: actionInput,
|
|
4771
4785
|
modelProvider: ctx.modelProvider,
|
|
4786
|
+
modelResolver: ctx.modelResolver,
|
|
4772
4787
|
isRoot: false,
|
|
4773
4788
|
guardrails: ctx.guardrails,
|
|
4774
4789
|
depth: ctx.depth + 1,
|
|
@@ -4818,6 +4833,7 @@ async function handleToolCall(call, ctx) {
|
|
|
4818
4833
|
parentActionCallId: ctx.parentActionCallId,
|
|
4819
4834
|
handlerPath: busyCfg.path,
|
|
4820
4835
|
modelProvider: ctx.modelProvider,
|
|
4836
|
+
modelResolver: ctx.modelResolver,
|
|
4821
4837
|
guardrails: ctx.guardrails,
|
|
4822
4838
|
depth: ctx.depth,
|
|
4823
4839
|
defaultModel: ctx.defaultModel,
|
|
@@ -4919,6 +4935,7 @@ async function handleToolCall(call, ctx) {
|
|
|
4919
4935
|
parentActionCallId: ctx.parentActionCallId,
|
|
4920
4936
|
handlerPath: busyCfg.path,
|
|
4921
4937
|
modelProvider: ctx.modelProvider,
|
|
4938
|
+
modelResolver: ctx.modelResolver,
|
|
4922
4939
|
guardrails: ctx.guardrails,
|
|
4923
4940
|
depth: ctx.depth,
|
|
4924
4941
|
defaultModel: ctx.defaultModel,
|
|
@@ -5008,6 +5025,7 @@ async function runBusyHandler(args) {
|
|
|
5008
5025
|
path: args.handlerPath,
|
|
5009
5026
|
input,
|
|
5010
5027
|
modelProvider: args.modelProvider,
|
|
5028
|
+
modelResolver: args.modelResolver,
|
|
5011
5029
|
isRoot: false,
|
|
5012
5030
|
guardrails: args.guardrails,
|
|
5013
5031
|
depth: args.depth + 1,
|
|
@@ -5101,6 +5119,7 @@ function createIdleController(args) {
|
|
|
5101
5119
|
runId: args.runId,
|
|
5102
5120
|
parentActionCallId: args.parentActionCallId,
|
|
5103
5121
|
modelProvider: args.modelProvider,
|
|
5122
|
+
modelResolver: args.modelResolver,
|
|
5104
5123
|
guardrails: args.guardrails,
|
|
5105
5124
|
depth: args.depth,
|
|
5106
5125
|
defaultModel: args.defaultModel,
|
|
@@ -5175,6 +5194,7 @@ async function runIdleHandler(args) {
|
|
|
5175
5194
|
path: args.handlerPath,
|
|
5176
5195
|
input,
|
|
5177
5196
|
modelProvider: args.modelProvider,
|
|
5197
|
+
modelResolver: args.modelResolver,
|
|
5178
5198
|
isRoot: false,
|
|
5179
5199
|
guardrails: args.guardrails,
|
|
5180
5200
|
depth: args.depth + 1,
|
|
@@ -5254,6 +5274,7 @@ async function maybeHandleError(args) {
|
|
|
5254
5274
|
path: handlerPath,
|
|
5255
5275
|
input: envelopeInput,
|
|
5256
5276
|
modelProvider: args.ctx.modelProvider,
|
|
5277
|
+
modelResolver: args.ctx.modelResolver,
|
|
5257
5278
|
isRoot: false,
|
|
5258
5279
|
guardrails: args.ctx.guardrails,
|
|
5259
5280
|
depth: args.ctx.depth + 1,
|
|
@@ -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"}
|