@opentabs-dev/mcp-server 0.0.67 → 0.0.69
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/adapter-files.d.ts.map +1 -1
- package/dist/adapter-files.js +8 -0
- package/dist/adapter-files.js.map +1 -1
- package/dist/browser-tools/extension-get-logs.d.ts +2 -2
- package/dist/browser-tools/get-console-logs.d.ts +2 -2
- package/package.json +1 -1
- package/dist/browser-tool-names.d.ts +0 -14
- package/dist/browser-tool-names.d.ts.map +0 -1
- package/dist/browser-tool-names.js +0 -55
- package/dist/browser-tool-names.js.map +0 -1
- package/dist/discovery-legacy.d.ts +0 -32
- package/dist/discovery-legacy.d.ts.map +0 -1
- package/dist/discovery-legacy.js +0 -415
- package/dist/discovery-legacy.js.map +0 -1
- package/dist/manifest-schema.d.ts +0 -14
- package/dist/manifest-schema.d.ts.map +0 -1
- package/dist/manifest-schema.js +0 -51
- package/dist/manifest-schema.js.map +0 -1
- package/dist/mcp-prompts.d.ts +0 -71
- package/dist/mcp-prompts.d.ts.map +0 -1
- package/dist/mcp-prompts.js +0 -248
- package/dist/mcp-prompts.js.map +0 -1
- package/dist/mcp-resources.d.ts +0 -53
- package/dist/mcp-resources.d.ts.map +0 -1
- package/dist/mcp-resources.js +0 -139
- package/dist/mcp-resources.js.map +0 -1
- package/dist/permissions.d.ts +0 -59
- package/dist/permissions.d.ts.map +0 -1
- package/dist/permissions.js +0 -144
- package/dist/permissions.js.map +0 -1
- package/dist/prompts/audit-ai-docs.d.ts +0 -6
- package/dist/prompts/audit-ai-docs.d.ts.map +0 -1
- package/dist/prompts/audit-ai-docs.js +0 -155
- package/dist/prompts/audit-ai-docs.js.map +0 -1
- package/dist/prompts/build-plugin.d.ts +0 -3
- package/dist/prompts/build-plugin.d.ts.map +0 -1
- package/dist/prompts/build-plugin.js +0 -455
- package/dist/prompts/build-plugin.js.map +0 -1
- package/dist/prompts/contribute-learnings.d.ts +0 -12
- package/dist/prompts/contribute-learnings.d.ts.map +0 -1
- package/dist/prompts/contribute-learnings.js +0 -107
- package/dist/prompts/contribute-learnings.js.map +0 -1
- package/dist/prompts/plugin-icon.d.ts +0 -5
- package/dist/prompts/plugin-icon.d.ts.map +0 -1
- package/dist/prompts/plugin-icon.js +0 -147
- package/dist/prompts/plugin-icon.js.map +0 -1
- package/dist/prompts/setup-plugin.d.ts +0 -3
- package/dist/prompts/setup-plugin.d.ts.map +0 -1
- package/dist/prompts/setup-plugin.js +0 -197
- package/dist/prompts/setup-plugin.js.map +0 -1
- package/dist/prompts/troubleshoot.d.ts +0 -3
- package/dist/prompts/troubleshoot.d.ts.map +0 -1
- package/dist/prompts/troubleshoot.js +0 -191
- package/dist/prompts/troubleshoot.js.map +0 -1
- package/dist/resources/browser-tools.d.ts +0 -3
- package/dist/resources/browser-tools.d.ts.map +0 -1
- package/dist/resources/browser-tools.js +0 -100
- package/dist/resources/browser-tools.js.map +0 -1
- package/dist/resources/cli.d.ts +0 -3
- package/dist/resources/cli.d.ts.map +0 -1
- package/dist/resources/cli.js +0 -217
- package/dist/resources/cli.js.map +0 -1
- package/dist/resources/plugin-development.d.ts +0 -3
- package/dist/resources/plugin-development.d.ts.map +0 -1
- package/dist/resources/plugin-development.js +0 -596
- package/dist/resources/plugin-development.js.map +0 -1
- package/dist/resources/quick-start.d.ts +0 -3
- package/dist/resources/quick-start.d.ts.map +0 -1
- package/dist/resources/quick-start.js +0 -210
- package/dist/resources/quick-start.js.map +0 -1
- package/dist/resources/sdk-api.d.ts +0 -3
- package/dist/resources/sdk-api.d.ts.map +0 -1
- package/dist/resources/sdk-api.js +0 -199
- package/dist/resources/sdk-api.js.map +0 -1
- package/dist/resources/self-improvement.d.ts +0 -10
- package/dist/resources/self-improvement.d.ts.map +0 -1
- package/dist/resources/self-improvement.js +0 -91
- package/dist/resources/self-improvement.js.map +0 -1
- package/dist/resources/status.d.ts +0 -5
- package/dist/resources/status.d.ts.map +0 -1
- package/dist/resources/status.js +0 -27
- package/dist/resources/status.js.map +0 -1
- package/dist/resources/troubleshooting.d.ts +0 -3
- package/dist/resources/troubleshooting.d.ts.map +0 -1
- package/dist/resources/troubleshooting.js +0 -167
- package/dist/resources/troubleshooting.js.map +0 -1
- package/dist/sanitize-tool-output.d.ts +0 -20
- package/dist/sanitize-tool-output.d.ts.map +0 -1
- package/dist/sanitize-tool-output.js +0 -52
- package/dist/sanitize-tool-output.js.map +0 -1
- package/dist/skip-confirmation.d.ts +0 -15
- package/dist/skip-confirmation.d.ts.map +0 -1
- package/dist/skip-confirmation.js +0 -16
- package/dist/skip-confirmation.js.map +0 -1
- package/dist/skip-permissions.d.ts +0 -11
- package/dist/skip-permissions.d.ts.map +0 -1
- package/dist/skip-permissions.js +0 -12
- package/dist/skip-permissions.js.map +0 -1
- package/dist/skip-sanitization.d.ts +0 -17
- package/dist/skip-sanitization.d.ts.map +0 -1
- package/dist/skip-sanitization.js +0 -18
- package/dist/skip-sanitization.js.map +0 -1
- package/dist/skip-verification.d.ts +0 -11
- package/dist/skip-verification.d.ts.map +0 -1
- package/dist/skip-verification.js +0 -12
- package/dist/skip-verification.js.map +0 -1
- package/dist/verify-plugin.d.ts +0 -53
- package/dist/verify-plugin.d.ts.map +0 -1
- package/dist/verify-plugin.js +0 -123
- package/dist/verify-plugin.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-files.d.ts","sourceRoot":"","sources":["../src/adapter-files.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;GAIG;AACH,QAAA,MAAM,iBAAiB,GAAU,OAAO,WAAW,KAAG,OAAO,CAAC,IAAI,CAIjE,CAAC;AAEF,yDAAyD;AACzD,QAAA,MAAM,gBAAgB,YAAY,CAAC;AAKnC,yEAAyE;AACzE,QAAA,MAAM,wBAAwB,QAAS,CAAC;AAExC,qEAAqE;AACrE,QAAA,MAAM,WAAW,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GAIG;AACH,QAAA,MAAM,wBAAwB,GAAU,oBAAoB,GAAG,CAAC,MAAM,CAAC,KAAG,OAAO,CAAC,IAAI,CAgDrF,CAAC;AAMF;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,GAAU,OAAO,WAAW,EAAE,QAAQ,MAAM,EAAE,MAAM,MAAM,KAAG,OAAO,CAAC,MAAM,CAiD7F,CAAC;AAEF,4EAA4E;AAC5E,QAAA,MAAM,cAAc,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,IAAI,CAM5D,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,qBAAqB,QAAa,OAAO,CAAC,IAAI,CAiBnD,CAAC;AAEF,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,wBAAwB,EACxB,gBAAgB,GACjB,CAAC"}
|
package/dist/adapter-files.js
CHANGED
|
@@ -147,11 +147,17 @@ const writeExecFile = async (state, execId, code) => {
|
|
|
147
147
|
const finalPath = join(getAdaptersDir(), filename);
|
|
148
148
|
const resultKey = `__execResult_${execId}`;
|
|
149
149
|
const asyncKey = `__execAsync_${execId}`;
|
|
150
|
+
const startedKey = `__execStarted_${execId}`;
|
|
150
151
|
// Wrap user code to capture sync/async results and errors.
|
|
151
152
|
// The wrapper stores results at namespaced keys on globalThis.__openTabs
|
|
152
153
|
// so concurrent executions do not collide. The extension reads the
|
|
153
154
|
// namespaced key matching this execution's UUID and cleans it up.
|
|
154
155
|
//
|
|
156
|
+
// The __startedKey sentinel is set synchronously at the top of the IIFE
|
|
157
|
+
// before the try block, so the polling function can distinguish between
|
|
158
|
+
// "IIFE hasn't executed yet" (keep polling) and "sync code produced no
|
|
159
|
+
// result" (genuine failure).
|
|
160
|
+
//
|
|
155
161
|
// User code is placed inline inside an inner function expression, avoiding
|
|
156
162
|
// eval-like constructs (new Function, eval) that strict CSP blocks. The
|
|
157
163
|
// file is injected via chrome.scripting.executeScript({ files }), which
|
|
@@ -161,6 +167,8 @@ const writeExecFile = async (state, execId, code) => {
|
|
|
161
167
|
' var __ot = globalThis.__openTabs = globalThis.__openTabs || {};',
|
|
162
168
|
` var __resultKey = ${JSON.stringify(resultKey)};`,
|
|
163
169
|
` var __asyncKey = ${JSON.stringify(asyncKey)};`,
|
|
170
|
+
` var __startedKey = ${JSON.stringify(startedKey)};`,
|
|
171
|
+
' __ot[__startedKey] = true;',
|
|
164
172
|
' try {',
|
|
165
173
|
' var __r = (async function() {',
|
|
166
174
|
code,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-files.js","sourceRoot":"","sources":["../src/adapter-files.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,KAAK,EAAE,KAAkB,EAAiB,EAAE;IACpE,IAAI,KAAK,CAAC,gBAAgB;QAAE,OAAO;IACnC,MAAM,KAAK,CAAC,cAAc,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAChE,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;AAChC,CAAC,CAAC;AAEF,yDAAyD;AACzD,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAEnC,sEAAsE;AACtE,MAAM,WAAW,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MA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C,CAAC;AAEF;;;GAGG;AACH,MAAM,qBAAqB,GAAG,KAAK,IAAmB,EAAE;IACtD,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,IAAI,OAAiB,CAAC;IACtB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;IACT,CAAC;IAED,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CACnC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CACpF,CAAC;IACF,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAExC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChG,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,MAAM,CAAC;IACrE,GAAG,CAAC,IAAI,CAAC,cAAc,OAAO,qBAAqB,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,wBAAwB,EACxB,gBAAgB,GACjB,CAAC"}
|
|
@@ -7,10 +7,10 @@ import { z } from 'zod';
|
|
|
7
7
|
declare const extensionGetLogs: import("./definition.js").BrowserToolDefinition<z.ZodObject<{
|
|
8
8
|
level: z.ZodOptional<z.ZodEnum<{
|
|
9
9
|
info: "info";
|
|
10
|
+
warn: "warn";
|
|
10
11
|
error: "error";
|
|
11
|
-
all: "all";
|
|
12
12
|
log: "log";
|
|
13
|
-
|
|
13
|
+
all: "all";
|
|
14
14
|
}>>;
|
|
15
15
|
source: z.ZodOptional<z.ZodEnum<{
|
|
16
16
|
all: "all";
|
|
@@ -8,10 +8,10 @@ declare const getConsoleLogs: import("./definition.js").BrowserToolDefinition<z.
|
|
|
8
8
|
level: z.ZodOptional<z.ZodEnum<{
|
|
9
9
|
debug: "debug";
|
|
10
10
|
info: "info";
|
|
11
|
+
warn: "warn";
|
|
11
12
|
error: "error";
|
|
12
|
-
all: "all";
|
|
13
13
|
log: "log";
|
|
14
|
-
|
|
14
|
+
all: "all";
|
|
15
15
|
}>>;
|
|
16
16
|
}, z.core.$strip>>;
|
|
17
17
|
export { getConsoleLogs };
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Static list of all browser tool names.
|
|
3
|
-
*
|
|
4
|
-
* Extracted into its own module so the plugin loader can check for browser
|
|
5
|
-
* tool name references (prompt injection detection) without pulling in the
|
|
6
|
-
* full browser-tools barrel and its heavy dependencies (Zod schemas,
|
|
7
|
-
* handler implementations, etc.).
|
|
8
|
-
*
|
|
9
|
-
* browser-tools/index.ts validates at module load time that this list
|
|
10
|
-
* matches the actual tool definitions.
|
|
11
|
-
*/
|
|
12
|
-
declare const BROWSER_TOOL_NAMES: readonly string[];
|
|
13
|
-
export { BROWSER_TOOL_NAMES };
|
|
14
|
-
//# sourceMappingURL=browser-tool-names.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser-tool-names.d.ts","sourceRoot":"","sources":["../src/browser-tool-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,QAAA,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAyCxC,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Static list of all browser tool names.
|
|
3
|
-
*
|
|
4
|
-
* Extracted into its own module so the plugin loader can check for browser
|
|
5
|
-
* tool name references (prompt injection detection) without pulling in the
|
|
6
|
-
* full browser-tools barrel and its heavy dependencies (Zod schemas,
|
|
7
|
-
* handler implementations, etc.).
|
|
8
|
-
*
|
|
9
|
-
* browser-tools/index.ts validates at module load time that this list
|
|
10
|
-
* matches the actual tool definitions.
|
|
11
|
-
*/
|
|
12
|
-
const BROWSER_TOOL_NAMES = [
|
|
13
|
-
'extension_reload',
|
|
14
|
-
'browser_list_tabs',
|
|
15
|
-
'browser_open_tab',
|
|
16
|
-
'browser_close_tab',
|
|
17
|
-
'browser_navigate_tab',
|
|
18
|
-
'browser_focus_tab',
|
|
19
|
-
'browser_get_tab_info',
|
|
20
|
-
'browser_execute_script',
|
|
21
|
-
'browser_screenshot_tab',
|
|
22
|
-
'browser_get_tab_content',
|
|
23
|
-
'browser_get_page_html',
|
|
24
|
-
'browser_get_storage',
|
|
25
|
-
'browser_click_element',
|
|
26
|
-
'browser_type_text',
|
|
27
|
-
'browser_select_option',
|
|
28
|
-
'browser_wait_for_element',
|
|
29
|
-
'browser_query_elements',
|
|
30
|
-
'browser_get_cookies',
|
|
31
|
-
'browser_set_cookie',
|
|
32
|
-
'browser_delete_cookies',
|
|
33
|
-
'browser_enable_network_capture',
|
|
34
|
-
'browser_get_network_requests',
|
|
35
|
-
'browser_get_websocket_frames',
|
|
36
|
-
'browser_export_har',
|
|
37
|
-
'browser_disable_network_capture',
|
|
38
|
-
'browser_get_console_logs',
|
|
39
|
-
'browser_clear_console_logs',
|
|
40
|
-
'browser_list_resources',
|
|
41
|
-
'browser_get_resource_content',
|
|
42
|
-
'browser_press_key',
|
|
43
|
-
'browser_scroll',
|
|
44
|
-
'browser_hover_element',
|
|
45
|
-
'browser_handle_dialog',
|
|
46
|
-
'extension_get_state',
|
|
47
|
-
'extension_get_logs',
|
|
48
|
-
'extension_get_side_panel',
|
|
49
|
-
'extension_check_adapter',
|
|
50
|
-
'extension_force_reconnect',
|
|
51
|
-
'plugin_analyze_site',
|
|
52
|
-
'plugin_list_tabs',
|
|
53
|
-
];
|
|
54
|
-
export { BROWSER_TOOL_NAMES };
|
|
55
|
-
//# sourceMappingURL=browser-tool-names.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser-tool-names.js","sourceRoot":"","sources":["../src/browser-tool-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,kBAAkB,GAAsB;IAC5C,kBAAkB;IAClB,mBAAmB;IACnB,kBAAkB;IAClB,mBAAmB;IACnB,sBAAsB;IACtB,mBAAmB;IACnB,sBAAsB;IACtB,wBAAwB;IACxB,wBAAwB;IACxB,yBAAyB;IACzB,uBAAuB;IACvB,qBAAqB;IACrB,uBAAuB;IACvB,mBAAmB;IACnB,uBAAuB;IACvB,0BAA0B;IAC1B,wBAAwB;IACxB,qBAAqB;IACrB,oBAAoB;IACpB,wBAAwB;IACxB,gCAAgC;IAChC,8BAA8B;IAC9B,8BAA8B;IAC9B,oBAAoB;IACpB,iCAAiC;IACjC,0BAA0B;IAC1B,4BAA4B;IAC5B,wBAAwB;IACxB,8BAA8B;IAC9B,mBAAmB;IACnB,gBAAgB;IAChB,uBAAuB;IACvB,uBAAuB;IACvB,qBAAqB;IACrB,oBAAoB;IACpB,0BAA0B;IAC1B,yBAAyB;IACzB,2BAA2B;IAC3B,qBAAqB;IACrB,kBAAkB;CACnB,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legacy plugin discovery (opentabs-plugin.json based).
|
|
3
|
-
*
|
|
4
|
-
* Provides the old discoverPlugins and loadPluginFromDir functions that read
|
|
5
|
-
* opentabs-plugin.json manifests. Used by reload.ts and file-watcher.ts until
|
|
6
|
-
* they are migrated to the new package.json-based pipeline in later stories.
|
|
7
|
-
*
|
|
8
|
-
* This file will be deleted once US-009 (reload.ts), US-012 (file-watcher.ts),
|
|
9
|
-
* and US-020 (cleanup) are complete.
|
|
10
|
-
*/
|
|
11
|
-
import type { FailedPlugin, RegisteredPlugin } from './state.js';
|
|
12
|
-
import type { TrustTier } from '@opentabs-dev/shared';
|
|
13
|
-
/**
|
|
14
|
-
* Load a single plugin from a directory.
|
|
15
|
-
* Reads opentabs-plugin.json and dist/adapter.iife.js.
|
|
16
|
-
*/
|
|
17
|
-
declare const loadPluginFromDir: (dir: string, trustTier: TrustTier, npmPkgName: string | null, sourcePath?: string) => Promise<RegisteredPlugin>;
|
|
18
|
-
/** Result of full plugin discovery: successfully loaded plugins and failed paths */
|
|
19
|
-
interface DiscoveryOutcome {
|
|
20
|
-
plugins: Map<string, RegisteredPlugin>;
|
|
21
|
-
failures: FailedPlugin[];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Legacy plugin discovery using opentabs-plugin.json manifests.
|
|
25
|
-
* Discovers from both node_modules and local filesystem paths.
|
|
26
|
-
*
|
|
27
|
-
* This function will be replaced by the new discoverPlugins in discovery.ts
|
|
28
|
-
* once reload.ts (US-009) and file-watcher.ts (US-012) are migrated.
|
|
29
|
-
*/
|
|
30
|
-
declare const discoverPluginsLegacy: (localPaths: string[], allowedNpmPackages: string[], rootDir?: string) => Promise<DiscoveryOutcome>;
|
|
31
|
-
export { discoverPluginsLegacy, loadPluginFromDir };
|
|
32
|
-
//# sourceMappingURL=discovery-legacy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discovery-legacy.d.ts","sourceRoot":"","sources":["../src/discovery-legacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAqEtD;;;GAGG;AACH,QAAA,MAAM,iBAAiB,GACrB,KAAK,MAAM,EACX,WAAW,SAAS,EACpB,YAAY,MAAM,GAAG,IAAI,EACzB,aAAa,MAAM,KAClB,OAAO,CAAC,gBAAgB,CA+E1B,CAAC;AA4PF,oFAAoF;AACpF,UAAU,gBAAgB;IACxB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACvC,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,QAAA,MAAM,qBAAqB,GACzB,YAAY,MAAM,EAAE,EACpB,oBAAoB,MAAM,EAAE,EAC5B,UAAU,MAAM,KACf,OAAO,CAAC,gBAAgB,CAoC1B,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/discovery-legacy.js
DELETED
|
@@ -1,415 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legacy plugin discovery (opentabs-plugin.json based).
|
|
3
|
-
*
|
|
4
|
-
* Provides the old discoverPlugins and loadPluginFromDir functions that read
|
|
5
|
-
* opentabs-plugin.json manifests. Used by reload.ts and file-watcher.ts until
|
|
6
|
-
* they are migrated to the new package.json-based pipeline in later stories.
|
|
7
|
-
*
|
|
8
|
-
* This file will be deleted once US-009 (reload.ts), US-012 (file-watcher.ts),
|
|
9
|
-
* and US-020 (cleanup) are complete.
|
|
10
|
-
*/
|
|
11
|
-
import { browserTools } from './browser-tools/index.js';
|
|
12
|
-
import { log } from './logger.js';
|
|
13
|
-
import { parseManifest } from './manifest-schema.js';
|
|
14
|
-
import { isAllowedPluginPath } from './resolver.js';
|
|
15
|
-
import { validatePluginName, validateUrlPattern } from '@opentabs-dev/shared';
|
|
16
|
-
import { readdir, stat } from 'node:fs/promises';
|
|
17
|
-
import { join, resolve, dirname } from 'node:path';
|
|
18
|
-
import { fileURLToPath } from 'node:url';
|
|
19
|
-
/**
|
|
20
|
-
* The mcp-server package root directory, resolved from this module's URL.
|
|
21
|
-
* Used as the default rootDir for npm plugin discovery so that `node_modules`
|
|
22
|
-
* scanning works regardless of the process's working directory.
|
|
23
|
-
*/
|
|
24
|
-
const PACKAGE_DIR = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
25
|
-
/**
|
|
26
|
-
* Extract the plugin name from an npm package name.
|
|
27
|
-
* opentabs-plugin-slack → slack
|
|
28
|
-
* @myorg/opentabs-plugin-jira → myorg-jira
|
|
29
|
-
*/
|
|
30
|
-
const pluginNameFromPackage = (pkgName) => {
|
|
31
|
-
if (pkgName.startsWith('@')) {
|
|
32
|
-
// Scoped: @scope/opentabs-plugin-name → scope-name
|
|
33
|
-
const parts = pkgName.split('/');
|
|
34
|
-
const scopePart = parts[0] ?? '';
|
|
35
|
-
const namePart = parts[1] ?? '';
|
|
36
|
-
const scope = scopePart.slice(1); // remove @
|
|
37
|
-
const pluginSuffix = namePart.replace(/^opentabs-plugin-/, '');
|
|
38
|
-
return `${scope}-${pluginSuffix}`;
|
|
39
|
-
}
|
|
40
|
-
return pkgName.replace(/^opentabs-plugin-/, '');
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Determine trust tier from how the plugin was discovered.
|
|
44
|
-
*/
|
|
45
|
-
const determineTrustTierLegacy = (pkgName, isLocal) => {
|
|
46
|
-
if (isLocal)
|
|
47
|
-
return 'local';
|
|
48
|
-
if (pkgName && pkgName.startsWith('@opentabs-dev/'))
|
|
49
|
-
return 'official';
|
|
50
|
-
return 'community';
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Browser tool names that should not appear in plugin tool descriptions.
|
|
54
|
-
* Presence of these names may indicate a prompt injection attempt where
|
|
55
|
-
* a plugin tries to instruct the AI agent to invoke browser-level tools.
|
|
56
|
-
* Derived from the browserTools array so the list stays in sync automatically.
|
|
57
|
-
*/
|
|
58
|
-
const BROWSER_TOOL_NAMES = browserTools.map(t => t.name);
|
|
59
|
-
/**
|
|
60
|
-
* Check plugin tool descriptions for references to browser tool names.
|
|
61
|
-
* Returns an array of { toolName, browserToolName } for each match found.
|
|
62
|
-
*/
|
|
63
|
-
const checkBrowserToolReferences = (tools) => {
|
|
64
|
-
const matches = [];
|
|
65
|
-
for (const tool of tools) {
|
|
66
|
-
const descLower = tool.description.toLowerCase();
|
|
67
|
-
for (const btName of BROWSER_TOOL_NAMES) {
|
|
68
|
-
if (descLower.includes(btName)) {
|
|
69
|
-
matches.push({ toolName: tool.name, browserToolName: btName });
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return matches;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* Load a single plugin from a directory.
|
|
77
|
-
* Reads opentabs-plugin.json and dist/adapter.iife.js.
|
|
78
|
-
*/
|
|
79
|
-
const loadPluginFromDir = async (dir, trustTier, npmPkgName, sourcePath) => {
|
|
80
|
-
const manifestPath = join(dir, 'opentabs-plugin.json');
|
|
81
|
-
const iifePath = join(dir, 'dist', 'adapter.iife.js');
|
|
82
|
-
// Read and validate manifest
|
|
83
|
-
const manifestRaw = await Bun.file(manifestPath).text();
|
|
84
|
-
const manifest = parseManifest(manifestRaw, manifestPath);
|
|
85
|
-
// Derive the internal plugin name.
|
|
86
|
-
// Handles both bare names ("slack") and legacy prefixed names ("opentabs-plugin-slack").
|
|
87
|
-
let pluginName;
|
|
88
|
-
if (npmPkgName) {
|
|
89
|
-
pluginName = pluginNameFromPackage(npmPkgName);
|
|
90
|
-
const manifestBare = manifest.name.replace(/^opentabs-plugin-/, '');
|
|
91
|
-
if (manifestBare !== pluginName) {
|
|
92
|
-
log.warn(`Plugin manifest name "${manifest.name}" doesn't match package name "${npmPkgName}" (expected plugin name: ${pluginName}, got: ${manifestBare})`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
// Local plugin — strip legacy prefix if present
|
|
97
|
-
pluginName = manifest.name.replace(/^opentabs-plugin-/, '');
|
|
98
|
-
}
|
|
99
|
-
// Validate plugin name
|
|
100
|
-
const nameError = validatePluginName(pluginName);
|
|
101
|
-
if (nameError) {
|
|
102
|
-
throw new Error(nameError);
|
|
103
|
-
}
|
|
104
|
-
// Validate URL patterns
|
|
105
|
-
for (const pattern of manifest.url_patterns) {
|
|
106
|
-
const patternError = validateUrlPattern(pattern);
|
|
107
|
-
if (patternError)
|
|
108
|
-
throw new Error(patternError);
|
|
109
|
-
}
|
|
110
|
-
// Warn if any tool description references browser tool names (possible prompt injection)
|
|
111
|
-
for (const match of checkBrowserToolReferences(manifest.tools)) {
|
|
112
|
-
log.warn(`Plugin "${pluginName}" tool "${match.toolName}" description references browser tool "${match.browserToolName}" — possible prompt injection attempt`);
|
|
113
|
-
}
|
|
114
|
-
// Read IIFE — reject missing, empty, or oversized files
|
|
115
|
-
const MAX_IIFE_SIZE = 5 * 1024 * 1024;
|
|
116
|
-
const iifeFile = Bun.file(iifePath);
|
|
117
|
-
if (!(await iifeFile.exists())) {
|
|
118
|
-
throw new Error(`Adapter IIFE not found at ${iifePath}`);
|
|
119
|
-
}
|
|
120
|
-
const iifeSize = iifeFile.size;
|
|
121
|
-
if (iifeSize > MAX_IIFE_SIZE) {
|
|
122
|
-
throw new Error(`Adapter IIFE for "${pluginName}" is ${(iifeSize / 1024 / 1024).toFixed(1)}MB, exceeding the 5MB limit`);
|
|
123
|
-
}
|
|
124
|
-
const iife = await iifeFile.text();
|
|
125
|
-
if (iife.length === 0) {
|
|
126
|
-
throw new Error(`Adapter IIFE at ${iifePath} is empty — rebuild the plugin`);
|
|
127
|
-
}
|
|
128
|
-
return {
|
|
129
|
-
name: pluginName,
|
|
130
|
-
version: manifest.version,
|
|
131
|
-
displayName: manifest.displayName,
|
|
132
|
-
urlPatterns: manifest.url_patterns,
|
|
133
|
-
trustTier,
|
|
134
|
-
iife,
|
|
135
|
-
tools: manifest.tools.map(t => ({
|
|
136
|
-
name: t.name,
|
|
137
|
-
displayName: t.displayName,
|
|
138
|
-
description: t.description,
|
|
139
|
-
icon: t.icon,
|
|
140
|
-
input_schema: t.input_schema,
|
|
141
|
-
output_schema: t.output_schema,
|
|
142
|
-
})),
|
|
143
|
-
adapterHash: manifest.adapterHash,
|
|
144
|
-
sourcePath,
|
|
145
|
-
npmPackageName: npmPkgName ?? undefined,
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
/**
|
|
149
|
-
* Check if a directory exists and is accessible.
|
|
150
|
-
*/
|
|
151
|
-
const dirExists = async (path) => {
|
|
152
|
-
try {
|
|
153
|
-
const s = await stat(path);
|
|
154
|
-
return s.isDirectory();
|
|
155
|
-
}
|
|
156
|
-
catch {
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
/**
|
|
161
|
-
* Check if a file exists and is accessible.
|
|
162
|
-
*/
|
|
163
|
-
const fileExists = async (path) => Bun.file(path).exists();
|
|
164
|
-
/**
|
|
165
|
-
* Scan node_modules for opentabs plugins.
|
|
166
|
-
* Looks for:
|
|
167
|
-
* 1. node_modules/opentabs-plugin-* directories
|
|
168
|
-
* 2. node_modules/@* /opentabs-plugin-* directories (scoped packages)
|
|
169
|
-
* 3. Any package with 'opentabs-plugin' keyword in package.json
|
|
170
|
-
*
|
|
171
|
-
* Only packages listed in allowedPackages are loaded. Discovered packages
|
|
172
|
-
* not in the allow list are logged as skipped with instructions to add them.
|
|
173
|
-
*/
|
|
174
|
-
const discoverFromNodeModules = async (rootDir, allowedPackages) => {
|
|
175
|
-
const allowedSet = new Set(allowedPackages);
|
|
176
|
-
const results = [];
|
|
177
|
-
const nodeModulesDir = join(rootDir, 'node_modules');
|
|
178
|
-
if (!(await dirExists(nodeModulesDir))) {
|
|
179
|
-
return results;
|
|
180
|
-
}
|
|
181
|
-
let entries;
|
|
182
|
-
try {
|
|
183
|
-
entries = await readdir(nodeModulesDir);
|
|
184
|
-
}
|
|
185
|
-
catch {
|
|
186
|
-
return results;
|
|
187
|
-
}
|
|
188
|
-
// Track already-discovered package dirs to avoid duplicate keyword scan
|
|
189
|
-
const discoveredDirs = new Set();
|
|
190
|
-
// 1. Direct matches: opentabs-plugin-*
|
|
191
|
-
for (const entry of entries) {
|
|
192
|
-
if (!entry.startsWith('opentabs-plugin-'))
|
|
193
|
-
continue;
|
|
194
|
-
const pkgDir = join(nodeModulesDir, entry);
|
|
195
|
-
if (!(await dirExists(pkgDir)))
|
|
196
|
-
continue;
|
|
197
|
-
if (!(await fileExists(join(pkgDir, 'opentabs-plugin.json'))))
|
|
198
|
-
continue;
|
|
199
|
-
if (!allowedSet.has(entry)) {
|
|
200
|
-
log.info(`Skipping npm plugin "${entry}" — not listed in config.npmPlugins. Add it to ~/.opentabs/config.json to enable.`);
|
|
201
|
-
discoveredDirs.add(pkgDir);
|
|
202
|
-
continue;
|
|
203
|
-
}
|
|
204
|
-
const trustTier = determineTrustTierLegacy(entry, false);
|
|
205
|
-
try {
|
|
206
|
-
const plugin = await loadPluginFromDir(pkgDir, trustTier, entry);
|
|
207
|
-
results.push({ plugin, source: `node_modules/${entry}` });
|
|
208
|
-
discoveredDirs.add(pkgDir);
|
|
209
|
-
}
|
|
210
|
-
catch (err) {
|
|
211
|
-
log.error(`Failed to load plugin from node_modules/${entry}:`, err);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
// 2. Scoped packages: @scope/opentabs-plugin-*
|
|
215
|
-
for (const entry of entries) {
|
|
216
|
-
if (!entry.startsWith('@'))
|
|
217
|
-
continue;
|
|
218
|
-
const scopeDir = join(nodeModulesDir, entry);
|
|
219
|
-
if (!(await dirExists(scopeDir)))
|
|
220
|
-
continue;
|
|
221
|
-
let scopeEntries;
|
|
222
|
-
try {
|
|
223
|
-
scopeEntries = await readdir(scopeDir);
|
|
224
|
-
}
|
|
225
|
-
catch {
|
|
226
|
-
continue;
|
|
227
|
-
}
|
|
228
|
-
for (const scopeEntry of scopeEntries) {
|
|
229
|
-
if (!scopeEntry.startsWith('opentabs-plugin-'))
|
|
230
|
-
continue;
|
|
231
|
-
const pkgDir = join(scopeDir, scopeEntry);
|
|
232
|
-
if (!(await dirExists(pkgDir)))
|
|
233
|
-
continue;
|
|
234
|
-
if (!(await fileExists(join(pkgDir, 'opentabs-plugin.json'))))
|
|
235
|
-
continue;
|
|
236
|
-
const fullPkgName = `${entry}/${scopeEntry}`;
|
|
237
|
-
if (!allowedSet.has(fullPkgName)) {
|
|
238
|
-
log.info(`Skipping npm plugin "${fullPkgName}" — not listed in config.npmPlugins. Add it to ~/.opentabs/config.json to enable.`);
|
|
239
|
-
discoveredDirs.add(pkgDir);
|
|
240
|
-
continue;
|
|
241
|
-
}
|
|
242
|
-
const trustTier = determineTrustTierLegacy(fullPkgName, false);
|
|
243
|
-
try {
|
|
244
|
-
const plugin = await loadPluginFromDir(pkgDir, trustTier, fullPkgName);
|
|
245
|
-
results.push({
|
|
246
|
-
plugin,
|
|
247
|
-
source: `node_modules/${fullPkgName}`,
|
|
248
|
-
});
|
|
249
|
-
discoveredDirs.add(pkgDir);
|
|
250
|
-
}
|
|
251
|
-
catch (err) {
|
|
252
|
-
log.error(`Failed to load plugin from node_modules/${fullPkgName}:`, err);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
// 3. Keyword fallback: scan remaining packages for 'opentabs-plugin' keyword.
|
|
257
|
-
// Check for opentabs-plugin.json first (cheap stat) before reading package.json (expensive parse).
|
|
258
|
-
for (const entry of entries) {
|
|
259
|
-
if (entry.startsWith('.') || entry.startsWith('@'))
|
|
260
|
-
continue;
|
|
261
|
-
if (entry.startsWith('opentabs-plugin-'))
|
|
262
|
-
continue; // Already checked
|
|
263
|
-
const pkgDir = join(nodeModulesDir, entry);
|
|
264
|
-
if (discoveredDirs.has(pkgDir))
|
|
265
|
-
continue;
|
|
266
|
-
if (!(await dirExists(pkgDir)))
|
|
267
|
-
continue;
|
|
268
|
-
if (!(await fileExists(join(pkgDir, 'opentabs-plugin.json'))))
|
|
269
|
-
continue;
|
|
270
|
-
const pkgJsonPath = join(pkgDir, 'package.json');
|
|
271
|
-
if (!(await fileExists(pkgJsonPath)))
|
|
272
|
-
continue;
|
|
273
|
-
try {
|
|
274
|
-
const pkgJson = JSON.parse(await Bun.file(pkgJsonPath).text());
|
|
275
|
-
const keywords = pkgJson.keywords;
|
|
276
|
-
if (!Array.isArray(keywords) || !keywords.includes('opentabs-plugin'))
|
|
277
|
-
continue;
|
|
278
|
-
if (!allowedSet.has(entry)) {
|
|
279
|
-
log.info(`Skipping npm plugin "${entry}" — not listed in config.npmPlugins. Add it to ~/.opentabs/config.json to enable.`);
|
|
280
|
-
discoveredDirs.add(pkgDir);
|
|
281
|
-
continue;
|
|
282
|
-
}
|
|
283
|
-
const trustTier = determineTrustTierLegacy(entry, false);
|
|
284
|
-
const plugin = await loadPluginFromDir(pkgDir, trustTier, entry);
|
|
285
|
-
results.push({ plugin, source: `node_modules/${entry} (keyword)` });
|
|
286
|
-
discoveredDirs.add(pkgDir);
|
|
287
|
-
}
|
|
288
|
-
catch (err) {
|
|
289
|
-
log.error(`Failed to load plugin from node_modules/${entry} (keyword):`, err);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
// Keyword scan for scoped packages too
|
|
293
|
-
for (const entry of entries) {
|
|
294
|
-
if (!entry.startsWith('@'))
|
|
295
|
-
continue;
|
|
296
|
-
const scopeDir = join(nodeModulesDir, entry);
|
|
297
|
-
if (!(await dirExists(scopeDir)))
|
|
298
|
-
continue;
|
|
299
|
-
let scopeEntries;
|
|
300
|
-
try {
|
|
301
|
-
scopeEntries = await readdir(scopeDir);
|
|
302
|
-
}
|
|
303
|
-
catch {
|
|
304
|
-
continue;
|
|
305
|
-
}
|
|
306
|
-
for (const scopeEntry of scopeEntries) {
|
|
307
|
-
if (scopeEntry.startsWith('opentabs-plugin-'))
|
|
308
|
-
continue; // Already checked
|
|
309
|
-
const pkgDir = join(scopeDir, scopeEntry);
|
|
310
|
-
if (discoveredDirs.has(pkgDir))
|
|
311
|
-
continue;
|
|
312
|
-
if (!(await dirExists(pkgDir)))
|
|
313
|
-
continue;
|
|
314
|
-
if (!(await fileExists(join(pkgDir, 'opentabs-plugin.json'))))
|
|
315
|
-
continue;
|
|
316
|
-
const pkgJsonPath = join(pkgDir, 'package.json');
|
|
317
|
-
if (!(await fileExists(pkgJsonPath)))
|
|
318
|
-
continue;
|
|
319
|
-
try {
|
|
320
|
-
const pkgJson = JSON.parse(await Bun.file(pkgJsonPath).text());
|
|
321
|
-
const keywords = pkgJson.keywords;
|
|
322
|
-
if (!Array.isArray(keywords) || !keywords.includes('opentabs-plugin'))
|
|
323
|
-
continue;
|
|
324
|
-
const fullPkgName = `${entry}/${scopeEntry}`;
|
|
325
|
-
if (!allowedSet.has(fullPkgName)) {
|
|
326
|
-
log.info(`Skipping npm plugin "${fullPkgName}" — not listed in config.npmPlugins. Add it to ~/.opentabs/config.json to enable.`);
|
|
327
|
-
discoveredDirs.add(pkgDir);
|
|
328
|
-
continue;
|
|
329
|
-
}
|
|
330
|
-
const trustTier = determineTrustTierLegacy(fullPkgName, false);
|
|
331
|
-
const plugin = await loadPluginFromDir(pkgDir, trustTier, fullPkgName);
|
|
332
|
-
results.push({
|
|
333
|
-
plugin,
|
|
334
|
-
source: `node_modules/${fullPkgName} (keyword)`,
|
|
335
|
-
});
|
|
336
|
-
discoveredDirs.add(pkgDir);
|
|
337
|
-
}
|
|
338
|
-
catch (err) {
|
|
339
|
-
log.error(`Failed to load plugin from node_modules/${entry}/${scopeEntry} (keyword):`, err);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
return results;
|
|
344
|
-
};
|
|
345
|
-
const discoverFromLocalPaths = async (paths) => {
|
|
346
|
-
const results = [];
|
|
347
|
-
const failures = [];
|
|
348
|
-
for (const pluginPath of paths) {
|
|
349
|
-
const resolvedPath = resolve(pluginPath);
|
|
350
|
-
if (!(await isAllowedPluginPath(resolvedPath))) {
|
|
351
|
-
const msg = `Rejected plugin path outside allowed directories: ${resolvedPath}`;
|
|
352
|
-
log.warn(msg);
|
|
353
|
-
failures.push({ path: resolvedPath, error: 'Path is outside allowed directories' });
|
|
354
|
-
continue;
|
|
355
|
-
}
|
|
356
|
-
if (!(await dirExists(resolvedPath))) {
|
|
357
|
-
const msg = `Local plugin path does not exist: ${resolvedPath}`;
|
|
358
|
-
log.warn(msg);
|
|
359
|
-
failures.push({ path: resolvedPath, error: 'Directory does not exist' });
|
|
360
|
-
continue;
|
|
361
|
-
}
|
|
362
|
-
if (!(await fileExists(join(resolvedPath, 'opentabs-plugin.json')))) {
|
|
363
|
-
const msg = `No opentabs-plugin.json found at: ${resolvedPath}`;
|
|
364
|
-
log.warn(msg);
|
|
365
|
-
failures.push({ path: resolvedPath, error: 'No opentabs-plugin.json found' });
|
|
366
|
-
continue;
|
|
367
|
-
}
|
|
368
|
-
try {
|
|
369
|
-
const plugin = await loadPluginFromDir(resolvedPath, 'local', null, resolvedPath);
|
|
370
|
-
results.push({ plugin, source: resolvedPath });
|
|
371
|
-
}
|
|
372
|
-
catch (err) {
|
|
373
|
-
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
374
|
-
log.error(`Failed to load local plugin from ${resolvedPath}:`, err);
|
|
375
|
-
failures.push({ path: resolvedPath, error: errorMsg });
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
return { results, failures };
|
|
379
|
-
};
|
|
380
|
-
/**
|
|
381
|
-
* Legacy plugin discovery using opentabs-plugin.json manifests.
|
|
382
|
-
* Discovers from both node_modules and local filesystem paths.
|
|
383
|
-
*
|
|
384
|
-
* This function will be replaced by the new discoverPlugins in discovery.ts
|
|
385
|
-
* once reload.ts (US-009) and file-watcher.ts (US-012) are migrated.
|
|
386
|
-
*/
|
|
387
|
-
const discoverPluginsLegacy = async (localPaths, allowedNpmPackages, rootDir) => {
|
|
388
|
-
const resolvedRoot = rootDir ?? PACKAGE_DIR;
|
|
389
|
-
log.info('Starting plugin discovery...');
|
|
390
|
-
// Discover from both sources in parallel
|
|
391
|
-
const [npmResults, localDiscovery] = await Promise.all([
|
|
392
|
-
discoverFromNodeModules(resolvedRoot, allowedNpmPackages),
|
|
393
|
-
discoverFromLocalPaths(localPaths),
|
|
394
|
-
]);
|
|
395
|
-
// Local results first so local plugins take precedence over npm in dedup
|
|
396
|
-
const allResults = [...localDiscovery.results, ...npmResults];
|
|
397
|
-
const failures = [...localDiscovery.failures];
|
|
398
|
-
// Build new plugin Map, checking for duplicates
|
|
399
|
-
const plugins = new Map();
|
|
400
|
-
let loaded = 0;
|
|
401
|
-
for (const { plugin, source } of allResults) {
|
|
402
|
-
if (plugins.has(plugin.name)) {
|
|
403
|
-
log.warn(`Duplicate plugin "${plugin.name}" from ${source} — skipping (already loaded)`);
|
|
404
|
-
continue;
|
|
405
|
-
}
|
|
406
|
-
plugins.set(plugin.name, plugin);
|
|
407
|
-
loaded++;
|
|
408
|
-
const toolNames = plugin.tools.map(t => t.name).join(', ');
|
|
409
|
-
log.info(`Discovered plugin: ${plugin.name} v${plugin.version} (${plugin.trustTier}) from ${source} — tools: [${toolNames}]`);
|
|
410
|
-
}
|
|
411
|
-
log.info(`Plugin discovery complete: ${loaded} plugin(s) loaded`);
|
|
412
|
-
return { plugins, failures };
|
|
413
|
-
};
|
|
414
|
-
export { discoverPluginsLegacy, loadPluginFromDir };
|
|
415
|
-
//# sourceMappingURL=discovery-legacy.js.map
|