cyt-indexer-sdk 0.2.1 → 0.2.6
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 +1 -1
- package/README.md +0 -1
- package/cyt-indexer-sdk.darwin-x64.node +0 -0
- package/cyt-indexer-sdk.linux-arm64-gnu.node +0 -0
- package/cyt-indexer-sdk.linux-x64-gnu.node +0 -0
- package/cyt-indexer-sdk.win32-arm64-msvc.node +0 -0
- package/cyt-indexer-sdk.win32-x64-msvc.node +0 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/native.d.ts +0 -3
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js +0 -3
- package/dist/native.js.map +1 -1
- package/dist/test/smoke.test.js +0 -4
- package/dist/test/smoke.test.js.map +1 -1
- package/native.cjs +52 -55
- package/native.d.ts +0 -6
- package/package.json +1 -1
- package/dist/tokens.d.ts +0 -5
- package/dist/tokens.d.ts.map +0 -1
- package/dist/tokens.js +0 -15
- package/dist/tokens.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2026 Damien Berezenko
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { CatalogIndex, buildCatalogIndex, catalogToolCount, collectEnums, } from "./build.js";
|
|
2
2
|
export { DECOMPOSED_SCORE, DecomposedCatalog, ENUM_SCORE, loadCatalog, retrieveTools, type JsonRecord, type PolicyOptions, type RetrieveToolsOptions, } from "./retrieve.js";
|
|
3
|
-
export { compactJson, countJsonTokens, countTokens, logTokenUsage, } from "./tokens.js";
|
|
4
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,aAAa,EACb,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,aAAa,EACb,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { CatalogIndex, buildCatalogIndex, catalogToolCount, collectEnums, } from "./build.js";
|
|
2
2
|
export { DECOMPOSED_SCORE, DecomposedCatalog, ENUM_SCORE, loadCatalog, retrieveTools, } from "./retrieve.js";
|
|
3
|
-
export { compactJson, countJsonTokens, countTokens, logTokenUsage, } from "./tokens.js";
|
|
4
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,aAAa,GAId,MAAM,eAAe,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,aAAa,GAId,MAAM,eAAe,CAAC"}
|
package/dist/native.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export declare const buildCatalogIndexNative: typeof import("../native.d.ts").buildCatalogIndex;
|
|
2
2
|
export declare const catalogToolCountNative: typeof import("../native.d.ts").catalogToolCount;
|
|
3
|
-
export declare const compactJsonNative: typeof import("../native.d.ts").compactJson;
|
|
4
|
-
export declare const countJsonTokensNative: typeof import("../native.d.ts").countJsonTokens;
|
|
5
|
-
export declare const countTokensNative: typeof import("../native.d.ts").countTokens;
|
|
6
3
|
export declare const loadCatalogNative: typeof import("../native.d.ts").loadCatalog;
|
|
7
4
|
export declare const retrieveCoreNative: typeof import("../native.d.ts").retrieveCore;
|
|
8
5
|
export type { PolicyOptions } from "../native.d.ts";
|
package/dist/native.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,uBAAuB,mDAA2B,CAAC;AAChE,eAAO,MAAM,sBAAsB,kDAA0B,CAAC;AAC9D,eAAO,MAAM,iBAAiB,6CAAqB,CAAC;AACpD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,uBAAuB,mDAA2B,CAAC;AAChE,eAAO,MAAM,sBAAsB,kDAA0B,CAAC;AAC9D,eAAO,MAAM,iBAAiB,6CAAqB,CAAC;AACpD,eAAO,MAAM,kBAAkB,8CAAsB,CAAC;AAEtD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/native.js
CHANGED
|
@@ -3,9 +3,6 @@ const require = createRequire(import.meta.url);
|
|
|
3
3
|
const native = require("../native.cjs");
|
|
4
4
|
export const buildCatalogIndexNative = native.buildCatalogIndex;
|
|
5
5
|
export const catalogToolCountNative = native.catalogToolCount;
|
|
6
|
-
export const compactJsonNative = native.compactJson;
|
|
7
|
-
export const countJsonTokensNative = native.countJsonTokens;
|
|
8
|
-
export const countTokensNative = native.countTokens;
|
|
9
6
|
export const loadCatalogNative = native.loadCatalog;
|
|
10
7
|
export const retrieveCoreNative = native.retrieveCore;
|
|
11
8
|
//# sourceMappingURL=native.js.map
|
package/dist/native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAoC,CAAC;AAE3E,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC;AACpD,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAoC,CAAC;AAE3E,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,YAAY,CAAC"}
|
package/dist/test/smoke.test.js
CHANGED
|
@@ -3,11 +3,7 @@ import test from "node:test";
|
|
|
3
3
|
import { CatalogIndex } from "../build.js";
|
|
4
4
|
import { DecomposedCatalog } from "../decomposed-catalog.js";
|
|
5
5
|
import { DECOMPOSED_SCORE, ENUM_SCORE, retrieveTools } from "../retrieve.js";
|
|
6
|
-
import { countTokens } from "../tokens.js";
|
|
7
6
|
import { DECOMPOSED_PREFIX } from "../paths.js";
|
|
8
|
-
test("countTokens returns a positive count", () => {
|
|
9
|
-
assert.ok(countTokens("hello") > 0);
|
|
10
|
-
});
|
|
11
7
|
test("score constants match Python SDK", () => {
|
|
12
8
|
assert.equal(DECOMPOSED_SCORE, 0.5);
|
|
13
9
|
assert.equal(ENUM_SCORE, 0.2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smoke.test.js","sourceRoot":"","sources":["../../src/test/smoke.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":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C,EAAE,EAAE,EAAE,OAAO,EAAE,EAAkB,EAAE,CAAC,EACxD,SAAS,CACV,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,4DAA4D,EAAE,GAAG,EAAE;IACtE,MAAM,QAAQ,GAAG,GAAG,iBAAiB,aAAa,CAAC;IACnD,MAAM,OAAO,GAAG,IAAI,iBAAiB,CAAC;QACpC,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;KAC/C,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAChD,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AACnC,CAAC,CAAC,CAAC"}
|
package/native.cjs
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('cyt-indexer-sdk-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('cyt-indexer-sdk-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '0.2.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
80
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('cyt-indexer-sdk-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('cyt-indexer-sdk-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '0.2.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
96
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('cyt-indexer-sdk-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('cyt-indexer-sdk-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '0.2.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
117
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('cyt-indexer-sdk-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('cyt-indexer-sdk-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '0.2.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
133
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('cyt-indexer-sdk-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('cyt-indexer-sdk-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.2.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
150
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('cyt-indexer-sdk-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('cyt-indexer-sdk-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '0.2.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
166
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('cyt-indexer-sdk-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('cyt-indexer-sdk-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '0.2.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
185
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('cyt-indexer-sdk-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('cyt-indexer-sdk-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '0.2.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
201
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('cyt-indexer-sdk-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('cyt-indexer-sdk-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '0.2.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
217
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('cyt-indexer-sdk-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('cyt-indexer-sdk-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '0.2.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
237
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('cyt-indexer-sdk-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('cyt-indexer-sdk-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '0.2.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
253
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('cyt-indexer-sdk-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('cyt-indexer-sdk-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '0.2.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
274
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('cyt-indexer-sdk-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('cyt-indexer-sdk-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '0.2.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
290
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('cyt-indexer-sdk-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('cyt-indexer-sdk-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '0.2.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
308
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('cyt-indexer-sdk-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('cyt-indexer-sdk-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '0.2.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
324
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('cyt-indexer-sdk-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('cyt-indexer-sdk-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '0.2.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
342
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('cyt-indexer-sdk-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('cyt-indexer-sdk-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '0.2.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
358
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('cyt-indexer-sdk-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('cyt-indexer-sdk-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '0.2.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
376
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('cyt-indexer-sdk-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('cyt-indexer-sdk-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '0.2.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
392
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('cyt-indexer-sdk-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('cyt-indexer-sdk-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '0.2.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
410
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('cyt-indexer-sdk-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('cyt-indexer-sdk-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '0.2.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
426
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('cyt-indexer-sdk-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('cyt-indexer-sdk-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.2.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
443
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('cyt-indexer-sdk-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('cyt-indexer-sdk-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.2.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
459
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('cyt-indexer-sdk-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('cyt-indexer-sdk-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '0.2.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
479
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('cyt-indexer-sdk-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('cyt-indexer-sdk-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '0.2.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
495
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('cyt-indexer-sdk-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('cyt-indexer-sdk-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '0.2.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 0.2.
|
|
511
|
+
if (bindingPackageVersion !== '0.2.6' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 0.2.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -588,8 +588,5 @@ if (!nativeBinding) {
|
|
|
588
588
|
module.exports = nativeBinding
|
|
589
589
|
module.exports.buildCatalogIndex = nativeBinding.buildCatalogIndex
|
|
590
590
|
module.exports.catalogToolCount = nativeBinding.catalogToolCount
|
|
591
|
-
module.exports.compactJson = nativeBinding.compactJson
|
|
592
|
-
module.exports.countJsonTokens = nativeBinding.countJsonTokens
|
|
593
|
-
module.exports.countTokens = nativeBinding.countTokens
|
|
594
591
|
module.exports.loadCatalog = nativeBinding.loadCatalog
|
|
595
592
|
module.exports.retrieveCore = nativeBinding.retrieveCore
|
package/native.d.ts
CHANGED
|
@@ -9,12 +9,6 @@ export interface CatalogIndexResult {
|
|
|
9
9
|
|
|
10
10
|
export declare function catalogToolCount(data: any): number
|
|
11
11
|
|
|
12
|
-
export declare function compactJson(obj: any): string
|
|
13
|
-
|
|
14
|
-
export declare function countJsonTokens(obj: any): number
|
|
15
|
-
|
|
16
|
-
export declare function countTokens(text: string): number
|
|
17
|
-
|
|
18
12
|
export declare function loadCatalog(dirPath: string): any
|
|
19
13
|
|
|
20
14
|
export interface PolicyOptions {
|
package/package.json
CHANGED
package/dist/tokens.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function compactJson(obj: unknown): string;
|
|
2
|
-
export declare function countTokens(text: string): number;
|
|
3
|
-
export declare function countJsonTokens(obj: unknown): number;
|
|
4
|
-
export declare function logTokenUsage(label: string, tokens: number): void;
|
|
5
|
-
//# sourceMappingURL=tokens.d.ts.map
|
package/dist/tokens.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAMA,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEhD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAGjE"}
|
package/dist/tokens.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { compactJsonNative, countJsonTokensNative, countTokensNative, } from "./native.js";
|
|
2
|
-
export function compactJson(obj) {
|
|
3
|
-
return compactJsonNative(obj);
|
|
4
|
-
}
|
|
5
|
-
export function countTokens(text) {
|
|
6
|
-
return countTokensNative(text);
|
|
7
|
-
}
|
|
8
|
-
export function countJsonTokens(obj) {
|
|
9
|
-
return countJsonTokensNative(obj);
|
|
10
|
-
}
|
|
11
|
-
export function logTokenUsage(label, tokens) {
|
|
12
|
-
const msg = `${label}: ${tokens} tokens`;
|
|
13
|
-
console.log(msg);
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=tokens.js.map
|
package/dist/tokens.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,MAAM,UAAU,WAAW,CAAC,GAAY;IACtC,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAY;IAC1C,OAAO,qBAAqB,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,MAAc;IACzD,MAAM,GAAG,GAAG,GAAG,KAAK,KAAK,MAAM,SAAS,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC"}
|