@knowzai/api-client 0.1.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.
- package/LICENSE +21 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/chat.d.ts +21 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/chat.js +147 -0
- package/dist/chat.js.map +1 -0
- package/dist/client.d.ts +33 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +198 -0
- package/dist/client.js.map +1 -0
- package/dist/contracts.d.ts +24 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +2 -0
- package/dist/contracts.js.map +1 -0
- package/dist/envelope.d.ts +27 -0
- package/dist/envelope.d.ts.map +1 -0
- package/dist/envelope.js +16 -0
- package/dist/envelope.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/ask.d.ts +14 -0
- package/dist/resources/ask.d.ts.map +1 -0
- package/dist/resources/ask.js +22 -0
- package/dist/resources/ask.js.map +1 -0
- package/dist/resources/auth.d.ts +15 -0
- package/dist/resources/auth.d.ts.map +1 -0
- package/dist/resources/auth.js +35 -0
- package/dist/resources/auth.js.map +1 -0
- package/dist/resources/extras.d.ts +157 -0
- package/dist/resources/extras.d.ts.map +1 -0
- package/dist/resources/extras.js +150 -0
- package/dist/resources/extras.js.map +1 -0
- package/dist/resources/index.d.ts +6 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +6 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/knowledge.d.ts +13 -0
- package/dist/resources/knowledge.d.ts.map +1 -0
- package/dist/resources/knowledge.js +92 -0
- package/dist/resources/knowledge.js.map +1 -0
- package/dist/resources/paging.d.ts +15 -0
- package/dist/resources/paging.d.ts.map +1 -0
- package/dist/resources/paging.js +16 -0
- package/dist/resources/paging.js.map +1 -0
- package/dist/resources/schemas.d.ts +322 -0
- package/dist/resources/schemas.d.ts.map +1 -0
- package/dist/resources/schemas.js +172 -0
- package/dist/resources/schemas.js.map +1 -0
- package/dist/resources/search.d.ts +14 -0
- package/dist/resources/search.d.ts.map +1 -0
- package/dist/resources/search.js +21 -0
- package/dist/resources/search.js.map +1 -0
- package/dist/resources/vaults.d.ts +14 -0
- package/dist/resources/vaults.d.ts.map +1 -0
- package/dist/resources/vaults.js +41 -0
- package/dist/resources/vaults.js.map +1 -0
- package/dist/tls.d.ts +7 -0
- package/dist/tls.d.ts.map +1 -0
- package/dist/tls.js +22 -0
- package/dist/tls.js.map +1 -0
- package/package.json +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Knowz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.array.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../types/dist/index.d.ts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/typealiases.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/index.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/zoderror.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseutil.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/enumutil.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorutil.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/partialutil.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/standard-schema.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.d.cts","../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.d.cts","../src/contracts.ts","../src/chat.ts","../../../node_modules/.pnpm/@types+retry@0.12.2/node_modules/@types/retry/index.d.ts","../../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.d.ts","../src/tls.ts","../src/resources/schemas.ts","../src/resources/auth.ts","../src/resources/paging.ts","../src/resources/knowledge.ts","../src/resources/vaults.ts","../src/resources/search.ts","../src/resources/ask.ts","../src/resources/index.ts","../src/resources/extras.ts","../src/client.ts","../src/envelope.ts","../src/index.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/compatibility/disposable.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/compatibility/indexable.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/compatibility/index.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/globals.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/domexception.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/events.d.ts","../../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/header.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/readable.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/file.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/fetch.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/formdata.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/connector.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/client.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/errors.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/dispatcher.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/global-origin.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool-stats.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/pool.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/handlers.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-client.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-pool.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/mock-errors.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-handler.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/retry-agent.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/api.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/interceptors.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/util.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cookies.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/patch.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/websocket.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/eventsource.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/filereader.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/content-type.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/cache.d.ts","../../../node_modules/.pnpm/undici-types@6.21.0/node_modules/undici-types/index.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/fetch.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/navigator.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/web-globals/storage.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/assert.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/assert/strict.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/async_hooks.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/buffer.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/child_process.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/cluster.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/console.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/constants.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/crypto.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/dgram.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/dns.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/dns/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/domain.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/events.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/fs.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/fs/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/http.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/http2.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/https.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/inspector.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/inspector.generated.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/module.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/net.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/os.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/path.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/process.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/punycode.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/querystring.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/readline.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/readline/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/repl.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/sea.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/sqlite.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/stream.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/stream/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/stream/web.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/string_decoder.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/test.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/timers.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/timers/promises.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/tls.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/trace_events.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/tty.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/url.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/util.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/v8.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/vm.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/wasi.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/worker_threads.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/zlib.d.ts","../../../node_modules/.pnpm/@types+node@22.19.19/node_modules/@types/node/index.d.ts","../../../node_modules/.pnpm/@types+better-sqlite3@7.6.13/node_modules/@types/better-sqlite3/index.d.ts","../../../node_modules/.pnpm/pg-types@2.2.0/node_modules/pg-types/index.d.ts","../../../node_modules/.pnpm/pg-protocol@1.14.0/node_modules/pg-protocol/dist/messages.d.ts","../../../node_modules/.pnpm/pg-protocol@1.14.0/node_modules/pg-protocol/dist/serializer.d.ts","../../../node_modules/.pnpm/pg-protocol@1.14.0/node_modules/pg-protocol/dist/parser.d.ts","../../../node_modules/.pnpm/pg-protocol@1.14.0/node_modules/pg-protocol/dist/index.d.ts","../../../node_modules/.pnpm/@types+pg@8.20.0/node_modules/@types/pg/lib/type-overrides.d.ts","../../../node_modules/.pnpm/@types+pg@8.20.0/node_modules/@types/pg/index.d.ts","../../../../node_modules/@types/readable-stream/index.d.ts"],"fileIdsList":[[99,148,165,166,198],[99,145,146,148,165,166],[99,147,148,165,166],[148,165,166],[99,148,153,165,166,183],[99,148,149,154,159,165,166,168,180,191],[99,148,149,150,159,165,166,168],[99,148,165,166],[94,95,96,99,148,165,166],[99,148,151,165,166,192],[99,148,152,153,160,165,166,169],[99,148,153,165,166,180,188],[99,148,154,156,159,165,166,168],[99,147,148,155,165,166],[99,148,156,157,165,166],[99,148,158,159,165,166],[99,147,148,159,165,166],[99,148,159,160,161,165,166,180,191],[99,148,159,160,161,165,166,175,180,183],[99,141,148,156,159,162,165,166,168,180,191],[99,148,159,160,162,163,165,166,168,180,188,191],[99,148,162,164,165,166,180,188,191],[97,98,99,100,101,102,103,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197],[99,148,159,165,166],[99,148,165,166,167,191],[99,148,156,159,165,166,168,180],[99,148,165,166,169],[99,148,165,166,170],[99,147,148,165,166,171],[99,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197],[99,148,165,166,173],[99,148,165,166,174],[99,148,159,165,166,175,176],[99,148,165,166,175,177,192,194],[99,148,160,165,166],[99,148,159,165,166,180,181,183],[99,148,165,166,182,183],[99,148,165,166,180,181],[99,148,165,166,183],[99,148,165,166,184],[99,145,148,165,166,180,185,191],[99,148,159,165,166,186,187],[99,148,165,166,186,187],[99,148,153,165,166,168,180,188],[99,148,165,166,189],[99,148,165,166,168,190],[99,148,162,165,166,174,191],[99,148,153,165,166,192],[99,148,165,166,180,193],[99,148,165,166,167,194],[99,148,165,166,195],[99,141,148,165,166],[99,141,148,159,161,165,166,171,180,183,191,193,194,196],[99,148,165,166,180,197],[99,148,159,165,166,180,188,198,200,201,204,205,206],[99,148,165,166,206],[79,99,148,165,166],[99,148,165,166,198,201,202,203],[99,148,165,166,180,198,201],[99,113,117,148,165,166,191],[99,113,148,165,166,180,191],[99,108,148,165,166],[99,110,113,148,165,166,188,191],[99,148,165,166,168,188],[99,108,148,165,166,198],[99,110,113,148,165,166,168,191],[99,105,106,109,112,148,159,165,166,180,191],[99,113,120,148,165,166],[99,105,111,148,165,166],[99,113,134,135,148,165,166],[99,109,113,148,165,166,183,191,198],[99,134,148,165,166,198],[99,107,108,148,165,166,198],[99,113,148,165,166],[99,107,108,109,110,111,112,113,114,115,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,135,136,137,138,139,140,148,165,166],[99,113,128,148,165,166],[99,113,120,121,148,165,166],[99,111,113,121,122,148,165,166],[99,112,148,165,166],[99,105,108,113,148,165,166],[99,113,117,121,122,148,165,166],[99,117,148,165,166],[99,111,113,116,148,165,166,191],[99,105,110,113,120,148,165,166],[99,148,165,166,180],[99,108,113,134,148,165,166,196,198],[75,99,148,165,166],[66,67,99,148,165,166],[63,64,66,68,69,74,99,148,165,166],[64,66,99,148,165,166],[74,99,148,165,166],[66,99,148,165,166],[63,64,66,69,70,71,72,73,99,148,165,166],[63,64,65,99,148,165,166],[62,77,99,148,165,166],[62,76,77,78,80,81,89,90,99,148,165,166],[76,99,148,165,166],[62,77,78,81,84,89,90,91,92,99,148,165,166],[62,77,82,99,148,165,166],[76,77,82,84,99,148,165,166],[83,85,86,87,88,99,148,165,166],[62,76,77,82,84,99,148,165,166],[62,99,148,165,166],[62,76,77,82,99,148,165,166],[62,77,82,84,99,148,165,166],[99,148,165,166,180,198]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"d5bad27c2e2912fb0c6aa27d87e72abc6c9e89c82ce30eb4b5fbb13978895220","impliedFormat":99},{"version":"d3cfde44f8089768ebb08098c96d01ca260b88bccf238d55eee93f1c620ff5a5","impliedFormat":1},{"version":"293eadad9dead44c6fd1db6de552663c33f215c55a1bfa2802a1bceed88ff0ec","impliedFormat":1},{"version":"833e92c058d033cde3f29a6c7603f517001d1ddd8020bc94d2067a3bc69b2a8e","impliedFormat":1},{"version":"08b2fae7b0f553ad9f79faec864b179fc58bc172e295a70943e8585dd85f600c","impliedFormat":1},{"version":"f12edf1672a94c578eca32216839604f1e1c16b40a1896198deabf99c882b340","impliedFormat":1},{"version":"e3498cf5e428e6c6b9e97bd88736f26d6cf147dedbfa5a8ad3ed8e05e059af8a","impliedFormat":1},{"version":"dba3f34531fd9b1b6e072928b6f885aa4d28dd6789cbd0e93563d43f4b62da53","impliedFormat":1},{"version":"f672c876c1a04a223cf2023b3d91e8a52bb1544c576b81bf64a8fec82be9969c","impliedFormat":1},{"version":"e4b03ddcf8563b1c0aee782a185286ed85a255ce8a30df8453aade2188bbc904","impliedFormat":1},{"version":"2329d90062487e1eaca87b5e06abcbbeeecf80a82f65f949fd332cfcf824b87b","impliedFormat":1},{"version":"25b3f581e12ede11e5739f57a86e8668fbc0124f6649506def306cad2c59d262","impliedFormat":1},{"version":"4fdb529707247a1a917a4626bfb6a293d52cd8ee57ccf03830ec91d39d606d6d","impliedFormat":1},{"version":"a9ebb67d6bbead6044b43714b50dcb77b8f7541ffe803046fdec1714c1eba206","impliedFormat":1},{"version":"5780b706cece027f0d4444fbb4e1af62dc51e19da7c3d3719f67b22b033859b9","impliedFormat":1},{"version":"315ce6b136dffa5302a3586f6266c18c6e164340cf2518643dd3a13d08c9f4fd","signature":"ccc6378f40783194fe04d454781522567c6ac963745652b8c3ad8c1f29b52f32","impliedFormat":99},{"version":"70251660f199693d6c674f43563d7f2f3851b0da7703f956200d6edb223e5116","signature":"c9344ea2eae002f4b3e49b20c8dda4be2a5a975a4a29603e0a59fbf117140188","impliedFormat":99},{"version":"510616459e6edd01acbce333fb256e06bdffdad43ca233a9090164bf8bb83912","impliedFormat":1},{"version":"3725da27619321470183eb7dd61190b139e5bcc4cf9366d6d828906a76e31742","impliedFormat":99},{"version":"952b9a265f26017f49e89495fa0ceb957bd8a6858e5d320b058f5736064169ae","signature":"51ec986b1fe6904f983bfdbee6397260ac873828abd71e412d7f8a628373124d","impliedFormat":99},{"version":"5bed7f6cca3f0b541c1ea6037e118fbfe27bdfdb0b650ac9683a6472620f722c","signature":"b764b862381328449a9578d1adf48f1b56b28b76c61fb61823d06f15246f2bab","impliedFormat":99},{"version":"e1d1f22eac32e5d3ee4f90f19feac042e74f021c4f6b17afe5fd2fd1ffe3cbc0","signature":"edc6d242a73d83cb2931dcab1bb9c070215d4c69215da314823ea7f57827ac30","impliedFormat":99},{"version":"850198ef506c62030630d89ced286fe2aad33bb81dfe023c20ddd9041a8b95ac","signature":"91401943f0b26da132deec9f18541cf955564cc9cf15d264b39d6c5aeb271459","impliedFormat":99},{"version":"0737abd7164bced9e9e79f80fa65ad15378c936ea9408cb755d43aa2eb9335eb","signature":"af3b5a52d32715c6ce0299809f046de12292c98c6f09aa8fbae85da920e453a8","impliedFormat":99},{"version":"11a57c1e783f4abbde3ffb533e9c4109b589fd5833abf7a6aacf124509be088f","signature":"2b92859cfc8fdfdcd0fa1491eaa317fd128bcefc4ab45416a00a768287589256","impliedFormat":99},{"version":"65227e8ece0795c81860518d1e8faf4ecdb44accbb9ee0525c4130c4ef90eace","signature":"895a9b8add7fbbb34e4fb241c99b2511bde3173453275477c7a26312a660eb1c","impliedFormat":99},{"version":"521d8cd524e42e3d438f5a77865232575e341096975a43f95edf6e8fd83be46c","signature":"a5ef73e0431169021c1c13c9fc36ab26fc19ef27911d17478fe9a3e95b38bb49","impliedFormat":99},{"version":"a4db76c00c8c1611ee72072605a09f7aeef8f3f106055b7129880d0c686321df","impliedFormat":99},{"version":"28e7210b64e9c7a8442528f6ce4deaf8ee16859bbb79894089e9d0dc125ce09e","signature":"0d808b8a416b6e80c5a8c80bd49d46ec4df63c737edc222f61ade533f5d1c9d2","impliedFormat":99},{"version":"27a432eafd1ec41e000b85fed61c28fa4cf49b056269decf13057a689a897c0e","signature":"37e4f3fc8e57bf9f5754cc0e9f4ba939aa0f426f0181d985666d172baf6f039d","impliedFormat":99},{"version":"941e09c82dc88f4d0efc6ef3c8793e1ab6679699656647746918836b8d2e78e3","signature":"5e19f5fb3c8b9dd47293c9b074d90ac572a35ecb5d4b3806b81389d08e502f1d","impliedFormat":99},{"version":"aece87b7d0543f7ee2e0b6a230e376786ebf78f2efdbb36d996da3df6750b3df","signature":"55eb495ee63f9362d0a631be73e0595cc8131e5d4e0e2ca515be048e4801c815","impliedFormat":99},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"b52476feb4a0cbcb25e5931b930fc73cb6643fb1a5060bf8a3dda0eeae5b4b68","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"58647d85d0f722a1ce9de50955df60a7489f0593bf1a7015521efe901c06d770","impliedFormat":1},{"version":"73b5fa37db36eeac90c4d752e39586f1b57187400c4f5280fd05f16437287a45","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6f137d651076822d4fe884287e68fd61785a0d3d1fdb250a5059b691fa897db","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"bceb58df66ab8fb00170df20cd813978c5ab84be1d285710c4eb005d8e9d8efb","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"80523c00b8544a2000ae0143e4a90a00b47f99823eb7926c1e03c494216fc363","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"746911b62b329587939560deb5c036aca48aece03147b021fa680223255d5183","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c8d3e5a18ba35629954e48c4cc8f11dc88224650067a172685c736b27a34a4dc","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"2b55d426ff2b9087485e52ac4bc7cfafe1dc420fc76dad926cd46526567c501a","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"358765d5ea8afd285d4fd1532e78b88273f18cb3f87403a9b16fef61ac9fdcfe","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1},{"version":"c2a6a737189ced24ffe0634e9239b087e4c26378d0490f95141b9b9b042b746c","impliedFormat":1},{"version":"f60e3e3060207ac982da13363181fd7ee4beecc19a7c569f0d6bb034331066c2","impliedFormat":1},{"version":"17230b34bb564a3a2e36f9d3985372ccab4ad1722df2c43f7c5c2b553f68e5db","impliedFormat":1},{"version":"dcb41cc4b671f5f85d3754e68dfde7824686a8adbb4c690cb259c1501cb868e1","impliedFormat":1},{"version":"21ac4cf3f8d8c6e1201cb31f600be708c9a37867fc5c73b7ccf80560fae591c8","impliedFormat":1},{"version":"0dfe35191a04e8f9dc7caeb9f52f2ee07402736563d12cbccd15fb5f31ac877f","impliedFormat":1},{"version":"798367363a3274220cbed839b883fe2f52ba7197b25e8cb2ac59c1e1fd8af6b7","impliedFormat":1},{"version":"2636a309ed87d6876728d9aca846a76b372cf2a21a4fdf9940a82a2dd86687d0","impliedFormat":1},{"version":"82428329db2b05aba6784395a429504ebca24f5d4b9506f779b964cf8c0fd58e","affectsGlobalScope":true,"impliedFormat":1}],"root":[77,78,[81,93]],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":199,"noImplicitOverride":true,"noUncheckedIndexedAccess":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"tsBuildInfoFile":"./.tsbuildinfo","verbatimModuleSyntax":false},"referencedMap":[[199,1],[145,2],[146,2],[147,3],[99,4],[148,5],[149,6],[150,7],[94,8],[97,9],[95,8],[96,8],[151,10],[152,11],[153,12],[154,13],[155,14],[156,15],[157,15],[158,16],[159,17],[160,18],[161,19],[100,8],[98,8],[162,20],[163,21],[164,22],[198,23],[165,24],[166,8],[167,25],[168,26],[169,27],[170,28],[171,29],[172,30],[173,31],[174,32],[175,33],[176,33],[177,34],[178,8],[179,35],[180,36],[182,37],[181,38],[183,39],[184,40],[185,41],[186,42],[187,43],[188,44],[189,45],[190,46],[191,47],[192,48],[193,49],[194,50],[195,51],[101,8],[102,8],[103,8],[142,52],[143,8],[144,8],[196,53],[197,54],[206,55],[205,56],[79,8],[104,8],[80,57],[204,58],[201,1],[203,59],[202,1],[200,8],[60,8],[61,8],[12,8],[11,8],[2,8],[13,8],[14,8],[15,8],[16,8],[17,8],[18,8],[19,8],[20,8],[3,8],[21,8],[22,8],[4,8],[23,8],[27,8],[24,8],[25,8],[26,8],[28,8],[29,8],[30,8],[5,8],[31,8],[32,8],[33,8],[34,8],[6,8],[38,8],[35,8],[36,8],[37,8],[39,8],[7,8],[40,8],[45,8],[46,8],[41,8],[42,8],[43,8],[44,8],[8,8],[50,8],[47,8],[48,8],[49,8],[51,8],[9,8],[52,8],[53,8],[54,8],[56,8],[55,8],[57,8],[58,8],[10,8],[59,8],[1,8],[120,60],[130,61],[119,60],[140,62],[111,63],[110,64],[139,1],[133,65],[138,66],[113,67],[127,68],[112,69],[136,70],[108,71],[107,1],[137,72],[109,73],[114,74],[115,8],[118,74],[105,8],[141,75],[131,76],[122,77],[123,78],[125,79],[121,80],[124,81],[134,1],[116,82],[117,83],[126,84],[106,85],[129,76],[128,74],[132,8],[135,86],[76,87],[68,88],[75,89],[70,8],[71,8],[69,90],[72,91],[63,8],[64,8],[65,87],[67,92],[73,8],[74,93],[66,94],[78,95],[91,96],[77,97],[92,97],[93,98],[88,99],[83,99],[90,100],[89,101],[85,102],[84,103],[82,97],[87,104],[86,105],[81,103],[62,8],[207,106]],"latestChangedDtsFile":"./envelope.d.ts","version":"5.9.3"}
|
package/dist/chat.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ChatEvent, ChatTurnRequest } from '@knowzai/types';
|
|
2
|
+
import type { CoreClient } from './contracts.js';
|
|
3
|
+
/**
|
|
4
|
+
* Parse a `text/event-stream` body into typed ChatEvents. Tolerant of partial
|
|
5
|
+
* chunks across reads, heartbeat (`:`) lines, and unknown event types.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseSseStream(body: ReadableStream<Uint8Array>): AsyncGenerator<ChatEvent>;
|
|
8
|
+
export declare class ChatApi {
|
|
9
|
+
private readonly core;
|
|
10
|
+
constructor(core: CoreClient);
|
|
11
|
+
/**
|
|
12
|
+
* Submit a turn to the agentic streaming endpoint and yield typed events
|
|
13
|
+
* (token/thinking/sources/done/…). Auth is carried by the standard headers;
|
|
14
|
+
* no handshake is needed for the turn itself (the handshake side-channel is
|
|
15
|
+
* only for the optional progress GET stream).
|
|
16
|
+
*/
|
|
17
|
+
streamTurn(req: ChatTurnRequest, opts?: {
|
|
18
|
+
signal?: AbortSignal;
|
|
19
|
+
}): AsyncGenerator<ChatEvent>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=chat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../src/chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA8DjD;;;GAGG;AACH,wBAAuB,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC,CAsCjG;AAgBD,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C;;;;;OAKG;IACI,UAAU,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,GAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAO,GAAG,cAAc,CAAC,SAAS,CAAC;CAUxG"}
|
package/dist/chat.js
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// Event types the backend emits over `POST /api/v1/knowledge/chat/stream`. The
|
|
2
|
+
// discriminator is the SSE `event:` field; the protocol is additive so unknown
|
|
3
|
+
// types are skipped. Source: ChatStreamEndpoints.cs + IChatPipeline.cs.
|
|
4
|
+
const KNOWN_EVENTS = new Set([
|
|
5
|
+
'ping',
|
|
6
|
+
'status',
|
|
7
|
+
'token',
|
|
8
|
+
'thinking',
|
|
9
|
+
'agent_handoff',
|
|
10
|
+
'sources',
|
|
11
|
+
'metadata',
|
|
12
|
+
'media_references',
|
|
13
|
+
'debug',
|
|
14
|
+
'coverage_warning',
|
|
15
|
+
'rate_limit_warning',
|
|
16
|
+
'done',
|
|
17
|
+
'error',
|
|
18
|
+
'cached',
|
|
19
|
+
]);
|
|
20
|
+
// Friendly mode -> backend `ChatKnowledgeRequest.Mode` enum int (web modeMap).
|
|
21
|
+
const MODE_MAP = {
|
|
22
|
+
Standard: 0,
|
|
23
|
+
QuickAnswer: 1,
|
|
24
|
+
DeepResearch: 2,
|
|
25
|
+
Agentic: 3,
|
|
26
|
+
Auto: 4,
|
|
27
|
+
Balanced: 5,
|
|
28
|
+
Express: 6,
|
|
29
|
+
GraphResearch: 8,
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Parse one SSE block. The event TYPE comes from the `event:` field and the
|
|
33
|
+
* payload from the `data:` field(s) — the backend writes `event: <type>\n
|
|
34
|
+
* data: <json>\n\n` and the data JSON has no `type`. We synthesize the typed
|
|
35
|
+
* union as `{ type, ...payload }`.
|
|
36
|
+
*/
|
|
37
|
+
function parseEventBlock(raw) {
|
|
38
|
+
let eventType;
|
|
39
|
+
const dataLines = [];
|
|
40
|
+
for (const line of raw.split('\n')) {
|
|
41
|
+
const l = line.replace(/\r$/, '');
|
|
42
|
+
if (!l || l.startsWith(':'))
|
|
43
|
+
continue; // blank or comment/heartbeat
|
|
44
|
+
if (l.startsWith('event:'))
|
|
45
|
+
eventType = l.slice(6).trim();
|
|
46
|
+
else if (l.startsWith('data:'))
|
|
47
|
+
dataLines.push(l.slice(5).replace(/^ /, ''));
|
|
48
|
+
// id:/retry: ignored
|
|
49
|
+
}
|
|
50
|
+
if (!eventType || !KNOWN_EVENTS.has(eventType))
|
|
51
|
+
return undefined; // forward-compatible skip
|
|
52
|
+
let payload = {};
|
|
53
|
+
if (dataLines.length) {
|
|
54
|
+
try {
|
|
55
|
+
payload = JSON.parse(dataLines.join('\n'));
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
payload = {};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return { type: eventType, ...payload };
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Parse a `text/event-stream` body into typed ChatEvents. Tolerant of partial
|
|
65
|
+
* chunks across reads, heartbeat (`:`) lines, and unknown event types.
|
|
66
|
+
*/
|
|
67
|
+
export async function* parseSseStream(body) {
|
|
68
|
+
const reader = body.getReader();
|
|
69
|
+
const decoder = new TextDecoder();
|
|
70
|
+
let buf = '';
|
|
71
|
+
for (;;) {
|
|
72
|
+
const { done, value } = await reader.read();
|
|
73
|
+
if (done)
|
|
74
|
+
break;
|
|
75
|
+
buf += decoder.decode(value, { stream: true });
|
|
76
|
+
// SSE events may be framed with CRLF (`\r\n\r\n`, 4 bytes) or LF (`\n\n`,
|
|
77
|
+
// 2 bytes) — and a single stream can mix the two. Each iteration take
|
|
78
|
+
// whichever delimiter occurs first and advance past exactly its length, so
|
|
79
|
+
// a CRLF-framed stream is split correctly (else the buffer grows unbounded
|
|
80
|
+
// and the CLI chat hangs).
|
|
81
|
+
for (;;) {
|
|
82
|
+
const crlf = buf.indexOf('\r\n\r\n');
|
|
83
|
+
const lf = buf.indexOf('\n\n');
|
|
84
|
+
let idx;
|
|
85
|
+
let delimLen;
|
|
86
|
+
if (crlf >= 0 && (lf < 0 || crlf <= lf)) {
|
|
87
|
+
idx = crlf;
|
|
88
|
+
delimLen = 4;
|
|
89
|
+
}
|
|
90
|
+
else if (lf >= 0) {
|
|
91
|
+
idx = lf;
|
|
92
|
+
delimLen = 2;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
const block = buf.slice(0, idx);
|
|
98
|
+
buf = buf.slice(idx + delimLen);
|
|
99
|
+
const ev = parseEventBlock(block);
|
|
100
|
+
if (ev)
|
|
101
|
+
yield ev;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
buf += decoder.decode();
|
|
105
|
+
if (buf.trim()) {
|
|
106
|
+
const ev = parseEventBlock(buf);
|
|
107
|
+
if (ev)
|
|
108
|
+
yield ev;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/** Map a ChatTurnRequest to the backend `ChatKnowledgeRequest` wire shape. */
|
|
112
|
+
function toStreamBody(req) {
|
|
113
|
+
return {
|
|
114
|
+
message: req.message,
|
|
115
|
+
conversationId: req.conversationId,
|
|
116
|
+
vaultIds: req.vaultIds,
|
|
117
|
+
mode: req.mode ? MODE_MAP[req.mode] ?? MODE_MAP.Balanced : undefined,
|
|
118
|
+
personaId: req.personaId,
|
|
119
|
+
conversationHistory: req.history,
|
|
120
|
+
userTimezone: req.userTimezone,
|
|
121
|
+
verbose: req.verbose ?? false,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
export class ChatApi {
|
|
125
|
+
core;
|
|
126
|
+
constructor(core) {
|
|
127
|
+
this.core = core;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Submit a turn to the agentic streaming endpoint and yield typed events
|
|
131
|
+
* (token/thinking/sources/done/…). Auth is carried by the standard headers;
|
|
132
|
+
* no handshake is needed for the turn itself (the handshake side-channel is
|
|
133
|
+
* only for the optional progress GET stream).
|
|
134
|
+
*/
|
|
135
|
+
async *streamTurn(req, opts = {}) {
|
|
136
|
+
const res = await this.core.stream({
|
|
137
|
+
method: 'POST',
|
|
138
|
+
path: '/api/v1/knowledge/chat/stream',
|
|
139
|
+
body: toStreamBody(req),
|
|
140
|
+
signal: opts.signal,
|
|
141
|
+
});
|
|
142
|
+
if (!res.body)
|
|
143
|
+
return;
|
|
144
|
+
yield* parseSseStream(res.body);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=chat.js.map
|
package/dist/chat.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../src/chat.ts"],"names":[],"mappings":"AAGA,+EAA+E;AAC/E,+EAA+E;AAC/E,wEAAwE;AACxE,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,MAAM;IACN,QAAQ;IACR,OAAO;IACP,UAAU;IACV,eAAe;IACf,SAAS;IACT,UAAU;IACV,kBAAkB;IAClB,OAAO;IACP,kBAAkB;IAClB,oBAAoB;IACpB,MAAM;IACN,OAAO;IACP,QAAQ;CACT,CAAC,CAAC;AAEH,+EAA+E;AAC/E,MAAM,QAAQ,GAA2B;IACvC,QAAQ,EAAE,CAAC;IACX,WAAW,EAAE,CAAC;IACd,YAAY,EAAE,CAAC;IACf,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;IACV,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF;;;;;GAKG;AACH,SAAS,eAAe,CAAC,GAAW;IAClC,IAAI,SAA6B,CAAC;IAClC,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,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YAAE,MAAM,EAAE,CAAC;IACnB,CAAC;AACH,CAAC;AAED,8EAA8E;AAC9E,SAAS,YAAY,CAAC,GAAoB;IACxC,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,cAAc,EAAE,GAAG,CAAC,cAAc;QAClC,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;QACpE,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,mBAAmB,EAAE,GAAG,CAAC,OAAO;QAChC,YAAY,EAAE,GAAG,CAAC,YAAY;QAC9B,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,KAAK;KAC9B,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,OAAO;IACW;IAA7B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD;;;;;OAKG;IACH,KAAK,CAAC,CAAC,UAAU,CAAC,GAAoB,EAAE,OAAiC,EAAE;QACzE,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;YACjC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,+BAA+B;YACrC,IAAI,EAAE,YAAY,CAAC,GAAG,CAAC;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,IAAI;YAAE,OAAO;QACtB,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type AuthHeader } from '@knowzai/types';
|
|
2
|
+
import { AuthApi, KnowledgeApi, VaultsApi, SearchApi, AskApi } from './resources/index.js';
|
|
3
|
+
import { EntitiesApi, TopicsApi, StatsApi, CommentsApi, VersionsApi, AmendApi } from './resources/extras.js';
|
|
4
|
+
import { ChatApi } from './chat.js';
|
|
5
|
+
import type { RequestSpec, StreamSpec } from './contracts.js';
|
|
6
|
+
export type { RequestSpec, StreamSpec, CoreClient } from './contracts.js';
|
|
7
|
+
export interface ApiClientOptions {
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
/** Injected by N3; undefined ⇒ anonymous. */
|
|
10
|
+
auth?: () => AuthHeader | undefined;
|
|
11
|
+
timeoutMs?: number;
|
|
12
|
+
retries?: number;
|
|
13
|
+
fetchImpl?: typeof fetch;
|
|
14
|
+
}
|
|
15
|
+
export interface KnowzApiClient {
|
|
16
|
+
request<T>(spec: RequestSpec<T>): Promise<T>;
|
|
17
|
+
stream(spec: StreamSpec): Promise<Response>;
|
|
18
|
+
readonly baseUrl: string;
|
|
19
|
+
readonly auth: AuthApi;
|
|
20
|
+
readonly knowledge: KnowledgeApi;
|
|
21
|
+
readonly vaults: VaultsApi;
|
|
22
|
+
readonly search: SearchApi;
|
|
23
|
+
readonly ask: AskApi;
|
|
24
|
+
readonly chat: ChatApi;
|
|
25
|
+
readonly entities: EntitiesApi;
|
|
26
|
+
readonly topics: TopicsApi;
|
|
27
|
+
readonly stats: StatsApi;
|
|
28
|
+
readonly comments: CommentsApi;
|
|
29
|
+
readonly versions: VersionsApi;
|
|
30
|
+
readonly amend: AmendApi;
|
|
31
|
+
}
|
|
32
|
+
export declare function createApiClient(opts: ApiClientOptions): KnowzApiClient;
|
|
33
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AA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C;IAC/B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;CAC1B;AA4BD,wBAAgB,eAAe,CAAC,IAAI,EAAE,gBAAgB,GAAG,cAAc,CA8JtE"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import pRetry, { AbortError } from 'p-retry';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ApiError } from '@knowzai/types';
|
|
4
|
+
import { assertTlsAllowed } from './tls.js';
|
|
5
|
+
import { AuthApi, KnowledgeApi, VaultsApi, SearchApi, AskApi } from './resources/index.js';
|
|
6
|
+
import { EntitiesApi, TopicsApi, StatsApi, CommentsApi, VersionsApi, AmendApi, } from './resources/extras.js';
|
|
7
|
+
import { ChatApi } from './chat.js';
|
|
8
|
+
/** Envelope shape with an opaque `data` — validated before the typed payload. */
|
|
9
|
+
const BaseEnvelopeSchema = z.object({
|
|
10
|
+
success: z.boolean(),
|
|
11
|
+
data: z.unknown(),
|
|
12
|
+
// `message` is not always present at the envelope top level — some endpoints
|
|
13
|
+
// (e.g. /auth/validate-key) nest it inside `data` or omit it. Keep it optional
|
|
14
|
+
// so a valid response isn't rejected as "Malformed".
|
|
15
|
+
message: z.string().optional(),
|
|
16
|
+
errors: z.array(z.string()).nullable(),
|
|
17
|
+
timestamp: z.string(),
|
|
18
|
+
});
|
|
19
|
+
const RETRYABLE_STATUS = (s) => s >= 500 || s === 429;
|
|
20
|
+
function buildUrl(baseUrl, path, query) {
|
|
21
|
+
const url = new URL(path.replace(/^\//, ''), baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`);
|
|
22
|
+
if (query) {
|
|
23
|
+
for (const [key, value] of Object.entries(query)) {
|
|
24
|
+
if (value === undefined || value === null)
|
|
25
|
+
continue;
|
|
26
|
+
if (Array.isArray(value)) {
|
|
27
|
+
for (const v of value)
|
|
28
|
+
url.searchParams.append(key, String(v));
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
url.searchParams.set(key, String(value));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return url.toString();
|
|
36
|
+
}
|
|
37
|
+
function messagesFromBody(body, status) {
|
|
38
|
+
if (body && typeof body === 'object') {
|
|
39
|
+
const b = body;
|
|
40
|
+
if (Array.isArray(b.errors) && b.errors.length)
|
|
41
|
+
return b.errors.map(String);
|
|
42
|
+
if (typeof b.message === 'string' && b.message)
|
|
43
|
+
return [b.message];
|
|
44
|
+
}
|
|
45
|
+
return [`Request failed with status ${status}`];
|
|
46
|
+
}
|
|
47
|
+
export function createApiClient(opts) {
|
|
48
|
+
assertTlsAllowed(opts.baseUrl);
|
|
49
|
+
const fetchImpl = opts.fetchImpl ?? globalThis.fetch;
|
|
50
|
+
const defaultTimeout = opts.timeoutMs ?? 30_000;
|
|
51
|
+
const retries = opts.retries ?? 3;
|
|
52
|
+
function headersFor(spec) {
|
|
53
|
+
const headers = new Headers();
|
|
54
|
+
if (spec.hasBody)
|
|
55
|
+
headers.set('Content-Type', 'application/json');
|
|
56
|
+
headers.set('Accept', 'application/json');
|
|
57
|
+
if (!spec.anonymous) {
|
|
58
|
+
const a = opts.auth?.();
|
|
59
|
+
if (a)
|
|
60
|
+
headers.set(a.header, a.value);
|
|
61
|
+
}
|
|
62
|
+
return headers;
|
|
63
|
+
}
|
|
64
|
+
async function doFetch(method, url, headers, body, timeoutMs, externalSignal) {
|
|
65
|
+
const controller = new AbortController();
|
|
66
|
+
const onAbort = () => controller.abort();
|
|
67
|
+
if (externalSignal) {
|
|
68
|
+
if (externalSignal.aborted)
|
|
69
|
+
controller.abort();
|
|
70
|
+
else
|
|
71
|
+
externalSignal.addEventListener('abort', onAbort, { once: true });
|
|
72
|
+
}
|
|
73
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
74
|
+
try {
|
|
75
|
+
return await fetchImpl(url, {
|
|
76
|
+
method,
|
|
77
|
+
headers,
|
|
78
|
+
body: body === undefined ? undefined : JSON.stringify(body),
|
|
79
|
+
signal: controller.signal,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
clearTimeout(timer);
|
|
84
|
+
if (externalSignal)
|
|
85
|
+
externalSignal.removeEventListener('abort', onAbort);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async function request(spec) {
|
|
89
|
+
const url = buildUrl(opts.baseUrl, spec.path, spec.query);
|
|
90
|
+
const headers = headersFor({ anonymous: spec.anonymous, hasBody: spec.body !== undefined });
|
|
91
|
+
const timeoutMs = spec.timeoutMs ?? defaultTimeout;
|
|
92
|
+
const run = async () => {
|
|
93
|
+
let res;
|
|
94
|
+
try {
|
|
95
|
+
res = await doFetch(spec.method, url, headers, spec.body, timeoutMs);
|
|
96
|
+
}
|
|
97
|
+
catch (e) {
|
|
98
|
+
// Timeout/abort → do not retry. Other network errors → retryable (rethrow).
|
|
99
|
+
if (e instanceof Error && e.name === 'AbortError') {
|
|
100
|
+
throw new AbortError(new ApiError(0, ['Request timed out'], { code: 'timeout', cause: e }));
|
|
101
|
+
}
|
|
102
|
+
throw e; // p-retry retries network failures
|
|
103
|
+
}
|
|
104
|
+
if (RETRYABLE_STATUS(res.status)) {
|
|
105
|
+
// Thrown ApiError is retried by p-retry; on exhaustion it rejects with
|
|
106
|
+
// this error so the upstream status (e.g. 503/429) is preserved.
|
|
107
|
+
throw new ApiError(res.status, [`Upstream returned status ${res.status}`], {
|
|
108
|
+
code: 'retryable',
|
|
109
|
+
requestId: res.headers.get('x-request-id') ?? undefined,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
// 204 / empty body
|
|
113
|
+
if (res.status === 204)
|
|
114
|
+
return spec.schema.parse(undefined);
|
|
115
|
+
const text = await res.text();
|
|
116
|
+
const json = text ? safeJson(text) : undefined;
|
|
117
|
+
if (!res.ok) {
|
|
118
|
+
throw new AbortError(new ApiError(res.status, messagesFromBody(json, res.status), {
|
|
119
|
+
requestId: res.headers.get('x-request-id') ?? undefined,
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
// 1) Validate the envelope shape with an opaque `data`.
|
|
123
|
+
const base = BaseEnvelopeSchema.safeParse(json);
|
|
124
|
+
if (!base.success) {
|
|
125
|
+
const issue = base.error.issues[0];
|
|
126
|
+
throw new AbortError(new ApiError(res.status, [
|
|
127
|
+
`Malformed API response${issue ? ` ('${issue.path.join('.')}': ${issue.message})` : ''}`,
|
|
128
|
+
]));
|
|
129
|
+
}
|
|
130
|
+
// 2) A success:false envelope is an error regardless of HTTP status.
|
|
131
|
+
if (!base.data.success) {
|
|
132
|
+
throw new AbortError(new ApiError(res.status, base.data.errors ?? [base.data.message || 'Request failed']));
|
|
133
|
+
}
|
|
134
|
+
// 3) Validate the typed payload.
|
|
135
|
+
const payload = spec.schema.safeParse(base.data.data);
|
|
136
|
+
if (!payload.success) {
|
|
137
|
+
const issue = payload.error.issues[0];
|
|
138
|
+
throw new AbortError(new ApiError(res.status, [
|
|
139
|
+
`Malformed API response data${issue ? ` ('${issue.path.join('.')}': ${issue.message})` : ''}`,
|
|
140
|
+
]));
|
|
141
|
+
}
|
|
142
|
+
return payload.data;
|
|
143
|
+
};
|
|
144
|
+
try {
|
|
145
|
+
return await pRetry(run, { retries, minTimeout: 1000, factor: 2 });
|
|
146
|
+
}
|
|
147
|
+
catch (e) {
|
|
148
|
+
if (e instanceof ApiError)
|
|
149
|
+
throw e;
|
|
150
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
151
|
+
throw new ApiError(0, [msg], { code: 'transport', cause: e });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async function stream(spec) {
|
|
155
|
+
const url = buildUrl(opts.baseUrl, spec.path, spec.query);
|
|
156
|
+
const headers = headersFor({ anonymous: spec.anonymous, hasBody: spec.body !== undefined });
|
|
157
|
+
headers.set('Accept', 'text/event-stream');
|
|
158
|
+
// Long-lived: no body timeout; honors an external signal only.
|
|
159
|
+
const res = await fetchImpl(url, {
|
|
160
|
+
method: spec.method,
|
|
161
|
+
headers,
|
|
162
|
+
body: spec.body === undefined ? undefined : JSON.stringify(spec.body),
|
|
163
|
+
signal: spec.signal,
|
|
164
|
+
});
|
|
165
|
+
if (!res.ok) {
|
|
166
|
+
const text = await res.text().catch(() => '');
|
|
167
|
+
throw new ApiError(res.status, messagesFromBody(safeJson(text), res.status));
|
|
168
|
+
}
|
|
169
|
+
return res;
|
|
170
|
+
}
|
|
171
|
+
const core = { request, stream };
|
|
172
|
+
return {
|
|
173
|
+
request,
|
|
174
|
+
stream,
|
|
175
|
+
baseUrl: opts.baseUrl,
|
|
176
|
+
auth: new AuthApi(core),
|
|
177
|
+
knowledge: new KnowledgeApi(core),
|
|
178
|
+
vaults: new VaultsApi(core),
|
|
179
|
+
search: new SearchApi(core),
|
|
180
|
+
ask: new AskApi(core),
|
|
181
|
+
chat: new ChatApi(core),
|
|
182
|
+
entities: new EntitiesApi(core),
|
|
183
|
+
topics: new TopicsApi(core),
|
|
184
|
+
stats: new StatsApi(core),
|
|
185
|
+
comments: new CommentsApi(core),
|
|
186
|
+
versions: new VersionsApi(core),
|
|
187
|
+
amend: new AmendApi(core),
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function safeJson(text) {
|
|
191
|
+
try {
|
|
192
|
+
return JSON.parse(text);
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
return undefined;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE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EAAE,CAAC;IACjC,OAAO;QACL,OAAO;QACP,MAAM;QACN,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,IAAI,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;QACvB,SAAS,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC;QACjC,MAAM,EAAE,IAAI,SAAS,CAAC,IAAI,CAAC;QAC3B,MAAM,EAAE,IAAI,SAAS,CAAC,IAAI,CAAC;QAC3B,GAAG,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC;QACrB,IAAI,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;QACvB,QAAQ,EAAE,IAAI,WAAW,CAAC,IAAI,CAAC;QAC/B,MAAM,EAAE,IAAI,SAAS,CAAC,IAAI,CAAC;QAC3B,KAAK,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC;QACzB,QAAQ,EAAE,IAAI,WAAW,CAAC,IAAI,CAAC;QAC/B,QAAQ,EAAE,IAAI,WAAW,CAAC,IAAI,CAAC;QAC/B,KAAK,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC;KAC1B,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
export interface RequestSpec<T> {
|
|
3
|
+
method: string;
|
|
4
|
+
path: string;
|
|
5
|
+
query?: Record<string, unknown>;
|
|
6
|
+
body?: unknown;
|
|
7
|
+
schema: z.ZodType<T, z.ZodTypeDef, any>;
|
|
8
|
+
anonymous?: boolean;
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface StreamSpec {
|
|
12
|
+
method: string;
|
|
13
|
+
path: string;
|
|
14
|
+
query?: Record<string, unknown>;
|
|
15
|
+
body?: unknown;
|
|
16
|
+
anonymous?: boolean;
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
}
|
|
19
|
+
/** Minimal core surface the resource modules depend on. */
|
|
20
|
+
export interface CoreClient {
|
|
21
|
+
request<T>(spec: RequestSpec<T>): Promise<T>;
|
|
22
|
+
stream(spec: StreamSpec): Promise<Response>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;IAKf,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;IACxC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,2DAA2D;AAC3D,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC7C"}
|