@lay111/dsh-plugin-google 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/bin/setup.js +17 -92
  2. package/package.json +1 -1
package/bin/setup.js CHANGED
@@ -10,24 +10,20 @@ const PLUGIN_ROOT = path.resolve(__dirname, '..');
10
10
 
11
11
  const HOME = os.homedir();
12
12
  const DSH_HOME = path.join(HOME, '.dsh');
13
- const DSH_TUI_HOME = path.join(HOME, '.dsh-tui');
14
13
  const LOCAL_BIN = path.join(HOME, '.local', 'bin');
15
14
 
16
15
  console.log(`
17
16
  ╭──────────────────────────────────────────────────────────╮
18
17
  │ DeepSeek Harness · Google Antigravity One-Click Setup │
19
- 全自动配置 TUI / Web / 全局 Google Pro 满血模型矩阵
18
+ DSH 全局注入 Google Antigravity Pro & 满血模型矩阵
20
19
  ╰──────────────────────────────────────────────────────────╯
21
20
  `);
22
21
 
23
22
  // 1. Ensure required directories
24
23
  fs.mkdirSync(DSH_HOME, { recursive: true });
25
- fs.mkdirSync(DSH_TUI_HOME, { recursive: true });
26
24
  fs.mkdirSync(LOCAL_BIN, { recursive: true });
27
- fs.mkdirSync(path.join(DSH_HOME, 'profiles', 'dsh-tui'), { recursive: true });
28
- fs.mkdirSync(path.join(DSH_HOME, 'profiles', 'web'), { recursive: true });
29
25
 
30
- console.log('📦 [1/4] 配置全局 DSH 默认设置...');
26
+ console.log('📦 [1/3] 配置全局 DSH 默认模型 (Gemini 3.7 Flash High)...');
31
27
  // 2. Configure ~/.dsh/settings.yaml
32
28
  const settingsPath = path.join(DSH_HOME, 'settings.yaml');
33
29
  const settingsContent = `agent-default-model:
@@ -36,89 +32,16 @@ const settingsContent = `agent-default-model:
36
32
  `;
37
33
  fs.writeFileSync(settingsPath, settingsContent, 'utf-8');
38
34
 
39
- console.log('🎨 [2/4] 挂载插件至 TUI & Web 运行时 Profile...');
40
- // 3. Configure TUI Profile
41
- const tuiPatchPath = path.join(DSH_HOME, 'profiles', 'dsh-tui', 'cordis.patch.yml');
42
- const tuiPatchContent = `- insert:
43
- - id: dsh-antigravity
44
- name: ${PLUGIN_ROOT}
45
-
46
- - id: dsh-tui
47
- config:
48
- provider: antigravity
49
- model: gemini-3.7-flash
50
- fullscreen: true
51
- `;
52
- fs.writeFileSync(tuiPatchPath, tuiPatchContent, 'utf-8');
53
-
54
- const tuiPkgPath = path.join(DSH_HOME, 'profiles', 'dsh-tui', 'package.json');
55
- if (!fs.existsSync(tuiPkgPath)) {
56
- fs.writeFileSync(
57
- tuiPkgPath,
58
- JSON.stringify(
59
- {
60
- name: 'dsh-profile-dsh-tui',
61
- private: true,
62
- dependencies: { '@deepseek-harness-tui/dsh-tui': '^0.9.3' },
63
- dsh: { profile: { bundles: ['@deepseek-ai/dsh-base', '@deepseek-harness-tui/dsh-tui'] } },
64
- },
65
- null,
66
- 2,
67
- ),
68
- 'utf-8',
69
- );
70
- }
71
-
72
- // 4. Configure Web Profile
73
- const webPatchPath = path.join(DSH_HOME, 'profiles', 'web', 'cordis.patch.yml');
74
- const webPatchContent = `- insert:
35
+ console.log('🧩 [2/3] 全局挂载 Google 原生插件至所有 DSH Profile (Web/CLI/TUI/Headless)...');
36
+ // 3. Configure Global ~/.dsh/cordis.patch.yml (Applied to ALL DSH profiles automatically)
37
+ const globalPatchPath = path.join(DSH_HOME, 'cordis.patch.yml');
38
+ const globalPatchContent = `- insert:
75
39
  - id: dsh-antigravity
76
40
  name: ${PLUGIN_ROOT}
77
41
  `;
78
- fs.writeFileSync(webPatchPath, webPatchContent, 'utf-8');
79
-
80
- const webPkgPath = path.join(DSH_HOME, 'profiles', 'web', 'package.json');
81
- if (!fs.existsSync(webPkgPath)) {
82
- fs.writeFileSync(
83
- webPkgPath,
84
- JSON.stringify(
85
- {
86
- name: 'dsh-profile-web',
87
- private: true,
88
- dsh: { profile: { bundles: ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-web-app'] } },
89
- },
90
- null,
91
- 2,
92
- ),
93
- 'utf-8',
94
- );
95
- }
96
-
97
- // 5. Configure ~/.dsh-tui preferences
98
- fs.writeFileSync(
99
- path.join(DSH_TUI_HOME, 'model.json'),
100
- JSON.stringify({ provider: 'antigravity', model: 'gemini-3.7-flash' }, null, 2),
101
- 'utf-8',
102
- );
103
- fs.writeFileSync(
104
- path.join(DSH_TUI_HOME, 'model-recents.json'),
105
- JSON.stringify({ models: [{ provider: 'antigravity', id: 'gemini-3.7-flash' }] }, null, 2),
106
- 'utf-8',
107
- );
108
-
109
- console.log('🔗 [3/4] 注册全局快捷命令 (dst / dsh-google-auth)...');
110
- const tuiBin = path.join(DSH_HOME, 'profiles', 'dsh-tui', 'node_modules', '@deepseek-harness-tui', 'dsh-tui', 'bin', 'dsh-tui.js');
111
- if (fs.existsSync(tuiBin)) {
112
- try {
113
- fs.unlinkSync(path.join(LOCAL_BIN, 'dst'));
114
- fs.unlinkSync(path.join(LOCAL_BIN, 'dsh-tui'));
115
- } catch {}
116
- try {
117
- fs.symlinkSync(tuiBin, path.join(LOCAL_BIN, 'dst'));
118
- fs.symlinkSync(tuiBin, path.join(LOCAL_BIN, 'dsh-tui'));
119
- } catch {}
120
- }
42
+ fs.writeFileSync(globalPatchPath, globalPatchContent, 'utf-8');
121
43
 
44
+ // Link dsh-google-auth to PATH
122
45
  try {
123
46
  fs.unlinkSync(path.join(LOCAL_BIN, 'dsh-google-auth'));
124
47
  } catch {}
@@ -126,23 +49,25 @@ try {
126
49
  fs.symlinkSync(path.join(PLUGIN_ROOT, 'bin', 'auth-cli.js'), path.join(LOCAL_BIN, 'dsh-google-auth'));
127
50
  } catch {}
128
51
 
129
- console.log('🔑 [4/4] 检查 Google 账号登录状态...');
52
+ console.log('🔑 [3/3] 检查 Google 账号登录状态...');
130
53
  const active = getActiveAccount();
131
54
 
132
55
  async function runLogin() {
133
56
  if (active) {
134
57
  console.log(`\n✓ 当前已登录账号: ${active.email} (项目: ${active.projectId})`);
135
- console.log(`\n🎉 安装完成!你可以直接输入以下命令启动:`);
136
- console.log(` 👉 终端全屏 TUI 模式: dst`);
137
- console.log(` 👉 本地 Web 浏览器模式: dsh web\n`);
58
+ console.log(`\n🎉 安装完成!DSH 任意形态现已全局支持 Google 满血模型:`);
59
+ console.log(` 👉 命令行一问一答 (Headless): dsh --profile headless "你的任务"`);
60
+ console.log(` 👉 本地 Web 浏览器模式: dsh web`);
61
+ console.log(` 👉 终端交互模式 (TUI): dst / dsh --profile dsh-tui\n`);
138
62
  } else {
139
63
  console.log(`\n未检测到已登录的 Google 账号,正在为你唤起浏览器授权登录...`);
140
64
  try {
141
65
  const account = await startGoogleOAuthLogin();
142
66
  console.log(`\n🎉 登录成功: ${account.email}!`);
143
- console.log(`\n🎉 所有配置已就绪!你可以直接输入:`);
144
- console.log(` 👉 终端全屏 TUI 模式: dst`);
145
- console.log(` 👉 本地 Web 浏览器模式: dsh web\n`);
67
+ console.log(`\n🎉 全局配置已就绪!你可以使用任意 DSH 模式:`);
68
+ console.log(` 👉 命令行一问一答 (Headless): dsh --profile headless "你的任务"`);
69
+ console.log(` 👉 本地 Web 浏览器模式: dsh web`);
70
+ console.log(` 👉 终端交互模式 (TUI): dst / dsh --profile dsh-tui\n`);
146
71
  } catch (err) {
147
72
  console.log(`\n若浏览器未自动完成,可随时在终端运行 dsh-google-auth login 手动完成登录。`);
148
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lay111/dsh-plugin-google",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Native DeepSeek Harness Plugin for Google Antigravity Pro & Gemini/Claude Models",
5
5
  "type": "module",
6
6
  "main": "src/index.js",