Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,901 changes: 832 additions & 1,069 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions packages/argent-mcp/src/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,22 @@ const PNG_SIGNATURE = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0
// Without this check, a 404 (file missing), an HTML error page, or any other
// non-PNG response would be base64'd and labelled `image/png`, which the
// model API rejects with "Image could not be processed" (issue #255).
//
// `file://` URLs are handled directly via the fs module — Node's built-in
// `fetch` only supports `http(s)://`, and the ios-remote screenshot path
// writes PNGs to a temp dir and returns a `file://` URL.
async function fetchPngBytes(url: string): Promise<Buffer | null> {
try {
const res = await fetch(url);
if (!res.ok) return null;
const buf = Buffer.from(await res.arrayBuffer());
let buf: Buffer;
if (url.startsWith("file://")) {
const { readFile } = await import("node:fs/promises");
const { fileURLToPath } = await import("node:url");
buf = await readFile(fileURLToPath(url));
} else {
const res = await fetch(url);
if (!res.ok) return null;
buf = Buffer.from(await res.arrayBuffer());
}
if (buf.length < PNG_SIGNATURE.length) return null;
if (!buf.subarray(0, PNG_SIGNATURE.length).equals(PNG_SIGNATURE)) return null;
return buf;
Expand Down
2 changes: 2 additions & 0 deletions packages/argent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
"scripts/postinstall.cjs"
],
"dependencies": {
"@fails-components/webtransport": "^1.6.3",
"@fails-components/webtransport-transport-http3-quiche": "^1.6.3",
"@modelcontextprotocol/sdk": "^1.20.0"
},
"devDependencies": {
Expand Down
12 changes: 12 additions & 0 deletions packages/argent/scripts/bundle-tools.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ if (fs.existsSync(ANDROID_APK_DEST_DIR)) {
fs.mkdirSync(path.dirname(OUT_FILE), { recursive: true });

// Bundle the tools server
//
// `@fails-components/webtransport` and its http3-quiche transport ship native
// addons (quiche, prebuilt .node binaries) that can't be inlined into a single
// CJS bundle. Keep them external so npm resolves them from the published
// package's `node_modules/` at runtime — they're listed in
// `@swmansion/argent`'s `dependencies` so they install alongside the package.
const TOOL_SERVER_EXTERNAL = [
"@fails-components/webtransport",
"@fails-components/webtransport-transport-http3-quiche",
];

esbuild.buildSync({
entryPoints: [TOOLS_ENTRY],
bundle: true,
Expand All @@ -104,6 +115,7 @@ esbuild.buildSync({
outfile: OUT_FILE,
alias: ALIASES,
mainFields: MAIN_FIELDS,
external: TOOL_SERVER_EXTERNAL,
});

console.log(`✓ Bundled tools server → ${path.relative(process.cwd(), OUT_FILE)}`);
Expand Down
13 changes: 11 additions & 2 deletions packages/registry/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface InvokeToolOptions {

// ── Device + Capability Types ──

export type Platform = "ios" | "android";
export type Platform = "ios" | "android" | "ios-remote";

export type DeviceKind = "simulator" | "emulator" | "device" | "unknown";

Expand Down Expand Up @@ -90,6 +90,15 @@ export interface ToolCapability {
simulator?: boolean;
device?: boolean;
};
/**
* Remote-iOS support, driven via `sim-remote`. Independent matrix from
* `apple` because remote sims have different host-binary requirements
* (`sim-remote` instead of `xcrun`) and a different transport stack
* (MoQ + TCP proxy instead of local WebSocket + Unix sockets).
*/
appleRemote?: {
simulator?: boolean;
};
android?: {
emulator?: boolean;
device?: boolean;
Expand Down Expand Up @@ -119,7 +128,7 @@ export interface ToolCapability {
* On a missing binary, the HTTP layer returns 424 Failed Dependency with an
* install hint the agent can surface verbatim.
*/
export type ToolDependency = "adb" | "xcrun" | "emulator";
export type ToolDependency = "adb" | "xcrun" | "emulator" | "sim-remote";

// ── Tool Types ──

Expand Down
7 changes: 6 additions & 1 deletion packages/tool-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@
"typecheck:tests": "tsc --noEmit -p tsconfig.test.json"
},
"dependencies": {
"@argent/native-devtools-ios": "file:../native-devtools-ios",
"@argent/native-devtools-android": "file:../native-devtools-android",
"@argent/native-devtools-ios": "file:../native-devtools-ios",
"@argent/registry": "file:../registry",
"@argent/update-core": "file:../update-core",
"@clack/prompts": "^1.1.0",
"@fails-components/webtransport": "^1.6.3",
"@fails-components/webtransport-transport-http3-quiche": "^1.6.3",
"@moq/lite": "^0.2.4",
"@moq/net": "^0.1.1",
"express": "^4.19.2",
"pngjs": "^7.0.0",
"protobufjs": "^7.6.1",
"semver": "^7.7.4",
"source-map-js": "^1.2.1",
"tree-sitter": "^0.21.1",
Expand Down
Loading
Loading