@crazyhappyone/dsh-tui 0.1.0-alpha.5 → 0.1.0-alpha.50
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/CHANGELOG.md +49 -0
- package/README.i18n.yaml +2 -2
- package/README.md +137 -20
- package/README.zh.md +135 -19
- package/assets/screenshots/dsh-tui-hello.png +0 -0
- package/assets/screenshots/dsh-tui-settings.png +0 -0
- package/bin/dsh-tui.js +18 -3
- package/cordis.patch.yml +116 -22
- package/dist/index.js +70216 -47186
- package/dist/schedule.js +36041 -0
- package/dist/settings.js +961 -0
- package/dist/startup.js +16 -11
- package/dist/zen-proxy.js +1048 -0
- package/package.json +82 -8
- package/presets/base-disable.patch.yml +82 -0
- package/presets/cordis.patch.yml +136 -0
- package/presets/minimal.patch.yml +78 -0
- package/presets/ptc.patch.yml +134 -0
- package/presets/registry.patch.yml +12 -0
- package/presets/standard.patch.yml +128 -0
- package/src/launcher.js +209 -75
- package/assets/screenshots/dsh-tui-home.png +0 -0
- package/tui/README.md +0 -126
- package/tui/README.zh.md +0 -126
- package/tui/cordis.patch.yml +0 -73
package/bin/dsh-tui.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/** Command-line entry for the dsh-tui source-runtime launcher. */
|
|
3
3
|
|
|
4
|
-
import { lstatSync, mkdirSync, readFileSync
|
|
4
|
+
import { lstatSync, mkdirSync, readFileSync } from 'node:fs'
|
|
5
5
|
import { constants, homedir } from 'node:os'
|
|
6
6
|
import { fileURLToPath } from 'node:url'
|
|
7
7
|
import { spawnSync } from 'node:child_process'
|
|
8
|
+
import { createRequire } from 'node:module'
|
|
9
|
+
import { join } from 'node:path'
|
|
8
10
|
import { parseLauncherInvocation, resolveLauncherSettings, runLauncher } from '../src/launcher.js'
|
|
9
11
|
|
|
10
12
|
function inspectPath(path) {
|
|
@@ -28,7 +30,11 @@ function run(command, args, options = {}) {
|
|
|
28
30
|
env: process.env,
|
|
29
31
|
maxBuffer: capture ? 16 * 1024 * 1024 : undefined,
|
|
30
32
|
shell: false,
|
|
31
|
-
|
|
33
|
+
timeout: options.timeoutMs,
|
|
34
|
+
killSignal: 'SIGKILL',
|
|
35
|
+
stdio: options.stdio === 'inherit' ? 'inherit'
|
|
36
|
+
: options.stdio === 'output' ? ['ignore', 'inherit', 'inherit']
|
|
37
|
+
: capture ? ['ignore', 'pipe', 'pipe'] : 'inherit',
|
|
32
38
|
})
|
|
33
39
|
if (result.error !== undefined) {
|
|
34
40
|
return { status: 1, stdout: '', stderr: result.error.message }
|
|
@@ -61,10 +67,19 @@ try {
|
|
|
61
67
|
packageVersion: manifest.version,
|
|
62
68
|
env: process.env,
|
|
63
69
|
adapters: {
|
|
70
|
+
nodeExecutable: process.execPath,
|
|
71
|
+
currentDirectory: process.cwd(),
|
|
72
|
+
resolveDshPackage(directory) {
|
|
73
|
+
try {
|
|
74
|
+
return createRequire(join(directory, 'package.json')).resolve('@deepseek-ai/dsh/package.json')
|
|
75
|
+
} catch (error) {
|
|
76
|
+
if (error.code === 'MODULE_NOT_FOUND') return undefined
|
|
77
|
+
throw error
|
|
78
|
+
}
|
|
79
|
+
},
|
|
64
80
|
inspectPath,
|
|
65
81
|
makeDirectory: path => mkdirSync(path, { recursive: true, mode: 0o700 }),
|
|
66
82
|
readText: path => readFileSync(path, 'utf8'),
|
|
67
|
-
writeText: (path, content) => writeFileSync(path, content, 'utf8'),
|
|
68
83
|
run,
|
|
69
84
|
writeOut: text => process.stdout.write(text),
|
|
70
85
|
writeError: text => process.stderr.write(text),
|
package/cordis.patch.yml
CHANGED
|
@@ -1,30 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# yaml-language-server: $schema=none
|
|
2
|
+
# The dsh-tui bundle layer: a terminal surface over @deepseek-ai/dsh-base.
|
|
2
3
|
# It mounts no Host, HTTP server, Web runtime, or browser plugin. An ordinary
|
|
3
|
-
# provider plugin parses --resume/--cwd and the task positional
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
4
|
+
# provider plugin parses --resume/--cwd and the task positional; the terminal
|
|
5
|
+
# driver then creates an Agent through the core registry. The UI displays one
|
|
6
|
+
# Session; scheduled reminders can activate other Sessions in the same process.
|
|
7
|
+
#
|
|
8
|
+
# Install it as a bundle so user settings (written to the profile layer)
|
|
9
|
+
# apply after this layer:
|
|
10
|
+
# dsh plugin --profile tui add @crazyhappyone/dsh-tui
|
|
11
|
+
# dsh --profile tui
|
|
12
|
+
# Rows target the dsh 0.2 Loader and name plugins through this package's
|
|
13
|
+
# exports, so profile-layer edits record a portable row name.
|
|
8
14
|
|
|
15
|
+
# The working directory reaches the model through the runtime-context
|
|
16
|
+
# message; dsh 0.2.1 registers no cwd prompt variable.
|
|
9
17
|
- id: system-prompt
|
|
10
18
|
config:
|
|
11
|
-
|
|
12
|
-
You are a coding agent powered by the {{model}} model.
|
|
13
|
-
You are interacting with the user through the
|
|
19
|
+
personaPrefix: >-
|
|
20
|
+
You are a coding agent powered by the {{model}} model.
|
|
21
|
+
You are interacting with the user through the dsh-tui
|
|
22
|
+
terminal interface.
|
|
14
23
|
|
|
15
|
-
#
|
|
16
|
-
#
|
|
24
|
+
# HMR stays disabled. Profile and home patch edits apply on the next
|
|
25
|
+
# process start; /reload restarts the terminal with the current session.
|
|
17
26
|
- id: hmr
|
|
18
27
|
disabled: true
|
|
19
28
|
|
|
20
29
|
- id: tools
|
|
21
30
|
config:
|
|
22
31
|
# Keep the same temporary process-wide Code Mode opt-in as the Web surface.
|
|
23
|
-
mode:
|
|
24
|
-
|
|
25
|
-
- id: approval
|
|
26
|
-
config:
|
|
27
|
-
policy: !!js "(process.env.DSH_PERMISSION_MODE ?? 'workspace-write') === 'danger-full-access' ? 'never' : 'ask'"
|
|
32
|
+
mode: native
|
|
28
33
|
|
|
29
34
|
# Full-text session search stays disabled until the first Ctrl+K search (the
|
|
30
35
|
# base row's `openAt: never`). The TUI has no browser-latency concern, so the
|
|
@@ -34,23 +39,107 @@
|
|
|
34
39
|
path: ':memory:'
|
|
35
40
|
openAt: first-search
|
|
36
41
|
|
|
42
|
+
# The first-prompt title gets the whole first prompt, not the base 4 KiB.
|
|
43
|
+
- id: session-title-llm
|
|
44
|
+
config:
|
|
45
|
+
targetWords: 5
|
|
46
|
+
targetCjkCharacters: 10
|
|
47
|
+
maxInputBytes: 16384
|
|
48
|
+
maxOutputTokens: 64
|
|
49
|
+
timeoutMs: 60000
|
|
50
|
+
|
|
37
51
|
- insert:
|
|
52
|
+
# Official task storage/runtime over the terminal's shared cold-Session
|
|
53
|
+
# activation owner. No browser Session API or upload transport is mounted.
|
|
54
|
+
- id: schedule
|
|
55
|
+
name: '@crazyhappyone/dsh-tui/schedule'
|
|
56
|
+
|
|
57
|
+
- id: tool-schedule
|
|
58
|
+
name: '@deepseek-ai/dsh-tool-schedule'
|
|
59
|
+
|
|
60
|
+
# Durable current-time context uses the process time zone and refreshes
|
|
61
|
+
# at most once per ten minutes, matching the official provider defaults.
|
|
62
|
+
- id: time-context
|
|
63
|
+
name: '@deepseek-ai/dsh-time-context'
|
|
64
|
+
config:
|
|
65
|
+
refreshIntervalMs: 600000
|
|
66
|
+
|
|
67
|
+
# Explicit file deliveries stay in the owning Session log.
|
|
68
|
+
- id: tool-present
|
|
69
|
+
name: '@deepseek-ai/dsh-tool-present'
|
|
70
|
+
config:
|
|
71
|
+
maxFiles: 8
|
|
72
|
+
|
|
73
|
+
# Per-round token/duration stats for the terminal status line.
|
|
74
|
+
- id: session-stats
|
|
75
|
+
name: "@deepseek-ai/dsh-session-stats"
|
|
76
|
+
|
|
77
|
+
# Base owns the shared storage/domain/projection-cache stack. This layer
|
|
78
|
+
# contributes only the TUI-facing feedback consumer over that stack.
|
|
79
|
+
- id: message-feedback
|
|
80
|
+
name: "@deepseek-ai/dsh-message-feedback"
|
|
81
|
+
config:
|
|
82
|
+
maxNoteBytes: 8192
|
|
83
|
+
|
|
84
|
+
- id: tool-ask-user
|
|
85
|
+
name: "@deepseek-ai/dsh-tool-ask-user"
|
|
86
|
+
|
|
38
87
|
- id: tui-startup
|
|
39
|
-
name: "
|
|
88
|
+
name: "@crazyhappyone/dsh-tui/startup"
|
|
89
|
+
|
|
90
|
+
# TUI presentation preferences (locale, Enter behavior, notifications,
|
|
91
|
+
# scrollbar, thinking visibility). Every field is volatile, so /settings
|
|
92
|
+
# edits land in the profile layer and apply without a remount.
|
|
93
|
+
- id: tui
|
|
94
|
+
name: "@crazyhappyone/dsh-tui/settings"
|
|
95
|
+
|
|
96
|
+
# In-process OpenCode Zen header proxy (vendored from
|
|
97
|
+
# zhangyang-crazy-one/dsh-zen-proxy, MIT). Listens on localhost
|
|
98
|
+
# only; point an opencode provider baseURL at
|
|
99
|
+
# http://127.0.0.1:4097/v1 to reach the Zen free tier.
|
|
100
|
+
# Remove this row to disable the listener.
|
|
101
|
+
- id: zen-proxy
|
|
102
|
+
name: "@crazyhappyone/dsh-tui/zen-proxy"
|
|
103
|
+
config:
|
|
104
|
+
host: 127.0.0.1
|
|
105
|
+
port: 4097
|
|
106
|
+
|
|
107
|
+
# Loopback route carrier for the DeepSeek account browser callback
|
|
108
|
+
# (/login). Port 0 takes a free port from the OS; pin a port here when
|
|
109
|
+
# an SSH session forwards it. Only routes registered by mounted plugins
|
|
110
|
+
# are served, and the address must stay a loopback literal.
|
|
111
|
+
- id: webserver
|
|
112
|
+
name: '@deepseek-ai/dsh-host-webserver'
|
|
113
|
+
config:
|
|
114
|
+
host: 127.0.0.1
|
|
115
|
+
port: 0
|
|
116
|
+
|
|
117
|
+
# Records each top-level turn's changed files from git working-tree
|
|
118
|
+
# snapshots; the TUI projects a bounded transcript card from Host
|
|
119
|
+
# summaries. Bounds match the plugin Config defaults.
|
|
120
|
+
- id: workspace-changes
|
|
121
|
+
name: '@deepseek-ai/dsh-workspace-changes'
|
|
122
|
+
config:
|
|
123
|
+
timeoutMs: 30000
|
|
124
|
+
outputMaxBytes: 8388608
|
|
125
|
+
maxFiles: 500
|
|
126
|
+
maxFileBytes: 2097152
|
|
127
|
+
diffTimeoutMs: 100
|
|
40
128
|
|
|
41
129
|
# Reads its task from the ordinary tuiStartup provider.
|
|
42
130
|
- id: tui-runtime
|
|
43
|
-
name: "
|
|
131
|
+
name: "@crazyhappyone/dsh-tui/runtime"
|
|
44
132
|
inject: [tuiStartup]
|
|
45
133
|
config:
|
|
46
134
|
task: !!js ctx.tuiStartup.task
|
|
47
135
|
resume: !!js ctx.tuiStartup.resume
|
|
48
136
|
cwd: !!js ctx.tuiStartup.cwd
|
|
137
|
+
model: !!js ctx.tuiStartup.model
|
|
49
138
|
frameStats: !!js ctx.tuiStartup.frameStats
|
|
50
|
-
# Render policy (overscan
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
139
|
+
# Render policy (overscan, stream pacing, scroll pacing, cache).
|
|
140
|
+
# The values mirror the runtime Config schema defaults so the
|
|
141
|
+
# deployment layer owns the tunables; override in the profile patch
|
|
142
|
+
# to retune without touching the plugin.
|
|
54
143
|
renderPolicy:
|
|
55
144
|
transcriptOverscan: 16
|
|
56
145
|
stream:
|
|
@@ -71,3 +160,8 @@
|
|
|
71
160
|
cache:
|
|
72
161
|
maxRows: 4096
|
|
73
162
|
maxBytes: 4194304
|
|
163
|
+
|
|
164
|
+
# Terminal marketplace catalog uses the Host service; installs retain plugin-manager approval.
|
|
165
|
+
- insert:
|
|
166
|
+
- id: plugin-market
|
|
167
|
+
name: "@deepseek-ai/dsh-plugin-market"
|