@bolt-foundry/gambit 0.8.3 → 0.8.5-rc.5
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/CHANGELOG.md +38 -2
- package/README.md +79 -16
- package/esm/_dnt.polyfills.d.ts +17 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +122 -0
- package/esm/deps/jsr.io/@std/collections/1.1.5/deep_merge.d.ts +322 -0
- package/esm/deps/jsr.io/@std/collections/1.1.5/deep_merge.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.1.5/deep_merge.js +105 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.d.ts +14 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.js +34 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.d.ts +13 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.js +18 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_is_same_path.d.ts +10 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_is_same_path.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_is_same_path.js +17 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_is_subdir.d.ts +12 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_is_subdir.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_is_subdir.js +25 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_to_path_string.d.ts +9 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_to_path_string.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/_to_path_string.js +13 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/copy.d.ts +117 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/copy.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/copy.js +313 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/empty_dir.d.ts +48 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/empty_dir.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/empty_dir.js +87 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_dir.d.ts +49 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_dir.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_dir.js +102 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_file.d.ts +47 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_file.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_file.js +90 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_link.d.ts +49 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_link.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_link.js +61 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_symlink.d.ts +70 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_symlink.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/ensure_symlink.js +156 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/eol.d.ts +52 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/eol.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/eol.js +67 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/exists.d.ts +218 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/exists.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/exists.js +271 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/expand_glob.d.ts +267 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/expand_glob.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/expand_glob.js +442 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/mod.d.ts +29 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/mod.js +29 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/move.d.ts +86 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/move.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/move.js +142 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/walk.d.ts +777 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/walk.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.22/walk.js +846 -0
- package/esm/deps/jsr.io/@std/json/1.0.2/types.d.ts +5 -0
- package/esm/deps/jsr.io/@std/json/1.0.2/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/json/1.0.2/types.js +3 -0
- package/esm/deps/jsr.io/@std/jsonc/1.0.2/mod.d.ts +20 -0
- package/esm/deps/jsr.io/@std/jsonc/1.0.2/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/jsonc/1.0.2/mod.js +21 -0
- package/esm/deps/jsr.io/@std/jsonc/1.0.2/parse.d.ts +21 -0
- package/esm/deps/jsr.io/@std/jsonc/1.0.2/parse.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/jsonc/1.0.2/parse.js +320 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts +93 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.js +753 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/mod.d.ts +109 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/mod.js +110 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/parse.d.ts +21 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/parse.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/parse.js +25 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/stringify.d.ts +35 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/stringify.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/toml/1.0.11/stringify.js +283 -0
- package/esm/gambit/simulator-ui/dist/bundle.js +10639 -4629
- package/esm/gambit/simulator-ui/dist/bundle.js.map +4 -4
- package/esm/mod.d.ts +13 -3
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +8 -2
- package/esm/src/cli_utils.d.ts +1 -0
- package/esm/src/cli_utils.d.ts.map +1 -1
- package/esm/src/cli_utils.js +13 -1
- package/esm/src/default_runtime.d.ts +46 -0
- package/esm/src/default_runtime.d.ts.map +1 -0
- package/esm/src/default_runtime.js +415 -0
- package/esm/src/durable_streams.js +26 -1
- package/esm/src/model_matchers.d.ts +10 -0
- package/esm/src/model_matchers.d.ts.map +1 -0
- package/esm/src/model_matchers.js +26 -0
- package/esm/src/openai_compat.d.ts +12 -1
- package/esm/src/openai_compat.d.ts.map +1 -1
- package/esm/src/openai_compat.js +53 -1
- package/esm/src/project_config.d.ts +47 -0
- package/esm/src/project_config.d.ts.map +1 -0
- package/esm/src/project_config.js +134 -0
- package/esm/src/providers/codex.d.ts +37 -0
- package/esm/src/providers/codex.d.ts.map +1 -0
- package/esm/src/providers/codex.js +810 -0
- package/esm/src/providers/google.d.ts +3 -1
- package/esm/src/providers/google.d.ts.map +1 -1
- package/esm/src/providers/google.js +82 -6
- package/esm/src/providers/ollama.d.ts +3 -1
- package/esm/src/providers/ollama.d.ts.map +1 -1
- package/esm/src/providers/ollama.js +238 -15
- package/esm/src/providers/openrouter.d.ts +6 -2
- package/esm/src/providers/openrouter.d.ts.map +1 -1
- package/esm/src/providers/openrouter.js +260 -23
- package/esm/src/providers/router.d.ts +19 -0
- package/esm/src/providers/router.d.ts.map +1 -0
- package/esm/src/providers/router.js +93 -0
- package/esm/src/server.d.ts +9 -0
- package/esm/src/server.d.ts.map +1 -1
- package/esm/src/server.js +3186 -652
- package/esm/src/server_feedback_grading_routes.d.ts +32 -0
- package/esm/src/server_feedback_grading_routes.d.ts.map +1 -0
- package/esm/src/server_feedback_grading_routes.js +305 -0
- package/esm/src/server_helpers.d.ts +4 -0
- package/esm/src/server_helpers.d.ts.map +1 -0
- package/esm/src/server_helpers.js +46 -0
- package/esm/src/server_session_store.d.ts +87 -0
- package/esm/src/server_session_store.d.ts.map +1 -0
- package/esm/src/server_session_store.js +873 -0
- package/esm/src/server_types.d.ts +110 -0
- package/esm/src/server_types.d.ts.map +1 -0
- package/esm/src/server_types.js +1 -0
- package/esm/src/server_ui_routes.d.ts +33 -0
- package/esm/src/server_ui_routes.d.ts.map +1 -0
- package/esm/src/server_ui_routes.js +135 -0
- package/esm/src/session_artifacts.d.ts +22 -0
- package/esm/src/session_artifacts.d.ts.map +1 -0
- package/esm/src/session_artifacts.js +243 -0
- package/esm/src/trace.d.ts.map +1 -1
- package/esm/src/trace.js +6 -3
- package/esm/src/workspace.d.ts +19 -0
- package/esm/src/workspace.d.ts.map +1 -0
- package/esm/src/workspace.js +164 -0
- package/esm/src/workspace_contract.d.ts +76 -0
- package/esm/src/workspace_contract.d.ts.map +1 -0
- package/esm/src/workspace_contract.js +74 -0
- package/package.json +2 -2
- package/script/_dnt.polyfills.d.ts +17 -0
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +122 -0
- package/script/deps/jsr.io/@std/collections/1.1.5/deep_merge.d.ts +322 -0
- package/script/deps/jsr.io/@std/collections/1.1.5/deep_merge.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/collections/1.1.5/deep_merge.js +108 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.d.ts +14 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_create_walk_entry.js +71 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.d.ts +13 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_get_file_info_type.js +21 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_is_same_path.d.ts +10 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_is_same_path.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_is_same_path.js +20 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_is_subdir.d.ts +12 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_is_subdir.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_is_subdir.js +28 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_to_path_string.d.ts +9 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_to_path_string.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/_to_path_string.js +16 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/copy.d.ts +117 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/copy.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/copy.js +350 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/empty_dir.d.ts +48 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/empty_dir.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/empty_dir.js +124 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_dir.d.ts +49 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_dir.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_dir.js +139 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_file.d.ts +47 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_file.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_file.js +127 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_link.d.ts +49 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_link.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_link.js +98 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_symlink.d.ts +70 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_symlink.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/ensure_symlink.js +193 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/eol.d.ts +52 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/eol.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/eol.js +105 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/exists.d.ts +218 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/exists.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/exists.js +308 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/expand_glob.d.ts +267 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/expand_glob.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/expand_glob.js +479 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/mod.d.ts +29 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/mod.js +45 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/move.d.ts +86 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/move.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/move.js +179 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/walk.d.ts +777 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/walk.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.22/walk.js +883 -0
- package/script/deps/jsr.io/@std/json/1.0.2/types.d.ts +5 -0
- package/script/deps/jsr.io/@std/json/1.0.2/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/json/1.0.2/types.js +4 -0
- package/script/deps/jsr.io/@std/jsonc/1.0.2/mod.d.ts +20 -0
- package/script/deps/jsr.io/@std/jsonc/1.0.2/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/jsonc/1.0.2/mod.js +37 -0
- package/script/deps/jsr.io/@std/jsonc/1.0.2/parse.d.ts +21 -0
- package/script/deps/jsr.io/@std/jsonc/1.0.2/parse.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/jsonc/1.0.2/parse.js +323 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts +93 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/_parser.js +781 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/mod.d.ts +109 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/mod.js +126 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/parse.d.ts +21 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/parse.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/parse.js +28 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/stringify.d.ts +35 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/stringify.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/toml/1.0.11/stringify.js +286 -0
- package/script/gambit/simulator-ui/dist/bundle.js +10639 -4629
- package/script/gambit/simulator-ui/dist/bundle.js.map +4 -4
- package/script/mod.d.ts +13 -3
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +14 -5
- package/script/src/cli_utils.d.ts +1 -0
- package/script/src/cli_utils.d.ts.map +1 -1
- package/script/src/cli_utils.js +14 -1
- package/script/src/default_runtime.d.ts +46 -0
- package/script/src/default_runtime.d.ts.map +1 -0
- package/script/src/default_runtime.js +452 -0
- package/script/src/durable_streams.js +26 -1
- package/script/src/model_matchers.d.ts +10 -0
- package/script/src/model_matchers.d.ts.map +1 -0
- package/script/src/model_matchers.js +29 -0
- package/script/src/openai_compat.d.ts +12 -1
- package/script/src/openai_compat.d.ts.map +1 -1
- package/script/src/openai_compat.js +85 -0
- package/script/src/project_config.d.ts +47 -0
- package/script/src/project_config.d.ts.map +1 -0
- package/script/src/project_config.js +173 -0
- package/script/src/providers/codex.d.ts +37 -0
- package/script/src/providers/codex.d.ts.map +1 -0
- package/script/src/providers/codex.js +850 -0
- package/script/src/providers/google.d.ts +3 -1
- package/script/src/providers/google.d.ts.map +1 -1
- package/script/src/providers/google.js +82 -6
- package/script/src/providers/ollama.d.ts +3 -1
- package/script/src/providers/ollama.d.ts.map +1 -1
- package/script/src/providers/ollama.js +238 -15
- package/script/src/providers/openrouter.d.ts +6 -2
- package/script/src/providers/openrouter.d.ts.map +1 -1
- package/script/src/providers/openrouter.js +260 -23
- package/script/src/providers/router.d.ts +19 -0
- package/script/src/providers/router.d.ts.map +1 -0
- package/script/src/providers/router.js +96 -0
- package/script/src/server.d.ts +9 -0
- package/script/src/server.d.ts.map +1 -1
- package/script/src/server.js +3193 -659
- package/script/src/server_feedback_grading_routes.d.ts +32 -0
- package/script/src/server_feedback_grading_routes.d.ts.map +1 -0
- package/script/src/server_feedback_grading_routes.js +343 -0
- package/script/src/server_helpers.d.ts +4 -0
- package/script/src/server_helpers.d.ts.map +1 -0
- package/script/src/server_helpers.js +84 -0
- package/script/src/server_session_store.d.ts +87 -0
- package/script/src/server_session_store.d.ts.map +1 -0
- package/script/src/server_session_store.js +910 -0
- package/script/src/server_types.d.ts +110 -0
- package/script/src/server_types.d.ts.map +1 -0
- package/script/src/server_types.js +2 -0
- package/script/src/server_ui_routes.d.ts +33 -0
- package/script/src/server_ui_routes.d.ts.map +1 -0
- package/script/src/server_ui_routes.js +172 -0
- package/script/src/session_artifacts.d.ts +22 -0
- package/script/src/session_artifacts.d.ts.map +1 -0
- package/script/src/session_artifacts.js +279 -0
- package/script/src/trace.d.ts.map +1 -1
- package/script/src/trace.js +6 -3
- package/script/src/workspace.d.ts +19 -0
- package/script/src/workspace.d.ts.map +1 -0
- package/script/src/workspace.js +201 -0
- package/script/src/workspace_contract.d.ts +76 -0
- package/script/src/workspace_contract.d.ts.map +1 -0
- package/script/src/workspace_contract.js +82 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import * as dntShim from "../_dnt.shims.js";
|
|
2
|
+
import * as path from "../deps/jsr.io/@std/path/1.1.4/mod.js";
|
|
3
|
+
import { existsSync } from "../deps/jsr.io/@std/fs/1.0.22/mod.js";
|
|
4
|
+
const ROOT_PROMPT = `+++
|
|
5
|
+
label = "Workspace Root"
|
|
6
|
+
description = "Starter root deck for this workspace."
|
|
7
|
+
|
|
8
|
+
[modelParams]
|
|
9
|
+
model = ["ollama/hf.co/LiquidAI/LFM2-1.2B-Tool-GGUF:latest", "openrouter/openai/gpt-5.1-chat"]
|
|
10
|
+
|
|
11
|
+
[modelParams.reasoning]
|
|
12
|
+
effort = "low"
|
|
13
|
+
summary = "detailed"
|
|
14
|
+
|
|
15
|
+
[[scenarios]]
|
|
16
|
+
path = "./scenarios/default/PROMPT.md"
|
|
17
|
+
label = "Default scenario"
|
|
18
|
+
description = "Quick sanity check scenario."
|
|
19
|
+
|
|
20
|
+
[[graders]]
|
|
21
|
+
path = "./graders/default/PROMPT.md"
|
|
22
|
+
label = "Default grader"
|
|
23
|
+
description = "Simple grader to start."
|
|
24
|
+
+++
|
|
25
|
+
|
|
26
|
+
You are the default deck for a new Gambit workspace.
|
|
27
|
+
|
|
28
|
+
## Assistant Persona
|
|
29
|
+
|
|
30
|
+
- You are a minimal placeholder deck used to bootstrap a blank workspace.
|
|
31
|
+
- You keep responses short and avoid introducing product narrative.
|
|
32
|
+
|
|
33
|
+
## User Persona
|
|
34
|
+
|
|
35
|
+
- The user is in the Build tab and expects guidance on what to do next.
|
|
36
|
+
|
|
37
|
+
## Behavior
|
|
38
|
+
|
|
39
|
+
- If asked what to do, reply exactly: "Use the Build tab to draft your deck."
|
|
40
|
+
- Keep all other responses brief, plain text, and focused on build guidance.
|
|
41
|
+
`;
|
|
42
|
+
const ROOT_INTENT = `# Workspace Intent
|
|
43
|
+
|
|
44
|
+
## Purpose
|
|
45
|
+
|
|
46
|
+
- Provide a starter workspace deck for the Build/Test/Grade loop.
|
|
47
|
+
|
|
48
|
+
## Constraints
|
|
49
|
+
|
|
50
|
+
- Keep the initial behavior simple and easy to replace.
|
|
51
|
+
|
|
52
|
+
## Tradeoffs
|
|
53
|
+
|
|
54
|
+
- Favor clarity over advanced functionality in the starter scaffold.
|
|
55
|
+
`;
|
|
56
|
+
const DEFAULT_SCENARIO_PROMPT = `+++
|
|
57
|
+
label = "Default scenario"
|
|
58
|
+
description = "Starter scenario for this workspace."
|
|
59
|
+
contextSchema = "gambit://schemas/scenarios/plain_chat_input_optional.zod.ts"
|
|
60
|
+
responseSchema = "gambit://schemas/scenarios/plain_chat_output.zod.ts"
|
|
61
|
+
|
|
62
|
+
[modelParams]
|
|
63
|
+
model = ["ollama/hf.co/LiquidAI/LFM2-1.2B-Tool-GGUF:latest", "openrouter/openai/gpt-5.1-chat"]
|
|
64
|
+
+++
|
|
65
|
+
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+
You are a user testing the assistant.
|
|
69
|
+
|
|
70
|
+
Conversation plan:
|
|
71
|
+
|
|
72
|
+
1. Start by asking: "What can you help me with?"
|
|
73
|
+
2. If the assistant replies, answer once with: "Thanks!"
|
|
74
|
+
3. End the scenario by returning an empty response.
|
|
75
|
+
|
|
76
|
+
Rules:
|
|
77
|
+
|
|
78
|
+
- Keep replies short and plain text.
|
|
79
|
+
- Do not include markdown or lists.
|
|
80
|
+
- If the assistant says it is done, or ends the session, respond with an empty message.
|
|
81
|
+
`;
|
|
82
|
+
const DEFAULT_GRADER_PROMPT = `+++
|
|
83
|
+
label = "Default grader"
|
|
84
|
+
description = "Starter grader for this workspace."
|
|
85
|
+
contextSchema = "gambit://schemas/graders/contexts/conversation.zod.ts"
|
|
86
|
+
responseSchema = "gambit://schemas/graders/grader_output.zod.ts"
|
|
87
|
+
|
|
88
|
+
[modelParams]
|
|
89
|
+
model = ["ollama/hf.co/LiquidAI/LFM2-1.2B-Tool-GGUF:latest", "openrouter/openai/gpt-5.1-chat"]
|
|
90
|
+
+++
|
|
91
|
+
|
|
92
|
+

|
|
93
|
+
|
|
94
|
+
You are grading the assistant's response for clarity and helpfulness.
|
|
95
|
+
|
|
96
|
+
Score 1 if the assistant is clear and directly answers the user.
|
|
97
|
+
Score 0 if the response is vague or unhelpful.
|
|
98
|
+
|
|
99
|
+
Provide a short reason.
|
|
100
|
+
`;
|
|
101
|
+
const toStamp = (date) => date.toISOString().replace(/[:.]/g, "-");
|
|
102
|
+
const generateWorkspaceId = (date) => `workspace-${toStamp(date)}-${crypto.randomUUID().slice(0, 8)}`;
|
|
103
|
+
async function ensureDir(dir) {
|
|
104
|
+
await dntShim.Deno.mkdir(dir, { recursive: true });
|
|
105
|
+
}
|
|
106
|
+
async function writeFile(pathValue, contents) {
|
|
107
|
+
await dntShim.Deno.writeTextFile(pathValue, contents);
|
|
108
|
+
}
|
|
109
|
+
function ensureEmptyPath(pathValue) {
|
|
110
|
+
if (existsSync(pathValue)) {
|
|
111
|
+
throw new Error(`Init target already exists: ${pathValue}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export async function createWorkspaceScaffoldAtRoot(rootDir) {
|
|
115
|
+
const resolvedRoot = path.resolve(rootDir);
|
|
116
|
+
await ensureDir(resolvedRoot);
|
|
117
|
+
const rootDeckPath = path.join(resolvedRoot, "PROMPT.md");
|
|
118
|
+
const intentPath = path.join(resolvedRoot, "INTENT.md");
|
|
119
|
+
const scenariosDir = path.join(resolvedRoot, "scenarios", "default");
|
|
120
|
+
const gradersDir = path.join(resolvedRoot, "graders", "default");
|
|
121
|
+
const scenarioPromptPath = path.join(scenariosDir, "PROMPT.md");
|
|
122
|
+
const graderPromptPath = path.join(gradersDir, "PROMPT.md");
|
|
123
|
+
await ensureEmptyPath(rootDeckPath);
|
|
124
|
+
await ensureEmptyPath(intentPath);
|
|
125
|
+
await ensureEmptyPath(scenarioPromptPath);
|
|
126
|
+
await ensureEmptyPath(graderPromptPath);
|
|
127
|
+
await ensureDir(scenariosDir);
|
|
128
|
+
await ensureDir(gradersDir);
|
|
129
|
+
await writeFile(rootDeckPath, ROOT_PROMPT);
|
|
130
|
+
await writeFile(intentPath, ROOT_INTENT);
|
|
131
|
+
await writeFile(scenarioPromptPath, DEFAULT_SCENARIO_PROMPT);
|
|
132
|
+
await writeFile(graderPromptPath, DEFAULT_GRADER_PROMPT);
|
|
133
|
+
return {
|
|
134
|
+
rootDir: resolvedRoot,
|
|
135
|
+
rootDeckPath,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
export async function createWorkspaceScaffold(opts) {
|
|
139
|
+
const baseDir = path.resolve(opts.baseDir);
|
|
140
|
+
await ensureDir(baseDir);
|
|
141
|
+
const now = opts.now ?? new Date();
|
|
142
|
+
let workspaceId = opts.id ?? generateWorkspaceId(now);
|
|
143
|
+
let rootDir = path.join(baseDir, workspaceId);
|
|
144
|
+
if (existsSync(rootDir)) {
|
|
145
|
+
workspaceId = generateWorkspaceId(new Date(now.getTime() + 1));
|
|
146
|
+
rootDir = path.join(baseDir, workspaceId);
|
|
147
|
+
}
|
|
148
|
+
const rootDeckPath = path.join(rootDir, "PROMPT.md");
|
|
149
|
+
const intentPath = path.join(rootDir, "INTENT.md");
|
|
150
|
+
const scenariosDir = path.join(rootDir, "scenarios", "default");
|
|
151
|
+
const gradersDir = path.join(rootDir, "graders", "default");
|
|
152
|
+
await ensureDir(scenariosDir);
|
|
153
|
+
await ensureDir(gradersDir);
|
|
154
|
+
await writeFile(rootDeckPath, ROOT_PROMPT);
|
|
155
|
+
await writeFile(intentPath, ROOT_INTENT);
|
|
156
|
+
await writeFile(path.join(scenariosDir, "PROMPT.md"), DEFAULT_SCENARIO_PROMPT);
|
|
157
|
+
await writeFile(path.join(gradersDir, "PROMPT.md"), DEFAULT_GRADER_PROMPT);
|
|
158
|
+
return {
|
|
159
|
+
id: workspaceId,
|
|
160
|
+
rootDir,
|
|
161
|
+
rootDeckPath,
|
|
162
|
+
createdAt: now.toISOString(),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export declare const WORKSPACE_STATE_SCHEMA_VERSION = "workspace-state.v1";
|
|
2
|
+
export declare const WORKSPACE_ROUTE_BASE = "/workspaces";
|
|
3
|
+
export type WorkspaceRouteTab = "debug" | "build" | "test" | "grade";
|
|
4
|
+
export declare const WORKSPACE_ROUTE_TABS: Array<WorkspaceRouteTab>;
|
|
5
|
+
export type WorkspaceRoute = {
|
|
6
|
+
workspaceId: string | null;
|
|
7
|
+
tab: WorkspaceRouteTab;
|
|
8
|
+
isNew: boolean;
|
|
9
|
+
testRunId?: string;
|
|
10
|
+
gradeRunId?: string;
|
|
11
|
+
};
|
|
12
|
+
export type WorkspaceStreamEvent = {
|
|
13
|
+
type: "build.stream";
|
|
14
|
+
workspaceId: string;
|
|
15
|
+
role: "assistant" | "user";
|
|
16
|
+
chunk: string;
|
|
17
|
+
turn?: number;
|
|
18
|
+
ts?: number;
|
|
19
|
+
} | {
|
|
20
|
+
type: "build.stream.end";
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
role: "assistant" | "user";
|
|
23
|
+
turn?: number;
|
|
24
|
+
ts?: number;
|
|
25
|
+
} | {
|
|
26
|
+
type: "test.stream";
|
|
27
|
+
workspaceId: string;
|
|
28
|
+
role: "assistant" | "user";
|
|
29
|
+
chunk: string;
|
|
30
|
+
turn?: number;
|
|
31
|
+
ts?: number;
|
|
32
|
+
} | {
|
|
33
|
+
type: "test.stream.end";
|
|
34
|
+
workspaceId: string;
|
|
35
|
+
role: "assistant" | "user";
|
|
36
|
+
turn?: number;
|
|
37
|
+
ts?: number;
|
|
38
|
+
} | {
|
|
39
|
+
type: "grade.session";
|
|
40
|
+
workspaceId: string;
|
|
41
|
+
runId?: string;
|
|
42
|
+
ts?: number;
|
|
43
|
+
};
|
|
44
|
+
export type WorkspaceReducerEvent = {
|
|
45
|
+
type: "workspace.loaded";
|
|
46
|
+
workspaceId: string;
|
|
47
|
+
state: unknown;
|
|
48
|
+
} | {
|
|
49
|
+
type: "build.status";
|
|
50
|
+
workspaceId: string;
|
|
51
|
+
run: unknown;
|
|
52
|
+
} | {
|
|
53
|
+
type: "test.status";
|
|
54
|
+
workspaceId: string;
|
|
55
|
+
run: unknown;
|
|
56
|
+
} | {
|
|
57
|
+
type: "grade.status";
|
|
58
|
+
workspaceId: string;
|
|
59
|
+
run: unknown;
|
|
60
|
+
} | WorkspaceStreamEvent;
|
|
61
|
+
export type WorkspaceCreateResponse = {
|
|
62
|
+
workspaceId: string;
|
|
63
|
+
deckPath: string;
|
|
64
|
+
workspaceDir: string;
|
|
65
|
+
createdAt: string;
|
|
66
|
+
workspaceSchemaVersion: string;
|
|
67
|
+
};
|
|
68
|
+
export declare const buildWorkspacePath: (tab: WorkspaceRouteTab, workspaceId?: string | null, opts?: {
|
|
69
|
+
runId?: string;
|
|
70
|
+
}) => string;
|
|
71
|
+
export declare const parseWorkspaceRoute: (pathname: string) => WorkspaceRoute | null;
|
|
72
|
+
export declare const WORKSPACE_ID_ALIASES: readonly ["workspaceId"];
|
|
73
|
+
export declare const resolveWorkspaceIdFromRecord: (record: Record<string, unknown>) => string | undefined;
|
|
74
|
+
export declare const resolveWorkspaceIdFromSearchParams: (params: URLSearchParams) => string | undefined;
|
|
75
|
+
export declare const workspaceSchemaError: (workspaceId: string, foundVersion: string | null) => string;
|
|
76
|
+
//# sourceMappingURL=workspace_contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|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B,GACvC,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,MAAM,GAAG,SAMX,CAAC;AAEF,eAAO,MAAM,kCAAkC,GAC7C,QAAQ,eAAe,KACtB,MAAM,GAAG,SAQX,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,aAAa,MAAM,EACnB,cAAc,MAAM,GAAG,IAAI,KAC1B,MAOF,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export const WORKSPACE_STATE_SCHEMA_VERSION = "workspace-state.v1";
|
|
2
|
+
export const WORKSPACE_ROUTE_BASE = "/workspaces";
|
|
3
|
+
export const WORKSPACE_ROUTE_TABS = [
|
|
4
|
+
"debug",
|
|
5
|
+
"build",
|
|
6
|
+
"test",
|
|
7
|
+
"grade",
|
|
8
|
+
];
|
|
9
|
+
export const buildWorkspacePath = (tab, workspaceId, opts) => {
|
|
10
|
+
const encoded = workspaceId ? encodeURIComponent(workspaceId) : "new";
|
|
11
|
+
const base = `${WORKSPACE_ROUTE_BASE}/${encoded}/${tab}`;
|
|
12
|
+
const runId = opts?.runId;
|
|
13
|
+
if (!runId)
|
|
14
|
+
return base;
|
|
15
|
+
if (tab !== "test" && tab !== "grade")
|
|
16
|
+
return base;
|
|
17
|
+
return `${base}/${encodeURIComponent(runId)}`;
|
|
18
|
+
};
|
|
19
|
+
export const parseWorkspaceRoute = (pathname) => {
|
|
20
|
+
const match = pathname.match(/^\/workspaces\/([^/]+)\/(debug|build|test|grade)(?:\/([^/]+))?$/);
|
|
21
|
+
if (!match)
|
|
22
|
+
return null;
|
|
23
|
+
const rawId = decodeURIComponent(match[1]);
|
|
24
|
+
const tab = match[2];
|
|
25
|
+
const runSegment = typeof match[3] === "string"
|
|
26
|
+
? decodeURIComponent(match[3])
|
|
27
|
+
: undefined;
|
|
28
|
+
if (runSegment && tab !== "test" && tab !== "grade")
|
|
29
|
+
return null;
|
|
30
|
+
if (rawId === "new" && runSegment)
|
|
31
|
+
return null;
|
|
32
|
+
if (rawId === "new") {
|
|
33
|
+
return { workspaceId: null, tab, isNew: true };
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
workspaceId: rawId,
|
|
37
|
+
tab,
|
|
38
|
+
isNew: false,
|
|
39
|
+
testRunId: tab === "test" ? runSegment : undefined,
|
|
40
|
+
gradeRunId: tab === "grade" ? runSegment : undefined,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export const WORKSPACE_ID_ALIASES = ["workspaceId"];
|
|
44
|
+
const readString = (record, key) => {
|
|
45
|
+
const value = record[key];
|
|
46
|
+
return typeof value === "string" && value.trim().length > 0
|
|
47
|
+
? value
|
|
48
|
+
: undefined;
|
|
49
|
+
};
|
|
50
|
+
export const resolveWorkspaceIdFromRecord = (record) => {
|
|
51
|
+
for (const key of WORKSPACE_ID_ALIASES) {
|
|
52
|
+
const value = readString(record, key);
|
|
53
|
+
if (value)
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
return undefined;
|
|
57
|
+
};
|
|
58
|
+
export const resolveWorkspaceIdFromSearchParams = (params) => {
|
|
59
|
+
for (const key of WORKSPACE_ID_ALIASES) {
|
|
60
|
+
const value = params.get(key);
|
|
61
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return undefined;
|
|
66
|
+
};
|
|
67
|
+
export const workspaceSchemaError = (workspaceId, foundVersion) => {
|
|
68
|
+
const shown = foundVersion ? `"${foundVersion}"` : "missing";
|
|
69
|
+
return [
|
|
70
|
+
`Unsupported workspace state schema for "${workspaceId}" (found ${shown}).`,
|
|
71
|
+
`Expected "${WORKSPACE_STATE_SCHEMA_VERSION}".`,
|
|
72
|
+
"Recreate this workspace with /api/workspace/new.",
|
|
73
|
+
].join(" ");
|
|
74
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bolt-foundry/gambit",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5-rc.5",
|
|
4
4
|
"description": "Agent harness framework for building, running, and verifying LLM workflows in Markdown and code.",
|
|
5
5
|
"homepage": "https://github.com/bolt-foundry/gambit",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"gambit": "bin/gambit.cjs"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@bolt-foundry/gambit-core": "^0.8.
|
|
27
|
+
"@bolt-foundry/gambit-core": "^0.8.5-rc.5",
|
|
28
28
|
"openai": "^4.78.1",
|
|
29
29
|
"zod": "^3.23.8",
|
|
30
30
|
"@deno/shim-deno": "~0.18.0"
|
|
@@ -97,5 +97,22 @@ interface ImportMetaPonyfill extends ImportMetaPonyfillCommonjs, ImportMetaPonyf
|
|
|
97
97
|
export declare let import_meta_ponyfill_commonjs: ImportMetaPonyfillCommonjs;
|
|
98
98
|
export declare let import_meta_ponyfill_esmodule: ImportMetaPonyfillEsmodule;
|
|
99
99
|
export declare let import_meta_ponyfill: ImportMetaPonyfill;
|
|
100
|
+
declare global {
|
|
101
|
+
interface ArrayConstructor {
|
|
102
|
+
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | Promise<T>> | ArrayLike<T | Promise<T>>): Promise<T[]>;
|
|
103
|
+
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export {};
|
|
107
|
+
declare global {
|
|
108
|
+
interface Object {
|
|
109
|
+
/**
|
|
110
|
+
* Determines whether an object has a property with the specified name.
|
|
111
|
+
* @param o An object.
|
|
112
|
+
* @param v A property name.
|
|
113
|
+
*/
|
|
114
|
+
hasOwn(o: object, v: PropertyKey): boolean;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
100
117
|
export {};
|
|
101
118
|
//# sourceMappingURL=_dnt.polyfills.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAgC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAGlE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB;;;;;;;;;;;;;;WAcG;QACH,GAAG,EAAE,MAAM,CAAC;QACZ;;;;;;;;;;;;WAYG;QACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC;QACtE;;;;;;;;WAQG;QACH,IAAI,EAAE,OAAO,CAAC;QAEd;;;;;;;;;;;;WAYG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;;;;;;;;;;;WAYG;QACH,OAAO,EAAE,MAAM,CAAC;KACjB;CACF;AAED,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,KAAK,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AACnD,UAAU,0BAA0B;IAClC,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CACxD;AACD,UAAU,0BAA0B;IAClC,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;CACtC;AACD,UAAU,kBACR,SAAQ,0BAA0B,EAAE,0BAA0B;CAC/D;AAiBD,eAAO,IAAI,6BAA6B,EA2BnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,6BAA6B,EA4DnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,oBAAoB,EAoB1B,kBAAkB,CAAC"}
|
|
1
|
+
{"version":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AAC,GAAG,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAC7F,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;QAEhB,SAAS,CAAC,CAAC,EAAE,CAAC,EACV,mBAAmB,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,EAClE,KAAK,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAC/B,OAAO,CAAC,EAAE,GAAG,GACd,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;KAC1B;CACF;AAoID,OAAO,EAAE,CAAC;AAeV,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd;;;;WAIG;QACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;KAC5C;CACF;AAED,OAAO,EAAE,CAAC"}
|
package/script/_dnt.polyfills.js
CHANGED
|
@@ -128,3 +128,125 @@ exports.import_meta_ponyfill = ((...args) => {
|
|
|
128
128
|
//@ts-ignore
|
|
129
129
|
return (0, exports.import_meta_ponyfill)(...args);
|
|
130
130
|
});
|
|
131
|
+
// From https://github.com/es-shims/array-from-async/blob/4a5ff83947b861f35b380d5d4f20da2f07698638/index.mjs
|
|
132
|
+
// Tried to have dnt depend on the package instead, but it distributes as an
|
|
133
|
+
// ES module, so doesn't work with CommonJS.
|
|
134
|
+
//
|
|
135
|
+
// Code below:
|
|
136
|
+
//
|
|
137
|
+
// Copyright 2021 J. S. Choi
|
|
138
|
+
//
|
|
139
|
+
// Redistribution and use in source and binary forms, with or without
|
|
140
|
+
// modification, are permitted provided that the following conditions
|
|
141
|
+
// are met:
|
|
142
|
+
//
|
|
143
|
+
// 1. Redistributions of source code must retain the above copyright
|
|
144
|
+
// notice, this list of conditions and the following disclaimer.
|
|
145
|
+
//
|
|
146
|
+
// 2. Redistributions in binary form must reproduce the above copyright
|
|
147
|
+
// notice, this list of conditions and the following disclaimer in the
|
|
148
|
+
// documentation and/or other materials provided with the distribution.
|
|
149
|
+
//
|
|
150
|
+
// 3. Neither the name of the copyright holder nor the names of its
|
|
151
|
+
// contributors may be used to endorse or promote products derived from
|
|
152
|
+
// this software without specific prior written permission.
|
|
153
|
+
//
|
|
154
|
+
// **This software is provided by the copyright holders and contributors
|
|
155
|
+
// "as is" and any express or implied warranties, including, but not
|
|
156
|
+
// limited to, the implied warranties of merchantability and fitness for a
|
|
157
|
+
// particular purpose are disclaimed. In no event shall the copyright
|
|
158
|
+
// holder or contributors be liable for any direct, indirect, incidental,
|
|
159
|
+
// special, exemplary, or consequential damages (including, but not limited
|
|
160
|
+
// to, procurement of substitute goods or services; loss of use, data, or
|
|
161
|
+
// profits; or business interruption) however caused and on any theory of
|
|
162
|
+
// liability, whether in contract, strict liability, or tort (including
|
|
163
|
+
// negligence or otherwise) arising in any way out of the use of this
|
|
164
|
+
// software, even if advised of the possibility of such damage.**
|
|
165
|
+
const { MAX_SAFE_INTEGER } = Number;
|
|
166
|
+
const iteratorSymbol = Symbol.iterator;
|
|
167
|
+
const asyncIteratorSymbol = Symbol.asyncIterator;
|
|
168
|
+
const IntrinsicArray = Array;
|
|
169
|
+
const tooLongErrorMessage = 'Input is too long and exceeded Number.MAX_SAFE_INTEGER times.';
|
|
170
|
+
function isConstructor(obj) {
|
|
171
|
+
if (obj != null) {
|
|
172
|
+
const prox = new Proxy(obj, {
|
|
173
|
+
construct() {
|
|
174
|
+
return prox;
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
try {
|
|
178
|
+
new prox;
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
catch (err) {
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
async function fromAsync(items, mapfn, thisArg) {
|
|
190
|
+
const itemsAreIterable = (asyncIteratorSymbol in items ||
|
|
191
|
+
iteratorSymbol in items);
|
|
192
|
+
if (itemsAreIterable) {
|
|
193
|
+
const result = isConstructor(this)
|
|
194
|
+
? new this
|
|
195
|
+
: IntrinsicArray(0);
|
|
196
|
+
let i = 0;
|
|
197
|
+
for await (const v of items) {
|
|
198
|
+
if (i > MAX_SAFE_INTEGER) {
|
|
199
|
+
throw TypeError(tooLongErrorMessage);
|
|
200
|
+
}
|
|
201
|
+
else if (mapfn) {
|
|
202
|
+
result[i] = await mapfn.call(thisArg, v, i);
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
result[i] = v;
|
|
206
|
+
}
|
|
207
|
+
i++;
|
|
208
|
+
}
|
|
209
|
+
result.length = i;
|
|
210
|
+
return result;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
// In this case, the items are assumed to be an arraylike object with
|
|
214
|
+
// a length property and integer properties for each element.
|
|
215
|
+
const { length } = items;
|
|
216
|
+
const result = isConstructor(this)
|
|
217
|
+
? new this(length)
|
|
218
|
+
: IntrinsicArray(length);
|
|
219
|
+
let i = 0;
|
|
220
|
+
while (i < length) {
|
|
221
|
+
if (i > MAX_SAFE_INTEGER) {
|
|
222
|
+
throw TypeError(tooLongErrorMessage);
|
|
223
|
+
}
|
|
224
|
+
const v = await items[i];
|
|
225
|
+
if (mapfn) {
|
|
226
|
+
result[i] = await mapfn.call(thisArg, v, i);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
result[i] = v;
|
|
230
|
+
}
|
|
231
|
+
i++;
|
|
232
|
+
}
|
|
233
|
+
result.length = i;
|
|
234
|
+
return result;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (!Array.fromAsync) {
|
|
238
|
+
Array.fromAsync = fromAsync;
|
|
239
|
+
}
|
|
240
|
+
if (!Object.hasOwn) {
|
|
241
|
+
Object.defineProperty(Object, "hasOwn", {
|
|
242
|
+
value: function (object, property) {
|
|
243
|
+
if (object == null) {
|
|
244
|
+
throw new TypeError("Cannot convert undefined or null to object");
|
|
245
|
+
}
|
|
246
|
+
return Object.prototype.hasOwnProperty.call(Object(object), property);
|
|
247
|
+
},
|
|
248
|
+
configurable: true,
|
|
249
|
+
enumerable: false,
|
|
250
|
+
writable: true,
|
|
251
|
+
});
|
|
252
|
+
}
|