bailinghub 0.7.0 → 0.9.0

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.
Files changed (263) hide show
  1. package/README.en.md +7 -9
  2. package/README.md +7 -9
  3. package/docker-compose.images.yml +2 -2
  4. package/docs/AGENT_CLIENT_RUNTIME_API.en.md +46 -0
  5. package/docs/AGENT_CLIENT_RUNTIME_API.md +34 -0
  6. package/docs/AGENT_TASK_CONTROL.en.md +25 -0
  7. package/docs/AGENT_TASK_CONTROL.md +94 -0
  8. package/docs/AGENT_TASK_CONTROL_FOUNDATION.md +134 -0
  9. package/docs/ARCHITECTURE.md +1 -1
  10. package/docs/CHANGELOG.en.md +22 -1
  11. package/docs/CHANGELOG.md +22 -1
  12. package/docs/COMPATIBILITY.en.md +6 -0
  13. package/docs/CONTRACT.en.md +2 -0
  14. package/docs/CONTRACT.md +2 -0
  15. package/docs/GENERATED_ARTIFACTS.en.md +46 -0
  16. package/docs/GENERATED_ARTIFACTS.md +108 -0
  17. package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
  18. package/docs/INDEPENDENT_VALIDATION.md +4 -4
  19. package/docs/INVOCATION_RECEIPTS.md +111 -0
  20. package/docs/MODEL_BILLING.en.md +123 -0
  21. package/docs/MODEL_BILLING.md +125 -0
  22. package/docs/PERIOD_ALLOWANCE_UPGRADE.en.md +31 -0
  23. package/docs/PERIOD_ALLOWANCE_UPGRADE.md +31 -0
  24. package/docs/README.en.md +7 -0
  25. package/docs/README.md +7 -0
  26. package/docs/RELEASE_NOTES_NEXT.en.md +4 -2
  27. package/docs/RELEASE_NOTES_NEXT.md +4 -2
  28. package/docs/RELEASE_NOTES_v0.8.0.en.md +40 -0
  29. package/docs/RELEASE_NOTES_v0.8.0.md +62 -0
  30. package/docs/RELEASE_NOTES_v0.9.0.en.md +45 -0
  31. package/docs/RELEASE_NOTES_v0.9.0.md +45 -0
  32. package/docs/TOOL_RATE_LIMITS.md +50 -0
  33. package/docs/UPGRADE_v0.8.0.en.md +71 -0
  34. package/docs/UPGRADE_v0.8.0.md +73 -0
  35. package/docs/UPGRADE_v0.9.0.en.md +54 -0
  36. package/docs/UPGRADE_v0.9.0.md +54 -0
  37. package/docs//345/205/274/345/256/271/346/200/247/344/270/216/345/215/207/347/272/247.md +6 -0
  38. package/package.json +1 -1
  39. package/schemas/config/route.schema.json +1 -0
  40. package/schemas/config/tool-provider.schema.json +2 -1
  41. package/scripts/check-doc-links.mjs +5 -0
  42. package/scripts/check-image-tags.sh +1 -1
  43. package/scripts/check-release-consistency.test.mjs +2 -2
  44. package/scripts/e2e-console.mjs +32 -2
  45. package/scripts/install.sh +1 -1
  46. package/scripts/publish-images.sh +1 -1
  47. package/scripts/release-audit.mjs +2 -0
  48. package/scripts/sdk-runtime-test.mjs +6 -0
  49. package/scripts/verify-billing-install-upgrade.mjs +225 -0
  50. package/scripts/verify-github-repo.mjs +2 -0
  51. package/sdk/node/README.md +17 -0
  52. package/sdk/node/examples/billing.mjs +21 -0
  53. package/sdk/node/package.json +5 -1
  54. package/sdk/node/src/index.mjs +2 -0
  55. package/sdk/node/src/usage.d.mts +74 -0
  56. package/sdk/node/src/usage.mjs +62 -0
  57. package/sdk/node/tests/usage-types.mts +23 -0
  58. package/sdk/node/tests/usage.test.mjs +81 -0
  59. package/sdk/php7/README.md +19 -2
  60. package/sdk/php7/examples/billing.php +27 -0
  61. package/sdk/php7/examples/well-known.php +1 -1
  62. package/sdk/php7/src/ToolSpec.php +1 -1
  63. package/sdk/php7/src/UsageClient.php +95 -0
  64. package/sdk/php7/src/UsageClientException.php +22 -0
  65. package/sdk/php7/tests/billing-core-http.php +59 -0
  66. package/sdk/php7/tests/usage-client.php +78 -0
  67. package/sql/060_agent_artifacts.sql +11 -0
  68. package/sql/061_tool_rate_limit_policies.sql +3 -0
  69. package/sql/062_agent_task_control.sql +92 -0
  70. package/sql/063_usage_model_billing.sql +153 -0
  71. package/sql/064_period_plan_allowance.sql +25 -0
  72. package/sql/README.en.md +12 -4
  73. package/sql/README.md +14 -6
  74. package/src/adapters/storage/object-storage.ts +15 -3
  75. package/src/adapters/storage/oss-signature.test.ts +40 -0
  76. package/src/adapters/storage/oss-signature.ts +21 -0
  77. package/src/app/agent-artifacts.test.ts +165 -0
  78. package/src/app/agent-artifacts.ts +85 -0
  79. package/src/app/agent-client-runtime.test.ts +76 -1
  80. package/src/app/agent-client-runtime.ts +13 -0
  81. package/src/app/agent-invocation-snapshot.ts +35 -0
  82. package/src/app/agent-task-control.ts +187 -0
  83. package/src/app/agent-task-runtime.ts +68 -0
  84. package/src/app/agent-tool-invocations.test.ts +329 -1
  85. package/src/app/agent-tool-invocations.ts +223 -10
  86. package/src/app/agent-tool-job.test.ts +11 -1
  87. package/src/app/agent-tool-job.ts +8 -1
  88. package/src/app/auth.ts +2 -0
  89. package/src/app/builtin-tools.ts +4 -0
  90. package/src/app/oss-edition.ts +2 -0
  91. package/src/app/tool-approvals.ts +4 -0
  92. package/src/app/tool-assembly.ts +5 -0
  93. package/src/core/config/artifact-config.ts +15 -0
  94. package/src/core/config/config-codec.ts +3 -1
  95. package/src/core/config/config-models.ts +11 -1
  96. package/src/core/config/route-config.ts +3 -2
  97. package/src/core/contracts/tool-rate-limits.test.ts +59 -0
  98. package/src/core/contracts/tool-rate-limits.ts +48 -0
  99. package/src/core/contracts/tools.ts +122 -43
  100. package/src/core/contracts/types.ts +3 -1
  101. package/src/core/runtime/agent-task-control.test.ts +114 -0
  102. package/src/core/runtime/agent-task-control.ts +227 -0
  103. package/src/infrastructure/config/config-agent-artifact-repository.ts +32 -0
  104. package/src/infrastructure/config/config-agent-client-runtime-repository.ts +7 -1
  105. package/src/infrastructure/config/config-agent-task-control-journal-mysql.test.ts +315 -0
  106. package/src/infrastructure/config/config-agent-task-control-mysql.test.ts +331 -0
  107. package/src/infrastructure/config/config-agent-task-control-repository.ts +640 -0
  108. package/src/infrastructure/config/config-rate-limit-ledger.integration.test.ts +52 -0
  109. package/src/infrastructure/config/config-rate-limit-ledger.ts +48 -0
  110. package/src/infrastructure/config/config-storage-bucket-repository.ts +2 -2
  111. package/src/infrastructure/config/config-tool-provider-repository.ts +4 -4
  112. package/src/infrastructure/config/configstore.ts +15 -1
  113. package/src/modules/usage/allowance-reset.mysql.test.ts +122 -0
  114. package/src/modules/usage/billing-contracts.ts +59 -0
  115. package/src/modules/usage/billing-decimal.test.ts +22 -0
  116. package/src/modules/usage/billing-decimal.ts +36 -0
  117. package/src/modules/usage/billing-external.ts +39 -0
  118. package/src/modules/usage/billing-gateway.mysql.test.ts +24 -0
  119. package/src/modules/usage/billing-ledger.test.ts +51 -0
  120. package/src/modules/usage/billing-ledger.ts +104 -0
  121. package/src/modules/usage/billing-presentation.mysql.test.ts +95 -0
  122. package/src/modules/usage/billing-presentation.test.ts +49 -0
  123. package/src/modules/usage/billing-presentation.ts +34 -0
  124. package/src/modules/usage/billing-prices.mysql.test.ts +88 -0
  125. package/src/modules/usage/billing-repository.mysql.test.ts +181 -0
  126. package/src/modules/usage/billing-repository.ts +463 -0
  127. package/src/modules/usage/contracts.ts +49 -0
  128. package/src/modules/usage/dynamic-plan-models.mysql.test.ts +221 -0
  129. package/src/modules/usage/errors.ts +19 -0
  130. package/src/modules/usage/http.ts +85 -0
  131. package/src/modules/usage/identity-revocation.mysql.test.ts +286 -0
  132. package/src/modules/usage/identity.mysql.test.ts +120 -0
  133. package/src/modules/usage/identity.ts +303 -0
  134. package/src/modules/usage/issuer-sdk-billing.mysql.test.ts +92 -0
  135. package/src/modules/usage/model-gateway.mysql.test.ts +207 -0
  136. package/src/modules/usage/model-gateway.ts +229 -0
  137. package/src/modules/usage/model-tool-gateway.mysql.test.ts +137 -0
  138. package/src/modules/usage/model-tool-provider.test.ts +37 -0
  139. package/src/modules/usage/model-tool-provider.ts +110 -0
  140. package/src/modules/usage/model-tools.test.ts +36 -0
  141. package/src/modules/usage/model-tools.ts +62 -0
  142. package/src/modules/usage/period-allowance.mysql.test.ts +97 -0
  143. package/src/modules/usage/period.test.ts +26 -0
  144. package/src/modules/usage/period.ts +96 -0
  145. package/src/modules/usage/pricing.test.ts +178 -0
  146. package/src/modules/usage/pricing.ts +228 -0
  147. package/src/modules/usage/provider-failure.ts +37 -0
  148. package/src/modules/usage/provider-stream.test.ts +85 -0
  149. package/src/modules/usage/provider-stream.ts +77 -0
  150. package/src/modules/usage/provider.test.ts +67 -0
  151. package/src/modules/usage/provider.ts +142 -0
  152. package/src/modules/usage/repository.ts +539 -0
  153. package/src/modules/usage/service-availability.mysql.test.ts +68 -0
  154. package/src/modules/usage/service-availability.ts +13 -0
  155. package/src/modules/usage/service-delete.mysql.test.ts +87 -0
  156. package/src/modules/usage/stream-http.ts +32 -0
  157. package/src/modules/usage/test-harness.ts +108 -0
  158. package/src/modules/usage/usage-deletion.mysql.test.ts +312 -0
  159. package/src/modules/usage/usage-deletion.ts +119 -0
  160. package/src/modules/usage/validation.test.ts +18 -0
  161. package/src/modules/usage/validation.ts +33 -0
  162. package/src/routes/admin-agent-tasks.ts +32 -0
  163. package/src/routes/admin-billing-usage.ts +73 -0
  164. package/src/routes/admin-tool-providers.test.ts +22 -0
  165. package/src/routes/admin-tool-providers.ts +9 -1
  166. package/src/routes/admin-usage.ts +147 -0
  167. package/src/routes/admin.ts +7 -0
  168. package/src/routes/agent-api.test.ts +76 -0
  169. package/src/routes/agent-api.ts +42 -1
  170. package/src/routes/agent-artifacts.ts +29 -0
  171. package/src/routes/agent-task-control-http-mysql.test.ts +246 -0
  172. package/src/routes/private.ts +9 -0
  173. package/src/routes/run.ts +2 -1
  174. package/src/test-support/agent-task-control-mysql-fixture.ts +75 -0
  175. package/web/connect/bailing-connect-php7.tgz +0 -0
  176. package/web/console/assets/Accounts-Bervi5JU.css +1 -0
  177. package/web/console/assets/Accounts-DnddhY6t.js +3 -0
  178. package/web/console/assets/AgentClients-VInbD7JS.js +1 -0
  179. package/web/console/assets/AgentClients-i52AI6YV.css +1 -0
  180. package/web/console/assets/AgentTasks-B-1XklBg.js +2 -0
  181. package/web/console/assets/AgentTasks-BsG850Il.css +1 -0
  182. package/web/console/assets/{Approvals-Bs6FGbp2.js → Approvals-34qUPHf0.js} +1 -1
  183. package/web/console/assets/{Audit-4WWYhkFM.js → Audit-BbVgkSm2.js} +1 -1
  184. package/web/console/assets/{BrandLockup-D2GhCipL.js → BrandLockup-DgscF28e.js} +1 -1
  185. package/web/console/assets/{Channels-CmoGpiCJ.js → Channels-Bp-yuk8d.js} +1 -1
  186. package/web/console/assets/{ChatEntries-BFRMtwta.js → ChatEntries-C9Ft60TS.js} +1 -1
  187. package/web/console/assets/{Clients-DGkkSXyA.js → Clients-NPldD-DD.js} +1 -1
  188. package/web/console/assets/{Cost-BmGt0MfS.js → Cost-DZcuB-EB.js} +1 -1
  189. package/web/console/assets/{Credentials-CR-sYINT.js → Credentials-RTT7N6zl.js} +1 -1
  190. package/web/console/assets/{Diagnostics-DAPbKSJp.js → Diagnostics-_LeK8cce.js} +1 -1
  191. package/web/console/assets/{Executors-CgpiT3o8.js → Executors-Bi7H8rIm.js} +1 -1
  192. package/web/console/assets/{HelpTip-i-KJhf5s.js → HelpTip-BfyWrxCE.js} +1 -1
  193. package/web/console/assets/{Kb-Cm9dVSQw.js → Kb-BHamz8NP.js} +2 -2
  194. package/web/console/assets/{Login-CyUcsTZ_.js → Login-C1rJR-6w.js} +1 -1
  195. package/web/console/assets/{Projects-DldFPgWg.js → Projects-BRA4a48v.js} +1 -1
  196. package/web/console/assets/Routes-CTC7U-fQ.js +124 -0
  197. package/web/console/assets/Routes-CyXV4Pba.css +1 -0
  198. package/web/console/assets/{Runs-1hxgkuR4.js → Runs-B_fa_BlD.js} +1 -1
  199. package/web/console/assets/{Setup-DBLOnI2_.js → Setup-C1_d0mFy.js} +1 -1
  200. package/web/console/assets/Shell-CHEV6RGC.js +1 -0
  201. package/web/console/assets/Shell-ykb-tUfo.css +1 -0
  202. package/web/console/assets/StorageBuckets-CVgpZRWY.css +1 -0
  203. package/web/console/assets/StorageBuckets-DlG3ojhA.js +1 -0
  204. package/web/console/assets/{SystemSettings-cDkudo2y.js → SystemSettings-DYo2gg6d.js} +1 -1
  205. package/web/console/assets/{SystemStatus-DZd6s8OX.js → SystemStatus-DKCoUZlq.js} +1 -1
  206. package/web/console/assets/{Targets-DYNGq1NU.js → Targets-CdkG6BPR.js} +1 -1
  207. package/web/console/assets/Tools-DU8ei6sd.css +1 -0
  208. package/web/console/assets/Tools-DVpCt0ox.js +2 -0
  209. package/web/console/assets/Usage-CAeDGjrb.css +1 -0
  210. package/web/console/assets/Usage-DWCpLugC.js +1 -0
  211. package/web/console/assets/UsageAccess-B_Xq7ARW.js +1 -0
  212. package/web/console/assets/UsageAccess-CGGaWTuj.css +1 -0
  213. package/web/console/assets/UsageHelp-CSM4xO0K.css +1 -0
  214. package/web/console/assets/UsageHelp-t5ZG_f-e.js +1 -0
  215. package/web/console/assets/{index-QnmD7N7F.js → index-C6W4LWVV.js} +1 -1
  216. package/web/console/assets/{index-Fi9gkGxV.css → index-Cxuc9OCj.css} +1 -1
  217. package/web/console/assets/index-H1kfa0Mj.js +2 -0
  218. package/web/console/assets/{request-B7MLvOqo.js → request-DLsP1_ot.js} +1 -1
  219. package/web/console/assets/{schema-CMuwjYdJ.js → schema-BLOHvAJQ.js} +1 -1
  220. package/web/console/assets/{util-4bN2dv7B.js → util-CGVh2Jvr.js} +1 -1
  221. package/web/console/assets/{vendor-element-CZoEjZr8.js → vendor-element-BD089KxE.js} +1 -1
  222. package/web/console/assets/{vendor-mammoth-BUEEDX6A.js → vendor-mammoth-Bv-CZhmH.js} +1 -1
  223. package/web/console/index.html +3 -3
  224. package/web-admin/README.md +17 -0
  225. package/web-admin/scripts/agent-task-control-smoke.mjs +120 -0
  226. package/web-admin/src/components/AgentSetupPanel.vue +13 -0
  227. package/web-admin/src/components/ToolRateLimitEditor.vue +28 -0
  228. package/web-admin/src/components/UsageDeletionPreview.vue +44 -0
  229. package/web-admin/src/components/UsageHelp.vue +72 -0
  230. package/web-admin/src/components/UsageServiceReferences.vue +169 -0
  231. package/web-admin/src/layout/Shell.vue +23 -6
  232. package/web-admin/src/pages/Accounts.vue +3 -3
  233. package/web-admin/src/pages/AgentClients.vue +3 -1
  234. package/web-admin/src/pages/AgentTasks.vue +281 -0
  235. package/web-admin/src/pages/Routes.vue +5 -1
  236. package/web-admin/src/pages/StorageBuckets.vue +6 -6
  237. package/web-admin/src/pages/Tools.vue +53 -4
  238. package/web-admin/src/pages/Usage.vue +2470 -0
  239. package/web-admin/src/pages/UsageAccess.vue +1147 -0
  240. package/web-admin/src/router.ts +10 -4
  241. package/web-admin/src/styles/base.css +57 -0
  242. package/web-admin/src/table-widths.ts +16 -1
  243. package/web-admin/src/usage-deletion.ts +40 -0
  244. package/web-admin/src/usage-management.ts +13 -0
  245. package/web-admin/src/usage-presentation.test.ts +21 -0
  246. package/web-admin/src/usage-presentation.ts +107 -0
  247. package/web-admin/src/usage-price-preview.test.ts +60 -0
  248. package/web-admin/src/usage-price-preview.ts +54 -0
  249. package/web-admin/tests/token-usage.browser.mjs +773 -0
  250. package/web-admin/tests/usage-access.browser.mjs +398 -0
  251. package/web/console/assets/Accounts-B4ePH5jp.css +0 -1
  252. package/web/console/assets/Accounts-ChL9k-XA.js +0 -3
  253. package/web/console/assets/AgentClients-Bs7UgVDj.js +0 -1
  254. package/web/console/assets/AgentClients-DkgPTEbq.css +0 -1
  255. package/web/console/assets/Routes-DkMIjMQA.css +0 -1
  256. package/web/console/assets/Routes-DubfjlBD.js +0 -124
  257. package/web/console/assets/Shell-D9Uw-fsa.css +0 -1
  258. package/web/console/assets/Shell-gJ5Vz_E7.js +0 -1
  259. package/web/console/assets/StorageBuckets-DkDW16tj.js +0 -1
  260. package/web/console/assets/StorageBuckets-GnXnVvF0.css +0 -1
  261. package/web/console/assets/Tools-A20oaMaQ.css +0 -1
  262. package/web/console/assets/Tools-DpWM59vV.js +0 -2
  263. package/web/console/assets/index-DGqs28gI.js +0 -2
@@ -0,0 +1,31 @@
1
+ # Separating periodic plan price from allowance
2
+
3
+ This guide applies to Core 0.9.0 and explains periodic allowance terms and migration of existing billing snapshots. Public Core 0.8.0 did not include this billing module. Its normal upgrade adds 063/064 through the official migrator and requires no real-data purge. See the [v0.9.0 upgrade guide](UPGRADE_v0.9.0.en.md).
4
+
5
+ ## Period allowance contract
6
+
7
+ Periodic plans require both `priceUsd > 0` (sale price) and `periodAllowanceUsd > 0` (USD available per period), with at most twelve decimal places and a maximum of 1,000,000,000. Credit packs continue to use `priceUsd` as allowance and reject `periodAllowanceUsd`. Unknown fields remain rejected. There is no fallback to sale price, legacy field alias, turn limit or request-count limit.
8
+
9
+ For example, a weekly plan selling for 100 USD with a 20 USD allowance has 10 USD / 50% remaining after a 10 USD charge and regains 20 USD in the next week. A final partial week still receives the full allowance; expiration blocks new requests. Late settlement belongs to the original period, with its original multiplier, price and pool. Template edits affect future grant terms and do not automatically re-grant existing accounts.
10
+
11
+ `GET /admin/api/usage/billing/plans` provides `period_allowance_supported: true`. Without this marker, the frontend may preview the field but cannot save periodic plans. The marker describes code capability, not proof of database migration; verify the migration ledger and billing-structure readiness as well.
12
+
13
+ ## Instances that already deployed a billing preview
14
+
15
+ These data checks apply only when 063 billing data already exists and periodic snapshots lack the new field. Separate cleanup of abandoned test schemas is outside this process and must not be applied to real customer data.
16
+
17
+ 1. Coordinate all Core instances, frontends and plan writers sharing the state database on the new contract. Back up billing tables and migration ledger and retain previous artifacts. Stop old-version writes, including maintenance settlement and backend grant/control calls. Retain original IDs and evidence for dispatched requests; do not dispatch replacements.
18
+ 2. Apply the outstanding `064_period_plan_allowance.sql` through the official Core schema migrator (`npm run db:init` for source installations), keeping its ledger and checksum checks.
19
+ 3. Each periodic record missing the field receives its own original `priceUsd`, not the current template price. This covers plan `config_json`, grant snapshot `config_json`, request `grant_json` and grant/control replay `result_json.config`, including history. Original allowance semantics and cached request hashes remain unchanged. Explicit new allowances are never overwritten; credit packs are untouched. Original pools, ledger, charges, revisions and expiration are not rewritten.
20
+ 4. Confirm positive new fields in all four periodic JSON forms and no new field on credit packs. Compare record counts, original prices, pool allowances and ledger amounts. Start the new Core and UI, then check capability discovery, historical summaries, original-ID lookup and idempotent replay. Runtime does not infer missing fields; do not start it expecting automatic compatibility.
21
+ 5. Edit templates explicitly for later price or allowance changes. New terms apply to future grants; template edits are not migration of original grants. Use the normal provisioning flow if a new grant is needed.
22
+
23
+ The SQL converts only missing fields and retains explicit allowances. After interruption, keep writers stopped until the official migrator completes and checks pass. Do not manually change the migration ledger or replay recorded files.
24
+
25
+ ## Rollback and verification
26
+
27
+ Once the new fields exist, old Core's strict validation cannot read those configurations. Rollback requires stopped writers and coordinated backup/artifact restoration. If new requests or charges exist, retain them and repair forward instead of discarding the ledger through an older backup.
28
+
29
+ Check positive values and precision, rejection of periodic fields on credits, percentage calculations, month-end rules, independence of template edits and original snapshots, period renewal, late original-period settlement, final partial periods and expiration. Migration checks include differing template/grant amounts, original-request settlement, replay of original idempotency keys and preservation of explicit new allowances.
30
+
31
+ [Model billing contract](MODEL_BILLING.en.md) · [简体中文](PERIOD_ALLOWANCE_UPGRADE.md)
@@ -0,0 +1,31 @@
1
+ # 周期套餐售价与额度拆分
2
+
3
+ 本说明适用于 Core 0.9.0,解释周期额度契约及已存在计费快照的迁移。公开 Core 0.8.0 尚无此计费模块,正常升级通过正式迁移器新增 063/064,不要求清退真实数据。完整步骤见 [v0.9.0 升级指南](UPGRADE_v0.9.0.md)。
4
+
5
+ ## 周期额度契约
6
+
7
+ 周期套餐需同时提供 `priceUsd > 0`(售价)与 `periodAllowanceUsd > 0`(每周期 USD 额度),金额最多十二位小数、上限 1,000,000,000。额度包继续以 `priceUsd` 提供额度,拒绝 `periodAllowanceUsd`。未知字段继续拒绝,无售价回落、旧字段别名、轮次或请求次数限制。
8
+
9
+ 例如周套餐售价 100 USD、周期额度 20 USD,结算 10 USD 后剩余 10 USD / 50%;跨周重新获得 20 USD。有效期最后不足一周仍获得完整 20 USD,到期后停止新请求。原请求的晚结算归入原周期,原倍率、参考价格和额度池保持不变。套餐编辑只影响后续开通的额度条款,原账户不自动重新开通。
10
+
11
+ `GET /admin/api/usage/billing/plans` 提供 `period_allowance_supported: true`。旧 Core 不返回此标记时,前端只能预览周期额度,不能保存周期套餐。该标记表示代码能力,不能单独证明数据库已迁移;应同时核对迁移账本和计费结构就绪状态。
12
+
13
+ ## 已部署计费预览实例的迁移
14
+
15
+ 仅在实例已经存在 063 计费数据且周期快照缺少新字段时,需要以下数据核对。废弃测试结构的独立清理不属于本升级流程,不能用于真实客户数据。
16
+
17
+ 1. 确认所有共用状态库的 Core、前端及套餐配置调用方采用新契约。备份计费表与迁移账本,保留旧产物;停止旧版本写入,包括维护结算及业务侧开通/控制请求。已派发请求保留原 ID 与证据,不能重派。
18
+ 2. 使用官方 Core schema migrator(源码入口 `npm run db:init`)执行未应用的 `064_period_plan_allowance.sql`,按原迁移账本和摘要规则处理。
19
+ 3. 迁移为每条缺少新字段的周期记录写入其自身旧 `priceUsd`,不是当前套餐售价。范围为套餐 `config_json`、开通快照 `config_json`、原请求 `grant_json`、开通/控制幂等缓存 `result_json.config`,包括历史记录。原历史额度语义和缓存请求哈希不变;已有明确新额度不覆盖,credits 不修改。原额度池、账本、扣费、修订和有效期均不重写。
20
+ 4. 核对四类周期 JSON 均有合法正数新字段、credits 无新字段。比较迁移前后记录数、原价格、原池额度和账本金额;启动新 Core 与配套界面,验收能力位、历史摘要、原 ID 查询与幂等重放。运行时不会推断缺失字段,不能先启新版本再等待自动兼容。
21
+ 5. 后续调整售价或周期额度时显式编辑套餐;新条款用于以后开通,不能把模板编辑当作原开通迁移。需要重新开通时按正常开通流程处理。
22
+
23
+ SQL 只转换缺字段记录,不覆盖已有明确额度;中断后保持停写,按正式迁移器完成剩余步骤并核对后再恢复使用。不要手工修改迁移账本或重跑已记账文件。
24
+
25
+ ## 回退与验证
26
+
27
+ 新字段写入后,旧 Core 的严格校验不能读取新配置。回退需要停写并协调备份和旧产物;如已发生新请求或计费,保留新记录并修复,不能直接恢复旧备份丢弃账本。
28
+
29
+ 检查显式正数与金额精度、credits 拒收周期字段、周期百分比、月末规则、模板编辑与原快照独立、跨周期恢复、原周期晚结算以及最后短周期和到期行为。迁移核对包括模板与原开通金额不同、原请求结算、原幂等键重放及已有新额度不覆盖。
30
+
31
+ [模型计费契约](MODEL_BILLING.md) · [English](PERIOD_ALLOWANCE_UPGRADE.en.md)
package/docs/README.en.md CHANGED
@@ -6,6 +6,11 @@ This directory contains public documentation for the open-source BailingHub proj
6
6
 
7
7
  | Document | Purpose |
8
8
  |---|---|
9
+ | [RELEASE_NOTES_v0.9.0.en.md](RELEASE_NOTES_v0.9.0.en.md) · [Chinese](RELEASE_NOTES_v0.9.0.md) | v0.9.0: optional model billing, shared allowances and image tools. |
10
+ | [UPGRADE_v0.9.0.en.md](UPGRADE_v0.9.0.en.md) · [Chinese](UPGRADE_v0.9.0.md) | Upgrade from public 0.8.0, migrations 063/064 and optional host integration. |
11
+ | [MODEL_BILLING.en.md](MODEL_BILLING.en.md) · [Chinese](MODEL_BILLING.md) | Models/tools, reference prices, asynchronous settlement, archive and allowance reset contract. |
12
+ | [PERIOD_ALLOWANCE_UPGRADE.en.md](PERIOD_ALLOWANCE_UPGRADE.en.md) · [Chinese](PERIOD_ALLOWANCE_UPGRADE.md) | Separate periodic price/allowance and migrate existing preview snapshots. |
13
+ | [RELEASE_NOTES_v0.8.0.md](RELEASE_NOTES_v0.8.0.md) · [English](RELEASE_NOTES_v0.8.0.en.md) | v0.8.0: long tasks, original receipts, attachments and upgrade boundaries. |
9
14
  | [RELEASE_NOTES_v0.7.0.md](RELEASE_NOTES_v0.7.0.md) · [English](RELEASE_NOTES_v0.7.0.en.md) | v0.7.0 shop/inventory scenarios, upgrade steps and limits. |
10
15
  | [user-guide/conversations.en.md](user-guide/conversations.en.md) | Multi-account conversations, full-text review and offline recovery for users. |
11
16
  | [QUICKSTART.en.md](QUICKSTART.en.md) | Install BailingHub, run the Docker demo, create the first route, and connect the first business tool. |
@@ -21,7 +26,9 @@ This directory contains public documentation for the open-source BailingHub proj
21
26
  | [AGENT_SUBJECT_DISPLAY.en.md](AGENT_SUBJECT_DISPLAY.en.md) | Business authorization display names: responsibilities, new approvals and existing-session synchronization. |
22
27
  | [AGENT_AUTH_API.en.md](AGENT_AUTH_API.en.md) | Agent Auth v1, PKCE, trusted business identity, and revocation. |
23
28
  | [AGENT_AUTH_API.md](AGENT_AUTH_API.md) | Chinese Agent Auth v1 protocol. |
29
+ | [INVOCATION_RECEIPTS.md](INVOCATION_RECEIPTS.md) | Read an original receipt without continuing its business operation. |
24
30
  | [AGENT_CLIENT_RUNTIME_API.en.md](AGENT_CLIENT_RUNTIME_API.en.md) | Agent Client Runtime v1 workspaces, turns, tools, and completion contract. |
31
+ | [AGENT_TASK_CONTROL.en.md](AGENT_TASK_CONTROL.en.md) · [Chinese](AGENT_TASK_CONTROL.md) | Core 0.8.0: cumulative task budgets, actual dispatch, pause and SDK/DSH host integration. |
25
32
  | [AGENT_CLIENT_RUNTIME_API.md](AGENT_CLIENT_RUNTIME_API.md) | Chinese Agent Client Runtime v1 contract. |
26
33
  | [AGENT_CONVERSATION_AUDIT.en.md](AGENT_CONVERSATION_AUDIT.en.md) | Complete visible conversation audit, member confirmation, run ownership and admin pagination. |
27
34
  | [AGENT_CONVERSATION_AUDIT.md](AGENT_CONVERSATION_AUDIT.md) | Chinese complete conversation audit protocol. |
package/docs/README.md CHANGED
@@ -8,6 +8,11 @@
8
8
 
9
9
  | 文档 | 用途 |
10
10
  |---|---|
11
+ | [RELEASE_NOTES_v0.9.0.md](RELEASE_NOTES_v0.9.0.md) · [English](RELEASE_NOTES_v0.9.0.en.md) | v0.9.0:可选模型计费、统一套餐额度与文生图工具。 |
12
+ | [UPGRADE_v0.9.0.md](UPGRADE_v0.9.0.md) · [English](UPGRADE_v0.9.0.en.md) | 从公开 0.8.0 升级、063/064 迁移及宿主按需接入。 |
13
+ | [MODEL_BILLING.md](MODEL_BILLING.md) · [English](MODEL_BILLING.en.md) | 模型与工具、参考价格、异步结算、账户归档和额度重置契约。 |
14
+ | [PERIOD_ALLOWANCE_UPGRADE.md](PERIOD_ALLOWANCE_UPGRADE.md) · [English](PERIOD_ALLOWANCE_UPGRADE.en.md) | 周期售价与额度拆分,以及已有计费预览快照的迁移。 |
15
+ | [RELEASE_NOTES_v0.8.0.md](RELEASE_NOTES_v0.8.0.md) · [English](RELEASE_NOTES_v0.8.0.en.md) | v0.8.0: long tasks, original receipts, attachments and upgrade boundaries. |
11
16
  | [RELEASE_NOTES_v0.7.0.md](RELEASE_NOTES_v0.7.0.md) · [English](RELEASE_NOTES_v0.7.0.en.md) | v0.7.0:商城与库存场景、配套升级和限制。 |
12
17
  | [user-guide/conversations.md](user-guide/conversations.md) | 普通用户的多账户对话、完整沟通追溯和离线恢复指南。 |
13
18
  | [QUICKSTART.md](QUICKSTART.md) | 从零部署百灵中枢,适合准备接入真实业务系统的开发者。 |
@@ -25,7 +30,9 @@
25
30
  | [AGENT_SUBJECT_DISPLAY.md](AGENT_SUBJECT_DISPLAY.md) | 业务授权显示名称:三方职责、新授权与旧会话名称同步。 |
26
31
  | [AGENT_AUTH_API.md](AGENT_AUTH_API.md) | Agent Auth v1:业务登录态绑定、PKCE、Token 交换与会话撤销的语言无关契约。 |
27
32
  | [AGENT_AUTH_API.en.md](AGENT_AUTH_API.en.md) | English Agent Auth v1 protocol and trusted business-identity boundary. |
33
+ | [INVOCATION_RECEIPTS.md](INVOCATION_RECEIPTS.md) | 只读核对原调用、审批与执行日志;与可能继续业务的 resume 分开。 |
28
34
  | [AGENT_CLIENT_RUNTIME_API.md](AGENT_CLIENT_RUNTIME_API.md) | Agent Client Runtime v1:工作区、turn、能力搜索、工具执行与完成回传。 |
35
+ | [AGENT_TASK_CONTROL.md](AGENT_TASK_CONTROL.md) · [English](AGENT_TASK_CONTROL.en.md) | Core 0.8.0:跨轮任务额度、实际派发、暂停及 SDK/DSH 宿主接入。 |
29
36
  | [AGENT_CLIENT_RUNTIME_API.en.md](AGENT_CLIENT_RUNTIME_API.en.md) | English Agent Client Runtime v1 contract. |
30
37
  | [AGENT_CONVERSATION_AUDIT.md](AGENT_CONVERSATION_AUDIT.md) | 完整可见对话审计:逐授权成员确认、幂等文本事件、run 关联和管理员分页读取。 |
31
38
  | [AGENT_CONVERSATION_AUDIT.en.md](AGENT_CONVERSATION_AUDIT.en.md) | English complete conversation audit protocol and authorization boundary. |
@@ -1,3 +1,5 @@
1
- # Versioned release notes
1
+ # Current release: Core 0.9.0
2
2
 
3
- See [BailingHub v0.7.0](RELEASE_NOTES_v0.7.0.en.md).
3
+ Core 0.9.0 introduces an optional model billing gateway, shared USD plans, periodic allowances and text-to-image tools. Release pairing: SDK 0.7.0 / DSH 0.7.0.
4
+
5
+ [Core 0.9.0 release notes](RELEASE_NOTES_v0.9.0.en.md) · [Upgrade guide](UPGRADE_v0.9.0.en.md) · [Billing contract](MODEL_BILLING.en.md) · [简体中文](RELEASE_NOTES_NEXT.md)
@@ -1,3 +1,5 @@
1
- # 本期说明已归入正式版本
1
+ # 当前版本:Core 0.9.0
2
2
 
3
- 请阅读 [BailingHub v0.7.0 发布说明](RELEASE_NOTES_v0.7.0.md)。
3
+ Core 0.9.0 提供可选模型计费网关、统一 USD 套餐、周期额度与文生图工具。配套为 SDK 0.7.0 / DSH 0.7.0。
4
+
5
+ [Core 0.9.0 版本说明](RELEASE_NOTES_v0.9.0.md) · [升级指南](UPGRADE_v0.9.0.md) · [计费契约](MODEL_BILLING.md) · [English](RELEASE_NOTES_NEXT.en.md)
@@ -0,0 +1,40 @@
1
+ # v0.8.0 BailingHub release: continue and control longer business tasks
2
+
3
+ Release 0.8.0. Pairing: Core 0.8.0 / Agent Client SDK 0.6.0 / DSH 0.6.0. Changes below are relative to the preceding public release.
4
+
5
+ Maintaining a shop catalog may involve checking inventory, producing images, editing products and waiting for approval. This update connects those steps with clearer discovery, original-call recovery and task controls. Multi-system authorization, subject display names and visible conversation archives were already available in the preceding release.
6
+
7
+ ## What changes
8
+
9
+ **Task-wide budgets and controls.** Administrators can fix a task's authorized members, allowed tools, cumulative write-call budget, concurrent permit limit and optional deadline under Agent Clients → Task Control. A new message, tool search or host restart does not reset its budget. A batch operation affecting 20 products counts as one invocation, not 20 objects; a business rejection with a trustworthy response may also consume the write budget. Reads use concurrent permits but not the write budget. Original permissions and per-call approvals remain in force.
10
+
11
+ Pause blocks subsequent dispatch permits; already permitted work may finish. Continuing a task does not increase its budget or automatically continue an invocation. Cancelling prevents further dispatch and does not roll back completed changes.
12
+
13
+ **Inspect without executing.** A product listing can be approved without having been dispatched. A new read-only receipt keeps result, approval and dispatch facts separate. Refreshing it never submits the listing. Explicit continuation retains the original identity, parameters, run and invocation ID. An uncertain dispatched write is inspected rather than replaced. The paired DSH offers durable original-call recovery and panel APIs that work without an active model turn; hosts implement their own UI.
14
+
15
+ **Configurable tool limits.** Tool Providers → Edit → Governance supports inherited, custom or disabled Hub per-tool limits, including individual overrides. Provider-wide, per-tool and client-app gates remain separate. Hour/day limits keep their original windows. The same provider/tool shares its counter across users and conversations. SDK/DSH preserve retry guidance and original invocation recovery without asking the model to reconstruct write arguments.
16
+
17
+ **Local Agent attachment space, image-first.** An adapted host can register generated images or images explicitly selected by the user for business use. The Agent uploads them to operator-configured COS, OSS or explicit local storage and receives URLs for existing business tools—for example, a campaign cover or shop product image. PNG/JPEG/WebP, up to 6 MiB each and 1–8 images per DSH batch, are supported. Successful URLs are reusable; upload and business-action outcomes are separate. Chat attachments are not uploaded automatically. The host owns file access and image generation; the business system supplies the action accepting the URL.
18
+
19
+ Uploads are disabled by default. Configure storage under Agent Clients → Connection Configuration → Tools and Approval → Generated Image Upload. Images are publicly readable in this first phase. Operators manage retention; ending a conversation does not automatically delete objects.
20
+
21
+ **Clearer discovery and longer tool use.** Returned candidates, loaded tools and authorization-filtered catalog counts have separate meanings; unknown totals stay unknown. Ranked discovery is not exhaustive pagination. Paired DSH retains valid tools across searches within a turn. Adapted hosts can opt into declaration reuse across turns of the same living Session. Current target preparation, identity, permission and revision checks still apply.
22
+
23
+ ## Who should upgrade
24
+
25
+ | Role | Action |
26
+ | --- | --- |
27
+ | Hub operator | Upgrade Core, apply unapplied migrations 060–062 and configure optional storage, rate policies and tasks |
28
+ | Client host developer | Upgrade the paired SDK/DSH, persistent stores and public task/receipt APIs; explicitly opt into cross-turn reuse |
29
+ | Business backend developer | Retain current declarations, authorization, approval and APIs; image use requires an existing URL interface or a separate business import operation |
30
+ | Plugin user | Use an adapted host; installing a package alone grants neither file access nor administrative permissions |
31
+
32
+ ## Upgrade and boundaries
33
+
34
+ Follow the [paired upgrade guide](UPGRADE_v0.8.0.en.md). Migrations add attachment receipts, rate-limit policies and task records. Use the official migration ledger and retain configuration, encryption material, object storage and host records.
35
+
36
+ Task enrollment creates a persistent requirement on each original Agent Session, including its other conversations. Cancellation does not remove that requirement. Check every relevant host before enrolling dedicated test authorizations. Do not downgrade an enrolled deployment to a Core that does not enforce this marker.
37
+
38
+ The same-Hub, same-audit-domain boundary remains. This is not cross-system transactions, automatic product mapping, full-plan restart, automatic reconciliation of uncertain writes or business rollback. Documents, video and drive management are outside the first attachment release.
39
+
40
+ Component regression, synthetic integration and bounded client acceptance have been completed. Verify the release Tag and actual package provenance when upgrading. Windows device testing and actual user clicks in the latest panel are not covered by this acceptance; no general model reliability or production-adoption claim is made.
@@ -0,0 +1,62 @@
1
+ # 百灵中枢 v0.8.0:让业务长任务可继续、可控制
2
+
3
+ 发布版本:0.8.0。配套:Core 0.8.0 / Agent Client SDK 0.6.0 / DSH 0.6.0。相对上一公开版本的变化如下。
4
+
5
+ 用户让助手整理一批商城商品,过程中可能先查库存、生成展示图、修改商品,再等待业务审批。对话变长后,开发者需要解决的不只是“能不能调用接口”,还包括工具切换是否顺畅、中断后如何核对,以及管理员如何控制整项任务。
6
+
7
+ 这一轮更新围绕这些步骤完善中枢和配套客户端。多系统授权、授权主体名称和完整可见对话在上一公开版已经提供,本次延续这些能力。
8
+
9
+ ## 更新了什么
10
+
11
+ ### 一个任务,跨轮次累计额度
12
+
13
+ 管理员可在“智能体客户端 → 任务控制”为任务固定授权成员、允许使用的工具、累计写调用上限、在途许可上限和可选截止时间。例如“核对库存并维护商城商品,最多 20 次写调用”。切换工具、发送下一条消息或重开客户端,不会重新获得一份任务额度。
14
+
15
+ 写额度按原业务调用计数,不按商品数或成功次数计数:一个批量接口修改 20 件商品,仍是一笔调用。读操作不消耗写额度,但占用在途许可。已有业务权限和逐笔审批继续生效。
16
+
17
+ 暂停阻止后续派发;已经取得许可的请求可能完成。继续任务不增加额度,也不自动继续任何原操作。取消停止后续派发,不能撤回已发生的业务变化或自动回滚。
18
+
19
+ ### 核对结果不会顺带执行
20
+
21
+ “商品上架已批准”和“商品已上架”是两件事。新增只读原调用回执,管理端与已适配宿主可以核对执行、审批和派发记录,刷新状态不会提交上架。
22
+
23
+ 用户明确继续时,仍使用原授权、参数、运行记录和调用 ID。写请求已经发出而结果未知时,只核对原记录,不另建一次写操作。配套 DSH 提供会话重开后的持久恢复,以及无活跃对话轮次时的面板核对和继续接口;具体界面由客户端宿主接入。
24
+
25
+ ### 限额可以按部署规模设置
26
+
27
+ “工具源 → 编辑 → 治理”支持继承业务声明、自定义或关闭中枢单工具限额,并可覆盖指定工具。工具源总闸、单工具限额和接入方限额分别生效。
28
+
29
+ 小时、日限额按原时间窗口计算,不再折算为更小的每分钟额度。相同工具源下同一工具由多个用户与会话共享计数。限流等待提示通过 SDK/DSH 传递;明确未派发的可恢复操作继续使用原调用,不要求模型重新拼写入参数。
30
+
31
+ ### 本地智能体附件空间,首期支持图片
32
+
33
+ 助手可以把生成的活动海报、经营图表,或用户明确指定用于业务的图片,上传到部署方配置的普通 COS、OSS 或显式本地存储,取得 URL 后交给已有业务工具使用。例如把图片设为商城商品主图,或交给内容系统作为活动封面。
34
+
35
+ 首期支持 PNG/JPEG/WebP,单图最高 6 MiB,配套 DSH 每批 1–8 张。上传逐项返回结果,成功地址可以直接复用。普通聊天附件不会自动上传;上传成功和业务修改成功分别判断。图片生成服务、业务图片接口和客户端文件权限仍由各自系统提供。
36
+
37
+ 上传默认关闭,在“智能体客户端 → 配置接入 → 工具与审批 → 生成图片上传”选择存储并启用。首期对象公开读取,文件保留由部署方管理,不随会话结束自动删除。
38
+
39
+ ### 能力发现与错误更容易理解
40
+
41
+ 搜索返回数量、当前加载数量和授权目录数量分别表达;无法确定的总数保持未知。搜索是有上限的相关候选检索,不代表完整遍历。
42
+
43
+ 配套 DSH 在一轮内保留仍有效的工具;已适配宿主还可启用同一存活会话内的跨轮声明复用。例如“创建商品→查询库存→继续编辑商品”不必因一次新搜索就丢掉前面的工具。每轮仍按需准备当前目标,工具声明缓存不替代授权和权限检查。
44
+
45
+ ## 谁需要升级
46
+
47
+ | 使用者 | 需要做什么 |
48
+ | --- | --- |
49
+ | 中枢管理员 | 升级 Core、应用未执行的 060–062 迁移;按需配置存储、频率限额和任务控制 |
50
+ | 客户端宿主开发者 | 成套升级 SDK/DSH,接入持久记录、正式任务和原调用接口;跨轮复用需要显式启用 |
51
+ | 业务后端开发者 | 既有声明、授权、审批和业务 API 可沿用;图片使用仍须业务接口能接收 URL,或提供自己的素材导入能力 |
52
+ | 普通插件使用者 | 使用已完成这些接入的宿主;仅升级包不会自动取得本地文件或新增管理权限 |
53
+
54
+ ## 升级和限制
55
+
56
+ 先看[配套升级指南](UPGRADE_v0.8.0.md)。新增迁移分别保存附件回执、限额策略和任务控制记录。使用正式迁移器检查账本,仅执行未应用文件;保留实例配置、密钥、原存储及客户端持久记录。
57
+
58
+ 任务控制按需启用,但纳入任务会为原 Agent Session 设置持续强制标记,影响该授权的其他会话;取消任务也不会解除。先确认全部相关宿主兼容,再用专用测试授权启用。启用后不可回退到不理解该标记的旧 Core。
59
+
60
+ 边界仍是同一 Hub、同一审计域。没有跨系统事务、自动商品对应、整项计划自动续跑、未知写结果自动补偿或业务回滚。附件首期不包含文档、视频或网盘管理。
61
+
62
+ 已完成分组件回归、合成联测和限定客户端接入核对;发行制品需与对应 Tag 及安装摘要一致。Windows 实机及最新面板的实际用户点击尚未覆盖,不据此宣称任意模型或生产场景都已通过。
@@ -0,0 +1,45 @@
1
+ # BailingHub v0.9.0: model services and shared plan allowances
2
+
3
+ Release pairing: **Core 0.9.0 / MCP and Agent Client SDK 0.7.0 / DSH 0.7.0**. These notes describe changes and upgrade impact relative to public Core 0.8.0.
4
+
5
+ An enterprise assistant may select a conversation model, generate a campaign image and then call an authorized business API. Administrators can now give those models and generation tools a shared allowance. The local host continues to orchestrate the conversation and task; the Hub records original requests, actual usage and settlement. Existing business permissions and approvals still apply.
6
+
7
+ ## An optional lightweight model billing gateway
8
+
9
+ Enable model billing when needed. Administrators configure a provider connection, actual model identifier, reference pricing model and endpoint, then grant a plan to a personal or shared organization account. Conversation models and model tools have separate discovery catalogs. Charges are not based on user turns or task steps.
10
+
11
+ The actual model identifier can differ from the reference catalog identifier; operators explicitly verify that mapping. OpenRouter supplies reference prices, **not the actual provider's paid price or invoice**. Each request retains its price and plan-multiplier snapshot, so later price changes do not recalculate history. Unready services stay out of callable catalog entries; hosts can show the reason and direct users to their administrator.
12
+
13
+ ## One plan, one USD allowance
14
+
15
+ Every model and tool in a plan shares its USD allowance and a single multiplier. For example, an Enterprise Assistant monthly plan may sell for 300 USD and provide 100 USD per month at a 1.5 multiplier. A request with a 0.20 USD reference cost deducts 0.30 USD, leaving an actual allowance ratio of 99.70%.
16
+
17
+ - **Periodic plans** separate sale price `priceUsd` from per-period allowance `periodAllowanceUsd`. Daily, weekly or monthly resets restore that allowance; customers see a remaining percentage whose denominator is the allowance.
18
+ - **Credit packs** use `priceUsd` as the one-time USD allowance. Customers see Credits at a fixed 1000 Credits per USD, with no separate credit ledger.
19
+ - Validity and reset periods are independent. A final partial period still provides the full allowance; expiration stops new requests and unused allowance does not roll over. Template price edits do not reset existing grant terms; the current service set and unified multiplier are read from the plan.
20
+ - The business application owns payment, currency conversion, refunds and product pricing. Raw Token counts remain usage evidence, not plan limits or percentage denominators.
21
+
22
+ ## Text-to-image tools and asynchronous settlement
23
+
24
+ Model tools declare their name, purpose, parameters and output; hosts choose and invoke them. Initial executable adapters support text-to-image through Aliyun's OpenAI Images-compatible API, native DashScope and OpenRouter Images. Video, voice and custom capabilities may be declared, but remain explicitly uncallable without an execution adapter. A saved declaration does not imply generation support.
25
+
26
+ Image requests persist dispatch evidence and finish asynchronously. Hosts query the original `operation_id`. A completed result can be used while billing awaits actual metering; missing reliable usage never becomes an invented fee or Token count. Positive balances admit requests; late concurrent settlements can create an overage, and depleted balances block new requests.
27
+
28
+ Connection loss, missing responses and unknown outcomes retain the original ID rather than creating another generation. Confirmed rejection and unknown results are distinct. Late usage after cancellation remains accountable and does not revive a finished turn. Hosts can reuse the existing attachment space for image URLs/Base64 when needed; generation does not automatically modify business data.
29
+
30
+ ## Everyday administration
31
+
32
+ - Removing a plan preserves its identity, grants, allowance pools, requests and ledger. A plan still used by an effective grant requires its use relationship to be resolved first. Suspending a template only stops new grants.
33
+ - Disabled personal and shared accounts can be archived. Restoration returns the original account to disabled state; revoked credentials and members are not restored and allowance is not replenished.
34
+ - Authorized administrators can reset an active account's effective Hub-managed plan. Periodic plans regain their original period allowance with a new period anchor; credit packs regain their original Credits. Expiration is unchanged and original in-flight requests settle against their original pool.
35
+ - Console examples use generic business-assistant and enterprise-service descriptions suitable for different business systems.
36
+
37
+ ## Upgrade impact and acceptance
38
+
39
+ From public Core 0.8.0, use the official migrator to apply `063_usage_model_billing.sql` and `064_period_plan_allowance.sql`, retaining existing data and the migration ledger. **Normal public-version upgrades require no real-data or test-data purge.** Instances that already deployed a billing preview separately follow the [period allowance guide](PERIOD_ALLOWANCE_UPGRADE.en.md) for original snapshots.
40
+
41
+ Hosts opt into model catalogs, tools, summaries and persistent original-request records. Business backends adopt provisioning or plan-scoped identity APIs only when needed. Existing business-tool deployments need not enable model billing. Identity, permissions, session scope, approvals, task controls and business-call archives remain independent.
42
+
43
+ Verify enabled service configuration, customer allowance display, actual usage, original-ID recovery and administration against the final matched artifacts. Automated checks do not establish provider, client or production acceptance.
44
+
45
+ [Paired upgrade guide](UPGRADE_v0.9.0.en.md) · [Model billing contract](MODEL_BILLING.en.md) · [简体中文](RELEASE_NOTES_v0.9.0.md)
@@ -0,0 +1,45 @@
1
+ # 百灵中枢 v0.9.0:模型服务与统一套餐额度
2
+
3
+ 版本:**Core 0.9.0 / MCP 与 Agent Client SDK 0.7.0 / DSH 0.7.0**。本页说明相对公开 Core 0.8.0 的变化与升级影响。
4
+
5
+ 企业业务助手需要在对话中选择模型、生成活动图片,再调用已获授权的业务接口。管理员现在可以为这些模型与生成工具配置一份共享额度;本地宿主继续负责对话和任务编排,中枢记录原请求、计量及结算,原业务权限与审批继续生效。
6
+
7
+ ## 可选的微型模型计费网关
8
+
9
+ 模型计费按需启用。管理员配置模型连接、实际调用型号、参考计价模型与端点,再创建套餐并开通给个人或组织共享账户。对话模型与模型工具进入独立目录,宿主按能力发现接入;中枢不按用户轮次或任务步数收费。
10
+
11
+ 实际调用型号可以与参考目录中的型号不同,管理员需要显式核对映射。参考价格来自 OpenRouter,**不代表实际模型供应商的实付价格或账单**。每个请求保留参考价格和套餐倍率快照,后续调价不重算历史请求。配置未就绪的服务不会进入可调用目录,宿主可读取原因并提示联系管理员。
12
+
13
+ ## 一个套餐、一份 USD 额度
14
+
15
+ 套餐统一使用 USD 计量,同一套餐内所有模型与工具共用额度与一个倍率。例如“企业服务助手”月套餐售价 300 USD,每月额度 100 USD,倍率 1.5;一次请求参考费用 0.20 USD,结算扣除 0.30 USD,实际剩余额度占比为 99.70%。
16
+
17
+ - **周期套餐**:售价 `priceUsd` 与每周期额度 `periodAllowanceUsd` 分开设置。按日、周或月恢复额度,客户显示剩余百分比;分母是周期额度。
18
+ - **额度包**:`priceUsd` 提供一次性 USD 额度,客户显示 Credits(积分),固定 1 USD = 1000 Credits。没有独立积分账本。
19
+ - 有效期与重置周期分开,最后不足一个完整周期仍提供完整额度,到期停止新请求,未用额度不结转。模板改价不会重置已开通账户的原额度条款;当前模型集合和统一倍率按套餐读取。
20
+ - 支付、汇率、退款及商品定价由业务侧处理。原始 Token 是用量记录,不是套餐上限或百分比分母。
21
+
22
+ ## 文生图与异步结算
23
+
24
+ 模型工具声明名称、用途、参数及输出,宿主负责选择并调用。首批可执行适配为阿里云 OpenAI Images 兼容接口、DashScope 原生接口和 OpenRouter Images 接口的文生图。视频、语音与自定义能力可以保存声明;没有执行适配时明确不可调用,不表示已支持生成。
25
+
26
+ 图片请求保存派发记录后异步完成,宿主用原 `operation_id` 查询结果。结果完成即可使用,计费可能仍在等待实际计量;缺少可信计量不猜测费用或伪造 Token。余额为正时允许新请求,并发晚结算可能产生超额,余额耗尽后阻止新请求。
27
+
28
+ 断网、回包丢失或结果未知时保持原 ID,不另建生成请求。明确拒绝与结果未知分开展示;取消后的晚到结果仍可记录用量,不恢复已结束轮次。图片 URL/Base64 可由宿主按需写入已有附件空间,生成成功不会自动修改业务数据。
29
+
30
+ ## 后台日常管理
31
+
32
+ - 套餐移除保留原 ID、历史开通、额度池、请求及账本;仍被有效开通使用的套餐需要先处理使用关系。停用模板只停止新开通。
33
+ - 个人账户和组织共享账户停用后可移除归档;恢复回原账户的停用状态,旧凭证与被撤销成员不恢复,额度不补发。
34
+ - 有权限的管理员可为启用账户手动重置中枢维护的有效套餐:周期套餐恢复到原周期额度并重新起算周期,额度包恢复原始积分。到期时间不延长;原在途请求仍向原额度池结算。
35
+ - 控制台的接入示例使用通用业务助手和企业服务描述,便于各类业务系统复用。
36
+
37
+ ## 升级影响与验收
38
+
39
+ 从公开 Core 0.8.0 升级时,通过正式迁移器应用新增的 `063_usage_model_billing.sql` 和 `064_period_plan_allowance.sql`,保留原数据和迁移账本。**正常公开版升级不要求清退真实数据或旧测试数据。** 已部署过计费预览的实例另按[周期额度说明](PERIOD_ALLOWANCE_UPGRADE.md)核对原快照。
40
+
41
+ 客户端宿主按需接入模型目录、工具、摘要与原请求持久记录;业务后端仅在需要开通套餐或提供套餐范围身份时接入对应接口。只使用既有业务工具的部署无需开启模型计费。原身份、权限、会话范围、审批、长任务控制与业务调用归档保持独立。
42
+
43
+ 验收应覆盖所启用的服务配置、额度展示、实际计量、原 ID 查询及管理操作,并核对最终制品与配套版本。自动化通过不等于供应商、客户端或生产环境的实际验收。
44
+
45
+ [配套升级指南](UPGRADE_v0.9.0.md) · [模型服务与套餐计费](MODEL_BILLING.md) · [English](RELEASE_NOTES_v0.9.0.en.md)
@@ -0,0 +1,50 @@
1
+ # 批量业务操作的限额与恢复
2
+
3
+ 例如智能体需要批量更新商城商品资料,管理员可以根据部署规模设置额度。无需修改业务能力声明,也无需取消原有权限与审批。
4
+
5
+ ## 在哪里设置
6
+
7
+ 进入 **工具源 → 编辑 → 治理**:
8
+
9
+ - **工具源总限额**:该工具源的所有工具、用户、授权与会话,共用每分钟额度。`0` 关闭这一层总闸。
10
+ - **单工具默认策略**:继承业务声明、自定义中枢限额,或关闭中枢单工具限额。
11
+ - **指定工具覆盖**:针对某个工具单独设置,优先于默认策略。“继承业务声明”表示直接使用该工具的声明。
12
+
13
+ 自定义支持按秒、分钟、小时或天计数。每个工具分别计数;同一工具源、同一工具的不同用户与会话共享额度,并非每次新建会话获得一份新额度。工具清单详情同时显示原声明、生效限额和来源。刷新清单会保留管理员设置。
14
+
15
+ 若要关闭该工具源在中枢的两层工具限额,将总限额设为 `0`,将单工具默认策略设为“关闭中枢单工具限额”,并检查指定工具覆盖。**接入方 → 编辑**中的每分钟限额仍独立生效,它按 `client_app_id` 共享,也支持 `0` 关闭。业务系统自己实施的限流仍由业务系统管理。
16
+
17
+ ## 数量代表什么
18
+
19
+ `120 次/小时` 按一小时滑动窗口计数:空窗口中可连续接受 120 次,随后等待最早一笔额度到期。不会折算成每分钟 2 次。计数针对中枢调度闸接受的尝试,不是业务成功数量;接受后进入审批或业务拒绝的尝试也可能占用额度。
20
+
21
+ MySQL 运行时在同一事务中检查工具与工具源两层额度;任一层拒绝,均不增加另一层的计数。内存运行时使用同样的全闸检查。旧扩展若仅实现单桶 `consume` 回调,可继续运行;要获得全闸原子计数,应实现可选 `consumeAll` 接缝。修改配置不主动清空账本,按新窗口及已保留记录计算。
22
+
23
+ ## 被限流后如何继续
24
+
25
+ 调用尚未派发时,回执仍为 `rejected_before_dispatch`、`auto_retry_allowed=true`,并增加:
26
+
27
+ ```json
28
+ {
29
+ "retry_after_ms": 60000,
30
+ "rate_limit": {
31
+ "level": "tool",
32
+ "count": 120,
33
+ "window_sec": 3600,
34
+ "scope": "tool_provider_shared",
35
+ "source": "declaration"
36
+ }
37
+ }
38
+ ```
39
+
40
+ `retry_after_ms` 是当前观察下的等待提示,等待结束后仍会重新核验授权、配置和额度。SDK 保留这些可选字段;DSH 等待后只恢复原 `invocation_id`。等待超过本次自动等待预算时,DSH 返回 `agent_client_wait.state=rate_limited`,保留原调用供稍后恢复,避免高频轮询。
41
+
42
+ Core 在私有执行记录中加密保存原参数,并绑定原授权、run、工具、参数摘要与执行契约。恢复不会让模型重新拼参数。派发前先持久化执行标记;如果写操作可能已发出、但没有可靠结果,则进入 `reconciliation_required`,不重新派发。权限、参数审批与原身份核验照常生效。
43
+
44
+ ## 升级与兼容
45
+
46
+ 本说明适用于 Core 0.8.0 及配套 SDK/DSH 0.6.0。Core 需执行 `061_tool_rate_limit_policies.sql`;历史配置默认继承原声明。SDK/DSH 配套版本提供等待提示,旧包可忽略新增字段,仍沿用原接口。
47
+
48
+ 原参数快照使用实例 `server.token` 派生的专用密钥加密;重启需保留该配置。轮换该令牌后未完成快照无法解密,会严格阻断自动派发。已完成结果与原审批记录仍沿原路径读取。旧版本已丢失的参数不会被猜补,不能承诺修复历史失败调用后自动执行。
49
+
50
+ Business backends keep their existing declarations and APIs. Operators can inherit, override or disable Hub tool limits under **Tool providers → Edit → Governance**. Tool limits are shared per provider/tool; the provider gate is shared across all its tools, and the client gate remains independent. Hour/day windows retain their original duration. Matching SDK/DSH candidates preserve retry hints and resume only the original invocation; an uncertain write is never replayed automatically.
@@ -0,0 +1,71 @@
1
+ # Paired upgrade guide for 0.8.0: longer tasks and attachment delivery
2
+
3
+ Upgrade Core 0.7.0 / SDK 0.5.0 / DSH 0.5.0 to Core 0.8.0 / SDK 0.6.0 / DSH 0.6.0 using the deployment-specific release procedure. Preserve original configuration and persistent records.
4
+
5
+ ## Choose the required features
6
+
7
+ | Need | Core | SDK / DSH and host | Business backend |
8
+ | --- | --- | --- | --- |
9
+ | Configure Hub tool limits | New Core, migration 061 and policies | Paired packages for retry guidance and original-call recovery | Keep APIs/declarations; backend limits remain independent |
10
+ | Use generated or explicitly selected images | New Core, 060, storage and workspace switch | New SDK, controlled source and durable upload store in the DSH host | Existing URL APIs work; asset IDs/imports remain business operations |
11
+ | Switch tools within a turn | Paired Core for full discovery feedback | New DSH merges valid tools | No new requirement |
12
+ | Reuse declarations across messages | Current-turn preparation and permission checks remain | Opt into `toolLifecycle: 'session'` and handle preparation | No new requirement |
13
+ | Inspect/recover after reopening | New read-only receipt API | New SDK/DSH, durable invocation store and panel methods | Original invocation and approval rules remain |
14
+ | Task budgets, concurrency and pause | New Core, 062 and administrator-created tasks | Paired packages, task store and complete original-scope verification | Counts invocations, not products or monetary impact |
15
+
16
+ Other MCP hosts and adapters do not gain these integrations automatically. Ordinary unenrolled authorizations retain their existing flow. Unsupported interfaces must not cause fallback to a broader or default authorization.
17
+
18
+ ## 1. Preserve original state
19
+
20
+ Back up the database, configuration, encryption material, storage settings and objects. Original argument snapshots use a key derived from the instance's `server.token`. Do not combine a normal upgrade with an unplanned rotation: an old snapshot that cannot be decrypted must block recovery rather than be reconstructed.
21
+
22
+ Hosts retain secure credentials, connection instance keys, real Sessions, fixed scopes, events, archive outbox/ACK/CAS, upload and invocation journals, and task bindings. Protect these private stores; do not commit or publish them. An upgrade should not recreate authorizations or conversations.
23
+
24
+ ## 2. Upgrade Core and apply migrations
25
+
26
+ Use final released artifacts and the deployment-specific upgrade procedure. Check the intended database, then run the official migration runner (`npm run db:init` for a source installation) for all unapplied files before starting the new service. Startup does not migrate implicitly.
27
+
28
+ | New since Core 0.7.0 | Purpose |
29
+ | --- | --- |
30
+ | `060_agent_artifacts.sql` | Original image-upload receipts; binary objects stay in operator storage |
31
+ | `061_tool_rate_limit_policies.sql` | Provider defaults and per-tool overrides; existing null settings inherit declarations |
32
+ | `062_agent_task_control.sql` | Six tables for task bindings, enforcement, invocations and budgets/permits |
33
+
34
+ Verify the migration ledger and readiness. Do not manually replay applied SQL. Older baselines also need their missing earlier migrations. Existing candidate deployments must compare migration records and checksums rather than recreate tables.
35
+
36
+ Persistent task control needs the corresponding MySQL repository. Embedded hosts lacking optional support report unsupported. A configured managed flow must block on missing tables or database failure, not fall back to unrestricted dispatch.
37
+
38
+ ## 3. Upgrade the actual SDK, DSH and host
39
+
40
+ The released DSH must depend on the exact paired SDK, with a matching lockfile. Editing the source manifest alone does not upgrade a desktop Profile or packaged application. Verify actual consumer resolution and nested copies. An earlier same-numbered candidate is identified by hash; it is not the public 0.5.0 package.
41
+
42
+ - Cross-turn reuse: enable `toolLifecycle: 'session'`, preserve the real Session/runtime and handle preparation with current schemas. `active_turn` remains the default. Restart empties the declaration cache; the separate invocation journal can still recover original operations.
43
+ - Recovery and panels: persist `invocationStore`; use `inspectSessionInvocation` / `resumeSessionInvocation` with the original real Session, ID and cancellation signal. Reads never invoke resume. Null results stay unconfirmed; storage errors and history gaps cannot display stale success.
44
+ - Tasks: persist `taskStore`, obtain original coordinates with `getSessionTaskCoordinates` and bind the administrator-created task. Restore original scope/task/journal. The model does not choose task IDs.
45
+ - Images: connect a controlled `artifactSource` and durable `artifactStore`. Register only files approved for business use in the current conversation. Ordinary chat attachments are not synchronized automatically. The model chooses neither buckets nor arbitrary local paths.
46
+
47
+ Do not reconstruct missing historical bindings or arguments from text. Old SDK/Core versions without read-only receipts report unsupported; inspection must not fall back to resume.
48
+
49
+ ## 4. Enable features with a small validation scope
50
+
51
+ Configure Media Storage, then select it under Agent Clients → Connection Configuration → Tools and Approval → Generated Image Upload. Objects are public in the first phase; use an image suitable for public display.
52
+
53
+ Configure provider-wide, default per-tool and individual override limits under Tool Providers → Edit → Governance. A provider gate value of `0` disables only that layer. Client-app, per-tool and backend gates remain independent. The same provider/tool shares its counter across conversations.
54
+
55
+ Create and bind a task using dedicated test authorizations. **Enrollment persists a requirement on each original Agent Session, including its other conversations and older entry points. Cancellation does not remove the marker.** Check all relevant hosts before enrolling ordinary authorizations. A task write budget of `0` means read-only; `null` means no cumulative write cap.
56
+
57
+ ## Observable checks
58
+
59
+ 1. Ordinary chat does not create business runs just to restore tools or inspect a panel. Unselected targets receive no requests.
60
+ 2. Query a shop product, inspect inventory and return to the product: targets remain correct; valid tools are reused or prepared with complete schemas.
61
+ 3. Upload a public test image, obtain a ready URL and recover the same upload. The business action using that URL has its own result or approval.
62
+ 4. In a synthetic task, counts survive turn changes; pause stops new dispatch permits while original outcomes remain readable.
63
+ 5. Reopen a conversation with trustworthy persisted invocations: inspect sends no business action; explicit continuation retains the original ID. Unknown writes are not replaced. Cancelling a wait is not displayed as withdrawing a business request.
64
+
65
+ Synthetic and automated checks do not replace each deployer's actual client acceptance. Focus on the enabled features and final artifacts rather than repeating unrelated tests.
66
+
67
+ ## Rollback and limits
68
+
69
+ Before task enrollment, assess rollback against new persistent records and interfaces and retain migration tables/ledger. **Once enforcement markers exist, do not revert to a Core/host that ignores them or delete markers to remove control.** Pause managed dispatch and inspect in-flight calls first; prefer a forward fix. Restoring a backup requires separately reconciling business effects since that backup. Database restoration is not business rollback.
70
+
71
+ Task quotas exclude host-local tools, model inference, attachment uploads and chat archives. They do not measure product count, money or field impact. Cross-Hub tasks, full-plan automatic restart and compensation are not provided. Some host attachment-source listing errors can still surface as `unknown_failure`; they must not be displayed as an empty list. Per-item upload errors and already-ready URLs remain separate.
@@ -0,0 +1,73 @@
1
+ # 长任务与附件空间:配套升级指南
2
+
3
+ 本指南从 Core 0.7.0 / SDK 0.5.0 / DSH 0.5.0 升级到 Core 0.8.0 / SDK 0.6.0 / DSH 0.6.0。按部署方式使用正式版本,保留原配置和持久记录。
4
+
5
+ ## 先确定需要哪部分
6
+
7
+ | 需求 | Core | SDK / DSH 与宿主 | 业务后端 |
8
+ | --- | --- | --- | --- |
9
+ | 调整中枢工具限额 | 新 Core、061;后台设置策略 | 配套版本可展示准确等待与原调用恢复 | 原 API/声明可沿用;业务自有限流不由中枢关闭 |
10
+ | 生成或指定图片后用于业务 | 新 Core、060、存储及工作空间开关 | 新 SDK;DSH 宿主接文件目录和持久上传记录 | 已接收 URL 的能力可沿用;素材 ID/转存由业务系统提供 |
11
+ | 一轮内来回切换工具 | 配套版本用于完整发现反馈 | 新 DSH 自动合并仍有效工具 | 无新增要求 |
12
+ | 跨用户消息复用工具声明 | 沿用现有每轮准备和权限检查 | 新 DSH;宿主显式 `toolLifecycle: 'session'` 并处理准备结果 | 无新增要求 |
13
+ | 重开后恢复原调用及只读面板 | 新 Core 的只读 receipt | 新 SDK/DSH、持久 invocationStore、正式面板接口 | 原调用/审批规则保持 |
14
+ | 任务累计预算、并发和暂停 | 新 Core、062;管理端按需创建任务 | 新 SDK/DSH、taskStore、完整原范围核验与绑定 | 计量为调用次数;不新增商品数/金额保护承诺 |
15
+
16
+ 新包不会自动让其他 MCP 客户端、生态适配器或业务后端取得这些宿主能力。普通未纳入任务的授权可继续原流程;新接口不支持时要明确报告,不能扩大授权或换默认连接。
17
+
18
+ ## 第一步:保留原状态
19
+
20
+ 中枢备份数据库、运行配置与密钥、存储配置和文件对象。限流恢复的原参数快照由实例 `server.token` 派生密钥加密:不要在同一次普通升级中无计划地轮换它。令牌轮换后,旧快照不能解密时应阻断恢复,不能重新猜参数。
21
+
22
+ 客户端保留安全凭据、连接实例标识、真实 Session、固定范围、原事件、归档 outbox/ACK/CAS、上传和原调用账本,以及已有任务关联。保护原私有存储位置,不把这些内容提交源码或当作示例数据;升级不应重新授权或重建全部会话。
23
+
24
+ ## 第二步:升级中枢并迁移
25
+
26
+ 使用最终正式发行制品,按部署方式准备代码和回滚材料。确认目标数据库后,用正式迁移器(源码安装入口为 `npm run db:init`)应用全部未执行迁移,再启动新版本。启动本身不隐式迁移。
27
+
28
+ | 相对 Core 0.7.0 的迁移 | 保存内容 |
29
+ | --- | --- |
30
+ | `060_agent_artifacts.sql` | 图片上传回执与原上传关联;二进制在部署方存储中 |
31
+ | `061_tool_rate_limit_policies.sql` | 工具源默认及单工具覆盖策略;历史空值继承原声明 |
32
+ | `062_agent_task_control.sql` | 六张任务关联、强制标记、调用及额度/许可记录表 |
33
+
34
+ 检查迁移账本与就绪状态。已经应用的文件不要手工重跑;从更旧版本升级时还要应用其缺少的前序迁移。已有候选部署应按账本和文件摘要核对,不重复建表。
35
+
36
+ 当前任务持久控制需要相应 MySQL 仓储。缺少可选接口的嵌入式 Host 应报告不支持;一旦配置为受管模式,缺表或数据库故障必须阻断,不能静默回到无限制执行。
37
+
38
+ ## 第三步:升级实际 SDK / DSH 和宿主
39
+
40
+ DSH 正式依赖必须精确指向同批 SDK,lock 也应匹配。仅改工程 `package.json` 不足以证明桌面客户端、用户 Profile 或打包产物已升级:核对实际解析来源,检查是否存在嵌套旧 SDK。早期同版本候选按哈希识别,不能把候选 0.5.0 当成公开 0.5.0。
41
+
42
+ 宿主按需接入:
43
+
44
+ - 跨轮复用:开启 `toolLifecycle: 'session'`,保留真实 Session/runtime,使用当前 schema 并处理“尚未准备”。默认 `active_turn` 保持。工具缓存重启后为空,不影响另一份原调用账本的持久恢复。
45
+ - 恢复与面板:持久 `invocationStore`;使用正式 `inspectSessionInvocation` / `resumeSessionInvocation`,传原 Session、原 ID 和取消信号。读取不会调用 resume。空结果保持未确认,存储错误或历史缺口不能显示旧成功。
46
+ - 任务:持久 `taskStore`,通过 `getSessionTaskCoordinates` 提交原坐标,再绑定管理端返回的任务,恢复时保留原范围、task 和 journal。任务 ID 不交给模型选择。
47
+ - 图片:受控 `artifactSource`、持久 `artifactStore`,只登记当前会话获准用于业务的文件。普通聊天附件不自动同步,模型不选择桶或本机任意路径。
48
+
49
+ 旧记录缺少可信原绑定或参数时,不从正文补齐。旧 SDK/Core 明确不支持只读回执时,界面显示 unsupported,不用 resume 代替查询。
50
+
51
+ ## 第四步:按需启用,先小范围验证
52
+
53
+ 存储:先在“媒体存储”配置,再到“智能体客户端 → 配置接入 → 工具与审批 → 生成图片上传”启用指定存储。首期公开读取;准备一张可公开的测试图片即可。
54
+
55
+ 限额:在“工具源 → 编辑 → 治理”设置工具源总闸、单工具默认与覆盖策略。总闸的 `0` 只关闭该层,不会关闭单工具、接入方或业务系统自有限流。相同工具源/工具的不同会话共享计数。
56
+
57
+ 任务:用专用测试授权,通过管理端创建任务并绑定。**纳入任务会为原 Agent Session 保存持续强制标记,影响它的其他会话及旧入口;取消任务不会删除标记。** 先确认所有相关宿主兼容,再决定是否纳入日常授权。任务写额度 `0` 表示只读,`null` 表示没有累计写上限,不能混淆。
58
+
59
+ ## 如何确认成功
60
+
61
+ 1. 只聊天时不因恢复缓存或面板而创建业务 run;未选授权不接收请求。
62
+ 2. 查询商品、查看库存,再回到商品查询,目标正确,旧有效工具可复用;需要准备时能取得完整参数说明。
63
+ 3. 上传公开用途测试图片后得到 ready URL,恢复时仍是原上传;业务侧使用 URL 的成功、审批或失败单独显示。
64
+ 4. 在专用合成任务中核对累计调用数;切换轮次不重置,暂停后不授予新派发许可,原结果仍可查询。
65
+ 5. 关闭并重开有可信原调用记录的会话,核对不派发;明确继续仍是同一原调用。结果未知不产生替代写,取消等待不被显示为“已撤回业务”。
66
+
67
+ 合成与自动化通过不能替代各部署方的实际客户端验收。无需为了每次升级重新执行无关场景;重点检查本次启用的能力与最终安装包。
68
+
69
+ ## 回退与限制
70
+
71
+ 尚未启用任务时,仍需根据新增持久记录和接口评估回退,保留新增表与账本,不能简单删表降级。**一旦存在任务强制标记,不应回到不理解它的旧 Core/宿主,也不通过删标记解除控制。** 出现问题先暂停受管派发并核对原在途调用,优先修复前进;完整恢复备份需要单独核对备份后已发生的业务效果,不能把数据库恢复当成业务回滚。
72
+
73
+ 任务不包含本地工具、模型推理、图片上传或聊天归档的资源额度,不自动度量商品数、金额或字段影响;没有跨 Hub、整项计划自动恢复或自动补偿。附件列表的某些宿主源错误仍可能显示 `unknown_failure`,宿主不能将其展示为空目录;上传逐项错误和已成功 URL 保持独立。