@nettoolskit/memory 0.0.1-preview.1 → 0.0.1-preview.2
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/README.md
CHANGED
|
@@ -788,4 +788,7 @@ ntk-memory --help
|
|
|
788
788
|
npx @nettoolskit/memory --help
|
|
789
789
|
```
|
|
790
790
|
|
|
791
|
-
The npm wrapper executes a native `ntk-memory` binary from `npm/native/` when release packaging stages one. For development or private release validation, set `NTK_MEMORY_BINARY` to an already built local binary. Use `npm run stage:native -- <path-to-binary>` before packaging a native tarball.
|
|
791
|
+
The npm wrapper executes a native `ntk-memory` binary from `npm/native/` when release packaging stages one. For development or private release validation, set `NTK_MEMORY_BINARY` to an already built local binary. Use `npm run stage:native -- <path-to-binary>` before packaging a native tarball.
|
|
792
|
+
## Package publication
|
|
793
|
+
|
|
794
|
+
Current preview package: `@nettoolskit/memory@0.0.1-preview.2`. Use `npx @nettoolskit/memory` for ephemeral execution or `ntk-memory` after global installation. GitRiver stage `river/publish` runs package dry-run validation on pull requests and publishes only from `main` or `v*` source refs through `scripts/ci/river/npm-publish.sh`.
|
|
File without changes
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nettoolskit/memory",
|
|
3
|
-
"version": "0.0.1-preview.
|
|
3
|
+
"version": "0.0.1-preview.2",
|
|
4
4
|
"description": "Knowledge ingestion, local memory, RAG, HyDE, retrieval, context packages, and vault materialization for NetToolsKit.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -25,12 +25,17 @@
|
|
|
25
25
|
"README.md",
|
|
26
26
|
"npm/cli/ntk-memory.js",
|
|
27
27
|
"npm/native/",
|
|
28
|
+
"scripts/npm/assert-native-bundled.js",
|
|
28
29
|
"scripts/npm/postinstall.js",
|
|
29
30
|
"scripts/npm/stage-native.js"
|
|
30
31
|
],
|
|
31
32
|
"scripts": {
|
|
33
|
+
"build:native": "cargo build --release --bin ntk-memory",
|
|
34
|
+
"prepublishOnly": "node scripts/npm/assert-native-bundled.js",
|
|
32
35
|
"postinstall": "node scripts/npm/postinstall.js",
|
|
33
36
|
"stage:native": "node scripts/npm/stage-native.js",
|
|
37
|
+
"test:package-wrapper": "node scripts/npm/test-package-wrapper-smoke.js",
|
|
38
|
+
"test:package-tarball": "node scripts/npm/test-package-tarball-install-smoke.js",
|
|
34
39
|
"pack:dry-run": "npm pack --ignore-scripts --dry-run"
|
|
35
40
|
},
|
|
36
41
|
"publishConfig": {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
|
|
7
|
+
const nativeName = process.platform === "win32" ? "ntk-memory.exe" : "ntk-memory";
|
|
8
|
+
const nativePath = path.resolve(__dirname, "..", "..", "npm", "native", nativeName);
|
|
9
|
+
|
|
10
|
+
if (!fs.existsSync(nativePath)) {
|
|
11
|
+
console.error(`Missing bundled ntk-memory native binary: ${nativePath}`);
|
|
12
|
+
console.error("Run `npm run build:native` and `npm run stage:native` before publishing.");
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const stat = fs.statSync(nativePath);
|
|
17
|
+
if (!stat.isFile() || stat.size === 0) {
|
|
18
|
+
console.error(`Invalid bundled ntk-memory native binary: ${nativePath}`);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
console.log(`Bundled ntk-memory native binary is present: ${nativeName}`);
|
|
@@ -7,8 +7,17 @@ const path = require("node:path");
|
|
|
7
7
|
const binaryName = process.platform === "win32" ? "ntk-memory.exe" : "ntk-memory";
|
|
8
8
|
const repoRoot = path.resolve(__dirname, "..", "..");
|
|
9
9
|
const explicitSource = process.argv[2] || process.env.NTK_MEMORY_STAGE_BINARY;
|
|
10
|
+
const cargoTargetDir = process.env.CARGO_TARGET_DIR
|
|
11
|
+
? path.resolve(process.env.CARGO_TARGET_DIR)
|
|
12
|
+
: null;
|
|
10
13
|
const candidates = [
|
|
11
14
|
explicitSource,
|
|
15
|
+
cargoTargetDir ? path.join(cargoTargetDir, "release", binaryName) : null,
|
|
16
|
+
cargoTargetDir ? path.join(cargoTargetDir, "x86_64-pc-windows-msvc", "release", "ntk-memory.exe") : null,
|
|
17
|
+
cargoTargetDir ? path.join(cargoTargetDir, "x86_64-unknown-linux-gnu", "release", "ntk-memory") : null,
|
|
18
|
+
path.join(repoRoot, ".build", "target", "release", binaryName),
|
|
19
|
+
path.join(repoRoot, ".build", "target", "x86_64-pc-windows-msvc", "release", "ntk-memory.exe"),
|
|
20
|
+
path.join(repoRoot, ".build", "target", "x86_64-unknown-linux-gnu", "release", "ntk-memory"),
|
|
12
21
|
path.join(repoRoot, "target", "release", binaryName),
|
|
13
22
|
path.join(repoRoot, "target", "x86_64-pc-windows-msvc", "release", "ntk-memory.exe"),
|
|
14
23
|
path.join(repoRoot, "target", "x86_64-unknown-linux-gnu", "release", "ntk-memory"),
|