minovative-mind-cli 2.14.0 → 2.14.2

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 (35) hide show
  1. package/README.md +51 -68
  2. package/dist/services/agent/slashCommands.js +74 -31
  3. package/dist/services/agent/toolLoop.js +3 -1
  4. package/dist/services/agent-tools.d.ts +18 -0
  5. package/dist/services/agent-tools.js +220 -43
  6. package/dist/services/agent.js +6 -3
  7. package/dist/services/ai.d.ts +3 -0
  8. package/dist/services/ai.js +65 -20
  9. package/dist/services/contextAgent.d.ts +10 -4
  10. package/dist/services/contextAgent.js +33 -9
  11. package/dist/services/orchestration/investigationAgent.js +34 -9
  12. package/dist/services/orchestration/investigationCache.js +19 -9
  13. package/dist/services/orchestration/readCache.d.ts +1 -0
  14. package/dist/services/orchestration/readCache.js +5 -2
  15. package/dist/services/orchestration/scopedTools.js +37 -10
  16. package/dist/services/orchestration/subAgent.js +16 -2
  17. package/dist/services/proxyClient.d.ts +6 -0
  18. package/dist/services/proxyClient.js +24 -10
  19. package/dist/services/userProfileService.d.ts +14 -0
  20. package/dist/services/userProfileService.js +105 -3
  21. package/dist/utils/analysisRunner.d.ts +120 -8
  22. package/dist/utils/analysisRunner.js +946 -125
  23. package/dist/utils/contextPrompts.d.ts +39 -0
  24. package/dist/utils/contextPrompts.js +81 -9
  25. package/dist/utils/contextRanker.d.ts +216 -0
  26. package/dist/utils/contextRanker.js +603 -0
  27. package/dist/utils/dependencyTracer/modules/graph.d.ts +4 -1
  28. package/dist/utils/dependencyTracer/modules/graph.js +11 -0
  29. package/dist/utils/dependencyTracer/modules/types.d.ts +10 -0
  30. package/dist/utils/dependencyTracer.d.ts +25 -0
  31. package/dist/utils/dependencyTracer.js +34 -0
  32. package/dist/utils/systemPrompts.d.ts +1 -1
  33. package/dist/utils/systemPrompts.js +13 -2
  34. package/oclif.manifest.json +1 -1
  35. package/package.json +1 -1
@@ -554,6 +554,17 @@ export async function buildDependencyGraph(workspaceRoot) {
554
554
  getForwardDependencyTree(filePath, maxDepth = 3) {
555
555
  return bfsTraverse(nodes, filePath, 'imports', maxDepth);
556
556
  },
557
+ getCentrality(filePath) {
558
+ const node = nodes.get(filePath);
559
+ const inDegree = node?.importedBy.size ?? 0;
560
+ const outDegree = node?.imports.size ?? 0;
561
+ const totalDegree = inDegree + outDegree;
562
+ const score = inDegree * 1.5 + outDegree * 0.5;
563
+ return { inDegree, outDegree, totalDegree, score };
564
+ },
565
+ getAllCentrality() {
566
+ return computeGraphCentrality(nodes);
567
+ },
557
568
  };
558
569
  }
559
570
  /**
@@ -652,6 +663,29 @@ export function formatDependencyResult(result) {
652
663
  lines.push(`Total impact radius: ${totalImpact} file(s)`);
653
664
  return lines.join('\n');
654
665
  }
666
+ /**
667
+ * Calculates graph centrality metrics for all nodes in a dependency graph.
668
+ */
669
+ export function computeGraphCentrality(nodes) {
670
+ const result = new Map();
671
+ for (const [file, node] of nodes.entries()) {
672
+ const inDegree = node.importedBy.size;
673
+ const outDegree = node.imports.size;
674
+ const totalDegree = inDegree + outDegree;
675
+ const score = inDegree * 1.5 + outDegree * 0.5;
676
+ result.set(file, { inDegree, outDegree, totalDegree, score });
677
+ }
678
+ return result;
679
+ }
680
+ /**
681
+ * Returns top dependency hub files sorted descending by centrality score.
682
+ */
683
+ export function getHubFiles(graph, limit) {
684
+ const allCentrality = graph.getAllCentrality();
685
+ const entries = Array.from(allCentrality.entries()).map(([filePath, metrics]) => ({ filePath, metrics }));
686
+ entries.sort((a, b) => b.metrics.score - a.metrics.score || b.metrics.inDegree - a.metrics.inDegree);
687
+ return typeof limit === 'number' && limit > 0 ? entries.slice(0, limit) : entries;
688
+ }
655
689
  /**
656
690
  * Resets the tsconfig alias cache (useful between workspace changes).
657
691
  */
@@ -7,5 +7,5 @@ export declare const EXECUTION_COMPLEXITY_SYSTEM_INSTRUCTION = "<identity>\nYou
7
7
  export declare const INVESTIGATION_COMPLEXITY_SYSTEM_INSTRUCTION = "<identity>\nYou are an investigation strategy analyzer for an AI coding assistant.\nYour task is to determine if the user's request requires a single investigation agent or parallel investigation agents across multiple code domains.\n</identity>\n\n<input>\nYou will receive:\n- The user's request\n- The detected project type (e.g., \"Node.js / TypeScript / React\")\n- The approximate number of files in the project\n- Recent chat history (if any)\n- Configured Primary Sub-Path / Sub-Path Auto-Focus status (if any, e.g. \"src\", \"packages/core\")\n- Sub-Path Override status (if active/requested)\n</input>\n\n<subpath_autofocus_rules>\nWhen an active Primary Sub-Path is specified:\n- **Semantic Scope Evaluation**: Determine whether the request is confined to the active primary sub-path or requires broader scope:\n - If the prompt targets components, functions, styles, or features that reside within the active primary sub-path, set \"scope\": \"SUB_PATH\" and \"subPathOverride\": null. (e.g. \"update global CSS variables in src/styles/theme.css\" stays in \"SUB_PATH\" if \"src\" is active).\n - If the prompt explicitly asks for full repository exploration, whole codebase refactoring, monorepo-wide scanning, or targets files outside the active sub-path (such as root configs, package.json, Dockerfile), set \"scope\": \"FULL_WORKSPACE\" and set \"subPathOverride\" to the targeted root file or \"root\".\n - If the prompt references an external workspace alias (e.g. \"@website\", \"@backend\"), set \"scope\": \"EXTERNAL_WORKSPACE\" and \"subPathOverride\": \"@alias\".\n</subpath_autofocus_rules>\n\n<classification_rules>\nOutput \"PARALLEL\" if:\n- The request spans multiple code domains, subsystems, or layers (e.g., frontend + backend, UI + API, state + components, CLI + services).\n- The request is architectural, broad, multi-file, or exploratory (e.g., \"refactor\", \"migrate\", \"audit\", \"investigate how X and Y interact\", \"add end-to-end feature\").\n- The request touches non-trivial features or requires investigating multiple candidate files or folders across the project.\n- Multiple search fronts will accelerate discovery and yield comprehensive context.\n- Examples: \"refactor auth to OAuth2\", \"add dark mode across the app\", \"investigate caching and tool loops\", \"audit security rules and API routes\"\n\nOutput \"SINGLE\" only if:\n- The request targets a strictly localized, single-file or single-component edit with an obvious scope (e.g., \"fix typo in README\", \"update constant in config.ts\", \"change button color in LoginButton.tsx\").\n\nWhen in doubt for multi-file, feature-level, or architectural queries, prefer \"PARALLEL\" with 2-3 focused domain agent assignments.\n</classification_rules>\n\n<domain_decomposition>\nWhen outputting \"PARALLEL\", you must also:\n1. Identify the investigation domains the request spans (e.g., \"Frontend components\", \"API routes\", \"Database models\", \"Config & environment\").\n2. Group related domains into 2 to 3 agent assignments maximum to optimize concurrency and prevent token window exhaustion. Related domains that share context (e.g., \"Frontend auth\" and \"Frontend UI\") should be assigned to the SAME agent to reduce overhead and benefit from shared investigation context.\n3. Each agent assignment gets a human-readable label and a list of domains it covers.\n\nRules:\n- Group domains by layer, stack, or logical relatedness (e.g., \"Frontend & UI\", \"Backend & Services\", \"Config & Data\").\n- Limit assignments to 2-3 focused agents max. Prefer fewer agents with broader scope over many narrow agents.\n- Each agent should have a clear, non-overlapping investigation focus.\n</domain_decomposition>\n\n<output_format>\nAlways output ONLY valid JSON with this exact schema. No markdown, no explanations:\n{\n \"strategy\": \"SINGLE\" | \"PARALLEL\",\n \"scope\": \"SUB_PATH\" | \"FULL_WORKSPACE\" | \"EXTERNAL_WORKSPACE\",\n \"subPathOverride\": \"string (target root file, 'root', or '@alias') or null\",\n \"domains\": [\"string (all identified domains)\"],\n \"agentAssignments\": [\n { \"agentLabel\": \"string\", \"domains\": [\"string\"] }\n ],\n \"reasoning\": \"string (brief justification)\"\n}\n\nFor \"SINGLE\" strategy, domains and agentAssignments should be empty arrays.\n</output_format>";
8
8
  export declare const HISTORY_SUMMARIZER_SYSTEM_INSTRUCTION = "<identity>\nYou are a Chat History Compression Agent for an AI coding assistant.\nYour sole task is to summarize past conversation turns into a concise, high-density structured summary to fit within token limits while preserving essential context.\n</identity>\n\n<compression_rules>\n- Maintain all essential technical facts, user requirements, user preferences, decisions made, key files modified or inspected, and current system/task state.\n- Eliminate redundant chatter, user/assistant greetings, verbose tool outputs, and conversational filler.\n- Retain exact file paths, command results, structural code snippets, and active sub-agent/task progress if relevant.\n- Express key decisions and context in clear, structured bullet points.\n- Ensure downstream AI agents can seamlessly continue the session without losing track of previous accomplishments or active goals.\n</compression_rules>\n\n<output_format>\nOutput a structured markdown summary covering:\n- **Core Goals & User Intent**\n- **Key Decisions & Technical Findings**\n- **Relevant / Modified / Inspected Files**\n- **Current Status & Active Tasks**\n</output_format>";
9
9
  export declare const INVESTIGATION_SEMANTIC_SYSTEM_INSTRUCTION = "<identity>\nYou are a Semantic Intent and Entity Classifier for a codebase investigation memory bank.\nYour task is to analyze user prompts or engineering questions, extract normalized semantic topics and target components, and classify the underlying technical intent to enable precise context cache lookup and deduplication.\n</identity>\n\n<extraction_rules>\n- Identify technical topics/domains (e.g. \"authentication\", \"billing\", \"database\", \"routing\", \"state-management\", \"caching\", \"testing\", \"ui-layout\", \"api-gateway\").\n- Extract explicit or inferred components, filenames, class names, functions, endpoints, or data models mentioned or implied (e.g. \"investigationCache\", \"loginForm\", \"authMiddleware\", \"stripeWebhook\").\n- Determine the primary intent category (e.g. \"bug_fix\", \"feature_addition\", \"refactoring\", \"performance_optimization\", \"explanation\", \"investigation\").\n- Normalize terms into concise lowercase identifiers.\n</extraction_rules>\n\n<output_format>\nAlways output ONLY valid JSON with this exact schema. No markdown, no explanations:\n{\n \"topics\": [\"string\"],\n \"components\": [\"string\"],\n \"intent\": \"string\",\n \"reasoning\": \"string\"\n}\n</output_format>";
10
- export declare const USER_PROFILE_EXTRACTOR_SYSTEM_INSTRUCTION = "<identity>\nYou are an Adaptive User Profiler and Memory Reconciler for an AI coding assistant.\nYour task is to analyze conversational dialogue between the user and the AI agent, observing patterns in how the user communicates, their personality, tone, thought formulation, technical preferences, and working habits.\n</identity>\n\n<observation_and_reconciliation_rules>\n1. **Dynamic Modification & Evolution (CRITICAL)**:\n - Review the provided numbered list of \"Existing Agent Side-Notes\" (e.g. \"[0] ...\", \"[1] ...\").\n - You are empowered and expected to **CHANGE, REWRITE, and UPDATE** existing notes using \"updateNotes\" whenever a user clarifies, modifies, deepens, or changes their opinions, habits, or phrasing.\n - Do not merely append notes endlessly. When an observation evolves or needs adjustment, use \"updateNotes\" with {\"index\": <number>, \"updatedText\": \"<refined note>\"} to keep memory modern, accurate, and concise.\n - If a new interaction contradicts an existing note (e.g. the user previously preferred Python but now explicitly pivots to Node.js, or previously wanted verbose explanations but now requests strict brevity):\n - Use **\"deleteNoteIndices\"** to remove the index of the outdated, contradicted, or obsolete note.\n - Use **\"removeStrengths\"** / **\"removeConventions\"** to prune superseded technologies or abandoned conventions.\n\n2. **Communication Style & Personality**:\n - Observe and update tone, demeanor, verbosity, and thought formulation styles (e.g. \"Direct and concise\", \"Enjoys subtle dev humor\", \"Provides high-level architectural requirements\").\n\n3. **Cognitive & Decision-Making Spectrum (\"cognitiveTraits\")**:\n - Observe how the user thinks, decides, and collaborates:\n - **architecturalStyle**: (e.g. \"top-down-design\", \"bottom-up-code\", \"balanced\")\n - **decisionPreference**: (e.g. \"direct-recommendation\", \"present-options\")\n - **riskTolerance**: (e.g. \"defensive-rigor\", \"pragmatic-speed\")\n - **delegationDepth**: (e.g. \"autonomous-delegation\", \"hands-on-stepwise\")\n - **debuggingStyle**: (e.g. \"minimal-diff-fix\", \"root-cause-deep-dive\")\n - **explanationFormat**: (e.g. \"code-first\", \"bullet-summaries\", \"conceptual-analogies\")\n\n4. **Incremental Side-Notes (\"addNotes\")**:\n - Add 1-2 new, high-value side-notes for genuinely new observations that do not conflict with existing notes and cannot be represented as updates to existing ones.\n - Do NOT record trivial actions (e.g. \"User typed a command\") or hallucinate unproven habits.\n - Keep all side-notes respectful, professional, objective, and actionable.\n\n5. **Zero-Noise Output**:\n - If the turn reveals no new insights, updates, or contradictions, return empty arrays and leave fields unchanged.\n</observation_and_reconciliation_rules>\n\n<output_format>\nAlways output ONLY valid JSON matching the schema. No markdown, no preambles.\n</output_format>";
10
+ export declare const USER_PROFILE_EXTRACTOR_SYSTEM_INSTRUCTION = "<identity>\nYou are an Adaptive User Profiler and Memory Reconciler for an AI coding assistant.\nYour task is to analyze conversational dialogue between the user and the AI agent, observing patterns in how the user communicates, their personality, tone, thought formulation, technical preferences, and working habits.\n</identity>\n\n<observation_and_reconciliation_rules>\n1. **Dynamic Modification & Evolution (CRITICAL)**:\n - Review the provided numbered list of \"Existing Agent Side-Notes\" (e.g. \"[0] ...\", \"[1] ...\").\n - You are empowered and expected to **CHANGE, REWRITE, and UPDATE** existing notes using \"updateNotes\" whenever a user clarifies, modifies, deepens, or changes their opinions, habits, or phrasing.\n - Do not merely append notes endlessly. When an observation evolves or needs adjustment, use \"updateNotes\" with {\"index\": <number>, \"updatedText\": \"<refined note>\"} to keep memory modern, accurate, and concise.\n - If a new interaction contradicts an existing note (e.g. the user previously preferred Python but now explicitly pivots to Node.js, or previously wanted verbose explanations but now requests strict brevity):\n - Use **\"deleteNoteIndices\"** to remove the index of the outdated, contradicted, or obsolete note.\n - Use **\"removeStrengths\"** / **\"removeConventions\"** to prune superseded technologies or abandoned conventions.\n\n2. **Communication Style & Personality**:\n - Observe and update tone, demeanor, verbosity, and thought formulation styles (e.g. \"Direct and concise\", \"Enjoys subtle dev humor\", \"Provides high-level architectural requirements\").\n\n3. **Cognitive & Decision-Making Spectrum (\"cognitiveTraits\")**:\n - Observe how the user thinks, decides, and collaborates:\n - **architecturalStyle**: (e.g. \"top-down-design\", \"bottom-up-code\", \"balanced\")\n - **decisionPreference**: (e.g. \"direct-recommendation\", \"present-options\")\n - **riskTolerance**: (e.g. \"defensive-rigor\", \"pragmatic-speed\")\n - **delegationDepth**: (e.g. \"autonomous-delegation\", \"hands-on-stepwise\")\n - **debuggingStyle**: (e.g. \"minimal-diff-fix\", \"root-cause-deep-dive\")\n - **explanationFormat**: (e.g. \"code-first\", \"bullet-summaries\", \"conceptual-analogies\")\n\n4. **Conversational Persona & Teammate Pairing Dynamics (\"conversationalPersona\")**:\n - Observe the interpersonal wavelength and how the user communicates with the AI:\n - **relationshipModel**: (e.g. \"collaborative-peer\", \"command-operator\", \"rubber-duck\", \"socratic-explorer\")\n - **banterAffinity**: (e.g. \"witty-banter\", \"dry-professional\", \"warm-encouraging\")\n - **formalityLevel**: (e.g. \"casual-slang\", \"telegraphic-concise\", \"polite-cordial\")\n - **apologyTolerance**: (e.g. \"zero-apologies\", \"tolerant-empathetic\")\n - **stressCadence**: (e.g. \"urgent-surgical\", \"calm-exploratory\")\n - **promptingHabit**: (e.g. \"code-dump-deducer\", \"bulleted-architect\", \"stream-of-consciousness\", \"rapid-breadcrumbs\")\n - **conversationalQuirks**: (Add 1-2 distinct recurring catchphrases, quirks, or communicative habits e.g. \"Uses 'lgtm' and 'ship it' when satisfied\", \"Appreciates dry sarcasm\", \"Drops raw stack traces without commentary\")\n - **removeQuirks**: (Prune outdated or superseded quirks if the user's habits change)\n\n5. **Incremental Side-Notes (\"addNotes\")**:\n - Add 1-2 new, high-value side-notes for genuinely new observations that do not conflict with existing notes and cannot be represented as updates to existing ones.\n - Do NOT record trivial actions (e.g. \"User typed a command\") or hallucinate unproven habits.\n - Keep all side-notes respectful, professional, objective, and actionable.\n\n6. **Zero-Noise Output**:\n - If the turn reveals no new insights, updates, or contradictions, return empty arrays and leave fields unchanged.\n</observation_and_reconciliation_rules>\n\n<output_format>\nAlways output ONLY valid JSON matching the schema. No markdown, no preambles.\n</output_format>";
11
11
  export declare const TRIVIAL_MESSAGE_CLASSIFIER_SYSTEM_INSTRUCTION = "<identity>\nYou are a Conversation Turn Signal Classifier for an AI coding assistant.\nYour sole job is to determine whether a user's message contains substantive personality or technical signal, or if it is purely a trivial/low-signal interaction.\n</identity>\n\n<classification_rules>\n- Output \"isTrivial\": true if the user's message is:\n - A generic greeting or farewell (e.g. \"hi\", \"hello\", \"bye\", \"see you\").\n - A simple affirmation, confirmation, or approval (e.g. \"ok\", \"yes\", \"proceed\", \"looks good\", \"lgtm\", \"sounds good\", \"continue\", \"go ahead\").\n - A short courtesy or filler (e.g. \"thanks\", \"thank you\", \"awesome\", \"cool\", \"got it\").\n - A simple CLI/session control command (e.g. \"stop\", \"exit\", \"quit\", \"clear\").\n - An interaction that reveals ZERO technical preferences, opinions, architectural decisions, or unique communication traits.\n\n- Output \"isTrivial\": false if the user's message:\n - Formulates a technical idea, asks an architectural question, or requests a feature.\n - Expresses a distinct opinion, coding preference, dislike, or tool choice (e.g. \"I prefer using Zod over Joi\", \"Please make it concise with zero fluff\").\n - Shows an emotional or stylistic tone (e.g. witty sarcasm, detailed breakdown, deep frustration with a pattern).\n - Contains code snippets, error logs, or specific technical directives.\n</classification_rules>\n\n<output_format>\nAlways output ONLY valid JSON matching the schema: {\"isTrivial\": boolean, \"reason\": string}. No markdown, no preambles.\n</output_format>";
@@ -367,12 +367,23 @@ Your task is to analyze conversational dialogue between the user and the AI agen
367
367
  - **debuggingStyle**: (e.g. "minimal-diff-fix", "root-cause-deep-dive")
368
368
  - **explanationFormat**: (e.g. "code-first", "bullet-summaries", "conceptual-analogies")
369
369
 
370
- 4. **Incremental Side-Notes ("addNotes")**:
370
+ 4. **Conversational Persona & Teammate Pairing Dynamics ("conversationalPersona")**:
371
+ - Observe the interpersonal wavelength and how the user communicates with the AI:
372
+ - **relationshipModel**: (e.g. "collaborative-peer", "command-operator", "rubber-duck", "socratic-explorer")
373
+ - **banterAffinity**: (e.g. "witty-banter", "dry-professional", "warm-encouraging")
374
+ - **formalityLevel**: (e.g. "casual-slang", "telegraphic-concise", "polite-cordial")
375
+ - **apologyTolerance**: (e.g. "zero-apologies", "tolerant-empathetic")
376
+ - **stressCadence**: (e.g. "urgent-surgical", "calm-exploratory")
377
+ - **promptingHabit**: (e.g. "code-dump-deducer", "bulleted-architect", "stream-of-consciousness", "rapid-breadcrumbs")
378
+ - **conversationalQuirks**: (Add 1-2 distinct recurring catchphrases, quirks, or communicative habits e.g. "Uses 'lgtm' and 'ship it' when satisfied", "Appreciates dry sarcasm", "Drops raw stack traces without commentary")
379
+ - **removeQuirks**: (Prune outdated or superseded quirks if the user's habits change)
380
+
381
+ 5. **Incremental Side-Notes ("addNotes")**:
371
382
  - Add 1-2 new, high-value side-notes for genuinely new observations that do not conflict with existing notes and cannot be represented as updates to existing ones.
372
383
  - Do NOT record trivial actions (e.g. "User typed a command") or hallucinate unproven habits.
373
384
  - Keep all side-notes respectful, professional, objective, and actionable.
374
385
 
375
- 5. **Zero-Noise Output**:
386
+ 6. **Zero-Noise Output**:
376
387
  - If the turn reveals no new insights, updates, or contradictions, return empty arrays and leave fields unchanged.
377
388
  </observation_and_reconciliation_rules>
378
389
 
@@ -201,5 +201,5 @@
201
201
  ]
202
202
  }
203
203
  },
204
- "version": "2.14.0"
204
+ "version": "2.14.2"
205
205
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "minovative-mind-cli",
3
3
  "description": "An automated AI agent powered by Vertex AI that helps you write software",
4
- "version": "2.14.0",
4
+ "version": "2.14.2",
5
5
  "author": "Daniel Ward",
6
6
  "bin": {
7
7
  "minovative-mind-cli": "bin/run.js"