@iamu-dev/iamu 0.8.0-beta.0 → 0.8.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.
Files changed (47) hide show
  1. package/README.md +4 -2
  2. package/dist/bin.js +13590 -11724
  3. package/dist/commands/advise.d.ts +4 -2
  4. package/dist/commands/agent-commands.d.ts +22 -0
  5. package/dist/commands/browse-actions.d.ts +1 -0
  6. package/dist/commands/browse-driver.d.ts +30 -6
  7. package/dist/commands/browse.d.ts +58 -2
  8. package/dist/commands/cloud-push.d.ts +3 -3
  9. package/dist/commands/complete.d.ts +21 -0
  10. package/dist/commands/completion.d.ts +2 -0
  11. package/dist/commands/context.d.ts +19 -0
  12. package/dist/commands/dev-script.d.ts +14 -0
  13. package/dist/commands/doctor.d.ts +6 -0
  14. package/dist/commands/edit-entity.d.ts +5 -3
  15. package/dist/commands/evaluate.d.ts +10 -3
  16. package/dist/commands/finding-stability.d.ts +1 -0
  17. package/dist/commands/findings.d.ts +9 -0
  18. package/dist/commands/init.d.ts +14 -5
  19. package/dist/commands/instructions-walk.d.ts +8 -0
  20. package/dist/commands/instructions.d.ts +2 -11
  21. package/dist/commands/list.d.ts +3 -0
  22. package/dist/commands/match.d.ts +8 -5
  23. package/dist/commands/new-entity.d.ts +2 -0
  24. package/dist/commands/new-finding.d.ts +2 -0
  25. package/dist/commands/persona-today.d.ts +20 -0
  26. package/dist/commands/preflight.d.ts +4 -2
  27. package/dist/commands/pull.d.ts +1 -1
  28. package/dist/commands/set-entity.d.ts +15 -3
  29. package/dist/commands/skill-command.d.ts +13 -0
  30. package/dist/commands/step.d.ts +4 -0
  31. package/dist/commands/summary.d.ts +2 -0
  32. package/dist/commands/triage.d.ts +15 -0
  33. package/dist/index.js +13571 -11715
  34. package/dist/templates/prompts/complete.md +2 -3
  35. package/dist/templates/prompts/designer.md +10 -4
  36. package/dist/templates/prompts/persona.md +2 -1
  37. package/dist/templates/prompts/walk.md +26 -12
  38. package/dist/templates/skills/iamu-design.md +20 -15
  39. package/dist/templates/skills/iamu-findings.md +6 -6
  40. package/dist/templates/skills/iamu-new.md +9 -9
  41. package/dist/templates/skills/iamu-run.md +66 -42
  42. package/dist/templates/skills/iamu-setup.md +155 -76
  43. package/dist/templates/skills/iamu-stage.md +29 -23
  44. package/dist/templates/skills/iamu-status.md +2 -0
  45. package/dist/templates.d.ts +1 -1
  46. package/package.json +3 -3
  47. package/dist/templates/prompts/evaluate.md +0 -64
@@ -3,6 +3,7 @@ export declare const ADVISOR_VERSION = "1.5.0";
3
3
  /** The installed `iamu/.prompts/advise.md`, or the bundled template. */
4
4
  export declare function readAdvisePrompt(projectRoot: string): string;
5
5
  export interface AdviseOptions {
6
+ run?: string;
6
7
  project?: boolean;
7
8
  json?: boolean;
8
9
  promptFile?: string;
@@ -11,15 +12,16 @@ export interface AdviseOptions {
11
12
  * Print the advisor's input: for a run (after the judge, before publish)
12
13
  * or, with --project, across every open finding in the project.
13
14
  */
14
- export declare function advise(runId: string | undefined, opts?: AdviseOptions): Promise<void>;
15
+ export declare function advise(runIdArg: string | undefined, opts?: AdviseOptions): Promise<void>;
15
16
  export interface AdviseRecordOptions {
17
+ run?: string;
16
18
  project?: boolean;
17
19
  file?: string;
18
20
  data?: string;
19
21
  json?: boolean;
20
22
  }
21
23
  /** Record the advisor's answer for a run, or a project synthesis. */
22
- export declare function adviseRecord(runId: string | undefined, opts: AdviseRecordOptions): Promise<void>;
24
+ export declare function adviseRecord(runIdArg: string | undefined, opts: AdviseRecordOptions): Promise<void>;
23
25
  export interface DirectionsOptions {
24
26
  json?: boolean;
25
27
  }
@@ -0,0 +1,22 @@
1
+ /** Skills the CLI points the agent at. */
2
+ export type AgentSkill = "run" | "findings" | "design";
3
+ /**
4
+ * How to invoke an iamu skill from the agent, in the form this project's
5
+ * host accepts (`/iamu:<skill>` with the plugin or Claude Code commands,
6
+ * else `/iamu-<skill>`). One name per skill: see `skillCommand`.
7
+ *
8
+ * @param projectRoot - Absolute path to the project root.
9
+ * @param skill - The skill to invoke.
10
+ * @param args - Arguments appended after the command, if any.
11
+ * @returns The slash command, e.g. `/iamu:run checkout`.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * agentCommand("/project", "run", "maya--video"); // "/iamu:run maya--video"
16
+ * ```
17
+ */
18
+ export declare function agentCommand(projectRoot: string, skill: AgentSkill, args?: string): string;
19
+ /** The re-run that turns a persona finding's fix into `verified`. */
20
+ export declare function rerunCommand(projectRoot: string, scenario: string): string;
21
+ /** The designer's review that turns a designer finding's fix into `verified`. */
22
+ export declare function designReviewCommand(screen: string): string;
@@ -28,6 +28,7 @@ export interface IndexedElement {
28
28
  name: string;
29
29
  type?: string;
30
30
  disabled?: boolean;
31
+ checked?: boolean;
31
32
  }
32
33
  export declare const INDEXED_SELECTOR: string;
33
34
  export declare function markAndQueryIndexedElements(page: Page): Promise<IndexedElement[]>;
@@ -43,7 +43,9 @@ export interface BrowserDriver {
43
43
  /** The full command line of `pid`, or null when it is gone or cannot be read. */
44
44
  commandLine(pid: number): Promise<string | null>;
45
45
  /** Send SIGTERM to `pid`. Never throws. */
46
- kill(pid: number): void;
46
+ kill(pid: number, signal?: NodeJS.Signals | number): void;
47
+ /** Is `pid` still alive in the OS process table? */
48
+ alive?(pid: number): boolean;
47
49
  }
48
50
  /** How long a CDP liveness probe may take before the port counts as dead. */
49
51
  export declare const CDP_PROBE_TIMEOUT_MS = 1000;
@@ -65,10 +67,9 @@ export declare const CDP_PROBE_TIMEOUT_MS = 1000;
65
67
  */
66
68
  export declare function probeCdp(port: number, timeoutMs?: number): Promise<boolean>;
67
69
  /**
68
- * The command line of a running process, read without a shell:
69
- * `/proc/<pid>/cmdline` on Linux, else `ps -ww -o args= -p <pid>`.
70
- * Windows has no equivalent we trust, so it answers null there — and
71
- * callers then leave the process alone.
70
+ * The command line of a running process:
71
+ * `/proc/<pid>/cmdline` on Linux, PowerShell CIM query on Windows,
72
+ * else `ps -ww -o args= -p <pid>`.
72
73
  *
73
74
  * @param pid - Process ID to inspect.
74
75
  * @param platform - Defaults to `process.platform`.
@@ -82,6 +83,12 @@ export declare function probeCdp(port: number, timeoutMs?: number): Promise<bool
82
83
  * @public
83
84
  */
84
85
  export declare function readProcessCommandLine(pid: number, platform?: NodeJS.Platform): Promise<string | null>;
86
+ /**
87
+ * Supported browser executable names in process command lines.
88
+ *
89
+ * @public
90
+ */
91
+ export declare const BROWSER_NAME_RE: RegExp;
85
92
  /**
86
93
  * Was this command line launched with exactly this `--user-data-dir`?
87
94
  * The profile directory is ours alone, so a match means the PID is the
@@ -116,6 +123,23 @@ export declare function isOurBrowser(commandLine: string | null, profileDir: str
116
123
  *
117
124
  * @public
118
125
  */
119
- export declare function reapBrowser(pid: number, profileDir: string, driver: Pick<BrowserDriver, "commandLine" | "kill">): Promise<boolean>;
126
+ export declare function reapBrowser(pid: number, profileDir: string, driver: Pick<BrowserDriver, "commandLine" | "kill"> & {
127
+ alive?: (pid: number) => boolean;
128
+ }): Promise<boolean>;
129
+ /**
130
+ * Select the target page to act on from all open pages in the context.
131
+ * Filters out devtools and browser internal/extension pages unless only internal pages exist.
132
+ * Respects pageIndex when valid; otherwise prefers the last active non-blank page.
133
+ *
134
+ * @param rawPages - All pages returned by the browser context.
135
+ * @param pageIndex - Optional explicit zero-based index into the filtered pages array.
136
+ * @returns The selected Page and the list of user/available pages.
137
+ *
138
+ * @public
139
+ */
140
+ export declare function selectTargetPage(rawPages: Page[], pageIndex?: number): {
141
+ page: Page | undefined;
142
+ pages: Page[];
143
+ };
120
144
  /** The real driver: spawns Chrome and speaks CDP through playwright-core. */
121
145
  export declare const cdpDriver: BrowserDriver;
@@ -3,6 +3,8 @@ import { type BrowserDriver, type Size } from "./browse-driver.js";
3
3
  export type { BrowserDriver } from "./browse-driver.js";
4
4
  /** Parsed options for `iamu browse <command>`. */
5
5
  export interface BrowseOptions {
6
+ /** step: record into a run that is already completed. */
7
+ force?: boolean;
6
8
  shot?: string;
7
9
  nth?: string;
8
10
  submit?: boolean;
@@ -19,6 +21,10 @@ export interface BrowseOptions {
19
21
  surface?: string;
20
22
  maxSteps?: string | number;
21
23
  stepFile?: string;
24
+ /** Chained page actions executed sequentially in a single browse step before screenshot. */
25
+ then?: string[];
26
+ /** Include post-action indexed snapshot in browse step output (default: true). */
27
+ snapshot?: boolean;
22
28
  json?: boolean;
23
29
  /** Annotate snapshot with 1-based index numbers [#N] for click-index / fill-index */
24
30
  indexed?: boolean;
@@ -72,6 +78,25 @@ export declare function parseViewport(value: string | undefined): Size | null;
72
78
  * @public
73
79
  */
74
80
  export declare function findChrome(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, exists?: (p: string) => boolean): string | null;
81
+ /**
82
+ * The OS window `start` opens: large enough for the viewport plus the
83
+ * browser's chrome, never smaller than 1280×900. `--width` / `--height`
84
+ * (deprecated) still win.
85
+ *
86
+ * @param viewport - The page size `start` emulates, or null for none.
87
+ * @param width - `--width`, when given.
88
+ * @param height - `--height`, when given.
89
+ * @returns The window size in pixels.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * windowSize({ width: 1920, height: 1080 }); // { width: 1936, height: 1200 }
94
+ * windowSize({ width: 390, height: 844 }); // { width: 1280, height: 964 }
95
+ * ```
96
+ *
97
+ * @public
98
+ */
99
+ export declare function windowSize(viewport: Size | null, width?: string, height?: string): Size;
75
100
  /**
76
101
  * Should `start` launch without a window? `--headless` wins, then
77
102
  * `IAMU_HEADLESS`, then CI or a Linux box with no `DISPLAY`.
@@ -114,7 +139,8 @@ export declare function shouldDisableSandbox(env?: NodeJS.ProcessEnv, uid?: numb
114
139
  * terminated only when its command line shows our `--user-data-dir`;
115
140
  * a PID the OS has since handed to another process is left alone.
116
141
  *
117
- * @param opts - `viewport`, `run`, `port`, `width`, `height`, `headless`, `json`.
142
+ * @param opts - `viewport`, `run`, `port`, `headless`, `json` (and the
143
+ * deprecated `width` / `height`, which override the derived window).
118
144
  * @param driver - Machine/browser seam; tests pass a fake.
119
145
  *
120
146
  * @example
@@ -177,7 +203,16 @@ export declare function detectAntiBotChallenge(page: Page, allowEvaluate?: boole
177
203
  */
178
204
  export declare function withPage(opts: BrowseOptions, driver: BrowserDriver, fn: (page: Page) => Promise<void>,
179
205
  /** What the action looks for, named for the error message. */
180
- target?: string): Promise<PageResult | null>;
206
+ target?: string,
207
+ /** Optional post-screenshot hook executed before detaching from CDP. */
208
+ onPostShot?: (page: Page) => Promise<void>): Promise<PageResult | null>;
209
+ /**
210
+ * Obtain an ARIA accessibility snapshot with fallback from body to :root,
211
+ * handling empty or about:blank pages gracefully.
212
+ *
213
+ * @public
214
+ */
215
+ export declare function resilientAriaSnapshot(page: Page): Promise<string>;
181
216
  /** What {@link clearOriginStorage} removed. */
182
217
  export interface ClearedStorage {
183
218
  origin: string;
@@ -194,6 +229,27 @@ export declare function clearOriginStorage(origin: string, driver?: BrowserDrive
194
229
  returnTo?: string): Promise<ClearedStorage | {
195
230
  error: string;
196
231
  }>;
232
+ /**
233
+ * Split a chained action string (e.g. `fill-index 22 "2026-11-20"`) into tokens,
234
+ * respecting single and double quotes.
235
+ *
236
+ * @public
237
+ */
238
+ export declare function parseActionCommand(raw: string): string[];
239
+ export interface ActionOptsOverride {
240
+ submit?: boolean;
241
+ nth?: string;
242
+ }
243
+ /**
244
+ * Extract `--submit` and `--nth <n>` flags from tokenized action arguments
245
+ * so inline flags are not treated as literal text arguments.
246
+ *
247
+ * @public
248
+ */
249
+ export declare function extractActionFlags(tokens: string[]): {
250
+ args: string[];
251
+ optsOverride: ActionOptsOverride;
252
+ };
197
253
  /**
198
254
  * `iamu browse <command> [args…]` — dispatch one browse subcommand.
199
255
  * Failures print to stderr and set exit code 1.
@@ -10,9 +10,9 @@ export interface CloudRunInfo {
10
10
  * Push one run to the cloud when the project is cloud-linked. Returns
11
11
  * `undefined` for a local-only project, so callers print nothing.
12
12
  *
13
- * Called by every command that changes what the run's cloud copy shows
14
- * (`complete`, `evaluate-record`): offering "Open in Iamu Cloud" after a
15
- * local-only write would open a stale report.
13
+ * Called by `complete`, which offers "Open in Iamu Cloud" afterwards: a
14
+ * local-only write there would open a stale report. The record stages
15
+ * after it stay local; `iamu sync` publishes their result.
16
16
  */
17
17
  export declare function pushRunToCloud(projectRoot: string, runId: string): Promise<CloudRunInfo | undefined>;
18
18
  /** Project dashboard URL, or `null` for a local-only project. */
@@ -13,6 +13,8 @@ export interface CompleteOptions {
13
13
  }
14
14
  /** Non-fatal observations made while completing, reported after assembly. */
15
15
  export interface CompletionExtras {
16
+ /** What the walk left out: no steps, no closing summary. Never fatal. */
17
+ walkWarnings: string[];
16
18
  revisit: RevisitReport | null;
17
19
  viewportWarning: string | null;
18
20
  codeWarning: string | null;
@@ -34,6 +36,17 @@ export declare function pickCompletedAt(manifest: Pick<WalkthroughManifest, "com
34
36
  export declare function completedManifest(manifest: WalkthroughManifest, completedAt: string): WalkthroughManifest;
35
37
  /** Persist the completed manifest to disk atomically. */
36
38
  export declare function persistManifest(manifestPath: string, manifest: WalkthroughManifest, completedAt: string): Promise<WalkthroughManifest>;
39
+ /**
40
+ * What a walk left out that `complete` assembles around anyway: no steps
41
+ * (an unblocked run then has no evidence) or no `summary.json` (no
42
+ * closing synthesis, no blocked or ended state). Warnings, not errors: a
43
+ * completion is still a completion.
44
+ */
45
+ export declare function walkGapWarnings(run: {
46
+ runId: string;
47
+ runDirPath: string;
48
+ manifest: Pick<WalkthroughManifest, "blocked">;
49
+ }, opts?: Pick<CompleteOptions, "force">): Promise<string[]>;
37
50
  /** `complete --json` output: the canonical plus whichever extras exist. */
38
51
  export declare function completeJsonPayload(canonical: CanonicalWalkthrough, extras: CompletionExtras): Record<string, unknown>;
39
52
  /** Non-fatal provenance warnings; prints nothing for a clean audit. */
@@ -99,6 +112,14 @@ type AssembledRunFiles = {
99
112
  * stages that re-derive them in parallel never interleave.
100
113
  */
101
114
  export declare function assembleRun(projectRoot: string, runId: string, manifest: WalkthroughManifest, completedAt: string): Promise<AssembledRunFiles>;
115
+ /**
116
+ * {@link assembleRun} for a caller that already holds the run's record
117
+ * lock (`withRunLock` is not re-entrant). The record stages take the lock
118
+ * around their finding writes and this re-derivation together, so another
119
+ * stage never reads half-written findings or overwrites the report with
120
+ * an older canonical.
121
+ */
122
+ export declare function assembleRunUnlocked(projectRoot: string, runId: string, manifest: WalkthroughManifest, completedAt: string): Promise<AssembledRunFiles>;
102
123
  /** One requested place, whether the run reached it, and what awaits there. */
103
124
  export type RevisitReportPlace = RevisitPlaceCoverage & {
104
125
  findings: Array<{
@@ -1,2 +1,4 @@
1
1
  import type { Command } from "commander";
2
+ /** Shells `iamu completion [shell]` writes a script for. */
3
+ export declare const SHELLS: readonly ["bash", "zsh", "fish"];
2
4
  export declare function completion(program: Command, shell?: string): void;
@@ -52,6 +52,7 @@ export declare function resolveRunId(projectRoot: string, explicitRunId?: string
52
52
  */
53
53
  export declare function reportFatalError(err: unknown, argv?: readonly string[]): void;
54
54
  export declare function resolveProject(opts?: {
55
+ cwd?: string;
55
56
  json?: boolean | string;
56
57
  }): Promise<ProjectContext | null>;
57
58
  /**
@@ -72,3 +73,21 @@ export declare function resolveCloudProject(opts?: {
72
73
  export declare function safeReadEntity<T extends object = Record<string, unknown>>(projectRoot: string, type: EntityType, slug: string, opts?: {
73
74
  json?: boolean | string;
74
75
  }): Promise<Awaited<ReturnType<typeof readEntity<T>>> | null>;
76
+ /**
77
+ * Refuse to record into a run that `iamu complete` already finished:
78
+ * canonical.json and report.md were derived from what was there, and a
79
+ * later step, finding or summary would leave them silently stale.
80
+ * `force` records anyway; the caller then re-derives with
81
+ * `iamu complete <run-id> --force`. A run without a readable manifest
82
+ * is not refused here (the writer reports what it needs).
83
+ *
84
+ * @returns true when the caller may write; false once the refusal has
85
+ * been reported (exit code 1).
86
+ */
87
+ export declare function refuseCompletedRun(runDirPath: string, runId: string, opts: {
88
+ json?: boolean;
89
+ force?: boolean;
90
+ }, report?: (message: string, diag: {
91
+ code: string;
92
+ fix: string;
93
+ }) => void): boolean;
@@ -0,0 +1,14 @@
1
+ export type PackageManager = "pnpm" | "npm" | "yarn" | "bun";
2
+ export interface DevScripts {
3
+ manager: PackageManager;
4
+ /** Scripts that look like they start the app, in preference order. */
5
+ scripts: string[];
6
+ }
7
+ /**
8
+ * The dev scripts `projectRoot`'s package.json declares. `null` without a
9
+ * readable package.json; an empty `scripts` list when it has none that
10
+ * start the app.
11
+ */
12
+ export declare function detectDevScripts(projectRoot: string): DevScripts | null;
13
+ /** The shell command that runs `script` with `manager`. */
14
+ export declare function devCommand(manager: PackageManager, script: string): string;
@@ -18,6 +18,12 @@ export interface DoctorResult {
18
18
  export declare function checkPortAvailable(port: number): Promise<boolean>;
19
19
  /** Check CDP responsiveness on a port */
20
20
  export declare function checkCdpResponsive(port: number): Promise<boolean>;
21
+ /**
22
+ * The testability status a target URL earns when a person sets it:
23
+ * `verified` when it answers the probe (any response short of a server
24
+ * error, an external auth redirect included), else `configured`.
25
+ */
26
+ export declare function probeTargetStatus(targetUrl: string): Promise<"verified" | "configured">;
21
27
  export declare function checkTargetHealth(targetUrl: string): Promise<DoctorCheck[]>;
22
28
  export declare function checkProjectHarnesses(projectRoot: string): Promise<DoctorCheck[]>;
23
29
  export declare function checkProjectTestabilityContract(projectRoot: string): Promise<{
@@ -1,8 +1,10 @@
1
1
  export interface EditEntityOptions {
2
2
  json?: boolean;
3
3
  }
4
+ /** Types `iamu edit <type>` opens: every entity plus project config. */
5
+ export declare const EDITABLE_TYPES: readonly ["persona", "capability", "outline", "scenario", "finding", "source", "guidance", "testability", "context"];
4
6
  /**
5
- * Open an entity in the user's $EDITOR or $VISUAL, and validate its frontmatter
6
- * against the entity schema on exit.
7
+ * Open an entity or project configuration file in the user's $EDITOR or $VISUAL,
8
+ * and validate its frontmatter against the schema on exit.
7
9
  */
8
- export declare function editEntity(type: string, slug: string, opts?: EditEntityOptions): Promise<void>;
10
+ export declare function editEntity(type: string, slug?: string, opts?: EditEntityOptions): Promise<void>;
@@ -23,17 +23,24 @@ export declare function applyVerdicts(canonical: CanonicalWalkthrough, recorded:
23
23
  * walkthrough for report markdown rendering.
24
24
  */
25
25
  export declare function applyRecordedVerdicts(canonical: CanonicalWalkthrough, runDirPath: string): Promise<CanonicalWalkthrough>;
26
- export declare function evaluate(runId: string, opts?: {
26
+ export interface EvaluateOptions {
27
+ run?: string;
27
28
  json?: boolean;
28
29
  promptFile?: string;
29
- }): Promise<void>;
30
+ }
31
+ export declare function evaluate(runIdArg?: string, opts?: EvaluateOptions): Promise<void>;
30
32
  export interface EvaluateRecordOptions {
33
+ run?: string;
31
34
  file?: string;
32
35
  data?: string;
33
36
  json?: boolean;
37
+ /** @deprecated No-op since evaluate-record stopped prompting (removed in 0.9.0). */
34
38
  yes?: boolean;
39
+ /** @deprecated No-op since evaluate-record stopped prompting (removed in 0.9.0). */
35
40
  prompt?: boolean;
41
+ /** @deprecated No-op since evaluate-record stopped prompting (removed in 0.9.0). */
36
42
  view?: boolean;
43
+ /** @deprecated No-op since evaluate-record stopped pushing (removed in 0.9.0). */
37
44
  push?: boolean;
38
45
  }
39
- export declare function evaluateRecord(runId: string, opts: EvaluateRecordOptions): Promise<void>;
46
+ export declare function evaluateRecord(runIdArg: string | undefined, opts: EvaluateRecordOptions): Promise<void>;
@@ -46,6 +46,7 @@ interface HistoryFinding {
46
46
  scenario?: string;
47
47
  canonical_id?: string;
48
48
  triage_status?: string;
49
+ addressed_at?: string | null;
49
50
  updated_at?: string;
50
51
  created_at?: string;
51
52
  source?: string;
@@ -1,7 +1,16 @@
1
1
  export declare function findings(opts?: {
2
2
  open?: boolean;
3
+ /** Fix applied (`triage_status: addressed`), whatever its fix state. */
4
+ addressed?: boolean;
5
+ /** Hidden alias of `addressed`, kept for one release. */
3
6
  resolved?: boolean;
4
7
  dismissed?: boolean;
8
+ deferred?: boolean;
9
+ status?: string;
10
+ /** Only findings an active tester guidance rule flagged. */
11
+ flagged?: boolean;
12
+ /** Only addressed findings in this fix state. */
13
+ fixState?: string;
5
14
  scenario?: string;
6
15
  /** Only the persona's, or only the designer's. Default: both. */
7
16
  source?: string;
@@ -1,25 +1,34 @@
1
+ import { type TestabilityStatus } from "@iamu-dev/protocol";
1
2
  import type { HostAdapter } from "../adapters/types.js";
2
3
  /**
3
4
  * The setup skill as the user will see it. With the Iamu plugin enabled,
4
- * Claude Code has `/iamu:init` and no `iamu-setup`.
5
+ * Claude Code has `/iamu:init` and no `iamu-setup` (see `skillCommand`).
5
6
  */
6
7
  export declare function setupCommand(projectRoot: string, hosts: HostAdapter[]): string;
8
+ /**
9
+ * The "start your dev server" line of the init summary: the project's own
10
+ * dev script under its package manager, the recorded `dev_command`, or
11
+ * an honest "none found" — never a guessed `pnpm dev`.
12
+ */
13
+ export declare function devServerHint(projectRoot: string, devCommandRecorded?: string | null): string;
7
14
  /**
8
15
  * Detect the target port for local dev execution.
9
16
  * Checks, in order:
10
17
  * 1. process.env.PORT
11
- * 2. .env files (.env.local, .env.development, .env) for PORT, VITE_PORT, APP_URL, NEXT_PUBLIC_APP_URL
12
- * 3. package.json scripts for `-p <port>` or `--port <port>` flags
13
- * 4. package.json dependencies and framework config files (vite -> 5173, astro -> 4321)
18
+ * 2. Root .env files, vite/astro config `port:`, package.json scripts/deps
19
+ * 3. Monorepo workspace subdirectories (apps/*, packages/*, web, frontend, client)
14
20
  */
15
21
  export declare function detectTargetPort(projectRoot: string): number | undefined;
16
22
  export declare function detectTargetUrl(projectRoot: string): string;
17
- export declare function createDraftTestabilityContent(targetUrl?: string): string;
23
+ /** The target line of the init summary, by testability status. */
24
+ export declare function describeTargetStatus(status: TestabilityStatus): string;
25
+ export declare function createDraftTestabilityContent(targetUrl?: string, status?: TestabilityStatus): string;
18
26
  export interface InitOptions {
19
27
  name?: string;
20
28
  yes?: boolean;
21
29
  json?: boolean;
22
30
  cloud?: boolean;
31
+ target?: string;
23
32
  }
24
33
  /**
25
34
  * Scaffold `iamu/` and install skills for the detected hosts.
@@ -1,5 +1,11 @@
1
1
  import { type GuidanceRule, type RevisitPlace } from "@iamu-dev/local-store";
2
2
  import { type RunViewport, type ScenarioState } from "@iamu-dev/protocol";
3
+ /**
4
+ * How to invoke this very CLI from a subagent's shell. Aliases and
5
+ * shell functions do not exist there, so name the executable that is
6
+ * running now.
7
+ */
8
+ export declare function selfCommand(execPath?: string, scriptPath?: string): string;
3
9
  /** "The browser is sized as a phone screen, 390×844." */
4
10
  export declare function viewportLine(v: RunViewport): string;
5
11
  interface WalkerPromptParts {
@@ -9,6 +15,8 @@ interface WalkerPromptParts {
9
15
  role: string;
10
16
  disposition: string | null;
11
17
  background: string | null;
18
+ /** The persona's `## Today` section: how they do the job today. */
19
+ today?: string | null;
12
20
  };
13
21
  outline: {
14
22
  title: string;
@@ -12,18 +12,9 @@ export declare function instructionsStage(slug?: string, opts?: {
12
12
  json?: boolean;
13
13
  }): Promise<void>;
14
14
  /**
15
- * Generates dynamic setup instructions for the project.
15
+ * Phases `iamu instructions [phase]` serves (`run` is an alias of `walk`).
16
16
  */
17
- export declare function instructionsSetup(opts?: {
18
- json?: boolean;
19
- }): Promise<void>;
20
- /**
21
- * Generates dynamic triage instructions for reviewing run findings.
22
- */
23
- export declare function instructionsTriage(slug?: string, opts?: {
24
- run?: string;
25
- json?: boolean;
26
- }): Promise<void>;
17
+ export declare const INSTRUCTION_PHASES: string[];
27
18
  /**
28
19
  * Top-level dispatcher for `iamu instructions [phase] [slug]`.
29
20
  */
@@ -1,3 +1,6 @@
1
+ import { type EntityType } from "@iamu-dev/protocol";
2
+ /** `iamu list <type>` accepts each type by name or by these plurals. */
3
+ export declare const PLURAL_LABELS: Record<EntityType, string>;
1
4
  export declare function list(type: string | undefined, opts: {
2
5
  capability?: string;
3
6
  diff?: string | boolean;
@@ -3,18 +3,21 @@ import { type WalkthroughManifest } from "@iamu-dev/local-store";
3
3
  export declare function completedManifest(runDirPath: string, runId: string, opts?: {
4
4
  json?: boolean;
5
5
  }): Promise<WalkthroughManifest | null>;
6
+ export interface MatchOptions {
7
+ run?: string;
8
+ json?: boolean;
9
+ promptFile?: string;
10
+ }
6
11
  /**
7
12
  * Print the matcher's input bundle: this run's findings, the scenario's
8
13
  * earlier canonical findings, this run's steps, and the prompt.
9
14
  */
10
- export declare function match(runId: string, opts?: {
11
- json?: boolean;
12
- promptFile?: string;
13
- }): Promise<void>;
15
+ export declare function match(runIdArg?: string, opts?: MatchOptions): Promise<void>;
14
16
  export interface MatchRecordOptions {
17
+ run?: string;
15
18
  file?: string;
16
19
  data?: string;
17
20
  json?: boolean;
18
21
  }
19
22
  /** Record the matcher's answer and re-derive the run's delta and report. */
20
- export declare function matchRecord(runId: string, opts: MatchRecordOptions): Promise<void>;
23
+ export declare function matchRecord(runIdArg: string | undefined, opts: MatchRecordOptions): Promise<void>;
@@ -31,4 +31,6 @@ export interface NewEntityOptions {
31
31
  stateApproximation?: string;
32
32
  json?: boolean;
33
33
  }
34
+ /** Entity types `iamu new <type>` creates (findings: `iamu new-finding`). */
35
+ export declare const SUPPORTED_TYPES: readonly ["persona", "outline", "capability", "source", "scenario"];
34
36
  export declare function newEntity(type: string, opts: NewEntityOptions): Promise<void>;
@@ -22,6 +22,8 @@ export interface NewFindingOptions {
22
22
  recommendation?: string;
23
23
  /** Complete markdown body (overrides description and recommendation). */
24
24
  body?: string;
25
+ /** Record into a run that is already completed. */
26
+ force?: boolean;
25
27
  json?: boolean;
26
28
  }
27
29
  export declare function newFinding(opts: NewFindingOptions): Promise<void>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A persona's baseline: the `## Today` section of the persona body, how
3
+ * this person does the job today (a paper sheet, a spreadsheet, phone
4
+ * calls, another tool). The walker compares the product against it and
5
+ * the judge weighs voluntary use against it. A body heading, not a
6
+ * frontmatter field, so no schema changes.
7
+ */
8
+ /**
9
+ * Split a persona body into its `## Today` section and the rest. The
10
+ * section runs to the next heading of level one or two, or the end.
11
+ * `today` is null when there is no such section or it is empty.
12
+ *
13
+ * @example
14
+ * splitPersonaToday("Fixes taps.\n\n## Today\nA paper job sheet.")
15
+ * // → { today: "A paper job sheet.", rest: "Fixes taps." }
16
+ */
17
+ export declare function splitPersonaToday(body: string): {
18
+ today: string | null;
19
+ rest: string;
20
+ };
@@ -10,14 +10,16 @@ export interface PreflightCheckResult {
10
10
  reason?: string;
11
11
  }
12
12
  /**
13
- * Detect the fast compile/typecheck/lint command for a target project.
13
+ * Detect the fast compile/typecheck command for a target project.
14
+ * Deliberately excludes lint scripts (`check`, `eslint`, `biome check`) so
15
+ * lint rules never block walkthrough execution.
14
16
  */
15
17
  export declare function detectPreflightCommand(targetDir: string): Promise<{
16
18
  command: string;
17
19
  args: string[];
18
20
  } | null>;
19
21
  /**
20
- * Executes a fast preflight type/lint check.
22
+ * Executes a fast preflight typecheck.
21
23
  */
22
24
  export declare function runPreflightCheck(targetDir: string): Promise<PreflightCheckResult>;
23
25
  /**
@@ -1,4 +1,4 @@
1
- export declare function pull(opts?: {
1
+ export declare function pull(refs?: string[], opts?: {
2
2
  force?: boolean;
3
3
  preview?: boolean;
4
4
  json?: boolean;