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
|
@@ -15,6 +15,7 @@ import logging
|
|
|
15
15
|
import time
|
|
16
16
|
from collections.abc import Mapping
|
|
17
17
|
from contextlib import nullcontext
|
|
18
|
+
from dataclasses import replace
|
|
18
19
|
from typing import TYPE_CHECKING, Any, AsyncIterator, Optional, cast
|
|
19
20
|
|
|
20
21
|
from pydantic import JsonValue
|
|
@@ -65,11 +66,43 @@ async def _anext_or_stop(gen: AsyncIterator[Any]) -> Any:
|
|
|
65
66
|
return _STREAM_STOP
|
|
66
67
|
|
|
67
68
|
|
|
69
|
+
async def _pump_stream_in_one_context(
|
|
70
|
+
gen: AsyncIterator[Any],
|
|
71
|
+
requests: asyncio.Queue[None],
|
|
72
|
+
results: asyncio.Queue[tuple[str, Any]],
|
|
73
|
+
) -> None:
|
|
74
|
+
"""Own one async generator in one Task without reading ahead."""
|
|
75
|
+
outcome: tuple[str, Any] = ("stop", _STREAM_STOP)
|
|
76
|
+
try:
|
|
77
|
+
while True:
|
|
78
|
+
await requests.get()
|
|
79
|
+
try:
|
|
80
|
+
chunk = await gen.__anext__()
|
|
81
|
+
except StopAsyncIteration:
|
|
82
|
+
break
|
|
83
|
+
await results.put(("chunk", chunk))
|
|
84
|
+
except asyncio.CancelledError:
|
|
85
|
+
raise
|
|
86
|
+
except BaseException as exc:
|
|
87
|
+
outcome = ("error", exc)
|
|
88
|
+
finally:
|
|
89
|
+
aclose = getattr(gen, "aclose", None)
|
|
90
|
+
if callable(aclose):
|
|
91
|
+
try:
|
|
92
|
+
await aclose()
|
|
93
|
+
except asyncio.CancelledError:
|
|
94
|
+
raise
|
|
95
|
+
except BaseException as exc:
|
|
96
|
+
if outcome[0] != "error":
|
|
97
|
+
outcome = ("error", exc)
|
|
98
|
+
await results.put(outcome)
|
|
99
|
+
|
|
100
|
+
|
|
68
101
|
def _a2ui_surface_event(
|
|
69
102
|
self: Any,
|
|
70
103
|
handle: RunHandle,
|
|
71
104
|
chunk: Any,
|
|
72
|
-
) -> RuntimeEvent
|
|
105
|
+
) -> tuple[RuntimeEvent, ...]:
|
|
73
106
|
"""Recognize a validated A2UI tool envelope and emit a canonical data-item event.
|
|
74
107
|
|
|
75
108
|
The dynamic ``generate_a2ui`` tool returns official v0.9 operations as a
|
|
@@ -83,7 +116,7 @@ def _a2ui_surface_event(
|
|
|
83
116
|
"""
|
|
84
117
|
|
|
85
118
|
if not isinstance(chunk, dict):
|
|
86
|
-
return
|
|
119
|
+
return ()
|
|
87
120
|
value = chunk.get("tool_output", chunk.get("output"))
|
|
88
121
|
if value is not None and hasattr(value, "content"):
|
|
89
122
|
value = value.content
|
|
@@ -91,15 +124,15 @@ def _a2ui_surface_event(
|
|
|
91
124
|
try:
|
|
92
125
|
value = json.loads(value)
|
|
93
126
|
except (TypeError, ValueError):
|
|
94
|
-
return
|
|
127
|
+
return ()
|
|
95
128
|
if not isinstance(value, Mapping):
|
|
96
|
-
return
|
|
129
|
+
return ()
|
|
97
130
|
operations_raw = value.get("a2ui_operations")
|
|
98
131
|
if not isinstance(operations_raw, list) or not operations_raw:
|
|
99
|
-
return
|
|
132
|
+
return ()
|
|
100
133
|
operations = [dict(operation) for operation in operations_raw if isinstance(operation, Mapping)]
|
|
101
134
|
if not operations:
|
|
102
|
-
return
|
|
135
|
+
return ()
|
|
103
136
|
|
|
104
137
|
known: list[tuple[str, str]] = [] # (surface_id, lifecycle)
|
|
105
138
|
for operation in operations:
|
|
@@ -116,71 +149,75 @@ def _a2ui_surface_event(
|
|
|
116
149
|
known.append((surface_id, lifecycle))
|
|
117
150
|
break
|
|
118
151
|
if not known:
|
|
119
|
-
return
|
|
152
|
+
return ()
|
|
120
153
|
surface_ids = {surface_id for surface_id, _lifecycle in known}
|
|
121
154
|
if len(surface_ids) != 1:
|
|
122
155
|
logger.warning("ignoring A2UI tool result with multiple surfaces")
|
|
123
|
-
return
|
|
156
|
+
return ()
|
|
124
157
|
surface_id = known[0][0]
|
|
125
158
|
lifecycle = "begin" if any(lc == "begin" for _, lc in known) else known[0][1]
|
|
126
159
|
|
|
127
160
|
framework = self._runtime_type
|
|
128
161
|
run_id = handle.run_id
|
|
129
162
|
scope_id = stable_scope_id(framework, run_id)
|
|
130
|
-
|
|
163
|
+
# A dynamic A2UI tool result is a complete, immutable operation batch. It
|
|
164
|
+
# must therefore be represented by a closed canonical item. Reusing one
|
|
165
|
+
# long-lived item per surface leaves a create/update-only batch open at the
|
|
166
|
+
# run terminal and makes strict reducers reject the stream.
|
|
167
|
+
start_seq = self._next_seq()
|
|
168
|
+
batch_ref = str(chunk.get("call_id") or chunk.get("run_id") or chunk.get("id") or "")
|
|
169
|
+
if not batch_ref:
|
|
170
|
+
batch_ref = json.dumps(
|
|
171
|
+
operations,
|
|
172
|
+
ensure_ascii=False,
|
|
173
|
+
sort_keys=True,
|
|
174
|
+
separators=(",", ":"),
|
|
175
|
+
)
|
|
176
|
+
item_id = stable_item_id(framework, run_id, "a2ui-batch", surface_id, batch_ref)
|
|
131
177
|
source = SourceRef(
|
|
132
178
|
framework=framework,
|
|
133
179
|
protocol="a2ui",
|
|
134
180
|
native_run_id=run_id,
|
|
135
|
-
metadata={
|
|
181
|
+
metadata={
|
|
182
|
+
"surface_id": surface_id,
|
|
183
|
+
"operation_batch": True,
|
|
184
|
+
"surface_lifecycle": lifecycle,
|
|
185
|
+
},
|
|
136
186
|
)
|
|
137
187
|
# TODO(runtime-event-v2): dict chunk 退化路径,chunk_ordinal 用 seq counter;
|
|
138
188
|
# LangGraph/Codex 切 stream_canonical_events 后清理
|
|
139
|
-
n = self._next_seq()
|
|
140
189
|
timestamp = time.time()
|
|
141
|
-
|
|
142
|
-
|
|
190
|
+
snapshot = ContentSnapshot(parts=(DataContent(part_id="a2ui-ops", data=operations),))
|
|
191
|
+
completed_seq = self._next_seq()
|
|
192
|
+
return (
|
|
193
|
+
ItemStarted(
|
|
143
194
|
schema_version=2,
|
|
144
195
|
event_id=stable_event_id(
|
|
145
|
-
framework, scope_id, item_id, "item.started", "a2ui", run_id,
|
|
196
|
+
framework, scope_id, item_id, "item.started", "a2ui", run_id, start_seq
|
|
146
197
|
),
|
|
147
|
-
seq=
|
|
198
|
+
seq=start_seq,
|
|
148
199
|
timestamp=timestamp,
|
|
149
200
|
run_id=run_id,
|
|
150
201
|
scope_id=scope_id,
|
|
151
202
|
source=source,
|
|
152
203
|
item_id=item_id,
|
|
153
204
|
item_kind="data",
|
|
154
|
-
initial=
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
return ItemUpdated(
|
|
205
|
+
initial=snapshot,
|
|
206
|
+
),
|
|
207
|
+
ItemCompleted(
|
|
158
208
|
schema_version=2,
|
|
159
209
|
event_id=stable_event_id(
|
|
160
|
-
framework, scope_id, item_id, "item.
|
|
210
|
+
framework, scope_id, item_id, "item.completed", "a2ui", run_id, completed_seq
|
|
161
211
|
),
|
|
162
|
-
seq=
|
|
212
|
+
seq=completed_seq,
|
|
163
213
|
timestamp=timestamp,
|
|
164
214
|
run_id=run_id,
|
|
165
215
|
scope_id=scope_id,
|
|
166
216
|
source=source,
|
|
167
217
|
item_id=item_id,
|
|
168
218
|
item_kind="data",
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
)
|
|
172
|
-
# lifecycle == "end"
|
|
173
|
-
return ItemCompleted(
|
|
174
|
-
schema_version=2,
|
|
175
|
-
event_id=stable_event_id(framework, scope_id, item_id, "item.completed", "a2ui", run_id, n),
|
|
176
|
-
seq=n,
|
|
177
|
-
timestamp=timestamp,
|
|
178
|
-
run_id=run_id,
|
|
179
|
-
scope_id=scope_id,
|
|
180
|
-
source=source,
|
|
181
|
-
item_id=item_id,
|
|
182
|
-
item_kind="data",
|
|
183
|
-
snapshot=ContentSnapshot(parts=()),
|
|
219
|
+
snapshot=snapshot,
|
|
220
|
+
),
|
|
184
221
|
)
|
|
185
222
|
|
|
186
223
|
|
|
@@ -188,14 +225,27 @@ class _RunnerStreamMappingMixin:
|
|
|
188
225
|
"""``_map_runner_stream`` / ``_chunk_to_event`` 的实现载体(纯移动自 runner_adapter)。"""
|
|
189
226
|
|
|
190
227
|
async def _map_runner_stream(
|
|
191
|
-
self,
|
|
228
|
+
self,
|
|
229
|
+
handle: RunHandle,
|
|
230
|
+
runner_input: dict,
|
|
231
|
+
*,
|
|
232
|
+
active_run: Optional[_ActiveRun] = None,
|
|
192
233
|
) -> AsyncIterator[RuntimeEvent]:
|
|
193
|
-
run: Optional[_ActiveRun] =
|
|
234
|
+
run: Optional[_ActiveRun] = active_run
|
|
235
|
+
if run is None:
|
|
236
|
+
run = self._active_runs.get(handle.run_id) # type: ignore[attr-defined]
|
|
194
237
|
interrupt = run.interrupt_event if run is not None else None
|
|
195
238
|
prepared_start = run.__dict__.get("_prepared_start") if run is not None else None
|
|
196
239
|
invocation_context = (
|
|
197
240
|
prepared_start.context if isinstance(prepared_start, PreparedRuntimeStart) else None
|
|
198
241
|
)
|
|
242
|
+
if run is not None and run.__dict__.get("_tag_context") is not None:
|
|
243
|
+
tag_context = run.__dict__["_tag_context"]
|
|
244
|
+
invocation_context = (
|
|
245
|
+
replace(invocation_context, session=tag_context.session)
|
|
246
|
+
if invocation_context is not None
|
|
247
|
+
else tag_context
|
|
248
|
+
)
|
|
199
249
|
scope = (
|
|
200
250
|
platform_invocation_scope(invocation_context)
|
|
201
251
|
if invocation_context is not None
|
|
@@ -205,6 +255,9 @@ class _RunnerStreamMappingMixin:
|
|
|
205
255
|
accumulated_output = ""
|
|
206
256
|
usage: dict[str, Any] = {}
|
|
207
257
|
runner_gen: Optional[AsyncIterator[Any]] = None
|
|
258
|
+
pump_requests: asyncio.Queue[None] | None = None
|
|
259
|
+
pump_queue: asyncio.Queue[tuple[str, Any]] | None = None
|
|
260
|
+
pump_task: asyncio.Task[None] | None = None
|
|
208
261
|
# span scope 经 runner_adapter 模块属性间接解析,保持既有 monkeypatch
|
|
209
262
|
# patch 点(tests/agui/test_runtime_preprocessing.py)继续生效。
|
|
210
263
|
from ksadk.runtime import runner_adapter as _runner_adapter_module
|
|
@@ -243,10 +296,26 @@ class _RunnerStreamMappingMixin:
|
|
|
243
296
|
# 调用返回 coroutine,需 await 得到迭代器。
|
|
244
297
|
stream_result = await stream_result
|
|
245
298
|
runner_gen = cast(AsyncIterator[Any], stream_result)
|
|
299
|
+
if self._requires_stable_stream_context():
|
|
300
|
+
pump_requests = asyncio.Queue(maxsize=1)
|
|
301
|
+
pump_queue = asyncio.Queue()
|
|
302
|
+
pump_task = asyncio.create_task(
|
|
303
|
+
_pump_stream_in_one_context(
|
|
304
|
+
runner_gen, pump_requests, pump_queue
|
|
305
|
+
)
|
|
306
|
+
)
|
|
307
|
+
if run is not None:
|
|
308
|
+
run.chunk_task = pump_task
|
|
246
309
|
while True:
|
|
247
310
|
# 竞速:下一个 runner chunk vs cancel 中断事件。
|
|
248
|
-
|
|
249
|
-
|
|
311
|
+
if pump_requests is not None:
|
|
312
|
+
pump_requests.put_nowait(None)
|
|
313
|
+
chunk_task = asyncio.ensure_future(
|
|
314
|
+
pump_queue.get()
|
|
315
|
+
if pump_queue is not None
|
|
316
|
+
else _anext_or_stop(runner_gen)
|
|
317
|
+
)
|
|
318
|
+
if run is not None and pump_task is None:
|
|
250
319
|
run.chunk_task = chunk_task
|
|
251
320
|
wait_set = {chunk_task}
|
|
252
321
|
interrupt_task = (
|
|
@@ -265,17 +334,23 @@ class _RunnerStreamMappingMixin:
|
|
|
265
334
|
await asyncio.gather(*pending, return_exceptions=True)
|
|
266
335
|
if interrupt_task is not None and interrupt_task in done:
|
|
267
336
|
# cancel 中断:安全关闭 runner 流(同一 task)并停止。
|
|
268
|
-
chunk_task
|
|
269
|
-
|
|
337
|
+
owner_task = pump_task or chunk_task
|
|
338
|
+
owner_task.cancel()
|
|
339
|
+
await asyncio.gather(owner_task, return_exceptions=True)
|
|
270
340
|
return
|
|
271
341
|
try:
|
|
272
342
|
chunk = chunk_task.result()
|
|
343
|
+
if pump_task is not None:
|
|
344
|
+
outcome, payload = cast(tuple[str, Any], chunk)
|
|
345
|
+
if outcome == "error":
|
|
346
|
+
raise payload
|
|
347
|
+
chunk = payload
|
|
273
348
|
except asyncio.CancelledError:
|
|
274
349
|
if interrupt is not None and interrupt.is_set():
|
|
275
350
|
return
|
|
276
351
|
raise
|
|
277
352
|
finally:
|
|
278
|
-
if run is not None:
|
|
353
|
+
if run is not None and pump_task is None:
|
|
279
354
|
run.chunk_task = None
|
|
280
355
|
if chunk is _STREAM_STOP:
|
|
281
356
|
return
|
|
@@ -323,14 +398,17 @@ class _RunnerStreamMappingMixin:
|
|
|
323
398
|
usage.update(raw_usage)
|
|
324
399
|
for event in self._chunk_to_event(handle, run, chunk): # type: ignore[attr-defined]
|
|
325
400
|
yield event
|
|
326
|
-
a2ui_surface
|
|
327
|
-
if a2ui_surface is not None:
|
|
401
|
+
for a2ui_surface in _a2ui_surface_event(self, handle, chunk):
|
|
328
402
|
yield a2ui_surface
|
|
329
403
|
finally:
|
|
330
404
|
if accumulated_output:
|
|
331
405
|
_set_conversation_output_attributes(span, accumulated_output)
|
|
332
406
|
_set_conversation_usage_attributes(span, usage)
|
|
333
|
-
if
|
|
407
|
+
if pump_task is not None:
|
|
408
|
+
if not pump_task.done():
|
|
409
|
+
pump_task.cancel()
|
|
410
|
+
await asyncio.gather(pump_task, return_exceptions=True)
|
|
411
|
+
elif runner_gen is not None:
|
|
334
412
|
aclose = getattr(runner_gen, "aclose", None)
|
|
335
413
|
if callable(aclose):
|
|
336
414
|
try:
|
|
@@ -338,6 +416,8 @@ class _RunnerStreamMappingMixin:
|
|
|
338
416
|
except Exception: # noqa: BLE001
|
|
339
417
|
pass
|
|
340
418
|
if run is not None:
|
|
419
|
+
if pump_task is not None:
|
|
420
|
+
run.chunk_task = None
|
|
341
421
|
run.cancellation_ack.set()
|
|
342
422
|
|
|
343
423
|
def _chunk_to_event(
|
|
@@ -384,6 +464,24 @@ class _RunnerStreamMappingMixin:
|
|
|
384
464
|
)
|
|
385
465
|
]
|
|
386
466
|
|
|
467
|
+
def tool_item_id(effective_call_id: str, item_kind: str) -> str:
|
|
468
|
+
components = (effective_call_id, item_kind)
|
|
469
|
+
if run is None:
|
|
470
|
+
return stable_item_id(framework, run_id, *components)
|
|
471
|
+
occurrences = run.__dict__.setdefault("_tool_item_occurrences", {})
|
|
472
|
+
occurrence_key = (scope_id, item_kind, effective_call_id)
|
|
473
|
+
occurrence = int(occurrences.get(occurrence_key, 0))
|
|
474
|
+
occurrences[occurrence_key] = occurrence + 1
|
|
475
|
+
if occurrence == 0:
|
|
476
|
+
return stable_item_id(framework, run_id, *components)
|
|
477
|
+
return stable_item_id(
|
|
478
|
+
framework,
|
|
479
|
+
run_id,
|
|
480
|
+
*components,
|
|
481
|
+
"occurrence",
|
|
482
|
+
occurrence,
|
|
483
|
+
)
|
|
484
|
+
|
|
387
485
|
chunk_type = chunk.get("type")
|
|
388
486
|
|
|
389
487
|
# ---- reasoning ----
|
|
@@ -446,7 +544,7 @@ class _RunnerStreamMappingMixin:
|
|
|
446
544
|
)
|
|
447
545
|
name = str(chunk.get("tool_name") or chunk.get("name") or "tool")
|
|
448
546
|
effective_call_id = call_id or name
|
|
449
|
-
item_id =
|
|
547
|
+
item_id = tool_item_id(effective_call_id, "tool_call")
|
|
450
548
|
part_id = "tool_call"
|
|
451
549
|
tc_content = ToolCallContent(
|
|
452
550
|
part_id=part_id,
|
|
@@ -493,7 +591,7 @@ class _RunnerStreamMappingMixin:
|
|
|
493
591
|
)
|
|
494
592
|
name = str(chunk.get("tool_name") or chunk.get("name") or "tool")
|
|
495
593
|
effective_call_id = call_id or name
|
|
496
|
-
item_id =
|
|
594
|
+
item_id = tool_item_id(effective_call_id, "tool_result")
|
|
497
595
|
part_id = "tool_result"
|
|
498
596
|
result_data = chunk.get("tool_output", chunk.get("output"))
|
|
499
597
|
# ToolGateway 审批可能出现在"本已终态"的 tool result 里;识别后转为
|
|
@@ -615,26 +713,55 @@ class _RunnerStreamMappingMixin:
|
|
|
615
713
|
if isinstance(runtime_ref, dict):
|
|
616
714
|
handle.native_ref.update(runtime_ref)
|
|
617
715
|
item_id = stable_item_id(framework, run_id, "$run")
|
|
716
|
+
# Extract checkpoint capability from agentengine metadata so the
|
|
717
|
+
# canonical event carries backend/scope/next_node facts that the
|
|
718
|
+
# projection layer (projection.py) needs for the REST payload.
|
|
719
|
+
capability: dict[str, Any] = {}
|
|
720
|
+
for cap_key in (
|
|
721
|
+
# Capability / resume fields
|
|
722
|
+
"backend", "scope", "durable", "next_node",
|
|
723
|
+
"is_terminal", "is_resumable", "resume_status",
|
|
724
|
+
"resume_disabled_reason",
|
|
725
|
+
# Checkpoint display fields
|
|
726
|
+
"phase", "stage", "stage_name", "stage_key",
|
|
727
|
+
"stage_index", "total_stages", "summary",
|
|
728
|
+
"next_action", "status", "artifact_preview",
|
|
729
|
+
"tool_name", "receipt_key", "artifact_path",
|
|
730
|
+
):
|
|
731
|
+
cap_val = agentengine.get(cap_key)
|
|
732
|
+
if cap_val is not None:
|
|
733
|
+
capability[cap_key] = cap_val
|
|
734
|
+
canonical_kwargs = self._canonical_kwargs( # type: ignore[attr-defined]
|
|
735
|
+
handle,
|
|
736
|
+
scope_id=scope_id,
|
|
737
|
+
item_id=item_id,
|
|
738
|
+
event_type="continuation.created",
|
|
739
|
+
part_id="continuation",
|
|
740
|
+
)
|
|
741
|
+
if capability:
|
|
742
|
+
base_source = canonical_kwargs["source"]
|
|
743
|
+
canonical_kwargs["source"] = SourceRef(
|
|
744
|
+
framework=base_source.framework,
|
|
745
|
+
protocol=base_source.protocol,
|
|
746
|
+
native_run_id=base_source.native_run_id,
|
|
747
|
+
metadata={**base_source.metadata, "capability": capability},
|
|
748
|
+
)
|
|
618
749
|
ref_value = cast(
|
|
619
750
|
JsonValue,
|
|
620
751
|
framework_ref if isinstance(framework_ref, dict) else {},
|
|
621
752
|
)
|
|
753
|
+
next_node_val = agentengine.get("next_node")
|
|
622
754
|
return [
|
|
623
755
|
ContinuationCreated(
|
|
624
|
-
**
|
|
625
|
-
handle,
|
|
626
|
-
scope_id=scope_id,
|
|
627
|
-
item_id=item_id,
|
|
628
|
-
event_type="continuation.created",
|
|
629
|
-
part_id="continuation",
|
|
630
|
-
),
|
|
756
|
+
**canonical_kwargs,
|
|
631
757
|
continuation_id=checkpoint_id,
|
|
632
758
|
continuation_kind="graph_checkpoint",
|
|
633
|
-
resumable=True,
|
|
759
|
+
resumable=bool(agentengine.get("is_resumable", True)),
|
|
634
760
|
ref={
|
|
635
761
|
"framework": ckpt_framework,
|
|
636
762
|
"framework_ref": ref_value,
|
|
637
763
|
"resume_target": ref_value,
|
|
764
|
+
**({"next_node": str(next_node_val)} if next_node_val else {}),
|
|
638
765
|
},
|
|
639
766
|
)
|
|
640
767
|
]
|
|
@@ -708,8 +835,10 @@ class _RunnerStreamMappingMixin:
|
|
|
708
835
|
if run is not None:
|
|
709
836
|
run.final_answer_item_id = item_id
|
|
710
837
|
text_content = TextContent(part_id="text-0", text=output)
|
|
711
|
-
# Auto-close any open commentary/reasoning item before
|
|
712
|
-
# Text
|
|
838
|
+
# Auto-close any open explicit commentary/reasoning item before completing
|
|
839
|
+
# final_answer. Text deltas already belong to the final-answer item and must
|
|
840
|
+
# keep that identity through completion.
|
|
841
|
+
# Commentary/thinking deltas create items that are never ItemCompleted;
|
|
713
842
|
# without this, RunCompleted fails _ensure_no_open_items.
|
|
714
843
|
#
|
|
715
844
|
# Close them *before* allocating the final-answer item. Event
|
|
@@ -764,9 +893,13 @@ class _RunnerStreamMappingMixin:
|
|
|
764
893
|
text = self._coerce(chunk.get("delta") or chunk.get("output") or chunk.get("data")) # type: ignore[attr-defined]
|
|
765
894
|
if not text:
|
|
766
895
|
return []
|
|
767
|
-
|
|
896
|
+
is_commentary = chunk_type in {"commentary", "commentary_delta"}
|
|
897
|
+
phase = "commentary" if is_commentary else "final_answer"
|
|
898
|
+
item_id = stable_item_id(framework, run_id, "message", phase)
|
|
899
|
+
if run is not None and not is_commentary:
|
|
900
|
+
run.final_answer_item_id = item_id
|
|
768
901
|
op: str = "replace" if chunk.get("replace") else "append"
|
|
769
|
-
events = ensure_started(item_id=item_id, item_kind="message", phase=
|
|
902
|
+
events = ensure_started(item_id=item_id, item_kind="message", phase=phase)
|
|
770
903
|
events.append(
|
|
771
904
|
ItemUpdated(
|
|
772
905
|
**self._canonical_kwargs( # type: ignore[attr-defined]
|
ksadk/runtime/adapter.py
CHANGED
|
@@ -114,6 +114,8 @@ class ResumePayload(BaseModel):
|
|
|
114
114
|
call_id: Optional[str] = None
|
|
115
115
|
"""对应的 ``approval.requested`` / ``tool.call`` 的 id(如有)。"""
|
|
116
116
|
data: Any = None
|
|
117
|
+
session_context: dict[str, Any] | None = None
|
|
118
|
+
"""Platform-owned snapshot for a new resume invocation; never model input."""
|
|
117
119
|
|
|
118
120
|
|
|
119
121
|
# ---------------------------------------------------------------------------
|
|
@@ -417,6 +419,7 @@ class RuntimeAdapter(ABC):
|
|
|
417
419
|
inject=_unavailable("runtime_no_native_inject"),
|
|
418
420
|
checkpoint=_unavailable(),
|
|
419
421
|
durable_restore=_unavailable(),
|
|
422
|
+
interaction_mode="unavailable",
|
|
420
423
|
)
|
|
421
424
|
|
|
422
425
|
def native_capabilities(self) -> dict[str, object]:
|
|
@@ -194,12 +194,21 @@ async def iter_runtime_conversation_events(
|
|
|
194
194
|
for persisted in await pipeline.ingest(context_event):
|
|
195
195
|
yield persisted
|
|
196
196
|
async for event in executor.stream(handle):
|
|
197
|
-
_validate_event_scope(
|
|
197
|
+
_validate_event_scope(
|
|
198
|
+
event,
|
|
199
|
+
request,
|
|
200
|
+
alternate_run_id=(
|
|
201
|
+
prepared.invocation_id if checkpoint_resume is not None else None
|
|
202
|
+
),
|
|
203
|
+
)
|
|
198
204
|
for persisted in await pipeline.ingest(event):
|
|
199
205
|
await _project_runtime_run_status(
|
|
200
206
|
persisted,
|
|
201
207
|
session_id=prepared.session_id,
|
|
202
208
|
author=agent_id,
|
|
209
|
+
invocation_id=(
|
|
210
|
+
prepared.invocation_id if checkpoint_resume is not None else None
|
|
211
|
+
),
|
|
203
212
|
run_mode=prepared.run_mode,
|
|
204
213
|
run_trigger=prepared.run_trigger,
|
|
205
214
|
session_service_provider=provider,
|
|
@@ -223,13 +232,16 @@ async def iter_runtime_conversation_events(
|
|
|
223
232
|
raise RuntimeError("runtime stream ended without a terminal or interrupted event")
|
|
224
233
|
except asyncio.CancelledError:
|
|
225
234
|
cancel_result = await executor.cancel(handle)
|
|
235
|
+
cancel_run_id = (
|
|
236
|
+
prepared.invocation_id if checkpoint_resume is not None else handle.run_id
|
|
237
|
+
)
|
|
226
238
|
cancelled_event = RunCanceled(
|
|
227
239
|
schema_version=2,
|
|
228
|
-
event_id=f"cancel:{
|
|
240
|
+
event_id=f"cancel:{cancel_run_id}:{cancel_result.value}",
|
|
229
241
|
seq=0,
|
|
230
242
|
timestamp=time.time(),
|
|
231
|
-
run_id=
|
|
232
|
-
scope_id=
|
|
243
|
+
run_id=cancel_run_id,
|
|
244
|
+
scope_id=cancel_run_id,
|
|
233
245
|
source=SourceRef(
|
|
234
246
|
framework="ksadk", metadata={"cancel_result": cancel_result.value}
|
|
235
247
|
),
|
|
@@ -241,6 +253,9 @@ async def iter_runtime_conversation_events(
|
|
|
241
253
|
persisted_cancelled,
|
|
242
254
|
session_id=prepared.session_id,
|
|
243
255
|
author=agent_id,
|
|
256
|
+
invocation_id=(
|
|
257
|
+
prepared.invocation_id if checkpoint_resume is not None else None
|
|
258
|
+
),
|
|
244
259
|
run_mode=prepared.run_mode,
|
|
245
260
|
run_trigger=prepared.run_trigger,
|
|
246
261
|
session_service_provider=provider,
|
|
@@ -375,6 +390,7 @@ async def _project_runtime_run_status(
|
|
|
375
390
|
*,
|
|
376
391
|
session_id: str,
|
|
377
392
|
author: str,
|
|
393
|
+
invocation_id: str | None = None,
|
|
378
394
|
run_mode: str,
|
|
379
395
|
run_trigger: str,
|
|
380
396
|
session_service_provider: Callable[[], Any],
|
|
@@ -389,7 +405,7 @@ async def _project_runtime_run_status(
|
|
|
389
405
|
session_id=session_id,
|
|
390
406
|
author=author,
|
|
391
407
|
status=status,
|
|
392
|
-
invocation_id=event.run_id,
|
|
408
|
+
invocation_id=str(invocation_id or event.run_id),
|
|
393
409
|
detail=str(detail) if detail else None,
|
|
394
410
|
metadata={
|
|
395
411
|
"runtime_event_id": event.event_id,
|
|
@@ -450,10 +466,7 @@ async def _resume_runtime_handle(
|
|
|
450
466
|
def _resume_target(resume_input: Mapping[str, Any]) -> ResumeTarget:
|
|
451
467
|
framework = str(resume_input.get("framework") or "").strip().lower()
|
|
452
468
|
framework_ref = resume_input.get("framework_ref")
|
|
453
|
-
|
|
454
|
-
runtime_ref: Mapping[str, Any] = (
|
|
455
|
-
raw_runtime_ref if isinstance(raw_runtime_ref, Mapping) else {}
|
|
456
|
-
)
|
|
469
|
+
runtime_ref = _runtime_ref_from_projection(framework, framework_ref)
|
|
457
470
|
checkpoint_id = str(resume_input.get("checkpoint_id") or "").strip()
|
|
458
471
|
run_id = str(resume_input.get("run_id") or "").strip()
|
|
459
472
|
if framework == "langgraph":
|
|
@@ -470,8 +483,7 @@ def _persisted_resume_native_ref(resume_input: Mapping[str, Any]) -> dict[str, A
|
|
|
470
483
|
checkpoint_id = str(resume_input.get("checkpoint_id") or "").strip()
|
|
471
484
|
framework_ref = resume_input.get("framework_ref")
|
|
472
485
|
normalized_ref = dict(framework_ref) if isinstance(framework_ref, Mapping) else {}
|
|
473
|
-
|
|
474
|
-
native_ref = dict(runtime_ref) if isinstance(runtime_ref, Mapping) else {}
|
|
486
|
+
native_ref = _runtime_ref_from_projection(framework, normalized_ref)
|
|
475
487
|
native_ref["framework_ref"] = normalized_ref
|
|
476
488
|
if checkpoint_id:
|
|
477
489
|
native_ref.setdefault("checkpoint_id", checkpoint_id)
|
|
@@ -479,12 +491,45 @@ def _persisted_resume_native_ref(resume_input: Mapping[str, Any]) -> dict[str, A
|
|
|
479
491
|
return native_ref
|
|
480
492
|
|
|
481
493
|
|
|
482
|
-
def
|
|
494
|
+
def _runtime_ref_from_projection(framework: str, framework_ref: Any) -> dict[str, Any]:
|
|
495
|
+
"""Flatten native refs wrapped by checkpoint REST/session projections."""
|
|
496
|
+
|
|
497
|
+
if not framework or not isinstance(framework_ref, Mapping):
|
|
498
|
+
return {}
|
|
499
|
+
raw = framework_ref.get(framework)
|
|
500
|
+
if not isinstance(raw, Mapping):
|
|
501
|
+
return {}
|
|
502
|
+
resolved = dict(raw)
|
|
503
|
+
current = raw
|
|
504
|
+
for _ in range(4):
|
|
505
|
+
nested_ref: Mapping[str, Any] | None = None
|
|
506
|
+
for key in ("framework_ref", "resume_target"):
|
|
507
|
+
container = current.get(key)
|
|
508
|
+
candidate = container.get(framework) if isinstance(container, Mapping) else None
|
|
509
|
+
if isinstance(candidate, Mapping):
|
|
510
|
+
nested_ref = candidate
|
|
511
|
+
break
|
|
512
|
+
if nested_ref is None:
|
|
513
|
+
break
|
|
514
|
+
resolved.update(nested_ref)
|
|
515
|
+
current = nested_ref
|
|
516
|
+
return resolved
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
def _validate_event_scope(
|
|
520
|
+
event: RuntimeEvent,
|
|
521
|
+
request: StartRequest,
|
|
522
|
+
*,
|
|
523
|
+
alternate_run_id: str | None = None,
|
|
524
|
+
) -> None:
|
|
483
525
|
expected_run_id = str(request.metadata["invocation_id"])
|
|
484
|
-
|
|
526
|
+
expected_run_ids = {expected_run_id}
|
|
527
|
+
if alternate_run_id:
|
|
528
|
+
expected_run_ids.add(str(alternate_run_id))
|
|
529
|
+
if event.schema_version != 2 or event.run_id not in expected_run_ids:
|
|
485
530
|
raise ValueError(
|
|
486
531
|
"runtime event scope does not match request: "
|
|
487
|
-
f"expected run_id
|
|
532
|
+
f"expected run_id in {sorted(expected_run_ids)!r}, got {event.run_id!r}"
|
|
488
533
|
)
|
|
489
534
|
|
|
490
535
|
|
|
@@ -496,6 +541,14 @@ async def iter_runtime_conversation_semantic_events(
|
|
|
496
541
|
reducer = StreamReducer()
|
|
497
542
|
approval: dict[str, Any] | None = None
|
|
498
543
|
execution_context: dict[str, str] = {}
|
|
544
|
+
# (scope_id, call_id) → tool_name:不同子运行可复用原生 call_id。
|
|
545
|
+
# (ToolResultContent 不带 name,前端靠 name 关联 call/result)。
|
|
546
|
+
_tool_name_by_call_id: dict[tuple[str, str], str] = {}
|
|
547
|
+
# 按 scope 和 call_id 跨 ItemStarted/ItemCompleted 去重,保留其他子运行的调用。
|
|
548
|
+
# 各 adapter 产生 ToolCallContent 的位置不一致:Codex 在 ItemStarted.initial 和
|
|
549
|
+
# ItemCompleted.snapshot 都带(需去重);LangGraph/ADK 的 ItemStarted.initial=None,
|
|
550
|
+
# ToolCallContent 只出现在 ItemCompleted.snapshot(需在 Completed 补发,不能跳过)。
|
|
551
|
+
_emitted_tool_call_ids: set[tuple[str, str]] = set()
|
|
499
552
|
async for event in iter_runtime_conversation_events(
|
|
500
553
|
**kwargs, _execution_context=execution_context
|
|
501
554
|
):
|
|
@@ -543,15 +596,34 @@ async def iter_runtime_conversation_semantic_events(
|
|
|
543
596
|
elif isinstance(event, ItemStarted) and event.initial is not None:
|
|
544
597
|
for part in event.initial.parts:
|
|
545
598
|
if isinstance(part, ToolCallContent):
|
|
599
|
+
# 记录 call_id → name,供后续 tool_result 反查 name
|
|
600
|
+
# (ToolResultContent 不带 name,否则前端渲染成 "tool")。
|
|
601
|
+
if part.call_id and part.name:
|
|
602
|
+
_tool_name_by_call_id[(event.scope_id, part.call_id)] = part.name
|
|
603
|
+
if (event.scope_id, part.call_id) in _emitted_tool_call_ids:
|
|
604
|
+
continue
|
|
605
|
+
if part.call_id:
|
|
606
|
+
_emitted_tool_call_ids.add((event.scope_id, part.call_id))
|
|
546
607
|
yield _tool_call_semantic(part)
|
|
547
608
|
elif isinstance(event, ItemCompleted):
|
|
548
609
|
for part in event.snapshot.parts:
|
|
549
610
|
if isinstance(part, ToolCallContent):
|
|
611
|
+
# Codex 的 ItemStarted.initial 已发过 tool_call → 去重跳过;
|
|
612
|
+
# LangGraph/ADK 的 ItemStarted.initial=None 没发过 → 在这里补发,
|
|
613
|
+
# 否则 tool_call 事件会丢失、tool_result 也反查不到 name。
|
|
614
|
+
if part.call_id and part.name:
|
|
615
|
+
_tool_name_by_call_id[(event.scope_id, part.call_id)] = part.name
|
|
616
|
+
if (event.scope_id, part.call_id) in _emitted_tool_call_ids:
|
|
617
|
+
continue
|
|
618
|
+
if part.call_id:
|
|
619
|
+
_emitted_tool_call_ids.add((event.scope_id, part.call_id))
|
|
550
620
|
yield _tool_call_semantic(part)
|
|
551
621
|
elif isinstance(part, ToolResultContent):
|
|
622
|
+
# ToolResultContent 不带 name,用 call_id 反查 tool_call 的 name。
|
|
623
|
+
tool_name = _tool_name_by_call_id.get((event.scope_id, part.call_id), "")
|
|
552
624
|
yield {
|
|
553
625
|
"type": "tool_result",
|
|
554
|
-
"name":
|
|
626
|
+
"name": tool_name,
|
|
555
627
|
"output": part.result,
|
|
556
628
|
"run_id": part.call_id,
|
|
557
629
|
}
|
|
@@ -596,7 +668,11 @@ async def iter_runtime_conversation_semantic_events(
|
|
|
596
668
|
else None
|
|
597
669
|
)
|
|
598
670
|
if isinstance(requested_agentengine, Mapping):
|
|
599
|
-
completion_metadata["agentengine"] =
|
|
671
|
+
completion_metadata["agentengine"] = {
|
|
672
|
+
key: value
|
|
673
|
+
for key, value in requested_agentengine.items()
|
|
674
|
+
if key != "session_context"
|
|
675
|
+
}
|
|
600
676
|
completion_metadata["runtime"] = {
|
|
601
677
|
"duration_ms": event.source.metadata.get("duration_ms"),
|
|
602
678
|
"runtime_type": kwargs["launch_context"].runtime_type,
|