@adhd/agent-store-tools 2.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.
Files changed (66) hide show
  1. package/drizzle/0000_dry_roulette.sql +18 -0
  2. package/drizzle/0001_gray_talkback.sql +20 -0
  3. package/drizzle/0002_aberrant_blink.sql +7 -0
  4. package/drizzle/0003_foamy_otto_octavius.sql +10 -0
  5. package/drizzle/meta/0000_snapshot.json +129 -0
  6. package/drizzle/meta/0001_snapshot.json +251 -0
  7. package/drizzle/meta/0002_snapshot.json +298 -0
  8. package/drizzle/meta/0003_snapshot.json +358 -0
  9. package/drizzle/meta/_journal.json +34 -0
  10. package/package.json +50 -0
  11. package/src/db/client.d.ts +7 -0
  12. package/src/db/client.d.ts.map +1 -0
  13. package/src/db/client.js +18 -0
  14. package/src/db/client.js.map +1 -0
  15. package/src/db/migrate-runner.d.ts +30 -0
  16. package/src/db/migrate-runner.d.ts.map +1 -0
  17. package/src/db/migrate-runner.js +34 -0
  18. package/src/db/migrate-runner.js.map +1 -0
  19. package/src/db/migrate.d.ts +9 -0
  20. package/src/db/migrate.d.ts.map +1 -0
  21. package/src/db/migrate.js +13 -0
  22. package/src/db/migrate.js.map +1 -0
  23. package/src/db/schema.d.ts +584 -0
  24. package/src/db/schema.d.ts.map +1 -0
  25. package/src/db/schema.js +150 -0
  26. package/src/db/schema.js.map +1 -0
  27. package/src/index.d.ts +13 -0
  28. package/src/index.d.ts.map +1 -0
  29. package/src/index.js +11 -0
  30. package/src/index.js.map +1 -0
  31. package/src/seed/bindings.d.ts +21 -0
  32. package/src/seed/bindings.d.ts.map +1 -0
  33. package/src/seed/bindings.js +167 -0
  34. package/src/seed/bindings.js.map +1 -0
  35. package/src/seed/index.d.ts +29 -0
  36. package/src/seed/index.d.ts.map +1 -0
  37. package/src/seed/index.js +80 -0
  38. package/src/seed/index.js.map +1 -0
  39. package/src/seed/platforms.d.ts +17 -0
  40. package/src/seed/platforms.d.ts.map +1 -0
  41. package/src/seed/platforms.js +48 -0
  42. package/src/seed/platforms.js.map +1 -0
  43. package/src/seed/tool-types.d.ts +15 -0
  44. package/src/seed/tool-types.d.ts.map +1 -0
  45. package/src/seed/tool-types.js +35 -0
  46. package/src/seed/tool-types.js.map +1 -0
  47. package/src/seed/tools.d.ts +18 -0
  48. package/src/seed/tools.d.ts.map +1 -0
  49. package/src/seed/tools.js +117 -0
  50. package/src/seed/tools.js.map +1 -0
  51. package/src/store/agent-tool-store.d.ts +63 -0
  52. package/src/store/agent-tool-store.d.ts.map +1 -0
  53. package/src/store/agent-tool-store.js +100 -0
  54. package/src/store/agent-tool-store.js.map +1 -0
  55. package/src/store/binding-store.d.ts +75 -0
  56. package/src/store/binding-store.d.ts.map +1 -0
  57. package/src/store/binding-store.js +144 -0
  58. package/src/store/binding-store.js.map +1 -0
  59. package/src/store/mcp-server-store.d.ts +46 -0
  60. package/src/store/mcp-server-store.d.ts.map +1 -0
  61. package/src/store/mcp-server-store.js +89 -0
  62. package/src/store/mcp-server-store.js.map +1 -0
  63. package/src/store/tool-store.d.ts +55 -0
  64. package/src/store/tool-store.d.ts.map +1 -0
  65. package/src/store/tool-store.js +115 -0
  66. package/src/store/tool-store.js.map +1 -0
@@ -0,0 +1,89 @@
1
+ import { eq } from 'drizzle-orm';
2
+ import { mcpServersTable } from '../db/schema.js';
3
+ export class McpServerStoreError extends Error {
4
+ code;
5
+ constructor(code, message) {
6
+ super(message);
7
+ this.code = code;
8
+ this.name = 'McpServerStoreError';
9
+ }
10
+ }
11
+ // ──────────────────────────────────────────────
12
+ // McpServerStore
13
+ //
14
+ // Thin Drizzle queries over mcp_servers.
15
+ // Mirrors the pattern in entrypoint/agent-mcp's AgentStore (agent-cache-store pattern).
16
+ // Constructor accepts a BetterSQLite3Database so tests can inject their own
17
+ // connection without touching the production singleton in client.ts.
18
+ // ──────────────────────────────────────────────
19
+ export class McpServerStore {
20
+ db;
21
+ constructor(db) {
22
+ this.db = db;
23
+ }
24
+ /**
25
+ * Register an MCP server.
26
+ * Throws MCP_SERVER_ALREADY_EXISTS if the id PK already exists.
27
+ */
28
+ create(input) {
29
+ const existing = this.db
30
+ .select()
31
+ .from(mcpServersTable)
32
+ .where(eq(mcpServersTable.id, input.id))
33
+ .get();
34
+ if (existing) {
35
+ throw new McpServerStoreError('MCP_SERVER_ALREADY_EXISTS', `MCP server '${input.id}' already exists`);
36
+ }
37
+ const server = {
38
+ id: input.id,
39
+ transport: input.transport,
40
+ name: input.name,
41
+ providedToolIds: input.providedToolIds ?? [],
42
+ configSchema: input.configSchema ?? {},
43
+ };
44
+ this.db
45
+ .insert(mcpServersTable)
46
+ .values({
47
+ id: server.id,
48
+ transport: server.transport,
49
+ name: server.name,
50
+ providedToolIds: server.providedToolIds,
51
+ configSchema: server.configSchema,
52
+ })
53
+ .run();
54
+ return server;
55
+ }
56
+ /**
57
+ * Read an MCP server by id.
58
+ * Throws MCP_SERVER_NOT_FOUND if absent.
59
+ */
60
+ read(id) {
61
+ const row = this.db
62
+ .select()
63
+ .from(mcpServersTable)
64
+ .where(eq(mcpServersTable.id, id))
65
+ .get();
66
+ if (!row) {
67
+ throw new McpServerStoreError('MCP_SERVER_NOT_FOUND', `MCP server '${id}' not found`);
68
+ }
69
+ return {
70
+ id: row.id,
71
+ transport: row.transport,
72
+ name: row.name,
73
+ providedToolIds: row.providedToolIds,
74
+ configSchema: row.configSchema,
75
+ };
76
+ }
77
+ /** List all registered MCP servers. */
78
+ list() {
79
+ const rows = this.db.select().from(mcpServersTable).all();
80
+ return rows.map((row) => ({
81
+ id: row.id,
82
+ transport: row.transport,
83
+ name: row.name,
84
+ providedToolIds: row.providedToolIds,
85
+ configSchema: row.configSchema,
86
+ }));
87
+ }
88
+ }
89
+ //# sourceMappingURL=mcp-server-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-server-store.js","sourceRoot":"","sources":["../../../../../../packages/agent/agent-store-tools/src/store/mcp-server-store.ts"],"names":[],"mappings":"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55 @@
1
+ import type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
2
+ /** A seeded tool-type classification row (text PK, never an enum). */
3
+ export interface ToolType {
4
+ slug: string;
5
+ description: string;
6
+ }
7
+ /** A canonical, platform-independent agent capability. */
8
+ export interface Tool {
9
+ name: string;
10
+ type: string;
11
+ description: string;
12
+ version: number;
13
+ requiresApproval: boolean;
14
+ isDestructive: boolean;
15
+ dependencyToolIds: string[];
16
+ capabilities: string[];
17
+ }
18
+ /** Input for creating a canonical tool. */
19
+ export interface ToolCreateInput {
20
+ name: string;
21
+ type: string;
22
+ description: string;
23
+ /** Defaults to 1 if omitted. */
24
+ version?: number;
25
+ requiresApproval?: boolean;
26
+ isDestructive?: boolean;
27
+ dependencyToolIds?: string[];
28
+ capabilities?: string[];
29
+ }
30
+ export type ToolStoreErrorCode = 'TOOL_ALREADY_EXISTS' | 'TOOL_NOT_FOUND' | 'TOOL_TYPE_NOT_FOUND';
31
+ export declare class ToolStoreError extends Error {
32
+ readonly code: ToolStoreErrorCode;
33
+ constructor(code: ToolStoreErrorCode, message: string);
34
+ }
35
+ export declare class ToolStore {
36
+ private readonly db;
37
+ constructor(db: BetterSQLite3Database<Record<string, never>>);
38
+ /** Seed or upsert a tool-type lookup row. */
39
+ seedToolType(input: ToolType): void;
40
+ /** Return all seeded tool types. */
41
+ listToolTypes(): ToolType[];
42
+ /**
43
+ * Create a canonical tool row.
44
+ * Throws TOOL_ALREADY_EXISTS if the name PK already exists.
45
+ */
46
+ create(input: ToolCreateInput): Tool;
47
+ /**
48
+ * Read a canonical tool by name.
49
+ * Throws TOOL_NOT_FOUND if absent.
50
+ */
51
+ read(name: string): Tool;
52
+ /** List all canonical tools. */
53
+ list(): Tool[];
54
+ }
55
+ //# sourceMappingURL=tool-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-store.d.ts","sourceRoot":"","sources":["../../../../../../packages/agent/agent-store-tools/src/store/tool-store.ts"],"names":[],"mappings":"AAEA,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AI,QAAQ,EAAE;IAM3B;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IA0CpC;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAuBxB,gCAAgC;IAChC,IAAI,IAAI,IAAI,EAAE;CAaf"}
@@ -0,0 +1,115 @@
1
+ import { eq } from 'drizzle-orm';
2
+ import { toolTypesTable, toolsTable } from '../db/schema.js';
3
+ export class ToolStoreError extends Error {
4
+ code;
5
+ constructor(code, message) {
6
+ super(message);
7
+ this.code = code;
8
+ this.name = 'ToolStoreError';
9
+ }
10
+ }
11
+ // ──────────────────────────────────────────────
12
+ // ToolStore
13
+ //
14
+ // Thin Drizzle queries over tool_types and tools.
15
+ // Mirrors the pattern in entrypoint/agent-mcp's AgentStore (agent-cache-store pattern).
16
+ // Constructor accepts a BetterSQLite3Database so tests can inject their own
17
+ // connection without touching the production singleton in client.ts.
18
+ // ──────────────────────────────────────────────
19
+ export class ToolStore {
20
+ db;
21
+ constructor(db) {
22
+ this.db = db;
23
+ }
24
+ // ── tool_types ────────────────────────────
25
+ /** Seed or upsert a tool-type lookup row. */
26
+ seedToolType(input) {
27
+ this.db
28
+ .insert(toolTypesTable)
29
+ .values({ slug: input.slug, description: input.description })
30
+ .onConflictDoNothing()
31
+ .run();
32
+ }
33
+ /** Return all seeded tool types. */
34
+ listToolTypes() {
35
+ return this.db.select().from(toolTypesTable).all();
36
+ }
37
+ // ── tools ─────────────────────────────────
38
+ /**
39
+ * Create a canonical tool row.
40
+ * Throws TOOL_ALREADY_EXISTS if the name PK already exists.
41
+ */
42
+ create(input) {
43
+ const existing = this.db
44
+ .select()
45
+ .from(toolsTable)
46
+ .where(eq(toolsTable.name, input.name))
47
+ .get();
48
+ if (existing) {
49
+ throw new ToolStoreError('TOOL_ALREADY_EXISTS', `Tool '${input.name}' already exists`);
50
+ }
51
+ const tool = {
52
+ name: input.name,
53
+ type: input.type,
54
+ description: input.description,
55
+ version: input.version ?? 1,
56
+ requiresApproval: input.requiresApproval ?? false,
57
+ isDestructive: input.isDestructive ?? false,
58
+ dependencyToolIds: input.dependencyToolIds ?? [],
59
+ capabilities: input.capabilities ?? [],
60
+ };
61
+ this.db
62
+ .insert(toolsTable)
63
+ .values({
64
+ name: tool.name,
65
+ type: tool.type,
66
+ description: tool.description,
67
+ version: tool.version,
68
+ requiresApproval: tool.requiresApproval,
69
+ isDestructive: tool.isDestructive,
70
+ dependencyToolIds: tool.dependencyToolIds,
71
+ capabilities: tool.capabilities,
72
+ })
73
+ .run();
74
+ return tool;
75
+ }
76
+ /**
77
+ * Read a canonical tool by name.
78
+ * Throws TOOL_NOT_FOUND if absent.
79
+ */
80
+ read(name) {
81
+ const row = this.db
82
+ .select()
83
+ .from(toolsTable)
84
+ .where(eq(toolsTable.name, name))
85
+ .get();
86
+ if (!row) {
87
+ throw new ToolStoreError('TOOL_NOT_FOUND', `Tool '${name}' not found`);
88
+ }
89
+ return {
90
+ name: row.name,
91
+ type: row.type,
92
+ description: row.description,
93
+ version: row.version,
94
+ requiresApproval: row.requiresApproval,
95
+ isDestructive: row.isDestructive,
96
+ dependencyToolIds: row.dependencyToolIds,
97
+ capabilities: row.capabilities,
98
+ };
99
+ }
100
+ /** List all canonical tools. */
101
+ list() {
102
+ const rows = this.db.select().from(toolsTable).all();
103
+ return rows.map((row) => ({
104
+ name: row.name,
105
+ type: row.type,
106
+ description: row.description,
107
+ version: row.version,
108
+ requiresApproval: row.requiresApproval,
109
+ isDestructive: row.isDestructive,
110
+ dependencyToolIds: row.dependencyToolIds,
111
+ capabilities: row.capabilities,
112
+ }));
113
+ }
114
+ }
115
+ //# sourceMappingURL=tool-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-store.js","sourceRoot":"","sources":["../../../../../../packages/agent/agent-store-tools/src/store/tool-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAIjC,OAAO,EAAE,c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