@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,95 +0,0 @@
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
- }
41
- /**
42
- * Record a single step into `<runDir>/steps/NNN.json`.
43
- *
44
- * The step number is reserved with an exclusive create (see
45
- * {@link reserveStepFile}), so concurrent calls get distinct numbers
46
- * instead of overwriting each other; the content is then written
47
- * atomically (temp file + rename). A `shot` is copied into
48
- * `<runDir>/screenshots/step-N.png`; a `shot` that is not an existing
49
- * file is an error — a step never points at a screenshot that is not there.
50
- *
51
- * @param input - The run, the action, and optional evidence.
52
- * @returns The validated step, its file, and the copied screenshot path.
53
- * @throws Error when the run is missing, `shot` is not a file, or the step limit is reached.
54
- *
55
- * @example
56
- * ```ts
57
- * const { step } = await recordStep({
58
- * projectRoot,
59
- * runId,
60
- * action: "Clicked checkout",
61
- * shot: "./shot.png",
62
- * });
63
- * console.log(step.step_number);
64
- * ```
65
- *
66
- * @public
67
- */
68
- export declare function recordStep(input: RecordStepInput): Promise<RecordStepResult>;
69
- /** Options for `iamu step`. */
70
- export interface StepOptions {
71
- run?: string;
72
- action: string;
73
- note?: string;
74
- shot?: string;
75
- url?: string;
76
- surface?: string;
77
- grounding?: string;
78
- maxSteps?: string | number;
79
- json?: boolean;
80
- }
81
- /**
82
- * `iamu step [run-id]` — record one step via {@link recordStep} and
83
- * print it (one JSON document with `--json`). Errors set exit code 1.
84
- *
85
- * @param runArg - Positional run ID; falls back to `opts.run`.
86
- * @param opts - Parsed CLI options.
87
- *
88
- * @example
89
- * ```ts
90
- * await stepCommand("run-123", { action: "Clicked checkout", json: true });
91
- * ```
92
- *
93
- * @public
94
- */
95
- export declare function stepCommand(runArg: string | undefined, opts: StepOptions): Promise<void>;
@@ -1,6 +0,0 @@
1
- export declare function sync(opts?: {
2
- status?: boolean;
3
- json?: boolean;
4
- keepMine?: boolean;
5
- confirmDeletes?: boolean;
6
- }): Promise<void>;
@@ -1,21 +0,0 @@
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>;
@@ -1,4 +0,0 @@
1
- export interface UpdateOptions {
2
- host?: string;
3
- }
4
- export declare function update(opts?: UpdateOptions): Promise<void>;
@@ -1,8 +0,0 @@
1
- export declare function validate(filePath: string | undefined, opts: {
2
- run?: string;
3
- all?: boolean;
4
- type?: string;
5
- json?: boolean;
6
- fix?: boolean;
7
- dryRun?: boolean;
8
- }): Promise<void>;
@@ -1,9 +0,0 @@
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 DELETED
@@ -1,9 +0,0 @@
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";
@@ -1,42 +0,0 @@
1
- /**
2
- * Fatal-error reporting for the sync MCP server entry point.
3
- *
4
- * stdout is the MCP stdio transport, so a diagnostic printed there would
5
- * corrupt the protocol stream. Everything here writes to stderr only.
6
- */
7
- /** Side effects a fatal report needs, injectable so it can be tested. */
8
- export interface FatalDeps {
9
- /** Write a diagnostic line — stderr, never stdout. */
10
- writeErr: (text: string) => void;
11
- /** Terminate the process with the given exit code. */
12
- exit: (code: number) => void;
13
- }
14
- /**
15
- * Describe a fatal error, with its stack when there is one.
16
- *
17
- * @example
18
- * ```ts
19
- * formatFatal("uncaughtException", new Error("boom"));
20
- * // "iamu sync-server: fatal uncaughtException: boom\n…stack…\n"
21
- * ```
22
- */
23
- export declare function formatFatal(kind: string, err: unknown): string;
24
- /**
25
- * Report a fatal error on stderr and exit non-zero.
26
- *
27
- * @example
28
- * ```ts
29
- * handleFatal("uncaughtException", err, deps);
30
- * ```
31
- */
32
- export declare function handleFatal(kind: string, err: unknown, deps?: FatalDeps): void;
33
- /**
34
- * Install `uncaughtException` / `unhandledRejection` handlers that log
35
- * to stderr before exiting, instead of dying silently with code 1.
36
- *
37
- * @example
38
- * ```ts
39
- * installFatalHandlers();
40
- * ```
41
- */
42
- export declare function installFatalHandlers(deps?: FatalDeps): void;
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- /**
3
- * Build the `iamu-sync` MCP server: push, pull, auth status, and
4
- * background change polling over the local `iamu/` project tree.
5
- *
6
- * @example
7
- * ```ts
8
- * const server = createSyncServer();
9
- * await server.connect(new StdioServerTransport());
10
- * ```
11
- */
12
- export declare function createSyncServer(): McpServer;
@@ -1,10 +0,0 @@
1
- /**
2
- * Resolves the root directory containing `templates/`.
3
- * In development (source/vitest): import.meta.url is in `src/` or `src/commands/`,
4
- * so templates are located at `src/templates`.
5
- * In production bundle (tsup): import.meta.url is in `dist/`,
6
- * and copy-assets.mjs copies templates to `dist/templates`.
7
- */
8
- export declare function getTemplatesRoot(): string;
9
- export declare function getTemplateDir(subdir: "skills" | "prompts"): string;
10
- export declare function getTemplateFile(subdir: "skills" | "prompts", filename: string): string;
@@ -1,3 +0,0 @@
1
- import type { JourneyDiff } from "@iamu-dev/local-store";
2
- export declare function formatJourneyDiffTerminal(diff: JourneyDiff): string;
3
- export declare function printJourneyDiff(diff: JourneyDiff): void;
package/dist/ui/json.d.ts DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * Pick specified keys from an array of records or a single record.
3
- * Supports comma-separated field list: e.g. "slug,name,role".
4
- * If fields is boolean true or undefined/empty, returns target as-is.
5
- */
6
- export declare function filterJsonFields<T extends Record<string, unknown>>(target: T[] | T, fields?: string | boolean): unknown;
@@ -1,5 +0,0 @@
1
- /**
2
- * Standard verbosity and quiet mode helpers driven by IAMU_QUIET and IAMU_VERBOSE environment variables.
3
- */
4
- export declare function isQuiet(): boolean;
5
- export declare function isVerbose(): boolean;
@@ -1,11 +0,0 @@
1
- type SigintCleanup = () => Promise<void> | void;
2
- /**
3
- * Registers an asynchronous cleanup handler to execute on SIGINT (e.g. closing an HTTP server).
4
- * Returns an unregister function.
5
- */
6
- export declare function registerSigintCleanup(handler: SigintCleanup): () => void;
7
- /**
8
- * Registers global process handlers for graceful shutdown and top-level error boundaries.
9
- */
10
- export declare function setupProcessHandlers(): void;
11
- export {};
@@ -1,11 +0,0 @@
1
- export declare const symbols: {
2
- success: string;
3
- error: string;
4
- pending: string;
5
- warning: string;
6
- modified: string;
7
- add: string;
8
- info: string;
9
- dot: string;
10
- question: string;
11
- };
@@ -1,20 +0,0 @@
1
- export declare function stripAnsi(str: string): string;
2
- export declare function visualLength(str: string): number;
3
- export declare function padRight(str: string, targetWidth: number): string;
4
- export declare function truncate(str: string, maxWidth: number): string;
5
- export interface TableColumn<T> {
6
- header: string;
7
- value: (item: T) => string;
8
- minWidth?: number;
9
- maxWidth?: number;
10
- }
11
- export interface FormatTableOptions {
12
- tty?: boolean;
13
- }
14
- /**
15
- * Formats data into a cleanly aligned table with dynamically calculated column widths.
16
- * Automatically accounts for ANSI color sequences in length calculations.
17
- * When output is piped (!process.stdout.isTTY), automatically emits machine-readable
18
- * Tab-Separated Values (TSV) without ANSI escapes, borders, or text truncation.
19
- */
20
- export declare function formatTable<T>(items: T[], columns: TableColumn<T>[], options?: FormatTableOptions): string[];
@@ -1,6 +0,0 @@
1
- export declare function isSemverGreater(latest: string, current: string): boolean;
2
- /**
3
- * Non-blocking, cached check against npm registry for CLI updates.
4
- */
5
- export declare function checkForUpdate(currentVersion: string): Promise<string | null>;
6
- export declare function printUpdateNotice(currentVersion: string, latestVersion: string): void;
@@ -1,49 +0,0 @@
1
- /** The build block's view of the working tree. */
2
- export interface WorktreeState {
3
- git_dirty: boolean;
4
- /** Only when dirty: 12 lowercase hex characters. */
5
- worktree_hash?: string;
6
- }
7
- /** Answers the working-tree question for a project root. */
8
- export type WorktreeDetector = (projectRoot: string) => WorktreeState | undefined;
9
- /** Untracked files hashed at most; past this the count still counts. */
10
- export declare const MAX_UNTRACKED_HASHED = 2000;
11
- /**
12
- * Whether the working tree has changes outside `iamu/`, and their
13
- * fingerprint.
14
- *
15
- * Hash recipe (sha256, first 12 hex characters):
16
- * 1. the bytes of `git diff HEAD --binary -- . ':(exclude)<iamu>'`, run
17
- * from the repository root with diff settings pinned;
18
- * 2. then, for each untracked non-ignored file outside `iamu/` sorted by
19
- * path (bytewise, at most {@link MAX_UNTRACKED_HASHED}):
20
- * `<path>\0<sha256 of content>\n`, and past the cap `+<count>\n`.
21
- *
22
- * @example
23
- * ```ts
24
- * detectWorktreeState("/work/shop");
25
- * // { git_dirty: true, worktree_hash: "3fa9c1d2e4b5" }
26
- * ```
27
- */
28
- export declare function detectWorktreeState(projectRoot: string, iamuDirName?: string): WorktreeState | undefined;
29
- /**
30
- * Whether the product's code changed between `start-run` and `complete`.
31
- * The build block's fingerprint is taken at start; an edit (or commit) made
32
- * while the walker was out means the run's findings may mix two versions,
33
- * and the build it lands in describes only the first.
34
- *
35
- * @param start - The run's recorded build block (`walkthrough.json`).
36
- * @param now - The working tree as it is now.
37
- * @returns A one-line warning, or null when nothing changed or either side
38
- * is unknown.
39
- *
40
- * @example
41
- * ```ts
42
- * codeChangedWarning({ git_dirty: false }, { git_dirty: true, worktree_hash: "a1b2c3d4e5f6" });
43
- * // "the product's code changed during the walk …"
44
- * ```
45
- */
46
- export declare function codeChangedWarning(start: {
47
- git_dirty?: boolean;
48
- worktree_hash?: string;
49
- } | undefined, now: WorktreeState | undefined): string | null;