dsh-my-go 0.1.0 → 0.1.2
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/LICENSE +21 -21
- package/dist/client.core.js +11 -0
- package/dist/client.js +11 -0
- package/lib/index.js +38 -0
- package/package.json +5 -3
- package/preset/tools/broker.mjs +38 -0
- package/src/client.js +6 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 KuoHu
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KuoHu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/client.core.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name2 in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/client.js
|
|
@@ -25,6 +35,7 @@ __export(client_exports, {
|
|
|
25
35
|
name: () => name
|
|
26
36
|
});
|
|
27
37
|
module.exports = __toCommonJS(client_exports);
|
|
38
|
+
var React = __toESM(require("react"), 1);
|
|
28
39
|
var name = "dsh-my-go";
|
|
29
40
|
var inject = ["slots"];
|
|
30
41
|
function apply(ctx) {
|
package/dist/client.js
CHANGED
|
@@ -4,9 +4,11 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
"use strict";
|
|
7
|
+
var __create = Object.create;
|
|
7
8
|
var __defProp = Object.defineProperty;
|
|
8
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
10
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
12
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
13
|
var __export = (target, all) => {
|
|
12
14
|
for (var name2 in all)
|
|
@@ -20,6 +22,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
20
22
|
}
|
|
21
23
|
return to;
|
|
22
24
|
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
30
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
31
|
+
mod
|
|
32
|
+
));
|
|
23
33
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
34
|
|
|
25
35
|
// src/client.js
|
|
@@ -30,6 +40,7 @@ __export(client_exports, {
|
|
|
30
40
|
name: () => name
|
|
31
41
|
});
|
|
32
42
|
module.exports = __toCommonJS(client_exports);
|
|
43
|
+
var React = __toESM(require("react"), 1);
|
|
33
44
|
var name = "dsh-my-go";
|
|
34
45
|
var inject = ["slots"];
|
|
35
46
|
function apply(ctx) {
|
package/lib/index.js
CHANGED
|
@@ -18,8 +18,45 @@ export const name = 'dsh-my-go'
|
|
|
18
18
|
|
|
19
19
|
export const inject = ['tools', 'subagents', 'systemPrompt']
|
|
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
|
+
|
|
21
26
|
const AGENT_TYPES = ['hermes', 'explore', 'librarian', 'looker', 'hephaestus', 'prometheus', 'oracle']
|
|
22
27
|
|
|
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/lib
|
|
40
|
+
const packageRoot = 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
|
+
try {
|
|
46
|
+
await access(target)
|
|
47
|
+
return // already installed
|
|
48
|
+
} catch {
|
|
49
|
+
// not present — install below
|
|
50
|
+
}
|
|
51
|
+
await access(source)
|
|
52
|
+
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`)
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.error(`[dsh-my-go] could not install agent preset: ${String(error)}`)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
23
60
|
const AGENT_TYPE_PREFIX = 'dsh-my-go:'
|
|
24
61
|
|
|
25
62
|
function agentLabel(type, summary) {
|
|
@@ -213,6 +250,7 @@ class Orchestration {
|
|
|
213
250
|
}
|
|
214
251
|
|
|
215
252
|
export async function apply(ctx, config = {}) {
|
|
253
|
+
void ensurePresetInstalled()
|
|
216
254
|
const orchestration = new Orchestration()
|
|
217
255
|
const sessionTypes = new Map()
|
|
218
256
|
let bindings = { ...defaultBindings(), ...(config.bindings ?? {}) }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-my-go",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"client": {
|
|
35
35
|
"platform": "web",
|
|
36
36
|
"immediately": true,
|
|
37
|
-
"inject": ["@deepseek-ai/dsh-client-runtime", "@deepseek-ai/dsh-client-ui-slots"]
|
|
37
|
+
"inject": ["@deepseek-ai/dsh-client-runtime", "@deepseek-ai/dsh-client-locale", "@deepseek-ai/dsh-client-ui-settings", "@deepseek-ai/dsh-client-ui-slots"]
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -45,6 +45,8 @@
|
|
|
45
45
|
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
|
|
46
46
|
"@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
|
|
47
47
|
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.6",
|
|
48
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.6",
|
|
49
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.6",
|
|
48
50
|
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
|
|
49
51
|
"react": "^18.2.0"
|
|
50
52
|
},
|
|
@@ -60,4 +62,4 @@
|
|
|
60
62
|
"esbuild": "^0.28.2",
|
|
61
63
|
"typescript": "^5.6.0"
|
|
62
64
|
}
|
|
63
|
-
}
|
|
65
|
+
}
|
package/preset/tools/broker.mjs
CHANGED
|
@@ -18,8 +18,45 @@ export const name = 'dsh-my-go-broker'
|
|
|
18
18
|
|
|
19
19
|
export const inject = ['tools', 'subagents', 'systemPrompt']
|
|
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
|
+
|
|
21
26
|
const AGENT_TYPES = ['hermes', 'explore', 'librarian', 'looker', 'hephaestus', 'prometheus', 'oracle']
|
|
22
27
|
|
|
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/lib
|
|
40
|
+
const packageRoot = 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
|
+
try {
|
|
46
|
+
await access(target)
|
|
47
|
+
return // already installed
|
|
48
|
+
} catch {
|
|
49
|
+
// not present — install below
|
|
50
|
+
}
|
|
51
|
+
await access(source)
|
|
52
|
+
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`)
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.error(`[dsh-my-go] could not install agent preset: ${String(error)}`)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
23
60
|
const AGENT_TYPE_PREFIX = 'dsh-my-go:'
|
|
24
61
|
|
|
25
62
|
function agentLabel(type, summary) {
|
|
@@ -213,6 +250,7 @@ class Orchestration {
|
|
|
213
250
|
}
|
|
214
251
|
|
|
215
252
|
export async function apply(ctx, config = {}) {
|
|
253
|
+
void ensurePresetInstalled()
|
|
216
254
|
const orchestration = new Orchestration()
|
|
217
255
|
const sessionTypes = new Map()
|
|
218
256
|
let bindings = { ...defaultBindings(), ...(config.bindings ?? {}) }
|
package/src/client.js
CHANGED
|
@@ -10,10 +10,14 @@
|
|
|
10
10
|
* to the Sisyphus parent session.
|
|
11
11
|
*
|
|
12
12
|
* Built by scripts/build-client.mjs into dist/client.js (a
|
|
13
|
-
* `__ModuleLoader__.load` wrapper around the esbuild CJS bundle). React is
|
|
14
|
-
*
|
|
13
|
+
* `__ModuleLoader__.load` wrapper around the esbuild CJS bundle). React is
|
|
14
|
+
* external in the bundle and resolved through the loader's require, so we
|
|
15
|
+
* import it here — NOT the dynamic-plugin Builtin (that path has no
|
|
16
|
+
* import and relies on an ambient global, which breaks under esbuild).
|
|
15
17
|
*/
|
|
16
18
|
|
|
19
|
+
import * as React from 'react'
|
|
20
|
+
|
|
17
21
|
export const name = 'dsh-my-go'
|
|
18
22
|
|
|
19
23
|
export const inject = ['slots']
|