@iamu-dev/iamu 0.3.0-beta.0 → 0.3.0-beta.2
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.js +498 -74
- package/dist/commands/set-entity.d.ts +32 -5
- package/dist/index.js +498 -74
- package/dist/templates/skills/iamu-findings.md +47 -62
- package/dist/templates/skills/iamu-new.md +10 -20
- package/dist/templates/skills/iamu-propose.md +4 -2
- package/dist/templates/skills/iamu-run.md +85 -100
- package/dist/templates/skills/iamu-setup.md +38 -61
- package/dist/templates/skills/iamu-stage.md +11 -0
- package/dist/templates/skills/iamu-status.md +1 -1
- package/dist/ui/symbols.d.ts +1 -0
- package/package.json +3 -3
package/dist/bin.js
CHANGED
|
@@ -5460,10 +5460,20 @@ async function readTestability(projectRoot) {
|
|
|
5460
5460
|
body: parsed.body
|
|
5461
5461
|
};
|
|
5462
5462
|
}
|
|
5463
|
+
async function writeTestability(projectRoot, input, body) {
|
|
5464
|
+
const p = testabilityPath(projectRoot);
|
|
5465
|
+
const isLocalDoc = "frontmatter" in input && typeof input.frontmatter === "object";
|
|
5466
|
+
const fm = isLocalDoc ? input.frontmatter : input;
|
|
5467
|
+
const effectiveBody = body !== void 0 ? body : isLocalDoc ? input.body : "";
|
|
5468
|
+
const validated = testabilityFrontmatterSchema.parse(fm);
|
|
5469
|
+
const serialized = serializeFrontmatter(validated, effectiveBody);
|
|
5470
|
+
await atomicWriteFile(p, serialized);
|
|
5471
|
+
}
|
|
5463
5472
|
var init_testability2 = __esm({
|
|
5464
5473
|
"../../packages/local-store/dist/testability.js"() {
|
|
5465
5474
|
"use strict";
|
|
5466
5475
|
init_dist();
|
|
5476
|
+
init_atomic();
|
|
5467
5477
|
init_markdown();
|
|
5468
5478
|
init_paths();
|
|
5469
5479
|
}
|
|
@@ -8622,7 +8632,7 @@ function formatRefError(err) {
|
|
|
8622
8632
|
const dir = ENTITY_DIRS[err.missing_ref];
|
|
8623
8633
|
const hint = MISSING_REF_HINTS[err.missing_ref] ?? "";
|
|
8624
8634
|
if (!err.missing_slug) {
|
|
8625
|
-
const fieldHint = err.missing_ref === "capability" && err.entity_type === "outline" ?
|
|
8635
|
+
const fieldHint = err.missing_ref === "capability" && err.entity_type === "outline" ? `run \`iamu set outline ${err.entity_slug ?? "<slug>"} --capability <slug>\`` : `add a \`${err.missing_ref}:\` field to the file`;
|
|
8626
8636
|
return `${err.entity_type} ${err.entity_slug || err.entity_id}: ${err.missing_ref} slug is missing from frontmatter \u2014 ${fieldHint}`;
|
|
8627
8637
|
}
|
|
8628
8638
|
return `${err.entity_type} ${err.entity_slug || err.entity_id}: \`${err.missing_slug}\` not found in iamu/${dir}/${hint}`;
|
|
@@ -8636,7 +8646,7 @@ var init_refs = __esm({
|
|
|
8636
8646
|
init_sync_tracking();
|
|
8637
8647
|
init_walkthrough_mirror();
|
|
8638
8648
|
MISSING_REF_HINTS = {
|
|
8639
|
-
capability: " \u2014 create it with `iamu new capability` or
|
|
8649
|
+
capability: " \u2014 create it with `iamu new capability` or set with `iamu set outline <slug> --capability <slug>`",
|
|
8640
8650
|
outline: " \u2014 create it with `iamu new` or verify the slug matches a file in iamu/outlines/",
|
|
8641
8651
|
persona: " \u2014 create it with `iamu new persona` or check the slug",
|
|
8642
8652
|
scenario: " \u2014 verify the scenario exists locally with `iamu list scenarios`"
|
|
@@ -13030,7 +13040,8 @@ var init_symbols = __esm({
|
|
|
13030
13040
|
add: chalk3.cyan("+"),
|
|
13031
13041
|
info: chalk3.blue(supportsUnicode ? "\u2139" : "i"),
|
|
13032
13042
|
dot: chalk3.dim(supportsUnicode ? "\u2022" : "*"),
|
|
13033
|
-
question: chalk3.yellow("?")
|
|
13043
|
+
question: chalk3.yellow("?"),
|
|
13044
|
+
step: chalk3.blue(supportsUnicode ? "\u25B6" : ">")
|
|
13034
13045
|
};
|
|
13035
13046
|
}
|
|
13036
13047
|
});
|
|
@@ -13636,8 +13647,8 @@ import { dirname as dirname3, join as join4, resolve as resolve2 } from "path";
|
|
|
13636
13647
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
13637
13648
|
import chalk6 from "chalk";
|
|
13638
13649
|
function getVersion() {
|
|
13639
|
-
if ("0.3.0-beta.
|
|
13640
|
-
return "0.3.0-beta.
|
|
13650
|
+
if ("0.3.0-beta.2") {
|
|
13651
|
+
return "0.3.0-beta.2";
|
|
13641
13652
|
}
|
|
13642
13653
|
try {
|
|
13643
13654
|
const thisDir = dirname3(fileURLToPath2(import.meta.url));
|
|
@@ -16007,9 +16018,16 @@ async function report(scenario, opts) {
|
|
|
16007
16018
|
if (viewport) {
|
|
16008
16019
|
console.log(` ${chalk13.dim("device:")} ${formatViewport(viewport)}`);
|
|
16009
16020
|
}
|
|
16010
|
-
const
|
|
16011
|
-
if (
|
|
16012
|
-
|
|
16021
|
+
const config = await readConfig(projectRoot);
|
|
16022
|
+
if (config.cloud_linked && config.cloud_project_id) {
|
|
16023
|
+
const viewUrl = await pushedRunUrl(projectRoot, run.runId);
|
|
16024
|
+
if (viewUrl) {
|
|
16025
|
+
console.log(` ${chalk13.dim("view:")} ${chalk13.underline(viewUrl)}`);
|
|
16026
|
+
} else {
|
|
16027
|
+
console.log(
|
|
16028
|
+
` ${chalk13.dim("view:")} ${chalk13.dim("not synced yet")} ${chalk13.dim("(run `iamu sync` to view in cloud)")}`
|
|
16029
|
+
);
|
|
16030
|
+
}
|
|
16013
16031
|
}
|
|
16014
16032
|
if (c) {
|
|
16015
16033
|
const v = c.verification;
|
|
@@ -18690,23 +18708,38 @@ async function stepCommand(runArg, opts) {
|
|
|
18690
18708
|
);
|
|
18691
18709
|
return;
|
|
18692
18710
|
}
|
|
18693
|
-
|
|
18694
|
-
|
|
18695
|
-
|
|
18696
|
-
|
|
18697
|
-
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
|
|
18704
|
-
|
|
18711
|
+
const stepNumStr = String(res.step.step_number).padStart(2, "0");
|
|
18712
|
+
if (isVerbose()) {
|
|
18713
|
+
console.log();
|
|
18714
|
+
console.log(
|
|
18715
|
+
` ${symbols.success} Step ${chalk20.cyan(stepNumStr)} recorded: ${res.step.action}`
|
|
18716
|
+
);
|
|
18717
|
+
if (res.step.note) {
|
|
18718
|
+
console.log(` ${chalk20.dim("note:")} ${res.step.note}`);
|
|
18719
|
+
}
|
|
18720
|
+
if (res.step.url) {
|
|
18721
|
+
console.log(` ${chalk20.dim("url:")} ${res.step.url}`);
|
|
18722
|
+
}
|
|
18723
|
+
if (res.step.screenshot) {
|
|
18724
|
+
console.log(` ${chalk20.dim("shot:")} ${res.step.screenshot}`);
|
|
18725
|
+
}
|
|
18726
|
+
console.log(
|
|
18727
|
+
` ${chalk20.dim("file:")} ${path25.relative(projectRoot, res.stepPath)}`
|
|
18728
|
+
);
|
|
18729
|
+
console.log();
|
|
18730
|
+
} else {
|
|
18731
|
+
let route = "";
|
|
18732
|
+
if (res.step.url) {
|
|
18733
|
+
try {
|
|
18734
|
+
route = new URL(res.step.url).pathname;
|
|
18735
|
+
} catch {
|
|
18736
|
+
route = res.step.url;
|
|
18737
|
+
}
|
|
18738
|
+
}
|
|
18739
|
+
console.log(
|
|
18740
|
+
` ${symbols.step} Step ${chalk20.cyan(stepNumStr)} \xB7 ${chalk20.bold(res.step.action)}${route ? chalk20.dim(` \xB7 ${route}`) : ""}`
|
|
18741
|
+
);
|
|
18705
18742
|
}
|
|
18706
|
-
console.log(
|
|
18707
|
-
` ${chalk20.dim("file:")} ${path25.relative(projectRoot, res.stepPath)}`
|
|
18708
|
-
);
|
|
18709
|
-
console.log();
|
|
18710
18743
|
} catch (err) {
|
|
18711
18744
|
commandError(err.message, opts);
|
|
18712
18745
|
}
|
|
@@ -18717,6 +18750,7 @@ var init_step = __esm({
|
|
|
18717
18750
|
"use strict";
|
|
18718
18751
|
init_dist2();
|
|
18719
18752
|
init_dist();
|
|
18753
|
+
init_logger();
|
|
18720
18754
|
init_symbols();
|
|
18721
18755
|
init_context4();
|
|
18722
18756
|
init_live_run_client();
|
|
@@ -19301,16 +19335,34 @@ function printStep(opts, record, projectRoot, stagnationWarning, challengeWarnin
|
|
|
19301
19335
|
console.log(JSON.stringify(doc, null, 2));
|
|
19302
19336
|
return;
|
|
19303
19337
|
}
|
|
19304
|
-
|
|
19305
|
-
|
|
19306
|
-
|
|
19307
|
-
|
|
19308
|
-
|
|
19309
|
-
|
|
19310
|
-
|
|
19311
|
-
|
|
19312
|
-
|
|
19313
|
-
console.log(` ${chalk21.dim("
|
|
19338
|
+
const stepNumStr = String(step.step_number).padStart(2, "0");
|
|
19339
|
+
if (isVerbose()) {
|
|
19340
|
+
console.log(
|
|
19341
|
+
` ${symbols.success} Step ${chalk21.cyan(stepNumStr)} recorded: ${step.action}`
|
|
19342
|
+
);
|
|
19343
|
+
for (const w of warnings) {
|
|
19344
|
+
console.log(` ${symbols.warning} ${chalk21.yellow(w)}`);
|
|
19345
|
+
}
|
|
19346
|
+
if (step.note) console.log(` ${chalk21.dim("note:")} ${step.note}`);
|
|
19347
|
+
if (step.url) console.log(` ${chalk21.dim("url:")} ${step.url}`);
|
|
19348
|
+
if (step.screenshot) {
|
|
19349
|
+
console.log(` ${chalk21.dim("screenshot:")} ${step.screenshot}`);
|
|
19350
|
+
}
|
|
19351
|
+
} else {
|
|
19352
|
+
let route = "";
|
|
19353
|
+
if (step.url) {
|
|
19354
|
+
try {
|
|
19355
|
+
route = new URL(step.url).pathname;
|
|
19356
|
+
} catch {
|
|
19357
|
+
route = step.url;
|
|
19358
|
+
}
|
|
19359
|
+
}
|
|
19360
|
+
console.log(
|
|
19361
|
+
` ${symbols.step} Step ${chalk21.cyan(stepNumStr)} \xB7 ${chalk21.bold(step.action)}${route ? chalk21.dim(` \xB7 ${route}`) : ""}`
|
|
19362
|
+
);
|
|
19363
|
+
for (const w of warnings) {
|
|
19364
|
+
console.log(` ${symbols.warning} ${chalk21.yellow(w)}`);
|
|
19365
|
+
}
|
|
19314
19366
|
}
|
|
19315
19367
|
}
|
|
19316
19368
|
async function browseStep(args, opts, driver) {
|
|
@@ -19617,6 +19669,8 @@ var init_browse = __esm({
|
|
|
19617
19669
|
"use strict";
|
|
19618
19670
|
init_dist2();
|
|
19619
19671
|
init_dist();
|
|
19672
|
+
init_logger();
|
|
19673
|
+
init_symbols();
|
|
19620
19674
|
init_browse_actions();
|
|
19621
19675
|
init_browse_driver();
|
|
19622
19676
|
init_context4();
|
|
@@ -20873,6 +20927,15 @@ function validateFile(filePath, raw, projectRoot) {
|
|
|
20873
20927
|
);
|
|
20874
20928
|
}
|
|
20875
20929
|
}
|
|
20930
|
+
if (type2 === "outline" && zodResult.success) {
|
|
20931
|
+
const fm = zodResult.data;
|
|
20932
|
+
if (!fm.primary_capability && !fm.capability) {
|
|
20933
|
+
result.warnings = result.warnings ?? [];
|
|
20934
|
+
result.warnings.push(
|
|
20935
|
+
`outline has no primary capability \u2014 sync will require one (run \`iamu set outline ${fm.slug ?? "<slug>"} --capability <slug>\`)`
|
|
20936
|
+
);
|
|
20937
|
+
}
|
|
20938
|
+
}
|
|
20876
20939
|
return result;
|
|
20877
20940
|
}
|
|
20878
20941
|
async function buildRepairLookups(projectRoot) {
|
|
@@ -21441,6 +21504,15 @@ async function newEntity(type2, opts) {
|
|
|
21441
21504
|
);
|
|
21442
21505
|
return;
|
|
21443
21506
|
}
|
|
21507
|
+
if (entityType === "outline" && !opts.capability) {
|
|
21508
|
+
try {
|
|
21509
|
+
const { entities } = await listEntities(projectRoot, "capability");
|
|
21510
|
+
if (entities.length === 1 && typeof entities[0].frontmatter.slug === "string") {
|
|
21511
|
+
opts.capability = entities[0].frontmatter.slug;
|
|
21512
|
+
}
|
|
21513
|
+
} catch {
|
|
21514
|
+
}
|
|
21515
|
+
}
|
|
21444
21516
|
const id = randomUUID10();
|
|
21445
21517
|
const frontmatter = defaultFrontmatter(entityType, id, slug, opts.name, opts);
|
|
21446
21518
|
const body = opts.body ?? (entityType === "outline" ? "" : opts.narrative) ?? "";
|
|
@@ -21559,6 +21631,42 @@ function applyChanges(type2, fm, opts) {
|
|
|
21559
21631
|
put("paths", paths);
|
|
21560
21632
|
}
|
|
21561
21633
|
if (opts.area !== void 0) put("area", opts.area || null);
|
|
21634
|
+
} else if (type2 === "outline") {
|
|
21635
|
+
if (opts.capability === false) {
|
|
21636
|
+
put("primary_capability", null);
|
|
21637
|
+
put("capability", null);
|
|
21638
|
+
} else if (opts.capability !== void 0) {
|
|
21639
|
+
put("primary_capability", opts.capability || null);
|
|
21640
|
+
put("capability", opts.capability || null);
|
|
21641
|
+
}
|
|
21642
|
+
if (opts.additionalCapabilities === false) {
|
|
21643
|
+
put("additional_capabilities", []);
|
|
21644
|
+
} else if (opts.additionalCapabilities !== void 0) {
|
|
21645
|
+
const caps = typeof opts.additionalCapabilities === "string" ? splitList(opts.additionalCapabilities) : Array.isArray(opts.additionalCapabilities) ? opts.additionalCapabilities : [];
|
|
21646
|
+
put("additional_capabilities", caps);
|
|
21647
|
+
}
|
|
21648
|
+
} else if (type2 === "testability") {
|
|
21649
|
+
if (opts.target !== void 0) put("target_url", opts.target || null);
|
|
21650
|
+
if (opts.devCommand !== void 0)
|
|
21651
|
+
put("dev_command", opts.devCommand || null);
|
|
21652
|
+
if (opts.authStrategy !== void 0)
|
|
21653
|
+
put("auth_strategy", opts.authStrategy || null);
|
|
21654
|
+
if (opts.access !== void 0) put("access", opts.access || null);
|
|
21655
|
+
if (opts.harnesses !== void 0) {
|
|
21656
|
+
put("harnesses", opts.harnesses ? splitList(opts.harnesses) : null);
|
|
21657
|
+
}
|
|
21658
|
+
if (opts.untestableBoundaries !== void 0) {
|
|
21659
|
+
put(
|
|
21660
|
+
"untestable_boundaries",
|
|
21661
|
+
opts.untestableBoundaries ? splitList(opts.untestableBoundaries) : null
|
|
21662
|
+
);
|
|
21663
|
+
}
|
|
21664
|
+
} else if (type2 === "context") {
|
|
21665
|
+
if (opts.domain !== void 0) put("domain", opts.domain || null);
|
|
21666
|
+
if (opts.industry !== void 0) put("industry", opts.industry || null);
|
|
21667
|
+
if (opts.jurisdiction !== void 0)
|
|
21668
|
+
put("jurisdiction", opts.jurisdiction || null);
|
|
21669
|
+
if (opts.notes !== void 0) put("notes", opts.notes || null);
|
|
21562
21670
|
}
|
|
21563
21671
|
return changed;
|
|
21564
21672
|
}
|
|
@@ -21574,6 +21682,15 @@ async function setEntity(type2, slug, opts) {
|
|
|
21574
21682
|
);
|
|
21575
21683
|
return;
|
|
21576
21684
|
}
|
|
21685
|
+
if (type2 !== "testability" && type2 !== "context" && !slug) {
|
|
21686
|
+
commandError(`A slug is required when setting a ${type2}.`, {
|
|
21687
|
+
...opts,
|
|
21688
|
+
code: "missing_slug",
|
|
21689
|
+
fix: `iamu set ${type2} <slug>`
|
|
21690
|
+
});
|
|
21691
|
+
return;
|
|
21692
|
+
}
|
|
21693
|
+
const effectiveSlug = slug || type2;
|
|
21577
21694
|
const foreign = Object.keys(FLAG_NAMES).filter(
|
|
21578
21695
|
(k) => !allowed.includes(k) && given(opts, k)
|
|
21579
21696
|
);
|
|
@@ -21583,7 +21700,7 @@ async function setEntity(type2, slug, opts) {
|
|
|
21583
21700
|
{
|
|
21584
21701
|
...opts,
|
|
21585
21702
|
code: "invalid_field_combination",
|
|
21586
|
-
fix: `iamu set ${type2} ${
|
|
21703
|
+
fix: `iamu set ${type2} ${effectiveSlug} ${FLAG_NAMES[allowed[0]]} ...`
|
|
21587
21704
|
}
|
|
21588
21705
|
);
|
|
21589
21706
|
return;
|
|
@@ -21624,7 +21741,38 @@ async function setEntity(type2, slug, opts) {
|
|
|
21624
21741
|
const allowedPatchKeys = {
|
|
21625
21742
|
scenario: ["entry", "entry_path", "target", "target_url", "state"],
|
|
21626
21743
|
persona: ["access"],
|
|
21627
|
-
capability: ["paths", "addPath", "removePath", "area"]
|
|
21744
|
+
capability: ["paths", "addPath", "removePath", "area"],
|
|
21745
|
+
outline: [
|
|
21746
|
+
"capability",
|
|
21747
|
+
"primary_capability",
|
|
21748
|
+
"additional_capabilities",
|
|
21749
|
+
"additionalCapabilities"
|
|
21750
|
+
],
|
|
21751
|
+
testability: [
|
|
21752
|
+
"target",
|
|
21753
|
+
"target_url",
|
|
21754
|
+
"devCommand",
|
|
21755
|
+
"dev_command",
|
|
21756
|
+
"authStrategy",
|
|
21757
|
+
"auth_strategy",
|
|
21758
|
+
"access",
|
|
21759
|
+
"harnesses",
|
|
21760
|
+
"untestableBoundaries",
|
|
21761
|
+
"untestable_boundaries",
|
|
21762
|
+
"body"
|
|
21763
|
+
],
|
|
21764
|
+
context: [
|
|
21765
|
+
"domain",
|
|
21766
|
+
"industry",
|
|
21767
|
+
"jurisdiction",
|
|
21768
|
+
"notes",
|
|
21769
|
+
"description",
|
|
21770
|
+
"name",
|
|
21771
|
+
"governed_by",
|
|
21772
|
+
"actors",
|
|
21773
|
+
"terminology",
|
|
21774
|
+
"body"
|
|
21775
|
+
]
|
|
21628
21776
|
};
|
|
21629
21777
|
const foreignPatchKeys = Object.keys(parsed).filter(
|
|
21630
21778
|
(k) => !allowedPatchKeys[type2]?.includes(k)
|
|
@@ -21683,6 +21831,65 @@ async function setEntity(type2, slug, opts) {
|
|
|
21683
21831
|
if (effectiveOpts.area === void 0 && parsed.area !== void 0) {
|
|
21684
21832
|
effectiveOpts.area = parsed.area === null || parsed.area === false ? false : String(parsed.area);
|
|
21685
21833
|
}
|
|
21834
|
+
} else if (type2 === "outline") {
|
|
21835
|
+
if (effectiveOpts.capability === void 0 && (parsed.capability !== void 0 || parsed.primary_capability !== void 0)) {
|
|
21836
|
+
const v = parsed.capability ?? parsed.primary_capability;
|
|
21837
|
+
effectiveOpts.capability = v === null || v === false ? false : String(v);
|
|
21838
|
+
}
|
|
21839
|
+
if (effectiveOpts.additionalCapabilities === void 0 && (parsed.additionalCapabilities !== void 0 || parsed.additional_capabilities !== void 0)) {
|
|
21840
|
+
const v = parsed.additionalCapabilities ?? parsed.additional_capabilities;
|
|
21841
|
+
effectiveOpts.additionalCapabilities = v === null || v === false ? false : Array.isArray(v) ? v.join(",") : String(v);
|
|
21842
|
+
}
|
|
21843
|
+
} else if (type2 === "testability") {
|
|
21844
|
+
if (effectiveOpts.target === void 0 && (parsed.target !== void 0 || parsed.target_url !== void 0)) {
|
|
21845
|
+
const v = parsed.target ?? parsed.target_url;
|
|
21846
|
+
effectiveOpts.target = v === null || v === false ? false : String(v);
|
|
21847
|
+
}
|
|
21848
|
+
if (effectiveOpts.devCommand === void 0 && (parsed.devCommand !== void 0 || parsed.dev_command !== void 0)) {
|
|
21849
|
+
const v = parsed.devCommand ?? parsed.dev_command;
|
|
21850
|
+
effectiveOpts.devCommand = v === null || v === false ? false : String(v);
|
|
21851
|
+
}
|
|
21852
|
+
if (effectiveOpts.authStrategy === void 0 && (parsed.authStrategy !== void 0 || parsed.auth_strategy !== void 0)) {
|
|
21853
|
+
const v = parsed.authStrategy ?? parsed.auth_strategy;
|
|
21854
|
+
effectiveOpts.authStrategy = v === null || v === false ? false : String(v);
|
|
21855
|
+
}
|
|
21856
|
+
if (effectiveOpts.access === void 0 && parsed.access !== void 0) {
|
|
21857
|
+
effectiveOpts.access = parsed.access === null || parsed.access === false ? false : String(parsed.access);
|
|
21858
|
+
}
|
|
21859
|
+
if (effectiveOpts.harnesses === void 0 && parsed.harnesses !== void 0) {
|
|
21860
|
+
effectiveOpts.harnesses = parsed.harnesses === null || parsed.harnesses === false ? false : Array.isArray(parsed.harnesses) ? parsed.harnesses.join(",") : String(parsed.harnesses);
|
|
21861
|
+
}
|
|
21862
|
+
if (effectiveOpts.untestableBoundaries === void 0 && (parsed.untestableBoundaries !== void 0 || parsed.untestable_boundaries !== void 0)) {
|
|
21863
|
+
const b = parsed.untestableBoundaries ?? parsed.untestable_boundaries;
|
|
21864
|
+
effectiveOpts.untestableBoundaries = b === null || b === false ? false : Array.isArray(b) ? b.join(",") : String(b);
|
|
21865
|
+
}
|
|
21866
|
+
if (effectiveOpts.body === void 0 && parsed.body !== void 0) {
|
|
21867
|
+
effectiveOpts.body = String(parsed.body);
|
|
21868
|
+
}
|
|
21869
|
+
} else if (type2 === "context") {
|
|
21870
|
+
if (effectiveOpts.domain === void 0 && parsed.domain !== void 0) {
|
|
21871
|
+
effectiveOpts.domain = parsed.domain === null || parsed.domain === false ? false : String(parsed.domain);
|
|
21872
|
+
}
|
|
21873
|
+
if (effectiveOpts.industry === void 0 && parsed.industry !== void 0) {
|
|
21874
|
+
effectiveOpts.industry = parsed.industry === null || parsed.industry === false ? false : String(parsed.industry);
|
|
21875
|
+
}
|
|
21876
|
+
if (effectiveOpts.jurisdiction === void 0 && parsed.jurisdiction !== void 0) {
|
|
21877
|
+
effectiveOpts.jurisdiction = parsed.jurisdiction === null || parsed.jurisdiction === false ? false : String(parsed.jurisdiction);
|
|
21878
|
+
}
|
|
21879
|
+
if (effectiveOpts.notes === void 0 && parsed.notes !== void 0) {
|
|
21880
|
+
effectiveOpts.notes = parsed.notes === null || parsed.notes === false ? false : String(parsed.notes);
|
|
21881
|
+
}
|
|
21882
|
+
if (effectiveOpts.description === void 0 && parsed.description !== void 0) {
|
|
21883
|
+
effectiveOpts.description = parsed.description === null || parsed.description === false ? false : String(parsed.description);
|
|
21884
|
+
}
|
|
21885
|
+
if (effectiveOpts.name === void 0 && parsed.name !== void 0) {
|
|
21886
|
+
effectiveOpts.name = parsed.name === null || parsed.name === false ? false : String(parsed.name);
|
|
21887
|
+
}
|
|
21888
|
+
if (effectiveOpts.body === void 0 && parsed.body !== void 0) {
|
|
21889
|
+
effectiveOpts.body = String(parsed.body);
|
|
21890
|
+
} else if (effectiveOpts.body === void 0 && effectiveOpts.description !== void 0) {
|
|
21891
|
+
effectiveOpts.body = effectiveOpts.description ? String(effectiveOpts.description) : "";
|
|
21892
|
+
}
|
|
21686
21893
|
}
|
|
21687
21894
|
}
|
|
21688
21895
|
if (!allowed.some((k) => given(effectiveOpts, k))) {
|
|
@@ -21691,11 +21898,112 @@ async function setEntity(type2, slug, opts) {
|
|
|
21691
21898
|
{
|
|
21692
21899
|
...opts,
|
|
21693
21900
|
code: "nothing_to_set",
|
|
21694
|
-
fix: `iamu set ${type2} ${
|
|
21901
|
+
fix: `iamu set ${type2}${type2 === "testability" || type2 === "context" ? "" : ` ${effectiveSlug}`} ${FLAG_NAMES[allowed[0]]} ...`
|
|
21695
21902
|
}
|
|
21696
21903
|
);
|
|
21697
21904
|
return;
|
|
21698
21905
|
}
|
|
21906
|
+
if (type2 === "testability") {
|
|
21907
|
+
const doc = await readTestability(projectRoot) ?? {
|
|
21908
|
+
frontmatter: {
|
|
21909
|
+
schema_version: 1,
|
|
21910
|
+
status: "draft",
|
|
21911
|
+
target_url: "http://localhost:3000"
|
|
21912
|
+
},
|
|
21913
|
+
body: ""
|
|
21914
|
+
};
|
|
21915
|
+
const fm2 = { ...doc.frontmatter };
|
|
21916
|
+
const changed2 = applyChanges(type2, fm2, effectiveOpts);
|
|
21917
|
+
let body = doc.body;
|
|
21918
|
+
if (effectiveOpts.body !== void 0) {
|
|
21919
|
+
body = effectiveOpts.body;
|
|
21920
|
+
changed2.push("body");
|
|
21921
|
+
}
|
|
21922
|
+
const writtenPath2 = testabilityPath(projectRoot);
|
|
21923
|
+
try {
|
|
21924
|
+
await writeTestability(
|
|
21925
|
+
projectRoot,
|
|
21926
|
+
fm2,
|
|
21927
|
+
body
|
|
21928
|
+
);
|
|
21929
|
+
} catch (err) {
|
|
21930
|
+
const message = err instanceof ZodError2 ? err.issues.map((i) => `${i.path.join(".") || "root"}: ${i.message}`).join("; ") : err instanceof Error ? err.message : String(err);
|
|
21931
|
+
commandError(`Could not set testability: ${message}`, {
|
|
21932
|
+
...opts,
|
|
21933
|
+
code: "testability_write_error",
|
|
21934
|
+
fix: "iamu set testability --target <url>"
|
|
21935
|
+
});
|
|
21936
|
+
return;
|
|
21937
|
+
}
|
|
21938
|
+
if (opts.json) {
|
|
21939
|
+
console.log(
|
|
21940
|
+
JSON.stringify({
|
|
21941
|
+
slug: "testability",
|
|
21942
|
+
type: "testability",
|
|
21943
|
+
path: writtenPath2,
|
|
21944
|
+
changed: changed2
|
|
21945
|
+
})
|
|
21946
|
+
);
|
|
21947
|
+
return;
|
|
21948
|
+
}
|
|
21949
|
+
console.log();
|
|
21950
|
+
console.log(
|
|
21951
|
+
` ${symbols.success} Updated testability: ${changed2.join(", ")}`
|
|
21952
|
+
);
|
|
21953
|
+
console.log(` ${chalk28.dim("path:")} ${writtenPath2}`);
|
|
21954
|
+
console.log();
|
|
21955
|
+
return;
|
|
21956
|
+
}
|
|
21957
|
+
if (type2 === "context") {
|
|
21958
|
+
const doc = await readContext(projectRoot) ?? {
|
|
21959
|
+
frontmatter: {
|
|
21960
|
+
schema_version: SCHEMA_VERSION,
|
|
21961
|
+
status: "draft"
|
|
21962
|
+
},
|
|
21963
|
+
notes_body: ""
|
|
21964
|
+
};
|
|
21965
|
+
const fm2 = { ...doc.frontmatter };
|
|
21966
|
+
const changed2 = applyChanges(type2, fm2, effectiveOpts);
|
|
21967
|
+
let body = doc.notes_body;
|
|
21968
|
+
if (effectiveOpts.body !== void 0) {
|
|
21969
|
+
body = effectiveOpts.body;
|
|
21970
|
+
changed2.push("body");
|
|
21971
|
+
} else if (effectiveOpts.description !== void 0) {
|
|
21972
|
+
body = effectiveOpts.description ? String(effectiveOpts.description) : "";
|
|
21973
|
+
changed2.push("body");
|
|
21974
|
+
}
|
|
21975
|
+
const writtenPath2 = contextPath(projectRoot);
|
|
21976
|
+
try {
|
|
21977
|
+
await writeContext(projectRoot, {
|
|
21978
|
+
frontmatter: fm2,
|
|
21979
|
+
notes_body: body
|
|
21980
|
+
});
|
|
21981
|
+
} catch (err) {
|
|
21982
|
+
const message = err instanceof ZodError2 ? err.issues.map((i) => `${i.path.join(".") || "root"}: ${i.message}`).join("; ") : err instanceof Error ? err.message : String(err);
|
|
21983
|
+
commandError(`Could not set context: ${message}`, {
|
|
21984
|
+
...opts,
|
|
21985
|
+
code: "context_write_error",
|
|
21986
|
+
fix: "iamu set context --domain <domain>"
|
|
21987
|
+
});
|
|
21988
|
+
return;
|
|
21989
|
+
}
|
|
21990
|
+
if (opts.json) {
|
|
21991
|
+
console.log(
|
|
21992
|
+
JSON.stringify({
|
|
21993
|
+
slug: "context",
|
|
21994
|
+
type: "context",
|
|
21995
|
+
path: writtenPath2,
|
|
21996
|
+
changed: changed2
|
|
21997
|
+
})
|
|
21998
|
+
);
|
|
21999
|
+
return;
|
|
22000
|
+
}
|
|
22001
|
+
console.log();
|
|
22002
|
+
console.log(` ${symbols.success} Updated context: ${changed2.join(", ")}`);
|
|
22003
|
+
console.log(` ${chalk28.dim("path:")} ${writtenPath2}`);
|
|
22004
|
+
console.log();
|
|
22005
|
+
return;
|
|
22006
|
+
}
|
|
21699
22007
|
if (type2 === "capability") {
|
|
21700
22008
|
const candidatePaths = [
|
|
21701
22009
|
...typeof effectiveOpts.paths === "string" ? splitList(effectiveOpts.paths) : [],
|
|
@@ -21708,7 +22016,7 @@ async function setEntity(type2, slug, opts) {
|
|
|
21708
22016
|
{
|
|
21709
22017
|
...opts,
|
|
21710
22018
|
code: "invalid_route_prefix",
|
|
21711
|
-
fix: `iamu set ${type2} ${
|
|
22019
|
+
fix: `iamu set ${type2} ${effectiveSlug} --paths /${invalid[0]?.replace(/^\/+/, "") || ""}`
|
|
21712
22020
|
}
|
|
21713
22021
|
);
|
|
21714
22022
|
return;
|
|
@@ -21781,7 +22089,25 @@ var init_set_entity = __esm({
|
|
|
21781
22089
|
"state"
|
|
21782
22090
|
],
|
|
21783
22091
|
persona: ["access"],
|
|
21784
|
-
capability: ["paths", "addPath", "removePath", "area"]
|
|
22092
|
+
capability: ["paths", "addPath", "removePath", "area"],
|
|
22093
|
+
outline: ["capability", "additionalCapabilities"],
|
|
22094
|
+
testability: [
|
|
22095
|
+
"target",
|
|
22096
|
+
"devCommand",
|
|
22097
|
+
"authStrategy",
|
|
22098
|
+
"access",
|
|
22099
|
+
"harnesses",
|
|
22100
|
+
"untestableBoundaries",
|
|
22101
|
+
"body"
|
|
22102
|
+
],
|
|
22103
|
+
context: [
|
|
22104
|
+
"domain",
|
|
22105
|
+
"industry",
|
|
22106
|
+
"jurisdiction",
|
|
22107
|
+
"notes",
|
|
22108
|
+
"description",
|
|
22109
|
+
"body"
|
|
22110
|
+
]
|
|
21785
22111
|
};
|
|
21786
22112
|
FLAG_NAMES = {
|
|
21787
22113
|
entry: "--entry",
|
|
@@ -21793,7 +22119,20 @@ var init_set_entity = __esm({
|
|
|
21793
22119
|
paths: "--paths",
|
|
21794
22120
|
addPath: "--add-path",
|
|
21795
22121
|
removePath: "--remove-path",
|
|
21796
|
-
area: "--area"
|
|
22122
|
+
area: "--area",
|
|
22123
|
+
capability: "--capability",
|
|
22124
|
+
additionalCapabilities: "--additional-capabilities",
|
|
22125
|
+
devCommand: "--dev-command",
|
|
22126
|
+
authStrategy: "--auth-strategy",
|
|
22127
|
+
harnesses: "--harnesses",
|
|
22128
|
+
untestableBoundaries: "--untestable-boundaries",
|
|
22129
|
+
domain: "--domain",
|
|
22130
|
+
industry: "--industry",
|
|
22131
|
+
jurisdiction: "--jurisdiction",
|
|
22132
|
+
notes: "--notes",
|
|
22133
|
+
description: "--description",
|
|
22134
|
+
name: "--name",
|
|
22135
|
+
body: "--body"
|
|
21797
22136
|
};
|
|
21798
22137
|
}
|
|
21799
22138
|
});
|
|
@@ -23054,7 +23393,7 @@ __export(instructions_walk_exports, {
|
|
|
23054
23393
|
revisitSection: () => revisitSection,
|
|
23055
23394
|
viewportLine: () => viewportLine
|
|
23056
23395
|
});
|
|
23057
|
-
import { existsSync as existsSync16, readFileSync as readFileSync9 } from "fs";
|
|
23396
|
+
import { existsSync as existsSync16, readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "fs";
|
|
23058
23397
|
import { join as join9 } from "path";
|
|
23059
23398
|
import chalk31 from "chalk";
|
|
23060
23399
|
function selfCommand() {
|
|
@@ -23441,8 +23780,17 @@ async function instructionsWalk(opts) {
|
|
|
23441
23780
|
state: sfm.state ?? null,
|
|
23442
23781
|
context: contextYml,
|
|
23443
23782
|
untestableBoundaries
|
|
23444
|
-
}) : null
|
|
23783
|
+
}) : null,
|
|
23784
|
+
walker_prompt_path: null
|
|
23445
23785
|
};
|
|
23786
|
+
if (runDirPath && result.walker_prompt) {
|
|
23787
|
+
try {
|
|
23788
|
+
const promptPath = join9(runDirPath, "walker_prompt.txt");
|
|
23789
|
+
writeFileSync4(promptPath, result.walker_prompt, "utf-8");
|
|
23790
|
+
result.walker_prompt_path = promptPath;
|
|
23791
|
+
} catch {
|
|
23792
|
+
}
|
|
23793
|
+
}
|
|
23446
23794
|
if (opts.json) {
|
|
23447
23795
|
console.log(JSON.stringify(result, null, 2));
|
|
23448
23796
|
return;
|
|
@@ -24463,13 +24811,25 @@ async function evaluateRecord(runId, opts) {
|
|
|
24463
24811
|
});
|
|
24464
24812
|
return;
|
|
24465
24813
|
}
|
|
24814
|
+
const defaultVerdictsPath = path34.join(runDirPath, "verdicts.json");
|
|
24466
24815
|
if (!opts.file && !opts.data) {
|
|
24467
|
-
|
|
24468
|
-
|
|
24469
|
-
|
|
24470
|
-
|
|
24471
|
-
}
|
|
24472
|
-
|
|
24816
|
+
let hasExisting = false;
|
|
24817
|
+
try {
|
|
24818
|
+
await fs32.access(defaultVerdictsPath);
|
|
24819
|
+
hasExisting = true;
|
|
24820
|
+
} catch {
|
|
24821
|
+
hasExisting = false;
|
|
24822
|
+
}
|
|
24823
|
+
if (hasExisting) {
|
|
24824
|
+
opts.file = defaultVerdictsPath;
|
|
24825
|
+
} else {
|
|
24826
|
+
commandError("Either --file <path> or --data <json> is required", {
|
|
24827
|
+
...opts,
|
|
24828
|
+
code: "missing_verdicts_input",
|
|
24829
|
+
fix: `iamu evaluate-record ${runId} --data '<json>'`
|
|
24830
|
+
});
|
|
24831
|
+
return;
|
|
24832
|
+
}
|
|
24473
24833
|
}
|
|
24474
24834
|
let parsedFile;
|
|
24475
24835
|
try {
|
|
@@ -25426,13 +25786,25 @@ async function matchRecord(runId, opts) {
|
|
|
25426
25786
|
});
|
|
25427
25787
|
const manifest = await completedManifest2(runDirPath, runId, opts);
|
|
25428
25788
|
if (!manifest) return;
|
|
25789
|
+
const defaultMatchesPath = path36.join(runDirPath, "matches.json");
|
|
25429
25790
|
if (!opts.file && !opts.data) {
|
|
25430
|
-
|
|
25431
|
-
|
|
25432
|
-
|
|
25433
|
-
|
|
25434
|
-
}
|
|
25435
|
-
|
|
25791
|
+
let hasExisting = false;
|
|
25792
|
+
try {
|
|
25793
|
+
await fs34.access(defaultMatchesPath);
|
|
25794
|
+
hasExisting = true;
|
|
25795
|
+
} catch {
|
|
25796
|
+
hasExisting = false;
|
|
25797
|
+
}
|
|
25798
|
+
if (hasExisting) {
|
|
25799
|
+
opts.file = defaultMatchesPath;
|
|
25800
|
+
} else {
|
|
25801
|
+
commandError("Either --file <path> or --data <json> is required", {
|
|
25802
|
+
...opts,
|
|
25803
|
+
code: "missing_matches_input",
|
|
25804
|
+
fix: `iamu match-record ${runId} --data '<json>'`
|
|
25805
|
+
});
|
|
25806
|
+
return;
|
|
25807
|
+
}
|
|
25436
25808
|
}
|
|
25437
25809
|
let answer;
|
|
25438
25810
|
try {
|
|
@@ -25874,12 +26246,12 @@ function registerProjectCommands(program2) {
|
|
|
25874
26246
|
await newEntity2(type2, opts);
|
|
25875
26247
|
}
|
|
25876
26248
|
);
|
|
25877
|
-
program2.command("set <type>
|
|
25878
|
-
"Change how an entity is staged: a scenario's start path, target and starting state, a persona's access key, a capability's routes (scenario, persona, capability)"
|
|
26249
|
+
program2.command("set <type> [slug]").helpGroup("Project:").description(
|
|
26250
|
+
"Change how an entity is staged: a scenario's start path, target and starting state, a persona's access key, a capability's routes, or project testability / context (scenario, persona, capability, testability, context)"
|
|
25879
26251
|
).option(
|
|
25880
26252
|
"--entry <path>",
|
|
25881
26253
|
"Where the walk starts, as a path on the product (scenario)"
|
|
25882
|
-
).option("--no-entry", "Clear the start path (scenario)").option("--target <url>", "Default target URL (scenario)").option("--no-target", "Clear the default target URL (scenario)").option(
|
|
26254
|
+
).option("--no-entry", "Clear the start path (scenario)").option("--target <url>", "Default target URL (scenario, testability)").option("--no-target", "Clear the default target URL (scenario)").option(
|
|
25883
26255
|
"--state-description <text>",
|
|
25884
26256
|
"What the world must contain, in domain words (scenario)"
|
|
25885
26257
|
).option(
|
|
@@ -25887,8 +26259,8 @@ function registerProjectCommands(program2) {
|
|
|
25887
26259
|
"How the walker picks the closest record when the exact one is missing (scenario)"
|
|
25888
26260
|
).option("--no-state", "Clear the starting state (scenario)").option(
|
|
25889
26261
|
"--access <key>",
|
|
25890
|
-
"Account, role or switcher key this persona uses (persona)"
|
|
25891
|
-
).option("--no-access", "Clear the access key (persona)").option(
|
|
26262
|
+
"Account, role or switcher key this persona uses (persona, testability)"
|
|
26263
|
+
).option("--no-access", "Clear the access key (persona, testability)").option(
|
|
25892
26264
|
"--paths <paths>",
|
|
25893
26265
|
"Route prefixes, comma-separated; replaces the list (capability)"
|
|
25894
26266
|
).option("--no-paths", "Clear route prefixes (capability)").option(
|
|
@@ -25899,12 +26271,27 @@ function registerProjectCommands(program2) {
|
|
|
25899
26271
|
"--remove-path <path>",
|
|
25900
26272
|
"Remove a route prefix (capability, repeatable)",
|
|
25901
26273
|
(val, prev = []) => [...prev, val]
|
|
25902
|
-
).option("--area <name>", "Visual grouping category (capability)").option("--no-area", "Clear the area (capability)").option(
|
|
26274
|
+
).option("--area <name>", "Visual grouping category (capability)").option("--no-area", "Clear the area (capability)").option("--capability <slug>", "Primary capability slug (outline)").option("--no-capability", "Clear primary capability (outline)").option(
|
|
26275
|
+
"--additional-capabilities <slugs>",
|
|
26276
|
+
"Secondary capability slugs, comma-separated (outline)"
|
|
26277
|
+
).option(
|
|
26278
|
+
"--no-additional-capabilities",
|
|
26279
|
+
"Clear secondary capabilities (outline)"
|
|
26280
|
+
).option("--dev-command <cmd>", "Dev startup command (testability)").option("--no-dev-command", "Clear dev startup command (testability)").option("--auth-strategy <strategy>", "Auth strategy (testability)").option("--no-auth-strategy", "Clear auth strategy (testability)").option(
|
|
26281
|
+
"--harnesses <list>",
|
|
26282
|
+
"Mock frameworks or seed scripts, comma-separated (testability)"
|
|
26283
|
+
).option("--no-harnesses", "Clear harnesses (testability)").option(
|
|
26284
|
+
"--untestable-boundaries <list>",
|
|
26285
|
+
"Forbidden external endpoints, comma-separated (testability)"
|
|
26286
|
+
).option(
|
|
26287
|
+
"--no-untestable-boundaries",
|
|
26288
|
+
"Clear untestable boundaries (testability)"
|
|
26289
|
+
).option("--domain <text>", "Domain name (context)").option("--industry <text>", "Industry category (context)").option("--jurisdiction <text>", "Jurisdiction or region (context)").option("--notes <text>", "Orientation notes (context)").option("--description <text>", "Project description (context)").option("--name <text>", "Project name (context)").option("--body <text>", "Markdown narrative body (testability, context)").option(
|
|
25903
26290
|
"--file <path>",
|
|
25904
26291
|
"JSON patch file to apply staging fields (or - for stdin)"
|
|
25905
26292
|
).option("--json", "Output as JSON").addHelpText(
|
|
25906
26293
|
"after",
|
|
25907
|
-
'\nWhat a scenario is about (narrative, tension, human tests, brief) is not set here.\n\nExamples:\n $ iamu set scenario maria--handoff --entry /incidents --state-description "Five open incidents at one site"\n $ iamu set persona maria --access coordinator@site-a.test\n $ iamu set capability team-access --add-path /team\n $ iamu set scenario maria--handoff --file patch.json'
|
|
26294
|
+
'\nWhat a scenario is about (narrative, tension, human tests, brief) is not set here.\n\nExamples:\n $ iamu set scenario maria--handoff --entry /incidents --state-description "Five open incidents at one site"\n $ iamu set persona maria --access coordinator@site-a.test\n $ iamu set outline shift-handoff --capability incident-reporting\n $ iamu set capability team-access --add-path /team\n $ iamu set testability --target http://localhost:5173 --dev-command "./dev" --auth-strategy dev_switcher\n $ iamu set context --domain "Workplace safety" --industry "Manufacturing" --description "..."\n $ iamu set scenario maria--handoff --file patch.json'
|
|
25908
26295
|
).action(
|
|
25909
26296
|
async (type2, slug, opts) => {
|
|
25910
26297
|
const { setEntity: setEntity2 } = await Promise.resolve().then(() => (init_set_entity(), set_entity_exports));
|
|
@@ -26023,41 +26410,65 @@ function registerWalkthroughCommands(program2) {
|
|
|
26023
26410
|
"--surface <text>",
|
|
26024
26411
|
`"browse" (default) for iamu browse, or a description of your own browser tool \u2014 becomes the walker prompt's Driving surface section`
|
|
26025
26412
|
).option("--json", "Output as JSON").action(
|
|
26026
|
-
async (phase, slug, opts) => {
|
|
26413
|
+
async (phase, slug, opts, cmd) => {
|
|
26414
|
+
const effectiveOpts = {
|
|
26415
|
+
...cmd.optsWithGlobals(),
|
|
26416
|
+
...opts
|
|
26417
|
+
};
|
|
26027
26418
|
const { instructions: instructions2 } = await Promise.resolve().then(() => (init_instructions(), instructions_exports));
|
|
26028
|
-
await instructions2(phase, slug,
|
|
26419
|
+
await instructions2(phase, slug, effectiveOpts);
|
|
26029
26420
|
}
|
|
26030
26421
|
);
|
|
26031
26422
|
instrCmd.command("walk [scenario-slug]").description("Compose walking prompt from scenario + persona + outline").option("--scenario <slug>", "Scenario slug (default: active scenario)").option("--run <run-id>", "Run ID (resolves target URL from manifest)").option(
|
|
26032
26423
|
"--surface <text>",
|
|
26033
26424
|
`"browse" (default) for iamu browse, or a description of your own browser tool \u2014 becomes the walker prompt's Driving surface section`
|
|
26034
26425
|
).option("--json", "Output as JSON").action(
|
|
26035
|
-
async (scenarioSlug, opts) => {
|
|
26426
|
+
async (scenarioSlug, opts, cmd) => {
|
|
26427
|
+
const effectiveOpts = {
|
|
26428
|
+
...cmd.parent?.opts(),
|
|
26429
|
+
...cmd.optsWithGlobals(),
|
|
26430
|
+
...opts
|
|
26431
|
+
};
|
|
26036
26432
|
const { instructionsWalk: instructionsWalk2 } = await Promise.resolve().then(() => (init_instructions_walk(), instructions_walk_exports));
|
|
26037
26433
|
await instructionsWalk2({
|
|
26038
|
-
...
|
|
26039
|
-
scenario: scenarioSlug ??
|
|
26434
|
+
...effectiveOpts,
|
|
26435
|
+
scenario: scenarioSlug ?? effectiveOpts.scenario
|
|
26040
26436
|
});
|
|
26041
26437
|
}
|
|
26042
26438
|
);
|
|
26043
26439
|
instrCmd.command("stage [scenario-slug]").description(
|
|
26044
26440
|
"Dynamic staging instructions: persona, outline, tension, boundaries"
|
|
26045
26441
|
).option("--json", "Output as JSON").action(
|
|
26046
|
-
async (scenarioSlug, opts) => {
|
|
26442
|
+
async (scenarioSlug, opts, cmd) => {
|
|
26443
|
+
const effectiveOpts = {
|
|
26444
|
+
...cmd.parent?.opts(),
|
|
26445
|
+
...cmd.optsWithGlobals(),
|
|
26446
|
+
...opts
|
|
26447
|
+
};
|
|
26047
26448
|
const { instructionsStage: instructionsStage2 } = await Promise.resolve().then(() => (init_instructions(), instructions_exports));
|
|
26048
|
-
await instructionsStage2(scenarioSlug,
|
|
26449
|
+
await instructionsStage2(scenarioSlug, effectiveOpts);
|
|
26049
26450
|
}
|
|
26050
26451
|
);
|
|
26051
|
-
instrCmd.command("setup").description("Dynamic project setup instructions & prerequisite checks").option("--json", "Output as JSON").action(async (opts) => {
|
|
26452
|
+
instrCmd.command("setup").description("Dynamic project setup instructions & prerequisite checks").option("--json", "Output as JSON").action(async (opts, cmd) => {
|
|
26453
|
+
const effectiveOpts = {
|
|
26454
|
+
...cmd.parent?.opts(),
|
|
26455
|
+
...cmd.optsWithGlobals(),
|
|
26456
|
+
...opts
|
|
26457
|
+
};
|
|
26052
26458
|
const { instructionsSetup: instructionsSetup2 } = await Promise.resolve().then(() => (init_instructions(), instructions_exports));
|
|
26053
|
-
await instructionsSetup2(
|
|
26459
|
+
await instructionsSetup2(effectiveOpts);
|
|
26054
26460
|
});
|
|
26055
26461
|
instrCmd.command("triage [run-or-scenario-slug]").description(
|
|
26056
26462
|
"Dynamic triage instructions: finding triage, confirmation, dismissal guidance"
|
|
26057
26463
|
).option("--run <run-id>", "Run ID to triage findings for").option("--json", "Output as JSON").action(
|
|
26058
|
-
async (slug, opts) => {
|
|
26464
|
+
async (slug, opts, cmd) => {
|
|
26465
|
+
const effectiveOpts = {
|
|
26466
|
+
...cmd.parent?.opts(),
|
|
26467
|
+
...cmd.optsWithGlobals(),
|
|
26468
|
+
...opts
|
|
26469
|
+
};
|
|
26059
26470
|
const { instructionsTriage: instructionsTriage2 } = await Promise.resolve().then(() => (init_instructions(), instructions_exports));
|
|
26060
|
-
await instructionsTriage2(slug,
|
|
26471
|
+
await instructionsTriage2(slug, effectiveOpts);
|
|
26061
26472
|
}
|
|
26062
26473
|
);
|
|
26063
26474
|
program2.command("browse <command> [args...]").helpGroup("Walkthrough:").description(
|
|
@@ -26195,7 +26606,14 @@ function registerWalkthroughCommands(program2) {
|
|
|
26195
26606
|
);
|
|
26196
26607
|
program2.command("match-record <run-id>").helpGroup("Walkthrough:").description(
|
|
26197
26608
|
"Record finding matches and re-derive the run's since-last-run delta"
|
|
26198
|
-
).option("--file <path>", "Path to matches JSON file (or - for stdin)").option("--data <json>", "Inline matches JSON string").option("--json", "Output match results as JSON").
|
|
26609
|
+
).option("--file <path>", "Path to matches JSON file (or - for stdin)").option("--data <json>", "Inline matches JSON string").option("--json", "Output match results as JSON").addHelpText(
|
|
26610
|
+
"after",
|
|
26611
|
+
`
|
|
26612
|
+
Examples:
|
|
26613
|
+
$ iamu match-record <run-id> --data '{"matches":[]}'
|
|
26614
|
+
$ iamu match-record <run-id> --file matches.json
|
|
26615
|
+
$ iamu match-record <run-id> --json`
|
|
26616
|
+
).action(
|
|
26199
26617
|
async (runId, opts) => {
|
|
26200
26618
|
const { matchRecord: matchRecord2 } = await Promise.resolve().then(() => (init_match(), match_exports));
|
|
26201
26619
|
await matchRecord2(runId, opts);
|
|
@@ -26209,7 +26627,13 @@ function registerWalkthroughCommands(program2) {
|
|
|
26209
26627
|
);
|
|
26210
26628
|
program2.command("evaluate-record <run-id>").helpGroup("Walkthrough:").description("Record evaluation verdicts into the run's verdicts.json").option("--file <path>", "Path to verdicts JSON file (or - for stdin)").option("--data <json>", "Inline verdicts JSON string").option("--json", "Output summary as JSON").option("-y, --yes", "Skip interactive prompts").option("--no-prompt", "Skip interactive prompt to view results").option("--no-push", "Skip pushing the updated run to Iamu Cloud").option("--view", "Open results in browser immediately without prompt").addHelpText(
|
|
26211
26629
|
"after",
|
|
26212
|
-
|
|
26630
|
+
`
|
|
26631
|
+
Examples:
|
|
26632
|
+
$ iamu evaluate-record <run-id> --data '{"verdicts":[]}' --no-prompt --no-push
|
|
26633
|
+
$ iamu evaluate-record <run-id> --file verdicts.json
|
|
26634
|
+
$ iamu evaluate-record <run-id> --file verdicts.json --no-prompt
|
|
26635
|
+
$ iamu evaluate-record <run-id> --file verdicts.json --no-push
|
|
26636
|
+
$ iamu evaluate-record <run-id> --file verdicts.json --json`
|
|
26213
26637
|
).action(
|
|
26214
26638
|
async (runId, opts) => {
|
|
26215
26639
|
const { evaluateRecord: evaluateRecord2 } = await Promise.resolve().then(() => (init_evaluate(), evaluate_exports));
|