ghostycode 0.0.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/README.md +51 -0
- package/bin/ghosty-tui.js +8 -0
- package/bin/ghosty.js +8 -0
- package/package.json +56 -0
- package/scripts/artifacts.js +136 -0
- package/scripts/install.js +1178 -0
- package/scripts/preflight-glibc.js +135 -0
- package/scripts/run.js +71 -0
- package/scripts/verify-release-assets.js +140 -0
- package/test/artifacts.test.js +76 -0
- package/test/install.test.js +180 -0
- package/test/postinstall.test.js +157 -0
- package/test/run.test.js +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# ghostycode
|
|
2
|
+
|
|
3
|
+
**Ghosty Code** — agente de código para tu terminal, sobre DeepSeek V4. 👻
|
|
4
|
+
|
|
5
|
+
Instala y corre Ghosty Code desde los binarios precompilados (Rust) publicados en GitHub Releases.
|
|
6
|
+
|
|
7
|
+
## Instalación
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g ghostycode
|
|
11
|
+
# o
|
|
12
|
+
pnpm add -g ghostycode
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Uso local en un proyecto:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install ghostycode
|
|
19
|
+
npx ghostycode --help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
El `postinstall` baja los binarios de tu plataforma a `bin/downloads/` y expone los
|
|
23
|
+
comandos **`ghosty`** y **`ghosty-tui`**. Si los assets del release no están disponibles
|
|
24
|
+
en ese momento, la instalación continúa y el wrapper reintenta la descarga al primer uso.
|
|
25
|
+
|
|
26
|
+
## Primer uso
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
ghosty auth set --provider deepseek --api-key "TU_DEEPSEEK_API_KEY"
|
|
30
|
+
ghosty doctor
|
|
31
|
+
ghosty
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
La config vive en `~/.ghosty/config.toml` (también lee la variable `DEEPSEEK_API_KEY`).
|
|
35
|
+
|
|
36
|
+
## Comandos básicos
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
ghosty # TUI interactiva
|
|
40
|
+
ghosty "explica esta función" # prompt de una sola vez
|
|
41
|
+
ghosty --model auto "arregla el bug" # auto-selecciona modelo + thinking
|
|
42
|
+
ghosty --yolo # auto-aprueba herramientas
|
|
43
|
+
ghosty sessions / resume --last # sesiones guardadas
|
|
44
|
+
ghosty update # actualiza el binario
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Código y documentación: https://github.com/blissito/ghostycode
|
|
48
|
+
|
|
49
|
+
## Licencia
|
|
50
|
+
|
|
51
|
+
MIT
|
package/bin/ghosty.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ghostycode",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"ghostyBinaryVersion": "0.0.1",
|
|
5
|
+
"description": "Ghosty Code \u2014 agentic terminal coding agent",
|
|
6
|
+
"author": "Bliss (blissito)",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"funding": [
|
|
9
|
+
{
|
|
10
|
+
"type": "github",
|
|
11
|
+
"url": "https://github.com/sponsors/blissito"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/blissito/ghostycode",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/blissito/ghostycode.git"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/blissito/ghostycode/issues"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"ghosty",
|
|
24
|
+
"ai",
|
|
25
|
+
"cli",
|
|
26
|
+
"tui",
|
|
27
|
+
"rust",
|
|
28
|
+
"terminal",
|
|
29
|
+
"coding-agent"
|
|
30
|
+
],
|
|
31
|
+
"type": "commonjs",
|
|
32
|
+
"bin": {
|
|
33
|
+
"ghosty": "bin/ghosty.js"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"release:check": "node scripts/verify-release-assets.js",
|
|
37
|
+
"postinstall": "node scripts/install.js --optional",
|
|
38
|
+
"prepublishOnly": "node scripts/verify-release-assets.js",
|
|
39
|
+
"prepack": "node scripts/install.js",
|
|
40
|
+
"test": "node --test test/*.test.js"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"preferGlobal": true,
|
|
49
|
+
"files": [
|
|
50
|
+
"bin/*.js",
|
|
51
|
+
"scripts/*.js",
|
|
52
|
+
"test/*.js",
|
|
53
|
+
"README.md",
|
|
54
|
+
"package.json"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const os = require("os");
|
|
3
|
+
|
|
4
|
+
const CHECKSUM_MANIFEST = "ghosty-artifacts-sha256.txt";
|
|
5
|
+
|
|
6
|
+
const ASSET_MATRIX = {
|
|
7
|
+
linux: {
|
|
8
|
+
x64: ["ghosty-linux-x64", "ghosty-tui-linux-x64"],
|
|
9
|
+
arm64: ["ghosty-linux-arm64", "ghosty-tui-linux-arm64"],
|
|
10
|
+
riscv64: ["ghosty-linux-riscv64", "ghosty-tui-linux-riscv64"],
|
|
11
|
+
},
|
|
12
|
+
darwin: {
|
|
13
|
+
x64: ["ghosty-macos-x64", "ghosty-tui-macos-x64"],
|
|
14
|
+
arm64: ["ghosty-macos-arm64", "ghosty-tui-macos-arm64"],
|
|
15
|
+
},
|
|
16
|
+
win32: {
|
|
17
|
+
x64: ["ghosty-windows-x64.exe", "ghosty-tui-windows-x64.exe", "ghosty.bat"],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// HarmonyPC (openharmony) is an x86_64 Linux-compatible environment; map it to
|
|
22
|
+
// the linux binary family so npm install succeeds without a separate build target.
|
|
23
|
+
const PLATFORM_ALIASES = {
|
|
24
|
+
openharmony: "linux",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function detectBinaryNames() {
|
|
28
|
+
const rawPlatform = os.platform();
|
|
29
|
+
const platform = PLATFORM_ALIASES[rawPlatform] || rawPlatform;
|
|
30
|
+
const arch = os.arch();
|
|
31
|
+
const defaults = ASSET_MATRIX[platform];
|
|
32
|
+
if (!defaults) {
|
|
33
|
+
const supported = Object.keys(ASSET_MATRIX).map(p => `'${p}'`).join(', ');
|
|
34
|
+
throw new Error(
|
|
35
|
+
`Unsupported platform: ${rawPlatform}. Supported platforms: ${supported}.\n\n` +
|
|
36
|
+
unsupportedBuildHint(),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
const pair = defaults[arch];
|
|
40
|
+
if (!pair) {
|
|
41
|
+
const supported = Object.keys(defaults).map(a => `'${a}'`).join(', ');
|
|
42
|
+
throw new Error(
|
|
43
|
+
`Unsupported architecture: ${arch} on platform ${platform}. ` +
|
|
44
|
+
`Supported architectures: ${supported}.\n\n` +
|
|
45
|
+
unsupportedBuildHint(),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
platform,
|
|
50
|
+
arch,
|
|
51
|
+
ghosty: pair[0],
|
|
52
|
+
tui: pair[1],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function unsupportedBuildHint() {
|
|
57
|
+
return [
|
|
58
|
+
"No prebuilt binary is available for this platform/architecture combo.",
|
|
59
|
+
"You can still run ghosty by building from source with Cargo:",
|
|
60
|
+
"",
|
|
61
|
+
" # Requires Rust 1.88+ (https://rustup.rs)",
|
|
62
|
+
" cargo install ghosty-cli --locked # provides `ghosty`",
|
|
63
|
+
" cargo install ghosty-tui --locked # provides `ghosty-tui`",
|
|
64
|
+
"",
|
|
65
|
+
"Or build from a checkout:",
|
|
66
|
+
"",
|
|
67
|
+
" git clone https://github.com/blissito/ghostycode.git",
|
|
68
|
+
" cd Ghosty",
|
|
69
|
+
" cargo install --path crates/cli --locked",
|
|
70
|
+
" cargo install --path crates/tui --locked",
|
|
71
|
+
"",
|
|
72
|
+
"See https://github.com/blissito/ghostycode/blob/main/docs/INSTALL.md",
|
|
73
|
+
"for cross-compilation, mirror, and Linux ARM64 specifics.",
|
|
74
|
+
].join("\n");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function executableName(base, platform) {
|
|
78
|
+
return platform === "win32" ? `${base}.exe` : base;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function releaseBaseUrl(version, repo = "blissito/ghostycode") {
|
|
82
|
+
// GHOSTY_RELEASE_BASE_URL is the canonical override.
|
|
83
|
+
// DEEPSEEK_TUI_RELEASE_BASE_URL / DEEPSEEK_RELEASE_BASE_URL are legacy aliases.
|
|
84
|
+
const override =
|
|
85
|
+
process.env.GHOSTY_RELEASE_BASE_URL ||
|
|
86
|
+
process.env.DEEPSEEK_TUI_RELEASE_BASE_URL ||
|
|
87
|
+
process.env.DEEPSEEK_RELEASE_BASE_URL;
|
|
88
|
+
if (override) {
|
|
89
|
+
const trimmed = String(override).trim();
|
|
90
|
+
return trimmed.endsWith("/") ? trimmed : `${trimmed}/`;
|
|
91
|
+
}
|
|
92
|
+
// When GHOSTY_USE_CNB_MIRROR is set, use the CNB (China-friendly)
|
|
93
|
+
// mirror that already builds and publishes binary release assets.
|
|
94
|
+
if (process.env.GHOSTY_USE_CNB_MIRROR) {
|
|
95
|
+
return `https://cnb.cool/blissito/ghostycode/-/releases/v${version}/`;
|
|
96
|
+
}
|
|
97
|
+
return `https://github.com/${repo}/releases/download/v${version}/`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function releaseAssetUrl(baseName, version, repo = "blissito/ghostycode") {
|
|
101
|
+
return new URL(baseName, releaseBaseUrl(version, repo)).toString();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function checksumManifestUrl(version, repo = "blissito/ghostycode") {
|
|
105
|
+
return releaseAssetUrl(CHECKSUM_MANIFEST, version, repo);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function releaseBinaryDirectory() {
|
|
109
|
+
return path.join(__dirname, "..", "bin", "downloads");
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function allAssetNames() {
|
|
113
|
+
const names = [];
|
|
114
|
+
for (const platformAssets of Object.values(ASSET_MATRIX)) {
|
|
115
|
+
for (const assets of Object.values(platformAssets)) {
|
|
116
|
+
names.push(...assets);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return Array.from(new Set(names));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function allReleaseAssetNames() {
|
|
123
|
+
return [...allAssetNames(), CHECKSUM_MANIFEST];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
module.exports = {
|
|
127
|
+
allAssetNames,
|
|
128
|
+
allReleaseAssetNames,
|
|
129
|
+
CHECKSUM_MANIFEST,
|
|
130
|
+
checksumManifestUrl,
|
|
131
|
+
detectBinaryNames,
|
|
132
|
+
executableName,
|
|
133
|
+
releaseAssetUrl,
|
|
134
|
+
releaseBaseUrl,
|
|
135
|
+
releaseBinaryDirectory,
|
|
136
|
+
};
|