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
|
@@ -20,6 +20,7 @@ from typing import Any, Callable, cast
|
|
|
20
20
|
from pydantic import ValidationError
|
|
21
21
|
|
|
22
22
|
from ksadk.managed_runtime import installed_runtime_version
|
|
23
|
+
from ksadk.plugins.providers.dsh import DSH_HOST_USER_PERMISSION
|
|
23
24
|
from ksadk.studio.codex_builder import CodexBuildRecord
|
|
24
25
|
from ksadk.studio.codex_manifest import (
|
|
25
26
|
CodexAgentManifest,
|
|
@@ -168,6 +169,11 @@ class CodexAgentService:
|
|
|
168
169
|
)
|
|
169
170
|
resolved = (spec or default_agent_spec("blank")).model_copy(deep=True)
|
|
170
171
|
resolved.runtime = RuntimeRef(type="codex", version=self._runtime_version(resolved))
|
|
172
|
+
# Selecting the wheel-owned Codex Runtime also selects its shipped Provider.
|
|
173
|
+
# Grant only that Provider's required host permission on first creation;
|
|
174
|
+
# third-party plugins still require explicit Agent-level authorization.
|
|
175
|
+
if DSH_HOST_USER_PERMISSION not in resolved.security.allowed_permissions:
|
|
176
|
+
resolved.security.allowed_permissions.append(DSH_HOST_USER_PERMISSION)
|
|
171
177
|
self.ensure_bindings_supported(resolved)
|
|
172
178
|
manifest = self._manifest(agent_id, resolved)
|
|
173
179
|
snapshot = self.studio.codex_manifests.save(manifest)
|
|
@@ -204,6 +210,7 @@ class CodexAgentService:
|
|
|
204
210
|
)
|
|
205
211
|
resolved = spec.model_copy(deep=True)
|
|
206
212
|
resolved.runtime = current.spec.runtime
|
|
213
|
+
self._ensure_mcp_bindings_supported(resolved)
|
|
207
214
|
# 早期 Studio 曾把 ksadk Tool 写进 Codex 草稿,尽管 Codex Runtime
|
|
208
215
|
# 从未执行这些绑定。允许原样保存这类 dormant 历史数据,避免用户只改
|
|
209
216
|
# Prompt/Model 时被迫丢绑定;新增、删除或修改仍按当前能力矩阵拒绝。
|
|
@@ -251,8 +258,7 @@ class CodexAgentService:
|
|
|
251
258
|
self.drafts.save(updated)
|
|
252
259
|
return self._project(snapshot, current=updated)
|
|
253
260
|
|
|
254
|
-
|
|
255
|
-
def ensure_bindings_supported(spec: AgentSpec) -> None:
|
|
261
|
+
def ensure_bindings_supported(self, spec: AgentSpec) -> None:
|
|
256
262
|
bindings = spec.bindings
|
|
257
263
|
if bindings.tools or spec.capabilities.tools:
|
|
258
264
|
raise StudioError(
|
|
@@ -263,6 +269,34 @@ class CodexAgentService:
|
|
|
263
269
|
details={"runtimeType": "codex"},
|
|
264
270
|
)
|
|
265
271
|
# codex 支持 streamable-http MCP(通过 config_overrides 注入 mcp_servers)。
|
|
272
|
+
self._ensure_mcp_bindings_supported(spec)
|
|
273
|
+
|
|
274
|
+
def _ensure_mcp_bindings_supported(self, spec: AgentSpec) -> None:
|
|
275
|
+
direct_dynamic = [
|
|
276
|
+
server.name
|
|
277
|
+
for server in spec.capabilities.mcp_servers
|
|
278
|
+
if server.enabled and server.materialization == "dsh-profile"
|
|
279
|
+
]
|
|
280
|
+
if direct_dynamic:
|
|
281
|
+
raise StudioError(
|
|
282
|
+
"DSH_MCP_MANAGED_BINDING_REQUIRED",
|
|
283
|
+
"DSH Profile MCP 必须从当前 Catalog Resource 显式绑定,不能直接写入 AgentSpec",
|
|
284
|
+
status_code=422,
|
|
285
|
+
field="spec.capabilities.mcpServers",
|
|
286
|
+
details={"servers": sorted(direct_dynamic)},
|
|
287
|
+
)
|
|
288
|
+
for binding in spec.bindings.mcp_servers:
|
|
289
|
+
if not binding.enabled:
|
|
290
|
+
continue
|
|
291
|
+
descriptor = self.studio.catalog.get(binding.resource_id)
|
|
292
|
+
if descriptor.contract.get("materialization") == "dsh-profile":
|
|
293
|
+
raise StudioError(
|
|
294
|
+
"DSH_MCP_RUNTIME_INCOMPATIBLE",
|
|
295
|
+
"DSH Profile MCP 当前只支持 Harness Runtime",
|
|
296
|
+
status_code=422,
|
|
297
|
+
field="spec.runtime.type",
|
|
298
|
+
details={"runtimeType": "codex"},
|
|
299
|
+
)
|
|
266
300
|
|
|
267
301
|
def _skill_resource_ids(self, spec: AgentSpec) -> list[str]:
|
|
268
302
|
bindings = spec.bindings
|
|
@@ -277,7 +311,7 @@ class CodexAgentService:
|
|
|
277
311
|
return ordered
|
|
278
312
|
|
|
279
313
|
def _mcp_server_configs(self, spec: AgentSpec) -> list[dict[str, Any]]:
|
|
280
|
-
"""Resolve bound MCP
|
|
314
|
+
"""Resolve bound MCP resources to native Codex HTTP or stdio configs."""
|
|
281
315
|
bindings = spec.bindings
|
|
282
316
|
ids = [b.resource_id for b in bindings.mcp_servers]
|
|
283
317
|
ids.extend(spec.capabilities.mcp_servers or [])
|
|
@@ -299,26 +333,51 @@ class CodexAgentService:
|
|
|
299
333
|
if descriptor is None:
|
|
300
334
|
continue
|
|
301
335
|
contract = descriptor.contract or {}
|
|
336
|
+
if contract.get("materialization") == "dsh-profile":
|
|
337
|
+
raise StudioError(
|
|
338
|
+
"DSH_MCP_RUNTIME_INCOMPATIBLE",
|
|
339
|
+
"DSH Profile MCP 不能物化为 Codex MCP 配置",
|
|
340
|
+
status_code=422,
|
|
341
|
+
field="spec.bindings.mcpServers",
|
|
342
|
+
details={"runtimeType": "codex"},
|
|
343
|
+
)
|
|
302
344
|
url = str(
|
|
303
345
|
contract.get("endpointUrl")
|
|
304
346
|
or contract.get("endpoint_url")
|
|
305
347
|
or contract.get("url")
|
|
306
348
|
or ""
|
|
307
349
|
).strip()
|
|
308
|
-
if
|
|
350
|
+
transport = str(contract.get("transport") or ("http" if url else "")).lower()
|
|
351
|
+
command = str(contract.get("command") or "").strip()
|
|
352
|
+
if transport == "stdio" and command:
|
|
353
|
+
entry: dict[str, Any] = {
|
|
354
|
+
"name": descriptor.name,
|
|
355
|
+
"transport": "stdio",
|
|
356
|
+
"command": command,
|
|
357
|
+
"args": [str(argument) for argument in (contract.get("args") or [])],
|
|
358
|
+
}
|
|
359
|
+
elif transport in {"http", "sse"} and url:
|
|
360
|
+
entry = {
|
|
361
|
+
"name": descriptor.name,
|
|
362
|
+
"url": url,
|
|
363
|
+
}
|
|
364
|
+
if transport == "sse":
|
|
365
|
+
entry["transport"] = transport
|
|
366
|
+
else:
|
|
309
367
|
continue
|
|
310
368
|
env_refs = contract.get("envRefs") or {}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
369
|
+
if transport == "stdio" and isinstance(env_refs, dict) and env_refs:
|
|
370
|
+
entry["env_refs"] = {
|
|
371
|
+
str(env_name): str(reference) for env_name, reference in env_refs.items()
|
|
372
|
+
}
|
|
373
|
+
elif isinstance(env_refs, dict):
|
|
374
|
+
env_key = ""
|
|
375
|
+
for ref in env_refs.values():
|
|
376
|
+
if isinstance(ref, str) and ref.startswith("env://"):
|
|
377
|
+
env_key = ref.removeprefix("env://")
|
|
378
|
+
break
|
|
379
|
+
if env_key:
|
|
380
|
+
entry["env_key"] = env_key
|
|
322
381
|
ordered.append(entry)
|
|
323
382
|
return ordered
|
|
324
383
|
|
|
@@ -398,7 +457,7 @@ class CodexAgentService:
|
|
|
398
457
|
|
|
399
458
|
@staticmethod
|
|
400
459
|
def build_view(record: CodexBuildRecord) -> dict:
|
|
401
|
-
|
|
460
|
+
payload = {
|
|
402
461
|
"id": record.id,
|
|
403
462
|
"agentId": record.agent_name,
|
|
404
463
|
"sourceRevision": record.source_revision,
|
|
@@ -412,9 +471,30 @@ class CodexAgentService:
|
|
|
412
471
|
"manifestSha256": record.manifest_sha256,
|
|
413
472
|
"runtimeLock": record.runtime_lock,
|
|
414
473
|
"runtimeName": record.runtime_name,
|
|
474
|
+
"localExecution": record.local_execution,
|
|
475
|
+
"providerBundle": (record.provider_bundle.model_dump(by_alias=True)
|
|
476
|
+
if record.provider_bundle else None),
|
|
415
477
|
"runtimeVersion": record.runtime_version,
|
|
416
478
|
"proxyMode": record.proxy_mode,
|
|
417
479
|
}
|
|
480
|
+
if record.plugin_lock is not None:
|
|
481
|
+
payload.update(
|
|
482
|
+
{
|
|
483
|
+
"pluginLock": record.plugin_lock.model_dump(
|
|
484
|
+
by_alias=True, exclude_none=True, mode="json"
|
|
485
|
+
),
|
|
486
|
+
"pluginLockDigest": record.plugin_lock_digest,
|
|
487
|
+
"pluginMarketplace": (
|
|
488
|
+
record.plugin_marketplace.model_dump(
|
|
489
|
+
by_alias=True, exclude_none=True, mode="json"
|
|
490
|
+
)
|
|
491
|
+
if record.plugin_marketplace is not None
|
|
492
|
+
else None
|
|
493
|
+
),
|
|
494
|
+
"pluginRuntimeStatus": record.plugin_runtime_status or {},
|
|
495
|
+
}
|
|
496
|
+
)
|
|
497
|
+
return payload
|
|
418
498
|
|
|
419
499
|
def submit_build(
|
|
420
500
|
self,
|
|
@@ -426,6 +506,7 @@ class CodexAgentService:
|
|
|
426
506
|
revision = self._project(self.studio.codex_manifests.load(resolved_id)).metadata.revision
|
|
427
507
|
|
|
428
508
|
async def runner(_operation_id: str):
|
|
509
|
+
await self.studio.start()
|
|
429
510
|
return await asyncio.to_thread(
|
|
430
511
|
self.studio.codex_builder.build,
|
|
431
512
|
resolved_id,
|
|
@@ -494,8 +575,7 @@ class CodexAgentService:
|
|
|
494
575
|
bindings = self._model_bindings(manifest)
|
|
495
576
|
mcp_bindings, _unresolved_mcp = self._mcp_bindings(manifest)
|
|
496
577
|
skill_bindings = [
|
|
497
|
-
CapabilityBinding(resource_id=resource_id)
|
|
498
|
-
for resource_id in (manifest.skills or [])
|
|
578
|
+
CapabilityBinding(resource_id=resource_id) for resource_id in (manifest.skills or [])
|
|
499
579
|
]
|
|
500
580
|
# 从 Manifest 恢复 PCM context/memory(方案 §5.1:Build 不可变)
|
|
501
581
|
# Manifest 已在 model_validate 时严格校验;这里直接恢复
|
|
@@ -518,6 +598,7 @@ class CodexAgentService:
|
|
|
518
598
|
draft.spec.bindings.model_profile_ids = bindings[1]
|
|
519
599
|
draft.spec.bindings.skills = skill_bindings
|
|
520
600
|
draft.spec.bindings.mcp_servers = mcp_bindings
|
|
601
|
+
draft.spec.bindings.plugins = list(manifest.plugins or [])
|
|
521
602
|
draft.spec.context = context_spec
|
|
522
603
|
draft.spec.memory = memory_spec
|
|
523
604
|
draft.metadata.labels.update(self._labels(manifest))
|
|
@@ -542,6 +623,7 @@ class CodexAgentService:
|
|
|
542
623
|
model_profile_ids=profiles,
|
|
543
624
|
skills=skill_bindings,
|
|
544
625
|
mcp_servers=mcp_bindings,
|
|
626
|
+
plugins=list(manifest.plugins or []),
|
|
545
627
|
),
|
|
546
628
|
context=context_spec,
|
|
547
629
|
memory=memory_spec,
|
|
@@ -589,6 +671,7 @@ class CodexAgentService:
|
|
|
589
671
|
soul=spec.soul,
|
|
590
672
|
skills=skill_ids or None,
|
|
591
673
|
mcp_servers=mcp_servers or None,
|
|
674
|
+
plugins=list(spec.bindings.plugins) or None,
|
|
592
675
|
sandbox=spec.execution.sandbox,
|
|
593
676
|
approval_mode=spec.execution.approval_mode,
|
|
594
677
|
context=context_payload,
|
|
@@ -668,22 +751,41 @@ class CodexAgentService:
|
|
|
668
751
|
or contract.get("url")
|
|
669
752
|
or ""
|
|
670
753
|
).strip()
|
|
671
|
-
if
|
|
672
|
-
|
|
754
|
+
transport = str(contract.get("transport") or ("http" if url else "")).lower()
|
|
755
|
+
address = (
|
|
756
|
+
json.dumps(
|
|
757
|
+
[str(contract.get("command") or ""), *(contract.get("args") or [])],
|
|
758
|
+
separators=(",", ":"),
|
|
759
|
+
)
|
|
760
|
+
if transport == "stdio"
|
|
761
|
+
else url
|
|
762
|
+
)
|
|
763
|
+
if name and address:
|
|
764
|
+
resources.setdefault((name, address), descriptor.resource_id)
|
|
673
765
|
|
|
674
766
|
bindings: builtins.list[CapabilityBinding] = []
|
|
675
767
|
unresolved: builtins.list[dict[str, str]] = []
|
|
676
768
|
for entry in manifest.mcp_servers or []:
|
|
677
769
|
name = str(entry.get("name") or "").strip()
|
|
678
|
-
|
|
679
|
-
|
|
770
|
+
transport = str(entry.get("transport") or ("http" if entry.get("url") else "")).lower()
|
|
771
|
+
address = (
|
|
772
|
+
json.dumps(
|
|
773
|
+
[str(entry.get("command") or ""), *(entry.get("args") or [])],
|
|
774
|
+
separators=(",", ":"),
|
|
775
|
+
)
|
|
776
|
+
if transport == "stdio"
|
|
777
|
+
else str(entry.get("url") or "").strip()
|
|
778
|
+
)
|
|
779
|
+
resource_id = resources.get((name, address))
|
|
680
780
|
if resource_id:
|
|
681
781
|
bindings.append(CapabilityBinding(resource_id=resource_id))
|
|
682
782
|
else:
|
|
683
|
-
unresolved.append(
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
783
|
+
unresolved.append(
|
|
784
|
+
{
|
|
785
|
+
"name": name or "未命名 MCP",
|
|
786
|
+
"reason": "not-in-resource-catalog",
|
|
787
|
+
}
|
|
788
|
+
)
|
|
687
789
|
return bindings, unresolved
|
|
688
790
|
|
|
689
791
|
@staticmethod
|
ksadk/studio/codex_builder.py
CHANGED
|
@@ -12,7 +12,7 @@ from pathlib import Path
|
|
|
12
12
|
from typing import Any, Callable, Literal, cast
|
|
13
13
|
|
|
14
14
|
import yaml # type: ignore[import-untyped]
|
|
15
|
-
from pydantic import ValidationError
|
|
15
|
+
from pydantic import ValidationError, model_validator
|
|
16
16
|
|
|
17
17
|
from ksadk.builders.managed_runtime_builder import (
|
|
18
18
|
ManagedRuntimeBuilder,
|
|
@@ -24,9 +24,25 @@ from ksadk.managed_runtime import (
|
|
|
24
24
|
validate_installed_runtime,
|
|
25
25
|
validate_runtime_binary,
|
|
26
26
|
)
|
|
27
|
+
from ksadk.plugins.artifacts import PluginArtifactReceipt
|
|
28
|
+
from ksadk.plugins.contracts import (
|
|
29
|
+
LockedPluginComponent,
|
|
30
|
+
PluginLock,
|
|
31
|
+
PluginLockEntry,
|
|
32
|
+
plugin_lock_digest,
|
|
33
|
+
)
|
|
27
34
|
from ksadk.studio.codex_manifest import CodexManifestRepository
|
|
35
|
+
from ksadk.studio.codex_plugin_store import (
|
|
36
|
+
CodexPinnedMarketplace,
|
|
37
|
+
CodexPluginSnapshotStore,
|
|
38
|
+
CodexWorkspacePluginSnapshot,
|
|
39
|
+
component_selector,
|
|
40
|
+
)
|
|
41
|
+
from ksadk.studio.codex_provider_build import CodexProviderBuildReference
|
|
28
42
|
from ksadk.studio.contracts import ContractModel, ModelSpec
|
|
29
43
|
from ksadk.studio.errors import StudioError, not_found
|
|
44
|
+
from ksadk.studio.resource_binding_validation import resource_binding_diagnostics
|
|
45
|
+
from ksadk.studio.resource_connections import ResourceConnectionRepository
|
|
30
46
|
from ksadk.studio.workspace import Workspace
|
|
31
47
|
from ksadk.version import VERSION as SDK_VERSION
|
|
32
48
|
|
|
@@ -58,8 +74,22 @@ class CodexBuildRecord(ContractModel):
|
|
|
58
74
|
# stale with an actionable rebuild; Phase 2 has not shipped yet, so the
|
|
59
75
|
# deployment path does not carry a legacy identity-migration branch.
|
|
60
76
|
model_profile_ids: list[str] | None = None
|
|
77
|
+
# Omitted for builds without native plugins so existing on-disk receipts
|
|
78
|
+
# and their historical build ids remain byte-shape compatible.
|
|
79
|
+
plugin_lock: PluginLock | None = None
|
|
80
|
+
plugin_lock_digest: str | None = None
|
|
81
|
+
plugin_marketplace: CodexPinnedMarketplace | None = None
|
|
82
|
+
plugin_runtime_status: dict[str, dict[str, Any]] | None = None
|
|
83
|
+
local_execution: Literal["legacy", "provider"] = "legacy"
|
|
84
|
+
provider_bundle: CodexProviderBuildReference | None = None
|
|
61
85
|
created_at: datetime
|
|
62
86
|
|
|
87
|
+
@model_validator(mode="after")
|
|
88
|
+
def local_execution_reference(self):
|
|
89
|
+
if (self.local_execution == "provider") != (self.provider_bundle is not None):
|
|
90
|
+
raise ValueError("Provider execution requires its complete local Bundle reference")
|
|
91
|
+
return self
|
|
92
|
+
|
|
63
93
|
|
|
64
94
|
class CodexBuildRepository:
|
|
65
95
|
def __init__(self, workspace: Workspace) -> None:
|
|
@@ -259,6 +289,10 @@ class CodexStudioBuilder:
|
|
|
259
289
|
runtime_inspector: RuntimeInspector = _inspect_runtime,
|
|
260
290
|
resource_catalog: Any = None,
|
|
261
291
|
draft_repository: Any = None,
|
|
292
|
+
plugin_snapshot_store: CodexPluginSnapshotStore | None = None,
|
|
293
|
+
resource_connections: ResourceConnectionRepository | None = None,
|
|
294
|
+
provider_build: Callable[..., CodexProviderBuildReference] | None = None,
|
|
295
|
+
provider_validate: Callable[[CodexBuildRecord], Any] | None = None,
|
|
262
296
|
) -> None:
|
|
263
297
|
self.workspace = workspace
|
|
264
298
|
self.manifests = manifest_repository or CodexManifestRepository(workspace)
|
|
@@ -266,6 +300,10 @@ class CodexStudioBuilder:
|
|
|
266
300
|
self.runtime_inspector = runtime_inspector
|
|
267
301
|
self.catalog = resource_catalog
|
|
268
302
|
self.drafts = draft_repository
|
|
303
|
+
self.plugin_snapshots = plugin_snapshot_store or CodexPluginSnapshotStore(workspace)
|
|
304
|
+
self.resource_connections = resource_connections
|
|
305
|
+
self.provider_build = provider_build
|
|
306
|
+
self.provider_validate = provider_validate
|
|
269
307
|
|
|
270
308
|
def build(
|
|
271
309
|
self,
|
|
@@ -274,16 +312,45 @@ class CodexStudioBuilder:
|
|
|
274
312
|
source_revision: int = 1,
|
|
275
313
|
) -> CodexBuildRecord:
|
|
276
314
|
snapshot = self.manifests.load(agent_id)
|
|
315
|
+
if self.resource_connections is not None:
|
|
316
|
+
diagnostics = resource_binding_diagnostics(
|
|
317
|
+
snapshot.manifest.plugins or [], snapshot.manifest.memory,
|
|
318
|
+
self.resource_connections,
|
|
319
|
+
)
|
|
320
|
+
if any(item.severity == "error" for item in diagnostics):
|
|
321
|
+
raise StudioError(
|
|
322
|
+
"RESOURCE_BINDING_VALIDATION_FAILED", "资源连接或策略校验失败",
|
|
323
|
+
status_code=422,
|
|
324
|
+
details={
|
|
325
|
+
"diagnostics": [item.model_dump(by_alias=True) for item in diagnostics]
|
|
326
|
+
},
|
|
327
|
+
)
|
|
277
328
|
model_profiles = self._model_profile_snapshot(
|
|
278
329
|
snapshot.manifest.name,
|
|
279
330
|
allowed_models=snapshot.manifest.allowed_models,
|
|
280
331
|
ignore_missing=True,
|
|
281
332
|
)
|
|
282
333
|
model_profile_ids = self._bound_model_profile_ids(snapshot.manifest.name)
|
|
334
|
+
(
|
|
335
|
+
native_plugin_lock,
|
|
336
|
+
plugin_selections,
|
|
337
|
+
plugin_runtime_status,
|
|
338
|
+
) = self._native_plugin_lock(snapshot.manifest.plugins or [])
|
|
339
|
+
native_plugin_lock_digest = (
|
|
340
|
+
plugin_lock_digest(native_plugin_lock) if native_plugin_lock.plugins else None
|
|
341
|
+
)
|
|
342
|
+
provider_bundle = (
|
|
343
|
+
self.provider_build(
|
|
344
|
+
snapshot, model_profiles, model_profile_ids, native_plugin_lock_digest,
|
|
345
|
+
)
|
|
346
|
+
if self.provider_build is not None else None
|
|
347
|
+
)
|
|
283
348
|
build_id = self._build_id(
|
|
284
349
|
snapshot.manifest_sha256,
|
|
285
350
|
model_profiles,
|
|
286
351
|
model_profile_ids=model_profile_ids,
|
|
352
|
+
plugin_lock_digest_value=native_plugin_lock_digest,
|
|
353
|
+
provider_bundle_digest=provider_bundle.digest if provider_bundle else None,
|
|
287
354
|
)
|
|
288
355
|
try:
|
|
289
356
|
existing = self.repository.get(build_id)
|
|
@@ -336,6 +403,14 @@ class CodexStudioBuilder:
|
|
|
336
403
|
"构建产物与当前 agentengine.yaml 摘要不一致",
|
|
337
404
|
status_code=500,
|
|
338
405
|
)
|
|
406
|
+
pinned_marketplace = (
|
|
407
|
+
self.plugin_snapshots.materialize_marketplace(
|
|
408
|
+
plugin_lock_digest=native_plugin_lock_digest,
|
|
409
|
+
selections=plugin_selections,
|
|
410
|
+
)
|
|
411
|
+
if native_plugin_lock_digest is not None
|
|
412
|
+
else None
|
|
413
|
+
)
|
|
339
414
|
record = CodexBuildRecord(
|
|
340
415
|
id=build_id,
|
|
341
416
|
agent_name=snapshot.manifest.name,
|
|
@@ -350,14 +425,75 @@ class CodexStudioBuilder:
|
|
|
350
425
|
runtime_lock=lock,
|
|
351
426
|
model_profiles=model_profiles,
|
|
352
427
|
model_profile_ids=model_profile_ids,
|
|
428
|
+
plugin_lock=native_plugin_lock if native_plugin_lock.plugins else None,
|
|
429
|
+
plugin_lock_digest=native_plugin_lock_digest,
|
|
430
|
+
plugin_marketplace=pinned_marketplace,
|
|
431
|
+
plugin_runtime_status=plugin_runtime_status or None,
|
|
432
|
+
local_execution="provider" if provider_bundle else "legacy",
|
|
433
|
+
provider_bundle=provider_bundle,
|
|
353
434
|
created_at=datetime.now(timezone.utc),
|
|
354
435
|
)
|
|
355
436
|
return self.repository.save(record)
|
|
356
437
|
|
|
438
|
+
def export_plugin_artifact(self, build_id: str) -> tuple[PluginArtifactReceipt, Path]:
|
|
439
|
+
"""Export frozen plugin bytes without mutating the Build or installing.
|
|
440
|
+
|
|
441
|
+
This is the C1 content boundary. Deployment must still negotiate
|
|
442
|
+
control-plane support and validate the target dependency environment.
|
|
443
|
+
"""
|
|
444
|
+
from ksadk.plugins.artifacts import export_plugin_artifact
|
|
445
|
+
|
|
446
|
+
build = self.repository.get(build_id)
|
|
447
|
+
pinned = build.plugin_marketplace
|
|
448
|
+
if pinned is None or build.plugin_lock is None:
|
|
449
|
+
raise StudioError("PLUGIN_ARTIFACT_EMPTY", "此 Build 未绑定原生插件", status_code=422)
|
|
450
|
+
if plugin_lock_digest(build.plugin_lock) != build.plugin_lock_digest:
|
|
451
|
+
raise StudioError("PLUGIN_LOCK_INVALID", "Build 插件锁摘要不匹配", status_code=422)
|
|
452
|
+
if pinned.plugin_lock_digest != build.plugin_lock_digest:
|
|
453
|
+
raise StudioError("PLUGIN_LOCK_INVALID", "插件快照与 Build 锁不匹配", status_code=422)
|
|
454
|
+
root = self.plugin_snapshots.verify_marketplace(pinned)
|
|
455
|
+
receipt, archive = export_plugin_artifact(
|
|
456
|
+
root,
|
|
457
|
+
self.workspace.resolve(".agentkit/plugin-artifacts"),
|
|
458
|
+
runtime_version=build.runtime_version,
|
|
459
|
+
plugin_lock_digest=build.plugin_lock_digest,
|
|
460
|
+
)
|
|
461
|
+
# Reject concurrent modifications; exported bytes must correspond to
|
|
462
|
+
# the frozen receipt, never a mutable workspace installation.
|
|
463
|
+
self.plugin_snapshots.verify_marketplace(pinned)
|
|
464
|
+
return receipt, archive
|
|
465
|
+
|
|
357
466
|
def is_current(self, record: CodexBuildRecord) -> bool:
|
|
467
|
+
if record.local_execution == "provider":
|
|
468
|
+
if self.provider_validate is None:
|
|
469
|
+
return False
|
|
470
|
+
try:
|
|
471
|
+
self.provider_validate(record)
|
|
472
|
+
except StudioError:
|
|
473
|
+
return False
|
|
358
474
|
snapshot = self.manifests.load(record.agent_name)
|
|
359
475
|
if record.manifest_sha256 != snapshot.manifest_sha256:
|
|
360
476
|
return False
|
|
477
|
+
current_plugin_lock, _selections, _status = self._native_plugin_lock(
|
|
478
|
+
snapshot.manifest.plugins or []
|
|
479
|
+
)
|
|
480
|
+
current_plugin_digest = (
|
|
481
|
+
plugin_lock_digest(current_plugin_lock) if current_plugin_lock.plugins else None
|
|
482
|
+
)
|
|
483
|
+
if record.plugin_lock_digest != current_plugin_digest:
|
|
484
|
+
return False
|
|
485
|
+
if record.plugin_lock is not None and record.plugin_lock != current_plugin_lock:
|
|
486
|
+
return False
|
|
487
|
+
if record.plugin_lock is None and current_plugin_lock.plugins:
|
|
488
|
+
return False
|
|
489
|
+
if record.plugin_marketplace is not None:
|
|
490
|
+
try:
|
|
491
|
+
self.plugin_snapshots.materialize_marketplace(
|
|
492
|
+
plugin_lock_digest=record.plugin_marketplace.plugin_lock_digest,
|
|
493
|
+
selections=_selections,
|
|
494
|
+
)
|
|
495
|
+
except (StudioError, ValueError):
|
|
496
|
+
return False
|
|
361
497
|
if record.model_profiles is None:
|
|
362
498
|
return True
|
|
363
499
|
if record.model_profile_ids is None:
|
|
@@ -387,13 +523,21 @@ class CodexStudioBuilder:
|
|
|
387
523
|
model_profiles: dict[str, dict[str, Any]],
|
|
388
524
|
*,
|
|
389
525
|
model_profile_ids: list[str] | None = None,
|
|
526
|
+
plugin_lock_digest_value: str | None = None,
|
|
527
|
+
provider_bundle_digest: str | None = None,
|
|
390
528
|
) -> str:
|
|
391
|
-
if not model_profiles and not model_profile_ids
|
|
529
|
+
if (not model_profiles and not model_profile_ids
|
|
530
|
+
and plugin_lock_digest_value is None and provider_bundle_digest is None):
|
|
392
531
|
return f"build_{manifest_sha256[:20]}"
|
|
393
532
|
fingerprint = json.dumps(
|
|
394
533
|
{
|
|
395
534
|
"profiles": model_profiles,
|
|
396
535
|
"resourceIds": sorted(model_profile_ids or []),
|
|
536
|
+
"pluginLockDigest": plugin_lock_digest_value,
|
|
537
|
+
**(
|
|
538
|
+
{"providerBundleDigest": provider_bundle_digest}
|
|
539
|
+
if provider_bundle_digest else {}
|
|
540
|
+
),
|
|
397
541
|
},
|
|
398
542
|
ensure_ascii=False,
|
|
399
543
|
sort_keys=True,
|
|
@@ -404,6 +548,101 @@ class CodexStudioBuilder:
|
|
|
404
548
|
digest = hashlib.sha256(f"{manifest_sha256}\n{fingerprint}".encode()).hexdigest()
|
|
405
549
|
return f"build_{digest[:20]}"
|
|
406
550
|
|
|
551
|
+
def _native_plugin_lock(
|
|
552
|
+
self,
|
|
553
|
+
bindings: list[Any] | tuple[Any, ...],
|
|
554
|
+
) -> tuple[
|
|
555
|
+
PluginLock,
|
|
556
|
+
tuple[
|
|
557
|
+
tuple[CodexWorkspacePluginSnapshot, tuple[Any, ...]],
|
|
558
|
+
...,
|
|
559
|
+
],
|
|
560
|
+
dict[str, dict[str, Any]],
|
|
561
|
+
]:
|
|
562
|
+
entries: list[PluginLockEntry] = []
|
|
563
|
+
selections: list[tuple[CodexWorkspacePluginSnapshot, tuple[Any, ...]]] = []
|
|
564
|
+
statuses: dict[str, dict[str, Any]] = {}
|
|
565
|
+
for binding in bindings:
|
|
566
|
+
if not binding.enabled:
|
|
567
|
+
continue
|
|
568
|
+
if binding.ecosystem != "codex":
|
|
569
|
+
from ksadk.resource_runtime.plugin_config import resource_plugin_config
|
|
570
|
+
|
|
571
|
+
# Official platform resources are DSH capabilities materialized by
|
|
572
|
+
# the Provider Bundle. They belong in the resource Build lock,
|
|
573
|
+
# never in Codex's native marketplace lock.
|
|
574
|
+
if resource_plugin_config(
|
|
575
|
+
binding.plugin_ref,
|
|
576
|
+
binding.ecosystem,
|
|
577
|
+
binding.config,
|
|
578
|
+
enabled=True,
|
|
579
|
+
) is not None:
|
|
580
|
+
continue
|
|
581
|
+
raise StudioError(
|
|
582
|
+
"CODEX_PLUGIN_ECOSYSTEM_UNSUPPORTED",
|
|
583
|
+
"Codex Agent 目前只能运行 Codex 原生插件绑定",
|
|
584
|
+
status_code=422,
|
|
585
|
+
details={"pluginRef": binding.plugin_ref},
|
|
586
|
+
)
|
|
587
|
+
stored = self.plugin_snapshots.load(binding.snapshot_digest)
|
|
588
|
+
if stored.plugin_ref != binding.plugin_ref:
|
|
589
|
+
raise StudioError(
|
|
590
|
+
"CODEX_PLUGIN_BINDING_MISMATCH",
|
|
591
|
+
"Codex 插件绑定与不可变快照身份不一致",
|
|
592
|
+
status_code=409,
|
|
593
|
+
details={
|
|
594
|
+
"pluginRef": binding.plugin_ref,
|
|
595
|
+
"snapshotPluginRef": stored.plugin_ref,
|
|
596
|
+
"snapshotDigest": binding.snapshot_digest,
|
|
597
|
+
},
|
|
598
|
+
)
|
|
599
|
+
selected = stored.select_components(binding.components)
|
|
600
|
+
plugin_id, version = binding.plugin_ref.removeprefix("plugin://").rsplit("@", 1)
|
|
601
|
+
components = tuple(
|
|
602
|
+
LockedPluginComponent(
|
|
603
|
+
id=component_selector(component),
|
|
604
|
+
kind=component.kind,
|
|
605
|
+
digest=component.content_digest,
|
|
606
|
+
path=component.path,
|
|
607
|
+
)
|
|
608
|
+
for component in selected
|
|
609
|
+
)
|
|
610
|
+
entries.append(
|
|
611
|
+
PluginLockEntry(
|
|
612
|
+
id=plugin_id,
|
|
613
|
+
version=version,
|
|
614
|
+
digest=stored.artifact_digest,
|
|
615
|
+
source="local" if stored.source.type == "local" else "market",
|
|
616
|
+
license=stored.manifest.license,
|
|
617
|
+
upstream=stored.source.to_plugin_source_snapshot(),
|
|
618
|
+
components=components,
|
|
619
|
+
)
|
|
620
|
+
)
|
|
621
|
+
hook_selectors = [
|
|
622
|
+
component_selector(component) for component in selected if component.kind == "hook"
|
|
623
|
+
]
|
|
624
|
+
statuses[binding.plugin_ref] = (
|
|
625
|
+
{
|
|
626
|
+
"runnable": False,
|
|
627
|
+
"hookTrust": "unsupported",
|
|
628
|
+
"reason": "official-trust-api-unavailable",
|
|
629
|
+
"components": hook_selectors,
|
|
630
|
+
}
|
|
631
|
+
if hook_selectors
|
|
632
|
+
else {"runnable": True, "hookTrust": "not-required"}
|
|
633
|
+
)
|
|
634
|
+
selections.append((stored, selected))
|
|
635
|
+
try:
|
|
636
|
+
lock = PluginLock(plugins=entries)
|
|
637
|
+
except ValueError as exc:
|
|
638
|
+
raise StudioError(
|
|
639
|
+
"CODEX_PLUGIN_LOCK_INVALID",
|
|
640
|
+
"Codex 插件绑定无法编译为唯一、精确的 PluginLock",
|
|
641
|
+
status_code=422,
|
|
642
|
+
details={"reason": str(exc)},
|
|
643
|
+
) from exc
|
|
644
|
+
return lock, tuple(selections), statuses
|
|
645
|
+
|
|
407
646
|
def _model_profile_snapshot(
|
|
408
647
|
self,
|
|
409
648
|
agent_id: str,
|