@mearl/native-host 2.7.2 → 2.8.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.
- package/dist/index.js +903 -32513
- package/dist/install.js +9 -268
- package/package.json +12 -7
- package/dist/agent/codex-provider.d.ts +0 -60
- package/dist/agent/event-transport.d.ts +0 -3
- package/dist/agent/executable-resolver.d.ts +0 -46
- package/dist/agent/manager.d.ts +0 -41
- package/dist/agent/process-env.d.ts +0 -2
- package/dist/agent/provider.d.ts +0 -47
- package/dist/agent/qoder-provider.d.ts +0 -65
- package/dist/agent/skill-manager.d.ts +0 -21
- package/dist/agent/workspace-directory.d.ts +0 -4
- package/dist/agentbay-browser.d.ts +0 -168
- package/dist/agentbay-file-upload.d.ts +0 -12
- package/dist/agentbay-lifecycle.d.ts +0 -38
- package/dist/analytics.d.ts +0 -3
- package/dist/browser-inventory.d.ts +0 -8
- package/dist/browser-registry.d.ts +0 -78
- package/dist/cdp-backend/action-registry.d.ts +0 -36
- package/dist/cdp-backend/browser-handlers.d.ts +0 -8
- package/dist/cdp-backend/buffers.d.ts +0 -53
- package/dist/cdp-backend/cdp-session.d.ts +0 -74
- package/dist/cdp-backend/cdp-utils.d.ts +0 -67
- package/dist/cdp-backend/client.d.ts +0 -34
- package/dist/cdp-backend/composite-handlers.d.ts +0 -17
- package/dist/cdp-backend/controlled-indicator.d.ts +0 -18
- package/dist/cdp-backend/cookie-handlers.d.ts +0 -5
- package/dist/cdp-backend/cookie-transfer.d.ts +0 -30
- package/dist/cdp-backend/discover.d.ts +0 -28
- package/dist/cdp-backend/domain-manager.d.ts +0 -4
- package/dist/cdp-backend/handlers.d.ts +0 -31
- package/dist/cdp-backend/http-handlers.d.ts +0 -8
- package/dist/cdp-backend/interaction-handlers.d.ts +0 -18
- package/dist/cdp-backend/mock-handlers.d.ts +0 -9
- package/dist/cdp-backend/navigation-observer.d.ts +0 -9
- package/dist/cdp-backend/page-observer.d.ts +0 -5
- package/dist/cdp-backend/page-refs.d.ts +0 -9
- package/dist/cdp-backend/recording-handlers.d.ts +0 -12
- package/dist/cdp-backend/release-control.d.ts +0 -13
- package/dist/cdp-backend/request-handlers.d.ts +0 -10
- package/dist/cdp-backend/send-request.d.ts +0 -2
- package/dist/cdp-backend/snapshot-handlers.d.ts +0 -7
- package/dist/cdp-backend/tab-handlers.d.ts +0 -8
- package/dist/cdp-backend/tdbank-handlers.d.ts +0 -14
- package/dist/cdp-backend/timezone-handlers.d.ts +0 -4
- package/dist/cloud-connector.d.ts +0 -61
- package/dist/extension-file-transfer.d.ts +0 -7
- package/dist/host-updater.d.ts +0 -39
- package/dist/index.d.ts +0 -2
- package/dist/internal-extension-actions.d.ts +0 -9
- package/dist/managed-browser.d.ts +0 -78
- package/dist/send-request-file-utils.d.ts +0 -14
- package/dist/version.d.ts +0 -1
package/dist/install.js
CHANGED
|
@@ -1,237 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import fs2 from "node:fs";
|
|
3
|
-
import path2 from "node:path";
|
|
4
|
-
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
5
|
-
import { createRequire } from "node:module";
|
|
6
|
-
import { fileURLToPath } from "node:url";
|
|
7
|
-
|
|
8
|
-
// ../setup/dist/nativeHost.js
|
|
9
|
-
import fs from "node:fs";
|
|
10
|
-
import os from "node:os";
|
|
11
|
-
import path from "node:path";
|
|
12
|
-
import { execFileSync } from "node:child_process";
|
|
13
|
-
var MEARL_NATIVE_HOST_NAMES = {
|
|
14
|
-
skills: "com.alibaba.mearl.skills",
|
|
15
|
-
mcp: "com.alibaba.mearl.mcp"
|
|
16
|
-
};
|
|
17
|
-
function resolveNativeHostDirectory(options = {}) {
|
|
18
|
-
const env = options.env ?? process.env;
|
|
19
|
-
const home = (options.homedir ?? os.homedir)();
|
|
20
|
-
switch (options.platform ?? process.platform) {
|
|
21
|
-
case "darwin":
|
|
22
|
-
return path.join(home, "Library/Application Support/Google/Chrome/NativeMessagingHosts");
|
|
23
|
-
case "linux":
|
|
24
|
-
return path.join(home, ".config/google-chrome/NativeMessagingHosts");
|
|
25
|
-
case "win32":
|
|
26
|
-
return path.join(env.PROGRAMDATA || "C:\\ProgramData", "Google\\Chrome\\NativeMessagingHosts");
|
|
27
|
-
default:
|
|
28
|
-
throw new Error(`Unsupported platform: ${String(options.platform ?? process.platform)}`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function unregisterWindowsNativeHost(hostName) {
|
|
32
|
-
const registryKey = `HKCU\\SOFTWARE\\Google\\Chrome\\NativeMessagingHosts\\${hostName}`;
|
|
33
|
-
try {
|
|
34
|
-
execFileSync("reg", ["delete", registryKey, "/f"], { stdio: "pipe" });
|
|
35
|
-
} catch {
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function uninstallNativeHostArtifacts(options = {}, dependencies = {}) {
|
|
39
|
-
const { mode = "both", silent = false } = options;
|
|
40
|
-
if (mode === "both") {
|
|
41
|
-
return ["skills", "mcp"].map((integrationMode) => uninstallNativeHostArtifacts({ ...options, mode: integrationMode }, dependencies)).every(Boolean);
|
|
42
|
-
}
|
|
43
|
-
const writeLine = dependencies.writeLine ?? ((line) => console.error(line));
|
|
44
|
-
const log = (line) => {
|
|
45
|
-
if (!silent)
|
|
46
|
-
writeLine(line);
|
|
47
|
-
};
|
|
48
|
-
try {
|
|
49
|
-
const existsSync = dependencies.existsSync ?? fs.existsSync;
|
|
50
|
-
const platform = dependencies.platform ?? process.platform;
|
|
51
|
-
const hostDir = dependencies.hostDir ?? resolveNativeHostDirectory({
|
|
52
|
-
env: dependencies.env,
|
|
53
|
-
homedir: dependencies.homedir,
|
|
54
|
-
platform
|
|
55
|
-
});
|
|
56
|
-
const unlinkSync = dependencies.unlinkSync ?? fs.unlinkSync;
|
|
57
|
-
const unregister = dependencies.unregisterWindowsNativeHost ?? unregisterWindowsNativeHost;
|
|
58
|
-
const hostName = MEARL_NATIVE_HOST_NAMES[mode];
|
|
59
|
-
const launcherExtension = platform === "win32" ? "cmd" : "sh";
|
|
60
|
-
const artifacts = [
|
|
61
|
-
path.join(hostDir, `${hostName}.json`),
|
|
62
|
-
path.join(hostDir, `${hostName}-launcher.${launcherExtension}`)
|
|
63
|
-
];
|
|
64
|
-
for (const artifact of artifacts) {
|
|
65
|
-
if (!existsSync(artifact))
|
|
66
|
-
continue;
|
|
67
|
-
unlinkSync(artifact);
|
|
68
|
-
log(`✅ Removed: ${artifact}`);
|
|
69
|
-
}
|
|
70
|
-
if (platform === "win32")
|
|
71
|
-
unregister(hostName);
|
|
72
|
-
return true;
|
|
73
|
-
} catch (error) {
|
|
74
|
-
log(`❌ Uninstall failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// src/install.ts
|
|
80
|
-
var DEFAULT_EXTENSION_ID = "aoehhjnofngknnjefamjbplchbolghkm";
|
|
81
|
-
var __filename = fileURLToPath(import.meta.url);
|
|
82
|
-
var __dirname = path2.dirname(__filename);
|
|
83
|
-
var ALL_MODES = ["skills", "mcp"];
|
|
84
|
-
function resolveHostDir() {
|
|
85
|
-
return resolveNativeHostDirectory();
|
|
86
|
-
}
|
|
87
|
-
function resolveNativeHostPath() {
|
|
88
|
-
const siblingPath = path2.join(__dirname, "index.js");
|
|
89
|
-
if (fs2.existsSync(siblingPath)) {
|
|
90
|
-
return siblingPath;
|
|
91
|
-
}
|
|
92
|
-
try {
|
|
93
|
-
const require2 = createRequire(import.meta.url);
|
|
94
|
-
return require2.resolve("@mearl/native-host/runtime");
|
|
95
|
-
} catch {
|
|
96
|
-
throw new Error(
|
|
97
|
-
"Cannot locate native-host runtime entry point. Ensure @mearl/native-host is installed correctly."
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
function registerWindowsNativeHost(hostName, manifestPath) {
|
|
102
|
-
const regKey = `HKCU\\SOFTWARE\\Google\\Chrome\\NativeMessagingHosts\\${hostName}`;
|
|
103
|
-
execFileSync2("reg", ["add", regKey, "/ve", "/t", "REG_SZ", "/d", manifestPath, "/f"], {
|
|
104
|
-
stdio: "pipe"
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
function createLauncherScript(hostDir, hostPath, hostName) {
|
|
108
|
-
const nodePath = path2.resolve(process.execPath);
|
|
109
|
-
if (process.platform === "win32") {
|
|
110
|
-
const launcherPath2 = path2.join(hostDir, `${hostName}-launcher.cmd`);
|
|
111
|
-
const content2 = `@echo off\r
|
|
1
|
+
import { createRequire as __mearlCreateRequire } from 'node:module'; const require = __mearlCreateRequire(import.meta.url);
|
|
2
|
+
import fs2 from"node:fs";import path2 from"node:path";import{execFileSync as execFileSync2}from"node:child_process";import{createRequire}from"node:module";import{fileURLToPath}from"node:url";import fs from"node:fs";import os from"node:os";import path from"node:path";import{execFileSync}from"node:child_process";var MEARL_NATIVE_HOST_NAMES={skills:"com.alibaba.mearl.skills",mcp:"com.alibaba.mearl.mcp"};function resolveNativeHostDirectory(options={}){let env=options.env??process.env,home=(options.homedir??os.homedir)();switch(options.platform??process.platform){case"darwin":return path.join(home,"Library/Application Support/Google/Chrome/NativeMessagingHosts");case"linux":return path.join(home,".config/google-chrome/NativeMessagingHosts");case"win32":return path.join(env.PROGRAMDATA||"C:\\ProgramData","Google\\Chrome\\NativeMessagingHosts");default:throw new Error(`Unsupported platform: ${String(options.platform??process.platform)}`)}}function unregisterWindowsNativeHost(hostName){let registryKey=`HKCU\\SOFTWARE\\Google\\Chrome\\NativeMessagingHosts\\${hostName}`;try{execFileSync("reg",["delete",registryKey,"/f"],{stdio:"pipe"})}catch{}}function uninstallNativeHostArtifacts(options={},dependencies={}){let{mode="both",silent=!1}=options;if(mode==="both")return["skills","mcp"].map(integrationMode=>uninstallNativeHostArtifacts({...options,mode:integrationMode},dependencies)).every(Boolean);let writeLine=dependencies.writeLine??(line=>console.error(line)),log=line=>{silent||writeLine(line)};try{let existsSync=dependencies.existsSync??fs.existsSync,platform=dependencies.platform??process.platform,hostDir=dependencies.hostDir??resolveNativeHostDirectory({env:dependencies.env,homedir:dependencies.homedir,platform}),unlinkSync=dependencies.unlinkSync??fs.unlinkSync,unregister=dependencies.unregisterWindowsNativeHost??unregisterWindowsNativeHost,hostName=MEARL_NATIVE_HOST_NAMES[mode],launcherExtension=platform==="win32"?"cmd":"sh",artifacts=[path.join(hostDir,`${hostName}.json`),path.join(hostDir,`${hostName}-launcher.${launcherExtension}`)];for(let artifact of artifacts)existsSync(artifact)&&(unlinkSync(artifact),log(`✅ Removed: ${artifact}`));return platform==="win32"&&unregister(hostName),!0}catch(error){return log(`❌ Uninstall failed: ${error instanceof Error?error.message:String(error)}`),!1}}var DEFAULT_EXTENSION_ID="aoehhjnofngknnjefamjbplchbolghkm",__filename=fileURLToPath(import.meta.url),__dirname=path2.dirname(__filename),ALL_MODES=["skills","mcp"];function resolveHostDir(){return resolveNativeHostDirectory()}function resolveNativeHostPath(){let siblingPath=path2.join(__dirname,"index.js");if(fs2.existsSync(siblingPath))return siblingPath;try{return createRequire(import.meta.url).resolve("@mearl/native-host/runtime")}catch{throw new Error("Cannot locate native-host runtime entry point. Ensure @mearl/native-host is installed correctly.")}}function registerWindowsNativeHost(hostName,manifestPath){let regKey=`HKCU\\SOFTWARE\\Google\\Chrome\\NativeMessagingHosts\\${hostName}`;execFileSync2("reg",["add",regKey,"/ve","/t","REG_SZ","/d",manifestPath,"/f"],{stdio:"pipe"})}function createLauncherScript(hostDir,hostPath,hostName){let nodePath=path2.resolve(process.execPath);if(process.platform==="win32"){let launcherPath2=path2.join(hostDir,`${hostName}-launcher.cmd`),content2=`@echo off\r
|
|
112
3
|
"${nodePath}" "${hostPath}" %*\r
|
|
113
|
-
`;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
const launcherPath = path2.join(hostDir, `${hostName}-launcher.sh`);
|
|
118
|
-
const content = [
|
|
119
|
-
"#!/bin/sh",
|
|
120
|
-
`NODE_BIN=${JSON.stringify(nodePath)}`,
|
|
121
|
-
`HOST_SCRIPT=${JSON.stringify(hostPath)}`,
|
|
122
|
-
'exec "$NODE_BIN" "$HOST_SCRIPT" "$@"',
|
|
123
|
-
""
|
|
124
|
-
].join("\n");
|
|
125
|
-
fs2.writeFileSync(launcherPath, content, "utf-8");
|
|
126
|
-
fs2.chmodSync(launcherPath, 493);
|
|
127
|
-
return launcherPath;
|
|
128
|
-
}
|
|
129
|
-
async function installNativeHost(options = {}) {
|
|
130
|
-
const {
|
|
131
|
-
mode = "both",
|
|
132
|
-
extensionId = DEFAULT_EXTENSION_ID,
|
|
133
|
-
silent = false,
|
|
134
|
-
skipIfExists = false
|
|
135
|
-
} = options;
|
|
136
|
-
if (mode === "both") {
|
|
137
|
-
const results = await Promise.all(
|
|
138
|
-
ALL_MODES.map((m) => installNativeHost({ ...options, mode: m }))
|
|
139
|
-
);
|
|
140
|
-
return results.every(Boolean);
|
|
141
|
-
}
|
|
142
|
-
const hostName = MEARL_NATIVE_HOST_NAMES[mode];
|
|
143
|
-
if (!hostName) {
|
|
144
|
-
throw new Error(`Unknown mode: ${mode}. Expected 'skills' or 'mcp'.`);
|
|
145
|
-
}
|
|
146
|
-
const log = (...args) => {
|
|
147
|
-
if (!silent) console.error(...args);
|
|
148
|
-
};
|
|
149
|
-
try {
|
|
150
|
-
const hostDir = resolveHostDir();
|
|
151
|
-
if (skipIfExists) {
|
|
152
|
-
const manifestPath2 = path2.join(hostDir, `${hostName}.json`);
|
|
153
|
-
if (fs2.existsSync(manifestPath2)) {
|
|
154
|
-
log(`✅ Already installed: ${manifestPath2}`);
|
|
155
|
-
return true;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
if (!fs2.existsSync(hostDir)) {
|
|
159
|
-
fs2.mkdirSync(hostDir, { recursive: true });
|
|
160
|
-
log(`✅ Created directory: ${hostDir}`);
|
|
161
|
-
}
|
|
162
|
-
const resolvedHostPath = resolveNativeHostPath();
|
|
163
|
-
log(`✅ Native host path: ${resolvedHostPath}`);
|
|
164
|
-
const launcherPath = createLauncherScript(hostDir, resolvedHostPath, hostName);
|
|
165
|
-
log(`✅ Launcher script: ${launcherPath}`);
|
|
166
|
-
const manifest = {
|
|
167
|
-
name: hostName,
|
|
168
|
-
description: "Mearl Native Messaging Bridge",
|
|
169
|
-
path: launcherPath,
|
|
170
|
-
type: "stdio",
|
|
171
|
-
allowed_origins: [`chrome-extension://${extensionId}/`]
|
|
172
|
-
};
|
|
173
|
-
const manifestPath = path2.join(hostDir, `${hostName}.json`);
|
|
174
|
-
fs2.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
|
|
175
|
-
if (process.platform === "win32") {
|
|
176
|
-
registerWindowsNativeHost(hostName, manifestPath);
|
|
177
|
-
log(`✅ Windows registry key created for: ${hostName}`);
|
|
178
|
-
} else {
|
|
179
|
-
fs2.chmodSync(manifestPath, 420);
|
|
180
|
-
}
|
|
181
|
-
log(`✅ Manifest installed: ${manifestPath}`);
|
|
182
|
-
log(`✅ Extension ID: ${extensionId}`);
|
|
183
|
-
log(`✅ Host name: ${hostName}`);
|
|
184
|
-
return true;
|
|
185
|
-
} catch (error) {
|
|
186
|
-
log(`❌ Installation failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
187
|
-
if (error instanceof Error && "code" in error && error.code === "EACCES") {
|
|
188
|
-
log("\n Permission denied. Try running with sudo.");
|
|
189
|
-
}
|
|
190
|
-
return false;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
async function uninstallNativeHost(options = {}, dependencies = {}) {
|
|
194
|
-
return uninstallNativeHostArtifacts(options, dependencies);
|
|
195
|
-
}
|
|
196
|
-
function parseCliArgs(argv) {
|
|
197
|
-
let mode = "both";
|
|
198
|
-
let extensionId;
|
|
199
|
-
let skipIfExists = false;
|
|
200
|
-
let uninstall = false;
|
|
201
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
202
|
-
const arg = argv[i];
|
|
203
|
-
if (arg === "--help" || arg === "-h") {
|
|
204
|
-
return { showHelp: true, uninstall, mode, skipIfExists };
|
|
205
|
-
}
|
|
206
|
-
if (arg === "--mode" || arg.startsWith("--mode=")) {
|
|
207
|
-
const value = arg.includes("=") ? arg.slice("--mode=".length) : argv[++i];
|
|
208
|
-
if (value !== "skills" && value !== "mcp" && value !== "both") {
|
|
209
|
-
console.error(`❌ Invalid mode: ${value}. Expected 'skills', 'mcp', or 'both'.`);
|
|
210
|
-
process.exit(1);
|
|
211
|
-
}
|
|
212
|
-
mode = value;
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
if (arg === "--extension-id" || arg.startsWith("--extension-id=")) {
|
|
216
|
-
extensionId = arg.includes("=") ? arg.slice("--extension-id=".length) : argv[++i];
|
|
217
|
-
continue;
|
|
218
|
-
}
|
|
219
|
-
if (arg === "--skip-if-exists") {
|
|
220
|
-
skipIfExists = true;
|
|
221
|
-
continue;
|
|
222
|
-
}
|
|
223
|
-
if (arg === "--uninstall") {
|
|
224
|
-
uninstall = true;
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
|
-
if (arg === "--init") {
|
|
228
|
-
continue;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
return { showHelp: false, uninstall, mode, extensionId, skipIfExists };
|
|
232
|
-
}
|
|
233
|
-
function printHelp() {
|
|
234
|
-
console.error(`Usage:
|
|
4
|
+
`;return fs2.writeFileSync(launcherPath2,content2,"utf-8"),launcherPath2}let launcherPath=path2.join(hostDir,`${hostName}-launcher.sh`),content=["#!/bin/sh",`NODE_BIN=${JSON.stringify(nodePath)}`,`HOST_SCRIPT=${JSON.stringify(hostPath)}`,'exec "$NODE_BIN" "$HOST_SCRIPT" "$@"',""].join(`
|
|
5
|
+
`);return fs2.writeFileSync(launcherPath,content,"utf-8"),fs2.chmodSync(launcherPath,493),launcherPath}async function installNativeHost(options={}){let{mode="both",extensionId=DEFAULT_EXTENSION_ID,silent=!1,skipIfExists=!1}=options;if(mode==="both")return(await Promise.all(ALL_MODES.map(m=>installNativeHost({...options,mode:m})))).every(Boolean);let hostName=MEARL_NATIVE_HOST_NAMES[mode];if(!hostName)throw new Error(`Unknown mode: ${mode}. Expected 'skills' or 'mcp'.`);let log=(...args)=>{silent||console.error(...args)};try{let hostDir=resolveHostDir();if(skipIfExists){let manifestPath2=path2.join(hostDir,`${hostName}.json`);if(fs2.existsSync(manifestPath2))return log(`✅ Already installed: ${manifestPath2}`),!0}fs2.existsSync(hostDir)||(fs2.mkdirSync(hostDir,{recursive:!0}),log(`✅ Created directory: ${hostDir}`));let resolvedHostPath=resolveNativeHostPath();log(`✅ Native host path: ${resolvedHostPath}`);let launcherPath=createLauncherScript(hostDir,resolvedHostPath,hostName);log(`✅ Launcher script: ${launcherPath}`);let manifest={name:hostName,description:"Mearl Native Messaging Bridge",path:launcherPath,type:"stdio",allowed_origins:[`chrome-extension://${extensionId}/`]},manifestPath=path2.join(hostDir,`${hostName}.json`);return fs2.writeFileSync(manifestPath,JSON.stringify(manifest,null,2)),process.platform==="win32"?(registerWindowsNativeHost(hostName,manifestPath),log(`✅ Windows registry key created for: ${hostName}`)):fs2.chmodSync(manifestPath,420),log(`✅ Manifest installed: ${manifestPath}`),log(`✅ Extension ID: ${extensionId}`),log(`✅ Host name: ${hostName}`),!0}catch(error){return log(`❌ Installation failed: ${error instanceof Error?error.message:String(error)}`),error instanceof Error&&"code"in error&&error.code==="EACCES"&&log(`
|
|
6
|
+
Permission denied. Try running with sudo.`),!1}}async function uninstallNativeHost(options={},dependencies={}){return uninstallNativeHostArtifacts(options,dependencies)}function parseCliArgs(argv){let mode="both",extensionId,skipIfExists=!1,uninstall=!1;for(let i=0;i<argv.length;i+=1){let arg=argv[i];if(arg==="--help"||arg==="-h")return{showHelp:!0,uninstall,mode,skipIfExists};if(arg==="--mode"||arg.startsWith("--mode=")){let value=arg.includes("=")?arg.slice(7):argv[++i];value!=="skills"&&value!=="mcp"&&value!=="both"&&(console.error(`❌ Invalid mode: ${value}. Expected 'skills', 'mcp', or 'both'.`),process.exit(1)),mode=value;continue}if(arg==="--extension-id"||arg.startsWith("--extension-id=")){extensionId=arg.includes("=")?arg.slice(15):argv[++i];continue}if(arg==="--skip-if-exists"){skipIfExists=!0;continue}if(arg==="--uninstall"){uninstall=!0;continue}}return{showHelp:!1,uninstall,mode,extensionId,skipIfExists}}function printHelp(){console.error(`Usage:
|
|
235
7
|
mearl-native-host --init [options]
|
|
236
8
|
mearl-native-host --uninstall [options]
|
|
237
9
|
|
|
@@ -245,31 +17,9 @@ Examples:
|
|
|
245
17
|
mearl-native-host --init
|
|
246
18
|
mearl-native-host --init --mode mcp
|
|
247
19
|
mearl-native-host --uninstall --mode skills
|
|
248
|
-
mearl-native-host --init --extension-id abcdefghijklmnopqrstuvwxyzabcdef`);
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
const parsed = parseCliArgs(argv);
|
|
252
|
-
if (parsed.showHelp) {
|
|
253
|
-
printHelp();
|
|
254
|
-
process.exit(0);
|
|
255
|
-
}
|
|
256
|
-
if (parsed.extensionId && !/^[a-z]{32}$/.test(parsed.extensionId)) {
|
|
257
|
-
console.error(`❌ Invalid extension ID: ${parsed.extensionId}`);
|
|
258
|
-
console.error(" Must be a 32-character lowercase string (see chrome://extensions/)");
|
|
259
|
-
process.exit(1);
|
|
260
|
-
}
|
|
261
|
-
if (parsed.uninstall) {
|
|
262
|
-
const success2 = await uninstallNativeHost({ mode: parsed.mode });
|
|
263
|
-
if (success2) console.error("\n✅ Uninstall complete!\n");
|
|
264
|
-
process.exit(success2 ? 0 : 1);
|
|
265
|
-
}
|
|
266
|
-
const success = await installNativeHost({
|
|
267
|
-
mode: parsed.mode,
|
|
268
|
-
extensionId: parsed.extensionId,
|
|
269
|
-
skipIfExists: parsed.skipIfExists
|
|
270
|
-
});
|
|
271
|
-
if (success) {
|
|
272
|
-
console.error(`
|
|
20
|
+
mearl-native-host --init --extension-id abcdefghijklmnopqrstuvwxyzabcdef`)}async function runCli(argv){let parsed=parseCliArgs(argv);if(parsed.showHelp&&(printHelp(),process.exit(0)),parsed.extensionId&&!/^[a-z]{32}$/.test(parsed.extensionId)&&(console.error(`❌ Invalid extension ID: ${parsed.extensionId}`),console.error(" Must be a 32-character lowercase string (see chrome://extensions/)"),process.exit(1)),parsed.uninstall){let success2=await uninstallNativeHost({mode:parsed.mode});success2&&console.error(`
|
|
21
|
+
✅ Uninstall complete!
|
|
22
|
+
`),process.exit(success2?0:1)}let success=await installNativeHost({mode:parsed.mode,extensionId:parsed.extensionId,skipIfExists:parsed.skipIfExists});success&&console.error(`
|
|
273
23
|
✅ Installation complete!
|
|
274
24
|
|
|
275
25
|
Next steps:
|
|
@@ -278,13 +28,4 @@ Next steps:
|
|
|
278
28
|
|
|
279
29
|
Verify:
|
|
280
30
|
mearl get_requests --payload '{"count":1}'
|
|
281
|
-
`);
|
|
282
|
-
}
|
|
283
|
-
process.exit(success ? 0 : 1);
|
|
284
|
-
}
|
|
285
|
-
export {
|
|
286
|
-
installNativeHost,
|
|
287
|
-
resolveHostDir,
|
|
288
|
-
runCli,
|
|
289
|
-
uninstallNativeHost
|
|
290
|
-
};
|
|
31
|
+
`),process.exit(success?0:1)}export{installNativeHost,resolveHostDir,runCli,uninstallNativeHost};
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/native-host",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Native Messaging Host for Mearl — bridges Chrome Extension and local socket server",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=18"
|
|
8
|
+
},
|
|
6
9
|
"main": "dist/install.js",
|
|
7
10
|
"types": "dist/install.d.ts",
|
|
8
11
|
"exports": {
|
|
@@ -16,7 +19,9 @@
|
|
|
16
19
|
"mearl-native-host": "./dist/index.js"
|
|
17
20
|
},
|
|
18
21
|
"files": [
|
|
19
|
-
"dist"
|
|
22
|
+
"dist/index.js",
|
|
23
|
+
"dist/install.js",
|
|
24
|
+
"dist/install.d.ts"
|
|
20
25
|
],
|
|
21
26
|
"keywords": [
|
|
22
27
|
"mearl",
|
|
@@ -28,8 +33,7 @@
|
|
|
28
33
|
"registry": "https://registry.npmjs.org"
|
|
29
34
|
},
|
|
30
35
|
"dependencies": {
|
|
31
|
-
"ws": "^8.18.3"
|
|
32
|
-
"wuying-agentbay-sdk": "^0.22.0"
|
|
36
|
+
"ws": "^8.18.3"
|
|
33
37
|
},
|
|
34
38
|
"devDependencies": {
|
|
35
39
|
"@agentclientprotocol/sdk": "^1.2.1",
|
|
@@ -37,9 +41,10 @@
|
|
|
37
41
|
"@types/ws": "^8.18.1",
|
|
38
42
|
"esbuild": "^0.25.2",
|
|
39
43
|
"typescript": "^5.8.3",
|
|
40
|
-
"
|
|
41
|
-
"@mearl/daemon-core": "2.
|
|
42
|
-
"@mearl/
|
|
44
|
+
"wuying-agentbay-sdk": "0.22.0",
|
|
45
|
+
"@mearl/daemon-core": "2.8.0",
|
|
46
|
+
"@mearl/browser-core": "2.8.0",
|
|
47
|
+
"@mearl/setup": "2.8.0"
|
|
43
48
|
},
|
|
44
49
|
"scripts": {
|
|
45
50
|
"build": "rm -rf dist/ && node build.mjs",
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { AgentChatImageInput, AgentChatModelInfo, AgentChatProviderDescriptor, AgentInstalledSkill } from '@mearl/browser-core';
|
|
2
|
-
import type { AgentProvider, AgentProviderEvent, AgentProviderListSessionsOptions, AgentProviderListSessionsResult, AgentProviderResumeResult, AgentProviderSessionOptions } from './provider.js';
|
|
3
|
-
interface CodexExecutableCandidateOptions {
|
|
4
|
-
env?: NodeJS.ProcessEnv;
|
|
5
|
-
homedir?: () => string;
|
|
6
|
-
platform?: NodeJS.Platform;
|
|
7
|
-
processExecPath?: string;
|
|
8
|
-
readdirSync?: typeof import('node:fs').readdirSync;
|
|
9
|
-
}
|
|
10
|
-
export declare function codexExecutableCandidatePaths(options?: CodexExecutableCandidateOptions): string[];
|
|
11
|
-
export declare function codexThreadUrl(providerSessionId: string): string;
|
|
12
|
-
export declare function externalOpenCommand(url: string, platform?: NodeJS.Platform): {
|
|
13
|
-
command: string;
|
|
14
|
-
args: string[];
|
|
15
|
-
};
|
|
16
|
-
export declare class CodexAgentProvider implements AgentProvider {
|
|
17
|
-
private readonly log;
|
|
18
|
-
private readonly clientVersion;
|
|
19
|
-
private readonly mearlSocketPath?;
|
|
20
|
-
readonly id = "codex";
|
|
21
|
-
private process;
|
|
22
|
-
private initialized;
|
|
23
|
-
private startPromise;
|
|
24
|
-
private nextRequestId;
|
|
25
|
-
private pendingRequests;
|
|
26
|
-
private listeners;
|
|
27
|
-
private knownThreadIds;
|
|
28
|
-
private sessionModels;
|
|
29
|
-
private readonly executableResolver;
|
|
30
|
-
constructor(log: (...args: any[]) => void, clientVersion: string, mearlSocketPath?: string | undefined);
|
|
31
|
-
getDescriptor(): Promise<AgentChatProviderDescriptor>;
|
|
32
|
-
prepare(): Promise<void>;
|
|
33
|
-
onEvent(listener: (event: AgentProviderEvent) => void): () => void;
|
|
34
|
-
listSessions(options: AgentProviderListSessionsOptions): Promise<AgentProviderListSessionsResult>;
|
|
35
|
-
listSkills(cwd?: string): Promise<AgentInstalledSkill[]>;
|
|
36
|
-
startSession(options: AgentProviderSessionOptions): Promise<string>;
|
|
37
|
-
resumeSession(providerSessionId: string, options: AgentProviderSessionOptions): Promise<AgentProviderResumeResult>;
|
|
38
|
-
getSessionModel(providerSessionId: string): AgentChatModelInfo | undefined;
|
|
39
|
-
sendMessage(providerSessionId: string, message: string, images?: AgentChatImageInput[]): Promise<{
|
|
40
|
-
turnId: string;
|
|
41
|
-
}>;
|
|
42
|
-
interrupt(providerSessionId: string, turnId: string): Promise<void>;
|
|
43
|
-
closeSession(providerSessionId: string): Promise<void>;
|
|
44
|
-
openSession(providerSessionId: string): Promise<void>;
|
|
45
|
-
respondToRequest(requestId: string | number, result: unknown): void;
|
|
46
|
-
dispose(): void;
|
|
47
|
-
private ensureStarted;
|
|
48
|
-
private start;
|
|
49
|
-
private handleLine;
|
|
50
|
-
private request;
|
|
51
|
-
private write;
|
|
52
|
-
private handleExit;
|
|
53
|
-
private rejectPending;
|
|
54
|
-
private emit;
|
|
55
|
-
private extractThreadId;
|
|
56
|
-
private probeExecutable;
|
|
57
|
-
private resolveExecutable;
|
|
58
|
-
private resolveExecutableCandidates;
|
|
59
|
-
}
|
|
60
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
export type AgentExecutableResolution = {
|
|
3
|
-
executable: string;
|
|
4
|
-
error: null;
|
|
5
|
-
} | {
|
|
6
|
-
executable: null;
|
|
7
|
-
error: string;
|
|
8
|
-
};
|
|
9
|
-
interface AgentExecutableResolverOptions {
|
|
10
|
-
candidates: () => string[];
|
|
11
|
-
probe: (executable: string) => Promise<string | null>;
|
|
12
|
-
notFoundError: string;
|
|
13
|
-
unusableError: string;
|
|
14
|
-
onFailure?: (executable: string, error: string) => void;
|
|
15
|
-
}
|
|
16
|
-
interface AgentExecutableProbeOptions {
|
|
17
|
-
args: string[];
|
|
18
|
-
timeoutMs: number;
|
|
19
|
-
timeoutError: string;
|
|
20
|
-
startError: (error: Error) => string;
|
|
21
|
-
exitError: (code: number | null) => string;
|
|
22
|
-
}
|
|
23
|
-
interface AgentExecutableCandidateOptions {
|
|
24
|
-
executableNames: string[];
|
|
25
|
-
configuredPath?: string;
|
|
26
|
-
env?: NodeJS.ProcessEnv;
|
|
27
|
-
extraUserCandidates?: string[];
|
|
28
|
-
home: string;
|
|
29
|
-
platform?: NodeJS.Platform;
|
|
30
|
-
processExecPath?: string;
|
|
31
|
-
readdirSync?: typeof fs.readdirSync;
|
|
32
|
-
}
|
|
33
|
-
export declare function agentExecutableCandidatePaths({ executableNames, configuredPath, env, extraUserCandidates, home, platform, processExecPath, readdirSync, }: AgentExecutableCandidateOptions): string[];
|
|
34
|
-
export declare class AgentExecutableResolver {
|
|
35
|
-
private readonly options;
|
|
36
|
-
private resolvedExecutable;
|
|
37
|
-
private resolutionPromise;
|
|
38
|
-
private generation;
|
|
39
|
-
constructor(options: AgentExecutableResolverOptions);
|
|
40
|
-
resolve(): Promise<AgentExecutableResolution>;
|
|
41
|
-
reset(): void;
|
|
42
|
-
private probeCandidates;
|
|
43
|
-
}
|
|
44
|
-
export declare function executableFileCandidates(candidates: Array<string | null | undefined>): string[];
|
|
45
|
-
export declare function probeAgentExecutable(executable: string, options: AgentExecutableProbeOptions): Promise<string | null>;
|
|
46
|
-
export {};
|
package/dist/agent/manager.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { AgentChatEvent, AgentChatEventsOptions, AgentChatEventsResult, AgentChatListSessionsOptions, AgentChatListSessionsResult, AgentChatPrepareOptions, AgentChatRefreshResult, AgentChatRespondOptions, AgentChatSendOptions, AgentChatSession, AgentChatSessionTarget, AgentChatStartOptions, AgentChatStatus, AgentInstalledSkill, AgentSkillInstalledListOptions, AgentSkillReadOptions, AgentSkillReadResult } from '@mearl/browser-core';
|
|
2
|
-
import type { AgentProvider } from './provider.js';
|
|
3
|
-
export declare class AgentChatManager {
|
|
4
|
-
private readonly emit;
|
|
5
|
-
private readonly providers;
|
|
6
|
-
private readonly sessions;
|
|
7
|
-
private readonly sessionByProviderThread;
|
|
8
|
-
private readonly pendingRequests;
|
|
9
|
-
private readonly completedTurns;
|
|
10
|
-
private readonly recentEvents;
|
|
11
|
-
private readonly recentEventBytes;
|
|
12
|
-
private readonly compactedEventCounts;
|
|
13
|
-
private readonly truncatedEventSessions;
|
|
14
|
-
private readonly unsubscribe;
|
|
15
|
-
constructor(providers: AgentProvider[], emit: (event: AgentChatEvent) => void);
|
|
16
|
-
getStatus(): Promise<AgentChatStatus>;
|
|
17
|
-
prepare(options: AgentChatPrepareOptions): Promise<void>;
|
|
18
|
-
listSkills(options: AgentSkillInstalledListOptions): Promise<AgentInstalledSkill[]>;
|
|
19
|
-
readSkill(options: AgentSkillReadOptions): Promise<AgentSkillReadResult>;
|
|
20
|
-
listSessions(options: AgentChatListSessionsOptions): Promise<AgentChatListSessionsResult>;
|
|
21
|
-
startSession(options: AgentChatStartOptions): Promise<AgentChatSession>;
|
|
22
|
-
sendMessage(options: AgentChatSendOptions): Promise<{
|
|
23
|
-
turnId: string;
|
|
24
|
-
}>;
|
|
25
|
-
interrupt(options: AgentChatSessionTarget): Promise<void>;
|
|
26
|
-
openSession(options: AgentChatSessionTarget): Promise<void>;
|
|
27
|
-
closeSession(options: AgentChatSessionTarget): Promise<void>;
|
|
28
|
-
getEvents(options: AgentChatEventsOptions): AgentChatEventsResult;
|
|
29
|
-
refreshSession(options: AgentChatEventsOptions): Promise<AgentChatRefreshResult>;
|
|
30
|
-
respondToRequest(options: AgentChatRespondOptions): void;
|
|
31
|
-
dispose(): void;
|
|
32
|
-
private handleProviderEvent;
|
|
33
|
-
private emitEvent;
|
|
34
|
-
private recordEvent;
|
|
35
|
-
private trimReplayBuffer;
|
|
36
|
-
private getProvider;
|
|
37
|
-
private getSession;
|
|
38
|
-
private providerThreadKey;
|
|
39
|
-
private providerRequestKey;
|
|
40
|
-
private sessionTurnKey;
|
|
41
|
-
}
|
package/dist/agent/provider.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { AgentChatEventKind, AgentChatImageInput, AgentChatListSessionsOptions, AgentChatModelInfo, AgentChatProviderDescriptor, AgentChatSessionSummary, AgentInstalledSkill } from '@mearl/browser-core';
|
|
2
|
-
export interface AgentProviderEvent {
|
|
3
|
-
providerSessionId?: string;
|
|
4
|
-
kind: AgentChatEventKind;
|
|
5
|
-
method: string;
|
|
6
|
-
params: unknown;
|
|
7
|
-
timestamp?: number;
|
|
8
|
-
requestId?: string | number;
|
|
9
|
-
}
|
|
10
|
-
export interface AgentProviderSessionOptions {
|
|
11
|
-
cwd?: string;
|
|
12
|
-
developerInstructions?: string;
|
|
13
|
-
ephemeral?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export type AgentProviderSessionSummary = Omit<AgentChatSessionSummary, 'providerId'>;
|
|
16
|
-
export interface AgentProviderListSessionsOptions extends Omit<AgentChatListSessionsOptions, 'providerId' | 'limit'> {
|
|
17
|
-
limit: number;
|
|
18
|
-
}
|
|
19
|
-
export interface AgentProviderListSessionsResult {
|
|
20
|
-
sessions: AgentProviderSessionSummary[];
|
|
21
|
-
nextCursor?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface AgentProviderResumeResult {
|
|
24
|
-
providerSessionId: string;
|
|
25
|
-
history?: AgentProviderEvent[];
|
|
26
|
-
historyComplete?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface AgentProvider {
|
|
29
|
-
readonly id: string;
|
|
30
|
-
getDescriptor(): Promise<AgentChatProviderDescriptor>;
|
|
31
|
-
prepare(): Promise<void>;
|
|
32
|
-
onEvent(listener: (event: AgentProviderEvent) => void): () => void;
|
|
33
|
-
listSessions?(options: AgentProviderListSessionsOptions): Promise<AgentProviderListSessionsResult>;
|
|
34
|
-
listSkills?(cwd?: string): Promise<AgentInstalledSkill[]>;
|
|
35
|
-
startSession(options: AgentProviderSessionOptions): Promise<string>;
|
|
36
|
-
resumeSession(providerSessionId: string, options: AgentProviderSessionOptions): Promise<AgentProviderResumeResult>;
|
|
37
|
-
getSessionModel?(providerSessionId: string): AgentChatModelInfo | undefined;
|
|
38
|
-
validateMessageInput?(images: AgentChatImageInput[]): Promise<void>;
|
|
39
|
-
sendMessage(providerSessionId: string, message: string, images?: AgentChatImageInput[]): Promise<{
|
|
40
|
-
turnId: string;
|
|
41
|
-
}>;
|
|
42
|
-
interrupt(providerSessionId: string, turnId: string): Promise<void>;
|
|
43
|
-
closeSession(providerSessionId: string): Promise<void>;
|
|
44
|
-
openSession?(providerSessionId: string): Promise<void>;
|
|
45
|
-
respondToRequest(requestId: string | number, result: unknown): void;
|
|
46
|
-
dispose(): void;
|
|
47
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import * as acp from '@agentclientprotocol/sdk';
|
|
3
|
-
import type { AgentChatImageInput, AgentChatModelInfo, AgentChatProviderDescriptor, AgentInstalledSkill } from '@mearl/browser-core';
|
|
4
|
-
import type { AgentProvider, AgentProviderEvent, AgentProviderListSessionsOptions, AgentProviderListSessionsResult, AgentProviderResumeResult, AgentProviderSessionOptions } from './provider.js';
|
|
5
|
-
export declare function qoderModelInfo(configOptions: acp.SessionConfigOption[] | null | undefined): AgentChatModelInfo | undefined;
|
|
6
|
-
export declare function parseQoderSkillsList(output: string, cwd: string, home?: string): AgentInstalledSkill[];
|
|
7
|
-
export declare function qoderInstallCommand(platform?: NodeJS.Platform): string;
|
|
8
|
-
interface QoderExecutableCandidateOptions {
|
|
9
|
-
env?: NodeJS.ProcessEnv;
|
|
10
|
-
homedir?: () => string;
|
|
11
|
-
platform?: NodeJS.Platform;
|
|
12
|
-
processExecPath?: string;
|
|
13
|
-
readdirSync?: typeof fs.readdirSync;
|
|
14
|
-
}
|
|
15
|
-
export declare function qoderExecutableCandidatePaths(options?: QoderExecutableCandidateOptions): string[];
|
|
16
|
-
export declare class QoderAgentProvider implements AgentProvider {
|
|
17
|
-
private readonly log;
|
|
18
|
-
private readonly clientVersion;
|
|
19
|
-
readonly id = "qoder";
|
|
20
|
-
private process;
|
|
21
|
-
private connection;
|
|
22
|
-
private context;
|
|
23
|
-
private initializeResponse;
|
|
24
|
-
private startPromise;
|
|
25
|
-
private listeners;
|
|
26
|
-
private sessions;
|
|
27
|
-
private pendingPermissions;
|
|
28
|
-
private historyCaptures;
|
|
29
|
-
private nextTurnId;
|
|
30
|
-
private readonly executableResolver;
|
|
31
|
-
constructor(log: (...args: any[]) => void, clientVersion: string);
|
|
32
|
-
getDescriptor(): Promise<AgentChatProviderDescriptor>;
|
|
33
|
-
prepare(): Promise<void>;
|
|
34
|
-
onEvent(listener: (event: AgentProviderEvent) => void): () => void;
|
|
35
|
-
listSessions(options: AgentProviderListSessionsOptions): Promise<AgentProviderListSessionsResult>;
|
|
36
|
-
listSkills(cwd?: string): Promise<AgentInstalledSkill[]>;
|
|
37
|
-
startSession(options: AgentProviderSessionOptions): Promise<string>;
|
|
38
|
-
resumeSession(providerSessionId: string, options: AgentProviderSessionOptions): Promise<AgentProviderResumeResult>;
|
|
39
|
-
getSessionModel(providerSessionId: string): AgentChatModelInfo | undefined;
|
|
40
|
-
validateMessageInput(images: AgentChatImageInput[]): Promise<void>;
|
|
41
|
-
sendMessage(providerSessionId: string, message: string, images?: AgentChatImageInput[]): Promise<{
|
|
42
|
-
turnId: string;
|
|
43
|
-
}>;
|
|
44
|
-
interrupt(providerSessionId: string, _turnId: string): Promise<void>;
|
|
45
|
-
closeSession(providerSessionId: string): Promise<void>;
|
|
46
|
-
respondToRequest(requestId: string | number, result: unknown): void;
|
|
47
|
-
dispose(): void;
|
|
48
|
-
private ensureStarted;
|
|
49
|
-
private start;
|
|
50
|
-
private runPrompt;
|
|
51
|
-
private handleSessionUpdate;
|
|
52
|
-
private emitToolUpdate;
|
|
53
|
-
private handlePermissionRequest;
|
|
54
|
-
private cancelPermissions;
|
|
55
|
-
private handleExit;
|
|
56
|
-
private getContext;
|
|
57
|
-
private assertImageInputSupported;
|
|
58
|
-
private withTimeout;
|
|
59
|
-
private probeExecutable;
|
|
60
|
-
private runSkillsList;
|
|
61
|
-
private resolveExecutable;
|
|
62
|
-
private resolveExecutableCandidates;
|
|
63
|
-
private emit;
|
|
64
|
-
}
|
|
65
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { AgentSkillCheckUpdatesResult, AgentSkillCheckUpdatesOptions, AgentSkillCliStatus, AgentSkillInstallOptions, AgentSkillMutationOptions, AgentSkillMutationResult, AgentSkillScope, AgentSkillUpdate } from '@mearl/browser-core';
|
|
2
|
-
import { resolveAliSkillsExecutable, type AliSkillsCliRunner } from '@mearl/setup/ali-skills';
|
|
3
|
-
export type SkillCliRunner = AliSkillsCliRunner;
|
|
4
|
-
export { resolveAliSkillsExecutable };
|
|
5
|
-
export declare const runSkillCli: SkillCliRunner;
|
|
6
|
-
export interface AgentSkillManagerOptions {
|
|
7
|
-
resolveExecutable?: () => string | null;
|
|
8
|
-
run?: SkillCliRunner;
|
|
9
|
-
}
|
|
10
|
-
export declare function parseSkillUpdates(stdout: string, scope: AgentSkillScope): AgentSkillUpdate[];
|
|
11
|
-
export declare class AgentSkillManager {
|
|
12
|
-
private readonly executableResolver;
|
|
13
|
-
private readonly run;
|
|
14
|
-
constructor(options?: AgentSkillManagerOptions);
|
|
15
|
-
getStatus(): Promise<AgentSkillCliStatus>;
|
|
16
|
-
install(data: AgentSkillInstallOptions): Promise<AgentSkillMutationResult>;
|
|
17
|
-
checkUpdates(data: AgentSkillCheckUpdatesOptions): Promise<AgentSkillCheckUpdatesResult>;
|
|
18
|
-
update(data: AgentSkillMutationOptions): Promise<AgentSkillMutationResult>;
|
|
19
|
-
uninstall(data: AgentSkillMutationOptions): Promise<AgentSkillMutationResult>;
|
|
20
|
-
private mutationContext;
|
|
21
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export type DirectoryPickerRunner = (command: string, args: string[]) => Promise<string | null>;
|
|
2
|
-
export declare const runDirectoryPickerCommand: DirectoryPickerRunner;
|
|
3
|
-
export declare function pickWorkspaceDirectory(platform?: NodeJS.Platform, run?: DirectoryPickerRunner): Promise<string | null>;
|
|
4
|
-
export declare function resolveWorkspaceDirectory(directory: unknown): string;
|