pilot-ai 0.3.14 → 0.4.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 (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +303 -0
  3. package/dist/agent/core.d.ts.map +1 -1
  4. package/dist/agent/core.js +19 -1
  5. package/dist/agent/core.js.map +1 -1
  6. package/dist/agent/mcp-manager.d.ts +44 -0
  7. package/dist/agent/mcp-manager.d.ts.map +1 -0
  8. package/dist/agent/mcp-manager.js +127 -0
  9. package/dist/agent/mcp-manager.js.map +1 -0
  10. package/dist/agent/tool-descriptions.d.ts.map +1 -1
  11. package/dist/agent/tool-descriptions.js +15 -0
  12. package/dist/agent/tool-descriptions.js.map +1 -1
  13. package/dist/cli/init.js +60 -8
  14. package/dist/cli/init.js.map +1 -1
  15. package/dist/config/schema.d.ts +9 -0
  16. package/dist/config/schema.d.ts.map +1 -1
  17. package/dist/config/schema.js +7 -0
  18. package/dist/config/schema.js.map +1 -1
  19. package/dist/config/store.d.ts.map +1 -1
  20. package/dist/config/store.js +15 -3
  21. package/dist/config/store.js.map +1 -1
  22. package/dist/tools/google-auth.d.ts +34 -0
  23. package/dist/tools/google-auth.d.ts.map +1 -0
  24. package/dist/tools/google-auth.js +123 -0
  25. package/dist/tools/google-auth.js.map +1 -0
  26. package/dist/tools/google-calendar.d.ts +68 -0
  27. package/dist/tools/google-calendar.d.ts.map +1 -0
  28. package/dist/tools/google-calendar.js +124 -0
  29. package/dist/tools/google-calendar.js.map +1 -0
  30. package/dist/tools/google-drive.d.ts +43 -0
  31. package/dist/tools/google-drive.d.ts.map +1 -0
  32. package/dist/tools/google-drive.js +146 -0
  33. package/dist/tools/google-drive.js.map +1 -0
  34. package/dist/tools/mcp-registry.d.ts +38 -0
  35. package/dist/tools/mcp-registry.d.ts.map +1 -0
  36. package/dist/tools/mcp-registry.js +146 -0
  37. package/dist/tools/mcp-registry.js.map +1 -0
  38. package/package.json +1 -1
@@ -0,0 +1,43 @@
1
+ export interface DriveFile {
2
+ id: string;
3
+ name: string;
4
+ mimeType: string;
5
+ size?: string;
6
+ modifiedTime?: string;
7
+ parents?: string[];
8
+ webViewLink?: string;
9
+ }
10
+ export interface DriveSearchResult {
11
+ files: DriveFile[];
12
+ nextPageToken?: string;
13
+ }
14
+ /**
15
+ * Lists files in a folder or root.
16
+ */
17
+ export declare function listFiles(folderId?: string, maxResults?: number): Promise<DriveFile[]>;
18
+ /**
19
+ * Searches for files by name or content.
20
+ */
21
+ export declare function searchFiles(query: string, maxResults?: number): Promise<DriveFile[]>;
22
+ /**
23
+ * Gets file metadata.
24
+ */
25
+ export declare function getFile(fileId: string): Promise<DriveFile>;
26
+ /**
27
+ * Downloads file content as text. Works for Google Docs (exported as plain text),
28
+ * or regular files.
29
+ */
30
+ export declare function downloadFileContent(fileId: string, mimeType?: string): Promise<string>;
31
+ /**
32
+ * Creates a new file in Google Drive.
33
+ */
34
+ export declare function createFile(name: string, content: string, mimeType?: string, folderId?: string): Promise<DriveFile>;
35
+ /**
36
+ * Lists folders (for navigation).
37
+ */
38
+ export declare function listFolders(parentId?: string): Promise<DriveFile[]>;
39
+ /**
40
+ * Finds a folder by name.
41
+ */
42
+ export declare function findFolder(name: string): Promise<DriveFile | null>;
43
+ //# sourceMappingURL=google-drive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-drive.d.ts","sourceRoot":"","sources":["../../src/tools/google-drive.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAkBD;;GAEG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,CAAC,EAAE,MAAM,EACjB,UAAU,GAAE,MAAW,GACtB,OAAO,CAAC,SAAS,EAAE,CAAC,CAatB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAW,GACtB,OAAO,CAAC,SAAS,EAAE,CAAC,CAWtB;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAKhE;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoB5F;AAED;;GAEG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAAqB,EAC/B,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,SAAS,CAAC,CAoCpB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAYzE;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAUxE"}
@@ -0,0 +1,146 @@
1
+ /**
2
+ * Google Drive integration via REST API.
3
+ * Uses shared Google OAuth2 module for authentication.
4
+ */
5
+ import { getGoogleAccessToken } from './google-auth.js';
6
+ const DRIVE_API = 'https://www.googleapis.com/drive/v3';
7
+ async function driveFetch(path, init) {
8
+ const token = await getGoogleAccessToken();
9
+ const res = await fetch(`${DRIVE_API}${path}`, {
10
+ ...init,
11
+ headers: {
12
+ Authorization: `Bearer ${token}`,
13
+ ...init?.headers,
14
+ },
15
+ });
16
+ if (!res.ok) {
17
+ const err = await res.text();
18
+ throw new Error(`Google Drive API error (${res.status}): ${err}`);
19
+ }
20
+ return res.json();
21
+ }
22
+ /**
23
+ * Lists files in a folder or root.
24
+ */
25
+ export async function listFiles(folderId, maxResults = 20) {
26
+ const q = folderId
27
+ ? `'${folderId}' in parents and trashed=false`
28
+ : `'root' in parents and trashed=false`;
29
+ const params = new URLSearchParams({
30
+ q,
31
+ pageSize: String(maxResults),
32
+ fields: 'files(id,name,mimeType,size,modifiedTime,parents,webViewLink)',
33
+ orderBy: 'modifiedTime desc',
34
+ });
35
+ const data = await driveFetch(`/files?${params}`);
36
+ return data.files ?? [];
37
+ }
38
+ /**
39
+ * Searches for files by name or content.
40
+ */
41
+ export async function searchFiles(query, maxResults = 20) {
42
+ const q = `name contains '${query.replace(/'/g, "\\'")}' and trashed=false`;
43
+ const params = new URLSearchParams({
44
+ q,
45
+ pageSize: String(maxResults),
46
+ fields: 'files(id,name,mimeType,size,modifiedTime,parents,webViewLink)',
47
+ orderBy: 'modifiedTime desc',
48
+ });
49
+ const data = await driveFetch(`/files?${params}`);
50
+ return data.files ?? [];
51
+ }
52
+ /**
53
+ * Gets file metadata.
54
+ */
55
+ export async function getFile(fileId) {
56
+ const params = new URLSearchParams({
57
+ fields: 'id,name,mimeType,size,modifiedTime,parents,webViewLink',
58
+ });
59
+ return driveFetch(`/files/${fileId}?${params}`);
60
+ }
61
+ /**
62
+ * Downloads file content as text. Works for Google Docs (exported as plain text),
63
+ * or regular files.
64
+ */
65
+ export async function downloadFileContent(fileId, mimeType) {
66
+ const token = await getGoogleAccessToken();
67
+ // Google Docs/Sheets/Slides need export
68
+ const googleDocTypes = {
69
+ 'application/vnd.google-apps.document': 'text/plain',
70
+ 'application/vnd.google-apps.spreadsheet': 'text/csv',
71
+ 'application/vnd.google-apps.presentation': 'text/plain',
72
+ };
73
+ const exportMime = mimeType ? googleDocTypes[mimeType] : undefined;
74
+ const url = exportMime
75
+ ? `${DRIVE_API}/files/${fileId}/export?mimeType=${encodeURIComponent(exportMime)}`
76
+ : `${DRIVE_API}/files/${fileId}?alt=media`;
77
+ const res = await fetch(url, {
78
+ headers: { Authorization: `Bearer ${token}` },
79
+ });
80
+ if (!res.ok)
81
+ throw new Error(`Drive download error: ${res.status}`);
82
+ return res.text();
83
+ }
84
+ /**
85
+ * Creates a new file in Google Drive.
86
+ */
87
+ export async function createFile(name, content, mimeType = 'text/plain', folderId) {
88
+ const token = await getGoogleAccessToken();
89
+ const metadata = { name, mimeType };
90
+ if (folderId)
91
+ metadata.parents = [folderId];
92
+ const boundary = '----PilotAIDriveBoundary';
93
+ const body = [
94
+ `--${boundary}`,
95
+ 'Content-Type: application/json; charset=UTF-8',
96
+ '',
97
+ JSON.stringify(metadata),
98
+ `--${boundary}`,
99
+ `Content-Type: ${mimeType}`,
100
+ '',
101
+ content,
102
+ `--${boundary}--`,
103
+ ].join('\r\n');
104
+ const res = await fetch('https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&fields=id,name,mimeType,webViewLink', {
105
+ method: 'POST',
106
+ headers: {
107
+ Authorization: `Bearer ${token}`,
108
+ 'Content-Type': `multipart/related; boundary=${boundary}`,
109
+ },
110
+ body,
111
+ });
112
+ if (!res.ok) {
113
+ const err = await res.text();
114
+ throw new Error(`Drive create error (${res.status}): ${err}`);
115
+ }
116
+ return res.json();
117
+ }
118
+ /**
119
+ * Lists folders (for navigation).
120
+ */
121
+ export async function listFolders(parentId) {
122
+ const parent = parentId ?? 'root';
123
+ const q = `'${parent}' in parents and mimeType='application/vnd.google-apps.folder' and trashed=false`;
124
+ const params = new URLSearchParams({
125
+ q,
126
+ pageSize: '50',
127
+ fields: 'files(id,name,mimeType,modifiedTime)',
128
+ orderBy: 'name',
129
+ });
130
+ const data = await driveFetch(`/files?${params}`);
131
+ return data.files ?? [];
132
+ }
133
+ /**
134
+ * Finds a folder by name.
135
+ */
136
+ export async function findFolder(name) {
137
+ const q = `name='${name.replace(/'/g, "\\'")}' and mimeType='application/vnd.google-apps.folder' and trashed=false`;
138
+ const params = new URLSearchParams({
139
+ q,
140
+ pageSize: '1',
141
+ fields: 'files(id,name,mimeType)',
142
+ });
143
+ const data = await driveFetch(`/files?${params}`);
144
+ return data.files?.[0] ?? null;
145
+ }
146
+ //# sourceMappingURL=google-drive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-drive.js","sourceRoot":"","sources":["../../src/tools/google-drive.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,SAAS,GAAG,qCAAqC,CAAC;AAiBxD,KAAK,UAAU,UAAU,CAAI,IAAY,EAAE,IAAkB;IAC3D,MAAM,KAAK,GAAG,MAAM,oBAAoB,EAAE,CAAC;IAC3C,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,SAAS,GAAG,IAAI,EAAE,EAAE;QAC7C,GAAG,IAAI;QACP,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,KAAK,EAAE;YAChC,GAAG,IAAI,EAAE,OAAO;SACjB;KACF,CAAC,CAAC;IACH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,CAAC,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,EAAgB,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,QAAiB,EACjB,aAAqB,EAAE;IAEvB,MAAM,CAAC,GAAG,QAAQ;QAChB,CAAC,CAAC,IAAI,QAAQ,gCAAgC;QAC9C,CAAC,CAAC,qCAAqC,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QACjC,CAAC;QACD,QAAQ,EAAE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AC;AACjC,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Built-in registry of known MCP servers.
3
+ * The agent uses this to auto-discover and propose MCP server installations.
4
+ */
5
+ export interface McpServerEntry {
6
+ /** Unique key (used in mcp-config.json) */
7
+ id: string;
8
+ /** Human-readable name */
9
+ name: string;
10
+ /** What this server provides */
11
+ description: string;
12
+ /** npm package to run via npx */
13
+ npmPackage: string;
14
+ /** Extra args after the package name */
15
+ args?: string[];
16
+ /** Environment variables required (key -> description) */
17
+ envVars?: Record<string, string>;
18
+ /** Keywords that trigger auto-discovery */
19
+ keywords: string[];
20
+ /** Category for grouping */
21
+ category: 'design' | 'productivity' | 'development' | 'data' | 'communication';
22
+ }
23
+ /**
24
+ * Built-in registry of well-known MCP servers.
25
+ * This list is used for auto-discovery — the agent matches user requests
26
+ * against keywords and proposes installing relevant servers.
27
+ */
28
+ export declare const MCP_REGISTRY: McpServerEntry[];
29
+ /**
30
+ * Finds registry entries matching any of the given keywords.
31
+ * Uses case-insensitive partial matching.
32
+ */
33
+ export declare function findMatchingServers(text: string): McpServerEntry[];
34
+ /**
35
+ * Gets a registry entry by ID.
36
+ */
37
+ export declare function getRegistryEntry(id: string): McpServerEntry | undefined;
38
+ //# sourceMappingURL=mcp-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-registry.d.ts","sourceRoot":"","sources":["../../src/tools/mcp-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,4BAA4B;IAC5B,QAAQ,EAAE,QAAQ,GAAG,cAAc,GAAG,aAAa,GAAG,MAAM,GAAG,eAAe,CAAC;CAChF;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,EAyHxC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE,CAKlE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAEvE"}
@@ -0,0 +1,146 @@
1
+ /**
2
+ * Built-in registry of known MCP servers.
3
+ * The agent uses this to auto-discover and propose MCP server installations.
4
+ */
5
+ /**
6
+ * Built-in registry of well-known MCP servers.
7
+ * This list is used for auto-discovery — the agent matches user requests
8
+ * against keywords and proposes installing relevant servers.
9
+ */
10
+ export const MCP_REGISTRY = [
11
+ {
12
+ id: 'figma',
13
+ name: 'Figma',
14
+ description: 'Access Figma designs, components, variables, and comments',
15
+ npmPackage: '@anthropic-ai/figma-mcp',
16
+ envVars: { FIGMA_PERSONAL_ACCESS_TOKEN: 'Figma Personal Access Token' },
17
+ keywords: ['figma', 'design', 'ui', 'component', 'prototype', 'frame', 'design token'],
18
+ category: 'design',
19
+ },
20
+ {
21
+ id: 'github',
22
+ name: 'GitHub',
23
+ description: 'Manage GitHub repos, issues, PRs, and actions',
24
+ npmPackage: '@modelcontextprotocol/server-github',
25
+ envVars: { GITHUB_PERSONAL_ACCESS_TOKEN: 'GitHub Personal Access Token' },
26
+ keywords: ['github', 'repo', 'pull request', 'pr', 'issue', 'actions', 'workflow'],
27
+ category: 'development',
28
+ },
29
+ {
30
+ id: 'slack',
31
+ name: 'Slack',
32
+ description: 'Read and send Slack messages, manage channels',
33
+ npmPackage: '@modelcontextprotocol/server-slack',
34
+ envVars: { SLACK_BOT_TOKEN: 'Slack Bot Token (xoxb-...)', SLACK_TEAM_ID: 'Slack Team/Workspace ID' },
35
+ keywords: ['slack', 'channel', 'workspace', 'slack message'],
36
+ category: 'communication',
37
+ },
38
+ {
39
+ id: 'google-drive',
40
+ name: 'Google Drive',
41
+ description: 'Search, read, and create files in Google Drive',
42
+ npmPackage: '@anthropic-ai/google-drive-mcp',
43
+ envVars: {
44
+ GOOGLE_CLIENT_ID: 'Google OAuth Client ID',
45
+ GOOGLE_CLIENT_SECRET: 'Google OAuth Client Secret',
46
+ },
47
+ keywords: ['google drive', 'gdrive', 'drive', 'google docs', 'google sheets', 'spreadsheet'],
48
+ category: 'productivity',
49
+ },
50
+ {
51
+ id: 'notion',
52
+ name: 'Notion',
53
+ description: 'Search, read, create, and update Notion pages and databases',
54
+ npmPackage: '@notionhq/notion-mcp-server',
55
+ envVars: { OPENAPI_MCP_HEADERS: 'Notion API headers JSON (Authorization: Bearer ntn_...)' },
56
+ keywords: ['notion', 'notion page', 'notion database', 'wiki'],
57
+ category: 'productivity',
58
+ },
59
+ {
60
+ id: 'linear',
61
+ name: 'Linear',
62
+ description: 'Manage Linear issues, projects, and cycles',
63
+ npmPackage: '@anthropic-ai/linear-mcp',
64
+ envVars: { LINEAR_API_KEY: 'Linear API Key (lin_api_...)' },
65
+ keywords: ['linear', 'linear issue', 'sprint', 'cycle', 'backlog'],
66
+ category: 'development',
67
+ },
68
+ {
69
+ id: 'postgres',
70
+ name: 'PostgreSQL',
71
+ description: 'Query and manage PostgreSQL databases',
72
+ npmPackage: '@modelcontextprotocol/server-postgres',
73
+ envVars: { POSTGRES_CONNECTION_STRING: 'PostgreSQL connection string (postgresql://...)' },
74
+ keywords: ['postgres', 'postgresql', 'database', 'sql', 'db query'],
75
+ category: 'data',
76
+ },
77
+ {
78
+ id: 'sqlite',
79
+ name: 'SQLite',
80
+ description: 'Query SQLite databases',
81
+ npmPackage: '@modelcontextprotocol/server-sqlite',
82
+ envVars: {},
83
+ keywords: ['sqlite', 'sqlite3', 'local database'],
84
+ category: 'data',
85
+ },
86
+ {
87
+ id: 'puppeteer',
88
+ name: 'Puppeteer',
89
+ description: 'Browser automation and web scraping via Puppeteer',
90
+ npmPackage: '@anthropic-ai/puppeteer-mcp',
91
+ envVars: {},
92
+ keywords: ['puppeteer', 'headless browser', 'web scraping', 'screenshot'],
93
+ category: 'development',
94
+ },
95
+ {
96
+ id: 'filesystem',
97
+ name: 'Filesystem',
98
+ description: 'Read and write files with access control',
99
+ npmPackage: '@modelcontextprotocol/server-filesystem',
100
+ envVars: {},
101
+ keywords: ['filesystem', 'file access', 'directory'],
102
+ category: 'development',
103
+ },
104
+ {
105
+ id: 'memory',
106
+ name: 'Memory',
107
+ description: 'Persistent memory via knowledge graph',
108
+ npmPackage: '@modelcontextprotocol/server-memory',
109
+ envVars: {},
110
+ keywords: ['memory', 'knowledge graph', 'remember', 'persistent memory'],
111
+ category: 'productivity',
112
+ },
113
+ {
114
+ id: 'brave-search',
115
+ name: 'Brave Search',
116
+ description: 'Web search via Brave Search API',
117
+ npmPackage: '@modelcontextprotocol/server-brave-search',
118
+ envVars: { BRAVE_API_KEY: 'Brave Search API Key' },
119
+ keywords: ['brave', 'web search', 'search api'],
120
+ category: 'productivity',
121
+ },
122
+ {
123
+ id: 'sentry',
124
+ name: 'Sentry',
125
+ description: 'View and manage Sentry error tracking issues',
126
+ npmPackage: '@modelcontextprotocol/server-sentry',
127
+ envVars: { SENTRY_AUTH_TOKEN: 'Sentry Auth Token' },
128
+ keywords: ['sentry', 'error tracking', 'crash', 'exception'],
129
+ category: 'development',
130
+ },
131
+ ];
132
+ /**
133
+ * Finds registry entries matching any of the given keywords.
134
+ * Uses case-insensitive partial matching.
135
+ */
136
+ export function findMatchingServers(text) {
137
+ const lower = text.toLowerCase();
138
+ return MCP_REGISTRY.filter((entry) => entry.keywords.some((kw) => lower.includes(kw.toLowerCase())));
139
+ }
140
+ /**
141
+ * Gets a registry entry by ID.
142
+ */
143
+ export function getRegistryEntry(id) {
144
+ return MCP_REGISTRY.find((e) => e.id === id);
145
+ }
146
+ //# sourceMappingURL=mcp-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-registry.js","sourceRoot":"","sources":["../../src/tools/mcp-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC5C;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,2DAA2D;QACxE,UAAU,EAAE,yBAAyB;QACrC,OAAO,EAAE,EAAE,2BAA2B,EAAE,6BAA6B,EAAE;QACvE,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,CAAC;QACtF,QAAQ,EAAE,QAAQ;KACnB;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,+CAA+C;QAC5D,UAAU,EAAE,qCAAqC;QACjD,OAAO,EAAE,EAAE,4BAA4B,EAAE,8BAA8B,EAAE;QACzE,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC;QAClF,QAAQ,EAAE,aAAa;KACxB;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,+CAA+C;QAC5D,UAAU,EAAE,oCAAoC;QAChD,OAAO,EAAE,EAAE,eAAe,EAAE,4BAA4B,EAAE,aAAa,EAAE,yBAAyB,EAAE;QACpG,QAAQ,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,CAAC;QAC5D,QAAQ,EAAE,eAAe;KAC1B;IACD;QACE,EAAE,EAAE,cAAc;QAClB,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,gDAAgD;QAC7D,UAAU,EAAE,gCAAgC;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a;KACxB;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACjC,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACnC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAC9D,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAU;IACzC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAC/C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pilot-ai",
3
- "version": "0.3.14",
3
+ "version": "0.4.0",
4
4
  "description": "Personal AI agent that controls your macOS via Slack or Telegram",
5
5
  "type": "module",
6
6
  "bin": {