@harrylabsj/kiwi 0.9.0 → 0.11.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 (470) hide show
  1. package/README.md +1 -1
  2. package/contracts/card-publication/0.1.2/request.schema.json +78 -0
  3. package/contracts/kiwi-contracts.lock.json +2 -2
  4. package/contracts/manifest.json +127 -1
  5. package/contracts/merchant-management/1.0/README.md +109 -0
  6. package/contracts/merchant-management/1.0/approval-decision.schema.json +16 -0
  7. package/contracts/merchant-management/1.0/approval-preview.schema.json +26 -0
  8. package/contracts/merchant-management/1.0/connector-delivery-manifest.schema.json +78 -0
  9. package/contracts/merchant-management/1.0/management-error.schema.json +30 -0
  10. package/contracts/merchant-management/1.0/operation-receipt.schema.json +28 -0
  11. package/contracts/merchant-management/1.0/runtime-management-descriptor.schema.json +33 -0
  12. package/contracts/merchant-management/1.0/runtime-status.schema.json +42 -0
  13. package/contracts/merchant-rfq/0.1.0/delivery-record.schema.json +206 -0
  14. package/contracts/merchant-rfq/0.1.0/fact-snapshot.schema.json +118 -0
  15. package/contracts/merchant-rfq/0.1.0/handoff-record.schema.json +251 -0
  16. package/contracts/merchant-rfq/0.1.0/pricing-input.schema.json +139 -0
  17. package/contracts/merchant-rfq/0.1.0/quote-revision.schema.json +153 -0
  18. package/contracts/merchant-rfq/0.1.0/release-request.schema.json +121 -0
  19. package/contracts/merchant-rfq/0.1.0/rfq-case.schema.json +357 -0
  20. package/contracts/merchant-rfq/0.1.0/source-record.schema.json +162 -0
  21. package/contracts/merchant-workbench/1.0/README.md +6 -0
  22. package/contracts/merchant-workbench/1.0/money.schema.json +19 -0
  23. package/contracts/merchant-workbench/1.0/problem.schema.json +73 -0
  24. package/contracts/runtime-binding/0.1.2/binding-request.schema.json +73 -0
  25. package/contracts/runtime-binding/0.1.2/claims.schema.json +100 -0
  26. package/contracts/runtime-binding/0.1.2/document.schema.json +161 -0
  27. package/contracts/vectors/binding-thumbprint.json +15 -0
  28. package/dist/a2a/node.d.ts +96 -2
  29. package/dist/a2a/node.js +164 -91
  30. package/dist/a2a/node.js.map +1 -1
  31. package/dist/a2a/server/errors.d.ts +8 -0
  32. package/dist/a2a/server/errors.js +8 -0
  33. package/dist/a2a/server/errors.js.map +1 -1
  34. package/dist/a2a/server/merchant-handler.d.ts +13 -0
  35. package/dist/a2a/server/merchant-handler.js +267 -34
  36. package/dist/a2a/server/merchant-handler.js.map +1 -1
  37. package/dist/a2a/server/pipeline.d.ts +15 -10
  38. package/dist/a2a/server/pipeline.js +48 -18
  39. package/dist/a2a/server/pipeline.js.map +1 -1
  40. package/dist/a2a/server/server.d.ts +20 -1
  41. package/dist/a2a/server/server.js +87 -13
  42. package/dist/a2a/server/server.js.map +1 -1
  43. package/dist/a2a/server/task-registry.d.ts +31 -11
  44. package/dist/a2a/server/task-registry.js +65 -20
  45. package/dist/a2a/server/task-registry.js.map +1 -1
  46. package/dist/a2a/server/types.d.ts +23 -0
  47. package/dist/a2a/signing-key.d.ts +6 -0
  48. package/dist/a2a/signing-key.js +12 -0
  49. package/dist/a2a/signing-key.js.map +1 -1
  50. package/dist/agent/buyer/buyer-tools.js +1 -1
  51. package/dist/agent/buyer/buyer-tools.js.map +1 -1
  52. package/dist/agent/host/web-renderer.d.ts +5 -0
  53. package/dist/agent/host/web-renderer.js +25 -6
  54. package/dist/agent/host/web-renderer.js.map +1 -1
  55. package/dist/agent/kernel.js +6 -6
  56. package/dist/agent/kernel.js.map +1 -1
  57. package/dist/agent/memory/schema.d.ts +1 -1
  58. package/dist/agent/memory/schema.js +190 -1
  59. package/dist/agent/memory/schema.js.map +1 -1
  60. package/dist/agent/memory/store.js +3 -1
  61. package/dist/agent/memory/store.js.map +1 -1
  62. package/dist/agent/merchant/action-candidate.d.ts +1 -0
  63. package/dist/agent/merchant/action-candidate.js +42 -24
  64. package/dist/agent/merchant/action-candidate.js.map +1 -1
  65. package/dist/agent/merchant/fake-merchant-client.d.ts +30 -1
  66. package/dist/agent/merchant/fake-merchant-client.js +151 -2
  67. package/dist/agent/merchant/fake-merchant-client.js.map +1 -1
  68. package/dist/agent/merchant/intelligence/default-backend.js +2 -2
  69. package/dist/agent/merchant/intelligence/default-backend.js.map +1 -1
  70. package/dist/agent/merchant/merchant-client.d.ts +38 -5
  71. package/dist/agent/merchant/merchant-client.js +103 -8
  72. package/dist/agent/merchant/merchant-client.js.map +1 -1
  73. package/dist/agent/merchant/types.d.ts +107 -0
  74. package/dist/agent/merchant/types.js +69 -0
  75. package/dist/agent/merchant/types.js.map +1 -1
  76. package/dist/alerts/external-delivery.d.ts +78 -0
  77. package/dist/alerts/external-delivery.js +256 -0
  78. package/dist/alerts/external-delivery.js.map +1 -0
  79. package/dist/auth/app-oauth-callback.d.ts +38 -0
  80. package/dist/auth/app-oauth-callback.js +119 -0
  81. package/dist/auth/app-oauth-callback.js.map +1 -0
  82. package/dist/auth/merchant-oauth.js +15 -41
  83. package/dist/auth/merchant-oauth.js.map +1 -1
  84. package/dist/auth/merchant-pairing.d.ts +51 -0
  85. package/dist/auth/merchant-pairing.js +66 -16
  86. package/dist/auth/merchant-pairing.js.map +1 -1
  87. package/dist/auth/merchant-sessions.d.ts +7 -1
  88. package/dist/auth/merchant-sessions.js +25 -3
  89. package/dist/auth/merchant-sessions.js.map +1 -1
  90. package/dist/buyer-core/build-service.d.ts +3 -1
  91. package/dist/buyer-core/build-service.js +4 -1
  92. package/dist/buyer-core/build-service.js.map +1 -1
  93. package/dist/buyer-core/merchant-index.d.ts +20 -0
  94. package/dist/buyer-core/merchant-index.js +83 -12
  95. package/dist/buyer-core/merchant-index.js.map +1 -1
  96. package/dist/buyer-core/network-search.d.ts +92 -0
  97. package/dist/buyer-core/network-search.js +144 -0
  98. package/dist/buyer-core/network-search.js.map +1 -0
  99. package/dist/buyer-core/product-summary.d.ts +71 -0
  100. package/dist/buyer-core/product-summary.js +63 -0
  101. package/dist/buyer-core/product-summary.js.map +1 -0
  102. package/dist/buyer-core/service.d.ts +26 -0
  103. package/dist/buyer-core/service.js +38 -8
  104. package/dist/buyer-core/service.js.map +1 -1
  105. package/dist/cli.js +22 -243
  106. package/dist/cli.js.map +1 -1
  107. package/dist/cloud/binding/audit.d.ts +72 -0
  108. package/dist/cloud/binding/audit.js +137 -0
  109. package/dist/cloud/binding/audit.js.map +1 -0
  110. package/dist/cloud/binding/issuance.d.ts +76 -0
  111. package/dist/cloud/binding/issuance.js +121 -0
  112. package/dist/cloud/binding/issuance.js.map +1 -0
  113. package/dist/cloud/binding/proofs.d.ts +110 -0
  114. package/dist/cloud/binding/proofs.js +200 -0
  115. package/dist/cloud/binding/proofs.js.map +1 -0
  116. package/dist/cloud/binding/runtime-challenge.d.ts +48 -0
  117. package/dist/cloud/binding/runtime-challenge.js +178 -0
  118. package/dist/cloud/binding/runtime-challenge.js.map +1 -0
  119. package/dist/cloud/bootstrap.d.ts +63 -0
  120. package/dist/cloud/bootstrap.js +937 -0
  121. package/dist/cloud/bootstrap.js.map +1 -0
  122. package/dist/cloud/config.d.ts +91 -0
  123. package/dist/cloud/config.js +229 -0
  124. package/dist/cloud/config.js.map +1 -0
  125. package/dist/cloud/http-router.d.ts +61 -0
  126. package/dist/cloud/http-router.js +127 -0
  127. package/dist/cloud/http-router.js.map +1 -0
  128. package/dist/cloud/main.d.ts +16 -0
  129. package/dist/cloud/main.js +64 -0
  130. package/dist/cloud/main.js.map +1 -0
  131. package/dist/cloud/onboarding/local-fallback.d.ts +86 -0
  132. package/dist/cloud/onboarding/local-fallback.js +98 -0
  133. package/dist/cloud/onboarding/local-fallback.js.map +1 -0
  134. package/dist/cloud/onboarding/steps.d.ts +95 -0
  135. package/dist/cloud/onboarding/steps.js +175 -0
  136. package/dist/cloud/onboarding/steps.js.map +1 -0
  137. package/dist/cloud/onboarding/store.d.ts +136 -0
  138. package/dist/cloud/onboarding/store.js +472 -0
  139. package/dist/cloud/onboarding/store.js.map +1 -0
  140. package/dist/cloud/onboarding/types.d.ts +132 -0
  141. package/dist/cloud/onboarding/types.js +152 -0
  142. package/dist/cloud/onboarding/types.js.map +1 -0
  143. package/dist/cloud/product-source.d.ts +97 -0
  144. package/dist/cloud/product-source.js +226 -0
  145. package/dist/cloud/product-source.js.map +1 -0
  146. package/dist/cloud/readiness.d.ts +49 -0
  147. package/dist/cloud/readiness.js +54 -0
  148. package/dist/cloud/readiness.js.map +1 -0
  149. package/dist/commerce/data-source.d.ts +5 -0
  150. package/dist/commerce/data-source.js.map +1 -1
  151. package/dist/config/provider-kind.d.ts +26 -0
  152. package/dist/config/provider-kind.js +19 -0
  153. package/dist/config/provider-kind.js.map +1 -0
  154. package/dist/contracts/cloud-contracts.d.ts +23 -0
  155. package/dist/contracts/cloud-contracts.js +90 -0
  156. package/dist/contracts/cloud-contracts.js.map +1 -0
  157. package/dist/counterparty/a2a-direct/index.d.ts +3 -0
  158. package/dist/counterparty/a2a-direct/index.js +22 -6
  159. package/dist/counterparty/a2a-direct/index.js.map +1 -1
  160. package/dist/counterparty/registry.d.ts +2 -0
  161. package/dist/counterparty/registry.js +2 -0
  162. package/dist/counterparty/registry.js.map +1 -1
  163. package/dist/counterparty/shopping-cli-hosted/index.d.ts +3 -0
  164. package/dist/counterparty/shopping-cli-hosted/index.js +9 -2
  165. package/dist/counterparty/shopping-cli-hosted/index.js.map +1 -1
  166. package/dist/discovery/catalog-source/buyer-follows.js +2 -2
  167. package/dist/discovery/catalog-source/buyer-follows.js.map +1 -1
  168. package/dist/discovery/catalog-source/cloud-card.d.ts +184 -0
  169. package/dist/discovery/catalog-source/cloud-card.js +379 -0
  170. package/dist/discovery/catalog-source/cloud-card.js.map +1 -0
  171. package/dist/discovery/catalog-source/cloud-hosting.d.ts +71 -0
  172. package/dist/discovery/catalog-source/cloud-hosting.js +70 -0
  173. package/dist/discovery/catalog-source/cloud-hosting.js.map +1 -0
  174. package/dist/discovery/catalog-source/errors.d.ts +12 -2
  175. package/dist/discovery/catalog-source/errors.js +14 -1
  176. package/dist/discovery/catalog-source/errors.js.map +1 -1
  177. package/dist/discovery/catalog-source/index.d.ts +2 -0
  178. package/dist/discovery/catalog-source/index.js +2 -0
  179. package/dist/discovery/catalog-source/index.js.map +1 -1
  180. package/dist/discovery/catalog-source/kiwi-source.js +2 -2
  181. package/dist/discovery/catalog-source/kiwi-source.js.map +1 -1
  182. package/dist/discovery/catalog-source/merchant-publications.d.ts +2 -2
  183. package/dist/discovery/catalog-source/merchant-publications.js +10 -5
  184. package/dist/discovery/catalog-source/merchant-publications.js.map +1 -1
  185. package/dist/discovery/catalog-source/source.js +2 -2
  186. package/dist/discovery/catalog-source/source.js.map +1 -1
  187. package/dist/discovery/merchant-subscriptions.d.ts +45 -0
  188. package/dist/discovery/merchant-subscriptions.js +319 -0
  189. package/dist/discovery/merchant-subscriptions.js.map +1 -0
  190. package/dist/discovery/resolve.d.ts +38 -0
  191. package/dist/discovery/resolve.js +100 -7
  192. package/dist/discovery/resolve.js.map +1 -1
  193. package/dist/fanout/orchestrator.d.ts +2 -0
  194. package/dist/fanout/orchestrator.js +4 -1
  195. package/dist/fanout/orchestrator.js.map +1 -1
  196. package/dist/handoff/ledger.d.ts +1 -0
  197. package/dist/handoff/ledger.js +3 -0
  198. package/dist/handoff/ledger.js.map +1 -1
  199. package/dist/handoff/transaction.js +1 -1
  200. package/dist/handoff/transaction.js.map +1 -1
  201. package/dist/http/merchant-engagement-api.d.ts +10 -0
  202. package/dist/http/merchant-engagement-api.js +138 -0
  203. package/dist/http/merchant-engagement-api.js.map +1 -0
  204. package/dist/http/merchant-feed-api.d.ts +7 -0
  205. package/dist/http/merchant-feed-api.js +129 -0
  206. package/dist/http/merchant-feed-api.js.map +1 -0
  207. package/dist/http/merchant-follow-api.d.ts +15 -0
  208. package/dist/http/merchant-follow-api.js +192 -0
  209. package/dist/http/merchant-follow-api.js.map +1 -0
  210. package/dist/http/merchant-management/api.d.ts +241 -0
  211. package/dist/http/merchant-management/api.js +2785 -0
  212. package/dist/http/merchant-management/api.js.map +1 -0
  213. package/dist/http/merchant-management/draft-store.d.ts +51 -0
  214. package/dist/http/merchant-management/draft-store.js +95 -0
  215. package/dist/http/merchant-management/draft-store.js.map +1 -0
  216. package/dist/http/merchant-management/event-projection.d.ts +41 -0
  217. package/dist/http/merchant-management/event-projection.js +190 -0
  218. package/dist/http/merchant-management/event-projection.js.map +1 -0
  219. package/dist/http/merchant-management/operation-store.d.ts +97 -0
  220. package/dist/http/merchant-management/operation-store.js +252 -0
  221. package/dist/http/merchant-management/operation-store.js.map +1 -0
  222. package/dist/http/merchant-management/page.d.ts +29 -0
  223. package/dist/http/merchant-management/page.js +346 -0
  224. package/dist/http/merchant-management/page.js.map +1 -0
  225. package/dist/http/merchant-management/problem-client.d.ts +19 -0
  226. package/dist/http/merchant-management/problem-client.js +55 -0
  227. package/dist/http/merchant-management/problem-client.js.map +1 -0
  228. package/dist/http/merchant-management/problem.d.ts +74 -0
  229. package/dist/http/merchant-management/problem.js +112 -0
  230. package/dist/http/merchant-management/problem.js.map +1 -0
  231. package/dist/http/merchant-management/reconciliation-worker.d.ts +95 -0
  232. package/dist/http/merchant-management/reconciliation-worker.js +397 -0
  233. package/dist/http/merchant-management/reconciliation-worker.js.map +1 -0
  234. package/dist/http/merchant-management/service-state.d.ts +86 -0
  235. package/dist/http/merchant-management/service-state.js +217 -0
  236. package/dist/http/merchant-management/service-state.js.map +1 -0
  237. package/dist/http/merchant-management/trusted-page.d.ts +3 -0
  238. package/dist/http/merchant-management/trusted-page.js +73 -0
  239. package/dist/http/merchant-management/trusted-page.js.map +1 -0
  240. package/dist/http/merchant-management/webauthn-confirmation.d.ts +148 -0
  241. package/dist/http/merchant-management/webauthn-confirmation.js +517 -0
  242. package/dist/http/merchant-management/webauthn-confirmation.js.map +1 -0
  243. package/dist/http/merchant-privacy-api.d.ts +9 -0
  244. package/dist/http/merchant-privacy-api.js +96 -0
  245. package/dist/http/merchant-privacy-api.js.map +1 -0
  246. package/dist/mcp/merchant-rfq-resources.d.ts +37 -0
  247. package/dist/mcp/merchant-rfq-resources.js +132 -0
  248. package/dist/mcp/merchant-rfq-resources.js.map +1 -0
  249. package/dist/mcp/merchant-rfq-tools.d.ts +61 -0
  250. package/dist/mcp/merchant-rfq-tools.js +584 -0
  251. package/dist/mcp/merchant-rfq-tools.js.map +1 -0
  252. package/dist/mcp/merchant-runtime-assembly.d.ts +74 -0
  253. package/dist/mcp/merchant-runtime-assembly.js +473 -0
  254. package/dist/mcp/merchant-runtime-assembly.js.map +1 -0
  255. package/dist/mcp/merchant-server.d.ts +64 -1
  256. package/dist/mcp/merchant-server.js +245 -23
  257. package/dist/mcp/merchant-server.js.map +1 -1
  258. package/dist/mcp/tools.js +8 -2
  259. package/dist/mcp/tools.js.map +1 -1
  260. package/dist/merchant/application/actor.d.ts +85 -0
  261. package/dist/merchant/application/actor.js +162 -0
  262. package/dist/merchant/application/actor.js.map +1 -0
  263. package/dist/merchant/application/money.d.ts +35 -0
  264. package/dist/merchant/application/money.js +124 -0
  265. package/dist/merchant/application/money.js.map +1 -0
  266. package/dist/merchant/application/service.d.ts +228 -0
  267. package/dist/merchant/application/service.js +262 -0
  268. package/dist/merchant/application/service.js.map +1 -0
  269. package/dist/merchant/clock-safety.d.ts +50 -0
  270. package/dist/merchant/clock-safety.js +153 -0
  271. package/dist/merchant/clock-safety.js.map +1 -0
  272. package/dist/merchant/engagement-store.d.ts +32 -0
  273. package/dist/merchant/engagement-store.js +119 -0
  274. package/dist/merchant/engagement-store.js.map +1 -0
  275. package/dist/merchant/exact-product-executors.d.ts +11 -0
  276. package/dist/merchant/exact-product-executors.js +132 -0
  277. package/dist/merchant/exact-product-executors.js.map +1 -0
  278. package/dist/merchant/feed-executors.d.ts +17 -0
  279. package/dist/merchant/feed-executors.js +151 -0
  280. package/dist/merchant/feed-executors.js.map +1 -0
  281. package/dist/merchant/feed-store.d.ts +141 -0
  282. package/dist/merchant/feed-store.js +496 -0
  283. package/dist/merchant/feed-store.js.map +1 -0
  284. package/dist/merchant/follow-store.d.ts +66 -0
  285. package/dist/merchant/follow-store.js +295 -0
  286. package/dist/merchant/follow-store.js.map +1 -0
  287. package/dist/merchant/grant-executors.d.ts +11 -0
  288. package/dist/merchant/grant-executors.js +136 -0
  289. package/dist/merchant/grant-executors.js.map +1 -0
  290. package/dist/merchant/grant-store.d.ts +125 -0
  291. package/dist/merchant/grant-store.js +313 -0
  292. package/dist/merchant/grant-store.js.map +1 -0
  293. package/dist/merchant/inventory-executors.d.ts +47 -0
  294. package/dist/merchant/inventory-executors.js +91 -0
  295. package/dist/merchant/inventory-executors.js.map +1 -0
  296. package/dist/merchant/listing-executors.d.ts +51 -0
  297. package/dist/merchant/listing-executors.js +100 -0
  298. package/dist/merchant/listing-executors.js.map +1 -0
  299. package/dist/merchant/operation-receipts.d.ts +57 -0
  300. package/dist/merchant/operation-receipts.js +138 -0
  301. package/dist/merchant/operation-receipts.js.map +1 -0
  302. package/dist/merchant/promotion-broadcast-recovery.d.ts +22 -0
  303. package/dist/merchant/promotion-broadcast-recovery.js +74 -0
  304. package/dist/merchant/promotion-broadcast-recovery.js.map +1 -0
  305. package/dist/merchant/promotion-broadcast-workflow.d.ts +42 -0
  306. package/dist/merchant/promotion-broadcast-workflow.js +171 -0
  307. package/dist/merchant/promotion-broadcast-workflow.js.map +1 -0
  308. package/dist/merchant/promotion-executors.d.ts +18 -0
  309. package/dist/merchant/promotion-executors.js +133 -0
  310. package/dist/merchant/promotion-executors.js.map +1 -0
  311. package/dist/merchant/promotion-store.d.ts +114 -0
  312. package/dist/merchant/promotion-store.js +325 -0
  313. package/dist/merchant/promotion-store.js.map +1 -0
  314. package/dist/merchant/promotion-time.d.ts +19 -0
  315. package/dist/merchant/promotion-time.js +162 -0
  316. package/dist/merchant/promotion-time.js.map +1 -0
  317. package/dist/merchant/quote-calculator.d.ts +32 -0
  318. package/dist/merchant/quote-calculator.js +70 -0
  319. package/dist/merchant/quote-calculator.js.map +1 -0
  320. package/dist/merchant/service-control-executors.d.ts +15 -0
  321. package/dist/merchant/service-control-executors.js +52 -0
  322. package/dist/merchant/service-control-executors.js.map +1 -0
  323. package/dist/merchant/workbench-service.d.ts +1 -0
  324. package/dist/merchant/workbench-service.js +11 -1
  325. package/dist/merchant/workbench-service.js.map +1 -1
  326. package/dist/merchant-admin/pending-page.d.ts +104 -0
  327. package/dist/merchant-admin/pending-page.js +20 -0
  328. package/dist/merchant-admin/pending-page.js.map +1 -1
  329. package/dist/merchant-admin/rfq-page.d.ts +105 -0
  330. package/dist/merchant-admin/rfq-page.js +176 -0
  331. package/dist/merchant-admin/rfq-page.js.map +1 -0
  332. package/dist/merchant-core/commands.d.ts +27 -0
  333. package/dist/merchant-core/commands.js +90 -1
  334. package/dist/merchant-core/commands.js.map +1 -1
  335. package/dist/merchant-core/executor.d.ts +27 -3
  336. package/dist/merchant-core/executor.js +13 -4
  337. package/dist/merchant-core/executor.js.map +1 -1
  338. package/dist/merchant-core/rfq/artifacts.d.ts +78 -0
  339. package/dist/merchant-core/rfq/artifacts.js +219 -0
  340. package/dist/merchant-core/rfq/artifacts.js.map +1 -0
  341. package/dist/merchant-core/rfq/data-source-adapter.d.ts +49 -0
  342. package/dist/merchant-core/rfq/data-source-adapter.js +128 -0
  343. package/dist/merchant-core/rfq/data-source-adapter.js.map +1 -0
  344. package/dist/merchant-core/rfq/delivery.d.ts +43 -0
  345. package/dist/merchant-core/rfq/delivery.js +57 -0
  346. package/dist/merchant-core/rfq/delivery.js.map +1 -0
  347. package/dist/merchant-core/rfq/fact-resolver.d.ts +76 -0
  348. package/dist/merchant-core/rfq/fact-resolver.js +220 -0
  349. package/dist/merchant-core/rfq/fact-resolver.js.map +1 -0
  350. package/dist/merchant-core/rfq/handoff.d.ts +54 -0
  351. package/dist/merchant-core/rfq/handoff.js +71 -0
  352. package/dist/merchant-core/rfq/handoff.js.map +1 -0
  353. package/dist/merchant-core/rfq/policy.d.ts +77 -0
  354. package/dist/merchant-core/rfq/policy.js +104 -0
  355. package/dist/merchant-core/rfq/policy.js.map +1 -0
  356. package/dist/merchant-core/rfq/pricing.d.ts +48 -0
  357. package/dist/merchant-core/rfq/pricing.js +150 -0
  358. package/dist/merchant-core/rfq/pricing.js.map +1 -0
  359. package/dist/merchant-core/rfq/quote-revisions.d.ts +52 -0
  360. package/dist/merchant-core/rfq/quote-revisions.js +126 -0
  361. package/dist/merchant-core/rfq/quote-revisions.js.map +1 -0
  362. package/dist/merchant-core/rfq/release-coordinator.d.ts +99 -0
  363. package/dist/merchant-core/rfq/release-coordinator.js +355 -0
  364. package/dist/merchant-core/rfq/release-coordinator.js.map +1 -0
  365. package/dist/merchant-core/rfq/repository.d.ts +398 -0
  366. package/dist/merchant-core/rfq/repository.js +855 -0
  367. package/dist/merchant-core/rfq/repository.js.map +1 -0
  368. package/dist/merchant-core/rfq/service.d.ts +398 -0
  369. package/dist/merchant-core/rfq/service.js +1036 -0
  370. package/dist/merchant-core/rfq/service.js.map +1 -0
  371. package/dist/merchant-core/rfq/source-records.d.ts +97 -0
  372. package/dist/merchant-core/rfq/source-records.js +349 -0
  373. package/dist/merchant-core/rfq/source-records.js.map +1 -0
  374. package/dist/merchant-core/rfq/types.d.ts +197 -0
  375. package/dist/merchant-core/rfq/types.js +110 -0
  376. package/dist/merchant-core/rfq/types.js.map +1 -0
  377. package/dist/merchant-core/service.d.ts +118 -1
  378. package/dist/merchant-core/service.js +202 -7
  379. package/dist/merchant-core/service.js.map +1 -1
  380. package/dist/merchant-core/storage/clock-skew-alerts.d.ts +21 -0
  381. package/dist/merchant-core/storage/clock-skew-alerts.js +67 -0
  382. package/dist/merchant-core/storage/clock-skew-alerts.js.map +1 -0
  383. package/dist/merchant-core/storage/leased-job.d.ts +42 -0
  384. package/dist/merchant-core/storage/leased-job.js +38 -0
  385. package/dist/merchant-core/storage/leased-job.js.map +1 -0
  386. package/dist/merchant-core/storage/operation-lifecycle.d.ts +78 -0
  387. package/dist/merchant-core/storage/operation-lifecycle.js +111 -0
  388. package/dist/merchant-core/storage/operation-lifecycle.js.map +1 -0
  389. package/dist/merchant-core/storage/redact.d.ts +29 -0
  390. package/dist/merchant-core/storage/redact.js +34 -0
  391. package/dist/merchant-core/storage/redact.js.map +1 -0
  392. package/dist/merchant-core/storage/schema.d.ts +24 -0
  393. package/dist/merchant-core/storage/schema.js +22 -0
  394. package/dist/merchant-core/storage/schema.js.map +1 -0
  395. package/dist/merchant-core/storage/transaction.d.ts +47 -0
  396. package/dist/merchant-core/storage/transaction.js +28 -0
  397. package/dist/merchant-core/storage/transaction.js.map +1 -0
  398. package/dist/merchant-gateway/catalog-publications.d.ts +25 -0
  399. package/dist/merchant-gateway/catalog-publications.js +37 -0
  400. package/dist/merchant-gateway/catalog-publications.js.map +1 -1
  401. package/dist/merchant-gateway/catalog-tools.js +42 -4
  402. package/dist/merchant-gateway/catalog-tools.js.map +1 -1
  403. package/dist/merchant-gateway/cli.js +6 -3
  404. package/dist/merchant-gateway/cli.js.map +1 -1
  405. package/dist/merchant-gateway/entry-server.js +57 -10
  406. package/dist/merchant-gateway/entry-server.js.map +1 -1
  407. package/dist/merchant-gateway/instance-registration.d.ts +1 -0
  408. package/dist/merchant-gateway/instance-registration.js +11 -2
  409. package/dist/merchant-gateway/instance-registration.js.map +1 -1
  410. package/dist/merchant-gateway/instance-tools.d.ts +3 -3
  411. package/dist/merchant-gateway/instance-tools.js +13 -11
  412. package/dist/merchant-gateway/instance-tools.js.map +1 -1
  413. package/dist/merchant-gateway/pinned-fetch.d.ts +3 -1
  414. package/dist/merchant-gateway/pinned-fetch.js +24 -5
  415. package/dist/merchant-gateway/pinned-fetch.js.map +1 -1
  416. package/dist/negotiation/domain/objects.d.ts +7 -0
  417. package/dist/negotiation/domain/objects.js +8 -0
  418. package/dist/negotiation/domain/objects.js.map +1 -1
  419. package/dist/negotiation/idempotency/store.d.ts +23 -0
  420. package/dist/negotiation/idempotency/store.js +72 -1
  421. package/dist/negotiation/idempotency/store.js.map +1 -1
  422. package/dist/negotiation/idempotency/types.d.ts +16 -0
  423. package/dist/negotiation/idempotency/types.js +2 -0
  424. package/dist/negotiation/idempotency/types.js.map +1 -1
  425. package/dist/negotiation/lease/store.d.ts +18 -22
  426. package/dist/negotiation/lease/store.js +133 -88
  427. package/dist/negotiation/lease/store.js.map +1 -1
  428. package/dist/negotiation/ledger/event.d.ts +6 -0
  429. package/dist/negotiation/ledger/event.js +1 -0
  430. package/dist/negotiation/ledger/event.js.map +1 -1
  431. package/dist/negotiation/ledger/index.d.ts +4 -2
  432. package/dist/negotiation/ledger/index.js +1 -0
  433. package/dist/negotiation/ledger/index.js.map +1 -1
  434. package/dist/negotiation/ledger/payload-segments.d.ts +51 -0
  435. package/dist/negotiation/ledger/payload-segments.js +247 -0
  436. package/dist/negotiation/ledger/payload-segments.js.map +1 -0
  437. package/dist/negotiation/ledger/store.d.ts +34 -0
  438. package/dist/negotiation/ledger/store.js +162 -0
  439. package/dist/negotiation/ledger/store.js.map +1 -1
  440. package/dist/negotiation/recovery/recover.js +1 -1
  441. package/dist/negotiation/recovery/recover.js.map +1 -1
  442. package/dist/privacy/ledger-payload-deletion.d.ts +10 -0
  443. package/dist/privacy/ledger-payload-deletion.js +31 -0
  444. package/dist/privacy/ledger-payload-deletion.js.map +1 -0
  445. package/dist/privacy/local-backup-deletion.d.ts +13 -0
  446. package/dist/privacy/local-backup-deletion.js +115 -0
  447. package/dist/privacy/local-backup-deletion.js.map +1 -0
  448. package/dist/privacy/workbench-retention.d.ts +105 -0
  449. package/dist/privacy/workbench-retention.js +501 -0
  450. package/dist/privacy/workbench-retention.js.map +1 -0
  451. package/dist/runtime/model.d.ts +1 -1
  452. package/dist/runtime/model.js +3 -3
  453. package/dist/runtime/model.js.map +1 -1
  454. package/dist/trust/binding/claims.d.ts +92 -0
  455. package/dist/trust/binding/claims.js +175 -0
  456. package/dist/trust/binding/claims.js.map +1 -0
  457. package/dist/trust/binding/thumbprint.d.ts +35 -0
  458. package/dist/trust/binding/thumbprint.js +88 -0
  459. package/dist/trust/binding/thumbprint.js.map +1 -0
  460. package/dist/trust/binding/verify.d.ts +84 -0
  461. package/dist/trust/binding/verify.js +121 -0
  462. package/dist/trust/binding/verify.js.map +1 -0
  463. package/dist/trust/identity/auth-verifier.d.ts +9 -0
  464. package/dist/trust/identity/auth-verifier.js +10 -2
  465. package/dist/trust/identity/auth-verifier.js.map +1 -1
  466. package/dist/trust/identity/jws.d.ts +22 -1
  467. package/dist/trust/identity/jws.js +31 -2
  468. package/dist/trust/identity/jws.js.map +1 -1
  469. package/package.json +12 -4
  470. package/skills/kiwi-buyer/SKILL.md +33 -2
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Copyright 2026 harrylabsj
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /** RFQ 业务错误(设计 v0.1.1 §11.3 错误码;MCP 层映射为带内错误)。 */
17
+ export type RfqErrorCode = "auth" | "forbidden" | "not_found" | "validation" | "unavailable" | "tenant_mismatch" | "needs_clarification" | "sku_ambiguous" | "source_unavailable" | "source_conflict" | "source_invalid" | "fact_stale" | "pricing_invalid" | "unsupported_term" | "policy_requires_review" | "version_conflict" | "approval_stale" | "idempotency_conflict" | "operation_unknown" | "case_closed" | "quote_expired";
18
+ export declare class RfqError extends Error {
19
+ readonly code: RfqErrorCode;
20
+ constructor(code: RfqErrorCode, message: string);
21
+ }
22
+ /**
23
+ * 规范化序列化(v0.1.1 §10.3)。数组保序;对象键 ASCII 且字典序排序;
24
+ * number 仅接受安全整数(浮点/非有限值拒绝——金额与数量绝不以浮点进入
25
+ * 摘要);undefined 键剔除(与既有 stableStringify 一致,重试幂等依赖它)。
26
+ */
27
+ export declare function canonicalJson(value: unknown): string;
28
+ /** 规范化 JSON 的 sha256 内容摘要(sha256: 前缀,与既有 contentHash 同风格)。 */
29
+ export declare function rfqContentDigest(value: unknown): string;
30
+ export declare const RFQ_STAGES: readonly ["NEW", "NEEDS_CLARIFICATION", "READY", "PRICED", "CLOSED", "CANCELLED"];
31
+ export type RfqStage = (typeof RFQ_STAGES)[number];
32
+ export declare const QUOTE_STATUSES: readonly ["DRAFT", "VALIDATED", "PENDING_APPROVAL", "APPROVED", "EXPORTED", "REJECTED", "SUPERSEDED", "EXPIRED"];
33
+ export type QuoteStatus = (typeof QUOTE_STATUSES)[number];
34
+ /** 报价生命周期事件(rfq_quote_events 投影;当前状态 = 最新事件)。 */
35
+ export type QuoteEventKind = Exclude<QuoteStatus, "DRAFT">;
36
+ export declare const DELIVERY_STATUSES: readonly ["NOT_SENT", "REPORTED_SENT", "RECEIPT_VERIFIED", "DELIVERY_UNKNOWN"];
37
+ export type DeliveryStatus = (typeof DELIVERY_STATUSES)[number];
38
+ export declare const HANDOFF_STATUSES: readonly ["PACKET_READY", "OWNER_RECORDED", "TARGET_VERIFIED", "REJECTED", "UNKNOWN"];
39
+ export type HandoffStatus = (typeof HANDOFF_STATUSES)[number];
40
+ export interface RfqLine {
41
+ line_id: string;
42
+ /** 客户原始需求描述(未经模型改写)。 */
43
+ query: string;
44
+ sku: string | null;
45
+ quantity: number | null;
46
+ unit: string | null;
47
+ confirmation: "unconfirmed" | "confirmed";
48
+ /** 服务端验证过的具名确认引用(模型自报 human_confirmed 不作数)。 */
49
+ confirmation_ref: string | null;
50
+ evidence_source_ids: string[];
51
+ }
52
+ export interface RfqTerms {
53
+ currency: "CNY";
54
+ tax_basis: "UNKNOWN" | "INCLUSIVE" | "EXCLUSIVE";
55
+ tax_rate_bps: number | null;
56
+ shipping_known: boolean;
57
+ shipping_minor: number | null;
58
+ /** 已确认交期表达(原文口径;不做自然语言承诺扩展)。 */
59
+ delivery_date: string | null;
60
+ payment_terms: string | null;
61
+ }
62
+ /** 一版需求 revision 的规范字段(rfq_case_revisions.fields_json)。 */
63
+ export interface RfqCaseFields {
64
+ client_ref: string;
65
+ recipient_ref: string | null;
66
+ lines: RfqLine[];
67
+ terms: RfqTerms;
68
+ }
69
+ /** 规范字段缺口(view 级投影;NEEDS_CLARIFICATION 的依据)。 */
70
+ export interface RfqBlocker {
71
+ field: string;
72
+ reason: string;
73
+ }
74
+ /** 文本来源定位:Unicode code point 半开区间(不是 UTF-8 字节偏移)。 */
75
+ export interface TextSpanLocator {
76
+ kind: "text_span";
77
+ character_start: number;
78
+ character_end: number;
79
+ quote: string;
80
+ }
81
+ /** CSV 来源定位:1 起算数据行号 + 列名。 */
82
+ export interface CsvCellLocator {
83
+ kind: "csv_cell";
84
+ row_start: number;
85
+ row_end: number;
86
+ column: string;
87
+ }
88
+ export type SourceLocator = TextSpanLocator | CsvCellLocator;
89
+ export type FactAuthority = "LOCAL_AUTHORITATIVE" | "UPSTREAM_PROXY" | "READ_ONLY";
90
+ /** 单字段事实(对齐 fact-snapshot.schema.json:八字段全必填)。 */
91
+ export interface FactField {
92
+ field_path: string;
93
+ value: string | number | boolean | null;
94
+ authority: FactAuthority;
95
+ source: string;
96
+ /** 源版本;上游未提供时记 "unknown"(发布时按缺验证阻断,§6.3)。 */
97
+ source_version: string;
98
+ verified_at: string;
99
+ /** 快照内过期时点(verified_at + fresh_for_seconds;无阈值时 = fetched_at + rules 阈值)。 */
100
+ expires_at: string;
101
+ /** 可见性:进入模型工具结果的字段必须 model_public(§15.2)。 */
102
+ visibility: "model_public" | "operator_only";
103
+ }
104
+ export type TaxBasis = "EXCLUSIVE" | "INCLUSIVE";
105
+ export interface PricingLineInput {
106
+ line_id: string;
107
+ /** SKU / 单位为透传字段(供投影与策略使用,不参与算术)。 */
108
+ sku?: string;
109
+ unit?: string;
110
+ quantity: number;
111
+ unit_price_minor: number;
112
+ discount_minor: number;
113
+ tax_basis: TaxBasis;
114
+ tax_rate_bps: number;
115
+ /** 字段证据来源(pricing-input.schema.json 必填;持久化时由服务层填)。 */
116
+ evidence_source_ids?: string[];
117
+ }
118
+ export interface PricingShippingInput {
119
+ amount_minor: number;
120
+ tax_basis: TaxBasis;
121
+ tax_rate_bps: number;
122
+ /** 字段证据来源(pricing-input.schema.json 必填;持久化时由服务层填)。 */
123
+ evidence_source_ids?: string[];
124
+ }
125
+ /** PricingEngine 的纯函数输入(§7.4:不接受模型提交的最终金额)。 */
126
+ export interface PricingInput {
127
+ schema_version: "0.1.0";
128
+ currency: "CNY";
129
+ rounding: "HALF_UP_LINE";
130
+ lines: PricingLineInput[];
131
+ shipping: PricingShippingInput;
132
+ }
133
+ export interface PricingSplit {
134
+ net_minor: number;
135
+ tax_minor: number;
136
+ gross_minor: number;
137
+ }
138
+ export interface PricingResult {
139
+ lines: Array<PricingSplit & {
140
+ line_id: string;
141
+ }>;
142
+ shipping: PricingSplit;
143
+ totals: PricingSplit;
144
+ }
145
+ /** 客户投影(公开字段白名单;绝不包含成本/底价/内部备注)。 */
146
+ export interface PublicQuoteView {
147
+ quote_id: string;
148
+ revision: number;
149
+ case_id: string;
150
+ case_revision: number;
151
+ status: QuoteStatus;
152
+ recipient_ref: string;
153
+ client_ref: string;
154
+ currency: "CNY";
155
+ totals: PricingSplit;
156
+ lines: Array<{
157
+ line_id: string;
158
+ sku: string;
159
+ quantity: number;
160
+ unit: string;
161
+ unit_price_minor: number;
162
+ discount_minor: number;
163
+ tax_basis: TaxBasis;
164
+ tax_rate_bps: number;
165
+ }>;
166
+ shipping: {
167
+ amount_minor: number;
168
+ tax_basis: TaxBasis;
169
+ tax_rate_bps: number;
170
+ };
171
+ delivery_terms: string;
172
+ payment_terms: string;
173
+ valid_until: string;
174
+ /** 数据截至时间 + 产品边界(§14.2 客户文件必含)。 */
175
+ data_as_of: string;
176
+ nonbinding_execution_boundary: string;
177
+ }
178
+ /** 两版报价的字段级差异(§11.1 compare;只读)。 */
179
+ export interface QuoteDiff {
180
+ from: {
181
+ quote_id: string;
182
+ revision: number;
183
+ status: QuoteStatus;
184
+ };
185
+ to: {
186
+ quote_id: string;
187
+ revision: number;
188
+ status: QuoteStatus;
189
+ };
190
+ changed: Array<{
191
+ field: string;
192
+ from: unknown;
193
+ to: unknown;
194
+ }>;
195
+ from_invalid_reason?: string;
196
+ to_invalid_reason?: string;
197
+ }
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Copyright 2026 harrylabsj
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * RFQ 工作台领域类型与序列化权威(询报价工作台设计 v0.1.1 §6/§8/§10.3)。
18
+ *
19
+ * 类型与 contracts/merchant-rfq/0.1.0/ 的八份 JSON Schema 对齐;schema 是
20
+ * 序列化权威,本文件类型经 tests/merchant-rfq 契约一致性测试维护。
21
+ *
22
+ * 内容摘要(rfq-canonical-json-v1):对象键限定 ASCII、按字典序排序、
23
+ * UTF-8、无多余空白、禁止浮点与非有限数值;字符串内容原样保存(不做
24
+ * 隐式 Unicode 归一)。它不是 KNP 的 JCS——禁止把此摘要替换现有 wire
25
+ * digest。对合法值与既有 contentHash 行为一致(契约测试覆盖)。
26
+ */
27
+ import { createHash } from "node:crypto";
28
+ export class RfqError extends Error {
29
+ code;
30
+ constructor(code, message) {
31
+ super(message);
32
+ this.name = "RfqError";
33
+ this.code = code;
34
+ }
35
+ }
36
+ // ---------------------------------------------------------------------------
37
+ // rfq-canonical-json-v1
38
+ // ---------------------------------------------------------------------------
39
+ const ASCII_KEY = /^[\x20-\x7E]+$/;
40
+ /**
41
+ * 规范化序列化(v0.1.1 §10.3)。数组保序;对象键 ASCII 且字典序排序;
42
+ * number 仅接受安全整数(浮点/非有限值拒绝——金额与数量绝不以浮点进入
43
+ * 摘要);undefined 键剔除(与既有 stableStringify 一致,重试幂等依赖它)。
44
+ */
45
+ export function canonicalJson(value) {
46
+ if (Array.isArray(value))
47
+ return `[${value.map(canonicalJson).join(",")}]`;
48
+ if (value !== null && typeof value === "object") {
49
+ const entries = Object.entries(value)
50
+ .filter(([, v]) => v !== undefined)
51
+ .map(([k, v]) => {
52
+ if (!ASCII_KEY.test(k)) {
53
+ throw new RfqError("validation", `rfq-canonical-json-v1:对象键必须为 ASCII(${k.slice(0, 8)}…)`);
54
+ }
55
+ return [k, v];
56
+ })
57
+ .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
58
+ .map(([k, v]) => `${JSON.stringify(k)}:${canonicalJson(v)}`);
59
+ return `{${entries.join(",")}}`;
60
+ }
61
+ if (typeof value === "number") {
62
+ if (!Number.isSafeInteger(value)) {
63
+ throw new RfqError("validation", "rfq-canonical-json-v1:禁止浮点与非有限数值");
64
+ }
65
+ return JSON.stringify(value);
66
+ }
67
+ if (typeof value === "bigint") {
68
+ throw new RfqError("validation", "rfq-canonical-json-v1:禁止 bigint(先转安全整数)");
69
+ }
70
+ return JSON.stringify(value) ?? "null";
71
+ }
72
+ /** 规范化 JSON 的 sha256 内容摘要(sha256: 前缀,与既有 contentHash 同风格)。 */
73
+ export function rfqContentDigest(value) {
74
+ return `sha256:${createHash("sha256").update(canonicalJson(value), "utf8").digest("hex")}`;
75
+ }
76
+ // ---------------------------------------------------------------------------
77
+ // 状态域(v0.1.1 §8.1;四个状态域独立维护,绝不相互推导)
78
+ // ---------------------------------------------------------------------------
79
+ export const RFQ_STAGES = [
80
+ "NEW",
81
+ "NEEDS_CLARIFICATION",
82
+ "READY",
83
+ "PRICED",
84
+ "CLOSED",
85
+ "CANCELLED",
86
+ ];
87
+ export const QUOTE_STATUSES = [
88
+ "DRAFT",
89
+ "VALIDATED",
90
+ "PENDING_APPROVAL",
91
+ "APPROVED",
92
+ "EXPORTED",
93
+ "REJECTED",
94
+ "SUPERSEDED",
95
+ "EXPIRED",
96
+ ];
97
+ export const DELIVERY_STATUSES = [
98
+ "NOT_SENT",
99
+ "REPORTED_SENT",
100
+ "RECEIPT_VERIFIED",
101
+ "DELIVERY_UNKNOWN",
102
+ ];
103
+ export const HANDOFF_STATUSES = [
104
+ "PACKET_READY",
105
+ "OWNER_RECORDED",
106
+ "TARGET_VERIFIED",
107
+ "REJECTED",
108
+ "UNKNOWN",
109
+ ];
110
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/merchant-core/rfq/types.ts"],"names":[],"mappings":"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"}
@@ -17,6 +17,10 @@ import type { A2aNegotiationRow } from "../merchant/workbench-service.js";
17
17
  import { MerchantWorkbenchService, type MerchantWorkbenchServiceDeps } from "../merchant/workbench-service.js";
18
18
  import type { MerchantOAuthStore } from "../auth/merchant-oauth.js";
19
19
  import { MerchantCommandLog } from "./commands.js";
20
+ import type { CommittedDecisionProof, CommittedDecisionVerifier } from "./commands.js";
21
+ import { type CommandExecutor } from "./executor.js";
22
+ import { type ExactMoney } from "../merchant/application/money.js";
23
+ import type { GrantAction, GrantResourceType } from "../merchant/grant-store.js";
20
24
  import type { ApplyPolicyResult } from "./policy-runtime.js";
21
25
  import type { MerchantPolicy } from "../config/profile.js";
22
26
  import type { MerchantOperation, MerchantOperationStore } from "./operations.js";
@@ -51,6 +55,18 @@ export interface MerchantCoreServiceDeps extends MerchantWorkbenchServiceDeps {
51
55
  merchantDataDir?: string;
52
56
  /** 一次性确认凭证存储(BUG-02;配置后 execute/reject 必须携带有效凭证)。 */
53
57
  confirmations?: MerchantOAuthStore;
58
+ /**
59
+ * RFQ 子服务(询报价工作台设计 v0.1.1 §11.1):配置后启用 rfq 工具面、
60
+ * 发布/移交执行器与管理页路由;不配置时对应能力 fail-closed「不可得」。
61
+ */
62
+ rfq?: {
63
+ service: import("./rfq/service.js").MerchantRfqService;
64
+ /** RFQ 固定执行器(发布/移交;静态合并进注册表)。 */
65
+ executors: import("./executor.js").CommandExecutor[];
66
+ };
67
+ /** Additional Workbench executors fixed at Runtime startup. */
68
+ extraExecutors?: CommandExecutor[];
69
+ requireCommittedProductDecisions?: boolean;
54
70
  }
55
71
  export declare class MerchantCoreService {
56
72
  /** V1 facade(委托转发;facade 语义不变)。 */
@@ -66,22 +82,38 @@ export declare class MerchantCoreService {
66
82
  private readonly confirmationStore?;
67
83
  private readonly operationsStore?;
68
84
  private readonly merchantDataDir?;
85
+ private readonly rfqDeps?;
86
+ private readonly extraExecutors;
87
+ private readonly depsRequireCommittedProductDecisions;
69
88
  private readonly now;
70
89
  private readonly principalId;
71
90
  private readonly approvalsRef;
72
91
  private readonly profileRef;
73
92
  private readonly modeRef;
74
93
  constructor(deps: MerchantCoreServiceDeps);
94
+ /** RFQ 子服务(未配置 → undefined;工具面 fail-closed)。 */
95
+ get rfqService(): import("./rfq/service.js").MerchantRfqService | undefined;
96
+ /**
97
+ * BD-03 管理面策略提交入口(未配置策略运行时 → undefined)。
98
+ * 回执只含版本与摘要——策略数值本身不出现在任何回执(红线 6)。
99
+ */
100
+ get policyApplier(): ((patch: Record<string, unknown>) => Promise<{
101
+ version: number;
102
+ digest: string;
103
+ }>) | undefined;
75
104
  listPublicProducts(): Promise<{
76
105
  items: import("../merchant/workbench-service.js").PublicProductView[];
77
106
  source: "data_source" | "merchant_client";
78
107
  }>;
79
108
  getPublicProduct(sku: string, merchantId?: string): Promise<import("../merchant/workbench-service.js").PublicProductView>;
109
+ listExactProducts(): Promise<import("../agent/merchant/types.js").ExactMerchantProduct[]>;
110
+ getExactProduct(sku: string): Promise<import("../agent/merchant/types.js").ExactMerchantProduct>;
80
111
  getInventorySnapshot(sku: string): Promise<import("../agent/merchant/types.js").InventorySnapshot>;
81
112
  listA2aNegotiations(limit?: unknown): Promise<{
82
113
  total: number;
83
114
  items: A2aNegotiationRow[];
84
115
  }>;
116
+ getA2aNegotiation(negotiationId: string): Promise<A2aNegotiationRow>;
85
117
  listActiveConsultations(): Promise<A2aNegotiationRow[]>;
86
118
  listHumanReviews(): Promise<import("../merchant/workbench-service.js").HumanReviewRow[]>;
87
119
  getAnalytics(period?: string): Promise<import("../agent/merchant/intelligence/types.js").MerchantBusinessSnapshot>;
@@ -96,18 +128,21 @@ export declare class MerchantCoreService {
96
128
  * 商家写,白烧人工确认)。 */
97
129
  prepareProductCreate(input: {
98
130
  product: unknown;
131
+ authorization?: Record<string, unknown>;
99
132
  reason?: string;
100
133
  }): Promise<import("./commands.js").PreparedCommand>;
101
134
  /** prepare:库存调整。 */
102
135
  prepareInventoryUpdate(input: {
103
136
  sku: string;
104
137
  stock: number;
138
+ authorization?: Record<string, unknown>;
105
139
  reason?: string;
106
140
  }): Promise<import("./commands.js").PreparedCommand>;
107
- /** prepare:listing 销售状态变更(F08 语义;上游不支持 → fail-closed「不可得」)。 */
141
+ /** prepare:listing 销售状态变更(F08 语义;能力探测 listing_pause=false → fail-closed「不可得」,不降级为库存写零)。 */
108
142
  prepareListingChange(input: {
109
143
  sku: string;
110
144
  paused: boolean;
145
+ authorization?: Record<string, unknown>;
111
146
  reason?: string;
112
147
  }): Promise<import("./commands.js").PreparedCommand>;
113
148
  /** prepare:人工处理(F14 两轨;A2A 轨执行面 fail-closed「不可得」留后续)。 */
@@ -122,12 +157,94 @@ export declare class MerchantCoreService {
122
157
  patch: Record<string, unknown>;
123
158
  reason?: string;
124
159
  }): Promise<import("./commands.js").PreparedCommand>;
160
+ prepareBroadcastPublish(input: {
161
+ broadcast: Record<string, unknown>;
162
+ authorization?: Record<string, unknown>;
163
+ workflowId?: string;
164
+ reason?: string;
165
+ }): Promise<import("./commands.js").PreparedCommand>;
166
+ prepareBroadcastRevise(input: {
167
+ broadcastId: string;
168
+ expectedRevision: number;
169
+ broadcast: Record<string, unknown>;
170
+ authorization?: Record<string, unknown>;
171
+ reason?: string;
172
+ }): Promise<import("./commands.js").PreparedCommand>;
173
+ prepareBroadcastWithdraw(input: {
174
+ broadcastId: string;
175
+ expectedRevision: number;
176
+ authorization?: Record<string, unknown>;
177
+ reason?: string;
178
+ }): Promise<import("./commands.js").PreparedCommand>;
179
+ prepareGrantCreate(input: {
180
+ ownerActorId: string;
181
+ subjectId: string;
182
+ action: GrantAction;
183
+ resourceType: GrantResourceType;
184
+ resourceSelector: "merchant" | "all_products" | readonly string[];
185
+ expiresAt: string;
186
+ reason?: string;
187
+ }): Promise<import("./commands.js").PreparedCommand>;
188
+ prepareGrantRevoke(input: {
189
+ ownerActorId: string;
190
+ grantId: string;
191
+ reason?: string;
192
+ }): Promise<import("./commands.js").PreparedCommand>;
193
+ preparePromotionPublish(input: {
194
+ promotionId: string;
195
+ expectedRevision: number;
196
+ workflowId?: string;
197
+ broadcastAuthorization?: Record<string, unknown>;
198
+ reason?: string;
199
+ }): Promise<import("./commands.js").PreparedCommand>;
200
+ preparePromotionWithdraw(input: {
201
+ promotionId: string;
202
+ expectedRevision: number;
203
+ reason?: string;
204
+ }): Promise<import("./commands.js").PreparedCommand>;
205
+ prepareExactProductCreate(input: {
206
+ sku: string;
207
+ title: string;
208
+ money: ExactMoney;
209
+ stock: number;
210
+ expectedAuthorityVersion: number;
211
+ authorization: Record<string, unknown>;
212
+ description?: string;
213
+ category?: string;
214
+ tags?: string[];
215
+ deliveryAttributes?: string[];
216
+ handoffDestination?: string;
217
+ reason?: string;
218
+ }): Promise<import("./commands.js").PreparedCommand>;
219
+ prepareExactProductMoneyUpdate(input: {
220
+ sku: string;
221
+ money: ExactMoney;
222
+ expectedAuthorityVersion: number;
223
+ authorization: Record<string, unknown>;
224
+ reason?: string;
225
+ }): Promise<import("./commands.js").PreparedCommand>;
226
+ prepareServiceResume(input: {
227
+ expectedRevision: number;
228
+ reason?: string;
229
+ }): Promise<import("./commands.js").PreparedCommand>;
125
230
  /** 确认通道:批准并执行(确认凭证 + 重校验 + 幂等 + 回读)。单商家单主体
126
231
  * 实例的便捷包装——主体恒为本实例 commandPrincipalId;跨主体校验在
127
232
  * commands.executeApproved(管理页传入会话主体时真实生效)。 */
128
233
  executeApproved(commandId: string, confirmationToken?: string): Promise<import("../agent/merchant/action-candidate.js").ApprovalExecutionResult>;
129
234
  /** 确认通道:拒绝候选(同上:单主体便捷包装)。 */
130
235
  rejectCandidate(commandId: string, confirmationToken?: string): Promise<import("../agent/merchant/action-candidate.js").WriteApprovalCandidate>;
236
+ executeCommittedDecision(input: Omit<CommittedDecisionProof, "actionDigest">, verifier: CommittedDecisionVerifier): Promise<import("../agent/merchant/action-candidate.js").WriteApprovalCandidate | import("../agent/merchant/action-candidate.js").ApprovalExecutionResult>;
237
+ getCommand(commandId: string): import("../agent/merchant/action-candidate.js").WriteApprovalCandidate | undefined;
238
+ commandExecutionWasClaimed(commandId: string): boolean | undefined;
239
+ queryCommittedDecisionOutcome(input: Omit<CommittedDecisionProof, "actionDigest">): Promise<{
240
+ status: "succeeded";
241
+ } | {
242
+ status: "failed";
243
+ error: string;
244
+ } | {
245
+ status: "unknown";
246
+ error: string;
247
+ }>;
131
248
  /**
132
249
  * 重启恢复(阶段三推广版):恢复全部已注册写工具的 pending 命令
133
250
  * (覆盖 V1 recoverPendingDrafts 语义并推广);未注册工具的死候选标 expired。