@ganziliang/kb 0.1.3 → 0.1.4

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/dist/entry.d.ts CHANGED
@@ -1 +1,2 @@
1
+ #!/usr/bin/env node
1
2
  export {};
package/dist/entry.js CHANGED
@@ -1,4 +1,15 @@
1
- // Install the warning filter before loading node:sqlite through the CLI module.
1
+ #!/usr/bin/env node
2
+ // node:sqlite emits its experimental warning while the module is loading.
3
+ const emitWarning = process.emitWarning.bind(process);
4
+ process.emitWarning = ((warning, ...args) => {
5
+ const message = warning instanceof Error ? warning.message : warning;
6
+ const options = args[0] && typeof args[0] === "object" ? args[0] : undefined;
7
+ if (/SQLite/i.test(message) && options?.type === "ExperimentalWarning")
8
+ return;
9
+ return emitWarning(warning, ...args);
10
+ });
11
+ // Install a custom handler so Node's default warning printer does not print SQLite's warning.
12
+ process.removeAllListeners("warning");
2
13
  process.on("warning", (warning) => {
3
14
  if (warning.name === "ExperimentalWarning" && /SQLite/i.test(warning.message))
4
15
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ganziliang/kb",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Local knowledge base agent CLI",
5
5
  "type": "module",
6
6
  "bin": {