@iamu-dev/iamu 0.2.0-beta.6 → 0.2.0-beta.7

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 CHANGED
@@ -824,7 +824,14 @@ var init_scenario = __esm({
824
824
  reviews: z15.array(z15.string().min(1).max(64)).max(16).default([]),
825
825
  baseline_score: z15.number().min(0).max(100).nullish(),
826
826
  current_score: z15.number().min(0).max(100).nullish(),
827
- target_score: z15.number().min(0).max(100).default(95)
827
+ target_score: z15.number().min(0).max(100).default(95),
828
+ /** Environment state preconditions and approximation guidance. */
829
+ state: z15.object({
830
+ /** Description of data/records expected to exist in the environment. */
831
+ description: z15.string().max(2048).nullish(),
832
+ /** Guidance on how to squint or approximate if exact records are absent. */
833
+ approximation: z15.string().max(2048).nullish()
834
+ }).nullish()
828
835
  });
829
836
  }
830
837
  });
@@ -12325,15 +12332,6 @@ function mcpJson(cmd) {
12325
12332
  2
12326
12333
  );
12327
12334
  }
12328
- function vscodeMcpJson(cmd) {
12329
- return JSON.stringify(
12330
- {
12331
- servers: { iamu: { type: "stdio", command: cmd[0], args: cmd.slice(1) } }
12332
- },
12333
- null,
12334
- 2
12335
- );
12336
- }
12337
12335
  function detectHosts(projectRoot) {
12338
12336
  return HOST_ADAPTERS.filter(
12339
12337
  (host) => host.detectionPaths.some((p) => existsSync3(join3(projectRoot, p)))
@@ -12382,13 +12380,17 @@ var init_registry = __esm({
12382
12380
  {
12383
12381
  name: "GitHub Copilot",
12384
12382
  value: "github-copilot",
12385
- detectionPaths: [".vscode", ".github/copilot-instructions.md"],
12386
- supportsSkills: false,
12387
- getSkillsDir: () => "",
12388
- getCommandPath: (root, id) => join3(root, ".github", "prompts", `iamu-${id}.prompt.md`),
12389
- formatCommand: descOnlyFormat,
12390
- getMcpConfigPath: (root) => join3(root, ".vscode", "mcp.json"),
12391
- formatMcpConfig: vscodeMcpJson
12383
+ detectionPaths: [
12384
+ ".github/copilot-instructions.md",
12385
+ ".github/skills",
12386
+ ".copilot"
12387
+ ],
12388
+ supportsSkills: true,
12389
+ getSkillsDir: (root) => join3(root, ".github", "skills"),
12390
+ getCommandPath: (root, id) => join3(root, ".github", "skills", `iamu-${id}`, "SKILL.md"),
12391
+ formatCommand: richFormat,
12392
+ getMcpConfigPath: (root) => join3(root, ".mcp.json"),
12393
+ formatMcpConfig: mcpJson
12392
12394
  },
12393
12395
  {
12394
12396
  name: "Cline",
@@ -12570,6 +12572,14 @@ function isCliWrittenSkill(path28) {
12570
12572
  return false;
12571
12573
  }
12572
12574
  }
12575
+ function isCliWrittenPrompt(path28) {
12576
+ try {
12577
+ const content = readFileSync3(path28, "utf-8");
12578
+ return content.includes("iamu") || /^generatedBy:/m.test(content);
12579
+ } catch {
12580
+ return false;
12581
+ }
12582
+ }
12573
12583
  function planSkillFiles(hosts, projectRoot, version2) {
12574
12584
  const skillTemplates = loadSkillTemplates(version2);
12575
12585
  const files = [];
@@ -12598,6 +12608,19 @@ function planSkillFiles(hosts, projectRoot, version2) {
12598
12608
  }
12599
12609
  }
12600
12610
  }
12611
+ if (host.value === "github-copilot") {
12612
+ for (const cmd of commandsFromSkills(skillTemplates)) {
12613
+ const legacyPrompt = join4(
12614
+ projectRoot,
12615
+ ".github",
12616
+ "prompts",
12617
+ `iamu-${cmd.id}.prompt.md`
12618
+ );
12619
+ if (isCliWrittenPrompt(legacyPrompt)) {
12620
+ files.push({ host, path: legacyPrompt, content: null });
12621
+ }
12622
+ }
12623
+ }
12601
12624
  } else {
12602
12625
  for (const cmd of commandsFromSkills(skillTemplates)) {
12603
12626
  files.push({
@@ -12622,6 +12645,15 @@ function detectInstalledHosts(projectRoot) {
12622
12645
  const skillDir = join4(host.getSkillsDir(projectRoot), "iamu-setup");
12623
12646
  if (existsSync5(skillDir)) return true;
12624
12647
  }
12648
+ if (host.value === "github-copilot") {
12649
+ const legacyPrompt = join4(
12650
+ projectRoot,
12651
+ ".github",
12652
+ "prompts",
12653
+ "iamu-setup.prompt.md"
12654
+ );
12655
+ if (existsSync5(legacyPrompt)) return true;
12656
+ }
12625
12657
  return false;
12626
12658
  });
12627
12659
  }
@@ -16341,7 +16373,10 @@ var init_browse_actions = __esm({
16341
16373
  usage: "goto <url>",
16342
16374
  minArgs: 1,
16343
16375
  run: async (p, args) => {
16344
- await p.goto(args[0], { waitUntil: "domcontentloaded" });
16376
+ await p.goto(args[0], {
16377
+ waitUntil: "domcontentloaded",
16378
+ timeout: 1e4
16379
+ });
16345
16380
  }
16346
16381
  },
16347
16382
  click: {
@@ -16502,6 +16537,12 @@ var init_browse_driver = __esm({
16502
16537
  commandLine: (pid) => readProcessCommandLine(pid),
16503
16538
  kill(pid) {
16504
16539
  try {
16540
+ if (process.platform !== "win32") {
16541
+ try {
16542
+ process.kill(-pid, "SIGTERM");
16543
+ } catch {
16544
+ }
16545
+ }
16505
16546
  process.kill(pid, "SIGTERM");
16506
16547
  } catch {
16507
16548
  }
@@ -16878,6 +16919,8 @@ function chromeArgs(opts, port, headless) {
16878
16919
  `--window-size=${opts.width ?? "1280"},${opts.height ?? "900"}`,
16879
16920
  "--no-first-run",
16880
16921
  "--no-default-browser-check",
16922
+ "--password-store=basic",
16923
+ "--use-mock-keychain",
16881
16924
  ...headless ? ["--headless=new", "--disable-dev-shm-usage", "--disable-gpu"] : [],
16882
16925
  ...shouldDisableSandbox() ? ["--no-sandbox"] : [],
16883
16926
  "about:blank"
@@ -18554,13 +18597,21 @@ function defaultFrontmatter(type2, id, slug, name, opts) {
18554
18597
  url: opts.url,
18555
18598
  authority_level: opts.authority ?? "informational"
18556
18599
  };
18557
- case "scenario":
18600
+ case "scenario": {
18601
+ const stateObj = opts.stateDescription || opts.stateApproximation ? {
18602
+ state: {
18603
+ ...opts.stateDescription ? { description: opts.stateDescription } : {},
18604
+ ...opts.stateApproximation ? { approximation: opts.stateApproximation } : {}
18605
+ }
18606
+ } : {};
18558
18607
  return {
18559
18608
  ...base,
18560
18609
  outline: opts.outline ?? null,
18561
18610
  persona: opts.persona ?? null,
18562
- ...opts.entry ? { entry_path: opts.entry } : {}
18611
+ ...opts.entry ? { entry_path: opts.entry } : {},
18612
+ ...stateObj
18563
18613
  };
18614
+ }
18564
18615
  default:
18565
18616
  return base;
18566
18617
  }
@@ -18954,6 +19005,17 @@ function composeWalkerPrompt(p) {
18954
19005
  "",
18955
19006
  "## First-person brief",
18956
19007
  p.brief ?? "",
19008
+ ...p.context ? ["", "## Product domain & regulatory context", p.context.trim()] : [],
19009
+ ...p.state?.description || p.state?.approximation ? [
19010
+ "",
19011
+ "## Expected state & semantic squinting",
19012
+ p.state.description ? `Expected state: ${p.state.description}` : "",
19013
+ p.state.approximation ? `Approximation strategy: ${p.state.approximation}` : "",
19014
+ "Squinting Guardrails:",
19015
+ "\u2022 If the exact target record/option is not available, apply the approximation strategy above to pick the closest plausible entity within the domain flow.",
19016
+ "\u2022 Squinting does NOT permit drifting to unrelated settings, account profiles, or off-target pages. Stay strictly within the scenario journey.",
19017
+ "\u2022 If the system is completely empty or unseeded, and your persona role cannot create data, do NOT report false product bugs about the empty state. Note that preconditions are unseeded/blocked."
19018
+ ].filter(Boolean) : [],
18957
19019
  ...revisitSection(p.revisit ?? []),
18958
19020
  "",
18959
19021
  "## Access",
@@ -19102,7 +19164,8 @@ async function instructionsWalk(opts) {
19102
19164
  const result = {
19103
19165
  scenario: {
19104
19166
  slug: sfm.slug,
19105
- brief: scenario.body.trim() || null
19167
+ brief: scenario.body.trim() || null,
19168
+ state: sfm.state ?? null
19106
19169
  },
19107
19170
  persona: {
19108
19171
  slug: sfm.persona,
@@ -19156,7 +19219,9 @@ async function instructionsWalk(opts) {
19156
19219
  runDirPath,
19157
19220
  projectRoot,
19158
19221
  surface: opts.surface ?? "browse",
19159
- viewport
19222
+ viewport,
19223
+ state: sfm.state ?? null,
19224
+ context: contextYml
19160
19225
  }) : null
19161
19226
  };
19162
19227
  if (opts.json) {
@@ -19168,6 +19233,11 @@ async function instructionsWalk(opts) {
19168
19233
  console.log(` ${chalk26.dim("scenario:")} ${sfm.slug}`);
19169
19234
  console.log(` ${chalk26.dim("persona:")} ${pfm.name} (${pfm.role})`);
19170
19235
  console.log(` ${chalk26.dim("outline:")} ${ofm.title}`);
19236
+ if (sfm.state?.description || sfm.state?.approximation) {
19237
+ console.log(
19238
+ ` ${chalk26.dim("state:")} ${sfm.state.description ? sfm.state.description : sfm.state.approximation ?? ""}`
19239
+ );
19240
+ }
19171
19241
  if (targetUrl) console.log(` ${chalk26.dim("target:")} ${targetUrl}`);
19172
19242
  console.log(
19173
19243
  ` ${chalk26.dim("access:")} ${projectAccess || personaAccess ? `${projectAccess ? "project" : ""}${projectAccess && personaAccess ? " + " : ""}${personaAccess ? "persona" : ""}` : "not recorded (walker would run as whoever is signed in)"}`
@@ -20851,6 +20921,12 @@ function registerProjectCommands(program2) {
20851
20921
  ).option("--outline <slug>", "Outline slug (scenario only)").option("--persona <slug>", "Persona slug (scenario only)").option(
20852
20922
  "--entry <path>",
20853
20923
  "Where the situation starts, as a path on the product, e.g. /en/episodes/1 (scenario only)"
20924
+ ).option(
20925
+ "--state-description <text>",
20926
+ "Assumed environment data/records state (scenario only)"
20927
+ ).option(
20928
+ "--state-approximation <text>",
20929
+ "Guidance on how persona should approximate/squint if records are missing (scenario only)"
20854
20930
  ).option("--url <url>", "Document the source cites (source only, required)").option(
20855
20931
  "--authority <level>",
20856
20932
  "legislation | regulation | standard | company_policy | guideline | informational (source only, default informational)"