@harrylabsj/kiwi 0.12.3 → 0.12.5

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 (404) hide show
  1. package/README.md +1 -1
  2. package/contracts/kiwi-contracts.lock.json +1 -1
  3. package/dist/a2a/client/client.d.ts +3 -1
  4. package/dist/a2a/client/client.js +23 -14
  5. package/dist/a2a/client/client.js.map +1 -1
  6. package/dist/a2a/client/types.d.ts +1 -1
  7. package/dist/a2a/client/url-policy.d.ts +2 -1
  8. package/dist/a2a/client/url-policy.js +5 -2
  9. package/dist/a2a/client/url-policy.js.map +1 -1
  10. package/dist/a2a/negotiate.js +68 -27
  11. package/dist/a2a/negotiate.js.map +1 -1
  12. package/dist/a2a/node.d.ts +5 -1
  13. package/dist/a2a/node.js +68 -30
  14. package/dist/a2a/node.js.map +1 -1
  15. package/dist/a2a/server/merchant-handler.d.ts +4 -6
  16. package/dist/a2a/server/merchant-handler.js +679 -484
  17. package/dist/a2a/server/merchant-handler.js.map +1 -1
  18. package/dist/a2a/server/merchant-product-facts.d.ts +32 -0
  19. package/dist/a2a/server/merchant-product-facts.js +57 -0
  20. package/dist/a2a/server/merchant-product-facts.js.map +1 -0
  21. package/dist/a2a/server/pipeline.d.ts +1 -0
  22. package/dist/a2a/server/pipeline.js +48 -10
  23. package/dist/a2a/server/pipeline.js.map +1 -1
  24. package/dist/a2a/task/poller.d.ts +3 -0
  25. package/dist/a2a/task/poller.js +3 -0
  26. package/dist/a2a/task/poller.js.map +1 -1
  27. package/dist/agent/buyer/buyer-tools.d.ts +1 -1
  28. package/dist/agent/buyer/buyer-tools.js +322 -4
  29. package/dist/agent/buyer/buyer-tools.js.map +1 -1
  30. package/dist/agent/buyer/scheduler.d.ts +3 -0
  31. package/dist/agent/buyer/scheduler.js +25 -5
  32. package/dist/agent/buyer/scheduler.js.map +1 -1
  33. package/dist/agent/buyer/search-loop.js +6 -2
  34. package/dist/agent/buyer/search-loop.js.map +1 -1
  35. package/dist/agent/buyer/task-store.d.ts +12 -0
  36. package/dist/agent/buyer/task-store.js +101 -14
  37. package/dist/agent/buyer/task-store.js.map +1 -1
  38. package/dist/agent/kernel.d.ts +11 -0
  39. package/dist/agent/kernel.js +345 -273
  40. package/dist/agent/kernel.js.map +1 -1
  41. package/dist/agent/kiwi-tool.d.ts +11 -12
  42. package/dist/agent/merchant/action-candidate.d.ts +7 -0
  43. package/dist/agent/merchant/action-candidate.js +54 -9
  44. package/dist/agent/merchant/action-candidate.js.map +1 -1
  45. package/dist/agent/merchant/types.d.ts +4 -9
  46. package/dist/agent/merchant/types.js +14 -0
  47. package/dist/agent/merchant/types.js.map +1 -1
  48. package/dist/agent/negotiation-chat.js +36 -8
  49. package/dist/agent/negotiation-chat.js.map +1 -1
  50. package/dist/agent/session.js +8 -0
  51. package/dist/agent/session.js.map +1 -1
  52. package/dist/agent/write-gate.d.ts +4 -0
  53. package/dist/agent/write-gate.js +22 -20
  54. package/dist/agent/write-gate.js.map +1 -1
  55. package/dist/buyer-core/a2a-knp.d.ts +2 -8
  56. package/dist/buyer-core/a2a-knp.js +16 -3
  57. package/dist/buyer-core/a2a-knp.js.map +1 -1
  58. package/dist/buyer-core/a2a-negotiator.d.ts +26 -19
  59. package/dist/buyer-core/a2a-negotiator.js +105 -38
  60. package/dist/buyer-core/a2a-negotiator.js.map +1 -1
  61. package/dist/buyer-core/a2a-quote-fetcher.d.ts +17 -3
  62. package/dist/buyer-core/a2a-quote-fetcher.js +141 -57
  63. package/dist/buyer-core/a2a-quote-fetcher.js.map +1 -1
  64. package/dist/buyer-core/build-service.d.ts +2 -0
  65. package/dist/buyer-core/build-service.js +28 -2
  66. package/dist/buyer-core/build-service.js.map +1 -1
  67. package/dist/buyer-core/errors.js +1 -1
  68. package/dist/buyer-core/negotiator.d.ts +0 -15
  69. package/dist/buyer-core/negotiator.js +3 -0
  70. package/dist/buyer-core/negotiator.js.map +1 -1
  71. package/dist/buyer-core/product-summary.d.ts +4 -0
  72. package/dist/buyer-core/product-summary.js +6 -0
  73. package/dist/buyer-core/product-summary.js.map +1 -1
  74. package/dist/buyer-core/protocol-recovery.d.ts +78 -0
  75. package/dist/buyer-core/protocol-recovery.js +368 -0
  76. package/dist/buyer-core/protocol-recovery.js.map +1 -0
  77. package/dist/buyer-core/receive-gate.d.ts +11 -0
  78. package/dist/buyer-core/receive-gate.js +107 -0
  79. package/dist/buyer-core/receive-gate.js.map +1 -0
  80. package/dist/buyer-core/service.d.ts +53 -2
  81. package/dist/buyer-core/service.js +584 -74
  82. package/dist/buyer-core/service.js.map +1 -1
  83. package/dist/buyer-core/store.d.ts +27 -2
  84. package/dist/buyer-core/store.js +131 -26
  85. package/dist/buyer-core/store.js.map +1 -1
  86. package/dist/cli.js +208 -21
  87. package/dist/cli.js.map +1 -1
  88. package/dist/cloud/binding/enrollment-challenge.d.ts +1 -0
  89. package/dist/cloud/binding/enrollment-challenge.js +84 -33
  90. package/dist/cloud/binding/enrollment-challenge.js.map +1 -1
  91. package/dist/cloud/binding/enrollment-heartbeat.d.ts +2 -0
  92. package/dist/cloud/binding/enrollment-heartbeat.js +6 -2
  93. package/dist/cloud/binding/enrollment-heartbeat.js.map +1 -1
  94. package/dist/cloud/binding/proofs.d.ts +5 -0
  95. package/dist/cloud/binding/proofs.js +14 -1
  96. package/dist/cloud/binding/proofs.js.map +1 -1
  97. package/dist/cloud/binding/runtime-challenge.d.ts +2 -0
  98. package/dist/cloud/binding/runtime-challenge.js +20 -8
  99. package/dist/cloud/binding/runtime-challenge.js.map +1 -1
  100. package/dist/cloud/binding/store-lock.d.ts +13 -0
  101. package/dist/cloud/binding/store-lock.js +77 -0
  102. package/dist/cloud/binding/store-lock.js.map +1 -0
  103. package/dist/cloud/bootstrap.d.ts +4 -0
  104. package/dist/cloud/bootstrap.js +74 -57
  105. package/dist/cloud/bootstrap.js.map +1 -1
  106. package/dist/cloud/catalog-client.d.ts +4 -0
  107. package/dist/cloud/catalog-client.js +106 -29
  108. package/dist/cloud/catalog-client.js.map +1 -1
  109. package/dist/cloud/connect-service.d.ts +6 -0
  110. package/dist/cloud/connect-service.js +360 -120
  111. package/dist/cloud/connect-service.js.map +1 -1
  112. package/dist/cloud/file-listing-publication.js +6 -0
  113. package/dist/cloud/file-listing-publication.js.map +1 -1
  114. package/dist/cloud/main.d.ts +3 -0
  115. package/dist/cloud/main.js +47 -11
  116. package/dist/cloud/main.js.map +1 -1
  117. package/dist/cloud/onboarding/catalog-pipeline.d.ts +32 -1
  118. package/dist/cloud/onboarding/catalog-pipeline.js +80 -19
  119. package/dist/cloud/onboarding/catalog-pipeline.js.map +1 -1
  120. package/dist/cloud/onboarding/store.js +12 -4
  121. package/dist/cloud/onboarding/store.js.map +1 -1
  122. package/dist/cloud/product-import-tabular.d.ts +1 -1
  123. package/dist/cloud/product-import-tabular.js +275 -36
  124. package/dist/cloud/product-import-tabular.js.map +1 -1
  125. package/dist/cloud/product-source.d.ts +6 -1
  126. package/dist/cloud/product-source.js +47 -15
  127. package/dist/cloud/product-source.js.map +1 -1
  128. package/dist/commerce/data-source.d.ts +4 -0
  129. package/dist/commerce/data-source.js.map +1 -1
  130. package/dist/commerce/http-client.d.ts +30 -1
  131. package/dist/commerce/http-client.js +11 -7
  132. package/dist/commerce/http-client.js.map +1 -1
  133. package/dist/commerce/shopping-cli-source.js +4 -0
  134. package/dist/commerce/shopping-cli-source.js.map +1 -1
  135. package/dist/commerce/types.d.ts +2 -1
  136. package/dist/commerce/types.js.map +1 -1
  137. package/dist/counterparty/a2a-direct/index.js +2 -20
  138. package/dist/counterparty/a2a-direct/index.js.map +1 -1
  139. package/dist/counterparty/channel.d.ts +2 -1
  140. package/dist/counterparty/channel.js.map +1 -1
  141. package/dist/counterparty/shopping-cli-hosted/index.js +2 -24
  142. package/dist/counterparty/shopping-cli-hosted/index.js.map +1 -1
  143. package/dist/demo/demo-runner.d.ts +1 -1
  144. package/dist/demo/demo-runner.js +3 -6
  145. package/dist/demo/demo-runner.js.map +1 -1
  146. package/dist/discovery/catalog-source/cloud-card.d.ts +4 -3
  147. package/dist/discovery/catalog-source/cloud-card.js +28 -25
  148. package/dist/discovery/catalog-source/cloud-card.js.map +1 -1
  149. package/dist/discovery/catalog-source/kiwi-source.d.ts +7 -19
  150. package/dist/discovery/catalog-source/kiwi-source.js +19 -12
  151. package/dist/discovery/catalog-source/kiwi-source.js.map +1 -1
  152. package/dist/discovery/catalog-source/register.js +22 -12
  153. package/dist/discovery/catalog-source/register.js.map +1 -1
  154. package/dist/discovery/catalog-source/source.d.ts +3 -17
  155. package/dist/discovery/catalog-source/source.js +11 -8
  156. package/dist/discovery/catalog-source/source.js.map +1 -1
  157. package/dist/discovery/catalog-source/types.d.ts +3 -2
  158. package/dist/discovery/catalog-source/types.js +0 -15
  159. package/dist/discovery/catalog-source/types.js.map +1 -1
  160. package/dist/discovery/merchant-subscriptions.d.ts +4 -0
  161. package/dist/discovery/merchant-subscriptions.js +72 -23
  162. package/dist/discovery/merchant-subscriptions.js.map +1 -1
  163. package/dist/discovery/resolve.d.ts +7 -3
  164. package/dist/discovery/resolve.js +62 -30
  165. package/dist/discovery/resolve.js.map +1 -1
  166. package/dist/discovery/ucp/resolver.d.ts +3 -17
  167. package/dist/discovery/ucp/resolver.js +9 -3
  168. package/dist/discovery/ucp/resolver.js.map +1 -1
  169. package/dist/fanout/disclosure.js +27 -10
  170. package/dist/fanout/disclosure.js.map +1 -1
  171. package/dist/fanout/orchestrator.js +38 -24
  172. package/dist/fanout/orchestrator.js.map +1 -1
  173. package/dist/fs/atomic-write.d.ts +11 -0
  174. package/dist/fs/atomic-write.js +67 -10
  175. package/dist/fs/atomic-write.js.map +1 -1
  176. package/dist/handoff/index.d.ts +2 -1
  177. package/dist/handoff/index.js +1 -0
  178. package/dist/handoff/index.js.map +1 -1
  179. package/dist/handoff/launch-marketplace-policy.d.ts +149 -0
  180. package/dist/handoff/launch-marketplace-policy.js +301 -0
  181. package/dist/handoff/launch-marketplace-policy.js.map +1 -0
  182. package/dist/handoff/marketplace-product-link.d.ts +18 -0
  183. package/dist/handoff/marketplace-product-link.js +71 -0
  184. package/dist/handoff/marketplace-product-link.js.map +1 -0
  185. package/dist/handoff/order-record.js +25 -3
  186. package/dist/handoff/order-record.js.map +1 -1
  187. package/dist/handoff/transaction.d.ts +30 -0
  188. package/dist/handoff/transaction.js +64 -0
  189. package/dist/handoff/transaction.js.map +1 -1
  190. package/dist/handoff/ucp-checkout/channel.js +2 -1
  191. package/dist/handoff/ucp-checkout/channel.js.map +1 -1
  192. package/dist/handoff/ucp-checkout/client.d.ts +1 -0
  193. package/dist/handoff/ucp-checkout/client.js +48 -37
  194. package/dist/handoff/ucp-checkout/client.js.map +1 -1
  195. package/dist/handoff/url-safety.d.ts +3 -0
  196. package/dist/handoff/url-safety.js +7 -0
  197. package/dist/handoff/url-safety.js.map +1 -1
  198. package/dist/http/bounded-ip-rate-limit.d.ts +10 -0
  199. package/dist/http/bounded-ip-rate-limit.js +37 -0
  200. package/dist/http/bounded-ip-rate-limit.js.map +1 -0
  201. package/dist/http/cli.js +23 -0
  202. package/dist/http/cli.js.map +1 -1
  203. package/dist/http/merchant-feed-api.js +8 -1
  204. package/dist/http/merchant-feed-api.js.map +1 -1
  205. package/dist/http/merchant-management/api.js +20 -1
  206. package/dist/http/merchant-management/api.js.map +1 -1
  207. package/dist/http/merchant-management/page.js +176 -45
  208. package/dist/http/merchant-management/page.js.map +1 -1
  209. package/dist/http/merchant-management/reconciliation-worker.js +5 -2
  210. package/dist/http/merchant-management/reconciliation-worker.js.map +1 -1
  211. package/dist/http/merchant-management/trusted-page.js +1 -1
  212. package/dist/http/merchant-management/trusted-page.js.map +1 -1
  213. package/dist/http/merchant-server.js +2 -1
  214. package/dist/http/merchant-server.js.map +1 -1
  215. package/dist/http/server.d.ts +15 -0
  216. package/dist/http/server.js +107 -9
  217. package/dist/http/server.js.map +1 -1
  218. package/dist/i18n.d.ts +1 -0
  219. package/dist/i18n.js +3 -0
  220. package/dist/i18n.js.map +1 -1
  221. package/dist/lifecycle/close.d.ts +24 -0
  222. package/dist/lifecycle/close.js +131 -0
  223. package/dist/lifecycle/close.js.map +1 -0
  224. package/dist/mcp/merchant-rfq-tools.d.ts +6 -4
  225. package/dist/mcp/merchant-rfq-tools.js +2 -0
  226. package/dist/mcp/merchant-rfq-tools.js.map +1 -1
  227. package/dist/mcp/merchant-runtime-assembly.js +7 -22
  228. package/dist/mcp/merchant-runtime-assembly.js.map +1 -1
  229. package/dist/mcp/merchant-server.d.ts +0 -22
  230. package/dist/mcp/merchant-server.js +25 -2
  231. package/dist/mcp/merchant-server.js.map +1 -1
  232. package/dist/mcp/tools.js +17 -16
  233. package/dist/mcp/tools.js.map +1 -1
  234. package/dist/mcp/types.d.ts +1 -1
  235. package/dist/mcp/types.js +1 -1
  236. package/dist/merchant/ai-runtime/config.d.ts +99 -0
  237. package/dist/merchant/ai-runtime/config.js +187 -0
  238. package/dist/merchant/ai-runtime/config.js.map +1 -0
  239. package/dist/merchant/ai-runtime/gate.d.ts +142 -0
  240. package/dist/merchant/ai-runtime/gate.js +343 -0
  241. package/dist/merchant/ai-runtime/gate.js.map +1 -0
  242. package/dist/merchant/ai-runtime/owner-authoritative-receipts.d.ts +5 -0
  243. package/dist/merchant/ai-runtime/owner-authoritative-receipts.js +53 -0
  244. package/dist/merchant/ai-runtime/owner-authoritative-receipts.js.map +1 -0
  245. package/dist/merchant/ai-runtime/owner-budget-gate.d.ts +10 -0
  246. package/dist/merchant/ai-runtime/owner-budget-gate.js +37 -0
  247. package/dist/merchant/ai-runtime/owner-budget-gate.js.map +1 -0
  248. package/dist/merchant/ai-runtime/owner-business-config.d.ts +33 -0
  249. package/dist/merchant/ai-runtime/owner-business-config.js +93 -0
  250. package/dist/merchant/ai-runtime/owner-business-config.js.map +1 -0
  251. package/dist/merchant/ai-runtime/owner-business-host.d.ts +24 -0
  252. package/dist/merchant/ai-runtime/owner-business-host.js +114 -0
  253. package/dist/merchant/ai-runtime/owner-business-host.js.map +1 -0
  254. package/dist/merchant/ai-runtime/owner-business-proof-contract.d.ts +26 -0
  255. package/dist/merchant/ai-runtime/owner-business-proof-contract.js +2 -0
  256. package/dist/merchant/ai-runtime/owner-business-proof-contract.js.map +1 -0
  257. package/dist/merchant/ai-runtime/owner-committed-proof.d.ts +55 -0
  258. package/dist/merchant/ai-runtime/owner-committed-proof.js +141 -0
  259. package/dist/merchant/ai-runtime/owner-committed-proof.js.map +1 -0
  260. package/dist/merchant/ai-runtime/owner-factory-config.d.ts +30 -0
  261. package/dist/merchant/ai-runtime/owner-factory-config.js +99 -0
  262. package/dist/merchant/ai-runtime/owner-factory-config.js.map +1 -0
  263. package/dist/merchant/ai-runtime/owner-file-grant.d.ts +71 -0
  264. package/dist/merchant/ai-runtime/owner-file-grant.js +118 -0
  265. package/dist/merchant/ai-runtime/owner-file-grant.js.map +1 -0
  266. package/dist/merchant/ai-runtime/owner-local-readonly-host.d.ts +17 -0
  267. package/dist/merchant/ai-runtime/owner-local-readonly-host.js +116 -0
  268. package/dist/merchant/ai-runtime/owner-local-readonly-host.js.map +1 -0
  269. package/dist/merchant/ai-runtime/owner-operation-reader.d.ts +24 -0
  270. package/dist/merchant/ai-runtime/owner-operation-reader.js +62 -0
  271. package/dist/merchant/ai-runtime/owner-operation-reader.js.map +1 -0
  272. package/dist/merchant/ai-runtime/owner-provider-guard.d.ts +9 -0
  273. package/dist/merchant/ai-runtime/owner-provider-guard.js +127 -0
  274. package/dist/merchant/ai-runtime/owner-provider-guard.js.map +1 -0
  275. package/dist/merchant/ai-runtime/owner-readonly-facts.d.ts +26 -0
  276. package/dist/merchant/ai-runtime/owner-readonly-facts.js +72 -0
  277. package/dist/merchant/ai-runtime/owner-readonly-facts.js.map +1 -0
  278. package/dist/merchant/ai-runtime/owner-sdk-tools.d.ts +43 -0
  279. package/dist/merchant/ai-runtime/owner-sdk-tools.js +83 -0
  280. package/dist/merchant/ai-runtime/owner-sdk-tools.js.map +1 -0
  281. package/dist/merchant/ai-runtime/owner-session.d.ts +341 -0
  282. package/dist/merchant/ai-runtime/owner-session.js +1280 -0
  283. package/dist/merchant/ai-runtime/owner-session.js.map +1 -0
  284. package/dist/merchant/ai-runtime/owner-storage-admission.d.ts +35 -0
  285. package/dist/merchant/ai-runtime/owner-storage-admission.js +324 -0
  286. package/dist/merchant/ai-runtime/owner-storage-admission.js.map +1 -0
  287. package/dist/merchant/ai-runtime/owner-trusted-factory.d.ts +44 -0
  288. package/dist/merchant/ai-runtime/owner-trusted-factory.js +185 -0
  289. package/dist/merchant/ai-runtime/owner-trusted-factory.js.map +1 -0
  290. package/dist/merchant/ai-runtime/sqlite-budget-store.d.ts +68 -0
  291. package/dist/merchant/ai-runtime/sqlite-budget-store.js +335 -0
  292. package/dist/merchant/ai-runtime/sqlite-budget-store.js.map +1 -0
  293. package/dist/merchant/ai-runtime/status.d.ts +64 -0
  294. package/dist/merchant/ai-runtime/status.js +56 -0
  295. package/dist/merchant/ai-runtime/status.js.map +1 -0
  296. package/dist/merchant/application/service.d.ts +5 -1
  297. package/dist/merchant/application/service.js +7 -8
  298. package/dist/merchant/application/service.js.map +1 -1
  299. package/dist/merchant/grant-store.js +9 -4
  300. package/dist/merchant/grant-store.js.map +1 -1
  301. package/dist/merchant/promotion-store.js +1 -0
  302. package/dist/merchant/promotion-store.js.map +1 -1
  303. package/dist/merchant/stats-store.d.ts +3 -0
  304. package/dist/merchant/stats-store.js +28 -8
  305. package/dist/merchant/stats-store.js.map +1 -1
  306. package/dist/merchant/workbench-service.d.ts +1 -0
  307. package/dist/merchant/workbench-service.js +28 -11
  308. package/dist/merchant/workbench-service.js.map +1 -1
  309. package/dist/merchant-core/commands.d.ts +3 -0
  310. package/dist/merchant-core/commands.js +39 -2
  311. package/dist/merchant-core/commands.js.map +1 -1
  312. package/dist/merchant-core/executor.d.ts +2 -0
  313. package/dist/merchant-core/executor.js +1 -1
  314. package/dist/merchant-core/executor.js.map +1 -1
  315. package/dist/merchant-core/operations.d.ts +2 -2
  316. package/dist/merchant-core/operations.js +11 -9
  317. package/dist/merchant-core/operations.js.map +1 -1
  318. package/dist/merchant-core/product-import.js +1 -1
  319. package/dist/merchant-core/product-import.js.map +1 -1
  320. package/dist/merchant-core/rfq/data-source-adapter.d.ts +2 -10
  321. package/dist/merchant-core/rfq/data-source-adapter.js +21 -9
  322. package/dist/merchant-core/rfq/data-source-adapter.js.map +1 -1
  323. package/dist/merchant-core/rfq/pending-candidates.d.ts +14 -0
  324. package/dist/merchant-core/rfq/pending-candidates.js +11 -0
  325. package/dist/merchant-core/rfq/pending-candidates.js.map +1 -0
  326. package/dist/merchant-core/rfq/release-coordinator.d.ts +9 -2
  327. package/dist/merchant-core/rfq/release-coordinator.js +32 -14
  328. package/dist/merchant-core/rfq/release-coordinator.js.map +1 -1
  329. package/dist/merchant-core/rfq/repository.d.ts +4 -7
  330. package/dist/merchant-core/rfq/repository.js +10 -24
  331. package/dist/merchant-core/rfq/repository.js.map +1 -1
  332. package/dist/merchant-core/rfq/service.d.ts +5 -2
  333. package/dist/merchant-core/rfq/service.js +4 -3
  334. package/dist/merchant-core/rfq/service.js.map +1 -1
  335. package/dist/merchant-gateway/entry-server.js +25 -1
  336. package/dist/merchant-gateway/entry-server.js.map +1 -1
  337. package/dist/merchant-gateway/pinned-fetch.d.ts +9 -2
  338. package/dist/merchant-gateway/pinned-fetch.js +68 -29
  339. package/dist/merchant-gateway/pinned-fetch.js.map +1 -1
  340. package/dist/merchant-runtime/manager.d.ts +5 -2
  341. package/dist/merchant-runtime/manager.js +40 -11
  342. package/dist/merchant-runtime/manager.js.map +1 -1
  343. package/dist/negotiation/context-map/store.js +4 -13
  344. package/dist/negotiation/context-map/store.js.map +1 -1
  345. package/dist/negotiation/domain/common.js +33 -2
  346. package/dist/negotiation/domain/common.js.map +1 -1
  347. package/dist/negotiation/domain/envelope.d.ts +2 -5
  348. package/dist/negotiation/domain/envelope.js +36 -9
  349. package/dist/negotiation/domain/envelope.js.map +1 -1
  350. package/dist/negotiation/domain/objects.js +14 -0
  351. package/dist/negotiation/domain/objects.js.map +1 -1
  352. package/dist/negotiation/idempotency/store.d.ts +4 -1
  353. package/dist/negotiation/idempotency/store.js +80 -52
  354. package/dist/negotiation/idempotency/store.js.map +1 -1
  355. package/dist/negotiation/idempotency/types.d.ts +7 -1
  356. package/dist/negotiation/idempotency/types.js +1 -1
  357. package/dist/negotiation/idempotency/types.js.map +1 -1
  358. package/dist/negotiation/jcs.js +11 -16
  359. package/dist/negotiation/jcs.js.map +1 -1
  360. package/dist/negotiation/ledger/store.d.ts +15 -9
  361. package/dist/negotiation/ledger/store.js +201 -65
  362. package/dist/negotiation/ledger/store.js.map +1 -1
  363. package/dist/negotiation/recovery/recover.js +30 -30
  364. package/dist/negotiation/recovery/recover.js.map +1 -1
  365. package/dist/negotiation/recovery/types.d.ts +3 -3
  366. package/dist/net/request-budget.d.ts +17 -0
  367. package/dist/net/request-budget.js +63 -0
  368. package/dist/net/request-budget.js.map +1 -0
  369. package/dist/operator/controller.d.ts +1 -1
  370. package/dist/operator/controller.js +23 -12
  371. package/dist/operator/controller.js.map +1 -1
  372. package/dist/operator/runner.d.ts +69 -0
  373. package/dist/operator/runner.js +260 -39
  374. package/dist/operator/runner.js.map +1 -1
  375. package/dist/operator/strategy.d.ts +2 -0
  376. package/dist/operator/strategy.js +11 -0
  377. package/dist/operator/strategy.js.map +1 -1
  378. package/dist/privacy/workbench-retention.js +28 -10
  379. package/dist/privacy/workbench-retention.js.map +1 -1
  380. package/dist/product-init.js +25 -4
  381. package/dist/product-init.js.map +1 -1
  382. package/dist/product-publish.js +3 -102
  383. package/dist/product-publish.js.map +1 -1
  384. package/dist/runtime/foreground.d.ts +1 -1
  385. package/dist/runtime/foreground.js +3 -0
  386. package/dist/runtime/foreground.js.map +1 -1
  387. package/dist/runtime/model.js +4 -0
  388. package/dist/runtime/model.js.map +1 -1
  389. package/dist/supervisor/manage.js +109 -35
  390. package/dist/supervisor/manage.js.map +1 -1
  391. package/dist/trust/identity/jws.js +46 -5
  392. package/dist/trust/identity/jws.js.map +1 -1
  393. package/dist/trust/identity/message-signature.js +15 -2
  394. package/dist/trust/identity/message-signature.js.map +1 -1
  395. package/dist/trust/records/store.d.ts +8 -1
  396. package/dist/trust/records/store.js +68 -6
  397. package/dist/trust/records/store.js.map +1 -1
  398. package/dist/weixin/channel.d.ts +4 -0
  399. package/dist/weixin/channel.js +17 -3
  400. package/dist/weixin/channel.js.map +1 -1
  401. package/dist/weixin/cli-weixin.js +8 -2
  402. package/dist/weixin/cli-weixin.js.map +1 -1
  403. package/package.json +30 -7
  404. package/scripts/check-install-toolchain.mjs +93 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harrylabsj/kiwi",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "description": "Kiwi: standalone A2A commerce negotiation agent runtime (Pi Agent Core + shopping-cli Commerce API)",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -19,7 +19,8 @@
19
19
  "dist",
20
20
  "contracts",
21
21
  "examples",
22
- "skills"
22
+ "skills",
23
+ "scripts/check-install-toolchain.mjs"
23
24
  ],
24
25
  "scripts": {
25
26
  "build": "tsc -p tsconfig.build.json",
@@ -54,14 +55,16 @@
54
55
  "verify:delivery-manifest": "node scripts/verify-delivery-manifest.mjs"
55
56
  },
56
57
  "dependencies": {
57
- "@earendil-works/pi-agent-core": "0.87.1",
58
- "@earendil-works/pi-ai": "0.87.1",
59
- "@earendil-works/pi-coding-agent": "0.87.1",
58
+ "@earendil-works/pi-agent-core": "^1.2.0",
59
+ "@earendil-works/pi-ai": "^1.2.0",
60
+ "@earendil-works/pi-coding-agent": "^1.2.0",
60
61
  "@modelcontextprotocol/sdk": "^1.30.0",
61
62
  "@simplewebauthn/server": "14.0.2",
62
63
  "ajv": "8.20.0",
63
64
  "ajv-formats": "3.0.1",
64
- "yaml": "2.9.1"
65
+ "yaml": "2.9.1",
66
+ "@earendil-works/pi-durable": "^1.2.0",
67
+ "typebox": "1.3.27"
65
68
  },
66
69
  "devDependencies": {
67
70
  "@a2a-js/sdk": "^1.0.1",
@@ -76,7 +79,8 @@
76
79
  "prettier": "^3.5.3",
77
80
  "qrcode": "^1.5.4",
78
81
  "typescript": "^6.0.3",
79
- "vitest": "^4.1.11"
82
+ "vitest": "^4.1.11",
83
+ "esbuild": "^0.28.2"
80
84
  },
81
85
  "publishConfig": {
82
86
  "access": "public"
@@ -84,5 +88,24 @@
84
88
  "repository": {
85
89
  "type": "git",
86
90
  "url": "git+https://github.com/harrylabsj/kiwi.git"
91
+ },
92
+ "overrides": {
93
+ "brace-expansion": "5.0.12"
94
+ },
95
+ "allowScripts": {
96
+ "@google/genai@2.21.0": true,
97
+ "fsevents@2.3.3": true,
98
+ "protobufjs@7.6.6": true
99
+ },
100
+ "packageManager": "npm@12.2.0",
101
+ "devEngines": {
102
+ "runtime": {
103
+ "name": "node",
104
+ "onFail": "error"
105
+ },
106
+ "packageManager": {
107
+ "name": "npm",
108
+ "onFail": "error"
109
+ }
87
110
  }
88
111
  }
@@ -0,0 +1,93 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Copyright 2026 harrylabsj
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ /**
19
+ * A106 安装工具契约守卫(preinstall,fail-closed)— 0.12.5 起。
20
+ *
21
+ * 不变量:本包的安装产物中不得存在已知脆弱的嵌套依赖副本。
22
+ * 背景(A92/A94/A97/A100 实证链):pi-coding-agent ≤1.0.2 的 npm-shrinkwrap
23
+ * 曾钉嵌套 brace-expansion 5.0.9(GHSA-q2hr-2g5m-vwhr / GHSA-qhr7-859c-m2p7 /
24
+ * GHSA-6j4f-fj2g-mc7p),旧 npm 无法用 override 穿透,故 0.12.4 曾按
25
+ * npm >=12.0.2 <13 fail-closed。上游 1.2.0 已移除 shrinkwrap、原始树即干净
26
+ * (实测 brace-expansion 仅 5.0.12),本守卫转为直接校验树内容,任何
27
+ * 安装器版本均可安装;若脆弱副本再次出现,无论 npm 版本一律拒绝。
28
+ */
29
+
30
+ import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
31
+ import path from "node:path";
32
+
33
+ const VULNERABLE = [
34
+ { name: "brace-expansion", version: "5.0.9", ghsa: "GHSA-q2hr-2g5m-vwhr" },
35
+ ];
36
+
37
+ /** 深度优先收集 <dir> 树内 name 包的全部安装副本(含任意嵌套 node_modules 与 @scope)。 */
38
+ function collectCopies(dir, name, out, depth = 0) {
39
+ if (depth > 24 || out.length > 5000) return;
40
+ const nm = path.join(dir, "node_modules");
41
+ let entries = [];
42
+ try {
43
+ entries = readdirSync(nm, { withFileTypes: true });
44
+ } catch {
45
+ return;
46
+ }
47
+ for (const e of entries) {
48
+ if (!e.isDirectory() || e.name.startsWith(".")) continue;
49
+ if (e.name.startsWith("@")) {
50
+ let scoped = [];
51
+ try {
52
+ scoped = readdirSync(path.join(nm, e.name), { withFileTypes: true });
53
+ } catch {
54
+ continue;
55
+ }
56
+ for (const s of scoped) {
57
+ if (!s.isDirectory() || s.name.startsWith(".")) continue;
58
+ recordIfVulnerable(path.join(nm, e.name, s.name), name, out);
59
+ collectCopies(path.join(nm, e.name, s.name), name, out, depth + 1);
60
+ }
61
+ } else {
62
+ recordIfVulnerable(path.join(nm, e.name), name, out);
63
+ collectCopies(path.join(nm, e.name), name, out, depth + 1);
64
+ }
65
+ }
66
+ }
67
+
68
+ function recordIfVulnerable(pkgDir, name, out) {
69
+ if (path.basename(pkgDir) !== name) return;
70
+ if (!existsSync(pkgDir) || !statSync(pkgDir).isDirectory()) return;
71
+ try {
72
+ const v = JSON.parse(readFileSync(path.join(pkgDir, "package.json"), "utf8")).version;
73
+ const vuln = VULNERABLE.find((x) => x.name === name && x.version === v);
74
+ if (vuln) out.push(`${name}@${v} at ${pkgDir} (${vuln.ghsa})`);
75
+ } catch {
76
+ /* unreadable package.json: skip */
77
+ }
78
+ }
79
+
80
+ const root = process.env.npm_config_local_prefix || process.cwd();
81
+ const offenders = [];
82
+ for (const vuln of VULNERABLE) {
83
+ collectCopies(root, vuln.name, offenders);
84
+ }
85
+
86
+ if (offenders.length > 0) {
87
+ console.error(
88
+ "[a106] vulnerable nested dependency copy detected — refusing to install (fail-closed):\n " +
89
+ offenders.join("\n "),
90
+ );
91
+ process.exit(1);
92
+ }
93
+ console.log("[a106] dependency tree invariant OK");