@iamu-dev/iamu 0.2.0-beta.9 → 0.3.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.
- package/dist/adapters/claude-plugin.d.ts +13 -0
- package/dist/adapters/registry.d.ts +6 -0
- package/dist/adapters/types.d.ts +19 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +5372 -1594
- package/dist/build-info.d.ts +53 -0
- package/dist/cloud-url.d.ts +19 -0
- package/dist/commands/auth-http.d.ts +37 -0
- package/dist/commands/auth-project-choice.d.ts +74 -0
- package/dist/commands/auth-token-input.d.ts +21 -0
- package/dist/commands/auth.d.ts +84 -0
- package/dist/commands/browse-actions.d.ts +61 -0
- package/dist/commands/browse-driver.d.ts +121 -0
- package/dist/commands/browse.d.ts +195 -0
- package/dist/commands/cloud-push.d.ts +27 -0
- package/dist/commands/complete.d.ts +132 -0
- package/dist/commands/completion.d.ts +2 -0
- package/dist/commands/context.d.ts +81 -0
- package/dist/commands/credentials.d.ts +144 -0
- package/dist/commands/diff-filter.d.ts +11 -0
- package/dist/commands/doctor.d.ts +33 -0
- package/dist/commands/edit-entity.d.ts +8 -0
- package/dist/commands/evaluate.d.ts +34 -0
- package/dist/commands/explore-crawl.d.ts +67 -0
- package/dist/commands/explore.d.ts +53 -0
- package/dist/commands/findings.d.ts +7 -0
- package/dist/commands/init.d.ts +27 -0
- package/dist/commands/instructions-walk.d.ts +69 -0
- package/dist/commands/instructions.d.ts +30 -0
- package/dist/commands/list.d.ts +5 -0
- package/dist/commands/live-run-client.d.ts +127 -0
- package/dist/commands/match.d.ts +15 -0
- package/dist/commands/mcp-config.d.ts +10 -0
- package/dist/commands/new-entity.d.ts +34 -0
- package/dist/commands/new-finding.d.ts +25 -0
- package/dist/commands/open.d.ts +8 -0
- package/dist/commands/port.d.ts +17 -0
- package/dist/commands/preflight.d.ts +26 -0
- package/dist/commands/prune.d.ts +11 -0
- package/dist/commands/pull.d.ts +5 -0
- package/dist/commands/register-cloud.d.ts +5 -0
- package/dist/commands/register-findings.d.ts +5 -0
- package/dist/commands/register-project.d.ts +5 -0
- package/dist/commands/register-walkthrough.d.ts +5 -0
- package/dist/commands/register.d.ts +10 -0
- package/dist/commands/report.d.ts +3 -0
- package/dist/commands/serve.d.ts +11 -0
- package/dist/commands/set-entity.d.ts +46 -0
- package/dist/commands/skills.d.ts +34 -0
- package/dist/commands/start-run.d.ts +56 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/step-numbering.d.ts +87 -0
- package/dist/commands/step.d.ts +96 -0
- package/dist/commands/summary.d.ts +20 -0
- package/dist/commands/sync.d.ts +6 -0
- package/dist/commands/triage.d.ts +21 -0
- package/dist/commands/update.d.ts +4 -0
- package/dist/commands/validate.d.ts +11 -0
- package/dist/commands/view-results.d.ts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +5369 -1637
- package/dist/sync-mcp/fatal.d.ts +42 -0
- package/dist/sync-mcp/server.d.ts +1 -0
- package/dist/sync-mcp/tools.d.ts +12 -0
- package/dist/templates/prompts/walk.md +62 -37
- package/dist/templates/skills/iamu-findings.md +118 -42
- package/dist/templates/skills/iamu-new.md +106 -60
- package/dist/templates/skills/iamu-propose.md +36 -25
- package/dist/templates/skills/iamu-run.md +273 -114
- package/dist/templates/skills/iamu-setup.md +252 -176
- package/dist/templates/skills/iamu-stage.md +164 -0
- package/dist/templates/skills/iamu-status.md +16 -11
- package/dist/templates.d.ts +10 -0
- package/dist/ui/journey-diff.d.ts +3 -0
- package/dist/ui/json.d.ts +6 -0
- package/dist/ui/logger.d.ts +5 -0
- package/dist/ui/panic.d.ts +11 -0
- package/dist/ui/symbols.d.ts +11 -0
- package/dist/ui/table.d.ts +20 -0
- package/dist/ui/update-check.d.ts +6 -0
- package/dist/worktree-state.d.ts +49 -0
- package/package.json +8 -8
- package/dist/eval/gemini-eval-cli.js +0 -976
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type GuidanceRule, type RevisitPlace } from "@iamu-dev/local-store";
|
|
2
|
+
import { type RunViewport, type ScenarioState } 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
|
+
/** Scenario environment state and semantic approximation guidance */
|
|
37
|
+
state?: ScenarioState | null;
|
|
38
|
+
/** Product domain and regulatory context from context.yml */
|
|
39
|
+
context?: string | null;
|
|
40
|
+
/** Untestable execution boundaries from testability.md */
|
|
41
|
+
untestableBoundaries?: string[] | null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Extracts bullet points from a markdown "## Untestable Boundaries" section.
|
|
45
|
+
*/
|
|
46
|
+
export declare function extractUntestableBoundaries(body: string): string[];
|
|
47
|
+
/**
|
|
48
|
+
* The places-to-pass-through section: where this scenario's fixes
|
|
49
|
+
* awaiting a re-run were observed, framed as part of the persona's own
|
|
50
|
+
* route. It carries URLs and screen names only — never a finding's
|
|
51
|
+
* title, type, severity or any hint of what was wrong, so the walker
|
|
52
|
+
* judges each place fresh (the same reason it never sees human tests).
|
|
53
|
+
* Empty when nothing awaits, so those prompts stay as they were.
|
|
54
|
+
*/
|
|
55
|
+
export declare function revisitSection(places: readonly RevisitPlace[]): string[];
|
|
56
|
+
/**
|
|
57
|
+
* The walker subagent's whole prompt — persona, situation, brief, access,
|
|
58
|
+
* driving surface, methodology, and the run-directory contract (steps,
|
|
59
|
+
* screenshots, findings, summary.json). Composed here so every host
|
|
60
|
+
* hands its walker the same thing instead of assembling it by hand.
|
|
61
|
+
*/
|
|
62
|
+
export declare function composeWalkerPrompt(p: WalkerPromptParts): string;
|
|
63
|
+
export declare function instructionsWalk(opts: {
|
|
64
|
+
scenario?: string;
|
|
65
|
+
run?: string;
|
|
66
|
+
surface?: string;
|
|
67
|
+
json?: boolean;
|
|
68
|
+
}): Promise<void>;
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface InstructionsOptions {
|
|
2
|
+
phase?: string;
|
|
3
|
+
scenario?: string;
|
|
4
|
+
run?: string;
|
|
5
|
+
surface?: string;
|
|
6
|
+
json?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Generates dynamic staging instructions for an active or specified scenario.
|
|
10
|
+
*/
|
|
11
|
+
export declare function instructionsStage(slug?: string, opts?: {
|
|
12
|
+
json?: boolean;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Generates dynamic setup instructions for the project.
|
|
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>;
|
|
27
|
+
/**
|
|
28
|
+
* Top-level dispatcher for `iamu instructions [phase] [slug]`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function instructions(phase?: string, slug?: string, opts?: InstructionsOptions): Promise<void>;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { RunStep } from "@iamu-dev/protocol";
|
|
2
|
+
/** Timeout for run registration on start-run (3 seconds). */
|
|
3
|
+
export declare const REGISTER_TIMEOUT_MS = 3000;
|
|
4
|
+
/** Timeout for per-step and phase event dispatches (1.5 seconds). */
|
|
5
|
+
export declare const EVENT_TIMEOUT_MS = 1500;
|
|
6
|
+
/** Cap screenshot base64 at 5 MB raw binary (~6.7 MB base64, under the 8 MB payload cap). */
|
|
7
|
+
export declare const MAX_LIVE_SCREENSHOT_BYTES: number;
|
|
8
|
+
export type LiveRunPhase = "walking" | "completing" | "matching" | "judging" | "publishing";
|
|
9
|
+
export interface LiveRunMeta {
|
|
10
|
+
walkthrough_id: string;
|
|
11
|
+
viewer_url: string;
|
|
12
|
+
project_id: string;
|
|
13
|
+
api_url: string;
|
|
14
|
+
last_seq: number;
|
|
15
|
+
}
|
|
16
|
+
export interface RegisterLiveRunParams {
|
|
17
|
+
projectRoot: string;
|
|
18
|
+
runId: string;
|
|
19
|
+
scenarioSlug: string;
|
|
20
|
+
targetUrl: string;
|
|
21
|
+
startedAt?: string;
|
|
22
|
+
lenses?: string[];
|
|
23
|
+
fetchFn?: typeof fetch;
|
|
24
|
+
}
|
|
25
|
+
export interface RegisterLiveRunResult {
|
|
26
|
+
walkthroughId: string;
|
|
27
|
+
viewerUrl: string;
|
|
28
|
+
status: "created" | "resumed";
|
|
29
|
+
}
|
|
30
|
+
export interface LiveStepEvent {
|
|
31
|
+
seq: number;
|
|
32
|
+
type: "step";
|
|
33
|
+
step: {
|
|
34
|
+
number: number;
|
|
35
|
+
title: string;
|
|
36
|
+
persona_reasoning?: string | null;
|
|
37
|
+
grounding?: string | null;
|
|
38
|
+
page_url?: string | null;
|
|
39
|
+
surface?: string | null;
|
|
40
|
+
screenshot_base64?: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface LiveActionEvent {
|
|
44
|
+
seq: number;
|
|
45
|
+
type: "action";
|
|
46
|
+
step_number: number;
|
|
47
|
+
action_type: string;
|
|
48
|
+
target?: string | null;
|
|
49
|
+
}
|
|
50
|
+
export interface LiveFindingEvent {
|
|
51
|
+
seq: number;
|
|
52
|
+
type: "finding";
|
|
53
|
+
finding: {
|
|
54
|
+
id: string;
|
|
55
|
+
title: string;
|
|
56
|
+
type: "helps" | "hinders" | "missing" | "irrelevant" | "incorrect";
|
|
57
|
+
severity: "critical" | "major" | "minor" | "observation";
|
|
58
|
+
ui_fact?: string | null;
|
|
59
|
+
consequence?: string | null;
|
|
60
|
+
step_number?: number | null;
|
|
61
|
+
task_impact?: string | null;
|
|
62
|
+
confidence?: string | null;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface LivePhaseEvent {
|
|
66
|
+
seq: number;
|
|
67
|
+
type: "phase";
|
|
68
|
+
phase: LiveRunPhase;
|
|
69
|
+
}
|
|
70
|
+
export interface LiveAbandonEvent {
|
|
71
|
+
seq: number;
|
|
72
|
+
type: "abandon";
|
|
73
|
+
reason?: string;
|
|
74
|
+
}
|
|
75
|
+
export type LiveRunEvent = LiveStepEvent | LiveActionEvent | LiveFindingEvent | LivePhaseEvent | LiveAbandonEvent;
|
|
76
|
+
export interface LiveEventsResponse {
|
|
77
|
+
accepted_seq?: number;
|
|
78
|
+
cancelled?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Reads `<runDir>/live.json`. Returns null when absent or malformed.
|
|
82
|
+
*/
|
|
83
|
+
export declare function loadLiveRunMeta(runDirPath: string): Promise<LiveRunMeta | null>;
|
|
84
|
+
/**
|
|
85
|
+
* Saves `<runDir>/live.json` atomically.
|
|
86
|
+
*/
|
|
87
|
+
export declare function saveLiveRunMeta(runDirPath: string, meta: LiveRunMeta): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Register a running walkthrough with Iamu Cloud (POST /api/projects/:id/live-runs).
|
|
90
|
+
*
|
|
91
|
+
* Runs only when the project is cloud-linked, IAMU_LIVE != "0", and valid
|
|
92
|
+
* credentials exist. Never throws: network errors or 4xx/5xx silently return null.
|
|
93
|
+
*/
|
|
94
|
+
export declare function registerLiveRun(params: RegisterLiveRunParams): Promise<RegisterLiveRunResult | null>;
|
|
95
|
+
/**
|
|
96
|
+
* Dispatch ordered events to POST /api/projects/:id/live-runs/:runId/events.
|
|
97
|
+
*
|
|
98
|
+
* Reads `<runDir>/live.json`. If absent or not cloud-linked, makes 0 network
|
|
99
|
+
* requests. Increments `last_seq` and catches all network errors silently.
|
|
100
|
+
*/
|
|
101
|
+
export declare function sendLiveEvents(projectRoot: string, runId: string, buildEvents: (startSeq: number) => LiveRunEvent[] | LiveRunEvent, fetchFn?: typeof fetch): Promise<LiveEventsResponse>;
|
|
102
|
+
/**
|
|
103
|
+
* Post a step event with optional base64 screenshot.
|
|
104
|
+
*/
|
|
105
|
+
export declare function sendLiveStep(projectRoot: string, runId: string, step: RunStep, screenshotPath?: string | null, fetchFn?: typeof fetch): Promise<LiveEventsResponse>;
|
|
106
|
+
/**
|
|
107
|
+
* Post a phase transition event (completing, matching, judging, publishing).
|
|
108
|
+
*/
|
|
109
|
+
export declare function sendLivePhase(projectRoot: string, runId: string, phase: LiveRunPhase, fetchFn?: typeof fetch): Promise<LiveEventsResponse>;
|
|
110
|
+
/**
|
|
111
|
+
* Post a finding event.
|
|
112
|
+
*/
|
|
113
|
+
export declare function sendLiveFinding(projectRoot: string, runId: string, finding: {
|
|
114
|
+
id: string;
|
|
115
|
+
title: string;
|
|
116
|
+
type: "helps" | "hinders" | "missing" | "irrelevant" | "incorrect";
|
|
117
|
+
severity: "critical" | "major" | "minor" | "observation";
|
|
118
|
+
ui_fact?: string | null;
|
|
119
|
+
consequence?: string | null;
|
|
120
|
+
step_number?: number | null;
|
|
121
|
+
task_impact?: string | null;
|
|
122
|
+
confidence?: string | null;
|
|
123
|
+
}, fetchFn?: typeof fetch): Promise<LiveEventsResponse>;
|
|
124
|
+
/**
|
|
125
|
+
* Post an abandon event if a run was discarded or failed locally.
|
|
126
|
+
*/
|
|
127
|
+
export declare function sendLiveAbandon(projectRoot: string, runId: string, reason?: string, fetchFn?: typeof fetch): Promise<LiveEventsResponse>;
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
promptFile?: string;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
export interface MatchRecordOptions {
|
|
10
|
+
file?: string;
|
|
11
|
+
data?: string;
|
|
12
|
+
json?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Record the matcher's answer and re-derive the run's delta and report. */
|
|
15
|
+
export declare function matchRecord(runId: string, opts: MatchRecordOptions): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface NewEntityOptions {
|
|
2
|
+
name: string;
|
|
3
|
+
slug?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
narrative?: string;
|
|
7
|
+
access?: string;
|
|
8
|
+
role?: string;
|
|
9
|
+
disposition?: string;
|
|
10
|
+
outline?: string;
|
|
11
|
+
persona?: string;
|
|
12
|
+
url?: string;
|
|
13
|
+
authority?: string;
|
|
14
|
+
/** Primary capability slug (outline only). */
|
|
15
|
+
capability?: string;
|
|
16
|
+
/** Secondary capability slugs, comma-separated or array (outline only). */
|
|
17
|
+
additionalCapabilities?: string | string[];
|
|
18
|
+
/** Structural tension driving the situation (outline only). */
|
|
19
|
+
tension?: string;
|
|
20
|
+
/** Human-test question to evaluate at walkthrough completion (outline only). */
|
|
21
|
+
humanTest?: string | string[];
|
|
22
|
+
/** Route patterns owned by this capability, comma-separated or array (capability only). */
|
|
23
|
+
paths?: string | string[];
|
|
24
|
+
/** Optional visual grouping category (capability only). */
|
|
25
|
+
area?: string;
|
|
26
|
+
/** Scenario start path, e.g. /en/episodes/1. */
|
|
27
|
+
entry?: string;
|
|
28
|
+
/** Scenario assumed environment state description. */
|
|
29
|
+
stateDescription?: string;
|
|
30
|
+
/** Scenario squint/approximation guidance when exact records are missing. */
|
|
31
|
+
stateApproximation?: string;
|
|
32
|
+
json?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function newEntity(type: string, opts: NewEntityOptions): Promise<void>;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/** Finding narrative description. */
|
|
18
|
+
description?: string;
|
|
19
|
+
/** Concrete recommendation for fixing the finding. */
|
|
20
|
+
recommendation?: string;
|
|
21
|
+
/** Complete markdown body (overrides description and recommendation). */
|
|
22
|
+
body?: string;
|
|
23
|
+
json?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function newFinding(opts: NewFindingOptions): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,17 @@
|
|
|
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;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface PreflightOptions {
|
|
2
|
+
cwd?: string;
|
|
3
|
+
json?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface PreflightCheckResult {
|
|
6
|
+
ok: boolean;
|
|
7
|
+
command?: string;
|
|
8
|
+
output?: string;
|
|
9
|
+
skipped?: boolean;
|
|
10
|
+
reason?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Detect the fast compile/typecheck/lint command for a target project.
|
|
14
|
+
*/
|
|
15
|
+
export declare function detectPreflightCommand(targetDir: string): Promise<{
|
|
16
|
+
command: string;
|
|
17
|
+
args: string[];
|
|
18
|
+
} | null>;
|
|
19
|
+
/**
|
|
20
|
+
* Executes a fast preflight type/lint check.
|
|
21
|
+
*/
|
|
22
|
+
export declare function runPreflightCheck(targetDir: string): Promise<PreflightCheckResult>;
|
|
23
|
+
/**
|
|
24
|
+
* CLI handler for `iamu preflight`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function preflight(opts?: PreflightOptions): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
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>;
|
|
@@ -0,0 +1,5 @@
|
|
|
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;
|
|
@@ -0,0 +1,10 @@
|
|
|
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, };
|
|
@@ -0,0 +1,11 @@
|
|
|
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>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for `iamu set`. Every field is staging: where a walk starts,
|
|
3
|
+
* what the world holds, which account a persona uses, which routes an
|
|
4
|
+
* area owns. What a scenario is about (narrative, tension, human tests,
|
|
5
|
+
* brief, background) is not settable here — that is authoring's.
|
|
6
|
+
*
|
|
7
|
+
* Commander maps `--no-<flag>` to `false`, which clears the field.
|
|
8
|
+
*/
|
|
9
|
+
export interface SetEntityOptions {
|
|
10
|
+
/** Scenario start path, or `false` to clear. */
|
|
11
|
+
entry?: string | false;
|
|
12
|
+
/** Scenario default target URL, or `false` to clear. */
|
|
13
|
+
target?: string | false;
|
|
14
|
+
/** Scenario `state.description`. */
|
|
15
|
+
stateDescription?: string;
|
|
16
|
+
/** Scenario `state.approximation`. */
|
|
17
|
+
stateApproximation?: string;
|
|
18
|
+
/** `false` clears scenario `state` (Commander defaults it to `true`). */
|
|
19
|
+
state?: boolean;
|
|
20
|
+
/** Persona access key, or `false` to clear. */
|
|
21
|
+
access?: string | false;
|
|
22
|
+
/** Capability route prefixes, comma-separated; replaces `paths`, or `false` to clear. */
|
|
23
|
+
paths?: string | false;
|
|
24
|
+
/** Capability route prefix to add (repeatable). */
|
|
25
|
+
addPath?: string[];
|
|
26
|
+
/** Capability route prefix to remove (repeatable). */
|
|
27
|
+
removePath?: string[];
|
|
28
|
+
/** Capability visual grouping, or `false` to clear. */
|
|
29
|
+
area?: string | false;
|
|
30
|
+
/** JSON patch file (or - for stdin) containing staging fields. */
|
|
31
|
+
file?: string;
|
|
32
|
+
json?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* `iamu set <type> <slug>` — change the staging fields of an existing
|
|
36
|
+
* entity: a scenario's start path, target and starting state, a
|
|
37
|
+
* persona's access key, a capability's route prefixes and area.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```bash
|
|
41
|
+
* iamu set scenario maria--handoff --entry /incidents \
|
|
42
|
+
* --state-description "Five open incidents at one site"
|
|
43
|
+
* iamu set capability team-access --add-path /team
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function setEntity(type: string, slug: string, opts: SetEntityOptions): Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
}>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type BuildMetadata, type RunViewport, type ScenarioFrontmatter } from "@iamu-dev/protocol";
|
|
2
|
+
/** `target_url` from `iamu/testability.md`, when there is one. */
|
|
3
|
+
export declare function testabilityTarget(projectRoot: string): Promise<string | null>;
|
|
4
|
+
/**
|
|
5
|
+
* The URL a run starts at: `--target` (or the scenario's `target_url` or `iamu/testability.md`)
|
|
6
|
+
* as the base, with the scenario's `entry_path` resolved against it.
|
|
7
|
+
* Returns an error message instead when there is nothing usable.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveStartUrl(target: string | undefined, scenario: Pick<ScenarioFrontmatter, "target_url" | "entry_path">, fallbackTarget?: string | null): {
|
|
10
|
+
url: string;
|
|
11
|
+
} | {
|
|
12
|
+
error: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const DEV_CRASH_MARKERS: string[];
|
|
15
|
+
/**
|
|
16
|
+
* Fast preflight probe to check if the target URL answers HTTP requests.
|
|
17
|
+
* Times out quickly (default: 1500ms) to avoid stalling walkthrough initialization.
|
|
18
|
+
* Validates against 5xx crash responses and dev server compiler crash overlays.
|
|
19
|
+
*/
|
|
20
|
+
export declare function checkTargetReachable(url: string, timeoutMs?: number): Promise<{
|
|
21
|
+
reachable: boolean;
|
|
22
|
+
error?: string;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* The build as one line: label, branch, commit and CI provider. A dirty
|
|
26
|
+
* tree shows next to the commit, so a re-run after an uncommitted fix
|
|
27
|
+
* visibly walks a different build.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* formatBuild({ git_sha: "90e2444…", git_dirty: true, worktree_hash: "3fa9c1d2e4b5" });
|
|
32
|
+
* // "90e2444 + uncommitted changes (3fa9c1…)"
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function formatBuild(build: BuildMetadata): string;
|
|
36
|
+
/**
|
|
37
|
+
* A run viewport as one line.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* formatViewport({ device: "desktop", width: 1280, height: 800, source: "persona-tags" });
|
|
42
|
+
* // "desktop 1280×800 (from persona tags)"
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function formatViewport(v: RunViewport): string;
|
|
46
|
+
export interface StartRunOptions {
|
|
47
|
+
target?: string;
|
|
48
|
+
build?: string;
|
|
49
|
+
env?: string;
|
|
50
|
+
json?: boolean;
|
|
51
|
+
check?: boolean;
|
|
52
|
+
walker?: string;
|
|
53
|
+
judge?: string;
|
|
54
|
+
matcher?: string;
|
|
55
|
+
}
|
|
56
|
+
export declare function startRun(scenarioSlugArg: string | undefined, opts: StartRunOptions): Promise<void>;
|