aimeat 2.0.0 → 2.1.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 (412) hide show
  1. package/dist/locales/en.json +35 -1
  2. package/dist/locales/fi.json +35 -1
  3. package/dist/public/components/LinkPreview.js +101 -0
  4. package/dist/public/components/NotificationBell.js +18 -1
  5. package/dist/public/css/theme.css +57 -7
  6. package/dist/public/css/views/admin.css +8 -1
  7. package/dist/public/css/views/app-grant.css +18 -0
  8. package/dist/public/css/views/inbox.css +46 -0
  9. package/dist/public/css/views/portfolio.css +46 -0
  10. package/dist/public/css/views/profile.css +29 -4
  11. package/dist/public/js/services/apps.js +19 -3
  12. package/dist/public/js/services/messages-ai-prompts.js +38 -0
  13. package/dist/public/js/services/messages.js +26 -4
  14. package/dist/public/js/services/notebook.js +76 -0
  15. package/dist/public/js/services/unfurl.js +43 -0
  16. package/dist/public/lib/samples/LICENSE.md +11 -0
  17. package/dist/public/lib/samples/bass/A1.mp3 +0 -0
  18. package/dist/public/lib/samples/bass/B2.mp3 +0 -0
  19. package/dist/public/lib/samples/bass/D2.mp3 +0 -0
  20. package/dist/public/lib/samples/bass/E1.mp3 +0 -0
  21. package/dist/public/lib/samples/bass/E3.mp3 +0 -0
  22. package/dist/public/lib/samples/bass/G2.mp3 +0 -0
  23. package/dist/public/lib/samples/epiano/C2.mp3 +0 -0
  24. package/dist/public/lib/samples/epiano/C3.mp3 +0 -0
  25. package/dist/public/lib/samples/epiano/C4.mp3 +0 -0
  26. package/dist/public/lib/samples/epiano/C5.mp3 +0 -0
  27. package/dist/public/lib/samples/epiano/C6.mp3 +0 -0
  28. package/dist/public/lib/samples/epiano/G2.mp3 +0 -0
  29. package/dist/public/lib/samples/epiano/G3.mp3 +0 -0
  30. package/dist/public/lib/samples/epiano/G4.mp3 +0 -0
  31. package/dist/public/lib/samples/epiano/G5.mp3 +0 -0
  32. package/dist/public/lib/samples/guitar-steel/A2.mp3 +0 -0
  33. package/dist/public/lib/samples/guitar-steel/A4.mp3 +0 -0
  34. package/dist/public/lib/samples/guitar-steel/B3.mp3 +0 -0
  35. package/dist/public/lib/samples/guitar-steel/D3.mp3 +0 -0
  36. package/dist/public/lib/samples/guitar-steel/E2.mp3 +0 -0
  37. package/dist/public/lib/samples/guitar-steel/E4.mp3 +0 -0
  38. package/dist/public/lib/samples/guitar-steel/E5.mp3 +0 -0
  39. package/dist/public/lib/samples/guitar-steel/G3.mp3 +0 -0
  40. package/dist/public/lib/samples/organ/C2.mp3 +0 -0
  41. package/dist/public/lib/samples/organ/C3.mp3 +0 -0
  42. package/dist/public/lib/samples/organ/C4.mp3 +0 -0
  43. package/dist/public/lib/samples/organ/C5.mp3 +0 -0
  44. package/dist/public/lib/samples/organ/C6.mp3 +0 -0
  45. package/dist/public/lib/samples/organ/G2.mp3 +0 -0
  46. package/dist/public/lib/samples/organ/G3.mp3 +0 -0
  47. package/dist/public/lib/samples/organ/G4.mp3 +0 -0
  48. package/dist/public/lib/samples/organ/G5.mp3 +0 -0
  49. package/dist/public/lib/samples/strings/C2.mp3 +0 -0
  50. package/dist/public/lib/samples/strings/C3.mp3 +0 -0
  51. package/dist/public/lib/samples/strings/C4.mp3 +0 -0
  52. package/dist/public/lib/samples/strings/C5.mp3 +0 -0
  53. package/dist/public/lib/samples/strings/C6.mp3 +0 -0
  54. package/dist/public/lib/samples/strings/G2.mp3 +0 -0
  55. package/dist/public/lib/samples/strings/G3.mp3 +0 -0
  56. package/dist/public/lib/samples/strings/G4.mp3 +0 -0
  57. package/dist/public/lib/samples/strings/G5.mp3 +0 -0
  58. package/dist/public/lib/samples/trumpet/A3.mp3 +0 -0
  59. package/dist/public/lib/samples/trumpet/A4.mp3 +0 -0
  60. package/dist/public/lib/samples/trumpet/A5.mp3 +0 -0
  61. package/dist/public/lib/samples/trumpet/C4.mp3 +0 -0
  62. package/dist/public/lib/samples/trumpet/C5.mp3 +0 -0
  63. package/dist/public/lib/samples/trumpet/E3.mp3 +0 -0
  64. package/dist/public/lib/samples/trumpet/E4.mp3 +0 -0
  65. package/dist/public/lib/samples/trumpet/E5.mp3 +0 -0
  66. package/dist/public/spa.html +2 -0
  67. package/dist/public/views/app-grant.js +24 -4
  68. package/dist/public/views/portfolio.js +61 -6
  69. package/dist/public/views/profile/apps-tab.js +18 -1
  70. package/dist/public/views/profile/inbox-tab/ai-actions.js +86 -0
  71. package/dist/public/views/profile/inbox-tab/components.js +124 -9
  72. package/dist/public/views/profile/inbox-tab/helpers.js +26 -0
  73. package/dist/public/views/profile/inbox-tab/panels.js +18 -3
  74. package/dist/public/views/profile/inbox-tab/use-thread-ux.js +18 -1
  75. package/dist/public/views/profile/inbox-tab.js +46 -49
  76. package/dist/public/views/profile/landing-page.cards.js +7 -0
  77. package/dist/public/views/profile/landing-page.js +12 -1
  78. package/dist/public/views/profile/skills-tab.js +1 -1
  79. package/dist/public/views/public-workspace-viewer.js +1 -1
  80. package/dist/public/views/start.js +2 -1
  81. package/dist/scripts/build-sdk-libs.d.ts +16 -0
  82. package/dist/scripts/build-sdk-libs.d.ts.map +1 -0
  83. package/dist/scripts/build-sdk-libs.js +112 -0
  84. package/dist/scripts/build-sdk-libs.js.map +1 -0
  85. package/dist/src/cli/connect/auth.d.ts +15 -0
  86. package/dist/src/cli/connect/auth.d.ts.map +1 -1
  87. package/dist/src/cli/connect/auth.js +25 -6
  88. package/dist/src/cli/connect/auth.js.map +1 -1
  89. package/dist/src/cli/connect/keychain.d.ts +9 -0
  90. package/dist/src/cli/connect/keychain.d.ts.map +1 -1
  91. package/dist/src/cli/connect/keychain.js +21 -8
  92. package/dist/src/cli/connect/keychain.js.map +1 -1
  93. package/dist/src/cli/connect/mcp/tools/exchange.d.ts +18 -0
  94. package/dist/src/cli/connect/mcp/tools/exchange.d.ts.map +1 -0
  95. package/dist/src/cli/connect/mcp/tools/exchange.js +170 -0
  96. package/dist/src/cli/connect/mcp/tools/exchange.js.map +1 -0
  97. package/dist/src/cli/connect/mcp/tools/index.d.ts.map +1 -1
  98. package/dist/src/cli/connect/mcp/tools/index.js +2 -0
  99. package/dist/src/cli/connect/mcp/tools/index.js.map +1 -1
  100. package/dist/src/cli/connect/tool-call-defs-exchange.d.ts +3 -0
  101. package/dist/src/cli/connect/tool-call-defs-exchange.d.ts.map +1 -0
  102. package/dist/src/cli/connect/tool-call-defs-exchange.js +146 -0
  103. package/dist/src/cli/connect/tool-call-defs-exchange.js.map +1 -0
  104. package/dist/src/cli/connect/tool-call.d.ts.map +1 -1
  105. package/dist/src/cli/connect/tool-call.js +2 -0
  106. package/dist/src/cli/connect/tool-call.js.map +1 -1
  107. package/dist/src/commerce/session-service.d.ts +14 -0
  108. package/dist/src/commerce/session-service.d.ts.map +1 -1
  109. package/dist/src/commerce/session-service.js +1 -1
  110. package/dist/src/commerce/session-service.js.map +1 -1
  111. package/dist/src/data/app-templates/shells.d.ts +7 -3
  112. package/dist/src/data/app-templates/shells.d.ts.map +1 -1
  113. package/dist/src/data/app-templates/shells.js +10 -6
  114. package/dist/src/data/app-templates/shells.js.map +1 -1
  115. package/dist/src/data/appdev-pitfalls.d.ts +2 -0
  116. package/dist/src/data/appdev-pitfalls.d.ts.map +1 -1
  117. package/dist/src/data/appdev-pitfalls.js +24 -1
  118. package/dist/src/data/appdev-pitfalls.js.map +1 -1
  119. package/dist/src/generated/api-types.d.ts +1565 -9
  120. package/dist/src/generated/api-types.d.ts.map +1 -1
  121. package/dist/src/mcp/annotations.d.ts.map +1 -1
  122. package/dist/src/mcp/annotations.js +20 -0
  123. package/dist/src/mcp/annotations.js.map +1 -1
  124. package/dist/src/mcp/apps.d.ts.map +1 -1
  125. package/dist/src/mcp/apps.js +8 -4
  126. package/dist/src/mcp/apps.js.map +1 -1
  127. package/dist/src/mcp/catalog/definitions/exchange.d.ts +18 -0
  128. package/dist/src/mcp/catalog/definitions/exchange.d.ts.map +1 -0
  129. package/dist/src/mcp/catalog/definitions/exchange.js +182 -0
  130. package/dist/src/mcp/catalog/definitions/exchange.js.map +1 -0
  131. package/dist/src/mcp/catalog/definitions.d.ts.map +1 -1
  132. package/dist/src/mcp/catalog/definitions.js +2 -0
  133. package/dist/src/mcp/catalog/definitions.js.map +1 -1
  134. package/dist/src/mcp/catalog/scopes.d.ts.map +1 -1
  135. package/dist/src/mcp/catalog/scopes.js +22 -0
  136. package/dist/src/mcp/catalog/scopes.js.map +1 -1
  137. package/dist/src/mcp/catalog/surfaces.d.ts.map +1 -1
  138. package/dist/src/mcp/catalog/surfaces.js +14 -0
  139. package/dist/src/mcp/catalog/surfaces.js.map +1 -1
  140. package/dist/src/mcp/exchange-run.d.ts +5 -0
  141. package/dist/src/mcp/exchange-run.d.ts.map +1 -0
  142. package/dist/src/mcp/exchange-run.js +226 -0
  143. package/dist/src/mcp/exchange-run.js.map +1 -0
  144. package/dist/src/mcp/exchange.d.ts +5 -0
  145. package/dist/src/mcp/exchange.d.ts.map +1 -0
  146. package/dist/src/mcp/exchange.js +351 -0
  147. package/dist/src/mcp/exchange.js.map +1 -0
  148. package/dist/src/mcp/extensions.d.ts.map +1 -1
  149. package/dist/src/mcp/extensions.js +11 -0
  150. package/dist/src/mcp/extensions.js.map +1 -1
  151. package/dist/src/mcp/index.d.ts.map +1 -1
  152. package/dist/src/mcp/index.js +6 -2
  153. package/dist/src/mcp/index.js.map +1 -1
  154. package/dist/src/models/app-tool-schemas.d.ts +55 -1
  155. package/dist/src/models/app-tool-schemas.d.ts.map +1 -1
  156. package/dist/src/models/app-tool-schemas.js +20 -1
  157. package/dist/src/models/app-tool-schemas.js.map +1 -1
  158. package/dist/src/models/offer-schemas.d.ts +2 -2
  159. package/dist/src/models/schemas.d.ts +1 -0
  160. package/dist/src/models/schemas.d.ts.map +1 -1
  161. package/dist/src/models/schemas.js +3 -0
  162. package/dist/src/models/schemas.js.map +1 -1
  163. package/dist/src/routes/agents/device-auth.d.ts +4 -0
  164. package/dist/src/routes/agents/device-auth.d.ts.map +1 -1
  165. package/dist/src/routes/agents/device-auth.js +19 -4
  166. package/dist/src/routes/agents/device-auth.js.map +1 -1
  167. package/dist/src/routes/app-grants.d.ts +6 -0
  168. package/dist/src/routes/app-grants.d.ts.map +1 -1
  169. package/dist/src/routes/app-grants.js +35 -2
  170. package/dist/src/routes/app-grants.js.map +1 -1
  171. package/dist/src/routes/apps/fork-manage.d.ts.map +1 -1
  172. package/dist/src/routes/apps/fork-manage.js +24 -1
  173. package/dist/src/routes/apps/fork-manage.js.map +1 -1
  174. package/dist/src/routes/apps/publish.d.ts +2 -0
  175. package/dist/src/routes/apps/publish.d.ts.map +1 -1
  176. package/dist/src/routes/apps/publish.js +27 -1
  177. package/dist/src/routes/apps/publish.js.map +1 -1
  178. package/dist/src/routes/apps-cost.d.ts +25 -0
  179. package/dist/src/routes/apps-cost.d.ts.map +1 -0
  180. package/dist/src/routes/apps-cost.js +107 -0
  181. package/dist/src/routes/apps-cost.js.map +1 -0
  182. package/dist/src/routes/exchange-market.d.ts +28 -0
  183. package/dist/src/routes/exchange-market.d.ts.map +1 -0
  184. package/dist/src/routes/exchange-market.js +454 -0
  185. package/dist/src/routes/exchange-market.js.map +1 -0
  186. package/dist/src/routes/exchange.d.ts +33 -0
  187. package/dist/src/routes/exchange.d.ts.map +1 -0
  188. package/dist/src/routes/exchange.js +395 -0
  189. package/dist/src/routes/exchange.js.map +1 -0
  190. package/dist/src/routes/extensions/entitlement-gate.d.ts +33 -0
  191. package/dist/src/routes/extensions/entitlement-gate.d.ts.map +1 -0
  192. package/dist/src/routes/extensions/entitlement-gate.js +143 -0
  193. package/dist/src/routes/extensions/entitlement-gate.js.map +1 -0
  194. package/dist/src/routes/extensions/manifest.d.ts +9 -0
  195. package/dist/src/routes/extensions/manifest.d.ts.map +1 -1
  196. package/dist/src/routes/extensions/manifest.js +33 -1
  197. package/dist/src/routes/extensions/manifest.js.map +1 -1
  198. package/dist/src/routes/extensions/paywall.d.ts.map +1 -1
  199. package/dist/src/routes/extensions/paywall.js +9 -0
  200. package/dist/src/routes/extensions/paywall.js.map +1 -1
  201. package/dist/src/routes/federation-sync/messaging.d.ts.map +1 -1
  202. package/dist/src/routes/federation-sync/messaging.js +3 -1
  203. package/dist/src/routes/federation-sync/messaging.js.map +1 -1
  204. package/dist/src/routes/ghii/recovery.d.ts +2 -0
  205. package/dist/src/routes/ghii/recovery.d.ts.map +1 -1
  206. package/dist/src/routes/ghii/recovery.js +7 -0
  207. package/dist/src/routes/ghii/recovery.js.map +1 -1
  208. package/dist/src/routes/ghii/register-login.d.ts +4 -0
  209. package/dist/src/routes/ghii/register-login.d.ts.map +1 -1
  210. package/dist/src/routes/ghii/register-login.js +45 -22
  211. package/dist/src/routes/ghii/register-login.js.map +1 -1
  212. package/dist/src/routes/ghii/web-verify.d.ts +5 -0
  213. package/dist/src/routes/ghii/web-verify.d.ts.map +1 -1
  214. package/dist/src/routes/ghii/web-verify.js +24 -3
  215. package/dist/src/routes/ghii/web-verify.js.map +1 -1
  216. package/dist/src/routes/libs/sdk-serve.d.ts +11 -0
  217. package/dist/src/routes/libs/sdk-serve.d.ts.map +1 -0
  218. package/dist/src/routes/libs/sdk-serve.js +53 -0
  219. package/dist/src/routes/libs/sdk-serve.js.map +1 -0
  220. package/dist/src/routes/libs.d.ts +7 -1
  221. package/dist/src/routes/libs.d.ts.map +1 -1
  222. package/dist/src/routes/libs.js +65 -146
  223. package/dist/src/routes/libs.js.map +1 -1
  224. package/dist/src/routes/messages.d.ts +3 -0
  225. package/dist/src/routes/messages.d.ts.map +1 -1
  226. package/dist/src/routes/messages.js +9 -0
  227. package/dist/src/routes/messages.js.map +1 -1
  228. package/dist/src/routes/notifications.d.ts +6 -3
  229. package/dist/src/routes/notifications.d.ts.map +1 -1
  230. package/dist/src/routes/notifications.js +32 -3
  231. package/dist/src/routes/notifications.js.map +1 -1
  232. package/dist/src/routes/organisms/workspace-access.d.ts.map +1 -1
  233. package/dist/src/routes/organisms/workspace-access.js +38 -20
  234. package/dist/src/routes/organisms/workspace-access.js.map +1 -1
  235. package/dist/src/routes/unfurl.d.ts +27 -0
  236. package/dist/src/routes/unfurl.d.ts.map +1 -0
  237. package/dist/src/routes/unfurl.js +180 -0
  238. package/dist/src/routes/unfurl.js.map +1 -0
  239. package/dist/src/routes/upload.d.ts +2 -0
  240. package/dist/src/routes/upload.d.ts.map +1 -1
  241. package/dist/src/routes/upload.js +7 -0
  242. package/dist/src/routes/upload.js.map +1 -1
  243. package/dist/src/routes/webmcp.d.ts +3 -0
  244. package/dist/src/routes/webmcp.d.ts.map +1 -1
  245. package/dist/src/routes/webmcp.js +55 -0
  246. package/dist/src/routes/webmcp.js.map +1 -1
  247. package/dist/src/server-bootstrap/routes-loader.d.ts +1 -0
  248. package/dist/src/server-bootstrap/routes-loader.d.ts.map +1 -1
  249. package/dist/src/server-bootstrap/routes-loader.js +8 -0
  250. package/dist/src/server-bootstrap/routes-loader.js.map +1 -1
  251. package/dist/src/services/agent-face.d.ts +10 -2
  252. package/dist/src/services/agent-face.d.ts.map +1 -1
  253. package/dist/src/services/agent-face.js +10 -4
  254. package/dist/src/services/agent-face.js.map +1 -1
  255. package/dist/src/services/app-tool-interfaces.d.ts +37 -0
  256. package/dist/src/services/app-tool-interfaces.d.ts.map +1 -0
  257. package/dist/src/services/app-tool-interfaces.js +101 -0
  258. package/dist/src/services/app-tool-interfaces.js.map +1 -0
  259. package/dist/src/services/build-app-prompt.d.ts +3 -0
  260. package/dist/src/services/build-app-prompt.d.ts.map +1 -1
  261. package/dist/src/services/build-app-prompt.js +12 -1
  262. package/dist/src/services/build-app-prompt.js.map +1 -1
  263. package/dist/src/services/contacts.d.ts +25 -1
  264. package/dist/src/services/contacts.d.ts.map +1 -1
  265. package/dist/src/services/contacts.js +30 -0
  266. package/dist/src/services/contacts.js.map +1 -1
  267. package/dist/src/services/entitlement-money.d.ts +55 -0
  268. package/dist/src/services/entitlement-money.d.ts.map +1 -0
  269. package/dist/src/services/entitlement-money.js +68 -0
  270. package/dist/src/services/entitlement-money.js.map +1 -0
  271. package/dist/src/services/exchange-market.d.ts +247 -0
  272. package/dist/src/services/exchange-market.d.ts.map +1 -0
  273. package/dist/src/services/exchange-market.js +254 -0
  274. package/dist/src/services/exchange-market.js.map +1 -0
  275. package/dist/src/services/exchange-proposals.d.ts +47 -0
  276. package/dist/src/services/exchange-proposals.d.ts.map +1 -0
  277. package/dist/src/services/exchange-proposals.js +71 -0
  278. package/dist/src/services/exchange-proposals.js.map +1 -0
  279. package/dist/src/services/exchange-work.d.ts +30 -0
  280. package/dist/src/services/exchange-work.d.ts.map +1 -0
  281. package/dist/src/services/exchange-work.js +43 -0
  282. package/dist/src/services/exchange-work.js.map +1 -0
  283. package/dist/src/services/message-send.d.ts.map +1 -1
  284. package/dist/src/services/message-send.js +4 -1
  285. package/dist/src/services/message-send.js.map +1 -1
  286. package/dist/src/services/metered-entitlements.d.ts +203 -0
  287. package/dist/src/services/metered-entitlements.d.ts.map +1 -0
  288. package/dist/src/services/metered-entitlements.js +264 -0
  289. package/dist/src/services/metered-entitlements.js.map +1 -0
  290. package/dist/src/services/notify.d.ts +7 -0
  291. package/dist/src/services/notify.d.ts.map +1 -1
  292. package/dist/src/services/notify.js +35 -0
  293. package/dist/src/services/notify.js.map +1 -1
  294. package/dist/src/services/owner-memory.d.ts +16 -0
  295. package/dist/src/services/owner-memory.d.ts.map +1 -1
  296. package/dist/src/services/owner-memory.js +23 -0
  297. package/dist/src/services/owner-memory.js.map +1 -1
  298. package/dist/src/services/owner-provisioning.d.ts +5 -0
  299. package/dist/src/services/owner-provisioning.d.ts.map +1 -1
  300. package/dist/src/services/owner-provisioning.js +20 -2
  301. package/dist/src/services/owner-provisioning.js.map +1 -1
  302. package/dist/src/storage/providers/postgres-kysely/methods/apps.d.ts +1 -0
  303. package/dist/src/storage/providers/postgres-kysely/methods/apps.d.ts.map +1 -1
  304. package/dist/src/storage/providers/postgres-kysely/methods/apps.js +2 -0
  305. package/dist/src/storage/providers/postgres-kysely/methods/apps.js.map +1 -1
  306. package/dist/src/storage/providers/postgres-kysely/methods/identity.d.ts +1 -0
  307. package/dist/src/storage/providers/postgres-kysely/methods/identity.d.ts.map +1 -1
  308. package/dist/src/storage/providers/postgres-kysely/methods/identity.js +4 -0
  309. package/dist/src/storage/providers/postgres-kysely/methods/identity.js.map +1 -1
  310. package/dist/src/storage/providers/postgres-kysely/migrations/0011_unique_verified_email.sql +25 -0
  311. package/dist/src/storage/providers/sqlite/methods/apps.d.ts +1 -0
  312. package/dist/src/storage/providers/sqlite/methods/apps.d.ts.map +1 -1
  313. package/dist/src/storage/providers/sqlite/methods/apps.js +2 -0
  314. package/dist/src/storage/providers/sqlite/methods/apps.js.map +1 -1
  315. package/dist/src/storage/providers/sqlite/methods/identity-nodes.d.ts +1 -0
  316. package/dist/src/storage/providers/sqlite/methods/identity-nodes.d.ts.map +1 -1
  317. package/dist/src/storage/providers/sqlite/methods/identity-nodes.js +4 -0
  318. package/dist/src/storage/providers/sqlite/methods/identity-nodes.js.map +1 -1
  319. package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
  320. package/dist/src/storage/providers/sqlite/schema.js +20 -0
  321. package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
  322. package/dist/src/storage/repositories/app.repository.d.ts +0 -0
  323. package/dist/src/storage/repositories/app.repository.d.ts.map +1 -1
  324. package/dist/src/storage/repositories/identity.repository.d.ts +6 -0
  325. package/dist/src/storage/repositories/identity.repository.d.ts.map +1 -1
  326. package/dist/src/storage/types/apps.d.ts +1 -0
  327. package/dist/src/storage/types/apps.d.ts.map +1 -1
  328. package/dist/src/storage/types/organisms-federation.d.ts +21 -0
  329. package/dist/src/storage/types/organisms-federation.d.ts.map +1 -1
  330. package/dist/src/utils/app-mobile-lint.d.ts +17 -0
  331. package/dist/src/utils/app-mobile-lint.d.ts.map +1 -0
  332. package/dist/src/utils/app-mobile-lint.js +40 -0
  333. package/dist/src/utils/app-mobile-lint.js.map +1 -0
  334. package/dist/static/app-catalog/_template.html +12 -77
  335. package/dist/static/app-catalog/js/apps-io.js +51 -165
  336. package/dist/static/app-catalog/js/cost.js +100 -0
  337. package/dist/static/app-catalog/js/db.js +23 -93
  338. package/dist/static/app-catalog/js/detail.js +158 -24
  339. package/dist/static/app-catalog/js/favorites.js +71 -0
  340. package/dist/static/app-catalog/js/i18n-data.js +90 -16
  341. package/dist/static/app-catalog/js/main.js +23 -103
  342. package/dist/static/app-catalog/js/migrate.js +88 -0
  343. package/dist/static/app-catalog/js/monetize.js +1 -1
  344. package/dist/static/app-catalog/js/promote.js +70 -0
  345. package/dist/static/app-catalog/js/render.js +26 -139
  346. package/dist/static/app-catalog/js/server-io.js +126 -223
  347. package/dist/static/app-catalog/js/settings.js +11 -204
  348. package/dist/static/app-catalog/styles/app-catalog.css +40 -0
  349. package/dist/static/app-catalog.html +790 -912
  350. package/dist/static/sdk-libs/_core/config.js +52 -0
  351. package/dist/static/sdk-libs/_core/http.js +52 -0
  352. package/dist/static/sdk-libs/_core/namespace.js +33 -0
  353. package/dist/static/sdk-libs/_core/sdk-globals.d.ts +50 -0
  354. package/dist/static/sdk-libs/_core/session.js +66 -0
  355. package/dist/static/sdk-libs/agentface/index.js +102 -0
  356. package/dist/static/sdk-libs/agents/index.js +267 -0
  357. package/dist/static/sdk-libs/ai/index.js +153 -0
  358. package/dist/static/sdk-libs/audio/core.js +111 -0
  359. package/dist/static/sdk-libs/audio/index.js +380 -0
  360. package/dist/static/sdk-libs/audio/instruments.js +369 -0
  361. package/dist/static/sdk-libs/auth/config.js +46 -0
  362. package/dist/static/sdk-libs/auth/crypto.js +166 -0
  363. package/dist/static/sdk-libs/auth/events.js +27 -0
  364. package/dist/static/sdk-libs/auth/i18n.js +64 -0
  365. package/dist/static/sdk-libs/auth/index.js +37 -0
  366. package/dist/static/sdk-libs/auth/modal.js +545 -0
  367. package/dist/static/sdk-libs/auth/pill.js +167 -0
  368. package/dist/static/sdk-libs/auth/session.js +792 -0
  369. package/dist/static/sdk-libs/auth/signup.js +232 -0
  370. package/dist/static/sdk-libs/auth/theme.js +96 -0
  371. package/dist/static/sdk-libs/capabilities/index.js +179 -0
  372. package/dist/static/sdk-libs/commerce/index.js +243 -0
  373. package/dist/static/sdk-libs/data/index.js +188 -0
  374. package/dist/static/sdk-libs/dist/aimeat-agentface.js +91 -0
  375. package/dist/static/sdk-libs/dist/aimeat-agents.js +315 -0
  376. package/dist/static/sdk-libs/dist/aimeat-ai.js +168 -0
  377. package/dist/static/sdk-libs/dist/aimeat-audio.js +979 -0
  378. package/dist/static/sdk-libs/dist/aimeat-auth.js +1831 -0
  379. package/dist/static/sdk-libs/dist/aimeat-capabilities.js +177 -0
  380. package/dist/static/sdk-libs/dist/aimeat-commerce.js +265 -0
  381. package/dist/static/sdk-libs/dist/aimeat-data.js +205 -0
  382. package/dist/static/sdk-libs/dist/aimeat-editor.js +299 -0
  383. package/dist/static/sdk-libs/dist/aimeat-header.js +270 -0
  384. package/dist/static/sdk-libs/dist/aimeat-intake.js +94 -0
  385. package/dist/static/sdk-libs/dist/aimeat-live.js +265 -0
  386. package/dist/static/sdk-libs/dist/aimeat-markdown.js +602 -0
  387. package/dist/static/sdk-libs/dist/aimeat-organism.js +394 -0
  388. package/dist/static/sdk-libs/dist/aimeat-portfolio-standalone.js +90 -0
  389. package/dist/static/sdk-libs/dist/aimeat-social.js +157 -0
  390. package/dist/static/sdk-libs/dist/aimeat-speech.js +300 -0
  391. package/dist/static/sdk-libs/dist/aimeat-storage.js +210 -0
  392. package/dist/static/sdk-libs/dist/aimeat-tunnel.js +383 -0
  393. package/dist/static/sdk-libs/dist/aimeat-wallet.js +118 -0
  394. package/dist/static/sdk-libs/dist/aimeat-webmcp.js +187 -0
  395. package/dist/static/sdk-libs/dist/aimeat-work.js +213 -0
  396. package/dist/static/sdk-libs/dist/aimeat-workflows.js +147 -0
  397. package/dist/static/sdk-libs/editor/index.js +229 -0
  398. package/dist/static/sdk-libs/header/index.js +249 -0
  399. package/dist/static/sdk-libs/intake/index.js +75 -0
  400. package/dist/static/sdk-libs/live/index.js +156 -0
  401. package/dist/static/sdk-libs/markdown/index.js +522 -0
  402. package/dist/static/sdk-libs/organism/index.js +381 -0
  403. package/dist/static/sdk-libs/portfolio-standalone/index.js +78 -0
  404. package/dist/static/sdk-libs/social/index.js +140 -0
  405. package/dist/static/sdk-libs/speech/index.js +321 -0
  406. package/dist/static/sdk-libs/storage/index.js +189 -0
  407. package/dist/static/sdk-libs/tunnel/index.js +428 -0
  408. package/dist/static/sdk-libs/wallet/index.js +115 -0
  409. package/dist/static/sdk-libs/webmcp/index.js +185 -0
  410. package/dist/static/sdk-libs/work/index.js +191 -0
  411. package/dist/static/sdk-libs/workflows/index.js +113 -0
  412. package/package.json +5 -2
@@ -0,0 +1,177 @@
1
+ // GENERATED FILE — do not edit directly. Source: src/static/sdk-libs/capabilities/ (+ _core/).
2
+ // Rebuild: pnpm build:sdk · Served at /v1/libs/aimeat-capabilities.js (with a per-node config prelude).
3
+ "use strict";
4
+ (() => {
5
+ // src/static/sdk-libs/_core/session.js
6
+ function getSession(libLabel) {
7
+ const auth = window.AIMEAT && window.AIMEAT.auth;
8
+ if (!auth) {
9
+ throw new Error("AIMEAT.auth is required. Include aimeat-auth.js before " + (libLabel || "this library"));
10
+ }
11
+ const s = auth.getSession();
12
+ if (!s) throw new Error("Not logged in. Call AIMEAT.auth.login() first.");
13
+ return s;
14
+ }
15
+ function authFetch(path, opts, libLabel) {
16
+ return getSession(libLabel).fetch(path, opts);
17
+ }
18
+ function makeSession(libLabel) {
19
+ return {
20
+ getSession: () => getSession(libLabel),
21
+ authFetch: (path, opts) => authFetch(path, opts, libLabel)
22
+ };
23
+ }
24
+
25
+ // src/static/sdk-libs/_core/namespace.js
26
+ function namespace() {
27
+ if (!window.AIMEAT) window.AIMEAT = {};
28
+ return window.AIMEAT;
29
+ }
30
+ function attach(key, value) {
31
+ const ns = namespace();
32
+ ns[key] = value;
33
+ return ns;
34
+ }
35
+
36
+ // src/static/sdk-libs/capabilities/index.js
37
+ var { getSession: getSession2, authFetch: authFetch2 } = makeSession("aimeat-capabilities.js");
38
+ var _loadedCortex = {};
39
+ async function loadCortexLib(url) {
40
+ if (_loadedCortex[url]) return;
41
+ return new Promise(function(resolve, reject) {
42
+ var s = document.createElement("script");
43
+ s.src = url;
44
+ s.onload = function() {
45
+ _loadedCortex[url] = true;
46
+ resolve(void 0);
47
+ };
48
+ s.onerror = function() {
49
+ reject(new Error("Failed to load: " + url));
50
+ };
51
+ document.head.appendChild(s);
52
+ });
53
+ }
54
+ var capabilities = {
55
+ // ── Discovery ──
56
+ async list(filters) {
57
+ var params = new URLSearchParams();
58
+ if (filters) {
59
+ if (filters.search) params.set("search", filters.search);
60
+ if (filters.tags) params.set("tags", filters.tags.join(","));
61
+ if (filters.callable !== void 0) params.set("callable", String(filters.callable));
62
+ if (filters.authRequired) params.set("authRequired", filters.authRequired);
63
+ if (filters.source_type) params.set("source_type", filters.source_type);
64
+ if (filters.status) params.set("status", filters.status);
65
+ if (filters.page) params.set("page", String(filters.page));
66
+ if (filters.per_page) params.set("per_page", String(filters.per_page));
67
+ }
68
+ var qs = params.toString();
69
+ var res = await authFetch2("/v1/capabilities" + (qs ? "?" + qs : ""));
70
+ if (!res.ok) throw new Error(res.error?.message || "Failed to list capabilities");
71
+ return res.data;
72
+ },
73
+ async search(query) {
74
+ return capabilities.list({ search: query });
75
+ },
76
+ async get(id) {
77
+ var res = await authFetch2("/v1/capabilities/" + encodeURIComponent(id));
78
+ if (!res.ok) throw new Error(res.error?.message || "Capability not found");
79
+ return res.data;
80
+ },
81
+ // ── Invocation ──
82
+ async invoke(id, input, opts) {
83
+ var cap = await capabilities.get(id);
84
+ var mode = opts && opts.mode || "normal";
85
+ if (cap.source && cap.source.type === "cortex") {
86
+ var usage = cap.usage || "";
87
+ var libMatch = usage.match(/loadScript\(['"]([^'"]+)['"]/);
88
+ if (libMatch) {
89
+ await loadCortexLib(libMatch[1]);
90
+ }
91
+ if (cap.exports && cap.exports.length > 0) {
92
+ var parts = id.split(":");
93
+ var funcName = parts.length >= 3 ? parts[2] : null;
94
+ if (funcName) {
95
+ var fn = window[funcName] || window.AIMEAT && window.AIMEAT[funcName];
96
+ if (typeof fn === "function") {
97
+ var start = performance.now();
98
+ var result = await fn(input);
99
+ var duration = Math.round(performance.now() - start);
100
+ try {
101
+ authFetch2("/v1/capabilities/" + encodeURIComponent(id) + "/telemetry", {
102
+ method: "POST",
103
+ body: JSON.stringify({ duration_ms: duration, status: "success" })
104
+ }).catch(function() {
105
+ });
106
+ } catch {
107
+ }
108
+ return result;
109
+ }
110
+ }
111
+ }
112
+ throw new Error("Cortex capability loaded but export function not found. Use direct loadScript() instead.");
113
+ }
114
+ var res = await authFetch2("/v1/capabilities/" + encodeURIComponent(id) + "/invoke" + (mode === "raw" ? "?mode=raw" : ""), {
115
+ method: "POST",
116
+ body: JSON.stringify({ input: input || {} })
117
+ });
118
+ if (!res.ok) throw new Error(res.error?.message || "Invoke failed");
119
+ return res.data.result !== void 0 ? res.data.result : res.data;
120
+ },
121
+ // ── Management ──
122
+ async create(record) {
123
+ var res = await authFetch2("/v1/capabilities", {
124
+ method: "POST",
125
+ body: JSON.stringify(record)
126
+ });
127
+ if (!res.ok) throw new Error(res.error?.message || "Failed to create capability");
128
+ return res.data;
129
+ },
130
+ async update(id, updates) {
131
+ var res = await authFetch2("/v1/capabilities/" + encodeURIComponent(id), {
132
+ method: "PUT",
133
+ body: JSON.stringify(updates)
134
+ });
135
+ if (!res.ok) throw new Error(res.error?.message || "Failed to update capability");
136
+ return res.data;
137
+ },
138
+ async delete(id) {
139
+ var res = await authFetch2("/v1/capabilities/" + encodeURIComponent(id), {
140
+ method: "DELETE"
141
+ });
142
+ if (!res.ok) throw new Error(res.error?.message || "Failed to delete capability");
143
+ return res.data;
144
+ },
145
+ async mine() {
146
+ var session = getSession2();
147
+ return capabilities.list({ owner: session.ghii || session.owner });
148
+ },
149
+ // ── Testing ──
150
+ async test(id, input) {
151
+ var res = await authFetch2("/v1/capabilities/" + encodeURIComponent(id) + "/test", {
152
+ method: "POST",
153
+ body: JSON.stringify({ input: input || {} })
154
+ });
155
+ if (!res.ok) throw new Error(res.error?.message || "Test failed");
156
+ return res.data;
157
+ },
158
+ // ── Vouching ──
159
+ async vouch(id, comment) {
160
+ var body = comment ? { comment } : {};
161
+ var res = await authFetch2("/v1/capabilities/" + encodeURIComponent(id) + "/vouch", {
162
+ method: "POST",
163
+ body: JSON.stringify(body)
164
+ });
165
+ if (!res.ok) throw new Error(res.error?.message || "Vouch failed");
166
+ return res.data;
167
+ },
168
+ async unvouch(id) {
169
+ var res = await authFetch2("/v1/capabilities/" + encodeURIComponent(id) + "/vouch", {
170
+ method: "DELETE"
171
+ });
172
+ if (!res.ok) throw new Error(res.error?.message || "Unvouch failed");
173
+ return res.data;
174
+ }
175
+ };
176
+ attach("capabilities", capabilities);
177
+ })();
@@ -0,0 +1,265 @@
1
+ // GENERATED FILE — do not edit directly. Source: src/static/sdk-libs/commerce/ (+ _core/).
2
+ // Rebuild: pnpm build:sdk · Served at /v1/libs/aimeat-commerce.js (with a per-node config prelude).
3
+ "use strict";
4
+ (() => {
5
+ // src/static/sdk-libs/_core/config.js
6
+ function cfg() {
7
+ return window.__AIMEAT_SDK_CFG__ || { nodeId: "", baseUrl: "" };
8
+ }
9
+ function resolveNodeUrl() {
10
+ const meta = document.querySelector('meta[name="aimeat-node"]');
11
+ if (meta) return (meta.getAttribute("content") || "").replace(/\/$/, "");
12
+ if (location.protocol === "http:" || location.protocol === "https:") return location.origin;
13
+ return cfg().baseUrl;
14
+ }
15
+ var NODE_URL = resolveNodeUrl();
16
+ var APEX_URL = cfg().baseUrl;
17
+ var NODE_ID = cfg().nodeId;
18
+ var HEARTBEAT_MS = cfg().heartbeatMs || 3e4;
19
+
20
+ // src/static/sdk-libs/_core/session.js
21
+ function getSession(libLabel) {
22
+ const auth = window.AIMEAT && window.AIMEAT.auth;
23
+ if (!auth) {
24
+ throw new Error("AIMEAT.auth is required. Include aimeat-auth.js before " + (libLabel || "this library"));
25
+ }
26
+ const s = auth.getSession();
27
+ if (!s) throw new Error("Not logged in. Call AIMEAT.auth.login() first.");
28
+ return s;
29
+ }
30
+ function authFetch(path, opts, libLabel) {
31
+ return getSession(libLabel).fetch(path, opts);
32
+ }
33
+ function makeSession(libLabel) {
34
+ return {
35
+ getSession: () => getSession(libLabel),
36
+ authFetch: (path, opts) => authFetch(path, opts, libLabel)
37
+ };
38
+ }
39
+
40
+ // src/static/sdk-libs/_core/namespace.js
41
+ function namespace() {
42
+ if (!window.AIMEAT) window.AIMEAT = {};
43
+ return window.AIMEAT;
44
+ }
45
+ function attach(key, value) {
46
+ const ns = namespace();
47
+ ns[key] = value;
48
+ return ns;
49
+ }
50
+
51
+ // src/static/sdk-libs/commerce/index.js
52
+ var { authFetch: authFetch2 } = makeSession("aimeat-commerce.js");
53
+ var NODE_URL2 = APEX_URL;
54
+ var MONEY_UNIT = 1e6;
55
+ function commerceError(res, fallback) {
56
+ const e = (
57
+ /** @type {Error & { code?: string, paymentRequired?: boolean, accepts?: unknown, x402Version?: unknown }} */
58
+ new Error(res.error && res.error.message || fallback)
59
+ );
60
+ e.code = res.error && res.error.code;
61
+ if (res.accepts) {
62
+ e.paymentRequired = true;
63
+ e.accepts = res.accepts;
64
+ e.x402Version = res.x402Version;
65
+ }
66
+ return e;
67
+ }
68
+ function normalizeItems(items) {
69
+ const arr = Array.isArray(items) ? items : [items];
70
+ return arr.map(function(i) {
71
+ const out = (
72
+ /** @type {Record<string, any>} */
73
+ { offer_id: i.offer_id || i.offerId }
74
+ );
75
+ if (i.kind) out.kind = i.kind;
76
+ if (i.agent) out.agent = i.agent;
77
+ if (i.org) out.org = i.org;
78
+ if (i.app) out.app = i.app;
79
+ if (i.tool) out.tool = i.tool;
80
+ if (i.input) out.input = i.input;
81
+ if (i.quantity) out.quantity = i.quantity;
82
+ return out;
83
+ });
84
+ }
85
+ var commerce = {
86
+ MONEY_UNIT,
87
+ // ── Money formatting (same convention as the portal's utils.js fmtMoney) ──
88
+ /** Format money micro-units as "1.50 EUR" / "0.002 USD" (≥2 decimals, up to 6 when sub-cent). */
89
+ fmtMoney(micros, currency) {
90
+ const s = ((Number(micros) || 0) / MONEY_UNIT).toFixed(6).replace(/(\.\d{2}\d*?)0+$/, "$1");
91
+ return currency ? s + " " + currency : s;
92
+ },
93
+ /** Format any session/offer amount currency-aware: morsels are integers, money is micro-units. */
94
+ fmtAmount(amount, currency) {
95
+ if (!currency || currency === "morsel" || currency === "MORSEL") {
96
+ return (Number(amount) || 0) + " morsels";
97
+ }
98
+ return commerce.fmtMoney(amount, currency);
99
+ },
100
+ /** Parse a major-unit input ("1.50", "0,002") into integer money micro-units; null if not positive. */
101
+ microsFromInput(str) {
102
+ const n = parseFloat(String(str).replace(",", "."));
103
+ if (!Number.isFinite(n) || n <= 0) return null;
104
+ return Math.round(n * MONEY_UNIT);
105
+ },
106
+ // ── Offer discovery + price reading ──
107
+ /** Public product feed: every PUBLIC, priced agent offer on the node (no login needed). */
108
+ async feed() {
109
+ const r = await fetch(NODE_URL2 + "/v1/commerce/feed");
110
+ const res = await r.json();
111
+ if (res.error) throw commerceError(res, "Failed to read the commerce feed");
112
+ return res;
113
+ },
114
+ /** Read one offer (with price/priceMoney) from an agent's published offers. */
115
+ async getOffer(agent, offerId) {
116
+ const res = await authFetch2("/v1/agents/" + encodeURIComponent(agent) + "/offers");
117
+ if (!res.ok) throw commerceError(res, "Failed to read offers");
118
+ const offers = res.data && res.data.offers || [];
119
+ return offers.find(function(o) {
120
+ return o.id === offerId;
121
+ }) || null;
122
+ },
123
+ /**
124
+ * The price of an offer or app-tool entry in one currency.
125
+ * → { amount, currency, formatted } or null when it has no price in that currency.
126
+ * currency omitted/'morsel' → price.morsels; 'EUR'/'USD' → priceMoney micro-units.
127
+ */
128
+ priceOf(offer, currency) {
129
+ if (!offer) return null;
130
+ if (!currency || currency === "morsel") {
131
+ const m = offer.price && Number(offer.price.morsels);
132
+ if (!m || m <= 0) return null;
133
+ return { amount: m, currency: "morsel", formatted: commerce.fmtAmount(m, "morsel") };
134
+ }
135
+ const pm = offer.priceMoney;
136
+ if (!pm || pm.currency !== currency) return null;
137
+ return { amount: pm.amount, currency, formatted: commerce.fmtMoney(pm.amount, currency) };
138
+ },
139
+ // ── Checkout sessions (/v1/commerce/checkout-sessions) ──
140
+ /**
141
+ * Open a checkout session. items: [{ agent, offer_id, quantity? }] (kind defaults to 'offer').
142
+ * opts: { note?, currency? } — currency 'EUR'/'USD' needs a money price + a settling handler.
143
+ */
144
+ async openCheckout(items, opts) {
145
+ const body = (
146
+ /** @type {Record<string, any>} */
147
+ { items: normalizeItems(items) }
148
+ );
149
+ if (opts && opts.note) body.note = opts.note;
150
+ if (opts && opts.currency) body.currency = opts.currency;
151
+ const res = await authFetch2("/v1/commerce/checkout-sessions", {
152
+ method: "POST",
153
+ body: JSON.stringify(body)
154
+ });
155
+ if (!res.ok) throw commerceError(res, "Failed to open checkout");
156
+ return res.data.session;
157
+ },
158
+ /** Read one of the buyer's checkout sessions. */
159
+ async getCheckout(id) {
160
+ const res = await authFetch2("/v1/commerce/checkout-sessions/" + encodeURIComponent(id));
161
+ if (!res.ok) throw commerceError(res, "Failed to read checkout");
162
+ return res.data.session;
163
+ },
164
+ /** The buyer's checkout sessions (purchases), newest first. */
165
+ async listCheckouts(opts) {
166
+ const qs = opts && opts.limit ? "?limit=" + opts.limit : "";
167
+ const res = await authFetch2("/v1/commerce/checkout-sessions" + qs);
168
+ if (!res.ok) throw commerceError(res, "Failed to list checkouts");
169
+ return res.data.sessions;
170
+ },
171
+ /** Replace the cart of an open session. */
172
+ async updateCheckout(id, items) {
173
+ const res = await authFetch2("/v1/commerce/checkout-sessions/" + encodeURIComponent(id), {
174
+ method: "PATCH",
175
+ body: JSON.stringify({ items: normalizeItems(items) })
176
+ });
177
+ if (!res.ok) throw commerceError(res, "Failed to update checkout");
178
+ return res.data.session;
179
+ },
180
+ /** Cancel an open session. */
181
+ async cancelCheckout(id) {
182
+ const res = await authFetch2("/v1/commerce/checkout-sessions/" + encodeURIComponent(id), {
183
+ method: "PATCH",
184
+ body: JSON.stringify({ cancel: true })
185
+ });
186
+ if (!res.ok) throw commerceError(res, "Failed to cancel checkout");
187
+ return res.data.session;
188
+ },
189
+ /**
190
+ * Complete (pay + fulfill) a session. payment: { handler?, instrument? } — omit for the
191
+ * node default (morsels). On 402 the thrown error has err.paymentRequired + err.accepts.
192
+ * Returns the completed session: session.receipt { handler, charged, fee }, session.fulfillment.
193
+ */
194
+ async completeCheckout(id, payment) {
195
+ const res = await authFetch2("/v1/commerce/checkout-sessions/" + encodeURIComponent(id) + "/complete", {
196
+ method: "POST",
197
+ body: JSON.stringify(payment ? { payment } : {})
198
+ });
199
+ if (!res.ok) throw commerceError(res, "Failed to complete checkout");
200
+ return res.data.session;
201
+ },
202
+ /** One-call purchase: open a session for one offer and complete it immediately. */
203
+ async buyOffer(agent, offerId, opts) {
204
+ const session = await commerce.openCheckout(
205
+ [{ agent, offer_id: offerId, quantity: opts && opts.quantity || 1 }],
206
+ opts
207
+ );
208
+ return commerce.completeCheckout(session.id, opts && opts.payment);
209
+ },
210
+ /** The seller's received orders (completed sessions where you are the seller). */
211
+ async listOrders(opts) {
212
+ const qs = opts && opts.limit ? "?limit=" + opts.limit : "";
213
+ const res = await authFetch2("/v1/commerce/orders" + qs);
214
+ if (!res.ok) throw commerceError(res, "Failed to list orders");
215
+ return res.data.orders;
216
+ },
217
+ // ── App tools (TARGET-034 — priced tool calls on agent-faced apps) ──
218
+ /**
219
+ * Read an app's declared tool manifest: the public memory record apps.{appId}.tools under the
220
+ * app owner's GHII — { tools: [{ name, description, inputSchema, action_id?, agent?, price?, priceMoney? }] }.
221
+ * Returns null when the app declares no tools. Works logged out (public read).
222
+ */
223
+ async getAppTools(ownerGhii, appId) {
224
+ const url = NODE_URL2 + "/v1/memory/" + encodeURIComponent(ownerGhii) + "/" + encodeURIComponent("apps." + appId + ".tools");
225
+ const r = await fetch(url);
226
+ const res = await r.json();
227
+ if (!res.ok) {
228
+ if (res.error && res.error.code === "NOT_FOUND") return null;
229
+ throw commerceError(res, "Failed to read app tools");
230
+ }
231
+ return res.data.value;
232
+ },
233
+ /**
234
+ * Buy + invoke a priced app-tool through the checkout core (TARGET-034):
235
+ * one { kind:'app-tool', app:'ownerName/appId', tool, input } line item, opened and
236
+ * completed in one call. A tool bound to a capability (action_id) runs with your input and
237
+ * the result comes back on session.fulfillment.results[0].result; an unbound tool queues an
238
+ * agent TASK for the app owner instead — session.fulfillment.taskIds[0] (the deliverable
239
+ * arrives via the seller's task flow). The receipt shows the charge either way.
240
+ * One call per invocation. On a node without the resolver this throws
241
+ * with code 'APP_TOOL_NOT_AVAILABLE'.
242
+ */
243
+ async invokeAppTool(ref, opts) {
244
+ try {
245
+ const session = await commerce.openCheckout(
246
+ [{ kind: "app-tool", app: ref.app, tool: ref.tool, input: ref.input }],
247
+ opts
248
+ );
249
+ return commerce.completeCheckout(session.id, opts && opts.payment);
250
+ } catch (e) {
251
+ if (e.code === "UNKNOWN_ITEM_KIND" || e.code === "INVALID_CHECKOUT" && /invalid enum|"kind"/i.test(String(e.message))) {
252
+ const err = (
253
+ /** @type {Error & { code?: string, cause?: unknown }} */
254
+ new Error("This node does not sell app-tools (app-tool resolver not enabled)")
255
+ );
256
+ err.code = "APP_TOOL_NOT_AVAILABLE";
257
+ err.cause = e;
258
+ throw err;
259
+ }
260
+ throw e;
261
+ }
262
+ }
263
+ };
264
+ attach("commerce", commerce);
265
+ })();
@@ -0,0 +1,205 @@
1
+ // GENERATED FILE — do not edit directly. Source: src/static/sdk-libs/data/ (+ _core/).
2
+ // Rebuild: pnpm build:sdk · Served at /v1/libs/aimeat-data.js (with a per-node config prelude).
3
+ "use strict";
4
+ (() => {
5
+ // src/static/sdk-libs/_core/config.js
6
+ function cfg() {
7
+ return window.__AIMEAT_SDK_CFG__ || { nodeId: "", baseUrl: "" };
8
+ }
9
+ function resolveNodeUrl() {
10
+ const meta = document.querySelector('meta[name="aimeat-node"]');
11
+ if (meta) return (meta.getAttribute("content") || "").replace(/\/$/, "");
12
+ if (location.protocol === "http:" || location.protocol === "https:") return location.origin;
13
+ return cfg().baseUrl;
14
+ }
15
+ var NODE_URL = resolveNodeUrl();
16
+ var APEX_URL = cfg().baseUrl;
17
+ var NODE_ID = cfg().nodeId;
18
+ var HEARTBEAT_MS = cfg().heartbeatMs || 3e4;
19
+
20
+ // src/static/sdk-libs/_core/session.js
21
+ function getSession(libLabel) {
22
+ const auth = window.AIMEAT && window.AIMEAT.auth;
23
+ if (!auth) {
24
+ throw new Error("AIMEAT.auth is required. Include aimeat-auth.js before " + (libLabel || "this library"));
25
+ }
26
+ const s = auth.getSession();
27
+ if (!s) throw new Error("Not logged in. Call AIMEAT.auth.login() first.");
28
+ return s;
29
+ }
30
+ function authFetch(path, opts, libLabel) {
31
+ return getSession(libLabel).fetch(path, opts);
32
+ }
33
+ function makeSession(libLabel) {
34
+ return {
35
+ getSession: () => getSession(libLabel),
36
+ authFetch: (path, opts) => authFetch(path, opts, libLabel)
37
+ };
38
+ }
39
+
40
+ // src/static/sdk-libs/_core/namespace.js
41
+ function namespace() {
42
+ if (!window.AIMEAT) window.AIMEAT = {};
43
+ return window.AIMEAT;
44
+ }
45
+ function attach(key, value) {
46
+ const ns = namespace();
47
+ ns[key] = value;
48
+ return ns;
49
+ }
50
+
51
+ // src/static/sdk-libs/data/index.js
52
+ var { authFetch: authFetch2 } = makeSession("aimeat-data.js");
53
+ var data = {
54
+ // Write or upsert a memory entry
55
+ async set(key, value, opts) {
56
+ const body = { key, value, visibility: "private", ...opts };
57
+ const res = await authFetch2("/v1/memory", { method: "POST", body: JSON.stringify(body) });
58
+ if (!res.ok) throw new Error(res.error?.message || "Failed to set memory");
59
+ return res.data;
60
+ },
61
+ // Read a single entry (falls back to public read from app creator if not found or empty).
62
+ // Uses ?soft=1 so a missing key is a clean 200 (value null) — no browser-console 404 noise;
63
+ // the contract is unchanged: resolves null when the key does not exist.
64
+ async get(key) {
65
+ const res = await authFetch2("/v1/memory/" + encodeURIComponent(key) + "?soft=1");
66
+ var val = res.ok ? res.data.value : null;
67
+ var isEmpty = val == null || typeof val === "object" && Object.keys(val).length === 0;
68
+ if (!isEmpty) return val;
69
+ var creator = document.querySelector('meta[name="aimeat-creator"]')?.getAttribute("content");
70
+ if (!creator) {
71
+ var m = location.pathname.match(/\/v1\/apps\/([^/]+)\//);
72
+ if (m) {
73
+ creator = decodeURIComponent(m[1]);
74
+ if (creator && !creator.includes("@")) creator = creator + "@" + NODE_ID;
75
+ }
76
+ }
77
+ if (creator) {
78
+ try {
79
+ var pub = await data.getPublic(creator, key);
80
+ if (pub != null) return pub;
81
+ } catch {
82
+ }
83
+ }
84
+ return val;
85
+ },
86
+ // Read full entry metadata
87
+ async getEntry(key) {
88
+ const res = await authFetch2("/v1/memory/" + encodeURIComponent(key));
89
+ if (!res.ok) {
90
+ if (res.error?.code === "NOT_FOUND") return null;
91
+ throw new Error(res.error?.message || "Failed to get memory");
92
+ }
93
+ return res.data;
94
+ },
95
+ // Update with optimistic locking
96
+ async update(key, value, version, opts) {
97
+ const body = { value, version, ...opts };
98
+ const res = await authFetch2("/v1/memory/" + encodeURIComponent(key), {
99
+ method: "PUT",
100
+ body: JSON.stringify(body)
101
+ });
102
+ if (!res.ok) throw new Error(res.error?.message || "Failed to update memory");
103
+ return res.data;
104
+ },
105
+ // Delete an entry
106
+ async delete(key) {
107
+ const res = await authFetch2("/v1/memory/" + encodeURIComponent(key), { method: "DELETE" });
108
+ if (!res.ok) throw new Error(res.error?.message || "Failed to delete memory");
109
+ return res.data;
110
+ },
111
+ // List all memory keys
112
+ async list(opts) {
113
+ const params = new URLSearchParams();
114
+ if (opts?.prefix) params.set("prefix", opts.prefix);
115
+ if (opts?.visibility) params.set("visibility", opts.visibility);
116
+ if (opts?.tags) params.set("tags", opts.tags.join(","));
117
+ const qs = params.toString();
118
+ const res = await authFetch2("/v1/memory" + (qs ? "?" + qs : ""));
119
+ if (!res.ok) throw new Error(res.error?.message || "Failed to list memory");
120
+ return res.data;
121
+ },
122
+ // Search memory entries
123
+ async search(query, opts) {
124
+ const params = new URLSearchParams({ q: query });
125
+ if (opts?.visibility) params.set("visibility", opts.visibility);
126
+ const res = await authFetch2("/v1/memory/search?" + params.toString());
127
+ if (!res.ok) throw new Error(res.error?.message || "Failed to search memory");
128
+ return res.data;
129
+ },
130
+ // Read another agent's public memory (no auth needed). ?soft=1: missing (or hidden)
131
+ // keys resolve null via a clean 200 instead of logging a console 404.
132
+ async getPublic(gaii, key) {
133
+ const url = NODE_URL + "/v1/memory/" + encodeURIComponent(gaii) + "/" + encodeURIComponent(key) + "?soft=1";
134
+ const r = await fetch(url);
135
+ const res = await r.json();
136
+ if (!res.ok) {
137
+ if (res.error?.code === "NOT_FOUND") return null;
138
+ throw new Error(res.error?.message || "Failed to read public memory");
139
+ }
140
+ return res.data.value;
141
+ },
142
+ // ── Micro-Memory (Tier 0.5, GET-based) ──
143
+ micro(setName, accessCode) {
144
+ const base = NODE_URL + "/v1/mm";
145
+ function mmUrl(params) {
146
+ const p = new URLSearchParams(params);
147
+ if (accessCode) p.set("access_code", accessCode);
148
+ return base + "?" + p.toString();
149
+ }
150
+ async function mmFetch(params) {
151
+ const r = await fetch(mmUrl(params));
152
+ const res = await r.json();
153
+ if (!res.ok) throw new Error(res.error?.message || "Micro-memory operation failed");
154
+ return res.data;
155
+ }
156
+ return {
157
+ // Add or overwrite a key
158
+ async add(key, value) {
159
+ return mmFetch({ op: "add", set: setName, key, value: typeof value === "object" ? JSON.stringify(value) : String(value) });
160
+ },
161
+ // Modify existing key
162
+ async mod(key, value) {
163
+ return mmFetch({ op: "mod", set: setName, key, value: typeof value === "object" ? JSON.stringify(value) : String(value) });
164
+ },
165
+ // Delete a key
166
+ async del(key) {
167
+ return mmFetch({ op: "del", set: setName, key });
168
+ },
169
+ // List all entries in this set
170
+ async list() {
171
+ return mmFetch({ op: "list", set: setName });
172
+ },
173
+ // Batch add multiple key-value pairs
174
+ async batch(entries) {
175
+ const params = { op: "batch", set: setName };
176
+ Object.keys(entries).forEach((k, i) => {
177
+ params["key" + i] = k;
178
+ const v = entries[k];
179
+ params["value" + i] = typeof v === "object" ? JSON.stringify(v) : String(v);
180
+ });
181
+ return mmFetch(params);
182
+ },
183
+ // Configure visibility
184
+ async config(visibility) {
185
+ const params = { op: "config", set: setName, access: visibility };
186
+ return mmFetch(params);
187
+ },
188
+ // Get a single key value
189
+ async get(key) {
190
+ const d = await mmFetch({ op: "list", set: setName });
191
+ return d.entries?.[key] ?? null;
192
+ }
193
+ };
194
+ },
195
+ // List all micro-memory sets
196
+ async microSets() {
197
+ const url = NODE_URL + "/v1/mm?op=list";
198
+ const r = await fetch(url);
199
+ const res = await r.json();
200
+ if (!res.ok) throw new Error(res.error?.message || "Failed to list micro-memory sets");
201
+ return res.data;
202
+ }
203
+ };
204
+ attach("data", data);
205
+ })();