@cofy-x/dsh-console 0.1.0-alpha.6 → 0.1.0-alpha.7
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 +2 -2
- package/bin/dsh-console.js +18 -5
- package/dist/{chunk-4NKDFR6S.js → chunk-HNDB6HFI.js} +68 -29
- package/dist/dsh/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +32 -19
package/README.md
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
|
-
DSH Console requires Node.js 24 or newer and a working DSH provider configuration.
|
|
9
|
+
DSH Console requires Node.js 24 or newer and a working DSH provider configuration. This release is verified from the npm-default DeepSeek Harness `0.1.1-rc.2` through the current source release `0.1.2-alpha.1`; install DSH normally without pinning the command to a version.
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
npm install --global @deepseek-ai/dsh @cofy-x/dsh-console
|
|
13
13
|
dsh-console --prompt "hello"
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Public Alpha releases
|
|
16
|
+
Public Alpha releases retain prerelease versions while the current published Console remains available through npm's default install path.
|
|
17
17
|
|
|
18
18
|
## Use
|
|
19
19
|
|
package/bin/dsh-console.js
CHANGED
|
@@ -9,11 +9,13 @@
|
|
|
9
9
|
import { existsSync, readFileSync } from 'node:fs';
|
|
10
10
|
import { homedir } from 'node:os';
|
|
11
11
|
import { dirname, join } from 'node:path';
|
|
12
|
-
import { spawnSync } from 'node:child_process';
|
|
13
12
|
import { fileURLToPath } from 'node:url';
|
|
13
|
+
import crossSpawn from 'cross-spawn';
|
|
14
14
|
|
|
15
15
|
const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
16
|
-
const manifest = JSON.parse(
|
|
16
|
+
const manifest = JSON.parse(
|
|
17
|
+
readFileSync(join(packageRoot, 'package.json'), 'utf8'),
|
|
18
|
+
);
|
|
17
19
|
const profile = 'dsh-console';
|
|
18
20
|
const RESTART_EXIT_CODE = 199;
|
|
19
21
|
const forwardedArgs = process.argv.slice(2);
|
|
@@ -40,9 +42,14 @@ const installedManifest = join(
|
|
|
40
42
|
);
|
|
41
43
|
|
|
42
44
|
function run(command, args) {
|
|
43
|
-
const result =
|
|
45
|
+
const result = crossSpawn.sync(command, args, {
|
|
46
|
+
stdio: 'inherit',
|
|
47
|
+
env: process.env,
|
|
48
|
+
});
|
|
44
49
|
if (result.error) {
|
|
45
|
-
process.stderr.write(
|
|
50
|
+
process.stderr.write(
|
|
51
|
+
`dsh-console: unable to run ${command}: ${result.error.message}\n`,
|
|
52
|
+
);
|
|
46
53
|
process.exit(1);
|
|
47
54
|
}
|
|
48
55
|
if (result.signal) process.kill(process.pid, result.signal);
|
|
@@ -54,7 +61,13 @@ if (!existsSync(installedManifest)) {
|
|
|
54
61
|
const packageSpec =
|
|
55
62
|
process.env.DSH_CONSOLE_PACKAGE_SPEC ||
|
|
56
63
|
(localCheckout ? packageRoot : `@cofy-x/dsh-console@${manifest.version}`);
|
|
57
|
-
const status = run('dsh', [
|
|
64
|
+
const status = run('dsh', [
|
|
65
|
+
'plugin',
|
|
66
|
+
'--profile',
|
|
67
|
+
profile,
|
|
68
|
+
'add',
|
|
69
|
+
packageSpec,
|
|
70
|
+
]);
|
|
58
71
|
if (status !== 0) process.exit(status);
|
|
59
72
|
}
|
|
60
73
|
|
|
@@ -6260,7 +6260,7 @@ import { Box as Box25 } from "ink";
|
|
|
6260
6260
|
import { Box as Box21, Text as Text20 } from "ink";
|
|
6261
6261
|
|
|
6262
6262
|
// src/generated/git-commit.ts
|
|
6263
|
-
var GIT_COMMIT_INFO = "
|
|
6263
|
+
var GIT_COMMIT_INFO = "52d0684";
|
|
6264
6264
|
|
|
6265
6265
|
// src/ui/components/dialogs/about-box.tsx
|
|
6266
6266
|
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
@@ -25442,7 +25442,8 @@ function isWithin(root, candidate) {
|
|
|
25442
25442
|
function parseReferences(text) {
|
|
25443
25443
|
const references = [];
|
|
25444
25444
|
for (let index = 0; index < text.length; index += 1) {
|
|
25445
|
-
if (text[index] !== "@" || index > 0 && !/\s/.test(text[index - 1]))
|
|
25445
|
+
if (text[index] !== "@" || index > 0 && !/\s/.test(text[index - 1]))
|
|
25446
|
+
continue;
|
|
25446
25447
|
let cursor = index + 1;
|
|
25447
25448
|
let value = "";
|
|
25448
25449
|
let escaped = false;
|
|
@@ -25452,7 +25453,9 @@ function parseReferences(text) {
|
|
|
25452
25453
|
value += character;
|
|
25453
25454
|
escaped = false;
|
|
25454
25455
|
} else if (character === "\\") {
|
|
25455
|
-
|
|
25456
|
+
const next = text[cursor + 1];
|
|
25457
|
+
if (next !== void 0 && /[,\s;!()[\]{}]/.test(next)) escaped = true;
|
|
25458
|
+
else value += character;
|
|
25456
25459
|
} else if (/[,\s;!?()[\]{}]/.test(character)) {
|
|
25457
25460
|
break;
|
|
25458
25461
|
} else {
|
|
@@ -25470,13 +25473,18 @@ async function resolveReference(value, workspaceRoots, clipboardRoots) {
|
|
|
25470
25473
|
const isAllowedLexically = candidates.some(
|
|
25471
25474
|
(candidate) => workspaceRoots.some((root) => isWithin(root, candidate)) || clipboardRoots.some((root) => isWithin(root, candidate))
|
|
25472
25475
|
);
|
|
25473
|
-
if (!isAllowedLexically)
|
|
25476
|
+
if (!isAllowedLexically)
|
|
25477
|
+
throw new Error(`File reference is outside the workspace: @${value}`);
|
|
25474
25478
|
for (const candidate of candidates) {
|
|
25475
25479
|
try {
|
|
25476
25480
|
const realCandidate = await fs13.realpath(candidate);
|
|
25477
|
-
const workspaceRoot = workspaceRoots.find(
|
|
25481
|
+
const workspaceRoot = workspaceRoots.find(
|
|
25482
|
+
(root) => isWithin(root, realCandidate)
|
|
25483
|
+
);
|
|
25478
25484
|
if (workspaceRoot) return { path: realCandidate, kind: "workspace-file" };
|
|
25479
|
-
const clipboardRoot = clipboardRoots.find(
|
|
25485
|
+
const clipboardRoot = clipboardRoots.find(
|
|
25486
|
+
(root) => isWithin(root, realCandidate)
|
|
25487
|
+
);
|
|
25480
25488
|
if (clipboardRoot) return { path: realCandidate, kind: "clipboard-file" };
|
|
25481
25489
|
throw new Error(`File reference is outside the workspace: @${value}`);
|
|
25482
25490
|
} catch (error) {
|
|
@@ -25492,7 +25500,8 @@ async function collectFiles(candidate, root, signal, output) {
|
|
|
25492
25500
|
const stats = await fs13.lstat(candidate);
|
|
25493
25501
|
if (stats.isSymbolicLink()) return;
|
|
25494
25502
|
if (stats.isFile()) {
|
|
25495
|
-
if (!IMAGE_MEDIA_TYPES.has(path14.extname(candidate).toLowerCase()))
|
|
25503
|
+
if (!IMAGE_MEDIA_TYPES.has(path14.extname(candidate).toLowerCase()))
|
|
25504
|
+
output.push(candidate);
|
|
25496
25505
|
return;
|
|
25497
25506
|
}
|
|
25498
25507
|
if (!stats.isDirectory()) return;
|
|
@@ -25520,23 +25529,33 @@ var WorkspacePromptInputRuntime = class {
|
|
|
25520
25529
|
clipboardImageRoots,
|
|
25521
25530
|
signal
|
|
25522
25531
|
}) {
|
|
25523
|
-
if (this.disposed)
|
|
25532
|
+
if (this.disposed)
|
|
25533
|
+
throw new Error("Prompt input runtime has been disposed.");
|
|
25524
25534
|
throwIfAborted(signal);
|
|
25525
|
-
const roots = await Promise.all(
|
|
25526
|
-
|
|
25527
|
-
|
|
25528
|
-
|
|
25529
|
-
|
|
25530
|
-
|
|
25531
|
-
|
|
25532
|
-
|
|
25533
|
-
|
|
25535
|
+
const roots = await Promise.all(
|
|
25536
|
+
workspaceRoots.map((root) => fs13.realpath(root))
|
|
25537
|
+
);
|
|
25538
|
+
const clipboardRoots = await Promise.all(
|
|
25539
|
+
clipboardImageRoots.map(async (root) => {
|
|
25540
|
+
try {
|
|
25541
|
+
return await fs13.realpath(root);
|
|
25542
|
+
} catch (error) {
|
|
25543
|
+
if (error.code === "ENOENT")
|
|
25544
|
+
return path14.resolve(root);
|
|
25545
|
+
throw error;
|
|
25546
|
+
}
|
|
25547
|
+
})
|
|
25548
|
+
);
|
|
25534
25549
|
const references = parseReferences(text);
|
|
25535
25550
|
const images = /* @__PURE__ */ new Map();
|
|
25536
25551
|
const textFiles = [];
|
|
25537
25552
|
for (const reference of references) {
|
|
25538
25553
|
throwIfAborted(signal);
|
|
25539
|
-
const resolved = await resolveReference(
|
|
25554
|
+
const resolved = await resolveReference(
|
|
25555
|
+
reference.value,
|
|
25556
|
+
roots,
|
|
25557
|
+
clipboardRoots
|
|
25558
|
+
);
|
|
25540
25559
|
if (!resolved) continue;
|
|
25541
25560
|
const stats = await fs13.stat(resolved.path);
|
|
25542
25561
|
const extension = path14.extname(resolved.path).toLowerCase();
|
|
@@ -25551,16 +25570,27 @@ var WorkspacePromptInputRuntime = class {
|
|
|
25551
25570
|
continue;
|
|
25552
25571
|
}
|
|
25553
25572
|
if (stats.isFile() && UNSUPPORTED_ATTACHMENT_EXTENSIONS.has(extension)) {
|
|
25554
|
-
throw new Error(
|
|
25573
|
+
throw new Error(
|
|
25574
|
+
`Unsupported attachment type: ${extension.slice(1) || "binary file"}`
|
|
25575
|
+
);
|
|
25555
25576
|
}
|
|
25556
25577
|
if (resolved.kind === "clipboard-file") {
|
|
25557
|
-
throw new Error(
|
|
25578
|
+
throw new Error(
|
|
25579
|
+
"Clipboard attachments must be PNG, JPEG, WebP, or GIF images."
|
|
25580
|
+
);
|
|
25558
25581
|
}
|
|
25559
|
-
const root = roots.find(
|
|
25560
|
-
|
|
25582
|
+
const root = roots.find(
|
|
25583
|
+
(candidate) => isWithin(candidate, resolved.path)
|
|
25584
|
+
);
|
|
25585
|
+
if (!root)
|
|
25586
|
+
throw new Error(
|
|
25587
|
+
`File reference is outside the workspace: @${reference.value}`
|
|
25588
|
+
);
|
|
25561
25589
|
if (stats.isFile()) {
|
|
25562
25590
|
if (stats.size > MAX_FILE_BYTES) {
|
|
25563
|
-
throw new Error(
|
|
25591
|
+
throw new Error(
|
|
25592
|
+
`Referenced text file is too large: @${reference.value}`
|
|
25593
|
+
);
|
|
25564
25594
|
}
|
|
25565
25595
|
const candidate = await fs13.readFile(resolved.path, { signal });
|
|
25566
25596
|
try {
|
|
@@ -25584,14 +25614,18 @@ var WorkspacePromptInputRuntime = class {
|
|
|
25584
25614
|
cursor = reference.end;
|
|
25585
25615
|
}
|
|
25586
25616
|
appendText(displayContent, text.slice(cursor));
|
|
25587
|
-
if (displayContent.length === 0)
|
|
25588
|
-
|
|
25617
|
+
if (displayContent.length === 0)
|
|
25618
|
+
displayContent.push({ type: "text", text });
|
|
25619
|
+
const uniqueFiles = [
|
|
25620
|
+
...new Map(textFiles.map((entry) => [entry.file, entry])).values()
|
|
25621
|
+
].slice(0, MAX_FILES);
|
|
25589
25622
|
const sections = [];
|
|
25590
25623
|
let totalBytes = 0;
|
|
25591
25624
|
for (const { file, root } of uniqueFiles) {
|
|
25592
25625
|
throwIfAborted(signal);
|
|
25593
25626
|
const stats = await fs13.stat(file);
|
|
25594
|
-
if (stats.size > MAX_FILE_BYTES || totalBytes + stats.size > MAX_TOTAL_BYTES)
|
|
25627
|
+
if (stats.size > MAX_FILE_BYTES || totalBytes + stats.size > MAX_TOTAL_BYTES)
|
|
25628
|
+
continue;
|
|
25595
25629
|
const buffer = await fs13.readFile(file, { signal });
|
|
25596
25630
|
if (buffer.includes(0)) continue;
|
|
25597
25631
|
let content2;
|
|
@@ -25605,13 +25639,18 @@ var WorkspacePromptInputRuntime = class {
|
|
|
25605
25639
|
sections.push(`Content from @${label}:
|
|
25606
25640
|
${content2}`);
|
|
25607
25641
|
}
|
|
25608
|
-
const content = displayContent.map(
|
|
25642
|
+
const content = displayContent.map(
|
|
25643
|
+
(part) => part.type === "text" ? { ...part } : part
|
|
25644
|
+
);
|
|
25609
25645
|
if (sections.length > 0) {
|
|
25610
|
-
appendText(
|
|
25646
|
+
appendText(
|
|
25647
|
+
content,
|
|
25648
|
+
`
|
|
25611
25649
|
|
|
25612
25650
|
${REFERENCE_START}
|
|
25613
25651
|
${sections.join("\n\n")}
|
|
25614
|
-
${REFERENCE_END}`
|
|
25652
|
+
${REFERENCE_END}`
|
|
25653
|
+
);
|
|
25615
25654
|
}
|
|
25616
25655
|
return { content, displayContent };
|
|
25617
25656
|
}
|
package/dist/dsh/index.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cofy-x/dsh-console",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.7",
|
|
4
4
|
"description": "A TypeScript and React/Ink terminal frontend for DeepSeek Harness.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -56,11 +56,13 @@
|
|
|
56
56
|
"dsh": {
|
|
57
57
|
"bundle": {
|
|
58
58
|
"patch": "./cordis.patch.yml"
|
|
59
|
+
},
|
|
60
|
+
"compatibility": {
|
|
61
|
+
"minimum": "0.1.1-rc.2",
|
|
62
|
+
"maximumTested": "0.1.2-alpha.1"
|
|
59
63
|
}
|
|
60
64
|
},
|
|
61
65
|
"dependencies": {
|
|
62
|
-
"@deepseek-ai/dsh-cmdline": "0.1.1-rc.2",
|
|
63
|
-
"@deepseek-ai/schemastery": "3.18.1",
|
|
64
66
|
"@xterm/headless": "^5.5.0",
|
|
65
67
|
"ansi-escapes": "^7.2.0",
|
|
66
68
|
"ansi-regex": "^6.2.2",
|
|
@@ -69,6 +71,7 @@
|
|
|
69
71
|
"clipboardy": "^5.0.2",
|
|
70
72
|
"commander": "^14.0.3",
|
|
71
73
|
"comment-json": "^4.5.0",
|
|
74
|
+
"cross-spawn": "^7.0.6",
|
|
72
75
|
"diff": "^8.0.3",
|
|
73
76
|
"dotenv": "^17.2.3",
|
|
74
77
|
"fdir": "^6.5.0",
|
|
@@ -93,6 +96,7 @@
|
|
|
93
96
|
"@cofy-x/dsh-console-test-utils": "workspace:*",
|
|
94
97
|
"@deepseek-ai/cordis": "4.0.1",
|
|
95
98
|
"@deepseek-ai/cordis-plugin-loader": "1.0.2",
|
|
99
|
+
"@deepseek-ai/dsh-cmdline": "0.1.1-rc.2",
|
|
96
100
|
"@deepseek-ai/dsh-agent": "0.1.1-rc.2",
|
|
97
101
|
"@deepseek-ai/dsh-agent-default-model": "0.1.1-rc.2",
|
|
98
102
|
"@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
|
|
@@ -109,6 +113,7 @@
|
|
|
109
113
|
"@deepseek-ai/dsh-tools": "0.1.1-rc.2",
|
|
110
114
|
"@deepseek-ai/dsh-user-approval": "0.1.1-rc.2",
|
|
111
115
|
"@deepseek-ai/dsh-user-questions": "0.1.1-rc.2",
|
|
116
|
+
"@deepseek-ai/schemastery": "3.18.1",
|
|
112
117
|
"@types/hast": "^3.0.4",
|
|
113
118
|
"@types/node": "^24.10.1",
|
|
114
119
|
"@types/react": "^19.2.18",
|
|
@@ -123,22 +128,24 @@
|
|
|
123
128
|
"peerDependencies": {
|
|
124
129
|
"@deepseek-ai/cordis": ">=4.0.1-rc.1 <5.0.0",
|
|
125
130
|
"@deepseek-ai/cordis-plugin-loader": ">=1.0.2 <2.0.0",
|
|
126
|
-
"@deepseek-ai/dsh-
|
|
127
|
-
"@deepseek-ai/dsh-agent
|
|
128
|
-
"@deepseek-ai/dsh-
|
|
129
|
-
"@deepseek-ai/dsh-
|
|
130
|
-
"@deepseek-ai/dsh-
|
|
131
|
-
"@deepseek-ai/dsh-
|
|
132
|
-
"@deepseek-ai/dsh-
|
|
133
|
-
"@deepseek-ai/dsh-
|
|
134
|
-
"@deepseek-ai/dsh-session
|
|
135
|
-
"@deepseek-ai/dsh-session-
|
|
136
|
-
"@deepseek-ai/dsh-
|
|
137
|
-
"@deepseek-ai/dsh-
|
|
138
|
-
"@deepseek-ai/dsh-
|
|
139
|
-
"@deepseek-ai/dsh-
|
|
140
|
-
"@deepseek-ai/dsh-
|
|
141
|
-
"@deepseek-ai/dsh-user-
|
|
131
|
+
"@deepseek-ai/dsh-cmdline": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
132
|
+
"@deepseek-ai/dsh-agent": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
133
|
+
"@deepseek-ai/dsh-agent-default-model": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
134
|
+
"@deepseek-ai/dsh-attachment": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
135
|
+
"@deepseek-ai/dsh-commands": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
136
|
+
"@deepseek-ai/dsh-credentials": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
137
|
+
"@deepseek-ai/dsh-llm": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
138
|
+
"@deepseek-ai/dsh-permission-presets": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
139
|
+
"@deepseek-ai/dsh-session": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
140
|
+
"@deepseek-ai/dsh-session-projection": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
141
|
+
"@deepseek-ai/dsh-session-query": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
142
|
+
"@deepseek-ai/dsh-settings": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
143
|
+
"@deepseek-ai/dsh-subagent": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
144
|
+
"@deepseek-ai/dsh-tool-todo": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
145
|
+
"@deepseek-ai/dsh-tools": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
146
|
+
"@deepseek-ai/dsh-user-approval": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
147
|
+
"@deepseek-ai/dsh-user-questions": ">=0.1.1-rc.2 <=0.1.2-alpha.1",
|
|
148
|
+
"@deepseek-ai/schemastery": ">=3.18.1 <4.0.0"
|
|
142
149
|
},
|
|
143
150
|
"peerDependenciesMeta": {
|
|
144
151
|
"@deepseek-ai/cordis": {
|
|
@@ -147,6 +154,9 @@
|
|
|
147
154
|
"@deepseek-ai/cordis-plugin-loader": {
|
|
148
155
|
"optional": true
|
|
149
156
|
},
|
|
157
|
+
"@deepseek-ai/dsh-cmdline": {
|
|
158
|
+
"optional": true
|
|
159
|
+
},
|
|
150
160
|
"@deepseek-ai/dsh-agent": {
|
|
151
161
|
"optional": true
|
|
152
162
|
},
|
|
@@ -194,6 +204,9 @@
|
|
|
194
204
|
},
|
|
195
205
|
"@deepseek-ai/dsh-subagent": {
|
|
196
206
|
"optional": true
|
|
207
|
+
},
|
|
208
|
+
"@deepseek-ai/schemastery": {
|
|
209
|
+
"optional": true
|
|
197
210
|
}
|
|
198
211
|
},
|
|
199
212
|
"license": "Apache-2.0",
|