@bolt-foundry/gambit-core 0.8.3 → 0.8.5-rc.11
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 +38 -7
- package/cards/context.card.md +4 -4
- package/decks/anthropic/agent-sdk/PROMPT.md +9 -0
- package/decks/openai/codex-sdk/PROMPT.md +9 -0
- package/decks/openai/codex-sdk/codex_client.ts +109 -0
- package/decks/openai/codex-sdk/codex_sdk_bridge.deck.ts +36 -0
- package/esm/cards/context.card.md +9 -0
- package/esm/cards/end.card.md +10 -0
- package/esm/cards/generate-test-input.card.md +12 -0
- package/esm/cards/respond.card.md +10 -0
- package/esm/decks/anthropic/agent-sdk/PROMPT.md +9 -0
- package/esm/decks/openai/codex-sdk/PROMPT.md +9 -0
- package/esm/decks/openai/codex-sdk/codex_client.ts +109 -0
- package/esm/decks/openai/codex-sdk/codex_sdk_bridge.deck.ts +36 -0
- package/{script/deps/jsr.io/@std/collections/1.1.4 → esm/deps/jsr.io/@std/collections/1.1.6}/deep_merge.d.ts +2 -2
- package/esm/deps/jsr.io/@std/collections/{1.1.4 → 1.1.6}/deep_merge.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/collections/{1.1.4 → 1.1.6}/deep_merge.js +29 -19
- package/esm/deps/jsr.io/@std/front-matter/1.0.9/yaml.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.0.11 → 1.0.12}/_chars.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/yaml/1.0.11 → esm/deps/jsr.io/@std/yaml/1.0.12}/_loader_state.d.ts +0 -5
- package/esm/deps/jsr.io/@std/yaml/1.0.12/_loader_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_loader_state.js +216 -175
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_schema.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/binary.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/bool.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/float.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/int.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/yaml/1.0.11 → esm/deps/jsr.io/@std/yaml/1.0.12}/_type/map.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/merge.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/nil.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/omap.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/pairs.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/regexp.d.ts.map +1 -1
- package/{script/deps/jsr.io/@std/yaml/1.0.11 → esm/deps/jsr.io/@std/yaml/1.0.12}/_type/seq.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/set.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/str.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/timestamp.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/undefined.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_utils.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/parse.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/parse.js +0 -2
- package/esm/mod.d.ts +10 -2
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +4 -0
- package/esm/schemas/graders/contexts/conversation.d.ts +22 -0
- package/esm/schemas/graders/contexts/conversation.d.ts.map +1 -0
- package/esm/schemas/graders/contexts/conversation.js +17 -0
- package/esm/schemas/graders/contexts/conversation.ts +40 -0
- package/esm/schemas/graders/contexts/conversation.zod.d.ts +3 -0
- package/esm/schemas/graders/contexts/conversation.zod.d.ts.map +1 -0
- package/esm/schemas/graders/contexts/conversation.zod.js +2 -0
- package/esm/schemas/graders/contexts/conversation.zod.ts +1 -0
- package/esm/schemas/graders/contexts/conversation_tools.d.ts +31 -0
- package/esm/schemas/graders/contexts/conversation_tools.d.ts.map +1 -0
- package/esm/schemas/graders/contexts/conversation_tools.js +25 -0
- package/esm/schemas/graders/contexts/conversation_tools.ts +63 -0
- package/esm/schemas/graders/contexts/conversation_tools.zod.d.ts +3 -0
- package/esm/schemas/graders/contexts/conversation_tools.zod.d.ts.map +1 -0
- package/esm/schemas/graders/contexts/conversation_tools.zod.js +2 -0
- package/esm/schemas/graders/contexts/conversation_tools.zod.ts +1 -0
- package/esm/schemas/graders/contexts/tools.d.ts +4 -0
- package/esm/schemas/graders/contexts/tools.d.ts.map +1 -0
- package/esm/schemas/graders/contexts/tools.js +3 -0
- package/esm/schemas/graders/contexts/tools.ts +5 -0
- package/esm/schemas/graders/contexts/tools.zod.d.ts +3 -0
- package/esm/schemas/graders/contexts/tools.zod.d.ts.map +1 -0
- package/esm/schemas/graders/contexts/tools.zod.js +2 -0
- package/esm/schemas/graders/contexts/tools.zod.ts +1 -0
- package/esm/schemas/graders/contexts/turn.d.ts +10 -0
- package/esm/schemas/graders/contexts/turn.d.ts.map +1 -0
- package/esm/schemas/graders/contexts/turn.js +8 -0
- package/esm/schemas/graders/contexts/turn.ts +17 -0
- package/esm/schemas/graders/contexts/turn.zod.d.ts +3 -0
- package/esm/schemas/graders/contexts/turn.zod.d.ts.map +1 -0
- package/esm/schemas/graders/contexts/turn.zod.js +2 -0
- package/esm/schemas/graders/contexts/turn.zod.ts +1 -0
- package/esm/schemas/graders/contexts/turn_tools.d.ts +32 -0
- package/esm/schemas/graders/contexts/turn_tools.d.ts.map +1 -0
- package/esm/schemas/graders/contexts/turn_tools.js +28 -0
- package/esm/schemas/graders/contexts/turn_tools.ts +63 -0
- package/esm/schemas/graders/contexts/turn_tools.zod.d.ts +3 -0
- package/esm/schemas/graders/contexts/turn_tools.zod.d.ts.map +1 -0
- package/esm/schemas/graders/contexts/turn_tools.zod.js +2 -0
- package/esm/schemas/graders/contexts/turn_tools.zod.ts +1 -0
- package/esm/schemas/graders/grader_output.d.ts +10 -0
- package/esm/schemas/graders/grader_output.d.ts.map +1 -0
- package/esm/schemas/graders/grader_output.js +8 -0
- package/esm/schemas/graders/grader_output.ts +15 -0
- package/esm/schemas/graders/grader_output.zod.d.ts +3 -0
- package/esm/schemas/graders/grader_output.zod.d.ts.map +1 -0
- package/esm/schemas/graders/grader_output.zod.js +2 -0
- package/esm/schemas/graders/grader_output.zod.ts +1 -0
- package/esm/schemas/graders/respond.d.ts +12 -0
- package/esm/schemas/graders/respond.d.ts.map +1 -0
- package/esm/schemas/graders/respond.js +10 -0
- package/esm/schemas/graders/respond.ts +19 -0
- package/esm/schemas/graders/respond.zod.d.ts +3 -0
- package/esm/schemas/graders/respond.zod.d.ts.map +1 -0
- package/esm/schemas/graders/respond.zod.js +2 -0
- package/esm/schemas/graders/respond.zod.ts +1 -0
- package/esm/schemas/scenarios/plain_chat_input_optional.d.ts +5 -0
- package/esm/schemas/scenarios/plain_chat_input_optional.d.ts.map +1 -0
- package/esm/schemas/scenarios/plain_chat_input_optional.js +5 -0
- package/esm/schemas/scenarios/plain_chat_input_optional.ts +6 -0
- package/esm/schemas/scenarios/plain_chat_input_optional.zod.d.ts +3 -0
- package/esm/schemas/scenarios/plain_chat_input_optional.zod.d.ts.map +1 -0
- package/esm/schemas/scenarios/plain_chat_input_optional.zod.js +2 -0
- package/esm/schemas/scenarios/plain_chat_input_optional.zod.ts +1 -0
- package/esm/schemas/scenarios/plain_chat_output.d.ts +5 -0
- package/esm/schemas/scenarios/plain_chat_output.d.ts.map +1 -0
- package/esm/schemas/scenarios/plain_chat_output.js +4 -0
- package/esm/schemas/scenarios/plain_chat_output.ts +5 -0
- package/esm/schemas/scenarios/plain_chat_output.zod.d.ts +3 -0
- package/esm/schemas/scenarios/plain_chat_output.zod.d.ts.map +1 -0
- package/esm/schemas/scenarios/plain_chat_output.zod.js +2 -0
- package/esm/schemas/scenarios/plain_chat_output.zod.ts +1 -0
- package/esm/snippets/context.md +8 -0
- package/esm/snippets/end.md +10 -0
- package/esm/snippets/generate-test-input.md +12 -0
- package/esm/snippets/init.md +12 -0
- package/esm/snippets/respond.md +10 -0
- package/esm/snippets/scenario-participant.md +10 -0
- package/esm/src/builtins.d.ts +2 -0
- package/esm/src/builtins.d.ts.map +1 -1
- package/esm/src/builtins.js +45 -1
- package/esm/src/constants.d.ts +0 -1
- package/esm/src/constants.d.ts.map +1 -1
- package/esm/src/constants.js +0 -4
- package/esm/src/loader.d.ts.map +1 -1
- package/esm/src/loader.js +159 -11
- package/esm/src/markdown.d.ts.map +1 -1
- package/esm/src/markdown.js +267 -41
- package/esm/src/permissions.d.ts +143 -0
- package/esm/src/permissions.d.ts.map +1 -0
- package/esm/src/permissions.js +406 -0
- package/esm/src/runtime.d.ts +43 -3
- package/esm/src/runtime.d.ts.map +1 -1
- package/esm/src/runtime.js +4372 -406
- package/esm/src/runtime_exec_host.d.ts +6 -0
- package/esm/src/runtime_exec_host.d.ts.map +1 -0
- package/esm/src/runtime_exec_host.js +17 -0
- package/esm/src/runtime_exec_host_contract.d.ts +23 -0
- package/esm/src/runtime_exec_host_contract.d.ts.map +1 -0
- package/esm/src/runtime_exec_host_contract.js +14 -0
- package/esm/src/runtime_exec_host_deno.d.ts +3 -0
- package/esm/src/runtime_exec_host_deno.d.ts.map +1 -0
- package/esm/src/runtime_exec_host_deno.js +35 -0
- package/esm/src/runtime_exec_host_unsupported.d.ts +3 -0
- package/esm/src/runtime_exec_host_unsupported.d.ts.map +1 -0
- package/esm/src/runtime_exec_host_unsupported.js +8 -0
- package/esm/src/runtime_worker_host.d.ts +6 -0
- package/esm/src/runtime_worker_host.d.ts.map +1 -0
- package/esm/src/runtime_worker_host.js +17 -0
- package/esm/src/runtime_worker_host_contract.d.ts +33 -0
- package/esm/src/runtime_worker_host_contract.d.ts.map +1 -0
- package/esm/src/runtime_worker_host_contract.js +14 -0
- package/esm/src/runtime_worker_host_deno.d.ts +3 -0
- package/esm/src/runtime_worker_host_deno.d.ts.map +1 -0
- package/esm/src/runtime_worker_host_deno.js +26 -0
- package/esm/src/runtime_worker_host_unsupported.d.ts +3 -0
- package/esm/src/runtime_worker_host_unsupported.d.ts.map +1 -0
- package/esm/src/runtime_worker_host_unsupported.js +8 -0
- package/esm/src/state.d.ts +1 -0
- package/esm/src/state.d.ts.map +1 -1
- package/esm/src/types.d.ts +259 -3
- package/esm/src/types.d.ts.map +1 -1
- package/package.json +73 -1
- package/schemas/graders/contexts/conversation.ts +32 -9
- package/schemas/graders/contexts/conversation.zod.ts +1 -0
- package/schemas/graders/contexts/conversation_tools.ts +63 -0
- package/schemas/graders/contexts/conversation_tools.zod.ts +1 -0
- package/schemas/graders/contexts/tools.ts +5 -0
- package/schemas/graders/contexts/tools.zod.ts +1 -0
- package/schemas/graders/contexts/turn.ts +8 -1
- package/schemas/graders/contexts/turn.zod.ts +1 -0
- package/schemas/graders/contexts/turn_tools.ts +63 -0
- package/schemas/graders/contexts/turn_tools.zod.ts +1 -0
- package/schemas/graders/grader_output.ts +9 -1
- package/schemas/graders/grader_output.zod.ts +1 -0
- package/schemas/graders/respond.ts +13 -3
- package/schemas/graders/respond.zod.ts +1 -0
- package/schemas/scenarios/plain_chat_input_optional.ts +6 -0
- package/schemas/scenarios/plain_chat_input_optional.zod.ts +1 -0
- package/schemas/scenarios/plain_chat_output.ts +5 -0
- package/schemas/scenarios/plain_chat_output.zod.ts +1 -0
- package/script/cards/context.card.md +9 -0
- package/script/cards/end.card.md +10 -0
- package/script/cards/generate-test-input.card.md +12 -0
- package/script/cards/respond.card.md +10 -0
- package/script/decks/anthropic/agent-sdk/PROMPT.md +9 -0
- package/script/decks/openai/codex-sdk/PROMPT.md +9 -0
- package/script/decks/openai/codex-sdk/codex_client.ts +109 -0
- package/script/decks/openai/codex-sdk/codex_sdk_bridge.deck.ts +36 -0
- package/{esm/deps/jsr.io/@std/collections/1.1.4 → script/deps/jsr.io/@std/collections/1.1.6}/deep_merge.d.ts +2 -2
- package/script/deps/jsr.io/@std/collections/{1.1.4 → 1.1.6}/deep_merge.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/collections/{1.1.4 → 1.1.6}/deep_merge.js +29 -19
- package/script/deps/jsr.io/@std/front-matter/1.0.9/yaml.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.0.11 → 1.0.12}/_chars.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/yaml/1.0.11 → script/deps/jsr.io/@std/yaml/1.0.12}/_loader_state.d.ts +0 -5
- package/script/deps/jsr.io/@std/yaml/1.0.12/_loader_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_loader_state.js +216 -175
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_schema.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/binary.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/bool.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/float.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/int.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/yaml/1.0.11 → script/deps/jsr.io/@std/yaml/1.0.12}/_type/map.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/merge.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/nil.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/omap.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/pairs.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/regexp.d.ts.map +1 -1
- package/{esm/deps/jsr.io/@std/yaml/1.0.11 → script/deps/jsr.io/@std/yaml/1.0.12}/_type/seq.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/set.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/str.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/timestamp.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/undefined.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_utils.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/parse.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/parse.js +0 -2
- package/script/mod.d.ts +10 -2
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +12 -1
- package/script/schemas/graders/contexts/conversation.d.ts +22 -0
- package/script/schemas/graders/contexts/conversation.d.ts.map +1 -0
- package/script/schemas/graders/contexts/conversation.js +20 -0
- package/script/schemas/graders/contexts/conversation.ts +40 -0
- package/script/schemas/graders/contexts/conversation.zod.d.ts +3 -0
- package/script/schemas/graders/contexts/conversation.zod.d.ts.map +1 -0
- package/script/schemas/graders/contexts/conversation.zod.js +9 -0
- package/script/schemas/graders/contexts/conversation.zod.ts +1 -0
- package/script/schemas/graders/contexts/conversation_tools.d.ts +31 -0
- package/script/schemas/graders/contexts/conversation_tools.d.ts.map +1 -0
- package/script/schemas/graders/contexts/conversation_tools.js +28 -0
- package/script/schemas/graders/contexts/conversation_tools.ts +63 -0
- package/script/schemas/graders/contexts/conversation_tools.zod.d.ts +3 -0
- package/script/schemas/graders/contexts/conversation_tools.zod.d.ts.map +1 -0
- package/script/schemas/graders/contexts/conversation_tools.zod.js +9 -0
- package/script/schemas/graders/contexts/conversation_tools.zod.ts +1 -0
- package/script/schemas/graders/contexts/tools.d.ts +4 -0
- package/script/schemas/graders/contexts/tools.d.ts.map +1 -0
- package/script/schemas/graders/contexts/tools.js +12 -0
- package/script/schemas/graders/contexts/tools.ts +5 -0
- package/script/schemas/graders/contexts/tools.zod.d.ts +3 -0
- package/script/schemas/graders/contexts/tools.zod.d.ts.map +1 -0
- package/script/schemas/graders/contexts/tools.zod.js +9 -0
- package/script/schemas/graders/contexts/tools.zod.ts +1 -0
- package/script/schemas/graders/contexts/turn.d.ts +10 -0
- package/script/schemas/graders/contexts/turn.d.ts.map +1 -0
- package/script/schemas/graders/contexts/turn.js +10 -0
- package/script/schemas/graders/contexts/turn.ts +17 -0
- package/script/schemas/graders/contexts/turn.zod.d.ts +3 -0
- package/script/schemas/graders/contexts/turn.zod.d.ts.map +1 -0
- package/script/schemas/graders/contexts/turn.zod.js +9 -0
- package/script/schemas/graders/contexts/turn.zod.ts +1 -0
- package/script/schemas/graders/contexts/turn_tools.d.ts +32 -0
- package/script/schemas/graders/contexts/turn_tools.d.ts.map +1 -0
- package/script/schemas/graders/contexts/turn_tools.js +31 -0
- package/script/schemas/graders/contexts/turn_tools.ts +63 -0
- package/script/schemas/graders/contexts/turn_tools.zod.d.ts +3 -0
- package/script/schemas/graders/contexts/turn_tools.zod.d.ts.map +1 -0
- package/script/schemas/graders/contexts/turn_tools.zod.js +9 -0
- package/script/schemas/graders/contexts/turn_tools.zod.ts +1 -0
- package/script/schemas/graders/grader_output.d.ts +10 -0
- package/script/schemas/graders/grader_output.d.ts.map +1 -0
- package/script/schemas/graders/grader_output.js +10 -0
- package/script/schemas/graders/grader_output.ts +15 -0
- package/script/schemas/graders/grader_output.zod.d.ts +3 -0
- package/script/schemas/graders/grader_output.zod.d.ts.map +1 -0
- package/script/schemas/graders/grader_output.zod.js +9 -0
- package/script/schemas/graders/grader_output.zod.ts +1 -0
- package/script/schemas/graders/respond.d.ts +12 -0
- package/script/schemas/graders/respond.d.ts.map +1 -0
- package/script/schemas/graders/respond.js +12 -0
- package/script/schemas/graders/respond.ts +19 -0
- package/script/schemas/graders/respond.zod.d.ts +3 -0
- package/script/schemas/graders/respond.zod.d.ts.map +1 -0
- package/script/schemas/graders/respond.zod.js +9 -0
- package/script/schemas/graders/respond.zod.ts +1 -0
- package/script/schemas/scenarios/plain_chat_input_optional.d.ts +5 -0
- package/script/schemas/scenarios/plain_chat_input_optional.d.ts.map +1 -0
- package/script/schemas/scenarios/plain_chat_input_optional.js +7 -0
- package/script/schemas/scenarios/plain_chat_input_optional.ts +6 -0
- package/script/schemas/scenarios/plain_chat_input_optional.zod.d.ts +3 -0
- package/script/schemas/scenarios/plain_chat_input_optional.zod.d.ts.map +1 -0
- package/script/schemas/scenarios/plain_chat_input_optional.zod.js +9 -0
- package/script/schemas/scenarios/plain_chat_input_optional.zod.ts +1 -0
- package/script/schemas/scenarios/plain_chat_output.d.ts +5 -0
- package/script/schemas/scenarios/plain_chat_output.d.ts.map +1 -0
- package/script/schemas/scenarios/plain_chat_output.js +6 -0
- package/script/schemas/scenarios/plain_chat_output.ts +5 -0
- package/script/schemas/scenarios/plain_chat_output.zod.d.ts +3 -0
- package/script/schemas/scenarios/plain_chat_output.zod.d.ts.map +1 -0
- package/script/schemas/scenarios/plain_chat_output.zod.js +9 -0
- package/script/schemas/scenarios/plain_chat_output.zod.ts +1 -0
- package/script/snippets/context.md +8 -0
- package/script/snippets/end.md +10 -0
- package/script/snippets/generate-test-input.md +12 -0
- package/script/snippets/init.md +12 -0
- package/script/snippets/respond.md +10 -0
- package/script/snippets/scenario-participant.md +10 -0
- package/script/src/builtins.d.ts +2 -0
- package/script/src/builtins.d.ts.map +1 -1
- package/script/src/builtins.js +47 -1
- package/script/src/constants.d.ts +0 -1
- package/script/src/constants.d.ts.map +1 -1
- package/script/src/constants.js +1 -5
- package/script/src/loader.d.ts.map +1 -1
- package/script/src/loader.js +158 -10
- package/script/src/markdown.d.ts.map +1 -1
- package/script/src/markdown.js +267 -41
- package/script/src/permissions.d.ts +143 -0
- package/script/src/permissions.d.ts.map +1 -0
- package/script/src/permissions.js +453 -0
- package/script/src/runtime.d.ts +43 -3
- package/script/src/runtime.d.ts.map +1 -1
- package/script/src/runtime.js +4374 -405
- package/script/src/runtime_exec_host.d.ts +6 -0
- package/script/src/runtime_exec_host.d.ts.map +1 -0
- package/script/src/runtime_exec_host.js +56 -0
- package/script/src/runtime_exec_host_contract.d.ts +23 -0
- package/script/src/runtime_exec_host_contract.d.ts.map +1 -0
- package/script/src/runtime_exec_host_contract.js +18 -0
- package/script/src/runtime_exec_host_deno.d.ts +3 -0
- package/script/src/runtime_exec_host_deno.d.ts.map +1 -0
- package/script/src/runtime_exec_host_deno.js +71 -0
- package/script/src/runtime_exec_host_unsupported.d.ts +3 -0
- package/script/src/runtime_exec_host_unsupported.d.ts.map +1 -0
- package/script/src/runtime_exec_host_unsupported.js +11 -0
- package/script/src/runtime_worker_host.d.ts +6 -0
- package/script/src/runtime_worker_host.d.ts.map +1 -0
- package/script/src/runtime_worker_host.js +56 -0
- package/script/src/runtime_worker_host_contract.d.ts +33 -0
- package/script/src/runtime_worker_host_contract.d.ts.map +1 -0
- package/script/src/runtime_worker_host_contract.js +18 -0
- package/script/src/runtime_worker_host_deno.d.ts +3 -0
- package/script/src/runtime_worker_host_deno.d.ts.map +1 -0
- package/script/src/runtime_worker_host_deno.js +62 -0
- package/script/src/runtime_worker_host_unsupported.d.ts +3 -0
- package/script/src/runtime_worker_host_unsupported.d.ts.map +1 -0
- package/script/src/runtime_worker_host_unsupported.js +11 -0
- package/script/src/state.d.ts +1 -0
- package/script/src/state.d.ts.map +1 -1
- package/script/src/types.d.ts +259 -3
- package/script/src/types.d.ts.map +1 -1
- package/snippets/context.md +8 -0
- package/snippets/end.md +10 -0
- package/snippets/generate-test-input.md +12 -0
- package/snippets/init.md +12 -0
- package/snippets/respond.md +10 -0
- package/snippets/scenario-participant.md +10 -0
- package/esm/deps/jsr.io/@std/collections/1.1.4/_utils.d.ts +0 -6
- package/esm/deps/jsr.io/@std/collections/1.1.4/_utils.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/collections/1.1.4/_utils.js +0 -18
- package/esm/deps/jsr.io/@std/yaml/1.0.11/_loader_state.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/collections/1.1.4/_utils.d.ts +0 -6
- package/script/deps/jsr.io/@std/collections/1.1.4/_utils.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/collections/1.1.4/_utils.js +0 -21
- package/script/deps/jsr.io/@std/yaml/1.0.11/_loader_state.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_chars.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_chars.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_schema.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_schema.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/binary.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/binary.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/bool.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/bool.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/float.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/float.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/int.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/int.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/map.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/map.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/merge.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/merge.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/nil.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/nil.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/omap.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/omap.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/pairs.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/pairs.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/regexp.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/regexp.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/seq.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/seq.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/set.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/set.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/str.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/str.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/timestamp.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/timestamp.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/undefined.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/undefined.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_utils.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_utils.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/parse.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_chars.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_chars.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_schema.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_schema.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/binary.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/binary.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/bool.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/bool.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/float.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/float.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/int.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/int.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/map.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/map.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/merge.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/merge.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/nil.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/nil.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/omap.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/omap.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/pairs.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/pairs.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/regexp.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/regexp.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/seq.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/seq.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/set.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/set.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/str.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/str.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/timestamp.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/timestamp.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/undefined.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/undefined.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_utils.d.ts +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_utils.js +0 -0
- /package/script/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/parse.d.ts +0 -0
package/README.md
CHANGED
|
@@ -112,6 +112,14 @@ export default defineCard({
|
|
|
112
112
|
});
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
+
For built-in Gambit schemas in TypeScript/compute decks, use canonical module
|
|
116
|
+
subpaths:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
import contextSchema from "@bolt-foundry/gambit-core/schemas/scenarios/plain_chat_input_optional.zod.ts";
|
|
120
|
+
import responseSchema from "@bolt-foundry/gambit-core/schemas/scenarios/plain_chat_output.zod.ts";
|
|
121
|
+
```
|
|
122
|
+
|
|
115
123
|
## Running decks programmatically
|
|
116
124
|
|
|
117
125
|
The runtime loads the deck (Markdown or TS) and steps through each pass. Provide
|
|
@@ -145,7 +153,13 @@ When the deck defines `run`/`execute`, the runtime hands you an
|
|
|
145
153
|
[`ExecutionContext`](src/types.ts) with:
|
|
146
154
|
|
|
147
155
|
- `ctx.input`: validated input (narrowable when you type the schema).
|
|
148
|
-
- `ctx.
|
|
156
|
+
- `ctx.initialUserMessage`: current turn user message when provided by caller.
|
|
157
|
+
- `ctx.getSessionMeta(key)`: read persisted run/session metadata.
|
|
158
|
+
- `ctx.setSessionMeta(key, value)`: persist metadata for later turns.
|
|
159
|
+
- `ctx.appendMessage({ role, content })`: append chat transcript messages from
|
|
160
|
+
execute decks.
|
|
161
|
+
- `ctx.spawnAndWait({ path, input, initialUserMessage? })`: call another deck
|
|
162
|
+
and await the result; user message is inherited by default unless overridden.
|
|
149
163
|
- `ctx.return(payload)`: respond early without running guards again.
|
|
150
164
|
- `ctx.fail({ message, code?, details? })`: aborts the run (throws).
|
|
151
165
|
- `ctx.log(...)`: emit structured trace entries for observability.
|
|
@@ -153,6 +167,22 @@ When the deck defines `run`/`execute`, the runtime hands you an
|
|
|
153
167
|
Pass `guardrails`, `initialUserMessage`, `modelOverride`, and
|
|
154
168
|
`allowRootStringInput` to `runDeck` when scripting custom runtimes.
|
|
155
169
|
|
|
170
|
+
### Worker sandbox behavior in `runDeck`
|
|
171
|
+
|
|
172
|
+
`gambit-core` keeps worker sandboxing opt-in and host-scoped:
|
|
173
|
+
|
|
174
|
+
- `runDeck` enables worker sandboxing only when `workerSandbox: true` is passed
|
|
175
|
+
(or when `GAMBIT_DECK_WORKER_SANDBOX=1|true|yes` is set in Deno).
|
|
176
|
+
- In Deno hosts, worker sandboxing keeps the current worker permission
|
|
177
|
+
enforcement model.
|
|
178
|
+
- In npm/Node/Bun hosts, requesting `workerSandbox: true` throws
|
|
179
|
+
`WorkerSandboxUnsupportedHostError`
|
|
180
|
+
(`code: "worker_sandbox_unsupported_host"`).
|
|
181
|
+
- `workerSandbox: true` with `signal` also throws
|
|
182
|
+
(`code: "worker_sandbox_signal_unsupported"`), because abort signaling is not
|
|
183
|
+
bridged into worker runtimes yet.
|
|
184
|
+
- If sandboxing is not requested, `runDeck` executes in-process.
|
|
185
|
+
|
|
156
186
|
## Loading Markdown decks and cards
|
|
157
187
|
|
|
158
188
|
Markdown files use front matter for metadata, with the body becoming the prompt.
|
|
@@ -181,8 +211,9 @@ clarifying questions before choosing an action.
|
|
|
181
211
|
`loadDeck` normalizes relative paths, merges card fragments, enforces unique
|
|
182
212
|
action names, and warns about deprecated fields (`actions`,
|
|
183
213
|
`handlers.onInterval`, `intervalMs`). The Markdown loader also injects helper
|
|
184
|
-
text for built-in tools like `gambit_context
|
|
185
|
-
`gambit_end`
|
|
214
|
+
text for built-in tools like `gambit_context` when you add `gambit://` markers.
|
|
215
|
+
Legacy `gambit_respond` and `gambit_end` markers are migration-only and now
|
|
216
|
+
hard-fail in default runtime paths.
|
|
186
217
|
|
|
187
218
|
## Compatibility and utilities
|
|
188
219
|
|
|
@@ -194,9 +225,9 @@ text for built-in tools like `gambit_context`, `gambit_respond`, and
|
|
|
194
225
|
conforming to the `responses()` signature in `ModelProvider`.
|
|
195
226
|
- **Constants**:
|
|
196
227
|
[`GAMBIT_TOOL_CONTEXT`, `GAMBIT_TOOL_RESPOND`, `GAMBIT_TOOL_END`](src/constants.ts)
|
|
197
|
-
(`GAMBIT_TOOL_INIT` remains as a deprecated alias).
|
|
198
|
-
|
|
199
|
-
|
|
228
|
+
(`GAMBIT_TOOL_INIT` remains as a deprecated alias). `GAMBIT_TOOL_RESPOND` and
|
|
229
|
+
`GAMBIT_TOOL_END` remain for migration detection and legacy trace handling;
|
|
230
|
+
default runtime paths no longer expose them as callable synthetic tools.
|
|
200
231
|
|
|
201
232
|
## Persisted state and traces
|
|
202
233
|
|
|
@@ -211,7 +242,7 @@ stream them to your own observability stack.
|
|
|
211
242
|
|
|
212
243
|
## Local development
|
|
213
244
|
|
|
214
|
-
From
|
|
245
|
+
From this package directory:
|
|
215
246
|
|
|
216
247
|
```
|
|
217
248
|
deno task fmt # format sources
|
package/cards/context.card.md
CHANGED
|
@@ -3,7 +3,7 @@ label = "Gambit context primer"
|
|
|
3
3
|
+++
|
|
4
4
|
|
|
5
5
|
You will automatically receive a `gambit_context` tool result at the start of
|
|
6
|
-
the run whenever the caller supplies `--context
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
the run whenever the caller supplies `--context`. This payload contains run
|
|
7
|
+
metadata or seeded inputs. Read it before you respond, treat it as trusted
|
|
8
|
+
context, and keep it on hand throughout the workflow so downstream actions have
|
|
9
|
+
the right data. Do not call `gambit_context` yourself; runtime injects it once.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
+++
|
|
2
|
+
label = "Anthropic agent SDK bridge"
|
|
3
|
+
contextSchema = "gambit://schemas/scenarios/plain_chat_input_optional.zod.ts"
|
|
4
|
+
responseSchema = "gambit://schemas/scenarios/plain_chat_output.zod.ts"
|
|
5
|
+
+++
|
|
6
|
+
|
|
7
|
+
This stdlib deck provides the default bridge between the Anthropic agent SDK
|
|
8
|
+
runtime and Gambit decks. It is intentionally minimal; downstream runners supply
|
|
9
|
+
the actual runtime behavior.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
+++
|
|
2
|
+
label = "Codex SDK bridge"
|
|
3
|
+
contextSchema = "gambit://schemas/scenarios/plain_chat_input_optional.zod.ts"
|
|
4
|
+
responseSchema = "gambit://schemas/scenarios/plain_chat_output.zod.ts"
|
|
5
|
+
+++
|
|
6
|
+
|
|
7
|
+
This stdlib deck provides the default bridge between the Codex SDK runtime and
|
|
8
|
+
Gambit decks. It is intentionally minimal; downstream runners supply the actual
|
|
9
|
+
runtime behavior.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export type CodexTurnInput = {
|
|
2
|
+
userText: string;
|
|
3
|
+
threadId?: string;
|
|
4
|
+
systemPrompt?: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type CodexTurnOutput = {
|
|
8
|
+
threadId: string;
|
|
9
|
+
assistantText: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type CodexEvent =
|
|
13
|
+
| { type: "thread.started"; thread_id?: unknown }
|
|
14
|
+
| {
|
|
15
|
+
type: "item.completed";
|
|
16
|
+
item?: { type?: unknown; text?: unknown };
|
|
17
|
+
}
|
|
18
|
+
| { type: string; [key: string]: unknown };
|
|
19
|
+
|
|
20
|
+
function runCwd(): string {
|
|
21
|
+
const botRoot = Deno.env.get("GAMBIT_BOT_ROOT");
|
|
22
|
+
if (typeof botRoot === "string" && botRoot.trim().length > 0) {
|
|
23
|
+
return botRoot.trim();
|
|
24
|
+
}
|
|
25
|
+
return Deno.cwd();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function parseCodexEvents(stdout: string): {
|
|
29
|
+
threadId?: string;
|
|
30
|
+
assistantText?: string;
|
|
31
|
+
} {
|
|
32
|
+
let threadId: string | undefined;
|
|
33
|
+
let assistantText: string | undefined;
|
|
34
|
+
|
|
35
|
+
for (const line of stdout.split(/\r?\n/)) {
|
|
36
|
+
const trimmed = line.trim();
|
|
37
|
+
if (!trimmed.startsWith("{")) continue;
|
|
38
|
+
let parsed: CodexEvent | null = null;
|
|
39
|
+
try {
|
|
40
|
+
parsed = JSON.parse(trimmed) as CodexEvent;
|
|
41
|
+
} catch {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (!parsed || typeof parsed !== "object") continue;
|
|
45
|
+
if (parsed.type === "thread.started") {
|
|
46
|
+
if (typeof parsed.thread_id === "string" && parsed.thread_id.trim()) {
|
|
47
|
+
threadId = parsed.thread_id.trim();
|
|
48
|
+
}
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (parsed.type === "item.completed") {
|
|
52
|
+
const item = parsed.item;
|
|
53
|
+
if (!item || typeof item !== "object") continue;
|
|
54
|
+
const rec = item as Record<string, unknown>;
|
|
55
|
+
if (rec.type !== "agent_message") continue;
|
|
56
|
+
if (typeof rec.text !== "string") continue;
|
|
57
|
+
const next = rec.text.trim();
|
|
58
|
+
if (next) assistantText = next;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return { threadId, assistantText };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function sendCodexTurn(
|
|
66
|
+
input: CodexTurnInput,
|
|
67
|
+
): Promise<CodexTurnOutput> {
|
|
68
|
+
const prompt = input.systemPrompt && input.systemPrompt.trim()
|
|
69
|
+
? `${input.systemPrompt.trim()}\n\n${input.userText}`
|
|
70
|
+
: input.userText;
|
|
71
|
+
|
|
72
|
+
const args = input.threadId
|
|
73
|
+
? [
|
|
74
|
+
"exec",
|
|
75
|
+
"resume",
|
|
76
|
+
"--skip-git-repo-check",
|
|
77
|
+
"--json",
|
|
78
|
+
input.threadId,
|
|
79
|
+
prompt,
|
|
80
|
+
]
|
|
81
|
+
: ["exec", "--skip-git-repo-check", "--json", prompt];
|
|
82
|
+
|
|
83
|
+
const out = await new Deno.Command("codex", {
|
|
84
|
+
args,
|
|
85
|
+
cwd: runCwd(),
|
|
86
|
+
stdout: "piped",
|
|
87
|
+
stderr: "piped",
|
|
88
|
+
}).output();
|
|
89
|
+
|
|
90
|
+
const stdout = new TextDecoder().decode(out.stdout);
|
|
91
|
+
const stderr = new TextDecoder().decode(out.stderr);
|
|
92
|
+
if (!out.success) {
|
|
93
|
+
throw new Error(
|
|
94
|
+
`codex exec failed (exit ${out.code}): ${stderr.trim() || stdout.trim()}`,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const parsed = parseCodexEvents(stdout);
|
|
99
|
+
const threadId = parsed.threadId ?? input.threadId;
|
|
100
|
+
if (!threadId) {
|
|
101
|
+
throw new Error(
|
|
102
|
+
`codex exec succeeded but no thread id found in output: ${stdout.trim()}`,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
threadId,
|
|
107
|
+
assistantText: parsed.assistantText ?? "",
|
|
108
|
+
};
|
|
109
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineDeck } from "../../../src/definitions.ts";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { sendCodexTurn } from "./codex_client.ts";
|
|
4
|
+
|
|
5
|
+
const CODEX_THREAD_META_KEY = "codex.threadId";
|
|
6
|
+
|
|
7
|
+
export default defineDeck({
|
|
8
|
+
label: "codex_sdk_bridge",
|
|
9
|
+
contextSchema: z.string().optional(),
|
|
10
|
+
responseSchema: z.string(),
|
|
11
|
+
async run(ctx) {
|
|
12
|
+
const userText = typeof ctx.initialUserMessage === "string" &&
|
|
13
|
+
ctx.initialUserMessage.trim()
|
|
14
|
+
? ctx.initialUserMessage.trim()
|
|
15
|
+
: typeof ctx.input === "string" && ctx.input.trim()
|
|
16
|
+
? ctx.input.trim()
|
|
17
|
+
: "";
|
|
18
|
+
|
|
19
|
+
if (!userText) return "";
|
|
20
|
+
|
|
21
|
+
const priorThreadId = ctx.getSessionMeta<string>(CODEX_THREAD_META_KEY);
|
|
22
|
+
const systemPrompt = ctx.getSessionMeta<string>("codex.systemPrompt");
|
|
23
|
+
|
|
24
|
+
ctx.appendMessage({ role: "user", content: userText });
|
|
25
|
+
|
|
26
|
+
const result = await sendCodexTurn({
|
|
27
|
+
userText,
|
|
28
|
+
threadId: priorThreadId,
|
|
29
|
+
systemPrompt,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
ctx.setSessionMeta(CODEX_THREAD_META_KEY, result.threadId);
|
|
33
|
+
ctx.appendMessage({ role: "assistant", content: result.assistantText });
|
|
34
|
+
return result.assistantText;
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
+++
|
|
2
|
+
label = "Gambit context primer"
|
|
3
|
+
+++
|
|
4
|
+
|
|
5
|
+
You will automatically receive a `gambit_context` tool result at the start of
|
|
6
|
+
the run whenever the caller supplies `--context`. This payload contains run
|
|
7
|
+
metadata or seeded inputs. Read it before you respond, treat it as trusted
|
|
8
|
+
context, and keep it on hand throughout the workflow so downstream actions have
|
|
9
|
+
the right data. Do not call `gambit_context` yourself; runtime injects it once.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
+++
|
|
2
|
+
label = "Explicitly end the run"
|
|
3
|
+
allowEnd = true
|
|
4
|
+
+++
|
|
5
|
+
|
|
6
|
+
If the entire conversation/workflow is complete and you must stop all further
|
|
7
|
+
turns, call the `gambit_end` tool with an optional `message`, `payload`,
|
|
8
|
+
`status`, `code`, or `meta`. Only use this when you want Gambit to halt entirely
|
|
9
|
+
(no more user messages). Otherwise continue with normal responses or
|
|
10
|
+
`gambit_respond`.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
+++
|
|
2
|
+
label = "Generate test input"
|
|
3
|
+
+++
|
|
4
|
+
|
|
5
|
+
When you receive a user message with:
|
|
6
|
+
|
|
7
|
+
{ "type": "gambit_test_bot_init_fill", "missing": ["path.to.field", "..."],
|
|
8
|
+
"current": { ... }, "schemaHints": [ ... ] }
|
|
9
|
+
|
|
10
|
+
Return ONLY valid JSON that supplies values for the missing fields. Do not
|
|
11
|
+
include any fields that are not listed in "missing". If the only missing path is
|
|
12
|
+
"(root)", return the full init JSON value.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
+++
|
|
2
|
+
label = "Call gambit_respond"
|
|
3
|
+
respond = true
|
|
4
|
+
+++
|
|
5
|
+
|
|
6
|
+
When you finish this workflow, do **not** emit a normal assistant reply.
|
|
7
|
+
Instead, call the `gambit_respond` tool exactly once with a JSON envelope that
|
|
8
|
+
includes your validated `payload` plus optional `status`, `message`, `code`, or
|
|
9
|
+
`meta` fields. This keeps outputs structured and lets Gambit capture the result
|
|
10
|
+
even when guardrails stop the run early.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
+++
|
|
2
|
+
label = "Anthropic agent SDK bridge"
|
|
3
|
+
contextSchema = "gambit://schemas/scenarios/plain_chat_input_optional.zod.ts"
|
|
4
|
+
responseSchema = "gambit://schemas/scenarios/plain_chat_output.zod.ts"
|
|
5
|
+
+++
|
|
6
|
+
|
|
7
|
+
This stdlib deck provides the default bridge between the Anthropic agent SDK
|
|
8
|
+
runtime and Gambit decks. It is intentionally minimal; downstream runners supply
|
|
9
|
+
the actual runtime behavior.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
+++
|
|
2
|
+
label = "Codex SDK bridge"
|
|
3
|
+
contextSchema = "gambit://schemas/scenarios/plain_chat_input_optional.zod.ts"
|
|
4
|
+
responseSchema = "gambit://schemas/scenarios/plain_chat_output.zod.ts"
|
|
5
|
+
+++
|
|
6
|
+
|
|
7
|
+
This stdlib deck provides the default bridge between the Codex SDK runtime and
|
|
8
|
+
Gambit decks. It is intentionally minimal; downstream runners supply the actual
|
|
9
|
+
runtime behavior.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export type CodexTurnInput = {
|
|
2
|
+
userText: string;
|
|
3
|
+
threadId?: string;
|
|
4
|
+
systemPrompt?: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type CodexTurnOutput = {
|
|
8
|
+
threadId: string;
|
|
9
|
+
assistantText: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type CodexEvent =
|
|
13
|
+
| { type: "thread.started"; thread_id?: unknown }
|
|
14
|
+
| {
|
|
15
|
+
type: "item.completed";
|
|
16
|
+
item?: { type?: unknown; text?: unknown };
|
|
17
|
+
}
|
|
18
|
+
| { type: string; [key: string]: unknown };
|
|
19
|
+
|
|
20
|
+
function runCwd(): string {
|
|
21
|
+
const botRoot = Deno.env.get("GAMBIT_BOT_ROOT");
|
|
22
|
+
if (typeof botRoot === "string" && botRoot.trim().length > 0) {
|
|
23
|
+
return botRoot.trim();
|
|
24
|
+
}
|
|
25
|
+
return Deno.cwd();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function parseCodexEvents(stdout: string): {
|
|
29
|
+
threadId?: string;
|
|
30
|
+
assistantText?: string;
|
|
31
|
+
} {
|
|
32
|
+
let threadId: string | undefined;
|
|
33
|
+
let assistantText: string | undefined;
|
|
34
|
+
|
|
35
|
+
for (const line of stdout.split(/\r?\n/)) {
|
|
36
|
+
const trimmed = line.trim();
|
|
37
|
+
if (!trimmed.startsWith("{")) continue;
|
|
38
|
+
let parsed: CodexEvent | null = null;
|
|
39
|
+
try {
|
|
40
|
+
parsed = JSON.parse(trimmed) as CodexEvent;
|
|
41
|
+
} catch {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (!parsed || typeof parsed !== "object") continue;
|
|
45
|
+
if (parsed.type === "thread.started") {
|
|
46
|
+
if (typeof parsed.thread_id === "string" && parsed.thread_id.trim()) {
|
|
47
|
+
threadId = parsed.thread_id.trim();
|
|
48
|
+
}
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (parsed.type === "item.completed") {
|
|
52
|
+
const item = parsed.item;
|
|
53
|
+
if (!item || typeof item !== "object") continue;
|
|
54
|
+
const rec = item as Record<string, unknown>;
|
|
55
|
+
if (rec.type !== "agent_message") continue;
|
|
56
|
+
if (typeof rec.text !== "string") continue;
|
|
57
|
+
const next = rec.text.trim();
|
|
58
|
+
if (next) assistantText = next;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return { threadId, assistantText };
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function sendCodexTurn(
|
|
66
|
+
input: CodexTurnInput,
|
|
67
|
+
): Promise<CodexTurnOutput> {
|
|
68
|
+
const prompt = input.systemPrompt && input.systemPrompt.trim()
|
|
69
|
+
? `${input.systemPrompt.trim()}\n\n${input.userText}`
|
|
70
|
+
: input.userText;
|
|
71
|
+
|
|
72
|
+
const args = input.threadId
|
|
73
|
+
? [
|
|
74
|
+
"exec",
|
|
75
|
+
"resume",
|
|
76
|
+
"--skip-git-repo-check",
|
|
77
|
+
"--json",
|
|
78
|
+
input.threadId,
|
|
79
|
+
prompt,
|
|
80
|
+
]
|
|
81
|
+
: ["exec", "--skip-git-repo-check", "--json", prompt];
|
|
82
|
+
|
|
83
|
+
const out = await new Deno.Command("codex", {
|
|
84
|
+
args,
|
|
85
|
+
cwd: runCwd(),
|
|
86
|
+
stdout: "piped",
|
|
87
|
+
stderr: "piped",
|
|
88
|
+
}).output();
|
|
89
|
+
|
|
90
|
+
const stdout = new TextDecoder().decode(out.stdout);
|
|
91
|
+
const stderr = new TextDecoder().decode(out.stderr);
|
|
92
|
+
if (!out.success) {
|
|
93
|
+
throw new Error(
|
|
94
|
+
`codex exec failed (exit ${out.code}): ${stderr.trim() || stdout.trim()}`,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const parsed = parseCodexEvents(stdout);
|
|
99
|
+
const threadId = parsed.threadId ?? input.threadId;
|
|
100
|
+
if (!threadId) {
|
|
101
|
+
throw new Error(
|
|
102
|
+
`codex exec succeeded but no thread id found in output: ${stdout.trim()}`,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
threadId,
|
|
107
|
+
assistantText: parsed.assistantText ?? "",
|
|
108
|
+
};
|
|
109
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineDeck } from "../../../src/definitions.ts";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { sendCodexTurn } from "./codex_client.ts";
|
|
4
|
+
|
|
5
|
+
const CODEX_THREAD_META_KEY = "codex.threadId";
|
|
6
|
+
|
|
7
|
+
export default defineDeck({
|
|
8
|
+
label: "codex_sdk_bridge",
|
|
9
|
+
contextSchema: z.string().optional(),
|
|
10
|
+
responseSchema: z.string(),
|
|
11
|
+
async run(ctx) {
|
|
12
|
+
const userText = typeof ctx.initialUserMessage === "string" &&
|
|
13
|
+
ctx.initialUserMessage.trim()
|
|
14
|
+
? ctx.initialUserMessage.trim()
|
|
15
|
+
: typeof ctx.input === "string" && ctx.input.trim()
|
|
16
|
+
? ctx.input.trim()
|
|
17
|
+
: "";
|
|
18
|
+
|
|
19
|
+
if (!userText) return "";
|
|
20
|
+
|
|
21
|
+
const priorThreadId = ctx.getSessionMeta<string>(CODEX_THREAD_META_KEY);
|
|
22
|
+
const systemPrompt = ctx.getSessionMeta<string>("codex.systemPrompt");
|
|
23
|
+
|
|
24
|
+
ctx.appendMessage({ role: "user", content: userText });
|
|
25
|
+
|
|
26
|
+
const result = await sendCodexTurn({
|
|
27
|
+
userText,
|
|
28
|
+
threadId: priorThreadId,
|
|
29
|
+
systemPrompt,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
ctx.setSessionMeta(CODEX_THREAD_META_KEY, result.threadId);
|
|
33
|
+
ctx.appendMessage({ role: "assistant", content: result.assistantText });
|
|
34
|
+
return result.assistantText;
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -280,7 +280,7 @@ export type MergeAllSets<T, U, X = PartialByType<T, Set<unknown>>, Y = PartialBy
|
|
|
280
280
|
}> = Z;
|
|
281
281
|
/** Get array values type */
|
|
282
282
|
export type ArrayValueType<T> = T extends Array<infer V> ? V : never;
|
|
283
|
-
/** Merge all
|
|
283
|
+
/** Merge all arrays types definitions from keys present in both objects */
|
|
284
284
|
export type MergeAllArrays<T, U, X = PartialByType<T, Array<unknown>>, Y = PartialByType<U, Array<unknown>>, Z = {
|
|
285
285
|
[K in keyof X & keyof Y]: Array<ArrayValueType<X[K]> | ArrayValueType<Y[K]>>;
|
|
286
286
|
}> = Z;
|
|
@@ -288,7 +288,7 @@ export type MergeAllArrays<T, U, X = PartialByType<T, Array<unknown>>, Y = Parti
|
|
|
288
288
|
export type MapKeyType<T> = T extends Map<infer K, unknown> ? K : never;
|
|
289
289
|
/** Get map values types */
|
|
290
290
|
export type MapValueType<T> = T extends Map<unknown, infer V> ? V : never;
|
|
291
|
-
/** Merge all
|
|
291
|
+
/** Merge all maps types definitions from keys present in both objects */
|
|
292
292
|
export type MergeAllMaps<T, U, X = PartialByType<T, Map<unknown, unknown>>, Y = PartialByType<U, Map<unknown, unknown>>, Z = {
|
|
293
293
|
[K in keyof X & keyof Y]: Map<MapKeyType<X[K]> | MapKeyType<Y[K]>, MapValueType<X[K]> | MapValueType<Y[K]>>;
|
|
294
294
|
}> = Z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deep_merge.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.1.
|
|
1
|
+
{"version":3,"file":"deep_merge.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.1.6/deep_merge.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,wBAAgB,SAAS,CACvB,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EAEtC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC5B,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAC3B,OAAO,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GACnC,CAAC,CAAC;AACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AACH,wBAAgB,SAAS,CACvB,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EACtC,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EACtC,OAAO,SAAS,gBAAgB,EAEhC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EACnB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAClB,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,GAC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,EAAE,OAAO,CAAC,CAAC,GACvE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,GAEpB,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
2
|
// This module is browser compatible.
|
|
3
|
-
|
|
3
|
+
/** Default merging options - cached to avoid object allocation on each call */
|
|
4
|
+
const DEFAULT_OPTIONS = {
|
|
5
|
+
arrays: "merge",
|
|
6
|
+
sets: "merge",
|
|
7
|
+
maps: "merge",
|
|
8
|
+
};
|
|
4
9
|
export function deepMerge(record, other, options) {
|
|
5
|
-
return deepMergeInternal(record, other, new Set(), options);
|
|
10
|
+
return deepMergeInternal(record, other, new Set(), options ?? DEFAULT_OPTIONS);
|
|
6
11
|
}
|
|
7
12
|
function deepMergeInternal(record, other, seen, options) {
|
|
8
13
|
const result = {};
|
|
@@ -33,11 +38,7 @@ function deepMergeInternal(record, other, seen, options) {
|
|
|
33
38
|
}
|
|
34
39
|
return result;
|
|
35
40
|
}
|
|
36
|
-
function mergeObjects(left, right, seen, options
|
|
37
|
-
arrays: "merge",
|
|
38
|
-
sets: "merge",
|
|
39
|
-
maps: "merge",
|
|
40
|
-
}) {
|
|
41
|
+
function mergeObjects(left, right, seen, options) {
|
|
41
42
|
// Recursively merge mergeable objects
|
|
42
43
|
if (isMergeable(left) && isMergeable(right)) {
|
|
43
44
|
return deepMergeInternal(left, right, seen, options);
|
|
@@ -53,20 +54,22 @@ function mergeObjects(left, right, seen, options = {
|
|
|
53
54
|
// Handle maps
|
|
54
55
|
if ((left instanceof Map) && (right instanceof Map)) {
|
|
55
56
|
if (options.maps === "merge") {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
const result = new Map(left);
|
|
58
|
+
for (const [k, v] of right) {
|
|
59
|
+
result.set(k, v);
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
60
62
|
}
|
|
61
63
|
return right;
|
|
62
64
|
}
|
|
63
65
|
// Handle sets
|
|
64
66
|
if ((left instanceof Set) && (right instanceof Set)) {
|
|
65
67
|
if (options.sets === "merge") {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
const result = new Set(left);
|
|
69
|
+
for (const v of right) {
|
|
70
|
+
result.add(v);
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
70
73
|
}
|
|
71
74
|
return right;
|
|
72
75
|
}
|
|
@@ -88,8 +91,15 @@ function isNonNullObject(value) {
|
|
|
88
91
|
return value !== null && typeof value === "object";
|
|
89
92
|
}
|
|
90
93
|
function getKeys(record) {
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
const keys = Object.keys(record);
|
|
95
|
+
const symbols = Object.getOwnPropertySymbols(record);
|
|
96
|
+
// Fast path: most objects have no symbol keys
|
|
97
|
+
if (symbols.length === 0)
|
|
98
|
+
return keys;
|
|
99
|
+
for (const sym of symbols) {
|
|
100
|
+
if (Object.prototype.propertyIsEnumerable.call(record, sym)) {
|
|
101
|
+
keys.push(sym);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return keys;
|
|
95
105
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
2
|
// This module is browser compatible.
|
|
3
3
|
import { extractFrontMatter } from "./_shared.js";
|
|
4
|
-
import { parse } from "../../yaml/1.0.
|
|
4
|
+
import { parse } from "../../yaml/1.0.12/parse.js";
|
|
5
5
|
import { EXTRACT_YAML_REGEXP } from "./_formats.js";
|
|
6
6
|
/**
|
|
7
7
|
* Extracts and parses {@link https://yaml.org | YAML} from the metadata of
|
|
@@ -12,7 +12,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
12
12
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
13
13
|
};
|
|
14
14
|
var _Scanner_whitespace, _Scanner_position, _Scanner_source;
|
|
15
|
-
import { deepMerge } from "../../collections/1.1.
|
|
15
|
+
import { deepMerge } from "../../collections/1.1.6/deep_merge.js";
|
|
16
16
|
/**
|
|
17
17
|
* Copy of `import { isLeap } from "@std/datetime";` because it cannot be impoted as long as it is unstable.
|
|
18
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_chars.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/yaml/1.0.
|
|
1
|
+
{"version":3,"file":"_chars.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/yaml/1.0.12/_chars.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,GAAG,QAAS,CAAC;AAC1B,eAAO,MAAM,GAAG,IAAO,CAAC;AACxB,eAAO,MAAM,SAAS,KAAO,CAAC;AAC9B,eAAO,MAAM,eAAe,KAAO,CAAC;AACpC,eAAO,MAAM,KAAK,KAAO,CAAC;AAC1B,eAAO,MAAM,WAAW,KAAO,CAAC;AAChC,eAAO,MAAM,YAAY,KAAO,CAAC;AACjC,eAAO,MAAM,KAAK,KAAO,CAAC;AAC1B,eAAO,MAAM,OAAO,KAAO,CAAC;AAC5B,eAAO,MAAM,SAAS,KAAO,CAAC;AAC9B,eAAO,MAAM,YAAY,KAAO,CAAC;AACjC,eAAO,MAAM,QAAQ,KAAO,CAAC;AAC7B,eAAO,MAAM,IAAI,KAAO,CAAC;AACzB,eAAO,MAAM,KAAK,KAAO,CAAC;AAC1B,eAAO,MAAM,KAAK,KAAO,CAAC;AAC1B,eAAO,MAAM,GAAG,KAAO,CAAC;AACxB,eAAO,MAAM,KAAK,KAAO,CAAC;AAC1B,eAAO,MAAM,YAAY,KAAO,CAAC;AACjC,eAAO,MAAM,YAAY,KAAO,CAAC;AACjC,eAAO,MAAM,QAAQ,KAAO,CAAC;AAC7B,eAAO,MAAM,aAAa,KAAO,CAAC;AAClC,eAAO,MAAM,mBAAmB,KAAO,CAAC;AACxC,eAAO,MAAM,SAAS,KAAO,CAAC;AAC9B,eAAO,MAAM,oBAAoB,KAAO,CAAC;AACzC,eAAO,MAAM,YAAY,KAAO,CAAC;AACjC,eAAO,MAAM,kBAAkB,MAAO,CAAC;AACvC,eAAO,MAAM,aAAa,MAAO,CAAC;AAClC,eAAO,MAAM,mBAAmB,MAAO,CAAC;AAExC,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAExC;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAQlD"}
|
package/{script/deps/jsr.io/@std/yaml/1.0.11 → esm/deps/jsr.io/@std/yaml/1.0.12}/_loader_state.d.ts
RENAMED
|
@@ -16,11 +16,8 @@ interface State {
|
|
|
16
16
|
}
|
|
17
17
|
export declare class LoaderState {
|
|
18
18
|
#private;
|
|
19
|
-
input: string;
|
|
20
|
-
length: number;
|
|
21
19
|
lineIndent: number;
|
|
22
20
|
lineStart: number;
|
|
23
|
-
position: number;
|
|
24
21
|
line: number;
|
|
25
22
|
onWarning: ((error: Error) => void) | undefined;
|
|
26
23
|
allowDuplicateKeys: boolean;
|
|
@@ -33,8 +30,6 @@ export declare class LoaderState {
|
|
|
33
30
|
skipWhitespaces(): void;
|
|
34
31
|
skipComment(): void;
|
|
35
32
|
readIndent(): void;
|
|
36
|
-
peek(offset?: number): number;
|
|
37
|
-
next(): number;
|
|
38
33
|
dispatchWarning(message: string): void;
|
|
39
34
|
yamlDirectiveHandler(args: string[]): string | null;
|
|
40
35
|
tagDirectiveHandler(args: string[]): void;
|