dsh-gitbash-shell 0.38.0 → 0.38.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/CHANGELOG.md +10 -0
- package/dsh.plugin.json +1 -1
- package/package.json +1 -1
- package/src/inline-tools.js +34 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
> 倒序排列,新版本条目在最上面。条目格式:`## vX.Y.Z — YYYY-MM-DD` + 类型(feat / fix / docs / chore)+ 要点 + 相关链接。
|
|
4
4
|
> 纪律见 AGENTS.md「变更记录纪律」:发版前先更新本文件并随版本提交;事故复盘、复现与真机验证记录也记在这里。
|
|
5
5
|
|
|
6
|
+
## v0.38.1 — 2026-10-13
|
|
7
|
+
|
|
8
|
+
**类型**:fix(bash 补位在桌面版宿主解析不到官方包;真机反复确认的最后一个开放问题)。
|
|
9
|
+
|
|
10
|
+
- **根因(无日志下的代码级定位,待真机确认)**:bash 激活的解析通道用的是裸 `createRequire(ctx.baseUrl).resolve('@deepseek-ai/dsh-tool-bash')`——**桌面版宿主把官方包打进 `app.asar`,从插件的 profile 布局裸解析必然失败**(返回空 → 日志 "not resolvable" → bash 永缺)。这也解释了为何同一进程里 deny/pwsh7/gb_* 全部正常(插件自带代码,不依赖该解析)而唯独 bash 缺。
|
|
11
|
+
- **修复:解析通道改为宿主 loader 优先**——`ctx.loader.internal.import(name, ctx.baseUrl, {})`,与宿主挂载行包**完全相同的调用**(`vendor/loader/src/config/tree.ts:122`),走宿主自己的 resolve 钩子(可达 asar 内部);失败才退回裸 createRequire(旧通道,非桌面布局保底)。两通道都失败才如实记日志。
|
|
12
|
+
- `resolveToolBashEntry` 返回形状从 href 字符串改为 `{ load }` 惰性加载器;`activateOfficialBash` 接收 loader 对象;调用点与缓存变量同步更名。
|
|
13
|
+
- **冒烟**:118 项全绿;新增「bash resolution tries the HOST loader before a plain require」(断言通道顺序、官方包名、baseUrl 透传、惰性加载)。
|
|
14
|
+
- **待真机复验**:升级重启后官方模式新建会话,工具面应出现 `bash`;日志应出现 `official bash tool activated for this agent`。
|
|
15
|
+
|
|
6
16
|
## v0.38.0 — 2026-10-13
|
|
7
17
|
|
|
8
18
|
**类型**:feat(设置卡折叠分区;用户反馈「开关堆一列不知道主题」)。
|
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-external/dsh-gitbash-shell",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.1",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"description": "Windows 全模式 Git Bash:用 Git for Windows bash 替换 PowerShell 执行器;官方四个模式经行内工具补位直接获得 Git Bash(v0.35.0,默认),四个 *·Git Bash 变体 preset 可开关;附带 gitbash_pwsh(系统 PowerShell 7)与 gb_* FastCtx 文件工具,检测到 dsh-ops 自动让位。联动:dsh-ptc-cordis-preset(PTC 创造模式带 Git Bash 行且可去重)+ dsh-better-sidebar(终端标签自动切 Git Bash)。",
|
|
6
6
|
"engines": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-gitbash-shell",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.1",
|
|
4
4
|
"description": "Windows 上让 agent 的每条 shell 命令改经 Git for Windows bash 执行;物化四个内置预设的 Git Bash 变体,统一 MSYS 盘根路径方言,侧栏终端接管可开关。· Run every agent shell command through Git for Windows bash on Windows; materialize Git Bash variants of the built-in presets, unify the MSYS drive-root path dialect, and adopt the sidebar terminal behind a switch.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
package/src/inline-tools.js
CHANGED
|
@@ -221,19 +221,40 @@ export function validatePwshArgs(args) {
|
|
|
221
221
|
return undefined
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
+
/** The official bash-tool package the inline patch activates. */
|
|
225
|
+
const TOOL_BASH_PACKAGE = '@deepseek-ai/dsh-tool-bash'
|
|
226
|
+
|
|
224
227
|
/**
|
|
225
|
-
* Resolve the OFFICIAL @deepseek-ai/dsh-tool-bash module
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
+
* Resolve the OFFICIAL @deepseek-ai/dsh-tool-bash module. TWO channels, in
|
|
229
|
+
* order (v0.38.1, the desktop-host field report):
|
|
230
|
+
*
|
|
231
|
+
* ① THE HOST'S OWN LOADER — `ctx.loader.internal.import(name, baseUrl, {})`,
|
|
232
|
+
* the exact call the row mount itself uses
|
|
233
|
+
* (vendor/loader/src/config/tree.ts:122). It runs the host's resolve
|
|
234
|
+
* hooks, so it reaches packages inside the desktop app.asar that a bare
|
|
235
|
+
* Node resolver cannot see from the plugin's profile layout.
|
|
236
|
+
* ② A plain createRequire from the host base — the v0.35.0 channel, kept
|
|
237
|
+
* for layouts where the internal loader is absent.
|
|
238
|
+
*
|
|
239
|
+
* @returns {Promise<{ load: async () => object }|undefined>} a lazy loader for
|
|
240
|
+
* the module, or undefined when neither channel resolves it.
|
|
228
241
|
*/
|
|
229
242
|
export async function resolveToolBashEntry(ctx) {
|
|
243
|
+
try {
|
|
244
|
+
const internal = ctx?.loader?.internal
|
|
245
|
+
if (internal && typeof internal.import === 'function') {
|
|
246
|
+
const mod = await internal.import(TOOL_BASH_PACKAGE, ctx?.baseUrl, {})
|
|
247
|
+
if (mod && typeof mod.apply === 'function') return { load: async () => mod }
|
|
248
|
+
}
|
|
249
|
+
} catch { /* fall through to the plain resolution */ }
|
|
230
250
|
try {
|
|
231
251
|
const { createRequire } = await import('node:module')
|
|
232
252
|
const { pathToFileURL } = await import('node:url')
|
|
233
253
|
const req = createRequire(ctx?.baseUrl ?? import.meta.url)
|
|
234
|
-
|
|
254
|
+
const href = pathToFileURL(req.resolve(TOOL_BASH_PACKAGE)).href
|
|
255
|
+
return { load: async () => import(href) }
|
|
235
256
|
} catch {
|
|
236
|
-
return
|
|
257
|
+
return undefined
|
|
237
258
|
}
|
|
238
259
|
}
|
|
239
260
|
|
|
@@ -245,10 +266,10 @@ export async function resolveToolBashEntry(ctx) {
|
|
|
245
266
|
* prescribes for per-agent variants. The official module is loaded ONCE per
|
|
246
267
|
* process; each agent gets a fresh scope and a fresh apply().
|
|
247
268
|
*/
|
|
248
|
-
export async function activateOfficialBash(agent,
|
|
269
|
+
export async function activateOfficialBash(agent, resolved, createScopeFn, log) {
|
|
249
270
|
let mod
|
|
250
271
|
try {
|
|
251
|
-
mod = await
|
|
272
|
+
mod = await resolved.load()
|
|
252
273
|
} catch (error) {
|
|
253
274
|
log(`official tool-bash module import failed: ${error?.message ?? error}`)
|
|
254
275
|
return undefined
|
|
@@ -294,7 +315,7 @@ export function mountInlineTools(ctx, deps) {
|
|
|
294
315
|
const { tools, agents, createScope, allowed, spawn, pwshPath, echo, log } = deps
|
|
295
316
|
/** agent -> { timer, scope, denyPwsh, pwshScope }; named `tracked` because `agents` above is the host service */
|
|
296
317
|
const tracked = new Map()
|
|
297
|
-
let
|
|
318
|
+
let toolBashResolvePromise
|
|
298
319
|
|
|
299
320
|
const faceNames = (agent) => {
|
|
300
321
|
try {
|
|
@@ -383,13 +404,13 @@ export function mountInlineTools(ctx, deps) {
|
|
|
383
404
|
}
|
|
384
405
|
}
|
|
385
406
|
if (needs.needsBash && !state.scope) {
|
|
386
|
-
if (
|
|
387
|
-
void
|
|
388
|
-
if (
|
|
389
|
-
log('official @deepseek-ai/dsh-tool-bash is not resolvable
|
|
407
|
+
if (toolBashResolvePromise === undefined) toolBashResolvePromise = resolveToolBashEntry(ctx)
|
|
408
|
+
void toolBashResolvePromise.then(async (resolved) => {
|
|
409
|
+
if (!resolved) {
|
|
410
|
+
log('official @deepseek-ai/dsh-tool-bash is not resolvable (neither the host loader nor a plain resolution found it); bash stays absent for this agent')
|
|
390
411
|
return
|
|
391
412
|
}
|
|
392
|
-
const scope = await activateOfficialBash(agent,
|
|
413
|
+
const scope = await activateOfficialBash(agent, resolved, createScope, log)
|
|
393
414
|
if (scope && tracked.get(agent) === state) {
|
|
394
415
|
state.scope = scope
|
|
395
416
|
log('official bash tool activated for this agent (Git Bash host; fake pwsh denied)')
|