agentengine-sdk-python 0.8.2__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.2.dist-info → agentengine_sdk_python-0.8.4.dist-info}/METADATA +22 -28
- agentengine_sdk_python-0.8.4.dist-info/RECORD +1070 -0
- ksadk/_build_provenance.json +1 -0
- ksadk/agui/_agent_helpers.py +4 -0
- ksadk/api/client.py +108 -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 +4 -0
- ksadk/cli/__init__.py +38 -3
- ksadk/cli/cmd_managed_runtime.py +13 -1
- ksadk/cli/cmd_plugin.py +662 -0
- 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 +83 -283
- ksadk/common/auth.py +16 -10
- ksadk/configs/env_registry.py +59 -3
- ksadk/configs/settings.py +9 -0
- ksadk/context_engine/contributors.py +73 -8
- ksadk/conversations/__init__.py +19 -0
- ksadk/conversations/context.py +104 -24
- ksadk/conversations/contracts.py +266 -0
- ksadk/conversations/message_projection.py +154 -15
- ksadk/conversations/projector.py +614 -0
- ksadk/conversations/reducer.py +98 -0
- 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/_v1_compat/projection.py +2 -0
- ksadk/events/adapters/_codex_validators.py +18 -7
- ksadk/events/adapters/codex.py +190 -0
- ksadk/events/adapters/langgraph.py +15 -1
- ksadk/events/canonical_store.py +3 -1
- ksadk/events/projections.py +1 -1
- ksadk/harness/__init__.py +45 -35
- ksadk/harness/config.py +2 -2
- ksadk/harness/runtime.py +75 -16
- 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/contract_fingerprints.py +5 -4
- ksadk/kernel/contracts.py +8 -0
- ksadk/kernel/control.py +1 -0
- ksadk/kernel/ingress.py +36 -2
- ksadk/kernel/memory_store.py +1 -0
- ksadk/kernel/postgres_store.py +1 -0
- ksadk/kernel/sqlite_store.py +28 -0
- ksadk/kernel/store.py +3 -0
- ksadk/kernel/worker.py +76 -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/memory/providers/local_sqlite.py +7 -0
- ksadk/model_proxy/server.py +10 -5
- ksadk/plugins/__init__.py +171 -0
- ksadk/plugins/artifacts.py +275 -0
- ksadk/plugins/bridges/__init__.py +47 -0
- ksadk/plugins/bridges/codex.py +659 -0
- ksadk/plugins/bridges/dsh.py +1300 -0
- ksadk/plugins/builtins.py +746 -0
- ksadk/plugins/bundle.py +246 -0
- ksadk/plugins/bundle_security.py +191 -0
- ksadk/plugins/codex_manifest.py +983 -0
- ksadk/plugins/composition.py +537 -0
- ksadk/plugins/context_contributor.py +437 -0
- ksadk/plugins/contracts.py +569 -0
- ksadk/plugins/delivery.py +153 -0
- ksadk/plugins/dsh_installation_digest.py +71 -0
- ksadk/plugins/dsh_toolchain.py +1024 -0
- ksadk/plugins/ecosystem_bridge.py +1105 -0
- ksadk/plugins/ecosystem_probe.py +191 -0
- ksadk/plugins/host.py +787 -0
- ksadk/plugins/kernel_adapter.py +205 -0
- ksadk/plugins/providers/__init__.py +108 -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-codex/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/ksadk-codex/index.mjs +18 -0
- ksadk/plugins/providers/bundles/ksadk-codex/package.json +19 -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/bundles/ksadk-harness/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/ksadk-harness/index.mjs +19 -0
- ksadk/plugins/providers/bundles/ksadk-harness/package.json +19 -0
- ksadk/plugins/providers/codex.py +988 -0
- ksadk/plugins/providers/codex_dsh.py +83 -0
- ksadk/plugins/providers/codex_native.py +368 -0
- ksadk/plugins/providers/codex_turn.py +301 -0
- ksadk/plugins/providers/dsh.py +951 -0
- ksadk/plugins/providers/dsh_capabilities.py +1389 -0
- ksadk/plugins/providers/dsh_descriptor_host.py +226 -0
- ksadk/plugins/providers/dsh_mcp.py +467 -0
- ksadk/plugins/providers/harness.py +632 -0
- ksadk/plugins/providers/harness_dsh.py +91 -0
- ksadk/plugins/providers/legacy.py +215 -0
- ksadk/plugins/providers/legacy_catalog.py +100 -0
- ksadk/plugins/providers/mcp_projection.py +150 -0
- ksadk/plugins/providers/platform_resources.py +657 -0
- ksadk/plugins/providers/shipped_dsh.py +370 -0
- ksadk/plugins/resolver.py +338 -0
- ksadk/plugins/subagent_providers/__init__.py +12 -0
- ksadk/plugins/subagent_providers/codex.py +443 -0
- ksadk/plugins/subagents.py +333 -0
- 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 +193 -60
- ksadk/runtime/adapter.py +3 -0
- ksadk/runtime/conversation_execution.py +92 -16
- ksadk/runtime/executor.py +78 -2
- ksadk/runtime/factory.py +30 -200
- ksadk/runtime/framework_adapters.py +41 -0
- ksadk/runtime/preprocessing.py +10 -2
- ksadk/runtime/runner_adapter.py +78 -14
- ksadk/runtime_context.py +40 -2
- ksadk/sandbox/__init__.py +2 -1
- 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/sandbox/factory.py +72 -0
- ksadk/scheduler/__init__.py +18 -0
- ksadk/scheduler/calendar.py +102 -0
- ksadk/scheduler/contracts.py +254 -0
- ksadk/scheduler/dispatcher.py +129 -0
- ksadk/scheduler/engine.py +416 -0
- ksadk/scheduler/sqlite_store.py +581 -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-DSU1sWD_.js → ArtifactsPanel-CGbWlMNh.js} +1 -1
- ksadk/server/static/assets/{CodeBlock-DOH6MVcn.js → CodeBlock-b4C7upmO.js} +3 -3
- ksadk/server/static/assets/{MathMessageMarkdown-BL8my1R2.js → MathMessageMarkdown-DbdW5A4_.js} +4 -4
- ksadk/server/static/assets/{MermaidBlock-Dz4IP-Tx.js → MermaidBlock-BEBN4Ksz.js} +6 -6
- ksadk/server/static/assets/{NativeTerminalPanel-DUrK0JpZ.js → NativeTerminalPanel-zvL-WpAn.js} +1 -1
- ksadk/server/static/assets/{abnfDiagram-VCTEODGH-g20pFzNV.js → abnfDiagram-VCTEODGH-BYafW7Za.js} +1 -1
- ksadk/server/static/assets/{arc-C4FzinUA.js → arc-bTohInsS.js} +1 -1
- ksadk/server/static/assets/architecture-7GRP2DOG-BW5UtSnx.js +1 -0
- ksadk/server/static/assets/{architectureDiagram-5GKGNRK7-DpIqL5h4.js → architectureDiagram-5GKGNRK7-Ch5Lbzsi.js} +1 -1
- ksadk/server/static/assets/{blockDiagram-NRAW4CY4-BjkljTNz.js → blockDiagram-NRAW4CY4-kqF4MDOG.js} +1 -1
- ksadk/server/static/assets/{c4Diagram-UCG6FXSJ-Dk_ieq2X.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-BVHAchFb.js → chunk-5VM5RSS4-DkhehZDr.js} +1 -1
- ksadk/server/static/assets/{chunk-F27PBJKO-C-ipQzuS.js → chunk-F27PBJKO-BdXhtPe9.js} +1 -1
- ksadk/server/static/assets/{chunk-G27WJ6UU-C2EyJbIK.js → chunk-G27WJ6UU-DPTpvpwi.js} +1 -1
- ksadk/server/static/assets/{chunk-JWPE2WC7-vYvVJb_M.js → chunk-JWPE2WC7-Pqoh38el.js} +1 -1
- ksadk/server/static/assets/{chunk-LCL6LL3I-BcI6ysPT.js → chunk-LCL6LL3I-DeU00qC-.js} +1 -1
- ksadk/server/static/assets/{chunk-POPQ4Y6H-C030x_Z1.js → chunk-POPQ4Y6H-CzxScFkr.js} +1 -1
- ksadk/server/static/assets/{chunk-RHFEMEQ7-yyGpsz4n.js → chunk-RHFEMEQ7-DpqMx-ux.js} +1 -1
- ksadk/server/static/assets/{chunk-SVP7TREG-BLTlmMU7.js → chunk-SVP7TREG-C6t0SypQ.js} +1 -1
- ksadk/server/static/assets/{chunk-XXDRQBXY-C_32ArgP.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-9YQYwdl0.js → cose-bilkent-JH36ORCC-Bf9D3tzJ.js} +1 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-DVWs8a2t.js +1 -0
- ksadk/server/static/assets/{cynefinDiagram-5FMLGOSQ-ErLF5N13.js → cynefinDiagram-5FMLGOSQ-B9cY3iTz.js} +1 -1
- ksadk/server/static/assets/{dagre-3AP2YEHR-DFiQF-6f.js → dagre-3AP2YEHR-CSwlx3CB.js} +1 -1
- ksadk/server/static/assets/{dagre-BuhGnRI1.js → dagre-UBpgon5q.js} +1 -1
- ksadk/server/static/assets/{diagram-S7CK7UJ4-Bt1v8-GC.js → diagram-S7CK7UJ4-C9akhN9a.js} +1 -1
- ksadk/server/static/assets/{diagram-UQ7AKVKN-DSCxJdBK.js → diagram-UQ7AKVKN-CgedhTPI.js} +1 -1
- ksadk/server/static/assets/{diagram-VSXAHHWV-DHfYwp_9.js → diagram-VSXAHHWV-Cjucz5BY.js} +1 -1
- ksadk/server/static/assets/{diagram-VX7I27RA-DdzD-4Le.js → diagram-VX7I27RA-Dd4Vleyn.js} +1 -1
- ksadk/server/static/assets/{diagram-Z3DM3KII-Du-nAJ9F.js → diagram-Z3DM3KII-CZ2jGtYW.js} +1 -1
- ksadk/server/static/assets/{dist-B7seoj3d.js → dist-B2_CVgKv.js} +1 -1
- ksadk/server/static/assets/{dist-CSh_DE14.js → dist-B3FR1SKK.js} +1 -1
- ksadk/server/static/assets/{dist-DUX-id_F.js → dist-BIr4DSRq.js} +1 -1
- ksadk/server/static/assets/{dist-C_wsv-Qd.js → dist-BgV_owcB.js} +1 -1
- ksadk/server/static/assets/{dist-W-TIVntx.js → dist-Bj730Ib4.js} +1 -1
- ksadk/server/static/assets/{dist-BytlxIDT.js → dist-BnaTiyzN.js} +1 -1
- ksadk/server/static/assets/{dist-CXYYBw3_.js → dist-C1NMAY5a.js} +1 -1
- ksadk/server/static/assets/{dist-dDdADKFA.js → dist-C5_ZAZsG.js} +1 -1
- ksadk/server/static/assets/{dist-BVDffZ0U.js → dist-CB9iJrvg.js} +1 -1
- ksadk/server/static/assets/{dist-Bf2M8m3N.js → dist-CFzsn6BG.js} +1 -1
- ksadk/server/static/assets/{dist-ngtN0DJB.js → dist-Cf125P_m.js} +1 -1
- ksadk/server/static/assets/{dist-BE7bu-DL.js → dist-ClYUxfeK.js} +1 -1
- ksadk/server/static/assets/{dist-DNp6rLRA.js → dist-DFD6Qa6T.js} +1 -1
- ksadk/server/static/assets/{dist-BX8z72IC.js → dist-DVCOWtha.js} +1 -1
- ksadk/server/static/assets/{dist-dydu68Fl.js → dist-D_ctSS2i.js} +1 -1
- ksadk/server/static/assets/{dist-ClxGviKw.js → dist-DiixqL0J.js} +1 -1
- ksadk/server/static/assets/{dist-BjU6y-A2.js → dist-DoVSwoDb.js} +1 -1
- ksadk/server/static/assets/{dist-Dq9gLD7L.js → dist-DvFK7p5S.js} +1 -1
- ksadk/server/static/assets/{dist-8hqcx0sU.js → dist-QfkEHOlb.js} +1 -1
- ksadk/server/static/assets/{dist-CttYUqzS.js → dist-btbmmX5O.js} +1 -1
- ksadk/server/static/assets/{dist-DmldrHd_.js → dist-fBO2v5Kt.js} +1 -1
- ksadk/server/static/assets/{dist-DnfXs8Vn.js → dist-ufY3F5p6.js} +1 -1
- ksadk/server/static/assets/{ebnfDiagram-PWID7BFC-Da9C9NO1.js → ebnfDiagram-PWID7BFC-Ci8NqqZu.js} +1 -1
- ksadk/server/static/assets/{erDiagram-SSCWMZ5O-EAGqqR79.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-DqJsKb59.js → ganttDiagram-EL5Y4UJY-Cp_r9Hb6.js} +1 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-fgWEf7UD.js +1 -0
- ksadk/server/static/assets/{gitGraphDiagram-WWUBYQGX-B6g4dtDi.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-Djm_nbd5.js → infoDiagram-RXCK75RN-CO0rRTRA.js} +1 -1
- ksadk/server/static/assets/{ishikawaDiagram-5VMMS53U-DWya9SG2.js → ishikawaDiagram-5VMMS53U-CHiaedSS.js} +1 -1
- ksadk/server/static/assets/{journeyDiagram-EYS64GPL-DutxhSNI.js → journeyDiagram-EYS64GPL-CHcCIB09.js} +1 -1
- ksadk/server/static/assets/{kanban-definition-3QL26DDD-DJdOF8Fm.js → kanban-definition-3QL26DDD-CJ_ebBZf.js} +1 -1
- ksadk/server/static/assets/{katex-vFWytM5c.js → katex-B4weu383.js} +1 -1
- ksadk/server/static/assets/{linear-BHjG8b-J.js → linear-V-MgYHW1.js} +1 -1
- ksadk/server/static/assets/{mermaid-parser.core-KGSy4jWT.js → mermaid-parser.core-CBijEX_c.js} +2 -2
- ksadk/server/static/assets/{mindmap-definition-FBJOCRG2-9-HC88D4.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-DrEZd4fD.js → pegDiagram-XKGWAZYB-D7genGLl.js} +1 -1
- ksadk/server/static/assets/pie-WAS4IAKB-X0xh4SaT.js +1 -0
- ksadk/server/static/assets/{pieDiagram-E7YTZNPT-DpjqOFFp.js → pieDiagram-E7YTZNPT-Bxj32zwD.js} +1 -1
- ksadk/server/static/assets/{quadrantDiagram-AXDQQJYC-BiNhgOXX.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-_Y3Ojg6G.js → railroadDiagram-O6MQD6OU-CCsh3avW.js} +1 -1
- ksadk/server/static/assets/{requirementDiagram-EFPCY7ZU-DeCFdg9K.js → requirementDiagram-EFPCY7ZU-_FRRBKEd.js} +1 -1
- ksadk/server/static/assets/{sankeyDiagram-P5KCCOFB-CPH75rhw.js → sankeyDiagram-P5KCCOFB-C-gr2o9M.js} +1 -1
- ksadk/server/static/assets/{sequenceDiagram-WJ2MYXX4-OEpQQdr4.js → sequenceDiagram-WJ2MYXX4-D97NmfKg.js} +1 -1
- ksadk/server/static/assets/{sizeCapture-X5ZJPWSS-heUErzhI.js → sizeCapture-X5ZJPWSS-DjrPC5FX.js} +1 -1
- ksadk/server/static/assets/{stateDiagram-HBIQ2CUA-DvA3jSMB.js → stateDiagram-HBIQ2CUA-DzMNg1hh.js} +1 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-BIcjKFhF.js +1 -0
- ksadk/server/static/assets/{swimlanes-XN3QIQJK-CR-dfN_t.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-DAVJf1TX.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-DwM8eDkh.js → vennDiagram-4TSXK5OY-BSKgJsmR.js} +1 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-CefhOliM.js +1 -0
- ksadk/server/static/assets/{wardleyDiagram-VM6X3IG4-DZL-Zz2t.js → wardleyDiagram-VM6X3IG4-eflHNoaZ.js} +1 -1
- ksadk/server/static/assets/{xychartDiagram-S5SC5T6Z-Dy6Yh_hu.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 +211 -24
- ksadk/studio/agent_lifecycle.py +26 -20
- ksadk/studio/api.py +714 -90
- ksadk/studio/api_catalog_routes.py +23 -0
- ksadk/studio/api_contracts.py +34 -1
- ksadk/studio/api_plugin_routes.py +911 -0
- ksadk/studio/api_resource_connections.py +183 -0
- ksadk/studio/attachment_store.py +187 -0
- ksadk/studio/authoring.py +10 -4
- ksadk/studio/authoring_coordinator.py +31 -16
- ksadk/studio/builder.py +199 -43
- ksadk/studio/cloud.py +346 -104
- ksadk/studio/cloud_shared_web.py +565 -0
- ksadk/studio/codex_agent_service.py +140 -27
- ksadk/studio/codex_builder.py +294 -16
- ksadk/studio/codex_credentials.py +90 -0
- ksadk/studio/codex_manifest.py +51 -4
- ksadk/studio/codex_plugin_store.py +746 -0
- ksadk/studio/codex_provider_build.py +231 -0
- ksadk/studio/codex_run.py +200 -29
- ksadk/studio/compatibility_report.py +456 -0
- ksadk/studio/compiler.py +84 -15
- ksadk/studio/contracts.py +249 -4
- 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 +1075 -0
- ksadk/studio/event_store.py +54 -6
- ksadk/studio/framework_run.py +37 -4
- ksadk/studio/hosted_kernel.py +89 -14
- ksadk/studio/mcp_runtime.py +11 -3
- ksadk/studio/model_client.py +2 -2
- ksadk/studio/operations.py +12 -2
- ksadk/studio/plugin_composition.py +468 -0
- ksadk/studio/plugin_kernel_adapter.py +28 -0
- ksadk/studio/plugin_runtime.py +831 -0
- 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 +149 -3
- ksadk/studio/resource_connections.py +220 -0
- ksadk/studio/run_service.py +1144 -96
- ksadk/studio/runtime_source.py +24 -8
- ksadk/studio/scheduler_assistant.py +317 -0
- ksadk/studio/scheduler_runtime.py +383 -0
- ksadk/studio/scheduler_service.py +214 -0
- ksadk/studio/service.py +1131 -95
- ksadk/studio/shared_web.py +610 -87
- ksadk/studio/soul.py +52 -0
- 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/studio/validator.py +1 -1
- ksadk/studio/workspace.py +1 -0
- ksadk/version.py +1 -1
- ksadk_runtime_common/workspace_files/path_utils.py +41 -0
- agentengine_sdk_python-0.8.2.dist-info/RECORD +0 -778
- ksadk/server/static/assets/architecture-7GRP2DOG-DjKratdf.js +0 -1
- ksadk/server/static/assets/channel-4cQHKtx1.js +0 -1
- ksadk/server/static/assets/chunk-2Q5K7J3B-DmgWkESh.js +0 -1
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-DLFd9Xi0.js +0 -1
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-DLFd9Xi0.js +0 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-DjEM48Qp.js +0 -1
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-CMgMaJrC.js +0 -1
- ksadk/server/static/assets/flowDiagram-A5DVABFB-BBKL0x3P.js +0 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-Dw63mrhw.js +0 -1
- ksadk/server/static/assets/index-8ipRcQ-M.js +0 -240
- ksadk/server/static/assets/index-ByFCqjlh.css +0 -2
- ksadk/server/static/assets/info-A6RAGUB7-B6iAblII.js +0 -1
- ksadk/server/static/assets/packet-AYTQ26CC-BOYAipuq.js +0 -1
- ksadk/server/static/assets/pie-WAS4IAKB-Ctq0Kbku.js +0 -1
- ksadk/server/static/assets/radar-RG4KPBEZ-DN0-ul_0.js +0 -1
- ksadk/server/static/assets/railroad-74A4TZTK-C6cC_to0.js +0 -1
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-BimjIuRc.js +0 -1
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-CvY65ABq.js +0 -1
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-D72Iq_Tv.js +0 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-BgQY03nz.js +0 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-DLVw3q5Q.js +0 -8
- ksadk/server/static/assets/treeView-Q6P3EWNA-BMpO0wsB.js +0 -1
- ksadk/server/static/assets/treemap-WGGIJYW6-Et0aqzU3.js +0 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-CbY0mhpl.js +0 -1
- ksadk/studio/static/assets/PrismRenderer-IYN-ffww.js +0 -3
- ksadk/studio/static/assets/index-BLpcdrgW.css +0 -1
- ksadk/studio/static/assets/index-CYekR2Xv.js +0 -260
- {agentengine_sdk_python-0.8.2.dist-info → agentengine_sdk_python-0.8.4.dist-info}/WHEEL +0 -0
- {agentengine_sdk_python-0.8.2.dist-info → agentengine_sdk_python-0.8.4.dist-info}/entry_points.txt +0 -0
- {agentengine_sdk_python-0.8.2.dist-info → agentengine_sdk_python-0.8.4.dist-info}/licenses/LICENSE +0 -0
- {agentengine_sdk_python-0.8.2.dist-info → agentengine_sdk_python-0.8.4.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,746 @@
|
|
|
1
|
+
"""Built-in capability runtimes for immutable AgentBundle execution.
|
|
2
|
+
|
|
3
|
+
These plugins deliberately consume only the already validated
|
|
4
|
+
``ResolvedPluginBundle`` plus explicit process services supplied at host
|
|
5
|
+
construction. They never reach back into Studio's mutable catalogs. The
|
|
6
|
+
module also keeps rendering as a projection of the canonical ConversationItem
|
|
7
|
+
contract; it does not introduce another event or transcript pipeline.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import hashlib
|
|
13
|
+
import json
|
|
14
|
+
from collections.abc import Callable, Mapping, Sequence
|
|
15
|
+
from pathlib import Path, PurePosixPath
|
|
16
|
+
from typing import Any, cast
|
|
17
|
+
|
|
18
|
+
from ksadk.conversations.contracts import ConversationItem
|
|
19
|
+
from ksadk.events.session_event import SessionServiceEventStore
|
|
20
|
+
from ksadk.harness.config import McpToolSpec
|
|
21
|
+
from ksadk.plugins.bundle import ResolvedPluginBundle
|
|
22
|
+
from ksadk.plugins.contracts import (
|
|
23
|
+
CompositionProfile,
|
|
24
|
+
PluginManifest,
|
|
25
|
+
plugin_lock_digest,
|
|
26
|
+
)
|
|
27
|
+
from ksadk.plugins.host import PluginHostError
|
|
28
|
+
from ksadk.plugins.providers.harness import HarnessSkillContribution, HarnessTurnRequest
|
|
29
|
+
from ksadk.plugins.resolver import composition_profile_digest
|
|
30
|
+
from ksadk.sessions.base import BaseSessionService
|
|
31
|
+
from ksadk.sessions.local_service import LocalSessionService
|
|
32
|
+
|
|
33
|
+
BUILTIN_PLUGIN_VERSION = "1.0.0"
|
|
34
|
+
|
|
35
|
+
SQLITE_SESSION_STORE_PLUGIN_ID = "io.ksadk.session-store.sqlite"
|
|
36
|
+
WORKSPACE_MCP_PLUGIN_ID = "io.ksadk.mcp.workspace"
|
|
37
|
+
WORKSPACE_SKILL_PLUGIN_ID = "io.ksadk.skill.workspace"
|
|
38
|
+
READ_ONLY_CONTEXT_PLUGIN_ID = "io.ksadk.context.bundle-readonly"
|
|
39
|
+
CORE_RENDERER_PLUGIN_ID = "io.ksadk.renderer.conversation-core"
|
|
40
|
+
|
|
41
|
+
SecretResolver = Callable[[str], str | None]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _manifest_digest(plugin_id: str) -> str:
|
|
45
|
+
payload = f"{plugin_id}@{BUILTIN_PLUGIN_VERSION}:builtin-runtime-v1".encode()
|
|
46
|
+
return f"sha256:{hashlib.sha256(payload).hexdigest()}"
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _manifest(
|
|
50
|
+
plugin_id: str,
|
|
51
|
+
*,
|
|
52
|
+
definition: str,
|
|
53
|
+
slot: str,
|
|
54
|
+
mode: str,
|
|
55
|
+
permissions: Sequence[str] = (),
|
|
56
|
+
secret_fields: Sequence[str] = (),
|
|
57
|
+
) -> PluginManifest:
|
|
58
|
+
return cast(
|
|
59
|
+
PluginManifest,
|
|
60
|
+
PluginManifest.model_validate(
|
|
61
|
+
{
|
|
62
|
+
"metadata": {"id": plugin_id, "version": BUILTIN_PLUGIN_VERSION},
|
|
63
|
+
"spec": {
|
|
64
|
+
"domain": "ksadk-platform",
|
|
65
|
+
"runtime": "python",
|
|
66
|
+
"entrypoint": "ksadk.plugins.builtins:builtin_capability_factories",
|
|
67
|
+
"provides": [{"definition": definition, "slot": slot, "mode": mode}],
|
|
68
|
+
"secretFields": list(secret_fields),
|
|
69
|
+
"permissions": list(permissions),
|
|
70
|
+
"isolation": "in-process",
|
|
71
|
+
"compatibility": {
|
|
72
|
+
"kernelApi": ">=1,<2",
|
|
73
|
+
"runtimeProtocols": ["agentkit.runtime/v1"],
|
|
74
|
+
"python": ">=3.10,<3.15",
|
|
75
|
+
},
|
|
76
|
+
"healthContract": "plugin.health/v1",
|
|
77
|
+
"provenance": {
|
|
78
|
+
"source": "builtin",
|
|
79
|
+
"digest": _manifest_digest(plugin_id),
|
|
80
|
+
"license": "Apache-2.0",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
),
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def builtin_capability_manifests() -> tuple[PluginManifest, ...]:
|
|
89
|
+
"""Return the exact, deterministic Phase 2 built-in capability catalog."""
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
_manifest(
|
|
93
|
+
SQLITE_SESSION_STORE_PLUGIN_ID,
|
|
94
|
+
definition="session.event-store/v1",
|
|
95
|
+
slot="session.events",
|
|
96
|
+
mode="unique",
|
|
97
|
+
permissions=("filesystem:session-store",),
|
|
98
|
+
),
|
|
99
|
+
_manifest(
|
|
100
|
+
WORKSPACE_MCP_PLUGIN_ID,
|
|
101
|
+
definition="mcp.connector/v1",
|
|
102
|
+
slot="mcp.workspace",
|
|
103
|
+
mode="multiple",
|
|
104
|
+
permissions=("network:mcp",),
|
|
105
|
+
secret_fields=("apiKeyRef",),
|
|
106
|
+
),
|
|
107
|
+
_manifest(
|
|
108
|
+
WORKSPACE_SKILL_PLUGIN_ID,
|
|
109
|
+
definition="skill.source/v1",
|
|
110
|
+
slot="skill.workspace",
|
|
111
|
+
mode="multiple",
|
|
112
|
+
permissions=("filesystem:bundle-read",),
|
|
113
|
+
),
|
|
114
|
+
_manifest(
|
|
115
|
+
READ_ONLY_CONTEXT_PLUGIN_ID,
|
|
116
|
+
definition="context.contributor/v1",
|
|
117
|
+
slot="context.bundle",
|
|
118
|
+
mode="multiple",
|
|
119
|
+
permissions=("filesystem:bundle-read",),
|
|
120
|
+
),
|
|
121
|
+
_manifest(
|
|
122
|
+
CORE_RENDERER_PLUGIN_ID,
|
|
123
|
+
definition="session.item.renderer/v1",
|
|
124
|
+
slot="renderer.core",
|
|
125
|
+
mode="multiple",
|
|
126
|
+
),
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def builtin_capability_permissions(
|
|
131
|
+
profile: CompositionProfile,
|
|
132
|
+
) -> frozenset[str]:
|
|
133
|
+
"""Return host-owned permissions for built-ins selected by one Profile.
|
|
134
|
+
|
|
135
|
+
Studio's built-in session store, context, renderer, MCP and Skill adapters
|
|
136
|
+
are part of the trusted PluginHost distribution. Their narrow permissions
|
|
137
|
+
are granted by that host rather than copied into every user-authored Agent
|
|
138
|
+
revision. Only exact built-in capability references present in the resolved
|
|
139
|
+
Profile contribute permissions; AgentProvider permissions remain subject to
|
|
140
|
+
the Agent's explicit security policy.
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
selected_refs = {capability.ref for capability in profile.capabilities}
|
|
144
|
+
permissions: set[str] = set()
|
|
145
|
+
for manifest in builtin_capability_manifests():
|
|
146
|
+
reference = f"plugin://{manifest.metadata.id}@{manifest.metadata.version}"
|
|
147
|
+
if reference in selected_refs:
|
|
148
|
+
permissions.update(manifest.spec.permissions)
|
|
149
|
+
return frozenset(permissions)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
class _BuiltinRuntime:
|
|
153
|
+
def __init__(self, plugin_id: str, version: str) -> None:
|
|
154
|
+
self.plugin_id = plugin_id
|
|
155
|
+
self.version = version
|
|
156
|
+
self._ready = False
|
|
157
|
+
self._disposed = False
|
|
158
|
+
|
|
159
|
+
async def start(self) -> None:
|
|
160
|
+
if self._disposed:
|
|
161
|
+
raise PluginHostError(
|
|
162
|
+
"builtin_capability_disposed",
|
|
163
|
+
f"built-in capability {self.plugin_id}@{self.version} is disposed",
|
|
164
|
+
)
|
|
165
|
+
self._ready = True
|
|
166
|
+
|
|
167
|
+
async def health(self) -> bool:
|
|
168
|
+
return self._ready and not self._disposed
|
|
169
|
+
|
|
170
|
+
async def drain(self) -> None:
|
|
171
|
+
self._ready = False
|
|
172
|
+
|
|
173
|
+
async def dispose(self) -> None:
|
|
174
|
+
self._ready = False
|
|
175
|
+
self._disposed = True
|
|
176
|
+
|
|
177
|
+
def _require_ready(self) -> None:
|
|
178
|
+
if not self._ready or self._disposed:
|
|
179
|
+
raise PluginHostError(
|
|
180
|
+
"builtin_capability_unavailable",
|
|
181
|
+
f"built-in capability {self.plugin_id}@{self.version} is not ready",
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
def _config(self, bundle: ResolvedPluginBundle) -> Mapping[str, Any]:
|
|
185
|
+
self._require_ready()
|
|
186
|
+
return _bound_capability_config(bundle, self.plugin_id, self.version)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
class SQLiteSessionStoreRuntime(_BuiltinRuntime):
|
|
190
|
+
"""Own one durable SQLite session service for an active profile."""
|
|
191
|
+
|
|
192
|
+
def __init__(self, plugin_id: str, version: str, *, db_path: Path) -> None:
|
|
193
|
+
super().__init__(plugin_id, version)
|
|
194
|
+
self.db_path = db_path.resolve()
|
|
195
|
+
self._service: LocalSessionService | None = None
|
|
196
|
+
self._event_store: SessionServiceEventStore | None = None
|
|
197
|
+
|
|
198
|
+
async def start(self) -> None:
|
|
199
|
+
if self._disposed:
|
|
200
|
+
await super().start()
|
|
201
|
+
try:
|
|
202
|
+
self._service = LocalSessionService(self.db_path)
|
|
203
|
+
self._event_store = SessionServiceEventStore(self._service)
|
|
204
|
+
except Exception as error: # noqa: BLE001 - durable backend boundary
|
|
205
|
+
self._service = None
|
|
206
|
+
self._event_store = None
|
|
207
|
+
raise PluginHostError(
|
|
208
|
+
"builtin_session_store_start_failed",
|
|
209
|
+
"SQLite session store could not be initialized",
|
|
210
|
+
) from error
|
|
211
|
+
self._ready = True
|
|
212
|
+
|
|
213
|
+
def session_service_for(self, bundle: ResolvedPluginBundle) -> BaseSessionService:
|
|
214
|
+
self._config(bundle)
|
|
215
|
+
if self._service is None: # pragma: no cover - protected by lifecycle
|
|
216
|
+
raise PluginHostError(
|
|
217
|
+
"builtin_capability_unavailable", "SQLite session service is unavailable"
|
|
218
|
+
)
|
|
219
|
+
return self._service
|
|
220
|
+
|
|
221
|
+
def event_store_for(self, bundle: ResolvedPluginBundle) -> SessionServiceEventStore:
|
|
222
|
+
self._config(bundle)
|
|
223
|
+
if self._event_store is None: # pragma: no cover - protected by lifecycle
|
|
224
|
+
raise PluginHostError(
|
|
225
|
+
"builtin_capability_unavailable", "SQLite event store is unavailable"
|
|
226
|
+
)
|
|
227
|
+
return self._event_store
|
|
228
|
+
|
|
229
|
+
async def dispose(self) -> None:
|
|
230
|
+
service = self._service
|
|
231
|
+
self._ready = False
|
|
232
|
+
self._disposed = True
|
|
233
|
+
if service is not None:
|
|
234
|
+
await service.aclose()
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
class WorkspaceMCPRuntime(_BuiltinRuntime):
|
|
238
|
+
"""Materialize locked workspace MCP resources for the Harness provider."""
|
|
239
|
+
|
|
240
|
+
def __init__(
|
|
241
|
+
self,
|
|
242
|
+
plugin_id: str,
|
|
243
|
+
version: str,
|
|
244
|
+
*,
|
|
245
|
+
secret_resolver: SecretResolver | None,
|
|
246
|
+
) -> None:
|
|
247
|
+
super().__init__(plugin_id, version)
|
|
248
|
+
self._secret_resolver = secret_resolver
|
|
249
|
+
|
|
250
|
+
def inventory(self, bundle: ResolvedPluginBundle) -> tuple[dict[str, Any], ...]:
|
|
251
|
+
resources = self._resources(bundle)
|
|
252
|
+
inventory: list[dict[str, Any]] = []
|
|
253
|
+
for materializer, resolved in resources:
|
|
254
|
+
inventory.append(
|
|
255
|
+
{
|
|
256
|
+
"name": resolved["name"],
|
|
257
|
+
"version": resolved["version"],
|
|
258
|
+
"transport": resolved["transport"],
|
|
259
|
+
"endpointUrl": resolved.get("endpointUrl"),
|
|
260
|
+
"toolFilter": tuple(_string_list(materializer.get("toolFilter"))),
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
return tuple(inventory)
|
|
264
|
+
|
|
265
|
+
def harness_mcp_specs(self, bundle: ResolvedPluginBundle) -> tuple[McpToolSpec, ...]:
|
|
266
|
+
specs: list[McpToolSpec] = []
|
|
267
|
+
for materializer, resolved in self._resources(bundle):
|
|
268
|
+
transport = _required_string(resolved, "transport", code="builtin_mcp_invalid")
|
|
269
|
+
if transport not in {"http", "sse"}:
|
|
270
|
+
raise PluginHostError(
|
|
271
|
+
"builtin_mcp_transport_unsupported",
|
|
272
|
+
f"workspace MCP {resolved['name']!r} uses unsupported transport",
|
|
273
|
+
)
|
|
274
|
+
endpoint = _required_string(
|
|
275
|
+
resolved, "endpointUrl", code="builtin_mcp_endpoint_missing"
|
|
276
|
+
)
|
|
277
|
+
secret_ref = _optional_string(materializer.get("apiKeyRef"))
|
|
278
|
+
api_key: str | None = None
|
|
279
|
+
if secret_ref is not None:
|
|
280
|
+
if not _is_secret_reference(secret_ref):
|
|
281
|
+
raise PluginHostError(
|
|
282
|
+
"builtin_mcp_secret_ref_invalid",
|
|
283
|
+
"workspace MCP apiKeyRef must be an external secret reference",
|
|
284
|
+
)
|
|
285
|
+
if self._secret_resolver is None:
|
|
286
|
+
raise PluginHostError(
|
|
287
|
+
"builtin_mcp_secret_unavailable",
|
|
288
|
+
"workspace MCP credential resolver is unavailable",
|
|
289
|
+
)
|
|
290
|
+
try:
|
|
291
|
+
api_key = self._secret_resolver(secret_ref)
|
|
292
|
+
except Exception as error: # noqa: BLE001 - secret-provider boundary
|
|
293
|
+
raise PluginHostError(
|
|
294
|
+
"builtin_mcp_secret_unavailable",
|
|
295
|
+
"workspace MCP credential could not be resolved",
|
|
296
|
+
) from error
|
|
297
|
+
if not api_key:
|
|
298
|
+
raise PluginHostError(
|
|
299
|
+
"builtin_mcp_secret_unavailable",
|
|
300
|
+
"workspace MCP credential could not be resolved",
|
|
301
|
+
)
|
|
302
|
+
specs.append(
|
|
303
|
+
McpToolSpec(
|
|
304
|
+
name=_required_string(resolved, "name", code="builtin_mcp_invalid"),
|
|
305
|
+
url=endpoint,
|
|
306
|
+
api_key=api_key,
|
|
307
|
+
tool_filter=tuple(_string_list(materializer.get("toolFilter"))),
|
|
308
|
+
tool_name_prefix=_optional_string(materializer.get("toolNamePrefix")),
|
|
309
|
+
)
|
|
310
|
+
)
|
|
311
|
+
return tuple(specs)
|
|
312
|
+
|
|
313
|
+
def _resources(
|
|
314
|
+
self, bundle: ResolvedPluginBundle
|
|
315
|
+
) -> tuple[tuple[Mapping[str, Any], Mapping[str, Any]], ...]:
|
|
316
|
+
config = self._config(bundle)
|
|
317
|
+
declared = _resource_entries(config, expected_kind="mcp")
|
|
318
|
+
resolved = _resolved_resources(bundle, "mcpServers")
|
|
319
|
+
return tuple(
|
|
320
|
+
(
|
|
321
|
+
_mapping(entry.get("materializer"), code="builtin_mcp_invalid"),
|
|
322
|
+
_match_resource(entry, resolved, code="builtin_mcp_resource_mismatch"),
|
|
323
|
+
)
|
|
324
|
+
for entry in declared
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
class WorkspaceSkillRuntime(_BuiltinRuntime):
|
|
329
|
+
"""Expose integrity-checked Skill instructions copied into the Bundle."""
|
|
330
|
+
|
|
331
|
+
def harness_skill(self, bundle: ResolvedPluginBundle) -> HarnessSkillContribution:
|
|
332
|
+
config = self._config(bundle)
|
|
333
|
+
declared = _resource_entries(config, expected_kind="skill")
|
|
334
|
+
resolved = _resolved_resources(bundle, "skills")
|
|
335
|
+
contributions: list[HarnessSkillContribution] = []
|
|
336
|
+
for entry in declared:
|
|
337
|
+
item = _match_resource(entry, resolved, code="builtin_skill_resource_mismatch")
|
|
338
|
+
name = _required_string(item, "name", code="builtin_skill_invalid")
|
|
339
|
+
bundle_path = _required_string(item, "bundlePath", code="builtin_skill_path_invalid")
|
|
340
|
+
directory = _safe_bundle_path(
|
|
341
|
+
bundle,
|
|
342
|
+
bundle_path,
|
|
343
|
+
code="builtin_skill_path_invalid",
|
|
344
|
+
require_declared=False,
|
|
345
|
+
)
|
|
346
|
+
if not directory.is_dir() or directory.is_symlink():
|
|
347
|
+
raise PluginHostError(
|
|
348
|
+
"builtin_skill_path_invalid", f"Skill {name!r} is not a Bundle directory"
|
|
349
|
+
)
|
|
350
|
+
expected_digest = _required_string(item, "digest", code="builtin_skill_invalid")
|
|
351
|
+
if _directory_digest(directory) != expected_digest:
|
|
352
|
+
raise PluginHostError(
|
|
353
|
+
"builtin_skill_digest_mismatch",
|
|
354
|
+
f"Skill {name!r} does not match its locked Bundle digest",
|
|
355
|
+
)
|
|
356
|
+
instructions = _required_string(
|
|
357
|
+
item, "instructions", code="builtin_skill_instructions_missing"
|
|
358
|
+
)
|
|
359
|
+
contributions.append(HarnessSkillContribution(name=name, instructions=instructions))
|
|
360
|
+
if not contributions:
|
|
361
|
+
raise PluginHostError(
|
|
362
|
+
"builtin_skill_resource_missing", "workspace Skill has no locked resource"
|
|
363
|
+
)
|
|
364
|
+
if len(contributions) == 1:
|
|
365
|
+
return contributions[0]
|
|
366
|
+
return HarnessSkillContribution(
|
|
367
|
+
name="workspace-skills",
|
|
368
|
+
instructions="\n\n".join(
|
|
369
|
+
f"Skill {item.name}:\n{item.instructions}" for item in contributions
|
|
370
|
+
),
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
class ReadOnlyBundleContextRuntime(_BuiltinRuntime):
|
|
375
|
+
"""Read declared UTF-8 context files from the immutable Bundle only."""
|
|
376
|
+
|
|
377
|
+
async def harness_context(
|
|
378
|
+
self, bundle: ResolvedPluginBundle, request: HarnessTurnRequest
|
|
379
|
+
) -> str:
|
|
380
|
+
del request
|
|
381
|
+
config = self._config(bundle)
|
|
382
|
+
paths = _string_list(config.get("paths"))
|
|
383
|
+
max_chars = config.get("maxChars", 32_000)
|
|
384
|
+
if not isinstance(max_chars, int) or isinstance(max_chars, bool) or max_chars < 1:
|
|
385
|
+
raise PluginHostError(
|
|
386
|
+
"builtin_context_config_invalid", "maxChars must be a positive integer"
|
|
387
|
+
)
|
|
388
|
+
chunks: list[str] = []
|
|
389
|
+
remaining = max_chars
|
|
390
|
+
for relative in paths:
|
|
391
|
+
path = _safe_bundle_path(
|
|
392
|
+
bundle,
|
|
393
|
+
relative,
|
|
394
|
+
code="builtin_context_path_invalid",
|
|
395
|
+
require_declared=True,
|
|
396
|
+
)
|
|
397
|
+
if not path.is_file() or path.is_symlink():
|
|
398
|
+
raise PluginHostError(
|
|
399
|
+
"builtin_context_path_invalid",
|
|
400
|
+
f"Bundle context path is not a regular file: {relative}",
|
|
401
|
+
)
|
|
402
|
+
try:
|
|
403
|
+
text = path.read_text(encoding="utf-8").strip()
|
|
404
|
+
except (OSError, UnicodeError) as error:
|
|
405
|
+
raise PluginHostError(
|
|
406
|
+
"builtin_context_read_failed",
|
|
407
|
+
f"Bundle context file could not be read: {relative}",
|
|
408
|
+
) from error
|
|
409
|
+
if not text or remaining == 0:
|
|
410
|
+
continue
|
|
411
|
+
chunk = text[:remaining]
|
|
412
|
+
chunks.append(chunk)
|
|
413
|
+
remaining -= len(chunk)
|
|
414
|
+
return "\n\n".join(chunks)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
class CoreConversationRendererRuntime(_BuiltinRuntime):
|
|
418
|
+
"""Project canonical items into a safe core renderer view model."""
|
|
419
|
+
|
|
420
|
+
_COMPONENTS = {
|
|
421
|
+
"user_message": "markdown",
|
|
422
|
+
"assistant_text": "markdown",
|
|
423
|
+
"reasoning": "reasoning",
|
|
424
|
+
"tool_call": "tool",
|
|
425
|
+
"approval": "approval",
|
|
426
|
+
"progress": "progress",
|
|
427
|
+
"plan": "plan",
|
|
428
|
+
"goal": "goal",
|
|
429
|
+
"artifact": "artifact",
|
|
430
|
+
"a2ui": "a2ui",
|
|
431
|
+
"error": "error",
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
def render(self, item: ConversationItem) -> dict[str, Any]:
|
|
435
|
+
base: dict[str, Any] = {
|
|
436
|
+
"component": self._COMPONENTS.get(item.kind, "unknown"),
|
|
437
|
+
"itemId": item.item_id,
|
|
438
|
+
"lifecycle": item.lifecycle,
|
|
439
|
+
}
|
|
440
|
+
if item.kind in {"user_message", "assistant_text"}:
|
|
441
|
+
text = item.payload.get("text", "")
|
|
442
|
+
base["text"] = text if isinstance(text, str) else str(text)
|
|
443
|
+
return base
|
|
444
|
+
if item.kind == "unknown":
|
|
445
|
+
base["schemaRef"] = item.payload_schema_ref
|
|
446
|
+
base["summary"] = json.dumps(
|
|
447
|
+
item.payload,
|
|
448
|
+
ensure_ascii=False,
|
|
449
|
+
sort_keys=True,
|
|
450
|
+
separators=(",", ":"),
|
|
451
|
+
default=str,
|
|
452
|
+
)[:4096]
|
|
453
|
+
return base
|
|
454
|
+
# Structured payload stays data. Consumers choose trusted local UI
|
|
455
|
+
# components; no Bundle-provided HTML or JavaScript is executed here.
|
|
456
|
+
base["payload"] = dict(item.payload)
|
|
457
|
+
base["schemaRef"] = item.payload_schema_ref
|
|
458
|
+
return base
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
class SQLiteSessionStoreFactory:
|
|
462
|
+
def __init__(self, state_root: Path) -> None:
|
|
463
|
+
self._state_root = state_root.resolve()
|
|
464
|
+
self.runtime: SQLiteSessionStoreRuntime | None = None
|
|
465
|
+
|
|
466
|
+
async def stage(
|
|
467
|
+
self,
|
|
468
|
+
manifest: PluginManifest,
|
|
469
|
+
*,
|
|
470
|
+
profile: CompositionProfile,
|
|
471
|
+
services: Mapping[str, Any],
|
|
472
|
+
) -> SQLiteSessionStoreRuntime:
|
|
473
|
+
del services
|
|
474
|
+
_require_manifest(manifest, SQLITE_SESSION_STORE_PLUGIN_ID)
|
|
475
|
+
profile_key = composition_profile_digest(profile).removeprefix("sha256:")
|
|
476
|
+
runtime = SQLiteSessionStoreRuntime(
|
|
477
|
+
manifest.metadata.id,
|
|
478
|
+
manifest.metadata.version,
|
|
479
|
+
db_path=self._state_root / profile_key / "sessions.sqlite",
|
|
480
|
+
)
|
|
481
|
+
self.runtime = runtime
|
|
482
|
+
return runtime
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
class _WorkspaceMCPFactory:
|
|
486
|
+
def __init__(self, secret_resolver: SecretResolver | None) -> None:
|
|
487
|
+
self._secret_resolver = secret_resolver
|
|
488
|
+
|
|
489
|
+
async def stage(
|
|
490
|
+
self,
|
|
491
|
+
manifest: PluginManifest,
|
|
492
|
+
*,
|
|
493
|
+
profile: CompositionProfile,
|
|
494
|
+
services: Mapping[str, Any],
|
|
495
|
+
) -> WorkspaceMCPRuntime:
|
|
496
|
+
del profile
|
|
497
|
+
_require_manifest(manifest, WORKSPACE_MCP_PLUGIN_ID)
|
|
498
|
+
resolver = self._secret_resolver
|
|
499
|
+
service_resolver = services.get("secret_resolver")
|
|
500
|
+
if resolver is None and callable(service_resolver):
|
|
501
|
+
resolver = service_resolver
|
|
502
|
+
return WorkspaceMCPRuntime(
|
|
503
|
+
manifest.metadata.id,
|
|
504
|
+
manifest.metadata.version,
|
|
505
|
+
secret_resolver=resolver,
|
|
506
|
+
)
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
class _SimpleFactory:
|
|
510
|
+
def __init__(self, plugin_id: str, runtime_type: type[_BuiltinRuntime]) -> None:
|
|
511
|
+
self._plugin_id = plugin_id
|
|
512
|
+
self._runtime_type = runtime_type
|
|
513
|
+
|
|
514
|
+
async def stage(
|
|
515
|
+
self,
|
|
516
|
+
manifest: PluginManifest,
|
|
517
|
+
*,
|
|
518
|
+
profile: CompositionProfile,
|
|
519
|
+
services: Mapping[str, Any],
|
|
520
|
+
) -> _BuiltinRuntime:
|
|
521
|
+
del profile, services
|
|
522
|
+
_require_manifest(manifest, self._plugin_id)
|
|
523
|
+
return self._runtime_type(manifest.metadata.id, manifest.metadata.version)
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
def builtin_capability_factories(
|
|
527
|
+
*,
|
|
528
|
+
state_root: Path,
|
|
529
|
+
secret_resolver: SecretResolver | None = None,
|
|
530
|
+
) -> dict[str, Any]:
|
|
531
|
+
"""Create factories with explicit state and secret-provider boundaries."""
|
|
532
|
+
|
|
533
|
+
return {
|
|
534
|
+
SQLITE_SESSION_STORE_PLUGIN_ID: SQLiteSessionStoreFactory(state_root),
|
|
535
|
+
WORKSPACE_MCP_PLUGIN_ID: _WorkspaceMCPFactory(secret_resolver),
|
|
536
|
+
WORKSPACE_SKILL_PLUGIN_ID: _SimpleFactory(WORKSPACE_SKILL_PLUGIN_ID, WorkspaceSkillRuntime),
|
|
537
|
+
READ_ONLY_CONTEXT_PLUGIN_ID: _SimpleFactory(
|
|
538
|
+
READ_ONLY_CONTEXT_PLUGIN_ID, ReadOnlyBundleContextRuntime
|
|
539
|
+
),
|
|
540
|
+
CORE_RENDERER_PLUGIN_ID: _SimpleFactory(
|
|
541
|
+
CORE_RENDERER_PLUGIN_ID, CoreConversationRendererRuntime
|
|
542
|
+
),
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
def _require_manifest(manifest: PluginManifest, plugin_id: str) -> None:
|
|
547
|
+
if manifest.metadata.id != plugin_id or manifest.metadata.version != BUILTIN_PLUGIN_VERSION:
|
|
548
|
+
raise PluginHostError(
|
|
549
|
+
"builtin_manifest_mismatch",
|
|
550
|
+
f"factory cannot stage {manifest.metadata.id}@{manifest.metadata.version}",
|
|
551
|
+
)
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
def _bound_capability_config(
|
|
555
|
+
bundle: ResolvedPluginBundle, plugin_id: str, version: str
|
|
556
|
+
) -> Mapping[str, Any]:
|
|
557
|
+
composition = bundle.composition
|
|
558
|
+
if composition_profile_digest(composition.profile) != composition.profile_digest:
|
|
559
|
+
raise PluginHostError(
|
|
560
|
+
"plugin_bundle_profile_mutated",
|
|
561
|
+
"resolved Bundle composition profile changed after validation",
|
|
562
|
+
)
|
|
563
|
+
if plugin_lock_digest(composition.plugin_lock) != composition.plugin_lock_digest:
|
|
564
|
+
raise PluginHostError(
|
|
565
|
+
"plugin_bundle_lock_mutated",
|
|
566
|
+
"resolved Bundle plugin lock changed after validation",
|
|
567
|
+
)
|
|
568
|
+
ref = f"plugin://{plugin_id}@{version}"
|
|
569
|
+
matches = [item for item in composition.profile.capabilities if item.ref == ref]
|
|
570
|
+
if len(matches) != 1:
|
|
571
|
+
raise PluginHostError(
|
|
572
|
+
"builtin_capability_binding_missing",
|
|
573
|
+
f"resolved Bundle does not bind built-in capability {plugin_id}@{version}",
|
|
574
|
+
)
|
|
575
|
+
if not any(
|
|
576
|
+
item.id == plugin_id and item.version == version for item in composition.plugin_lock.plugins
|
|
577
|
+
):
|
|
578
|
+
raise PluginHostError(
|
|
579
|
+
"builtin_capability_lock_missing",
|
|
580
|
+
f"resolved Bundle does not lock built-in capability {plugin_id}@{version}",
|
|
581
|
+
)
|
|
582
|
+
return cast(Mapping[str, Any], matches[0].config)
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
def _resource_entries(
|
|
586
|
+
config: Mapping[str, Any], *, expected_kind: str
|
|
587
|
+
) -> tuple[Mapping[str, Any], ...]:
|
|
588
|
+
raw = config.get("resources")
|
|
589
|
+
if not isinstance(raw, Sequence) or isinstance(raw, (str, bytes)):
|
|
590
|
+
raise PluginHostError(
|
|
591
|
+
f"builtin_{expected_kind}_config_invalid", "resources must be an array"
|
|
592
|
+
)
|
|
593
|
+
entries: list[Mapping[str, Any]] = []
|
|
594
|
+
for item in raw:
|
|
595
|
+
entry = _mapping(item, code=f"builtin_{expected_kind}_config_invalid")
|
|
596
|
+
if entry.get("kind") != expected_kind:
|
|
597
|
+
raise PluginHostError(
|
|
598
|
+
f"builtin_{expected_kind}_resource_mismatch",
|
|
599
|
+
f"resource kind must be {expected_kind!r}",
|
|
600
|
+
)
|
|
601
|
+
for field in ("resourceId", "name", "version", "digest"):
|
|
602
|
+
_required_string(entry, field, code=f"builtin_{expected_kind}_invalid")
|
|
603
|
+
entries.append(entry)
|
|
604
|
+
return tuple(entries)
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
def _resolved_resources(bundle: ResolvedPluginBundle, field: str) -> tuple[Mapping[str, Any], ...]:
|
|
608
|
+
capabilities = _mapping(
|
|
609
|
+
bundle.resolved_agent_spec.get("capabilities"),
|
|
610
|
+
code="builtin_bundle_capabilities_missing",
|
|
611
|
+
)
|
|
612
|
+
raw = capabilities.get(field)
|
|
613
|
+
if not isinstance(raw, Sequence) or isinstance(raw, (str, bytes)):
|
|
614
|
+
raise PluginHostError(
|
|
615
|
+
"builtin_bundle_capabilities_missing", f"Bundle capabilities.{field} is missing"
|
|
616
|
+
)
|
|
617
|
+
return tuple(_mapping(item, code="builtin_bundle_capabilities_invalid") for item in raw)
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
def _match_resource(
|
|
621
|
+
declared: Mapping[str, Any],
|
|
622
|
+
resolved: Sequence[Mapping[str, Any]],
|
|
623
|
+
*,
|
|
624
|
+
code: str,
|
|
625
|
+
) -> Mapping[str, Any]:
|
|
626
|
+
name = _required_string(declared, "name", code=code)
|
|
627
|
+
version = _required_string(declared, "version", code=code)
|
|
628
|
+
digest = _required_string(declared, "digest", code=code)
|
|
629
|
+
matches = [
|
|
630
|
+
item
|
|
631
|
+
for item in resolved
|
|
632
|
+
if item.get("name") == name
|
|
633
|
+
and item.get("version") == version
|
|
634
|
+
and item.get("digest") == digest
|
|
635
|
+
]
|
|
636
|
+
if len(matches) != 1:
|
|
637
|
+
raise PluginHostError(
|
|
638
|
+
code,
|
|
639
|
+
f"locked resource {name!r}@{version} is missing from resolved Agent spec",
|
|
640
|
+
)
|
|
641
|
+
return matches[0]
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
def _safe_bundle_path(
|
|
645
|
+
bundle: ResolvedPluginBundle,
|
|
646
|
+
relative_text: str,
|
|
647
|
+
*,
|
|
648
|
+
code: str,
|
|
649
|
+
require_declared: bool,
|
|
650
|
+
) -> Path:
|
|
651
|
+
relative = PurePosixPath(relative_text)
|
|
652
|
+
if relative.is_absolute() or not relative.parts or ".." in relative.parts:
|
|
653
|
+
raise PluginHostError(code, f"unsafe Bundle path: {relative_text}")
|
|
654
|
+
path = bundle.root.joinpath(*relative.parts)
|
|
655
|
+
cursor = bundle.root
|
|
656
|
+
for part in relative.parts:
|
|
657
|
+
cursor = cursor / part
|
|
658
|
+
if cursor.is_symlink():
|
|
659
|
+
raise PluginHostError(code, f"Bundle path cannot use symlinks: {relative_text}")
|
|
660
|
+
try:
|
|
661
|
+
resolved = path.resolve(strict=True)
|
|
662
|
+
resolved.relative_to(bundle.root)
|
|
663
|
+
except (OSError, ValueError) as error:
|
|
664
|
+
raise PluginHostError(code, f"Bundle path is unavailable: {relative_text}") from error
|
|
665
|
+
if require_declared and relative.as_posix() not in {
|
|
666
|
+
item.path for item in bundle.manifest.files
|
|
667
|
+
}:
|
|
668
|
+
raise PluginHostError(code, f"Bundle path is not declared: {relative_text}")
|
|
669
|
+
return cast(Path, resolved)
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
def _directory_digest(directory: Path) -> str:
|
|
673
|
+
digest = hashlib.sha256()
|
|
674
|
+
for path in sorted(item for item in directory.rglob("*") if item.is_file()):
|
|
675
|
+
if path.is_symlink():
|
|
676
|
+
raise PluginHostError(
|
|
677
|
+
"builtin_skill_path_invalid", "Skill Bundle cannot contain symlinks"
|
|
678
|
+
)
|
|
679
|
+
relative = path.relative_to(directory).as_posix().encode("utf-8")
|
|
680
|
+
content = path.read_bytes()
|
|
681
|
+
digest.update(len(relative).to_bytes(4, "big"))
|
|
682
|
+
digest.update(relative)
|
|
683
|
+
digest.update(len(content).to_bytes(8, "big"))
|
|
684
|
+
digest.update(content)
|
|
685
|
+
return f"sha256:{digest.hexdigest()}"
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
def _mapping(value: Any, *, code: str) -> Mapping[str, Any]:
|
|
689
|
+
if not isinstance(value, Mapping):
|
|
690
|
+
raise PluginHostError(code, "expected an object")
|
|
691
|
+
return value
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
def _required_string(value: Mapping[str, Any], field: str, *, code: str) -> str:
|
|
695
|
+
text = value.get(field)
|
|
696
|
+
if not isinstance(text, str) or not text.strip():
|
|
697
|
+
raise PluginHostError(code, f"{field} must be a non-empty string")
|
|
698
|
+
return text.strip()
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
def _optional_string(value: Any) -> str | None:
|
|
702
|
+
if value is None:
|
|
703
|
+
return None
|
|
704
|
+
if not isinstance(value, str):
|
|
705
|
+
raise PluginHostError(
|
|
706
|
+
"builtin_config_invalid", "optional configuration value must be a string"
|
|
707
|
+
)
|
|
708
|
+
return value.strip() or None
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
def _string_list(value: Any) -> tuple[str, ...]:
|
|
712
|
+
if value is None:
|
|
713
|
+
return ()
|
|
714
|
+
if not isinstance(value, Sequence) or isinstance(value, (str, bytes)):
|
|
715
|
+
raise PluginHostError("builtin_config_invalid", "configuration value must be an array")
|
|
716
|
+
result: list[str] = []
|
|
717
|
+
for item in value:
|
|
718
|
+
if not isinstance(item, str) or not item.strip():
|
|
719
|
+
raise PluginHostError(
|
|
720
|
+
"builtin_config_invalid", "array entries must be non-empty strings"
|
|
721
|
+
)
|
|
722
|
+
result.append(item.strip())
|
|
723
|
+
return tuple(result)
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
def _is_secret_reference(value: str) -> bool:
|
|
727
|
+
return value.startswith(("secret://", "env://", "credential://", "vault://"))
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
__all__ = [
|
|
731
|
+
"BUILTIN_PLUGIN_VERSION",
|
|
732
|
+
"CORE_RENDERER_PLUGIN_ID",
|
|
733
|
+
"READ_ONLY_CONTEXT_PLUGIN_ID",
|
|
734
|
+
"SQLITE_SESSION_STORE_PLUGIN_ID",
|
|
735
|
+
"WORKSPACE_MCP_PLUGIN_ID",
|
|
736
|
+
"WORKSPACE_SKILL_PLUGIN_ID",
|
|
737
|
+
"CoreConversationRendererRuntime",
|
|
738
|
+
"ReadOnlyBundleContextRuntime",
|
|
739
|
+
"SQLiteSessionStoreFactory",
|
|
740
|
+
"SQLiteSessionStoreRuntime",
|
|
741
|
+
"WorkspaceMCPRuntime",
|
|
742
|
+
"WorkspaceSkillRuntime",
|
|
743
|
+
"builtin_capability_factories",
|
|
744
|
+
"builtin_capability_manifests",
|
|
745
|
+
"builtin_capability_permissions",
|
|
746
|
+
]
|