agent-discover 1.0.22 → 1.0.25
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/agent-desk-plugin.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/storage/database.ts"],"names":[],"mappings":"AAeA,OAAO,
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/storage/database.ts"],"names":[],"mappings":"AAeA,OAAO,EAIL,KAAK,EAAE,EAER,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,WAAW,SAAS;IACxB,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,QAAQ,CAAC,OAAO,GAAE,SAAc,GAAG,EAAE,CAGpD"}
|
package/dist/storage/database.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
2
|
// agent-discover — Storage layer
|
|
3
3
|
//
|
|
4
|
-
// Thin wrapper around agent-common's createDb.
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
4
|
+
// Thin wrapper around agent-common's createDb. Uses adoptUserVersion so
|
|
5
|
+
// existing installations that previously tracked schema via `pragma
|
|
6
|
+
// user_version` migrate cleanly to agent-common's _meta-table runner without
|
|
7
|
+
// re-running migrations against tables that already have the columns. All
|
|
8
|
+
// ALTER TABLE statements in v2/v3 use addColumnIfMissing to stay idempotent
|
|
9
|
+
// on partially-migrated DBs.
|
|
10
10
|
// =============================================================================
|
|
11
|
-
import Database from 'better-sqlite3';
|
|
12
11
|
import { homedir } from 'os';
|
|
13
12
|
import { join } from 'path';
|
|
14
13
|
import { mkdirSync } from 'fs';
|
|
15
|
-
import { createDb as createKitDb } from 'agent-common';
|
|
14
|
+
import { createDb as createKitDb, addColumnIfMissing, hasColumn, } from 'agent-common';
|
|
16
15
|
export function createDb(options = {}) {
|
|
17
16
|
const path = resolveDbPath(options.path);
|
|
18
|
-
|
|
19
|
-
return createKitDb({ path, migrations, verbose: options.verbose });
|
|
17
|
+
return createKitDb({ path, migrations, verbose: options.verbose, adoptUserVersion: true });
|
|
20
18
|
}
|
|
21
19
|
function resolveDbPath(path) {
|
|
22
20
|
if (path)
|
|
@@ -28,41 +26,11 @@ function resolveDbPath(path) {
|
|
|
28
26
|
mkdirSync(dir, { recursive: true });
|
|
29
27
|
return join(dir, 'agent-discover.db');
|
|
30
28
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Bridge legacy pragma user_version DBs into agent-common's _meta table.
|
|
33
|
-
* Opens the DB once, copies user_version → _meta.schema_version (if _meta is
|
|
34
|
-
* empty), then closes. Safe on fresh DBs (both values are 0). Skipped for
|
|
35
|
-
* in-memory DBs.
|
|
36
|
-
*/
|
|
37
|
-
function seedMetaFromUserVersion(path) {
|
|
38
|
-
if (path === ':memory:')
|
|
39
|
-
return;
|
|
40
|
-
const raw = new Database(path);
|
|
41
|
-
try {
|
|
42
|
-
raw.exec(`CREATE TABLE IF NOT EXISTS _meta (key TEXT PRIMARY KEY, value TEXT NOT NULL)`);
|
|
43
|
-
const existing = raw.prepare(`SELECT value FROM _meta WHERE key = 'schema_version'`).get();
|
|
44
|
-
if (existing)
|
|
45
|
-
return;
|
|
46
|
-
const userVersion = raw.pragma('user_version', { simple: true });
|
|
47
|
-
if (userVersion > 0) {
|
|
48
|
-
raw
|
|
49
|
-
.prepare(`INSERT INTO _meta (key, value) VALUES ('schema_version', ?)`)
|
|
50
|
-
.run(String(userVersion));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
finally {
|
|
54
|
-
raw.close();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
29
|
// ---------------------------------------------------------------------------
|
|
58
30
|
// Migrations — version-ordered, applied by agent-common's runner.
|
|
59
31
|
// All ALTER TABLE statements are guarded so they're safe to re-run on DBs
|
|
60
32
|
// that legacy pragma-user_version code already touched.
|
|
61
33
|
// ---------------------------------------------------------------------------
|
|
62
|
-
function hasColumn(db, table, column) {
|
|
63
|
-
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
64
|
-
return cols.some((c) => c.name === column);
|
|
65
|
-
}
|
|
66
34
|
const migrations = [
|
|
67
35
|
{
|
|
68
36
|
version: 1,
|
|
@@ -124,21 +92,11 @@ const migrations = [
|
|
|
124
92
|
{
|
|
125
93
|
version: 2,
|
|
126
94
|
up: (db) => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
if (!hasColumn(db, 'servers', 'last_health_check')) {
|
|
134
|
-
db.exec(`ALTER TABLE servers ADD COLUMN last_health_check TEXT`);
|
|
135
|
-
}
|
|
136
|
-
if (!hasColumn(db, 'servers', 'health_status')) {
|
|
137
|
-
db.exec(`ALTER TABLE servers ADD COLUMN health_status TEXT DEFAULT 'unknown'`);
|
|
138
|
-
}
|
|
139
|
-
if (!hasColumn(db, 'servers', 'error_count')) {
|
|
140
|
-
db.exec(`ALTER TABLE servers ADD COLUMN error_count INTEGER DEFAULT 0`);
|
|
141
|
-
}
|
|
95
|
+
addColumnIfMissing(db, 'servers', 'approval_status', "TEXT DEFAULT 'experimental'");
|
|
96
|
+
addColumnIfMissing(db, 'servers', 'latest_version', 'TEXT');
|
|
97
|
+
addColumnIfMissing(db, 'servers', 'last_health_check', 'TEXT');
|
|
98
|
+
addColumnIfMissing(db, 'servers', 'health_status', "TEXT DEFAULT 'unknown'");
|
|
99
|
+
addColumnIfMissing(db, 'servers', 'error_count', 'INTEGER DEFAULT 0');
|
|
142
100
|
db.exec(`
|
|
143
101
|
CREATE TABLE IF NOT EXISTS server_secrets (
|
|
144
102
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../src/storage/database.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,iCAAiC;AACjC,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../src/storage/database.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,iCAAiC;AACjC,EAAE;AACF,wEAAwE;AACxE,oEAAoE;AACpE,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,6BAA6B;AAC7B,gFAAgF;AAGhF,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EACL,QAAQ,IAAI,WAAW,EACvB,kBAAkB,EAClB,SAAS,GAGV,MAAM,cAAc,CAAC;AAWtB,MAAM,UAAU,QAAQ,CAAC,UAAqB,EAAE;IAC9C,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,WAAW,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,aAAa,CAAC,IAAa;IAClC,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAC9C,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IACvC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC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
|
|
4
4
|
"mcpName": "io.github.keshrath/agent-discover",
|
|
5
5
|
"description": "MCP server registry and marketplace — discover, install, activate, and manage MCP tools on demand",
|
|
6
6
|
"type": "module",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"start:server": "node dist/server.js",
|
|
30
30
|
"test": "vitest run",
|
|
31
31
|
"test:watch": "vitest",
|
|
32
|
+
"test:e2e:ui": "playwright test",
|
|
32
33
|
"test:coverage": "vitest run --coverage",
|
|
33
34
|
"lint": "eslint src/ tests/",
|
|
34
35
|
"lint:fix": "eslint src/ tests/ --fix",
|
|
@@ -49,13 +50,14 @@
|
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
52
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
52
|
-
"agent-common": "^1.0
|
|
53
|
+
"agent-common": "^1.1.0",
|
|
53
54
|
"better-sqlite3": "12.8.0",
|
|
54
55
|
"morphdom": "^2.7.8",
|
|
55
56
|
"ws": "8.20.0"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@eslint/js": "^10.0.1",
|
|
60
|
+
"@playwright/test": "^1.59.1",
|
|
59
61
|
"@types/better-sqlite3": "^7.6.13",
|
|
60
62
|
"@types/node": "^22.0.0",
|
|
61
63
|
"@types/ws": "^8.18.1",
|