@mearl/setup 2.20.4 → 2.20.5
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/nativeHost.d.ts +2 -3
- package/dist/nativeHost.js +2 -19
- package/dist/plugin.js +10 -2
- package/package.json +3 -3
package/dist/nativeHost.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
-
|
|
3
|
-
export
|
|
2
|
+
import { MEARL_NATIVE_HOST_NAMES, resolveNativeHostDirectory, type NativeHostIntegrationMode } from '@mearl/client/native-host';
|
|
3
|
+
export { MEARL_NATIVE_HOST_NAMES, resolveNativeHostDirectory, type NativeHostIntegrationMode };
|
|
4
4
|
export interface NativeHostCleanupOptions {
|
|
5
5
|
mode?: NativeHostIntegrationMode | 'both';
|
|
6
6
|
silent?: boolean;
|
|
@@ -15,5 +15,4 @@ export interface NativeHostCleanupDependencies {
|
|
|
15
15
|
unregisterWindowsNativeHost?: (hostName: string) => void;
|
|
16
16
|
writeLine?: (line: string) => void;
|
|
17
17
|
}
|
|
18
|
-
export declare function resolveNativeHostDirectory(options?: Pick<NativeHostCleanupDependencies, 'env' | 'homedir' | 'platform'>): string;
|
|
19
18
|
export declare function uninstallNativeHostArtifacts(options?: NativeHostCleanupOptions, dependencies?: NativeHostCleanupDependencies): boolean;
|
package/dist/nativeHost.js
CHANGED
|
@@ -1,25 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
-
import os from 'node:os';
|
|
3
2
|
import path from 'node:path';
|
|
4
3
|
import { execFileSync } from 'node:child_process';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
mcp: 'com.alibaba.mearl.mcp',
|
|
8
|
-
};
|
|
9
|
-
export function resolveNativeHostDirectory(options = {}) {
|
|
10
|
-
const env = options.env ?? process.env;
|
|
11
|
-
const home = (options.homedir ?? os.homedir)();
|
|
12
|
-
switch (options.platform ?? process.platform) {
|
|
13
|
-
case 'darwin':
|
|
14
|
-
return path.join(home, 'Library/Application Support/Google/Chrome/NativeMessagingHosts');
|
|
15
|
-
case 'linux':
|
|
16
|
-
return path.join(home, '.config/google-chrome/NativeMessagingHosts');
|
|
17
|
-
case 'win32':
|
|
18
|
-
return path.join(env.PROGRAMDATA || 'C:\\ProgramData', 'Google\\Chrome\\NativeMessagingHosts');
|
|
19
|
-
default:
|
|
20
|
-
throw new Error(`Unsupported platform: ${String(options.platform ?? process.platform)}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
4
|
+
import { MEARL_NATIVE_HOST_NAMES, resolveNativeHostDirectory, } from '@mearl/client/native-host';
|
|
5
|
+
export { MEARL_NATIVE_HOST_NAMES, resolveNativeHostDirectory };
|
|
23
6
|
function unregisterWindowsNativeHost(hostName) {
|
|
24
7
|
const registryKey = `HKCU\\SOFTWARE\\Google\\Chrome\\NativeMessagingHosts\\${hostName}`;
|
|
25
8
|
try {
|
package/dist/plugin.js
CHANGED
|
@@ -37,7 +37,11 @@ export async function setupPlugin(target, requestedName) {
|
|
|
37
37
|
assertPluginName(name);
|
|
38
38
|
await ensurePluginRuntime();
|
|
39
39
|
return {
|
|
40
|
-
entry: registerPlugin(name, entry, plugin.description, {
|
|
40
|
+
entry: registerPlugin(name, entry, plugin.description, {
|
|
41
|
+
toolbox: plugin.toolbox,
|
|
42
|
+
appProfiles: plugin.appProfiles,
|
|
43
|
+
profileSources: plugin.profileSources,
|
|
44
|
+
}),
|
|
41
45
|
name,
|
|
42
46
|
};
|
|
43
47
|
}
|
|
@@ -264,6 +268,8 @@ export async function installPlugins(args, runner = runCommand, options = {}) {
|
|
|
264
268
|
entry,
|
|
265
269
|
description: plugin.description,
|
|
266
270
|
...(plugin.toolbox ? { toolbox: plugin.toolbox } : {}),
|
|
271
|
+
appProfiles: plugin.appProfiles,
|
|
272
|
+
profileSources: plugin.profileSources,
|
|
267
273
|
});
|
|
268
274
|
}
|
|
269
275
|
if (plugins.size === 0) {
|
|
@@ -271,10 +277,12 @@ export async function installPlugins(args, runner = runCommand, options = {}) {
|
|
|
271
277
|
return 0;
|
|
272
278
|
}
|
|
273
279
|
await ensurePluginRuntime(runner);
|
|
274
|
-
for (const [name, { entry, description, toolbox }] of plugins) {
|
|
280
|
+
for (const [name, { entry, description, toolbox, appProfiles, profileSources }] of plugins) {
|
|
275
281
|
registerPlugin(name, entry, description, {
|
|
276
282
|
managedBy: options.registrationManagedBy,
|
|
277
283
|
...(toolbox ? { toolbox } : {}),
|
|
284
|
+
appProfiles,
|
|
285
|
+
profileSources,
|
|
278
286
|
});
|
|
279
287
|
console.error(`Plugin ${name} registered: ${entry}\nRun: mearl ${name} --help`);
|
|
280
288
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/setup",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.5",
|
|
4
4
|
"description": "One-shot environment setup and configuration for Mearl",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"commander": "^15.0.0",
|
|
70
70
|
"extract-zip": "^2.0.1",
|
|
71
71
|
"ws": "^8.18.3",
|
|
72
|
-
"@mearl/client": "2.20.
|
|
73
|
-
"@mearl/provider": "2.20.
|
|
72
|
+
"@mearl/client": "2.20.5",
|
|
73
|
+
"@mearl/provider": "2.20.5"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/node": "^24.9.1",
|