react-native-mcp-kit 4.2.1 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/ios-hid +0 -0
- package/dist/server/helpers.d.ts +32 -0
- package/dist/server/helpers.d.ts.map +1 -1
- package/dist/server/helpers.js +89 -1
- package/dist/server/helpers.js.map +1 -1
- package/dist/server/instructions.d.ts +1 -1
- package/dist/server/instructions.d.ts.map +1 -1
- package/dist/server/instructions.js +15 -0
- package/dist/server/instructions.js.map +1 -1
- package/dist/server/tools/assert.d.ts.map +1 -1
- package/dist/server/tools/assert.js +54 -30
- package/dist/server/tools/assert.js.map +1 -1
- package/dist/server/tools/call.d.ts.map +1 -1
- package/dist/server/tools/call.js +17 -7
- package/dist/server/tools/call.js.map +1 -1
- package/dist/server/tools/describeTool.d.ts.map +1 -1
- package/dist/server/tools/describeTool.js +30 -11
- package/dist/server/tools/describeTool.js.map +1 -1
- package/dist/server/tools/listTools.d.ts.map +1 -1
- package/dist/server/tools/listTools.js +13 -6
- package/dist/server/tools/listTools.js.map +1 -1
- package/dist/server/tools/waitUntil.d.ts.map +1 -1
- package/dist/server/tools/waitUntil.js +98 -48
- package/dist/server/tools/waitUntil.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/ios-hid
CHANGED
|
Binary file
|
package/dist/server/helpers.d.ts
CHANGED
|
@@ -52,6 +52,38 @@ export interface ServerContext {
|
|
|
52
52
|
export declare const jsonError: (msg: string) => {
|
|
53
53
|
content: TextContent[];
|
|
54
54
|
};
|
|
55
|
+
export type ClientIdsParse = {
|
|
56
|
+
ids: string[];
|
|
57
|
+
mode: 'broadcast';
|
|
58
|
+
ok: true;
|
|
59
|
+
} | {
|
|
60
|
+
clientId: string | undefined;
|
|
61
|
+
mode: 'single';
|
|
62
|
+
ok: true;
|
|
63
|
+
} | {
|
|
64
|
+
error: string;
|
|
65
|
+
ok: false;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Normalises the `clientId` arg accepted by every public tool. A bare string
|
|
69
|
+
* keeps the single-client shape (image content passes through; auto-resolution
|
|
70
|
+
* still applies when undefined). An array — even with one entry — switches the
|
|
71
|
+
* caller into broadcast mode, where each client is dispatched in parallel and
|
|
72
|
+
* results are aggregated.
|
|
73
|
+
*/
|
|
74
|
+
export declare const parseClientIds: (raw: unknown) => ClientIdsParse;
|
|
75
|
+
export interface BroadcastDispatch {
|
|
76
|
+
clientId: string;
|
|
77
|
+
result: DispatchResult;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Build MCP content blocks from per-client dispatch results. When every result
|
|
81
|
+
* is text-only, the function returns a single JSON envelope so the agent can
|
|
82
|
+
* parse one blob; when any result carries image content (e.g. screenshots),
|
|
83
|
+
* results are emitted as per-client blocks prefixed with `## <clientId>`
|
|
84
|
+
* headers so each image stays paired with its source.
|
|
85
|
+
*/
|
|
86
|
+
export declare const buildBroadcastContent: (results: BroadcastDispatch[], formatResult: (result: unknown) => Array<TextContent | ImageContent>) => Array<TextContent | ImageContent>;
|
|
55
87
|
/**
|
|
56
88
|
* Parse a `call`-style args argument that may arrive as a JSON string (older
|
|
57
89
|
* clients) or a plain object (new form). Returns { ok, args } or { ok: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/server/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACzD,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,O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;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,WACnB,WAAW,gBACL,MAAM,KACnB,mBAAmB,GAAG,IA4BxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,WAAY,WAAW,KAAG,SAAS,EAuC9D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAY,OAAO,KAAG,KAAK,CAAC,WAAW,GAAG,YAAY,CAQ9E,CAAC"}
|
package/dist/server/helpers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatResult = exports.buildToolGroups = exports.findToolInClient = exports.canonicalizeGroup = exports.canonicalize = exports.parseCallArgs = exports.jsonError = void 0;
|
|
3
|
+
exports.formatResult = exports.buildToolGroups = exports.findToolInClient = exports.canonicalizeGroup = exports.canonicalize = exports.parseCallArgs = exports.buildBroadcastContent = exports.parseClientIds = exports.jsonError = void 0;
|
|
4
4
|
const protocol_1 = require("../shared/protocol");
|
|
5
5
|
const jsonError = (msg) => {
|
|
6
6
|
return {
|
|
@@ -8,6 +8,94 @@ const jsonError = (msg) => {
|
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
exports.jsonError = jsonError;
|
|
11
|
+
/**
|
|
12
|
+
* Normalises the `clientId` arg accepted by every public tool. A bare string
|
|
13
|
+
* keeps the single-client shape (image content passes through; auto-resolution
|
|
14
|
+
* still applies when undefined). An array — even with one entry — switches the
|
|
15
|
+
* caller into broadcast mode, where each client is dispatched in parallel and
|
|
16
|
+
* results are aggregated.
|
|
17
|
+
*/
|
|
18
|
+
const parseClientIds = (raw) => {
|
|
19
|
+
if (raw === undefined || raw === null)
|
|
20
|
+
return { clientId: undefined, mode: 'single', ok: true };
|
|
21
|
+
if (typeof raw === 'string')
|
|
22
|
+
return { clientId: raw, mode: 'single', ok: true };
|
|
23
|
+
if (Array.isArray(raw)) {
|
|
24
|
+
if (raw.length === 0) {
|
|
25
|
+
return { error: 'clientId array must contain at least one entry.', ok: false };
|
|
26
|
+
}
|
|
27
|
+
const seen = new Set();
|
|
28
|
+
const ids = [];
|
|
29
|
+
for (const id of raw) {
|
|
30
|
+
if (typeof id !== 'string') {
|
|
31
|
+
return { error: 'clientId array must contain strings only.', ok: false };
|
|
32
|
+
}
|
|
33
|
+
if (!seen.has(id)) {
|
|
34
|
+
seen.add(id);
|
|
35
|
+
ids.push(id);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return { ids, mode: 'broadcast', ok: true };
|
|
39
|
+
}
|
|
40
|
+
return { error: 'clientId must be a string or an array of strings.', ok: false };
|
|
41
|
+
};
|
|
42
|
+
exports.parseClientIds = parseClientIds;
|
|
43
|
+
/**
|
|
44
|
+
* Detects an MCP image-content payload (the shape host__screenshot returns)
|
|
45
|
+
* without re-running formatResult. Used to pick the broadcast aggregation
|
|
46
|
+
* strategy — text-only results collapse into a single JSON envelope, image
|
|
47
|
+
* results keep per-client blocks so each image is anchored to its source.
|
|
48
|
+
*/
|
|
49
|
+
const isImageResult = (result) => {
|
|
50
|
+
if (!Array.isArray(result) || result.length === 0)
|
|
51
|
+
return false;
|
|
52
|
+
const first = result[0];
|
|
53
|
+
return (typeof first === 'object' &&
|
|
54
|
+
first !== null &&
|
|
55
|
+
'type' in first &&
|
|
56
|
+
first.type === 'image');
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Build MCP content blocks from per-client dispatch results. When every result
|
|
60
|
+
* is text-only, the function returns a single JSON envelope so the agent can
|
|
61
|
+
* parse one blob; when any result carries image content (e.g. screenshots),
|
|
62
|
+
* results are emitted as per-client blocks prefixed with `## <clientId>`
|
|
63
|
+
* headers so each image stays paired with its source.
|
|
64
|
+
*/
|
|
65
|
+
const buildBroadcastContent = (results, formatResult) => {
|
|
66
|
+
const hasImage = results.some(({ result }) => {
|
|
67
|
+
return result.ok && isImageResult(result.result);
|
|
68
|
+
});
|
|
69
|
+
if (!hasImage) {
|
|
70
|
+
return [
|
|
71
|
+
{
|
|
72
|
+
text: JSON.stringify({
|
|
73
|
+
results: results.map(({ clientId, result }) => {
|
|
74
|
+
if (result.ok)
|
|
75
|
+
return { clientId, ok: true, result: result.result };
|
|
76
|
+
return { clientId, error: result.error, ok: false };
|
|
77
|
+
}),
|
|
78
|
+
}, null, 2),
|
|
79
|
+
type: 'text',
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
const blocks = [];
|
|
84
|
+
for (const { clientId, result } of results) {
|
|
85
|
+
blocks.push({ text: `## ${clientId}`, type: 'text' });
|
|
86
|
+
if (result.ok) {
|
|
87
|
+
blocks.push(...formatResult(result.result));
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
blocks.push({
|
|
91
|
+
text: JSON.stringify({ error: result.error }, null, 2),
|
|
92
|
+
type: 'text',
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return blocks;
|
|
97
|
+
};
|
|
98
|
+
exports.buildBroadcastContent = buildBroadcastContent;
|
|
11
99
|
/**
|
|
12
100
|
* Parse a `call`-style args argument that may arrive as a JSON string (older
|
|
13
101
|
* clients) or a plain object (new form). Returns { ok, args } or { ok: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/server/helpers.ts"],"names":[],"mappings":";;;AAAA,gDAAqD;AAmD9C,MAAM,SAAS,GAAG,CAAC,GAAW,EAA8B,EAAE;IACnE,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,CAAC;KAC3E,CAAC;AACJ,CAAC,CAAC;AAJW,QAAA,SAAS,aAIpB;AAEF;;;;GAIG;AACI,MAAM,aAAa,GAAG,CAC3B,GAAY,EACgE,EAAE;IAC9E,IAAI,GAAG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AE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,CAAC,CAAC;AAC5E,CAAC,CAAC;AARW,QAAA,YAAY,gBAQvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const BASE_INSTRUCTIONS = "You are connected to a running React Native app via the react-native-mcp-kit bridge.\n\nMultiple React Native apps can connect simultaneously \u2014 each is identified by a short ID like \"ios-1\", \"android-1\", or \"client-1\". Use `connection_status` or `list_tools` to see which clients are connected and their IDs, platforms, and labels.\n\n## How to interact\n\n1. Use `connection_status` to check which clients are connected.\n2. Use `list_tools` to browse all available tool names and short descriptions. The response is compact \u2014 modules that are structurally identical across multiple clients are deduplicated into a single entry with a `clientIds` array, and input schemas are omitted. Narrow the listing with `{ module }` or `{ clientId }`, or pass `{ compact: true }` to drop module-level descriptions.\n3. Use `describe_tool` with `{ tool, clientId? }` to fetch the full input schema of a specific tool before calling it. Required when you need to know the argument shape. Host tools are resolved directly (no clientId needed). For in-app tools, omit `clientId` to auto-pick; specify it only when multiple clients have the same tool with different schemas.\n4. Use `call` to invoke any tool with format: module__method (e.g. navigation__navigate). When more than one client is connected, specify `clientId`. When exactly one client is connected, `clientId` is optional \u2014 it's auto-picked. `args` accepts either a plain object or a JSON string \u2014 prefer objects to avoid quote escaping.\n5. Use `wait_until` to poll any tool until a predicate over its result holds (or timeout). Replaces \"screenshot in a loop + sleep\" for state-level waits (\"wait for network to idle\", \"wait for state key X to become Y\"). Predicate supports compound forms: { all: [...] } (AND), { any: [...] } (OR), { not: predicate }.\n6. For UI-level waits (\"wait for a screen to appear\", \"wait for a spinner to disappear\") use `fiber_tree__query` with `waitFor: { until: \"appear\" | \"disappear\", timeout?, interval?, stable? }` \u2014 it polls the same query with cache bypassed until the target state holds. `stable: <ms>` requires continuous presence/absence for that many ms to ignore transient matches during screen transitions.\n7. Use `assert` for a single-shot checkpoint after actions \u2014 same predicate vocabulary as wait_until, returns { pass, actual, expected?, result? }. Natural pair: do action \u2192 wait_until / fiber_tree waitFor \u2192 assert.\n8. Use `host__tap_fiber` to collapse \"fiber_tree__query \u2192 host__tap at bounds\" into one call. Pass fiber_tree steps; if exactly one fiber matches, its center is tapped. Ambiguous match returns the candidate list so you can add `index` or narrow the chain.\n\nSome tools run inline on the MCP server host (e.g. `host__screenshot`, `host__list_devices`, `host__launch_app`, `host__terminate_app`, `host__restart_app`, `metro__reload`, `metro__symbolicate`) and work even when no React Native client is connected. They use xcrun simctl / adb on the dev machine. When `clientId` is provided, host tools use that client's platform/label/deviceId as hints to resolve the target device; otherwise they prefer the device of the single connected client, falling back to the single booted sim / online device. `launch_app`, `terminate_app`, and `restart_app` accept an `appId` arg (iOS bundle ID / Android package name); omit it to reuse the target client's registered `bundleId` from its connection metadata.\n\n## Driving the UI \u2014 pick the right tool\n1. **`host__tap_fiber` with `steps: [...]`** \u2014 the canonical way to simulate a user tap. One call locates the fiber via fiber_tree__query and taps its center through the real OS gesture pipeline, so Pressable feedback, gesture responders, and hit-test logic all run. Ambiguous matches return a candidate list so you can add `index` or narrow `steps`. This is what you want whenever the user asks to simulate a tap / press / button click.\n2. **`fiber_tree__query` with `select: [\"mcpId\",\"name\",\"bounds\"]` + `host__tap`** when you want to inspect a match set before committing \u2014 e.g. verify bounds, or skim candidates before picking one. `props` is opt-in on `select` to keep responses small.\n3. **`fiber_tree__call`** for non-gesture callbacks or imperative ref methods. Pass `prop` to call a callback prop (`{ prop: 'onPress' }`) or `method` to call a native-ref method (`{ method: 'focus' }`). Good when the component is off-screen / virtualised, when a scroll-handler parent swallows taps, or when you're driving focus / blur / measure / scrollTo via the native ref. For simulating a user tap, prefer tap_fiber (above).\n4. **`host__screenshot` + manual coordinate estimation + `host__tap`** ONLY for non-React surfaces: system permission dialogs, native alerts, the on-screen keyboard, WebView content, native splash. These have no fiber and no bounds. Pair with `region: { x, y, width, height }` to screenshot just the area you're inspecting \u2014 vision-token cheap.\n\nGesture tools: `host__tap` / `host__long_press` / `host__swipe` / `host__drag` / `host__type_text` / `host__type_text_batch` / `host__press_key` work on both platforms with no external daemons: Android via `adb shell input`, iOS via a bundled `ios-hid` binary that injects HID events directly into iOS Simulator through SimulatorKit.\n\nStack traces: `errors__get_errors` and `log_box__get_logs` return parsed `stackFrames` you can pass straight into `metro__symbolicate` to resolve bundled frames back to source paths via Metro.\n\n## Consolidated tools \u2014 verb + arg, not verb-per-action\n\nEvery module exposes one verb per concept rather than one tool per variant. Reach for the listing tool with a filter arg, not a tool named after the filter:\n\n- **console** \u2014 `get_logs({ level? })` for all levels (no per-level shortcuts).\n- **errors** \u2014 `get_errors({ fatal? })` covers fatal-only too.\n- **network** \u2014 `get_requests({ status?, method?, url? })` covers errors / pending / URL filter.\n- **log_box** \u2014 `clear({ level? })` (warn / error / syntax / all); `set_installed({ enabled })` toggles install/uninstall.\n- **navigation** \u2014 `navigate({ mode: 'reuse' | 'push' | 'replace' })` covers navigate/push/replace; `pop({ to: <number> | <screenName> | 'top' })` covers pop / pop_to / pop_to_top; `get_current_route({ withState? })` covers the route-state read too.\n- **query** (reactQuery) \u2014 `mutate({ action: 'invalidate' | 'refetch' | 'remove' | 'reset', key? })` covers all four cache mutations.\n- **device** \u2014 `info({ select?: [...] })` aggregates platform / dimensions / pixelRatio / appearance / appState / accessibility / keyboard / initialUrl / dev / identity / app / battery / memoryStorage. `open_url({ dryRun? })` covers the canOpenURL check too.\n- **fiber_tree** \u2014 `query` (all inspection: mcpId / name / testID / props / hooks / bounds / refMethods / children) and `call({ prop? | method? })` (callback prop OR native-ref method) \u2014 two tools cover everything fibers offer.\n\n## Path-based drill into heavy responses\n\nAll listing tools that return heavy JSON (console / network / errors / storage / reactQuery / log_box / navigation / metro events / fiber_tree) accept the standard `path` / `depth` / `maxBytes` projection args. Heavy nested values collapse to compact `${...}`-keyed markers; primitives stay raw. Drill into a specific subtree via the same tool with `path` \u2014 no separate by-id fetcher.\n\n `network__get_requests({ path: '[-1:][0].response.body' })` \u2014 last request's body\n `network__get_requests({ path: '[-1:][0].response.body', depth: 8 })` \u2014 fully expanded\n `console__get_logs({ path: '[-3:][0].args[1]' })` \u2014 second arg of the third-from-last log\n `storage__get_item({ key: 'session', path: 'value.user.email' })` \u2014 drill into a stored value\n `query__get_data({ key: '[\"users\"]', path: 'data.email' })` \u2014 drill into cached data\n\nPath syntax (JS-style):\n `.key` or `[\"key.with.dots\"]` \u2014 object key access\n `[N]` \u2014 index (numeric for arrays, Nth char for strings, Nth key in insertion order for objects)\n `[start:end]` / `[start:]` / `[:end]` \u2014 slice (Python/jq-style; negative indices count from end). Works on arrays, strings, and objects (key slice). After array slice, chained `.key` maps over each element; `[N]` picks one.\n\nPath drilling to a string scalar applies `previewCap` as usual \u2014 long leaves still wrap in a `${str}` marker. To get a raw substring, end the path with a slice: `stack[0:500]` returns the first 500 chars verbatim (slice = explicit truncation request, previewCap bypassed). Default `previewCap` is 250; override per call via `previewCap: <N>`.\n\n`depth` (default per tool, max 8) controls how many container levels are walked before collapsing to a marker. Bump `depth` for an exploratory survey, use `path` for a targeted drill. `maxBytes` (default 50KB) caps the total response size \u2014 overflow is replaced with a single `${str}` marker carrying the original byte count + a preview.\n\nFor `fiber_tree__query`, heavy fields (`props`, `hooks`) take projection knobs per-field via `select` so the rest of the response stays raw:\n `select: [{ props: { path: \"style\", depth: 2 } }]` \u2014 drill into props.style 2 levels deep\n `select: [{ props: { path: \"data[0:5]\" } }]` \u2014 slice path: take first 5 items of props.data\n `select: [{ hooks: { kinds: [\"State\"], names: [\"isLoading\"], withValues: true, depth: 2 } }]` \u2014 filter + project hook values\n `select: [{ children: 5 }]` \u2014 light-only recursive tree walker (5 levels deep); use `scope: \"root\"` as the first step to dump the whole tree. props/hooks not supported inside; sub-children past treeDepth surface as `${arr}: N`.\n\nHook filters: `kinds` (State/Effect/Memo/Ref/Custom/...), `names` (exact or `/regex/flags`), `withValues` (adds resolved values), `expansionDepth` (caps custom-hook recursion), `format: \"tree\"` (nested children vs flat `via` chains). Each hook entry carries `{ kind, name, hook?, via?, expanded? }`. Sensitive names (password, token, jwt, secret, credential, apiKey, authorization, Pin suffix) are auto-redacted; configure via `fiberTreeModule({ redactHookNames, additionalRedactHookNames })`.\n\nMarker format: `{ \"${obj}\": N }` for collapsed objects (N keys), `{ \"${arr}\": N }` for arrays (N items), `{ \"${fun}\": \"name\" }` for functions, `{ \"${str}\": { len, preview } }` for long strings (>`previewCap`, default 250), `{ \"${Date}\": \"iso\" }` for Date, `{ \"${Err}\": { name, msg } }` for Error, `{ \"${RegExp}\": \"/.../i\" }` for RegExp, `{ \"${map}\": N }` / `{ \"${set}\": N }` for Map/Set sizes, `{ \"${cyc}\": true }` for cycles, `{ \"${ref}\": { mcpId, name } }` for fiber/native refs, `{ \"${cls}\": { name, len } }` for class instances, `{ \"${truncated}\": { total, slice } }` first key/item when a container is wider than the cap (30 keys for objects, 50 items for arrays).\n";
|
|
1
|
+
export declare const BASE_INSTRUCTIONS = "You are connected to a running React Native app via the react-native-mcp-kit bridge.\n\nMultiple React Native apps can connect simultaneously \u2014 each is identified by a short ID like \"ios-1\", \"android-1\", or \"client-1\". Use `connection_status` or `list_tools` to see which clients are connected and their IDs, platforms, and labels.\n\n## How to interact\n\n1. Use `connection_status` to check which clients are connected.\n2. Use `list_tools` to browse all available tool names and short descriptions. The response is compact \u2014 modules that are structurally identical across multiple clients are deduplicated into a single entry with a `clientIds` array, and input schemas are omitted. Narrow the listing with `{ module }` or `{ clientId }`, or pass `{ compact: true }` to drop module-level descriptions.\n3. Use `describe_tool` with `{ tool, clientId? }` to fetch the full input schema of a specific tool before calling it. Required when you need to know the argument shape. Host tools are resolved directly (no clientId needed). For in-app tools, omit `clientId` to auto-pick; specify it only when multiple clients have the same tool with different schemas.\n4. Use `call` to invoke any tool with format: module__method (e.g. navigation__navigate). When more than one client is connected, specify `clientId`. When exactly one client is connected, `clientId` is optional \u2014 it's auto-picked. `args` accepts either a plain object or a JSON string \u2014 prefer objects to avoid quote escaping.\n5. Use `wait_until` to poll any tool until a predicate over its result holds (or timeout). Replaces \"screenshot in a loop + sleep\" for state-level waits (\"wait for network to idle\", \"wait for state key X to become Y\"). Predicate supports compound forms: { all: [...] } (AND), { any: [...] } (OR), { not: predicate }.\n6. For UI-level waits (\"wait for a screen to appear\", \"wait for a spinner to disappear\") use `fiber_tree__query` with `waitFor: { until: \"appear\" | \"disappear\", timeout?, interval?, stable? }` \u2014 it polls the same query with cache bypassed until the target state holds. `stable: <ms>` requires continuous presence/absence for that many ms to ignore transient matches during screen transitions.\n7. Use `assert` for a single-shot checkpoint after actions \u2014 same predicate vocabulary as wait_until, returns { pass, actual, expected?, result? }. Natural pair: do action \u2192 wait_until / fiber_tree waitFor \u2192 assert.\n\n### Broadcast \u2014 same call on several clients\n\n`call`, `wait_until` and `assert` accept `clientId` as either a string or an array of strings. A string keeps the single-client shape (image content passes through). An array dispatches the same invocation to every listed client in parallel \u2014 useful for iOS\u2194Android parity, A/B device runs, or asserting a state across all attached apps in one round-trip.\n\n `call({ clientId: [\"ios-1\", \"android-1\"], tool: \"host__screenshot\" })` \u2014 two screenshots in one response\n `wait_until({ clientId: [\"ios-1\", \"android-1\"], tool: \"navigation__get_current_route\", predicate: { op: \"equals\", path: \"name\", value: \"CART\" } })` \u2014 wait until both clients land on CART\n `assert({ clientId: [\"ios-1\", \"android-1\"], tool: \"fiber_tree__query\", args: { mcpId: \"checkout:button:submit\" }, predicate: { op: \"exists\" } })` \u2014 the same fiber exists on both platforms\n\nBroadcast result shapes:\n `call` \u2014 when every per-client result is text, you get one JSON envelope `{ results: [{ clientId, ok, result | error }, ...] }`. When any result is an image (screenshot), per-client `## <clientId>` text headers are interleaved with each client's blocks so each image stays paired with its source.\n `wait_until` \u2014 `{ ok, perClient: [{ clientId, ok, attempts, elapsedMs, matched? | lastResult, lastError?, reason? }, ...] }`; overall `ok` is true only if every client matched within the shared timeout.\n `assert` \u2014 `{ pass, perClient: [{ clientId, pass, actual?, expected?, op?, path?, message?, result?, error? }, ...] }`; overall `pass` is true only when every client passed.\n\n`list_tools` and `describe_tool` also accept an array `clientId` \u2014 there it narrows the considered client set (filter / canonicalisation pool) rather than triggering a broadcast.\n8. Use `host__tap_fiber` to collapse \"fiber_tree__query \u2192 host__tap at bounds\" into one call. Pass fiber_tree steps; if exactly one fiber matches, its center is tapped. Ambiguous match returns the candidate list so you can add `index` or narrow the chain.\n\nSome tools run inline on the MCP server host (e.g. `host__screenshot`, `host__list_devices`, `host__launch_app`, `host__terminate_app`, `host__restart_app`, `metro__reload`, `metro__symbolicate`) and work even when no React Native client is connected. They use xcrun simctl / adb on the dev machine. When `clientId` is provided, host tools use that client's platform/label/deviceId as hints to resolve the target device; otherwise they prefer the device of the single connected client, falling back to the single booted sim / online device. `launch_app`, `terminate_app`, and `restart_app` accept an `appId` arg (iOS bundle ID / Android package name); omit it to reuse the target client's registered `bundleId` from its connection metadata.\n\n## Driving the UI \u2014 pick the right tool\n1. **`host__tap_fiber` with `steps: [...]`** \u2014 the canonical way to simulate a user tap. One call locates the fiber via fiber_tree__query and taps its center through the real OS gesture pipeline, so Pressable feedback, gesture responders, and hit-test logic all run. Ambiguous matches return a candidate list so you can add `index` or narrow `steps`. This is what you want whenever the user asks to simulate a tap / press / button click.\n2. **`fiber_tree__query` with `select: [\"mcpId\",\"name\",\"bounds\"]` + `host__tap`** when you want to inspect a match set before committing \u2014 e.g. verify bounds, or skim candidates before picking one. `props` is opt-in on `select` to keep responses small.\n3. **`fiber_tree__call`** for non-gesture callbacks or imperative ref methods. Pass `prop` to call a callback prop (`{ prop: 'onPress' }`) or `method` to call a native-ref method (`{ method: 'focus' }`). Good when the component is off-screen / virtualised, when a scroll-handler parent swallows taps, or when you're driving focus / blur / measure / scrollTo via the native ref. For simulating a user tap, prefer tap_fiber (above).\n4. **`host__screenshot` + manual coordinate estimation + `host__tap`** ONLY for non-React surfaces: system permission dialogs, native alerts, the on-screen keyboard, WebView content, native splash. These have no fiber and no bounds. Pair with `region: { x, y, width, height }` to screenshot just the area you're inspecting \u2014 vision-token cheap.\n\nGesture tools: `host__tap` / `host__long_press` / `host__swipe` / `host__drag` / `host__type_text` / `host__type_text_batch` / `host__press_key` work on both platforms with no external daemons: Android via `adb shell input`, iOS via a bundled `ios-hid` binary that injects HID events directly into iOS Simulator through SimulatorKit.\n\nStack traces: `errors__get_errors` and `log_box__get_logs` return parsed `stackFrames` you can pass straight into `metro__symbolicate` to resolve bundled frames back to source paths via Metro.\n\n## Consolidated tools \u2014 verb + arg, not verb-per-action\n\nEvery module exposes one verb per concept rather than one tool per variant. Reach for the listing tool with a filter arg, not a tool named after the filter:\n\n- **console** \u2014 `get_logs({ level? })` for all levels (no per-level shortcuts).\n- **errors** \u2014 `get_errors({ fatal? })` covers fatal-only too.\n- **network** \u2014 `get_requests({ status?, method?, url? })` covers errors / pending / URL filter.\n- **log_box** \u2014 `clear({ level? })` (warn / error / syntax / all); `set_installed({ enabled })` toggles install/uninstall.\n- **navigation** \u2014 `navigate({ mode: 'reuse' | 'push' | 'replace' })` covers navigate/push/replace; `pop({ to: <number> | <screenName> | 'top' })` covers pop / pop_to / pop_to_top; `get_current_route({ withState? })` covers the route-state read too.\n- **query** (reactQuery) \u2014 `mutate({ action: 'invalidate' | 'refetch' | 'remove' | 'reset', key? })` covers all four cache mutations.\n- **device** \u2014 `info({ select?: [...] })` aggregates platform / dimensions / pixelRatio / appearance / appState / accessibility / keyboard / initialUrl / dev / identity / app / battery / memoryStorage. `open_url({ dryRun? })` covers the canOpenURL check too.\n- **fiber_tree** \u2014 `query` (all inspection: mcpId / name / testID / props / hooks / bounds / refMethods / children) and `call({ prop? | method? })` (callback prop OR native-ref method) \u2014 two tools cover everything fibers offer.\n\n## Path-based drill into heavy responses\n\nAll listing tools that return heavy JSON (console / network / errors / storage / reactQuery / log_box / navigation / metro events / fiber_tree) accept the standard `path` / `depth` / `maxBytes` projection args. Heavy nested values collapse to compact `${...}`-keyed markers; primitives stay raw. Drill into a specific subtree via the same tool with `path` \u2014 no separate by-id fetcher.\n\n `network__get_requests({ path: '[-1:][0].response.body' })` \u2014 last request's body\n `network__get_requests({ path: '[-1:][0].response.body', depth: 8 })` \u2014 fully expanded\n `console__get_logs({ path: '[-3:][0].args[1]' })` \u2014 second arg of the third-from-last log\n `storage__get_item({ key: 'session', path: 'value.user.email' })` \u2014 drill into a stored value\n `query__get_data({ key: '[\"users\"]', path: 'data.email' })` \u2014 drill into cached data\n\nPath syntax (JS-style):\n `.key` or `[\"key.with.dots\"]` \u2014 object key access\n `[N]` \u2014 index (numeric for arrays, Nth char for strings, Nth key in insertion order for objects)\n `[start:end]` / `[start:]` / `[:end]` \u2014 slice (Python/jq-style; negative indices count from end). Works on arrays, strings, and objects (key slice). After array slice, chained `.key` maps over each element; `[N]` picks one.\n\nPath drilling to a string scalar applies `previewCap` as usual \u2014 long leaves still wrap in a `${str}` marker. To get a raw substring, end the path with a slice: `stack[0:500]` returns the first 500 chars verbatim (slice = explicit truncation request, previewCap bypassed). Default `previewCap` is 250; override per call via `previewCap: <N>`.\n\n`depth` (default per tool, max 8) controls how many container levels are walked before collapsing to a marker. Bump `depth` for an exploratory survey, use `path` for a targeted drill. `maxBytes` (default 50KB) caps the total response size \u2014 overflow is replaced with a single `${str}` marker carrying the original byte count + a preview.\n\nFor `fiber_tree__query`, heavy fields (`props`, `hooks`) take projection knobs per-field via `select` so the rest of the response stays raw:\n `select: [{ props: { path: \"style\", depth: 2 } }]` \u2014 drill into props.style 2 levels deep\n `select: [{ props: { path: \"data[0:5]\" } }]` \u2014 slice path: take first 5 items of props.data\n `select: [{ hooks: { kinds: [\"State\"], names: [\"isLoading\"], withValues: true, depth: 2 } }]` \u2014 filter + project hook values\n `select: [{ children: 5 }]` \u2014 light-only recursive tree walker (5 levels deep); use `scope: \"root\"` as the first step to dump the whole tree. props/hooks not supported inside; sub-children past treeDepth surface as `${arr}: N`.\n\nHook filters: `kinds` (State/Effect/Memo/Ref/Custom/...), `names` (exact or `/regex/flags`), `withValues` (adds resolved values), `expansionDepth` (caps custom-hook recursion), `format: \"tree\"` (nested children vs flat `via` chains). Each hook entry carries `{ kind, name, hook?, via?, expanded? }`. Sensitive names (password, token, jwt, secret, credential, apiKey, authorization, Pin suffix) are auto-redacted; configure via `fiberTreeModule({ redactHookNames, additionalRedactHookNames })`.\n\nMarker format: `{ \"${obj}\": N }` for collapsed objects (N keys), `{ \"${arr}\": N }` for arrays (N items), `{ \"${fun}\": \"name\" }` for functions, `{ \"${str}\": { len, preview } }` for long strings (>`previewCap`, default 250), `{ \"${Date}\": \"iso\" }` for Date, `{ \"${Err}\": { name, msg } }` for Error, `{ \"${RegExp}\": \"/.../i\" }` for RegExp, `{ \"${map}\": N }` / `{ \"${set}\": N }` for Map/Set sizes, `{ \"${cyc}\": true }` for cycles, `{ \"${ref}\": { mcpId, name } }` for fiber/native refs, `{ \"${cls}\": { name, len } }` for class instances, `{ \"${truncated}\": { total, slice } }` first key/item when a container is wider than the cap (30 keys for objects, 50 items for arrays).\n";
|
|
2
2
|
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/server/instructions.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/server/instructions.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,ssZAmF7B,CAAC"}
|
|
@@ -15,6 +15,21 @@ Multiple React Native apps can connect simultaneously — each is identified by
|
|
|
15
15
|
5. Use \`wait_until\` to poll any tool until a predicate over its result holds (or timeout). Replaces "screenshot in a loop + sleep" for state-level waits ("wait for network to idle", "wait for state key X to become Y"). Predicate supports compound forms: { all: [...] } (AND), { any: [...] } (OR), { not: predicate }.
|
|
16
16
|
6. For UI-level waits ("wait for a screen to appear", "wait for a spinner to disappear") use \`fiber_tree${protocol_1.MODULE_SEPARATOR}query\` with \`waitFor: { until: "appear" | "disappear", timeout?, interval?, stable? }\` — it polls the same query with cache bypassed until the target state holds. \`stable: <ms>\` requires continuous presence/absence for that many ms to ignore transient matches during screen transitions.
|
|
17
17
|
7. Use \`assert\` for a single-shot checkpoint after actions — same predicate vocabulary as wait_until, returns { pass, actual, expected?, result? }. Natural pair: do action → wait_until / fiber_tree waitFor → assert.
|
|
18
|
+
|
|
19
|
+
### Broadcast — same call on several clients
|
|
20
|
+
|
|
21
|
+
\`call\`, \`wait_until\` and \`assert\` accept \`clientId\` as either a string or an array of strings. A string keeps the single-client shape (image content passes through). An array dispatches the same invocation to every listed client in parallel — useful for iOS↔Android parity, A/B device runs, or asserting a state across all attached apps in one round-trip.
|
|
22
|
+
|
|
23
|
+
\`call({ clientId: ["ios-1", "android-1"], tool: "host${protocol_1.MODULE_SEPARATOR}screenshot" })\` — two screenshots in one response
|
|
24
|
+
\`wait_until({ clientId: ["ios-1", "android-1"], tool: "navigation${protocol_1.MODULE_SEPARATOR}get_current_route", predicate: { op: "equals", path: "name", value: "CART" } })\` — wait until both clients land on CART
|
|
25
|
+
\`assert({ clientId: ["ios-1", "android-1"], tool: "fiber_tree${protocol_1.MODULE_SEPARATOR}query", args: { mcpId: "checkout:button:submit" }, predicate: { op: "exists" } })\` — the same fiber exists on both platforms
|
|
26
|
+
|
|
27
|
+
Broadcast result shapes:
|
|
28
|
+
\`call\` — when every per-client result is text, you get one JSON envelope \`{ results: [{ clientId, ok, result | error }, ...] }\`. When any result is an image (screenshot), per-client \`## <clientId>\` text headers are interleaved with each client's blocks so each image stays paired with its source.
|
|
29
|
+
\`wait_until\` — \`{ ok, perClient: [{ clientId, ok, attempts, elapsedMs, matched? | lastResult, lastError?, reason? }, ...] }\`; overall \`ok\` is true only if every client matched within the shared timeout.
|
|
30
|
+
\`assert\` — \`{ pass, perClient: [{ clientId, pass, actual?, expected?, op?, path?, message?, result?, error? }, ...] }\`; overall \`pass\` is true only when every client passed.
|
|
31
|
+
|
|
32
|
+
\`list_tools\` and \`describe_tool\` also accept an array \`clientId\` — there it narrows the considered client set (filter / canonicalisation pool) rather than triggering a broadcast.
|
|
18
33
|
8. Use \`host${protocol_1.MODULE_SEPARATOR}tap_fiber\` to collapse "fiber_tree__query → host__tap at bounds" into one call. Pass fiber_tree steps; if exactly one fiber matches, its center is tapped. Ambiguous match returns the candidate list so you can add \`index\` or narrow the chain.
|
|
19
34
|
|
|
20
35
|
Some tools run inline on the MCP server host (e.g. \`host${protocol_1.MODULE_SEPARATOR}screenshot\`, \`host${protocol_1.MODULE_SEPARATOR}list_devices\`, \`host${protocol_1.MODULE_SEPARATOR}launch_app\`, \`host${protocol_1.MODULE_SEPARATOR}terminate_app\`, \`host${protocol_1.MODULE_SEPARATOR}restart_app\`, \`metro${protocol_1.MODULE_SEPARATOR}reload\`, \`metro${protocol_1.MODULE_SEPARATOR}symbolicate\`) and work even when no React Native client is connected. They use xcrun simctl / adb on the dev machine. When \`clientId\` is provided, host tools use that client's platform/label/deviceId as hints to resolve the target device; otherwise they prefer the device of the single connected client, falling back to the single booted sim / online device. \`launch_app\`, \`terminate_app\`, and \`restart_app\` accept an \`appId\` arg (iOS bundle ID / Android package name); omit it to reuse the target client's registered \`bundleId\` from its connection metadata.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/server/instructions.ts"],"names":[],"mappings":";;;AAAA,gDAAqD;AAExC,QAAA,iBAAiB,GAAG;;;;;;;;;wDASuB,2BAAgB,0BAA0B,2BAAgB;;2GAEP,2BAAgB
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/server/instructions.ts"],"names":[],"mappings":";;;AAAA,gDAAqD;AAExC,QAAA,iBAAiB,GAAG;;;;;;;;;wDASuB,2BAAgB,0BAA0B,2BAAgB;;2GAEP,2BAAgB;;;;;;;0DAOjE,2BAAgB;sEACJ,2BAAgB;kEACpB,2BAAgB;;;;;;;;eAQnE,2BAAgB;;2DAE4B,2BAAgB,uBAAuB,2BAAgB,yBAAyB,2BAAgB,uBAAuB,2BAAgB,0BAA0B,2BAAgB,yBAAyB,2BAAgB,oBAAoB,2BAAgB;;;aAG5S,2BAAgB;mBACV,2BAAgB,8DAA8D,2BAAgB;mBAC9F,2BAAgB;aACtB,2BAAgB,uDAAuD,2BAAgB;;uBAE7E,2BAAgB,iBAAiB,2BAAgB,wBAAwB,2BAAgB,mBAAmB,2BAAgB,kBAAkB,2BAAgB,uBAAuB,2BAAgB,6BAA6B,2BAAgB;;wBAEjP,2BAAgB,6BAA6B,2BAAgB,8EAA8E,2BAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2ClL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../src/server/tools/assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,
|
|
1
|
+
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../src/server/tools/assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AA4C1B,eAAO,MAAM,kBAAkB,QAAS,SAAS,OAAO,aAAa,KAAG,IAmFvE,CAAC"}
|
|
@@ -5,6 +5,30 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const helpers_1 = require("../../server/helpers");
|
|
6
6
|
const predicate_1 = require("../../server/predicate");
|
|
7
7
|
const protocol_1 = require("../../shared/protocol");
|
|
8
|
+
const evaluate = (dispatch, pred, isLeaf, leafPath, leafValue, leafOp, message) => {
|
|
9
|
+
if (!dispatch.ok) {
|
|
10
|
+
const failure = { error: dispatch.error, pass: false };
|
|
11
|
+
if (message)
|
|
12
|
+
failure.message = message;
|
|
13
|
+
return failure;
|
|
14
|
+
}
|
|
15
|
+
const pass = (0, predicate_1.evalPredicate)(dispatch.result, pred);
|
|
16
|
+
const payload = { pass };
|
|
17
|
+
if (isLeaf)
|
|
18
|
+
payload.actual = (0, predicate_1.resolvePath)(dispatch.result, leafPath);
|
|
19
|
+
if (!pass) {
|
|
20
|
+
if (isLeaf) {
|
|
21
|
+
payload.expected = leafValue;
|
|
22
|
+
payload.op = leafOp;
|
|
23
|
+
if (leafPath)
|
|
24
|
+
payload.path = leafPath;
|
|
25
|
+
}
|
|
26
|
+
if (message)
|
|
27
|
+
payload.message = message;
|
|
28
|
+
payload.result = dispatch.result;
|
|
29
|
+
}
|
|
30
|
+
return payload;
|
|
31
|
+
};
|
|
8
32
|
const registerAssertTool = (mcp, ctx) => {
|
|
9
33
|
mcp.registerTool('assert', {
|
|
10
34
|
annotations: {
|
|
@@ -13,9 +37,14 @@ const registerAssertTool = (mcp, ctx) => {
|
|
|
13
37
|
},
|
|
14
38
|
description: `Single-shot assertion over a tool's result. Same predicate vocabulary (including { all / any / not }) as wait_until, but one attempt and a standardized diff on failure.
|
|
15
39
|
|
|
16
|
-
|
|
17
|
-
Returns { pass:
|
|
18
|
-
Returns { pass: false,
|
|
40
|
+
Single client (clientId omitted or a string):
|
|
41
|
+
Returns { pass: true, actual? } on success — actual is the path-resolved value for leaf predicates, omitted for compound.
|
|
42
|
+
Returns { pass: false, actual, expected?, op?, path?, message?, result } on predicate failure.
|
|
43
|
+
Returns { pass: false, error, message? } when the tool dispatch itself threw.
|
|
44
|
+
|
|
45
|
+
Broadcast (clientId is an array — asserts on each client in parallel):
|
|
46
|
+
Returns { pass, perClient: [{ clientId, pass, actual?, expected?, op?, path?, message?, result?, error? }, ...] }
|
|
47
|
+
with overall pass = every client's assertion passed.
|
|
19
48
|
|
|
20
49
|
Useful after wait_until as a checkpoint — the pair reads "do action → wait → assert" which produces a clean audit trail in session logs.`,
|
|
21
50
|
inputSchema: {
|
|
@@ -23,7 +52,10 @@ Useful after wait_until as a checkpoint — the pair reads "do action → wait
|
|
|
23
52
|
.union([zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())])
|
|
24
53
|
.optional()
|
|
25
54
|
.describe('Arguments for the asserted tool — object or JSON string.'),
|
|
26
|
-
clientId: zod_1.z
|
|
55
|
+
clientId: zod_1.z
|
|
56
|
+
.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())])
|
|
57
|
+
.optional()
|
|
58
|
+
.describe('Target client ID(s). String asserts on one client; array runs the same assertion on multiple clients in parallel. Same auto-resolution semantics as `call`.'),
|
|
27
59
|
message: zod_1.z
|
|
28
60
|
.string()
|
|
29
61
|
.optional()
|
|
@@ -39,39 +71,31 @@ Useful after wait_until as a checkpoint — the pair reads "do action → wait
|
|
|
39
71
|
const parsedArgs = (0, helpers_1.parseCallArgs)(args);
|
|
40
72
|
if (!parsedArgs.ok)
|
|
41
73
|
return (0, helpers_1.jsonError)(parsedArgs.error);
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
44
|
-
return
|
|
45
|
-
content: [
|
|
46
|
-
{
|
|
47
|
-
text: JSON.stringify({ error: dispatch.error, message, pass: false }, null, 2),
|
|
48
|
-
type: 'text',
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
};
|
|
52
|
-
}
|
|
74
|
+
const clients = (0, helpers_1.parseClientIds)(clientId);
|
|
75
|
+
if (!clients.ok)
|
|
76
|
+
return (0, helpers_1.jsonError)(clients.error);
|
|
53
77
|
const pred = predicate;
|
|
54
78
|
const isLeaf = (0, predicate_1.isLeafPredicate)(pred);
|
|
55
79
|
const leafPath = isLeaf ? pred.path : undefined;
|
|
56
80
|
const leafValue = isLeaf ? pred.value : undefined;
|
|
57
81
|
const leafOp = isLeaf ? pred.op : undefined;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
payload.expected = leafValue;
|
|
65
|
-
payload.op = leafOp;
|
|
66
|
-
if (leafPath)
|
|
67
|
-
payload.path = leafPath;
|
|
68
|
-
}
|
|
69
|
-
if (message)
|
|
70
|
-
payload.message = message;
|
|
71
|
-
payload.result = dispatch.result;
|
|
82
|
+
if (clients.mode === 'single') {
|
|
83
|
+
const dispatch = await ctx.dispatchTool(tool, parsedArgs.args, clients.clientId);
|
|
84
|
+
const payload = evaluate(dispatch, pred, isLeaf, leafPath, leafValue, leafOp, message);
|
|
85
|
+
return {
|
|
86
|
+
content: [{ text: JSON.stringify(payload, null, 2), type: 'text' }],
|
|
87
|
+
};
|
|
72
88
|
}
|
|
89
|
+
const perClient = await Promise.all(clients.ids.map(async (id) => {
|
|
90
|
+
const dispatch = await ctx.dispatchTool(tool, parsedArgs.args, id);
|
|
91
|
+
const entry = evaluate(dispatch, pred, isLeaf, leafPath, leafValue, leafOp, message);
|
|
92
|
+
return { clientId: id, ...entry };
|
|
93
|
+
}));
|
|
94
|
+
const pass = perClient.every((entry) => {
|
|
95
|
+
return entry.pass === true;
|
|
96
|
+
});
|
|
73
97
|
return {
|
|
74
|
-
content: [{ text: JSON.stringify(
|
|
98
|
+
content: [{ text: JSON.stringify({ pass, perClient }, null, 2), type: 'text' }],
|
|
75
99
|
};
|
|
76
100
|
});
|
|
77
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../src/server/tools/assert.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../src/server/tools/assert.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAExB,8CAM0B;AAC1B,kDAM4B;AAC5B,gDAAqD;AAOrD,MAAM,QAAQ,GAAG,CACf,QAAwB,EACxB,IAAe,EACf,MAAe,EACf,QAA4B,EAC5B,SAAkB,EAClB,MAA0B,EAC1B,OAA2B,EACZ,EAAE;IACjB,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,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AO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,CAAC;SACzF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAnFW,QAAA,kBAAkB,sBAmF7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../../src/server/tools/call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,
|
|
1
|
+
{"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../../src/server/tools/call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAML,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,gBAAgB,QAAS,SAAS,OAAO,aAAa,KAAG,IAoDrE,CAAC"}
|
|
@@ -10,16 +10,16 @@ const registerCallTool = (mcp, ctx) => {
|
|
|
10
10
|
openWorldHint: true,
|
|
11
11
|
title: 'Call Tool',
|
|
12
12
|
},
|
|
13
|
-
description: 'Call a tool registered by a React Native app client. Use list_tools first to see available tools. When multiple clients are connected, specify clientId; otherwise it is auto-picked. `args` accepts either a plain object or a JSON string — objects are preferred to avoid escaping quotes.',
|
|
13
|
+
description: 'Call a tool registered by a React Native app client. Use list_tools first to see available tools. When multiple clients are connected, specify clientId; otherwise it is auto-picked. Pass `clientId: ["ios-1", "android-1"]` (an array) to broadcast the same call to several clients in parallel — useful for iOS↔Android parity checks. `args` accepts either a plain object or a JSON string — objects are preferred to avoid escaping quotes.',
|
|
14
14
|
inputSchema: {
|
|
15
15
|
args: zod_1.z
|
|
16
16
|
.union([zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())])
|
|
17
17
|
.optional()
|
|
18
18
|
.describe('Tool arguments as a plain object (e.g. { screen: "AUTH_LOGIN_SCREEN" }) or a JSON string.'),
|
|
19
19
|
clientId: zod_1.z
|
|
20
|
-
.string()
|
|
20
|
+
.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())])
|
|
21
21
|
.optional()
|
|
22
|
-
.describe('Target client ID (e.g. "ios-1", "android-1"). Optional when exactly one client is connected.'),
|
|
22
|
+
.describe('Target client ID(s). String selects one client (e.g. "ios-1"); array broadcasts the call to multiple clients in parallel (e.g. ["ios-1", "android-1"]). Optional when exactly one client is connected.'),
|
|
23
23
|
tool: zod_1.z
|
|
24
24
|
.string()
|
|
25
25
|
.describe(`Tool name in format "module${protocol_1.MODULE_SEPARATOR}method" (e.g. "navigation${protocol_1.MODULE_SEPARATOR}navigate")`),
|
|
@@ -28,10 +28,20 @@ const registerCallTool = (mcp, ctx) => {
|
|
|
28
28
|
const parsed = (0, helpers_1.parseCallArgs)(args);
|
|
29
29
|
if (!parsed.ok)
|
|
30
30
|
return (0, helpers_1.jsonError)(parsed.error);
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
33
|
-
return (0, helpers_1.jsonError)(
|
|
34
|
-
|
|
31
|
+
const clients = (0, helpers_1.parseClientIds)(clientId);
|
|
32
|
+
if (!clients.ok)
|
|
33
|
+
return (0, helpers_1.jsonError)(clients.error);
|
|
34
|
+
if (clients.mode === 'single') {
|
|
35
|
+
const dispatch = await ctx.dispatchTool(tool, parsed.args, clients.clientId);
|
|
36
|
+
if (!dispatch.ok)
|
|
37
|
+
return (0, helpers_1.jsonError)(dispatch.error);
|
|
38
|
+
return { content: ctx.formatResult(dispatch.result) };
|
|
39
|
+
}
|
|
40
|
+
const results = await Promise.all(clients.ids.map(async (id) => {
|
|
41
|
+
const result = await ctx.dispatchTool(tool, parsed.args, id);
|
|
42
|
+
return { clientId: id, result };
|
|
43
|
+
}));
|
|
44
|
+
return { content: (0, helpers_1.buildBroadcastContent)(results, ctx.formatResult) };
|
|
35
45
|
});
|
|
36
46
|
};
|
|
37
47
|
exports.registerCallTool = registerCallTool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../../src/server/tools/call.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../../src/server/tools/call.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAExB,8CAO0B;AAC1B,gDAAqD;AAE9C,MAAM,gBAAgB,GAAG,CAAC,GAAc,EAAE,GAAkB,EAAQ,EAAE;IAC3E,GAAG,CAAC,YAAY,CACd,MAAM,EACN;QACE,WAAW,EAAE;YACX,aAAa,EAAE,IAAI;YACnB,KAAK,EAAE,WAAW;SACnB;QACD,WAAW,EACT,obAAob;QACtb,WAAW,EAAE;YACX,IAAI,EAAE,OAAC;iBACJ,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;iBACtD,QAAQ,EAAE;iBACV,QAAQ,CACP,2FAA2F,CAC5F;YACH,QAAQ,EAAE,OAAC;iBACR,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;iBACxC,QAAQ,EAAE;iBACV,QAAQ,CACP,wMAAwM,CACzM;YACH,IAAI,EAAE,OAAC;iBACJ,MAAM,EAAE;iBACR,QAAQ,CACP,8BAA8B,2BAAgB,4BAA4B,2BAAgB,YAAY,CACvG;SACJ;KACF,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE;QACjC,MAAM,MAAM,GAAG,IAAA,uBAAa,EAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAA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AAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,
|
|
1
|
+
{"version":3,"file":"describeTool.d.ts","sourceRoot":"","sources":["../../../src/server/tools/describeTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAKL,KAAK,aAAa,EAEnB,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,wBAAwB,QAAS,SAAS,OAAO,aAAa,KAAG,IAgL7E,CAAC"}
|
|
@@ -10,17 +10,20 @@ const registerDescribeToolTool = (mcp, ctx) => {
|
|
|
10
10
|
readOnlyHint: true,
|
|
11
11
|
title: 'Describe Tool',
|
|
12
12
|
},
|
|
13
|
-
description: 'Fetch the full description and input schema for a single tool. Use this after list_tools to learn how to construct arguments for a tool before calling it. For host tools, clientId is ignored. For in-app tools, omit clientId to auto-pick the shared descriptor; specify
|
|
13
|
+
description: 'Fetch the full description and input schema for a single tool. Use this after list_tools to learn how to construct arguments for a tool before calling it. For host tools, clientId is ignored. For in-app tools, omit clientId to auto-pick the shared descriptor; specify a string clientId to pin to one client, or an array of clientIds to narrow the auto-pick to that subset (useful when other clients have a divergent schema).',
|
|
14
14
|
inputSchema: {
|
|
15
15
|
clientId: zod_1.z
|
|
16
|
-
.string()
|
|
16
|
+
.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())])
|
|
17
17
|
.optional()
|
|
18
|
-
.describe('Target client
|
|
18
|
+
.describe('Target client(s) for in-app tools. String pins to one client; array narrows the canonicalisation pool to the listed clients. Ignored for host tools.'),
|
|
19
19
|
tool: zod_1.z
|
|
20
20
|
.string()
|
|
21
21
|
.describe(`Full tool name in the format "module${protocol_1.MODULE_SEPARATOR}method" (e.g. "navigation${protocol_1.MODULE_SEPARATOR}navigate", "host${protocol_1.MODULE_SEPARATOR}screenshot").`),
|
|
22
22
|
},
|
|
23
23
|
}, async ({ clientId, tool }) => {
|
|
24
|
+
const parsedClient = (0, helpers_1.parseClientIds)(clientId);
|
|
25
|
+
if (!parsedClient.ok)
|
|
26
|
+
return (0, helpers_1.jsonError)(parsedClient.error);
|
|
24
27
|
// 1. Host tool path — resolved via hostToolMap, clientId is ignored
|
|
25
28
|
const hostEntry = ctx.hostToolMap.get(tool);
|
|
26
29
|
if (hostEntry) {
|
|
@@ -45,9 +48,10 @@ const registerDescribeToolTool = (mcp, ctx) => {
|
|
|
45
48
|
],
|
|
46
49
|
};
|
|
47
50
|
}
|
|
48
|
-
// 2. Explicit clientId —
|
|
49
|
-
if (clientId) {
|
|
50
|
-
const
|
|
51
|
+
// 2. Explicit single clientId — pin to one client
|
|
52
|
+
if (parsedClient.mode === 'single' && parsedClient.clientId) {
|
|
53
|
+
const pinned = parsedClient.clientId;
|
|
54
|
+
const client = ctx.bridge.getClient(pinned);
|
|
51
55
|
if (!client) {
|
|
52
56
|
const available = ctx.bridge
|
|
53
57
|
.listClients()
|
|
@@ -55,17 +59,17 @@ const registerDescribeToolTool = (mcp, ctx) => {
|
|
|
55
59
|
return c.id;
|
|
56
60
|
})
|
|
57
61
|
.join(', ') || '(none)';
|
|
58
|
-
return (0, helpers_1.jsonError)(`Client '${
|
|
62
|
+
return (0, helpers_1.jsonError)(`Client '${pinned}' not connected. Available: ${available}`);
|
|
59
63
|
}
|
|
60
64
|
const found = (0, helpers_1.findToolInClient)(client, tool);
|
|
61
65
|
if (!found) {
|
|
62
|
-
return (0, helpers_1.jsonError)(`Tool '${tool}' not found on client '${
|
|
66
|
+
return (0, helpers_1.jsonError)(`Tool '${tool}' not found on client '${pinned}'.`);
|
|
63
67
|
}
|
|
64
68
|
return {
|
|
65
69
|
content: [
|
|
66
70
|
{
|
|
67
71
|
text: JSON.stringify({
|
|
68
|
-
clientIds: [
|
|
72
|
+
clientIds: [pinned],
|
|
69
73
|
description: found.description,
|
|
70
74
|
inputSchema: found.inputSchema,
|
|
71
75
|
name: tool,
|
|
@@ -76,8 +80,23 @@ const registerDescribeToolTool = (mcp, ctx) => {
|
|
|
76
80
|
],
|
|
77
81
|
};
|
|
78
82
|
}
|
|
79
|
-
// 3. Auto-pick across all connected clients
|
|
80
|
-
|
|
83
|
+
// 3. Auto-pick across all connected clients (optionally narrowed by an
|
|
84
|
+
// explicit array of clientIds — only those clients participate in the
|
|
85
|
+
// canonicalisation pool).
|
|
86
|
+
const allClients = ctx.bridge.listClients();
|
|
87
|
+
const clients = parsedClient.mode === 'broadcast'
|
|
88
|
+
? allClients.filter((c) => {
|
|
89
|
+
return parsedClient.ids.includes(c.id);
|
|
90
|
+
})
|
|
91
|
+
: allClients;
|
|
92
|
+
if (parsedClient.mode === 'broadcast' && clients.length === 0) {
|
|
93
|
+
const available = allClients
|
|
94
|
+
.map((c) => {
|
|
95
|
+
return c.id;
|
|
96
|
+
})
|
|
97
|
+
.join(', ') || '(none)';
|
|
98
|
+
return (0, helpers_1.jsonError)(`None of the requested clients (${parsedClient.ids.join(', ')}) are connected. Available: ${available}`);
|
|
99
|
+
}
|
|
81
100
|
const matches = [];
|
|
82
101
|
for (const c of clients) {
|
|
83
102
|
const found = (0, helpers_1.findToolInClient)(c, tool);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describeTool.js","sourceRoot":"","sources":["../../../src/server/tools/describeTool.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"describeTool.js","sourceRoot":"","sources":["../../../src/server/tools/describeTool.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAExB,8CAO0B;AAC1B,gDAAqD;AAE9C,MAAM,wBAAwB,GAAG,CAAC,GAAc,EAAE,GAAkB,EAAQ,EAAE;IACnF,GAAG,CAAC,YAAY,CACd,eAAe,EACf;QACE,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,KAAK,EAAE,eAAe;SACvB;QACD,WAAW,EACT,0aAA0a;QAC5a,WAAW,EAAE;YACX,QAAQ,EAAE,OAAC;iBACR,KAA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BAAqB,CACrG,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAhLW,QAAA,wBAAwB,4BAgLnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listTools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/listTools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,
|
|
1
|
+
{"version":3,"file":"listTools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/listTools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAIL,KAAK,aAAa,EAEnB,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,qBAAqB,QAAS,SAAS,OAAO,aAAa,KAAG,IAiI1E,CAAC"}
|
|
@@ -10,12 +10,12 @@ const registerListToolsTool = (mcp, ctx) => {
|
|
|
10
10
|
readOnlyHint: true,
|
|
11
11
|
title: 'List Tools',
|
|
12
12
|
},
|
|
13
|
-
description: 'Browse available tools with compact (schema-free) descriptions. Modules with identical shape across multiple clients are deduplicated into a single entry with a clientIds array. Use describe_tool to fetch the full input schema for a specific tool before calling it. Pass `module` to narrow to one module, `clientId` to narrow to one client, `compact: true` to drop long module-level descriptions.',
|
|
13
|
+
description: 'Browse available tools with compact (schema-free) descriptions. Modules with identical shape across multiple clients are deduplicated into a single entry with a clientIds array. Use describe_tool to fetch the full input schema for a specific tool before calling it. Pass `module` to narrow to one module, `clientId` to narrow to one client (string) or several clients (array, e.g. ["ios-1", "android-1"]), `compact: true` to drop long module-level descriptions.',
|
|
14
14
|
inputSchema: {
|
|
15
15
|
clientId: zod_1.z
|
|
16
|
-
.string()
|
|
16
|
+
.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())])
|
|
17
17
|
.optional()
|
|
18
|
-
.describe('Narrow listing to a single client. Omit for all connected clients.'),
|
|
18
|
+
.describe('Narrow listing to a single client (string) or several clients (array). Omit for all connected clients.'),
|
|
19
19
|
compact: zod_1.z
|
|
20
20
|
.boolean()
|
|
21
21
|
.optional()
|
|
@@ -26,12 +26,19 @@ const registerListToolsTool = (mcp, ctx) => {
|
|
|
26
26
|
.describe('Narrow listing to a single module name (e.g. "fiber_tree", "host"). Omit for all.'),
|
|
27
27
|
},
|
|
28
28
|
}, async ({ clientId, compact, module }) => {
|
|
29
|
+
const filter = (0, helpers_1.parseClientIds)(clientId);
|
|
30
|
+
if (!filter.ok)
|
|
31
|
+
return (0, helpers_1.jsonError)(filter.error);
|
|
29
32
|
const allClients = ctx.bridge.listClients();
|
|
30
|
-
const clients =
|
|
33
|
+
const clients = filter.mode === 'broadcast'
|
|
31
34
|
? allClients.filter((c) => {
|
|
32
|
-
return c.id
|
|
35
|
+
return filter.ids.includes(c.id);
|
|
33
36
|
})
|
|
34
|
-
:
|
|
37
|
+
: filter.clientId
|
|
38
|
+
? allClients.filter((c) => {
|
|
39
|
+
return c.id === filter.clientId;
|
|
40
|
+
})
|
|
41
|
+
: allClients;
|
|
35
42
|
// Dedup tool groups across clients by canonical shape
|
|
36
43
|
const dedupMap = new Map();
|
|
37
44
|
for (const client of clients) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listTools.js","sourceRoot":"","sources":["../../../src/server/tools/listTools.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"listTools.js","sourceRoot":"","sources":["../../../src/server/tools/listTools.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAExB,8CAM0B;AAC1B,gDAAqD;AAE9C,MAAM,qBAAqB,GAAG,CAAC,GAAc,EAAE,GAAkB,EAAQ,EAAE;IAChF,GAAG,CAAC,YAAY,CACd,YAAY,EACZ;QACE,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,KAAK,EAAE,YAAY;SACpB;QACD,WAAW,EACT,+cAA+c;QACjd,WAAW,EAAE;YAC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,CAAC;YACzB,OAAO,CAAC,WAAW,GAAG,mCAAmC,CAAC;QAC5D,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,CAAC;SAC7E,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAjIW,QAAA,qBAAqB,yBAiIhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitUntil.d.ts","sourceRoot":"","sources":["../../../src/server/tools/waitUntil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,
|
|
1
|
+
{"version":3,"file":"waitUntil.d.ts","sourceRoot":"","sources":["../../../src/server/tools/waitUntil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAA4C,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAwEhG,eAAO,MAAM,qBAAqB,QAAS,SAAS,OAAO,aAAa,KAAG,IAgJ1E,CAAC"}
|
|
@@ -5,6 +5,48 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const helpers_1 = require("../../server/helpers");
|
|
6
6
|
const predicate_1 = require("../../server/predicate");
|
|
7
7
|
const protocol_1 = require("../../shared/protocol");
|
|
8
|
+
const pollForClient = async (ctx, tool, args, clientId, pred, isLeaf, leafPath, timeout, interval) => {
|
|
9
|
+
const started = Date.now();
|
|
10
|
+
let attempts = 0;
|
|
11
|
+
let lastResult;
|
|
12
|
+
let lastError;
|
|
13
|
+
while (Date.now() - started < timeout) {
|
|
14
|
+
attempts += 1;
|
|
15
|
+
const dispatch = await ctx.dispatchTool(tool, args, clientId);
|
|
16
|
+
if (dispatch.ok) {
|
|
17
|
+
lastResult = dispatch.result;
|
|
18
|
+
if ((0, predicate_1.evalPredicate)(lastResult, pred)) {
|
|
19
|
+
const outcome = {
|
|
20
|
+
attempts,
|
|
21
|
+
elapsedMs: Date.now() - started,
|
|
22
|
+
ok: true,
|
|
23
|
+
};
|
|
24
|
+
if (isLeaf)
|
|
25
|
+
outcome.matched = (0, predicate_1.resolvePath)(lastResult, leafPath);
|
|
26
|
+
return outcome;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
lastError = dispatch.error;
|
|
31
|
+
}
|
|
32
|
+
const remaining = timeout - (Date.now() - started);
|
|
33
|
+
if (remaining <= 0)
|
|
34
|
+
break;
|
|
35
|
+
await new Promise((r) => {
|
|
36
|
+
return setTimeout(r, Math.min(interval, remaining));
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
attempts,
|
|
41
|
+
elapsedMs: Date.now() - started,
|
|
42
|
+
lastError,
|
|
43
|
+
lastResult,
|
|
44
|
+
ok: false,
|
|
45
|
+
reason: lastError
|
|
46
|
+
? `Last dispatch failed: ${lastError}`
|
|
47
|
+
: `Predicate did not hold within ${timeout}ms`,
|
|
48
|
+
};
|
|
49
|
+
};
|
|
8
50
|
const registerWaitUntilTool = (mcp, ctx) => {
|
|
9
51
|
mcp.registerTool('wait_until', {
|
|
10
52
|
annotations: {
|
|
@@ -30,15 +72,23 @@ PREDICATE
|
|
|
30
72
|
Example: { all: [{op:"equals", path:"name", value:"CART"}, {op:"gt", path:"items.length", value:0}] }
|
|
31
73
|
|
|
32
74
|
RETURNS
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
75
|
+
Single client (clientId omitted or a string):
|
|
76
|
+
{ ok: true, attempts, elapsedMs, matched? } on success — matched is the path-
|
|
77
|
+
resolved value for leaf predicates, omitted for compound.
|
|
78
|
+
{ ok: false, reason, attempts, elapsedMs, lastResult, lastError? } on timeout.
|
|
79
|
+
|
|
80
|
+
Broadcast (clientId is an array — polls each client in parallel under the
|
|
81
|
+
shared timeout): { ok, perClient: [{ clientId, ok, attempts, elapsedMs, matched? | lastResult, lastError? }, ...] }
|
|
82
|
+
with overall ok = every client matched within its budget.`,
|
|
36
83
|
inputSchema: {
|
|
37
84
|
args: zod_1.z
|
|
38
85
|
.union([zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())])
|
|
39
86
|
.optional()
|
|
40
87
|
.describe('Arguments for the polled tool — object or JSON string.'),
|
|
41
|
-
clientId: zod_1.z
|
|
88
|
+
clientId: zod_1.z
|
|
89
|
+
.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())])
|
|
90
|
+
.optional()
|
|
91
|
+
.describe('Target client ID(s). String polls one client; array broadcasts the poll to multiple clients in parallel and reports per-client outcomes. Same auto-resolution semantics as `call`.'),
|
|
42
92
|
intervalMs: zod_1.z
|
|
43
93
|
.number()
|
|
44
94
|
.optional()
|
|
@@ -58,60 +108,60 @@ RETURNS
|
|
|
58
108
|
const parsedArgs = (0, helpers_1.parseCallArgs)(args);
|
|
59
109
|
if (!parsedArgs.ok)
|
|
60
110
|
return (0, helpers_1.jsonError)(parsedArgs.error);
|
|
111
|
+
const clients = (0, helpers_1.parseClientIds)(clientId);
|
|
112
|
+
if (!clients.ok)
|
|
113
|
+
return (0, helpers_1.jsonError)(clients.error);
|
|
61
114
|
const pred = predicate;
|
|
62
115
|
const isLeaf = (0, predicate_1.isLeafPredicate)(pred);
|
|
63
116
|
const leafPath = isLeaf ? pred.path : undefined;
|
|
64
117
|
const timeout = Math.max(500, Math.min(60_000, timeoutMs ?? 10_000));
|
|
65
118
|
const interval = Math.max(50, Math.min(5_000, intervalMs ?? 300));
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const payload = {
|
|
77
|
-
attempts,
|
|
78
|
-
elapsedMs: Date.now() - started,
|
|
79
|
-
ok: true,
|
|
80
|
-
};
|
|
81
|
-
if (isLeaf) {
|
|
82
|
-
payload.matched = (0, predicate_1.resolvePath)(lastResult, leafPath);
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
content: [{ text: JSON.stringify(payload, null, 2), type: 'text' }],
|
|
86
|
-
};
|
|
87
|
-
}
|
|
119
|
+
if (clients.mode === 'single') {
|
|
120
|
+
const outcome = await pollForClient(ctx, tool, parsedArgs.args, clients.clientId, pred, isLeaf, leafPath, timeout, interval);
|
|
121
|
+
const payload = {
|
|
122
|
+
attempts: outcome.attempts,
|
|
123
|
+
elapsedMs: outcome.elapsedMs,
|
|
124
|
+
ok: outcome.ok,
|
|
125
|
+
};
|
|
126
|
+
if (outcome.ok) {
|
|
127
|
+
if (isLeaf)
|
|
128
|
+
payload.matched = outcome.matched;
|
|
88
129
|
}
|
|
89
130
|
else {
|
|
90
|
-
|
|
131
|
+
payload.lastResult = outcome.lastResult;
|
|
132
|
+
payload.reason = outcome.reason;
|
|
133
|
+
if (outcome.lastError)
|
|
134
|
+
payload.lastError = outcome.lastError;
|
|
91
135
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
await new Promise((r) => {
|
|
96
|
-
return setTimeout(r, Math.min(interval, remaining));
|
|
97
|
-
});
|
|
136
|
+
return {
|
|
137
|
+
content: [{ text: JSON.stringify(payload, null, 2), type: 'text' }],
|
|
138
|
+
};
|
|
98
139
|
}
|
|
140
|
+
const perClient = await Promise.all(clients.ids.map(async (id) => {
|
|
141
|
+
const outcome = await pollForClient(ctx, tool, parsedArgs.args, id, pred, isLeaf, leafPath, timeout, interval);
|
|
142
|
+
const entry = {
|
|
143
|
+
attempts: outcome.attempts,
|
|
144
|
+
clientId: id,
|
|
145
|
+
elapsedMs: outcome.elapsedMs,
|
|
146
|
+
ok: outcome.ok,
|
|
147
|
+
};
|
|
148
|
+
if (outcome.ok) {
|
|
149
|
+
if (isLeaf)
|
|
150
|
+
entry.matched = outcome.matched;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
entry.lastResult = outcome.lastResult;
|
|
154
|
+
entry.reason = outcome.reason;
|
|
155
|
+
if (outcome.lastError)
|
|
156
|
+
entry.lastError = outcome.lastError;
|
|
157
|
+
}
|
|
158
|
+
return entry;
|
|
159
|
+
}));
|
|
160
|
+
const ok = perClient.every((entry) => {
|
|
161
|
+
return entry.ok === true;
|
|
162
|
+
});
|
|
99
163
|
return {
|
|
100
|
-
content: [
|
|
101
|
-
{
|
|
102
|
-
text: JSON.stringify({
|
|
103
|
-
attempts,
|
|
104
|
-
elapsedMs: Date.now() - started,
|
|
105
|
-
lastError,
|
|
106
|
-
lastResult,
|
|
107
|
-
ok: false,
|
|
108
|
-
reason: lastError
|
|
109
|
-
? `Last dispatch failed: ${lastError}`
|
|
110
|
-
: `Predicate did not hold within ${timeout}ms`,
|
|
111
|
-
}, null, 2),
|
|
112
|
-
type: 'text',
|
|
113
|
-
},
|
|
114
|
-
],
|
|
164
|
+
content: [{ text: JSON.stringify({ ok, perClient }, null, 2), type: 'text' }],
|
|
115
165
|
};
|
|
116
166
|
});
|
|
117
167
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitUntil.js","sourceRoot":"","sources":["../../../src/server/tools/waitUntil.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"waitUntil.js","sourceRoot":"","sources":["../../../src/server/tools/waitUntil.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AAExB,8CAAgG;AAChG,kDAM4B;AAC5B,gDAAqD;AAYrD,MAAM,aAAa,GAAG,KAAK,EACzB,GAAkB,EAClB,IAAY,EACZ,IAA6B,EAC7B,QAA4B,EAC5B,IAAe,EACf,MAAe,EACf,QAA4B,EAC5B,OAAe,EACf,QAAgB,EACM,EAAE;IACxB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,IAAI,QAAQ,GAAG,CAA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CAAC,SAAS;oBAAE,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;YAC7D,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CACH,CAAC;QAEF,MAAM,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACnC,OAAO,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,CAAC;SACvF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAhJW,QAAA,qBAAqB,yBAgJhC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-mcp-kit",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "MCP server for React Native — drive, inspect, and debug running RN apps from AI agents via the real OS gesture pipeline",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Aliaksei Pranko",
|