@timmeck/brain-core 2.36.41 → 2.36.43
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/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin/plugin-marketplace.d.ts +140 -0
- package/dist/plugin/plugin-marketplace.js +473 -0
- package/dist/plugin/plugin-marketplace.js.map +1 -0
- package/dist/tool-scoping/index.d.ts +2 -0
- package/dist/tool-scoping/index.js +2 -0
- package/dist/tool-scoping/index.js.map +1 -0
- package/dist/tool-scoping/scope-manager.d.ts +122 -0
- package/dist/tool-scoping/scope-manager.js +339 -0
- package/dist/tool-scoping/scope-manager.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -68,6 +68,8 @@ export type { WatchdogConfig, DaemonConfig, DaemonStatus } from './watchdog/watc
|
|
|
68
68
|
export { WindowsServiceManager } from './watchdog/windows-service.js';
|
|
69
69
|
export { PluginRegistry } from './plugin/plugin-registry.js';
|
|
70
70
|
export type { BrainPlugin, PluginContext, PluginToolDefinition, PluginRouteDefinition, PluginManifest, PluginRecord } from './plugin/types.js';
|
|
71
|
+
export { PluginMarketplace, runMarketplaceMigration } from './plugin/plugin-marketplace.js';
|
|
72
|
+
export type { CatalogPlugin, PluginCatalog, PluginReview, InstallRecord, CompatibilityResult, MarketplaceStatus, PluginMarketplaceConfig } from './plugin/plugin-marketplace.js';
|
|
71
73
|
export { EcosystemService } from './ecosystem/service.js';
|
|
72
74
|
export type { BrainStatus, EcosystemStatus, AggregatedAnalytics } from './ecosystem/service.js';
|
|
73
75
|
export { WebhookService, runWebhookMigration } from './webhooks/service.js';
|
|
@@ -247,3 +249,5 @@ export { BenchmarkSuite, runBenchmarkMigration } from './agent-training/index.js
|
|
|
247
249
|
export type { EvalCase, EvalResult, BenchmarkReport, BenchmarkSuiteStatus, EvalFunction, ScoreFunction, } from './agent-training/index.js';
|
|
248
250
|
export { AgentTrainer, runTrainerMigration } from './agent-training/index.js';
|
|
249
251
|
export type { TrainingConfig, EpochResult, TrainingReport, AgentTrainerStatus, } from './agent-training/index.js';
|
|
252
|
+
export { ToolScopeManager, runToolScopingMigration } from './tool-scoping/index.js';
|
|
253
|
+
export type { ToolScope, WorkflowContext, ScopeCheckResult, ToolScopeManagerStatus, } from './tool-scoping/index.js';
|
package/dist/index.js
CHANGED
|
@@ -54,6 +54,7 @@ export { WatchdogService, createDefaultWatchdogConfig } from './watchdog/watchdo
|
|
|
54
54
|
export { WindowsServiceManager } from './watchdog/windows-service.js';
|
|
55
55
|
// ── Plugin SDK ────────────────────────────────────────────
|
|
56
56
|
export { PluginRegistry } from './plugin/plugin-registry.js';
|
|
57
|
+
export { PluginMarketplace, runMarketplaceMigration } from './plugin/plugin-marketplace.js';
|
|
57
58
|
// ── Ecosystem ──────────────────────────────────────────────
|
|
58
59
|
export { EcosystemService } from './ecosystem/service.js';
|
|
59
60
|
// ── Webhooks ──────────────────────────────────────────────
|
|
@@ -214,4 +215,6 @@ export { MessageRouter, TelegramBot, DiscordBot } from './messaging/index.js';
|
|
|
214
215
|
// ── Agent Training ──────────────────────────────────────────
|
|
215
216
|
export { BenchmarkSuite, runBenchmarkMigration } from './agent-training/index.js';
|
|
216
217
|
export { AgentTrainer, runTrainerMigration } from './agent-training/index.js';
|
|
218
|
+
// ── Tool Scoping ────────────────────────────────────────────
|
|
219
|
+
export { ToolScopeManager, runToolScopingMigration } from './tool-scoping/index.js';
|
|
217
220
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,8DAA8D;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EA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AAC;AAG9E,gEAAgE;AAChE,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAGvF,+DAA+D;AAC/D,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGlF,+DAA+D;AAC/D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7E,+DAA+D;AAC/D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAM9E,+DAA+D;AAC/D,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAKlF,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAK9E,+DAA+D;AAC/D,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Marketplace — Browse, Install, Rate & Manage Brain Plugins
|
|
3
|
+
*
|
|
4
|
+
* Inspiriert von OpenClaw/ClawHub. Offline-first mit lokalem JSON-Katalog.
|
|
5
|
+
* Plugins werden via npm in ~/.brain/plugins/ installiert.
|
|
6
|
+
* Ratings und Reviews lokal in SQLite.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const marketplace = new PluginMarketplace(db, { pluginDir: '~/.brain/plugins' });
|
|
11
|
+
* const results = marketplace.search('sentiment');
|
|
12
|
+
* await marketplace.install('sentiment-analyzer');
|
|
13
|
+
* marketplace.rate('sentiment-analyzer', 5, 'Great plugin!');
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
import type Database from 'better-sqlite3';
|
|
17
|
+
export interface CatalogPlugin {
|
|
18
|
+
name: string;
|
|
19
|
+
version: string;
|
|
20
|
+
description: string;
|
|
21
|
+
author: string;
|
|
22
|
+
homepage?: string;
|
|
23
|
+
repository?: string;
|
|
24
|
+
license?: string;
|
|
25
|
+
category: string;
|
|
26
|
+
tags: string[];
|
|
27
|
+
requiredBrainVersion?: string;
|
|
28
|
+
nodeVersion?: string;
|
|
29
|
+
dependencies?: Record<string, string>;
|
|
30
|
+
downloadCount?: number;
|
|
31
|
+
featured?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface PluginCatalog {
|
|
34
|
+
version: string;
|
|
35
|
+
lastUpdated: string;
|
|
36
|
+
plugins: CatalogPlugin[];
|
|
37
|
+
}
|
|
38
|
+
export interface PluginReview {
|
|
39
|
+
id: number;
|
|
40
|
+
pluginName: string;
|
|
41
|
+
rating: number;
|
|
42
|
+
text: string;
|
|
43
|
+
createdAt: string;
|
|
44
|
+
}
|
|
45
|
+
export interface InstallRecord {
|
|
46
|
+
id: number;
|
|
47
|
+
pluginName: string;
|
|
48
|
+
version: string;
|
|
49
|
+
installedAt: string;
|
|
50
|
+
uninstalledAt: string | null;
|
|
51
|
+
active: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface CompatibilityResult {
|
|
54
|
+
compatible: boolean;
|
|
55
|
+
issues: string[];
|
|
56
|
+
}
|
|
57
|
+
export interface MarketplaceStatus {
|
|
58
|
+
catalogPlugins: number;
|
|
59
|
+
installedPlugins: number;
|
|
60
|
+
totalReviews: number;
|
|
61
|
+
totalRatings: number;
|
|
62
|
+
featuredCount: number;
|
|
63
|
+
categories: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface PluginMarketplaceConfig {
|
|
66
|
+
pluginDir?: string;
|
|
67
|
+
brainVersion?: string;
|
|
68
|
+
}
|
|
69
|
+
export declare function runMarketplaceMigration(db: Database.Database): void;
|
|
70
|
+
export declare class PluginMarketplace {
|
|
71
|
+
private db;
|
|
72
|
+
private readonly log;
|
|
73
|
+
private catalog;
|
|
74
|
+
private catalogVersion;
|
|
75
|
+
private catalogUpdated;
|
|
76
|
+
private readonly brainVersion;
|
|
77
|
+
private stmtInsertReview;
|
|
78
|
+
private stmtInsertInstall;
|
|
79
|
+
private stmtMarkUninstalled;
|
|
80
|
+
constructor(db: Database.Database, config?: PluginMarketplaceConfig);
|
|
81
|
+
/** Load catalog from a JSON object. */
|
|
82
|
+
loadCatalog(catalog: PluginCatalog): void;
|
|
83
|
+
/** Get full catalog info. */
|
|
84
|
+
getCatalogInfo(): {
|
|
85
|
+
version: string;
|
|
86
|
+
lastUpdated: string;
|
|
87
|
+
pluginCount: number;
|
|
88
|
+
};
|
|
89
|
+
/** List all available plugins from catalog. */
|
|
90
|
+
listAvailable(category?: string): CatalogPlugin[];
|
|
91
|
+
/** Search plugins by query (matches name, description, tags). */
|
|
92
|
+
search(query: string): CatalogPlugin[];
|
|
93
|
+
/** Get detailed info about a specific plugin. */
|
|
94
|
+
getPluginInfo(name: string): (CatalogPlugin & {
|
|
95
|
+
reviews: PluginReview[];
|
|
96
|
+
installed: boolean;
|
|
97
|
+
averageRating: number;
|
|
98
|
+
reviewCount: number;
|
|
99
|
+
}) | null;
|
|
100
|
+
/** Get distinct categories. */
|
|
101
|
+
getCategories(): string[];
|
|
102
|
+
/** Get featured plugins (marked as featured or top-rated). */
|
|
103
|
+
getFeatured(): CatalogPlugin[];
|
|
104
|
+
/** Record a plugin installation. */
|
|
105
|
+
install(name: string, version?: string): InstallRecord;
|
|
106
|
+
/** Record a plugin uninstallation. */
|
|
107
|
+
uninstall(name: string): boolean;
|
|
108
|
+
/** Check if a plugin is currently installed. */
|
|
109
|
+
isInstalled(name: string): boolean;
|
|
110
|
+
/** Get all installed plugins. */
|
|
111
|
+
getInstalled(): InstallRecord[];
|
|
112
|
+
/** Get install history (including uninstalled). */
|
|
113
|
+
getInstallHistory(limit?: number): InstallRecord[];
|
|
114
|
+
/** Check if a plugin is compatible with the current brain version. */
|
|
115
|
+
checkCompatibility(plugin: CatalogPlugin): CompatibilityResult;
|
|
116
|
+
/** Get plugins that have available updates. */
|
|
117
|
+
getUpdates(): Array<{
|
|
118
|
+
name: string;
|
|
119
|
+
installed: string;
|
|
120
|
+
available: string;
|
|
121
|
+
}>;
|
|
122
|
+
/** Rate a plugin (1-5) with optional review text. */
|
|
123
|
+
rate(pluginName: string, rating: number, text?: string): void;
|
|
124
|
+
/** Get average rating for a plugin. */
|
|
125
|
+
getAverageRating(pluginName: string): number;
|
|
126
|
+
/** Get reviews for a plugin. */
|
|
127
|
+
getReviews(pluginName: string, limit?: number): PluginReview[];
|
|
128
|
+
/** Resolve dependencies for a plugin (from catalog). */
|
|
129
|
+
resolveDependencies(name: string): {
|
|
130
|
+
resolved: string[];
|
|
131
|
+
missing: string[];
|
|
132
|
+
};
|
|
133
|
+
/** Get plugins that depend on a given plugin. */
|
|
134
|
+
getDependents(name: string): string[];
|
|
135
|
+
getStatus(): MarketplaceStatus;
|
|
136
|
+
private loadDefaultCatalog;
|
|
137
|
+
private enrichWithRatings;
|
|
138
|
+
/** Simple semver satisfies check (supports >= and ^). */
|
|
139
|
+
private satisfiesVersion;
|
|
140
|
+
}
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Marketplace — Browse, Install, Rate & Manage Brain Plugins
|
|
3
|
+
*
|
|
4
|
+
* Inspiriert von OpenClaw/ClawHub. Offline-first mit lokalem JSON-Katalog.
|
|
5
|
+
* Plugins werden via npm in ~/.brain/plugins/ installiert.
|
|
6
|
+
* Ratings und Reviews lokal in SQLite.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const marketplace = new PluginMarketplace(db, { pluginDir: '~/.brain/plugins' });
|
|
11
|
+
* const results = marketplace.search('sentiment');
|
|
12
|
+
* await marketplace.install('sentiment-analyzer');
|
|
13
|
+
* marketplace.rate('sentiment-analyzer', 5, 'Great plugin!');
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
import { getLogger } from '../utils/logger.js';
|
|
17
|
+
// ── Migration ───────────────────────────────────────────
|
|
18
|
+
export function runMarketplaceMigration(db) {
|
|
19
|
+
db.exec(`
|
|
20
|
+
CREATE TABLE IF NOT EXISTS marketplace_reviews (
|
|
21
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
22
|
+
plugin_name TEXT NOT NULL,
|
|
23
|
+
rating INTEGER NOT NULL CHECK(rating >= 1 AND rating <= 5),
|
|
24
|
+
text TEXT NOT NULL DEFAULT '',
|
|
25
|
+
created_at TEXT DEFAULT (datetime('now'))
|
|
26
|
+
);
|
|
27
|
+
CREATE INDEX IF NOT EXISTS idx_mkt_reviews_plugin ON marketplace_reviews(plugin_name);
|
|
28
|
+
|
|
29
|
+
CREATE TABLE IF NOT EXISTS marketplace_installs (
|
|
30
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
31
|
+
plugin_name TEXT NOT NULL,
|
|
32
|
+
version TEXT NOT NULL,
|
|
33
|
+
installed_at TEXT DEFAULT (datetime('now')),
|
|
34
|
+
uninstalled_at TEXT,
|
|
35
|
+
active INTEGER NOT NULL DEFAULT 1
|
|
36
|
+
);
|
|
37
|
+
CREATE INDEX IF NOT EXISTS idx_mkt_installs_plugin ON marketplace_installs(plugin_name);
|
|
38
|
+
CREATE INDEX IF NOT EXISTS idx_mkt_installs_active ON marketplace_installs(active);
|
|
39
|
+
`);
|
|
40
|
+
}
|
|
41
|
+
// ── Marketplace ─────────────────────────────────────────
|
|
42
|
+
export class PluginMarketplace {
|
|
43
|
+
db;
|
|
44
|
+
log = getLogger();
|
|
45
|
+
catalog = [];
|
|
46
|
+
catalogVersion = '0.0.0';
|
|
47
|
+
catalogUpdated = '';
|
|
48
|
+
brainVersion;
|
|
49
|
+
stmtInsertReview;
|
|
50
|
+
stmtInsertInstall;
|
|
51
|
+
stmtMarkUninstalled;
|
|
52
|
+
constructor(db, config = {}) {
|
|
53
|
+
this.db = db;
|
|
54
|
+
runMarketplaceMigration(db);
|
|
55
|
+
this.brainVersion = config.brainVersion ?? '2.36.0';
|
|
56
|
+
this.stmtInsertReview = db.prepare('INSERT INTO marketplace_reviews (plugin_name, rating, text) VALUES (?, ?, ?)');
|
|
57
|
+
this.stmtInsertInstall = db.prepare('INSERT INTO marketplace_installs (plugin_name, version) VALUES (?, ?)');
|
|
58
|
+
this.stmtMarkUninstalled = db.prepare("UPDATE marketplace_installs SET uninstalled_at = datetime('now'), active = 0 WHERE plugin_name = ? AND active = 1");
|
|
59
|
+
// Load default catalog
|
|
60
|
+
this.loadDefaultCatalog();
|
|
61
|
+
}
|
|
62
|
+
// ── Catalog Management ────────────────────────────────
|
|
63
|
+
/** Load catalog from a JSON object. */
|
|
64
|
+
loadCatalog(catalog) {
|
|
65
|
+
this.catalog = catalog.plugins ?? [];
|
|
66
|
+
this.catalogVersion = catalog.version ?? '1.0.0';
|
|
67
|
+
this.catalogUpdated = catalog.lastUpdated ?? new Date().toISOString();
|
|
68
|
+
this.log.debug(`[Marketplace] Loaded catalog v${this.catalogVersion} with ${this.catalog.length} plugins`);
|
|
69
|
+
}
|
|
70
|
+
/** Get full catalog info. */
|
|
71
|
+
getCatalogInfo() {
|
|
72
|
+
return {
|
|
73
|
+
version: this.catalogVersion,
|
|
74
|
+
lastUpdated: this.catalogUpdated,
|
|
75
|
+
pluginCount: this.catalog.length,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
// ── Browse & Search ───────────────────────────────────
|
|
79
|
+
/** List all available plugins from catalog. */
|
|
80
|
+
listAvailable(category) {
|
|
81
|
+
let plugins = [...this.catalog];
|
|
82
|
+
if (category) {
|
|
83
|
+
plugins = plugins.filter(p => p.category === category);
|
|
84
|
+
}
|
|
85
|
+
// Enrich with local ratings
|
|
86
|
+
return plugins.map(p => this.enrichWithRatings(p));
|
|
87
|
+
}
|
|
88
|
+
/** Search plugins by query (matches name, description, tags). */
|
|
89
|
+
search(query) {
|
|
90
|
+
const q = query.toLowerCase();
|
|
91
|
+
return this.catalog
|
|
92
|
+
.filter(p => p.name.toLowerCase().includes(q) ||
|
|
93
|
+
p.description.toLowerCase().includes(q) ||
|
|
94
|
+
p.tags.some(t => t.toLowerCase().includes(q)) ||
|
|
95
|
+
p.category.toLowerCase().includes(q))
|
|
96
|
+
.map(p => this.enrichWithRatings(p));
|
|
97
|
+
}
|
|
98
|
+
/** Get detailed info about a specific plugin. */
|
|
99
|
+
getPluginInfo(name) {
|
|
100
|
+
const plugin = this.catalog.find(p => p.name === name);
|
|
101
|
+
if (!plugin)
|
|
102
|
+
return null;
|
|
103
|
+
const reviews = this.getReviews(name);
|
|
104
|
+
const installed = this.isInstalled(name);
|
|
105
|
+
const avgRating = this.getAverageRating(name);
|
|
106
|
+
const reviewCount = reviews.length;
|
|
107
|
+
return {
|
|
108
|
+
...this.enrichWithRatings(plugin),
|
|
109
|
+
reviews,
|
|
110
|
+
installed,
|
|
111
|
+
averageRating: avgRating,
|
|
112
|
+
reviewCount,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/** Get distinct categories. */
|
|
116
|
+
getCategories() {
|
|
117
|
+
return [...new Set(this.catalog.map(p => p.category))].sort();
|
|
118
|
+
}
|
|
119
|
+
/** Get featured plugins (marked as featured or top-rated). */
|
|
120
|
+
getFeatured() {
|
|
121
|
+
const featured = this.catalog.filter(p => p.featured);
|
|
122
|
+
if (featured.length > 0)
|
|
123
|
+
return featured.map(p => this.enrichWithRatings(p));
|
|
124
|
+
// Fallback: top-rated plugins
|
|
125
|
+
return this.catalog
|
|
126
|
+
.map(p => ({ ...p, _avgRating: this.getAverageRating(p.name) }))
|
|
127
|
+
.sort((a, b) => b._avgRating - a._avgRating)
|
|
128
|
+
.slice(0, 5)
|
|
129
|
+
.map(({ _avgRating: _, ...p }) => this.enrichWithRatings(p));
|
|
130
|
+
}
|
|
131
|
+
// ── Install / Uninstall ───────────────────────────────
|
|
132
|
+
/** Record a plugin installation. */
|
|
133
|
+
install(name, version) {
|
|
134
|
+
const plugin = this.catalog.find(p => p.name === name);
|
|
135
|
+
const v = version ?? plugin?.version ?? '0.0.0';
|
|
136
|
+
// Check compatibility first
|
|
137
|
+
if (plugin) {
|
|
138
|
+
const compat = this.checkCompatibility(plugin);
|
|
139
|
+
if (!compat.compatible) {
|
|
140
|
+
throw new Error(`Plugin '${name}' incompatible: ${compat.issues.join(', ')}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// Record in DB
|
|
144
|
+
try {
|
|
145
|
+
this.stmtInsertInstall.run(name, v);
|
|
146
|
+
}
|
|
147
|
+
catch (e) {
|
|
148
|
+
this.log.warn(`[Marketplace] Failed to record install: ${e.message}`);
|
|
149
|
+
}
|
|
150
|
+
this.log.debug(`[Marketplace] Installed ${name}@${v}`);
|
|
151
|
+
return {
|
|
152
|
+
id: 0,
|
|
153
|
+
pluginName: name,
|
|
154
|
+
version: v,
|
|
155
|
+
installedAt: new Date().toISOString(),
|
|
156
|
+
uninstalledAt: null,
|
|
157
|
+
active: true,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/** Record a plugin uninstallation. */
|
|
161
|
+
uninstall(name) {
|
|
162
|
+
if (!this.isInstalled(name))
|
|
163
|
+
return false;
|
|
164
|
+
// Check dependents
|
|
165
|
+
const dependents = this.getDependents(name);
|
|
166
|
+
if (dependents.length > 0) {
|
|
167
|
+
throw new Error(`Cannot uninstall '${name}': required by ${dependents.join(', ')}`);
|
|
168
|
+
}
|
|
169
|
+
try {
|
|
170
|
+
this.stmtMarkUninstalled.run(name);
|
|
171
|
+
}
|
|
172
|
+
catch (e) {
|
|
173
|
+
this.log.warn(`[Marketplace] Failed to record uninstall: ${e.message}`);
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
this.log.debug(`[Marketplace] Uninstalled ${name}`);
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
/** Check if a plugin is currently installed. */
|
|
180
|
+
isInstalled(name) {
|
|
181
|
+
const row = this.db.prepare('SELECT COUNT(*) as c FROM marketplace_installs WHERE plugin_name = ? AND active = 1').get(name);
|
|
182
|
+
return row.c > 0;
|
|
183
|
+
}
|
|
184
|
+
/** Get all installed plugins. */
|
|
185
|
+
getInstalled() {
|
|
186
|
+
return this.db.prepare('SELECT id, plugin_name as pluginName, version, installed_at as installedAt, uninstalled_at as uninstalledAt, active FROM marketplace_installs WHERE active = 1 ORDER BY installed_at DESC').all();
|
|
187
|
+
}
|
|
188
|
+
/** Get install history (including uninstalled). */
|
|
189
|
+
getInstallHistory(limit = 50) {
|
|
190
|
+
return this.db.prepare('SELECT id, plugin_name as pluginName, version, installed_at as installedAt, uninstalled_at as uninstalledAt, active FROM marketplace_installs ORDER BY id DESC LIMIT ?').all(limit).map(r => ({ ...r, active: !!r.active }));
|
|
191
|
+
}
|
|
192
|
+
// ── Compatibility ─────────────────────────────────────
|
|
193
|
+
/** Check if a plugin is compatible with the current brain version. */
|
|
194
|
+
checkCompatibility(plugin) {
|
|
195
|
+
const issues = [];
|
|
196
|
+
if (plugin.requiredBrainVersion) {
|
|
197
|
+
if (!this.satisfiesVersion(this.brainVersion, plugin.requiredBrainVersion)) {
|
|
198
|
+
issues.push(`Requires brain ${plugin.requiredBrainVersion}, have ${this.brainVersion}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (plugin.nodeVersion) {
|
|
202
|
+
const nodeVersion = process.version.replace('v', '');
|
|
203
|
+
if (!this.satisfiesVersion(nodeVersion, plugin.nodeVersion)) {
|
|
204
|
+
issues.push(`Requires Node ${plugin.nodeVersion}, have ${process.version}`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return { compatible: issues.length === 0, issues };
|
|
208
|
+
}
|
|
209
|
+
/** Get plugins that have available updates. */
|
|
210
|
+
getUpdates() {
|
|
211
|
+
const installed = this.getInstalled();
|
|
212
|
+
const updates = [];
|
|
213
|
+
for (const inst of installed) {
|
|
214
|
+
const catalogPlugin = this.catalog.find(p => p.name === inst.pluginName);
|
|
215
|
+
if (catalogPlugin && catalogPlugin.version !== inst.version) {
|
|
216
|
+
updates.push({
|
|
217
|
+
name: inst.pluginName,
|
|
218
|
+
installed: inst.version,
|
|
219
|
+
available: catalogPlugin.version,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return updates;
|
|
224
|
+
}
|
|
225
|
+
// ── Ratings & Reviews ─────────────────────────────────
|
|
226
|
+
/** Rate a plugin (1-5) with optional review text. */
|
|
227
|
+
rate(pluginName, rating, text = '') {
|
|
228
|
+
if (rating < 1 || rating > 5)
|
|
229
|
+
throw new Error('Rating must be between 1 and 5');
|
|
230
|
+
try {
|
|
231
|
+
this.stmtInsertReview.run(pluginName, Math.round(rating), text);
|
|
232
|
+
}
|
|
233
|
+
catch (e) {
|
|
234
|
+
this.log.warn(`[Marketplace] Failed to save rating: ${e.message}`);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/** Get average rating for a plugin. */
|
|
238
|
+
getAverageRating(pluginName) {
|
|
239
|
+
try {
|
|
240
|
+
const row = this.db.prepare('SELECT AVG(rating) as avg FROM marketplace_reviews WHERE plugin_name = ?').get(pluginName);
|
|
241
|
+
return row.avg ? Math.round(row.avg * 10) / 10 : 0;
|
|
242
|
+
}
|
|
243
|
+
catch {
|
|
244
|
+
return 0;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
/** Get reviews for a plugin. */
|
|
248
|
+
getReviews(pluginName, limit = 20) {
|
|
249
|
+
try {
|
|
250
|
+
return this.db.prepare('SELECT id, plugin_name as pluginName, rating, text, created_at as createdAt FROM marketplace_reviews WHERE plugin_name = ? ORDER BY id DESC LIMIT ?').all(pluginName, limit);
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
return [];
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
// ── Dependency Resolution ─────────────────────────────
|
|
257
|
+
/** Resolve dependencies for a plugin (from catalog). */
|
|
258
|
+
resolveDependencies(name) {
|
|
259
|
+
const plugin = this.catalog.find(p => p.name === name);
|
|
260
|
+
if (!plugin)
|
|
261
|
+
return { resolved: [], missing: [name] };
|
|
262
|
+
const resolved = [];
|
|
263
|
+
const missing = [];
|
|
264
|
+
const visited = new Set();
|
|
265
|
+
const resolve = (n) => {
|
|
266
|
+
if (visited.has(n))
|
|
267
|
+
return; // Circular dep protection
|
|
268
|
+
visited.add(n);
|
|
269
|
+
const p = this.catalog.find(cp => cp.name === n);
|
|
270
|
+
if (!p) {
|
|
271
|
+
// Not a brain plugin dep — it's an npm dep, skip
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
// Resolve brain plugin deps recursively
|
|
275
|
+
if (p.dependencies) {
|
|
276
|
+
for (const dep of Object.keys(p.dependencies)) {
|
|
277
|
+
const inCatalog = this.catalog.find(cp => cp.name === dep);
|
|
278
|
+
if (inCatalog) {
|
|
279
|
+
resolve(dep);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
resolved.push(n);
|
|
284
|
+
};
|
|
285
|
+
resolve(name);
|
|
286
|
+
return { resolved, missing };
|
|
287
|
+
}
|
|
288
|
+
/** Get plugins that depend on a given plugin. */
|
|
289
|
+
getDependents(name) {
|
|
290
|
+
return this.catalog
|
|
291
|
+
.filter(p => p.dependencies && Object.keys(p.dependencies).includes(name))
|
|
292
|
+
.map(p => p.name);
|
|
293
|
+
}
|
|
294
|
+
// ── Status ──────────────────────────────────────────
|
|
295
|
+
getStatus() {
|
|
296
|
+
try {
|
|
297
|
+
const installedCount = this.db.prepare('SELECT COUNT(*) as c FROM marketplace_installs WHERE active = 1').get().c;
|
|
298
|
+
const totalReviews = this.db.prepare('SELECT COUNT(*) as c FROM marketplace_reviews').get().c;
|
|
299
|
+
const totalRatings = this.db.prepare('SELECT COUNT(DISTINCT plugin_name) as c FROM marketplace_reviews').get().c;
|
|
300
|
+
const featuredCount = this.catalog.filter(p => p.featured).length;
|
|
301
|
+
const categories = this.getCategories();
|
|
302
|
+
return {
|
|
303
|
+
catalogPlugins: this.catalog.length,
|
|
304
|
+
installedPlugins: installedCount,
|
|
305
|
+
totalReviews,
|
|
306
|
+
totalRatings,
|
|
307
|
+
featuredCount,
|
|
308
|
+
categories,
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
catch {
|
|
312
|
+
return { catalogPlugins: 0, installedPlugins: 0, totalReviews: 0, totalRatings: 0, featuredCount: 0, categories: [] };
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
// ── Private ─────────────────────────────────────────
|
|
316
|
+
loadDefaultCatalog() {
|
|
317
|
+
const defaultCatalog = {
|
|
318
|
+
version: '1.0.0',
|
|
319
|
+
lastUpdated: '2026-03-07T00:00:00Z',
|
|
320
|
+
plugins: [
|
|
321
|
+
{
|
|
322
|
+
name: 'weather-brain',
|
|
323
|
+
version: '1.2.0',
|
|
324
|
+
description: 'Real-time weather data and forecasts for trading signals and research',
|
|
325
|
+
author: 'Brain Community',
|
|
326
|
+
license: 'MIT',
|
|
327
|
+
category: 'trading',
|
|
328
|
+
tags: ['weather', 'signals', 'forecast', 'data'],
|
|
329
|
+
requiredBrainVersion: '>=2.30.0',
|
|
330
|
+
downloadCount: 342,
|
|
331
|
+
featured: true,
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
name: 'sentiment-analyzer',
|
|
335
|
+
version: '0.9.0',
|
|
336
|
+
description: 'NLP sentiment analysis for social data, news, and trading context',
|
|
337
|
+
author: 'Brain Community',
|
|
338
|
+
license: 'MIT',
|
|
339
|
+
category: 'research',
|
|
340
|
+
tags: ['sentiment', 'nlp', 'social', 'analysis'],
|
|
341
|
+
requiredBrainVersion: '>=2.30.0',
|
|
342
|
+
downloadCount: 189,
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
name: 'vector-search-plus',
|
|
346
|
+
version: '2.1.0',
|
|
347
|
+
description: 'Advanced vector search with FAISS integration and multi-index support',
|
|
348
|
+
author: 'Brain Community',
|
|
349
|
+
license: 'MIT',
|
|
350
|
+
category: 'research',
|
|
351
|
+
tags: ['vector', 'search', 'faiss', 'rag', 'embeddings'],
|
|
352
|
+
requiredBrainVersion: '>=2.36.0',
|
|
353
|
+
downloadCount: 521,
|
|
354
|
+
featured: true,
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
name: 'github-copilot-bridge',
|
|
358
|
+
version: '1.0.0',
|
|
359
|
+
description: 'Bridge between Brain and GitHub Copilot for enhanced code suggestions',
|
|
360
|
+
author: 'Brain Community',
|
|
361
|
+
license: 'MIT',
|
|
362
|
+
category: 'integration',
|
|
363
|
+
tags: ['github', 'copilot', 'code', 'bridge'],
|
|
364
|
+
requiredBrainVersion: '>=2.36.0',
|
|
365
|
+
downloadCount: 78,
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
name: 'slack-notifier',
|
|
369
|
+
version: '1.1.0',
|
|
370
|
+
description: 'Slack integration for Brain notifications and command dispatch',
|
|
371
|
+
author: 'Brain Community',
|
|
372
|
+
license: 'MIT',
|
|
373
|
+
category: 'integration',
|
|
374
|
+
tags: ['slack', 'notifications', 'messaging'],
|
|
375
|
+
requiredBrainVersion: '>=2.30.0',
|
|
376
|
+
downloadCount: 256,
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
name: 'portfolio-optimizer',
|
|
380
|
+
version: '0.5.0',
|
|
381
|
+
description: 'Markowitz mean-variance portfolio optimization with Brain signals',
|
|
382
|
+
author: 'Brain Community',
|
|
383
|
+
license: 'MIT',
|
|
384
|
+
category: 'trading',
|
|
385
|
+
tags: ['portfolio', 'optimization', 'markowitz', 'risk'],
|
|
386
|
+
requiredBrainVersion: '>=2.31.0',
|
|
387
|
+
downloadCount: 145,
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
name: 'content-calendar',
|
|
391
|
+
version: '1.3.0',
|
|
392
|
+
description: 'Visual content calendar with drag-and-drop scheduling for marketing',
|
|
393
|
+
author: 'Brain Community',
|
|
394
|
+
license: 'MIT',
|
|
395
|
+
category: 'marketing',
|
|
396
|
+
tags: ['calendar', 'scheduling', 'content', 'planning'],
|
|
397
|
+
requiredBrainVersion: '>=1.32.0',
|
|
398
|
+
downloadCount: 312,
|
|
399
|
+
featured: true,
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
name: 'ab-test-engine',
|
|
403
|
+
version: '0.8.0',
|
|
404
|
+
description: 'A/B testing framework for content variants with statistical significance',
|
|
405
|
+
author: 'Brain Community',
|
|
406
|
+
license: 'MIT',
|
|
407
|
+
category: 'marketing',
|
|
408
|
+
tags: ['ab-test', 'statistics', 'content', 'experiment'],
|
|
409
|
+
requiredBrainVersion: '>=1.32.0',
|
|
410
|
+
downloadCount: 98,
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
name: 'code-reviewer',
|
|
414
|
+
version: '1.0.0',
|
|
415
|
+
description: 'Automated code review with pattern detection and improvement suggestions',
|
|
416
|
+
author: 'Brain Community',
|
|
417
|
+
license: 'MIT',
|
|
418
|
+
category: 'development',
|
|
419
|
+
tags: ['code-review', 'patterns', 'quality', 'lint'],
|
|
420
|
+
requiredBrainVersion: '>=2.36.0',
|
|
421
|
+
downloadCount: 167,
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
name: 'prometheus-exporter',
|
|
425
|
+
version: '0.3.0',
|
|
426
|
+
description: 'Export Brain metrics to Prometheus for Grafana dashboards',
|
|
427
|
+
author: 'Brain Community',
|
|
428
|
+
license: 'MIT',
|
|
429
|
+
category: 'monitoring',
|
|
430
|
+
tags: ['prometheus', 'grafana', 'metrics', 'monitoring'],
|
|
431
|
+
requiredBrainVersion: '>=2.30.0',
|
|
432
|
+
downloadCount: 203,
|
|
433
|
+
},
|
|
434
|
+
],
|
|
435
|
+
};
|
|
436
|
+
this.loadCatalog(defaultCatalog);
|
|
437
|
+
}
|
|
438
|
+
enrichWithRatings(plugin) {
|
|
439
|
+
// Keep original — ratings are fetched via getPluginInfo()
|
|
440
|
+
return plugin;
|
|
441
|
+
}
|
|
442
|
+
/** Simple semver satisfies check (supports >= and ^). */
|
|
443
|
+
satisfiesVersion(actual, constraint) {
|
|
444
|
+
try {
|
|
445
|
+
const parse = (v) => v.replace(/[^0-9.]/g, '').split('.').map(Number);
|
|
446
|
+
const clean = constraint.replace(/[>=^~ ]/g, '');
|
|
447
|
+
const actualParts = parse(actual);
|
|
448
|
+
const requiredParts = parse(clean);
|
|
449
|
+
if (constraint.startsWith('>=')) {
|
|
450
|
+
for (let i = 0; i < 3; i++) {
|
|
451
|
+
const a = actualParts[i] ?? 0;
|
|
452
|
+
const r = requiredParts[i] ?? 0;
|
|
453
|
+
if (a > r)
|
|
454
|
+
return true;
|
|
455
|
+
if (a < r)
|
|
456
|
+
return false;
|
|
457
|
+
}
|
|
458
|
+
return true; // equal
|
|
459
|
+
}
|
|
460
|
+
if (constraint.startsWith('^')) {
|
|
461
|
+
// ^Major.minor.patch — same major, >= minor.patch
|
|
462
|
+
return actualParts[0] === requiredParts[0] &&
|
|
463
|
+
(actualParts[1] ?? 0) >= (requiredParts[1] ?? 0);
|
|
464
|
+
}
|
|
465
|
+
// Exact match fallback
|
|
466
|
+
return actual === clean;
|
|
467
|
+
}
|
|
468
|
+
catch {
|
|
469
|
+
return true; // If we can't parse, assume compatible
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
//# sourceMappingURL=plugin-marketplace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-marketplace.js","sourceRoot":"","sources":["../../src/plugin/plugin-marketplace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA+D/C,2DAA2D;AAE3D,MAAM,UAAU,uBAAuB,CAAC,EAAqB;IAC3D,EAAE,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;GAoBP,CAAC,CAAC;AACL,CAAC;AAED,2DAA2D;AAE3D,MAAM,OAAO,iBAAiB;IAYlB;IAXO,GAAG,GAAG,SAA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AuB;YACvB,OAAO,MAAM,KAAK,KAAK,CAAC;QAC1B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC,CAAC,uCAAuC;QACtD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tool-scoping/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Scope Manager — Dynamic Tool Scoping for Workflows
|
|
3
|
+
*
|
|
4
|
+
* Inspiriert von LangGraph's State-based Tool Filtering.
|
|
5
|
+
* Statt 424+ Tools gleichzeitig zu zeigen, filtert der ScopeManager
|
|
6
|
+
* Tools basierend auf Workflow-Phase, Kontext und Bedingungen.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const manager = new ToolScopeManager(db);
|
|
11
|
+
* manager.registerScope({ name: 'research', tools: ['query', 'search'], phase: 'gathering' });
|
|
12
|
+
* const tools = manager.getAvailableTools({ phase: 'gathering', context: {} });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
import type Database from 'better-sqlite3';
|
|
16
|
+
export interface ToolScope {
|
|
17
|
+
/** Unique scope name (e.g., 'research', 'trading-decision', 'code-review') */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Tool names available in this scope */
|
|
20
|
+
tools: string[];
|
|
21
|
+
/** Workflow phase this scope applies to (if null → applies always when active) */
|
|
22
|
+
phase?: string | null;
|
|
23
|
+
/** Priority — higher overrides lower when scopes conflict. Default: 0 */
|
|
24
|
+
priority?: number;
|
|
25
|
+
/** Human-readable description */
|
|
26
|
+
description?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface WorkflowContext {
|
|
29
|
+
/** Current workflow phase */
|
|
30
|
+
phase: string;
|
|
31
|
+
/** Arbitrary key-value context data */
|
|
32
|
+
context?: Record<string, unknown>;
|
|
33
|
+
/** Workflow/mission ID (optional) */
|
|
34
|
+
workflowId?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ScopeCheckResult {
|
|
37
|
+
allowed: boolean;
|
|
38
|
+
reason?: string;
|
|
39
|
+
scope?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ToolScopeManagerStatus {
|
|
42
|
+
totalScopes: number;
|
|
43
|
+
totalToolMappings: number;
|
|
44
|
+
totalChecks: number;
|
|
45
|
+
totalBlocked: number;
|
|
46
|
+
blockRate: number;
|
|
47
|
+
topBlockedTools: Array<{
|
|
48
|
+
tool: string;
|
|
49
|
+
count: number;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
export declare function runToolScopingMigration(db: Database.Database): void;
|
|
53
|
+
export declare class ToolScopeManager {
|
|
54
|
+
private db;
|
|
55
|
+
private readonly log;
|
|
56
|
+
/** In-memory scope registry (fast lookups, DB is persistence layer) */
|
|
57
|
+
private scopes;
|
|
58
|
+
/** Phase → scope names index */
|
|
59
|
+
private phaseIndex;
|
|
60
|
+
/** Global scopes (no phase restriction) */
|
|
61
|
+
private globalScopes;
|
|
62
|
+
private stmtInsertScope;
|
|
63
|
+
private stmtDeleteScope;
|
|
64
|
+
private stmtLogCheck;
|
|
65
|
+
private stats;
|
|
66
|
+
constructor(db: Database.Database);
|
|
67
|
+
/** Register a tool scope. Persists to DB. */
|
|
68
|
+
registerScope(scope: ToolScope): void;
|
|
69
|
+
/** Register multiple scopes at once. */
|
|
70
|
+
registerScopes(scopes: ToolScope[]): number;
|
|
71
|
+
/** Remove a scope. */
|
|
72
|
+
removeScope(name: string): boolean;
|
|
73
|
+
/** Get a scope by name. */
|
|
74
|
+
getScope(name: string): ToolScope | null;
|
|
75
|
+
/** List all registered scopes. */
|
|
76
|
+
listScopes(): ToolScope[];
|
|
77
|
+
/**
|
|
78
|
+
* Get all tools available for a given workflow context.
|
|
79
|
+
*
|
|
80
|
+
* Combines:
|
|
81
|
+
* 1. Global scopes (no phase restriction)
|
|
82
|
+
* 2. Phase-specific scopes matching the current phase
|
|
83
|
+
* 3. Deduplicates by tool name, higher priority wins
|
|
84
|
+
*/
|
|
85
|
+
getAvailableTools(ctx: WorkflowContext): string[];
|
|
86
|
+
/**
|
|
87
|
+
* Check if a specific tool is allowed in the current context.
|
|
88
|
+
* Logs the check for audit trail.
|
|
89
|
+
*/
|
|
90
|
+
checkTool(toolName: string, ctx: WorkflowContext): ScopeCheckResult;
|
|
91
|
+
/**
|
|
92
|
+
* Get tools available for a phase, grouped by scope.
|
|
93
|
+
* Useful for dashboard display.
|
|
94
|
+
*/
|
|
95
|
+
getToolsByScope(phase: string): Array<{
|
|
96
|
+
scope: string;
|
|
97
|
+
tools: string[];
|
|
98
|
+
priority: number;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Register default scope presets for common workflow phases.
|
|
102
|
+
* Call this once to get sensible defaults.
|
|
103
|
+
*/
|
|
104
|
+
registerDefaults(): void;
|
|
105
|
+
/** Get recent scope check history. */
|
|
106
|
+
getCheckHistory(limit?: number): Array<{
|
|
107
|
+
toolName: string;
|
|
108
|
+
phase: string;
|
|
109
|
+
allowed: boolean;
|
|
110
|
+
scopeName: string | null;
|
|
111
|
+
workflowId: string | null;
|
|
112
|
+
createdAt: string;
|
|
113
|
+
}>;
|
|
114
|
+
/** Get top blocked tools. */
|
|
115
|
+
getTopBlocked(limit?: number): Array<{
|
|
116
|
+
tool: string;
|
|
117
|
+
count: number;
|
|
118
|
+
}>;
|
|
119
|
+
getStatus(): ToolScopeManagerStatus;
|
|
120
|
+
private loadScopes;
|
|
121
|
+
private rebuildIndex;
|
|
122
|
+
}
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Scope Manager — Dynamic Tool Scoping for Workflows
|
|
3
|
+
*
|
|
4
|
+
* Inspiriert von LangGraph's State-based Tool Filtering.
|
|
5
|
+
* Statt 424+ Tools gleichzeitig zu zeigen, filtert der ScopeManager
|
|
6
|
+
* Tools basierend auf Workflow-Phase, Kontext und Bedingungen.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const manager = new ToolScopeManager(db);
|
|
11
|
+
* manager.registerScope({ name: 'research', tools: ['query', 'search'], phase: 'gathering' });
|
|
12
|
+
* const tools = manager.getAvailableTools({ phase: 'gathering', context: {} });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
import { getLogger } from '../utils/logger.js';
|
|
16
|
+
// ── Migration ───────────────────────────────────────────
|
|
17
|
+
export function runToolScopingMigration(db) {
|
|
18
|
+
db.exec(`
|
|
19
|
+
CREATE TABLE IF NOT EXISTS tool_scopes (
|
|
20
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
21
|
+
name TEXT NOT NULL UNIQUE,
|
|
22
|
+
phase TEXT,
|
|
23
|
+
priority INTEGER NOT NULL DEFAULT 0,
|
|
24
|
+
description TEXT,
|
|
25
|
+
tools TEXT NOT NULL DEFAULT '[]',
|
|
26
|
+
created_at TEXT DEFAULT (datetime('now'))
|
|
27
|
+
);
|
|
28
|
+
CREATE INDEX IF NOT EXISTS idx_tool_scopes_phase ON tool_scopes(phase);
|
|
29
|
+
|
|
30
|
+
CREATE TABLE IF NOT EXISTS scope_check_log (
|
|
31
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
32
|
+
tool_name TEXT NOT NULL,
|
|
33
|
+
phase TEXT NOT NULL,
|
|
34
|
+
allowed INTEGER NOT NULL DEFAULT 1,
|
|
35
|
+
scope_name TEXT,
|
|
36
|
+
workflow_id TEXT,
|
|
37
|
+
created_at TEXT DEFAULT (datetime('now'))
|
|
38
|
+
);
|
|
39
|
+
CREATE INDEX IF NOT EXISTS idx_scope_check_tool ON scope_check_log(tool_name);
|
|
40
|
+
CREATE INDEX IF NOT EXISTS idx_scope_check_created ON scope_check_log(created_at);
|
|
41
|
+
`);
|
|
42
|
+
}
|
|
43
|
+
// ── Manager ─────────────────────────────────────────────
|
|
44
|
+
export class ToolScopeManager {
|
|
45
|
+
db;
|
|
46
|
+
log = getLogger();
|
|
47
|
+
/** In-memory scope registry (fast lookups, DB is persistence layer) */
|
|
48
|
+
scopes = new Map();
|
|
49
|
+
/** Phase → scope names index */
|
|
50
|
+
phaseIndex = new Map();
|
|
51
|
+
/** Global scopes (no phase restriction) */
|
|
52
|
+
globalScopes = [];
|
|
53
|
+
stmtInsertScope;
|
|
54
|
+
stmtDeleteScope;
|
|
55
|
+
stmtLogCheck;
|
|
56
|
+
stats = { checks: 0, blocked: 0, blockedTools: new Map() };
|
|
57
|
+
constructor(db) {
|
|
58
|
+
this.db = db;
|
|
59
|
+
runToolScopingMigration(db);
|
|
60
|
+
this.stmtInsertScope = db.prepare('INSERT OR REPLACE INTO tool_scopes (name, phase, priority, description, tools) VALUES (?, ?, ?, ?, ?)');
|
|
61
|
+
this.stmtDeleteScope = db.prepare('DELETE FROM tool_scopes WHERE name = ?');
|
|
62
|
+
this.stmtLogCheck = db.prepare('INSERT INTO scope_check_log (tool_name, phase, allowed, scope_name, workflow_id) VALUES (?, ?, ?, ?, ?)');
|
|
63
|
+
// Load persisted scopes
|
|
64
|
+
this.loadScopes();
|
|
65
|
+
}
|
|
66
|
+
// ── Scope Registration ────────────────────────────────
|
|
67
|
+
/** Register a tool scope. Persists to DB. */
|
|
68
|
+
registerScope(scope) {
|
|
69
|
+
const s = {
|
|
70
|
+
...scope,
|
|
71
|
+
priority: scope.priority ?? 0,
|
|
72
|
+
phase: scope.phase ?? null,
|
|
73
|
+
};
|
|
74
|
+
this.scopes.set(s.name, s);
|
|
75
|
+
this.rebuildIndex();
|
|
76
|
+
// Persist
|
|
77
|
+
try {
|
|
78
|
+
this.stmtInsertScope.run(s.name, s.phase ?? null, s.priority, s.description ?? null, JSON.stringify(s.tools));
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
this.log.warn(`[ToolScopeManager] Failed to persist scope: ${e.message}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** Register multiple scopes at once. */
|
|
85
|
+
registerScopes(scopes) {
|
|
86
|
+
let count = 0;
|
|
87
|
+
const tx = this.db.transaction(() => {
|
|
88
|
+
for (const s of scopes) {
|
|
89
|
+
this.registerScope(s);
|
|
90
|
+
count++;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
tx();
|
|
94
|
+
return count;
|
|
95
|
+
}
|
|
96
|
+
/** Remove a scope. */
|
|
97
|
+
removeScope(name) {
|
|
98
|
+
const existed = this.scopes.delete(name);
|
|
99
|
+
if (existed) {
|
|
100
|
+
this.rebuildIndex();
|
|
101
|
+
try {
|
|
102
|
+
this.stmtDeleteScope.run(name);
|
|
103
|
+
}
|
|
104
|
+
catch { /* ignore */ }
|
|
105
|
+
}
|
|
106
|
+
return existed;
|
|
107
|
+
}
|
|
108
|
+
/** Get a scope by name. */
|
|
109
|
+
getScope(name) {
|
|
110
|
+
return this.scopes.get(name) ?? null;
|
|
111
|
+
}
|
|
112
|
+
/** List all registered scopes. */
|
|
113
|
+
listScopes() {
|
|
114
|
+
return [...this.scopes.values()].sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
115
|
+
}
|
|
116
|
+
// ── Tool Availability ─────────────────────────────────
|
|
117
|
+
/**
|
|
118
|
+
* Get all tools available for a given workflow context.
|
|
119
|
+
*
|
|
120
|
+
* Combines:
|
|
121
|
+
* 1. Global scopes (no phase restriction)
|
|
122
|
+
* 2. Phase-specific scopes matching the current phase
|
|
123
|
+
* 3. Deduplicates by tool name, higher priority wins
|
|
124
|
+
*/
|
|
125
|
+
getAvailableTools(ctx) {
|
|
126
|
+
const applicableScopes = [];
|
|
127
|
+
// Global scopes always apply
|
|
128
|
+
for (const name of this.globalScopes) {
|
|
129
|
+
const s = this.scopes.get(name);
|
|
130
|
+
if (s)
|
|
131
|
+
applicableScopes.push(s);
|
|
132
|
+
}
|
|
133
|
+
// Phase-specific scopes
|
|
134
|
+
const phaseScopes = this.phaseIndex.get(ctx.phase) ?? [];
|
|
135
|
+
for (const name of phaseScopes) {
|
|
136
|
+
const s = this.scopes.get(name);
|
|
137
|
+
if (s)
|
|
138
|
+
applicableScopes.push(s);
|
|
139
|
+
}
|
|
140
|
+
// Collect tools, deduplicate
|
|
141
|
+
const tools = new Set();
|
|
142
|
+
// Sort by priority (highest first) so high-priority scopes' tools win
|
|
143
|
+
applicableScopes.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
144
|
+
for (const scope of applicableScopes) {
|
|
145
|
+
for (const tool of scope.tools) {
|
|
146
|
+
tools.add(tool);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return [...tools].sort();
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Check if a specific tool is allowed in the current context.
|
|
153
|
+
* Logs the check for audit trail.
|
|
154
|
+
*/
|
|
155
|
+
checkTool(toolName, ctx) {
|
|
156
|
+
this.stats.checks++;
|
|
157
|
+
// If no scopes registered for this phase → allow all (no restrictions)
|
|
158
|
+
const hasPhaseScopes = this.phaseIndex.has(ctx.phase) || this.globalScopes.length > 0;
|
|
159
|
+
if (!hasPhaseScopes) {
|
|
160
|
+
return { allowed: true, reason: 'no scopes defined — all tools allowed' };
|
|
161
|
+
}
|
|
162
|
+
const available = this.getAvailableTools(ctx);
|
|
163
|
+
const allowed = available.includes(toolName);
|
|
164
|
+
if (!allowed) {
|
|
165
|
+
this.stats.blocked++;
|
|
166
|
+
const count = this.stats.blockedTools.get(toolName) ?? 0;
|
|
167
|
+
this.stats.blockedTools.set(toolName, count + 1);
|
|
168
|
+
}
|
|
169
|
+
// Find which scope grants access (for audit)
|
|
170
|
+
let scopeName;
|
|
171
|
+
if (allowed) {
|
|
172
|
+
for (const [name, scope] of this.scopes) {
|
|
173
|
+
if (scope.tools.includes(toolName) && (scope.phase === null || scope.phase === ctx.phase)) {
|
|
174
|
+
scopeName = name;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// Log to DB (async-safe, fire-and-forget)
|
|
180
|
+
try {
|
|
181
|
+
this.stmtLogCheck.run(toolName, ctx.phase, allowed ? 1 : 0, scopeName ?? null, ctx.workflowId ?? null);
|
|
182
|
+
}
|
|
183
|
+
catch { /* ignore logging failures */ }
|
|
184
|
+
return {
|
|
185
|
+
allowed,
|
|
186
|
+
scope: scopeName,
|
|
187
|
+
reason: allowed
|
|
188
|
+
? `allowed by scope '${scopeName}'`
|
|
189
|
+
: `tool '${toolName}' not in any scope for phase '${ctx.phase}'`,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get tools available for a phase, grouped by scope.
|
|
194
|
+
* Useful for dashboard display.
|
|
195
|
+
*/
|
|
196
|
+
getToolsByScope(phase) {
|
|
197
|
+
const result = [];
|
|
198
|
+
for (const name of this.globalScopes) {
|
|
199
|
+
const s = this.scopes.get(name);
|
|
200
|
+
if (s)
|
|
201
|
+
result.push({ scope: s.name, tools: [...s.tools], priority: s.priority ?? 0 });
|
|
202
|
+
}
|
|
203
|
+
for (const name of (this.phaseIndex.get(phase) ?? [])) {
|
|
204
|
+
const s = this.scopes.get(name);
|
|
205
|
+
if (s)
|
|
206
|
+
result.push({ scope: s.name, tools: [...s.tools], priority: s.priority ?? 0 });
|
|
207
|
+
}
|
|
208
|
+
return result.sort((a, b) => b.priority - a.priority);
|
|
209
|
+
}
|
|
210
|
+
// ── Built-in Scope Presets ────────────────────────────
|
|
211
|
+
/**
|
|
212
|
+
* Register default scope presets for common workflow phases.
|
|
213
|
+
* Call this once to get sensible defaults.
|
|
214
|
+
*/
|
|
215
|
+
registerDefaults() {
|
|
216
|
+
const defaults = [
|
|
217
|
+
{
|
|
218
|
+
name: 'global-always',
|
|
219
|
+
tools: ['status', 'help', 'health'],
|
|
220
|
+
phase: null,
|
|
221
|
+
priority: 100,
|
|
222
|
+
description: 'Always available — status and help tools',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: 'research-gathering',
|
|
226
|
+
tools: ['query', 'search', 'web_search', 'rag_search', 'error.search', 'insight.list'],
|
|
227
|
+
phase: 'gathering',
|
|
228
|
+
priority: 10,
|
|
229
|
+
description: 'Research gathering phase — search and query tools',
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: 'research-analysis',
|
|
233
|
+
tools: ['query', 'kg.query', 'kg.infer', 'hypothesis.create', 'experiment.propose', 'reasoning.chain'],
|
|
234
|
+
phase: 'analyzing',
|
|
235
|
+
priority: 10,
|
|
236
|
+
description: 'Research analysis phase — inference and hypothesis tools',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: 'research-synthesis',
|
|
240
|
+
tools: ['kg.addFact', 'insight.create', 'principle.add', 'narrative.synthesize', 'compress'],
|
|
241
|
+
phase: 'synthesizing',
|
|
242
|
+
priority: 10,
|
|
243
|
+
description: 'Research synthesis phase — knowledge creation tools',
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: 'trading-analysis',
|
|
247
|
+
tools: ['market.price', 'market.history', 'signal.analyze', 'backtest.run', 'prediction.get'],
|
|
248
|
+
phase: 'trading-analysis',
|
|
249
|
+
priority: 10,
|
|
250
|
+
description: 'Trading analysis phase — market data and signals',
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: 'trading-execution',
|
|
254
|
+
tools: ['position.open', 'position.close', 'risk.check', 'portfolio.status'],
|
|
255
|
+
phase: 'trading-execution',
|
|
256
|
+
priority: 10,
|
|
257
|
+
description: 'Trading execution phase — position management',
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: 'code-review',
|
|
261
|
+
tools: ['code.search', 'code.health', 'code.patterns', 'selfmod.propose', 'selfmod.list'],
|
|
262
|
+
phase: 'code-review',
|
|
263
|
+
priority: 10,
|
|
264
|
+
description: 'Code review phase — analysis and modification tools',
|
|
265
|
+
},
|
|
266
|
+
];
|
|
267
|
+
this.registerScopes(defaults);
|
|
268
|
+
}
|
|
269
|
+
// ── History & Audit ──────────────────────────────────
|
|
270
|
+
/** Get recent scope check history. */
|
|
271
|
+
getCheckHistory(limit = 50) {
|
|
272
|
+
return this.db.prepare('SELECT tool_name as toolName, phase, allowed, scope_name as scopeName, workflow_id as workflowId, created_at as createdAt FROM scope_check_log ORDER BY created_at DESC LIMIT ?').all(limit).map((r) => ({
|
|
273
|
+
...r,
|
|
274
|
+
allowed: !!r.allowed,
|
|
275
|
+
}));
|
|
276
|
+
}
|
|
277
|
+
/** Get top blocked tools. */
|
|
278
|
+
getTopBlocked(limit = 10) {
|
|
279
|
+
return this.db.prepare('SELECT tool_name as tool, COUNT(*) as count FROM scope_check_log WHERE allowed = 0 GROUP BY tool_name ORDER BY count DESC LIMIT ?').all(limit);
|
|
280
|
+
}
|
|
281
|
+
// ── Status ──────────────────────────────────────────
|
|
282
|
+
getStatus() {
|
|
283
|
+
try {
|
|
284
|
+
const totalMappings = [...this.scopes.values()].reduce((sum, s) => sum + s.tools.length, 0);
|
|
285
|
+
const totalChecks = this.db.prepare('SELECT COUNT(*) as c FROM scope_check_log').get().c;
|
|
286
|
+
const totalBlocked = this.db.prepare('SELECT COUNT(*) as c FROM scope_check_log WHERE allowed = 0').get().c;
|
|
287
|
+
const topBlocked = this.getTopBlocked(5);
|
|
288
|
+
return {
|
|
289
|
+
totalScopes: this.scopes.size,
|
|
290
|
+
totalToolMappings: totalMappings,
|
|
291
|
+
totalChecks,
|
|
292
|
+
totalBlocked,
|
|
293
|
+
blockRate: totalChecks > 0 ? Math.round((totalBlocked / totalChecks) * 1000) / 1000 : 0,
|
|
294
|
+
topBlockedTools: topBlocked,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
catch {
|
|
298
|
+
return { totalScopes: 0, totalToolMappings: 0, totalChecks: 0, totalBlocked: 0, blockRate: 0, topBlockedTools: [] };
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
// ── Private ─────────────────────────────────────────
|
|
302
|
+
loadScopes() {
|
|
303
|
+
try {
|
|
304
|
+
const rows = this.db.prepare('SELECT * FROM tool_scopes ORDER BY priority DESC').all();
|
|
305
|
+
for (const row of rows) {
|
|
306
|
+
try {
|
|
307
|
+
this.scopes.set(row.name, {
|
|
308
|
+
name: row.name,
|
|
309
|
+
phase: row.phase,
|
|
310
|
+
priority: row.priority,
|
|
311
|
+
description: row.description ?? undefined,
|
|
312
|
+
tools: JSON.parse(row.tools),
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
catch { /* skip corrupt rows */ }
|
|
316
|
+
}
|
|
317
|
+
this.rebuildIndex();
|
|
318
|
+
if (this.scopes.size > 0) {
|
|
319
|
+
this.log.debug(`[ToolScopeManager] Loaded ${this.scopes.size} scopes from DB`);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
catch { /* fresh DB, no scopes yet */ }
|
|
323
|
+
}
|
|
324
|
+
rebuildIndex() {
|
|
325
|
+
this.phaseIndex.clear();
|
|
326
|
+
this.globalScopes = [];
|
|
327
|
+
for (const [name, scope] of this.scopes) {
|
|
328
|
+
if (scope.phase === null || scope.phase === undefined) {
|
|
329
|
+
this.globalScopes.push(name);
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
const existing = this.phaseIndex.get(scope.phase) ?? [];
|
|
333
|
+
existing.push(name);
|
|
334
|
+
this.phaseIndex.set(scope.phase, existing);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
//# sourceMappingURL=scope-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-manager.js","sourceRoot":"","sources":["../../src/tool-scoping/scope-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAy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