agentengine-sdk-python 0.8.4__py3-none-any.whl → 0.8.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agentengine_sdk_python-0.8.4.dist-info → agentengine_sdk_python-0.8.6.dist-info}/METADATA +17 -10
- agentengine_sdk_python-0.8.6.dist-info/RECORD +1731 -0
- ksadk/_async_iterators.py +79 -0
- ksadk/_build_provenance.json +1 -1
- ksadk/_model_anthropic.py +49 -0
- ksadk/_model_input.py +86 -0
- ksadk/_model_json.py +40 -0
- ksadk/_model_reasoning.py +17 -0
- ksadk/_model_refusal.py +20 -0
- ksadk/_model_sse.py +163 -0
- ksadk/_process.py +83 -0
- ksadk/_str_enum.py +17 -0
- ksadk/a2a/__init__.py +157 -167
- ksadk/a2a/_invocation_state.py +86 -0
- ksadk/a2a/_space_client_events.py +33 -22
- ksadk/a2a/adk.py +194 -0
- ksadk/a2a/adk_invocation_context.py +242 -0
- ksadk/a2a/adk_runtime.py +126 -0
- ksadk/a2a/adk_tools.py +319 -0
- ksadk/a2a/bootstrap.py +149 -23
- ksadk/a2a/build_validation.py +147 -0
- ksadk/a2a/card.py +23 -15
- ksadk/a2a/codex.py +160 -0
- ksadk/a2a/codex_checkpoint.py +111 -0
- ksadk/a2a/codex_recovery.py +96 -0
- ksadk/a2a/codex_recovery_events.py +123 -0
- ksadk/a2a/codex_runtime.py +198 -0
- ksadk/a2a/codex_session_checkpoint.py +162 -0
- ksadk/a2a/composition.py +88 -0
- ksadk/a2a/context_store.py +118 -19
- ksadk/a2a/control_plane.py +108 -106
- ksadk/a2a/event_adapter.py +92 -193
- ksadk/a2a/executor.py +257 -85
- ksadk/a2a/exposure.py +106 -0
- ksadk/a2a/external_transport.py +3 -4
- ksadk/a2a/identity.py +106 -12
- ksadk/a2a/ids.py +14 -3
- ksadk/a2a/inbound_kernel.py +133 -0
- ksadk/a2a/interaction_wire.py +76 -0
- ksadk/a2a/invocation_checkpoint.py +274 -0
- ksadk/a2a/invocation_policy.py +87 -0
- ksadk/a2a/invocation_publication.py +210 -0
- ksadk/a2a/invocation_service.py +972 -0
- ksadk/a2a/invocation_types.py +459 -0
- ksadk/a2a/kernel_task_adapter.py +259 -0
- ksadk/a2a/langgraph.py +20 -7
- ksadk/a2a/langgraph_invocation_context.py +136 -0
- ksadk/a2a/langgraph_managed.py +150 -0
- ksadk/a2a/langgraph_recovery.py +32 -0
- ksadk/a2a/langgraph_runtime.py +89 -0
- ksadk/a2a/langgraph_tool_runtime.py +132 -0
- ksadk/a2a/langgraph_tools.py +63 -0
- ksadk/a2a/message_digest.py +40 -0
- ksadk/a2a/platform.py +389 -0
- ksadk/a2a/policy_refs.py +13 -0
- ksadk/a2a/presentation.py +402 -0
- ksadk/a2a/product_kernel_facts.py +177 -0
- ksadk/a2a/product_key.py +99 -0
- ksadk/a2a/protocol_errors.py +116 -0
- ksadk/a2a/result_text.py +49 -0
- ksadk/a2a/resume_store.py +93 -3
- ksadk/a2a/routes.py +6 -1
- ksadk/a2a/runtime_approval.py +198 -0
- ksadk/a2a/runtime_input.py +151 -0
- ksadk/a2a/server.py +16 -7
- ksadk/a2a/space_client.py +101 -16
- ksadk/a2a/task_adapter.py +19 -5
- ksadk/a2a/task_event_dispatcher.py +39 -2
- ksadk/a2a/task_event_outbox.py +215 -0
- ksadk/a2a/task_event_outbox_owned.py +130 -0
- ksadk/a2a/task_store.py +37 -0
- ksadk/a2a/tool_activity.py +176 -0
- ksadk/a2a/workload_tokens.py +134 -0
- ksadk/a2ui/core.py +3 -3
- ksadk/api/client.py +38 -79
- ksadk/api/sse_stream.py +96 -0
- ksadk/builders/code_builder.py +121 -118
- ksadk/builders/container_builder.py +11 -29
- ksadk/builders/framework_requirements.py +22 -2
- ksadk/builders/managed_runtime_builder.py +12 -0
- ksadk/builders/source_provenance.py +87 -0
- ksadk/cli/__init__.py +36 -0
- ksadk/cli/cmd_a2a.py +43 -0
- ksadk/cli/cmd_build.py +9 -0
- ksadk/cli/cmd_config.py +4 -4
- ksadk/cli/cmd_create.py +12 -12
- ksadk/cli/cmd_deploy.py +27 -2
- ksadk/cli/cmd_hermes.py +24 -2
- ksadk/cli/cmd_invoke.py +64 -88
- ksadk/cli/cmd_openclaw.py +26 -1
- ksadk/cli/cmd_plugin.py +70 -12
- ksadk/cli/cmd_studio.py +69 -17
- ksadk/cli/cmd_web.py +2 -0
- ksadk/cli/hosted_invoke.py +206 -0
- ksadk/cli/invoke_content.py +60 -0
- ksadk/cli/openclaw_env.py +1 -1
- ksadk/cli/resource_common.py +26 -0
- ksadk/cli/runtime_bootstrap.py +27 -5
- ksadk/codex/_expert_request_reader.py +48 -0
- ksadk/codex/a2a_tools.py +140 -0
- ksadk/codex/async_approval.py +169 -0
- ksadk/codex/async_client.py +938 -0
- ksadk/codex/async_proxy.py +216 -0
- ksadk/codex/base_runtime.py +25 -0
- ksadk/codex/client.py +3 -1047
- ksadk/codex/client_payloads.py +85 -0
- ksadk/codex/rollout_checkpoint.py +264 -0
- ksadk/codex/runtime.py +290 -54
- ksadk/common/auth.py +2 -2
- ksadk/common/cloud_headers.py +36 -0
- ksadk/common/diagnostics.py +34 -0
- ksadk/common/kop_client.py +2 -1
- ksadk/configs/__init__.py +1 -1
- ksadk/configs/env_registry.py +216 -143
- ksadk/configs/env_registry_a2a.py +173 -0
- ksadk/configs/env_registry_studio.py +134 -0
- ksadk/configs/global_config.py +2 -1
- ksadk/configs/settings.py +9 -3
- ksadk/connector/__init__.py +17 -0
- ksadk/connector/channel.py +477 -0
- ksadk/context_engine/assembler.py +9 -0
- ksadk/context_engine/capabilities.py +52 -4
- ksadk/context_engine/contributors.py +80 -17
- ksadk/context_engine/instruction_authority.py +18 -0
- ksadk/conversations/attachment_storage.py +10 -3
- ksadk/conversations/attachments.py +69 -20
- ksadk/conversations/contracts.py +28 -9
- ksadk/conversations/message_projection.py +51 -155
- ksadk/conversations/message_projection_blocks.py +137 -0
- ksadk/conversations/model_context.py +11 -3
- ksadk/conversations/normalize.py +28 -10
- ksadk/conversations/projector.py +63 -0
- ksadk/conversations/runtime_baseline.py +37 -0
- ksadk/conversations/runtime_compaction.py +7 -2
- ksadk/conversations/runtime_input.py +16 -4
- ksadk/conversations/runtime_invocation.py +17 -4
- ksadk/conversations/runtime_observability.py +39 -10
- ksadk/conversations/runtime_payloads.py +12 -0
- ksadk/conversations/runtime_persistence.py +296 -32
- ksadk/conversations/runtime_preparation.py +98 -13
- ksadk/conversations/runtime_projection.py +217 -0
- ksadk/conversations/runtime_resume.py +141 -70
- ksadk/conversations/runtime_stream_events.py +29 -35
- ksadk/conversations/runtime_streaming.py +8 -0
- ksadk/conversations/tool_receipt_resume.py +387 -0
- ksadk/conversations/tool_receipts.py +32 -0
- ksadk/deployment/env_forward.py +5 -0
- ksadk/deployment/manager.py +15 -6
- ksadk/deployment/providers/serverless.py +76 -136
- ksadk/deployment/providers/serverless_payloads.py +122 -0
- ksadk/evaluation/agent_eval_client.py +2 -1
- ksadk/evaluation/contracts.py +78 -3
- ksadk/evaluation/evaluators.py +166 -1
- ksadk/evaluation/evidence.py +271 -4
- ksadk/evaluation/local_adapter.py +76 -12
- ksadk/evaluation/studio_build_adapter.py +73 -9
- ksadk/events/adapters/_a2a_checkpoint.py +151 -0
- ksadk/events/adapters/_a2a_snapshot.py +18 -14
- ksadk/events/adapters/_a2a_support.py +15 -3
- ksadk/events/adapters/_a2a_tool_activity.py +123 -0
- ksadk/events/adapters/_codex_errors.py +49 -0
- ksadk/events/adapters/_codex_items.py +16 -8
- ksadk/events/adapters/_langgraph_support.py +46 -1
- ksadk/events/adapters/a2a.py +54 -26
- ksadk/events/adapters/adk.py +188 -30
- ksadk/events/adapters/codex.py +33 -7
- ksadk/events/adapters/langgraph.py +16 -6
- ksadk/events/canonical.py +5 -0
- ksadk/events/canonical_store.py +200 -4
- ksadk/events/reducer.py +82 -0
- ksadk/events/run_authority.py +176 -0
- ksadk/events/session_event.py +2 -2
- ksadk/harness/__init__.py +18 -0
- ksadk/harness/app.py +11 -0
- ksadk/harness/artifact_adapters/__init__.py +1 -0
- ksadk/harness/artifact_adapters/native_page_budget.py +172 -0
- ksadk/harness/artifact_adapters/native_search.py +249 -0
- ksadk/harness/artifact_adapters/native_search_budget.py +134 -0
- ksadk/harness/artifact_adapters/native_store.py +115 -0
- ksadk/harness/artifact_adapters/native_tool.py +222 -0
- ksadk/harness/artifact_store.py +230 -0
- ksadk/harness/browser_adapters/__init__.py +6 -0
- ksadk/harness/browser_adapters/native_browser_tool.py +92 -0
- ksadk/harness/browser_adapters/native_dom_snapshot.py +187 -0
- ksadk/harness/browser_adapters/native_playwright.py +953 -0
- ksadk/harness/browser_adapters/native_vision.py +295 -0
- ksadk/harness/capabilities.py +115 -0
- ksadk/harness/capability_adapters/__init__.py +1 -0
- ksadk/harness/capability_adapters/native_dsh.py +289 -0
- ksadk/harness/capability_runtime.py +332 -0
- ksadk/harness/closure_contract.py +92 -0
- ksadk/harness/compaction_record.py +153 -0
- ksadk/harness/compiler.py +284 -0
- ksadk/harness/config.py +28 -5
- ksadk/harness/conformance/__init__.py +33 -0
- ksadk/harness/conformance/contract.py +504 -0
- ksadk/harness/conformance/fixtures.py +102 -0
- ksadk/harness/context_engine.py +388 -0
- ksadk/harness/context_maintenance.py +259 -0
- ksadk/harness/context_manifest.py +188 -0
- ksadk/harness/context_sections.py +397 -0
- ksadk/harness/context_tuning.py +168 -0
- ksadk/harness/diagnostic_adapters/__init__.py +1 -0
- ksadk/harness/diagnostic_adapters/contracts.py +70 -0
- ksadk/harness/diagnostic_adapters/lsp_rpc.py +210 -0
- ksadk/harness/diagnostic_adapters/native_lsp.py +286 -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 +57 -0
- ksadk/harness/engine/context_pipeline.py +1351 -0
- ksadk/harness/engine/graph_builder.py +352 -0
- ksadk/harness/engine/hooked_reasoner.py +380 -0
- ksadk/harness/engine/langgraph.py +1049 -0
- ksadk/harness/engine/mcp_disclosure.py +701 -0
- ksadk/harness/engine/phases/__init__.py +6 -0
- ksadk/harness/engine/phases/context.py +48 -0
- ksadk/harness/engine/phases/interaction.py +31 -0
- ksadk/harness/engine/phases/reason.py +552 -0
- ksadk/harness/engine/phases/tools.py +638 -0
- ksadk/harness/engine/policy_runtime.py +81 -0
- ksadk/harness/engine/postgres_checkpointer.py +386 -0
- ksadk/harness/engine/run_control_bridge.py +100 -0
- ksadk/harness/engine/run_types.py +98 -0
- ksadk/harness/engine/skill_disclosure.py +275 -0
- ksadk/harness/engine/spans.py +41 -0
- ksadk/harness/engine/steering.py +177 -0
- ksadk/harness/engine/subagents.py +360 -0
- ksadk/harness/engine/thread_ids.py +112 -0
- ksadk/harness/engine/tool_dispatch.py +249 -0
- ksadk/harness/event_tree.py +212 -0
- ksadk/harness/events.py +498 -0
- ksadk/harness/execution_policy.py +104 -0
- ksadk/harness/hooks.py +259 -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 +699 -0
- ksadk/harness/loop/tools.py +907 -0
- ksadk/harness/managed_runtime.py +1044 -0
- ksadk/harness/mcp_disclosure_contract.py +85 -0
- ksadk/harness/mcp_matrix.py +474 -0
- ksadk/harness/mcp_result_policy.py +44 -0
- ksadk/harness/mcp_runtime.py +504 -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/micro_compact.py +69 -0
- ksadk/harness/model_adapters/__init__.py +1 -0
- ksadk/harness/model_adapters/native_mcp_media.py +100 -0
- ksadk/harness/model_adapters/native_mcp_result.py +36 -0
- ksadk/harness/model_adapters/native_openai.py +703 -0
- ksadk/harness/model_capability.py +468 -0
- ksadk/harness/model_provider.py +430 -0
- ksadk/harness/multimodal.py +57 -0
- ksadk/harness/native/__init__.py +1 -0
- ksadk/harness/native/activation_contract.py +25 -0
- ksadk/harness/native/activation_recovery.py +29 -0
- ksadk/harness/native/adapters.py +291 -0
- ksadk/harness/native/artifact_contract.py +14 -0
- ksadk/harness/native/artifact_partial_read_capacity.py +171 -0
- ksadk/harness/native/artifact_read_capacity.py +182 -0
- ksadk/harness/native/artifact_read_contract.py +27 -0
- ksadk/harness/native/artifact_runtime.py +408 -0
- ksadk/harness/native/artifact_search_capacity.py +206 -0
- ksadk/harness/native/artifact_search_contract.py +40 -0
- ksadk/harness/native/artifact_single_read_capacity.py +170 -0
- ksadk/harness/native/browser_contract.py +229 -0
- ksadk/harness/native/browser_recovery.py +183 -0
- ksadk/harness/native/capabilities.py +204 -0
- ksadk/harness/native/child_approval.py +60 -0
- ksadk/harness/native/child_budget.py +136 -0
- ksadk/harness/native/child_cancellation.py +80 -0
- ksadk/harness/native/child_input.py +98 -0
- ksadk/harness/native/child_input_runtime.py +59 -0
- ksadk/harness/native/child_interruption.py +81 -0
- ksadk/harness/native/child_lifecycle.py +246 -0
- ksadk/harness/native/child_lifecycle_contract.py +91 -0
- ksadk/harness/native/child_notifications.py +75 -0
- ksadk/harness/native/child_promotion.py +66 -0
- ksadk/harness/native/command_runtime.py +99 -0
- ksadk/harness/native/completion.py +302 -0
- ksadk/harness/native/completion_text.py +116 -0
- ksadk/harness/native/context.py +358 -0
- ksadk/harness/native/context_artifact_page.py +75 -0
- ksadk/harness/native/context_compaction_projection.py +131 -0
- ksadk/harness/native/context_contributions.py +320 -0
- ksadk/harness/native/context_contributor_contract.py +133 -0
- ksadk/harness/native/context_driver.py +820 -0
- ksadk/harness/native/context_fresh_tools.py +49 -0
- ksadk/harness/native/context_history.py +272 -0
- ksadk/harness/native/context_microcompact.py +61 -0
- ksadk/harness/native/context_partial_summary.py +58 -0
- ksadk/harness/native/context_partition.py +492 -0
- ksadk/harness/native/context_pruning.py +275 -0
- ksadk/harness/native/context_reduction.py +60 -0
- ksadk/harness/native/context_replay.py +148 -0
- ksadk/harness/native/context_request_projection.py +526 -0
- ksadk/harness/native/context_runtime.py +976 -0
- ksadk/harness/native/context_runtime_contracts.py +409 -0
- ksadk/harness/native/context_search.py +112 -0
- ksadk/harness/native/context_source_fragments.py +188 -0
- ksadk/harness/native/context_source_progress.py +119 -0
- ksadk/harness/native/context_summary_planning.py +788 -0
- ksadk/harness/native/context_summary_recovery.py +105 -0
- ksadk/harness/native/delivery_review.py +331 -0
- ksadk/harness/native/delivery_review_contract.py +54 -0
- ksadk/harness/native/effect_admission.py +82 -0
- ksadk/harness/native/effect_control.py +318 -0
- ksadk/harness/native/effect_receipts.py +729 -0
- ksadk/harness/native/effect_runtime.py +303 -0
- ksadk/harness/native/effective_configuration.py +28 -0
- ksadk/harness/native/engine.py +945 -0
- ksadk/harness/native/final_output.py +34 -0
- ksadk/harness/native/final_submission.py +58 -0
- ksadk/harness/native/finalization_workspace.py +96 -0
- ksadk/harness/native/fork.py +151 -0
- ksadk/harness/native/guidance.py +91 -0
- ksadk/harness/native/history.py +381 -0
- ksadk/harness/native/hook_executor.py +205 -0
- ksadk/harness/native/hook_runtime_contract.py +282 -0
- ksadk/harness/native/interaction_observation.py +117 -0
- ksadk/harness/native/lease.py +103 -0
- ksadk/harness/native/machine.py +974 -0
- ksadk/harness/native/mcp_result_governance.py +156 -0
- ksadk/harness/native/model.py +570 -0
- ksadk/harness/native/model_feedback.py +63 -0
- ksadk/harness/native/model_input.py +30 -0
- ksadk/harness/native/model_recovery_contract.py +35 -0
- ksadk/harness/native/model_replay.py +128 -0
- ksadk/harness/native/model_request.py +133 -0
- ksadk/harness/native/model_runtime.py +196 -0
- ksadk/harness/native/model_takeover.py +419 -0
- ksadk/harness/native/model_tool_batch.py +40 -0
- ksadk/harness/native/observed_progress.py +46 -0
- ksadk/harness/native/operator_guidance.py +201 -0
- ksadk/harness/native/output_contract.py +80 -0
- ksadk/harness/native/output_recovery.py +24 -0
- ksadk/harness/native/ports.py +749 -0
- ksadk/harness/native/precompact_hook_runtime.py +171 -0
- ksadk/harness/native/replay_context.py +149 -0
- ksadk/harness/native/request_media.py +112 -0
- ksadk/harness/native/restore_contract.py +16 -0
- ksadk/harness/native/run_clock.py +120 -0
- ksadk/harness/native/state.py +436 -0
- ksadk/harness/native/steering.py +170 -0
- ksadk/harness/native/stop_hook_runtime.py +151 -0
- ksadk/harness/native/studio_admission.py +29 -0
- ksadk/harness/native/subagents.py +86 -0
- ksadk/harness/native/task_policy.py +99 -0
- ksadk/harness/native/task_progress.py +86 -0
- ksadk/harness/native/terminal_verification.py +43 -0
- ksadk/harness/native/tool_argument_feedback.py +178 -0
- ksadk/harness/native/tool_budget.py +253 -0
- ksadk/harness/native/tool_error_streak.py +89 -0
- ksadk/harness/native/tool_hook_runtime.py +343 -0
- ksadk/harness/native/tool_input_validation.py +58 -0
- ksadk/harness/native/tool_interruption.py +96 -0
- ksadk/harness/native/tool_observation.py +259 -0
- ksadk/harness/native/tool_progress.py +223 -0
- ksadk/harness/native/tool_recovery.py +25 -0
- ksadk/harness/native/tool_scheduling.py +33 -0
- ksadk/harness/native/tool_schema.py +126 -0
- ksadk/harness/native/transitions.py +151 -0
- ksadk/harness/native/turn_control.py +98 -0
- ksadk/harness/native/user_document.py +98 -0
- ksadk/harness/native/user_document_capture.py +49 -0
- ksadk/harness/native/user_input.py +87 -0
- ksadk/harness/native/verification.py +432 -0
- ksadk/harness/native/verification_binding.py +40 -0
- ksadk/harness/native/verification_runtime.py +233 -0
- ksadk/harness/native/verification_workspace.py +67 -0
- ksadk/harness/native_driver_failure.py +123 -0
- ksadk/harness/native_facade.py +977 -0
- ksadk/harness/native_factory.py +244 -0
- ksadk/harness/native_projection.py +503 -0
- ksadk/harness/native_runtime.py +621 -0
- ksadk/harness/native_shadow.py +250 -0
- ksadk/harness/native_shadow_inputs.py +146 -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/progress_adapters/__init__.py +5 -0
- ksadk/harness/progress_adapters/native_todo.py +75 -0
- ksadk/harness/prompt_cache.py +132 -0
- ksadk/harness/public_activity.py +213 -0
- ksadk/harness/public_output.py +30 -0
- ksadk/harness/public_summary.py +36 -0
- ksadk/harness/readiness.py +249 -0
- ksadk/harness/reasoner.py +779 -17
- ksadk/harness/release_readiness.py +140 -0
- ksadk/harness/resource_ref.py +69 -0
- ksadk/harness/rpc.py +200 -0
- ksadk/harness/run_control.py +773 -0
- ksadk/harness/runtime.py +157 -113
- ksadk/harness/runtime_capabilities.py +228 -0
- ksadk/harness/runtime_server.py +514 -0
- ksadk/harness/sandbox_adapters.py +739 -0
- ksadk/harness/sandbox_backend.py +733 -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/sdk.py +153 -0
- ksadk/harness/session_store.py +589 -0
- ksadk/harness/skill_adapters/__init__.py +1 -0
- ksadk/harness/skill_adapters/native_bundle.py +148 -0
- ksadk/harness/skill_adapters/native_disclosure.py +306 -0
- ksadk/harness/skill_composition.py +212 -0
- ksadk/harness/skill_feedback.py +123 -0
- ksadk/harness/skill_intent.py +47 -0
- ksadk/harness/skill_matrix.py +233 -0
- ksadk/harness/skill_runtime.py +317 -0
- ksadk/harness/spec.py +342 -0
- ksadk/harness/state.py +155 -0
- ksadk/harness/stores/__init__.py +14 -0
- ksadk/harness/stores/native_command_settlement.py +65 -0
- ksadk/harness/stores/native_contract.py +311 -0
- ksadk/harness/stores/native_memory.py +326 -0
- ksadk/harness/stores/native_memory_archive.py +70 -0
- ksadk/harness/stores/native_migration_cli.py +91 -0
- ksadk/harness/stores/native_outbox.py +56 -0
- ksadk/harness/stores/native_sqlite.py +782 -0
- ksadk/harness/stores/native_sqlite_audit.py +29 -0
- ksadk/harness/stores/native_sqlite_migration.py +252 -0
- ksadk/harness/strategies.py +149 -0
- ksadk/harness/subagent.py +263 -0
- ksadk/harness/subagent_adapters/checkpoint_recovery.py +120 -0
- ksadk/harness/subagent_adapters/native_background_child.py +803 -0
- ksadk/harness/subagent_adapters/native_child.py +819 -0
- ksadk/harness/subagent_adapters/native_child_approval.py +128 -0
- ksadk/harness/subagent_adapters/native_child_continuation.py +51 -0
- ksadk/harness/subagent_adapters/native_child_result.py +392 -0
- ksadk/harness/subagent_adapters/prepared_recovery.py +120 -0
- ksadk/harness/tool_display.py +75 -0
- ksadk/harness/tool_display_contract.py +134 -0
- ksadk/harness/tool_output.py +141 -0
- ksadk/harness/tool_policy.py +134 -0
- ksadk/harness/tool_receipts.py +96 -0
- ksadk/harness/tool_reliability.py +81 -0
- ksadk/harness/tool_result_policy.py +216 -0
- ksadk/harness/tools.py +52 -0
- ksadk/harness/user_errors.py +69 -0
- ksadk/harness/working_context.py +81 -0
- ksadk/harness/working_context_patch.py +99 -0
- ksadk/harness/workspace_adapters/__init__.py +6 -0
- ksadk/harness/workspace_adapters/native_directory.py +180 -0
- ksadk/harness/workspace_adapters/native_git.py +208 -0
- ksadk/harness/workspace_adapters/native_isolation.py +350 -0
- ksadk/identity/resolver.py +18 -0
- ksadk/interaction/__init__.py +1 -1
- ksadk/interaction/ledger.py +1 -1
- ksadk/interaction/provider.py +1 -1
- ksadk/interaction/providers/__init__.py +3 -1
- ksadk/interaction/providers/adk.py +1 -1
- ksadk/interaction/providers/codex.py +1 -1
- ksadk/interaction/providers/harness.py +50 -0
- ksadk/interaction/providers/langgraph.py +9 -2
- ksadk/kernel/__init__.py +10 -0
- ksadk/kernel/approval_presentation.py +91 -0
- ksadk/kernel/authorization.py +1 -1
- ksadk/kernel/bootstrap.py +220 -252
- ksadk/kernel/contract_fingerprints.py +45 -1
- ksadk/kernel/contracts.py +30 -0
- ksadk/kernel/control.py +180 -29
- ksadk/kernel/execution_grants.py +428 -0
- ksadk/kernel/execution_grants_memory.py +252 -0
- ksadk/kernel/execution_grants_postgres.py +395 -0
- ksadk/kernel/execution_grants_sqlite.py +435 -0
- ksadk/kernel/execution_host_ingress.py +1071 -0
- ksadk/kernel/history_projection.py +120 -0
- ksadk/kernel/ingress.py +139 -226
- ksadk/kernel/ingress_bootstrap.py +268 -0
- ksadk/kernel/legacy_history.py +179 -0
- ksadk/kernel/mapping.py +1 -1
- ksadk/kernel/memory_store.py +61 -58
- ksadk/kernel/memory_store_projection.py +63 -0
- ksadk/kernel/postgres_event_log.py +181 -0
- ksadk/kernel/postgres_store.py +230 -231
- ksadk/kernel/readiness.py +125 -0
- ksadk/kernel/recovery.py +166 -16
- ksadk/kernel/recovery_projection.py +124 -0
- ksadk/kernel/runtime_checkpoint.py +34 -0
- ksadk/kernel/sql/001_agent_kernel.sql +28 -0
- ksadk/kernel/sqlite_schema.py +100 -0
- ksadk/kernel/sqlite_store.py +410 -200
- ksadk/kernel/state.py +2 -3
- ksadk/kernel/store.py +104 -5
- ksadk/kernel/teams_artifact_tools.py +392 -0
- ksadk/kernel/teams_effects.py +851 -0
- ksadk/kernel/teams_execution_context.py +408 -0
- ksadk/kernel/teams_host_http.py +237 -0
- ksadk/kernel/teams_material_transport.py +245 -0
- ksadk/kernel/teams_materials.py +318 -0
- ksadk/kernel/teams_runtime_bootstrap.py +604 -0
- ksadk/kernel/teams_tool_runtime.py +273 -0
- ksadk/kernel/teams_workspace.py +259 -0
- ksadk/kernel/worker.py +369 -340
- ksadk/kernel/worker_controls.py +454 -0
- ksadk/kernel/worker_history.py +72 -0
- ksadk/kernel/worker_identity.py +74 -0
- ksadk/kernel/worker_interactions.py +197 -0
- ksadk/knowledge_base/client.py +15 -1
- ksadk/managed_runtime.py +29 -2
- ksadk/memory/adk/backends/http_ltm_backend.py +2 -1
- ksadk/memory/adk/backends/sdk_ltm_backend.py +15 -1
- ksadk/memory/adk/bounded_database_session_service.py +232 -0
- ksadk/memory/adk/resilient_session_service.py +115 -15
- ksadk/memory/adk/short_term_memory.py +8 -9
- ksadk/memory/coordinator.py +22 -6
- ksadk/memory/extraction.py +159 -7
- ksadk/memory/models.py +77 -1
- ksadk/memory/provider_resolver.py +5 -0
- ksadk/memory/providers/local_candidates.py +183 -0
- ksadk/memory/providers/local_postgres.py +200 -0
- ksadk/memory/providers/local_sqlite.py +280 -67
- ksadk/memory/resolved_policy.py +12 -7
- ksadk/memory/retrieval.py +189 -0
- ksadk/memory/store_adapter.py +150 -0
- ksadk/model_gateway/__init__.py +29 -0
- ksadk/model_gateway/client.py +253 -0
- ksadk/model_gateway/events.py +113 -0
- ksadk/model_gateway/matrix.py +297 -0
- ksadk/model_policy.py +2 -2
- ksadk/model_proxy/compat.py +670 -0
- ksadk/model_proxy/detect.py +254 -0
- ksadk/model_proxy/server.py +14 -9
- ksadk/model_proxy/transform.py +72 -6
- ksadk/plugins/__init__.py +1 -1
- ksadk/plugins/bridges/dsh.py +29 -20
- ksadk/plugins/bridges/dsh_profile_manifest.py +36 -0
- ksadk/plugins/builtin_resources.py +199 -0
- ksadk/plugins/builtins.py +417 -185
- ksadk/plugins/companion_artifacts.py +83 -0
- ksadk/plugins/companions.py +368 -0
- ksadk/plugins/context_contributor.py +15 -4
- ksadk/plugins/contracts.py +1 -1
- ksadk/plugins/dsh_channels.py +156 -0
- ksadk/plugins/dsh_dependency_policy.py +41 -0
- ksadk/plugins/dsh_home.py +140 -0
- ksadk/plugins/dsh_teams.py +105 -0
- ksadk/plugins/dsh_toolchain.py +92 -21
- ksadk/plugins/execution_host.py +107 -0
- ksadk/plugins/host.py +73 -5
- ksadk/plugins/kernel_adapter.py +44 -1
- ksadk/plugins/memory_provider.py +180 -0
- ksadk/plugins/providers/_process_group.py +50 -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/index.mjs +24 -2
- ksadk/plugins/providers/bundles/dsh-knowledge/package.json +1 -1
- ksadk/plugins/providers/bundles/dsh-memory/package.json +1 -1
- ksadk/plugins/providers/bundles/dsh-skill-center/package.json +1 -1
- ksadk/plugins/providers/bundles/dsh-teams-client/client.js +29 -0
- ksadk/plugins/providers/bundles/dsh-teams-client/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-teams-client/index.mjs +11 -0
- ksadk/plugins/providers/bundles/dsh-teams-client/package.json +35 -0
- ksadk/plugins/providers/bundles/dsh-teams-leader-policy/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-teams-leader-policy/index.mjs +13 -0
- ksadk/plugins/providers/bundles/dsh-teams-leader-policy/package.json +27 -0
- ksadk/plugins/providers/bundles/dsh-teams-profile/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-teams-profile/index.mjs +12 -0
- ksadk/plugins/providers/bundles/dsh-teams-profile/package.json +26 -0
- ksadk/plugins/providers/bundles/dsh-teams-router/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-teams-router/index.mjs +16 -0
- ksadk/plugins/providers/bundles/dsh-teams-router/package.json +27 -0
- ksadk/plugins/providers/bundles/dsh-teams-tasks/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-teams-tasks/index.mjs +16 -0
- ksadk/plugins/providers/bundles/dsh-teams-tasks/package.json +27 -0
- ksadk/plugins/providers/bundles/dsh-teams-tools/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-teams-tools/index.mjs +25 -0
- ksadk/plugins/providers/bundles/dsh-teams-tools/package.json +29 -0
- ksadk/plugins/providers/bundles/dsh-teams-tools/tools.json +235 -0
- ksadk/plugins/providers/bundles/ksadk-codex/index.mjs +1 -1
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/index.mjs +51 -1
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/package.json +2 -2
- ksadk/plugins/providers/bundles/ksadk-dsh-companion-host/client.mjs +133 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-companion-host/index.mjs +14 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/client.js +27 -4
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/index.mjs +9 -5
- ksadk/plugins/providers/bundles/ksadk-harness/index.mjs +1 -1
- ksadk/plugins/providers/codex.py +52 -40
- ksadk/plugins/providers/codex_native.py +20 -0
- ksadk/plugins/providers/codex_skills.py +46 -0
- ksadk/plugins/providers/dsh_capabilities.py +49 -143
- ksadk/plugins/providers/dsh_connector_lease.py +225 -0
- ksadk/plugins/providers/dsh_mcp.py +163 -1
- ksadk/plugins/providers/harness.py +413 -52
- ksadk/plugins/providers/harness_context.py +61 -0
- ksadk/plugins/providers/harness_contributions.py +241 -0
- ksadk/plugins/providers/harness_delegation.py +670 -0
- ksadk/plugins/providers/harness_hooks.py +121 -0
- ksadk/plugins/providers/harness_managed.py +550 -0
- ksadk/plugins/providers/harness_tools.py +455 -0
- ksadk/plugins/providers/legacy_catalog.py +1 -1
- ksadk/plugins/providers/mcp_projection.py +100 -3
- ksadk/plugins/providers/platform_resources.py +16 -6
- ksadk/plugins/providers/shipped_dsh.py +4 -1
- ksadk/plugins/subagent_providers/codex.py +28 -6
- ksadk/plugins/teams/__init__.py +5 -0
- ksadk/plugins/teams/api.py +405 -0
- ksadk/plugins/teams/application.py +540 -0
- ksadk/plugins/teams/artifacts.py +60 -0
- ksadk/plugins/teams/build_artifacts.py +460 -0
- ksadk/plugins/teams/cloud_contract_fingerprints.py +22 -0
- ksadk/plugins/teams/cloud_contracts.py +928 -0
- ksadk/plugins/teams/cloud_permits.py +250 -0
- ksadk/plugins/teams/context.py +96 -0
- ksadk/plugins/teams/contracts.py +136 -0
- ksadk/plugins/teams/domain.py +1480 -0
- ksadk/plugins/teams/domain_values.py +24 -0
- ksadk/plugins/teams/effect_contracts.py +255 -0
- ksadk/plugins/teams/errors.py +13 -0
- ksadk/plugins/teams/execution_projection.py +255 -0
- ksadk/plugins/teams/leader_decisions.py +106 -0
- ksadk/plugins/teams/migration.py +311 -0
- ksadk/plugins/teams/migration_cli.py +322 -0
- ksadk/plugins/teams/postgres_store.py +352 -0
- ksadk/plugins/teams/release_contracts.py +60 -0
- ksadk/plugins/teams/runtime.py +853 -0
- ksadk/plugins/teams/source_projection.py +84 -0
- ksadk/plugins/teams/store.py +519 -0
- ksadk/plugins/teams/task_decisions.py +436 -0
- ksadk/plugins/teams/tool_service.py +152 -0
- ksadk/plugins/teams/transport.py +96 -0
- ksadk/plugins/teams/workspaces.py +255 -0
- ksadk/resource_runtime/skill_runtime.py +3 -0
- ksadk/resource_runtime/socket_server.py +11 -0
- ksadk/resource_runtime/worker.py +28 -4
- ksadk/runners/_adk_a2a_stream.py +122 -0
- ksadk/runners/_adk_canonical_stream.py +474 -0
- ksadk/runners/_langgraph_canonical_streams.py +527 -0
- ksadk/runners/_langgraph_runner_streams.py +83 -401
- ksadk/runners/_langgraph_state_reader.py +106 -0
- ksadk/runners/_langgraph_tool_projection.py +86 -0
- ksadk/runners/_langgraph_tools_transformer.py +27 -0
- ksadk/runners/_session_identity.py +285 -0
- ksadk/runners/adk_runner.py +220 -350
- ksadk/runners/base_runner.py +6 -5
- ksadk/runners/langgraph_runner.py +208 -195
- ksadk/runners/patch_langchain.py +47 -0
- ksadk/runners/usage_accumulator.py +11 -3
- ksadk/runners/utils/loader.py +28 -14
- ksadk/runtime/_runner_adapter/a2ui_surface.py +145 -0
- ksadk/runtime/_runner_adapter/gateway_approvals.py +93 -0
- ksadk/runtime/_runner_adapter/stream_mapping.py +134 -129
- ksadk/runtime/adapter.py +40 -3
- ksadk/runtime/conversation_execution.py +29 -3
- ksadk/runtime/executor.py +105 -7
- ksadk/runtime/factory.py +45 -3
- ksadk/runtime/framework_adapters.py +184 -10
- ksadk/runtime/hosted_finalizer.py +4 -6
- ksadk/runtime/launch.py +2 -0
- ksadk/runtime/preprocessing.py +11 -3
- ksadk/runtime/runner_adapter.py +160 -21
- ksadk/runtime/skill_eval_result.py +36 -0
- ksadk/runtime/timing.py +46 -0
- ksadk/runtime/usage.py +49 -18
- ksadk/runtime_context.py +105 -1
- ksadk/sandbox/backends/e2b.py +272 -24
- ksadk/sandbox/backends/local_process.py +73 -39
- ksadk/sandbox/base.py +62 -1
- ksadk/sandbox/diagnostics.py +82 -0
- ksadk/sandbox/e2b_connection.py +9 -1
- ksadk/sandbox/local_controls.py +776 -0
- ksadk/sandbox/local_launcher.py +124 -0
- ksadk/scheduler/dispatcher.py +1 -1
- ksadk/server/factory.py +178 -25
- ksadk/server/history_deadline.py +158 -0
- ksadk/server/history_page_cache.py +129 -0
- ksadk/server/invocation_identity.py +118 -0
- ksadk/server/routes/checkpoint_audit.py +88 -0
- ksadk/server/routes/checkpoint_listing.py +294 -0
- ksadk/server/routes/checkpoint_resolution.py +73 -20
- ksadk/server/routes/common.py +32 -3
- ksadk/server/routes/control.py +112 -9
- ksadk/server/routes/dependencies.py +2 -1
- ksadk/server/routes/display_projection.py +154 -0
- ksadk/server/routes/kernel_ingress.py +26 -3
- ksadk/server/routes/misc.py +331 -33
- ksadk/server/routes/models.py +28 -4
- ksadk/server/routes/openai_compat.py +82 -13
- ksadk/server/routes/projection.py +159 -216
- ksadk/server/routes/run.py +112 -37
- ksadk/server/routes/sessions.py +493 -358
- ksadk/server/routes/streaming.py +68 -15
- ksadk/server/routes/tool_receipt_claim_routes.py +107 -0
- ksadk/server/routes/workspace.py +135 -23
- ksadk/server/static/assets/{ArtifactsPanel-CGbWlMNh.js → ArtifactsPanel-CILaW-fC.js} +1 -1
- ksadk/server/static/assets/{CodeBlock-b4C7upmO.js → CodeBlock-BVrNVtJC.js} +10 -7
- ksadk/server/static/assets/MathMessageMarkdown-Dp7c4wWD.js +8 -0
- ksadk/server/static/assets/{MermaidBlock-BEBN4Ksz.js → MermaidBlock-Dxop8Rd7.js} +9 -9
- ksadk/server/static/assets/{NativeTerminalPanel-zvL-WpAn.js → NativeTerminalPanel-Cjjz8B30.js} +1 -1
- ksadk/server/static/assets/{abnfDiagram-VCTEODGH-BYafW7Za.js → abnfDiagram-VCTEODGH-ckWDmOzw.js} +1 -1
- ksadk/server/static/assets/{arc-bTohInsS.js → arc-DqxJede-.js} +1 -1
- ksadk/server/static/assets/architecture-7GRP2DOG-pn_DuLy6.js +1 -0
- ksadk/server/static/assets/{architectureDiagram-5GKGNRK7-Ch5Lbzsi.js → architectureDiagram-5GKGNRK7-SEQA4bVi.js} +1 -1
- ksadk/server/static/assets/{blockDiagram-NRAW4CY4-kqF4MDOG.js → blockDiagram-NRAW4CY4-pM0B-6NJ.js} +1 -1
- ksadk/server/static/assets/{c4Diagram-UCG6FXSJ-8uSRIODv.js → c4Diagram-UCG6FXSJ-m2tuCNVq.js} +1 -1
- ksadk/server/static/assets/channel-fySsnkft.js +1 -0
- ksadk/server/static/assets/chunk-2Q5K7J3B-BheGxKRQ.js +1 -0
- ksadk/server/static/assets/{chunk-5VM5RSS4-DkhehZDr.js → chunk-5VM5RSS4-GJHDr9Ww.js} +1 -1
- ksadk/server/static/assets/{chunk-F27PBJKO-BdXhtPe9.js → chunk-F27PBJKO-CbAN45AV.js} +1 -1
- ksadk/server/static/assets/{chunk-G27WJ6UU-DPTpvpwi.js → chunk-G27WJ6UU-D5ngbbzF.js} +1 -1
- ksadk/server/static/assets/{chunk-JWPE2WC7-Pqoh38el.js → chunk-JWPE2WC7-Cc5IwuYC.js} +1 -1
- ksadk/server/static/assets/{chunk-LCL6LL3I-DeU00qC-.js → chunk-LCL6LL3I-CprgDDdJ.js} +1 -1
- ksadk/server/static/assets/{chunk-POPQ4Y6H-CzxScFkr.js → chunk-POPQ4Y6H-CDZhSy82.js} +1 -1
- ksadk/server/static/assets/{chunk-RHFEMEQ7-DpqMx-ux.js → chunk-RHFEMEQ7-CZchUNro.js} +1 -1
- ksadk/server/static/assets/{chunk-SVP7TREG-C6t0SypQ.js → chunk-SVP7TREG-BVruqk6T.js} +1 -1
- ksadk/server/static/assets/{chunk-XXDRQBXY-DVaeafZk.js → chunk-XXDRQBXY-4ld9SxPN.js} +1 -1
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-DSfLtNYm.js +1 -0
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-DSfLtNYm.js +1 -0
- ksadk/server/static/assets/{cose-bilkent-JH36ORCC-Bf9D3tzJ.js → cose-bilkent-JH36ORCC-Dmyyk_Vp.js} +1 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-PFWIGtvA.js +1 -0
- ksadk/server/static/assets/{cynefinDiagram-5FMLGOSQ-B9cY3iTz.js → cynefinDiagram-5FMLGOSQ-BIyq3EJb.js} +1 -1
- ksadk/server/static/assets/{dagre-3AP2YEHR-CSwlx3CB.js → dagre-3AP2YEHR-eBw08Qdk.js} +1 -1
- ksadk/server/static/assets/{dagre-UBpgon5q.js → dagre-DfvnEf45.js} +1 -1
- ksadk/server/static/assets/{diagram-S7CK7UJ4-C9akhN9a.js → diagram-S7CK7UJ4-CUSrE3Mg.js} +1 -1
- ksadk/server/static/assets/{diagram-UQ7AKVKN-CgedhTPI.js → diagram-UQ7AKVKN-Dq5Zw2gy.js} +1 -1
- ksadk/server/static/assets/{diagram-VSXAHHWV-Cjucz5BY.js → diagram-VSXAHHWV-DyUHfNwT.js} +1 -1
- ksadk/server/static/assets/{diagram-VX7I27RA-Dd4Vleyn.js → diagram-VX7I27RA-CREmM89O.js} +1 -1
- ksadk/server/static/assets/{diagram-Z3DM3KII-CZ2jGtYW.js → diagram-Z3DM3KII-Dw9zhHUK.js} +1 -1
- ksadk/server/static/assets/{dist-Bj730Ib4.js → dist-0uJ4tdx6.js} +1 -1
- ksadk/server/static/assets/{dist-BnaTiyzN.js → dist-AEv-vXf-.js} +1 -1
- ksadk/server/static/assets/{dist-BgV_owcB.js → dist-B49GzZDb.js} +1 -1
- ksadk/server/static/assets/{dist-D_ctSS2i.js → dist-B8Myiet9.js} +1 -1
- ksadk/server/static/assets/{dist-ufY3F5p6.js → dist-BBsYarrI.js} +2 -2
- ksadk/server/static/assets/{dist-ClYUxfeK.js → dist-BQMrUwdI.js} +1 -1
- ksadk/server/static/assets/{dist-CFzsn6BG.js → dist-BX_-FENW.js} +1 -1
- ksadk/server/static/assets/{dist-B3FR1SKK.js → dist-CD4L6ymH.js} +1 -1
- ksadk/server/static/assets/{dist-Cf125P_m.js → dist-CHpW1BHj.js} +1 -1
- ksadk/server/static/assets/{dist-DVCOWtha.js → dist-CVPau3tn.js} +1 -1
- ksadk/server/static/assets/{dist-DFD6Qa6T.js → dist-C_qdxcSH.js} +1 -1
- ksadk/server/static/assets/{dist-BIr4DSRq.js → dist-Co68Apq4.js} +1 -1
- ksadk/server/static/assets/{dist-DiixqL0J.js → dist-Cp2PaOMY.js} +1 -1
- ksadk/server/static/assets/{dist-fBO2v5Kt.js → dist-CuR5Bgme.js} +1 -1
- ksadk/server/static/assets/{dist-DoVSwoDb.js → dist-DDSyLEOX.js} +1 -1
- ksadk/server/static/assets/{dist-C5_ZAZsG.js → dist-DUxO0R99.js} +1 -1
- ksadk/server/static/assets/{dist-C1NMAY5a.js → dist-QzbGrED_.js} +1 -1
- ksadk/server/static/assets/dist-bupkyEBZ.js +1 -0
- ksadk/server/static/assets/{dist-DvFK7p5S.js → dist-cxTGfdqx.js} +1 -1
- ksadk/server/static/assets/{dist-CB9iJrvg.js → dist-hL5p1til.js} +1 -1
- ksadk/server/static/assets/{dist-btbmmX5O.js → dist-lOy23y43.js} +1 -1
- ksadk/server/static/assets/{dist-QfkEHOlb.js → dist-pq-nD33R.js} +1 -1
- ksadk/server/static/assets/{ebnfDiagram-PWID7BFC-Ci8NqqZu.js → ebnfDiagram-PWID7BFC-BS5LdNoR.js} +1 -1
- ksadk/server/static/assets/{erDiagram-SSCWMZ5O-CCIOhLZG.js → erDiagram-SSCWMZ5O-Bv1QtiY-.js} +1 -1
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-DsM4upQX.js +1 -0
- ksadk/server/static/assets/flowDiagram-A5DVABFB-D5NA16k9.js +1 -0
- ksadk/server/static/assets/{ganttDiagram-EL5Y4UJY-Cp_r9Hb6.js → ganttDiagram-EL5Y4UJY-musi-e0G.js} +1 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-DUCVz-ih.js +1 -0
- ksadk/server/static/assets/{gitGraphDiagram-WWUBYQGX-Dlhc8Wr8.js → gitGraphDiagram-WWUBYQGX-DH37EGkG.js} +1 -1
- ksadk/server/static/assets/index-CZdkAvsv.js +244 -0
- ksadk/server/static/assets/index-CvXdHgF3.css +2 -0
- ksadk/server/static/assets/info-A6RAGUB7-rw0ZNHZp.js +1 -0
- ksadk/server/static/assets/{infoDiagram-RXCK75RN-CO0rRTRA.js → infoDiagram-RXCK75RN-C1kEtv2y.js} +1 -1
- ksadk/server/static/assets/{ishikawaDiagram-5VMMS53U-CHiaedSS.js → ishikawaDiagram-5VMMS53U-BCNPyMka.js} +1 -1
- ksadk/server/static/assets/{journeyDiagram-EYS64GPL-CHcCIB09.js → journeyDiagram-EYS64GPL--cDbKnjP.js} +1 -1
- ksadk/server/static/assets/{kanban-definition-3QL26DDD-CJ_ebBZf.js → kanban-definition-3QL26DDD-R1rAVw2f.js} +1 -1
- ksadk/server/static/assets/{katex-B4weu383.js → katex-BT-X-V7U.js} +1 -1
- ksadk/server/static/assets/{linear-V-MgYHW1.js → linear-DTR631iG.js} +1 -1
- ksadk/server/static/assets/{mermaid-parser.core-CBijEX_c.js → mermaid-parser.core-DfFzJhX8.js} +2 -2
- ksadk/server/static/assets/{mindmap-definition-FBJOCRG2-Bc-pQvpp.js → mindmap-definition-FBJOCRG2-D4by_rmk.js} +1 -1
- ksadk/server/static/assets/packet-AYTQ26CC-Ca4Hvki9.js +1 -0
- ksadk/server/static/assets/{pegDiagram-XKGWAZYB-D7genGLl.js → pegDiagram-XKGWAZYB-xWXPEh0c.js} +1 -1
- ksadk/server/static/assets/pie-WAS4IAKB-hwiz6fbw.js +1 -0
- ksadk/server/static/assets/{pieDiagram-E7YTZNPT-Bxj32zwD.js → pieDiagram-E7YTZNPT-BudBDlCI.js} +1 -1
- ksadk/server/static/assets/{quadrantDiagram-AXDQQJYC-BURv2mGh.js → quadrantDiagram-AXDQQJYC-DXZ0PCJF.js} +1 -1
- ksadk/server/static/assets/radar-RG4KPBEZ-BR1oZXLM.js +1 -0
- ksadk/server/static/assets/railroad-74A4TZTK-DfgEISfX.js +1 -0
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-CWOC3rdk.js +1 -0
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-CiRvHCLY.js +1 -0
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-DSDDyJ2f.js +1 -0
- ksadk/server/static/assets/{railroadDiagram-O6MQD6OU-CCsh3avW.js → railroadDiagram-O6MQD6OU-BdAYRYB8.js} +1 -1
- ksadk/server/static/assets/{requirementDiagram-EFPCY7ZU-_FRRBKEd.js → requirementDiagram-EFPCY7ZU-CBBmaL70.js} +1 -1
- ksadk/server/static/assets/{sankeyDiagram-P5KCCOFB-C-gr2o9M.js → sankeyDiagram-P5KCCOFB-Doc3rdwp.js} +1 -1
- ksadk/server/static/assets/{sequenceDiagram-WJ2MYXX4-D97NmfKg.js → sequenceDiagram-WJ2MYXX4-0J8R8hWW.js} +1 -1
- ksadk/server/static/assets/{sizeCapture-X5ZJPWSS-DjrPC5FX.js → sizeCapture-X5ZJPWSS-CfFLlWsK.js} +1 -1
- ksadk/server/static/assets/{stateDiagram-HBIQ2CUA-DzMNg1hh.js → stateDiagram-HBIQ2CUA-jBwkjtTy.js} +1 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-Cw1fPb5w.js +1 -0
- ksadk/server/static/assets/{swimlanes-XN3QIQJK-Cssf_CsU.js → swimlanes-XN3QIQJK-B0WxTQf8.js} +1 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-Cc3JMBAF.js +8 -0
- ksadk/server/static/assets/{timeline-definition-24CTP7MA-BWTHzyS1.js → timeline-definition-24CTP7MA-BfCT_75A.js} +1 -1
- ksadk/server/static/assets/treeView-Q6P3EWNA-C05SJHxo.js +1 -0
- ksadk/server/static/assets/treemap-WGGIJYW6-BqNLAhc3.js +1 -0
- ksadk/server/static/assets/{vennDiagram-4TSXK5OY-BSKgJsmR.js → vennDiagram-4TSXK5OY-9gX1VMDC.js} +1 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-DokNktqB.js +1 -0
- ksadk/server/static/assets/{wardleyDiagram-VM6X3IG4-eflHNoaZ.js → wardleyDiagram-VM6X3IG4-sEs_BP6O.js} +1 -1
- ksadk/server/static/assets/{xychartDiagram-S5SC5T6Z-eYqrQ-v4.js → xychartDiagram-S5SC5T6Z-Ll4jvUN9.js} +1 -1
- ksadk/server/static/index.html +2 -2
- ksadk/server/terminal_sessions.py +34 -2
- ksadk/sessions/__init__.py +8 -1
- ksadk/sessions/_checkpoint_resume_audit.py +44 -0
- ksadk/sessions/_in_memory_query.py +112 -0
- ksadk/sessions/_local_service_sync.py +157 -156
- ksadk/sessions/_local_state_sync.py +152 -0
- ksadk/sessions/_local_tables.py +2 -0
- ksadk/sessions/_postgres_checkpoint_read.py +323 -0
- ksadk/sessions/_postgres_checkpoint_stats.py +330 -0
- ksadk/sessions/_postgres_history_read.py +678 -0
- ksadk/sessions/_postgres_schema.py +44 -2
- ksadk/sessions/_postgres_tables.py +2 -0
- ksadk/sessions/_postgres_tool_receipts.py +169 -0
- ksadk/sessions/_resilient_read.py +630 -0
- ksadk/sessions/_tool_receipt_sync.py +119 -0
- ksadk/sessions/agent_identity.py +16 -0
- ksadk/sessions/base.py +278 -0
- ksadk/sessions/db_budget.py +332 -0
- ksadk/sessions/errors.py +12 -0
- ksadk/sessions/history_budget.py +36 -0
- ksadk/sessions/history_identity.py +27 -0
- ksadk/sessions/in_memory.py +376 -113
- ksadk/sessions/invocation_identity.py +235 -0
- ksadk/sessions/local_service.py +345 -0
- ksadk/sessions/postgres_service.py +515 -549
- ksadk/sessions/resilience.py +21 -14
- ksadk/sessions/resilient.py +611 -504
- ksadk/skills/__init__.py +26 -0
- ksadk/skills/events.py +464 -0
- ksadk/skills/loader.py +44 -2
- ksadk/skills/manifest_cache.py +263 -0
- ksadk/skills/mcp_server/__init__.py +0 -0
- ksadk/skills/mcp_server/_registry.py +33 -0
- ksadk/skills/mcp_server/_routing.py +26 -0
- ksadk/skills/mcp_server/_workspace_files.py +160 -0
- ksadk/skills/mcp_server/register.py +415 -0
- ksadk/skills/mcp_server/server.py +218 -0
- ksadk/skills/models.py +11 -0
- ksadk/skills/observability.py +132 -0
- ksadk/skills/package_store.py +75 -2
- ksadk/skills/runtime/agent.py +38 -5
- ksadk/skills/runtime/artifacts.py +87 -0
- ksadk/skills/runtime/backends/e2b.py +400 -56
- ksadk/skills/runtime/backends/local.py +621 -119
- ksadk/skills/runtime/base.py +78 -7
- ksadk/skills/runtime/executor.py +266 -1
- ksadk/skills/runtime/loader.py +108 -3
- ksadk/skills/runtime/request.py +18 -0
- ksadk/skills/service_client.py +6 -1
- ksadk/skills/tool_defs.py +108 -3
- ksadk/studio/a2a_bindings.py +407 -0
- ksadk/studio/a2a_orchestration.py +178 -0
- ksadk/studio/active_run_output.py +92 -0
- ksadk/studio/activity_records.py +542 -0
- ksadk/studio/agent_configuration.py +173 -0
- ksadk/studio/api.py +784 -419
- ksadk/studio/api_a2a_routes.py +93 -0
- ksadk/studio/api_catalog_routes.py +13 -0
- ksadk/studio/api_cloud_chat_routes.py +382 -0
- ksadk/studio/api_contracts.py +31 -2
- ksadk/studio/api_plugin_routes.py +39 -12
- ksadk/studio/api_resource_connections.py +79 -41
- ksadk/studio/attachment_store.py +14 -2
- ksadk/studio/authoring.py +12 -6
- ksadk/studio/authoring_coordinator.py +4 -2
- ksadk/studio/build_resolution.py +117 -0
- ksadk/studio/build_singleflight.py +37 -0
- ksadk/studio/builder.py +32 -2
- ksadk/studio/capabilities.py +31 -9
- ksadk/studio/channel_connections.py +333 -0
- ksadk/studio/cloud.py +113 -387
- ksadk/studio/cloud_gateways.py +424 -0
- ksadk/studio/cloud_shared_web.py +82 -2
- ksadk/studio/codex_agent_service.py +19 -2
- ksadk/studio/codex_builder.py +1 -1
- ksadk/studio/codex_manifest.py +5 -1
- ksadk/studio/codex_provider_build.py +65 -0
- ksadk/studio/codex_run.py +6 -1
- ksadk/studio/compiler.py +112 -6
- ksadk/studio/configuration.py +182 -0
- ksadk/studio/contract_base.py +19 -0
- ksadk/studio/contracts.py +260 -202
- ksadk/studio/dsh_application.py +183 -27
- ksadk/studio/dsh_capability_service.py +302 -189
- ksadk/studio/dsh_lifecycle.py +58 -0
- ksadk/studio/dsh_mcp_transport.py +191 -0
- ksadk/studio/dsh_provider_registration.py +55 -16
- ksadk/studio/entry.py +53 -0
- ksadk/studio/event_store.py +53 -5
- ksadk/studio/execution_host.py +598 -0
- ksadk/studio/framework_run.py +50 -10
- ksadk/studio/hosted_kernel.py +1 -1
- ksadk/studio/interaction_submission.py +265 -0
- ksadk/studio/kernel_registry.py +429 -0
- ksadk/studio/kernel_sqlite_migration.py +181 -0
- ksadk/studio/lifecycle_status.py +43 -0
- ksadk/studio/model_buffered_wire.py +227 -0
- ksadk/studio/model_chat_tools.py +143 -0
- ksadk/studio/model_client.py +1939 -345
- ksadk/studio/model_content_stream.py +129 -0
- ksadk/studio/model_credentials.py +196 -0
- ksadk/studio/model_profile_service.py +89 -40
- ksadk/studio/model_request_projection.py +284 -0
- ksadk/studio/model_responses_content.py +296 -0
- ksadk/studio/model_usage.py +109 -0
- ksadk/studio/model_wire_failure.py +110 -0
- ksadk/studio/model_wire_identity.py +138 -0
- ksadk/studio/model_wire_snapshot.py +45 -0
- ksadk/studio/model_wire_tools.py +283 -0
- ksadk/studio/native_acceptance.py +68 -0
- ksadk/studio/native_approval.py +111 -0
- ksadk/studio/native_browser_port.py +861 -0
- ksadk/studio/native_child_mcp.py +87 -0
- ksadk/studio/native_child_publication.py +68 -0
- ksadk/studio/native_child_skills.py +72 -0
- ksadk/studio/native_child_workspace.py +176 -0
- ksadk/studio/native_command_policy.py +53 -0
- ksadk/studio/native_context_port.py +326 -0
- ksadk/studio/native_context_registration.py +54 -0
- ksadk/studio/native_document_input.py +88 -0
- ksadk/studio/native_documents.py +172 -0
- ksadk/studio/native_final_shape.py +852 -0
- ksadk/studio/native_gateway_stream.py +69 -0
- ksadk/studio/native_hook_port.py +145 -0
- ksadk/studio/native_hook_registration.py +70 -0
- ksadk/studio/native_inventory_disclosure.py +223 -0
- ksadk/studio/native_kernel_admission.py +84 -0
- ksadk/studio/native_language_diagnostics.py +320 -0
- ksadk/studio/native_mcp_disclosure.py +198 -0
- ksadk/studio/native_mcp_tool_port.py +219 -0
- ksadk/studio/native_memory_acceptance.py +362 -0
- ksadk/studio/native_memory_context.py +266 -0
- ksadk/studio/native_memory_flush.py +174 -0
- ksadk/studio/native_memory_sources.py +80 -0
- ksadk/studio/native_memory_tool_port.py +360 -0
- ksadk/studio/native_memory_turn.py +183 -0
- ksadk/studio/native_model_port.py +765 -0
- ksadk/studio/native_model_recovery.py +126 -0
- ksadk/studio/native_options.py +75 -0
- ksadk/studio/native_output_fields.py +58 -0
- ksadk/studio/native_planning.py +156 -0
- ksadk/studio/native_product.py +988 -0
- ksadk/studio/native_read_budget.py +426 -0
- ksadk/studio/native_recovery.py +171 -0
- ksadk/studio/native_scope.py +35 -0
- ksadk/studio/native_session_context_port.py +141 -0
- ksadk/studio/native_session_engine.py +14 -0
- ksadk/studio/native_skill_source.py +74 -0
- ksadk/studio/native_subagent_port.py +700 -0
- ksadk/studio/native_terminal_recovery.py +95 -0
- ksadk/studio/native_test_action.py +610 -0
- ksadk/studio/native_tool_port.py +477 -0
- ksadk/studio/native_user_input.py +60 -0
- ksadk/studio/native_verification_presentation.py +65 -0
- ksadk/studio/native_workspace_diagnostics.py +183 -0
- ksadk/studio/native_workspace_port.py +43 -0
- ksadk/studio/operations.py +34 -9
- ksadk/studio/plugin_composition.py +39 -12
- ksadk/studio/plugin_kernel_adapter.py +89 -0
- ksadk/studio/plugin_lifecycle.py +80 -0
- ksadk/studio/plugin_native_activation.py +163 -0
- ksadk/studio/plugin_runtime.py +832 -99
- ksadk/studio/plugin_runtime_admission.py +57 -0
- ksadk/studio/presentation.py +92 -0
- ksadk/studio/provider_recovery.py +59 -0
- ksadk/studio/public_output_store.py +69 -0
- ksadk/studio/recovery_page.py +70 -0
- ksadk/studio/resource_authority.py +69 -34
- ksadk/studio/resource_catalog.py +14 -12
- ksadk/studio/run_activity.py +848 -0
- ksadk/studio/run_controls.py +185 -0
- ksadk/studio/run_documents.py +127 -0
- ksadk/studio/run_service.py +1220 -335
- ksadk/studio/run_submission_receipts.py +68 -0
- ksadk/studio/runtime_catalog.py +73 -11
- ksadk/studio/runtime_prewarm.py +22 -0
- ksadk/studio/runtime_source.py +1 -1
- ksadk/studio/scheduler_assistant.py +4 -1
- ksadk/studio/scheduler_runtime.py +32 -289
- ksadk/studio/service.py +615 -246
- ksadk/studio/service_settings.py +229 -0
- ksadk/studio/shared_web.py +518 -181
- ksadk/studio/shared_web_response_events.py +180 -0
- ksadk/studio/shared_web_run_state.py +133 -0
- ksadk/studio/skill_discovery.py +305 -3
- ksadk/studio/static/assets/ChannelsPage-xX5HlMId.js +8 -0
- ksadk/studio/static/assets/CodeBlock-DMIf4h33-CkufcPYo.js +44 -0
- ksadk/studio/static/assets/ExecutionTree-v3HexvPo-Bk8wzGSy.js +1 -0
- ksadk/studio/static/assets/MathMessageMarkdown-BesSeCYl-DYG1Wzbx.js +8 -0
- ksadk/studio/static/assets/MermaidBlock-H_0qzQDf-BdXtxug_.js +11 -0
- ksadk/studio/static/assets/MessageMarkdown-CwMTvgFj-BeyLyQHu.js +59 -0
- ksadk/studio/static/assets/PrismRenderer-5pK6tUdb.js +3 -0
- ksadk/studio/static/assets/TeamsPage-CCaaGaVp.js +3 -0
- ksadk/studio/static/assets/abnfDiagram-VCTEODGH-Bnb1O3tA.js +1 -0
- ksadk/studio/static/assets/architecture-7GRP2DOG-BMOPAkUC.js +1 -0
- ksadk/studio/static/assets/architectureDiagram-5GKGNRK7-5Zn1gqJv.js +36 -0
- ksadk/studio/static/assets/{blockDiagram-I7D4REHJ-CFmPl1de.js → blockDiagram-I7D4REHJ-CLB4L11u.js} +6 -6
- ksadk/studio/static/assets/{c4Diagram-7LVT6UL2-BRrGu8qt.js → c4Diagram-7LVT6UL2-BOma_Z_F.js} +7 -7
- ksadk/studio/static/assets/channel-r8itPEik.js +1 -0
- ksadk/studio/static/assets/chunk-2E4U76K2-BFf_huql.js +2 -0
- ksadk/studio/static/assets/chunk-2ZTRR5NV-C2qZJila.js +2 -0
- ksadk/studio/static/assets/chunk-3Z5EZCMW-DMniOlPd.js +1 -0
- ksadk/studio/static/assets/{chunk-4HAMMTFA-D220vUtq.js → chunk-4HAMMTFA-DVtDP4rm.js} +7 -7
- ksadk/studio/static/assets/chunk-5V3GS4D5-i-ZDOEnP.js +1 -0
- ksadk/studio/static/assets/chunk-6AZGARVD-BB6FqMl-.js +1 -0
- ksadk/studio/static/assets/chunk-6EIED4P4-DdUJkP0f.js +1 -0
- ksadk/studio/static/assets/chunk-6K3QC6MW-CqVsVn-y.js +1 -0
- ksadk/studio/static/assets/chunk-6TQVIW2G-DKlLbNIP.js +1 -0
- ksadk/studio/static/assets/chunk-747NJXEK-BFkZPlab.js +2 -0
- ksadk/studio/static/assets/chunk-75Z2AOVW-BZNhM4vB.js +2 -0
- ksadk/studio/static/assets/chunk-CLGD4ZFX-D-GTtyKs.js +1 -0
- ksadk/studio/static/assets/{chunk-DU6HZSFF-C4DtVpCu.js → chunk-DU6HZSFF-CpEZCUgg.js} +1 -1
- ksadk/studio/static/assets/chunk-F27PBJKO-D7pvKf0C.js +1 -0
- ksadk/studio/static/assets/{chunk-GMAD6QVW-DiQA-u2N.js → chunk-GMAD6QVW-DE_8H717.js} +6 -6
- ksadk/studio/static/assets/chunk-GVQU2GXP-BfEB0lNv.js +1 -0
- ksadk/studio/static/assets/chunk-I5DQTOEV-Hm2LfiYI.js +1 -0
- ksadk/studio/static/assets/chunk-ICYGCRZG-749o-pGJ.js +1 -0
- ksadk/studio/static/assets/chunk-IH6LHLGP-CC6I9F3i.js +1 -0
- ksadk/studio/static/assets/{chunk-IMKFNOWR-BSlbjT_b.js → chunk-IMKFNOWR-D38axYOR.js} +5 -5
- ksadk/studio/static/assets/chunk-KI3K4JFJ-Rma-0k_M.js +1 -0
- ksadk/studio/static/assets/chunk-L3NEJ4N5-Dq5xn7aL.js +1 -0
- ksadk/studio/static/assets/chunk-LNGE3PJU-DWpGwHrW.js +34 -0
- ksadk/studio/static/assets/{chunk-OSK3NFVY-M2m6G3j4.js → chunk-OSK3NFVY-DiCQjx9b.js} +5 -5
- ksadk/studio/static/assets/chunk-OUJLGHUK-D0j2JRSg.js +2 -0
- ksadk/studio/static/assets/{chunk-P2QGCYS3-DezaQxiK.js → chunk-P2QGCYS3-VdhKmfYq.js} +1 -1
- ksadk/studio/static/assets/chunk-POPQ4Y6H-C1_rzO5M.js +1 -0
- ksadk/studio/static/assets/chunk-PWAF6VOD-B45HvflI.js +1 -0
- ksadk/studio/static/assets/{chunk-SHT3W25Y-DAyIVp5H.js → chunk-SHT3W25Y-DsCFnRVE.js} +9 -9
- ksadk/studio/static/assets/{chunk-SVP7TREG-DulomOrS.js → chunk-SVP7TREG-DljApgRX.js} +1 -1
- ksadk/studio/static/assets/{chunk-TICWLB2K-bHJYoflj.js → chunk-TICWLB2K-DWqRtyqa.js} +6 -6
- ksadk/studio/static/assets/chunk-TLUHSLCS-DUeGgnD5.js +2 -0
- ksadk/studio/static/assets/chunk-UY3FDG6J-CnmaAkG5.js +1 -0
- ksadk/studio/static/assets/chunk-XHIXRSVI-BFQ6B8BE.js +1 -0
- ksadk/studio/static/assets/chunk-XXDRQBXY-DqAYeljN.js +1 -0
- ksadk/studio/static/assets/classDiagram-ZZMXUADV-DjeMNJmu.js +1 -0
- ksadk/studio/static/assets/classDiagram-v2-VYDZK3BY-DjeMNJmu.js +1 -0
- ksadk/studio/static/assets/clsx-DB0hHKMi.js +1 -0
- ksadk/studio/static/assets/cose-bilkent-JH36ORCC-om8AY0Mc.js +1 -0
- ksadk/studio/static/assets/createLucideIcon-DR0LGTP5.js +1 -0
- ksadk/studio/static/assets/cynefin-OW5HDTMX-7tP7QfM3.js +1 -0
- ksadk/studio/static/assets/cynefinDiagram-5FMLGOSQ-6BrmK52S.js +62 -0
- ksadk/studio/static/assets/dagre-GXQ25YYZ-buZBRlwz.js +4 -0
- ksadk/studio/static/assets/{diagram-S7CK7UJ4-0BZ98mya.js → diagram-S7CK7UJ4-C6aH78c4.js} +3 -3
- ksadk/studio/static/assets/diagram-UQ7AKVKN-DY_tQ6C_.js +41 -0
- ksadk/studio/static/assets/diagram-VSXAHHWV-DX9p5cQT.js +3 -0
- ksadk/studio/static/assets/diagram-VX7I27RA-DB2WSH8X.js +24 -0
- ksadk/studio/static/assets/diagram-Z3DM3KII-Ce1BJwHE.js +24 -0
- ksadk/studio/static/assets/ebnfDiagram-PWID7BFC-Daukxwqf.js +1 -0
- ksadk/studio/static/assets/{erDiagram-RLTQ6QDP-DLGry2Ap.js → erDiagram-RLTQ6QDP-CGthTMmJ.js} +6 -6
- ksadk/studio/static/assets/eventmodeling-NTZA5JFV-BR2FzK4R.js +1 -0
- ksadk/studio/static/assets/flowDiagram-HODETNUW-CZ1tEenp.js +1 -0
- ksadk/studio/static/assets/ganttDiagram-EL5Y4UJY-BfoAZW9X.js +292 -0
- ksadk/studio/static/assets/gitGraph-4MIJSDKK-DYlXv_yJ.js +1 -0
- ksadk/studio/static/assets/gitGraphDiagram-WWUBYQGX-S985OIJF.js +106 -0
- ksadk/studio/static/assets/iconfont-4HN3C9Pg.woff2 +0 -0
- ksadk/studio/static/assets/index-C7DNDik2.css +2 -0
- ksadk/studio/static/assets/index-Cy68gTlH.js +265 -0
- ksadk/studio/static/assets/index.dom-BQenBtFm.js +1 -0
- ksadk/studio/static/assets/info-A6RAGUB7-BlU-8_xu.js +1 -0
- ksadk/studio/static/assets/infoDiagram-27XIBGKW-CO3W8tFn.js +2 -0
- ksadk/studio/static/assets/{ishikawaDiagram-5VMMS53U-CljI2wyf.js → ishikawaDiagram-5VMMS53U-BUGEl8cO.js} +2 -2
- ksadk/studio/static/assets/{journeyDiagram-3NMN7TZE-D50Fo2sL.js → journeyDiagram-3NMN7TZE-Ch2ZYxvr.js} +6 -6
- ksadk/studio/static/assets/{kanban-definition-UXKFOSKX-DimfOTam.js → kanban-definition-UXKFOSKX-Da-Fp4vC.js} +3 -3
- ksadk/studio/static/assets/kingsoft-cloud-BOcLiQ3e.ico +0 -0
- ksadk/studio/static/assets/{line-CX5BOOUP.js → line-BDaeq300.js} +1 -1
- ksadk/studio/static/assets/linear-DmucvK78.js +1 -0
- ksadk/studio/static/assets/mermaid-parser.core-Cj5mYdBi.js +4 -0
- ksadk/studio/static/assets/{mindmap-definition-YA3MSWOX-Bizzqy5R.js → mindmap-definition-YA3MSWOX-CvlsVQ38.js} +1 -1
- ksadk/studio/static/assets/packet-AYTQ26CC-BSJEH9Lb.js +1 -0
- ksadk/studio/static/assets/pegDiagram-XKGWAZYB-BuHuNgT5.js +1 -0
- ksadk/studio/static/assets/pie-WAS4IAKB-qxv01Y8W.js +1 -0
- ksadk/studio/static/assets/{pieDiagram-E7YTZNPT-B9mrFSDF.js → pieDiagram-E7YTZNPT-DlrWiSOv.js} +1 -1
- ksadk/studio/static/assets/preload-helper-CO68xz6u.js +1 -0
- ksadk/studio/static/assets/presentation-yYw7xK60-BmcZriri.js +1 -0
- ksadk/studio/static/assets/{quadrantDiagram-AXDQQJYC-NzUfCbMR.js → quadrantDiagram-AXDQQJYC-BA3hpUZM.js} +6 -6
- ksadk/studio/static/assets/radar-RG4KPBEZ-B6h6pWOs.js +1 -0
- ksadk/studio/static/assets/railroad-74A4TZTK-CGtTWdGc.js +1 -0
- ksadk/studio/static/assets/railroad-abnf-HS5TGJTU-Cq7y22IA.js +1 -0
- ksadk/studio/static/assets/railroad-ebnf-LZEXJU2U-V0aQVv9m.js +1 -0
- ksadk/studio/static/assets/railroad-peg-WCYAUIDC-BQiIsX_p.js +1 -0
- ksadk/studio/static/assets/railroadDiagram-O6MQD6OU-BxpAazym.js +1 -0
- ksadk/studio/static/assets/{requirementDiagram-BXWQKSXE-BF3d103U.js → requirementDiagram-BXWQKSXE-E-Ge0FcV.js} +1 -1
- ksadk/studio/static/assets/sankeyDiagram-P5KCCOFB-CA6YKhQ3.js +40 -0
- ksadk/studio/static/assets/{sequenceDiagram-WJ2MYXX4-Dh4wZtUm.js → sequenceDiagram-WJ2MYXX4-CcElXGg4.js} +9 -9
- ksadk/studio/static/assets/src-B6xuSHsQ.js +1 -0
- ksadk/studio/static/assets/stateDiagram-D77RDMKH-DdXZOFqY.js +1 -0
- ksadk/studio/static/assets/stateDiagram-v2-MP3YSRHH-CJbOM-QK.js +1 -0
- ksadk/studio/static/assets/swimlanes-42K2YHIH-NtgEEHLY.js +1 -0
- ksadk/studio/static/assets/swimlanesDiagram-VR7AAH4N-D-AVlW8B.js +8 -0
- ksadk/studio/static/assets/{timeline-definition-24CTP7MA-DxmSSjRB.js → timeline-definition-24CTP7MA-CIuYhNy3.js} +7 -7
- ksadk/studio/static/assets/treeView-Q6P3EWNA-BTTYcvrF.js +1 -0
- ksadk/studio/static/assets/treemap-WGGIJYW6-Cg7tyfH8.js +1 -0
- ksadk/studio/static/assets/vennDiagram-4TSXK5OY-7HbApbrv.js +34 -0
- ksadk/studio/static/assets/wardley-WFR3VGLG-C6N1rULY.js +1 -0
- ksadk/studio/static/assets/{wardleyDiagram-VM6X3IG4-Ba1AOWoe.js → wardleyDiagram-VM6X3IG4-CMJiaedy.js} +1 -1
- ksadk/studio/static/assets/{xychartDiagram-S5SC5T6Z-Cr5pt5Y-.js → xychartDiagram-S5SC5T6Z-BdgtMvW2.js} +6 -6
- ksadk/studio/static/index.html +8 -2
- ksadk/studio/teams_catalog.py +166 -0
- ksadk/studio/teams_installation.py +217 -0
- ksadk/studio/teams_node.py +549 -0
- ksadk/studio/teams_node_factory.py +558 -0
- ksadk/studio/teams_node_runner.py +72 -0
- ksadk/studio/teams_node_v1.py +935 -0
- ksadk/studio/teams_remote.py +496 -0
- ksadk/studio/templates.py +41 -19
- ksadk/studio/validator.py +13 -0
- ksadk/studio/workspace.py +19 -4
- ksadk/studio/workspace_plugins.py +138 -0
- ksadk/studio/workspace_registry.py +286 -0
- ksadk/tools/a2a_policy.py +5 -0
- ksadk/tools/artifact_observation.py +53 -0
- ksadk/tools/captured_source_artifact.py +68 -0
- ksadk/tools/schema.py +34 -0
- ksadk/toolsets/__init__.py +93 -88
- ksadk/toolsets/a2a.py +89 -89
- ksadk/toolsets/sandbox.py +377 -6
- ksadk/toolsets/skill_management.py +315 -0
- ksadk/toolsets/skills.py +446 -378
- ksadk/toolsets/tool_selection.py +94 -0
- ksadk/toolsets/workspace.py +344 -326
- ksadk/toolsets/workspace_editing.py +291 -0
- ksadk/toolsets/workspace_identity.py +15 -0
- ksadk/toolsets/workspace_model_observation.py +104 -0
- ksadk/toolsets/workspace_mutation.py +75 -0
- ksadk/toolsets/workspace_read_budget.py +216 -0
- ksadk/toolsets/workspace_search.py +192 -0
- ksadk/toolsets/workspace_search_process.py +129 -0
- ksadk/toolsets/workspace_state.py +6 -0
- ksadk/version.py +1 -1
- ksadk_runtime_common/http_headers.py +18 -0
- 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 +28 -14
- agentengine_sdk_python-0.8.4.dist-info/RECORD +0 -1070
- ksadk/server/static/assets/MathMessageMarkdown-DbdW5A4_.js +0 -8
- ksadk/server/static/assets/architecture-7GRP2DOG-BW5UtSnx.js +0 -1
- ksadk/server/static/assets/channel-CF5Up3hQ.js +0 -1
- ksadk/server/static/assets/chunk-2Q5K7J3B-KkXX47WI.js +0 -1
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-Cz81acRQ.js +0 -1
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-Cz81acRQ.js +0 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-DVWs8a2t.js +0 -1
- ksadk/server/static/assets/dist-B2_CVgKv.js +0 -1
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-CQqR2hg3.js +0 -1
- ksadk/server/static/assets/flowDiagram-A5DVABFB-DDRRbGPm.js +0 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-fgWEf7UD.js +0 -1
- ksadk/server/static/assets/index-DcTML1Up.css +0 -2
- ksadk/server/static/assets/index-Dh2XHqPK.js +0 -244
- ksadk/server/static/assets/info-A6RAGUB7-BUecLTdt.js +0 -1
- ksadk/server/static/assets/packet-AYTQ26CC-BeW-btFv.js +0 -1
- ksadk/server/static/assets/pie-WAS4IAKB-X0xh4SaT.js +0 -1
- ksadk/server/static/assets/radar-RG4KPBEZ-DzRMSqjd.js +0 -1
- ksadk/server/static/assets/railroad-74A4TZTK-Cc44icX-.js +0 -1
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-D6S4BdV-.js +0 -1
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-vD3aVE2o.js +0 -1
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-CYbW_b4T.js +0 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-BIcjKFhF.js +0 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-tq3K3Ybl.js +0 -8
- ksadk/server/static/assets/treeView-Q6P3EWNA-DBXt3GdU.js +0 -1
- ksadk/server/static/assets/treemap-WGGIJYW6-DrCy4E_l.js +0 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-CefhOliM.js +0 -1
- ksadk/studio/static/assets/CodeBlock-DCUUY0PL-BLjA7kbS.js +0 -41
- ksadk/studio/static/assets/MathMessageMarkdown-CBcDrAw--CUYIXwgI.js +0 -8
- ksadk/studio/static/assets/MermaidBlock-DBFTztfQ-BTYKWEbD.js +0 -44
- ksadk/studio/static/assets/PrismRenderer-wiXRHURw.js +0 -3
- ksadk/studio/static/assets/abnfDiagram-VCTEODGH-CLETGjKq.js +0 -1
- ksadk/studio/static/assets/architecture-7GRP2DOG-hXMiO_AU.js +0 -1
- ksadk/studio/static/assets/architectureDiagram-5GKGNRK7-B5EQysk6.js +0 -36
- ksadk/studio/static/assets/channel-BqO-gtEw.js +0 -1
- ksadk/studio/static/assets/chunk-75Z2AOVW-C8lLv_qc.js +0 -2
- ksadk/studio/static/assets/chunk-F27PBJKO-Cpw14SNG.js +0 -1
- ksadk/studio/static/assets/chunk-GVQU2GXP-DUdNBUCi.js +0 -1
- ksadk/studio/static/assets/chunk-L3NEJ4N5-Db8Ab22W.js +0 -1
- ksadk/studio/static/assets/chunk-POPQ4Y6H-DOpufJ3t.js +0 -1
- ksadk/studio/static/assets/chunk-PWAF6VOD-CfLb1gSc.js +0 -1
- ksadk/studio/static/assets/chunk-XXDRQBXY-7PcdR2B1.js +0 -1
- ksadk/studio/static/assets/classDiagram-ZZMXUADV-D_bW8JjA.js +0 -1
- ksadk/studio/static/assets/classDiagram-v2-VYDZK3BY-D_bW8JjA.js +0 -1
- ksadk/studio/static/assets/cose-bilkent-JH36ORCC-snL88wkX.js +0 -1
- ksadk/studio/static/assets/cynefin-OW5HDTMX-Bd1YhRo1.js +0 -1
- ksadk/studio/static/assets/cynefinDiagram-5FMLGOSQ-BBrIG_mI.js +0 -62
- ksadk/studio/static/assets/dagre-GXQ25YYZ-DtF1nGdY.js +0 -4
- ksadk/studio/static/assets/diagram-UQ7AKVKN-6mLKEo6L.js +0 -41
- ksadk/studio/static/assets/diagram-VSXAHHWV-CJBIaiZ2.js +0 -3
- ksadk/studio/static/assets/diagram-VX7I27RA-BohLEE1C.js +0 -24
- ksadk/studio/static/assets/diagram-Z3DM3KII-D8KIGonG.js +0 -24
- ksadk/studio/static/assets/ebnfDiagram-PWID7BFC-C99HU61t.js +0 -1
- ksadk/studio/static/assets/eventmodeling-NTZA5JFV-B1_5Ac8j.js +0 -1
- ksadk/studio/static/assets/flowDiagram-HODETNUW-DD5hmicn.js +0 -1
- ksadk/studio/static/assets/ganttDiagram-EL5Y4UJY-BPJrVLSG.js +0 -292
- ksadk/studio/static/assets/gitGraph-4MIJSDKK-Cy_ZQBGi.js +0 -1
- ksadk/studio/static/assets/gitGraphDiagram-WWUBYQGX-CZCUz4MT.js +0 -106
- ksadk/studio/static/assets/index-CeHL9ARV.css +0 -2
- ksadk/studio/static/assets/index-D9QEcVpL.js +0 -320
- ksadk/studio/static/assets/info-A6RAGUB7-DBzDQB_I.js +0 -1
- ksadk/studio/static/assets/infoDiagram-27XIBGKW-B-sq07Hi.js +0 -2
- ksadk/studio/static/assets/linear-BCxN9JLv.js +0 -1
- ksadk/studio/static/assets/mermaid-parser.core-BdCz8fkS.js +0 -7
- ksadk/studio/static/assets/packet-AYTQ26CC-gPln-_kG.js +0 -1
- ksadk/studio/static/assets/pegDiagram-XKGWAZYB-Dy3fB-gW.js +0 -1
- ksadk/studio/static/assets/pie-WAS4IAKB-qZdHMr7B.js +0 -1
- ksadk/studio/static/assets/radar-RG4KPBEZ-BZlnaea9.js +0 -1
- ksadk/studio/static/assets/railroad-74A4TZTK-Ce3__H9c.js +0 -1
- ksadk/studio/static/assets/railroad-abnf-HS5TGJTU-DqQn7EzD.js +0 -1
- ksadk/studio/static/assets/railroad-ebnf-LZEXJU2U-B55kCA8F.js +0 -1
- ksadk/studio/static/assets/railroad-peg-WCYAUIDC-DfQnvkHd.js +0 -1
- ksadk/studio/static/assets/railroadDiagram-O6MQD6OU-DnhMjZCk.js +0 -1
- ksadk/studio/static/assets/sankeyDiagram-P5KCCOFB-Bo-JTwt0.js +0 -40
- ksadk/studio/static/assets/src-SFn9St9H.js +0 -1
- ksadk/studio/static/assets/stateDiagram-D77RDMKH-DH774G6d.js +0 -1
- ksadk/studio/static/assets/stateDiagram-v2-MP3YSRHH-DZvVWPBo.js +0 -1
- ksadk/studio/static/assets/swimlanes-42K2YHIH-Bl13OvTX.js +0 -1
- ksadk/studio/static/assets/swimlanesDiagram-VR7AAH4N-BnFOTALJ.js +0 -8
- ksadk/studio/static/assets/treeView-Q6P3EWNA-D5Nn9Swz.js +0 -1
- ksadk/studio/static/assets/treemap-WGGIJYW6-CgHgnQhE.js +0 -1
- ksadk/studio/static/assets/vennDiagram-4TSXK5OY-B9QEXcJq.js +0 -34
- ksadk/studio/static/assets/wardley-WFR3VGLG-DXrK2RRY.js +0 -1
- {agentengine_sdk_python-0.8.4.dist-info → agentengine_sdk_python-0.8.6.dist-info}/WHEEL +0 -0
- {agentengine_sdk_python-0.8.4.dist-info → agentengine_sdk_python-0.8.6.dist-info}/entry_points.txt +0 -0
- {agentengine_sdk_python-0.8.4.dist-info → agentengine_sdk_python-0.8.6.dist-info}/licenses/LICENSE +0 -0
- {agentengine_sdk_python-0.8.4.dist-info → agentengine_sdk_python-0.8.6.dist-info}/top_level.txt +0 -0
- /ksadk/studio/static/assets/{MathMessageMarkdown-CBcDrAw--BEOyPC3w.css → MathMessageMarkdown-BesSeCYl-BEOyPC3w.css} +0 -0
ksadk/studio/shared_web.py
CHANGED
|
@@ -22,10 +22,14 @@ from ksadk.conversations.message_projection import project_session_messages
|
|
|
22
22
|
from ksadk.events.canonical import parse_runtime_event
|
|
23
23
|
from ksadk.events.canonical_store import session_event_to_runtime_event
|
|
24
24
|
from ksadk.sessions.base import Session
|
|
25
|
-
from ksadk.studio
|
|
25
|
+
from ksadk.studio import shared_web_run_state as run_state
|
|
26
|
+
from ksadk.studio.active_run_output import active_run_output
|
|
27
|
+
from ksadk.studio.contracts import OperationStatus, RunRecord, RunStatus, RunSubmissionRef
|
|
26
28
|
from ksadk.studio.errors import StudioError, not_found
|
|
29
|
+
from ksadk.studio.run_documents import link_run_documents
|
|
27
30
|
from ksadk.studio.run_service import project_runtime_event
|
|
28
31
|
from ksadk.studio.service import StudioService
|
|
32
|
+
from ksadk.studio.shared_web_response_events import project_response_events
|
|
29
33
|
from ksadk.tools.gateway import tool_approval_capability
|
|
30
34
|
|
|
31
35
|
_TERMINAL_OPERATIONS = {
|
|
@@ -67,6 +71,13 @@ class StudioSharedWebBridge:
|
|
|
67
71
|
"ApiFormats": ["responses"],
|
|
68
72
|
"Model": model,
|
|
69
73
|
"Capabilities": {
|
|
74
|
+
"ConversationPresentation": {
|
|
75
|
+
"Timeline": "compact"
|
|
76
|
+
if self.studio.agent_runtime_type(agent_id) == "harness"
|
|
77
|
+
else "standard",
|
|
78
|
+
},
|
|
79
|
+
"RuntimePrewarm": self.studio.agent_runtime_type(agent_id) == "harness",
|
|
80
|
+
"StudioRunReceiptQuery": True,
|
|
70
81
|
"HostedChat": {
|
|
71
82
|
"Enabled": True,
|
|
72
83
|
"ApiFormats": ["responses"],
|
|
@@ -95,6 +106,8 @@ class StudioSharedWebBridge:
|
|
|
95
106
|
},
|
|
96
107
|
"ApprovalPolicy": tool_approval_capability(),
|
|
97
108
|
"InteractionV1": True,
|
|
109
|
+
"SteerRun": self.studio.agent_runtime_type(agent_id).strip().lower()
|
|
110
|
+
== "harness",
|
|
98
111
|
"WorkspaceFiles": {"Enabled": False},
|
|
99
112
|
"NativeDashboard": {"Enabled": False},
|
|
100
113
|
"NativeTerminal": {"Enabled": False},
|
|
@@ -146,6 +159,7 @@ class StudioSharedWebBridge:
|
|
|
146
159
|
return {"Session": self._session_metadata_record(session)}
|
|
147
160
|
|
|
148
161
|
async def get_session(self, session_id: str) -> dict[str, Any]:
|
|
162
|
+
self.studio._require_direct_session(session_id)
|
|
149
163
|
runs = self.studio.event_store.list_runs(session_id=session_id)
|
|
150
164
|
if runs:
|
|
151
165
|
return {"Session": self._session_record(runs)}
|
|
@@ -155,6 +169,7 @@ class StudioSharedWebBridge:
|
|
|
155
169
|
return {"Session": self._session_metadata_record(session)}
|
|
156
170
|
|
|
157
171
|
async def compact_session(self, agent_id: str, session_id: str) -> dict[str, Any]:
|
|
172
|
+
self.studio._require_direct_session(session_id)
|
|
158
173
|
from ksadk.codex.runtime import CodexRuntimeAdapter
|
|
159
174
|
|
|
160
175
|
runs = self.studio.event_store.list_runs(session_id=session_id, agent_id=agent_id)
|
|
@@ -218,6 +233,7 @@ class StudioSharedWebBridge:
|
|
|
218
233
|
before_seq_id: int | None = None,
|
|
219
234
|
limit: int = 50,
|
|
220
235
|
) -> dict[str, Any]:
|
|
236
|
+
self.studio._require_direct_session(session_id)
|
|
221
237
|
runs = self.studio.event_store.list_runs(session_id=session_id)
|
|
222
238
|
messages: list[dict[str, Any]] = []
|
|
223
239
|
sequence = 0
|
|
@@ -233,6 +249,25 @@ class StudioSharedWebBridge:
|
|
|
233
249
|
"InvocationId": run.id,
|
|
234
250
|
}
|
|
235
251
|
)
|
|
252
|
+
last_steer_at = None
|
|
253
|
+
for event in self.studio.event_store.events(run.id):
|
|
254
|
+
if event.type != "run.steer_requested":
|
|
255
|
+
continue
|
|
256
|
+
text = event.data.get("text")
|
|
257
|
+
if not isinstance(text, str) or not text:
|
|
258
|
+
continue
|
|
259
|
+
sequence += 1
|
|
260
|
+
last_steer_at = event.created_at
|
|
261
|
+
messages.append(
|
|
262
|
+
{
|
|
263
|
+
"MessageId": f"{run.id}:steer:{event.id}",
|
|
264
|
+
"Role": "user",
|
|
265
|
+
"Content": {"text": text},
|
|
266
|
+
"Timestamp": self._timestamp(event.created_at),
|
|
267
|
+
"SeqId": sequence,
|
|
268
|
+
"InvocationId": run.id,
|
|
269
|
+
}
|
|
270
|
+
)
|
|
236
271
|
sequence += 1
|
|
237
272
|
messages.append(
|
|
238
273
|
{
|
|
@@ -242,11 +277,17 @@ class StudioSharedWebBridge:
|
|
|
242
277
|
# Run status is metadata, not an assistant reply. An
|
|
243
278
|
# empty pending reply lets canonical reasoning/tools
|
|
244
279
|
# restore without a synthetic status text shadowing them.
|
|
245
|
-
"text": (
|
|
246
|
-
|
|
280
|
+
"text": link_run_documents(
|
|
281
|
+
self.studio,
|
|
282
|
+
run,
|
|
283
|
+
await active_run_output(self.studio.run_service, run)
|
|
284
|
+
if self._active_status(run.status)
|
|
285
|
+
else self._run_output(run),
|
|
247
286
|
)
|
|
248
287
|
},
|
|
249
|
-
"Timestamp": self._timestamp(
|
|
288
|
+
"Timestamp": self._timestamp(
|
|
289
|
+
run.completed_at or last_steer_at or run.started_at
|
|
290
|
+
),
|
|
250
291
|
"SeqId": sequence,
|
|
251
292
|
"InvocationId": run.id,
|
|
252
293
|
"Activities": await self._run_activities(run),
|
|
@@ -279,6 +320,7 @@ class StudioSharedWebBridge:
|
|
|
279
320
|
}
|
|
280
321
|
|
|
281
322
|
async def list_session_events(self, session_id: str) -> dict[str, Any]:
|
|
323
|
+
self.studio._require_direct_session(session_id)
|
|
282
324
|
runs = self.studio.event_store.list_runs(session_id=session_id)
|
|
283
325
|
events: list[dict[str, Any]] = []
|
|
284
326
|
sequence = 0
|
|
@@ -290,7 +332,7 @@ class StudioSharedWebBridge:
|
|
|
290
332
|
"SeqId": sequence,
|
|
291
333
|
"EventType": self._shared_event_type(event.type, event.data),
|
|
292
334
|
"InvocationId": run.id,
|
|
293
|
-
"Content": self.
|
|
335
|
+
"Content": self._presentation_event_content(event.data, run),
|
|
294
336
|
"Timestamp": self._timestamp(event.created_at),
|
|
295
337
|
}
|
|
296
338
|
)
|
|
@@ -386,7 +428,72 @@ class StudioSharedWebBridge:
|
|
|
386
428
|
return data
|
|
387
429
|
return {**data, "runtimeEvent": {**native, "run_id": run_id}}
|
|
388
430
|
|
|
431
|
+
def _presentation_event_content(self, data: dict[str, Any], run: RunRecord) -> dict[str, Any]:
|
|
432
|
+
content = self._shared_event_content(data, run.id)
|
|
433
|
+
native = content.get("runtimeEvent")
|
|
434
|
+
if run.runtime_type != "harness" or not isinstance(native, dict):
|
|
435
|
+
return content
|
|
436
|
+
native = dict(native)
|
|
437
|
+
source_metadata = native.get("source", {}).get("metadata", {})
|
|
438
|
+
native_type = source_metadata.get(
|
|
439
|
+
"native_event_type", source_metadata.get("native_event_kind")
|
|
440
|
+
)
|
|
441
|
+
if native_type == "run.progress" and native.get("item_kind") == "message":
|
|
442
|
+
# Progress is an activity, never assistant answer prose. This also
|
|
443
|
+
# repairs historical runs without rewriting their audit transcript.
|
|
444
|
+
native["item_kind"] = "reasoning"
|
|
445
|
+
if (
|
|
446
|
+
native_type == "text.completed"
|
|
447
|
+
and native.get("item_kind") == "message"
|
|
448
|
+
and source_metadata.get("phase") == "final_answer"
|
|
449
|
+
and run.output
|
|
450
|
+
and not self._active_status(run.status)
|
|
451
|
+
):
|
|
452
|
+
snapshot = native.get("snapshot") or {}
|
|
453
|
+
text = "".join(
|
|
454
|
+
str(part.get("text") or "")
|
|
455
|
+
for part in snapshot.get("parts", [])
|
|
456
|
+
if part.get("content_type") == "text"
|
|
457
|
+
)
|
|
458
|
+
if text and text != run.output:
|
|
459
|
+
# Older Harness runs projected compaction summaries through
|
|
460
|
+
# the same final item as the actual answer. The durable run
|
|
461
|
+
# output is the terminal authority; retain the legacy event as
|
|
462
|
+
# redacted trace state so refresh cannot restore stale prose.
|
|
463
|
+
native["item_kind"] = "status"
|
|
464
|
+
native["snapshot"] = {
|
|
465
|
+
**snapshot,
|
|
466
|
+
"parts": [
|
|
467
|
+
{
|
|
468
|
+
**part,
|
|
469
|
+
"text": json.dumps(
|
|
470
|
+
{
|
|
471
|
+
"event": "text.completed",
|
|
472
|
+
"details": {"purpose": "non_authoritative_final"},
|
|
473
|
+
},
|
|
474
|
+
ensure_ascii=False,
|
|
475
|
+
separators=(",", ":"),
|
|
476
|
+
),
|
|
477
|
+
}
|
|
478
|
+
if part.get("content_type") == "text"
|
|
479
|
+
else part
|
|
480
|
+
for part in snapshot.get("parts", [])
|
|
481
|
+
],
|
|
482
|
+
}
|
|
483
|
+
if native_type == "text.completed" and native.get("snapshot"):
|
|
484
|
+
native["snapshot"] = {
|
|
485
|
+
**native["snapshot"],
|
|
486
|
+
"parts": [
|
|
487
|
+
{**part, "text": link_run_documents(self.studio, run, part["text"])}
|
|
488
|
+
if part.get("content_type") == "text"
|
|
489
|
+
else part
|
|
490
|
+
for part in native["snapshot"].get("parts", [])
|
|
491
|
+
],
|
|
492
|
+
}
|
|
493
|
+
return {**content, "runtimeEvent": native}
|
|
494
|
+
|
|
389
495
|
async def subscription_run_id(self, session_id: str, invocation_id: str) -> str:
|
|
496
|
+
self.studio._require_direct_session(session_id)
|
|
390
497
|
run_id = self._run_ids_by_invocation.get(invocation_id, invocation_id)
|
|
391
498
|
try:
|
|
392
499
|
run = self.studio.event_store.get(run_id)
|
|
@@ -440,7 +547,12 @@ class StudioSharedWebBridge:
|
|
|
440
547
|
break
|
|
441
548
|
offset += len(self.studio.event_store.events(record.id))
|
|
442
549
|
cursor = max(0, after_seq_id - offset)
|
|
550
|
+
control_sent = False
|
|
443
551
|
while True:
|
|
552
|
+
control = run_state.control_ready_event(self.studio, run_id, invocation_id)
|
|
553
|
+
if control and not control_sent:
|
|
554
|
+
yield self._sse(*control)
|
|
555
|
+
control_sent = True
|
|
444
556
|
for event in await self.studio.run_service.events(run_id, after=cursor):
|
|
445
557
|
cursor = max(cursor, event.id)
|
|
446
558
|
yield self._sse(
|
|
@@ -450,7 +562,9 @@ class StudioSharedWebBridge:
|
|
|
450
562
|
"SessionId": session_id,
|
|
451
563
|
"InvocationId": invocation_id,
|
|
452
564
|
"EventType": self._shared_event_type(event.type, event.data),
|
|
453
|
-
"Content": self.
|
|
565
|
+
"Content": self._presentation_event_content(
|
|
566
|
+
event.data, self.studio.event_store.get(run_id)
|
|
567
|
+
),
|
|
454
568
|
"Timestamp": self._timestamp(event.created_at),
|
|
455
569
|
},
|
|
456
570
|
)
|
|
@@ -461,43 +575,294 @@ class StudioSharedWebBridge:
|
|
|
461
575
|
yield ": ping\n\n"
|
|
462
576
|
await asyncio.sleep(0.25)
|
|
463
577
|
|
|
464
|
-
def cancel_run(self, invocation_id: str) -> dict[str, Any]:
|
|
578
|
+
async def cancel_run(self, invocation_id: str) -> dict[str, Any]:
|
|
465
579
|
operation_id = self._operations_by_invocation.get(invocation_id)
|
|
466
|
-
|
|
580
|
+
run_id = run_state.resolve_cancel_run_id(
|
|
581
|
+
self.studio,
|
|
582
|
+
invocation_id,
|
|
583
|
+
self._run_ids_by_invocation,
|
|
584
|
+
self._response_runs,
|
|
585
|
+
)
|
|
586
|
+
if run_id is None and operation_id is None:
|
|
587
|
+
client_id = next((
|
|
588
|
+
client_id
|
|
589
|
+
for client_id, canonical_id in self._run_ids_by_invocation.items()
|
|
590
|
+
if canonical_id == invocation_id and client_id in self._operations_by_invocation
|
|
591
|
+
), None)
|
|
592
|
+
if client_id is not None:
|
|
593
|
+
operation_id = self._operations_by_invocation[client_id]
|
|
594
|
+
run_id = invocation_id
|
|
595
|
+
self.studio._require_direct_run(run_id or invocation_id)
|
|
596
|
+
if run_id:
|
|
597
|
+
# Preserve the canonical Run terminal event. Cancelling only the
|
|
598
|
+
# outer Operation can strand the already-created Run in CREATED.
|
|
599
|
+
await self.studio.run_service.cancel_run(run_id)
|
|
600
|
+
# ListSessions is refreshed as soon as this response returns. Give
|
|
601
|
+
# the run task a short bounded window to persist its terminal state
|
|
602
|
+
# so the sidebar does not keep a stale "running" indicator.
|
|
603
|
+
event_store = getattr(self.studio, "event_store", None)
|
|
604
|
+
if event_store is not None:
|
|
605
|
+
# Provider cancellation may need to unwind an in-flight model
|
|
606
|
+
# request before RunService can append run.canceled. Keep the
|
|
607
|
+
# CancelRun response pending for a bounded 10 seconds so the
|
|
608
|
+
# refresh issued by ksadk-web observes the terminal record
|
|
609
|
+
# instead of permanently caching a transient RUNNING badge.
|
|
610
|
+
for _ in range(200):
|
|
611
|
+
try:
|
|
612
|
+
status = event_store.get(run_id).status
|
|
613
|
+
except Exception: # noqa: BLE001 - cancellation already accepted
|
|
614
|
+
break
|
|
615
|
+
if status not in {
|
|
616
|
+
RunStatus.CREATED,
|
|
617
|
+
RunStatus.RUNNING,
|
|
618
|
+
RunStatus.WAITING_INPUT,
|
|
619
|
+
}:
|
|
620
|
+
break
|
|
621
|
+
await asyncio.sleep(0.05)
|
|
622
|
+
elif operation_id:
|
|
467
623
|
self.studio.operations.cancel(operation_id)
|
|
468
|
-
return {
|
|
624
|
+
return {
|
|
625
|
+
"InvocationId": invocation_id,
|
|
626
|
+
"RunId": run_id or "",
|
|
627
|
+
"Cancelled": bool(run_id or operation_id),
|
|
628
|
+
}
|
|
469
629
|
|
|
470
630
|
async def pause_run(self, invocation_id: str) -> dict[str, Any]:
|
|
631
|
+
self.studio._require_direct_run(invocation_id)
|
|
471
632
|
run_id = self._run_ids_by_invocation.get(invocation_id)
|
|
472
633
|
if not run_id:
|
|
473
634
|
raise StudioError("RUN_NOT_READY", "运行尚未创建,请稍后重试", status_code=409)
|
|
474
635
|
return await self.studio.run_service.pause_run(run_id)
|
|
475
636
|
|
|
637
|
+
async def steer_run(
|
|
638
|
+
self, invocation_id: str, text: str, *, delivery: str = "replace"
|
|
639
|
+
) -> dict[str, Any]:
|
|
640
|
+
run_id = self.resolve_run_reference(invocation_id)
|
|
641
|
+
self.studio._require_direct_run(run_id)
|
|
642
|
+
result = await self.studio.run_service.steer_run(run_id, text, delivery=delivery)
|
|
643
|
+
message_id = f"{run_id}:steer:{result['eventId']}" if result.get("eventId") else None
|
|
644
|
+
return {
|
|
645
|
+
"InvocationId": invocation_id,
|
|
646
|
+
"RunId": result["runId"],
|
|
647
|
+
"Status": result["status"],
|
|
648
|
+
**({"MessageId": message_id} if message_id else {}),
|
|
649
|
+
}
|
|
650
|
+
|
|
476
651
|
async def resume_run(self, invocation_id: str) -> dict[str, Any]:
|
|
652
|
+
self.studio._require_direct_run(invocation_id)
|
|
477
653
|
run_id = self._run_ids_by_invocation.get(invocation_id)
|
|
478
654
|
if not run_id:
|
|
479
655
|
raise StudioError("RUN_NOT_FOUND", "未找到可继续的运行", status_code=404)
|
|
480
656
|
return await self.studio.run_service.resume_run(run_id)
|
|
481
657
|
|
|
482
658
|
def response_session_id(self, response_id: str) -> str:
|
|
483
|
-
run_id =
|
|
659
|
+
run_id = (
|
|
660
|
+
self._run_ids_by_invocation.get(response_id)
|
|
661
|
+
or self._response_runs.get(response_id)
|
|
662
|
+
or response_id
|
|
663
|
+
)
|
|
484
664
|
return self.studio.event_store.get(run_id).session_id
|
|
485
665
|
|
|
666
|
+
def resolve_run_reference(self, reference: str) -> str:
|
|
667
|
+
"""Resolve a live Responses invocation without guessing the latest run."""
|
|
668
|
+
return run_state.resolve_run_reference(
|
|
669
|
+
self._run_ids_by_invocation, self._response_runs, reference
|
|
670
|
+
)
|
|
671
|
+
|
|
672
|
+
def run_receipt(self, agent_id: str, session_id: str, invocation_id: str) -> dict[str, Any]:
|
|
673
|
+
from ksadk.studio.run_submission_receipts import submission_receipt
|
|
674
|
+
|
|
675
|
+
return submission_receipt(
|
|
676
|
+
self.studio,
|
|
677
|
+
RunSubmissionRef(
|
|
678
|
+
client_invocation_id=invocation_id, agent_id=agent_id, session_id=session_id
|
|
679
|
+
),
|
|
680
|
+
)
|
|
681
|
+
|
|
682
|
+
async def _submit_response_resume(
|
|
683
|
+
self,
|
|
684
|
+
*,
|
|
685
|
+
previous_response_id: str,
|
|
686
|
+
response_id: str,
|
|
687
|
+
resume_input: dict[str, Any],
|
|
688
|
+
) -> RunRecord:
|
|
689
|
+
"""Resolve one Responses approval item through Interaction/v1."""
|
|
690
|
+
|
|
691
|
+
if str(resume_input.get("type") or "") != "mcp_approval_response":
|
|
692
|
+
raise StudioError(
|
|
693
|
+
"RESPONSE_RESUME_UNSUPPORTED",
|
|
694
|
+
"Studio 当前只支持 MCP 审批恢复",
|
|
695
|
+
status_code=422,
|
|
696
|
+
)
|
|
697
|
+
run_id = self.resolve_run_reference(previous_response_id)
|
|
698
|
+
record = self.studio.event_store.get(run_id)
|
|
699
|
+
requested_id = str(
|
|
700
|
+
resume_input.get("approval_request_id") or resume_input.get("id") or ""
|
|
701
|
+
)
|
|
702
|
+
events = self.studio.event_store.events(run_id)
|
|
703
|
+
resolved_ids = {
|
|
704
|
+
str(event.data.get("interactionId") or event.data.get("interaction_id") or "")
|
|
705
|
+
for event in events
|
|
706
|
+
if event.type in {"a2ui.action", "interaction.resolved"}
|
|
707
|
+
}
|
|
708
|
+
pending = [
|
|
709
|
+
event
|
|
710
|
+
for event in events
|
|
711
|
+
if event.type == "a2ui.interaction"
|
|
712
|
+
and str(
|
|
713
|
+
event.data.get("interactionId") or event.data.get("interaction_id") or ""
|
|
714
|
+
)
|
|
715
|
+
not in resolved_ids
|
|
716
|
+
]
|
|
717
|
+
interaction = next(
|
|
718
|
+
(
|
|
719
|
+
event
|
|
720
|
+
for event in reversed(pending)
|
|
721
|
+
if not requested_id
|
|
722
|
+
or requested_id
|
|
723
|
+
in {
|
|
724
|
+
str(
|
|
725
|
+
event.data.get("interactionId")
|
|
726
|
+
or event.data.get("interaction_id")
|
|
727
|
+
or ""
|
|
728
|
+
),
|
|
729
|
+
str(event.data.get("callId") or event.data.get("call_id") or ""),
|
|
730
|
+
}
|
|
731
|
+
),
|
|
732
|
+
None,
|
|
733
|
+
)
|
|
734
|
+
if interaction is None:
|
|
735
|
+
raise StudioError(
|
|
736
|
+
"INTERACTION_NOT_FOUND",
|
|
737
|
+
"未找到待处理的审批请求",
|
|
738
|
+
status_code=404,
|
|
739
|
+
)
|
|
740
|
+
interaction_id = str(
|
|
741
|
+
interaction.data.get("interactionId")
|
|
742
|
+
or interaction.data.get("interaction_id")
|
|
743
|
+
or ""
|
|
744
|
+
)
|
|
745
|
+
revision = int(interaction.data.get("revision") or 1)
|
|
746
|
+
approved = bool(resume_input.get("approve"))
|
|
747
|
+
action = "approve" if approved else "reject"
|
|
748
|
+
data: dict[str, Any] = {"decision": action}
|
|
749
|
+
if resume_input.get("reason") is not None:
|
|
750
|
+
data["reason"] = str(resume_input.get("reason") or "")
|
|
751
|
+
await self.studio.run_service.submit_interaction(
|
|
752
|
+
run_id,
|
|
753
|
+
interaction_id,
|
|
754
|
+
name=action,
|
|
755
|
+
data=data,
|
|
756
|
+
expected_revision=revision,
|
|
757
|
+
idempotency_key=f"responses:{response_id}:{interaction_id}:{revision}",
|
|
758
|
+
)
|
|
759
|
+
self._run_ids_by_invocation[response_id] = run_id
|
|
760
|
+
self._response_runs[response_id] = run_id
|
|
761
|
+
return record
|
|
762
|
+
|
|
763
|
+
async def _wait_for_resumed_response(self, run_id: str) -> RunRecord:
|
|
764
|
+
while True:
|
|
765
|
+
run = self.studio.event_store.get(run_id)
|
|
766
|
+
if run.status == RunStatus.COMPLETED:
|
|
767
|
+
return run
|
|
768
|
+
if run.status in {RunStatus.FAILED, RunStatus.CANCELLED}:
|
|
769
|
+
raise StudioError("RUN_FAILED", self._run_output(run), status_code=500)
|
|
770
|
+
await asyncio.sleep(0.05)
|
|
771
|
+
|
|
772
|
+
async def stream_response_resume(
|
|
773
|
+
self,
|
|
774
|
+
*,
|
|
775
|
+
previous_response_id: str,
|
|
776
|
+
response_id: str,
|
|
777
|
+
resume_input: dict[str, Any],
|
|
778
|
+
) -> AsyncIterator[str]:
|
|
779
|
+
try:
|
|
780
|
+
record = await self._submit_response_resume(
|
|
781
|
+
previous_response_id=previous_response_id,
|
|
782
|
+
response_id=response_id,
|
|
783
|
+
resume_input=resume_input,
|
|
784
|
+
)
|
|
785
|
+
model = str(record.model or "")
|
|
786
|
+
yield run_state.created_response_sse(
|
|
787
|
+
response_id,
|
|
788
|
+
model=model,
|
|
789
|
+
encode=self._sse,
|
|
790
|
+
response_shell=self._response_shell,
|
|
791
|
+
)
|
|
792
|
+
yield self._sse(
|
|
793
|
+
"response.in_progress",
|
|
794
|
+
{
|
|
795
|
+
"type": "response.in_progress",
|
|
796
|
+
"response": self._response_shell(response_id, model=model),
|
|
797
|
+
},
|
|
798
|
+
)
|
|
799
|
+
wait_task = asyncio.create_task(self._wait_for_resumed_response(record.id))
|
|
800
|
+
while not wait_task.done():
|
|
801
|
+
yield ": keep-alive\n\n"
|
|
802
|
+
await asyncio.sleep(1)
|
|
803
|
+
run = await wait_task
|
|
804
|
+
if run.output:
|
|
805
|
+
yield self._response_delta_sse(
|
|
806
|
+
"response.output_text.delta",
|
|
807
|
+
invocation_id=response_id,
|
|
808
|
+
delta=run.output,
|
|
809
|
+
)
|
|
810
|
+
yield self._sse(
|
|
811
|
+
"response.completed",
|
|
812
|
+
{
|
|
813
|
+
"type": "response.completed",
|
|
814
|
+
"response": self._response_payload(
|
|
815
|
+
run,
|
|
816
|
+
model=model,
|
|
817
|
+
response_id=response_id,
|
|
818
|
+
),
|
|
819
|
+
},
|
|
820
|
+
)
|
|
821
|
+
except StudioError as exc:
|
|
822
|
+
yield self._failed_sse(response_id, exc.message)
|
|
823
|
+
|
|
824
|
+
async def invoke_response_resume(
|
|
825
|
+
self,
|
|
826
|
+
*,
|
|
827
|
+
previous_response_id: str,
|
|
828
|
+
response_id: str,
|
|
829
|
+
resume_input: dict[str, Any],
|
|
830
|
+
) -> dict[str, Any]:
|
|
831
|
+
record = await self._submit_response_resume(
|
|
832
|
+
previous_response_id=previous_response_id,
|
|
833
|
+
response_id=response_id,
|
|
834
|
+
resume_input=resume_input,
|
|
835
|
+
)
|
|
836
|
+
run = await self._wait_for_resumed_response(record.id)
|
|
837
|
+
return self._response_payload(
|
|
838
|
+
run,
|
|
839
|
+
model=str(run.model or record.model or ""),
|
|
840
|
+
response_id=response_id,
|
|
841
|
+
)
|
|
842
|
+
|
|
486
843
|
async def stream_run(
|
|
487
844
|
self, payload: dict[str, Any], *, shared_ui: bool = False
|
|
488
845
|
) -> AsyncIterator[str]:
|
|
489
|
-
agent_id = self.resolve_agent_id(str(payload.get("AgentId") or "") or None)
|
|
490
846
|
session_id = str(payload.get("SessionId") or f"ses_{uuid4().hex}")
|
|
491
847
|
invocation_id = str(payload.get("InvocationId") or f"resp_{uuid4().hex}")
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
approval_mode, collaboration_mode, goal_objective, reasoning_effort = (
|
|
497
|
-
self._request_controls(payload)
|
|
498
|
-
)
|
|
848
|
+
# Keep the client correlation key through the operation layer. It is
|
|
849
|
+
# only an idempotency key when the caller explicitly supplies one;
|
|
850
|
+
# otherwise each invocation remains independently executable.
|
|
851
|
+
idempotency_key = str(payload.get("IdempotencyKey") or f"responses:{invocation_id}")
|
|
499
852
|
try:
|
|
853
|
+
agent_id = self.resolve_agent_id(str(payload.get("AgentId") or "") or None)
|
|
854
|
+
prompt = self._input_text(payload)
|
|
855
|
+
runtime_input = self._runtime_input(payload)
|
|
856
|
+
# A cold provider-backed Agent may not have populated the mutable
|
|
857
|
+
# provider catalog yet. Building first performs the authoritative
|
|
858
|
+
# discovery and freezes the resolved model into the Build; model
|
|
859
|
+
# validation must therefore happen after this step.
|
|
500
860
|
build = await self._ensure_build(agent_id)
|
|
861
|
+
model = self._select_build_model(build, str(payload.get("Model") or ""))
|
|
862
|
+
model_explicit = bool(payload.get("ModelExplicit", str(payload.get("Model") or "")))
|
|
863
|
+
approval_mode, collaboration_mode, goal_objective, reasoning_effort = (
|
|
864
|
+
self._request_controls(payload)
|
|
865
|
+
)
|
|
501
866
|
self._validate_conversation_turn(
|
|
502
867
|
build_id=build.id,
|
|
503
868
|
session_id=session_id,
|
|
@@ -533,24 +898,21 @@ class StudioSharedWebBridge:
|
|
|
533
898
|
collaboration_mode=collaboration_mode,
|
|
534
899
|
goal_objective=goal_objective,
|
|
535
900
|
reasoning_effort=reasoning_effort,
|
|
901
|
+
idempotency_key=idempotency_key,
|
|
536
902
|
)
|
|
537
903
|
)
|
|
538
904
|
|
|
539
|
-
|
|
540
|
-
self._operations_by_invocation.pop(invocation_id, None)
|
|
541
|
-
if not task.cancelled():
|
|
542
|
-
task.exception()
|
|
543
|
-
|
|
544
|
-
execution.add_done_callback(release_operation)
|
|
545
|
-
|
|
546
|
-
yield self._sse(
|
|
547
|
-
"response.created",
|
|
548
|
-
{
|
|
549
|
-
"type": "response.created",
|
|
550
|
-
"response": self._response_shell(invocation_id, model=model),
|
|
551
|
-
},
|
|
552
|
-
)
|
|
905
|
+
run_state.attach_release_callback(execution, self._operations_by_invocation, invocation_id)
|
|
553
906
|
try:
|
|
907
|
+
await run_state.wait_for_durable_run(
|
|
908
|
+
execution,
|
|
909
|
+
self._run_ids_by_invocation,
|
|
910
|
+
invocation_id,
|
|
911
|
+
self._operations_by_invocation,
|
|
912
|
+
)
|
|
913
|
+
yield run_state.created_response_sse(
|
|
914
|
+
invocation_id, model=model, encode=self._sse, response_shell=self._response_shell
|
|
915
|
+
)
|
|
554
916
|
yield self._sse(
|
|
555
917
|
"response.in_progress",
|
|
556
918
|
{
|
|
@@ -574,15 +936,9 @@ class StudioSharedWebBridge:
|
|
|
574
936
|
if event_name == "response.output_text.delta":
|
|
575
937
|
emitted_text += str(event_payload.get("delta") or "")
|
|
576
938
|
yield self._sse(event_name, event_payload)
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
and event_payload.get("kind") in {"form", "structured_input"}
|
|
581
|
-
):
|
|
582
|
-
# The shared UI restores the durable Interaction/v1
|
|
583
|
-
# request, then subscribes to this same live run.
|
|
584
|
-
# Leave the execution attached while input is pending.
|
|
585
|
-
return
|
|
939
|
+
# A form pauses the Agent, not its response stream.
|
|
940
|
+
# Keep delivery attached through input and emit the
|
|
941
|
+
# eventual terminal frame after the same run resumes.
|
|
586
942
|
else:
|
|
587
943
|
idle_polls += 1
|
|
588
944
|
if idle_polls >= 20:
|
|
@@ -608,19 +964,32 @@ class StudioSharedWebBridge:
|
|
|
608
964
|
invocation_id=invocation_id,
|
|
609
965
|
delta=remaining,
|
|
610
966
|
)
|
|
967
|
+
response = self._response_payload(run, model=model, response_id=invocation_id)
|
|
968
|
+
# A delta can be a provisional model preview. Responses clients may
|
|
969
|
+
# suppress response.completed's text after any delta, so publish the
|
|
970
|
+
# committed (and document-linked) replacement explicitly first.
|
|
971
|
+
yield self._sse(
|
|
972
|
+
"response.output_text.done",
|
|
973
|
+
{
|
|
974
|
+
"type": "response.output_text.done",
|
|
975
|
+
"item_id": f"msg_{invocation_id}",
|
|
976
|
+
"output_index": 0,
|
|
977
|
+
"content_index": 0,
|
|
978
|
+
"text": response["output"][0]["content"][0]["text"],
|
|
979
|
+
},
|
|
980
|
+
)
|
|
611
981
|
yield self._sse(
|
|
612
982
|
"response.completed",
|
|
613
983
|
{
|
|
614
984
|
"type": "response.completed",
|
|
615
|
-
"response":
|
|
616
|
-
run,
|
|
617
|
-
model=model,
|
|
618
|
-
response_id=invocation_id,
|
|
619
|
-
),
|
|
985
|
+
"response": response,
|
|
620
986
|
},
|
|
621
987
|
)
|
|
622
988
|
except StudioError as exc:
|
|
623
|
-
|
|
989
|
+
if exc.code == "RUN_CANCELLED":
|
|
990
|
+
yield run_state.cancelled_response_sse(invocation_id, encode=self._sse)
|
|
991
|
+
else:
|
|
992
|
+
yield self._failed_sse(invocation_id, exc.message)
|
|
624
993
|
except Exception:
|
|
625
994
|
yield self._failed_sse(invocation_id, "本地 Agent 运行失败")
|
|
626
995
|
finally:
|
|
@@ -633,12 +1002,15 @@ class StudioSharedWebBridge:
|
|
|
633
1002
|
agent_id = self.resolve_agent_id(str(payload.get("AgentId") or "") or None)
|
|
634
1003
|
session_id = str(payload.get("SessionId") or f"ses_{uuid4().hex}")
|
|
635
1004
|
invocation_id = str(payload.get("InvocationId") or f"resp_{uuid4().hex}")
|
|
636
|
-
|
|
1005
|
+
idempotency_key = str(payload.get("IdempotencyKey") or f"responses:{invocation_id}")
|
|
1006
|
+
# Keep the non-streaming entry point consistent with stream_run: a
|
|
1007
|
+
# cold Build is what discovers provider-backed models.
|
|
1008
|
+
build = await self._ensure_build(agent_id)
|
|
1009
|
+
model = self._select_build_model(build, str(payload.get("Model") or ""))
|
|
637
1010
|
model_explicit = bool(payload.get("ModelExplicit", str(payload.get("Model") or "")))
|
|
638
1011
|
approval_mode, collaboration_mode, goal_objective, reasoning_effort = (
|
|
639
1012
|
self._request_controls(payload)
|
|
640
1013
|
)
|
|
641
|
-
build = await self._ensure_build(agent_id)
|
|
642
1014
|
prompt = self._input_text(payload)
|
|
643
1015
|
runtime_input = self._runtime_input(payload)
|
|
644
1016
|
self._validate_conversation_turn(
|
|
@@ -666,6 +1038,7 @@ class StudioSharedWebBridge:
|
|
|
666
1038
|
collaboration_mode=collaboration_mode,
|
|
667
1039
|
goal_objective=goal_objective,
|
|
668
1040
|
reasoning_effort=reasoning_effort,
|
|
1041
|
+
idempotency_key=idempotency_key,
|
|
669
1042
|
)
|
|
670
1043
|
return self._response_payload(
|
|
671
1044
|
run,
|
|
@@ -689,6 +1062,7 @@ class StudioSharedWebBridge:
|
|
|
689
1062
|
collaboration_mode: str = "",
|
|
690
1063
|
goal_objective: str = "",
|
|
691
1064
|
reasoning_effort: str = "",
|
|
1065
|
+
idempotency_key: str = "",
|
|
692
1066
|
) -> RunRecord:
|
|
693
1067
|
if build is None:
|
|
694
1068
|
build = await self._ensure_build(agent_id)
|
|
@@ -716,8 +1090,11 @@ class StudioSharedWebBridge:
|
|
|
716
1090
|
goal_objective=goal_objective or None,
|
|
717
1091
|
reasoning_effort=reasoning_effort or None,
|
|
718
1092
|
runtime_input=runtime_input or None,
|
|
719
|
-
idempotency_key=f"responses:{invocation_id}",
|
|
1093
|
+
idempotency_key=idempotency_key or f"responses:{invocation_id}",
|
|
720
1094
|
on_event=observe,
|
|
1095
|
+
submission_ref=RunSubmissionRef(
|
|
1096
|
+
client_invocation_id=invocation_id, agent_id=agent_id, session_id=session_id
|
|
1097
|
+
),
|
|
721
1098
|
)
|
|
722
1099
|
self._operations_by_invocation[invocation_id] = operation.id
|
|
723
1100
|
while True:
|
|
@@ -726,23 +1103,14 @@ class StudioSharedWebBridge:
|
|
|
726
1103
|
break
|
|
727
1104
|
await asyncio.sleep(0.05)
|
|
728
1105
|
if current.status != OperationStatus.SUCCEEDED:
|
|
729
|
-
|
|
730
|
-
raise StudioError("RUN_FAILED", message, status_code=500)
|
|
1106
|
+
run_state.raise_for_unsuccessful_operation(self.studio, current)
|
|
731
1107
|
run = self.studio.event_store.get(current.resource_id)
|
|
732
1108
|
if run.status != RunStatus.COMPLETED:
|
|
733
1109
|
raise StudioError("RUN_FAILED", self._run_output(run), status_code=500)
|
|
734
1110
|
self._response_runs[invocation_id] = run.id
|
|
735
1111
|
return run
|
|
736
1112
|
|
|
737
|
-
|
|
738
|
-
def _response_shell(response_id: str, *, model: str) -> dict[str, Any]:
|
|
739
|
-
return {
|
|
740
|
-
"id": response_id,
|
|
741
|
-
"object": "response",
|
|
742
|
-
"status": "in_progress",
|
|
743
|
-
"model": model,
|
|
744
|
-
"output": [],
|
|
745
|
-
}
|
|
1113
|
+
_response_shell = staticmethod(run_state.response_shell)
|
|
746
1114
|
|
|
747
1115
|
async def _project_response_events(
|
|
748
1116
|
self,
|
|
@@ -752,101 +1120,9 @@ class StudioSharedWebBridge:
|
|
|
752
1120
|
invocation_id: str,
|
|
753
1121
|
seen: set[tuple[str, int]],
|
|
754
1122
|
) -> list[tuple[str, dict[str, Any]]]:
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
return projected
|
|
759
|
-
for run in self.studio.event_store.list_runs(session_id=session_id):
|
|
760
|
-
if run.agent_id != agent_id or run.id != current_run_id:
|
|
761
|
-
continue
|
|
762
|
-
events = await self.studio.run_service.events(run.id)
|
|
763
|
-
starts = {
|
|
764
|
-
str(event.data.get("callId") or event.data.get("call_id") or ""): event.data
|
|
765
|
-
for event in events
|
|
766
|
-
if event.type in {"command.started", "tool.started", "tool.requested"}
|
|
767
|
-
}
|
|
768
|
-
for event in events:
|
|
769
|
-
key = (run.id, event.id)
|
|
770
|
-
if key in seen:
|
|
771
|
-
continue
|
|
772
|
-
seen.add(key)
|
|
773
|
-
if event.type in {"message.delta", "thinking.delta"}:
|
|
774
|
-
delta = str(event.data.get("text") or event.data.get("delta") or "")
|
|
775
|
-
if not delta:
|
|
776
|
-
continue
|
|
777
|
-
event_name = (
|
|
778
|
-
"response.output_text.delta"
|
|
779
|
-
if event.type == "message.delta"
|
|
780
|
-
else "response.reasoning_summary_text.delta"
|
|
781
|
-
)
|
|
782
|
-
projected.append(
|
|
783
|
-
(
|
|
784
|
-
event_name,
|
|
785
|
-
self._response_delta_payload(
|
|
786
|
-
event_name,
|
|
787
|
-
invocation_id=invocation_id,
|
|
788
|
-
delta=delta,
|
|
789
|
-
),
|
|
790
|
-
)
|
|
791
|
-
)
|
|
792
|
-
continue
|
|
793
|
-
if event.type.startswith("a2ui."):
|
|
794
|
-
projected.append(
|
|
795
|
-
(
|
|
796
|
-
event.type,
|
|
797
|
-
{
|
|
798
|
-
"type": event.type,
|
|
799
|
-
"runId": run.id,
|
|
800
|
-
**event.data,
|
|
801
|
-
},
|
|
802
|
-
)
|
|
803
|
-
)
|
|
804
|
-
continue
|
|
805
|
-
if event.type == "run.paused":
|
|
806
|
-
projected.append(
|
|
807
|
-
(
|
|
808
|
-
"response.paused",
|
|
809
|
-
{
|
|
810
|
-
"type": "response.paused",
|
|
811
|
-
"response_id": invocation_id,
|
|
812
|
-
"runId": run.id,
|
|
813
|
-
},
|
|
814
|
-
)
|
|
815
|
-
)
|
|
816
|
-
continue
|
|
817
|
-
if event.type == "run.resumed":
|
|
818
|
-
projected.append(
|
|
819
|
-
(
|
|
820
|
-
"response.resumed",
|
|
821
|
-
{
|
|
822
|
-
"type": "response.resumed",
|
|
823
|
-
"response_id": invocation_id,
|
|
824
|
-
"runId": run.id,
|
|
825
|
-
},
|
|
826
|
-
)
|
|
827
|
-
)
|
|
828
|
-
continue
|
|
829
|
-
if event.type == "approval.resolved":
|
|
830
|
-
projected.append(
|
|
831
|
-
(
|
|
832
|
-
"response.ksadk.approval_resolved",
|
|
833
|
-
{
|
|
834
|
-
"type": "response.ksadk.approval_resolved",
|
|
835
|
-
"approvalRequestId": event.data.get("approvalId")
|
|
836
|
-
or event.data.get("interactionId"),
|
|
837
|
-
"decision": event.data.get("decision")
|
|
838
|
-
or event.data.get("name")
|
|
839
|
-
or "approved",
|
|
840
|
-
"revision": event.data.get("revision") or 2,
|
|
841
|
-
"runId": run.id,
|
|
842
|
-
},
|
|
843
|
-
)
|
|
844
|
-
)
|
|
845
|
-
continue
|
|
846
|
-
item_event = self._response_item_event(event.type, event.data, starts)
|
|
847
|
-
if item_event is not None:
|
|
848
|
-
projected.append(item_event)
|
|
849
|
-
return projected
|
|
1123
|
+
return await project_response_events(
|
|
1124
|
+
self, session_id=session_id, agent_id=agent_id, invocation_id=invocation_id, seen=seen
|
|
1125
|
+
)
|
|
850
1126
|
|
|
851
1127
|
@staticmethod
|
|
852
1128
|
def _response_item_event(
|
|
@@ -862,6 +1138,9 @@ class StudioSharedWebBridge:
|
|
|
862
1138
|
"command.failed",
|
|
863
1139
|
"tool.failed",
|
|
864
1140
|
}
|
|
1141
|
+
failed = event_type.endswith("failed") or str(data.get("status") or "").lower() in {
|
|
1142
|
+
"failed", "error", "uncertain",
|
|
1143
|
+
}
|
|
865
1144
|
if event_type.startswith("command."):
|
|
866
1145
|
command = str(data.get("command") or started.get("command") or "执行命令")
|
|
867
1146
|
item = {
|
|
@@ -870,7 +1149,7 @@ class StudioSharedWebBridge:
|
|
|
870
1149
|
"type": "shell_call",
|
|
871
1150
|
"status": (
|
|
872
1151
|
"failed"
|
|
873
|
-
if
|
|
1152
|
+
if failed or data.get("exitCode") not in {None, 0}
|
|
874
1153
|
else "completed"
|
|
875
1154
|
if done
|
|
876
1155
|
else "in_progress"
|
|
@@ -893,7 +1172,7 @@ class StudioSharedWebBridge:
|
|
|
893
1172
|
"arguments": json.dumps(args, ensure_ascii=False) if args is not None else "",
|
|
894
1173
|
"status": (
|
|
895
1174
|
"failed"
|
|
896
|
-
if
|
|
1175
|
+
if failed
|
|
897
1176
|
else "completed"
|
|
898
1177
|
if done
|
|
899
1178
|
else "in_progress"
|
|
@@ -948,8 +1227,8 @@ class StudioSharedWebBridge:
|
|
|
948
1227
|
"delta": delta,
|
|
949
1228
|
}
|
|
950
1229
|
|
|
951
|
-
@staticmethod
|
|
952
1230
|
def _response_payload(
|
|
1231
|
+
self,
|
|
953
1232
|
run: RunRecord,
|
|
954
1233
|
*,
|
|
955
1234
|
model: str,
|
|
@@ -969,7 +1248,7 @@ class StudioSharedWebBridge:
|
|
|
969
1248
|
"content": [
|
|
970
1249
|
{
|
|
971
1250
|
"type": "output_text",
|
|
972
|
-
"text": run.output,
|
|
1251
|
+
"text": link_run_documents(self.studio, run, run.output),
|
|
973
1252
|
"annotations": [],
|
|
974
1253
|
}
|
|
975
1254
|
],
|
|
@@ -1086,16 +1365,20 @@ class StudioSharedWebBridge:
|
|
|
1086
1365
|
session.id: self._session_metadata_record(session)
|
|
1087
1366
|
for session in persisted
|
|
1088
1367
|
if session.user_id in {"local-user", "local-studio"}
|
|
1368
|
+
and not self.studio.execution_host.is_reserved_session(session.id)
|
|
1089
1369
|
}
|
|
1090
1370
|
grouped: dict[str, list[RunRecord]] = {}
|
|
1091
|
-
for run in self.studio.event_store.list_runs():
|
|
1092
|
-
if run.agent_id != agent_id:
|
|
1093
|
-
continue
|
|
1371
|
+
for run in self.studio.event_store.list_runs(agent_id=agent_id):
|
|
1094
1372
|
grouped.setdefault(run.session_id, []).append(run)
|
|
1095
1373
|
for session_id, runs in grouped.items():
|
|
1096
1374
|
records[session_id] = self._session_record(runs)
|
|
1097
1375
|
ordered = list(records.values())
|
|
1098
|
-
|
|
1376
|
+
# UpdatedAt 相同(同一秒创建的"新会话"、毫秒级并发会话)时以 SessionId
|
|
1377
|
+
# 定序,避免两次 ListSessions 之间插入顺序漂移导致前端列表"乱跳"。
|
|
1378
|
+
ordered.sort(
|
|
1379
|
+
key=lambda item: (item["UpdatedAt"], item["SessionId"]),
|
|
1380
|
+
reverse=True,
|
|
1381
|
+
)
|
|
1099
1382
|
return ordered
|
|
1100
1383
|
|
|
1101
1384
|
def _session_metadata_record(self, session: Session) -> dict[str, Any]:
|
|
@@ -1197,27 +1480,39 @@ class StudioSharedWebBridge:
|
|
|
1197
1480
|
binding_ids = list(draft.spec.bindings.model_profile_ids)
|
|
1198
1481
|
if not binding_ids and draft.spec.bindings.model_profile_id:
|
|
1199
1482
|
binding_ids = [draft.spec.bindings.model_profile_id]
|
|
1200
|
-
|
|
1483
|
+
resolved_descriptors: list[tuple[str, dict[str, Any]]] = []
|
|
1201
1484
|
for binding_id in binding_ids:
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1485
|
+
try:
|
|
1486
|
+
spec = self.studio.catalog.resolve_model(
|
|
1487
|
+
draft.spec.bindings.model_copy(
|
|
1488
|
+
update={"model_profile_id": binding_id, "model_profile_ids": []}
|
|
1489
|
+
)
|
|
1205
1490
|
)
|
|
1206
|
-
|
|
1491
|
+
except StudioError:
|
|
1492
|
+
# provider 目录是惰性发现的;绑定指向尚未发现/已失效的
|
|
1493
|
+
# model:provider:* 资源时跳过该绑定,回退到后续描述符,
|
|
1494
|
+
# 而不是让整个 bootstrap 404(前端只能无限转圈)。
|
|
1495
|
+
continue
|
|
1207
1496
|
if spec is not None:
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1497
|
+
resolved_descriptors.append(
|
|
1498
|
+
(
|
|
1499
|
+
binding_id,
|
|
1500
|
+
self._model_descriptor_from_spec(
|
|
1501
|
+
draft,
|
|
1502
|
+
spec,
|
|
1503
|
+
display_name=self.studio.catalog.get(binding_id).display_name,
|
|
1504
|
+
),
|
|
1213
1505
|
)
|
|
1214
1506
|
)
|
|
1215
|
-
if
|
|
1507
|
+
if resolved_descriptors:
|
|
1216
1508
|
default_id = draft.spec.bindings.model_profile_id
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1509
|
+
# Provider resources are discovered lazily. Keep the resource ID
|
|
1510
|
+
# paired with each successfully resolved descriptor: indexing the
|
|
1511
|
+
# shortened descriptor list with the original binding position
|
|
1512
|
+
# raises IndexError when an earlier binding is temporarily absent.
|
|
1513
|
+
if default_id:
|
|
1514
|
+
resolved_descriptors.sort(key=lambda item: item[0] != default_id)
|
|
1515
|
+
return [descriptor for _, descriptor in resolved_descriptors]
|
|
1221
1516
|
if draft.spec.model is not None:
|
|
1222
1517
|
return [self._model_descriptor_from_spec(draft, draft.spec.model)]
|
|
1223
1518
|
return [self._unconfigured_model_descriptor(draft)]
|
|
@@ -1310,6 +1605,44 @@ class StudioSharedWebBridge:
|
|
|
1310
1605
|
)
|
|
1311
1606
|
return selected
|
|
1312
1607
|
|
|
1608
|
+
def _select_build_model(self, build, requested: str) -> str:
|
|
1609
|
+
"""Authorize execution against the immutable Build model lock."""
|
|
1610
|
+
|
|
1611
|
+
runtime_lock = dict(getattr(build, "runtime_lock", {}) or {})
|
|
1612
|
+
allowed = [str(item) for item in runtime_lock.get("models") or [] if str(item)]
|
|
1613
|
+
default = str(runtime_lock.get("model") or "").strip()
|
|
1614
|
+
# Managed Codex runtime-lock.json deliberately contains only the
|
|
1615
|
+
# runtime and manifest digest. Its immutable model allowlist lives in
|
|
1616
|
+
# the manifest addressed by that digest (and is revalidated by
|
|
1617
|
+
# CodexRunService). Treating the generic Bundle lock as authoritative
|
|
1618
|
+
# for Codex therefore turns every cold/default turn into
|
|
1619
|
+
# AGENT_MODEL_REQUIRED. Read the same pinned manifest used to build
|
|
1620
|
+
# this record; framework/Harness Builds continue to use runtime_lock.
|
|
1621
|
+
agent_name = str(getattr(build, "agent_name", "") or "")
|
|
1622
|
+
manifest_sha256 = str(getattr(build, "manifest_sha256", "") or "")
|
|
1623
|
+
if agent_name and manifest_sha256:
|
|
1624
|
+
snapshot = self.studio.codex_manifests.load(agent_name)
|
|
1625
|
+
if snapshot.manifest_sha256 == manifest_sha256:
|
|
1626
|
+
allowed = list(snapshot.manifest.allowed_models)
|
|
1627
|
+
default = snapshot.manifest.model
|
|
1628
|
+
if default and default not in allowed:
|
|
1629
|
+
allowed.insert(0, default)
|
|
1630
|
+
selected = requested.strip() or default
|
|
1631
|
+
if not selected:
|
|
1632
|
+
raise StudioError(
|
|
1633
|
+
"AGENT_MODEL_REQUIRED",
|
|
1634
|
+
"Build 没有绑定可运行模型",
|
|
1635
|
+
status_code=422,
|
|
1636
|
+
)
|
|
1637
|
+
if allowed and selected not in allowed:
|
|
1638
|
+
raise StudioError(
|
|
1639
|
+
"MODEL_NOT_BOUND",
|
|
1640
|
+
"请求模型未绑定到当前 Agent Build",
|
|
1641
|
+
status_code=422,
|
|
1642
|
+
details={"model": selected, "allowedModels": allowed},
|
|
1643
|
+
)
|
|
1644
|
+
return selected
|
|
1645
|
+
|
|
1313
1646
|
def _draft(self, agent_id: str):
|
|
1314
1647
|
return self.studio.agent_detail(agent_id)["draft"]
|
|
1315
1648
|
|
|
@@ -1483,11 +1816,16 @@ class StudioSharedWebBridge:
|
|
|
1483
1816
|
|
|
1484
1817
|
@staticmethod
|
|
1485
1818
|
def _run_output(run: RunRecord) -> str:
|
|
1819
|
+
status = run.status.value if isinstance(run.status, RunStatus) else str(run.status)
|
|
1820
|
+
if status == RunStatus.FAILED.value and run.error:
|
|
1821
|
+
# Progress text may end with a retry notice. Once the run is
|
|
1822
|
+
# terminal, that notice must not shadow the authoritative failure
|
|
1823
|
+
# recorded by the runtime.
|
|
1824
|
+
return str(run.error.get("message") or "Agent 运行失败")
|
|
1486
1825
|
if run.output:
|
|
1487
1826
|
return run.output
|
|
1488
1827
|
if run.error:
|
|
1489
1828
|
return str(run.error.get("message") or "Agent 运行失败")
|
|
1490
|
-
status = run.status.value if isinstance(run.status, RunStatus) else str(run.status)
|
|
1491
1829
|
return f"运行状态:{status}"
|
|
1492
1830
|
|
|
1493
1831
|
@staticmethod
|
|
@@ -1523,5 +1861,4 @@ class StudioSharedWebBridge:
|
|
|
1523
1861
|
},
|
|
1524
1862
|
)
|
|
1525
1863
|
|
|
1526
|
-
|
|
1527
1864
|
__all__ = ["StudioSharedWebBridge"]
|