@bike4mind/cli 3.4.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +223 -39
  2. package/bin/bike4mind-cli.mjs +301 -38
  3. package/bin/envFlags.d.mts +17 -0
  4. package/bin/envFlags.mjs +89 -0
  5. package/bin/hearth-hook.mjs +53 -7
  6. package/dist/{AgentHistoryStore-ClO2zOn6.mjs → AgentHistoryStore--J3sgO_-.mjs} +9011 -6699
  7. package/dist/ApiClient-CdO4Gamg.mjs +152 -0
  8. package/dist/BubblewrapRuntime-3jAbC60G.mjs +157 -0
  9. package/dist/ConfigStore-CausUCzY.mjs +2 -0
  10. package/dist/ConfigStore-Dusy6glb.mjs +3364 -0
  11. package/dist/{ConfigStore-CbVFLXMH.mjs → Logger-C1Wj6xla.mjs} +32880 -20779
  12. package/dist/{ProxyManager-B0-RuR2w.mjs → ProxyManager-TxEKlgdO.mjs} +88 -3
  13. package/dist/RemoteSkillSource-qTvRkaNA.mjs +455 -0
  14. package/dist/{SandboxOrchestrator-BcUv9fQ3.mjs → SandboxOrchestrator-CQwYq_uy.mjs} +26 -7
  15. package/dist/SandboxRuntimeAdapter-BsT2iLky.mjs +190 -0
  16. package/dist/SandboxRuntimeAdapter-Zg_0th7V.mjs +2 -0
  17. package/dist/SeatbeltRuntime-C2DEkrjy.mjs +194 -0
  18. package/dist/{WorkItemsClient-SeNbzvEw.mjs → WorkItemsClient-CxNZaOmc.mjs} +1 -1
  19. package/dist/agents/defaults/review.md +8 -1
  20. package/dist/agents/defaults/test.md +8 -1
  21. package/dist/buildToolSearch-DOb7mx6F.mjs +417 -0
  22. package/dist/commands/acpCommand.mjs +33 -27
  23. package/dist/commands/apiCommand.mjs +3 -5
  24. package/dist/commands/doctorCommand.mjs +2 -2
  25. package/dist/commands/envCommand.mjs +1 -1
  26. package/dist/commands/headlessCommand.mjs +118 -36
  27. package/dist/commands/hostCommand.mjs +2344 -0
  28. package/dist/commands/mcpCommand.mjs +46 -30
  29. package/dist/commands/mirrorCommand.mjs +279 -0
  30. package/dist/commands/modelsCommand.mjs +1117 -0
  31. package/dist/commands/pluginCommand.mjs +9 -9
  32. package/dist/commands/skillsCommand.mjs +404 -0
  33. package/dist/commands/updateCommand.mjs +2 -2
  34. package/dist/curated-build.json +1 -0
  35. package/dist/dist-CbViwiS9.mjs +4739 -0
  36. package/dist/dist-Citbv0y0.mjs +7864 -0
  37. package/dist/fit-CVWDiavv.mjs +200 -0
  38. package/dist/index.mjs +1001 -442
  39. package/dist/modelHub-BSB6qRFP.mjs +1963 -0
  40. package/dist/modelServers-BaegigV-.mjs +2465 -0
  41. package/dist/{package-MoDZ9cGj.mjs → package-C9pfAdGF.mjs} +1 -1
  42. package/dist/{serve-zi-B2iUT.mjs → serve-8wyGb8of.mjs} +1243 -44
  43. package/dist/store-BYeE0shc.mjs +2 -0
  44. package/dist/{store-BxmPEI3v.mjs → store-BbvSi3KK.mjs} +26 -2
  45. package/dist/types-BFIvwByC.mjs +2 -0
  46. package/dist/{types-F61_hxmG.mjs → types-CxrzVXel.mjs} +9 -5
  47. package/dist/{updateChecker-CCLVVdH0.mjs → updateChecker-BAKb8KWP.mjs} +7 -29
  48. package/package.json +17 -13
  49. package/dist/BubblewrapRuntime-5bLPTwEC.mjs +0 -72
  50. package/dist/SandboxRuntimeAdapter-BgLUVTJL.mjs +0 -57
  51. package/dist/SandboxRuntimeAdapter-Bt1wPpld.mjs +0 -2
  52. package/dist/SeatbeltRuntime-C_Y8q8Mr.mjs +0 -124
  53. package/dist/buildAgent-BeaVbpzH.mjs +0 -1992
  54. package/dist/dist-DlBq3wHu.mjs +0 -739
  55. package/dist/store-BkMur6uk.mjs +0 -2
  56. package/dist/types-I45lMh7Q.mjs +0 -2
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { t as ConfigStore } from "../ConfigStore-CbVFLXMH.mjs";
3
- import { t as version } from "../package-MoDZ9cGj.mjs";
2
+ import { n as McpToggleRefusedError, t as ConfigStore } from "../ConfigStore-Dusy6glb.mjs";
3
+ import { t as version } from "../package-C9pfAdGF.mjs";
4
4
  //#region src/commands/mcpCommand.ts
5
5
  /**
6
6
  * External MCP commands (b4m mcp list, b4m mcp add, etc.)
@@ -60,22 +60,24 @@ async function handleMcpCommand(subcommand, argv) {
60
60
  console.error("❌ Usage: b4m mcp enable <name>");
61
61
  process.exit(1);
62
62
  }
63
- await handleEnable(config, argv.name, configStore);
63
+ await handleEnable(argv.name, configStore);
64
64
  break;
65
65
  case "disable":
66
66
  if (!argv.name) {
67
67
  console.error("❌ Usage: b4m mcp disable <name>");
68
68
  process.exit(1);
69
69
  }
70
- await handleDisable(config, argv.name, configStore);
70
+ await handleDisable(argv.name, configStore);
71
71
  break;
72
72
  case "serve": {
73
- const { handleMcpServeCommand } = await import("../serve-zi-B2iUT.mjs");
73
+ const { handleMcpServeCommand } = await import("../serve-8wyGb8of.mjs");
74
74
  await handleMcpServeCommand({
75
75
  http: Boolean(argv.http),
76
+ local: Boolean(argv.local),
76
77
  port: typeof argv.port === "number" ? argv.port : void 0,
77
78
  apiKey: typeof argv.apiKey === "string" ? argv.apiKey : void 0,
78
79
  apiUrl: typeof argv.apiUrl === "string" ? argv.apiUrl : void 0,
80
+ token: typeof argv.token === "string" ? argv.token : void 0,
79
81
  version
80
82
  });
81
83
  break;
@@ -89,7 +91,7 @@ async function handleMcpCommand(subcommand, argv) {
89
91
  console.error(" b4m mcp remove <name> - Remove an MCP server");
90
92
  console.error(" b4m mcp enable <name> - Enable an MCP server");
91
93
  console.error(" b4m mcp disable <name> - Disable an MCP server");
92
- console.error(" b4m mcp serve [--http] [--port] - Run Bike4Mind as an MCP server");
94
+ console.error(" b4m mcp serve [--http|--local] - Run Bike4Mind as an MCP server");
93
95
  process.exit(1);
94
96
  }
95
97
  }
@@ -176,25 +178,37 @@ async function handleRemove(config, name, configStore) {
176
178
  process.exit(1);
177
179
  }
178
180
  }
181
+ const OVERRIDE_NOTES = {
182
+ "strict-mcp-config": "Saved in your config, but --strict-mcp-config ignores your config and connects only the servers in --mcp-config while it is passed.",
183
+ "mcp-config": "Saved in your config, but --mcp-config also defines this server and its definition still applies while that file is passed."
184
+ };
185
+ /** A refusal from the server's source, where nothing was written, is printed as it is and exits. */
186
+ function exitOnToggleRefusal(error) {
187
+ if (!(error instanceof McpToggleRefusedError)) return;
188
+ console.error(`\u274C ${error.message}`);
189
+ process.exit(1);
190
+ }
179
191
  /**
180
192
  * Enable an MCP server
181
193
  */
182
- async function handleEnable(config, name, configStore) {
183
- const server = config.mcpServers.find((s) => s.name === name);
184
- if (!server) {
185
- console.error(`❌ MCP server "${name}" not found.`);
186
- process.exit(1);
187
- }
188
- if (server.enabled) {
189
- console.log(`ℹ️ MCP server "${name}" is already enabled.`);
190
- return;
191
- }
194
+ async function handleEnable(name, configStore) {
192
195
  try {
193
- await configStore.toggleMcpServer(name, true);
196
+ const server = await configStore.findMcpServer(name);
197
+ if (!server) {
198
+ console.error(`❌ MCP server "${name}" not found.`);
199
+ process.exit(1);
200
+ }
201
+ if (server.enabled === true) {
202
+ console.log(`ℹ️ MCP server "${name}" is already enabled.`);
203
+ if (server.overriddenBy) console.log(OVERRIDE_NOTES[server.overriddenBy]);
204
+ return;
205
+ }
206
+ const { overriddenBy } = await configStore.toggleMcpServer(name, true);
194
207
  console.log(`✅ Enabled MCP server "${name}"`);
195
208
  console.log("");
196
- console.log("The server will connect next time you start the CLI.");
209
+ console.log(overriddenBy ? OVERRIDE_NOTES[overriddenBy] : "The server will connect next time you start the CLI.");
197
210
  } catch (error) {
211
+ exitOnToggleRefusal(error);
198
212
  console.error(`❌ Failed to save configuration:`, error instanceof Error ? error.message : String(error));
199
213
  process.exit(1);
200
214
  }
@@ -202,22 +216,24 @@ async function handleEnable(config, name, configStore) {
202
216
  /**
203
217
  * Disable an MCP server
204
218
  */
205
- async function handleDisable(config, name, configStore) {
206
- const server = config.mcpServers.find((s) => s.name === name);
207
- if (!server) {
208
- console.error(`❌ MCP server "${name}" not found.`);
209
- process.exit(1);
210
- }
211
- if (!server.enabled) {
212
- console.log(`ℹ️ MCP server "${name}" is already disabled.`);
213
- return;
214
- }
219
+ async function handleDisable(name, configStore) {
215
220
  try {
216
- await configStore.toggleMcpServer(name, false);
221
+ const server = await configStore.findMcpServer(name);
222
+ if (!server) {
223
+ console.error(`❌ MCP server "${name}" not found.`);
224
+ process.exit(1);
225
+ }
226
+ if (server.enabled === false) {
227
+ console.log(`ℹ️ MCP server "${name}" is already disabled.`);
228
+ if (server.overriddenBy) console.log(OVERRIDE_NOTES[server.overriddenBy]);
229
+ return;
230
+ }
231
+ const { overriddenBy } = await configStore.toggleMcpServer(name, false);
217
232
  console.log(`✅ Disabled MCP server "${name}"`);
218
233
  console.log("");
219
- console.log("The server will not connect next time you start the CLI.");
234
+ console.log(overriddenBy ? OVERRIDE_NOTES[overriddenBy] : "The server will not connect next time you start the CLI.");
220
235
  } catch (error) {
236
+ exitOnToggleRefusal(error);
221
237
  console.error(`❌ Failed to save configuration:`, error instanceof Error ? error.message : String(error));
222
238
  process.exit(1);
223
239
  }
@@ -0,0 +1,279 @@
1
+ #!/usr/bin/env node
2
+ import { t as ConfigStore, v as requireApiUrl } from "../ConfigStore-Dusy6glb.mjs";
3
+ import { t as ApiClient } from "../ApiClient-CdO4Gamg.mjs";
4
+ import path from "node:path";
5
+ import { z as z$1 } from "zod";
6
+ import { createHash } from "node:crypto";
7
+ import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
8
+ //#region ../../b4m-core/services/dist/mirror-B8_a9Ej-.mjs
9
+ const BUNDLE_EXPORT_VERSION = "2.0.0";
10
+ const digest = (bytes) => createHash("sha256").update(bytes).digest("hex");
11
+ const validPath = (value) => value.length > 0 && !value.startsWith("/") && !value.includes("\\") && value.split("/").every((segment) => segment !== "" && segment !== "." && segment !== "..");
12
+ const isoDateTimeSchema = z$1.iso.datetime({ offset: true });
13
+ const isDateTime = (value) => typeof value === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/i.test(value) && Number.isFinite(Date.parse(value)) && isoDateTimeSchema.safeParse(value.toUpperCase()).success;
14
+ const bundleMetadataSchema = z$1.object({
15
+ exportedAt: z$1.string().refine(isDateTime, "Invalid bundle timestamp"),
16
+ platform: z$1.string().min(1),
17
+ exportedBy: z$1.string().optional()
18
+ });
19
+ const rowsOf = async function* (source) {
20
+ for await (const row of source) yield row;
21
+ };
22
+ async function createExportBundle(input, write, append) {
23
+ const metadata = bundleMetadataSchema.parse({
24
+ exportedAt: input.exportedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
25
+ platform: input.platform ?? "bike4mind",
26
+ ...input.exportedBy ? { exportedBy: input.exportedBy } : {}
27
+ });
28
+ const manifest = {
29
+ exportVersion: BUNDLE_EXPORT_VERSION,
30
+ ...metadata,
31
+ collections: {},
32
+ files: []
33
+ };
34
+ const seen = /* @__PURE__ */ new Set();
35
+ for (const [name, source] of Object.entries(input.collections)) {
36
+ if (!/^[a-z][a-z0-9-]*$/.test(name)) throw new Error(`Invalid collection name: ${name}`);
37
+ const path = `collections/${name}.jsonl`;
38
+ const lines = [];
39
+ const hash = createHash("sha256");
40
+ let count = 0;
41
+ let byteCount = 0;
42
+ if (append) await write(path, Buffer.alloc(0));
43
+ for await (const row of rowsOf(source)) {
44
+ const encoded = JSON.stringify(row);
45
+ if (encoded === void 0) throw new Error(`Invalid record in ${name}`);
46
+ if (append) {
47
+ const bytes = Buffer.from(`${encoded}\n`, "utf8");
48
+ await append(path, bytes);
49
+ hash.update(bytes);
50
+ byteCount += bytes.length;
51
+ } else lines.push(encoded);
52
+ count++;
53
+ }
54
+ if (!append) {
55
+ const bytes = Buffer.from(lines.map((line) => `${line}\n`).join(""), "utf8");
56
+ await write(path, bytes);
57
+ hash.update(bytes);
58
+ byteCount = bytes.length;
59
+ }
60
+ manifest.collections[name] = {
61
+ path,
62
+ count,
63
+ bytes: byteCount,
64
+ sha256: hash.digest("hex")
65
+ };
66
+ seen.add(path);
67
+ }
68
+ if (input.files) for await (const file of input.files) {
69
+ if (!validPath(file.path) || !file.path.startsWith("files/")) throw new Error(`Invalid file path: ${file.path}`);
70
+ if (seen.has(file.path)) throw new Error(`Duplicate bundle path: ${file.path}`);
71
+ seen.add(file.path);
72
+ const bytes = Buffer.from(file.content);
73
+ await write(file.path, bytes);
74
+ manifest.files.push({
75
+ path: file.path,
76
+ bytes: bytes.length,
77
+ sha256: digest(bytes)
78
+ });
79
+ }
80
+ await write("manifest.json", Buffer.from(JSON.stringify(manifest, null, 2) + "\n", "utf8"));
81
+ return manifest;
82
+ }
83
+ const childCollections = [
84
+ "chat-messages",
85
+ "knowledge",
86
+ "artifacts",
87
+ "tools",
88
+ "agents"
89
+ ];
90
+ /** Buffers every row and file until the end, so memory grows with the export; use createExportBundle with `append` to stream. */
91
+ async function createNotebookBundle(notebooks, write, metadata = {}) {
92
+ const collections = {
93
+ notebooks: [],
94
+ "chat-messages": [],
95
+ knowledge: [],
96
+ artifacts: [],
97
+ tools: [],
98
+ agents: []
99
+ };
100
+ const files = [];
101
+ const filePaths = /* @__PURE__ */ new Set();
102
+ const notebookIds = /* @__PURE__ */ new Set();
103
+ for await (const notebook of rowsOf(notebooks)) {
104
+ if (notebookIds.has(notebook.id)) throw new Error(`Duplicate notebook: ${notebook.id}`);
105
+ notebookIds.add(notebook.id);
106
+ const { chatHistory, knowledge, artifacts, tools, agents, ...record } = notebook;
107
+ collections.notebooks.push(record);
108
+ const children = [
109
+ chatHistory,
110
+ knowledge,
111
+ artifacts,
112
+ tools,
113
+ agents
114
+ ];
115
+ childCollections.forEach((name, index) => {
116
+ for (const child of children[index]) {
117
+ const row = {
118
+ ...child,
119
+ notebookId: notebook.id
120
+ };
121
+ if (name === "knowledge" && typeof row.content === "string") {
122
+ const bytes = Buffer.from(row.content, "base64");
123
+ const path = `files/${digest(bytes)}`;
124
+ if (!filePaths.has(path)) {
125
+ files.push({
126
+ path,
127
+ content: bytes
128
+ });
129
+ filePaths.add(path);
130
+ }
131
+ delete row.content;
132
+ row.contentPath = path;
133
+ }
134
+ if (name === "chat-messages" && Array.isArray(row.images) && !metadata.imagesAsKeys) row.images = row.images.map((image) => {
135
+ if (typeof image !== "string" || image === "" || image.length % 4 !== 0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(image)) return image;
136
+ const bytes = Buffer.from(image, "base64");
137
+ const path = `files/${digest(bytes)}`;
138
+ if (!filePaths.has(path)) {
139
+ files.push({
140
+ path,
141
+ content: bytes
142
+ });
143
+ filePaths.add(path);
144
+ }
145
+ return { contentPath: path };
146
+ });
147
+ collections[name].push(row);
148
+ }
149
+ });
150
+ }
151
+ const { imagesAsKeys: _imagesAsKeys, ...bundleMetadata } = metadata;
152
+ return createExportBundle({
153
+ collections,
154
+ files,
155
+ ...bundleMetadata
156
+ }, write);
157
+ }
158
+ const MIRROR_GENESIS_CURSOR = {
159
+ at: 0,
160
+ id: "",
161
+ head: null
162
+ };
163
+ const sha256 = (s) => createHash("sha256").update(s).digest("hex");
164
+ const canonical = (value) => JSON.stringify(value, (_key, v) => v && typeof v === "object" && !Array.isArray(v) ? Object.fromEntries(Object.entries(v).sort(([a], [b]) => a < b ? -1 : 1)) : v);
165
+ const hashNotebook = (notebook) => sha256(canonical(notebook));
166
+ const chainLink = (prev, notebookId, updatedAt, contentHash) => sha256(JSON.stringify([
167
+ prev,
168
+ notebookId,
169
+ updatedAt,
170
+ contentHash
171
+ ]));
172
+ const encodeMirrorCursor = (cursor) => Buffer.from(JSON.stringify(cursor), "utf8").toString("base64url");
173
+ function decodeMirrorCursor(token) {
174
+ if (!token) return MIRROR_GENESIS_CURSOR;
175
+ try {
176
+ const parsed = JSON.parse(Buffer.from(token, "base64url").toString("utf8"));
177
+ if (typeof parsed.at === "number" && Number.isFinite(parsed.at) && typeof parsed.id === "string" && (parsed.head === null || typeof parsed.head === "string" && /^[a-f0-9]{64}$/.test(parsed.head))) return {
178
+ at: parsed.at,
179
+ id: parsed.id,
180
+ head: parsed.head
181
+ };
182
+ } catch {}
183
+ throw new Error("Invalid mirror cursor");
184
+ }
185
+ /** Throws unless the page continues the chain from `cursor` and every snapshot matches its hash. */
186
+ function verifyMirrorPage(cursor, page) {
187
+ let head = cursor.head;
188
+ for (const entry of page.entries) {
189
+ if (entry.notebook.id !== entry.notebookId || hashNotebook(entry.notebook) !== entry.contentHash) throw new Error(`Mirror content hash mismatch: ${entry.notebookId}`);
190
+ if (chainLink(head, entry.notebookId, entry.updatedAt, entry.contentHash) !== entry.link) throw new Error(`Mirror chain broken at: ${entry.notebookId}`);
191
+ head = entry.link;
192
+ }
193
+ const next = decodeMirrorCursor(page.cursor);
194
+ if (next.head !== head) throw new Error("Mirror cursor does not match the chain");
195
+ return next;
196
+ }
197
+ /** Verifies and applies one page in place; returns the cursor to resume from. */
198
+ function applyMirrorPage(state, cursor, page) {
199
+ const next = verifyMirrorPage(cursor, page);
200
+ for (const entry of page.entries) state.set(entry.notebookId, entry.notebook);
201
+ if (!page.hasMore && page.liveIds) {
202
+ const live = new Set(page.liveIds);
203
+ for (const id of [...state.keys()]) if (!live.has(id)) state.delete(id);
204
+ }
205
+ return next;
206
+ }
207
+ /** Writes the state as a v2 bundle, sorted by id so output is independent of arrival order. */
208
+ function mirrorStateToBundle(state, write, metadata = {}) {
209
+ return createNotebookBundle([...state.values()].sort((a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0), write, metadata);
210
+ }
211
+ //#endregion
212
+ //#region src/commands/mirrorCommand.ts
213
+ /**
214
+ * `b4m mirror <dir>`: pull the account's notebooks into a local v2 bundle and keep it current.
215
+ *
216
+ * State (`.mirror-state.json`: cursor plus the latest snapshot of each notebook) lives beside the
217
+ * bundle, so the destination credentials never leave this machine. Every page is verified against
218
+ * the hash chain before it is applied.
219
+ */
220
+ const STATE_FILE = ".mirror-state.json";
221
+ async function writeAtomic(file, data) {
222
+ await mkdir(path.dirname(file), { recursive: true });
223
+ const tmp = `${file}.tmp`;
224
+ await writeFile(tmp, data);
225
+ await rename(tmp, file);
226
+ }
227
+ async function loadState(dir) {
228
+ try {
229
+ const persisted = JSON.parse(await readFile(path.join(dir, STATE_FILE), "utf8"));
230
+ return {
231
+ state: new Map(Object.entries(persisted.notebooks)),
232
+ cursor: decodeMirrorCursor(persisted.cursor ?? void 0)
233
+ };
234
+ } catch (error) {
235
+ if (error.code === "ENOENT") return {
236
+ state: /* @__PURE__ */ new Map(),
237
+ cursor: MIRROR_GENESIS_CURSOR
238
+ };
239
+ throw error;
240
+ }
241
+ }
242
+ /** One sync pass: pages until the feed is drained, then rewrites the bundle. Resumable at any page. */
243
+ async function runMirrorOnce(dir, fetchPage) {
244
+ const { state, cursor: start } = await loadState(dir);
245
+ let cursor = start;
246
+ let pages = 0;
247
+ for (;;) {
248
+ const page = await fetchPage(cursor === MIRROR_GENESIS_CURSOR ? void 0 : encodeMirrorCursor(cursor));
249
+ cursor = applyMirrorPage(state, cursor, page);
250
+ pages++;
251
+ await writeAtomic(path.join(dir, STATE_FILE), JSON.stringify({
252
+ cursor: encodeMirrorCursor(cursor),
253
+ notebooks: Object.fromEntries(state)
254
+ }));
255
+ if (!page.hasMore) break;
256
+ }
257
+ await mirrorStateToBundle(state, (file, bytes) => writeAtomic(path.join(dir, "bundle", file), bytes));
258
+ return {
259
+ pages,
260
+ notebooks: state.size
261
+ };
262
+ }
263
+ async function handleMirrorCommand(dir, opts = {}) {
264
+ const configStore = new ConfigStore();
265
+ const config = await configStore.load();
266
+ const client = new ApiClient(requireApiUrl(config.apiConfig), configStore);
267
+ const fetchPage = async (cursor) => {
268
+ return (await client.post("/api/notebooks/mirror", { cursor })).data;
269
+ };
270
+ const target = path.resolve(dir);
271
+ for (;;) {
272
+ const { pages, notebooks } = await runMirrorOnce(target, fetchPage);
273
+ console.log(`Mirrored ${notebooks} notebooks (${pages} page${pages === 1 ? "" : "s"}) to ${target}/bundle`);
274
+ if (!opts.watchSeconds) return;
275
+ await new Promise((resolve) => setTimeout(resolve, opts.watchSeconds * 1e3));
276
+ }
277
+ }
278
+ //#endregion
279
+ export { handleMirrorCommand, runMirrorOnce };