@iamu-dev/iamu 0.0.0-stage → 0.2.0-beta.1

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 (80) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +103 -2
  3. package/dist/adapters/claude-plugin.d.ts +13 -0
  4. package/dist/adapters/registry.d.ts +6 -0
  5. package/dist/adapters/types.d.ts +19 -0
  6. package/dist/bin.d.ts +2 -0
  7. package/dist/bin.js +21005 -0
  8. package/dist/build-info.d.ts +53 -0
  9. package/dist/cloud-url.d.ts +19 -0
  10. package/dist/commands/auth-http.d.ts +37 -0
  11. package/dist/commands/auth-project-choice.d.ts +74 -0
  12. package/dist/commands/auth-token-input.d.ts +21 -0
  13. package/dist/commands/auth.d.ts +84 -0
  14. package/dist/commands/browse-actions.d.ts +56 -0
  15. package/dist/commands/browse-driver.d.ts +117 -0
  16. package/dist/commands/browse.d.ts +156 -0
  17. package/dist/commands/cloud-push.d.ts +27 -0
  18. package/dist/commands/complete.d.ts +131 -0
  19. package/dist/commands/completion.d.ts +2 -0
  20. package/dist/commands/context.d.ts +58 -0
  21. package/dist/commands/credentials.d.ts +144 -0
  22. package/dist/commands/diff-filter.d.ts +11 -0
  23. package/dist/commands/doctor.d.ts +24 -0
  24. package/dist/commands/evaluate.d.ts +30 -0
  25. package/dist/commands/findings.d.ts +7 -0
  26. package/dist/commands/init.d.ts +9 -0
  27. package/dist/commands/instructions-walk.d.ts +59 -0
  28. package/dist/commands/list.d.ts +5 -0
  29. package/dist/commands/match.d.ts +12 -0
  30. package/dist/commands/mcp-config.d.ts +10 -0
  31. package/dist/commands/new-entity.d.ts +15 -0
  32. package/dist/commands/new-finding.d.ts +19 -0
  33. package/dist/commands/open.d.ts +8 -0
  34. package/dist/commands/port.d.ts +17 -0
  35. package/dist/commands/prune.d.ts +11 -0
  36. package/dist/commands/pull.d.ts +5 -0
  37. package/dist/commands/register-cloud.d.ts +5 -0
  38. package/dist/commands/register-findings.d.ts +5 -0
  39. package/dist/commands/register-project.d.ts +5 -0
  40. package/dist/commands/register-walkthrough.d.ts +5 -0
  41. package/dist/commands/register.d.ts +10 -0
  42. package/dist/commands/report.d.ts +3 -0
  43. package/dist/commands/serve.d.ts +11 -0
  44. package/dist/commands/skills.d.ts +34 -0
  45. package/dist/commands/start-run.d.ts +49 -0
  46. package/dist/commands/status.d.ts +3 -0
  47. package/dist/commands/step-numbering.d.ts +87 -0
  48. package/dist/commands/step.d.ts +95 -0
  49. package/dist/commands/sync.d.ts +6 -0
  50. package/dist/commands/triage.d.ts +21 -0
  51. package/dist/commands/update.d.ts +4 -0
  52. package/dist/commands/validate.d.ts +8 -0
  53. package/dist/commands/view-results.d.ts +9 -0
  54. package/dist/index.d.ts +9 -0
  55. package/dist/index.js +20852 -0
  56. package/dist/sync-mcp/fatal.d.ts +42 -0
  57. package/dist/sync-mcp/server.d.ts +1 -0
  58. package/dist/sync-mcp/tools.d.ts +12 -0
  59. package/dist/templates/prompts/combine.md +69 -0
  60. package/dist/templates/prompts/complete.md +132 -0
  61. package/dist/templates/prompts/evaluate.md +64 -0
  62. package/dist/templates/prompts/outline.md +54 -0
  63. package/dist/templates/prompts/persona.md +40 -0
  64. package/dist/templates/prompts/walk.md +167 -0
  65. package/dist/templates/skills/iamu-findings.md +228 -0
  66. package/dist/templates/skills/iamu-new.md +206 -0
  67. package/dist/templates/skills/iamu-propose.md +124 -0
  68. package/dist/templates/skills/iamu-run.md +400 -0
  69. package/dist/templates/skills/iamu-setup.md +192 -0
  70. package/dist/templates/skills/iamu-status.md +64 -0
  71. package/dist/templates.d.ts +10 -0
  72. package/dist/ui/journey-diff.d.ts +3 -0
  73. package/dist/ui/json.d.ts +6 -0
  74. package/dist/ui/logger.d.ts +5 -0
  75. package/dist/ui/panic.d.ts +11 -0
  76. package/dist/ui/symbols.d.ts +11 -0
  77. package/dist/ui/table.d.ts +20 -0
  78. package/dist/ui/update-check.d.ts +6 -0
  79. package/dist/worktree-state.d.ts +49 -0
  80. package/package.json +69 -3
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: iamu-status
3
+ description: Check project testing status, list installed personas, scenarios, outlines, capabilities, or review walkthrough coverage and findings. Use when asked "what personas do we have?", "what scenarios exist?", "what is the test status?", "list personas", "what should we test next?", or to inspect iamu assets.
4
+ generatedBy: __IAMU_VERSION__
5
+ ---
6
+
7
+ You are the project's scenario-testing librarian. Your job is to give concise, structured overviews of iamu assets and testing status without dumping raw file bodies.
8
+
9
+ $ARGUMENTS
10
+
11
+ ## Instructions
12
+
13
+ ### 1. Always use CLI commands for inspection
14
+
15
+ - **List personas:** `iamu list personas` (or `--json`)
16
+ - **List scenarios:** `iamu list scenarios` (or `--json`)
17
+ - **List capabilities:** `iamu list capabilities`
18
+ - **List outlines:** `iamu list outlines`
19
+ - **List findings:** `iamu findings`
20
+ - **Project state & run status:** `iamu status`
21
+
22
+ Do NOT use `find`, `grep`, or `cat` to dump raw `.md` files in `iamu/`. The CLI outputs clean, validated data.
23
+
24
+ ### 2. Format entity responses as compact tables
25
+
26
+ When the user asks for personas, scenarios, or findings, respond with a scannable Markdown table. Never dump full psychological profiles, vocabulary lists, or raw frontmatter unless the user explicitly asks for deep detail on one entity.
27
+
28
+ **Personas:**
29
+ | Slug | Name | Role | Status |
30
+ |---|---|---|---|
31
+ | `elin-dahl` | Elin Dahl | Architect & first-time house owner in Falun | active |
32
+
33
+ **Scenarios:**
34
+ | Slug | Persona | Outline | Status / Target |
35
+ |---|---|---|---|
36
+ | `replacing-windows` | `elin-dahl` | `measure-and-order` | ready |
37
+
38
+ **Findings:**
39
+ | # | Severity | Type | Finding | Status |
40
+ |---|---|---|---|---|
41
+ | 1 | CRITICAL | hinders | Submit fails opaquely on empty field | open |
42
+
43
+ ### 3. Ignore internal templates
44
+
45
+ The directory `iamu/.prompts/` contains internal prompt templates (`persona.md`, `outline.md`, etc.). These are NOT project entities. Never list them or explain them to the user.
46
+
47
+ ### 4. Cloud line
48
+
49
+ For a project-status question, add one line on the cloud from `iamu status --json` (`mode`, `sync`, `requests`) and `iamu auth status --json` (`authenticated`):
50
+
51
+ - **Linked** → `Cloud: linked — <url from iamu open --print>`, then only what needs action: unpushed changes (`sync.pending_new` + `sync.pending_updates` + `walkthroughs.pending`, and `sync.local_deletions.count`) → `iamu sync`; `requests.open` above zero → `<N> team requests — iamu-findings`.
52
+ - **Linked, no credentials** → `Cloud: linked, but this machine has no credentials — iamu auth login.`
53
+ - **Local-only** → `Cloud: local-only.` Nothing more; no upgrade pitch.
54
+
55
+ ### 5. Provide clear next steps
56
+
57
+ Conclude with one concise action prompt:
58
+ - To run a scenario: `iamu-run <scenario-slug>`
59
+ - To propose new personas or scenarios: `iamu-propose`
60
+ - To draft a persona or scenario directly: `iamu-new`
61
+ - To review open findings or team requests: `iamu-findings`
62
+ - To inspect reports: `iamu report`, or `iamu open` for the cloud dashboard (linked projects)
63
+ - To share unpushed work with the team: `iamu sync` (linked projects)
64
+
@@ -0,0 +1,10 @@
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;
@@ -0,0 +1,3 @@
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;
@@ -0,0 +1,6 @@
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;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,11 @@
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 {};
@@ -0,0 +1,11 @@
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
+ };
@@ -0,0 +1,20 @@
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[];
@@ -0,0 +1,6 @@
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;
@@ -0,0 +1,49 @@
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;
package/package.json CHANGED
@@ -1,6 +1,72 @@
1
1
  {
2
2
  "name": "@iamu-dev/iamu",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0-beta.1",
4
+ "type": "module",
5
+ "description": "Test your product as realistic personas — scenario-driven development CLI",
6
+ "license": "UNLICENSED",
7
+ "author": "Iamu <hello@iamu.dev>",
8
+ "homepage": "https://iamu.dev",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/iamu-dev/iamu.git",
12
+ "directory": "apps/cli"
13
+ },
14
+ "bugs": "https://github.com/iamu-dev/iamu/issues",
15
+ "keywords": [
16
+ "iamu",
17
+ "scenario-testing",
18
+ "persona-testing",
19
+ "walkthrough",
20
+ "ux-testing",
21
+ "devex",
22
+ "claude-code"
23
+ ],
24
+ "bin": {
25
+ "iamu": "./dist/bin.js"
26
+ },
27
+ "sideEffects": true,
28
+ "files": [
29
+ "dist",
30
+ "README.md",
31
+ "LICENSE"
32
+ ],
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "import": "./dist/index.js"
37
+ }
38
+ },
39
+ "publishConfig": {
40
+ "access": "public",
41
+ "tag": "beta"
42
+ },
43
+ "engines": {
44
+ "node": ">=22"
45
+ },
46
+ "dependencies": {
47
+ "@clack/prompts": "^1.8.1",
48
+ "@modelcontextprotocol/sdk": "^1.26.0",
49
+ "chalk": "^5.6.2",
50
+ "commander": "^14.0.3",
51
+ "playwright-core": "^1.58.2",
52
+ "zod": "^3.25.0"
53
+ },
54
+ "devDependencies": {
55
+ "@types/node": "^22.0.0",
56
+ "@vitest/coverage-v8": "^4.1.11",
57
+ "tsup": "^8.5.1",
58
+ "typescript": "^5.8.0",
59
+ "vitest": "^4.1.11",
60
+ "@iamu-dev/protocol": "0.1.0",
61
+ "@iamu-dev/local-store": "0.1.0",
62
+ "@iamu/tsconfig": "0.1.0"
63
+ },
64
+ "scripts": {
65
+ "build": "tsup && tsc -b tsconfig.build.json --emitDeclarationOnly && node scripts/copy-assets.mjs",
66
+ "clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true }); fs.rmSync('tsconfig.tsbuildinfo', { force: true }); fs.rmSync('tsconfig.build.tsbuildinfo', { force: true })\"",
67
+ "typecheck": "tsc --noEmit",
68
+ "test": "vitest run",
69
+ "test:coverage": "vitest run --coverage",
70
+ "pack:dry-run": "npm pack --dry-run"
71
+ }
6
72
  }