@iamu-dev/iamu 0.3.0-beta.6 → 0.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,119 @@
1
+ import { type CheckOutcome, type RunChecks } from "@iamu-dev/local-store";
2
+ export interface HtmlReportHighlight {
3
+ targetBox: {
4
+ x: number;
5
+ y: number;
6
+ width: number;
7
+ height: number;
8
+ viewportWidth?: number;
9
+ viewportHeight?: number;
10
+ viewport_width?: number;
11
+ viewport_height?: number;
12
+ };
13
+ label?: string;
14
+ severity?: string | null;
15
+ type?: string;
16
+ }
17
+ export interface HtmlReportStep {
18
+ stepNumber: number;
19
+ action: string;
20
+ screenTitle?: string | null;
21
+ personaReasoning?: string | null;
22
+ url?: string | null;
23
+ screenshotUrl?: string | null;
24
+ targetBox?: {
25
+ x: number;
26
+ y: number;
27
+ width: number;
28
+ height: number;
29
+ viewportWidth?: number;
30
+ viewportHeight?: number;
31
+ viewport_width?: number;
32
+ viewport_height?: number;
33
+ } | null;
34
+ highlights?: HtmlReportHighlight[];
35
+ }
36
+ export interface HtmlReportFinding {
37
+ id: string;
38
+ title: string;
39
+ type: string;
40
+ severity?: string | null;
41
+ uiFact?: string | null;
42
+ consequence?: string | null;
43
+ recommendation?: string | null;
44
+ /** "/request · step 8" */
45
+ where?: string | null;
46
+ isNew?: boolean;
47
+ persists?: boolean;
48
+ }
49
+ export interface HtmlReportVerdict {
50
+ question: string;
51
+ rating: string;
52
+ reasoning?: string;
53
+ }
54
+ export interface HtmlReportSinceItem {
55
+ title: string;
56
+ note?: string;
57
+ step_ids?: string[];
58
+ fixed_before?: boolean;
59
+ severity_before?: string;
60
+ severity_now?: string;
61
+ }
62
+ export interface HtmlReportVerification {
63
+ resolved: HtmlReportSinceItem[];
64
+ persists: HtmlReportSinceItem[];
65
+ notObserved?: HtmlReportSinceItem[];
66
+ newFindings: Array<{
67
+ type?: string;
68
+ }>;
69
+ }
70
+ export interface HtmlReportData {
71
+ scenarioName: string;
72
+ scenarioNarrative?: string | null;
73
+ persona?: {
74
+ name: string;
75
+ role?: string | null;
76
+ context?: string | null;
77
+ } | null;
78
+ walkthroughId: string;
79
+ runNumber?: number | string | null;
80
+ startedAt?: string | null | Date;
81
+ completedAt?: string | null | Date;
82
+ targetUrl?: string | null;
83
+ steps: HtmlReportStep[];
84
+ findings: HtmlReportFinding[];
85
+ verdicts?: HtmlReportVerdict[];
86
+ /** The run's answer to "would they come back", with one label for all tests. */
87
+ overall?: {
88
+ question: string;
89
+ label: string;
90
+ answer: string | null;
91
+ reasoning: string | null;
92
+ } | null;
93
+ verification?: HtmlReportVerification | null;
94
+ whatWorked?: string[];
95
+ openQuestions?: string[];
96
+ /** The walker's doubts about the test setup. */
97
+ setupNotes?: string[];
98
+ /** What a re-run was sent to check, with this run's outcome for each fix. */
99
+ checks?: {
100
+ fixes: Array<RunChecks["fixes"][number] & {
101
+ outcome: CheckOutcome;
102
+ }>;
103
+ directions: string[];
104
+ } | null;
105
+ }
106
+ export declare function generateHtmlReport(data: HtmlReportData): string;
107
+ /**
108
+ * Builds HtmlReportData by reading a completed run directory and resolving
109
+ * persona/scenario files and local screenshots into base64 data URIs.
110
+ */
111
+ export declare function buildReportDataFromRun(projectRoot: string, runId: string): Promise<HtmlReportData>;
112
+ /**
113
+ * Creates and writes a self-contained local HTML report for a walkthrough run.
114
+ * Defaults to writing to `iamu/.runs/<runId>/report.html`.
115
+ */
116
+ export declare function createLocalHtmlReport(projectRoot: string, runId: string, destination?: string): Promise<{
117
+ filePath: string;
118
+ html: string;
119
+ }>;
@@ -0,0 +1,116 @@
1
+ export type VerdictLabel = "YES" | "PARTIAL" | "NO" | "PENDING" | "BLOCKED";
2
+ export interface RunFindingRow {
3
+ id: string;
4
+ /** Finding file slug, for `iamu triage <slug>`; null when the file is gone. */
5
+ slug: string | null;
6
+ severity: string | null;
7
+ type: string;
8
+ title: string;
9
+ where: string | null;
10
+ /** The advisor's recommendation, when the run was advised. */
11
+ recommendation: string | null;
12
+ persists: boolean;
13
+ isNew: boolean;
14
+ }
15
+ export type SinceOutcome = "resolved" | "persists" | "not_seen" | "uncertain";
16
+ export interface RunView {
17
+ persona: string;
18
+ situation: string;
19
+ completedAt: string | null;
20
+ steps: number;
21
+ targetUrl: string | null;
22
+ /** Cloud link, or a note that the run is not synced; null when not linked. */
23
+ cloud: string | null;
24
+ verdict: {
25
+ label: VerdictLabel;
26
+ question: string | null;
27
+ answer: string | null;
28
+ };
29
+ tests: Array<{
30
+ question: string;
31
+ label: VerdictLabel;
32
+ }>;
33
+ since: {
34
+ baselineAt: string | null;
35
+ resolved: number;
36
+ persists: number;
37
+ added: number;
38
+ notSeen: number;
39
+ /** Each earlier finding this run re-checked, by title. */
40
+ items: Array<{
41
+ title: string;
42
+ outcome: SinceOutcome;
43
+ /** Why the matcher judged it so. */
44
+ note: string | null;
45
+ /** Marked addressed before this run: persisting means the fix did not hold. */
46
+ fixedBefore: boolean;
47
+ /** Persists only: "less severe, major → minor" or "worse, …", else "". */
48
+ shift: string;
49
+ }>;
50
+ } | null;
51
+ findings: RunFindingRow[];
52
+ strengths: string[];
53
+ directions: Array<{
54
+ title: string;
55
+ size: string;
56
+ absorbs: number;
57
+ verify: number;
58
+ }>;
59
+ observations: Array<{
60
+ kind: string;
61
+ title: string;
62
+ }>;
63
+ /** The fixes this run re-checked: how many, confirmed fixed, and came back. */
64
+ checks: {
65
+ fixes: number;
66
+ fixed: number;
67
+ cameBack: number;
68
+ directions: string[];
69
+ } | null;
70
+ /** The walker's doubts about the test setup. */
71
+ setupNotes: string[];
72
+ }
73
+ export interface OverviewRun {
74
+ completedAt: string | null;
75
+ label: VerdictLabel;
76
+ problems: number;
77
+ /** Problems by severity: critical, major, minor (minor includes observations). */
78
+ bySeverity: {
79
+ critical: number;
80
+ major: number;
81
+ minor: number;
82
+ };
83
+ resolved: number;
84
+ persists: number;
85
+ added: number;
86
+ }
87
+ export interface OverviewScenario {
88
+ persona: string;
89
+ situation: string;
90
+ slug: string;
91
+ runs: OverviewRun[];
92
+ latestAnswer: string | null;
93
+ }
94
+ export interface OverviewView {
95
+ project: string;
96
+ scenarios: OverviewScenario[];
97
+ openProblems: number;
98
+ directions: Array<{
99
+ title: string;
100
+ status: string;
101
+ size: string;
102
+ absorbs: number;
103
+ }>;
104
+ }
105
+ export declare function verdictColor(label: VerdictLabel): (s: string) => string;
106
+ /** "9 Oct 07:54" in local time; the raw value when it does not parse. */
107
+ export declare function shortDate(iso: string | null): string;
108
+ /** Word-wrap plain text to `width`, each line prefixed with `indent`. */
109
+ export declare function wrap(text: string, width: number, indent: string): string[];
110
+ export declare function firstSentence(text: string): string;
111
+ /** Opening sentences of a text, enough to say something (≥ 60 chars). */
112
+ export declare function lead(text: string): string;
113
+ /** The latest run of one scenario, outcome first. */
114
+ export declare function renderRunView(v: RunView, width?: number): string[];
115
+ /** Every scenario and how its runs went, newest scenario first. */
116
+ export declare function renderOverview(v: OverviewView, width?: number): string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamu-dev/iamu",
3
- "version": "0.3.0-beta.6",
3
+ "version": "0.4.0-beta.1",
4
4
  "type": "module",
5
5
  "description": "Test your product as realistic personas — scenario-driven development CLI",
6
6
  "license": "UNLICENSED",
@@ -58,9 +58,9 @@
58
58
  "tsup": "^8.5.1",
59
59
  "typescript": "^5.8.0",
60
60
  "vitest": "^4.1.11",
61
+ "@iamu-dev/local-store": "0.1.0",
61
62
  "@iamu-dev/protocol": "0.1.0",
62
- "@iamu/tsconfig": "0.1.0",
63
- "@iamu-dev/local-store": "0.1.0"
63
+ "@iamu/tsconfig": "0.1.0"
64
64
  },
65
65
  "scripts": {
66
66
  "build": "tsup && tsc -b --force tsconfig.build.json --emitDeclarationOnly && node scripts/copy-assets.mjs",