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,218 @@
|
|
|
1
|
+
"""RuntimeEvent → OpenTelemetry Span 适配 + OTLP 导出(plan §13 / 方案 P0)。
|
|
2
|
+
|
|
3
|
+
在 RuntimeEvent 事件流之上加 OTel Span 适配层,不改 RuntimeEvent 契约。
|
|
4
|
+
按 ``KSADK_OTEL_ENDPOINT`` 环境变量开关;无配置时不导出(零侵入)。
|
|
5
|
+
|
|
6
|
+
Span 层级映射(plan §13.1 事件层级)::
|
|
7
|
+
|
|
8
|
+
Run → root Span
|
|
9
|
+
Turn → child Span of Run
|
|
10
|
+
Model → child Span of Turn
|
|
11
|
+
Tool → child Span of Turn
|
|
12
|
+
Context → child Span of Turn(compaction/planned)
|
|
13
|
+
Approval→ child Span of Turn
|
|
14
|
+
Memory → child Span of Turn
|
|
15
|
+
|
|
16
|
+
成对事件(started/completed)由 Span 自动计时;单次事件(delta/usage)记为
|
|
17
|
+
Span 事件(OTel Event,非 Span)。Tool Call begin/end 成对包裹。
|
|
18
|
+
|
|
19
|
+
配置::
|
|
20
|
+
|
|
21
|
+
KSADK_OTEL_ENDPOINT=http://otel-collector:4318/v1/traces
|
|
22
|
+
KSADK_OTEL_SERVICE_NAME=ksadk-harness (默认)
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
from __future__ import annotations
|
|
26
|
+
|
|
27
|
+
import os
|
|
28
|
+
from typing import Any
|
|
29
|
+
|
|
30
|
+
from ksadk.harness.events import EventType, RuntimeEvent
|
|
31
|
+
|
|
32
|
+
#: 事件 → OTel Span 名映射(started 事件创建 Span,completed/failed 结束)。
|
|
33
|
+
_SPAN_EVENTS: dict[str, str] = {
|
|
34
|
+
EventType.RUN_STARTED: "harness.run",
|
|
35
|
+
EventType.TURN_STARTED: "harness.turn",
|
|
36
|
+
EventType.MODEL_CALL_STARTED: "harness.model_call",
|
|
37
|
+
EventType.TOOL_CALL_BEGIN: "harness.tool_call",
|
|
38
|
+
EventType.CONTEXT_COMPACTION_STARTED: "harness.compaction",
|
|
39
|
+
EventType.CHECKPOINT_CREATED: "harness.checkpoint",
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#: started 事件 → 对应的结束事件(completed/failed/end/canceled)。
|
|
43
|
+
_SPAN_END_EVENTS: dict[str, set[str]] = {
|
|
44
|
+
EventType.RUN_STARTED: {
|
|
45
|
+
EventType.RUN_COMPLETED,
|
|
46
|
+
EventType.RUN_FAILED,
|
|
47
|
+
EventType.RUN_CANCELED,
|
|
48
|
+
},
|
|
49
|
+
EventType.TURN_STARTED: {EventType.TURN_COMPLETED},
|
|
50
|
+
EventType.MODEL_CALL_STARTED: {
|
|
51
|
+
EventType.MODEL_CALL_COMPLETED,
|
|
52
|
+
EventType.MODEL_CALL_FAILED,
|
|
53
|
+
},
|
|
54
|
+
EventType.TOOL_CALL_BEGIN: {EventType.TOOL_CALL_END},
|
|
55
|
+
EventType.CONTEXT_COMPACTION_STARTED: {EventType.CONTEXT_COMPACTION_COMPLETED},
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class OTelSpanAdapter:
|
|
60
|
+
"""把 RuntimeEvent 流适配为 OpenTelemetry Span。
|
|
61
|
+
|
|
62
|
+
用法:引擎在 stream 事件时调 :meth:`on_event`;适配器内部维护 Span 栈,
|
|
63
|
+
started 事件创建 Span,结束事件结束 Span。
|
|
64
|
+
|
|
65
|
+
无 ``KSADK_OTEL_ENDPOINT`` 时为 no-op(不创建 TracerProvider)。
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
def __init__(
|
|
69
|
+
self,
|
|
70
|
+
*,
|
|
71
|
+
endpoint: str | None = None,
|
|
72
|
+
service_name: str = "ksadk-harness",
|
|
73
|
+
) -> None:
|
|
74
|
+
self._endpoint = endpoint or os.getenv("KSADK_OTEL_ENDPOINT", "")
|
|
75
|
+
self._service_name = os.getenv("KSADK_OTEL_SERVICE_NAME", service_name)
|
|
76
|
+
self._tracer: Any | None = None
|
|
77
|
+
self._provider: Any | None = None
|
|
78
|
+
self._spans: dict[str, Any] = {} # span_key → Span
|
|
79
|
+
self._span_counter: int = 0
|
|
80
|
+
if self._endpoint:
|
|
81
|
+
self._setup_otel()
|
|
82
|
+
|
|
83
|
+
def _setup_otel(self) -> None:
|
|
84
|
+
"""初始化 OTel TracerProvider + OTLP HTTP exporter。"""
|
|
85
|
+
from opentelemetry import trace
|
|
86
|
+
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
|
|
87
|
+
from opentelemetry.sdk.resources import Resource
|
|
88
|
+
from opentelemetry.sdk.trace import TracerProvider
|
|
89
|
+
from opentelemetry.sdk.trace.export import BatchSpanProcessor
|
|
90
|
+
|
|
91
|
+
resource = Resource.create({"service.name": self._service_name})
|
|
92
|
+
provider = TracerProvider(resource=resource)
|
|
93
|
+
exporter = OTLPSpanExporter(endpoint=self._endpoint)
|
|
94
|
+
provider.add_span_processor(BatchSpanProcessor(exporter))
|
|
95
|
+
trace.set_tracer_provider(provider)
|
|
96
|
+
self._provider = provider
|
|
97
|
+
self._tracer = trace.get_tracer("ksadk.harness")
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def enabled(self) -> bool:
|
|
101
|
+
return self._tracer is not None
|
|
102
|
+
|
|
103
|
+
def on_event(self, event: RuntimeEvent) -> None:
|
|
104
|
+
"""处理一个 RuntimeEvent——创建/结束对应 OTel Span。"""
|
|
105
|
+
if not self._tracer:
|
|
106
|
+
return
|
|
107
|
+
|
|
108
|
+
et = event.event_type
|
|
109
|
+
|
|
110
|
+
# started 事件 → 创建 Span
|
|
111
|
+
if et in _SPAN_EVENTS:
|
|
112
|
+
span_name = _SPAN_EVENTS[et]
|
|
113
|
+
span_key = self._span_key(event, et)
|
|
114
|
+
if span_key in self._spans:
|
|
115
|
+
return # 已存在(重复 started,不重复创建)
|
|
116
|
+
parent_key = self._parent_key(event, et)
|
|
117
|
+
parent_span = self._spans.get(parent_key) if parent_key else None
|
|
118
|
+
context = parent_span.set_span_on_parent() if parent_span else None
|
|
119
|
+
span = self._tracer.start_span(
|
|
120
|
+
span_name,
|
|
121
|
+
context=context,
|
|
122
|
+
attributes=self._attributes(event),
|
|
123
|
+
)
|
|
124
|
+
self._spans[span_key] = span
|
|
125
|
+
return
|
|
126
|
+
|
|
127
|
+
# 结束事件 → 结束对应 Span
|
|
128
|
+
for started_et, end_events in _SPAN_END_EVENTS.items():
|
|
129
|
+
if et in end_events:
|
|
130
|
+
span_key = self._span_key(event, started_et)
|
|
131
|
+
span = self._spans.pop(span_key, None)
|
|
132
|
+
if span:
|
|
133
|
+
if et.endswith(".failed") or et.endswith(".canceled"):
|
|
134
|
+
span.set_attribute("otel.status_code", "ERROR")
|
|
135
|
+
span.set_attribute(
|
|
136
|
+
"error.message", str(event.payload.get("error") or "")
|
|
137
|
+
)
|
|
138
|
+
else:
|
|
139
|
+
span.set_attribute("otel.status_code", "OK")
|
|
140
|
+
span.end()
|
|
141
|
+
return
|
|
142
|
+
|
|
143
|
+
# 单次事件 → 记为 Span Event(非新 Span)
|
|
144
|
+
if self._spans:
|
|
145
|
+
turn_key = self._span_key(event, EventType.TURN_STARTED)
|
|
146
|
+
span = self._spans.get(turn_key) or self._spans.get(
|
|
147
|
+
self._span_key(event, EventType.RUN_STARTED)
|
|
148
|
+
)
|
|
149
|
+
if span:
|
|
150
|
+
span.add_event(
|
|
151
|
+
et,
|
|
152
|
+
attributes={
|
|
153
|
+
k: str(v) for k, v in event.payload.items() if v is not None
|
|
154
|
+
},
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
def flush(self) -> None:
|
|
158
|
+
"""强制刷新所有待导出的 Span(进程退出前调)。"""
|
|
159
|
+
if self._provider:
|
|
160
|
+
try:
|
|
161
|
+
self._provider.force_flush()
|
|
162
|
+
except Exception: # noqa: BLE001 - 导出失败不阻断主流程
|
|
163
|
+
pass
|
|
164
|
+
|
|
165
|
+
def shutdown(self) -> None:
|
|
166
|
+
"""关闭 TracerProvider。"""
|
|
167
|
+
if self._provider:
|
|
168
|
+
try:
|
|
169
|
+
self._provider.shutdown()
|
|
170
|
+
except Exception: # noqa: BLE001
|
|
171
|
+
pass
|
|
172
|
+
self._provider = None
|
|
173
|
+
self._tracer = None
|
|
174
|
+
|
|
175
|
+
# ---- helpers ----
|
|
176
|
+
|
|
177
|
+
def _span_key(self, event: RuntimeEvent, started_et: str) -> str:
|
|
178
|
+
"""Span 唯一键:run_id + started_event_type + call_id/tool_id。"""
|
|
179
|
+
run_id = event.run_id or event.invocation_id
|
|
180
|
+
extra = ""
|
|
181
|
+
if started_et == EventType.TOOL_CALL_BEGIN:
|
|
182
|
+
extra = f":{event.payload.get('call_id', '')}"
|
|
183
|
+
elif started_et == EventType.MODEL_CALL_STARTED:
|
|
184
|
+
extra = f":{event.payload.get('attempt', '')}"
|
|
185
|
+
return f"{run_id}:{started_et}{extra}"
|
|
186
|
+
|
|
187
|
+
def _parent_key(self, event: RuntimeEvent, started_et: str) -> str | None:
|
|
188
|
+
"""Span 父键:Turn/Tool 的父是 Run/Turn。"""
|
|
189
|
+
run_id = event.run_id or event.invocation_id
|
|
190
|
+
if started_et == EventType.TURN_STARTED:
|
|
191
|
+
return f"{run_id}:{EventType.RUN_STARTED}"
|
|
192
|
+
if started_et in (
|
|
193
|
+
EventType.MODEL_CALL_STARTED,
|
|
194
|
+
EventType.TOOL_CALL_BEGIN,
|
|
195
|
+
EventType.CONTEXT_COMPACTION_STARTED,
|
|
196
|
+
):
|
|
197
|
+
return f"{run_id}:{EventType.TURN_STARTED}"
|
|
198
|
+
return None
|
|
199
|
+
|
|
200
|
+
@staticmethod
|
|
201
|
+
def _attributes(event: RuntimeEvent) -> dict[str, Any]:
|
|
202
|
+
"""从 RuntimeEvent 提取 OTel Span 属性。"""
|
|
203
|
+
attrs: dict[str, Any] = {
|
|
204
|
+
"harness.event_type": event.event_type,
|
|
205
|
+
"harness.agent_id": event.agent_id,
|
|
206
|
+
"harness.session_id": event.session_id,
|
|
207
|
+
"harness.run_id": event.run_id or event.invocation_id,
|
|
208
|
+
"harness.seq_id": event.seq_id,
|
|
209
|
+
}
|
|
210
|
+
if event.phase:
|
|
211
|
+
attrs["harness.phase"] = event.phase
|
|
212
|
+
for key, value in event.payload.items():
|
|
213
|
+
if value is not None and isinstance(value, (str, int, float, bool)):
|
|
214
|
+
attrs[f"harness.payload.{key}"] = value
|
|
215
|
+
return attrs
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
__all__ = ["OTelSpanAdapter"]
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Prompt Cache 边界诊断(只记录 Hash,不持久化 Prompt 正文)。"""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections import OrderedDict
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass(frozen=True)
|
|
10
|
+
class PromptCacheDiagnostic:
|
|
11
|
+
"""一次稳定 Prompt 前缀观察结果。"""
|
|
12
|
+
|
|
13
|
+
stable_prompt_hash: str
|
|
14
|
+
previous_stable_prompt_hash: str
|
|
15
|
+
cache_break: bool
|
|
16
|
+
reason: str
|
|
17
|
+
|
|
18
|
+
def to_payload(self) -> dict[str, str | bool]:
|
|
19
|
+
return {
|
|
20
|
+
"stable_prompt_hash": self.stable_prompt_hash,
|
|
21
|
+
"previous_stable_prompt_hash": self.previous_stable_prompt_hash,
|
|
22
|
+
"cache_break": self.cache_break,
|
|
23
|
+
"reason": self.reason,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class PromptCacheTracker:
|
|
28
|
+
"""进程内有界诊断器。
|
|
29
|
+
|
|
30
|
+
Provider 的真实缓存命中仍以 ``usage.reported.cached_tokens`` 为准;本类只
|
|
31
|
+
判断 KsADK 稳定 Prompt 合同是否发生变化。LRU 有界,重启后首个观察记为
|
|
32
|
+
``cold_start``,不会把本地缓存状态伪装成云端事实。
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
def __init__(self, *, max_scopes: int = 1024) -> None:
|
|
36
|
+
if max_scopes < 1:
|
|
37
|
+
raise ValueError("max_scopes 必须为正整数")
|
|
38
|
+
self._max_scopes = max_scopes
|
|
39
|
+
self._hashes: OrderedDict[str, str] = OrderedDict()
|
|
40
|
+
|
|
41
|
+
def observe(self, *, scope: str, stable_prompt_hash: str) -> PromptCacheDiagnostic:
|
|
42
|
+
current = stable_prompt_hash.strip()
|
|
43
|
+
previous = self._hashes.pop(scope, "")
|
|
44
|
+
if current:
|
|
45
|
+
self._hashes[scope] = current
|
|
46
|
+
while len(self._hashes) > self._max_scopes:
|
|
47
|
+
self._hashes.popitem(last=False)
|
|
48
|
+
|
|
49
|
+
if not current:
|
|
50
|
+
return PromptCacheDiagnostic(
|
|
51
|
+
stable_prompt_hash="",
|
|
52
|
+
previous_stable_prompt_hash=previous,
|
|
53
|
+
cache_break=False,
|
|
54
|
+
reason="stable_prompt_unavailable",
|
|
55
|
+
)
|
|
56
|
+
if not previous:
|
|
57
|
+
reason, cache_break = "cold_start", False
|
|
58
|
+
elif previous == current:
|
|
59
|
+
reason, cache_break = "stable_prompt_reused", False
|
|
60
|
+
else:
|
|
61
|
+
reason, cache_break = "stable_prompt_changed", True
|
|
62
|
+
return PromptCacheDiagnostic(
|
|
63
|
+
stable_prompt_hash=current,
|
|
64
|
+
previous_stable_prompt_hash=previous,
|
|
65
|
+
cache_break=cache_break,
|
|
66
|
+
reason=reason,
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
__all__ = ["PromptCacheDiagnostic", "PromptCacheTracker"]
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"""Small, display-safe facts about actions, never a copy of tool arguments."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import ipaddress
|
|
6
|
+
import re
|
|
7
|
+
import shlex
|
|
8
|
+
from pathlib import PurePosixPath
|
|
9
|
+
from typing import Any
|
|
10
|
+
from urllib.parse import urlsplit, urlunsplit
|
|
11
|
+
|
|
12
|
+
_SENSITIVE = re.compile(
|
|
13
|
+
r"(?i)(?:api[_ -]?key|secret|password|passwd|authorization|bearer|token|"
|
|
14
|
+
r"sk-[a-z0-9]|[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})"
|
|
15
|
+
)
|
|
16
|
+
_SECRET_VALUE = re.compile(
|
|
17
|
+
r"(?i)(?:\b(?:api[_ -]?key|secret|password|passwd|authorization|access[_ -]?token|"
|
|
18
|
+
r"refresh[_ -]?token)\b\s*[:=]\s*\S+|\bbearer\s+\S+|\bsk-[a-z0-9_-]{12,})"
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _text(value: Any) -> str:
|
|
23
|
+
# Tool arguments are untrusted payloads. Keep the deliberately broad
|
|
24
|
+
# policy here: even a credential-shaped field name or URL path is enough
|
|
25
|
+
# to omit the action rather than risk displaying it.
|
|
26
|
+
if not isinstance(value, str) or _SENSITIVE.search(value):
|
|
27
|
+
return ""
|
|
28
|
+
# Free-text search requests can embed URLs too; never publish credentials.
|
|
29
|
+
if re.search(r"https?://[^\s/]*@", value):
|
|
30
|
+
return ""
|
|
31
|
+
return " ".join(value.split())[:180]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def public_commentary_text(value: Any, *, limit: int = 360) -> str:
|
|
35
|
+
"""Return model-authored text that is safe to show as public progress.
|
|
36
|
+
|
|
37
|
+
This accepts only the assistant's public text channel. Provider reasoning,
|
|
38
|
+
tool arguments and tool results never call this helper. Fail closed for
|
|
39
|
+
credentials and for tool-protocol fragments that some OpenAI-compatible
|
|
40
|
+
providers accidentally place in ``content`` alongside a tool call.
|
|
41
|
+
"""
|
|
42
|
+
# Public assistant prose may legitimately discuss concepts such as a
|
|
43
|
+
# "token budget". Only reject text that contains a credential value;
|
|
44
|
+
# unlike tool arguments, this channel has already been separated from
|
|
45
|
+
# provider reasoning and tool payloads.
|
|
46
|
+
if not isinstance(value, str) or _SECRET_VALUE.search(value):
|
|
47
|
+
return ""
|
|
48
|
+
if re.search(r"https?://[^\s/]*@", value):
|
|
49
|
+
return ""
|
|
50
|
+
if re.search(
|
|
51
|
+
r"(?i)(?:<\|\s*DSML\s*\||</?calls?>|</?invoke\b|<parameter\b|"
|
|
52
|
+
r"tool_calls?\s*[:=]|function_call\s*[:=])",
|
|
53
|
+
value,
|
|
54
|
+
):
|
|
55
|
+
return ""
|
|
56
|
+
# Child conclusions are often Markdown. The activity feed is prose, so
|
|
57
|
+
# remove presentation markers while retaining the actual conclusion.
|
|
58
|
+
text = re.sub(r"(?m)^\s{0,3}(?:#{1,6}\s+|>\s*|[-*+]\s+|\d+[.)]\s+)", "", value)
|
|
59
|
+
text = text.replace("**", "").replace("__", "").replace("`", "")
|
|
60
|
+
text = " ".join(text.split()).strip()
|
|
61
|
+
# Streaming providers can occasionally leave a trailing punctuation-only
|
|
62
|
+
# content fragment after a tool call. It conveys no progress and would
|
|
63
|
+
# otherwise render as a stray activity row such as ``。``.
|
|
64
|
+
if not re.search(r"[A-Za-z0-9\u3400-\u9fff]", text):
|
|
65
|
+
return ""
|
|
66
|
+
# Tool-preface boilerplate is not a useful user-facing checkpoint. It is
|
|
67
|
+
# intentionally omitted instead of translated into another canned phrase.
|
|
68
|
+
if re.fullmatch(
|
|
69
|
+
r"(?i)(?:let me|i(?:'ll| will)|we(?:'ll| will))\s+"
|
|
70
|
+
r"(?:delegate|search|look up|check|call|use|run)\b.*",
|
|
71
|
+
text,
|
|
72
|
+
):
|
|
73
|
+
return ""
|
|
74
|
+
if len(text) <= limit:
|
|
75
|
+
return text
|
|
76
|
+
shortened = text[:limit]
|
|
77
|
+
boundary = max(shortened.rfind(mark) for mark in "。!?;.!?;")
|
|
78
|
+
if boundary >= max(40, limit // 2):
|
|
79
|
+
shortened = shortened[: boundary + 1]
|
|
80
|
+
return shortened.rstrip() + "…"
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def tool_public_action(payload: dict[str, Any]) -> dict[str, str] | None:
|
|
84
|
+
"""Allowlist display fields; omit results, command arguments and credentials."""
|
|
85
|
+
name = str(payload.get("name") or "").lower()
|
|
86
|
+
args = payload.get("args")
|
|
87
|
+
if not isinstance(args, dict):
|
|
88
|
+
return None
|
|
89
|
+
if name == "web_search":
|
|
90
|
+
query = _text(args.get("query"))
|
|
91
|
+
return {"text": f"搜索资料:{query}"} if query else None
|
|
92
|
+
if name == "web_fetch":
|
|
93
|
+
try:
|
|
94
|
+
url = urlsplit(str(args.get("url") or ""))
|
|
95
|
+
host = url.hostname or ""
|
|
96
|
+
if url.scheme not in {"https", "http"} or not host:
|
|
97
|
+
return None
|
|
98
|
+
if host == "localhost" or "." not in host or host.endswith((".local", ".internal")):
|
|
99
|
+
return None
|
|
100
|
+
try:
|
|
101
|
+
if not ipaddress.ip_address(host).is_global:
|
|
102
|
+
return None
|
|
103
|
+
except ValueError:
|
|
104
|
+
pass
|
|
105
|
+
# Queries, fragments and URL credentials never become presentation data.
|
|
106
|
+
safe = urlunsplit((url.scheme, host, url.path, "", ""))
|
|
107
|
+
if not _text(safe) or len(safe) > 300:
|
|
108
|
+
return None
|
|
109
|
+
return {"text": f"查看网页:{host}{url.path}", "href": safe}
|
|
110
|
+
except ValueError:
|
|
111
|
+
return None
|
|
112
|
+
if name in {
|
|
113
|
+
"read_workspace_file",
|
|
114
|
+
"write_workspace_file",
|
|
115
|
+
"edit_workspace_file",
|
|
116
|
+
"list_workspace_files",
|
|
117
|
+
}:
|
|
118
|
+
target = _text(PurePosixPath(str(args.get("path") or "").replace("\\", "/")).name)
|
|
119
|
+
if not target or target in {".", "..", ".env"}:
|
|
120
|
+
return None
|
|
121
|
+
verb = (
|
|
122
|
+
"保存文件"
|
|
123
|
+
if name == "write_workspace_file"
|
|
124
|
+
else "编辑文件"
|
|
125
|
+
if name == "edit_workspace_file"
|
|
126
|
+
else "查看文件"
|
|
127
|
+
if name == "read_workspace_file"
|
|
128
|
+
else "查看目录"
|
|
129
|
+
)
|
|
130
|
+
return {"text": f"{verb}:{target}"}
|
|
131
|
+
if name in {"exec_command", "run_command", "execute_command", "run_workspace_command"}:
|
|
132
|
+
try:
|
|
133
|
+
words = shlex.split(str(args.get("command") or args.get("cmd") or ""))
|
|
134
|
+
except ValueError:
|
|
135
|
+
return None
|
|
136
|
+
command = PurePosixPath(words[0]).name if words else ""
|
|
137
|
+
if command in {
|
|
138
|
+
"rg",
|
|
139
|
+
"git",
|
|
140
|
+
"ls",
|
|
141
|
+
"cat",
|
|
142
|
+
"sed",
|
|
143
|
+
"python",
|
|
144
|
+
"python3",
|
|
145
|
+
"node",
|
|
146
|
+
"npm",
|
|
147
|
+
"uv",
|
|
148
|
+
"pytest",
|
|
149
|
+
}:
|
|
150
|
+
return {"text": f"运行命令:{command}(参数未展示)"}
|
|
151
|
+
return None
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
__all__ = ["public_commentary_text", "tool_public_action"]
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
"""Harness 运行就绪度稳定合同。
|
|
2
|
+
|
|
3
|
+
把不可变 :class:`HarnessSpec` 与一次 smoke/draft Run 的公开事件合并为
|
|
4
|
+
``ready / warning / blocked``。该投影只消费公开合同,不解析 Engine、MCP、
|
|
5
|
+
Skill 或 Sandbox 私有对象,可直接供生命周期门禁与 Studio 展示。
|
|
6
|
+
|
|
7
|
+
``unknown`` 不等于故障:渐进披露能力在尚未被模型使用前本来就是 unknown,
|
|
8
|
+
因此只产生 warning;只有已观测到的必需能力故障、模型失败或 Run 失败才阻断。
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from collections import Counter
|
|
14
|
+
from typing import Any, Sequence
|
|
15
|
+
|
|
16
|
+
from ksadk.harness.events import EventType, RuntimeEvent
|
|
17
|
+
from ksadk.harness.observability import capability_health
|
|
18
|
+
from ksadk.harness.spec import CapabilityBinding, HarnessSpec
|
|
19
|
+
|
|
20
|
+
_STATUS_ORDER = {"ready": 0, "warning": 1, "blocked": 2}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def runtime_readiness(
|
|
24
|
+
spec: HarnessSpec,
|
|
25
|
+
events: Sequence[RuntimeEvent] = (),
|
|
26
|
+
) -> dict[str, Any]:
|
|
27
|
+
"""返回 JSON 兼容的运行/部署就绪度快照。
|
|
28
|
+
|
|
29
|
+
该函数不执行探测。``events`` 应来自同一 Revision 的 draft/smoke Run;
|
|
30
|
+
空事件仍可做静态检查,但模型和按需能力会标记为尚未观测。
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
projected = capability_health(events)
|
|
34
|
+
health_by_ref = {
|
|
35
|
+
str(item["capability_ref"]): item for item in projected.get("items", ())
|
|
36
|
+
}
|
|
37
|
+
checks: list[dict[str, Any]] = [
|
|
38
|
+
_check(
|
|
39
|
+
check_id="spec",
|
|
40
|
+
category="configuration",
|
|
41
|
+
status="ready",
|
|
42
|
+
reason_code="spec_valid",
|
|
43
|
+
resource_ref=spec.agent_revision_ref,
|
|
44
|
+
required=True,
|
|
45
|
+
),
|
|
46
|
+
_model_check(spec, events),
|
|
47
|
+
]
|
|
48
|
+
checks.extend(
|
|
49
|
+
_capability_check("mcp", binding, health_by_ref.get(binding.capability_ref))
|
|
50
|
+
for binding in spec.capabilities.mcp_bindings
|
|
51
|
+
)
|
|
52
|
+
checks.extend(
|
|
53
|
+
_capability_check("skill", binding, health_by_ref.get(binding.capability_ref))
|
|
54
|
+
for binding in spec.capabilities.skill_bindings
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Sandbox 只有在引擎实际声明/使用时才属于该 Agent 的运行依赖;默认
|
|
58
|
+
# SandboxPolicy 本身不代表 Agent 一定绑定了 Sandbox Tool。
|
|
59
|
+
checks.extend(
|
|
60
|
+
_observed_capability_check(item)
|
|
61
|
+
for item in projected.get("items", ())
|
|
62
|
+
if item.get("kind") == "sandbox"
|
|
63
|
+
)
|
|
64
|
+
checks.append(_approval_check(spec))
|
|
65
|
+
checks.append(_run_check(events))
|
|
66
|
+
|
|
67
|
+
counts = Counter(str(item["status"]) for item in checks)
|
|
68
|
+
overall = max((str(item["status"]) for item in checks), key=_STATUS_ORDER.__getitem__)
|
|
69
|
+
run_ids = sorted(
|
|
70
|
+
{
|
|
71
|
+
str(event.run_id or event.invocation_id)
|
|
72
|
+
for event in events
|
|
73
|
+
if event.run_id or event.invocation_id
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
return {
|
|
77
|
+
"status": overall,
|
|
78
|
+
"deployable": overall != "blocked",
|
|
79
|
+
"revision_ref": spec.agent_revision_ref,
|
|
80
|
+
"spec_hash": spec.content_hash(),
|
|
81
|
+
"observed_run_ids": run_ids,
|
|
82
|
+
"counts": {name: counts.get(name, 0) for name in ("ready", "warning", "blocked")},
|
|
83
|
+
"checks": checks,
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def _model_check(spec: HarnessSpec, events: Sequence[RuntimeEvent]) -> dict[str, Any]:
|
|
88
|
+
observed = [
|
|
89
|
+
event
|
|
90
|
+
for event in events
|
|
91
|
+
if event.event_type
|
|
92
|
+
in {EventType.MODEL_CALL_COMPLETED, EventType.MODEL_CALL_FAILED}
|
|
93
|
+
]
|
|
94
|
+
if not observed:
|
|
95
|
+
return _check(
|
|
96
|
+
check_id="model",
|
|
97
|
+
category="model",
|
|
98
|
+
status="warning",
|
|
99
|
+
reason_code="not_observed",
|
|
100
|
+
resource_ref=spec.model.profile_ref,
|
|
101
|
+
required=True,
|
|
102
|
+
)
|
|
103
|
+
latest = observed[-1]
|
|
104
|
+
failed = latest.event_type == EventType.MODEL_CALL_FAILED
|
|
105
|
+
check = _check(
|
|
106
|
+
check_id="model",
|
|
107
|
+
category="model",
|
|
108
|
+
status="blocked" if failed else "ready",
|
|
109
|
+
reason_code="model_call_failed" if failed else "model_call_succeeded",
|
|
110
|
+
resource_ref=str(latest.payload.get("model") or spec.model.profile_ref),
|
|
111
|
+
required=True,
|
|
112
|
+
)
|
|
113
|
+
check["configured_resource_ref"] = spec.model.profile_ref
|
|
114
|
+
check["fallback_used"] = bool(latest.payload.get("fallback", False))
|
|
115
|
+
check["attempt"] = int(latest.payload.get("attempt") or 1)
|
|
116
|
+
return check
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def _capability_check(
|
|
120
|
+
kind: str,
|
|
121
|
+
binding: CapabilityBinding,
|
|
122
|
+
health: dict[str, Any] | None,
|
|
123
|
+
) -> dict[str, Any]:
|
|
124
|
+
observed_status = str((health or {}).get("status") or "unknown")
|
|
125
|
+
if observed_status == "available":
|
|
126
|
+
status, reason = "ready", "capability_available"
|
|
127
|
+
elif observed_status == "degraded":
|
|
128
|
+
status = "blocked" if binding.required else "warning"
|
|
129
|
+
reason = (
|
|
130
|
+
"required_capability_degraded"
|
|
131
|
+
if binding.required
|
|
132
|
+
else "optional_capability_degraded"
|
|
133
|
+
)
|
|
134
|
+
else:
|
|
135
|
+
# on_demand/explicit 以及尚未调用的 always 能力都不能仅因“未使用”判坏。
|
|
136
|
+
status, reason = "warning", "capability_not_observed"
|
|
137
|
+
return _check(
|
|
138
|
+
check_id=f"{kind}:{binding.capability_ref}",
|
|
139
|
+
category=kind,
|
|
140
|
+
status=status,
|
|
141
|
+
reason_code=reason,
|
|
142
|
+
resource_ref=binding.capability_ref,
|
|
143
|
+
required=binding.required,
|
|
144
|
+
load_policy=binding.load_policy,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def _observed_capability_check(item: dict[str, Any]) -> dict[str, Any]:
|
|
149
|
+
required = bool(item.get("required", True))
|
|
150
|
+
observed_status = str(item.get("status") or "unknown")
|
|
151
|
+
if observed_status == "available":
|
|
152
|
+
status, reason = "ready", "capability_available"
|
|
153
|
+
elif observed_status == "degraded":
|
|
154
|
+
status = "blocked" if required else "warning"
|
|
155
|
+
reason = "required_capability_degraded" if required else "optional_capability_degraded"
|
|
156
|
+
else:
|
|
157
|
+
status, reason = "warning", "capability_not_observed"
|
|
158
|
+
capability_ref = str(item.get("capability_ref") or "")
|
|
159
|
+
return _check(
|
|
160
|
+
check_id=f"{item.get('kind', 'capability')}:{capability_ref}",
|
|
161
|
+
category=str(item.get("kind") or "capability"),
|
|
162
|
+
status=status,
|
|
163
|
+
reason_code=reason,
|
|
164
|
+
resource_ref=capability_ref,
|
|
165
|
+
required=required,
|
|
166
|
+
load_policy=str(item.get("load_policy") or "on_demand"),
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def _approval_check(spec: HarnessSpec) -> dict[str, Any]:
|
|
171
|
+
policy = spec.approval_policy
|
|
172
|
+
if policy.mode == "never" or policy.approver_roles:
|
|
173
|
+
status, reason = "ready", "approval_policy_configured"
|
|
174
|
+
else:
|
|
175
|
+
# 本地调试可由调用者直接批准,正式平台仍应配置组织审批角色。
|
|
176
|
+
status, reason = "warning", "approval_roles_not_configured"
|
|
177
|
+
return _check(
|
|
178
|
+
check_id="approval-policy",
|
|
179
|
+
category="policy",
|
|
180
|
+
status=status,
|
|
181
|
+
reason_code=reason,
|
|
182
|
+
resource_ref=None,
|
|
183
|
+
required=policy.mode != "never",
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def _run_check(events: Sequence[RuntimeEvent]) -> dict[str, Any]:
|
|
188
|
+
terminal = [
|
|
189
|
+
event
|
|
190
|
+
for event in events
|
|
191
|
+
if event.event_type
|
|
192
|
+
in {
|
|
193
|
+
EventType.RUN_COMPLETED,
|
|
194
|
+
EventType.RUN_FAILED,
|
|
195
|
+
EventType.RUN_CANCELED,
|
|
196
|
+
EventType.RUN_INTERRUPTED,
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
if not terminal:
|
|
200
|
+
return _check(
|
|
201
|
+
check_id="smoke-run",
|
|
202
|
+
category="runtime",
|
|
203
|
+
status="warning",
|
|
204
|
+
reason_code="smoke_run_not_observed",
|
|
205
|
+
resource_ref=None,
|
|
206
|
+
required=False,
|
|
207
|
+
)
|
|
208
|
+
latest = terminal[-1]
|
|
209
|
+
if latest.event_type == EventType.RUN_COMPLETED:
|
|
210
|
+
status, reason = "ready", "smoke_run_succeeded"
|
|
211
|
+
elif latest.event_type == EventType.RUN_FAILED:
|
|
212
|
+
status, reason = "blocked", "smoke_run_failed"
|
|
213
|
+
else:
|
|
214
|
+
status, reason = "warning", "smoke_run_incomplete"
|
|
215
|
+
return _check(
|
|
216
|
+
check_id="smoke-run",
|
|
217
|
+
category="runtime",
|
|
218
|
+
status=status,
|
|
219
|
+
reason_code=reason,
|
|
220
|
+
resource_ref=None,
|
|
221
|
+
required=False,
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def _check(
|
|
226
|
+
*,
|
|
227
|
+
check_id: str,
|
|
228
|
+
category: str,
|
|
229
|
+
status: str,
|
|
230
|
+
reason_code: str,
|
|
231
|
+
resource_ref: str | None,
|
|
232
|
+
required: bool,
|
|
233
|
+
load_policy: str | None = None,
|
|
234
|
+
) -> dict[str, Any]:
|
|
235
|
+
result: dict[str, Any] = {
|
|
236
|
+
"id": check_id,
|
|
237
|
+
"category": category,
|
|
238
|
+
"status": status,
|
|
239
|
+
"reason_code": reason_code,
|
|
240
|
+
"required": required,
|
|
241
|
+
}
|
|
242
|
+
if resource_ref:
|
|
243
|
+
result["resource_ref"] = resource_ref
|
|
244
|
+
if load_policy:
|
|
245
|
+
result["load_policy"] = load_policy
|
|
246
|
+
return result
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
__all__ = ["runtime_readiness"]
|