aimeat 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (422) hide show
  1. package/dist/.env.example +9 -4
  2. package/dist/locales/en.json +28 -0
  3. package/dist/locales/fi.json +28 -0
  4. package/dist/public/cortex-bundled/aimeat-charts.js +158 -10
  5. package/dist/public/cortex-bundled/aimeat-charts.yaml +1 -1
  6. package/dist/public/cortex-bundled/aimeat-dag.js +515 -173
  7. package/dist/public/cortex-bundled/aimeat-dag.yaml +1 -1
  8. package/dist/public/cortex-bundled/aimeat-i18n.js +6 -1
  9. package/dist/public/cortex-bundled/aimeat-i18n.yaml +1 -1
  10. package/dist/public/cortex-bundled/aimeat-surface.js +577 -0
  11. package/dist/public/cortex-bundled/aimeat-surface.yaml +107 -0
  12. package/dist/public/cortex-bundled/aimeat-viewport.js +405 -0
  13. package/dist/public/cortex-bundled/aimeat-viewport.yaml +100 -0
  14. package/dist/public/css/views/inbox.css +1 -1
  15. package/dist/public/css/views/profile.css +9 -0
  16. package/dist/public/lib/VENDORED.md +6 -3
  17. package/dist/public/lib/aimeat-daisyui-bridge.css +39 -2
  18. package/dist/public/lib/aimeat-theme.css +538 -0
  19. package/dist/public/lib/fonts/LICENSE.md +11 -4
  20. package/dist/public/lib/fonts/fraunces-var-latin-ext.woff2 +0 -0
  21. package/dist/public/lib/fonts/fraunces-var-latin.woff2 +0 -0
  22. package/dist/public/lib/fonts/inter-var-latin-ext.woff2 +0 -0
  23. package/dist/public/lib/fonts/inter-var-latin.woff2 +0 -0
  24. package/dist/public/lib/fonts/jetbrains-mono-var-latin-ext.woff2 +0 -0
  25. package/dist/public/lib/fonts/jetbrains-mono-var-latin.woff2 +0 -0
  26. package/dist/public/lib/fonts/space-grotesk-var-latin-ext.woff2 +0 -0
  27. package/dist/public/lib/fonts/space-grotesk-var-latin.woff2 +0 -0
  28. package/dist/public/lib/samples/theme-check.html +92 -0
  29. package/dist/public/lib/samples/themes-boot.js +20 -0
  30. package/dist/public/lib/samples/themes.html +154 -0
  31. package/dist/public/lib/samples/themes.js +60 -0
  32. package/dist/public/views/profile/access-tab/connected-apps.js +81 -5
  33. package/dist/public/views/profile/extensions-tab.maturity.js +4 -1
  34. package/dist/public/views/profile/inbox-tab/components.js +17 -1
  35. package/dist/public/views/profile/inbox-tab/use-thread-ux.js +29 -2
  36. package/dist/public/views/profile/libraries-tab.js +10 -2
  37. package/dist/public/views/profile/wallet-tab.js +64 -0
  38. package/dist/scripts/check-openapi.d.ts +2 -0
  39. package/dist/scripts/check-openapi.d.ts.map +1 -0
  40. package/dist/scripts/check-openapi.js +139 -0
  41. package/dist/scripts/check-openapi.js.map +1 -0
  42. package/dist/scripts/embed-viewport.d.ts +23 -0
  43. package/dist/scripts/embed-viewport.d.ts.map +1 -0
  44. package/dist/scripts/embed-viewport.js +116 -0
  45. package/dist/scripts/embed-viewport.js.map +1 -0
  46. package/dist/src/auth/sse-domain-scopes.d.ts +50 -0
  47. package/dist/src/auth/sse-domain-scopes.d.ts.map +1 -0
  48. package/dist/src/auth/sse-domain-scopes.js +111 -0
  49. package/dist/src/auth/sse-domain-scopes.js.map +1 -0
  50. package/dist/src/cli/connect/mcp/tools/agent-tasks.d.ts.map +1 -1
  51. package/dist/src/cli/connect/mcp/tools/agent-tasks.js +4 -1
  52. package/dist/src/cli/connect/mcp/tools/agent-tasks.js.map +1 -1
  53. package/dist/src/cli/connect/mcp/tools/core.d.ts.map +1 -1
  54. package/dist/src/cli/connect/mcp/tools/core.js +14 -3
  55. package/dist/src/cli/connect/mcp/tools/core.js.map +1 -1
  56. package/dist/src/cli/connect/mcp/tools/workspaces.d.ts +3 -0
  57. package/dist/src/cli/connect/mcp/tools/workspaces.d.ts.map +1 -1
  58. package/dist/src/cli/connect/mcp/tools/workspaces.js +4 -2
  59. package/dist/src/cli/connect/mcp/tools/workspaces.js.map +1 -1
  60. package/dist/src/cli/connect/tool-call-defs-core.d.ts.map +1 -1
  61. package/dist/src/cli/connect/tool-call-defs-core.js +13 -1
  62. package/dist/src/cli/connect/tool-call-defs-core.js.map +1 -1
  63. package/dist/src/commerce/__tests__/x402-registry.test.d.ts +2 -0
  64. package/dist/src/commerce/__tests__/x402-registry.test.d.ts.map +1 -0
  65. package/dist/src/commerce/__tests__/x402-registry.test.js +105 -0
  66. package/dist/src/commerce/__tests__/x402-registry.test.js.map +1 -0
  67. package/dist/src/commerce/evm-address.d.ts +21 -0
  68. package/dist/src/commerce/evm-address.d.ts.map +1 -0
  69. package/dist/src/commerce/evm-address.js +94 -0
  70. package/dist/src/commerce/evm-address.js.map +1 -0
  71. package/dist/src/commerce/money.d.ts +18 -5
  72. package/dist/src/commerce/money.d.ts.map +1 -1
  73. package/dist/src/commerce/money.js +27 -6
  74. package/dist/src/commerce/money.js.map +1 -1
  75. package/dist/src/commerce/x402-facilitator.d.ts +64 -13
  76. package/dist/src/commerce/x402-facilitator.d.ts.map +1 -1
  77. package/dist/src/commerce/x402-facilitator.js +71 -19
  78. package/dist/src/commerce/x402-facilitator.js.map +1 -1
  79. package/dist/src/commerce/x402-handler.d.ts +13 -7
  80. package/dist/src/commerce/x402-handler.d.ts.map +1 -1
  81. package/dist/src/commerce/x402-handler.js +23 -10
  82. package/dist/src/commerce/x402-handler.js.map +1 -1
  83. package/dist/src/commerce/x402.d.ts +11 -6
  84. package/dist/src/commerce/x402.d.ts.map +1 -1
  85. package/dist/src/commerce/x402.js +10 -7
  86. package/dist/src/commerce/x402.js.map +1 -1
  87. package/dist/src/config-types.d.ts +12 -0
  88. package/dist/src/config-types.d.ts.map +1 -1
  89. package/dist/src/config.d.ts.map +1 -1
  90. package/dist/src/config.js +8 -0
  91. package/dist/src/config.js.map +1 -1
  92. package/dist/src/data/app-templates/shells.d.ts +11 -3
  93. package/dist/src/data/app-templates/shells.d.ts.map +1 -1
  94. package/dist/src/data/app-templates/shells.js +87 -6
  95. package/dist/src/data/app-templates/shells.js.map +1 -1
  96. package/dist/src/data/app-templates.js +2 -2
  97. package/dist/src/data/app-templates.js.map +1 -1
  98. package/dist/src/data/library-packs/cortex.d.ts.map +1 -1
  99. package/dist/src/data/library-packs/cortex.js +108 -5
  100. package/dist/src/data/library-packs/cortex.js.map +1 -1
  101. package/dist/src/data/library-packs/sdk.d.ts.map +1 -1
  102. package/dist/src/data/library-packs/sdk.js +32 -8
  103. package/dist/src/data/library-packs/sdk.js.map +1 -1
  104. package/dist/src/data/library-packs/vendored.d.ts.map +1 -1
  105. package/dist/src/data/library-packs/vendored.js +83 -6
  106. package/dist/src/data/library-packs/vendored.js.map +1 -1
  107. package/dist/src/generated/api-types.d.ts +478 -19
  108. package/dist/src/generated/api-types.d.ts.map +1 -1
  109. package/dist/src/mcp/agent-tasks.d.ts +4 -0
  110. package/dist/src/mcp/agent-tasks.d.ts.map +1 -1
  111. package/dist/src/mcp/agent-tasks.js +20 -2
  112. package/dist/src/mcp/agent-tasks.js.map +1 -1
  113. package/dist/src/mcp/capabilities.d.ts +7 -1
  114. package/dist/src/mcp/capabilities.d.ts.map +1 -1
  115. package/dist/src/mcp/capabilities.js +5 -2
  116. package/dist/src/mcp/capabilities.js.map +1 -1
  117. package/dist/src/mcp/catalog/definitions/commerce.d.ts.map +1 -1
  118. package/dist/src/mcp/catalog/definitions/commerce.js +4 -2
  119. package/dist/src/mcp/catalog/definitions/commerce.js.map +1 -1
  120. package/dist/src/mcp/catalog/definitions/discovery-work-boards.d.ts.map +1 -1
  121. package/dist/src/mcp/catalog/definitions/discovery-work-boards.js +4 -3
  122. package/dist/src/mcp/catalog/definitions/discovery-work-boards.js.map +1 -1
  123. package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.js +1 -1
  124. package/dist/src/mcp/catalog/definitions/organisms-workspaces-apps.js.map +1 -1
  125. package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.d.ts.map +1 -1
  126. package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js +3 -2
  127. package/dist/src/mcp/catalog/definitions/schedules-tasks-memory.js.map +1 -1
  128. package/dist/src/mcp/catalog/output-schemas.d.ts +6 -1
  129. package/dist/src/mcp/catalog/output-schemas.d.ts.map +1 -1
  130. package/dist/src/mcp/catalog/output-schemas.js +6 -1
  131. package/dist/src/mcp/catalog/output-schemas.js.map +1 -1
  132. package/dist/src/mcp/commerce.d.ts.map +1 -1
  133. package/dist/src/mcp/commerce.js +15 -3
  134. package/dist/src/mcp/commerce.js.map +1 -1
  135. package/dist/src/mcp/core-storage.d.ts +23 -0
  136. package/dist/src/mcp/core-storage.d.ts.map +1 -0
  137. package/dist/src/mcp/core-storage.js +157 -0
  138. package/dist/src/mcp/core-storage.js.map +1 -0
  139. package/dist/src/mcp/core.d.ts +16 -0
  140. package/dist/src/mcp/core.d.ts.map +1 -1
  141. package/dist/src/mcp/core.js +75 -119
  142. package/dist/src/mcp/core.js.map +1 -1
  143. package/dist/src/mcp/dm-messages.d.ts +4 -0
  144. package/dist/src/mcp/dm-messages.d.ts.map +1 -1
  145. package/dist/src/mcp/dm-messages.js +43 -2
  146. package/dist/src/mcp/dm-messages.js.map +1 -1
  147. package/dist/src/mcp/exchange.d.ts.map +1 -1
  148. package/dist/src/mcp/exchange.js +3 -2
  149. package/dist/src/mcp/exchange.js.map +1 -1
  150. package/dist/src/mcp/extensions.d.ts.map +1 -1
  151. package/dist/src/mcp/extensions.js +6 -2
  152. package/dist/src/mcp/extensions.js.map +1 -1
  153. package/dist/src/mcp/index.d.ts +5 -0
  154. package/dist/src/mcp/index.d.ts.map +1 -1
  155. package/dist/src/mcp/index.js +23 -4
  156. package/dist/src/mcp/index.js.map +1 -1
  157. package/dist/src/mcp/memory-namespace-hints.d.ts +33 -0
  158. package/dist/src/mcp/memory-namespace-hints.d.ts.map +1 -0
  159. package/dist/src/mcp/memory-namespace-hints.js +60 -0
  160. package/dist/src/mcp/memory-namespace-hints.js.map +1 -0
  161. package/dist/src/mcp/workspaces.d.ts +5 -0
  162. package/dist/src/mcp/workspaces.d.ts.map +1 -1
  163. package/dist/src/mcp/workspaces.js +5 -3
  164. package/dist/src/mcp/workspaces.js.map +1 -1
  165. package/dist/src/models/agent-task-schemas.d.ts +25 -3
  166. package/dist/src/models/agent-task-schemas.d.ts.map +1 -1
  167. package/dist/src/models/agent-task-schemas.js +16 -0
  168. package/dist/src/models/agent-task-schemas.js.map +1 -1
  169. package/dist/src/models/app-tool-schemas.d.ts +518 -1
  170. package/dist/src/models/app-tool-schemas.d.ts.map +1 -1
  171. package/dist/src/models/app-tool-schemas.js +53 -1
  172. package/dist/src/models/app-tool-schemas.js.map +1 -1
  173. package/dist/src/models/odps-schemas.d.ts +305 -0
  174. package/dist/src/models/odps-schemas.d.ts.map +1 -0
  175. package/dist/src/models/odps-schemas.js +182 -0
  176. package/dist/src/models/odps-schemas.js.map +1 -0
  177. package/dist/src/models/offer-schemas.d.ts +357 -2
  178. package/dist/src/models/offer-schemas.d.ts.map +1 -1
  179. package/dist/src/models/offer-schemas.js +37 -0
  180. package/dist/src/models/offer-schemas.js.map +1 -1
  181. package/dist/src/models/schemas.d.ts +6 -3
  182. package/dist/src/models/schemas.d.ts.map +1 -1
  183. package/dist/src/models/schemas.js +10 -1
  184. package/dist/src/models/schemas.js.map +1 -1
  185. package/dist/src/models/webhook-schemas.d.ts +8 -8
  186. package/dist/src/routes/agent-tasks/create-read.d.ts +4 -0
  187. package/dist/src/routes/agent-tasks/create-read.d.ts.map +1 -1
  188. package/dist/src/routes/agent-tasks/create-read.js +20 -1
  189. package/dist/src/routes/agent-tasks/create-read.js.map +1 -1
  190. package/dist/src/routes/agent-tasks/lifecycle.d.ts.map +1 -1
  191. package/dist/src/routes/agent-tasks/lifecycle.js +10 -0
  192. package/dist/src/routes/agent-tasks/lifecycle.js.map +1 -1
  193. package/dist/src/routes/agents/offers.d.ts +2 -0
  194. package/dist/src/routes/agents/offers.d.ts.map +1 -1
  195. package/dist/src/routes/agents/offers.js +0 -0
  196. package/dist/src/routes/agents/offers.js.map +1 -1
  197. package/dist/src/routes/app-grants.d.ts +6 -0
  198. package/dist/src/routes/app-grants.d.ts.map +1 -1
  199. package/dist/src/routes/app-grants.js +55 -25
  200. package/dist/src/routes/app-grants.js.map +1 -1
  201. package/dist/src/routes/apps/drafts.d.ts +3 -0
  202. package/dist/src/routes/apps/drafts.d.ts.map +1 -1
  203. package/dist/src/routes/apps/drafts.js +63 -1
  204. package/dist/src/routes/apps/drafts.js.map +1 -1
  205. package/dist/src/routes/apps/publish.d.ts +2 -0
  206. package/dist/src/routes/apps/publish.d.ts.map +1 -1
  207. package/dist/src/routes/apps/publish.js +17 -2
  208. package/dist/src/routes/apps/publish.js.map +1 -1
  209. package/dist/src/routes/commerce.d.ts.map +1 -1
  210. package/dist/src/routes/commerce.js +122 -2
  211. package/dist/src/routes/commerce.js.map +1 -1
  212. package/dist/src/routes/exchange-market.d.ts +6 -2
  213. package/dist/src/routes/exchange-market.d.ts.map +1 -1
  214. package/dist/src/routes/exchange-market.js +154 -28
  215. package/dist/src/routes/exchange-market.js.map +1 -1
  216. package/dist/src/routes/exchange.d.ts.map +1 -1
  217. package/dist/src/routes/exchange.js +5 -2
  218. package/dist/src/routes/exchange.js.map +1 -1
  219. package/dist/src/routes/extensions/actions.d.ts.map +1 -1
  220. package/dist/src/routes/extensions/actions.js +18 -0
  221. package/dist/src/routes/extensions/actions.js.map +1 -1
  222. package/dist/src/routes/extensions/crud.d.ts.map +1 -1
  223. package/dist/src/routes/extensions/crud.js +36 -3
  224. package/dist/src/routes/extensions/crud.js.map +1 -1
  225. package/dist/src/routes/extensions/entitlement-gate.d.ts.map +1 -1
  226. package/dist/src/routes/extensions/entitlement-gate.js +13 -0
  227. package/dist/src/routes/extensions/entitlement-gate.js.map +1 -1
  228. package/dist/src/routes/extensions/manifest.d.ts +6 -0
  229. package/dist/src/routes/extensions/manifest.d.ts.map +1 -1
  230. package/dist/src/routes/extensions/manifest.js +68 -1
  231. package/dist/src/routes/extensions/manifest.js.map +1 -1
  232. package/dist/src/routes/extensions/pacing.d.ts +31 -0
  233. package/dist/src/routes/extensions/pacing.d.ts.map +1 -0
  234. package/dist/src/routes/extensions/pacing.js +73 -0
  235. package/dist/src/routes/extensions/pacing.js.map +1 -0
  236. package/dist/src/routes/extensions/paywall.d.ts.map +1 -1
  237. package/dist/src/routes/extensions/paywall.js +17 -17
  238. package/dist/src/routes/extensions/paywall.js.map +1 -1
  239. package/dist/src/routes/memory/crud.d.ts.map +1 -1
  240. package/dist/src/routes/memory/crud.js +10 -0
  241. package/dist/src/routes/memory/crud.js.map +1 -1
  242. package/dist/src/routes/organisms/crud.d.ts +3 -0
  243. package/dist/src/routes/organisms/crud.d.ts.map +1 -1
  244. package/dist/src/routes/organisms/crud.js +5 -2
  245. package/dist/src/routes/organisms/crud.js.map +1 -1
  246. package/dist/src/routes/organisms/workspace-read.d.ts.map +1 -1
  247. package/dist/src/routes/organisms/workspace-read.js +7 -2
  248. package/dist/src/routes/organisms/workspace-read.js.map +1 -1
  249. package/dist/src/routes/public-stats.d.ts +7 -0
  250. package/dist/src/routes/public-stats.d.ts.map +1 -1
  251. package/dist/src/routes/public-stats.js +28 -7
  252. package/dist/src/routes/public-stats.js.map +1 -1
  253. package/dist/src/routes/sse.d.ts +7 -0
  254. package/dist/src/routes/sse.d.ts.map +1 -1
  255. package/dist/src/routes/sse.js +36 -6
  256. package/dist/src/routes/sse.js.map +1 -1
  257. package/dist/src/routes/storage-files.d.ts +11 -0
  258. package/dist/src/routes/storage-files.d.ts.map +1 -1
  259. package/dist/src/routes/storage-files.js +58 -51
  260. package/dist/src/routes/storage-files.js.map +1 -1
  261. package/dist/src/routes/subdomains.d.ts +4 -0
  262. package/dist/src/routes/subdomains.d.ts.map +1 -1
  263. package/dist/src/routes/subdomains.js +42 -5
  264. package/dist/src/routes/subdomains.js.map +1 -1
  265. package/dist/src/routes/upload.d.ts +11 -0
  266. package/dist/src/routes/upload.d.ts.map +1 -1
  267. package/dist/src/routes/upload.js +108 -28
  268. package/dist/src/routes/upload.js.map +1 -1
  269. package/dist/src/routes/webmcp.d.ts.map +1 -1
  270. package/dist/src/routes/webmcp.js +4 -0
  271. package/dist/src/routes/webmcp.js.map +1 -1
  272. package/dist/src/schemas/knowledge-package.d.ts +1 -1
  273. package/dist/src/server-bootstrap/static-files.d.ts +4 -0
  274. package/dist/src/server-bootstrap/static-files.d.ts.map +1 -1
  275. package/dist/src/server-bootstrap/static-files.js +11 -0
  276. package/dist/src/server-bootstrap/static-files.js.map +1 -1
  277. package/dist/src/services/build-app-prompt.d.ts +19 -0
  278. package/dist/src/services/build-app-prompt.d.ts.map +1 -1
  279. package/dist/src/services/build-app-prompt.js +97 -11
  280. package/dist/src/services/build-app-prompt.js.map +1 -1
  281. package/dist/src/services/call-timing.d.ts +51 -0
  282. package/dist/src/services/call-timing.d.ts.map +1 -0
  283. package/dist/src/services/call-timing.js +91 -0
  284. package/dist/src/services/call-timing.js.map +1 -0
  285. package/dist/src/services/capability-invoke.d.ts +2 -0
  286. package/dist/src/services/capability-invoke.d.ts.map +1 -1
  287. package/dist/src/services/capability-invoke.js +10 -0
  288. package/dist/src/services/capability-invoke.js.map +1 -1
  289. package/dist/src/services/config-schema.d.ts.map +1 -1
  290. package/dist/src/services/config-schema.js +6 -0
  291. package/dist/src/services/config-schema.js.map +1 -1
  292. package/dist/src/services/draft-token.d.ts +22 -2
  293. package/dist/src/services/draft-token.d.ts.map +1 -1
  294. package/dist/src/services/draft-token.js +52 -3
  295. package/dist/src/services/draft-token.js.map +1 -1
  296. package/dist/src/services/exchange-market.d.ts +41 -8
  297. package/dist/src/services/exchange-market.d.ts.map +1 -1
  298. package/dist/src/services/exchange-market.js +24 -2
  299. package/dist/src/services/exchange-market.js.map +1 -1
  300. package/dist/src/services/exchange-odps.d.ts +58 -0
  301. package/dist/src/services/exchange-odps.d.ts.map +1 -0
  302. package/dist/src/services/exchange-odps.js +400 -0
  303. package/dist/src/services/exchange-odps.js.map +1 -0
  304. package/dist/src/services/exchange-projection.d.ts +61 -0
  305. package/dist/src/services/exchange-projection.d.ts.map +1 -0
  306. package/dist/src/services/exchange-projection.js +504 -0
  307. package/dist/src/services/exchange-projection.js.map +1 -0
  308. package/dist/src/services/exchange-proposals.d.ts.map +1 -1
  309. package/dist/src/services/exchange-proposals.js +2 -0
  310. package/dist/src/services/exchange-proposals.js.map +1 -1
  311. package/dist/src/services/extension-files.d.ts +64 -0
  312. package/dist/src/services/extension-files.d.ts.map +1 -0
  313. package/dist/src/services/extension-files.js +88 -0
  314. package/dist/src/services/extension-files.js.map +1 -0
  315. package/dist/src/services/extension-runtime.d.ts +33 -0
  316. package/dist/src/services/extension-runtime.d.ts.map +1 -1
  317. package/dist/src/services/extension-runtime.js +52 -0
  318. package/dist/src/services/extension-runtime.js.map +1 -1
  319. package/dist/src/services/file-refs.d.ts +105 -0
  320. package/dist/src/services/file-refs.d.ts.map +1 -0
  321. package/dist/src/services/file-refs.js +106 -0
  322. package/dist/src/services/file-refs.js.map +1 -0
  323. package/dist/src/services/metered-entitlements.d.ts +7 -0
  324. package/dist/src/services/metered-entitlements.d.ts.map +1 -1
  325. package/dist/src/services/metered-entitlements.js +4 -0
  326. package/dist/src/services/metered-entitlements.js.map +1 -1
  327. package/dist/src/services/owner-memory.d.ts +14 -1
  328. package/dist/src/services/owner-memory.d.ts.map +1 -1
  329. package/dist/src/services/owner-memory.js +8 -14
  330. package/dist/src/services/owner-memory.js.map +1 -1
  331. package/dist/src/services/task-files.d.ts +51 -0
  332. package/dist/src/services/task-files.d.ts.map +1 -0
  333. package/dist/src/services/task-files.js +58 -0
  334. package/dist/src/services/task-files.js.map +1 -0
  335. package/dist/src/services/upload-token.d.ts +29 -0
  336. package/dist/src/services/upload-token.d.ts.map +1 -1
  337. package/dist/src/services/upload-token.js +37 -0
  338. package/dist/src/services/upload-token.js.map +1 -1
  339. package/dist/src/services/upload-zip.d.ts +2 -0
  340. package/dist/src/services/upload-zip.d.ts.map +1 -1
  341. package/dist/src/services/upload-zip.js +5 -1
  342. package/dist/src/services/upload-zip.js.map +1 -1
  343. package/dist/src/services/workspace-meta.d.ts +15 -0
  344. package/dist/src/services/workspace-meta.d.ts.map +1 -1
  345. package/dist/src/services/workspace-meta.js +17 -0
  346. package/dist/src/services/workspace-meta.js.map +1 -1
  347. package/dist/src/services/workspace-provision.d.ts +3 -0
  348. package/dist/src/services/workspace-provision.d.ts.map +1 -1
  349. package/dist/src/services/workspace-provision.js +5 -3
  350. package/dist/src/services/workspace-provision.js.map +1 -1
  351. package/dist/src/storage/providers/postgres-kysely/methods/app-grants.d.ts +1 -0
  352. package/dist/src/storage/providers/postgres-kysely/methods/app-grants.d.ts.map +1 -1
  353. package/dist/src/storage/providers/postgres-kysely/methods/app-grants.js +10 -0
  354. package/dist/src/storage/providers/postgres-kysely/methods/app-grants.js.map +1 -1
  355. package/dist/src/storage/providers/postgres-kysely/methods/memory.d.ts +2 -0
  356. package/dist/src/storage/providers/postgres-kysely/methods/memory.d.ts.map +1 -1
  357. package/dist/src/storage/providers/postgres-kysely/methods/memory.js +12 -1
  358. package/dist/src/storage/providers/postgres-kysely/methods/memory.js.map +1 -1
  359. package/dist/src/storage/providers/postgres-kysely/methods/organisms.d.ts.map +1 -1
  360. package/dist/src/storage/providers/postgres-kysely/methods/organisms.js +5 -1
  361. package/dist/src/storage/providers/postgres-kysely/methods/organisms.js.map +1 -1
  362. package/dist/src/storage/providers/postgres-kysely/migrations/0012_unique_live_app_grant.sql +29 -0
  363. package/dist/src/storage/providers/sqlite/methods/apps.d.ts +3 -0
  364. package/dist/src/storage/providers/sqlite/methods/apps.d.ts.map +1 -1
  365. package/dist/src/storage/providers/sqlite/methods/apps.js +7 -0
  366. package/dist/src/storage/providers/sqlite/methods/apps.js.map +1 -1
  367. package/dist/src/storage/providers/sqlite/methods/governance.d.ts +1 -0
  368. package/dist/src/storage/providers/sqlite/methods/governance.d.ts.map +1 -1
  369. package/dist/src/storage/providers/sqlite/methods/governance.js +4 -1
  370. package/dist/src/storage/providers/sqlite/methods/governance.js.map +1 -1
  371. package/dist/src/storage/providers/sqlite/methods/owner.d.ts +5 -0
  372. package/dist/src/storage/providers/sqlite/methods/owner.d.ts.map +1 -1
  373. package/dist/src/storage/providers/sqlite/methods/owner.js +8 -0
  374. package/dist/src/storage/providers/sqlite/methods/owner.js.map +1 -1
  375. package/dist/src/storage/providers/sqlite/schema.d.ts +3 -0
  376. package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
  377. package/dist/src/storage/providers/sqlite/schema.js +20 -0
  378. package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
  379. package/dist/src/storage/repositories/app-grant.repository.d.ts +9 -1
  380. package/dist/src/storage/repositories/app-grant.repository.d.ts.map +1 -1
  381. package/dist/src/storage/repositories/memory.repository.d.ts +14 -0
  382. package/dist/src/storage/repositories/memory.repository.d.ts.map +1 -1
  383. package/dist/src/storage/repositories-impl/memory-repository.d.ts +8 -1
  384. package/dist/src/storage/repositories-impl/memory-repository.d.ts.map +1 -1
  385. package/dist/src/storage/repositories-impl/memory-repository.js +15 -4
  386. package/dist/src/storage/repositories-impl/memory-repository.js.map +1 -1
  387. package/dist/src/storage/types/agents-messaging.d.ts +19 -0
  388. package/dist/src/storage/types/agents-messaging.d.ts.map +1 -1
  389. package/dist/src/storage/types/agents-messaging.js.map +1 -1
  390. package/dist/src/storage/types/organisms-federation.d.ts +29 -0
  391. package/dist/src/storage/types/organisms-federation.d.ts.map +1 -1
  392. package/dist/src/utils/app-badge.d.ts.map +1 -1
  393. package/dist/src/utils/app-badge.js +7 -3
  394. package/dist/src/utils/app-badge.js.map +1 -1
  395. package/dist/static/app-catalog/_template.html +6 -5
  396. package/dist/static/app-catalog/js/cortex.js +3 -1
  397. package/dist/static/app-catalog/js/detail.js +411 -36
  398. package/dist/static/app-catalog/js/i18n-data.js +279 -3
  399. package/dist/static/app-catalog/js/main.js +28 -37
  400. package/dist/static/app-catalog/js/monetize.js +204 -16
  401. package/dist/static/app-catalog/js/odps.js +489 -0
  402. package/dist/static/app-catalog/js/render.js +3 -0
  403. package/dist/static/app-catalog/js/workcopy.js +198 -0
  404. package/dist/static/app-catalog/styles/app-catalog.css +60 -0
  405. package/dist/static/app-catalog.html +1450 -137
  406. package/dist/static/sdk-libs/agents/index.js +45 -7
  407. package/dist/static/sdk-libs/auth/cluster.js +97 -0
  408. package/dist/static/sdk-libs/auth/index.js +25 -1
  409. package/dist/static/sdk-libs/auth/locale.js +151 -0
  410. package/dist/static/sdk-libs/auth/modal.js +11 -2
  411. package/dist/static/sdk-libs/auth/palette.js +172 -0
  412. package/dist/static/sdk-libs/auth/pill.js +37 -6
  413. package/dist/static/sdk-libs/auth/theme.js +61 -20
  414. package/dist/static/sdk-libs/data/index.js +70 -8
  415. package/dist/static/sdk-libs/dist/aimeat-agents.js +41 -8
  416. package/dist/static/sdk-libs/dist/aimeat-auth.js +422 -21
  417. package/dist/static/sdk-libs/dist/aimeat-data.js +50 -8
  418. package/dist/static/sdk-libs/dist/aimeat-live.js +54 -2
  419. package/dist/static/sdk-libs/dist/aimeat-markdown.js +32 -1
  420. package/dist/static/sdk-libs/live/index.js +71 -4
  421. package/dist/static/sdk-libs/markdown/index.js +49 -1
  422. package/package.json +6 -2
@@ -0,0 +1,107 @@
1
+ apiVersion: cortex.aimeat.org/v1
2
+ kind: Extension
3
+ metadata:
4
+ name: aimeat-surface
5
+ namespace: aimeat
6
+ description: "The panel-spec surface engine: turn a plain-language request into ONE panel spec, resolve its data source into rows, and render them through the node's UI packs (stats / table / chart / timeline / brief / options). Data sources are plugins — memory and inline ship built in, the app registers the rest, and the registered sources assemble the composer's own prompt. Renders the panel BODY only; card, frame and persistence belong to the host."
7
+ author: AIMEAT
8
+ tags: [surface, panel, spec, ai, compose, dashboard, living-surface, ui]
9
+ labels:
10
+ domain: ui
11
+
12
+ spec:
13
+ version: "1.1.0"
14
+ license: MIT
15
+ components:
16
+ - type: prompt
17
+ name: surface-assistant
18
+ content: |
19
+ You are a living-surface assistant for an AIMEAT app. The user's node is at {{node_url}}.
20
+
21
+ aimeat-surface turns "show me X" into a rendered panel. The app never hand-builds a
22
+ dashboard: it composes a PANEL SPEC, resolves the spec's source into rows, and renders.
23
+ The same spec can be a card in one product and a frame on a canvas in another, because
24
+ the engine renders the BODY only.
25
+
26
+ Include the packs it renders through, then this one:
27
+ <script src="{{node_url}}/v1/cortex/aimeat-ui-viewers/libs/aimeat-ui-viewers.js"></script>
28
+ <script src="{{node_url}}/v1/cortex/aimeat-ui-motion/libs/aimeat-ui-motion.js"></script>
29
+ <script src="{{node_url}}/lib/chartjs@4.js"></script>
30
+ <script src="{{node_url}}/v1/cortex/aimeat-charts/libs/aimeat-charts.js"></script>
31
+ <script src="{{node_url}}/v1/cortex/aimeat-surface/libs/aimeat-surface.js"></script>
32
+ Every pack call has a plain-DOM fallback, so a missing pack degrades instead of blanking
33
+ the panel — but load them and the surface looks like one product.
34
+
35
+ const surface = AIMEAT.surface.create({ appId: APP_ID, locale: 'fi' });
36
+
37
+ THE PANEL SPEC is the whole contract:
38
+ { id, title, kind, intent, source, view, needsYou, updatedAt, author }
39
+ kind: stats | table | chart | timeline | brief | options
40
+ source: { type, ... } resolved by a registered source
41
+ view: per kind —
42
+ table {"columns":[{"key","label"}]} (omit and columns are auto-picked)
43
+ chart {"chartType":"bar|line|pie|doughnut","labelKey","valueKeys":[]}
44
+ stats {"tiles":[{"label","key","agg":"count|sum|avg|latest","format":"usd|eur","sparkKey"}]}
45
+ timeline {"tsKey","textKey"}
46
+ brief {"markdown":"…"}
47
+ options {"items":[{"title","body"}],"chosen":{…}}
48
+
49
+ DATA SOURCES ARE PLUGINS. Built in: memory (owner-scope read by key prefix, which also
50
+ picks up what the owner's AGENTS wrote) and inline. Register anything else the app can
51
+ fetch — and note the consequence: a source you do not register is a source the composer
52
+ is never told about, because the registered sources assemble its prompt.
53
+ surface.registerSource('companies', {
54
+ hint: ' {"type":"companies","names":["Nokia"]} Finnish trade-register companies',
55
+ fields: 'name, businessId, form, line, registered, lastChange, website, city',
56
+ resolve: async (src, ctx) => rowsFor(src),
57
+ normalize: (src) => ({ names: src.names || src.companies || [], ids: src.ids || [] }),
58
+ claims: (src) => !!(src.names || src.companies || src.ids),
59
+ })
60
+ `claims` matters: models rename and drop the type field, so each source gets to claim a
61
+ malformed source object by SHAPE before the engine falls back to inline.
62
+
63
+ THE LOOP:
64
+ const spec = await surface.compose(text, { prefixes }); // request → spec
65
+ const rows = await surface.resolve(spec, { session }); // spec → rows
66
+ surface.renderBody(boxEl, spec, rows, { onPick }); // rows → DOM
67
+ const next = await surface.reshape(spec, 'make it a chart by month');
68
+ const better = await surface.refine(spec, rows); // SECOND PASS, see below
69
+ spec.view.markdown = await surface.writeBrief(spec, rows);
70
+
71
+ RUN refine() AFTER THE ROWS ARRIVE when the composer had to guess the data shape blind
72
+ (memory sources above all). It re-picks kind + view against the REAL field names, and it
73
+ is the difference between "my AI spend per day" arriving as a chart of the right column
74
+ and as a table of plumbing. Keep the source pinned — refine() does.
75
+
76
+ writeBrief() runs AFTER resolve() on purpose: the model only ever sees fetched rows, so a
77
+ brief cannot invent data.
78
+
79
+ Helpers you may want directly: AIMEAT.surface.flatten(obj), .autoColumns(rows),
80
+ .agg(rows, key, how), .num(v); on an engine, .fmtNum(n, 'usd'|'eur') and .specHint().
81
+
82
+ The engine does NOT persist anything. Store specs where they belong for your product —
83
+ an app memory key, a workspace record, a board — and pass them back in.
84
+ variables:
85
+ - "{{node_url}}"
86
+
87
+ - type: lib
88
+ name: aimeat-surface
89
+ filename: aimeat-surface.js
90
+ exports:
91
+ - create
92
+ api_surface: |
93
+ AIMEAT.surface.create({ appId?, locale?: 'fi'|'en', strings?, ai?, scrollClass? })
94
+ -> { KINDS, registerSource(type, def), resolve(spec, ctx), renderBody(box, spec, rows, opts?),
95
+ specHint(), normalizeSpec(out, intent), compose(text, ctx), reshape(spec, text),
96
+ refine(spec, rows), writeBrief(spec, rows), autoColumns(rows), fmtNum(n, format), t(key) }
97
+ AIMEAT.surface.{ KINDS, flatten, autoColumns, agg, num, VERSION }
98
+
99
+ Panel spec: { id, title, kind, intent, source, view, needsYou, updatedAt, author }
100
+ kind: stats | table | chart | timeline | brief | options
101
+ Built-in sources: memory ({type,prefix}, owner-scope, includes agent writes) · inline ({type,rows}).
102
+ registerSource def: { resolve(src, ctx), hint, fields?, normalize?(src), claims?(src) }.
103
+
104
+ Renders the panel BODY into the element you pass; chrome and persistence are the host's.
105
+ Rendering degrades gracefully when a UI pack is absent (statTiles → daisyUI stats,
106
+ ChartBuilder → warning, Timeline → list, markdown → escaped text, DataTable → table).
107
+ renderBody opts: { onPick(index, spec), pageSize }.
@@ -0,0 +1,405 @@
1
+ /**
2
+ * @file aimeat-viewport.js
3
+ * @description The shared CAMERA primitive for AIMEAT canvas surfaces — pan, zoom-at-cursor,
4
+ * pinch, drag delegation, animated fit/centerOn, and the navigate/interact capture-overlay
5
+ * model that makes panning work over children which swallow pointer events (iframes). It owns
6
+ * the camera and NOTHING about content: what counts as draggable content is answered by the
7
+ * consumer through the `onClaimPointer` hit-test delegate. Extracted verbatim-in-behaviour from
8
+ * aimeat-dag v1.0.1 (TARGET-051) so a second consumer does not mean a third pan/zoom
9
+ * implementation; aimeat-dag now sits on this and embeds a byte-identical copy of this file so
10
+ * it can stay a single self-contained script tag.
11
+ * @structure
12
+ * - injectCss(prefix) → structural CSS for one class prefix (host/world/panning/overlay)
13
+ * - create(hostOrSelector, opts) → the viewport instance
14
+ * - instance: world, cam(), scale(), setCamera(), fit(), centerOn(), clientToWorld(),
15
+ * worldToClient(), setMode(), getMode(), refreshCaptures(), destroy()
16
+ * @usage
17
+ * <script src="/v1/cortex/aimeat-viewport/libs/aimeat-viewport.js"></script>
18
+ * const vp = AIMEAT.viewport.create('#board', {
19
+ * classPrefix: 'og', minZoom: 0.05, maxZoom: 3,
20
+ * captureSelector: '[data-og-frame]', // enables the navigate/interact model
21
+ * contentBBox: () => boundsOfAllFrames(),
22
+ * onClaimPointer: (ev) => { const f = ev.target.closest('[data-og-frame]'); return f ? handleFor(f) : null; },
23
+ * });
24
+ * vp.world.appendChild(frameEl); // children live in world space
25
+ * @version-history
26
+ * v1.0.3 — 2026-07-25 — Report the version the manifest declares; the constant and the
27
+ * manifest had crossed. pnpm check:viewport now asserts they match.
28
+ * v1.0.1 — 2026-07-25 — Fix: do not force position:relative on the host (it beat a consumer's
29
+ * own position:fixed at the same specificity and collapsed a full-screen board to 0px);
30
+ * create() promotes the host only when its computed position is static.
31
+ * v1.0.0 — 2026-07-25 — Initial (TARGET-051 Slice 1): camera extracted from aimeat-dag v1.0.1.
32
+ * Behaviour-preserving for dag (same gesture semantics, same zoom clamps as defaults, same
33
+ * easing and reduced-motion handling); new for other consumers are classPrefix, configurable
34
+ * zoom bounds, the pointer-claim delegate, clientToWorld/worldToClient as public API (it was
35
+ * dead code in dag), and the navigate/interact capture overlays.
36
+ */
37
+ (function (global) {
38
+ 'use strict';
39
+
40
+ var AIMEAT = global.AIMEAT = global.AIMEAT || {};
41
+
42
+ // Idempotent: aimeat-dag embeds a copy of this file so it can ship as one script tag. Loading
43
+ // both the standalone pack and dag must not redefine the namespace.
44
+ if (AIMEAT.viewport) return;
45
+
46
+ var REDUCED = false;
47
+ try { REDUCED = global.matchMedia && global.matchMedia('(prefers-reduced-motion: reduce)').matches; } catch (e) { /* noop */ }
48
+
49
+ var ANIM_MS = 320;
50
+ var ANIM_EASE = 'cubic-bezier(.22,1,.36,1)';
51
+
52
+ // Structural CSS only — the consumer owns cosmetics (size, background, radius). Keeping the two
53
+ // sets disjoint means injection order never matters and no rule fights another.
54
+ var injected = {};
55
+ function injectCss(p) {
56
+ if (injected[p]) return;
57
+ var css = [
58
+ /* NOTE: `position` is deliberately NOT set here. The host only has to be a positioning
59
+ context, and a consumer may already be one in a way that matters — a full-screen board is
60
+ `position: fixed; inset: 0`, and a same-specificity `position: relative` from this
61
+ stylesheet would silently win, collapse the host to zero height and leave every pointer
62
+ event landing on nothing. create() promotes the host only when it is actually static. */
63
+ '.' + p + '-host { overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }',
64
+ '.' + p + '-host.' + p + '-panning { cursor: grabbing; }',
65
+ '.' + p + '-host.' + p + '-interact { cursor: default; }',
66
+ '.' + p + '-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }',
67
+ '.' + p + '-world.' + p + '-animated { transition: transform ' + ANIM_MS + 'ms ' + ANIM_EASE + '; }',
68
+ // The capture overlay: transparent, fills its host child, sits above iframe content so the
69
+ // pointer stream reaches the viewport instead of being swallowed.
70
+ '.' + p + '-capture { position: absolute; inset: 0; z-index: 5; background: transparent; cursor: inherit; }',
71
+ '@media (prefers-reduced-motion: reduce) { .' + p + '-world.' + p + '-animated { transition: none; } }',
72
+ ].join('\n');
73
+ var style = document.createElement('style');
74
+ style.setAttribute('data-aimeat-viewport', p);
75
+ style.textContent = css;
76
+ document.head.appendChild(style);
77
+ injected[p] = true;
78
+ }
79
+
80
+ function resolveEl(elOrSelector) {
81
+ return typeof elOrSelector === 'string' ? document.querySelector(elOrSelector) : elOrSelector;
82
+ }
83
+
84
+ function dist(a, b) { return Math.hypot(a.x - b.x, a.y - b.y); }
85
+ function mid(a, b) { return { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 }; }
86
+ function clamp(v, lo, hi) { return Math.min(hi, Math.max(lo, v)); }
87
+
88
+ function isTextEntry(el) {
89
+ if (!el) return false;
90
+ var tag = (el.tagName || '').toLowerCase();
91
+ return tag === 'input' || tag === 'textarea' || tag === 'select' || el.isContentEditable === true;
92
+ }
93
+
94
+ /**
95
+ * Create a viewport over `host`. The instance creates and owns the `world` element; put your
96
+ * content inside `vp.world` and position it in world coordinates.
97
+ *
98
+ * @param {Element|string} hostOrSelector clipping host (the consumer gives it a size)
99
+ * @param {Object} [opts]
100
+ * @param {string} [opts.classPrefix='av'] prefix for host/world/panning/capture classes — a
101
+ * consumer that already ships CSS selectors passes its own so nothing renames.
102
+ * @param {number} [opts.minZoom=0.2] @param {number} [opts.maxZoom=2.5]
103
+ * @param {Object} [opts.initial={x:40,y:40,k:1}] starting camera
104
+ * @param {number} [opts.fitPadding=36] @param {number} [opts.fitMaxZoom=1.4]
105
+ * @param {number} [opts.centerMinZoom=1] centerOn() zooms in to at least this
106
+ * @param {number} [opts.dragThreshold=4] client px before a claimed pointer counts as moved
107
+ * @param {Function} [opts.contentBBox] () → {x,y,w,h} in world units; required for fit()
108
+ * @param {Function} [opts.onClaimPointer] (ev) → null (viewport pans) | drag handle
109
+ * { onMove(worldDx, worldDy, ev, cam), onEnd(movedPastThreshold, ev) }
110
+ * @param {Function} [opts.onTap] (ev) fired when a pan gesture ends without moving
111
+ * @param {Function} [opts.onCameraChange] (cam) after any camera change
112
+ * @param {string} [opts.captureSelector] children matching this get a capture overlay in
113
+ * navigate mode. Supplying it OPTS IN to the two-mode model (space-hold, middle-mouse pan,
114
+ * Esc). Omit it and no window listeners are attached at all.
115
+ * @param {string} [opts.mode='navigate']
116
+ */
117
+ function create(hostOrSelector, opts) {
118
+ opts = opts || {};
119
+ var host = resolveEl(hostOrSelector);
120
+ if (!host) throw new Error('aimeat-viewport: host element not found');
121
+
122
+ var P = opts.classPrefix || 'av';
123
+ var minZoom = opts.minZoom != null ? opts.minZoom : 0.2;
124
+ var maxZoom = opts.maxZoom != null ? opts.maxZoom : 2.5;
125
+ var fitPadding = opts.fitPadding != null ? opts.fitPadding : 36;
126
+ var fitMaxZoom = opts.fitMaxZoom != null ? opts.fitMaxZoom : 1.4;
127
+ var centerMinZoom = opts.centerMinZoom != null ? opts.centerMinZoom : 1;
128
+ var dragThreshold = opts.dragThreshold != null ? opts.dragThreshold : 4;
129
+ var twoMode = !!opts.captureSelector;
130
+
131
+ injectCss(P);
132
+ host.classList.add(P + '-host');
133
+ /* The world is absolutely positioned, so the host must be a positioning context — but only
134
+ promote it when it is static. Overwriting an existing fixed/absolute/sticky host is how a
135
+ full-screen board ends up 0px tall. */
136
+ if (global.getComputedStyle(host).position === 'static') host.style.position = 'relative';
137
+
138
+ var world = document.createElement('div');
139
+ world.className = P + '-world';
140
+ host.appendChild(world);
141
+
142
+ var init = opts.initial || {};
143
+ var cam = { x: init.x != null ? init.x : 40, y: init.y != null ? init.y : 40, k: init.k != null ? init.k : 1 };
144
+ var mode = opts.mode === 'interact' ? 'interact' : 'navigate';
145
+ var spaceHeld = false;
146
+ var destroyed = false;
147
+
148
+ function emitCam() { if (opts.onCameraChange) opts.onCameraChange({ x: cam.x, y: cam.y, k: cam.k }); }
149
+
150
+ function applyCam(animated) {
151
+ if (animated && !REDUCED) {
152
+ world.classList.add(P + '-animated');
153
+ setTimeout(function () { world.classList.remove(P + '-animated'); }, ANIM_MS + 40);
154
+ }
155
+ world.style.transform = 'translate(' + cam.x + 'px,' + cam.y + 'px) scale(' + cam.k + ')';
156
+ emitCam();
157
+ }
158
+
159
+ // ── capture overlays ──────────────────────────────────────────────────────
160
+ // Children that handle their own pointer events (iframes above all) swallow the stream and
161
+ // panning over them silently stops working. In navigate mode each one gets a transparent
162
+ // overlay; in interact mode the overlays come off and the child behaves normally.
163
+ function refreshCaptures() {
164
+ if (!twoMode) return;
165
+ var wants = (mode === 'navigate') || spaceHeld;
166
+ /* Sweep first. The selector decides WHO gets an overlay, so an element that has left the set
167
+ must lose the one it already has. Only matching elements were visited, so a consumer that
168
+ excludes a frame at runtime — "let me use just this one" — kept a dead overlay sitting on
169
+ top of it and the frame stayed unclickable with no way to tell why. */
170
+ var stale = world.querySelectorAll('.' + P + '-capture');
171
+ for (var k = 0; k < stale.length; k++) {
172
+ var owner = stale[k].parentElement;
173
+ if (owner && owner.matches && !owner.matches(opts.captureSelector)) stale[k].remove();
174
+ }
175
+ var targets = world.querySelectorAll(opts.captureSelector);
176
+ for (var i = 0; i < targets.length; i++) {
177
+ var el = targets[i];
178
+ var existing = el.querySelector(':scope > .' + P + '-capture');
179
+ if (wants && !existing) {
180
+ var ov = document.createElement('div');
181
+ ov.className = P + '-capture';
182
+ ov.setAttribute('aria-hidden', 'true');
183
+ el.appendChild(ov);
184
+ } else if (!wants && existing) {
185
+ existing.remove();
186
+ }
187
+ }
188
+ }
189
+
190
+ function setMode(next) {
191
+ var m = next === 'interact' ? 'interact' : 'navigate';
192
+ if (m === mode) return;
193
+ mode = m;
194
+ host.classList.toggle(P + '-interact', mode === 'interact');
195
+ refreshCaptures();
196
+ }
197
+
198
+ // ── pointer interactions ──────────────────────────────────────────────────
199
+ var pointers = {}; // pointerId → {x,y}
200
+ var gesture = null; // {mode:'pan'|'pinch'|'claim', ...}
201
+
202
+ function clientToWorld(cx, cy) {
203
+ var r = host.getBoundingClientRect();
204
+ return { x: (cx - r.left - cam.x) / cam.k, y: (cy - r.top - cam.y) / cam.k };
205
+ }
206
+ function worldToClient(wx, wy) {
207
+ var r = host.getBoundingClientRect();
208
+ return { x: wx * cam.k + cam.x + r.left, y: wy * cam.k + cam.y + r.top };
209
+ }
210
+
211
+ function beginPan(ev) {
212
+ gesture = { mode: 'pan', sx: ev.clientX, sy: ev.clientY, cam0: { x: cam.x, y: cam.y }, moved: false };
213
+ host.classList.add(P + '-panning');
214
+ }
215
+
216
+ function onPointerDown(ev) {
217
+ // Capture is best-effort: synthetic PointerEvents (tests, automation) and pointers released
218
+ // mid-dispatch have no active pointer and would throw NotFoundError, swallowing the whole
219
+ // pointerdown. (aimeat-dag v1.0.1 shipped this as a real bug fix.)
220
+ try { host.setPointerCapture && host.setPointerCapture(ev.pointerId); } catch (e) { /* noop */ }
221
+ pointers[ev.pointerId] = { x: ev.clientX, y: ev.clientY };
222
+
223
+ if (Object.keys(pointers).length === 2) {
224
+ var pts = Object.keys(pointers).map(function (id) { return pointers[id]; });
225
+ gesture = {
226
+ mode: 'pinch', d0: dist(pts[0], pts[1]), k0: cam.k,
227
+ mid0: mid(pts[0], pts[1]), cam0: { x: cam.x, y: cam.y },
228
+ };
229
+ return;
230
+ }
231
+
232
+ // Middle mouse always pans, and holding space is a temporary navigate — both are the
233
+ // conventions users bring from other canvas tools.
234
+ if (twoMode && (ev.button === 1 || spaceHeld)) { beginPan(ev); return; }
235
+
236
+ var handle = opts.onClaimPointer ? opts.onClaimPointer(ev) : null;
237
+ if (handle) {
238
+ gesture = { mode: 'claim', handle: handle, sx: ev.clientX, sy: ev.clientY, moved: false };
239
+ return;
240
+ }
241
+ beginPan(ev);
242
+ }
243
+
244
+ function onPointerMove(ev) {
245
+ if (!pointers[ev.pointerId]) return;
246
+ pointers[ev.pointerId] = { x: ev.clientX, y: ev.clientY };
247
+ if (!gesture) return;
248
+
249
+ if (gesture.mode === 'pinch') {
250
+ var pts = Object.keys(pointers).map(function (id) { return pointers[id]; });
251
+ if (pts.length < 2) return;
252
+ var k = clamp(gesture.k0 * dist(pts[0], pts[1]) / Math.max(1, gesture.d0), minZoom, maxZoom);
253
+ var m = mid(pts[0], pts[1]);
254
+ var r = host.getBoundingClientRect();
255
+ // keep the world point under the pinch midpoint stationary
256
+ var wx = (gesture.mid0.x - r.left - gesture.cam0.x) / gesture.k0;
257
+ var wy = (gesture.mid0.y - r.top - gesture.cam0.y) / gesture.k0;
258
+ cam.k = k;
259
+ cam.x = (m.x - r.left) - wx * k;
260
+ cam.y = (m.y - r.top) - wy * k;
261
+ applyCam(false);
262
+ return;
263
+ }
264
+
265
+ if (gesture.mode === 'pan') {
266
+ gesture.moved = gesture.moved || Math.abs(ev.clientX - gesture.sx) + Math.abs(ev.clientY - gesture.sy) > 3;
267
+ cam.x = gesture.cam0.x + (ev.clientX - gesture.sx);
268
+ cam.y = gesture.cam0.y + (ev.clientY - gesture.sy);
269
+ applyCam(false);
270
+ return;
271
+ }
272
+
273
+ if (gesture.mode === 'claim') {
274
+ var dx = (ev.clientX - gesture.sx) / cam.k;
275
+ var dy = (ev.clientY - gesture.sy) / cam.k;
276
+ if (!gesture.moved && Math.abs(dx) + Math.abs(dy) < dragThreshold / cam.k) return;
277
+ gesture.moved = true;
278
+ if (gesture.handle.onMove) gesture.handle.onMove(dx, dy, ev, { x: cam.x, y: cam.y, k: cam.k });
279
+ }
280
+ }
281
+
282
+ function onPointerUp(ev) {
283
+ delete pointers[ev.pointerId];
284
+ host.classList.remove(P + '-panning');
285
+ if (!gesture) return;
286
+ var g = gesture;
287
+ // A pinch that lost one finger keeps waiting for the other to lift.
288
+ if (Object.keys(pointers).length > 0 && g.mode === 'pinch') return;
289
+ gesture = null;
290
+ if (g.mode === 'claim') {
291
+ if (g.handle.onEnd) g.handle.onEnd(g.moved, ev);
292
+ } else if (g.mode === 'pan' && !g.moved) {
293
+ if (opts.onTap) opts.onTap(ev);
294
+ }
295
+ }
296
+
297
+ function onWheel(ev) {
298
+ ev.preventDefault();
299
+ var factor = Math.pow(1.0015, -ev.deltaY);
300
+ var k = clamp(cam.k * factor, minZoom, maxZoom);
301
+ var r = host.getBoundingClientRect();
302
+ var wx = (ev.clientX - r.left - cam.x) / cam.k;
303
+ var wy = (ev.clientY - r.top - cam.y) / cam.k;
304
+ cam.k = k;
305
+ cam.x = (ev.clientX - r.left) - wx * k;
306
+ cam.y = (ev.clientY - r.top) - wy * k;
307
+ applyCam(false);
308
+ }
309
+
310
+ function onKeyDown(ev) {
311
+ if (ev.code !== 'Space' || spaceHeld || isTextEntry(ev.target)) return;
312
+ spaceHeld = true;
313
+ host.classList.add(P + '-panning');
314
+ refreshCaptures();
315
+ ev.preventDefault(); // stop the page from scrolling under a held space
316
+ }
317
+ function onKeyUp(ev) {
318
+ if (ev.code === 'Escape') { setMode('navigate'); return; }
319
+ if (ev.code !== 'Space' || !spaceHeld) return;
320
+ spaceHeld = false;
321
+ if (!gesture) host.classList.remove(P + '-panning');
322
+ refreshCaptures();
323
+ }
324
+
325
+ host.addEventListener('pointerdown', onPointerDown);
326
+ host.addEventListener('pointermove', onPointerMove);
327
+ host.addEventListener('pointerup', onPointerUp);
328
+ host.addEventListener('pointercancel', onPointerUp);
329
+ host.addEventListener('wheel', onWheel, { passive: false });
330
+ if (twoMode) {
331
+ global.addEventListener('keydown', onKeyDown);
332
+ global.addEventListener('keyup', onKeyUp);
333
+ host.classList.toggle(P + '-interact', mode === 'interact');
334
+ }
335
+
336
+ // ── camera moves ──────────────────────────────────────────────────────────
337
+ function setCamera(next, animated) {
338
+ if (next.k != null) cam.k = clamp(next.k, minZoom, maxZoom);
339
+ if (next.x != null) cam.x = next.x;
340
+ if (next.y != null) cam.y = next.y;
341
+ applyCam(!!animated);
342
+ }
343
+
344
+ function fit(animated) {
345
+ var b = opts.contentBBox ? opts.contentBBox() : null;
346
+ if (!b || !(b.w > 0) || !(b.h > 0)) return;
347
+ var k = clamp(Math.min(
348
+ (host.clientWidth - fitPadding * 2) / b.w,
349
+ (host.clientHeight - fitPadding * 2) / b.h,
350
+ fitMaxZoom,
351
+ ), minZoom, maxZoom);
352
+ cam.k = k;
353
+ cam.x = (host.clientWidth - b.w * k) / 2 - b.x * k;
354
+ cam.y = (host.clientHeight - b.h * k) / 2 - b.y * k;
355
+ applyCam(animated !== false);
356
+ }
357
+
358
+ /** Centre the camera on a world-space rect {x,y,w,h}, zooming in to at least centerMinZoom. */
359
+ function centerOn(rect, animated) {
360
+ if (!rect) return;
361
+ var k = clamp(Math.max(cam.k, centerMinZoom), minZoom, maxZoom);
362
+ cam.k = k;
363
+ cam.x = host.clientWidth / 2 - (rect.x + rect.w / 2) * k;
364
+ cam.y = host.clientHeight / 2 - (rect.y + rect.h / 2) * k;
365
+ applyCam(animated !== false);
366
+ }
367
+
368
+ function destroy() {
369
+ if (destroyed) return;
370
+ destroyed = true;
371
+ host.removeEventListener('pointerdown', onPointerDown);
372
+ host.removeEventListener('pointermove', onPointerMove);
373
+ host.removeEventListener('pointerup', onPointerUp);
374
+ host.removeEventListener('pointercancel', onPointerUp);
375
+ host.removeEventListener('wheel', onWheel);
376
+ if (twoMode) {
377
+ global.removeEventListener('keydown', onKeyDown);
378
+ global.removeEventListener('keyup', onKeyUp);
379
+ }
380
+ host.classList.remove(P + '-host', P + '-panning', P + '-interact');
381
+ world.remove();
382
+ }
383
+
384
+ applyCam(false);
385
+
386
+ return {
387
+ host: host,
388
+ world: world,
389
+ cam: function () { return { x: cam.x, y: cam.y, k: cam.k }; },
390
+ scale: function () { return cam.k; },
391
+ setCamera: setCamera,
392
+ fit: fit,
393
+ centerOn: centerOn,
394
+ clientToWorld: clientToWorld,
395
+ worldToClient: worldToClient,
396
+ setMode: setMode,
397
+ getMode: function () { return spaceHeld ? 'navigate' : mode; },
398
+ refreshCaptures: refreshCaptures,
399
+ destroy: destroy,
400
+ };
401
+ }
402
+
403
+ AIMEAT.viewport = { create: create, VERSION: '1.0.4' };
404
+
405
+ })(typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : this);
@@ -0,0 +1,100 @@
1
+ apiVersion: cortex.aimeat.org/v1
2
+ kind: Extension
3
+ metadata:
4
+ name: aimeat-viewport
5
+ namespace: aimeat
6
+ description: "The camera primitive for movable surfaces: pan, zoom-at-cursor, pinch, drag delegation, animated fit/centerOn, and the navigate/interact capture-overlay model that keeps panning working over iframes. Owns the camera and nothing about content — the consumer answers what is draggable via a hit-test delegate. Zero dependencies, theme-agnostic, reduced-motion safe."
7
+ author: AIMEAT
8
+ tags: [viewport, camera, canvas, pan, zoom, pinch, surface, ui]
9
+ labels:
10
+ domain: canvas
11
+
12
+ spec:
13
+ version: "1.0.4"
14
+ license: MIT
15
+ components:
16
+ - type: prompt
17
+ name: viewport-assistant
18
+ content: |
19
+ You are a canvas-surface assistant for an AIMEAT app. The user's node is at {{node_url}}.
20
+
21
+ aimeat-viewport is the CAMERA ONLY. Reach for it when the app needs a movable surface of
22
+ its OWN content — arbitrary children, the app's own layout, pan/zoom/pinch. If the app
23
+ wants an auto-laid-out graph to read use aimeat-dag; a user-drawn node-and-wire diagram
24
+ use aimeat-flow; freehand drawing use aimeat-canvas; a static text-defined diagram use
25
+ mermaid. Choosing this pack for those means reimplementing what they already do.
26
+
27
+ Include ONE tag:
28
+ <script src="{{node_url}}/v1/cortex/aimeat-viewport/libs/aimeat-viewport.js"></script>
29
+
30
+ API:
31
+
32
+ const vp = AIMEAT.viewport.create(elOrSelector, {
33
+ classPrefix?: 'av', // host/world/panning/capture class prefix
34
+ minZoom?: 0.2, maxZoom?: 2.5,
35
+ initial?: { x: 40, y: 40, k: 1 },
36
+ fitPadding?: 36, fitMaxZoom?: 1.4, centerMinZoom?: 1, dragThreshold?: 4,
37
+ contentBBox?: () => ({ x, y, w, h }), // world units; fit() asks for this
38
+ onClaimPointer?: (ev) => null | { // null => the viewport pans
39
+ onMove(worldDx, worldDy, ev, cam), onEnd(movedPastThreshold, ev) },
40
+ onTap?: (ev) => {}, // pan gesture that never moved
41
+ onCameraChange?: (cam) => {},
42
+ captureSelector?: '[data-frame]', // opts in to the navigate/interact model
43
+ mode?: 'navigate' | 'interact',
44
+ })
45
+
46
+ vp.world // append your content here; position it in WORLD coordinates
47
+ vp.cam() -> {x,y,k} // copy; vp.scale() -> k
48
+ vp.setCamera({x,y,k}, animated) · vp.fit(animated) · vp.centerOn({x,y,w,h}, animated)
49
+ vp.clientToWorld(cx, cy) · vp.worldToClient(wx, wy)
50
+ vp.setMode('navigate'|'interact') · vp.getMode() · vp.refreshCaptures() · vp.destroy()
51
+
52
+ THE HOST ELEMENT MUST HAVE A SIZE (e.g. style="height:480px" or position:fixed;inset:0).
53
+ A zero-height host silently swallows every pointer event — this is the single most common
54
+ mistake with canvas packs.
55
+
56
+ The viewport supplies only STRUCTURAL css (positioning, transform, cursor, touch-action).
57
+ The app owns cosmetics — size, background, border-radius — so the two never fight.
58
+
59
+ THE POINTER-CLAIM DELEGATE is the whole content contract: on pointerdown the viewport asks
60
+ onClaimPointer whether you claim this event. Return a drag handle and you drive the drag
61
+ (deltas arrive in WORLD units, already divided by the zoom); return null and the viewport
62
+ pans. Keep any "did it actually move" state in the handle closure when your own rule for
63
+ that differs from the viewport's threshold.
64
+
65
+ NAVIGATE VS INTERACT — only needed when children swallow pointer events (iframes, or
66
+ anything with its own handlers). Pass captureSelector and in navigate mode each matching
67
+ child gets a transparent overlay so panning works over it; setMode('interact') removes the
68
+ overlays so the child behaves normally (forms, scroll, microphone). Holding space is a
69
+ temporary navigate, middle-mouse always pans, Escape returns to navigate. Call
70
+ refreshCaptures() after adding or removing children. Omit captureSelector entirely and no
71
+ window listeners are attached at all — plain DOM children you render yourself need none of
72
+ this.
73
+
74
+ Persist the camera from onCameraChange to an app memory key and pass it back as `initial`
75
+ on the next mount, the same way aimeat-dag persists node positions.
76
+ variables:
77
+ - "{{node_url}}"
78
+
79
+ - type: lib
80
+ name: aimeat-viewport
81
+ filename: aimeat-viewport.js
82
+ exports:
83
+ - create
84
+ api_surface: |
85
+ AIMEAT.viewport.create(elOrSelector, { classPrefix?, minZoom?, maxZoom?, initial?,
86
+ fitPadding?, fitMaxZoom?, centerMinZoom?, dragThreshold?, contentBBox?, onClaimPointer?,
87
+ onTap?, onCameraChange?, captureSelector?, mode? })
88
+ -> { host, world, cam(), scale(), setCamera(cam, animated), fit(animated),
89
+ centerOn(rect, animated), clientToWorld(cx,cy), worldToClient(wx,wy),
90
+ setMode('navigate'|'interact'), getMode(), refreshCaptures(), destroy() }
91
+
92
+ The consumer appends content to `world` in world coordinates and answers onClaimPointer
93
+ for anything draggable. Gestures: drag to pan, wheel to zoom at the cursor, two-finger
94
+ pinch to zoom about the midpoint. With captureSelector set, children that swallow pointer
95
+ events get a transparent overlay in navigate mode; space-hold, middle-mouse and Escape
96
+ behave as in other canvas tools.
97
+
98
+ Zero dependencies. Structural CSS only (the app owns cosmetics).
99
+ prefers-reduced-motion safe. Idempotent namespace guard: aimeat-dag embeds a
100
+ byte-identical copy so it can ship as a single script tag, and loading both is safe.
@@ -528,7 +528,7 @@
528
528
  box-shadow: var(--shadow-md);
529
529
  }
530
530
  .inbox-row:hover .inbox-bubble-actions { opacity: 1; pointer-events: auto; }
531
- /* Touch devices have no hover — the per-message actions (↩ reply, ⭐, 🔗, 📓, ✨) would be unreachable.
531
+ /* Touch devices have no hover — the per-message actions (↩ reply, ⧉ copy, ⭐, 🔗, 📓, ✨) would be unreachable.
532
532
  Reveal them permanently there so a phone user can actually reply to / act on a message by tapping. */
533
533
  @media (hover: none) {
534
534
  .inbox-bubble-actions { opacity: 1; pointer-events: auto; }
@@ -4,6 +4,8 @@
4
4
  * wallet, memory, agents, extensions, packages, knowledge, generator, and
5
5
  * edit panels. Consumes theme.css tokens so it flips with dark/light mode.
6
6
  * @version-history
7
+ * v2.17.0 — 2026-07-25 — .ag-scope-toggle: the Connected Apps scope count is now the disclosure
8
+ * button for its badge list (button reset so it still renders as a plain .badge).
7
9
  * v2.16.2 — 2026-07-21 — App-shell scroll model (theme.css v1.24.0): .pf-sidebar sticks to top:0 of
8
10
  * the new .page-content scroll region (was top:var(--nav-height) against the window) and caps at
9
11
  * calc(100dvh − nav-height) so its nav list scrolls without a header-height gap.
@@ -226,6 +228,9 @@
226
228
  .pf .wallet-psp{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1.5rem}
227
229
  .pf .wallet-psp-row{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}
228
230
  .pf .wallet-psp-input{flex:1;min-width:240px}
231
+ /* Payout rails: the chips that say WHICH rail a sale settles on (fiat via provider vs USDC on-chain). */
232
+ .pf .wallet-rail-row{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}
233
+ .pf .wallet-rail-row code{font-size:.8em;word-break:break-all}
229
234
  .pf .pf-psp-chip{display:inline-block;padding:.1rem .55rem;border-radius:var(--radius-full,999px);border:1px solid var(--border);font-size:.72rem;width:fit-content}
230
235
  .pf .pf-psp-chip--ok{color:var(--success,#22c55e);border-color:var(--success,#22c55e)}
231
236
  .pf .pf-psp-chip--warn{color:var(--warning,#f59e0b);border-color:var(--warning,#f59e0b)}
@@ -1615,6 +1620,10 @@
1615
1620
 
1616
1621
  /* ── Access tab ── */
1617
1622
  .pf .access-mono { font-family: monospace; font-size: .75rem; word-break: break-all; color: var(--muted); }
1623
+ /* Scope count doubles as the disclosure control for the badge list it summarises: button reset so a
1624
+ <button> carrying .badge looks exactly like the static badges elsewhere in the card. */
1625
+ .pf .ag-scope-toggle { border: 0; font-family: inherit; font-size: .66rem; font-weight: 600; cursor: pointer; }
1626
+ .pf .ag-scope-toggle:hover { filter: brightness(1.1); }
1618
1627
  .pf .access-key-blur { filter: blur(4px); transition: filter .2s; }
1619
1628
  .pf .access-key-blur.revealed { filter: none; }
1620
1629
  .pf .access-card-warn { border-color: var(--warn); cursor: pointer; }