agentengine-sdk-python 0.8.1__py3-none-any.whl → 0.8.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agentengine_sdk_python-0.8.1.dist-info → agentengine_sdk_python-0.8.3.dist-info}/METADATA +25 -12
- {agentengine_sdk_python-0.8.1.dist-info → agentengine_sdk_python-0.8.3.dist-info}/RECORD +421 -232
- ksadk/_build_provenance.json +1 -0
- ksadk/a2a/_space_client_events.py +381 -0
- ksadk/a2a/event_adapter.py +156 -64
- ksadk/a2a/executor.py +179 -63
- ksadk/a2a/space_client.py +6 -333
- ksadk/a2ui/core.py +222 -53
- ksadk/agui/_agent_helpers.py +247 -0
- ksadk/agui/a2ui_projection.py +12 -5
- ksadk/agui/agent.py +443 -259
- ksadk/api/client.py +528 -27
- ksadk/builders/code_builder.py +284 -8
- ksadk/builders/container_builder.py +8 -1
- ksadk/builders/managed_runtime_builder.py +42 -35
- ksadk/cli/__init__.py +23 -0
- ksadk/cli/cmd_dashboard.py +15 -1
- ksadk/cli/cmd_deploy.py +10 -2
- ksadk/cli/cmd_eval.py +66 -9
- ksadk/cli/cmd_evalset.py +284 -0
- ksadk/cli/cmd_files.py +5 -1
- ksadk/cli/cmd_hermes.py +1 -126
- ksadk/cli/cmd_invoke.py +28 -38
- ksadk/cli/cmd_managed_runtime.py +95 -0
- ksadk/cli/cmd_observe.py +85 -0
- ksadk/cli/cmd_openclaw.py +1 -435
- ksadk/cli/cmd_plugin.py +657 -0
- ksadk/cli/cmd_replay.py +28 -4
- ksadk/cli/cmd_studio.py +99 -8
- ksadk/cli/cmd_web.py +10 -2
- ksadk/cli/hermes_env.py +151 -0
- ksadk/cli/invoke_payload.py +49 -0
- ksadk/cli/openclaw_env.py +458 -0
- ksadk/codex/client.py +180 -30
- ksadk/codex/runtime.py +475 -331
- ksadk/configs/env_registry.py +94 -12
- ksadk/configs/env_registry_pcm.py +181 -0
- ksadk/configs/env_var_spec.py +18 -0
- ksadk/configs/global_config.py +5 -0
- ksadk/configs/settings.py +9 -0
- ksadk/context_engine/__init__.py +98 -0
- ksadk/context_engine/assembler.py +176 -0
- ksadk/context_engine/baseline.py +419 -0
- ksadk/context_engine/cache_observability.py +228 -0
- ksadk/context_engine/capabilities.py +443 -0
- ksadk/context_engine/contributors.py +409 -0
- ksadk/context_engine/hosted_pipeline.py +417 -0
- ksadk/context_engine/models.py +117 -0
- ksadk/context_engine/planner.py +698 -0
- ksadk/context_engine/policies.py +319 -0
- ksadk/context_engine/projection.py +31 -0
- ksadk/context_engine/shadow_plan.py +266 -0
- ksadk/context_engine/tokenizer.py +164 -0
- ksadk/conversations/__init__.py +19 -0
- ksadk/conversations/context.py +230 -30
- ksadk/conversations/contracts.py +266 -0
- ksadk/conversations/message_projection.py +308 -26
- ksadk/conversations/model_context.py +49 -3
- ksadk/conversations/projector.py +616 -0
- ksadk/conversations/reducer.py +98 -0
- ksadk/conversations/runtime_compaction.py +207 -5
- ksadk/conversations/runtime_input.py +184 -2
- ksadk/conversations/runtime_invocation.py +81 -3
- ksadk/conversations/runtime_observability.py +141 -0
- ksadk/conversations/runtime_payloads.py +42 -0
- ksadk/conversations/runtime_preparation.py +272 -2
- ksadk/conversations/runtime_resume.py +20 -1
- ksadk/conversations/runtime_stream_events.py +94 -9
- ksadk/conversations/semantic_summary.py +311 -1
- ksadk/conversations/session_lock.py +51 -0
- ksadk/deployment/env_forward.py +72 -0
- ksadk/deployment/managed_runtime.py +5 -0
- ksadk/deployment/providers/serverless.py +143 -69
- ksadk/evaluation/__init__.py +32 -0
- ksadk/evaluation/a2a_adapter.py +9 -1
- ksadk/evaluation/adapters.py +18 -5
- ksadk/evaluation/agent_eval_client.py +395 -0
- ksadk/evaluation/cloud_binding.py +80 -0
- ksadk/evaluation/cloud_converter.py +194 -0
- ksadk/evaluation/cloud_service.py +199 -0
- ksadk/evaluation/contracts.py +73 -4
- ksadk/evaluation/evaluators.py +183 -17
- ksadk/evaluation/evidence.py +258 -0
- ksadk/evaluation/executor.py +31 -6
- ksadk/evaluation/local_adapter.py +550 -0
- ksadk/evaluation/service_env.py +27 -0
- ksadk/evaluation/studio_build_adapter.py +253 -0
- ksadk/evaluation/target.py +15 -6
- ksadk/events/__init__.py +13 -13
- ksadk/events/_v1_compat/__init__.py +1 -0
- ksadk/events/_v1_compat/models.py +299 -0
- ksadk/events/_v1_compat/parser.py +247 -0
- ksadk/events/_v1_compat/projection.py +755 -0
- ksadk/events/adapters/__init__.py +34 -0
- ksadk/events/adapters/_a2a_snapshot.py +622 -0
- ksadk/events/adapters/_a2a_support.py +275 -0
- ksadk/events/adapters/_codex_interactions.py +375 -0
- ksadk/events/adapters/_codex_items.py +801 -0
- ksadk/events/adapters/_codex_validators.py +311 -0
- ksadk/events/adapters/_langgraph_support.py +785 -0
- ksadk/events/adapters/a2a.py +841 -0
- ksadk/events/adapters/adk.py +503 -0
- ksadk/events/adapters/codex.py +907 -0
- ksadk/events/adapters/langgraph.py +745 -0
- ksadk/events/canonical.py +440 -0
- ksadk/events/canonical_replay.py +497 -0
- ksadk/events/canonical_store.py +468 -0
- ksadk/events/cold_recovery.py +257 -0
- ksadk/events/content.py +89 -0
- ksadk/events/identity.py +86 -0
- ksadk/events/pipeline.py +455 -0
- ksadk/events/projections.py +66 -0
- ksadk/events/reducer.py +661 -0
- ksadk/events/replay.py +3 -36
- ksadk/events/runtime_event.py +20 -265
- ksadk/events/session_event.py +324 -0
- ksadk/events/store.py +3 -316
- ksadk/events/v1_compat.py +41 -0
- ksadk/harness/__init__.py +45 -35
- ksadk/harness/runtime.py +220 -58
- ksadk/identity/resolver.py +4 -3
- ksadk/interaction/__init__.py +28 -0
- ksadk/interaction/contracts.py +136 -0
- ksadk/interaction/ledger.py +189 -0
- ksadk/interaction/provider.py +122 -0
- ksadk/interaction/providers/__init__.py +52 -0
- ksadk/interaction/providers/adk.py +40 -0
- ksadk/interaction/providers/codex.py +94 -0
- ksadk/interaction/providers/langgraph.py +58 -0
- ksadk/kernel/__init__.py +117 -0
- ksadk/kernel/authorization.py +258 -0
- ksadk/kernel/bootstrap.py +1074 -0
- ksadk/kernel/contract_fingerprints.py +62 -0
- ksadk/kernel/contracts.py +370 -0
- ksadk/kernel/control.py +220 -0
- ksadk/kernel/errors.py +79 -0
- ksadk/kernel/ingress.py +1123 -0
- ksadk/kernel/mapping.py +111 -0
- ksadk/kernel/memory_store.py +1134 -0
- ksadk/kernel/postgres_store.py +1757 -0
- ksadk/kernel/recovery.py +452 -0
- ksadk/kernel/runtime_identity.py +103 -0
- ksadk/kernel/sql/001_agent_kernel.sql +120 -0
- ksadk/kernel/sqlite_store.py +1411 -0
- ksadk/kernel/state.py +145 -0
- ksadk/kernel/store.py +232 -0
- ksadk/kernel/worker.py +964 -0
- ksadk/knowledge_base/client.py +7 -0
- ksadk/knowledge_base/service.py +32 -5
- ksadk/memory/__init__.py +61 -0
- ksadk/memory/adk/backends/base_ltm_backend.py +96 -1
- ksadk/memory/adk/backends/http_ltm_backend.py +14 -5
- ksadk/memory/adk/backends/inmemory_ltm_backend.py +136 -3
- ksadk/memory/adk/backends/sdk_ltm_backend.py +384 -2
- ksadk/memory/adk/backends/sqlite_ltm_backend.py +95 -0
- ksadk/memory/coordinator.py +461 -0
- ksadk/memory/events.py +202 -0
- ksadk/memory/extraction.py +228 -0
- ksadk/memory/ltm_backend_factory.py +16 -3
- ksadk/memory/models.py +316 -0
- ksadk/memory/policy.py +215 -0
- ksadk/memory/provider.py +47 -0
- ksadk/memory/provider_adapter.py +159 -0
- ksadk/memory/provider_resolver.py +71 -0
- ksadk/memory/providers/__init__.py +5 -0
- ksadk/memory/providers/local_sqlite.py +497 -0
- ksadk/memory/resolved_policy.py +145 -0
- ksadk/memory/service.py +188 -6
- ksadk/model_proxy/bootstrap.py +16 -9
- ksadk/model_proxy/detect.py +202 -9
- ksadk/model_proxy/namespace.py +39 -15
- ksadk/model_proxy/server.py +24 -5
- ksadk/model_proxy/transform.py +60 -2
- ksadk/observability/__init__.py +25 -0
- ksadk/observability/session_log.py +420 -0
- ksadk/observability/trajectory.py +105 -0
- ksadk/plugins/__init__.py +167 -0
- ksadk/plugins/bridges/__init__.py +45 -0
- ksadk/plugins/bridges/codex.py +552 -0
- ksadk/plugins/bridges/dsh.py +1116 -0
- ksadk/plugins/builtins.py +747 -0
- ksadk/plugins/bundle.py +246 -0
- ksadk/plugins/bundle_security.py +167 -0
- ksadk/plugins/composition.py +529 -0
- ksadk/plugins/context_contributor.py +437 -0
- ksadk/plugins/contracts.py +451 -0
- ksadk/plugins/dsh_toolchain.py +935 -0
- ksadk/plugins/ecosystem_bridge.py +1105 -0
- ksadk/plugins/ecosystem_probe.py +191 -0
- ksadk/plugins/host.py +724 -0
- ksadk/plugins/providers/__init__.py +85 -0
- ksadk/plugins/providers/bundles/ksadk-codex/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/ksadk-codex/index.mjs +18 -0
- ksadk/plugins/providers/bundles/ksadk-codex/package.json +19 -0
- ksadk/plugins/providers/bundles/ksadk-harness/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/ksadk-harness/index.mjs +19 -0
- ksadk/plugins/providers/bundles/ksadk-harness/package.json +19 -0
- ksadk/plugins/providers/codex.py +722 -0
- ksadk/plugins/providers/codex_dsh.py +83 -0
- ksadk/plugins/providers/dsh.py +951 -0
- ksadk/plugins/providers/dsh_descriptor_host.py +226 -0
- ksadk/plugins/providers/harness.py +627 -0
- ksadk/plugins/providers/harness_dsh.py +91 -0
- ksadk/plugins/providers/legacy.py +215 -0
- ksadk/plugins/providers/legacy_catalog.py +100 -0
- ksadk/plugins/providers/shipped_dsh.py +370 -0
- ksadk/plugins/resolver.py +331 -0
- ksadk/plugins/subagent_providers/__init__.py +12 -0
- ksadk/plugins/subagent_providers/codex.py +443 -0
- ksadk/plugins/subagents.py +333 -0
- ksadk/prompts/__init__.py +71 -0
- ksadk/prompts/compiler.py +215 -0
- ksadk/prompts/models.py +82 -0
- ksadk/prompts/projection.py +89 -0
- ksadk/prompts/resolved.py +137 -0
- ksadk/prompts/sources.py +233 -0
- ksadk/runners/_langgraph_runner_streams.py +822 -0
- ksadk/runners/adk_runner.py +5 -5
- ksadk/runners/base_runner.py +16 -0
- ksadk/runners/factory.py +1 -2
- ksadk/runners/langgraph_runner.py +198 -437
- ksadk/runtime/_runner_adapter/__init__.py +1 -0
- ksadk/runtime/_runner_adapter/stream_mapping.py +797 -0
- ksadk/runtime/adapter.py +119 -2
- ksadk/runtime/conversation_execution.py +316 -182
- ksadk/runtime/executor.py +144 -3
- ksadk/runtime/factory.py +268 -8
- ksadk/runtime/framework_adapters.py +18 -0
- ksadk/runtime/hosted_finalizer.py +268 -0
- ksadk/runtime/launch.py +14 -1
- ksadk/runtime/preprocessing.py +25 -3
- ksadk/runtime/runner_adapter.py +293 -508
- ksadk/runtime/usage.py +33 -0
- ksadk/sandbox/__init__.py +2 -1
- ksadk/sandbox/backends/e2b.py +35 -2
- ksadk/sandbox/factory.py +72 -0
- ksadk/scheduler/__init__.py +18 -0
- ksadk/scheduler/calendar.py +102 -0
- ksadk/scheduler/contracts.py +254 -0
- ksadk/scheduler/dispatcher.py +129 -0
- ksadk/scheduler/engine.py +416 -0
- ksadk/scheduler/sqlite_store.py +563 -0
- ksadk/server/composition.py +8 -0
- ksadk/server/factory.py +69 -6
- ksadk/server/routes/kernel_ingress.py +258 -0
- ksadk/server/routes/openai_compat.py +88 -8
- ksadk/server/routes/projection.py +35 -20
- ksadk/server/routes/run.py +94 -0
- ksadk/server/routes/sessions.py +2 -0
- ksadk/server/routes/streaming.py +5 -2
- ksadk/server/static/assets/{ArtifactsPanel-CakCqxEN.js → ArtifactsPanel-10GPXIJ6.js} +1 -1
- ksadk/server/static/assets/{CodeBlock-CynLknyO.js → CodeBlock-BXk1l-G1.js} +4 -4
- ksadk/server/static/assets/MathMessageMarkdown-BorAY7qD.css +1 -0
- ksadk/server/static/assets/{MathMessageMarkdown-3sQdOysS.js → MathMessageMarkdown-D9uB55Oh.js} +4 -4
- ksadk/server/static/assets/MermaidBlock--OEYoXIJ.js +312 -0
- ksadk/server/static/assets/NativeTerminalPanel-DrEe1syq.js +1 -0
- ksadk/server/static/assets/abnfDiagram-VCTEODGH-eeTFJLvo.js +1 -0
- ksadk/server/static/assets/arc-S3ZNbIAd.js +1 -0
- ksadk/server/static/assets/architecture-7GRP2DOG-Dk9nRQ6-.js +1 -0
- ksadk/server/static/assets/architectureDiagram-5GKGNRK7-CRjgEJDX.js +36 -0
- ksadk/server/static/assets/blockDiagram-NRAW4CY4-C7bsBoNH.js +129 -0
- ksadk/server/static/assets/c4Diagram-UCG6FXSJ-BX3c33Ob.js +38 -0
- ksadk/server/static/assets/channel-s354Yo6o.js +1 -0
- ksadk/server/static/assets/chunk-2Q5K7J3B-CDpPpKR5.js +1 -0
- ksadk/server/static/assets/{chunk-FMBD7UC4-B_fH2YuH.js → chunk-5VM5RSS4-bZ7ws-8m.js} +1 -1
- ksadk/server/static/assets/{chunk-ND2GUHAM-D6rFLaVV.js → chunk-F27PBJKO-D2r0pvhY.js} +1 -1
- ksadk/server/static/assets/chunk-G27WJ6UU-CZwF3oUP.js +231 -0
- ksadk/server/static/assets/{chunk-4BX2VUAB-B9drTgOW.js → chunk-JWPE2WC7-DigFYCML.js} +1 -1
- ksadk/server/static/assets/chunk-LCL6LL3I-CnorGV5q.js +206 -0
- ksadk/server/static/assets/chunk-POPQ4Y6H-CexntQA-.js +1 -0
- ksadk/server/static/assets/chunk-RHFEMEQ7-CHTC7UxA.js +168 -0
- ksadk/server/static/assets/chunk-SVP7TREG-BC1EWt_-.js +88 -0
- ksadk/server/static/assets/chunk-XXDRQBXY-BTG24xN0.js +1 -0
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-Dd0nucl9.js +1 -0
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-Dd0nucl9.js +1 -0
- ksadk/server/static/assets/{cose-bilkent-S5V4N54A-ChNs_Mdk.js → cose-bilkent-JH36ORCC-CkonRdAS.js} +1 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-BBlT4uMf.js +1 -0
- ksadk/server/static/assets/cynefinDiagram-5FMLGOSQ-DEOCBe15.js +62 -0
- ksadk/server/static/assets/cytoscape.esm-CyCl8rPi.js +321 -0
- ksadk/server/static/assets/dagre-3AP2YEHR-DBThPuLa.js +4 -0
- ksadk/server/static/assets/dagre-ClTPrTht.js +1 -0
- ksadk/server/static/assets/diagram-S7CK7UJ4-DsZHrnpJ.js +30 -0
- ksadk/server/static/assets/diagram-UQ7AKVKN-BJR4nhVr.js +41 -0
- ksadk/server/static/assets/diagram-VSXAHHWV-xzcERX0a.js +3 -0
- ksadk/server/static/assets/diagram-VX7I27RA-tn2xM1xu.js +24 -0
- ksadk/server/static/assets/diagram-Z3DM3KII-BZPGBkw5.js +24 -0
- ksadk/server/static/assets/{dist-gLnrGsoU.js → dist-4zN1_tq5.js} +1 -1
- ksadk/server/static/assets/{dist-C1sz5Eo3.js → dist-8VWI-2bZ.js} +1 -1
- ksadk/server/static/assets/{dist-BjOdlDjj.js → dist-B-46q3Hk.js} +1 -1
- ksadk/server/static/assets/{dist-o2OVmKvt.js → dist-B0gdk4rl.js} +1 -1
- ksadk/server/static/assets/{dist-4N2NMVYg.js → dist-B1oWRmrH.js} +1 -1
- ksadk/server/static/assets/{dist-CmZHzlwZ.js → dist-BI1qQH4n.js} +1 -1
- ksadk/server/static/assets/{dist-X4TnqwOK.js → dist-BJLUwH6W.js} +1 -1
- ksadk/server/static/assets/{dist-B5oS1zcj.js → dist-Bbwqa8TG.js} +1 -1
- ksadk/server/static/assets/{dist-j6Dxmf_j.js → dist-Btyo4vX4.js} +1 -1
- ksadk/server/static/assets/{dist-DQU9EWw-.js → dist-C71CsujO.js} +1 -1
- ksadk/server/static/assets/{dist-BIlKoW0k.js → dist-CXpH_Rdd.js} +1 -1
- ksadk/server/static/assets/{dist-DJN_6Y39.js → dist-Cq4OL6nO.js} +1 -1
- ksadk/server/static/assets/{dist-Dli7qW-B.js → dist-D1V3f1B4.js} +1 -1
- ksadk/server/static/assets/{dist-fhOuWds5.js → dist-DJmCPRVB.js} +1 -1
- ksadk/server/static/assets/{dist-CWV4lDr1.js → dist-DQAB0qn_.js} +2 -2
- ksadk/server/static/assets/{dist-D6MpCZtz.js → dist-DUwKa_l6.js} +1 -1
- ksadk/server/static/assets/dist-DdRBIceA.js +1 -0
- ksadk/server/static/assets/{dist-DWKByxWV.js → dist-DfGFrb0v.js} +1 -1
- ksadk/server/static/assets/{dist-DsHPdk3W.js → dist-DjhwGUgZ.js} +1 -1
- ksadk/server/static/assets/{dist-B-jNR6Vn.js → dist-DyqV4fL4.js} +1 -1
- ksadk/server/static/assets/{dist-BB3-OwTQ.js → dist-M67Hwu0n.js} +1 -1
- ksadk/server/static/assets/{dist-_pHPTyZ-.js → dist-u8tVH5Ak.js} +1 -1
- ksadk/server/static/assets/ebnfDiagram-PWID7BFC-DVfMsLge.js +1 -0
- ksadk/server/static/assets/erDiagram-SSCWMZ5O-CWEZSYaw.js +99 -0
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-Dr5okd8V.js +1 -0
- ksadk/server/static/assets/flowDiagram-A5DVABFB-VEO-cVcO.js +1 -0
- ksadk/server/static/assets/ganttDiagram-EL5Y4UJY-TWIxoyYL.js +292 -0
- ksadk/server/static/assets/gitGraph-4MIJSDKK-CKiKY9Cf.js +1 -0
- ksadk/server/static/assets/gitGraphDiagram-WWUBYQGX-DDh2hd2S.js +106 -0
- ksadk/server/static/assets/index-B2k_urY8.js +241 -0
- ksadk/server/static/assets/index-ILPt6IWF.css +2 -0
- ksadk/server/static/assets/info-A6RAGUB7-ubA4Nm_p.js +1 -0
- ksadk/server/static/assets/infoDiagram-RXCK75RN-CgoyWiDR.js +2 -0
- ksadk/server/static/assets/{ishikawaDiagram-YF4QCWOH-K0OOfVna.js → ishikawaDiagram-5VMMS53U-CyRIu_om.js} +6 -6
- ksadk/server/static/assets/{journeyDiagram-JHISSGLW-8LeOJaZp.js → journeyDiagram-EYS64GPL-DN5JXHzN.js} +6 -6
- ksadk/server/static/assets/{kanban-definition-UN3LZRKU-C6uCgZrW.js → kanban-definition-3QL26DDD-CNP3ui66.js} +10 -10
- ksadk/server/static/assets/katex-DWEzQy1d.js +257 -0
- ksadk/server/static/assets/{linear-hdBcYzM8.js → linear-C-qHp7d2.js} +1 -1
- ksadk/server/static/assets/mermaid-parser.core-Cl-K943T.js +166 -0
- ksadk/server/static/assets/{mindmap-definition-RKZ34NQL-Bjy_2v4_.js → mindmap-definition-FBJOCRG2-D5DB5mYm.js} +29 -29
- ksadk/server/static/assets/packet-AYTQ26CC-C7R3NUlK.js +1 -0
- ksadk/server/static/assets/pegDiagram-XKGWAZYB-BQVc9ia_.js +1 -0
- ksadk/server/static/assets/pie-WAS4IAKB-BIT6qjr3.js +1 -0
- ksadk/server/static/assets/pieDiagram-E7YTZNPT-B6UCAvtY.js +39 -0
- ksadk/server/static/assets/{quadrantDiagram-W4KKPZXB-BmkRbwCg.js → quadrantDiagram-AXDQQJYC-mIr2d3eb.js} +6 -6
- ksadk/server/static/assets/radar-RG4KPBEZ-l5noef9X.js +1 -0
- ksadk/server/static/assets/railroad-74A4TZTK-Baea6ZvM.js +1 -0
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-OKn8zZnU.js +1 -0
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-DdKAKC4l.js +1 -0
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-Bds8udlG.js +1 -0
- ksadk/server/static/assets/railroadDiagram-O6MQD6OU-Dt3FFDmK.js +1 -0
- ksadk/server/static/assets/requirementDiagram-EFPCY7ZU-Cz_vQtgF.js +84 -0
- ksadk/server/static/assets/{sankeyDiagram-5OEKKPKP-l6iXmU65.js → sankeyDiagram-P5KCCOFB-wlO1TsH5.js} +7 -7
- ksadk/server/static/assets/{sequenceDiagram-3UESZ5HK-Cq6UBeQB.js → sequenceDiagram-WJ2MYXX4-CHRbElYq.js} +10 -10
- ksadk/server/static/assets/sizeCapture-X5ZJPWSS-DXX54iyO.js +1 -0
- ksadk/server/static/assets/stateDiagram-HBIQ2CUA-Dp_lw9II.js +1 -0
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-5b-8o2iS.js +1 -0
- ksadk/server/static/assets/swimlanes-XN3QIQJK-D8O5UlLG.js +1 -0
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-uf6WPRA4.js +8 -0
- ksadk/server/static/assets/{timeline-definition-PNZ67QCA-DEz24vV0.js → timeline-definition-24CTP7MA-8mfKcxvG.js} +7 -7
- ksadk/server/static/assets/treeView-Q6P3EWNA-CK5CSrSO.js +1 -0
- ksadk/server/static/assets/treemap-WGGIJYW6-Ch2BKgAM.js +1 -0
- ksadk/server/static/assets/vennDiagram-4TSXK5OY-EnNl0DE7.js +34 -0
- ksadk/server/static/assets/wardley-WFR3VGLG-YW3Q0ml_.js +1 -0
- ksadk/server/static/assets/wardleyDiagram-VM6X3IG4-DBu5fbYr.js +78 -0
- ksadk/server/static/assets/xychartDiagram-S5SC5T6Z-BSVXs4IY.js +7 -0
- ksadk/server/static/index.html +2 -2
- ksadk/sessions/__init__.py +26 -9
- ksadk/sessions/_local_service_sync.py +688 -0
- ksadk/sessions/_local_tables.py +21 -0
- ksadk/sessions/_postgres_schema.py +305 -0
- ksadk/sessions/_postgres_tables.py +15 -0
- ksadk/sessions/base.py +80 -1
- ksadk/sessions/in_memory.py +53 -2
- ksadk/sessions/local_service.py +63 -604
- ksadk/sessions/postgres_service.py +58 -148
- ksadk/sessions/resilient.py +35 -1
- ksadk/skills/service_client.py +48 -0
- ksadk/studio/agent_lifecycle.py +26 -20
- ksadk/studio/api.py +1063 -69
- ksadk/studio/api_catalog_routes.py +5 -0
- ksadk/studio/api_contracts.py +148 -6
- ksadk/studio/api_memory_routes.py +82 -0
- ksadk/studio/api_plugin_routes.py +480 -0
- ksadk/studio/attachment_store.py +187 -0
- ksadk/studio/authoring.py +259 -28
- ksadk/studio/authoring_coordinator.py +809 -67
- ksadk/studio/builder.py +197 -40
- ksadk/studio/capabilities.py +17 -0
- ksadk/studio/cloud.py +1920 -95
- ksadk/studio/codex_agent_service.py +137 -15
- ksadk/studio/codex_authoring.py +469 -0
- ksadk/studio/codex_builder.py +177 -25
- ksadk/studio/codex_manifest.py +71 -22
- ksadk/studio/codex_run.py +59 -4
- ksadk/studio/compatibility_report.py +445 -0
- ksadk/studio/compiler.py +7 -1
- ksadk/studio/contracts.py +234 -4
- ksadk/studio/dsh_provider_registration.py +768 -0
- ksadk/studio/event_store.py +79 -101
- ksadk/studio/framework_run.py +264 -3
- ksadk/studio/hosted_kernel.py +317 -0
- ksadk/studio/manifest_resolver.py +131 -0
- ksadk/studio/model_client.py +95 -9
- ksadk/studio/model_profile_service.py +1 -1
- ksadk/studio/operations.py +47 -5
- ksadk/studio/otel_trace.py +348 -42
- ksadk/studio/pcm_memory.py +85 -0
- ksadk/studio/plugin_composition.py +301 -0
- ksadk/studio/plugin_kernel_adapter.py +128 -0
- ksadk/studio/plugin_runtime.py +652 -0
- ksadk/studio/repository.py +23 -2
- ksadk/studio/resource_catalog.py +49 -1
- ksadk/studio/run_service.py +1266 -202
- ksadk/studio/runtime_source.py +51 -17
- ksadk/studio/scheduler_runtime.py +374 -0
- ksadk/studio/scheduler_service.py +211 -0
- ksadk/studio/service.py +1815 -117
- ksadk/studio/shared_web.py +199 -50
- ksadk/studio/soul.py +52 -0
- ksadk/studio/static/assets/index-DXs1Eq4M.css +1 -0
- ksadk/studio/static/assets/index-DeDqwTsD.js +283 -0
- ksadk/studio/static/index.html +2 -2
- ksadk/studio/templates.py +100 -8
- ksadk/studio/validator.py +20 -1
- ksadk/studio/workspace.py +31 -32
- ksadk/tracing/setup.py +304 -3
- ksadk/version.py +1 -1
- ksadk_runtime_common/schemas/runtime_event_v1.json +37 -0
- ksadk_runtime_common/schemas/runtime_event_v2.json +271 -0
- ksadk_runtime_common/workspace_files/path_utils.py +41 -0
- ksadk/events/parser.py +0 -191
- ksadk/server/static/assets/MathMessageMarkdown-DeYh8QPr.css +0 -1
- ksadk/server/static/assets/MermaidBlock-NERD_ef7.js +0 -303
- ksadk/server/static/assets/NativeTerminalPanel-CiHWf82q.js +0 -1
- ksadk/server/static/assets/arc-DrgjcKhl.js +0 -1
- ksadk/server/static/assets/architecture-7EHR7CIX-CpZLRCcY.js +0 -1
- ksadk/server/static/assets/architectureDiagram-3BPJPVTR-BXoVRbQ6.js +0 -36
- ksadk/server/static/assets/blockDiagram-GPEHLZMM-BnaB3Ywv.js +0 -132
- ksadk/server/static/assets/c4Diagram-AAUBKEIU-Dw4weZcp.js +0 -10
- ksadk/server/static/assets/channel-Dt3rQTFI.js +0 -1
- ksadk/server/static/assets/chunk-2J33WTMH-ChjpLK7j.js +0 -1
- ksadk/server/static/assets/chunk-55IACEB6-CK4ROATy.js +0 -1
- ksadk/server/static/assets/chunk-727SXJPM-B9KtTTgw.js +0 -206
- ksadk/server/static/assets/chunk-AQP2D5EJ-1O1mki3m.js +0 -231
- ksadk/server/static/assets/chunk-QZHKN3VN-iXEZtKQc.js +0 -1
- ksadk/server/static/assets/classDiagram-4FO5ZUOK-DIveV17Q.js +0 -1
- ksadk/server/static/assets/classDiagram-v2-Q7XG4LA2-DIveV17Q.js +0 -1
- ksadk/server/static/assets/cytoscape.esm-DelgaX4f.js +0 -321
- ksadk/server/static/assets/dagre-BM42HDAG-D0QXg_MQ.js +0 -4
- ksadk/server/static/assets/dagre-Bx709z4p.js +0 -1
- ksadk/server/static/assets/diagram-2AECGRRQ-DBDDKwBQ.js +0 -43
- ksadk/server/static/assets/diagram-5GNKFQAL-BkwDOxmO.js +0 -10
- ksadk/server/static/assets/diagram-KO2AKTUF-Bv8waYvY.js +0 -3
- ksadk/server/static/assets/diagram-LMA3HP47-e1VECDdu.js +0 -24
- ksadk/server/static/assets/diagram-OG6HWLK6-Ds9adfRl.js +0 -24
- ksadk/server/static/assets/dist-B5J2uhNk.js +0 -1
- ksadk/server/static/assets/erDiagram-TEJ5UH35-BPItFKH6.js +0 -85
- ksadk/server/static/assets/eventmodeling-FCH6USID-DYFSxbqr.js +0 -1
- ksadk/server/static/assets/flowDiagram-I6XJVG4X-BbYB9w5Y.js +0 -162
- ksadk/server/static/assets/ganttDiagram-6RSMTGT7-TQXa0KXv.js +0 -292
- ksadk/server/static/assets/gitGraph-WXDBUCRP-DyNYp6BN.js +0 -1
- ksadk/server/static/assets/gitGraphDiagram-PVQCEYII-bKblCnpa.js +0 -106
- ksadk/server/static/assets/graphlib-B8gBHxth.js +0 -1
- ksadk/server/static/assets/index-R52pJJvg.js +0 -177
- ksadk/server/static/assets/index-jJr3_955.css +0 -2
- ksadk/server/static/assets/info-J43DQDTF-WUx7qTde.js +0 -1
- ksadk/server/static/assets/infoDiagram-5YYISTIA-BGVT7J_i.js +0 -2
- ksadk/server/static/assets/katex-CYWseY5E.js +0 -265
- ksadk/server/static/assets/mermaid-parser.core-BWrDjSZM.js +0 -161
- ksadk/server/static/assets/packet-YPE3B663-BN13y_xl.js +0 -1
- ksadk/server/static/assets/pie-LRSECV5Y-ftSLXhhc.js +0 -1
- ksadk/server/static/assets/pieDiagram-4H26LBE5-GmmqNiVH.js +0 -30
- ksadk/server/static/assets/radar-GUYGQ44K-jaICkIeO.js +0 -1
- ksadk/server/static/assets/requirementDiagram-4Y6WPE33-DSWFqL7c.js +0 -84
- ksadk/server/static/assets/stateDiagram-AJRCARHV-qzTQpg3Y.js +0 -1
- ksadk/server/static/assets/stateDiagram-v2-BHNVJYJU-BYCoYGAN.js +0 -1
- ksadk/server/static/assets/treeView-BLDUP644-Cpib_vlz.js +0 -1
- ksadk/server/static/assets/treemap-LRROVOQU-DQxfmVHK.js +0 -1
- ksadk/server/static/assets/vennDiagram-CIIHVFJN-CMCixki2.js +0 -34
- ksadk/server/static/assets/wardley-L42UT6IY-BQYHnnkU.js +0 -1
- ksadk/server/static/assets/wardleyDiagram-YWT4CUSO-CVzB8F9K.js +0 -78
- ksadk/server/static/assets/xychartDiagram-2RQKCTM6-BFBqBLc1.js +0 -7
- ksadk/studio/evaluation.py +0 -192
- ksadk/studio/static/assets/index-CaEN0eTR.css +0 -1
- ksadk/studio/static/assets/index-DI2eY_NH.js +0 -252
- {agentengine_sdk_python-0.8.1.dist-info → agentengine_sdk_python-0.8.3.dist-info}/WHEEL +0 -0
- {agentengine_sdk_python-0.8.1.dist-info → agentengine_sdk_python-0.8.3.dist-info}/entry_points.txt +0 -0
- {agentengine_sdk_python-0.8.1.dist-info → agentengine_sdk_python-0.8.3.dist-info}/licenses/LICENSE +0 -0
- {agentengine_sdk_python-0.8.1.dist-info → agentengine_sdk_python-0.8.3.dist-info}/top_level.txt +0 -0
ksadk/configs/env_registry.py
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@dataclass(frozen=True)
|
|
7
|
-
class EnvVarSpec:
|
|
8
|
-
name: str
|
|
9
|
-
module: str
|
|
10
|
-
purpose: str
|
|
11
|
-
default: str = ""
|
|
12
|
-
sensitive: bool = False
|
|
13
|
-
|
|
3
|
+
from ksadk.configs.env_registry_pcm import PCM_ENV_VAR_REGISTRY_ITEMS
|
|
4
|
+
from ksadk.configs.env_var_spec import EnvVarSpec
|
|
14
5
|
|
|
15
6
|
_ENV_VAR_REGISTRY_ITEMS: tuple[EnvVarSpec, ...] = (
|
|
7
|
+
EnvVarSpec(
|
|
8
|
+
"KSADK_AGENT_EVAL",
|
|
9
|
+
"evaluation",
|
|
10
|
+
"Enable internal Agent evaluation integration.",
|
|
11
|
+
"0",
|
|
12
|
+
documented=False,
|
|
13
|
+
),
|
|
16
14
|
EnvVarSpec("KSADK_ADK_RESUMABLE", "runners", "Enable ADK invocation resume support.", "false"),
|
|
17
15
|
EnvVarSpec("KSADK_ADK_SESSION_BACKEND", "sessions", "ADK-native session backend selector."),
|
|
18
16
|
EnvVarSpec("KSADK_ADK_SESSION_PATH", "sessions", "ADK-native SQLite session database path."),
|
|
@@ -234,12 +232,42 @@ _ENV_VAR_REGISTRY_ITEMS: tuple[EnvVarSpec, ...] = (
|
|
|
234
232
|
"Isolate native Codex state under the project workspace; set to 0 for debugging only.",
|
|
235
233
|
"1",
|
|
236
234
|
),
|
|
235
|
+
EnvVarSpec(
|
|
236
|
+
"KSADK_DSH_BIN",
|
|
237
|
+
"plugins",
|
|
238
|
+
(
|
|
239
|
+
"Optional absolute path to the managed DSH command; must match the pinned "
|
|
240
|
+
"toolchain version."
|
|
241
|
+
),
|
|
242
|
+
),
|
|
243
|
+
EnvVarSpec(
|
|
244
|
+
"KSADK_DSH_HOME",
|
|
245
|
+
"plugins",
|
|
246
|
+
(
|
|
247
|
+
"Directory containing the isolated DSH Profile; defaults to .agentkit/dsh-home "
|
|
248
|
+
"in the workspace."
|
|
249
|
+
),
|
|
250
|
+
),
|
|
251
|
+
EnvVarSpec(
|
|
252
|
+
"KSADK_DSH_PROFILE",
|
|
253
|
+
"plugins",
|
|
254
|
+
"DSH Profile name used by Studio and the plugin bridge.",
|
|
255
|
+
"studio",
|
|
256
|
+
),
|
|
237
257
|
EnvVarSpec(
|
|
238
258
|
"KSADK_STUDIO_NO_SECURITY",
|
|
239
259
|
"studio",
|
|
240
260
|
"Disable Studio loopback session and CSRF checks for controlled tests only.",
|
|
241
261
|
"0",
|
|
242
262
|
),
|
|
263
|
+
EnvVarSpec(
|
|
264
|
+
"KSADK_STUDIO_AUTHORIZER",
|
|
265
|
+
"studio",
|
|
266
|
+
"Internal authoring backend selector; bounded chat is the default and the "
|
|
267
|
+
"filesystem-capable Codex authorizer requires an explicit opt-in.",
|
|
268
|
+
"chat",
|
|
269
|
+
documented=False,
|
|
270
|
+
),
|
|
243
271
|
EnvVarSpec(
|
|
244
272
|
"KSADK_STUDIO_SESSION_TOKEN",
|
|
245
273
|
"studio",
|
|
@@ -278,6 +306,19 @@ _ENV_VAR_REGISTRY_ITEMS: tuple[EnvVarSpec, ...] = (
|
|
|
278
306
|
"Enable L2 snip deterministic redundancy removal in compaction pipeline.",
|
|
279
307
|
"true",
|
|
280
308
|
),
|
|
309
|
+
*PCM_ENV_VAR_REGISTRY_ITEMS,
|
|
310
|
+
EnvVarSpec(
|
|
311
|
+
"KSADK_DEPLOYMENT_MODE",
|
|
312
|
+
"runtime",
|
|
313
|
+
"Deployment-mode ownership declaration.",
|
|
314
|
+
documented=False,
|
|
315
|
+
),
|
|
316
|
+
EnvVarSpec(
|
|
317
|
+
"KSADK_EVAL_COMMIT",
|
|
318
|
+
"evaluation",
|
|
319
|
+
"Source commit recorded by evaluation runs.",
|
|
320
|
+
documented=False,
|
|
321
|
+
),
|
|
281
322
|
EnvVarSpec(
|
|
282
323
|
"KSADK_CORE_RUNTIME_REQUIREMENTS",
|
|
283
324
|
"builders",
|
|
@@ -334,6 +375,15 @@ _ENV_VAR_REGISTRY_ITEMS: tuple[EnvVarSpec, ...] = (
|
|
|
334
375
|
"LangGraph PostgreSQL checkpoint DSN.",
|
|
335
376
|
sensitive=True,
|
|
336
377
|
),
|
|
378
|
+
EnvVarSpec(
|
|
379
|
+
"KSADK_LANGGRAPH_AUTO_CHECKPOINT",
|
|
380
|
+
"sessions",
|
|
381
|
+
(
|
|
382
|
+
"Allow a hosted LangGraph runner to rebuild a factory-exported graph with the "
|
|
383
|
+
"managed PostgreSQL saver."
|
|
384
|
+
),
|
|
385
|
+
"false",
|
|
386
|
+
),
|
|
337
387
|
EnvVarSpec(
|
|
338
388
|
"KSADK_LOCAL_SKILLS_DIR", "skills", "Local directory containing extracted Skill packages."
|
|
339
389
|
),
|
|
@@ -453,12 +503,30 @@ _ENV_VAR_REGISTRY_ITEMS: tuple[EnvVarSpec, ...] = (
|
|
|
453
503
|
"runners",
|
|
454
504
|
"Header name for remote Responses session propagation.",
|
|
455
505
|
),
|
|
506
|
+
EnvVarSpec(
|
|
507
|
+
"KSADK_RUNTIME_IMAGE_SOURCE_COMMIT",
|
|
508
|
+
"runtime",
|
|
509
|
+
"Build-injected source commit for Runtime image provenance.",
|
|
510
|
+
documented=False,
|
|
511
|
+
),
|
|
512
|
+
EnvVarSpec(
|
|
513
|
+
"KSADK_RUNTIME_IMAGE_WHEEL_SHA256",
|
|
514
|
+
"runtime",
|
|
515
|
+
"Build-injected wheel digest for Runtime image provenance.",
|
|
516
|
+
documented=False,
|
|
517
|
+
),
|
|
456
518
|
EnvVarSpec(
|
|
457
519
|
"KSADK_RUNTIME_PORT", "cli", "Runtime HTTP port exported to template runtimes.", "8080"
|
|
458
520
|
),
|
|
459
521
|
EnvVarSpec(
|
|
460
522
|
"KSADK_RUNTIME_REQUIREMENTS", "builders", "Internal bundled runtime requirements constant."
|
|
461
523
|
),
|
|
524
|
+
EnvVarSpec(
|
|
525
|
+
"KSADK_RUNTIME_STATE_DIR",
|
|
526
|
+
"runtime",
|
|
527
|
+
"Internal Runtime state directory override.",
|
|
528
|
+
documented=False,
|
|
529
|
+
),
|
|
462
530
|
EnvVarSpec(
|
|
463
531
|
"KSADK_ALLOW_POD_PROCESS_TOOLS",
|
|
464
532
|
"sandbox",
|
|
@@ -589,6 +657,20 @@ _ENV_VAR_REGISTRY_ITEMS: tuple[EnvVarSpec, ...] = (
|
|
|
589
657
|
"KSADK_SESSION_DSN", "sessions", "Conversation session database DSN.", sensitive=True
|
|
590
658
|
),
|
|
591
659
|
EnvVarSpec("KSADK_SESSION_NAMESPACE", "sessions", "Conversation session namespace."),
|
|
660
|
+
EnvVarSpec(
|
|
661
|
+
"KSADK_AGENT_ID",
|
|
662
|
+
"platform",
|
|
663
|
+
"Stable AgentEngine agent identity used only as a fallback checkpoint namespace.",
|
|
664
|
+
),
|
|
665
|
+
EnvVarSpec(
|
|
666
|
+
"KSADK_AGENT_KERNEL",
|
|
667
|
+
"kernel",
|
|
668
|
+
(
|
|
669
|
+
"Opt in to Agent Kernel ingress locally; managed deployment may use "
|
|
670
|
+
"AGENT_KERNEL_ENABLED instead."
|
|
671
|
+
),
|
|
672
|
+
"false",
|
|
673
|
+
),
|
|
592
674
|
EnvVarSpec("KSADK_SESSION_PATH", "sessions", "Conversation local SQLite database path."),
|
|
593
675
|
EnvVarSpec(
|
|
594
676
|
"KSADK_SESSION_PG_CONNECT_TIMEOUT",
|
|
@@ -756,7 +838,7 @@ _ENV_VAR_REGISTRY_ITEMS: tuple[EnvVarSpec, ...] = (
|
|
|
756
838
|
"KSADK_WEB_VERSION",
|
|
757
839
|
"web",
|
|
758
840
|
"Published KsADK Web npm version used for a reproducible wheel build.",
|
|
759
|
-
"0.3.
|
|
841
|
+
"0.3.4",
|
|
760
842
|
),
|
|
761
843
|
EnvVarSpec(
|
|
762
844
|
"KSADK_WORKING_SET_MAX_FILES",
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"""Prompt, Context and Memory environment-variable registry entries."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import replace
|
|
6
|
+
|
|
7
|
+
from ksadk.configs.env_var_spec import EnvVarSpec
|
|
8
|
+
|
|
9
|
+
_PCM_ENV_VAR_REGISTRY_ITEMS: tuple[EnvVarSpec, ...] = (
|
|
10
|
+
EnvVarSpec("KSADK_BASELINE_COLLECT", "context", "Enable PCM baseline collection.", "0"),
|
|
11
|
+
EnvVarSpec(
|
|
12
|
+
"KSADK_BASELINE_EXECUTION_TARGET", "context", "PCM baseline execution target label."
|
|
13
|
+
),
|
|
14
|
+
EnvVarSpec(
|
|
15
|
+
"KSADK_BASELINE_FLUSH_EACH_TURN",
|
|
16
|
+
"context",
|
|
17
|
+
"Flush PCM baseline output after every turn.",
|
|
18
|
+
"0",
|
|
19
|
+
),
|
|
20
|
+
EnvVarSpec("KSADK_BASELINE_PATH", "context", "PCM baseline JSONL output path."),
|
|
21
|
+
EnvVarSpec("KSADK_COMPACT_HARD_LIMIT_PCT", "context", "Hard compaction threshold percentage."),
|
|
22
|
+
EnvVarSpec(
|
|
23
|
+
"KSADK_COMPACT_HARD_LIMIT_PCT_DEFAULT",
|
|
24
|
+
"context",
|
|
25
|
+
"Default hard compaction threshold percentage.",
|
|
26
|
+
),
|
|
27
|
+
EnvVarSpec("KSADK_COMPACT_SOFT_LIMIT_PCT", "context", "Soft compaction threshold percentage."),
|
|
28
|
+
EnvVarSpec(
|
|
29
|
+
"KSADK_COMPACT_SOFT_LIMIT_PCT_DEFAULT",
|
|
30
|
+
"context",
|
|
31
|
+
"Default soft compaction threshold percentage.",
|
|
32
|
+
),
|
|
33
|
+
EnvVarSpec(
|
|
34
|
+
"KSADK_CONTEXT_CACHE_BREAK_OBSERVABILITY",
|
|
35
|
+
"context",
|
|
36
|
+
"Enable prompt cache-break diagnostics.",
|
|
37
|
+
"0",
|
|
38
|
+
),
|
|
39
|
+
EnvVarSpec(
|
|
40
|
+
"KSADK_CONTEXT_CONTRIBUTOR_ALLOW_PLATFORM_TRUST",
|
|
41
|
+
"context",
|
|
42
|
+
"Allow trusted platform context contributors.",
|
|
43
|
+
"0",
|
|
44
|
+
),
|
|
45
|
+
EnvVarSpec(
|
|
46
|
+
"KSADK_CONTEXT_CONTRIBUTOR_FAILURE_MODE",
|
|
47
|
+
"context",
|
|
48
|
+
"Context contributor failure policy.",
|
|
49
|
+
),
|
|
50
|
+
EnvVarSpec(
|
|
51
|
+
"KSADK_CONTEXT_CONTRIBUTOR_TIMEOUT_MS",
|
|
52
|
+
"context",
|
|
53
|
+
"Context contributor timeout in milliseconds.",
|
|
54
|
+
),
|
|
55
|
+
EnvVarSpec(
|
|
56
|
+
"KSADK_CONTEXT_EMERGENCY_KEEP_TAIL_GROUPS",
|
|
57
|
+
"context",
|
|
58
|
+
"Recent event groups retained during emergency compaction.",
|
|
59
|
+
),
|
|
60
|
+
EnvVarSpec(
|
|
61
|
+
"KSADK_CONTEXT_ENGINE_V2_ENABLED", "context", "Enable the PCM context planner.", "0"
|
|
62
|
+
),
|
|
63
|
+
EnvVarSpec(
|
|
64
|
+
"KSADK_CONTEXT_HARD_LIMIT_PERCENT",
|
|
65
|
+
"context",
|
|
66
|
+
"Hard request-context budget threshold percentage.",
|
|
67
|
+
),
|
|
68
|
+
EnvVarSpec(
|
|
69
|
+
"KSADK_CONTEXT_KEEP_TAIL_GROUPS",
|
|
70
|
+
"context",
|
|
71
|
+
"Recent event groups retained during normal compaction.",
|
|
72
|
+
),
|
|
73
|
+
EnvVarSpec(
|
|
74
|
+
"KSADK_CONTEXT_MAX_RETRY_AFTER_PTL",
|
|
75
|
+
"context",
|
|
76
|
+
"Maximum controlled retries after prompt-too-long.",
|
|
77
|
+
),
|
|
78
|
+
EnvVarSpec(
|
|
79
|
+
"KSADK_CONTEXT_RULE_FILES_MAX_TOKENS", "context", "Combined rule-file token budget."
|
|
80
|
+
),
|
|
81
|
+
EnvVarSpec("KSADK_CONTEXT_RULE_FILE_MAX_TOKENS", "context", "Per rule-file token budget."),
|
|
82
|
+
EnvVarSpec(
|
|
83
|
+
"KSADK_CONTEXT_SAFETY_BUFFER_TOKENS", "context", "Reserved context-window safety buffer."
|
|
84
|
+
),
|
|
85
|
+
EnvVarSpec("KSADK_CONTEXT_SEMANTIC_ENABLED", "context", "Enable semantic compaction.", "0"),
|
|
86
|
+
EnvVarSpec(
|
|
87
|
+
"KSADK_CONTEXT_SEMANTIC_TIMEOUT_MS",
|
|
88
|
+
"context",
|
|
89
|
+
"Semantic compaction timeout in milliseconds.",
|
|
90
|
+
),
|
|
91
|
+
EnvVarSpec(
|
|
92
|
+
"KSADK_CONTEXT_SOFT_LIMIT_PERCENT",
|
|
93
|
+
"context",
|
|
94
|
+
"Soft request-context budget threshold percentage.",
|
|
95
|
+
),
|
|
96
|
+
EnvVarSpec(
|
|
97
|
+
"KSADK_CONTEXT_TOOL_RESULT_MAX_TOKENS",
|
|
98
|
+
"context",
|
|
99
|
+
"Maximum token budget for one tool result.",
|
|
100
|
+
),
|
|
101
|
+
EnvVarSpec(
|
|
102
|
+
"KSADK_CONTEXT_WORKING_STATE_ENABLED",
|
|
103
|
+
"context",
|
|
104
|
+
"Enable structured working-state extraction.",
|
|
105
|
+
"0",
|
|
106
|
+
),
|
|
107
|
+
EnvVarSpec(
|
|
108
|
+
"KSADK_CONTEXT_WORKING_STATE_EXTRACTION_TIMEOUT_MS",
|
|
109
|
+
"context",
|
|
110
|
+
"Working-state extraction timeout in milliseconds.",
|
|
111
|
+
),
|
|
112
|
+
EnvVarSpec(
|
|
113
|
+
"KSADK_CONTEXT_WORKING_STATE_MAX_TOKENS", "context", "Working-state token budget."
|
|
114
|
+
),
|
|
115
|
+
EnvVarSpec(
|
|
116
|
+
"KSADK_CONTEXT_WORKING_STATE_MIN_TOKEN_GROWTH",
|
|
117
|
+
"context",
|
|
118
|
+
"Minimum growth before refreshing working state.",
|
|
119
|
+
),
|
|
120
|
+
EnvVarSpec(
|
|
121
|
+
"KSADK_LTM_FORCE_INMEMORY",
|
|
122
|
+
"memory",
|
|
123
|
+
"Force in-memory long-term-memory backend for tests.",
|
|
124
|
+
"0",
|
|
125
|
+
),
|
|
126
|
+
EnvVarSpec("KSADK_MEMORY_CORE_MAX_TOKENS", "memory", "Core-memory token budget."),
|
|
127
|
+
EnvVarSpec("KSADK_MEMORY_DB_PATH", "memory", "Local PCM memory database path."),
|
|
128
|
+
EnvVarSpec("KSADK_MEMORY_ENABLED", "memory", "Enable platform memory projection.", "0"),
|
|
129
|
+
EnvVarSpec(
|
|
130
|
+
"KSADK_MEMORY_FLUSH_BEFORE_COMPACTION",
|
|
131
|
+
"memory",
|
|
132
|
+
"Flush memory candidates before compaction.",
|
|
133
|
+
"0",
|
|
134
|
+
),
|
|
135
|
+
EnvVarSpec("KSADK_MEMORY_FLUSH_ENABLED", "memory", "Enable memory candidate commit.", "0"),
|
|
136
|
+
EnvVarSpec("KSADK_MEMORY_MIN_SCORE", "memory", "Minimum memory recall relevance score."),
|
|
137
|
+
EnvVarSpec(
|
|
138
|
+
"KSADK_MEMORY_MAX_RECORDS",
|
|
139
|
+
"memory",
|
|
140
|
+
"Maximum retained records for the local PCM memory provider.",
|
|
141
|
+
"10000",
|
|
142
|
+
),
|
|
143
|
+
EnvVarSpec("KSADK_MEMORY_PROVIDER", "memory", "Platform memory provider selector."),
|
|
144
|
+
EnvVarSpec("KSADK_MEMORY_RECALL_MAX_TOKENS", "memory", "Memory recall token budget."),
|
|
145
|
+
EnvVarSpec("KSADK_MEMORY_RECALL_TOP_K", "memory", "Maximum recalled memory items."),
|
|
146
|
+
EnvVarSpec(
|
|
147
|
+
"KSADK_MEMORY_RETENTION_DAYS",
|
|
148
|
+
"memory",
|
|
149
|
+
"Retention period in days for the local PCM memory provider.",
|
|
150
|
+
"90",
|
|
151
|
+
),
|
|
152
|
+
EnvVarSpec(
|
|
153
|
+
"KSADK_MEMORY_WRITE_MODE",
|
|
154
|
+
"memory",
|
|
155
|
+
"Memory write mode: off, explicit-only, or candidate.",
|
|
156
|
+
),
|
|
157
|
+
EnvVarSpec(
|
|
158
|
+
"KSADK_PLATFORM_SAFETY_TEXT",
|
|
159
|
+
"prompt",
|
|
160
|
+
"Platform safety rules injected by the prompt compiler.",
|
|
161
|
+
),
|
|
162
|
+
EnvVarSpec(
|
|
163
|
+
"KSADK_PROMPT_AUTO_DISCOVERY", "prompt", "Enable project prompt-source discovery.", "0"
|
|
164
|
+
),
|
|
165
|
+
EnvVarSpec(
|
|
166
|
+
"KSADK_PROMPT_COMPILER_ENABLED", "prompt", "Enable structured prompt compilation.", "0"
|
|
167
|
+
),
|
|
168
|
+
EnvVarSpec(
|
|
169
|
+
"KSADK_TOKENIZER_PROVIDER", "context", "Tokenizer provider used for context accounting."
|
|
170
|
+
),
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
# PCM rollout, budget and diagnostic environment variables are internal runtime
|
|
174
|
+
# controls. Public users configure the same behavior through AgentSpec policies,
|
|
175
|
+
# so these names intentionally do not expand the public environment reference.
|
|
176
|
+
PCM_ENV_VAR_REGISTRY_ITEMS: tuple[EnvVarSpec, ...] = tuple(
|
|
177
|
+
replace(item, documented=False) for item in _PCM_ENV_VAR_REGISTRY_ITEMS
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
__all__ = ["PCM_ENV_VAR_REGISTRY_ITEMS"]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Shared environment-variable registry value object."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@dataclass(frozen=True)
|
|
9
|
+
class EnvVarSpec:
|
|
10
|
+
name: str
|
|
11
|
+
module: str
|
|
12
|
+
purpose: str
|
|
13
|
+
default: str = ""
|
|
14
|
+
sensitive: bool = False
|
|
15
|
+
documented: bool = True
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
__all__ = ["EnvVarSpec"]
|
ksadk/configs/global_config.py
CHANGED
|
@@ -43,6 +43,11 @@ CONFIG_GROUPS = {
|
|
|
43
43
|
# 嵌套对象,get_env_from_global_config 跳过它(不当 env-var),build 保留它
|
|
44
44
|
"IDENTITY_CACHE",
|
|
45
45
|
],
|
|
46
|
+
"evaluation": [
|
|
47
|
+
"AGENT_EVAL_BASE_URL",
|
|
48
|
+
"AGENT_EVAL_API_TOKEN",
|
|
49
|
+
"AGENT_EVAL_ACCOUNT_ID",
|
|
50
|
+
],
|
|
46
51
|
# 未来可扩展更多分组
|
|
47
52
|
# "observability": ["OTEL_EXPORTER_OTLP_ENDPOINT", ...],
|
|
48
53
|
# "plugins": {...},
|
ksadk/configs/settings.py
CHANGED
|
@@ -628,3 +628,12 @@ def setup_environment(agent_path: Path | str):
|
|
|
628
628
|
setup_proxy_redirect_if_enabled()
|
|
629
629
|
except Exception: # noqa: BLE001 代理可选,失败不影响主流程(默认关时本就不触发)
|
|
630
630
|
pass
|
|
631
|
+
|
|
632
|
+
# 5. 沙箱控制面 URL 内网探测:在 Pod 内探测 198 公共服务网内网地址,
|
|
633
|
+
# 可达则覆盖 E2B_API_URL 为内网域名,private_only 节点也能访问沙箱控制面。
|
|
634
|
+
try:
|
|
635
|
+
from ksadk.sandbox import setup_sandbox_api_url_if_needed
|
|
636
|
+
|
|
637
|
+
setup_sandbox_api_url_if_needed()
|
|
638
|
+
except Exception: # noqa: BLE001 沙箱可选,失败不影响主流程
|
|
639
|
+
pass
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"""Context Engine —— Prompt/Context/Memory 的运行时上下文协调层。
|
|
2
|
+
|
|
3
|
+
数据模型、capability 合同与 shadow 可观测基线已落地;后续 PR 新增 planner / assembler /
|
|
4
|
+
policies / contributors 的实际逻辑。本模块导出稳定类型与运行时合同。
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from ksadk.context_engine.assembler import AssembledInput, ContextAssembler, assemble
|
|
8
|
+
from ksadk.context_engine.capabilities import (
|
|
9
|
+
DEFAULT_CONTEXT_CAPABILITIES,
|
|
10
|
+
CapabilityCircuitOpen,
|
|
11
|
+
ContextAccuracy,
|
|
12
|
+
ContextCapabilities,
|
|
13
|
+
ContextIntegrationMode,
|
|
14
|
+
ContextOwner,
|
|
15
|
+
DeploymentMode,
|
|
16
|
+
adk_context_capabilities,
|
|
17
|
+
assert_capability_not_circuit_open,
|
|
18
|
+
capabilities_for_runner,
|
|
19
|
+
capabilities_for_runtime_type,
|
|
20
|
+
capability_hash,
|
|
21
|
+
codex_context_capabilities,
|
|
22
|
+
deepagents_context_capabilities,
|
|
23
|
+
detect_capability_mismatch,
|
|
24
|
+
is_capability_circuit_open,
|
|
25
|
+
langchain_context_capabilities,
|
|
26
|
+
langgraph_context_capabilities,
|
|
27
|
+
mark_capability_mismatch,
|
|
28
|
+
reset_capability_circuit,
|
|
29
|
+
)
|
|
30
|
+
from ksadk.context_engine.models import (
|
|
31
|
+
CONTEXT_POLICY_VERSION,
|
|
32
|
+
ContextBudget,
|
|
33
|
+
ContextDecision,
|
|
34
|
+
ContextItem,
|
|
35
|
+
ContextKind,
|
|
36
|
+
ContextPlan,
|
|
37
|
+
)
|
|
38
|
+
from ksadk.context_engine.planner import ContextPlanner, build_budget
|
|
39
|
+
from ksadk.context_engine.policies import (
|
|
40
|
+
ContextBudgetPolicy,
|
|
41
|
+
ContextPolicy,
|
|
42
|
+
SectionBudget,
|
|
43
|
+
compute_budget_tokens,
|
|
44
|
+
)
|
|
45
|
+
from ksadk.context_engine.projection import PROJECTION_VERSION, ProjectionResult
|
|
46
|
+
from ksadk.context_engine.tokenizer import (
|
|
47
|
+
HEURISTIC_TOKENIZER_NAME,
|
|
48
|
+
HeuristicTokenCounter,
|
|
49
|
+
TokenCounter,
|
|
50
|
+
get_default_token_counter,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
__all__ = [
|
|
54
|
+
"AssembledInput",
|
|
55
|
+
"CONTEXT_POLICY_VERSION",
|
|
56
|
+
"ContextAssembler",
|
|
57
|
+
"ContextAccuracy",
|
|
58
|
+
"ContextBudget",
|
|
59
|
+
"ContextBudgetPolicy",
|
|
60
|
+
"ContextCapabilities",
|
|
61
|
+
"ContextDecision",
|
|
62
|
+
"ContextIntegrationMode",
|
|
63
|
+
"ContextItem",
|
|
64
|
+
"ContextKind",
|
|
65
|
+
"ContextOwner",
|
|
66
|
+
"ContextPlan",
|
|
67
|
+
"ContextPlanner",
|
|
68
|
+
"ContextPolicy",
|
|
69
|
+
"DEFAULT_CONTEXT_CAPABILITIES",
|
|
70
|
+
"DeploymentMode",
|
|
71
|
+
"HEURISTIC_TOKENIZER_NAME",
|
|
72
|
+
"HeuristicTokenCounter",
|
|
73
|
+
"PROJECTION_VERSION",
|
|
74
|
+
"ProjectionResult",
|
|
75
|
+
"SectionBudget",
|
|
76
|
+
"TokenCounter",
|
|
77
|
+
"adk_context_capabilities",
|
|
78
|
+
"assemble",
|
|
79
|
+
"build_budget",
|
|
80
|
+
"capabilities_for_runner",
|
|
81
|
+
"capabilities_for_runtime_type",
|
|
82
|
+
"capability_hash",
|
|
83
|
+
"codex_context_capabilities",
|
|
84
|
+
"compute_budget_tokens",
|
|
85
|
+
"deepagents_context_capabilities",
|
|
86
|
+
"detect_capability_mismatch",
|
|
87
|
+
"get_default_token_counter",
|
|
88
|
+
"is_capability_circuit_open",
|
|
89
|
+
"langchain_context_capabilities",
|
|
90
|
+
"langgraph_context_capabilities",
|
|
91
|
+
"mark_capability_mismatch",
|
|
92
|
+
"reset_capability_circuit",
|
|
93
|
+
"assert_capability_not_circuit_open",
|
|
94
|
+
"CapabilityCircuitOpen",
|
|
95
|
+
"allowed_ownership_choices",
|
|
96
|
+
"validate_ownership_for_runtime",
|
|
97
|
+
"resolve_ownership",
|
|
98
|
+
]
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"""Context Assembler —— 把 ContextPlan.selected 投影成 messages/responses 输入(方案 §8)。
|
|
2
|
+
|
|
3
|
+
Assembler 是 KsADK-owned(``ksadk_hosted``)路径的最终输入组装器:把 ``ContextPlan.selected``
|
|
4
|
+
按方案 §7.4 的稳定前缀→部署级→动态后缀顺序投影成 Chat/Responses 格式。assisted/native 路径
|
|
5
|
+
不调用本模块,由 RuntimeAdapter 自行投影(方案 §6.2)。
|
|
6
|
+
|
|
7
|
+
第一个版本只实现 Chat messages 与 Responses items 两种合法投影,不含模型调用;actual_token
|
|
8
|
+
由调用方在收到 usage 后回填 ``ContextPlan.runtime_reported_input_tokens``。
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from dataclasses import dataclass
|
|
14
|
+
from typing import Any, Literal
|
|
15
|
+
|
|
16
|
+
from ksadk.context_engine.models import ContextItem, ContextPlan
|
|
17
|
+
|
|
18
|
+
ProjectionFormat = Literal["chat", "responses"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass(frozen=True)
|
|
22
|
+
class AssembledInput:
|
|
23
|
+
"""组装后的模型输入(shadow/可观测用,不直接发模型)。"""
|
|
24
|
+
|
|
25
|
+
format: ProjectionFormat
|
|
26
|
+
system: str
|
|
27
|
+
messages: list[dict[str, Any]]
|
|
28
|
+
responses_items: list[dict[str, Any]]
|
|
29
|
+
estimated_tokens: int
|
|
30
|
+
warnings: tuple[str, ...] = ()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _item_text(item: ContextItem) -> str:
|
|
34
|
+
content = item.content
|
|
35
|
+
if isinstance(content, str):
|
|
36
|
+
return content
|
|
37
|
+
if isinstance(content, list):
|
|
38
|
+
parts: list[str] = []
|
|
39
|
+
for part in content:
|
|
40
|
+
if isinstance(part, str):
|
|
41
|
+
parts.append(part)
|
|
42
|
+
elif isinstance(part, dict):
|
|
43
|
+
t = part.get("text") or part.get("content")
|
|
44
|
+
if isinstance(t, str):
|
|
45
|
+
parts.append(t)
|
|
46
|
+
return "\n".join(parts)
|
|
47
|
+
return str(content or "")
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _split_prompt_and_rest(selected: list[ContextItem]) -> tuple[str, list[ContextItem]]:
|
|
51
|
+
"""稳定前缀(compiled_prompt)单独提为 system,其余按顺序进入 messages。"""
|
|
52
|
+
prompt_text = ""
|
|
53
|
+
rest: list[ContextItem] = []
|
|
54
|
+
for item in selected:
|
|
55
|
+
if item.kind == "compiled_prompt":
|
|
56
|
+
prompt_text = (
|
|
57
|
+
(prompt_text + "\n\n" + _item_text(item)).strip("\n\n")
|
|
58
|
+
if prompt_text
|
|
59
|
+
else _item_text(item)
|
|
60
|
+
)
|
|
61
|
+
else:
|
|
62
|
+
rest.append(item)
|
|
63
|
+
return prompt_text, rest
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _role_for(item: ContextItem) -> str:
|
|
67
|
+
if item.kind == "current_input":
|
|
68
|
+
return "user"
|
|
69
|
+
if item.kind == "history_round":
|
|
70
|
+
# history_round 的 content 形如 {"role": "...", "content": ...} 或带 role metadata
|
|
71
|
+
role = item.metadata.get("role")
|
|
72
|
+
if isinstance(role, str):
|
|
73
|
+
return role
|
|
74
|
+
return "assistant"
|
|
75
|
+
if item.kind == "tool_result":
|
|
76
|
+
return "tool"
|
|
77
|
+
return "assistant"
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _current_input_last(items: list[ContextItem]) -> list[ContextItem]:
|
|
81
|
+
"""Keep the canonical current input at the end of Chat chronology.
|
|
82
|
+
|
|
83
|
+
Planner order represents retention priority, not physical message order. If
|
|
84
|
+
``current_input`` is projected before selected history, the runner can treat
|
|
85
|
+
it as history and inject it again as the new input. Preserve every other
|
|
86
|
+
item's relative order and move only ``current_input`` to the end.
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
return [item for item in items if item.kind != "current_input"] + [
|
|
90
|
+
item for item in items if item.kind == "current_input"
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class ContextAssembler:
|
|
95
|
+
"""把 ContextPlan 投影成 Chat/Responses 输入(方案 §8)。
|
|
96
|
+
|
|
97
|
+
纯函数式、无副作用。``assemble_chat`` 输出 OpenAI Chat 风格 messages;
|
|
98
|
+
``assemble_responses`` 输出 Responses API items。两者共用同一 selected 顺序。
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
def assemble_chat(self, plan: ContextPlan) -> AssembledInput:
|
|
102
|
+
system, rest = _split_prompt_and_rest(plan.selected)
|
|
103
|
+
rest = _current_input_last(rest)
|
|
104
|
+
messages: list[dict[str, Any]] = []
|
|
105
|
+
if system:
|
|
106
|
+
messages.append({"role": "system", "content": system})
|
|
107
|
+
warnings: list[str] = []
|
|
108
|
+
for item in rest:
|
|
109
|
+
role = _role_for(item)
|
|
110
|
+
content = _item_text(item)
|
|
111
|
+
if item.metadata.get("truncated_to_tokens") is not None:
|
|
112
|
+
warnings.append(f"{item.item_id}:truncated")
|
|
113
|
+
if item.metadata.get("replaced_with_artifact_summary"):
|
|
114
|
+
warnings.append(f"{item.item_id}:artifact_summary")
|
|
115
|
+
messages.append({"role": role, "content": content, "name": item.metadata.get("name")})
|
|
116
|
+
return AssembledInput(
|
|
117
|
+
format="chat",
|
|
118
|
+
system=system,
|
|
119
|
+
messages=messages,
|
|
120
|
+
responses_items=[],
|
|
121
|
+
estimated_tokens=plan.planned_input_tokens,
|
|
122
|
+
warnings=tuple(warnings),
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
def assemble_responses(self, plan: ContextPlan) -> AssembledInput:
|
|
126
|
+
system, rest = _split_prompt_and_rest(plan.selected)
|
|
127
|
+
rest = _current_input_last(rest)
|
|
128
|
+
items: list[dict[str, Any]] = []
|
|
129
|
+
if system:
|
|
130
|
+
items.append(
|
|
131
|
+
{
|
|
132
|
+
"type": "message",
|
|
133
|
+
"role": "system",
|
|
134
|
+
"content": [{"type": "input_text", "text": system}],
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
warnings: list[str] = []
|
|
138
|
+
for item in rest:
|
|
139
|
+
role = _role_for(item)
|
|
140
|
+
content = _item_text(item)
|
|
141
|
+
if item.metadata.get("truncated_to_tokens") is not None:
|
|
142
|
+
warnings.append(f"{item.item_id}:truncated")
|
|
143
|
+
if item.kind == "tool_result":
|
|
144
|
+
# Responses function_call_output
|
|
145
|
+
call_id = str(
|
|
146
|
+
item.metadata.get("call_id") or item.metadata.get("tool_call_id") or ""
|
|
147
|
+
)
|
|
148
|
+
items.append(
|
|
149
|
+
{"type": "function_call_output", "call_id": call_id, "output": content}
|
|
150
|
+
)
|
|
151
|
+
else:
|
|
152
|
+
item_type = "input_text" if role == "user" else "output_text"
|
|
153
|
+
items.append(
|
|
154
|
+
{
|
|
155
|
+
"type": "message",
|
|
156
|
+
"role": role,
|
|
157
|
+
"content": [{"type": item_type, "text": content}],
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
return AssembledInput(
|
|
161
|
+
format="responses",
|
|
162
|
+
system=system,
|
|
163
|
+
messages=[],
|
|
164
|
+
responses_items=items,
|
|
165
|
+
estimated_tokens=plan.planned_input_tokens,
|
|
166
|
+
warnings=tuple(warnings),
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def assemble(plan: ContextPlan, *, fmt: ProjectionFormat = "chat") -> AssembledInput:
|
|
171
|
+
"""便捷入口。"""
|
|
172
|
+
asm = ContextAssembler()
|
|
173
|
+
return asm.assemble_chat(plan) if fmt == "chat" else asm.assemble_responses(plan)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
__all__ = ["AssembledInput", "ContextAssembler", "ProjectionFormat", "assemble"]
|