@giovannijecha/jecode 0.0.0-stage → 0.1.0

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Giovanni Jecha
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,38 @@
1
- # Temporary Holding Version
1
+ # Jecode
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Jecode is a terminal coding agent. It runs as a native Rust executable and lets
4
+ you work with an AI model on files and commands in your project.
5
+
6
+ Install Jecode with Node.js 22 or later and npm:
7
+
8
+ ```sh
9
+ npm install -g @giovannijecha/jecode
10
+ jecode --version
11
+ ```
12
+
13
+ The npm package supports Windows x64, Linux x64 with glibc 2.39 or newer, and
14
+ macOS on Apple silicon (verified on macOS 15). Earlier macOS versions remain
15
+ unverified. It includes the platform executables; it does not build code or fetch
16
+ a binary when you first run it. Node.js starts the npm command. A standalone
17
+ build of Jecode does not need Node.js.
18
+
19
+ Update the npm installation with:
20
+
21
+ ```sh
22
+ npm update -g @giovannijecha/jecode
23
+ ```
24
+
25
+ Remove it with:
26
+
27
+ ```sh
28
+ npm uninstall -g @giovannijecha/jecode
29
+ ```
30
+
31
+ Removing the package keeps your settings, accounts, conversations, and
32
+ checkpoints in `~/.jecode/` or your `JECODE_HOME` directory. If you previously
33
+ installed Jecode from source, check which `jecode` command appears first on
34
+ `PATH`; npm does not remove that separate installation.
35
+
36
+ See the [installation guide](https://github.com/giovannijecha/jecode/blob/main/docs/usage/INSTALLATION.md)
37
+ for source installation and troubleshooting, and the [command-line guide](https://github.com/giovannijecha/jecode/blob/main/docs/usage/CLI.md)
38
+ for usage.
package/bin/jecode.cjs ADDED
@@ -0,0 +1,104 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { spawn } = require('node:child_process');
5
+ const { existsSync } = require('node:fs');
6
+ const { constants } = require('node:os');
7
+ const path = require('node:path');
8
+ const { targetFor } = require('./targets.cjs');
9
+
10
+ function signalExitCode(signal) {
11
+ const number = constants.signals[signal];
12
+ return Number.isInteger(number) ? 128 + number : 1;
13
+ }
14
+
15
+ function glibcMeetsMinimum(version, minimum) {
16
+ if (!/^\d+\.\d+$/.test(version)) return false;
17
+ const [major, minor] = version.split('.').map(Number);
18
+ const [requiredMajor, requiredMinor] = minimum.split('.').map(Number);
19
+ return major > requiredMajor || (major === requiredMajor && minor >= requiredMinor);
20
+ }
21
+
22
+ function launch({
23
+ runtime = process,
24
+ packageRoot = path.resolve(__dirname, '..'),
25
+ spawnChild = spawn,
26
+ binaryExists = existsSync,
27
+ } = {}) {
28
+ const target = targetFor(runtime.platform, runtime.arch);
29
+ if (!target) {
30
+ runtime.stderr.write(
31
+ `jecode: unsupported platform ${runtime.platform}-${runtime.arch}. ` +
32
+ 'Supported: win32-x64, linux-x64, darwin-arm64.\n',
33
+ );
34
+ runtime.exitCode = 1;
35
+ return null;
36
+ }
37
+
38
+ if (runtime.platform === 'linux') {
39
+ let glibc;
40
+ try {
41
+ glibc = runtime.report?.getReport()?.header?.glibcVersionRuntime;
42
+ } catch {
43
+ // An unreadable diagnostic report cannot establish libc compatibility.
44
+ }
45
+ if (typeof glibc !== 'string' || !glibcMeetsMinimum(glibc, target.glibcMinimum)) {
46
+ const detail = glibc ? `glibc ${glibc} is too old or unrecognized` : 'unsupported Linux libc';
47
+ runtime.stderr.write(
48
+ `jecode: ${detail}; requires glibc ${target.glibcMinimum} or newer.\n`,
49
+ );
50
+ runtime.exitCode = 1;
51
+ return null;
52
+ }
53
+ }
54
+
55
+ const executable = path.join(packageRoot, 'native', target.key, target.binary);
56
+ if (!binaryExists(executable)) {
57
+ runtime.stderr.write(
58
+ `jecode: missing native executable for ${target.key}. ` +
59
+ 'Reinstall the npm package and check its contents.\n',
60
+ );
61
+ runtime.exitCode = 1;
62
+ return null;
63
+ }
64
+
65
+ let child;
66
+ try {
67
+ child = spawnChild(executable, runtime.argv.slice(2), {
68
+ stdio: 'inherit',
69
+ shell: false,
70
+ });
71
+ } catch (error) {
72
+ runtime.stderr.write(`jecode: could not start ${target.key}: ${error.message}\n`);
73
+ runtime.exitCode = 1;
74
+ return null;
75
+ }
76
+
77
+ let spawnError = false;
78
+ const onInterrupt = () => {
79
+ // The terminal sends Ctrl+C to the foreground group. The child already
80
+ // receives it; forwarding here could interrupt it twice or kill it on Windows.
81
+ };
82
+ const onTerminate = () => child.kill('SIGTERM');
83
+ const onHangup = () => child.kill('SIGHUP');
84
+ runtime.on('SIGINT', onInterrupt);
85
+ runtime.on('SIGTERM', onTerminate);
86
+ if (runtime.platform !== 'win32') runtime.on('SIGHUP', onHangup);
87
+
88
+ child.on('error', (error) => {
89
+ spawnError = true;
90
+ runtime.stderr.write(`jecode: could not start ${target.key}: ${error.message}\n`);
91
+ runtime.exitCode = 1;
92
+ });
93
+ child.on('close', (code, signal) => {
94
+ runtime.removeListener('SIGINT', onInterrupt);
95
+ runtime.removeListener('SIGTERM', onTerminate);
96
+ if (runtime.platform !== 'win32') runtime.removeListener('SIGHUP', onHangup);
97
+ if (!spawnError) runtime.exitCode = signal ? signalExitCode(signal) : (code ?? 1);
98
+ });
99
+ return child;
100
+ }
101
+
102
+ if (require.main === module) launch();
103
+
104
+ module.exports = { launch, signalExitCode };
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ const targets = Object.freeze({
4
+ 'win32-x64': Object.freeze({
5
+ platform: 'win32',
6
+ arch: 'x64',
7
+ binary: 'jecode.exe',
8
+ identity: 'windows-x86_64',
9
+ }),
10
+ 'linux-x64': Object.freeze({
11
+ platform: 'linux',
12
+ arch: 'x64',
13
+ binary: 'jecode',
14
+ identity: 'linux-x86_64',
15
+ glibcMinimum: '2.39',
16
+ }),
17
+ 'darwin-arm64': Object.freeze({
18
+ platform: 'darwin',
19
+ arch: 'arm64',
20
+ binary: 'jecode',
21
+ identity: 'macos-aarch64',
22
+ }),
23
+ });
24
+
25
+ function targetFor(platform, arch) {
26
+ const key = `${platform}-${arch}`;
27
+ return Object.hasOwn(targets, key) ? { key, ...targets[key] } : null;
28
+ }
29
+
30
+ module.exports = { targets, targetFor };
Binary file
Binary file
@@ -0,0 +1,48 @@
1
+ {
2
+ "format": 1,
3
+ "version": "0.1.0",
4
+ "revision": "aad2da70b03f77114fc36781cd4338e12b725084",
5
+ "artifacts": [
6
+ {
7
+ "format": 1,
8
+ "version": "0.1.0",
9
+ "revision": "aad2da70b03f77114fc36781cd4338e12b725084",
10
+ "sourceClean": true,
11
+ "target": "win32-x64",
12
+ "binary": "jecode.exe",
13
+ "bytes": 10511872,
14
+ "sha256": "238361f504a4e5e7c95228a7427adddcd3c0a0879d60f4c6f25a4c06171826d1"
15
+ },
16
+ {
17
+ "format": 1,
18
+ "version": "0.1.0",
19
+ "revision": "aad2da70b03f77114fc36781cd4338e12b725084",
20
+ "sourceClean": true,
21
+ "target": "linux-x64",
22
+ "binary": "jecode",
23
+ "bytes": 13697232,
24
+ "sha256": "82d0fcb18d4fc453df6d0f08561705b87fabcdb34350d99dd0237ed3ffe3845c",
25
+ "glibcMinimum": "2.39",
26
+ "abiCheckedFiles": [
27
+ "jecode",
28
+ "jecode-clipboard_linux",
29
+ "jecode-http",
30
+ "jecode-openai_crypto",
31
+ "jecode-process_unix",
32
+ "jecode-pty_unix",
33
+ "jecode-shell",
34
+ "jecode-terminal_unix"
35
+ ]
36
+ },
37
+ {
38
+ "format": 1,
39
+ "version": "0.1.0",
40
+ "revision": "aad2da70b03f77114fc36781cd4338e12b725084",
41
+ "sourceClean": true,
42
+ "target": "darwin-arm64",
43
+ "binary": "jecode",
44
+ "bytes": 8323888,
45
+ "sha256": "1cc29f869ffe6d55b2f01fbe485cc73bae49ffa910628be719c9c4ef2da4888d"
46
+ }
47
+ ]
48
+ }
Binary file
package/package.json CHANGED
@@ -1,6 +1,38 @@
1
1
  {
2
2
  "name": "@giovannijecha/jecode",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "A terminal coding agent in Rust",
5
+ "license": "MIT",
6
+ "author": "Giovanni Jecha",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/giovannijecha/jecode.git"
10
+ },
11
+ "homepage": "https://github.com/giovannijecha/jecode#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/giovannijecha/jecode/issues"
14
+ },
15
+ "bin": {
16
+ "jecode": "bin/jecode.cjs"
17
+ },
18
+ "engines": {
19
+ "node": ">=22"
20
+ },
21
+ "os": [
22
+ "win32",
23
+ "linux",
24
+ "darwin"
25
+ ],
26
+ "cpu": [
27
+ "x64",
28
+ "arm64"
29
+ ],
30
+ "files": [
31
+ "bin/",
32
+ "native/"
33
+ ],
34
+ "publishConfig": {
35
+ "access": "public",
36
+ "registry": "https://registry.npmjs.org/"
37
+ }
38
+ }