agentengine-sdk-python 0.7.0__py3-none-any.whl → 0.8.1__py3-none-any.whl
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.
- {agentengine_sdk_python-0.7.0.dist-info → agentengine_sdk_python-0.8.1.dist-info}/METADATA +52 -20
- agentengine_sdk_python-0.8.1.dist-info/RECORD +644 -0
- {agentengine_sdk_python-0.7.0.dist-info → agentengine_sdk_python-0.8.1.dist-info}/WHEEL +1 -1
- ksadk/a2a/__init__.py +180 -11
- ksadk/a2a/bootstrap.py +332 -0
- ksadk/a2a/card.py +15 -0
- ksadk/a2a/context_store.py +203 -0
- ksadk/a2a/control_plane.py +1056 -0
- ksadk/a2a/credential.py +99 -0
- ksadk/a2a/event_adapter.py +149 -0
- ksadk/a2a/executor.py +361 -137
- ksadk/a2a/external_transport.py +516 -0
- ksadk/a2a/identity.py +304 -0
- ksadk/a2a/ids.py +22 -0
- ksadk/a2a/langgraph.py +285 -0
- ksadk/a2a/resume_store.py +201 -0
- ksadk/a2a/routes.py +112 -0
- ksadk/a2a/server.py +102 -62
- ksadk/a2a/service_env.py +33 -0
- ksadk/a2a/space_client.py +1122 -0
- ksadk/a2a/task_adapter.py +423 -0
- ksadk/a2a/task_event_dispatcher.py +167 -0
- ksadk/a2a/task_event_outbox.py +326 -0
- ksadk/a2a/task_store.py +206 -0
- ksadk/a2a_card.py +101 -0
- ksadk/a2ui/__init__.py +27 -0
- ksadk/a2ui/core.py +186 -0
- ksadk/a2ui/models.py +166 -0
- ksadk/a2ui/renderer.py +198 -0
- ksadk/agui/__init__.py +9 -0
- ksadk/agui/a2ui_projection.py +92 -0
- ksadk/agui/agent.py +872 -0
- ksadk/agui/config.py +92 -0
- ksadk/agui/routes.py +47 -0
- ksadk/api/client.py +238 -204
- ksadk/api/environment.py +27 -0
- ksadk/builders/__init__.py +2 -0
- ksadk/builders/base.py +16 -14
- ksadk/builders/code_builder.py +375 -270
- ksadk/builders/container_builder.py +240 -200
- ksadk/builders/framework_requirements.py +31 -12
- ksadk/builders/ks3_uploader.py +60 -29
- ksadk/builders/managed_runtime_builder.py +173 -0
- ksadk/builders/mcp_builder.py +91 -92
- ksadk/builders/requirements_utils.py +1 -5
- ksadk/cli/__init__.py +97 -171
- ksadk/cli/cmd_a2a.py +255 -84
- ksadk/cli/cmd_agent.py +19 -5
- ksadk/cli/cmd_build.py +158 -29
- ksadk/cli/cmd_completion.py +47 -35
- ksadk/cli/cmd_config.py +267 -198
- ksadk/cli/cmd_create.py +507 -740
- ksadk/cli/cmd_dashboard.py +120 -45
- ksadk/cli/cmd_deploy.py +135 -59
- ksadk/cli/cmd_destroy.py +44 -14
- ksadk/cli/cmd_eval.py +386 -0
- ksadk/cli/cmd_files.py +63 -24
- ksadk/cli/cmd_hermes.py +313 -135
- ksadk/cli/cmd_invoke.py +184 -122
- ksadk/cli/cmd_launch.py +76 -28
- ksadk/cli/cmd_mcp.py +98 -64
- ksadk/cli/cmd_model.py +14 -5
- ksadk/cli/cmd_openclaw.py +564 -268
- ksadk/cli/cmd_replay.py +71 -0
- ksadk/cli/cmd_run.py +58 -73
- ksadk/cli/cmd_status.py +80 -31
- ksadk/cli/cmd_studio.py +110 -0
- ksadk/cli/cmd_version.py +20 -13
- ksadk/cli/cmd_web.py +95 -18
- ksadk/cli/deploy_utils.py +20 -20
- ksadk/cli/dry_run.py +7 -4
- ksadk/cli/env_options.py +83 -0
- ksadk/cli/error_utils.py +37 -12
- ksadk/cli/global_options.py +4 -3
- ksadk/cli/local_runtime.py +1 -2
- ksadk/cli/model_catalog.py +6 -2
- ksadk/cli/network_options.py +41 -19
- ksadk/cli/resource_common.py +6 -2
- ksadk/cli/runtime_bootstrap.py +51 -0
- ksadk/cli/storage.py +0 -1
- ksadk/cli/ui.py +11 -3
- ksadk/cli/workflow_common.py +52 -18
- ksadk/codex/__init__.py +12 -0
- ksadk/codex/client.py +1042 -0
- ksadk/codex/phase.py +143 -0
- ksadk/codex/runtime.py +940 -0
- ksadk/common/aicp_env.py +0 -1
- ksadk/common/auth.py +2 -2
- ksadk/common/constants.py +1 -3
- ksadk/common/kop_client.py +232 -0
- ksadk/common/llm_utils.py +17 -13
- ksadk/compat/__init__.py +5 -0
- ksadk/compat/adk_compat.py +200 -0
- ksadk/compat/copilotkit_a2ui.py +330 -0
- ksadk/configs/__init__.py +12 -14
- ksadk/configs/env_registry.py +661 -116
- ksadk/configs/global_config.py +3 -2
- ksadk/configs/settings.py +133 -209
- ksadk/conversations/__init__.py +85 -92
- ksadk/conversations/attachment_storage.py +16 -11
- ksadk/conversations/attachments.py +44 -36
- ksadk/conversations/compaction_pipeline.py +12 -12
- ksadk/conversations/compaction_prompt.py +9 -5
- ksadk/conversations/context.py +221 -6
- ksadk/conversations/message_projection.py +438 -51
- ksadk/conversations/model_context.py +12 -6
- ksadk/conversations/model_options.py +0 -1
- ksadk/conversations/normalize.py +20 -16
- ksadk/conversations/reasoning_markup.py +1 -1
- ksadk/conversations/runtime.py +339 -5255
- ksadk/conversations/runtime_compaction.py +333 -0
- ksadk/conversations/runtime_constants.py +27 -0
- ksadk/conversations/runtime_governance.py +185 -0
- ksadk/conversations/runtime_input.py +660 -0
- ksadk/conversations/runtime_invocation.py +395 -0
- ksadk/conversations/runtime_metadata.py +475 -0
- ksadk/conversations/runtime_observability.py +367 -0
- ksadk/conversations/runtime_payloads.py +272 -0
- ksadk/conversations/runtime_persistence.py +440 -0
- ksadk/conversations/runtime_preparation.py +426 -0
- ksadk/conversations/runtime_resume.py +836 -0
- ksadk/conversations/runtime_stream_events.py +902 -0
- ksadk/conversations/runtime_streaming.py +700 -0
- ksadk/conversations/semantic_summary.py +17 -5
- ksadk/conversations/session_title.py +6 -3
- ksadk/deployment/__init__.py +15 -16
- ksadk/deployment/agent_access.py +12 -23
- ksadk/deployment/base.py +51 -38
- ksadk/deployment/managed_runtime.py +33 -0
- ksadk/deployment/manager.py +85 -71
- ksadk/deployment/providers/serverless.py +379 -210
- ksadk/deployment/registry.py +38 -32
- ksadk/deployment/state.py +11 -11
- ksadk/deployment/ui_config.py +1 -1
- ksadk/detection/__init__.py +1 -1
- ksadk/detection/detector.py +146 -83
- ksadk/detection/mcp_detector.py +9 -6
- ksadk/evaluation/__init__.py +84 -0
- ksadk/evaluation/a2a_adapter.py +444 -0
- ksadk/evaluation/adapters.py +54 -0
- ksadk/evaluation/contracts.py +409 -0
- ksadk/evaluation/evalset.py +351 -0
- ksadk/evaluation/evaluators.py +461 -0
- ksadk/evaluation/executor.py +118 -0
- ksadk/evaluation/storage.py +68 -0
- ksadk/evaluation/target.py +73 -0
- ksadk/events/__init__.py +25 -0
- ksadk/events/parser.py +191 -0
- ksadk/events/replay.py +37 -0
- ksadk/events/runtime_event.py +273 -0
- ksadk/events/store.py +317 -0
- ksadk/harness/__init__.py +35 -0
- ksadk/harness/app.py +269 -0
- ksadk/harness/config.py +181 -0
- ksadk/harness/reasoner.py +105 -0
- ksadk/harness/runtime.py +364 -0
- ksadk/harness/sandbox.py +141 -0
- ksadk/harness/tools.py +222 -0
- ksadk/hermes_terminal.py +28 -12
- ksadk/identity/resolver.py +15 -9
- ksadk/ids.py +32 -0
- ksadk/knowledge_base/adk_tool.py +1 -1
- ksadk/knowledge_base/client.py +38 -33
- ksadk/managed_a2a_card.py +160 -0
- ksadk/managed_runtime.py +195 -0
- ksadk/markdown.py +5 -2
- ksadk/mcp_runtime/__init__.py +9 -6
- ksadk/memory/__init__.py +1 -1
- ksadk/memory/adk/__init__.py +2 -0
- ksadk/memory/adk/backends/base_ltm_backend.py +2 -6
- ksadk/memory/adk/backends/http_ltm_backend.py +13 -21
- ksadk/memory/adk/backends/inmemory_ltm_backend.py +7 -13
- ksadk/memory/adk/backends/sdk_ltm_backend.py +36 -36
- ksadk/memory/adk/long_term_memory.py +34 -37
- ksadk/memory/adk/resilient_session_service.py +4 -5
- ksadk/memory/adk/short_term_memory.py +12 -21
- ksadk/memory/adk_tool.py +3 -2
- ksadk/memory/backends/base.py +19 -19
- ksadk/memory/backends/memory.py +24 -25
- ksadk/memory/backends/redis.py +31 -30
- ksadk/memory/langchain_tool.py +2 -1
- ksadk/memory/manager.py +52 -47
- ksadk/memory/service.py +16 -6
- ksadk/memory/tool.py +4 -0
- ksadk/model_policy.py +15 -7
- ksadk/model_proxy/__init__.py +51 -0
- ksadk/model_proxy/bootstrap.py +80 -0
- ksadk/model_proxy/cache.py +165 -0
- ksadk/model_proxy/config.py +66 -0
- ksadk/model_proxy/demo_webui.py +115 -0
- ksadk/model_proxy/detect.py +145 -0
- ksadk/model_proxy/gate.py +68 -0
- ksadk/model_proxy/namespace.py +201 -0
- ksadk/model_proxy/protocol_proxy.py +22 -0
- ksadk/model_proxy/server.py +443 -0
- ksadk/model_proxy/transform.py +735 -0
- ksadk/openclaw_gateway.py +29 -14
- ksadk/runners/adk_runner.py +354 -146
- ksadk/runners/base_runner.py +71 -29
- ksadk/runners/deepagents_runner.py +0 -1
- ksadk/runners/factory.py +18 -5
- ksadk/runners/langchain_runner.py +29 -742
- ksadk/runners/langgraph_runner.py +417 -97
- ksadk/runners/patch_langchain.py +16 -16
- ksadk/runners/remote_runner.py +134 -33
- ksadk/runners/usage_accumulator.py +1 -0
- ksadk/runners/utils/__init__.py +0 -10
- ksadk/runners/utils/loader.py +23 -7
- ksadk/runtime/__init__.py +67 -0
- ksadk/runtime/adapter.py +412 -0
- ksadk/runtime/conversation_execution.py +553 -0
- ksadk/runtime/executor.py +251 -0
- ksadk/runtime/factory.py +156 -0
- ksadk/runtime/framework_adapters.py +118 -0
- ksadk/runtime/launch.py +48 -0
- ksadk/runtime/preprocessing.py +131 -0
- ksadk/runtime/runner_adapter.py +1032 -0
- ksadk/runtime/runner_loading.py +36 -0
- ksadk/runtime_context.py +18 -3
- ksadk/runtime_state.py +0 -1
- ksadk/sandbox/__init__.py +4 -1
- ksadk/sandbox/backends/__init__.py +4 -1
- ksadk/sandbox/backends/e2b.py +13 -5
- ksadk/sandbox/backends/local_process.py +11 -3
- ksadk/sandbox/base.py +10 -15
- ksadk/sandbox/factory.py +14 -4
- ksadk/sandbox/registry.py +57 -6
- ksadk/server/__init__.py +39 -4
- ksadk/server/api_models.py +15 -5
- ksadk/server/app.py +24 -3928
- ksadk/server/composition.py +47 -0
- ksadk/server/factory.py +622 -0
- ksadk/server/routes/__init__.py +1 -0
- ksadk/server/routes/checkpoint_resolution.py +116 -0
- ksadk/server/routes/common.py +682 -0
- ksadk/server/routes/control.py +331 -0
- ksadk/server/routes/dependencies.py +98 -0
- ksadk/server/routes/misc.py +425 -0
- ksadk/server/routes/models.py +451 -0
- ksadk/server/routes/openai_compat.py +229 -0
- ksadk/server/routes/projection.py +848 -0
- ksadk/server/routes/routers.py +52 -0
- ksadk/server/routes/run.py +519 -0
- ksadk/server/routes/sessions.py +644 -0
- ksadk/server/routes/streaming.py +265 -0
- ksadk/server/routes/workspace.py +414 -0
- ksadk/server/static/assets/{ArtifactsPanel-D-SSn2ee.js → ArtifactsPanel-CakCqxEN.js} +1 -1
- ksadk/server/static/assets/CodeBlock-CynLknyO.js +9 -0
- ksadk/server/static/assets/MathMessageMarkdown-3sQdOysS.js +8 -0
- ksadk/server/static/assets/MermaidBlock-NERD_ef7.js +303 -0
- ksadk/server/static/assets/NativeTerminalPanel-CiHWf82q.js +1 -0
- ksadk/server/static/assets/{arc-BA13sHc9.js → arc-DrgjcKhl.js} +1 -1
- ksadk/server/static/assets/architecture-7EHR7CIX-CpZLRCcY.js +1 -0
- ksadk/server/static/assets/{architectureDiagram-3BPJPVTR-DzJzgVoL.js → architectureDiagram-3BPJPVTR-BXoVRbQ6.js} +1 -1
- ksadk/server/static/assets/{blockDiagram-GPEHLZMM-UTdVcZhn.js → blockDiagram-GPEHLZMM-BnaB3Ywv.js} +1 -1
- ksadk/server/static/assets/{c4Diagram-AAUBKEIU-Dix0GD4m.js → c4Diagram-AAUBKEIU-Dw4weZcp.js} +1 -1
- ksadk/server/static/assets/channel-Dt3rQTFI.js +1 -0
- ksadk/server/static/assets/{chunk-2J33WTMH-C2JxuZ42.js → chunk-2J33WTMH-ChjpLK7j.js} +1 -1
- ksadk/server/static/assets/{chunk-4BX2VUAB-Be57QPgD.js → chunk-4BX2VUAB-B9drTgOW.js} +1 -1
- ksadk/server/static/assets/{chunk-55IACEB6-WjSuy4nv.js → chunk-55IACEB6-CK4ROATy.js} +1 -1
- ksadk/server/static/assets/{chunk-727SXJPM-BOovP-b5.js → chunk-727SXJPM-B9KtTTgw.js} +1 -1
- ksadk/server/static/assets/{chunk-AQP2D5EJ-DOmZNmWj.js → chunk-AQP2D5EJ-1O1mki3m.js} +1 -1
- ksadk/server/static/assets/{chunk-FMBD7UC4-DzwlodkU.js → chunk-FMBD7UC4-B_fH2YuH.js} +1 -1
- ksadk/server/static/assets/{chunk-ND2GUHAM-DMqAikEU.js → chunk-ND2GUHAM-D6rFLaVV.js} +1 -1
- ksadk/server/static/assets/chunk-QZHKN3VN-iXEZtKQc.js +1 -0
- ksadk/server/static/assets/classDiagram-4FO5ZUOK-DIveV17Q.js +1 -0
- ksadk/server/static/assets/classDiagram-v2-Q7XG4LA2-DIveV17Q.js +1 -0
- ksadk/server/static/assets/{cose-bilkent-S5V4N54A-Zhy2GBnP.js → cose-bilkent-S5V4N54A-ChNs_Mdk.js} +1 -1
- ksadk/server/static/assets/{dagre-BM42HDAG-CbKrtIUz.js → dagre-BM42HDAG-D0QXg_MQ.js} +1 -1
- ksadk/server/static/assets/{diagram-2AECGRRQ-BRApgQRK.js → diagram-2AECGRRQ-DBDDKwBQ.js} +1 -1
- ksadk/server/static/assets/{diagram-5GNKFQAL-D0xbnDiK.js → diagram-5GNKFQAL-BkwDOxmO.js} +1 -1
- ksadk/server/static/assets/{diagram-KO2AKTUF-CVugVI9L.js → diagram-KO2AKTUF-Bv8waYvY.js} +1 -1
- ksadk/server/static/assets/{diagram-LMA3HP47-DozUGgee.js → diagram-LMA3HP47-e1VECDdu.js} +1 -1
- ksadk/server/static/assets/{diagram-OG6HWLK6-ZOYsKlru.js → diagram-OG6HWLK6-Ds9adfRl.js} +1 -1
- ksadk/server/static/assets/{dist-DpKtt4Bo.js → dist-4N2NMVYg.js} +1 -1
- ksadk/server/static/assets/{dist-CkEKJFtk.js → dist-B-jNR6Vn.js} +1 -1
- ksadk/server/static/assets/{dist-D57wnGWd.js → dist-B5J2uhNk.js} +1 -1
- ksadk/server/static/assets/{dist-8_SfK1IP.js → dist-B5oS1zcj.js} +1 -1
- ksadk/server/static/assets/{dist-DMezvBGJ.js → dist-BB3-OwTQ.js} +1 -1
- ksadk/server/static/assets/{dist-2hInLS_J.js → dist-BIlKoW0k.js} +1 -1
- ksadk/server/static/assets/{dist-BrCcQ47T.js → dist-BjOdlDjj.js} +1 -1
- ksadk/server/static/assets/{dist-BmlMPsCc.js → dist-C1sz5Eo3.js} +1 -1
- ksadk/server/static/assets/{dist-B0NP_Z0z.js → dist-CWV4lDr1.js} +1 -1
- ksadk/server/static/assets/{dist-D-xOD048.js → dist-CmZHzlwZ.js} +1 -1
- ksadk/server/static/assets/{dist-DL_NKc_z.js → dist-D6MpCZtz.js} +1 -1
- ksadk/server/static/assets/{dist-DyOkZmze.js → dist-DJN_6Y39.js} +1 -1
- ksadk/server/static/assets/{dist-DmFaq_Iy.js → dist-DQU9EWw-.js} +1 -1
- ksadk/server/static/assets/{dist-gX6GOLKq.js → dist-DWKByxWV.js} +1 -1
- ksadk/server/static/assets/{dist-DyWsb78Q.js → dist-Dli7qW-B.js} +1 -1
- ksadk/server/static/assets/{dist-BIJVDMuB.js → dist-DsHPdk3W.js} +1 -1
- ksadk/server/static/assets/{dist-Dp0k7bWI.js → dist-X4TnqwOK.js} +1 -1
- ksadk/server/static/assets/{dist-8EEyGgDx.js → dist-_pHPTyZ-.js} +1 -1
- ksadk/server/static/assets/{dist-CPBtqRTW.js → dist-fhOuWds5.js} +1 -1
- ksadk/server/static/assets/{dist-D-JMdWPQ.js → dist-gLnrGsoU.js} +1 -1
- ksadk/server/static/assets/{dist-BssVmjIo.js → dist-j6Dxmf_j.js} +1 -1
- ksadk/server/static/assets/{dist-C3HIIaN5.js → dist-o2OVmKvt.js} +1 -1
- ksadk/server/static/assets/{erDiagram-TEJ5UH35-Bk-9bgE5.js → erDiagram-TEJ5UH35-BPItFKH6.js} +1 -1
- ksadk/server/static/assets/eventmodeling-FCH6USID-DYFSxbqr.js +1 -0
- ksadk/server/static/assets/{flowDiagram-I6XJVG4X-Dn9kZVuZ.js → flowDiagram-I6XJVG4X-BbYB9w5Y.js} +1 -1
- ksadk/server/static/assets/{ganttDiagram-6RSMTGT7-BGxXlJqm.js → ganttDiagram-6RSMTGT7-TQXa0KXv.js} +1 -1
- ksadk/server/static/assets/gitGraph-WXDBUCRP-DyNYp6BN.js +1 -0
- ksadk/server/static/assets/{gitGraphDiagram-PVQCEYII-C7Q0X-wi.js → gitGraphDiagram-PVQCEYII-bKblCnpa.js} +1 -1
- ksadk/server/static/assets/index-R52pJJvg.js +177 -0
- ksadk/server/static/assets/index-jJr3_955.css +2 -0
- ksadk/server/static/assets/info-J43DQDTF-WUx7qTde.js +1 -0
- ksadk/server/static/assets/{infoDiagram-5YYISTIA-BO_CSqq5.js → infoDiagram-5YYISTIA-BGVT7J_i.js} +1 -1
- ksadk/server/static/assets/{ishikawaDiagram-YF4QCWOH-eYLPLd46.js → ishikawaDiagram-YF4QCWOH-K0OOfVna.js} +1 -1
- ksadk/server/static/assets/{journeyDiagram-JHISSGLW-De9geSb0.js → journeyDiagram-JHISSGLW-8LeOJaZp.js} +1 -1
- ksadk/server/static/assets/{kanban-definition-UN3LZRKU-Cs80kQto.js → kanban-definition-UN3LZRKU-C6uCgZrW.js} +1 -1
- ksadk/server/static/assets/{katex-DSrCFD8n.js → katex-CYWseY5E.js} +1 -1
- ksadk/server/static/assets/{linear-CN9sbKTF.js → linear-hdBcYzM8.js} +1 -1
- ksadk/server/static/assets/{mermaid-parser.core-DlgSBU8l.js → mermaid-parser.core-BWrDjSZM.js} +2 -2
- ksadk/server/static/assets/{mindmap-definition-RKZ34NQL-9afz7Oug.js → mindmap-definition-RKZ34NQL-Bjy_2v4_.js} +1 -1
- ksadk/server/static/assets/packet-YPE3B663-BN13y_xl.js +1 -0
- ksadk/server/static/assets/pie-LRSECV5Y-ftSLXhhc.js +1 -0
- ksadk/server/static/assets/{pieDiagram-4H26LBE5-DPv_VstN.js → pieDiagram-4H26LBE5-GmmqNiVH.js} +1 -1
- ksadk/server/static/assets/{quadrantDiagram-W4KKPZXB-o77wZ1XK.js → quadrantDiagram-W4KKPZXB-BmkRbwCg.js} +1 -1
- ksadk/server/static/assets/radar-GUYGQ44K-jaICkIeO.js +1 -0
- ksadk/server/static/assets/{requirementDiagram-4Y6WPE33-BYVw81VC.js → requirementDiagram-4Y6WPE33-DSWFqL7c.js} +1 -1
- ksadk/server/static/assets/{sankeyDiagram-5OEKKPKP-B7nZFMKT.js → sankeyDiagram-5OEKKPKP-l6iXmU65.js} +1 -1
- ksadk/server/static/assets/{sequenceDiagram-3UESZ5HK-BGRRrFw5.js → sequenceDiagram-3UESZ5HK-Cq6UBeQB.js} +1 -1
- ksadk/server/static/assets/{stateDiagram-AJRCARHV-BUfHCoPs.js → stateDiagram-AJRCARHV-qzTQpg3Y.js} +1 -1
- ksadk/server/static/assets/stateDiagram-v2-BHNVJYJU-BYCoYGAN.js +1 -0
- ksadk/server/static/assets/{timeline-definition-PNZ67QCA-FbCTGrf9.js → timeline-definition-PNZ67QCA-DEz24vV0.js} +1 -1
- ksadk/server/static/assets/treeView-BLDUP644-Cpib_vlz.js +1 -0
- ksadk/server/static/assets/treemap-LRROVOQU-DQxfmVHK.js +1 -0
- ksadk/server/static/assets/{vennDiagram-CIIHVFJN-DWgwtPsJ.js → vennDiagram-CIIHVFJN-CMCixki2.js} +1 -1
- ksadk/server/static/assets/wardley-L42UT6IY-BQYHnnkU.js +1 -0
- ksadk/server/static/assets/{wardleyDiagram-YWT4CUSO-2x8G-tTM.js → wardleyDiagram-YWT4CUSO-CVzB8F9K.js} +1 -1
- ksadk/server/static/assets/{xychartDiagram-2RQKCTM6-Drma3AYl.js → xychartDiagram-2RQKCTM6-BFBqBLc1.js} +1 -1
- ksadk/server/static/index.html +2 -2
- ksadk/server/terminal_sessions.py +111 -58
- ksadk/sessions/__init__.py +69 -19
- ksadk/sessions/base.py +31 -11
- ksadk/sessions/continuity.py +2 -3
- ksadk/sessions/in_memory.py +46 -2
- ksadk/sessions/local_service.py +148 -17
- ksadk/sessions/postgres_service.py +143 -25
- ksadk/sessions/resilient.py +36 -8
- ksadk/skills/models.py +17 -5
- ksadk/skills/package_store.py +5 -2
- ksadk/skills/runtime/agent.py +20 -5
- ksadk/skills/runtime/artifacts.py +1 -5
- ksadk/skills/runtime/backends/e2b.py +10 -4
- ksadk/skills/runtime/backends/local.py +15 -3
- ksadk/skills/runtime/base.py +1 -2
- ksadk/skills/runtime/executor.py +10 -3
- ksadk/skills/runtime/factory.py +4 -2
- ksadk/skills/runtime/loader.py +1 -2
- ksadk/skills/runtime/registry.py +15 -10
- ksadk/skills/runtime/request.py +3 -1
- ksadk/skills/service_client.py +47 -16
- ksadk/skills/tool_defs.py +15 -10
- ksadk/studio/__init__.py +5 -0
- ksadk/studio/agent_avatar_assets.py +120 -0
- ksadk/studio/agent_lifecycle.py +51 -0
- ksadk/studio/api.py +1046 -0
- ksadk/studio/api_catalog_routes.py +324 -0
- ksadk/studio/api_contracts.py +177 -0
- ksadk/studio/api_helpers.py +132 -0
- ksadk/studio/authoring.py +524 -0
- ksadk/studio/authoring_coordinator.py +285 -0
- ksadk/studio/builder.py +320 -0
- ksadk/studio/capabilities.py +351 -0
- ksadk/studio/cloud.py +278 -0
- ksadk/studio/codex_agent_service.py +583 -0
- ksadk/studio/codex_builder.py +324 -0
- ksadk/studio/codex_manifest.py +278 -0
- ksadk/studio/codex_run.py +352 -0
- ksadk/studio/compiler.py +189 -0
- ksadk/studio/contracts.py +644 -0
- ksadk/studio/errors.py +47 -0
- ksadk/studio/evaluation.py +192 -0
- ksadk/studio/event_store.py +284 -0
- ksadk/studio/framework_run.py +114 -0
- ksadk/studio/identifiers.py +33 -0
- ksadk/studio/mcp_runtime.py +229 -0
- ksadk/studio/model_client.py +543 -0
- ksadk/studio/model_profile_service.py +214 -0
- ksadk/studio/operations.py +243 -0
- ksadk/studio/otel_trace.py +754 -0
- ksadk/studio/pagination.py +182 -0
- ksadk/studio/python_tool_inspection.py +183 -0
- ksadk/studio/repository.py +306 -0
- ksadk/studio/resource_catalog.py +1217 -0
- ksadk/studio/run_service.py +707 -0
- ksadk/studio/runtime_catalog.py +74 -0
- ksadk/studio/runtime_source.py +339 -0
- ksadk/studio/service.py +1141 -0
- ksadk/studio/shared_web.py +994 -0
- ksadk/studio/skill_discovery.py +628 -0
- ksadk/studio/static/assets/PrismRenderer-IYN-ffww.js +3 -0
- ksadk/studio/static/assets/index-CaEN0eTR.css +1 -0
- ksadk/studio/static/assets/index-DI2eY_NH.js +252 -0
- ksadk/studio/static/assets/react-vendor-BNmTiJ-I.js +9 -0
- ksadk/studio/static/assets/rolldown-runtime-hePW80VL.js +1 -0
- ksadk/studio/static/index.html +15 -0
- ksadk/studio/templates.py +630 -0
- ksadk/studio/validator.py +246 -0
- ksadk/studio/workspace.py +137 -0
- ksadk/terminal_exec_policy.py +3 -4
- ksadk/tools/gateway.py +101 -15
- ksadk/tools/result_budget.py +12 -4
- ksadk/toolsets/__init__.py +161 -37
- ksadk/toolsets/a2a.py +426 -0
- ksadk/toolsets/platform.py +21 -5
- ksadk/toolsets/sandbox.py +82 -16
- ksadk/toolsets/skills.py +200 -39
- ksadk/toolsets/web.py +123 -26
- ksadk/toolsets/workspace.py +212 -101
- ksadk/tracing/__init__.py +19 -21
- ksadk/tracing/exporters/inmemory_exporter.py +62 -51
- ksadk/tracing/setup.py +135 -506
- ksadk/tracing/span_utils.py +0 -41
- ksadk/tui/loop.py +78 -30
- ksadk/tui/stream_render.py +1 -0
- ksadk/ui_config.py +5 -3
- ksadk/version.py +1 -1
- ksadk_runtime_common/memory_backend/registry.py +56 -56
- ksadk_runtime_common/schemas/runtime_event_v1.json +95 -0
- ksadk_runtime_common/workspace_files/router.py +8 -2
- agentengine_sdk_python-0.7.0.dist-info/RECORD +0 -482
- ksadk/a2a/card_builder.py +0 -64
- ksadk/a2a/client.py +0 -309
- ksadk/runners/utils/langfuse.py +0 -230
- ksadk/server/static/assets/CodeBlock-P16VOLYi.js +0 -9
- ksadk/server/static/assets/MathMessageMarkdown-CdGiQWHR.js +0 -8
- ksadk/server/static/assets/MermaidBlock-IOcal8cm.js +0 -303
- ksadk/server/static/assets/NativeTerminalPanel-DGSDWsei.js +0 -1
- ksadk/server/static/assets/architecture-7EHR7CIX-BvUlsA6l.js +0 -1
- ksadk/server/static/assets/channel-CTuydARX.js +0 -1
- ksadk/server/static/assets/chunk-QZHKN3VN-BnCydivS.js +0 -1
- ksadk/server/static/assets/classDiagram-4FO5ZUOK-BNHg45Be.js +0 -1
- ksadk/server/static/assets/classDiagram-v2-Q7XG4LA2-BNHg45Be.js +0 -1
- ksadk/server/static/assets/eventmodeling-FCH6USID-DsAgWnlf.js +0 -1
- ksadk/server/static/assets/gitGraph-WXDBUCRP-BIao9Yjg.js +0 -1
- ksadk/server/static/assets/index-C00Lwg3L.js +0 -165
- ksadk/server/static/assets/index-DAURbCsP.css +0 -1
- ksadk/server/static/assets/info-J43DQDTF-CyipqGxU.js +0 -1
- ksadk/server/static/assets/packet-YPE3B663-CGkyRxlg.js +0 -1
- ksadk/server/static/assets/pie-LRSECV5Y-M0uWAf4n.js +0 -1
- ksadk/server/static/assets/radar-GUYGQ44K-Bdbm24-x.js +0 -1
- ksadk/server/static/assets/stateDiagram-v2-BHNVJYJU-8xBN_gLM.js +0 -1
- ksadk/server/static/assets/treeView-BLDUP644-npMo0ak1.js +0 -1
- ksadk/server/static/assets/treemap-LRROVOQU-CHdzrrdo.js +0 -1
- ksadk/server/static/assets/wardley-L42UT6IY-BEQz7wyy.js +0 -1
- ksadk/tracing/exporters/langfuse_exporter.py +0 -445
- {agentengine_sdk_python-0.7.0.dist-info → agentengine_sdk_python-0.8.1.dist-info}/entry_points.txt +0 -0
- {agentengine_sdk_python-0.7.0.dist-info → agentengine_sdk_python-0.8.1.dist-info}/licenses/LICENSE +0 -0
- {agentengine_sdk_python-0.7.0.dist-info → agentengine_sdk_python-0.8.1.dist-info}/top_level.txt +0 -0
ksadk/toolsets/__init__.py
CHANGED
|
@@ -3,34 +3,44 @@ from __future__ import annotations
|
|
|
3
3
|
import json
|
|
4
4
|
import os
|
|
5
5
|
import re
|
|
6
|
-
from collections.abc import Iterable
|
|
7
|
-
from collections.abc import Mapping
|
|
6
|
+
from collections.abc import Callable, Iterable, Mapping
|
|
8
7
|
from typing import Any
|
|
9
8
|
|
|
10
|
-
from ksadk.
|
|
11
|
-
from ksadk.toolsets.
|
|
12
|
-
from ksadk.toolsets.
|
|
9
|
+
from ksadk.tools.gateway import ToolPolicy, tool_policy_requires_approval
|
|
10
|
+
from ksadk.toolsets._langchain import as_tool
|
|
11
|
+
from ksadk.toolsets.a2a import (
|
|
12
|
+
_A2A_TOOL_POLICIES,
|
|
13
|
+
_a2a_space_id,
|
|
14
|
+
call_a2a_agent,
|
|
15
|
+
get_a2a_agent_card,
|
|
16
|
+
get_a2a_tools,
|
|
17
|
+
list_a2a_agents,
|
|
18
|
+
)
|
|
19
|
+
from ksadk.toolsets.platform import component_status, get_platform_tools
|
|
13
20
|
from ksadk.toolsets.sandbox import (
|
|
14
21
|
_SANDBOX_TOOL_POLICIES,
|
|
22
|
+
get_sandbox_tools,
|
|
15
23
|
run_code,
|
|
16
24
|
run_command,
|
|
17
25
|
sandbox_backend_name,
|
|
18
26
|
sandbox_status,
|
|
19
27
|
)
|
|
20
|
-
from ksadk.toolsets.skills import get_skill_tools
|
|
21
28
|
from ksadk.toolsets.skills import (
|
|
22
29
|
_SKILL_TOOL_POLICIES,
|
|
23
30
|
_skill_execution_backend,
|
|
24
31
|
execute_skills,
|
|
32
|
+
get_skill_tools,
|
|
33
|
+
list_skill_spaces,
|
|
25
34
|
list_skills,
|
|
26
35
|
load_skill,
|
|
27
36
|
search_skills,
|
|
28
37
|
)
|
|
29
|
-
from ksadk.toolsets.
|
|
38
|
+
from ksadk.toolsets.web import _WEB_TOOL_POLICIES, get_web_tools, web_fetch, web_search
|
|
30
39
|
from ksadk.toolsets.workspace import (
|
|
31
40
|
_WORKSPACE_TOOL_POLICIES,
|
|
32
41
|
delete_workspace_file,
|
|
33
42
|
edit_workspace_file,
|
|
43
|
+
get_workspace_tools,
|
|
34
44
|
lint_workspace_file,
|
|
35
45
|
list_workspace_files,
|
|
36
46
|
multi_edit_workspace_file,
|
|
@@ -40,12 +50,8 @@ from ksadk.toolsets.workspace import (
|
|
|
40
50
|
write_workspace_file,
|
|
41
51
|
write_workspace_files,
|
|
42
52
|
)
|
|
43
|
-
from ksadk.toolsets.web import get_web_tools
|
|
44
|
-
from ksadk.toolsets.web import web_fetch, web_search, _WEB_TOOL_POLICIES
|
|
45
|
-
from ksadk.tools.gateway import ToolPolicy, tool_policy_requires_approval
|
|
46
|
-
from ksadk.toolsets._langchain import as_tool
|
|
47
53
|
|
|
48
|
-
_DEFAULT_GROUPS = ("skill", "workspace", "platform", "sandbox", "web")
|
|
54
|
+
_DEFAULT_GROUPS = ("skill", "workspace", "platform", "sandbox", "web", "a2a")
|
|
49
55
|
_DISPATCHER_TOOL_NAME = "tool_dispatcher"
|
|
50
56
|
_LEGACY_DISPATCHER_TOOL_NAME = "agentengine_tool_dispatcher"
|
|
51
57
|
_TOOL_SEARCH_NAME = "tool_search"
|
|
@@ -77,11 +83,15 @@ _TOOLSET_FACTORIES = {
|
|
|
77
83
|
"platform": get_platform_tools,
|
|
78
84
|
"sandbox": get_sandbox_tools,
|
|
79
85
|
"web": get_web_tools,
|
|
86
|
+
"a2a": get_a2a_tools,
|
|
80
87
|
}
|
|
81
88
|
|
|
82
|
-
_TOOLSET_DESCRIPTORS
|
|
89
|
+
_TOOLSET_DESCRIPTORS: dict[
|
|
90
|
+
str, tuple[tuple[Callable[..., Any], ToolPolicy, dict[str, Any]], ...]
|
|
91
|
+
] = {
|
|
83
92
|
"skill": (
|
|
84
93
|
(list_skills, _SKILL_TOOL_POLICIES["list_skills"], {}),
|
|
94
|
+
(list_skill_spaces, _SKILL_TOOL_POLICIES["list_skill_spaces"], {}),
|
|
85
95
|
(search_skills, _SKILL_TOOL_POLICIES["search_skills"], {}),
|
|
86
96
|
(load_skill, _SKILL_TOOL_POLICIES["load_skill"], {}),
|
|
87
97
|
(
|
|
@@ -95,20 +105,58 @@ _TOOLSET_DESCRIPTORS = {
|
|
|
95
105
|
),
|
|
96
106
|
),
|
|
97
107
|
"workspace": (
|
|
98
|
-
(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
(
|
|
109
|
+
workspace_status,
|
|
110
|
+
_WORKSPACE_TOOL_POLICIES["workspace_status"],
|
|
111
|
+
{"boundary": "workspace_root"},
|
|
112
|
+
),
|
|
113
|
+
(
|
|
114
|
+
list_workspace_files,
|
|
115
|
+
_WORKSPACE_TOOL_POLICIES["list_workspace_files"],
|
|
116
|
+
{"boundary": "workspace_root"},
|
|
117
|
+
),
|
|
118
|
+
(
|
|
119
|
+
read_workspace_file,
|
|
120
|
+
_WORKSPACE_TOOL_POLICIES["read_workspace_file"],
|
|
121
|
+
{"boundary": "workspace_root"},
|
|
122
|
+
),
|
|
123
|
+
(
|
|
124
|
+
write_workspace_file,
|
|
125
|
+
_WORKSPACE_TOOL_POLICIES["write_workspace_file"],
|
|
126
|
+
{"boundary": "workspace_root"},
|
|
127
|
+
),
|
|
128
|
+
(
|
|
129
|
+
write_workspace_files,
|
|
130
|
+
_WORKSPACE_TOOL_POLICIES["write_workspace_files"],
|
|
131
|
+
{"boundary": "workspace_root"},
|
|
132
|
+
),
|
|
133
|
+
(
|
|
134
|
+
edit_workspace_file,
|
|
135
|
+
_WORKSPACE_TOOL_POLICIES["edit_workspace_file"],
|
|
136
|
+
{"boundary": "workspace_root"},
|
|
137
|
+
),
|
|
138
|
+
(
|
|
139
|
+
multi_edit_workspace_file,
|
|
140
|
+
_WORKSPACE_TOOL_POLICIES["multi_edit_workspace_file"],
|
|
141
|
+
{"boundary": "workspace_root"},
|
|
142
|
+
),
|
|
143
|
+
(
|
|
144
|
+
lint_workspace_file,
|
|
145
|
+
_WORKSPACE_TOOL_POLICIES["lint_workspace_file"],
|
|
146
|
+
{"boundary": "workspace_root"},
|
|
147
|
+
),
|
|
148
|
+
(
|
|
149
|
+
search_workspace_files,
|
|
150
|
+
_WORKSPACE_TOOL_POLICIES["search_workspace_files"],
|
|
151
|
+
{"boundary": "workspace_root"},
|
|
152
|
+
),
|
|
153
|
+
(
|
|
154
|
+
delete_workspace_file,
|
|
155
|
+
_WORKSPACE_TOOL_POLICIES["delete_workspace_file"],
|
|
156
|
+
{"boundary": "workspace_root"},
|
|
157
|
+
),
|
|
111
158
|
),
|
|
159
|
+
"platform": ((component_status, ToolPolicy(risk_level="low"), {}),),
|
|
112
160
|
"sandbox": (
|
|
113
161
|
(
|
|
114
162
|
sandbox_status,
|
|
@@ -142,6 +190,23 @@ _TOOLSET_DESCRIPTORS = {
|
|
|
142
190
|
(web_fetch, _WEB_TOOL_POLICIES["web_fetch"], {"boundary": "public_http"}),
|
|
143
191
|
(web_search, _WEB_TOOL_POLICIES["web_search"], {"boundary": "search_provider"}),
|
|
144
192
|
),
|
|
193
|
+
"a2a": (
|
|
194
|
+
(
|
|
195
|
+
list_a2a_agents,
|
|
196
|
+
_A2A_TOOL_POLICIES["list_a2a_agents"],
|
|
197
|
+
{"enabled": lambda: bool(_a2a_space_id()), "boundary": "a2a_discovery"},
|
|
198
|
+
),
|
|
199
|
+
(
|
|
200
|
+
get_a2a_agent_card,
|
|
201
|
+
_A2A_TOOL_POLICIES["get_a2a_agent_card"],
|
|
202
|
+
{"enabled": lambda: bool(_a2a_space_id()), "boundary": "a2a_discovery"},
|
|
203
|
+
),
|
|
204
|
+
(
|
|
205
|
+
call_a2a_agent,
|
|
206
|
+
_A2A_TOOL_POLICIES["call_a2a_agent"],
|
|
207
|
+
{"enabled": lambda: bool(_a2a_space_id()), "boundary": "a2a_data_plane"},
|
|
208
|
+
),
|
|
209
|
+
),
|
|
145
210
|
}
|
|
146
211
|
|
|
147
212
|
|
|
@@ -218,9 +283,38 @@ def tool_dispatcher(
|
|
|
218
283
|
include: str | Iterable[str] | None = None,
|
|
219
284
|
profile: str = "default",
|
|
220
285
|
) -> dict[str, Any]:
|
|
221
|
-
"""List, describe, or call ksadk built-in tools through one governed entrypoint.
|
|
286
|
+
"""List, describe, or call ksadk built-in tools through one governed entrypoint.
|
|
287
|
+
|
|
288
|
+
Args:
|
|
289
|
+
action: One of "list" (list available tools), "describe" (get a tool's
|
|
290
|
+
spec), or "call" (execute a tool). Common synonyms "call_tool",
|
|
291
|
+
"execute", "run" are auto-mapped to "call"; "get" to "describe".
|
|
292
|
+
tool_name: Required for "describe" and "call"; ignored for "list".
|
|
293
|
+
arguments: Tool arguments (dict or JSON string); used with "call".
|
|
294
|
+
include: Comma-separated tool groups to scope (e.g. "skill,sandbox").
|
|
295
|
+
profile: Tool profile name (default: "default").
|
|
296
|
+
"""
|
|
222
297
|
|
|
223
298
|
normalized_action = str(action or "").strip().lower()
|
|
299
|
+
# 兼容 LLM 常见同义词,避免 "call_tool"/"execute"/"run" 等导致 unknown_action。
|
|
300
|
+
_ACTION_SYNONYMS = {
|
|
301
|
+
"call_tool": "call",
|
|
302
|
+
"execute": "call",
|
|
303
|
+
"run": "call",
|
|
304
|
+
"invoke": "call",
|
|
305
|
+
"get": "describe",
|
|
306
|
+
"info": "describe",
|
|
307
|
+
"ls": "list",
|
|
308
|
+
"search": "list",
|
|
309
|
+
}
|
|
310
|
+
normalized_action = _ACTION_SYNONYMS.get(normalized_action, normalized_action)
|
|
311
|
+
# LLM 常把 tool_name 塞进 action(如 "list_skills"/"search_skills"/"run_command")。
|
|
312
|
+
# 如果 action 不是合法值,无论 tool_name 是否有值,都自动当成 "call":
|
|
313
|
+
# 有 tool_name → 直接 call; 无 tool_name → 把 action 值当 tool_name 再 call。
|
|
314
|
+
if normalized_action not in ("list", "describe", "call"):
|
|
315
|
+
if not tool_name:
|
|
316
|
+
tool_name = normalized_action
|
|
317
|
+
normalized_action = "call"
|
|
224
318
|
requested_include = _normalize_include(include)
|
|
225
319
|
|
|
226
320
|
if normalized_action == "list":
|
|
@@ -231,17 +325,25 @@ def tool_dispatcher(
|
|
|
231
325
|
include_dispatcher=False,
|
|
232
326
|
)
|
|
233
327
|
except ValueError:
|
|
234
|
-
return _unknown_tool_error(
|
|
328
|
+
return _unknown_tool_error(
|
|
329
|
+
", ".join(requested_include) if requested_include else str(include or "")
|
|
330
|
+
)
|
|
235
331
|
return {"ok": True, "tools": specs, "tool_count": len(specs)}
|
|
236
332
|
|
|
237
333
|
if normalized_action == "describe":
|
|
238
334
|
target_name = _normalize_tool_name(tool_name)
|
|
239
335
|
if not target_name:
|
|
240
|
-
return {
|
|
336
|
+
return {
|
|
337
|
+
"ok": False,
|
|
338
|
+
"error_type": "missing_tool_name",
|
|
339
|
+
"error_message": "tool_name is required",
|
|
340
|
+
}
|
|
241
341
|
if target_name in {_DISPATCHER_TOOL_NAME, _LEGACY_DISPATCHER_TOOL_NAME}:
|
|
242
342
|
return _dispatcher_self_call_error()
|
|
243
343
|
try:
|
|
244
|
-
_, specs = _select_agentengine_tools(
|
|
344
|
+
_, specs = _select_agentengine_tools(
|
|
345
|
+
include=[target_name], profile=profile, include_dispatcher=False
|
|
346
|
+
)
|
|
245
347
|
except ValueError:
|
|
246
348
|
return _unknown_tool_error(target_name)
|
|
247
349
|
return {"ok": True, "tool": specs[0]}
|
|
@@ -249,15 +351,26 @@ def tool_dispatcher(
|
|
|
249
351
|
if normalized_action == "call":
|
|
250
352
|
target_name = _normalize_tool_name(tool_name)
|
|
251
353
|
if not target_name:
|
|
252
|
-
return {
|
|
354
|
+
return {
|
|
355
|
+
"ok": False,
|
|
356
|
+
"error_type": "missing_tool_name",
|
|
357
|
+
"error_message": "tool_name is required",
|
|
358
|
+
}
|
|
253
359
|
if target_name in {_DISPATCHER_TOOL_NAME, _LEGACY_DISPATCHER_TOOL_NAME}:
|
|
254
360
|
return _dispatcher_self_call_error()
|
|
255
361
|
try:
|
|
256
|
-
tools, specs = _select_agentengine_tools(
|
|
362
|
+
tools, specs = _select_agentengine_tools(
|
|
363
|
+
include=[target_name], profile=profile, include_dispatcher=False
|
|
364
|
+
)
|
|
257
365
|
except ValueError:
|
|
258
366
|
return _unknown_tool_error(target_name)
|
|
259
367
|
if specs and specs[0].get("enabled") is False:
|
|
260
|
-
return {
|
|
368
|
+
return {
|
|
369
|
+
"ok": False,
|
|
370
|
+
"error_type": "tool_disabled",
|
|
371
|
+
"error_message": f"Tool is disabled: {target_name}",
|
|
372
|
+
"tool_name": target_name,
|
|
373
|
+
}
|
|
261
374
|
tool_arguments, arguments_error = _normalize_tool_arguments(arguments)
|
|
262
375
|
if arguments_error:
|
|
263
376
|
return arguments_error
|
|
@@ -429,7 +542,9 @@ def _expand_requested_names(requested: list[str], tool_registry: Mapping[str, An
|
|
|
429
542
|
return names
|
|
430
543
|
|
|
431
544
|
|
|
432
|
-
def _expand_requested_descriptor_names(
|
|
545
|
+
def _expand_requested_descriptor_names(
|
|
546
|
+
requested: list[str], descriptor_registry: Mapping[str, Any]
|
|
547
|
+
) -> list[str]:
|
|
433
548
|
names: list[str] = []
|
|
434
549
|
for name in requested:
|
|
435
550
|
canonical_name = _canonical_toolset_group(name)
|
|
@@ -560,7 +675,9 @@ def _normalize_tool_name(tool_name: str | None) -> str:
|
|
|
560
675
|
return str(tool_name or "").strip()
|
|
561
676
|
|
|
562
677
|
|
|
563
|
-
def _normalize_tool_arguments(
|
|
678
|
+
def _normalize_tool_arguments(
|
|
679
|
+
arguments: dict[str, Any] | str | None,
|
|
680
|
+
) -> tuple[dict[str, Any], dict[str, Any] | None]:
|
|
564
681
|
if arguments is None:
|
|
565
682
|
return {}, None
|
|
566
683
|
if isinstance(arguments, dict):
|
|
@@ -594,7 +711,9 @@ def _normalize_tool_arguments(arguments: dict[str, Any] | str | None) -> tuple[d
|
|
|
594
711
|
}
|
|
595
712
|
|
|
596
713
|
|
|
597
|
-
def _normalize_dispatched_tool_arguments(
|
|
714
|
+
def _normalize_dispatched_tool_arguments(
|
|
715
|
+
tool_name: str, arguments: dict[str, Any]
|
|
716
|
+
) -> dict[str, Any]:
|
|
598
717
|
if tool_name == "save_memory" and "content" not in arguments:
|
|
599
718
|
if "key" in arguments and "value" in arguments:
|
|
600
719
|
return {"content": f"{arguments['key']}: {_stringify_memory_value(arguments['value'])}"}
|
|
@@ -819,13 +938,18 @@ def _tool_spec(
|
|
|
819
938
|
"risk_level": policy.risk_level,
|
|
820
939
|
"requires_approval": tool_policy_requires_approval(policy),
|
|
821
940
|
"side_effects": list(policy.side_effects),
|
|
941
|
+
"approval_scopes": list(policy.approval_scopes),
|
|
942
|
+
"approval_exempt": policy.approval_exempt,
|
|
822
943
|
"enabled": True,
|
|
823
944
|
}
|
|
824
945
|
for key, value in dict(extras or {}).items():
|
|
825
946
|
spec[key] = value() if callable(value) else value
|
|
826
947
|
enabled = bool(spec.get("enabled", True))
|
|
827
948
|
if name == "web_search":
|
|
828
|
-
enabled = bool(
|
|
949
|
+
enabled = bool(
|
|
950
|
+
os.environ.get("KSADK_WEB_SEARCH_PROVIDER")
|
|
951
|
+
or os.environ.get("OPENCLAW_WEB_SEARCH_PROVIDER")
|
|
952
|
+
)
|
|
829
953
|
if name in {"run_command", "run_code", "sandbox_status"}:
|
|
830
954
|
enabled = enabled and _enabled_backend(sandbox_backend_name())
|
|
831
955
|
spec["enabled"] = enabled
|