@farmslot/adapter-sdk 0.1.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 ADDED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@farmslot/adapter-sdk` are tracked here.
4
+
5
+ ## Unreleased
6
+
7
+ - Active-development baseline; add user-facing changes here before release or package publication.
8
+
9
+ ## 0.1.0 - 2026-10-04
10
+
11
+ - Add the platform adapter contract: `PlatformAdapter` and its member types, `defineAdapter`, and `createAdapterRegistry`. A registry refuses a duplicate id and any adapter written for another `sdkVersion`. Extracted from the metamask-harness adapter surface; a host extends `PlatformAdapter` with its own members.
12
+ - Publish with protocol 0.34.0 and recipe-runner 0.23.0.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Arthur Breton
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # @farmslot/adapter-sdk
2
+
3
+ The platform adapter contract for recipe harnesses. A platform adapter owns everything one
4
+ target kind needs (ports, readiness, logs, the action set, install/verify/cleanup, recording and
5
+ diagnostics), so the commands that drive it never compare adapter ids.
6
+
7
+ ```ts
8
+ import { createAdapterRegistry, defineAdapter } from '@farmslot/adapter-sdk';
9
+
10
+ const web = defineAdapter({ id: 'web', sdkVersion: 1, headless: false /* … */ });
11
+ const registry = createAdapterRegistry();
12
+ registry.register(web);
13
+ registry.get('web');
14
+ ```
15
+
16
+ A host extends `PlatformAdapter` with its own members and types its registry with that:
17
+ `createAdapterRegistry<HostAdapter>()`. A registry refuses a duplicate id and any adapter whose
18
+ `sdkVersion` differs from `ADAPTER_SDK_VERSION`.
19
+
20
+ Docs: https://farmslot.io/docs/reference/adapter-sdk
21
+
22
+ ## Source layout
23
+
24
+ | path | owns |
25
+ | ----------------- | ------------------------------------------------------------- |
26
+ | `src/types.ts` | `PlatformAdapter`, its member types and `ADAPTER_SDK_VERSION` |
27
+ | `src/registry.ts` | `defineAdapter` and `createAdapterRegistry` |
28
+
29
+ ## Maintenance rules
30
+
31
+ - Types first. The only runtime code is the registry and its shape check.
32
+ - No platform or product names. A behavior one platform needs becomes an optional member.
33
+ - Removing or renaming a member is a breaking change: bump `ADAPTER_SDK_VERSION`.
34
+
35
+ ## Local quality
36
+
37
+ ```sh
38
+ yarn workspace @farmslot/adapter-sdk quality
39
+ ```
@@ -0,0 +1,3 @@
1
+ export { type AdapterRegistry, createAdapterRegistry, defineAdapter } from './registry.js';
2
+ export { ADAPTER_SDK_VERSION, type AdapterActions, type AdapterCdpTarget, type AdapterConsoleFiles, type AdapterDevServer, type AdapterDevServerStop, type AdapterDiagnostics, type AdapterHarness, type AdapterHarnessLeaf, type AdapterHarnessVerify, type AdapterHints, type AdapterLogSource, type AdapterRecording, type AdapterRuntimeContextSpec, type AdapterRuntimeStatus, type AdapterSdkVersion, type AdapterUiHarness, type AdapterUiTransport, type NativeUiTransport, type NativeUiTransportOptions, type PlatformAdapter, } from './types.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,EACL,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { createAdapterRegistry, defineAdapter } from './registry.js';
2
+ export { ADAPTER_SDK_VERSION, } from './types.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,qBAAqB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,EACL,mBAAmB,GAqBpB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type PlatformAdapter } from './types.js';
2
+ export interface AdapterRegistry<A extends PlatformAdapter = PlatformAdapter> {
3
+ register(adapter: A): void;
4
+ get(id: string): A;
5
+ has(id: string): boolean;
6
+ list(): string[];
7
+ }
8
+ /** Type and shape-check a platform adapter where it is written. */
9
+ export declare function defineAdapter<A extends PlatformAdapter>(adapter: A): A;
10
+ /** A registry keyed by adapter id. Registering an id twice throws. */
11
+ export declare function createAdapterRegistry<A extends PlatformAdapter = PlatformAdapter>(): AdapterRegistry<A>;
12
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAEvE,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe;IAC1E,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;IAC3B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC;IACnB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAEzB,IAAI,IAAI,MAAM,EAAE,CAAC;CAClB;AAeD,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,CAAC,SAAS,eAAe,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAGtE;AAED,sEAAsE;AACtE,wBAAgB,qBAAqB,CACnC,CAAC,SAAS,eAAe,GAAG,eAAe,KACxC,eAAe,CAAC,CAAC,CAAC,CAmBtB"}
@@ -0,0 +1,38 @@
1
+ import { ADAPTER_SDK_VERSION } from './types.js';
2
+ // Throws when the adapter cannot be registered by any host: a missing id, or an
3
+ // SDK version this package does not implement.
4
+ function assertAdapterShape(adapter) {
5
+ if (typeof adapter.id !== 'string' || adapter.id.trim() === '') {
6
+ throw new Error('adapter id must be a non-empty string');
7
+ }
8
+ if (adapter.sdkVersion !== ADAPTER_SDK_VERSION) {
9
+ throw new Error(`adapter '${adapter.id}' targets adapter SDK ${String(adapter.sdkVersion)}; this host implements ${ADAPTER_SDK_VERSION}`);
10
+ }
11
+ }
12
+ /** Type and shape-check a platform adapter where it is written. */
13
+ export function defineAdapter(adapter) {
14
+ assertAdapterShape(adapter);
15
+ return adapter;
16
+ }
17
+ /** A registry keyed by adapter id. Registering an id twice throws. */
18
+ export function createAdapterRegistry() {
19
+ const adapters = new Map();
20
+ const registry = {
21
+ register(adapter) {
22
+ assertAdapterShape(adapter);
23
+ if (adapters.has(adapter.id))
24
+ throw new Error(`adapter '${adapter.id}' is already registered`);
25
+ adapters.set(adapter.id, adapter);
26
+ },
27
+ get(id) {
28
+ const adapter = adapters.get(id);
29
+ if (!adapter)
30
+ throw new Error(`unknown adapter '${id}' (registered: ${registry.list().join(', ')})`);
31
+ return adapter;
32
+ },
33
+ has: (id) => adapters.has(id),
34
+ list: () => [...adapters.keys()],
35
+ };
36
+ return registry;
37
+ }
38
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAwB,MAAM,YAAY,CAAC;AAUvE,gFAAgF;AAChF,+CAA+C;AAC/C,SAAS,kBAAkB,CAAC,OAAwB;IAClD,IAAI,OAAO,OAAO,CAAC,EAAE,KAAK,QAAQ,IAAI,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,OAAO,CAAC,UAAU,KAAK,mBAAmB,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CACb,YAAY,OAAO,CAAC,EAAE,yBAAyB,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,0BAA0B,mBAAmB,EAAE,CACzH,CAAC;IACJ,CAAC;AACH,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,aAAa,CAA4B,OAAU;IACjE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,qBAAqB;IAGnC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAa,CAAC;IACtC,MAAM,QAAQ,GAAuB;QACnC,QAAQ,CAAC,OAAO;YACd,kBAAkB,CAAC,OAAO,CAAC,CAAC;YAC5B,IAAI,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,CAAC,EAAE,yBAAyB,CAAC,CAAC;YACnE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACpC,CAAC;QACD,GAAG,CAAC,EAAE;YACJ,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACjC,IAAI,CAAC,OAAO;gBACV,MAAM,IAAI,KAAK,CAAC,oBAAoB,EAAE,kBAAkB,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACzF,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;KACjC,CAAC;IACF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,175 @@
1
+ import type { RecipeValidationFinding } from '@farmslot/protocol';
2
+ import type { ActionAdapter, ActionExecutionContext, RecordingTarget, RecordingTargetContext, StandardUiAction, UiActionTransport, VideoRecorder } from '@farmslot/recipe-runner';
3
+ import type { CreateCdpWebUiTransportOptions } from '@farmslot/recipe-runner/runtime/cdp';
4
+ import type { CreateReactNativeBridgeUiTransportOptions } from '@farmslot/recipe-runner/runtime/react-native-bridge';
5
+ /** The adapter SDK major version a host implements. */
6
+ export declare const ADAPTER_SDK_VERSION = 1;
7
+ export type AdapterSdkVersion = typeof ADAPTER_SDK_VERSION;
8
+ export interface PlatformAdapter {
9
+ /** Registry key and the value of `--adapter`. */
10
+ readonly id: string;
11
+ /** The SDK version this adapter was written against. A host refuses any other. */
12
+ readonly sdkVersion: AdapterSdkVersion;
13
+ readonly headless: boolean;
14
+ resolveSlotPorts(target: string): void;
15
+ runtimeStatus(target: string): Promise<AdapterRuntimeStatus>;
16
+ devServer: AdapterDevServer;
17
+ logSources(target: string): AdapterLogSource[];
18
+ appLogSource(target: string): AdapterLogSource | null;
19
+ hints: AdapterHints;
20
+ actions: AdapterActions;
21
+ harness: AdapterHarness;
22
+ runtimeContext: AdapterRuntimeContextSpec;
23
+ reload?(target: string, json: boolean): Promise<number>;
24
+ recording?: AdapterRecording;
25
+ diagnostics?: AdapterDiagnostics;
26
+ sourceFingerprint?(root: string): string;
27
+ }
28
+ export interface AdapterRuntimeStatus {
29
+ decision: string;
30
+ reasonCode?: string;
31
+ reasons: string[];
32
+ nextAction?: string;
33
+ deps?: string;
34
+ devServer?: {
35
+ label: string;
36
+ status: string;
37
+ };
38
+ }
39
+ export interface AdapterLogSource {
40
+ label: string;
41
+ path: string;
42
+ }
43
+ export type AdapterDevServerStop = {
44
+ kind: 'headless';
45
+ message: string;
46
+ userAction: string;
47
+ } | {
48
+ kind: 'stopped';
49
+ status: number;
50
+ summary: string;
51
+ signalled?: number;
52
+ output?: string;
53
+ };
54
+ export interface AdapterDevServer {
55
+ label: string;
56
+ describe(): string;
57
+ stop(target: string): AdapterDevServerStop;
58
+ afterStop?(target: string): string;
59
+ }
60
+ export interface AdapterHints {
61
+ launch: string;
62
+ relaunch: string;
63
+ runtimeProbeRecovery(target: string): string;
64
+ }
65
+ export interface AdapterActions {
66
+ manifestPath(): string;
67
+ semantic: readonly string[];
68
+ liveOnly?: readonly string[];
69
+ liveNeedsCdpPort?: boolean;
70
+ tsxLiveScripts?: {
71
+ env(projectRoot: string, tempDir: string): Promise<NodeJS.ProcessEnv>;
72
+ };
73
+ cdpTarget: AdapterCdpTarget;
74
+ ui?(harness: AdapterUiHarness, options: {
75
+ hudPolicy: 'auto' | 'show';
76
+ }): AdapterUiTransport;
77
+ wrap?(adapters: ActionAdapter[]): Promise<ActionAdapter[]>;
78
+ lifecycle?(adapters: ActionAdapter[]): Promise<ActionAdapter[]>;
79
+ inputFindings?(nodeId: string, node: Record<string, unknown>): RecipeValidationFinding[];
80
+ }
81
+ export interface AdapterCdpTarget {
82
+ transport: string;
83
+ probePath: string;
84
+ watcherPortFirst?: boolean;
85
+ requiredProbe?(node: Record<string, unknown>, context: ActionExecutionContext): Promise<Record<string, unknown>>;
86
+ }
87
+ export interface NativeUiTransport extends UiActionTransport {
88
+ close?(): Promise<void>;
89
+ }
90
+ export interface NativeUiTransportOptions {
91
+ platform: 'ios' | 'android';
92
+ device: string;
93
+ app: string;
94
+ session: string;
95
+ stateDir: string;
96
+ }
97
+ export interface AdapterUiHarness {
98
+ createReactNativeBridgeUiTransport: (options: CreateReactNativeBridgeUiTransportOptions) => UiActionTransport;
99
+ createCdpWebUiTransport: (options: CreateCdpWebUiTransportOptions) => UiActionTransport;
100
+ createNativeUiTransport?: (options: NativeUiTransportOptions) => Promise<NativeUiTransport>;
101
+ }
102
+ export interface AdapterUiTransport {
103
+ base: UiActionTransport;
104
+ execute?(action: StandardUiAction, node: Record<string, unknown>, context: ActionExecutionContext, standard: () => Promise<unknown>): Promise<unknown>;
105
+ }
106
+ export interface AdapterHarnessLeaf {
107
+ entry: string;
108
+ fallback: string;
109
+ node?: boolean;
110
+ }
111
+ export type AdapterHarnessVerify = {
112
+ command: string;
113
+ prefixArgs: string[];
114
+ } | {
115
+ inProcess(): Promise<(args: string[], io: {
116
+ out(line: string): void;
117
+ err(line: string): void;
118
+ }) => Promise<number>>;
119
+ } | {
120
+ error: string;
121
+ };
122
+ export interface AdapterHarness {
123
+ install: AdapterHarnessLeaf;
124
+ cleanup: AdapterHarnessLeaf & {
125
+ fromInstalledRunner?: boolean;
126
+ };
127
+ verify(target: string): AdapterHarnessVerify;
128
+ verifyArgs?(target: string, args: string[]): string[];
129
+ restart?: string;
130
+ }
131
+ export interface AdapterRuntimeContextSpec {
132
+ forbiddenFields: readonly string[];
133
+ localPorts?: {
134
+ cdp?: number;
135
+ watcher?: number;
136
+ };
137
+ resources?(ports: {
138
+ watcherPort: unknown;
139
+ existing: Record<string, unknown>;
140
+ defaults: Record<string, string | number>;
141
+ envPort(...names: string[]): number | undefined;
142
+ }): Record<string, unknown>;
143
+ }
144
+ export interface AdapterRecording {
145
+ target(context: RecordingTargetContext): Promise<RecordingTarget>;
146
+ framed?: {
147
+ browserPid(projectRoot: string, artifactsDir: string, cdpPort?: string): number | undefined;
148
+ };
149
+ videoRecorder?(): Promise<VideoRecorder | undefined>;
150
+ }
151
+ export interface AdapterConsoleFiles {
152
+ extensionLog: string;
153
+ pageLog: string;
154
+ pidFile: string;
155
+ }
156
+ export interface AdapterDiagnostics {
157
+ console?: {
158
+ start(projectRoot: string): Promise<void>;
159
+ files(projectRoot: string): AdapterConsoleFiles;
160
+ cdpPort(): string | undefined;
161
+ verifyControl(capture: {
162
+ projectRoot: string;
163
+ cdpPort: string;
164
+ } & AdapterConsoleFiles): Promise<{
165
+ ok: boolean;
166
+ detail: string;
167
+ }>;
168
+ };
169
+ walletLog?(projectRoot: string): string;
170
+ issueBuffer?: {
171
+ arm(projectRoot: string): boolean;
172
+ collect(projectRoot: string): unknown[] | null;
173
+ };
174
+ }
175
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC1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,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,GAAG,mBAAmB,GACtE,OAAO,CAAC;YAAE,EAAE,EAAE,OAAO,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC7C,CAAC;IAEF,SAAS,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAExC,WAAW,CAAC,EAAE;QACZ,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;QAClC,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC;KAChD,CAAC;CACH"}
package/dist/types.js ADDED
@@ -0,0 +1,6 @@
1
+ // The platform adapter contract: one interface every command resolves platform
2
+ // behavior through, so no command compares adapter ids. A new platform behavior
3
+ // adds a member here, implemented by the platforms that own it.
4
+ /** The adapter SDK major version a host implements. */
5
+ export const ADAPTER_SDK_VERSION = 1;
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,gFAAgF;AAChF,gEAAgE;AAehE,uDAAuD;AACvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@farmslot/adapter-sdk",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "typecheck": "tsc --noEmit --project tsconfig.json",
16
+ "test": "node ../../scripts/quality/run-tsx-tests.mjs --cwd . --tsconfig tsconfig.json test",
17
+ "format": "prettier --write --ignore-path ../../.prettierignore .",
18
+ "format:check": "prettier --check --ignore-path ../../.prettierignore .",
19
+ "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
20
+ "lint:fix": "eslint \"src/**/*.ts\" \"test/**/*.ts\" --fix",
21
+ "quality": "prettier --check --ignore-path ../../.prettierignore . && eslint \"src/**/*.ts\" \"test/**/*.ts\" && tsc --noEmit --project tsconfig.json && yarn build && yarn test",
22
+ "build": "yarn workspace @farmslot/recipe-runner build && rm -rf dist && tsc --project tsconfig.build.json",
23
+ "prepack": "cd ../.. && node scripts/quality/check-farmslot-package-readiness.mjs --require-changelog --packages @farmslot/adapter-sdk && yarn workspace @farmslot/adapter-sdk build",
24
+ "prepublishOnly": "node ../../scripts/quality/check-farmslot-package-readiness.mjs --publish --packages @farmslot/adapter-sdk"
25
+ },
26
+ "dependencies": {
27
+ "@farmslot/protocol": "0.34.0",
28
+ "@farmslot/recipe-runner": "0.23.0"
29
+ },
30
+ "devDependencies": {
31
+ "@types/node": "^22.0.0",
32
+ "eslint": "^10.3.0",
33
+ "prettier": "^3.8.3",
34
+ "tsx": "^4.19.0",
35
+ "typescript": "^5.6.0"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/deeeed/farmslot.git",
40
+ "directory": "packages/adapter-sdk"
41
+ },
42
+ "bugs": {
43
+ "url": "https://github.com/deeeed/farmslot/issues"
44
+ },
45
+ "license": "MIT",
46
+ "homepage": "https://farmslot.io/docs/reference/adapter-sdk",
47
+ "keywords": [
48
+ "farmslot",
49
+ "recipe",
50
+ "adapter-sdk",
51
+ "platform-adapter",
52
+ "agentic-engineering"
53
+ ],
54
+ "files": [
55
+ "README.md",
56
+ "LICENSE",
57
+ "dist/**/*.js",
58
+ "dist/**/*.d.ts",
59
+ "dist/**/*.d.ts.map",
60
+ "dist/**/*.js.map"
61
+ ],
62
+ "publishConfig": {
63
+ "access": "public"
64
+ }
65
+ }