@aipanel/provider-opencode 1.2.0-beta.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.
@@ -0,0 +1,289 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
30
+ var provider_exports = {};
31
+ __export(provider_exports, {
32
+ DefaultWebProvider: () => DefaultWebProvider
33
+ });
34
+ module.exports = __toCommonJS(provider_exports);
35
+ var import_http = __toESM(require("http"));
36
+ var import_core = require("@aipanel/core");
37
+ var import_node = require("@aipanel/core/node");
38
+ var import_constants = require("./constants.cjs");
39
+ var import_api = require("./api.cjs");
40
+ var import_bridge_script = require("./bridge-script.cjs");
41
+ var import_opencode_web = require("./opencode-web.cjs");
42
+ var import_system = require("./system.cjs");
43
+ const log = (0, import_node.createLogger)("DefaultWebProvider");
44
+ class DefaultWebProvider {
45
+ constructor(config, deps, options) {
46
+ __publicField(this, "config", config);
47
+ __publicField(this, "id", "opencode");
48
+ __publicField(this, "displayName", "OpenCode Web");
49
+ /** 支持会话 URL 深链;支持代码审查面板(右上角 </> 按钮,由 bridge 渲染) */
50
+ __publicField(this, "capabilities", { deepLink: true, reviewPanel: true });
51
+ /** REST 会话 API(Provider 内部使用) */
52
+ __publicField(this, "api");
53
+ __publicField(this, "deps");
54
+ __publicField(this, "process", null);
55
+ __publicField(this, "bridgeOptions", {});
56
+ __publicField(this, "opts");
57
+ this.deps = deps;
58
+ this.opts = resolveOpenCodeOptions(options);
59
+ this.api = new import_api.OpenCodeAPI(
60
+ config.hostname,
61
+ deps.getWebPort,
62
+ deps.getProxyPort,
63
+ config.chromeDevtoolsPort
64
+ );
65
+ }
66
+ /** 代理注入到 HTML 的桥接脚本(Provider 资产) */
67
+ get bridgeScript() {
68
+ return (0, import_bridge_script.generateBridgeScript)(this.bridgeOptions);
69
+ }
70
+ /** 初始化桥接配置(主题/语言/设置) */
71
+ applyConfig(config) {
72
+ this.bridgeOptions = {
73
+ theme: config.theme,
74
+ language: this.opts.language,
75
+ settings: this.opts.settings
76
+ };
77
+ }
78
+ async checkEnvironment() {
79
+ if (!await (0, import_system.checkOpenCodeInstalled)()) {
80
+ return {
81
+ ok: false,
82
+ message: `OpenCode is not installed!
83
+
84
+ Please install OpenCode first:
85
+
86
+ # YOLO
87
+ curl -fsSL https://opencode.ai/install | bash
88
+
89
+ # Package managers
90
+ npm i -g opencode-ai@latest # or bun/pnpm/yarn
91
+ scoop install opencode # Windows
92
+ choco install opencode # Windows
93
+ brew install anomalyco/tap/opencode # macOS and Linux (recommended, always up to date)
94
+ brew install opencode # macOS and Linux (official brew formula, updated less)
95
+ sudo pacman -S opencode # Arch Linux (Stable)
96
+ paru -S opencode-bin # Arch Linux (Latest from AUR)
97
+ mise use -g opencode # Any OS
98
+ nix run nixpkgs#opencode # or github:anomalyco/opencode for latest dev branch
99
+ `
100
+ };
101
+ }
102
+ const version = await (0, import_system.getOpenCodeVersion)();
103
+ return { ok: true, version: version ?? void 0 };
104
+ }
105
+ async start(options) {
106
+ log.debug("Preparing OpenCode runtime", { cwd: options.cwd, vitePort: options.vitePort });
107
+ const configDir = (0, import_opencode_web.prepareOpenCodeRuntime)(
108
+ options.cwd,
109
+ options.vitePort,
110
+ this.opts.enableLsp,
111
+ this.opts.enablePrettier
112
+ );
113
+ log.debug("Starting OpenCode Web process", {
114
+ port: options.port,
115
+ hostname: options.hostname,
116
+ configDir
117
+ });
118
+ const proc = (0, import_opencode_web.startOpenCodeWeb)({
119
+ port: options.port,
120
+ hostname: options.hostname,
121
+ serverUrl: "",
122
+ cwd: options.cwd,
123
+ configDir,
124
+ corsOrigins: options.corsOrigins,
125
+ contextApiUrl: options.contextApiUrl,
126
+ logsApiUrl: options.logsApiUrl,
127
+ logFilesJson: this.opts.logFiles ? JSON.stringify(this.opts.logFiles) : void 0,
128
+ enableBlockOnError: this.opts.enableBlockOnError,
129
+ verbose: options.verbose,
130
+ enableLsp: this.opts.enableLsp,
131
+ enablePrettier: this.opts.enablePrettier,
132
+ vueDevtoolsApiUrl: options.vueDevtoolsApiUrl
133
+ });
134
+ this.process = proc;
135
+ return { url: `http://${options.hostname}:${options.port}`, processHandle: proc };
136
+ }
137
+ async stop() {
138
+ if (this.process) {
139
+ log.debug("Killing web process", { pid: this.process.pid });
140
+ this.process.kill("SIGTERM");
141
+ this.process = null;
142
+ }
143
+ }
144
+ async killOrphans() {
145
+ return (0, import_system.killOrphanOpenCodeProcesses)();
146
+ }
147
+ async listSessions(projectDir) {
148
+ const sessions = await this.api.getSessions(projectDir);
149
+ return sessions.filter((s) => {
150
+ if (s.title === "__chrome_mcp_warmup__") return false;
151
+ if (s.parentID) return false;
152
+ if (s.time?.archived) return false;
153
+ return true;
154
+ }).map((s) => toChatSession(s));
155
+ }
156
+ async createSession(projectDir, title) {
157
+ const session = await this.api.createSession(projectDir, void 0, title);
158
+ return toChatSession(session);
159
+ }
160
+ async deleteSession(sessionId) {
161
+ await this.api.deleteSession(sessionId);
162
+ }
163
+ buildSessionUrl(projectDir, sessionId) {
164
+ return this.api.buildSessionProxyUrl(projectDir, sessionId);
165
+ }
166
+ subscribeEvents(handler) {
167
+ const port = this.deps.getWebPort();
168
+ const url = `http://${this.config.hostname}:${port}/global/event`;
169
+ log.debug("Subscribing to provider event stream", { url });
170
+ let aborted = false;
171
+ let currentReq = null;
172
+ let retryTimer = null;
173
+ const cleanup = () => {
174
+ if (retryTimer) {
175
+ clearTimeout(retryTimer);
176
+ retryTimer = null;
177
+ }
178
+ currentReq?.destroy();
179
+ currentReq = null;
180
+ };
181
+ const scheduleReconnect = () => {
182
+ if (aborted) return;
183
+ cleanup();
184
+ retryTimer = setTimeout(connect, import_core.RETRY_DELAY);
185
+ };
186
+ const connect = () => {
187
+ if (aborted) return;
188
+ const req = import_http.default.get(url, (res) => {
189
+ res.setEncoding("utf-8");
190
+ let buffer = "";
191
+ res.on("data", (chunk) => {
192
+ buffer += chunk;
193
+ const lines = buffer.split("\n");
194
+ buffer = lines.pop() ?? "";
195
+ for (const line of lines) {
196
+ const trimmed = line.trim();
197
+ if (!trimmed.startsWith("data:")) continue;
198
+ const data = trimmed.slice(5).trim();
199
+ if (!data) continue;
200
+ try {
201
+ const message = JSON.parse(data);
202
+ const event = mapEvent(message.payload);
203
+ if (event) handler(event);
204
+ } catch {
205
+ }
206
+ }
207
+ });
208
+ res.on("end", scheduleReconnect);
209
+ res.on("error", scheduleReconnect);
210
+ });
211
+ req.on("error", scheduleReconnect);
212
+ currentReq = req;
213
+ };
214
+ connect();
215
+ return () => {
216
+ aborted = true;
217
+ cleanup();
218
+ };
219
+ }
220
+ }
221
+ function mapEvent(payload) {
222
+ if (!payload || typeof payload !== "object") return null;
223
+ const msg = payload;
224
+ const props = msg.properties;
225
+ if (!props) return null;
226
+ switch (msg.type) {
227
+ case "session.updated": {
228
+ const info = props.info;
229
+ if (!info?.id) return null;
230
+ return {
231
+ type: "session.updated",
232
+ session: {
233
+ id: info.id,
234
+ title: info.title ?? "",
235
+ createdAt: info.time?.created,
236
+ updatedAt: info.time?.updated,
237
+ archived: info.time?.archived !== void 0
238
+ }
239
+ };
240
+ }
241
+ case "session.status": {
242
+ const sessionId = props.sessionID;
243
+ if (!sessionId) return null;
244
+ const status = props.status?.type ?? "idle";
245
+ return { type: "session.status", sessionId, status };
246
+ }
247
+ case "message.updated": {
248
+ const info = props.info;
249
+ if (info?.role !== "assistant" || !info.sessionID) return null;
250
+ const thinking = typeof info.time?.completed !== "number";
251
+ return { type: "thinking", sessionId: info.sessionID, thinking };
252
+ }
253
+ case "message.part.delta": {
254
+ const sessionId = props.sessionID;
255
+ if (!sessionId) return null;
256
+ return { type: "thinking", sessionId, thinking: true };
257
+ }
258
+ default:
259
+ return null;
260
+ }
261
+ }
262
+ function toChatSession(s) {
263
+ return {
264
+ id: s.id,
265
+ title: s.title,
266
+ createdAt: s.time?.created,
267
+ updatedAt: s.time?.updated,
268
+ archived: s.time?.archived !== void 0,
269
+ parentId: s.parentID,
270
+ url: s.url
271
+ };
272
+ }
273
+ function resolveOpenCodeOptions(options) {
274
+ if (!options) return { ...import_constants.DEFAULT_OPENCODE_PROVIDER_OPTIONS };
275
+ const po = options.providerOptions ?? {};
276
+ return {
277
+ ...import_constants.DEFAULT_OPENCODE_PROVIDER_OPTIONS,
278
+ language: po.language ?? options.language,
279
+ settings: po.settings ?? options.settings,
280
+ logFiles: options.logFiles,
281
+ enableLsp: po.enableLsp ?? options.enableLsp,
282
+ enableBlockOnError: po.enableBlockOnError ?? options.enableBlockOnError,
283
+ enablePrettier: po.enablePrettier ?? options.enablePrettier
284
+ };
285
+ }
286
+ // Annotate the CommonJS export names for ESM import in node:
287
+ 0 && (module.exports = {
288
+ DefaultWebProvider
289
+ });
@@ -0,0 +1,49 @@
1
+ import type { ChatSession, ProviderConfig, ProviderEnvironmentInfo, ProviderEvent, ProviderStartOptions, ProviderStartResult, WebProvider } from "@aipanel/core";
2
+ /** DefaultWebProvider 构造配置(核心层传入的运行时参数) */
3
+ export interface DefaultWebProviderConfig {
4
+ /** 服务主机名 */
5
+ hostname: string;
6
+ /** Chrome DevTools Protocol 端口 */
7
+ chromeDevtoolsPort: number;
8
+ }
9
+ /** DefaultWebProvider 构造依赖(端口等运行时状态由编排层提供) */
10
+ export interface DefaultWebProviderDeps {
11
+ /** 实际 Web 端口读取器 */
12
+ getWebPort: () => number;
13
+ /** 实际代理端口读取器 */
14
+ getProxyPort: () => number;
15
+ }
16
+ /**
17
+ * 默认 Web Provider
18
+ * 组合 CLI 进程管理、REST API、桥接脚本,向核心层暴露 WebProvider 契约。
19
+ */
20
+ export declare class DefaultWebProvider implements WebProvider {
21
+ private config;
22
+ readonly id = "opencode";
23
+ readonly displayName = "OpenCode Web";
24
+ /** 支持会话 URL 深链;支持代码审查面板(右上角 </> 按钮,由 bridge 渲染) */
25
+ readonly capabilities: {
26
+ readonly deepLink: true;
27
+ readonly reviewPanel: true;
28
+ };
29
+ /** REST 会话 API(Provider 内部使用) */
30
+ private readonly api;
31
+ private deps;
32
+ private process;
33
+ private bridgeOptions;
34
+ private readonly opts;
35
+ constructor(config: DefaultWebProviderConfig, deps: DefaultWebProviderDeps, options?: Record<string, unknown>);
36
+ /** 代理注入到 HTML 的桥接脚本(Provider 资产) */
37
+ get bridgeScript(): string | undefined;
38
+ /** 初始化桥接配置(主题/语言/设置) */
39
+ applyConfig(config: ProviderConfig): void;
40
+ checkEnvironment(): Promise<ProviderEnvironmentInfo>;
41
+ start(options: ProviderStartOptions): Promise<ProviderStartResult>;
42
+ stop(): Promise<void>;
43
+ killOrphans(): Promise<number>;
44
+ listSessions(projectDir: string): Promise<ChatSession[]>;
45
+ createSession(projectDir: string, title?: string): Promise<ChatSession>;
46
+ deleteSession(sessionId: string): Promise<void>;
47
+ buildSessionUrl(projectDir: string, sessionId: string): string;
48
+ subscribeEvents(handler: (e: ProviderEvent) => void): () => void;
49
+ }
package/lib/system.cjs ADDED
@@ -0,0 +1,200 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var system_exports = {};
19
+ __export(system_exports, {
20
+ checkOpenCodeInstalled: () => checkOpenCodeInstalled,
21
+ getOpenCodeVersion: () => getOpenCodeVersion,
22
+ killOrphanOpenCodeProcesses: () => killOrphanOpenCodeProcesses
23
+ });
24
+ module.exports = __toCommonJS(system_exports);
25
+ var import_child_process = require("child_process");
26
+ var import_node = require("@aipanel/core/node");
27
+ const log = (0, import_node.createLogger)("OpenCodeSystem");
28
+ async function checkOpenCodeInstalled() {
29
+ const timer = log.timer("checkOpenCodeInstalled");
30
+ return new Promise((resolve) => {
31
+ log.debug("Checking if OpenCode is installed...");
32
+ const proc = (0, import_child_process.spawn)("opencode", ["--version"], { stdio: "ignore", shell: true });
33
+ proc.on("close", (code) => {
34
+ const installed = code === 0;
35
+ timer.end(installed ? "\u2713 OpenCode is installed" : "\u274C OpenCode not found");
36
+ resolve(installed);
37
+ });
38
+ proc.on("error", (err) => {
39
+ log.debug("Failed to check OpenCode installation", { error: err.message });
40
+ timer.end("\u274C Check failed");
41
+ resolve(false);
42
+ });
43
+ });
44
+ }
45
+ function getOpenCodeVersion() {
46
+ return new Promise((resolve) => {
47
+ const proc = (0, import_child_process.spawn)("opencode", ["--version"], { stdio: "pipe", shell: true });
48
+ let output = "";
49
+ proc.stdout?.on("data", (data) => {
50
+ output += data.toString();
51
+ });
52
+ proc.on("close", (code) => {
53
+ if (code === 0 && output.trim()) {
54
+ resolve(output.trim());
55
+ } else {
56
+ resolve(null);
57
+ }
58
+ });
59
+ proc.on("error", () => {
60
+ resolve(null);
61
+ });
62
+ });
63
+ }
64
+ const KILL_ORPHAN_TIMEOUT = 5e3;
65
+ async function killOrphanOpenCodeProcesses() {
66
+ const timer = log.timer("killOrphanOpenCodeProcesses");
67
+ log.debug("Looking for orphan OpenCode processes (PPID=1)");
68
+ return new Promise((resolve) => {
69
+ let settled = false;
70
+ const done = (count) => {
71
+ if (settled) return;
72
+ settled = true;
73
+ resolve(count);
74
+ };
75
+ const timeout = setTimeout(() => {
76
+ log.warn("Kill orphan processes timed out, skipping");
77
+ timer.end("\u26A0 Timeout, skipped");
78
+ done(0);
79
+ }, KILL_ORPHAN_TIMEOUT);
80
+ const wrappedResolve = (count) => {
81
+ clearTimeout(timeout);
82
+ done(count);
83
+ };
84
+ if (process.platform === "win32") {
85
+ killOrphanProcessesOnWindows(wrappedResolve, timer);
86
+ } else {
87
+ killOrphanProcessesOnUnix(wrappedResolve, timer);
88
+ }
89
+ });
90
+ }
91
+ function killOrphanProcessesOnWindows(resolve, timer) {
92
+ log.debug("Using Windows method to find orphan processes");
93
+ const proc = (0, import_child_process.spawn)(
94
+ "wmic",
95
+ ["process", "where", 'name="opencode.exe"', "get", "processid,parentprocessid"],
96
+ { stdio: "pipe" }
97
+ );
98
+ let output = "";
99
+ proc.stdout?.on("data", (data) => {
100
+ output += data.toString();
101
+ });
102
+ proc.on("close", () => {
103
+ const lines = output.split("\n").filter((line) => line.trim());
104
+ const pidsToKill = [];
105
+ lines.forEach((line) => {
106
+ const parts = line.trim().split(/\s+/);
107
+ if (parts.length >= 2) {
108
+ const ppid = parts[0];
109
+ const pid = parts[1];
110
+ if (ppid === "1" && pid && !isNaN(Number(pid))) {
111
+ pidsToKill.push(pid);
112
+ }
113
+ }
114
+ });
115
+ if (pidsToKill.length > 0) {
116
+ log.debug(`Found ${pidsToKill.length} orphan processes`, { pids: pidsToKill });
117
+ let killedCount = 0;
118
+ let completedCount = 0;
119
+ pidsToKill.forEach((pid) => {
120
+ const killProc = (0, import_child_process.spawn)("taskkill", ["/F", "/PID", pid], { stdio: "ignore" });
121
+ killProc.on("close", (code) => {
122
+ completedCount++;
123
+ if (code === 0) {
124
+ killedCount++;
125
+ log.debug(`Killed orphan process ${pid}`);
126
+ }
127
+ if (completedCount === pidsToKill.length) {
128
+ timer.end(`\u2713 Killed ${killedCount} orphan processes`);
129
+ resolve(killedCount);
130
+ }
131
+ });
132
+ });
133
+ } else {
134
+ log.debug("No orphan processes found");
135
+ timer.end("No orphan processes found");
136
+ resolve(0);
137
+ }
138
+ });
139
+ proc.on("error", (err) => {
140
+ log.debug("Failed to find orphan processes", { error: err.message });
141
+ timer.end("\u274C Failed to find orphan processes");
142
+ resolve(0);
143
+ });
144
+ }
145
+ function killOrphanProcessesOnUnix(resolve, timer) {
146
+ log.debug("Using Unix method to find orphan processes");
147
+ const proc = (0, import_child_process.spawn)("ps", ["-e", "-o", "pid,ppid,comm"], { stdio: "pipe" });
148
+ let output = "";
149
+ proc.stdout?.on("data", (data) => {
150
+ output += data.toString();
151
+ });
152
+ proc.on("close", () => {
153
+ const lines = output.split("\n");
154
+ const pidsToKill = [];
155
+ lines.forEach((line) => {
156
+ const trimmed = line.trim();
157
+ if (trimmed.includes("opencode")) {
158
+ const parts = trimmed.split(/\s+/);
159
+ if (parts.length >= 3) {
160
+ const pid = parts[0];
161
+ const ppid = parts[1];
162
+ const comm = parts.slice(2).join(" ");
163
+ if (ppid === "1" && comm.includes("opencode")) {
164
+ pidsToKill.push(pid);
165
+ }
166
+ }
167
+ }
168
+ });
169
+ if (pidsToKill.length > 0) {
170
+ log.debug(`Found ${pidsToKill.length} orphan processes`, { pids: pidsToKill });
171
+ const killProc = (0, import_child_process.spawn)("kill", ["-9", ...pidsToKill], { stdio: "ignore" });
172
+ killProc.on("close", (code) => {
173
+ const killedCount = code === 0 ? pidsToKill.length : 0;
174
+ timer.end(
175
+ killedCount > 0 ? `\u2713 Killed ${killedCount} orphan processes` : "\u274C Failed to kill processes"
176
+ );
177
+ resolve(killedCount);
178
+ });
179
+ killProc.on("error", () => {
180
+ timer.end("\u274C Failed to kill processes");
181
+ resolve(0);
182
+ });
183
+ } else {
184
+ log.debug("No orphan processes found");
185
+ timer.end("No orphan processes found");
186
+ resolve(0);
187
+ }
188
+ });
189
+ proc.on("error", (err) => {
190
+ log.debug("Failed to find orphan processes", { error: err.message });
191
+ timer.end("\u274C Failed to find orphan processes");
192
+ resolve(0);
193
+ });
194
+ }
195
+ // Annotate the CommonJS export names for ESM import in node:
196
+ 0 && (module.exports = {
197
+ checkOpenCodeInstalled,
198
+ getOpenCodeVersion,
199
+ killOrphanOpenCodeProcesses
200
+ });
@@ -0,0 +1,3 @@
1
+ export declare function checkOpenCodeInstalled(): Promise<boolean>;
2
+ export declare function getOpenCodeVersion(): Promise<string | null>;
3
+ export declare function killOrphanOpenCodeProcesses(): Promise<number>;
package/lib/types.cjs ADDED
@@ -0,0 +1,15 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var types_exports = {};
15
+ module.exports = __toCommonJS(types_exports);