@deeeed/metamask-harness 0.50.6 → 0.51.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 +12 -9
- package/README.md +31 -0
- package/adapters/extension/ensure-browser.sh +5 -18
- package/adapters/extension/launch-browser.cjs +59 -139
- package/adapters/extension/lib/macos-focus.cjs +12 -177
- package/adapters/extension/lib/validation-process-ownership.cjs +2 -49
- package/adapters/extension/live.sh +2 -0
- package/adapters/extension/stop-viewers.sh +2 -1
- package/adapters/mobile/open-device.sh +41 -1
- package/adapters/mobile/verify.sh +24 -0
- package/dist/adapters/extension/validation-process-ownership.js +2 -3
- package/dist/adapters/slot-ports.js +13 -59
- package/dist/cli-commands.js +2 -1
- package/dist/cli.js +4 -0
- package/dist/command-contract.js +43 -0
- package/dist/commands/checklist.js +9 -17
- package/dist/commands/prepare.js +236 -0
- package/dist/commands/task-init.js +51 -0
- package/dist/doctor.js +3 -4
- package/dist/mm-harness-cli.js +82 -2
- package/dist/paths.js +4 -0
- package/package.json +5 -5
package/dist/doctor.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "../library/actions/mobile/platform/tool-paths.mjs";
|
|
9
9
|
import { mobilePerpsEnvironment } from "./adapters/mobile/perps-env.js";
|
|
10
10
|
import { readRuntimeContextField, resolveRuntimeContextPath } from "./harness.js";
|
|
11
|
-
import { manifestPath, readJson, recipeHarnessRoot, recipeRuntimeDir, runnerDir } from "./paths.js";
|
|
11
|
+
import { harnessExecutable, manifestPath, readJson, recipeHarnessRoot, recipeRuntimeDir, runnerDir } from "./paths.js";
|
|
12
12
|
function requiredDoctorCheckSummary(checks) {
|
|
13
13
|
const required = checks.filter((check) => check.required);
|
|
14
14
|
const failed = required.filter((check) => check.status === "fail").map((check) => check.id);
|
|
@@ -246,9 +246,7 @@ function runnerProvenance(actionManifestPath) {
|
|
|
246
246
|
if (typeof version !== "string" || !version) {
|
|
247
247
|
throw new Error(`Expected package version in ${packagePath}`);
|
|
248
248
|
}
|
|
249
|
-
const executablePath =
|
|
250
|
-
process.env.MM_HARNESS_EXECUTABLE ?? path.join(runnerDir, "bin/mm-harness")
|
|
251
|
-
);
|
|
249
|
+
const executablePath = harnessExecutable();
|
|
252
250
|
const invokedPath = path.resolve(process.env.MM_HARNESS_INVOKED_AS ?? executablePath);
|
|
253
251
|
const installKind = runnerInstallKind(runnerDir, invokedPath, executablePath);
|
|
254
252
|
const packageSource = runnerDir.includes(`${path.sep}node_modules${path.sep}`) ? "node_modules" : "source-checkout";
|
|
@@ -286,5 +284,6 @@ export {
|
|
|
286
284
|
repoShape,
|
|
287
285
|
requiredDoctorCheckSummary,
|
|
288
286
|
runnerInstallKind,
|
|
287
|
+
runnerProvenance,
|
|
289
288
|
runtimeContextSummary
|
|
290
289
|
};
|
package/dist/mm-harness-cli.js
CHANGED
|
@@ -123,7 +123,9 @@ Example:
|
|
|
123
123
|
mark delegates checklist state to @farmslot/agent-runtime. Successful complete
|
|
124
124
|
and no-change marks stage a learning package through @farmslot/handoff.
|
|
125
125
|
closeout exposes that same Handoff boundary directly; --share remains explicit.
|
|
126
|
-
The task directory
|
|
126
|
+
The task directory is the one mm-harness task init wrote. Without a
|
|
127
|
+
checklist-target.json it marks CHECKLIST.md and writes SIGNAL.json; only a
|
|
128
|
+
role switch writes that manifest, to point at its own checklist.
|
|
127
129
|
|
|
128
130
|
Steps: start | 1 | 2 | ... | complete | no-change | blocked
|
|
129
131
|
|
|
@@ -133,6 +135,84 @@ Example:
|
|
|
133
135
|
mm-harness checklist mark temp/tasks/recipe-cook/<task> complete --mark-last
|
|
134
136
|
mm-harness checklist closeout temp/tasks/recipe-cook/<task> --share`
|
|
135
137
|
},
|
|
138
|
+
{
|
|
139
|
+
name: "prepare",
|
|
140
|
+
summary: "Bring this checkout to a proven-ready state and write the readiness record.",
|
|
141
|
+
example: "mm-harness prepare --platform extension",
|
|
142
|
+
helpText: `mm-harness prepare [flags]
|
|
143
|
+
|
|
144
|
+
Run the readiness chain for this checkout and record what it did as one
|
|
145
|
+
protocol readiness record (sandbox.json). Steps run in order and stop at the
|
|
146
|
+
first failure; later steps are recorded as skipped.
|
|
147
|
+
|
|
148
|
+
doctor --fix status launch --verify fixtures set verify
|
|
149
|
+
|
|
150
|
+
Core skips launch and fixtures (headless; verify is its readiness gate).
|
|
151
|
+
Mobile infers ios|android from the connected devices reported by status and
|
|
152
|
+
refuses with the numbered choice when that is ambiguous.
|
|
153
|
+
|
|
154
|
+
--target <path> Checkout path (default: cwd)
|
|
155
|
+
--platform <mobile|extension|core> Force the platform (auto-detected inside a checkout)
|
|
156
|
+
--mobile-platform <ios|android> Mobile target when status cannot decide it
|
|
157
|
+
--artifacts-dir <dir> Where sandbox.json and the per-step reports land
|
|
158
|
+
(default: <target>/temp/recipe/runtime)
|
|
159
|
+
--json Print the readiness record
|
|
160
|
+
|
|
161
|
+
Exit 0 when the record is ready, 1 otherwise.
|
|
162
|
+
|
|
163
|
+
Example:
|
|
164
|
+
mm-harness prepare
|
|
165
|
+
mm-harness prepare --platform mobile --mobile-platform ios --json
|
|
166
|
+
mm-harness prepare --artifacts-dir temp/tasks/fix/TAT-1/artifacts --json`
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "task",
|
|
170
|
+
summary: "Create the task directory an agent works from, out of a shared execution template.",
|
|
171
|
+
example: 'mm-harness task init temp/tasks/fix/TAT-1 --flow fix-bug --run-mode autonomous --template fix-bug/autonomous.mobile --title "Wrong total"',
|
|
172
|
+
helpText: `mm-harness task init <task-dir> [options]
|
|
173
|
+
|
|
174
|
+
Write the task directory from a selected execution template: TASK.md, the
|
|
175
|
+
CHECKLIST.md whose boxes are the steps, a mark shim routed through
|
|
176
|
+
mm-harness checklist mark, and inputs/ (handoff.json, worker-terminal-contract.json).
|
|
177
|
+
checklist-target.json is NOT written \u2014 absent means CHECKLIST.md + SIGNAL.json.
|
|
178
|
+
|
|
179
|
+
Applied when you do not pass them: --surface skill, --mark-command for this
|
|
180
|
+
executable, and --platform from the detected checkout.
|
|
181
|
+
|
|
182
|
+
Task:
|
|
183
|
+
--title <t> Task title (required)
|
|
184
|
+
--task-text <s> | --task-file <p> Task description, inline or from a file
|
|
185
|
+
--ticket <key> Ticket key
|
|
186
|
+
--source-ref <url> Where the task came from
|
|
187
|
+
|
|
188
|
+
Selection (same catalog as execution-template):
|
|
189
|
+
--flow <flow> Exact flow (required)
|
|
190
|
+
--run-mode <mode> autonomous|interactive|validation (required)
|
|
191
|
+
--platform <platform> Exact platform
|
|
192
|
+
--template <id> Exact template id (required)
|
|
193
|
+
--domain <domain> Exact domain
|
|
194
|
+
--dir <path> Custom flow-tree source (repeatable)
|
|
195
|
+
--domain-dir <domain=path> Domain-scoped team source (repeatable)
|
|
196
|
+
--package-templates <path> Canonical package flow-tree root
|
|
197
|
+
--package-id <id> Source label for the package root
|
|
198
|
+
--project-worker <path> Project template directory
|
|
199
|
+
--project-name <name> Source label for project templates
|
|
200
|
+
|
|
201
|
+
Identity and rendering:
|
|
202
|
+
--surface <s> Handoff surface (default: skill)
|
|
203
|
+
--project <name> --repo <owner/name> --attempt-id <id>
|
|
204
|
+
--var KEY=VALUE Template placeholder value (repeatable)
|
|
205
|
+
--task-dir-label <label> Task directory as written into the documents
|
|
206
|
+
--mode-preamble <text> Run-mode preamble for TASK.md
|
|
207
|
+
--addendum-file <path> Extra task-document section
|
|
208
|
+
--mark-command <cmd> Override the recorded mark command
|
|
209
|
+
--json Machine-readable output
|
|
210
|
+
|
|
211
|
+
Example:
|
|
212
|
+
mm-harness task init temp/tasks/fix/TAT-1 --flow fix-bug --run-mode autonomous \\
|
|
213
|
+
--template fix-bug/autonomous.mobile --package-templates <path> \\
|
|
214
|
+
--title "Wrong total on the receipt" --ticket TAT-1 --json`
|
|
215
|
+
},
|
|
136
216
|
{
|
|
137
217
|
name: "execution-template",
|
|
138
218
|
summary: "Discover, validate, and materialize shared agent checklists.",
|
|
@@ -698,7 +778,7 @@ const HELP_GROUPS = [
|
|
|
698
778
|
{
|
|
699
779
|
title: "DAILY LOOP",
|
|
700
780
|
blurb: "what a teammate runs many times a day (auto-ensures the overlay; --heal owns recovery)",
|
|
701
|
-
commands: ["status", "launch", "stop", "logs", "debug", "reload", "fixtures"]
|
|
781
|
+
commands: ["status", "task", "prepare", "launch", "stop", "logs", "debug", "reload", "fixtures"]
|
|
702
782
|
},
|
|
703
783
|
{
|
|
704
784
|
title: "DISCOVER",
|
package/dist/paths.js
CHANGED
|
@@ -11,6 +11,9 @@ function recipeRuntimeDir() {
|
|
|
11
11
|
function recipeHarnessRoot() {
|
|
12
12
|
return validateRelativeRecipePath("RECIPE_HARNESS_ROOT", process.env.RECIPE_HARNESS_ROOT || DEFAULT_RECIPE_HARNESS_ROOT);
|
|
13
13
|
}
|
|
14
|
+
function harnessExecutable() {
|
|
15
|
+
return path.resolve(process.env.MM_HARNESS_EXECUTABLE ?? path.join(runnerDir, "bin/mm-harness"));
|
|
16
|
+
}
|
|
14
17
|
function readPathDefaults() {
|
|
15
18
|
const defaultsPath = path.join(runnerDir, "adapters/shared/path-defaults.json");
|
|
16
19
|
const parsed = JSON.parse(fs.readFileSync(defaultsPath, "utf8"));
|
|
@@ -170,6 +173,7 @@ export {
|
|
|
170
173
|
DEFAULT_RECIPE_RUNTIME_DIR,
|
|
171
174
|
assertAdapter,
|
|
172
175
|
extensionIdPath,
|
|
176
|
+
harnessExecutable,
|
|
173
177
|
importMetaMaskNativeUiProvider,
|
|
174
178
|
importRecipeHarness,
|
|
175
179
|
importRecipeHarnessAppLifecycle,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deeeed/metamask-harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mm-harness": "bin/mm-harness"
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"check:syntax": "find . -name '*.mjs' -print0 | xargs -0 -n1 node --check"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@farmslot/agent-runtime": "0.
|
|
24
|
-
"@farmslot/expo-recipe": "0.9.
|
|
23
|
+
"@farmslot/agent-runtime": "0.9.0",
|
|
24
|
+
"@farmslot/expo-recipe": "0.9.1",
|
|
25
25
|
"@farmslot/handoff": "^0.3.1",
|
|
26
|
-
"@farmslot/protocol": "0.
|
|
27
|
-
"@farmslot/recipe-harness": "0.16.
|
|
26
|
+
"@farmslot/protocol": "0.26.0",
|
|
27
|
+
"@farmslot/recipe-harness": "0.16.2",
|
|
28
28
|
"agent-device": "0.19.3",
|
|
29
29
|
"commander": "^12.0.0",
|
|
30
30
|
"es-module-lexer": "2.3.1",
|