dsh-chat-embed 0.6.12 → 0.6.15
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 +104 -51
- package/client.js +1053 -363
- package/index.js +858 -134
- package/package.json +1 -4
- package/tools/shell-patch/shell-patch.cmd +66 -0
- package/tools/shell-patch/shell-patch.command +70 -0
- package/tools/shell-patch/shell-patch.mjs +1260 -0
- package/docs/architecture.md +0 -387
- package/docs/publishing.md +0 -188
- package/restore-shell-patch.cmd +0 -39
- package/tools/shell-patch/clean-cache.ps1 +0 -76
- package/tools/shell-patch/patch-asar.cjs +0 -272
- package/tools/shell-patch/watchdog.ps1 +0 -124
- package//346/270/205/347/220/206/350/201/212/345/244/251/347/274/223/345/255/230.cmd +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-chat-embed",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.15",
|
|
4
4
|
"author": "poluce <fishsummer@126.com>",
|
|
5
5
|
"description": "Multi-tab AI chat embed for the DeepSeek Harness desktop app: DeepSeek, 豆包, ChatGPT, MiniMax, Kimi, Gemini and Grok, each signed in separately.",
|
|
6
6
|
"type": "module",
|
|
@@ -17,10 +17,7 @@
|
|
|
17
17
|
"cordis.patch.yml",
|
|
18
18
|
"locale/*.json",
|
|
19
19
|
"icon.svg",
|
|
20
|
-
"docs",
|
|
21
20
|
"tools/shell-patch",
|
|
22
|
-
"restore-shell-patch.cmd",
|
|
23
|
-
"清理聊天缓存.cmd",
|
|
24
21
|
"README.md",
|
|
25
22
|
"LICENSE"
|
|
26
23
|
],
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
rem shell-patch - turn "logins survive a restart" on or off.
|
|
3
|
+
rem
|
|
4
|
+
rem Double-click this file. It finds a Node binary (DSH ships one, so nothing
|
|
5
|
+
rem needs to be installed), runs the menu, and keeps the window open so the
|
|
6
|
+
rem result can be read.
|
|
7
|
+
rem
|
|
8
|
+
rem Usage: shell-patch.cmd [status|apply|revert] [--resources <dir>]
|
|
9
|
+
rem
|
|
10
|
+
rem Nothing here edits files by itself: shell-patch.mjs does the work and
|
|
11
|
+
rem verifies it. This launcher only locates Node and passes the arguments on.
|
|
12
|
+
rem Everything outside the Node resolution is ASCII on purpose: this file is
|
|
13
|
+
rem read through the console codepage, and a multi-byte character in a comment
|
|
14
|
+
rem is enough to break the batch parser.
|
|
15
|
+
setlocal
|
|
16
|
+
|
|
17
|
+
set "HERE=%~dp0"
|
|
18
|
+
set "SCRIPT=%HERE%shell-patch.mjs"
|
|
19
|
+
if not exist "%SCRIPT%" (
|
|
20
|
+
echo.
|
|
21
|
+
echo [x] shell-patch.mjs not found next to this file.
|
|
22
|
+
echo Expected: %SCRIPT%
|
|
23
|
+
echo.
|
|
24
|
+
pause
|
|
25
|
+
exit /b 1
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
rem --- 1. Node bundled with DSH -------------------------------------------------
|
|
29
|
+
set "NODE="
|
|
30
|
+
if defined DSH_HOME (
|
|
31
|
+
for /d %%R in ("%DSH_HOME%\dsh-runtimes\*") do (
|
|
32
|
+
if exist "%%~fR\dependencies\node\bin\node.exe" set "NODE=%%~fR\dependencies\node\bin\node.exe"
|
|
33
|
+
)
|
|
34
|
+
)
|
|
35
|
+
if not defined NODE (
|
|
36
|
+
for /d %%R in ("%USERPROFILE%\.dsh\dsh-runtimes\*") do (
|
|
37
|
+
if exist "%%~fR\dependencies\node\bin\node.exe" set "NODE=%%~fR\dependencies\node\bin\node.exe"
|
|
38
|
+
)
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
rem --- 2. Node on PATH ----------------------------------------------------------
|
|
42
|
+
if not defined NODE (
|
|
43
|
+
for /f "delims=" %%N in ('where node 2^>nul') do (
|
|
44
|
+
if not defined NODE set "NODE=%%N"
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
rem --- 3. The usual install location --------------------------------------------
|
|
49
|
+
if not defined NODE if exist "%ProgramFiles%\nodejs\node.exe" set "NODE=%ProgramFiles%\nodejs\node.exe"
|
|
50
|
+
|
|
51
|
+
if not defined NODE (
|
|
52
|
+
echo.
|
|
53
|
+
echo [x] No Node binary found.
|
|
54
|
+
echo DSH normally ships one under %%USERPROFILE%%\.dsh\dsh-runtimes
|
|
55
|
+
echo Either start DSH once, or install Node and try again.
|
|
56
|
+
echo.
|
|
57
|
+
pause
|
|
58
|
+
exit /b 1
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
"%NODE%" "%SCRIPT%" %*
|
|
62
|
+
set "CODE=%ERRORLEVEL%"
|
|
63
|
+
echo.
|
|
64
|
+
if not "%CODE%"=="0" echo [exit %CODE%]
|
|
65
|
+
pause
|
|
66
|
+
exit /b %CODE%
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# shell-patch - turn "logins survive a restart" on or off.
|
|
3
|
+
#
|
|
4
|
+
# Double-click this file in Finder (macOS runs it through Terminal). It finds a
|
|
5
|
+
# Node binary, runs the menu, and waits for a keypress so the result can be
|
|
6
|
+
# read.
|
|
7
|
+
#
|
|
8
|
+
# Usage: shell-patch.command [status|apply|revert] [--resources <dir>]
|
|
9
|
+
#
|
|
10
|
+
# Nothing here edits files by itself: shell-patch.mjs does the work and verifies
|
|
11
|
+
# it. This launcher only locates Node and raises the script through admin rights
|
|
12
|
+
# when the app bundle refuses a write.
|
|
13
|
+
|
|
14
|
+
set -u
|
|
15
|
+
|
|
16
|
+
HERE=$(cd "$(dirname "$0")" && pwd)
|
|
17
|
+
SCRIPT="$HERE/shell-patch.mjs"
|
|
18
|
+
|
|
19
|
+
if [ ! -f "$SCRIPT" ]; then
|
|
20
|
+
printf '\n [x] shell-patch.mjs not found next to this file.\n'
|
|
21
|
+
printf ' Expected: %s\n\n' "$SCRIPT"
|
|
22
|
+
printf ' Press enter to close.'
|
|
23
|
+
read -r _
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# --- 1. Node bundled with DSH -------------------------------------------------
|
|
28
|
+
NODE=""
|
|
29
|
+
DSH_ROOT="${DSH_HOME:-$HOME/.dsh}"
|
|
30
|
+
for candidate in "$DSH_ROOT"/dsh-runtimes/*/dependencies/node/bin/node; do
|
|
31
|
+
if [ -x "$candidate" ]; then
|
|
32
|
+
NODE="$candidate"
|
|
33
|
+
break
|
|
34
|
+
fi
|
|
35
|
+
done
|
|
36
|
+
|
|
37
|
+
# --- 2. Node on PATH ----------------------------------------------------------
|
|
38
|
+
if [ -z "$NODE" ]; then
|
|
39
|
+
NODE=$(command -v node 2>/dev/null || true)
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
# --- 3. The usual install locations -------------------------------------------
|
|
43
|
+
if [ -z "$NODE" ]; then
|
|
44
|
+
for candidate in /usr/local/bin/node /opt/homebrew/bin/node /usr/bin/node; do
|
|
45
|
+
if [ -x "$candidate" ]; then
|
|
46
|
+
NODE="$candidate"
|
|
47
|
+
break
|
|
48
|
+
fi
|
|
49
|
+
done
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
if [ -z "$NODE" ]; then
|
|
53
|
+
printf '\n [x] No Node binary found.\n'
|
|
54
|
+
printf ' DSH normally ships one under %s/dsh-runtimes.\n' "$DSH_ROOT"
|
|
55
|
+
printf ' Either start DSH once, or install Node and try again.\n\n'
|
|
56
|
+
printf ' Press enter to close.'
|
|
57
|
+
read -r _
|
|
58
|
+
exit 1
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
"$NODE" "$SCRIPT" "$@"
|
|
62
|
+
CODE=$?
|
|
63
|
+
|
|
64
|
+
printf '\n'
|
|
65
|
+
if [ "$CODE" -ne 0 ]; then
|
|
66
|
+
printf ' [exit %s]\n\n' "$CODE"
|
|
67
|
+
fi
|
|
68
|
+
printf ' Press enter to close.'
|
|
69
|
+
read -r _
|
|
70
|
+
exit "$CODE"
|