@lay111/dsh-plugin-google 1.0.2 → 1.0.4

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/bin/setup.js CHANGED
@@ -7,27 +7,24 @@ import { startGoogleOAuthLogin, getActiveAccount } from '../src/auth.js';
7
7
 
8
8
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
9
  const PLUGIN_ROOT = path.resolve(__dirname, '..');
10
+ const PLUGIN_ENTRY = path.join(PLUGIN_ROOT, 'src', 'index.js');
10
11
 
11
12
  const HOME = os.homedir();
12
13
  const DSH_HOME = path.join(HOME, '.dsh');
13
- const DSH_TUI_HOME = path.join(HOME, '.dsh-tui');
14
14
  const LOCAL_BIN = path.join(HOME, '.local', 'bin');
15
15
 
16
16
  console.log(`
17
17
  ╭──────────────────────────────────────────────────────────╮
18
18
  │ DeepSeek Harness · Google Antigravity One-Click Setup │
19
- 全自动配置 TUI / Web / 全局 Google Pro 满血模型矩阵
19
+ DSH 全局注入 Google Antigravity Pro & 满血模型矩阵
20
20
  ╰──────────────────────────────────────────────────────────╯
21
21
  `);
22
22
 
23
23
  // 1. Ensure required directories
24
24
  fs.mkdirSync(DSH_HOME, { recursive: true });
25
- fs.mkdirSync(DSH_TUI_HOME, { recursive: true });
26
25
  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
26
 
30
- console.log('📦 [1/4] 配置全局 DSH 默认设置...');
27
+ console.log('📦 [1/3] 配置全局 DSH 默认模型 (Gemini 3.7 Flash High)...');
31
28
  // 2. Configure ~/.dsh/settings.yaml
32
29
  const settingsPath = path.join(DSH_HOME, 'settings.yaml');
33
30
  const settingsContent = `agent-default-model:
@@ -36,89 +33,16 @@ const settingsContent = `agent-default-model:
36
33
  `;
37
34
  fs.writeFileSync(settingsPath, settingsContent, 'utf-8');
38
35
 
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:
36
+ console.log('🧩 [2/3] 全局挂载 Google 原生插件至所有 DSH Profile (Web/CLI/TUI/Headless)...');
37
+ // 3. Configure Global ~/.dsh/cordis.patch.yml (Applied to ALL DSH profiles automatically)
38
+ const globalPatchPath = path.join(DSH_HOME, 'cordis.patch.yml');
39
+ const globalPatchContent = `- insert:
43
40
  - 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:
75
- - id: dsh-antigravity
76
- name: ${PLUGIN_ROOT}
41
+ name: ${PLUGIN_ENTRY}
77
42
  `;
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
- }
43
+ fs.writeFileSync(globalPatchPath, globalPatchContent, 'utf-8');
121
44
 
45
+ // Link dsh-google-auth to PATH
122
46
  try {
123
47
  fs.unlinkSync(path.join(LOCAL_BIN, 'dsh-google-auth'));
124
48
  } catch {}
@@ -126,23 +50,25 @@ try {
126
50
  fs.symlinkSync(path.join(PLUGIN_ROOT, 'bin', 'auth-cli.js'), path.join(LOCAL_BIN, 'dsh-google-auth'));
127
51
  } catch {}
128
52
 
129
- console.log('🔑 [4/4] 检查 Google 账号登录状态...');
53
+ console.log('🔑 [3/3] 检查 Google 账号登录状态...');
130
54
  const active = getActiveAccount();
131
55
 
132
56
  async function runLogin() {
133
57
  if (active) {
134
58
  console.log(`\n✓ 当前已登录账号: ${active.email} (项目: ${active.projectId})`);
135
- console.log(`\n🎉 安装完成!你可以直接输入以下命令启动:`);
136
- console.log(` 👉 终端全屏 TUI 模式: dst`);
137
- console.log(` 👉 本地 Web 浏览器模式: dsh web\n`);
59
+ console.log(`\n🎉 安装完成!DSH 任意形态现已全局支持 Google 满血模型:`);
60
+ console.log(` 👉 命令行一问一答 (Headless): dsh --profile headless "你的任务"`);
61
+ console.log(` 👉 本地 Web 浏览器模式: dsh web`);
62
+ console.log(` 👉 终端交互模式 (TUI): dst / dsh --profile dsh-tui\n`);
138
63
  } else {
139
64
  console.log(`\n未检测到已登录的 Google 账号,正在为你唤起浏览器授权登录...`);
140
65
  try {
141
66
  const account = await startGoogleOAuthLogin();
142
67
  console.log(`\n🎉 登录成功: ${account.email}!`);
143
- console.log(`\n🎉 所有配置已就绪!你可以直接输入:`);
144
- console.log(` 👉 终端全屏 TUI 模式: dst`);
145
- console.log(` 👉 本地 Web 浏览器模式: dsh web\n`);
68
+ console.log(`\n🎉 全局配置已就绪!你可以使用任意 DSH 模式:`);
69
+ console.log(` 👉 命令行一问一答 (Headless): dsh --profile headless "你的任务"`);
70
+ console.log(` 👉 本地 Web 浏览器模式: dsh web`);
71
+ console.log(` 👉 终端交互模式 (TUI): dst / dsh --profile dsh-tui\n`);
146
72
  } catch (err) {
147
73
  console.log(`\n若浏览器未自动完成,可随时在终端运行 dsh-google-auth login 手动完成登录。`);
148
74
  }
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.4",
4
4
  "description": "Native DeepSeek Harness Plugin for Google Antigravity Pro & Gemini/Claude Models",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -24,13 +24,7 @@
24
24
  ],
25
25
  "peerDependencies": {
26
26
  "@deepseek-ai/cordis": "^4.0.1",
27
- "@deepseek-ai/dsh-llm": "^0.1.0-rc.6 || ^0.1.1-rc.2",
28
- "@deepseek-ai/dsh-commands": "^0.1.0-rc.6 || ^0.1.1-rc.2"
29
- },
30
- "peerDependenciesMeta": {
31
- "@deepseek-ai/dsh-commands": {
32
- "optional": true
33
- }
27
+ "@deepseek-ai/dsh-llm": "^0.1.0-rc.6 || ^0.1.1-rc.2"
34
28
  },
35
29
  "keywords": [
36
30
  "deepseek-harness",
package/src/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { AntigravityLlmAdapter } from './adapter.js';
2
- import { startGoogleOAuthLogin, getActiveAccount } from './auth.js';
3
2
 
4
3
  export const name = 'dsh-antigravity';
5
4
  export const inject = ['llm'];
@@ -10,24 +9,6 @@ export function apply(ctx) {
10
9
  // 1. Register the native LLM adapter with DeepSeek Harness
11
10
  ctx.llm.registerAdapter(['antigravity'], adapter);
12
11
 
13
- // 2. Register slash command if commands service is present
14
- if (ctx.commands) {
15
- ctx.commands.command('auth/google', 'Log in to Google Antigravity Pro').action(async () => {
16
- console.log('Initiating Google OAuth login flow...');
17
- const account = await startGoogleOAuthLogin();
18
- console.log(`Successfully logged in as: ${account.email}`);
19
- });
20
-
21
- ctx.commands.command('auth/status', 'Check Google Antigravity account status').action(() => {
22
- const active = getActiveAccount();
23
- if (active) {
24
- console.log(`Active Account: ${active.email} (Project: ${active.projectId})`);
25
- } else {
26
- console.log('No Google Antigravity account currently logged in.');
27
- }
28
- });
29
- }
30
-
31
12
  ctx.logger?.info('Google Antigravity plugin mounted successfully.');
32
13
  }
33
14