agentengine-sdk-python 0.8.4__py3-none-any.whl → 0.8.5__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.4.dist-info → agentengine_sdk_python-0.8.5.dist-info}/METADATA +6 -3
- {agentengine_sdk_python-0.8.4.dist-info → agentengine_sdk_python-0.8.5.dist-info}/RECORD +591 -365
- ksadk/_build_provenance.json +1 -1
- ksadk/_process.py +83 -0
- ksadk/_str_enum.py +17 -0
- ksadk/a2ui/core.py +3 -3
- ksadk/api/client.py +6 -0
- ksadk/builders/code_builder.py +38 -12
- ksadk/builders/framework_requirements.py +20 -2
- ksadk/cli/__init__.py +36 -0
- ksadk/cli/cmd_config.py +4 -4
- ksadk/cli/cmd_create.py +12 -12
- ksadk/cli/cmd_hermes.py +24 -2
- ksadk/cli/cmd_invoke.py +28 -5
- ksadk/cli/cmd_openclaw.py +26 -1
- ksadk/cli/cmd_plugin.py +70 -12
- ksadk/cli/cmd_studio.py +64 -16
- ksadk/cli/openclaw_env.py +1 -1
- ksadk/cli/resource_common.py +26 -0
- ksadk/codex/client.py +3 -2
- ksadk/configs/__init__.py +1 -1
- ksadk/configs/env_registry.py +125 -31
- ksadk/configs/env_registry_studio.py +86 -0
- ksadk/configs/global_config.py +1 -1
- ksadk/configs/settings.py +3 -3
- ksadk/connector/__init__.py +17 -0
- ksadk/connector/channel.py +477 -0
- ksadk/context_engine/capabilities.py +52 -4
- ksadk/conversations/attachment_storage.py +10 -3
- ksadk/conversations/attachments.py +16 -5
- ksadk/conversations/message_projection.py +23 -32
- ksadk/conversations/normalize.py +28 -10
- ksadk/conversations/runtime_baseline.py +37 -0
- ksadk/conversations/runtime_invocation.py +17 -4
- ksadk/conversations/runtime_observability.py +39 -10
- ksadk/conversations/runtime_payloads.py +8 -0
- ksadk/conversations/runtime_persistence.py +105 -9
- ksadk/conversations/runtime_preparation.py +13 -7
- ksadk/conversations/runtime_stream_events.py +29 -35
- ksadk/conversations/runtime_streaming.py +8 -0
- ksadk/events/adapters/_codex_items.py +16 -8
- ksadk/events/adapters/_langgraph_support.py +34 -0
- ksadk/events/session_event.py +2 -2
- ksadk/harness/__init__.py +14 -0
- ksadk/harness/app.py +11 -0
- ksadk/harness/artifact_store.py +213 -0
- ksadk/harness/capabilities.py +115 -0
- ksadk/harness/capability_runtime.py +237 -0
- ksadk/harness/closure_contract.py +92 -0
- ksadk/harness/compaction_record.py +122 -0
- ksadk/harness/compiler.py +284 -0
- ksadk/harness/conformance/__init__.py +33 -0
- ksadk/harness/conformance/contract.py +506 -0
- ksadk/harness/conformance/fixtures.py +102 -0
- ksadk/harness/context_engine.py +403 -0
- ksadk/harness/context_maintenance.py +259 -0
- ksadk/harness/context_manifest.py +188 -0
- ksadk/harness/context_tuning.py +168 -0
- ksadk/harness/draft_runtime.py +322 -0
- ksadk/harness/engine/__init__.py +40 -0
- ksadk/harness/engine/base.py +122 -0
- ksadk/harness/engine/budgets.py +108 -0
- ksadk/harness/engine/capability_declarations.py +59 -0
- ksadk/harness/engine/completion_guard.py +42 -0
- ksadk/harness/engine/context_pipeline.py +579 -0
- ksadk/harness/engine/graph_builder.py +859 -0
- ksadk/harness/engine/langgraph.py +931 -0
- ksadk/harness/engine/mcp_disclosure.py +750 -0
- ksadk/harness/engine/policy_runtime.py +70 -0
- ksadk/harness/engine/postgres_checkpointer.py +63 -0
- ksadk/harness/engine/run_control_bridge.py +80 -0
- ksadk/harness/engine/run_types.py +88 -0
- ksadk/harness/engine/skill_disclosure.py +189 -0
- ksadk/harness/engine/spans.py +41 -0
- ksadk/harness/engine/subagents.py +343 -0
- ksadk/harness/engine/thread_ids.py +112 -0
- ksadk/harness/engine/tool_dispatch.py +144 -0
- ksadk/harness/event_tree.py +212 -0
- ksadk/harness/events.py +461 -0
- ksadk/harness/execution_policy.py +94 -0
- ksadk/harness/insights.py +210 -0
- ksadk/harness/lifecycle.py +578 -0
- ksadk/harness/lifecycle_conformance.py +233 -0
- ksadk/harness/lifecycle_local_plane.py +104 -0
- ksadk/harness/loop/__init__.py +44 -0
- ksadk/harness/loop/reason.py +454 -0
- ksadk/harness/loop/tools.py +762 -0
- ksadk/harness/managed_runtime.py +884 -0
- ksadk/harness/mcp_matrix.py +474 -0
- ksadk/harness/mcp_runtime.py +471 -0
- ksadk/harness/memory_consolidation.py +157 -0
- ksadk/harness/memory_loop.py +156 -0
- ksadk/harness/memory_runtime.py +541 -0
- ksadk/harness/metrics.py +90 -0
- ksadk/harness/model_capability.py +253 -0
- ksadk/harness/model_provider.py +220 -0
- ksadk/harness/observability/__init__.py +29 -0
- ksadk/harness/observability/inspection.py +528 -0
- ksadk/harness/observability/metrics.py +167 -0
- ksadk/harness/observability/otel_exporter.py +218 -0
- ksadk/harness/prompt_cache.py +70 -0
- ksadk/harness/public_activity.py +154 -0
- ksadk/harness/readiness.py +249 -0
- ksadk/harness/reasoner.py +466 -13
- ksadk/harness/release_readiness.py +140 -0
- ksadk/harness/resource_ref.py +69 -0
- ksadk/harness/run_control.py +668 -0
- ksadk/harness/runtime.py +146 -111
- ksadk/harness/runtime_capabilities.py +158 -0
- ksadk/harness/runtime_server.py +514 -0
- ksadk/harness/sandbox_adapters.py +739 -0
- ksadk/harness/sandbox_backend.py +530 -0
- ksadk/harness/sandbox_conformance.py +288 -0
- ksadk/harness/sandbox_lease.py +77 -0
- ksadk/harness/sandbox_lease_conformance.py +259 -0
- ksadk/harness/sandbox_matrix.py +170 -0
- ksadk/harness/sandbox_reconciliation.py +140 -0
- ksadk/harness/sandbox_recovery.py +586 -0
- ksadk/harness/sandbox_recovery_conformance.py +246 -0
- ksadk/harness/session_store.py +243 -0
- ksadk/harness/skill_composition.py +212 -0
- ksadk/harness/skill_feedback.py +123 -0
- ksadk/harness/skill_matrix.py +233 -0
- ksadk/harness/skill_runtime.py +259 -0
- ksadk/harness/spec.py +332 -0
- ksadk/harness/state.py +153 -0
- ksadk/harness/strategies.py +149 -0
- ksadk/harness/subagent.py +253 -0
- ksadk/harness/tool_policy.py +131 -0
- ksadk/harness/tool_receipts.py +96 -0
- ksadk/harness/tool_reliability.py +81 -0
- ksadk/harness/user_errors.py +69 -0
- ksadk/harness/working_context.py +81 -0
- ksadk/harness/working_context_patch.py +99 -0
- ksadk/identity/resolver.py +18 -0
- ksadk/interaction/__init__.py +1 -1
- ksadk/interaction/ledger.py +1 -1
- ksadk/interaction/provider.py +1 -1
- ksadk/interaction/providers/__init__.py +3 -1
- ksadk/interaction/providers/adk.py +1 -1
- ksadk/interaction/providers/codex.py +1 -1
- ksadk/interaction/providers/harness.py +50 -0
- ksadk/interaction/providers/langgraph.py +1 -1
- ksadk/kernel/__init__.py +10 -0
- ksadk/kernel/approval_presentation.py +91 -0
- ksadk/kernel/authorization.py +1 -1
- ksadk/kernel/bootstrap.py +86 -102
- ksadk/kernel/contract_fingerprints.py +1 -1
- ksadk/kernel/contracts.py +5 -0
- ksadk/kernel/control.py +32 -1
- ksadk/kernel/execution_grants.py +221 -0
- ksadk/kernel/execution_grants_memory.py +133 -0
- ksadk/kernel/execution_grants_postgres.py +217 -0
- ksadk/kernel/execution_grants_sqlite.py +209 -0
- ksadk/kernel/ingress.py +27 -27
- ksadk/kernel/mapping.py +1 -1
- ksadk/kernel/memory_store.py +24 -11
- ksadk/kernel/postgres_store.py +63 -33
- ksadk/kernel/recovery.py +78 -14
- ksadk/kernel/sql/001_agent_kernel.sql +23 -0
- ksadk/kernel/sqlite_store.py +304 -25
- ksadk/kernel/state.py +2 -3
- ksadk/kernel/store.py +69 -2
- ksadk/kernel/worker.py +79 -41
- ksadk/kernel/worker_history.py +72 -0
- ksadk/kernel/worker_identity.py +47 -0
- ksadk/memory/coordinator.py +22 -6
- ksadk/memory/extraction.py +40 -1
- ksadk/memory/models.py +77 -1
- ksadk/memory/provider_resolver.py +5 -0
- ksadk/memory/providers/local_postgres.py +200 -0
- ksadk/memory/providers/local_sqlite.py +42 -3
- ksadk/memory/retrieval.py +189 -0
- ksadk/memory/store_adapter.py +150 -0
- ksadk/model_policy.py +2 -2
- ksadk/model_proxy/detect.py +254 -0
- ksadk/model_proxy/server.py +4 -2
- ksadk/model_proxy/transform.py +40 -2
- ksadk/plugins/__init__.py +1 -1
- ksadk/plugins/bridges/dsh.py +11 -0
- ksadk/plugins/builtins.py +40 -2
- ksadk/plugins/companion_artifacts.py +83 -0
- ksadk/plugins/companions.py +368 -0
- ksadk/plugins/contracts.py +1 -1
- ksadk/plugins/dsh_channels.py +156 -0
- ksadk/plugins/dsh_home.py +140 -0
- ksadk/plugins/dsh_teams.py +105 -0
- ksadk/plugins/dsh_toolchain.py +101 -19
- ksadk/plugins/execution_host.py +99 -0
- ksadk/plugins/providers/bundles/dsh-channels-client/client.js +19 -0
- ksadk/plugins/providers/bundles/dsh-channels-client/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-channels-client/index.mjs +7 -0
- ksadk/plugins/providers/bundles/dsh-channels-client/package.json +12 -0
- ksadk/plugins/providers/bundles/dsh-knowledge/package.json +1 -1
- ksadk/plugins/providers/bundles/dsh-memory/package.json +1 -1
- ksadk/plugins/providers/bundles/dsh-skill-center/package.json +1 -1
- ksadk/plugins/providers/bundles/dsh-teams-client/client.js +29 -0
- ksadk/plugins/providers/bundles/dsh-teams-client/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-teams-client/index.mjs +11 -0
- ksadk/plugins/providers/bundles/dsh-teams-client/package.json +35 -0
- ksadk/plugins/providers/bundles/dsh-teams-leader-policy/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-teams-leader-policy/index.mjs +13 -0
- ksadk/plugins/providers/bundles/dsh-teams-leader-policy/package.json +27 -0
- ksadk/plugins/providers/bundles/dsh-teams-profile/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-teams-profile/index.mjs +12 -0
- ksadk/plugins/providers/bundles/dsh-teams-profile/package.json +26 -0
- ksadk/plugins/providers/bundles/dsh-teams-router/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-teams-router/index.mjs +16 -0
- ksadk/plugins/providers/bundles/dsh-teams-router/package.json +27 -0
- ksadk/plugins/providers/bundles/dsh-teams-tasks/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-teams-tasks/index.mjs +16 -0
- ksadk/plugins/providers/bundles/dsh-teams-tasks/package.json +27 -0
- ksadk/plugins/providers/bundles/dsh-teams-tools/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-teams-tools/index.mjs +25 -0
- ksadk/plugins/providers/bundles/dsh-teams-tools/package.json +29 -0
- ksadk/plugins/providers/bundles/dsh-teams-tools/tools.json +235 -0
- ksadk/plugins/providers/bundles/ksadk-codex/index.mjs +1 -1
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/index.mjs +51 -1
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/package.json +2 -2
- ksadk/plugins/providers/bundles/ksadk-dsh-companion-host/client.mjs +133 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-companion-host/index.mjs +14 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/client.js +27 -4
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/index.mjs +9 -5
- ksadk/plugins/providers/bundles/ksadk-harness/index.mjs +1 -1
- ksadk/plugins/providers/codex.py +10 -2
- ksadk/plugins/providers/dsh_capabilities.py +61 -0
- ksadk/plugins/providers/harness.py +181 -33
- ksadk/plugins/providers/harness_delegation.py +593 -0
- ksadk/plugins/providers/harness_managed.py +456 -0
- ksadk/plugins/providers/harness_tools.py +326 -0
- ksadk/plugins/providers/shipped_dsh.py +4 -1
- ksadk/plugins/subagent_providers/codex.py +28 -6
- ksadk/plugins/teams/__init__.py +5 -0
- ksadk/plugins/teams/api.py +405 -0
- ksadk/plugins/teams/application.py +680 -0
- ksadk/plugins/teams/artifacts.py +60 -0
- ksadk/plugins/teams/context.py +96 -0
- ksadk/plugins/teams/contracts.py +136 -0
- ksadk/plugins/teams/domain.py +1427 -0
- ksadk/plugins/teams/domain_values.py +24 -0
- ksadk/plugins/teams/errors.py +13 -0
- ksadk/plugins/teams/migration.py +311 -0
- ksadk/plugins/teams/migration_cli.py +322 -0
- ksadk/plugins/teams/postgres_store.py +138 -0
- ksadk/plugins/teams/runtime.py +777 -0
- ksadk/plugins/teams/source_projection.py +84 -0
- ksadk/plugins/teams/store.py +311 -0
- ksadk/plugins/teams/task_decisions.py +423 -0
- ksadk/plugins/teams/transport.py +91 -0
- ksadk/plugins/teams/workspaces.py +255 -0
- ksadk/runners/_langgraph_runner_streams.py +121 -45
- ksadk/runners/_langgraph_state_reader.py +106 -0
- ksadk/runners/_session_identity.py +285 -0
- ksadk/runners/adk_runner.py +25 -60
- ksadk/runners/langgraph_runner.py +128 -111
- ksadk/runners/patch_langchain.py +47 -0
- ksadk/runners/usage_accumulator.py +11 -3
- ksadk/runtime/_runner_adapter/stream_mapping.py +52 -2
- ksadk/runtime/conversation_execution.py +25 -1
- ksadk/runtime/executor.py +9 -1
- ksadk/runtime/factory.py +36 -1
- ksadk/runtime/preprocessing.py +11 -3
- ksadk/runtime/runner_adapter.py +38 -9
- ksadk/runtime/skill_eval_result.py +36 -0
- ksadk/runtime/timing.py +46 -0
- ksadk/runtime/usage.py +49 -18
- ksadk/runtime_context.py +103 -1
- ksadk/sandbox/backends/e2b.py +245 -23
- ksadk/sandbox/backends/local_process.py +63 -39
- ksadk/sandbox/base.py +62 -1
- ksadk/sandbox/diagnostics.py +82 -0
- ksadk/sandbox/local_controls.py +746 -0
- ksadk/sandbox/local_launcher.py +90 -0
- ksadk/scheduler/dispatcher.py +1 -1
- ksadk/server/invocation_identity.py +118 -0
- ksadk/server/routes/common.py +32 -3
- ksadk/server/routes/control.py +64 -9
- ksadk/server/routes/dependencies.py +2 -1
- ksadk/server/routes/kernel_ingress.py +9 -1
- ksadk/server/routes/misc.py +233 -25
- ksadk/server/routes/models.py +3 -3
- ksadk/server/routes/openai_compat.py +76 -13
- ksadk/server/routes/run.py +106 -35
- ksadk/server/routes/sessions.py +244 -68
- ksadk/server/routes/workspace.py +130 -21
- ksadk/server/static/assets/{ArtifactsPanel-CGbWlMNh.js → ArtifactsPanel-C1YoaKhx.js} +1 -1
- ksadk/server/static/assets/{CodeBlock-b4C7upmO.js → CodeBlock-DHuAWfr5.js} +10 -7
- ksadk/server/static/assets/MathMessageMarkdown-cvdrBwYr.js +8 -0
- ksadk/server/static/assets/{MermaidBlock-BEBN4Ksz.js → MermaidBlock-DeBkbJvI.js} +9 -9
- ksadk/server/static/assets/{NativeTerminalPanel-zvL-WpAn.js → NativeTerminalPanel-oJj44_sV.js} +1 -1
- ksadk/server/static/assets/{abnfDiagram-VCTEODGH-BYafW7Za.js → abnfDiagram-VCTEODGH-Dhfv25o2.js} +1 -1
- ksadk/server/static/assets/{arc-bTohInsS.js → arc-C35w-pn1.js} +1 -1
- ksadk/server/static/assets/architecture-7GRP2DOG-BCsa26zi.js +1 -0
- ksadk/server/static/assets/{architectureDiagram-5GKGNRK7-Ch5Lbzsi.js → architectureDiagram-5GKGNRK7-FoMY_u6D.js} +1 -1
- ksadk/server/static/assets/{blockDiagram-NRAW4CY4-kqF4MDOG.js → blockDiagram-NRAW4CY4-zD4Rt7oE.js} +1 -1
- ksadk/server/static/assets/{c4Diagram-UCG6FXSJ-8uSRIODv.js → c4Diagram-UCG6FXSJ-BCtGGkhN.js} +1 -1
- ksadk/server/static/assets/channel-_KDifNys.js +1 -0
- ksadk/server/static/assets/chunk-2Q5K7J3B-HdVkJ9F0.js +1 -0
- ksadk/server/static/assets/{chunk-5VM5RSS4-DkhehZDr.js → chunk-5VM5RSS4-C2Ms13_k.js} +1 -1
- ksadk/server/static/assets/{chunk-F27PBJKO-BdXhtPe9.js → chunk-F27PBJKO-BoTj-qgx.js} +1 -1
- ksadk/server/static/assets/{chunk-G27WJ6UU-DPTpvpwi.js → chunk-G27WJ6UU-DOMyyjHH.js} +1 -1
- ksadk/server/static/assets/{chunk-JWPE2WC7-Pqoh38el.js → chunk-JWPE2WC7-DbJJqDli.js} +1 -1
- ksadk/server/static/assets/{chunk-LCL6LL3I-DeU00qC-.js → chunk-LCL6LL3I-CLuRCt_W.js} +1 -1
- ksadk/server/static/assets/{chunk-POPQ4Y6H-CzxScFkr.js → chunk-POPQ4Y6H-D0Dz847e.js} +1 -1
- ksadk/server/static/assets/{chunk-RHFEMEQ7-DpqMx-ux.js → chunk-RHFEMEQ7-BWSRzEcd.js} +1 -1
- ksadk/server/static/assets/{chunk-SVP7TREG-C6t0SypQ.js → chunk-SVP7TREG-CPoHqkCY.js} +1 -1
- ksadk/server/static/assets/{chunk-XXDRQBXY-DVaeafZk.js → chunk-XXDRQBXY-Bx1jS-X-.js} +1 -1
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-BVCW3ZqZ.js +1 -0
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-BVCW3ZqZ.js +1 -0
- ksadk/server/static/assets/{cose-bilkent-JH36ORCC-Bf9D3tzJ.js → cose-bilkent-JH36ORCC-LzyWm4m0.js} +1 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-CNXjFctL.js +1 -0
- ksadk/server/static/assets/{cynefinDiagram-5FMLGOSQ-B9cY3iTz.js → cynefinDiagram-5FMLGOSQ-BlW_bHED.js} +1 -1
- ksadk/server/static/assets/{dagre-3AP2YEHR-CSwlx3CB.js → dagre-3AP2YEHR-Bu_S86_i.js} +1 -1
- ksadk/server/static/assets/{dagre-UBpgon5q.js → dagre-B7nCawed.js} +1 -1
- ksadk/server/static/assets/{diagram-S7CK7UJ4-C9akhN9a.js → diagram-S7CK7UJ4-W_Zow2Km.js} +1 -1
- ksadk/server/static/assets/{diagram-UQ7AKVKN-CgedhTPI.js → diagram-UQ7AKVKN-CLIKAHON.js} +1 -1
- ksadk/server/static/assets/{diagram-VSXAHHWV-Cjucz5BY.js → diagram-VSXAHHWV-Dv6_QAlN.js} +1 -1
- ksadk/server/static/assets/{diagram-VX7I27RA-Dd4Vleyn.js → diagram-VX7I27RA-BWAWRDtZ.js} +1 -1
- ksadk/server/static/assets/{diagram-Z3DM3KII-CZ2jGtYW.js → diagram-Z3DM3KII-XA_rWMss.js} +1 -1
- ksadk/server/static/assets/dist-0X_j2Rcc.js +1 -0
- ksadk/server/static/assets/{dist-DiixqL0J.js → dist-1nXCdsej.js} +1 -1
- ksadk/server/static/assets/{dist-BIr4DSRq.js → dist-2vL2sAdF.js} +1 -1
- ksadk/server/static/assets/{dist-D_ctSS2i.js → dist-B3bA05-e.js} +1 -1
- ksadk/server/static/assets/{dist-ClYUxfeK.js → dist-BLpRy_Yx.js} +1 -1
- ksadk/server/static/assets/{dist-QfkEHOlb.js → dist-BO_UwatH.js} +1 -1
- ksadk/server/static/assets/{dist-B3FR1SKK.js → dist-BdNFAney.js} +1 -1
- ksadk/server/static/assets/{dist-BnaTiyzN.js → dist-C0J5_3qM.js} +1 -1
- ksadk/server/static/assets/{dist-Bj730Ib4.js → dist-CGt_UGeO.js} +1 -1
- ksadk/server/static/assets/{dist-CFzsn6BG.js → dist-CIRMvUM4.js} +1 -1
- ksadk/server/static/assets/{dist-BgV_owcB.js → dist-CIpWk_5f.js} +1 -1
- ksadk/server/static/assets/{dist-C5_ZAZsG.js → dist-CPyieXEf.js} +1 -1
- ksadk/server/static/assets/{dist-btbmmX5O.js → dist-D-92S-Fd.js} +1 -1
- ksadk/server/static/assets/{dist-fBO2v5Kt.js → dist-DNKuMzWc.js} +1 -1
- ksadk/server/static/assets/{dist-ufY3F5p6.js → dist-DWfdmz9s.js} +2 -2
- ksadk/server/static/assets/{dist-DVCOWtha.js → dist-DppE_r-D.js} +1 -1
- ksadk/server/static/assets/{dist-C1NMAY5a.js → dist-DyG6Ya-z.js} +1 -1
- ksadk/server/static/assets/{dist-CB9iJrvg.js → dist-M-SrdhhZ.js} +1 -1
- ksadk/server/static/assets/{dist-DvFK7p5S.js → dist-mqD5TZup.js} +1 -1
- ksadk/server/static/assets/{dist-Cf125P_m.js → dist-n3n6t_FO.js} +1 -1
- ksadk/server/static/assets/{dist-DFD6Qa6T.js → dist-qe8xjesy.js} +1 -1
- ksadk/server/static/assets/{dist-DoVSwoDb.js → dist-t6MzE0jU.js} +1 -1
- ksadk/server/static/assets/{ebnfDiagram-PWID7BFC-Ci8NqqZu.js → ebnfDiagram-PWID7BFC-BfCzF1Xi.js} +1 -1
- ksadk/server/static/assets/{erDiagram-SSCWMZ5O-CCIOhLZG.js → erDiagram-SSCWMZ5O-Dpz9_0zn.js} +1 -1
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-B5-8RH9c.js +1 -0
- ksadk/server/static/assets/flowDiagram-A5DVABFB-BppFxEKw.js +1 -0
- ksadk/server/static/assets/{ganttDiagram-EL5Y4UJY-Cp_r9Hb6.js → ganttDiagram-EL5Y4UJY-DDaG1f4_.js} +1 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-B-AhYj4C.js +1 -0
- ksadk/server/static/assets/{gitGraphDiagram-WWUBYQGX-Dlhc8Wr8.js → gitGraphDiagram-WWUBYQGX-DcxzRwYC.js} +1 -1
- ksadk/server/static/assets/index-BMd2mucF.css +2 -0
- ksadk/server/static/assets/index-D5qyyhTH.js +244 -0
- ksadk/server/static/assets/info-A6RAGUB7-0uiKrC35.js +1 -0
- ksadk/server/static/assets/{infoDiagram-RXCK75RN-CO0rRTRA.js → infoDiagram-RXCK75RN-CYMdn6lQ.js} +1 -1
- ksadk/server/static/assets/{ishikawaDiagram-5VMMS53U-CHiaedSS.js → ishikawaDiagram-5VMMS53U-CLHFAD6c.js} +1 -1
- ksadk/server/static/assets/{journeyDiagram-EYS64GPL-CHcCIB09.js → journeyDiagram-EYS64GPL-BHSKQGAl.js} +1 -1
- ksadk/server/static/assets/{kanban-definition-3QL26DDD-CJ_ebBZf.js → kanban-definition-3QL26DDD-D5W3tjTT.js} +1 -1
- ksadk/server/static/assets/{katex-B4weu383.js → katex-mtjOi4KM.js} +1 -1
- ksadk/server/static/assets/{linear-V-MgYHW1.js → linear-BETqsxE_.js} +1 -1
- ksadk/server/static/assets/{mermaid-parser.core-CBijEX_c.js → mermaid-parser.core-DPWrvs90.js} +2 -2
- ksadk/server/static/assets/{mindmap-definition-FBJOCRG2-Bc-pQvpp.js → mindmap-definition-FBJOCRG2-CJG2mfBP.js} +1 -1
- ksadk/server/static/assets/packet-AYTQ26CC-BVTmZ_cw.js +1 -0
- ksadk/server/static/assets/{pegDiagram-XKGWAZYB-D7genGLl.js → pegDiagram-XKGWAZYB-GjAPNaqn.js} +1 -1
- ksadk/server/static/assets/pie-WAS4IAKB-DyfxBU7V.js +1 -0
- ksadk/server/static/assets/{pieDiagram-E7YTZNPT-Bxj32zwD.js → pieDiagram-E7YTZNPT-ToIewrqr.js} +1 -1
- ksadk/server/static/assets/{quadrantDiagram-AXDQQJYC-BURv2mGh.js → quadrantDiagram-AXDQQJYC-4d78KiEY.js} +1 -1
- ksadk/server/static/assets/radar-RG4KPBEZ-FFontjL2.js +1 -0
- ksadk/server/static/assets/railroad-74A4TZTK-D0Uidzen.js +1 -0
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-BOo_9T2h.js +1 -0
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-D6-BjW7Z.js +1 -0
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-CXx__yMm.js +1 -0
- ksadk/server/static/assets/{railroadDiagram-O6MQD6OU-CCsh3avW.js → railroadDiagram-O6MQD6OU-DKzx4xfv.js} +1 -1
- ksadk/server/static/assets/{requirementDiagram-EFPCY7ZU-_FRRBKEd.js → requirementDiagram-EFPCY7ZU-CJYljxQS.js} +1 -1
- ksadk/server/static/assets/{sankeyDiagram-P5KCCOFB-C-gr2o9M.js → sankeyDiagram-P5KCCOFB-DLU2fV1w.js} +1 -1
- ksadk/server/static/assets/{sequenceDiagram-WJ2MYXX4-D97NmfKg.js → sequenceDiagram-WJ2MYXX4-CVqysrA9.js} +1 -1
- ksadk/server/static/assets/{sizeCapture-X5ZJPWSS-DjrPC5FX.js → sizeCapture-X5ZJPWSS-BUxfmTHc.js} +1 -1
- ksadk/server/static/assets/{stateDiagram-HBIQ2CUA-DzMNg1hh.js → stateDiagram-HBIQ2CUA-CNFgYI9E.js} +1 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-BXAFScz8.js +1 -0
- ksadk/server/static/assets/{swimlanes-XN3QIQJK-Cssf_CsU.js → swimlanes-XN3QIQJK-B6qCMe8N.js} +1 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-uIQ2lJKH.js +8 -0
- ksadk/server/static/assets/{timeline-definition-24CTP7MA-BWTHzyS1.js → timeline-definition-24CTP7MA-CMD3x_U_.js} +1 -1
- ksadk/server/static/assets/treeView-Q6P3EWNA-CK5GgucZ.js +1 -0
- ksadk/server/static/assets/treemap-WGGIJYW6-Bq1u1SpG.js +1 -0
- ksadk/server/static/assets/{vennDiagram-4TSXK5OY-BSKgJsmR.js → vennDiagram-4TSXK5OY-BqtUqvXM.js} +1 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-QAt06uEz.js +1 -0
- ksadk/server/static/assets/{wardleyDiagram-VM6X3IG4-eflHNoaZ.js → wardleyDiagram-VM6X3IG4-B5KfDjI-.js} +1 -1
- ksadk/server/static/assets/{xychartDiagram-S5SC5T6Z-eYqrQ-v4.js → xychartDiagram-S5SC5T6Z-BaUlSZrn.js} +1 -1
- ksadk/server/static/index.html +2 -2
- ksadk/server/terminal_sessions.py +34 -2
- ksadk/sessions/invocation_identity.py +235 -0
- ksadk/skills/__init__.py +26 -0
- ksadk/skills/events.py +464 -0
- ksadk/skills/manifest_cache.py +263 -0
- ksadk/skills/mcp_server/__init__.py +0 -0
- ksadk/skills/mcp_server/_registry.py +33 -0
- ksadk/skills/mcp_server/_routing.py +26 -0
- ksadk/skills/mcp_server/_workspace_files.py +160 -0
- ksadk/skills/mcp_server/register.py +415 -0
- ksadk/skills/mcp_server/server.py +218 -0
- ksadk/skills/models.py +11 -0
- ksadk/skills/observability.py +132 -0
- ksadk/skills/package_store.py +75 -2
- ksadk/skills/runtime/agent.py +38 -5
- ksadk/skills/runtime/artifacts.py +87 -0
- ksadk/skills/runtime/backends/e2b.py +393 -52
- ksadk/skills/runtime/backends/local.py +621 -119
- ksadk/skills/runtime/base.py +78 -7
- ksadk/skills/runtime/executor.py +266 -1
- ksadk/skills/runtime/loader.py +108 -3
- ksadk/skills/runtime/request.py +18 -0
- ksadk/skills/tool_defs.py +108 -3
- ksadk/studio/api.py +592 -57
- ksadk/studio/api_contracts.py +8 -2
- ksadk/studio/api_plugin_routes.py +39 -12
- ksadk/studio/api_resource_connections.py +79 -41
- ksadk/studio/authoring.py +12 -6
- ksadk/studio/authoring_coordinator.py +4 -2
- ksadk/studio/builder.py +12 -0
- ksadk/studio/capabilities.py +23 -6
- ksadk/studio/channel_connections.py +333 -0
- ksadk/studio/cloud.py +30 -10
- ksadk/studio/cloud_shared_web.py +75 -2
- ksadk/studio/codex_agent_service.py +2 -2
- ksadk/studio/codex_builder.py +1 -1
- ksadk/studio/codex_run.py +6 -1
- ksadk/studio/compiler.py +10 -0
- ksadk/studio/configuration.py +182 -0
- ksadk/studio/contracts.py +33 -5
- ksadk/studio/dsh_application.py +135 -25
- ksadk/studio/dsh_capability_service.py +287 -20
- ksadk/studio/dsh_lifecycle.py +58 -0
- ksadk/studio/dsh_provider_registration.py +55 -16
- ksadk/studio/entry.py +53 -0
- ksadk/studio/event_store.py +36 -5
- ksadk/studio/execution_host.py +525 -0
- ksadk/studio/framework_run.py +32 -10
- ksadk/studio/hosted_kernel.py +1 -1
- ksadk/studio/kernel_registry.py +418 -0
- ksadk/studio/kernel_sqlite_migration.py +181 -0
- ksadk/studio/model_client.py +1178 -64
- ksadk/studio/model_profile_service.py +26 -11
- ksadk/studio/native_documents.py +172 -0
- ksadk/studio/plugin_composition.py +13 -2
- ksadk/studio/plugin_kernel_adapter.py +15 -0
- ksadk/studio/plugin_lifecycle.py +80 -0
- ksadk/studio/plugin_runtime.py +230 -17
- ksadk/studio/provider_recovery.py +59 -0
- ksadk/studio/recovery_page.py +70 -0
- ksadk/studio/resource_authority.py +59 -32
- ksadk/studio/resource_catalog.py +6 -0
- ksadk/studio/run_activity.py +895 -0
- ksadk/studio/run_documents.py +127 -0
- ksadk/studio/run_service.py +329 -33
- ksadk/studio/runtime_catalog.py +53 -10
- ksadk/studio/runtime_source.py +1 -1
- ksadk/studio/scheduler_runtime.py +32 -289
- ksadk/studio/service.py +398 -103
- ksadk/studio/shared_web.py +149 -36
- ksadk/studio/static/assets/ChannelsPage-D_PGmKVq.js +8 -0
- ksadk/studio/static/assets/CodeBlock-DMIf4h33-UIqo-BPW.js +44 -0
- ksadk/studio/static/assets/ExecutionTree-v3HexvPo-Bk8wzGSy.js +1 -0
- ksadk/studio/static/assets/MathMessageMarkdown-BesSeCYl-OhNwH4K9.js +8 -0
- ksadk/studio/static/assets/MermaidBlock-H_0qzQDf-BdXtxug_.js +11 -0
- ksadk/studio/static/assets/MessageMarkdown-CwMTvgFj-g0I-I4dD.js +59 -0
- ksadk/studio/static/assets/PrismRenderer-5pK6tUdb.js +3 -0
- ksadk/studio/static/assets/TeamsPage-DqX4HWKQ.js +3 -0
- ksadk/studio/static/assets/abnfDiagram-VCTEODGH-Bnb1O3tA.js +1 -0
- ksadk/studio/static/assets/architecture-7GRP2DOG-BMOPAkUC.js +1 -0
- ksadk/studio/static/assets/architectureDiagram-5GKGNRK7-5Zn1gqJv.js +36 -0
- ksadk/studio/static/assets/{blockDiagram-I7D4REHJ-CFmPl1de.js → blockDiagram-I7D4REHJ-CLB4L11u.js} +6 -6
- ksadk/studio/static/assets/{c4Diagram-7LVT6UL2-BRrGu8qt.js → c4Diagram-7LVT6UL2-BOma_Z_F.js} +7 -7
- ksadk/studio/static/assets/channel-r8itPEik.js +1 -0
- ksadk/studio/static/assets/chunk-2E4U76K2-BFf_huql.js +2 -0
- ksadk/studio/static/assets/chunk-2ZTRR5NV-C2qZJila.js +2 -0
- ksadk/studio/static/assets/chunk-3Z5EZCMW-DMniOlPd.js +1 -0
- ksadk/studio/static/assets/{chunk-4HAMMTFA-D220vUtq.js → chunk-4HAMMTFA-DVtDP4rm.js} +7 -7
- ksadk/studio/static/assets/chunk-5V3GS4D5-i-ZDOEnP.js +1 -0
- ksadk/studio/static/assets/chunk-6AZGARVD-BB6FqMl-.js +1 -0
- ksadk/studio/static/assets/chunk-6EIED4P4-DdUJkP0f.js +1 -0
- ksadk/studio/static/assets/chunk-6K3QC6MW-CqVsVn-y.js +1 -0
- ksadk/studio/static/assets/chunk-6TQVIW2G-DKlLbNIP.js +1 -0
- ksadk/studio/static/assets/chunk-747NJXEK-BFkZPlab.js +2 -0
- ksadk/studio/static/assets/chunk-75Z2AOVW-BZNhM4vB.js +2 -0
- ksadk/studio/static/assets/chunk-CLGD4ZFX-D-GTtyKs.js +1 -0
- ksadk/studio/static/assets/{chunk-DU6HZSFF-C4DtVpCu.js → chunk-DU6HZSFF-CpEZCUgg.js} +1 -1
- ksadk/studio/static/assets/chunk-F27PBJKO-D7pvKf0C.js +1 -0
- ksadk/studio/static/assets/{chunk-GMAD6QVW-DiQA-u2N.js → chunk-GMAD6QVW-DE_8H717.js} +6 -6
- ksadk/studio/static/assets/chunk-GVQU2GXP-BfEB0lNv.js +1 -0
- ksadk/studio/static/assets/chunk-I5DQTOEV-Hm2LfiYI.js +1 -0
- ksadk/studio/static/assets/chunk-ICYGCRZG-749o-pGJ.js +1 -0
- ksadk/studio/static/assets/chunk-IH6LHLGP-CC6I9F3i.js +1 -0
- ksadk/studio/static/assets/{chunk-IMKFNOWR-BSlbjT_b.js → chunk-IMKFNOWR-D38axYOR.js} +5 -5
- ksadk/studio/static/assets/chunk-KI3K4JFJ-Rma-0k_M.js +1 -0
- ksadk/studio/static/assets/chunk-L3NEJ4N5-Dq5xn7aL.js +1 -0
- ksadk/studio/static/assets/chunk-LNGE3PJU-DWpGwHrW.js +34 -0
- ksadk/studio/static/assets/{chunk-OSK3NFVY-M2m6G3j4.js → chunk-OSK3NFVY-DiCQjx9b.js} +5 -5
- ksadk/studio/static/assets/chunk-OUJLGHUK-D0j2JRSg.js +2 -0
- ksadk/studio/static/assets/{chunk-P2QGCYS3-DezaQxiK.js → chunk-P2QGCYS3-VdhKmfYq.js} +1 -1
- ksadk/studio/static/assets/chunk-POPQ4Y6H-C1_rzO5M.js +1 -0
- ksadk/studio/static/assets/chunk-PWAF6VOD-B45HvflI.js +1 -0
- ksadk/studio/static/assets/{chunk-SHT3W25Y-DAyIVp5H.js → chunk-SHT3W25Y-DsCFnRVE.js} +9 -9
- ksadk/studio/static/assets/{chunk-SVP7TREG-DulomOrS.js → chunk-SVP7TREG-DljApgRX.js} +1 -1
- ksadk/studio/static/assets/{chunk-TICWLB2K-bHJYoflj.js → chunk-TICWLB2K-DWqRtyqa.js} +6 -6
- ksadk/studio/static/assets/chunk-TLUHSLCS-DUeGgnD5.js +2 -0
- ksadk/studio/static/assets/chunk-UY3FDG6J-CnmaAkG5.js +1 -0
- ksadk/studio/static/assets/chunk-XHIXRSVI-BFQ6B8BE.js +1 -0
- ksadk/studio/static/assets/chunk-XXDRQBXY-DqAYeljN.js +1 -0
- ksadk/studio/static/assets/classDiagram-ZZMXUADV-DjeMNJmu.js +1 -0
- ksadk/studio/static/assets/classDiagram-v2-VYDZK3BY-DjeMNJmu.js +1 -0
- ksadk/studio/static/assets/clsx-DB0hHKMi.js +1 -0
- ksadk/studio/static/assets/cose-bilkent-JH36ORCC-om8AY0Mc.js +1 -0
- ksadk/studio/static/assets/createLucideIcon-DR0LGTP5.js +1 -0
- ksadk/studio/static/assets/cynefin-OW5HDTMX-7tP7QfM3.js +1 -0
- ksadk/studio/static/assets/cynefinDiagram-5FMLGOSQ-6BrmK52S.js +62 -0
- ksadk/studio/static/assets/dagre-GXQ25YYZ-buZBRlwz.js +4 -0
- ksadk/studio/static/assets/{diagram-S7CK7UJ4-0BZ98mya.js → diagram-S7CK7UJ4-C6aH78c4.js} +3 -3
- ksadk/studio/static/assets/diagram-UQ7AKVKN-DY_tQ6C_.js +41 -0
- ksadk/studio/static/assets/diagram-VSXAHHWV-DX9p5cQT.js +3 -0
- ksadk/studio/static/assets/diagram-VX7I27RA-DB2WSH8X.js +24 -0
- ksadk/studio/static/assets/diagram-Z3DM3KII-Ce1BJwHE.js +24 -0
- ksadk/studio/static/assets/ebnfDiagram-PWID7BFC-Daukxwqf.js +1 -0
- ksadk/studio/static/assets/{erDiagram-RLTQ6QDP-DLGry2Ap.js → erDiagram-RLTQ6QDP-CGthTMmJ.js} +6 -6
- ksadk/studio/static/assets/eventmodeling-NTZA5JFV-BR2FzK4R.js +1 -0
- ksadk/studio/static/assets/flowDiagram-HODETNUW-CZ1tEenp.js +1 -0
- ksadk/studio/static/assets/ganttDiagram-EL5Y4UJY-BfoAZW9X.js +292 -0
- ksadk/studio/static/assets/gitGraph-4MIJSDKK-DYlXv_yJ.js +1 -0
- ksadk/studio/static/assets/gitGraphDiagram-WWUBYQGX-S985OIJF.js +106 -0
- ksadk/studio/static/assets/iconfont-4HN3C9Pg.woff2 +0 -0
- ksadk/studio/static/assets/index-CfEnms6Y.css +2 -0
- ksadk/studio/static/assets/index-Dp61rOWZ.js +0 -0
- ksadk/studio/static/assets/index.dom-BQenBtFm.js +1 -0
- ksadk/studio/static/assets/info-A6RAGUB7-BlU-8_xu.js +1 -0
- ksadk/studio/static/assets/infoDiagram-27XIBGKW-CO3W8tFn.js +2 -0
- ksadk/studio/static/assets/{ishikawaDiagram-5VMMS53U-CljI2wyf.js → ishikawaDiagram-5VMMS53U-BUGEl8cO.js} +2 -2
- ksadk/studio/static/assets/{journeyDiagram-3NMN7TZE-D50Fo2sL.js → journeyDiagram-3NMN7TZE-Ch2ZYxvr.js} +6 -6
- ksadk/studio/static/assets/{kanban-definition-UXKFOSKX-DimfOTam.js → kanban-definition-UXKFOSKX-Da-Fp4vC.js} +3 -3
- ksadk/studio/static/assets/kingsoft-cloud-BOcLiQ3e.ico +0 -0
- ksadk/studio/static/assets/{line-CX5BOOUP.js → line-BDaeq300.js} +1 -1
- ksadk/studio/static/assets/linear-DmucvK78.js +1 -0
- ksadk/studio/static/assets/mermaid-parser.core-Cj5mYdBi.js +4 -0
- ksadk/studio/static/assets/{mindmap-definition-YA3MSWOX-Bizzqy5R.js → mindmap-definition-YA3MSWOX-CvlsVQ38.js} +1 -1
- ksadk/studio/static/assets/packet-AYTQ26CC-BSJEH9Lb.js +1 -0
- ksadk/studio/static/assets/pegDiagram-XKGWAZYB-BuHuNgT5.js +1 -0
- ksadk/studio/static/assets/pie-WAS4IAKB-qxv01Y8W.js +1 -0
- ksadk/studio/static/assets/{pieDiagram-E7YTZNPT-B9mrFSDF.js → pieDiagram-E7YTZNPT-DlrWiSOv.js} +1 -1
- ksadk/studio/static/assets/preload-helper-CO68xz6u.js +1 -0
- ksadk/studio/static/assets/presentation-yYw7xK60-BmcZriri.js +1 -0
- ksadk/studio/static/assets/{quadrantDiagram-AXDQQJYC-NzUfCbMR.js → quadrantDiagram-AXDQQJYC-BA3hpUZM.js} +6 -6
- ksadk/studio/static/assets/radar-RG4KPBEZ-B6h6pWOs.js +1 -0
- ksadk/studio/static/assets/railroad-74A4TZTK-CGtTWdGc.js +1 -0
- ksadk/studio/static/assets/railroad-abnf-HS5TGJTU-Cq7y22IA.js +1 -0
- ksadk/studio/static/assets/railroad-ebnf-LZEXJU2U-V0aQVv9m.js +1 -0
- ksadk/studio/static/assets/railroad-peg-WCYAUIDC-BQiIsX_p.js +1 -0
- ksadk/studio/static/assets/railroadDiagram-O6MQD6OU-BxpAazym.js +1 -0
- ksadk/studio/static/assets/{requirementDiagram-BXWQKSXE-BF3d103U.js → requirementDiagram-BXWQKSXE-E-Ge0FcV.js} +1 -1
- ksadk/studio/static/assets/sankeyDiagram-P5KCCOFB-CA6YKhQ3.js +40 -0
- ksadk/studio/static/assets/{sequenceDiagram-WJ2MYXX4-Dh4wZtUm.js → sequenceDiagram-WJ2MYXX4-CcElXGg4.js} +9 -9
- ksadk/studio/static/assets/src-B6xuSHsQ.js +1 -0
- ksadk/studio/static/assets/stateDiagram-D77RDMKH-DdXZOFqY.js +1 -0
- ksadk/studio/static/assets/stateDiagram-v2-MP3YSRHH-CJbOM-QK.js +1 -0
- ksadk/studio/static/assets/swimlanes-42K2YHIH-NtgEEHLY.js +1 -0
- ksadk/studio/static/assets/swimlanesDiagram-VR7AAH4N-D-AVlW8B.js +8 -0
- ksadk/studio/static/assets/{timeline-definition-24CTP7MA-DxmSSjRB.js → timeline-definition-24CTP7MA-CIuYhNy3.js} +7 -7
- ksadk/studio/static/assets/treeView-Q6P3EWNA-BTTYcvrF.js +1 -0
- ksadk/studio/static/assets/treemap-WGGIJYW6-Cg7tyfH8.js +1 -0
- ksadk/studio/static/assets/vennDiagram-4TSXK5OY-7HbApbrv.js +34 -0
- ksadk/studio/static/assets/wardley-WFR3VGLG-C6N1rULY.js +1 -0
- ksadk/studio/static/assets/{wardleyDiagram-VM6X3IG4-Ba1AOWoe.js → wardleyDiagram-VM6X3IG4-CMJiaedy.js} +1 -1
- ksadk/studio/static/assets/{xychartDiagram-S5SC5T6Z-Cr5pt5Y-.js → xychartDiagram-S5SC5T6Z-BdgtMvW2.js} +6 -6
- ksadk/studio/static/index.html +8 -2
- ksadk/studio/teams_catalog.py +133 -0
- ksadk/studio/teams_installation.py +214 -0
- ksadk/studio/teams_node.py +545 -0
- ksadk/studio/teams_node_runner.py +69 -0
- ksadk/studio/teams_remote.py +274 -0
- ksadk/studio/templates.py +40 -19
- ksadk/studio/validator.py +13 -0
- ksadk/studio/workspace.py +19 -4
- ksadk/studio/workspace_plugins.py +136 -0
- ksadk/studio/workspace_registry.py +286 -0
- ksadk/toolsets/__init__.py +11 -0
- ksadk/toolsets/skills.py +446 -378
- ksadk/toolsets/workspace.py +3 -3
- ksadk/toolsets/workspace_identity.py +15 -0
- ksadk/version.py +1 -1
- ksadk_runtime_common/memory_backend/providers/lancedb.py +56 -2
- ksadk_runtime_common/schemas/memory_backend_manifest.schema.json +148 -148
- ksadk_runtime_common/workspace_files/router.py +26 -13
- ksadk/server/static/assets/MathMessageMarkdown-DbdW5A4_.js +0 -8
- ksadk/server/static/assets/architecture-7GRP2DOG-BW5UtSnx.js +0 -1
- ksadk/server/static/assets/channel-CF5Up3hQ.js +0 -1
- ksadk/server/static/assets/chunk-2Q5K7J3B-KkXX47WI.js +0 -1
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-Cz81acRQ.js +0 -1
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-Cz81acRQ.js +0 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-DVWs8a2t.js +0 -1
- ksadk/server/static/assets/dist-B2_CVgKv.js +0 -1
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-CQqR2hg3.js +0 -1
- ksadk/server/static/assets/flowDiagram-A5DVABFB-DDRRbGPm.js +0 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-fgWEf7UD.js +0 -1
- ksadk/server/static/assets/index-DcTML1Up.css +0 -2
- ksadk/server/static/assets/index-Dh2XHqPK.js +0 -244
- ksadk/server/static/assets/info-A6RAGUB7-BUecLTdt.js +0 -1
- ksadk/server/static/assets/packet-AYTQ26CC-BeW-btFv.js +0 -1
- ksadk/server/static/assets/pie-WAS4IAKB-X0xh4SaT.js +0 -1
- ksadk/server/static/assets/radar-RG4KPBEZ-DzRMSqjd.js +0 -1
- ksadk/server/static/assets/railroad-74A4TZTK-Cc44icX-.js +0 -1
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-D6S4BdV-.js +0 -1
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-vD3aVE2o.js +0 -1
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-CYbW_b4T.js +0 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-BIcjKFhF.js +0 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-tq3K3Ybl.js +0 -8
- ksadk/server/static/assets/treeView-Q6P3EWNA-DBXt3GdU.js +0 -1
- ksadk/server/static/assets/treemap-WGGIJYW6-DrCy4E_l.js +0 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-CefhOliM.js +0 -1
- ksadk/studio/static/assets/CodeBlock-DCUUY0PL-BLjA7kbS.js +0 -41
- ksadk/studio/static/assets/MathMessageMarkdown-CBcDrAw--CUYIXwgI.js +0 -8
- ksadk/studio/static/assets/MermaidBlock-DBFTztfQ-BTYKWEbD.js +0 -44
- ksadk/studio/static/assets/PrismRenderer-wiXRHURw.js +0 -3
- ksadk/studio/static/assets/abnfDiagram-VCTEODGH-CLETGjKq.js +0 -1
- ksadk/studio/static/assets/architecture-7GRP2DOG-hXMiO_AU.js +0 -1
- ksadk/studio/static/assets/architectureDiagram-5GKGNRK7-B5EQysk6.js +0 -36
- ksadk/studio/static/assets/channel-BqO-gtEw.js +0 -1
- ksadk/studio/static/assets/chunk-75Z2AOVW-C8lLv_qc.js +0 -2
- ksadk/studio/static/assets/chunk-F27PBJKO-Cpw14SNG.js +0 -1
- ksadk/studio/static/assets/chunk-GVQU2GXP-DUdNBUCi.js +0 -1
- ksadk/studio/static/assets/chunk-L3NEJ4N5-Db8Ab22W.js +0 -1
- ksadk/studio/static/assets/chunk-POPQ4Y6H-DOpufJ3t.js +0 -1
- ksadk/studio/static/assets/chunk-PWAF6VOD-CfLb1gSc.js +0 -1
- ksadk/studio/static/assets/chunk-XXDRQBXY-7PcdR2B1.js +0 -1
- ksadk/studio/static/assets/classDiagram-ZZMXUADV-D_bW8JjA.js +0 -1
- ksadk/studio/static/assets/classDiagram-v2-VYDZK3BY-D_bW8JjA.js +0 -1
- ksadk/studio/static/assets/cose-bilkent-JH36ORCC-snL88wkX.js +0 -1
- ksadk/studio/static/assets/cynefin-OW5HDTMX-Bd1YhRo1.js +0 -1
- ksadk/studio/static/assets/cynefinDiagram-5FMLGOSQ-BBrIG_mI.js +0 -62
- ksadk/studio/static/assets/dagre-GXQ25YYZ-DtF1nGdY.js +0 -4
- ksadk/studio/static/assets/diagram-UQ7AKVKN-6mLKEo6L.js +0 -41
- ksadk/studio/static/assets/diagram-VSXAHHWV-CJBIaiZ2.js +0 -3
- ksadk/studio/static/assets/diagram-VX7I27RA-BohLEE1C.js +0 -24
- ksadk/studio/static/assets/diagram-Z3DM3KII-D8KIGonG.js +0 -24
- ksadk/studio/static/assets/ebnfDiagram-PWID7BFC-C99HU61t.js +0 -1
- ksadk/studio/static/assets/eventmodeling-NTZA5JFV-B1_5Ac8j.js +0 -1
- ksadk/studio/static/assets/flowDiagram-HODETNUW-DD5hmicn.js +0 -1
- ksadk/studio/static/assets/ganttDiagram-EL5Y4UJY-BPJrVLSG.js +0 -292
- ksadk/studio/static/assets/gitGraph-4MIJSDKK-Cy_ZQBGi.js +0 -1
- ksadk/studio/static/assets/gitGraphDiagram-WWUBYQGX-CZCUz4MT.js +0 -106
- ksadk/studio/static/assets/index-CeHL9ARV.css +0 -2
- ksadk/studio/static/assets/index-D9QEcVpL.js +0 -320
- ksadk/studio/static/assets/info-A6RAGUB7-DBzDQB_I.js +0 -1
- ksadk/studio/static/assets/infoDiagram-27XIBGKW-B-sq07Hi.js +0 -2
- ksadk/studio/static/assets/linear-BCxN9JLv.js +0 -1
- ksadk/studio/static/assets/mermaid-parser.core-BdCz8fkS.js +0 -7
- ksadk/studio/static/assets/packet-AYTQ26CC-gPln-_kG.js +0 -1
- ksadk/studio/static/assets/pegDiagram-XKGWAZYB-Dy3fB-gW.js +0 -1
- ksadk/studio/static/assets/pie-WAS4IAKB-qZdHMr7B.js +0 -1
- ksadk/studio/static/assets/radar-RG4KPBEZ-BZlnaea9.js +0 -1
- ksadk/studio/static/assets/railroad-74A4TZTK-Ce3__H9c.js +0 -1
- ksadk/studio/static/assets/railroad-abnf-HS5TGJTU-DqQn7EzD.js +0 -1
- ksadk/studio/static/assets/railroad-ebnf-LZEXJU2U-B55kCA8F.js +0 -1
- ksadk/studio/static/assets/railroad-peg-WCYAUIDC-DfQnvkHd.js +0 -1
- ksadk/studio/static/assets/railroadDiagram-O6MQD6OU-DnhMjZCk.js +0 -1
- ksadk/studio/static/assets/sankeyDiagram-P5KCCOFB-Bo-JTwt0.js +0 -40
- ksadk/studio/static/assets/src-SFn9St9H.js +0 -1
- ksadk/studio/static/assets/stateDiagram-D77RDMKH-DH774G6d.js +0 -1
- ksadk/studio/static/assets/stateDiagram-v2-MP3YSRHH-DZvVWPBo.js +0 -1
- ksadk/studio/static/assets/swimlanes-42K2YHIH-Bl13OvTX.js +0 -1
- ksadk/studio/static/assets/swimlanesDiagram-VR7AAH4N-BnFOTALJ.js +0 -8
- ksadk/studio/static/assets/treeView-Q6P3EWNA-D5Nn9Swz.js +0 -1
- ksadk/studio/static/assets/treemap-WGGIJYW6-CgHgnQhE.js +0 -1
- ksadk/studio/static/assets/vennDiagram-4TSXK5OY-B9QEXcJq.js +0 -34
- ksadk/studio/static/assets/wardley-WFR3VGLG-DXrK2RRY.js +0 -1
- {agentengine_sdk_python-0.8.4.dist-info → agentengine_sdk_python-0.8.5.dist-info}/WHEEL +0 -0
- {agentengine_sdk_python-0.8.4.dist-info → agentengine_sdk_python-0.8.5.dist-info}/entry_points.txt +0 -0
- {agentengine_sdk_python-0.8.4.dist-info → agentengine_sdk_python-0.8.5.dist-info}/licenses/LICENSE +0 -0
- {agentengine_sdk_python-0.8.4.dist-info → agentengine_sdk_python-0.8.5.dist-info}/top_level.txt +0 -0
- /ksadk/studio/static/assets/{MathMessageMarkdown-CBcDrAw--BEOyPC3w.css → MathMessageMarkdown-BesSeCYl-BEOyPC3w.css} +0 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"""Frozen inputs and per-attempt working trees inside an execution node.
|
|
2
|
+
|
|
3
|
+
The authority stores an intent only. This module resolves filesystem paths on
|
|
4
|
+
the actual execution node, within roots explicitly granted by its owner.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import hashlib
|
|
10
|
+
import json
|
|
11
|
+
import os
|
|
12
|
+
import re
|
|
13
|
+
import subprocess
|
|
14
|
+
from collections.abc import Sequence
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
from .artifacts import read_workspace_artifact
|
|
18
|
+
from .errors import TeamsError
|
|
19
|
+
from .store import digest, encode
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def validate_workspace_plan(plan: dict | None, *, require_pinned_git: bool = False) -> None:
|
|
23
|
+
if (
|
|
24
|
+
plan
|
|
25
|
+
and require_pinned_git
|
|
26
|
+
and plan.get("mode", "auto") != "directory"
|
|
27
|
+
and not re.fullmatch(r"(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})", str(plan.get("baseRef") or ""))
|
|
28
|
+
):
|
|
29
|
+
raise TeamsError(
|
|
30
|
+
"workspace_commit_required",
|
|
31
|
+
"服务端 Git 任务需要完整提交哈希;非 Git 文件请选择目录模式",
|
|
32
|
+
status=422,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _component(value: str) -> str:
|
|
37
|
+
if re.fullmatch(r"[a-zA-Z0-9_-]{1,160}", value):
|
|
38
|
+
return value
|
|
39
|
+
return hashlib.sha256(value.encode()).hexdigest()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _git(source: Path, *arguments: str, required: bool = True) -> str | None:
|
|
43
|
+
try:
|
|
44
|
+
result = subprocess.run(
|
|
45
|
+
["git", "-c", "core.hooksPath=/dev/null", "-C", str(source), *arguments],
|
|
46
|
+
capture_output=True,
|
|
47
|
+
text=True,
|
|
48
|
+
timeout=30,
|
|
49
|
+
check=False,
|
|
50
|
+
env={**os.environ, "GIT_TERMINAL_PROMPT": "0"},
|
|
51
|
+
)
|
|
52
|
+
except (OSError, subprocess.TimeoutExpired) as error:
|
|
53
|
+
raise TeamsError(
|
|
54
|
+
"workspace_git_unavailable", "Git 工作区准备失败,请检查节点环境", status=422
|
|
55
|
+
) from error
|
|
56
|
+
if result.returncode:
|
|
57
|
+
if not required:
|
|
58
|
+
return None
|
|
59
|
+
raise TeamsError(
|
|
60
|
+
"workspace_git_failed", "无法准备所选 Git 基线,请检查提交与仓库", status=422
|
|
61
|
+
)
|
|
62
|
+
return result.stdout.strip()
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _relative_input(value: str) -> Path:
|
|
66
|
+
path = Path(value)
|
|
67
|
+
if (
|
|
68
|
+
not path.parts
|
|
69
|
+
or path.is_absolute()
|
|
70
|
+
or ".." in path.parts
|
|
71
|
+
or ".git" in path.parts
|
|
72
|
+
or "\x00" in value
|
|
73
|
+
):
|
|
74
|
+
raise TeamsError(
|
|
75
|
+
"workspace_input_forbidden", "输入必须是源目录内的普通相对文件", status=422
|
|
76
|
+
)
|
|
77
|
+
return path
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _mkdir(path: Path, root: Path) -> None:
|
|
81
|
+
relative = path.relative_to(root)
|
|
82
|
+
current = root
|
|
83
|
+
for part in relative.parts:
|
|
84
|
+
current = current / part
|
|
85
|
+
if current.is_symlink():
|
|
86
|
+
raise TeamsError("workspace_path_forbidden", "工作区路径不能包含符号链接", status=403)
|
|
87
|
+
current.mkdir(exist_ok=True)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def prepare_workspace(
|
|
91
|
+
output_root: Path,
|
|
92
|
+
*,
|
|
93
|
+
group_id: str,
|
|
94
|
+
team_run_id: str,
|
|
95
|
+
member_id: str,
|
|
96
|
+
attempt_id: str,
|
|
97
|
+
plan: dict | None,
|
|
98
|
+
allowed_roots: Sequence[Path],
|
|
99
|
+
require_pinned_git: bool = False,
|
|
100
|
+
) -> Path:
|
|
101
|
+
"""Return the real cwd; each run resolves its baseline exactly once per node.
|
|
102
|
+
|
|
103
|
+
Git HEAD/ref includes committed content. Explicit input files are frozen
|
|
104
|
+
separately, allowing a user to intentionally supply an untracked file.
|
|
105
|
+
Existing attempt directories are reused without resetting their changes.
|
|
106
|
+
"""
|
|
107
|
+
validate_workspace_plan(plan, require_pinned_git=require_pinned_git)
|
|
108
|
+
output_root = output_root.resolve()
|
|
109
|
+
output_root.mkdir(parents=True, exist_ok=True)
|
|
110
|
+
run_root = output_root / _component(group_id) / _component(team_run_id)
|
|
111
|
+
target = run_root / _component(member_id) / _component(attempt_id)
|
|
112
|
+
_mkdir(target.parent, output_root)
|
|
113
|
+
if not plan:
|
|
114
|
+
_mkdir(target, output_root)
|
|
115
|
+
return target
|
|
116
|
+
source = Path(plan["sourcePath"]).expanduser().resolve()
|
|
117
|
+
if not any(source.is_relative_to(Path(root).resolve()) for root in allowed_roots):
|
|
118
|
+
raise TeamsError(
|
|
119
|
+
"workspace_source_forbidden", "所选目录不在该执行节点允许的工作目录内", status=403
|
|
120
|
+
)
|
|
121
|
+
if not source.is_dir():
|
|
122
|
+
raise TeamsError("workspace_source_missing", "所选源目录在执行节点上不存在", status=422)
|
|
123
|
+
# A filesystem lock coordinates simultaneous members and multiple node
|
|
124
|
+
# workers. Keep the lock file outside their writable attempt directories.
|
|
125
|
+
try:
|
|
126
|
+
import fcntl
|
|
127
|
+
except ImportError as error:
|
|
128
|
+
raise TeamsError(
|
|
129
|
+
"workspace_platform_unsupported", "当前节点不支持隔离工作区锁", status=422
|
|
130
|
+
) from error
|
|
131
|
+
lock = run_root / ".workspace.lock"
|
|
132
|
+
fd = os.open(lock, os.O_CREAT | os.O_RDWR | os.O_NOFOLLOW, 0o600)
|
|
133
|
+
try:
|
|
134
|
+
try:
|
|
135
|
+
fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
|
136
|
+
except BlockingIOError as error:
|
|
137
|
+
raise TeamsError(
|
|
138
|
+
"workspace_busy", "任务基线正在由另一个执行准备,请稍后重试", status=409
|
|
139
|
+
) from error
|
|
140
|
+
manifest_path = run_root / ".workspace.json"
|
|
141
|
+
if manifest_path.is_symlink():
|
|
142
|
+
raise TeamsError("workspace_manifest_invalid", "任务基线文件不可用", status=409)
|
|
143
|
+
plan_digest = digest(plan)
|
|
144
|
+
if manifest_path.exists():
|
|
145
|
+
manifest = json.loads(manifest_path.read_text())
|
|
146
|
+
if manifest["planDigest"] != plan_digest:
|
|
147
|
+
raise TeamsError(
|
|
148
|
+
"workspace_plan_changed", "任务基线已经冻结,不能在执行中修改", status=409
|
|
149
|
+
)
|
|
150
|
+
else:
|
|
151
|
+
git_root = None
|
|
152
|
+
if plan.get("mode", "auto") == "auto":
|
|
153
|
+
git_root = _git(source, "rev-parse", "--show-toplevel", required=False)
|
|
154
|
+
if git_root:
|
|
155
|
+
repository = Path(git_root).resolve()
|
|
156
|
+
if not any(
|
|
157
|
+
repository.is_relative_to(Path(root).resolve()) for root in allowed_roots
|
|
158
|
+
):
|
|
159
|
+
raise TeamsError(
|
|
160
|
+
"workspace_source_forbidden", "Git 仓库根目录超出节点授权范围", status=403
|
|
161
|
+
)
|
|
162
|
+
commit = _git(
|
|
163
|
+
repository,
|
|
164
|
+
"rev-parse",
|
|
165
|
+
"--verify",
|
|
166
|
+
"--end-of-options",
|
|
167
|
+
str(plan.get("baseRef") or "HEAD") + "^{commit}",
|
|
168
|
+
)
|
|
169
|
+
if require_pinned_git and commit.lower() != plan["baseRef"].lower():
|
|
170
|
+
raise TeamsError(
|
|
171
|
+
"workspace_commit_mismatch", "节点仓库与任务冻结提交不一致", status=409
|
|
172
|
+
)
|
|
173
|
+
else:
|
|
174
|
+
repository, commit = None, None
|
|
175
|
+
if plan.get("baseRef"):
|
|
176
|
+
raise TeamsError(
|
|
177
|
+
"workspace_base_ref_invalid", "只有 Git 工作区可以选择提交基线", status=422
|
|
178
|
+
)
|
|
179
|
+
manifest = {
|
|
180
|
+
"planDigest": plan_digest,
|
|
181
|
+
"sourcePath": str(source),
|
|
182
|
+
"repository": str(repository) if repository else None,
|
|
183
|
+
"commit": commit,
|
|
184
|
+
"inputs": {},
|
|
185
|
+
}
|
|
186
|
+
frozen = run_root / ".inputs"
|
|
187
|
+
_mkdir(frozen, output_root)
|
|
188
|
+
total = 0
|
|
189
|
+
# Validate all files before publishing the run baseline.
|
|
190
|
+
supplied = []
|
|
191
|
+
for value in dict.fromkeys(plan.get("inputs", [])):
|
|
192
|
+
relative = _relative_input(value)
|
|
193
|
+
_, content = read_workspace_artifact(source, str(relative))
|
|
194
|
+
total += len(content)
|
|
195
|
+
if total > 64 * 1024 * 1024:
|
|
196
|
+
raise TeamsError(
|
|
197
|
+
"workspace_inputs_too_large", "单任务输入文件总计不能超过64MiB", status=422
|
|
198
|
+
)
|
|
199
|
+
supplied.append((relative, content))
|
|
200
|
+
for relative, content in supplied:
|
|
201
|
+
input_target = frozen / relative
|
|
202
|
+
_mkdir(input_target.parent, output_root)
|
|
203
|
+
if input_target.is_symlink():
|
|
204
|
+
raise TeamsError(
|
|
205
|
+
"workspace_input_forbidden", "输入快照不能包含符号链接", status=403
|
|
206
|
+
)
|
|
207
|
+
input_target.write_bytes(content)
|
|
208
|
+
manifest["inputs"][str(relative)] = hashlib.sha256(content).hexdigest()
|
|
209
|
+
temporary = manifest_path.with_suffix(".tmp")
|
|
210
|
+
with temporary.open("w", encoding="utf-8") as stream:
|
|
211
|
+
stream.write(encode(manifest))
|
|
212
|
+
temporary.replace(manifest_path)
|
|
213
|
+
marker = target.parent / (target.name + ".prepared.json")
|
|
214
|
+
if marker.exists():
|
|
215
|
+
if (
|
|
216
|
+
marker.is_symlink()
|
|
217
|
+
or json.loads(marker.read_text()).get("planDigest") != plan_digest
|
|
218
|
+
):
|
|
219
|
+
raise TeamsError("workspace_manifest_invalid", "执行工作区标识不一致", status=409)
|
|
220
|
+
if target.is_symlink() or not target.is_dir():
|
|
221
|
+
raise TeamsError("workspace_path_forbidden", "执行工作区不可用", status=409)
|
|
222
|
+
return target
|
|
223
|
+
if target.exists():
|
|
224
|
+
# Never reset or delete partially prepared / user-edited files.
|
|
225
|
+
raise TeamsError(
|
|
226
|
+
"workspace_preparation_incomplete",
|
|
227
|
+
"工作区准备未完成,请检查该次尝试的目录后重试",
|
|
228
|
+
status=409,
|
|
229
|
+
)
|
|
230
|
+
if manifest["repository"]:
|
|
231
|
+
_git(
|
|
232
|
+
Path(manifest["repository"]),
|
|
233
|
+
"worktree",
|
|
234
|
+
"add",
|
|
235
|
+
"--detach",
|
|
236
|
+
str(target),
|
|
237
|
+
manifest["commit"],
|
|
238
|
+
)
|
|
239
|
+
else:
|
|
240
|
+
_mkdir(target, output_root)
|
|
241
|
+
for value, checksum in manifest["inputs"].items():
|
|
242
|
+
relative = _relative_input(value)
|
|
243
|
+
_, content = read_workspace_artifact(run_root / ".inputs", value)
|
|
244
|
+
if hashlib.sha256(content).hexdigest() != checksum:
|
|
245
|
+
raise TeamsError("workspace_input_changed", "冻结输入文件摘要已改变", status=409)
|
|
246
|
+
destination = target / relative
|
|
247
|
+
_mkdir(destination.parent, output_root)
|
|
248
|
+
if destination.is_symlink():
|
|
249
|
+
raise TeamsError("workspace_input_forbidden", "输入目标不能是符号链接", status=403)
|
|
250
|
+
destination.write_bytes(content)
|
|
251
|
+
with marker.open("x", encoding="utf-8") as stream:
|
|
252
|
+
stream.write(encode({"planDigest": plan_digest, "commit": manifest["commit"]}))
|
|
253
|
+
return target
|
|
254
|
+
finally:
|
|
255
|
+
os.close(fd)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import logging
|
|
9
9
|
import time
|
|
10
10
|
import uuid
|
|
11
11
|
from typing import TYPE_CHECKING, Any, AsyncIterator, Dict, Mapping
|
|
@@ -15,6 +15,10 @@ from langgraph.types import Command
|
|
|
15
15
|
from ksadk.conversations.reasoning_markup import ReasoningMarkupParser, strip_reasoning_markup
|
|
16
16
|
from ksadk.events.runtime_event import RuntimeEvent
|
|
17
17
|
from ksadk.runners.usage_accumulator import accumulate_usage
|
|
18
|
+
from ksadk.runtime.skill_eval_result import skill_eval_response_fields
|
|
19
|
+
from ksadk.runtime.timing import extract_timing
|
|
20
|
+
|
|
21
|
+
logger = logging.getLogger(__name__)
|
|
18
22
|
|
|
19
23
|
if TYPE_CHECKING:
|
|
20
24
|
pass
|
|
@@ -57,12 +61,13 @@ class _LangGraphStreamMixin:
|
|
|
57
61
|
invoke_payload["resume_payload_provided"] = resume_payload_provided
|
|
58
62
|
invoke_payload["resume_interrupt_id"] = resume_interrupt_id
|
|
59
63
|
|
|
60
|
-
config = self.
|
|
64
|
+
config = await self._get_session_config(session_id)
|
|
61
65
|
if is_checkpoint_resume:
|
|
62
66
|
config = self._apply_checkpoint_resume_config(
|
|
63
67
|
config,
|
|
64
68
|
session_id=session_id,
|
|
65
69
|
checkpoint_ref=checkpoint_ref,
|
|
70
|
+
enforce_bound_thread=bool(self._invocation_identity_scope_ref()),
|
|
66
71
|
)
|
|
67
72
|
|
|
68
73
|
if is_checkpoint_resume:
|
|
@@ -86,6 +91,8 @@ class _LangGraphStreamMixin:
|
|
|
86
91
|
inline_reasoning_parser = ReasoningMarkupParser()
|
|
87
92
|
emitted_non_text_event = False
|
|
88
93
|
final_output_text = ""
|
|
94
|
+
final_output_timing: dict[str, Any] = {}
|
|
95
|
+
final_result_fields: dict[str, Any] = {}
|
|
89
96
|
final_output_usage: dict[str, Any] = {}
|
|
90
97
|
final_output_last_usage: dict[str, Any] = {}
|
|
91
98
|
model_run_usages: dict[str, dict[str, Any]] = {}
|
|
@@ -96,6 +103,7 @@ class _LangGraphStreamMixin:
|
|
|
96
103
|
model_step_indexes: dict[str, int] = {}
|
|
97
104
|
first_token_seen: set[str] = set()
|
|
98
105
|
next_step_index = 0
|
|
106
|
+
internal_model_runs: set[str] = set()
|
|
99
107
|
|
|
100
108
|
def model_run_key(
|
|
101
109
|
event: Mapping[str, Any],
|
|
@@ -168,6 +176,8 @@ class _LangGraphStreamMixin:
|
|
|
168
176
|
last_usage = self._extract_last_usage(result)
|
|
169
177
|
if last_usage:
|
|
170
178
|
final_chunk.setdefault("metadata", {})["last_usage"] = last_usage
|
|
179
|
+
if timing := extract_timing(result):
|
|
180
|
+
final_chunk["timing"] = timing
|
|
171
181
|
yield final_chunk
|
|
172
182
|
return
|
|
173
183
|
|
|
@@ -195,6 +205,19 @@ class _LangGraphStreamMixin:
|
|
|
195
205
|
async for event in self._agent.astream_events(stream_input, **stream_kwargs):
|
|
196
206
|
event_kind = event.get("event", "")
|
|
197
207
|
|
|
208
|
+
# This metadata is scoped to a model call, not the whole graph.
|
|
209
|
+
# Remember it because subsequent chunks may omit metadata.
|
|
210
|
+
event_run_id = str(event.get("run_id") or "")
|
|
211
|
+
event_metadata = event.get("metadata") or {}
|
|
212
|
+
internal_output = (
|
|
213
|
+
isinstance(event_metadata, Mapping)
|
|
214
|
+
and event_metadata.get("ksadk_output_visibility") == "internal"
|
|
215
|
+
)
|
|
216
|
+
if event_kind.startswith("on_chat_model_"):
|
|
217
|
+
if internal_output and event_run_id:
|
|
218
|
+
internal_model_runs.add(event_run_id)
|
|
219
|
+
internal_output = internal_output or event_run_id in internal_model_runs
|
|
220
|
+
|
|
198
221
|
if event_kind == "on_chat_model_start":
|
|
199
222
|
model_call_id = str(event.get("run_id") or "")
|
|
200
223
|
if model_call_id:
|
|
@@ -219,15 +242,10 @@ class _LangGraphStreamMixin:
|
|
|
219
242
|
if not chunk:
|
|
220
243
|
continue
|
|
221
244
|
model_call_id = str(event.get("run_id") or "")
|
|
222
|
-
if
|
|
223
|
-
model_call_id in model_started_at
|
|
224
|
-
and model_call_id not in first_token_seen
|
|
225
|
-
):
|
|
245
|
+
if model_call_id in model_started_at and model_call_id not in first_token_seen:
|
|
226
246
|
reasoning_content = getattr(chunk, "reasoning_content", None)
|
|
227
247
|
if not reasoning_content and hasattr(chunk, "additional_kwargs"):
|
|
228
|
-
reasoning_content = chunk.additional_kwargs.get(
|
|
229
|
-
"reasoning_content"
|
|
230
|
-
)
|
|
248
|
+
reasoning_content = chunk.additional_kwargs.get("reasoning_content")
|
|
231
249
|
if getattr(chunk, "content", None) or reasoning_content:
|
|
232
250
|
first_token_seen.add(model_call_id)
|
|
233
251
|
yield {
|
|
@@ -235,8 +253,7 @@ class _LangGraphStreamMixin:
|
|
|
235
253
|
"step_id": f"step_{model_call_id}",
|
|
236
254
|
"model_call_id": model_call_id,
|
|
237
255
|
"ttft_ms": int(
|
|
238
|
-
(time.monotonic() - model_started_at[model_call_id])
|
|
239
|
-
* 1000
|
|
256
|
+
(time.monotonic() - model_started_at[model_call_id]) * 1000
|
|
240
257
|
),
|
|
241
258
|
}
|
|
242
259
|
chunk_usage = self._extract_usage(chunk)
|
|
@@ -253,6 +270,11 @@ class _LangGraphStreamMixin:
|
|
|
253
270
|
stream_usage_run_keys.add(run_key)
|
|
254
271
|
record_model_usage(event, latest_stream_usage)
|
|
255
272
|
|
|
273
|
+
# Collect usage/lifecycle above even for internal calls, but
|
|
274
|
+
# never feed their text into the shared reasoning parser.
|
|
275
|
+
if internal_output:
|
|
276
|
+
continue
|
|
277
|
+
|
|
256
278
|
# 推理内容
|
|
257
279
|
reasoning = getattr(chunk, "reasoning_content", None)
|
|
258
280
|
if not reasoning and hasattr(chunk, "additional_kwargs"):
|
|
@@ -392,26 +414,23 @@ class _LangGraphStreamMixin:
|
|
|
392
414
|
|
|
393
415
|
elif event_kind == "on_chain_end":
|
|
394
416
|
output = event.get("data", {}).get("output", {})
|
|
417
|
+
if not event.get("parent_ids"):
|
|
418
|
+
final_output_timing = extract_timing(output)
|
|
419
|
+
final_result_fields = skill_eval_response_fields(output)
|
|
395
420
|
if isinstance(output, dict) and "__interrupt__" in output:
|
|
396
421
|
emitted_non_text_event = True
|
|
397
422
|
# __interrupt__ 是 LangGraph 原始 Interrupt 对象列表,
|
|
398
423
|
# 直接 yield 会导致下游拿不到 tool_name/description(非 Mapping)。
|
|
399
424
|
# 用 _get_interrupt_info 从 state 提取结构化 interrupt_info,
|
|
400
425
|
# 与 406-412 的异常路径和 419-436 的 pending_approval 兜底一致。
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
)
|
|
406
|
-
|
|
407
|
-
_maybe_state = _get_state(config)
|
|
408
|
-
if inspect.isawaitable(_maybe_state):
|
|
409
|
-
_maybe_state = await _maybe_state
|
|
410
|
-
_interrupt_info = self._get_interrupt_info(_maybe_state)
|
|
411
|
-
except Exception:
|
|
412
|
-
_interrupt_info = {}
|
|
426
|
+
state, _error = await self._read_graph_state(
|
|
427
|
+
config, include_subgraphs=True
|
|
428
|
+
)
|
|
429
|
+
_interrupt_info = (
|
|
430
|
+
self._get_interrupt_info(state) if state is not None else {}
|
|
431
|
+
)
|
|
413
432
|
if not _interrupt_info:
|
|
414
|
-
#
|
|
433
|
+
# state 里读不到结构化信息时,退回原始 __interrupt__。
|
|
415
434
|
_interrupt_info = output["__interrupt__"]
|
|
416
435
|
yield {
|
|
417
436
|
"type": "interrupt",
|
|
@@ -427,9 +446,15 @@ class _LangGraphStreamMixin:
|
|
|
427
446
|
|
|
428
447
|
except Exception as e:
|
|
429
448
|
if "Interrupt" in type(e).__name__:
|
|
449
|
+
state, error = await self._read_graph_state(config, include_subgraphs=True)
|
|
450
|
+
if state is None:
|
|
451
|
+
# 图已经抛出 interrupt 但状态读不回来:显性失败,不返回空信息。
|
|
452
|
+
raise RuntimeError(
|
|
453
|
+
"graph interrupted but its checkpoint state could not be read"
|
|
454
|
+
) from error
|
|
430
455
|
yield {
|
|
431
456
|
"type": "interrupt",
|
|
432
|
-
"interrupt_info": self._get_interrupt_info(
|
|
457
|
+
"interrupt_info": self._get_interrupt_info(state),
|
|
433
458
|
"session_id": session_id,
|
|
434
459
|
}
|
|
435
460
|
return
|
|
@@ -437,20 +462,26 @@ class _LangGraphStreamMixin:
|
|
|
437
462
|
|
|
438
463
|
# goal-18(ksadk-web 人机交互):图因审批门(HITL)在流式中静默暂停时,
|
|
439
464
|
# 这里把审批详情(action_requests)作为 approval 事件冒出,供 UI 渲染审批卡。
|
|
440
|
-
#
|
|
441
|
-
#
|
|
465
|
+
# 失败语义(0.8.5 契约):interrupt 依赖 checkpointer——
|
|
466
|
+
# - 配了 checkpointer 的图(含内存版),状态读不出来必须显性失败——绝不能把
|
|
467
|
+
# "读不到"当成"没有待审批"继续走 completed(审批卡会无声消失)。
|
|
468
|
+
# - 没配 checkpointer 的图不可能有 interrupt,读不到属于正常情况。
|
|
442
469
|
pending_approval = None
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
470
|
+
state, error = await self._read_graph_state(config, include_subgraphs=True)
|
|
471
|
+
if state is None:
|
|
472
|
+
agent = getattr(self, "_agent", None)
|
|
473
|
+
has_checkpointer = (
|
|
474
|
+
getattr(agent, "checkpointer", None) is not None
|
|
475
|
+
or getattr(agent, "_checkpointer", None) is not None
|
|
446
476
|
)
|
|
447
|
-
if
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
477
|
+
if has_checkpointer:
|
|
478
|
+
raise RuntimeError(
|
|
479
|
+
"stream ended without a terminal event and the checkpoint "
|
|
480
|
+
"state could not be read; refusing to report the run as completed"
|
|
481
|
+
) from error
|
|
482
|
+
logger.debug("graph has no checkpointer; skipping pending-approval probe")
|
|
483
|
+
else:
|
|
484
|
+
pending_approval = self._get_interrupt_info(state)
|
|
454
485
|
if pending_approval:
|
|
455
486
|
yield {
|
|
456
487
|
"type": "approval",
|
|
@@ -474,7 +505,7 @@ class _LangGraphStreamMixin:
|
|
|
474
505
|
|
|
475
506
|
if not accumulated_text:
|
|
476
507
|
if final_output_text:
|
|
477
|
-
final_chunk = {"output": final_output_text, "type": "final"}
|
|
508
|
+
final_chunk = {"output": final_output_text, "type": "final", **final_result_fields}
|
|
478
509
|
usage = accumulated_model_usage() or final_output_usage or latest_stream_usage
|
|
479
510
|
last_usage = (
|
|
480
511
|
latest_model_usage() or final_output_last_usage or latest_stream_usage or usage
|
|
@@ -483,11 +514,14 @@ class _LangGraphStreamMixin:
|
|
|
483
514
|
final_chunk["usage"] = usage
|
|
484
515
|
if last_usage:
|
|
485
516
|
final_chunk.setdefault("metadata", {})["last_usage"] = last_usage
|
|
517
|
+
if final_output_timing:
|
|
518
|
+
final_chunk["timing"] = final_output_timing
|
|
486
519
|
yield final_chunk
|
|
487
520
|
elif not emitted_non_text_event:
|
|
488
521
|
result = await self.invoke({**invoke_payload, "_ksadk_force_graph_invoke": True})
|
|
489
522
|
fallback_chunk: dict[str, Any] = {
|
|
490
523
|
"output": result.get("output", ""),
|
|
524
|
+
**skill_eval_response_fields(result),
|
|
491
525
|
"type": "final",
|
|
492
526
|
}
|
|
493
527
|
usage = self._extract_usage(result)
|
|
@@ -496,13 +530,15 @@ class _LangGraphStreamMixin:
|
|
|
496
530
|
last_usage = self._extract_last_usage(result)
|
|
497
531
|
if last_usage:
|
|
498
532
|
fallback_chunk.setdefault("metadata", {})["last_usage"] = last_usage
|
|
533
|
+
if timing := extract_timing(result):
|
|
534
|
+
fallback_chunk["timing"] = timing
|
|
499
535
|
yield fallback_chunk
|
|
500
536
|
checkpoint_metadata = result.get("metadata") if isinstance(result, dict) else None
|
|
501
537
|
if isinstance(checkpoint_metadata, dict) and checkpoint_metadata.get("agentengine"):
|
|
502
538
|
yield {"type": "checkpoint", "metadata": checkpoint_metadata}
|
|
503
539
|
return
|
|
504
540
|
else:
|
|
505
|
-
final_chunk = {"output": accumulated_text, "type": "final"}
|
|
541
|
+
final_chunk = {"output": accumulated_text, "type": "final", **final_result_fields}
|
|
506
542
|
state_usage = await self._latest_state_usage(config)
|
|
507
543
|
usage = (
|
|
508
544
|
accumulated_model_usage()
|
|
@@ -520,6 +556,8 @@ class _LangGraphStreamMixin:
|
|
|
520
556
|
or usage
|
|
521
557
|
)
|
|
522
558
|
final_chunk.setdefault("metadata", {})["last_usage"] = last_usage
|
|
559
|
+
if final_output_timing:
|
|
560
|
+
final_chunk["timing"] = final_output_timing
|
|
523
561
|
yield final_chunk
|
|
524
562
|
|
|
525
563
|
metadata = await self._latest_checkpoint_metadata(config)
|
|
@@ -554,6 +592,7 @@ class _LangGraphStreamMixin:
|
|
|
554
592
|
RunInterrupted,
|
|
555
593
|
RunStarted,
|
|
556
594
|
SourceRef,
|
|
595
|
+
UsageReported,
|
|
557
596
|
)
|
|
558
597
|
from ksadk.events.identity import stable_event_id, stable_item_id, stable_scope_id
|
|
559
598
|
from ksadk.events.reducer import StreamReducer
|
|
@@ -581,12 +620,13 @@ class _LangGraphStreamMixin:
|
|
|
581
620
|
context_schema=getattr(self._agent, "context_schema", None),
|
|
582
621
|
)
|
|
583
622
|
|
|
584
|
-
config = self.
|
|
623
|
+
config = await self._get_session_config(session_id)
|
|
585
624
|
if is_checkpoint_resume:
|
|
586
625
|
config = self._apply_checkpoint_resume_config(
|
|
587
626
|
config,
|
|
588
627
|
session_id=session_id,
|
|
589
628
|
checkpoint_ref=checkpoint_ref,
|
|
629
|
+
enforce_bound_thread=bool(self._invocation_identity_scope_ref()),
|
|
590
630
|
)
|
|
591
631
|
|
|
592
632
|
# --- build state (same logic as stream()) ---
|
|
@@ -694,6 +734,8 @@ class _LangGraphStreamMixin:
|
|
|
694
734
|
)
|
|
695
735
|
adapter = LangGraphEventAdapter()
|
|
696
736
|
reducer = StreamReducer()
|
|
737
|
+
accumulated_usage: dict[str, Any] = {}
|
|
738
|
+
final_result_fields: dict[str, Any] = {}
|
|
697
739
|
|
|
698
740
|
# --- build stream kwargs (v3 rejects stream_mode/subgraphs) ---
|
|
699
741
|
stream_kwargs: dict[str, Any] = {"version": "v3", "config": config}
|
|
@@ -706,6 +748,18 @@ class _LangGraphStreamMixin:
|
|
|
706
748
|
try:
|
|
707
749
|
run_stream = await self._agent.astream_events(stream_input, **stream_kwargs)
|
|
708
750
|
async for event in adapter.stream_run(run_stream, adapter_context):
|
|
751
|
+
if isinstance(event, UsageReported):
|
|
752
|
+
accumulated_usage = accumulate_usage(
|
|
753
|
+
accumulated_usage,
|
|
754
|
+
{
|
|
755
|
+
"input_tokens": event.input_tokens,
|
|
756
|
+
"output_tokens": event.output_tokens,
|
|
757
|
+
"total_tokens": event.total_tokens,
|
|
758
|
+
"cached_tokens": event.cached_tokens,
|
|
759
|
+
"reasoning_tokens": event.reasoning_tokens,
|
|
760
|
+
},
|
|
761
|
+
)
|
|
762
|
+
event = event.model_copy(update=accumulated_usage)
|
|
709
763
|
if isinstance(event, RunInterrupted):
|
|
710
764
|
was_interrupted = True
|
|
711
765
|
# Extract checkpoint from graph state and emit
|
|
@@ -713,7 +767,9 @@ class _LangGraphStreamMixin:
|
|
|
713
767
|
# consumers (agui agent) can resolve the resumable
|
|
714
768
|
# checkpoint_id before processing the terminal interrupt.
|
|
715
769
|
try:
|
|
716
|
-
|
|
770
|
+
# 统一异步状态读取入口:managed 模式挂 AsyncPostgresSaver,
|
|
771
|
+
# 在事件循环里同步 get_state 会直接报错。
|
|
772
|
+
ckpt_state, ckpt_read_error = await self._read_graph_state(config)
|
|
717
773
|
ckpt_config = getattr(ckpt_state, "config", {}) or {}
|
|
718
774
|
ckpt_id = str(
|
|
719
775
|
(ckpt_config.get("configurable") or {}).get("checkpoint_id", "") or ""
|
|
@@ -766,7 +822,14 @@ class _LangGraphStreamMixin:
|
|
|
766
822
|
"thread_id", session_id
|
|
767
823
|
)
|
|
768
824
|
),
|
|
769
|
-
|
|
825
|
+
# 保留状态自报的真实寻址(子图 ns 带任务路径),
|
|
826
|
+
# 根 checkpoint 时为空串。恢复按原地址定位。
|
|
827
|
+
"checkpoint_ns": str(
|
|
828
|
+
(ckpt_config.get("configurable") or {}).get(
|
|
829
|
+
"checkpoint_ns", ""
|
|
830
|
+
)
|
|
831
|
+
or ""
|
|
832
|
+
),
|
|
770
833
|
"checkpoint_id": ckpt_id,
|
|
771
834
|
**({"next_node": ckpt_next_node} if ckpt_next_node else {}),
|
|
772
835
|
}
|
|
@@ -806,8 +869,15 @@ class _LangGraphStreamMixin:
|
|
|
806
869
|
)
|
|
807
870
|
reducer.apply(cont_event)
|
|
808
871
|
yield cont_event
|
|
809
|
-
except Exception:
|
|
810
|
-
|
|
872
|
+
except Exception as ckpt_error:
|
|
873
|
+
# 恢复指针丢失会让这次 interrupt 无法恢复——绝不能静默:
|
|
874
|
+
# RunInterrupted 仍然发出(下游知道 run 已暂停),但必须
|
|
875
|
+
# 留下显性告警指向根因。
|
|
876
|
+
logger.warning(
|
|
877
|
+
"LangGraph resume checkpoint 读取失败,ContinuationCreated "
|
|
878
|
+
"未发出(run 可标记为 interrupted 但不可恢复): %s",
|
|
879
|
+
ckpt_error,
|
|
880
|
+
)
|
|
811
881
|
reducer.apply(event)
|
|
812
882
|
last_timestamp = float(getattr(event, "timestamp", 0.0) or last_timestamp)
|
|
813
883
|
yield event
|
|
@@ -815,6 +885,9 @@ class _LangGraphStreamMixin:
|
|
|
815
885
|
reducer.apply(event)
|
|
816
886
|
last_timestamp = float(getattr(event, "timestamp", 0.0) or last_timestamp)
|
|
817
887
|
yield event
|
|
888
|
+
# v3 exposes the final graph state after the event stream completes.
|
|
889
|
+
final_state = await run_stream.output()
|
|
890
|
+
final_result_fields = skill_eval_response_fields(final_state)
|
|
818
891
|
except Exception as exc:
|
|
819
892
|
error_source = SourceRef(
|
|
820
893
|
framework="langgraph",
|
|
@@ -864,7 +937,10 @@ class _LangGraphStreamMixin:
|
|
|
864
937
|
terminal_source = SourceRef(
|
|
865
938
|
framework="langgraph",
|
|
866
939
|
native_run_id=run_id,
|
|
867
|
-
metadata=
|
|
940
|
+
metadata={
|
|
941
|
+
**source_metadata,
|
|
942
|
+
**({"metrics": final_result_fields} if final_result_fields else {}),
|
|
943
|
+
},
|
|
868
944
|
)
|
|
869
945
|
yield RunCompleted(
|
|
870
946
|
schema_version=2,
|