@farmslot/recipe-harness 0.3.0 → 0.3.1
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
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to `@farmslot/recipe-harness` are tracked here.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
_No entries yet. Add Added/Changed/Fixed/Removed bullets here with each PR; date and version only at publish._
|
|
8
|
+
|
|
9
|
+
## 0.3.1 - 2026-06-26
|
|
10
|
+
|
|
11
|
+
- Add `runtime/orchestrate-up` — generic install → relaunch decision loop (`orchestrateRuntimeUp`) for product runners to wrap with shell/platform actions.
|
|
12
|
+
|
|
7
13
|
## 0.3.0 - 2026-06-26
|
|
8
14
|
|
|
9
15
|
- Add shared runtime-readiness helpers under `@farmslot/recipe-harness/runtime/*`:
|
package/README.md
CHANGED
|
@@ -64,6 +64,7 @@ listed here.
|
|
|
64
64
|
| `@farmslot/recipe-harness/runtime/log-analysis` | Bundle-log boundaries, unresolved-module scoping, persistent bundle-error state. |
|
|
65
65
|
| `@farmslot/recipe-harness/runtime/metro-probe` | Metro packager `/status` reachability probe. |
|
|
66
66
|
| `@farmslot/recipe-harness/runtime/decision-types` | Portable `RuntimeDecisionReport` / action shapes for product adapters. |
|
|
67
|
+
| `@farmslot/recipe-harness/runtime/orchestrate-up` | Generic install → relaunch orchestration loop for `recipe up` hosts. |
|
|
67
68
|
| `@farmslot/recipe-harness/cli` | Programmatic CLI entrypoint. |
|
|
68
69
|
| `@farmslot/recipe-harness/cli/support` | Shared CLI input validation helpers. |
|
|
69
70
|
| `@farmslot/recipe-harness/writers` | Node-only JSON artifact writers. |
|
|
@@ -84,6 +85,12 @@ Project-specific behavior stays outside this package. For example,
|
|
|
84
85
|
`example.trade.place_order`, `checkout.ensure_cart`, or `backend.seed_user`
|
|
85
86
|
belong in the project runner that imports this package.
|
|
86
87
|
|
|
88
|
+
## Changelog
|
|
89
|
+
|
|
90
|
+
Update [CHANGELOG.md](./CHANGELOG.md) under `## Unreleased` in the same PR as code changes
|
|
91
|
+
(Added / Changed / Fixed / Removed). Add a dated version section only when publishing
|
|
92
|
+
(`yarn npm publish` — `prepack` checks changelog readiness).
|
|
93
|
+
|
|
87
94
|
## Minimal runner
|
|
88
95
|
|
|
89
96
|
```ts
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RuntimeDecisionReport, RuntimeReadinessDecision } from './decision-types.js';
|
|
2
|
+
export interface OrchestrateRuntimeUpOptions<T extends RuntimeDecisionReport = RuntimeDecisionReport> {
|
|
3
|
+
decide: () => Promise<T>;
|
|
4
|
+
onInstall: (report: T) => Promise<void>;
|
|
5
|
+
onLaunch: (report: T) => Promise<void>;
|
|
6
|
+
onReady: (report: T) => Promise<void>;
|
|
7
|
+
onBlocked?: (report: T) => Promise<void>;
|
|
8
|
+
/** Shared flag — set true after first install attempt to prevent loops. */
|
|
9
|
+
installAttempted?: {
|
|
10
|
+
value: boolean;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface OrchestrateRuntimeUpResult<T extends RuntimeDecisionReport = RuntimeDecisionReport> {
|
|
14
|
+
report: T;
|
|
15
|
+
exitDecision: RuntimeReadinessDecision;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Generic install → relaunch decision loop for product runners.
|
|
19
|
+
* Hosts supply shell/platform actions via onInstall/onLaunch/onReady callbacks.
|
|
20
|
+
*/
|
|
21
|
+
export declare function orchestrateRuntimeUp<T extends RuntimeDecisionReport>(options: OrchestrateRuntimeUpOptions<T>): Promise<OrchestrateRuntimeUpResult<T>>;
|
|
22
|
+
//# sourceMappingURL=orchestrate-up.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrate-up.d.ts","sourceRoot":"","sources":["../../src/runtime/orchestrate-up.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE3F,MAAM,WAAW,2BAA2B,CAAC,CAAC,SAAS,qBAAqB,GAAG,qBAAqB;IAClG,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IACzB,SAAS,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;CACvC;AAED,MAAM,WAAW,0BAA0B,CAAC,CAAC,SAAS,qBAAqB,GAAG,qBAAqB;IACjG,MAAM,EAAE,CAAC,CAAC;IACV,YAAY,EAAE,wBAAwB,CAAC;CACxC;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,SAAS,qBAAqB,EACxE,OAAO,EAAE,2BAA2B,CAAC,CAAC,CAAC,GACtC,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,CA4BxC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic install → relaunch decision loop for product runners.
|
|
3
|
+
* Hosts supply shell/platform actions via onInstall/onLaunch/onReady callbacks.
|
|
4
|
+
*/
|
|
5
|
+
export async function orchestrateRuntimeUp(options) {
|
|
6
|
+
const installFlag = options.installAttempted ?? { value: false };
|
|
7
|
+
const report = await options.decide();
|
|
8
|
+
switch (report.decision) {
|
|
9
|
+
case 'install': {
|
|
10
|
+
if (installFlag.value) {
|
|
11
|
+
throw new Error(`install did not resolve runtime (${report.reasonCode})`);
|
|
12
|
+
}
|
|
13
|
+
installFlag.value = true;
|
|
14
|
+
await options.onInstall(report);
|
|
15
|
+
return orchestrateRuntimeUp({ ...options, installAttempted: installFlag });
|
|
16
|
+
}
|
|
17
|
+
case 'launch':
|
|
18
|
+
case 'relaunch':
|
|
19
|
+
case 'build':
|
|
20
|
+
await options.onLaunch(report);
|
|
21
|
+
return { report, exitDecision: report.decision };
|
|
22
|
+
case 'ready':
|
|
23
|
+
await options.onReady(report);
|
|
24
|
+
return { report, exitDecision: 'ready' };
|
|
25
|
+
case 'blocked':
|
|
26
|
+
if (options.onBlocked)
|
|
27
|
+
await options.onBlocked(report);
|
|
28
|
+
return { report, exitDecision: 'blocked' };
|
|
29
|
+
default:
|
|
30
|
+
if (options.onBlocked)
|
|
31
|
+
await options.onBlocked(report);
|
|
32
|
+
return { report, exitDecision: report.decision };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=orchestrate-up.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrate-up.js","sourceRoot":"","sources":["../../src/runtime/orchestrate-up.ts"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAuC;IAEvC,MAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IACjE,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC;IAEtC,QAAQ,MAAM,CAAC,QAAQ,EAAE,CAAC;QACxB,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,oCAAoC,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;YAC5E,CAAC;YACD,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC;YACzB,MAAM,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YAChC,OAAO,oBAAoB,CAAC,EAAE,GAAG,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC,CAAC;QAC7E,CAAC;QACD,KAAK,QAAQ,CAAC;QACd,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO;YACV,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC/B,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;QACnD,KAAK,OAAO;YACV,MAAM,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAC9B,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;QAC3C,KAAK,SAAS;YACZ,IAAI,OAAO,CAAC,SAAS;gBAAE,MAAM,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACvD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;QAC7C;YACE,IAAI,OAAO,CAAC,SAAS;gBAAE,MAAM,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACvD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;IACrD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farmslot/recipe-harness",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -82,6 +82,11 @@
|
|
|
82
82
|
"types": "./dist/runtime/decision-types.d.ts",
|
|
83
83
|
"import": "./dist/runtime/decision-types.js",
|
|
84
84
|
"default": "./dist/runtime/decision-types.js"
|
|
85
|
+
},
|
|
86
|
+
"./runtime/orchestrate-up": {
|
|
87
|
+
"types": "./dist/runtime/orchestrate-up.d.ts",
|
|
88
|
+
"import": "./dist/runtime/orchestrate-up.js",
|
|
89
|
+
"default": "./dist/runtime/orchestrate-up.js"
|
|
85
90
|
}
|
|
86
91
|
},
|
|
87
92
|
"scripts": {
|