bailinghub 0.9.4 → 0.10.1
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.
- package/README.en.md +6 -6
- package/README.md +6 -6
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/docker-compose.images.yml +2 -2
- package/docs/AGENT_CLIENT_QUICKSTART.en.md +1 -3
- package/docs/AGENT_CLIENT_QUICKSTART.md +1 -1
- package/docs/AGENT_CLIENT_RUNTIME_API.en.md +87 -2
- package/docs/AGENT_CLIENT_RUNTIME_API.md +36 -2
- package/docs/AGENT_KNOWLEDGE_API.en.md +77 -0
- package/docs/AGENT_KNOWLEDGE_API.md +86 -0
- package/docs/AGENT_TASK_CONTROL.md +4 -4
- package/docs/AGENT_TASK_CONTROL_FOUNDATION.md +1 -1
- package/docs/ARCHITECTURE.md +4 -0
- package/docs/CHANGELOG.en.md +24 -1
- package/docs/CHANGELOG.md +24 -1
- package/docs/COMPATIBILITY.en.md +27 -1
- package/docs/CONTRACT.en.md +1 -1
- package/docs/CONTRACT.md +1 -1
- package/docs/IMPLEMENTATION_STATUS.en.md +28 -15
- package/docs/IMPLEMENTATION_STATUS.md +28 -15
- package/docs/INDEPENDENT_VALIDATION.en.md +6 -4
- package/docs/INDEPENDENT_VALIDATION.md +6 -4
- package/docs/INTEGRATION_WALKTHROUGH.md +65 -0
- package/docs/MODEL_BILLING.en.md +2 -0
- package/docs/MODEL_BILLING.md +6 -2
- package/docs/MODEL_CONTINUATION.en.md +54 -0
- package/docs/MODEL_CONTINUATION.md +54 -0
- package/docs/MODEL_OUTPUT_BUDGET.en.md +69 -0
- package/docs/MODEL_OUTPUT_BUDGET.md +69 -0
- package/docs/OPERATIONS.en.md +16 -4
- package/docs/OPERATIONS.md +16 -4
- package/docs/QUICKSTART.md +1 -1
- package/docs/README.en.md +7 -0
- package/docs/README.md +7 -0
- package/docs/RELEASE_NOTES_NEXT.en.md +3 -3
- package/docs/RELEASE_NOTES_NEXT.md +3 -3
- package/docs/RELEASE_NOTES_v0.10.0.en.md +58 -0
- package/docs/RELEASE_NOTES_v0.10.0.md +58 -0
- package/docs/RELEASE_NOTES_v0.10.1.en.md +41 -0
- package/docs/RELEASE_NOTES_v0.10.1.md +41 -0
- package/docs/UPGRADE_PLAN.en.md +118 -0
- package/docs/UPGRADE_PLAN.md +124 -0
- package/docs/UPGRADE_v0.10.0.en.md +47 -0
- package/docs/UPGRADE_v0.10.0.md +47 -0
- package/docs/UPGRADE_v0.10.1.en.md +66 -0
- package/docs/UPGRADE_v0.10.1.md +66 -0
- package/docs//345/205/274/345/256/271/346/200/247/344/270/216/345/215/207/347/272/247.md +38 -22
- package/package.json +10 -5
- package/schemas/tool-definition.schema.json +13 -0
- package/scripts/check-doc-links.mjs +6 -0
- package/scripts/check-image-tags.sh +1 -1
- package/scripts/check-php-sdk-artifacts.mjs +152 -0
- package/scripts/check-php-sdk-artifacts.test.mjs +99 -0
- package/scripts/check-release-consistency.test.mjs +2 -2
- package/scripts/doctor-upgrade-plan.test.ts +205 -0
- package/scripts/doctor-upgrade-plan.ts +276 -0
- package/scripts/doctor.ts +4 -1
- package/scripts/e2e-console-approval-details.mjs +134 -0
- package/scripts/e2e-console-config-races.mjs +180 -0
- package/scripts/e2e-console-kb-audit.mjs +170 -0
- package/scripts/e2e-console-operations-audit.mjs +152 -0
- package/scripts/e2e-console-runtime-audit.mjs +179 -0
- package/scripts/e2e-console-settings-audit.mjs +125 -0
- package/scripts/e2e-console-troubleshooting-extra.mjs +267 -0
- package/scripts/e2e-console.mjs +476 -7
- package/scripts/install.sh +1 -1
- package/scripts/publish-images.sh +1 -1
- package/scripts/release-audit.mjs +9 -1
- package/scripts/sdk-declaration-contract-test.ts +34 -0
- package/scripts/sdk-p1-check.mjs +62 -26
- package/scripts/verify-github-repo.mjs +8 -0
- package/sdk/dotnet/Bailing.Connect/BailingConnect.cs +4 -4
- package/sdk/dotnet/README.md +8 -0
- package/sdk/dotnet/tests/Declaration/Declaration.csproj +11 -0
- package/sdk/dotnet/tests/Declaration/Program.cs +74 -0
- package/sdk/go/README.md +8 -0
- package/sdk/go/bailingconnect/connect.go +5 -5
- package/sdk/go/bailingconnect/declaration_test.go +107 -0
- package/sdk/java/README.md +13 -0
- package/sdk/java/src/main/java/com/bailing/connect/BailingConnect.java +4 -4
- package/sdk/java/tests/DeclarationTest.java +70 -0
- package/sdk/node/README.md +8 -0
- package/sdk/node/src/index.mjs +4 -4
- package/sdk/node/tests/declaration.test.mjs +41 -0
- package/sdk/php/README.md +16 -0
- package/sdk/php/src/Attributes/AiTool.php +4 -4
- package/sdk/php/src/SpecBuilder.php +8 -8
- package/sdk/php/tests/declaration-serialization.php +103 -0
- package/sdk/php7/README.md +14 -0
- package/sdk/php7/src/ToolDef.php +3 -3
- package/sdk/php7/src/ToolSpec.php +8 -13
- package/sdk/php7/tests/declaration-serialization.php +103 -0
- package/sdk/python/README.md +8 -0
- package/sdk/python/bailing_connect/__init__.py +6 -6
- package/sdk/python/tests/test_declaration.py +61 -0
- package/src/app/agent-client-runtime.test.ts +115 -2
- package/src/app/agent-client-runtime.ts +40 -11
- package/src/app/agent-knowledge.test.ts +171 -0
- package/src/app/agent-knowledge.ts +233 -0
- package/src/app/agent-tool-catalog-revision.test.ts +31 -0
- package/src/app/agent-tool-invocations.test.ts +7 -2
- package/src/app/agent-tool-invocations.ts +67 -7
- package/src/app/approval-continuations.test.ts +49 -1
- package/src/app/http.test.ts +16 -1
- package/src/app/http.ts +3 -3
- package/src/app/kernel-boot-recovery.mysql.test.ts +132 -0
- package/src/app/kernel-boot-recovery.test.ts +157 -0
- package/src/app/kernel.ts +12 -8
- package/src/app/readiness.mysql.test.ts +120 -0
- package/src/app/readiness.test.ts +111 -26
- package/src/app/readiness.ts +26 -22
- package/src/app/runtime-lifecycle.ts +34 -3
- package/src/app/tool-approvals.test.ts +83 -0
- package/src/app/tool-approvals.ts +25 -7
- package/src/app/tool-proxy-payload.test.ts +81 -0
- package/src/app/tool-proxy.ts +24 -2
- package/src/core/config/console-diagnostic-location.test.ts +36 -0
- package/src/core/config/console-form-guard.test.ts +69 -0
- package/src/core/config/console-task-location.test.ts +64 -0
- package/src/core/contracts/explicit-capability-values.test.ts +62 -0
- package/src/core/contracts/openapi-tools.ts +18 -7
- package/src/core/contracts/schema-readiness.ts +11 -0
- package/src/core/contracts/tool-annotations.ts +4 -4
- package/src/core/contracts/tool-definition.ts +26 -0
- package/src/core/contracts/tool-guidance.test.ts +77 -0
- package/src/core/contracts/tool-guidance.ts +31 -0
- package/src/core/contracts/tool-input-limits.ts +15 -0
- package/src/core/contracts/tools-idempotency.test.ts +90 -0
- package/src/core/contracts/tools.ts +52 -9
- package/src/core/runtime/agent-execution-memory.test.ts +64 -0
- package/src/core/runtime/agent-execution-memory.ts +63 -0
- package/src/core/state/state-contracts.ts +3 -0
- package/src/infrastructure/config/config-observability-ledger.ts +2 -0
- package/src/infrastructure/schema/schema-readiness.ts +29 -0
- package/src/infrastructure/state/state-mysql.ts +3 -0
- package/src/modules/usage/contracts.ts +7 -0
- package/src/modules/usage/http.ts +2 -0
- package/src/modules/usage/model-continuation.test.ts +109 -0
- package/src/modules/usage/model-gateway.ts +5 -1
- package/src/modules/usage/output-budget.mysql.test.ts +84 -0
- package/src/modules/usage/output-budget.test.ts +167 -0
- package/src/modules/usage/output-budget.ts +73 -0
- package/src/modules/usage/provider-stream.test.ts +22 -0
- package/src/modules/usage/provider.ts +2 -3
- package/src/modules/usage/repository.ts +6 -0
- package/src/modules/usage/test-harness.ts +4 -2
- package/src/routes/admin-approval-view.test.ts +109 -0
- package/src/routes/admin-approval-view.ts +36 -0
- package/src/routes/admin-readiness.test.ts +52 -0
- package/src/routes/admin-runtime-ux.test.ts +51 -0
- package/src/routes/admin-runtime-ux.ts +25 -0
- package/src/routes/admin-runtime.ts +36 -8
- package/src/routes/admin.ts +9 -0
- package/src/routes/agent-api.test.ts +80 -1
- package/src/routes/agent-api.ts +63 -4
- package/src/routes/agent-tool-detail.test.ts +140 -0
- package/src/routes/public-default.ts +1 -1
- package/src/services/kb-agent.test.ts +84 -0
- package/src/services/kb.ts +73 -0
- package/web/connect/bailing-connect-php.tgz +0 -0
- package/web/connect/bailing-connect-php7.tgz +0 -0
- package/web/console/assets/Accounts-CjIBO3sU.css +1 -0
- package/web/console/assets/Accounts-Dhyw-7wF.js +3 -0
- package/web/console/assets/AgentClients-BA0M26-I.css +1 -0
- package/web/console/assets/AgentClients-DWxb8-ko.js +1 -0
- package/web/console/assets/AgentTasks-DOyxANnx.css +1 -0
- package/web/console/assets/AgentTasks-DUHD4dzr.js +2 -0
- package/web/console/assets/Approvals-Brl-2uJq.css +1 -0
- package/web/console/assets/Approvals-CQx1YWxW.js +1 -0
- package/web/console/assets/Audit--QcdVlMh.js +1 -0
- package/web/console/assets/Audit-DAdmOnIs.css +1 -0
- package/web/console/assets/{BrandLockup-CffORQse.js → BrandLockup-DQcaW4Nt.js} +1 -1
- package/web/console/assets/Channels-DJJU3ksE.css +1 -0
- package/web/console/assets/Channels-cGS5WfQ-.js +105 -0
- package/web/console/assets/ChatEntries-BYpji27B.css +1 -0
- package/web/console/assets/ChatEntries-nh23Iz5O.js +7 -0
- package/web/console/assets/Clients-CX5EeYio.js +3 -0
- package/web/console/assets/Clients-CbZAou8E.css +1 -0
- package/web/console/assets/Cost-C6oQvz9P.css +1 -0
- package/web/console/assets/Cost-DOZfdNS9.js +1 -0
- package/web/console/assets/Credentials--aHs57yV.css +1 -0
- package/web/console/assets/Credentials-sy6W9Sac.js +1 -0
- package/web/console/assets/Diagnostics-CKs27Dnv.css +1 -0
- package/web/console/assets/Diagnostics-CyoM1XrZ.js +1 -0
- package/web/console/assets/Executors-2Upi6bOS.css +1 -0
- package/web/console/assets/Executors-BQqqiFwt.js +1 -0
- package/web/console/assets/HelpTip-DLlhaGQp.js +1 -0
- package/web/console/assets/HelpTip-bbDEyuqV.css +1 -0
- package/web/console/assets/Kb-5R3ce4UU.js +5 -0
- package/web/console/assets/Kb-BM_PYi11.css +1 -0
- package/web/console/assets/{Login-CGgLGTE1.js → Login-YKeUwdgo.js} +1 -1
- package/web/console/assets/Projects-DHwHrPT9.css +1 -0
- package/web/console/assets/Projects-Grgb6fOv.js +1 -0
- package/web/console/assets/Routes-DR_Yf02e.css +1 -0
- package/web/console/assets/Routes-DYgrXlRJ.js +138 -0
- package/web/console/assets/Runs-CwTddJJj.js +3 -0
- package/web/console/assets/Runs-D4FOvNfu.css +1 -0
- package/web/console/assets/Setup-Ca0b1d1-.css +1 -0
- package/web/console/assets/Setup-D_xUPNDq.js +1 -0
- package/web/console/assets/Shell-BTg8Vw_L.css +1 -0
- package/web/console/assets/Shell-Dfam2Uoj.js +1 -0
- package/web/console/assets/StorageBuckets-7QLBpV4a.css +1 -0
- package/web/console/assets/StorageBuckets-CP6e50wI.js +1 -0
- package/web/console/assets/SystemSettings-BRYKyJNa.js +1 -0
- package/web/console/assets/SystemSettings-HsXGx0aH.css +1 -0
- package/web/console/assets/SystemStatus-B-VfRsQd.css +1 -0
- package/web/console/assets/SystemStatus-CbPsDsGt.js +1 -0
- package/web/console/assets/Targets-1j4-g6rC.css +1 -0
- package/web/console/assets/Targets-C2LkR2AF.js +1 -0
- package/web/console/assets/Tools-C9HPJqJb.css +1 -0
- package/web/console/assets/Tools-C9JNJUS0.js +2 -0
- package/web/console/assets/Usage-D1Mv6vGY.js +1 -0
- package/web/console/assets/Usage-DMOzUsqh.css +1 -0
- package/web/console/assets/UsageAccess-77LmGCm6.js +1 -0
- package/web/console/assets/UsageAccess-C6ZGxEgJ.css +1 -0
- package/web/console/assets/{UsageHelp-CzS2gI40.js → UsageHelp-BmuiE1Ew.js} +1 -1
- package/web/console/assets/client-route-draft-DxZRxKPT.js +1 -0
- package/web/console/assets/console-location-Csv-xsnl.js +1 -0
- package/web/console/assets/form-guard-8GrFpry0.js +1 -0
- package/web/console/assets/{index-65JiiUr4.js → index-B_5UfiTw.js} +1 -1
- package/web/console/assets/index-MjZJEFIN.js +2 -0
- package/web/console/assets/{request-DKycpD7z.js → request-rqm6MT0s.js} +1 -1
- package/web/console/assets/runtime-feedback-gPfZVNvY.js +1 -0
- package/web/console/assets/{schema-SCiNxBlR.js → schema-o3mK4mid.js} +1 -1
- package/web/console/assets/task-page-location-DWiGtAln.js +1 -0
- package/web/console/assets/use-list-location-FvLFt0Tq.css +1 -0
- package/web/console/assets/use-list-location-cIPy2cKM.js +1 -0
- package/web/console/assets/use-unsaved-form-DScKD0h9.js +1 -0
- package/web/console/assets/{util-DZYfJ5Zo.js → util-B40VqOwl.js} +1 -1
- package/web/console/assets/{vendor-element-8cVcdt5T.js → vendor-element-BT8tHCFk.js} +1 -1
- package/web/console/assets/{vendor-mammoth-CnDA23N0.js → vendor-mammoth-CVIXVxTN.js} +1 -1
- package/web/console/assets/{vendor-vue-Co7x2FW6.js → vendor-vue-DhbG0vd4.js} +7 -7
- package/web/console/index.html +3 -3
- package/web-admin/package-lock.json +4 -4
- package/web-admin/package.json +1 -1
- package/web-admin/src/client-route-draft.ts +25 -0
- package/web-admin/src/components/AgentSetupPanel.vue +54 -41
- package/web-admin/src/components/HelpTip.vue +4 -1
- package/web-admin/src/components/ListLocationBar.vue +22 -0
- package/web-admin/src/components/NotificationOutboxPanel.vue +35 -7
- package/web-admin/src/console-entry.test.ts +26 -0
- package/web-admin/src/console-entry.ts +20 -0
- package/web-admin/src/console-location.ts +35 -0
- package/web-admin/src/form-guard.ts +35 -0
- package/web-admin/src/layout/Shell.vue +18 -65
- package/web-admin/src/onboarding-state.test.ts +174 -0
- package/web-admin/src/onboarding-state.ts +122 -0
- package/web-admin/src/pages/Accounts.vue +44 -24
- package/web-admin/src/pages/AgentClients.vue +47 -29
- package/web-admin/src/pages/AgentTasks.vue +57 -12
- package/web-admin/src/pages/Approvals.vue +105 -25
- package/web-admin/src/pages/Audit.vue +15 -6
- package/web-admin/src/pages/Channels.vue +136 -43
- package/web-admin/src/pages/ChatEntries.vue +96 -41
- package/web-admin/src/pages/Clients.vue +87 -26
- package/web-admin/src/pages/Cost.vue +15 -4
- package/web-admin/src/pages/Credentials.vue +63 -32
- package/web-admin/src/pages/Diagnostics.vue +103 -54
- package/web-admin/src/pages/Executors.vue +103 -40
- package/web-admin/src/pages/Kb.vue +278 -128
- package/web-admin/src/pages/Projects.vue +44 -16
- package/web-admin/src/pages/Routes.vue +168 -247
- package/web-admin/src/pages/Runs.vue +163 -91
- package/web-admin/src/pages/Setup.vue +182 -291
- package/web-admin/src/pages/StorageBuckets.vue +61 -25
- package/web-admin/src/pages/SystemSettings.vue +76 -51
- package/web-admin/src/pages/SystemStatus.vue +54 -30
- package/web-admin/src/pages/Targets.vue +45 -17
- package/web-admin/src/pages/Tools.vue +133 -68
- package/web-admin/src/pages/Usage.vue +64 -25
- package/web-admin/src/pages/UsageAccess.vue +11 -8
- package/web-admin/src/route-call-snippets.test.ts +82 -0
- package/web-admin/src/route-call-snippets.ts +178 -0
- package/web-admin/src/router.ts +11 -29
- package/web-admin/src/runtime-feedback.ts +43 -0
- package/web-admin/src/task-page-location.ts +66 -0
- package/web-admin/src/usage-output-budget.test.ts +26 -0
- package/web-admin/src/usage-output-budget.ts +46 -0
- package/web-admin/src/use-list-location.ts +24 -0
- package/web-admin/src/use-unsaved-form.ts +38 -0
- package/web-admin/tests/model-output-budget.browser.mjs +69 -0
- package/web/console/assets/Accounts-Bervi5JU.css +0 -1
- package/web/console/assets/Accounts-Dhj6PjXP.js +0 -3
- package/web/console/assets/AgentClients-CMy8StAH.js +0 -1
- package/web/console/assets/AgentClients-i52AI6YV.css +0 -1
- package/web/console/assets/AgentTasks-BsG850Il.css +0 -1
- package/web/console/assets/AgentTasks-DA1xZdmP.js +0 -2
- package/web/console/assets/Approvals-DIsd7R8N.js +0 -1
- package/web/console/assets/Approvals-DlTSHl_7.css +0 -1
- package/web/console/assets/Audit-AUDABLTX.js +0 -1
- package/web/console/assets/Audit-CSu6_3oD.css +0 -1
- package/web/console/assets/Channels-B8rjsM0S.js +0 -105
- package/web/console/assets/Channels-CCn0L1jg.css +0 -1
- package/web/console/assets/ChatEntries-DsYtcXN6.css +0 -1
- package/web/console/assets/ChatEntries-iZjJMEUZ.js +0 -7
- package/web/console/assets/Clients-CSHIsaWU.css +0 -1
- package/web/console/assets/Clients-CwgpGCSD.js +0 -3
- package/web/console/assets/Cost-B2tNxu71.js +0 -1
- package/web/console/assets/Cost-CjT39DSZ.css +0 -1
- package/web/console/assets/Credentials-BuwFB-fV.js +0 -1
- package/web/console/assets/Credentials-ioLP0qYN.css +0 -1
- package/web/console/assets/Diagnostics-Ya05PTDp.css +0 -1
- package/web/console/assets/Diagnostics-z5glms11.js +0 -1
- package/web/console/assets/Executors-Bc4SvjeH.js +0 -1
- package/web/console/assets/Executors-CjhEM54c.css +0 -1
- package/web/console/assets/HelpTip-CA6Bm7Nx.css +0 -1
- package/web/console/assets/HelpTip-Dtdt2tKR.js +0 -1
- package/web/console/assets/Kb-BRbRHxLy.js +0 -5
- package/web/console/assets/Kb-CzIzd9xr.css +0 -1
- package/web/console/assets/Projects-Bm8AjsNx.css +0 -1
- package/web/console/assets/Projects-CPWw3con.js +0 -1
- package/web/console/assets/Routes-CMIaE0Bx.js +0 -124
- package/web/console/assets/Routes-CyXV4Pba.css +0 -1
- package/web/console/assets/Runs-B8HuE700.js +0 -3
- package/web/console/assets/Runs-Bv6CV_Hk.css +0 -1
- package/web/console/assets/Setup-D7nxgn-9.css +0 -1
- package/web/console/assets/Setup-G8RKzliR.js +0 -1
- package/web/console/assets/Shell-DimHgraJ.js +0 -1
- package/web/console/assets/Shell-ykb-tUfo.css +0 -1
- package/web/console/assets/StorageBuckets-CVgpZRWY.css +0 -1
- package/web/console/assets/StorageBuckets-CiVYXIE2.js +0 -1
- package/web/console/assets/SystemSettings-BjiHyrXO.css +0 -1
- package/web/console/assets/SystemSettings-DF8sZNen.js +0 -1
- package/web/console/assets/SystemStatus-BlHywK13.js +0 -1
- package/web/console/assets/SystemStatus-I11I67rw.css +0 -1
- package/web/console/assets/Targets-BXaoPoAJ.js +0 -1
- package/web/console/assets/Targets-DTb5tn6z.css +0 -1
- package/web/console/assets/Tools-B22lNHXq.js +0 -2
- package/web/console/assets/Tools-DU8ei6sd.css +0 -1
- package/web/console/assets/Usage-C02EzoI2.js +0 -1
- package/web/console/assets/Usage-CAeDGjrb.css +0 -1
- package/web/console/assets/UsageAccess-CGGaWTuj.css +0 -1
- package/web/console/assets/UsageAccess-DOb-cyPE.js +0 -1
- package/web/console/assets/index-CK0ZCTZv.js +0 -2
package/README.en.md
CHANGED
|
@@ -29,13 +29,13 @@ You choose which business APIs become available. BailingHub connects the convers
|
|
|
29
29
|
<img src="assets/readme-product-overview.en.svg" width="100%" alt="BailingHub connects conversational entry points to governed business capabilities while the business system remains the authority">
|
|
30
30
|
</picture>
|
|
31
31
|
|
|
32
|
-
## v0.
|
|
32
|
+
## v0.10.1: Preserve explicit false and low declarations
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Business-side SDK generators preserve explicit readonly, idempotency and risk values. Core gives explicit values precedence over the GET fallback. Unspecified fields remain omitted; non-readonly operations without risk still default to medium. PHP7/PHP8 packages gain per-file and actual-generator verification, with matching corrections in the other language generators.
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
This patch is **Core 0.10.1**. ACC **1.0.6 / declaration version: 1**, MCP / Agent Client SDK **0.8.0** and DSH **0.8.0** remain unchanged. There is **no new SQL relative to 0.10.0**. Business owners should review regenerated declarations, especially explicit low write operations previously omitted and explicit false on GET. Approval, authentication and final business authority remain unchanged.
|
|
37
37
|
|
|
38
|
-
[Release notes](docs/RELEASE_NOTES_v0.
|
|
38
|
+
[Release notes](docs/RELEASE_NOTES_v0.10.1.en.md) · [Upgrade guide](docs/UPGRADE_v0.10.1.en.md) · [Business integration](docs/INTEGRATION.en.md) · [Previous release](docs/RELEASE_NOTES_v0.10.0.en.md)
|
|
39
39
|
|
|
40
40
|
## Operate the System by Conversation
|
|
41
41
|
|
|
@@ -125,7 +125,7 @@ To explore before installing, use the [online experience](https://trial.bailingh
|
|
|
125
125
|
To run the complete disposable loop locally:
|
|
126
126
|
|
|
127
127
|
```bash
|
|
128
|
-
git clone --branch v0.
|
|
128
|
+
git clone --branch v0.10.1 --depth 1 https://github.com/bailinghub/bailinghub.git
|
|
129
129
|
cd bailinghub
|
|
130
130
|
export BAILING_TOKEN="${BAILING_TOKEN:-$(openssl rand -hex 32)}"
|
|
131
131
|
docker compose up --build
|
|
@@ -214,7 +214,7 @@ Run separate BailingHub deployments for mutually isolated organizations. A `clie
|
|
|
214
214
|
- [HTTP Contract](docs/CONTRACT.en.md) — stable network and identity boundaries.
|
|
215
215
|
- [Architecture](docs/ARCHITECTURE.en.md) — runtime layers and dependency direction.
|
|
216
216
|
- [English Documentation Map](docs/README.en.md) — the complete public documentation index.
|
|
217
|
-
- [Changelog](docs/CHANGELOG.en.md) and [v0.
|
|
217
|
+
- [Changelog](docs/CHANGELOG.en.md) and [v0.10.1](docs/RELEASE_NOTES_v0.10.1.en.md) — current release changes and upgrade notes.
|
|
218
218
|
|
|
219
219
|
## Feedback and Ecosystem
|
|
220
220
|
|
package/README.md
CHANGED
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
|
|
28
28
|
在线体验环境只用于了解产品和配置方式。请勿上传生产凭据、敏感数据或接入真实业务;正式使用请自行部署开源版。
|
|
29
29
|
|
|
30
|
-
## v0.
|
|
30
|
+
## v0.10.1:明确声明的 false 和 low 不再丢失
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
业务侧 SDK 生成声明时保留显式只读、幂等与风险值;Core 消费时让显式值优先于 GET 缺省信号。未设置字段继续省略,非只读操作未设置 risk 时仍为 medium。PHP7/PHP8 配套包增加逐文件与实际生成器校验,其他语言生成器同步修正。
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
本轮为 **Core 0.10.1** 补丁;ACC 规范 **1.0.6 / 声明 version: 1**、MCP / Agent Client SDK **0.8.0**、DSH **0.8.0** 保持。相对 0.10.0 **无新增 SQL**。业务负责人应核对重新生成的声明,尤其是此前被省略的显式 low 写操作和 GET 的显式 false;审批、鉴权与最终业务权限不变。
|
|
35
35
|
|
|
36
|
-
[版本说明](docs/RELEASE_NOTES_v0.
|
|
36
|
+
[版本说明](docs/RELEASE_NOTES_v0.10.1.md) · [升级指南](docs/UPGRADE_v0.10.1.md) · [业务接入](docs/第三方对接指南.md) · [上一版本](docs/RELEASE_NOTES_v0.10.0.md)
|
|
37
37
|
|
|
38
38
|
## 适合哪些团队
|
|
39
39
|
|
|
@@ -115,7 +115,7 @@ DOCX 解析保留官方 Mammoth 1.12.0 库源码,移除未使用的 CLI 依赖
|
|
|
115
115
|
在本机启动中枢、MySQL、Demo 业务系统、工具源、路由和接入方:
|
|
116
116
|
|
|
117
117
|
```bash
|
|
118
|
-
git clone --branch v0.
|
|
118
|
+
git clone --branch v0.10.1 --depth 1 https://github.com/bailinghub/bailinghub.git
|
|
119
119
|
cd bailinghub
|
|
120
120
|
export BAILING_TOKEN="${BAILING_TOKEN:-$(openssl rand -hex 32)}"
|
|
121
121
|
docker compose up --build
|
|
@@ -199,7 +199,7 @@ BailingHub Core 是独立服务,只通过稳定网络契约与业务系统协
|
|
|
199
199
|
| 集中开启本地智能体与工具 | [四步配置指南](docs/LOCAL_AGENT_SETUP.md) · [系统说明](docs/AGENT_SYSTEM_INFO.md) |
|
|
200
200
|
| 查 API 与边界契约 | [HTTP 契约](docs/CONTRACT.md) · [Client API](docs/CLIENT_API.md) |
|
|
201
201
|
| 理解架构与长期取舍 | [架构](docs/ARCHITECTURE.md) · [项目愿景](VISION.md) |
|
|
202
|
-
| 查看版本变化 | [CHANGELOG](docs/CHANGELOG.md) · [v0.
|
|
202
|
+
| 查看版本变化 | [CHANGELOG](docs/CHANGELOG.md) · [v0.10.1](docs/RELEASE_NOTES_v0.10.1.md) |
|
|
203
203
|
|
|
204
204
|
完整中英文文档地图见 [docs/README.md](docs/README.md)。公共 API、SDK、Schema、Docker Demo 与代码标识保持语言中立。
|
|
205
205
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -152,7 +152,7 @@ The package license texts and copyright notices remain in the installed package
|
|
|
152
152
|
| Console | [typescript](https://www.npmjs.com/package/typescript) | 5.9.3 | Apache-2.0 | runtime |
|
|
153
153
|
| Console | [underscore](https://www.npmjs.com/package/underscore) | 1.13.8 | MIT | runtime |
|
|
154
154
|
| Console | [util-deprecate](https://www.npmjs.com/package/util-deprecate) | 1.0.2 | MIT | runtime |
|
|
155
|
-
| Console | [vite](https://www.npmjs.com/package/vite) | 6.4.
|
|
155
|
+
| Console | [vite](https://www.npmjs.com/package/vite) | 6.4.5 | MIT | build/test |
|
|
156
156
|
| Console | [vue](https://www.npmjs.com/package/vue) | 3.5.43 | MIT | runtime |
|
|
157
157
|
| Console | [vue-component-type-helpers](https://www.npmjs.com/package/vue-component-type-helpers) | 3.3.4 | MIT | runtime |
|
|
158
158
|
| Console | [vue-demi](https://www.npmjs.com/package/vue-demi) | 0.14.10 | MIT | runtime |
|
|
@@ -209,7 +209,7 @@ The package license texts and copyright notices remain in the installed package
|
|
|
209
209
|
| Hub | [duck](https://www.npmjs.com/package/duck) | 0.1.12 | BSD | runtime |
|
|
210
210
|
| Hub | [esbuild](https://www.npmjs.com/package/esbuild) | 0.28.1 | MIT | runtime |
|
|
211
211
|
| Hub | [fast-deep-equal](https://www.npmjs.com/package/fast-deep-equal) | 3.1.3 | MIT | build/test |
|
|
212
|
-
| Hub | [fast-uri](https://www.npmjs.com/package/fast-uri) | 3.1.
|
|
212
|
+
| Hub | [fast-uri](https://www.npmjs.com/package/fast-uri) | 3.1.9 | BSD-3-Clause | build/test |
|
|
213
213
|
| Hub | [fsevents](https://www.npmjs.com/package/fsevents) | 2.3.2 | MIT | build/test |
|
|
214
214
|
| Hub | [fsevents](https://www.npmjs.com/package/fsevents) | 2.3.3 | MIT | runtime |
|
|
215
215
|
| Hub | [generate-function](https://www.npmjs.com/package/generate-function) | 2.3.1 | MIT | runtime |
|
|
@@ -18,7 +18,7 @@ services:
|
|
|
18
18
|
retries: 30
|
|
19
19
|
|
|
20
20
|
demo-business:
|
|
21
|
-
image: ${BAILING_DEMO_BUSINESS_IMAGE:-crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailing-demo-business:0.
|
|
21
|
+
image: ${BAILING_DEMO_BUSINESS_IMAGE:-crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailing-demo-business:0.10.1}
|
|
22
22
|
environment:
|
|
23
23
|
DEMO_HOST: 0.0.0.0
|
|
24
24
|
DEMO_PORT: 19080
|
|
@@ -29,7 +29,7 @@ services:
|
|
|
29
29
|
- "${BAILING_DEMO_PUBLIC_PORT:-19080}:19080"
|
|
30
30
|
|
|
31
31
|
bailinghub:
|
|
32
|
-
image: ${BAILINGHUB_IMAGE:-crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailinghub:0.
|
|
32
|
+
image: ${BAILINGHUB_IMAGE:-crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailinghub:0.10.1}
|
|
33
33
|
depends_on:
|
|
34
34
|
mysql:
|
|
35
35
|
condition: service_healthy
|
|
@@ -50,9 +50,7 @@ the end user to paste a BailingHub Client Token, Tool Provider Secret, or busine
|
|
|
50
50
|
|
|
51
51
|
### 3.1 Deploy Core and apply migrations
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
or a compatible client. Apply all outstanding migrations, including 055–059, as part of the
|
|
55
|
-
deployment; runtime startup does not apply them.
|
|
53
|
+
The current component set is Core 0.10.0, MCP / Agent Client SDK 0.8.0 and DSH 0.8.0 or a compatible host. Complete conversation audit retains its existing protocol; hosts explicitly negotiate on-demand knowledge. Apply all outstanding migrations through 068 as a deployment step. Public 0.9.4 upgrades add no SQL, and runtime startup never applies migrations. See the [upgrade guide](UPGRADE_v0.10.0.en.md).
|
|
56
54
|
Confirm that health and readiness pass, no migration is pending, the console can edit
|
|
57
55
|
Agent Client settings, and production traffic uses HTTPS.
|
|
58
56
|
|
|
@@ -47,7 +47,7 @@ BailingHub Client Token、Tool Provider Secret 或业务系统密码的步骤。
|
|
|
47
47
|
|
|
48
48
|
### 3.1 部署 Core 并执行数据库迁移
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
当前配套为 Core 0.10.0、MCP / Agent Client SDK 0.8.0 与 DSH 0.8.0 或兼容宿主。完整对话归档沿用既有协议,新知识按需交付由宿主显式协商。按账本应用全部未执行迁移(截至 068);从公开 0.9.4 升级没有新增 SQL。由部署步骤显式迁移,运行时启动不会自动迁移;见 [升级指南](UPGRADE_v0.10.0.md)。
|
|
51
51
|
升级后先确认:
|
|
52
52
|
|
|
53
53
|
- `/health` 和 `/health/ready` 正常;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent Client Runtime v1
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Available as an optional capability since Core 0.8.0, [task control](AGENT_TASK_CONTROL.en.md) adds trusted `task_binding` to turns and echoes it. Enrolled Sessions cannot omit it; runtime searches must use the original `run_id`. Read-only inspection and explicit original-operation continuation remain separate.
|
|
4
4
|
|
|
5
5
|
English | [简体中文](AGENT_CLIENT_RUNTIME_API.md)
|
|
6
6
|
|
|
@@ -12,7 +12,9 @@ does not replace `/run`, chat entries, or the executor protocol. See the
|
|
|
12
12
|
|
|
13
13
|
Every endpoint requires `Authorization: Bearer <Agent access token>` and returns
|
|
14
14
|
`Cache-Control: no-store`. The workspace is the intersection of the Client `allowed_routes`, Agent
|
|
15
|
-
Session `allowed_routes`, enabled and audience-compatible routes,
|
|
15
|
+
Session `allowed_routes`, enabled and audience-compatible routes, with `agent_client.enabled`.
|
|
16
|
+
Business tool discovery and execution additionally require `tools.agent_direct`. A knowledge-only
|
|
17
|
+
workspace can bootstrap and prepare a turn with an empty business tool catalog.
|
|
16
18
|
`agent_client.enabled=false` disables this Runtime only; it does not disable the older
|
|
17
19
|
`/agent-api/v1/tools` surface.
|
|
18
20
|
|
|
@@ -22,6 +24,9 @@ Session `allowed_routes`, enabled and audience-compatible routes, and `tools.age
|
|
|
22
24
|
- `GET /agent-api/v1/workspaces/:route/bootstrap`
|
|
23
25
|
- `POST /agent-api/v1/workspaces/:route/turns`
|
|
24
26
|
- `POST /agent-api/v1/workspaces/:route/capabilities/search`
|
|
27
|
+
- `GET /agent-api/v1/workspaces/:route/knowledge/capabilities`
|
|
28
|
+
- `POST /agent-api/v1/workspaces/:route/knowledge/search`
|
|
29
|
+
- `POST /agent-api/v1/workspaces/:route/knowledge/read`
|
|
25
30
|
- `POST /agent-api/v1/runs/:run_id/complete`
|
|
26
31
|
- Tool execution continues to use `POST /agent-api/v1/tool-invocations` and the existing resume
|
|
27
32
|
endpoint.
|
|
@@ -29,6 +34,31 @@ Session `allowed_routes`, enabled and audience-compatible routes, and `tools.age
|
|
|
29
34
|
Raw JSON for `turns` and `complete` is limited to 512 KiB. Parsed values still have strict field
|
|
30
35
|
limits; the service rejects invalid input instead of truncating it silently.
|
|
31
36
|
|
|
37
|
+
Hosts supporting the [Agent knowledge protocol](AGENT_KNOWLEDGE_API.en.md) may explicitly request
|
|
38
|
+
`knowledge_delivery: "on_demand"` in a turn. This option is part of the immutable turn request hash.
|
|
39
|
+
The server echoes the negotiated mode in `context.knowledge_delivery`, retaining instructions,
|
|
40
|
+
governance and memory while replacing supplementary knowledge bodies with bounded hints.
|
|
41
|
+
Absent this option, legacy inline knowledge remains unchanged. Native chat/embed/widget do not
|
|
42
|
+
use this option. Hosts must not silently remove unnegotiated bodies.
|
|
43
|
+
|
|
44
|
+
Tool invocation `arguments` must remain an object. The limit is **1048576 bytes (1 MiB)**,
|
|
45
|
+
measured as UTF-8 bytes of `JSON.stringify(arguments)`, including JSON escaping. The full HTTP
|
|
46
|
+
JSON envelope is limited to **2097152 bytes (2 MiB)**. Executor `/jobs/:job_id/tools/invoke`
|
|
47
|
+
uses the same budgets. These explicit tool budgets are independent of `BAILING_JSON_BODY_MAX_BYTES`;
|
|
48
|
+
other endpoints and business capability field limits remain separate. Composite HTML/CSS fields
|
|
49
|
+
remain objects, subject to the capability schema and business validation.
|
|
50
|
+
|
|
51
|
+
Oversize requests are rejected before dispatch with HTTP 413, `error=arguments_too_large`,
|
|
52
|
+
`origin=core`, `dispatch=not_dispatched`, `limit_scope=arguments|request_body`, and `max_bytes`.
|
|
53
|
+
Argument rejection includes exact `actual_bytes`. Streaming envelope rejection includes
|
|
54
|
+
`observed_bytes`, the bytes observed when reading stopped, which may be less than the full request.
|
|
55
|
+
No body or credential is echoed. Older MCP/SDK clients enforce their own smaller limits and need
|
|
56
|
+
the matching client fix; updating Core alone cannot change installed clients.
|
|
57
|
+
|
|
58
|
+
Complete approval argument snapshots retain the exact idempotency hash. Notifications use bounded
|
|
59
|
+
summaries, and large snapshots are read on demand in the console. Larger transport budgets do not
|
|
60
|
+
bypass identity, authorization, approval, idempotency, or audit checks.
|
|
61
|
+
|
|
32
62
|
## Write and approval semantics
|
|
33
63
|
|
|
34
64
|
`tools.agent_direct.write_tools` exposes exact write operation IDs to the local Agent. Approval
|
|
@@ -160,6 +190,46 @@ owns dynamic tool replacement/append behavior and the current loaded-tool set.
|
|
|
160
190
|
|
|
161
191
|
## Tool invocation and recovery
|
|
162
192
|
|
|
193
|
+
### Read usage guidance by tool name
|
|
194
|
+
|
|
195
|
+
Discovery `description` remains short: the OpenAPI compiler caps it at 500 Unicode code points.
|
|
196
|
+
Optional `usage_guidance_available: true` identifies separate guidance; `description_truncated: true`
|
|
197
|
+
only means the short description itself was shortened, with a `tool_description_truncated` compile
|
|
198
|
+
warning. Separate detail does not imply truncation. When both OpenAPI `summary` and `description`
|
|
199
|
+
are present, both remain in explicit guidance rather than silently discarding `description`.
|
|
200
|
+
|
|
201
|
+
```http
|
|
202
|
+
GET /agent-api/v1/tools/page_save?route=pages&capability_revision=<current-capability-revision>
|
|
203
|
+
Authorization: Bearer <Agent access token>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
The `bailing.agent-tool-detail.v1` response contains `route`, `capability_revision`, the existing
|
|
207
|
+
allowlisted `tool` projection, and `usage_guidance: { text, truncated, source_chars, max_chars,
|
|
208
|
+
source_bytes, max_bytes }`. Scope, risk, approval, readonly and idempotency keep their existing
|
|
209
|
+
machine meanings. Guidance never grants permission or replaces server validation. Detail combines
|
|
210
|
+
only standard summary/description, ACC when-to-use/returns and the first example; it does not expose
|
|
211
|
+
the original spec, extension bag, Provider URL or credentials.
|
|
212
|
+
|
|
213
|
+
Guidance is bounded by both **32768 Unicode code points** and **65536 UTF-8 bytes**, whichever is
|
|
214
|
+
reached first, without splitting characters. Source counts describe the guidance before truncation,
|
|
215
|
+
after control-character cleanup. `truncated: true` means even this detail is incomplete, with a
|
|
216
|
+
`tool_usage_guidance_truncated` compile warning. Authors should shorten guidance and put critical
|
|
217
|
+
conditions first; schema and ACC machine checks continue independently. Catalogs and searches do
|
|
218
|
+
not inline the full guidance.
|
|
219
|
+
|
|
220
|
+
Each read revalidates current Client, Session, route, audience, subject and exact tool authorization.
|
|
221
|
+
A stale revision returns `409 capability_changed`; an unavailable tool returns `404 tool_not_found`.
|
|
222
|
+
This read creates no invocation/job, consumes no approval or execution allowance and makes no
|
|
223
|
+
business request. Responses use `Cache-Control: no-store`. Older clients can ignore optional fields;
|
|
224
|
+
missing fields or an unsupported endpoint on an older server do not prove its short description
|
|
225
|
+
contains all prerequisites.
|
|
226
|
+
|
|
227
|
+
The capability revision includes the compiled public projection and bounded guidance. A compiler
|
|
228
|
+
upgrade that changes descriptions, flags or guidance therefore invalidates discovery caches even
|
|
229
|
+
when the raw spec is unchanged. This discovery revision remains separate from an invocation's
|
|
230
|
+
frozen execution fingerprint: guidance-only changes do not block original approval continuation
|
|
231
|
+
and do not permit automatic redispatch.
|
|
232
|
+
|
|
163
233
|
Invoke only a tool projected by the current bootstrap/search result. Core revalidates the Agent
|
|
164
234
|
Session, route, operation ID, ACC declaration, approval state, limits, and business authorization
|
|
165
235
|
on every invocation. When the result is pending, in progress, or uncertain, resume the original
|
|
@@ -180,6 +250,21 @@ raw business response bodies.
|
|
|
180
250
|
|
|
181
251
|
## Complete
|
|
182
252
|
|
|
253
|
+
Authorization-level execution summaries can use `bailing.authorization-execution-summary.v1`
|
|
254
|
+
inside the existing `content` string. They contain only original invocation IDs, original tool
|
|
255
|
+
names, last-known states, `next_action: "inspect_original"` for unresolved calls, and total/omitted
|
|
256
|
+
counts. New DSH summaries exclude business result text. They are neither a complete audit nor a
|
|
257
|
+
current outcome check, and they do not invent a reference for retrieving full original output.
|
|
258
|
+
|
|
259
|
+
When assembling the next turn's `memory.recent`, Core recognizes this marker only in outbound
|
|
260
|
+
messages and projects allowed fact fields again. It fixes `kind: "authorization_execution_summary"`,
|
|
261
|
+
`source: "agent_client"` and `trust: "reference_only"`: a client-claimed schema does not verify an
|
|
262
|
+
outcome or grant authority. User messages cannot acquire execution provenance by including the
|
|
263
|
+
same marker. Memory limits omit whole invocation records with explicit counts; very small limits
|
|
264
|
+
return an explicit omission notice, never partial JSON. Existing assistant text and immutable
|
|
265
|
+
completion bodies remain compatible. This adds neither user long-term memory nor full-audit
|
|
266
|
+
storage guarantees.
|
|
267
|
+
|
|
183
268
|
```json
|
|
184
269
|
{
|
|
185
270
|
"assistant_message_id": "assistant-message-1",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Agent Client Runtime v1
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Core 0.8.0 起提供的可选[任务控制](AGENT_TASK_CONTROL.md)为 turn 增加宿主 `task_binding` 和原样回显;已加入任务的 Session 不能省略,业务搜索须使用原 `run_id`。原调用只读核对与显式继续分别处理。
|
|
4
4
|
|
|
5
5
|
本版本化接口让已完成 Agent Auth 网页授权的本地智能体在本地承担规划,同时继续复用 BailingHub 的身份重验、工具治理、审批、审计与对话总账。它不替代现有 `/run`、聊天入口或执行器协议。配套的部署、业务授权页和宿主接入步骤见 [Agent Client v1 接入指南](AGENT_CLIENT_QUICKSTART.md),身份授权契约见 [Agent Auth v1](AGENT_AUTH_API.md)。
|
|
6
6
|
|
|
7
|
-
所有接口只接受 `Authorization: Bearer <Agent access token>`,响应均 `Cache-Control: no-store
|
|
7
|
+
所有接口只接受 `Authorization: Bearer <Agent access token>`,响应均 `Cache-Control: no-store`。Runtime 工作区授权面取以下交集:Client `allowed_routes` ∩ Agent Session `allowed_routes` ∩ 启用且 audience 允许的 route,并要求 `agent_client.enabled`。业务工具发现与执行另要求 `tools.agent_direct`;纯知识工作区无需打开业务工具直调,此时bootstrap/turn返回空工具集。`agent_client.enabled=false` 关闭 Runtime 工作区、上下文与能力接口,不关闭旧 `/agent-api/v1/tools`。
|
|
8
8
|
|
|
9
9
|
首次选择业务目标所需的[系统说明](AGENT_SYSTEM_INFO.md)采用同一身份与路由边界,但读取说明不要求开启 Runtime 或工具直调,也不会加载工具或创建业务运行。
|
|
10
10
|
|
|
@@ -15,11 +15,20 @@
|
|
|
15
15
|
- `GET /agent-api/v1/workspaces/:route/bootstrap`
|
|
16
16
|
- `POST /agent-api/v1/workspaces/:route/turns`
|
|
17
17
|
- `POST /agent-api/v1/workspaces/:route/capabilities/search`
|
|
18
|
+
- `GET /agent-api/v1/workspaces/:route/knowledge/capabilities`
|
|
19
|
+
- `POST /agent-api/v1/workspaces/:route/knowledge/search`
|
|
20
|
+
- `POST /agent-api/v1/workspaces/:route/knowledge/read`
|
|
18
21
|
- `POST /agent-api/v1/runs/:run_id/complete`
|
|
19
22
|
- 工具执行继续使用 `POST /agent-api/v1/tool-invocations` 与既有 resume 端点。
|
|
20
23
|
|
|
21
24
|
`turns` 与 `complete` 的原始 JSON 请求上限为 512 KiB。该上限可覆盖 64000 字符 Unicode 文本的 JSON 编码、Turn 的 16 KiB `page_context` 以及合理 envelope;解析后仍按各字段的字符上限严格校验。
|
|
22
25
|
|
|
26
|
+
工具调用的 `arguments` 必须是对象,按 `JSON.stringify(arguments)` 后的 UTF-8 字节数计量,最多 **1048576 字节(1 MiB)**。完整调用 HTTP JSON 信封最多 **2097152 字节(2 MiB)**;执行器的 `/jobs/:job_id/tools/invoke` 使用同一预算。它们是独立于 `BAILING_JSON_BODY_MAX_BYTES` 的工具调用固定安全预算,不改变其他接口或业务能力的字段上限。HTML/CSS 等复合字段继续传对象,由能力 schema 和业务服务独立校验,不能将其改成 JSON 字符串绕过校验。
|
|
27
|
+
|
|
28
|
+
超限在派发前返回 HTTP 413:`error=arguments_too_large`、`origin=core`、`dispatch=not_dispatched`、`limit_scope=arguments|request_body` 和 `max_bytes`。参数超限返回精确的 `actual_bytes`;HTTP 信封的流式读取超限返回 `observed_bytes`,仅代表停止读取前已观察到的字节数,完整请求可能更大。回执不包含正文或凭据。较旧 MCP/SDK 有独立的小上限,需要使用配套修复候选;只升级 Core 不会改变已安装客户端的校验。
|
|
29
|
+
|
|
30
|
+
完整审批参数快照与幂等哈希保持一致,通知只携带有界摘要;大快照在后台按需查看。放宽传输容量不会跳过主体、授权、审批、原调用幂等或审计约束。
|
|
31
|
+
|
|
23
32
|
## 工具审批语义
|
|
24
33
|
|
|
25
34
|
`tools.agent_direct.write_tools` 只负责按精确 operationId 开放本地 Agent 可调用的写工具;工具是否需要审批默认继续以业务侧 ACC 的 `risk`、`approval.required` 和 `approval.when` 声明为准。路由只有把工具精确列入 `tools.agent_direct.force_approval_tools` 时,才会在 ACC 之外额外强制审批。高风险、ACC 明示审批和条件审批不会被路由覆盖掉。
|
|
@@ -92,6 +101,8 @@ Bootstrap 只逐字段抽取 `target_config.system_prompt`,再拼接可选 `ag
|
|
|
92
101
|
|
|
93
102
|
同一 Agent Session + route + conversation + turn,以及同一 `user_message_id`,会冻结到同一个 `run_id` 和上下文快照;同键不同请求返回 `409`。服务端先读取本轮之前的 memory,再把用户可见消息追加到总账。
|
|
94
103
|
|
|
104
|
+
支持[Agent知识按需协议](AGENT_KNOWLEDGE_API.md)的宿主可在turn请求显式添加 `knowledge_delivery: "on_demand"`,该选项计入同turn不可变请求哈希。服务端仅将补充知识正文改为有界提示,保留必要instructions、governance和memory;响应通过 `context.knowledge_delivery` 明确回显协议与模式。无该选项的旧客户端保持原有inline知识正文,自带chat/embed/widget不使用此选项。宿主不得自行删除未协商正文。
|
|
105
|
+
|
|
95
106
|
能力搜索最多返回 12 个完整 typed tools,schema 为 `bailing.agent-capability-search.v1`。检索只在当前授权集内进行;任一工具源的 embedding 不可用时,整次搜索确定性退回 lexical 排序。
|
|
96
107
|
能力搜索必须提供非空 `query`,或者提供属于当前 Agent Session 与 route 的合法 `run_id`,由服务端回退使用该 run 的 `user_input`。
|
|
97
108
|
|
|
@@ -123,12 +134,35 @@ Bootstrap 只逐字段抽取 `target_config.system_prompt`,再拼接可选 `ag
|
|
|
123
134
|
|
|
124
135
|
## 工具调用与恢复
|
|
125
136
|
|
|
137
|
+
### 按名读取工具使用指导
|
|
138
|
+
|
|
139
|
+
发现结果中的 `description` 仍是短说明,OpenAPI 编译上限为 500 个 Unicode 字符。存在独立的完整说明时返回可选 `usage_guidance_available: true`;短说明确实超长时另返回 `description_truncated: true` 并产生 `tool_description_truncated` 编译警告。**有详细指导不等于短说明被截断**。OpenAPI 同时提供 `summary` 和 `description` 时,两者都会保留在按需指导中,原 `description` 不再因存在 `summary` 而丢失。
|
|
140
|
+
|
|
141
|
+
客户端可明确读取当前工具,不需要发起任务或业务调用:
|
|
142
|
+
|
|
143
|
+
```http
|
|
144
|
+
GET /agent-api/v1/tools/page_save?route=pages&capability_revision=<当前能力修订>
|
|
145
|
+
Authorization: Bearer <Agent access token>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
响应为 `bailing.agent-tool-detail.v1`,包含同一 `route`、`capability_revision`、现有白名单投影 `tool`,以及 `usage_guidance: { text, truncated, source_chars, max_chars, source_bytes, max_bytes }`。`tool` 的 scope、风险、审批、只读、幂等等机器字段保持原语义;指导文字不会扩大权限或替代服务端校验。详情只合成标准 `summary`、`description`、ACC `when_to_use` / `returns` 和首个示例,不返回原 spec、扩展袋、Provider 地址或凭据。
|
|
149
|
+
|
|
150
|
+
指导同时受 **32768 个 Unicode code point** 和 **65536 个 UTF-8 字节**限制,先到者生效,保持完整字符。`source_chars` / `source_bytes` 是清理控制字符后的原始指导长度;`truncated: true` 明确表示详情也不完整,并产生 `tool_usage_guidance_truncated` 编译警告。接入方应缩短、前置关键条件;schema / ACC 中的机器约束继续独立执行。响应只按需携带一项指导,目录与搜索不会自动附上全文。
|
|
151
|
+
|
|
152
|
+
每次读取都重新检查当前 Client、Session、route、audience、主体与具体工具授权;旧修订返回 `409 capability_changed`,需重新发现。无当前工具授权返回 `404 tool_not_found`。该只读路径不创建 invocation/job、不消费审批或执行额度、不调用业务接口,且响应 `Cache-Control: no-store`。新增字段可被旧客户端忽略;遇到缺少字段或不支持详情端点的旧服务端时,不能宣称短说明已包含全部前置条件。
|
|
153
|
+
|
|
154
|
+
能力修订同时包含编译后的公开工具投影和有界指导,因此同一份原始 spec 经新编译器产生不同短说明、标记或指导时,也会使客户端缓存失效。该发现修订与 invocation 冻结的执行指纹分开:仅文案/指导变化不阻断原审批调用的恢复,也不会允许自动重复派发。
|
|
155
|
+
|
|
126
156
|
工具已经尝试发送、但网络中断或响应正文丢失时,Core 返回 `reconciliation_required` 和 `auto_retry_allowed: false`;只读和声明幂等的工具也不能被标为 `rejected_before_dispatch`。该状态表示尚无可信结果,不证明业务已经执行或尚未执行。
|
|
127
157
|
|
|
128
158
|
客户端必须保留原 `invocation_id` 及授权关联,使用现有 resume 恢复原调用。Core 重新验证当前授权并回放已保存的结果,不重新派发;结果仍不确定时需要人工核实,不能新建库存调整、订单更新等操作,也不能切换授权或改用另一工具重复执行。重新发现工具与恢复业务调用是两个动作。原审批和执行日志机制保持不变。
|
|
129
159
|
|
|
130
160
|
## Complete
|
|
131
161
|
|
|
162
|
+
授权级执行摘要可在既有 `content` 字符串中使用 `bailing.authorization-execution-summary.v1`:仅包含原 `invocation_id`、原工具名、`last_known_state`、未决调用的 `next_action: "inspect_original"`,以及 `total_invocations` / `omitted_invocations`。DSH 的新投影不把业务响应原文写入这份摘要;它也不是完整审计、当前结果验证或原文读取引用。
|
|
163
|
+
|
|
164
|
+
Core 装配下一轮 `memory.recent` 时,仅对出站消息识别该标识,重新白名单投影并固定标注 `kind: "authorization_execution_summary"`、`source: "agent_client"`、`trust: "reference_only"`。这是客户端报告的历史事实,标识本身不证明权限或结果;普通用户消息不会因出现同标识而获得执行来源。预算不足时按完整调用条目省略并标注数量;极小预算返回明确的省略说明,均不会产出半段 JSON。旧普通 assistant 正文保持兼容,既有 completion 幂等正文不会被静默改写;不新增用户长期记忆或审计全文存储承诺。
|
|
165
|
+
|
|
132
166
|
```json
|
|
133
167
|
{
|
|
134
168
|
"assistant_message_id": "assistant-message-1",
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Agent knowledge search and read
|
|
2
|
+
|
|
3
|
+
[简体中文](AGENT_KNOWLEDGE_API.md) | [Runtime API](AGENT_CLIENT_RUNTIME_API.en.md)
|
|
4
|
+
|
|
5
|
+
Optional protocol `bailing.agent-knowledge.v1` applies only to Agent Clients. Native chat,
|
|
6
|
+
embed and widget keep existing server-side retrieval and body injection. Knowledge is
|
|
7
|
+
`reference_only`: it does not replace instructions, permissions, approvals or business receipts.
|
|
8
|
+
|
|
9
|
+
All endpoints require the current Agent bearer, revalidate Client/Session/route/audience and
|
|
10
|
+
`agent_client.enabled`, and return `Cache-Control: no-store`. Knowledge-only routes do not
|
|
11
|
+
require direct business tools. The client cannot supply KB IDs or document IDs.
|
|
12
|
+
|
|
13
|
+
## Negotiation
|
|
14
|
+
|
|
15
|
+
`GET /agent-api/v1/workspaces/:route/knowledge/capabilities` returns schema
|
|
16
|
+
`bailing.agent-knowledge-capabilities.v1`, protocol, supported, route, enabled,
|
|
17
|
+
knowledge_scope_revision, delivery_modes (`inline`, `on_demand`) and limits:
|
|
18
|
+
search_max_results=3, search_max_bytes=4096, read_default_bytes=16384,
|
|
19
|
+
read_max_bytes=32768, reference_ttl_seconds=300, read_chain_max_bytes=131072.
|
|
20
|
+
|
|
21
|
+
After explicit support negotiation, a trusted host may request `knowledge_delivery: "on_demand"`
|
|
22
|
+
in a new turn. The option is part of the immutable request hash. Core keeps knowledge and
|
|
23
|
+
knowledge_refs as empty arrays and echoes context.knowledge_delivery with schema_version
|
|
24
|
+
`bailing.agent-knowledge-delivery.v1`, mode, protocol, scope revision, status and bounded hints.
|
|
25
|
+
Instructions, governance and memory remain. Legacy requests without the option retain inline
|
|
26
|
+
bodies. Do not silently strip bodies when negotiation fails. Old endpoint 404/405/501 may fall
|
|
27
|
+
back to inline; authorization/server errors and unknown schemas must not pretend success.
|
|
28
|
+
|
|
29
|
+
## Search
|
|
30
|
+
|
|
31
|
+
`POST /agent-api/v1/workspaces/:route/knowledge/search` accepts
|
|
32
|
+
`{query, limit?, run_id?}`. Nonempty query is at most 2000 characters; limit is 1–3. An optional
|
|
33
|
+
run must be current, owned by this Session/client/route and context_ready. Managed tasks retain
|
|
34
|
+
their membership and active-state checks. Server-only turn preparation may issue run-bound
|
|
35
|
+
hints before finalization; the public endpoint cannot access preparing runs.
|
|
36
|
+
|
|
37
|
+
Schema `bailing.agent-knowledge-search.v1` returns route, optional run_id, knowledge_scope_revision,
|
|
38
|
+
status, trust=reference_only, hints and truncated. Each hint has ref, title, summary, revision,
|
|
39
|
+
score and expires_at. Summaries are bounded excerpts from actual current hits, not model output.
|
|
40
|
+
The entire JSON response is at most 4096 UTF-8 bytes and up to three distinct parent documents.
|
|
41
|
+
No knowledge body, memory or business schemas are included.
|
|
42
|
+
|
|
43
|
+
Status distinguishes ok (including zero matches), disabled, unavailable and partial. Do not call
|
|
44
|
+
retrieval failure “no knowledge”. Respect route thresholds; scores are not relevance probabilities.
|
|
45
|
+
Agent retrieval validates fresh index hits against current ready documents, ownership and exact
|
|
46
|
+
chunk content without changing native retrieval/cache behavior. Cross-model ranking remains an
|
|
47
|
+
approximation. No invocation/job or business dispatch is created.
|
|
48
|
+
|
|
49
|
+
## Read
|
|
50
|
+
|
|
51
|
+
`POST /agent-api/v1/workspaces/:route/knowledge/read` accepts
|
|
52
|
+
`{ref, run_id?, cursor?, max_bytes?}`. Reuse exactly the same run and original opaque cursor.
|
|
53
|
+
Schema `bailing.agent-knowledge-read.v1` returns route, optional run_id, knowledge_scope_revision,
|
|
54
|
+
ref, revision, title, content, trust, next_cursor, truncated, budget_exhausted,
|
|
55
|
+
total_content_bytes and read_chain_max_bytes.
|
|
56
|
+
|
|
57
|
+
Full JSON UTF-8 response budget defaults to 16384 bytes, accepts 4096–32768, and preserves Unicode
|
|
58
|
+
characters. Follow next_cursor when non-null. A reference reading chain exposes at most 128 KiB
|
|
59
|
+
of body: its last page explicitly has truncated=true, budget_exhausted=true and next_cursor=null
|
|
60
|
+
if the source exceeds that limit. This is not a per-turn total budget or a complete-source claim.
|
|
61
|
+
|
|
62
|
+
References/cursors use domain-separated HMAC under the existing server token, with a five-minute
|
|
63
|
+
TTL and no migration/new configuration. References bind Client, Session, principal/on_behalf_of,
|
|
64
|
+
route, optional run, full knowledge configuration and SHA-256 of title/body. Every read revalidates
|
|
65
|
+
current identity, scope, task state, KB enabled state, document ownership, ready state and revision.
|
|
66
|
+
Shared-key processes can validate references; key rotation requires a new search.
|
|
67
|
+
|
|
68
|
+
Errors: knowledge_reference_invalid (400, including cross-identity), knowledge_reference_expired
|
|
69
|
+
(410), knowledge_scope_changed (409), knowledge_changed (409), knowledge_unavailable (503).
|
|
70
|
+
Search again when references change; never substitute a new body for an old revision or replay
|
|
71
|
+
a business write to repair knowledge retrieval. Errors do not include body, credentials or SQL.
|
|
72
|
+
|
|
73
|
+
Hosts expose separate knowledge search/read tools, keep hints visible, isolate caches by current
|
|
74
|
+
authorization and turn, reject late responses, and preserve reference-only provenance. Existing
|
|
75
|
+
named-context delivery confirmation only addresses duplicate assembly; it does not replace
|
|
76
|
+
knowledge authorization or retrieval. Required business preconditions must also live in capability
|
|
77
|
+
guidance and server validation.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Agent知识按需搜索与读取
|
|
2
|
+
|
|
3
|
+
[English](AGENT_KNOWLEDGE_API.en.md) | [Runtime契约](AGENT_CLIENT_RUNTIME_API.md)
|
|
4
|
+
|
|
5
|
+
这是Agent Session专用的可选协议 `bailing.agent-knowledge.v1`。它只改变智能体客户端的补充知识交付,自带聊天、embed和widget继续由服务端按原配置自动检索并装配知识正文。知识是 `reference_only`,不能替代路由规则、能力机器约束、授权、审批、业务回执或未知调用核对。
|
|
6
|
+
|
|
7
|
+
## 协商与兼容
|
|
8
|
+
|
|
9
|
+
先以当前Agent bearer读取:
|
|
10
|
+
|
|
11
|
+
```http
|
|
12
|
+
GET /agent-api/v1/workspaces/:route/knowledge/capabilities
|
|
13
|
+
Authorization: Bearer <Agent access token>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
响应schema为 `bailing.agent-knowledge-capabilities.v1`,包含 `protocol`、`supported: true`、`route`、`enabled`、`knowledge_scope_revision`、`delivery_modes: ["inline", "on_demand"]` 和固定 `limits`:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"search_max_results": 3,
|
|
21
|
+
"search_max_bytes": 4096,
|
|
22
|
+
"read_default_bytes": 16384,
|
|
23
|
+
"read_max_bytes": 32768,
|
|
24
|
+
"reference_ttl_seconds": 300,
|
|
25
|
+
"read_chain_max_bytes": 131072
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`supported`表示协议存在;`enabled`表示配置了知识来源且知识服务可用,不保证全部来源此刻都能检索。旧Core的404/405/501可视为不支持并保持inline,401/403/5xx及未知schema不能冒充成功。
|
|
30
|
+
|
|
31
|
+
仅显式支持协议的宿主可在新turn请求添加 `knowledge_delivery: "on_demand"`。服务端保留 `context.knowledge` / `knowledge_refs` 两个空数组,另回显:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"knowledge_delivery": {
|
|
36
|
+
"schema_version": "bailing.agent-knowledge-delivery.v1",
|
|
37
|
+
"mode": "on_demand",
|
|
38
|
+
"protocol": "bailing.agent-knowledge.v1",
|
|
39
|
+
"knowledge_scope_revision": "<sha256>",
|
|
40
|
+
"status": "ok",
|
|
41
|
+
"hints": []
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
必要instructions、governance、memory和工具schema保持独立。无选项的旧客户端仍获原有有界正文。模式计入turn请求哈希,同turn切模式返回冲突;丢响应后应重试原选项,不创建新业务调用。这里没有 `off/hint/full` 参数,也不把旧轮内序号 `knowledge:1` 升为可读引用。
|
|
47
|
+
|
|
48
|
+
## 独立搜索
|
|
49
|
+
|
|
50
|
+
```http
|
|
51
|
+
POST /agent-api/v1/workspaces/:route/knowledge/search
|
|
52
|
+
Content-Type: application/json
|
|
53
|
+
|
|
54
|
+
{"query":"退款窗口设为0会怎样?","limit":3,"run_id":"<当前run UUID>"}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`query`非空、最多2000字符;`limit`为1–3。`run_id`可省略用于未加入受管理任务的会话;给出时必须属于当前Session/client/route且处于活跃context_ready状态。受管理任务沿用其成员和任务状态约束。内部turn装配可在preparing阶段生成同run提示,公开端点不能读取未就绪run。
|
|
58
|
+
|
|
59
|
+
结果schema为 `bailing.agent-knowledge-search.v1`,含route、可选run_id、独立 `knowledge_scope_revision`、`trust: "reference_only"`、`status`、`hints`和`truncated`。每个hint仅含 `ref`、`title`、`summary`、`revision`、`score`、`expires_at`;摘要来自当前有效命中片段的有界摘录,没有调用模型生成摘要。最多3篇父文档,整个JSON UTF-8最多4096字节,可能因预算少于3篇。不会附正文、memory、业务工具schema或连接凭据。
|
|
60
|
+
|
|
61
|
+
`status=ok`且hints为空表示本次无符合路由阈值的命中;`disabled`表示未配置;`unavailable`表示无法检索;`partial`表示部分库不可用。检索错误不能描述成“知识库没有资料”。相似度分数不是相关概率,也不为凑满数量降低路由阈值。知识搜索无需开启业务工具直调,不创建invocation/job或派发业务。
|
|
62
|
+
|
|
63
|
+
Agent专用检索读取当前索引并回查当前ready文档、归属及命中片段,不复用原生聊天的索引缓存。多个库按现有分数近似合并;跨模型分数不能视为统一概率,本批未更换召回算法。
|
|
64
|
+
|
|
65
|
+
## 按引用分页读取
|
|
66
|
+
|
|
67
|
+
```http
|
|
68
|
+
POST /agent-api/v1/workspaces/:route/knowledge/read
|
|
69
|
+
Content-Type: application/json
|
|
70
|
+
|
|
71
|
+
{"ref":"<搜索返回的ref>","run_id":"<同一个run UUID>","max_bytes":16384}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
响应schema为 `bailing.agent-knowledge-read.v1`,包含route、可选run_id、knowledge_scope_revision、原ref、revision、title、content、trust、`next_cursor`、`truncated`、`budget_exhausted`、`total_content_bytes`、`read_chain_max_bytes`。下一页传同ref、同run和原样 `cursor`,不自行推导偏移。
|
|
75
|
+
|
|
76
|
+
`max_bytes`为4096–32768,默认16384,按完整响应JSON UTF-8字节计量,保持Unicode完整字符。`next_cursor`非空表示可继续;引用读取链正文最多128KiB,超过时最后一页 `truncated=true`、`budget_exhausted=true`、`next_cursor=null`。这不表示已读完整原文;客户端应说明资料不完整,不能无限翻页或把该上限说成每轮总用量限制。
|
|
77
|
+
|
|
78
|
+
引用和分页游标由现有server token域分离HMAC签名,自包含、5分钟有效,无新配置或迁移;相同实例密钥的进程可核验,密钥轮换后需重新搜索。引用绑定Client、Session、主体/on_behalf_of、route、可选run、完整知识配置及文档标题/正文SHA256修订。引用不是授权凭据,每次读取都重新检查当前身份、路由、任务、KB启用状态、归属、ready状态与文档修订。客户端不得传任意kb_ids/doc_id扩大范围。
|
|
79
|
+
|
|
80
|
+
篡改或跨身份引用返回 `400 knowledge_reference_invalid`;过期返回 `410 knowledge_reference_expired`;知识配置变化返回 `409 knowledge_scope_changed`;文档更新、删除或停用返回 `409 knowledge_changed`;服务不可用返回 `503 knowledge_unavailable`。需要重新搜索,不静默用新版正文替换旧ref,不重放业务写操作。响应均 `Cache-Control: no-store`,错误不包含内部地址、凭据、SQL或文档正文。
|
|
81
|
+
|
|
82
|
+
## 宿主职责
|
|
83
|
+
|
|
84
|
+
给模型独立的知识search/read工具和简短可见说明;工具发现不应强制读取文档,规则问答也不应被迫执行业务工具。将hint、分页正文保留为当前授权的参考资料,不能提升为system治理。根据回显模式和状态装配,不按空数组猜测“没有知识”。跨轮、换账号、换授权、换route或声明变化时隔离/失效缓存,并拒绝迟到响应污染当前上下文。
|
|
85
|
+
|
|
86
|
+
已有宿主命名context交付确认仍只解决重复装配;它不会代替本协议的搜索、读取或当前引用授权。必要业务前提必须同时由能力指导和服务端校验承载,不能只藏在可选知识里。
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
- **继续**:恢复原任务可派发状态,不增加额度、不变更成员,也不会自动执行任何业务调用。审批已通过的操作仍需显式继续原 `invocation_id`。
|
|
35
35
|
- **取消**:终止后续派发,不能重新开启,也不会回滚已经发生的业务变化。
|
|
36
36
|
- **原成员失效**:任一成员撤销、身份变化或绑定变化,整组阻断;不缩成剩余子集,不换默认授权。
|
|
37
|
-
- **结果不明**:只核对原调用。不能换 ID
|
|
37
|
+
- **结果不明**:只核对原调用。不能换 ID、换授权、重建任务或改用另一个工具重新发出同一写操作。当前实现不会自动向业务系统查询补证,也不自动释放未知许可。
|
|
38
38
|
|
|
39
39
|
审批单消费、原调用派发标记、任务许可和执行 journal 在同一 MySQL 事务提交;之后才发出 HTTP。可信响应与额度结算也同事务保存。审计降级或传输不确定会保留明确的不确定状态,不能当成业务成功。
|
|
40
40
|
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
|
|
67
67
|
SDK 增量方法为 `getTaskControlCapabilities`、`getTask` 和 `startTurn(..., { taskBinding })`。DSH 提供宿主 `setSessionTaskBinding/getSessionTaskState/restoreSessionTaskBinding` 及 CAS 存储接缝;精确签名以配套 DSH 的 `docs/TASK_CONTROL.md` 为准。模型不获得管理员 Token、创建任务、改额度或解除暂停的工具。沿用已选授权、跨轮工具缓存和原调用持久 journal;新操作使用本轮真实 run,恢复操作使用原 run / invocation。
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
当前实现限同一 Hub 和同一审计域。不同 Hub 的预算、正文转发和权限不能自动合并。
|
|
70
70
|
|
|
71
71
|
## 管理接口
|
|
72
72
|
|
|
@@ -79,7 +79,7 @@ SDK 增量方法为 `getTaskControlCapabilities`、`getTask` 和 `startTurn(...,
|
|
|
79
79
|
| `GET /admin/api/agent-tasks/{task_id}?limit=30&before=...` | `{task,invocations,next_cursor}`;原调用按稳定 job ID 分页。 |
|
|
80
80
|
| `POST /admin/api/agent-tasks/{task_id}/control` | `{request_id,expected_revision,action}`,`action=pause/resume/cancel`,返回快照。 |
|
|
81
81
|
|
|
82
|
-
`members` 每项为 `{session_id,client_app_id,workspace,client_conversation_id,allowed_tools}`;工具只允许精确名称。`policy` 为 `{max_write_calls,max_concurrent,expires_at}`,截止时间可为 `null
|
|
82
|
+
`members` 每项为 `{session_id,client_app_id,workspace,client_conversation_id,allowed_tools}`;工具只允许精确名称。`policy` 为 `{max_write_calls,max_concurrent,expires_at}`,截止时间可为 `null`。成员与策略创建后冻结,当前实现不支持直接编辑。
|
|
83
83
|
|
|
84
84
|
创建与控制必须保留同一逻辑请求的 `request_id`,丢失确认时重试原请求。控制使用 CAS;修订冲突先刷新并请操作者重新判断,不能自动换修订号重放操作。后台只展示原关联、状态和计数,任务接口不返回工具参数或业务正文。
|
|
85
85
|
|
|
@@ -89,6 +89,6 @@ SDK 增量方法为 `getTaskControlCapabilities`、`getTask` 和 `startTurn(...,
|
|
|
89
89
|
|
|
90
90
|
`TASK_DISPATCH_UNCERTAIN` 以及 invoke/resume 的 `TASK_UNAVAILABLE` 由配套 SDK 保守标成原调用结果未知,指导 `inspect_original`,不建议新写。旧 Core 404/405/501 能力协商为明确不支持;网络问题不能冒充“不支持”。旧 SDK/DSH 可继续使用**未加入任务**的授权,但不能执行已强制任务的 Session。
|
|
91
91
|
|
|
92
|
-
数据库需要既有 `062_agent_task_control.sql`
|
|
92
|
+
数据库需要既有 `062_agent_task_control.sql` 的六张表,本次接线不增加后续迁移。全未迁移时任务能力不支持;部分表缺失或数据库故障必须阻断,不降级绕过。正式部署需先备份并核对当前数据库、配套制品和宿主兼容性;本地测试通过不代表已经部署。启用任务后不要回退到不认识强制标记的旧 Core,也不要删除标记或任务表作为回滚手段。
|
|
93
93
|
|
|
94
94
|
Core 的可复现检查:`npm run typecheck`、`npm test`。真实事务/HTTP 验收通过显式 `BAILING_TASK_TEST_MYSQL_CONFIG` 指向专用 loopback 临时数据库,再运行 `src/routes/agent-task-control-http-mysql.test.ts` 与任务仓储的 MySQL 测试。禁止将该测试指向业务数据库。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Task control: persistence foundation
|
|
2
2
|
|
|
3
|
-
Historical foundation notes. The
|
|
3
|
+
Historical foundation notes. The Core 0.8.0 paired release connects the actual runtime, HTTP, SDK/DSH and console; see [Task control](AGENT_TASK_CONTROL.en.md). The limitations below describe the earlier foundation slice only.
|
|
4
4
|
|
|
5
5
|
Status: internal implementation foundation. It is **not connected to the HTTP APIs,
|
|
6
6
|
tool runtime, SDK, DSH, or console**. Applying the new SQL alone does not enforce a
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -693,10 +693,14 @@ route、target、tool provider、delivery、channel、storage bucket 等配置
|
|
|
693
693
|
|
|
694
694
|
`config-diagnostics` 是运行期巡检:启动时检查配置结构、跨表引用、凭证用途、禁用资源引用、工具检索坐标系、知识库与渠道依赖,并写入 `config_diagnostics` 审计。后台只读 API `GET /admin/api/config-diagnostics` 可随时触发同款巡检。
|
|
695
695
|
|
|
696
|
+
系统状态页使用受 `audit:read` 保护的 `GET /admin/api/readiness`:复用 `/readyz` 的实际状态库、配置库连接及迁移校验检查,并附带 `checked_at`。接口成功取得报告时返回 HTTP 200,是否就绪以 `ready` 为准;这与公开 `/readyz` 的 HTTP 就绪信号不同。`/admin/api/version` 的迁移数量仅表示配置库账本,不独立证明实例就绪,也不代表物理 DDL 或外部业务链路已经验证。页面分别处理读取失败、空结果和旧快照,刷新失败不会沿用“当前通过”结论。
|
|
697
|
+
|
|
696
698
|
后续控制台新增配置页时,应优先消费这些 schema 生成字段、默认校验和错误提示,再补充跨表引用、密钥掩码这类运行期规则。
|
|
697
699
|
|
|
698
700
|
### 7.3 Trace 已成为单 Job 追溯入口
|
|
699
701
|
|
|
702
|
+
后台任务详情及 `trace.job` 的 `console_execution` 只描述交互边界:Agent 直调回原客户端继续,结果不明先核对原调用,在途任务等待结果。`rerun.available` 不授予权限,实际重跑仍受后台权限和服务端规则校验。审批列表的 `continuation_mode`、`continuation_pending`、`job_status` 分别描述续办方式、恢复状态与原任务状态;`used_at` 仅代表批准已使用,不能单独证明业务成功。旧接口未提供这些字段时,控制台保守提示核对,不推定自动执行。
|
|
703
|
+
|
|
700
704
|
开源产品最需要的是一个 `job_id` 查全链。当前 `/admin/api/runs/:job/trace` 已聚合 job、trace events、审批意图和会话总账,控制台「任务 → 追溯」可以直接输入 job_id 查看:
|
|
701
705
|
|
|
702
706
|
```text
|