caliper-harness 0.1.2 → 0.1.3
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 +17 -14
- package/install.cjs +19 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,28 +3,31 @@
|
|
|
3
3
|
Local models, practical coding tools and project memory.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
npm install
|
|
7
|
-
cd your-project
|
|
6
|
+
npm install caliper-harness
|
|
8
7
|
caliper
|
|
9
8
|
```
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
Installation downloads the complete application and registers `caliper` for your
|
|
11
|
+
user account. If your current terminal cannot find it, open a new terminal;
|
|
12
|
+
installation cannot change the PATH of a terminal that is already running. You
|
|
13
|
+
can then enter any project directory and run `caliper`.
|
|
14
|
+
|
|
15
|
+
Plain npm installation creates `node_modules` and npm package files in the
|
|
16
|
+
installation directory. To avoid those files in a project, install globally with
|
|
17
|
+
`npm install -g caliper-harness`; npm supplies the global command in that case.
|
|
18
|
+
|
|
19
|
+
Supported platforms are macOS Apple Silicon, Windows x64 and Linux x64/ARM64.
|
|
20
|
+
Node 20 or newer is needed for the npm launcher. On Windows, the launcher checks
|
|
21
|
+
the Microsoft Visual C++ runtime before starting. If it is missing or outdated,
|
|
22
|
+
the shared prerequisite helper downloads Microsoft's installer directly and may
|
|
23
|
+
request administrator approval or a restart. A compatible installation needs no
|
|
24
|
+
download. Caliper does not bundle Microsoft's installer or runtime DLLs.
|
|
18
25
|
|
|
19
26
|
Model weights and tools belonging to your project remain yours to install.
|
|
20
27
|
|
|
21
28
|
Caliper offers available updates at startup. Use `/update` to download an update
|
|
22
|
-
for your next launch, or
|
|
29
|
+
for your next launch, or repeat your npm installation with `caliper-harness@latest`.
|
|
23
30
|
|
|
24
31
|
Your settings, graph and sessions live in your operating system's user-data
|
|
25
32
|
folder, separate from application versions. Updates preserve previous versions
|
|
26
33
|
and never delete your project work or model files.
|
|
27
|
-
|
|
28
|
-
For a project-local installation, `npm install caliper-harness` followed by
|
|
29
|
-
`npx caliper` works too; npm creates `node_modules` in that project. Use the global
|
|
30
|
-
command above to keep project directories free of installation files.
|
package/install.cjs
CHANGED
|
@@ -72,6 +72,23 @@ async function activateNative(root) {
|
|
|
72
72
|
child.on('error',reject);child.on('exit',code=>code===0?resolve():reject(new Error(`Native installation activation failed (${code}); previous selection preserved`)));
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
+
async function registerCommand(root) {
|
|
76
|
+
// Global npm installs already register the package's bin entry. Local npm
|
|
77
|
+
// installs need the same per-user registration as downloaded app folders.
|
|
78
|
+
if (process.env.npm_config_global === 'true') return;
|
|
79
|
+
let command = '/bin/sh', args = [path.join(root, 'install.sh')];
|
|
80
|
+
if (process.platform === 'win32') {
|
|
81
|
+
if (!process.env.SystemRoot) throw new Error('SystemRoot unavailable; cannot register Caliper command');
|
|
82
|
+
command = path.join(process.env.SystemRoot, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe');
|
|
83
|
+
// Register the installed folder in place; do not copy its runtime again.
|
|
84
|
+
args = ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', path.join(root, 'install-windows.ps1'), '-TargetDirectory', root];
|
|
85
|
+
}
|
|
86
|
+
await new Promise((resolve, reject) => {
|
|
87
|
+
const child = spawn(command, args, {stdio: 'inherit', windowsHide: false});
|
|
88
|
+
child.on('error', reject);
|
|
89
|
+
child.on('exit', code => code === 0 ? resolve() : reject(new Error(`Caliper command registration failed (${code}); application retained at ${root}`)));
|
|
90
|
+
});
|
|
91
|
+
}
|
|
75
92
|
async function install(base = home(), download = get, activate = activateNative) {
|
|
76
93
|
if (!supported.includes(identity)) throw new Error(`No Caliper product bundle for ${identity}. Supported: ${supported.join(', ')}`);
|
|
77
94
|
const parent = path.join(base, 'versions', version, identity);
|
|
@@ -118,5 +135,5 @@ async function install(base = home(), download = get, activate = activateNative)
|
|
|
118
135
|
return root;
|
|
119
136
|
} finally { fs.rmSync(stage, { recursive: true, force: true }); }
|
|
120
137
|
}
|
|
121
|
-
if (require.main === module) install().then(root => console.log(`Caliper ${version} installed: ${root}\nRun caliper from your project directory.`)).catch(error => { console.error(`Caliper installation failed: ${error.message}`); process.exitCode = 1; });
|
|
122
|
-
module.exports = { home, executable, validate, install, identity, version, ensurePrerequisites, activateNative };
|
|
138
|
+
if (require.main === module) install().then(async root => { await registerCommand(root); console.log(`Caliper ${version} installed: ${root}\nRun caliper from your project directory. Reopen your terminal if the command is not found.`); }).catch(error => { console.error(`Caliper installation failed: ${error.message}`); process.exitCode = 1; });
|
|
139
|
+
module.exports = { home, executable, validate, install, identity, version, ensurePrerequisites, activateNative, registerCommand };
|
package/package.json
CHANGED