agentengine-sdk-python 0.8.3__py3-none-any.whl → 0.8.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/METADATA +9 -8
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/RECORD +482 -245
- ksadk/_build_provenance.json +1 -1
- ksadk/api/client.py +105 -91
- ksadk/builders/code_builder.py +36 -9
- ksadk/builders/framework_requirements.py +2 -1
- ksadk/builders/ks3_uploader.py +36 -7
- ksadk/builders/managed_runtime_builder.py +1 -0
- ksadk/cli/__init__.py +32 -3
- ksadk/cli/cmd_managed_runtime.py +13 -1
- ksadk/cli/cmd_plugin.py +6 -1
- ksadk/cli/cmd_web.py +2 -5
- ksadk/cli/runtime_bootstrap.py +23 -1
- ksadk/codex/client.py +424 -96
- ksadk/codex/projection.py +24 -0
- ksadk/codex/runtime.py +56 -298
- ksadk/common/auth.py +16 -10
- ksadk/configs/env_registry.py +29 -1
- ksadk/conversations/message_projection.py +135 -14
- ksadk/conversations/projector.py +4 -6
- ksadk/conversations/runtime_invocation.py +5 -0
- ksadk/conversations/runtime_payloads.py +1 -0
- ksadk/conversations/runtime_preparation.py +30 -27
- ksadk/conversations/runtime_resume.py +50 -2
- ksadk/conversations/runtime_stream_events.py +5 -0
- ksadk/conversations/runtime_streaming.py +25 -7
- ksadk/deployment/env_forward.py +2 -2
- ksadk/deployment/providers/serverless.py +1 -1
- ksadk/events/adapters/_codex_validators.py +18 -7
- ksadk/events/adapters/langgraph.py +15 -1
- ksadk/events/canonical_store.py +3 -1
- ksadk/events/projections.py +1 -1
- ksadk/harness/config.py +2 -2
- ksadk/harness/runtime.py +27 -27
- ksadk/harness/tools.py +38 -13
- ksadk/interaction/provider.py +1 -0
- ksadk/interaction/providers/langgraph.py +1 -0
- ksadk/kernel/bootstrap.py +28 -4
- ksadk/kernel/ingress.py +15 -2
- ksadk/kernel/sqlite_store.py +27 -0
- ksadk/kernel/store.py +3 -0
- ksadk/kernel/worker.py +65 -10
- ksadk/knowledge_base/client.py +57 -27
- ksadk/mcp_runtime/__init__.py +12 -4
- ksadk/memory/adk/backends/sdk_ltm_backend.py +161 -41
- ksadk/memory/adk/resilient_session_service.py +25 -17
- ksadk/memory/adk/short_term_memory.py +26 -9
- ksadk/memory/models.py +7 -4
- ksadk/memory/provider_resolver.py +3 -0
- ksadk/model_proxy/server.py +10 -5
- ksadk/plugins/__init__.py +4 -0
- ksadk/plugins/artifacts.py +275 -0
- ksadk/plugins/bridges/__init__.py +4 -2
- ksadk/plugins/bridges/codex.py +120 -13
- ksadk/plugins/bridges/dsh.py +340 -156
- ksadk/plugins/builtins.py +35 -36
- ksadk/plugins/bundle_security.py +28 -4
- ksadk/plugins/codex_manifest.py +983 -0
- ksadk/plugins/composition.py +8 -0
- ksadk/plugins/contracts.py +118 -0
- ksadk/plugins/delivery.py +153 -0
- ksadk/plugins/dsh_installation_digest.py +71 -0
- ksadk/plugins/dsh_toolchain.py +110 -21
- ksadk/plugins/ecosystem_probe.py +6 -6
- ksadk/plugins/host.py +102 -39
- ksadk/plugins/kernel_adapter.py +205 -0
- ksadk/plugins/providers/__init__.py +23 -0
- ksadk/plugins/providers/bundles/dsh-knowledge/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-knowledge/index.mjs +53 -0
- ksadk/plugins/providers/bundles/dsh-knowledge/package.json +16 -0
- ksadk/plugins/providers/bundles/dsh-memory/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-memory/index.mjs +175 -0
- ksadk/plugins/providers/bundles/dsh-memory/package.json +16 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/client.mjs +166 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/index.mjs +9 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/package.json +12 -0
- ksadk/plugins/providers/bundles/dsh-skill-center/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-skill-center/index.mjs +125 -0
- ksadk/plugins/providers/bundles/dsh-skill-center/package.json +16 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/index.mjs +870 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/package.json +27 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/client.js +92 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/index.mjs +15 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/package.json +7 -0
- ksadk/plugins/providers/codex.py +335 -69
- ksadk/plugins/providers/codex_native.py +368 -0
- ksadk/plugins/providers/codex_turn.py +301 -0
- ksadk/plugins/providers/dsh_capabilities.py +1389 -0
- ksadk/plugins/providers/dsh_mcp.py +467 -0
- ksadk/plugins/providers/harness.py +118 -113
- ksadk/plugins/providers/mcp_projection.py +150 -0
- ksadk/plugins/providers/platform_resources.py +657 -0
- ksadk/plugins/resolver.py +8 -1
- ksadk/resource_runtime/__init__.py +4 -0
- ksadk/resource_runtime/broker.py +616 -0
- ksadk/resource_runtime/build_artifacts.py +165 -0
- ksadk/resource_runtime/contracts.py +138 -0
- ksadk/resource_runtime/discovery_receipts.py +100 -0
- ksadk/resource_runtime/discovery_skills.py +172 -0
- ksadk/resource_runtime/errors.py +6 -0
- ksadk/resource_runtime/ipc.py +142 -0
- ksadk/resource_runtime/kernel_approval.py +165 -0
- ksadk/resource_runtime/knowledge.py +114 -0
- ksadk/resource_runtime/langgraph.py +94 -0
- ksadk/resource_runtime/leases.py +191 -0
- ksadk/resource_runtime/managed_projection.py +186 -0
- ksadk/resource_runtime/mcp_server.py +138 -0
- ksadk/resource_runtime/memory_provider.py +318 -0
- ksadk/resource_runtime/memory_receipts.py +34 -0
- ksadk/resource_runtime/operation_ledger.py +211 -0
- ksadk/resource_runtime/plugin_config.py +48 -0
- ksadk/resource_runtime/policy_authorization.py +54 -0
- ksadk/resource_runtime/process.py +110 -0
- ksadk/resource_runtime/skill_artifacts.py +153 -0
- ksadk/resource_runtime/skill_runtime.py +42 -0
- ksadk/resource_runtime/skill_workspace.py +118 -0
- ksadk/resource_runtime/skills.py +215 -0
- ksadk/resource_runtime/snapshots.py +180 -0
- ksadk/resource_runtime/socket_server.py +103 -0
- ksadk/resource_runtime/supervisor.py +380 -0
- ksadk/resource_runtime/worker.py +504 -0
- ksadk/runners/_langgraph_runner_streams.py +74 -6
- ksadk/runners/adk_runner.py +149 -11
- ksadk/runners/base_runner.py +29 -1
- ksadk/runners/langgraph_runner.py +475 -145
- ksadk/runtime/_runner_adapter/stream_mapping.py +142 -18
- ksadk/runtime/adapter.py +2 -0
- ksadk/runtime/conversation_execution.py +92 -16
- ksadk/runtime/executor.py +78 -2
- ksadk/runtime/factory.py +29 -273
- ksadk/runtime/framework_adapters.py +23 -0
- ksadk/runtime/preprocessing.py +10 -2
- ksadk/runtime/runner_adapter.py +73 -14
- ksadk/runtime_context.py +40 -2
- ksadk/sandbox/backends/e2b.py +52 -11
- ksadk/sandbox/backends/local_process.py +9 -0
- ksadk/sandbox/base.py +2 -0
- ksadk/sandbox/e2b_connection.py +66 -0
- ksadk/scheduler/sqlite_store.py +18 -0
- ksadk/server/composition.py +2 -0
- ksadk/server/factory.py +5 -0
- ksadk/server/persistence_capability.py +516 -0
- ksadk/server/routes/control.py +210 -46
- ksadk/server/routes/dependencies.py +15 -0
- ksadk/server/routes/models.py +47 -4
- ksadk/server/routes/projection.py +252 -12
- ksadk/server/routes/sessions.py +284 -107
- ksadk/server/routes/streaming.py +43 -9
- ksadk/server/static/assets/{ArtifactsPanel-10GPXIJ6.js → ArtifactsPanel-CGbWlMNh.js} +1 -1
- ksadk/server/static/assets/{CodeBlock-BXk1l-G1.js → CodeBlock-b4C7upmO.js} +3 -3
- ksadk/server/static/assets/{MathMessageMarkdown-D9uB55Oh.js → MathMessageMarkdown-DbdW5A4_.js} +4 -4
- ksadk/server/static/assets/{MermaidBlock--OEYoXIJ.js → MermaidBlock-BEBN4Ksz.js} +6 -6
- ksadk/server/static/assets/{NativeTerminalPanel-DrEe1syq.js → NativeTerminalPanel-zvL-WpAn.js} +1 -1
- ksadk/server/static/assets/{abnfDiagram-VCTEODGH-eeTFJLvo.js → abnfDiagram-VCTEODGH-BYafW7Za.js} +1 -1
- ksadk/server/static/assets/{arc-S3ZNbIAd.js → arc-bTohInsS.js} +1 -1
- ksadk/server/static/assets/architecture-7GRP2DOG-BW5UtSnx.js +1 -0
- ksadk/server/static/assets/{architectureDiagram-5GKGNRK7-CRjgEJDX.js → architectureDiagram-5GKGNRK7-Ch5Lbzsi.js} +1 -1
- ksadk/server/static/assets/{blockDiagram-NRAW4CY4-C7bsBoNH.js → blockDiagram-NRAW4CY4-kqF4MDOG.js} +1 -1
- ksadk/server/static/assets/{c4Diagram-UCG6FXSJ-BX3c33Ob.js → c4Diagram-UCG6FXSJ-8uSRIODv.js} +1 -1
- ksadk/server/static/assets/channel-CF5Up3hQ.js +1 -0
- ksadk/server/static/assets/chunk-2Q5K7J3B-KkXX47WI.js +1 -0
- ksadk/server/static/assets/{chunk-5VM5RSS4-bZ7ws-8m.js → chunk-5VM5RSS4-DkhehZDr.js} +1 -1
- ksadk/server/static/assets/{chunk-F27PBJKO-D2r0pvhY.js → chunk-F27PBJKO-BdXhtPe9.js} +1 -1
- ksadk/server/static/assets/{chunk-G27WJ6UU-CZwF3oUP.js → chunk-G27WJ6UU-DPTpvpwi.js} +1 -1
- ksadk/server/static/assets/{chunk-JWPE2WC7-DigFYCML.js → chunk-JWPE2WC7-Pqoh38el.js} +1 -1
- ksadk/server/static/assets/{chunk-LCL6LL3I-CnorGV5q.js → chunk-LCL6LL3I-DeU00qC-.js} +1 -1
- ksadk/server/static/assets/{chunk-POPQ4Y6H-CexntQA-.js → chunk-POPQ4Y6H-CzxScFkr.js} +1 -1
- ksadk/server/static/assets/{chunk-RHFEMEQ7-CHTC7UxA.js → chunk-RHFEMEQ7-DpqMx-ux.js} +1 -1
- ksadk/server/static/assets/{chunk-SVP7TREG-BC1EWt_-.js → chunk-SVP7TREG-C6t0SypQ.js} +1 -1
- ksadk/server/static/assets/{chunk-XXDRQBXY-BTG24xN0.js → chunk-XXDRQBXY-DVaeafZk.js} +1 -1
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-Cz81acRQ.js +1 -0
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-Cz81acRQ.js +1 -0
- ksadk/server/static/assets/{cose-bilkent-JH36ORCC-CkonRdAS.js → cose-bilkent-JH36ORCC-Bf9D3tzJ.js} +1 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-DVWs8a2t.js +1 -0
- ksadk/server/static/assets/{cynefinDiagram-5FMLGOSQ-DEOCBe15.js → cynefinDiagram-5FMLGOSQ-B9cY3iTz.js} +1 -1
- ksadk/server/static/assets/{dagre-3AP2YEHR-DBThPuLa.js → dagre-3AP2YEHR-CSwlx3CB.js} +1 -1
- ksadk/server/static/assets/{dagre-ClTPrTht.js → dagre-UBpgon5q.js} +1 -1
- ksadk/server/static/assets/{diagram-S7CK7UJ4-DsZHrnpJ.js → diagram-S7CK7UJ4-C9akhN9a.js} +1 -1
- ksadk/server/static/assets/{diagram-UQ7AKVKN-BJR4nhVr.js → diagram-UQ7AKVKN-CgedhTPI.js} +1 -1
- ksadk/server/static/assets/{diagram-VSXAHHWV-xzcERX0a.js → diagram-VSXAHHWV-Cjucz5BY.js} +1 -1
- ksadk/server/static/assets/{diagram-VX7I27RA-tn2xM1xu.js → diagram-VX7I27RA-Dd4Vleyn.js} +1 -1
- ksadk/server/static/assets/{diagram-Z3DM3KII-BZPGBkw5.js → diagram-Z3DM3KII-CZ2jGtYW.js} +1 -1
- ksadk/server/static/assets/{dist-DdRBIceA.js → dist-B2_CVgKv.js} +1 -1
- ksadk/server/static/assets/{dist-Cq4OL6nO.js → dist-B3FR1SKK.js} +1 -1
- ksadk/server/static/assets/{dist-M67Hwu0n.js → dist-BIr4DSRq.js} +1 -1
- ksadk/server/static/assets/{dist-B1oWRmrH.js → dist-BgV_owcB.js} +1 -1
- ksadk/server/static/assets/{dist-DyqV4fL4.js → dist-Bj730Ib4.js} +1 -1
- ksadk/server/static/assets/{dist-DfGFrb0v.js → dist-BnaTiyzN.js} +1 -1
- ksadk/server/static/assets/{dist-C71CsujO.js → dist-C1NMAY5a.js} +1 -1
- ksadk/server/static/assets/{dist-CXpH_Rdd.js → dist-C5_ZAZsG.js} +1 -1
- ksadk/server/static/assets/{dist-DJmCPRVB.js → dist-CB9iJrvg.js} +1 -1
- ksadk/server/static/assets/{dist-DjhwGUgZ.js → dist-CFzsn6BG.js} +1 -1
- ksadk/server/static/assets/{dist-BI1qQH4n.js → dist-Cf125P_m.js} +1 -1
- ksadk/server/static/assets/{dist-8VWI-2bZ.js → dist-ClYUxfeK.js} +1 -1
- ksadk/server/static/assets/{dist-DUwKa_l6.js → dist-DFD6Qa6T.js} +1 -1
- ksadk/server/static/assets/{dist-B-46q3Hk.js → dist-DVCOWtha.js} +1 -1
- ksadk/server/static/assets/{dist-BJLUwH6W.js → dist-D_ctSS2i.js} +1 -1
- ksadk/server/static/assets/{dist-4zN1_tq5.js → dist-DiixqL0J.js} +1 -1
- ksadk/server/static/assets/{dist-B0gdk4rl.js → dist-DoVSwoDb.js} +1 -1
- ksadk/server/static/assets/{dist-Bbwqa8TG.js → dist-DvFK7p5S.js} +1 -1
- ksadk/server/static/assets/{dist-D1V3f1B4.js → dist-QfkEHOlb.js} +1 -1
- ksadk/server/static/assets/{dist-Btyo4vX4.js → dist-btbmmX5O.js} +1 -1
- ksadk/server/static/assets/{dist-u8tVH5Ak.js → dist-fBO2v5Kt.js} +1 -1
- ksadk/server/static/assets/{dist-DQAB0qn_.js → dist-ufY3F5p6.js} +1 -1
- ksadk/server/static/assets/{ebnfDiagram-PWID7BFC-DVfMsLge.js → ebnfDiagram-PWID7BFC-Ci8NqqZu.js} +1 -1
- ksadk/server/static/assets/{erDiagram-SSCWMZ5O-CWEZSYaw.js → erDiagram-SSCWMZ5O-CCIOhLZG.js} +1 -1
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-CQqR2hg3.js +1 -0
- ksadk/server/static/assets/flowDiagram-A5DVABFB-DDRRbGPm.js +1 -0
- ksadk/server/static/assets/{ganttDiagram-EL5Y4UJY-TWIxoyYL.js → ganttDiagram-EL5Y4UJY-Cp_r9Hb6.js} +1 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-fgWEf7UD.js +1 -0
- ksadk/server/static/assets/{gitGraphDiagram-WWUBYQGX-DDh2hd2S.js → gitGraphDiagram-WWUBYQGX-Dlhc8Wr8.js} +1 -1
- ksadk/server/static/assets/index-DcTML1Up.css +2 -0
- ksadk/server/static/assets/index-Dh2XHqPK.js +244 -0
- ksadk/server/static/assets/info-A6RAGUB7-BUecLTdt.js +1 -0
- ksadk/server/static/assets/{infoDiagram-RXCK75RN-CgoyWiDR.js → infoDiagram-RXCK75RN-CO0rRTRA.js} +1 -1
- ksadk/server/static/assets/{ishikawaDiagram-5VMMS53U-CyRIu_om.js → ishikawaDiagram-5VMMS53U-CHiaedSS.js} +1 -1
- ksadk/server/static/assets/{journeyDiagram-EYS64GPL-DN5JXHzN.js → journeyDiagram-EYS64GPL-CHcCIB09.js} +1 -1
- ksadk/server/static/assets/{kanban-definition-3QL26DDD-CNP3ui66.js → kanban-definition-3QL26DDD-CJ_ebBZf.js} +1 -1
- ksadk/server/static/assets/{katex-DWEzQy1d.js → katex-B4weu383.js} +1 -1
- ksadk/server/static/assets/{linear-C-qHp7d2.js → linear-V-MgYHW1.js} +1 -1
- ksadk/server/static/assets/{mermaid-parser.core-Cl-K943T.js → mermaid-parser.core-CBijEX_c.js} +2 -2
- ksadk/server/static/assets/{mindmap-definition-FBJOCRG2-D5DB5mYm.js → mindmap-definition-FBJOCRG2-Bc-pQvpp.js} +1 -1
- ksadk/server/static/assets/packet-AYTQ26CC-BeW-btFv.js +1 -0
- ksadk/server/static/assets/{pegDiagram-XKGWAZYB-BQVc9ia_.js → pegDiagram-XKGWAZYB-D7genGLl.js} +1 -1
- ksadk/server/static/assets/pie-WAS4IAKB-X0xh4SaT.js +1 -0
- ksadk/server/static/assets/{pieDiagram-E7YTZNPT-B6UCAvtY.js → pieDiagram-E7YTZNPT-Bxj32zwD.js} +1 -1
- ksadk/server/static/assets/{quadrantDiagram-AXDQQJYC-mIr2d3eb.js → quadrantDiagram-AXDQQJYC-BURv2mGh.js} +1 -1
- ksadk/server/static/assets/radar-RG4KPBEZ-DzRMSqjd.js +1 -0
- ksadk/server/static/assets/railroad-74A4TZTK-Cc44icX-.js +1 -0
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-D6S4BdV-.js +1 -0
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-vD3aVE2o.js +1 -0
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-CYbW_b4T.js +1 -0
- ksadk/server/static/assets/{railroadDiagram-O6MQD6OU-Dt3FFDmK.js → railroadDiagram-O6MQD6OU-CCsh3avW.js} +1 -1
- ksadk/server/static/assets/{requirementDiagram-EFPCY7ZU-Cz_vQtgF.js → requirementDiagram-EFPCY7ZU-_FRRBKEd.js} +1 -1
- ksadk/server/static/assets/{sankeyDiagram-P5KCCOFB-wlO1TsH5.js → sankeyDiagram-P5KCCOFB-C-gr2o9M.js} +1 -1
- ksadk/server/static/assets/{sequenceDiagram-WJ2MYXX4-CHRbElYq.js → sequenceDiagram-WJ2MYXX4-D97NmfKg.js} +1 -1
- ksadk/server/static/assets/{sizeCapture-X5ZJPWSS-DXX54iyO.js → sizeCapture-X5ZJPWSS-DjrPC5FX.js} +1 -1
- ksadk/server/static/assets/{stateDiagram-HBIQ2CUA-Dp_lw9II.js → stateDiagram-HBIQ2CUA-DzMNg1hh.js} +1 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-BIcjKFhF.js +1 -0
- ksadk/server/static/assets/{swimlanes-XN3QIQJK-D8O5UlLG.js → swimlanes-XN3QIQJK-Cssf_CsU.js} +1 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-tq3K3Ybl.js +8 -0
- ksadk/server/static/assets/{timeline-definition-24CTP7MA-8mfKcxvG.js → timeline-definition-24CTP7MA-BWTHzyS1.js} +1 -1
- ksadk/server/static/assets/treeView-Q6P3EWNA-DBXt3GdU.js +1 -0
- ksadk/server/static/assets/treemap-WGGIJYW6-DrCy4E_l.js +1 -0
- ksadk/server/static/assets/{vennDiagram-4TSXK5OY-EnNl0DE7.js → vennDiagram-4TSXK5OY-BSKgJsmR.js} +1 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-CefhOliM.js +1 -0
- ksadk/server/static/assets/{wardleyDiagram-VM6X3IG4-DBu5fbYr.js → wardleyDiagram-VM6X3IG4-eflHNoaZ.js} +1 -1
- ksadk/server/static/assets/{xychartDiagram-S5SC5T6Z-BSVXs4IY.js → xychartDiagram-S5SC5T6Z-eYqrQ-v4.js} +1 -1
- ksadk/server/static/index.html +2 -2
- ksadk/session_context.py +66 -0
- ksadk/sessions/__init__.py +11 -21
- ksadk/sessions/_local_service_sync.py +263 -1
- ksadk/sessions/base.py +176 -0
- ksadk/sessions/errors.py +4 -0
- ksadk/sessions/in_memory.py +309 -19
- ksadk/sessions/local_service.py +83 -1
- ksadk/sessions/persistence.py +275 -0
- ksadk/sessions/postgres_service.py +358 -0
- ksadk/sessions/resilience.py +8 -0
- ksadk/sessions/resilient.py +362 -4
- ksadk/sessions/topology.py +135 -0
- ksadk/skills/models.py +26 -4
- ksadk/skills/package_store.py +186 -38
- ksadk/skills/runtime/agent.py +31 -6
- ksadk/skills/runtime/artifact_delivery.py +139 -0
- ksadk/skills/runtime/backends/e2b.py +98 -6
- ksadk/skills/runtime/backends/local.py +73 -8
- ksadk/skills/runtime/base.py +3 -0
- ksadk/skills/runtime/executor.py +2 -0
- ksadk/skills/runtime/loader.py +10 -2
- ksadk/skills/runtime/pinned.py +114 -0
- ksadk/skills/runtime/request.py +31 -0
- ksadk/skills/service_client.py +167 -28
- ksadk/studio/api.py +224 -42
- ksadk/studio/api_catalog_routes.py +18 -0
- ksadk/studio/api_plugin_routes.py +526 -95
- ksadk/studio/api_resource_connections.py +183 -0
- ksadk/studio/authoring_coordinator.py +19 -14
- ksadk/studio/builder.py +76 -0
- ksadk/studio/cloud.py +342 -104
- ksadk/studio/cloud_shared_web.py +565 -0
- ksadk/studio/codex_agent_service.py +128 -26
- ksadk/studio/codex_builder.py +241 -2
- ksadk/studio/codex_credentials.py +90 -0
- ksadk/studio/codex_manifest.py +31 -4
- ksadk/studio/codex_plugin_store.py +746 -0
- ksadk/studio/codex_provider_build.py +231 -0
- ksadk/studio/codex_run.py +184 -25
- ksadk/studio/compatibility_report.py +12 -1
- ksadk/studio/compiler.py +78 -14
- ksadk/studio/contracts.py +132 -6
- ksadk/studio/dsh_application.py +137 -0
- ksadk/studio/dsh_capability_service.py +1107 -0
- ksadk/studio/dsh_models.py +59 -0
- ksadk/studio/dsh_provider_registration.py +320 -13
- ksadk/studio/hosted_kernel.py +88 -13
- ksadk/studio/mcp_runtime.py +11 -3
- ksadk/studio/model_client.py +2 -2
- ksadk/studio/plugin_composition.py +190 -23
- ksadk/studio/plugin_kernel_adapter.py +12 -112
- ksadk/studio/plugin_runtime.py +224 -45
- ksadk/studio/resource_authority.py +637 -0
- ksadk/studio/resource_binding_validation.py +77 -0
- ksadk/studio/resource_build_admission.py +196 -0
- ksadk/studio/resource_build_materializer.py +149 -0
- ksadk/studio/resource_catalog.py +143 -2
- ksadk/studio/resource_connections.py +220 -0
- ksadk/studio/run_service.py +462 -52
- ksadk/studio/runtime_source.py +15 -7
- ksadk/studio/scheduler_assistant.py +317 -0
- ksadk/studio/scheduler_runtime.py +9 -0
- ksadk/studio/scheduler_service.py +3 -0
- ksadk/studio/service.py +490 -44
- ksadk/studio/shared_web.py +446 -62
- ksadk/studio/static/assets/CodeBlock-DCUUY0PL-BLjA7kbS.js +41 -0
- ksadk/studio/static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- ksadk/studio/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- ksadk/studio/static/assets/MathMessageMarkdown-CBcDrAw--BEOyPC3w.css +1 -0
- ksadk/studio/static/assets/MathMessageMarkdown-CBcDrAw--CUYIXwgI.js +8 -0
- ksadk/studio/static/assets/MermaidBlock-DBFTztfQ-BTYKWEbD.js +44 -0
- ksadk/studio/static/assets/PrismRenderer-wiXRHURw.js +3 -0
- ksadk/studio/static/assets/abnfDiagram-VCTEODGH-CLETGjKq.js +1 -0
- ksadk/studio/static/assets/arc-Pry-7G1_.js +1 -0
- ksadk/studio/static/assets/architecture-7GRP2DOG-hXMiO_AU.js +1 -0
- ksadk/studio/static/assets/architectureDiagram-5GKGNRK7-B5EQysk6.js +36 -0
- ksadk/studio/static/assets/array-BifhSqXX.js +1 -0
- ksadk/studio/static/assets/blockDiagram-I7D4REHJ-CFmPl1de.js +129 -0
- ksadk/studio/static/assets/c4Diagram-7LVT6UL2-BRrGu8qt.js +38 -0
- ksadk/studio/static/assets/channel-BqO-gtEw.js +1 -0
- ksadk/studio/static/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- ksadk/studio/static/assets/chunk-4HAMMTFA-D220vUtq.js +62 -0
- ksadk/studio/static/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- ksadk/studio/static/assets/chunk-75Z2AOVW-C8lLv_qc.js +2 -0
- ksadk/studio/static/assets/chunk-DU6HZSFF-C4DtVpCu.js +128 -0
- ksadk/studio/static/assets/chunk-F27PBJKO-Cpw14SNG.js +1 -0
- ksadk/studio/static/assets/chunk-FOHPRMQF-DHwB1DNv.js +161 -0
- ksadk/studio/static/assets/chunk-GMAD6QVW-DiQA-u2N.js +72 -0
- ksadk/studio/static/assets/chunk-GVQU2GXP-DUdNBUCi.js +1 -0
- ksadk/studio/static/assets/chunk-IMKFNOWR-BSlbjT_b.js +231 -0
- ksadk/studio/static/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- ksadk/studio/static/assets/chunk-L3NEJ4N5-Db8Ab22W.js +1 -0
- ksadk/studio/static/assets/chunk-OSK3NFVY-M2m6G3j4.js +10 -0
- ksadk/studio/static/assets/chunk-P2QGCYS3-DezaQxiK.js +1 -0
- ksadk/studio/static/assets/chunk-POPQ4Y6H-DOpufJ3t.js +1 -0
- ksadk/studio/static/assets/chunk-PWAF6VOD-CfLb1gSc.js +1 -0
- ksadk/studio/static/assets/chunk-SHT3W25Y-DAyIVp5H.js +168 -0
- ksadk/studio/static/assets/chunk-SVP7TREG-DulomOrS.js +88 -0
- ksadk/studio/static/assets/chunk-TICWLB2K-bHJYoflj.js +206 -0
- ksadk/studio/static/assets/chunk-XXDRQBXY-7PcdR2B1.js +1 -0
- ksadk/studio/static/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- ksadk/studio/static/assets/classDiagram-ZZMXUADV-D_bW8JjA.js +1 -0
- ksadk/studio/static/assets/classDiagram-v2-VYDZK3BY-D_bW8JjA.js +1 -0
- ksadk/studio/static/assets/cose-bilkent-JH36ORCC-snL88wkX.js +1 -0
- ksadk/studio/static/assets/cynefin-OW5HDTMX-Bd1YhRo1.js +1 -0
- ksadk/studio/static/assets/cynefinDiagram-5FMLGOSQ-BBrIG_mI.js +62 -0
- ksadk/studio/static/assets/cytoscape.esm-CGd-uY3x.js +321 -0
- ksadk/studio/static/assets/dagre-GXQ25YYZ-DtF1nGdY.js +4 -0
- ksadk/studio/static/assets/dagre-PrKaheQc.js +1 -0
- ksadk/studio/static/assets/defaultLocale-BFoDCU3G.js +1 -0
- ksadk/studio/static/assets/diagram-S7CK7UJ4-0BZ98mya.js +30 -0
- ksadk/studio/static/assets/diagram-UQ7AKVKN-6mLKEo6L.js +41 -0
- ksadk/studio/static/assets/diagram-VSXAHHWV-CJBIaiZ2.js +3 -0
- ksadk/studio/static/assets/diagram-VX7I27RA-BohLEE1C.js +24 -0
- ksadk/studio/static/assets/diagram-Z3DM3KII-D8KIGonG.js +24 -0
- ksadk/studio/static/assets/dist-v5Q1xZ2K.js +1 -0
- ksadk/studio/static/assets/ebnfDiagram-PWID7BFC-C99HU61t.js +1 -0
- ksadk/studio/static/assets/erDiagram-RLTQ6QDP-DLGry2Ap.js +99 -0
- ksadk/studio/static/assets/eventmodeling-NTZA5JFV-B1_5Ac8j.js +1 -0
- ksadk/studio/static/assets/flowDiagram-HODETNUW-DD5hmicn.js +1 -0
- ksadk/studio/static/assets/ganttDiagram-EL5Y4UJY-BPJrVLSG.js +292 -0
- ksadk/studio/static/assets/gitGraph-4MIJSDKK-Cy_ZQBGi.js +1 -0
- ksadk/studio/static/assets/gitGraphDiagram-WWUBYQGX-CZCUz4MT.js +106 -0
- ksadk/studio/static/assets/graphlib-DS17s2tU.js +1 -0
- ksadk/studio/static/assets/index-CeHL9ARV.css +2 -0
- ksadk/studio/static/assets/index-D9QEcVpL.js +320 -0
- ksadk/studio/static/assets/info-A6RAGUB7-DBzDQB_I.js +1 -0
- ksadk/studio/static/assets/infoDiagram-27XIBGKW-B-sq07Hi.js +2 -0
- ksadk/studio/static/assets/init-C-OQMol4.js +1 -0
- ksadk/studio/static/assets/ishikawaDiagram-5VMMS53U-CljI2wyf.js +70 -0
- ksadk/studio/static/assets/journeyDiagram-3NMN7TZE-D50Fo2sL.js +139 -0
- ksadk/studio/static/assets/kanban-definition-UXKFOSKX-DimfOTam.js +89 -0
- ksadk/studio/static/assets/katex-DhON-x74.js +257 -0
- ksadk/studio/static/assets/line-CX5BOOUP.js +1 -0
- ksadk/studio/static/assets/linear-BCxN9JLv.js +1 -0
- ksadk/studio/static/assets/mermaid-parser.core-BdCz8fkS.js +7 -0
- ksadk/studio/static/assets/mindmap-definition-YA3MSWOX-Bizzqy5R.js +96 -0
- ksadk/studio/static/assets/ordinal-BDEzSJ7C.js +1 -0
- ksadk/studio/static/assets/packet-AYTQ26CC-gPln-_kG.js +1 -0
- ksadk/studio/static/assets/path-fybaL0A-.js +1 -0
- ksadk/studio/static/assets/pegDiagram-XKGWAZYB-Dy3fB-gW.js +1 -0
- ksadk/studio/static/assets/pie-WAS4IAKB-qZdHMr7B.js +1 -0
- ksadk/studio/static/assets/pieDiagram-E7YTZNPT-B9mrFSDF.js +39 -0
- ksadk/studio/static/assets/quadrantDiagram-AXDQQJYC-NzUfCbMR.js +7 -0
- ksadk/studio/static/assets/radar-RG4KPBEZ-BZlnaea9.js +1 -0
- ksadk/studio/static/assets/railroad-74A4TZTK-Ce3__H9c.js +1 -0
- ksadk/studio/static/assets/railroad-abnf-HS5TGJTU-DqQn7EzD.js +1 -0
- ksadk/studio/static/assets/railroad-ebnf-LZEXJU2U-B55kCA8F.js +1 -0
- ksadk/studio/static/assets/railroad-peg-WCYAUIDC-DfQnvkHd.js +1 -0
- ksadk/studio/static/assets/railroadDiagram-O6MQD6OU-DnhMjZCk.js +1 -0
- ksadk/studio/static/assets/requirementDiagram-BXWQKSXE-BF3d103U.js +84 -0
- ksadk/studio/static/assets/rolldown-runtime-Dy4uBu1J-DK3Fl9T5.js +1 -0
- ksadk/studio/static/assets/rough.esm-Dy-Kn_BL.js +1 -0
- ksadk/studio/static/assets/sankeyDiagram-P5KCCOFB-Bo-JTwt0.js +40 -0
- ksadk/studio/static/assets/sequenceDiagram-WJ2MYXX4-Dh4wZtUm.js +162 -0
- ksadk/studio/static/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -0
- ksadk/studio/static/assets/src-SFn9St9H.js +1 -0
- ksadk/studio/static/assets/stateDiagram-D77RDMKH-DH774G6d.js +1 -0
- ksadk/studio/static/assets/stateDiagram-v2-MP3YSRHH-DZvVWPBo.js +1 -0
- ksadk/studio/static/assets/swimlanes-42K2YHIH-Bl13OvTX.js +1 -0
- ksadk/studio/static/assets/swimlanesDiagram-VR7AAH4N-BnFOTALJ.js +8 -0
- ksadk/studio/static/assets/timeline-definition-24CTP7MA-DxmSSjRB.js +120 -0
- ksadk/studio/static/assets/treeView-Q6P3EWNA-D5Nn9Swz.js +1 -0
- ksadk/studio/static/assets/treemap-WGGIJYW6-CgHgnQhE.js +1 -0
- ksadk/studio/static/assets/vennDiagram-4TSXK5OY-B9QEXcJq.js +34 -0
- ksadk/studio/static/assets/wardley-WFR3VGLG-DXrK2RRY.js +1 -0
- ksadk/studio/static/assets/wardleyDiagram-VM6X3IG4-Ba1AOWoe.js +78 -0
- ksadk/studio/static/assets/xychartDiagram-S5SC5T6Z-Cr5pt5Y-.js +7 -0
- ksadk/studio/static/index.html +2 -2
- ksadk/version.py +1 -1
- ksadk/server/static/assets/architecture-7GRP2DOG-Dk9nRQ6-.js +0 -1
- ksadk/server/static/assets/channel-s354Yo6o.js +0 -1
- ksadk/server/static/assets/chunk-2Q5K7J3B-CDpPpKR5.js +0 -1
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-Dd0nucl9.js +0 -1
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-Dd0nucl9.js +0 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-BBlT4uMf.js +0 -1
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-Dr5okd8V.js +0 -1
- ksadk/server/static/assets/flowDiagram-A5DVABFB-VEO-cVcO.js +0 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-CKiKY9Cf.js +0 -1
- ksadk/server/static/assets/index-B2k_urY8.js +0 -241
- ksadk/server/static/assets/index-ILPt6IWF.css +0 -2
- ksadk/server/static/assets/info-A6RAGUB7-ubA4Nm_p.js +0 -1
- ksadk/server/static/assets/packet-AYTQ26CC-C7R3NUlK.js +0 -1
- ksadk/server/static/assets/pie-WAS4IAKB-BIT6qjr3.js +0 -1
- ksadk/server/static/assets/radar-RG4KPBEZ-l5noef9X.js +0 -1
- ksadk/server/static/assets/railroad-74A4TZTK-Baea6ZvM.js +0 -1
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-OKn8zZnU.js +0 -1
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-DdKAKC4l.js +0 -1
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-Bds8udlG.js +0 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-5b-8o2iS.js +0 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-uf6WPRA4.js +0 -8
- ksadk/server/static/assets/treeView-Q6P3EWNA-CK5CSrSO.js +0 -1
- ksadk/server/static/assets/treemap-WGGIJYW6-Ch2BKgAM.js +0 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-YW3Q0ml_.js +0 -1
- ksadk/studio/static/assets/PrismRenderer-IYN-ffww.js +0 -3
- ksadk/studio/static/assets/index-DXs1Eq4M.css +0 -1
- ksadk/studio/static/assets/index-DeDqwTsD.js +0 -283
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/WHEEL +0 -0
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/entry_points.txt +0 -0
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/licenses/LICENSE +0 -0
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/top_level.txt +0 -0
ksadk/memory/models.py
CHANGED
|
@@ -127,6 +127,8 @@ class MemoryExtractionStatus:
|
|
|
127
127
|
status: str
|
|
128
128
|
searchable: bool = False
|
|
129
129
|
message: str = ""
|
|
130
|
+
# Query failure does not prove that the previously submitted write failed.
|
|
131
|
+
error_code: str = ""
|
|
130
132
|
|
|
131
133
|
|
|
132
134
|
def map_session_state(state: int | None) -> str:
|
|
@@ -176,7 +178,7 @@ class MemoryConflictError(MemoryOperationError):
|
|
|
176
178
|
MEMORY_MODEL_VERSION = "v1"
|
|
177
179
|
|
|
178
180
|
MemoryScope = Literal["user", "agent", "workspace", "org"]
|
|
179
|
-
MemoryType = Literal["profile", "fact", "episode"]
|
|
181
|
+
MemoryType = Literal["profile", "fact", "episode", "unknown"]
|
|
180
182
|
MemoryStatus = Literal["active", "superseded", "deleted", "expired"]
|
|
181
183
|
MemoryOperation = Literal["add", "update", "delete", "ignore"]
|
|
182
184
|
MemorySearchStatus = Literal["ok", "not_configured", "timeout", "unauthorized", "failed"]
|
|
@@ -206,8 +208,8 @@ class MemoryRecord:
|
|
|
206
208
|
content: str
|
|
207
209
|
summary: str
|
|
208
210
|
status: MemoryStatus
|
|
209
|
-
confidence: float
|
|
210
|
-
importance: float
|
|
211
|
+
confidence: float | None
|
|
212
|
+
importance: float | None
|
|
211
213
|
valid_from: str
|
|
212
214
|
valid_to: str
|
|
213
215
|
expires_at: str
|
|
@@ -215,7 +217,8 @@ class MemoryRecord:
|
|
|
215
217
|
source_event_ids: list[str]
|
|
216
218
|
source_seq_range: tuple[int, int] | None
|
|
217
219
|
content_hash: str
|
|
218
|
-
|
|
220
|
+
# None means the provider has no record revision/CAS contract.
|
|
221
|
+
version: int | None
|
|
219
222
|
metadata: dict[str, Any] = field(default_factory=dict)
|
|
220
223
|
created_at: str = ""
|
|
221
224
|
updated_at: str = ""
|
|
@@ -32,6 +32,9 @@ def resolve_memory_provider(provider_ref: str) -> MemoryProviderLike:
|
|
|
32
32
|
"""
|
|
33
33
|
ref = str(provider_ref or "").strip().lower()
|
|
34
34
|
|
|
35
|
+
if ref.startswith("binding://"):
|
|
36
|
+
raise ValueError("RESOURCE_MEMORY_BINDING_REQUIRES_ACTIVATION")
|
|
37
|
+
|
|
35
38
|
if ref in ("local-inmemory", "inmemory"):
|
|
36
39
|
from ksadk.memory.adk.backends.inmemory_ltm_backend import (
|
|
37
40
|
InMemoryLTMBackend,
|
ksadk/model_proxy/server.py
CHANGED
|
@@ -444,13 +444,18 @@ class ProxyServer:
|
|
|
444
444
|
# 应用层取消信号:让活动 SSE 的 _stream_gen 主动 break
|
|
445
445
|
self._app.state.cancel_event.set()
|
|
446
446
|
if self._server is not None:
|
|
447
|
-
#
|
|
448
|
-
#
|
|
449
|
-
#
|
|
447
|
+
# Enter Uvicorn's normal shutdown so its lifespan task receives a
|
|
448
|
+
# shutdown event. Setting force_exit here skips that event and
|
|
449
|
+
# makes every completed Studio turn print a CancelledError.
|
|
450
450
|
self._server.should_exit = True
|
|
451
|
-
self._server.force_exit = True
|
|
452
451
|
if self._thread is not None:
|
|
453
|
-
self._thread.join(timeout=
|
|
452
|
+
self._thread.join(timeout=3)
|
|
453
|
+
if self._thread.is_alive() and self._server is not None:
|
|
454
|
+
# The application cancel signal normally drains active SSE
|
|
455
|
+
# generators. Keep a bounded last resort for a broken client
|
|
456
|
+
# or upstream that ignores cancellation.
|
|
457
|
+
self._server.force_exit = True
|
|
458
|
+
self._thread.join(timeout=2)
|
|
454
459
|
if self._sock is not None:
|
|
455
460
|
try:
|
|
456
461
|
self._sock.close()
|
ksadk/plugins/__init__.py
CHANGED
|
@@ -27,8 +27,10 @@ from ksadk.plugins.context_contributor import (
|
|
|
27
27
|
from ksadk.plugins.contracts import (
|
|
28
28
|
CapabilityDefinition,
|
|
29
29
|
CompositionProfile,
|
|
30
|
+
LockedPluginComponent,
|
|
30
31
|
PluginInventory,
|
|
31
32
|
PluginLock,
|
|
33
|
+
PluginSourceSnapshot,
|
|
32
34
|
canonical_plugin_lock,
|
|
33
35
|
plugin_lock_digest,
|
|
34
36
|
)
|
|
@@ -120,6 +122,7 @@ __all__ = [
|
|
|
120
122
|
"BridgeTransitionPlan",
|
|
121
123
|
"CapabilityDefinition",
|
|
122
124
|
"CompositionProfile",
|
|
125
|
+
"LockedPluginComponent",
|
|
123
126
|
"ContextClassification",
|
|
124
127
|
"ContextContributorCacheability",
|
|
125
128
|
"ContextContributorCapabilities",
|
|
@@ -135,6 +138,7 @@ __all__ = [
|
|
|
135
138
|
"EcosystemPluginInventory",
|
|
136
139
|
"PluginInventory",
|
|
137
140
|
"PluginLock",
|
|
141
|
+
"PluginSourceSnapshot",
|
|
138
142
|
"PluginDesiredState",
|
|
139
143
|
"PluginEcosystem",
|
|
140
144
|
"PluginEcosystemBridge",
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
"""Portable plugin bytes; credentials and machine state never belong here.
|
|
2
|
+
|
|
3
|
+
The caller supplies an already verified, selected plugin tree. Delivery and
|
|
4
|
+
credential authorization remain separate from this bounded archive format.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import hashlib
|
|
10
|
+
import json
|
|
11
|
+
import os
|
|
12
|
+
import shutil
|
|
13
|
+
import stat
|
|
14
|
+
import tempfile
|
|
15
|
+
import zipfile
|
|
16
|
+
from pathlib import Path, PurePosixPath
|
|
17
|
+
from typing import Literal
|
|
18
|
+
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
20
|
+
|
|
21
|
+
MAX_FILES = 10000
|
|
22
|
+
MAX_BYTES = 256 * 1024 * 1024
|
|
23
|
+
SCHEMA = "ksadk.plugin-artifact/v1"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class PluginArtifactReceipt(BaseModel):
|
|
27
|
+
model_config = ConfigDict(extra="forbid")
|
|
28
|
+
schema_version: Literal["ksadk.plugin-artifact/v1"] = SCHEMA
|
|
29
|
+
ecosystem: Literal["codex"] = "codex"
|
|
30
|
+
runtime_version: str = Field(min_length=1)
|
|
31
|
+
plugin_lock_digest: str = Field(pattern=r"^sha256:[0-9a-f]{64}$")
|
|
32
|
+
artifact_digest: str = Field(pattern=r"^sha256:[0-9a-f]{64}$")
|
|
33
|
+
size_bytes: int = Field(gt=0, le=MAX_BYTES)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _digest(raw: bytes) -> str:
|
|
37
|
+
return "sha256:" + hashlib.sha256(raw).hexdigest()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _safe_path(value: str) -> str:
|
|
41
|
+
path = PurePosixPath(value)
|
|
42
|
+
if (
|
|
43
|
+
not value
|
|
44
|
+
or "\\" in value
|
|
45
|
+
or path.is_absolute()
|
|
46
|
+
or str(path) != value
|
|
47
|
+
or any(p in {".", ".."} for p in path.parts)
|
|
48
|
+
):
|
|
49
|
+
raise ValueError("Invalid plugin artifact path")
|
|
50
|
+
forbidden = {".credentials.json", "auth.json", "config.toml", ".git", "sessions"}
|
|
51
|
+
if any(part.lower() in forbidden or part.lower().startswith(".env") for part in path.parts):
|
|
52
|
+
raise ValueError("Plugin artifact contains credential or host state paths")
|
|
53
|
+
return value
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _zip_entry(name: str, mode: int) -> zipfile.ZipInfo:
|
|
57
|
+
info = zipfile.ZipInfo(name, date_time=(1980, 1, 1, 0, 0, 0))
|
|
58
|
+
info.create_system = 3
|
|
59
|
+
info.external_attr = (stat.S_IFREG | mode) << 16
|
|
60
|
+
info.compress_type = zipfile.ZIP_STORED
|
|
61
|
+
return info
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def export_plugin_artifact(
|
|
65
|
+
root: Path,
|
|
66
|
+
output_dir: Path,
|
|
67
|
+
*,
|
|
68
|
+
runtime_version: str,
|
|
69
|
+
plugin_lock_digest: str,
|
|
70
|
+
) -> tuple[PluginArtifactReceipt, Path]:
|
|
71
|
+
"""Package only the pinned Codex marketplace, independent of local paths."""
|
|
72
|
+
if root.is_symlink() or not root.is_dir():
|
|
73
|
+
raise ValueError("Plugin artifact root must be a real directory")
|
|
74
|
+
if output_dir.resolve().is_relative_to(root.resolve()):
|
|
75
|
+
raise ValueError("Plugin artifact output must be outside its source tree")
|
|
76
|
+
files = []
|
|
77
|
+
total = 0
|
|
78
|
+
output_dir.mkdir(parents=True, exist_ok=True)
|
|
79
|
+
fd, temporary = tempfile.mkstemp(prefix=".plugin-artifact-", dir=output_dir)
|
|
80
|
+
os.close(fd)
|
|
81
|
+
temporary_path = Path(temporary)
|
|
82
|
+
try:
|
|
83
|
+
with zipfile.ZipFile(temporary_path, "w") as archive:
|
|
84
|
+
for source in sorted(root.rglob("*")):
|
|
85
|
+
if source.is_symlink():
|
|
86
|
+
raise ValueError("Plugin artifacts cannot contain symlinks")
|
|
87
|
+
if source.is_dir():
|
|
88
|
+
_safe_path(source.relative_to(root).as_posix())
|
|
89
|
+
continue
|
|
90
|
+
if not source.is_file():
|
|
91
|
+
raise ValueError("Plugin artifacts require regular files")
|
|
92
|
+
name = _safe_path(source.relative_to(root).as_posix())
|
|
93
|
+
size = source.stat().st_size
|
|
94
|
+
total += size
|
|
95
|
+
if total > MAX_BYTES or len(files) >= MAX_FILES:
|
|
96
|
+
raise ValueError("Plugin artifact exceeds size limits")
|
|
97
|
+
with source.open("rb") as stream:
|
|
98
|
+
raw = stream.read(size + 1)
|
|
99
|
+
if len(raw) != size:
|
|
100
|
+
raise ValueError("Plugin artifact source changed during export")
|
|
101
|
+
mode = 0o644 | (source.stat().st_mode & 0o111)
|
|
102
|
+
files.append({"path": name, "digest": _digest(raw), "size": len(raw), "mode": mode})
|
|
103
|
+
archive.writestr(_zip_entry("payload/" + name, mode), raw)
|
|
104
|
+
if not files:
|
|
105
|
+
raise ValueError("Plugin artifact is empty")
|
|
106
|
+
manifest = {
|
|
107
|
+
"schema_version": SCHEMA,
|
|
108
|
+
"ecosystem": "codex",
|
|
109
|
+
"runtime_version": runtime_version,
|
|
110
|
+
"plugin_lock_digest": plugin_lock_digest,
|
|
111
|
+
"files": files,
|
|
112
|
+
}
|
|
113
|
+
archive.writestr(
|
|
114
|
+
_zip_entry("manifest.json", 0o644),
|
|
115
|
+
json.dumps(manifest, sort_keys=True, separators=(",", ":")).encode(),
|
|
116
|
+
)
|
|
117
|
+
if temporary_path.stat().st_size > MAX_BYTES:
|
|
118
|
+
raise ValueError("Plugin artifact exceeds size limits")
|
|
119
|
+
raw = temporary_path.read_bytes()
|
|
120
|
+
receipt = PluginArtifactReceipt(
|
|
121
|
+
runtime_version=runtime_version,
|
|
122
|
+
plugin_lock_digest=plugin_lock_digest,
|
|
123
|
+
artifact_digest=_digest(raw),
|
|
124
|
+
size_bytes=len(raw),
|
|
125
|
+
)
|
|
126
|
+
target = output_dir / (receipt.artifact_digest.removeprefix("sha256:") + ".zip")
|
|
127
|
+
os.replace(temporary_path, target)
|
|
128
|
+
return receipt, target
|
|
129
|
+
finally:
|
|
130
|
+
temporary_path.unlink(missing_ok=True)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def restore_plugin_artifact(
|
|
134
|
+
archive_path: Path, receipt: PluginArtifactReceipt, target: Path
|
|
135
|
+
) -> Path:
|
|
136
|
+
"""Verify a downloaded archive before atomic installation into a fresh path."""
|
|
137
|
+
if archive_path.stat().st_size != receipt.size_bytes:
|
|
138
|
+
raise ValueError("Plugin artifact size mismatch")
|
|
139
|
+
if _digest(archive_path.read_bytes()) != receipt.artifact_digest:
|
|
140
|
+
raise ValueError("Plugin artifact digest mismatch")
|
|
141
|
+
if target.exists() or target.is_symlink():
|
|
142
|
+
raise ValueError("Plugin artifact target already exists")
|
|
143
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
144
|
+
staging = Path(tempfile.mkdtemp(prefix=".plugin-restore-", dir=target.parent))
|
|
145
|
+
try:
|
|
146
|
+
with zipfile.ZipFile(archive_path) as archive:
|
|
147
|
+
entries = archive.infolist()
|
|
148
|
+
names = [entry.filename for entry in entries]
|
|
149
|
+
if len(names) != len(set(names)) or len(names) > MAX_FILES + 1:
|
|
150
|
+
raise ValueError("Duplicate or excessive plugin archive entries")
|
|
151
|
+
if sum(entry.file_size for entry in entries) > MAX_BYTES:
|
|
152
|
+
raise ValueError("Plugin archive expands beyond size limit")
|
|
153
|
+
manifest = json.loads(archive.read("manifest.json"))
|
|
154
|
+
for key in ("schema_version", "ecosystem", "runtime_version", "plugin_lock_digest"):
|
|
155
|
+
if manifest.get(key) != getattr(receipt, key):
|
|
156
|
+
raise ValueError("Plugin artifact manifest mismatch")
|
|
157
|
+
files = manifest.get("files")
|
|
158
|
+
if not isinstance(files, list) or not files:
|
|
159
|
+
raise ValueError("Missing plugin artifact file index")
|
|
160
|
+
expected = ["payload/" + _safe_path(item["path"]) for item in files]
|
|
161
|
+
if len(expected) != len(set(expected)) or set(names) != {"manifest.json", *expected}:
|
|
162
|
+
raise ValueError("Plugin artifact file index mismatch")
|
|
163
|
+
for item, name in zip(files, expected, strict=True):
|
|
164
|
+
info = archive.getinfo(name)
|
|
165
|
+
mode = info.external_attr >> 16
|
|
166
|
+
if not stat.S_ISREG(mode) or (item["mode"] & ~0o111) != 0o644:
|
|
167
|
+
raise ValueError("Plugin artifact has invalid file type or mode")
|
|
168
|
+
raw = archive.read(name)
|
|
169
|
+
if len(raw) != item["size"] or _digest(raw) != item["digest"]:
|
|
170
|
+
raise ValueError("Plugin artifact file digest mismatch")
|
|
171
|
+
destination = staging / item["path"]
|
|
172
|
+
destination.parent.mkdir(parents=True, exist_ok=True)
|
|
173
|
+
destination.write_bytes(raw)
|
|
174
|
+
destination.chmod(item["mode"])
|
|
175
|
+
os.replace(staging, target)
|
|
176
|
+
return target
|
|
177
|
+
finally:
|
|
178
|
+
if staging.exists():
|
|
179
|
+
shutil.rmtree(staging)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def restore_materialized_plugin_artifact(
|
|
183
|
+
source: Path, receipt: PluginArtifactReceipt, target: Path
|
|
184
|
+
) -> Path:
|
|
185
|
+
"""Verify an init-container-extracted artifact before atomic installation.
|
|
186
|
+
|
|
187
|
+
The init container verifies the downloaded archive digest before extraction.
|
|
188
|
+
The runtime independently verifies the portable manifest and every extracted
|
|
189
|
+
file before the marketplace becomes visible to Codex.
|
|
190
|
+
"""
|
|
191
|
+
if source.is_symlink() or not source.is_dir():
|
|
192
|
+
raise ValueError("Materialized plugin artifact must be a real directory")
|
|
193
|
+
if target.exists() or target.is_symlink():
|
|
194
|
+
raise ValueError("Plugin artifact target already exists")
|
|
195
|
+
|
|
196
|
+
manifest_path = source / "manifest.json"
|
|
197
|
+
if manifest_path.is_symlink() or not manifest_path.is_file():
|
|
198
|
+
raise ValueError("Missing plugin artifact manifest")
|
|
199
|
+
if manifest_path.stat().st_size > MAX_BYTES:
|
|
200
|
+
raise ValueError("Plugin artifact manifest exceeds size limit")
|
|
201
|
+
try:
|
|
202
|
+
manifest = json.loads(manifest_path.read_bytes())
|
|
203
|
+
except (json.JSONDecodeError, UnicodeError) as exc:
|
|
204
|
+
raise ValueError("Invalid plugin artifact manifest") from exc
|
|
205
|
+
if not isinstance(manifest, dict):
|
|
206
|
+
raise ValueError("Plugin artifact manifest must be an object")
|
|
207
|
+
for key in ("schema_version", "ecosystem", "runtime_version", "plugin_lock_digest"):
|
|
208
|
+
if manifest.get(key) != getattr(receipt, key):
|
|
209
|
+
raise ValueError("Plugin artifact manifest mismatch")
|
|
210
|
+
|
|
211
|
+
files = manifest.get("files")
|
|
212
|
+
if not isinstance(files, list) or not files or len(files) > MAX_FILES:
|
|
213
|
+
raise ValueError("Missing or excessive plugin artifact file index")
|
|
214
|
+
|
|
215
|
+
indexed: list[tuple[dict, str]] = []
|
|
216
|
+
expected = {"manifest.json"}
|
|
217
|
+
for item in files:
|
|
218
|
+
if not isinstance(item, dict):
|
|
219
|
+
raise ValueError("Invalid plugin artifact file index")
|
|
220
|
+
try:
|
|
221
|
+
name = _safe_path(item["path"])
|
|
222
|
+
size = int(item["size"])
|
|
223
|
+
mode = int(item["mode"])
|
|
224
|
+
digest = str(item["digest"])
|
|
225
|
+
except (KeyError, TypeError, ValueError) as exc:
|
|
226
|
+
raise ValueError("Invalid plugin artifact file index") from exc
|
|
227
|
+
if size < 0 or size > MAX_BYTES or (mode & ~0o111) != 0o644:
|
|
228
|
+
raise ValueError("Plugin artifact has invalid file size or mode")
|
|
229
|
+
if not digest.startswith("sha256:") or len(digest) != 71:
|
|
230
|
+
raise ValueError("Plugin artifact has invalid file digest")
|
|
231
|
+
relative = "payload/" + name
|
|
232
|
+
if relative in expected:
|
|
233
|
+
raise ValueError("Duplicate plugin artifact file index")
|
|
234
|
+
expected.add(relative)
|
|
235
|
+
indexed.append((item, relative))
|
|
236
|
+
|
|
237
|
+
actual: set[str] = set()
|
|
238
|
+
for path in source.rglob("*"):
|
|
239
|
+
relative = path.relative_to(source).as_posix()
|
|
240
|
+
if path.is_symlink():
|
|
241
|
+
raise ValueError("Plugin artifacts cannot contain symlinks")
|
|
242
|
+
if path.is_dir():
|
|
243
|
+
_safe_path(relative)
|
|
244
|
+
continue
|
|
245
|
+
if not path.is_file():
|
|
246
|
+
raise ValueError("Plugin artifacts require regular files")
|
|
247
|
+
actual.add(relative)
|
|
248
|
+
if actual != expected:
|
|
249
|
+
raise ValueError("Plugin artifact file index mismatch")
|
|
250
|
+
|
|
251
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
252
|
+
staging = Path(tempfile.mkdtemp(prefix=".plugin-restore-", dir=target.parent))
|
|
253
|
+
total = 0
|
|
254
|
+
try:
|
|
255
|
+
for item, relative in indexed:
|
|
256
|
+
source_file = source / relative
|
|
257
|
+
size = int(item["size"])
|
|
258
|
+
with source_file.open("rb") as stream:
|
|
259
|
+
raw = stream.read(size + 1)
|
|
260
|
+
total += len(raw)
|
|
261
|
+
if (
|
|
262
|
+
len(raw) != size
|
|
263
|
+
or total > MAX_BYTES
|
|
264
|
+
or _digest(raw) != item["digest"]
|
|
265
|
+
):
|
|
266
|
+
raise ValueError("Plugin artifact file digest mismatch")
|
|
267
|
+
destination = staging / item["path"]
|
|
268
|
+
destination.parent.mkdir(parents=True, exist_ok=True)
|
|
269
|
+
destination.write_bytes(raw)
|
|
270
|
+
destination.chmod(int(item["mode"]))
|
|
271
|
+
os.replace(staging, target)
|
|
272
|
+
return target
|
|
273
|
+
finally:
|
|
274
|
+
if staging.exists():
|
|
275
|
+
shutil.rmtree(staging)
|
|
@@ -7,6 +7,8 @@ not add a generic plugin execution API to KsADK.
|
|
|
7
7
|
from ksadk.plugins.bridges.codex import (
|
|
8
8
|
CodexAppServerPluginBridge,
|
|
9
9
|
CodexBridgeError,
|
|
10
|
+
CodexHostComponentDetail,
|
|
11
|
+
CodexMarketplaceAddResult,
|
|
10
12
|
CodexPluginApprovalRequired,
|
|
11
13
|
CodexPluginDetail,
|
|
12
14
|
CodexPluginInventory,
|
|
@@ -15,7 +17,6 @@ from ksadk.plugins.bridges.codex import (
|
|
|
15
17
|
from ksadk.plugins.bridges.dsh import (
|
|
16
18
|
DshBridgeError,
|
|
17
19
|
DshBridgeHost,
|
|
18
|
-
DshClientBundle,
|
|
19
20
|
DshHostUnavailableError,
|
|
20
21
|
DshPluginApprovalRequired,
|
|
21
22
|
DshPluginInventory,
|
|
@@ -28,13 +29,14 @@ from ksadk.plugins.bridges.dsh import (
|
|
|
28
29
|
__all__ = [
|
|
29
30
|
"CodexAppServerPluginBridge",
|
|
30
31
|
"CodexBridgeError",
|
|
32
|
+
"CodexHostComponentDetail",
|
|
33
|
+
"CodexMarketplaceAddResult",
|
|
31
34
|
"CodexPluginApprovalRequired",
|
|
32
35
|
"CodexPluginDetail",
|
|
33
36
|
"CodexPluginInventory",
|
|
34
37
|
"CodexPluginNotFoundError",
|
|
35
38
|
"DshBridgeError",
|
|
36
39
|
"DshBridgeHost",
|
|
37
|
-
"DshClientBundle",
|
|
38
40
|
"DshHostUnavailableError",
|
|
39
41
|
"DshPluginApprovalRequired",
|
|
40
42
|
"DshPluginInventory",
|
ksadk/plugins/bridges/codex.py
CHANGED
|
@@ -21,7 +21,7 @@ def _to_camel(value: str) -> str:
|
|
|
21
21
|
return head + "".join(part.capitalize() for part in tail)
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
class
|
|
24
|
+
class _CodexPublicModel(BaseModel):
|
|
25
25
|
model_config = ConfigDict(
|
|
26
26
|
alias_generator=_to_camel,
|
|
27
27
|
populate_by_name=True,
|
|
@@ -30,6 +30,17 @@ class _CodexWireModel(BaseModel):
|
|
|
30
30
|
)
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
class _CodexWireModel(_CodexPublicModel):
|
|
34
|
+
"""Forward-compatible model for the experimental App Server surface."""
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
alias_generator=_to_camel,
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
extra="allow",
|
|
40
|
+
frozen=True,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
33
44
|
class _LocalSource(_CodexWireModel):
|
|
34
45
|
type: Literal["local"]
|
|
35
46
|
path: str
|
|
@@ -130,7 +141,7 @@ class _PluginUninstallResponse(_CodexWireModel):
|
|
|
130
141
|
pass
|
|
131
142
|
|
|
132
143
|
|
|
133
|
-
class CodexPluginInventory(
|
|
144
|
+
class CodexPluginInventory(_CodexPublicModel):
|
|
134
145
|
"""Normalized observed state; install receipt never implies these fields."""
|
|
135
146
|
|
|
136
147
|
plugin_id: str
|
|
@@ -142,6 +153,7 @@ class CodexPluginInventory(_CodexWireModel):
|
|
|
142
153
|
enabled: bool
|
|
143
154
|
availability: str
|
|
144
155
|
source: CodexPluginSource = Field(discriminator="type")
|
|
156
|
+
interface: dict[str, Any] = Field(default_factory=dict)
|
|
145
157
|
permissions_declared: Literal[False] = False
|
|
146
158
|
risk_disclosures: tuple[str, ...] = (
|
|
147
159
|
"Codex plugin permissions are host-managed and not declared in the plugin manifest.",
|
|
@@ -149,29 +161,47 @@ class CodexPluginInventory(_CodexWireModel):
|
|
|
149
161
|
)
|
|
150
162
|
|
|
151
163
|
|
|
152
|
-
class
|
|
164
|
+
class CodexHostComponentDetail(_CodexPublicModel):
|
|
165
|
+
"""Lossless-enough projection of a component reported by ``plugin/read``."""
|
|
166
|
+
|
|
167
|
+
kind: Literal["skill", "mcp", "hook", "app", "app-template", "scheduled-task"]
|
|
168
|
+
name: str
|
|
169
|
+
path: str | None = None
|
|
170
|
+
metadata: dict[str, Any] = Field(default_factory=dict)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class CodexPluginDetail(_CodexPublicModel):
|
|
153
174
|
inventory: CodexPluginInventory
|
|
154
175
|
description: str | None = None
|
|
176
|
+
share_url: str | None = None
|
|
155
177
|
skills: tuple[str, ...] = ()
|
|
156
178
|
mcp_servers: tuple[str, ...] = ()
|
|
157
179
|
hooks: tuple[str, ...] = ()
|
|
158
180
|
apps: tuple[str, ...] = ()
|
|
159
181
|
scheduled_tasks: tuple[str, ...] = ()
|
|
182
|
+
components: tuple[CodexHostComponentDetail, ...] = ()
|
|
183
|
+
host_metadata: dict[str, Any] = Field(default_factory=dict)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
class CodexMarketplaceAddResult(_CodexPublicModel):
|
|
187
|
+
marketplace_name: str
|
|
188
|
+
installed_root: str
|
|
189
|
+
already_added: bool
|
|
160
190
|
|
|
161
191
|
|
|
162
|
-
class CodexPluginInstallResult(
|
|
192
|
+
class CodexPluginInstallResult(_CodexPublicModel):
|
|
163
193
|
inventory: CodexPluginInventory
|
|
164
194
|
auth_policy: Literal["ON_INSTALL", "ON_USE"]
|
|
165
195
|
apps_needing_auth: tuple[str, ...] = ()
|
|
166
196
|
|
|
167
197
|
|
|
168
|
-
class CodexPluginUninstallResult(
|
|
198
|
+
class CodexPluginUninstallResult(_CodexPublicModel):
|
|
169
199
|
plugin_id: str
|
|
170
200
|
installed: Literal[False] = False
|
|
171
201
|
enabled: Literal[False] = False
|
|
172
202
|
|
|
173
203
|
|
|
174
|
-
class CodexBridgeHost(
|
|
204
|
+
class CodexBridgeHost(_CodexPublicModel):
|
|
175
205
|
host_id: Literal["codex-app-server"] = "codex-app-server"
|
|
176
206
|
version: str
|
|
177
207
|
protocol: Literal["codex.app-server/v1"] = "codex.app-server/v1"
|
|
@@ -231,6 +261,63 @@ def _reported_host_version(metadata: Any) -> str:
|
|
|
231
261
|
return match.group(1) if match is not None else "unreported"
|
|
232
262
|
|
|
233
263
|
|
|
264
|
+
def _component_path(metadata: dict[str, Any]) -> str | None:
|
|
265
|
+
for field in (
|
|
266
|
+
"path",
|
|
267
|
+
"filePath",
|
|
268
|
+
"file_path",
|
|
269
|
+
"skillPath",
|
|
270
|
+
"skill_path",
|
|
271
|
+
"manifestPath",
|
|
272
|
+
"manifest_path",
|
|
273
|
+
):
|
|
274
|
+
value = metadata.get(field)
|
|
275
|
+
if isinstance(value, str) and value:
|
|
276
|
+
return value
|
|
277
|
+
return None
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
def _reported_components(plugin: _PluginDetailWire) -> tuple[CodexHostComponentDetail, ...]:
|
|
281
|
+
components: list[CodexHostComponentDetail] = []
|
|
282
|
+
|
|
283
|
+
def append(
|
|
284
|
+
kind: Literal["skill", "hook", "app", "app-template", "scheduled-task"],
|
|
285
|
+
items: tuple[dict[str, Any], ...],
|
|
286
|
+
identity_fields: tuple[str, ...],
|
|
287
|
+
) -> None:
|
|
288
|
+
for index, item in enumerate(items):
|
|
289
|
+
name = next(
|
|
290
|
+
(
|
|
291
|
+
str(item[field])
|
|
292
|
+
for field in identity_fields
|
|
293
|
+
if item.get(field) not in (None, "")
|
|
294
|
+
),
|
|
295
|
+
f"{kind}:{index}",
|
|
296
|
+
)
|
|
297
|
+
components.append(
|
|
298
|
+
CodexHostComponentDetail(
|
|
299
|
+
kind=kind,
|
|
300
|
+
name=name,
|
|
301
|
+
path=_component_path(item),
|
|
302
|
+
metadata=dict(item),
|
|
303
|
+
)
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
append("skill", plugin.skills, ("name", "id", "key"))
|
|
307
|
+
append("hook", plugin.hooks, ("key", "name", "id"))
|
|
308
|
+
append("app", plugin.apps, ("id", "name", "key"))
|
|
309
|
+
append("app-template", plugin.app_templates, ("id", "name", "key"))
|
|
310
|
+
append(
|
|
311
|
+
"scheduled-task",
|
|
312
|
+
plugin.scheduled_tasks or (),
|
|
313
|
+
("key", "name", "id"),
|
|
314
|
+
)
|
|
315
|
+
components.extend(
|
|
316
|
+
CodexHostComponentDetail(kind="mcp", name=name) for name in plugin.mcp_servers
|
|
317
|
+
)
|
|
318
|
+
return tuple(components)
|
|
319
|
+
|
|
320
|
+
|
|
234
321
|
class CodexAppServerPluginBridge:
|
|
235
322
|
"""Allowlisted Codex plugin manager backed by one App Server process."""
|
|
236
323
|
|
|
@@ -290,12 +377,27 @@ class CodexAppServerPluginBridge:
|
|
|
290
377
|
await transport.close()
|
|
291
378
|
|
|
292
379
|
async def add_marketplace(self, source: str, *, ref_name: str | None = None) -> str:
|
|
380
|
+
result = await self.add_marketplace_with_receipt(source, ref_name=ref_name)
|
|
381
|
+
return result.marketplace_name
|
|
382
|
+
|
|
383
|
+
async def add_marketplace_with_receipt(
|
|
384
|
+
self,
|
|
385
|
+
source: str,
|
|
386
|
+
*,
|
|
387
|
+
ref_name: str | None = None,
|
|
388
|
+
) -> CodexMarketplaceAddResult:
|
|
389
|
+
"""Add a marketplace while retaining its host-materialized root."""
|
|
390
|
+
|
|
293
391
|
response = await self._request(
|
|
294
392
|
"marketplace/add",
|
|
295
393
|
{"source": source, "refName": ref_name, "sparsePaths": None},
|
|
296
394
|
_MarketplaceAddResponse,
|
|
297
395
|
)
|
|
298
|
-
return
|
|
396
|
+
return CodexMarketplaceAddResult(
|
|
397
|
+
marketplace_name=response.marketplace_name,
|
|
398
|
+
installed_root=response.installed_root,
|
|
399
|
+
already_added=response.already_added,
|
|
400
|
+
)
|
|
299
401
|
|
|
300
402
|
async def list_plugins(
|
|
301
403
|
self, *, force_refetch: bool = False
|
|
@@ -324,18 +426,20 @@ class CodexAppServerPluginBridge:
|
|
|
324
426
|
_PluginReadResponse,
|
|
325
427
|
)
|
|
326
428
|
plugin = response.plugin
|
|
429
|
+
components = _reported_components(plugin)
|
|
327
430
|
return CodexPluginDetail(
|
|
328
431
|
inventory=self._inventory(marketplace, plugin.summary),
|
|
329
432
|
description=plugin.description,
|
|
330
|
-
|
|
433
|
+
share_url=plugin.share_url,
|
|
434
|
+
skills=tuple(component.name for component in components if component.kind == "skill"),
|
|
331
435
|
mcp_servers=plugin.mcp_servers,
|
|
332
|
-
hooks=tuple(
|
|
333
|
-
apps=tuple(
|
|
436
|
+
hooks=tuple(component.name for component in components if component.kind == "hook"),
|
|
437
|
+
apps=tuple(component.name for component in components if component.kind == "app"),
|
|
334
438
|
scheduled_tasks=tuple(
|
|
335
|
-
|
|
336
|
-
for item in (plugin.scheduled_tasks or ())
|
|
337
|
-
if item.get("key")
|
|
439
|
+
component.name for component in components if component.kind == "scheduled-task"
|
|
338
440
|
),
|
|
441
|
+
components=components,
|
|
442
|
+
host_metadata=dict(plugin.model_extra or {}),
|
|
339
443
|
)
|
|
340
444
|
|
|
341
445
|
async def install_plugin(
|
|
@@ -536,6 +640,7 @@ class CodexAppServerPluginBridge:
|
|
|
536
640
|
enabled=summary.enabled,
|
|
537
641
|
availability=summary.availability,
|
|
538
642
|
source=summary.source,
|
|
643
|
+
interface=summary.interface or {},
|
|
539
644
|
)
|
|
540
645
|
|
|
541
646
|
|
|
@@ -543,6 +648,8 @@ __all__ = [
|
|
|
543
648
|
"CodexAppServerPluginBridge",
|
|
544
649
|
"CodexBridgeError",
|
|
545
650
|
"CodexBridgeHost",
|
|
651
|
+
"CodexHostComponentDetail",
|
|
652
|
+
"CodexMarketplaceAddResult",
|
|
546
653
|
"CodexPluginApprovalRequired",
|
|
547
654
|
"CodexPluginDetail",
|
|
548
655
|
"CodexPluginInstallResult",
|