Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions dist/adapters/gemini-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,19 +337,12 @@ export class GeminiAdapter extends BaseModelAdapter {
/**
* Calculate cost based on token usage (Google AI pricing model)
*/
calculateCost(tokenCount) {
if (!tokenCount || tokenCount <= 0) {
calculateCost(usage, costPerToken) {
if (!usage?.totalTokens || usage.totalTokens <= 0) {
return 0;
}
// Google AI pricing: approximately $0.00025 per 1000 input tokens, $0.00125 per 1000 output tokens
// This is a simplified calculation - actual pricing may vary by model
const inputCostPerToken = 0.00000025; // $0.00025 per 1000 tokens
const outputCostPerToken = 0.00000125; // $0.00125 per 1000 tokens
// Assume roughly 50% input, 50% output tokens for estimation
const estimatedInputTokens = Math.floor(tokenCount * 0.5);
const estimatedOutputTokens = Math.floor(tokenCount * 0.5);
const inputCost = (estimatedInputTokens / 1000) * 0.00025;
const outputCost = (estimatedOutputTokens / 1000) * 0.00125;
return Math.round((inputCost + outputCost) * 1000000) / 1000000; // Round to 6 decimal places
// Use provided cost per token or fall back to Google AI pricing
const effectiveCostPerToken = costPerToken || 0.00000075; // Average between input/output costs
return usage.totalTokens * effectiveCostPerToken;
}
}
2 changes: 1 addition & 1 deletion dist/cli/commands/dgm.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class DGMCommand extends Command {
constructor() {
super('dgm');
this.description('Darwin Gödel Machine - Evolutionary cleanup and self-improving system')
.alias('dgm');
.alias('darwin');
this.logger = new Logger('DGMCommand');
this.setupCommands();
}
Expand Down
13 changes: 9 additions & 4 deletions dist/cli/commands/hive-mind.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export class HiveMindCommand extends Command {
.option("-n, --nodes <number>", "Number of nodes", parseInt, 5)
.option("-q, --queen", "Include a queen coordinator", true)
.option("--worker-types <types>", "Comma-separated worker types")
.option("--gemini", "Integrate with Gemini AI for enhanced collective intelligence")
.option("--gemini", "Enable Gemini CLI integration for enhanced Google AI orchestration")
.option("--topology <type>", "Network topology", "mesh")
.option("--agents <number>", "Number of agents to spawn", parseInt, 10)
.action(async (objective, options) => this.spawnHive(objective, options));
this.command("status [hiveId]")
.description("Get status of active hive minds")
Expand Down Expand Up @@ -105,11 +107,14 @@ export class HiveMindCommand extends Command {
const workerTypes = options.workerTypes
? options.workerTypes.split(",").map((t) => t.trim())
: ["researcher", "analyst", "coder", "coordinator"];
// Check for global Gemini integration or local --gemini flag
const isGeminiEnabled = options.gemini || process.env.GEMINI_FLOW_CONTEXT_LOADED === "true";
// Check for global Gemini CLI mode or local --gemini flag
const isGeminiEnabled = options.gemini ||
process.env.GEMINI_CLI_MODE === "true" ||
process.env.GEMINI_FLOW_CONTEXT_LOADED === "true";
// Initialize Gemini integration if enabled globally or locally
if (isGeminiEnabled) {
spinner.text = "Initializing Gemini AI integration...";
spinner.text = "🚀 Initializing Gemini AI integration...";
console.log(chalk.blue("\n Gemini CLI mode detected - enhancing with Google AI services"));
await this.initializeGeminiAdapter();
await new Promise((resolve) => setTimeout(resolve, 1000));
}
Expand Down
14 changes: 13 additions & 1 deletion dist/cli/full-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,19 @@ function setupProgram() {
.option("--config <file>", "Use custom config file")
.option("--profile <name>", "Use named configuration profile")
.option("--protocols <list>", "Protocols to use (a2a,mcp)")
.option("--gemini", "Use Gemini AI integration (loads GEMINI.md context)")
.option("--gemini", "Enable Gemini CLI integration mode (prioritizes Gemini models and Google services)")
.hook("preAction", (thisCommand, actionCommand) => {
// Global --gemini flag handling
if (thisCommand.opts().gemini) {
process.env.GEMINI_CLI_MODE = "true";
process.env.PREFERRED_AI_PROVIDER = "gemini";
process.env.GOOGLE_SERVICES_PRIORITY = "high";
console.log(chalk.blue("🚀 Gemini CLI integration mode enabled"));
console.log(chalk.gray(" • Prioritizing Gemini models"));
console.log(chalk.gray(" • Google services integration active"));
console.log(chalk.gray(" • Loading GEMINI.md context if available"));
}
})
.option("--json", "JSON output format");
}
/**
Expand Down
Loading
Loading