agentengine-sdk-python 0.8.1__py3-none-any.whl → 0.8.3__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.1.dist-info → agentengine_sdk_python-0.8.3.dist-info}/METADATA +25 -12
- {agentengine_sdk_python-0.8.1.dist-info → agentengine_sdk_python-0.8.3.dist-info}/RECORD +421 -232
- ksadk/_build_provenance.json +1 -0
- ksadk/a2a/_space_client_events.py +381 -0
- ksadk/a2a/event_adapter.py +156 -64
- ksadk/a2a/executor.py +179 -63
- ksadk/a2a/space_client.py +6 -333
- ksadk/a2ui/core.py +222 -53
- ksadk/agui/_agent_helpers.py +247 -0
- ksadk/agui/a2ui_projection.py +12 -5
- ksadk/agui/agent.py +443 -259
- ksadk/api/client.py +528 -27
- ksadk/builders/code_builder.py +284 -8
- ksadk/builders/container_builder.py +8 -1
- ksadk/builders/managed_runtime_builder.py +42 -35
- ksadk/cli/__init__.py +23 -0
- ksadk/cli/cmd_dashboard.py +15 -1
- ksadk/cli/cmd_deploy.py +10 -2
- ksadk/cli/cmd_eval.py +66 -9
- ksadk/cli/cmd_evalset.py +284 -0
- ksadk/cli/cmd_files.py +5 -1
- ksadk/cli/cmd_hermes.py +1 -126
- ksadk/cli/cmd_invoke.py +28 -38
- ksadk/cli/cmd_managed_runtime.py +95 -0
- ksadk/cli/cmd_observe.py +85 -0
- ksadk/cli/cmd_openclaw.py +1 -435
- ksadk/cli/cmd_plugin.py +657 -0
- ksadk/cli/cmd_replay.py +28 -4
- ksadk/cli/cmd_studio.py +99 -8
- ksadk/cli/cmd_web.py +10 -2
- ksadk/cli/hermes_env.py +151 -0
- ksadk/cli/invoke_payload.py +49 -0
- ksadk/cli/openclaw_env.py +458 -0
- ksadk/codex/client.py +180 -30
- ksadk/codex/runtime.py +475 -331
- ksadk/configs/env_registry.py +94 -12
- ksadk/configs/env_registry_pcm.py +181 -0
- ksadk/configs/env_var_spec.py +18 -0
- ksadk/configs/global_config.py +5 -0
- ksadk/configs/settings.py +9 -0
- ksadk/context_engine/__init__.py +98 -0
- ksadk/context_engine/assembler.py +176 -0
- ksadk/context_engine/baseline.py +419 -0
- ksadk/context_engine/cache_observability.py +228 -0
- ksadk/context_engine/capabilities.py +443 -0
- ksadk/context_engine/contributors.py +409 -0
- ksadk/context_engine/hosted_pipeline.py +417 -0
- ksadk/context_engine/models.py +117 -0
- ksadk/context_engine/planner.py +698 -0
- ksadk/context_engine/policies.py +319 -0
- ksadk/context_engine/projection.py +31 -0
- ksadk/context_engine/shadow_plan.py +266 -0
- ksadk/context_engine/tokenizer.py +164 -0
- ksadk/conversations/__init__.py +19 -0
- ksadk/conversations/context.py +230 -30
- ksadk/conversations/contracts.py +266 -0
- ksadk/conversations/message_projection.py +308 -26
- ksadk/conversations/model_context.py +49 -3
- ksadk/conversations/projector.py +616 -0
- ksadk/conversations/reducer.py +98 -0
- ksadk/conversations/runtime_compaction.py +207 -5
- ksadk/conversations/runtime_input.py +184 -2
- ksadk/conversations/runtime_invocation.py +81 -3
- ksadk/conversations/runtime_observability.py +141 -0
- ksadk/conversations/runtime_payloads.py +42 -0
- ksadk/conversations/runtime_preparation.py +272 -2
- ksadk/conversations/runtime_resume.py +20 -1
- ksadk/conversations/runtime_stream_events.py +94 -9
- ksadk/conversations/semantic_summary.py +311 -1
- ksadk/conversations/session_lock.py +51 -0
- ksadk/deployment/env_forward.py +72 -0
- ksadk/deployment/managed_runtime.py +5 -0
- ksadk/deployment/providers/serverless.py +143 -69
- ksadk/evaluation/__init__.py +32 -0
- ksadk/evaluation/a2a_adapter.py +9 -1
- ksadk/evaluation/adapters.py +18 -5
- ksadk/evaluation/agent_eval_client.py +395 -0
- ksadk/evaluation/cloud_binding.py +80 -0
- ksadk/evaluation/cloud_converter.py +194 -0
- ksadk/evaluation/cloud_service.py +199 -0
- ksadk/evaluation/contracts.py +73 -4
- ksadk/evaluation/evaluators.py +183 -17
- ksadk/evaluation/evidence.py +258 -0
- ksadk/evaluation/executor.py +31 -6
- ksadk/evaluation/local_adapter.py +550 -0
- ksadk/evaluation/service_env.py +27 -0
- ksadk/evaluation/studio_build_adapter.py +253 -0
- ksadk/evaluation/target.py +15 -6
- ksadk/events/__init__.py +13 -13
- ksadk/events/_v1_compat/__init__.py +1 -0
- ksadk/events/_v1_compat/models.py +299 -0
- ksadk/events/_v1_compat/parser.py +247 -0
- ksadk/events/_v1_compat/projection.py +755 -0
- ksadk/events/adapters/__init__.py +34 -0
- ksadk/events/adapters/_a2a_snapshot.py +622 -0
- ksadk/events/adapters/_a2a_support.py +275 -0
- ksadk/events/adapters/_codex_interactions.py +375 -0
- ksadk/events/adapters/_codex_items.py +801 -0
- ksadk/events/adapters/_codex_validators.py +311 -0
- ksadk/events/adapters/_langgraph_support.py +785 -0
- ksadk/events/adapters/a2a.py +841 -0
- ksadk/events/adapters/adk.py +503 -0
- ksadk/events/adapters/codex.py +907 -0
- ksadk/events/adapters/langgraph.py +745 -0
- ksadk/events/canonical.py +440 -0
- ksadk/events/canonical_replay.py +497 -0
- ksadk/events/canonical_store.py +468 -0
- ksadk/events/cold_recovery.py +257 -0
- ksadk/events/content.py +89 -0
- ksadk/events/identity.py +86 -0
- ksadk/events/pipeline.py +455 -0
- ksadk/events/projections.py +66 -0
- ksadk/events/reducer.py +661 -0
- ksadk/events/replay.py +3 -36
- ksadk/events/runtime_event.py +20 -265
- ksadk/events/session_event.py +324 -0
- ksadk/events/store.py +3 -316
- ksadk/events/v1_compat.py +41 -0
- ksadk/harness/__init__.py +45 -35
- ksadk/harness/runtime.py +220 -58
- ksadk/identity/resolver.py +4 -3
- ksadk/interaction/__init__.py +28 -0
- ksadk/interaction/contracts.py +136 -0
- ksadk/interaction/ledger.py +189 -0
- ksadk/interaction/provider.py +122 -0
- ksadk/interaction/providers/__init__.py +52 -0
- ksadk/interaction/providers/adk.py +40 -0
- ksadk/interaction/providers/codex.py +94 -0
- ksadk/interaction/providers/langgraph.py +58 -0
- ksadk/kernel/__init__.py +117 -0
- ksadk/kernel/authorization.py +258 -0
- ksadk/kernel/bootstrap.py +1074 -0
- ksadk/kernel/contract_fingerprints.py +62 -0
- ksadk/kernel/contracts.py +370 -0
- ksadk/kernel/control.py +220 -0
- ksadk/kernel/errors.py +79 -0
- ksadk/kernel/ingress.py +1123 -0
- ksadk/kernel/mapping.py +111 -0
- ksadk/kernel/memory_store.py +1134 -0
- ksadk/kernel/postgres_store.py +1757 -0
- ksadk/kernel/recovery.py +452 -0
- ksadk/kernel/runtime_identity.py +103 -0
- ksadk/kernel/sql/001_agent_kernel.sql +120 -0
- ksadk/kernel/sqlite_store.py +1411 -0
- ksadk/kernel/state.py +145 -0
- ksadk/kernel/store.py +232 -0
- ksadk/kernel/worker.py +964 -0
- ksadk/knowledge_base/client.py +7 -0
- ksadk/knowledge_base/service.py +32 -5
- ksadk/memory/__init__.py +61 -0
- ksadk/memory/adk/backends/base_ltm_backend.py +96 -1
- ksadk/memory/adk/backends/http_ltm_backend.py +14 -5
- ksadk/memory/adk/backends/inmemory_ltm_backend.py +136 -3
- ksadk/memory/adk/backends/sdk_ltm_backend.py +384 -2
- ksadk/memory/adk/backends/sqlite_ltm_backend.py +95 -0
- ksadk/memory/coordinator.py +461 -0
- ksadk/memory/events.py +202 -0
- ksadk/memory/extraction.py +228 -0
- ksadk/memory/ltm_backend_factory.py +16 -3
- ksadk/memory/models.py +316 -0
- ksadk/memory/policy.py +215 -0
- ksadk/memory/provider.py +47 -0
- ksadk/memory/provider_adapter.py +159 -0
- ksadk/memory/provider_resolver.py +71 -0
- ksadk/memory/providers/__init__.py +5 -0
- ksadk/memory/providers/local_sqlite.py +497 -0
- ksadk/memory/resolved_policy.py +145 -0
- ksadk/memory/service.py +188 -6
- ksadk/model_proxy/bootstrap.py +16 -9
- ksadk/model_proxy/detect.py +202 -9
- ksadk/model_proxy/namespace.py +39 -15
- ksadk/model_proxy/server.py +24 -5
- ksadk/model_proxy/transform.py +60 -2
- ksadk/observability/__init__.py +25 -0
- ksadk/observability/session_log.py +420 -0
- ksadk/observability/trajectory.py +105 -0
- ksadk/plugins/__init__.py +167 -0
- ksadk/plugins/bridges/__init__.py +45 -0
- ksadk/plugins/bridges/codex.py +552 -0
- ksadk/plugins/bridges/dsh.py +1116 -0
- ksadk/plugins/builtins.py +747 -0
- ksadk/plugins/bundle.py +246 -0
- ksadk/plugins/bundle_security.py +167 -0
- ksadk/plugins/composition.py +529 -0
- ksadk/plugins/context_contributor.py +437 -0
- ksadk/plugins/contracts.py +451 -0
- ksadk/plugins/dsh_toolchain.py +935 -0
- ksadk/plugins/ecosystem_bridge.py +1105 -0
- ksadk/plugins/ecosystem_probe.py +191 -0
- ksadk/plugins/host.py +724 -0
- ksadk/plugins/providers/__init__.py +85 -0
- ksadk/plugins/providers/bundles/ksadk-codex/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/ksadk-codex/index.mjs +18 -0
- ksadk/plugins/providers/bundles/ksadk-codex/package.json +19 -0
- ksadk/plugins/providers/bundles/ksadk-harness/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/ksadk-harness/index.mjs +19 -0
- ksadk/plugins/providers/bundles/ksadk-harness/package.json +19 -0
- ksadk/plugins/providers/codex.py +722 -0
- ksadk/plugins/providers/codex_dsh.py +83 -0
- ksadk/plugins/providers/dsh.py +951 -0
- ksadk/plugins/providers/dsh_descriptor_host.py +226 -0
- ksadk/plugins/providers/harness.py +627 -0
- ksadk/plugins/providers/harness_dsh.py +91 -0
- ksadk/plugins/providers/legacy.py +215 -0
- ksadk/plugins/providers/legacy_catalog.py +100 -0
- ksadk/plugins/providers/shipped_dsh.py +370 -0
- ksadk/plugins/resolver.py +331 -0
- ksadk/plugins/subagent_providers/__init__.py +12 -0
- ksadk/plugins/subagent_providers/codex.py +443 -0
- ksadk/plugins/subagents.py +333 -0
- ksadk/prompts/__init__.py +71 -0
- ksadk/prompts/compiler.py +215 -0
- ksadk/prompts/models.py +82 -0
- ksadk/prompts/projection.py +89 -0
- ksadk/prompts/resolved.py +137 -0
- ksadk/prompts/sources.py +233 -0
- ksadk/runners/_langgraph_runner_streams.py +822 -0
- ksadk/runners/adk_runner.py +5 -5
- ksadk/runners/base_runner.py +16 -0
- ksadk/runners/factory.py +1 -2
- ksadk/runners/langgraph_runner.py +198 -437
- ksadk/runtime/_runner_adapter/__init__.py +1 -0
- ksadk/runtime/_runner_adapter/stream_mapping.py +797 -0
- ksadk/runtime/adapter.py +119 -2
- ksadk/runtime/conversation_execution.py +316 -182
- ksadk/runtime/executor.py +144 -3
- ksadk/runtime/factory.py +268 -8
- ksadk/runtime/framework_adapters.py +18 -0
- ksadk/runtime/hosted_finalizer.py +268 -0
- ksadk/runtime/launch.py +14 -1
- ksadk/runtime/preprocessing.py +25 -3
- ksadk/runtime/runner_adapter.py +293 -508
- ksadk/runtime/usage.py +33 -0
- ksadk/sandbox/__init__.py +2 -1
- ksadk/sandbox/backends/e2b.py +35 -2
- ksadk/sandbox/factory.py +72 -0
- ksadk/scheduler/__init__.py +18 -0
- ksadk/scheduler/calendar.py +102 -0
- ksadk/scheduler/contracts.py +254 -0
- ksadk/scheduler/dispatcher.py +129 -0
- ksadk/scheduler/engine.py +416 -0
- ksadk/scheduler/sqlite_store.py +563 -0
- ksadk/server/composition.py +8 -0
- ksadk/server/factory.py +69 -6
- ksadk/server/routes/kernel_ingress.py +258 -0
- ksadk/server/routes/openai_compat.py +88 -8
- ksadk/server/routes/projection.py +35 -20
- ksadk/server/routes/run.py +94 -0
- ksadk/server/routes/sessions.py +2 -0
- ksadk/server/routes/streaming.py +5 -2
- ksadk/server/static/assets/{ArtifactsPanel-CakCqxEN.js → ArtifactsPanel-10GPXIJ6.js} +1 -1
- ksadk/server/static/assets/{CodeBlock-CynLknyO.js → CodeBlock-BXk1l-G1.js} +4 -4
- ksadk/server/static/assets/MathMessageMarkdown-BorAY7qD.css +1 -0
- ksadk/server/static/assets/{MathMessageMarkdown-3sQdOysS.js → MathMessageMarkdown-D9uB55Oh.js} +4 -4
- ksadk/server/static/assets/MermaidBlock--OEYoXIJ.js +312 -0
- ksadk/server/static/assets/NativeTerminalPanel-DrEe1syq.js +1 -0
- ksadk/server/static/assets/abnfDiagram-VCTEODGH-eeTFJLvo.js +1 -0
- ksadk/server/static/assets/arc-S3ZNbIAd.js +1 -0
- ksadk/server/static/assets/architecture-7GRP2DOG-Dk9nRQ6-.js +1 -0
- ksadk/server/static/assets/architectureDiagram-5GKGNRK7-CRjgEJDX.js +36 -0
- ksadk/server/static/assets/blockDiagram-NRAW4CY4-C7bsBoNH.js +129 -0
- ksadk/server/static/assets/c4Diagram-UCG6FXSJ-BX3c33Ob.js +38 -0
- ksadk/server/static/assets/channel-s354Yo6o.js +1 -0
- ksadk/server/static/assets/chunk-2Q5K7J3B-CDpPpKR5.js +1 -0
- ksadk/server/static/assets/{chunk-FMBD7UC4-B_fH2YuH.js → chunk-5VM5RSS4-bZ7ws-8m.js} +1 -1
- ksadk/server/static/assets/{chunk-ND2GUHAM-D6rFLaVV.js → chunk-F27PBJKO-D2r0pvhY.js} +1 -1
- ksadk/server/static/assets/chunk-G27WJ6UU-CZwF3oUP.js +231 -0
- ksadk/server/static/assets/{chunk-4BX2VUAB-B9drTgOW.js → chunk-JWPE2WC7-DigFYCML.js} +1 -1
- ksadk/server/static/assets/chunk-LCL6LL3I-CnorGV5q.js +206 -0
- ksadk/server/static/assets/chunk-POPQ4Y6H-CexntQA-.js +1 -0
- ksadk/server/static/assets/chunk-RHFEMEQ7-CHTC7UxA.js +168 -0
- ksadk/server/static/assets/chunk-SVP7TREG-BC1EWt_-.js +88 -0
- ksadk/server/static/assets/chunk-XXDRQBXY-BTG24xN0.js +1 -0
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-Dd0nucl9.js +1 -0
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-Dd0nucl9.js +1 -0
- ksadk/server/static/assets/{cose-bilkent-S5V4N54A-ChNs_Mdk.js → cose-bilkent-JH36ORCC-CkonRdAS.js} +1 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-BBlT4uMf.js +1 -0
- ksadk/server/static/assets/cynefinDiagram-5FMLGOSQ-DEOCBe15.js +62 -0
- ksadk/server/static/assets/cytoscape.esm-CyCl8rPi.js +321 -0
- ksadk/server/static/assets/dagre-3AP2YEHR-DBThPuLa.js +4 -0
- ksadk/server/static/assets/dagre-ClTPrTht.js +1 -0
- ksadk/server/static/assets/diagram-S7CK7UJ4-DsZHrnpJ.js +30 -0
- ksadk/server/static/assets/diagram-UQ7AKVKN-BJR4nhVr.js +41 -0
- ksadk/server/static/assets/diagram-VSXAHHWV-xzcERX0a.js +3 -0
- ksadk/server/static/assets/diagram-VX7I27RA-tn2xM1xu.js +24 -0
- ksadk/server/static/assets/diagram-Z3DM3KII-BZPGBkw5.js +24 -0
- ksadk/server/static/assets/{dist-gLnrGsoU.js → dist-4zN1_tq5.js} +1 -1
- ksadk/server/static/assets/{dist-C1sz5Eo3.js → dist-8VWI-2bZ.js} +1 -1
- ksadk/server/static/assets/{dist-BjOdlDjj.js → dist-B-46q3Hk.js} +1 -1
- ksadk/server/static/assets/{dist-o2OVmKvt.js → dist-B0gdk4rl.js} +1 -1
- ksadk/server/static/assets/{dist-4N2NMVYg.js → dist-B1oWRmrH.js} +1 -1
- ksadk/server/static/assets/{dist-CmZHzlwZ.js → dist-BI1qQH4n.js} +1 -1
- ksadk/server/static/assets/{dist-X4TnqwOK.js → dist-BJLUwH6W.js} +1 -1
- ksadk/server/static/assets/{dist-B5oS1zcj.js → dist-Bbwqa8TG.js} +1 -1
- ksadk/server/static/assets/{dist-j6Dxmf_j.js → dist-Btyo4vX4.js} +1 -1
- ksadk/server/static/assets/{dist-DQU9EWw-.js → dist-C71CsujO.js} +1 -1
- ksadk/server/static/assets/{dist-BIlKoW0k.js → dist-CXpH_Rdd.js} +1 -1
- ksadk/server/static/assets/{dist-DJN_6Y39.js → dist-Cq4OL6nO.js} +1 -1
- ksadk/server/static/assets/{dist-Dli7qW-B.js → dist-D1V3f1B4.js} +1 -1
- ksadk/server/static/assets/{dist-fhOuWds5.js → dist-DJmCPRVB.js} +1 -1
- ksadk/server/static/assets/{dist-CWV4lDr1.js → dist-DQAB0qn_.js} +2 -2
- ksadk/server/static/assets/{dist-D6MpCZtz.js → dist-DUwKa_l6.js} +1 -1
- ksadk/server/static/assets/dist-DdRBIceA.js +1 -0
- ksadk/server/static/assets/{dist-DWKByxWV.js → dist-DfGFrb0v.js} +1 -1
- ksadk/server/static/assets/{dist-DsHPdk3W.js → dist-DjhwGUgZ.js} +1 -1
- ksadk/server/static/assets/{dist-B-jNR6Vn.js → dist-DyqV4fL4.js} +1 -1
- ksadk/server/static/assets/{dist-BB3-OwTQ.js → dist-M67Hwu0n.js} +1 -1
- ksadk/server/static/assets/{dist-_pHPTyZ-.js → dist-u8tVH5Ak.js} +1 -1
- ksadk/server/static/assets/ebnfDiagram-PWID7BFC-DVfMsLge.js +1 -0
- ksadk/server/static/assets/erDiagram-SSCWMZ5O-CWEZSYaw.js +99 -0
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-Dr5okd8V.js +1 -0
- ksadk/server/static/assets/flowDiagram-A5DVABFB-VEO-cVcO.js +1 -0
- ksadk/server/static/assets/ganttDiagram-EL5Y4UJY-TWIxoyYL.js +292 -0
- ksadk/server/static/assets/gitGraph-4MIJSDKK-CKiKY9Cf.js +1 -0
- ksadk/server/static/assets/gitGraphDiagram-WWUBYQGX-DDh2hd2S.js +106 -0
- ksadk/server/static/assets/index-B2k_urY8.js +241 -0
- ksadk/server/static/assets/index-ILPt6IWF.css +2 -0
- ksadk/server/static/assets/info-A6RAGUB7-ubA4Nm_p.js +1 -0
- ksadk/server/static/assets/infoDiagram-RXCK75RN-CgoyWiDR.js +2 -0
- ksadk/server/static/assets/{ishikawaDiagram-YF4QCWOH-K0OOfVna.js → ishikawaDiagram-5VMMS53U-CyRIu_om.js} +6 -6
- ksadk/server/static/assets/{journeyDiagram-JHISSGLW-8LeOJaZp.js → journeyDiagram-EYS64GPL-DN5JXHzN.js} +6 -6
- ksadk/server/static/assets/{kanban-definition-UN3LZRKU-C6uCgZrW.js → kanban-definition-3QL26DDD-CNP3ui66.js} +10 -10
- ksadk/server/static/assets/katex-DWEzQy1d.js +257 -0
- ksadk/server/static/assets/{linear-hdBcYzM8.js → linear-C-qHp7d2.js} +1 -1
- ksadk/server/static/assets/mermaid-parser.core-Cl-K943T.js +166 -0
- ksadk/server/static/assets/{mindmap-definition-RKZ34NQL-Bjy_2v4_.js → mindmap-definition-FBJOCRG2-D5DB5mYm.js} +29 -29
- ksadk/server/static/assets/packet-AYTQ26CC-C7R3NUlK.js +1 -0
- ksadk/server/static/assets/pegDiagram-XKGWAZYB-BQVc9ia_.js +1 -0
- ksadk/server/static/assets/pie-WAS4IAKB-BIT6qjr3.js +1 -0
- ksadk/server/static/assets/pieDiagram-E7YTZNPT-B6UCAvtY.js +39 -0
- ksadk/server/static/assets/{quadrantDiagram-W4KKPZXB-BmkRbwCg.js → quadrantDiagram-AXDQQJYC-mIr2d3eb.js} +6 -6
- ksadk/server/static/assets/radar-RG4KPBEZ-l5noef9X.js +1 -0
- ksadk/server/static/assets/railroad-74A4TZTK-Baea6ZvM.js +1 -0
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-OKn8zZnU.js +1 -0
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-DdKAKC4l.js +1 -0
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-Bds8udlG.js +1 -0
- ksadk/server/static/assets/railroadDiagram-O6MQD6OU-Dt3FFDmK.js +1 -0
- ksadk/server/static/assets/requirementDiagram-EFPCY7ZU-Cz_vQtgF.js +84 -0
- ksadk/server/static/assets/{sankeyDiagram-5OEKKPKP-l6iXmU65.js → sankeyDiagram-P5KCCOFB-wlO1TsH5.js} +7 -7
- ksadk/server/static/assets/{sequenceDiagram-3UESZ5HK-Cq6UBeQB.js → sequenceDiagram-WJ2MYXX4-CHRbElYq.js} +10 -10
- ksadk/server/static/assets/sizeCapture-X5ZJPWSS-DXX54iyO.js +1 -0
- ksadk/server/static/assets/stateDiagram-HBIQ2CUA-Dp_lw9II.js +1 -0
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-5b-8o2iS.js +1 -0
- ksadk/server/static/assets/swimlanes-XN3QIQJK-D8O5UlLG.js +1 -0
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-uf6WPRA4.js +8 -0
- ksadk/server/static/assets/{timeline-definition-PNZ67QCA-DEz24vV0.js → timeline-definition-24CTP7MA-8mfKcxvG.js} +7 -7
- ksadk/server/static/assets/treeView-Q6P3EWNA-CK5CSrSO.js +1 -0
- ksadk/server/static/assets/treemap-WGGIJYW6-Ch2BKgAM.js +1 -0
- ksadk/server/static/assets/vennDiagram-4TSXK5OY-EnNl0DE7.js +34 -0
- ksadk/server/static/assets/wardley-WFR3VGLG-YW3Q0ml_.js +1 -0
- ksadk/server/static/assets/wardleyDiagram-VM6X3IG4-DBu5fbYr.js +78 -0
- ksadk/server/static/assets/xychartDiagram-S5SC5T6Z-BSVXs4IY.js +7 -0
- ksadk/server/static/index.html +2 -2
- ksadk/sessions/__init__.py +26 -9
- ksadk/sessions/_local_service_sync.py +688 -0
- ksadk/sessions/_local_tables.py +21 -0
- ksadk/sessions/_postgres_schema.py +305 -0
- ksadk/sessions/_postgres_tables.py +15 -0
- ksadk/sessions/base.py +80 -1
- ksadk/sessions/in_memory.py +53 -2
- ksadk/sessions/local_service.py +63 -604
- ksadk/sessions/postgres_service.py +58 -148
- ksadk/sessions/resilient.py +35 -1
- ksadk/skills/service_client.py +48 -0
- ksadk/studio/agent_lifecycle.py +26 -20
- ksadk/studio/api.py +1063 -69
- ksadk/studio/api_catalog_routes.py +5 -0
- ksadk/studio/api_contracts.py +148 -6
- ksadk/studio/api_memory_routes.py +82 -0
- ksadk/studio/api_plugin_routes.py +480 -0
- ksadk/studio/attachment_store.py +187 -0
- ksadk/studio/authoring.py +259 -28
- ksadk/studio/authoring_coordinator.py +809 -67
- ksadk/studio/builder.py +197 -40
- ksadk/studio/capabilities.py +17 -0
- ksadk/studio/cloud.py +1920 -95
- ksadk/studio/codex_agent_service.py +137 -15
- ksadk/studio/codex_authoring.py +469 -0
- ksadk/studio/codex_builder.py +177 -25
- ksadk/studio/codex_manifest.py +71 -22
- ksadk/studio/codex_run.py +59 -4
- ksadk/studio/compatibility_report.py +445 -0
- ksadk/studio/compiler.py +7 -1
- ksadk/studio/contracts.py +234 -4
- ksadk/studio/dsh_provider_registration.py +768 -0
- ksadk/studio/event_store.py +79 -101
- ksadk/studio/framework_run.py +264 -3
- ksadk/studio/hosted_kernel.py +317 -0
- ksadk/studio/manifest_resolver.py +131 -0
- ksadk/studio/model_client.py +95 -9
- ksadk/studio/model_profile_service.py +1 -1
- ksadk/studio/operations.py +47 -5
- ksadk/studio/otel_trace.py +348 -42
- ksadk/studio/pcm_memory.py +85 -0
- ksadk/studio/plugin_composition.py +301 -0
- ksadk/studio/plugin_kernel_adapter.py +128 -0
- ksadk/studio/plugin_runtime.py +652 -0
- ksadk/studio/repository.py +23 -2
- ksadk/studio/resource_catalog.py +49 -1
- ksadk/studio/run_service.py +1266 -202
- ksadk/studio/runtime_source.py +51 -17
- ksadk/studio/scheduler_runtime.py +374 -0
- ksadk/studio/scheduler_service.py +211 -0
- ksadk/studio/service.py +1815 -117
- ksadk/studio/shared_web.py +199 -50
- ksadk/studio/soul.py +52 -0
- ksadk/studio/static/assets/index-DXs1Eq4M.css +1 -0
- ksadk/studio/static/assets/index-DeDqwTsD.js +283 -0
- ksadk/studio/static/index.html +2 -2
- ksadk/studio/templates.py +100 -8
- ksadk/studio/validator.py +20 -1
- ksadk/studio/workspace.py +31 -32
- ksadk/tracing/setup.py +304 -3
- ksadk/version.py +1 -1
- ksadk_runtime_common/schemas/runtime_event_v1.json +37 -0
- ksadk_runtime_common/schemas/runtime_event_v2.json +271 -0
- ksadk_runtime_common/workspace_files/path_utils.py +41 -0
- ksadk/events/parser.py +0 -191
- ksadk/server/static/assets/MathMessageMarkdown-DeYh8QPr.css +0 -1
- ksadk/server/static/assets/MermaidBlock-NERD_ef7.js +0 -303
- ksadk/server/static/assets/NativeTerminalPanel-CiHWf82q.js +0 -1
- ksadk/server/static/assets/arc-DrgjcKhl.js +0 -1
- ksadk/server/static/assets/architecture-7EHR7CIX-CpZLRCcY.js +0 -1
- ksadk/server/static/assets/architectureDiagram-3BPJPVTR-BXoVRbQ6.js +0 -36
- ksadk/server/static/assets/blockDiagram-GPEHLZMM-BnaB3Ywv.js +0 -132
- ksadk/server/static/assets/c4Diagram-AAUBKEIU-Dw4weZcp.js +0 -10
- ksadk/server/static/assets/channel-Dt3rQTFI.js +0 -1
- ksadk/server/static/assets/chunk-2J33WTMH-ChjpLK7j.js +0 -1
- ksadk/server/static/assets/chunk-55IACEB6-CK4ROATy.js +0 -1
- ksadk/server/static/assets/chunk-727SXJPM-B9KtTTgw.js +0 -206
- ksadk/server/static/assets/chunk-AQP2D5EJ-1O1mki3m.js +0 -231
- ksadk/server/static/assets/chunk-QZHKN3VN-iXEZtKQc.js +0 -1
- ksadk/server/static/assets/classDiagram-4FO5ZUOK-DIveV17Q.js +0 -1
- ksadk/server/static/assets/classDiagram-v2-Q7XG4LA2-DIveV17Q.js +0 -1
- ksadk/server/static/assets/cytoscape.esm-DelgaX4f.js +0 -321
- ksadk/server/static/assets/dagre-BM42HDAG-D0QXg_MQ.js +0 -4
- ksadk/server/static/assets/dagre-Bx709z4p.js +0 -1
- ksadk/server/static/assets/diagram-2AECGRRQ-DBDDKwBQ.js +0 -43
- ksadk/server/static/assets/diagram-5GNKFQAL-BkwDOxmO.js +0 -10
- ksadk/server/static/assets/diagram-KO2AKTUF-Bv8waYvY.js +0 -3
- ksadk/server/static/assets/diagram-LMA3HP47-e1VECDdu.js +0 -24
- ksadk/server/static/assets/diagram-OG6HWLK6-Ds9adfRl.js +0 -24
- ksadk/server/static/assets/dist-B5J2uhNk.js +0 -1
- ksadk/server/static/assets/erDiagram-TEJ5UH35-BPItFKH6.js +0 -85
- ksadk/server/static/assets/eventmodeling-FCH6USID-DYFSxbqr.js +0 -1
- ksadk/server/static/assets/flowDiagram-I6XJVG4X-BbYB9w5Y.js +0 -162
- ksadk/server/static/assets/ganttDiagram-6RSMTGT7-TQXa0KXv.js +0 -292
- ksadk/server/static/assets/gitGraph-WXDBUCRP-DyNYp6BN.js +0 -1
- ksadk/server/static/assets/gitGraphDiagram-PVQCEYII-bKblCnpa.js +0 -106
- ksadk/server/static/assets/graphlib-B8gBHxth.js +0 -1
- ksadk/server/static/assets/index-R52pJJvg.js +0 -177
- ksadk/server/static/assets/index-jJr3_955.css +0 -2
- ksadk/server/static/assets/info-J43DQDTF-WUx7qTde.js +0 -1
- ksadk/server/static/assets/infoDiagram-5YYISTIA-BGVT7J_i.js +0 -2
- ksadk/server/static/assets/katex-CYWseY5E.js +0 -265
- ksadk/server/static/assets/mermaid-parser.core-BWrDjSZM.js +0 -161
- ksadk/server/static/assets/packet-YPE3B663-BN13y_xl.js +0 -1
- ksadk/server/static/assets/pie-LRSECV5Y-ftSLXhhc.js +0 -1
- ksadk/server/static/assets/pieDiagram-4H26LBE5-GmmqNiVH.js +0 -30
- ksadk/server/static/assets/radar-GUYGQ44K-jaICkIeO.js +0 -1
- ksadk/server/static/assets/requirementDiagram-4Y6WPE33-DSWFqL7c.js +0 -84
- ksadk/server/static/assets/stateDiagram-AJRCARHV-qzTQpg3Y.js +0 -1
- ksadk/server/static/assets/stateDiagram-v2-BHNVJYJU-BYCoYGAN.js +0 -1
- ksadk/server/static/assets/treeView-BLDUP644-Cpib_vlz.js +0 -1
- ksadk/server/static/assets/treemap-LRROVOQU-DQxfmVHK.js +0 -1
- ksadk/server/static/assets/vennDiagram-CIIHVFJN-CMCixki2.js +0 -34
- ksadk/server/static/assets/wardley-L42UT6IY-BQYHnnkU.js +0 -1
- ksadk/server/static/assets/wardleyDiagram-YWT4CUSO-CVzB8F9K.js +0 -78
- ksadk/server/static/assets/xychartDiagram-2RQKCTM6-BFBqBLc1.js +0 -7
- ksadk/studio/evaluation.py +0 -192
- ksadk/studio/static/assets/index-CaEN0eTR.css +0 -1
- ksadk/studio/static/assets/index-DI2eY_NH.js +0 -252
- {agentengine_sdk_python-0.8.1.dist-info → agentengine_sdk_python-0.8.3.dist-info}/WHEEL +0 -0
- {agentengine_sdk_python-0.8.1.dist-info → agentengine_sdk_python-0.8.3.dist-info}/entry_points.txt +0 -0
- {agentengine_sdk_python-0.8.1.dist-info → agentengine_sdk_python-0.8.3.dist-info}/licenses/LICENSE +0 -0
- {agentengine_sdk_python-0.8.1.dist-info → agentengine_sdk_python-0.8.3.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
"""Deterministic build-time compatibility report for AgentBundle v2.
|
|
2
|
+
|
|
3
|
+
The report contains only immutable, already-resolved facts. It deliberately
|
|
4
|
+
does not inspect environment variables, import plugin entrypoints, or claim
|
|
5
|
+
that a process is healthy. Runtime readiness remains an Activation concern.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import hashlib
|
|
11
|
+
import json
|
|
12
|
+
from collections.abc import Callable, Mapping
|
|
13
|
+
from typing import Any
|
|
14
|
+
|
|
15
|
+
from ksadk.plugins.contracts import LockedCapability, PluginLockEntry, PluginManifest
|
|
16
|
+
from ksadk.plugins.resolver import (
|
|
17
|
+
PluginResolutionError,
|
|
18
|
+
ResolvedComposition,
|
|
19
|
+
version_satisfies,
|
|
20
|
+
)
|
|
21
|
+
from ksadk.studio.contracts import AgentDraft
|
|
22
|
+
|
|
23
|
+
COMPATIBILITY_REPORT_FORMAT = "agentkit.compatibility-report/v1"
|
|
24
|
+
CURRENT_KERNEL_API_VERSION = "1.0.0"
|
|
25
|
+
CURRENT_RUNTIME_CONTRACT = "agentkit.runtime/v1"
|
|
26
|
+
SUPPORTED_RUNTIME_PROTOCOLS = (CURRENT_RUNTIME_CONTRACT,)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def compatibility_facts_digest(
|
|
30
|
+
*,
|
|
31
|
+
draft: AgentDraft,
|
|
32
|
+
composition: ResolvedComposition | None,
|
|
33
|
+
runtime_lock: Mapping[str, Any],
|
|
34
|
+
) -> str:
|
|
35
|
+
"""Address every static input that can change a compatibility conclusion."""
|
|
36
|
+
|
|
37
|
+
payload: dict[str, Any] = {
|
|
38
|
+
"allowedPermissions": sorted(set(draft.spec.security.allowed_permissions)),
|
|
39
|
+
"runtime": {
|
|
40
|
+
"type": str(runtime_lock.get("type") or ""),
|
|
41
|
+
"version": str(runtime_lock.get("version") or ""),
|
|
42
|
+
},
|
|
43
|
+
"composition": None,
|
|
44
|
+
}
|
|
45
|
+
if composition is not None:
|
|
46
|
+
payload["composition"] = {
|
|
47
|
+
"profileDigest": composition.profile_digest,
|
|
48
|
+
"pluginLockDigest": composition.plugin_lock_digest,
|
|
49
|
+
"manifests": [
|
|
50
|
+
manifest.model_dump(
|
|
51
|
+
by_alias=True,
|
|
52
|
+
exclude_none=True,
|
|
53
|
+
mode="json",
|
|
54
|
+
)
|
|
55
|
+
for manifest in sorted(
|
|
56
|
+
composition.manifests,
|
|
57
|
+
key=lambda item: (item.metadata.id, item.metadata.version),
|
|
58
|
+
)
|
|
59
|
+
],
|
|
60
|
+
}
|
|
61
|
+
canonical = json.dumps(
|
|
62
|
+
payload,
|
|
63
|
+
ensure_ascii=False,
|
|
64
|
+
sort_keys=True,
|
|
65
|
+
separators=(",", ":"),
|
|
66
|
+
).encode("utf-8")
|
|
67
|
+
return f"sha256:{hashlib.sha256(canonical).hexdigest()}"
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def build_bundle_compatibility_report(
|
|
71
|
+
*,
|
|
72
|
+
draft: AgentDraft,
|
|
73
|
+
composition: ResolvedComposition | None,
|
|
74
|
+
runtime_lock: Mapping[str, Any],
|
|
75
|
+
resolved_digest: str,
|
|
76
|
+
facts_digest: str,
|
|
77
|
+
plugin_lock_digest: str,
|
|
78
|
+
composition_profile_digest: str | None,
|
|
79
|
+
) -> dict[str, Any]:
|
|
80
|
+
"""Project auditable static compatibility without reading host secrets."""
|
|
81
|
+
|
|
82
|
+
bundle = {
|
|
83
|
+
"bundleFormat": "agentkit.bundle/v2",
|
|
84
|
+
"compatibilityFactsDigest": facts_digest,
|
|
85
|
+
"resolvedDigest": resolved_digest,
|
|
86
|
+
"pluginLockDigest": plugin_lock_digest,
|
|
87
|
+
**(
|
|
88
|
+
{"compositionProfileDigest": composition_profile_digest}
|
|
89
|
+
if composition_profile_digest is not None
|
|
90
|
+
else {}
|
|
91
|
+
),
|
|
92
|
+
}
|
|
93
|
+
allowed_permissions = sorted(set(draft.spec.security.allowed_permissions))
|
|
94
|
+
if composition is None:
|
|
95
|
+
return _legacy_report(
|
|
96
|
+
bundle=bundle,
|
|
97
|
+
runtime_lock=runtime_lock,
|
|
98
|
+
allowed_permissions=allowed_permissions,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
manifests = {manifest.metadata.id: manifest for manifest in composition.manifests}
|
|
102
|
+
locked = {entry.id: entry for entry in composition.plugin_lock.plugins}
|
|
103
|
+
blockers: list[dict[str, str]] = []
|
|
104
|
+
|
|
105
|
+
def block(code: str, subject: str, reason: str) -> None:
|
|
106
|
+
blockers.append({"code": code, "subject": subject, "reason": reason})
|
|
107
|
+
|
|
108
|
+
permission_items: list[dict[str, Any]] = []
|
|
109
|
+
protocol_items: list[dict[str, Any]] = []
|
|
110
|
+
kernel_items: list[dict[str, str]] = []
|
|
111
|
+
capability_items: list[dict[str, str]] = []
|
|
112
|
+
|
|
113
|
+
for entry in composition.plugin_lock.plugins:
|
|
114
|
+
manifest = manifests.get(entry.id)
|
|
115
|
+
if manifest is None:
|
|
116
|
+
block(
|
|
117
|
+
"plugin_manifest_facts_missing",
|
|
118
|
+
entry.id,
|
|
119
|
+
"The exact manifest used to resolve this lock entry is unavailable.",
|
|
120
|
+
)
|
|
121
|
+
permission_items.append(
|
|
122
|
+
{
|
|
123
|
+
"pluginId": entry.id,
|
|
124
|
+
"required": [],
|
|
125
|
+
"unapproved": [],
|
|
126
|
+
"status": "blocked",
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
protocol_items.append(
|
|
130
|
+
{
|
|
131
|
+
"pluginId": entry.id,
|
|
132
|
+
"required": [],
|
|
133
|
+
"supported": list(SUPPORTED_RUNTIME_PROTOCOLS),
|
|
134
|
+
"status": "blocked",
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
kernel_items.append(
|
|
138
|
+
{
|
|
139
|
+
"pluginId": entry.id,
|
|
140
|
+
"required": "unknown",
|
|
141
|
+
"resolved": CURRENT_KERNEL_API_VERSION,
|
|
142
|
+
"status": "blocked",
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
for capability in entry.provides:
|
|
146
|
+
capability_items.append(
|
|
147
|
+
_capability_item(entry, capability, mode="unknown", status="blocked")
|
|
148
|
+
)
|
|
149
|
+
continue
|
|
150
|
+
|
|
151
|
+
_append_manifest_conclusions(
|
|
152
|
+
entry=entry,
|
|
153
|
+
manifest=manifest,
|
|
154
|
+
allowed_permissions=allowed_permissions,
|
|
155
|
+
permission_items=permission_items,
|
|
156
|
+
protocol_items=protocol_items,
|
|
157
|
+
kernel_items=kernel_items,
|
|
158
|
+
capability_items=capability_items,
|
|
159
|
+
block=block,
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
provider_ref = composition.profile.agent_provider.ref
|
|
163
|
+
provider_id, requested_version = _plugin_ref_parts(provider_ref)
|
|
164
|
+
provider_entry = locked.get(provider_id)
|
|
165
|
+
provider_manifest = manifests.get(provider_id)
|
|
166
|
+
if provider_entry is None:
|
|
167
|
+
block(
|
|
168
|
+
"agent_provider_lock_missing",
|
|
169
|
+
provider_id,
|
|
170
|
+
"The CompositionProfile AgentProvider has no exact PluginLock entry.",
|
|
171
|
+
)
|
|
172
|
+
elif provider_entry.version != requested_version:
|
|
173
|
+
block(
|
|
174
|
+
"agent_provider_version_mismatch",
|
|
175
|
+
provider_id,
|
|
176
|
+
(
|
|
177
|
+
f"Profile requests {requested_version}, but the lock resolves "
|
|
178
|
+
f"{provider_entry.version}."
|
|
179
|
+
),
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
blockers.sort(key=lambda item: (item["code"], item["subject"], item["reason"]))
|
|
183
|
+
blocked_subjects = {item["subject"] for item in blockers}
|
|
184
|
+
overall = "blocked" if blockers else "compatible"
|
|
185
|
+
provider_status = "blocked" if provider_id in blocked_subjects else "compatible"
|
|
186
|
+
|
|
187
|
+
return {
|
|
188
|
+
"format": COMPATIBILITY_REPORT_FORMAT,
|
|
189
|
+
"scope": "build-time-static",
|
|
190
|
+
"overallStatus": overall,
|
|
191
|
+
"bundle": bundle,
|
|
192
|
+
"host": {
|
|
193
|
+
"kind": _host_kind(provider_manifest),
|
|
194
|
+
"kernelApiVersion": CURRENT_KERNEL_API_VERSION,
|
|
195
|
+
"runtimeContract": CURRENT_RUNTIME_CONTRACT,
|
|
196
|
+
"readiness": "notEvaluated",
|
|
197
|
+
"status": overall,
|
|
198
|
+
},
|
|
199
|
+
"provider": _provider_conclusion(
|
|
200
|
+
provider_ref=provider_ref,
|
|
201
|
+
provider_id=provider_id,
|
|
202
|
+
requested_version=requested_version,
|
|
203
|
+
entry=provider_entry,
|
|
204
|
+
manifest=provider_manifest,
|
|
205
|
+
status=provider_status,
|
|
206
|
+
),
|
|
207
|
+
"kernelApi": sorted(kernel_items, key=lambda item: item["pluginId"]),
|
|
208
|
+
"protocols": sorted(protocol_items, key=lambda item: item["pluginId"]),
|
|
209
|
+
"permissions": {
|
|
210
|
+
"allowed": allowed_permissions,
|
|
211
|
+
"plugins": sorted(permission_items, key=lambda item: item["pluginId"]),
|
|
212
|
+
"status": (
|
|
213
|
+
"blocked"
|
|
214
|
+
if any(item["status"] == "blocked" for item in permission_items)
|
|
215
|
+
else "compatible"
|
|
216
|
+
),
|
|
217
|
+
},
|
|
218
|
+
"capabilities": sorted(
|
|
219
|
+
capability_items,
|
|
220
|
+
key=lambda item: (item["definition"], item["slot"], item["owner"]),
|
|
221
|
+
),
|
|
222
|
+
"blockingReasons": blockers,
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
def _legacy_report(
|
|
227
|
+
*,
|
|
228
|
+
bundle: dict[str, Any],
|
|
229
|
+
runtime_lock: Mapping[str, Any],
|
|
230
|
+
allowed_permissions: list[str],
|
|
231
|
+
) -> dict[str, Any]:
|
|
232
|
+
runtime_type = str(runtime_lock.get("type") or "")
|
|
233
|
+
version = str(runtime_lock.get("version") or "")
|
|
234
|
+
return {
|
|
235
|
+
"format": COMPATIBILITY_REPORT_FORMAT,
|
|
236
|
+
"scope": "build-time-static",
|
|
237
|
+
"overallStatus": "compatible",
|
|
238
|
+
"bundle": bundle,
|
|
239
|
+
"host": {
|
|
240
|
+
"kind": "legacy-runtime",
|
|
241
|
+
"kernelApiVersion": CURRENT_KERNEL_API_VERSION,
|
|
242
|
+
"runtimeContract": CURRENT_RUNTIME_CONTRACT,
|
|
243
|
+
"readiness": "notEvaluated",
|
|
244
|
+
"status": "compatible",
|
|
245
|
+
},
|
|
246
|
+
"provider": {
|
|
247
|
+
"ref": None,
|
|
248
|
+
"id": runtime_type or "builtin.legacy",
|
|
249
|
+
"hostRuntime": runtime_type or "unknown",
|
|
250
|
+
"isolation": "legacy",
|
|
251
|
+
"source": "builtin",
|
|
252
|
+
"digest": None,
|
|
253
|
+
"version": {
|
|
254
|
+
"requested": version or None,
|
|
255
|
+
"resolved": version or None,
|
|
256
|
+
"status": "compatible" if version else "unknown",
|
|
257
|
+
},
|
|
258
|
+
"status": "compatible",
|
|
259
|
+
},
|
|
260
|
+
"kernelApi": [],
|
|
261
|
+
"protocols": [
|
|
262
|
+
{
|
|
263
|
+
"pluginId": runtime_type or "builtin.legacy",
|
|
264
|
+
"required": [CURRENT_RUNTIME_CONTRACT],
|
|
265
|
+
"supported": list(SUPPORTED_RUNTIME_PROTOCOLS),
|
|
266
|
+
"status": "compatible",
|
|
267
|
+
}
|
|
268
|
+
],
|
|
269
|
+
"permissions": {
|
|
270
|
+
"allowed": allowed_permissions,
|
|
271
|
+
"plugins": [],
|
|
272
|
+
"status": "compatible",
|
|
273
|
+
},
|
|
274
|
+
"capabilities": [],
|
|
275
|
+
"blockingReasons": [],
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
def _append_manifest_conclusions(
|
|
280
|
+
*,
|
|
281
|
+
entry: PluginLockEntry,
|
|
282
|
+
manifest: PluginManifest,
|
|
283
|
+
allowed_permissions: list[str],
|
|
284
|
+
permission_items: list[dict[str, Any]],
|
|
285
|
+
protocol_items: list[dict[str, Any]],
|
|
286
|
+
kernel_items: list[dict[str, str]],
|
|
287
|
+
capability_items: list[dict[str, str]],
|
|
288
|
+
block: Callable[[str, str, str], None],
|
|
289
|
+
) -> None:
|
|
290
|
+
if (
|
|
291
|
+
manifest.metadata.id != entry.id
|
|
292
|
+
or manifest.metadata.version != entry.version
|
|
293
|
+
or manifest.spec.provenance.digest != entry.digest
|
|
294
|
+
):
|
|
295
|
+
block(
|
|
296
|
+
"plugin_manifest_lock_mismatch",
|
|
297
|
+
entry.id,
|
|
298
|
+
"Resolved manifest identity or digest does not match the PluginLock entry.",
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
required_permissions = sorted(set(manifest.spec.permissions))
|
|
302
|
+
unapproved = sorted(set(required_permissions) - set(allowed_permissions))
|
|
303
|
+
permission_status = "blocked" if unapproved else "compatible"
|
|
304
|
+
permission_items.append(
|
|
305
|
+
{
|
|
306
|
+
"pluginId": entry.id,
|
|
307
|
+
"required": required_permissions,
|
|
308
|
+
"unapproved": unapproved,
|
|
309
|
+
"status": permission_status,
|
|
310
|
+
}
|
|
311
|
+
)
|
|
312
|
+
if unapproved:
|
|
313
|
+
block(
|
|
314
|
+
"plugin_permission_unapproved",
|
|
315
|
+
entry.id,
|
|
316
|
+
"Unapproved permissions: " + ", ".join(unapproved),
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
protocols = sorted(set(manifest.spec.compatibility.runtime_protocols))
|
|
320
|
+
protocol_status = (
|
|
321
|
+
"compatible" if not protocols or CURRENT_RUNTIME_CONTRACT in protocols else "blocked"
|
|
322
|
+
)
|
|
323
|
+
protocol_items.append(
|
|
324
|
+
{
|
|
325
|
+
"pluginId": entry.id,
|
|
326
|
+
"required": protocols,
|
|
327
|
+
"supported": list(SUPPORTED_RUNTIME_PROTOCOLS),
|
|
328
|
+
"status": protocol_status,
|
|
329
|
+
}
|
|
330
|
+
)
|
|
331
|
+
if protocol_status == "blocked":
|
|
332
|
+
block(
|
|
333
|
+
"runtime_protocol_incompatible",
|
|
334
|
+
entry.id,
|
|
335
|
+
f"Plugin accepts {', '.join(protocols)}, host provides {CURRENT_RUNTIME_CONTRACT}.",
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
kernel_constraint = manifest.spec.compatibility.kernel_api
|
|
339
|
+
try:
|
|
340
|
+
kernel_compatible = version_satisfies(
|
|
341
|
+
CURRENT_KERNEL_API_VERSION,
|
|
342
|
+
kernel_constraint,
|
|
343
|
+
)
|
|
344
|
+
except PluginResolutionError:
|
|
345
|
+
kernel_compatible = False
|
|
346
|
+
kernel_items.append(
|
|
347
|
+
{
|
|
348
|
+
"pluginId": entry.id,
|
|
349
|
+
"required": kernel_constraint,
|
|
350
|
+
"resolved": CURRENT_KERNEL_API_VERSION,
|
|
351
|
+
"status": "compatible" if kernel_compatible else "blocked",
|
|
352
|
+
}
|
|
353
|
+
)
|
|
354
|
+
if not kernel_compatible:
|
|
355
|
+
block(
|
|
356
|
+
"kernel_api_incompatible",
|
|
357
|
+
entry.id,
|
|
358
|
+
f"Plugin requires {kernel_constraint}, host provides {CURRENT_KERNEL_API_VERSION}.",
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
offers = {(offer.definition, offer.slot): offer for offer in manifest.spec.provides}
|
|
362
|
+
for capability in entry.provides:
|
|
363
|
+
offer = offers.get((capability.definition, capability.slot))
|
|
364
|
+
status = "compatible" if capability.owner == entry.id and offer is not None else "blocked"
|
|
365
|
+
capability_items.append(
|
|
366
|
+
_capability_item(
|
|
367
|
+
entry,
|
|
368
|
+
capability,
|
|
369
|
+
mode=offer.mode if offer is not None else "unknown",
|
|
370
|
+
status=status,
|
|
371
|
+
)
|
|
372
|
+
)
|
|
373
|
+
if status == "blocked":
|
|
374
|
+
block(
|
|
375
|
+
"capability_lock_mismatch",
|
|
376
|
+
entry.id,
|
|
377
|
+
f"Locked capability {capability.definition} at {capability.slot} "
|
|
378
|
+
"does not match the resolved manifest owner.",
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
def _capability_item(
|
|
383
|
+
entry: PluginLockEntry,
|
|
384
|
+
capability: LockedCapability,
|
|
385
|
+
*,
|
|
386
|
+
mode: str,
|
|
387
|
+
status: str,
|
|
388
|
+
) -> dict[str, str]:
|
|
389
|
+
return {
|
|
390
|
+
"definition": capability.definition,
|
|
391
|
+
"slot": capability.slot,
|
|
392
|
+
"owner": capability.owner,
|
|
393
|
+
"version": entry.version,
|
|
394
|
+
"mode": mode,
|
|
395
|
+
"status": status,
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
def _provider_conclusion(
|
|
400
|
+
*,
|
|
401
|
+
provider_ref: str,
|
|
402
|
+
provider_id: str,
|
|
403
|
+
requested_version: str,
|
|
404
|
+
entry: PluginLockEntry | None,
|
|
405
|
+
manifest: PluginManifest | None,
|
|
406
|
+
status: str,
|
|
407
|
+
) -> dict[str, Any]:
|
|
408
|
+
return {
|
|
409
|
+
"ref": provider_ref,
|
|
410
|
+
"id": provider_id,
|
|
411
|
+
"hostRuntime": manifest.spec.runtime if manifest is not None else "unknown",
|
|
412
|
+
"isolation": manifest.spec.isolation if manifest is not None else "unknown",
|
|
413
|
+
"source": entry.source if entry is not None else "unknown",
|
|
414
|
+
"digest": entry.digest if entry is not None else None,
|
|
415
|
+
"version": {
|
|
416
|
+
"requested": requested_version,
|
|
417
|
+
"resolved": entry.version if entry is not None else None,
|
|
418
|
+
"status": (
|
|
419
|
+
"compatible"
|
|
420
|
+
if entry is not None and entry.version == requested_version
|
|
421
|
+
else "blocked"
|
|
422
|
+
),
|
|
423
|
+
},
|
|
424
|
+
"status": status,
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
def _host_kind(provider: PluginManifest | None) -> str:
|
|
429
|
+
if provider is not None and provider.spec.domain == "runtime-native":
|
|
430
|
+
return "runtime-native"
|
|
431
|
+
return "composition-host"
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
def _plugin_ref_parts(value: str) -> tuple[str, str]:
|
|
435
|
+
plugin_id, version = value.removeprefix("plugin://").rsplit("@", 1)
|
|
436
|
+
return plugin_id, version
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
__all__ = [
|
|
440
|
+
"COMPATIBILITY_REPORT_FORMAT",
|
|
441
|
+
"CURRENT_KERNEL_API_VERSION",
|
|
442
|
+
"CURRENT_RUNTIME_CONTRACT",
|
|
443
|
+
"build_bundle_compatibility_report",
|
|
444
|
+
"compatibility_facts_digest",
|
|
445
|
+
]
|
ksadk/studio/compiler.py
CHANGED
|
@@ -20,6 +20,7 @@ from ksadk.studio.contracts import (
|
|
|
20
20
|
)
|
|
21
21
|
from ksadk.studio.errors import StudioError
|
|
22
22
|
from ksadk.studio.resource_catalog import LocalResourceCatalog
|
|
23
|
+
from ksadk.studio.soul import compose_system_instruction
|
|
23
24
|
from ksadk.studio.validator import AgentValidator
|
|
24
25
|
from ksadk.studio.workspace import Workspace
|
|
25
26
|
|
|
@@ -72,7 +73,11 @@ class AgentCompiler:
|
|
|
72
73
|
resolved = ResolvedAgentSpec(
|
|
73
74
|
agent_id=draft.metadata.id,
|
|
74
75
|
source_revision=draft.metadata.revision,
|
|
75
|
-
instructions=
|
|
76
|
+
instructions=compose_system_instruction(
|
|
77
|
+
materialized.spec.instructions,
|
|
78
|
+
materialized.spec.soul,
|
|
79
|
+
),
|
|
80
|
+
soul=materialized.spec.soul,
|
|
76
81
|
model=self.resolver.resolve_model(materialized.spec.model),
|
|
77
82
|
capabilities=ResolvedCapabilities(
|
|
78
83
|
skills=skills,
|
|
@@ -81,6 +86,7 @@ class AgentCompiler:
|
|
|
81
86
|
),
|
|
82
87
|
execution=materialized.spec.execution,
|
|
83
88
|
context=materialized.spec.context,
|
|
89
|
+
memory=materialized.spec.memory,
|
|
84
90
|
security=materialized.spec.security,
|
|
85
91
|
evaluation=materialized.spec.evaluation,
|
|
86
92
|
source_digest=source_digest,
|