agentengine-sdk-python 0.8.3__py3-none-any.whl → 0.8.4__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.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/METADATA +9 -8
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/RECORD +482 -245
- ksadk/_build_provenance.json +1 -1
- ksadk/api/client.py +105 -91
- ksadk/builders/code_builder.py +36 -9
- ksadk/builders/framework_requirements.py +2 -1
- ksadk/builders/ks3_uploader.py +36 -7
- ksadk/builders/managed_runtime_builder.py +1 -0
- ksadk/cli/__init__.py +32 -3
- ksadk/cli/cmd_managed_runtime.py +13 -1
- ksadk/cli/cmd_plugin.py +6 -1
- ksadk/cli/cmd_web.py +2 -5
- ksadk/cli/runtime_bootstrap.py +23 -1
- ksadk/codex/client.py +424 -96
- ksadk/codex/projection.py +24 -0
- ksadk/codex/runtime.py +56 -298
- ksadk/common/auth.py +16 -10
- ksadk/configs/env_registry.py +29 -1
- ksadk/conversations/message_projection.py +135 -14
- ksadk/conversations/projector.py +4 -6
- ksadk/conversations/runtime_invocation.py +5 -0
- ksadk/conversations/runtime_payloads.py +1 -0
- ksadk/conversations/runtime_preparation.py +30 -27
- ksadk/conversations/runtime_resume.py +50 -2
- ksadk/conversations/runtime_stream_events.py +5 -0
- ksadk/conversations/runtime_streaming.py +25 -7
- ksadk/deployment/env_forward.py +2 -2
- ksadk/deployment/providers/serverless.py +1 -1
- ksadk/events/adapters/_codex_validators.py +18 -7
- ksadk/events/adapters/langgraph.py +15 -1
- ksadk/events/canonical_store.py +3 -1
- ksadk/events/projections.py +1 -1
- ksadk/harness/config.py +2 -2
- ksadk/harness/runtime.py +27 -27
- ksadk/harness/tools.py +38 -13
- ksadk/interaction/provider.py +1 -0
- ksadk/interaction/providers/langgraph.py +1 -0
- ksadk/kernel/bootstrap.py +28 -4
- ksadk/kernel/ingress.py +15 -2
- ksadk/kernel/sqlite_store.py +27 -0
- ksadk/kernel/store.py +3 -0
- ksadk/kernel/worker.py +65 -10
- ksadk/knowledge_base/client.py +57 -27
- ksadk/mcp_runtime/__init__.py +12 -4
- ksadk/memory/adk/backends/sdk_ltm_backend.py +161 -41
- ksadk/memory/adk/resilient_session_service.py +25 -17
- ksadk/memory/adk/short_term_memory.py +26 -9
- ksadk/memory/models.py +7 -4
- ksadk/memory/provider_resolver.py +3 -0
- ksadk/model_proxy/server.py +10 -5
- ksadk/plugins/__init__.py +4 -0
- ksadk/plugins/artifacts.py +275 -0
- ksadk/plugins/bridges/__init__.py +4 -2
- ksadk/plugins/bridges/codex.py +120 -13
- ksadk/plugins/bridges/dsh.py +340 -156
- ksadk/plugins/builtins.py +35 -36
- ksadk/plugins/bundle_security.py +28 -4
- ksadk/plugins/codex_manifest.py +983 -0
- ksadk/plugins/composition.py +8 -0
- ksadk/plugins/contracts.py +118 -0
- ksadk/plugins/delivery.py +153 -0
- ksadk/plugins/dsh_installation_digest.py +71 -0
- ksadk/plugins/dsh_toolchain.py +110 -21
- ksadk/plugins/ecosystem_probe.py +6 -6
- ksadk/plugins/host.py +102 -39
- ksadk/plugins/kernel_adapter.py +205 -0
- ksadk/plugins/providers/__init__.py +23 -0
- ksadk/plugins/providers/bundles/dsh-knowledge/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-knowledge/index.mjs +53 -0
- ksadk/plugins/providers/bundles/dsh-knowledge/package.json +16 -0
- ksadk/plugins/providers/bundles/dsh-memory/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-memory/index.mjs +175 -0
- ksadk/plugins/providers/bundles/dsh-memory/package.json +16 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/client.mjs +166 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/index.mjs +9 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/package.json +12 -0
- ksadk/plugins/providers/bundles/dsh-skill-center/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-skill-center/index.mjs +125 -0
- ksadk/plugins/providers/bundles/dsh-skill-center/package.json +16 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/index.mjs +870 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/package.json +27 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/client.js +92 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/index.mjs +15 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/package.json +7 -0
- ksadk/plugins/providers/codex.py +335 -69
- ksadk/plugins/providers/codex_native.py +368 -0
- ksadk/plugins/providers/codex_turn.py +301 -0
- ksadk/plugins/providers/dsh_capabilities.py +1389 -0
- ksadk/plugins/providers/dsh_mcp.py +467 -0
- ksadk/plugins/providers/harness.py +118 -113
- ksadk/plugins/providers/mcp_projection.py +150 -0
- ksadk/plugins/providers/platform_resources.py +657 -0
- ksadk/plugins/resolver.py +8 -1
- ksadk/resource_runtime/__init__.py +4 -0
- ksadk/resource_runtime/broker.py +616 -0
- ksadk/resource_runtime/build_artifacts.py +165 -0
- ksadk/resource_runtime/contracts.py +138 -0
- ksadk/resource_runtime/discovery_receipts.py +100 -0
- ksadk/resource_runtime/discovery_skills.py +172 -0
- ksadk/resource_runtime/errors.py +6 -0
- ksadk/resource_runtime/ipc.py +142 -0
- ksadk/resource_runtime/kernel_approval.py +165 -0
- ksadk/resource_runtime/knowledge.py +114 -0
- ksadk/resource_runtime/langgraph.py +94 -0
- ksadk/resource_runtime/leases.py +191 -0
- ksadk/resource_runtime/managed_projection.py +186 -0
- ksadk/resource_runtime/mcp_server.py +138 -0
- ksadk/resource_runtime/memory_provider.py +318 -0
- ksadk/resource_runtime/memory_receipts.py +34 -0
- ksadk/resource_runtime/operation_ledger.py +211 -0
- ksadk/resource_runtime/plugin_config.py +48 -0
- ksadk/resource_runtime/policy_authorization.py +54 -0
- ksadk/resource_runtime/process.py +110 -0
- ksadk/resource_runtime/skill_artifacts.py +153 -0
- ksadk/resource_runtime/skill_runtime.py +42 -0
- ksadk/resource_runtime/skill_workspace.py +118 -0
- ksadk/resource_runtime/skills.py +215 -0
- ksadk/resource_runtime/snapshots.py +180 -0
- ksadk/resource_runtime/socket_server.py +103 -0
- ksadk/resource_runtime/supervisor.py +380 -0
- ksadk/resource_runtime/worker.py +504 -0
- ksadk/runners/_langgraph_runner_streams.py +74 -6
- ksadk/runners/adk_runner.py +149 -11
- ksadk/runners/base_runner.py +29 -1
- ksadk/runners/langgraph_runner.py +475 -145
- ksadk/runtime/_runner_adapter/stream_mapping.py +142 -18
- ksadk/runtime/adapter.py +2 -0
- ksadk/runtime/conversation_execution.py +92 -16
- ksadk/runtime/executor.py +78 -2
- ksadk/runtime/factory.py +29 -273
- ksadk/runtime/framework_adapters.py +23 -0
- ksadk/runtime/preprocessing.py +10 -2
- ksadk/runtime/runner_adapter.py +73 -14
- ksadk/runtime_context.py +40 -2
- ksadk/sandbox/backends/e2b.py +52 -11
- ksadk/sandbox/backends/local_process.py +9 -0
- ksadk/sandbox/base.py +2 -0
- ksadk/sandbox/e2b_connection.py +66 -0
- ksadk/scheduler/sqlite_store.py +18 -0
- ksadk/server/composition.py +2 -0
- ksadk/server/factory.py +5 -0
- ksadk/server/persistence_capability.py +516 -0
- ksadk/server/routes/control.py +210 -46
- ksadk/server/routes/dependencies.py +15 -0
- ksadk/server/routes/models.py +47 -4
- ksadk/server/routes/projection.py +252 -12
- ksadk/server/routes/sessions.py +284 -107
- ksadk/server/routes/streaming.py +43 -9
- ksadk/server/static/assets/{ArtifactsPanel-10GPXIJ6.js → ArtifactsPanel-CGbWlMNh.js} +1 -1
- ksadk/server/static/assets/{CodeBlock-BXk1l-G1.js → CodeBlock-b4C7upmO.js} +3 -3
- ksadk/server/static/assets/{MathMessageMarkdown-D9uB55Oh.js → MathMessageMarkdown-DbdW5A4_.js} +4 -4
- ksadk/server/static/assets/{MermaidBlock--OEYoXIJ.js → MermaidBlock-BEBN4Ksz.js} +6 -6
- ksadk/server/static/assets/{NativeTerminalPanel-DrEe1syq.js → NativeTerminalPanel-zvL-WpAn.js} +1 -1
- ksadk/server/static/assets/{abnfDiagram-VCTEODGH-eeTFJLvo.js → abnfDiagram-VCTEODGH-BYafW7Za.js} +1 -1
- ksadk/server/static/assets/{arc-S3ZNbIAd.js → arc-bTohInsS.js} +1 -1
- ksadk/server/static/assets/architecture-7GRP2DOG-BW5UtSnx.js +1 -0
- ksadk/server/static/assets/{architectureDiagram-5GKGNRK7-CRjgEJDX.js → architectureDiagram-5GKGNRK7-Ch5Lbzsi.js} +1 -1
- ksadk/server/static/assets/{blockDiagram-NRAW4CY4-C7bsBoNH.js → blockDiagram-NRAW4CY4-kqF4MDOG.js} +1 -1
- ksadk/server/static/assets/{c4Diagram-UCG6FXSJ-BX3c33Ob.js → c4Diagram-UCG6FXSJ-8uSRIODv.js} +1 -1
- ksadk/server/static/assets/channel-CF5Up3hQ.js +1 -0
- ksadk/server/static/assets/chunk-2Q5K7J3B-KkXX47WI.js +1 -0
- ksadk/server/static/assets/{chunk-5VM5RSS4-bZ7ws-8m.js → chunk-5VM5RSS4-DkhehZDr.js} +1 -1
- ksadk/server/static/assets/{chunk-F27PBJKO-D2r0pvhY.js → chunk-F27PBJKO-BdXhtPe9.js} +1 -1
- ksadk/server/static/assets/{chunk-G27WJ6UU-CZwF3oUP.js → chunk-G27WJ6UU-DPTpvpwi.js} +1 -1
- ksadk/server/static/assets/{chunk-JWPE2WC7-DigFYCML.js → chunk-JWPE2WC7-Pqoh38el.js} +1 -1
- ksadk/server/static/assets/{chunk-LCL6LL3I-CnorGV5q.js → chunk-LCL6LL3I-DeU00qC-.js} +1 -1
- ksadk/server/static/assets/{chunk-POPQ4Y6H-CexntQA-.js → chunk-POPQ4Y6H-CzxScFkr.js} +1 -1
- ksadk/server/static/assets/{chunk-RHFEMEQ7-CHTC7UxA.js → chunk-RHFEMEQ7-DpqMx-ux.js} +1 -1
- ksadk/server/static/assets/{chunk-SVP7TREG-BC1EWt_-.js → chunk-SVP7TREG-C6t0SypQ.js} +1 -1
- ksadk/server/static/assets/{chunk-XXDRQBXY-BTG24xN0.js → chunk-XXDRQBXY-DVaeafZk.js} +1 -1
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-Cz81acRQ.js +1 -0
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-Cz81acRQ.js +1 -0
- ksadk/server/static/assets/{cose-bilkent-JH36ORCC-CkonRdAS.js → cose-bilkent-JH36ORCC-Bf9D3tzJ.js} +1 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-DVWs8a2t.js +1 -0
- ksadk/server/static/assets/{cynefinDiagram-5FMLGOSQ-DEOCBe15.js → cynefinDiagram-5FMLGOSQ-B9cY3iTz.js} +1 -1
- ksadk/server/static/assets/{dagre-3AP2YEHR-DBThPuLa.js → dagre-3AP2YEHR-CSwlx3CB.js} +1 -1
- ksadk/server/static/assets/{dagre-ClTPrTht.js → dagre-UBpgon5q.js} +1 -1
- ksadk/server/static/assets/{diagram-S7CK7UJ4-DsZHrnpJ.js → diagram-S7CK7UJ4-C9akhN9a.js} +1 -1
- ksadk/server/static/assets/{diagram-UQ7AKVKN-BJR4nhVr.js → diagram-UQ7AKVKN-CgedhTPI.js} +1 -1
- ksadk/server/static/assets/{diagram-VSXAHHWV-xzcERX0a.js → diagram-VSXAHHWV-Cjucz5BY.js} +1 -1
- ksadk/server/static/assets/{diagram-VX7I27RA-tn2xM1xu.js → diagram-VX7I27RA-Dd4Vleyn.js} +1 -1
- ksadk/server/static/assets/{diagram-Z3DM3KII-BZPGBkw5.js → diagram-Z3DM3KII-CZ2jGtYW.js} +1 -1
- ksadk/server/static/assets/{dist-DdRBIceA.js → dist-B2_CVgKv.js} +1 -1
- ksadk/server/static/assets/{dist-Cq4OL6nO.js → dist-B3FR1SKK.js} +1 -1
- ksadk/server/static/assets/{dist-M67Hwu0n.js → dist-BIr4DSRq.js} +1 -1
- ksadk/server/static/assets/{dist-B1oWRmrH.js → dist-BgV_owcB.js} +1 -1
- ksadk/server/static/assets/{dist-DyqV4fL4.js → dist-Bj730Ib4.js} +1 -1
- ksadk/server/static/assets/{dist-DfGFrb0v.js → dist-BnaTiyzN.js} +1 -1
- ksadk/server/static/assets/{dist-C71CsujO.js → dist-C1NMAY5a.js} +1 -1
- ksadk/server/static/assets/{dist-CXpH_Rdd.js → dist-C5_ZAZsG.js} +1 -1
- ksadk/server/static/assets/{dist-DJmCPRVB.js → dist-CB9iJrvg.js} +1 -1
- ksadk/server/static/assets/{dist-DjhwGUgZ.js → dist-CFzsn6BG.js} +1 -1
- ksadk/server/static/assets/{dist-BI1qQH4n.js → dist-Cf125P_m.js} +1 -1
- ksadk/server/static/assets/{dist-8VWI-2bZ.js → dist-ClYUxfeK.js} +1 -1
- ksadk/server/static/assets/{dist-DUwKa_l6.js → dist-DFD6Qa6T.js} +1 -1
- ksadk/server/static/assets/{dist-B-46q3Hk.js → dist-DVCOWtha.js} +1 -1
- ksadk/server/static/assets/{dist-BJLUwH6W.js → dist-D_ctSS2i.js} +1 -1
- ksadk/server/static/assets/{dist-4zN1_tq5.js → dist-DiixqL0J.js} +1 -1
- ksadk/server/static/assets/{dist-B0gdk4rl.js → dist-DoVSwoDb.js} +1 -1
- ksadk/server/static/assets/{dist-Bbwqa8TG.js → dist-DvFK7p5S.js} +1 -1
- ksadk/server/static/assets/{dist-D1V3f1B4.js → dist-QfkEHOlb.js} +1 -1
- ksadk/server/static/assets/{dist-Btyo4vX4.js → dist-btbmmX5O.js} +1 -1
- ksadk/server/static/assets/{dist-u8tVH5Ak.js → dist-fBO2v5Kt.js} +1 -1
- ksadk/server/static/assets/{dist-DQAB0qn_.js → dist-ufY3F5p6.js} +1 -1
- ksadk/server/static/assets/{ebnfDiagram-PWID7BFC-DVfMsLge.js → ebnfDiagram-PWID7BFC-Ci8NqqZu.js} +1 -1
- ksadk/server/static/assets/{erDiagram-SSCWMZ5O-CWEZSYaw.js → erDiagram-SSCWMZ5O-CCIOhLZG.js} +1 -1
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-CQqR2hg3.js +1 -0
- ksadk/server/static/assets/flowDiagram-A5DVABFB-DDRRbGPm.js +1 -0
- ksadk/server/static/assets/{ganttDiagram-EL5Y4UJY-TWIxoyYL.js → ganttDiagram-EL5Y4UJY-Cp_r9Hb6.js} +1 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-fgWEf7UD.js +1 -0
- ksadk/server/static/assets/{gitGraphDiagram-WWUBYQGX-DDh2hd2S.js → gitGraphDiagram-WWUBYQGX-Dlhc8Wr8.js} +1 -1
- ksadk/server/static/assets/index-DcTML1Up.css +2 -0
- ksadk/server/static/assets/index-Dh2XHqPK.js +244 -0
- ksadk/server/static/assets/info-A6RAGUB7-BUecLTdt.js +1 -0
- ksadk/server/static/assets/{infoDiagram-RXCK75RN-CgoyWiDR.js → infoDiagram-RXCK75RN-CO0rRTRA.js} +1 -1
- ksadk/server/static/assets/{ishikawaDiagram-5VMMS53U-CyRIu_om.js → ishikawaDiagram-5VMMS53U-CHiaedSS.js} +1 -1
- ksadk/server/static/assets/{journeyDiagram-EYS64GPL-DN5JXHzN.js → journeyDiagram-EYS64GPL-CHcCIB09.js} +1 -1
- ksadk/server/static/assets/{kanban-definition-3QL26DDD-CNP3ui66.js → kanban-definition-3QL26DDD-CJ_ebBZf.js} +1 -1
- ksadk/server/static/assets/{katex-DWEzQy1d.js → katex-B4weu383.js} +1 -1
- ksadk/server/static/assets/{linear-C-qHp7d2.js → linear-V-MgYHW1.js} +1 -1
- ksadk/server/static/assets/{mermaid-parser.core-Cl-K943T.js → mermaid-parser.core-CBijEX_c.js} +2 -2
- ksadk/server/static/assets/{mindmap-definition-FBJOCRG2-D5DB5mYm.js → mindmap-definition-FBJOCRG2-Bc-pQvpp.js} +1 -1
- ksadk/server/static/assets/packet-AYTQ26CC-BeW-btFv.js +1 -0
- ksadk/server/static/assets/{pegDiagram-XKGWAZYB-BQVc9ia_.js → pegDiagram-XKGWAZYB-D7genGLl.js} +1 -1
- ksadk/server/static/assets/pie-WAS4IAKB-X0xh4SaT.js +1 -0
- ksadk/server/static/assets/{pieDiagram-E7YTZNPT-B6UCAvtY.js → pieDiagram-E7YTZNPT-Bxj32zwD.js} +1 -1
- ksadk/server/static/assets/{quadrantDiagram-AXDQQJYC-mIr2d3eb.js → quadrantDiagram-AXDQQJYC-BURv2mGh.js} +1 -1
- ksadk/server/static/assets/radar-RG4KPBEZ-DzRMSqjd.js +1 -0
- ksadk/server/static/assets/railroad-74A4TZTK-Cc44icX-.js +1 -0
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-D6S4BdV-.js +1 -0
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-vD3aVE2o.js +1 -0
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-CYbW_b4T.js +1 -0
- ksadk/server/static/assets/{railroadDiagram-O6MQD6OU-Dt3FFDmK.js → railroadDiagram-O6MQD6OU-CCsh3avW.js} +1 -1
- ksadk/server/static/assets/{requirementDiagram-EFPCY7ZU-Cz_vQtgF.js → requirementDiagram-EFPCY7ZU-_FRRBKEd.js} +1 -1
- ksadk/server/static/assets/{sankeyDiagram-P5KCCOFB-wlO1TsH5.js → sankeyDiagram-P5KCCOFB-C-gr2o9M.js} +1 -1
- ksadk/server/static/assets/{sequenceDiagram-WJ2MYXX4-CHRbElYq.js → sequenceDiagram-WJ2MYXX4-D97NmfKg.js} +1 -1
- ksadk/server/static/assets/{sizeCapture-X5ZJPWSS-DXX54iyO.js → sizeCapture-X5ZJPWSS-DjrPC5FX.js} +1 -1
- ksadk/server/static/assets/{stateDiagram-HBIQ2CUA-Dp_lw9II.js → stateDiagram-HBIQ2CUA-DzMNg1hh.js} +1 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-BIcjKFhF.js +1 -0
- ksadk/server/static/assets/{swimlanes-XN3QIQJK-D8O5UlLG.js → swimlanes-XN3QIQJK-Cssf_CsU.js} +1 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-tq3K3Ybl.js +8 -0
- ksadk/server/static/assets/{timeline-definition-24CTP7MA-8mfKcxvG.js → timeline-definition-24CTP7MA-BWTHzyS1.js} +1 -1
- ksadk/server/static/assets/treeView-Q6P3EWNA-DBXt3GdU.js +1 -0
- ksadk/server/static/assets/treemap-WGGIJYW6-DrCy4E_l.js +1 -0
- ksadk/server/static/assets/{vennDiagram-4TSXK5OY-EnNl0DE7.js → vennDiagram-4TSXK5OY-BSKgJsmR.js} +1 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-CefhOliM.js +1 -0
- ksadk/server/static/assets/{wardleyDiagram-VM6X3IG4-DBu5fbYr.js → wardleyDiagram-VM6X3IG4-eflHNoaZ.js} +1 -1
- ksadk/server/static/assets/{xychartDiagram-S5SC5T6Z-BSVXs4IY.js → xychartDiagram-S5SC5T6Z-eYqrQ-v4.js} +1 -1
- ksadk/server/static/index.html +2 -2
- ksadk/session_context.py +66 -0
- ksadk/sessions/__init__.py +11 -21
- ksadk/sessions/_local_service_sync.py +263 -1
- ksadk/sessions/base.py +176 -0
- ksadk/sessions/errors.py +4 -0
- ksadk/sessions/in_memory.py +309 -19
- ksadk/sessions/local_service.py +83 -1
- ksadk/sessions/persistence.py +275 -0
- ksadk/sessions/postgres_service.py +358 -0
- ksadk/sessions/resilience.py +8 -0
- ksadk/sessions/resilient.py +362 -4
- ksadk/sessions/topology.py +135 -0
- ksadk/skills/models.py +26 -4
- ksadk/skills/package_store.py +186 -38
- ksadk/skills/runtime/agent.py +31 -6
- ksadk/skills/runtime/artifact_delivery.py +139 -0
- ksadk/skills/runtime/backends/e2b.py +98 -6
- ksadk/skills/runtime/backends/local.py +73 -8
- ksadk/skills/runtime/base.py +3 -0
- ksadk/skills/runtime/executor.py +2 -0
- ksadk/skills/runtime/loader.py +10 -2
- ksadk/skills/runtime/pinned.py +114 -0
- ksadk/skills/runtime/request.py +31 -0
- ksadk/skills/service_client.py +167 -28
- ksadk/studio/api.py +224 -42
- ksadk/studio/api_catalog_routes.py +18 -0
- ksadk/studio/api_plugin_routes.py +526 -95
- ksadk/studio/api_resource_connections.py +183 -0
- ksadk/studio/authoring_coordinator.py +19 -14
- ksadk/studio/builder.py +76 -0
- ksadk/studio/cloud.py +342 -104
- ksadk/studio/cloud_shared_web.py +565 -0
- ksadk/studio/codex_agent_service.py +128 -26
- ksadk/studio/codex_builder.py +241 -2
- ksadk/studio/codex_credentials.py +90 -0
- ksadk/studio/codex_manifest.py +31 -4
- ksadk/studio/codex_plugin_store.py +746 -0
- ksadk/studio/codex_provider_build.py +231 -0
- ksadk/studio/codex_run.py +184 -25
- ksadk/studio/compatibility_report.py +12 -1
- ksadk/studio/compiler.py +78 -14
- ksadk/studio/contracts.py +132 -6
- ksadk/studio/dsh_application.py +137 -0
- ksadk/studio/dsh_capability_service.py +1107 -0
- ksadk/studio/dsh_models.py +59 -0
- ksadk/studio/dsh_provider_registration.py +320 -13
- ksadk/studio/hosted_kernel.py +88 -13
- ksadk/studio/mcp_runtime.py +11 -3
- ksadk/studio/model_client.py +2 -2
- ksadk/studio/plugin_composition.py +190 -23
- ksadk/studio/plugin_kernel_adapter.py +12 -112
- ksadk/studio/plugin_runtime.py +224 -45
- ksadk/studio/resource_authority.py +637 -0
- ksadk/studio/resource_binding_validation.py +77 -0
- ksadk/studio/resource_build_admission.py +196 -0
- ksadk/studio/resource_build_materializer.py +149 -0
- ksadk/studio/resource_catalog.py +143 -2
- ksadk/studio/resource_connections.py +220 -0
- ksadk/studio/run_service.py +462 -52
- ksadk/studio/runtime_source.py +15 -7
- ksadk/studio/scheduler_assistant.py +317 -0
- ksadk/studio/scheduler_runtime.py +9 -0
- ksadk/studio/scheduler_service.py +3 -0
- ksadk/studio/service.py +490 -44
- ksadk/studio/shared_web.py +446 -62
- ksadk/studio/static/assets/CodeBlock-DCUUY0PL-BLjA7kbS.js +41 -0
- ksadk/studio/static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- ksadk/studio/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- ksadk/studio/static/assets/MathMessageMarkdown-CBcDrAw--BEOyPC3w.css +1 -0
- ksadk/studio/static/assets/MathMessageMarkdown-CBcDrAw--CUYIXwgI.js +8 -0
- ksadk/studio/static/assets/MermaidBlock-DBFTztfQ-BTYKWEbD.js +44 -0
- ksadk/studio/static/assets/PrismRenderer-wiXRHURw.js +3 -0
- ksadk/studio/static/assets/abnfDiagram-VCTEODGH-CLETGjKq.js +1 -0
- ksadk/studio/static/assets/arc-Pry-7G1_.js +1 -0
- ksadk/studio/static/assets/architecture-7GRP2DOG-hXMiO_AU.js +1 -0
- ksadk/studio/static/assets/architectureDiagram-5GKGNRK7-B5EQysk6.js +36 -0
- ksadk/studio/static/assets/array-BifhSqXX.js +1 -0
- ksadk/studio/static/assets/blockDiagram-I7D4REHJ-CFmPl1de.js +129 -0
- ksadk/studio/static/assets/c4Diagram-7LVT6UL2-BRrGu8qt.js +38 -0
- ksadk/studio/static/assets/channel-BqO-gtEw.js +1 -0
- ksadk/studio/static/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- ksadk/studio/static/assets/chunk-4HAMMTFA-D220vUtq.js +62 -0
- ksadk/studio/static/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- ksadk/studio/static/assets/chunk-75Z2AOVW-C8lLv_qc.js +2 -0
- ksadk/studio/static/assets/chunk-DU6HZSFF-C4DtVpCu.js +128 -0
- ksadk/studio/static/assets/chunk-F27PBJKO-Cpw14SNG.js +1 -0
- ksadk/studio/static/assets/chunk-FOHPRMQF-DHwB1DNv.js +161 -0
- ksadk/studio/static/assets/chunk-GMAD6QVW-DiQA-u2N.js +72 -0
- ksadk/studio/static/assets/chunk-GVQU2GXP-DUdNBUCi.js +1 -0
- ksadk/studio/static/assets/chunk-IMKFNOWR-BSlbjT_b.js +231 -0
- ksadk/studio/static/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- ksadk/studio/static/assets/chunk-L3NEJ4N5-Db8Ab22W.js +1 -0
- ksadk/studio/static/assets/chunk-OSK3NFVY-M2m6G3j4.js +10 -0
- ksadk/studio/static/assets/chunk-P2QGCYS3-DezaQxiK.js +1 -0
- ksadk/studio/static/assets/chunk-POPQ4Y6H-DOpufJ3t.js +1 -0
- ksadk/studio/static/assets/chunk-PWAF6VOD-CfLb1gSc.js +1 -0
- ksadk/studio/static/assets/chunk-SHT3W25Y-DAyIVp5H.js +168 -0
- ksadk/studio/static/assets/chunk-SVP7TREG-DulomOrS.js +88 -0
- ksadk/studio/static/assets/chunk-TICWLB2K-bHJYoflj.js +206 -0
- ksadk/studio/static/assets/chunk-XXDRQBXY-7PcdR2B1.js +1 -0
- ksadk/studio/static/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- ksadk/studio/static/assets/classDiagram-ZZMXUADV-D_bW8JjA.js +1 -0
- ksadk/studio/static/assets/classDiagram-v2-VYDZK3BY-D_bW8JjA.js +1 -0
- ksadk/studio/static/assets/cose-bilkent-JH36ORCC-snL88wkX.js +1 -0
- ksadk/studio/static/assets/cynefin-OW5HDTMX-Bd1YhRo1.js +1 -0
- ksadk/studio/static/assets/cynefinDiagram-5FMLGOSQ-BBrIG_mI.js +62 -0
- ksadk/studio/static/assets/cytoscape.esm-CGd-uY3x.js +321 -0
- ksadk/studio/static/assets/dagre-GXQ25YYZ-DtF1nGdY.js +4 -0
- ksadk/studio/static/assets/dagre-PrKaheQc.js +1 -0
- ksadk/studio/static/assets/defaultLocale-BFoDCU3G.js +1 -0
- ksadk/studio/static/assets/diagram-S7CK7UJ4-0BZ98mya.js +30 -0
- ksadk/studio/static/assets/diagram-UQ7AKVKN-6mLKEo6L.js +41 -0
- ksadk/studio/static/assets/diagram-VSXAHHWV-CJBIaiZ2.js +3 -0
- ksadk/studio/static/assets/diagram-VX7I27RA-BohLEE1C.js +24 -0
- ksadk/studio/static/assets/diagram-Z3DM3KII-D8KIGonG.js +24 -0
- ksadk/studio/static/assets/dist-v5Q1xZ2K.js +1 -0
- ksadk/studio/static/assets/ebnfDiagram-PWID7BFC-C99HU61t.js +1 -0
- ksadk/studio/static/assets/erDiagram-RLTQ6QDP-DLGry2Ap.js +99 -0
- ksadk/studio/static/assets/eventmodeling-NTZA5JFV-B1_5Ac8j.js +1 -0
- ksadk/studio/static/assets/flowDiagram-HODETNUW-DD5hmicn.js +1 -0
- ksadk/studio/static/assets/ganttDiagram-EL5Y4UJY-BPJrVLSG.js +292 -0
- ksadk/studio/static/assets/gitGraph-4MIJSDKK-Cy_ZQBGi.js +1 -0
- ksadk/studio/static/assets/gitGraphDiagram-WWUBYQGX-CZCUz4MT.js +106 -0
- ksadk/studio/static/assets/graphlib-DS17s2tU.js +1 -0
- ksadk/studio/static/assets/index-CeHL9ARV.css +2 -0
- ksadk/studio/static/assets/index-D9QEcVpL.js +320 -0
- ksadk/studio/static/assets/info-A6RAGUB7-DBzDQB_I.js +1 -0
- ksadk/studio/static/assets/infoDiagram-27XIBGKW-B-sq07Hi.js +2 -0
- ksadk/studio/static/assets/init-C-OQMol4.js +1 -0
- ksadk/studio/static/assets/ishikawaDiagram-5VMMS53U-CljI2wyf.js +70 -0
- ksadk/studio/static/assets/journeyDiagram-3NMN7TZE-D50Fo2sL.js +139 -0
- ksadk/studio/static/assets/kanban-definition-UXKFOSKX-DimfOTam.js +89 -0
- ksadk/studio/static/assets/katex-DhON-x74.js +257 -0
- ksadk/studio/static/assets/line-CX5BOOUP.js +1 -0
- ksadk/studio/static/assets/linear-BCxN9JLv.js +1 -0
- ksadk/studio/static/assets/mermaid-parser.core-BdCz8fkS.js +7 -0
- ksadk/studio/static/assets/mindmap-definition-YA3MSWOX-Bizzqy5R.js +96 -0
- ksadk/studio/static/assets/ordinal-BDEzSJ7C.js +1 -0
- ksadk/studio/static/assets/packet-AYTQ26CC-gPln-_kG.js +1 -0
- ksadk/studio/static/assets/path-fybaL0A-.js +1 -0
- ksadk/studio/static/assets/pegDiagram-XKGWAZYB-Dy3fB-gW.js +1 -0
- ksadk/studio/static/assets/pie-WAS4IAKB-qZdHMr7B.js +1 -0
- ksadk/studio/static/assets/pieDiagram-E7YTZNPT-B9mrFSDF.js +39 -0
- ksadk/studio/static/assets/quadrantDiagram-AXDQQJYC-NzUfCbMR.js +7 -0
- ksadk/studio/static/assets/radar-RG4KPBEZ-BZlnaea9.js +1 -0
- ksadk/studio/static/assets/railroad-74A4TZTK-Ce3__H9c.js +1 -0
- ksadk/studio/static/assets/railroad-abnf-HS5TGJTU-DqQn7EzD.js +1 -0
- ksadk/studio/static/assets/railroad-ebnf-LZEXJU2U-B55kCA8F.js +1 -0
- ksadk/studio/static/assets/railroad-peg-WCYAUIDC-DfQnvkHd.js +1 -0
- ksadk/studio/static/assets/railroadDiagram-O6MQD6OU-DnhMjZCk.js +1 -0
- ksadk/studio/static/assets/requirementDiagram-BXWQKSXE-BF3d103U.js +84 -0
- ksadk/studio/static/assets/rolldown-runtime-Dy4uBu1J-DK3Fl9T5.js +1 -0
- ksadk/studio/static/assets/rough.esm-Dy-Kn_BL.js +1 -0
- ksadk/studio/static/assets/sankeyDiagram-P5KCCOFB-Bo-JTwt0.js +40 -0
- ksadk/studio/static/assets/sequenceDiagram-WJ2MYXX4-Dh4wZtUm.js +162 -0
- ksadk/studio/static/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -0
- ksadk/studio/static/assets/src-SFn9St9H.js +1 -0
- ksadk/studio/static/assets/stateDiagram-D77RDMKH-DH774G6d.js +1 -0
- ksadk/studio/static/assets/stateDiagram-v2-MP3YSRHH-DZvVWPBo.js +1 -0
- ksadk/studio/static/assets/swimlanes-42K2YHIH-Bl13OvTX.js +1 -0
- ksadk/studio/static/assets/swimlanesDiagram-VR7AAH4N-BnFOTALJ.js +8 -0
- ksadk/studio/static/assets/timeline-definition-24CTP7MA-DxmSSjRB.js +120 -0
- ksadk/studio/static/assets/treeView-Q6P3EWNA-D5Nn9Swz.js +1 -0
- ksadk/studio/static/assets/treemap-WGGIJYW6-CgHgnQhE.js +1 -0
- ksadk/studio/static/assets/vennDiagram-4TSXK5OY-B9QEXcJq.js +34 -0
- ksadk/studio/static/assets/wardley-WFR3VGLG-DXrK2RRY.js +1 -0
- ksadk/studio/static/assets/wardleyDiagram-VM6X3IG4-Ba1AOWoe.js +78 -0
- ksadk/studio/static/assets/xychartDiagram-S5SC5T6Z-Cr5pt5Y-.js +7 -0
- ksadk/studio/static/index.html +2 -2
- ksadk/version.py +1 -1
- ksadk/server/static/assets/architecture-7GRP2DOG-Dk9nRQ6-.js +0 -1
- ksadk/server/static/assets/channel-s354Yo6o.js +0 -1
- ksadk/server/static/assets/chunk-2Q5K7J3B-CDpPpKR5.js +0 -1
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-Dd0nucl9.js +0 -1
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-Dd0nucl9.js +0 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-BBlT4uMf.js +0 -1
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-Dr5okd8V.js +0 -1
- ksadk/server/static/assets/flowDiagram-A5DVABFB-VEO-cVcO.js +0 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-CKiKY9Cf.js +0 -1
- ksadk/server/static/assets/index-B2k_urY8.js +0 -241
- ksadk/server/static/assets/index-ILPt6IWF.css +0 -2
- ksadk/server/static/assets/info-A6RAGUB7-ubA4Nm_p.js +0 -1
- ksadk/server/static/assets/packet-AYTQ26CC-C7R3NUlK.js +0 -1
- ksadk/server/static/assets/pie-WAS4IAKB-BIT6qjr3.js +0 -1
- ksadk/server/static/assets/radar-RG4KPBEZ-l5noef9X.js +0 -1
- ksadk/server/static/assets/railroad-74A4TZTK-Baea6ZvM.js +0 -1
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-OKn8zZnU.js +0 -1
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-DdKAKC4l.js +0 -1
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-Bds8udlG.js +0 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-5b-8o2iS.js +0 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-uf6WPRA4.js +0 -8
- ksadk/server/static/assets/treeView-Q6P3EWNA-CK5CSrSO.js +0 -1
- ksadk/server/static/assets/treemap-WGGIJYW6-Ch2BKgAM.js +0 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-YW3Q0ml_.js +0 -1
- ksadk/studio/static/assets/PrismRenderer-IYN-ffww.js +0 -3
- ksadk/studio/static/assets/index-DXs1Eq4M.css +0 -1
- ksadk/studio/static/assets/index-DeDqwTsD.js +0 -283
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/WHEEL +0 -0
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/entry_points.txt +0 -0
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/licenses/LICENSE +0 -0
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/top_level.txt +0 -0
ksadk/plugins/host.py
CHANGED
|
@@ -4,6 +4,7 @@ The host has no knowledge of AgentControl, SessionEvent sequencing, or cloud
|
|
|
4
4
|
deployment. It only stages a fully resolved profile, atomically swaps it once
|
|
5
5
|
healthy, and disposes owned effects in reverse dependency order.
|
|
6
6
|
"""
|
|
7
|
+
|
|
7
8
|
from __future__ import annotations
|
|
8
9
|
|
|
9
10
|
import asyncio
|
|
@@ -79,6 +80,9 @@ class PluginExecutionContext:
|
|
|
79
80
|
profile_digest: str
|
|
80
81
|
plugin_lock_digest: str
|
|
81
82
|
bindings: tuple[PluginCapabilityBinding, ...]
|
|
83
|
+
# The host owns this key. Capability plugins may use it to bind ephemeral
|
|
84
|
+
# leases to the same provider activation without learning request payloads.
|
|
85
|
+
activation_key: str = ""
|
|
82
86
|
|
|
83
87
|
def all(
|
|
84
88
|
self,
|
|
@@ -89,8 +93,7 @@ class PluginExecutionContext:
|
|
|
89
93
|
return tuple(
|
|
90
94
|
binding
|
|
91
95
|
for binding in self.bindings
|
|
92
|
-
if binding.definition == definition
|
|
93
|
-
and (slot is None or binding.slot == slot)
|
|
96
|
+
if binding.definition == definition and (slot is None or binding.slot == slot)
|
|
94
97
|
)
|
|
95
98
|
|
|
96
99
|
def require(
|
|
@@ -157,6 +160,7 @@ class _ActiveActivation:
|
|
|
157
160
|
bundle_digest: str
|
|
158
161
|
runtime: PreparedAgent
|
|
159
162
|
operation_lock: asyncio.Lock
|
|
163
|
+
operation_task: asyncio.Task[Any] | None = None
|
|
160
164
|
closed: bool = False
|
|
161
165
|
|
|
162
166
|
|
|
@@ -370,7 +374,11 @@ class PluginHost:
|
|
|
370
374
|
await self._finish_cleanup(self._dispose_unpinned_retired_graphs())
|
|
371
375
|
|
|
372
376
|
graph = self._require_bundle_graph(bundle)
|
|
373
|
-
runtime = await self._prepare_activation(
|
|
377
|
+
runtime = await self._prepare_activation(
|
|
378
|
+
graph,
|
|
379
|
+
bundle,
|
|
380
|
+
activation_key=key,
|
|
381
|
+
)
|
|
374
382
|
active = _ActiveActivation(
|
|
375
383
|
key=key,
|
|
376
384
|
graph=graph,
|
|
@@ -406,11 +414,7 @@ class PluginHost:
|
|
|
406
414
|
"""Drain and dispose active plus retired graphs; there is no implicit restart."""
|
|
407
415
|
|
|
408
416
|
async with self._transaction_lock:
|
|
409
|
-
graphs = [
|
|
410
|
-
graph
|
|
411
|
-
for graph in [self._active, *self._retired]
|
|
412
|
-
if graph is not None
|
|
413
|
-
]
|
|
417
|
+
graphs = [graph for graph in [self._active, *self._retired] if graph is not None]
|
|
414
418
|
self._active = None
|
|
415
419
|
self._retired = []
|
|
416
420
|
if graphs:
|
|
@@ -491,9 +495,7 @@ class PluginHost:
|
|
|
491
495
|
def _require_bundle_graph(self, bundle: ResolvedPluginBundle) -> _ActiveGraph:
|
|
492
496
|
graph = self._active
|
|
493
497
|
if graph is None:
|
|
494
|
-
raise PluginHostError(
|
|
495
|
-
"plugin_profile_inactive", "no plugin profile is active"
|
|
496
|
-
)
|
|
498
|
+
raise PluginHostError("plugin_profile_inactive", "no plugin profile is active")
|
|
497
499
|
if not self._bundle_matches_graph(bundle, graph):
|
|
498
500
|
raise PluginHostError(
|
|
499
501
|
"plugin_bundle_profile_mismatch",
|
|
@@ -512,11 +514,11 @@ class PluginHost:
|
|
|
512
514
|
self,
|
|
513
515
|
graph: _ActiveGraph,
|
|
514
516
|
bundle: ResolvedPluginBundle,
|
|
517
|
+
*,
|
|
518
|
+
activation_key: str,
|
|
515
519
|
) -> PreparedAgent:
|
|
516
|
-
capabilities = self._execution_context(graph)
|
|
517
|
-
provider_binding = capabilities.require(
|
|
518
|
-
"agent.provider/v1", slot="agent.execution"
|
|
519
|
-
)
|
|
520
|
+
capabilities = self._execution_context(graph, activation_key=activation_key)
|
|
521
|
+
provider_binding = capabilities.require("agent.provider/v1", slot="agent.execution")
|
|
520
522
|
provider = provider_binding.runtime
|
|
521
523
|
if not isinstance(provider, ExecutableAgentProvider):
|
|
522
524
|
raise PluginHostError(
|
|
@@ -541,15 +543,11 @@ class PluginHost:
|
|
|
541
543
|
try:
|
|
542
544
|
await activation.start()
|
|
543
545
|
except Exception as error: # noqa: BLE001 - activation boundary
|
|
544
|
-
raise PluginHostError(
|
|
545
|
-
"agent_activation_start_failed", str(error)
|
|
546
|
-
) from error
|
|
546
|
+
raise PluginHostError("agent_activation_start_failed", str(error)) from error
|
|
547
547
|
try:
|
|
548
548
|
healthy = await activation.health()
|
|
549
549
|
except Exception as error: # noqa: BLE001 - activation boundary
|
|
550
|
-
raise PluginHostError(
|
|
551
|
-
"agent_activation_health_failed", str(error)
|
|
552
|
-
) from error
|
|
550
|
+
raise PluginHostError("agent_activation_health_failed", str(error)) from error
|
|
553
551
|
if not healthy:
|
|
554
552
|
raise PluginHostError(
|
|
555
553
|
"agent_activation_health_failed",
|
|
@@ -572,15 +570,18 @@ class PluginHost:
|
|
|
572
570
|
request: Any,
|
|
573
571
|
) -> Any:
|
|
574
572
|
async with active.operation_lock:
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
"agent_activation_closed",
|
|
578
|
-
f"Agent activation {active.key!r} is closed",
|
|
579
|
-
)
|
|
573
|
+
task = asyncio.current_task()
|
|
574
|
+
active.operation_task = task
|
|
580
575
|
try:
|
|
576
|
+
if active.closed:
|
|
577
|
+
raise PluginHostError(
|
|
578
|
+
"agent_activation_closed",
|
|
579
|
+
f"Agent activation {active.key!r} is closed",
|
|
580
|
+
)
|
|
581
581
|
result = await active.runtime.execute(request)
|
|
582
582
|
except asyncio.CancelledError:
|
|
583
|
-
|
|
583
|
+
if not active.closed:
|
|
584
|
+
await self._dispose_activation(active.runtime)
|
|
584
585
|
active.closed = True
|
|
585
586
|
raise
|
|
586
587
|
except PluginHostError as error:
|
|
@@ -594,6 +595,9 @@ class PluginHost:
|
|
|
594
595
|
await self._dispose_activation(active.runtime)
|
|
595
596
|
active.closed = True
|
|
596
597
|
raise failure from error
|
|
598
|
+
finally:
|
|
599
|
+
if active.operation_task is task:
|
|
600
|
+
active.operation_task = None
|
|
597
601
|
self._last_failure = None
|
|
598
602
|
return result
|
|
599
603
|
|
|
@@ -623,28 +627,86 @@ class PluginHost:
|
|
|
623
627
|
return adapter
|
|
624
628
|
|
|
625
629
|
async def _close_activation_record(self, active: _ActiveActivation) -> None:
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
630
|
+
await self._finish_cleanup(self._close_activation_record_owned(active))
|
|
631
|
+
|
|
632
|
+
async def _close_activation_record_owned(self, active: _ActiveActivation) -> None:
|
|
633
|
+
"""Finish the entire terminal close before propagating caller cancellation."""
|
|
634
|
+
|
|
635
|
+
if active.closed and active.operation_task is None:
|
|
636
|
+
return
|
|
637
|
+
active.closed = True
|
|
638
|
+
operation = active.operation_task
|
|
639
|
+
await self._abort_activation(active.runtime)
|
|
640
|
+
if operation is not None and operation is not asyncio.current_task():
|
|
641
|
+
operation.cancel()
|
|
642
|
+
try:
|
|
643
|
+
await asyncio.wait_for(active.operation_lock.acquire(), timeout=2.0)
|
|
644
|
+
except TimeoutError:
|
|
645
|
+
await self._bounded_dispose_activation(active.runtime)
|
|
646
|
+
return
|
|
647
|
+
try:
|
|
648
|
+
await self._bounded_dispose_activation(active.runtime)
|
|
649
|
+
finally:
|
|
650
|
+
active.operation_lock.release()
|
|
651
|
+
|
|
652
|
+
@staticmethod
|
|
653
|
+
async def _abort_activation(activation: PreparedAgent) -> None:
|
|
654
|
+
"""Finish provider revocation before a close can report success.
|
|
655
|
+
|
|
656
|
+
``abort`` is currently implemented only by the Harness activation and
|
|
657
|
+
revokes activation-scoped MCP credentials. A host-side timeout would
|
|
658
|
+
let close return while those credentials still authorize requests.
|
|
659
|
+
The underlying DSH lifecycle operation owns its network timeout and
|
|
660
|
+
kills the whole generation when revocation cannot be proven.
|
|
661
|
+
"""
|
|
662
|
+
|
|
663
|
+
abort = getattr(activation, "abort", None)
|
|
664
|
+
if not callable(abort):
|
|
665
|
+
return
|
|
666
|
+
try:
|
|
667
|
+
result = abort()
|
|
668
|
+
if asyncio.iscoroutine(result):
|
|
669
|
+
await result
|
|
670
|
+
except BaseException: # abort is best-effort; disposal still follows
|
|
671
|
+
pass
|
|
672
|
+
|
|
673
|
+
@classmethod
|
|
674
|
+
async def _bounded_dispose_activation(cls, activation: PreparedAgent) -> None:
|
|
675
|
+
try:
|
|
676
|
+
await asyncio.wait_for(cls._dispose_activation(activation), timeout=2.0)
|
|
677
|
+
except BaseException: # terminal close cannot wait forever on provider code
|
|
678
|
+
pass
|
|
631
679
|
|
|
632
680
|
async def _close_graph_activations(self, graph: _ActiveGraph) -> None:
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
681
|
+
selected = [
|
|
682
|
+
(key, active)
|
|
683
|
+
for key, active in tuple(self._activations.items())
|
|
684
|
+
if active.graph is graph
|
|
685
|
+
]
|
|
686
|
+
if selected:
|
|
687
|
+
await asyncio.gather(
|
|
688
|
+
*(self._close_activation_record(active) for _key, active in selected)
|
|
689
|
+
)
|
|
690
|
+
for key, active in selected:
|
|
637
691
|
if self._activations.get(key) is active:
|
|
638
692
|
self._activations.pop(key, None)
|
|
639
693
|
|
|
640
694
|
async def _close_all_activations(self) -> None:
|
|
641
|
-
|
|
642
|
-
|
|
695
|
+
selected = tuple(self._activations.items())
|
|
696
|
+
if selected:
|
|
697
|
+
await asyncio.gather(
|
|
698
|
+
*(self._close_activation_record(active) for _key, active in selected)
|
|
699
|
+
)
|
|
700
|
+
for key, active in selected:
|
|
643
701
|
if self._activations.get(key) is active:
|
|
644
702
|
self._activations.pop(key, None)
|
|
645
703
|
|
|
646
704
|
@staticmethod
|
|
647
|
-
def _execution_context(
|
|
705
|
+
def _execution_context(
|
|
706
|
+
graph: _ActiveGraph,
|
|
707
|
+
*,
|
|
708
|
+
activation_key: str = "",
|
|
709
|
+
) -> PluginExecutionContext:
|
|
648
710
|
bindings = tuple(
|
|
649
711
|
PluginCapabilityBinding(
|
|
650
712
|
plugin_id=plugin.entry.id,
|
|
@@ -660,6 +722,7 @@ class PluginHost:
|
|
|
660
722
|
profile_digest=graph.resolved.profile_digest,
|
|
661
723
|
plugin_lock_digest=graph.resolved.plugin_lock_digest,
|
|
662
724
|
bindings=bindings,
|
|
725
|
+
activation_key=activation_key,
|
|
663
726
|
)
|
|
664
727
|
|
|
665
728
|
@staticmethod
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"""Provider-neutral AgentKernel adapter for PluginHost runtimes."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import asyncio
|
|
6
|
+
from collections.abc import Awaitable, Callable
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from ksadk.kernel.contracts import InjectPayload, SteerPayload
|
|
10
|
+
from ksadk.kernel.errors import UnsupportedControlError
|
|
11
|
+
from ksadk.runtime import (
|
|
12
|
+
BaseRuntime,
|
|
13
|
+
CancelResult,
|
|
14
|
+
CheckpointDescriptor,
|
|
15
|
+
PauseResult,
|
|
16
|
+
ResumePayload,
|
|
17
|
+
ResumeTarget,
|
|
18
|
+
RunHandle,
|
|
19
|
+
RuntimeAdapter,
|
|
20
|
+
StartRequest,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
BindDelegate = Callable[[str], Awaitable[RuntimeAdapter]]
|
|
24
|
+
ReleaseBinding = Callable[[str], Awaitable[None]]
|
|
25
|
+
|
|
26
|
+
_PROVIDER_RUNTIME_TYPE_KEY = "_ksadk_plugin_provider_runtime_type"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class _PluginKernelRuntime(BaseRuntime):
|
|
30
|
+
def __init__(self, runtime_type: str) -> None:
|
|
31
|
+
self.runtime_type = runtime_type
|
|
32
|
+
|
|
33
|
+
def native_capabilities(self) -> dict[str, Any]:
|
|
34
|
+
return {
|
|
35
|
+
"provider_owned": True,
|
|
36
|
+
"runtime_adapter": True,
|
|
37
|
+
"session_continuity": {"durable": False, "scope": "process"},
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class PluginKernelAdapter(RuntimeAdapter):
|
|
42
|
+
"""Expose a lazily activated Agent Provider through the Kernel contract."""
|
|
43
|
+
|
|
44
|
+
def __init__(
|
|
45
|
+
self,
|
|
46
|
+
*,
|
|
47
|
+
runtime_type: str,
|
|
48
|
+
bind_delegate: BindDelegate,
|
|
49
|
+
release_binding: ReleaseBinding,
|
|
50
|
+
) -> None:
|
|
51
|
+
super().__init__(_PluginKernelRuntime(runtime_type))
|
|
52
|
+
self._runtime_type = runtime_type
|
|
53
|
+
self._bind_delegate_callback = bind_delegate
|
|
54
|
+
self._release_binding_callback = release_binding
|
|
55
|
+
self._delegate: RuntimeAdapter | None = None
|
|
56
|
+
self._native_handle: RunHandle | None = None
|
|
57
|
+
|
|
58
|
+
async def start(self, request: StartRequest) -> RunHandle:
|
|
59
|
+
try:
|
|
60
|
+
delegate = await self._bind_delegate(request.session_id)
|
|
61
|
+
metadata = dict(request.metadata)
|
|
62
|
+
if not metadata.get("invocation_id") and metadata.get("run_id"):
|
|
63
|
+
metadata["invocation_id"] = metadata["run_id"]
|
|
64
|
+
native_handle = await delegate.start(
|
|
65
|
+
request.model_copy(update={"metadata": metadata})
|
|
66
|
+
)
|
|
67
|
+
self._native_handle = native_handle
|
|
68
|
+
return self._outer_handle(native_handle)
|
|
69
|
+
except BaseException:
|
|
70
|
+
await self._release_failed_binding(request.session_id)
|
|
71
|
+
raise
|
|
72
|
+
|
|
73
|
+
def stream(self, handle: RunHandle): # type: ignore[no-untyped-def]
|
|
74
|
+
return self._require_delegate().stream(self._provider_handle(handle))
|
|
75
|
+
|
|
76
|
+
async def cancel(self, handle: RunHandle) -> CancelResult:
|
|
77
|
+
return await self._require_delegate().cancel(self._provider_handle(handle))
|
|
78
|
+
|
|
79
|
+
async def pause(self, handle: RunHandle) -> PauseResult:
|
|
80
|
+
return await self._require_delegate().pause(self._provider_handle(handle))
|
|
81
|
+
|
|
82
|
+
async def submit(self, handle: RunHandle, payload: ResumePayload) -> None:
|
|
83
|
+
await self._require_delegate().submit(self._provider_handle(handle), payload)
|
|
84
|
+
|
|
85
|
+
async def resume(
|
|
86
|
+
self,
|
|
87
|
+
handle: RunHandle,
|
|
88
|
+
target: ResumeTarget,
|
|
89
|
+
payload: ResumePayload | None,
|
|
90
|
+
) -> RunHandle:
|
|
91
|
+
native_handle = await self._require_delegate().resume(
|
|
92
|
+
self._provider_handle(handle), target, payload
|
|
93
|
+
)
|
|
94
|
+
self._native_handle = native_handle
|
|
95
|
+
return self._outer_handle(native_handle)
|
|
96
|
+
|
|
97
|
+
async def attach(self, handle: RunHandle) -> RunHandle:
|
|
98
|
+
try:
|
|
99
|
+
delegate = await self._bind_delegate(handle.session_id)
|
|
100
|
+
native_handle = await delegate.attach(self._provider_handle(handle))
|
|
101
|
+
self._native_handle = native_handle
|
|
102
|
+
return self._outer_handle(native_handle)
|
|
103
|
+
except BaseException:
|
|
104
|
+
await self._release_failed_binding(handle.session_id)
|
|
105
|
+
raise
|
|
106
|
+
|
|
107
|
+
async def steer(self, handle: RunHandle, payload: SteerPayload) -> None:
|
|
108
|
+
await self._require_delegate().steer(self._provider_handle(handle), payload)
|
|
109
|
+
|
|
110
|
+
async def inject(self, handle: RunHandle, payload: InjectPayload) -> None:
|
|
111
|
+
await self._require_delegate().inject(self._provider_handle(handle), payload)
|
|
112
|
+
|
|
113
|
+
async def checkpoint(self, handle: RunHandle) -> CheckpointDescriptor:
|
|
114
|
+
return await self._require_delegate().checkpoint(self._provider_handle(handle))
|
|
115
|
+
|
|
116
|
+
async def durable_restore(self, handle: RunHandle) -> RunHandle:
|
|
117
|
+
try:
|
|
118
|
+
delegate = await self._bind_delegate(handle.session_id)
|
|
119
|
+
native_handle = await delegate.durable_restore(
|
|
120
|
+
self._provider_handle(handle)
|
|
121
|
+
)
|
|
122
|
+
self._native_handle = native_handle
|
|
123
|
+
return self._outer_handle(native_handle)
|
|
124
|
+
except BaseException:
|
|
125
|
+
await self._release_failed_binding(handle.session_id)
|
|
126
|
+
raise
|
|
127
|
+
|
|
128
|
+
def is_handle_attached(self, handle: RunHandle) -> bool:
|
|
129
|
+
return self._delegate is not None and self._delegate.is_handle_attached(
|
|
130
|
+
self._provider_handle(handle)
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
async def close(self, handle: RunHandle) -> None:
|
|
134
|
+
try:
|
|
135
|
+
await self._require_delegate().close(self._provider_handle(handle))
|
|
136
|
+
finally:
|
|
137
|
+
await self._release_binding_callback(handle.session_id)
|
|
138
|
+
|
|
139
|
+
def capabilities(self): # type: ignore[no-untyped-def]
|
|
140
|
+
# Provider activation is asynchronous, so admission is deliberately
|
|
141
|
+
# conservative until a session has bound its delegate.
|
|
142
|
+
if self._delegate is None:
|
|
143
|
+
return super().capabilities()
|
|
144
|
+
return self._delegate.capabilities()
|
|
145
|
+
|
|
146
|
+
def _require_delegate(self) -> RuntimeAdapter:
|
|
147
|
+
if self._delegate is None:
|
|
148
|
+
raise UnsupportedControlError(
|
|
149
|
+
"PluginHost RuntimeAdapter has not started a provider activation"
|
|
150
|
+
)
|
|
151
|
+
return self._delegate
|
|
152
|
+
|
|
153
|
+
async def _bind_delegate(self, session_id: str) -> RuntimeAdapter:
|
|
154
|
+
delegate = await self._bind_delegate_callback(session_id)
|
|
155
|
+
if not isinstance(delegate, RuntimeAdapter):
|
|
156
|
+
raise RuntimeError("AgentProvider returned an invalid RuntimeAdapter")
|
|
157
|
+
self._delegate = delegate
|
|
158
|
+
return delegate
|
|
159
|
+
|
|
160
|
+
def _outer_handle(self, handle: RunHandle) -> RunHandle:
|
|
161
|
+
native_ref = dict(handle.native_ref)
|
|
162
|
+
native_ref[_PROVIDER_RUNTIME_TYPE_KEY] = handle.runtime_type
|
|
163
|
+
return handle.model_copy(
|
|
164
|
+
update={"runtime_type": self._runtime_type, "native_ref": native_ref}
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
def _provider_handle(self, handle: RunHandle) -> RunHandle:
|
|
168
|
+
cached = self._native_handle
|
|
169
|
+
if (
|
|
170
|
+
cached is not None
|
|
171
|
+
and cached.run_id == handle.run_id
|
|
172
|
+
and cached.session_id == handle.session_id
|
|
173
|
+
):
|
|
174
|
+
return cached
|
|
175
|
+
native_ref = dict(handle.native_ref)
|
|
176
|
+
runtime_type = str(native_ref.pop(_PROVIDER_RUNTIME_TYPE_KEY, "")).strip()
|
|
177
|
+
if not runtime_type:
|
|
178
|
+
runtime_type = self._require_delegate().runtime.runtime_type
|
|
179
|
+
return handle.model_copy(
|
|
180
|
+
update={"runtime_type": runtime_type, "native_ref": native_ref}
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
async def _release_failed_binding(self, session_id: str) -> None:
|
|
184
|
+
"""Close a partially opened activation even under cancellation."""
|
|
185
|
+
|
|
186
|
+
self._delegate = None
|
|
187
|
+
self._native_handle = None
|
|
188
|
+
cleanup = asyncio.create_task(self._release_binding_callback(session_id))
|
|
189
|
+
interrupted = False
|
|
190
|
+
while not cleanup.done():
|
|
191
|
+
try:
|
|
192
|
+
await asyncio.shield(cleanup)
|
|
193
|
+
except asyncio.CancelledError:
|
|
194
|
+
interrupted = True
|
|
195
|
+
try:
|
|
196
|
+
cleanup.result()
|
|
197
|
+
except Exception:
|
|
198
|
+
# Preserve the provider/delegate failure. Its owner still gets the
|
|
199
|
+
# terminal suspend path for disposing a host that could not close.
|
|
200
|
+
pass
|
|
201
|
+
if interrupted:
|
|
202
|
+
raise asyncio.CancelledError
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
__all__ = ["BindDelegate", "PluginKernelAdapter", "ReleaseBinding"]
|
|
@@ -46,6 +46,29 @@ _EXPORTS = {
|
|
|
46
46
|
"DshAgentProviderRuntime": ("dsh", "DshAgentProviderRuntime"),
|
|
47
47
|
"DshPreparedAgent": ("dsh", "DshPreparedAgent"),
|
|
48
48
|
"dsh_agent_provider_manifest": ("dsh", "dsh_agent_provider_manifest"),
|
|
49
|
+
"DSH_CAPABILITY_BUNDLE_PACKAGE": (
|
|
50
|
+
"dsh_capabilities",
|
|
51
|
+
"DSH_CAPABILITY_BUNDLE_PACKAGE",
|
|
52
|
+
),
|
|
53
|
+
"DSH_CAPABILITY_HOST_PROTOCOL": ("dsh_capabilities", "DSH_CAPABILITY_HOST_PROTOCOL"),
|
|
54
|
+
"DSH_CAPABILITY_HOST_VERSION": ("dsh_capabilities", "DSH_CAPABILITY_HOST_VERSION"),
|
|
55
|
+
"DshCapabilityTool": ("dsh_capabilities", "DshCapabilityTool"),
|
|
56
|
+
"DshMcpConnectorLease": ("dsh_capabilities", "DshMcpConnectorLease"),
|
|
57
|
+
"DshProfileCapabilityDescriptor": (
|
|
58
|
+
"dsh_capabilities",
|
|
59
|
+
"DshProfileCapabilityDescriptor",
|
|
60
|
+
),
|
|
61
|
+
"DshProfileCapabilityHost": ("dsh_capabilities", "DshProfileCapabilityHost"),
|
|
62
|
+
"DshProfileCapabilityInventory": (
|
|
63
|
+
"dsh_capabilities",
|
|
64
|
+
"DshProfileCapabilityInventory",
|
|
65
|
+
),
|
|
66
|
+
"load_dsh_capability_bundle": ("dsh_capabilities", "load_dsh_capability_bundle"),
|
|
67
|
+
"DSH_PROFILE_MCP_PLUGIN_ID": ("dsh_mcp", "DSH_PROFILE_MCP_PLUGIN_ID"),
|
|
68
|
+
"DSH_PROFILE_MCP_PLUGIN_VERSION": ("dsh_mcp", "DSH_PROFILE_MCP_PLUGIN_VERSION"),
|
|
69
|
+
"DshProfileMCPFactory": ("dsh_mcp", "DshProfileMCPFactory"),
|
|
70
|
+
"DshProfileMCPRuntime": ("dsh_mcp", "DshProfileMCPRuntime"),
|
|
71
|
+
"dsh_profile_mcp_manifest": ("dsh_mcp", "dsh_profile_mcp_manifest"),
|
|
49
72
|
"HarnessContextSource": ("harness", "HarnessContextSource"),
|
|
50
73
|
"HarnessMCPSource": ("harness", "HarnessMCPSource"),
|
|
51
74
|
"HarnessProviderInventory": ("harness", "HarnessProviderInventory"),
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export const name = 'dsh-knowledge'
|
|
2
|
+
export const inject = ['tools', 'platformResources']
|
|
3
|
+
|
|
4
|
+
export function apply(ctx) {
|
|
5
|
+
ctx.effect(() => ctx.platformResources.registerTool('search_knowledge_base', 'search_knowledge_base'))
|
|
6
|
+
ctx.tools.register({
|
|
7
|
+
name: 'search_knowledge_base',
|
|
8
|
+
description: 'Search the knowledge base bound to this Agent and return document sources.',
|
|
9
|
+
parameters: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
query: { type: 'string', description: 'Non-empty query, at most 16000 characters.' },
|
|
13
|
+
top_k: { type: 'integer', description: 'Positive result count, capped by the binding policy.' },
|
|
14
|
+
},
|
|
15
|
+
required: ['query'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
},
|
|
18
|
+
output: {
|
|
19
|
+
schema: {
|
|
20
|
+
type: 'object',
|
|
21
|
+
properties: {
|
|
22
|
+
status: { type: 'string', enum: ['ok', 'empty', 'failed'] },
|
|
23
|
+
bindingId: { type: 'string' },
|
|
24
|
+
items: { type: 'array', items: {
|
|
25
|
+
type: 'object',
|
|
26
|
+
properties: {
|
|
27
|
+
documentId: { type: 'string' }, documentName: { type: 'string' },
|
|
28
|
+
segmentId: { type: 'string' }, content: { type: 'string' }, score: { type: 'number' },
|
|
29
|
+
},
|
|
30
|
+
required: ['documentId', 'documentName', 'segmentId', 'content', 'score'],
|
|
31
|
+
additionalProperties: false,
|
|
32
|
+
} },
|
|
33
|
+
truncated: { type: 'boolean' }, requestId: { type: 'string' },
|
|
34
|
+
errorCode: { oneOf: [
|
|
35
|
+
{ type: 'string', enum: ['KNOWLEDGE_RETRIEVAL_FAILED', 'RESOURCE_FORBIDDEN'] }, { type: 'null' },
|
|
36
|
+
] },
|
|
37
|
+
},
|
|
38
|
+
required: ['status', 'bindingId', 'items', 'truncated', 'requestId'],
|
|
39
|
+
additionalProperties: false,
|
|
40
|
+
},
|
|
41
|
+
render(_args, result) {
|
|
42
|
+
const text = result.status === 'failed' ? 'Knowledge retrieval failed.'
|
|
43
|
+
: result.status === 'empty' ? 'No matching knowledge found.'
|
|
44
|
+
: result.items.map(item => `[${item.documentName || item.documentId}] ${item.content}`).join('\n\n')
|
|
45
|
+
return [{ type: 'text', text }]
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
isConcurrencySafe: () => true,
|
|
49
|
+
execute(args, execution) {
|
|
50
|
+
return ctx.platformResources.call('search_knowledge_base', args, { signal: execution.signal })
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kingsoftcloud/dsh-knowledge",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Private development bundle for Agent-bound knowledge retrieval",
|
|
7
|
+
"exports": {".": "./index.mjs", "./cordis.patch.yml": "./cordis.patch.yml"},
|
|
8
|
+
"files": ["index.mjs", "cordis.patch.yml"],
|
|
9
|
+
"engines": {"node": ">=22.19.0"},
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
12
|
+
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
|
|
13
|
+
"@kingsoftcloud/dsh-platform-resources": "0.1.0"
|
|
14
|
+
},
|
|
15
|
+
"dsh": {"bundle": {"patch": "./cordis.patch.yml"}}
|
|
16
|
+
}
|