aimeat 1.35.0 → 1.37.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 (296) hide show
  1. package/dist/.env.example +31 -0
  2. package/dist/locales/en.json +192 -27
  3. package/dist/locales/fi.json +192 -27
  4. package/dist/public/components/Markdown.js +9 -0
  5. package/dist/public/components/MemoryEmbed.js +151 -0
  6. package/dist/public/components/Mermaid.js +4 -1
  7. package/dist/public/components/NotificationBell.js +45 -19
  8. package/dist/public/css/components/markdown.css +15 -0
  9. package/dist/public/css/views/agents-detail.css +17 -0
  10. package/dist/public/css/views/portfolio.css +51 -0
  11. package/dist/public/css/views/profile.css +31 -0
  12. package/dist/public/js/services/agents.js +9 -0
  13. package/dist/public/js/services/organisms.js +37 -1
  14. package/dist/public/llms-template.txt +278 -0
  15. package/dist/public/spa.html +39 -2
  16. package/dist/public/sw.js +50 -34
  17. package/dist/public/views/my-company.js +13 -1
  18. package/dist/public/views/portfolio.js +267 -44
  19. package/dist/public/views/profile/agents/agent-card.js +4 -0
  20. package/dist/public/views/profile/agents/tab-contracts.js +112 -0
  21. package/dist/public/views/profile/landing-page.js +10 -1
  22. package/dist/public/views/profile/memory-tab.js +6 -2
  23. package/dist/public/views/profile/notifications-tab.js +9 -1
  24. package/dist/public/views/profile/organisms/home.js +23 -3
  25. package/dist/public/views/profile/organisms/participants-panel.js +89 -17
  26. package/dist/public/views/profile/organisms/workspace-apps.js +130 -0
  27. package/dist/public/views/profile/organisms/workspace.js +5 -0
  28. package/dist/public/views/profile/organisms-tab.js +1 -1
  29. package/dist/public/views/secretary.js +13 -0
  30. package/dist/scripts/archive-stale-versions.d.ts +33 -0
  31. package/dist/scripts/archive-stale-versions.d.ts.map +1 -0
  32. package/dist/scripts/archive-stale-versions.js +278 -0
  33. package/dist/scripts/archive-stale-versions.js.map +1 -0
  34. package/dist/src/cli/connect/mcp/tools/agent-management.d.ts +4 -1
  35. package/dist/src/cli/connect/mcp/tools/agent-management.d.ts.map +1 -1
  36. package/dist/src/cli/connect/mcp/tools/agent-management.js +1 -1
  37. package/dist/src/cli/connect/mcp/tools/agent-management.js.map +1 -1
  38. package/dist/src/cli/init-wizard.d.ts.map +1 -1
  39. package/dist/src/cli/init-wizard.js +32 -0
  40. package/dist/src/cli/init-wizard.js.map +1 -1
  41. package/dist/src/config.d.ts +24 -0
  42. package/dist/src/config.d.ts.map +1 -1
  43. package/dist/src/config.js +21 -0
  44. package/dist/src/config.js.map +1 -1
  45. package/dist/src/data/aimeat-iam-package.d.ts +10 -2
  46. package/dist/src/data/aimeat-iam-package.d.ts.map +1 -1
  47. package/dist/src/data/aimeat-iam-package.js +39 -10
  48. package/dist/src/data/aimeat-iam-package.js.map +1 -1
  49. package/dist/src/generated/api-types.d.ts +802 -60
  50. package/dist/src/generated/api-types.d.ts.map +1 -1
  51. package/dist/src/generated/prisma-postgres/edge.js +5 -3
  52. package/dist/src/generated/prisma-postgres/index-browser.js +2 -0
  53. package/dist/src/generated/prisma-postgres/index.d.ts +54 -2
  54. package/dist/src/generated/prisma-postgres/index.js +5 -3
  55. package/dist/src/generated/prisma-postgres/package.json +1 -1
  56. package/dist/src/generated/prisma-postgres/schema.prisma +2 -0
  57. package/dist/src/generated/prisma-postgres/wasm.js +5 -3
  58. package/dist/src/mcp/annotations.d.ts.map +1 -1
  59. package/dist/src/mcp/annotations.js +1 -0
  60. package/dist/src/mcp/annotations.js.map +1 -1
  61. package/dist/src/mcp/catalog/definitions.d.ts +3 -0
  62. package/dist/src/mcp/catalog/definitions.d.ts.map +1 -1
  63. package/dist/src/mcp/catalog/definitions.js +21 -7
  64. package/dist/src/mcp/catalog/definitions.js.map +1 -1
  65. package/dist/src/mcp/catalog/surfaces.js +1 -1
  66. package/dist/src/mcp/catalog/surfaces.js.map +1 -1
  67. package/dist/src/mcp/core.js +1 -1
  68. package/dist/src/mcp/core.js.map +1 -1
  69. package/dist/src/mcp/extensions.d.ts.map +1 -1
  70. package/dist/src/mcp/extensions.js +21 -0
  71. package/dist/src/mcp/extensions.js.map +1 -1
  72. package/dist/src/mcp/memory-extended.js +1 -1
  73. package/dist/src/mcp/memory-extended.js.map +1 -1
  74. package/dist/src/mcp/organisms.d.ts +1 -0
  75. package/dist/src/mcp/organisms.d.ts.map +1 -1
  76. package/dist/src/mcp/organisms.js +23 -6
  77. package/dist/src/mcp/organisms.js.map +1 -1
  78. package/dist/src/mcp/workspaces.d.ts +7 -0
  79. package/dist/src/mcp/workspaces.d.ts.map +1 -1
  80. package/dist/src/mcp/workspaces.js +23 -5
  81. package/dist/src/mcp/workspaces.js.map +1 -1
  82. package/dist/src/middleware/subdomain.d.ts +9 -0
  83. package/dist/src/middleware/subdomain.d.ts.map +1 -1
  84. package/dist/src/middleware/subdomain.js +24 -3
  85. package/dist/src/middleware/subdomain.js.map +1 -1
  86. package/dist/src/models/schemas.d.ts +2 -0
  87. package/dist/src/models/schemas.d.ts.map +1 -1
  88. package/dist/src/models/schemas.js +2 -2
  89. package/dist/src/models/schemas.js.map +1 -1
  90. package/dist/src/routes/admin-features.js +1 -1
  91. package/dist/src/routes/admin-features.js.map +1 -1
  92. package/dist/src/routes/agent-onboarding.d.ts.map +1 -1
  93. package/dist/src/routes/agent-onboarding.js +44 -7
  94. package/dist/src/routes/agent-onboarding.js.map +1 -1
  95. package/dist/src/routes/agents.d.ts +8 -0
  96. package/dist/src/routes/agents.d.ts.map +1 -1
  97. package/dist/src/routes/agents.js +91 -5
  98. package/dist/src/routes/agents.js.map +1 -1
  99. package/dist/src/routes/app-grants.d.ts +5 -0
  100. package/dist/src/routes/app-grants.d.ts.map +1 -1
  101. package/dist/src/routes/app-grants.js +52 -20
  102. package/dist/src/routes/app-grants.js.map +1 -1
  103. package/dist/src/routes/boards.d.ts.map +1 -1
  104. package/dist/src/routes/boards.js +4 -1
  105. package/dist/src/routes/boards.js.map +1 -1
  106. package/dist/src/routes/bootstrap.d.ts +2 -0
  107. package/dist/src/routes/bootstrap.d.ts.map +1 -1
  108. package/dist/src/routes/bootstrap.js +5 -0
  109. package/dist/src/routes/bootstrap.js.map +1 -1
  110. package/dist/src/routes/capabilities.d.ts.map +1 -1
  111. package/dist/src/routes/capabilities.js +4 -1
  112. package/dist/src/routes/capabilities.js.map +1 -1
  113. package/dist/src/routes/catalogue.d.ts.map +1 -1
  114. package/dist/src/routes/catalogue.js +5 -4
  115. package/dist/src/routes/catalogue.js.map +1 -1
  116. package/dist/src/routes/extensions.d.ts.map +1 -1
  117. package/dist/src/routes/extensions.js +11 -0
  118. package/dist/src/routes/extensions.js.map +1 -1
  119. package/dist/src/routes/ghii.d.ts.map +1 -1
  120. package/dist/src/routes/ghii.js +65 -17
  121. package/dist/src/routes/ghii.js.map +1 -1
  122. package/dist/src/routes/lib-editor.d.ts +26 -0
  123. package/dist/src/routes/lib-editor.d.ts.map +1 -0
  124. package/dist/src/routes/lib-editor.js +215 -0
  125. package/dist/src/routes/lib-editor.js.map +1 -0
  126. package/dist/src/routes/lib-markdown.d.ts +16 -1
  127. package/dist/src/routes/lib-markdown.d.ts.map +1 -1
  128. package/dist/src/routes/lib-markdown.js +281 -2
  129. package/dist/src/routes/lib-markdown.js.map +1 -1
  130. package/dist/src/routes/lib-organism.d.ts +28 -0
  131. package/dist/src/routes/lib-organism.d.ts.map +1 -0
  132. package/dist/src/routes/lib-organism.js +298 -0
  133. package/dist/src/routes/lib-organism.js.map +1 -0
  134. package/dist/src/routes/lib-portfolio-standalone.d.ts +22 -0
  135. package/dist/src/routes/lib-portfolio-standalone.d.ts.map +1 -0
  136. package/dist/src/routes/lib-portfolio-standalone.js +68 -0
  137. package/dist/src/routes/lib-portfolio-standalone.js.map +1 -0
  138. package/dist/src/routes/libs.d.ts +18 -0
  139. package/dist/src/routes/libs.d.ts.map +1 -1
  140. package/dist/src/routes/libs.js +116 -18
  141. package/dist/src/routes/libs.js.map +1 -1
  142. package/dist/src/routes/memory.d.ts +3 -0
  143. package/dist/src/routes/memory.d.ts.map +1 -1
  144. package/dist/src/routes/memory.js +58 -4
  145. package/dist/src/routes/memory.js.map +1 -1
  146. package/dist/src/routes/notifications.d.ts +5 -1
  147. package/dist/src/routes/notifications.d.ts.map +1 -1
  148. package/dist/src/routes/notifications.js +68 -3
  149. package/dist/src/routes/notifications.js.map +1 -1
  150. package/dist/src/routes/oauth-login.d.ts +26 -21
  151. package/dist/src/routes/oauth-login.d.ts.map +1 -1
  152. package/dist/src/routes/oauth-login.js +257 -229
  153. package/dist/src/routes/oauth-login.js.map +1 -1
  154. package/dist/src/routes/openrouter.d.ts +3 -0
  155. package/dist/src/routes/openrouter.d.ts.map +1 -1
  156. package/dist/src/routes/openrouter.js +10 -5
  157. package/dist/src/routes/openrouter.js.map +1 -1
  158. package/dist/src/routes/organisms.d.ts +6 -0
  159. package/dist/src/routes/organisms.d.ts.map +1 -1
  160. package/dist/src/routes/organisms.js +203 -16
  161. package/dist/src/routes/organisms.js.map +1 -1
  162. package/dist/src/routes/owners.d.ts.map +1 -1
  163. package/dist/src/routes/owners.js +12 -8
  164. package/dist/src/routes/owners.js.map +1 -1
  165. package/dist/src/routes/portfolio.d.ts +41 -1
  166. package/dist/src/routes/portfolio.d.ts.map +1 -1
  167. package/dist/src/routes/portfolio.js +94 -30
  168. package/dist/src/routes/portfolio.js.map +1 -1
  169. package/dist/src/routes/push.d.ts +15 -0
  170. package/dist/src/routes/push.d.ts.map +1 -1
  171. package/dist/src/routes/push.js +16 -1
  172. package/dist/src/routes/push.js.map +1 -1
  173. package/dist/src/routes/site.d.ts +2 -0
  174. package/dist/src/routes/site.d.ts.map +1 -1
  175. package/dist/src/routes/site.js +10 -2
  176. package/dist/src/routes/site.js.map +1 -1
  177. package/dist/src/routes/subdomains.d.ts +5 -0
  178. package/dist/src/routes/subdomains.d.ts.map +1 -1
  179. package/dist/src/routes/subdomains.js +56 -0
  180. package/dist/src/routes/subdomains.js.map +1 -1
  181. package/dist/src/server-bootstrap/routes-loader.d.ts.map +1 -1
  182. package/dist/src/server-bootstrap/routes-loader.js +10 -15
  183. package/dist/src/server-bootstrap/routes-loader.js.map +1 -1
  184. package/dist/src/server-bootstrap/static-files.d.ts.map +1 -1
  185. package/dist/src/server-bootstrap/static-files.js +9 -4
  186. package/dist/src/server-bootstrap/static-files.js.map +1 -1
  187. package/dist/src/services/access-guard.d.ts.map +1 -1
  188. package/dist/src/services/access-guard.js +7 -0
  189. package/dist/src/services/access-guard.js.map +1 -1
  190. package/dist/src/services/ai-completion.d.ts +2 -0
  191. package/dist/src/services/ai-completion.d.ts.map +1 -1
  192. package/dist/src/services/ai-completion.js +2 -1
  193. package/dist/src/services/ai-completion.js.map +1 -1
  194. package/dist/src/services/config-schema.d.ts.map +1 -1
  195. package/dist/src/services/config-schema.js +2 -0
  196. package/dist/src/services/config-schema.js.map +1 -1
  197. package/dist/src/services/ecosystem-access.d.ts +24 -8
  198. package/dist/src/services/ecosystem-access.d.ts.map +1 -1
  199. package/dist/src/services/ecosystem-access.js +27 -5
  200. package/dist/src/services/ecosystem-access.js.map +1 -1
  201. package/dist/src/services/generator-autopilot.d.ts +2 -0
  202. package/dist/src/services/generator-autopilot.d.ts.map +1 -1
  203. package/dist/src/services/generator-autopilot.js +3 -1
  204. package/dist/src/services/generator-autopilot.js.map +1 -1
  205. package/dist/src/services/iam/app-commands.d.ts +75 -0
  206. package/dist/src/services/iam/app-commands.d.ts.map +1 -0
  207. package/dist/src/services/iam/app-commands.js +55 -0
  208. package/dist/src/services/iam/app-commands.js.map +1 -0
  209. package/dist/src/services/iam/define-app-iam.d.ts +45 -0
  210. package/dist/src/services/iam/define-app-iam.d.ts.map +1 -0
  211. package/dist/src/services/iam/define-app-iam.js +75 -0
  212. package/dist/src/services/iam/define-app-iam.js.map +1 -0
  213. package/dist/src/services/iam/model.d.ts +113 -0
  214. package/dist/src/services/iam/model.d.ts.map +1 -0
  215. package/dist/src/services/iam/model.js +115 -0
  216. package/dist/src/services/iam/model.js.map +1 -0
  217. package/dist/src/services/mailbox-notification.d.ts +1 -0
  218. package/dist/src/services/mailbox-notification.d.ts.map +1 -1
  219. package/dist/src/services/mailbox-notification.js +3 -0
  220. package/dist/src/services/mailbox-notification.js.map +1 -1
  221. package/dist/src/services/notebook-ai.d.ts +2 -0
  222. package/dist/src/services/notebook-ai.d.ts.map +1 -1
  223. package/dist/src/services/notebook-ai.js +1 -1
  224. package/dist/src/services/notebook-ai.js.map +1 -1
  225. package/dist/src/services/notify.d.ts +11 -1
  226. package/dist/src/services/notify.d.ts.map +1 -1
  227. package/dist/src/services/notify.js +39 -2
  228. package/dist/src/services/notify.js.map +1 -1
  229. package/dist/src/services/oidc-providers.d.ts +94 -0
  230. package/dist/src/services/oidc-providers.d.ts.map +1 -0
  231. package/dist/src/services/oidc-providers.js +181 -0
  232. package/dist/src/services/oidc-providers.js.map +1 -0
  233. package/dist/src/services/organism-privacy.d.ts +46 -0
  234. package/dist/src/services/organism-privacy.d.ts.map +1 -0
  235. package/dist/src/services/organism-privacy.js +42 -0
  236. package/dist/src/services/organism-privacy.js.map +1 -0
  237. package/dist/src/services/organism-template.d.ts.map +1 -1
  238. package/dist/src/services/organism-template.js +3 -1
  239. package/dist/src/services/organism-template.js.map +1 -1
  240. package/dist/src/services/prompt-defaults.d.ts +2 -0
  241. package/dist/src/services/prompt-defaults.d.ts.map +1 -1
  242. package/dist/src/services/prompt-defaults.js +5 -0
  243. package/dist/src/services/prompt-defaults.js.map +1 -1
  244. package/dist/src/services/scheduler.d.ts.map +1 -1
  245. package/dist/src/services/scheduler.js +16 -4
  246. package/dist/src/services/scheduler.js.map +1 -1
  247. package/dist/src/services/skill-bundle/generator.d.ts +2 -0
  248. package/dist/src/services/skill-bundle/generator.d.ts.map +1 -1
  249. package/dist/src/services/skill-bundle/generator.js +3 -1
  250. package/dist/src/services/skill-bundle/generator.js.map +1 -1
  251. package/dist/src/services/workspace-access.d.ts +2 -0
  252. package/dist/src/services/workspace-access.d.ts.map +1 -1
  253. package/dist/src/services/workspace-access.js +20 -8
  254. package/dist/src/services/workspace-access.js.map +1 -1
  255. package/dist/src/services/workspace-engagements.d.ts +65 -0
  256. package/dist/src/services/workspace-engagements.d.ts.map +1 -0
  257. package/dist/src/services/workspace-engagements.js +92 -0
  258. package/dist/src/services/workspace-engagements.js.map +1 -0
  259. package/dist/src/services/workspace-meta.d.ts +9 -2
  260. package/dist/src/services/workspace-meta.d.ts.map +1 -1
  261. package/dist/src/services/workspace-meta.js +22 -2
  262. package/dist/src/services/workspace-meta.js.map +1 -1
  263. package/dist/src/storage/interface.d.ts +10 -2
  264. package/dist/src/storage/interface.d.ts.map +1 -1
  265. package/dist/src/storage/interface.js.map +1 -1
  266. package/dist/src/storage/providers/mongodb/index.d.ts +1 -0
  267. package/dist/src/storage/providers/mongodb/index.d.ts.map +1 -1
  268. package/dist/src/storage/providers/mongodb/index.js +29 -2
  269. package/dist/src/storage/providers/mongodb/index.js.map +1 -1
  270. package/dist/src/storage/providers/sqlite/index.d.ts +1 -0
  271. package/dist/src/storage/providers/sqlite/index.d.ts.map +1 -1
  272. package/dist/src/storage/providers/sqlite/index.js +23 -8
  273. package/dist/src/storage/providers/sqlite/index.js.map +1 -1
  274. package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
  275. package/dist/src/storage/providers/sqlite/schema.js +9 -0
  276. package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
  277. package/dist/src/storage/repositories/identity.repository.d.ts +2 -0
  278. package/dist/src/storage/repositories/identity.repository.d.ts.map +1 -1
  279. package/dist/src/utils/env-config.d.ts.map +1 -1
  280. package/dist/src/utils/env-config.js +23 -0
  281. package/dist/src/utils/env-config.js.map +1 -1
  282. package/dist/src/utils/env-validator.d.ts.map +1 -1
  283. package/dist/src/utils/env-validator.js +8 -0
  284. package/dist/src/utils/env-validator.js.map +1 -1
  285. package/dist/src/utils/node-descriptor.d.ts.map +1 -1
  286. package/dist/src/utils/node-descriptor.js +1 -0
  287. package/dist/src/utils/node-descriptor.js.map +1 -1
  288. package/dist/static/app-catalog.html +8 -2
  289. package/dist/static/icons/badge-96.png +0 -0
  290. package/dist/static/icons/icon-192.png +0 -0
  291. package/dist/static/icons/icon-512.png +0 -0
  292. package/dist/static/manifest.json +19 -17
  293. package/dist/static/sw.js +13 -11
  294. package/package.json +3 -1
  295. package/prisma/schema.postgres.prisma +2 -0
  296. package/prisma/schema.prisma +2 -0
@@ -4,11 +4,17 @@
4
4
  * in-app notifications (GET /v1/notifications). Opening the dropdown marks them read. Refreshes on
5
5
  * the SSE `aimeat-live-update` event and a 45s poll, so a workspace-access approval (or request)
6
6
  * surfaces without the user having to guess. Self-contained: reads the JWT from window.AIMEAT.auth.
7
- * @structure NotificationBell({ t, onNavigate }) — t = i18n fn, onNavigate(path) = SPA navigate.
7
+ * Exports openNotificationLink() — the ONE translation from a notification link/URL into SPA
8
+ * navigation, shared by the bell dropdown and the service-worker push-click handler (spa.html).
9
+ * @structure
10
+ * - openNotificationLink(link, onNavigate) — deep-link a bell/push notification target
11
+ * - NotificationBell({ t, onNavigate }) — t = i18n fn, onNavigate(path) = SPA navigate.
8
12
  * @usage import { NotificationBell } from '/components/NotificationBell.js'; html`<${NotificationBell} t=${t} onNavigate=${navigate} />`
9
13
  * @version-history
10
14
  * v1.0.0 — 2026-06-08 — Initial: header bell + dropdown + mark-read for the notification inbox.
11
15
  * v1.0.1 — 2026-06-19 — JSDoc type annotations for frontend type-checking
16
+ * v1.1.0 — 2026-07-02 — Extract openNotificationLink() so push-notification clicks reuse the
17
+ * same deep-link translation as bell clicks (supports both '#hash' and '?tab=' forms).
12
18
  */
13
19
  import { h } from 'preact';
14
20
  import { useState, useEffect, useRef, useCallback } from 'preact/hooks';
@@ -36,6 +42,43 @@ function relTime(iso) {
36
42
  } catch { return ''; }
37
43
  }
38
44
 
45
+ /**
46
+ * Deep-link a notification target into the SPA. Handles both notification link vocabularies:
47
+ * the bell's hash form ('/v1/profile#organisms', '/v1/profile#inbox/<conversationId>') and the
48
+ * push URL form ('/v1/profile?tab=messages#inbox/<id>'). Profile targets switch tabs in place:
49
+ * prime sessionStorage so a cold profile mount opens the tab, navigate, then dispatch
50
+ * aimeat-open-tab so an already-mounted profile reacts too. Anything else just navigates.
51
+ * @param {string} link
52
+ * @param {(path: string) => void} [onNavigate]
53
+ */
54
+ export function openNotificationLink(link, onNavigate) {
55
+ if (!link) return;
56
+ let url;
57
+ try { url = new URL(link, window.location.origin); } catch { return; }
58
+ if (url.origin === window.location.origin && url.pathname === '/v1/profile') {
59
+ const hashMatch = /^#([a-z]+)(?:\/(.+))?$/i.exec(url.hash || '');
60
+ const rawTab = url.searchParams.get('tab') || (hashMatch ? hashMatch[1] : '');
61
+ if (rawTab) {
62
+ const tabId = rawTab.toLowerCase() === 'inbox' ? 'messages' : rawTab;
63
+ const rest = hashMatch ? (hashMatch[2] || '') : '';
64
+ try {
65
+ sessionStorage.setItem('aimeat-profile-tab', JSON.stringify({ tabId, slot: 'main' }));
66
+ if (tabId === 'messages' && rest) sessionStorage.setItem('aimeat.inbox.open', rest);
67
+ } catch { /* noop */ }
68
+ if (onNavigate) onNavigate('/v1/profile');
69
+ setTimeout(() => window.dispatchEvent(new CustomEvent('aimeat-open-tab', { detail: { tabId } })), 60);
70
+ return;
71
+ }
72
+ }
73
+ // App pages ('/v1/apps/<owner>/<file>') and other non-SPA documents are served by the
74
+ // backend (and may 301 to the isolated app origin) — a hard navigation, not SPA routing.
75
+ if (/^\/v1\/apps\//.test(url.pathname) || /\.html$/i.test(url.pathname)) {
76
+ window.location.assign(url.pathname + url.search + url.hash);
77
+ return;
78
+ }
79
+ if (onNavigate) onNavigate(url.pathname + url.search + url.hash);
80
+ }
81
+
39
82
  export function NotificationBell({ t, onNavigate }) {
40
83
  const tr = (k, fb) => (t ? t(k) : null) || fb;
41
84
  const [items, setItems] = useState([]);
@@ -72,24 +115,7 @@ export function NotificationBell({ t, onNavigate }) {
72
115
  };
73
116
  const clickNotif = (n) => {
74
117
  setOpen(false);
75
- if (!n.link) return;
76
- // Profile tab deep-links carry a #hash that the SPA router ignores (it matches on pathname
77
- // only). Translate them into the profile's tab-open mechanism: prime sessionStorage so a cold
78
- // mount opens the tab, navigate to the profile, then dispatch aimeat-open-tab so an
79
- // already-mounted profile reacts too. `#inbox[/<conversationId|requests>]` opens that thread.
80
- const m = /\/v1\/profile#([a-z]+)(?:\/(.+))?$/i.exec(n.link);
81
- if (m) {
82
- const tabId = m[1] === 'inbox' ? 'messages' : m[1];
83
- const rest = m[2] || '';
84
- try {
85
- sessionStorage.setItem('aimeat-profile-tab', JSON.stringify({ tabId, slot: 'main' }));
86
- if (tabId === 'messages' && rest) sessionStorage.setItem('aimeat.inbox.open', rest);
87
- } catch { /* noop */ }
88
- if (onNavigate) onNavigate('/v1/profile');
89
- setTimeout(() => window.dispatchEvent(new CustomEvent('aimeat-open-tab', { detail: { tabId } })), 60);
90
- return;
91
- }
92
- if (onNavigate) onNavigate(n.link);
118
+ openNotificationLink(n.link, onNavigate);
93
119
  };
94
120
 
95
121
  return html`
@@ -8,6 +8,8 @@
8
8
  * all colors/spacing via theme.css variables.
9
9
  * @version-history
10
10
  * v1.0.0 — 2026-06-19 — Initial: extracted the per-view duplicates into one global component sheet.
11
+ * v1.1.0 — 2026-07-02 — Styles for the live memory embed (aimeat-memory fence → MemoryEmbed): .md-mem
12
+ * container/header/refresh/table/notes.
11
13
  */
12
14
 
13
15
  .md-body {
@@ -65,3 +67,16 @@
65
67
  .md-body .md-img { max-width: 100%; height: auto; border-radius: 6px; margin: 0.6em 0; }
66
68
  .md-body hr,
67
69
  .md-body .md-hr { border: none; border-top: 1px solid var(--border); margin: 1.6em 0; }
70
+
71
+ /* ── Live memory embed (```aimeat-memory fence → components/MemoryEmbed.js) ── */
72
+ .md-body .md-mem { border: 1px solid var(--border); border-radius: 8px; padding: 0.5em 0.8em 0.7em; margin: 1em 0; background: var(--bg-dim); }
73
+ .md-body .md-mem-head { display: flex; align-items: center; gap: 0.6em; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.35em; }
74
+ .md-body .md-mem-title { font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace); overflow-wrap: anywhere; flex: 1; }
75
+ .md-body .md-mem-upd { white-space: nowrap; }
76
+ .md-body .md-mem-refresh { border: none; background: transparent; color: var(--muted); cursor: pointer; border-radius: 4px; padding: 0 0.3em; font-size: 0.9rem; line-height: 1.4; }
77
+ .md-body .md-mem-refresh:hover { color: var(--text); background: var(--surface, var(--card)); }
78
+ .md-body .md-mem table { margin: 0.3em 0 0; background: transparent; }
79
+ .md-body .md-mem-note { color: var(--muted); font-size: 0.88rem; padding: 0.2em 0; }
80
+ .md-body .md-mem-err { color: var(--warning, var(--muted)); }
81
+ .md-body .md-mem-more { color: var(--muted); font-size: 0.78rem; margin-top: 0.3em; }
82
+ .md-body .md-mem-value { font-size: 0.95rem; white-space: pre-wrap; overflow-wrap: anywhere; }
@@ -4,6 +4,8 @@
4
4
  * Uses agd- prefix to avoid collisions with other profile styles.
5
5
  * All colors use CSS variables from theme.css.
6
6
  * @version-history
7
+ * v1.14.0 -- 2026-07-03 -- Add Contracts sub-tab styles (.pf-agd-contracts, .agc-caps, .agc-list,
8
+ * .agc-row, .agc-where, .agc-org, .agc-since) — agent-side contract-engagement visibility.
7
9
  * v1.13.0 -- 2026-06-24 -- Secretary P5 (S-A): add .pf-agd-badge--specialist (specialist agent type badge).
8
10
  * v1.12.0 -- 2026-06-22 -- Add .pf-agd-capwrap rule so the capabilities summary
9
11
  * ("N tools · N skills · N langs") gets the card content inset (1rem) instead of
@@ -3646,3 +3648,18 @@
3646
3648
  .pf .pf-agd-json-bool { color: var(--accent, #E8564A); font-family: var(--font-mono, monospace); }
3647
3649
  .pf .pf-agd-json-null,
3648
3650
  .pf .pf-agd-json-empty { color: var(--text-muted, #9CA3AF); font-style: italic; }
3651
+
3652
+ /* ── Contracts sub-tab — agent-side contract-engagement visibility (active / retired). ── */
3653
+ .pf .pf-agd-contracts { padding: 0.25rem 0; }
3654
+ .pf .pf-agd-contracts .agc-mt { margin-top: 1rem; }
3655
+ .pf .pf-agd-contracts .agc-caps { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0 0.2rem; }
3656
+ .pf .pf-agd-contracts .agc-list { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.4rem; }
3657
+ .pf .pf-agd-contracts .agc-row {
3658
+ display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
3659
+ padding: 0.45rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-xs, 6px);
3660
+ background: var(--card);
3661
+ }
3662
+ .pf .pf-agd-contracts .agc-row--retired { opacity: 0.72; }
3663
+ .pf .pf-agd-contracts .agc-where { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; font-size: 0.85rem; }
3664
+ .pf .pf-agd-contracts .agc-org { color: var(--text-dim); font-size: 0.78rem; }
3665
+ .pf .pf-agd-contracts .agc-since { color: var(--text-muted); font-size: 0.75rem; }
@@ -1,3 +1,14 @@
1
+ /**
2
+ * @file portfolio.css
3
+ * @description Styles for the Portfolio view — builder wizard (.portfolio-container
4
+ * column) and full-bleed public viewer (.portfolio-viewer-full).
5
+ * @usage Loaded by spa.html; classes consumed by public/views/portfolio.js.
6
+ * @version-history
7
+ * v1.1.0 — 2026-07-03 — Full-bleed public viewer: .portfolio-viewer-full column fills
8
+ * the viewport below the nav, slim toolbar, iframe flexes to remaining height.
9
+ * v1.0.0 — 2026-03-06 — Initial portfolio builder + viewer styles.
10
+ */
11
+
1
12
  /* ── Portfolio View ────────────────────────────────────── */
2
13
 
3
14
  .portfolio-container {
@@ -248,6 +259,37 @@
248
259
  min-height: 60vh;
249
260
  }
250
261
 
262
+ /* Full-bleed published-portfolio view: a flex column that fills the viewport
263
+ below the sticky nav; the iframe takes all remaining height and the
264
+ portfolio scrolls inside it. */
265
+ .portfolio-viewer-full {
266
+ display: flex;
267
+ flex-direction: column;
268
+ height: calc(100vh - var(--nav-height, 64px));
269
+ height: calc(100dvh - var(--nav-height, 64px));
270
+ }
271
+
272
+ .portfolio-viewer-bar {
273
+ display: flex;
274
+ align-items: center;
275
+ gap: 0.75rem;
276
+ flex-wrap: wrap;
277
+ padding: 0.45rem 1rem;
278
+ }
279
+
280
+ .portfolio-viewer-owner {
281
+ color: var(--text-dim, #6B7280);
282
+ font-size: 0.9rem;
283
+ min-width: 0;
284
+ overflow: hidden;
285
+ text-overflow: ellipsis;
286
+ white-space: nowrap;
287
+ }
288
+
289
+ .portfolio-viewer-fs {
290
+ margin-left: auto;
291
+ }
292
+
251
293
  .portfolio-viewer-frame {
252
294
  width: 100%;
253
295
  border: none;
@@ -256,6 +298,14 @@
256
298
  background: #fff;
257
299
  }
258
300
 
301
+ /* Keep after the base .portfolio-viewer-frame rule — same specificity,
302
+ the override must win in the cascade. */
303
+ .portfolio-viewer-frame-full {
304
+ flex: 1;
305
+ min-height: 0;
306
+ border-radius: 0;
307
+ }
308
+
259
309
  .portfolio-not-found {
260
310
  text-align: center;
261
311
  padding: 4rem 2rem;
@@ -337,4 +387,5 @@
337
387
  .portfolio-publish-target { font-size: .85rem; color: var(--text-dim); margin-bottom: .75rem; }
338
388
  .portfolio-publish-url { font-family: monospace; word-break: break-all; }
339
389
  .portfolio-paste-actions { display: flex; gap: .6rem; margin-top: .5rem; flex-wrap: wrap; }
390
+ .portfolio-badge-toggle { margin: -0.25rem 0 0.75rem; }
340
391
  .portfolio-preview-frame { margin-top: .75rem; min-height: 420px; width: 100%; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
@@ -4,6 +4,10 @@
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.10.0 — 2026-07-03 — Contract-engagement chips: .pj-eng + .pj-retire-btn for the People panel.
8
+ * v2.9.0 — 2026-07-02 — Workspace Apps strip: .pj-apps-strip/-head/-title/-hint/-grid, launch
9
+ * cards .pj-app-card/-name/-desc/-meta/-missing, and the pin/unpin picker .pj-apps-picker(-row/
10
+ * -name/-owner) + .pj-apps-empty.
7
11
  * v2.8.0 — 2026-06-24 — Secretary P5 (S-C): .ext-instance-cfg-field/-label/-secret/-desc for the
8
12
  * extension instance-create config form (masked secret fields).
9
13
  * v2.7.0 — 2026-06-22 — Home "Usage & quotas" card: .pf-usage-card/.pf-usage-row/.pf-usage-bar/
@@ -1799,6 +1803,11 @@
1799
1803
  border: 1px solid var(--border-soft, #f0f0ec);
1800
1804
  }
1801
1805
  .pf-edit-hint { font-size: .75rem; color: var(--text-dim, #9CA3AF); }
1806
+ /* Directory opt-in checkbox row (member "phone book"). */
1807
+ .pf-edit-check { display: flex; align-items: flex-start; gap: .6rem; cursor: pointer; }
1808
+ .pf-edit-check input { margin-top: .2rem; flex-shrink: 0; }
1809
+ .pf-edit-check > span { display: flex; flex-direction: column; gap: .15rem; }
1810
+ .pf-edit-check-title { font-size: .9rem; }
1802
1811
  .pf-edit-error { font-size: .81rem; color: var(--danger, #ef4444); padding: 8px 12px; background: var(--danger-soft, #FEF2F2); border-radius: 8px; }
1803
1812
  .pf-edit-footer {
1804
1813
  display: flex; justify-content: flex-end; gap: 10px;
@@ -2173,6 +2182,10 @@
2173
2182
  .pj-contract-agents { border: 1px solid var(--border); border-radius: 10px; padding: 0.5rem 0.75rem; margin-bottom: 0.6rem; background: var(--card); }
2174
2183
  /* The per-contract one-click adopt action inside a contract-agent chip. */
2175
2184
  .pj-adopt-btn { margin-left: 0.4rem; padding: 0.1rem 0.5rem; font-size: 0.78rem; }
2185
+ /* A per-contract engagement group (state badge + its adopt/retire action). */
2186
+ .pj-eng { display: inline-flex; align-items: center; gap: 0.2rem; }
2187
+ /* Retire an active contract engagement — quiet, so it reads as secondary to the green "active" badge. */
2188
+ .pj-retire-btn { margin-left: 0.25rem; padding: 0.1rem 0.5rem; font-size: 0.78rem; color: var(--text-dim); }
2176
2189
  .pj-draft-form { margin: 0.4rem 0; }
2177
2190
  .pj-drafts { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.3rem; }
2178
2191
  .pj-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; }
@@ -3099,3 +3112,21 @@
3099
3112
  .dsc-item-meta { margin-top: .5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
3100
3113
  .dsc-tag { font-size: .72rem; color: var(--muted); background: var(--bg-dim); border-radius: var(--radius-full); padding: .08rem .45rem; }
3101
3114
  .dsc-owner { margin-left: auto; font-size: .72rem; color: var(--muted); font-family: var(--mono); }
3115
+
3116
+ /* ── Workspace Apps strip (pinned apps on the workspace Overview) ── */
3117
+ .pj-apps-strip { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .9rem; margin-bottom: 1rem; }
3118
+ .pj-apps-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .5rem; }
3119
+ .pj-apps-title { font-weight: 600; font-size: .95rem; }
3120
+ .pj-apps-hint { flex: 1; font-size: .78rem; color: var(--muted); }
3121
+ .pj-apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; }
3122
+ .pj-app-card { background: var(--bg-dim); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .75rem; cursor: pointer; transition: border-color .12s; }
3123
+ .pj-app-card:hover, .pj-app-card:focus-visible { border-color: var(--accent-border); box-shadow: var(--shadow-sm); }
3124
+ .pj-app-name { font-weight: 600; font-size: .9rem; }
3125
+ .pj-app-desc { margin-top: .25rem; font-size: .78rem; color: var(--text-dim); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
3126
+ .pj-app-meta { margin-top: .35rem; font-size: .72rem; color: var(--muted); }
3127
+ .pj-app-missing { color: var(--warning, var(--muted)); }
3128
+ .pj-apps-empty { font-size: .82rem; color: var(--muted); padding: .25rem 0; }
3129
+ .pj-apps-picker { margin-top: .75rem; border-top: 1px solid var(--border); padding-top: .6rem; display: flex; flex-direction: column; gap: .45rem; }
3130
+ .pj-apps-picker-row { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem; background: var(--bg-dim); border: 1px solid var(--border); border-radius: var(--radius); }
3131
+ .pj-apps-picker-name { font-size: .87rem; }
3132
+ .pj-apps-picker-owner { flex: 1; font-size: .74rem; color: var(--muted); font-family: var(--mono); }
@@ -53,6 +53,15 @@ export async function adoptContractTask(agentName, { organismId, ws, contract })
53
53
  });
54
54
  }
55
55
 
56
+ /** The agent's contract engagements across every organism/workspace (active + retired), enriched
57
+ * with organism + workspace display names. Powers the agent-detail Contracts tab. Returns array. */
58
+ export async function getAgentEngagements(agentName) {
59
+ try {
60
+ const data = await apiGet(`/v1/agents/${encodeURIComponent(agentName)}/engagements`);
61
+ return Array.isArray(data?.data?.engagements) ? data.data.engagements : [];
62
+ } catch { return []; }
63
+ }
64
+
56
65
  /** List chat session agents (name starts with 'session-'). */
57
66
  export async function listChatSessions(owner) {
58
67
  const agents = await listAgents(owner);
@@ -6,6 +6,9 @@
6
6
  * resolve gate approvals.
7
7
  * @usage import * as orgService from '/js/services/organisms.js';
8
8
  * @version-history
9
+ * v1.6.0 — 2026-07-02 — Workspace generator prompt + agent connect prompt teach rich document
10
+ * markdown: mermaid diagrams and aimeat-memory LIVE data blocks (embed a memory key; fresh on
11
+ * every open) so AI-authored documentspaces/documents use live embeds instead of static tables.
9
12
  * v1.5.0 — 2026-06-24 — uploadFile(orgId, file): generic blob upload (any document/image) to an
10
13
  * organism's private storage, returning {key,url,mime} — used by the Secretary doc/image intake.
11
14
  * v1.4.0 — 2026-06-23 — Optional color tags: getAllColors()/saveColors() read/write the per-item
@@ -276,7 +279,7 @@ const GENERATOR_PROMPT = `You are the AIMEAT Workspace Architect. Design a works
276
279
 
277
280
  A workspace is a set of object types. Each type is one of two modes:
278
281
  - "records" — structured items with consistent fields, validated by a schema. Use this for trackable things: milestones, tasks, risks, contacts, decisions.
279
- - "document" — free-form markdown that grows organically, with no schema. Use this whenever the user asks for documents, a wiki, notes, guides, design docs, or an open / free-form format.
282
+ - "document" — free-form markdown that grows organically, with no schema. Use this whenever the user asks for documents, a wiki, notes, guides, design docs, or an open / free-form format. Documents render rich markdown: \`\`\`mermaid fenced blocks become diagrams, and \`\`\`aimeat-memory fenced blocks become LIVE data (the block names a memory key; the document shows that key's current value — array of objects renders as a table — fresh on every open, so agent-maintained data belongs in a memory key + embed, not in pasted static tables). Mention these in a document space's "description" when the space is meant for dashboards or agent-fed reports.
280
283
 
281
284
  Respond with this shape:
282
285
  {
@@ -620,6 +623,12 @@ export async function saveWorkspaceReadme(orgId, wsId, readme) {
620
623
  return apiPut(`/v1/organisms/${encodeURIComponent(orgId)}/workspace?ws=${encodeURIComponent(wsId)}`, { ws: wsId, readme });
621
624
  }
622
625
 
626
+ /** Replace the workspace's pinned-apps list (FULL replace; [] clears). Each entry references a
627
+ * published app ({ owner, filename, label? }). Creator/admin only (enforced server-side). */
628
+ export async function saveWorkspaceApps(orgId, wsId, apps) {
629
+ return apiPut(`/v1/organisms/${encodeURIComponent(orgId)}/workspace?ws=${encodeURIComponent(wsId)}`, { ws: wsId, apps });
630
+ }
631
+
623
632
  /** Overwrite a workspace's manifest (e.g. edited name/summary/policy from Settings). */
624
633
  export async function saveManifest(orgId, wsId, manifest) {
625
634
  return apiPost('/v1/memory', { key: `${wsRoot(orgId, wsId)}.meta.manifest`, value: manifest, visibility: 'private' });
@@ -709,6 +718,29 @@ export async function revokeWorkspaceRole(orgId, ws, grantee) {
709
718
  return apiPost(`/v1/organisms/${encodeURIComponent(orgId)}/workspace-access/revoke`, { ws, grantee });
710
719
  }
711
720
 
721
+ /* ── Contract engagements — the first-class (agent × contract × workspace) binding with an
722
+ * active/retired lifecycle. Adopt writes `active`; Retire flips to `retired` (kept as history).
723
+ * Distinct from the derived "active here" trace: the engagement is the deactivatable INTENT. ── */
724
+
725
+ /** List the contract engagements declared in a workspace (active + retired). Returns array. */
726
+ export async function getWorkspaceEngagements(orgId, ws) {
727
+ try {
728
+ const resp = await apiGet(`/v1/organisms/${encodeURIComponent(orgId)}/workspace/engagements?ws=${encodeURIComponent(ws)}`);
729
+ return Array.isArray(resp?.data?.engagements) ? resp.data.engagements : [];
730
+ } catch { return []; }
731
+ }
732
+
733
+ /** Activate (adopt) a contract engagement for one of your agents. `agent` = full GAII. */
734
+ export async function activateEngagement(orgId, ws, agent, contract) {
735
+ return apiPost(`/v1/organisms/${encodeURIComponent(orgId)}/workspace/engagements`, { ws, agent, contract });
736
+ }
737
+
738
+ /** Retire a contract engagement — the agent's loop then skips this workspace (real off-switch).
739
+ * Allowed for the agent's owner or the workspace creator. `agent` = full GAII. */
740
+ export async function retireEngagement(orgId, ws, agent, contract) {
741
+ return apiPost(`/v1/organisms/${encodeURIComponent(orgId)}/workspace/engagements/retire`, { ws, agent, contract });
742
+ }
743
+
712
744
  /* ── Public document-space sharing (meta.share) ──
713
745
  * Independent of the access roles above: this controls what PUBLISHED document-space pages are
714
746
  * readable by ANYONE with the public viewer link (no login). Creator/admin manages it. ── */
@@ -902,6 +934,10 @@ export async function buildAccessPrompt(orgId, orgName, wsId, ws, variant = 'hum
902
934
  `- Write/refresh a draft: aimeat_memory_write key="organism.${orgId}.w.${wsId}.{namespace}.{id}.draft" value={...}`,
903
935
  `- Attach a file/screenshot: aimeat_storage_upload key="organism.${orgId}.w.${wsId}.img.{name}"`,
904
936
  ` then embed it in a document's markdown as ![alt](/v1/storage/<returned key>)`,
937
+ `- Live data in documents: a \`\`\`aimeat-memory fenced block (body: key: <memory key>, optional view: table|props|list,`,
938
+ ` fields: a,b and title: ...) renders that key's CURRENT value on every open — write changing data with`,
939
+ ` aimeat_memory_write as an array of objects (consistent field names) and embed the key instead of a static table;`,
940
+ ` re-writing the SAME key updates every document that embeds it. \`\`\`mermaid blocks render as diagrams.`,
905
941
  `- Publish a draft: POST ${nodeUrl}/v1/organisms/${orgId}/publish body { "ws":"${wsId}", "namespace":"...", "id":"..." }`,
906
942
  ` (snapshots .version.N + .latest, consumes the draft; may require operator approval if the publish gate is on)`,
907
943
  ].join('\n');