Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(browser): stage recipe uploads and bound article images

Dashc6d699fd9b31
diff --git a/apps/desktop/src/main/mcp-integrations/browser.ts b/apps/desktop/src/main/mcp-integrations/browser.ts
index 7c4bc82b46..6289d97ffe 100644
--- a/apps/desktop/src/main/mcp-integrations/browser.ts
+++ b/apps/desktop/src/main/mcp-integrations/browser.ts
@@ -11,6 +11,7 @@ import nodePath from 'node:path';
import { app, ipcMain } from 'electron';
import {
createBrowserControlRuntime,
+ browserUploadDirectory,
setBrowserControlRuntimeConfig,
type BrowserProxyRoute,
type BrowserControlRuntime,
@@ -485,9 +486,10 @@ export function getBrowserMcpDeps(): {
read: (file) => fs.readFileSync(resolve(file)),
open: (file) => fs.openSync(resolve(file), 'r'),
directory: sessionRoots[0],
- // Temporary upload copies belong to this task's existing browser artifact
- // root so the ordinary upload policy accepts them without extra grants.
- temporaryRoot: sessionId ? roots[0] : undefined,
+ // Each backend consumes invocation copies below its existing upload root.
+ // The recipe host owns the same finally cleanup for both backends.
+ temporaryRoot: sessionId ? (backendController.kind === 'external'
+ ? artifactSessionRoot(browserUploadDirectory, sessionId) : roots[0]) : undefined,
output: (file: string) => resolveRecipeOutputPath(file, sessionRoots),
};
},
diff --git a/packages/browser-control-runtime/src/index.ts b/packages/browser-control-runtime/src/index.ts
index 5484b4db7b..b3bd7113ea 100644
--- a/packages/browser-control-runtime/src/index.ts
+++ b/packages/browser-control-runtime/src/index.ts
@@ -39,6 +39,7 @@ export { refreshBrowserRuntimeConfigDir } from './shim/_local/text-utils.js';
export { isPublicHttpResourceUrl } from './resource-url-policy.js';
export { assertRecipeCommand } from './recipe-command.js';
export { RecipeBrowserSessions, type RecipeTransport } from './recipe-sessions.js';
+export { DEFAULT_UPLOAD_DIR as browserUploadDirectory } from './_generated/extension/src/browser/paths.js';
export {
managedProfilePidOwnsCdpPort,
pidIsManagedChromeForProfile,
diff --git a/packages/lizi-mcps/src/browser/opencli-page.ts b/packages/lizi-mcps/src/browser/opencli-page.ts
index c69a5cc43d..173f0fc8b0 100644
--- a/packages/lizi-mcps/src/browser/opencli-page.ts
+++ b/packages/lizi-mcps/src/browser/opencli-page.ts
@@ -1,5 +1,5 @@
import { readFile, writeFile } from "node:fs/promises";
-import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
+import { recipeOutputPath, stageRecipeUploadFiles } from '@jackwener/opencli/cindy/host';
import {
CDPBasePage,
buildEvaluateExpression,
@@ -254,8 +254,9 @@ export class OpenCliPage extends CDPBasePage {
files: string[],
selector = "input[type=file]",
): Promise<void> {
+ const paths = stageRecipeUploadFiles(files);
await this.ensureTarget();
- await this.request({ action: "upload", paths: files, element: selector });
+ await this.request({ action: "upload", paths, element: selector });
}
async startNetworkCapture(pattern = ""): Promise<boolean> {
diff --git a/packages/lizi-mcps/src/browser/opencli-recipes.test.ts b/packages/lizi-mcps/src/browser/opencli-recipes.test.ts
index b30af5df8c..37dbb2f71a 100644
--- a/packages/lizi-mcps/src/browser/opencli-recipes.test.ts
+++ b/packages/lizi-mcps/src/browser/opencli-recipes.test.ts
@@ -5,6 +5,9 @@ import { RecipeBrowserSessions, type BrowserControlRequest } from "@cindy/browse
import * as guardedNetwork from '@cindy/browser-control-runtime/ssrf-runtime';
import { MockAgent } from 'undici';
import { httpDownload } from '@jackwener/opencli/download';
+import * as downloads from '@jackwener/opencli/download';
+import { downloadArticle } from '@jackwener/opencli/download/article-download';
+import { resolveExistingUploadPaths } from '../../../browser-control-runtime/src/_generated/extension/src/browser/paths.js';
import { createBrowserMcpServer } from "./server.js";
import { OpenCliPage } from "./opencli-page.js";
import { loadRecipes, RecipeSchema, type Recipe } from "./recipe-loader.js";
@@ -27,6 +30,8 @@ import { resolvePayload } from '../../../opencli-vendor/clis/zhihu/write-shared.
// @ts-expect-error Pinned upstream JavaScript helpers have no declarations.
import { prepareChatGPTFilePaths } from '../../../opencli-vendor/clis/chatgpt/utils.js';
import { readFileSync, openSync } from 'node:fs';
+// @ts-expect-error Upstream JavaScript helpers have no declarations.
+import { validateLocalReferences } from '../../../opencli-vendor/clis/midjourney/utils.js';
afterEach(() => {
vi.useRealTimers();
@@ -35,6 +40,114 @@ afterEach(() => {
});
describe("bundled OpenCLI recipes", () => {
+ // #6826 file boundary recurrence; unit tier. Real adapter input checks must
+ // reject an existing absolute path without the host before browser effects.
+ it.each(['mercury', 'wechat-channels', 'midjourney'])('brokers %s input metadata before browser effects', async site => {
+ const dir = await mkdtemp(path.join(tmpdir(), 'cindy-recipe-stat-test-'));
+ const file = path.join(dir, site === 'wechat-channels' ? 'clip.mp4' : 'receipt.png');
+ await writeFile(file, 'test-only-bytes');
+ const goto = vi.fn(async () => { throw new Error('unexpected browser effect'); });
+ const page = { goto } as unknown as IPage;
+ const run = () => site === 'midjourney' ? validateLocalReferences([{ kind: 'local', value: file }], 'fixture')
+ : executeAdapter(site === 'mercury' ? 'mercury/reimbursement-draft' : 'wechat-channels/publish', site === 'mercury' ? {
+ receipt: file, amount: '1.00', date: '2026-10-23', merchant: 'Fixture', notes: 'fixture',
+ } : { video: file }, page);
+ try {
+ await expect(run()).rejects.toThrow();
+ expect(goto).not.toHaveBeenCalled();
+ } finally { await rm(dir, { recursive: true, force: true }); }
+ });
+
+ // #6826 upload regression; real page upload entry + actual external runtime
+ // path resolver, unit tier. Source workdir is outside the runtime upload root.
+ // Existing screenshot-temp tests never tried a normal adapter upload.
+ it.each([false, true])('stages approved uploads in the runtime root and cleans after failure=%s', async fail => {
+ const dir = await mkdtemp(path.join(tmpdir(), 'cindy-recipe-upload-test-'));
+ const uploadRoot = path.join(dir, 'uploads');
+ const file = path.join(dir, 'receipt.png');
+ await writeFile(file, 'test-only-image');
+ let staged = '';
+ const page = new OpenCliPage({ targetId: 't', call: async request => {
+ expect(request.action).toBe('upload');
+ staged = request.paths![0];
+ const result = await resolveExistingUploadPaths({ requestedPaths: request.paths!, uploadDir: uploadRoot, inboundMediaDir: path.join(dir, 'inbound') });
+ expect(result.ok).toBe(true);
+ expect(staged).not.toBe(file);
+ expect(await readFile(staged, 'utf8')).toBe('test-only-image');
+ return fail ? { ok: false, action: 'upload', message: 'fixture upload rejected' } : { ok: true, action: 'upload', data: {} };
+ } });
+ try {
+ const running = withRecipeHost(undefined, () => page.setFileInput([file]), {
+ directory: dir, temporaryRoot: uploadRoot, read: readFileSync, open: file => openSync(file, 'r'),
+ });
+ if (fail) await expect(running).rejects.toThrow('fixture upload rejected');
+ else await running;
+ expect(staged).not.toBe('');
+ await expect(access(staged)).rejects.toThrow();
+ expect(await readFile(file, 'utf8')).toBe('test-only-image');
+ } finally { await page.dispose(); await rm(dir, { recursive: true, force: true }); }
+ });
+
+ // #6826 resource-limit regression; real article/download production entries,
+ // unit tier with local streams. Old coverage used only a small single image.
+ it('limits article image count and leaves remaining links remote', async () => {
+ const dir = await mkdtemp(path.join(tmpdir(), 'cindy-recipe-image-test-'));
+ const urls = Array.from({ length: 25 }, (_, i) => `https://example.test/${i}.png`);
+ const fetch = vi.spyOn(guardedNetwork, 'fetchWithSsrFGuard').mockImplementation(async params => ({
+ response: new Response('image'), finalUrl: params.url, release: async () => {},
+ }));
+ try {
+ await withRecipeHost(undefined, () => downloadArticle({ title: 'Fixture', contentHtml: urls.map(url => `<img src="${url}">`).join(''), imageUrls: urls }, { output: dir }), {
+ directory: dir, read: readFileSync, open: file => openSync(file, 'r'), output: file => file,
+ });
+ expect(fetch).toHaveBeenCalledTimes(20);
+ expect(await readdir(path.join(dir, 'Fixture', 'images'))).toHaveLength(20);
+ const md = await readFile(path.join(dir, 'Fixture', 'Fixture.md'), 'utf8');
+ expect(md).toContain(urls[24]);
+ } finally { await rm(dir, { recursive: true, force: true }); }
+ });
+
+ it.each([8, 10])('counts %s MiB progress across image batches without exceeding the article budget', async sizeMiB => {
+ const dir = await mkdtemp(path.join(tmpdir(), 'cindy-recipe-total-test-'));
+ const urls = Array.from({ length: 16 }, (_, i) => `https://example.test/${i}.png`);
+ // Simulate byte progress through the public downloader callback; actual
+ // stream rejection/cleanup is covered separately without large disk writes.
+ const fetch = vi.spyOn(downloads, 'httpDownload').mockImplementation(async (_url, _path, options) => {
+ options?.onProgress?.(sizeMiB * 1024 * 1024, 0);
+ await Promise.resolve();
+ return { success: true, size: sizeMiB * 1024 * 1024 };
+ });
+ try {
+ await withRecipeHost(undefined, () => downloadArticle({ title: 'Fixture', contentHtml: urls.map(url => `<img src="${url}">`).join(''), imageUrls: urls }, { output: dir }), {
+ directory: dir, read: readFileSync, open: file => openSync(file, 'r'), output: file => file,
+ });
+ expect(fetch).toHaveBeenCalledTimes(sizeMiB === 8 ? 7 : 5);
+ const md = await readFile(path.join(dir, 'Fixture', 'Fixture.md'), 'utf8');
+ expect(md.match(/images\/img_/g)).toHaveLength(sizeMiB === 8 ? 6 : 5);
+ expect(md).toContain(urls[15]);
+ } finally { await rm(dir, { recursive: true, force: true }); }
+ });
+
+ it.each([[true, false], [false, false], [false, true]])('rejects an oversized download before saving (length header=%s, progress rejection=%s)', async (lengthHeader, progressRejection) => {
+ const dir = await mkdtemp(path.join(tmpdir(), 'cindy-recipe-limit-test-'));
+ const release = vi.fn(async () => {});
+ vi.spyOn(guardedNetwork, 'fetchWithSsrFGuard').mockResolvedValue({
+ response: new Response('12345678', { headers: lengthHeader ? { 'content-length': '8' } : {} }),
+ finalUrl: 'https://example.test/image', release,
+ });
+ try {
+ const result = await withRecipeHost(undefined, () => httpDownload('https://example.test/image', path.join(dir, 'image.png'), {
+ maxBytes: progressRejection ? Infinity : 4,
+ onProgress: progressRejection ? () => { throw new Error('Article image byte limit exceeded'); } : undefined,
+ }), {
+ directory: dir, read: readFileSync, open: file => openSync(file, 'r'), output: file => file,
+ });
+ expect(result).toMatchObject({ success: false, error: expect.stringMatching(/limit/i) });
+ expect(await readdir(dir)).toEqual([]);
+ expect(release).toHaveBeenCalledOnce();
+ } finally { await rm(dir, { recursive: true, force: true }); }
+ });
+
// #6826 security regression; unit tier. Real download -> real SSRF shell,
// fake DNS and in-memory HTTP dispatcher. Previously image downloads could
// reach private literals, private DNS answers and private redirect targets.
@@ -223,7 +336,7 @@ describe("bundled OpenCLI recipes", () => {
const output = vi.fn(() => { throw new Error('output denied by host'); });
await expect(executeAdapter('pixiv/novel-download', { ...inputs, output: rejected }, page, undefined, undefined,
{ read: () => Buffer.alloc(0), open: () => -1, directory: dir, output },
- )).rejects.toThrow('output denied by host');
+ )).rejects.toThrow(/output denied by host|not a safe directory/);
expect(output).toHaveBeenCalledWith(rejected);
await expect(access(rejected)).rejects.toThrow();
const deniedImage = path.join(dir, 'image.png');
@@ -243,7 +356,7 @@ describe("bundled OpenCLI recipes", () => {
{ read: () => Buffer.alloc(0), open: () => -1, directory: dir, output: file => file });
expect(await readFile(deniedImage, 'utf8')).toBe('image');
await expect(executeAdapter('pixiv/novel-download', { ...inputs, output: path.join(dir, 'no-host') }, page))
- .rejects.toThrow('host output file broker');
+ .rejects.toThrow(/host output file broker|not a safe directory/);
await expect(access(path.join(dir, 'no-host'))).rejects.toThrow();
} finally { await rm(dir, { recursive: true, force: true }); }
});
@@ -315,11 +428,11 @@ describe("bundled OpenCLI recipes", () => {
}));
const result = await runRecipe(loadRecipes().get('opencli:yollomi/upload')!, { file }, { call });
expect(result.ok).toBe(false);
- expect(result.message).toContain('host file broker');
+ expect(result.message).toContain('file broker');
expect(call.mock.calls.some(([req]) => req.request?.fn?.includes('atob('))).toBe(false);
const read = vi.fn(() => Buffer.from('approved-image'));
const approved = await runRecipe(loadRecipes().get('opencli:yollomi/upload')!, { file }, {
- call, recipeFiles: async () => ({ read, open: () => { throw new Error('unused'); } }),
+ call, recipeFiles: async () => ({ read, output: file => file, open: () => { throw new Error('unused'); } }),
});
expect(approved.ok).toBe(true);
expect(read).toHaveBeenCalledWith(file);
diff --git a/packages/lizi-mcps/src/vite-env.d.ts b/packages/lizi-mcps/src/vite-env.d.ts
index bf20b22c29..c9f64d746e 100644
--- a/packages/lizi-mcps/src/vite-env.d.ts
+++ b/packages/lizi-mcps/src/vite-env.d.ts
@@ -7,6 +7,11 @@ declare module '*.md?raw' {
export default content;
}
+declare module 'turndown-plugin-gfm' {
+ import type TurndownService from 'turndown';
+ export const gfm: TurndownService.Plugin;
+}
+
interface ImportMeta {
glob<T = unknown>(
pattern: string | string[],
diff --git a/packages/opencli-vendor/README.md b/packages/opencli-vendor/README.md
index 627322a0d7..64514e9465 100644
--- a/packages/opencli-vendor/README.md
+++ b/packages/opencli-vendor/README.md
@@ -47,11 +47,16 @@
- 适配器直接读取文件和分片上传也须通过宿主文件代理,复用原有上传目录、敏感文件和
realpath 校验;文件检查复用同一代理的描述符,命名导入与别名导入均按任务解析。
无会话目录或宿主文件代理时拒绝读取。ChatGPT 后端请求只发送自身域的 Cookie。
+- 输入文件检查统一通过宿主描述符,其他文件存在性、目录枚举和输出检查先验证任务根;
+ 生产构建检查这些文件边界。上传在派发前把批准字节暂存到对应后端已有上传根下的调用目录,
+ 成功和失败均沿用调用 finally 清理,源文件保留;外部 Chrome 与内嵌浏览器使用相同的暂存入口。
- 图片、音频和下载成果的默认路径与目录参数元数据均使用任务内相对路径;
诊断截图及跟踪文件按调用隔离,结束后清理,兼容 Windows。
- 共享 Node 文件下载复用浏览器运行层的 SSRF fetch:首跳与每次重定向均检查协议、DNS/IP,
连接固定在已校验的公网地址;跨 origin 移除鉴权头,正文结束或失败后释放连接。
这条下载路径使用受保护的直连,不读取适配器的代理环境变量;需要代理的站点可沿用浏览器操作。
+- 文章自动图片下载最多 20 张,每张 10 MiB,单篇累计接收 50 MiB(包含失败传输);
+ 先检查响应长度,再在写入前检查实际流量。超出上限或下载失败的图片保留远程链接。
- 与配方按使用维护共用暂停状态:适配器参数预检失败不会暂停配方,执行失败才暂停;
暂停记录可跨任务读取。修订仍须用带 guard/expect 的声明式步骤试跑成功后保存,
不把适配器返回成功等同于通过页面与结果校验,也不自动重放写操作。
diff --git a/packages/opencli-vendor/UPSTREAM.json b/packages/opencli-vendor/UPSTREAM.json
index ab247a3a24..c3522610a1 100644
--- a/packages/opencli-vendor/UPSTREAM.json
+++ b/packages/opencli-vendor/UPSTREAM.json
@@ -216,6 +216,9 @@
},
"cli-manifest.json": {
"upstreamSha256": "79791f1435dd3fb4c00c9996e2dfea71a644b3a2caeae7ec22f2c1a4f5520758"
+ },
+ "src/browser/cdp.ts": {
+ "upstreamSha256": "0558dc14d65741c39f9c3fe8461e1dd3b3ae0cbdd0b7ddafbd1f02e1153d04b3"
}
},
"files": {
@@ -384,7 +387,7 @@
"clis/chatgpt/deep-research-result.js": "43993ccc844f62d93ff7cc2dce1d2adcc847896df07b1c4599b1045678410a51",
"clis/chatgpt/detail.js": "8c43571fdc1f3ccd4d2242f5c7eb8e0a7a6069e9230b49c12ca7bf7a2c8ae3b2",
"clis/chatgpt/history.js": "66d608d3c77d95983f668211c6366c081d9d008aede136062af950aa0fd89785",
- "clis/chatgpt/image.js": "423873d548615fabd55b84c5d417be69601f5300b82d9d571503c2407d050290",
+ "clis/chatgpt/image.js": "6c554475a85cb6280dbc024c94647aa8d950c105660c63611e0f2b05b4b7c83c",
"clis/chatgpt/model.js": "2c7e4535f07d3fb6091f359dadb64064168772565b188c3ed58dccee4e0b82ac",
"clis/chatgpt/new.js": "68d2435dc54035ee566e6140e8f9104c368342237474dff5dacd70380e07311d",
"clis/chatgpt/project-file-add.js": "90bd5b4ff547f7ba1db66d8d5b356d1694eb1a02995f5675f33d61a6f0908fdc",
@@ -510,12 +513,12 @@
"clis/douyin/_shared/browser-fetch.js": "50117bc3144a7d4824150a04da173758747b16e77405bbce9f47dbf2d2c6e525",
"clis/douyin/_shared/creation-id.js": "7764baf7e84773233a9ae1881b5dd6f5be49cf24dd4e8d02524beb2d0087973a",
"clis/douyin/_shared/evaluate-result.js": "e83d57918fda3f1b39e7b58b462415dc91451eaea4c325b509bf59f43a3f5c6d",
- "clis/douyin/_shared/imagex-upload.js": "b031e2c30de02c9c70a3df28a9e6c57017fb60113d1f8149d19f373e54c5a107",
+ "clis/douyin/_shared/imagex-upload.js": "16c678b9a05c08f45621750d7d69e96d6885ff978985a431cbc0726e7119af39",
"clis/douyin/_shared/public-api.js": "4c8140adb5f4a3c7b8e5946d614241c719d494f6bb5f5546c72125f272fd1606",
"clis/douyin/_shared/sts2.js": "0759c0b4ac5542ad06a7bc03af5370579721f9af249ff29ad6230bdb6a2d7c46",
"clis/douyin/_shared/text-extra.js": "4caa2e8660eba04115476ee212deaa7ac578271e3df18c4513295b9c15fca3dd",
"clis/douyin/_shared/timing.js": "4bdc8fc4f64015253c884540e473d780bad4f97823e9ed91dff4fe83773b905b",
- "clis/douyin/_shared/tos-upload.js": "4b74923816ef842c72e07cca90d457b22f42d345dd6699c8e1d1da94573f42a2",
+ "clis/douyin/_shared/tos-upload.js": "07490cd63bd14031f255d03fad3c43910edc82b42ba880d551cce136ee9f0f49",
"clis/douyin/_shared/transcode.js": "2fc7d05b9748efd4ddf5333ae8da31560f2417773a2e5cc4fffe3b9ed7306e36",
"clis/douyin/_shared/types.js": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
"clis/douyin/_shared/vod-upload.js": "8030db92de71acce559e8ba4c1d89d93846e7bcf8c8f2c470def958283cf3c3c",
@@ -525,12 +528,12 @@
"clis/douyin/delete.js": "49469d70131c5934b7ae636bcef7d7208dcf2b30a85c18288f1e21a7d9dab978",
"clis/douyin/detail.js": "3262fac62fdb9703c1aac36cfdd54bce76bbb4b5d1f11c0f4f75da6521c16e95",
"clis/douyin/detail.LICENSE": "fd5c0a7fd23782b2835070f7902c1469c63bf1d9fc3eb58523e088dba1672e6b",
- "clis/douyin/draft.js": "3765ab4b07e8b0d74f7c0a4daef9df30e8f966bc276062d6d877874e6cc885c2",
+ "clis/douyin/draft.js": "ee8d9ae3e7c36531cf4cff61a732d6e0dd37967699dbcc93486afeeb154d47f0",
"clis/douyin/drafts.js": "c0fda6aec116d9b8ba19957fd6d541b34eaffa1959ad86f9ec13ec5c91524ad9",
"clis/douyin/hashtag.js": "7952fb0240669b86d1b5b254fddc0758797677df0830047ca5e7a6ed565f86ad",
"clis/douyin/location.js": "f8637006996174d8830bb299d5ccb18c0fe589964ebf77bf0865cea3d39b8712",
"clis/douyin/profile.js": "4d4c7a090dd84479961f31a17a6761db363f9a313a90569ac647347242cb9f53",
- "clis/douyin/publish.js": "2a70e3df62a8217c90e616232d60d966962c594efacfc87d8c05067e966cf749",
+ "clis/douyin/publish.js": "daa37b28f4832a66fb4022d816ee73651080c41c82c4ac374652936575ee0cf5",
"clis/douyin/search.js": "28c508c4bb80282858e036ba2c3b57c91de8651293d2c12234c3486fe535fbe1",
"clis/douyin/stats.js": "baac5cff947d7848bca84303de8c1cfcd75a24b488e64f1c644fa04eec388aba",
"clis/douyin/update.js": "407f58aea77dfb29a78480fc6dad255fcae9b16af9ba98c041ec5b9eced6c1ec",
@@ -709,7 +712,7 @@
"clis/indeed/utils.js": "432ee24c15fdd18df6d9e9a54fbfcdd75edf86708eae88b64dcd4bec06822118",
"clis/instagram/_shared/navigation.js": "acb71a106f5086de5e2053d8fda4bfd1ecc67ce96fb3c0722b118d1501ca7725",
"clis/instagram/_shared/post-like.js": "e1acb51a3f00823df80f18c89f529f2613e62b75a3525e1a872861049e39dbda",
- "clis/instagram/_shared/private-publish.js": "0fb4f78f2c74fe8a145e9766542affe37d091f18192f6c2487d83c9b9c1e2b17",
+ "clis/instagram/_shared/private-publish.js": "bf5c86f273a658ce4d1d13285f3e6c7c9ac88c28c3a9465a613a7e0eaab2699a",
"clis/instagram/_shared/protocol-capture.js": "1d6d92e962d76cfe8ddd30b7df914b1a3f8c3a3a76c6433808249aef64a7db20",
"clis/instagram/_shared/read-response.js": "7805d4fc63e6ecb767136a6c7ae5415a000c41768b047f2ee539eb23f76bb513",
"clis/instagram/_shared/runtime-info.js": "40ecefbf47ee65685048d9b8f61ba12dc9666d5e1ba8c048828b9e7eff74592c",
@@ -725,13 +728,13 @@
"clis/instagram/following.js": "f42334a31aca1a727a11874836e814584b8cbac7e51a876c80b8d0d4d38775c9",
"clis/instagram/like.js": "40eca5c72564f704c40cf27b6c4da1bc38ee4d875224415cd88292a74e1b7bb0",
"clis/instagram/note.js": "5c409f7e6d2da0ab2c875729154b1af04c4ec00c6a2d51e4807bc3c3ea50abf8",
- "clis/instagram/post.js": "1059abbf3fba2dc58c47c080b4d2b7dfd7ff1e513ea0a2039e29f86849c72ef0",
+ "clis/instagram/post.js": "6bfdf02653c73ab4f0c552afba03fcb74177c7c33043c2dab32999fa6ad35754",
"clis/instagram/profile.js": "40f400cdabdcfcc216c5e7fa4bb321f1b70e00a5a5b83bac3c2ee1c276fca312",
- "clis/instagram/reel.js": "82d84ce0692286a300da803ff3ad042ca771b5ca114d485476f9bb1d8f860e29",
+ "clis/instagram/reel.js": "6a580a3147ab9bd514c5c7a6b8c38380edc69c3254e4d5568e01a30c40818f29",
"clis/instagram/save.js": "fc5105071edad389d6004247a1113473ade4b8da3e174ed6c06ef151d5a468ec",
"clis/instagram/saved.js": "95fbb7d994bd68e502b0b6a7fce70f24c3cf58083d5aefb1af54dfdd288781ec",
"clis/instagram/search.js": "a38879e761271d167bef752359442b0be84611cca727b2b323467772d2d45239",
- "clis/instagram/story.js": "2eade7fbb2f9cdbadf5cc49da13efa2b0577a08bb8d6e500d31395cb437279e5",
+ "clis/instagram/story.js": "a9068d974cd13e5831dd21198b97511e7b2431641b9e3bcaacce7f4cc4dc0a9d",
"clis/instagram/unfollow.js": "80631c5da759fe95e384ed674b791101d7554b6243094cffa2e2d559f329e57c",
"clis/instagram/unlike.js": "3e098fdd270da213aee8c4d108ed3c47e20b89f060a9dba938426286f406492f",
"clis/instagram/unsave.js": "9872bd76c98039689cc7c68fe255f230226efce0fe9b45dd651a540312504c1f",
@@ -878,7 +881,7 @@
"clis/mercury/check-login.js": "f0003229671bc81faaa9d321854ff71c093ee46d4f7a54484d670891e829a264",
"clis/mercury/reimbursement-draft.js": "3225ed072d7943543af9afa5d97a72ae317fcea2efa748b1449fda4e7d248362",
"clis/mercury/reimbursement-plan.js": "499b4dcc4412023ee052e444ee705501c89cfdc36f485ac37baf7819c3225bd4",
- "clis/mercury/utils.js": "b6e736d3182bbdadd8356b2b67f913dfdb21aae388c2bdeff7a3ad9f172824b9",
+ "clis/mercury/utils.js": "d5a6d3e07e893a4feecc95d563660030c476b51fa6f384642f5f06211a09b59e",
"clis/midjourney/action.js": "d5fa75d3711bef0bd7c1bb1bfda8511ebc4fb6105087ca8ce4457a673b16e97c",
"clis/midjourney/auth-utils.js": "af4fb68018bac5fd94b0108ae69aaa12b2c3a6d370b0e96636f74e961578ed8f",
"clis/midjourney/capabilities.js": "fd7413726b757b07db627be9b81ef3b29b17b2ebb822ad6475f47788901e6b8f",
@@ -890,17 +893,17 @@
"clis/midjourney/quota.js": "c9be85847c01d7a0d9673dc45b2ddbadc77a2de885825530b08886fe6e310a0f",
"clis/midjourney/settings.js": "bcec44f911c62f1621f0a8776199c7ab3918df16c648e9fa2216f11e0bfea6bf",
"clis/midjourney/status.js": "1382504f9b9cbe73864bc05f4d3f398ea38ae3fa18a4379428b7cdfee8ecfc2b",
- "clis/midjourney/utils.js": "77df1811a3c54b84e0ac25b00b34de56c5ba53c8c863a1b3d3b459b259096a38",
+ "clis/midjourney/utils.js": "645e331a02a04591447c2496a4a6298eb726b7195f995c0e0dd1da43c2c337c2",
"clis/midjourney/whoami.js": "78424e609c5cc0022ec7c2590cc902371f4431207d2f0b1079a9cdf9fa1beea9",
"clis/minimax/music.js": "a192c07d35827813ca229d4fae2e4136153aaa8e987d2335db33605daaa65837",
- "clis/minimax/utils.js": "c175b6e059568df44be268a4acd92a666ade3ed45f770896be4cf59fd799071d",
+ "clis/minimax/utils.js": "07c258f4481a8c3524d66cc686915222a3a8f0b9879626e0a520571226974e51",
"clis/mubu/doc.js": "8c0e2cbe4ad8246744ed2ab903d54ad0a4fa4f3a4778ab498c5c14f8c01216c2",
"clis/mubu/docs.js": "1b2b186631e9bfc973140ffbf29d525ee46b66e25488c5b1b13ab908d0c1bfa4",
"clis/mubu/notes.js": "70e91496a033bd3054b152c8047e2bc59d7b4c4f973fda092ccc2cecb8a12bfa",
"clis/mubu/recent.js": "c942df22f5a5471e0603ad4a9145b3f2165b7d7501b8a880fd1294c2d54aecc1",
"clis/mubu/search.js": "27a36be32428b2ee469a2290a73de4ae42c11b2ddac3438c6d60d7f46a7a9b6a",
"clis/mubu/utils.js": "084cda4a7f1b06a2e4702517ed942ab0b29deff640b5097d4c92f6ee81d83b88",
- "clis/notebooklm/add-source.js": "686c81dd8dab502c50d6b13a074fd0f2aff8665446b82fd9b419d3869c599f40",
+ "clis/notebooklm/add-source.js": "d26e70d233275ea5c960c647a77d2a16bcd64d4764bfe1f54df5ce3ff3c20cb5",
"clis/notebooklm/auth.js": "03eeb11bbf5160b46bb01bd40bb5a06add947e5e0841b28731f6fa79fee9f2db",
"clis/notebooklm/create.js": "8b6e73960db406cf55351b128a217027ae6f8cd6c969f335385d33e83db09f7b",
"clis/notebooklm/current.js": "164f185ab66af82d2b51697b7c2338393314f228717f4b3d09592e57ab5a4085",
@@ -984,7 +987,7 @@
"clis/paperreview/feedback.js": "198fb6ff0c8c151e7d42ea5853781460bf273a96be685bf74fc072977141f5a2",
"clis/paperreview/review.js": "5f9c372061f10e5329d5711523457537aee7c21b10d8a2fb790937492b1d1f74",
"clis/paperreview/submit.js": "a618f96d7f0b1e9c887a3ca44e23f411f471845cd521c72fb41df8fef6b335fb",
- "clis/paperreview/utils.js": "3d7e33c66a15a38476474ee6d6aa93975f33cd5fc23d0c52875ceef515e57f29",
+ "clis/paperreview/utils.js": "932aa6b62f6691e35e9ee2410c8caa640b82f9b54b203b699d06566d15675c1e",
"clis/pinterest/board-create.js": "11559ab31594c8ef079e64f0775e1765ddd340f90c818a3d9e2717a881b13550",
"clis/pinterest/board-delete.js": "7ebe57101e3dee3b2a5a09c1253a84fcd327148c4e48d917dce8700c09a7bf60",
"clis/pinterest/board-pins.js": "31dc289e09cb6c547b733464ba96cf40bd05d07000b736c4dc2e53050a1f8bf9",
@@ -1006,14 +1009,14 @@
"clis/pinterest/user.js": "74caf778de5511cab09ebb57d15d48163e5e80b9ccec6bba636d5749e50f58af",
"clis/pinterest/utils.js": "93a4de9d26601cd189e33518a16e59861e35bba71ffdc6deb549c9071f63f0a9",
"clis/pixiv/auth.js": "c310b6eba51848c77db58cb5471944c7bfa77c4566cf128942a49ad0f58a7c8f",
- "clis/pixiv/bookmark-download.js": "244f9e9cd1a6dc7b80e37621c375125c8b31ff4c69506c5358c774ae362a8479",
+ "clis/pixiv/bookmark-download.js": "bb6c8003b20db1993201b8d7fbfa853776f9c323e43c1c1ee09af3f9ce73f0d6",
"clis/pixiv/bookmark-utils.js": "e2a0553503f1553495a23fe44c351e45da6e11d1fe9825d3339768a02189a6f5",
"clis/pixiv/bookmarks.js": "5ea921bc5d61093b32ef46899e7dac4c81ac6f1e8121692e711a50cd82f6a1dc",
"clis/pixiv/detail.js": "5d3e08bb06597f6f7c9a13f9d87a6743ae8e7613aa1125a8b50c7c59fec3533d",
"clis/pixiv/download.js": "59e937271f1ede5628ade7808d6a529e48ef6c39c094cf9b476222b030f1201c",
"clis/pixiv/illusts.js": "49c1363bb9ddcc55b12ec3eec72f7dfd75b549e70c586052f505d99249fe01fc",
"clis/pixiv/me.js": "eed040f8be1ce1b385a9aad3ac525c0860e3e03b43a6e151b44f7ea7dd17bad7",
- "clis/pixiv/novel-download-utils.js": "c50f3271c82c74b6107c32dc6e5a548831636e4fa2dccea072a207f7e3285f8d",
+ "clis/pixiv/novel-download-utils.js": "e2e6fbc1c3ec8121adf8f8bed44eb6ddce030d503de94637f151f1eea20e7615",
"clis/pixiv/novel-download.js": "95a05617659b8e7790f09d36d1bdcdbda8692245382eccc1ad4251bfc11a44be",
"clis/pixiv/novel.js": "55b7cd8d80cdffd4d44c8f11f35de0f6f748f24795a5acef5ae1af76779fb9bf",
"clis/pixiv/novels.js": "cf63f172140b826cc78b3fd32c182cd3a8cc1aa534d6f331c9fe2712f717d63d",
@@ -1197,7 +1200,7 @@
"clis/suno/generate.js": "4dd38a391fce74c6df9190832d51988ef5d63e17845d171c4fca98ca77b5767c",
"clis/suno/list.js": "f4b6f015a9c87547eda1b84adf6d6960c868b8b60c0e8b75f06a1c3367f6212f",
"clis/suno/status.js": "57559e6773be4f37b65c2ad9bf1590e4b87cbae19db26b59c5601053a3bd5bd7",
- "clis/suno/utils.js": "a955020a49f4eb2bcdc60ecef89380d68e494541dbf49fa5364ddaa055d3dfb5",
+ "clis/suno/utils.js": "e0f36f011d8c20b94a86e988777e1f29f5e809403a6abce3bad855fd1f6b7a17",
"clis/taobao/add-cart.js": "ab8c4410ad47fcce126532980c6bfead586acf62d3ece709d31a48b5d71560f1",
"clis/taobao/auth.js": "771219ed232f85e3fb59984377f9f03e3ce3129c5d158eb92ebeb6ddb2f02ccd",
"clis/taobao/cart-action.js": "48a8c345e49298387c455607fda5bc34fc8e158925e15f3ec10836cb860afae4",
@@ -1253,14 +1256,14 @@
"clis/tvmaze/show.js": "bfd76054316b2309835c9e041af6c3b8c6ff234f9f78eee5f519d9cd3aabb065",
"clis/tvmaze/utils.js": "0eba0730644e1d1eb433dde45ec65d3db36856cb202420f962d032366a65aeb1",
"clis/twitter/accept.js": "ae85da341b400e535538700e78c8958a649425783cc9ca163da11aafd0fbf17d",
- "clis/twitter/archive.js": "0a59e32cdbf69614f9215b1b95f04f85b46c7661dbc6c2c11b370cc784c7f24b",
+ "clis/twitter/archive.js": "f9ebba3e4b1ca600ae35be9f87877bd1e119fde18192fb45854718f2a41bd3cf",
"clis/twitter/article.js": "8a9838423d895f2a81da36c149132ca4d455dbfb121617f473afa04ba745f5d5",
"clis/twitter/auth.js": "4f626b2313472183676837ab20abc237a0cc8dc5246ef547262b311587b3cbed",
"clis/twitter/block.js": "c5ae3dfb44d100be31c54943dc16b4c84a35c915b6fa4d0c9746f71aa9348933",
"clis/twitter/bookmark-folder.js": "8797a227580ec5388c0207a600ac23738e633b8bc9634650944b38c5e5e26a6c",
"clis/twitter/bookmark-folders.js": "5d318c1d623b74ba8fb4fb680b4a93578bd604034a7b6c1bd695c106d86ef60e",
"clis/twitter/bookmark.js": "8f775d736c3638f7e016d4341e994a9d1843ba199032ec17067b20f0344f4fbe",
- "clis/twitter/bookmarks.js": "7e4f09d153177a7e22b09eea1dfa1420be788924ad58eae8a5ab525d298cb7a5",
+ "clis/twitter/bookmarks.js": "317225b6ae4bedd178775ebf4724a437ef6c647d44929e6e73cae60362b0b0fd",
"clis/twitter/collection.js": "896d740afd40132d25345cd817f4b9c9cab19a37b6b0e63b0ac44d6aa5540cfe",
"clis/twitter/delete.js": "a705c98df94f952e35b4d85da1b40a1227e6dd71e6fc488043c4364b7cb0857a",
"clis/twitter/device-follow.js": "9034f37c6f71fb7c56a1f6f505e3aeeb02b4fb833c55e4380381ba8f5d113889",
@@ -1271,7 +1274,7 @@
"clis/twitter/following.js": "8837ea224c0e3619594c6109396d6831bc52451c150232ebba12b7989dfc8aa6",
"clis/twitter/hide-reply.js": "c4fa23b98b57ea345c702dd6075ae1dc09961dffaf13e58f4cf88ed312db02b2",
"clis/twitter/like.js": "8d512e0a083baeec4f6760f6d821e5eb9c597b089604a9eec49acce39bd9ae88",
- "clis/twitter/likes.js": "0c5a5b5aa402700a6cbb71b55801f71aa35f298c680cab92e991b8b555c8a2b6",
+ "clis/twitter/likes.js": "90e454ad1b36dd520f8eb1f1e44678fe8abd8c568e1a30ca1639bcd2597f8264",
"clis/twitter/list-add-batch.js": "4d10676a75817b2e6155df68b19bac79b3301ac444073a8cb8bd3ecf5bcef446",
"clis/twitter/list-add-core.js": "095baf186a1abc5dd81cd547423f982f7e0a86cb121d0185f851b43b248df1f4",
"clis/twitter/list-add.js": "ea8eb41bd2e369fcf5630fd51e61b825d4de5a92a568427e945d5465fb10d2bb",
@@ -1285,7 +1288,7 @@
"clis/twitter/lists.js": "a8553e7e2acedde80e7f9e8a03e7762fe03e9ba751585feb1cf9892ca137a9ae",
"clis/twitter/mute-word.js": "b1c411c56819dc40566e1fedd3b3809006b06e610dfe1e4216159bbc4343bed7",
"clis/twitter/notifications.js": "ffdc5b84bc00178ef81df61b02646468bba1fbb2031fe984a8126019c446e998",
- "clis/twitter/post.js": "5ea08450b1d0d75dd8d64d492595f5d99f519ce167502c057d09edc8dc473a8e",
+ "clis/twitter/post.js": "de3511abb1d177de264d25ff4269894b070c85bf1a10559dc6b9c0665bf17098",
"clis/twitter/profile.js": "a92e986946b35c58c8b7bc0b43ab991709eaf668034abc7f98a040d4712f6f49",
"clis/twitter/quote.js": "0d4a034d0a6413b9097df752ca1b4edee1cbc66f4030811ba4a72e5a1da2bdf7",
"clis/twitter/reply-dm.js": "05b84cbb7c32c5ef0abd6011e14ae87f4e555befce37e646a45d101d1fa75302",
@@ -1303,7 +1306,7 @@
"clis/twitter/unlike.js": "183aaf8d883fe57d504e28f41ad46aaaa6e639d7d7c562b87a06f3852fc525c9",
"clis/twitter/unretweet.js": "207a14240eb519b1be6c5e35ded2a9c3002f3cc42d8ad96d9315df88f706bdaf",
"clis/twitter/user-timeline.js": "d80d311ca4090a7c63a7ff8c6b33d612f51d7132a6f289665957bcebda321b00",
- "clis/twitter/utils.js": "2a961227501b379bf67edea6bdb490a2adb0484d7cb992f9d49e13311490e171",
+ "clis/twitter/utils.js": "f76c2eac8fa259e946262b04103a7f185112ce62cafa7afaae8d840f6d0c95a3",
"clis/uisdc/news.js": "7450fa65ec39331fbb4e0e911bf6ebb4bf4cd9e43e5f72b59fbba740b723ae32",
"clis/uiverse/_shared.js": "6318c65c3e3630e843278fc77b87e8da00a387909c78bbee69bfe56803fc0638",
"clis/uiverse/code.js": "3efffa78519d4c545b4c8fb2bb9c7ff607322b6a9dad8443cc7a3af4df217cd3",
@@ -1328,7 +1331,7 @@
"clis/wanfang/search.js": "1713664acba438a57e797d2ffba61387f97070909d3cd95a43180d2b1a6df7d5",
"clis/web/read.js": "163da31622a991a8448948ed1efc08c1539fdb8936c37e82a3421fe31dd34873",
"clis/wechat-channels/auth.js": "87273b45899f69ad523ccb3474b328cc2f915d0c2891900a78dbaceaa9ed2958",
- "clis/wechat-channels/publish.js": "7d85a2abf4bcb38b542eeb5b14ad49d1e17bf1edb1daa6a0099cf7a2d23c3142",
+ "clis/wechat-channels/publish.js": "adcdd5360ed2833e0692c1dcbcca5e1068735d4c7d7842dd8c16b87fba56bb88",
"clis/weibo/auth.js": "a67993a6302b445465ab09a1e2eaf0048b41f373b235801c07198ce9de263c07",
"clis/weibo/comments.js": "f2b9bb520ace7e3f530e0af09fb45ad251795ff1d61be93e96ecc4a8330f709c",
"clis/weibo/delete.js": "866a54ed27988df25d0d0499a58820246915f05af3d2c613ac9df7f022ca0113",
@@ -1337,12 +1340,12 @@
"clis/weibo/hot.js": "7620f20c15956b9823f5a31968c3e07d47a0cadd62ce29815f943375b53cc1cb",
"clis/weibo/me.js": "99461e63852a18c2a4440c61e85aad6e5f97d9886797fa5ef817da6d8c1d1ba3",
"clis/weibo/post.js": "a47e4144934005a8c15b598e6ba4adbee4cfd9118d2571b75222ea1ed6346c57",
- "clis/weibo/publish.js": "0adef31ba6d13c3de59eb6dc763483adba0f0aecb7b21604a4f09f6be768bcd5",
+ "clis/weibo/publish.js": "f2a6659d764188b529193b8a294fd9e6ca65f70b3f646b25176382b95cafc377",
"clis/weibo/search.js": "0156bc86cda823b780e57416b94bba446130777c1c3c921845da5389c5f09f38",
"clis/weibo/user-posts.js": "6e406fd15cf0bcfcd188179445549e793e9ae102209da3bde8d4fe7912bd98e1",
"clis/weibo/user.js": "1707d64c298265817a270b09996ccfbe24f55b001dabafff4fbdd58366b207d2",
"clis/weibo/utils.js": "3b8e7077369b89042924bdeb981af2e133f5b308ca4d26ca80b29f41fbcad69d",
- "clis/weixin/create-draft.js": "3d07da54b91248e91f9ec2d8d3de456142aa4b30f09e7da6b4eb2d5faae33097",
+ "clis/weixin/create-draft.js": "83e397355499658c520cde251179005c65575f2de707aafd630ba4e17723451b",
"clis/weixin/download.js": "52234ac2b72888f7e8f836cd4756759c50e5e45c3200c1f1e5a7e451284f4ae5",
"clis/weixin/drafts.js": "23c1ed53b94f3dabd6f416751176c24fec9f018bc86e8f2957a3e392709c7e27",
"clis/weixin/search.js": "2b75a2a7b78af38c86c229a57ec86b420b9eb209a5bab564f0ef65587eca7ea9",
@@ -1384,7 +1387,7 @@
"clis/xianyu/inbox.js": "43e5d6f9109898277333b3acd0fca5d2c9591ed0342f59784871adb7d68a8088",
"clis/xianyu/item.js": "bff303f425ca3591133c46cc76086705dde675e0dbb6e41f50db13f04192bda8",
"clis/xianyu/messages.js": "d1612d6099d388ce260e9f0920a970929511e54c31d0f707e10c674f48a57c27",
- "clis/xianyu/publish.js": "fc371de84f277b7c42eec91148b625594c45a0788d352b6b310ae324120f5bd5",
+ "clis/xianyu/publish.js": "c61ef91e781082e25b9982f22454be4101ce970da35bbf00900034f7ae26d4ac",
"clis/xianyu/reply.js": "b5a59b16805e66eed19d2ad6a6aaaaa2ace5ed1ee6b78ffef06da9411607d603",
"clis/xianyu/search.js": "0946ee3b745c4afbf45c779e6029cd5d147d8f937b149535bf28224c91584bb4",
"clis/xianyu/utils.js": "9c96e43065c941becbb7f626507be4b29ef807ff418e9a6e6429fd1c04c0800b",
@@ -1420,7 +1423,7 @@
"clis/xiaohongshu/note.js": "09c08e2b8c69ee3a16daafc6fdcebf63fb016b99640adb8a157b80b3287f0833",
"clis/xiaohongshu/notifications.js": "1262c0172fabc45aa21ae65643d19e242856062e73caf0377a95cf94914000a3",
"clis/xiaohongshu/pinia-helpers.js": "c2b7639c4ddc2cd078a01eb62c66c0c37548b7b3fd5aac3c631ac53a36c68686",
- "clis/xiaohongshu/publish.js": "1916886230869f202f1756884d18c27b7bf3689d3d3d5b4406e87afd5bc58ebb",
+ "clis/xiaohongshu/publish.js": "ca1592a4de93dab3b4908f5e841a2f8b4b9528e1be3460434f413f3ce33cc599",
"clis/xiaohongshu/risk-control.js": "6e7c15a8a27de78a45fbe01d206bbbd43fab23bd9aa4cf39c900bf6c838c7242",
"clis/xiaohongshu/saved.js": "c69f484e82b016a07ac699d3622236b8e0d2440826ff497f1ddbabb97137a2c7",
"clis/xiaohongshu/search.js": "333f5db3d62dfb3227bb59f47b5ce8e509901d6438b42e3038ec61624ea0d329",
@@ -1462,9 +1465,9 @@
"clis/yollomi/remove-bg.js": "dcbdb9d48603bdcc528884d87169d67c31e7e3dd0d12bd2ca1a70f997bfc2fc0",
"clis/yollomi/restore.js": "6bd1988650f884bdfcefbbc5add8eb9260534e2bb6d7ff7624171be6383f313b",
"clis/yollomi/try-on.js": "64b0cb281ff66f7f09bc15bc590ccb23245078f69b41027dfd458918947f1bfd",
- "clis/yollomi/upload.js": "e1228c46ad26996a9bdeba11795e6eefc9e5e2d1724363df3034836deb5eec67",
+ "clis/yollomi/upload.js": "65e3f95ecb0e9569c5d15fc202b8cf899f20bab0d68da9f049967b846b95c6b8",
"clis/yollomi/upscale.js": "c8af76d01004a75ba7cf5c2120777936d052ba0d1b4b96b558de0af5ba4f6f2e",
- "clis/yollomi/utils.js": "60442358408875ecb64d4df30e8aa2cb7d2bab9ae0f36e732180bd4b6eead2bf",
+ "clis/yollomi/utils.js": "a3a0900856e2083edb300e2a1b942739b61badd138b1b49db7ce081cf0f21079",
"clis/yollomi/video.js": "d9080992f8ecf4dc41627190014f760ccc255cad5b6f97e9d18c263892f50721",
"clis/youdao/note.js": "dd511f473dd50d84b4baade69da710f19f02d2f84d69719f016b022d8efb826d",
"clis/youtube/auth.js": "976f10a7fa03f2d46c5f0b27c113ee6e18faf1bbdaca8592528bae041e252039",
@@ -1541,7 +1544,7 @@
"src/browser/base-page.ts": "0c1b2d0cbd82426c41b429acc84a6a367d64628c02df98a28ae84ba33738426c",
"src/browser/bridge-readiness.ts": "14692b5292fd1c1e9ad06eeba8ec7efb64062716c7a40098253ca003d3ec2176",
"src/browser/bridge.ts": "faa6c51f9f165f56807c714cc821e157345ed1d2685067869c6e905280d5d25c",
- "src/browser/cdp.ts": "0558dc14d65741c39f9c3fe8461e1dd3b3ae0cbdd0b7ddafbd1f02e1153d04b3",
+ "src/browser/cdp.ts": "66ba2c7176846eddc0aa3d5c37e5ee4ba330f0e5f5b6af7b98decb99d710299d",
"src/browser/compound.ts": "3494dbb724b4a256910f9c6a660f46f3574c9a51ee98b6c386e2b13345c5f386",
"src/browser/config.ts": "7db653b44bd4d8c4b3e3ab2f74b892eac96b5d90d503dec29f6cf1f7fb5e199b",
"src/browser/daemon-client.ts": "742fd1c7c980de0f7d8785e0fe9a1ca8e930bab96d5651d4568d955c2f94e956",
@@ -1592,9 +1595,9 @@
"src/daemon.ts": "8000099c0f205fb1d9b500e8400ff900474c13c40295fd09bce7a38affce178b",
"src/discovery.ts": "797e8d6153ecd0b9df50d45a5bbbd997f0f74c33120c7a040ae457b241cfc98a",
"src/doctor.ts": "a05ee2f2c1413ffe98cffc66a8b35ed9879a6a55d70884c74ecc5986a53525ce",
- "src/download/article-download.ts": "0914f015a1a00c702b3ffddfdf9725f75738729849b8e22a5e8d4826fd9fd0f0",
- "src/download/index.ts": "fee1e6d57c878956fbd265db72079dbb9bc5561eae45528ece3bfbe16b5d7098",
- "src/download/media-download.ts": "e417e2dfd540f81827262ba8ce0a64af11756efe96263824f068f2fbe21e492e",
+ "src/download/article-download.ts": "45b48e3072990fac88e0aa5d60490d27a3b8504f577b42dd3ceda68c5408a509",
+ "src/download/index.ts": "0a3f6f1a8d934b848588a5ed73116282cf67f81e33abdb51c0d37e759f8a6572",
+ "src/download/media-download.ts": "3391cf1af9d3b39e0fa3c8768b90128a773b3f4eae9625b610cba886fb8d3fb1",
"src/download/progress.ts": "98f9ff046388d58f9347ed31fd26a9dc86d29e53d5ec9040ec47e34cae09608f",
"src/errors.ts": "21b26a6bdd9e1e5f44b09212709bdcfc8db5b8c6e8a84e02a3ada733a835afaf",
"src/execution.ts": "20bef8ef3984d326e7e2b207d18525ba70ed41113add904f73d2e6826d1feaaa",
@@ -1620,7 +1623,7 @@
"src/pipeline/index.ts": "c883e03a6f2460f49e61e3530c632ede2ab2afa1b6e9393353b21bdbf7ebeb0a",
"src/pipeline/registry.ts": "dc9d24bc5ccaecfbe919e6475b25f432ff1d8150d27abbbf255141aebfa49dbd",
"src/pipeline/steps/browser.ts": "b60aba9d9c7e5188b6420ed4e099ecfdbe23096a252a55664b7928734eb14944",
- "src/pipeline/steps/download.ts": "8a87ae725cf4d68e4dd623f3fe7fdae27efe97b6f912ab477bcfb09327dd359e",
+ "src/pipeline/steps/download.ts": "4f6642cc5c67366dc8fe0bf0e6ea9e70c85a0f474a2f22f30f936498463701bb",
"src/pipeline/steps/fetch.ts": "a9bdfe540cb8e61c2ed19aa13d393e286d07be6157406c8945d3135bba41dd5d",
"src/pipeline/steps/intercept.ts": "c45a26c974489f621fd932b513ea742efea1a7bb3746d4c10d8a110613068aa7",
"src/pipeline/steps/tap.ts": "7e4a5f80656931feb358b3d9a655f32c257ab2aaf749b532f5751e6fba48b964",
diff --git a/packages/opencli-vendor/cindy/host.ts b/packages/opencli-vendor/cindy/host.ts
index 76466fd1ca..3e28396389 100644
--- a/packages/opencli-vendor/cindy/host.ts
+++ b/packages/opencli-vendor/cindy/host.ts
@@ -1,5 +1,5 @@
import { AsyncLocalStorage } from "node:async_hooks";
-import { readFileSync, mkdirSync, mkdtempSync, rmSync, openSync, closeSync, fstatSync } from "node:fs";
+import { readFileSync, writeFileSync, mkdirSync, mkdtempSync, rmSync, openSync, closeSync, fstatSync } from "node:fs";
import { tmpdir } from 'node:os';
import { join, resolve, relative, isAbsolute, basename } from 'node:path';
@@ -16,6 +16,22 @@ export function recipeDiagnosticPath(name: string): string {
return join(recipeTemporaryDirectory(), basename(name));
}
+/** Both backends consume broker-approved bytes from invocation-owned copies. */
+export function stageRecipeUploadFiles(files: string[]): string[] {
+ if (!files.length || files.length > 20) throw new Error('Upload requires 1 to 20 files');
+ let total = 0;
+ return files.map((file) => {
+ const bytes = readRecipeFileSync(file);
+ total += bytes.length;
+ if (bytes.length > 100 * 1024 * 1024 || total > 500 * 1024 * 1024)
+ throw new Error('Upload byte limit exceeded');
+ const dir = mkdtempSync(join(recipeTemporaryDirectory(), 'upload-'));
+ const staged = join(dir, basename(file));
+ writeFileSync(staged, bytes, { mode: 0o600 });
+ return staged;
+ });
+}
+
export interface RecipeSecrets {
read(key: string): string | null;
write(key: string, value: string): boolean;
diff --git a/packages/opencli-vendor/cindy/patches.json b/packages/opencli-vendor/cindy/patches.json
index 266810d521..6a8a0a03e3 100644
--- a/packages/opencli-vendor/cindy/patches.json
+++ b/packages/opencli-vendor/cindy/patches.json
@@ -2727,5 +2727,467 @@
"before": " bodyTruncated: entry?.responseBodyTruncated === true,",
"after": " bodyTruncated: entry?.responseBodyTruncated === true,\n captureComplete: entry?.captureComplete,",
"count": 1
+ },
+ {
+ "file": "clis/mercury/utils.js",
+ "before": "import { resolveRecipePath }",
+ "after": "import { resolveRecipePath, statRecipeFileSync }",
+ "count": 1
+ },
+ {
+ "file": "clis/mercury/utils.js",
+ "before": "fs.statSync(resolveRecipePath(receipt), { throwIfNoEntry: false })",
+ "after": "statRecipeFileSync(receipt)",
+ "count": 1
+ },
+ {
+ "file": "clis/wechat-channels/publish.js",
+ "before": "import { resolveRecipePath }",
+ "after": "import { resolveRecipePath, statRecipeFileSync }",
+ "count": 1
+ },
+ {
+ "file": "clis/wechat-channels/publish.js",
+ "before": "fs.statSync(resolveRecipePath(resolved))",
+ "after": "statRecipeFileSync(resolved)",
+ "count": 1
+ },
+ {
+ "file": "clis/midjourney/utils.js",
+ "before": "import { recipeCopySource, recipeOutputPath, resolveRecipePath }",
+ "after": "import { recipeCopySource, recipeOutputPath, resolveRecipePath, statRecipeFileSync }",
+ "count": 1
+ },
+ {
+ "file": "clis/midjourney/utils.js",
+ "before": "await fs.stat(resolveRecipePath(ref.value))",
+ "after": "statRecipeFileSync(ref.value)",
+ "count": 1
+ },
+ {
+ "file": "src/download/index.ts",
+ "before": " maxRedirects?: number;",
+ "after": " maxRedirects?: number;\n maxBytes?: number;",
+ "count": 1
+ },
+ {
+ "file": "src/download/index.ts",
+ "before": "timeout = 30000, onProgress, maxRedirects = 10, includeContentType = false,",
+ "after": "timeout = 30000, onProgress, maxRedirects = 10, maxBytes = Infinity, includeContentType = false,",
+ "count": 1
+ },
+ {
+ "file": "src/download/index.ts",
+ "before": " const totalSize = parseInt(response.headers.get('content-length') || '0', 10);",
+ "after": " const totalSize = parseInt(response.headers.get('content-length') || '0', 10);\n if (totalSize > maxBytes) throw new Error('Download byte limit exceeded');",
+ "count": 1
+ },
+ {
+ "file": "src/download/index.ts",
+ "before": " received += chunk.length;\n if (onProgress) onProgress(received, totalSize);\n callback(null, chunk);",
+ "after": " try {\n if (received + chunk.length > maxBytes) throw new Error('Download byte limit exceeded');\n received += chunk.length;\n onProgress?.(received, totalSize);\n callback(null, chunk);\n } catch (error) {\n controller.abort();\n callback(error instanceof Error ? error : new Error(String(error)));\n }",
+ "count": 1
+ },
+ {
+ "file": "src/download/article-download.ts",
+ "before": "const IMAGE_CONCURRENCY = 5;",
+ "after": "const IMAGE_CONCURRENCY = 5;\nconst MAX_ARTICLE_IMAGES = 20;\nconst MAX_IMAGE_BYTES = 10 * 1024 * 1024;\nconst MAX_ARTICLE_IMAGE_BYTES = 50 * 1024 * 1024;",
+ "count": 1
+ },
+ {
+ "file": "src/download/article-download.ts",
+ "before": " const uniqueUrls = imgUrls.filter(url => {\n if (seen.has(url)) return false;\n seen.add(url);\n return true;\n });",
+ "after": " const uniqueUrls: string[] = [];\n for (const url of imgUrls) {\n if (seen.has(url)) continue;\n seen.add(url);\n uniqueUrls.push(url);\n if (uniqueUrls.length >= MAX_ARTICLE_IMAGES) break;\n }\n let receivedBytes = 0;",
+ "count": 1
+ },
+ {
+ "file": "src/download/article-download.ts",
+ "before": " try {\n const result = await httpDownload(imgUrl, guessedPath, {",
+ "after": " try {\n if (receivedBytes >= MAX_ARTICLE_IMAGE_BYTES) return null;\n let previous = 0;\n const result = await httpDownload(imgUrl, guessedPath, {",
+ "count": 1
+ },
+ {
+ "file": "src/download/article-download.ts",
+ "before": " timeout: 15000,\n includeContentType: requireContentType,",
+ "after": " timeout: 15000,\n maxBytes: MAX_IMAGE_BYTES,\n onProgress: (received) => {\n receivedBytes += received - previous;\n previous = received;\n if (receivedBytes > MAX_ARTICLE_IMAGE_BYTES) throw new Error('Article image byte limit exceeded');\n },\n includeContentType: requireContentType,",
+ "count": 1
+ },
+ {
+ "file": "clis/douyin/_shared/imagex-upload.js",
+ "before": "import { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "after": "import { recipeOutputPath } from '@jackwener/opencli/cindy/host';\nimport { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "clis/douyin/_shared/imagex-upload.js",
+ "before": "fs.existsSync(resolveRecipePath(imagePath))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(imagePath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/douyin/_shared/tos-upload.js",
+ "before": "fs.existsSync(resolveRecipePath(filePath))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(filePath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/douyin/_shared/tos-upload.js",
+ "before": "fs.statSync(resolveRecipePath(filePath))",
+ "after": "fs.statSync(recipeOutputPath(resolveRecipePath(filePath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/douyin/draft.js",
+ "before": "import { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "after": "import { recipeOutputPath } from '@jackwener/opencli/cindy/host';\nimport { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "clis/douyin/draft.js",
+ "before": "fs.existsSync(resolveRecipePath(videoPath))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(videoPath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/douyin/draft.js",
+ "before": "fs.existsSync(resolveRecipePath(resolveRecipePath(coverPath)))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(resolveRecipePath(coverPath))))",
+ "count": 1
+ },
+ {
+ "file": "clis/douyin/publish.js",
+ "before": "import { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "after": "import { recipeOutputPath } from '@jackwener/opencli/cindy/host';\nimport { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "clis/douyin/publish.js",
+ "before": "fs.existsSync(resolveRecipePath(videoPath))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(videoPath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/douyin/publish.js",
+ "before": "fs.statSync(resolveRecipePath(videoPath))",
+ "after": "fs.statSync(recipeOutputPath(resolveRecipePath(videoPath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/douyin/publish.js",
+ "before": "fs.existsSync(resolveRecipePath(resolveRecipePath(coverPath)))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(resolveRecipePath(coverPath))))",
+ "count": 1
+ },
+ {
+ "file": "clis/instagram/_shared/private-publish.js",
+ "before": "fs.existsSync(resolveRecipePath(outputPath))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(outputPath)))",
+ "count": 2
+ },
+ {
+ "file": "clis/instagram/post.js",
+ "before": "fs.existsSync(resolveRecipePath(resolved))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(resolved)))",
+ "count": 1
+ },
+ {
+ "file": "clis/instagram/reel.js",
+ "before": "fs.existsSync(resolveRecipePath(resolved))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(resolved)))",
+ "count": 1
+ },
+ {
+ "file": "clis/instagram/story.js",
+ "before": "import { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "after": "import { recipeOutputPath } from '@jackwener/opencli/cindy/host';\nimport { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "clis/instagram/story.js",
+ "before": "fs.existsSync(resolveRecipePath(resolved))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(resolved)))",
+ "count": 1
+ },
+ {
+ "file": "clis/midjourney/utils.js",
+ "before": "fs.stat(resolveRecipePath(filePath))",
+ "after": "fs.stat(recipeOutputPath(resolveRecipePath(filePath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/midjourney/utils.js",
+ "before": "fs.stat(resolveRecipePath(sourcePath))",
+ "after": "fs.stat(recipeOutputPath(resolveRecipePath(sourcePath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/minimax/utils.js",
+ "before": "fs.statSync(resolveRecipePath(dir))",
+ "after": "fs.statSync(recipeOutputPath(resolveRecipePath(dir)))",
+ "count": 1
+ },
+ {
+ "file": "clis/minimax/utils.js",
+ "before": "fs.accessSync(resolveRecipePath(dir), fs.constants.W_OK)",
+ "after": "fs.accessSync(recipeOutputPath(resolveRecipePath(dir)), fs.constants.W_OK)",
+ "count": 1
+ },
+ {
+ "file": "clis/minimax/utils.js",
+ "before": "fs.existsSync(resolveRecipePath(target))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(target)))",
+ "count": 2
+ },
+ {
+ "file": "clis/notebooklm/add-source.js",
+ "before": "import { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "after": "import { recipeOutputPath } from '@jackwener/opencli/cindy/host';\nimport { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "clis/notebooklm/add-source.js",
+ "before": "fs.statSync(resolveRecipePath(abs))",
+ "after": "fs.statSync(recipeOutputPath(resolveRecipePath(abs)))",
+ "count": 1
+ },
+ {
+ "file": "clis/paperreview/utils.js",
+ "before": "import { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "after": "import { recipeOutputPath } from '@jackwener/opencli/cindy/host';\nimport { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "clis/paperreview/utils.js",
+ "before": "fs.stat(resolveRecipePath(resolvedPath))",
+ "after": "fs.stat(recipeOutputPath(resolveRecipePath(resolvedPath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/pixiv/bookmark-download.js",
+ "before": "fs.existsSync(resolveRecipePath(cursor))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(cursor)))",
+ "count": 1
+ },
+ {
+ "file": "clis/pixiv/bookmark-download.js",
+ "before": "fs.lstatSync(resolveRecipePath(destination))",
+ "after": "fs.lstatSync(recipeOutputPath(resolveRecipePath(destination)))",
+ "count": 1
+ },
+ {
+ "file": "clis/pixiv/novel-download-utils.js",
+ "before": "fs.lstatSync(resolveRecipePath(ancestor))",
+ "after": "fs.lstatSync(recipeOutputPath(resolveRecipePath(ancestor)))",
+ "count": 1
+ },
+ {
+ "file": "clis/pixiv/novel-download-utils.js",
+ "before": "fs.statSync(resolveRecipePath(canonicalAncestor))",
+ "after": "fs.statSync(recipeOutputPath(resolveRecipePath(canonicalAncestor)))",
+ "count": 1
+ },
+ {
+ "file": "clis/pixiv/novel-download-utils.js",
+ "before": "fs.lstatSync(resolveRecipePath(target))",
+ "after": "fs.lstatSync(recipeOutputPath(resolveRecipePath(target)))",
+ "count": 1
+ },
+ {
+ "file": "clis/pixiv/novel-download-utils.js",
+ "before": "fs.existsSync(resolveRecipePath(cursor))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(cursor)))",
+ "count": 1
+ },
+ {
+ "file": "clis/suno/utils.js",
+ "before": "fs.statSync(resolveRecipePath(filePath))",
+ "after": "fs.statSync(recipeOutputPath(resolveRecipePath(filePath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/twitter/archive.js",
+ "before": "fs.existsSync(resolveRecipePath(filePath))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(filePath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/twitter/bookmarks.js",
+ "before": "fs.existsSync(resolveRecipePath(filePath))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(filePath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/twitter/bookmarks.js",
+ "before": "fs.existsSync(resolveRecipePath(outputFile))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(outputFile)))",
+ "count": 2
+ },
+ {
+ "file": "clis/twitter/likes.js",
+ "before": "fs.existsSync(resolveRecipePath(filePath))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(filePath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/twitter/likes.js",
+ "before": "fs.existsSync(resolveRecipePath(outputFile))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(outputFile)))",
+ "count": 2
+ },
+ {
+ "file": "clis/twitter/post.js",
+ "before": "import { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "after": "import { recipeOutputPath } from '@jackwener/opencli/cindy/host';\nimport { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "clis/twitter/post.js",
+ "before": "fs.statSync(resolveRecipePath(absPath), { throwIfNoEntry: false })",
+ "after": "fs.statSync(recipeOutputPath(resolveRecipePath(absPath)), { throwIfNoEntry: false })",
+ "count": 1
+ },
+ {
+ "file": "clis/twitter/utils.js",
+ "before": "fs.existsSync(resolveRecipePath(absPath))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(absPath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/twitter/utils.js",
+ "before": "fs.statSync(resolveRecipePath(absPath))",
+ "after": "fs.statSync(recipeOutputPath(resolveRecipePath(absPath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/weibo/publish.js",
+ "before": "import { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "after": "import { recipeOutputPath } from '@jackwener/opencli/cindy/host';\nimport { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "clis/weibo/publish.js",
+ "before": "fs.statSync(resolveRecipePath(absPath), { throwIfNoEntry: false })",
+ "after": "fs.statSync(recipeOutputPath(resolveRecipePath(absPath)), { throwIfNoEntry: false })",
+ "count": 1
+ },
+ {
+ "file": "clis/weixin/create-draft.js",
+ "before": "import { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "after": "import { recipeOutputPath } from '@jackwener/opencli/cindy/host';\nimport { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "clis/weixin/create-draft.js",
+ "before": "fs.statSync(resolveRecipePath(absPath))",
+ "after": "fs.statSync(recipeOutputPath(resolveRecipePath(absPath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/xianyu/publish.js",
+ "before": "import { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "after": "import { recipeOutputPath } from '@jackwener/opencli/cindy/host';\nimport { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "clis/xianyu/publish.js",
+ "before": "fs.statSync(resolveRecipePath(absPath), { throwIfNoEntry: false })",
+ "after": "fs.statSync(recipeOutputPath(resolveRecipePath(absPath)), { throwIfNoEntry: false })",
+ "count": 1
+ },
+ {
+ "file": "clis/xiaohongshu/publish.js",
+ "before": "import { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "after": "import { recipeOutputPath } from '@jackwener/opencli/cindy/host';\nimport { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "clis/xiaohongshu/publish.js",
+ "before": "fs.existsSync(resolveRecipePath(absPath))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(absPath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/yollomi/upload.js",
+ "before": "import { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "after": "import { recipeOutputPath } from '@jackwener/opencli/cindy/host';\nimport { resolveRecipePath } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "clis/yollomi/upload.js",
+ "before": "fs.existsSync(resolveRecipePath(filePath))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(filePath)))",
+ "count": 1
+ },
+ {
+ "file": "clis/yollomi/utils.js",
+ "before": "fs.existsSync(resolveRecipePath(resolved))",
+ "after": "fs.existsSync(recipeOutputPath(resolveRecipePath(resolved)))",
+ "count": 1
+ },
+ {
+ "file": "src/download/index.ts",
+ "before": "fs.statSync(resolveRecipePath(destPath))",
+ "after": "fs.statSync(recipeOutputPath(destPath))",
+ "count": 1
+ },
+ {
+ "file": "src/download/index.ts",
+ "before": "fs.statSync(resolveRecipePath(actualFile))",
+ "after": "fs.statSync(recipeOutputPath(actualFile))",
+ "count": 1
+ },
+ {
+ "file": "src/download/index.ts",
+ "before": "fs.readdirSync(resolveRecipePath(dir))",
+ "after": "fs.readdirSync(recipeOutputPath(dir))",
+ "count": 1
+ },
+ {
+ "file": "src/download/index.ts",
+ "before": "fs.existsSync(resolveRecipePath(destPath))",
+ "after": "fs.existsSync(recipeOutputPath(destPath))",
+ "count": 1
+ },
+ {
+ "file": "src/download/media-download.ts",
+ "before": "fs.existsSync(resolveRecipePath(cookiesFile))",
+ "after": "fs.existsSync(recipeOutputPath(cookiesFile))",
+ "count": 1
+ },
+ {
+ "file": "src/browser/cdp.ts",
+ "before": "import { readFileSync, statSync } from 'node:fs';",
+ "after": "import { readRecipeFileSync as readFileSync, statRecipeFileSync as statSync } from '@jackwener/opencli/cindy/host';",
+ "count": 1
+ },
+ {
+ "file": "src/pipeline/steps/download.ts",
+ "before": "fs.existsSync(resolveRecipePath(destPath))",
+ "after": "fs.existsSync(recipeOutputPath(destPath))",
+ "count": 1
+ },
+ {
+ "file": "src/pipeline/steps/download.ts",
+ "before": "fs.existsSync(resolveRecipePath(cookiesFile))",
+ "after": "fs.existsSync(recipeOutputPath(cookiesFile))",
+ "count": 1
+ },
+ {
+ "file": "src/pipeline/steps/download.ts",
+ "before": "fs.statSync(resolveRecipePath(destPath))",
+ "after": "fs.statSync(recipeOutputPath(destPath))",
+ "count": 1
+ },
+ {
+ "file": "clis/chatgpt/image.js",
+ "before": "import { resolveRecipePath }",
+ "after": "import { resolveRecipePath, recipeOutputPath }",
+ "count": 1
+ },
+ {
+ "file": "clis/chatgpt/image.js",
+ "before": "existsSync = fs.existsSync",
+ "after": "existsSync = (file) => fs.existsSync(recipeOutputPath(file))",
+ "count": 1
}
]
diff --git a/packages/opencli-vendor/clis/chatgpt/image.js b/packages/opencli-vendor/clis/chatgpt/image.js
index 926336ce55..6bcfd8cbac 100644
--- a/packages/opencli-vendor/clis/chatgpt/image.js
+++ b/packages/opencli-vendor/clis/chatgpt/image.js
@@ -1,4 +1,4 @@
-import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
+import { resolveRecipePath, recipeOutputPath } from '@jackwener/opencli/cindy/host';
import * as os from 'node:os';
import * as path from 'node:path';
import * as fs from 'node:fs';
@@ -29,7 +29,7 @@ export function resolveOutputDir(value) {
return resolveRecipePath(raw);
}
-export function nextAvailablePath(dir, baseName, ext, existsSync = fs.existsSync) {
+export function nextAvailablePath(dir, baseName, ext, existsSync = (file) => fs.existsSync(recipeOutputPath(file))) {
let candidate = path.join(dir, `${baseName}${ext}`);
for (let index = 1; existsSync(candidate); index += 1) {
candidate = path.join(dir, `${baseName}_${index}${ext}`);
diff --git a/packages/opencli-vendor/clis/douyin/_shared/imagex-upload.js b/packages/opencli-vendor/clis/douyin/_shared/imagex-upload.js
index 421902b02e..42ebdb527f 100644
--- a/packages/opencli-vendor/clis/douyin/_shared/imagex-upload.js
+++ b/packages/opencli-vendor/clis/douyin/_shared/imagex-upload.js
@@ -1,3 +1,4 @@
+import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
import { readRecipeFileSync } from '@jackwener/opencli/cindy/host';
/**
@@ -34,7 +35,7 @@ function detectContentType(filePath) {
* @returns The store_uri (= image_uri for use in create_v2)
*/
export async function imagexUpload(imagePath, uploadInfo) {
- if (!fs.existsSync(resolveRecipePath(imagePath))) {
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(imagePath)))) {
throw new CommandExecutionError(`Cover image file not found: ${imagePath}`, 'Ensure the file path is correct and accessible.');
}
const imageBuffer = readRecipeFileSync(imagePath);
diff --git a/packages/opencli-vendor/clis/douyin/_shared/tos-upload.js b/packages/opencli-vendor/clis/douyin/_shared/tos-upload.js
index eefc29ae0a..25979fb9b7 100644
--- a/packages/opencli-vendor/clis/douyin/_shared/tos-upload.js
+++ b/packages/opencli-vendor/clis/douyin/_shared/tos-upload.js
@@ -267,10 +267,10 @@ export function setReadSyncOverride(fn) {
export async function tosUpload(options) {
const { filePath, uploadInfo, credentials, onProgress } = options;
// Validate file exists
- if (!fs.existsSync(resolveRecipePath(filePath))) {
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(filePath)))) {
throw new CommandExecutionError(`Video file not found: ${filePath}`, 'Ensure the file path is correct and accessible.');
}
- const { size: fileSize } = fs.statSync(resolveRecipePath(filePath));
+ const { size: fileSize } = fs.statSync(recipeOutputPath(resolveRecipePath(filePath)));
if (fileSize === 0) {
throw new CommandExecutionError(`Video file is empty: ${filePath}`);
}
diff --git a/packages/opencli-vendor/clis/douyin/draft.js b/packages/opencli-vendor/clis/douyin/draft.js
index 600127e6c9..f3aa370dcc 100644
--- a/packages/opencli-vendor/clis/douyin/draft.js
+++ b/packages/opencli-vendor/clis/douyin/draft.js
@@ -5,6 +5,7 @@
* matches creator center's live upload flow. This command now drives the
* official upload page directly so it stays aligned with the site.
*/
+import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
import * as fs from 'node:fs';
import * as path from 'node:path';
@@ -306,7 +307,7 @@ cli({
columns: ['status', 'draft_id'],
func: async (page, kwargs) => {
const videoPath = resolveRecipePath(kwargs.video);
- if (!fs.existsSync(resolveRecipePath(videoPath))) {
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(videoPath)))) {
throw new ArgumentError(`视频文件不存在: ${videoPath}`);
}
const ext = path.extname(videoPath).toLowerCase();
@@ -323,7 +324,7 @@ cli({
}
const coverPath = kwargs.cover;
if (coverPath) {
- if (!fs.existsSync(resolveRecipePath(resolveRecipePath(coverPath)))) {
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(resolveRecipePath(coverPath))))) {
throw new ArgumentError(`封面文件不存在: ${resolveRecipePath(coverPath)}`);
}
}
diff --git a/packages/opencli-vendor/clis/douyin/publish.js b/packages/opencli-vendor/clis/douyin/publish.js
index cc6978a76c..b3ee67971d 100644
--- a/packages/opencli-vendor/clis/douyin/publish.js
+++ b/packages/opencli-vendor/clis/douyin/publish.js
@@ -11,6 +11,7 @@
* 7. Content safety check
* 8. create_v2 publish
*/
+import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
import * as fs from 'node:fs';
import * as path from 'node:path';
@@ -112,14 +113,14 @@ cli({
func: async (page, kwargs) => {
// ── Fail-fast validation ────────────────────────────────────────────
const videoPath = resolveRecipePath(kwargs.video);
- if (!fs.existsSync(resolveRecipePath(videoPath))) {
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(videoPath)))) {
throw new ArgumentError(`视频文件不存在: ${videoPath}`);
}
const ext = path.extname(videoPath).toLowerCase();
if (!['.mp4', '.mov', '.avi', '.webm'].includes(ext)) {
throw new ArgumentError(`不支持的视频格式: ${ext}(支持 mp4/mov/avi/webm)`);
}
- const fileSize = fs.statSync(resolveRecipePath(videoPath)).size;
+ const fileSize = fs.statSync(recipeOutputPath(resolveRecipePath(videoPath))).size;
const title = kwargs.title;
if (title.length > 30) {
throw new ArgumentError('标题不能超过 30 字');
@@ -133,7 +134,7 @@ cli({
const visibilityType = VISIBILITY_MAP[kwargs.visibility] ?? 0;
const coverPath = kwargs.cover;
if (coverPath) {
- if (!fs.existsSync(resolveRecipePath(resolveRecipePath(coverPath)))) {
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(resolveRecipePath(coverPath))))) {
throw new ArgumentError(`封面文件不存在: ${resolveRecipePath(coverPath)}`);
}
}
diff --git a/packages/opencli-vendor/clis/instagram/_shared/private-publish.js b/packages/opencli-vendor/clis/instagram/_shared/private-publish.js
index c4952275e7..fca1bbe146 100644
--- a/packages/opencli-vendor/clis/instagram/_shared/private-publish.js
+++ b/packages/opencli-vendor/clis/instagram/_shared/private-publish.js
@@ -353,7 +353,7 @@ export function prepareImageAssetForPrivateUpload(filePath) {
], {
encoding: 'utf8',
});
- if (result.error || result.status !== 0 || !fs.existsSync(resolveRecipePath(outputPath))) {
+ if (result.error || result.status !== 0 || !fs.existsSync(recipeOutputPath(resolveRecipePath(outputPath)))) {
const detail = [result.error?.message, result.stderr, result.stdout]
.map((value) => String(value || '').trim())
.filter(Boolean)
@@ -387,7 +387,7 @@ export function prepareImageAssetForPrivateStoryUpload(filePath) {
], {
encoding: 'utf8',
});
- if (result.error || result.status !== 0 || !fs.existsSync(resolveRecipePath(outputPath))) {
+ if (result.error || result.status !== 0 || !fs.existsSync(recipeOutputPath(resolveRecipePath(outputPath)))) {
const detail = [result.error?.message, result.stderr, result.stdout]
.map((value) => String(value || '').trim())
.filter(Boolean)
diff --git a/packages/opencli-vendor/clis/instagram/post.js b/packages/opencli-vendor/clis/instagram/post.js
index 8a4cb4d7aa..8f0657e060 100644
--- a/packages/opencli-vendor/clis/instagram/post.js
+++ b/packages/opencli-vendor/clis/instagram/post.js
@@ -98,7 +98,7 @@ function validateMixedMediaItems(inputs) {
if (!resolved) {
throw new ArgumentError('Media path cannot be empty');
}
- if (!fs.existsSync(resolveRecipePath(resolved))) {
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(resolved)))) {
throw new ArgumentError(`Media file not found: ${resolved}`);
}
const ext = path.extname(resolved).toLowerCase();
diff --git a/packages/opencli-vendor/clis/instagram/reel.js b/packages/opencli-vendor/clis/instagram/reel.js
index 7abe94902c..846b695889 100644
--- a/packages/opencli-vendor/clis/instagram/reel.js
+++ b/packages/opencli-vendor/clis/instagram/reel.js
@@ -20,7 +20,7 @@ function validateVideoPath(input) {
if (!resolved) {
throw new ArgumentError('Video path cannot be empty');
}
- if (!fs.existsSync(resolveRecipePath(resolved))) {
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(resolved)))) {
throw new ArgumentError(`Video file not found: ${resolved}`);
}
const ext = path.extname(resolved).toLowerCase();
diff --git a/packages/opencli-vendor/clis/instagram/story.js b/packages/opencli-vendor/clis/instagram/story.js
index 364f51326a..f45848f1bc 100644
--- a/packages/opencli-vendor/clis/instagram/story.js
+++ b/packages/opencli-vendor/clis/instagram/story.js
@@ -1,3 +1,4 @@
+import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
import * as fs from 'node:fs';
import * as path from 'node:path';
@@ -28,7 +29,7 @@ function normalizeStoryMediaItem(kwargs) {
throw new ArgumentError('Instagram story currently supports a single media item.', 'Provide one image or one video path with --media');
}
const resolved = resolveRecipePath(parts[0]);
- if (!fs.existsSync(resolveRecipePath(resolved))) {
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(resolved)))) {
throw new ArgumentError(`Story media file not found: ${resolved}`);
}
const ext = path.extname(resolved).toLowerCase();
diff --git a/packages/opencli-vendor/clis/mercury/utils.js b/packages/opencli-vendor/clis/mercury/utils.js
index 9820225e7f..7ac79aafa3 100644
--- a/packages/opencli-vendor/clis/mercury/utils.js
+++ b/packages/opencli-vendor/clis/mercury/utils.js
@@ -1,4 +1,4 @@
-import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
+import { resolveRecipePath, statRecipeFileSync } from '@jackwener/opencli/cindy/host';
import fs from 'node:fs';
import path from 'node:path';
import { ArgumentError, AuthRequiredError, CommandExecutionError } from '@jackwener/opencli/errors';
@@ -36,7 +36,7 @@ function parseReceiptPath(kwargs) {
const receipt = resolveRecipePath(requireString(kwargs, 'receipt'));
let stat;
try {
- stat = fs.statSync(resolveRecipePath(receipt), { throwIfNoEntry: false });
+ stat = statRecipeFileSync(receipt);
}
catch (error) {
throw new ArgumentError(`Receipt file cannot be read: ${receipt}`, error instanceof Error ? error.message : undefined);
diff --git a/packages/opencli-vendor/clis/midjourney/utils.js b/packages/opencli-vendor/clis/midjourney/utils.js
index 4aadee2491..554016c3b8 100644
--- a/packages/opencli-vendor/clis/midjourney/utils.js
+++ b/packages/opencli-vendor/clis/midjourney/utils.js
@@ -1,4 +1,4 @@
-import { recipeCopySource, recipeOutputPath, resolveRecipePath } from '@jackwener/opencli/cindy/host';
+import { recipeCopySource, recipeOutputPath, resolveRecipePath, statRecipeFileSync } from '@jackwener/opencli/cindy/host';
import { readRecipeFileSync } from '@jackwener/opencli/cindy/host';
import {
ArgumentError,
@@ -650,7 +650,7 @@ function sniffMediaMime(buffer) {
async function existingMedia(filePath, force, expectedMime) {
if (force) return null;
try {
- const stat = await fs.stat(resolveRecipePath(filePath));
+ const stat = await fs.stat(recipeOutputPath(resolveRecipePath(filePath)));
if (!stat.isFile() || stat.size <= 0) return null;
const handle = await fs.open(recipeCopySource(filePath), 'r');
try {
@@ -809,7 +809,7 @@ export async function downloadRenderedVideo(page, jobId, index, kind, outputDir,
throw new CommandExecutionError(`Midjourney ${kind} download did not complete: ${downloaded?.error || downloaded?.state || 'unknown'}`);
}
const sourcePath = resolveRecipePath(String(downloaded.filename));
- const sourceStat = await fs.stat(resolveRecipePath(sourcePath)).catch(() => null);
+ const sourceStat = await fs.stat(recipeOutputPath(resolveRecipePath(sourcePath))).catch(() => null);
if (!sourceStat?.isFile() || sourceStat.size <= 0) {
throw new CommandExecutionError(`Browser reported a completed download but the file is missing: ${sourcePath}`);
}
@@ -954,7 +954,7 @@ export async function validateLocalReferences(refs, label) {
for (const ref of refs.filter((item) => item.kind === 'local')) {
let stat;
try {
- stat = await fs.stat(resolveRecipePath(ref.value));
+ stat = statRecipeFileSync(ref.value);
} catch {
throw new ArgumentError(`${label} file does not exist: ${ref.value}`);
}
diff --git a/packages/opencli-vendor/clis/minimax/utils.js b/packages/opencli-vendor/clis/minimax/utils.js
index b837414c4a..dc0e6955a4 100644
--- a/packages/opencli-vendor/clis/minimax/utils.js
+++ b/packages/opencli-vendor/clis/minimax/utils.js
@@ -184,11 +184,11 @@ export function reserveAudioFile(dir, model, format, now = new Date()) {
const staging = `${target}.${process.pid}.${randomUUID()}.tmp`;
try {
fs.mkdirSync(recipeOutputPath(dir), { recursive: true });
- if (!fs.statSync(resolveRecipePath(dir)).isDirectory()) throw new Error('not a directory');
- fs.accessSync(resolveRecipePath(dir), fs.constants.W_OK);
- if (fs.existsSync(resolveRecipePath(target))) throw new Error('target already exists');
+ if (!fs.statSync(recipeOutputPath(resolveRecipePath(dir))).isDirectory()) throw new Error('not a directory');
+ fs.accessSync(recipeOutputPath(resolveRecipePath(dir)), fs.constants.W_OK);
+ if (fs.existsSync(recipeOutputPath(resolveRecipePath(target)))) throw new Error('target already exists');
fs.writeFileSync(recipeOutputPath(lock), String(process.pid), { flag: 'wx', mode: 0o600 });
- if (fs.existsSync(resolveRecipePath(target))) {
+ if (fs.existsSync(recipeOutputPath(resolveRecipePath(target)))) {
fs.rmSync(recipeOutputPath(lock), { force: true });
throw new Error('target appeared during reservation');
}
diff --git a/packages/opencli-vendor/clis/notebooklm/add-source.js b/packages/opencli-vendor/clis/notebooklm/add-source.js
index 07fe7af33f..9b6a0a3eeb 100644
--- a/packages/opencli-vendor/clis/notebooklm/add-source.js
+++ b/packages/opencli-vendor/clis/notebooklm/add-source.js
@@ -1,3 +1,4 @@
+import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
import { readRecipeFileSync } from '@jackwener/opencli/cindy/host';
import * as fs from 'node:fs';
@@ -42,7 +43,7 @@ export function readFileForUpload(filePath) {
const abs = resolveRecipePath(filePath);
let stat;
try {
- stat = fs.statSync(resolveRecipePath(abs));
+ stat = fs.statSync(recipeOutputPath(resolveRecipePath(abs)));
} catch {
throw new ArgumentError(`--file path does not exist: ${filePath}`);
}
diff --git a/packages/opencli-vendor/clis/paperreview/utils.js b/packages/opencli-vendor/clis/paperreview/utils.js
index 84a85ee0e0..6540d2e6b4 100644
--- a/packages/opencli-vendor/clis/paperreview/utils.js
+++ b/packages/opencli-vendor/clis/paperreview/utils.js
@@ -1,3 +1,4 @@
+import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
import { readRecipeFileSync } from '@jackwener/opencli/cindy/host';
import fs from 'node:fs/promises';
@@ -60,7 +61,7 @@ export async function readPdfFile(inputPath) {
}
let fileStat;
try {
- fileStat = await fs.stat(resolveRecipePath(resolvedPath));
+ fileStat = await fs.stat(recipeOutputPath(resolveRecipePath(resolvedPath)));
}
catch (error) {
if (error?.code === 'ENOENT') {
diff --git a/packages/opencli-vendor/clis/pixiv/bookmark-download.js b/packages/opencli-vendor/clis/pixiv/bookmark-download.js
index b30bd6c04f..12adc056c2 100644
--- a/packages/opencli-vendor/clis/pixiv/bookmark-download.js
+++ b/packages/opencli-vendor/clis/pixiv/bookmark-download.js
@@ -73,7 +73,7 @@ async function prepareIllustPlan(page, row, outputRoot) {
throw new CommandExecutionError(`Refusing to overwrite existing Pixiv download: ${finalPath}`);
}
const createdDirs = [];
- for (let cursor = path.dirname(finalPath); !fs.existsSync(resolveRecipePath(cursor)); cursor = path.dirname(cursor)) {
+ for (let cursor = path.dirname(finalPath); !fs.existsSync(recipeOutputPath(resolveRecipePath(cursor))); cursor = path.dirname(cursor)) {
createdDirs.push(cursor);
if (path.dirname(cursor) === cursor) break;
}
@@ -105,7 +105,7 @@ async function commitIllustPlan(plan, cookies) {
includeContentType: true,
});
validateImageDownload(result, file);
- const stat = fs.lstatSync(resolveRecipePath(destination));
+ const stat = fs.lstatSync(recipeOutputPath(resolveRecipePath(destination)));
if (stat.isSymbolicLink() || !stat.isFile() || stat.size <= 0) {
throw new CommandExecutionError(`Pixiv image download did not create a valid file: ${file.filename}`);
}
diff --git a/packages/opencli-vendor/clis/pixiv/novel-download-utils.js b/packages/opencli-vendor/clis/pixiv/novel-download-utils.js
index d938898d98..b21aa4eabf 100644
--- a/packages/opencli-vendor/clis/pixiv/novel-download-utils.js
+++ b/packages/opencli-vendor/clis/pixiv/novel-download-utils.js
@@ -70,7 +70,7 @@ export function normalizePixivOutputRoot(value, fallback) {
let ancestorStat;
while (!ancestorStat) {
try {
- ancestorStat = fs.lstatSync(resolveRecipePath(ancestor));
+ ancestorStat = fs.lstatSync(recipeOutputPath(resolveRecipePath(ancestor)));
} catch (error) {
if (error?.code !== 'ENOENT') {
throw new ArgumentError(`output path is not a safe directory: ${ancestor}`);
@@ -92,7 +92,7 @@ export function normalizePixivOutputRoot(value, fallback) {
} catch {
throw new ArgumentError(`output path is not a safe directory: ${ancestor}`);
}
- if (!fs.statSync(resolveRecipePath(canonicalAncestor)).isDirectory()) {
+ if (!fs.statSync(recipeOutputPath(resolveRecipePath(canonicalAncestor))).isDirectory()) {
throw new ArgumentError(`output path is not a safe directory: ${ancestor}`);
}
return path.join(canonicalAncestor, ...missingParts);
@@ -100,7 +100,7 @@ export function normalizePixivOutputRoot(value, fallback) {
export function pixivPathEntryExists(target) {
try {
- fs.lstatSync(resolveRecipePath(target));
+ fs.lstatSync(recipeOutputPath(resolveRecipePath(target)));
return true;
} catch (error) {
if (error?.code === 'ENOENT') return false;
@@ -161,7 +161,7 @@ export function prepareNovelFile(body, output, format) {
throw new CommandExecutionError(`Refusing to overwrite existing Pixiv download: ${destPath}`);
}
const createdDirs = [];
- for (let cursor = outputDir; !fs.existsSync(resolveRecipePath(cursor)); cursor = path.dirname(cursor)) {
+ for (let cursor = outputDir; !fs.existsSync(recipeOutputPath(resolveRecipePath(cursor))); cursor = path.dirname(cursor)) {
createdDirs.push(cursor);
if (path.dirname(cursor) === cursor) break;
}
diff --git a/packages/opencli-vendor/clis/suno/utils.js b/packages/opencli-vendor/clis/suno/utils.js
index 181e05d0b6..8a24bf1278 100644
--- a/packages/opencli-vendor/clis/suno/utils.js
+++ b/packages/opencli-vendor/clis/suno/utils.js
@@ -495,7 +495,7 @@ async function writeFromDataUrl(page, url, filePath) {
return { ok: false, reason: 'empty response body' };
}
fs.writeFileSync(recipeOutputPath(filePath), Buffer.from(base64, 'base64'));
- if (!fs.statSync(resolveRecipePath(filePath)).size) {
+ if (!fs.statSync(recipeOutputPath(resolveRecipePath(filePath))).size) {
return { ok: false, reason: 'empty file written' };
}
return { ok: true };
diff --git a/packages/opencli-vendor/clis/twitter/archive.js b/packages/opencli-vendor/clis/twitter/archive.js
index 7cee2105b1..b8b3a0b2ba 100644
--- a/packages/opencli-vendor/clis/twitter/archive.js
+++ b/packages/opencli-vendor/clis/twitter/archive.js
@@ -36,7 +36,7 @@ function removeFile(filePath) {
export function loadJsonlArchiveState(filePath) {
const seen = new Set();
let count = 0;
- if (!filePath || !fs.existsSync(resolveRecipePath(filePath)))
+ if (!filePath || !fs.existsSync(recipeOutputPath(resolveRecipePath(filePath))))
return { seen, count };
const text = readRecipeFileSync(filePath, 'utf8');
for (const [index, line] of text.split('\n').entries()) {
diff --git a/packages/opencli-vendor/clis/twitter/bookmarks.js b/packages/opencli-vendor/clis/twitter/bookmarks.js
index 07b448eb07..4dac21cff3 100644
--- a/packages/opencli-vendor/clis/twitter/bookmarks.js
+++ b/packages/opencli-vendor/clis/twitter/bookmarks.js
@@ -109,7 +109,7 @@ export function parseBookmarks(data, seen) {
return { tweets, nextCursor, hasTimelineItems };
}
function readResumeFile(filePath, expected = null) {
- if (!filePath || !fs.existsSync(resolveRecipePath(filePath)))
+ if (!filePath || !fs.existsSync(recipeOutputPath(resolveRecipePath(filePath))))
return null;
let parsed;
try {
@@ -222,10 +222,10 @@ cli({
source: 'bookmarks',
outputFile: useOutputFile ? outputFile : null,
}) : null;
- if (useOutputFile && resumed && resumed.count > 0 && !fs.existsSync(resolveRecipePath(outputFile))) {
+ if (useOutputFile && resumed && resumed.count > 0 && !fs.existsSync(recipeOutputPath(resolveRecipePath(outputFile)))) {
throw new CommandExecutionError(`Twitter bookmarks output file is missing for resume state: ${outputFile}`);
}
- if (useOutputFile && !resumed && fs.existsSync(resolveRecipePath(outputFile))) {
+ if (useOutputFile && !resumed && fs.existsSync(recipeOutputPath(resolveRecipePath(outputFile)))) {
throw new ArgumentError(`Refusing to overwrite existing Twitter bookmarks output file: ${outputFile}`);
}
const allTweets = useOutputFile ? [] : (resumed?.tweets ? [...resumed.tweets] : []);
diff --git a/packages/opencli-vendor/clis/twitter/likes.js b/packages/opencli-vendor/clis/twitter/likes.js
index 8eaaf607b6..a109585e8e 100644
--- a/packages/opencli-vendor/clis/twitter/likes.js
+++ b/packages/opencli-vendor/clis/twitter/likes.js
@@ -124,7 +124,7 @@ function parseLikes(data, seen) {
return { tweets, nextCursor, hasTimelineItems };
}
function readResumeFile(filePath, expected = null) {
- if (!filePath || !fs.existsSync(resolveRecipePath(filePath)))
+ if (!filePath || !fs.existsSync(recipeOutputPath(resolveRecipePath(filePath))))
return null;
let parsed;
try {
@@ -279,10 +279,10 @@ cli({
username,
outputFile: useOutputFile ? outputFile : null,
}) : null;
- if (useOutputFile && resumed && resumed.count > 0 && !fs.existsSync(resolveRecipePath(outputFile))) {
+ if (useOutputFile && resumed && resumed.count > 0 && !fs.existsSync(recipeOutputPath(resolveRecipePath(outputFile)))) {
throw new CommandExecutionError(`Twitter likes output file is missing for resume state: ${outputFile}`);
}
- if (useOutputFile && !resumed && fs.existsSync(resolveRecipePath(outputFile))) {
+ if (useOutputFile && !resumed && fs.existsSync(recipeOutputPath(resolveRecipePath(outputFile)))) {
throw new ArgumentError(`Refusing to overwrite existing Twitter likes output file: ${outputFile}`);
}
const allTweets = useOutputFile ? [] : (resumed?.tweets ? [...resumed.tweets] : []);
diff --git a/packages/opencli-vendor/clis/twitter/post.js b/packages/opencli-vendor/clis/twitter/post.js
index aaa24d004e..0c013ab11d 100644
--- a/packages/opencli-vendor/clis/twitter/post.js
+++ b/packages/opencli-vendor/clis/twitter/post.js
@@ -1,3 +1,4 @@
+import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
import { readRecipeFileSync } from '@jackwener/opencli/cindy/host';
import * as fs from 'node:fs';
@@ -29,7 +30,7 @@ function validateImagePaths(raw) {
if (!SUPPORTED_EXTENSIONS.has(ext)) {
throw new CommandExecutionError(`Unsupported image format "${ext}". Supported: jpg, png, gif, webp`);
}
- const stat = fs.statSync(resolveRecipePath(absPath), { throwIfNoEntry: false });
+ const stat = fs.statSync(recipeOutputPath(resolveRecipePath(absPath)), { throwIfNoEntry: false });
if (!stat || !stat.isFile()) {
throw new CommandExecutionError(`Not a valid file: ${absPath}`);
}
diff --git a/packages/opencli-vendor/clis/twitter/utils.js b/packages/opencli-vendor/clis/twitter/utils.js
index 0d3131d41e..9c8e28b7c3 100644
--- a/packages/opencli-vendor/clis/twitter/utils.js
+++ b/packages/opencli-vendor/clis/twitter/utils.js
@@ -41,14 +41,14 @@ const CONTENT_TYPE_TO_EXTENSION = {
*/
export function resolveImagePath(imagePath) {
const absPath = resolveRecipePath(imagePath);
- if (!fs.existsSync(resolveRecipePath(absPath))) {
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(absPath)))) {
throw new ArgumentError(`Image file not found: ${absPath}`);
}
const ext = path.extname(absPath).toLowerCase();
if (!SUPPORTED_IMAGE_EXTENSIONS.has(ext)) {
throw new ArgumentError(`Unsupported image format "${ext}". Supported: jpg, jpeg, png, gif, webp`);
}
- const stat = fs.statSync(resolveRecipePath(absPath));
+ const stat = fs.statSync(recipeOutputPath(resolveRecipePath(absPath)));
if (stat.size > MAX_IMAGE_SIZE_BYTES) {
throw new ArgumentError(`Image too large: ${(stat.size / 1024 / 1024).toFixed(1)} MB (max ${MAX_IMAGE_SIZE_BYTES / 1024 / 1024} MB)`);
}
diff --git a/packages/opencli-vendor/clis/wechat-channels/publish.js b/packages/opencli-vendor/clis/wechat-channels/publish.js
index fde76dcb50..39db54d6c6 100644
--- a/packages/opencli-vendor/clis/wechat-channels/publish.js
+++ b/packages/opencli-vendor/clis/wechat-channels/publish.js
@@ -1,4 +1,4 @@
-import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
+import { resolveRecipePath, statRecipeFileSync } from '@jackwener/opencli/cindy/host';
import { readRecipeFileSync, recipeDiagnosticPath } from '@jackwener/opencli/cindy/host';
/**
* WeChat Channels (视频号) publish — UI automation for WeChat Video Channels creator center.
@@ -67,7 +67,7 @@ function requireFilePath(filePath, label, allowedExts) {
const resolved = resolveRecipePath(String(filePath));
let stat;
try {
- stat = fs.statSync(resolveRecipePath(resolved));
+ stat = statRecipeFileSync(resolved);
} catch {
throw new ArgumentError(`${label}文件不存在: ${resolved}`);
}
diff --git a/packages/opencli-vendor/clis/weibo/publish.js b/packages/opencli-vendor/clis/weibo/publish.js
index 40b609d911..5076e615ad 100644
--- a/packages/opencli-vendor/clis/weibo/publish.js
+++ b/packages/opencli-vendor/clis/weibo/publish.js
@@ -15,6 +15,7 @@
* opencli weibo publish "Hello from OpenCLI! #opencli" # publishes immediately
* opencli weibo publish "Check this out" --images /path/a.jpg,/path/b.jpg
*/
+import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
import * as fs from 'node:fs';
import * as path from 'node:path';
@@ -61,7 +62,7 @@ function validateImagePaths(raw) {
if (!SUPPORTED_EXTENSIONS.has(ext)) {
throw new ArgumentError(`Unsupported image format "${ext}". Supported: jpg, png, gif, webp`);
}
- const stat = fs.statSync(resolveRecipePath(absPath), { throwIfNoEntry: false });
+ const stat = fs.statSync(recipeOutputPath(resolveRecipePath(absPath)), { throwIfNoEntry: false });
if (!stat || !stat.isFile()) {
throw new ArgumentError(`Not a valid file: ${absPath}`);
}
diff --git a/packages/opencli-vendor/clis/weixin/create-draft.js b/packages/opencli-vendor/clis/weixin/create-draft.js
index 82dd859868..36397e663a 100644
--- a/packages/opencli-vendor/clis/weixin/create-draft.js
+++ b/packages/opencli-vendor/clis/weixin/create-draft.js
@@ -1,3 +1,4 @@
+import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
import { readRecipeFileSync } from '@jackwener/opencli/cindy/host';
import fs from 'node:fs';
@@ -38,7 +39,7 @@ function resolveCoverImage(rawPath) {
const absPath = resolveRecipePath(value);
let stat;
try {
- stat = fs.statSync(resolveRecipePath(absPath));
+ stat = fs.statSync(recipeOutputPath(resolveRecipePath(absPath)));
} catch {
throw new ArgumentError(`weixin create-draft cover-image does not exist: ${absPath}`);
}
diff --git a/packages/opencli-vendor/clis/xianyu/publish.js b/packages/opencli-vendor/clis/xianyu/publish.js
index e2877c9de4..154286e7b3 100644
--- a/packages/opencli-vendor/clis/xianyu/publish.js
+++ b/packages/opencli-vendor/clis/xianyu/publish.js
@@ -1,3 +1,4 @@
+import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
import * as fs from 'node:fs';
import * as path from 'node:path';
@@ -68,7 +69,7 @@ function validateImagePaths(raw) {
if (!SUPPORTED_IMAGE_EXTENSIONS.has(ext)) {
throw new ArgumentError(`Unsupported image format "${ext}". Supported: jpg, jpeg, png, webp`);
}
- const stat = fs.statSync(resolveRecipePath(absPath), { throwIfNoEntry: false });
+ const stat = fs.statSync(recipeOutputPath(resolveRecipePath(absPath)), { throwIfNoEntry: false });
if (!stat || !stat.isFile()) {
throw new ArgumentError(`Not a valid image file: ${absPath}`);
}
diff --git a/packages/opencli-vendor/clis/xiaohongshu/publish.js b/packages/opencli-vendor/clis/xiaohongshu/publish.js
index 99e7f56eec..e28e466cfb 100644
--- a/packages/opencli-vendor/clis/xiaohongshu/publish.js
+++ b/packages/opencli-vendor/clis/xiaohongshu/publish.js
@@ -1,3 +1,4 @@
+import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
import { readRecipeFileSync, recipeDiagnosticPath } from '@jackwener/opencli/cindy/host';
/**
@@ -127,7 +128,7 @@ function unwrapBrowserResult(value) {
function validateImagePaths(filePaths) {
return filePaths.map((filePath) => {
const absPath = resolveRecipePath(filePath);
- if (!fs.existsSync(resolveRecipePath(absPath)))
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(absPath))))
throw new ArgumentError(`Image file not found: ${absPath}`);
const ext = path.extname(absPath).toLowerCase();
if (!SUPPORTED_EXTENSIONS[ext]) {
diff --git a/packages/opencli-vendor/clis/yollomi/upload.js b/packages/opencli-vendor/clis/yollomi/upload.js
index d3b59d8b77..64fb60a428 100644
--- a/packages/opencli-vendor/clis/yollomi/upload.js
+++ b/packages/opencli-vendor/clis/yollomi/upload.js
@@ -1,3 +1,4 @@
+import { recipeOutputPath } from '@jackwener/opencli/cindy/host';
import { resolveRecipePath } from '@jackwener/opencli/cindy/host';
import { readRecipeFileSync } from '@jackwener/opencli/cindy/host';
/**
@@ -31,7 +32,7 @@ cli({
columns: ['status', 'file', 'size', 'url'],
func: async (page, kwargs) => {
const filePath = resolveRecipePath(kwargs.file);
- if (!fs.existsSync(resolveRecipePath(filePath)))
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(filePath))))
throw new CliError('FILE_NOT_FOUND', `File not found: ${filePath}`, 'Provide a valid file path');
const ext = path.extname(filePath).toLowerCase();
const mime = MIME_MAP[ext];
diff --git a/packages/opencli-vendor/clis/yollomi/utils.js b/packages/opencli-vendor/clis/yollomi/utils.js
index d758fe8eb6..5582f7ed1c 100644
--- a/packages/opencli-vendor/clis/yollomi/utils.js
+++ b/packages/opencli-vendor/clis/yollomi/utils.js
@@ -79,7 +79,7 @@ export function resolveImageInput(input) {
return input;
}
const resolved = resolveRecipePath(input);
- if (!fs.existsSync(resolveRecipePath(resolved))) {
+ if (!fs.existsSync(recipeOutputPath(resolveRecipePath(resolved)))) {
throw new CliError('FILE_NOT_FOUND', `File not found: ${resolved}`, 'Provide a valid file path or URL');
}
const ext = path.extname(resolved).toLowerCase();
diff --git a/packages/opencli-vendor/src/browser/cdp.ts b/packages/opencli-vendor/src/browser/cdp.ts
index 57278aba93..27b4a0c26b 100644
--- a/packages/opencli-vendor/src/browser/cdp.ts
+++ b/packages/opencli-vendor/src/browser/cdp.ts
@@ -11,7 +11,7 @@
import { WebSocket, type RawData } from 'ws';
import { request as httpRequest } from 'node:http';
import { request as httpsRequest } from 'node:https';
-import { readFileSync, statSync } from 'node:fs';
+import { readRecipeFileSync as readFileSync, statRecipeFileSync as statSync } from '@jackwener/opencli/cindy/host';
import type { BrowserCookie, BrowserEvaluateFunction, IPage, ScreenshotOptions } from '../types.js';
import type { IBrowserFactory } from '../runtime.js';
import { buildEvaluateExpression } from './utils.js';
diff --git a/packages/opencli-vendor/src/download/article-download.ts b/packages/opencli-vendor/src/download/article-download.ts
index 8f56485182..791a9c7c61 100644
--- a/packages/opencli-vendor/src/download/article-download.ts
+++ b/packages/opencli-vendor/src/download/article-download.ts
@@ -15,6 +15,9 @@ import { httpDownload, sanitizeFilename } from './index.js';
import { formatBytes } from './progress.js';
const IMAGE_CONCURRENCY = 5;
+const MAX_ARTICLE_IMAGES = 20;
+const MAX_IMAGE_BYTES = 10 * 1024 * 1024;
+const MAX_ARTICLE_IMAGE_BYTES = 50 * 1024 * 1024;
const IMAGE_EXT_BY_CONTENT_TYPE: Record<string, string> = {
'image/avif': 'avif',
'image/bmp': 'bmp',
@@ -298,11 +301,14 @@ async function downloadImages(
// Deduplicate image URLs
const seen = new Set<string>();
- const uniqueUrls = imgUrls.filter(url => {
- if (seen.has(url)) return false;
+ const uniqueUrls: string[] = [];
+ for (const url of imgUrls) {
+ if (seen.has(url)) continue;
seen.add(url);
- return true;
- });
+ uniqueUrls.push(url);
+ if (uniqueUrls.length >= MAX_ARTICLE_IMAGES) break;
+ }
+ let receivedBytes = 0;
for (let i = 0; i < uniqueUrls.length; i += IMAGE_CONCURRENCY) {
const batch = uniqueUrls.slice(i, i + IMAGE_CONCURRENCY);
@@ -318,9 +324,17 @@ async function downloadImages(
const guessedPath = path.join(imgDir, guessedFilename);
try {
+ if (receivedBytes >= MAX_ARTICLE_IMAGE_BYTES) return null;
+ let previous = 0;
const result = await httpDownload(imgUrl, guessedPath, {
headers,
timeout: 15000,
+ maxBytes: MAX_IMAGE_BYTES,
+ onProgress: (received) => {
+ receivedBytes += received - previous;
+ previous = received;
+ if (receivedBytes > MAX_ARTICLE_IMAGE_BYTES) throw new Error('Article image byte limit exceeded');
+ },
includeContentType: requireContentType,
});
if (result.success) {
diff --git a/packages/opencli-vendor/src/download/index.ts b/packages/opencli-vendor/src/download/index.ts
index ce9b4cdeaf..3c39631878 100644
--- a/packages/opencli-vendor/src/download/index.ts
+++ b/packages/opencli-vendor/src/download/index.ts
@@ -24,6 +24,7 @@ export interface DownloadOptions {
timeout?: number;
onProgress?: (received: number, total: number) => void;
maxRedirects?: number;
+ maxBytes?: number;
/** Include the final response MIME type in the result. */
includeContentType?: boolean;
}
@@ -120,7 +121,7 @@ export async function httpDownload(
redirectCount = 0,
): Promise<HttpDownloadResult> {
const {
- cookies, headers = {}, timeout = 30000, onProgress, maxRedirects = 10, includeContentType = false,
+ cookies, headers = {}, timeout = 30000, onProgress, maxRedirects = 10, maxBytes = Infinity, includeContentType = false,
} = options;
const requestHeaders: Record<string, string> = {
@@ -164,12 +165,19 @@ export async function httpDownload(
}
const totalSize = parseInt(response.headers.get('content-length') || '0', 10);
+ if (totalSize > maxBytes) throw new Error('Download byte limit exceeded');
let received = 0;
const progressStream = new Transform({
transform(chunk, _encoding, callback) {
- received += chunk.length;
- if (onProgress) onProgress(received, totalSize);
- callback(null, chunk);
+ try {
+ if (received + chunk.length > maxBytes) throw new Error('Download byte limit exceeded');
+ received += chunk.length;
+ onProgress?.(received, totalSize);
+ callback(null, chunk);
+ } catch (error) {
+ controller.abort();
+ callback(error instanceof Error ? error : new Error(String(error)));
+ }
},
});
@@ -331,15 +339,15 @@ export async function ytdlpDownload(
});
proc.on('close', (code) => {
- if (code === 0 && fs.existsSync(resolveRecipePath(destPath))) {
- const stats = fs.statSync(resolveRecipePath(destPath));
+ if (code === 0 && fs.existsSync(recipeOutputPath(destPath))) {
+ const stats = fs.statSync(recipeOutputPath(destPath));
resolve({ success: true, size: stats.size });
} else {
// Check for common yt-dlp output patterns
- const patterns = fs.readdirSync(resolveRecipePath(dir)).filter(f => f.startsWith(path.basename(destPath, path.extname(destPath))));
+ const patterns = fs.readdirSync(recipeOutputPath(dir)).filter(f => f.startsWith(path.basename(destPath, path.extname(destPath))));
if (patterns.length > 0) {
const actualFile = path.join(dir, patterns[0]);
- const stats = fs.statSync(resolveRecipePath(actualFile));
+ const stats = fs.statSync(recipeOutputPath(actualFile));
resolve({ success: true, size: stats.size });
} else {
resolve({ success: false, size: 0, error: errorOutput.slice(0, 200) || `Exit code ${code}` });
diff --git a/packages/opencli-vendor/src/download/media-download.ts b/packages/opencli-vendor/src/download/media-download.ts
index de43b12d20..28e9ff6971 100644
--- a/packages/opencli-vendor/src/download/media-download.ts
+++ b/packages/opencli-vendor/src/download/media-download.ts
@@ -173,7 +173,7 @@ export async function downloadMedia(
tracker.finish();
// Auto-cleanup exported cookies file
- if (cookiesFile && fs.existsSync(resolveRecipePath(cookiesFile))) {
+ if (cookiesFile && fs.existsSync(recipeOutputPath(cookiesFile))) {
fs.unlinkSync(recipeOutputPath(cookiesFile));
}
}
diff --git a/packages/opencli-vendor/src/pipeline/steps/download.ts b/packages/opencli-vendor/src/pipeline/steps/download.ts
index c360f85e66..2e5c3cca84 100644
--- a/packages/opencli-vendor/src/pipeline/steps/download.ts
+++ b/packages/opencli-vendor/src/pipeline/steps/download.ts
@@ -220,14 +220,14 @@ export async function stepDownload(
const destPath = path.join(dir, filename);
// Check if file exists and skip_existing is true
- if (skipExisting && fs.existsSync(resolveRecipePath(destPath))) {
+ if (skipExisting && fs.existsSync(recipeOutputPath(destPath))) {
tracker.onFileComplete(true, true);
return {
...item,
_download: {
status: 'skipped',
path: destPath,
- size: fs.statSync(resolveRecipePath(destPath)).size,
+ size: fs.statSync(recipeOutputPath(destPath)).size,
} as DownloadResult,
};
}
@@ -329,7 +329,7 @@ export async function stepDownload(
});
// Cleanup temp cookie file
- if (cookiesFile && fs.existsSync(resolveRecipePath(cookiesFile))) {
+ if (cookiesFile && fs.existsSync(recipeOutputPath(cookiesFile))) {
try {
fs.unlinkSync(recipeOutputPath(cookiesFile));
} catch {
diff --git a/scripts/check-opencli-bundle.mjs b/scripts/check-opencli-bundle.mjs
index f1558f502c..6c4656e9dd 100644
--- a/scripts/check-opencli-bundle.mjs
+++ b/scripts/check-opencli-bundle.mjs
@@ -47,6 +47,9 @@ try {
const parts = chain(node.callee);
if (fsBindings.has(parts[0])) {
const method = (fsBindings.get(parts[0]) || parts.at(-1)).replace(/Sync$/, '');
+ if (['stat', 'lstat', 'exists', 'access', 'readdir'].includes(method) && !guarded(node.arguments[0])) {
+ throw new Error(`Unbrokered filesystem inspection in bundled recipe: ${path.relative(root, id)} (${method})`);
+ }
if (method === 'open' && node.arguments[1]?.value !== 'r' && !guarded(node.arguments[0])) {
throw new Error(`Unbrokered output descriptor in bundled recipe: ${path.relative(root, id)}`);
}
diff --git a/scripts/verify-opencli-browser.mjs b/scripts/verify-opencli-browser.mjs
index 3de19b4017..67629ab7a6 100644
--- a/scripts/verify-opencli-browser.mjs
+++ b/scripts/verify-opencli-browser.mjs
@@ -1,6 +1,7 @@
// Real Chromium, isolated temporary profile, local fixture only. No real-site writes.
import assert from "node:assert/strict";
-import { mkdtemp, rm, readFile } from "node:fs/promises";
+import { mkdtemp, rm, readFile, mkdir, writeFile } from "node:fs/promises";
+import { readFileSync, openSync } from 'node:fs';
import { tmpdir } from "node:os";
import path from "node:path";
import { fileURLToPath } from "node:url";
@@ -18,7 +19,7 @@ const http = httpServer((req, res) => {
} else {
res.setHeader("Content-Type", "text/html");
res.end(
- '<!doctype html><title>Recipe fixture</title><input id="name"><button id="save" onclick="window.clicks=(window.clicks||0)+1">Save</button><article><h1>Recipe article</h1><p>This local article verifies the bundled recipe extraction code without using any real account or publishing content.</p></article>',
+ '<!doctype html><title>Recipe fixture</title><input id="name"><input id="file" type="file"><button id="save" onclick="window.clicks=(window.clicks||0)+1">Save</button><article><h1>Recipe article</h1><p>This local article verifies the bundled recipe extraction code without using any real account or publishing content.</p></article>',
);
}
});
@@ -115,6 +116,21 @@ try {
);
await page.click("#save");
assert.equal(await page.evaluate("window.clicks"), 1);
+ const { DEFAULT_UPLOAD_DIR } = await vite.ssrLoadModule('/packages/browser-control-runtime/src/_generated/extension/src/browser/paths.ts');
+ const { withRecipeHost } = await vite.ssrLoadModule('/packages/opencli-vendor/cindy/host.ts');
+ await mkdir(DEFAULT_UPLOAD_DIR, { recursive: true });
+ const uploadRoot = await mkdtemp(path.join(DEFAULT_UPLOAD_DIR, 'cindy-recipe-verify-'));
+ const uploadSource = path.join(scratch, 'fixture.txt');
+ await writeFile(uploadSource, 'local upload fixture');
+ try {
+ await withRecipeHost(undefined, () => page.setFileInput([uploadSource], '#file'), {
+ directory: scratch, temporaryRoot: uploadRoot,
+ read: readFileSync, open: file => openSync(file, 'r'),
+ });
+ assert.equal(await page.evaluate('document.querySelector("#file").files[0].name'), 'fixture.txt');
+ assert.equal(await page.evaluate('document.querySelector("#file").files[0].text()'), 'local upload fixture');
+ assert.equal(await readFile(uploadSource, 'utf8'), 'local upload fixture');
+ } finally { await rm(uploadRoot, { recursive: true, force: true }); }
const document = await page.cdp("DOM.getDocument");
const element = await page.cdp("DOM.querySelector", {
nodeId: document.root.nodeId,
@@ -168,6 +184,7 @@ try {
"typed-arguments",
"fill",
"click",
+ "staged-file-upload",
"CDP-session",
"network-after-navigation",
"screenshot",