anlyx 0.1.3 → 0.1.6-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/README.md CHANGED
@@ -1,13 +1,64 @@
1
- # anlyx
1
+ # Anlyx
2
2
 
3
- Command line interface for Anlyx.
3
+ CLI for Anlyx Project JSON validation, import, and local viewing.
4
4
 
5
- Published usage:
5
+ Anlyx renders `anlyx.project.json` in a local 4777 viewer:
6
+
7
+ ```txt
8
+ Pages -> Features -> Requests -> Flows -> Architecture -> Evidence
9
+ ```
10
+
11
+ The current primary path is Project JSON first. New setups should start from
12
+ `anlyx.project.json`.
13
+
14
+ ## Quick Start
15
+
16
+ ```bash
17
+ npm install -D anlyx@latest
18
+ npx anlyx prompt init
19
+ npx anlyx validate anlyx.project.json
20
+ npx anlyx import anlyx.project.json
21
+ npx anlyx dev
22
+ ```
23
+
24
+ Then open:
25
+
26
+ ```txt
27
+ http://localhost:4777
28
+ ```
29
+
30
+ ## What It Shows
31
+
32
+ - Pages and page groups authored by the user's AI Agent
33
+ - Features and requests connected to each page
34
+ - Flow summaries from frontend/request/API through backend/data/result layers
35
+ - Architecture Map from agent-authored nodes and edges
36
+ - Evidence labels for observed, measured, source-matched, agent-inferred, manual, not-proven, and unknown claims
37
+ - Timing only when `measurements` exist
38
+ - Raw JSON inspection for `anlyx.project.json`
39
+
40
+ ## Supported
41
+
42
+ Primary:
43
+
44
+ - `anlyx.project.json`
45
+ - `.anlyx/project/*.json` split project files
46
+ - `npx anlyx validate <file>`
47
+ - `npx anlyx import <file>`
48
+ - `npx anlyx dev` for the local viewer
49
+
50
+ ## Commands
6
51
 
7
52
  ```bash
8
53
  npx anlyx init
9
- npx anlyx scan
54
+ npx anlyx prompt init
55
+ npx anlyx prompt refresh
56
+ npx anlyx validate anlyx.project.json
57
+ npx anlyx import anlyx.project.json
10
58
  npx anlyx dev
59
+ npx anlyx --help
11
60
  ```
12
61
 
13
- See the root Anlyx README for v0.1 usage and scope.
62
+ See the full documentation on GitHub:
63
+
64
+ https://github.com/suhannoh/anlyx
@@ -1,6 +1,6 @@
1
- import { type ScanResult } from "@anlyx/core";
1
+ import type { IncomingMessage, ServerResponse } from "node:http";
2
+ import { type ProjectData, type ProjectValidationReport, type ScanResult } from "@anlyx/core";
2
3
  import { loadConfig } from "./config-loader.js";
3
- import { runScanCommand } from "./scan-command.js";
4
4
  export type DevCommandOptions = {
5
5
  cwd?: string;
6
6
  configPath?: string;
@@ -12,17 +12,18 @@ export type DevCommandOptions = {
12
12
  export type DevCommandResult = {
13
13
  url: string;
14
14
  port: number;
15
+ projectDataPath: string;
15
16
  reportDataPath: string;
16
17
  mode: "inject" | "overlay" | "viewer";
17
18
  frontendUrl?: string;
18
19
  scriptTag?: string;
19
20
  frontendStarted: boolean;
20
- scanRan: boolean;
21
21
  };
22
22
  export type DevCommandDependencies = {
23
23
  loadConfig?: typeof loadConfig;
24
+ readProjectData?: (path: string) => Promise<ProjectData>;
24
25
  readReportData?: (path: string) => Promise<ScanResult>;
25
- runScanCommand?: typeof runScanCommand;
26
+ readValidationReport?: (path: string) => Promise<ProjectValidationReport | undefined>;
26
27
  createLocalUiServer?: (options: LocalUiServerOptions) => Promise<LocalUiServer>;
27
28
  isFrontendReachable?: (url: string) => Promise<boolean>;
28
29
  startFrontendDevServer?: (options: StartFrontendDevServerOptions) => FrontendDevServerProcess;
@@ -30,7 +31,9 @@ export type DevCommandDependencies = {
30
31
  };
31
32
  export type LocalUiServerOptions = {
32
33
  port: number;
33
- reportData: ScanResult;
34
+ projectData?: ProjectData;
35
+ validationReport?: ProjectValidationReport;
36
+ reportData?: ScanResult;
34
37
  viewerRoot: string;
35
38
  frontendBaseUrl: string;
36
39
  mode: "inject" | "overlay" | "viewer";
@@ -48,11 +51,19 @@ export type FrontendDevServerProcess = {
48
51
  };
49
52
  export declare function runDevCommand(options?: DevCommandOptions): Promise<DevCommandResult>;
50
53
  export declare function closeActiveLocalUiServers(): Promise<void>;
54
+ export declare function readProjectData(path: string): Promise<ProjectData>;
51
55
  export declare function readReportData(path: string): Promise<ScanResult>;
56
+ export declare function readValidationReport(path: string): Promise<ProjectValidationReport | undefined>;
52
57
  export declare function createLocalUiServer(options: LocalUiServerOptions): Promise<LocalUiServer>;
53
58
  export declare function openBrowser(url: string): Promise<void>;
54
59
  export declare function isFrontendReachable(url: string): Promise<boolean>;
55
60
  export declare function startFrontendDevServer(options: StartFrontendDevServerOptions): FrontendDevServerProcess;
61
+ export declare function createLiveEventRuntime(reportData: ScanResult): {
62
+ openStream(request: IncomingMessage, response: ServerResponse): void;
63
+ recordBrowserRequest(request: IncomingMessage, response: ServerResponse): Promise<void>;
64
+ recordPageContext(request: IncomingMessage, response: ServerResponse): Promise<void>;
65
+ recordBackendSpans(request: IncomingMessage, response: ServerResponse): Promise<void>;
66
+ };
56
67
  export declare function buildProxyTargetUrl(frontendBaseUrl: string, requestUrl: string): string;
57
68
  export declare function injectOverlayScript(html: string): string;
58
69
  export declare function getOverlayScriptTag(serverUrl: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"dev-command.d.ts","sourceRoot":"","sources":["../src/dev-command.ts"],"names":[],"mappings":"AAOA,OAAO,EAAgD,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAG5F,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAInD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,sBAAsB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MA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