@google/adk 2.4.0 → 2.5.0
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/dist/cjs/a2a/a2a_remote_agent.js +17 -2
- package/dist/cjs/a2a/a2a_remote_agent_utils.js +8 -4
- package/dist/cjs/a2a/agent_card.js +5 -81
- package/dist/cjs/a2a/agent_to_a2a.js +7 -0
- package/dist/cjs/a2a/event_converter_utils.js +10 -3
- package/dist/cjs/agents/agent_engine_client.js +282 -55
- package/dist/cjs/agents/base_agent.js +111 -68
- package/dist/cjs/agents/functions.js +62 -85
- package/dist/cjs/agents/instructions.js +7 -6
- package/dist/cjs/agents/invocation_context.js +2 -2
- package/dist/cjs/agents/llm_agent.js +105 -95
- package/dist/cjs/agents/processors/content_processor_utils.js +42 -15
- package/dist/cjs/agents/processors/content_request_processor.js +28 -11
- package/dist/cjs/agents/processors/context_compactor_request_processor.js +5 -1
- package/dist/cjs/agents/processors/instructions_llm_request_processor.js +1 -1
- package/dist/cjs/agents/processors/nl_planning_processor.js +2 -1
- package/dist/cjs/artifacts/file_artifact_service.js +1 -1
- package/dist/cjs/cli/cli_eval.js +884 -17
- package/dist/cjs/cli/utils/cleanup.js +84 -0
- package/dist/cjs/cli/utils/envs.js +33 -2
- package/dist/cjs/cli/utils/evals.js +75 -8
- package/dist/cjs/cli/utils/logs.js +128 -9
- package/dist/cjs/cli/utils/path_validation.js +83 -0
- package/dist/cjs/code_executors/container_code_executor.js +158 -36
- package/dist/cjs/common.js +50 -12
- package/dist/cjs/context/compaction_utils.js +19 -0
- package/dist/cjs/events/event.js +7 -3
- package/dist/cjs/features/feature_registry.js +5 -0
- package/dist/cjs/index.js +29 -14
- package/dist/cjs/models/google_llm.js +33 -2
- package/dist/cjs/models/interactions_utils.js +3 -0
- package/dist/cjs/plugins/base_plugin.js +45 -21
- package/dist/cjs/plugins/plugin_manager.js +27 -0
- package/dist/cjs/runner/runner.js +306 -189
- package/dist/cjs/sessions/base_session_service.js +1 -4
- package/dist/cjs/sessions/database_session_service.js +191 -19
- package/dist/cjs/sessions/db/operations.js +70 -1
- package/dist/cjs/sessions/db/schema.js +4 -0
- package/dist/cjs/sessions/in_memory_session_service.js +2 -2
- package/dist/cjs/sessions/vertex_ai_session_service.js +11 -3
- package/dist/cjs/skills/loader.js +29 -28
- package/dist/cjs/telemetry/api/instrumentation.js +632 -0
- package/dist/cjs/telemetry/api/internal/common/accumulators.js +169 -0
- package/dist/cjs/telemetry/api/internal/common/attributes.js +131 -0
- package/dist/cjs/telemetry/api/internal/common/config.js +159 -0
- package/dist/cjs/telemetry/api/internal/common/error.js +98 -0
- package/dist/cjs/telemetry/api/internal/common/finish_reason.js +63 -0
- package/dist/cjs/telemetry/api/internal/common/genai_messages.js +217 -0
- package/dist/cjs/telemetry/api/internal/common/http_exchange.js +169 -0
- package/dist/cjs/telemetry/api/internal/common/provider_name.js +87 -0
- package/dist/cjs/telemetry/api/internal/common/redaction.js +148 -0
- package/dist/cjs/telemetry/api/internal/common/serialization.js +58 -0
- package/dist/cjs/telemetry/api/internal/common/token_usage.js +118 -0
- package/dist/cjs/telemetry/api/internal/logs/inference.js +50 -0
- package/dist/cjs/telemetry/api/internal/logs/logger.js +46 -0
- package/dist/cjs/telemetry/api/internal/logs/mcp.js +141 -0
- package/dist/cjs/telemetry/api/internal/metrics/agent.js +128 -0
- package/dist/cjs/telemetry/api/internal/metrics/inference_start_hook.js +56 -0
- package/dist/cjs/telemetry/api/internal/metrics/meters.js +189 -0
- package/dist/cjs/telemetry/api/internal/metrics/tool.js +147 -0
- package/dist/cjs/telemetry/api/internal/metrics/workflow.js +132 -0
- package/dist/cjs/telemetry/api/internal/trace/agent.js +52 -0
- package/dist/cjs/telemetry/api/internal/trace/compaction.js +78 -0
- package/dist/cjs/telemetry/api/internal/trace/inference.js +132 -0
- package/dist/cjs/telemetry/api/internal/trace/live.js +52 -0
- package/dist/cjs/telemetry/api/internal/trace/node.js +73 -0
- package/dist/cjs/telemetry/api/internal/trace/propagation.js +67 -0
- package/dist/cjs/telemetry/api/internal/trace/tool.js +122 -0
- package/dist/cjs/telemetry/api/internal/trace/tracer.js +77 -0
- package/dist/cjs/telemetry/api/internal/trace/workflow.js +77 -0
- package/dist/cjs/telemetry/export/agent_engine.js +90 -0
- package/dist/cjs/telemetry/export/agent_runtime.js +73 -0
- package/dist/cjs/telemetry/export/google_cloud.js +763 -0
- package/dist/cjs/telemetry/export/request_driven_metric_reader.js +303 -0
- package/dist/cjs/telemetry/{setup.js → export/setup.js} +72 -5
- package/dist/cjs/tools/agent_tool.js +9 -1
- package/dist/cjs/tools/application_integration_tool/application_integration_toolset.js +22 -34
- package/dist/cjs/tools/application_integration_tool/clients/connections_client.js +60 -20
- package/dist/cjs/tools/application_integration_tool/clients/integration_client.js +26 -10
- package/dist/cjs/tools/application_integration_tool/integration_connector_tool.js +14 -23
- package/dist/cjs/tools/base_toolset.js +1 -1
- package/dist/cjs/tools/computer_use/base_computer.js +125 -0
- package/dist/cjs/tools/computer_use/computer_use_actions.js +502 -0
- package/dist/cjs/tools/computer_use/computer_use_tool.js +244 -0
- package/dist/cjs/tools/computer_use/computer_use_toolset.js +360 -0
- package/dist/cjs/tools/function_tool.js +15 -5
- package/dist/cjs/tools/google_api_tool/google_api_toolset.js +3 -2
- package/dist/cjs/tools/google_api_tool/googleapi_to_openapi_converter.js +3 -1
- package/dist/cjs/tools/load_artifacts_tool.js +15 -5
- package/dist/cjs/tools/load_memory_tool.js +2 -5
- package/dist/cjs/tools/mcp/mcp_session_manager.js +23 -3
- package/dist/cjs/tools/mcp/mcp_tool.js +7 -3
- package/dist/cjs/tools/mcp/mcp_toolset.js +18 -6
- package/dist/cjs/tools/openapi_tool/auth/auth_helpers.js +30 -29
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +2 -2
- package/dist/cjs/tools/openapi_tool/rest_api_tool.js +45 -14
- package/dist/cjs/tools/skill/load_skill_resource_tool.js +7 -0
- package/dist/cjs/tools/skill/load_skill_tool.js +3 -0
- package/dist/cjs/tools/skill/run_skill_script_tool.js +12 -2
- package/dist/cjs/tools/toolbox_toolset.js +47 -28
- package/dist/cjs/utils/async_queue.js +37 -3
- package/dist/cjs/utils/client_labels.js +9 -11
- package/dist/cjs/utils/env_aware_utils.js +13 -7
- package/dist/cjs/utils/error_utils.js +40 -2
- package/dist/cjs/utils/failover_utils.js +10 -9
- package/dist/cjs/utils/gemini_schema_util.js +125 -12
- package/dist/cjs/utils/id_provider.js +63 -0
- package/dist/cjs/utils/model_name.js +15 -0
- package/dist/cjs/utils/simple_zod_to_json.js +13 -31
- package/dist/cjs/utils/ssrf_guard.js +46 -16
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/workflow/index.js +2 -0
- package/dist/cjs/workflow/node_runner.js +24 -80
- package/dist/cjs/workflow/nodes/parallel_worker.js +18 -7
- package/dist/cjs/workflow/run_llm_agent_as_node.js +19 -14
- package/dist/cjs/workflow/utils/retry_utils.js +2 -2
- package/dist/cjs/workflow/workflow.js +12 -12
- package/dist/esm/a2a/a2a_remote_agent.js +23 -3
- package/dist/esm/a2a/a2a_remote_agent_utils.js +8 -4
- package/dist/esm/a2a/agent_card.js +5 -83
- package/dist/esm/a2a/agent_to_a2a.js +7 -0
- package/dist/esm/a2a/event_converter_utils.js +10 -3
- package/dist/esm/agents/agent_engine_client.js +293 -55
- package/dist/esm/agents/base_agent.js +111 -72
- package/dist/esm/agents/functions.js +67 -89
- package/dist/esm/agents/instructions.js +7 -6
- package/dist/esm/agents/invocation_context.js +2 -2
- package/dist/esm/agents/llm_agent.js +111 -100
- package/dist/esm/agents/processors/content_processor_utils.js +42 -15
- package/dist/esm/agents/processors/content_request_processor.js +28 -11
- package/dist/esm/agents/processors/context_compactor_request_processor.js +5 -1
- package/dist/esm/agents/processors/instructions_llm_request_processor.js +1 -1
- package/dist/esm/agents/processors/nl_planning_processor.js +2 -1
- package/dist/esm/artifacts/file_artifact_service.js +1 -1
- package/dist/esm/cli/cli_eval.js +880 -17
- package/dist/esm/cli/utils/cleanup.js +56 -0
- package/dist/esm/cli/utils/envs.js +33 -2
- package/dist/esm/cli/utils/evals.js +74 -8
- package/dist/esm/cli/utils/logs.js +128 -9
- package/dist/esm/cli/utils/path_validation.js +45 -0
- package/dist/esm/code_executors/container_code_executor.js +158 -36
- package/dist/esm/common.js +49 -6
- package/dist/esm/context/compaction_utils.js +19 -0
- package/dist/esm/events/event.js +7 -3
- package/dist/esm/features/feature_registry.js +5 -0
- package/dist/esm/index.js +27 -15
- package/dist/esm/models/google_llm.js +33 -2
- package/dist/esm/models/interactions_utils.js +3 -0
- package/dist/esm/plugins/base_plugin.js +45 -21
- package/dist/esm/plugins/plugin_manager.js +27 -0
- package/dist/esm/runner/runner.js +310 -192
- package/dist/esm/sessions/base_session_service.js +1 -4
- package/dist/esm/sessions/database_session_service.js +191 -19
- package/dist/esm/sessions/db/operations.js +70 -1
- package/dist/esm/sessions/db/schema.js +4 -0
- package/dist/esm/sessions/in_memory_session_service.js +2 -2
- package/dist/esm/sessions/vertex_ai_session_service.js +11 -3
- package/dist/esm/skills/loader.js +29 -28
- package/dist/esm/telemetry/api/instrumentation.js +655 -0
- package/dist/esm/telemetry/api/internal/common/accumulators.js +139 -0
- package/dist/esm/telemetry/api/internal/common/attributes.js +94 -0
- package/dist/esm/telemetry/api/internal/common/config.js +128 -0
- package/dist/esm/telemetry/api/internal/common/error.js +69 -0
- package/dist/esm/telemetry/api/internal/common/finish_reason.js +35 -0
- package/dist/esm/telemetry/api/internal/common/genai_messages.js +188 -0
- package/dist/esm/telemetry/api/internal/common/http_exchange.js +142 -0
- package/dist/esm/telemetry/api/internal/common/provider_name.js +59 -0
- package/dist/esm/telemetry/api/internal/common/redaction.js +121 -0
- package/dist/esm/telemetry/api/internal/common/serialization.js +30 -0
- package/dist/esm/telemetry/api/internal/common/token_usage.js +85 -0
- package/dist/esm/telemetry/api/internal/logs/inference.js +23 -0
- package/dist/esm/telemetry/api/internal/logs/logger.js +19 -0
- package/dist/esm/telemetry/api/internal/logs/mcp.js +113 -0
- package/dist/esm/telemetry/api/internal/metrics/agent.js +107 -0
- package/dist/esm/telemetry/api/internal/metrics/inference_start_hook.js +29 -0
- package/dist/esm/telemetry/api/internal/metrics/meters.js +165 -0
- package/dist/esm/telemetry/api/internal/metrics/tool.js +119 -0
- package/dist/esm/telemetry/api/internal/metrics/workflow.js +112 -0
- package/dist/esm/telemetry/api/internal/trace/agent.js +25 -0
- package/dist/esm/telemetry/api/internal/trace/compaction.js +50 -0
- package/dist/esm/telemetry/api/internal/trace/inference.js +107 -0
- package/dist/esm/telemetry/api/internal/trace/live.js +28 -0
- package/dist/esm/telemetry/api/internal/trace/node.js +44 -0
- package/dist/esm/telemetry/api/internal/trace/propagation.js +39 -0
- package/dist/esm/telemetry/api/internal/trace/tool.js +96 -0
- package/dist/esm/telemetry/api/internal/trace/tracer.js +52 -0
- package/dist/esm/telemetry/api/internal/trace/workflow.js +54 -0
- package/dist/esm/telemetry/export/agent_engine.js +67 -0
- package/dist/esm/telemetry/export/agent_runtime.js +46 -0
- package/dist/esm/telemetry/export/google_cloud.js +733 -0
- package/dist/esm/telemetry/export/request_driven_metric_reader.js +276 -0
- package/dist/esm/telemetry/export/setup.js +160 -0
- package/dist/esm/tools/agent_tool.js +9 -1
- package/dist/esm/tools/application_integration_tool/application_integration_toolset.js +23 -35
- package/dist/esm/tools/application_integration_tool/clients/connections_client.js +64 -21
- package/dist/esm/tools/application_integration_tool/clients/integration_client.js +26 -10
- package/dist/esm/tools/application_integration_tool/integration_connector_tool.js +14 -23
- package/dist/esm/tools/base_toolset.js +1 -1
- package/dist/esm/tools/computer_use/base_computer.js +99 -0
- package/dist/esm/tools/computer_use/computer_use_actions.js +477 -0
- package/dist/esm/tools/computer_use/computer_use_tool.js +217 -0
- package/dist/esm/tools/computer_use/computer_use_toolset.js +344 -0
- package/dist/esm/tools/function_tool.js +15 -5
- package/dist/esm/tools/google_api_tool/google_api_toolset.js +3 -2
- package/dist/esm/tools/google_api_tool/googleapi_to_openapi_converter.js +3 -1
- package/dist/esm/tools/load_artifacts_tool.js +15 -5
- package/dist/esm/tools/load_memory_tool.js +2 -5
- package/dist/esm/tools/mcp/mcp_session_manager.js +23 -3
- package/dist/esm/tools/mcp/mcp_tool.js +7 -3
- package/dist/esm/tools/mcp/mcp_toolset.js +18 -6
- package/dist/esm/tools/openapi_tool/auth/auth_helpers.js +27 -26
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +2 -2
- package/dist/esm/tools/openapi_tool/rest_api_tool.js +45 -14
- package/dist/esm/tools/skill/load_skill_resource_tool.js +7 -0
- package/dist/esm/tools/skill/load_skill_tool.js +3 -0
- package/dist/esm/tools/skill/run_skill_script_tool.js +12 -2
- package/dist/esm/tools/toolbox_toolset.js +47 -28
- package/dist/esm/utils/async_queue.js +37 -3
- package/dist/esm/utils/client_labels.js +9 -11
- package/dist/esm/utils/env_aware_utils.js +12 -7
- package/dist/esm/utils/error_utils.js +37 -1
- package/dist/esm/utils/failover_utils.js +10 -9
- package/dist/esm/utils/gemini_schema_util.js +124 -11
- package/dist/esm/utils/id_provider.js +33 -0
- package/dist/esm/utils/model_name.js +14 -0
- package/dist/esm/utils/simple_zod_to_json.js +13 -31
- package/dist/esm/utils/ssrf_guard.js +55 -15
- package/dist/esm/version.js +1 -1
- package/dist/esm/workflow/index.js +2 -1
- package/dist/esm/workflow/node_runner.js +26 -80
- package/dist/esm/workflow/nodes/parallel_worker.js +16 -6
- package/dist/esm/workflow/run_llm_agent_as_node.js +19 -14
- package/dist/esm/workflow/utils/retry_utils.js +2 -2
- package/dist/esm/workflow/workflow.js +12 -12
- package/dist/types/a2a/a2a_remote_agent.d.ts +6 -0
- package/dist/types/a2a/a2a_remote_agent_utils.d.ts +3 -2
- package/dist/types/agents/agent_engine_client.d.ts +121 -3
- package/dist/types/agents/base_agent.d.ts +2 -0
- package/dist/types/agents/processors/content_processor_utils.d.ts +9 -9
- package/dist/types/agents/run_config.d.ts +14 -0
- package/dist/types/cli/cli_eval.d.ts +172 -9
- package/dist/types/cli/utils/cleanup.d.ts +18 -0
- package/dist/types/cli/utils/envs.d.ts +13 -3
- package/dist/types/cli/utils/evals.d.ts +64 -1
- package/dist/types/cli/utils/logs.d.ts +19 -2
- package/dist/types/cli/utils/path_validation.d.ts +30 -0
- package/dist/types/code_executors/container_code_executor.d.ts +49 -8
- package/dist/types/common.d.ts +16 -9
- package/dist/types/context/compaction_utils.d.ts +13 -1
- package/dist/types/events/event.d.ts +3 -0
- package/dist/types/features/feature_registry.d.ts +1 -0
- package/dist/types/index.d.ts +9 -6
- package/dist/types/plugins/base_plugin.d.ts +50 -21
- package/dist/types/plugins/plugin_manager.d.ts +13 -0
- package/dist/types/runner/runner.d.ts +11 -0
- package/dist/types/sessions/base_session_service.d.ts +0 -2
- package/dist/types/sessions/db/operations.d.ts +2 -1
- package/dist/types/sessions/db/schema.d.ts +5 -3
- package/dist/types/telemetry/api/instrumentation.d.ts +259 -0
- package/dist/types/telemetry/api/internal/common/accumulators.d.ts +91 -0
- package/dist/types/telemetry/api/internal/common/attributes.d.ts +90 -0
- package/dist/types/telemetry/api/internal/common/config.d.ts +61 -0
- package/dist/types/telemetry/api/internal/common/error.d.ts +29 -0
- package/dist/types/telemetry/api/internal/common/finish_reason.d.ts +18 -0
- package/dist/types/telemetry/api/internal/common/genai_messages.d.ts +26 -0
- package/dist/types/telemetry/api/internal/common/http_exchange.d.ts +50 -0
- package/dist/types/telemetry/api/internal/common/provider_name.d.ts +16 -0
- package/dist/types/telemetry/api/internal/common/redaction.d.ts +14 -0
- package/dist/types/telemetry/api/internal/common/serialization.d.ts +18 -0
- package/dist/types/telemetry/api/internal/common/token_usage.d.ts +47 -0
- package/dist/types/telemetry/api/internal/logs/inference.d.ts +15 -0
- package/dist/types/telemetry/api/internal/logs/logger.d.ts +13 -0
- package/dist/types/telemetry/api/internal/logs/mcp.d.ts +31 -0
- package/dist/types/telemetry/api/internal/metrics/agent.d.ts +28 -0
- package/dist/types/telemetry/api/internal/metrics/inference_start_hook.d.ts +12 -0
- package/dist/types/telemetry/api/internal/metrics/meters.d.ts +57 -0
- package/dist/types/telemetry/api/internal/metrics/tool.d.ts +44 -0
- package/dist/types/telemetry/api/internal/metrics/workflow.d.ts +32 -0
- package/dist/types/telemetry/api/internal/trace/agent.d.ts +14 -0
- package/dist/types/telemetry/api/internal/trace/compaction.d.ts +20 -0
- package/dist/types/telemetry/api/internal/trace/inference.d.ts +31 -0
- package/dist/types/telemetry/api/internal/trace/live.d.ts +21 -0
- package/dist/types/telemetry/api/internal/trace/node.d.ts +22 -0
- package/dist/types/telemetry/api/internal/trace/propagation.d.ts +22 -0
- package/dist/types/telemetry/api/internal/trace/tool.d.ts +57 -0
- package/dist/types/telemetry/api/internal/trace/tracer.d.ts +31 -0
- package/dist/types/telemetry/api/internal/trace/workflow.d.ts +21 -0
- package/dist/types/telemetry/export/agent_engine.d.ts +23 -0
- package/dist/types/telemetry/export/agent_runtime.d.ts +40 -0
- package/dist/types/telemetry/export/google_cloud.d.ts +189 -0
- package/dist/types/telemetry/export/request_driven_metric_reader.d.ts +144 -0
- package/dist/types/telemetry/{setup.d.ts → export/setup.d.ts} +3 -0
- package/dist/types/tools/agent_tool.d.ts +1 -1
- package/dist/types/tools/application_integration_tool/clients/connections_client.d.ts +13 -4
- package/dist/types/tools/base_toolset.d.ts +1 -1
- package/dist/types/tools/computer_use/base_computer.d.ts +281 -0
- package/dist/types/tools/computer_use/computer_use_actions.d.ts +53 -0
- package/dist/types/tools/computer_use/computer_use_tool.d.ts +108 -0
- package/dist/types/tools/computer_use/computer_use_toolset.d.ts +132 -0
- package/dist/types/tools/google_api_tool/google_api_toolset.d.ts +2 -0
- package/dist/types/tools/load_artifacts_tool.d.ts +5 -1
- package/dist/types/tools/load_memory_tool.d.ts +13 -7
- package/dist/types/tools/mcp/mcp_session_manager.d.ts +16 -0
- package/dist/types/tools/openapi_tool/auth/auth_helpers.d.ts +8 -8
- package/dist/types/tools/openapi_tool/openapi_spec_parser/operation_parser.d.ts +7 -3
- package/dist/types/tools/toolbox_toolset.d.ts +15 -20
- package/dist/types/utils/async_queue.d.ts +14 -0
- package/dist/types/utils/env_aware_utils.d.ts +11 -0
- package/dist/types/utils/error_utils.d.ts +4 -0
- package/dist/types/utils/gemini_schema_util.d.ts +27 -6
- package/dist/types/utils/id_provider.d.ts +43 -0
- package/dist/types/utils/model_name.d.ts +8 -0
- package/dist/types/utils/ssrf_guard.d.ts +2 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/workflow/index.d.ts +1 -1
- package/dist/types/workflow/nodes/parallel_worker.d.ts +8 -1
- package/dist/web/index_web.js +86 -88
- package/dist/web/index_web.js.map +4 -4
- package/package.json +13 -15
- package/dist/cjs/telemetry/google_cloud.js +0 -116
- package/dist/cjs/telemetry/tracing.js +0 -393
- package/dist/esm/telemetry/google_cloud.js +0 -99
- package/dist/esm/telemetry/setup.js +0 -88
- package/dist/esm/telemetry/tracing.js +0 -361
- package/dist/types/telemetry/google_cloud.d.ts +0 -9
- package/dist/types/telemetry/tracing.d.ts +0 -143
|
@@ -20,22 +20,28 @@ export interface LoadMemoryToolOptions {
|
|
|
20
20
|
/**
|
|
21
21
|
* Response returned by {@link LoadMemoryTool}.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* By default, `memories` contains complete {@link MemoryEntry} objects.
|
|
24
|
+
* When {@link LoadMemoryToolOptions.textOnlyContent} is `true`, each entry
|
|
25
|
+
* contains a flattened `string` in `content` alongside `author` and
|
|
26
|
+
* `timestamp`.
|
|
25
27
|
*/
|
|
26
|
-
export interface LoadMemoryResponse {
|
|
27
|
-
memories:
|
|
28
|
+
export interface LoadMemoryResponse<T = MemoryEntry> {
|
|
29
|
+
memories: T[];
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
|
-
* A tool that loads
|
|
32
|
+
* A tool that loads memory entries for the current user.
|
|
31
33
|
*
|
|
32
|
-
*
|
|
34
|
+
* By default, returns complete {@link MemoryEntry} objects.
|
|
33
35
|
*/
|
|
34
36
|
export declare class LoadMemoryTool extends BaseTool {
|
|
35
37
|
private readonly textOnlyContent;
|
|
36
38
|
constructor(options?: LoadMemoryToolOptions);
|
|
37
39
|
_getDeclaration(): FunctionDeclaration | undefined;
|
|
38
|
-
runAsync({ args, toolContext
|
|
40
|
+
runAsync({ args, toolContext }: RunAsyncToolRequest): Promise<LoadMemoryResponse<MemoryEntry | {
|
|
41
|
+
content: string;
|
|
42
|
+
author?: string;
|
|
43
|
+
timestamp?: string;
|
|
44
|
+
}>>;
|
|
39
45
|
processLlmRequest(request: ToolProcessLlmRequest): Promise<void>;
|
|
40
46
|
}
|
|
41
47
|
/**
|
|
@@ -7,6 +7,7 @@ import type { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
|
7
7
|
import type { SSEClientTransportOptions } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
8
8
|
import type { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
9
9
|
import type { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
10
|
+
import type { RequestOptions } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
10
11
|
/**
|
|
11
12
|
* Defines the parameters for establishing a connection to an MCP server using
|
|
12
13
|
* standard input/output (stdio). This is typically used for running MCP servers
|
|
@@ -15,6 +16,10 @@ import type { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol
|
|
|
15
16
|
export interface StdioConnectionParams {
|
|
16
17
|
type: 'StdioConnectionParams';
|
|
17
18
|
serverParams: StdioServerParameters;
|
|
19
|
+
/**
|
|
20
|
+
* Request timeout in seconds for stdio MCP operations. When unset, the MCP
|
|
21
|
+
* SDK applies its own default request timeout.
|
|
22
|
+
*/
|
|
18
23
|
timeout?: number;
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
@@ -94,6 +99,17 @@ export declare class MCPSessionManager {
|
|
|
94
99
|
private readonly connectionParams;
|
|
95
100
|
private readonly activeSessions;
|
|
96
101
|
constructor(connectionParams: MCPConnectionParams);
|
|
102
|
+
/**
|
|
103
|
+
* Builds per-request options for MCP client operations.
|
|
104
|
+
*
|
|
105
|
+
* For a stdio connection with a configured `timeout`, the timeout is
|
|
106
|
+
* converted from seconds to milliseconds. Otherwise the MCP SDK applies its
|
|
107
|
+
* own default request timeout.
|
|
108
|
+
*
|
|
109
|
+
* @param signal Optional abort signal to attach to the request.
|
|
110
|
+
* @return The request options for the MCP SDK client.
|
|
111
|
+
*/
|
|
112
|
+
getRequestOptions(signal?: AbortSignal): RequestOptions;
|
|
97
113
|
createSession(): Promise<Client>;
|
|
98
114
|
closeSession(client: Client): Promise<void>;
|
|
99
115
|
getActiveSessions(): Client[];
|
|
@@ -86,7 +86,7 @@ export declare function tokenToSchemeCredential(tokenType: 'apikey' | 'oauth2Tok
|
|
|
86
86
|
* @param scopes The scopes to request.
|
|
87
87
|
* @returns A `[scheme, credential]` pair.
|
|
88
88
|
*/
|
|
89
|
-
export declare function
|
|
89
|
+
export declare function serviceAccountRecordToSchemeCredential(config: Record<string, unknown>, scopes: string[]): [AuthScheme, AuthCredential];
|
|
90
90
|
/**
|
|
91
91
|
* Creates a bearer scheme and a service-account credential from an already
|
|
92
92
|
* built `ServiceAccount`.
|
|
@@ -99,16 +99,16 @@ export declare function serviceAccountSchemeCredential(config: ServiceAccount):
|
|
|
99
99
|
* Builds an OpenID Connect scheme and credential from a configuration object
|
|
100
100
|
* and a client-secret object.
|
|
101
101
|
*
|
|
102
|
-
* @param
|
|
102
|
+
* @param configRecord An OpenID Connect configuration. Snake_case keys, as a
|
|
103
103
|
* discovery document delivers them, are accepted and normalized.
|
|
104
104
|
* @param scopes The scopes to request.
|
|
105
|
-
* @param
|
|
105
|
+
* @param credentialRecord The Google OAuth client secret. Its keys stay
|
|
106
106
|
* snake_case, because it is an on-disk wire format. A `{web: {…}}` or
|
|
107
107
|
* `{installed: {…}}` wrapper is unwrapped.
|
|
108
108
|
* @returns A `[scheme, credential]` pair.
|
|
109
109
|
* @throws Error When the configuration or the client secret is incomplete.
|
|
110
110
|
*/
|
|
111
|
-
export declare function
|
|
111
|
+
export declare function openidRecordToSchemeCredential(configRecord: Record<string, unknown>, scopes: string[], credentialRecord: Record<string, unknown>): [OpenIdConnectWithConfig, AuthCredential];
|
|
112
112
|
/**
|
|
113
113
|
* Fetches an OpenID Connect discovery document and pairs it with a client
|
|
114
114
|
* secret.
|
|
@@ -118,12 +118,12 @@ export declare function openidDictToSchemeCredential(configDict: Record<string,
|
|
|
118
118
|
*
|
|
119
119
|
* @param openidUrl The OpenID Connect discovery URL.
|
|
120
120
|
* @param scopes The scopes to request.
|
|
121
|
-
* @param
|
|
121
|
+
* @param credentialRecord The Google OAuth client secret, keyed snake_case.
|
|
122
122
|
* @returns A `[scheme, credential]` pair.
|
|
123
123
|
* @throws Error When the request fails, the body is not a JSON object, or the
|
|
124
124
|
* configuration is incomplete.
|
|
125
125
|
*/
|
|
126
|
-
export declare function openidUrlToSchemeCredential(openidUrl: string, scopes: string[],
|
|
126
|
+
export declare function openidUrlToSchemeCredential(openidUrl: string, scopes: string[], credentialRecord: Record<string, unknown>): Promise<[OpenIdConnectWithConfig, AuthCredential]>;
|
|
127
127
|
/**
|
|
128
128
|
* Converts a scheme and credential into the tool parameter that carries the
|
|
129
129
|
* credential, plus the value to send for it.
|
|
@@ -144,7 +144,7 @@ export declare function credentialToParam(authScheme: AuthScheme, authCredential
|
|
|
144
144
|
* `AuthScheme`.
|
|
145
145
|
*
|
|
146
146
|
* @example
|
|
147
|
-
* const scheme =
|
|
147
|
+
* const scheme = recordToAuthScheme({
|
|
148
148
|
* type: 'apiKey',
|
|
149
149
|
* in: 'header',
|
|
150
150
|
* name: 'X-API-Key',
|
|
@@ -155,4 +155,4 @@ export declare function credentialToParam(authScheme: AuthScheme, authCredential
|
|
|
155
155
|
* @throws Error When `type` is missing or unrecognised, or the rest of the
|
|
156
156
|
* object does not match the shape that type requires.
|
|
157
157
|
*/
|
|
158
|
-
export declare function
|
|
158
|
+
export declare function recordToAuthScheme(data: Record<string, unknown>): AuthScheme;
|
|
@@ -104,6 +104,9 @@ export declare class OperationParser {
|
|
|
104
104
|
/**
|
|
105
105
|
* Gets the Python-style type hint of the return value.
|
|
106
106
|
*
|
|
107
|
+
* @deprecated Legacy Python type-hint helper retained for compatibility. In
|
|
108
|
+
* `adk-js`, tool declarations pass the JSON schema from
|
|
109
|
+
* {@link OperationParser.getJsonSchema} directly to the model.
|
|
107
110
|
* @returns A type name such as `str`, or `Any` when the operation declares
|
|
108
111
|
* no typed 2xx response.
|
|
109
112
|
*/
|
|
@@ -112,9 +115,10 @@ export declare class OperationParser {
|
|
|
112
115
|
* Generates a Python-style docstring describing the operation, every
|
|
113
116
|
* parameter and the return value.
|
|
114
117
|
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
+
* @deprecated Legacy Python docstring helper retained for compatibility. In
|
|
119
|
+
* `adk-js`, tool declarations use {@link OperationParser.getDescription}
|
|
120
|
+
* and {@link OperationParser.getJsonSchema} rather than sending a Python
|
|
121
|
+
* docstring to the model.
|
|
118
122
|
* @returns The generated docstring.
|
|
119
123
|
*/
|
|
120
124
|
getPydocString(): string;
|
|
@@ -33,12 +33,12 @@ export interface ToolboxToolLike {
|
|
|
33
33
|
*/
|
|
34
34
|
export interface ToolboxLoadOptions {
|
|
35
35
|
/**
|
|
36
|
-
* Mapping of authentication service names to
|
|
36
|
+
* Mapping of authentication service names to functions that return the
|
|
37
37
|
* corresponding authentication token.
|
|
38
38
|
*/
|
|
39
39
|
authTokenGetters?: Record<string, () => string | Promise<string>>;
|
|
40
40
|
/**
|
|
41
|
-
* Mapping of parameter names to bind to fixed values or
|
|
41
|
+
* Mapping of parameter names to bind to fixed values or functions that
|
|
42
42
|
* produce values as needed.
|
|
43
43
|
*/
|
|
44
44
|
boundParams?: Record<string, unknown>;
|
|
@@ -49,21 +49,13 @@ export interface ToolboxLoadOptions {
|
|
|
49
49
|
*/
|
|
50
50
|
export interface ToolboxToolsetClientLike {
|
|
51
51
|
/**
|
|
52
|
-
* Loads a single tool by name
|
|
52
|
+
* Loads a single tool by name.
|
|
53
53
|
*/
|
|
54
|
-
loadTool?: (toolName: string,
|
|
54
|
+
loadTool?: (toolName: string, authTokenGetters?: Record<string, () => string | Promise<string>>, boundParams?: Record<string, unknown>) => BaseTool | ToolboxToolLike | ((...args: never[]) => unknown) | Promise<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)>;
|
|
55
55
|
/**
|
|
56
|
-
* Loads a
|
|
56
|
+
* Loads a toolset by name.
|
|
57
57
|
*/
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Loads a toolset by name (camelCase convention).
|
|
61
|
-
*/
|
|
62
|
-
loadToolset?: (toolsetName: string, options?: ToolboxLoadOptions) => Array<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)> | Promise<Array<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)>>;
|
|
63
|
-
/**
|
|
64
|
-
* Loads a toolset by name (snake_case convention).
|
|
65
|
-
*/
|
|
66
|
-
load_toolset?: (toolsetName: string, options?: ToolboxLoadOptions) => Array<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)> | Promise<Array<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)>>;
|
|
58
|
+
loadToolset?: (toolsetName: string, authTokenGetters?: Record<string, () => string | Promise<string>>, boundParams?: Record<string, unknown>) => Array<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)> | Promise<Array<BaseTool | ToolboxToolLike | ((...args: never[]) => unknown)>>;
|
|
67
59
|
/**
|
|
68
60
|
* Closes the underlying client resources.
|
|
69
61
|
*/
|
|
@@ -74,9 +66,9 @@ export interface ToolboxToolsetClientLike {
|
|
|
74
66
|
*/
|
|
75
67
|
export interface ToolboxToolsetOptions {
|
|
76
68
|
/**
|
|
77
|
-
* The URL of the Toolbox server.
|
|
69
|
+
* The URL of the Toolbox server. Required when `client` is not provided.
|
|
78
70
|
*/
|
|
79
|
-
serverUrl
|
|
71
|
+
serverUrl?: string;
|
|
80
72
|
/**
|
|
81
73
|
* The name of the Toolbox toolset to load.
|
|
82
74
|
*/
|
|
@@ -86,12 +78,12 @@ export interface ToolboxToolsetOptions {
|
|
|
86
78
|
*/
|
|
87
79
|
toolNames?: readonly string[];
|
|
88
80
|
/**
|
|
89
|
-
* Mapping of authentication service names to
|
|
81
|
+
* Mapping of authentication service names to functions that return the
|
|
90
82
|
* corresponding authentication token.
|
|
91
83
|
*/
|
|
92
84
|
authTokenGetters?: Record<string, () => string | Promise<string>>;
|
|
93
85
|
/**
|
|
94
|
-
* Mapping of parameter names to bind to fixed values or
|
|
86
|
+
* Mapping of parameter names to bind to fixed values or functions that
|
|
95
87
|
* produce values as needed.
|
|
96
88
|
*/
|
|
97
89
|
boundParams?: Record<string, unknown>;
|
|
@@ -121,9 +113,9 @@ export declare class ToolboxToolset extends BaseToolset {
|
|
|
121
113
|
/** A unique symbol to identify ADK ToolboxToolset class. */
|
|
122
114
|
readonly [TOOLBOX_TOOLSET_SIGNATURE_SYMBOL] = true;
|
|
123
115
|
/**
|
|
124
|
-
* The URL of the Toolbox server.
|
|
116
|
+
* The URL of the Toolbox server, if configured.
|
|
125
117
|
*/
|
|
126
|
-
readonly serverUrl
|
|
118
|
+
readonly serverUrl?: string;
|
|
127
119
|
/**
|
|
128
120
|
* The name of the Toolbox toolset to load, if configured.
|
|
129
121
|
*/
|
|
@@ -145,6 +137,9 @@ export declare class ToolboxToolset extends BaseToolset {
|
|
|
145
137
|
*/
|
|
146
138
|
readonly toolboxClient: ToolboxToolsetClientLike;
|
|
147
139
|
constructor(options: ToolboxToolsetOptions);
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated Use `new ToolboxToolset({serverUrl, ...options})` instead.
|
|
142
|
+
*/
|
|
148
143
|
constructor(serverUrl: string, options: Omit<ToolboxToolsetOptions, 'serverUrl'>);
|
|
149
144
|
/**
|
|
150
145
|
* Loads the configured toolset and/or individual tools from the Toolbox
|
|
@@ -18,12 +18,16 @@
|
|
|
18
18
|
* queue, so a later `close()` can't discard the error.
|
|
19
19
|
* - {@link push} after close/fail is ignored (the producer has already
|
|
20
20
|
* signalled completion).
|
|
21
|
+
* - {@link pushAndWait} resolves once the consumer has finished with the item:
|
|
22
|
+
* when it asks for the next one, or when the queue closes or fails.
|
|
21
23
|
*/
|
|
22
24
|
export declare class AsyncQueue<T> implements AsyncIterable<T> {
|
|
23
25
|
private queue;
|
|
24
26
|
private resolvers;
|
|
25
27
|
private closed;
|
|
26
28
|
private failure?;
|
|
29
|
+
/** Releases the producer of the item the consumer currently holds. */
|
|
30
|
+
private deliveredAck?;
|
|
27
31
|
/** Whether the queue has been closed or failed. */
|
|
28
32
|
get isClosed(): boolean;
|
|
29
33
|
/** Number of items buffered and not yet consumed. */
|
|
@@ -33,6 +37,16 @@ export declare class AsyncQueue<T> implements AsyncIterable<T> {
|
|
|
33
37
|
* immediately; otherwise the value is buffered. No-op once closed/failed.
|
|
34
38
|
*/
|
|
35
39
|
push(value: T): void;
|
|
40
|
+
/**
|
|
41
|
+
* Enqueues a value like {@link push}, and resolves once the consumer has
|
|
42
|
+
* finished with it: when it asks for the next item, or when the queue closes
|
|
43
|
+
* or fails. Resolves at once if the queue is already closed.
|
|
44
|
+
*/
|
|
45
|
+
pushAndWait(value: T): Promise<void>;
|
|
46
|
+
private enqueue;
|
|
47
|
+
/** Releases every producer still waiting in {@link pushAndWait}. */
|
|
48
|
+
private releaseAll;
|
|
49
|
+
private releaseDelivered;
|
|
36
50
|
/**
|
|
37
51
|
* Signals that production failed. Buffered items are still delivered first;
|
|
38
52
|
* once the buffer drains, the consumer's next `next()` rejects with `error`.
|
|
@@ -68,6 +68,17 @@ export declare function base64Decode(data: string): string;
|
|
|
68
68
|
* @return True if the string is base64-encoded, false otherwise.
|
|
69
69
|
*/
|
|
70
70
|
export declare function isBase64Encoded(data: string): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Gets the value of the given environment variable.
|
|
73
|
+
*
|
|
74
|
+
* Browsers have no `process` global, and there even `process?.env` throws a
|
|
75
|
+
* ReferenceError, so this checks `typeof process` first and treats every
|
|
76
|
+
* variable as unset.
|
|
77
|
+
*
|
|
78
|
+
* @param envVar The environment variable to get the value of.
|
|
79
|
+
* @return The value of the environment variable, or undefined if it is unset.
|
|
80
|
+
*/
|
|
81
|
+
export declare function getEnvVar(envVar: string): string | undefined;
|
|
71
82
|
/**
|
|
72
83
|
* Gets the boolean value of the given environment variable.
|
|
73
84
|
*
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* Copyright 2026 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
/** Normalizes a plugin notification without changing the caller's thrown value. */
|
|
7
|
+
export declare function toError(error: unknown): Error;
|
|
8
|
+
/** Recognizes cancellation within 32 cause levels, only after signal abort. */
|
|
9
|
+
export declare function isInvocationCancellation(error: unknown, signal?: AbortSignal): boolean;
|
|
6
10
|
/**
|
|
7
11
|
* Returns the plain, non-recursive message for a single thrown value.
|
|
8
12
|
*
|
|
@@ -9,15 +9,32 @@ export type MCPToolSchema = {
|
|
|
9
9
|
properties?: Record<string, unknown>;
|
|
10
10
|
required?: string[];
|
|
11
11
|
};
|
|
12
|
-
export declare function toGeminiSchema(mcpSchema?: MCPToolSchema): Schema | undefined;
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
13
|
+
* Copies the constraint keywords a genai `Schema` declares from a JSON Schema
|
|
14
|
+
* node onto a `Schema` node, in the encoding the genai dialect expects.
|
|
15
|
+
*
|
|
16
|
+
* This is the one place that decides which constraints survive a conversion, so
|
|
17
|
+
* that both converters apply the same rules: `toGeminiSchema` for a JSON Schema
|
|
18
|
+
* (an MCP tool schema, or a serialized Zod response) and `zodObjectToSchema`
|
|
19
|
+
* for a Zod object. Without this, every nested `minItems`/`minLength`/`minimum`
|
|
20
|
+
* is silently dropped and the model is told an unconstrained schema.
|
|
21
|
+
*
|
|
22
|
+
* - `minItems`/`maxItems`, `minLength`/`maxLength` and
|
|
23
|
+
* `minProperties`/`maxProperties` are counts and lengths, which the genai
|
|
24
|
+
* `Schema` stores as strings.
|
|
25
|
+
* - `minimum`/`maximum` stay numbers, as `Schema` declares them.
|
|
26
|
+
* - `pattern` is already a string in both dialects, and survives unless it
|
|
27
|
+
* merely restates an `email`/`uuid` format.
|
|
16
28
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
29
|
+
* Every other JSON Schema keyword (`title`, `default`, `example`,
|
|
30
|
+
* `exclusiveMinimum`, ...) and any unsupported `format` has no `Schema` field
|
|
31
|
+
* the backend accepts, so it is still dropped.
|
|
32
|
+
*
|
|
33
|
+
* @param source The JSON Schema node to read the constraints from.
|
|
34
|
+
* @param target The `Schema` node to write them to; may be `source` itself.
|
|
19
35
|
*/
|
|
20
|
-
export declare function
|
|
36
|
+
export declare function copySchemaConstraints(source: Record<string, unknown>, target: Record<string, unknown>): void;
|
|
37
|
+
export declare function toGeminiSchema(mcpSchema?: MCPToolSchema): Schema | undefined;
|
|
21
38
|
/**
|
|
22
39
|
* Converts an OpenAPI schema to a Gemini `Schema`.
|
|
23
40
|
*
|
|
@@ -26,6 +43,10 @@ export declare function normalizeJsonSchemaType(jsonSchemaType?: unknown): [stri
|
|
|
26
43
|
* it likes, so a key the Gemini `Schema` does not declare is dropped instead of
|
|
27
44
|
* being forwarded to a backend that rejects it.
|
|
28
45
|
*
|
|
46
|
+
* `oneOf` branches are folded into `anyOf`. A `{type: 'null'}` branch is
|
|
47
|
+
* removed and marks the schema `nullable`. When only one branch remains, it is
|
|
48
|
+
* merged into the parent schema instead of being kept as a one-item `anyOf`.
|
|
49
|
+
*
|
|
29
50
|
* @param openApiSchema The OpenAPI schema, which may be any value.
|
|
30
51
|
* @returns The converted schema, or `undefined` when there is no input.
|
|
31
52
|
* @throws {TypeError} If the input is neither an object nor nullish.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Returns a new unique ID string.
|
|
8
|
+
*/
|
|
9
|
+
export type IdProvider = () => string;
|
|
10
|
+
/**
|
|
11
|
+
* Sets the function used to generate event, invocation, session and
|
|
12
|
+
* function-call IDs. Without a provider, every ID keeps its default format.
|
|
13
|
+
*
|
|
14
|
+
* Useful when random IDs are not unique, e.g. runtimes restored from one
|
|
15
|
+
* memory snapshot share RNG state. Like adk-python's `set_id_provider`, but
|
|
16
|
+
* global instead of scoped to an async context.
|
|
17
|
+
*
|
|
18
|
+
* Each value must be a non-empty string that no other runtime produces.
|
|
19
|
+
* Session IDs come from it too, so the values should also be hard to guess.
|
|
20
|
+
*
|
|
21
|
+
* @param provider A function that returns a unique ID string.
|
|
22
|
+
*/
|
|
23
|
+
export declare function setIdProvider(provider: IdProvider): void;
|
|
24
|
+
/**
|
|
25
|
+
* Removes the provider set with `setIdProvider`, so IDs go back to their
|
|
26
|
+
* default formats.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resetIdProvider(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Returns a new unique ID from the provider set with `setIdProvider`, or a
|
|
31
|
+
* random v4 UUID when none is set.
|
|
32
|
+
*/
|
|
33
|
+
export declare function newId(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Returns a new unique ID from the provider set with `setIdProvider`, or from
|
|
36
|
+
* `fallback` when none is set.
|
|
37
|
+
*
|
|
38
|
+
* Internal to the framework: not part of the public API. For IDs whose default
|
|
39
|
+
* is not a random v4 UUID, such as event IDs.
|
|
40
|
+
*
|
|
41
|
+
* @param fallback A function that returns the default ID.
|
|
42
|
+
*/
|
|
43
|
+
export declare function newIdOr(fallback: IdProvider): string;
|
|
@@ -18,6 +18,14 @@ export declare function extractModelName(modelString: string): string;
|
|
|
18
18
|
* @return true if it's a Gemini model, false otherwise.
|
|
19
19
|
*/
|
|
20
20
|
export declare function isGeminiModel(modelString: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the major version of a `gemini-*` model.
|
|
23
|
+
*
|
|
24
|
+
* @param modelString Either a simple model name or path-based model name.
|
|
25
|
+
* @return The major version, or `undefined` when the model is not a Gemini
|
|
26
|
+
* model or its version is not numeric (for example `gemini-flash-latest`).
|
|
27
|
+
*/
|
|
28
|
+
export declare function getGeminiMajorVersion(modelString: string | undefined): number | undefined;
|
|
21
29
|
/**
|
|
22
30
|
* Check if the model is a Gemini 1.x model using regex patterns.
|
|
23
31
|
*
|
|
@@ -24,6 +24,8 @@ export declare function isNonGlobalAddress(address: string): boolean;
|
|
|
24
24
|
* embeds a link-local IPv4. Unparseable input fails closed (blocked).
|
|
25
25
|
*/
|
|
26
26
|
export declare function isLinkLocalAddress(address: string): boolean;
|
|
27
|
+
/** Returns `true` when `address` is an IPv4 or IPv6 literal (without brackets). */
|
|
28
|
+
export declare function isIpAddress(address: string): boolean;
|
|
27
29
|
/**
|
|
28
30
|
* Resolves `hostname` to a de-duplicated list of IP addresses. IP literals are
|
|
29
31
|
* returned as-is; hostnames are resolved via DNS. Throws when resolution yields
|
package/dist/types/version.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export { FunctionNode } from './nodes/function_node.js';
|
|
|
21
21
|
export type { FunctionNodeConfig, FunctionNodeHandler, FunctionNodeResult, } from './nodes/function_node.js';
|
|
22
22
|
export { JoinNode } from './nodes/join_node.js';
|
|
23
23
|
export { NodeTool } from './nodes/node_tool.js';
|
|
24
|
-
export { ParallelWorker } from './nodes/parallel_worker.js';
|
|
24
|
+
export { ParallelWorker, isParallelWorker } from './nodes/parallel_worker.js';
|
|
25
25
|
export type { ParallelWorkerConfig } from './nodes/parallel_worker.js';
|
|
26
26
|
export { ToolNode } from './nodes/tool_node.js';
|
|
27
27
|
export type { ToolNodeConfig } from './nodes/tool_node.js';
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { BaseNode } from '../base_node.js';
|
|
7
7
|
import { RunnableNode } from '../graph.js';
|
|
8
8
|
import { NodeContext } from '../node_context.js';
|
|
9
|
+
declare const PARALLEL_WORKER_SIGNATURE_SYMBOL: unique symbol;
|
|
9
10
|
/** Options for a {@link ParallelWorker}. */
|
|
10
11
|
export interface ParallelWorkerConfig {
|
|
11
12
|
/**
|
|
@@ -48,8 +49,14 @@ export interface ParallelWorkerConfig {
|
|
|
48
49
|
* `ctx.runNode` has no way to forward a signal into a child run.
|
|
49
50
|
*/
|
|
50
51
|
export declare class ParallelWorker extends BaseNode {
|
|
52
|
+
readonly [PARALLEL_WORKER_SIGNATURE_SYMBOL] = true;
|
|
51
53
|
readonly maxParallelWorkers?: number;
|
|
52
|
-
|
|
54
|
+
readonly inner: BaseNode;
|
|
53
55
|
constructor(inner: RunnableNode, config?: ParallelWorkerConfig);
|
|
54
56
|
protected runImpl(ctx: NodeContext, input: unknown): AsyncGenerator<unknown, void, void>;
|
|
55
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Type guard to check if an object is an instance of {@link ParallelWorker}.
|
|
60
|
+
*/
|
|
61
|
+
export declare function isParallelWorker(value: unknown): value is ParallelWorker;
|
|
62
|
+
export {};
|