@knowzai/indexer 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 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","../src/embedding.ts","../src/graph.ts","../../../node_modules/.pnpm/web-tree-sitter@0.25.10/node_modules/web-tree-sitter/web-tree-sitter.d.ts","../src/languages.ts","../../local-store/dist/types.d.ts","../../local-store/dist/hash.d.ts","../../local-store/dist/sqlite-store.d.ts","../../local-store/dist/postgres-store.d.ts","../../local-store/dist/open.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","../../api-client/dist/contracts.d.ts","../../api-client/dist/resources/auth.d.ts","../../api-client/dist/resources/knowledge.d.ts","../../api-client/dist/resources/vaults.d.ts","../../api-client/dist/resources/search.d.ts","../../api-client/dist/resources/ask.d.ts","../../api-client/dist/resources/index.d.ts","../../api-client/dist/resources/extras.d.ts","../../api-client/dist/chat.d.ts","../../api-client/dist/client.d.ts","../../api-client/dist/envelope.d.ts","../../api-client/dist/tls.d.ts","../../api-client/dist/resources/paging.d.ts","../../api-client/dist/index.d.ts","../../local-store/dist/sync-engine.d.ts","../../local-store/dist/pg-provision.d.ts","../../local-store/dist/index.d.ts","../src/indexer.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":[[110,159,176,177,209],[110,156,157,159,176,177],[110,158,159,176,177],[159,176,177],[110,159,164,176,177,194],[110,159,160,165,170,176,177,179,191,202],[110,159,160,161,170,176,177,179],[110,159,176,177],[105,106,107,110,159,176,177],[110,159,162,176,177,203],[110,159,163,164,171,176,177,180],[110,159,164,176,177,191,199],[110,159,165,167,170,176,177,179],[110,158,159,166,176,177],[110,159,167,168,176,177],[110,159,169,170,176,177],[110,158,159,170,176,177],[110,159,170,171,172,176,177,191,202],[110,159,170,171,172,176,177,186,191,194],[110,152,159,167,170,173,176,177,179,191,202],[110,159,170,171,173,174,176,177,179,191,199,202],[110,159,173,175,176,177,191,199,202],[108,109,110,111,112,113,114,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,198,199,200,201,202,203,204,205,206,207,208],[110,159,170,176,177],[110,159,176,177,178,202],[110,159,167,170,176,177,179,191],[110,159,176,177,180],[110,159,176,177,181],[110,158,159,176,177,182],[110,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,198,199,200,201,202,203,204,205,206,207,208],[110,159,176,177,184],[110,159,176,177,185],[110,159,170,176,177,186,187],[110,159,176,177,186,188,203,205],[110,159,171,176,177],[110,159,170,176,177,191,192,194],[110,159,176,177,193,194],[110,159,176,177,191,192],[110,159,176,177,194],[110,159,176,177,195],[110,156,159,176,177,191,196,202],[110,159,170,176,177,197,198],[110,159,176,177,197,198],[110,159,164,176,177,179,191,199],[110,159,176,177,200],[110,159,176,177,179,201],[110,159,173,176,177,185,202],[110,159,164,176,177,203],[110,159,176,177,191,204],[110,159,176,177,178,205],[110,159,176,177,206],[110,152,159,176,177],[110,152,159,170,172,176,177,182,191,194,202,204,205,207],[110,159,176,177,191,208],[110,159,170,176,177,191,199,209,211,212,215,216,217],[110,159,176,177,217],[110,159,176,177,209,212,213,214],[110,159,176,177,191,209,212],[110,124,128,159,176,177,202],[110,124,159,176,177,191,202],[110,119,159,176,177],[110,121,124,159,176,177,199,202],[110,159,176,177,179,199],[110,119,159,176,177,209],[110,121,124,159,176,177,179,202],[110,116,117,120,123,159,170,176,177,191,202],[110,124,131,159,176,177],[110,116,122,159,176,177],[110,124,145,146,159,176,177],[110,120,124,159,176,177,194,202,209],[110,145,159,176,177,209],[110,118,119,159,176,177,209],[110,124,159,176,177],[110,118,119,120,121,122,123,124,125,126,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,146,147,148,149,150,151,159,176,177],[110,124,139,159,176,177],[110,124,131,132,159,176,177],[110,122,124,132,133,159,176,177],[110,123,159,176,177],[110,116,119,124,159,176,177],[110,124,128,132,133,159,176,177],[110,128,159,176,177],[110,122,124,127,159,176,177,202],[110,116,121,124,131,159,176,177],[110,159,176,177,191],[110,119,124,145,159,176,177,207,209],[84,110,159,176,177],[75,76,110,159,176,177],[72,73,75,77,78,83,110,159,176,177],[73,75,110,159,176,177],[83,110,159,176,177],[75,110,159,176,177],[72,73,75,78,79,80,81,82,110,159,176,177],[72,73,74,110,159,176,177],[71,86,110,159,176,177],[71,86,92,93,94,110,159,176,177],[85,110,159,176,177],[71,86,92,93,94,95,96,97,98,110,159,176,177],[85,86,110,159,176,177],[87,88,89,90,91,110,159,176,177],[71,110,159,176,177],[62,63,65,103,110,159,176,177],[62,63,64,65,102,110,159,164,171,176,177,181],[64,110,159,176,177,178,181],[66,67,68,69,70,100,101,110,159,176,177],[66,110,159,176,177],[66,99,110,159,176,177],[110,159,176,177,191,209]],"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":"a5009c7bce63f3dad4dd77a1d8f1c1b6f219662b22c5fb5d1bafa6a335f81690","signature":"24d72d992a84f1341ffbb457e2eb2475e0b5cefa7fba3a1ba96a5b035560fb18","impliedFormat":99},{"version":"1ff29c562373288767a3b5db305fd1a585a5dc432fedca99b331f7a4438423e3","signature":"b60470c03fe320e267a068367cbdf5cd4db354c41248db1db10b8d70bb6c548f","impliedFormat":99},{"version":"c6118028f0e636f849e79fb6276603b6d5a19092f67ab46b570a2345d1103db8","impliedFormat":99},{"version":"2e606c1028f1ed750181fcb78ed69198c6ca1c1aeb406e5448d3f66d750441d1","signature":"35002f4cc1194c483a59cb72ace39d912dd37b54e9a7afbec026a324f9fb7cdf","impliedFormat":99},{"version":"fd252511557750a88b44b9eb7ce442ce592d93e51fa138bae149c2b1d5e20b8f","impliedFormat":99},{"version":"190efd7de11797af70ea812f61e149bae56cc0dce3f790e2704dcccccf1fe1b0","impliedFormat":99},{"version":"6e88ba1c2081a7cdb28f02be72a529ebaef6c780cc51a73c757cc05be5688df6","impliedFormat":99},{"version":"d750ff0195a600fddfad9aabddd5d9f3b2cef5e2a8a7f54fa8d3808f180b6866","impliedFormat":99},{"version":"49f27d70f572a6121a9528954e2422924d043ef82f1eb093e1afb6dfbbc31145","impliedFormat":99},{"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":"ccc6378f40783194fe04d454781522567c6ac963745652b8c3ad8c1f29b52f32","impliedFormat":99},{"version":"edc6d242a73d83cb2931dcab1bb9c070215d4c69215da314823ea7f57827ac30","impliedFormat":99},{"version":"af3b5a52d32715c6ce0299809f046de12292c98c6f09aa8fbae85da920e453a8","impliedFormat":99},{"version":"2b92859cfc8fdfdcd0fa1491eaa317fd128bcefc4ab45416a00a768287589256","impliedFormat":99},{"version":"895a9b8add7fbbb34e4fb241c99b2511bde3173453275477c7a26312a660eb1c","impliedFormat":99},{"version":"a5ef73e0431169021c1c13c9fc36ab26fc19ef27911d17478fe9a3e95b38bb49","impliedFormat":99},{"version":"a4db76c00c8c1611ee72072605a09f7aeef8f3f106055b7129880d0c686321df","impliedFormat":99},{"version":"0d808b8a416b6e80c5a8c80bd49d46ec4df63c737edc222f61ade533f5d1c9d2","impliedFormat":99},{"version":"c9344ea2eae002f4b3e49b20c8dda4be2a5a975a4a29603e0a59fbf117140188","impliedFormat":99},{"version":"37e4f3fc8e57bf9f5754cc0e9f4ba939aa0f426f0181d985666d172baf6f039d","impliedFormat":99},{"version":"5e19f5fb3c8b9dd47293c9b074d90ac572a35ecb5d4b3806b81389d08e502f1d","impliedFormat":99},{"version":"51ec986b1fe6904f983bfdbee6397260ac873828abd71e412d7f8a628373124d","impliedFormat":99},{"version":"91401943f0b26da132deec9f18541cf955564cc9cf15d264b39d6c5aeb271459","impliedFormat":99},{"version":"55eb495ee63f9362d0a631be73e0595cc8131e5d4e0e2ca515be048e4801c815","impliedFormat":99},{"version":"7c4961099846f3e6b3bbc64764c21e43e180c3d6f1331c9c539ba3700cee4b5d","impliedFormat":99},{"version":"e8d720c42f968ed0d3d0fd3203b250b6a17637fe79791b1e4834311e09eca2d2","impliedFormat":99},{"version":"de2e92eaa497cd97727b1970799a3abd2011613648a90b6ab398c4ceea3e4230","impliedFormat":99},{"version":"196e718680b3561eb6cbf8bb5b0fcebc025b678a25cec8d496d7e9985de2329c","signature":"88e668bf45dc622d05b3d22567c2202bcb5009e6fca75596f93ff2f8f0209cf3","impliedFormat":99},{"version":"4c3abb6e8a943562d2ade4d21ed5eb5f153118bdf692dab8fdc7f40120dd6e1a","signature":"66f726fd800a05e4c356117e37bfb363e1591e690b54a7279372888a3583350a","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":[62,63,65,103,104],"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":[[210,1],[156,2],[157,2],[158,3],[110,4],[159,5],[160,6],[161,7],[105,8],[108,9],[106,8],[107,8],[162,10],[163,11],[164,12],[165,13],[166,14],[167,15],[168,15],[169,16],[170,17],[171,18],[172,19],[111,8],[109,8],[173,20],[174,21],[175,22],[209,23],[176,24],[177,8],[178,25],[179,26],[180,27],[181,28],[182,29],[183,30],[184,31],[185,32],[186,33],[187,33],[188,34],[189,8],[190,35],[191,36],[193,37],[192,38],[194,39],[195,40],[196,41],[197,42],[198,43],[199,44],[200,45],[201,46],[202,47],[203,48],[204,49],[205,50],[206,51],[112,8],[113,8],[114,8],[153,52],[154,8],[155,8],[207,53],[208,54],[217,55],[216,56],[115,8],[215,57],[212,1],[214,58],[213,1],[211,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],[131,59],[141,60],[130,59],[151,61],[122,62],[121,63],[150,1],[144,64],[149,65],[124,66],[138,67],[123,68],[147,69],[119,70],[118,1],[148,71],[120,72],[125,73],[126,8],[129,73],[116,8],[152,74],[142,75],[133,76],[134,77],[136,78],[132,79],[135,80],[145,1],[127,81],[128,82],[137,83],[117,84],[140,75],[139,73],[143,8],[146,85],[64,8],[85,86],[77,87],[84,88],[79,8],[80,8],[78,89],[81,90],[72,8],[73,8],[74,86],[76,91],[82,8],[83,92],[75,93],[94,94],[95,95],[86,96],[96,96],[99,97],[91,94],[87,94],[93,98],[92,99],[88,94],[98,100],[90,94],[89,94],[97,8],[62,8],[63,8],[104,101],[103,102],[65,103],[67,8],[102,104],[70,105],[101,8],[69,105],[68,105],[100,106],[66,8],[71,8],[218,107]],"latestChangedDtsFile":"./indexer.d.ts","version":"5.9.3"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Local, dependency-free embedder: signed feature-hashing of word tokens AND
3
+ * character n-grams into a fixed-dim L2-normalized vector. The n-grams give
4
+ * sub-word/morphological overlap (e.g. `addNumbers` ~ `add numbers` ~ `adding`),
5
+ * which raises recall + relevance over plain word hashing — deterministic and
6
+ * offline, no model download.
7
+ *
8
+ * The `Embedder` interface + `createEmbedder` factory let a transformer/cloud
9
+ * embedder be plugged in later (Model-3 requires LOCAL embeddings — S-N8-3).
10
+ * Note: a transformer embedder (e.g. all-MiniLM, 384-dim) needs a model
11
+ * download (network) and would make `embed` async — tracked as a follow-up.
12
+ */
13
+ export declare const DEFAULT_EMBED_DIM = 384;
14
+ export interface Embedder {
15
+ readonly dim: number;
16
+ readonly id: string;
17
+ embed(text: string): Float32Array;
18
+ }
19
+ export declare class HashingEmbedder implements Embedder {
20
+ readonly dim: number;
21
+ readonly id: string;
22
+ constructor(dim?: number);
23
+ embed(text: string): Float32Array;
24
+ }
25
+ export declare const EMBEDDERS: readonly ["hashing", "transformer"];
26
+ export type EmbedderId = (typeof EMBEDDERS)[number];
27
+ export declare class EmbedderError extends Error {
28
+ constructor(message: string);
29
+ }
30
+ /**
31
+ * Build an embedder by name. `hashing` (default) is local + zero-dep.
32
+ * `transformer` is an opt-in path that requires `@huggingface/transformers`
33
+ * (not a base dependency) and network access for the model — and async
34
+ * inference, which the current sync `Embedder` interface does not yet support.
35
+ */
36
+ export declare function createEmbedder(spec?: EmbedderId | string, dim?: number): Embedder;
37
+ //# sourceMappingURL=embedding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../src/embedding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;CACnC;AA2BD,qBAAa,eAAgB,YAAW,QAAQ;IAElC,QAAQ,CAAC,GAAG,EAAE,MAAM;IADhC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;gBACC,GAAG,GAAE,MAA0B;IAIpD,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;CAmBlC;AAED,eAAO,MAAM,SAAS,qCAAsC,CAAC;AAC7D,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,GAAE,UAAU,GAAG,MAAkB,EAAE,GAAG,SAAoB,GAAG,QAAQ,CAQvG"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Local, dependency-free embedder: signed feature-hashing of word tokens AND
3
+ * character n-grams into a fixed-dim L2-normalized vector. The n-grams give
4
+ * sub-word/morphological overlap (e.g. `addNumbers` ~ `add numbers` ~ `adding`),
5
+ * which raises recall + relevance over plain word hashing — deterministic and
6
+ * offline, no model download.
7
+ *
8
+ * The `Embedder` interface + `createEmbedder` factory let a transformer/cloud
9
+ * embedder be plugged in later (Model-3 requires LOCAL embeddings — S-N8-3).
10
+ * Note: a transformer embedder (e.g. all-MiniLM, 384-dim) needs a model
11
+ * download (network) and would make `embed` async — tracked as a follow-up.
12
+ */
13
+ export const DEFAULT_EMBED_DIM = 384;
14
+ function hash32(s) {
15
+ let h = 2166136261 >>> 0; // FNV-1a
16
+ for (let i = 0; i < s.length; i++) {
17
+ h ^= s.charCodeAt(i);
18
+ h = Math.imul(h, 16777619) >>> 0;
19
+ }
20
+ return h >>> 0;
21
+ }
22
+ function words(text) {
23
+ return text
24
+ .toLowerCase()
25
+ .split(/[^a-z0-9_]+/)
26
+ .filter((t) => t.length > 1 && t.length < 40);
27
+ }
28
+ /** 3-grams over each word (padded) for sub-word overlap. */
29
+ function charNgrams(word, n = 3) {
30
+ const w = `#${word}#`;
31
+ if (w.length < n)
32
+ return [w];
33
+ const out = [];
34
+ for (let i = 0; i + n <= w.length; i++)
35
+ out.push(w.slice(i, i + n));
36
+ return out;
37
+ }
38
+ export class HashingEmbedder {
39
+ dim;
40
+ id;
41
+ constructor(dim = DEFAULT_EMBED_DIM) {
42
+ this.dim = dim;
43
+ this.id = `hashing-v2-${dim}`;
44
+ }
45
+ embed(text) {
46
+ const v = new Float32Array(this.dim);
47
+ const add = (token, weight) => {
48
+ const h = hash32(token);
49
+ const bucket = h % this.dim;
50
+ const sign = (h & 1) === 0 ? 1 : -1;
51
+ v[bucket] += sign * weight;
52
+ };
53
+ for (const w of words(text)) {
54
+ add(w, 1); // whole-word feature
55
+ if (w.length > 3)
56
+ for (const g of charNgrams(w))
57
+ add(g, 0.5); // sub-word features
58
+ }
59
+ // L2 normalize (so cosine/L2 distances are comparable; zero stays zero).
60
+ let norm = 0;
61
+ for (let i = 0; i < v.length; i++)
62
+ norm += v[i] * v[i];
63
+ norm = Math.sqrt(norm);
64
+ if (norm > 0)
65
+ for (let i = 0; i < v.length; i++)
66
+ v[i] /= norm;
67
+ return v;
68
+ }
69
+ }
70
+ export const EMBEDDERS = ['hashing', 'transformer'];
71
+ export class EmbedderError extends Error {
72
+ constructor(message) {
73
+ super(message);
74
+ this.name = 'EmbedderError';
75
+ }
76
+ }
77
+ /**
78
+ * Build an embedder by name. `hashing` (default) is local + zero-dep.
79
+ * `transformer` is an opt-in path that requires `@huggingface/transformers`
80
+ * (not a base dependency) and network access for the model — and async
81
+ * inference, which the current sync `Embedder` interface does not yet support.
82
+ */
83
+ export function createEmbedder(spec = 'hashing', dim = DEFAULT_EMBED_DIM) {
84
+ if (spec === 'hashing' || !spec)
85
+ return new HashingEmbedder(dim);
86
+ if (spec === 'transformer' || spec === 'minilm') {
87
+ throw new EmbedderError('The transformer embedder is not available in this build: install `@huggingface/transformers`, ensure network access to download the model, and use a future async-embedding build. Use the default `hashing` embedder for now.');
88
+ }
89
+ throw new EmbedderError(`Unknown embedder '${spec}'. Available: ${EMBEDDERS.join(', ')}.`);
90
+ }
91
+ //# sourceMappingURL=embedding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embedding.js","sourceRoot":"","sources":["../src/embedding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAQrC,SAAS,MAAM,CAAC,CAAS;IACvB,IAAI,CAAC,GAAG,UAAU,KAAK,CAAC,CAAC,CAAC,SAAS;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC;AAED,SAAS,KAAK,CAAC,IAAY;IACzB,OAAO,IAAI;SACR,WAAW,EAAE;SACb,KAAK,CAAC,aAAa,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,G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M,IAAI,aAAa,CACrB,gOAAgO,CACjO,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,aAAa,CAAC,qBAAqB,IAAI,iBAAiB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7F,CAAC"}
@@ -0,0 +1,41 @@
1
+ export type NodeKind = 'file' | 'function' | 'class' | 'method' | 'interface' | 'symbol';
2
+ export type EdgeKind = 'contains' | 'calls' | 'imports' | 'references';
3
+ export interface CodeNode {
4
+ id: string;
5
+ name: string;
6
+ kind: NodeKind;
7
+ file: string;
8
+ startByte?: number;
9
+ }
10
+ export interface CodeEdge {
11
+ from: string;
12
+ to: string;
13
+ kind: EdgeKind;
14
+ }
15
+ export declare class CodeGraph {
16
+ readonly nodes: Map<string, CodeNode>;
17
+ readonly edges: CodeEdge[];
18
+ addNode(n: CodeNode): void;
19
+ addEdge(e: CodeEdge): void;
20
+ merge(other: CodeGraph): void;
21
+ /** Resolve bare-name edge targets to node ids by unique name match. */
22
+ resolve(): void;
23
+ stats(): {
24
+ nodes: number;
25
+ edges: number;
26
+ byKind: Record<string, number>;
27
+ topByDegree: {
28
+ id: string;
29
+ degree: number;
30
+ }[];
31
+ };
32
+ toJSON(): {
33
+ nodes: CodeNode[];
34
+ edges: CodeEdge[];
35
+ };
36
+ static fromJSON(j: {
37
+ nodes: CodeNode[];
38
+ edges: CodeEdge[];
39
+ }): CodeGraph;
40
+ }
41
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;AACzF,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,CAAC;AAEvE,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE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 merge(other) {
12
+ for (const n of other.nodes.values())
13
+ this.addNode(n);
14
+ for (const e of other.edges)
15
+ this.edges.push(e);
16
+ }
17
+ /** Resolve bare-name edge targets to node ids by unique name match. */
18
+ resolve() {
19
+ const byName = new Map();
20
+ for (const n of this.nodes.values()) {
21
+ const arr = byName.get(n.name) ?? [];
22
+ arr.push(n.id);
23
+ byName.set(n.name, arr);
24
+ }
25
+ for (const e of this.edges) {
26
+ if (this.nodes.has(e.to))
27
+ continue;
28
+ const matches = byName.get(e.to);
29
+ if (matches && matches.length === 1)
30
+ e.to = matches[0];
31
+ }
32
+ }
33
+ stats() {
34
+ const byKind = {};
35
+ for (const n of this.nodes.values())
36
+ byKind[n.kind] = (byKind[n.kind] ?? 0) + 1;
37
+ const degree = new Map();
38
+ for (const e of this.edges) {
39
+ degree.set(e.from, (degree.get(e.from) ?? 0) + 1);
40
+ degree.set(e.to, (degree.get(e.to) ?? 0) + 1);
41
+ }
42
+ const topByDegree = [...degree.entries()]
43
+ .map(([id, d]) => ({ id, degree: d }))
44
+ .sort((a, b) => b.degree - a.degree)
45
+ .slice(0, 20);
46
+ return { nodes: this.nodes.size, edges: this.edges.length, byKind, topByDegree };
47
+ }
48
+ toJSON() {
49
+ return { nodes: [...this.nodes.values()], edges: this.edges };
50
+ }
51
+ static fromJSON(j) {
52
+ const g = new CodeGraph();
53
+ for (const n of j.nodes)
54
+ g.addNode(n);
55
+ for (const e of j.edges)
56
+ g.addEdge(e);
57
+ return g;
58
+ }
59
+ }
60
+ //# sourceMappingURL=graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.js","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAgBA,MAAM,OAAO,SAAS;IACX,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAC;IACpC,KAAK,GAAe,EAAE,CAAC;IAEhC,OAAO,CAAC,CAAW;QACjB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAA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AM,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IAChE,CAAC;IACD,MAAM,CAAC,QAAQ,CAAC,CAA2C;QACzD,MAAM,CAAC,GAAG,IAAI,SAAS,EAAE,CAAC;QAC1B,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK;YAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACtC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK;YAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACtC,OAAO,CAAC,CAAC;IACX,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ export declare const NODE_ID: "FEAT_KnowzLocalIndexer";
2
+ export { HashingEmbedder, DEFAULT_EMBED_DIM, createEmbedder, EmbedderError, EMBEDDERS, type Embedder, type EmbedderId, } from './embedding.js';
3
+ export { EXT_TO_GRAMMAR, grammarForPath, initParser, loadLanguage, parserFor, } from './languages.js';
4
+ export { CodeGraph, type CodeNode, type CodeEdge, type NodeKind, type EdgeKind } from './graph.js';
5
+ export { TreeSitterIndexer, stableItemId, relPath, isIndexableFile, inferKnowledgeType, type IndexerOptions, type FileIndexResult, type IndexReport, } from './indexer.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,EAAG,wBAAiC,CAAC;AAEzD,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,UAAU,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EACd,cAAc,EACd,UAAU,EACV,YAAY,EACZ,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnG,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACP,eAAe,EACf,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export const NODE_ID = 'FEAT_KnowzLocalIndexer';
2
+ export { HashingEmbedder, DEFAULT_EMBED_DIM, createEmbedder, EmbedderError, EMBEDDERS, } from './embedding.js';
3
+ export { EXT_TO_GRAMMAR, grammarForPath, initParser, loadLanguage, parserFor, } from './languages.js';
4
+ export { CodeGraph } from './graph.js';
5
+ export { TreeSitterIndexer, stableItemId, relPath, isIndexableFile, inferKnowledgeType, } from './indexer.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,wBAAiC,CAAC;AAEzD,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,SAAS,GAGV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EACd,cAAc,EACd,UAAU,EACV,YAAY,EACZ,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAA8D,MAAM,YAAY,CAAC;AACnG,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACP,eAAe,EACf,kBAAkB,GAInB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,51 @@
1
+ import type { Chunk, LocalItem, LocalStore } from '@knowzai/local-store';
2
+ import { CodeGraph } from './graph.js';
3
+ import { type Embedder } from './embedding.js';
4
+ /** Any text file worth indexing (code grammar, doc, structured, or extra text). */
5
+ export declare function isIndexableFile(path: string): boolean;
6
+ /** Map a file to a knowledge type: code → Code, docs → Document, structured/other → Note. */
7
+ export declare function inferKnowledgeType(path: string, grammar?: string): 'Code' | 'Document' | 'Note';
8
+ export interface IndexerOptions {
9
+ embedder?: Embedder;
10
+ maxChunkChars?: number;
11
+ maxFileBytes?: number;
12
+ }
13
+ export interface FileIndexResult {
14
+ item: LocalItem;
15
+ chunks: Chunk[];
16
+ vectors: Float32Array[];
17
+ graph: CodeGraph;
18
+ lang?: string;
19
+ }
20
+ export interface IndexReport {
21
+ filesIndexed: number;
22
+ filesSkipped: number;
23
+ chunks: number;
24
+ graph: CodeGraph;
25
+ }
26
+ export declare function stableItemId(path: string): string;
27
+ export declare class TreeSitterIndexer {
28
+ private readonly embedder;
29
+ private readonly maxChunkChars;
30
+ private readonly maxFileBytes;
31
+ constructor(opts?: IndexerOptions);
32
+ get dim(): number;
33
+ /** Parse + chunk + extract a single file's content. */
34
+ indexFile(path: string, content: string): Promise<FileIndexResult>;
35
+ private walkTopLevel;
36
+ /** Return the definition node directly, or unwrap an `export` wrapper. */
37
+ private defNode;
38
+ private emitDef;
39
+ private windowChunks;
40
+ /** Heading-aware markdown chunking: one chunk per section (`#`/`##`/…). */
41
+ private chunkMarkdown;
42
+ /** Walk a directory, index changed code files into the store, return a report. */
43
+ indexDirectory(dir: string, store: LocalStore, opts?: {
44
+ vaultId?: string;
45
+ force?: boolean;
46
+ }): Promise<IndexReport>;
47
+ private walkFiles;
48
+ embedQuery(text: string): Float32Array;
49
+ }
50
+ export declare function relPath(root: string, p: string): string;
51
+ //# sourceMappingURL=indexer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../src/indexer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGzE,OAAO,EAAE,SAAS,EAAiB,MAAM,YAAY,CAAC;AACtD,OAAO,EAAmB,KAAK,QAAQ,EAAqB,MAAM,gBAAgB,CAAC;AAoCnF,mFAAmF;A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IA4BrB,kFAAkF;IAC5E,cAAc,CAClB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,UAAU,EACjB,IAAI,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAO,GAC/C,OAAO,CAAC,WAAW,CAAC;IA4CvB,OAAO,CAAC,SAAS;IAuBjB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;CAGvC;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvD"}
@@ -0,0 +1,351 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { closeSync, fstatSync, openSync, readdirSync, readFileSync, statSync } from 'node:fs';
3
+ import { join, relative, sep } from 'node:path';
4
+ import { contentHash } from '@knowzai/local-store';
5
+ import { grammarForPath, parserFor } from './languages.js';
6
+ import { CodeGraph } from './graph.js';
7
+ import { HashingEmbedder, DEFAULT_EMBED_DIM } from './embedding.js';
8
+ const CLASS_LIKE = new Set([
9
+ 'class_declaration', 'class_definition', 'class_specifier', 'struct_item',
10
+ 'struct_declaration', 'interface_declaration', 'impl_item',
11
+ ]);
12
+ const FUNC_LIKE = new Set([
13
+ 'function_declaration', 'function_definition', 'function_item', 'method_definition',
14
+ 'method_declaration', 'constructor_declaration', 'generator_function_declaration',
15
+ ]);
16
+ const NAME_TYPES = new Set([
17
+ 'identifier', 'type_identifier', 'property_identifier', 'field_identifier', 'name', 'constant',
18
+ ]);
19
+ const CALL_TYPES = new Set([
20
+ 'call_expression', 'call', 'invocation_expression', 'method_invocation', 'macro_invocation',
21
+ ]);
22
+ const IMPORT_TYPES = new Set([
23
+ 'import_statement', 'import_from_statement', 'import_declaration', 'using_directive', 'preproc_include',
24
+ ]);
25
+ const NAMESPACE_LIKE = new Set([
26
+ 'namespace_declaration', 'file_scoped_namespace_declaration', 'module', 'namespace', 'mod_item',
27
+ ]);
28
+ const DEFAULT_IGNORES = new Set(['node_modules', '.git', 'dist', 'build', 'out', '.knowz', 'coverage', 'bin', 'obj']);
29
+ // Non-code text we still index (docs / markdown / structured / unstructured).
30
+ const DOC_EXT = new Set(['md', 'markdown', 'txt', 'rst', 'adoc', 'text', 'org']);
31
+ const STRUCT_EXT = new Set(['json', 'yaml', 'yml', 'toml', 'xml', 'csv', 'tsv', 'ini', 'env', 'properties']);
32
+ const EXTRA_TEXT_EXT = new Set(['log', 'sql', 'graphql', 'gql', 'proto', 'dockerfile', 'makefile', 'sh', 'bash']);
33
+ function extOf(path) {
34
+ return path.split('/').pop().split('.').pop().toLowerCase();
35
+ }
36
+ function isMarkdown(path) {
37
+ const e = extOf(path);
38
+ return e === 'md' || e === 'markdown';
39
+ }
40
+ /** Any text file worth indexing (code grammar, doc, structured, or extra text). */
41
+ export function isIndexableFile(path) {
42
+ if (grammarForPath(path))
43
+ return true;
44
+ const e = extOf(path);
45
+ return DOC_EXT.has(e) || STRUCT_EXT.has(e) || EXTRA_TEXT_EXT.has(e);
46
+ }
47
+ /** Map a file to a knowledge type: code → Code, docs → Document, structured/other → Note. */
48
+ export function inferKnowledgeType(path, grammar) {
49
+ if (grammar && !STRUCT_EXT.has(extOf(path)))
50
+ return 'Code';
51
+ if (DOC_EXT.has(extOf(path)))
52
+ return 'Document';
53
+ return 'Note';
54
+ }
55
+ function nameOf(node) {
56
+ const named = node.childForFieldName?.('name');
57
+ if (named?.text)
58
+ return named.text;
59
+ for (let i = 0; i < node.namedChildCount; i++) {
60
+ const c = node.namedChild(i);
61
+ if (c && NAME_TYPES.has(c.type))
62
+ return c.text;
63
+ }
64
+ return undefined;
65
+ }
66
+ function kindFor(type, parentIsClass) {
67
+ if (type === 'interface_declaration')
68
+ return 'interface';
69
+ if (CLASS_LIKE.has(type))
70
+ return 'class';
71
+ return parentIsClass ? 'method' : 'function';
72
+ }
73
+ function collectCalls(node, out, budget = 200) {
74
+ const stack = [node];
75
+ while (stack.length && out.size < budget) {
76
+ const n = stack.pop();
77
+ if (CALL_TYPES.has(n.type)) {
78
+ const fn = n.childForFieldName?.('function') ?? n.namedChild(0);
79
+ const txt = fn?.text;
80
+ if (txt)
81
+ out.add(txt.split(/[.:>]/).pop().trim());
82
+ }
83
+ for (let i = 0; i < n.namedChildCount; i++) {
84
+ const c = n.namedChild(i);
85
+ if (c)
86
+ stack.push(c);
87
+ }
88
+ }
89
+ }
90
+ export function stableItemId(path) {
91
+ return createHash('sha1').update(path).digest('hex');
92
+ }
93
+ export class TreeSitterIndexer {
94
+ embedder;
95
+ maxChunkChars;
96
+ maxFileBytes;
97
+ constructor(opts = {}) {
98
+ this.embedder = opts.embedder ?? new HashingEmbedder(DEFAULT_EMBED_DIM);
99
+ this.maxChunkChars = opts.maxChunkChars ?? 4000;
100
+ this.maxFileBytes = opts.maxFileBytes ?? 1_000_000;
101
+ }
102
+ get dim() {
103
+ return this.embedder.dim;
104
+ }
105
+ /** Parse + chunk + extract a single file's content. */
106
+ async indexFile(path, content) {
107
+ const itemId = stableItemId(path);
108
+ const graph = new CodeGraph();
109
+ const fileNodeId = `file:${path}`;
110
+ graph.addNode({ id: fileNodeId, name: path, kind: 'file', file: path });
111
+ const grammar = grammarForPath(path);
112
+ const parser = grammar ? await parserFor(grammar) : undefined;
113
+ const rawChunks = [];
114
+ if (parser) {
115
+ const tree = parser.parse(content);
116
+ const root = tree?.rootNode;
117
+ if (root)
118
+ this.walkTopLevel(root, content, path, fileNodeId, graph, rawChunks);
119
+ tree?.delete?.();
120
+ }
121
+ if (rawChunks.length === 0) {
122
+ // Non-code: markdown gets heading-aware sections; everything else windows.
123
+ if (isMarkdown(path))
124
+ this.chunkMarkdown(content, rawChunks);
125
+ else
126
+ this.windowChunks(content, rawChunks);
127
+ }
128
+ const knowledgeType = inferKnowledgeType(path, grammar);
129
+ const chunks = [];
130
+ const vectors = [];
131
+ rawChunks.forEach((rc, ordinal) => {
132
+ const text = rc.text.slice(0, this.maxChunkChars);
133
+ chunks.push({ id: `${itemId}:${ordinal}`, itemId, ordinal, text, startByte: rc.startByte, endByte: rc.endByte, lang: grammar });
134
+ vectors.push(this.embedder.embed(text));
135
+ });
136
+ const item = {
137
+ id: itemId,
138
+ title: path,
139
+ type: knowledgeType,
140
+ contentHash: contentHash(content, path, grammar ? [grammar] : []),
141
+ content,
142
+ tags: grammar ? [grammar] : [],
143
+ updatedAt: new Date().toISOString(),
144
+ syncState: 'new',
145
+ };
146
+ graph.resolve();
147
+ return { item, chunks, vectors, graph, lang: grammar };
148
+ }
149
+ walkTopLevel(root, content, path, fileNodeId, graph, out) {
150
+ let pending = null;
151
+ const flushPending = () => {
152
+ if (!pending)
153
+ return;
154
+ const text = content.slice(pending.start, pending.end);
155
+ if (text.trim())
156
+ this.windowChunks(text, out, pending.start);
157
+ pending = null;
158
+ };
159
+ for (let i = 0; i < root.namedChildCount; i++) {
160
+ const child = root.namedChild(i);
161
+ if (!child)
162
+ continue;
163
+ if (IMPORT_TYPES.has(child.type)) {
164
+ const mod = nameOf(child) ?? child.text.replace(/\s+/g, ' ').slice(0, 60);
165
+ graph.addEdge({ from: fileNodeId, to: `import:${mod}`, kind: 'imports' });
166
+ }
167
+ // Descend namespace/module wrappers (e.g. C# file-scoped namespaces) one level.
168
+ if (NAMESPACE_LIKE.has(child.type)) {
169
+ flushPending();
170
+ for (let k = 0; k < child.namedChildCount; k++) {
171
+ const gc = child.namedChild(k);
172
+ if (!gc)
173
+ continue;
174
+ const nd = this.defNode(gc);
175
+ if (nd)
176
+ this.emitDef(nd, content, path, fileNodeId, graph, out, false);
177
+ }
178
+ continue;
179
+ }
180
+ const def = this.defNode(child);
181
+ if (def) {
182
+ flushPending();
183
+ this.emitDef(def, content, path, fileNodeId, graph, out, false);
184
+ }
185
+ else {
186
+ const s = child.startIndex;
187
+ const e = child.endIndex;
188
+ pending = pending ? { start: pending.start, end: e } : { start: s, end: e };
189
+ }
190
+ }
191
+ flushPending();
192
+ }
193
+ /** Return the definition node directly, or unwrap an `export` wrapper. */
194
+ defNode(node) {
195
+ if (CLASS_LIKE.has(node.type) || FUNC_LIKE.has(node.type))
196
+ return node;
197
+ if (node.type === 'export_statement' || node.type === 'export_default_declaration') {
198
+ const decl = node.childForFieldName?.('declaration');
199
+ if (decl && (CLASS_LIKE.has(decl.type) || FUNC_LIKE.has(decl.type)))
200
+ return decl;
201
+ for (let i = 0; i < node.namedChildCount; i++) {
202
+ const c = node.namedChild(i);
203
+ if (c && (CLASS_LIKE.has(c.type) || FUNC_LIKE.has(c.type)))
204
+ return c;
205
+ }
206
+ }
207
+ return undefined;
208
+ }
209
+ emitDef(node, content, path, parentNodeId, graph, out, parentIsClass) {
210
+ const name = nameOf(node) ?? '(anonymous)';
211
+ const id = `${path}#${name}`;
212
+ const kind = kindFor(node.type, parentIsClass);
213
+ graph.addNode({ id, name, kind, file: path, startByte: node.startIndex });
214
+ graph.addEdge({ from: parentNodeId, to: id, kind: 'contains' });
215
+ const calls = new Set();
216
+ collectCalls(node, calls);
217
+ for (const callee of calls)
218
+ graph.addEdge({ from: id, to: callee, kind: 'calls' });
219
+ out.push({ text: node.text, startByte: node.startIndex, endByte: node.endIndex });
220
+ // Recurse into class bodies for methods.
221
+ if (CLASS_LIKE.has(node.type)) {
222
+ const body = node.childForFieldName?.('body') ?? node;
223
+ for (let i = 0; i < body.namedChildCount; i++) {
224
+ const m = body.namedChild(i);
225
+ if (m && FUNC_LIKE.has(m.type))
226
+ this.emitDef(m, content, path, id, graph, out, true);
227
+ }
228
+ }
229
+ }
230
+ windowChunks(text, out, baseOffset = 0) {
231
+ const size = this.maxChunkChars;
232
+ for (let i = 0; i < text.length; i += size) {
233
+ const slice = text.slice(i, i + size);
234
+ if (slice.trim())
235
+ out.push({ text: slice, startByte: baseOffset + i, endByte: baseOffset + i + slice.length });
236
+ }
237
+ }
238
+ /** Heading-aware markdown chunking: one chunk per section (`#`/`##`/…). */
239
+ chunkMarkdown(text, out) {
240
+ const headingRe = /^#{1,6}\s+/;
241
+ const lines = text.split('\n');
242
+ let start = 0;
243
+ let buf = [];
244
+ let bufStart = 0;
245
+ const flush = (end) => {
246
+ const section = buf.join('\n');
247
+ if (section.trim()) {
248
+ if (section.length > this.maxChunkChars)
249
+ this.windowChunks(section, out, bufStart);
250
+ else
251
+ out.push({ text: section, startByte: bufStart, endByte: end });
252
+ }
253
+ buf = [];
254
+ };
255
+ for (const line of lines) {
256
+ const lineLen = line.length + 1;
257
+ if (headingRe.test(line) && buf.length) {
258
+ flush(start);
259
+ bufStart = start;
260
+ }
261
+ if (buf.length === 0)
262
+ bufStart = start;
263
+ buf.push(line);
264
+ start += lineLen;
265
+ }
266
+ flush(start);
267
+ if (out.length === 0)
268
+ this.windowChunks(text, out); // empty/space-only fallback
269
+ }
270
+ /** Walk a directory, index changed code files into the store, return a report. */
271
+ async indexDirectory(dir, store, opts = {}) {
272
+ const report = { filesIndexed: 0, filesSkipped: 0, chunks: 0, graph: new CodeGraph() };
273
+ const files = this.walkFiles(dir);
274
+ for (const path of files) {
275
+ const fd = openSync(path, 'r');
276
+ let content;
277
+ let st;
278
+ try {
279
+ st = fstatSync(fd);
280
+ if (st.size > this.maxFileBytes) {
281
+ report.filesSkipped++;
282
+ continue;
283
+ }
284
+ content = readFileSync(fd, 'utf8');
285
+ }
286
+ finally {
287
+ closeSync(fd);
288
+ }
289
+ const hash = createHash('sha256').update(content).digest('hex');
290
+ const prior = await store.getFileState(path);
291
+ if (!opts.force && prior?.hash === hash) {
292
+ report.filesSkipped++;
293
+ continue;
294
+ }
295
+ const result = await this.indexFile(path, content);
296
+ if (prior?.itemId && prior.itemId !== result.item.id) {
297
+ result.item.id = prior.itemId;
298
+ result.chunks = result.chunks.map((c) => ({
299
+ ...c,
300
+ id: `${prior.itemId}:${c.ordinal}`,
301
+ itemId: prior.itemId,
302
+ }));
303
+ }
304
+ if (opts.vaultId)
305
+ result.item.vaultId = opts.vaultId;
306
+ await store.upsertItem(result.item);
307
+ await store.putChunks(result.item.id, result.chunks, result.vectors);
308
+ await store.setFileState({ path, hash, mtimeMs: st.mtimeMs, size: st.size, itemId: result.item.id, lastIndexedAt: new Date().toISOString() });
309
+ report.graph.merge(result.graph);
310
+ report.filesIndexed++;
311
+ report.chunks += result.chunks.length;
312
+ }
313
+ report.graph.resolve();
314
+ return report;
315
+ }
316
+ walkFiles(dir) {
317
+ const acc = [];
318
+ const visit = (d) => {
319
+ let entries;
320
+ try {
321
+ entries = readdirSync(d, { withFileTypes: true });
322
+ }
323
+ catch {
324
+ return;
325
+ }
326
+ for (const e of entries) {
327
+ if (e.name.startsWith('.') && e.name !== '.')
328
+ continue;
329
+ if (DEFAULT_IGNORES.has(e.name))
330
+ continue;
331
+ const full = join(d, e.name);
332
+ if (e.isDirectory())
333
+ visit(full);
334
+ else if (e.isFile() && isIndexableFile(e.name))
335
+ acc.push(full);
336
+ }
337
+ };
338
+ const top = statSync(dir);
339
+ if (top.isFile())
340
+ return isIndexableFile(dir) ? [dir] : [];
341
+ visit(dir);
342
+ return acc;
343
+ }
344
+ embedQuery(text) {
345
+ return this.embedder.embed(text);
346
+ }
347
+ }
348
+ export function relPath(root, p) {
349
+ return relative(root, p).split(sep).join('/');
350
+ }
351
+ //# sourceMappingURL=indexer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexer.js","sourceRoot":"","sources":["../src/indexer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAc,MAAM,SAAS,CAAC;AAC1G,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAiB,MAAM,YAAY,CAAC;AAC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;IACb,CAAC;IAED,UAAU,CAAC,IAAY;QACrB,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;CACF;AAED,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,CAAS;IAC7C,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Parser, Language } from 'web-tree-sitter';
2
+ /** File extension → tree-sitter-wasms grammar name. */
3
+ export declare const EXT_TO_GRAMMAR: Record<string, string>;
4
+ export declare function grammarForPath(path: string): string | undefined;
5
+ export declare function initParser(): Promise<void>;
6
+ /** Load (and cache) a grammar by name. Returns undefined if the wasm is absent. */
7
+ export declare function loadLanguage(grammar: string): Promise<Language | undefined>;
8
+ export declare function parserFor(grammar: string): Promise<Parser | undefined>;
9
+ //# sourceMappingURL=languages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../src/languages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAInD,uDAAuD;AACvD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAmCjD,CAAC;AAEF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG/D;AASD,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAIhD;AAED,mFAAmF;AACnF,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAWjF;AAED,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAM5E"}
@@ -0,0 +1,80 @@
1
+ import { createRequire } from 'node:module';
2
+ import { dirname, join } from 'node:path';
3
+ import { Parser, Language } from 'web-tree-sitter';
4
+ const require = createRequire(import.meta.url);
5
+ /** File extension → tree-sitter-wasms grammar name. */
6
+ export const EXT_TO_GRAMMAR = {
7
+ ts: 'typescript',
8
+ mts: 'typescript',
9
+ cts: 'typescript',
10
+ tsx: 'tsx',
11
+ js: 'javascript',
12
+ jsx: 'javascript',
13
+ mjs: 'javascript',
14
+ cjs: 'javascript',
15
+ py: 'python',
16
+ cs: 'c_sharp',
17
+ go: 'go',
18
+ rs: 'rust',
19
+ java: 'java',
20
+ rb: 'ruby',
21
+ cpp: 'cpp',
22
+ cc: 'cpp',
23
+ cxx: 'cpp',
24
+ hpp: 'cpp',
25
+ c: 'c',
26
+ h: 'c',
27
+ kt: 'kotlin',
28
+ swift: 'swift',
29
+ scala: 'scala',
30
+ php: 'php',
31
+ lua: 'lua',
32
+ rs_: 'rust',
33
+ json: 'json',
34
+ html: 'html',
35
+ css: 'css',
36
+ yaml: 'yaml',
37
+ yml: 'yaml',
38
+ toml: 'toml',
39
+ sh: 'bash',
40
+ bash: 'bash',
41
+ };
42
+ export function grammarForPath(path) {
43
+ const ext = path.split('.').pop()?.toLowerCase();
44
+ return ext ? EXT_TO_GRAMMAR[ext] : undefined;
45
+ }
46
+ let inited = false;
47
+ const cache = new Map();
48
+ function grammarDir() {
49
+ return join(dirname(require.resolve('tree-sitter-wasms/package.json')), 'out');
50
+ }
51
+ export async function initParser() {
52
+ if (inited)
53
+ return;
54
+ await Parser.init();
55
+ inited = true;
56
+ }
57
+ /** Load (and cache) a grammar by name. Returns undefined if the wasm is absent. */
58
+ export async function loadLanguage(grammar) {
59
+ await initParser();
60
+ const cached = cache.get(grammar);
61
+ if (cached)
62
+ return cached;
63
+ try {
64
+ const lang = await Language.load(join(grammarDir(), `tree-sitter-${grammar}.wasm`));
65
+ cache.set(grammar, lang);
66
+ return lang;
67
+ }
68
+ catch {
69
+ return undefined;
70
+ }
71
+ }
72
+ export async function parserFor(grammar) {
73
+ const lang = await loadLanguage(grammar);
74
+ if (!lang)
75
+ return undefined;
76
+ const p = new Parser();
77
+ p.setLanguage(lang);
78
+ return p;
79
+ }
80
+ //# sourceMappingURL=languages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languages.js","sourceRoot":"","sources":["../src/languages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,uDAAuD;AACvD,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,EAAE,EAAE,YAAY;IAChB,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,YAAY;IAChB,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,YAAY;IACjB,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,MAAM;IACZ,EAAE,EAAE,MAAM;IACV,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,KAAK;IACT,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,EAAE,EAAE,QAAQ;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,MAAM;IACX,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,IAAI,EAA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M,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe;IAC7C,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,MAAM,CAAC,GAAG,IAAI,MAAM,EAAE,CAAC;IACvB,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACpB,OAAO,CAAC,CAAC;AACX,CAAC"}
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@knowzai/indexer",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.js"
9
+ }
10
+ },
11
+ "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "dependencies": {
17
+ "tree-sitter-wasms": "^0.1.12",
18
+ "web-tree-sitter": "^0.25.0",
19
+ "@knowzai/local-store": "0.1.0"
20
+ },
21
+ "license": "MIT",
22
+ "author": "Knowz",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/knowz-io/knowz-platform.git",
26
+ "directory": "cli/indexer"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "engines": {
32
+ "node": ">=20"
33
+ },
34
+ "scripts": {
35
+ "build": "tsc -b"
36
+ }
37
+ }