@contextzero/nest 0.2.16

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/NOTICE ADDED
@@ -0,0 +1,52 @@
1
+ nest CLI
2
+ Copyright (c) 2024-2026 Carlos Matias Baglieri
3
+
4
+ This software contains code derived from happy-cli
5
+ (https://github.com/slopus/happy-cli), which is licensed
6
+ under the MIT License:
7
+
8
+ ---
9
+
10
+ MIT License
11
+
12
+ Copyright (c) 2024 Kirill Dubovitskiy
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+
32
+ ---
33
+
34
+ The following files/directories are derived from happy-cli:
35
+ - src/api/
36
+ - src/claude/
37
+ - src/codex/
38
+ - src/runner/
39
+ - src/commands/
40
+ - src/ui/
41
+ - src/utils/
42
+ - src/modules/ripgrep/
43
+ - src/modules/difftastic/
44
+ - src/modules/watcher/
45
+ - src/modules/common/registerCommonHandlers.ts
46
+ - src/modules/common/pathSecurity.ts
47
+ - src/parsers/
48
+ - src/configuration.ts
49
+ - src/persistence.ts
50
+ - src/projectPath.ts
51
+ - src/lib.ts
52
+ - src/index.ts
package/bin/annie.cjs ADDED
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Annie CLI launcher. Resolves platform binary from optionalDependency
4
+ * (npm may install it in main package node_modules or as global sibling).
5
+ */
6
+ const { execFileSync, execSync } = require('child_process');
7
+ const path = require('path');
8
+ const fs = require('fs');
9
+
10
+ const platform = process.platform;
11
+ const arch = process.arch;
12
+
13
+ // Resolve main package name from package.json so optional deps match (e.g. @contextzero/nest -> @contextzero/nest-*)
14
+ let mainPkgName = '@ctx0/nest';
15
+ try {
16
+ const pkgPath = path.join(__dirname, '..', 'package.json');
17
+ if (fs.existsSync(pkgPath)) {
18
+ mainPkgName = require(pkgPath).name || mainPkgName;
19
+ }
20
+ } catch (_) {}
21
+ const scope = mainPkgName.startsWith('@') ? mainPkgName.split('/')[0] : '@ctx0';
22
+ const baseName = mainPkgName.startsWith('@') ? mainPkgName.split('/')[1] || 'nest' : mainPkgName;
23
+ const RELEASE_URL = `https://github.com/contextzero/nest/releases`;
24
+
25
+ const platformKey = `${platform}-${arch}`;
26
+ const pkgName = `${scope}/${baseName}-${platformKey}`;
27
+ const binName = platform === 'win32' ? 'nest.exe' : 'nest';
28
+
29
+ function getBinaryPath() {
30
+ const mainRoot = path.resolve(__dirname, '..');
31
+
32
+ const candidates = [
33
+ // 1. Optional dep inside main package (npm install -g @ctx0/nest)
34
+ path.join(mainRoot, 'node_modules', pkgName, 'bin', binName),
35
+ // 2. Sibling under same scope (global: .../node_modules/@ctx0/nest-*)
36
+ path.join(mainRoot, '..', `nest-${platformKey}`, 'bin', binName),
37
+ // 3. Global Unix
38
+ path.join(
39
+ process.env.npm_config_prefix || process.env.PREFIX || '/usr/local',
40
+ 'lib',
41
+ 'node_modules',
42
+ pkgName,
43
+ 'bin',
44
+ binName
45
+ ),
46
+ // 4. Global Windows
47
+ path.join(
48
+ process.env.npm_config_prefix ||
49
+ (process.env.APPDATA ? path.join(process.env.APPDATA, 'npm') : ''),
50
+ 'node_modules',
51
+ pkgName,
52
+ 'bin',
53
+ binName
54
+ ),
55
+ // 5. nvm-style global
56
+ path.join(
57
+ process.env.HOME || '',
58
+ '.nvm', 'versions', 'node',
59
+ 'v' + process.version.split('.')[0].slice(1),
60
+ 'lib', 'node_modules',
61
+ pkgName, 'bin', binName
62
+ ),
63
+ ].filter(Boolean);
64
+
65
+ for (const binPath of candidates) {
66
+ if (fs.existsSync(binPath)) return binPath;
67
+ }
68
+ return null;
69
+ }
70
+
71
+ function main() {
72
+ let binPath = getBinaryPath();
73
+
74
+ if (!binPath) {
75
+ console.log('Platform binary not found. Installing ' + pkgName + '...');
76
+ try {
77
+ execSync(`npm install -g ${pkgName}@latest --force`, { stdio: 'inherit' });
78
+ binPath = getBinaryPath();
79
+ } catch (e) {
80
+ console.error('Install failed. Try: npm install -g ' + mainPkgName + ' ' + pkgName + ' --force');
81
+ console.error('Or download from:', RELEASE_URL);
82
+ process.exit(1);
83
+ }
84
+ }
85
+
86
+ if (!binPath) {
87
+ console.error('Binary still missing. Run: npm install -g ' + mainPkgName + ' ' + pkgName + ' --force');
88
+ process.exit(1);
89
+ }
90
+
91
+ try {
92
+ execFileSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
93
+ } catch (e) {
94
+ process.exit(typeof e.status === 'number' ? e.status : 1);
95
+ }
96
+ }
97
+
98
+ main();
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Postinstall: ensure platform optional dependency is installed so
4
+ * optionalDependencies auto-link works. If the binary is missing, install it
5
+ * into this package's node_modules (npm sometimes skips optional deps).
6
+ */
7
+ const path = require('path');
8
+ const fs = require('fs');
9
+ const { execSync } = require('child_process');
10
+
11
+ const platform = process.platform;
12
+ const arch = process.arch;
13
+ const platformKey = `${platform}-${arch}`;
14
+ const pkgName = `@ctx0/nest-${platformKey}`;
15
+ const binName = platform === 'win32' ? 'nest.exe' : 'nest';
16
+
17
+ const packageRoot = path.resolve(__dirname, '..');
18
+ const binaryPath = path.join(packageRoot, 'node_modules', pkgName, 'bin', binName);
19
+
20
+ if (fs.existsSync(binaryPath)) {
21
+ process.exit(0);
22
+ }
23
+
24
+ let version;
25
+ try {
26
+ const pkgPath = path.join(packageRoot, 'package.json');
27
+ version = require(pkgPath).version;
28
+ } catch (e) {
29
+ process.exit(0);
30
+ }
31
+
32
+ if (!version) process.exit(0);
33
+
34
+ try {
35
+ execSync(`npm install ${pkgName}@${version} --no-save --prefer-offline --no-audit`, {
36
+ cwd: packageRoot,
37
+ stdio: 'inherit',
38
+ });
39
+ } catch (e) {
40
+ // Non-fatal: launcher will prompt or install on first run
41
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@contextzero/nest",
3
+ "version": "0.2.16",
4
+ "description": "NEST CLI - Enterprise AI coding agent control center. Run Claude Code, Codex, Cursor, Gemini, OpenCode locally and control remotely via web.",
5
+ "author": "Carlos Matias Baglieri",
6
+ "license": "AGPL-3.0-only",
7
+ "type": "module",
8
+ "homepage": "https://github.com/Facta-Dev/ctx0_nest_terminal",
9
+ "bugs": "https://github.com/Facta-Dev/ctx0_nest_terminal/issues",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/Facta-Dev/ctx0_nest_terminal.git",
13
+ "directory": "cli"
14
+ },
15
+ "bin": {
16
+ "annie": "bin/annie.cjs"
17
+ },
18
+ "scripts": {
19
+ "postinstall": "node -e \"try{require('fs').chmodSync(require('path').join(__dirname,'bin','annie.cjs'),0o755)}catch(e){}\" && node bin/ensure-platform.cjs"
20
+ },
21
+ "files": [
22
+ "bin/annie.cjs",
23
+ "bin/ensure-platform.cjs",
24
+ "NOTICE",
25
+ "LICENSE",
26
+ "README.md"
27
+ ],
28
+ "optionalDependencies": {
29
+ "@contextzero/nest-darwin-arm64": "0.2.16",
30
+ "@contextzero/nest-darwin-x64": "0.2.16",
31
+ "@contextzero/nest-linux-arm64": "0.2.16",
32
+ "@contextzero/nest-linux-x64": "0.2.16",
33
+ "@contextzero/nest-win32-x64": "0.2.16"
34
+ }
35
+ }