anlyx 0.1.2 → 0.1.5

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,61 @@
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
18
+ npx anlyx validate anlyx.project.json
19
+ npx anlyx import anlyx.project.json
20
+ npx anlyx dev
21
+ ```
22
+
23
+ Then open:
24
+
25
+ ```txt
26
+ http://localhost:4777
27
+ ```
28
+
29
+ ## What It Shows
30
+
31
+ - Pages and page groups authored by the user's AI Agent
32
+ - Features and requests connected to each page
33
+ - Flow summaries from frontend/request/API through backend/data/result layers
34
+ - Architecture Map from agent-authored nodes and edges
35
+ - Evidence labels for observed, measured, source-matched, agent-inferred, manual, not-proven, and unknown claims
36
+ - Timing only when `measurements` exist
37
+ - Raw JSON inspection for `anlyx.project.json`
38
+
39
+ ## Supported
40
+
41
+ Primary:
42
+
43
+ - `anlyx.project.json`
44
+ - `.anlyx/project/*.json` split project files
45
+ - `npx anlyx validate <file>`
46
+ - `npx anlyx import <file>`
47
+ - `npx anlyx dev` for the local viewer
48
+
49
+ ## Commands
6
50
 
7
51
  ```bash
8
52
  npx anlyx init
9
- npx anlyx scan
53
+ npx anlyx validate anlyx.project.json
54
+ npx anlyx import anlyx.project.json
10
55
  npx anlyx dev
56
+ npx anlyx --help
11
57
  ```
12
58
 
13
- See the root Anlyx README for v0.1 usage and scope.
59
+ See the full documentation on GitHub:
60
+
61
+ https://github.com/suhannoh/anlyx
@@ -1,4 +1,5 @@
1
- import { type ScanResult } from "@anlyx/core";
1
+ import type { IncomingMessage, ServerResponse } from "node:http";
2
+ import { type ProjectData, type ScanResult } from "@anlyx/core";
2
3
  import { loadConfig } from "./config-loader.js";
3
4
  export type DevCommandOptions = {
4
5
  cwd?: string;
@@ -11,25 +12,57 @@ export type DevCommandOptions = {
11
12
  export type DevCommandResult = {
12
13
  url: string;
13
14
  port: number;
15
+ projectDataPath: string;
14
16
  reportDataPath: string;
17
+ mode: "inject" | "overlay" | "viewer";
18
+ frontendUrl?: string;
19
+ scriptTag?: string;
20
+ frontendStarted: boolean;
15
21
  };
16
22
  export type DevCommandDependencies = {
17
23
  loadConfig?: typeof loadConfig;
24
+ readProjectData?: (path: string) => Promise<ProjectData>;
18
25
  readReportData?: (path: string) => Promise<ScanResult>;
19
26
  createLocalUiServer?: (options: LocalUiServerOptions) => Promise<LocalUiServer>;
27
+ isFrontendReachable?: (url: string) => Promise<boolean>;
28
+ startFrontendDevServer?: (options: StartFrontendDevServerOptions) => FrontendDevServerProcess;
20
29
  openBrowser?: (url: string) => Promise<void> | void;
21
30
  };
22
31
  export type LocalUiServerOptions = {
23
32
  port: number;
24
- reportData: ScanResult;
33
+ projectData?: ProjectData;
34
+ reportData?: ScanResult;
25
35
  viewerRoot: string;
36
+ frontendBaseUrl: string;
37
+ mode: "inject" | "overlay" | "viewer";
26
38
  };
27
39
  export type LocalUiServer = {
28
40
  url: string;
29
41
  close?: () => Promise<void> | void;
30
42
  };
43
+ export type StartFrontendDevServerOptions = {
44
+ command: string;
45
+ cwd: string;
46
+ };
47
+ export type FrontendDevServerProcess = {
48
+ stop?: () => Promise<void> | void;
49
+ };
31
50
  export declare function runDevCommand(options?: DevCommandOptions): Promise<DevCommandResult>;
51
+ export declare function closeActiveLocalUiServers(): Promise<void>;
52
+ export declare function readProjectData(path: string): Promise<ProjectData>;
32
53
  export declare function readReportData(path: string): Promise<ScanResult>;
33
54
  export declare function createLocalUiServer(options: LocalUiServerOptions): Promise<LocalUiServer>;
34
55
  export declare function openBrowser(url: string): Promise<void>;
56
+ export declare function isFrontendReachable(url: string): Promise<boolean>;
57
+ export declare function startFrontendDevServer(options: StartFrontendDevServerOptions): FrontendDevServerProcess;
58
+ export declare function createLiveEventRuntime(reportData: ScanResult): {
59
+ openStream(request: IncomingMessage, response: ServerResponse): void;
60
+ recordBrowserRequest(request: IncomingMessage, response: ServerResponse): Promise<void>;
61
+ recordPageContext(request: IncomingMessage, response: ServerResponse): Promise<void>;
62
+ recordBackendSpans(request: IncomingMessage, response: ServerResponse): Promise<void>;
63
+ };
64
+ export declare function buildProxyTargetUrl(frontendBaseUrl: string, requestUrl: string): string;
65
+ export declare function injectOverlayScript(html: string): string;
66
+ export declare function getOverlayScriptTag(serverUrl: string): string;
67
+ export declare function getOverlayClientScript(): string;
35
68
  //# sourceMappingURL=dev-command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dev-command.d.ts","sourceRoot":"","sources":["../src/dev-command.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgD,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAG5F,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIhD,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,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,CAAC,EAAE,OAAO,UAAU,CAAC;IAC/B,cAAc,CAAC,EAAE,C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