@iamu-dev/iamu 0.5.0-beta.0 → 0.6.0-beta.0

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.
@@ -1,5 +1,5 @@
1
1
  /** Stamped into `advised_by` and `advice.json`. Bump when advise.md changes meaningfully. */
2
- export declare const ADVISOR_VERSION = "1.3.0";
2
+ 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 {
@@ -80,13 +80,7 @@ export declare function validateCanonicalWalkthrough(canonical: unknown): Canoni
80
80
  export declare function persistCanonical(runDirPath: string, canonical: CanonicalWalkthrough): Promise<string>;
81
81
  /** Persist report.md to disk atomically. */
82
82
  export declare function persistReport(runDirPath: string, canonical: CanonicalWalkthrough): Promise<string>;
83
- /**
84
- * Build canonical.json (with the verification delta) and report.md for a
85
- * run. The report keeps any verdicts already recorded by
86
- * `evaluate-record`, so re-assembling after the judge (`--force`,
87
- * `match-record`) does not drop them.
88
- */
89
- export declare function assembleRun(projectRoot: string, runId: string, manifest: WalkthroughManifest, completedAt: string): Promise<{
83
+ type AssembledRunFiles = {
90
84
  canonical: CanonicalWalkthrough;
91
85
  verification: VerificationSummary | null;
92
86
  journeyDiff: JourneyDiff | null;
@@ -96,7 +90,15 @@ export declare function assembleRun(projectRoot: string, runId: string, manifest
96
90
  canonicalPath: string;
97
91
  reportPath: string;
98
92
  htmlReportPath?: string;
99
- }>;
93
+ };
94
+ /**
95
+ * Build canonical.json (with the verification delta) and report.md for a
96
+ * run. The report keeps any verdicts already recorded by
97
+ * `evaluate-record`, so re-assembling after the judge (`--force`,
98
+ * `match-record`) does not drop them. It holds the run's record lock so
99
+ * stages that re-derive them in parallel never interleave.
100
+ */
101
+ export declare function assembleRun(projectRoot: string, runId: string, manifest: WalkthroughManifest, completedAt: string): Promise<AssembledRunFiles>;
100
102
  /** One requested place, whether the run reached it, and what awaits there. */
101
103
  export type RevisitReportPlace = RevisitPlaceCoverage & {
102
104
  findings: Array<{
@@ -126,3 +128,4 @@ export declare function printRevisit(r: RevisitReport): void;
126
128
  * — so the heading says what it compares with.
127
129
  */
128
130
  export declare function printVerification(verification: VerificationSummary): void;
131
+ export {};
@@ -0,0 +1,5 @@
1
+ import { type DesignOptions } from "./design-output.js";
2
+ /** Write the match prompt and refs for a page's latest review. */
3
+ export declare function designReviewMatch(target: string, opts: DesignOptions): Promise<void>;
4
+ /** Record a match answer for a page's latest review. */
5
+ export declare function designReviewMatchRecord(target: string, opts: DesignOptions): Promise<void>;
@@ -0,0 +1,5 @@
1
+ import { type DesignOptions } from "./design-output.js";
2
+ /** List proposed edits to the design docs. */
3
+ export declare function designProposals(opts: DesignOptions): Promise<void>;
4
+ /** Accept (apply the exact Before → After to its doc) or reject a proposal. */
5
+ export declare function designDecide(slug: string, decision: "accepted" | "rejected", opts: DesignOptions): Promise<void>;
@@ -0,0 +1,19 @@
1
+ import { type DesignOptions } from "./design-output.js";
2
+ /** Which design files are recorded, open proposals, and the rules cited. */
3
+ export declare function designStatus(opts: DesignOptions): Promise<void>;
4
+ /** Find design material; with --record, record every candidate. */
5
+ export declare function designDetect(opts: DesignOptions): Promise<void>;
6
+ /**
7
+ * Record these files (or `file#heading` sections) as design docs: kind
8
+ * from --kind, else as detected, else `design`; --applies-to limits them
9
+ * to URL path prefixes or app directories; --remove stops recording them.
10
+ */
11
+ export declare function designSources(paths: string[], opts: DesignOptions): Promise<void>;
12
+ /**
13
+ * Migrate a legacy `iamu/design.md` once: print the plan, or with --apply
14
+ * write `sources.json` (ids frozen, `migrated_at` set) and, with
15
+ * --move-to, the plain doc in place of `iamu/design.md`.
16
+ */
17
+ export declare function designMigrate(opts: DesignOptions): Promise<void>;
18
+ /** Add (once) a pointer to the design docs in an agent instructions file. */
19
+ export declare function designLinkAgents(opts: DesignOptions): Promise<void>;
@@ -0,0 +1,33 @@
1
+ import { type CommandDiagnosticOptions } from "./context.js";
2
+ export interface DesignOptions {
3
+ /** migrate: write the plan instead of printing it. */
4
+ apply?: boolean;
5
+ /** migrate: move the legacy doc to this file. */
6
+ moveTo?: string;
7
+ /** link-agents: rewrite an existing block with the current wording. */
8
+ refresh?: boolean;
9
+ json?: boolean;
10
+ record?: boolean;
11
+ kind?: string;
12
+ /** sources: URL path prefixes or app directories, comma-separated. */
13
+ appliesTo?: string;
14
+ /** sources: entries to stop recording. */
15
+ remove?: boolean;
16
+ /** proposals: list decided ones too. */
17
+ all?: boolean;
18
+ file?: string;
19
+ data?: string;
20
+ promptFile?: string;
21
+ /**
22
+ * review: a check — the reviewer is not shown the previous review or
23
+ * the designer's earlier notes, so it cannot just confirm them.
24
+ */
25
+ blind?: boolean;
26
+ }
27
+ /** JSON with --json, else the human output. */
28
+ export declare const out: (opts: DesignOptions, value: unknown, human: () => void) => void;
29
+ export declare const plural: (n: number, word: string) => string;
30
+ /** A command error that also shows its fix hint in text mode. */
31
+ export declare function designError(message: string, opts: CommandDiagnosticOptions & {
32
+ fix?: string;
33
+ }): void;
@@ -0,0 +1,4 @@
1
+ import { type PROMPT_FILES } from "../templates.js";
2
+ export type PromptFile = (typeof PROMPT_FILES)[number];
3
+ /** Prompt = method (installed template), product principles, bundle. */
4
+ export declare function composeDesignPrompt(projectRoot: string, name: PromptFile, bundle: unknown): string;
@@ -1,29 +1,14 @@
1
- export interface DesignOptions {
2
- json?: boolean;
3
- record?: boolean;
4
- kind?: string;
5
- file?: string;
6
- data?: string;
7
- answers?: string;
8
- promptFile?: string;
9
- }
10
- /** What design material the project has, and the state of its rules. */
11
- export declare function designStatus(opts: DesignOptions): Promise<void>;
12
- /** Find design material; with --record, record every candidate as a source. */
13
- export declare function designDetect(opts: DesignOptions): Promise<void>;
14
- /** Record exactly these sources (kind from detection, else --kind, else rules). */
15
- export declare function designSources(paths: string[], opts: DesignOptions): Promise<void>;
16
- /** Write the drafting prompt: intent, people, what the code establishes. */
17
- export declare function designDraft(opts: DesignOptions): Promise<void>;
18
- /** Record a drafted or edited design doc (Markdown). */
19
- export declare function designRecord(opts: DesignOptions): Promise<void>;
1
+ import { type DesignOptions } from "./design-output.js";
2
+ export type { DesignOptions } from "./design-output.js";
3
+ export { designDetect, designLinkAgents, designMigrate, designSources, designStatus, } from "./design-docs.js";
4
+ export { designDecide, designProposals } from "./design-decide.js";
5
+ /** The project, the resolved surface, and where its review files go. */
6
+ export declare function surfaceContext(target: string, opts: DesignOptions): Promise<{
7
+ ctx: import("./context.js").ProjectContext;
8
+ surface: import("@iamu-dev/local-store").SurfaceTarget;
9
+ dir: string;
10
+ } | null>;
20
11
  /** Write the review prompt for one surface: its dossier and the method. */
21
12
  export declare function designReview(target: string, opts: DesignOptions): Promise<void>;
22
13
  /** Record a design review answer (JSON) for one surface. */
23
14
  export declare function designReviewRecord(target: string, opts: DesignOptions): Promise<void>;
24
- /** List proposed edits to the design rules, open first. */
25
- export declare function designProposals(opts: DesignOptions): Promise<void>;
26
- /** Accept (apply to the doc) or reject a proposal. */
27
- export declare function designDecide(slug: string, decision: "accepted" | "rejected", opts: DesignOptions): Promise<void>;
28
- /** Add (once) a pointer to the design rules in an agent instructions file. */
29
- export declare function designLinkAgents(opts: DesignOptions): Promise<void>;
@@ -0,0 +1,25 @@
1
+ export interface DesignerOptions {
2
+ json?: boolean;
3
+ }
4
+ /** Where the judge's answer goes, beside its prompt. */
5
+ export declare const DESIGNER_ANSWER_FILE = "designer_answer.json";
6
+ /** Write the designer's prompt and refs for a run, and say what it holds. */
7
+ export declare function designer(runId: string, opts?: DesignerOptions): Promise<void>;
8
+ export interface DesignerRecordOptions {
9
+ file?: string;
10
+ data?: string;
11
+ /** The orchestrator answered the prompt itself: weaker independence. */
12
+ byOrchestrator?: boolean;
13
+ /** Older name for `byOrchestrator`. */
14
+ inline?: boolean;
15
+ /** Record that the pass did not run, and why. */
16
+ skipped?: string;
17
+ json?: boolean;
18
+ }
19
+ /** Record the designer's answer, then re-derive canonical.json and report.md. */
20
+ export declare function designerRecord(runId: string, opts?: DesignerRecordOptions): Promise<void>;
21
+ /** Dismiss one designer finding: later reviews are told not to raise it again. */
22
+ export declare function designerDismiss(runId: string, issueId: string, opts?: {
23
+ reason?: string;
24
+ json?: boolean;
25
+ }): Promise<void>;
@@ -3,5 +3,7 @@ export declare function findings(opts?: {
3
3
  resolved?: boolean;
4
4
  dismissed?: boolean;
5
5
  scenario?: string;
6
+ /** Only the persona's, or only the designer's. Default: both. */
7
+ source?: string;
6
8
  json?: boolean | string;
7
9
  }): Promise<void>;
@@ -1,3 +1,9 @@
1
+ import { type DesignerFixBrief, type FixBrief } from "@iamu-dev/local-store";
1
2
  export declare function fixBrief(ref: string, opts: {
2
3
  json?: boolean;
3
4
  }): Promise<void>;
5
+ /**
6
+ * A loop step as a person reads it: each backticked field name becomes
7
+ * the section above that holds it, or its value.
8
+ */
9
+ export declare function readable(step: string, b: Pick<FixBrief | DesignerFixBrief, "rerun" | "closing_check">): string;
@@ -1,4 +1,4 @@
1
- import type { RunStep } from "@iamu-dev/protocol";
1
+ import { type FindingSeverity, type RunStep } from "@iamu-dev/protocol";
2
2
  /** Timeout for run registration on start-run (3 seconds). */
3
3
  export declare const REGISTER_TIMEOUT_MS = 3000;
4
4
  /** Timeout for per-step and phase event dispatches (1.5 seconds). */
@@ -54,7 +54,7 @@ export interface LiveFindingEvent {
54
54
  id: string;
55
55
  title: string;
56
56
  type: "helps" | "hinders" | "missing" | "irrelevant" | "incorrect";
57
- severity: "critical" | "major" | "minor" | "observation";
57
+ severity: FindingSeverity | "observation";
58
58
  ui_fact?: string | null;
59
59
  consequence?: string | null;
60
60
  step_number?: number | null;
@@ -114,7 +114,7 @@ export declare function sendLiveFinding(projectRoot: string, runId: string, find
114
114
  id: string;
115
115
  title: string;
116
116
  type: "helps" | "hinders" | "missing" | "irrelevant" | "incorrect";
117
- severity: "critical" | "major" | "minor" | "observation";
117
+ severity: FindingSeverity;
118
118
  ui_fact?: string | null;
119
119
  consequence?: string | null;
120
120
  step_number?: number | null;
@@ -1,5 +1,6 @@
1
1
  import type { Command } from "commander";
2
2
  /**
3
- * Registers `design` (rules, reviews, proposals) and `fix-brief`.
3
+ * Registers `design` (the project's design docs, reviews, proposals) and
4
+ * `fix-brief`.
4
5
  */
5
6
  export declare function registerDesignCommands(program: Command): void;
@@ -1,5 +1,5 @@
1
- import type { Command } from "commander";
1
+ import { type Command } from "commander";
2
2
  /**
3
- * Registers walkthrough execution commands: start-run, instructions, browse, step, new-finding, complete, match, match-record, advise, advise-record, directions, evaluate, evaluate-record, prune.
3
+ * Registers walkthrough execution commands: start-run, instructions, browse, step, new-finding, complete, match, match-record, advise, advise-record, designer, designer-record, designer-dismiss, directions, evaluate, evaluate-record, prune.
4
4
  */
5
5
  export declare function registerWalkthroughCommands(program: Command): void;
@@ -7,6 +7,10 @@ export interface SummaryOptions {
7
7
  model?: string;
8
8
  /** The walk could not start as set up: what was missing, or `false` to clear. */
9
9
  blocked?: string | false;
10
+ /** The walk reached what the persona came to do: the last thing they did. */
11
+ reached?: string;
12
+ /** The walk stopped before that: why. */
13
+ stopped?: string;
10
14
  file?: string;
11
15
  json?: boolean;
12
16
  }
@@ -20,5 +24,11 @@ export interface SummaryData {
20
24
  blocked?: {
21
25
  reason: string;
22
26
  };
27
+ /** How the walk ended: reached the goal, or stopped and why. */
28
+ ended?: WalkEnded;
29
+ }
30
+ export interface WalkEnded {
31
+ reached: boolean;
32
+ note: string;
23
33
  }
24
34
  export declare function summaryCommand(runIdArg: string | undefined, opts: SummaryOptions): Promise<void>;