@celljs/ta 4.11.0 → 4.13.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 (647) hide show
  1. package/README.en.md +2 -2
  2. package/README.md +2 -2
  3. package/dist/cli.mjs +1006 -164
  4. package/dist/gateway.mjs +161 -2
  5. package/dist/pi/CHANGELOG.md +15 -0
  6. package/dist/pi/package.json +1 -1
  7. package/dist/pi/packages/ta-agents/README.en.md +1 -1
  8. package/dist/pi/packages/ta-agents/README.md +1 -1
  9. package/dist/pi/packages/ta-agents/extension/index.mjs +266 -25
  10. package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +7 -2
  11. package/dist/pi/packages/ta-agents/lib/acp-protocol.js +5 -2
  12. package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +8 -3
  13. package/dist/pi/packages/ta-agents/lib/agent-prompt.js +12 -4
  14. package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +72 -2
  15. package/dist/pi/packages/ta-agents/lib/agent-session.js +183 -18
  16. package/dist/pi/packages/ta-agents/lib/agent-streamer.js +16 -2
  17. package/dist/pi/packages/ta-agents/lib/agent-tool.d.ts +2 -0
  18. package/dist/pi/packages/ta-agents/lib/agent-tool.js +45 -4
  19. package/dist/pi/packages/ta-agents/lib/agent-turn.d.ts +17 -1
  20. package/dist/pi/packages/ta-agents/lib/agent-turn.js +51 -3
  21. package/dist/pi/packages/ta-agents/lib/extension.js +7 -0
  22. package/dist/pi/packages/ta-agents/lib/texts.d.ts +12 -0
  23. package/dist/pi/packages/ta-agents/lib/texts.js +12 -0
  24. package/dist/pi/packages/ta-agents/package.json +1 -1
  25. package/dist/pi/packages/ta-bots/extension/index.mjs +51 -0
  26. package/dist/pi/packages/ta-bots/host/index.mjs +157 -0
  27. package/dist/pi/packages/ta-bots/package.json +7 -2
  28. package/dist/pi/packages/ta-changes/extension/index.mjs +51 -0
  29. package/dist/pi/packages/ta-changes/package.json +8 -2
  30. package/dist/pi/packages/ta-channels/README.en.md +3 -1
  31. package/dist/pi/packages/ta-channels/README.md +3 -1
  32. package/dist/pi/packages/ta-channels/extension/index.mjs +55 -2
  33. package/dist/pi/packages/ta-channels/host/index.mjs +268 -8
  34. package/dist/pi/packages/ta-channels/lib/channels-model.d.ts +25 -0
  35. package/dist/pi/packages/ta-channels/lib/channels-util.js +8 -2
  36. package/dist/pi/packages/ta-channels/lib/i18n.d.ts +1 -0
  37. package/dist/pi/packages/ta-channels/lib/i18n.js +2 -0
  38. package/dist/pi/packages/ta-channels/lib/room.d.ts +0 -4
  39. package/dist/pi/packages/ta-channels/lib/room.js +31 -5
  40. package/dist/pi/packages/ta-channels/lib/sidebar.js +31 -13
  41. package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
  42. package/dist/pi/packages/ta-channels/lib/style.js +10 -13
  43. package/dist/pi/packages/ta-channels/lib/team-view.d.ts +19 -0
  44. package/dist/pi/packages/ta-channels/lib/team-view.js +45 -0
  45. package/dist/pi/packages/ta-channels/lib/team.d.ts +20 -4
  46. package/dist/pi/packages/ta-channels/lib/team.js +87 -6
  47. package/dist/pi/packages/ta-channels/lib/views.d.ts +12 -0
  48. package/dist/pi/packages/ta-channels/lib/views.js +19 -0
  49. package/dist/pi/packages/ta-channels/package.json +26 -2
  50. package/dist/pi/packages/ta-channels/web/index.js +191 -36
  51. package/dist/pi/packages/ta-computer-use/package.json +1 -1
  52. package/dist/pi/packages/ta-cron/README.en.md +2 -2
  53. package/dist/pi/packages/ta-cron/README.md +2 -2
  54. package/dist/pi/packages/ta-cron/extension/index.mjs +91 -257
  55. package/dist/pi/packages/ta-cron/host/index.mjs +9 -0
  56. package/dist/pi/packages/ta-cron/lib/chat-task.d.ts +16 -15
  57. package/dist/pi/packages/ta-cron/lib/chat-task.js +45 -36
  58. package/dist/pi/packages/ta-cron/lib/extension.js +11 -7
  59. package/dist/pi/packages/ta-cron/lib/i18n.d.ts +5 -7
  60. package/dist/pi/packages/ta-cron/lib/i18n.js +10 -14
  61. package/dist/pi/packages/ta-cron/lib/index.js +0 -2
  62. package/dist/pi/packages/ta-cron/lib/page.d.ts +5 -0
  63. package/dist/pi/packages/ta-cron/lib/page.js +24 -0
  64. package/dist/pi/packages/ta-cron/lib/style.d.ts +1 -1
  65. package/dist/pi/packages/ta-cron/lib/style.js +8 -0
  66. package/dist/pi/packages/ta-cron/lib/task-change.d.ts +11 -0
  67. package/dist/pi/packages/ta-cron/lib/task-change.js +43 -0
  68. package/dist/pi/packages/ta-cron/lib/task-extension.d.ts +3 -0
  69. package/dist/pi/packages/ta-cron/lib/task-extension.js +2 -0
  70. package/dist/pi/packages/ta-cron/lib/task-util.d.ts +5 -0
  71. package/dist/pi/packages/ta-cron/lib/task-util.js +13 -0
  72. package/dist/pi/packages/ta-cron/lib/tasks-view.js +26 -2
  73. package/dist/pi/packages/ta-cron/package.json +10 -2
  74. package/dist/pi/packages/ta-cron/web/index.js +607 -784
  75. package/dist/pi/packages/ta-extensions/README.en.md +1 -2
  76. package/dist/pi/packages/ta-extensions/README.md +1 -2
  77. package/dist/pi/packages/ta-extensions/lib/i18n.d.ts +0 -4
  78. package/dist/pi/packages/ta-extensions/lib/i18n.js +2 -10
  79. package/dist/pi/packages/ta-extensions/lib/index.js +0 -2
  80. package/dist/pi/packages/ta-extensions/package.json +10 -2
  81. package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +16 -11
  82. package/dist/pi/packages/ta-extensions/web/index.js +176 -97
  83. package/dist/pi/packages/ta-games/package.json +8 -2
  84. package/dist/pi/packages/ta-glance/README.en.md +1 -0
  85. package/dist/pi/packages/ta-glance/README.md +1 -0
  86. package/dist/pi/packages/ta-glance/extension/index.mjs +425 -3
  87. package/dist/pi/packages/ta-glance/lib/card.js +42 -15
  88. package/dist/pi/packages/ta-glance/lib/extension.d.ts +3 -0
  89. package/dist/pi/packages/ta-glance/lib/extension.js +10 -0
  90. package/dist/pi/packages/ta-glance/lib/glance-ask.d.ts +15 -0
  91. package/dist/pi/packages/ta-glance/lib/glance-ask.js +97 -0
  92. package/dist/pi/packages/ta-glance/lib/glance-prompt.d.ts +1 -1
  93. package/dist/pi/packages/ta-glance/lib/glance-prompt.js +3 -3
  94. package/dist/pi/packages/ta-glance/lib/glance-protocol.d.ts +2 -0
  95. package/dist/pi/packages/ta-glance/lib/glance-protocol.js +3 -1
  96. package/dist/pi/packages/ta-glance/lib/glance-spec.d.ts +7 -1
  97. package/dist/pi/packages/ta-glance/lib/glance-spec.js +45 -9
  98. package/dist/pi/packages/ta-glance/lib/i18n.d.ts +5 -0
  99. package/dist/pi/packages/ta-glance/lib/i18n.js +9 -0
  100. package/dist/pi/packages/ta-glance/lib/index.js +4 -1
  101. package/dist/pi/packages/ta-glance/lib/style.d.ts +1 -1
  102. package/dist/pi/packages/ta-glance/lib/style.js +187 -102
  103. package/dist/pi/packages/ta-glance/package.json +1 -1
  104. package/dist/pi/packages/ta-glance/web/index.js +272 -124
  105. package/dist/pi/packages/ta-initiative/README.en.md +66 -0
  106. package/dist/pi/packages/ta-initiative/README.md +66 -0
  107. package/dist/pi/packages/ta-initiative/extension/index.mjs +720 -0
  108. package/dist/pi/packages/ta-initiative/host/index.mjs +1169 -0
  109. package/dist/pi/packages/ta-initiative/lib/chat-kinds.d.ts +4 -0
  110. package/dist/pi/packages/ta-initiative/lib/chat-kinds.js +17 -0
  111. package/dist/pi/packages/ta-initiative/lib/chat-proposals.d.ts +28 -0
  112. package/dist/pi/packages/ta-initiative/lib/chat-proposals.js +79 -0
  113. package/dist/pi/packages/ta-initiative/lib/conversation.d.ts +4 -0
  114. package/dist/pi/packages/ta-initiative/lib/conversation.js +27 -0
  115. package/dist/pi/packages/ta-initiative/lib/cron-proposals.d.ts +23 -0
  116. package/dist/pi/packages/ta-initiative/lib/cron-proposals.js +94 -0
  117. package/dist/pi/packages/ta-initiative/lib/event-proposals.d.ts +13 -0
  118. package/dist/pi/packages/ta-initiative/lib/event-proposals.js +76 -0
  119. package/dist/pi/packages/ta-initiative/lib/extension.d.ts +30 -0
  120. package/dist/pi/packages/ta-initiative/lib/extension.js +238 -0
  121. package/dist/pi/packages/ta-initiative/lib/host.d.ts +4 -0
  122. package/dist/pi/packages/ta-initiative/lib/host.js +11 -0
  123. package/dist/pi/packages/ta-initiative/lib/i18n.d.ts +79 -0
  124. package/dist/pi/packages/ta-initiative/lib/i18n.js +159 -0
  125. package/dist/pi/packages/ta-initiative/lib/inbox-util.d.ts +19 -0
  126. package/dist/pi/packages/ta-initiative/lib/inbox-util.js +45 -0
  127. package/dist/pi/packages/ta-initiative/lib/inbox.d.ts +23 -0
  128. package/dist/pi/packages/ta-initiative/lib/inbox.js +142 -0
  129. package/dist/pi/packages/ta-initiative/lib/index.d.ts +10 -0
  130. package/dist/pi/packages/ta-initiative/lib/index.js +121 -0
  131. package/dist/pi/packages/ta-initiative/lib/initiative-protocol.d.ts +320 -0
  132. package/dist/pi/packages/ta-initiative/lib/initiative-protocol.js +96 -0
  133. package/dist/pi/packages/ta-initiative/lib/initiative-service.d.ts +37 -0
  134. package/dist/pi/packages/ta-initiative/lib/initiative-service.js +104 -0
  135. package/dist/pi/packages/ta-initiative/lib/initiative-store.d.ts +44 -0
  136. package/dist/pi/packages/ta-initiative/lib/initiative-store.js +112 -0
  137. package/dist/pi/packages/ta-initiative/lib/level-util.d.ts +22 -0
  138. package/dist/pi/packages/ta-initiative/lib/level-util.js +86 -0
  139. package/dist/pi/packages/ta-initiative/lib/material-util.d.ts +34 -0
  140. package/dist/pi/packages/ta-initiative/lib/material-util.js +155 -0
  141. package/dist/pi/packages/ta-initiative/lib/notices.d.ts +13 -0
  142. package/dist/pi/packages/ta-initiative/lib/notices.js +65 -0
  143. package/dist/pi/packages/ta-initiative/lib/notify-util.d.ts +25 -0
  144. package/dist/pi/packages/ta-initiative/lib/notify-util.js +60 -0
  145. package/dist/pi/packages/ta-initiative/lib/pace-util.d.ts +21 -0
  146. package/dist/pi/packages/ta-initiative/lib/pace-util.js +60 -0
  147. package/dist/pi/packages/ta-initiative/lib/page-initiative.d.ts +9 -0
  148. package/dist/pi/packages/ta-initiative/lib/page-initiative.js +40 -0
  149. package/dist/pi/packages/ta-initiative/lib/proposal-book.d.ts +61 -0
  150. package/dist/pi/packages/ta-initiative/lib/proposal-book.js +397 -0
  151. package/dist/pi/packages/ta-initiative/lib/react.d.ts +11 -0
  152. package/dist/pi/packages/ta-initiative/lib/react.js +16 -0
  153. package/dist/pi/packages/ta-initiative/lib/review-service.d.ts +32 -0
  154. package/dist/pi/packages/ta-initiative/lib/review-service.js +155 -0
  155. package/dist/pi/packages/ta-initiative/lib/server-texts.d.ts +7 -0
  156. package/dist/pi/packages/ta-initiative/lib/server-texts.js +17 -0
  157. package/dist/pi/packages/ta-initiative/lib/settings.d.ts +10 -0
  158. package/dist/pi/packages/ta-initiative/lib/settings.js +226 -0
  159. package/dist/pi/packages/ta-initiative/lib/style.d.ts +4 -0
  160. package/dist/pi/packages/ta-initiative/lib/style.js +56 -0
  161. package/dist/pi/packages/ta-initiative/lib/tool.d.ts +106 -0
  162. package/dist/pi/packages/ta-initiative/lib/tool.js +98 -0
  163. package/dist/pi/packages/ta-initiative/package.json +63 -0
  164. package/dist/pi/packages/ta-initiative/web/index.js +1226 -0
  165. package/dist/pi/packages/ta-launcher/README.en.md +2 -1
  166. package/dist/pi/packages/ta-launcher/README.md +2 -1
  167. package/dist/pi/packages/ta-launcher/lib/i18n.d.ts +2 -0
  168. package/dist/pi/packages/ta-launcher/lib/i18n.js +4 -0
  169. package/dist/pi/packages/ta-launcher/lib/launcher-view.js +32 -0
  170. package/dist/pi/packages/ta-launcher/lib/style.d.ts +1 -1
  171. package/dist/pi/packages/ta-launcher/lib/style.js +11 -0
  172. package/dist/pi/packages/ta-launcher/package.json +1 -1
  173. package/dist/pi/packages/ta-launcher/web/index.js +58 -1
  174. package/dist/pi/packages/ta-manual/lib/pictures-b.js +29 -0
  175. package/dist/pi/packages/ta-manual/lib/pictures-c.d.ts +2 -0
  176. package/dist/pi/packages/ta-manual/lib/pictures-c.js +160 -0
  177. package/dist/pi/packages/ta-manual/lib/pictures.js +2 -1
  178. package/dist/pi/packages/ta-manual/lib/topics.d.ts +5 -0
  179. package/dist/pi/packages/ta-manual/lib/topics.js +155 -9
  180. package/dist/pi/packages/ta-manual/package.json +1 -1
  181. package/dist/pi/packages/ta-manual/skills/ta-manual/SKILL.md +54 -8
  182. package/dist/pi/packages/ta-manual/web/index.js +750 -10
  183. package/dist/pi/packages/ta-moments/README.en.md +29 -0
  184. package/dist/pi/packages/ta-moments/README.md +29 -0
  185. package/dist/pi/packages/ta-moments/extension/index.mjs +1766 -0
  186. package/dist/pi/packages/ta-moments/host/index.mjs +2394 -0
  187. package/dist/pi/packages/ta-moments/lib/brief-util.d.ts +30 -0
  188. package/dist/pi/packages/ta-moments/lib/brief-util.js +92 -0
  189. package/dist/pi/packages/ta-moments/lib/context.d.ts +18 -0
  190. package/dist/pi/packages/ta-moments/lib/context.js +35 -0
  191. package/dist/pi/packages/ta-moments/lib/draft-card.d.ts +6 -0
  192. package/dist/pi/packages/ta-moments/lib/draft-card.js +60 -0
  193. package/dist/pi/packages/ta-moments/lib/editor.d.ts +16 -0
  194. package/dist/pi/packages/ta-moments/lib/editor.js +126 -0
  195. package/dist/pi/packages/ta-moments/lib/extension.d.ts +24 -0
  196. package/dist/pi/packages/ta-moments/lib/extension.js +136 -0
  197. package/dist/pi/packages/ta-moments/lib/friends.d.ts +13 -0
  198. package/dist/pi/packages/ta-moments/lib/friends.js +27 -0
  199. package/dist/pi/packages/ta-moments/lib/host.d.ts +4 -0
  200. package/dist/pi/packages/ta-moments/lib/host.js +11 -0
  201. package/dist/pi/packages/ta-moments/lib/i18n.d.ts +92 -0
  202. package/dist/pi/packages/ta-moments/lib/i18n.js +201 -0
  203. package/dist/pi/packages/ta-moments/lib/image-util.d.ts +18 -0
  204. package/dist/pi/packages/ta-moments/lib/image-util.js +71 -0
  205. package/dist/pi/packages/ta-moments/lib/index.d.ts +8 -0
  206. package/dist/pi/packages/ta-moments/lib/index.js +50 -0
  207. package/dist/pi/packages/ta-moments/lib/moments-host.d.ts +133 -0
  208. package/dist/pi/packages/ta-moments/lib/moments-host.js +821 -0
  209. package/dist/pi/packages/ta-moments/lib/moments-protocol.d.ts +334 -0
  210. package/dist/pi/packages/ta-moments/lib/moments-protocol.js +99 -0
  211. package/dist/pi/packages/ta-moments/lib/page.d.ts +7 -0
  212. package/dist/pi/packages/ta-moments/lib/page.js +307 -0
  213. package/dist/pi/packages/ta-moments/lib/post-util.d.ts +31 -0
  214. package/dist/pi/packages/ta-moments/lib/post-util.js +205 -0
  215. package/dist/pi/packages/ta-moments/lib/server-texts.d.ts +29 -0
  216. package/dist/pi/packages/ta-moments/lib/server-texts.js +104 -0
  217. package/dist/pi/packages/ta-moments/lib/store.d.ts +33 -0
  218. package/dist/pi/packages/ta-moments/lib/store.js +108 -0
  219. package/dist/pi/packages/ta-moments/lib/style.d.ts +4 -0
  220. package/dist/pi/packages/ta-moments/lib/style.js +155 -0
  221. package/dist/pi/packages/ta-moments/lib/talk-host.d.ts +112 -0
  222. package/dist/pi/packages/ta-moments/lib/talk-host.js +582 -0
  223. package/dist/pi/packages/ta-moments/lib/talk-util.d.ts +26 -0
  224. package/dist/pi/packages/ta-moments/lib/talk-util.js +145 -0
  225. package/dist/pi/packages/ta-moments/lib/tool.d.ts +48 -0
  226. package/dist/pi/packages/ta-moments/lib/tool.js +56 -0
  227. package/dist/pi/packages/ta-moments/package.json +61 -0
  228. package/dist/pi/packages/ta-moments/web/index.js +1987 -0
  229. package/dist/pi/packages/ta-nearby/README.en.md +33 -0
  230. package/dist/pi/packages/ta-nearby/README.md +33 -0
  231. package/dist/pi/packages/ta-nearby/extension/index.mjs +389 -0
  232. package/dist/pi/packages/ta-nearby/host/index.mjs +1859 -0
  233. package/dist/pi/packages/ta-nearby/lib/extension.d.ts +27 -0
  234. package/dist/pi/packages/ta-nearby/lib/extension.js +190 -0
  235. package/dist/pi/packages/ta-nearby/lib/host.d.ts +7 -0
  236. package/dist/pi/packages/ta-nearby/lib/host.js +20 -0
  237. package/dist/pi/packages/ta-nearby/lib/i18n.d.ts +92 -0
  238. package/dist/pi/packages/ta-nearby/lib/i18n.js +183 -0
  239. package/dist/pi/packages/ta-nearby/lib/index.d.ts +8 -0
  240. package/dist/pi/packages/ta-nearby/lib/index.js +38 -0
  241. package/dist/pi/packages/ta-nearby/lib/nearby-crypto.d.ts +31 -0
  242. package/dist/pi/packages/ta-nearby/lib/nearby-crypto.js +59 -0
  243. package/dist/pi/packages/ta-nearby/lib/nearby-meet.d.ts +35 -0
  244. package/dist/pi/packages/ta-nearby/lib/nearby-meet.js +93 -0
  245. package/dist/pi/packages/ta-nearby/lib/nearby-net.d.ts +59 -0
  246. package/dist/pi/packages/ta-nearby/lib/nearby-net.js +253 -0
  247. package/dist/pi/packages/ta-nearby/lib/nearby-protocol.d.ts +274 -0
  248. package/dist/pi/packages/ta-nearby/lib/nearby-protocol.js +31 -0
  249. package/dist/pi/packages/ta-nearby/lib/nearby-service.d.ts +199 -0
  250. package/dist/pi/packages/ta-nearby/lib/nearby-service.js +1012 -0
  251. package/dist/pi/packages/ta-nearby/lib/nearby-spot.d.ts +50 -0
  252. package/dist/pi/packages/ta-nearby/lib/nearby-spot.js +167 -0
  253. package/dist/pi/packages/ta-nearby/lib/page.d.ts +52 -0
  254. package/dist/pi/packages/ta-nearby/lib/page.js +588 -0
  255. package/dist/pi/packages/ta-nearby/lib/react.d.ts +8 -0
  256. package/dist/pi/packages/ta-nearby/lib/react.js +8 -0
  257. package/dist/pi/packages/ta-nearby/lib/server-texts.d.ts +45 -0
  258. package/dist/pi/packages/ta-nearby/lib/server-texts.js +148 -0
  259. package/dist/pi/packages/ta-nearby/lib/style.d.ts +4 -0
  260. package/dist/pi/packages/ta-nearby/lib/style.js +92 -0
  261. package/dist/pi/packages/ta-nearby/package.json +65 -0
  262. package/dist/pi/packages/ta-nearby/web/index.js +1055 -0
  263. package/dist/pi/packages/ta-notify/README.en.md +3 -1
  264. package/dist/pi/packages/ta-notify/README.md +3 -1
  265. package/dist/pi/packages/ta-notify/extension/index.mjs +64 -0
  266. package/dist/pi/packages/ta-notify/host/index.mjs +24 -1
  267. package/dist/pi/packages/ta-notify/lib/extension.d.ts +4 -1
  268. package/dist/pi/packages/ta-notify/lib/extension.js +20 -1
  269. package/dist/pi/packages/ta-notify/lib/notify-protocol.d.ts +23 -3
  270. package/dist/pi/packages/ta-notify/lib/notify-service.d.ts +4 -2
  271. package/dist/pi/packages/ta-notify/lib/notify-service.js +27 -2
  272. package/dist/pi/packages/ta-notify/lib/style.d.ts +1 -1
  273. package/dist/pi/packages/ta-notify/lib/style.js +1 -1
  274. package/dist/pi/packages/ta-notify/lib/watcher.js +2 -1
  275. package/dist/pi/packages/ta-notify/package.json +7 -2
  276. package/dist/pi/packages/ta-notify/web/index.js +3 -2
  277. package/dist/pi/packages/ta-recall/README.en.md +15 -6
  278. package/dist/pi/packages/ta-recall/README.md +15 -6
  279. package/dist/pi/packages/ta-recall/extension/index.mjs +291 -134
  280. package/dist/pi/packages/ta-recall/host/index.mjs +451 -116
  281. package/dist/pi/packages/ta-recall/lib/block-util.d.ts +11 -0
  282. package/dist/pi/packages/ta-recall/lib/block-util.js +43 -0
  283. package/dist/pi/packages/ta-recall/lib/brief-util.d.ts +25 -0
  284. package/dist/pi/packages/ta-recall/lib/brief-util.js +38 -1
  285. package/dist/pi/packages/ta-recall/lib/composer.d.ts +3 -2
  286. package/dist/pi/packages/ta-recall/lib/composer.js +9 -8
  287. package/dist/pi/packages/ta-recall/lib/conversations.js +6 -0
  288. package/dist/pi/packages/ta-recall/lib/extension-util.d.ts +21 -0
  289. package/dist/pi/packages/ta-recall/lib/extension-util.js +104 -0
  290. package/dist/pi/packages/ta-recall/lib/extension.d.ts +3 -3
  291. package/dist/pi/packages/ta-recall/lib/extension.js +35 -26
  292. package/dist/pi/packages/ta-recall/lib/i18n.d.ts +18 -10
  293. package/dist/pi/packages/ta-recall/lib/i18n.js +40 -24
  294. package/dist/pi/packages/ta-recall/lib/index.d.ts +2 -2
  295. package/dist/pi/packages/ta-recall/lib/index.js +5 -4
  296. package/dist/pi/packages/ta-recall/lib/keep-card.d.ts +10 -0
  297. package/dist/pi/packages/ta-recall/lib/keep-card.js +83 -0
  298. package/dist/pi/packages/ta-recall/lib/keep-util.d.ts +15 -0
  299. package/dist/pi/packages/ta-recall/lib/keep-util.js +55 -0
  300. package/dist/pi/packages/ta-recall/lib/recall-protocol.d.ts +92 -18
  301. package/dist/pi/packages/ta-recall/lib/recall-protocol.js +19 -9
  302. package/dist/pi/packages/ta-recall/lib/recall-service.d.ts +16 -6
  303. package/dist/pi/packages/ta-recall/lib/recall-service.js +101 -11
  304. package/dist/pi/packages/ta-recall/lib/requests-util.d.ts +6 -0
  305. package/dist/pi/packages/ta-recall/lib/requests-util.js +37 -0
  306. package/dist/pi/packages/ta-recall/lib/server-texts.d.ts +2 -0
  307. package/dist/pi/packages/ta-recall/lib/server-texts.js +5 -0
  308. package/dist/pi/packages/ta-recall/lib/settings.d.ts +1 -1
  309. package/dist/pi/packages/ta-recall/lib/settings.js +1 -1
  310. package/dist/pi/packages/ta-recall/lib/style.d.ts +1 -1
  311. package/dist/pi/packages/ta-recall/lib/style.js +2 -2
  312. package/dist/pi/packages/ta-recall/lib/tool-line.d.ts +2 -2
  313. package/dist/pi/packages/ta-recall/lib/tool-line.js +10 -5
  314. package/dist/pi/packages/ta-recall/lib/tool.d.ts +14 -5
  315. package/dist/pi/packages/ta-recall/lib/tool.js +29 -17
  316. package/dist/pi/packages/ta-recall/package.json +13 -5
  317. package/dist/pi/packages/ta-recall/web/index.js +397 -153
  318. package/dist/pi/packages/ta-rooms/README.en.md +14 -5
  319. package/dist/pi/packages/ta-rooms/README.md +14 -5
  320. package/dist/pi/packages/ta-rooms/extension/index.mjs +526 -0
  321. package/dist/pi/packages/ta-rooms/host/index.mjs +1734 -0
  322. package/dist/pi/packages/ta-rooms/lib/agents-view.d.ts +25 -0
  323. package/dist/pi/packages/ta-rooms/lib/agents-view.js +128 -0
  324. package/dist/pi/packages/ta-rooms/lib/dialogs.js +5 -0
  325. package/dist/pi/packages/ta-rooms/lib/double-agents.d.ts +26 -0
  326. package/dist/pi/packages/ta-rooms/lib/double-agents.js +84 -0
  327. package/dist/pi/packages/ta-rooms/lib/double-grants.d.ts +22 -0
  328. package/dist/pi/packages/ta-rooms/lib/double-grants.js +140 -0
  329. package/dist/pi/packages/ta-rooms/lib/double-host.d.ts +117 -0
  330. package/dist/pi/packages/ta-rooms/lib/double-host.js +476 -0
  331. package/dist/pi/packages/ta-rooms/lib/double-i18n.d.ts +105 -0
  332. package/dist/pi/packages/ta-rooms/lib/double-i18n.js +212 -0
  333. package/dist/pi/packages/ta-rooms/lib/double-protocol.d.ts +258 -0
  334. package/dist/pi/packages/ta-rooms/lib/double-protocol.js +128 -0
  335. package/dist/pi/packages/ta-rooms/lib/double-tasks.d.ts +82 -0
  336. package/dist/pi/packages/ta-rooms/lib/double-tasks.js +527 -0
  337. package/dist/pi/packages/ta-rooms/lib/double-user.d.ts +19 -0
  338. package/dist/pi/packages/ta-rooms/lib/double-user.js +124 -0
  339. package/dist/pi/packages/ta-rooms/lib/double-util.d.ts +131 -0
  340. package/dist/pi/packages/ta-rooms/lib/double-util.js +238 -0
  341. package/dist/pi/packages/ta-rooms/lib/doubles-store.d.ts +48 -0
  342. package/dist/pi/packages/ta-rooms/lib/doubles-store.js +151 -0
  343. package/dist/pi/packages/ta-rooms/lib/doubles-view.d.ts +34 -0
  344. package/dist/pi/packages/ta-rooms/lib/doubles-view.js +228 -0
  345. package/dist/pi/packages/ta-rooms/lib/extension.d.ts +33 -0
  346. package/dist/pi/packages/ta-rooms/lib/extension.js +203 -0
  347. package/dist/pi/packages/ta-rooms/lib/friend-notices.d.ts +12 -0
  348. package/dist/pi/packages/ta-rooms/lib/friend-notices.js +47 -0
  349. package/dist/pi/packages/ta-rooms/lib/friends-view.d.ts +20 -0
  350. package/dist/pi/packages/ta-rooms/lib/friends-view.js +224 -0
  351. package/dist/pi/packages/ta-rooms/lib/host.d.ts +8 -0
  352. package/dist/pi/packages/ta-rooms/lib/host.js +25 -0
  353. package/dist/pi/packages/ta-rooms/lib/i18n.d.ts +27 -2
  354. package/dist/pi/packages/ta-rooms/lib/i18n.js +68 -18
  355. package/dist/pi/packages/ta-rooms/lib/index.js +41 -3
  356. package/dist/pi/packages/ta-rooms/lib/members-view.js +44 -3
  357. package/dist/pi/packages/ta-rooms/lib/page.d.ts +97 -10
  358. package/dist/pi/packages/ta-rooms/lib/page.js +223 -45
  359. package/dist/pi/packages/ta-rooms/lib/room-view.d.ts +2 -4
  360. package/dist/pi/packages/ta-rooms/lib/room-view.js +57 -35
  361. package/dist/pi/packages/ta-rooms/lib/rooms-home.d.ts +32 -0
  362. package/dist/pi/packages/ta-rooms/lib/rooms-home.js +141 -0
  363. package/dist/pi/packages/ta-rooms/lib/rooms-page.d.ts +8 -2
  364. package/dist/pi/packages/ta-rooms/lib/rooms-page.js +68 -36
  365. package/dist/pi/packages/ta-rooms/lib/style.d.ts +1 -1
  366. package/dist/pi/packages/ta-rooms/lib/style.js +126 -50
  367. package/dist/pi/packages/ta-rooms/lib/tasks-view.d.ts +41 -0
  368. package/dist/pi/packages/ta-rooms/lib/tasks-view.js +228 -0
  369. package/dist/pi/packages/ta-rooms/package.json +19 -4
  370. package/dist/pi/packages/ta-rooms/web/index.js +2585 -470
  371. package/dist/pi/packages/ta-share/README.en.md +1 -1
  372. package/dist/pi/packages/ta-share/README.md +1 -1
  373. package/dist/pi/packages/ta-share/extension/index.mjs +51 -0
  374. package/dist/pi/packages/ta-share/lib/i18n.js +6 -6
  375. package/dist/pi/packages/ta-share/lib/share-dialog.js +1 -1
  376. package/dist/pi/packages/ta-share/lib/shares-page.js +35 -11
  377. package/dist/pi/packages/ta-share/lib/style.d.ts +1 -1
  378. package/dist/pi/packages/ta-share/lib/style.js +14 -10
  379. package/dist/pi/packages/ta-share/package.json +10 -2
  380. package/dist/pi/packages/ta-share/web/index.js +56 -31
  381. package/dist/pi/packages/ta-sync/README.en.md +55 -0
  382. package/dist/pi/packages/ta-sync/README.md +55 -0
  383. package/dist/pi/packages/ta-sync/host/index.mjs +3763 -0
  384. package/dist/pi/packages/ta-sync/lib/host.d.ts +10 -0
  385. package/dist/pi/packages/ta-sync/lib/host.js +94 -0
  386. package/dist/pi/packages/ta-sync/lib/i18n.d.ts +98 -0
  387. package/dist/pi/packages/ta-sync/lib/i18n.js +202 -0
  388. package/dist/pi/packages/ta-sync/lib/index.d.ts +7 -0
  389. package/dist/pi/packages/ta-sync/lib/index.js +115 -0
  390. package/dist/pi/packages/ta-sync/lib/migrate-archive.d.ts +88 -0
  391. package/dist/pi/packages/ta-sync/lib/migrate-archive.js +439 -0
  392. package/dist/pi/packages/ta-sync/lib/migrate-frames.d.ts +77 -0
  393. package/dist/pi/packages/ta-sync/lib/migrate-frames.js +210 -0
  394. package/dist/pi/packages/ta-sync/lib/migrate-i18n.d.ts +99 -0
  395. package/dist/pi/packages/ta-sync/lib/migrate-i18n.js +210 -0
  396. package/dist/pi/packages/ta-sync/lib/migrate-net.d.ts +51 -0
  397. package/dist/pi/packages/ta-sync/lib/migrate-net.js +170 -0
  398. package/dist/pi/packages/ta-sync/lib/migrate-protocol.d.ts +126 -0
  399. package/dist/pi/packages/ta-sync/lib/migrate-protocol.js +43 -0
  400. package/dist/pi/packages/ta-sync/lib/migrate-service.d.ts +86 -0
  401. package/dist/pi/packages/ta-sync/lib/migrate-service.js +521 -0
  402. package/dist/pi/packages/ta-sync/lib/move-panel.d.ts +16 -0
  403. package/dist/pi/packages/ta-sync/lib/move-panel.js +320 -0
  404. package/dist/pi/packages/ta-sync/lib/move-store.d.ts +15 -0
  405. package/dist/pi/packages/ta-sync/lib/move-store.js +42 -0
  406. package/dist/pi/packages/ta-sync/lib/panel.d.ts +28 -0
  407. package/dist/pi/packages/ta-sync/lib/panel.js +305 -0
  408. package/dist/pi/packages/ta-sync/lib/pictures.d.ts +22 -0
  409. package/dist/pi/packages/ta-sync/lib/pictures.js +92 -0
  410. package/dist/pi/packages/ta-sync/lib/react.d.ts +11 -0
  411. package/dist/pi/packages/ta-sync/lib/react.js +16 -0
  412. package/dist/pi/packages/ta-sync/lib/server-texts.d.ts +29 -0
  413. package/dist/pi/packages/ta-sync/lib/server-texts.js +111 -0
  414. package/dist/pi/packages/ta-sync/lib/style.d.ts +4 -0
  415. package/dist/pi/packages/ta-sync/lib/style.js +108 -0
  416. package/dist/pi/packages/ta-sync/lib/sync-codec.d.ts +16 -0
  417. package/dist/pi/packages/ta-sync/lib/sync-codec.js +61 -0
  418. package/dist/pi/packages/ta-sync/lib/sync-engine.d.ts +57 -0
  419. package/dist/pi/packages/ta-sync/lib/sync-engine.js +203 -0
  420. package/dist/pi/packages/ta-sync/lib/sync-folder.d.ts +156 -0
  421. package/dist/pi/packages/ta-sync/lib/sync-folder.js +385 -0
  422. package/dist/pi/packages/ta-sync/lib/sync-identity.d.ts +60 -0
  423. package/dist/pi/packages/ta-sync/lib/sync-identity.js +201 -0
  424. package/dist/pi/packages/ta-sync/lib/sync-items.d.ts +104 -0
  425. package/dist/pi/packages/ta-sync/lib/sync-items.js +426 -0
  426. package/dist/pi/packages/ta-sync/lib/sync-merge.d.ts +42 -0
  427. package/dist/pi/packages/ta-sync/lib/sync-merge.js +109 -0
  428. package/dist/pi/packages/ta-sync/lib/sync-protocol.d.ts +134 -0
  429. package/dist/pi/packages/ta-sync/lib/sync-protocol.js +72 -0
  430. package/dist/pi/packages/ta-sync/lib/sync-service.d.ts +128 -0
  431. package/dist/pi/packages/ta-sync/lib/sync-service.js +679 -0
  432. package/dist/pi/packages/ta-sync/lib/sync-store.d.ts +15 -0
  433. package/dist/pi/packages/ta-sync/lib/sync-store.js +41 -0
  434. package/dist/pi/packages/ta-sync/package.json +57 -0
  435. package/dist/pi/packages/ta-sync/web/index.js +2018 -0
  436. package/dist/pi/packages/ta-sync-cloud/README.en.md +31 -0
  437. package/dist/pi/packages/ta-sync-cloud/README.md +31 -0
  438. package/dist/pi/packages/ta-sync-cloud/host/index.mjs +810 -0
  439. package/dist/pi/packages/ta-sync-cloud/lib/git-store.d.ts +90 -0
  440. package/dist/pi/packages/ta-sync-cloud/lib/git-store.js +393 -0
  441. package/dist/pi/packages/ta-sync-cloud/lib/host.d.ts +13 -0
  442. package/dist/pi/packages/ta-sync-cloud/lib/host.js +112 -0
  443. package/dist/pi/packages/ta-sync-cloud/lib/s3-store.d.ts +72 -0
  444. package/dist/pi/packages/ta-sync-cloud/lib/s3-store.js +206 -0
  445. package/dist/pi/packages/ta-sync-cloud/lib/store-util.d.ts +17 -0
  446. package/dist/pi/packages/ta-sync-cloud/lib/store-util.js +69 -0
  447. package/dist/pi/packages/ta-sync-cloud/lib/webdav-store.d.ts +40 -0
  448. package/dist/pi/packages/ta-sync-cloud/lib/webdav-store.js +144 -0
  449. package/dist/pi/packages/ta-sync-cloud/package.json +63 -0
  450. package/dist/pi/packages/ta-team/README.en.md +28 -0
  451. package/dist/pi/packages/ta-team/README.md +28 -0
  452. package/dist/pi/packages/ta-team/extension/index.mjs +264 -0
  453. package/dist/pi/packages/ta-team/host/index.mjs +2100 -0
  454. package/dist/pi/packages/ta-team/lib/dialogs.d.ts +13 -0
  455. package/dist/pi/packages/ta-team/lib/dialogs.js +335 -0
  456. package/dist/pi/packages/ta-team/lib/extension.d.ts +21 -0
  457. package/dist/pi/packages/ta-team/lib/extension.js +123 -0
  458. package/dist/pi/packages/ta-team/lib/host.d.ts +13 -0
  459. package/dist/pi/packages/ta-team/lib/host.js +45 -0
  460. package/dist/pi/packages/ta-team/lib/i18n.d.ts +200 -0
  461. package/dist/pi/packages/ta-team/lib/i18n.js +401 -0
  462. package/dist/pi/packages/ta-team/lib/index.d.ts +8 -0
  463. package/dist/pi/packages/ta-team/lib/index.js +67 -0
  464. package/dist/pi/packages/ta-team/lib/join.d.ts +28 -0
  465. package/dist/pi/packages/ta-team/lib/join.js +48 -0
  466. package/dist/pi/packages/ta-team/lib/member-dialog.d.ts +2 -0
  467. package/dist/pi/packages/ta-team/lib/member-dialog.js +121 -0
  468. package/dist/pi/packages/ta-team/lib/members-tab.d.ts +11 -0
  469. package/dist/pi/packages/ta-team/lib/members-tab.js +133 -0
  470. package/dist/pi/packages/ta-team/lib/page.d.ts +42 -0
  471. package/dist/pi/packages/ta-team/lib/page.js +142 -0
  472. package/dist/pi/packages/ta-team/lib/parts.d.ts +39 -0
  473. package/dist/pi/packages/ta-team/lib/parts.js +47 -0
  474. package/dist/pi/packages/ta-team/lib/policy.d.ts +37 -0
  475. package/dist/pi/packages/ta-team/lib/policy.js +215 -0
  476. package/dist/pi/packages/ta-team/lib/protocol.d.ts +285 -0
  477. package/dist/pi/packages/ta-team/lib/protocol.js +119 -0
  478. package/dist/pi/packages/ta-team/lib/react.d.ts +8 -0
  479. package/dist/pi/packages/ta-team/lib/react.js +8 -0
  480. package/dist/pi/packages/ta-team/lib/record-tab.d.ts +8 -0
  481. package/dist/pi/packages/ta-team/lib/record-tab.js +90 -0
  482. package/dist/pi/packages/ta-team/lib/remote.d.ts +31 -0
  483. package/dist/pi/packages/ta-team/lib/remote.js +128 -0
  484. package/dist/pi/packages/ta-team/lib/roles-tab.d.ts +9 -0
  485. package/dist/pi/packages/ta-team/lib/roles-tab.js +76 -0
  486. package/dist/pi/packages/ta-team/lib/seal.d.ts +28 -0
  487. package/dist/pi/packages/ta-team/lib/seal.js +75 -0
  488. package/dist/pi/packages/ta-team/lib/shared-home.d.ts +23 -0
  489. package/dist/pi/packages/ta-team/lib/shared-home.js +123 -0
  490. package/dist/pi/packages/ta-team/lib/style.d.ts +4 -0
  491. package/dist/pi/packages/ta-team/lib/style.js +99 -0
  492. package/dist/pi/packages/ta-team/lib/team-admin.d.ts +31 -0
  493. package/dist/pi/packages/ta-team/lib/team-admin.js +140 -0
  494. package/dist/pi/packages/ta-team/lib/team-audit.d.ts +35 -0
  495. package/dist/pi/packages/ta-team/lib/team-audit.js +152 -0
  496. package/dist/pi/packages/ta-team/lib/team-core.d.ts +58 -0
  497. package/dist/pi/packages/ta-team/lib/team-core.js +115 -0
  498. package/dist/pi/packages/ta-team/lib/team-error.d.ts +4 -0
  499. package/dist/pi/packages/ta-team/lib/team-error.js +8 -0
  500. package/dist/pi/packages/ta-team/lib/team-expiry.d.ts +15 -0
  501. package/dist/pi/packages/ta-team/lib/team-expiry.js +67 -0
  502. package/dist/pi/packages/ta-team/lib/team-files.d.ts +21 -0
  503. package/dist/pi/packages/ta-team/lib/team-files.js +119 -0
  504. package/dist/pi/packages/ta-team/lib/team-inbox.d.ts +8 -0
  505. package/dist/pi/packages/ta-team/lib/team-inbox.js +32 -0
  506. package/dist/pi/packages/ta-team/lib/team-invites.d.ts +46 -0
  507. package/dist/pi/packages/ta-team/lib/team-invites.js +204 -0
  508. package/dist/pi/packages/ta-team/lib/team-page.d.ts +6 -0
  509. package/dist/pi/packages/ta-team/lib/team-page.js +41 -0
  510. package/dist/pi/packages/ta-team/lib/team-paths.d.ts +15 -0
  511. package/dist/pi/packages/ta-team/lib/team-paths.js +70 -0
  512. package/dist/pi/packages/ta-team/lib/team-people.d.ts +28 -0
  513. package/dist/pi/packages/ta-team/lib/team-people.js +106 -0
  514. package/dist/pi/packages/ta-team/lib/team-requests.d.ts +24 -0
  515. package/dist/pi/packages/ta-team/lib/team-requests.js +126 -0
  516. package/dist/pi/packages/ta-team/lib/team-runs.d.ts +38 -0
  517. package/dist/pi/packages/ta-team/lib/team-runs.js +136 -0
  518. package/dist/pi/packages/ta-team/lib/team-service.d.ts +32 -0
  519. package/dist/pi/packages/ta-team/lib/team-service.js +58 -0
  520. package/dist/pi/packages/ta-team/lib/team-shares.d.ts +52 -0
  521. package/dist/pi/packages/ta-team/lib/team-shares.js +145 -0
  522. package/dist/pi/packages/ta-team/lib/team-waits.d.ts +8 -0
  523. package/dist/pi/packages/ta-team/lib/team-waits.js +42 -0
  524. package/dist/pi/packages/ta-team/lib/team-watch.d.ts +28 -0
  525. package/dist/pi/packages/ta-team/lib/team-watch.js +136 -0
  526. package/dist/pi/packages/ta-team/package.json +68 -0
  527. package/dist/pi/packages/ta-team/web/index.js +2741 -0
  528. package/dist/pi/packages/ta-workspace/package.json +1 -1
  529. package/dist/pi/packages/ta-workspace/web/index.js +157 -0
  530. package/dist/public/assets/{abnfDiagram-S7VZAUFO-D9uU0Tx2.js → abnfDiagram-S7VZAUFO-DJMZKA5d.js} +1 -1
  531. package/dist/public/assets/{architecture-WOLXFQ4H-f7Nm7EIo.js → architecture-WOLXFQ4H-DwZ8A2Bp.js} +1 -1
  532. package/dist/public/assets/{architectureDiagram-YGSQEFNW-DSAqlcms.js → architectureDiagram-YGSQEFNW-DPezb7-w.js} +1 -1
  533. package/dist/public/assets/{blockDiagram-APKKGZFW-C0lPIW9g.js → blockDiagram-APKKGZFW-SrFYBlSp.js} +1 -1
  534. package/dist/public/assets/{browser-WLpgVYno.js → browser-CljOqDFz.js} +1 -1
  535. package/dist/public/assets/{c4Diagram-KJ2TOQU5-CDcZ7mJq.js → c4Diagram-KJ2TOQU5-COCMkiJ6.js} +1 -1
  536. package/dist/public/assets/{chunk-6MUBBAK2-CXPuyqPL.js → chunk-6MUBBAK2-CWRxZCiu.js} +1 -1
  537. package/dist/public/assets/{chunk-AXFCVDMN-Du6JRX1x.js → chunk-AXFCVDMN-Dgn3RHlx.js} +1 -1
  538. package/dist/public/assets/{chunk-BG4553SI-D592E55X.js → chunk-BG4553SI-BDnAChfb.js} +1 -1
  539. package/dist/public/assets/{chunk-DQASFODM-BW2r2SL4.js → chunk-DQASFODM-DSgprMfc.js} +1 -1
  540. package/dist/public/assets/{chunk-HFQBQIA3-C3yoe54R.js → chunk-HFQBQIA3-ChtjyKjP.js} +1 -1
  541. package/dist/public/assets/{chunk-KQLB2F66-DF8gfYCy.js → chunk-KQLB2F66-B2o0ufJC.js} +1 -1
  542. package/dist/public/assets/{chunk-KS47KZWR-C8CRMTv1.js → chunk-KS47KZWR-C4qJvDaX.js} +1 -1
  543. package/dist/public/assets/{chunk-LEVMRMFU-BDcMKiwj.js → chunk-LEVMRMFU-2jTGUstS.js} +1 -1
  544. package/dist/public/assets/{chunk-M57EVK23-CKJPBygc.js → chunk-M57EVK23-CKAWW7fj.js} +1 -1
  545. package/dist/public/assets/{chunk-OY52VR5R-B3ZWH07L.js → chunk-OY52VR5R-B5TUKZAt.js} +1 -1
  546. package/dist/public/assets/{chunk-QB3YPZ4I-DI-z4UPL.js → chunk-QB3YPZ4I-CyQFTqwG.js} +1 -1
  547. package/dist/public/assets/{chunk-R3KSYZAL-Bg4-haAc.js → chunk-R3KSYZAL-C6git_yh.js} +1 -1
  548. package/dist/public/assets/{chunk-STOXU5M4-l_SHib3p.js → chunk-STOXU5M4-AwEqcNnS.js} +1 -1
  549. package/dist/public/assets/{chunk-TU62E6Q5-BINu9tIm.js → chunk-TU62E6Q5-GKcRDmvw.js} +1 -1
  550. package/dist/public/assets/{chunk-X4PVCEUW-BQn-mvV5.js → chunk-X4PVCEUW-CMG5EfZ9.js} +1 -1
  551. package/dist/public/assets/{chunk-XXDRQBXY-uvpAu0Ys.js → chunk-XXDRQBXY-BHd-dKtZ.js} +1 -1
  552. package/dist/public/assets/{classDiagram-v2-L25IHNXF-BIowooW1.js → classDiagram-v2-L25IHNXF-HaRsBCG9.js} +1 -1
  553. package/dist/public/assets/{cose-bilkent-JH36ORCC-BTyx1Mh2.js → cose-bilkent-JH36ORCC-BPBTCfj3.js} +1 -1
  554. package/dist/public/assets/cynefin-EF2NZ3EQ-DyqqRII3.js +1 -0
  555. package/dist/public/assets/{cynefinDiagram-L36ESFBY-D64EU9I0.js → cynefinDiagram-L36ESFBY-dAmWDtva.js} +1 -1
  556. package/dist/public/assets/{d3-selection-CN9k6_B9.js → d3-selection-BhemR5ul.js} +1 -1
  557. package/dist/public/assets/{dagre-SPEB5RXH-FCbz2-Kk.js → dagre-SPEB5RXH-D93g6hNI.js} +1 -1
  558. package/dist/public/assets/{diagram-3B7GL73J-OhHUSI7j.js → diagram-3B7GL73J-FJBKgG3X.js} +1 -1
  559. package/dist/public/assets/{diagram-DNEMPZML-Be4xMtp6.js → diagram-DNEMPZML-BP22T976.js} +1 -1
  560. package/dist/public/assets/{diagram-L3MUGCDN-CmKSs3aG.js → diagram-L3MUGCDN-DcrCJXRt.js} +1 -1
  561. package/dist/public/assets/{diagram-LA4NIPWU-D1C32rMN.js → diagram-LA4NIPWU-DUgd3PHQ.js} +1 -1
  562. package/dist/public/assets/{diagram-MHCOC4E2-BjoE6JXs.js → diagram-MHCOC4E2-ejTInqzQ.js} +1 -1
  563. package/dist/public/assets/{diagram-XPFHEONP-B22k4v8R.js → diagram-XPFHEONP-BLjkgho1.js} +1 -1
  564. package/dist/public/assets/{dist-DcBP8Cf6.js → dist-C9xqTt0E.js} +1 -1
  565. package/dist/public/assets/{ebnfDiagram-UZSYDL2S-Tn-K8-X7.js → ebnfDiagram-UZSYDL2S-CB1QQ4_T.js} +1 -1
  566. package/dist/public/assets/{editor.api-Bz4sjRz_.js → editor.api-lz6I1oVk.js} +1 -1
  567. package/dist/public/assets/{elk-XV6XMXQE-COnQsWlN.js → elk-XV6XMXQE-CLBx1s2b.js} +1 -1
  568. package/dist/public/assets/{erDiagram-EYBAPDEH-c53dJilq.js → erDiagram-EYBAPDEH-Dsj6RYi5.js} +1 -1
  569. package/dist/public/assets/{eventmodeling-K75KTNOO-DaFpPPks.js → eventmodeling-K75KTNOO-smOORsSG.js} +1 -1
  570. package/dist/public/assets/flowDiagram-MALGAFMO-DFmQPJ7B.js +1 -0
  571. package/dist/public/assets/{freemarker2-BLxfRHsw.js → freemarker2-DrLPw7Mc.js} +1 -1
  572. package/dist/public/assets/{ganttDiagram-23REXITY-Md-SavIS.js → ganttDiagram-23REXITY-BV9WK0rK.js} +1 -1
  573. package/dist/public/assets/gitGraph-VSP46ZUC-ybrJCK6u.js +1 -0
  574. package/dist/public/assets/{gitGraphDiagram-STJD7YCW-CMSwTghO.js → gitGraphDiagram-STJD7YCW-CsSpSQ0T.js} +1 -1
  575. package/dist/public/assets/{handlebars-sNpu01kP.js → handlebars-CLx5-csF.js} +1 -1
  576. package/dist/public/assets/{html-C_tKd-uP.js → html-C9LmGm46.js} +1 -1
  577. package/dist/public/assets/{index-Bn86rI4n.js → index-CLWW0mVu.js} +2 -2
  578. package/dist/public/assets/info-OHQRW6UA-n41_wZE4.js +1 -0
  579. package/dist/public/assets/{infoDiagram-KBXO4MBG-CwgNj-7i.js → infoDiagram-KBXO4MBG-wm5AnXDz.js} +1 -1
  580. package/dist/public/assets/{ishikawaDiagram-M35NCXHK-BSlzQNMN.js → ishikawaDiagram-M35NCXHK-BLUBDeS3.js} +1 -1
  581. package/dist/public/assets/{javascript-l3qKw0L-.js → javascript-C4S1eQb7.js} +1 -1
  582. package/dist/public/assets/{journeyDiagram-OPLOXDXO-B09LPEnF.js → journeyDiagram-OPLOXDXO-DXc7-I_g.js} +1 -1
  583. package/dist/public/assets/{jsonMode-5SQQn1EX.js → jsonMode-lLJKR2M6.js} +1 -1
  584. package/dist/public/assets/{kanban-definition-BZKZHSQY-BiW4aJ29.js → kanban-definition-BZKZHSQY-D5Ra4L_5.js} +1 -1
  585. package/dist/public/assets/{liquid-BGyTIIUt.js → liquid-DRlm-XZd.js} +1 -1
  586. package/dist/public/assets/{mdx-8tGjz4em.js → mdx-CzIqeqPy.js} +1 -1
  587. package/dist/public/assets/{mermaid-parser.core-CctN5b0z.js → mermaid-parser.core-BIPB1BgS.js} +3 -3
  588. package/dist/public/assets/{mermaid.core-7ERSdZ4-.js → mermaid.core-DxBlQ6oF.js} +4 -4
  589. package/dist/public/assets/{mindmap-definition-I2QAS2VK-D-GOUwW1.js → mindmap-definition-I2QAS2VK-BdupvuYr.js} +1 -1
  590. package/dist/public/assets/module-BPxWyxwR.js +2362 -0
  591. package/dist/public/assets/module-C_MSCGQC.js +1 -0
  592. package/dist/public/assets/{monaco-B_9hlk78.js → monaco-ChpJIYsY.js} +3 -3
  593. package/dist/public/assets/packet-JDAUHWVQ-BjrqMgis.js +1 -0
  594. package/dist/public/assets/{pegDiagram-FD4XPPHP-Dmy1fWB3.js → pegDiagram-FD4XPPHP-C_GF7Fng.js} +1 -1
  595. package/dist/public/assets/pie-XZMESJXO-CJSA88kr.js +1 -0
  596. package/dist/public/assets/{pieDiagram-J4AKIIQI-CXFHLYTg.js → pieDiagram-J4AKIIQI-WlpNP-IM.js} +1 -1
  597. package/dist/public/assets/{python-e-JK0s5M.js → python-BJgFCfc8.js} +1 -1
  598. package/dist/public/assets/{quadrantDiagram-XTYBLID2-RQvEpGWO.js → quadrantDiagram-XTYBLID2-CkCL5rJY.js} +1 -1
  599. package/dist/public/assets/radar-ABXABTNO-4nLUXAkG.js +1 -0
  600. package/dist/public/assets/railroad-I3PHUGI6-BD2LqZSr.js +1 -0
  601. package/dist/public/assets/{railroad-abnf-LNEFI6M7-CDOSPZwX.js → railroad-abnf-LNEFI6M7-DZZKUytl.js} +1 -1
  602. package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-BTrNQ0DX.js → railroad-ebnf-DWYD2UWJ-CS7KsJdb.js} +1 -1
  603. package/dist/public/assets/{railroad-peg-JR7BVNR7-B7NtVofS.js → railroad-peg-JR7BVNR7-CiukTZVd.js} +1 -1
  604. package/dist/public/assets/{railroadDiagram-MRQ6NCDL-DsDrT0Jf.js → railroadDiagram-MRQ6NCDL-BS0R_H3-.js} +1 -1
  605. package/dist/public/assets/{razor-DtSPwumi.js → razor-jcBIjr45.js} +1 -1
  606. package/dist/public/assets/{requirementDiagram-Y7LWUY3S-BQh0hFuA.js → requirementDiagram-Y7LWUY3S-C0_T9jgl.js} +1 -1
  607. package/dist/public/assets/{sankeyDiagram-WGJFYUXA-BUXNAQEF.js → sankeyDiagram-WGJFYUXA-DF15sUfS.js} +1 -1
  608. package/dist/public/assets/{sequenceDiagram-5NDRBG5M-05f-N5V_.js → sequenceDiagram-5NDRBG5M-7AkTLleX.js} +1 -1
  609. package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-D6V1fGWV.js → stateDiagram-v2-FJ4FJNEA-CU3i-U9q.js} +1 -1
  610. package/dist/public/assets/{swimlanes-UMQ2AFYF-DWhlPvKs.js → swimlanes-UMQ2AFYF-CR-ieLeo.js} +1 -1
  611. package/dist/public/assets/swimlanesDiagram-OMPLPG4O-COK2pFDF.js +8 -0
  612. package/dist/public/assets/{timeline-definition-SEUHKTQE-CMdocOui.js → timeline-definition-SEUHKTQE-DeM0Uekm.js} +1 -1
  613. package/dist/public/assets/treeView-D4JQ5SDB-BL13z_2J.js +1 -0
  614. package/dist/public/assets/treemap-SAJKECNS-Lx2qjQpO.js +1 -0
  615. package/dist/public/assets/{typescript-65jNyipU.js → typescript-B7zp7QPf.js} +1 -1
  616. package/dist/public/assets/{usecaseDiagram-AFA6YXN4-BQTHUX1f.js → usecaseDiagram-AFA6YXN4-D6rDIgdU.js} +1 -1
  617. package/dist/public/assets/{vennDiagram-NNMJR3RB-BULkVTfA.js → vennDiagram-NNMJR3RB-CncVDcMl.js} +1 -1
  618. package/dist/public/assets/wardley-7MLQ67FV-B4j5rilS.js +1 -0
  619. package/dist/public/assets/{wardleyDiagram-S7YFUSEH-Cek6l8lz.js → wardleyDiagram-S7YFUSEH-DKPAMfTE.js} +1 -1
  620. package/dist/public/assets/{xml-DWBejfu-.js → xml-BJIgLD52.js} +1 -1
  621. package/dist/public/assets/{xychartDiagram-GGNKY7IX-ujnZQTWA.js → xychartDiagram-GGNKY7IX-DmmXGebm.js} +1 -1
  622. package/dist/public/assets/{yaml-CwRCT7q1.js → yaml-Dxb2gmP5.js} +1 -1
  623. package/dist/public/index.html +1 -1
  624. package/dist/serve/index.mjs +7767 -3392
  625. package/package.json +37 -31
  626. package/dist/pi/packages/ta-cron/lib/composer.d.ts +0 -11
  627. package/dist/pi/packages/ta-cron/lib/composer.js +0 -58
  628. package/dist/pi/packages/ta-extensions/lib/composer.d.ts +0 -17
  629. package/dist/pi/packages/ta-extensions/lib/composer.js +0 -84
  630. package/dist/pi/packages/ta-recall/lib/skill-card.d.ts +0 -9
  631. package/dist/pi/packages/ta-recall/lib/skill-card.js +0 -51
  632. package/dist/pi/packages/ta-recall/lib/skill-util.d.ts +0 -19
  633. package/dist/pi/packages/ta-recall/lib/skill-util.js +0 -110
  634. package/dist/public/assets/cynefin-EF2NZ3EQ-Dg54eFzZ.js +0 -1
  635. package/dist/public/assets/flowDiagram-MALGAFMO-V5qkYWIO.js +0 -1
  636. package/dist/public/assets/gitGraph-VSP46ZUC-1q8ldRXU.js +0 -1
  637. package/dist/public/assets/info-OHQRW6UA-Crere6sx.js +0 -1
  638. package/dist/public/assets/module-DEqsdd00.js +0 -1
  639. package/dist/public/assets/module-TWc52XwT.js +0 -2244
  640. package/dist/public/assets/packet-JDAUHWVQ-qMf5LkHT.js +0 -1
  641. package/dist/public/assets/pie-XZMESJXO-BjqLn4qm.js +0 -1
  642. package/dist/public/assets/radar-ABXABTNO-DWO6t_4C.js +0 -1
  643. package/dist/public/assets/railroad-I3PHUGI6-D1XOJPWy.js +0 -1
  644. package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CRn5uHsY.js +0 -8
  645. package/dist/public/assets/treeView-D4JQ5SDB-D09wHNzT.js +0 -1
  646. package/dist/public/assets/treemap-SAJKECNS-ChxAT7Fq.js +0 -1
  647. package/dist/public/assets/wardley-7MLQ67FV-DfSjKzbJ.js +0 -1
@@ -0,0 +1,385 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FolderSpace = exports.StoreSpace = exports.LocalFolderStore = exports.FolderSyncUtil = exports.FOLDER_PIECE = void 0;
4
+ const node_crypto_1 = require("node:crypto");
5
+ const node_fs_1 = require("node:fs");
6
+ const promises_1 = require("node:fs/promises");
7
+ const node_path_1 = require("node:path");
8
+ const sync_protocol_1 = require("./sync-protocol");
9
+ const CHECK = 'ta-sync folder v1';
10
+ const DIR = 'ta-sync';
11
+ /** A piece of a blob in a folder: no limit of a relay, so large; a file each. */
12
+ exports.FOLDER_PIECE = 4 * 1024 * 1024;
13
+ var FolderSyncUtil;
14
+ (function (FolderSyncUtil) {
15
+ function randomId() {
16
+ return (0, node_crypto_1.randomBytes)(16).toString('base64url');
17
+ }
18
+ FolderSyncUtil.randomId = randomId;
19
+ function randomKey() {
20
+ return (0, node_crypto_1.randomBytes)(32).toString('base64url');
21
+ }
22
+ FolderSyncUtil.randomKey = randomKey;
23
+ /** `ta-sync://folder#v=1&s=<space>&k=<key>&p=<folder>&n=<computer>`: the key in the fragment. */
24
+ function link(record, name) {
25
+ const fragment = new URLSearchParams({ v: '1', s: record.id, k: record.key, p: record.path, n: name });
26
+ return `ta-sync://folder#${fragment}`;
27
+ }
28
+ FolderSyncUtil.link = link;
29
+ /**
30
+ * `ta-sync://store#v=1&s=<space>&k=<key>&t=<type>&o=<options>&a=<its name>&n=<computer>`: the options of the store, its
31
+ * sign-in among them, in base64url JSON of the fragment, so that the other computer joins by the link alone.
32
+ */
33
+ function storeLink(record, config, name) {
34
+ const options = Buffer.from(JSON.stringify(config.options)).toString('base64url');
35
+ const fragment = new URLSearchParams({
36
+ v: '1',
37
+ s: record.id,
38
+ k: record.key,
39
+ t: config.type,
40
+ o: options,
41
+ ...(config.name ? { a: config.name } : {}),
42
+ n: name,
43
+ });
44
+ return `ta-sync://store#${fragment}`;
45
+ }
46
+ FolderSyncUtil.storeLink = storeLink;
47
+ function isStore(text) {
48
+ return String(text !== null && text !== void 0 ? text : '')
49
+ .trim()
50
+ .startsWith('ta-sync://store#');
51
+ }
52
+ FolderSyncUtil.isStore = isStore;
53
+ function parseStore(text) {
54
+ var _a, _b, _c;
55
+ const value = String(text !== null && text !== void 0 ? text : '').trim();
56
+ const fragment = new URLSearchParams(value.slice(value.indexOf('#') + 1));
57
+ const [id, key, type] = ['s', 'k', 't'].map(name => { var _a; return (_a = fragment.get(name)) !== null && _a !== void 0 ? _a : ''; });
58
+ let options;
59
+ try {
60
+ options = JSON.parse(Buffer.from((_a = fragment.get('o')) !== null && _a !== void 0 ? _a : '', 'base64url').toString('utf8'));
61
+ }
62
+ catch (_d) {
63
+ options = undefined;
64
+ }
65
+ if (!isStore(value) ||
66
+ fragment.get('v') !== '1' ||
67
+ !/^[A-Za-z0-9_-]{16,64}$/.test(id) ||
68
+ !/^[A-Za-z0-9_-]{43}$/.test(key) ||
69
+ !/^[a-z][a-z0-9-]{1,31}$/.test(type) ||
70
+ !options ||
71
+ typeof options !== 'object' ||
72
+ Array.isArray(options)) {
73
+ throw new Error('This is not a link of sync in a storage.');
74
+ }
75
+ return { id, key, type, options: options, service: (_b = fragment.get('a')) !== null && _b !== void 0 ? _b : '', name: (_c = fragment.get('n')) !== null && _c !== void 0 ? _c : '' };
76
+ }
77
+ FolderSyncUtil.parseStore = parseStore;
78
+ function is(text) {
79
+ return String(text !== null && text !== void 0 ? text : '')
80
+ .trim()
81
+ .startsWith('ta-sync://folder#');
82
+ }
83
+ FolderSyncUtil.is = is;
84
+ function parse(text) {
85
+ var _a;
86
+ const value = String(text !== null && text !== void 0 ? text : '').trim();
87
+ const fragment = new URLSearchParams(value.slice(value.indexOf('#') + 1));
88
+ const [id, key, path] = ['s', 'k', 'p'].map(name => { var _a; return (_a = fragment.get(name)) !== null && _a !== void 0 ? _a : ''; });
89
+ if (!is(value) || fragment.get('v') !== '1' || !/^[A-Za-z0-9_-]{16,64}$/.test(id) || !/^[A-Za-z0-9_-]{43}$/.test(key) || !path) {
90
+ throw new Error('This is not a link of sync in a folder.');
91
+ }
92
+ return { id, key, path, name: (_a = fragment.get('n')) !== null && _a !== void 0 ? _a : '' };
93
+ }
94
+ FolderSyncUtil.parse = parse;
95
+ })(FolderSyncUtil || (exports.FolderSyncUtil = FolderSyncUtil = {}));
96
+ /** A folder of this computer as a store (TaRelayStore): what a cloud drive keeps the same on the user's computers. */
97
+ class LocalFolderStore {
98
+ constructor(root) {
99
+ this.root = root;
100
+ }
101
+ async list(dir) {
102
+ const found = [];
103
+ const at = (0, node_path_1.join)(this.root, ...dir.split('/').filter(Boolean));
104
+ for (const entry of await (0, promises_1.readdir)(at, { withFileTypes: true }).catch(() => [])) {
105
+ // What a drive or a write leaves (`.…`, iCloud's placeholders) is not there yet.
106
+ if (entry.name.startsWith('.')) {
107
+ continue;
108
+ }
109
+ if (entry.isDirectory()) {
110
+ found.push({ name: entry.name, tag: '', dir: true });
111
+ }
112
+ else if (entry.isFile()) {
113
+ const info = await (0, promises_1.stat)((0, node_path_1.join)(at, entry.name)).catch(() => undefined);
114
+ if (info) {
115
+ found.push({ name: entry.name, tag: `${info.mtimeMs}:${info.size}` });
116
+ }
117
+ }
118
+ }
119
+ return found.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
120
+ }
121
+ async read(path) {
122
+ try {
123
+ return new Uint8Array(await (0, promises_1.readFile)(this.path(path)));
124
+ }
125
+ catch (_a) {
126
+ return undefined;
127
+ }
128
+ }
129
+ async write(path, data) {
130
+ const file = this.path(path);
131
+ const dir = (0, node_path_1.join)(file, '..');
132
+ await (0, promises_1.mkdir)(dir, { recursive: true });
133
+ // A name with a dot first: drives and this code leave it alone until it is renamed whole.
134
+ const temporary = (0, node_path_1.join)(dir, `.${file.split(node_path_1.sep).pop()}.${process.pid}.tmp`);
135
+ await (0, promises_1.writeFile)(temporary, data);
136
+ await (0, promises_1.rename)(temporary, file);
137
+ }
138
+ async remove(path) {
139
+ await (0, promises_1.rm)(this.path(path), { force: true });
140
+ }
141
+ /** Best effort: a system without recursive watching has the rounds of every while. */
142
+ watch(listener) {
143
+ let watcher;
144
+ try {
145
+ watcher = (0, node_fs_1.watch)(this.root, { recursive: true }, (_event, file) => listener(String(file !== null && file !== void 0 ? file : '')
146
+ .split(node_path_1.sep)
147
+ .join('/')));
148
+ watcher.on('error', () => undefined);
149
+ }
150
+ catch (_a) {
151
+ // None: the rounds find it.
152
+ }
153
+ return () => watcher === null || watcher === void 0 ? void 0 : watcher.close();
154
+ }
155
+ path(path) {
156
+ return (0, node_path_1.join)(this.root, ...path.split('/').filter(Boolean));
157
+ }
158
+ }
159
+ exports.LocalFolderStore = LocalFolderStore;
160
+ /**
161
+ * The space of a sync in a store (a folder, WebDAV, S3): what SyncEngine reads and writes (SyncRoom), sealed in files
162
+ * under `ta-sync/<space>/`. Files a round read are kept by their tags: a store far away is read only where it changed.
163
+ */
164
+ class StoreSpace {
165
+ constructor(store, record) {
166
+ this.store = store;
167
+ this.record = record;
168
+ this.piece = exports.FOLDER_PIECE;
169
+ this.opened = new Map();
170
+ this.key = Buffer.from(record.key, 'base64url');
171
+ this.root = `${DIR}/${record.id}`;
172
+ }
173
+ /** Makes the space: its check. */
174
+ async create() {
175
+ await this.store.write(`${this.root}/space.json`, Buffer.from(JSON.stringify({ v: 1, check: this.seal('space', CHECK).toString('base64') })));
176
+ }
177
+ /** Whether the space is in the store and the key opens it; why not, else. */
178
+ async check() {
179
+ const bytes = await this.store.read(`${this.root}/space.json`);
180
+ if (!bytes) {
181
+ return 'missing';
182
+ }
183
+ try {
184
+ const space = JSON.parse(Buffer.from(bytes).toString('utf8'));
185
+ if (space.v !== 1) {
186
+ return 'newer';
187
+ }
188
+ return this.open(Buffer.from(String(space.check), 'base64'), 'space') === CHECK ? undefined : 'key';
189
+ }
190
+ catch (_a) {
191
+ return 'key';
192
+ }
193
+ }
194
+ async getState(prefix) {
195
+ if (prefix.startsWith(sync_protocol_1.SyncStateKeys.BLOB)) {
196
+ return this.blobs(prefix);
197
+ }
198
+ if (prefix === sync_protocol_1.SyncStateKeys.DEVICE) {
199
+ const found = {};
200
+ for (const device of await this.devices()) {
201
+ found[sync_protocol_1.SyncStateKeys.device(device.device)] = { value: device, version: 1 };
202
+ }
203
+ return found;
204
+ }
205
+ const found = {};
206
+ for (const [key, entry] of await this.items()) {
207
+ if (key.startsWith(prefix) && entry.value !== null) {
208
+ found[key] = { value: entry.value, version: entry.v };
209
+ }
210
+ }
211
+ return found;
212
+ }
213
+ /**
214
+ * An item on the version read: refused when another computer wrote a later one since. A store gives no lock, so
215
+ * two computers may still write the same version at once: the later wins on every computer, and the other finds
216
+ * its change gone on its next round, which merges it again (SyncMerge).
217
+ */
218
+ async setState(key, value, version) {
219
+ var _a;
220
+ if (key.startsWith(sync_protocol_1.SyncStateKeys.BLOB)) {
221
+ const path = `${this.root}/blobs/${this.blobName(key)}`;
222
+ if (value === null) {
223
+ await this.store.remove(path);
224
+ }
225
+ else {
226
+ await this.store.write(path, this.seal(key, value));
227
+ }
228
+ return { ok: true, version: 1 };
229
+ }
230
+ if (key.startsWith(sync_protocol_1.SyncStateKeys.DEVICE)) {
231
+ await this.store.write(`${this.root}/devices/${this.record.device}/device`, this.seal('device', value));
232
+ return { ok: true, version: 1 };
233
+ }
234
+ const current = (await this.items()).get(key);
235
+ const seen = current && current.value !== null ? current.v : 0;
236
+ if (version !== undefined && version !== seen) {
237
+ return { ok: false, version: seen };
238
+ }
239
+ const v = Math.max((_a = current === null || current === void 0 ? void 0 : current.v) !== null && _a !== void 0 ? _a : 0, version !== null && version !== void 0 ? version : 0) + 1;
240
+ const sealed = { key, value: value !== null && value !== void 0 ? value : null, v };
241
+ await this.store.write(`${this.root}/devices/${this.record.device}/items/${this.name(key)}`, this.seal(this.name(key), sealed));
242
+ return { ok: true, version: v };
243
+ }
244
+ /** The computers that synced here, as each says of itself. */
245
+ async devices() {
246
+ const devices = [];
247
+ for (const device of await this.dirs(`${this.root}/devices`)) {
248
+ const files = await this.store.list(`${this.root}/devices/${device}`);
249
+ const file = files.find(each => each.name === 'device' && !each.dir);
250
+ const value = file && (await this.cached(`${this.root}/devices/${device}/device`, file.tag, 'device'));
251
+ if (value) {
252
+ devices.push({ ...value, device });
253
+ }
254
+ }
255
+ return devices;
256
+ }
257
+ /** What the files of the other computers are now, by their names and tags: another computer wrote when it changes. */
258
+ async signature() {
259
+ const parts = [];
260
+ for (const device of await this.dirs(`${this.root}/devices`)) {
261
+ if (device === this.record.device) {
262
+ continue;
263
+ }
264
+ for (const file of await this.store.list(`${this.root}/devices/${device}/items`)) {
265
+ parts.push(`${device}/${file.name}:${file.tag}`);
266
+ }
267
+ }
268
+ return parts.join('\n');
269
+ }
270
+ /** Hears the other computers write, where the store can tell (a folder); the rounds of every while stay. */
271
+ watch(listener) {
272
+ if (!this.store.watch) {
273
+ return () => undefined;
274
+ }
275
+ return this.store.watch(path => {
276
+ var _a;
277
+ // What this computer wrote is not news; temporary files neither; nor other spaces.
278
+ if (path !== undefined &&
279
+ (!path.startsWith(`${this.root}/`) || path.includes(`devices/${this.record.device}/`) || ((_a = path.split('/').pop()) === null || _a === void 0 ? void 0 : _a.startsWith('.')))) {
280
+ return;
281
+ }
282
+ listener();
283
+ });
284
+ }
285
+ /** Every item, as the latest version any computer wrote of it. */
286
+ async items() {
287
+ const latest = new Map();
288
+ for (const device of await this.dirs(`${this.root}/devices`)) {
289
+ const dir = `${this.root}/devices/${device}/items`;
290
+ for (const file of await this.store.list(dir)) {
291
+ if (file.dir) {
292
+ continue;
293
+ }
294
+ const sealed = await this.cached(`${dir}/${file.name}`, file.tag, file.name);
295
+ if (!sealed || typeof sealed.key !== 'string' || typeof sealed.v !== 'number' || this.name(sealed.key) !== file.name) {
296
+ continue;
297
+ }
298
+ const before = latest.get(sealed.key);
299
+ const later = !before || sealed.v > before.v || (sealed.v === before.v && device > before.device);
300
+ if (later) {
301
+ latest.set(sealed.key, { ...sealed, device });
302
+ }
303
+ }
304
+ }
305
+ return latest;
306
+ }
307
+ async blobs(prefix) {
308
+ // `blob:<hash>:`: the pieces of one content.
309
+ const hash = prefix.slice(sync_protocol_1.SyncStateKeys.BLOB.length).replace(/:$/, '');
310
+ const stem = `${this.name(`blob:${hash}`)}.`;
311
+ const found = {};
312
+ for (const file of await this.store.list(`${this.root}/blobs`)) {
313
+ if (file.dir || !file.name.startsWith(stem)) {
314
+ continue;
315
+ }
316
+ const index = Number(file.name.slice(stem.length));
317
+ const key = sync_protocol_1.SyncStateKeys.blob(hash, index);
318
+ const value = Number.isInteger(index) ? await this.read(`${this.root}/blobs/${file.name}`, key) : undefined;
319
+ if (value !== undefined) {
320
+ found[key] = { value, version: 1 };
321
+ }
322
+ }
323
+ return found;
324
+ }
325
+ async dirs(dir) {
326
+ return (await this.store.list(dir)).filter(entry => entry.dir).map(entry => entry.name);
327
+ }
328
+ blobName(key) {
329
+ const [, hash, index] = key.split(':');
330
+ return `${this.name(`blob:${hash}`)}.${Number(index)}`;
331
+ }
332
+ name(key) {
333
+ return (0, node_crypto_1.createHmac)('sha256', this.key).update(`name\n${key}`).digest('base64url').slice(0, 32);
334
+ }
335
+ seal(aad, value) {
336
+ const iv = (0, node_crypto_1.randomBytes)(12);
337
+ const cipher = (0, node_crypto_1.createCipheriv)('aes-256-gcm', this.key, iv);
338
+ cipher.setAAD(Buffer.from(aad));
339
+ const body = Buffer.concat([cipher.update(JSON.stringify(value)), cipher.final()]);
340
+ return Buffer.concat([iv, cipher.getAuthTag(), body]);
341
+ }
342
+ open(sealed, aad) {
343
+ const decipher = (0, node_crypto_1.createDecipheriv)('aes-256-gcm', this.key, sealed.subarray(0, 12));
344
+ decipher.setAAD(Buffer.from(aad));
345
+ decipher.setAuthTag(sealed.subarray(12, 28));
346
+ return JSON.parse(Buffer.concat([decipher.update(sealed.subarray(28)), decipher.final()]).toString('utf8'));
347
+ }
348
+ /** A file opened, again only once its tag changed. */
349
+ async cached(path, tag, aad) {
350
+ const known = this.opened.get(path);
351
+ if (tag && (known === null || known === void 0 ? void 0 : known.tag) === tag) {
352
+ return known.value;
353
+ }
354
+ const value = await this.read(path, aad);
355
+ if (value !== undefined && tag) {
356
+ this.opened.set(path, { tag, value });
357
+ }
358
+ return value;
359
+ }
360
+ /** A file of the space, opened; undefined when it is not there yet (the drive still bringing it) or does not open. */
361
+ async read(path, aad) {
362
+ try {
363
+ const bytes = await this.store.read(path);
364
+ return bytes ? this.open(Buffer.from(bytes), aad) : undefined;
365
+ }
366
+ catch (_a) {
367
+ return undefined;
368
+ }
369
+ }
370
+ }
371
+ exports.StoreSpace = StoreSpace;
372
+ /** The space of a sync in a folder of this computer. */
373
+ class FolderSpace extends StoreSpace {
374
+ constructor(
375
+ /** The folder, as it is on this computer. */
376
+ folder, record) {
377
+ super(new LocalFolderStore(folder), record);
378
+ this.folder = folder;
379
+ }
380
+ get dir() {
381
+ return (0, node_path_1.join)(this.folder, DIR, this.record.id);
382
+ }
383
+ }
384
+ exports.FolderSpace = FolderSpace;
385
+ //# sourceMappingURL=sync-folder.js.map
@@ -0,0 +1,60 @@
1
+ import type { TaIdentityBundle, TaRoomRecord } from '@celljs/ta-protocol';
2
+ import type { SyncRoom } from './sync-engine';
3
+ import type { SyncHostSide } from './sync-items';
4
+ /**
5
+ * Keys of the space for the identity the user's computers share (docs/design/ta-sync.md 9): the identity, a key per
6
+ * membership of a room (its member id), and the friends.
7
+ */
8
+ export declare namespace SyncIdentityKeys {
9
+ const PREFIX = "id:";
10
+ const IDENTITY = "id:identity";
11
+ const ROOM = "id:room:";
12
+ const FRIENDS = "id:friends";
13
+ function room(member: string): string;
14
+ }
15
+ /** What both had after the last round here: the name, and the memberships and friends both had, to tell what one let go. */
16
+ export interface SyncIdentityBase {
17
+ name?: string;
18
+ rooms: string[];
19
+ friends: string[];
20
+ }
21
+ export interface SyncIdentityReport {
22
+ /** This computer took on the identity of the space. */
23
+ switched: boolean;
24
+ sent: number;
25
+ received: number;
26
+ }
27
+ /** What the round needs of ta serve: TaRooms, for ta-sync alone. */
28
+ export type SyncIdentitySide = NonNullable<SyncHostSide['identity']>;
29
+ type Friend = TaIdentityBundle['friends'][number];
30
+ /**
31
+ * One round of the identity shared by the user's computers: the first to turn it on puts its identity in the space, the
32
+ * others take it on (their rooms keep the identity they joined with); then each membership of a room and the friends go
33
+ * both ways, merged as RelayHubsUtil merges them, what one computer let go (left, forgot) let go on the others.
34
+ * `skip` tells the rooms each computer keeps for itself (the room of the sync).
35
+ */
36
+ export declare class SyncIdentity {
37
+ protected readonly room: SyncRoom;
38
+ protected readonly side: SyncIdentitySide;
39
+ protected readonly skip: (record: TaRoomRecord) => boolean;
40
+ constructor(room: SyncRoom, side: SyncIdentitySide, skip: (record: TaRoomRecord) => boolean);
41
+ round(base: SyncIdentityBase): Promise<SyncIdentityReport>;
42
+ protected rooms(space: Record<string, {
43
+ value: unknown;
44
+ version: number;
45
+ }>, base: SyncIdentityBase, report: SyncIdentityReport): Promise<void>;
46
+ protected friends(space: Record<string, {
47
+ value: unknown;
48
+ version: number;
49
+ }>, base: SyncIdentityBase, report: SyncIdentityReport): Promise<void>;
50
+ }
51
+ export declare namespace SyncIdentityUtil {
52
+ function isIdentity(value: unknown): value is TaIdentityBundle['identity'];
53
+ function isRecord(value: unknown): value is TaRoomRecord;
54
+ function isFriend(value: unknown): value is Friend;
55
+ /** The identity as it goes to the others: whether it is shared each computer says for itself. */
56
+ function portable(identity: TaIdentityBundle['identity']): TaIdentityBundle['identity'];
57
+ function byId(friends: Friend[]): Friend[];
58
+ }
59
+ export {};
60
+ //# sourceMappingURL=sync-identity.d.ts.map
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SyncIdentityUtil = exports.SyncIdentity = exports.SyncIdentityKeys = void 0;
4
+ const sync_merge_1 = require("./sync-merge");
5
+ /**
6
+ * Keys of the space for the identity the user's computers share (docs/design/ta-sync.md 9): the identity, a key per
7
+ * membership of a room (its member id), and the friends.
8
+ */
9
+ var SyncIdentityKeys;
10
+ (function (SyncIdentityKeys) {
11
+ SyncIdentityKeys.PREFIX = 'id:';
12
+ SyncIdentityKeys.IDENTITY = 'id:identity';
13
+ SyncIdentityKeys.ROOM = 'id:room:';
14
+ SyncIdentityKeys.FRIENDS = 'id:friends';
15
+ function room(member) {
16
+ return `${SyncIdentityKeys.ROOM}${member}`;
17
+ }
18
+ SyncIdentityKeys.room = room;
19
+ })(SyncIdentityKeys || (exports.SyncIdentityKeys = SyncIdentityKeys = {}));
20
+ /** The friends kept in the space, those seen last: one value of a room holds about 200. */
21
+ const MAX_FRIENDS = 150;
22
+ /**
23
+ * One round of the identity shared by the user's computers: the first to turn it on puts its identity in the space, the
24
+ * others take it on (their rooms keep the identity they joined with); then each membership of a room and the friends go
25
+ * both ways, merged as RelayHubsUtil merges them, what one computer let go (left, forgot) let go on the others.
26
+ * `skip` tells the rooms each computer keeps for itself (the room of the sync).
27
+ */
28
+ class SyncIdentity {
29
+ constructor(room, side, skip) {
30
+ this.room = room;
31
+ this.side = side;
32
+ this.skip = skip;
33
+ }
34
+ async round(base) {
35
+ var _a;
36
+ const report = { switched: false, sent: 0, received: 0 };
37
+ const space = await this.room.getState(SyncIdentityKeys.PREFIX);
38
+ let local = await this.side.exportIdentity();
39
+ const there = space[SyncIdentityKeys.IDENTITY];
40
+ const theirs = SyncIdentityUtil.isIdentity(there === null || there === void 0 ? void 0 : there.value) ? there.value : undefined;
41
+ if (!theirs) {
42
+ if (!(await this.room.setState(SyncIdentityKeys.IDENTITY, SyncIdentityUtil.portable(local.identity), (_a = there === null || there === void 0 ? void 0 : there.version) !== null && _a !== void 0 ? _a : 0)).ok) {
43
+ // Another computer put its identity first: the next round takes it on.
44
+ return report;
45
+ }
46
+ await this.side.setIdentityShared(true);
47
+ base.name = local.identity.name;
48
+ report.sent++;
49
+ }
50
+ else if (theirs.id !== local.identity.id) {
51
+ await this.side.importIdentity({ identity: theirs, rooms: [], friends: [] }, { shared: true });
52
+ report.switched = true;
53
+ report.received++;
54
+ base.name = theirs.name;
55
+ base.rooms = [];
56
+ base.friends = [];
57
+ local = await this.side.exportIdentity();
58
+ }
59
+ else {
60
+ if (!local.identity.shared) {
61
+ await this.side.setIdentityShared(true);
62
+ }
63
+ if (local.identity.name !== theirs.name) {
64
+ if (base.name === theirs.name) {
65
+ const named = { ...theirs, name: local.identity.name };
66
+ if ((await this.room.setState(SyncIdentityKeys.IDENTITY, named, there === null || there === void 0 ? void 0 : there.version)).ok) {
67
+ report.sent++;
68
+ }
69
+ }
70
+ else {
71
+ await this.side.setName(theirs.name);
72
+ report.received++;
73
+ }
74
+ }
75
+ base.name = (await this.side.exportIdentity()).identity.name;
76
+ }
77
+ await this.rooms(space, base, report);
78
+ await this.friends(space, base, report);
79
+ return report;
80
+ }
81
+ async rooms(space, base, report) {
82
+ var _a;
83
+ var _b, _c;
84
+ const remote = new Map();
85
+ for (const [key, entry] of Object.entries(space)) {
86
+ if (key.startsWith(SyncIdentityKeys.ROOM)) {
87
+ remote.set(key.slice(SyncIdentityKeys.ROOM.length), {
88
+ ...(SyncIdentityUtil.isRecord(entry.value) ? { value: entry.value } : {}),
89
+ version: entry.version,
90
+ });
91
+ }
92
+ }
93
+ const had = new Set(base.rooms);
94
+ const before = await this.side.exportIdentity();
95
+ const mine = new Map(before.rooms.filter(record => !this.skip(record)).map(record => [record.member, record]));
96
+ const rooms = new Map(before.rooms.map(record => [record.id, record]));
97
+ // What came: added or merged here; what this computer let go: let go there; what another let go: here.
98
+ for (const [member, { value, version }] of remote) {
99
+ const local = mine.get(member);
100
+ if (value && local) {
101
+ if (!sync_merge_1.SyncMerge.same(value, local) && (await this.side.upsertRoom(value))) {
102
+ report.received++;
103
+ }
104
+ }
105
+ else if (value && had.has(member)) {
106
+ await this.room.setState(SyncIdentityKeys.room(member), null, version);
107
+ report.sent++;
108
+ }
109
+ else if (value && !this.skip(value) && ((_b = (_a = rooms.get(value.id)) === null || _a === void 0 ? void 0 : _a.member) !== null && _b !== void 0 ? _b : member) === member) {
110
+ if (await this.side.upsertRoom(value)) {
111
+ report.received++;
112
+ }
113
+ }
114
+ else if (!value && local && had.has(member)) {
115
+ if (await this.side.forgetRoom(local.id, member)) {
116
+ report.received++;
117
+ }
118
+ }
119
+ }
120
+ for (const member of had) {
121
+ const local = mine.get(member);
122
+ if (local && !remote.has(member) && (await this.side.forgetRoom(local.id, member))) {
123
+ report.received++;
124
+ }
125
+ }
126
+ // What this computer has that the space has not, or not as merged here.
127
+ const after = await this.side.exportIdentity();
128
+ const kept = [];
129
+ for (const record of after.rooms.filter(each => !this.skip(each))) {
130
+ const there = remote.get(record.member);
131
+ if ((there === null || there === void 0 ? void 0 : there.value) && sync_merge_1.SyncMerge.same(there.value, record)) {
132
+ kept.push(record.member);
133
+ continue;
134
+ }
135
+ if (!(there === null || there === void 0 ? void 0 : there.value) && had.has(record.member)) {
136
+ continue;
137
+ }
138
+ if ((await this.room.setState(SyncIdentityKeys.room(record.member), record, (_c = there === null || there === void 0 ? void 0 : there.version) !== null && _c !== void 0 ? _c : 0)).ok) {
139
+ kept.push(record.member);
140
+ report.sent++;
141
+ }
142
+ }
143
+ base.rooms = kept;
144
+ }
145
+ async friends(space, base, report) {
146
+ var _a;
147
+ const there = space[SyncIdentityKeys.FRIENDS];
148
+ const remote = Array.isArray(there === null || there === void 0 ? void 0 : there.value) ? there.value.filter(SyncIdentityUtil.isFriend) : [];
149
+ const had = new Set(base.friends);
150
+ const local = (await this.side.exportIdentity()).friends;
151
+ const localIds = new Set(local.map(friend => friend.id));
152
+ const remoteIds = new Set(remote.map(friend => friend.id));
153
+ // A friend one computer removed: removed on the others, never brought back.
154
+ for (const friend of local) {
155
+ if (had.has(friend.id) && !remoteIds.has(friend.id) && (await this.side.removeFriend(friend.id))) {
156
+ report.received++;
157
+ }
158
+ }
159
+ const taken = remote.filter(friend => !(had.has(friend.id) && !localIds.has(friend.id)));
160
+ if (taken.length && (await this.side.mergeFriends(taken))) {
161
+ report.received++;
162
+ }
163
+ const merged = (await this.side.exportIdentity()).friends.sort((a, b) => b.seenAt - a.seenAt).slice(0, MAX_FRIENDS);
164
+ if (!sync_merge_1.SyncMerge.same(SyncIdentityUtil.byId(merged), SyncIdentityUtil.byId(remote))) {
165
+ if ((await this.room.setState(SyncIdentityKeys.FRIENDS, merged, (_a = there === null || there === void 0 ? void 0 : there.version) !== null && _a !== void 0 ? _a : 0)).ok) {
166
+ report.sent++;
167
+ }
168
+ }
169
+ base.friends = merged.map(friend => friend.id);
170
+ }
171
+ }
172
+ exports.SyncIdentity = SyncIdentity;
173
+ var SyncIdentityUtil;
174
+ (function (SyncIdentityUtil) {
175
+ function isIdentity(value) {
176
+ const identity = value;
177
+ return sync_merge_1.SyncMerge.isObject(value) && typeof identity.id === 'string' && typeof identity.name === 'string' && sync_merge_1.SyncMerge.isObject(identity.signKey);
178
+ }
179
+ SyncIdentityUtil.isIdentity = isIdentity;
180
+ function isRecord(value) {
181
+ const record = value;
182
+ return sync_merge_1.SyncMerge.isObject(value) && typeof record.id === 'string' && typeof record.member === 'string' && typeof record.status === 'string';
183
+ }
184
+ SyncIdentityUtil.isRecord = isRecord;
185
+ function isFriend(value) {
186
+ const friend = value;
187
+ return sync_merge_1.SyncMerge.isObject(value) && typeof friend.id === 'string' && typeof friend.seenAt === 'number';
188
+ }
189
+ SyncIdentityUtil.isFriend = isFriend;
190
+ /** The identity as it goes to the others: whether it is shared each computer says for itself. */
191
+ function portable(identity) {
192
+ const { shared: _shared, ...rest } = identity;
193
+ return rest;
194
+ }
195
+ SyncIdentityUtil.portable = portable;
196
+ function byId(friends) {
197
+ return [...friends].sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
198
+ }
199
+ SyncIdentityUtil.byId = byId;
200
+ })(SyncIdentityUtil || (exports.SyncIdentityUtil = SyncIdentityUtil = {}));
201
+ //# sourceMappingURL=sync-identity.js.map