@aurabase/aurabase-js 0.3.0 → 0.3.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 (258) hide show
  1. package/package.json +4 -4
  2. package/packages/ai/node_modules/.bin/esbuild +0 -19
  3. package/packages/ai/node_modules/.bin/tsc +0 -22
  4. package/packages/ai/node_modules/.bin/tsserver +0 -22
  5. package/packages/ai/node_modules/.bin/tsup +0 -22
  6. package/packages/ai/node_modules/.bin/tsup-node +0 -22
  7. package/packages/ai/node_modules/.bin/vite +0 -22
  8. package/packages/ai/node_modules/.bin/vitest +0 -22
  9. package/packages/ai/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  10. package/packages/ai/src/AiService.ts +0 -226
  11. package/packages/ai/src/index.ts +0 -18
  12. package/packages/ai/src/sse.ts +0 -141
  13. package/packages/ai/src/types.ts +0 -30
  14. package/packages/ai/tests/chat-stream.test.ts +0 -151
  15. package/packages/ai/tests/rag-namespaces.test.ts +0 -54
  16. package/packages/ai/tests/sse.test.ts +0 -69
  17. package/packages/ai/tsconfig.json +0 -5
  18. package/packages/ai/tsup.config.ts +0 -11
  19. package/packages/aurabase/node_modules/.bin/esbuild +0 -19
  20. package/packages/aurabase/node_modules/.bin/tsc +0 -22
  21. package/packages/aurabase/node_modules/.bin/tsserver +0 -22
  22. package/packages/aurabase/node_modules/.bin/tsup +0 -22
  23. package/packages/aurabase/node_modules/.bin/tsup-node +0 -22
  24. package/packages/aurabase/node_modules/.bin/vite +0 -22
  25. package/packages/aurabase/node_modules/.bin/vitest +0 -22
  26. package/packages/aurabase/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  27. package/packages/aurabase/src/AuraClient.ts +0 -237
  28. package/packages/aurabase/src/index.ts +0 -152
  29. package/packages/aurabase/src/ssr.ts +0 -156
  30. package/packages/aurabase/tests/ai-streaming-rag-e2e.test.ts +0 -82
  31. package/packages/aurabase/tests/ai.test.ts +0 -111
  32. package/packages/aurabase/tests/auth-admin.test.ts +0 -515
  33. package/packages/aurabase/tests/auth-e2e.test.ts +0 -135
  34. package/packages/aurabase/tests/auth-hardening.test.ts +0 -206
  35. package/packages/aurabase/tests/auth.test.ts +0 -947
  36. package/packages/aurabase/tests/database.test.ts +0 -230
  37. package/packages/aurabase/tests/db-types-e2e.test.ts +0 -217
  38. package/packages/aurabase/tests/dispose.test.ts +0 -23
  39. package/packages/aurabase/tests/foreign-token.e2e.test.ts +0 -129
  40. package/packages/aurabase/tests/functions.test.ts +0 -107
  41. package/packages/aurabase/tests/integration.test.ts +0 -413
  42. package/packages/aurabase/tests/live-production-validation.js +0 -241
  43. package/packages/aurabase/tests/live-sdk-production-validation.js +0 -293
  44. package/packages/aurabase/tests/mocks.ts +0 -139
  45. package/packages/aurabase/tests/notifications.test.ts +0 -314
  46. package/packages/aurabase/tests/observability-backup.test.ts +0 -186
  47. package/packages/aurabase/tests/observability-hook.test.ts +0 -130
  48. package/packages/aurabase/tests/production-robustness.test.ts +0 -268
  49. package/packages/aurabase/tests/public-api-surface.test.ts +0 -53
  50. package/packages/aurabase/tests/query-builder.test.ts +0 -329
  51. package/packages/aurabase/tests/readme-smoke-e2e.test.ts +0 -231
  52. package/packages/aurabase/tests/realtime-filter-e2e.test.ts +0 -344
  53. package/packages/aurabase/tests/refresh-locks.test.ts +0 -210
  54. package/packages/aurabase/tests/retry-option.test.ts +0 -17
  55. package/packages/aurabase/tests/rpc-e2e.test.ts +0 -254
  56. package/packages/aurabase/tests/rs256-local-e2e.test.ts +0 -114
  57. package/packages/aurabase/tests/rt-alias-public-e2e.test.ts +0 -235
  58. package/packages/aurabase/tests/rt-http-broadcast-e2e.test.ts +0 -124
  59. package/packages/aurabase/tests/service-role-guard.test.ts +0 -99
  60. package/packages/aurabase/tests/ssr.test.ts +0 -91
  61. package/packages/aurabase/tests/storage-backend-e2e.test.ts +0 -481
  62. package/packages/aurabase/tests/storage-sdk-parity-e2e.test.ts +0 -104
  63. package/packages/aurabase/tests/storage-transform-e2e.test.ts +0 -684
  64. package/packages/aurabase/tests/storage.test.ts +0 -55
  65. package/packages/aurabase/tests/types/client-generic.test-d.ts +0 -79
  66. package/packages/aurabase/tests/types/docs-snippets.test-d.ts +0 -571
  67. package/packages/aurabase/tests/types/error-code.test-d.ts +0 -53
  68. package/packages/aurabase/tsconfig.json +0 -5
  69. package/packages/aurabase/tsconfig.test-d.json +0 -5
  70. package/packages/aurabase/tsup.config.ts +0 -11
  71. package/packages/aurabase/vitest.config.ts +0 -16
  72. package/packages/auth/node_modules/.bin/esbuild +0 -19
  73. package/packages/auth/node_modules/.bin/tsc +0 -22
  74. package/packages/auth/node_modules/.bin/tsserver +0 -22
  75. package/packages/auth/node_modules/.bin/tsup +0 -22
  76. package/packages/auth/node_modules/.bin/tsup-node +0 -22
  77. package/packages/auth/node_modules/.bin/vite +0 -22
  78. package/packages/auth/node_modules/.bin/vitest +0 -22
  79. package/packages/auth/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  80. package/packages/auth/src/AuthAdminService.ts +0 -149
  81. package/packages/auth/src/AuthService.ts +0 -1166
  82. package/packages/auth/src/SessionManager.ts +0 -92
  83. package/packages/auth/src/index.ts +0 -17
  84. package/packages/auth/src/jwks.ts +0 -337
  85. package/packages/auth/src/pkce.ts +0 -27
  86. package/packages/auth/src/types.ts +0 -89
  87. package/packages/auth/tests/auth-lifecycle.test.ts +0 -149
  88. package/packages/auth/tests/detect-session.test.ts +0 -361
  89. package/packages/auth/tests/getclaims.test.ts +0 -780
  90. package/packages/auth/tests/is-mfa-challenge.test.ts +0 -27
  91. package/packages/auth/tests/password-recovery.test.ts +0 -124
  92. package/packages/auth/tests/pkce.test.ts +0 -192
  93. package/packages/auth/tests/session-manager.test.ts +0 -103
  94. package/packages/auth/tests/set-session.test.ts +0 -139
  95. package/packages/auth/tests/verify-otp.test.ts +0 -153
  96. package/packages/auth/tsconfig.json +0 -5
  97. package/packages/auth/tsup.config.ts +0 -11
  98. package/packages/core/node_modules/.bin/esbuild +0 -22
  99. package/packages/core/node_modules/.bin/tsc +0 -22
  100. package/packages/core/node_modules/.bin/tsserver +0 -22
  101. package/packages/core/node_modules/.bin/tsup +0 -22
  102. package/packages/core/node_modules/.bin/tsup-node +0 -22
  103. package/packages/core/node_modules/.bin/vite +0 -22
  104. package/packages/core/node_modules/.bin/vitest +0 -22
  105. package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  106. package/packages/core/src/AuraError.ts +0 -89
  107. package/packages/core/src/BaseService.ts +0 -44
  108. package/packages/core/src/client.ts +0 -34
  109. package/packages/core/src/cookie-utils.ts +0 -42
  110. package/packages/core/src/fetch.ts +0 -435
  111. package/packages/core/src/index.ts +0 -22
  112. package/packages/core/src/retry.ts +0 -63
  113. package/packages/core/src/serialize.ts +0 -6
  114. package/packages/core/src/stores/BaseAuthStore.ts +0 -164
  115. package/packages/core/src/stores/LocalAuthStore.ts +0 -199
  116. package/packages/core/src/types.ts +0 -1042
  117. package/packages/core/tests/auth-store.test.ts +0 -300
  118. package/packages/core/tests/error-code.test.ts +0 -61
  119. package/packages/core/tests/error.test.ts +0 -24
  120. package/packages/core/tests/fetch.test.ts +0 -286
  121. package/packages/core/tests/mocks.ts +0 -139
  122. package/packages/core/tests/observability.test.ts +0 -86
  123. package/packages/core/tests/refresh-hardening.test.ts +0 -164
  124. package/packages/core/tests/refresh-observability.test.ts +0 -111
  125. package/packages/core/tests/retry.test.ts +0 -106
  126. package/packages/core/tests/serialize.test.ts +0 -12
  127. package/packages/core/tests/timeout.test.ts +0 -79
  128. package/packages/core/tsconfig.json +0 -5
  129. package/packages/core/tsup.config.ts +0 -11
  130. package/packages/db/node_modules/.bin/esbuild +0 -19
  131. package/packages/db/node_modules/.bin/tsc +0 -22
  132. package/packages/db/node_modules/.bin/tsserver +0 -22
  133. package/packages/db/node_modules/.bin/tsup +0 -22
  134. package/packages/db/node_modules/.bin/tsup-node +0 -22
  135. package/packages/db/node_modules/.bin/vite +0 -22
  136. package/packages/db/node_modules/.bin/vitest +0 -22
  137. package/packages/db/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  138. package/packages/db/src/DatabaseService.ts +0 -170
  139. package/packages/db/src/QueryBuilder.ts +0 -830
  140. package/packages/db/src/index.ts +0 -2
  141. package/packages/db/src/pgrst-types/common/common.ts +0 -86
  142. package/packages/db/src/pgrst-types/common/rpc.ts +0 -151
  143. package/packages/db/src/pgrst-types/feature-flags.ts +0 -20
  144. package/packages/db/src/pgrst-types/types.ts +0 -134
  145. package/packages/db/src/select-query-parser/parser.ts +0 -479
  146. package/packages/db/src/select-query-parser/result.ts +0 -553
  147. package/packages/db/src/select-query-parser/types.ts +0 -132
  148. package/packages/db/src/select-query-parser/utils.ts +0 -707
  149. package/packages/db/tests/filters.test.ts +0 -81
  150. package/packages/db/tests/mutations-filtered.e2e.test.ts +0 -132
  151. package/packages/db/tests/mutations-filtered.test.ts +0 -188
  152. package/packages/db/tests/order.test.ts +0 -45
  153. package/packages/db/tests/rpc.test.ts +0 -41
  154. package/packages/db/tests/scale/build-large-schema.ts +0 -94
  155. package/packages/db/tests/scale/scale-compile.test.ts +0 -167
  156. package/packages/db/tests/schema.test.ts +0 -77
  157. package/packages/db/tests/single-accept.e2e.test.ts +0 -123
  158. package/packages/db/tests/single.test.ts +0 -211
  159. package/packages/db/tests/types/filters.test-d.ts +0 -52
  160. package/packages/db/tests/types/fixtures.ts +0 -40
  161. package/packages/db/tests/types/from-views.test-d.ts +0 -18
  162. package/packages/db/tests/types/mutations.test-d.ts +0 -23
  163. package/packages/db/tests/types/rpc.test-d.ts +0 -60
  164. package/packages/db/tests/types/schema-shape.test-d.ts +0 -8
  165. package/packages/db/tests/types/select-inference.test-d.ts +0 -38
  166. package/packages/db/tests/vendored/fixtures.ts +0 -83
  167. package/packages/db/tests/vendored/get-result.test-d.ts +0 -75
  168. package/packages/db/tsconfig.json +0 -5
  169. package/packages/db/tsconfig.test-d.json +0 -5
  170. package/packages/db/tsup.config.ts +0 -11
  171. package/packages/db/vitest.config.ts +0 -8
  172. package/packages/functions/node_modules/.bin/esbuild +0 -19
  173. package/packages/functions/node_modules/.bin/tsc +0 -22
  174. package/packages/functions/node_modules/.bin/tsserver +0 -22
  175. package/packages/functions/node_modules/.bin/tsup +0 -22
  176. package/packages/functions/node_modules/.bin/tsup-node +0 -22
  177. package/packages/functions/node_modules/.bin/vite +0 -22
  178. package/packages/functions/node_modules/.bin/vitest +0 -22
  179. package/packages/functions/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  180. package/packages/functions/src/FunctionsService.ts +0 -188
  181. package/packages/functions/src/errors.ts +0 -70
  182. package/packages/functions/src/index.ts +0 -6
  183. package/packages/functions/tests/invoke.test.ts +0 -97
  184. package/packages/functions/tests/response-type-errors.test.ts +0 -135
  185. package/packages/functions/tsconfig.json +0 -5
  186. package/packages/functions/tsup.config.ts +0 -11
  187. package/packages/gen/node_modules/.bin/esbuild +0 -19
  188. package/packages/gen/node_modules/.bin/tsc +0 -22
  189. package/packages/gen/node_modules/.bin/tsserver +0 -22
  190. package/packages/gen/node_modules/.bin/tsup +0 -22
  191. package/packages/gen/node_modules/.bin/tsup-node +0 -22
  192. package/packages/gen/node_modules/.bin/vite +0 -22
  193. package/packages/gen/node_modules/.bin/vitest +0 -22
  194. package/packages/gen/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  195. package/packages/gen/src/cli.ts +0 -67
  196. package/packages/gen/src/generate.ts +0 -0
  197. package/packages/gen/src/index.ts +0 -2
  198. package/packages/gen/tests/compile.test.ts +0 -213
  199. package/packages/gen/tests/e2e.test.ts +0 -130
  200. package/packages/gen/tests/generate.test.ts +0 -396
  201. package/packages/gen/tsconfig.json +0 -5
  202. package/packages/gen/tsup.config.ts +0 -11
  203. package/packages/notifications/node_modules/.bin/esbuild +0 -19
  204. package/packages/notifications/node_modules/.bin/tsc +0 -22
  205. package/packages/notifications/node_modules/.bin/tsserver +0 -22
  206. package/packages/notifications/node_modules/.bin/tsup +0 -22
  207. package/packages/notifications/node_modules/.bin/tsup-node +0 -22
  208. package/packages/notifications/node_modules/.bin/vite +0 -22
  209. package/packages/notifications/node_modules/.bin/vitest +0 -22
  210. package/packages/notifications/src/NotificationsService.ts +0 -230
  211. package/packages/notifications/src/index.ts +0 -19
  212. package/packages/notifications/tsconfig.json +0 -5
  213. package/packages/notifications/tsup.config.ts +0 -11
  214. package/packages/realtime/node_modules/.bin/esbuild +0 -19
  215. package/packages/realtime/node_modules/.bin/tsc +0 -22
  216. package/packages/realtime/node_modules/.bin/tsserver +0 -22
  217. package/packages/realtime/node_modules/.bin/tsup +0 -22
  218. package/packages/realtime/node_modules/.bin/tsup-node +0 -22
  219. package/packages/realtime/node_modules/.bin/vite +0 -22
  220. package/packages/realtime/node_modules/.bin/vitest +0 -22
  221. package/packages/realtime/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  222. package/packages/realtime/src/AuraChannel.ts +0 -485
  223. package/packages/realtime/src/HeartbeatManager.ts +0 -73
  224. package/packages/realtime/src/RealtimeService.ts +0 -505
  225. package/packages/realtime/src/columnFilter.ts +0 -301
  226. package/packages/realtime/src/index.ts +0 -4
  227. package/packages/realtime/tests/ack-routing.test.ts +0 -81
  228. package/packages/realtime/tests/column-filter.test.ts +0 -144
  229. package/packages/realtime/tests/dispatch.test.ts +0 -191
  230. package/packages/realtime/tests/heartbeat.test.ts +0 -67
  231. package/packages/realtime/tests/http-broadcast.test.ts +0 -68
  232. package/packages/realtime/tests/realtime-token.test.ts +0 -43
  233. package/packages/realtime/tests/reconnect-race.test.ts +0 -149
  234. package/packages/realtime/tests/ref-id.test.ts +0 -34
  235. package/packages/realtime/tests/set-auth.test.ts +0 -70
  236. package/packages/realtime/tsconfig.json +0 -5
  237. package/packages/realtime/tsup.config.ts +0 -11
  238. package/packages/storage/node_modules/.bin/esbuild +0 -19
  239. package/packages/storage/node_modules/.bin/tsc +0 -22
  240. package/packages/storage/node_modules/.bin/tsserver +0 -22
  241. package/packages/storage/node_modules/.bin/tsup +0 -22
  242. package/packages/storage/node_modules/.bin/tsup-node +0 -22
  243. package/packages/storage/node_modules/.bin/vite +0 -22
  244. package/packages/storage/node_modules/.bin/vitest +0 -22
  245. package/packages/storage/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
  246. package/packages/storage/src/DownloadBuilder.ts +0 -60
  247. package/packages/storage/src/StorageService.ts +0 -323
  248. package/packages/storage/src/index.ts +0 -2
  249. package/packages/storage/src/path.ts +0 -35
  250. package/packages/storage/src/transform.ts +0 -15
  251. package/packages/storage/tests/download.test.ts +0 -64
  252. package/packages/storage/tests/parity.test.ts +0 -154
  253. package/packages/storage/tests/path.test.ts +0 -87
  254. package/packages/storage/tests/transform.test.ts +0 -79
  255. package/packages/storage/tsconfig.json +0 -5
  256. package/packages/storage/tsup.config.ts +0 -11
  257. package/pnpm-workspace.yaml +0 -24
  258. package/tsconfig.base.json +0 -15
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aurabase/aurabase-js",
3
- "version": "0.3.0",
4
- "description": "aurabase sdk backend service ",
3
+ "version": "0.3.1",
4
+ "description": "Aurabase JavaScript SDK",
5
5
  "license": "ISC",
6
6
  "author": "Daylami Affane",
7
7
  "type": "module",
@@ -12,7 +12,8 @@
12
12
  "test": "pnpm -r test",
13
13
  "test:e2e": "pnpm --filter aurabase run test:e2e"
14
14
  },
15
- "dependencies": {
15
+ "dependencies": {},
16
+ "devDependencies": {
16
17
  "acorn": "^8.16.0",
17
18
  "any-promise": "^1.3.0",
18
19
  "assertion-error": "^2.0.1",
@@ -78,7 +79,6 @@
78
79
  "vitest": "^4.1.9",
79
80
  "why-is-node-running": "^2.3.0"
80
81
  },
81
- "devDependencies": {},
82
82
  "engines": {
83
83
  "node": ">=20.0.0"
84
84
  },
@@ -1,19 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- "$basedir/../../../../node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/bin/esbuild" "$@"
18
- exit $?
19
- # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/bin/esbuild
@@ -1,22 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
19
- else
20
- exec node "$basedir/../typescript/bin/tsc" "$@"
21
- fi
22
- # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/ai/node_modules/typescript/bin/tsc
@@ -1,22 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
19
- else
20
- exec node "$basedir/../typescript/bin/tsserver" "$@"
21
- fi
22
- # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/ai/node_modules/typescript/bin/tsserver
@@ -1,22 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules/tsup/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules/tsup/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../tsup/dist/cli-default.js" "$@"
19
- else
20
- exec node "$basedir/../tsup/dist/cli-default.js" "$@"
21
- fi
22
- # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/ai/node_modules/tsup/dist/cli-default.js
@@ -1,22 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules/tsup/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules/tsup/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../tsup/dist/cli-node.js" "$@"
19
- else
20
- exec node "$basedir/../tsup/dist/cli-node.js" "$@"
21
- fi
22
- # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/ai/node_modules/tsup/dist/cli-node.js
@@ -1,22 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/bin/vite.js" "$@"
19
- else
20
- exec node "$basedir/../../../../node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/bin/vite.js" "$@"
21
- fi
22
- # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/bin/vite.js
@@ -1,22 +0,0 @@
1
- #!/bin/sh
2
- basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
-
4
- case `uname` in
5
- *CYGWIN*|*MINGW*|*MSYS*)
6
- if command -v cygpath > /dev/null 2>&1; then
7
- basedir=`cygpath -w "$basedir"`
8
- fi
9
- ;;
10
- esac
11
-
12
- if [ -z "$NODE_PATH" ]; then
13
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vitest@4.1.9_@types+node@20.14.15_vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7_/node_modules/vitest/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vitest@4.1.9_@types+node@20.14.15_vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7_/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
- else
15
- export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vitest@4.1.9_@types+node@20.14.15_vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7_/node_modules/vitest/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vitest@4.1.9_@types+node@20.14.15_vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7_/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
- fi
17
- if [ -x "$basedir/node" ]; then
18
- exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
19
- else
20
- exec node "$basedir/../vitest/vitest.mjs" "$@"
21
- fi
22
- # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/ai/node_modules/vitest/vitest.mjs
@@ -1 +0,0 @@
1
- {"version":"4.1.9","results":[[":tests/chat-stream.test.ts",{"duration":1153.2597079999996,"failed":false}],[":tests/sse.test.ts",{"duration":167.96295800000007,"failed":false}],[":tests/rag-namespaces.test.ts",{"duration":362.81866700000046,"failed":false}]]}
@@ -1,226 +0,0 @@
1
- import { BaseService } from '@aurabase/core'
2
- import { AuraError, isTokenExpired, refreshOnce, isAbortError } from '@aurabase/core'
3
- import type {
4
- AuraResponse,
5
- ChatMessage,
6
- ChatResponse,
7
- EmbedRequest,
8
- EmbedResponse,
9
- RagIngestRequest,
10
- RagIngestResponse,
11
- RagRequest,
12
- RagResponse,
13
- SemanticSearchResult,
14
- } from '@aurabase/core'
15
- import type { AuraClientLike } from '@aurabase/core'
16
- import { parseSSE, type ChatStreamChunk, type ChatStreamFinal } from './sse'
17
- import type { RagNamespace, RagDeleteResponse, RagReindexResponse } from './types'
18
-
19
- export class AiService extends BaseService {
20
- constructor(client: AuraClientLike) {
21
- super(client)
22
- }
23
-
24
- private get prefix(): string {
25
- return `/v1/ai/${this.client.projectId}`
26
- }
27
-
28
- /**
29
- * Send a chat completion request.
30
- */
31
- async chat(
32
- messages: ChatMessage[],
33
- options?: { model?: string; temperature?: number; max_tokens?: number },
34
- ): Promise<AuraResponse<ChatResponse>> {
35
- return this.request('POST', `${this.prefix}/chat`, {
36
- messages,
37
- ...options,
38
- })
39
- }
40
-
41
- /**
42
- * Chat completion streamé (SSE). Renvoie un `AsyncIterable` de deltas de tokens,
43
- * consommable par `for await (const { delta } of ai.chatStream(msgs)) { … }`.
44
- *
45
- * Court-circuite volontairement le pipeline JSON (`@aurabase/core/fetch.ts`) et
46
- * emprunte le chemin transport BRUT `client.fetchFn` (patron `StorageService.download`) :
47
- * - refresh proactif du token expiré (même règle que `download`, marge 30 s) ;
48
- * - pose manuelle de `Authorization: Bearer` + `apikey`, `Accept: text/event-stream` ;
49
- * - lecture de `res.body` via `parseSSE`, mapping des events serveur :
50
- * `delta` (`{ content }`) → `yield { delta }`, `error` (`{ error }`) → lève une
51
- * `AuraError`, `done` → termine l'itération.
52
- *
53
- * `options.signal` interrompt proprement le flux (annulation du `fetch` + fin
54
- * d'itération sans throw). Sur `!res.ok`, lève `AuraError(res.status)`.
55
- *
56
- * Backend route: POST /v1/ai/{project_id}/chat/stream
57
- */
58
- async *chatStream(
59
- messages: ChatMessage[],
60
- options?: { model?: string; temperature?: number; max_tokens?: number; signal?: AbortSignal },
61
- ): AsyncGenerator<ChatStreamChunk> {
62
- const client = this.client
63
- const store = client.authStore
64
- // Refresh proactif AVANT d'ouvrir le flux (aligné sur download()).
65
- if (store.token && store.refreshToken && isTokenExpired(store.token, 30)) {
66
- await refreshOnce(client)
67
- }
68
- const headers: Record<string, string> = {
69
- 'Content-Type': 'application/json',
70
- Accept: 'text/event-stream',
71
- }
72
- if (store.token) headers['Authorization'] = `Bearer ${store.token}`
73
- if (client.apiKey) headers['apikey'] = client.apiKey
74
-
75
- const body = JSON.stringify({
76
- messages,
77
- model: options?.model,
78
- temperature: options?.temperature,
79
- max_tokens: options?.max_tokens,
80
- })
81
-
82
- try {
83
- const res = await client.fetchFn(this.url(`${this.prefix}/chat/stream`), {
84
- method: 'POST',
85
- headers,
86
- body,
87
- signal: options?.signal,
88
- })
89
- if (!res.ok) {
90
- let parsed: { error?: { code?: string; message?: string }; message?: string } | null = null
91
- try {
92
- parsed = (await res.json()) as typeof parsed
93
- } catch {
94
- // corps non-JSON / vide → AuraError générique sur le status
95
- }
96
- throw new AuraError(res.status, parsed)
97
- }
98
- if (!res.body) {
99
- throw new AuraError(0, {
100
- error: { code: 'invalid_response', message: 'chatStream: la réponse SSE n\'a pas de corps lisible' },
101
- })
102
- }
103
- for await (const msg of parseSSE(res.body as ReadableStream<Uint8Array>)) {
104
- if (msg.event === 'delta') {
105
- let content = ''
106
- try {
107
- content = (JSON.parse(msg.data) as { content?: string }).content ?? ''
108
- } catch {
109
- content = ''
110
- }
111
- if (content) yield { delta: content }
112
- } else if (msg.event === 'error') {
113
- let message = 'AI stream error'
114
- try {
115
- message = (JSON.parse(msg.data) as { error?: string }).error ?? message
116
- } catch {
117
- // conserve le message par défaut
118
- }
119
- throw new AuraError(0, { error: { code: 'ai_stream_error', message } })
120
- } else if (msg.event === 'done') {
121
- // Le serveur joint au `done` le provider effectif, la bascule éventuelle,
122
- // le motif d'arrêt et l'usage réel. Les jeter privait l'application de
123
- // toute visibilité sur une réponse tronquée et sur sa consommation.
124
- let final: ChatStreamFinal | undefined
125
- try {
126
- const parsed = JSON.parse(msg.data) as ChatStreamFinal & { status?: string }
127
- const { status: _status, ...rest } = parsed
128
- // Un chunk final n'est émis QUE s'il apporte quelque chose : face à un
129
- // serveur plus ancien (`done` réduit à `[DONE]`), l'itération se termine
130
- // exactement comme avant — aucun chunk supplémentaire à filtrer.
131
- if (Object.keys(rest).length > 0) final = rest
132
- } catch {
133
- final = undefined
134
- }
135
- if (final) yield { delta: '', final }
136
- return
137
- }
138
- }
139
- } catch (err) {
140
- // Annulation demandée → fin d'itération PROPRE (pas de throw), parité avec
141
- // une consommation interrompue via AbortController.
142
- if (options?.signal?.aborted || isAbortError(err)) return
143
- throw err
144
- }
145
- }
146
-
147
- /**
148
- * Generate embeddings for the given input(s).
149
- */
150
- async embed(req: EmbedRequest): Promise<AuraResponse<EmbedResponse>> {
151
- return this.request('POST', `${this.prefix}/embed`, req)
152
- }
153
-
154
- /**
155
- * Retrieval-Augmented Generation: query a collection and get an answer.
156
- */
157
- async rag(req: RagRequest): Promise<AuraResponse<RagResponse>> {
158
- return this.request('POST', `${this.prefix}/rag/query`, req)
159
- }
160
-
161
- /**
162
- * Ingest a document into a RAG namespace.
163
- */
164
- async ragIngest(req: RagIngestRequest): Promise<AuraResponse<RagIngestResponse>> {
165
- return this.request('POST', `${this.prefix}/rag/ingest`, req)
166
- }
167
-
168
- /**
169
- * Liste les namespaces RAG du projet.
170
- * Backend route: GET /v1/ai/{project_id}/rag/namespaces (→ `Vec<String>`).
171
- */
172
- async listNamespaces(): Promise<AuraResponse<RagNamespace[]>> {
173
- return this.request('GET', `${this.prefix}/rag/namespaces`)
174
- }
175
-
176
- /**
177
- * Supprime un namespace RAG (et son corpus). Le segment `namespace` est
178
- * URL-encodé (anti-injection de chemin).
179
- * Backend route: DELETE /v1/ai/{project_id}/rag/{namespace} (→ `{ deleted }`).
180
- */
181
- async deleteNamespace(namespace: string): Promise<AuraResponse<RagDeleteResponse>> {
182
- return this.request('DELETE', `${this.prefix}/rag/${encodeURIComponent(namespace)}`)
183
- }
184
-
185
- /**
186
- * Ré-indexe un namespace RAG avec le modèle d'embedding courant (remédiation
187
- * après un changement de modèle/dimension). Le segment `namespace` est URL-encodé.
188
- * Backend route: POST /v1/ai/{project_id}/rag/{namespace}/reindex (→ `ReindexResponse`).
189
- */
190
- async reindexNamespace(namespace: string): Promise<AuraResponse<RagReindexResponse>> {
191
- return this.request('POST', `${this.prefix}/rag/${encodeURIComponent(namespace)}/reindex`)
192
- }
193
-
194
- /**
195
- * Semantic search over an embedding namespace.
196
- */
197
- async semanticSearch(
198
- query: string,
199
- namespace: string,
200
- options?: { top_k?: number; threshold?: number },
201
- ): Promise<AuraResponse<SemanticSearchResult[]>> {
202
- const params = new URLSearchParams({ query, namespace })
203
- if (options?.top_k !== undefined) params.set('top_k', String(options.top_k))
204
- if (options?.threshold !== undefined) params.set('threshold', String(options.threshold))
205
- return this.request('GET', `${this.prefix}/search?${params.toString()}`)
206
- }
207
-
208
- /**
209
- * Natural-language to SQL: convert a question into a SQL query.
210
- */
211
- async nl2sql(
212
- question: string,
213
- schema: string,
214
- options?: {
215
- dialect?: string
216
- examples?: Array<{ question: string; sql: string }>
217
- },
218
- ): Promise<AuraResponse<{ sql: string; explanation: string }>> {
219
- return this.request('POST', `${this.prefix}/nl2sql`, {
220
- question,
221
- schema,
222
- dialect: options?.dialect,
223
- examples: options?.examples,
224
- })
225
- }
226
- }
@@ -1,18 +0,0 @@
1
- export { AiService } from './AiService'
2
- export { parseSSE } from './sse'
3
- export type { SSEMessage, ChatStreamChunk } from './sse'
4
- export type { RagNamespace, RagDeleteResponse, RagReindexResponse } from './types'
5
-
6
- // Types publics (utilisables en consommant `@aurabase/ai` seul, sans importer core).
7
- export type {
8
- AuraResponse,
9
- ChatMessage,
10
- ChatResponse,
11
- EmbedRequest,
12
- EmbedResponse,
13
- RagRequest,
14
- RagResponse,
15
- RagIngestRequest,
16
- RagIngestResponse,
17
- SemanticSearchResult,
18
- } from '@aurabase/core'
@@ -1,141 +0,0 @@
1
- // ---------------------------------------------------------------------------
2
- // Parseur SSE (Server-Sent Events) — utilitaire de streaming côté SDK.
3
- //
4
- // Extrait pour être testable en isolation (trames partielles, multi-events par
5
- // chunk, lignes keep-alive `:`) et réutilisable (chat streaming, futur SSE
6
- // realtime/functions). NE DÉPEND PAS de `@aurabase/core/fetch.ts` : il opère sur
7
- // un `ReadableStream<Uint8Array>` brut obtenu via `client.fetchFn` (patron Storage).
8
- // ---------------------------------------------------------------------------
9
-
10
- /** Un message SSE dispatché : nom d'event (`message` par défaut) + données jointes. */
11
- export interface SSEMessage {
12
- event: string
13
- data: string
14
- }
15
-
16
- /** Usage de tokens rapporté par le provider à la fin d'un flux. */
17
- export interface ChatStreamUsage {
18
- input_tokens?: number | null
19
- /** Tokens de sortie facturés, raisonnement inclus. */
20
- output_tokens?: number | null
21
- /** Part de `output_tokens` consommée par le raisonnement du modèle. */
22
- reasoning_tokens?: number | null
23
- /** `true` si les compteurs sont estimés faute d'usage rapporté par le provider. */
24
- estimated?: boolean
25
- }
26
-
27
- /**
28
- * Dernier chunk d'un flux de chat, émis avant la fin de l'itération.
29
- *
30
- * Le serveur envoie ces informations dans l'event SSE `done` ; elles étaient
31
- * jusqu'ici ignorées par le SDK, si bien qu'une réponse tronquée (`length`) ou la
32
- * consommation réelle de tokens restaient invisibles côté application.
33
- */
34
- export interface ChatStreamFinal {
35
- /** Provider ayant effectivement répondu. */
36
- provider?: string
37
- /** `true` si une bascule de fallback a eu lieu. */
38
- fallback_used?: boolean
39
- /** Motif d'arrêt normalisé : `stop` | `length` | `content_filter` | `tool_use` | `other`. */
40
- finish_reason?: string | null
41
- /** Raccourci : la réponse a été coupée par la limite de tokens. */
42
- truncated?: boolean
43
- usage?: ChatStreamUsage
44
- }
45
-
46
- /**
47
- * Chunk de streaming de chat.
48
- *
49
- * `delta` porte le texte incrémental ; le **dernier** chunk du flux porte `final`
50
- * (sans `delta`) avec l'usage et le motif d'arrêt. Les consommateurs existants
51
- * qui n'utilisent que `delta` continuent de fonctionner : ils reçoivent une
52
- * chaîne vide sur ce dernier chunk.
53
- */
54
- export interface ChatStreamChunk {
55
- delta: string
56
- final?: ChatStreamFinal
57
- }
58
-
59
- /**
60
- * Parse un flux SSE en `AsyncGenerator<SSEMessage>`.
61
- *
62
- * Conforme au protocole EventSource :
63
- * - événements séparés par une ligne vide (`\n\n`) ;
64
- * - champs `event:` / `data:` (espace optionnel après le `:`), autres champs ignorés ;
65
- * - plusieurs `data:` d'un même event sont jointes par `\n` ;
66
- * - lignes commençant par `:` = commentaires/keep-alive → ignorées ;
67
- * - CRLF toléré (le `\r` de fin de ligne est retiré).
68
- *
69
- * Gère les trames partielles : un event scindé sur plusieurs chunks est
70
- * bufferisé jusqu'à réception de la ligne vide. Un éventuel event final non
71
- * terminé par une ligne vide est tout de même livré à la fermeture du flux.
72
- */
73
- export async function* parseSSE(
74
- stream: ReadableStream<Uint8Array>,
75
- ): AsyncGenerator<SSEMessage> {
76
- const reader = stream.getReader()
77
- const decoder = new TextDecoder()
78
- let buffer = ''
79
- let eventName = 'message'
80
- let dataLines: string[] = []
81
-
82
- // Consomme une ligne (déjà débarrassée de son `\n` et de son éventuel `\r`).
83
- // Renvoie un SSEMessage à dispatcher sur ligne vide, sinon null.
84
- const consumeLine = (raw: string): SSEMessage | null => {
85
- const line = raw.endsWith('\r') ? raw.slice(0, -1) : raw
86
- if (line === '') {
87
- // Fin d'event : dispatch si des données ont été accumulées.
88
- if (dataLines.length === 0) {
89
- eventName = 'message'
90
- return null
91
- }
92
- const msg: SSEMessage = { event: eventName, data: dataLines.join('\n') }
93
- eventName = 'message'
94
- dataLines = []
95
- return msg
96
- }
97
- if (line.startsWith(':')) return null // commentaire / keep-alive
98
- const colon = line.indexOf(':')
99
- let field: string
100
- let value: string
101
- if (colon === -1) {
102
- field = line
103
- value = ''
104
- } else {
105
- field = line.slice(0, colon)
106
- value = line.slice(colon + 1)
107
- if (value.startsWith(' ')) value = value.slice(1)
108
- }
109
- if (field === 'event') eventName = value
110
- else if (field === 'data') dataLines.push(value)
111
- // id / retry : ignorés (non pertinents pour le SDK)
112
- return null
113
- }
114
-
115
- try {
116
- for (;;) {
117
- const { done, value } = await reader.read()
118
- if (done) break
119
- buffer += decoder.decode(value, { stream: true })
120
- let idx: number
121
- while ((idx = buffer.indexOf('\n')) !== -1) {
122
- const raw = buffer.slice(0, idx)
123
- buffer = buffer.slice(idx + 1)
124
- const msg = consumeLine(raw)
125
- if (msg) yield msg
126
- }
127
- }
128
- // Vidange du décodeur + traitement d'une éventuelle dernière ligne sans `\n`.
129
- buffer += decoder.decode()
130
- if (buffer.length > 0) {
131
- const msg = consumeLine(buffer)
132
- if (msg) yield msg
133
- }
134
- // Event final non terminé par une ligne vide (data accumulée sans dispatch).
135
- if (dataLines.length > 0) {
136
- yield { event: eventName, data: dataLines.join('\n') }
137
- }
138
- } finally {
139
- reader.releaseLock()
140
- }
141
- }
@@ -1,30 +0,0 @@
1
- // ---------------------------------------------------------------------------
2
- // Types locaux du package @aurabase/ai (non mutualisés dans @aurabase/core).
3
- // ---------------------------------------------------------------------------
4
-
5
- /**
6
- * Un namespace RAG. Le backend (`GET /rag/namespaces` → `Vec<String>`) renvoie
7
- * de simples chaînes ; le type reste un alias pour documenter l'intention et
8
- * autoriser une évolution ultérieure vers un objet sans casser les appelants.
9
- */
10
- export type RagNamespace = string
11
-
12
- /**
13
- * Réponse de `DELETE /rag/{namespace}` — forme réelle du handler
14
- * (`rag_delete_namespace` → `{ "deleted": <count> }`).
15
- */
16
- export interface RagDeleteResponse {
17
- /** Nombre d'entrées supprimées du namespace. */
18
- deleted: number
19
- }
20
-
21
- /**
22
- * Réponse de `POST /rag/{namespace}/reindex` — forme réelle du handler
23
- * (`ReindexResponse` dans `services/aura-ai/src/rag/mod.rs`).
24
- */
25
- export interface RagReindexResponse {
26
- /** Nombre de chunks ré-embeddés sous le modèle courant. */
27
- reindexed: number
28
- /** Modèle d'embedding désormais appliqué au namespace. */
29
- embedding_model: string
30
- }