@nebula-ai/sdk 1.2.0 → 1.3.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 (423) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +4 -23
  3. package/README.md +305 -128
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +205 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +205 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +505 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +501 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +13 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +13 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +43 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +13 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +40 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +37 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/qs/formats.d.mts +7 -0
  109. package/internal/qs/formats.d.mts.map +1 -0
  110. package/internal/qs/formats.d.ts +7 -0
  111. package/internal/qs/formats.d.ts.map +1 -0
  112. package/internal/qs/formats.js +13 -0
  113. package/internal/qs/formats.js.map +1 -0
  114. package/internal/qs/formats.mjs +9 -0
  115. package/internal/qs/formats.mjs.map +1 -0
  116. package/internal/qs/index.d.mts +10 -0
  117. package/internal/qs/index.d.mts.map +1 -0
  118. package/internal/qs/index.d.ts +10 -0
  119. package/internal/qs/index.d.ts.map +1 -0
  120. package/internal/qs/index.js +14 -0
  121. package/internal/qs/index.js.map +1 -0
  122. package/internal/qs/index.mjs +10 -0
  123. package/internal/qs/index.mjs.map +1 -0
  124. package/internal/qs/stringify.d.mts +3 -0
  125. package/internal/qs/stringify.d.mts.map +1 -0
  126. package/internal/qs/stringify.d.ts +3 -0
  127. package/internal/qs/stringify.d.ts.map +1 -0
  128. package/internal/qs/stringify.js +277 -0
  129. package/internal/qs/stringify.js.map +1 -0
  130. package/internal/qs/stringify.mjs +274 -0
  131. package/internal/qs/stringify.mjs.map +1 -0
  132. package/internal/qs/types.d.mts +57 -0
  133. package/internal/qs/types.d.mts.map +1 -0
  134. package/internal/qs/types.d.ts +57 -0
  135. package/internal/qs/types.d.ts.map +1 -0
  136. package/internal/qs/types.js +3 -0
  137. package/internal/qs/types.js.map +1 -0
  138. package/internal/qs/types.mjs +2 -0
  139. package/internal/qs/types.mjs.map +1 -0
  140. package/internal/qs/utils.d.mts +15 -0
  141. package/internal/qs/utils.d.mts.map +1 -0
  142. package/internal/qs/utils.d.ts +15 -0
  143. package/internal/qs/utils.d.ts.map +1 -0
  144. package/internal/qs/utils.js +230 -0
  145. package/internal/qs/utils.js.map +1 -0
  146. package/internal/qs/utils.mjs +217 -0
  147. package/internal/qs/utils.mjs.map +1 -0
  148. package/internal/request-options.d.mts +79 -0
  149. package/internal/request-options.d.mts.map +1 -0
  150. package/internal/request-options.d.ts +79 -0
  151. package/internal/request-options.d.ts.map +1 -0
  152. package/internal/request-options.js +14 -0
  153. package/internal/request-options.js.map +1 -0
  154. package/internal/request-options.mjs +10 -0
  155. package/internal/request-options.mjs.map +1 -0
  156. package/internal/shim-types.d.mts +17 -0
  157. package/internal/shim-types.d.mts.map +1 -0
  158. package/internal/shim-types.d.ts +17 -0
  159. package/internal/shim-types.d.ts.map +1 -0
  160. package/internal/shim-types.js +4 -0
  161. package/internal/shim-types.js.map +1 -0
  162. package/internal/shim-types.mjs +3 -0
  163. package/internal/shim-types.mjs.map +1 -0
  164. package/internal/shims.d.mts +20 -0
  165. package/internal/shims.d.mts.map +1 -0
  166. package/internal/shims.d.ts +20 -0
  167. package/internal/shims.d.ts.map +1 -0
  168. package/internal/shims.js +92 -0
  169. package/internal/shims.js.map +1 -0
  170. package/internal/shims.mjs +85 -0
  171. package/internal/shims.mjs.map +1 -0
  172. package/internal/to-file.d.mts +45 -0
  173. package/internal/to-file.d.mts.map +1 -0
  174. package/internal/to-file.d.ts +45 -0
  175. package/internal/to-file.d.ts.map +1 -0
  176. package/internal/to-file.js +91 -0
  177. package/internal/to-file.js.map +1 -0
  178. package/internal/to-file.mjs +88 -0
  179. package/internal/to-file.mjs.map +1 -0
  180. package/internal/tslib.js +81 -0
  181. package/internal/tslib.mjs +17 -0
  182. package/internal/types.d.mts +69 -0
  183. package/internal/types.d.mts.map +1 -0
  184. package/internal/types.d.ts +69 -0
  185. package/internal/types.d.ts.map +1 -0
  186. package/internal/types.js +4 -0
  187. package/internal/types.js.map +1 -0
  188. package/internal/types.mjs +3 -0
  189. package/internal/types.mjs.map +1 -0
  190. package/internal/uploads.d.mts +42 -0
  191. package/internal/uploads.d.mts.map +1 -0
  192. package/internal/uploads.d.ts +42 -0
  193. package/internal/uploads.d.ts.map +1 -0
  194. package/internal/uploads.js +141 -0
  195. package/internal/uploads.js.map +1 -0
  196. package/internal/uploads.mjs +131 -0
  197. package/internal/uploads.mjs.map +1 -0
  198. package/internal/utils/base64.d.mts +3 -0
  199. package/internal/utils/base64.d.mts.map +1 -0
  200. package/internal/utils/base64.d.ts +3 -0
  201. package/internal/utils/base64.d.ts.map +1 -0
  202. package/internal/utils/base64.js +38 -0
  203. package/internal/utils/base64.js.map +1 -0
  204. package/internal/utils/base64.mjs +33 -0
  205. package/internal/utils/base64.mjs.map +1 -0
  206. package/internal/utils/bytes.d.mts +4 -0
  207. package/internal/utils/bytes.d.mts.map +1 -0
  208. package/internal/utils/bytes.d.ts +4 -0
  209. package/internal/utils/bytes.d.ts.map +1 -0
  210. package/internal/utils/bytes.js +31 -0
  211. package/internal/utils/bytes.js.map +1 -0
  212. package/internal/utils/bytes.mjs +26 -0
  213. package/internal/utils/bytes.mjs.map +1 -0
  214. package/internal/utils/env.d.mts +9 -0
  215. package/internal/utils/env.d.mts.map +1 -0
  216. package/internal/utils/env.d.ts +9 -0
  217. package/internal/utils/env.d.ts.map +1 -0
  218. package/internal/utils/env.js +22 -0
  219. package/internal/utils/env.js.map +1 -0
  220. package/internal/utils/env.mjs +18 -0
  221. package/internal/utils/env.mjs.map +1 -0
  222. package/internal/utils/log.d.mts +37 -0
  223. package/internal/utils/log.d.mts.map +1 -0
  224. package/internal/utils/log.d.ts +37 -0
  225. package/internal/utils/log.d.ts.map +1 -0
  226. package/internal/utils/log.js +86 -0
  227. package/internal/utils/log.js.map +1 -0
  228. package/internal/utils/log.mjs +80 -0
  229. package/internal/utils/log.mjs.map +1 -0
  230. package/internal/utils/path.d.mts +15 -0
  231. package/internal/utils/path.d.mts.map +1 -0
  232. package/internal/utils/path.d.ts +15 -0
  233. package/internal/utils/path.d.ts.map +1 -0
  234. package/internal/utils/path.js +79 -0
  235. package/internal/utils/path.js.map +1 -0
  236. package/internal/utils/path.mjs +74 -0
  237. package/internal/utils/path.mjs.map +1 -0
  238. package/internal/utils/query.d.mts +2 -0
  239. package/internal/utils/query.d.mts.map +1 -0
  240. package/internal/utils/query.d.ts +2 -0
  241. package/internal/utils/query.d.ts.map +1 -0
  242. package/internal/utils/query.js +10 -0
  243. package/internal/utils/query.js.map +1 -0
  244. package/internal/utils/query.mjs +6 -0
  245. package/internal/utils/query.mjs.map +1 -0
  246. package/internal/utils/sleep.d.mts +2 -0
  247. package/internal/utils/sleep.d.mts.map +1 -0
  248. package/internal/utils/sleep.d.ts +2 -0
  249. package/internal/utils/sleep.d.ts.map +1 -0
  250. package/internal/utils/sleep.js +7 -0
  251. package/internal/utils/sleep.js.map +1 -0
  252. package/internal/utils/sleep.mjs +3 -0
  253. package/internal/utils/sleep.mjs.map +1 -0
  254. package/internal/utils/uuid.d.mts +5 -0
  255. package/internal/utils/uuid.d.mts.map +1 -0
  256. package/internal/utils/uuid.d.ts +5 -0
  257. package/internal/utils/uuid.d.ts.map +1 -0
  258. package/internal/utils/uuid.js +19 -0
  259. package/internal/utils/uuid.js.map +1 -0
  260. package/internal/utils/uuid.mjs +15 -0
  261. package/internal/utils/uuid.mjs.map +1 -0
  262. package/internal/utils/values.d.mts +18 -0
  263. package/internal/utils/values.d.mts.map +1 -0
  264. package/internal/utils/values.d.ts +18 -0
  265. package/internal/utils/values.d.ts.map +1 -0
  266. package/internal/utils/values.js +112 -0
  267. package/internal/utils/values.js.map +1 -0
  268. package/internal/utils/values.mjs +94 -0
  269. package/internal/utils/values.mjs.map +1 -0
  270. package/internal/utils.d.mts +8 -0
  271. package/internal/utils.d.mts.map +1 -0
  272. package/internal/utils.d.ts +8 -0
  273. package/internal/utils.d.ts.map +1 -0
  274. package/internal/utils.js +12 -0
  275. package/internal/utils.js.map +1 -0
  276. package/internal/utils.mjs +9 -0
  277. package/internal/utils.mjs.map +1 -0
  278. package/lib/dx.d.mts +96 -0
  279. package/lib/dx.d.mts.map +1 -0
  280. package/lib/dx.d.ts +96 -0
  281. package/lib/dx.d.ts.map +1 -0
  282. package/lib/dx.js +239 -0
  283. package/lib/dx.js.map +1 -0
  284. package/lib/dx.mjs +235 -0
  285. package/lib/dx.mjs.map +1 -0
  286. package/package.json +144 -58
  287. package/resource.d.mts +2 -0
  288. package/resource.d.mts.map +1 -0
  289. package/resource.d.ts +2 -0
  290. package/resource.d.ts.map +1 -0
  291. package/resource.js +6 -0
  292. package/resource.js.map +1 -0
  293. package/resource.mjs +2 -0
  294. package/resource.mjs.map +1 -0
  295. package/resources/collections.d.mts +289 -0
  296. package/resources/collections.d.mts.map +1 -0
  297. package/resources/collections.d.ts +289 -0
  298. package/resources/collections.d.ts.map +1 -0
  299. package/resources/collections.js +72 -0
  300. package/resources/collections.js.map +1 -0
  301. package/resources/collections.mjs +68 -0
  302. package/resources/collections.mjs.map +1 -0
  303. package/resources/connectors.d.mts +148 -0
  304. package/resources/connectors.d.mts.map +1 -0
  305. package/resources/connectors.d.ts +148 -0
  306. package/resources/connectors.d.ts.map +1 -0
  307. package/resources/connectors.js +50 -0
  308. package/resources/connectors.js.map +1 -0
  309. package/resources/connectors.mjs +46 -0
  310. package/resources/connectors.mjs.map +1 -0
  311. package/resources/index.d.mts +6 -0
  312. package/resources/index.d.mts.map +1 -0
  313. package/resources/index.d.ts +6 -0
  314. package/resources/index.d.ts.map +1 -0
  315. package/resources/index.js +13 -0
  316. package/resources/index.js.map +1 -0
  317. package/resources/index.mjs +6 -0
  318. package/resources/index.mjs.map +1 -0
  319. package/resources/memories.d.mts +1737 -0
  320. package/resources/memories.d.mts.map +1 -0
  321. package/resources/memories.d.ts +1737 -0
  322. package/resources/memories.d.ts.map +1 -0
  323. package/resources/memories.js +157 -0
  324. package/resources/memories.js.map +1 -0
  325. package/resources/memories.mjs +153 -0
  326. package/resources/memories.mjs.map +1 -0
  327. package/resources/snapshots.d.mts +281 -0
  328. package/resources/snapshots.d.mts.map +1 -0
  329. package/resources/snapshots.d.ts +281 -0
  330. package/resources/snapshots.d.ts.map +1 -0
  331. package/resources/snapshots.js +22 -0
  332. package/resources/snapshots.js.map +1 -0
  333. package/resources/snapshots.mjs +18 -0
  334. package/resources/snapshots.mjs.map +1 -0
  335. package/resources/top-level.d.mts +14 -0
  336. package/resources/top-level.d.mts.map +1 -0
  337. package/resources/top-level.d.ts +14 -0
  338. package/resources/top-level.d.ts.map +1 -0
  339. package/resources/top-level.js +4 -0
  340. package/resources/top-level.js.map +1 -0
  341. package/resources/top-level.mjs +3 -0
  342. package/resources/top-level.mjs.map +1 -0
  343. package/resources.d.mts +2 -0
  344. package/resources.d.mts.map +1 -0
  345. package/resources.d.ts +2 -0
  346. package/resources.d.ts.map +1 -0
  347. package/resources.js +5 -0
  348. package/resources.js.map +1 -0
  349. package/resources.mjs +2 -0
  350. package/resources.mjs.map +1 -0
  351. package/src/api-promise.ts +2 -0
  352. package/src/client.ts +892 -0
  353. package/src/core/README.md +3 -0
  354. package/src/core/api-promise.ts +92 -0
  355. package/src/core/error.ts +130 -0
  356. package/src/core/resource.ts +11 -0
  357. package/src/core/uploads.ts +2 -0
  358. package/src/error.ts +2 -0
  359. package/src/index.ts +36 -0
  360. package/src/internal/README.md +3 -0
  361. package/src/internal/builtin-types.ts +93 -0
  362. package/src/internal/detect-platform.ts +196 -0
  363. package/src/internal/errors.ts +33 -0
  364. package/src/internal/headers.ts +97 -0
  365. package/src/internal/parse.ts +56 -0
  366. package/src/internal/qs/LICENSE.md +13 -0
  367. package/src/internal/qs/README.md +3 -0
  368. package/src/internal/qs/formats.ts +10 -0
  369. package/src/internal/qs/index.ts +13 -0
  370. package/src/internal/qs/stringify.ts +385 -0
  371. package/src/internal/qs/types.ts +71 -0
  372. package/src/internal/qs/utils.ts +265 -0
  373. package/src/internal/request-options.ts +93 -0
  374. package/src/internal/shim-types.ts +26 -0
  375. package/src/internal/shims.ts +107 -0
  376. package/src/internal/to-file.ts +154 -0
  377. package/src/internal/types.ts +95 -0
  378. package/src/internal/uploads.ts +187 -0
  379. package/src/internal/utils/base64.ts +40 -0
  380. package/src/internal/utils/bytes.ts +32 -0
  381. package/src/internal/utils/env.ts +18 -0
  382. package/src/internal/utils/log.ts +127 -0
  383. package/src/internal/utils/path.ts +88 -0
  384. package/src/internal/utils/query.ts +7 -0
  385. package/src/internal/utils/sleep.ts +3 -0
  386. package/src/internal/utils/uuid.ts +17 -0
  387. package/src/internal/utils/values.ts +105 -0
  388. package/src/internal/utils.ts +9 -0
  389. package/src/lib/.keep +4 -0
  390. package/src/lib/dx.ts +459 -0
  391. package/src/resource.ts +2 -0
  392. package/src/resources/collections.ts +474 -0
  393. package/src/resources/connectors.ts +236 -0
  394. package/src/resources/index.ts +56 -0
  395. package/src/resources/memories.ts +2409 -0
  396. package/src/resources/snapshots.ts +387 -0
  397. package/src/resources/top-level.ts +19 -0
  398. package/src/resources.ts +1 -0
  399. package/src/tsconfig.json +11 -0
  400. package/src/uploads.ts +2 -0
  401. package/src/version.ts +1 -0
  402. package/uploads.d.mts +2 -0
  403. package/uploads.d.mts.map +1 -0
  404. package/uploads.d.ts +2 -0
  405. package/uploads.d.ts.map +1 -0
  406. package/uploads.js +6 -0
  407. package/uploads.js.map +1 -0
  408. package/uploads.mjs +2 -0
  409. package/uploads.mjs.map +1 -0
  410. package/version.d.mts +2 -0
  411. package/version.d.mts.map +1 -0
  412. package/version.d.ts +2 -0
  413. package/version.d.ts.map +1 -0
  414. package/version.js +5 -0
  415. package/version.js.map +1 -0
  416. package/version.mjs +2 -0
  417. package/version.mjs.map +1 -0
  418. package/dist/index.d.mts +0 -557
  419. package/dist/index.d.ts +0 -557
  420. package/dist/index.js +0 -1282
  421. package/dist/index.js.map +0 -1
  422. package/dist/index.mjs +0 -1267
  423. package/dist/index.mjs.map +0 -1
package/dist/index.d.mts DELETED
@@ -1,557 +0,0 @@
1
- declare enum GraphSearchResultType {
2
- ENTITY = "entity",
3
- RELATIONSHIP = "relationship",
4
- COMMUNITY = "community"
5
- }
6
- interface Chunk {
7
- id: string;
8
- content: string;
9
- metadata: Record<string, unknown>;
10
- role?: string;
11
- }
12
- /**
13
- * Structured chunk format returned by backend for conversation messages.
14
- * Contains message text and role metadata inline.
15
- */
16
- interface StructuredChunk {
17
- text: string;
18
- role: 'user' | 'assistant' | 'system';
19
- }
20
- interface TextContentPart {
21
- type: 'text';
22
- text: string;
23
- }
24
- interface FileContentPart {
25
- type?: 'image' | 'audio' | 'document' | 'file';
26
- data: string;
27
- media_type: string;
28
- filename?: string;
29
- duration_seconds?: number;
30
- }
31
- interface S3FileReferencePart {
32
- type: 's3_ref';
33
- s3_key: string;
34
- bucket?: string;
35
- media_type: string;
36
- filename?: string;
37
- size_bytes?: number;
38
- }
39
- type MultimodalContentPart = TextContentPart | FileContentPart | S3FileReferencePart;
40
- interface Memory$1 {
41
- collection_id?: string;
42
- content?: string | string[] | MultimodalContentPart[] | Array<{
43
- content: string | MultimodalContentPart[];
44
- role: string;
45
- metadata?: Record<string, unknown>;
46
- authority?: number;
47
- }>;
48
- role?: string;
49
- id?: string;
50
- memory_id?: string;
51
- metadata: Record<string, unknown>;
52
- authority?: number;
53
- chunks?: Chunk[];
54
- collection_ids?: string[];
55
- created_at?: string;
56
- updated_at?: string;
57
- }
58
- interface Collection {
59
- id: string;
60
- name: string;
61
- description?: string;
62
- metadata: Record<string, unknown>;
63
- created_at?: string;
64
- updated_at?: string;
65
- memory_count: number;
66
- owner_id?: string;
67
- }
68
- interface SearchResult {
69
- id: string;
70
- score: number;
71
- metadata: Record<string, unknown>;
72
- source?: string;
73
- timestamp?: string;
74
- display_name?: string;
75
- source_role?: string;
76
- memory_id?: string;
77
- owner_id?: string;
78
- engram_id?: string;
79
- content?: string;
80
- graph_result_type?: GraphSearchResultType;
81
- graph_entity?: GraphEntityResult;
82
- graph_relationship?: GraphRelationshipResult;
83
- graph_community?: GraphCommunityResult;
84
- chunk_ids?: string[];
85
- }
86
- interface GraphEntityResult {
87
- id?: string;
88
- name: string;
89
- description: string;
90
- metadata: Record<string, unknown>;
91
- }
92
- interface GraphRelationshipResult {
93
- id?: string;
94
- subject: string;
95
- predicate: string;
96
- object: string;
97
- subject_id?: string;
98
- object_id?: string;
99
- description?: string;
100
- metadata: Record<string, unknown>;
101
- }
102
- interface GraphCommunityResult {
103
- id?: string;
104
- name: string;
105
- summary: string;
106
- metadata: Record<string, unknown>;
107
- }
108
- interface SearchOptions {
109
- limit: number;
110
- filters?: Record<string, unknown>;
111
- }
112
- interface ActivatedEntity {
113
- id?: string;
114
- name: string;
115
- category?: string;
116
- activation_score: number;
117
- activation_reason?: string;
118
- description?: string;
119
- profile?: any;
120
- facets?: ActivatedFacet[];
121
- }
122
- interface ActivatedFacet {
123
- facet_id: string;
124
- facet_name: string;
125
- relevance_score: number;
126
- facts: ActivatedSemantic[];
127
- coherence_score?: number;
128
- is_noise: boolean;
129
- }
130
- interface ActivatedSemantic {
131
- id?: string;
132
- category?: string;
133
- description?: string;
134
- entity_id?: string;
135
- entity_name?: string;
136
- facet_name?: string;
137
- subject?: string;
138
- predicate?: string;
139
- value?: string;
140
- activation_score: number;
141
- extraction_confidence?: number;
142
- corroboration_count?: number;
143
- confidence?: number;
144
- source_chunk_ids?: string[];
145
- reasoning?: string;
146
- resolved_at?: string;
147
- source_nodegroup_ids?: string[];
148
- }
149
- interface GroundedSource {
150
- id?: string;
151
- text: string;
152
- activation_score: number;
153
- timestamp?: string;
154
- source_role?: string;
155
- speaker?: string;
156
- display_name?: string;
157
- engram_id?: string;
158
- owner_id?: string;
159
- supporting_fact_ids?: string[];
160
- metadata?: Record<string, unknown>;
161
- }
162
- interface ActivatedEpisode {
163
- id?: string;
164
- name?: string;
165
- description?: string;
166
- activation_score: number;
167
- status?: string;
168
- t_start?: number;
169
- t_last?: number;
170
- n_facts?: number;
171
- member_semantic_ids?: string[];
172
- source_chunk_ids?: string[];
173
- entity_names?: string[];
174
- }
175
- interface ActivatedProcedure {
176
- statement: string;
177
- activation_score: number;
178
- confidence: number;
179
- is_negated?: boolean;
180
- }
181
- interface MemoryResponse {
182
- query: string;
183
- semantics: ActivatedSemantic[];
184
- procedures?: ActivatedProcedure[];
185
- episodes?: ActivatedEpisode[];
186
- sources: GroundedSource[];
187
- entities: ActivatedEntity[];
188
- total_traversal_time_ms?: number;
189
- token_count?: number;
190
- }
191
- interface NebulaClientConfig {
192
- apiKey: string;
193
- baseUrl?: string;
194
- timeout?: number;
195
- }
196
- declare class NebulaException extends Error {
197
- statusCode?: number | undefined;
198
- details?: unknown | undefined;
199
- constructor(message: string, statusCode?: number | undefined, details?: unknown | undefined);
200
- }
201
- declare class NebulaClientException extends NebulaException {
202
- cause?: Error | undefined;
203
- constructor(message: string, cause?: Error | undefined);
204
- }
205
- declare class NebulaAuthenticationException extends NebulaException {
206
- constructor(message?: string);
207
- }
208
- declare class NebulaRateLimitException extends NebulaException {
209
- constructor(message?: string);
210
- }
211
- declare class NebulaValidationException extends NebulaException {
212
- details?: unknown | undefined;
213
- constructor(message?: string, details?: unknown | undefined);
214
- }
215
- declare class NebulaCollectionNotFoundException extends NebulaException {
216
- constructor(message?: string);
217
- }
218
- declare class NebulaNotFoundException extends NebulaException {
219
- constructor(resourceId: string, resourceType?: string);
220
- }
221
-
222
- /**
223
- * Official Nebula JavaScript/TypeScript SDK
224
- * Mirrors the exact Nebula Python SDK client.py implementation
225
- */
226
- declare class Nebula {
227
- private apiKey;
228
- private baseUrl;
229
- private timeout;
230
- private static readonly MAX_INLINE_SIZE;
231
- constructor(config?: NebulaClientConfig);
232
- setApiKey(next: string): void;
233
- setBaseUrl(next: string): void;
234
- setCorsProxy(_next: string): void;
235
- /** Check if API key is set */
236
- isApiKeySet(): boolean;
237
- /** Detect if a token looks like a Nebula API key (public.raw) */
238
- private _isNebulaApiKey;
239
- /** Build authentication headers */
240
- private _buildAuthHeaders;
241
- private _isRecord;
242
- private _unwrapResults;
243
- private _unwrapResultsArray;
244
- private _looksLikeMultimodalContent;
245
- private _normalizeContentParts;
246
- private _serializeContentAsText;
247
- private _serializeContentAsParts;
248
- /** Make an HTTP request to the Nebula API */
249
- private _makeRequest;
250
- /** Create a new collection */
251
- createCollection(options: {
252
- name: string;
253
- description?: string;
254
- metadata?: Record<string, unknown>;
255
- }): Promise<Collection>;
256
- /** Get a specific collection by ID */
257
- getCollection(collectionId: string): Promise<Collection>;
258
- /** Get a specific collection by name */
259
- getCollectionByName(name: string): Promise<Collection>;
260
- /** Get all collections */
261
- listCollections(options?: {
262
- limit?: number;
263
- offset?: number;
264
- name?: string;
265
- }): Promise<Collection[]>;
266
- /** Update a collection */
267
- updateCollection(options: {
268
- collectionId: string;
269
- name?: string;
270
- description?: string;
271
- metadata?: Record<string, unknown>;
272
- }): Promise<Collection>;
273
- /** Delete a collection */
274
- deleteCollection(collectionId: string): Promise<boolean>;
275
- /**
276
- * Legacy convenience: store raw text content into a collection as a document
277
- */
278
- store(content: string, collectionId: string, metadata?: Record<string, unknown>): Promise<Memory$1>;
279
- /**
280
- * Store a single memory using the unified engrams API.
281
- *
282
- * Automatically infers memory type:
283
- * - If role is present, creates a conversation
284
- * - Otherwise, creates a document
285
- */
286
- storeMemory(memory: Memory$1 | Record<string, unknown>, name?: string): Promise<string>;
287
- /**
288
- * Internal method to append content to an existing memory
289
- *
290
- * @throws NebulaNotFoundException if memory_id doesn't exist
291
- */
292
- private _appendToMemory;
293
- /** Store multiple memories using the unified engrams API.
294
- * @param memories - List of Memory objects to store.
295
- * @param metadata - Optional memory-level metadata for conversation groups.
296
- * Each Memory's own metadata is used as per-message metadata.
297
- */
298
- storeMemories(memories: Memory$1[], metadata?: Record<string, unknown>): Promise<string[]>;
299
- /** Delete one or more memories */
300
- delete(memoryIds: string | string[]): Promise<boolean | {
301
- message: string;
302
- results: {
303
- successful: string[];
304
- failed: Array<{
305
- id: string;
306
- error: string;
307
- }>;
308
- summary: {
309
- total: number;
310
- succeeded: number;
311
- failed: number;
312
- };
313
- };
314
- }>;
315
- /** Delete a specific source within a memory */
316
- deleteSource(sourceId: string): Promise<boolean>;
317
- /** Update a specific source within a memory */
318
- updateSource(sourceId: string, content: string, metadata?: Record<string, unknown>): Promise<boolean>;
319
- /**
320
- * Update memory-level properties including name, metadata, and collection associations.
321
- *
322
- * This method allows updating properties of an entire memory (document or conversation)
323
- * without modifying its content. For updating individual sources within a memory,
324
- * use updateSource(). For updating content, use storeMemory() to append.
325
- *
326
- * @param options - Update configuration
327
- * @param options.memoryId - The ID of the memory to update
328
- * @param options.name - New name for the memory (useful for conversations and documents)
329
- * @param options.metadata - Metadata to set. By default, replaces existing metadata.
330
- * Set mergeMetadata=true to merge with existing metadata instead.
331
- * @param options.collectionIds - New collection associations. Must specify at least one valid collection.
332
- * @param options.mergeMetadata - If true, merges provided metadata with existing metadata.
333
- * If false (default), replaces existing metadata entirely.
334
- *
335
- * @returns Promise resolving to true if successful
336
- *
337
- * @throws NebulaNotFoundException if memory_id doesn't exist
338
- * @throws NebulaValidationException if validation fails (e.g., no fields provided)
339
- * @throws NebulaAuthenticationException if user doesn't have permission to update this memory
340
- */
341
- updateMemory(options: {
342
- memoryId: string;
343
- name?: string;
344
- metadata?: Record<string, unknown>;
345
- collectionIds?: string[];
346
- mergeMetadata?: boolean;
347
- }): Promise<boolean>;
348
- /**
349
- * Get all memories from specific collections with optional metadata filtering
350
- *
351
- * @param options - Configuration for listing memories
352
- * @param options.collection_ids - One or more collection IDs to retrieve memories from
353
- * @param options.limit - Maximum number of memories to return (default: 100)
354
- * @param options.offset - Number of memories to skip for pagination (default: 0)
355
- * @param options.metadata_filters - Optional metadata filters using MongoDB-like operators.
356
- * Supported operators: $eq, $ne, $in, $nin, $exists, $and, $or
357
- *
358
- * @returns Promise resolving to array of MemoryResponse objects
359
- *
360
- * @example
361
- * // Get all playground memories excluding conversations
362
- * const memories = await client.listMemories({
363
- * collection_ids: ['collection-id'],
364
- * metadata_filters: {
365
- * 'metadata.content_type': { $ne: 'conversation' }
366
- * }
367
- * });
368
- *
369
- * @example
370
- * // Complex filter with multiple conditions
371
- * const memories = await client.listMemories({
372
- * collection_ids: ['collection-id'],
373
- * metadata_filters: {
374
- * $and: [
375
- * { 'metadata.playground': { $eq: true } },
376
- * { 'metadata.session_id': { $exists: true } }
377
- * ]
378
- * }
379
- * });
380
- */
381
- listMemories(options: {
382
- collection_ids: string | string[];
383
- limit?: number;
384
- offset?: number;
385
- metadata_filters?: Record<string, unknown>;
386
- }): Promise<Memory$1[]>;
387
- /** Get a specific memory by engram ID */
388
- getMemory(memoryId: string): Promise<Memory$1>;
389
- /**
390
- * Search within specific collections with optional metadata filtering.
391
- *
392
- * @param options - Search configuration
393
- * @param options.query - Search query string
394
- * @param options.collection_ids - One or more collection IDs to search within
395
- * @param options.effort - Compute effort budget (auto/low/medium/high). Controls traversal compute, not MemoryResponse size.
396
- * @param options.filters - Optional filters to apply to the search. Supports comprehensive metadata filtering
397
- * with MongoDB-like operators for both vector/chunk search and graph search.
398
- * @param options.searchSettings - Optional search configuration
399
- *
400
- * @returns Promise resolving to array of SearchResult objects containing both vector/chunk and graph search results
401
- *
402
- * @example
403
- * // Basic equality filter
404
- * await client.search({
405
- * query: "machine learning",
406
- * collection_ids: ["research-collection"],
407
- * filters: {
408
- * "metadata.category": { $eq: "research" },
409
- * "metadata.verified": true // Shorthand for $eq
410
- * }
411
- * });
412
- *
413
- * @example
414
- * // Numeric comparisons
415
- * await client.search({
416
- * query: "high priority",
417
- * collection_ids: ["tasks"],
418
- * filters: {
419
- * "metadata.priority": { $gte: 8 },
420
- * "metadata.score": { $lt: 100 }
421
- * }
422
- * });
423
- *
424
- * @example
425
- * // String matching
426
- * await client.search({
427
- * query: "employees",
428
- * collection_ids: ["team"],
429
- * filters: {
430
- * "metadata.email": { $ilike: "%@company.com" } // Case-insensitive
431
- * }
432
- * });
433
- *
434
- * @example
435
- * // Array operations
436
- * await client.search({
437
- * query: "developers",
438
- * collection_ids: ["team"],
439
- * filters: {
440
- * "metadata.skills": { $overlap: ["python", "typescript"] } // Has any
441
- * }
442
- * });
443
- *
444
- * @example
445
- * // Nested paths
446
- * await client.search({
447
- * query: "users",
448
- * collection_ids: ["profiles"],
449
- * filters: {
450
- * "metadata.user.preferences.theme": { $eq: "dark" }
451
- * }
452
- * });
453
- *
454
- * @example
455
- * // Complex logical combinations
456
- * await client.search({
457
- * query: "candidates",
458
- * collection_ids: ["hiring"],
459
- * filters: {
460
- * $and: [
461
- * { "metadata.verified": true },
462
- * { "metadata.level": { $gte: 5 } },
463
- * {
464
- * $or: [
465
- * { "metadata.skills": { $overlap: ["python", "go"] } },
466
- * { "metadata.years_experience": { $gte: 8 } }
467
- * ]
468
- * }
469
- * ]
470
- * }
471
- * });
472
- *
473
- * @remarks
474
- * Supported Operators:
475
- * - Comparison: $eq, $ne, $lt, $lte, $gt, $gte
476
- * - String: $like (case-sensitive), $ilike (case-insensitive)
477
- * - Array: $in, $nin, $overlap, $contains
478
- * - JSONB: $json_contains
479
- * - Logical: $and, $or
480
- *
481
- * For comprehensive filtering documentation, see the Metadata Filtering Guide:
482
- * https://docs.trynebula.ai/guides/metadata-filtering
483
- */
484
- search(options: {
485
- query: string;
486
- collection_ids?: string | string[];
487
- effort?: 'auto' | 'low' | 'medium' | 'high';
488
- filters?: Record<string, unknown>;
489
- searchSettings?: Record<string, unknown>;
490
- }): Promise<MemoryResponse>;
491
- /** List available connector providers */
492
- listProviders(): Promise<string[]>;
493
- /** Start an OAuth connection flow */
494
- connectProvider(provider: string, collectionId: string, config?: Record<string, unknown>): Promise<Record<string, unknown>>;
495
- /** List active connections for a collection */
496
- listConnections(collectionId: string): Promise<Record<string, unknown>[]>;
497
- /** Browse Google Drive folders for a connection */
498
- listFolders(connectionId: string, parentId?: string): Promise<Record<string, unknown>[]>;
499
- /** List Slack channels for a connection */
500
- listChannels(connectionId: string): Promise<Record<string, unknown>[]>;
501
- /** Get a single connection by ID */
502
- getConnection(connectionId: string): Promise<Record<string, unknown>>;
503
- /** Manually trigger a sync for a connection */
504
- triggerSync(connectionId: string): Promise<Record<string, unknown>>;
505
- /** Update connection config (e.g., folder/channel selection) */
506
- updateConnectionConfig(connectionId: string, config: Record<string, unknown>, apply?: string): Promise<Record<string, unknown>>;
507
- /** Disconnect an external data source */
508
- disconnect(connectionId: string, deleteMemories?: boolean): Promise<Record<string, unknown>>;
509
- healthCheck(): Promise<Record<string, unknown>>;
510
- private _collectionFromDict;
511
- private _memoryResponseFromDict;
512
- private _searchResultFromDict;
513
- private _searchResultFromGraphDict;
514
- private _sha256;
515
- private _formDataFromObject;
516
- /**
517
- * Convert and process multimodal content parts, auto-uploading large base64 files to S3.
518
- *
519
- * - Binary parts (`image`/`audio`/`document` with `data`) larger than 5MB are uploaded to S3 and converted to `s3_ref`.
520
- */
521
- private _processContentParts;
522
- /**
523
- * Get a presigned URL for uploading large files to S3.
524
- */
525
- getUploadUrl(options: {
526
- filename: string;
527
- content_type: string;
528
- file_size: number;
529
- }): Promise<{
530
- upload_url: string;
531
- s3_key: string;
532
- bucket: string;
533
- expires_in: number;
534
- }>;
535
- }
536
-
537
- /**
538
- * Utility for creating multimodal content from files.
539
- * Note: These methods only work in Node.js environments.
540
- */
541
- declare class NebulaContent {
542
- /**
543
- * Create a FileContentPart from a file path.
544
- * Automatically deduces media_type and the backend 'type' (image, audio, document).
545
- */
546
- static fromFile(filePath: string, mediaType?: string): Promise<FileContentPart>;
547
- }
548
-
549
- type MemoryFactory = {
550
- (data: Memory$1): Memory$1;
551
- File: typeof NebulaContent.fromFile;
552
- fromFile: (filePath: string, collection_id: string, metadata?: Record<string, unknown>, role?: string) => Promise<Memory$1>;
553
- };
554
- declare const Memory: MemoryFactory;
555
- type Memory = Memory$1;
556
-
557
- export { type ActivatedEntity, type ActivatedEpisode, type ActivatedFacet, type ActivatedProcedure, type ActivatedSemantic, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type GroundedSource, Memory, type MemoryResponse, type MultimodalContentPart, Nebula, NebulaAuthenticationException, type NebulaClientConfig, NebulaClientException, NebulaCollectionNotFoundException, NebulaContent, NebulaException, NebulaNotFoundException, NebulaRateLimitException, NebulaValidationException, type S3FileReferencePart, type SearchOptions, type SearchResult, type StructuredChunk, type TextContentPart, Nebula as default };