aimeat 2.1.0 → 2.2.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 (422) hide show
  1. package/dist/.env.example +9 -4
  2. package/dist/locales/en.json +28 -0
  3. package/dist/locales/fi.json +28 -0
  4. package/dist/public/cortex-bundled/aimeat-charts.js +158 -10
  5. package/dist/public/cortex-bundled/aimeat-charts.yaml +1 -1
  6. package/dist/public/cortex-bundled/aimeat-dag.js +515 -173
  7. package/dist/public/cortex-bundled/aimeat-dag.yaml +1 -1
  8. package/dist/public/cortex-bundled/aimeat-i18n.js +6 -1
  9. package/dist/public/cortex-bundled/aimeat-i18n.yaml +1 -1
  10. package/dist/public/cortex-bundled/aimeat-surface.js +577 -0
  11. package/dist/public/cortex-bundled/aimeat-surface.yaml +107 -0
  12. package/dist/public/cortex-bundled/aimeat-viewport.js +405 -0
  13. package/dist/public/cortex-bundled/aimeat-viewport.yaml +100 -0
  14. package/dist/public/css/views/inbox.css +1 -1
  15. package/dist/public/css/views/profile.css +9 -0
  16. package/dist/public/lib/VENDORED.md +6 -3
  17. package/dist/public/lib/aimeat-daisyui-bridge.css +39 -2
  18. package/dist/public/lib/aimeat-theme.css +538 -0
  19. package/dist/public/lib/fonts/LICENSE.md +11 -4
  20. package/dist/public/lib/fonts/fraunces-var-latin-ext.woff2 +0 -0
  21. package/dist/public/lib/fonts/fraunces-var-latin.woff2 +0 -0
  22. package/dist/public/lib/fonts/inter-var-latin-ext.woff2 +0 -0
  23. package/dist/public/lib/fonts/inter-var-latin.woff2 +0 -0
  24. package/dist/public/lib/fonts/jetbrains-mono-var-latin-ext.woff2 +0 -0
  25. package/dist/public/lib/fonts/jetbrains-mono-var-latin.woff2 +0 -0
  26. package/dist/public/lib/fonts/space-grotesk-var-latin-ext.woff2 +0 -0
  27. package/dist/public/lib/fonts/space-grotesk-var-latin.woff2 +0 -0
  28. package/dist/public/lib/samples/theme-check.html +92 -0
  29. package/dist/public/lib/samples/themes-boot.js +20 -0
  30. package/dist/public/lib/samples/themes.html +154 -0
  31. package/dist/public/lib/samples/themes.js +60 -0
  32. package/dist/public/views/profile/access-tab/connected-apps.js +81 -5
  33. package/dist/public/views/profile/extensions-tab.maturity.js +4 -1
  34. package/dist/public/views/profile/inbox-tab/components.js +17 -1
  35. package/dist/public/views/profile/inbox-tab/use-thread-ux.js +29 -2
  36. package/dist/public/views/profile/libraries-tab.js +10 -2
  37. package/dist/public/views/profile/wallet-tab.js +64 -0
  38. package/dist/scripts/check-openapi.d.ts +2 -0
  39. package/dist/scripts/check-openapi.d.ts.map +1 -0
  40. package/dist/scripts/check-openapi.js +139 -0
  41. package/dist/scripts/check-openapi.js.map +1 -0
  42. package/dist/scripts/embed-viewport.d.ts +23 -0
  43. package/dist/scripts/embed-viewport.d.ts.map +1 -0
  44. package/dist/scripts/embed-viewport.js +116 -0
  45. package/dist/scripts/embed-viewport.js.map +1 -0
  46. package/dist/src/auth/sse-domain-scopes.d.ts +50 -0
  47. package/dist/src/auth/sse-domain-scopes.d.ts.map +1 -0
  48. package/dist/src/auth/sse-domain-scopes.js +111 -0
  49. package/dist/src/auth/sse-domain-scopes.js.map +1 -0
  50. package/dist/src/cli/connect/mcp/tools/agent-tasks.d.ts.map +1 -1
  51. package/dist/src/cli/connect/mcp/tools/agent-tasks.js +4 -1
  52. package/dist/src/cli/connect/mcp/tools/agent-tasks.js.map +1 -1
  53. package/dist/src/cli/connect/mcp/tools/core.d.ts.map +1 -1
  54. package/dist/src/cli/connect/mcp/tools/core.js +14 -3
  55. package/dist/src/cli/connect/mcp/tools/core.js.map +1 -1
  56. package/dist/src/cli/connect/mcp/tools/workspaces.d.ts +3 -0
  57. package/dist/src/cli/connect/mcp/tools/workspaces.d.ts.map +1 -1
  58. package/dist/src/cli/connect/mcp/tools/workspaces.js +4 -2
  59. package/dist/src/cli/connect/mcp/tools/workspaces.js.map +1 -1
  60. package/dist/src/cli/connect/tool-call-defs-core.d.ts.map +1 -1
  61. package/dist/src/cli/connect/tool-call-defs-core.js +13 -1
  62. package/dist/src/cli/connect/tool-call-defs-core.js.map +1 -1
  63. package/dist/src/commerce/__tests__/x402-registry.test.d.ts +2 -0
  64. package/dist/src/commerce/__tests__/x402-registry.test.d.ts.map +1 -0
  65. package/dist/src/commerce/__tests__/x402-registry.test.js +105 -0
  66. package/dist/src/commerce/__tests__/x402-registry.test.js.map +1 -0
  67. package/dist/src/commerce/evm-address.d.ts +21 -0
  68. package/dist/src/commerce/evm-address.d.ts.map +1 -0
  69. package/dist/src/commerce/evm-address.js +94 -0
  70. package/dist/src/commerce/evm-address.js.map +1 -0
  71. package/dist/src/commerce/money.d.ts +18 -5
  72. package/dist/src/commerce/money.d.ts.map +1 -1
  73. package/dist/src/commerce/money.js +27 -6
  74. package/dist/src/commerce/money.js.map +1 -1
  75. package/dist/src/commerce/x402-facilitator.d.ts +64 -13
  76. package/dist/src/commerce/x402-facilitator.d.ts.map +1 -1
  77. package/dist/src/commerce/x402-facilitator.js +71 -19
  78. package/dist/src/commerce/x402-facilitator.js.map +1 -1
  79. package/dist/src/commerce/x402-handler.d.ts +13 -7
  80. package/dist/src/commerce/x402-handler.d.ts.map +1 -1
  81. package/dist/src/commerce/x402-handler.js +23 -10
  82. package/dist/src/commerce/x402-handler.js.map +1 -1
  83. package/dist/src/commerce/x402.d.ts +11 -6
  84. package/dist/src/commerce/x402.d.ts.map +1 -1
  85. package/dist/src/commerce/x402.js +10 -7
  86. package/dist/src/commerce/x402.js.map +1 -1
  87. package/dist/src/config-types.d.ts +12 -0
  88. package/dist/src/config-types.d.ts.map +1 -1
  89. package/dist/src/config.d.ts.map +1 -1
  90. package/dist/src/config.js +8 -0
  91. package/dist/src/config.js.map +1 -1
  92. package/dist/src/data/app-templates/shells.d.ts +11 -3
  93. package/dist/src/data/app-templates/shells.d.ts.map +1 -1
  94. package/dist/src/data/app-templates/shells.js +87 -6
  95. package/dist/src/data/app-templates/shells.js.map +1 -1
  96. package/dist/src/data/app-templates.js +2 -2
  97. package/dist/src/data/app-templates.js.map +1 -1
  98. package/dist/src/data/library-packs/cortex.d.ts.map +1 -1
  99. package/dist/src/data/library-packs/cortex.js +108 -5
  100. package/dist/src/data/library-packs/cortex.js.map +1 -1
  101. package/dist/src/data/library-packs/sdk.d.ts.map +1 -1
  102. package/dist/src/data/library-packs/sdk.js +32 -8
  103. package/dist/src/data/library-packs/sdk.js.map +1 -1
  104. package/dist/src/data/library-packs/vendored.d.ts.map +1 -1
  105. package/dist/src/data/library-packs/vendored.js +83 -6
  106. package/dist/src/data/library-packs/vendored.js.map +1 -1
  107. package/dist/src/generated/api-types.d.ts +478 -19
  108. package/dist/src/generated/api-types.d.ts.map +1 -1
  109. package/dist/src/mcp/agent-tasks.d.ts +4 -0
  110. package/dist/src/mcp/agent-tasks.d.ts.map +1 -1
  111. package/dist/src/mcp/agent-tasks.js +20 -2
  112. package/dist/src/mcp/agent-tasks.js.map +1 -1
  113. package/dist/src/mcp/capabilities.d.ts +7 -1
  114. package/dist/src/mcp/capabilities.d.ts.map +1 -1
  115. package/dist/src/mcp/capabilities.js +5 -2
  116. package/dist/src/mcp/capabilities.js.map +1 -1
  117. package/dist/src/mcp/catalog/definitions/commerce.d.ts.map +1 -1
  118. package/dist/src/mcp/catalog/definitions/commerce.js +4 -2
  119. package/dist/src/mcp/catalog/definitions/commerce.js.map +1 -1
  120. package/dist/src/mcp/catalog/definitions/discovery-work-boards.d.ts.map +1 -1
  121. package/dist/src/mcp/catalog/definitions/discovery-work-boards.js +4 -3
  122. package/dist/src/mcp/catalog/definitions/discovery-work-boards.js.map +1 -1
  123. package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.js +1 -1
  124. package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.js.map +1 -1
  125. package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.d.ts.map +1 -1
  126. package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js +3 -2
  127. package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js.map +1 -1
  128. package/dist/src/mcp/catalog/output-schemas.d.ts +6 -1
  129. package/dist/src/mcp/catalog/output-schemas.d.ts.map +1 -1
  130. package/dist/src/mcp/catalog/output-schemas.js +6 -1
  131. package/dist/src/mcp/catalog/output-schemas.js.map +1 -1
  132. package/dist/src/mcp/commerce.d.ts.map +1 -1
  133. package/dist/src/mcp/commerce.js +15 -3
  134. package/dist/src/mcp/commerce.js.map +1 -1
  135. package/dist/src/mcp/core-storage.d.ts +23 -0
  136. package/dist/src/mcp/core-storage.d.ts.map +1 -0
  137. package/dist/src/mcp/core-storage.js +157 -0
  138. package/dist/src/mcp/core-storage.js.map +1 -0
  139. package/dist/src/mcp/core.d.ts +16 -0
  140. package/dist/src/mcp/core.d.ts.map +1 -1
  141. package/dist/src/mcp/core.js +75 -119
  142. package/dist/src/mcp/core.js.map +1 -1
  143. package/dist/src/mcp/dm-messages.d.ts +4 -0
  144. package/dist/src/mcp/dm-messages.d.ts.map +1 -1
  145. package/dist/src/mcp/dm-messages.js +43 -2
  146. package/dist/src/mcp/dm-messages.js.map +1 -1
  147. package/dist/src/mcp/exchange.d.ts.map +1 -1
  148. package/dist/src/mcp/exchange.js +3 -2
  149. package/dist/src/mcp/exchange.js.map +1 -1
  150. package/dist/src/mcp/extensions.d.ts.map +1 -1
  151. package/dist/src/mcp/extensions.js +6 -2
  152. package/dist/src/mcp/extensions.js.map +1 -1
  153. package/dist/src/mcp/index.d.ts +5 -0
  154. package/dist/src/mcp/index.d.ts.map +1 -1
  155. package/dist/src/mcp/index.js +23 -4
  156. package/dist/src/mcp/index.js.map +1 -1
  157. package/dist/src/mcp/memory-namespace-hints.d.ts +33 -0
  158. package/dist/src/mcp/memory-namespace-hints.d.ts.map +1 -0
  159. package/dist/src/mcp/memory-namespace-hints.js +60 -0
  160. package/dist/src/mcp/memory-namespace-hints.js.map +1 -0
  161. package/dist/src/mcp/workspaces.d.ts +5 -0
  162. package/dist/src/mcp/workspaces.d.ts.map +1 -1
  163. package/dist/src/mcp/workspaces.js +5 -3
  164. package/dist/src/mcp/workspaces.js.map +1 -1
  165. package/dist/src/models/agent-task-schemas.d.ts +25 -3
  166. package/dist/src/models/agent-task-schemas.d.ts.map +1 -1
  167. package/dist/src/models/agent-task-schemas.js +16 -0
  168. package/dist/src/models/agent-task-schemas.js.map +1 -1
  169. package/dist/src/models/app-tool-schemas.d.ts +518 -1
  170. package/dist/src/models/app-tool-schemas.d.ts.map +1 -1
  171. package/dist/src/models/app-tool-schemas.js +53 -1
  172. package/dist/src/models/app-tool-schemas.js.map +1 -1
  173. package/dist/src/models/odps-schemas.d.ts +305 -0
  174. package/dist/src/models/odps-schemas.d.ts.map +1 -0
  175. package/dist/src/models/odps-schemas.js +182 -0
  176. package/dist/src/models/odps-schemas.js.map +1 -0
  177. package/dist/src/models/offer-schemas.d.ts +357 -2
  178. package/dist/src/models/offer-schemas.d.ts.map +1 -1
  179. package/dist/src/models/offer-schemas.js +37 -0
  180. package/dist/src/models/offer-schemas.js.map +1 -1
  181. package/dist/src/models/schemas.d.ts +6 -3
  182. package/dist/src/models/schemas.d.ts.map +1 -1
  183. package/dist/src/models/schemas.js +10 -1
  184. package/dist/src/models/schemas.js.map +1 -1
  185. package/dist/src/models/webhook-schemas.d.ts +8 -8
  186. package/dist/src/routes/agent-tasks/create-read.d.ts +4 -0
  187. package/dist/src/routes/agent-tasks/create-read.d.ts.map +1 -1
  188. package/dist/src/routes/agent-tasks/create-read.js +20 -1
  189. package/dist/src/routes/agent-tasks/create-read.js.map +1 -1
  190. package/dist/src/routes/agent-tasks/lifecycle.d.ts.map +1 -1
  191. package/dist/src/routes/agent-tasks/lifecycle.js +10 -0
  192. package/dist/src/routes/agent-tasks/lifecycle.js.map +1 -1
  193. package/dist/src/routes/agents/offers.d.ts +2 -0
  194. package/dist/src/routes/agents/offers.d.ts.map +1 -1
  195. package/dist/src/routes/agents/offers.js +0 -0
  196. package/dist/src/routes/agents/offers.js.map +1 -1
  197. package/dist/src/routes/app-grants.d.ts +6 -0
  198. package/dist/src/routes/app-grants.d.ts.map +1 -1
  199. package/dist/src/routes/app-grants.js +55 -25
  200. package/dist/src/routes/app-grants.js.map +1 -1
  201. package/dist/src/routes/apps/drafts.d.ts +3 -0
  202. package/dist/src/routes/apps/drafts.d.ts.map +1 -1
  203. package/dist/src/routes/apps/drafts.js +63 -1
  204. package/dist/src/routes/apps/drafts.js.map +1 -1
  205. package/dist/src/routes/apps/publish.d.ts +2 -0
  206. package/dist/src/routes/apps/publish.d.ts.map +1 -1
  207. package/dist/src/routes/apps/publish.js +17 -2
  208. package/dist/src/routes/apps/publish.js.map +1 -1
  209. package/dist/src/routes/commerce.d.ts.map +1 -1
  210. package/dist/src/routes/commerce.js +122 -2
  211. package/dist/src/routes/commerce.js.map +1 -1
  212. package/dist/src/routes/exchange-market.d.ts +6 -2
  213. package/dist/src/routes/exchange-market.d.ts.map +1 -1
  214. package/dist/src/routes/exchange-market.js +154 -28
  215. package/dist/src/routes/exchange-market.js.map +1 -1
  216. package/dist/src/routes/exchange.d.ts.map +1 -1
  217. package/dist/src/routes/exchange.js +5 -2
  218. package/dist/src/routes/exchange.js.map +1 -1
  219. package/dist/src/routes/extensions/actions.d.ts.map +1 -1
  220. package/dist/src/routes/extensions/actions.js +18 -0
  221. package/dist/src/routes/extensions/actions.js.map +1 -1
  222. package/dist/src/routes/extensions/crud.d.ts.map +1 -1
  223. package/dist/src/routes/extensions/crud.js +36 -3
  224. package/dist/src/routes/extensions/crud.js.map +1 -1
  225. package/dist/src/routes/extensions/entitlement-gate.d.ts.map +1 -1
  226. package/dist/src/routes/extensions/entitlement-gate.js +13 -0
  227. package/dist/src/routes/extensions/entitlement-gate.js.map +1 -1
  228. package/dist/src/routes/extensions/manifest.d.ts +6 -0
  229. package/dist/src/routes/extensions/manifest.d.ts.map +1 -1
  230. package/dist/src/routes/extensions/manifest.js +68 -1
  231. package/dist/src/routes/extensions/manifest.js.map +1 -1
  232. package/dist/src/routes/extensions/pacing.d.ts +31 -0
  233. package/dist/src/routes/extensions/pacing.d.ts.map +1 -0
  234. package/dist/src/routes/extensions/pacing.js +73 -0
  235. package/dist/src/routes/extensions/pacing.js.map +1 -0
  236. package/dist/src/routes/extensions/paywall.d.ts.map +1 -1
  237. package/dist/src/routes/extensions/paywall.js +17 -17
  238. package/dist/src/routes/extensions/paywall.js.map +1 -1
  239. package/dist/src/routes/memory/crud.d.ts.map +1 -1
  240. package/dist/src/routes/memory/crud.js +10 -0
  241. package/dist/src/routes/memory/crud.js.map +1 -1
  242. package/dist/src/routes/organisms/crud.d.ts +3 -0
  243. package/dist/src/routes/organisms/crud.d.ts.map +1 -1
  244. package/dist/src/routes/organisms/crud.js +5 -2
  245. package/dist/src/routes/organisms/crud.js.map +1 -1
  246. package/dist/src/routes/organisms/workspace-read.d.ts.map +1 -1
  247. package/dist/src/routes/organisms/workspace-read.js +7 -2
  248. package/dist/src/routes/organisms/workspace-read.js.map +1 -1
  249. package/dist/src/routes/public-stats.d.ts +7 -0
  250. package/dist/src/routes/public-stats.d.ts.map +1 -1
  251. package/dist/src/routes/public-stats.js +28 -7
  252. package/dist/src/routes/public-stats.js.map +1 -1
  253. package/dist/src/routes/sse.d.ts +7 -0
  254. package/dist/src/routes/sse.d.ts.map +1 -1
  255. package/dist/src/routes/sse.js +36 -6
  256. package/dist/src/routes/sse.js.map +1 -1
  257. package/dist/src/routes/storage-files.d.ts +11 -0
  258. package/dist/src/routes/storage-files.d.ts.map +1 -1
  259. package/dist/src/routes/storage-files.js +58 -51
  260. package/dist/src/routes/storage-files.js.map +1 -1
  261. package/dist/src/routes/subdomains.d.ts +4 -0
  262. package/dist/src/routes/subdomains.d.ts.map +1 -1
  263. package/dist/src/routes/subdomains.js +42 -5
  264. package/dist/src/routes/subdomains.js.map +1 -1
  265. package/dist/src/routes/upload.d.ts +11 -0
  266. package/dist/src/routes/upload.d.ts.map +1 -1
  267. package/dist/src/routes/upload.js +108 -28
  268. package/dist/src/routes/upload.js.map +1 -1
  269. package/dist/src/routes/webmcp.d.ts.map +1 -1
  270. package/dist/src/routes/webmcp.js +4 -0
  271. package/dist/src/routes/webmcp.js.map +1 -1
  272. package/dist/src/schemas/knowledge-package.d.ts +1 -1
  273. package/dist/src/server-bootstrap/static-files.d.ts +4 -0
  274. package/dist/src/server-bootstrap/static-files.d.ts.map +1 -1
  275. package/dist/src/server-bootstrap/static-files.js +11 -0
  276. package/dist/src/server-bootstrap/static-files.js.map +1 -1
  277. package/dist/src/services/build-app-prompt.d.ts +19 -0
  278. package/dist/src/services/build-app-prompt.d.ts.map +1 -1
  279. package/dist/src/services/build-app-prompt.js +97 -11
  280. package/dist/src/services/build-app-prompt.js.map +1 -1
  281. package/dist/src/services/call-timing.d.ts +51 -0
  282. package/dist/src/services/call-timing.d.ts.map +1 -0
  283. package/dist/src/services/call-timing.js +91 -0
  284. package/dist/src/services/call-timing.js.map +1 -0
  285. package/dist/src/services/capability-invoke.d.ts +2 -0
  286. package/dist/src/services/capability-invoke.d.ts.map +1 -1
  287. package/dist/src/services/capability-invoke.js +10 -0
  288. package/dist/src/services/capability-invoke.js.map +1 -1
  289. package/dist/src/services/config-schema.d.ts.map +1 -1
  290. package/dist/src/services/config-schema.js +6 -0
  291. package/dist/src/services/config-schema.js.map +1 -1
  292. package/dist/src/services/draft-token.d.ts +22 -2
  293. package/dist/src/services/draft-token.d.ts.map +1 -1
  294. package/dist/src/services/draft-token.js +52 -3
  295. package/dist/src/services/draft-token.js.map +1 -1
  296. package/dist/src/services/exchange-market.d.ts +41 -8
  297. package/dist/src/services/exchange-market.d.ts.map +1 -1
  298. package/dist/src/services/exchange-market.js +24 -2
  299. package/dist/src/services/exchange-market.js.map +1 -1
  300. package/dist/src/services/exchange-odps.d.ts +58 -0
  301. package/dist/src/services/exchange-odps.d.ts.map +1 -0
  302. package/dist/src/services/exchange-odps.js +400 -0
  303. package/dist/src/services/exchange-odps.js.map +1 -0
  304. package/dist/src/services/exchange-projection.d.ts +61 -0
  305. package/dist/src/services/exchange-projection.d.ts.map +1 -0
  306. package/dist/src/services/exchange-projection.js +504 -0
  307. package/dist/src/services/exchange-projection.js.map +1 -0
  308. package/dist/src/services/exchange-proposals.d.ts.map +1 -1
  309. package/dist/src/services/exchange-proposals.js +2 -0
  310. package/dist/src/services/exchange-proposals.js.map +1 -1
  311. package/dist/src/services/extension-files.d.ts +64 -0
  312. package/dist/src/services/extension-files.d.ts.map +1 -0
  313. package/dist/src/services/extension-files.js +88 -0
  314. package/dist/src/services/extension-files.js.map +1 -0
  315. package/dist/src/services/extension-runtime.d.ts +33 -0
  316. package/dist/src/services/extension-runtime.d.ts.map +1 -1
  317. package/dist/src/services/extension-runtime.js +52 -0
  318. package/dist/src/services/extension-runtime.js.map +1 -1
  319. package/dist/src/services/file-refs.d.ts +105 -0
  320. package/dist/src/services/file-refs.d.ts.map +1 -0
  321. package/dist/src/services/file-refs.js +106 -0
  322. package/dist/src/services/file-refs.js.map +1 -0
  323. package/dist/src/services/metered-entitlements.d.ts +7 -0
  324. package/dist/src/services/metered-entitlements.d.ts.map +1 -1
  325. package/dist/src/services/metered-entitlements.js +4 -0
  326. package/dist/src/services/metered-entitlements.js.map +1 -1
  327. package/dist/src/services/owner-memory.d.ts +14 -1
  328. package/dist/src/services/owner-memory.d.ts.map +1 -1
  329. package/dist/src/services/owner-memory.js +8 -14
  330. package/dist/src/services/owner-memory.js.map +1 -1
  331. package/dist/src/services/task-files.d.ts +51 -0
  332. package/dist/src/services/task-files.d.ts.map +1 -0
  333. package/dist/src/services/task-files.js +58 -0
  334. package/dist/src/services/task-files.js.map +1 -0
  335. package/dist/src/services/upload-token.d.ts +29 -0
  336. package/dist/src/services/upload-token.d.ts.map +1 -1
  337. package/dist/src/services/upload-token.js +37 -0
  338. package/dist/src/services/upload-token.js.map +1 -1
  339. package/dist/src/services/upload-zip.d.ts +2 -0
  340. package/dist/src/services/upload-zip.d.ts.map +1 -1
  341. package/dist/src/services/upload-zip.js +5 -1
  342. package/dist/src/services/upload-zip.js.map +1 -1
  343. package/dist/src/services/workspace-meta.d.ts +15 -0
  344. package/dist/src/services/workspace-meta.d.ts.map +1 -1
  345. package/dist/src/services/workspace-meta.js +17 -0
  346. package/dist/src/services/workspace-meta.js.map +1 -1
  347. package/dist/src/services/workspace-provision.d.ts +3 -0
  348. package/dist/src/services/workspace-provision.d.ts.map +1 -1
  349. package/dist/src/services/workspace-provision.js +5 -3
  350. package/dist/src/services/workspace-provision.js.map +1 -1
  351. package/dist/src/storage/providers/postgres-kysely/methods/app-grants.d.ts +1 -0
  352. package/dist/src/storage/providers/postgres-kysely/methods/app-grants.d.ts.map +1 -1
  353. package/dist/src/storage/providers/postgres-kysely/methods/app-grants.js +10 -0
  354. package/dist/src/storage/providers/postgres-kysely/methods/app-grants.js.map +1 -1
  355. package/dist/src/storage/providers/postgres-kysely/methods/memory.d.ts +2 -0
  356. package/dist/src/storage/providers/postgres-kysely/methods/memory.d.ts.map +1 -1
  357. package/dist/src/storage/providers/postgres-kysely/methods/memory.js +12 -1
  358. package/dist/src/storage/providers/postgres-kysely/methods/memory.js.map +1 -1
  359. package/dist/src/storage/providers/postgres-kysely/methods/organisms.d.ts.map +1 -1
  360. package/dist/src/storage/providers/postgres-kysely/methods/organisms.js +5 -1
  361. package/dist/src/storage/providers/postgres-kysely/methods/organisms.js.map +1 -1
  362. package/dist/src/storage/providers/postgres-kysely/migrations/0012_unique_live_app_grant.sql +29 -0
  363. package/dist/src/storage/providers/sqlite/methods/apps.d.ts +3 -0
  364. package/dist/src/storage/providers/sqlite/methods/apps.d.ts.map +1 -1
  365. package/dist/src/storage/providers/sqlite/methods/apps.js +7 -0
  366. package/dist/src/storage/providers/sqlite/methods/apps.js.map +1 -1
  367. package/dist/src/storage/providers/sqlite/methods/governance.d.ts +1 -0
  368. package/dist/src/storage/providers/sqlite/methods/governance.d.ts.map +1 -1
  369. package/dist/src/storage/providers/sqlite/methods/governance.js +4 -1
  370. package/dist/src/storage/providers/sqlite/methods/governance.js.map +1 -1
  371. package/dist/src/storage/providers/sqlite/methods/owner.d.ts +5 -0
  372. package/dist/src/storage/providers/sqlite/methods/owner.d.ts.map +1 -1
  373. package/dist/src/storage/providers/sqlite/methods/owner.js +8 -0
  374. package/dist/src/storage/providers/sqlite/methods/owner.js.map +1 -1
  375. package/dist/src/storage/providers/sqlite/schema.d.ts +3 -0
  376. package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
  377. package/dist/src/storage/providers/sqlite/schema.js +20 -0
  378. package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
  379. package/dist/src/storage/repositories/app-grant.repository.d.ts +9 -1
  380. package/dist/src/storage/repositories/app-grant.repository.d.ts.map +1 -1
  381. package/dist/src/storage/repositories/memory.repository.d.ts +14 -0
  382. package/dist/src/storage/repositories/memory.repository.d.ts.map +1 -1
  383. package/dist/src/storage/repositories-impl/memory-repository.d.ts +8 -1
  384. package/dist/src/storage/repositories-impl/memory-repository.d.ts.map +1 -1
  385. package/dist/src/storage/repositories-impl/memory-repository.js +15 -4
  386. package/dist/src/storage/repositories-impl/memory-repository.js.map +1 -1
  387. package/dist/src/storage/types/agents-messaging.d.ts +19 -0
  388. package/dist/src/storage/types/agents-messaging.d.ts.map +1 -1
  389. package/dist/src/storage/types/agents-messaging.js.map +1 -1
  390. package/dist/src/storage/types/organisms-federation.d.ts +29 -0
  391. package/dist/src/storage/types/organisms-federation.d.ts.map +1 -1
  392. package/dist/src/utils/app-badge.d.ts.map +1 -1
  393. package/dist/src/utils/app-badge.js +7 -3
  394. package/dist/src/utils/app-badge.js.map +1 -1
  395. package/dist/static/app-catalog/_template.html +6 -5
  396. package/dist/static/app-catalog/js/cortex.js +3 -1
  397. package/dist/static/app-catalog/js/detail.js +411 -36
  398. package/dist/static/app-catalog/js/i18n-data.js +279 -3
  399. package/dist/static/app-catalog/js/main.js +28 -37
  400. package/dist/static/app-catalog/js/monetize.js +204 -16
  401. package/dist/static/app-catalog/js/odps.js +489 -0
  402. package/dist/static/app-catalog/js/render.js +3 -0
  403. package/dist/static/app-catalog/js/workcopy.js +198 -0
  404. package/dist/static/app-catalog/styles/app-catalog.css +60 -0
  405. package/dist/static/app-catalog.html +1450 -137
  406. package/dist/static/sdk-libs/agents/index.js +45 -7
  407. package/dist/static/sdk-libs/auth/cluster.js +97 -0
  408. package/dist/static/sdk-libs/auth/index.js +25 -1
  409. package/dist/static/sdk-libs/auth/locale.js +151 -0
  410. package/dist/static/sdk-libs/auth/modal.js +11 -2
  411. package/dist/static/sdk-libs/auth/palette.js +172 -0
  412. package/dist/static/sdk-libs/auth/pill.js +37 -6
  413. package/dist/static/sdk-libs/auth/theme.js +61 -20
  414. package/dist/static/sdk-libs/data/index.js +70 -8
  415. package/dist/static/sdk-libs/dist/aimeat-agents.js +41 -8
  416. package/dist/static/sdk-libs/dist/aimeat-auth.js +422 -21
  417. package/dist/static/sdk-libs/dist/aimeat-data.js +50 -8
  418. package/dist/static/sdk-libs/dist/aimeat-live.js +54 -2
  419. package/dist/static/sdk-libs/dist/aimeat-markdown.js +32 -1
  420. package/dist/static/sdk-libs/live/index.js +71 -4
  421. package/dist/static/sdk-libs/markdown/index.js +49 -1
  422. package/package.json +6 -2
@@ -19,13 +19,14 @@
19
19
  */
20
20
  import { Router } from 'express';
21
21
  import { z } from 'zod';
22
- import { requireAuth } from '../auth/middleware.js';
22
+ import { requireAuth, requireRole } from '../auth/middleware.js';
23
23
  import { success, error } from '../middleware/envelope.js';
24
24
  import { resolveIdentity } from '../utils/gaii.js';
25
+ import { isEvmAddressShape, toChecksumAddress, checksumIsWrong, settlementAssetMatch, probeIsContract } from '../commerce/evm-address.js';
25
26
  import { createSession, getSession, updateSessionItems, cancelSession, completeSession, CommerceError, listSessions, listOrders, } from '../commerce/session-service.js';
26
27
  import { PaymentError } from '../commerce/payment-handlers.js';
27
28
  import { paymentChallenge, x402ExactAccepts } from '../commerce/x402.js';
28
- import { decodeXPayment } from '../commerce/x402-facilitator.js';
29
+ import { decodeXPayment, getX402Network, getX402Asset, x402SettlementCurrencies } from '../commerce/x402-facilitator.js';
29
30
  import { X402_HANDLER_ID } from '../commerce/x402-handler.js';
30
31
  const ItemsSchema = z.array(z.object({
31
32
  kind: z.enum(['offer', 'org-offering', 'app-tool', 'ext-call']).optional(),
@@ -69,6 +70,21 @@ function sendCommerceError(res, config, err, extraAccepts = []) {
69
70
  const e = err;
70
71
  res.status(500).json(error(config.nodeId, 'COMMERCE_ERROR', e.message ?? 'Unexpected commerce error'));
71
72
  }
73
+ /** The seller's opaque payment-settings record. Holds the Stripe credentials AND the x402 payout
74
+ * address side by side, so every write MERGES: one rail's settings must never delete the other's. */
75
+ const PSP_KEY = 'commerce.psp';
76
+ /** An EVM account address — the only shape an x402 stablecoin settlement can pay out to. */
77
+ const EVM_ADDRESS = /^0x[a-fA-F0-9]{40}$/;
78
+ /** Read the seller's payment settings record (private, owner-scoped). */
79
+ async function readPsp(storage, ownerGhii) {
80
+ const rec = await storage.getMemory(ownerGhii, PSP_KEY);
81
+ return rec?.value ?? {};
82
+ }
83
+ /** The x402 payout address in any of the shapes the facilitator accepts (extractPayTo mirrors this). */
84
+ function payToOf(psp) {
85
+ const candidate = psp.payTo ?? psp.address ?? psp.x402?.address ?? psp.x402?.payTo;
86
+ return typeof candidate === 'string' && EVM_ADDRESS.test(candidate.trim()) ? candidate.trim() : null;
87
+ }
72
88
  export function commerceRouter(config, storage) {
73
89
  const router = Router();
74
90
  // Kill-switch: AIMEAT_COMMERCE_ENABLED=false turns the whole surface off (503, machine-readable).
@@ -89,6 +105,110 @@ export function commerceRouter(config, storage) {
89
105
  return session;
90
106
  }
91
107
  // POST /v1/commerce/checkout-sessions — open a session against one seller's offers.
108
+ /* ── Seller payout settings ────────────────────────────────────────────────────────────────────
109
+ * Which rails can actually pay this seller, and the one setting the seller owns for each. The two
110
+ * rails are deliberately reported apart: Stripe moves fiat (EUR/USD) to a connected account, x402
111
+ * moves a stablecoin on-chain to an address the seller controls. Reading tells you which of your money
112
+ * listings can settle at all — an x402 sale without an address fails with SELLER_NO_X402_ADDRESS. */
113
+ router.get('/v1/commerce/payout', requireAuth(), requireRole('owner'), async (req, res) => {
114
+ const ownerGhii = resolveIdentity(req.auth, config.nodeId);
115
+ const psp = await readPsp(storage, ownerGhii);
116
+ const address = payToOf(psp);
117
+ // What the stablecoin rail can settle is READ FROM THE NETWORK REGISTRY, never hardcoded: the
118
+ // seller is told the real currency list for the network this node runs on, and which token each
119
+ // one settles in. One address receives them all, so a new currency asks for no new setting.
120
+ const network = getX402Network(config.x402Network);
121
+ const assets = x402SettlementCurrencies(network).map((currency) => {
122
+ const asset = getX402Asset(network, currency);
123
+ return { currency, symbol: asset.symbol, address: asset.address, decimals: asset.decimals };
124
+ });
125
+ return res.json(success(config.nodeId, {
126
+ x402: {
127
+ enabled: config.x402Enabled,
128
+ network: config.x402Network,
129
+ testnet: config.x402Network !== 'base',
130
+ configured: !!address,
131
+ address,
132
+ currencies: assets.map((a) => a.currency),
133
+ assets,
134
+ note: config.x402Enabled
135
+ ? `Stablecoin settlement: the buyer signs a payment in the token matching the price (${assets.map((a) => `${a.currency} → ${a.symbol}`).join(', ')}) and the facilitator settles it straight to this address. No key is held by the node.`
136
+ : 'The node operator has not enabled x402 on this node (AIMEAT_X402_ENABLED).',
137
+ },
138
+ stripe: {
139
+ configured: !!psp.secretKey,
140
+ provider: psp.provider ?? null,
141
+ currencies: ['EUR', 'USD'],
142
+ note: 'Card and invoice settlement in real currency, paid out to your connected account.',
143
+ },
144
+ }));
145
+ });
146
+ /**
147
+ * Set the x402 payout address. Guarded, because this is the one hand-typed value in the whole
148
+ * stablecoin flow and a settlement to the wrong target is irreversible: the shape, then the EIP-55
149
+ * checksum (catches a typo the eye cannot), then a check that it is not one of our own settlement
150
+ * TOKEN contracts (the address most likely to be on a seller's clipboard while setting this up),
151
+ * then — when the operator configured an RPC — whether the chain says it holds contract code.
152
+ * Merges into the record, so the Stripe credentials survive.
153
+ */
154
+ router.put('/v1/commerce/payout/x402', requireAuth(), requireRole('owner'), async (req, res) => {
155
+ const raw = (req.body ?? {});
156
+ const address = typeof raw.address === 'string' ? raw.address.trim() : '';
157
+ if (!isEvmAddressShape(address)) {
158
+ return res.status(400).json(error(config.nodeId, 'INVALID_ADDRESS', 'address must be an EVM account address: 0x followed by 40 hex characters'));
159
+ }
160
+ if (checksumIsWrong(address)) {
161
+ return res.status(400).json(error(config.nodeId, 'ADDRESS_CHECKSUM', 'This address fails its EIP-55 checksum, which almost always means a character was mistyped or lost in copying. '
162
+ + 'Paste it again from your wallet, or send it in all lowercase if your wallet does not use mixed case.'));
163
+ }
164
+ const token = settlementAssetMatch(address);
165
+ if (token) {
166
+ return res.status(400).json(error(config.nodeId, 'ADDRESS_IS_TOKEN_CONTRACT', `That is the ${token.currency === 'EUR' ? 'EURC' : 'USDC'} token contract on ${token.network}, not a wallet. `
167
+ + 'Funds settled there cannot be recovered. Use the address of an account you hold the key for.'));
168
+ }
169
+ const isContract = await probeIsContract(config.x402RpcUrl, address);
170
+ if (isContract === true) {
171
+ return res.status(400).json(error(config.nodeId, 'ADDRESS_IS_CONTRACT', 'The chain reports contract code at this address, so it is not a wallet you hold a key for. '
172
+ + 'If this is a smart-contract wallet you control, ask the operator to allow it.'));
173
+ }
174
+ // Store the canonical EIP-55 form: mixed case is what a wallet shows, so the seller can compare.
175
+ const canonical = toChecksumAddress(address);
176
+ const ownerGhii = resolveIdentity(req.auth, config.nodeId);
177
+ const psp = await readPsp(storage, ownerGhii);
178
+ const now = new Date().toISOString();
179
+ await storage.setMemory({
180
+ key: PSP_KEY, ownerGaii: ownerGhii, value: { ...psp, payTo: canonical },
181
+ visibility: 'private', tags: ['commerce'], ttlHours: null, version: 1, createdAt: now, updatedAt: now,
182
+ });
183
+ return res.json(success(config.nodeId, {
184
+ configured: true, address: canonical, network: config.x402Network,
185
+ // One address receives every settlement asset this network carries — report them all, so the
186
+ // seller sees that the same setting covers both a USD sale and a EUR one.
187
+ currencies: x402SettlementCurrencies(getX402Network(config.x402Network)),
188
+ enabled: config.x402Enabled,
189
+ checked: { shape: true, checksum: true, notTokenContract: true, onChain: isContract === null ? 'skipped' : 'account' },
190
+ }));
191
+ });
192
+ /** Remove the payout address only — Stripe credentials in the same record are untouched. */
193
+ router.delete('/v1/commerce/payout/x402', requireAuth(), requireRole('owner'), async (req, res) => {
194
+ const ownerGhii = resolveIdentity(req.auth, config.nodeId);
195
+ const psp = await readPsp(storage, ownerGhii);
196
+ const next = { ...psp };
197
+ delete next.payTo;
198
+ delete next.address;
199
+ if (next.x402) {
200
+ const x = { ...next.x402 };
201
+ delete x.address;
202
+ delete x.payTo;
203
+ next.x402 = x;
204
+ }
205
+ const now = new Date().toISOString();
206
+ await storage.setMemory({
207
+ key: PSP_KEY, ownerGaii: ownerGhii, value: next,
208
+ visibility: 'private', tags: ['commerce'], ttlHours: null, version: 1, createdAt: now, updatedAt: now,
209
+ });
210
+ return res.json(success(config.nodeId, { configured: false, note: 'Stablecoin sales now fail until an address is set again. Card/invoice settlement is unaffected.' }));
211
+ });
92
212
  router.post('/v1/commerce/checkout-sessions', requireAuth(), async (req, res) => {
93
213
  const parsed = CreateSchema.safeParse(req.body);
94
214
  if (!parsed.success) {
@@ -1 +1 @@
1
- {"version":3,"file":"commerce.js","sourceRoot":"","sources":["../../../src/routes/commerce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,aAAa,EAAE,UAAU,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAC5F,YAAY,EAAE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AAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC3F,MAAM,UAAU,GAAG,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC;YAC/D,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;YACpG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE;gBACtD,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE;aACpE,CAAC,CAAC,CAAC;QACN,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,mGAAmG;YACnG,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACvG,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -7,10 +7,14 @@
7
7
  * direct acceptance route). Records are public (browsable); writes are owner-authorised. The heavy
8
8
  * orchestration (agent negotiation, composite assembly) lives in the marketplace app/agent — this router
9
9
  * is the generic store + capability match.
10
- * @structure exchangeMarketRouter — offerings (POST/GET/GET :id detail/GET :id/consumers/DELETE) ·
11
- * needs (POST/GET/close) · bids (POST/GET/accept)
10
+ * @structure exchangeMarketRouter — offerings (POST/GET/GET :id detail/GET :id/odps(.yaml)/GET :id/consumers/
11
+ * DELETE) · needs (POST/GET/close) · bids (POST/GET/accept) · offeringContext (shared detail/ODPS builder)
12
12
  * @usage import { exchangeMarketRouter } from './routes/exchange-market.js'; app.use(exchangeMarketRouter(config, storage));
13
13
  * @version-history
14
+ * v1.5.0 — 2026-07-25 — ODPS v4.1 (TARGET-045 §4): GET /v1/exchange/offerings/{id}/odps(.yaml) projects the
15
+ * listing as an Open Data Product Specification document; `provenance` is now VALIDATED (400
16
+ * INVALID_PROVENANCE) instead of cast, and a new `odps` authoring block carries the standard fields the
17
+ * node cannot derive (400 INVALID_ODPS). Detail + ODPS share one context builder.
14
18
  * v1.4.0 — 2026-07-21 — Needs are app-bound (app_id required → 400 NEED_APP_REQUIRED) + carry an I/O
15
19
  * interface spec (inputSchema/outputSchema) — the emergent app-to-app data-API request.
16
20
  * v1.3.0 — 2026-07-21 — Cross-app selling (Gap 1): `kind: 'app-tool'` listing branch (a provider app sells a
@@ -1 +1 @@
1
- {"version":3,"file":"exchange-market.d.ts","sourceRoot":"","sources":["../../../src/routes/exchange-market.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAgDvD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAyXnF"}
1
+ {"version":3,"file":"exchange-market.d.ts","sourceRoot":"","sources":["../../../src/routes/exchange-market.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AA0EvD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAgenF"}
@@ -7,10 +7,14 @@
7
7
  * direct acceptance route). Records are public (browsable); writes are owner-authorised. The heavy
8
8
  * orchestration (agent negotiation, composite assembly) lives in the marketplace app/agent — this router
9
9
  * is the generic store + capability match.
10
- * @structure exchangeMarketRouter — offerings (POST/GET/GET :id detail/GET :id/consumers/DELETE) ·
11
- * needs (POST/GET/close) · bids (POST/GET/accept)
10
+ * @structure exchangeMarketRouter — offerings (POST/GET/GET :id detail/GET :id/odps(.yaml)/GET :id/consumers/
11
+ * DELETE) · needs (POST/GET/close) · bids (POST/GET/accept) · offeringContext (shared detail/ODPS builder)
12
12
  * @usage import { exchangeMarketRouter } from './routes/exchange-market.js'; app.use(exchangeMarketRouter(config, storage));
13
13
  * @version-history
14
+ * v1.5.0 — 2026-07-25 — ODPS v4.1 (TARGET-045 §4): GET /v1/exchange/offerings/{id}/odps(.yaml) projects the
15
+ * listing as an Open Data Product Specification document; `provenance` is now VALIDATED (400
16
+ * INVALID_PROVENANCE) instead of cast, and a new `odps` authoring block carries the standard fields the
17
+ * node cannot derive (400 INVALID_ODPS). Detail + ODPS share one context builder.
14
18
  * v1.4.0 — 2026-07-21 — Needs are app-bound (app_id required → 400 NEED_APP_REQUIRED) + carry an I/O
15
19
  * interface spec (inputSchema/outputSchema) — the emergent app-to-app data-API request.
16
20
  * v1.3.0 — 2026-07-21 — Cross-app selling (Gap 1): `kind: 'app-tool'` listing branch (a provider app sells a
@@ -25,11 +29,15 @@ import { Router } from 'express';
25
29
  import { requireAuth } from '../auth/middleware.js';
26
30
  import { success, error } from '../middleware/envelope.js';
27
31
  import { resolveIdentity } from '../utils/gaii.js';
32
+ import { resolvePacingToll } from './extensions/pacing.js';
28
33
  import { commerceFeePercent } from '../services/marketplace-fee.js';
29
34
  import { createEntitlement, readEntitlementForCall } from '../services/metered-entitlements.js';
30
35
  import { resolveActionPricing, newOfferingId, newNeedId, newBidId, appToolCoordinate, agentWorkCoordinate, putOffering, getOffering, listOfferings, deleteOffering, matchOfferings, putNeed, getNeed, listNeeds, putBid, listBids, getBid, offeringStats, offeringConsumers, enrichNeeds, } from '../services/exchange-market.js';
36
+ import { ProvenanceSchema, OdpsExtrasSchema } from '../models/odps-schemas.js';
37
+ import { offeringToOdps, odpsToYaml, ODPS_VERSION } from '../services/exchange-odps.js';
31
38
  import { AppToolsDocSchema, appToolsKey } from '../models/app-tool-schemas.js';
32
39
  import { ensureInterfaceVersion, getInterfaceVersion } from '../services/app-tool-interfaces.js';
40
+ import { reconcileOwnerOfferings, reconcileOwnerOfferingsThrottled, migrateLegacyOfferings } from '../services/exchange-projection.js';
33
41
  const str = (v) => (typeof v === 'string' ? v : '');
34
42
  const posOrNull = (v) => (typeof v === 'number' && Number.isFinite(v) && v >= 0 ? Math.floor(v) : null);
35
43
  /** A publishable schema is a non-empty object (an empty `{}` counts as "not published"). */
@@ -46,6 +54,31 @@ function parseUsageTerms(v) {
46
54
  note: typeof o.note === 'string' ? o.note : undefined,
47
55
  };
48
56
  }
57
+ /**
58
+ * Parse the provider's provenance attestation. Validated (not cast) because it lands in a PUBLIC record and
59
+ * is republished as ODPS: an unchecked object here would let a provider write arbitrary keys into the market.
60
+ * The node stamps `odpsVersion` so the descriptor always says which ODPS version it follows.
61
+ */
62
+ function parseProvenance(v) {
63
+ if (v === undefined || v === null)
64
+ return { ok: true, value: null };
65
+ const parsed = ProvenanceSchema.safeParse(v);
66
+ if (!parsed.success)
67
+ return { ok: false, message: parsed.error.issues.map(i => `${i.path.join('.') || 'provenance'}: ${i.message}`).join('; ') };
68
+ const value = parsed.data;
69
+ if (!Object.keys(value).length)
70
+ return { ok: true, value: null };
71
+ return { ok: true, value: { ...value, odpsVersion: value.odpsVersion ?? ODPS_VERSION } };
72
+ }
73
+ /** Parse the provider's ODPS authoring block (the standard fields the node cannot derive). */
74
+ function parseOdpsExtras(v) {
75
+ if (v === undefined || v === null)
76
+ return { ok: true, value: null };
77
+ const parsed = OdpsExtrasSchema.safeParse(v);
78
+ if (!parsed.success)
79
+ return { ok: false, message: parsed.error.issues.map(i => `${i.path.join('.') || 'odps'}: ${i.message}`).join('; ') };
80
+ return { ok: true, value: Object.keys(parsed.data).length ? parsed.data : null };
81
+ }
49
82
  /** Parse a need's interface-spec (the shape it sends/expects + light hints) from a request body. */
50
83
  function parseNeedSpec(v) {
51
84
  if (!v || typeof v !== 'object')
@@ -85,6 +118,14 @@ export function exchangeMarketRouter(config, storage) {
85
118
  router.post('/v1/exchange/offerings', requireAuth(), async (req, res) => {
86
119
  const owner = req.auth.owner;
87
120
  const b = (req.body ?? {});
121
+ // Provenance + the ODPS authoring block are validated once, before any kind branch: both are provider
122
+ // promises that get republished as an ODPS document, so a malformed one fails the listing loudly (400).
123
+ const prov = parseProvenance(b.provenance);
124
+ if (!prov.ok)
125
+ return res.status(400).json(error(config.nodeId, 'INVALID_PROVENANCE', `provenance is malformed — ${prov.message}`));
126
+ const odps = parseOdpsExtras(b.odps);
127
+ if (!odps.ok)
128
+ return res.status(400).json(error(config.nodeId, 'INVALID_ODPS', `odps is malformed — ${odps.message}`));
88
129
  // ── kind: app-tool — a provider app sells one of its tools (cross-app selling, Gap 1) ──
89
130
  if (b.kind === 'app-tool') {
90
131
  const appId = str(b.app_id), toolName = str(b.tool);
@@ -134,7 +175,7 @@ export function exchangeMarketRouter(config, storage) {
134
175
  description: str(b.description) || tool.description || '',
135
176
  unit: priced.unit, basePrice: priced.pricePerCall, currency: priced.currency,
136
177
  plans: commercial.plans ?? [],
137
- provenance: (b.provenance && typeof b.provenance === 'object') ? b.provenance : null,
178
+ provenance: prov.value, odps: odps.value,
138
179
  usageTerms,
139
180
  tags: Array.isArray(b.tags) ? b.tags.filter(t => typeof t === 'string') : [],
140
181
  state: 'listed', createdAt: now, updatedAt: now,
@@ -181,7 +222,7 @@ export function exchangeMarketRouter(config, storage) {
181
222
  unit: priced.unit, basePrice: priced.pricePerCall, currency: priced.currency,
182
223
  plans: commercial.plans ?? [],
183
224
  taskSpec: { inputSchema: inSchema, outputSchema: outSchema },
184
- provenance: (b.provenance && typeof b.provenance === 'object') ? b.provenance : null,
225
+ provenance: prov.value, odps: odps.value,
185
226
  usageTerms,
186
227
  tags: Array.isArray(b.tags) ? b.tags.filter(t => typeof t === 'string') : [],
187
228
  state: 'listed', createdAt: now, updatedAt: now,
@@ -225,7 +266,7 @@ export function exchangeMarketRouter(config, storage) {
225
266
  description: str(b.description),
226
267
  unit: priced.unit, basePrice: priced.pricePerCall, currency: priced.currency,
227
268
  plans: act.commercial?.plans ?? [],
228
- provenance: (b.provenance && typeof b.provenance === 'object') ? b.provenance : null,
269
+ provenance: prov.value, odps: odps.value,
229
270
  usageTerms,
230
271
  tags: Array.isArray(b.tags) ? b.tags.filter(t => typeof t === 'string') : [],
231
272
  state: 'listed', createdAt: now, updatedAt: now,
@@ -234,72 +275,120 @@ export function exchangeMarketRouter(config, storage) {
234
275
  return res.status(201).json(success(config.nodeId, { offering }));
235
276
  });
236
277
  /**
237
- * Offering DETAIL (public) everything a human or agent needs to decide + integrate: the I/O SCHEMA of
238
- * the underlying action, the CALL RECIPE (the contract IS the access — you call as yourself, no API key),
239
- * usage terms, provenance, and usage STATS (reputation). One call, so the app/agent needn't stitch it.
278
+ * The full decision + integration context for one offering: the capability's I/O SCHEMA, the CALL RECIPE
279
+ * (the contract IS the access — you call as yourself, no API key) and the usage STATS. Shared by the JSON
280
+ * detail route and the ODPS projection, so the two can never describe the same offering differently.
240
281
  */
241
- router.get('/v1/exchange/offerings/:id', async (req, res) => {
242
- const o = await getOffering(storage, str(req.params.id));
243
- if (!o)
244
- return res.status(404).json(error(config.nodeId, 'NOT_FOUND', 'No such offering'));
282
+ async function offeringContext(o) {
245
283
  const stats = await offeringStats(storage, o);
284
+ // The listing is the source for app-tool and agent-work (the provider authored it there); a raw ext
285
+ // action is read live from the extension below, the same way its price is.
286
+ const tollMorsels = o.tollMorsels ?? null;
246
287
  // app-tool: the capability schema is the PINNED interface snapshot; the call goes to the WebMCP invoke
247
288
  // endpoint (the accepted contract meters it). This is the freeze made visible — the version is explicit.
248
289
  if (o.kind === 'app-tool' && o.surface && o.surface.kind === 'app-tool') {
249
290
  const s = o.surface;
250
291
  const iface = await getInterfaceVersion(storage, o.providerGhii, s.appId, s.tool, s.ifaceVersion);
251
- return res.json(success(config.nodeId, {
252
- offering: o,
292
+ return {
253
293
  capability: iface ? {
254
294
  kind: 'app-tool', app: `${s.ownerName}/${s.appId}`, tool: s.tool, iface_version: s.ifaceVersion,
255
295
  input_schema: iface.inputSchema, output_schema: iface.outputSchema,
256
296
  } : null,
257
- call_recipe: {
297
+ iface: iface ? { inputSchema: iface.inputSchema, outputSchema: iface.outputSchema } : null,
298
+ callRecipe: {
258
299
  method: 'POST',
259
300
  url: `/v1/apps/${encodeURIComponent(s.ownerName)}/${encodeURIComponent(s.appId)}/webmcp/tools/${encodeURIComponent(s.tool)}`,
260
301
  auth: 'Your own AIMEAT token — the accepted contract (metered entitlement) authorises the call; no separate API key is issued.',
261
302
  note: `Each call is metered + charged to your budget at the provider price. The contract is pinned to interface v${s.ifaceVersion}; the provider may ship newer app versions without breaking your integration.`,
262
303
  body: '{ "input": { … } }',
263
304
  },
264
- stats,
265
- }));
305
+ stats, tollMorsels,
306
+ };
266
307
  }
267
308
  // agent-work: the "capability" is the task interface; the call recipe is "start work → agent delivers".
268
309
  if (o.kind === 'agent-work' && o.surface && o.surface.kind === 'agent-work') {
269
310
  const s = o.surface;
270
- return res.json(success(config.nodeId, {
271
- offering: o,
311
+ return {
272
312
  capability: o.taskSpec ? { kind: 'agent-work', agent: `${s.ownerName}/${s.agentName}`, task_type: s.taskType,
273
313
  input_schema: o.taskSpec.inputSchema, output_schema: o.taskSpec.outputSchema } : null,
274
- call_recipe: {
314
+ iface: o.taskSpec ? { inputSchema: o.taskSpec.inputSchema, outputSchema: o.taskSpec.outputSchema } : null,
315
+ callRecipe: {
275
316
  method: 'POST', url: '/v1/exchange/work',
276
317
  body: `{ "offering_id": "${o.offeringId}", "input": { … } }`,
277
318
  auth: 'Your own AIMEAT token — the accepted contract authorises starting work; no separate API key.',
278
319
  note: `Async: you START a task, the provider agent (${s.agentName}) DELIVERS, and you are charged the per-task price ON DELIVERY (metered + rake against your budget).`,
279
320
  },
280
- stats,
281
- }));
321
+ stats, tollMorsels,
322
+ };
282
323
  }
283
324
  // ext-action: schema comes live from the provider's extension action.
284
325
  const extRec = await storage.getExtension(o.ext);
285
326
  const act = extRec?.actions.find(a => a.id === o.action);
286
- return res.json(success(config.nodeId, {
287
- offering: o,
327
+ return {
288
328
  capability: act ? {
289
329
  input_schema: act.inputSchema ?? {},
290
330
  output_schema: act.outputSchema ?? {},
291
331
  toll_morsels: act.tollMorsels ?? 0,
292
332
  } : null,
293
- call_recipe: {
333
+ iface: act ? { inputSchema: (act.inputSchema ?? {}), outputSchema: (act.outputSchema ?? {}) } : null,
334
+ callRecipe: {
294
335
  method: 'POST',
295
336
  url: `/v1/ext/${o.ext}/${o.action}`,
296
337
  auth: 'Your own AIMEAT token — the accepted contract (metered entitlement) authorises the call; no separate API key is issued.',
297
338
  note: 'Each call is metered + charged to your budget at the provider price; the provider’s own upstream keys stay server-side.',
298
339
  mcp: `aimeat_extension_invoke { "name": "${o.ext}", "action": "${o.action}", "input": { … } }`,
299
340
  },
300
- stats,
341
+ stats, tollMorsels: act?.tollMorsels ?? null,
342
+ };
343
+ }
344
+ /**
345
+ * Offering DETAIL (public) — everything a human or agent needs to decide + integrate: the I/O SCHEMA of
346
+ * the underlying action, the CALL RECIPE (the contract IS the access — you call as yourself, no API key),
347
+ * usage terms, provenance, and usage STATS (reputation). One call, so the app/agent needn't stitch it.
348
+ */
349
+ router.get('/v1/exchange/offerings/:id', async (req, res) => {
350
+ const o = await getOffering(storage, str(req.params.id));
351
+ if (!o)
352
+ return res.status(404).json(error(config.nodeId, 'NOT_FOUND', 'No such offering'));
353
+ const ctx = await offeringContext(o);
354
+ return res.json(success(config.nodeId, {
355
+ offering: o, capability: ctx.capability, call_recipe: ctx.callRecipe, stats: ctx.stats,
356
+ // Stated before the contract is signed, because it changes what a call costs the CONSUMER even
357
+ // though it moves nothing to the provider. `source` says who set it: the seller, or the node.
358
+ pacing: {
359
+ toll_morsels: resolvePacingToll(config, ctx.tollMorsels),
360
+ source: typeof ctx.tollMorsels === 'number' && ctx.tollMorsels >= 0 ? 'capability' : 'node',
361
+ note: 'Morsels burned per call to bound consumption rate. A burn, not revenue: nobody is credited it, '
362
+ + 'and calling your own capability is free.',
363
+ },
364
+ odps: { version: ODPS_VERSION, url: `/v1/exchange/offerings/${o.offeringId}/odps.yaml` },
301
365
  }));
302
366
  });
367
+ /**
368
+ * The offering as an **Open Data Product Specification v4.1** document (opendataproducts.org, Linux
369
+ * Foundation) — the interoperable descriptor an outside catalogue or a negotiating agent can read without
370
+ * knowing anything about AIMEAT. Public, like the listing itself. Derived on read (never stored in ODPS
371
+ * form), so it cannot drift from the offering it describes. `.yaml` serves the spec's native format;
372
+ * `/odps` serves the same document as JSON inside the standard AIMEAT envelope (`?format=yaml` for raw).
373
+ * AIMEAT-specific truth (metered coordinate, pinned interface, provenance, observed usage) travels under
374
+ * `product.x-aimeat`, which keeps the document valid against the official schema.
375
+ */
376
+ async function serveOdps(req, res, format) {
377
+ const o = await getOffering(storage, str(req.params.id));
378
+ if (!o)
379
+ return res.status(404).json(error(config.nodeId, 'NOT_FOUND', 'No such offering'));
380
+ const ctx = await offeringContext(o);
381
+ const doc = offeringToOdps({
382
+ offering: o, iface: ctx.iface, callRecipe: ctx.callRecipe, stats: ctx.stats,
383
+ rakePercent: commerceFeePercent(config), baseUrl: config.baseUrl, nodeId: config.nodeId,
384
+ });
385
+ if (format === 'json')
386
+ return res.json(success(config.nodeId, { odps_version: ODPS_VERSION, odps: doc }));
387
+ res.type('text/yaml; charset=utf-8');
388
+ return res.send(odpsToYaml(doc));
389
+ }
390
+ router.get('/v1/exchange/offerings/:id/odps.yaml', (req, res) => serveOdps(req, res, 'yaml'));
391
+ router.get('/v1/exchange/offerings/:id/odps', (req, res) => serveOdps(req, res, str(req.query.format) === 'yaml' ? 'yaml' : 'json'));
303
392
  /**
304
393
  * Offering CONSUMERS (provider lineage) — who holds a contract against my offering, how much they consumed,
305
394
  * when they last used it. Provider-only: "where is my data used, by whom?".
@@ -313,6 +402,12 @@ export function exchangeMarketRouter(config, storage) {
313
402
  });
314
403
  /** Browse listed offerings (matching a capability or free text). Public. `?stats=1` folds in usage/reputation. */
315
404
  router.get('/v1/exchange/offerings', async (req, res) => {
405
+ // Safety net for the source-of-truth model: bring the CALLER's own projections up to date before
406
+ // they read the market (bounded to one owner — a browse never reconciles the whole node).
407
+ if (req.auth) {
408
+ await reconcileOwnerOfferingsThrottled(storage, resolveIdentity(req.auth, config.nodeId))
409
+ .catch(() => { });
410
+ }
316
411
  const ext = str(req.query.ext), action = str(req.query.action), q = str(req.query.q);
317
412
  const offerings = (ext && action) || q
318
413
  ? await matchOfferings(storage, { ext: ext || null, action: action || null, text: q || null })
@@ -323,14 +418,44 @@ export function exchangeMarketRouter(config, storage) {
323
418
  }
324
419
  return res.json(success(config.nodeId, { offerings, count: offerings.length }));
325
420
  });
326
- /** Delist an offering (owner only). */
421
+ /**
422
+ * Delist an offering (owner only). A PROJECTED listing (`auto`) exists because its source says so, so
423
+ * delisting it by hand would come straight back on the next reconcile — the honest answer is to turn the
424
+ * source's `exchange` flag off, and that is what this reports (409) instead of lying about the outcome.
425
+ */
327
426
  router.delete('/v1/exchange/offerings/:id', requireAuth(), async (req, res) => {
328
427
  const o = await getOffering(storage, str(req.params.id));
329
428
  if (!o || o.providerOwner !== req.auth.owner)
330
429
  return res.status(404).json(error(config.nodeId, 'NOT_FOUND', 'No such offering of yours'));
430
+ if (o.auto && str(req.query.force) !== '1') {
431
+ return res.status(409).json(error(config.nodeId, 'SOURCE_MANAGED', `This listing is projected from its source (${o.ext}/${o.action}). Turn "exchange" off there (app-catalog → app details → app tools, the extension action, or the agent offer) and it is removed. Pass ?force=1 to delist until the next reconcile.`));
432
+ }
331
433
  await deleteOffering(storage, o.offeringId);
332
434
  return res.json(success(config.nodeId, { offeringId: o.offeringId, state: 'delisted' }));
333
435
  });
436
+ /**
437
+ * Reconcile the caller's own listings against their sources (TARGET-050). Normally automatic — writing a
438
+ * tool manifest, an extension or an offer projects it — this is the explicit handle: a `dry_run` report
439
+ * before anything changes, and `migrate` to adopt hand-authored listings into the projection model
440
+ * (flag their source, keep their offeringId so existing contracts keep resolving).
441
+ */
442
+ router.post('/v1/exchange/reconcile', requireAuth(), async (req, res) => {
443
+ const b = (req.body ?? {});
444
+ const dryRun = b.dry_run === true || str(req.query.dry_run) === '1';
445
+ const migrate = b.migrate === true || str(req.query.migrate) === '1';
446
+ const ownerGhii = resolveIdentity(req.auth, config.nodeId);
447
+ const report = migrate
448
+ ? await migrateLegacyOfferings(storage, ownerGhii, { dryRun })
449
+ : await reconcileOwnerOfferings(storage, ownerGhii, {
450
+ dryRun,
451
+ ...(str(b.app_id) ? { appId: str(b.app_id) } : {}),
452
+ ...(str(b.ext) ? { extName: str(b.ext) } : {}),
453
+ ...(str(b.agent) ? { agentName: str(b.agent) } : {}),
454
+ });
455
+ return res.json(success(config.nodeId, report, [
456
+ { description: 'Browse the marketplace', method: 'GET', url: '/v1/exchange/offerings' },
457
+ ]));
458
+ });
334
459
  // ── NEEDS (demand) ──────────────────────────────────────────────────────────
335
460
  /** Post an open need. Providers browse open needs and bid. */
336
461
  router.post('/v1/exchange/needs', requireAuth(), async (req, res) => {
@@ -437,7 +562,8 @@ export function exchangeMarketRouter(config, storage) {
437
562
  consumerGaii, appId: n.appId, providerGhii: `${extRec.installedBy}@${config.nodeId}`,
438
563
  ext: bid.ext, action: bid.action, capabilityLabel: `${bid.ext}/${bid.action}`,
439
564
  unit: priced.unit, pricePerCall: priced.pricePerCall, currency: priced.currency, pricing: priced.pricing,
440
- capUnits: capCap, contractRef: `bid:${bid.bidId}`, createdBy: owner, carrySpend: existing,
565
+ capUnits: capCap, contractRef: `bid:${bid.bidId}`, tollMorsels: act.tollMorsels ?? null,
566
+ createdBy: owner, carrySpend: existing,
441
567
  });
442
568
  // Mark the bid accepted + the need matched (append updates; other bids stay for the record).
443
569
  bid.state = 'accepted';