@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,87 @@
|
|
|
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>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { type RunStep } from "@iamu-dev/protocol";
|
|
2
|
+
/** Steps a run may record before the circuit breaker trips. */
|
|
3
|
+
export declare const DEFAULT_MAX_STEPS = 50;
|
|
4
|
+
/**
|
|
5
|
+
* The step limit to enforce: `val` (from `--max-steps`) when it is a
|
|
6
|
+
* positive integer, else `IAMU_MAX_STEPS`, else {@link DEFAULT_MAX_STEPS}.
|
|
7
|
+
*
|
|
8
|
+
* @param val - The raw `--max-steps` value, if any.
|
|
9
|
+
* @returns A positive step limit.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* parseMaxSteps("20"); // 20
|
|
14
|
+
* parseMaxSteps(undefined); // 50, unless IAMU_MAX_STEPS is set
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseMaxSteps(val?: string | number): number;
|
|
20
|
+
/** What {@link recordStep} records. */
|
|
21
|
+
export interface RecordStepInput {
|
|
22
|
+
projectRoot: string;
|
|
23
|
+
runId: string;
|
|
24
|
+
action: string;
|
|
25
|
+
note?: string | null;
|
|
26
|
+
/** Path of an existing screenshot to copy in; a missing file is an error. */
|
|
27
|
+
shot?: string | null;
|
|
28
|
+
url?: string | null;
|
|
29
|
+
surface?: string | null;
|
|
30
|
+
grounding?: string | null;
|
|
31
|
+
timestamp?: string;
|
|
32
|
+
maxSteps?: string | number;
|
|
33
|
+
extra?: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
/** What {@link recordStep} wrote. */
|
|
36
|
+
export interface RecordStepResult {
|
|
37
|
+
step: RunStep;
|
|
38
|
+
stepPath: string;
|
|
39
|
+
screenshotPath: string | null;
|
|
40
|
+
cancelled?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Record a single step into `<runDir>/steps/NNN.json`.
|
|
44
|
+
*
|
|
45
|
+
* The step number is reserved with an exclusive create (see
|
|
46
|
+
* {@link reserveStepFile}), so concurrent calls get distinct numbers
|
|
47
|
+
* instead of overwriting each other; the content is then written
|
|
48
|
+
* atomically (temp file + rename). A `shot` is copied into
|
|
49
|
+
* `<runDir>/screenshots/step-N.png`; a `shot` that is not an existing
|
|
50
|
+
* file is an error — a step never points at a screenshot that is not there.
|
|
51
|
+
*
|
|
52
|
+
* @param input - The run, the action, and optional evidence.
|
|
53
|
+
* @returns The validated step, its file, and the copied screenshot path.
|
|
54
|
+
* @throws Error when the run is missing, `shot` is not a file, or the step limit is reached.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const { step } = await recordStep({
|
|
59
|
+
* projectRoot,
|
|
60
|
+
* runId,
|
|
61
|
+
* action: "Clicked checkout",
|
|
62
|
+
* shot: "./shot.png",
|
|
63
|
+
* });
|
|
64
|
+
* console.log(step.step_number);
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
export declare function recordStep(input: RecordStepInput): Promise<RecordStepResult>;
|
|
70
|
+
/** Options for `iamu step`. */
|
|
71
|
+
export interface StepOptions {
|
|
72
|
+
run?: string;
|
|
73
|
+
action: string;
|
|
74
|
+
note?: string;
|
|
75
|
+
shot?: string;
|
|
76
|
+
url?: string;
|
|
77
|
+
surface?: string;
|
|
78
|
+
grounding?: string;
|
|
79
|
+
maxSteps?: string | number;
|
|
80
|
+
json?: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* `iamu step [run-id]` — record one step via {@link recordStep} and
|
|
84
|
+
* print it (one JSON document with `--json`). Errors set exit code 1.
|
|
85
|
+
*
|
|
86
|
+
* @param runArg - Positional run ID; falls back to `opts.run`.
|
|
87
|
+
* @param opts - Parsed CLI options.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* await stepCommand("run-123", { action: "Clicked checkout", json: true });
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
export declare function stepCommand(runArg: string | undefined, opts: StepOptions): Promise<void>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SummaryOptions {
|
|
2
|
+
run?: string;
|
|
3
|
+
worked?: string | string[];
|
|
4
|
+
question?: string | string[];
|
|
5
|
+
model?: string;
|
|
6
|
+
/** The walk could not start as set up: what was missing, or `false` to clear. */
|
|
7
|
+
blocked?: string | false;
|
|
8
|
+
file?: string;
|
|
9
|
+
json?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface SummaryData {
|
|
12
|
+
what_worked: string[];
|
|
13
|
+
open_questions: string[];
|
|
14
|
+
model?: string;
|
|
15
|
+
/** Set when the walk could not start as set up (`--blocked`). */
|
|
16
|
+
blocked?: {
|
|
17
|
+
reason: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare function summaryCommand(runIdArg: string | undefined, opts: SummaryOptions): Promise<void>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface TriageOptions {
|
|
2
|
+
status: string;
|
|
3
|
+
/** Why — the triager's words. Required when dismissing. */
|
|
4
|
+
note?: string;
|
|
5
|
+
/** Dismiss reason: not_relevant | walker_error | duplicate. */
|
|
6
|
+
reason?: string;
|
|
7
|
+
/** Guidance rule text; defaults to "Don't report: <title>". */
|
|
8
|
+
rule?: string;
|
|
9
|
+
/** Where the guidance rule applies. Default: project. */
|
|
10
|
+
scope?: string;
|
|
11
|
+
/** `false` (`--no-guidance`): dismiss without writing a guidance rule. */
|
|
12
|
+
guidance?: boolean;
|
|
13
|
+
json?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Set the triage status of one or more findings. Dismissing as
|
|
17
|
+
* `not_relevant` or `walker_error` also writes a tester guidance rule
|
|
18
|
+
* (`iamu/guidance/<slug>.md`) so later walks stop reporting the same
|
|
19
|
+
* thing; several findings dismissed together share one rule.
|
|
20
|
+
*/
|
|
21
|
+
export declare function triage(refs: string[], opts: TriageOptions): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type EntityType } from "@iamu-dev/protocol";
|
|
2
|
+
import type { ZodSchema } from "zod";
|
|
3
|
+
export declare const schemaByType: Record<EntityType, ZodSchema>;
|
|
4
|
+
export declare function validate(filePath: string | undefined, opts: {
|
|
5
|
+
run?: string;
|
|
6
|
+
all?: boolean;
|
|
7
|
+
type?: string;
|
|
8
|
+
json?: boolean;
|
|
9
|
+
fix?: boolean;
|
|
10
|
+
dryRun?: boolean;
|
|
11
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function openBrowserResults(projectRoot: string, runId?: string): Promise<void>;
|
|
2
|
+
export interface PromptViewResultsOptions {
|
|
3
|
+
prompt?: boolean;
|
|
4
|
+
yes?: boolean;
|
|
5
|
+
view?: boolean;
|
|
6
|
+
json?: boolean;
|
|
7
|
+
runId?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function promptViewResults(projectRoot: string, opts?: PromptViewResultsOptions): Promise<void>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* \@iamu-dev/iamu
|
|
3
|
+
*
|
|
4
|
+
* Scenario-driven development — test your product as realistic personas.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
export { registerAllCommands } from "./commands/register.js";
|
|
9
|
+
export { setupProcessHandlers, registerSigintCleanup } from "./ui/panic.js";
|