@iamu-dev/iamu 0.2.0-beta.10 → 0.2.0-beta.11
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/bin.js +872 -521
- package/dist/commands/live-run-client.d.ts +127 -0
- package/dist/commands/step.d.ts +1 -0
- package/dist/index.js +938 -587
- package/dist/templates/prompts/walk.md +2 -0
- package/dist/templates/skills/iamu-run.md +13 -1
- package/dist/templates/skills/iamu-setup.md +219 -153
- package/package.json +3 -3
|
@@ -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>;
|