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
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""Static resource checks shared by Studio validation and the actual Build entry."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Sequence
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from ksadk.resource_runtime.plugin_config import resource_plugin_config
|
|
7
|
+
from ksadk.resource_runtime.snapshots import MemoryRecallPolicy
|
|
8
|
+
from ksadk.studio.contracts import Diagnostic, DiagnosticSeverity, MemorySpec
|
|
9
|
+
from ksadk.studio.errors import StudioError
|
|
10
|
+
from ksadk.studio.resource_connections import ResourceConnectionRepository
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def resource_binding_diagnostics(
|
|
14
|
+
bindings: Sequence[Any],
|
|
15
|
+
memory: MemorySpec | None,
|
|
16
|
+
connections: ResourceConnectionRepository,
|
|
17
|
+
) -> list[Diagnostic]:
|
|
18
|
+
diagnostics = []
|
|
19
|
+
for index, binding in enumerate(bindings):
|
|
20
|
+
if not binding.enabled:
|
|
21
|
+
continue
|
|
22
|
+
config = resource_plugin_config(
|
|
23
|
+
binding.plugin_ref,
|
|
24
|
+
binding.ecosystem,
|
|
25
|
+
binding.config,
|
|
26
|
+
enabled=True,
|
|
27
|
+
)
|
|
28
|
+
if config is None:
|
|
29
|
+
continue
|
|
30
|
+
field = f"spec.bindings.plugins[{index}].config"
|
|
31
|
+
try:
|
|
32
|
+
connection = connections.get(config.binding.connection_ref)
|
|
33
|
+
# Only confirm referenced secrets exist; no network or identity claims.
|
|
34
|
+
connections.resolve_credentials(connection.target)
|
|
35
|
+
except StudioError as error:
|
|
36
|
+
diagnostics.append(
|
|
37
|
+
Diagnostic(
|
|
38
|
+
severity=DiagnosticSeverity.ERROR,
|
|
39
|
+
code=error.code,
|
|
40
|
+
message=error.message,
|
|
41
|
+
field=field + ".binding.connectionRef",
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
if (
|
|
45
|
+
config.binding.resource.kind == "memory-instance"
|
|
46
|
+
and memory is not None
|
|
47
|
+
and memory.enabled
|
|
48
|
+
):
|
|
49
|
+
if memory.provider_ref != f"binding://{config.binding.id}":
|
|
50
|
+
diagnostics.append(
|
|
51
|
+
Diagnostic(
|
|
52
|
+
severity=DiagnosticSeverity.ERROR,
|
|
53
|
+
code="MEMORY_BINDING_MISMATCH",
|
|
54
|
+
message="记忆策略必须引用当前记忆插件绑定",
|
|
55
|
+
field="spec.memory.providerRef",
|
|
56
|
+
)
|
|
57
|
+
)
|
|
58
|
+
try:
|
|
59
|
+
MemoryRecallPolicy.model_validate(memory.recall.model_dump(exclude={"enabled"}))
|
|
60
|
+
except ValueError:
|
|
61
|
+
diagnostics.append(
|
|
62
|
+
Diagnostic(
|
|
63
|
+
severity=DiagnosticSeverity.ERROR,
|
|
64
|
+
code="MEMORY_SEARCH_POLICY_UNSUPPORTED",
|
|
65
|
+
message="记忆后端不支持当前召回阈值或预算,请调整策略",
|
|
66
|
+
field="spec.memory.recall",
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
diagnostics.append(
|
|
70
|
+
Diagnostic(
|
|
71
|
+
severity=DiagnosticSeverity.WARNING,
|
|
72
|
+
code="RESOURCE_AUTHORITY_UNVERIFIED",
|
|
73
|
+
message="本次仅校验连接声明与凭证引用,尚未验证平台主体和资源权限",
|
|
74
|
+
field=field + ".binding",
|
|
75
|
+
)
|
|
76
|
+
)
|
|
77
|
+
return diagnostics
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"""Trusted admission input for immutable platform-resource Build materialization."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass, field
|
|
6
|
+
from datetime import datetime, timezone
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Protocol
|
|
9
|
+
|
|
10
|
+
from ksadk.plugins.bridges.dsh import DshProfileBuildSnapshot
|
|
11
|
+
from ksadk.resource_runtime.contracts import ResourceConfig
|
|
12
|
+
from ksadk.resource_runtime.plugin_config import resource_plugin_config
|
|
13
|
+
from ksadk.resource_runtime.snapshots import (
|
|
14
|
+
FrozenResourceBinding,
|
|
15
|
+
MemoryRecallPolicy,
|
|
16
|
+
ResourceSnapshot,
|
|
17
|
+
)
|
|
18
|
+
from ksadk.studio.capabilities import canonical_json, sha256_digest
|
|
19
|
+
from ksadk.studio.contracts import AgentDraft, MemorySpec, NativePluginBinding
|
|
20
|
+
from ksadk.studio.errors import StudioError
|
|
21
|
+
from ksadk.studio.resource_authority import (
|
|
22
|
+
VerifiedResourceAuthority,
|
|
23
|
+
resource_allowed_operations,
|
|
24
|
+
)
|
|
25
|
+
from ksadk.studio.resource_build_materializer import materialize_resource_build
|
|
26
|
+
from ksadk.studio.resource_connections import ResourceConnectionRepository
|
|
27
|
+
|
|
28
|
+
_RESOURCE_BUNDLES = {
|
|
29
|
+
"knowledge-base": "@kingsoftcloud/dsh-knowledge",
|
|
30
|
+
"memory-instance": "@kingsoftcloud/dsh-memory",
|
|
31
|
+
"skill-space": "@kingsoftcloud/dsh-skill-center",
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class ResourceAuthority(Protocol):
|
|
36
|
+
def admit(
|
|
37
|
+
self,
|
|
38
|
+
config: ResourceConfig,
|
|
39
|
+
*,
|
|
40
|
+
expected_connection_revision: int | None = None,
|
|
41
|
+
) -> VerifiedResourceAuthority: ...
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@dataclass(frozen=True)
|
|
45
|
+
class AdmittedResourceBuild:
|
|
46
|
+
"""Credential-free snapshot plus private materialization dependencies."""
|
|
47
|
+
|
|
48
|
+
snapshot: ResourceSnapshot
|
|
49
|
+
bindings: tuple[NativePluginBinding, ...]
|
|
50
|
+
memory: MemorySpec
|
|
51
|
+
connections: ResourceConnectionRepository = field(repr=False, compare=False)
|
|
52
|
+
|
|
53
|
+
def materialize(self, directory: Path):
|
|
54
|
+
return materialize_resource_build(
|
|
55
|
+
directory,
|
|
56
|
+
bindings=self.bindings,
|
|
57
|
+
memory=self.memory,
|
|
58
|
+
admitted_snapshot=self.snapshot,
|
|
59
|
+
connections=self.connections,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def admit_resource_build(
|
|
64
|
+
draft: AgentDraft,
|
|
65
|
+
*,
|
|
66
|
+
authority: ResourceAuthority | None,
|
|
67
|
+
connections: ResourceConnectionRepository,
|
|
68
|
+
dsh_profile: DshProfileBuildSnapshot | None,
|
|
69
|
+
) -> AdmittedResourceBuild | None:
|
|
70
|
+
"""Admit enabled official resources without trusting browser-supplied identity."""
|
|
71
|
+
|
|
72
|
+
selected: list[tuple[NativePluginBinding, ResourceConfig]] = []
|
|
73
|
+
for binding in draft.spec.bindings.plugins:
|
|
74
|
+
if not binding.enabled:
|
|
75
|
+
continue
|
|
76
|
+
config = resource_plugin_config(
|
|
77
|
+
binding.plugin_ref,
|
|
78
|
+
binding.ecosystem,
|
|
79
|
+
binding.config,
|
|
80
|
+
enabled=True,
|
|
81
|
+
)
|
|
82
|
+
if config is not None:
|
|
83
|
+
selected.append((binding, config))
|
|
84
|
+
if not selected:
|
|
85
|
+
return None
|
|
86
|
+
if authority is None:
|
|
87
|
+
raise StudioError(
|
|
88
|
+
"RESOURCE_AUTHORITY_REQUIRED",
|
|
89
|
+
"平台资源 Build 需要宿主配置可信身份与权限校验",
|
|
90
|
+
status_code=503,
|
|
91
|
+
field="spec.bindings.plugins",
|
|
92
|
+
)
|
|
93
|
+
if dsh_profile is None:
|
|
94
|
+
raise StudioError(
|
|
95
|
+
"RESOURCE_BUILD_PROFILE_REQUIRED",
|
|
96
|
+
"平台资源 Build 需要锁定当前 DSH Profile 安装快照",
|
|
97
|
+
status_code=503,
|
|
98
|
+
field="spec.bindings.plugins",
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
required_bundles = {
|
|
102
|
+
_RESOURCE_BUNDLES[config.binding.resource.kind]
|
|
103
|
+
for _, config in selected
|
|
104
|
+
}
|
|
105
|
+
missing_bundles = sorted(required_bundles - set(dsh_profile.projection.bundles))
|
|
106
|
+
if missing_bundles:
|
|
107
|
+
raise StudioError(
|
|
108
|
+
"RESOURCE_PLUGIN_NOT_INSTALLED",
|
|
109
|
+
"当前 DSH Profile 未安装并启用所绑定的平台资源插件",
|
|
110
|
+
status_code=409,
|
|
111
|
+
field="spec.bindings.plugins",
|
|
112
|
+
details={"missingBundles": missing_bundles},
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
frozen: list[FrozenResourceBinding] = []
|
|
116
|
+
for binding, config in selected:
|
|
117
|
+
record = connections.get(config.binding.connection_ref)
|
|
118
|
+
grant = authority.admit(config, expected_connection_revision=record.revision)
|
|
119
|
+
current = connections.get(config.binding.connection_ref)
|
|
120
|
+
if current != record:
|
|
121
|
+
raise StudioError(
|
|
122
|
+
"RESOURCE_CONNECTION_CHANGED",
|
|
123
|
+
"资源准入期间连接发生变化,请重新构建",
|
|
124
|
+
status_code=409,
|
|
125
|
+
)
|
|
126
|
+
if (
|
|
127
|
+
grant.connection_ref != record.target.connection_ref
|
|
128
|
+
or grant.connection_revision != record.revision
|
|
129
|
+
or grant.tenant_ref != record.target.tenant_ref
|
|
130
|
+
or grant.resource_principal_ref != record.target.principal_ref
|
|
131
|
+
or grant.resource != config.binding.resource
|
|
132
|
+
or grant.data_endpoint != record.target.endpoint
|
|
133
|
+
or grant.expires_at <= datetime.now(timezone.utc)
|
|
134
|
+
or tuple(grant.allowed_operations) != resource_allowed_operations(config)
|
|
135
|
+
):
|
|
136
|
+
raise StudioError(
|
|
137
|
+
"RESOURCE_AUTHORITY_INVALID",
|
|
138
|
+
"平台资源准入结果与当前绑定不一致",
|
|
139
|
+
status_code=409,
|
|
140
|
+
field="spec.bindings.plugins",
|
|
141
|
+
)
|
|
142
|
+
frozen.append(
|
|
143
|
+
FrozenResourceBinding(
|
|
144
|
+
config=config,
|
|
145
|
+
connection=record.target,
|
|
146
|
+
connection_revision=record.revision,
|
|
147
|
+
memory_recall=(
|
|
148
|
+
MemoryRecallPolicy.model_validate(
|
|
149
|
+
draft.spec.memory.recall.model_dump(exclude={"enabled"})
|
|
150
|
+
)
|
|
151
|
+
if config.binding.resource.kind == "memory-instance"
|
|
152
|
+
and draft.spec.memory.enabled
|
|
153
|
+
else None
|
|
154
|
+
),
|
|
155
|
+
)
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
native_lock = [
|
|
159
|
+
{
|
|
160
|
+
"pluginRef": binding.plugin_ref,
|
|
161
|
+
"ecosystem": binding.ecosystem,
|
|
162
|
+
"snapshotDigest": binding.snapshot_digest,
|
|
163
|
+
"components": sorted(binding.components),
|
|
164
|
+
"configDigest": config.digest,
|
|
165
|
+
}
|
|
166
|
+
for binding, config in selected
|
|
167
|
+
]
|
|
168
|
+
native_lock.sort(key=lambda item: item["pluginRef"])
|
|
169
|
+
snapshot = ResourceSnapshot(
|
|
170
|
+
plugin_lock_digest=sha256_digest(canonical_json(native_lock)),
|
|
171
|
+
bindings=tuple(frozen),
|
|
172
|
+
dsh_profile=dsh_profile,
|
|
173
|
+
)
|
|
174
|
+
return AdmittedResourceBuild(
|
|
175
|
+
snapshot=snapshot,
|
|
176
|
+
bindings=tuple(binding for binding, _ in selected),
|
|
177
|
+
memory=draft.spec.memory.model_copy(deep=True),
|
|
178
|
+
connections=connections,
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def resource_build_required(draft: AgentDraft) -> bool:
|
|
183
|
+
return any(
|
|
184
|
+
binding.enabled
|
|
185
|
+
and resource_plugin_config(
|
|
186
|
+
binding.plugin_ref,
|
|
187
|
+
binding.ecosystem,
|
|
188
|
+
binding.config,
|
|
189
|
+
enabled=True,
|
|
190
|
+
)
|
|
191
|
+
is not None
|
|
192
|
+
for binding in draft.spec.bindings.plugins
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
__all__ = ["AdmittedResourceBuild", "admit_resource_build", "resource_build_required"]
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"""Produce resource files inside a caller-owned Build staging directory.
|
|
2
|
+
|
|
3
|
+
The trusted Build adapter supplies a snapshot after identity, permission, plugin
|
|
4
|
+
lock and engine admission. This producer cannot authorize a browser declaration
|
|
5
|
+
and is deliberately not exposed as a standalone API or artifact repository.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import tempfile
|
|
11
|
+
from collections.abc import Sequence
|
|
12
|
+
from dataclasses import replace
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
from ksadk.resource_runtime.build_artifacts import ResourceBuildReference, write_resource_build
|
|
16
|
+
from ksadk.resource_runtime.plugin_config import resource_plugin_config
|
|
17
|
+
from ksadk.resource_runtime.snapshots import MemoryRecallPolicy, ResourceSnapshot
|
|
18
|
+
from ksadk.skills.models import ContentHash
|
|
19
|
+
from ksadk.skills.package_store import PackageStore, SkillPackageError
|
|
20
|
+
from ksadk.skills.service_client import SkillServiceClient
|
|
21
|
+
from ksadk.studio.contracts import MemorySpec, NativePluginBinding
|
|
22
|
+
from ksadk.studio.resource_connections import ResourceConnectionRepository
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def materialize_resource_build(
|
|
26
|
+
directory: Path,
|
|
27
|
+
*,
|
|
28
|
+
bindings: Sequence[NativePluginBinding],
|
|
29
|
+
memory: MemorySpec | None,
|
|
30
|
+
admitted_snapshot: ResourceSnapshot,
|
|
31
|
+
connections: ResourceConnectionRepository,
|
|
32
|
+
) -> ResourceBuildReference:
|
|
33
|
+
"""Validate declaration/admission equality, then retain verified pinned bytes.
|
|
34
|
+
|
|
35
|
+
Connections are rechecked before and after downloads. No test writes or Skill
|
|
36
|
+
execution occur, and no credential or download URL enters the saved artifact.
|
|
37
|
+
The enclosing Build must still lock dependencies and publish atomically.
|
|
38
|
+
"""
|
|
39
|
+
snapshot = ResourceSnapshot.model_validate(admitted_snapshot.model_dump())
|
|
40
|
+
if snapshot.dsh_profile is None:
|
|
41
|
+
raise ValueError("Resource Build requires its admitted DSH profile snapshot")
|
|
42
|
+
configs = []
|
|
43
|
+
for value in bindings:
|
|
44
|
+
binding = NativePluginBinding.model_validate(value.model_dump())
|
|
45
|
+
if not binding.enabled:
|
|
46
|
+
continue
|
|
47
|
+
config = resource_plugin_config(
|
|
48
|
+
binding.plugin_ref,
|
|
49
|
+
binding.ecosystem,
|
|
50
|
+
binding.config,
|
|
51
|
+
enabled=True,
|
|
52
|
+
)
|
|
53
|
+
if config is not None:
|
|
54
|
+
configs.append(config)
|
|
55
|
+
if len(configs) != len(snapshot.bindings) or {
|
|
56
|
+
item.binding.id: item.digest for item in configs
|
|
57
|
+
} != {item.config.binding.id: item.config.digest for item in snapshot.bindings}:
|
|
58
|
+
raise ValueError("Resource declaration does not match admitted Build snapshot")
|
|
59
|
+
credentials = {}
|
|
60
|
+
for frozen in snapshot.bindings:
|
|
61
|
+
config = frozen.config
|
|
62
|
+
if config.include_public:
|
|
63
|
+
raise ValueError("Public Skill Build admission is not implemented")
|
|
64
|
+
if config.execution_mode == "isolated" and frozen.skill_execution is None:
|
|
65
|
+
raise ValueError("Isolated Skill Build requires an admitted execution target")
|
|
66
|
+
recall = None
|
|
67
|
+
if config.binding.resource.kind == "memory-instance" and memory and memory.enabled:
|
|
68
|
+
if memory.provider_ref != f"binding://{config.binding.id}":
|
|
69
|
+
raise ValueError("Memory policy does not match admitted binding")
|
|
70
|
+
recall = MemoryRecallPolicy.model_validate(
|
|
71
|
+
memory.recall.model_dump(exclude={"enabled"})
|
|
72
|
+
)
|
|
73
|
+
if frozen.memory_recall != recall:
|
|
74
|
+
raise ValueError("Memory recall policy does not match admitted Build snapshot")
|
|
75
|
+
credentials[config.binding.id] = connections.resolve_credentials(
|
|
76
|
+
frozen.connection,
|
|
77
|
+
expected_revision=frozen.connection_revision,
|
|
78
|
+
)
|
|
79
|
+
if frozen.skill_execution is not None:
|
|
80
|
+
connections.resolve_credentials(frozen.skill_execution.connection)
|
|
81
|
+
|
|
82
|
+
directory = Path(directory)
|
|
83
|
+
if directory.exists():
|
|
84
|
+
raise FileExistsError("Resource Build staging destination already exists")
|
|
85
|
+
directory.parent.mkdir(parents=True, exist_ok=True)
|
|
86
|
+
with tempfile.TemporaryDirectory(prefix=".resource-packages-", dir=directory.parent) as cache:
|
|
87
|
+
store = PackageStore(Path(cache), namespace=snapshot.digest, require_hash=True)
|
|
88
|
+
packages = {}
|
|
89
|
+
for frozen in snapshot.bindings:
|
|
90
|
+
config = frozen.config
|
|
91
|
+
if (
|
|
92
|
+
config.binding.resource.kind != "skill-space"
|
|
93
|
+
or config.selection_mode == "discovery"
|
|
94
|
+
or not config.selected_skills
|
|
95
|
+
):
|
|
96
|
+
continue
|
|
97
|
+
secret = credentials[config.binding.id]
|
|
98
|
+
if secret.session_token is not None:
|
|
99
|
+
raise ValueError("Skill client does not support STS Build downloads")
|
|
100
|
+
|
|
101
|
+
def reveal(value):
|
|
102
|
+
return value.get_secret_value() if value is not None else ""
|
|
103
|
+
|
|
104
|
+
client = SkillServiceClient(
|
|
105
|
+
base_url=frozen.connection.endpoint,
|
|
106
|
+
region=config.binding.resource.region,
|
|
107
|
+
access_key=reveal(secret.access_key),
|
|
108
|
+
secret_key=reveal(secret.secret_key),
|
|
109
|
+
token=reveal(secret.token),
|
|
110
|
+
allow_env_fallback=False,
|
|
111
|
+
)
|
|
112
|
+
try:
|
|
113
|
+
listing = client.list_skills_by_space_id(config.binding.resource.id)
|
|
114
|
+
if listing.space_id != config.binding.resource.id:
|
|
115
|
+
raise SkillPackageError("Skill catalog does not match admitted space")
|
|
116
|
+
catalog = {}
|
|
117
|
+
for ref in listing.active_skills(allow_partial=True):
|
|
118
|
+
if ref.skill_id in catalog:
|
|
119
|
+
raise SkillPackageError("Skill catalog contains duplicate identities")
|
|
120
|
+
catalog[ref.skill_id] = ref
|
|
121
|
+
selected_packages = []
|
|
122
|
+
for selected in config.selected_skills:
|
|
123
|
+
ref = catalog.get(selected.skill_id)
|
|
124
|
+
if ref is None:
|
|
125
|
+
raise SkillPackageError("Selected Skill is absent from admitted catalog")
|
|
126
|
+
# The catalog establishes space membership; the selected version
|
|
127
|
+
# and hash establish package identity, including historical pins.
|
|
128
|
+
algorithm, digest = selected.content_hash.split(":", 1)
|
|
129
|
+
ref = replace(
|
|
130
|
+
ref,
|
|
131
|
+
version_id=selected.version_id,
|
|
132
|
+
version="",
|
|
133
|
+
archive_uri="",
|
|
134
|
+
content_hash=ContentHash(algorithm, digest),
|
|
135
|
+
)
|
|
136
|
+
selected_packages.append(
|
|
137
|
+
store.store_archive(ref, client.download_skill_archive(ref))
|
|
138
|
+
)
|
|
139
|
+
packages[config.binding.id] = selected_packages
|
|
140
|
+
finally:
|
|
141
|
+
client.close()
|
|
142
|
+
for frozen in snapshot.bindings:
|
|
143
|
+
connections.resolve_credentials(
|
|
144
|
+
frozen.connection,
|
|
145
|
+
expected_revision=frozen.connection_revision,
|
|
146
|
+
)
|
|
147
|
+
if frozen.skill_execution is not None:
|
|
148
|
+
connections.resolve_credentials(frozen.skill_execution.connection)
|
|
149
|
+
return write_resource_build(directory, snapshot, packages)
|
ksadk/studio/resource_catalog.py
CHANGED
|
@@ -20,6 +20,13 @@ from pydantic import ValidationError
|
|
|
20
20
|
|
|
21
21
|
from ksadk.cli.model_catalog import fetch_provider_model_catalog
|
|
22
22
|
from ksadk.conversations.model_context import normalize_model_metadata
|
|
23
|
+
from ksadk.plugins.providers.dsh_capabilities import (
|
|
24
|
+
DshProfileCapabilityDescriptor,
|
|
25
|
+
)
|
|
26
|
+
from ksadk.plugins.providers.dsh_mcp import (
|
|
27
|
+
DSH_PROFILE_TOOL_PERMISSION,
|
|
28
|
+
dsh_harness_tool_alias,
|
|
29
|
+
)
|
|
23
30
|
from ksadk.studio.capabilities import (
|
|
24
31
|
LocalCapabilityResolver,
|
|
25
32
|
canonical_json,
|
|
@@ -162,6 +169,7 @@ class LocalResourceCatalog:
|
|
|
162
169
|
self.skill_discovery = SkillDiscoveryService(workspace)
|
|
163
170
|
self.python_tool_inspector = PythonToolInspector(workspace)
|
|
164
171
|
self._provider_models: dict[str, ResourceDescriptor] = {}
|
|
172
|
+
self._dsh_mcp_resources: dict[str, ResourceDescriptor] = {}
|
|
165
173
|
# api_base -> (monotonic_ts, descriptors, source),见 discover_provider_models。
|
|
166
174
|
self._provider_catalog_cache: dict[
|
|
167
175
|
str, tuple[float, builtins.list[ResourceDescriptor], str]
|
|
@@ -274,6 +282,7 @@ class LocalResourceCatalog:
|
|
|
274
282
|
) -> builtins.list[ResourceDescriptor]:
|
|
275
283
|
candidates = [
|
|
276
284
|
*self._provider_models.values(),
|
|
285
|
+
*self._dsh_mcp_resources.values(),
|
|
277
286
|
*self._builtin_tools(),
|
|
278
287
|
*self._persisted("models"),
|
|
279
288
|
*self._persisted("mcp"),
|
|
@@ -420,6 +429,77 @@ class LocalResourceCatalog:
|
|
|
420
429
|
)
|
|
421
430
|
return found
|
|
422
431
|
|
|
432
|
+
def replace_dsh_profile_mcp(
|
|
433
|
+
self,
|
|
434
|
+
descriptor: DshProfileCapabilityDescriptor,
|
|
435
|
+
) -> ResourceDescriptor:
|
|
436
|
+
"""Publish one live DSH Profile as a bindable, credential-free MCP.
|
|
437
|
+
|
|
438
|
+
This entry is intentionally memory-only. The stable descriptor is
|
|
439
|
+
compiled into a Build when selected, while its endpoint and bearer
|
|
440
|
+
token are acquired later by the PluginHost runtime.
|
|
441
|
+
"""
|
|
442
|
+
|
|
443
|
+
name = f"dsh-profile-{resource_slug(descriptor.profile)}"
|
|
444
|
+
server = MCPServerRef(
|
|
445
|
+
name=name,
|
|
446
|
+
version=descriptor.dsh_version,
|
|
447
|
+
transport="http",
|
|
448
|
+
materialization="dsh-profile",
|
|
449
|
+
profile=descriptor.profile,
|
|
450
|
+
profile_digest=descriptor.profile_digest,
|
|
451
|
+
descriptor_digest=descriptor.descriptor_digest,
|
|
452
|
+
inventory_digest=descriptor.inventory_digest,
|
|
453
|
+
)
|
|
454
|
+
resolved = self.resolver.resolve_mcp(server)
|
|
455
|
+
resolved["discoveredTools"] = [
|
|
456
|
+
ToolContract(
|
|
457
|
+
name=tool.name,
|
|
458
|
+
version=descriptor.dsh_version,
|
|
459
|
+
description=tool.description,
|
|
460
|
+
input_schema=tool.input_schema,
|
|
461
|
+
permissions=["network:mcp", DSH_PROFILE_TOOL_PERMISSION],
|
|
462
|
+
timeout_seconds=60,
|
|
463
|
+
side_effect="external",
|
|
464
|
+
approval="policy",
|
|
465
|
+
executor="mcp",
|
|
466
|
+
mcp_server=name,
|
|
467
|
+
group="dsh",
|
|
468
|
+
boundary="dsh-profile-sidecar",
|
|
469
|
+
backend="mcp",
|
|
470
|
+
).model_dump(by_alias=True, exclude_none=True, mode="json")
|
|
471
|
+
for tool in descriptor.tools
|
|
472
|
+
]
|
|
473
|
+
stable_id = resource_id("mcp", "provider", name, descriptor.dsh_version)
|
|
474
|
+
snapshot_suffix = descriptor.descriptor_digest.removeprefix("sha256:")[:20]
|
|
475
|
+
resource = ResourceDescriptor(
|
|
476
|
+
resource_id=f"{stable_id}:{snapshot_suffix}",
|
|
477
|
+
kind="mcp",
|
|
478
|
+
name=name,
|
|
479
|
+
display_name=f"DSH Profile: {descriptor.profile}",
|
|
480
|
+
version=descriptor.dsh_version,
|
|
481
|
+
digest=str(resolved["digest"]),
|
|
482
|
+
source="provider",
|
|
483
|
+
status="ready",
|
|
484
|
+
description="DSH/Cordis Profile tools exposed through a runtime MCP lease",
|
|
485
|
+
category="dsh",
|
|
486
|
+
contract=resolved,
|
|
487
|
+
health={
|
|
488
|
+
"profileDigest": descriptor.profile_digest,
|
|
489
|
+
"descriptorDigest": descriptor.descriptor_digest,
|
|
490
|
+
"inventoryDigest": descriptor.inventory_digest,
|
|
491
|
+
},
|
|
492
|
+
)
|
|
493
|
+
self._dsh_mcp_resources = {resource.resource_id: resource}
|
|
494
|
+
return resource
|
|
495
|
+
|
|
496
|
+
def clear_dsh_profile_mcp(self) -> None:
|
|
497
|
+
"""Withdraw stale Profile resources before the DSH generation changes."""
|
|
498
|
+
|
|
499
|
+
# Copy-on-write keeps concurrent catalog readers on a complete old or
|
|
500
|
+
# new snapshot instead of mutating a dict while it is being iterated.
|
|
501
|
+
self._dsh_mcp_resources = {}
|
|
502
|
+
|
|
423
503
|
def create_model_profile(
|
|
424
504
|
self,
|
|
425
505
|
*,
|
|
@@ -455,6 +535,13 @@ class LocalResourceCatalog:
|
|
|
455
535
|
description: str,
|
|
456
536
|
server: MCPServerRef,
|
|
457
537
|
) -> ResourceDescriptor:
|
|
538
|
+
if server.materialization == "dsh-profile":
|
|
539
|
+
raise StudioError(
|
|
540
|
+
"DSH_MCP_MANAGED_RESOURCE_REQUIRED",
|
|
541
|
+
"DSH Profile MCP 只能由当前受管理 Profile 发布",
|
|
542
|
+
status_code=422,
|
|
543
|
+
field="server.materialization",
|
|
544
|
+
)
|
|
458
545
|
require_exact_version(server.version, field="version")
|
|
459
546
|
resolved = self.resolver.resolve_mcp(server)
|
|
460
547
|
descriptor = self._descriptor(
|
|
@@ -638,6 +725,13 @@ class LocalResourceCatalog:
|
|
|
638
725
|
detail: str | None = None,
|
|
639
726
|
) -> ResourceDescriptor:
|
|
640
727
|
descriptor = self.get(resource)
|
|
728
|
+
if descriptor.kind != "mcp" or descriptor.source != "local":
|
|
729
|
+
raise StudioError(
|
|
730
|
+
"RESOURCE_KIND_INVALID",
|
|
731
|
+
"只有本地 MCP Resource 可以保存探测结果",
|
|
732
|
+
status_code=422,
|
|
733
|
+
details={"resourceId": resource},
|
|
734
|
+
)
|
|
641
735
|
updated = descriptor.model_copy(deep=True)
|
|
642
736
|
updated.status = "unhealthy"
|
|
643
737
|
updated.health = {
|
|
@@ -767,17 +861,33 @@ class LocalResourceCatalog:
|
|
|
767
861
|
if not binding.enabled:
|
|
768
862
|
continue
|
|
769
863
|
descriptor = self._ready_binding(binding, expected_kind="mcp")
|
|
864
|
+
raw_filter = binding.config.get("toolFilter")
|
|
865
|
+
tool_filter = (
|
|
866
|
+
{str(item).strip() for item in raw_filter} if isinstance(raw_filter, list) else None
|
|
867
|
+
)
|
|
868
|
+
raw_prefix = binding.config.get("toolNamePrefix")
|
|
869
|
+
prefix = raw_prefix.strip() if isinstance(raw_prefix, str) else ""
|
|
870
|
+
dynamic_dsh = descriptor.contract.get("materialization") == "dsh-profile"
|
|
770
871
|
for payload in descriptor.contract.get("discoveredTools") or []:
|
|
771
872
|
tool = ToolContract.model_validate(payload)
|
|
873
|
+
if tool_filter is not None and tool.name not in tool_filter:
|
|
874
|
+
continue
|
|
772
875
|
approval = self._effective_approval(
|
|
773
876
|
tool,
|
|
774
877
|
bindings.policy_template,
|
|
775
878
|
binding,
|
|
776
879
|
)
|
|
880
|
+
name = (
|
|
881
|
+
dsh_harness_tool_alias(tool.name, prefix)
|
|
882
|
+
if dynamic_dsh
|
|
883
|
+
else f"{prefix}_{tool.name}"
|
|
884
|
+
if prefix
|
|
885
|
+
else tool.name
|
|
886
|
+
)
|
|
777
887
|
tools.append(
|
|
778
888
|
cast(
|
|
779
889
|
ToolContract,
|
|
780
|
-
tool.model_copy(update={"approval": approval}),
|
|
890
|
+
tool.model_copy(update={"name": name, "approval": approval}),
|
|
781
891
|
)
|
|
782
892
|
)
|
|
783
893
|
return tools
|
|
@@ -1113,12 +1223,36 @@ class LocalResourceCatalog:
|
|
|
1113
1223
|
)
|
|
1114
1224
|
|
|
1115
1225
|
def _persisted(self, directory: str) -> Iterable[ResourceDescriptor]:
|
|
1226
|
+
expected_kind = {
|
|
1227
|
+
"models": "model",
|
|
1228
|
+
"mcp": "mcp",
|
|
1229
|
+
"tools": "tool",
|
|
1230
|
+
}.get(directory)
|
|
1231
|
+
if expected_kind is None:
|
|
1232
|
+
return
|
|
1116
1233
|
root = self.workspace.resolve(Path(".agentkit/catalog") / directory)
|
|
1117
1234
|
for path in sorted(root.glob("*.yaml")):
|
|
1118
1235
|
try:
|
|
1119
|
-
|
|
1236
|
+
descriptor = ResourceDescriptor.model_validate(load_yaml_file(path))
|
|
1120
1237
|
except (StudioError, ValidationError):
|
|
1121
1238
|
continue
|
|
1239
|
+
# Provider resources are live, memory-only projections. Never let
|
|
1240
|
+
# a stale or forged workspace YAML shadow their lifecycle fence.
|
|
1241
|
+
if descriptor.source != "local":
|
|
1242
|
+
continue
|
|
1243
|
+
if descriptor.kind != expected_kind:
|
|
1244
|
+
continue
|
|
1245
|
+
expected_id = resource_id(
|
|
1246
|
+
descriptor.kind,
|
|
1247
|
+
"local",
|
|
1248
|
+
descriptor.name,
|
|
1249
|
+
descriptor.version,
|
|
1250
|
+
)
|
|
1251
|
+
if descriptor.resource_id != expected_id:
|
|
1252
|
+
continue
|
|
1253
|
+
if descriptor.contract.get("materialization") == "dsh-profile":
|
|
1254
|
+
continue
|
|
1255
|
+
yield descriptor
|
|
1122
1256
|
|
|
1123
1257
|
def _persist_descriptor(
|
|
1124
1258
|
self,
|
|
@@ -1152,6 +1286,13 @@ class LocalResourceCatalog:
|
|
|
1152
1286
|
def delete_resource(self, resource_id: str) -> None:
|
|
1153
1287
|
"""Remove a persisted catalog resource (model/tool/mcp/skill) by id."""
|
|
1154
1288
|
descriptor = self.get(resource_id)
|
|
1289
|
+
if descriptor.source != "local":
|
|
1290
|
+
raise StudioError(
|
|
1291
|
+
"RESOURCE_DELETE_FORBIDDEN",
|
|
1292
|
+
"只有本地持久化 Resource 可以删除",
|
|
1293
|
+
status_code=422,
|
|
1294
|
+
details={"resourceId": resource_id, "source": descriptor.source},
|
|
1295
|
+
)
|
|
1155
1296
|
kind = descriptor.kind
|
|
1156
1297
|
if kind == "skill":
|
|
1157
1298
|
# Skill 以目录形式安装在 capabilities/skills/{name}
|