@iamu-dev/iamu 0.2.0-beta.1 → 0.2.0-beta.3

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 (67) hide show
  1. package/dist/bin.js +29 -8
  2. package/dist/index.js +29 -8
  3. package/dist/templates/skills/iamu-setup.md +40 -33
  4. package/package.json +2 -2
  5. package/dist/adapters/claude-plugin.d.ts +0 -13
  6. package/dist/adapters/registry.d.ts +0 -6
  7. package/dist/adapters/types.d.ts +0 -19
  8. package/dist/bin.d.ts +0 -2
  9. package/dist/build-info.d.ts +0 -53
  10. package/dist/cloud-url.d.ts +0 -19
  11. package/dist/commands/auth-http.d.ts +0 -37
  12. package/dist/commands/auth-project-choice.d.ts +0 -74
  13. package/dist/commands/auth-token-input.d.ts +0 -21
  14. package/dist/commands/auth.d.ts +0 -84
  15. package/dist/commands/browse-actions.d.ts +0 -56
  16. package/dist/commands/browse-driver.d.ts +0 -117
  17. package/dist/commands/browse.d.ts +0 -156
  18. package/dist/commands/cloud-push.d.ts +0 -27
  19. package/dist/commands/complete.d.ts +0 -131
  20. package/dist/commands/completion.d.ts +0 -2
  21. package/dist/commands/context.d.ts +0 -58
  22. package/dist/commands/credentials.d.ts +0 -144
  23. package/dist/commands/diff-filter.d.ts +0 -11
  24. package/dist/commands/doctor.d.ts +0 -24
  25. package/dist/commands/evaluate.d.ts +0 -30
  26. package/dist/commands/findings.d.ts +0 -7
  27. package/dist/commands/init.d.ts +0 -9
  28. package/dist/commands/instructions-walk.d.ts +0 -59
  29. package/dist/commands/list.d.ts +0 -5
  30. package/dist/commands/match.d.ts +0 -12
  31. package/dist/commands/mcp-config.d.ts +0 -10
  32. package/dist/commands/new-entity.d.ts +0 -15
  33. package/dist/commands/new-finding.d.ts +0 -19
  34. package/dist/commands/open.d.ts +0 -8
  35. package/dist/commands/port.d.ts +0 -17
  36. package/dist/commands/prune.d.ts +0 -11
  37. package/dist/commands/pull.d.ts +0 -5
  38. package/dist/commands/register-cloud.d.ts +0 -5
  39. package/dist/commands/register-findings.d.ts +0 -5
  40. package/dist/commands/register-project.d.ts +0 -5
  41. package/dist/commands/register-walkthrough.d.ts +0 -5
  42. package/dist/commands/register.d.ts +0 -10
  43. package/dist/commands/report.d.ts +0 -3
  44. package/dist/commands/serve.d.ts +0 -11
  45. package/dist/commands/skills.d.ts +0 -34
  46. package/dist/commands/start-run.d.ts +0 -49
  47. package/dist/commands/status.d.ts +0 -3
  48. package/dist/commands/step-numbering.d.ts +0 -87
  49. package/dist/commands/step.d.ts +0 -95
  50. package/dist/commands/sync.d.ts +0 -6
  51. package/dist/commands/triage.d.ts +0 -21
  52. package/dist/commands/update.d.ts +0 -4
  53. package/dist/commands/validate.d.ts +0 -8
  54. package/dist/commands/view-results.d.ts +0 -9
  55. package/dist/index.d.ts +0 -9
  56. package/dist/sync-mcp/fatal.d.ts +0 -42
  57. package/dist/sync-mcp/server.d.ts +0 -1
  58. package/dist/sync-mcp/tools.d.ts +0 -12
  59. package/dist/templates.d.ts +0 -10
  60. package/dist/ui/journey-diff.d.ts +0 -3
  61. package/dist/ui/json.d.ts +0 -6
  62. package/dist/ui/logger.d.ts +0 -5
  63. package/dist/ui/panic.d.ts +0 -11
  64. package/dist/ui/symbols.d.ts +0 -11
  65. package/dist/ui/table.d.ts +0 -20
  66. package/dist/ui/update-check.d.ts +0 -6
  67. package/dist/worktree-state.d.ts +0 -49
@@ -1,144 +0,0 @@
1
- import { IamuConfigError } from "@iamu-dev/protocol";
2
- /**
3
- * Production API URL, used when neither a flag, `IAMU_API_URL`, nor the
4
- * project config names one.
5
- *
6
- * @example
7
- * ```ts
8
- * const url = config.cloud_api_url ?? DEFAULT_API_URL;
9
- * ```
10
- */
11
- export declare const DEFAULT_API_URL = "https://api.iamu.dev";
12
- /**
13
- * Stored credentials, keyed by API URL. Values are left `unknown` on
14
- * purpose: the file is user-editable, so every reader narrows.
15
- */
16
- export type CredentialsStore = Record<string, unknown>;
17
- /**
18
- * Absolute path of the credentials file (`~/.iamu/credentials.json`).
19
- *
20
- * @returns The path; the file may not exist yet.
21
- *
22
- * @example
23
- * ```ts
24
- * console.log(`Tokens live in ${getCredentialsPath()}`);
25
- * ```
26
- */
27
- export declare function getCredentialsPath(): string;
28
- /**
29
- * The API URL a command talks to: the configured one (project config
30
- * or flag), else `IAMU_API_URL`, else {@link DEFAULT_API_URL}. Empty
31
- * strings count as unset.
32
- *
33
- * @param configured - URL from project config or a flag, if any.
34
- * @returns The effective API URL.
35
- *
36
- * @example
37
- * ```ts
38
- * const apiUrl = resolveApiUrl(config.cloud_api_url);
39
- * ```
40
- */
41
- export declare function resolveApiUrl(configured?: string | null): string;
42
- /**
43
- * The credentials file exists but is not a JSON object. Reported instead
44
- * of being treated as empty: the next login would otherwise overwrite
45
- * every stored token without a word.
46
- *
47
- * @example
48
- * ```ts
49
- * try {
50
- * await readCredentialsStore();
51
- * } catch (err) {
52
- * if (err instanceof CredentialsFileError) console.error(err.message);
53
- * }
54
- * ```
55
- */
56
- export declare class CredentialsFileError extends IamuConfigError {
57
- /**
58
- * @param path - The unreadable credentials file.
59
- * @param reason - What is wrong with it.
60
- * @param cause - Underlying parse error, if any.
61
- */
62
- constructor(path: string, reason: string, cause?: unknown);
63
- }
64
- /**
65
- * Read the whole credentials store. A missing file is an empty store; a
66
- * corrupt one throws {@link CredentialsFileError} so no caller writes
67
- * over tokens it could not read.
68
- *
69
- * @returns The parsed store.
70
- * @throws {@link CredentialsFileError} when the file is not a JSON object.
71
- *
72
- * @example
73
- * ```ts
74
- * const store = await readCredentialsStore();
75
- * delete store["https://api.iamu.dev"];
76
- * await writeCredentialsStore(store);
77
- * ```
78
- */
79
- export declare function readCredentialsStore(): Promise<CredentialsStore>;
80
- /**
81
- * Replace the credentials store. Written to a temp file with mode 0600
82
- * and renamed into place, so a crash mid-write leaves the previous file
83
- * intact and the tokens are never world-readable, even briefly. The
84
- * parent directory is created with mode 0700.
85
- *
86
- * @param store - The full store to persist.
87
- *
88
- * @example
89
- * ```ts
90
- * const store = await readCredentialsStore();
91
- * store[apiUrl] = { token, createdAt: new Date().toISOString() };
92
- * await writeCredentialsStore(store);
93
- * ```
94
- */
95
- export declare function writeCredentialsStore(store: CredentialsStore): Promise<void>;
96
- /** @internal Reset warned flag for unit testing. */
97
- export declare function _resetWarnedUnreadableStoreForTesting(): void;
98
- /**
99
- * Token for `apiUrl`: `IAMU_TOKEN`, then `IAMU_API_KEY`, then the entry
100
- * for that URL in the credentials file. A corrupt credentials file is
101
- * reported once on stderr (with the recovery step) and treated as no
102
- * token.
103
- *
104
- * Synchronous because it sits on hot paths (MCP tool handlers, status).
105
- *
106
- * @param apiUrl - API URL the token must belong to; defaults via
107
- * {@link resolveApiUrl}.
108
- * @returns The token, or `null` when none is available.
109
- *
110
- * @example
111
- * ```ts
112
- * const token = resolveApiKey(config.cloud_api_url);
113
- * if (!token) console.error("Run iamu auth login");
114
- * ```
115
- */
116
- export declare function resolveApiKey(apiUrl?: string | null): string | null;
117
- /**
118
- * True for hostnames that never leave the machine.
119
- *
120
- * @param hostname - `URL.hostname` (IPv6 arrives bracketed).
121
- * @returns Whether the host is loopback.
122
- *
123
- * @example
124
- * ```ts
125
- * isLoopbackHost(new URL("http://[::1]:3000").hostname); // true
126
- * ```
127
- */
128
- export declare function isLoopbackHost(hostname: string): boolean;
129
- /**
130
- * Refuse an API URL that would send the bearer token in cleartext:
131
- * anything but `https://`, except plain `http://` to a loopback host
132
- * (the local cloud stack).
133
- *
134
- * @param url - Candidate API URL.
135
- * @param source - Where it came from, for the error (`--url`,
136
- * `IAMU_API_URL`, ...).
137
- * @throws {@link IamuValidationError} when the URL is malformed or insecure.
138
- *
139
- * @example
140
- * ```ts
141
- * assertSecureApiUrl(process.env.IAMU_API_URL ?? DEFAULT_API_URL, "IAMU_API_URL");
142
- * ```
143
- */
144
- export declare function assertSecureApiUrl(url: string, source: string): void;
@@ -1,11 +0,0 @@
1
- import type { OutlineFrontmatter, ScenarioFrontmatter } from "@iamu-dev/protocol";
2
- export interface ChangedFilesResult {
3
- baseRef: string;
4
- files: string[];
5
- }
6
- /** Resolve changed files against a git base ref (e.g. origin/main, HEAD~1). */
7
- export declare function getChangedFiles(projectRoot: string, explicitRef?: string | boolean): ChangedFilesResult | null;
8
- /** Extract matching tokens from a scenario and its outline. */
9
- export declare function extractScenarioKeywords(scenario: ScenarioFrontmatter, outline?: OutlineFrontmatter): string[];
10
- /** Checks whether any changed file matches the scenario's keywords or path. */
11
- export declare function matchesChangedFiles(changedFiles: string[], scenario: ScenarioFrontmatter, outline?: OutlineFrontmatter): boolean;
@@ -1,24 +0,0 @@
1
- export interface DoctorCheck {
2
- category: "runtime" | "browser" | "project" | "agent" | "cloud";
3
- name: string;
4
- status: "ok" | "warn" | "error";
5
- message: string;
6
- remedy?: string;
7
- }
8
- export interface DoctorResult {
9
- ok: boolean;
10
- checks: DoctorCheck[];
11
- summary: {
12
- ok: number;
13
- warn: number;
14
- error: number;
15
- };
16
- }
17
- /** Check if a TCP port is available or bound */
18
- export declare function checkPortAvailable(port: number): Promise<boolean>;
19
- /** Check CDP responsiveness on a port */
20
- export declare function checkCdpResponsive(port: number): Promise<boolean>;
21
- export declare function runDoctorChecks(projectRoot?: string): Promise<DoctorResult>;
22
- export declare function doctor(opts?: {
23
- json?: boolean;
24
- }): Promise<void>;
@@ -1,30 +0,0 @@
1
- import { type CanonicalWalkthrough } from "@iamu-dev/protocol";
2
- /** What `verdicts.json` holds, as far as the report needs it. */
3
- export interface RecordedVerdicts {
4
- verdicts: Array<{
5
- human_test_id: string;
6
- verdict: string;
7
- reasoning: string;
8
- grounding_step_ids: string[];
9
- grounding_finding_ids: string[];
10
- }>;
11
- overall?: {
12
- answer: string;
13
- reasoning: string;
14
- };
15
- }
16
- /**
17
- * A copy of `canonical` with the judge's verdicts filled in. canonical.json
18
- * itself never carries them (its writer is `complete`); the report does.
19
- */
20
- export declare function applyVerdicts(canonical: CanonicalWalkthrough, recorded: RecordedVerdicts): CanonicalWalkthrough;
21
- export declare function evaluate(runId: string, opts?: {
22
- json?: boolean;
23
- }): Promise<void>;
24
- export declare function evaluateRecord(runId: string, opts: {
25
- file: string;
26
- json?: boolean;
27
- yes?: boolean;
28
- prompt?: boolean;
29
- view?: boolean;
30
- }): Promise<void>;
@@ -1,7 +0,0 @@
1
- export declare function findings(opts?: {
2
- open?: boolean;
3
- resolved?: boolean;
4
- dismissed?: boolean;
5
- scenario?: string;
6
- json?: boolean | string;
7
- }): Promise<void>;
@@ -1,9 +0,0 @@
1
- export interface InitOptions {
2
- name?: string;
3
- yes?: boolean;
4
- json?: boolean;
5
- }
6
- /**
7
- * Scaffold `iamu/` and install skills for the detected hosts.
8
- */
9
- export declare function init(opts?: InitOptions | string): Promise<void>;
@@ -1,59 +0,0 @@
1
- import { type GuidanceRule, type RevisitPlace } from "@iamu-dev/local-store";
2
- import { type RunViewport } from "@iamu-dev/protocol";
3
- /** "The browser is sized as a phone screen, 390×844." */
4
- export declare function viewportLine(v: RunViewport): string;
5
- interface WalkerPromptParts {
6
- targetUrl: string | null;
7
- persona: {
8
- name: string;
9
- role: string;
10
- disposition: string | null;
11
- background: string | null;
12
- };
13
- outline: {
14
- title: string;
15
- tension: unknown;
16
- narrative: unknown;
17
- };
18
- brief: string | null;
19
- access: {
20
- project: string | null;
21
- persona: string | null;
22
- };
23
- methodology: string;
24
- dismissed: string[];
25
- /** Active tester guidance in the scenario's scope. */
26
- guidance?: GuidanceRule[];
27
- /** Where fixes awaiting a re-run were seen — places only, no findings. */
28
- revisit?: RevisitPlace[];
29
- scenarioSlug: string;
30
- runId: string;
31
- runDirPath: string;
32
- projectRoot: string;
33
- surface: string;
34
- /** The run's viewport (`start-run`, from persona tags), if any. */
35
- viewport?: RunViewport | null;
36
- }
37
- /**
38
- * The places-to-pass-through section: where this scenario's fixes
39
- * awaiting a re-run were observed, framed as part of the persona's own
40
- * route. It carries URLs and screen names only — never a finding's
41
- * title, type, severity or any hint of what was wrong, so the walker
42
- * judges each place fresh (the same reason it never sees human tests).
43
- * Empty when nothing awaits, so those prompts stay as they were.
44
- */
45
- export declare function revisitSection(places: readonly RevisitPlace[]): string[];
46
- /**
47
- * The walker subagent's whole prompt — persona, situation, brief, access,
48
- * driving surface, methodology, and the run-directory contract (steps,
49
- * screenshots, findings, summary.json). Composed here so every host
50
- * hands its walker the same thing instead of assembling it by hand.
51
- */
52
- export declare function composeWalkerPrompt(p: WalkerPromptParts): string;
53
- export declare function instructionsWalk(opts: {
54
- scenario: string;
55
- run?: string;
56
- surface?: string;
57
- json?: boolean;
58
- }): Promise<void>;
59
- export {};
@@ -1,5 +0,0 @@
1
- export declare function list(type: string | undefined, opts: {
2
- capability?: string;
3
- diff?: string | boolean;
4
- json?: boolean | string;
5
- }): Promise<void>;
@@ -1,12 +0,0 @@
1
- /**
2
- * Print the matcher's input bundle: this run's findings, the scenario's
3
- * earlier canonical findings, this run's steps, and the prompt.
4
- */
5
- export declare function match(runId: string, opts?: {
6
- json?: boolean;
7
- }): Promise<void>;
8
- /** Record the matcher's answer and re-derive the run's delta and report. */
9
- export declare function matchRecord(runId: string, opts: {
10
- file: string;
11
- json?: boolean;
12
- }): Promise<void>;
@@ -1,10 +0,0 @@
1
- /**
2
- * Write or update the `iamu-sync` entry in an MCP config file.
3
- * Merges with existing content — does not clobber other servers.
4
- * Throws if existing file contains invalid JSON (avoids silent data loss).
5
- */
6
- export declare function writeSyncMcpEntry(mcpPath: string): Promise<void>;
7
- /**
8
- * Check if an MCP config file has an `iamu-sync` entry.
9
- */
10
- export declare function hasSyncMcpEntry(parsed: Record<string, unknown>, mcpPath: string): boolean;
@@ -1,15 +0,0 @@
1
- export interface NewEntityOptions {
2
- name: string;
3
- slug?: string;
4
- description?: string;
5
- role?: string;
6
- disposition?: string;
7
- outline?: string;
8
- persona?: string;
9
- url?: string;
10
- authority?: string;
11
- /** Scenario start path, e.g. /en/episodes/1. */
12
- entry?: string;
13
- json?: boolean;
14
- }
15
- export declare function newEntity(type: string, opts: NewEntityOptions): Promise<void>;
@@ -1,19 +0,0 @@
1
- export interface NewFindingOptions {
2
- scenario?: string;
3
- run?: string;
4
- title: string;
5
- type: string;
6
- severity: string;
7
- uiFact?: string;
8
- consequence?: string;
9
- lens?: string;
10
- uxHeuristic?: string;
11
- /** What the finding does to the persona's task (blocks … enables). */
12
- taskImpact?: string;
13
- /** How sure the walker is that this is real (high | medium | low). */
14
- confidence?: string;
15
- /** Step number whose screenshot shows the finding. */
16
- step?: string;
17
- json?: boolean;
18
- }
19
- export declare function newFinding(opts: NewFindingOptions): Promise<void>;
@@ -1,8 +0,0 @@
1
- export interface OpenOptions {
2
- printOnly?: boolean;
3
- }
4
- /**
5
- * Opens the Iamu Cloud dashboard for the project or a specific walkthrough run.
6
- * If the project is not cloud-linked, prompts the user to link or view the terminal summary.
7
- */
8
- export declare function openDashboard(runId?: string, opts?: OpenOptions): Promise<void>;
@@ -1,17 +0,0 @@
1
- /**
2
- * Commander coercer for `--port`. Commander calls a coercer as
3
- * `(value, previous)`, so a bare `parseInt` took the previous value as
4
- * its radix — reinterpreting the digits — and silently truncated
5
- * anything non-numeric instead of rejecting it.
6
- *
7
- * @param value - Raw option text from the command line.
8
- * @returns The port as an integer in `0..65535`.
9
- * @throws InvalidArgumentError when `value` is not such an integer.
10
- *
11
- * @example
12
- * ```ts
13
- * parsePortOption("8080"); // 8080
14
- * parsePortOption("abc"); // throws InvalidArgumentError
15
- * ```
16
- */
17
- export declare function parsePortOption(value: string, _previous?: unknown): number;
@@ -1,11 +0,0 @@
1
- import { type PruneResult } from "@iamu-dev/local-store";
2
- export interface PruneCliOptions {
3
- keep?: string | number;
4
- days?: string | number;
5
- screenshotsOnly?: boolean;
6
- dryRun?: boolean;
7
- yes?: boolean;
8
- json?: boolean;
9
- }
10
- export declare function formatBytes(bytes: number): string;
11
- export declare function prune(opts?: PruneCliOptions): Promise<PruneResult | undefined>;
@@ -1,5 +0,0 @@
1
- export declare function pull(opts?: {
2
- force?: boolean;
3
- preview?: boolean;
4
- json?: boolean;
5
- }): Promise<void>;
@@ -1,5 +0,0 @@
1
- import { type Command } from "commander";
2
- /**
3
- * Registers cloud sync, pull, auth, open, and internal sync-server commands.
4
- */
5
- export declare function registerCloudCommands(program: Command): void;
@@ -1,5 +0,0 @@
1
- import { type Command } from "commander";
2
- /**
3
- * Registers findings, triage, report, and serve commands.
4
- */
5
- export declare function registerFindingsCommands(program: Command): void;
@@ -1,5 +0,0 @@
1
- import type { Command } from "commander";
2
- /**
3
- * Registers project lifecycle commands: init, status, doctor, list, validate, update, new, completion.
4
- */
5
- export declare function registerProjectCommands(program: Command): void;
@@ -1,5 +0,0 @@
1
- import type { Command } from "commander";
2
- /**
3
- * Registers walkthrough execution commands: start-run, instructions, browse, step, new-finding, complete, match, match-record, evaluate, evaluate-record, prune.
4
- */
5
- export declare function registerWalkthroughCommands(program: Command): void;
@@ -1,10 +0,0 @@
1
- import type { Command } from "commander";
2
- import { registerCloudCommands } from "./register-cloud.js";
3
- import { registerFindingsCommands } from "./register-findings.js";
4
- import { registerProjectCommands } from "./register-project.js";
5
- import { registerWalkthroughCommands } from "./register-walkthrough.js";
6
- /**
7
- * Registers all CLI command groups onto the root Commander program.
8
- */
9
- export declare function registerAllCommands(program: Command): void;
10
- export { registerProjectCommands, registerWalkthroughCommands, registerFindingsCommands, registerCloudCommands, };
@@ -1,3 +0,0 @@
1
- export declare function report(scenario?: string, opts?: {
2
- json?: boolean;
3
- }): Promise<void>;
@@ -1,11 +0,0 @@
1
- export interface ServeOptions {
2
- /**
3
- * `false` (from `--no-open`) prints the dashboard URL instead of
4
- * launching a browser, like `iamu open --print`.
5
- */
6
- open?: boolean;
7
- }
8
- /**
9
- * Deprecated: The local web UI has been retired in favor of Iamu Cloud and terminal reporting.
10
- */
11
- export declare function serve(opts?: ServeOptions): Promise<void>;
@@ -1,34 +0,0 @@
1
- import type { HostAdapter, CommandContent } from "../adapters/types.js";
2
- export declare function getVersion(): string;
3
- export declare function loadSkillTemplates(version: string): Map<string, string>;
4
- export declare function commandsFromSkills(templates: Map<string, string>): CommandContent[];
5
- /**
6
- * Hosts in `projectRoot` that already have iamu skills or commands
7
- * installed — the ones `iamu update` refreshes.
8
- */
9
- export declare function detectInstalledHosts(projectRoot: string): HostAdapter[];
10
- /**
11
- * Resolves target hosts for install or update.
12
- * If hostFilter is supplied, matches by value or name (case-insensitive).
13
- * Otherwise combines already-installed hosts and detected editor hosts in the workspace.
14
- */
15
- export declare function resolveTargetHosts(projectRoot: string, hostFilter?: string): {
16
- hosts: HostAdapter[];
17
- error?: string;
18
- };
19
- /**
20
- * Installed skill/command files that differ from what `iamu update` would
21
- * write for this CLI version. Local reads only — no network.
22
- *
23
- * @returns Absolute paths of the stale files; empty when up to date or
24
- * when no host has iamu skills installed.
25
- */
26
- export declare function findStaleSkills(projectRoot: string): Promise<string[]>;
27
- /** The one-line nudge `iamu status` and `iamu sync` print. */
28
- export declare const STALE_SKILLS_MESSAGE = "Skills are out of date \u2014 run `iamu update`";
29
- export declare function installSkillsForHosts(hosts: HostAdapter[], projectRoot: string, version: string, opts?: {
30
- quiet?: boolean;
31
- }): Promise<{
32
- totalSkills: number;
33
- totalCommands: number;
34
- }>;
@@ -1,49 +0,0 @@
1
- import { type BuildMetadata, type RunViewport, type ScenarioFrontmatter } from "@iamu-dev/protocol";
2
- /**
3
- * The URL a run starts at: `--target` (or the scenario's `target_url`)
4
- * as the base, with the scenario's `entry_path` resolved against it.
5
- * Returns an error message instead when there is nothing usable.
6
- */
7
- export declare function resolveStartUrl(target: string | undefined, scenario: Pick<ScenarioFrontmatter, "target_url" | "entry_path">): {
8
- url: string;
9
- } | {
10
- error: string;
11
- };
12
- /**
13
- * Fast preflight probe to check if the target URL answers HTTP requests.
14
- * Times out quickly (default: 1000ms) to avoid stalling walkthrough initialization.
15
- */
16
- export declare function checkTargetReachable(url: string, timeoutMs?: number): Promise<{
17
- reachable: boolean;
18
- error?: string;
19
- }>;
20
- /**
21
- * The build as one line: label, branch, commit and CI provider. A dirty
22
- * tree shows next to the commit, so a re-run after an uncommitted fix
23
- * visibly walks a different build.
24
- *
25
- * @example
26
- * ```ts
27
- * formatBuild({ git_sha: "90e2444…", git_dirty: true, worktree_hash: "3fa9c1d2e4b5" });
28
- * // "90e2444 + uncommitted changes (3fa9c1…)"
29
- * ```
30
- */
31
- export declare function formatBuild(build: BuildMetadata): string;
32
- /**
33
- * A run viewport as one line.
34
- *
35
- * @example
36
- * ```ts
37
- * formatViewport({ device: "desktop", width: 1280, height: 800, source: "persona-tags" });
38
- * // "desktop 1280×800 (from persona tags)"
39
- * ```
40
- */
41
- export declare function formatViewport(v: RunViewport): string;
42
- export interface StartRunOptions {
43
- target?: string;
44
- build?: string;
45
- env?: string;
46
- json?: boolean;
47
- check?: boolean;
48
- }
49
- export declare function startRun(scenarioSlug: string, opts: StartRunOptions): Promise<void>;
@@ -1,3 +0,0 @@
1
- export declare function status(opts: {
2
- json?: boolean;
3
- }): Promise<void>;
@@ -1,87 +0,0 @@
1
- /**
2
- * A step number claimed on disk. The file at `stepPath` exists (empty)
3
- * until the caller overwrites it with the step, or calls `release()`.
4
- *
5
- * @public
6
- */
7
- export interface StepReservation {
8
- /** The reserved 1-based step number. */
9
- stepNumber: number;
10
- /** Absolute path of the reserved `NNN.json`. */
11
- stepPath: string;
12
- /** Give the number back — removes the placeholder file. Never throws. */
13
- release(): Promise<void>;
14
- }
15
- /**
16
- * The file name for a step number: `7` → `"007.json"`.
17
- *
18
- * @param stepNumber - 1-based step number.
19
- * @returns The zero-padded file name.
20
- *
21
- * @example
22
- * ```ts
23
- * stepFileName(7); // "007.json"
24
- * ```
25
- *
26
- * @public
27
- */
28
- export declare function stepFileName(stepNumber: number): string;
29
- /**
30
- * The step-limit error message shared by `iamu step` and
31
- * `iamu browse step`.
32
- *
33
- * @param maxSteps - The limit that was hit.
34
- * @param runId - The run being recorded into.
35
- * @returns A message naming the limit and both ways out.
36
- *
37
- * @example
38
- * ```ts
39
- * throw new Error(stepLimitMessage(50, runId));
40
- * ```
41
- *
42
- * @public
43
- */
44
- export declare function stepLimitMessage(maxSteps: number, runId: string): string;
45
- /**
46
- * The number the next step would get (highest recorded + 1), without
47
- * claiming it. Use for an early "would this exceed the limit?" check;
48
- * only {@link reserveStepFile} makes the number yours.
49
- *
50
- * @param stepsDir - Absolute path of `<runDir>/steps`.
51
- * @returns The next free step number (1 when the directory is empty or missing).
52
- *
53
- * @example
54
- * ```ts
55
- * if ((await peekNextStepNumber(stepsDir)) > maxSteps) fail("limit");
56
- * ```
57
- *
58
- * @public
59
- */
60
- export declare function peekNextStepNumber(stepsDir: string): Promise<number>;
61
- /**
62
- * Claim the next step number by exclusively creating its `NNN.json`.
63
- * On `EEXIST` (another writer won that number) it moves to the next
64
- * one, so N concurrent callers end up with N distinct files.
65
- *
66
- * @param stepsDir - Absolute path of `<runDir>/steps` (must exist).
67
- * @param limit - `maxSteps` cap and the `runId` named in the error.
68
- * @returns The reservation; overwrite `stepPath` with the step or `release()` it.
69
- * @throws Error with {@link stepLimitMessage} when the next number exceeds `maxSteps`.
70
- *
71
- * @example
72
- * ```ts
73
- * const r = await reserveStepFile(stepsDir, { maxSteps: 50, runId });
74
- * try {
75
- * await writeStep(runDir, { ...step, step_number: r.stepNumber });
76
- * } catch (err) {
77
- * await r.release();
78
- * throw err;
79
- * }
80
- * ```
81
- *
82
- * @public
83
- */
84
- export declare function reserveStepFile(stepsDir: string, limit: {
85
- maxSteps: number;
86
- runId: string;
87
- }): Promise<StepReservation>;