neuro-cli 4.1.0
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/LICENSE +21 -0
- package/README.md +510 -0
- package/dist/advisor/advisor.d.ts +50 -0
- package/dist/advisor/advisor.js +178 -0
- package/dist/agents/base.d.ts +62 -0
- package/dist/agents/base.js +215 -0
- package/dist/agents/orchestrator.d.ts +46 -0
- package/dist/agents/orchestrator.js +192 -0
- package/dist/agents/team.d.ts +51 -0
- package/dist/agents/team.js +210 -0
- package/dist/api/models.d.ts +23 -0
- package/dist/api/models.js +514 -0
- package/dist/api/ollama.d.ts +153 -0
- package/dist/api/ollama.js +751 -0
- package/dist/api/openrouter.d.ts +55 -0
- package/dist/api/openrouter.js +223 -0
- package/dist/commands/commands.d.ts +43 -0
- package/dist/commands/commands.js +308 -0
- package/dist/config/config.d.ts +8 -0
- package/dist/config/config.js +311 -0
- package/dist/context/compaction.d.ts +54 -0
- package/dist/context/compaction.js +251 -0
- package/dist/context/custom-agents.d.ts +107 -0
- package/dist/context/custom-agents.js +397 -0
- package/dist/context/custom-tools.d.ts +120 -0
- package/dist/context/custom-tools.js +564 -0
- package/dist/context/git-checkpoint.d.ts +52 -0
- package/dist/context/git-checkpoint.js +240 -0
- package/dist/context/neuro-md.d.ts +48 -0
- package/dist/context/neuro-md.js +202 -0
- package/dist/context/neuroignore.d.ts +102 -0
- package/dist/context/neuroignore.js +441 -0
- package/dist/context/repo-map.d.ts +38 -0
- package/dist/context/repo-map.js +220 -0
- package/dist/context/skill-standard.d.ts +262 -0
- package/dist/context/skill-standard.js +1156 -0
- package/dist/context/skill-system.d.ts +75 -0
- package/dist/context/skill-system.js +578 -0
- package/dist/context/tree-sitter.d.ts +99 -0
- package/dist/context/tree-sitter.js +1956 -0
- package/dist/core/acp.d.ts +325 -0
- package/dist/core/acp.js +1498 -0
- package/dist/core/api-server.d.ts +143 -0
- package/dist/core/api-server.js +550 -0
- package/dist/core/approval.d.ts +81 -0
- package/dist/core/approval.js +432 -0
- package/dist/core/auto-compact.d.ts +127 -0
- package/dist/core/auto-compact.js +436 -0
- package/dist/core/auto-mode.d.ts +232 -0
- package/dist/core/auto-mode.js +831 -0
- package/dist/core/background-session.d.ts +166 -0
- package/dist/core/background-session.js +696 -0
- package/dist/core/cicd.d.ts +257 -0
- package/dist/core/cicd.js +1443 -0
- package/dist/core/cloud-sync.d.ts +156 -0
- package/dist/core/cloud-sync.js +582 -0
- package/dist/core/code-review.d.ts +132 -0
- package/dist/core/code-review.js +1191 -0
- package/dist/core/completion.d.ts +49 -0
- package/dist/core/completion.js +384 -0
- package/dist/core/context.d.ts +38 -0
- package/dist/core/context.js +144 -0
- package/dist/core/diff-preview.d.ts +35 -0
- package/dist/core/diff-preview.js +173 -0
- package/dist/core/doom-loop.d.ts +51 -0
- package/dist/core/doom-loop.js +179 -0
- package/dist/core/engine.d.ts +183 -0
- package/dist/core/engine.js +942 -0
- package/dist/core/extended-thinking.d.ts +103 -0
- package/dist/core/extended-thinking.js +269 -0
- package/dist/core/fallback.d.ts +54 -0
- package/dist/core/fallback.js +104 -0
- package/dist/core/git-worktree.d.ts +139 -0
- package/dist/core/git-worktree.js +614 -0
- package/dist/core/headless.d.ts +30 -0
- package/dist/core/headless.js +101 -0
- package/dist/core/i18n.d.ts +83 -0
- package/dist/core/i18n.js +739 -0
- package/dist/core/linting.d.ts +129 -0
- package/dist/core/linting.js +699 -0
- package/dist/core/model-router.d.ts +109 -0
- package/dist/core/model-router.js +581 -0
- package/dist/core/multi-model.d.ts +243 -0
- package/dist/core/multi-model.js +1099 -0
- package/dist/core/multi-session.d.ts +144 -0
- package/dist/core/multi-session.js +442 -0
- package/dist/core/multimodal.d.ts +125 -0
- package/dist/core/multimodal.js +286 -0
- package/dist/core/observability.d.ts +93 -0
- package/dist/core/observability.js +737 -0
- package/dist/core/os-sandbox.d.ts +122 -0
- package/dist/core/os-sandbox.js +1193 -0
- package/dist/core/outcome-grading.d.ts +228 -0
- package/dist/core/outcome-grading.js +1123 -0
- package/dist/core/output-styles.d.ts +57 -0
- package/dist/core/output-styles.js +382 -0
- package/dist/core/parallel-agents.d.ts +183 -0
- package/dist/core/parallel-agents.js +563 -0
- package/dist/core/plugin-bundle.d.ts +236 -0
- package/dist/core/plugin-bundle.js +887 -0
- package/dist/core/plugin-sdk.d.ts +139 -0
- package/dist/core/plugin-sdk.js +273 -0
- package/dist/core/prompt-cache.d.ts +163 -0
- package/dist/core/prompt-cache.js +599 -0
- package/dist/core/sandbox.d.ts +127 -0
- package/dist/core/sandbox.js +369 -0
- package/dist/core/scheduled-tasks.d.ts +151 -0
- package/dist/core/scheduled-tasks.js +502 -0
- package/dist/core/security-scanner.d.ts +160 -0
- package/dist/core/security-scanner.js +1494 -0
- package/dist/core/session.d.ts +83 -0
- package/dist/core/session.js +269 -0
- package/dist/core/shell-completion.d.ts +51 -0
- package/dist/core/shell-completion.js +674 -0
- package/dist/core/smart-monitor.d.ts +146 -0
- package/dist/core/smart-monitor.js +1199 -0
- package/dist/core/spec-driven.d.ts +233 -0
- package/dist/core/spec-driven.js +1485 -0
- package/dist/core/spending-warnings.d.ts +123 -0
- package/dist/core/spending-warnings.js +456 -0
- package/dist/core/sub-agent.d.ts +298 -0
- package/dist/core/sub-agent.js +1023 -0
- package/dist/core/telemetry.d.ts +157 -0
- package/dist/core/telemetry.js +412 -0
- package/dist/core/terminal-ux.d.ts +134 -0
- package/dist/core/terminal-ux.js +649 -0
- package/dist/core/testing.d.ts +146 -0
- package/dist/core/testing.js +1200 -0
- package/dist/core/types.d.ts +439 -0
- package/dist/core/types.js +6 -0
- package/dist/core/undo-redo.d.ts +112 -0
- package/dist/core/undo-redo.js +290 -0
- package/dist/core/updater.d.ts +159 -0
- package/dist/core/updater.js +608 -0
- package/dist/core/vim-mode.d.ts +151 -0
- package/dist/core/vim-mode.js +771 -0
- package/dist/core/voice.d.ts +137 -0
- package/dist/core/voice.js +538 -0
- package/dist/core/web-dashboard.d.ts +109 -0
- package/dist/core/web-dashboard.js +484 -0
- package/dist/hooks/hooks.d.ts +74 -0
- package/dist/hooks/hooks.js +160 -0
- package/dist/hooks/llm-evaluator.d.ts +165 -0
- package/dist/hooks/llm-evaluator.js +560 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1186 -0
- package/dist/lsp/lsp-manager.d.ts +63 -0
- package/dist/lsp/lsp-manager.js +351 -0
- package/dist/mcp/client.d.ts +133 -0
- package/dist/mcp/client.js +684 -0
- package/dist/mcp/mcp-apps.d.ts +70 -0
- package/dist/mcp/mcp-apps.js +1007 -0
- package/dist/tools/bash.d.ts +5 -0
- package/dist/tools/bash.js +195 -0
- package/dist/tools/browser.d.ts +92 -0
- package/dist/tools/browser.js +1570 -0
- package/dist/tools/extended.d.ts +6 -0
- package/dist/tools/extended.js +191 -0
- package/dist/tools/file.d.ts +10 -0
- package/dist/tools/file.js +382 -0
- package/dist/tools/github.d.ts +389 -0
- package/dist/tools/github.js +759 -0
- package/dist/tools/index.d.ts +9 -0
- package/dist/tools/index.js +40 -0
- package/dist/tools/memory.d.ts +6 -0
- package/dist/tools/memory.js +197 -0
- package/dist/tools/registry.d.ts +29 -0
- package/dist/tools/registry.js +64 -0
- package/dist/tools/web.d.ts +6 -0
- package/dist/tools/web.js +150 -0
- package/dist/ui/renderer.d.ts +97 -0
- package/dist/ui/renderer.js +279 -0
- package/dist/ui/theme.d.ts +27 -0
- package/dist/ui/theme.js +106 -0
- package/package.json +83 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
export interface SmartMonitorConfig {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
/** Cheap model used for monitoring evaluations (default: gemma-4-31b) */
|
|
4
|
+
evaluatorModel: string;
|
|
5
|
+
riskThresholds: {
|
|
6
|
+
/** Risk score below this → auto-approve (default: 30) */
|
|
7
|
+
autoApprove: number;
|
|
8
|
+
/** Risk score above this → ask user (default: 70) */
|
|
9
|
+
askUser: number;
|
|
10
|
+
};
|
|
11
|
+
learning: {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
/** Directory where learned patterns are stored */
|
|
14
|
+
storagePath: string;
|
|
15
|
+
/** Minimum number of similar approvals before learning kicks in */
|
|
16
|
+
minSamples: number;
|
|
17
|
+
};
|
|
18
|
+
escalationRules: EscalationRule[];
|
|
19
|
+
contextAwareness: {
|
|
20
|
+
checkGitStatus: boolean;
|
|
21
|
+
checkTestCoverage: boolean;
|
|
22
|
+
checkProductionFiles: boolean;
|
|
23
|
+
/** Paths that are always treated as protected / high-risk */
|
|
24
|
+
protectedPaths: string[];
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface ActionRisk {
|
|
28
|
+
/** Aggregate risk score 0-100 */
|
|
29
|
+
score: number;
|
|
30
|
+
/** Individual contributing factors */
|
|
31
|
+
factors: RiskFactor[];
|
|
32
|
+
/** The monitor's recommendation */
|
|
33
|
+
recommendation: 'approve' | 'deny' | 'modify' | 'ask-user';
|
|
34
|
+
/** Human-readable explanation */
|
|
35
|
+
reasoning: string;
|
|
36
|
+
}
|
|
37
|
+
export interface RiskFactor {
|
|
38
|
+
name: string;
|
|
39
|
+
/** 0-100 contribution to the overall risk score */
|
|
40
|
+
contribution: number;
|
|
41
|
+
description: string;
|
|
42
|
+
}
|
|
43
|
+
export interface EscalationRule {
|
|
44
|
+
/** JS-style condition expression, e.g. "file matches src/production/**" */
|
|
45
|
+
condition: string;
|
|
46
|
+
action: 'ask-user' | 'deny';
|
|
47
|
+
reason: string;
|
|
48
|
+
}
|
|
49
|
+
export interface MonitorDecision {
|
|
50
|
+
action: 'approve' | 'deny' | 'modify' | 'ask-user';
|
|
51
|
+
confidence: number;
|
|
52
|
+
riskScore: number;
|
|
53
|
+
reasoning: string;
|
|
54
|
+
/** Populated only when action is 'modify' */
|
|
55
|
+
modifiedArgs?: Record<string, unknown>;
|
|
56
|
+
/** Populated only when action is 'ask-user' */
|
|
57
|
+
userQuestion?: string;
|
|
58
|
+
/** Whether this decision was derived from learned patterns */
|
|
59
|
+
learned: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface MonitorStats {
|
|
62
|
+
totalEvaluations: number;
|
|
63
|
+
approvals: number;
|
|
64
|
+
denials: number;
|
|
65
|
+
modifications: number;
|
|
66
|
+
escalations: number;
|
|
67
|
+
approvalRate: number;
|
|
68
|
+
avgRiskScore: number;
|
|
69
|
+
avgEvaluationTimeMs: number;
|
|
70
|
+
learnedDecisions: number;
|
|
71
|
+
cacheHitRate: number;
|
|
72
|
+
}
|
|
73
|
+
export interface ActionContext {
|
|
74
|
+
/** Current working directory */
|
|
75
|
+
workingDirectory: string;
|
|
76
|
+
/** Files that have been modified in the current session */
|
|
77
|
+
modifiedFiles: string[];
|
|
78
|
+
/** Total cost accrued so far in USD */
|
|
79
|
+
currentCost: number;
|
|
80
|
+
/** Spending limit in USD (0 = unlimited) */
|
|
81
|
+
spendingLimit: number;
|
|
82
|
+
/** Current safety level from auto mode */
|
|
83
|
+
safetyLevel: 'conservative' | 'moderate' | 'aggressive';
|
|
84
|
+
/** Recent tool call history (tool name + brief) */
|
|
85
|
+
recentHistory: Array<{
|
|
86
|
+
toolName: string;
|
|
87
|
+
brief: string;
|
|
88
|
+
}>;
|
|
89
|
+
/** Whether there are uncommitted git changes */
|
|
90
|
+
hasUncommittedChanges: boolean;
|
|
91
|
+
/** Optional project-level context from NEURO.md */
|
|
92
|
+
neuroMdContent?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface LearnedPattern {
|
|
95
|
+
/** Normalised key used for matching, e.g. "write_file:*.ts" */
|
|
96
|
+
pattern: string;
|
|
97
|
+
/** Number of times the user approved this pattern */
|
|
98
|
+
approvals: number;
|
|
99
|
+
/** Number of times the user denied this pattern */
|
|
100
|
+
denials: number;
|
|
101
|
+
/** Last seen timestamp (ms epoch) */
|
|
102
|
+
lastSeen: number;
|
|
103
|
+
/** Whether the pattern currently qualifies for auto-approve */
|
|
104
|
+
active: boolean;
|
|
105
|
+
}
|
|
106
|
+
export declare class SmartMonitor {
|
|
107
|
+
private config;
|
|
108
|
+
private apiClient;
|
|
109
|
+
private patterns;
|
|
110
|
+
private evaluationCache;
|
|
111
|
+
private stats;
|
|
112
|
+
constructor(config: Partial<SmartMonitorConfig>, apiClient: any);
|
|
113
|
+
evaluate(toolName: string, args: Record<string, unknown>, context: ActionContext): Promise<MonitorDecision>;
|
|
114
|
+
assessRisk(toolName: string, args: Record<string, unknown>, context: ActionContext): Promise<ActionRisk>;
|
|
115
|
+
private evaluateWithLLM;
|
|
116
|
+
private callEvaluatorModel;
|
|
117
|
+
private parseLLMResponse;
|
|
118
|
+
private estimateCost;
|
|
119
|
+
recordDecision(toolName: string, args: Record<string, unknown>, decision: MonitorDecision, userOverride?: boolean): void;
|
|
120
|
+
getLearnedPatterns(): LearnedPattern[];
|
|
121
|
+
resetLearning(): void;
|
|
122
|
+
private checkLearnedPatterns;
|
|
123
|
+
private loadPatterns;
|
|
124
|
+
private persistPatterns;
|
|
125
|
+
updateThresholds(thresholds: Partial<SmartMonitorConfig['riskThresholds']>): void;
|
|
126
|
+
addEscalationRule(rule: EscalationRule): void;
|
|
127
|
+
removeEscalationRule(condition: string): void;
|
|
128
|
+
getConfig(): Readonly<SmartMonitorConfig>;
|
|
129
|
+
setEnabled(enabled: boolean): void;
|
|
130
|
+
isEnabled(): boolean;
|
|
131
|
+
setEvaluatorModel(model: string): void;
|
|
132
|
+
addProtectedPath(pathPattern: string): void;
|
|
133
|
+
removeProtectedPath(pathPattern: string): void;
|
|
134
|
+
getStats(): MonitorStats;
|
|
135
|
+
resetStats(): void;
|
|
136
|
+
gatherContext(workingDirectory: string, currentCost: number, spendingLimit: number): ActionContext;
|
|
137
|
+
private adjustForSafetyLevel;
|
|
138
|
+
private scoreToConfidence;
|
|
139
|
+
private computeCacheKey;
|
|
140
|
+
private cacheDecision;
|
|
141
|
+
private sanitizeArgsForPrompt;
|
|
142
|
+
private freshStats;
|
|
143
|
+
}
|
|
144
|
+
export declare function createSmartMonitor(config?: Partial<SmartMonitorConfig>, apiClient?: any): SmartMonitor;
|
|
145
|
+
export declare function defaultSmartMonitorConfig(): SmartMonitorConfig;
|
|
146
|
+
//# sourceMappingURL=smart-monitor.d.ts.map
|