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,59 @@
|
|
|
1
|
+
"""Compose Core model routes from Studio's authoritative model resources.
|
|
2
|
+
|
|
3
|
+
Only references and provider metadata enter the temporary Cordis patch. Resolved
|
|
4
|
+
credentials live in the supervised process environment, never in DSH settings.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import hashlib
|
|
9
|
+
import os
|
|
10
|
+
from dataclasses import dataclass, field
|
|
11
|
+
|
|
12
|
+
from ksadk.studio.contracts import ModelSpec
|
|
13
|
+
from ksadk.studio.errors import StudioError
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass
|
|
17
|
+
class DshStudioModels:
|
|
18
|
+
providers: dict = field(default_factory=dict)
|
|
19
|
+
environment: dict[str, str] = field(default_factory=dict, repr=False)
|
|
20
|
+
default_provider: str | None = None
|
|
21
|
+
default_model: str | None = None
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def studio_model_projection(catalog, credentials) -> DshStudioModels:
|
|
25
|
+
result = DshStudioModels()
|
|
26
|
+
specs = []
|
|
27
|
+
base = os.getenv("OPENAI_BASE_URL") or os.getenv("OPENAI_API_BASE")
|
|
28
|
+
default = os.getenv("OPENAI_MODEL_NAME") or os.getenv("MODEL_NAME")
|
|
29
|
+
if base and default:
|
|
30
|
+
specs.append(ModelSpec(model=default, base_url=base, credential_ref="env://OPENAI_API_KEY"))
|
|
31
|
+
for item in catalog.list(kind="model", limit=1000):
|
|
32
|
+
specs.append(ModelSpec.model_validate(item.contract))
|
|
33
|
+
for spec in specs:
|
|
34
|
+
resolved = catalog.resolver.resolve_model(spec)
|
|
35
|
+
try:
|
|
36
|
+
key = credentials.resolve(resolved.credential_ref)
|
|
37
|
+
except StudioError:
|
|
38
|
+
# An unconfigured resource must not prevent other plugins starting.
|
|
39
|
+
continue
|
|
40
|
+
endpoint = resolved.endpoint_url
|
|
41
|
+
suffix = "/responses" if resolved.wire_api == "responses" else "/chat/completions"
|
|
42
|
+
if not endpoint.endswith(suffix):
|
|
43
|
+
continue
|
|
44
|
+
base_url = endpoint[:-len(suffix)]
|
|
45
|
+
identity = f"{base_url}\0{resolved.credential_ref}\0{resolved.wire_api}"
|
|
46
|
+
digest = hashlib.sha256(identity.encode()).hexdigest()[:12]
|
|
47
|
+
route = f"studio-{digest}"
|
|
48
|
+
reference = f"KSADK_STUDIO_MODEL_{digest.upper()}"
|
|
49
|
+
result.environment[reference] = key
|
|
50
|
+
provider = result.providers.setdefault(route, {
|
|
51
|
+
"displayName": "Studio", "baseURL": base_url,
|
|
52
|
+
"api": "openai-responses" if resolved.wire_api == "responses" else "openai-completions",
|
|
53
|
+
"apiKeyEnv": reference, "models": [],
|
|
54
|
+
})
|
|
55
|
+
if not any(model["id"] == resolved.model for model in provider["models"]):
|
|
56
|
+
provider["models"].append({"id": resolved.model, "name": resolved.model})
|
|
57
|
+
if result.default_provider is None:
|
|
58
|
+
result.default_provider, result.default_model = route, resolved.model
|
|
59
|
+
return result
|
|
@@ -19,6 +19,7 @@ from dataclasses import dataclass
|
|
|
19
19
|
from pathlib import Path
|
|
20
20
|
from typing import Any, Literal
|
|
21
21
|
|
|
22
|
+
import yaml
|
|
22
23
|
from pydantic import BaseModel, ConfigDict
|
|
23
24
|
|
|
24
25
|
from ksadk.plugins.bridges.dsh import (
|
|
@@ -27,7 +28,7 @@ from ksadk.plugins.bridges.dsh import (
|
|
|
27
28
|
DshProfileProjection,
|
|
28
29
|
)
|
|
29
30
|
from ksadk.plugins.contracts import CompositionProfile, PluginManifest
|
|
30
|
-
from ksadk.plugins.dsh_toolchain import DshToolchainManager
|
|
31
|
+
from ksadk.plugins.dsh_toolchain import DSH_CORE_PACKAGES, DshToolchainManager
|
|
31
32
|
from ksadk.plugins.host import ManagedPlugin, PluginHostError
|
|
32
33
|
from ksadk.plugins.providers.codex_dsh import (
|
|
33
34
|
SHIPPED_CODEX_DSH_PACKAGE,
|
|
@@ -51,8 +52,16 @@ from ksadk.plugins.providers.harness_dsh import (
|
|
|
51
52
|
|
|
52
53
|
_PROFILE_FILES = ("package.json", "cordis.patch.yml", "index.mjs")
|
|
53
54
|
_MAX_PACKAGE_JSON_BYTES = 2 * 1024 * 1024
|
|
54
|
-
_DSH_PLATFORM_BUNDLES = frozenset(
|
|
55
|
+
_DSH_PLATFORM_BUNDLES = frozenset(DSH_CORE_PACKAGES)
|
|
55
56
|
_SHIPPED_PROVIDER_PACKAGES = frozenset({SHIPPED_CODEX_DSH_PACKAGE, SHIPPED_HARNESS_DSH_PACKAGE})
|
|
57
|
+
_SHIPPED_RESOURCE_PACKAGES = (
|
|
58
|
+
("@kingsoftcloud/dsh-platform-resources", "dsh-platform-resources"),
|
|
59
|
+
("@kingsoftcloud/dsh-knowledge", "dsh-knowledge"),
|
|
60
|
+
("@kingsoftcloud/dsh-memory", "dsh-memory"),
|
|
61
|
+
("@kingsoftcloud/dsh-skill-center", "dsh-skill-center"),
|
|
62
|
+
)
|
|
63
|
+
_SHIPPED_RESOURCE_VERSION = "0.1.0"
|
|
64
|
+
_RESOURCE_RUNTIME_BUNDLE = "@deepseek-ai/dsh-web-app"
|
|
56
65
|
|
|
57
66
|
|
|
58
67
|
class StudioDshProviderRegistrationError(RuntimeError):
|
|
@@ -154,6 +163,63 @@ class _FreshDshAgentProviderFactory:
|
|
|
154
163
|
raise
|
|
155
164
|
|
|
156
165
|
|
|
166
|
+
class _FreshShippedDshBridgeFactory:
|
|
167
|
+
"""Bind a shipped provider to a host owned by the consuming PluginHost loop."""
|
|
168
|
+
|
|
169
|
+
def __init__(
|
|
170
|
+
self,
|
|
171
|
+
command: Sequence[str],
|
|
172
|
+
*,
|
|
173
|
+
projection: DshProfileProjection,
|
|
174
|
+
cwd: Path,
|
|
175
|
+
environment: Mapping[str, str],
|
|
176
|
+
registration: DshAgentProviderRegistration,
|
|
177
|
+
package_name: str,
|
|
178
|
+
host_factory: HostFactory,
|
|
179
|
+
) -> None:
|
|
180
|
+
self._command = tuple(command)
|
|
181
|
+
self._projection = projection
|
|
182
|
+
self._cwd = cwd
|
|
183
|
+
self._environment = dict(environment)
|
|
184
|
+
self._registration = registration
|
|
185
|
+
self._package_name = package_name
|
|
186
|
+
self._host_factory = host_factory
|
|
187
|
+
|
|
188
|
+
async def stage(
|
|
189
|
+
self,
|
|
190
|
+
manifest: PluginManifest,
|
|
191
|
+
*,
|
|
192
|
+
profile: CompositionProfile,
|
|
193
|
+
services: Mapping[str, Any],
|
|
194
|
+
) -> ManagedPlugin:
|
|
195
|
+
host = self._host_factory(
|
|
196
|
+
self._command,
|
|
197
|
+
projection=self._projection,
|
|
198
|
+
cwd=self._cwd,
|
|
199
|
+
environment=self._environment,
|
|
200
|
+
)
|
|
201
|
+
try:
|
|
202
|
+
current = await host.registration()
|
|
203
|
+
if current != self._registration:
|
|
204
|
+
raise PluginHostError(
|
|
205
|
+
"dsh_provider_registration_changed",
|
|
206
|
+
"DSH provider registration changed after Studio discovery",
|
|
207
|
+
)
|
|
208
|
+
if self._package_name == SHIPPED_CODEX_DSH_PACKAGE:
|
|
209
|
+
factory: Any = KsADKCodexDshBridgeFactory(host, current, owns_host=True)
|
|
210
|
+
elif self._package_name == SHIPPED_HARNESS_DSH_PACKAGE:
|
|
211
|
+
factory = KsADKHarnessDshBridgeFactory(host, current, owns_host=True)
|
|
212
|
+
else: # guarded by _register_package
|
|
213
|
+
raise PluginHostError(
|
|
214
|
+
"dsh_provider_package_unsupported",
|
|
215
|
+
"shipped DSH provider package is unsupported",
|
|
216
|
+
)
|
|
217
|
+
return await factory.stage(manifest, profile=profile, services=services)
|
|
218
|
+
except BaseException:
|
|
219
|
+
await host.dispose()
|
|
220
|
+
raise
|
|
221
|
+
|
|
222
|
+
|
|
157
223
|
class StudioDshProviderRegistrationManager:
|
|
158
224
|
"""Own Profile discovery, provider preflight, registration, and disposal."""
|
|
159
225
|
|
|
@@ -162,7 +228,7 @@ class StudioDshProviderRegistrationManager:
|
|
|
162
228
|
workspace: Path,
|
|
163
229
|
*,
|
|
164
230
|
dsh_home: Path,
|
|
165
|
-
profile: str = "
|
|
231
|
+
profile: str = "web",
|
|
166
232
|
dsh_command: Sequence[str] | None = None,
|
|
167
233
|
node_command: Sequence[str] | None = None,
|
|
168
234
|
cordis_module: Path | None = None,
|
|
@@ -192,7 +258,7 @@ class StudioDshProviderRegistrationManager:
|
|
|
192
258
|
if configured_home
|
|
193
259
|
else workspace / ".agentkit" / "dsh-home"
|
|
194
260
|
)
|
|
195
|
-
profile = os.environ.get("KSADK_DSH_PROFILE", "").strip() or "
|
|
261
|
+
profile = os.environ.get("KSADK_DSH_PROFILE", "").strip() or "web"
|
|
196
262
|
configured_bin = os.environ.get("KSADK_DSH_BIN", "").strip()
|
|
197
263
|
manifest = home / "profiles" / profile / "package.json"
|
|
198
264
|
if not manifest.is_file():
|
|
@@ -216,7 +282,7 @@ class StudioDshProviderRegistrationManager:
|
|
|
216
282
|
"""Discover DSH or prepare the isolated first-run Studio Profile.
|
|
217
283
|
|
|
218
284
|
The default is deliberately narrower than :meth:`discover`: only the
|
|
219
|
-
Studio-owned ``.agentkit/dsh-home`` and ``
|
|
285
|
+
Studio-owned ``.agentkit/dsh-home`` and official ``web`` Profile qualify for
|
|
220
286
|
automatic official-provider bootstrap. Explicit DSH homes/profiles
|
|
221
287
|
are user-owned and are never mutated by Studio startup.
|
|
222
288
|
"""
|
|
@@ -237,7 +303,33 @@ class StudioDshProviderRegistrationManager:
|
|
|
237
303
|
# DSH is optional. A missing toolchain must not make the
|
|
238
304
|
# normal Studio/legacy Codex path unavailable.
|
|
239
305
|
return None
|
|
240
|
-
return cls(root, dsh_home=home, profile="
|
|
306
|
+
return cls(root, dsh_home=home, profile="web", dsh_command=command)
|
|
307
|
+
|
|
308
|
+
@classmethod
|
|
309
|
+
def create_workspace_resource_default(
|
|
310
|
+
cls, workspace: Path
|
|
311
|
+
) -> "StudioDshProviderRegistrationManager | None":
|
|
312
|
+
"""Own the official-only Profile frozen into resource Builds."""
|
|
313
|
+
|
|
314
|
+
if os.environ.get("KSADK_DSH_HOME", "").strip() or os.environ.get(
|
|
315
|
+
"KSADK_DSH_PROFILE", ""
|
|
316
|
+
).strip():
|
|
317
|
+
return None
|
|
318
|
+
root = workspace.resolve()
|
|
319
|
+
configured_bin = os.environ.get("KSADK_DSH_BIN", "").strip()
|
|
320
|
+
if configured_bin:
|
|
321
|
+
command: Sequence[str] | None = (str(Path(configured_bin).expanduser()),)
|
|
322
|
+
else:
|
|
323
|
+
try:
|
|
324
|
+
command = DshToolchainManager().require_command()
|
|
325
|
+
except Exception:
|
|
326
|
+
return None
|
|
327
|
+
return cls(
|
|
328
|
+
root,
|
|
329
|
+
dsh_home=root / ".agentkit" / "dsh-home",
|
|
330
|
+
profile="agentkit-resources",
|
|
331
|
+
dsh_command=command,
|
|
332
|
+
)
|
|
241
333
|
|
|
242
334
|
@property
|
|
243
335
|
def inventory(self) -> StudioDshProviderInventory:
|
|
@@ -251,7 +343,7 @@ class StudioDshProviderRegistrationManager:
|
|
|
251
343
|
return (
|
|
252
344
|
not configured_home
|
|
253
345
|
and not configured_profile
|
|
254
|
-
and self._profile
|
|
346
|
+
and self._profile in {"web", "agentkit-resources"}
|
|
255
347
|
and self._dsh_home == expected_home
|
|
256
348
|
)
|
|
257
349
|
|
|
@@ -287,6 +379,7 @@ class StudioDshProviderRegistrationManager:
|
|
|
287
379
|
dsh_command=command,
|
|
288
380
|
cwd=self._workspace,
|
|
289
381
|
) as bridge:
|
|
382
|
+
self._repair_owned_profile_layout(bridge)
|
|
290
383
|
installed = {item.name: item for item in bridge.list_plugins()}
|
|
291
384
|
current = installed.get(SHIPPED_CODEX_DSH_PACKAGE)
|
|
292
385
|
if current is None:
|
|
@@ -318,6 +411,7 @@ class StudioDshProviderRegistrationManager:
|
|
|
318
411
|
self._write_default_marker(
|
|
319
412
|
marker,
|
|
320
413
|
{
|
|
414
|
+
**marker_payload,
|
|
321
415
|
"version": 1,
|
|
322
416
|
"codexProviderApplied": True,
|
|
323
417
|
"codexProviderVersion": SHIPPED_CODEX_PROVIDER_VERSION,
|
|
@@ -325,9 +419,174 @@ class StudioDshProviderRegistrationManager:
|
|
|
325
419
|
)
|
|
326
420
|
return result
|
|
327
421
|
|
|
422
|
+
async def bootstrap_official_resource_plugins(
|
|
423
|
+
self,
|
|
424
|
+
) -> Literal["installed", "already_enabled", "disabled", "skipped"]:
|
|
425
|
+
"""Apply the wheel-owned platform-resource stack once to Studio's Profile."""
|
|
426
|
+
|
|
427
|
+
if not self._owns_workspace_default_profile:
|
|
428
|
+
return "skipped"
|
|
429
|
+
async with self._lock:
|
|
430
|
+
return await asyncio.to_thread(self._bootstrap_official_resource_plugins_sync)
|
|
431
|
+
|
|
432
|
+
def _bootstrap_official_resource_plugins_sync(
|
|
433
|
+
self,
|
|
434
|
+
) -> Literal["installed", "already_enabled", "disabled", "skipped"]:
|
|
435
|
+
if not self._owns_workspace_default_profile:
|
|
436
|
+
return "skipped"
|
|
437
|
+
marker = self._default_marker_path
|
|
438
|
+
marker_payload = self._read_default_marker(marker)
|
|
439
|
+
command = self._dsh_command or DshToolchainManager().require_command()
|
|
440
|
+
installed_any = False
|
|
441
|
+
disabled = False
|
|
442
|
+
enable_defaults = marker_payload.get("platformResourcesEnabled") is not True
|
|
443
|
+
with self._bridge_factory(
|
|
444
|
+
dsh_home=self._dsh_home,
|
|
445
|
+
profile=self._profile,
|
|
446
|
+
dsh_command=command,
|
|
447
|
+
cwd=self._workspace,
|
|
448
|
+
) as bridge:
|
|
449
|
+
self._repair_owned_profile_layout(bridge)
|
|
450
|
+
inventory = {item.name: item for item in bridge.list_plugins()}
|
|
451
|
+
for package_name, directory_name in _SHIPPED_RESOURCE_PACKAGES:
|
|
452
|
+
current = inventory.get(package_name)
|
|
453
|
+
if current is None:
|
|
454
|
+
# A completed marker plus a missing package records a later,
|
|
455
|
+
# explicit uninstall. Startup must preserve that choice.
|
|
456
|
+
if marker_payload.get("platformResourcesApplied") is True:
|
|
457
|
+
continue
|
|
458
|
+
root = (
|
|
459
|
+
Path(__file__).parents[1]
|
|
460
|
+
/ "plugins"
|
|
461
|
+
/ "providers"
|
|
462
|
+
/ "bundles"
|
|
463
|
+
/ directory_name
|
|
464
|
+
)
|
|
465
|
+
current = bridge.install_plugin(
|
|
466
|
+
str(root), accept_host_permissions=True
|
|
467
|
+
)
|
|
468
|
+
if current.name != package_name:
|
|
469
|
+
raise StudioDshProviderRegistrationError(
|
|
470
|
+
"resource_dsh_package_mismatch",
|
|
471
|
+
"an official resource install returned a different package",
|
|
472
|
+
)
|
|
473
|
+
installed_any = True
|
|
474
|
+
if current.version != _SHIPPED_RESOURCE_VERSION:
|
|
475
|
+
raise StudioDshProviderRegistrationError(
|
|
476
|
+
"resource_dsh_bundle_not_active",
|
|
477
|
+
"an official platform resource Bundle version is not supported",
|
|
478
|
+
)
|
|
479
|
+
if not current.enabled and enable_defaults:
|
|
480
|
+
current = bridge.set_enabled(package_name, enabled=True)
|
|
481
|
+
if not current.enabled:
|
|
482
|
+
raise StudioDshProviderRegistrationError(
|
|
483
|
+
"resource_dsh_enable_failed",
|
|
484
|
+
"an official platform resource Bundle did not become enabled",
|
|
485
|
+
)
|
|
486
|
+
disabled = disabled or not current.enabled
|
|
487
|
+
self._verify_shipped_resource_bundle_bytes(package_name, directory_name)
|
|
488
|
+
if self._profile == "agentkit-resources":
|
|
489
|
+
self._ensure_resource_runtime_bundle()
|
|
490
|
+
if marker_payload.get("platformResourcesApplied") is not True:
|
|
491
|
+
self._write_default_marker(
|
|
492
|
+
marker,
|
|
493
|
+
{
|
|
494
|
+
**marker_payload,
|
|
495
|
+
"version": 1,
|
|
496
|
+
"platformResourcesApplied": True,
|
|
497
|
+
"platformResourcesEnabled": True,
|
|
498
|
+
"platformResourcesVersion": _SHIPPED_RESOURCE_VERSION,
|
|
499
|
+
},
|
|
500
|
+
)
|
|
501
|
+
elif enable_defaults:
|
|
502
|
+
self._write_default_marker(
|
|
503
|
+
marker,
|
|
504
|
+
{**marker_payload, "platformResourcesEnabled": True},
|
|
505
|
+
)
|
|
506
|
+
if disabled:
|
|
507
|
+
return "disabled"
|
|
508
|
+
return "installed" if installed_any else "already_enabled"
|
|
509
|
+
|
|
510
|
+
def _ensure_resource_runtime_bundle(self) -> None:
|
|
511
|
+
"""Give the private resource Profile the official loopback transport.
|
|
512
|
+
|
|
513
|
+
The capability exporter uses DSH's authenticated ``webServer`` and
|
|
514
|
+
``connection`` services even when no browser UI is mounted. Custom
|
|
515
|
+
Profiles start with only ``dsh-base``, so the Studio-owned execution
|
|
516
|
+
Profile must explicitly include DSH's official web runtime layer.
|
|
517
|
+
"""
|
|
518
|
+
|
|
519
|
+
manifest_path = self._profile_root / "package.json"
|
|
520
|
+
try:
|
|
521
|
+
if manifest_path.stat().st_size > _MAX_PACKAGE_JSON_BYTES:
|
|
522
|
+
raise ValueError("package.json is too large")
|
|
523
|
+
payload = json.loads(manifest_path.read_text(encoding="utf-8"))
|
|
524
|
+
dsh = payload.get("dsh")
|
|
525
|
+
profile = dsh.get("profile") if isinstance(dsh, dict) else None
|
|
526
|
+
bundles = profile.get("bundles") if isinstance(profile, dict) else None
|
|
527
|
+
if not isinstance(bundles, list) or any(
|
|
528
|
+
not isinstance(item, str) for item in bundles
|
|
529
|
+
):
|
|
530
|
+
raise ValueError("bundle order is invalid")
|
|
531
|
+
except (OSError, UnicodeError, json.JSONDecodeError, ValueError) as error:
|
|
532
|
+
raise StudioDshProviderRegistrationError(
|
|
533
|
+
"resource_dsh_profile_invalid",
|
|
534
|
+
"the official resource execution Profile is invalid",
|
|
535
|
+
) from error
|
|
536
|
+
if _RESOURCE_RUNTIME_BUNDLE in bundles:
|
|
537
|
+
return
|
|
538
|
+
try:
|
|
539
|
+
base_index = bundles.index("@deepseek-ai/dsh-base")
|
|
540
|
+
except ValueError as error:
|
|
541
|
+
raise StudioDshProviderRegistrationError(
|
|
542
|
+
"resource_dsh_profile_invalid",
|
|
543
|
+
"the official resource execution Profile has no DSH base Bundle",
|
|
544
|
+
) from error
|
|
545
|
+
bundles.insert(base_index + 1, _RESOURCE_RUNTIME_BUNDLE)
|
|
546
|
+
self._write_default_marker(manifest_path, payload)
|
|
547
|
+
|
|
548
|
+
def _repair_owned_profile_layout(self, bridge: DshProfilePluginBridge) -> None:
|
|
549
|
+
"""Repair only Studio's default legacy Profile before projecting it.
|
|
550
|
+
|
|
551
|
+
Older Studio versions created the ``web`` Profile with pnpm's hoisted
|
|
552
|
+
linker. Some community dependency graphs then contained links to the
|
|
553
|
+
ambient pnpm store and could not form a closed Build snapshot. The
|
|
554
|
+
frozen lock remains the authority; the bridge keeps the original tree
|
|
555
|
+
as an atomic rollback point while reinstalling the isolated layout.
|
|
556
|
+
"""
|
|
557
|
+
|
|
558
|
+
if not self._owns_workspace_default_profile:
|
|
559
|
+
return
|
|
560
|
+
settings_path = self._dsh_home / "profiles" / self._profile / "pnpm-workspace.yaml"
|
|
561
|
+
if not settings_path.is_file():
|
|
562
|
+
return
|
|
563
|
+
try:
|
|
564
|
+
settings = yaml.safe_load(settings_path.read_text(encoding="utf-8"))
|
|
565
|
+
except (OSError, UnicodeError, yaml.YAMLError) as error:
|
|
566
|
+
raise StudioDshProviderRegistrationError(
|
|
567
|
+
"dsh_profile_layout_invalid",
|
|
568
|
+
"the Studio-owned DSH Profile layout settings are unreadable",
|
|
569
|
+
) from error
|
|
570
|
+
if not isinstance(settings, dict):
|
|
571
|
+
raise StudioDshProviderRegistrationError(
|
|
572
|
+
"dsh_profile_layout_invalid",
|
|
573
|
+
"the Studio-owned DSH Profile layout settings are invalid",
|
|
574
|
+
)
|
|
575
|
+
if settings.get("nodeLinker") not in {"hoisted", "isolated"}:
|
|
576
|
+
return
|
|
577
|
+
bridge.migrate_to_isolated_layout(
|
|
578
|
+
accept_host_permissions=True,
|
|
579
|
+
recover_external_dependency_links=True,
|
|
580
|
+
)
|
|
581
|
+
|
|
328
582
|
@property
|
|
329
583
|
def _default_marker_path(self) -> Path:
|
|
330
|
-
|
|
584
|
+
# Scope the bootstrap receipt to the owned Profile. Older Studio
|
|
585
|
+
# builds used one workspace-wide marker while their default Profile
|
|
586
|
+
# was ``studio``. Reusing that marker after the default moved to
|
|
587
|
+
# official Core's ``web`` Profile incorrectly skipped first-run
|
|
588
|
+
# installation and left Studio with no runnable DSH Profile.
|
|
589
|
+
return self._workspace / ".agentkit" / f"official-dsh-defaults-{self._profile}.json"
|
|
331
590
|
|
|
332
591
|
@staticmethod
|
|
333
592
|
def _read_default_marker(path: Path) -> dict[str, object]:
|
|
@@ -525,7 +784,12 @@ class StudioDshProviderRegistrationManager:
|
|
|
525
784
|
provider_packages[provider_ref] = package.name
|
|
526
785
|
manifests[provider_ref] = registration.manifest
|
|
527
786
|
factories[provider_ref] = factory
|
|
528
|
-
|
|
787
|
+
# Discovery is a bounded admission probe. Keeping its process
|
|
788
|
+
# alive would bind Studio construction to that event loop and
|
|
789
|
+
# make later API or Scheduler loops reuse foreign transports.
|
|
790
|
+
# The fresh factory repeats the exact registration fence and
|
|
791
|
+
# owns its execution host in the consuming PluginHost loop.
|
|
792
|
+
await host.dispose()
|
|
529
793
|
statuses[index] = statuses[index].model_copy(
|
|
530
794
|
update={
|
|
531
795
|
"state": "ready",
|
|
@@ -617,10 +881,16 @@ class StudioDshProviderRegistrationManager:
|
|
|
617
881
|
"dsh_provider_inventory_not_ready",
|
|
618
882
|
"DSH AgentProvider inventory is not ready",
|
|
619
883
|
)
|
|
620
|
-
if package.name
|
|
621
|
-
factory: Any =
|
|
622
|
-
|
|
623
|
-
|
|
884
|
+
if package.name in _SHIPPED_PROVIDER_PACKAGES:
|
|
885
|
+
factory: Any = _FreshShippedDshBridgeFactory(
|
|
886
|
+
command,
|
|
887
|
+
projection=projection,
|
|
888
|
+
cwd=cwd,
|
|
889
|
+
environment=environment,
|
|
890
|
+
registration=registration,
|
|
891
|
+
package_name=package.name,
|
|
892
|
+
host_factory=self._host_factory,
|
|
893
|
+
)
|
|
624
894
|
else:
|
|
625
895
|
factory = _FreshDshAgentProviderFactory(
|
|
626
896
|
command,
|
|
@@ -730,6 +1000,43 @@ class StudioDshProviderRegistrationManager:
|
|
|
730
1000
|
"the installed DSH AgentProvider Bundle differs from the wheel-owned Bundle",
|
|
731
1001
|
)
|
|
732
1002
|
|
|
1003
|
+
def _verify_shipped_resource_bundle_bytes(
|
|
1004
|
+
self, package_name: str, directory_name: str
|
|
1005
|
+
) -> None:
|
|
1006
|
+
shipped = (
|
|
1007
|
+
Path(__file__).parents[1]
|
|
1008
|
+
/ "plugins"
|
|
1009
|
+
/ "providers"
|
|
1010
|
+
/ "bundles"
|
|
1011
|
+
/ directory_name
|
|
1012
|
+
)
|
|
1013
|
+
installed = self._profile_root / "node_modules"
|
|
1014
|
+
for segment in package_name.split("/"):
|
|
1015
|
+
installed /= segment
|
|
1016
|
+
names = ["package.json", "cordis.patch.yml", "index.mjs"]
|
|
1017
|
+
if directory_name == "dsh-platform-resources":
|
|
1018
|
+
names.append("client.mjs")
|
|
1019
|
+
try:
|
|
1020
|
+
package_matches = json.loads(
|
|
1021
|
+
(installed / "package.json").read_text(encoding="utf-8")
|
|
1022
|
+
) == json.loads((shipped / "package.json").read_text(encoding="utf-8"))
|
|
1023
|
+
matches = package_matches and all(
|
|
1024
|
+
(installed / name).read_bytes().rstrip()
|
|
1025
|
+
== (shipped / name).read_bytes().rstrip()
|
|
1026
|
+
for name in names
|
|
1027
|
+
if name != "package.json"
|
|
1028
|
+
)
|
|
1029
|
+
except (OSError, UnicodeError, json.JSONDecodeError) as error:
|
|
1030
|
+
raise StudioDshProviderRegistrationError(
|
|
1031
|
+
"resource_dsh_bundle_unreadable",
|
|
1032
|
+
"an installed platform resource Bundle cannot be verified",
|
|
1033
|
+
) from error
|
|
1034
|
+
if not matches:
|
|
1035
|
+
raise StudioDshProviderRegistrationError(
|
|
1036
|
+
"resource_dsh_bundle_digest_mismatch",
|
|
1037
|
+
"an installed platform resource Bundle differs from the wheel-owned Bundle",
|
|
1038
|
+
)
|
|
1039
|
+
|
|
733
1040
|
|
|
734
1041
|
def merge_provider_registrations(
|
|
735
1042
|
*registrations: StudioDshProviderRegistrations,
|
ksadk/studio/hosted_kernel.py
CHANGED
|
@@ -45,9 +45,35 @@ def build_hosted_kernel_requirement(
|
|
|
45
45
|
entry_point: str | None,
|
|
46
46
|
agent_variable: str | None,
|
|
47
47
|
launch_config: bytes | None,
|
|
48
|
+
composition_profile_digest: str | None = None,
|
|
49
|
+
plugin_lock_digest: str | None = None,
|
|
50
|
+
provider_ref: str | None = None,
|
|
48
51
|
) -> dict[str, Any]:
|
|
49
52
|
"""Build the immutable local requirement embedded into every Studio ZIP."""
|
|
50
53
|
|
|
54
|
+
if runtime_type == "plugin":
|
|
55
|
+
if not composition_profile_digest or not plugin_lock_digest or not provider_ref:
|
|
56
|
+
raise ValueError("plugin runtime requires a resolved composition launch contract")
|
|
57
|
+
runtime_requirement = {
|
|
58
|
+
"type": runtime_type,
|
|
59
|
+
"launchMode": "plugin-host",
|
|
60
|
+
"compositionProfile": "composition-profile.json",
|
|
61
|
+
"compositionProfileDigest": composition_profile_digest,
|
|
62
|
+
"pluginLock": "plugin-lock.json",
|
|
63
|
+
"pluginLockDigest": plugin_lock_digest,
|
|
64
|
+
"providerRef": provider_ref,
|
|
65
|
+
}
|
|
66
|
+
else:
|
|
67
|
+
runtime_requirement = {
|
|
68
|
+
"type": runtime_type,
|
|
69
|
+
"entryPoint": entry_point or "",
|
|
70
|
+
"agentVariable": agent_variable or "",
|
|
71
|
+
"launchConfig": "runtime/agentengine.yaml" if launch_config is not None else "",
|
|
72
|
+
"launchConfigSha256": (
|
|
73
|
+
sha256_digest(launch_config) if launch_config is not None else ""
|
|
74
|
+
),
|
|
75
|
+
}
|
|
76
|
+
|
|
51
77
|
return {
|
|
52
78
|
"format": HOSTED_KERNEL_REQUIREMENTS_FORMAT,
|
|
53
79
|
"kernelContract": {
|
|
@@ -56,13 +82,7 @@ def build_hosted_kernel_requirement(
|
|
|
56
82
|
},
|
|
57
83
|
"bundleLayout": HOSTED_KERNEL_BUNDLE_FORMAT,
|
|
58
84
|
"runtimeContract": HOSTED_KERNEL_RUNTIME_CONTRACT,
|
|
59
|
-
"runtime":
|
|
60
|
-
"type": runtime_type,
|
|
61
|
-
"entryPoint": entry_point or "",
|
|
62
|
-
"agentVariable": agent_variable or "",
|
|
63
|
-
"launchConfig": "runtime/agentengine.yaml" if launch_config is not None else "",
|
|
64
|
-
"launchConfigSha256": sha256_digest(launch_config) if launch_config is not None else "",
|
|
65
|
-
},
|
|
85
|
+
"runtime": runtime_requirement,
|
|
66
86
|
}
|
|
67
87
|
|
|
68
88
|
|
|
@@ -207,17 +227,24 @@ def _validate_requirement(
|
|
|
207
227
|
"Bundle 缺少受支持的 runtime 启动 requirement", reason="missing_runtime"
|
|
208
228
|
)
|
|
209
229
|
runtime_type = str(runtime.get("type") or "").strip().lower()
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
230
|
+
manifest_runtime_type = str(manifest.get("runtimeType") or "").strip().lower()
|
|
231
|
+
if runtime_type != manifest_runtime_type:
|
|
232
|
+
raise _incompatible_error(
|
|
233
|
+
"Bundle runtime requirement 与 manifest 不一致", reason="runtime_type"
|
|
234
|
+
)
|
|
235
|
+
if runtime_type == "plugin":
|
|
236
|
+
_validate_plugin_launch(manifest, runtime, entries)
|
|
237
|
+
return
|
|
214
238
|
if runtime_type not in _RUNTIME_TYPES:
|
|
215
239
|
raise _incompatible_error(
|
|
216
240
|
"Bundle runtime 类型不受 Hosted Agent Kernel 支持", reason="runtime_type"
|
|
217
241
|
)
|
|
242
|
+
entry_point = str(runtime.get("entryPoint") or "").strip()
|
|
243
|
+
agent_variable = str(runtime.get("agentVariable") or "").strip()
|
|
244
|
+
launch_path = str(runtime.get("launchConfig") or "").strip()
|
|
245
|
+
launch_digest = str(runtime.get("launchConfigSha256") or "").strip()
|
|
218
246
|
if (
|
|
219
|
-
|
|
220
|
-
or not entry_point
|
|
247
|
+
not entry_point
|
|
221
248
|
or not agent_variable
|
|
222
249
|
or launch_path != "runtime/agentengine.yaml"
|
|
223
250
|
or not launch_digest
|
|
@@ -249,6 +276,54 @@ def _validate_requirement(
|
|
|
249
276
|
)
|
|
250
277
|
|
|
251
278
|
|
|
279
|
+
def _validate_plugin_launch(
|
|
280
|
+
manifest: dict[str, Any],
|
|
281
|
+
runtime: dict[str, Any],
|
|
282
|
+
entries: dict[str, bytes],
|
|
283
|
+
) -> None:
|
|
284
|
+
profile_path = str(runtime.get("compositionProfile") or "").strip()
|
|
285
|
+
profile_digest = str(runtime.get("compositionProfileDigest") or "").strip()
|
|
286
|
+
lock_path = str(runtime.get("pluginLock") or "").strip()
|
|
287
|
+
lock_digest = str(runtime.get("pluginLockDigest") or "").strip()
|
|
288
|
+
provider_ref = str(runtime.get("providerRef") or "").strip()
|
|
289
|
+
if (
|
|
290
|
+
runtime.get("launchMode") != "plugin-host"
|
|
291
|
+
or manifest.get("compositionMode") != "composed"
|
|
292
|
+
or profile_path != "composition-profile.json"
|
|
293
|
+
or lock_path != "plugin-lock.json"
|
|
294
|
+
or not profile_digest
|
|
295
|
+
or not lock_digest
|
|
296
|
+
or not provider_ref
|
|
297
|
+
or manifest.get("compositionProfileDigest") != profile_digest
|
|
298
|
+
or manifest.get("pluginLockDigest") != lock_digest
|
|
299
|
+
):
|
|
300
|
+
raise _incompatible_error(
|
|
301
|
+
"Bundle 缺少可验证的 PluginHost 启动配置", reason="plugin_launch"
|
|
302
|
+
)
|
|
303
|
+
profile = _json_object(entries, profile_path)
|
|
304
|
+
lock = _json_object(entries, lock_path)
|
|
305
|
+
if sha256_digest(canonical_json(profile)) != profile_digest:
|
|
306
|
+
raise _incompatible_error(
|
|
307
|
+
"Bundle composition profile digest 不一致", reason="plugin_profile_digest"
|
|
308
|
+
)
|
|
309
|
+
if sha256_digest(canonical_json(lock)) != lock_digest:
|
|
310
|
+
raise _incompatible_error(
|
|
311
|
+
"Bundle plugin lock digest 不一致", reason="plugin_lock_digest"
|
|
312
|
+
)
|
|
313
|
+
agent_provider = profile.get("agentProvider")
|
|
314
|
+
if not isinstance(agent_provider, dict) or agent_provider.get("ref") != provider_ref:
|
|
315
|
+
raise _incompatible_error(
|
|
316
|
+
"Bundle Agent Provider 与 PluginHost requirement 不一致",
|
|
317
|
+
reason="plugin_provider",
|
|
318
|
+
)
|
|
319
|
+
runtime_lock = _json_object(entries, "runtime-lock.json")
|
|
320
|
+
if str(runtime_lock.get("type") or "").strip().lower() != "plugin":
|
|
321
|
+
raise _incompatible_error(
|
|
322
|
+
"Bundle runtime lock 与 PluginHost requirement 不一致",
|
|
323
|
+
reason="runtime_lock",
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
|
|
252
327
|
def _validate_content_manifest(manifest: dict[str, Any], entries: dict[str, bytes]) -> None:
|
|
253
328
|
files = manifest.get("files")
|
|
254
329
|
if not isinstance(files, list):
|
ksadk/studio/mcp_runtime.py
CHANGED
|
@@ -142,9 +142,11 @@ class MCPRuntimeAdapter:
|
|
|
142
142
|
yield read_stream, write_stream
|
|
143
143
|
elif transport in {"http", "streamable-http", "streamable_http"}:
|
|
144
144
|
headers = self._http_headers(server)
|
|
145
|
-
async with streamablehttp_client(
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
async with streamablehttp_client(server.endpoint_url or "", headers=headers) as (
|
|
146
|
+
read_stream,
|
|
147
|
+
write_stream,
|
|
148
|
+
_,
|
|
149
|
+
):
|
|
148
150
|
yield read_stream, write_stream
|
|
149
151
|
elif transport == "sse":
|
|
150
152
|
headers = self._http_headers(server)
|
|
@@ -193,6 +195,12 @@ class MCPRuntimeAdapter:
|
|
|
193
195
|
|
|
194
196
|
@staticmethod
|
|
195
197
|
def _validate(server: MCPServerRef) -> None:
|
|
198
|
+
if server.materialization == "dsh-profile":
|
|
199
|
+
raise StudioError(
|
|
200
|
+
"DSH_MCP_MANAGED_RESOURCE_REQUIRED",
|
|
201
|
+
"DSH Profile MCP 必须通过受管理的 PluginHost 租约使用",
|
|
202
|
+
status_code=422,
|
|
203
|
+
)
|
|
196
204
|
transport = (server.transport or "stdio").lower()
|
|
197
205
|
if transport == "stdio":
|
|
198
206
|
command = Path(server.command or "").name.lower()
|
ksadk/studio/model_client.py
CHANGED
|
@@ -220,9 +220,9 @@ class CredentialResolver:
|
|
|
220
220
|
"persistence": source,
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
def resolve(self, reference: str) -> str:
|
|
223
|
+
def resolve(self, reference: str, *, allow_aliases: bool = True) -> str:
|
|
224
224
|
name = self._environment_name(reference)
|
|
225
|
-
fallback = self._fallback_name(name)
|
|
225
|
+
fallback = self._fallback_name(name) if allow_aliases else None
|
|
226
226
|
aliases = [name, *([fallback] if fallback else [])]
|
|
227
227
|
for candidate in aliases:
|
|
228
228
|
value = self._session_value(candidate)
|