dsh-gitbash-shell 0.13.0 → 0.13.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/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-external/dsh-gitbash-shell",
3
- "version": "0.12.0",
3
+ "version": "0.13.1",
4
4
  "main": "./src/index.js",
5
5
  "description": "Windows 全模式 Git Bash:用 Git for Windows bash 替换 PowerShell 执行器,并物化 standard/minimal/code/cordis 的 Git Bash 变体 preset。双 era 适配 dsh <= 0.1.1(内置 id 'code')与 >= 0.1.2(改名 'ptc'),启动探测自动选择,preset id 永不变。联动:dsh-ptc-cordis-preset(两者同装时 PTC 创造模式自动物化为 Git Bash 版)+ dsh-better-sidebar(终端 UI 标签与模型 terminal_* 工具自动切到 Git Bash)。",
6
6
  "engines": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-gitbash-shell",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "DSH plugin: run every agent shell command through Git for Windows bash on Windows instead of PowerShell. Replaces the pwsh executor with a Git Bash ctx.shell provider and materializes Git Bash variants of the standard/minimal/code/cordis agent presets into your user preset root at startup. On Windows it also adopts dsh-better-sidebar's terminal shell (UI tabs and the model-facing terminal_* tools) through the sidebar's official settings seam, and pairs with dsh-ptc-cordis-preset so the PTC Creation-mode preset materializes as its Git Bash variant. Ships both composition eras for dsh <= 0.1.1 (built-in preset id 'code') and dsh >= 0.1.2 (renamed id 'ptc') — the era is probed per boot and re-materialized automatically after a dsh upgrade, in either upgrade order; preset ids never change so pinned sessions stay valid.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -41,7 +41,8 @@
41
41
  "LICENSE"
42
42
  ],
43
43
  "scripts": {
44
- "test": "node --test tests/smoke.mjs"
44
+ "test": "node --test tests/smoke.mjs",
45
+ "version": "node -e \"const fs=require('fs');const m=JSON.parse(fs.readFileSync('dsh.plugin.json','utf8'));const v=JSON.parse(fs.readFileSync('package.json','utf8')).version;m.version=v;fs.writeFileSync('dsh.plugin.json',JSON.stringify(m,null,2)+'\\n')\" && git add dsh.plugin.json"
45
46
  },
46
47
  "keywords": [
47
48
  "dsh",
package/src/index.js CHANGED
@@ -205,6 +205,32 @@ export async function detectPersonaEra(agentPresets) {
205
205
  }
206
206
  }
207
207
 
208
+ /**
209
+ * Does the SHIPPED composition already carry the official `present` row? The
210
+ * row (`@deepseek-ai/dsh-tool-present`, immutable file-delivery download
211
+ * cards) first shipped with dsh 0.1.5-alpha.2, and a composition row that
212
+ * cannot be imported rejects the WHOLE preset mount — so the row is injected
213
+ * only on hosts whose own shipped presets have it. The live roster is the
214
+ * authority: package resolution alone would lie on CLI installs (first-party
215
+ * packages live outside the profile) and on linked development trees.
216
+ * `minimal` never gains the row (single-tool preset). Never throws.
217
+ */
218
+ async function detectPresentSupport(agentPresets) {
219
+ try {
220
+ const list = await agentPresets.list()
221
+ const entries = Array.isArray(list) ? list : []
222
+ const entry = ['ptc', 'standard', 'cordis']
223
+ .map((id) => entries.find((p) => p && p.id === id && typeof p.path === 'string'))
224
+ .find(Boolean)
225
+ if (!entry) return false
226
+ const file = /\.yml$/.test(entry.path) ? entry.path : join(entry.path, 'agent.cordis.yml')
227
+ return readFileSync(file, 'utf8').includes("'@deepseek-ai/dsh-tool-present'")
228
+ } catch (error) {
229
+ console.log(`${TAG} present-row probe failed (${error?.message ?? error}) — not injecting the row`)
230
+ return false
231
+ }
232
+ }
233
+
208
234
  /**
209
235
  * Pick the committed composition asset inside one variant directory (pure).
210
236
  * The ptc-era twin is preferred when the roster says `ptc`; the persona-split
@@ -920,7 +946,11 @@ export async function apply(ctx, config = {}) {
920
946
  const skillsSource = await findSkillsSource(ctx.agentPresets)
921
947
  const base = await detectBase(ctx.agentPresets)
922
948
  const persona = await detectPersonaEra(ctx.agentPresets)
923
- const present = await hostHasToolPresent()
949
+ // Two independent signals, either of which is sufficient: the shipped
950
+ // composition text (authoritative on every install layout) and the package
951
+ // resolving from this plugin's own tree (covers hosts where the roster
952
+ // probe is unavailable).
953
+ const present = (await detectPresentSupport(ctx.agentPresets)) || (await hostHasToolPresent())
924
954
  const userRootPath = userRoot.path
925
955
  purgeOrphans(userRootPath, presetIds)
926
956
 
@@ -965,4 +995,4 @@ export async function apply(ctx, config = {}) {
965
995
  }
966
996
 
967
997
  // Test surface: pure helpers, no Cordis context required.
968
- export const _internal = { PRESET_IDS, translateMsysPath, translatePathArguments, readPosixPaths, windowsToMsys, rewriteResultPaths, MARKER_FILE, classify, materialize, cleanupOnDispose, firstUserRoot, hashTree, skillsHashes, syncDecision, installRegisterShim, baseForRoster, detectBase, pickComposition, personaEraForText, detectPersonaEra, injectPresentRow, hostHasToolPresent }
998
+ export const _internal = { PRESET_IDS, translateMsysPath, translatePathArguments, readPosixPaths, windowsToMsys, rewriteResultPaths, MARKER_FILE, classify, materialize, cleanupOnDispose, firstUserRoot, hashTree, skillsHashes, syncDecision, installRegisterShim, baseForRoster, detectBase, pickComposition, personaEraForText, detectPersonaEra, injectPresentRow, hostHasToolPresent, detectPresentSupport }