agentengine-sdk-python 0.7.0__py3-none-any.whl → 0.8.1__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.7.0.dist-info → agentengine_sdk_python-0.8.1.dist-info}/METADATA +52 -20
- agentengine_sdk_python-0.8.1.dist-info/RECORD +644 -0
- {agentengine_sdk_python-0.7.0.dist-info → agentengine_sdk_python-0.8.1.dist-info}/WHEEL +1 -1
- ksadk/a2a/__init__.py +180 -11
- ksadk/a2a/bootstrap.py +332 -0
- ksadk/a2a/card.py +15 -0
- ksadk/a2a/context_store.py +203 -0
- ksadk/a2a/control_plane.py +1056 -0
- ksadk/a2a/credential.py +99 -0
- ksadk/a2a/event_adapter.py +149 -0
- ksadk/a2a/executor.py +361 -137
- ksadk/a2a/external_transport.py +516 -0
- ksadk/a2a/identity.py +304 -0
- ksadk/a2a/ids.py +22 -0
- ksadk/a2a/langgraph.py +285 -0
- ksadk/a2a/resume_store.py +201 -0
- ksadk/a2a/routes.py +112 -0
- ksadk/a2a/server.py +102 -62
- ksadk/a2a/service_env.py +33 -0
- ksadk/a2a/space_client.py +1122 -0
- ksadk/a2a/task_adapter.py +423 -0
- ksadk/a2a/task_event_dispatcher.py +167 -0
- ksadk/a2a/task_event_outbox.py +326 -0
- ksadk/a2a/task_store.py +206 -0
- ksadk/a2a_card.py +101 -0
- ksadk/a2ui/__init__.py +27 -0
- ksadk/a2ui/core.py +186 -0
- ksadk/a2ui/models.py +166 -0
- ksadk/a2ui/renderer.py +198 -0
- ksadk/agui/__init__.py +9 -0
- ksadk/agui/a2ui_projection.py +92 -0
- ksadk/agui/agent.py +872 -0
- ksadk/agui/config.py +92 -0
- ksadk/agui/routes.py +47 -0
- ksadk/api/client.py +238 -204
- ksadk/api/environment.py +27 -0
- ksadk/builders/__init__.py +2 -0
- ksadk/builders/base.py +16 -14
- ksadk/builders/code_builder.py +375 -270
- ksadk/builders/container_builder.py +240 -200
- ksadk/builders/framework_requirements.py +31 -12
- ksadk/builders/ks3_uploader.py +60 -29
- ksadk/builders/managed_runtime_builder.py +173 -0
- ksadk/builders/mcp_builder.py +91 -92
- ksadk/builders/requirements_utils.py +1 -5
- ksadk/cli/__init__.py +97 -171
- ksadk/cli/cmd_a2a.py +255 -84
- ksadk/cli/cmd_agent.py +19 -5
- ksadk/cli/cmd_build.py +158 -29
- ksadk/cli/cmd_completion.py +47 -35
- ksadk/cli/cmd_config.py +267 -198
- ksadk/cli/cmd_create.py +507 -740
- ksadk/cli/cmd_dashboard.py +120 -45
- ksadk/cli/cmd_deploy.py +135 -59
- ksadk/cli/cmd_destroy.py +44 -14
- ksadk/cli/cmd_eval.py +386 -0
- ksadk/cli/cmd_files.py +63 -24
- ksadk/cli/cmd_hermes.py +313 -135
- ksadk/cli/cmd_invoke.py +184 -122
- ksadk/cli/cmd_launch.py +76 -28
- ksadk/cli/cmd_mcp.py +98 -64
- ksadk/cli/cmd_model.py +14 -5
- ksadk/cli/cmd_openclaw.py +564 -268
- ksadk/cli/cmd_replay.py +71 -0
- ksadk/cli/cmd_run.py +58 -73
- ksadk/cli/cmd_status.py +80 -31
- ksadk/cli/cmd_studio.py +110 -0
- ksadk/cli/cmd_version.py +20 -13
- ksadk/cli/cmd_web.py +95 -18
- ksadk/cli/deploy_utils.py +20 -20
- ksadk/cli/dry_run.py +7 -4
- ksadk/cli/env_options.py +83 -0
- ksadk/cli/error_utils.py +37 -12
- ksadk/cli/global_options.py +4 -3
- ksadk/cli/local_runtime.py +1 -2
- ksadk/cli/model_catalog.py +6 -2
- ksadk/cli/network_options.py +41 -19
- ksadk/cli/resource_common.py +6 -2
- ksadk/cli/runtime_bootstrap.py +51 -0
- ksadk/cli/storage.py +0 -1
- ksadk/cli/ui.py +11 -3
- ksadk/cli/workflow_common.py +52 -18
- ksadk/codex/__init__.py +12 -0
- ksadk/codex/client.py +1042 -0
- ksadk/codex/phase.py +143 -0
- ksadk/codex/runtime.py +940 -0
- ksadk/common/aicp_env.py +0 -1
- ksadk/common/auth.py +2 -2
- ksadk/common/constants.py +1 -3
- ksadk/common/kop_client.py +232 -0
- ksadk/common/llm_utils.py +17 -13
- ksadk/compat/__init__.py +5 -0
- ksadk/compat/adk_compat.py +200 -0
- ksadk/compat/copilotkit_a2ui.py +330 -0
- ksadk/configs/__init__.py +12 -14
- ksadk/configs/env_registry.py +661 -116
- ksadk/configs/global_config.py +3 -2
- ksadk/configs/settings.py +133 -209
- ksadk/conversations/__init__.py +85 -92
- ksadk/conversations/attachment_storage.py +16 -11
- ksadk/conversations/attachments.py +44 -36
- ksadk/conversations/compaction_pipeline.py +12 -12
- ksadk/conversations/compaction_prompt.py +9 -5
- ksadk/conversations/context.py +221 -6
- ksadk/conversations/message_projection.py +438 -51
- ksadk/conversations/model_context.py +12 -6
- ksadk/conversations/model_options.py +0 -1
- ksadk/conversations/normalize.py +20 -16
- ksadk/conversations/reasoning_markup.py +1 -1
- ksadk/conversations/runtime.py +339 -5255
- ksadk/conversations/runtime_compaction.py +333 -0
- ksadk/conversations/runtime_constants.py +27 -0
- ksadk/conversations/runtime_governance.py +185 -0
- ksadk/conversations/runtime_input.py +660 -0
- ksadk/conversations/runtime_invocation.py +395 -0
- ksadk/conversations/runtime_metadata.py +475 -0
- ksadk/conversations/runtime_observability.py +367 -0
- ksadk/conversations/runtime_payloads.py +272 -0
- ksadk/conversations/runtime_persistence.py +440 -0
- ksadk/conversations/runtime_preparation.py +426 -0
- ksadk/conversations/runtime_resume.py +836 -0
- ksadk/conversations/runtime_stream_events.py +902 -0
- ksadk/conversations/runtime_streaming.py +700 -0
- ksadk/conversations/semantic_summary.py +17 -5
- ksadk/conversations/session_title.py +6 -3
- ksadk/deployment/__init__.py +15 -16
- ksadk/deployment/agent_access.py +12 -23
- ksadk/deployment/base.py +51 -38
- ksadk/deployment/managed_runtime.py +33 -0
- ksadk/deployment/manager.py +85 -71
- ksadk/deployment/providers/serverless.py +379 -210
- ksadk/deployment/registry.py +38 -32
- ksadk/deployment/state.py +11 -11
- ksadk/deployment/ui_config.py +1 -1
- ksadk/detection/__init__.py +1 -1
- ksadk/detection/detector.py +146 -83
- ksadk/detection/mcp_detector.py +9 -6
- ksadk/evaluation/__init__.py +84 -0
- ksadk/evaluation/a2a_adapter.py +444 -0
- ksadk/evaluation/adapters.py +54 -0
- ksadk/evaluation/contracts.py +409 -0
- ksadk/evaluation/evalset.py +351 -0
- ksadk/evaluation/evaluators.py +461 -0
- ksadk/evaluation/executor.py +118 -0
- ksadk/evaluation/storage.py +68 -0
- ksadk/evaluation/target.py +73 -0
- ksadk/events/__init__.py +25 -0
- ksadk/events/parser.py +191 -0
- ksadk/events/replay.py +37 -0
- ksadk/events/runtime_event.py +273 -0
- ksadk/events/store.py +317 -0
- ksadk/harness/__init__.py +35 -0
- ksadk/harness/app.py +269 -0
- ksadk/harness/config.py +181 -0
- ksadk/harness/reasoner.py +105 -0
- ksadk/harness/runtime.py +364 -0
- ksadk/harness/sandbox.py +141 -0
- ksadk/harness/tools.py +222 -0
- ksadk/hermes_terminal.py +28 -12
- ksadk/identity/resolver.py +15 -9
- ksadk/ids.py +32 -0
- ksadk/knowledge_base/adk_tool.py +1 -1
- ksadk/knowledge_base/client.py +38 -33
- ksadk/managed_a2a_card.py +160 -0
- ksadk/managed_runtime.py +195 -0
- ksadk/markdown.py +5 -2
- ksadk/mcp_runtime/__init__.py +9 -6
- ksadk/memory/__init__.py +1 -1
- ksadk/memory/adk/__init__.py +2 -0
- ksadk/memory/adk/backends/base_ltm_backend.py +2 -6
- ksadk/memory/adk/backends/http_ltm_backend.py +13 -21
- ksadk/memory/adk/backends/inmemory_ltm_backend.py +7 -13
- ksadk/memory/adk/backends/sdk_ltm_backend.py +36 -36
- ksadk/memory/adk/long_term_memory.py +34 -37
- ksadk/memory/adk/resilient_session_service.py +4 -5
- ksadk/memory/adk/short_term_memory.py +12 -21
- ksadk/memory/adk_tool.py +3 -2
- ksadk/memory/backends/base.py +19 -19
- ksadk/memory/backends/memory.py +24 -25
- ksadk/memory/backends/redis.py +31 -30
- ksadk/memory/langchain_tool.py +2 -1
- ksadk/memory/manager.py +52 -47
- ksadk/memory/service.py +16 -6
- ksadk/memory/tool.py +4 -0
- ksadk/model_policy.py +15 -7
- ksadk/model_proxy/__init__.py +51 -0
- ksadk/model_proxy/bootstrap.py +80 -0
- ksadk/model_proxy/cache.py +165 -0
- ksadk/model_proxy/config.py +66 -0
- ksadk/model_proxy/demo_webui.py +115 -0
- ksadk/model_proxy/detect.py +145 -0
- ksadk/model_proxy/gate.py +68 -0
- ksadk/model_proxy/namespace.py +201 -0
- ksadk/model_proxy/protocol_proxy.py +22 -0
- ksadk/model_proxy/server.py +443 -0
- ksadk/model_proxy/transform.py +735 -0
- ksadk/openclaw_gateway.py +29 -14
- ksadk/runners/adk_runner.py +354 -146
- ksadk/runners/base_runner.py +71 -29
- ksadk/runners/deepagents_runner.py +0 -1
- ksadk/runners/factory.py +18 -5
- ksadk/runners/langchain_runner.py +29 -742
- ksadk/runners/langgraph_runner.py +417 -97
- ksadk/runners/patch_langchain.py +16 -16
- ksadk/runners/remote_runner.py +134 -33
- ksadk/runners/usage_accumulator.py +1 -0
- ksadk/runners/utils/__init__.py +0 -10
- ksadk/runners/utils/loader.py +23 -7
- ksadk/runtime/__init__.py +67 -0
- ksadk/runtime/adapter.py +412 -0
- ksadk/runtime/conversation_execution.py +553 -0
- ksadk/runtime/executor.py +251 -0
- ksadk/runtime/factory.py +156 -0
- ksadk/runtime/framework_adapters.py +118 -0
- ksadk/runtime/launch.py +48 -0
- ksadk/runtime/preprocessing.py +131 -0
- ksadk/runtime/runner_adapter.py +1032 -0
- ksadk/runtime/runner_loading.py +36 -0
- ksadk/runtime_context.py +18 -3
- ksadk/runtime_state.py +0 -1
- ksadk/sandbox/__init__.py +4 -1
- ksadk/sandbox/backends/__init__.py +4 -1
- ksadk/sandbox/backends/e2b.py +13 -5
- ksadk/sandbox/backends/local_process.py +11 -3
- ksadk/sandbox/base.py +10 -15
- ksadk/sandbox/factory.py +14 -4
- ksadk/sandbox/registry.py +57 -6
- ksadk/server/__init__.py +39 -4
- ksadk/server/api_models.py +15 -5
- ksadk/server/app.py +24 -3928
- ksadk/server/composition.py +47 -0
- ksadk/server/factory.py +622 -0
- ksadk/server/routes/__init__.py +1 -0
- ksadk/server/routes/checkpoint_resolution.py +116 -0
- ksadk/server/routes/common.py +682 -0
- ksadk/server/routes/control.py +331 -0
- ksadk/server/routes/dependencies.py +98 -0
- ksadk/server/routes/misc.py +425 -0
- ksadk/server/routes/models.py +451 -0
- ksadk/server/routes/openai_compat.py +229 -0
- ksadk/server/routes/projection.py +848 -0
- ksadk/server/routes/routers.py +52 -0
- ksadk/server/routes/run.py +519 -0
- ksadk/server/routes/sessions.py +644 -0
- ksadk/server/routes/streaming.py +265 -0
- ksadk/server/routes/workspace.py +414 -0
- ksadk/server/static/assets/{ArtifactsPanel-D-SSn2ee.js → ArtifactsPanel-CakCqxEN.js} +1 -1
- ksadk/server/static/assets/CodeBlock-CynLknyO.js +9 -0
- ksadk/server/static/assets/MathMessageMarkdown-3sQdOysS.js +8 -0
- ksadk/server/static/assets/MermaidBlock-NERD_ef7.js +303 -0
- ksadk/server/static/assets/NativeTerminalPanel-CiHWf82q.js +1 -0
- ksadk/server/static/assets/{arc-BA13sHc9.js → arc-DrgjcKhl.js} +1 -1
- ksadk/server/static/assets/architecture-7EHR7CIX-CpZLRCcY.js +1 -0
- ksadk/server/static/assets/{architectureDiagram-3BPJPVTR-DzJzgVoL.js → architectureDiagram-3BPJPVTR-BXoVRbQ6.js} +1 -1
- ksadk/server/static/assets/{blockDiagram-GPEHLZMM-UTdVcZhn.js → blockDiagram-GPEHLZMM-BnaB3Ywv.js} +1 -1
- ksadk/server/static/assets/{c4Diagram-AAUBKEIU-Dix0GD4m.js → c4Diagram-AAUBKEIU-Dw4weZcp.js} +1 -1
- ksadk/server/static/assets/channel-Dt3rQTFI.js +1 -0
- ksadk/server/static/assets/{chunk-2J33WTMH-C2JxuZ42.js → chunk-2J33WTMH-ChjpLK7j.js} +1 -1
- ksadk/server/static/assets/{chunk-4BX2VUAB-Be57QPgD.js → chunk-4BX2VUAB-B9drTgOW.js} +1 -1
- ksadk/server/static/assets/{chunk-55IACEB6-WjSuy4nv.js → chunk-55IACEB6-CK4ROATy.js} +1 -1
- ksadk/server/static/assets/{chunk-727SXJPM-BOovP-b5.js → chunk-727SXJPM-B9KtTTgw.js} +1 -1
- ksadk/server/static/assets/{chunk-AQP2D5EJ-DOmZNmWj.js → chunk-AQP2D5EJ-1O1mki3m.js} +1 -1
- ksadk/server/static/assets/{chunk-FMBD7UC4-DzwlodkU.js → chunk-FMBD7UC4-B_fH2YuH.js} +1 -1
- ksadk/server/static/assets/{chunk-ND2GUHAM-DMqAikEU.js → chunk-ND2GUHAM-D6rFLaVV.js} +1 -1
- ksadk/server/static/assets/chunk-QZHKN3VN-iXEZtKQc.js +1 -0
- ksadk/server/static/assets/classDiagram-4FO5ZUOK-DIveV17Q.js +1 -0
- ksadk/server/static/assets/classDiagram-v2-Q7XG4LA2-DIveV17Q.js +1 -0
- ksadk/server/static/assets/{cose-bilkent-S5V4N54A-Zhy2GBnP.js → cose-bilkent-S5V4N54A-ChNs_Mdk.js} +1 -1
- ksadk/server/static/assets/{dagre-BM42HDAG-CbKrtIUz.js → dagre-BM42HDAG-D0QXg_MQ.js} +1 -1
- ksadk/server/static/assets/{diagram-2AECGRRQ-BRApgQRK.js → diagram-2AECGRRQ-DBDDKwBQ.js} +1 -1
- ksadk/server/static/assets/{diagram-5GNKFQAL-D0xbnDiK.js → diagram-5GNKFQAL-BkwDOxmO.js} +1 -1
- ksadk/server/static/assets/{diagram-KO2AKTUF-CVugVI9L.js → diagram-KO2AKTUF-Bv8waYvY.js} +1 -1
- ksadk/server/static/assets/{diagram-LMA3HP47-DozUGgee.js → diagram-LMA3HP47-e1VECDdu.js} +1 -1
- ksadk/server/static/assets/{diagram-OG6HWLK6-ZOYsKlru.js → diagram-OG6HWLK6-Ds9adfRl.js} +1 -1
- ksadk/server/static/assets/{dist-DpKtt4Bo.js → dist-4N2NMVYg.js} +1 -1
- ksadk/server/static/assets/{dist-CkEKJFtk.js → dist-B-jNR6Vn.js} +1 -1
- ksadk/server/static/assets/{dist-D57wnGWd.js → dist-B5J2uhNk.js} +1 -1
- ksadk/server/static/assets/{dist-8_SfK1IP.js → dist-B5oS1zcj.js} +1 -1
- ksadk/server/static/assets/{dist-DMezvBGJ.js → dist-BB3-OwTQ.js} +1 -1
- ksadk/server/static/assets/{dist-2hInLS_J.js → dist-BIlKoW0k.js} +1 -1
- ksadk/server/static/assets/{dist-BrCcQ47T.js → dist-BjOdlDjj.js} +1 -1
- ksadk/server/static/assets/{dist-BmlMPsCc.js → dist-C1sz5Eo3.js} +1 -1
- ksadk/server/static/assets/{dist-B0NP_Z0z.js → dist-CWV4lDr1.js} +1 -1
- ksadk/server/static/assets/{dist-D-xOD048.js → dist-CmZHzlwZ.js} +1 -1
- ksadk/server/static/assets/{dist-DL_NKc_z.js → dist-D6MpCZtz.js} +1 -1
- ksadk/server/static/assets/{dist-DyOkZmze.js → dist-DJN_6Y39.js} +1 -1
- ksadk/server/static/assets/{dist-DmFaq_Iy.js → dist-DQU9EWw-.js} +1 -1
- ksadk/server/static/assets/{dist-gX6GOLKq.js → dist-DWKByxWV.js} +1 -1
- ksadk/server/static/assets/{dist-DyWsb78Q.js → dist-Dli7qW-B.js} +1 -1
- ksadk/server/static/assets/{dist-BIJVDMuB.js → dist-DsHPdk3W.js} +1 -1
- ksadk/server/static/assets/{dist-Dp0k7bWI.js → dist-X4TnqwOK.js} +1 -1
- ksadk/server/static/assets/{dist-8EEyGgDx.js → dist-_pHPTyZ-.js} +1 -1
- ksadk/server/static/assets/{dist-CPBtqRTW.js → dist-fhOuWds5.js} +1 -1
- ksadk/server/static/assets/{dist-D-JMdWPQ.js → dist-gLnrGsoU.js} +1 -1
- ksadk/server/static/assets/{dist-BssVmjIo.js → dist-j6Dxmf_j.js} +1 -1
- ksadk/server/static/assets/{dist-C3HIIaN5.js → dist-o2OVmKvt.js} +1 -1
- ksadk/server/static/assets/{erDiagram-TEJ5UH35-Bk-9bgE5.js → erDiagram-TEJ5UH35-BPItFKH6.js} +1 -1
- ksadk/server/static/assets/eventmodeling-FCH6USID-DYFSxbqr.js +1 -0
- ksadk/server/static/assets/{flowDiagram-I6XJVG4X-Dn9kZVuZ.js → flowDiagram-I6XJVG4X-BbYB9w5Y.js} +1 -1
- ksadk/server/static/assets/{ganttDiagram-6RSMTGT7-BGxXlJqm.js → ganttDiagram-6RSMTGT7-TQXa0KXv.js} +1 -1
- ksadk/server/static/assets/gitGraph-WXDBUCRP-DyNYp6BN.js +1 -0
- ksadk/server/static/assets/{gitGraphDiagram-PVQCEYII-C7Q0X-wi.js → gitGraphDiagram-PVQCEYII-bKblCnpa.js} +1 -1
- ksadk/server/static/assets/index-R52pJJvg.js +177 -0
- ksadk/server/static/assets/index-jJr3_955.css +2 -0
- ksadk/server/static/assets/info-J43DQDTF-WUx7qTde.js +1 -0
- ksadk/server/static/assets/{infoDiagram-5YYISTIA-BO_CSqq5.js → infoDiagram-5YYISTIA-BGVT7J_i.js} +1 -1
- ksadk/server/static/assets/{ishikawaDiagram-YF4QCWOH-eYLPLd46.js → ishikawaDiagram-YF4QCWOH-K0OOfVna.js} +1 -1
- ksadk/server/static/assets/{journeyDiagram-JHISSGLW-De9geSb0.js → journeyDiagram-JHISSGLW-8LeOJaZp.js} +1 -1
- ksadk/server/static/assets/{kanban-definition-UN3LZRKU-Cs80kQto.js → kanban-definition-UN3LZRKU-C6uCgZrW.js} +1 -1
- ksadk/server/static/assets/{katex-DSrCFD8n.js → katex-CYWseY5E.js} +1 -1
- ksadk/server/static/assets/{linear-CN9sbKTF.js → linear-hdBcYzM8.js} +1 -1
- ksadk/server/static/assets/{mermaid-parser.core-DlgSBU8l.js → mermaid-parser.core-BWrDjSZM.js} +2 -2
- ksadk/server/static/assets/{mindmap-definition-RKZ34NQL-9afz7Oug.js → mindmap-definition-RKZ34NQL-Bjy_2v4_.js} +1 -1
- ksadk/server/static/assets/packet-YPE3B663-BN13y_xl.js +1 -0
- ksadk/server/static/assets/pie-LRSECV5Y-ftSLXhhc.js +1 -0
- ksadk/server/static/assets/{pieDiagram-4H26LBE5-DPv_VstN.js → pieDiagram-4H26LBE5-GmmqNiVH.js} +1 -1
- ksadk/server/static/assets/{quadrantDiagram-W4KKPZXB-o77wZ1XK.js → quadrantDiagram-W4KKPZXB-BmkRbwCg.js} +1 -1
- ksadk/server/static/assets/radar-GUYGQ44K-jaICkIeO.js +1 -0
- ksadk/server/static/assets/{requirementDiagram-4Y6WPE33-BYVw81VC.js → requirementDiagram-4Y6WPE33-DSWFqL7c.js} +1 -1
- ksadk/server/static/assets/{sankeyDiagram-5OEKKPKP-B7nZFMKT.js → sankeyDiagram-5OEKKPKP-l6iXmU65.js} +1 -1
- ksadk/server/static/assets/{sequenceDiagram-3UESZ5HK-BGRRrFw5.js → sequenceDiagram-3UESZ5HK-Cq6UBeQB.js} +1 -1
- ksadk/server/static/assets/{stateDiagram-AJRCARHV-BUfHCoPs.js → stateDiagram-AJRCARHV-qzTQpg3Y.js} +1 -1
- ksadk/server/static/assets/stateDiagram-v2-BHNVJYJU-BYCoYGAN.js +1 -0
- ksadk/server/static/assets/{timeline-definition-PNZ67QCA-FbCTGrf9.js → timeline-definition-PNZ67QCA-DEz24vV0.js} +1 -1
- ksadk/server/static/assets/treeView-BLDUP644-Cpib_vlz.js +1 -0
- ksadk/server/static/assets/treemap-LRROVOQU-DQxfmVHK.js +1 -0
- ksadk/server/static/assets/{vennDiagram-CIIHVFJN-DWgwtPsJ.js → vennDiagram-CIIHVFJN-CMCixki2.js} +1 -1
- ksadk/server/static/assets/wardley-L42UT6IY-BQYHnnkU.js +1 -0
- ksadk/server/static/assets/{wardleyDiagram-YWT4CUSO-2x8G-tTM.js → wardleyDiagram-YWT4CUSO-CVzB8F9K.js} +1 -1
- ksadk/server/static/assets/{xychartDiagram-2RQKCTM6-Drma3AYl.js → xychartDiagram-2RQKCTM6-BFBqBLc1.js} +1 -1
- ksadk/server/static/index.html +2 -2
- ksadk/server/terminal_sessions.py +111 -58
- ksadk/sessions/__init__.py +69 -19
- ksadk/sessions/base.py +31 -11
- ksadk/sessions/continuity.py +2 -3
- ksadk/sessions/in_memory.py +46 -2
- ksadk/sessions/local_service.py +148 -17
- ksadk/sessions/postgres_service.py +143 -25
- ksadk/sessions/resilient.py +36 -8
- ksadk/skills/models.py +17 -5
- ksadk/skills/package_store.py +5 -2
- ksadk/skills/runtime/agent.py +20 -5
- ksadk/skills/runtime/artifacts.py +1 -5
- ksadk/skills/runtime/backends/e2b.py +10 -4
- ksadk/skills/runtime/backends/local.py +15 -3
- ksadk/skills/runtime/base.py +1 -2
- ksadk/skills/runtime/executor.py +10 -3
- ksadk/skills/runtime/factory.py +4 -2
- ksadk/skills/runtime/loader.py +1 -2
- ksadk/skills/runtime/registry.py +15 -10
- ksadk/skills/runtime/request.py +3 -1
- ksadk/skills/service_client.py +47 -16
- ksadk/skills/tool_defs.py +15 -10
- ksadk/studio/__init__.py +5 -0
- ksadk/studio/agent_avatar_assets.py +120 -0
- ksadk/studio/agent_lifecycle.py +51 -0
- ksadk/studio/api.py +1046 -0
- ksadk/studio/api_catalog_routes.py +324 -0
- ksadk/studio/api_contracts.py +177 -0
- ksadk/studio/api_helpers.py +132 -0
- ksadk/studio/authoring.py +524 -0
- ksadk/studio/authoring_coordinator.py +285 -0
- ksadk/studio/builder.py +320 -0
- ksadk/studio/capabilities.py +351 -0
- ksadk/studio/cloud.py +278 -0
- ksadk/studio/codex_agent_service.py +583 -0
- ksadk/studio/codex_builder.py +324 -0
- ksadk/studio/codex_manifest.py +278 -0
- ksadk/studio/codex_run.py +352 -0
- ksadk/studio/compiler.py +189 -0
- ksadk/studio/contracts.py +644 -0
- ksadk/studio/errors.py +47 -0
- ksadk/studio/evaluation.py +192 -0
- ksadk/studio/event_store.py +284 -0
- ksadk/studio/framework_run.py +114 -0
- ksadk/studio/identifiers.py +33 -0
- ksadk/studio/mcp_runtime.py +229 -0
- ksadk/studio/model_client.py +543 -0
- ksadk/studio/model_profile_service.py +214 -0
- ksadk/studio/operations.py +243 -0
- ksadk/studio/otel_trace.py +754 -0
- ksadk/studio/pagination.py +182 -0
- ksadk/studio/python_tool_inspection.py +183 -0
- ksadk/studio/repository.py +306 -0
- ksadk/studio/resource_catalog.py +1217 -0
- ksadk/studio/run_service.py +707 -0
- ksadk/studio/runtime_catalog.py +74 -0
- ksadk/studio/runtime_source.py +339 -0
- ksadk/studio/service.py +1141 -0
- ksadk/studio/shared_web.py +994 -0
- ksadk/studio/skill_discovery.py +628 -0
- ksadk/studio/static/assets/PrismRenderer-IYN-ffww.js +3 -0
- ksadk/studio/static/assets/index-CaEN0eTR.css +1 -0
- ksadk/studio/static/assets/index-DI2eY_NH.js +252 -0
- ksadk/studio/static/assets/react-vendor-BNmTiJ-I.js +9 -0
- ksadk/studio/static/assets/rolldown-runtime-hePW80VL.js +1 -0
- ksadk/studio/static/index.html +15 -0
- ksadk/studio/templates.py +630 -0
- ksadk/studio/validator.py +246 -0
- ksadk/studio/workspace.py +137 -0
- ksadk/terminal_exec_policy.py +3 -4
- ksadk/tools/gateway.py +101 -15
- ksadk/tools/result_budget.py +12 -4
- ksadk/toolsets/__init__.py +161 -37
- ksadk/toolsets/a2a.py +426 -0
- ksadk/toolsets/platform.py +21 -5
- ksadk/toolsets/sandbox.py +82 -16
- ksadk/toolsets/skills.py +200 -39
- ksadk/toolsets/web.py +123 -26
- ksadk/toolsets/workspace.py +212 -101
- ksadk/tracing/__init__.py +19 -21
- ksadk/tracing/exporters/inmemory_exporter.py +62 -51
- ksadk/tracing/setup.py +135 -506
- ksadk/tracing/span_utils.py +0 -41
- ksadk/tui/loop.py +78 -30
- ksadk/tui/stream_render.py +1 -0
- ksadk/ui_config.py +5 -3
- ksadk/version.py +1 -1
- ksadk_runtime_common/memory_backend/registry.py +56 -56
- ksadk_runtime_common/schemas/runtime_event_v1.json +95 -0
- ksadk_runtime_common/workspace_files/router.py +8 -2
- agentengine_sdk_python-0.7.0.dist-info/RECORD +0 -482
- ksadk/a2a/card_builder.py +0 -64
- ksadk/a2a/client.py +0 -309
- ksadk/runners/utils/langfuse.py +0 -230
- ksadk/server/static/assets/CodeBlock-P16VOLYi.js +0 -9
- ksadk/server/static/assets/MathMessageMarkdown-CdGiQWHR.js +0 -8
- ksadk/server/static/assets/MermaidBlock-IOcal8cm.js +0 -303
- ksadk/server/static/assets/NativeTerminalPanel-DGSDWsei.js +0 -1
- ksadk/server/static/assets/architecture-7EHR7CIX-BvUlsA6l.js +0 -1
- ksadk/server/static/assets/channel-CTuydARX.js +0 -1
- ksadk/server/static/assets/chunk-QZHKN3VN-BnCydivS.js +0 -1
- ksadk/server/static/assets/classDiagram-4FO5ZUOK-BNHg45Be.js +0 -1
- ksadk/server/static/assets/classDiagram-v2-Q7XG4LA2-BNHg45Be.js +0 -1
- ksadk/server/static/assets/eventmodeling-FCH6USID-DsAgWnlf.js +0 -1
- ksadk/server/static/assets/gitGraph-WXDBUCRP-BIao9Yjg.js +0 -1
- ksadk/server/static/assets/index-C00Lwg3L.js +0 -165
- ksadk/server/static/assets/index-DAURbCsP.css +0 -1
- ksadk/server/static/assets/info-J43DQDTF-CyipqGxU.js +0 -1
- ksadk/server/static/assets/packet-YPE3B663-CGkyRxlg.js +0 -1
- ksadk/server/static/assets/pie-LRSECV5Y-M0uWAf4n.js +0 -1
- ksadk/server/static/assets/radar-GUYGQ44K-Bdbm24-x.js +0 -1
- ksadk/server/static/assets/stateDiagram-v2-BHNVJYJU-8xBN_gLM.js +0 -1
- ksadk/server/static/assets/treeView-BLDUP644-npMo0ak1.js +0 -1
- ksadk/server/static/assets/treemap-LRROVOQU-CHdzrrdo.js +0 -1
- ksadk/server/static/assets/wardley-L42UT6IY-BEQz7wyy.js +0 -1
- ksadk/tracing/exporters/langfuse_exporter.py +0 -445
- {agentengine_sdk_python-0.7.0.dist-info → agentengine_sdk_python-0.8.1.dist-info}/entry_points.txt +0 -0
- {agentengine_sdk_python-0.7.0.dist-info → agentengine_sdk_python-0.8.1.dist-info}/licenses/LICENSE +0 -0
- {agentengine_sdk_python-0.7.0.dist-info → agentengine_sdk_python-0.8.1.dist-info}/top_level.txt +0 -0
ksadk/cli/model_catalog.py
CHANGED
|
@@ -116,7 +116,9 @@ async def fetch_provider_model_catalog(
|
|
|
116
116
|
normalized: list[dict[str, Any]] = []
|
|
117
117
|
for raw_model in _extract_catalog_items(payload):
|
|
118
118
|
item = normalize_model_metadata(raw_model)
|
|
119
|
-
item["_provider_raw_model"] =
|
|
119
|
+
item["_provider_raw_model"] = (
|
|
120
|
+
raw_model if isinstance(raw_model, Mapping) else {"id": str(raw_model)}
|
|
121
|
+
)
|
|
120
122
|
normalized.append(item)
|
|
121
123
|
return normalized
|
|
122
124
|
|
|
@@ -128,7 +130,9 @@ async def fetch_provider_model_metadata(
|
|
|
128
130
|
model: str | None,
|
|
129
131
|
timeout: float = 10.0,
|
|
130
132
|
) -> dict[str, Any] | None:
|
|
131
|
-
catalog = await fetch_provider_model_catalog(
|
|
133
|
+
catalog = await fetch_provider_model_catalog(
|
|
134
|
+
api_base=api_base, api_key=api_key, timeout=timeout
|
|
135
|
+
)
|
|
132
136
|
raw_models = [item.get("_provider_raw_model") or item for item in catalog]
|
|
133
137
|
raw_match = find_model_in_catalog(raw_models, model)
|
|
134
138
|
if raw_match is None:
|
ksadk/cli/network_options.py
CHANGED
|
@@ -38,7 +38,10 @@ def network_options(func):
|
|
|
38
38
|
click.option(
|
|
39
39
|
"--enable-public-access/--disable-public-access",
|
|
40
40
|
default=None,
|
|
41
|
-
help=
|
|
41
|
+
help=(
|
|
42
|
+
"是否开启公网访问;创建时默认开启,更新已有 Agent 时未指定则保留现有配置"
|
|
43
|
+
"(显式传入才覆盖)"
|
|
44
|
+
),
|
|
42
45
|
),
|
|
43
46
|
click.option("--enable-vpc-access", is_flag=True, default=False, help="开启 VPC 私网访问"),
|
|
44
47
|
click.option("--vpc-id", default=None, help="VPC ID(开启 VPC 访问时必填)"),
|
|
@@ -75,7 +78,8 @@ def extract_network_config(config: Mapping[str, Any] | None) -> dict[str, Any]:
|
|
|
75
78
|
"""Read network from top-level `network` or `deploy.network`."""
|
|
76
79
|
if not isinstance(config, Mapping):
|
|
77
80
|
return {}
|
|
78
|
-
|
|
81
|
+
deploy_value = config.get("deploy")
|
|
82
|
+
deploy_config: Mapping[str, Any] = deploy_value if isinstance(deploy_value, Mapping) else {}
|
|
79
83
|
raw_network = config.get("network") or deploy_config.get("network") or {}
|
|
80
84
|
return dict(raw_network) if isinstance(raw_network, Mapping) else {}
|
|
81
85
|
|
|
@@ -98,7 +102,12 @@ def apply_network_config(config: Mapping[str, Any] | None, deploy_target: "Deplo
|
|
|
98
102
|
if _picked_public_access is not None:
|
|
99
103
|
deploy_target.network.enable_public_access = bool(_picked_public_access)
|
|
100
104
|
deploy_target.network.enable_vpc_access = bool(
|
|
101
|
-
_pick(
|
|
105
|
+
_pick(
|
|
106
|
+
"enable_vpc_access",
|
|
107
|
+
"enableVpcAccess",
|
|
108
|
+
"EnableVpcAccess",
|
|
109
|
+
default=deploy_target.network.enable_vpc_access,
|
|
110
|
+
)
|
|
102
111
|
)
|
|
103
112
|
deploy_target.network.vpc_id = str(
|
|
104
113
|
_pick("vpc_id", "vpcId", "VpcId", default=deploy_target.network.vpc_id) or ""
|
|
@@ -136,7 +145,9 @@ def apply_network_cli_overrides(deploy_target: "DeployTarget", **network_kwargs:
|
|
|
136
145
|
value = network_kwargs.get(field)
|
|
137
146
|
if value is not None:
|
|
138
147
|
setattr(deploy_target.network, field, str(value or "").strip())
|
|
139
|
-
if any(
|
|
148
|
+
if any(
|
|
149
|
+
str(getattr(deploy_target.network, field, "") or "").strip() for field in _VPC_ID_FIELDS
|
|
150
|
+
):
|
|
140
151
|
deploy_target.network.enable_vpc_access = True
|
|
141
152
|
|
|
142
153
|
|
|
@@ -145,7 +156,9 @@ def validate_deploy_target_network(deploy_target: "DeployTarget") -> None:
|
|
|
145
156
|
values = {
|
|
146
157
|
"vpc_id": str(getattr(deploy_target.network, "vpc_id", "") or "").strip(),
|
|
147
158
|
"subnet_id": str(getattr(deploy_target.network, "subnet_id", "") or "").strip(),
|
|
148
|
-
"security_group_id": str(
|
|
159
|
+
"security_group_id": str(
|
|
160
|
+
getattr(deploy_target.network, "security_group_id", "") or ""
|
|
161
|
+
).strip(),
|
|
149
162
|
}
|
|
150
163
|
has_any_vpc_id = any(values.values())
|
|
151
164
|
if not (bool(getattr(deploy_target.network, "enable_vpc_access", False)) or has_any_vpc_id):
|
|
@@ -156,7 +169,8 @@ def validate_deploy_target_network(deploy_target: "DeployTarget") -> None:
|
|
|
156
169
|
"开启 VPC 访问时必须同时提供 VpcId、SubnetId、SecurityGroupId。",
|
|
157
170
|
details={"missing": missing},
|
|
158
171
|
hints=[
|
|
159
|
-
"请同时传入 `--vpc-id`、`--subnet-id`、`--security-group-id
|
|
172
|
+
"请同时传入 `--vpc-id`、`--subnet-id`、`--security-group-id`,"
|
|
173
|
+
"或在配置文件 network/deploy.network 中同时设置这三个字段。",
|
|
160
174
|
"`--availability-zone` 是可选字段,不替代子网或安全组。",
|
|
161
175
|
],
|
|
162
176
|
)
|
|
@@ -191,8 +205,7 @@ def resolve_deploy_target_network(
|
|
|
191
205
|
print_info(f"已根据子网 {subnet_id} 自动推断可用区: {availability_zone}")
|
|
192
206
|
else:
|
|
193
207
|
print_warn(
|
|
194
|
-
"未能根据子网自动推断可用区;如私网 ENI 调度失败,请显式传入 "
|
|
195
|
-
"`--availability-zone`。"
|
|
208
|
+
"未能根据子网自动推断可用区;如私网 ENI 调度失败,请显式传入 " "`--availability-zone`。"
|
|
196
209
|
)
|
|
197
210
|
|
|
198
211
|
|
|
@@ -234,7 +247,9 @@ def _validate_network_payload(payload: Mapping[str, Any]) -> None:
|
|
|
234
247
|
)
|
|
235
248
|
|
|
236
249
|
|
|
237
|
-
def _fill_network_availability_zone(
|
|
250
|
+
def _fill_network_availability_zone(
|
|
251
|
+
payload: dict[str, Any], network_kwargs: Mapping[str, Any]
|
|
252
|
+
) -> None:
|
|
238
253
|
if str(payload.get("availability_zone") or "").strip():
|
|
239
254
|
return
|
|
240
255
|
if not bool(payload.get("enable_vpc_access")):
|
|
@@ -254,8 +269,7 @@ def _fill_network_availability_zone(payload: dict[str, Any], network_kwargs: Map
|
|
|
254
269
|
print_info(f"已根据子网 {subnet_id} 自动推断可用区: {availability_zone}")
|
|
255
270
|
else:
|
|
256
271
|
print_warn(
|
|
257
|
-
"未能根据子网自动推断可用区;如私网 ENI 调度失败,请显式传入 "
|
|
258
|
-
"`--availability-zone`。"
|
|
272
|
+
"未能根据子网自动推断可用区;如私网 ENI 调度失败,请显式传入 " "`--availability-zone`。"
|
|
259
273
|
)
|
|
260
274
|
|
|
261
275
|
|
|
@@ -270,7 +284,9 @@ def _resolve_subnet_availability_zone(*, subnet_id: str, region: str) -> str | N
|
|
|
270
284
|
return None
|
|
271
285
|
|
|
272
286
|
try:
|
|
273
|
-
VpcClient, DescribeSubnetsRequest, Credential, ClientProfile, HttpProfile =
|
|
287
|
+
VpcClient, DescribeSubnetsRequest, Credential, ClientProfile, HttpProfile = (
|
|
288
|
+
_import_vpc_sdk()
|
|
289
|
+
)
|
|
274
290
|
except Exception as exc:
|
|
275
291
|
print_warn(f"缺少 VPC 子网查询 SDK,跳过可用区自动推断: {exc}")
|
|
276
292
|
return None
|
|
@@ -300,11 +316,13 @@ def _resolve_subnet_availability_zone(*, subnet_id: str, region: str) -> str | N
|
|
|
300
316
|
|
|
301
317
|
|
|
302
318
|
def _import_vpc_sdk():
|
|
303
|
-
from ksyun.client.vpc.v20160304.client import VpcClient
|
|
304
|
-
from ksyun.client.vpc.v20160304.models import
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
from ksyun.common.
|
|
319
|
+
from ksyun.client.vpc.v20160304.client import VpcClient # type: ignore[import-untyped]
|
|
320
|
+
from ksyun.client.vpc.v20160304.models import ( # type: ignore[import-untyped]
|
|
321
|
+
DescribeSubnetsRequest,
|
|
322
|
+
)
|
|
323
|
+
from ksyun.common.credential import Credential # type: ignore[import-untyped]
|
|
324
|
+
from ksyun.common.profile.client_profile import ClientProfile # type: ignore[import-untyped]
|
|
325
|
+
from ksyun.common.profile.http_profile import HttpProfile # type: ignore[import-untyped]
|
|
308
326
|
|
|
309
327
|
return VpcClient, DescribeSubnetsRequest, Credential, ClientProfile, HttpProfile
|
|
310
328
|
|
|
@@ -328,8 +346,12 @@ def _resolve_ksyun_credentials() -> tuple[str, str]:
|
|
|
328
346
|
except Exception:
|
|
329
347
|
global_env = {}
|
|
330
348
|
|
|
331
|
-
access_key =
|
|
332
|
-
|
|
349
|
+
access_key = (
|
|
350
|
+
access_key or global_env.get("KSYUN_ACCESS_KEY") or global_env.get("KS3_ACCESS_KEY") or ""
|
|
351
|
+
)
|
|
352
|
+
secret_key = (
|
|
353
|
+
secret_key or global_env.get("KSYUN_SECRET_KEY") or global_env.get("KS3_SECRET_KEY") or ""
|
|
354
|
+
)
|
|
333
355
|
return str(access_key or "").strip(), str(secret_key or "").strip()
|
|
334
356
|
|
|
335
357
|
|
ksadk/cli/resource_common.py
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from dataclasses import dataclass, field
|
|
6
5
|
import re
|
|
6
|
+
from dataclasses import dataclass, field
|
|
7
7
|
from typing import Any, Callable, Iterable, Sequence, TypeVar
|
|
8
8
|
|
|
9
9
|
import click
|
|
@@ -181,6 +181,7 @@ def confirm_destructive(
|
|
|
181
181
|
details={"prompt": prompt},
|
|
182
182
|
)
|
|
183
183
|
)
|
|
184
|
+
return False
|
|
184
185
|
if click.confirm(prompt):
|
|
185
186
|
return True
|
|
186
187
|
from ksadk.cli.error_utils import abort_with_cli_error, cancelled_error
|
|
@@ -192,6 +193,7 @@ def confirm_destructive(
|
|
|
192
193
|
details={"prompt": prompt},
|
|
193
194
|
)
|
|
194
195
|
)
|
|
196
|
+
return False
|
|
195
197
|
|
|
196
198
|
|
|
197
199
|
def print_list_summary(*, total: int, page: int, size: int, noun: str) -> None:
|
|
@@ -244,7 +246,9 @@ def get_descriptor_resource_key(descriptor: ResourceDescriptor) -> str:
|
|
|
244
246
|
return descriptor.resource_key or _resource_key(descriptor.name) or "resource"
|
|
245
247
|
|
|
246
248
|
|
|
247
|
-
def _legacy_action_descriptors(
|
|
249
|
+
def _legacy_action_descriptors(
|
|
250
|
+
descriptor: ResourceDescriptor,
|
|
251
|
+
) -> tuple[ResourceActionDescriptor, ...]:
|
|
248
252
|
action_set = descriptor.actions
|
|
249
253
|
if not isinstance(action_set, ResourceActionSet):
|
|
250
254
|
return tuple(action_set)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Shared RuntimeAdapter-first application composition for CLI entrypoints."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from fastapi import FastAPI
|
|
10
|
+
|
|
11
|
+
from ksadk.agui.config import agui_config_for_detection
|
|
12
|
+
from ksadk.runtime import RuntimeExecutor, RuntimeLaunchContext
|
|
13
|
+
from ksadk.runtime.factory import build_default_runtime_registry
|
|
14
|
+
from ksadk.server.composition import configure_runtime_app
|
|
15
|
+
from ksadk.server.factory import RuntimeAppConfig, create_runtime_app
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _managed_a2a_card() -> Any:
|
|
19
|
+
"""Build the managed discovery-only card when the runtime opts in.
|
|
20
|
+
|
|
21
|
+
Import is deferred so the A2A package is only loaded when
|
|
22
|
+
``KSADK_A2A_RUNTIME_ID`` is configured.
|
|
23
|
+
"""
|
|
24
|
+
if not os.getenv("KSADK_A2A_RUNTIME_ID", "").strip():
|
|
25
|
+
return None
|
|
26
|
+
from ksadk.managed_a2a_card import build_managed_a2a_card_if_configured
|
|
27
|
+
|
|
28
|
+
return build_managed_a2a_card_if_configured()
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def create_runtime_web_app(detection: Any, agent_path: Path) -> FastAPI:
|
|
32
|
+
"""Compose one detected project around the canonical RuntimeExecutor."""
|
|
33
|
+
|
|
34
|
+
context = RuntimeLaunchContext(
|
|
35
|
+
runtime_type=str(detection.type.value),
|
|
36
|
+
project_dir=agent_path,
|
|
37
|
+
detection=detection,
|
|
38
|
+
config=dict(getattr(detection, "raw_config", None) or {}),
|
|
39
|
+
)
|
|
40
|
+
return create_runtime_app(
|
|
41
|
+
RuntimeAppConfig(
|
|
42
|
+
runtime_executor=RuntimeExecutor(build_default_runtime_registry()),
|
|
43
|
+
launch_context=context,
|
|
44
|
+
agui=agui_config_for_detection(detection),
|
|
45
|
+
a2a=_managed_a2a_card(),
|
|
46
|
+
),
|
|
47
|
+
configure_runtime_app,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
__all__ = ["create_runtime_web_app"]
|
ksadk/cli/storage.py
CHANGED
ksadk/cli/ui.py
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from contextlib import contextmanager, redirect_stderr, redirect_stdout
|
|
6
|
-
from dataclasses import dataclass
|
|
7
5
|
import io
|
|
8
6
|
import json
|
|
9
7
|
import os
|
|
10
8
|
import sys
|
|
9
|
+
from contextlib import contextmanager, redirect_stderr, redirect_stdout
|
|
10
|
+
from dataclasses import dataclass
|
|
11
11
|
from typing import Iterator
|
|
12
12
|
|
|
13
13
|
import click
|
|
@@ -27,9 +27,12 @@ STATUS_RICH_STYLE = {
|
|
|
27
27
|
"RUNNING": "bold #2da44e",
|
|
28
28
|
"READY": "bold #2da44e",
|
|
29
29
|
"HEALTHY": "bold #2da44e",
|
|
30
|
+
"PASSED": "bold #2da44e",
|
|
30
31
|
"CREATING": "bold #d29922",
|
|
31
32
|
"SUBMITTED": "bold #d29922",
|
|
32
33
|
"PENDING": "bold #d29922",
|
|
34
|
+
"CANCELLED": "bold #d29922",
|
|
35
|
+
"UNAVAILABLE": "bold #d29922",
|
|
33
36
|
"UPDATING": "bold #d29922",
|
|
34
37
|
"SCALING": "bold #d29922",
|
|
35
38
|
"FAILED": "bold #f85149",
|
|
@@ -42,9 +45,12 @@ STATUS_CLICK_COLOR = {
|
|
|
42
45
|
"RUNNING": "green",
|
|
43
46
|
"READY": "green",
|
|
44
47
|
"HEALTHY": "green",
|
|
48
|
+
"PASSED": "green",
|
|
45
49
|
"CREATING": "yellow",
|
|
46
50
|
"SUBMITTED": "yellow",
|
|
47
51
|
"PENDING": "yellow",
|
|
52
|
+
"CANCELLED": "yellow",
|
|
53
|
+
"UNAVAILABLE": "yellow",
|
|
48
54
|
"UPDATING": "yellow",
|
|
49
55
|
"SCALING": "yellow",
|
|
50
56
|
"FAILED": "red",
|
|
@@ -303,7 +309,9 @@ def no_color_option(*, hidden: bool = False, expose_value: bool = False):
|
|
|
303
309
|
)
|
|
304
310
|
|
|
305
311
|
|
|
306
|
-
def build_no_color_click_option(
|
|
312
|
+
def build_no_color_click_option(
|
|
313
|
+
*, hidden: bool = False, expose_value: bool = False
|
|
314
|
+
) -> click.Option:
|
|
307
315
|
"""Build a shared no-color option for command injection."""
|
|
308
316
|
return click.Option(
|
|
309
317
|
["--no-color", "no_color"],
|
ksadk/cli/workflow_common.py
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from dataclasses import dataclass, replace
|
|
6
5
|
import json
|
|
6
|
+
from dataclasses import dataclass, replace
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from typing import Any, Sequence
|
|
9
9
|
|
|
@@ -16,9 +16,9 @@ from ksadk.cli.ui import (
|
|
|
16
16
|
print_info,
|
|
17
17
|
print_kv,
|
|
18
18
|
print_next_steps,
|
|
19
|
+
print_rule,
|
|
19
20
|
print_title,
|
|
20
21
|
print_warn,
|
|
21
|
-
print_rule,
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
|
|
@@ -55,9 +55,19 @@ def build_workflow_local_plan(
|
|
|
55
55
|
normalized_artifact_type = (artifact_type or "").strip().lower()
|
|
56
56
|
normalized_reference = str(artifact_reference or artifact_plan.reference or "")
|
|
57
57
|
source = artifact_plan.source or ("built" if artifact_plan.should_build else "external")
|
|
58
|
-
will_build =
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
will_build = (
|
|
59
|
+
artifact_plan.will_build
|
|
60
|
+
if artifact_plan.will_build is not None
|
|
61
|
+
else artifact_plan.should_build
|
|
62
|
+
)
|
|
63
|
+
should_publish = (
|
|
64
|
+
artifact_plan.should_publish
|
|
65
|
+
if artifact_plan.should_publish is not None
|
|
66
|
+
else artifact_plan.should_build
|
|
67
|
+
)
|
|
68
|
+
will_publish = (
|
|
69
|
+
artifact_plan.will_publish if artifact_plan.will_publish is not None else will_build
|
|
70
|
+
)
|
|
61
71
|
build_reason = _plan_step_reason(
|
|
62
72
|
source=source,
|
|
63
73
|
explicit_ref_option=artifact_plan.explicit_ref_option,
|
|
@@ -114,13 +124,20 @@ def build_workflow_local_plan(
|
|
|
114
124
|
}
|
|
115
125
|
|
|
116
126
|
|
|
117
|
-
def should_build_artifact(
|
|
127
|
+
def should_build_artifact(
|
|
128
|
+
*, target: str, artifact_type: str | None, ks3_path: str | None, image: str | None
|
|
129
|
+
) -> bool:
|
|
118
130
|
"""Whether deploy/launch should build artifacts locally."""
|
|
119
131
|
if target != "serverless":
|
|
120
132
|
return False
|
|
121
133
|
mode = (artifact_type or "Code").strip().lower()
|
|
122
134
|
if mode == "code":
|
|
123
135
|
return not bool(ks3_path)
|
|
136
|
+
# ManagedRuntime is a declarative server-side manifest. Deployment does
|
|
137
|
+
# not upload an artifact, but it must build the canonical manifest locally
|
|
138
|
+
# to include its SHA-256 in the control-plane request.
|
|
139
|
+
if mode == "managedruntime":
|
|
140
|
+
return True
|
|
124
141
|
if mode == "container":
|
|
125
142
|
return not bool(image)
|
|
126
143
|
return False
|
|
@@ -136,6 +153,7 @@ def plan_artifact_build(
|
|
|
136
153
|
repackage: bool = False,
|
|
137
154
|
) -> ArtifactBuildPlan:
|
|
138
155
|
"""Plan artifact build behavior and metadata cleanup under cache options."""
|
|
156
|
+
mode = (artifact_type or "Code").strip().lower()
|
|
139
157
|
should_build = should_build_artifact(
|
|
140
158
|
target=target,
|
|
141
159
|
artifact_type=artifact_type,
|
|
@@ -144,7 +162,6 @@ def plan_artifact_build(
|
|
|
144
162
|
)
|
|
145
163
|
explicit_ref_option = None
|
|
146
164
|
if target == "serverless" and not should_build:
|
|
147
|
-
mode = (artifact_type or "Code").strip().lower()
|
|
148
165
|
if mode == "code" and ks3_path:
|
|
149
166
|
explicit_ref_option = "--ks3-path"
|
|
150
167
|
elif mode == "container" and image:
|
|
@@ -154,8 +171,8 @@ def plan_artifact_build(
|
|
|
154
171
|
should_clear_metadata=bool((no_cache or repackage) and should_build),
|
|
155
172
|
explicit_ref_option=explicit_ref_option,
|
|
156
173
|
will_build=should_build,
|
|
157
|
-
should_publish=bool(target == "serverless" and should_build),
|
|
158
|
-
will_publish=bool(target == "serverless" and should_build),
|
|
174
|
+
should_publish=bool(target == "serverless" and should_build and mode != "managedruntime"),
|
|
175
|
+
will_publish=bool(target == "serverless" and should_build and mode != "managedruntime"),
|
|
159
176
|
source="external" if explicit_ref_option else ("built" if should_build else None),
|
|
160
177
|
)
|
|
161
178
|
|
|
@@ -176,7 +193,9 @@ def _predict_artifact_reference(
|
|
|
176
193
|
|
|
177
194
|
normalized_artifact_type = (artifact_type or "Code").strip().lower()
|
|
178
195
|
normalized_deploy_name = (deploy_name or "agent").strip() or "agent"
|
|
179
|
-
normalized_region =
|
|
196
|
+
normalized_region = (
|
|
197
|
+
"cn-beijing-6" if str(region or "").strip() == "pre-online" else str(region or "").strip()
|
|
198
|
+
)
|
|
180
199
|
|
|
181
200
|
if normalized_artifact_type == "code":
|
|
182
201
|
bucket = (ks3_bucket or "").strip()
|
|
@@ -184,7 +203,11 @@ def _predict_artifact_reference(
|
|
|
184
203
|
bucket = f"agentengine-{account_id}-{normalized_region}"
|
|
185
204
|
if not bucket:
|
|
186
205
|
bucket = "<ks3-bucket>"
|
|
187
|
-
|
|
206
|
+
artifact_label = "runtime" if normalized_artifact_type == "managedruntime" else "code"
|
|
207
|
+
return f"ks3://{bucket}/agents/{normalized_deploy_name}/{artifact_label}_<dry-run>.zip"
|
|
208
|
+
|
|
209
|
+
if normalized_artifact_type == "managedruntime":
|
|
210
|
+
return "inline:managed-runtime"
|
|
188
211
|
|
|
189
212
|
if normalized_artifact_type == "container":
|
|
190
213
|
normalized_registry = (registry or "").strip().rstrip("/")
|
|
@@ -212,6 +235,7 @@ def resolve_artifact_build_plan(
|
|
|
212
235
|
"""Resolve workflow artifact behavior after package metadata is available."""
|
|
213
236
|
normalized_explicit = str(explicit_reference or "").strip()
|
|
214
237
|
normalized_cached = str(cached_reference or "").strip()
|
|
238
|
+
is_managed_runtime = (artifact_type or "").strip().lower() == "managedruntime"
|
|
215
239
|
|
|
216
240
|
if normalized_explicit:
|
|
217
241
|
return replace(
|
|
@@ -237,11 +261,11 @@ def resolve_artifact_build_plan(
|
|
|
237
261
|
reference_is_predicted=False,
|
|
238
262
|
)
|
|
239
263
|
|
|
240
|
-
if plan.should_build and dry_run:
|
|
264
|
+
if plan.should_build and dry_run and not is_managed_runtime:
|
|
241
265
|
return replace(
|
|
242
266
|
plan,
|
|
243
267
|
will_build=False,
|
|
244
|
-
should_publish=bool(target == "serverless"),
|
|
268
|
+
should_publish=bool(target == "serverless" and not is_managed_runtime),
|
|
245
269
|
will_publish=False,
|
|
246
270
|
source="planned_build",
|
|
247
271
|
reference=_predict_artifact_reference(
|
|
@@ -260,8 +284,8 @@ def resolve_artifact_build_plan(
|
|
|
260
284
|
return replace(
|
|
261
285
|
plan,
|
|
262
286
|
will_build=True,
|
|
263
|
-
should_publish=bool(target == "serverless"),
|
|
264
|
-
will_publish=bool(target == "serverless"),
|
|
287
|
+
should_publish=bool(target == "serverless" and not is_managed_runtime),
|
|
288
|
+
will_publish=bool(target == "serverless" and not is_managed_runtime),
|
|
265
289
|
source="built",
|
|
266
290
|
reference=plan.reference,
|
|
267
291
|
reference_is_predicted=False,
|
|
@@ -339,7 +363,11 @@ def _request_header_summary(headers: Any) -> str:
|
|
|
339
363
|
def _summarize_plan_steps(steps: Sequence[dict[str, Any]]) -> tuple[str, str, str]:
|
|
340
364
|
executed = [str(step.get("name") or "-") for step in steps if step.get("will_run")]
|
|
341
365
|
planned = [str(step.get("name") or "-") for step in steps if step.get("planned")]
|
|
342
|
-
skipped = [
|
|
366
|
+
skipped = [
|
|
367
|
+
str(step.get("name") or "-")
|
|
368
|
+
for step in steps
|
|
369
|
+
if not step.get("will_run") and not step.get("planned")
|
|
370
|
+
]
|
|
343
371
|
return (
|
|
344
372
|
", ".join(executed) or "-",
|
|
345
373
|
", ".join(planned) or "-",
|
|
@@ -516,8 +544,14 @@ def render_workflow_dry_run(
|
|
|
516
544
|
|
|
517
545
|
print_rule("本地计划")
|
|
518
546
|
print_kv("制品类型", str(plan.get("artifact_type") or "-"))
|
|
519
|
-
print_kv(
|
|
520
|
-
|
|
547
|
+
print_kv(
|
|
548
|
+
"需要本地构建",
|
|
549
|
+
"是" if artifact.get("should_local_build", artifact.get("should_build")) else "否",
|
|
550
|
+
)
|
|
551
|
+
print_kv(
|
|
552
|
+
"会执行本地构建",
|
|
553
|
+
"是" if artifact.get("will_local_build", artifact.get("will_build")) else "否",
|
|
554
|
+
)
|
|
521
555
|
print_kv("需要发布制品", "是" if artifact.get("should_publish") else "否")
|
|
522
556
|
print_kv("会执行制品发布", "是" if artifact.get("will_publish") else "否")
|
|
523
557
|
if artifact.get("source"):
|
ksadk/codex/__init__.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""CodexRuntimeAdapter — 非 ADK 体系 runtime (goal-09)。"""
|
|
2
|
+
|
|
3
|
+
from ksadk.codex.client import AsyncCodexClient, CodexClient
|
|
4
|
+
from ksadk.codex.phase import CodexPhaseTracker
|
|
5
|
+
from ksadk.codex.runtime import CodexRuntimeAdapter
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"AsyncCodexClient",
|
|
9
|
+
"CodexClient",
|
|
10
|
+
"CodexPhaseTracker",
|
|
11
|
+
"CodexRuntimeAdapter",
|
|
12
|
+
]
|