@hermenics/deepseek-code 0.9.0 → 0.10.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/README.md +28 -2
- package/dist/cli.mjs +562 -494
- package/dist/deepseek.mjs +10 -27
- package/dist/runtime.bunfig.toml +1 -0
- package/dist/runtime.mjs +31 -0
- package/package.json +3 -2
package/dist/deepseek.mjs
CHANGED
|
@@ -1,31 +1,14 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from 'node:child_process'
|
|
3
3
|
import { dirname, join } from 'node:path'
|
|
4
4
|
import { fileURLToPath } from 'node:url'
|
|
5
|
+
import { constants } from 'node:os'
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
process.
|
|
7
|
+
const dir = dirname(fileURLToPath(import.meta.url))
|
|
8
|
+
const config = join(dir, 'runtime.bunfig.toml')
|
|
9
|
+
const child = spawn('bun', ['--env-file=' + config, '--config=' + config, join(dir, 'runtime.mjs'), ...process.argv.slice(2)], { stdio: 'inherit' })
|
|
10
|
+
for (const signal of ['SIGINT', 'SIGTERM', ...(process.platform === 'win32' ? [] : ['SIGHUP'])]) {
|
|
11
|
+
process.on(signal, () => { if (!child.killed) child.kill(signal) })
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
console.error(`DeepSeek Code requires Bun 1.1+ (found ${version}).`)
|
|
15
|
-
process.exit(1)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Restore the terminal on every exit path, even when the app dies without
|
|
19
|
-
// running its own cleanup. (SIGKILL cannot be intercepted on any platform.)
|
|
20
|
-
// No signal listeners here: registering one cancels the signal's default exit,
|
|
21
|
-
// so a SIGHUP/SIGTERM would only restore and leave the process running forever.
|
|
22
|
-
// The app itself turns SIGINT/SIGTERM/SIGHUP into a clean exit.
|
|
23
|
-
const restore = () => {
|
|
24
|
-
// The terminal may already be gone (EIO); exiting must not fail on it.
|
|
25
|
-
try {
|
|
26
|
-
if (process.stdout.isTTY) process.stdout.write('\u001b[?1000l\u001b[?1002l\u001b[?1003l\u001b[?25h')
|
|
27
|
-
} catch {}
|
|
28
|
-
}
|
|
29
|
-
process.on('exit', restore)
|
|
30
|
-
|
|
31
|
-
await import(join(dirname(fileURLToPath(import.meta.url)), 'cli.mjs'))
|
|
13
|
+
child.on('error', error => { console.error(error.message); process.exitCode = 1 })
|
|
14
|
+
child.on('exit', (code, signal) => { process.exitCode = code ?? (signal ? 128 + constants.signals[signal] : 1) })
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Empty Bun config and env file for the published CLI.
|
package/dist/runtime.mjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// DeepSeek Code runtime — runs on Linux, macOS and Windows.
|
|
3
|
+
import { dirname, join } from 'node:path'
|
|
4
|
+
import { fileURLToPath } from 'node:url'
|
|
5
|
+
|
|
6
|
+
const MIN_BUN = [1, 1]
|
|
7
|
+
const version = typeof Bun !== 'undefined' ? Bun.version : undefined
|
|
8
|
+
if (!version) {
|
|
9
|
+
console.error('DeepSeek Code requires Bun 1.1+ at runtime. Install Bun: https://bun.sh')
|
|
10
|
+
process.exit(1)
|
|
11
|
+
}
|
|
12
|
+
const [major = 0, minor = 0] = version.split('.').map(Number)
|
|
13
|
+
if (major < MIN_BUN[0] || (major === MIN_BUN[0] && minor < MIN_BUN[1])) {
|
|
14
|
+
console.error(`DeepSeek Code requires Bun 1.1+ (found ${version}).`)
|
|
15
|
+
process.exit(1)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Restore the terminal on every exit path, even when the app dies without
|
|
19
|
+
// running its own cleanup. (SIGKILL cannot be intercepted on any platform.)
|
|
20
|
+
// No signal listeners here: registering one cancels the signal's default exit,
|
|
21
|
+
// so a SIGHUP/SIGTERM would only restore and leave the process running forever.
|
|
22
|
+
// The app itself turns SIGINT/SIGTERM/SIGHUP into a clean exit.
|
|
23
|
+
const restore = () => {
|
|
24
|
+
// The terminal may already be gone (EIO); exiting must not fail on it.
|
|
25
|
+
try {
|
|
26
|
+
if (process.stdout.isTTY) process.stdout.write('\u001b[?1000l\u001b[?1002l\u001b[?1003l\u001b[?25h')
|
|
27
|
+
} catch {}
|
|
28
|
+
}
|
|
29
|
+
process.on('exit', restore)
|
|
30
|
+
|
|
31
|
+
await import(join(dirname(fileURLToPath(import.meta.url)), 'cli.mjs'))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hermenics/deepseek-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "An AI-powered coding assistant that lives in your terminal",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
35
|
-
"bun": ">=1.1"
|
|
35
|
+
"bun": ">=1.1",
|
|
36
|
+
"node": ">=18"
|
|
36
37
|
},
|
|
37
38
|
"scripts": {
|
|
38
39
|
"start": "NODE_ENV=development bun src/index.tsx",
|