agentengine-sdk-python 0.8.3__py3-none-any.whl → 0.8.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/METADATA +9 -8
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/RECORD +482 -245
- ksadk/_build_provenance.json +1 -1
- ksadk/api/client.py +105 -91
- ksadk/builders/code_builder.py +36 -9
- ksadk/builders/framework_requirements.py +2 -1
- ksadk/builders/ks3_uploader.py +36 -7
- ksadk/builders/managed_runtime_builder.py +1 -0
- ksadk/cli/__init__.py +32 -3
- ksadk/cli/cmd_managed_runtime.py +13 -1
- ksadk/cli/cmd_plugin.py +6 -1
- ksadk/cli/cmd_web.py +2 -5
- ksadk/cli/runtime_bootstrap.py +23 -1
- ksadk/codex/client.py +424 -96
- ksadk/codex/projection.py +24 -0
- ksadk/codex/runtime.py +56 -298
- ksadk/common/auth.py +16 -10
- ksadk/configs/env_registry.py +29 -1
- ksadk/conversations/message_projection.py +135 -14
- ksadk/conversations/projector.py +4 -6
- ksadk/conversations/runtime_invocation.py +5 -0
- ksadk/conversations/runtime_payloads.py +1 -0
- ksadk/conversations/runtime_preparation.py +30 -27
- ksadk/conversations/runtime_resume.py +50 -2
- ksadk/conversations/runtime_stream_events.py +5 -0
- ksadk/conversations/runtime_streaming.py +25 -7
- ksadk/deployment/env_forward.py +2 -2
- ksadk/deployment/providers/serverless.py +1 -1
- ksadk/events/adapters/_codex_validators.py +18 -7
- ksadk/events/adapters/langgraph.py +15 -1
- ksadk/events/canonical_store.py +3 -1
- ksadk/events/projections.py +1 -1
- ksadk/harness/config.py +2 -2
- ksadk/harness/runtime.py +27 -27
- ksadk/harness/tools.py +38 -13
- ksadk/interaction/provider.py +1 -0
- ksadk/interaction/providers/langgraph.py +1 -0
- ksadk/kernel/bootstrap.py +28 -4
- ksadk/kernel/ingress.py +15 -2
- ksadk/kernel/sqlite_store.py +27 -0
- ksadk/kernel/store.py +3 -0
- ksadk/kernel/worker.py +65 -10
- ksadk/knowledge_base/client.py +57 -27
- ksadk/mcp_runtime/__init__.py +12 -4
- ksadk/memory/adk/backends/sdk_ltm_backend.py +161 -41
- ksadk/memory/adk/resilient_session_service.py +25 -17
- ksadk/memory/adk/short_term_memory.py +26 -9
- ksadk/memory/models.py +7 -4
- ksadk/memory/provider_resolver.py +3 -0
- ksadk/model_proxy/server.py +10 -5
- ksadk/plugins/__init__.py +4 -0
- ksadk/plugins/artifacts.py +275 -0
- ksadk/plugins/bridges/__init__.py +4 -2
- ksadk/plugins/bridges/codex.py +120 -13
- ksadk/plugins/bridges/dsh.py +340 -156
- ksadk/plugins/builtins.py +35 -36
- ksadk/plugins/bundle_security.py +28 -4
- ksadk/plugins/codex_manifest.py +983 -0
- ksadk/plugins/composition.py +8 -0
- ksadk/plugins/contracts.py +118 -0
- ksadk/plugins/delivery.py +153 -0
- ksadk/plugins/dsh_installation_digest.py +71 -0
- ksadk/plugins/dsh_toolchain.py +110 -21
- ksadk/plugins/ecosystem_probe.py +6 -6
- ksadk/plugins/host.py +102 -39
- ksadk/plugins/kernel_adapter.py +205 -0
- ksadk/plugins/providers/__init__.py +23 -0
- ksadk/plugins/providers/bundles/dsh-knowledge/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-knowledge/index.mjs +53 -0
- ksadk/plugins/providers/bundles/dsh-knowledge/package.json +16 -0
- ksadk/plugins/providers/bundles/dsh-memory/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-memory/index.mjs +175 -0
- ksadk/plugins/providers/bundles/dsh-memory/package.json +16 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/client.mjs +166 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/index.mjs +9 -0
- ksadk/plugins/providers/bundles/dsh-platform-resources/package.json +12 -0
- ksadk/plugins/providers/bundles/dsh-skill-center/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/dsh-skill-center/index.mjs +125 -0
- ksadk/plugins/providers/bundles/dsh-skill-center/package.json +16 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/cordis.patch.yml +3 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/index.mjs +870 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-capability-host/package.json +27 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/client.js +92 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/index.mjs +15 -0
- ksadk/plugins/providers/bundles/ksadk-dsh-studio/package.json +7 -0
- ksadk/plugins/providers/codex.py +335 -69
- ksadk/plugins/providers/codex_native.py +368 -0
- ksadk/plugins/providers/codex_turn.py +301 -0
- ksadk/plugins/providers/dsh_capabilities.py +1389 -0
- ksadk/plugins/providers/dsh_mcp.py +467 -0
- ksadk/plugins/providers/harness.py +118 -113
- ksadk/plugins/providers/mcp_projection.py +150 -0
- ksadk/plugins/providers/platform_resources.py +657 -0
- ksadk/plugins/resolver.py +8 -1
- ksadk/resource_runtime/__init__.py +4 -0
- ksadk/resource_runtime/broker.py +616 -0
- ksadk/resource_runtime/build_artifacts.py +165 -0
- ksadk/resource_runtime/contracts.py +138 -0
- ksadk/resource_runtime/discovery_receipts.py +100 -0
- ksadk/resource_runtime/discovery_skills.py +172 -0
- ksadk/resource_runtime/errors.py +6 -0
- ksadk/resource_runtime/ipc.py +142 -0
- ksadk/resource_runtime/kernel_approval.py +165 -0
- ksadk/resource_runtime/knowledge.py +114 -0
- ksadk/resource_runtime/langgraph.py +94 -0
- ksadk/resource_runtime/leases.py +191 -0
- ksadk/resource_runtime/managed_projection.py +186 -0
- ksadk/resource_runtime/mcp_server.py +138 -0
- ksadk/resource_runtime/memory_provider.py +318 -0
- ksadk/resource_runtime/memory_receipts.py +34 -0
- ksadk/resource_runtime/operation_ledger.py +211 -0
- ksadk/resource_runtime/plugin_config.py +48 -0
- ksadk/resource_runtime/policy_authorization.py +54 -0
- ksadk/resource_runtime/process.py +110 -0
- ksadk/resource_runtime/skill_artifacts.py +153 -0
- ksadk/resource_runtime/skill_runtime.py +42 -0
- ksadk/resource_runtime/skill_workspace.py +118 -0
- ksadk/resource_runtime/skills.py +215 -0
- ksadk/resource_runtime/snapshots.py +180 -0
- ksadk/resource_runtime/socket_server.py +103 -0
- ksadk/resource_runtime/supervisor.py +380 -0
- ksadk/resource_runtime/worker.py +504 -0
- ksadk/runners/_langgraph_runner_streams.py +74 -6
- ksadk/runners/adk_runner.py +149 -11
- ksadk/runners/base_runner.py +29 -1
- ksadk/runners/langgraph_runner.py +475 -145
- ksadk/runtime/_runner_adapter/stream_mapping.py +142 -18
- ksadk/runtime/adapter.py +2 -0
- ksadk/runtime/conversation_execution.py +92 -16
- ksadk/runtime/executor.py +78 -2
- ksadk/runtime/factory.py +29 -273
- ksadk/runtime/framework_adapters.py +23 -0
- ksadk/runtime/preprocessing.py +10 -2
- ksadk/runtime/runner_adapter.py +73 -14
- ksadk/runtime_context.py +40 -2
- ksadk/sandbox/backends/e2b.py +52 -11
- ksadk/sandbox/backends/local_process.py +9 -0
- ksadk/sandbox/base.py +2 -0
- ksadk/sandbox/e2b_connection.py +66 -0
- ksadk/scheduler/sqlite_store.py +18 -0
- ksadk/server/composition.py +2 -0
- ksadk/server/factory.py +5 -0
- ksadk/server/persistence_capability.py +516 -0
- ksadk/server/routes/control.py +210 -46
- ksadk/server/routes/dependencies.py +15 -0
- ksadk/server/routes/models.py +47 -4
- ksadk/server/routes/projection.py +252 -12
- ksadk/server/routes/sessions.py +284 -107
- ksadk/server/routes/streaming.py +43 -9
- ksadk/server/static/assets/{ArtifactsPanel-10GPXIJ6.js → ArtifactsPanel-CGbWlMNh.js} +1 -1
- ksadk/server/static/assets/{CodeBlock-BXk1l-G1.js → CodeBlock-b4C7upmO.js} +3 -3
- ksadk/server/static/assets/{MathMessageMarkdown-D9uB55Oh.js → MathMessageMarkdown-DbdW5A4_.js} +4 -4
- ksadk/server/static/assets/{MermaidBlock--OEYoXIJ.js → MermaidBlock-BEBN4Ksz.js} +6 -6
- ksadk/server/static/assets/{NativeTerminalPanel-DrEe1syq.js → NativeTerminalPanel-zvL-WpAn.js} +1 -1
- ksadk/server/static/assets/{abnfDiagram-VCTEODGH-eeTFJLvo.js → abnfDiagram-VCTEODGH-BYafW7Za.js} +1 -1
- ksadk/server/static/assets/{arc-S3ZNbIAd.js → arc-bTohInsS.js} +1 -1
- ksadk/server/static/assets/architecture-7GRP2DOG-BW5UtSnx.js +1 -0
- ksadk/server/static/assets/{architectureDiagram-5GKGNRK7-CRjgEJDX.js → architectureDiagram-5GKGNRK7-Ch5Lbzsi.js} +1 -1
- ksadk/server/static/assets/{blockDiagram-NRAW4CY4-C7bsBoNH.js → blockDiagram-NRAW4CY4-kqF4MDOG.js} +1 -1
- ksadk/server/static/assets/{c4Diagram-UCG6FXSJ-BX3c33Ob.js → c4Diagram-UCG6FXSJ-8uSRIODv.js} +1 -1
- ksadk/server/static/assets/channel-CF5Up3hQ.js +1 -0
- ksadk/server/static/assets/chunk-2Q5K7J3B-KkXX47WI.js +1 -0
- ksadk/server/static/assets/{chunk-5VM5RSS4-bZ7ws-8m.js → chunk-5VM5RSS4-DkhehZDr.js} +1 -1
- ksadk/server/static/assets/{chunk-F27PBJKO-D2r0pvhY.js → chunk-F27PBJKO-BdXhtPe9.js} +1 -1
- ksadk/server/static/assets/{chunk-G27WJ6UU-CZwF3oUP.js → chunk-G27WJ6UU-DPTpvpwi.js} +1 -1
- ksadk/server/static/assets/{chunk-JWPE2WC7-DigFYCML.js → chunk-JWPE2WC7-Pqoh38el.js} +1 -1
- ksadk/server/static/assets/{chunk-LCL6LL3I-CnorGV5q.js → chunk-LCL6LL3I-DeU00qC-.js} +1 -1
- ksadk/server/static/assets/{chunk-POPQ4Y6H-CexntQA-.js → chunk-POPQ4Y6H-CzxScFkr.js} +1 -1
- ksadk/server/static/assets/{chunk-RHFEMEQ7-CHTC7UxA.js → chunk-RHFEMEQ7-DpqMx-ux.js} +1 -1
- ksadk/server/static/assets/{chunk-SVP7TREG-BC1EWt_-.js → chunk-SVP7TREG-C6t0SypQ.js} +1 -1
- ksadk/server/static/assets/{chunk-XXDRQBXY-BTG24xN0.js → chunk-XXDRQBXY-DVaeafZk.js} +1 -1
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-Cz81acRQ.js +1 -0
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-Cz81acRQ.js +1 -0
- ksadk/server/static/assets/{cose-bilkent-JH36ORCC-CkonRdAS.js → cose-bilkent-JH36ORCC-Bf9D3tzJ.js} +1 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-DVWs8a2t.js +1 -0
- ksadk/server/static/assets/{cynefinDiagram-5FMLGOSQ-DEOCBe15.js → cynefinDiagram-5FMLGOSQ-B9cY3iTz.js} +1 -1
- ksadk/server/static/assets/{dagre-3AP2YEHR-DBThPuLa.js → dagre-3AP2YEHR-CSwlx3CB.js} +1 -1
- ksadk/server/static/assets/{dagre-ClTPrTht.js → dagre-UBpgon5q.js} +1 -1
- ksadk/server/static/assets/{diagram-S7CK7UJ4-DsZHrnpJ.js → diagram-S7CK7UJ4-C9akhN9a.js} +1 -1
- ksadk/server/static/assets/{diagram-UQ7AKVKN-BJR4nhVr.js → diagram-UQ7AKVKN-CgedhTPI.js} +1 -1
- ksadk/server/static/assets/{diagram-VSXAHHWV-xzcERX0a.js → diagram-VSXAHHWV-Cjucz5BY.js} +1 -1
- ksadk/server/static/assets/{diagram-VX7I27RA-tn2xM1xu.js → diagram-VX7I27RA-Dd4Vleyn.js} +1 -1
- ksadk/server/static/assets/{diagram-Z3DM3KII-BZPGBkw5.js → diagram-Z3DM3KII-CZ2jGtYW.js} +1 -1
- ksadk/server/static/assets/{dist-DdRBIceA.js → dist-B2_CVgKv.js} +1 -1
- ksadk/server/static/assets/{dist-Cq4OL6nO.js → dist-B3FR1SKK.js} +1 -1
- ksadk/server/static/assets/{dist-M67Hwu0n.js → dist-BIr4DSRq.js} +1 -1
- ksadk/server/static/assets/{dist-B1oWRmrH.js → dist-BgV_owcB.js} +1 -1
- ksadk/server/static/assets/{dist-DyqV4fL4.js → dist-Bj730Ib4.js} +1 -1
- ksadk/server/static/assets/{dist-DfGFrb0v.js → dist-BnaTiyzN.js} +1 -1
- ksadk/server/static/assets/{dist-C71CsujO.js → dist-C1NMAY5a.js} +1 -1
- ksadk/server/static/assets/{dist-CXpH_Rdd.js → dist-C5_ZAZsG.js} +1 -1
- ksadk/server/static/assets/{dist-DJmCPRVB.js → dist-CB9iJrvg.js} +1 -1
- ksadk/server/static/assets/{dist-DjhwGUgZ.js → dist-CFzsn6BG.js} +1 -1
- ksadk/server/static/assets/{dist-BI1qQH4n.js → dist-Cf125P_m.js} +1 -1
- ksadk/server/static/assets/{dist-8VWI-2bZ.js → dist-ClYUxfeK.js} +1 -1
- ksadk/server/static/assets/{dist-DUwKa_l6.js → dist-DFD6Qa6T.js} +1 -1
- ksadk/server/static/assets/{dist-B-46q3Hk.js → dist-DVCOWtha.js} +1 -1
- ksadk/server/static/assets/{dist-BJLUwH6W.js → dist-D_ctSS2i.js} +1 -1
- ksadk/server/static/assets/{dist-4zN1_tq5.js → dist-DiixqL0J.js} +1 -1
- ksadk/server/static/assets/{dist-B0gdk4rl.js → dist-DoVSwoDb.js} +1 -1
- ksadk/server/static/assets/{dist-Bbwqa8TG.js → dist-DvFK7p5S.js} +1 -1
- ksadk/server/static/assets/{dist-D1V3f1B4.js → dist-QfkEHOlb.js} +1 -1
- ksadk/server/static/assets/{dist-Btyo4vX4.js → dist-btbmmX5O.js} +1 -1
- ksadk/server/static/assets/{dist-u8tVH5Ak.js → dist-fBO2v5Kt.js} +1 -1
- ksadk/server/static/assets/{dist-DQAB0qn_.js → dist-ufY3F5p6.js} +1 -1
- ksadk/server/static/assets/{ebnfDiagram-PWID7BFC-DVfMsLge.js → ebnfDiagram-PWID7BFC-Ci8NqqZu.js} +1 -1
- ksadk/server/static/assets/{erDiagram-SSCWMZ5O-CWEZSYaw.js → erDiagram-SSCWMZ5O-CCIOhLZG.js} +1 -1
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-CQqR2hg3.js +1 -0
- ksadk/server/static/assets/flowDiagram-A5DVABFB-DDRRbGPm.js +1 -0
- ksadk/server/static/assets/{ganttDiagram-EL5Y4UJY-TWIxoyYL.js → ganttDiagram-EL5Y4UJY-Cp_r9Hb6.js} +1 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-fgWEf7UD.js +1 -0
- ksadk/server/static/assets/{gitGraphDiagram-WWUBYQGX-DDh2hd2S.js → gitGraphDiagram-WWUBYQGX-Dlhc8Wr8.js} +1 -1
- ksadk/server/static/assets/index-DcTML1Up.css +2 -0
- ksadk/server/static/assets/index-Dh2XHqPK.js +244 -0
- ksadk/server/static/assets/info-A6RAGUB7-BUecLTdt.js +1 -0
- ksadk/server/static/assets/{infoDiagram-RXCK75RN-CgoyWiDR.js → infoDiagram-RXCK75RN-CO0rRTRA.js} +1 -1
- ksadk/server/static/assets/{ishikawaDiagram-5VMMS53U-CyRIu_om.js → ishikawaDiagram-5VMMS53U-CHiaedSS.js} +1 -1
- ksadk/server/static/assets/{journeyDiagram-EYS64GPL-DN5JXHzN.js → journeyDiagram-EYS64GPL-CHcCIB09.js} +1 -1
- ksadk/server/static/assets/{kanban-definition-3QL26DDD-CNP3ui66.js → kanban-definition-3QL26DDD-CJ_ebBZf.js} +1 -1
- ksadk/server/static/assets/{katex-DWEzQy1d.js → katex-B4weu383.js} +1 -1
- ksadk/server/static/assets/{linear-C-qHp7d2.js → linear-V-MgYHW1.js} +1 -1
- ksadk/server/static/assets/{mermaid-parser.core-Cl-K943T.js → mermaid-parser.core-CBijEX_c.js} +2 -2
- ksadk/server/static/assets/{mindmap-definition-FBJOCRG2-D5DB5mYm.js → mindmap-definition-FBJOCRG2-Bc-pQvpp.js} +1 -1
- ksadk/server/static/assets/packet-AYTQ26CC-BeW-btFv.js +1 -0
- ksadk/server/static/assets/{pegDiagram-XKGWAZYB-BQVc9ia_.js → pegDiagram-XKGWAZYB-D7genGLl.js} +1 -1
- ksadk/server/static/assets/pie-WAS4IAKB-X0xh4SaT.js +1 -0
- ksadk/server/static/assets/{pieDiagram-E7YTZNPT-B6UCAvtY.js → pieDiagram-E7YTZNPT-Bxj32zwD.js} +1 -1
- ksadk/server/static/assets/{quadrantDiagram-AXDQQJYC-mIr2d3eb.js → quadrantDiagram-AXDQQJYC-BURv2mGh.js} +1 -1
- ksadk/server/static/assets/radar-RG4KPBEZ-DzRMSqjd.js +1 -0
- ksadk/server/static/assets/railroad-74A4TZTK-Cc44icX-.js +1 -0
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-D6S4BdV-.js +1 -0
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-vD3aVE2o.js +1 -0
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-CYbW_b4T.js +1 -0
- ksadk/server/static/assets/{railroadDiagram-O6MQD6OU-Dt3FFDmK.js → railroadDiagram-O6MQD6OU-CCsh3avW.js} +1 -1
- ksadk/server/static/assets/{requirementDiagram-EFPCY7ZU-Cz_vQtgF.js → requirementDiagram-EFPCY7ZU-_FRRBKEd.js} +1 -1
- ksadk/server/static/assets/{sankeyDiagram-P5KCCOFB-wlO1TsH5.js → sankeyDiagram-P5KCCOFB-C-gr2o9M.js} +1 -1
- ksadk/server/static/assets/{sequenceDiagram-WJ2MYXX4-CHRbElYq.js → sequenceDiagram-WJ2MYXX4-D97NmfKg.js} +1 -1
- ksadk/server/static/assets/{sizeCapture-X5ZJPWSS-DXX54iyO.js → sizeCapture-X5ZJPWSS-DjrPC5FX.js} +1 -1
- ksadk/server/static/assets/{stateDiagram-HBIQ2CUA-Dp_lw9II.js → stateDiagram-HBIQ2CUA-DzMNg1hh.js} +1 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-BIcjKFhF.js +1 -0
- ksadk/server/static/assets/{swimlanes-XN3QIQJK-D8O5UlLG.js → swimlanes-XN3QIQJK-Cssf_CsU.js} +1 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-tq3K3Ybl.js +8 -0
- ksadk/server/static/assets/{timeline-definition-24CTP7MA-8mfKcxvG.js → timeline-definition-24CTP7MA-BWTHzyS1.js} +1 -1
- ksadk/server/static/assets/treeView-Q6P3EWNA-DBXt3GdU.js +1 -0
- ksadk/server/static/assets/treemap-WGGIJYW6-DrCy4E_l.js +1 -0
- ksadk/server/static/assets/{vennDiagram-4TSXK5OY-EnNl0DE7.js → vennDiagram-4TSXK5OY-BSKgJsmR.js} +1 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-CefhOliM.js +1 -0
- ksadk/server/static/assets/{wardleyDiagram-VM6X3IG4-DBu5fbYr.js → wardleyDiagram-VM6X3IG4-eflHNoaZ.js} +1 -1
- ksadk/server/static/assets/{xychartDiagram-S5SC5T6Z-BSVXs4IY.js → xychartDiagram-S5SC5T6Z-eYqrQ-v4.js} +1 -1
- ksadk/server/static/index.html +2 -2
- ksadk/session_context.py +66 -0
- ksadk/sessions/__init__.py +11 -21
- ksadk/sessions/_local_service_sync.py +263 -1
- ksadk/sessions/base.py +176 -0
- ksadk/sessions/errors.py +4 -0
- ksadk/sessions/in_memory.py +309 -19
- ksadk/sessions/local_service.py +83 -1
- ksadk/sessions/persistence.py +275 -0
- ksadk/sessions/postgres_service.py +358 -0
- ksadk/sessions/resilience.py +8 -0
- ksadk/sessions/resilient.py +362 -4
- ksadk/sessions/topology.py +135 -0
- ksadk/skills/models.py +26 -4
- ksadk/skills/package_store.py +186 -38
- ksadk/skills/runtime/agent.py +31 -6
- ksadk/skills/runtime/artifact_delivery.py +139 -0
- ksadk/skills/runtime/backends/e2b.py +98 -6
- ksadk/skills/runtime/backends/local.py +73 -8
- ksadk/skills/runtime/base.py +3 -0
- ksadk/skills/runtime/executor.py +2 -0
- ksadk/skills/runtime/loader.py +10 -2
- ksadk/skills/runtime/pinned.py +114 -0
- ksadk/skills/runtime/request.py +31 -0
- ksadk/skills/service_client.py +167 -28
- ksadk/studio/api.py +224 -42
- ksadk/studio/api_catalog_routes.py +18 -0
- ksadk/studio/api_plugin_routes.py +526 -95
- ksadk/studio/api_resource_connections.py +183 -0
- ksadk/studio/authoring_coordinator.py +19 -14
- ksadk/studio/builder.py +76 -0
- ksadk/studio/cloud.py +342 -104
- ksadk/studio/cloud_shared_web.py +565 -0
- ksadk/studio/codex_agent_service.py +128 -26
- ksadk/studio/codex_builder.py +241 -2
- ksadk/studio/codex_credentials.py +90 -0
- ksadk/studio/codex_manifest.py +31 -4
- ksadk/studio/codex_plugin_store.py +746 -0
- ksadk/studio/codex_provider_build.py +231 -0
- ksadk/studio/codex_run.py +184 -25
- ksadk/studio/compatibility_report.py +12 -1
- ksadk/studio/compiler.py +78 -14
- ksadk/studio/contracts.py +132 -6
- ksadk/studio/dsh_application.py +137 -0
- ksadk/studio/dsh_capability_service.py +1107 -0
- ksadk/studio/dsh_models.py +59 -0
- ksadk/studio/dsh_provider_registration.py +320 -13
- ksadk/studio/hosted_kernel.py +88 -13
- ksadk/studio/mcp_runtime.py +11 -3
- ksadk/studio/model_client.py +2 -2
- ksadk/studio/plugin_composition.py +190 -23
- ksadk/studio/plugin_kernel_adapter.py +12 -112
- ksadk/studio/plugin_runtime.py +224 -45
- ksadk/studio/resource_authority.py +637 -0
- ksadk/studio/resource_binding_validation.py +77 -0
- ksadk/studio/resource_build_admission.py +196 -0
- ksadk/studio/resource_build_materializer.py +149 -0
- ksadk/studio/resource_catalog.py +143 -2
- ksadk/studio/resource_connections.py +220 -0
- ksadk/studio/run_service.py +462 -52
- ksadk/studio/runtime_source.py +15 -7
- ksadk/studio/scheduler_assistant.py +317 -0
- ksadk/studio/scheduler_runtime.py +9 -0
- ksadk/studio/scheduler_service.py +3 -0
- ksadk/studio/service.py +490 -44
- ksadk/studio/shared_web.py +446 -62
- ksadk/studio/static/assets/CodeBlock-DCUUY0PL-BLjA7kbS.js +41 -0
- ksadk/studio/static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- ksadk/studio/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- ksadk/studio/static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- ksadk/studio/static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- ksadk/studio/static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- ksadk/studio/static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- ksadk/studio/static/assets/MathMessageMarkdown-CBcDrAw--BEOyPC3w.css +1 -0
- ksadk/studio/static/assets/MathMessageMarkdown-CBcDrAw--CUYIXwgI.js +8 -0
- ksadk/studio/static/assets/MermaidBlock-DBFTztfQ-BTYKWEbD.js +44 -0
- ksadk/studio/static/assets/PrismRenderer-wiXRHURw.js +3 -0
- ksadk/studio/static/assets/abnfDiagram-VCTEODGH-CLETGjKq.js +1 -0
- ksadk/studio/static/assets/arc-Pry-7G1_.js +1 -0
- ksadk/studio/static/assets/architecture-7GRP2DOG-hXMiO_AU.js +1 -0
- ksadk/studio/static/assets/architectureDiagram-5GKGNRK7-B5EQysk6.js +36 -0
- ksadk/studio/static/assets/array-BifhSqXX.js +1 -0
- ksadk/studio/static/assets/blockDiagram-I7D4REHJ-CFmPl1de.js +129 -0
- ksadk/studio/static/assets/c4Diagram-7LVT6UL2-BRrGu8qt.js +38 -0
- ksadk/studio/static/assets/channel-BqO-gtEw.js +1 -0
- ksadk/studio/static/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- ksadk/studio/static/assets/chunk-4HAMMTFA-D220vUtq.js +62 -0
- ksadk/studio/static/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- ksadk/studio/static/assets/chunk-75Z2AOVW-C8lLv_qc.js +2 -0
- ksadk/studio/static/assets/chunk-DU6HZSFF-C4DtVpCu.js +128 -0
- ksadk/studio/static/assets/chunk-F27PBJKO-Cpw14SNG.js +1 -0
- ksadk/studio/static/assets/chunk-FOHPRMQF-DHwB1DNv.js +161 -0
- ksadk/studio/static/assets/chunk-GMAD6QVW-DiQA-u2N.js +72 -0
- ksadk/studio/static/assets/chunk-GVQU2GXP-DUdNBUCi.js +1 -0
- ksadk/studio/static/assets/chunk-IMKFNOWR-BSlbjT_b.js +231 -0
- ksadk/studio/static/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- ksadk/studio/static/assets/chunk-L3NEJ4N5-Db8Ab22W.js +1 -0
- ksadk/studio/static/assets/chunk-OSK3NFVY-M2m6G3j4.js +10 -0
- ksadk/studio/static/assets/chunk-P2QGCYS3-DezaQxiK.js +1 -0
- ksadk/studio/static/assets/chunk-POPQ4Y6H-DOpufJ3t.js +1 -0
- ksadk/studio/static/assets/chunk-PWAF6VOD-CfLb1gSc.js +1 -0
- ksadk/studio/static/assets/chunk-SHT3W25Y-DAyIVp5H.js +168 -0
- ksadk/studio/static/assets/chunk-SVP7TREG-DulomOrS.js +88 -0
- ksadk/studio/static/assets/chunk-TICWLB2K-bHJYoflj.js +206 -0
- ksadk/studio/static/assets/chunk-XXDRQBXY-7PcdR2B1.js +1 -0
- ksadk/studio/static/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- ksadk/studio/static/assets/classDiagram-ZZMXUADV-D_bW8JjA.js +1 -0
- ksadk/studio/static/assets/classDiagram-v2-VYDZK3BY-D_bW8JjA.js +1 -0
- ksadk/studio/static/assets/cose-bilkent-JH36ORCC-snL88wkX.js +1 -0
- ksadk/studio/static/assets/cynefin-OW5HDTMX-Bd1YhRo1.js +1 -0
- ksadk/studio/static/assets/cynefinDiagram-5FMLGOSQ-BBrIG_mI.js +62 -0
- ksadk/studio/static/assets/cytoscape.esm-CGd-uY3x.js +321 -0
- ksadk/studio/static/assets/dagre-GXQ25YYZ-DtF1nGdY.js +4 -0
- ksadk/studio/static/assets/dagre-PrKaheQc.js +1 -0
- ksadk/studio/static/assets/defaultLocale-BFoDCU3G.js +1 -0
- ksadk/studio/static/assets/diagram-S7CK7UJ4-0BZ98mya.js +30 -0
- ksadk/studio/static/assets/diagram-UQ7AKVKN-6mLKEo6L.js +41 -0
- ksadk/studio/static/assets/diagram-VSXAHHWV-CJBIaiZ2.js +3 -0
- ksadk/studio/static/assets/diagram-VX7I27RA-BohLEE1C.js +24 -0
- ksadk/studio/static/assets/diagram-Z3DM3KII-D8KIGonG.js +24 -0
- ksadk/studio/static/assets/dist-v5Q1xZ2K.js +1 -0
- ksadk/studio/static/assets/ebnfDiagram-PWID7BFC-C99HU61t.js +1 -0
- ksadk/studio/static/assets/erDiagram-RLTQ6QDP-DLGry2Ap.js +99 -0
- ksadk/studio/static/assets/eventmodeling-NTZA5JFV-B1_5Ac8j.js +1 -0
- ksadk/studio/static/assets/flowDiagram-HODETNUW-DD5hmicn.js +1 -0
- ksadk/studio/static/assets/ganttDiagram-EL5Y4UJY-BPJrVLSG.js +292 -0
- ksadk/studio/static/assets/gitGraph-4MIJSDKK-Cy_ZQBGi.js +1 -0
- ksadk/studio/static/assets/gitGraphDiagram-WWUBYQGX-CZCUz4MT.js +106 -0
- ksadk/studio/static/assets/graphlib-DS17s2tU.js +1 -0
- ksadk/studio/static/assets/index-CeHL9ARV.css +2 -0
- ksadk/studio/static/assets/index-D9QEcVpL.js +320 -0
- ksadk/studio/static/assets/info-A6RAGUB7-DBzDQB_I.js +1 -0
- ksadk/studio/static/assets/infoDiagram-27XIBGKW-B-sq07Hi.js +2 -0
- ksadk/studio/static/assets/init-C-OQMol4.js +1 -0
- ksadk/studio/static/assets/ishikawaDiagram-5VMMS53U-CljI2wyf.js +70 -0
- ksadk/studio/static/assets/journeyDiagram-3NMN7TZE-D50Fo2sL.js +139 -0
- ksadk/studio/static/assets/kanban-definition-UXKFOSKX-DimfOTam.js +89 -0
- ksadk/studio/static/assets/katex-DhON-x74.js +257 -0
- ksadk/studio/static/assets/line-CX5BOOUP.js +1 -0
- ksadk/studio/static/assets/linear-BCxN9JLv.js +1 -0
- ksadk/studio/static/assets/mermaid-parser.core-BdCz8fkS.js +7 -0
- ksadk/studio/static/assets/mindmap-definition-YA3MSWOX-Bizzqy5R.js +96 -0
- ksadk/studio/static/assets/ordinal-BDEzSJ7C.js +1 -0
- ksadk/studio/static/assets/packet-AYTQ26CC-gPln-_kG.js +1 -0
- ksadk/studio/static/assets/path-fybaL0A-.js +1 -0
- ksadk/studio/static/assets/pegDiagram-XKGWAZYB-Dy3fB-gW.js +1 -0
- ksadk/studio/static/assets/pie-WAS4IAKB-qZdHMr7B.js +1 -0
- ksadk/studio/static/assets/pieDiagram-E7YTZNPT-B9mrFSDF.js +39 -0
- ksadk/studio/static/assets/quadrantDiagram-AXDQQJYC-NzUfCbMR.js +7 -0
- ksadk/studio/static/assets/radar-RG4KPBEZ-BZlnaea9.js +1 -0
- ksadk/studio/static/assets/railroad-74A4TZTK-Ce3__H9c.js +1 -0
- ksadk/studio/static/assets/railroad-abnf-HS5TGJTU-DqQn7EzD.js +1 -0
- ksadk/studio/static/assets/railroad-ebnf-LZEXJU2U-B55kCA8F.js +1 -0
- ksadk/studio/static/assets/railroad-peg-WCYAUIDC-DfQnvkHd.js +1 -0
- ksadk/studio/static/assets/railroadDiagram-O6MQD6OU-DnhMjZCk.js +1 -0
- ksadk/studio/static/assets/requirementDiagram-BXWQKSXE-BF3d103U.js +84 -0
- ksadk/studio/static/assets/rolldown-runtime-Dy4uBu1J-DK3Fl9T5.js +1 -0
- ksadk/studio/static/assets/rough.esm-Dy-Kn_BL.js +1 -0
- ksadk/studio/static/assets/sankeyDiagram-P5KCCOFB-Bo-JTwt0.js +40 -0
- ksadk/studio/static/assets/sequenceDiagram-WJ2MYXX4-Dh4wZtUm.js +162 -0
- ksadk/studio/static/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -0
- ksadk/studio/static/assets/src-SFn9St9H.js +1 -0
- ksadk/studio/static/assets/stateDiagram-D77RDMKH-DH774G6d.js +1 -0
- ksadk/studio/static/assets/stateDiagram-v2-MP3YSRHH-DZvVWPBo.js +1 -0
- ksadk/studio/static/assets/swimlanes-42K2YHIH-Bl13OvTX.js +1 -0
- ksadk/studio/static/assets/swimlanesDiagram-VR7AAH4N-BnFOTALJ.js +8 -0
- ksadk/studio/static/assets/timeline-definition-24CTP7MA-DxmSSjRB.js +120 -0
- ksadk/studio/static/assets/treeView-Q6P3EWNA-D5Nn9Swz.js +1 -0
- ksadk/studio/static/assets/treemap-WGGIJYW6-CgHgnQhE.js +1 -0
- ksadk/studio/static/assets/vennDiagram-4TSXK5OY-B9QEXcJq.js +34 -0
- ksadk/studio/static/assets/wardley-WFR3VGLG-DXrK2RRY.js +1 -0
- ksadk/studio/static/assets/wardleyDiagram-VM6X3IG4-Ba1AOWoe.js +78 -0
- ksadk/studio/static/assets/xychartDiagram-S5SC5T6Z-Cr5pt5Y-.js +7 -0
- ksadk/studio/static/index.html +2 -2
- ksadk/version.py +1 -1
- ksadk/server/static/assets/architecture-7GRP2DOG-Dk9nRQ6-.js +0 -1
- ksadk/server/static/assets/channel-s354Yo6o.js +0 -1
- ksadk/server/static/assets/chunk-2Q5K7J3B-CDpPpKR5.js +0 -1
- ksadk/server/static/assets/classDiagram-DTDB5LWJ-Dd0nucl9.js +0 -1
- ksadk/server/static/assets/classDiagram-v2-JRS7N3AN-Dd0nucl9.js +0 -1
- ksadk/server/static/assets/cynefin-OW5HDTMX-BBlT4uMf.js +0 -1
- ksadk/server/static/assets/eventmodeling-NTZA5JFV-Dr5okd8V.js +0 -1
- ksadk/server/static/assets/flowDiagram-A5DVABFB-VEO-cVcO.js +0 -1
- ksadk/server/static/assets/gitGraph-4MIJSDKK-CKiKY9Cf.js +0 -1
- ksadk/server/static/assets/index-B2k_urY8.js +0 -241
- ksadk/server/static/assets/index-ILPt6IWF.css +0 -2
- ksadk/server/static/assets/info-A6RAGUB7-ubA4Nm_p.js +0 -1
- ksadk/server/static/assets/packet-AYTQ26CC-C7R3NUlK.js +0 -1
- ksadk/server/static/assets/pie-WAS4IAKB-BIT6qjr3.js +0 -1
- ksadk/server/static/assets/radar-RG4KPBEZ-l5noef9X.js +0 -1
- ksadk/server/static/assets/railroad-74A4TZTK-Baea6ZvM.js +0 -1
- ksadk/server/static/assets/railroad-abnf-HS5TGJTU-OKn8zZnU.js +0 -1
- ksadk/server/static/assets/railroad-ebnf-LZEXJU2U-DdKAKC4l.js +0 -1
- ksadk/server/static/assets/railroad-peg-WCYAUIDC-Bds8udlG.js +0 -1
- ksadk/server/static/assets/stateDiagram-v2-4QOOHH4V-5b-8o2iS.js +0 -1
- ksadk/server/static/assets/swimlanesDiagram-VK2B7HYN-uf6WPRA4.js +0 -8
- ksadk/server/static/assets/treeView-Q6P3EWNA-CK5CSrSO.js +0 -1
- ksadk/server/static/assets/treemap-WGGIJYW6-Ch2BKgAM.js +0 -1
- ksadk/server/static/assets/wardley-WFR3VGLG-YW3Q0ml_.js +0 -1
- ksadk/studio/static/assets/PrismRenderer-IYN-ffww.js +0 -3
- ksadk/studio/static/assets/index-DXs1Eq4M.css +0 -1
- ksadk/studio/static/assets/index-DeDqwTsD.js +0 -283
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/WHEEL +0 -0
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/entry_points.txt +0 -0
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/licenses/LICENSE +0 -0
- {agentengine_sdk_python-0.8.3.dist-info → agentengine_sdk_python-0.8.4.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
export const name = 'dsh-memory'
|
|
2
|
+
export const inject = ['tools', 'platformResources']
|
|
3
|
+
|
|
4
|
+
export function apply(ctx) {
|
|
5
|
+
for (const operation of ['update_memory', 'delete_memory']) {
|
|
6
|
+
const updating = operation === 'update_memory'
|
|
7
|
+
ctx.effect(() => ctx.platformResources.registerTool(operation, operation))
|
|
8
|
+
ctx.tools.register({
|
|
9
|
+
name: operation,
|
|
10
|
+
description: updating
|
|
11
|
+
? 'Update a real memory ID recalled in this activation, after host approval. No versioned CAS is supported. Use only the returned new ID; if absent, search again.'
|
|
12
|
+
: 'Soft-delete a real memory ID recalled in this activation, after host approval. This does not guarantee physical erasure.',
|
|
13
|
+
parameters: {
|
|
14
|
+
type: 'object', properties: {
|
|
15
|
+
memoryId: { type: 'string', minLength: 1, maxLength: 256 },
|
|
16
|
+
...(updating ? { content: { type: 'string', minLength: 1, maxLength: 8192 } } : {}),
|
|
17
|
+
},
|
|
18
|
+
required: updating ? ['memoryId', 'content'] : ['memoryId'], additionalProperties: false,
|
|
19
|
+
},
|
|
20
|
+
output: {
|
|
21
|
+
schema: {
|
|
22
|
+
type: 'object', properties: {
|
|
23
|
+
status: { type: 'string', enum: ['succeeded', 'failed', 'unknown'] },
|
|
24
|
+
operationId: { type: 'string' }, memoryId: { type: 'string' },
|
|
25
|
+
newMemoryId: { oneOf: [{ type: 'string' }, { type: 'null' }] },
|
|
26
|
+
errorCode: { oneOf: [{ type: 'string' }, { type: 'null' }] },
|
|
27
|
+
},
|
|
28
|
+
required: ['status', 'operationId', 'memoryId', 'newMemoryId', 'errorCode'],
|
|
29
|
+
additionalProperties: false,
|
|
30
|
+
},
|
|
31
|
+
render(_args, result) {
|
|
32
|
+
const text = result.status === 'unknown'
|
|
33
|
+
? 'Memory mutation outcome is unknown. Do not submit it again automatically.'
|
|
34
|
+
: result.status === 'failed' ? 'Memory mutation was not completed. Search again before proposing another change.'
|
|
35
|
+
: !updating ? 'Memory soft-deletion confirmed. This receipt does not prove physical erasure.'
|
|
36
|
+
: result.newMemoryId ? `Memory update confirmed. Returned record ID: ${result.newMemoryId}.`
|
|
37
|
+
: 'Memory update confirmed, but its resulting record ID is unavailable. Search again before another change.'
|
|
38
|
+
return [{ type: 'text', text }]
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
isConcurrencySafe: () => false,
|
|
42
|
+
async execute(args, execution) {
|
|
43
|
+
const result = await ctx.platformResources.call(operation, args, { signal: execution.signal })
|
|
44
|
+
if (!['succeeded', 'failed', 'unknown'].includes(result.status)
|
|
45
|
+
|| !/^[0-9a-f]{64}$/.test(result.operationId)
|
|
46
|
+
|| (result.memoryId !== undefined && result.memoryId !== args.memoryId)
|
|
47
|
+
|| (result.newMemoryId !== undefined && typeof result.newMemoryId !== 'string')
|
|
48
|
+
|| (result.status !== 'succeeded' && result.newMemoryId)
|
|
49
|
+
|| (!updating && result.newMemoryId)
|
|
50
|
+
|| (result.errorCode != null && ![
|
|
51
|
+
'MEMORY_MUTATION_UNKNOWN', 'MEMORY_RECORD_NOT_OBSERVED', 'MEMORY_RECORD_NOT_FOUND',
|
|
52
|
+
].includes(result.errorCode))) throw new Error('MEMORY_RESPONSE_INVALID')
|
|
53
|
+
return {
|
|
54
|
+
status: result.status, operationId: result.operationId,
|
|
55
|
+
memoryId: args.memoryId, newMemoryId: result.newMemoryId || null,
|
|
56
|
+
errorCode: result.errorCode ?? (result.status === 'unknown' ? 'MEMORY_MUTATION_UNKNOWN' : null),
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
ctx.effect(() => ctx.platformResources.registerTool('memory_status', 'memory_status'))
|
|
62
|
+
ctx.tools.register({
|
|
63
|
+
name: 'memory_status',
|
|
64
|
+
description: 'Check an owned memory submission receipt without resubmitting it. Extraction completion does not prove search indexing is ready.',
|
|
65
|
+
parameters: {
|
|
66
|
+
type: 'object', properties: { operationId: { type: 'string', pattern: '^[0-9a-f]{64}$' } },
|
|
67
|
+
required: ['operationId'], additionalProperties: false,
|
|
68
|
+
},
|
|
69
|
+
output: {
|
|
70
|
+
schema: {
|
|
71
|
+
type: 'object', properties: {
|
|
72
|
+
operationId: { type: 'string' }, status: { type: 'string' },
|
|
73
|
+
extractionStatus: { type: 'string' }, searchable: { type: 'boolean' },
|
|
74
|
+
errorCode: { oneOf: [{ type: 'string' }, { type: 'null' }] },
|
|
75
|
+
},
|
|
76
|
+
required: ['operationId', 'status', 'extractionStatus', 'searchable', 'errorCode'],
|
|
77
|
+
additionalProperties: false,
|
|
78
|
+
},
|
|
79
|
+
render(_args, result) {
|
|
80
|
+
return [{ type: 'text', text: `Memory extraction: ${result.extractionStatus}. Search indexing has not been confirmed.` }]
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
isConcurrencySafe: () => true,
|
|
84
|
+
execute(args, execution) {
|
|
85
|
+
return ctx.platformResources.call('memory_status', args, { signal: execution.signal })
|
|
86
|
+
},
|
|
87
|
+
})
|
|
88
|
+
ctx.effect(() => ctx.platformResources.registerTool('save_memory', 'save_memory'))
|
|
89
|
+
ctx.tools.register({
|
|
90
|
+
name: 'save_memory',
|
|
91
|
+
description: 'Submit an explicitly authorized memory for this user. Acceptance is pending extraction, not confirmation that it can be recalled.',
|
|
92
|
+
parameters: {
|
|
93
|
+
type: 'object', properties: { content: { type: 'string', minLength: 1, maxLength: 8192 } },
|
|
94
|
+
required: ['content'], additionalProperties: false,
|
|
95
|
+
},
|
|
96
|
+
output: {
|
|
97
|
+
schema: {
|
|
98
|
+
type: 'object', properties: {
|
|
99
|
+
status: { type: 'string', enum: ['accepted_pending', 'unknown', 'searchable', 'failed'] },
|
|
100
|
+
operationId: { type: 'string' }, searchable: { type: 'boolean' },
|
|
101
|
+
},
|
|
102
|
+
required: ['status', 'operationId', 'searchable'], additionalProperties: false,
|
|
103
|
+
},
|
|
104
|
+
render(_args, result) {
|
|
105
|
+
const text = result.status === 'accepted_pending' ? 'Memory accepted; extraction is pending.'
|
|
106
|
+
: result.status === 'searchable' ? 'Memory indexing confirmed.'
|
|
107
|
+
: result.status === 'failed' ? 'Memory submission failed.'
|
|
108
|
+
: 'Memory submission outcome is unknown. Do not submit it again automatically.'
|
|
109
|
+
return [{ type: 'text', text }]
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
isConcurrencySafe: () => false,
|
|
113
|
+
async execute(args, execution) {
|
|
114
|
+
const result = await ctx.platformResources.call('save_memory', args, { signal: execution.signal })
|
|
115
|
+
if (!['accepted_pending', 'unknown', 'searchable', 'failed'].includes(result.status)
|
|
116
|
+
|| typeof result.operationId !== 'string') throw new Error('MEMORY_RESPONSE_INVALID')
|
|
117
|
+
return {
|
|
118
|
+
status: result.status, operationId: result.operationId,
|
|
119
|
+
searchable: result.status === 'searchable',
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
})
|
|
123
|
+
ctx.effect(() => ctx.platformResources.registerTool('load_memory', 'load_memory'))
|
|
124
|
+
ctx.tools.register({
|
|
125
|
+
name: 'load_memory',
|
|
126
|
+
description: 'Recall memories for the authenticated user from this Agent’s bound memory instance.',
|
|
127
|
+
parameters: {
|
|
128
|
+
type: 'object',
|
|
129
|
+
properties: { query: { type: 'string', maxLength: 16000 } },
|
|
130
|
+
required: ['query'], additionalProperties: false,
|
|
131
|
+
},
|
|
132
|
+
output: {
|
|
133
|
+
schema: {
|
|
134
|
+
type: 'object',
|
|
135
|
+
properties: {
|
|
136
|
+
status: { type: 'string', enum: ['ok', 'empty', 'failed', 'unauthorized'] },
|
|
137
|
+
items: { type: 'array', items: {
|
|
138
|
+
type: 'object',
|
|
139
|
+
properties: {
|
|
140
|
+
memoryId: { type: 'string' }, content: { type: 'string' },
|
|
141
|
+
score: { oneOf: [{ type: 'number' }, { type: 'null' }] },
|
|
142
|
+
version: { oneOf: [{ type: 'integer' }, { type: 'null' }] },
|
|
143
|
+
},
|
|
144
|
+
required: ['memoryId', 'content', 'score', 'version'], additionalProperties: false,
|
|
145
|
+
} },
|
|
146
|
+
truncated: { type: 'boolean' },
|
|
147
|
+
errorCode: { oneOf: [{ type: 'string' }, { type: 'null' }] },
|
|
148
|
+
},
|
|
149
|
+
required: ['status', 'items', 'truncated', 'errorCode'], additionalProperties: false,
|
|
150
|
+
},
|
|
151
|
+
render(_args, result) {
|
|
152
|
+
const text = result.status === 'empty' ? 'No matching memories found.'
|
|
153
|
+
: result.status !== 'ok' ? 'Memory retrieval unavailable.'
|
|
154
|
+
: result.items.map(item => `[${item.memoryId}] ${item.content}`).join('\n\n')
|
|
155
|
+
return [{ type: 'text', text }]
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
isConcurrencySafe: () => true,
|
|
159
|
+
async execute(args, execution) {
|
|
160
|
+
const result = await ctx.platformResources.call('load_memory', args, { signal: execution.signal })
|
|
161
|
+
if (!['ok', 'failed', 'unauthorized'].includes(result.status) || !Array.isArray(result.records)) {
|
|
162
|
+
throw new Error('MEMORY_RESPONSE_INVALID')
|
|
163
|
+
}
|
|
164
|
+
// Tenant/user partition and internal provenance remain host-side.
|
|
165
|
+
const items = result.status === 'ok' ? result.records.map(record => ({
|
|
166
|
+
memoryId: record.memory_id, content: record.content,
|
|
167
|
+
score: record.metadata?.score ?? null, version: record.version ?? null,
|
|
168
|
+
})) : []
|
|
169
|
+
return {
|
|
170
|
+
status: result.status === 'ok' && items.length === 0 ? 'empty' : result.status,
|
|
171
|
+
items, truncated: Boolean(result.truncated_by_budget), errorCode: result.error_code ?? null,
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
})
|
|
175
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kingsoftcloud/dsh-memory",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Private development bundle for Agent-bound memory tools",
|
|
7
|
+
"exports": {".": "./index.mjs", "./cordis.patch.yml": "./cordis.patch.yml"},
|
|
8
|
+
"files": ["index.mjs", "cordis.patch.yml"],
|
|
9
|
+
"engines": {"node": ">=22.19.0"},
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
12
|
+
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
|
|
13
|
+
"@kingsoftcloud/dsh-platform-resources": "0.1.0"
|
|
14
|
+
},
|
|
15
|
+
"dsh": {"bundle": {"patch": "./cordis.patch.yml"}}
|
|
16
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks'
|
|
2
|
+
import { randomUUID } from 'node:crypto'
|
|
3
|
+
import { createConnection } from 'node:net'
|
|
4
|
+
|
|
5
|
+
const MAX_BYTES = 1024 * 1024
|
|
6
|
+
const OPERATIONS = new Set([
|
|
7
|
+
'search_knowledge_base', 'load_memory', 'save_memory', 'update_memory',
|
|
8
|
+
'delete_memory', 'memory_status', 'list_skill_spaces', 'list_skills',
|
|
9
|
+
'search_skills', 'load_skill', 'read_skill_resource', 'execute_skills', 'read_skill_artifact',
|
|
10
|
+
])
|
|
11
|
+
|
|
12
|
+
export class ResourceBridgeError extends Error {
|
|
13
|
+
constructor(code) { super(code); this.code = code }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function assertJson(value, depth = 0, parents = new Set()) {
|
|
17
|
+
if (depth > 64) throw new ResourceBridgeError('RESOURCE_REQUEST_INVALID')
|
|
18
|
+
if (value === null || typeof value === 'boolean') return
|
|
19
|
+
if (typeof value === 'string') {
|
|
20
|
+
if (!value.isWellFormed()) throw new ResourceBridgeError('RESOURCE_REQUEST_INVALID')
|
|
21
|
+
return
|
|
22
|
+
}
|
|
23
|
+
if (typeof value === 'number' && Number.isFinite(value)) return
|
|
24
|
+
if (typeof value !== 'object' || parents.has(value)) {
|
|
25
|
+
throw new ResourceBridgeError('RESOURCE_REQUEST_INVALID')
|
|
26
|
+
}
|
|
27
|
+
if (!Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype) {
|
|
28
|
+
throw new ResourceBridgeError('RESOURCE_REQUEST_INVALID')
|
|
29
|
+
}
|
|
30
|
+
parents.add(value)
|
|
31
|
+
for (const [key, child] of Object.entries(value)) {
|
|
32
|
+
assertJson(key, depth + 1, parents)
|
|
33
|
+
assertJson(child, depth + 1, parents)
|
|
34
|
+
}
|
|
35
|
+
parents.delete(value)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class ResourceBridge {
|
|
39
|
+
#context = new AsyncLocalStorage()
|
|
40
|
+
#pending = new Set()
|
|
41
|
+
#closed = false
|
|
42
|
+
#socketPath
|
|
43
|
+
#tools = new Map()
|
|
44
|
+
|
|
45
|
+
constructor(socketPath) {
|
|
46
|
+
if (typeof socketPath !== 'string' || !socketPath.startsWith('/') || socketPath.includes('\0')) {
|
|
47
|
+
throw new ResourceBridgeError('RESOURCE_SOCKET_INVALID')
|
|
48
|
+
}
|
|
49
|
+
this.#socketPath = socketPath
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
registerTool(name, operation) {
|
|
53
|
+
if (!/^[A-Za-z0-9_.:-]{1,128}$/.test(name) || !OPERATIONS.has(operation) || this.#tools.has(name)) {
|
|
54
|
+
throw new ResourceBridgeError('RESOURCE_TOOL_INVALID')
|
|
55
|
+
}
|
|
56
|
+
this.#tools.set(name, operation)
|
|
57
|
+
return () => this.#tools.delete(name)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
operationForTool(name) { return this.#tools.get(name) }
|
|
61
|
+
|
|
62
|
+
withInvocation(context, callback) {
|
|
63
|
+
// Only the trusted executor/MCP adapter establishes this context. The
|
|
64
|
+
// opaque handle still requires independent authorization by Python.
|
|
65
|
+
if (!context || typeof context.handle !== 'string' ||
|
|
66
|
+
!/^[A-Za-z0-9_-]{32,256}$/.test(context.handle) ||
|
|
67
|
+
!Number.isSafeInteger(context.deadline) || context.deadline <= Date.now() ||
|
|
68
|
+
(context.signal != null && !(context.signal instanceof AbortSignal))) {
|
|
69
|
+
throw new ResourceBridgeError('RESOURCE_CONTEXT_REQUIRED')
|
|
70
|
+
}
|
|
71
|
+
return this.#context.run(Object.freeze({
|
|
72
|
+
handle: context.handle, deadline: context.deadline, signal: context.signal,
|
|
73
|
+
}), callback)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async call(operation, args = {}, { signal } = {}) {
|
|
77
|
+
return this.#request(operation, args, { signal }, false)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async check(operation) {
|
|
81
|
+
return this.#request(operation, {}, {}, true)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async #request(operation, args, { signal }, checkOnly) {
|
|
85
|
+
if (this.#closed) throw new ResourceBridgeError('RESOURCE_BRIDGE_CLOSED')
|
|
86
|
+
if (this.#pending.size >= 64) throw new ResourceBridgeError('RESOURCE_BUSY')
|
|
87
|
+
const context = this.#context.getStore()
|
|
88
|
+
if (!context) throw new ResourceBridgeError('RESOURCE_CONTEXT_REQUIRED')
|
|
89
|
+
if (signal != null && !(signal instanceof AbortSignal)) {
|
|
90
|
+
throw new ResourceBridgeError('RESOURCE_REQUEST_INVALID')
|
|
91
|
+
}
|
|
92
|
+
const signals = [context.signal, signal].filter(Boolean)
|
|
93
|
+
const callSignal = signals.length ? AbortSignal.any(signals) : undefined
|
|
94
|
+
if (!OPERATIONS.has(operation) || !args || Array.isArray(args) || typeof args !== 'object') {
|
|
95
|
+
throw new ResourceBridgeError('RESOURCE_REQUEST_INVALID')
|
|
96
|
+
}
|
|
97
|
+
assertJson(args)
|
|
98
|
+
const requestId = randomUUID()
|
|
99
|
+
const deadline = Math.min(context.deadline, Date.now() + (operation === 'execute_skills' ? 900_000 : 60_000))
|
|
100
|
+
if (deadline <= Date.now()) throw new ResourceBridgeError('RESOURCE_DEADLINE_EXCEEDED')
|
|
101
|
+
const body = Buffer.from(JSON.stringify({
|
|
102
|
+
v: 1, requestId, deadline, operation, handle: context.handle, arguments: args,
|
|
103
|
+
...(checkOnly ? { checkOnly: true } : {}),
|
|
104
|
+
}), 'utf8')
|
|
105
|
+
if (body.length > MAX_BYTES) throw new ResourceBridgeError('RESOURCE_REQUEST_INVALID')
|
|
106
|
+
const prefix = Buffer.alloc(4)
|
|
107
|
+
prefix.writeUInt32BE(body.length)
|
|
108
|
+
return new Promise((resolve, reject) => {
|
|
109
|
+
let socket
|
|
110
|
+
let timer
|
|
111
|
+
let settled = false
|
|
112
|
+
let received = Buffer.alloc(0)
|
|
113
|
+
let expected
|
|
114
|
+
const finish = (error, result) => {
|
|
115
|
+
if (settled) return
|
|
116
|
+
settled = true
|
|
117
|
+
clearTimeout(timer)
|
|
118
|
+
callSignal?.removeEventListener('abort', abort)
|
|
119
|
+
this.#pending.delete(abort)
|
|
120
|
+
socket?.destroy()
|
|
121
|
+
if (error) reject(error)
|
|
122
|
+
else resolve(result)
|
|
123
|
+
}
|
|
124
|
+
const fail = code => finish(new ResourceBridgeError(code))
|
|
125
|
+
const abort = () => fail('RESOURCE_CANCELLED')
|
|
126
|
+
if (callSignal?.aborted) return abort()
|
|
127
|
+
this.#pending.add(abort)
|
|
128
|
+
callSignal?.addEventListener('abort', abort, { once: true })
|
|
129
|
+
timer = setTimeout(() => fail('RESOURCE_DEADLINE_EXCEEDED'), Math.max(1, deadline - Date.now()))
|
|
130
|
+
socket = createConnection({ path: this.#socketPath })
|
|
131
|
+
socket.once('connect', () => socket.write(Buffer.concat([prefix, body])))
|
|
132
|
+
socket.once('error', () => fail('RESOURCE_TRANSPORT_FAILED'))
|
|
133
|
+
socket.once('close', () => { if (!settled) fail('RESOURCE_TRANSPORT_FAILED') })
|
|
134
|
+
socket.on('data', chunk => {
|
|
135
|
+
if (received.length + chunk.length > MAX_BYTES + 4) return fail('RESOURCE_RESPONSE_INVALID')
|
|
136
|
+
received = Buffer.concat([received, chunk])
|
|
137
|
+
if (expected === undefined && received.length >= 4) {
|
|
138
|
+
expected = received.readUInt32BE(0)
|
|
139
|
+
if (!expected || expected > MAX_BYTES) return fail('RESOURCE_RESPONSE_INVALID')
|
|
140
|
+
}
|
|
141
|
+
if (expected === undefined || received.length < expected + 4) return
|
|
142
|
+
if (received.length !== expected + 4) return fail('RESOURCE_RESPONSE_INVALID')
|
|
143
|
+
try {
|
|
144
|
+
const response = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(received.subarray(4)))
|
|
145
|
+
if (response?.v !== 1 || response.requestId !== requestId) return fail('RESOURCE_RESPONSE_INVALID')
|
|
146
|
+
if (response.error) {
|
|
147
|
+
const code = response.error.code
|
|
148
|
+
return fail(typeof code === 'string' && /^RESOURCE_[A-Z_]{1,64}$/.test(code)
|
|
149
|
+
? code : 'RESOURCE_RESPONSE_INVALID')
|
|
150
|
+
}
|
|
151
|
+
if (!response.result || typeof response.result !== 'object' || Array.isArray(response.result)) {
|
|
152
|
+
return fail('RESOURCE_RESPONSE_INVALID')
|
|
153
|
+
}
|
|
154
|
+
assertJson(response.result)
|
|
155
|
+
finish(null, response.result)
|
|
156
|
+
} catch { fail('RESOURCE_RESPONSE_INVALID') }
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
dispose() {
|
|
162
|
+
this.#closed = true
|
|
163
|
+
for (const abort of [...this.#pending]) abort()
|
|
164
|
+
this.#context.disable()
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ResourceBridge } from './client.mjs'
|
|
2
|
+
|
|
3
|
+
export const name = 'dsh-platform-resources'
|
|
4
|
+
|
|
5
|
+
export function apply(ctx, config = {}) {
|
|
6
|
+
const bridge = new ResourceBridge(config.socketPath)
|
|
7
|
+
ctx.provide('platformResources', bridge)
|
|
8
|
+
ctx.effect(() => () => bridge.dispose())
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kingsoftcloud/dsh-platform-resources",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Private development bundle for host-authorized platform resource IPC",
|
|
7
|
+
"exports": {".": "./index.mjs", "./client": "./client.mjs", "./cordis.patch.yml": "./cordis.patch.yml"},
|
|
8
|
+
"files": ["index.mjs", "client.mjs", "cordis.patch.yml"],
|
|
9
|
+
"engines": {"node": ">=22.19.0"},
|
|
10
|
+
"peerDependencies": {"@deepseek-ai/cordis": "^4.0.1"},
|
|
11
|
+
"dsh": {"bundle": {"patch": "./cordis.patch.yml"}}
|
|
12
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
export const name = 'dsh-skill-center'
|
|
2
|
+
export const inject = ['tools', 'platformResources']
|
|
3
|
+
|
|
4
|
+
const skillId = { type: 'string', minLength: 1, maxLength: 256 }
|
|
5
|
+
const artifactProperties = {
|
|
6
|
+
artifactId: { type: 'string' }, name: { type: 'string' },
|
|
7
|
+
size: { type: 'integer' }, sha256: { type: 'string' },
|
|
8
|
+
}
|
|
9
|
+
const resourceOutput = {
|
|
10
|
+
type: 'object', properties: {
|
|
11
|
+
status: { type: 'string', enum: ['ok'] }, skillId: { type: 'string' },
|
|
12
|
+
versionId: { type: 'string' }, contentHash: { type: 'string' }, path: { type: 'string' },
|
|
13
|
+
content: { type: 'string' }, truncated: { type: 'boolean' },
|
|
14
|
+
nextOffset: { oneOf: [{ type: 'integer' }, { type: 'null' }] },
|
|
15
|
+
},
|
|
16
|
+
required: ['status', 'skillId', 'versionId', 'contentHash', 'path', 'content', 'truncated', 'nextOffset'],
|
|
17
|
+
additionalProperties: false,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function apply(ctx) {
|
|
21
|
+
const definitions = [
|
|
22
|
+
{
|
|
23
|
+
name: 'execute_skills', description: 'Execute selected locked Skills in the Build’s isolated runtime after host approval. Discovery selections must first be loaded and recorded. An unknown outcome must not be retried as a new operation.',
|
|
24
|
+
parameters: { type: 'object', properties: {
|
|
25
|
+
workflowPrompt: { type: 'string', minLength: 1, maxLength: 16000 },
|
|
26
|
+
skillIds: { type: 'array', items: skillId, minItems: 1, maxItems: 32, uniqueItems: true },
|
|
27
|
+
}, required: ['workflowPrompt', 'skillIds'], additionalProperties: false },
|
|
28
|
+
schema: { type: 'object', properties: {
|
|
29
|
+
status: { type: 'string', enum: ['succeeded', 'unknown', 'failed'] },
|
|
30
|
+
operationId: { type: 'string' }, replayed: { type: 'boolean' },
|
|
31
|
+
artifacts: { type: 'array', items: { type: 'object', properties: artifactProperties,
|
|
32
|
+
required: ['artifactId', 'name', 'size', 'sha256'], additionalProperties: false } },
|
|
33
|
+
}, required: ['status', 'operationId'], additionalProperties: false },
|
|
34
|
+
render: result => result.status === 'succeeded'
|
|
35
|
+
? `Skill execution completed. Operation: ${result.operationId}. Artifacts: ${(result.artifacts ?? []).map(item => `${item.name} (${item.artifactId})`).join(', ') || 'none'}`
|
|
36
|
+
: `Skill execution outcome: ${result.status}. Operation: ${result.operationId}. Do not submit a new execution to recover this result.`,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'read_skill_artifact', description: 'Read a bounded base64 chunk of an artifact from an authorized Skill execution. Follow nextOffset to retrieve the complete file.',
|
|
40
|
+
parameters: { type: 'object', properties: {
|
|
41
|
+
operationId: { type: 'string', pattern: '^[0-9a-f]{64}$' },
|
|
42
|
+
artifactId: { type: 'string', pattern: '^[0-9a-f]{64}$' },
|
|
43
|
+
offset: { type: 'integer', minimum: 0, maximum: 20971520 },
|
|
44
|
+
maxBytes: { type: 'integer', minimum: 1, maximum: 32768 },
|
|
45
|
+
}, required: ['operationId', 'artifactId'], additionalProperties: false },
|
|
46
|
+
schema: { type: 'object', properties: {
|
|
47
|
+
...artifactProperties, operationId: { type: 'string' }, encoding: { type: 'string', enum: ['base64'] },
|
|
48
|
+
content: { type: 'string' }, offset: { type: 'integer' },
|
|
49
|
+
nextOffset: { oneOf: [{ type: 'integer' }, { type: 'null' }] },
|
|
50
|
+
}, required: ['artifactId', 'name', 'size', 'sha256', 'operationId', 'encoding', 'content', 'offset', 'nextOffset'], additionalProperties: false },
|
|
51
|
+
render: result => `${result.name} — base64 at byte ${result.offset}:\n${result.content}\nNext offset: ${result.nextOffset ?? 'end'}`,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'list_skills', description: 'List Skills allowed by this Agent binding: Build-locked packages in pinned mode, or the admitted space in discovery mode.',
|
|
55
|
+
parameters: { type: 'object', properties: {}, additionalProperties: false },
|
|
56
|
+
schema: {
|
|
57
|
+
type: 'object', properties: {
|
|
58
|
+
status: { type: 'string', enum: ['ok'] }, truncated: { type: 'boolean' },
|
|
59
|
+
items: { type: 'array', items: {
|
|
60
|
+
type: 'object', properties: {
|
|
61
|
+
skillId: { type: 'string' }, name: { type: 'string' }, versionId: { type: 'string' }, contentHash: { type: 'string' },
|
|
62
|
+
}, required: ['skillId', 'name', 'versionId', 'contentHash'], additionalProperties: false,
|
|
63
|
+
} },
|
|
64
|
+
}, required: ['status', 'items', 'truncated'], additionalProperties: false,
|
|
65
|
+
},
|
|
66
|
+
render: result => result.items.map(item => `${item.name} (${item.skillId}@${item.versionId})`).join('\n') || 'No Skills are available.',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'search_skills', description: 'Search names and descriptions of Skills allowed by this Agent binding using metadata matching.',
|
|
70
|
+
parameters: {
|
|
71
|
+
type: 'object', properties: {
|
|
72
|
+
query: { type: 'string', minLength: 1, maxLength: 16000 },
|
|
73
|
+
maxResults: { type: 'integer', minimum: 1, maximum: 32 },
|
|
74
|
+
}, required: ['query'], additionalProperties: false,
|
|
75
|
+
},
|
|
76
|
+
schema: {
|
|
77
|
+
type: 'object', properties: {
|
|
78
|
+
status: { type: 'string', enum: ['ok'] }, truncated: { type: 'boolean' },
|
|
79
|
+
items: { type: 'array', items: {
|
|
80
|
+
type: 'object', properties: {
|
|
81
|
+
skillId: { type: 'string' }, name: { type: 'string' }, versionId: { type: 'string' },
|
|
82
|
+
contentHash: { type: 'string' }, description: { type: 'string' },
|
|
83
|
+
score: { type: 'integer' }, reason: { type: 'string' },
|
|
84
|
+
}, required: ['skillId', 'name', 'versionId', 'contentHash', 'description', 'score', 'reason'],
|
|
85
|
+
additionalProperties: false,
|
|
86
|
+
} },
|
|
87
|
+
}, required: ['status', 'items', 'truncated'], additionalProperties: false,
|
|
88
|
+
},
|
|
89
|
+
render: result => result.items.map(item => `${item.name} (${item.skillId}@${item.versionId}): ${item.description}`).join('\n') || 'No Skill matches this query.',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'load_skill', description: 'Read an allowed Skill’s SKILL.md and fix its version for this run when using discovery. Follow nextOffset with read_skill_resource if truncated.',
|
|
93
|
+
parameters: { type: 'object', properties: { skillId }, required: ['skillId'], additionalProperties: false },
|
|
94
|
+
schema: resourceOutput, render: result => result.content,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'read_skill_resource', description: 'Read a UTF-8 text file from a selected Skill package by relative path. This does not execute scripts.',
|
|
98
|
+
parameters: {
|
|
99
|
+
type: 'object', properties: {
|
|
100
|
+
skillId, path: { type: 'string', minLength: 1, maxLength: 1024 },
|
|
101
|
+
offset: { type: 'integer', minimum: 0, maximum: 1048576 },
|
|
102
|
+
maxChars: { type: 'integer', minimum: 1, maximum: 64000 },
|
|
103
|
+
}, required: ['skillId', 'path'], additionalProperties: false,
|
|
104
|
+
},
|
|
105
|
+
schema: resourceOutput, render: result => result.content,
|
|
106
|
+
},
|
|
107
|
+
]
|
|
108
|
+
for (const definition of definitions) {
|
|
109
|
+
ctx.effect(() => ctx.platformResources.registerTool(definition.name, definition.name))
|
|
110
|
+
ctx.tools.register({
|
|
111
|
+
name: definition.name, description: definition.description, parameters: definition.parameters,
|
|
112
|
+
output: { schema: definition.schema, render: (_args, result) => [{ type: 'text', text: definition.render(result) }] },
|
|
113
|
+
isConcurrencySafe: () => definition.name !== 'execute_skills',
|
|
114
|
+
async execute(args, execution) {
|
|
115
|
+
const result = await ctx.platformResources.call(definition.name, args, { signal: execution.signal })
|
|
116
|
+
if (definition.name === 'execute_skills') {
|
|
117
|
+
if (!['succeeded', 'unknown', 'failed'].includes(result.status)) throw new Error('SKILL_EXECUTION_UNAVAILABLE')
|
|
118
|
+
} else if (definition.name !== 'read_skill_artifact' && result.status !== 'ok') {
|
|
119
|
+
throw new Error('SKILL_RESOURCE_UNAVAILABLE')
|
|
120
|
+
}
|
|
121
|
+
return result
|
|
122
|
+
},
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kingsoftcloud/dsh-skill-center",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Private development bundle for Build-bound Skill consumption",
|
|
7
|
+
"exports": {".": "./index.mjs", "./cordis.patch.yml": "./cordis.patch.yml"},
|
|
8
|
+
"files": ["index.mjs", "cordis.patch.yml"],
|
|
9
|
+
"engines": {"node": ">=22.19.0"},
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
12
|
+
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
|
|
13
|
+
"@kingsoftcloud/dsh-platform-resources": "0.1.0"
|
|
14
|
+
},
|
|
15
|
+
"dsh": {"bundle": {"patch": "./cordis.patch.yml"}}
|
|
16
|
+
}
|