staffos 0.1.6 → 0.1.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/bin/cli.js +26 -9
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -125,21 +125,38 @@ function getFilesRecursive(dir, fileList = []) {
|
|
|
125
125
|
const modelsPricing = {
|
|
126
126
|
'claude-sonnet': { name: 'Claude 4.8 Sonnet', input: 3.00, output: 15.00 },
|
|
127
127
|
'claude-opus': { name: 'Claude 4.8 Opus', input: 15.00, output: 75.00 },
|
|
128
|
-
'gemini-pro': { name: 'Gemini 3.1 Pro', input: 2.00, output: 12.00 },
|
|
129
|
-
'gemini-flash': { name: 'Gemini 3.5 Flash', input: 0.075, output: 0.30 },
|
|
130
|
-
'gpt-5.5': { name: 'GPT 5.5', input: 5.00, output: 30.00 },
|
|
128
|
+
'gemini-pro': { name: 'Gemini 3.1 Pro (OpenCode)', input: 2.00, output: 12.00 },
|
|
129
|
+
'gemini-flash': { name: 'Gemini 3.5 Flash (Antigravity 2.0)', input: 0.075, output: 0.30 },
|
|
130
|
+
'gpt-5.5': { name: 'GPT 5.5 (Codex)', input: 5.00, output: 30.00 },
|
|
131
131
|
'local': { name: 'Modelos Locales (Ollama/DeepSeek)', input: 0.00, output: 0.00 }
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
// Auto-detect the active AI environment
|
|
135
135
|
function detectActiveAI() {
|
|
136
|
-
// 1
|
|
136
|
+
// Heuristic 1: Active Runtime Environment Variables (HIGHEST PRIORITY)
|
|
137
|
+
if (process.env.ANTIGRAVITY_AGENT === '1' || process.env.ANTIGRAVITY_PROJECT_ID) {
|
|
138
|
+
return { key: 'gemini-flash', reason: 'ejecutando en entorno Antigravity 2.0' };
|
|
139
|
+
}
|
|
140
|
+
if (process.env.CODEX === 'true' || process.env.CODEX_AGENT) {
|
|
141
|
+
return { key: 'gpt-5.5', reason: 'ejecutando en entorno OpenAI Codex' };
|
|
142
|
+
}
|
|
143
|
+
if (process.env.OPENCODE === 'true') {
|
|
144
|
+
return { key: 'gemini-pro', reason: 'ejecutando en entorno OpenCode' };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Heuristic 2: Directory structures (Fallback if no env var is present)
|
|
148
|
+
if (fs.existsSync(path.join(targetDir, '.gemini')) || fs.existsSync(path.join(targetDir, 'adapters/antigravity'))) {
|
|
149
|
+
return { key: 'gemini-flash', reason: 'directorio de integración de Antigravity 2.0 detectado' };
|
|
150
|
+
}
|
|
151
|
+
if (fs.existsSync(path.join(targetDir, 'adapters/codex')) || fs.existsSync(path.join(targetDir, 'codex.json'))) {
|
|
152
|
+
return { key: 'gpt-5.5', reason: 'directorio de integración de Codex detectado' };
|
|
153
|
+
}
|
|
154
|
+
if (fs.existsSync(path.join(targetDir, '.opencode')) || fs.existsSync(path.join(targetDir, 'opencode.json')) || fs.existsSync(path.join(targetDir, 'opencode.jsonc'))) {
|
|
155
|
+
return { key: 'gemini-pro', reason: 'directorio de integración de OpenCode detectado' };
|
|
156
|
+
}
|
|
137
157
|
if (fs.existsSync(path.join(targetDir, '.claudecode'))) {
|
|
138
158
|
return { key: 'claude-sonnet', reason: 'directorio .claudecode detectado' };
|
|
139
159
|
}
|
|
140
|
-
if (fs.existsSync(path.join(targetDir, '.opencode'))) {
|
|
141
|
-
return { key: 'gemini-pro', reason: 'directorio .opencode detectado' };
|
|
142
|
-
}
|
|
143
160
|
if (fs.existsSync(path.join(targetDir, '.cursorrules'))) {
|
|
144
161
|
if (process.env.OPENAI_API_KEY && !process.env.ANTHROPIC_API_KEY) {
|
|
145
162
|
return { key: 'gpt-5.5', reason: 'archivo .cursorrules y OPENAI_API_KEY detectados' };
|
|
@@ -147,7 +164,7 @@ function detectActiveAI() {
|
|
|
147
164
|
return { key: 'claude-sonnet', reason: 'archivo .cursorrules detectado (Cursor default)' };
|
|
148
165
|
}
|
|
149
166
|
|
|
150
|
-
//
|
|
167
|
+
// Heuristic 3: Env Var keys
|
|
151
168
|
if (process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY) {
|
|
152
169
|
return { key: 'gemini-pro', reason: 'variable de entorno GEMINI_API_KEY / GOOGLE_API_KEY' };
|
|
153
170
|
}
|
|
@@ -158,7 +175,7 @@ function detectActiveAI() {
|
|
|
158
175
|
return { key: 'gpt-5.5', reason: 'variable de entorno OPENAI_API_KEY' };
|
|
159
176
|
}
|
|
160
177
|
|
|
161
|
-
//
|
|
178
|
+
// Heuristic 4: Terminal program
|
|
162
179
|
if (process.env.TERM_PROGRAM === 'vscode') {
|
|
163
180
|
return { key: 'claude-sonnet', reason: 'ejecutado bajo Cursor/VSCode' };
|
|
164
181
|
}
|