@giovannijecha/jecode 0.0.0-stage → 0.1.1
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 +21 -0
- package/README.md +39 -2
- package/bin/jecode.cjs +104 -0
- package/bin/targets.cjs +30 -0
- package/native/darwin-arm64/jecode +0 -0
- package/native/linux-x64/jecode +0 -0
- package/native/manifest.json +48 -0
- package/native/win32-x64/jecode.exe +0 -0
- package/package.json +36 -4
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,40 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Jecode
|
|
2
2
|
|
|
3
|
-
|
|
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
|
+

|
|
7
|
+
|
|
8
|
+
Install Jecode with Node.js 22 or later and npm:
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install -g @giovannijecha/jecode
|
|
12
|
+
jecode --version
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The npm package supports Windows x64, Linux x64 with glibc 2.39 or newer, and
|
|
16
|
+
macOS on Apple silicon (verified on macOS 15). Earlier macOS versions remain
|
|
17
|
+
unverified. It includes the platform executables; it does not build code or fetch
|
|
18
|
+
a binary when you first run it. Node.js starts the npm command. A standalone
|
|
19
|
+
build of Jecode does not need Node.js.
|
|
20
|
+
|
|
21
|
+
Update the npm installation with:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm update -g @giovannijecha/jecode
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Remove it with:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npm uninstall -g @giovannijecha/jecode
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Removing the package keeps your settings, accounts, conversations, and
|
|
34
|
+
checkpoints in `~/.jecode/` or your `JECODE_HOME` directory. If you previously
|
|
35
|
+
installed Jecode from source, check which `jecode` command appears first on
|
|
36
|
+
`PATH`; npm does not remove that separate installation.
|
|
37
|
+
|
|
38
|
+
See the [installation guide](https://github.com/giovannijecha/jecode/blob/main/docs/usage/INSTALLATION.md)
|
|
39
|
+
for source installation and troubleshooting, and the [command-line guide](https://github.com/giovannijecha/jecode/blob/main/docs/usage/CLI.md)
|
|
40
|
+
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 };
|
package/bin/targets.cjs
ADDED
|
@@ -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.1",
|
|
4
|
+
"revision": "88eed41a3fd300abeb055c4c3003a2527a5cb6ae",
|
|
5
|
+
"artifacts": [
|
|
6
|
+
{
|
|
7
|
+
"format": 1,
|
|
8
|
+
"version": "0.1.1",
|
|
9
|
+
"revision": "88eed41a3fd300abeb055c4c3003a2527a5cb6ae",
|
|
10
|
+
"sourceClean": true,
|
|
11
|
+
"target": "win32-x64",
|
|
12
|
+
"binary": "jecode.exe",
|
|
13
|
+
"bytes": 10546176,
|
|
14
|
+
"sha256": "0f9eae436df40ea070bb9c19772a19f8aa1105af7f213d4f80c691f957aecccc"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"format": 1,
|
|
18
|
+
"version": "0.1.1",
|
|
19
|
+
"revision": "88eed41a3fd300abeb055c4c3003a2527a5cb6ae",
|
|
20
|
+
"sourceClean": true,
|
|
21
|
+
"target": "linux-x64",
|
|
22
|
+
"binary": "jecode",
|
|
23
|
+
"bytes": 13698608,
|
|
24
|
+
"sha256": "53c04df261466e1dfba4189fc7f162a0e66f23334843a819434f9a461ff78e74",
|
|
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.1",
|
|
40
|
+
"revision": "88eed41a3fd300abeb055c4c3003a2527a5cb6ae",
|
|
41
|
+
"sourceClean": true,
|
|
42
|
+
"target": "darwin-arm64",
|
|
43
|
+
"binary": "jecode",
|
|
44
|
+
"bytes": 8342640,
|
|
45
|
+
"sha256": "39a7269f3d75aaf995f64400b1ed4905adf628d221d4fb8a271e0a298009bc6e"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@giovannijecha/jecode",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
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
|
+
}
|