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,394 @@
1
+ // GENERATED FILE — do not edit directly. Source: src/static/sdk-libs/organism/ (+ _core/).
2
+ // Rebuild: pnpm build:sdk · Served at /v1/libs/aimeat-organism.js (with a per-node config prelude).
3
+ "use strict";
4
+ (() => {
5
+ // src/static/sdk-libs/_core/namespace.js
6
+ function namespace() {
7
+ if (!window.AIMEAT) window.AIMEAT = {};
8
+ return window.AIMEAT;
9
+ }
10
+ function attach(key, value) {
11
+ const ns = namespace();
12
+ ns[key] = value;
13
+ return ns;
14
+ }
15
+
16
+ // src/static/sdk-libs/organism/index.js
17
+ function getSession() {
18
+ if (!window.AIMEAT || !window.AIMEAT.auth) {
19
+ throw new Error("AIMEAT.auth is required. Include aimeat-auth.js before aimeat-organism.js");
20
+ }
21
+ var s = window.AIMEAT.auth.getSession();
22
+ if (!s) throw new Error("Not logged in. Call AIMEAT.auth.login() first.");
23
+ return s;
24
+ }
25
+ async function authFetch(path, opts) {
26
+ var res = await getSession().fetch(path, opts);
27
+ if (res && typeof res.json === "function") res = await res.json();
28
+ return res;
29
+ }
30
+ function fail(res, fallback) {
31
+ var e = (
32
+ /** @type {Error & { code?: string, envelope?: unknown }} */
33
+ new Error(res && res.error && (res.error.message || res.error.code) || fallback)
34
+ );
35
+ e.code = res && res.error && res.error.code;
36
+ e.envelope = res;
37
+ return e;
38
+ }
39
+ var TITLE_FIELDS = ["title", "name", "subject", "label"];
40
+ var BODY_FIELDS = ["content", "body", "markdown", "text", "md", "description", "summary"];
41
+ function pickField(obj, names) {
42
+ if (!obj || typeof obj !== "object") return null;
43
+ for (var i = 0; i < names.length; i++) if (typeof obj[names[i]] === "string") return names[i];
44
+ return null;
45
+ }
46
+ function isMetaField(k) {
47
+ return typeof k === "string" && k.charAt(0) === "_";
48
+ }
49
+ function stripMeta(v) {
50
+ if (!v || typeof v !== "object" || Array.isArray(v)) return v;
51
+ var out = {};
52
+ Object.keys(v).forEach(function(k) {
53
+ if (!isMetaField(k)) out[k] = v[k];
54
+ });
55
+ return out;
56
+ }
57
+ function slugify(s) {
58
+ return String(s || "untitled").toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40) || "untitled";
59
+ }
60
+ function titleOf(value, fallbackId) {
61
+ var v = value || {};
62
+ var f = pickField(v, TITLE_FIELDS);
63
+ if (f && v[f]) return v[f];
64
+ if (typeof v.id === "string" && v.id) return v.id;
65
+ var bf = pickField(v, BODY_FIELDS);
66
+ if (bf && typeof v[bf] === "string" && v[bf]) return String(v[bf]).replace(/\s+/g, " ").slice(0, 48);
67
+ return fallbackId || "Untitled";
68
+ }
69
+ function bodyFieldOf(value) {
70
+ return pickField(value, BODY_FIELDS);
71
+ }
72
+ function isDocLike(value) {
73
+ var bf = bodyFieldOf(value);
74
+ if (!bf || !value || typeof value[bf] !== "string") return false;
75
+ return bf === "markdown" || bf === "content" || value[bf].length > 120 || /\n/.test(value[bf]);
76
+ }
77
+ function valueUpdatedAt(v) {
78
+ if (v && typeof v === "object" && (v._updatedAt || v._createdAt)) {
79
+ var t = new Date(v._updatedAt || v._createdAt).getTime();
80
+ return isNaN(t) ? 0 : t;
81
+ }
82
+ return 0;
83
+ }
84
+ function wsRoot(orgId, wsId) {
85
+ return "organism." + orgId + (wsId ? ".w." + wsId : "");
86
+ }
87
+ function draftKey(orgId, wsId, namespace2, id) {
88
+ return wsRoot(orgId, wsId) + "." + namespace2 + "." + id + ".draft";
89
+ }
90
+ function normalizeWorkspace(data) {
91
+ var manifest = data && data.manifest || null;
92
+ var otList = manifest && (manifest.objectTypes || manifest.object_types || manifest.types) || [];
93
+ if (!Array.isArray(otList) && otList && typeof otList === "object") {
94
+ otList = Object.keys(otList).map(function(k) {
95
+ var o = otList[k];
96
+ o = o && typeof o === "object" ? o : {};
97
+ if (!o.name) o.name = k;
98
+ return o;
99
+ });
100
+ }
101
+ var byName = {};
102
+ otList.forEach(function(ot) {
103
+ var n = ot.name || ot.id || ot.type;
104
+ if (n) byName[n] = ot;
105
+ });
106
+ var objects = data && data.objects || {};
107
+ var draftsMap = data && data.drafts || {};
108
+ var typeNames = [];
109
+ otList.forEach(function(ot) {
110
+ var n = ot.name || ot.id || ot.type;
111
+ if (n && typeNames.indexOf(n) < 0) typeNames.push(n);
112
+ });
113
+ Object.keys(objects).forEach(function(n) {
114
+ if (typeNames.indexOf(n) < 0) typeNames.push(n);
115
+ });
116
+ Object.keys(draftsMap).forEach(function(n) {
117
+ if (typeNames.indexOf(n) < 0) typeNames.push(n);
118
+ });
119
+ return typeNames.map(function(typeName) {
120
+ var ot = byName[typeName] || {};
121
+ var instances = {};
122
+ var order = [];
123
+ var seq = 0;
124
+ function instIdOf(v) {
125
+ if (v && typeof v === "object" && typeof v.id === "string" && v.id) return { id: v.id, real: true };
126
+ if (v && typeof v === "object") {
127
+ var tf = pickField(v, TITLE_FIELDS);
128
+ if (tf && v[tf]) return { id: "t-" + slugify(v[tf]), real: false };
129
+ }
130
+ return { id: "item-" + seq++, real: false };
131
+ }
132
+ function add(v, slot) {
133
+ if (v == null) return;
134
+ var m = instIdOf(v);
135
+ if (!instances[m.id]) {
136
+ instances[m.id] = { id: m.id, hasRealId: m.real, draft: null, latest: null };
137
+ order.push(m.id);
138
+ }
139
+ if (slot === "draft") instances[m.id].draft = v;
140
+ else instances[m.id].latest = instances[m.id].latest || v;
141
+ }
142
+ var pub = objects[typeName] || [];
143
+ if (!Array.isArray(pub)) pub = [pub];
144
+ pub.forEach(function(v) {
145
+ add(v, "latest");
146
+ });
147
+ var dr = draftsMap[typeName] || [];
148
+ if (!Array.isArray(dr)) dr = [dr];
149
+ dr.forEach(function(v) {
150
+ add(v, "draft");
151
+ });
152
+ var items = order.map(function(id) {
153
+ var inst = instances[id];
154
+ var best = inst.draft || inst.latest;
155
+ inst.value = best;
156
+ inst.title = titleOf(best, id);
157
+ inst.updatedAt = Math.max(valueUpdatedAt(inst.draft), valueUpdatedAt(inst.latest));
158
+ inst.status = inst.draft && inst.latest ? "draft+published" : inst.draft ? "draft" : "published";
159
+ return inst;
160
+ });
161
+ return {
162
+ name: typeName,
163
+ namespace: ot.namespace || ot.ns || typeName,
164
+ kind: ot.kind || ot.type || null,
165
+ schemaRef: ot.schemaRef || null,
166
+ writeRole: ot.writeRole || null,
167
+ items
168
+ };
169
+ });
170
+ }
171
+ function readmeText(readme) {
172
+ if (readme == null) return "";
173
+ if (typeof readme === "string") return readme;
174
+ if (typeof readme === "object") return readme.content || readme.text || readme.markdown || JSON.stringify(readme, null, 2);
175
+ return String(readme);
176
+ }
177
+ var organism = {
178
+ // List organisms the signed-in owner is a member of.
179
+ async list() {
180
+ var s = getSession();
181
+ var owner = s.owner || s.user && s.user.owner || "";
182
+ var res;
183
+ try {
184
+ res = await authFetch("/v1/organisms?member=" + encodeURIComponent(owner) + "&per_page=100");
185
+ } catch {
186
+ res = null;
187
+ }
188
+ if (!res || res.ok === false) res = await authFetch("/v1/organisms");
189
+ if (res.ok === false) throw fail(res, "Failed to list organisms");
190
+ var d = res.data !== void 0 ? res.data : res;
191
+ return d && (d.organisms || d.items) || (Array.isArray(d) ? d : []);
192
+ },
193
+ async get(orgId) {
194
+ var res = await authFetch("/v1/organisms/" + encodeURIComponent(orgId));
195
+ if (res.ok === false) throw fail(res, "Failed to load organism");
196
+ return res.data !== void 0 ? res.data : res;
197
+ },
198
+ // Create a NEW organism (the signed-in owner becomes creator/member). Needs the organism:write app
199
+ // scope (declare it in <meta name="aimeat-scopes">). Returns { id, name, ... }. Use this + createWorkspace
200
+ // to let a multi-tenant app provision its own data space for each user on first use.
201
+ async create(name, opts) {
202
+ opts = opts || {};
203
+ var res = await authFetch("/v1/organisms", {
204
+ method: "POST",
205
+ headers: { "Content-Type": "application/json" },
206
+ body: JSON.stringify({
207
+ name,
208
+ type: opts.type || "project",
209
+ visibility: opts.visibility || "private",
210
+ join_policy: opts.join_policy || "invite_only",
211
+ description: opts.description
212
+ })
213
+ });
214
+ if (res.ok === false) throw fail(res, "Failed to create organism");
215
+ var d = res.data !== void 0 ? res.data : res;
216
+ return d && d.organism ? d.organism : d;
217
+ },
218
+ // Create a NEW schema-locked workspace inside an organism from a manifest + per-namespace JSON schemas.
219
+ // manifest = { manifestVersion:'1', name, kind, objectTypes:[{ name, namespace, mode:'records',
220
+ // backing:'memory', writeRole:'member', schemaRef? }] }; schemas = { '<namespace>': <JSON Schema> }.
221
+ // Needs organism:write. Returns { ws, types, schemas_locked }.
222
+ async createWorkspace(orgId, name, manifest, schemas, readme) {
223
+ var m = manifest && typeof manifest === "object" ? JSON.parse(JSON.stringify(manifest)) : manifest;
224
+ var sc = schemas && typeof schemas === "object" ? Object.assign({}, schemas) : {};
225
+ if (m && Array.isArray(m.objectTypes)) {
226
+ for (var oi = 0; oi < m.objectTypes.length; oi++) {
227
+ var ot = m.objectTypes[oi];
228
+ if (ot && !ot.schemaRef) {
229
+ var slug = String(ot.name || "type" + oi).replace(/[^a-zA-Z0-9_-]/g, "-");
230
+ ot.schemaRef = "schema:" + name + "-" + slug + "@1";
231
+ }
232
+ if (ot && ot.namespace && sc[ot.namespace] === void 0 && (ot.mode || "records") === "records") {
233
+ sc[ot.namespace] = { type: "object", additionalProperties: true };
234
+ }
235
+ }
236
+ }
237
+ var res = await authFetch("/v1/organisms/" + encodeURIComponent(orgId) + "/workspaces", {
238
+ method: "POST",
239
+ headers: { "Content-Type": "application/json" },
240
+ body: JSON.stringify({ name, manifest: m, schemas: sc, readme })
241
+ });
242
+ if (res.ok === false) throw fail(res, "Failed to create workspace");
243
+ return res.data !== void 0 ? res.data : res;
244
+ },
245
+ // List workspaces (access + enrichment counts included).
246
+ async workspaces(orgId) {
247
+ var res = await authFetch("/v1/organisms/" + encodeURIComponent(orgId) + "/workspaces?include=enrichment");
248
+ if (res.ok === false) throw fail(res, "Failed to list workspaces");
249
+ var d = res.data !== void 0 ? res.data : res;
250
+ return d && (d.workspaces || d.items) || (Array.isArray(d) ? d : []);
251
+ },
252
+ // Read one workspace, normalized: { manifest, readme, readmeText, spaces, raw }.
253
+ // spaces[].items[]: { id, hasRealId, draft, latest, value, title, updatedAt, status }.
254
+ async read(orgId, wsId) {
255
+ var q = wsId ? "?ws=" + encodeURIComponent(wsId) : "";
256
+ var res = await authFetch("/v1/organisms/" + encodeURIComponent(orgId) + "/workspace" + q);
257
+ if (res.ok === false) throw fail(res, "Failed to read workspace");
258
+ var d = res.data !== void 0 ? res.data : res;
259
+ return {
260
+ manifest: d && d.manifest || null,
261
+ readme: d && d.readme || null,
262
+ readmeText: readmeText(d && d.readme),
263
+ spaces: normalizeWorkspace(d),
264
+ raw: d
265
+ };
266
+ },
267
+ // Write/overwrite an object's draft. Embeds the instance id into the value (SPA convention)
268
+ // unless opts.embedId === false (needed for locked schemas that reject an id property).
269
+ async writeDraft(orgId, wsId, namespace2, id, value, opts) {
270
+ opts = opts || {};
271
+ var v = stripMeta(value);
272
+ if (opts.embedId !== false && v && typeof v === "object" && !Array.isArray(v)) {
273
+ v = Object.assign({}, v, { id });
274
+ }
275
+ var body = (
276
+ /** @type {Record<string, any>} */
277
+ { key: draftKey(orgId, wsId, namespace2, id), value: v, visibility: opts.visibility || "private" }
278
+ );
279
+ if (opts.group_id) body.group_id = opts.group_id;
280
+ if (Array.isArray(opts.tags) && opts.tags.length) body.tags = opts.tags;
281
+ var res = await authFetch("/v1/memory", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) });
282
+ if (res.ok === false) throw fail(res, "Failed to save draft");
283
+ return res.data !== void 0 ? res.data : res;
284
+ },
285
+ // Publish a draft -> new .version.N + .latest (or a pending approval when the workspace gates publishes).
286
+ async publish(orgId, wsId, namespace2, id) {
287
+ var res = await authFetch("/v1/organisms/" + encodeURIComponent(orgId) + "/publish", {
288
+ method: "POST",
289
+ headers: { "Content-Type": "application/json" },
290
+ body: JSON.stringify({ ws: wsId || void 0, namespace: namespace2, id })
291
+ });
292
+ if (res.ok === false) throw fail(res, "Failed to publish");
293
+ return res.data !== void 0 ? res.data : res;
294
+ },
295
+ // BULK publish MANY records in ONE request (data-access redesign). Two shapes:
296
+ // • ids: ['id', ...] → publish each record's existing DRAFT (the edit → publish flow)
297
+ // • records: [{ id, value }, ...] → DRAFT-LESS: publish the supplied values directly (imports —
298
+ // one request for a whole CSV migration, no per-record draft write). optional expectedVersions.
299
+ // Replaces a loop of publish() (each a server-side scan + 2 writes + draft delete). Returns
300
+ // { published, skipped, failed, results }. create_only 409s; a publish review gate refuses the batch.
301
+ async publishRecords(orgId, wsId, namespace2, idsOrRecords, expectedVersions) {
302
+ var body = (
303
+ /** @type {Record<string, any>} */
304
+ { ws: wsId || void 0, namespace: namespace2 }
305
+ );
306
+ var arr = idsOrRecords || [];
307
+ if (arr.length && typeof arr[0] === "object") body.records = arr;
308
+ else body.instances = arr;
309
+ if (expectedVersions && typeof expectedVersions === "object") body.expected_versions = expectedVersions;
310
+ var res = await authFetch("/v1/organisms/" + encodeURIComponent(orgId) + "/workspace/records/publish", {
311
+ method: "POST",
312
+ headers: { "Content-Type": "application/json" },
313
+ body: JSON.stringify(body)
314
+ });
315
+ if (res.ok === false) throw fail(res, "Failed to publish records");
316
+ return res.data !== void 0 ? res.data : res;
317
+ },
318
+ // BULK delete MANY record families in ONE request (data-access redesign) — ids: [id,...]. Removes each
319
+ // record's bare/.draft/.latest/.version.N owned by the caller's own identity in one batched call
320
+ // (needs memory:delete scope). Replaces a loop of deleteObject() (a scan + per-key delete each).
321
+ // Returns { deleted:[{id,keys}], failed:[{id,reason}], rows_removed }.
322
+ async deleteRecords(orgId, wsId, namespace2, ids) {
323
+ var res = await authFetch("/v1/organisms/" + encodeURIComponent(orgId) + "/workspace/records/delete", {
324
+ method: "POST",
325
+ headers: { "Content-Type": "application/json" },
326
+ body: JSON.stringify({ ws: wsId || void 0, namespace: namespace2, ids: ids || [] })
327
+ });
328
+ if (res.ok === false) throw fail(res, "Failed to delete records");
329
+ return res.data !== void 0 ? res.data : res;
330
+ },
331
+ // Reopen a published record for editing (server copies .latest -> .draft; 409 if a draft exists).
332
+ async revertToDraft(orgId, wsId, namespace2, id) {
333
+ var res = await authFetch("/v1/organisms/" + encodeURIComponent(orgId) + "/revert", {
334
+ method: "POST",
335
+ headers: { "Content-Type": "application/json" },
336
+ body: JSON.stringify({ ws: wsId || void 0, namespace: namespace2, id })
337
+ });
338
+ if (res.ok === false) throw fail(res, "Failed to revert to draft");
339
+ return res.data !== void 0 ? res.data : res;
340
+ },
341
+ // Delete one object: bare key + .draft + .latest + all .version.N history (re-run for huge
342
+ // histories). NOTE: needs the memory:delete scope — app-grant tokens don't get it by default,
343
+ // declare it via <meta name="aimeat-scopes" content="memory:read memory:write memory:delete">.
344
+ async deleteObject(orgId, wsId, namespace2, id) {
345
+ var base = wsRoot(orgId, wsId) + "." + namespace2 + "." + id;
346
+ var res = await authFetch("/v1/memory?prefix=" + encodeURIComponent(base) + "&limit=200");
347
+ if (res.ok === false) throw fail(res, "Failed to list object keys");
348
+ var items = res.data && res.data.items || [];
349
+ var deleted = 0, attempted = 0, lastErr = null;
350
+ for (var i = 0; i < items.length; i++) {
351
+ var key = items[i].key;
352
+ if (key !== base && key.indexOf(base + ".") !== 0) continue;
353
+ attempted++;
354
+ var dres = await authFetch("/v1/memory/" + encodeURIComponent(key), { method: "DELETE" });
355
+ if (dres.ok !== false) deleted++;
356
+ else lastErr = dres;
357
+ }
358
+ if (attempted > 0 && deleted === 0 && lastErr) throw fail(lastErr, "Failed to delete object keys");
359
+ return { deleted, attempted };
360
+ },
361
+ // Save the workspace README (creator/org-admin only — the server enforces it).
362
+ async saveReadme(orgId, wsId, readme) {
363
+ var res = await authFetch("/v1/organisms/" + encodeURIComponent(orgId) + "/workspace?ws=" + encodeURIComponent(wsId), {
364
+ method: "PUT",
365
+ headers: { "Content-Type": "application/json" },
366
+ body: JSON.stringify({ readme })
367
+ });
368
+ if (res.ok === false) throw fail(res, "Failed to save README");
369
+ return res.data !== void 0 ? res.data : res;
370
+ },
371
+ // Organism-wide server-side search.
372
+ async search(orgId, q) {
373
+ var res = await authFetch("/v1/organisms/" + encodeURIComponent(orgId) + "/search?q=" + encodeURIComponent(q));
374
+ if (res.ok === false) throw fail(res, "Search failed");
375
+ var d = res.data !== void 0 ? res.data : res;
376
+ return d && (d.results || d.hits || d.items) || (Array.isArray(d) ? d : []);
377
+ },
378
+ util: {
379
+ stripMeta,
380
+ isMetaField,
381
+ titleOf,
382
+ bodyFieldOf,
383
+ isDocLike,
384
+ updatedAt: valueUpdatedAt,
385
+ wsRoot,
386
+ draftKey,
387
+ normalizeWorkspace,
388
+ readmeText,
389
+ TITLE_FIELDS: TITLE_FIELDS.slice(),
390
+ BODY_FIELDS: BODY_FIELDS.slice()
391
+ }
392
+ };
393
+ attach("organism", organism);
394
+ })();
@@ -0,0 +1,90 @@
1
+ // GENERATED FILE — do not edit directly. Source: src/static/sdk-libs/portfolio-standalone/ (+ _core/).
2
+ // Rebuild: pnpm build:sdk · Served at /v1/libs/aimeat-portfolio-standalone.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/portfolio-standalone/index.js
21
+ var APEX = APEX_URL;
22
+ var jwt = null;
23
+ function post(msg) {
24
+ try {
25
+ window.postMessage(msg, window.location.origin);
26
+ } catch {
27
+ }
28
+ }
29
+ function announce(loggedIn) {
30
+ post({ type: "aimeat-portfolio-auth", loggedIn: !!loggedIn });
31
+ }
32
+ window.addEventListener("message", function(e) {
33
+ if (e.source !== window) return;
34
+ var d = e.data;
35
+ if (!d || d.type !== "aimeat-portfolio-fetch") return;
36
+ var reply = function(ok, value) {
37
+ post({
38
+ type: "aimeat-portfolio-fetch-result",
39
+ id: d.id == null ? null : d.id,
40
+ ok: !!ok,
41
+ gaii: typeof d.gaii === "string" ? d.gaii : null,
42
+ key: typeof d.key === "string" ? d.key : null,
43
+ value: value == null ? null : value
44
+ });
45
+ };
46
+ if (typeof d.gaii !== "string" || typeof d.key !== "string") {
47
+ reply(false, null);
48
+ return;
49
+ }
50
+ fetch(
51
+ APEX + "/v1/memory/" + encodeURIComponent(d.gaii) + "/" + encodeURIComponent(d.key),
52
+ jwt ? { headers: { Authorization: "Bearer " + jwt } } : void 0
53
+ ).then(function(r) {
54
+ return r.json().then(function(j) {
55
+ return { r, j };
56
+ });
57
+ }).then(function(x) {
58
+ var ok = !!(x.r.ok && x.j && x.j.ok !== false);
59
+ reply(ok, ok && x.j.data ? x.j.data.value : null);
60
+ }).catch(function() {
61
+ reply(false, null);
62
+ });
63
+ });
64
+ function boot() {
65
+ var auth = window.AIMEAT && window.AIMEAT.auth;
66
+ if (!auth || typeof auth.login !== "function") {
67
+ announce(false);
68
+ return;
69
+ }
70
+ Promise.resolve(auth.login()).then(function(session) {
71
+ jwt = session && session.jwt ? session.jwt : null;
72
+ announce(!!jwt);
73
+ }).catch(function() {
74
+ announce(false);
75
+ });
76
+ if (typeof auth.on === "function") {
77
+ auth.on("login", function() {
78
+ var s = typeof auth.getSession === "function" ? auth.getSession() : null;
79
+ jwt = s && s.jwt || null;
80
+ announce(!!jwt);
81
+ });
82
+ auth.on("logout", function() {
83
+ jwt = null;
84
+ announce(false);
85
+ });
86
+ }
87
+ }
88
+ if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", boot);
89
+ else boot();
90
+ })();
@@ -0,0 +1,157 @@
1
+ // GENERATED FILE — do not edit directly. Source: src/static/sdk-libs/social/ (+ _core/).
2
+ // Rebuild: pnpm build:sdk · Served at /v1/libs/aimeat-social.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/social/index.js
52
+ var { authFetch: authFetch2 } = makeSession("aimeat-social.js");
53
+ async function publicFetch(path) {
54
+ const r = await fetch(NODE_URL + path);
55
+ return r.json();
56
+ }
57
+ var social = {
58
+ // ── Boards ──
59
+ // Create a new board
60
+ async createBoard(name, opts) {
61
+ const body = { name, visibility: "public", ...opts };
62
+ const res = await authFetch2("/v1/boards", { method: "POST", body: JSON.stringify(body) });
63
+ if (!res.ok) throw new Error(res.error?.message || "Failed to create board");
64
+ return res.data;
65
+ },
66
+ // List all visible boards (no auth needed for public boards)
67
+ async boards() {
68
+ const res = await publicFetch("/v1/boards");
69
+ if (!res.ok) throw new Error(res.error?.message || "Failed to list boards");
70
+ return res.data;
71
+ },
72
+ // ── Posts ──
73
+ // Post to a board
74
+ async post(boardId, content) {
75
+ const body = typeof content === "string" ? { body: content } : content;
76
+ const res = await authFetch2("/v1/boards/" + encodeURIComponent(boardId) + "/posts", {
77
+ method: "POST",
78
+ body: JSON.stringify(body)
79
+ });
80
+ if (!res.ok) throw new Error(res.error?.message || "Failed to post");
81
+ return res.data;
82
+ },
83
+ // List posts in a board (public, no auth needed)
84
+ async posts(boardId, opts) {
85
+ const params = new URLSearchParams();
86
+ if (opts?.category) params.set("category", opts.category);
87
+ if (opts?.cursor) params.set("cursor", opts.cursor);
88
+ if (opts?.limit) params.set("limit", String(opts.limit));
89
+ const qs = params.toString();
90
+ const res = await publicFetch("/v1/boards/" + encodeURIComponent(boardId) + "/posts" + (qs ? "?" + qs : ""));
91
+ if (!res.ok) throw new Error(res.error?.message || "Failed to list posts");
92
+ return res.data;
93
+ },
94
+ // Get a single post
95
+ async getPost(boardId, postId) {
96
+ const res = await publicFetch("/v1/boards/" + encodeURIComponent(boardId) + "/posts/" + encodeURIComponent(postId));
97
+ if (!res.ok) {
98
+ if (res.error?.code === "NOT_FOUND") return null;
99
+ throw new Error(res.error?.message || "Failed to get post");
100
+ }
101
+ return res.data;
102
+ },
103
+ // ── Reactions & Replies ──
104
+ // React to a post
105
+ async react(boardId, postId, reaction) {
106
+ const res = await authFetch2(
107
+ "/v1/boards/" + encodeURIComponent(boardId) + "/posts/" + encodeURIComponent(postId) + "/react",
108
+ { method: "POST", body: JSON.stringify({ reaction }) }
109
+ );
110
+ if (!res.ok) throw new Error(res.error?.message || "Failed to react");
111
+ return res.data;
112
+ },
113
+ // Reply to a post
114
+ async reply(boardId, postId, body) {
115
+ const content = typeof body === "string" ? { body } : body;
116
+ const res = await authFetch2(
117
+ "/v1/boards/" + encodeURIComponent(boardId) + "/posts/" + encodeURIComponent(postId) + "/replies",
118
+ { method: "POST", body: JSON.stringify(content) }
119
+ );
120
+ if (!res.ok) throw new Error(res.error?.message || "Failed to reply");
121
+ return res.data;
122
+ },
123
+ // ── Subscriptions ──
124
+ // Subscribe to a board
125
+ async subscribe(boardId, opts) {
126
+ const body = { callback_url: opts?.callback_url, filters: opts?.filters };
127
+ const res = await authFetch2("/v1/boards/" + encodeURIComponent(boardId) + "/subscribe", {
128
+ method: "POST",
129
+ body: JSON.stringify(body)
130
+ });
131
+ if (!res.ok) throw new Error(res.error?.message || "Failed to subscribe");
132
+ return res.data;
133
+ },
134
+ // Unsubscribe from a board
135
+ async unsubscribe(boardId) {
136
+ const res = await authFetch2("/v1/boards/" + encodeURIComponent(boardId) + "/subscribe", {
137
+ method: "DELETE"
138
+ });
139
+ if (!res.ok) throw new Error(res.error?.message || "Failed to unsubscribe");
140
+ return res.data;
141
+ },
142
+ // List own subscriptions
143
+ async subscriptions() {
144
+ const res = await authFetch2("/v1/boards/subscriptions");
145
+ if (!res.ok) throw new Error(res.error?.message || "Failed to list subscriptions");
146
+ return res.data;
147
+ },
148
+ // ── Catalogue (public, no auth) ──
149
+ // Browse public boards from catalogue
150
+ async catalogue() {
151
+ const res = await publicFetch("/v1/catalogue/boards");
152
+ if (!res.ok) throw new Error(res.error?.message || "Failed to browse catalogue boards");
153
+ return res.data;
154
+ }
155
+ };
156
+ attach("social", social);
157
+ })();