agentengine-sdk-python 0.8.3__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.3.dist-info → agentengine_sdk_python-0.8.5.dist-info}/METADATA +13 -9
- agentengine_sdk_python-0.8.5.dist-info/RECORD +1296 -0
- 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 +111 -91
- ksadk/builders/code_builder.py +74 -21
- ksadk/builders/framework_requirements.py +22 -3
- ksadk/builders/ks3_uploader.py +36 -7
- ksadk/builders/managed_runtime_builder.py +1 -0
- ksadk/cli/__init__.py +68 -3
- 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_managed_runtime.py +13 -1
- ksadk/cli/cmd_openclaw.py +26 -1
- ksadk/cli/cmd_plugin.py +76 -13
- ksadk/cli/cmd_studio.py +64 -16
- ksadk/cli/cmd_web.py +2 -5
- ksadk/cli/openclaw_env.py +1 -1
- ksadk/cli/resource_common.py +26 -0
- ksadk/cli/runtime_bootstrap.py +23 -1
- ksadk/codex/client.py +425 -96
- ksadk/codex/projection.py +24 -0
- ksadk/codex/runtime.py +56 -298
- ksadk/common/auth.py +16 -10
- ksadk/configs/__init__.py +1 -1
- ksadk/configs/env_registry.py +153 -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 +133 -21
- ksadk/conversations/normalize.py +28 -10
- ksadk/conversations/projector.py +4 -6
- ksadk/conversations/runtime_baseline.py +37 -0
- ksadk/conversations/runtime_invocation.py +22 -4
- ksadk/conversations/runtime_observability.py +39 -10
- ksadk/conversations/runtime_payloads.py +9 -0
- ksadk/conversations/runtime_persistence.py +105 -9
- ksadk/conversations/runtime_preparation.py +42 -33
- ksadk/conversations/runtime_resume.py +50 -2
- ksadk/conversations/runtime_stream_events.py +34 -35
- ksadk/conversations/runtime_streaming.py +33 -7
- ksadk/deployment/env_forward.py +2 -2
- ksadk/deployment/providers/serverless.py +1 -1
- ksadk/events/adapters/_codex_items.py +16 -8
- ksadk/events/adapters/_codex_validators.py +18 -7
- ksadk/events/adapters/_langgraph_support.py +34 -0
- ksadk/events/adapters/langgraph.py +15 -1
- ksadk/events/canonical_store.py +3 -1
- ksadk/events/projections.py +1 -1
- 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/config.py +2 -2
- 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 +171 -136
- 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/tools.py +38 -13
- 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 +2 -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 +2 -1
- ksadk/kernel/__init__.py +10 -0
- ksadk/kernel/approval_presentation.py +91 -0
- ksadk/kernel/authorization.py +1 -1
- ksadk/kernel/bootstrap.py +114 -106
- 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 +42 -29
- 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 +331 -25
- ksadk/kernel/state.py +2 -3
- ksadk/kernel/store.py +72 -2
- ksadk/kernel/worker.py +144 -51
- ksadk/kernel/worker_history.py +72 -0
- ksadk/kernel/worker_identity.py +47 -0
- ksadk/knowledge_base/client.py +57 -27
- ksadk/mcp_runtime/__init__.py +12 -4
- ksadk/memory/adk/backends/sdk_ltm_backend.py +161 -41
- ksadk/memory/adk/resilient_session_service.py +25 -17
- ksadk/memory/adk/short_term_memory.py +26 -9
- ksadk/memory/coordinator.py +22 -6
- ksadk/memory/extraction.py +40 -1
- ksadk/memory/models.py +84 -5
- ksadk/memory/provider_resolver.py +8 -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 +14 -7
- ksadk/model_proxy/transform.py +40 -2
- ksadk/plugins/__init__.py +5 -1
- ksadk/plugins/artifacts.py +275 -0
- ksadk/plugins/bridges/__init__.py +4 -2
- ksadk/plugins/bridges/codex.py +120 -13
- ksadk/plugins/bridges/dsh.py +351 -156
- ksadk/plugins/builtins.py +72 -35
- ksadk/plugins/bundle_security.py +28 -4
- ksadk/plugins/codex_manifest.py +983 -0
- ksadk/plugins/companion_artifacts.py +83 -0
- ksadk/plugins/companions.py +368 -0
- ksadk/plugins/composition.py +8 -0
- ksadk/plugins/contracts.py +119 -1
- ksadk/plugins/delivery.py +153 -0
- ksadk/plugins/dsh_channels.py +156 -0
- ksadk/plugins/dsh_home.py +140 -0
- ksadk/plugins/dsh_installation_digest.py +71 -0
- ksadk/plugins/dsh_teams.py +105 -0
- ksadk/plugins/dsh_toolchain.py +203 -32
- ksadk/plugins/ecosystem_probe.py +6 -6
- ksadk/plugins/execution_host.py +99 -0
- ksadk/plugins/host.py +102 -39
- ksadk/plugins/kernel_adapter.py +205 -0
- ksadk/plugins/providers/__init__.py +23 -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/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-knowledge/index.mjs +53 -0
- ksadk/plugins/providers/bundles/dsh-knowledge/package.json +16 -0
- ksadk/plugins/providers/bundles/dsh-memory/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-memory/index.mjs +175 -0
- ksadk/plugins/providers/bundles/dsh-memory/package.json +16 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/client.mjs +166 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/index.mjs +9 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/package.json +12 -0
- ksadk/plugins/providers/bundles/dsh-skill-center/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-skill-center/index.mjs +125 -0
- ksadk/plugins/providers/bundles/dsh-skill-center/package.json +16 -0
- ksadk/plugins/providers/bundles/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/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/index.mjs +920 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/package.json +27 -0
- 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 +115 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/index.mjs +19 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/package.json +7 -0
- ksadk/plugins/providers/bundles/ksadk-harness/index.mjs +1 -1
- ksadk/plugins/providers/codex.py +344 -70
- ksadk/plugins/providers/codex_native.py +368 -0
- ksadk/plugins/providers/codex_turn.py +301 -0
- ksadk/plugins/providers/dsh_capabilities.py +1450 -0
- ksadk/plugins/providers/dsh_mcp.py +467 -0
- ksadk/plugins/providers/harness.py +294 -141
- 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/mcp_projection.py +150 -0
- ksadk/plugins/providers/platform_resources.py +657 -0
- ksadk/plugins/providers/shipped_dsh.py +4 -1
- ksadk/plugins/resolver.py +8 -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/resource_runtime/__init__.py +4 -0
- ksadk/resource_runtime/broker.py +616 -0
- ksadk/resource_runtime/build_artifacts.py +165 -0
- ksadk/resource_runtime/contracts.py +138 -0
- ksadk/resource_runtime/discovery_receipts.py +100 -0
- ksadk/resource_runtime/discovery_skills.py +172 -0
- ksadk/resource_runtime/errors.py +6 -0
- ksadk/resource_runtime/ipc.py +142 -0
- ksadk/resource_runtime/kernel_approval.py +165 -0
- ksadk/resource_runtime/knowledge.py +114 -0
- ksadk/resource_runtime/langgraph.py +94 -0
- ksadk/resource_runtime/leases.py +191 -0
- ksadk/resource_runtime/managed_projection.py +186 -0
- ksadk/resource_runtime/mcp_server.py +138 -0
- ksadk/resource_runtime/memory_provider.py +318 -0
- ksadk/resource_runtime/memory_receipts.py +34 -0
- ksadk/resource_runtime/operation_ledger.py +211 -0
- ksadk/resource_runtime/plugin_config.py +48 -0
- ksadk/resource_runtime/policy_authorization.py +54 -0
- ksadk/resource_runtime/process.py +110 -0
- ksadk/resource_runtime/skill_artifacts.py +153 -0
- ksadk/resource_runtime/skill_runtime.py +42 -0
- ksadk/resource_runtime/skill_workspace.py +118 -0
- ksadk/resource_runtime/skills.py +215 -0
- ksadk/resource_runtime/snapshots.py +180 -0
- ksadk/resource_runtime/socket_server.py +103 -0
- ksadk/resource_runtime/supervisor.py +380 -0
- ksadk/resource_runtime/worker.py +504 -0
- ksadk/runners/_langgraph_runner_streams.py +182 -38
- ksadk/runners/_langgraph_state_reader.py +106 -0
- ksadk/runners/_session_identity.py +285 -0
- ksadk/runners/adk_runner.py +166 -63
- ksadk/runners/base_runner.py +29 -1
- ksadk/runners/langgraph_runner.py +542 -195
- ksadk/runners/patch_langchain.py +47 -0
- ksadk/runners/usage_accumulator.py +11 -3
- ksadk/runtime/_runner_adapter/stream_mapping.py +194 -20
- ksadk/runtime/adapter.py +2 -0
- ksadk/runtime/conversation_execution.py +117 -17
- ksadk/runtime/executor.py +87 -3
- ksadk/runtime/factory.py +65 -274
- ksadk/runtime/framework_adapters.py +23 -0
- ksadk/runtime/preprocessing.py +21 -5
- ksadk/runtime/runner_adapter.py +106 -18
- ksadk/runtime/skill_eval_result.py +36 -0
- ksadk/runtime/timing.py +46 -0
- ksadk/runtime/usage.py +49 -18
- ksadk/runtime_context.py +142 -2
- ksadk/sandbox/backends/e2b.py +288 -25
- ksadk/sandbox/backends/local_process.py +72 -39
- ksadk/sandbox/base.py +64 -1
- ksadk/sandbox/diagnostics.py +82 -0
- ksadk/sandbox/e2b_connection.py +66 -0
- ksadk/sandbox/local_controls.py +746 -0
- ksadk/sandbox/local_launcher.py +90 -0
- ksadk/scheduler/dispatcher.py +1 -1
- ksadk/scheduler/sqlite_store.py +18 -0
- ksadk/server/composition.py +2 -0
- ksadk/server/factory.py +5 -0
- ksadk/server/invocation_identity.py +118 -0
- ksadk/server/persistence_capability.py +516 -0
- ksadk/server/routes/common.py +32 -3
- ksadk/server/routes/control.py +271 -52
- ksadk/server/routes/dependencies.py +16 -0
- ksadk/server/routes/kernel_ingress.py +9 -1
- ksadk/server/routes/misc.py +233 -25
- ksadk/server/routes/models.py +47 -4
- ksadk/server/routes/openai_compat.py +76 -13
- ksadk/server/routes/projection.py +252 -12
- ksadk/server/routes/run.py +106 -35
- ksadk/server/routes/sessions.py +491 -138
- ksadk/server/routes/streaming.py +43 -9
- ksadk/server/routes/workspace.py +130 -21
- ksadk/server/static/assets/{ArtifactsPanel-10GPXIJ6.js → ArtifactsPanel-C1YoaKhx.js} +1 -1
- ksadk/server/static/assets/{CodeBlock-BXk1l-G1.js → CodeBlock-DHuAWfr5.js} +10 -7
- ksadk/server/static/assets/MathMessageMarkdown-cvdrBwYr.js +8 -0
- ksadk/server/static/assets/{MermaidBlock--OEYoXIJ.js → MermaidBlock-DeBkbJvI.js} +9 -9
- ksadk/server/static/assets/{NativeTerminalPanel-DrEe1syq.js → NativeTerminalPanel-oJj44_sV.js} +1 -1
- ksadk/server/static/assets/{abnfDiagram-VCTEODGH-eeTFJLvo.js → abnfDiagram-VCTEODGH-Dhfv25o2.js} +1 -1
- ksadk/server/static/assets/{arc-S3ZNbIAd.js → arc-C35w-pn1.js} +1 -1
- ksadk/server/static/assets/architecture-7GRP2DOG-BCsa26zi.js +1 -0
- ksadk/server/static/assets/{architectureDiagram-5GKGNRK7-CRjgEJDX.js → architectureDiagram-5GKGNRK7-FoMY_u6D.js} +1 -1
- ksadk/server/static/assets/{blockDiagram-NRAW4CY4-C7bsBoNH.js → blockDiagram-NRAW4CY4-zD4Rt7oE.js} +1 -1
- ksadk/server/static/assets/{c4Diagram-UCG6FXSJ-BX3c33Ob.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-bZ7ws-8m.js → chunk-5VM5RSS4-C2Ms13_k.js} +1 -1
- ksadk/server/static/assets/{chunk-F27PBJKO-D2r0pvhY.js → chunk-F27PBJKO-BoTj-qgx.js} +1 -1
- ksadk/server/static/assets/{chunk-G27WJ6UU-CZwF3oUP.js → chunk-G27WJ6UU-DOMyyjHH.js} +1 -1
- ksadk/server/static/assets/{chunk-JWPE2WC7-DigFYCML.js → chunk-JWPE2WC7-DbJJqDli.js} +1 -1
- ksadk/server/static/assets/{chunk-LCL6LL3I-CnorGV5q.js → chunk-LCL6LL3I-CLuRCt_W.js} +1 -1
- ksadk/server/static/assets/{chunk-POPQ4Y6H-CexntQA-.js → chunk-POPQ4Y6H-D0Dz847e.js} +1 -1
- ksadk/server/static/assets/{chunk-RHFEMEQ7-CHTC7UxA.js → chunk-RHFEMEQ7-BWSRzEcd.js} +1 -1
- ksadk/server/static/assets/{chunk-SVP7TREG-BC1EWt_-.js → chunk-SVP7TREG-CPoHqkCY.js} +1 -1
- ksadk/server/static/assets/{chunk-XXDRQBXY-BTG24xN0.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-CkonRdAS.js → cose-bilkent-JH36ORCC-LzyWm4m0.js} +1 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-CNXjFctL.js +1 -0
- ksadk/server/static/assets/{cynefinDiagram-5FMLGOSQ-DEOCBe15.js → cynefinDiagram-5FMLGOSQ-BlW_bHED.js} +1 -1
- ksadk/server/static/assets/{dagre-3AP2YEHR-DBThPuLa.js → dagre-3AP2YEHR-Bu_S86_i.js} +1 -1
- ksadk/server/static/assets/{dagre-ClTPrTht.js → dagre-B7nCawed.js} +1 -1
- ksadk/server/static/assets/{diagram-S7CK7UJ4-DsZHrnpJ.js → diagram-S7CK7UJ4-W_Zow2Km.js} +1 -1
- ksadk/server/static/assets/{diagram-UQ7AKVKN-BJR4nhVr.js → diagram-UQ7AKVKN-CLIKAHON.js} +1 -1
- ksadk/server/static/assets/{diagram-VSXAHHWV-xzcERX0a.js → diagram-VSXAHHWV-Dv6_QAlN.js} +1 -1
- ksadk/server/static/assets/{diagram-VX7I27RA-tn2xM1xu.js → diagram-VX7I27RA-BWAWRDtZ.js} +1 -1
- ksadk/server/static/assets/{diagram-Z3DM3KII-BZPGBkw5.js → diagram-Z3DM3KII-XA_rWMss.js} +1 -1
- ksadk/server/static/assets/dist-0X_j2Rcc.js +1 -0
- ksadk/server/static/assets/{dist-4zN1_tq5.js → dist-1nXCdsej.js} +1 -1
- ksadk/server/static/assets/{dist-M67Hwu0n.js → dist-2vL2sAdF.js} +1 -1
- ksadk/server/static/assets/{dist-BJLUwH6W.js → dist-B3bA05-e.js} +1 -1
- ksadk/server/static/assets/{dist-8VWI-2bZ.js → dist-BLpRy_Yx.js} +1 -1
- ksadk/server/static/assets/{dist-D1V3f1B4.js → dist-BO_UwatH.js} +1 -1
- ksadk/server/static/assets/{dist-Cq4OL6nO.js → dist-BdNFAney.js} +1 -1
- ksadk/server/static/assets/{dist-DfGFrb0v.js → dist-C0J5_3qM.js} +1 -1
- ksadk/server/static/assets/{dist-DyqV4fL4.js → dist-CGt_UGeO.js} +1 -1
- ksadk/server/static/assets/{dist-DjhwGUgZ.js → dist-CIRMvUM4.js} +1 -1
- ksadk/server/static/assets/{dist-B1oWRmrH.js → dist-CIpWk_5f.js} +1 -1
- ksadk/server/static/assets/{dist-CXpH_Rdd.js → dist-CPyieXEf.js} +1 -1
- ksadk/server/static/assets/{dist-Btyo4vX4.js → dist-D-92S-Fd.js} +1 -1
- ksadk/server/static/assets/{dist-u8tVH5Ak.js → dist-DNKuMzWc.js} +1 -1
- ksadk/server/static/assets/{dist-DQAB0qn_.js → dist-DWfdmz9s.js} +2 -2
- ksadk/server/static/assets/{dist-B-46q3Hk.js → dist-DppE_r-D.js} +1 -1
- ksadk/server/static/assets/{dist-C71CsujO.js → dist-DyG6Ya-z.js} +1 -1
- ksadk/server/static/assets/{dist-DJmCPRVB.js → dist-M-SrdhhZ.js} +1 -1
- ksadk/server/static/assets/{dist-Bbwqa8TG.js → dist-mqD5TZup.js} +1 -1
- ksadk/server/static/assets/{dist-BI1qQH4n.js → dist-n3n6t_FO.js} +1 -1
- ksadk/server/static/assets/{dist-DUwKa_l6.js → dist-qe8xjesy.js} +1 -1
- ksadk/server/static/assets/{dist-B0gdk4rl.js → dist-t6MzE0jU.js} +1 -1
- ksadk/server/static/assets/{ebnfDiagram-PWID7BFC-DVfMsLge.js → ebnfDiagram-PWID7BFC-BfCzF1Xi.js} +1 -1
- ksadk/server/static/assets/{erDiagram-SSCWMZ5O-CWEZSYaw.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-TWIxoyYL.js → ganttDiagram-EL5Y4UJY-DDaG1f4_.js} +1 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-B-AhYj4C.js +1 -0
- ksadk/server/static/assets/{gitGraphDiagram-WWUBYQGX-DDh2hd2S.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-CgoyWiDR.js → infoDiagram-RXCK75RN-CYMdn6lQ.js} +1 -1
- ksadk/server/static/assets/{ishikawaDiagram-5VMMS53U-CyRIu_om.js → ishikawaDiagram-5VMMS53U-CLHFAD6c.js} +1 -1
- ksadk/server/static/assets/{journeyDiagram-EYS64GPL-DN5JXHzN.js → journeyDiagram-EYS64GPL-BHSKQGAl.js} +1 -1
- ksadk/server/static/assets/{kanban-definition-3QL26DDD-CNP3ui66.js → kanban-definition-3QL26DDD-D5W3tjTT.js} +1 -1
- ksadk/server/static/assets/{katex-DWEzQy1d.js → katex-mtjOi4KM.js} +1 -1
- ksadk/server/static/assets/{linear-C-qHp7d2.js → linear-BETqsxE_.js} +1 -1
- ksadk/server/static/assets/{mermaid-parser.core-Cl-K943T.js → mermaid-parser.core-DPWrvs90.js} +2 -2
- ksadk/server/static/assets/{mindmap-definition-FBJOCRG2-D5DB5mYm.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-BQVc9ia_.js → pegDiagram-XKGWAZYB-GjAPNaqn.js} +1 -1
- ksadk/server/static/assets/pie-WAS4IAKB-DyfxBU7V.js +1 -0
- ksadk/server/static/assets/{pieDiagram-E7YTZNPT-B6UCAvtY.js → pieDiagram-E7YTZNPT-ToIewrqr.js} +1 -1
- ksadk/server/static/assets/{quadrantDiagram-AXDQQJYC-mIr2d3eb.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-Dt3FFDmK.js → railroadDiagram-O6MQD6OU-DKzx4xfv.js} +1 -1
- ksadk/server/static/assets/{requirementDiagram-EFPCY7ZU-Cz_vQtgF.js → requirementDiagram-EFPCY7ZU-CJYljxQS.js} +1 -1
- ksadk/server/static/assets/{sankeyDiagram-P5KCCOFB-wlO1TsH5.js → sankeyDiagram-P5KCCOFB-DLU2fV1w.js} +1 -1
- ksadk/server/static/assets/{sequenceDiagram-WJ2MYXX4-CHRbElYq.js → sequenceDiagram-WJ2MYXX4-CVqysrA9.js} +1 -1
- ksadk/server/static/assets/{sizeCapture-X5ZJPWSS-DXX54iyO.js → sizeCapture-X5ZJPWSS-BUxfmTHc.js} +1 -1
- ksadk/server/static/assets/{stateDiagram-HBIQ2CUA-Dp_lw9II.js → stateDiagram-HBIQ2CUA-CNFgYI9E.js} +1 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-BXAFScz8.js +1 -0
- ksadk/server/static/assets/{swimlanes-XN3QIQJK-D8O5UlLG.js → swimlanes-XN3QIQJK-B6qCMe8N.js} +1 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-uIQ2lJKH.js +8 -0
- ksadk/server/static/assets/{timeline-definition-24CTP7MA-8mfKcxvG.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-EnNl0DE7.js → vennDiagram-4TSXK5OY-BqtUqvXM.js} +1 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-QAt06uEz.js +1 -0
- ksadk/server/static/assets/{wardleyDiagram-VM6X3IG4-DBu5fbYr.js → wardleyDiagram-VM6X3IG4-B5KfDjI-.js} +1 -1
- ksadk/server/static/assets/{xychartDiagram-S5SC5T6Z-BSVXs4IY.js → xychartDiagram-S5SC5T6Z-BaUlSZrn.js} +1 -1
- ksadk/server/static/index.html +2 -2
- ksadk/server/terminal_sessions.py +34 -2
- ksadk/session_context.py +66 -0
- ksadk/sessions/__init__.py +11 -21
- ksadk/sessions/_local_service_sync.py +263 -1
- ksadk/sessions/base.py +176 -0
- ksadk/sessions/errors.py +4 -0
- ksadk/sessions/in_memory.py +309 -19
- ksadk/sessions/invocation_identity.py +235 -0
- ksadk/sessions/local_service.py +83 -1
- ksadk/sessions/persistence.py +275 -0
- ksadk/sessions/postgres_service.py +358 -0
- ksadk/sessions/resilience.py +8 -0
- ksadk/sessions/resilient.py +362 -4
- ksadk/sessions/topology.py +135 -0
- ksadk/skills/__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 +37 -4
- ksadk/skills/observability.py +132 -0
- ksadk/skills/package_store.py +261 -40
- ksadk/skills/runtime/agent.py +67 -9
- ksadk/skills/runtime/artifact_delivery.py +139 -0
- ksadk/skills/runtime/artifacts.py +87 -0
- ksadk/skills/runtime/backends/e2b.py +460 -27
- ksadk/skills/runtime/backends/local.py +629 -62
- ksadk/skills/runtime/base.py +81 -7
- ksadk/skills/runtime/executor.py +268 -1
- ksadk/skills/runtime/loader.py +118 -5
- ksadk/skills/runtime/pinned.py +114 -0
- ksadk/skills/runtime/request.py +49 -0
- ksadk/skills/service_client.py +167 -28
- ksadk/skills/tool_defs.py +108 -3
- ksadk/studio/api.py +810 -93
- ksadk/studio/api_catalog_routes.py +18 -0
- ksadk/studio/api_contracts.py +8 -2
- ksadk/studio/api_plugin_routes.py +562 -104
- ksadk/studio/api_resource_connections.py +221 -0
- ksadk/studio/authoring.py +12 -6
- ksadk/studio/authoring_coordinator.py +23 -16
- ksadk/studio/builder.py +88 -0
- ksadk/studio/capabilities.py +23 -6
- ksadk/studio/channel_connections.py +333 -0
- ksadk/studio/cloud.py +370 -112
- ksadk/studio/cloud_shared_web.py +638 -0
- ksadk/studio/codex_agent_service.py +130 -28
- ksadk/studio/codex_builder.py +242 -3
- ksadk/studio/codex_credentials.py +90 -0
- ksadk/studio/codex_manifest.py +31 -4
- ksadk/studio/codex_plugin_store.py +746 -0
- ksadk/studio/codex_provider_build.py +231 -0
- ksadk/studio/codex_run.py +190 -26
- ksadk/studio/compatibility_report.py +12 -1
- ksadk/studio/compiler.py +88 -14
- ksadk/studio/configuration.py +182 -0
- ksadk/studio/contracts.py +165 -11
- ksadk/studio/dsh_application.py +247 -0
- ksadk/studio/dsh_capability_service.py +1374 -0
- ksadk/studio/dsh_lifecycle.py +58 -0
- ksadk/studio/dsh_models.py +59 -0
- ksadk/studio/dsh_provider_registration.py +367 -21
- 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 +89 -14
- ksadk/studio/kernel_registry.py +418 -0
- ksadk/studio/kernel_sqlite_migration.py +181 -0
- ksadk/studio/mcp_runtime.py +11 -3
- ksadk/studio/model_client.py +1180 -66
- ksadk/studio/model_profile_service.py +26 -11
- ksadk/studio/native_documents.py +172 -0
- ksadk/studio/plugin_composition.py +202 -24
- ksadk/studio/plugin_kernel_adapter.py +21 -106
- ksadk/studio/plugin_lifecycle.py +80 -0
- ksadk/studio/plugin_runtime.py +448 -56
- ksadk/studio/provider_recovery.py +59 -0
- ksadk/studio/recovery_page.py +70 -0
- ksadk/studio/resource_authority.py +664 -0
- ksadk/studio/resource_binding_validation.py +77 -0
- ksadk/studio/resource_build_admission.py +196 -0
- ksadk/studio/resource_build_materializer.py +149 -0
- ksadk/studio/resource_catalog.py +149 -2
- ksadk/studio/resource_connections.py +220 -0
- ksadk/studio/run_activity.py +895 -0
- ksadk/studio/run_documents.py +127 -0
- ksadk/studio/run_service.py +789 -83
- ksadk/studio/runtime_catalog.py +53 -10
- ksadk/studio/runtime_source.py +16 -8
- ksadk/studio/scheduler_assistant.py +317 -0
- ksadk/studio/scheduler_runtime.py +32 -280
- ksadk/studio/scheduler_service.py +3 -0
- ksadk/studio/service.py +861 -120
- ksadk/studio/shared_web.py +579 -82
- 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/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- ksadk/studio/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- ksadk/studio/static/assets/MathMessageMarkdown-BesSeCYl-BEOyPC3w.css +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/arc-Pry-7G1_.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/array-BifhSqXX.js +1 -0
- ksadk/studio/static/assets/blockDiagram-I7D4REHJ-CLB4L11u.js +129 -0
- ksadk/studio/static/assets/c4Diagram-7LVT6UL2-BOma_Z_F.js +38 -0
- 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-2Q5K7J3B-C1jixKkw.js +1 -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-DVtDP4rm.js +62 -0
- ksadk/studio/static/assets/chunk-5V3GS4D5-i-ZDOEnP.js +1 -0
- ksadk/studio/static/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -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-CpEZCUgg.js +128 -0
- ksadk/studio/static/assets/chunk-F27PBJKO-D7pvKf0C.js +1 -0
- ksadk/studio/static/assets/chunk-FOHPRMQF-DHwB1DNv.js +161 -0
- ksadk/studio/static/assets/chunk-GMAD6QVW-DE_8H717.js +72 -0
- 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-D38axYOR.js +231 -0
- ksadk/studio/static/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- 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-DiCQjx9b.js +10 -0
- ksadk/studio/static/assets/chunk-OUJLGHUK-D0j2JRSg.js +2 -0
- ksadk/studio/static/assets/chunk-P2QGCYS3-VdhKmfYq.js +1 -0
- 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-DsCFnRVE.js +168 -0
- ksadk/studio/static/assets/chunk-SVP7TREG-DljApgRX.js +88 -0
- ksadk/studio/static/assets/chunk-TICWLB2K-DWqRtyqa.js +206 -0
- 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/chunk-Y2CYZVJY-DsF7k-Jl.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/cytoscape.esm-CGd-uY3x.js +321 -0
- ksadk/studio/static/assets/dagre-GXQ25YYZ-buZBRlwz.js +4 -0
- ksadk/studio/static/assets/dagre-PrKaheQc.js +1 -0
- ksadk/studio/static/assets/defaultLocale-BFoDCU3G.js +1 -0
- ksadk/studio/static/assets/diagram-S7CK7UJ4-C6aH78c4.js +30 -0
- 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/dist-v5Q1xZ2K.js +1 -0
- ksadk/studio/static/assets/ebnfDiagram-PWID7BFC-Daukxwqf.js +1 -0
- ksadk/studio/static/assets/erDiagram-RLTQ6QDP-CGthTMmJ.js +99 -0
- 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/graphlib-DS17s2tU.js +1 -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/init-C-OQMol4.js +1 -0
- ksadk/studio/static/assets/ishikawaDiagram-5VMMS53U-BUGEl8cO.js +70 -0
- ksadk/studio/static/assets/journeyDiagram-3NMN7TZE-Ch2ZYxvr.js +139 -0
- ksadk/studio/static/assets/kanban-definition-UXKFOSKX-Da-Fp4vC.js +89 -0
- ksadk/studio/static/assets/katex-DhON-x74.js +257 -0
- ksadk/studio/static/assets/kingsoft-cloud-BOcLiQ3e.ico +0 -0
- ksadk/studio/static/assets/line-BDaeq300.js +1 -0
- 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-CvlsVQ38.js +96 -0
- ksadk/studio/static/assets/ordinal-BDEzSJ7C.js +1 -0
- ksadk/studio/static/assets/packet-AYTQ26CC-BSJEH9Lb.js +1 -0
- ksadk/studio/static/assets/path-fybaL0A-.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-DlrWiSOv.js +39 -0
- 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-BA3hpUZM.js +7 -0
- 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-E-Ge0FcV.js +84 -0
- ksadk/studio/static/assets/rolldown-runtime-Dy4uBu1J-DK3Fl9T5.js +1 -0
- ksadk/studio/static/assets/rough.esm-Dy-Kn_BL.js +1 -0
- ksadk/studio/static/assets/sankeyDiagram-P5KCCOFB-CA6YKhQ3.js +40 -0
- ksadk/studio/static/assets/sequenceDiagram-WJ2MYXX4-CcElXGg4.js +162 -0
- ksadk/studio/static/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -0
- 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-CIuYhNy3.js +120 -0
- 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-CMJiaedy.js +78 -0
- ksadk/studio/static/assets/xychartDiagram-S5SC5T6Z-BdgtMvW2.js +7 -0
- 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
- agentengine_sdk_python-0.8.3.dist-info/RECORD +0 -833
- ksadk/server/static/assets/MathMessageMarkdown-D9uB55Oh.js +0 -8
- ksadk/server/static/assets/architecture-7GRP2DOG-Dk9nRQ6-.js +0 -1
- ksadk/server/static/assets/channel-s354Yo6o.js +0 -1
- ksadk/server/static/assets/chunk-2Q5K7J3B-CDpPpKR5.js +0 -1
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-Dd0nucl9.js +0 -1
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-Dd0nucl9.js +0 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-BBlT4uMf.js +0 -1
- ksadk/server/static/assets/dist-DdRBIceA.js +0 -1
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-Dr5okd8V.js +0 -1
- ksadk/server/static/assets/flowDiagram-A5DVABFB-VEO-cVcO.js +0 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-CKiKY9Cf.js +0 -1
- ksadk/server/static/assets/index-B2k_urY8.js +0 -241
- ksadk/server/static/assets/index-ILPt6IWF.css +0 -2
- ksadk/server/static/assets/info-A6RAGUB7-ubA4Nm_p.js +0 -1
- ksadk/server/static/assets/packet-AYTQ26CC-C7R3NUlK.js +0 -1
- ksadk/server/static/assets/pie-WAS4IAKB-BIT6qjr3.js +0 -1
- ksadk/server/static/assets/radar-RG4KPBEZ-l5noef9X.js +0 -1
- ksadk/server/static/assets/railroad-74A4TZTK-Baea6ZvM.js +0 -1
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-OKn8zZnU.js +0 -1
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-DdKAKC4l.js +0 -1
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-Bds8udlG.js +0 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-5b-8o2iS.js +0 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-uf6WPRA4.js +0 -8
- ksadk/server/static/assets/treeView-Q6P3EWNA-CK5CSrSO.js +0 -1
- ksadk/server/static/assets/treemap-WGGIJYW6-Ch2BKgAM.js +0 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-YW3Q0ml_.js +0 -1
- ksadk/studio/static/assets/PrismRenderer-IYN-ffww.js +0 -3
- ksadk/studio/static/assets/index-DXs1Eq4M.css +0 -1
- ksadk/studio/static/assets/index-DeDqwTsD.js +0 -283
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.5.dist-info}/WHEEL +0 -0
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.5.dist-info}/entry_points.txt +0 -0
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.5.dist-info}/licenses/LICENSE +0 -0
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.5.dist-info}/top_level.txt +0 -0
ksadk/studio/plugin_runtime.py
CHANGED
|
@@ -17,10 +17,17 @@ from ksadk.harness.reasoner import (
|
|
|
17
17
|
from ksadk.plugins.builtins import (
|
|
18
18
|
builtin_capability_factories,
|
|
19
19
|
builtin_capability_manifests,
|
|
20
|
+
builtin_capability_permissions,
|
|
20
21
|
)
|
|
21
22
|
from ksadk.plugins.bundle import PluginBundleError, PluginBundleResolver, ResolvedPluginBundle
|
|
22
23
|
from ksadk.plugins.contracts import CompositionProfile, PluginManifest
|
|
23
24
|
from ksadk.plugins.host import PluginHost, PluginHostError
|
|
25
|
+
from ksadk.plugins.providers.codex import CodexTurnResult
|
|
26
|
+
from ksadk.plugins.providers.dsh_mcp import (
|
|
27
|
+
DSH_PROFILE_MCP_PLUGIN_ID,
|
|
28
|
+
DshProfileMCPFactory,
|
|
29
|
+
dsh_profile_mcp_manifest,
|
|
30
|
+
)
|
|
24
31
|
from ksadk.plugins.providers.harness import (
|
|
25
32
|
HarnessTurnResult,
|
|
26
33
|
KsADKHarnessProviderFactory,
|
|
@@ -31,12 +38,20 @@ from ksadk.plugins.providers.legacy import (
|
|
|
31
38
|
LegacyHarnessSource,
|
|
32
39
|
)
|
|
33
40
|
from ksadk.plugins.providers.legacy_catalog import (
|
|
41
|
+
CODEX_AGENT_PROVIDER_PLUGIN_ID,
|
|
34
42
|
KSADK_HARNESS_AGENT_PROVIDER_PLUGIN_ID,
|
|
35
43
|
builtin_agent_provider_manifests,
|
|
36
44
|
legacy_harness_agent_provider_manifest,
|
|
37
45
|
)
|
|
46
|
+
from ksadk.plugins.providers.platform_resources import (
|
|
47
|
+
PLATFORM_RESOURCE_MCP_PLUGIN_ID,
|
|
48
|
+
PLATFORM_RESOURCE_MCP_REF,
|
|
49
|
+
PlatformResourceMCPFactory,
|
|
50
|
+
platform_resource_mcp_manifest,
|
|
51
|
+
)
|
|
38
52
|
from ksadk.plugins.resolver import PluginRegistry
|
|
39
|
-
from ksadk.
|
|
53
|
+
from ksadk.resource_runtime.policy_authorization import FullAccessResourceWriteAuthorizer
|
|
54
|
+
from ksadk.runtime import RuntimeExecutor, RuntimeLaunchContext
|
|
40
55
|
from ksadk.sessions.base import BaseSessionService
|
|
41
56
|
from ksadk.studio.contracts import (
|
|
42
57
|
BuildRecord,
|
|
@@ -49,6 +64,7 @@ from ksadk.studio.plugin_kernel_adapter import StudioPluginKernelAdapter
|
|
|
49
64
|
from ksadk.studio.repository import BuildRepository
|
|
50
65
|
from ksadk.studio.run_service import StudioRunSpec
|
|
51
66
|
from ksadk.studio.workspace import Workspace
|
|
67
|
+
from ksadk.tools.gateway import normalize_tool_approval_mode
|
|
52
68
|
|
|
53
69
|
_COMPOSED_RUNTIME_TYPES = frozenset({"harness", "plugin"})
|
|
54
70
|
|
|
@@ -90,6 +106,9 @@ class _StudioHarnessReasoner:
|
|
|
90
106
|
self._timeout_seconds = timeout_seconds
|
|
91
107
|
self._max_attempts = max_attempts
|
|
92
108
|
self._backoff_seconds = backoff_seconds
|
|
109
|
+
# Studio's Harness provider is always connected to the incremental
|
|
110
|
+
# model client. The engine uses this flag to select stream_complete.
|
|
111
|
+
self._streaming = True
|
|
93
112
|
|
|
94
113
|
async def complete(
|
|
95
114
|
self,
|
|
@@ -98,6 +117,7 @@ class _StudioHarnessReasoner:
|
|
|
98
117
|
prompt: str,
|
|
99
118
|
messages: Sequence[dict[str, Any]],
|
|
100
119
|
tools: Sequence[Any],
|
|
120
|
+
max_output_tokens: int | None = None,
|
|
101
121
|
) -> HarnessReasoningTurn:
|
|
102
122
|
del prompt
|
|
103
123
|
if model != self._model.model:
|
|
@@ -114,6 +134,7 @@ class _StudioHarnessReasoner:
|
|
|
114
134
|
backoff_seconds=self._backoff_seconds,
|
|
115
135
|
tools=[dict(tool.openai_schema) for tool in tools],
|
|
116
136
|
allow_empty=bool(tools),
|
|
137
|
+
max_output_tokens=max_output_tokens,
|
|
117
138
|
)
|
|
118
139
|
calls: list[HarnessToolCall] = []
|
|
119
140
|
for call in response.tool_calls:
|
|
@@ -136,11 +157,161 @@ class _StudioHarnessReasoner:
|
|
|
136
157
|
arguments=arguments,
|
|
137
158
|
)
|
|
138
159
|
)
|
|
160
|
+
reported_usage = response.usage if response.usage.reported else None
|
|
139
161
|
return HarnessReasoningTurn(
|
|
140
162
|
final_text=response.content or None,
|
|
141
163
|
tool_calls=tuple(calls),
|
|
164
|
+
reasoning=response.reasoning or None,
|
|
165
|
+
usage=None
|
|
166
|
+
if reported_usage is None
|
|
167
|
+
else {
|
|
168
|
+
"input_tokens": max(0, int(reported_usage.input_tokens)),
|
|
169
|
+
"output_tokens": max(0, int(reported_usage.output_tokens)),
|
|
170
|
+
"cached_tokens": max(0, int(reported_usage.cached_input_tokens)),
|
|
171
|
+
"reasoning_tokens": max(0, int(reported_usage.reasoning_output_tokens)),
|
|
172
|
+
},
|
|
142
173
|
)
|
|
143
174
|
|
|
175
|
+
async def stream_complete(
|
|
176
|
+
self,
|
|
177
|
+
*,
|
|
178
|
+
model: str,
|
|
179
|
+
prompt: str,
|
|
180
|
+
messages: Sequence[dict[str, Any]],
|
|
181
|
+
tools: Sequence[Any],
|
|
182
|
+
max_output_tokens: int | None = None,
|
|
183
|
+
):
|
|
184
|
+
"""Pass model deltas through the Harness loop as soon as they arrive."""
|
|
185
|
+
del prompt
|
|
186
|
+
if model != self._model.model:
|
|
187
|
+
raise PluginHostError(
|
|
188
|
+
"harness_model_not_bound",
|
|
189
|
+
f"Harness requested unbound model {model!r}",
|
|
190
|
+
)
|
|
191
|
+
text_parts: list[str] = []
|
|
192
|
+
reasoning_parts: list[str] = []
|
|
193
|
+
tool_calls: list[HarnessToolCall] = []
|
|
194
|
+
invalid_tool_name: str | None = None
|
|
195
|
+
usage = None
|
|
196
|
+
async for chunk in self._client.stream(
|
|
197
|
+
self._model,
|
|
198
|
+
messages=[dict(message) for message in messages],
|
|
199
|
+
network_policy=self._network_policy,
|
|
200
|
+
timeout_seconds=self._timeout_seconds,
|
|
201
|
+
tools=[dict(tool.openai_schema) for tool in tools],
|
|
202
|
+
max_output_tokens=max_output_tokens,
|
|
203
|
+
):
|
|
204
|
+
if chunk.text:
|
|
205
|
+
text_parts.append(chunk.text)
|
|
206
|
+
yield {"text_delta": chunk.text}
|
|
207
|
+
if chunk.reasoning:
|
|
208
|
+
reasoning_parts.append(chunk.reasoning)
|
|
209
|
+
yield {"reasoning_delta": chunk.reasoning}
|
|
210
|
+
if chunk.usage is not None:
|
|
211
|
+
usage = chunk.usage
|
|
212
|
+
if chunk.tool_calls:
|
|
213
|
+
tool_calls = []
|
|
214
|
+
for call in chunk.tool_calls:
|
|
215
|
+
try:
|
|
216
|
+
arguments = json.loads(call.arguments or "{}")
|
|
217
|
+
except json.JSONDecodeError:
|
|
218
|
+
invalid_tool_name = call.name
|
|
219
|
+
continue
|
|
220
|
+
if not isinstance(arguments, dict):
|
|
221
|
+
invalid_tool_name = call.name
|
|
222
|
+
continue
|
|
223
|
+
tool_calls.append(
|
|
224
|
+
HarnessToolCall(call_id=call.id, name=call.name, arguments=arguments)
|
|
225
|
+
)
|
|
226
|
+
if chunk.done:
|
|
227
|
+
if invalid_tool_name:
|
|
228
|
+
# Some OpenAI-compatible GLM gateways truncate or slightly
|
|
229
|
+
# corrupt a large native function-call JSON object. The
|
|
230
|
+
# first attempt's public prose has already streamed, so ask
|
|
231
|
+
# once for the intended call again with a larger budget and
|
|
232
|
+
# consume only its structured call. Raw invalid arguments
|
|
233
|
+
# are never placed back into model context or Studio events.
|
|
234
|
+
repair = await self._client.complete(
|
|
235
|
+
self._model,
|
|
236
|
+
messages=[
|
|
237
|
+
*[dict(message) for message in messages],
|
|
238
|
+
{
|
|
239
|
+
"role": "system",
|
|
240
|
+
"content": (
|
|
241
|
+
"The previous tool call could not be parsed. "
|
|
242
|
+
f"Retry the intended {invalid_tool_name} call once with "
|
|
243
|
+
"valid JSON arguments. Keep the file content concise enough "
|
|
244
|
+
"to fit in one tool call and do not repeat the analysis."
|
|
245
|
+
),
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
network_policy=self._network_policy,
|
|
249
|
+
timeout_seconds=self._timeout_seconds,
|
|
250
|
+
max_attempts=self._max_attempts,
|
|
251
|
+
backoff_seconds=self._backoff_seconds,
|
|
252
|
+
tools=[dict(tool.openai_schema) for tool in tools],
|
|
253
|
+
allow_empty=bool(tools),
|
|
254
|
+
retry_on_length=True,
|
|
255
|
+
max_output_tokens=max(
|
|
256
|
+
16_384,
|
|
257
|
+
int(
|
|
258
|
+
max_output_tokens
|
|
259
|
+
or self._model.parameters.max_tokens
|
|
260
|
+
or 0
|
|
261
|
+
),
|
|
262
|
+
),
|
|
263
|
+
)
|
|
264
|
+
tool_calls = []
|
|
265
|
+
for call in repair.tool_calls:
|
|
266
|
+
try:
|
|
267
|
+
arguments = json.loads(call.arguments or "{}")
|
|
268
|
+
except json.JSONDecodeError as error:
|
|
269
|
+
raise PluginHostError(
|
|
270
|
+
"harness_tool_arguments_invalid",
|
|
271
|
+
f"model emitted invalid arguments for tool {call.name!r}",
|
|
272
|
+
) from error
|
|
273
|
+
if not isinstance(arguments, dict):
|
|
274
|
+
raise PluginHostError(
|
|
275
|
+
"harness_tool_arguments_invalid",
|
|
276
|
+
f"model emitted non-object arguments for tool {call.name!r}",
|
|
277
|
+
)
|
|
278
|
+
tool_calls.append(
|
|
279
|
+
HarnessToolCall(
|
|
280
|
+
call_id=call.id,
|
|
281
|
+
name=call.name,
|
|
282
|
+
arguments=arguments,
|
|
283
|
+
)
|
|
284
|
+
)
|
|
285
|
+
if not tool_calls:
|
|
286
|
+
raise PluginHostError(
|
|
287
|
+
"harness_tool_arguments_invalid",
|
|
288
|
+
f"model did not repair arguments for tool {invalid_tool_name!r}",
|
|
289
|
+
)
|
|
290
|
+
usage = repair.usage
|
|
291
|
+
yield {
|
|
292
|
+
"turn": HarnessReasoningTurn(
|
|
293
|
+
final_text=(
|
|
294
|
+
"".join(text_parts)
|
|
295
|
+
or (repair.content if invalid_tool_name else "")
|
|
296
|
+
or None
|
|
297
|
+
),
|
|
298
|
+
tool_calls=tuple(tool_calls),
|
|
299
|
+
reasoning=(
|
|
300
|
+
"".join(reasoning_parts)
|
|
301
|
+
or (repair.reasoning if invalid_tool_name else "")
|
|
302
|
+
or None
|
|
303
|
+
),
|
|
304
|
+
usage=None
|
|
305
|
+
if usage is None
|
|
306
|
+
else {
|
|
307
|
+
"input_tokens": max(0, int(usage.input_tokens)),
|
|
308
|
+
"output_tokens": max(0, int(usage.output_tokens)),
|
|
309
|
+
"cached_tokens": max(0, int(usage.cached_input_tokens)),
|
|
310
|
+
"reasoning_tokens": max(0, int(usage.reasoning_output_tokens)),
|
|
311
|
+
},
|
|
312
|
+
)
|
|
313
|
+
}
|
|
314
|
+
|
|
144
315
|
|
|
145
316
|
class StudioPluginRuntime:
|
|
146
317
|
"""Resolve, activate, and retain composed providers for Studio sessions."""
|
|
@@ -157,6 +328,13 @@ class StudioPluginRuntime:
|
|
|
157
328
|
provider_manifests: Mapping[str, PluginManifest] | None = None,
|
|
158
329
|
provider_factories: Mapping[str, Any] | None = None,
|
|
159
330
|
legacy_harness_sources: Sequence[LegacyHarnessSource] = (),
|
|
331
|
+
dsh_capability_service: Any | None = None,
|
|
332
|
+
resource_dsh_capability_service: Any | None = None,
|
|
333
|
+
resource_authority: Any | None = None,
|
|
334
|
+
resource_connections: Any | None = None,
|
|
335
|
+
resource_actor_ref: str = "local-user",
|
|
336
|
+
codex_local_launch_resolver: Any = None,
|
|
337
|
+
runtime_executor: RuntimeExecutor | None = None,
|
|
160
338
|
) -> None:
|
|
161
339
|
self.workspace = workspace
|
|
162
340
|
self.builds = build_repository
|
|
@@ -166,9 +344,22 @@ class StudioPluginRuntime:
|
|
|
166
344
|
self._harness_reasoner = harness_reasoner
|
|
167
345
|
self._provider_manifests = dict(provider_manifests or {})
|
|
168
346
|
self._provider_factories = dict(provider_factories or {})
|
|
347
|
+
self._dsh_capability_service = dsh_capability_service
|
|
348
|
+
self._resource_dsh_capability_service = (
|
|
349
|
+
resource_dsh_capability_service or dsh_capability_service
|
|
350
|
+
)
|
|
351
|
+
self._resource_authority = resource_authority
|
|
352
|
+
self._resource_connections = resource_connections
|
|
353
|
+
self._resource_actor_ref = resource_actor_ref
|
|
354
|
+
self._codex_local_launch_resolver = codex_local_launch_resolver
|
|
355
|
+
self._runtime_executor = runtime_executor
|
|
169
356
|
self._legacy_bundles = LegacyBundleAdapter(legacy_harness_sources)
|
|
170
357
|
self._lock = asyncio.Lock()
|
|
171
358
|
self._hosts: dict[str, _HostEntry] = {}
|
|
359
|
+
self._resource_write_modes: dict[str, str] = {}
|
|
360
|
+
self._admission_open = True
|
|
361
|
+
self._closed = False
|
|
362
|
+
self.execution_policy_resolver: Any | None = None
|
|
172
363
|
|
|
173
364
|
def replace_provider_registrations(
|
|
174
365
|
self,
|
|
@@ -183,6 +374,8 @@ class StudioPluginRuntime:
|
|
|
183
374
|
raise ValueError(
|
|
184
375
|
"plugin provider manifests and factories must use the same exact references"
|
|
185
376
|
)
|
|
377
|
+
if self._closed:
|
|
378
|
+
raise RuntimeError("cannot replace provider registrations after runtime close")
|
|
186
379
|
if self._hosts:
|
|
187
380
|
raise RuntimeError("cannot replace provider registrations after activation")
|
|
188
381
|
self._provider_manifests = manifests
|
|
@@ -192,7 +385,13 @@ class StudioPluginRuntime:
|
|
|
192
385
|
def active_activation_count(self) -> int:
|
|
193
386
|
return sum(entry.host.activation_count for entry in self._hosts.values())
|
|
194
387
|
|
|
195
|
-
def resolve(
|
|
388
|
+
def resolve(
|
|
389
|
+
self,
|
|
390
|
+
build_id: str,
|
|
391
|
+
*,
|
|
392
|
+
model: str | None = None,
|
|
393
|
+
approval_mode: str | None = None,
|
|
394
|
+
) -> StudioRunSpec:
|
|
196
395
|
build = self.builds.get(build_id)
|
|
197
396
|
runtime_type = build.runtime_type.strip().lower()
|
|
198
397
|
if runtime_type not in _COMPOSED_RUNTIME_TYPES:
|
|
@@ -205,10 +404,18 @@ class StudioPluginRuntime:
|
|
|
205
404
|
bundle_root = self._bundle_root(build)
|
|
206
405
|
bundle = self._resolve_bundle(bundle_root)
|
|
207
406
|
self._preflight_bundle(bundle)
|
|
407
|
+
dynamic_dsh_mcp = self._bundle_uses_dynamic_dsh(bundle)
|
|
208
408
|
selected_model = self._select_model(build, model)
|
|
209
409
|
resolved = bundle.resolved_agent_spec
|
|
210
410
|
instructions = resolved.get("instructions")
|
|
211
411
|
instructions = instructions if isinstance(instructions, Mapping) else {}
|
|
412
|
+
provider_id, _provider_version = _parse_plugin_ref(
|
|
413
|
+
bundle.composition.profile.agent_provider.ref
|
|
414
|
+
)
|
|
415
|
+
provider_runtime_type = {
|
|
416
|
+
CODEX_AGENT_PROVIDER_PLUGIN_ID: "codex",
|
|
417
|
+
KSADK_HARNESS_AGENT_PROVIDER_PLUGIN_ID: "harness",
|
|
418
|
+
}.get(provider_id)
|
|
212
419
|
return StudioRunSpec(
|
|
213
420
|
launch_context=RuntimeLaunchContext(
|
|
214
421
|
runtime_type=runtime_type,
|
|
@@ -222,6 +429,15 @@ class StudioPluginRuntime:
|
|
|
222
429
|
"agent_system": str(instructions.get("system") or ""),
|
|
223
430
|
"agent_task": str(instructions.get("task") or ""),
|
|
224
431
|
"plugin_bundle_digest": bundle.bundle_digest,
|
|
432
|
+
"dynamic_dsh_mcp": dynamic_dsh_mcp,
|
|
433
|
+
"provider_runtime_adapter": provider_runtime_type is not None,
|
|
434
|
+
"provider_runtime_type": provider_runtime_type or "",
|
|
435
|
+
"provider_ref": bundle.composition.profile.agent_provider.ref,
|
|
436
|
+
**(
|
|
437
|
+
{"tool_approval_mode": normalize_tool_approval_mode(approval_mode)}
|
|
438
|
+
if approval_mode
|
|
439
|
+
else {}
|
|
440
|
+
),
|
|
225
441
|
},
|
|
226
442
|
manifest_sha256=build.resolved_digest,
|
|
227
443
|
plugin_bundle_root=bundle_root,
|
|
@@ -244,12 +460,29 @@ class StudioPluginRuntime:
|
|
|
244
460
|
"plugin_bundle_agent_mismatch",
|
|
245
461
|
"Studio run Agent does not match its immutable PluginHost Bundle",
|
|
246
462
|
)
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
activation_key=session_id,
|
|
463
|
+
self._resource_write_modes[session_id] = str(
|
|
464
|
+
spec.request_config.get("tool_approval_mode") or ""
|
|
250
465
|
)
|
|
251
|
-
|
|
252
|
-
|
|
466
|
+
try:
|
|
467
|
+
activation = await entry.host.open_activation(
|
|
468
|
+
entry.bundle,
|
|
469
|
+
activation_key=session_id,
|
|
470
|
+
)
|
|
471
|
+
except BaseException:
|
|
472
|
+
self._resource_write_modes.pop(session_id, None)
|
|
473
|
+
raise
|
|
474
|
+
try:
|
|
475
|
+
raw = await activation.execute(dict(request))
|
|
476
|
+
return _normalize_result(raw, session_id=session_id)
|
|
477
|
+
finally:
|
|
478
|
+
# Dynamic DSH leases are generation-bound. Rebuilding the
|
|
479
|
+
# activation per turn guarantees a restarted sidecar never leaves
|
|
480
|
+
# a session pinned to an expired port or scoped token.
|
|
481
|
+
if self._bundle_uses_dynamic_dsh(entry.bundle):
|
|
482
|
+
try:
|
|
483
|
+
await activation.close()
|
|
484
|
+
finally:
|
|
485
|
+
self._resource_write_modes.pop(session_id, None)
|
|
253
486
|
|
|
254
487
|
def kernel_adapter_provider(self, spec: StudioRunSpec): # type: ignore[no-untyped-def]
|
|
255
488
|
"""Return a lazy, Build-pinned adapter factory for Scheduler Kernel."""
|
|
@@ -282,31 +515,135 @@ class StudioPluginRuntime:
|
|
|
282
515
|
"plugin_bundle_agent_mismatch",
|
|
283
516
|
"Studio run Agent does not match its immutable PluginHost Bundle",
|
|
284
517
|
)
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
activation_key=session_id,
|
|
518
|
+
self._resource_write_modes[session_id] = str(
|
|
519
|
+
spec.request_config.get("tool_approval_mode") or ""
|
|
288
520
|
)
|
|
289
|
-
|
|
521
|
+
try:
|
|
522
|
+
activation = await entry.host.open_activation(
|
|
523
|
+
entry.bundle,
|
|
524
|
+
activation_key=session_id,
|
|
525
|
+
)
|
|
526
|
+
except BaseException:
|
|
527
|
+
self._resource_write_modes.pop(session_id, None)
|
|
528
|
+
raise
|
|
529
|
+
try:
|
|
530
|
+
return await activation.runtime_adapter()
|
|
531
|
+
except BaseException:
|
|
532
|
+
try:
|
|
533
|
+
await activation.close()
|
|
534
|
+
finally:
|
|
535
|
+
self._resource_write_modes.pop(session_id, None)
|
|
536
|
+
raise
|
|
290
537
|
|
|
291
538
|
async def close_session(self, session_id: str) -> None:
|
|
292
539
|
async with self._lock:
|
|
293
540
|
entries = tuple(self._hosts.values())
|
|
294
|
-
|
|
295
|
-
|
|
541
|
+
try:
|
|
542
|
+
for entry in entries:
|
|
543
|
+
await entry.host.close_activation(session_id)
|
|
544
|
+
finally:
|
|
545
|
+
self._resource_write_modes.pop(session_id, None)
|
|
546
|
+
|
|
547
|
+
async def close_session_if_dynamic(self, spec: StudioRunSpec, session_id: str) -> None:
|
|
548
|
+
# 每轮运行后关闭 dynamic-DSH MCP 激活会让下一轮重新 spawn/health/list
|
|
549
|
+
# 全部 MCP server(实测 ~12s),这是 harness 首 token 延迟的主因。
|
|
550
|
+
# open_activation 以 session 为 key 复用同一激活(图与 Bundle digest
|
|
551
|
+
# 不变),因此跨轮保留激活;激活只在会话删除(close_session)与
|
|
552
|
+
# Studio 退出(aclose)时释放。
|
|
553
|
+
return None
|
|
554
|
+
|
|
555
|
+
def check_configuration_mutable(self) -> None:
|
|
556
|
+
if self._hosts:
|
|
557
|
+
raise StudioError(
|
|
558
|
+
"SETTINGS_RUNTIME_BUSY", "请通过设置接口刷新运行配置", status_code=409
|
|
559
|
+
)
|
|
560
|
+
|
|
561
|
+
def replace_resource_authority(self, authority: Any) -> None:
|
|
562
|
+
self.check_configuration_mutable()
|
|
563
|
+
self._resource_authority = authority
|
|
564
|
+
|
|
565
|
+
async def suspend_admission(self) -> None:
|
|
566
|
+
"""Stop new activations and drain every currently owned host."""
|
|
567
|
+
|
|
568
|
+
async with self._lock:
|
|
569
|
+
self._admission_open = False
|
|
570
|
+
entries = tuple(self._hosts.values())
|
|
571
|
+
self._hosts.clear()
|
|
572
|
+
cleanup = asyncio.create_task(self._dispose_entries(entries))
|
|
573
|
+
interrupted = False
|
|
574
|
+
while not cleanup.done():
|
|
575
|
+
try:
|
|
576
|
+
await asyncio.shield(cleanup)
|
|
577
|
+
except asyncio.CancelledError:
|
|
578
|
+
interrupted = True
|
|
579
|
+
cleanup.result()
|
|
580
|
+
if interrupted:
|
|
581
|
+
raise asyncio.CancelledError
|
|
582
|
+
|
|
583
|
+
async def resume_admission(self) -> None:
|
|
584
|
+
async with self._lock:
|
|
585
|
+
if self._closed:
|
|
586
|
+
raise PluginHostError(
|
|
587
|
+
"plugin_runtime_closed",
|
|
588
|
+
"Studio plugin runtime is closed",
|
|
589
|
+
)
|
|
590
|
+
self._admission_open = True
|
|
591
|
+
|
|
592
|
+
@staticmethod
|
|
593
|
+
async def _dispose_entries(entries: Sequence[_HostEntry]) -> None:
|
|
594
|
+
if entries:
|
|
595
|
+
results = await asyncio.gather(
|
|
596
|
+
*(entry.host.dispose() for entry in entries),
|
|
597
|
+
return_exceptions=True,
|
|
598
|
+
)
|
|
599
|
+
for result in results:
|
|
600
|
+
if isinstance(result, BaseException):
|
|
601
|
+
raise result
|
|
296
602
|
|
|
297
603
|
async def aclose(self) -> None:
|
|
298
604
|
async with self._lock:
|
|
605
|
+
if self._closed:
|
|
606
|
+
return
|
|
607
|
+
self._closed = True
|
|
608
|
+
self._admission_open = False
|
|
299
609
|
entries = tuple(self._hosts.values())
|
|
300
610
|
self._hosts.clear()
|
|
301
|
-
|
|
302
|
-
|
|
611
|
+
cleanup = asyncio.create_task(self._dispose_entries(entries))
|
|
612
|
+
interrupted = False
|
|
613
|
+
while not cleanup.done():
|
|
614
|
+
try:
|
|
615
|
+
await asyncio.shield(cleanup)
|
|
616
|
+
except asyncio.CancelledError:
|
|
617
|
+
interrupted = True
|
|
618
|
+
cleanup.result()
|
|
619
|
+
if interrupted:
|
|
620
|
+
raise asyncio.CancelledError
|
|
303
621
|
|
|
304
622
|
async def _host_for(self, bundle_root: Path) -> _HostEntry:
|
|
305
623
|
# Re-resolve every turn. This deliberately rechecks enabled receipts and
|
|
306
624
|
# package digests rather than trusting a previously healthy child.
|
|
307
625
|
bundle = self._resolve_bundle(bundle_root)
|
|
626
|
+
if any(
|
|
627
|
+
item.ref == PLATFORM_RESOURCE_MCP_REF
|
|
628
|
+
for item in bundle.composition.profile.capabilities
|
|
629
|
+
) and not callable(getattr(self._resource_authority, "admit_runtime", None)):
|
|
630
|
+
raise StudioError(
|
|
631
|
+
"PLATFORM_RESOURCE_CONFIGURATION_REQUIRED",
|
|
632
|
+
"平台资源连接尚未配置,请在设置的云端连接中填写账号凭据和控制面地址",
|
|
633
|
+
status_code=422,
|
|
634
|
+
)
|
|
308
635
|
key = bundle.bundle_digest
|
|
309
636
|
async with self._lock:
|
|
637
|
+
if self._closed:
|
|
638
|
+
raise PluginHostError(
|
|
639
|
+
"plugin_runtime_closed",
|
|
640
|
+
"Studio plugin runtime is closed",
|
|
641
|
+
)
|
|
642
|
+
if not self._admission_open:
|
|
643
|
+
raise PluginHostError(
|
|
644
|
+
"plugin_runtime_reconfiguring",
|
|
645
|
+
"Studio plugin runtime is reconfiguring",
|
|
646
|
+
)
|
|
310
647
|
existing = self._hosts.get(key)
|
|
311
648
|
if existing is not None:
|
|
312
649
|
return existing
|
|
@@ -319,9 +656,24 @@ class StudioPluginRuntime:
|
|
|
319
656
|
)
|
|
320
657
|
services: dict[str, Any] = {
|
|
321
658
|
"session_service": self._session_service,
|
|
659
|
+
"runtime_state_root": self.workspace.resolve(".agentkit/plugin-runtime/state"),
|
|
322
660
|
# Providers resolve credential *references* at activation time.
|
|
323
661
|
# The DSH discovery host never receives this service.
|
|
324
662
|
"credential_resolver": self._secret_resolver,
|
|
663
|
+
# Harness Provider 持久 Checkpoint/RunStore/Receipt 的状态根
|
|
664
|
+
# (与 builtin capability factories 同一 Workspace 命名空间)。
|
|
665
|
+
"harness_state_dir": str(self.workspace.resolve(".agentkit/plugin-runtime/state")),
|
|
666
|
+
# 用户当前选择的 Studio 工作区:harness 的文件工具应写在这里,
|
|
667
|
+
# 而不是 plugin-runtime state 的哈希目录里。
|
|
668
|
+
"harness_workspace_root": str(self.workspace.root),
|
|
669
|
+
"codex_local_launch_resolver": self._codex_local_launch_resolver,
|
|
670
|
+
"runtime_executor": self._runtime_executor,
|
|
671
|
+
"execution_policy_resolver": self.execution_policy_resolver,
|
|
672
|
+
"dsh_capability_service": self._resource_dsh_capability_service,
|
|
673
|
+
"resource_authority": self._resource_authority,
|
|
674
|
+
"resource_connections": self._resource_connections,
|
|
675
|
+
"resource_actor_ref": self._resource_actor_ref,
|
|
676
|
+
"resource_write_authorizer_factory": self._resource_write_authorizer,
|
|
325
677
|
}
|
|
326
678
|
provider_id, _provider_version = _parse_plugin_ref(
|
|
327
679
|
verified.composition.profile.agent_provider.ref
|
|
@@ -346,21 +698,33 @@ class StudioPluginRuntime:
|
|
|
346
698
|
bundle=verified,
|
|
347
699
|
host=host,
|
|
348
700
|
)
|
|
349
|
-
stale = [
|
|
350
|
-
(digest, entry)
|
|
351
|
-
for digest, entry in self._hosts.items()
|
|
352
|
-
if entry.agent_id == candidate.agent_id and digest != key
|
|
353
|
-
]
|
|
354
701
|
self._hosts[key] = candidate
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
702
|
+
# Distinct immutable Builds of the same Agent may be active in
|
|
703
|
+
# different authorized sessions. Their profile graphs are owned
|
|
704
|
+
# until explicit maintenance/close, never evicted by another Build.
|
|
358
705
|
return candidate
|
|
359
706
|
|
|
707
|
+
def _resource_write_authorizer(
|
|
708
|
+
self,
|
|
709
|
+
activation_key: str,
|
|
710
|
+
_bundle: ResolvedPluginBundle,
|
|
711
|
+
) -> FullAccessResourceWriteAuthorizer | None:
|
|
712
|
+
if self._resource_write_modes.get(activation_key) != "full":
|
|
713
|
+
return None
|
|
714
|
+
return FullAccessResourceWriteAuthorizer(activation_key=activation_key)
|
|
715
|
+
|
|
716
|
+
@staticmethod
|
|
717
|
+
def _bundle_uses_dynamic_dsh(bundle: ResolvedPluginBundle) -> bool:
|
|
718
|
+
reference = (
|
|
719
|
+
f"plugin://{DSH_PROFILE_MCP_PLUGIN_ID}@{dsh_profile_mcp_manifest().metadata.version}"
|
|
720
|
+
)
|
|
721
|
+
dynamic_refs = {reference, PLATFORM_RESOURCE_MCP_REF}
|
|
722
|
+
return any(
|
|
723
|
+
capability.ref in dynamic_refs for capability in bundle.composition.profile.capabilities
|
|
724
|
+
)
|
|
725
|
+
|
|
360
726
|
def _resolve_bundle(self, bundle_root: Path) -> ResolvedPluginBundle:
|
|
361
|
-
registered_ids = {
|
|
362
|
-
manifest.metadata.id for manifest in self._provider_manifests.values()
|
|
363
|
-
}
|
|
727
|
+
registered_ids = {manifest.metadata.id for manifest in self._provider_manifests.values()}
|
|
364
728
|
try:
|
|
365
729
|
manifest, selection = self._legacy_bundles.select_from_bundle(
|
|
366
730
|
bundle_root,
|
|
@@ -390,9 +754,7 @@ class StudioPluginRuntime:
|
|
|
390
754
|
}
|
|
391
755
|
}
|
|
392
756
|
)
|
|
393
|
-
registry = PluginRegistry(
|
|
394
|
-
[selection.manifest, *builtin_capability_manifests()]
|
|
395
|
-
)
|
|
757
|
+
registry = PluginRegistry([selection.manifest, *builtin_capability_manifests()])
|
|
396
758
|
try:
|
|
397
759
|
resolved = json.loads(
|
|
398
760
|
(bundle_root / "resolved-agent-spec.json").read_text(encoding="utf-8")
|
|
@@ -421,6 +783,8 @@ class StudioPluginRuntime:
|
|
|
421
783
|
manifests = [
|
|
422
784
|
*builtin_agent_provider_manifests(),
|
|
423
785
|
*builtin_capability_manifests(),
|
|
786
|
+
dsh_profile_mcp_manifest(),
|
|
787
|
+
platform_resource_mcp_manifest(),
|
|
424
788
|
]
|
|
425
789
|
external = self._external_manifest(profile)
|
|
426
790
|
if external is not None:
|
|
@@ -442,11 +806,15 @@ class StudioPluginRuntime:
|
|
|
442
806
|
manifests: list[PluginManifest] = [
|
|
443
807
|
*builtin_agent_provider_manifests(),
|
|
444
808
|
*builtin_capability_manifests(),
|
|
809
|
+
dsh_profile_mcp_manifest(),
|
|
810
|
+
platform_resource_mcp_manifest(),
|
|
445
811
|
]
|
|
446
812
|
factories = builtin_capability_factories(
|
|
447
813
|
state_root=self.workspace.resolve(".agentkit/plugin-runtime/state"),
|
|
448
814
|
secret_resolver=self._secret_resolver.resolve,
|
|
449
815
|
)
|
|
816
|
+
factories[DSH_PROFILE_MCP_PLUGIN_ID] = DshProfileMCPFactory(self._dsh_capability_service)
|
|
817
|
+
factories[PLATFORM_RESOURCE_MCP_PLUGIN_ID] = PlatformResourceMCPFactory()
|
|
450
818
|
provider_id, provider_version = _parse_plugin_ref(
|
|
451
819
|
bundle.composition.profile.agent_provider.ref
|
|
452
820
|
)
|
|
@@ -467,19 +835,23 @@ class StudioPluginRuntime:
|
|
|
467
835
|
manifests.append(manifest)
|
|
468
836
|
factories[provider_id] = factory
|
|
469
837
|
|
|
838
|
+
allowed = set(builtin_capability_permissions(bundle.composition.profile))
|
|
470
839
|
builtin_ids = {
|
|
471
840
|
manifest.metadata.id
|
|
472
841
|
for manifest in (
|
|
473
842
|
*builtin_agent_provider_manifests(),
|
|
474
843
|
*builtin_capability_manifests(),
|
|
844
|
+
dsh_profile_mcp_manifest(),
|
|
845
|
+
platform_resource_mcp_manifest(),
|
|
475
846
|
)
|
|
476
847
|
}
|
|
477
|
-
|
|
848
|
+
builtin_ids.discard(DSH_PROFILE_MCP_PLUGIN_ID)
|
|
849
|
+
allowed.update(
|
|
478
850
|
permission
|
|
479
851
|
for manifest in manifests
|
|
480
852
|
if manifest.metadata.id in builtin_ids
|
|
481
853
|
for permission in manifest.spec.permissions
|
|
482
|
-
|
|
854
|
+
)
|
|
483
855
|
security = bundle.resolved_agent_spec.get("security")
|
|
484
856
|
if isinstance(security, Mapping):
|
|
485
857
|
raw = security.get("allowedPermissions") or security.get("allowed_permissions") or []
|
|
@@ -505,6 +877,13 @@ class StudioPluginRuntime:
|
|
|
505
877
|
try:
|
|
506
878
|
host.preflight(bundle.composition.profile)
|
|
507
879
|
except PluginHostError as error:
|
|
880
|
+
if error.code == "plugin_permission_denied":
|
|
881
|
+
raise StudioError(
|
|
882
|
+
"PLUGIN_PERMISSION_DENIED",
|
|
883
|
+
"Agent 插件组合未通过运行前检查",
|
|
884
|
+
status_code=409,
|
|
885
|
+
details=_permission_denial_details(error),
|
|
886
|
+
) from error
|
|
508
887
|
code = (
|
|
509
888
|
"PLUGIN_PERMISSION_DENIED"
|
|
510
889
|
if error.code == "plugin_permission_denied"
|
|
@@ -525,28 +904,26 @@ class StudioPluginRuntime:
|
|
|
525
904
|
network = NetworkPolicy.model_validate(security.get("network") or {})
|
|
526
905
|
execution = spec.get("execution")
|
|
527
906
|
execution = execution if isinstance(execution, Mapping) else {}
|
|
528
|
-
retry
|
|
529
|
-
|
|
907
|
+
# Managed Harness owns provider retry/failover in ModelProviderPolicy.
|
|
908
|
+
# Retrying again inside the HTTP client multiplies attempts (for
|
|
909
|
+
# example 3 outer attempts x 2 hidden HTTP attempts), makes the public
|
|
910
|
+
# attempt counter dishonest, and applies two independent backoffs.
|
|
911
|
+
# Keep this transport call single-shot; the Harness loop performs the
|
|
912
|
+
# visible ten-attempt policy and emits one durable event per retry.
|
|
530
913
|
return _StudioHarnessReasoner(
|
|
531
914
|
self._model_client,
|
|
532
915
|
model=model,
|
|
533
916
|
network_policy=network,
|
|
534
917
|
timeout_seconds=int(
|
|
535
|
-
execution.get("timeoutSeconds") or execution.get("timeout_seconds") or
|
|
536
|
-
),
|
|
537
|
-
max_attempts=int(
|
|
538
|
-
retry.get("maxAttempts") or retry.get("max_attempts") or 2
|
|
539
|
-
),
|
|
540
|
-
backoff_seconds=float(
|
|
541
|
-
retry.get("backoffSeconds") or retry.get("backoff_seconds") or 1
|
|
918
|
+
execution.get("timeoutSeconds") or execution.get("timeout_seconds") or 600
|
|
542
919
|
),
|
|
920
|
+
max_attempts=1,
|
|
921
|
+
backoff_seconds=0,
|
|
543
922
|
)
|
|
544
923
|
|
|
545
924
|
def _external_manifest(self, profile: CompositionProfile) -> PluginManifest | None:
|
|
546
925
|
plugin_id, version = _parse_plugin_ref(profile.agent_provider.ref)
|
|
547
|
-
builtin_ids = {
|
|
548
|
-
manifest.metadata.id for manifest in builtin_agent_provider_manifests()
|
|
549
|
-
}
|
|
926
|
+
builtin_ids = {manifest.metadata.id for manifest in builtin_agent_provider_manifests()}
|
|
550
927
|
if plugin_id in builtin_ids:
|
|
551
928
|
return None
|
|
552
929
|
provider_ref = f"plugin://{plugin_id}@{version}"
|
|
@@ -565,9 +942,7 @@ class StudioPluginRuntime:
|
|
|
565
942
|
return cast(
|
|
566
943
|
CompositionProfile,
|
|
567
944
|
CompositionProfile.model_validate_json(
|
|
568
|
-
(bundle_root / "composition-profile.json").read_text(
|
|
569
|
-
encoding="utf-8"
|
|
570
|
-
)
|
|
945
|
+
(bundle_root / "composition-profile.json").read_text(encoding="utf-8")
|
|
571
946
|
),
|
|
572
947
|
)
|
|
573
948
|
except (OSError, UnicodeError, ValueError) as error:
|
|
@@ -595,17 +970,13 @@ class StudioPluginRuntime:
|
|
|
595
970
|
|
|
596
971
|
@staticmethod
|
|
597
972
|
def _select_model(build: BuildRecord, requested: str | None) -> str:
|
|
598
|
-
allowed = [
|
|
599
|
-
str(item) for item in build.runtime_lock.get("models") or [] if str(item)
|
|
600
|
-
]
|
|
973
|
+
allowed = [str(item) for item in build.runtime_lock.get("models") or [] if str(item)]
|
|
601
974
|
default = str(build.runtime_lock.get("model") or "").strip()
|
|
602
975
|
if default and default not in allowed:
|
|
603
976
|
allowed.insert(0, default)
|
|
604
977
|
selected = str(requested or default).strip()
|
|
605
978
|
if not selected:
|
|
606
|
-
raise StudioError(
|
|
607
|
-
"AGENT_MODEL_REQUIRED", "Build 没有绑定可运行模型", status_code=422
|
|
608
|
-
)
|
|
979
|
+
raise StudioError("AGENT_MODEL_REQUIRED", "Build 没有绑定可运行模型", status_code=422)
|
|
609
980
|
if allowed and selected not in allowed:
|
|
610
981
|
raise StudioError(
|
|
611
982
|
"MODEL_NOT_BOUND",
|
|
@@ -615,13 +986,36 @@ class StudioPluginRuntime:
|
|
|
615
986
|
)
|
|
616
987
|
return selected
|
|
617
988
|
|
|
989
|
+
|
|
618
990
|
def _parse_plugin_ref(value: str) -> tuple[str, str]:
|
|
619
991
|
plugin_id, version = value.removeprefix("plugin://").rsplit("@", 1)
|
|
620
992
|
return plugin_id, version
|
|
621
993
|
|
|
622
994
|
|
|
995
|
+
_PERMISSION_DENIAL_MARKER = "requests unapproved permissions:"
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
def _permission_denial_details(error: PluginHostError) -> dict[str, Any]:
|
|
999
|
+
"""把权限拒绝错误转成可自助修复的 details(缺失权限 + 修复指引)。"""
|
|
1000
|
+
|
|
1001
|
+
message = str(error)
|
|
1002
|
+
missing: list[str] = []
|
|
1003
|
+
if _PERMISSION_DENIAL_MARKER in message:
|
|
1004
|
+
tail = message.split(_PERMISSION_DENIAL_MARKER, 1)[1]
|
|
1005
|
+
missing = [item.strip() for item in tail.split(",") if item.strip()]
|
|
1006
|
+
return {
|
|
1007
|
+
"reason": error.code,
|
|
1008
|
+
"missingPermissions": missing,
|
|
1009
|
+
"hint": (
|
|
1010
|
+
"在 Agent 安全设置的允许权限中加入缺失权限后重新构建并运行"
|
|
1011
|
+
if missing
|
|
1012
|
+
else "在 Agent 安全设置中调整允许权限后重新构建并运行"
|
|
1013
|
+
),
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
|
|
623
1017
|
def _normalize_result(raw: Any, *, session_id: str) -> StudioPluginTurnResult:
|
|
624
|
-
if isinstance(raw, HarnessTurnResult):
|
|
1018
|
+
if isinstance(raw, (CodexTurnResult, HarnessTurnResult)):
|
|
625
1019
|
return StudioPluginTurnResult(
|
|
626
1020
|
output_text=raw.output_text,
|
|
627
1021
|
session_id=raw.session_id,
|
|
@@ -630,9 +1024,7 @@ def _normalize_result(raw: Any, *, session_id: str) -> StudioPluginTurnResult:
|
|
|
630
1024
|
raw=raw,
|
|
631
1025
|
)
|
|
632
1026
|
if not isinstance(raw, Mapping):
|
|
633
|
-
raise PluginHostError(
|
|
634
|
-
"provider_result_invalid", "AgentProvider result must be an object"
|
|
635
|
-
)
|
|
1027
|
+
raise PluginHostError("provider_result_invalid", "AgentProvider result must be an object")
|
|
636
1028
|
output_text = str(raw.get("outputText") or raw.get("output_text") or raw.get("output") or "")
|
|
637
1029
|
if not output_text:
|
|
638
1030
|
raise PluginHostError(
|