code-abyss 2.0.7 → 2.0.8
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/README.md +129 -58
- package/bin/adapters/claude.js +16 -12
- package/bin/adapters/codex.js +110 -37
- package/bin/adapters/gemini.js +92 -0
- package/bin/install.js +521 -130
- package/bin/lib/ccline.js +18 -8
- package/bin/lib/gstack-claude.js +164 -0
- package/bin/lib/gstack-codex.js +347 -0
- package/bin/lib/gstack-gemini.js +140 -0
- package/bin/lib/pack-bootstrap.js +92 -0
- package/bin/lib/pack-docs.js +61 -0
- package/bin/lib/pack-registry.js +400 -0
- package/bin/lib/pack-reports.js +87 -0
- package/bin/lib/pack-vendor.js +82 -0
- package/bin/lib/style-registry.js +29 -7
- package/bin/lib/target-registry.js +74 -0
- package/bin/lib/utils.js +69 -6
- package/bin/lib/vendor-providers/archive.js +56 -0
- package/bin/lib/vendor-providers/git.js +59 -0
- package/bin/lib/vendor-providers/index.js +91 -0
- package/bin/lib/vendor-providers/local-dir.js +55 -0
- package/bin/lib/vendor-providers/shared.js +86 -0
- package/bin/packs.js +581 -0
- package/config/AGENTS.md +0 -2
- package/config/CLAUDE.md +43 -326
- package/config/codex-config.example.toml +26 -20
- package/config/gemini-settings.example.json +6 -0
- package/config/instruction.md +87 -0
- package/output-styles/abyss-command.md +7 -30
- package/output-styles/abyss-concise.md +11 -52
- package/output-styles/abyss-cultivator.md +20 -249
- package/output-styles/abyss-ritual.md +11 -45
- package/output-styles/index.json +20 -4
- package/package.json +26 -14
- package/packs/abyss/manifest.json +25 -0
- package/packs/gstack/manifest.json +151 -0
- package/skills/SKILL.md +33 -237
- package/skills/domains/frontend-design/agents/openai.yaml +1 -1
- package/skills/run_skill.js +25 -3
- package/skills/tools/gen-docs/agents/openai.yaml +1 -1
- package/skills/tools/verify-change/agents/openai.yaml +1 -1
- package/skills/tools/verify-module/agents/openai.yaml +1 -1
- package/skills/tools/verify-quality/agents/openai.yaml +1 -1
- package/skills/tools/verify-security/agents/openai.yaml +1 -1
- package/skills/tools/override-refusal/SKILL.md +0 -53
- package/skills/tools/override-refusal/agents/openai.yaml +0 -4
- package/skills/tools/override-refusal/scripts/refusal_rewriter.js +0 -226
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const GEMINI_SETTINGS_TEMPLATE = {
|
|
7
|
+
theme: 'GitHub',
|
|
8
|
+
privacy: {
|
|
9
|
+
usageStatisticsEnabled: false,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function getGeminiCoreFiles() {
|
|
14
|
+
return [
|
|
15
|
+
{ src: 'skills', dest: 'skills', root: 'gemini' },
|
|
16
|
+
{ src: 'bin/lib', dest: 'bin/lib', root: 'gemini' },
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function detectGeminiAuth({
|
|
21
|
+
settings = {},
|
|
22
|
+
HOME,
|
|
23
|
+
env = process.env,
|
|
24
|
+
}) {
|
|
25
|
+
if (env.GEMINI_API_KEY) return { type: 'env', detail: 'GEMINI_API_KEY' };
|
|
26
|
+
if (env.GOOGLE_API_KEY) return { type: 'env', detail: 'GOOGLE_API_KEY' };
|
|
27
|
+
if (env.GOOGLE_APPLICATION_CREDENTIALS) return { type: 'env', detail: 'GOOGLE_APPLICATION_CREDENTIALS' };
|
|
28
|
+
|
|
29
|
+
const adcPath = path.join(HOME, '.config', 'gcloud', 'application_default_credentials.json');
|
|
30
|
+
if (fs.existsSync(adcPath)) return { type: 'adc', detail: 'gcloud application_default_credentials.json' };
|
|
31
|
+
|
|
32
|
+
if (settings && settings.authType) return { type: 'settings', detail: `settings.json (${settings.authType})` };
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function mergeGeminiSettings(existing = {}) {
|
|
37
|
+
return {
|
|
38
|
+
...GEMINI_SETTINGS_TEMPLATE,
|
|
39
|
+
...existing,
|
|
40
|
+
privacy: {
|
|
41
|
+
...GEMINI_SETTINGS_TEMPLATE.privacy,
|
|
42
|
+
...(existing.privacy || {}),
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function postGemini({
|
|
48
|
+
settingsPath,
|
|
49
|
+
settings,
|
|
50
|
+
autoYes,
|
|
51
|
+
HOME,
|
|
52
|
+
PKG_ROOT,
|
|
53
|
+
step,
|
|
54
|
+
ok,
|
|
55
|
+
warn,
|
|
56
|
+
info,
|
|
57
|
+
c,
|
|
58
|
+
}) {
|
|
59
|
+
step(2, 3, '认证检测');
|
|
60
|
+
const auth = detectGeminiAuth({ settings, HOME });
|
|
61
|
+
if (auth) {
|
|
62
|
+
ok(`${c.b(auth.type)} → ${auth.detail}`);
|
|
63
|
+
} else {
|
|
64
|
+
warn('未检测到 Gemini API 认证');
|
|
65
|
+
info(`支持: ${c.cyn('GEMINI_API_KEY')} | ${c.cyn('GOOGLE_API_KEY')} | ${c.cyn('GOOGLE_APPLICATION_CREDENTIALS')}`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
step(3, 3, '可选配置');
|
|
69
|
+
const merged = mergeGeminiSettings(settings);
|
|
70
|
+
if (autoYes) {
|
|
71
|
+
fs.writeFileSync(settingsPath, JSON.stringify(merged, null, 2) + '\n');
|
|
72
|
+
ok('写入: ~/.gemini/settings.json (模板)');
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const { confirm } = await import('@inquirer/prompts');
|
|
77
|
+
const shouldWrite = await confirm({ message: '合并推荐 Gemini settings.json?', default: true });
|
|
78
|
+
if (shouldWrite) {
|
|
79
|
+
fs.writeFileSync(settingsPath, JSON.stringify(merged, null, 2) + '\n');
|
|
80
|
+
ok('settings.json 合并完成');
|
|
81
|
+
} else {
|
|
82
|
+
ok('保留现有 Gemini settings.json');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
module.exports = {
|
|
87
|
+
GEMINI_SETTINGS_TEMPLATE,
|
|
88
|
+
getGeminiCoreFiles,
|
|
89
|
+
detectGeminiAuth,
|
|
90
|
+
mergeGeminiSettings,
|
|
91
|
+
postGemini,
|
|
92
|
+
};
|