dsh-my-go 0.1.21 → 0.1.23

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/lib/index.js CHANGED
@@ -42,18 +42,13 @@ async function ensurePresetInstalled() {
42
42
  const dshHome = process.env.DSH_HOME || join(homedir(), '.dsh')
43
43
  const userPresetRoot = join(dshHome, '.agent-presets')
44
44
  const target = join(userPresetRoot, 'dsh-my-go')
45
- try {
46
- await access(target)
47
- return // already installed
48
- } catch {
49
- // not present — install below
50
- }
51
45
  await access(source)
52
46
  await mkdir(userPresetRoot, { recursive: true })
53
- await cp(source, target, { recursive: true })
54
- console.log(`[dsh-my-go] installed agent preset to ${target} restart dsh web if the picker is already open`)
47
+ // Always overwrite to ensure latest preset files after npm update
48
+ await cp(source, target, { recursive: true, force: true })
49
+ console.log(`[dsh-my-go] preset synced to ${target}`)
55
50
  } catch (error) {
56
- console.error(`[dsh-my-go] could not install agent preset: ${String(error)}`)
51
+ console.error(`[dsh-my-go] could not sync preset: ${String(error)}`)
57
52
  }
58
53
  }
59
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-my-go",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "description": "DSH plugin: Sisyphus agent orchestration — star topology, single-line blocking, 7 specialist sub-agents (Hermes/Explore/Librarian/Looker/Hephaestus/Prometheus/Oracle) with per-type model binding, go_work/continue/need_help/forward communication tools, Web UI tree panel and settings.",
5
5
  "author": "daizihan233",
6
6
  "license": "MIT",
@@ -18,40 +18,8 @@ export const name = 'dsh-my-go-broker'
18
18
 
19
19
  export const inject = ['tools', 'subagents', 'systemPrompt', 'llm', 'settings']
20
20
 
21
- import { access, cp, mkdir } from 'node:fs/promises'
22
- import { dirname, join } from 'node:path'
23
- import { fileURLToPath } from 'node:url'
24
- import { homedir } from 'node:os'
25
-
26
21
  const AGENT_TYPES = ['hermes', 'explore', 'librarian', 'looker', 'hephaestus', 'prometheus', 'oracle']
27
22
 
28
- /**
29
- * Install the bundled agent preset into the user preset root once, so the
30
- * "MyGO!!!!! 模式" preset appears in the session picker after `dsh plugin
31
- * add dsh-my-go`. DSH discovers presets only from configured roots
32
- * (~/.dsh/.agent-presets/), never from node_modules, so the npm bundle must
33
- * copy its preset/ directory there. Idempotent: skips when already present.
34
- * Failures are logged and swallowed — the host plugin must keep working even
35
- * when the preset copy is not possible.
36
- */
37
- async function ensurePresetInstalled() {
38
- try {
39
- const here = dirname(fileURLToPath(import.meta.url)) // .../dsh-my-go/preset/tools
40
- const packageRoot = dirname(dirname(here)) // .../dsh-my-go
41
- const source = join(packageRoot, 'preset')
42
- const dshHome = process.env.DSH_HOME || join(homedir(), '.dsh')
43
- const userPresetRoot = join(dshHome, '.agent-presets')
44
- const target = join(userPresetRoot, 'dsh-my-go')
45
- await access(source)
46
- await mkdir(userPresetRoot, { recursive: true })
47
- // Always overwrite to ensure latest preset files after npm update
48
- await cp(source, target, { recursive: true, force: true })
49
- console.log(`[dsh-my-go] preset synced to ${target}`)
50
- } catch (error) {
51
- console.error(`[dsh-my-go] could not sync preset: ${String(error)}`)
52
- }
53
- }
54
-
55
23
  const AGENT_TYPE_PREFIX = 'dsh-my-go:'
56
24
 
57
25
  function agentLabel(type, summary) {
@@ -245,7 +213,10 @@ class Orchestration {
245
213
  }
246
214
 
247
215
  export async function apply(ctx, config = {}) {
248
- void ensurePresetInstalled()
216
+ // NOTE: ensurePresetInstalled runs from lib/index.js (npm package host
217
+ // bundle), not here — when this file loads from the preset copy,
218
+ // import.meta.url points to the copy, not the npm package source.
219
+
249
220
  const orchestration = new Orchestration()
250
221
  const sessionTypes = new Map()
251
222
  let bindings = { ...defaultBindings(), ...(config.bindings ?? {}) }