briyah 1.0.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 (354) hide show
  1. package/.prettierrc +7 -0
  2. package/dist/ai/LLM/anthropic.module.d.ts +2 -0
  3. package/dist/ai/LLM/anthropic.module.js +21 -0
  4. package/dist/ai/LLM/anthropic.service.d.ts +27 -0
  5. package/dist/ai/LLM/anthropic.service.js +329 -0
  6. package/dist/ai/LLM/base-ai.service.d.ts +45 -0
  7. package/dist/ai/LLM/base-ai.service.js +409 -0
  8. package/dist/ai/LLM/deepseek.module.d.ts +2 -0
  9. package/dist/ai/LLM/deepseek.module.js +21 -0
  10. package/dist/ai/LLM/deepseek.service.d.ts +15 -0
  11. package/dist/ai/LLM/deepseek.service.js +279 -0
  12. package/dist/ai/LLM/fal.module.d.ts +2 -0
  13. package/dist/ai/LLM/fal.module.js +21 -0
  14. package/dist/ai/LLM/fal.service.d.ts +17 -0
  15. package/dist/ai/LLM/fal.service.js +314 -0
  16. package/dist/ai/LLM/googleai.module.d.ts +2 -0
  17. package/dist/ai/LLM/googleai.module.js +21 -0
  18. package/dist/ai/LLM/googleai.service.d.ts +20 -0
  19. package/dist/ai/LLM/googleai.service.js +271 -0
  20. package/dist/ai/LLM/grok.module.d.ts +2 -0
  21. package/dist/ai/LLM/grok.module.js +21 -0
  22. package/dist/ai/LLM/grok.service.d.ts +14 -0
  23. package/dist/ai/LLM/grok.service.js +263 -0
  24. package/dist/ai/LLM/mock.module.d.ts +2 -0
  25. package/dist/ai/LLM/mock.module.js +21 -0
  26. package/dist/ai/LLM/mock.service.d.ts +13 -0
  27. package/dist/ai/LLM/mock.service.js +194 -0
  28. package/dist/ai/LLM/openai.module.d.ts +2 -0
  29. package/dist/ai/LLM/openai.module.js +21 -0
  30. package/dist/ai/LLM/openai.service.d.ts +21 -0
  31. package/dist/ai/LLM/openai.service.js +421 -0
  32. package/dist/ai/LLM/together.module.d.ts +2 -0
  33. package/dist/ai/LLM/together.module.js +21 -0
  34. package/dist/ai/LLM/together.service.d.ts +18 -0
  35. package/dist/ai/LLM/together.service.js +285 -0
  36. package/dist/ai/LLM/vertexai.module.d.ts +2 -0
  37. package/dist/ai/LLM/vertexai.module.js +21 -0
  38. package/dist/ai/LLM/vertexai.service.d.ts +17 -0
  39. package/dist/ai/LLM/vertexai.service.js +323 -0
  40. package/dist/ai/agent-config.d.ts +32 -0
  41. package/dist/ai/agent-config.js +2 -0
  42. package/dist/ai/agent-factory.d.ts +15 -0
  43. package/dist/ai/agent-factory.js +24 -0
  44. package/dist/ai/agent-message.service.d.ts +9 -0
  45. package/dist/ai/agent-message.service.js +56 -0
  46. package/dist/ai/agent-store.module.d.ts +2 -0
  47. package/dist/ai/agent-store.module.js +21 -0
  48. package/dist/ai/agent-store.service.d.ts +31 -0
  49. package/dist/ai/agent-store.service.js +352 -0
  50. package/dist/ai/agent.d.ts +75 -0
  51. package/dist/ai/agent.js +174 -0
  52. package/dist/ai/ai-factory.module.d.ts +2 -0
  53. package/dist/ai/ai-factory.module.js +40 -0
  54. package/dist/ai/ai-factory.service.d.ts +24 -0
  55. package/dist/ai/ai-factory.service.js +94 -0
  56. package/dist/ai/artifact.module.d.ts +2 -0
  57. package/dist/ai/artifact.module.js +22 -0
  58. package/dist/ai/artifact.service.d.ts +21 -0
  59. package/dist/ai/artifact.service.js +239 -0
  60. package/dist/ai/attached-file.module.d.ts +2 -0
  61. package/dist/ai/attached-file.module.js +22 -0
  62. package/dist/ai/attached-file.service.d.ts +35 -0
  63. package/dist/ai/attached-file.service.js +253 -0
  64. package/dist/ai/model_prices.d.ts +2 -0
  65. package/dist/ai/model_prices.js +54 -0
  66. package/dist/ai/published-agents.service.d.ts +13 -0
  67. package/dist/ai/published-agents.service.js +118 -0
  68. package/dist/app/balance-message.service.d.ts +8 -0
  69. package/dist/app/balance-message.service.js +45 -0
  70. package/dist/app/balance.module.d.ts +2 -0
  71. package/dist/app/balance.module.js +20 -0
  72. package/dist/app/balance.service.d.ts +18 -0
  73. package/dist/app/balance.service.js +158 -0
  74. package/dist/app/stripe.controller.d.ts +31 -0
  75. package/dist/app/stripe.controller.js +150 -0
  76. package/dist/app/stripe.module.d.ts +2 -0
  77. package/dist/app/stripe.module.js +22 -0
  78. package/dist/app/stripe.service.d.ts +28 -0
  79. package/dist/app/stripe.service.js +198 -0
  80. package/dist/app/transaction.service.d.ts +15 -0
  81. package/dist/app/transaction.service.js +139 -0
  82. package/dist/app/user-service-factory.d.ts +21 -0
  83. package/dist/app/user-service-factory.js +81 -0
  84. package/dist/app/user-service-manager.d.ts +28 -0
  85. package/dist/app/user-service-manager.js +102 -0
  86. package/dist/app.controller.d.ts +232 -0
  87. package/dist/app.controller.js +2536 -0
  88. package/dist/app.module.d.ts +2 -0
  89. package/dist/app.module.js +45 -0
  90. package/dist/app.service.d.ts +186 -0
  91. package/dist/app.service.js +1334 -0
  92. package/dist/auth/agent-access.decorator.d.ts +2 -0
  93. package/dist/auth/agent-access.decorator.js +10 -0
  94. package/dist/auth/auth.controller.d.ts +38 -0
  95. package/dist/auth/auth.controller.js +356 -0
  96. package/dist/auth/auth.module.d.ts +2 -0
  97. package/dist/auth/auth.module.js +55 -0
  98. package/dist/auth/auth.service.d.ts +14 -0
  99. package/dist/auth/auth.service.js +84 -0
  100. package/dist/auth/dto/bot-login.dto.d.ts +4 -0
  101. package/dist/auth/dto/bot-login.dto.js +2 -0
  102. package/dist/auth/dto/password-reset.dto.d.ts +11 -0
  103. package/dist/auth/dto/password-reset.dto.js +2 -0
  104. package/dist/auth/dto/phone-login.dto.d.ts +8 -0
  105. package/dist/auth/dto/phone-login.dto.js +2 -0
  106. package/dist/auth/dto/phone-verification.dto.d.ts +9 -0
  107. package/dist/auth/dto/phone-verification.dto.js +2 -0
  108. package/dist/auth/jwt-auth.guard.d.ts +13 -0
  109. package/dist/auth/jwt-auth.guard.js +143 -0
  110. package/dist/auth/jwt.strategy.d.ts +17 -0
  111. package/dist/auth/jwt.strategy.js +45 -0
  112. package/dist/auth/phone-validation.service.d.ts +7 -0
  113. package/dist/auth/phone-validation.service.js +50 -0
  114. package/dist/auth/public.decorator.d.ts +2 -0
  115. package/dist/auth/public.decorator.js +7 -0
  116. package/dist/auth/rate-limit.service.d.ts +16 -0
  117. package/dist/auth/rate-limit.service.js +84 -0
  118. package/dist/auth/room-access.decorator.d.ts +2 -0
  119. package/dist/auth/room-access.decorator.js +10 -0
  120. package/dist/auth/scopes.decorator.d.ts +2 -0
  121. package/dist/auth/scopes.decorator.js +7 -0
  122. package/dist/auth/scopes.guard.d.ts +9 -0
  123. package/dist/auth/scopes.guard.js +82 -0
  124. package/dist/auth/session.guard.d.ts +7 -0
  125. package/dist/auth/session.guard.js +55 -0
  126. package/dist/auth/twilio.service.d.ts +15 -0
  127. package/dist/auth/twilio.service.js +139 -0
  128. package/dist/auth/users.service.d.ts +24 -0
  129. package/dist/auth/users.service.js +149 -0
  130. package/dist/common/errors.d.ts +12 -0
  131. package/dist/common/errors.js +43 -0
  132. package/dist/config/configuration.module.d.ts +2 -0
  133. package/dist/config/configuration.module.js +20 -0
  134. package/dist/config/configuration.service.d.ts +26 -0
  135. package/dist/config/configuration.service.js +131 -0
  136. package/dist/main.js +15749 -0
  137. package/dist/room/artifact-store.service.d.ts +15 -0
  138. package/dist/room/artifact-store.service.js +226 -0
  139. package/dist/room/artifact.d.ts +6 -0
  140. package/dist/room/artifact.js +2 -0
  141. package/dist/room/message.d.ts +19 -0
  142. package/dist/room/message.js +70 -0
  143. package/dist/room/published-rooms.service.d.ts +12 -0
  144. package/dist/room/published-rooms.service.js +108 -0
  145. package/dist/room/room-config.d.ts +12 -0
  146. package/dist/room/room-config.js +2 -0
  147. package/dist/room/room-factory.d.ts +7 -0
  148. package/dist/room/room-factory.js +16 -0
  149. package/dist/room/room-message.module.d.ts +2 -0
  150. package/dist/room/room-message.module.js +21 -0
  151. package/dist/room/room-message.service.d.ts +8 -0
  152. package/dist/room/room-message.service.js +44 -0
  153. package/dist/room/room-store.module.d.ts +2 -0
  154. package/dist/room/room-store.module.js +25 -0
  155. package/dist/room/room-store.service.d.ts +38 -0
  156. package/dist/room/room-store.service.js +353 -0
  157. package/dist/room/room.d.ts +107 -0
  158. package/dist/room/room.js +833 -0
  159. package/dist/sdk/briyah-config.d.ts +13 -0
  160. package/dist/sdk/briyah-config.js +32 -0
  161. package/dist/sdk/briyah.d.ts +36 -0
  162. package/dist/sdk/briyah.js +122 -0
  163. package/dist/sdk/index.d.ts +6 -0
  164. package/dist/sdk/index.js +11 -0
  165. package/dist/server/src/ai/LLM/anthropic.module.d.ts +2 -0
  166. package/dist/server/src/ai/LLM/anthropic.module.js +21 -0
  167. package/dist/server/src/ai/LLM/anthropic.service.d.ts +27 -0
  168. package/dist/server/src/ai/LLM/anthropic.service.js +329 -0
  169. package/dist/server/src/ai/LLM/base-ai.service.d.ts +45 -0
  170. package/dist/server/src/ai/LLM/base-ai.service.js +409 -0
  171. package/dist/server/src/ai/LLM/deepseek.module.d.ts +2 -0
  172. package/dist/server/src/ai/LLM/deepseek.module.js +21 -0
  173. package/dist/server/src/ai/LLM/deepseek.service.d.ts +15 -0
  174. package/dist/server/src/ai/LLM/deepseek.service.js +279 -0
  175. package/dist/server/src/ai/LLM/fal.module.d.ts +2 -0
  176. package/dist/server/src/ai/LLM/fal.module.js +21 -0
  177. package/dist/server/src/ai/LLM/fal.service.d.ts +17 -0
  178. package/dist/server/src/ai/LLM/fal.service.js +314 -0
  179. package/dist/server/src/ai/LLM/googleai.module.d.ts +2 -0
  180. package/dist/server/src/ai/LLM/googleai.module.js +21 -0
  181. package/dist/server/src/ai/LLM/googleai.service.d.ts +20 -0
  182. package/dist/server/src/ai/LLM/googleai.service.js +271 -0
  183. package/dist/server/src/ai/LLM/grok.module.d.ts +2 -0
  184. package/dist/server/src/ai/LLM/grok.module.js +21 -0
  185. package/dist/server/src/ai/LLM/grok.service.d.ts +14 -0
  186. package/dist/server/src/ai/LLM/grok.service.js +263 -0
  187. package/dist/server/src/ai/LLM/mock.module.d.ts +2 -0
  188. package/dist/server/src/ai/LLM/mock.module.js +21 -0
  189. package/dist/server/src/ai/LLM/mock.service.d.ts +13 -0
  190. package/dist/server/src/ai/LLM/mock.service.js +194 -0
  191. package/dist/server/src/ai/LLM/openai.module.d.ts +2 -0
  192. package/dist/server/src/ai/LLM/openai.module.js +21 -0
  193. package/dist/server/src/ai/LLM/openai.service.d.ts +21 -0
  194. package/dist/server/src/ai/LLM/openai.service.js +421 -0
  195. package/dist/server/src/ai/LLM/together.module.d.ts +2 -0
  196. package/dist/server/src/ai/LLM/together.module.js +21 -0
  197. package/dist/server/src/ai/LLM/together.service.d.ts +18 -0
  198. package/dist/server/src/ai/LLM/together.service.js +285 -0
  199. package/dist/server/src/ai/LLM/vertexai.module.d.ts +2 -0
  200. package/dist/server/src/ai/LLM/vertexai.module.js +21 -0
  201. package/dist/server/src/ai/LLM/vertexai.service.d.ts +17 -0
  202. package/dist/server/src/ai/LLM/vertexai.service.js +323 -0
  203. package/dist/server/src/ai/agent-config.d.ts +32 -0
  204. package/dist/server/src/ai/agent-config.js +2 -0
  205. package/dist/server/src/ai/agent-factory.d.ts +15 -0
  206. package/dist/server/src/ai/agent-factory.js +24 -0
  207. package/dist/server/src/ai/agent-message.service.d.ts +9 -0
  208. package/dist/server/src/ai/agent-message.service.js +56 -0
  209. package/dist/server/src/ai/agent-store.module.d.ts +2 -0
  210. package/dist/server/src/ai/agent-store.module.js +21 -0
  211. package/dist/server/src/ai/agent-store.service.d.ts +31 -0
  212. package/dist/server/src/ai/agent-store.service.js +352 -0
  213. package/dist/server/src/ai/agent.d.ts +75 -0
  214. package/dist/server/src/ai/agent.js +174 -0
  215. package/dist/server/src/ai/ai-factory.module.d.ts +2 -0
  216. package/dist/server/src/ai/ai-factory.module.js +40 -0
  217. package/dist/server/src/ai/ai-factory.service.d.ts +24 -0
  218. package/dist/server/src/ai/ai-factory.service.js +94 -0
  219. package/dist/server/src/ai/artifact.module.d.ts +2 -0
  220. package/dist/server/src/ai/artifact.module.js +22 -0
  221. package/dist/server/src/ai/artifact.service.d.ts +21 -0
  222. package/dist/server/src/ai/artifact.service.js +239 -0
  223. package/dist/server/src/ai/attached-file.module.d.ts +2 -0
  224. package/dist/server/src/ai/attached-file.module.js +22 -0
  225. package/dist/server/src/ai/attached-file.service.d.ts +35 -0
  226. package/dist/server/src/ai/attached-file.service.js +253 -0
  227. package/dist/server/src/ai/model_prices.d.ts +2 -0
  228. package/dist/server/src/ai/model_prices.js +54 -0
  229. package/dist/server/src/ai/published-agents.service.d.ts +13 -0
  230. package/dist/server/src/ai/published-agents.service.js +118 -0
  231. package/dist/server/src/app/balance-message.service.d.ts +8 -0
  232. package/dist/server/src/app/balance-message.service.js +45 -0
  233. package/dist/server/src/app/balance.module.d.ts +2 -0
  234. package/dist/server/src/app/balance.module.js +20 -0
  235. package/dist/server/src/app/balance.service.d.ts +18 -0
  236. package/dist/server/src/app/balance.service.js +158 -0
  237. package/dist/server/src/app/stripe.controller.d.ts +31 -0
  238. package/dist/server/src/app/stripe.controller.js +148 -0
  239. package/dist/server/src/app/stripe.module.d.ts +2 -0
  240. package/dist/server/src/app/stripe.module.js +22 -0
  241. package/dist/server/src/app/stripe.service.d.ts +28 -0
  242. package/dist/server/src/app/stripe.service.js +198 -0
  243. package/dist/server/src/app/transaction.service.d.ts +15 -0
  244. package/dist/server/src/app/transaction.service.js +139 -0
  245. package/dist/server/src/app/user-service-factory.d.ts +21 -0
  246. package/dist/server/src/app/user-service-factory.js +81 -0
  247. package/dist/server/src/app/user-service-manager.d.ts +28 -0
  248. package/dist/server/src/app/user-service-manager.js +102 -0
  249. package/dist/server/src/app.controller.d.ts +232 -0
  250. package/dist/server/src/app.controller.js +2534 -0
  251. package/dist/server/src/app.module.d.ts +2 -0
  252. package/dist/server/src/app.module.js +45 -0
  253. package/dist/server/src/app.service.d.ts +186 -0
  254. package/dist/server/src/app.service.js +1334 -0
  255. package/dist/server/src/auth/agent-access.decorator.d.ts +2 -0
  256. package/dist/server/src/auth/agent-access.decorator.js +10 -0
  257. package/dist/server/src/auth/auth.controller.d.ts +38 -0
  258. package/dist/server/src/auth/auth.controller.js +356 -0
  259. package/dist/server/src/auth/auth.module.d.ts +2 -0
  260. package/dist/server/src/auth/auth.module.js +55 -0
  261. package/dist/server/src/auth/auth.service.d.ts +14 -0
  262. package/dist/server/src/auth/auth.service.js +84 -0
  263. package/dist/server/src/auth/dto/bot-login.dto.d.ts +4 -0
  264. package/dist/server/src/auth/dto/bot-login.dto.js +2 -0
  265. package/dist/server/src/auth/dto/password-reset.dto.d.ts +11 -0
  266. package/dist/server/src/auth/dto/password-reset.dto.js +2 -0
  267. package/dist/server/src/auth/dto/phone-login.dto.d.ts +8 -0
  268. package/dist/server/src/auth/dto/phone-login.dto.js +2 -0
  269. package/dist/server/src/auth/dto/phone-verification.dto.d.ts +9 -0
  270. package/dist/server/src/auth/dto/phone-verification.dto.js +2 -0
  271. package/dist/server/src/auth/jwt-auth.guard.d.ts +13 -0
  272. package/dist/server/src/auth/jwt-auth.guard.js +143 -0
  273. package/dist/server/src/auth/jwt.strategy.d.ts +17 -0
  274. package/dist/server/src/auth/jwt.strategy.js +45 -0
  275. package/dist/server/src/auth/phone-validation.service.d.ts +7 -0
  276. package/dist/server/src/auth/phone-validation.service.js +50 -0
  277. package/dist/server/src/auth/public.decorator.d.ts +2 -0
  278. package/dist/server/src/auth/public.decorator.js +7 -0
  279. package/dist/server/src/auth/rate-limit.service.d.ts +16 -0
  280. package/dist/server/src/auth/rate-limit.service.js +84 -0
  281. package/dist/server/src/auth/room-access.decorator.d.ts +2 -0
  282. package/dist/server/src/auth/room-access.decorator.js +10 -0
  283. package/dist/server/src/auth/scopes.decorator.d.ts +2 -0
  284. package/dist/server/src/auth/scopes.decorator.js +7 -0
  285. package/dist/server/src/auth/scopes.guard.d.ts +9 -0
  286. package/dist/server/src/auth/scopes.guard.js +82 -0
  287. package/dist/server/src/auth/session.guard.d.ts +7 -0
  288. package/dist/server/src/auth/session.guard.js +55 -0
  289. package/dist/server/src/auth/twilio.service.d.ts +15 -0
  290. package/dist/server/src/auth/twilio.service.js +139 -0
  291. package/dist/server/src/auth/users.service.d.ts +24 -0
  292. package/dist/server/src/auth/users.service.js +149 -0
  293. package/dist/server/src/common/errors.d.ts +12 -0
  294. package/dist/server/src/common/errors.js +43 -0
  295. package/dist/server/src/config/configuration.module.d.ts +2 -0
  296. package/dist/server/src/config/configuration.module.js +20 -0
  297. package/dist/server/src/config/configuration.service.d.ts +26 -0
  298. package/dist/server/src/config/configuration.service.js +131 -0
  299. package/dist/server/src/room/artifact-store.service.d.ts +15 -0
  300. package/dist/server/src/room/artifact-store.service.js +226 -0
  301. package/dist/server/src/room/artifact.d.ts +6 -0
  302. package/dist/server/src/room/artifact.js +2 -0
  303. package/dist/server/src/room/message.d.ts +19 -0
  304. package/dist/server/src/room/message.js +70 -0
  305. package/dist/server/src/room/published-rooms.service.d.ts +12 -0
  306. package/dist/server/src/room/published-rooms.service.js +108 -0
  307. package/dist/server/src/room/room-config.d.ts +12 -0
  308. package/dist/server/src/room/room-config.js +2 -0
  309. package/dist/server/src/room/room-factory.d.ts +7 -0
  310. package/dist/server/src/room/room-factory.js +16 -0
  311. package/dist/server/src/room/room-message.module.d.ts +2 -0
  312. package/dist/server/src/room/room-message.module.js +21 -0
  313. package/dist/server/src/room/room-message.service.d.ts +8 -0
  314. package/dist/server/src/room/room-message.service.js +44 -0
  315. package/dist/server/src/room/room-store.module.d.ts +2 -0
  316. package/dist/server/src/room/room-store.module.js +25 -0
  317. package/dist/server/src/room/room-store.service.d.ts +38 -0
  318. package/dist/server/src/room/room-store.service.js +353 -0
  319. package/dist/server/src/room/room.d.ts +107 -0
  320. package/dist/server/src/room/room.js +833 -0
  321. package/dist/server/src/sdk/briyah-config.d.ts +13 -0
  322. package/dist/server/src/sdk/briyah-config.js +32 -0
  323. package/dist/server/src/sdk/briyah.d.ts +36 -0
  324. package/dist/server/src/sdk/briyah.js +122 -0
  325. package/dist/server/src/sdk/index.d.ts +6 -0
  326. package/dist/server/src/sdk/index.js +11 -0
  327. package/dist/server/src/shared/shared.module.d.ts +2 -0
  328. package/dist/server/src/shared/shared.module.js +46 -0
  329. package/dist/server/src/story/story-message.service.d.ts +10 -0
  330. package/dist/server/src/story/story-message.service.js +57 -0
  331. package/dist/server/src/story/story-progress.service.d.ts +8 -0
  332. package/dist/server/src/story/story-progress.service.js +44 -0
  333. package/dist/server/src/story/story-store.module.d.ts +2 -0
  334. package/dist/server/src/story/story-store.module.js +22 -0
  335. package/dist/server/src/story/story-store.service.d.ts +23 -0
  336. package/dist/server/src/story/story-store.service.js +392 -0
  337. package/dist/server/src/story/story.service.d.ts +94 -0
  338. package/dist/server/src/story/story.service.js +1797 -0
  339. package/dist/shared/shared.module.d.ts +2 -0
  340. package/dist/shared/shared.module.js +46 -0
  341. package/dist/shared/types/app.types.d.ts +296 -0
  342. package/dist/shared/types/app.types.js +17 -0
  343. package/dist/story/story-message.service.d.ts +10 -0
  344. package/dist/story/story-message.service.js +57 -0
  345. package/dist/story/story-progress.service.d.ts +8 -0
  346. package/dist/story/story-progress.service.js +44 -0
  347. package/dist/story/story-store.module.d.ts +2 -0
  348. package/dist/story/story-store.module.js +22 -0
  349. package/dist/story/story-store.service.d.ts +23 -0
  350. package/dist/story/story-store.service.js +392 -0
  351. package/dist/story/story.service.d.ts +94 -0
  352. package/dist/story/story.service.js +1797 -0
  353. package/eslint.config.js +29 -0
  354. package/package.json +125 -0
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.TransactionService = void 0;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ const zod_1 = require("zod");
40
+ class TransactionService {
41
+ userId;
42
+ configService;
43
+ transactionsDir;
44
+ constructor(userId, configService) {
45
+ this.userId = userId;
46
+ this.configService = configService;
47
+ const userDataPath = this.configService.getUserDataDir();
48
+ this.transactionsDir = path.join(userDataPath, 'transactions');
49
+ if (!fs.existsSync(this.transactionsDir)) {
50
+ fs.mkdirSync(this.transactionsDir, { recursive: true });
51
+ }
52
+ }
53
+ async recordTransaction(amount, stripePaymentIntentId, status = 'pending') {
54
+ const timestamp = Date.now();
55
+ const transaction = {
56
+ id: (0, zod_1.uuidv4)().toString(),
57
+ userId: this.userId,
58
+ amount,
59
+ currency: 'usd',
60
+ stripePaymentIntentId,
61
+ status,
62
+ createdAt: timestamp,
63
+ updatedAt: timestamp,
64
+ };
65
+ const filename = `${timestamp}-${stripePaymentIntentId}.json`;
66
+ const filePath = path.join(this.transactionsDir, filename);
67
+ try {
68
+ fs.writeFileSync(filePath, JSON.stringify(transaction, null, 2), 'utf-8');
69
+ return transaction;
70
+ }
71
+ catch (error) {
72
+ console.error(`Error recording transaction for user ${this.userId}:`, error);
73
+ throw error;
74
+ }
75
+ }
76
+ async updateTransactionStatus(paymentIntentId, status) {
77
+ try {
78
+ const transaction = await this.getTransactionByPaymentIntent(paymentIntentId);
79
+ if (!transaction) {
80
+ console.error(`Transaction not found for payment intent ${paymentIntentId}`);
81
+ return;
82
+ }
83
+ transaction.status = status;
84
+ transaction.updatedAt = Date.now();
85
+ const files = fs.readdirSync(this.transactionsDir);
86
+ const matchingFile = files.find((file) => file.includes(paymentIntentId));
87
+ if (matchingFile) {
88
+ const filePath = path.join(this.transactionsDir, matchingFile);
89
+ fs.writeFileSync(filePath, JSON.stringify(transaction, null, 2), 'utf-8');
90
+ }
91
+ }
92
+ catch (error) {
93
+ console.error(`Error updating transaction status for ${paymentIntentId}:`, error);
94
+ throw error;
95
+ }
96
+ }
97
+ async getTransactionByPaymentIntent(paymentIntentId) {
98
+ try {
99
+ const files = fs.readdirSync(this.transactionsDir);
100
+ const matchingFile = files.find((file) => file.includes(paymentIntentId));
101
+ if (!matchingFile) {
102
+ return null;
103
+ }
104
+ const filePath = path.join(this.transactionsDir, matchingFile);
105
+ const content = fs.readFileSync(filePath, 'utf-8');
106
+ return JSON.parse(content);
107
+ }
108
+ catch (error) {
109
+ console.error(`Error getting transaction for payment intent ${paymentIntentId}:`, error);
110
+ return null;
111
+ }
112
+ }
113
+ async getTransactions(limit = 50, offset = 0) {
114
+ try {
115
+ const files = fs.readdirSync(this.transactionsDir);
116
+ const transactions = [];
117
+ for (const file of files) {
118
+ if (!file.endsWith('.json'))
119
+ continue;
120
+ const filePath = path.join(this.transactionsDir, file);
121
+ const content = fs.readFileSync(filePath, 'utf-8');
122
+ const transaction = JSON.parse(content);
123
+ transactions.push(transaction);
124
+ }
125
+ transactions.sort((a, b) => b.createdAt - a.createdAt);
126
+ const total = transactions.length;
127
+ const paginatedTransactions = transactions.slice(offset, offset + limit);
128
+ return {
129
+ transactions: paginatedTransactions,
130
+ total,
131
+ };
132
+ }
133
+ catch (error) {
134
+ console.error(`Error getting transactions for user ${this.userId}:`, error);
135
+ return { transactions: [], total: 0 };
136
+ }
137
+ }
138
+ }
139
+ exports.TransactionService = TransactionService;
@@ -0,0 +1,21 @@
1
+ import { AppService } from '../app.service';
2
+ import { RoomMessageService } from '../room/room-message.service';
3
+ import { AiFactoryService } from '../ai/ai-factory.service';
4
+ import { AgentMessageService } from '../ai/agent-message.service';
5
+ import { StoryProgressService } from '../story/story-progress.service';
6
+ import { StoryMessageService } from '../story/story-message.service';
7
+ import { PublishedAgentsService } from '../ai/published-agents.service';
8
+ import { PublishedRoomsService } from '../room/published-rooms.service';
9
+ import { BalanceMessageService } from './balance-message.service';
10
+ export declare class UserServiceFactory {
11
+ private readonly aiFactoryService;
12
+ private readonly agentMessageService;
13
+ private readonly roomMessageService;
14
+ private readonly storyProgressService;
15
+ private readonly storyMessageService;
16
+ private readonly publishedAgentsService;
17
+ private readonly publishedRoomsService;
18
+ private readonly balanceMessageService;
19
+ constructor(aiFactoryService: AiFactoryService, agentMessageService: AgentMessageService, roomMessageService: RoomMessageService, storyProgressService: StoryProgressService, storyMessageService: StoryMessageService, publishedAgentsService: PublishedAgentsService, publishedRoomsService: PublishedRoomsService, balanceMessageService: BalanceMessageService);
20
+ createAppService(userId: string): AppService;
21
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UserServiceFactory = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const app_service_1 = require("../app.service");
15
+ const configuration_service_1 = require("../config/configuration.service");
16
+ const agent_store_service_1 = require("../ai/agent-store.service");
17
+ const room_store_service_1 = require("../room/room-store.service");
18
+ const artifact_store_service_1 = require("../room/artifact-store.service");
19
+ const room_message_service_1 = require("../room/room-message.service");
20
+ const story_store_service_1 = require("../story/story-store.service");
21
+ const attached_file_service_1 = require("../ai/attached-file.service");
22
+ const artifact_service_1 = require("../ai/artifact.service");
23
+ const ai_factory_service_1 = require("../ai/ai-factory.service");
24
+ const agent_message_service_1 = require("../ai/agent-message.service");
25
+ const story_service_1 = require("../story/story.service");
26
+ const story_progress_service_1 = require("../story/story-progress.service");
27
+ const story_message_service_1 = require("../story/story-message.service");
28
+ const published_agents_service_1 = require("../ai/published-agents.service");
29
+ const published_rooms_service_1 = require("../room/published-rooms.service");
30
+ const balance_service_1 = require("./balance.service");
31
+ const balance_message_service_1 = require("./balance-message.service");
32
+ const transaction_service_1 = require("./transaction.service");
33
+ const agent_factory_1 = require("../ai/agent-factory");
34
+ const room_factory_1 = require("../room/room-factory");
35
+ let UserServiceFactory = class UserServiceFactory {
36
+ aiFactoryService;
37
+ agentMessageService;
38
+ roomMessageService;
39
+ storyProgressService;
40
+ storyMessageService;
41
+ publishedAgentsService;
42
+ publishedRoomsService;
43
+ balanceMessageService;
44
+ constructor(aiFactoryService, agentMessageService, roomMessageService, storyProgressService, storyMessageService, publishedAgentsService, publishedRoomsService, balanceMessageService) {
45
+ this.aiFactoryService = aiFactoryService;
46
+ this.agentMessageService = agentMessageService;
47
+ this.roomMessageService = roomMessageService;
48
+ this.storyProgressService = storyProgressService;
49
+ this.storyMessageService = storyMessageService;
50
+ this.publishedAgentsService = publishedAgentsService;
51
+ this.publishedRoomsService = publishedRoomsService;
52
+ this.balanceMessageService = balanceMessageService;
53
+ }
54
+ createAppService(userId) {
55
+ const configService = new configuration_service_1.ConfigurationService(userId);
56
+ const balanceService = new balance_service_1.BalanceService(userId, configService, this.balanceMessageService);
57
+ const transactionService = new transaction_service_1.TransactionService(userId, configService);
58
+ const attachedFileService = new attached_file_service_1.AttachedFileService(configService);
59
+ const artifactService = new artifact_service_1.ArtifactService(configService);
60
+ const agentStore = new agent_store_service_1.AgentStoreService(this.aiFactoryService, configService, attachedFileService, balanceService, artifactService);
61
+ const agentFactory = new agent_factory_1.AgentFactory(this.aiFactoryService, agentStore, configService, balanceService, artifactService);
62
+ const artifactStore = new artifact_store_service_1.ArtifactStoreService();
63
+ const roomStore = new room_store_service_1.RoomStoreService(configService, agentStore, attachedFileService, artifactStore);
64
+ const roomFactory = new room_factory_1.RoomFactory(roomStore);
65
+ const storyStore = new story_store_service_1.StoryStoreService(configService, roomStore);
66
+ const storyService = new story_service_1.StoryService(storyStore, agentStore, roomStore, this.storyProgressService, this.storyMessageService, configService, agentFactory, roomFactory);
67
+ return new app_service_1.AppService(this.aiFactoryService, agentStore, this.agentMessageService, roomStore, this.roomMessageService, configService, attachedFileService, artifactService, storyStore, storyService, this.publishedAgentsService, this.publishedRoomsService, balanceService, this.balanceMessageService, transactionService, agentFactory, roomFactory);
68
+ }
69
+ };
70
+ exports.UserServiceFactory = UserServiceFactory;
71
+ exports.UserServiceFactory = UserServiceFactory = __decorate([
72
+ (0, common_1.Injectable)(),
73
+ __metadata("design:paramtypes", [ai_factory_service_1.AiFactoryService,
74
+ agent_message_service_1.AgentMessageService,
75
+ room_message_service_1.RoomMessageService,
76
+ story_progress_service_1.StoryProgressService,
77
+ story_message_service_1.StoryMessageService,
78
+ published_agents_service_1.PublishedAgentsService,
79
+ published_rooms_service_1.PublishedRoomsService,
80
+ balance_message_service_1.BalanceMessageService])
81
+ ], UserServiceFactory);
@@ -0,0 +1,28 @@
1
+ import { OnModuleInit, OnModuleDestroy } from '@nestjs/common';
2
+ import { ConfigService } from '@nestjs/config';
3
+ import { AppService } from '../app.service';
4
+ import { UserServiceFactory } from './user-service-factory';
5
+ export interface IConfigService {
6
+ get<T = string>(key: string, defaultValue?: T): T;
7
+ }
8
+ export declare class UserServiceManager implements OnModuleInit, OnModuleDestroy {
9
+ private readonly userServiceFactory;
10
+ private readonly configService;
11
+ private userServices;
12
+ private cleanupIntervalId;
13
+ private readonly cacheTimeoutMinutes;
14
+ private readonly cleanupIntervalMinutes;
15
+ constructor(userServiceFactory: UserServiceFactory, configService: ConfigService);
16
+ onModuleInit(): void;
17
+ onModuleDestroy(): void;
18
+ getAppService(userId: string): AppService;
19
+ removeUserService(userId: string): void;
20
+ getCacheStats(): {
21
+ cachedUsers: number;
22
+ users: {
23
+ userId: string;
24
+ ageMinutes: number;
25
+ }[];
26
+ };
27
+ private cleanupInactiveUsers;
28
+ }
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UserServiceManager = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const config_1 = require("@nestjs/config");
15
+ const user_service_factory_1 = require("./user-service-factory");
16
+ let UserServiceManager = class UserServiceManager {
17
+ userServiceFactory;
18
+ configService;
19
+ userServices = new Map();
20
+ cleanupIntervalId = null;
21
+ cacheTimeoutMinutes;
22
+ cleanupIntervalMinutes = 5;
23
+ constructor(userServiceFactory, configService) {
24
+ this.userServiceFactory = userServiceFactory;
25
+ this.configService = configService;
26
+ this.cacheTimeoutMinutes = parseInt(this.configService.get('USER_SERVICE_CACHE_TIMEOUT_MINUTES', '30'));
27
+ }
28
+ onModuleInit() {
29
+ if (this.cleanupIntervalId) {
30
+ return;
31
+ }
32
+ this.cleanupIntervalId = setInterval(() => this.cleanupInactiveUsers(), this.cleanupIntervalMinutes * 60 * 1000);
33
+ }
34
+ onModuleDestroy() {
35
+ if (this.cleanupIntervalId) {
36
+ clearInterval(this.cleanupIntervalId);
37
+ this.cleanupIntervalId = null;
38
+ this.userServices.clear();
39
+ console.log('[UserServiceManager] Shutdown complete');
40
+ }
41
+ }
42
+ getAppService(userId) {
43
+ const now = Date.now();
44
+ const context = this.userServices.get(userId);
45
+ if (context) {
46
+ const ageMinutes = (now - context.lastAccessed) / (60 * 1000);
47
+ if (ageMinutes < this.cacheTimeoutMinutes) {
48
+ context.lastAccessed = now;
49
+ return context.appService;
50
+ }
51
+ else {
52
+ console.log(`[UserServiceManager] Cache expired for user ${userId} (${ageMinutes.toFixed(1)}min old)`);
53
+ this.userServices.delete(userId);
54
+ }
55
+ }
56
+ const appService = this.userServiceFactory.createAppService(userId);
57
+ this.userServices.set(userId, {
58
+ appService,
59
+ lastAccessed: now,
60
+ });
61
+ return appService;
62
+ }
63
+ removeUserService(userId) {
64
+ if (this.userServices.delete(userId)) {
65
+ console.log(`[UserServiceManager] Manually removed service for user ${userId}`);
66
+ }
67
+ }
68
+ getCacheStats() {
69
+ const now = Date.now();
70
+ const users = Array.from(this.userServices.entries()).map(([userId, context]) => ({
71
+ userId,
72
+ ageMinutes: (now - context.lastAccessed) / (60 * 1000),
73
+ }));
74
+ return {
75
+ cachedUsers: this.userServices.size,
76
+ users,
77
+ };
78
+ }
79
+ cleanupInactiveUsers() {
80
+ const now = Date.now();
81
+ const timeoutMs = this.cacheTimeoutMinutes * 60 * 1000;
82
+ let removedCount = 0;
83
+ for (const [userId, context] of this.userServices.entries()) {
84
+ const age = now - context.lastAccessed;
85
+ if (age > timeoutMs) {
86
+ this.userServices.delete(userId);
87
+ removedCount++;
88
+ const ageMinutes = age / (60 * 1000);
89
+ console.log(`[UserServiceManager] Cleaned up service for user ${userId} (${ageMinutes.toFixed(1)}min inactive)`);
90
+ }
91
+ }
92
+ if (removedCount > 0) {
93
+ console.log(`[UserServiceManager] Cleanup complete: removed ${removedCount} inactive user(s), ${this.userServices.size} remaining`);
94
+ }
95
+ }
96
+ };
97
+ exports.UserServiceManager = UserServiceManager;
98
+ exports.UserServiceManager = UserServiceManager = __decorate([
99
+ (0, common_1.Injectable)(),
100
+ __metadata("design:paramtypes", [user_service_factory_1.UserServiceFactory,
101
+ config_1.ConfigService])
102
+ ], UserServiceManager);
@@ -0,0 +1,232 @@
1
+ import { MessageEvent } from '@nestjs/common';
2
+ import { Request as ExpressRequest, Response } from 'express';
3
+ import { Observable } from 'rxjs';
4
+ import { UserServiceManager } from './app/user-service-manager';
5
+ import { PublishedAgentsService } from './ai/published-agents.service';
6
+ import { PublishedRoomsService } from './room/published-rooms.service';
7
+ import { AgentInfo, CreateAgentResponse, UpdateAgentRequest, RoomInfo, RoomDetails, CreateRoomResponse, AgentMessagesResponse, RoomMessagesResponse, FileList, PromptFileContent, PromptFoldersResponse, PromptFilesResponse, PromptScope, CreatePromptFolderRequest, CreatePromptFileRequest, UpdatePromptFileRequest, ProcessTextResponse, PreparedPromptResponse, AttachDocumentResponse, StoryInfo, StoryState, Character, ModelInfo, StoryModelDefaults, ChapterInfo, StoryIdea } from '@shared/types/app.types';
8
+ import { RoomMessage } from './room/message';
9
+ export declare class AppController {
10
+ private readonly userServiceManager;
11
+ private readonly publishedAgentsService;
12
+ private readonly publishedRoomsService;
13
+ constructor(userServiceManager: UserServiceManager, publishedAgentsService: PublishedAgentsService, publishedRoomsService: PublishedRoomsService);
14
+ private getAppService;
15
+ listServices(req: ExpressRequest): string[];
16
+ listModels(req: ExpressRequest, aiServiceName: string): Promise<ModelInfo[]>;
17
+ listImageModels(req: ExpressRequest): Promise<ModelInfo[]>;
18
+ listStoryModels(req: ExpressRequest): Promise<ModelInfo[]>;
19
+ listStoryModelDefaults(_req: ExpressRequest): StoryModelDefaults;
20
+ createAgent(req: ExpressRequest, body: {
21
+ aiServiceName: string;
22
+ agentName: string;
23
+ agentNickname?: string;
24
+ description: string;
25
+ aiModel: string;
26
+ promptName: string;
27
+ controlledByHuman?: boolean;
28
+ reasoningEffort?: 'low' | 'medium' | 'high' | null;
29
+ maxOutputTokens?: number;
30
+ beginInstruction?: string;
31
+ }): Promise<CreateAgentResponse>;
32
+ processText(req: ExpressRequest, agentId: string, body: {
33
+ text: string;
34
+ }): Promise<ProcessTextResponse>;
35
+ attachDocument(req: ExpressRequest, agentId: string, body: {
36
+ fileName?: string;
37
+ }, file: Express.Multer.File): Promise<AttachDocumentResponse>;
38
+ listAttachedFiles(req: ExpressRequest, agentId: string): Promise<FileList>;
39
+ getPrompts(req: ExpressRequest, scope?: PromptScope): PromptFoldersResponse;
40
+ createPromptFolder(req: ExpressRequest, body: CreatePromptFolderRequest): Promise<void>;
41
+ deletePromptFolder(req: ExpressRequest, folderName: string): Promise<void>;
42
+ getPromptFiles(req: ExpressRequest, folderName: string): Promise<PromptFilesResponse>;
43
+ getPromptFile(req: ExpressRequest, folderName: string, fileName: string): Promise<PromptFileContent>;
44
+ createPromptFile(req: ExpressRequest, folderName: string, body: CreatePromptFileRequest): Promise<void>;
45
+ updatePromptFile(req: ExpressRequest, folderName: string, fileName: string, body: UpdatePromptFileRequest): Promise<void>;
46
+ deletePromptFile(req: ExpressRequest, folderName: string, fileName: string): Promise<void>;
47
+ listPromptFolders(req: ExpressRequest): string[];
48
+ listPrompts(req: ExpressRequest, agentId: string): string[];
49
+ runPreparedPrompt(req: ExpressRequest, agentId: string, promptName: string, body: {
50
+ variables?: any;
51
+ }): Promise<PreparedPromptResponse>;
52
+ listAgents(req: ExpressRequest, published?: string): Promise<AgentInfo[]>;
53
+ createRoom(req: ExpressRequest, body: {
54
+ roomName: string;
55
+ roomGoal: string;
56
+ agentIds: string[];
57
+ }): Promise<CreateRoomResponse>;
58
+ editRoom(req: ExpressRequest, roomId: string, body: {
59
+ roomName: string;
60
+ roomGoal: string;
61
+ baseRoomDir?: string;
62
+ agentIds: string[];
63
+ }): Promise<void>;
64
+ listRooms(req: ExpressRequest): RoomInfo[];
65
+ getRoomDetails(req: ExpressRequest, roomId: string): Promise<RoomDetails>;
66
+ getAgentDetails(req: ExpressRequest, agentId: string): Promise<AgentInfo>;
67
+ getRoomMessages(req: ExpressRequest, roomId: string, fromIndex: string, showThoughts?: string): RoomMessagesResponse;
68
+ getAgentMessages(req: ExpressRequest, agentId: string, fromIndex: string): Promise<AgentMessagesResponse>;
69
+ getStoryMessages(req: ExpressRequest, storyId: string, fromIndex: string): RoomMessagesResponse;
70
+ deleteAgent(req: ExpressRequest, agentId: string): Promise<void>;
71
+ publishAgentInstance(req: ExpressRequest, agentId: string, body: {
72
+ publishedAgentName: string;
73
+ }): Promise<{
74
+ instanceId: string;
75
+ publicUrl: string;
76
+ }>;
77
+ getPublishedInstances(req: ExpressRequest, agentId: string): Promise<AgentInfo[]>;
78
+ resetPublishedInstance(req: ExpressRequest, instanceId: string): Promise<void>;
79
+ deleteRoom(req: ExpressRequest, roomId: string): Promise<void>;
80
+ sendRoomMessage(req: ExpressRequest, roomId: string, body: {
81
+ content: string;
82
+ sender: string;
83
+ action?: string;
84
+ targets?: string[];
85
+ clearQueue?: boolean;
86
+ }): Promise<void>;
87
+ pauseRoom(req: ExpressRequest, roomId: string): Promise<{
88
+ success: boolean;
89
+ }>;
90
+ resumeRoom(req: ExpressRequest, roomId: string): Promise<{
91
+ success: boolean;
92
+ }>;
93
+ getUserPreferences(req: ExpressRequest): Promise<any>;
94
+ saveUserPreferences(req: ExpressRequest, preferences: any): Promise<void>;
95
+ listPromptFilesDeprecated(req: ExpressRequest, folderName: string): Promise<FileList>;
96
+ getPromptFileDeprecated(req: ExpressRequest, folderName: string, fileName: string): Promise<PromptFileContent>;
97
+ savePromptFileDeprecated(req: ExpressRequest, body: {
98
+ folderName: string;
99
+ fileName: string;
100
+ content: string;
101
+ fileType: string;
102
+ }): Promise<void>;
103
+ deletePromptFileDeprecated(req: ExpressRequest, body: {
104
+ folderName: string;
105
+ fileName: string;
106
+ }): Promise<void>;
107
+ deletePromptFolderDeprecated(req: ExpressRequest, body: {
108
+ folderName: string;
109
+ }): Promise<void>;
110
+ updateAgent(req: ExpressRequest, agentId: string, updateData: UpdateAgentRequest): Promise<void>;
111
+ deleteAttachedFile(req: ExpressRequest, agentId: string, documentId: string): Promise<void>;
112
+ reloadAgent(req: ExpressRequest, agentId: string): Promise<void>;
113
+ resetRoom(req: ExpressRequest, roomId: string): Promise<void>;
114
+ publishRoom(req: ExpressRequest, templateId: string, body: {
115
+ publishedName?: string;
116
+ }): Promise<{
117
+ roomId: string;
118
+ }>;
119
+ getPublishedRoomInstances(req: ExpressRequest, templateId: string): Promise<RoomInfo[]>;
120
+ resetPublishedRoomInstance(req: ExpressRequest, instanceId: string): Promise<void>;
121
+ resetStory(req: ExpressRequest, storyId: string): Promise<void>;
122
+ getRoomArtifacts(req: ExpressRequest, roomId: string): Promise<{
123
+ artifacts: any[];
124
+ }>;
125
+ publishArtifact(req: ExpressRequest, roomId: string, body: {
126
+ name: string;
127
+ creator: string;
128
+ body: string;
129
+ viewers?: string[];
130
+ }): Promise<void>;
131
+ createPromptFolderDeprecated(req: ExpressRequest, body: {
132
+ folderName: string;
133
+ }): Promise<void>;
134
+ listStories(req: ExpressRequest): StoryInfo[];
135
+ listStoryGenres(req: ExpressRequest): string[];
136
+ getRandomStoryIdea(req: ExpressRequest): Promise<StoryIdea | null>;
137
+ getStoryIdeasByGenre(req: ExpressRequest, genreName: string): Promise<StoryIdea | null>;
138
+ createStory(req: ExpressRequest, body: {
139
+ name: string;
140
+ idea: string;
141
+ userCharacterDesc: string;
142
+ otherCharactersDesc: string;
143
+ storyModel?: string;
144
+ isImport?: boolean;
145
+ imageModelName?: string;
146
+ }): Promise<StoryInfo>;
147
+ importStoryZip(req: ExpressRequest, file: Express.Multer.File): Promise<StoryInfo>;
148
+ deleteStory(req: ExpressRequest, storyId: string): Promise<void>;
149
+ compactStory(req: ExpressRequest, storyId: string): Promise<void>;
150
+ progressStory(req: ExpressRequest, storyId: string): Promise<{
151
+ chapterIndex: number;
152
+ }>;
153
+ getStoryState(req: ExpressRequest, storyId: string): Promise<StoryState>;
154
+ respondToStory(req: ExpressRequest, storyId: string, body: {
155
+ content: string;
156
+ }): Promise<void>;
157
+ introduceCharacter(req: ExpressRequest, storyId: string, body: {
158
+ name: string;
159
+ description?: string;
160
+ storyModel?: string;
161
+ fromNarratorSuggestion?: boolean;
162
+ }): Promise<void>;
163
+ declineCharacter(req: ExpressRequest, storyId: string, characterName: string): Promise<{
164
+ success: boolean;
165
+ }>;
166
+ deleteCharacter(req: ExpressRequest, storyId: string, characterName: string): Promise<void>;
167
+ listChapters(req: ExpressRequest, storyId: string): {
168
+ chapters: ChapterInfo[];
169
+ };
170
+ getChapter(req: ExpressRequest, storyId: string, chapterIndex: string): Promise<{
171
+ content: RoomMessage[];
172
+ }>;
173
+ saveChapter(req: ExpressRequest, storyId: string, chapterIndex: string, body: {
174
+ content: string;
175
+ }): void;
176
+ deleteChapter(req: ExpressRequest, storyId: string, chapterIndex: string): void;
177
+ exportStoryMarkdown(req: ExpressRequest, storyId: string, res: Response): Promise<void>;
178
+ exportStoryZip(req: ExpressRequest, storyId: string, res: Response): Promise<void>;
179
+ listCharacters(req: ExpressRequest, storyId: string): Promise<Character[]>;
180
+ getCharacter(req: ExpressRequest, storyId: string, characterName: string): Promise<{
181
+ content: string;
182
+ }>;
183
+ saveCharacter(req: ExpressRequest, storyId: string, characterName: string, body: {
184
+ content: string;
185
+ }): Promise<void>;
186
+ getPlotPlan(req: ExpressRequest, storyId: string): Promise<{
187
+ content: string;
188
+ }>;
189
+ getAgentHistory(req: ExpressRequest, storyId: string, agentId: string): Promise<{
190
+ content: string;
191
+ }>;
192
+ savePlotPlan(req: ExpressRequest, storyId: string, body: {
193
+ content: string;
194
+ }): Promise<void>;
195
+ listStoryArtifacts(req: ExpressRequest, storyId: string): Promise<{
196
+ artifacts: any[];
197
+ }>;
198
+ getStoryArtifact(req: ExpressRequest, storyId: string, artifactId: string, res: Response): Promise<void>;
199
+ storyProgress(req: ExpressRequest, storyId: string): Observable<MessageEvent>;
200
+ storyMessages(req: ExpressRequest, storyId: string): Observable<MessageEvent>;
201
+ agentMessages(req: ExpressRequest, agentId: string): Promise<Observable<MessageEvent>>;
202
+ roomMessages(req: ExpressRequest, roomId: string): Promise<Observable<MessageEvent>>;
203
+ balanceUpdates(req: ExpressRequest): Observable<MessageEvent>;
204
+ getBalance(req: ExpressRequest): Promise<{
205
+ balance: number;
206
+ }>;
207
+ listArtifacts(req: ExpressRequest): Promise<{
208
+ artifacts: any[];
209
+ }>;
210
+ getArtifact(req: ExpressRequest, artifactId: string): Promise<{
211
+ content: string;
212
+ }>;
213
+ createArtifact(req: ExpressRequest, body: {
214
+ name: string;
215
+ }, file: Express.Multer.File): Promise<{
216
+ artifactId: string;
217
+ }>;
218
+ updateArtifact(req: ExpressRequest, artifactId: string, body: {
219
+ content: string;
220
+ }): Promise<void>;
221
+ renameArtifact(req: ExpressRequest, artifactId: string, body: {
222
+ name: string;
223
+ }): Promise<void>;
224
+ deleteArtifact(req: ExpressRequest, artifactId: string): Promise<void>;
225
+ listAgentArtifacts(req: ExpressRequest, agentId: string): Promise<{
226
+ artifacts: any[];
227
+ }>;
228
+ attachArtifactToAgent(req: ExpressRequest, agentId: string, body: {
229
+ artifactId: string;
230
+ }): Promise<void>;
231
+ detachArtifactFromAgent(req: ExpressRequest, agentId: string, artifactId: string): Promise<void>;
232
+ }