@pcontext/api 0.0.1

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 (342) hide show
  1. package/README.md +151 -0
  2. package/dist/app.d.mts +44779 -0
  3. package/dist/app.d.mts.map +1 -0
  4. package/dist/app.mjs +37 -0
  5. package/dist/app.mjs.map +1 -0
  6. package/dist/client.d.mts +22428 -0
  7. package/dist/client.d.mts.map +1 -0
  8. package/dist/client.mjs +15 -0
  9. package/dist/client.mjs.map +1 -0
  10. package/dist/dev.d.mts +11 -0
  11. package/dist/dev.d.mts.map +1 -0
  12. package/dist/dev.mjs +16 -0
  13. package/dist/dev.mjs.map +1 -0
  14. package/dist/index.d.mts +3 -0
  15. package/dist/index.mjs +10 -0
  16. package/dist/index.mjs.map +1 -0
  17. package/dist/modules/doc/chat.route.d.mts +18 -0
  18. package/dist/modules/doc/chat.route.d.mts.map +1 -0
  19. package/dist/modules/doc/chat.route.mjs +20 -0
  20. package/dist/modules/doc/chat.route.mjs.map +1 -0
  21. package/dist/modules/doc/chat.service.d.mts +10 -0
  22. package/dist/modules/doc/chat.service.d.mts.map +1 -0
  23. package/dist/modules/doc/chat.service.mjs +29 -0
  24. package/dist/modules/doc/chat.service.mjs.map +1 -0
  25. package/dist/modules/doc/doc.dto.d.mts +67 -0
  26. package/dist/modules/doc/doc.dto.d.mts.map +1 -0
  27. package/dist/modules/doc/doc.dto.mjs +43 -0
  28. package/dist/modules/doc/doc.dto.mjs.map +1 -0
  29. package/dist/modules/doc/doc.entity.d.mts +19 -0
  30. package/dist/modules/doc/doc.entity.d.mts.map +1 -0
  31. package/dist/modules/doc/doc.entity.mjs +1 -0
  32. package/dist/modules/doc/doc.repo.interface.d.mts +28 -0
  33. package/dist/modules/doc/doc.repo.interface.d.mts.map +1 -0
  34. package/dist/modules/doc/doc.repo.interface.mjs +1 -0
  35. package/dist/modules/doc/doc.route.d.mts +14193 -0
  36. package/dist/modules/doc/doc.route.d.mts.map +1 -0
  37. package/dist/modules/doc/doc.route.mjs +100 -0
  38. package/dist/modules/doc/doc.route.mjs.map +1 -0
  39. package/dist/modules/doc/doc.service.d.mts +38 -0
  40. package/dist/modules/doc/doc.service.d.mts.map +1 -0
  41. package/dist/modules/doc/doc.service.mjs +134 -0
  42. package/dist/modules/doc/doc.service.mjs.map +1 -0
  43. package/dist/modules/doc/doc.vo.d.mts +17 -0
  44. package/dist/modules/doc/doc.vo.d.mts.map +1 -0
  45. package/dist/modules/doc/doc.vo.mjs +1 -0
  46. package/dist/modules/doc/infrastructure/agent/engine/chat.d.mts +21 -0
  47. package/dist/modules/doc/infrastructure/agent/engine/chat.d.mts.map +1 -0
  48. package/dist/modules/doc/infrastructure/agent/engine/chat.mjs +36 -0
  49. package/dist/modules/doc/infrastructure/agent/engine/chat.mjs.map +1 -0
  50. package/dist/modules/doc/infrastructure/agent/engine/generate.d.mts +28 -0
  51. package/dist/modules/doc/infrastructure/agent/engine/generate.d.mts.map +1 -0
  52. package/dist/modules/doc/infrastructure/agent/engine/generate.mjs +135 -0
  53. package/dist/modules/doc/infrastructure/agent/engine/generate.mjs.map +1 -0
  54. package/dist/modules/doc/infrastructure/agent/engine/query-filter.d.mts +7 -0
  55. package/dist/modules/doc/infrastructure/agent/engine/query-filter.d.mts.map +1 -0
  56. package/dist/modules/doc/infrastructure/agent/engine/query-filter.mjs +12 -0
  57. package/dist/modules/doc/infrastructure/agent/engine/query-filter.mjs.map +1 -0
  58. package/dist/modules/doc/infrastructure/agent/loaders/git-repository-reader.d.mts +54 -0
  59. package/dist/modules/doc/infrastructure/agent/loaders/git-repository-reader.d.mts.map +1 -0
  60. package/dist/modules/doc/infrastructure/agent/loaders/git-repository-reader.mjs +142 -0
  61. package/dist/modules/doc/infrastructure/agent/loaders/git-repository-reader.mjs.map +1 -0
  62. package/dist/modules/doc/infrastructure/agent/loaders/index.d.mts +3 -0
  63. package/dist/modules/doc/infrastructure/agent/loaders/index.mjs +4 -0
  64. package/dist/modules/doc/infrastructure/agent/loaders/website-crawl-reader.d.mts +42 -0
  65. package/dist/modules/doc/infrastructure/agent/loaders/website-crawl-reader.d.mts.map +1 -0
  66. package/dist/modules/doc/infrastructure/agent/loaders/website-crawl-reader.mjs +104 -0
  67. package/dist/modules/doc/infrastructure/agent/loaders/website-crawl-reader.mjs.map +1 -0
  68. package/dist/modules/doc/infrastructure/agent/settings.d.mts +5 -0
  69. package/dist/modules/doc/infrastructure/agent/settings.d.mts.map +1 -0
  70. package/dist/modules/doc/infrastructure/agent/settings.mjs +72 -0
  71. package/dist/modules/doc/infrastructure/agent/settings.mjs.map +1 -0
  72. package/dist/modules/doc/infrastructure/agent/storage/index.d.mts +7 -0
  73. package/dist/modules/doc/infrastructure/agent/storage/index.d.mts.map +1 -0
  74. package/dist/modules/doc/infrastructure/agent/storage/index.mjs +12 -0
  75. package/dist/modules/doc/infrastructure/agent/storage/index.mjs.map +1 -0
  76. package/dist/modules/doc/infrastructure/agent/storage/vector-store.d.mts +14 -0
  77. package/dist/modules/doc/infrastructure/agent/storage/vector-store.d.mts.map +1 -0
  78. package/dist/modules/doc/infrastructure/agent/storage/vector-store.mjs +35 -0
  79. package/dist/modules/doc/infrastructure/agent/storage/vector-store.mjs.map +1 -0
  80. package/dist/modules/doc/infrastructure/doc.po.d.mts +570 -0
  81. package/dist/modules/doc/infrastructure/doc.po.d.mts.map +1 -0
  82. package/dist/modules/doc/infrastructure/doc.po.mjs +54 -0
  83. package/dist/modules/doc/infrastructure/doc.po.mjs.map +1 -0
  84. package/dist/modules/doc/infrastructure/doc.repo.pg.d.mts +32 -0
  85. package/dist/modules/doc/infrastructure/doc.repo.pg.d.mts.map +1 -0
  86. package/dist/modules/doc/infrastructure/doc.repo.pg.mjs +157 -0
  87. package/dist/modules/doc/infrastructure/doc.repo.pg.mjs.map +1 -0
  88. package/dist/modules/doc/infrastructure/doc.repo.sqlite.d.mts +32 -0
  89. package/dist/modules/doc/infrastructure/doc.repo.sqlite.d.mts.map +1 -0
  90. package/dist/modules/doc/infrastructure/doc.repo.sqlite.mjs +153 -0
  91. package/dist/modules/doc/infrastructure/doc.repo.sqlite.mjs.map +1 -0
  92. package/dist/modules/doc/mcp.route.d.mts +18 -0
  93. package/dist/modules/doc/mcp.route.d.mts.map +1 -0
  94. package/dist/modules/doc/mcp.route.mjs +39 -0
  95. package/dist/modules/doc/mcp.route.mjs.map +1 -0
  96. package/dist/modules/doc/mcp.service.d.mts +22 -0
  97. package/dist/modules/doc/mcp.service.d.mts.map +1 -0
  98. package/dist/modules/doc/mcp.service.mjs +119 -0
  99. package/dist/modules/doc/mcp.service.mjs.map +1 -0
  100. package/dist/modules/rank/rank.dto.d.mts +10 -0
  101. package/dist/modules/rank/rank.dto.d.mts.map +1 -0
  102. package/dist/modules/rank/rank.dto.mjs +8 -0
  103. package/dist/modules/rank/rank.dto.mjs.map +1 -0
  104. package/dist/modules/rank/rank.route.d.mts +2033 -0
  105. package/dist/modules/rank/rank.route.d.mts.map +1 -0
  106. package/dist/modules/rank/rank.route.mjs +20 -0
  107. package/dist/modules/rank/rank.route.mjs.map +1 -0
  108. package/dist/modules/rank/rank.service.d.mts +32 -0
  109. package/dist/modules/rank/rank.service.d.mts.map +1 -0
  110. package/dist/modules/rank/rank.service.mjs +3 -0
  111. package/dist/modules/rank/rank.vo.d.mts +9 -0
  112. package/dist/modules/rank/rank.vo.d.mts.map +1 -0
  113. package/dist/modules/rank/rank.vo.mjs +1 -0
  114. package/dist/modules/task/infrastructure/mq/task-context.d.mts +29 -0
  115. package/dist/modules/task/infrastructure/mq/task-context.d.mts.map +1 -0
  116. package/dist/modules/task/infrastructure/mq/task-context.mjs +70 -0
  117. package/dist/modules/task/infrastructure/mq/task-context.mjs.map +1 -0
  118. package/dist/modules/task/infrastructure/mq/task-queue.d.mts +10 -0
  119. package/dist/modules/task/infrastructure/mq/task-queue.d.mts.map +1 -0
  120. package/dist/modules/task/infrastructure/mq/task-queue.mjs +12 -0
  121. package/dist/modules/task/infrastructure/mq/task-queue.mjs.map +1 -0
  122. package/dist/modules/task/infrastructure/mq/task-worker.d.mts +13 -0
  123. package/dist/modules/task/infrastructure/mq/task-worker.d.mts.map +1 -0
  124. package/dist/modules/task/infrastructure/mq/task-worker.mjs +35 -0
  125. package/dist/modules/task/infrastructure/mq/task-worker.mjs.map +1 -0
  126. package/dist/modules/task/infrastructure/task.po.d.mts +1147 -0
  127. package/dist/modules/task/infrastructure/task.po.d.mts.map +1 -0
  128. package/dist/modules/task/infrastructure/task.po.mjs +55 -0
  129. package/dist/modules/task/infrastructure/task.po.mjs.map +1 -0
  130. package/dist/modules/task/infrastructure/task.repo.pg.d.mts +21 -0
  131. package/dist/modules/task/infrastructure/task.repo.pg.d.mts.map +1 -0
  132. package/dist/modules/task/infrastructure/task.repo.pg.mjs +86 -0
  133. package/dist/modules/task/infrastructure/task.repo.pg.mjs.map +1 -0
  134. package/dist/modules/task/infrastructure/task.repo.sqlite.d.mts +21 -0
  135. package/dist/modules/task/infrastructure/task.repo.sqlite.d.mts.map +1 -0
  136. package/dist/modules/task/infrastructure/task.repo.sqlite.mjs +89 -0
  137. package/dist/modules/task/infrastructure/task.repo.sqlite.mjs.map +1 -0
  138. package/dist/modules/task/task.dto.d.mts +26 -0
  139. package/dist/modules/task/task.dto.d.mts.map +1 -0
  140. package/dist/modules/task/task.dto.mjs +25 -0
  141. package/dist/modules/task/task.dto.mjs.map +1 -0
  142. package/dist/modules/task/task.entity.d.mts +43 -0
  143. package/dist/modules/task/task.entity.d.mts.map +1 -0
  144. package/dist/modules/task/task.entity.mjs +1 -0
  145. package/dist/modules/task/task.repo.interface.d.mts +17 -0
  146. package/dist/modules/task/task.repo.interface.d.mts.map +1 -0
  147. package/dist/modules/task/task.repo.interface.mjs +1 -0
  148. package/dist/modules/task/task.route.d.mts +4087 -0
  149. package/dist/modules/task/task.route.d.mts.map +1 -0
  150. package/dist/modules/task/task.route.mjs +63 -0
  151. package/dist/modules/task/task.route.mjs.map +1 -0
  152. package/dist/modules/task/task.service.d.mts +28 -0
  153. package/dist/modules/task/task.service.d.mts.map +1 -0
  154. package/dist/modules/task/task.service.mjs +202 -0
  155. package/dist/modules/task/task.service.mjs.map +1 -0
  156. package/dist/modules/task/task.vo.d.mts +18 -0
  157. package/dist/modules/task/task.vo.d.mts.map +1 -0
  158. package/dist/modules/task/task.vo.mjs +1 -0
  159. package/dist/modules/user/application/user.service.d.mts +24 -0
  160. package/dist/modules/user/application/user.service.d.mts.map +1 -0
  161. package/dist/modules/user/application/user.service.mjs +153 -0
  162. package/dist/modules/user/application/user.service.mjs.map +1 -0
  163. package/dist/modules/user/domain/user.entity.d.mts +24 -0
  164. package/dist/modules/user/domain/user.entity.d.mts.map +1 -0
  165. package/dist/modules/user/domain/user.entity.mjs +35 -0
  166. package/dist/modules/user/domain/user.entity.mjs.map +1 -0
  167. package/dist/modules/user/domain/user.repo.interface.d.mts +27 -0
  168. package/dist/modules/user/domain/user.repo.interface.d.mts.map +1 -0
  169. package/dist/modules/user/domain/user.repo.interface.mjs +1 -0
  170. package/dist/modules/user/infrastructure/casbin/adapter.d.mts +7 -0
  171. package/dist/modules/user/infrastructure/casbin/adapter.d.mts.map +1 -0
  172. package/dist/modules/user/infrastructure/casbin/adapter.mjs +13 -0
  173. package/dist/modules/user/infrastructure/casbin/adapter.mjs.map +1 -0
  174. package/dist/modules/user/infrastructure/casbin/adapter.pg.d.mts +19 -0
  175. package/dist/modules/user/infrastructure/casbin/adapter.pg.d.mts.map +1 -0
  176. package/dist/modules/user/infrastructure/casbin/adapter.pg.mjs +129 -0
  177. package/dist/modules/user/infrastructure/casbin/adapter.pg.mjs.map +1 -0
  178. package/dist/modules/user/infrastructure/casbin/adapter.sqlite.d.mts +19 -0
  179. package/dist/modules/user/infrastructure/casbin/adapter.sqlite.d.mts.map +1 -0
  180. package/dist/modules/user/infrastructure/casbin/adapter.sqlite.mjs +129 -0
  181. package/dist/modules/user/infrastructure/casbin/adapter.sqlite.mjs.map +1 -0
  182. package/dist/modules/user/infrastructure/casbin/enforcer.d.mts +9 -0
  183. package/dist/modules/user/infrastructure/casbin/enforcer.d.mts.map +1 -0
  184. package/dist/modules/user/infrastructure/casbin/enforcer.mjs +150 -0
  185. package/dist/modules/user/infrastructure/casbin/enforcer.mjs.map +1 -0
  186. package/dist/modules/user/infrastructure/casbin-rule.po.d.mts +643 -0
  187. package/dist/modules/user/infrastructure/casbin-rule.po.d.mts.map +1 -0
  188. package/dist/modules/user/infrastructure/casbin-rule.po.mjs +30 -0
  189. package/dist/modules/user/infrastructure/casbin-rule.po.mjs.map +1 -0
  190. package/dist/modules/user/infrastructure/user.po.d.mts +392 -0
  191. package/dist/modules/user/infrastructure/user.po.d.mts.map +1 -0
  192. package/dist/modules/user/infrastructure/user.po.mjs +34 -0
  193. package/dist/modules/user/infrastructure/user.po.mjs.map +1 -0
  194. package/dist/modules/user/infrastructure/user.repo.pg.d.mts +24 -0
  195. package/dist/modules/user/infrastructure/user.repo.pg.d.mts.map +1 -0
  196. package/dist/modules/user/infrastructure/user.repo.pg.mjs +90 -0
  197. package/dist/modules/user/infrastructure/user.repo.pg.mjs.map +1 -0
  198. package/dist/modules/user/infrastructure/user.repo.sqlite.d.mts +24 -0
  199. package/dist/modules/user/infrastructure/user.repo.sqlite.d.mts.map +1 -0
  200. package/dist/modules/user/infrastructure/user.repo.sqlite.mjs +88 -0
  201. package/dist/modules/user/infrastructure/user.repo.sqlite.mjs.map +1 -0
  202. package/dist/modules/user/interfaces/admin.route.d.mts +8270 -0
  203. package/dist/modules/user/interfaces/admin.route.d.mts.map +1 -0
  204. package/dist/modules/user/interfaces/admin.route.mjs +74 -0
  205. package/dist/modules/user/interfaces/admin.route.mjs.map +1 -0
  206. package/dist/modules/user/interfaces/role.route.d.mts +102 -0
  207. package/dist/modules/user/interfaces/role.route.d.mts.map +1 -0
  208. package/dist/modules/user/interfaces/role.route.mjs +60 -0
  209. package/dist/modules/user/interfaces/role.route.mjs.map +1 -0
  210. package/dist/modules/user/interfaces/user.dto.d.mts +106 -0
  211. package/dist/modules/user/interfaces/user.dto.d.mts.map +1 -0
  212. package/dist/modules/user/interfaces/user.dto.mjs +32 -0
  213. package/dist/modules/user/interfaces/user.dto.mjs.map +1 -0
  214. package/dist/modules/user/interfaces/user.route.d.mts +2093 -0
  215. package/dist/modules/user/interfaces/user.route.d.mts.map +1 -0
  216. package/dist/modules/user/interfaces/user.route.mjs +69 -0
  217. package/dist/modules/user/interfaces/user.route.mjs.map +1 -0
  218. package/dist/modules/user/interfaces/user.vo.d.mts +28 -0
  219. package/dist/modules/user/interfaces/user.vo.d.mts.map +1 -0
  220. package/dist/modules/user/interfaces/user.vo.mjs +18 -0
  221. package/dist/modules/user/interfaces/user.vo.mjs.map +1 -0
  222. package/dist/rank.service-D2h-2iJA.mjs +109 -0
  223. package/dist/rank.service-D2h-2iJA.mjs.map +1 -0
  224. package/dist/settings.d.mts +12 -0
  225. package/dist/settings.d.mts.map +1 -0
  226. package/dist/settings.mjs +27 -0
  227. package/dist/settings.mjs.map +1 -0
  228. package/dist/shared/create-app.d.mts +13 -0
  229. package/dist/shared/create-app.d.mts.map +1 -0
  230. package/dist/shared/create-app.mjs +45 -0
  231. package/dist/shared/create-app.mjs.map +1 -0
  232. package/dist/shared/db/bootstrap.d.mts +5 -0
  233. package/dist/shared/db/bootstrap.d.mts.map +1 -0
  234. package/dist/shared/db/bootstrap.mjs +51 -0
  235. package/dist/shared/db/bootstrap.mjs.map +1 -0
  236. package/dist/shared/db/connection.d.mts +1567 -0
  237. package/dist/shared/db/connection.d.mts.map +1 -0
  238. package/dist/shared/db/connection.mjs +59 -0
  239. package/dist/shared/db/connection.mjs.map +1 -0
  240. package/dist/shared/db/migrations/pg/0000_init.sql +74 -0
  241. package/dist/shared/db/migrations/pg/0001_snippets & tokens.sql +6 -0
  242. package/dist/shared/db/migrations/pg/0002_change_task_id_to_uuid_v7.sql +3 -0
  243. package/dist/shared/db/migrations/pg/meta/0000_snapshot.json +498 -0
  244. package/dist/shared/db/migrations/pg/meta/0001_snapshot.json +513 -0
  245. package/dist/shared/db/migrations/pg/meta/0002_snapshot.json +514 -0
  246. package/dist/shared/db/migrations/pg/meta/_journal.json +27 -0
  247. package/dist/shared/db/migrations/sqlite/0000_init.sql +72 -0
  248. package/dist/shared/db/migrations/sqlite/0001_snippets & tokens.sql +2 -0
  249. package/dist/shared/db/migrations/sqlite/0002_change_task_id_to_uuid_v7.sql +35 -0
  250. package/dist/shared/db/migrations/sqlite/meta/0000_snapshot.json +493 -0
  251. package/dist/shared/db/migrations/sqlite/meta/0001_snapshot.json +509 -0
  252. package/dist/shared/db/migrations/sqlite/meta/0002_snapshot.json +509 -0
  253. package/dist/shared/db/migrations/sqlite/meta/_journal.json +27 -0
  254. package/dist/shared/db/seed.d.mts +5 -0
  255. package/dist/shared/db/seed.d.mts.map +1 -0
  256. package/dist/shared/db/seed.mjs +42 -0
  257. package/dist/shared/db/seed.mjs.map +1 -0
  258. package/dist/shared/deps.d.mts +28 -0
  259. package/dist/shared/deps.d.mts.map +1 -0
  260. package/dist/shared/deps.mjs +69 -0
  261. package/dist/shared/deps.mjs.map +1 -0
  262. package/dist/shared/dto/index.d.mts +11 -0
  263. package/dist/shared/dto/index.d.mts.map +1 -0
  264. package/dist/shared/dto/index.mjs +11 -0
  265. package/dist/shared/dto/index.mjs.map +1 -0
  266. package/dist/shared/logger.d.mts +14 -0
  267. package/dist/shared/logger.d.mts.map +1 -0
  268. package/dist/shared/logger.mjs +37 -0
  269. package/dist/shared/logger.mjs.map +1 -0
  270. package/dist/shared/mcp/createTool.d.mts +15 -0
  271. package/dist/shared/mcp/createTool.d.mts.map +1 -0
  272. package/dist/shared/mcp/createTool.mjs +8 -0
  273. package/dist/shared/mcp/createTool.mjs.map +1 -0
  274. package/dist/shared/middleware/authorization.d.mts +15 -0
  275. package/dist/shared/middleware/authorization.d.mts.map +1 -0
  276. package/dist/shared/middleware/authorization.mjs +46 -0
  277. package/dist/shared/middleware/authorization.mjs.map +1 -0
  278. package/dist/shared/middleware/http-logger.d.mts +7 -0
  279. package/dist/shared/middleware/http-logger.d.mts.map +1 -0
  280. package/dist/shared/middleware/http-logger.mjs +40 -0
  281. package/dist/shared/middleware/http-logger.mjs.map +1 -0
  282. package/dist/shared/middleware/jwt.d.mts +7 -0
  283. package/dist/shared/middleware/jwt.d.mts.map +1 -0
  284. package/dist/shared/middleware/jwt.mjs +34 -0
  285. package/dist/shared/middleware/jwt.mjs.map +1 -0
  286. package/dist/shared/middleware/limiter.d.mts +7 -0
  287. package/dist/shared/middleware/limiter.d.mts.map +1 -0
  288. package/dist/shared/middleware/limiter.mjs +10 -0
  289. package/dist/shared/middleware/limiter.mjs.map +1 -0
  290. package/dist/shared/middleware/services.d.mts +8 -0
  291. package/dist/shared/middleware/services.d.mts.map +1 -0
  292. package/dist/shared/middleware/services.mjs +19 -0
  293. package/dist/shared/middleware/services.mjs.map +1 -0
  294. package/dist/shared/redis/decorator.d.mts +113 -0
  295. package/dist/shared/redis/decorator.d.mts.map +1 -0
  296. package/dist/shared/redis/decorator.mjs +203 -0
  297. package/dist/shared/redis/decorator.mjs.map +1 -0
  298. package/dist/shared/redis/factory.d.mts +18 -0
  299. package/dist/shared/redis/factory.d.mts.map +1 -0
  300. package/dist/shared/redis/factory.mjs +41 -0
  301. package/dist/shared/redis/factory.mjs.map +1 -0
  302. package/dist/shared/redis/index.d.mts +12 -0
  303. package/dist/shared/redis/index.d.mts.map +1 -0
  304. package/dist/shared/redis/index.mjs +14 -0
  305. package/dist/shared/redis/index.mjs.map +1 -0
  306. package/dist/shared/types.d.mts +36 -0
  307. package/dist/shared/types.d.mts.map +1 -0
  308. package/dist/shared/types.mjs +1 -0
  309. package/dist/shared/utils/date.d.mts +1 -0
  310. package/dist/shared/utils/date.mjs +1 -0
  311. package/dist/shared/utils/error-handler.d.mts +7 -0
  312. package/dist/shared/utils/error-handler.d.mts.map +1 -0
  313. package/dist/shared/utils/error-handler.mjs +22 -0
  314. package/dist/shared/utils/error-handler.mjs.map +1 -0
  315. package/dist/shared/utils/format.d.mts +8 -0
  316. package/dist/shared/utils/format.d.mts.map +1 -0
  317. package/dist/shared/utils/format.mjs +24 -0
  318. package/dist/shared/utils/format.mjs.map +1 -0
  319. package/dist/shared/utils/pagination.d.mts +9 -0
  320. package/dist/shared/utils/pagination.d.mts.map +1 -0
  321. package/dist/shared/utils/pagination.mjs +12 -0
  322. package/dist/shared/utils/pagination.mjs.map +1 -0
  323. package/dist/shared/utils/response-template.d.mts +69 -0
  324. package/dist/shared/utils/response-template.d.mts.map +1 -0
  325. package/dist/shared/utils/response-template.mjs +96 -0
  326. package/dist/shared/utils/response-template.mjs.map +1 -0
  327. package/dist/shared/utils/url.d.mts +18 -0
  328. package/dist/shared/utils/url.d.mts.map +1 -0
  329. package/dist/shared/utils/url.mjs +39 -0
  330. package/dist/shared/utils/url.mjs.map +1 -0
  331. package/dist/shared/utils/user.d.mts +8 -0
  332. package/dist/shared/utils/user.d.mts.map +1 -0
  333. package/dist/shared/utils/user.mjs +11 -0
  334. package/dist/shared/utils/user.mjs.map +1 -0
  335. package/dist/shared/utils/validator.d.mts +5984 -0
  336. package/dist/shared/utils/validator.d.mts.map +1 -0
  337. package/dist/shared/utils/validator.mjs +34 -0
  338. package/dist/shared/utils/validator.mjs.map +1 -0
  339. package/dist/shared/vo/index.d.mts +11 -0
  340. package/dist/shared/vo/index.d.mts.map +1 -0
  341. package/dist/shared/vo/index.mjs +1 -0
  342. package/package.json +86 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validator.d.mts","names":[],"sources":["../../../src/shared/utils/validator.ts"],"mappings":";;;;;;;KAEK,UAAA,UAAoB,UAAA;AAAA,iBAET,aAAA,CAAc,MAAA,EAAQ,UAAA,CAAW,UAAA,YAAc,iBAAA,CAAf,IAAA,CAAe,GAAA;;;;;;;;;;;;;;;;;;;;cAAA,OAAA,CAAA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;cAAA,OAAA,CAAA,aAAA"}
@@ -0,0 +1,34 @@
1
+ import { zValidator } from "@hono/zod-validator";
2
+
3
+ //#region src/shared/utils/validator.ts
4
+ function jsonValidator(schema) {
5
+ return zValidator("json", schema, (result, c) => {
6
+ if (!result.success) return c.json({
7
+ code: 400,
8
+ message: "Validation failed",
9
+ data: result.error.issues
10
+ }, 400);
11
+ });
12
+ }
13
+ function queryValidator(schema) {
14
+ return zValidator("query", schema, (result, c) => {
15
+ if (!result.success) return c.json({
16
+ code: 400,
17
+ message: "Validation failed",
18
+ data: result.error.issues
19
+ }, 400);
20
+ });
21
+ }
22
+ function paramValidator(schema) {
23
+ return zValidator("param", schema, (result, c) => {
24
+ if (!result.success) return c.json({
25
+ code: 400,
26
+ message: "Validation failed",
27
+ data: result.error.issues
28
+ }, 400);
29
+ });
30
+ }
31
+
32
+ //#endregion
33
+ export { jsonValidator, paramValidator, queryValidator };
34
+ //# sourceMappingURL=validator.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validator.mjs","names":[],"sources":["../../../src/shared/utils/validator.ts"],"sourcesContent":["import { zValidator } from '@hono/zod-validator'\n\ntype ZValidator = typeof zValidator\n\nexport function jsonValidator(schema: Parameters<ZValidator>[1]) {\n return zValidator(\n 'json',\n schema,\n (result, c) => {\n if (!result.success) {\n return c.json(\n { code: 400, message: 'Validation failed', data: result.error.issues },\n 400,\n )\n }\n },\n )\n}\n\nexport function queryValidator(schema: Parameters<ZValidator>[1]) {\n return zValidator(\n 'query',\n schema,\n (result, c) => {\n if (!result.success) {\n return c.json(\n { code: 400, message: 'Validation failed', data: result.error.issues },\n 400,\n )\n }\n },\n )\n}\n\nexport function paramValidator(schema: Parameters<ZValidator>[1]) {\n return zValidator(\n 'param',\n schema,\n (result, c) => {\n if (!result.success) {\n return c.json(\n { code: 400, message: 'Validation failed', data: result.error.issues },\n 400,\n )\n }\n },\n )\n}\n"],"mappings":";;;AAIA,SAAgB,cAAc,QAAmC;AAC/D,QAAO,WACL,QACA,SACC,QAAQ,MAAM;AACb,MAAI,CAAC,OAAO,QACV,QAAO,EAAE,KACP;GAAE,MAAM;GAAK,SAAS;GAAqB,MAAM,OAAO,MAAM;GAAQ,EACtE,IACD;GAGN;;AAGH,SAAgB,eAAe,QAAmC;AAChE,QAAO,WACL,SACA,SACC,QAAQ,MAAM;AACb,MAAI,CAAC,OAAO,QACV,QAAO,EAAE,KACP;GAAE,MAAM;GAAK,SAAS;GAAqB,MAAM,OAAO,MAAM;GAAQ,EACtE,IACD;GAGN;;AAGH,SAAgB,eAAe,QAAmC;AAChE,QAAO,WACL,SACA,SACC,QAAQ,MAAM;AACb,MAAI,CAAC,OAAO,QACV,QAAO,EAAE,KACP;GAAE,MAAM;GAAK,SAAS;GAAqB,MAAM,OAAO,MAAM;GAAQ,EACtE,IACD;GAGN"}
@@ -0,0 +1,11 @@
1
+ //#region src/shared/vo/index.d.ts
2
+ interface PaginationVO<T> {
3
+ list: T[];
4
+ total: number;
5
+ page: number;
6
+ pageSize: number;
7
+ totalPages: number;
8
+ }
9
+ //#endregion
10
+ export { PaginationVO };
11
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/shared/vo/index.ts"],"mappings":";UAAiB,YAAA;EACf,IAAA,EAAM,CAAA;EACN,KAAA;EACA,IAAA;EACA,QAAA;EACA,UAAA;AAAA"}
@@ -0,0 +1 @@
1
+ export { };
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "@pcontext/api",
3
+ "type": "module",
4
+ "version": "0.0.1",
5
+ "description": "PContext API - Backend API service for PContext",
6
+ "author": "fkcaikengren",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/fkcaikengren/pcontext#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/fkcaikengren/pcontext.git",
12
+ "directory": "packages/api"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/fkcaikengren/pcontext/issues"
16
+ },
17
+ "keywords": [
18
+ "pcontext",
19
+ "api",
20
+ "hono"
21
+ ],
22
+ "exports": {
23
+ ".": "./dist/index.mjs"
24
+ },
25
+ "module": "./dist/index.mjs",
26
+ "public": true,
27
+ "publishConfig": {
28
+ "access": "public",
29
+ "registry": "https://registry.npmjs.org"
30
+ },
31
+ "files": [
32
+ "dist"
33
+ ],
34
+ "engines": {
35
+ "node": ">=22.0.0"
36
+ },
37
+ "scripts": {
38
+ "dev": "NODE_ENV=development bun run --hot src/dev.ts --elide-lines=1000",
39
+ "clean": "rm -rf dist",
40
+ "build": "NODE_ENV=production tsdown && cp -r src/shared/db/migrations dist/shared/db/migrations",
41
+ "test": "NODE_ENV=test bun run src/index.ts",
42
+ "mcp-inspector": "mcp-inspector",
43
+ "lint": "eslint . --ext .ts,.js",
44
+ "lint:fix": "eslint . --ext .ts,.js --fix",
45
+ "db:generate": "bun run scripts/drizzle-generate.ts"
46
+ },
47
+ "dependencies": {
48
+ "@ai-sdk/llamaindex": "^1.0.106",
49
+ "@hono/node-server": "^1.19.6",
50
+ "@hono/vite-dev-server": "^0.23.0",
51
+ "@hono/zod-validator": "^0.7.2",
52
+ "@libsql/client": "^0.15.15",
53
+ "@llamaindex/milvus": "^0.1.31",
54
+ "@llamaindex/openai": "0.4.22",
55
+ "@llamaindex/readers": "~3.1.4",
56
+ "@llamaindex/tools": "~0.1.2",
57
+ "@llamaindex/workflow": "~1.1.8",
58
+ "@mendable/firecrawl-js": "^4.13.0",
59
+ "@modelcontextprotocol/sdk": "^1.26.0",
60
+ "@pcontext/shared": "workspace:*",
61
+ "@zilliz/milvus2-sdk-node": "^2.6.5",
62
+ "ai": "^6.0.86",
63
+ "argon2": "^0.43.1",
64
+ "bullmq": "^5.70.1",
65
+ "casbin": "^5.45.0",
66
+ "class-variance-authority": "^0.7.1",
67
+ "croner": "^9.1.0",
68
+ "cross-env": "^10.1.0",
69
+ "dotenv": "^17.2.3",
70
+ "drizzle-orm": "^0.45.0",
71
+ "drizzle-zod": "^0.8.3",
72
+ "es-toolkit": "^1.42.0",
73
+ "git-url-parse": "^16.1.0",
74
+ "hono": "^4.10.7",
75
+ "hono-rate-limiter": "^0.4.2",
76
+ "ioredis": "^5.9.3",
77
+ "isbot": "^5.1.31",
78
+ "llamaindex": "~0.12.1",
79
+ "pg": "^8.16.3",
80
+ "pino": "^10.1.0",
81
+ "pino-http": "^11.0.0",
82
+ "stoker": "^2.0.1",
83
+ "uuidv7": "^1.1.0",
84
+ "zod": "^4.1.13"
85
+ }
86
+ }