@farmslot/adapter-rn 0.15.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/CHANGELOG.md +117 -0
- package/LICENSE +21 -0
- package/README.md +143 -0
- package/bin/farmslot-adapter-rn.mjs +10 -0
- package/dist/agent-device-ui-transport.d.ts +88 -0
- package/dist/agent-device-ui-transport.d.ts.map +1 -0
- package/dist/agent-device-ui-transport.js +1148 -0
- package/dist/agent-device-ui-transport.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +169 -0
- package/dist/cli.js.map +1 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +6 -0
- package/dist/constants.js.map +1 -0
- package/dist/doctor.d.ts +17 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +125 -0
- package/dist/doctor.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/json.d.ts +2 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +5 -0
- package/dist/json.js.map +1 -0
- package/dist/metro-recipe-bridge-transport.d.ts +12 -0
- package/dist/metro-recipe-bridge-transport.d.ts.map +1 -0
- package/dist/metro-recipe-bridge-transport.js +63 -0
- package/dist/metro-recipe-bridge-transport.js.map +1 -0
- package/dist/redaction.d.ts +3 -0
- package/dist/redaction.d.ts.map +1 -0
- package/dist/redaction.js +57 -0
- package/dist/redaction.js.map +1 -0
- package/dist/runner.d.ts +20 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +270 -0
- package/dist/runner.js.map +1 -0
- package/dist/scaffold.d.ts +14 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +82 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/simctl-video-recorder.d.ts +6 -0
- package/dist/simctl-video-recorder.d.ts.map +1 -0
- package/dist/simctl-video-recorder.js +160 -0
- package/dist/simctl-video-recorder.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +11 -0
- package/dist/version.js.map +1 -0
- package/package.json +81 -0
- package/templates/scripts/agentic/recipe/README.md +15 -0
- package/templates/scripts/agentic/recipe/action-manifest.json +547 -0
- package/templates/scripts/agentic/recipe/action-manifest.with-bridge.json +599 -0
- package/templates/scripts/agentic/recipe/recipes/expo.config.recipe.json +37 -0
- package/templates/scripts/agentic/validate-recipe.sh +64 -0
- package/templates/src/farmslot/RecipeBridgeProvider.tsx +127 -0
- package/templates/src/farmslot/RecipeHud.tsx +138 -0
- package/templates/src/farmslot/index.ts +11 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
3
|
+
import { errorMessage, manifestTarget, } from '@farmslot/recipe-runner';
|
|
4
|
+
const DEFAULT_STOP_TIMEOUT_MS = 20_000;
|
|
5
|
+
export function createSimctlVideoRecorder(options = {}) {
|
|
6
|
+
return new SimctlVideoRecorder(options);
|
|
7
|
+
}
|
|
8
|
+
class SimctlVideoRecorder {
|
|
9
|
+
#stopTimeoutMs;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.name = 'simctl';
|
|
12
|
+
this.platform = 'ios';
|
|
13
|
+
this.#stopTimeoutMs = options.stopTimeoutMs ?? DEFAULT_STOP_TIMEOUT_MS;
|
|
14
|
+
}
|
|
15
|
+
async doctor() {
|
|
16
|
+
if (process.platform !== 'darwin') {
|
|
17
|
+
return {
|
|
18
|
+
ok: false,
|
|
19
|
+
code: 'unsupported_platform',
|
|
20
|
+
message: 'simctl recordVideo is macOS-only.',
|
|
21
|
+
suggestedFix: 'Run iOS recipe proof on a macOS host or omit --record-video.',
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
let result;
|
|
25
|
+
try {
|
|
26
|
+
result = await runCommand('xcrun', ['simctl', 'help', 'io'], { timeoutMs: 10_000 });
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
return {
|
|
30
|
+
ok: false,
|
|
31
|
+
code: 'simctl_missing',
|
|
32
|
+
message: `xcrun simctl is not available: ${errorMessage(error)}`,
|
|
33
|
+
suggestedFix: 'Install Xcode command-line tools and ensure simctl is on PATH.',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
if (result.exitCode !== 0) {
|
|
37
|
+
return {
|
|
38
|
+
ok: false,
|
|
39
|
+
code: 'simctl_help_failed',
|
|
40
|
+
message: result.stderr.trim() || result.stdout.trim() || 'simctl help io failed.',
|
|
41
|
+
suggestedFix: 'Install Xcode command-line tools and ensure simctl is on PATH.',
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
ok: true,
|
|
46
|
+
code: 'ok',
|
|
47
|
+
message: 'simctl recordVideo is ready.',
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
async start(request) {
|
|
51
|
+
const device = simulatorDevice(request.target);
|
|
52
|
+
const args = [
|
|
53
|
+
'simctl',
|
|
54
|
+
'io',
|
|
55
|
+
device,
|
|
56
|
+
'recordVideo',
|
|
57
|
+
'--codec=h264',
|
|
58
|
+
'--force',
|
|
59
|
+
request.outputPath,
|
|
60
|
+
];
|
|
61
|
+
const child = spawn('xcrun', args, { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
62
|
+
const stderr = [];
|
|
63
|
+
child.stderr.setEncoding('utf-8');
|
|
64
|
+
child.stderr.on('data', (chunk) => stderr.push(chunk));
|
|
65
|
+
child.stdout.resume();
|
|
66
|
+
const exit = new Promise((resolve) => {
|
|
67
|
+
child.once('exit', (code, signal) => resolve({ code, signal }));
|
|
68
|
+
});
|
|
69
|
+
await new Promise((resolve, reject) => {
|
|
70
|
+
const timeout = setTimeout(resolve, 250);
|
|
71
|
+
child.once('error', (error) => {
|
|
72
|
+
clearTimeout(timeout);
|
|
73
|
+
reject(error);
|
|
74
|
+
});
|
|
75
|
+
child.once('exit', (code, signal) => {
|
|
76
|
+
clearTimeout(timeout);
|
|
77
|
+
reject(new Error(`simctl recordVideo exited early (${formatExit(code, signal)}): ${stderr.join('').trim()}`));
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
const stopTimeoutMs = this.#stopTimeoutMs;
|
|
81
|
+
const target = request.target;
|
|
82
|
+
return {
|
|
83
|
+
async stop() {
|
|
84
|
+
if (child.exitCode == null && child.signalCode == null)
|
|
85
|
+
child.kill('SIGINT');
|
|
86
|
+
const result = await waitForExit(exit, {
|
|
87
|
+
timeoutMs: stopTimeoutMs,
|
|
88
|
+
onTimeout: () => child.kill('SIGKILL'),
|
|
89
|
+
message: `simctl recordVideo did not stop within ${stopTimeoutMs}ms after SIGINT.`,
|
|
90
|
+
});
|
|
91
|
+
const expectedInterrupt = result.signal === 'SIGINT';
|
|
92
|
+
if (result.code !== 0 && !expectedInterrupt) {
|
|
93
|
+
throw new Error(`simctl recordVideo failed (${formatExit(result.code, result.signal)}): ${stderr.join('').trim()}`);
|
|
94
|
+
}
|
|
95
|
+
const stats = await stat(request.outputPath);
|
|
96
|
+
if (stats.size <= 0)
|
|
97
|
+
throw new Error(`Recording output is empty: ${request.outputPath}`);
|
|
98
|
+
const bytes = await readFile(request.outputPath);
|
|
99
|
+
if (!bytes.includes(Buffer.from('moov'))) {
|
|
100
|
+
throw new Error(`Recording output is missing moov atom: ${request.outputPath}`);
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
recorder: {
|
|
104
|
+
name: 'simctl',
|
|
105
|
+
platform: 'ios',
|
|
106
|
+
target: manifestTarget(target),
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function runCommand(command, args, options) {
|
|
114
|
+
return new Promise((resolve, reject) => {
|
|
115
|
+
const child = spawn(command, args, { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
116
|
+
let stdout = '';
|
|
117
|
+
let stderr = '';
|
|
118
|
+
const timer = setTimeout(() => {
|
|
119
|
+
child.kill('SIGTERM');
|
|
120
|
+
reject(new Error(`${command} ${args.join(' ')} timed out after ${options.timeoutMs}ms`));
|
|
121
|
+
}, options.timeoutMs);
|
|
122
|
+
child.stdout.setEncoding('utf-8');
|
|
123
|
+
child.stderr.setEncoding('utf-8');
|
|
124
|
+
child.stdout.on('data', (chunk) => (stdout += chunk));
|
|
125
|
+
child.stderr.on('data', (chunk) => (stderr += chunk));
|
|
126
|
+
child.once('error', (error) => {
|
|
127
|
+
clearTimeout(timer);
|
|
128
|
+
reject(error);
|
|
129
|
+
});
|
|
130
|
+
child.once('exit', (exitCode) => {
|
|
131
|
+
clearTimeout(timer);
|
|
132
|
+
resolve({ stdout, stderr, exitCode });
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function waitForExit(exit, options) {
|
|
137
|
+
return new Promise((resolve, reject) => {
|
|
138
|
+
const timer = setTimeout(() => {
|
|
139
|
+
options.onTimeout();
|
|
140
|
+
reject(new Error(options.message));
|
|
141
|
+
}, options.timeoutMs);
|
|
142
|
+
exit.then((result) => {
|
|
143
|
+
clearTimeout(timer);
|
|
144
|
+
resolve(result);
|
|
145
|
+
}, (error) => {
|
|
146
|
+
clearTimeout(timer);
|
|
147
|
+
reject(error);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function simulatorDevice(target) {
|
|
152
|
+
if (target.kind !== 'simulator') {
|
|
153
|
+
throw new Error('simctl recorder requires a simulator recording target.');
|
|
154
|
+
}
|
|
155
|
+
return target.device;
|
|
156
|
+
}
|
|
157
|
+
function formatExit(code, signal) {
|
|
158
|
+
return signal ? `signal ${signal}` : `exit ${code ?? 'unknown'}`;
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=simctl-video-recorder.js.map
|
|
@@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;YAC5B,OAAO,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACrC,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,CACP,CAAC,MAAM,EAAE,EAAE;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,EACD,CAAC,KAAc,EAAE,EAAE;YACjB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,eAAe,CAAC,MAAuB;IAC9C,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC;AACvB,CAAC;AAED,SAAS,UAAU,CAAC,IAAmB,EAAE,MAA6B;IACpE,OAAO,MAAM,CAAC,CAAC,CAAC,UAAU,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,IAAI,SAAS,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AASA,gFAAgF;AAChF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExE,CAAC"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
const packageJson = require('../package.json');
|
|
4
|
+
if (typeof packageJson.version !== 'string' || !packageJson.version) {
|
|
5
|
+
throw new Error('@farmslot/adapter-rn package version is missing.');
|
|
6
|
+
}
|
|
7
|
+
/** Packages this host vouches for when a recipe library declares `requires`. */
|
|
8
|
+
export const ADAPTER_RN_PACKAGE_VERSIONS = {
|
|
9
|
+
'@farmslot/adapter-rn': packageJson.version,
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAA0B,CAAC;AAExE,IAAI,OAAO,WAAW,CAAC,OAAO,KAAK,QAAQ,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;IACpE,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;AACtE,CAAC;AAED,gFAAgF;AAChF,MAAM,CAAC,MAAM,2BAA2B,GAAqC;IAC3E,sBAAsB,EAAE,WAAW,CAAC,OAAO;CAC5C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@farmslot/adapter-rn",
|
|
3
|
+
"version": "0.15.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"farmslot-adapter-rn": "./bin/farmslot-adapter-rn.mjs"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"typecheck": "tsc --noEmit --project tsconfig.json",
|
|
19
|
+
"build": "yarn workspace @farmslot/protocol build && yarn workspace @farmslot/recipe-runner build && rm -rf dist && tsc --project tsconfig.build.json",
|
|
20
|
+
"test": "tsx --tsconfig tsconfig.json --test src/agent-device-ui-transport.test.ts src/adapter-rn.test.ts src/metro-recipe-bridge-transport.test.ts",
|
|
21
|
+
"format": "prettier --write --ignore-path ../../.prettierignore .",
|
|
22
|
+
"format:check": "prettier --check --ignore-path ../../.prettierignore .",
|
|
23
|
+
"lint": "eslint \"src/**/*.ts\" \"templates/src/farmslot/**/*.{ts,tsx}\"",
|
|
24
|
+
"quality": "prettier --check --ignore-path ../../.prettierignore . && eslint \"src/**/*.ts\" \"templates/src/farmslot/**/*.{ts,tsx}\" && tsc --noEmit --project tsconfig.json && yarn build && yarn test",
|
|
25
|
+
"prepack": "yarn build",
|
|
26
|
+
"prepublishOnly": "node ../../scripts/quality/check-farmslot-package-readiness.mjs --publish --packages @farmslot/adapter-rn"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@farmslot/protocol": "0.34.0",
|
|
30
|
+
"@farmslot/recipe-runner": "0.23.0",
|
|
31
|
+
"pngjs": "^7.0.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"agent-device": ">=0.19.3"
|
|
35
|
+
},
|
|
36
|
+
"peerDependenciesMeta": {
|
|
37
|
+
"agent-device": {
|
|
38
|
+
"optional": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^22.0.0",
|
|
43
|
+
"@types/pngjs": "^6.0.5",
|
|
44
|
+
"agent-device": "0.19.3",
|
|
45
|
+
"eslint": "^10.3.0",
|
|
46
|
+
"prettier": "^3.8.3",
|
|
47
|
+
"tsx": "^4.19.0",
|
|
48
|
+
"typescript": "^5.6.0"
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/deeeed/farmslot.git",
|
|
53
|
+
"directory": "packages/adapter-rn"
|
|
54
|
+
},
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/deeeed/farmslot/issues"
|
|
57
|
+
},
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"homepage": "https://farmslot.io/docs/guides/adapter-rn",
|
|
60
|
+
"keywords": [
|
|
61
|
+
"farmslot",
|
|
62
|
+
"expo",
|
|
63
|
+
"react-native",
|
|
64
|
+
"recipe",
|
|
65
|
+
"validation",
|
|
66
|
+
"agentic-engineering"
|
|
67
|
+
],
|
|
68
|
+
"files": [
|
|
69
|
+
"README.md",
|
|
70
|
+
"LICENSE",
|
|
71
|
+
"bin/**/*.mjs",
|
|
72
|
+
"dist/**/*.js",
|
|
73
|
+
"dist/**/*.d.ts",
|
|
74
|
+
"dist/**/*.d.ts.map",
|
|
75
|
+
"dist/**/*.js.map",
|
|
76
|
+
"templates/**/*"
|
|
77
|
+
],
|
|
78
|
+
"publishConfig": {
|
|
79
|
+
"access": "public"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Farmslot recipe
|
|
2
|
+
|
|
3
|
+
This directory was generated by `@farmslot/adapter-rn`.
|
|
4
|
+
|
|
5
|
+
The files use Recipe Protocol v1, but the project-facing path and scripts are intentionally versionless so future protocol upgrades do not churn app code.
|
|
6
|
+
|
|
7
|
+
## Quality rules
|
|
8
|
+
|
|
9
|
+
- Keep the default manifest small. Add only capabilities this project actually supports.
|
|
10
|
+
- Prefer one parameterized domain action over many near-duplicates.
|
|
11
|
+
- Do not add task, ticket, or one-off debug actions to reusable manifests.
|
|
12
|
+
- Use UI actions only when the proof must show real user-visible interaction.
|
|
13
|
+
- Use commands/controllers for setup, diagnostics, and non-visual checks.
|
|
14
|
+
- Use `yarn recipe:run --record-video` only when visual motion proof is useful; it records one whole-recipe MP4 through `capture-helper`.
|
|
15
|
+
- If you declare app/HUD bridge actions, wire the dev-only bridge and run `yarn recipe:doctor`.
|