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,83 @@
|
|
|
1
|
+
"""Credential-free identities of the actual loaded companion execution inputs."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import hashlib
|
|
6
|
+
import json
|
|
7
|
+
from collections.abc import Mapping, Sequence
|
|
8
|
+
from dataclasses import asdict, dataclass
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
from ksadk.plugins.bridges.dsh import DshPluginInventory, DshProfileBuildSnapshot
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _digest(value: object) -> str:
|
|
15
|
+
data = json.dumps(value, sort_keys=True, separators=(",", ":")).encode()
|
|
16
|
+
return "sha256:" + hashlib.sha256(data).hexdigest()
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@dataclass(frozen=True)
|
|
20
|
+
class DshCompanionComponent:
|
|
21
|
+
component: str
|
|
22
|
+
package: str
|
|
23
|
+
version: str
|
|
24
|
+
source_digest: str | None
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclass(frozen=True)
|
|
28
|
+
class DshCompanionArtifact:
|
|
29
|
+
plugin_id: str
|
|
30
|
+
profile: str
|
|
31
|
+
components: tuple[DshCompanionComponent, ...]
|
|
32
|
+
dependency_lock_digest: str
|
|
33
|
+
installation_digest: str
|
|
34
|
+
source_digest: str
|
|
35
|
+
profile_digest: str
|
|
36
|
+
host_version: str
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def plugin_digest(self) -> str:
|
|
40
|
+
# Deliberately conservative: the whole dependency closure is bound.
|
|
41
|
+
# Runtime generations, temporary endpoints and secrets never enter it.
|
|
42
|
+
return _digest(asdict(self))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def companion_source_digest(sources: Sequence[Path]) -> str:
|
|
46
|
+
"""Hash trusted host-selected source bytes, excluding caches and file paths.
|
|
47
|
+
|
|
48
|
+
The caller defines an ordered source list. File names distinguish its roles
|
|
49
|
+
while an absolute checkout path does not affect a relocated installation.
|
|
50
|
+
"""
|
|
51
|
+
rows = []
|
|
52
|
+
for source in sources:
|
|
53
|
+
if source.is_symlink() or not source.is_file() or source.stat().st_size > 8 * 1024 * 1024:
|
|
54
|
+
raise ValueError("Companion source must be a bounded regular file")
|
|
55
|
+
rows.append((source.name, hashlib.sha256(source.read_bytes()).hexdigest()))
|
|
56
|
+
return _digest(rows)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def companion_artifact(
|
|
60
|
+
*,
|
|
61
|
+
plugin_id: str,
|
|
62
|
+
components: Mapping[str, str],
|
|
63
|
+
snapshot: DshProfileBuildSnapshot,
|
|
64
|
+
inventory: Sequence[DshPluginInventory],
|
|
65
|
+
sources: Sequence[Path],
|
|
66
|
+
) -> DshCompanionArtifact:
|
|
67
|
+
installed = {item.name: item for item in inventory}
|
|
68
|
+
rows = []
|
|
69
|
+
for component, package in sorted(components.items()):
|
|
70
|
+
item = installed.get(package)
|
|
71
|
+
if item is None or not item.enabled or package not in snapshot.projection.bundles:
|
|
72
|
+
raise ValueError("Companion requires its entire installed and enabled package graph")
|
|
73
|
+
rows.append(DshCompanionComponent(component, package, item.version, item.source_digest))
|
|
74
|
+
return DshCompanionArtifact(
|
|
75
|
+
plugin_id=plugin_id,
|
|
76
|
+
profile=snapshot.projection.profile,
|
|
77
|
+
components=tuple(rows),
|
|
78
|
+
dependency_lock_digest=snapshot.dependency_lock_digest,
|
|
79
|
+
installation_digest=snapshot.installation_digest,
|
|
80
|
+
source_digest=companion_source_digest(sources),
|
|
81
|
+
profile_digest=snapshot.projection.config_digest,
|
|
82
|
+
host_version=snapshot.projection.host_version,
|
|
83
|
+
)
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
"""Private, generation-scoped IPC for Cordis-owned Python companions.
|
|
2
|
+
|
|
3
|
+
Only a complete live Cordis graph and a healthy Core activate a companion.
|
|
4
|
+
Invocation principals are retained in Python behind opaque, expiring handles;
|
|
5
|
+
neither plugin tool arguments nor browser payloads can choose that principal.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import asyncio
|
|
11
|
+
import inspect
|
|
12
|
+
import json
|
|
13
|
+
import secrets
|
|
14
|
+
import shutil
|
|
15
|
+
import tempfile
|
|
16
|
+
import time
|
|
17
|
+
from collections.abc import Awaitable, Callable, Mapping
|
|
18
|
+
from dataclasses import dataclass, field
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
from typing import Any
|
|
21
|
+
|
|
22
|
+
from ksadk.plugins.companion_artifacts import DshCompanionArtifact
|
|
23
|
+
|
|
24
|
+
Callback = Callable[[], Awaitable[None] | None]
|
|
25
|
+
BindArtifact = Callable[[DshCompanionArtifact], Awaitable[None] | None]
|
|
26
|
+
Invoke = Callable[[Any, str, dict[str, Any], str], Awaitable[dict[str, Any]] | dict[str, Any]]
|
|
27
|
+
_MAX_BYTES = 1024 * 1024
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class CompanionError(RuntimeError):
|
|
31
|
+
def __init__(self, code: str) -> None:
|
|
32
|
+
super().__init__(code)
|
|
33
|
+
self.code = code
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@dataclass(frozen=True)
|
|
37
|
+
class DshCompanionDefinition:
|
|
38
|
+
plugin_id: str
|
|
39
|
+
components: Mapping[str, str]
|
|
40
|
+
operations: frozenset[str]
|
|
41
|
+
start: Callback
|
|
42
|
+
revoke: Callback
|
|
43
|
+
close: Callback
|
|
44
|
+
invoke: Invoke
|
|
45
|
+
profile: str = "web"
|
|
46
|
+
bind_artifact: BindArtifact | None = None
|
|
47
|
+
artifact_sources: tuple[Path, ...] = ()
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@dataclass(frozen=True)
|
|
51
|
+
class _Grant:
|
|
52
|
+
plugin_id: str
|
|
53
|
+
principal: Any
|
|
54
|
+
operations: frozenset[str]
|
|
55
|
+
expires_at: float
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@dataclass
|
|
59
|
+
class _Companion:
|
|
60
|
+
definition: DshCompanionDefinition
|
|
61
|
+
connections: dict[str, asyncio.StreamWriter] = field(default_factory=dict)
|
|
62
|
+
running: bool = False
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
async def _call(callback: Callback) -> None:
|
|
66
|
+
result = callback()
|
|
67
|
+
if inspect.isawaitable(result):
|
|
68
|
+
await result
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _object(pairs: list[tuple[str, Any]]) -> dict[str, Any]:
|
|
72
|
+
result: dict[str, Any] = {}
|
|
73
|
+
for key, value in pairs:
|
|
74
|
+
if key in result:
|
|
75
|
+
raise ValueError("duplicate key")
|
|
76
|
+
result[key] = value
|
|
77
|
+
return result
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class DshPluginCompanionManager:
|
|
81
|
+
def __init__(
|
|
82
|
+
self,
|
|
83
|
+
*,
|
|
84
|
+
profile: str,
|
|
85
|
+
generation_id: str,
|
|
86
|
+
definitions: tuple[DshCompanionDefinition, ...],
|
|
87
|
+
artifacts: Mapping[str, DshCompanionArtifact] | None = None,
|
|
88
|
+
) -> None:
|
|
89
|
+
if any(item.profile != profile for item in definitions):
|
|
90
|
+
raise CompanionError("COMPANION_PROFILE_MISMATCH")
|
|
91
|
+
self.profile = profile
|
|
92
|
+
self.generation_id = generation_id
|
|
93
|
+
self._companions = {item.plugin_id: _Companion(item) for item in definitions}
|
|
94
|
+
self._artifacts = dict(artifacts or {})
|
|
95
|
+
if any(
|
|
96
|
+
item.bind_artifact and item.plugin_id not in self._artifacts for item in definitions
|
|
97
|
+
):
|
|
98
|
+
raise CompanionError("COMPANION_ARTIFACT_REQUIRED")
|
|
99
|
+
if len(self._companions) != len(definitions):
|
|
100
|
+
raise CompanionError("COMPANION_DUPLICATE")
|
|
101
|
+
self._secret = secrets.token_urlsafe(32)
|
|
102
|
+
self._grants: dict[str, _Grant] = {}
|
|
103
|
+
self._pending: dict[asyncio.Task[Any], str] = {}
|
|
104
|
+
self._connections: set[asyncio.StreamWriter] = set()
|
|
105
|
+
self._lock = asyncio.Lock()
|
|
106
|
+
self._server: asyncio.Server | None = None
|
|
107
|
+
self._root: Path | None = None
|
|
108
|
+
self._healthy = False
|
|
109
|
+
self._closed = False
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def active_plugins(self) -> frozenset[str]:
|
|
113
|
+
return frozenset(key for key, value in self._companions.items() if value.running)
|
|
114
|
+
|
|
115
|
+
@property
|
|
116
|
+
def configuration(self) -> dict[str, Any]:
|
|
117
|
+
if self._root is None:
|
|
118
|
+
raise CompanionError("COMPANION_BROKER_NOT_STARTED")
|
|
119
|
+
return {
|
|
120
|
+
"socketPath": str(self._root / "host.sock"),
|
|
121
|
+
"generationId": self.generation_id,
|
|
122
|
+
"secret": self._secret,
|
|
123
|
+
"plugins": {
|
|
124
|
+
key: {"components": sorted(value.definition.components)}
|
|
125
|
+
for key, value in self._companions.items()
|
|
126
|
+
},
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async def start_broker(self) -> Path:
|
|
130
|
+
if self._closed:
|
|
131
|
+
raise CompanionError("COMPANION_CLOSED")
|
|
132
|
+
if self._root is None:
|
|
133
|
+
self._root = Path(tempfile.mkdtemp(prefix="ksadk-companion-"))
|
|
134
|
+
self._root.chmod(0o700)
|
|
135
|
+
path = self._root / "host.sock"
|
|
136
|
+
self._server = await asyncio.start_unix_server(self._connection, path=path)
|
|
137
|
+
path.chmod(0o600)
|
|
138
|
+
return self._root / "host.sock"
|
|
139
|
+
|
|
140
|
+
async def confirm_core_ready(self) -> None:
|
|
141
|
+
"""Called by the trusted supervisor only after actual Core health passes."""
|
|
142
|
+
async with self._lock:
|
|
143
|
+
if self._closed:
|
|
144
|
+
raise CompanionError("COMPANION_CLOSED")
|
|
145
|
+
for value in self._companions.values():
|
|
146
|
+
if set(value.connections) != set(value.definition.components):
|
|
147
|
+
raise CompanionError("COMPANION_GRAPH_NOT_READY")
|
|
148
|
+
self._healthy = True
|
|
149
|
+
try:
|
|
150
|
+
for value in self._companions.values():
|
|
151
|
+
await self._start(value)
|
|
152
|
+
except BaseException:
|
|
153
|
+
self._healthy = False
|
|
154
|
+
for value in self._companions.values():
|
|
155
|
+
await self._stop(value)
|
|
156
|
+
raise
|
|
157
|
+
|
|
158
|
+
def issue_invocation(
|
|
159
|
+
self,
|
|
160
|
+
plugin_id: str,
|
|
161
|
+
principal: Any,
|
|
162
|
+
*,
|
|
163
|
+
operations: frozenset[str],
|
|
164
|
+
ttl_seconds: float = 60,
|
|
165
|
+
) -> str:
|
|
166
|
+
value = self._companions.get(plugin_id)
|
|
167
|
+
if self._closed or not self._healthy or value is None or not value.running:
|
|
168
|
+
raise CompanionError("COMPANION_UNAVAILABLE")
|
|
169
|
+
if (
|
|
170
|
+
not operations
|
|
171
|
+
or not operations <= value.definition.operations
|
|
172
|
+
or not 0 < ttl_seconds <= 120
|
|
173
|
+
):
|
|
174
|
+
raise CompanionError("COMPANION_GRANT_INVALID")
|
|
175
|
+
now = time.monotonic()
|
|
176
|
+
self._grants = {key: grant for key, grant in self._grants.items() if grant.expires_at > now}
|
|
177
|
+
if len(self._grants) >= 1024:
|
|
178
|
+
raise CompanionError("COMPANION_BUSY")
|
|
179
|
+
handle = secrets.token_urlsafe(32)
|
|
180
|
+
self._grants[handle] = _Grant(plugin_id, principal, operations, now + ttl_seconds)
|
|
181
|
+
return handle
|
|
182
|
+
|
|
183
|
+
def revoke_invocation(self, handle: str) -> None:
|
|
184
|
+
self._grants.pop(handle, None)
|
|
185
|
+
|
|
186
|
+
async def _start(self, value: _Companion) -> None:
|
|
187
|
+
if (
|
|
188
|
+
not value.running
|
|
189
|
+
and self._healthy
|
|
190
|
+
and set(value.connections) == set(value.definition.components)
|
|
191
|
+
):
|
|
192
|
+
try:
|
|
193
|
+
if value.definition.bind_artifact is not None:
|
|
194
|
+
bound = value.definition.bind_artifact(
|
|
195
|
+
self._artifacts[value.definition.plugin_id]
|
|
196
|
+
)
|
|
197
|
+
if inspect.isawaitable(bound):
|
|
198
|
+
await bound
|
|
199
|
+
await _call(value.definition.start)
|
|
200
|
+
except BaseException:
|
|
201
|
+
await _call(value.definition.revoke)
|
|
202
|
+
await _call(value.definition.close)
|
|
203
|
+
raise
|
|
204
|
+
value.running = True
|
|
205
|
+
|
|
206
|
+
async def _stop(self, value: _Companion) -> None:
|
|
207
|
+
plugin_id = value.definition.plugin_id
|
|
208
|
+
self._grants = {
|
|
209
|
+
key: grant for key, grant in self._grants.items() if grant.plugin_id != plugin_id
|
|
210
|
+
}
|
|
211
|
+
if value.running:
|
|
212
|
+
value.running = False
|
|
213
|
+
# Revoke host dispatch and tool authority before closing the domain.
|
|
214
|
+
try:
|
|
215
|
+
await _call(value.definition.revoke)
|
|
216
|
+
finally:
|
|
217
|
+
for task, owner in tuple(self._pending.items()):
|
|
218
|
+
if owner == plugin_id and task is not asyncio.current_task():
|
|
219
|
+
task.cancel()
|
|
220
|
+
await _call(value.definition.close)
|
|
221
|
+
|
|
222
|
+
async def close(self) -> None:
|
|
223
|
+
async with self._lock:
|
|
224
|
+
if self._closed:
|
|
225
|
+
return
|
|
226
|
+
self._closed = True
|
|
227
|
+
self._healthy = False
|
|
228
|
+
try:
|
|
229
|
+
for value in self._companions.values():
|
|
230
|
+
await self._stop(value)
|
|
231
|
+
finally:
|
|
232
|
+
if self._server:
|
|
233
|
+
self._server.close()
|
|
234
|
+
for writer in tuple(self._connections):
|
|
235
|
+
writer.close()
|
|
236
|
+
if self._server:
|
|
237
|
+
await self._server.wait_closed()
|
|
238
|
+
self._grants.clear()
|
|
239
|
+
if self._root:
|
|
240
|
+
shutil.rmtree(self._root, ignore_errors=True)
|
|
241
|
+
|
|
242
|
+
async def _read(self, reader: asyncio.StreamReader) -> dict[str, Any]:
|
|
243
|
+
size = int.from_bytes(await reader.readexactly(4), "big")
|
|
244
|
+
if not 0 < size <= _MAX_BYTES:
|
|
245
|
+
raise CompanionError("COMPANION_REQUEST_INVALID")
|
|
246
|
+
raw = await reader.readexactly(size)
|
|
247
|
+
value = json.loads(
|
|
248
|
+
raw.decode("utf-8"),
|
|
249
|
+
object_pairs_hook=_object,
|
|
250
|
+
parse_constant=lambda _value: (_ for _ in ()).throw(ValueError()),
|
|
251
|
+
)
|
|
252
|
+
if not isinstance(value, dict) or value.get("v") != 1:
|
|
253
|
+
raise CompanionError("COMPANION_REQUEST_INVALID")
|
|
254
|
+
return value
|
|
255
|
+
|
|
256
|
+
async def _write(self, writer: asyncio.StreamWriter, value: dict[str, Any]) -> None:
|
|
257
|
+
body = json.dumps(
|
|
258
|
+
value, ensure_ascii=False, allow_nan=False, separators=(",", ":")
|
|
259
|
+
).encode()
|
|
260
|
+
if len(body) > _MAX_BYTES:
|
|
261
|
+
raise CompanionError("COMPANION_RESPONSE_INVALID")
|
|
262
|
+
writer.write(len(body).to_bytes(4, "big") + body)
|
|
263
|
+
await writer.drain()
|
|
264
|
+
|
|
265
|
+
async def _connection(self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None:
|
|
266
|
+
component: str | None = None
|
|
267
|
+
companion: _Companion | None = None
|
|
268
|
+
request_id = ""
|
|
269
|
+
if len(self._connections) >= 128 or self._closed:
|
|
270
|
+
writer.close()
|
|
271
|
+
return
|
|
272
|
+
self._connections.add(writer)
|
|
273
|
+
try:
|
|
274
|
+
request = await asyncio.wait_for(self._read(reader), timeout=5)
|
|
275
|
+
request_id = request.get("requestId")
|
|
276
|
+
if not isinstance(request_id, str) or not 1 <= len(request_id) <= 128:
|
|
277
|
+
raise CompanionError("COMPANION_REQUEST_INVALID")
|
|
278
|
+
companion = self._companions.get(request.get("pluginId"))
|
|
279
|
+
if companion is None:
|
|
280
|
+
raise CompanionError("COMPANION_UNAVAILABLE")
|
|
281
|
+
if request.get("type") == "register":
|
|
282
|
+
component = request.get("component")
|
|
283
|
+
if (
|
|
284
|
+
request.get("generationId") != self.generation_id
|
|
285
|
+
or not isinstance(request.get("secret"), str)
|
|
286
|
+
or not secrets.compare_digest(request["secret"], self._secret)
|
|
287
|
+
or component not in companion.definition.components
|
|
288
|
+
):
|
|
289
|
+
component = None
|
|
290
|
+
raise CompanionError("COMPANION_REGISTRATION_INVALID")
|
|
291
|
+
async with self._lock:
|
|
292
|
+
if component in companion.connections:
|
|
293
|
+
component = None
|
|
294
|
+
raise CompanionError("COMPANION_COMPONENT_DUPLICATE")
|
|
295
|
+
companion.connections[component] = writer
|
|
296
|
+
await self._start(companion)
|
|
297
|
+
await self._write(
|
|
298
|
+
writer, {"v": 1, "requestId": request_id, "result": {"registered": True}}
|
|
299
|
+
)
|
|
300
|
+
# A live connection is the component's lifecycle lease. Any
|
|
301
|
+
# data or EOF retires it; no caller-controlled heartbeat state.
|
|
302
|
+
await reader.read(1)
|
|
303
|
+
elif request.get("type") == "invoke":
|
|
304
|
+
operation = request.get("operation")
|
|
305
|
+
grant = self._grants.get(request.get("handle"))
|
|
306
|
+
arguments = request.get("arguments")
|
|
307
|
+
deadline = request.get("deadline")
|
|
308
|
+
call_id = request.get("callId")
|
|
309
|
+
if (
|
|
310
|
+
not self._healthy
|
|
311
|
+
or not companion.running
|
|
312
|
+
or grant is None
|
|
313
|
+
or grant.plugin_id != companion.definition.plugin_id
|
|
314
|
+
or grant.expires_at <= time.monotonic()
|
|
315
|
+
or operation not in grant.operations
|
|
316
|
+
):
|
|
317
|
+
raise CompanionError("COMPANION_INVOCATION_DENIED")
|
|
318
|
+
if (
|
|
319
|
+
not isinstance(arguments, dict)
|
|
320
|
+
or not isinstance(call_id, str)
|
|
321
|
+
or not 1 <= len(call_id) <= 128
|
|
322
|
+
or isinstance(deadline, bool)
|
|
323
|
+
or not isinstance(deadline, int)
|
|
324
|
+
or deadline <= time.time() * 1000
|
|
325
|
+
or deadline > time.time() * 1000 + 120_000
|
|
326
|
+
):
|
|
327
|
+
raise CompanionError("COMPANION_REQUEST_INVALID")
|
|
328
|
+
task = asyncio.current_task()
|
|
329
|
+
assert task is not None
|
|
330
|
+
self._pending[task] = companion.definition.plugin_id
|
|
331
|
+
result = companion.definition.invoke(
|
|
332
|
+
grant.principal, operation, arguments, call_id
|
|
333
|
+
)
|
|
334
|
+
if inspect.isawaitable(result):
|
|
335
|
+
result = await asyncio.wait_for(
|
|
336
|
+
result,
|
|
337
|
+
timeout=min(
|
|
338
|
+
grant.expires_at - time.monotonic(), deadline / 1000 - time.time()
|
|
339
|
+
),
|
|
340
|
+
)
|
|
341
|
+
if not isinstance(result, dict):
|
|
342
|
+
raise CompanionError("COMPANION_RESPONSE_INVALID")
|
|
343
|
+
await self._write(writer, {"v": 1, "requestId": request_id, "result": result})
|
|
344
|
+
else:
|
|
345
|
+
raise CompanionError("COMPANION_REQUEST_INVALID")
|
|
346
|
+
except asyncio.CancelledError:
|
|
347
|
+
raise
|
|
348
|
+
except Exception as error:
|
|
349
|
+
code = error.code if isinstance(error, CompanionError) else "COMPANION_REQUEST_FAILED"
|
|
350
|
+
try:
|
|
351
|
+
await self._write(
|
|
352
|
+
writer, {"v": 1, "requestId": request_id, "error": {"code": code}}
|
|
353
|
+
)
|
|
354
|
+
except Exception:
|
|
355
|
+
pass
|
|
356
|
+
finally:
|
|
357
|
+
self._pending.pop(asyncio.current_task(), None)
|
|
358
|
+
if companion is not None and component is not None:
|
|
359
|
+
async with self._lock:
|
|
360
|
+
if companion.connections.get(component) is writer:
|
|
361
|
+
companion.connections.pop(component)
|
|
362
|
+
await self._stop(companion)
|
|
363
|
+
self._connections.discard(writer)
|
|
364
|
+
writer.close()
|
|
365
|
+
try:
|
|
366
|
+
await writer.wait_closed()
|
|
367
|
+
except (ConnectionError, OSError):
|
|
368
|
+
pass
|
ksadk/plugins/contracts.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Frozen source contracts and internal records for plugin composition.
|
|
2
2
|
|
|
3
|
-
Only the models exported through ``__all__`` are public
|
|
3
|
+
Only the models exported through ``__all__`` are public Release contracts.
|
|
4
4
|
``PluginManifest`` and its supporting models are internal admission records:
|
|
5
5
|
they project DSH/Codex host inventory into the Python composition engine and
|
|
6
6
|
are not a third installable package format or a stable public contract.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"""Wheel-owned DSH bundle for the Studio Channel workspace page."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import os
|
|
7
|
+
import tempfile
|
|
8
|
+
from collections.abc import Sequence
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
from ksadk.plugins.bridges.dsh import DshProfilePluginBridge
|
|
13
|
+
from ksadk.plugins.dsh_home import prepare_studio_dsh_home
|
|
14
|
+
|
|
15
|
+
CHANNEL_PLUGIN_PACKAGE = "@kingsoftcloud/dsh-channels-client"
|
|
16
|
+
CHANNEL_PLUGIN_VERSION = "0.1.0"
|
|
17
|
+
_MARKER_NAME = ".ksadk-channel-default.json"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _marker_path(dsh_home: Path) -> Path:
|
|
21
|
+
return dsh_home / "profiles" / "web" / _MARKER_NAME
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _read_marker(path: Path) -> dict[str, Any]:
|
|
25
|
+
try:
|
|
26
|
+
value = json.loads(path.read_text(encoding="utf-8"))
|
|
27
|
+
except (OSError, UnicodeError, json.JSONDecodeError):
|
|
28
|
+
return {}
|
|
29
|
+
return value if isinstance(value, dict) else {}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _write_marker(path: Path, *, disabled: bool) -> None:
|
|
33
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
34
|
+
fd, temporary = tempfile.mkstemp(prefix=f".{path.name}.", dir=path.parent)
|
|
35
|
+
try:
|
|
36
|
+
with os.fdopen(fd, "w", encoding="utf-8") as stream:
|
|
37
|
+
json.dump(
|
|
38
|
+
{"schemaVersion": 1, "defaultApplied": True, "defaultDisabled": disabled},
|
|
39
|
+
stream,
|
|
40
|
+
)
|
|
41
|
+
stream.write("\n")
|
|
42
|
+
os.replace(temporary, path)
|
|
43
|
+
except BaseException:
|
|
44
|
+
try:
|
|
45
|
+
os.unlink(temporary)
|
|
46
|
+
except OSError:
|
|
47
|
+
pass
|
|
48
|
+
raise
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def channel_default_bootstrap_needed(dsh_home: Path) -> bool:
|
|
52
|
+
"""Return whether the Studio-owned default has not reached a terminal state."""
|
|
53
|
+
marker = _read_marker(_marker_path(dsh_home))
|
|
54
|
+
return not marker.get("defaultApplied") and not marker.get("defaultDisabled")
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def channel_workspace_contributions(
|
|
58
|
+
dsh_home: Path, profile_name: str = "web"
|
|
59
|
+
) -> list[dict[str, Any]]:
|
|
60
|
+
"""Read enabled client contributions without starting DSH Core."""
|
|
61
|
+
profile_root = dsh_home / "profiles" / profile_name
|
|
62
|
+
try:
|
|
63
|
+
profile = json.loads((profile_root / "package.json").read_text(encoding="utf-8"))
|
|
64
|
+
config = profile.get("dsh", {}).get("profile", {})
|
|
65
|
+
bundles = config.get("bundles", [])
|
|
66
|
+
package_path = (
|
|
67
|
+
profile_root
|
|
68
|
+
/ "node_modules"
|
|
69
|
+
/ "@kingsoftcloud"
|
|
70
|
+
/ "dsh-channels-client"
|
|
71
|
+
/ "package.json"
|
|
72
|
+
)
|
|
73
|
+
package = json.loads(package_path.read_text(encoding="utf-8"))
|
|
74
|
+
except (OSError, UnicodeError, json.JSONDecodeError, AttributeError):
|
|
75
|
+
return []
|
|
76
|
+
if (
|
|
77
|
+
not isinstance(bundles, list)
|
|
78
|
+
or not isinstance(package, dict)
|
|
79
|
+
or CHANNEL_PLUGIN_PACKAGE not in bundles
|
|
80
|
+
or package.get("name") != CHANNEL_PLUGIN_PACKAGE
|
|
81
|
+
):
|
|
82
|
+
return []
|
|
83
|
+
return [
|
|
84
|
+
{"id": "channels", "label": "消息渠道", "pluginId": CHANNEL_PLUGIN_PACKAGE, "order": 45}
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def configure_channel_profile(
|
|
89
|
+
*,
|
|
90
|
+
workspace: Path,
|
|
91
|
+
dsh_home: Path,
|
|
92
|
+
dsh_command: Sequence[str],
|
|
93
|
+
enabled: bool = True,
|
|
94
|
+
) -> dict[str, Any]:
|
|
95
|
+
"""Install/enable the Studio Channel UI in one validated Profile transaction.
|
|
96
|
+
|
|
97
|
+
This helper intentionally owns only the client bundle. The channel API and
|
|
98
|
+
connector remain Studio/SDK responsibilities, so loading the DSH bundle does
|
|
99
|
+
not create a second channel service or Core.
|
|
100
|
+
"""
|
|
101
|
+
prepare_studio_dsh_home(dsh_home)
|
|
102
|
+
marker = _marker_path(dsh_home)
|
|
103
|
+
marker_payload = _read_marker(marker)
|
|
104
|
+
if enabled and marker_payload.get("defaultDisabled") is True:
|
|
105
|
+
return {"profile": "web", "enabled": False, "skipped": "explicitly_disabled"}
|
|
106
|
+
with DshProfilePluginBridge(
|
|
107
|
+
dsh_home=dsh_home,
|
|
108
|
+
profile="web",
|
|
109
|
+
dsh_command=dsh_command,
|
|
110
|
+
cwd=workspace,
|
|
111
|
+
) as bridge:
|
|
112
|
+
result: dict[str, Any] | None = None
|
|
113
|
+
with bridge._profile_transaction(exclusive=True):
|
|
114
|
+
snapshot = bridge._snapshot()
|
|
115
|
+
try:
|
|
116
|
+
installed = {item.name: item for item in bridge.list_plugins()}
|
|
117
|
+
current = installed.get(CHANNEL_PLUGIN_PACKAGE)
|
|
118
|
+
if enabled:
|
|
119
|
+
# A user-disabled or uninstalled bundle is an explicit
|
|
120
|
+
# choice; the default bootstrap must never undo it.
|
|
121
|
+
if current is None and marker_payload.get("defaultApplied") is True:
|
|
122
|
+
return {"profile": "web", "enabled": False, "skipped": "explicitly_removed"}
|
|
123
|
+
if current is not None and not current.enabled:
|
|
124
|
+
_write_marker(marker, disabled=True)
|
|
125
|
+
return {
|
|
126
|
+
"profile": "web",
|
|
127
|
+
"enabled": False,
|
|
128
|
+
"skipped": "explicitly_disabled",
|
|
129
|
+
}
|
|
130
|
+
if current is not None and current.enabled:
|
|
131
|
+
_write_marker(marker, disabled=False)
|
|
132
|
+
return {"profile": "web", "enabled": True, "skipped": "already_enabled"}
|
|
133
|
+
if current is None:
|
|
134
|
+
source = (
|
|
135
|
+
Path(__file__).parent / "providers" / "bundles" / "dsh-channels-client"
|
|
136
|
+
)
|
|
137
|
+
current = bridge.install_plugin(str(source), accept_host_permissions=True)
|
|
138
|
+
if (
|
|
139
|
+
current.name != CHANNEL_PLUGIN_PACKAGE
|
|
140
|
+
or current.version != CHANNEL_PLUGIN_VERSION
|
|
141
|
+
):
|
|
142
|
+
raise ValueError("unsupported Channel client bundle")
|
|
143
|
+
bridge.set_enabled(CHANNEL_PLUGIN_PACKAGE, enabled=True)
|
|
144
|
+
elif current is not None:
|
|
145
|
+
bridge.set_enabled(CHANNEL_PLUGIN_PACKAGE, enabled=False)
|
|
146
|
+
projection = bridge.project_profile()
|
|
147
|
+
result = {
|
|
148
|
+
"profile": "web",
|
|
149
|
+
"enabled": enabled,
|
|
150
|
+
"profileDigest": projection.config_digest,
|
|
151
|
+
}
|
|
152
|
+
except BaseException as error:
|
|
153
|
+
bridge._rollback(snapshot, error)
|
|
154
|
+
raise
|
|
155
|
+
_write_marker(marker, disabled=not enabled)
|
|
156
|
+
return result or {"profile": "web", "enabled": enabled}
|