aipeek 0.1.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 +48 -0
- package/dist/chunk-4W6WRO3S.cjs +529 -0
- package/dist/chunk-C24MQAPN.js +529 -0
- package/dist/cli.cjs +41 -0
- package/dist/cli.js +41 -0
- package/dist/index.cjs +22 -0
- package/dist/index.d.cts +69 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.js +22 -0
- package/dist/plugin.cjs +6 -0
- package/dist/plugin.js +6 -0
- package/package.json +45 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
interface LogEntry {
|
|
4
|
+
level: 'error' | 'warn' | 'info' | 'debug' | 'log';
|
|
5
|
+
text: string;
|
|
6
|
+
timestamp?: number;
|
|
7
|
+
source?: string;
|
|
8
|
+
}
|
|
9
|
+
interface NetworkRequest {
|
|
10
|
+
method: string;
|
|
11
|
+
url: string;
|
|
12
|
+
status: number;
|
|
13
|
+
duration: number;
|
|
14
|
+
resourceType: string;
|
|
15
|
+
requestHeaders?: Record<string, string>;
|
|
16
|
+
responseHeaders?: Record<string, string>;
|
|
17
|
+
requestBody?: string;
|
|
18
|
+
requestSample?: string;
|
|
19
|
+
responseBody?: string;
|
|
20
|
+
responseSample?: string;
|
|
21
|
+
failed?: boolean;
|
|
22
|
+
failureText?: string;
|
|
23
|
+
}
|
|
24
|
+
interface ErrorEntry {
|
|
25
|
+
message: string;
|
|
26
|
+
stack?: string;
|
|
27
|
+
source?: string;
|
|
28
|
+
line?: number;
|
|
29
|
+
column?: number;
|
|
30
|
+
}
|
|
31
|
+
interface RawState {
|
|
32
|
+
url: string;
|
|
33
|
+
ui: string;
|
|
34
|
+
console: LogEntry[];
|
|
35
|
+
network: NetworkRequest[];
|
|
36
|
+
errors: ErrorEntry[];
|
|
37
|
+
state: Record<string, unknown>;
|
|
38
|
+
timestamp: number;
|
|
39
|
+
}
|
|
40
|
+
interface CompactState {
|
|
41
|
+
url: string;
|
|
42
|
+
ui: string;
|
|
43
|
+
console: string;
|
|
44
|
+
network: string;
|
|
45
|
+
errors: string;
|
|
46
|
+
state: string;
|
|
47
|
+
timestamp: number;
|
|
48
|
+
counts: {
|
|
49
|
+
console: number;
|
|
50
|
+
network: number;
|
|
51
|
+
errors: number;
|
|
52
|
+
state: number;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare function compactUI(tree: string): string;
|
|
57
|
+
declare function compactConsole(logs: LogEntry[]): string;
|
|
58
|
+
declare function compactNetwork(requests: NetworkRequest[]): string;
|
|
59
|
+
declare function compactErrors(errors: ErrorEntry[]): string;
|
|
60
|
+
declare function compactState(state: Record<string, unknown>): string;
|
|
61
|
+
declare function compact(raw: RawState): CompactState;
|
|
62
|
+
|
|
63
|
+
declare function emit(state: CompactState): string;
|
|
64
|
+
|
|
65
|
+
declare function detail(raw: RawState, section: string, index: string | undefined, full: boolean): Promise<string | null>;
|
|
66
|
+
|
|
67
|
+
declare function aipeekPlugin(): Plugin;
|
|
68
|
+
|
|
69
|
+
export { type CompactState, type ErrorEntry, type LogEntry, type NetworkRequest, type RawState, aipeekPlugin, compact, compactConsole, compactErrors, compactNetwork, compactState, compactUI, detail, emit };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
aipeekPlugin,
|
|
3
|
+
compact,
|
|
4
|
+
compactConsole,
|
|
5
|
+
compactErrors,
|
|
6
|
+
compactNetwork,
|
|
7
|
+
compactState,
|
|
8
|
+
compactUI,
|
|
9
|
+
detail,
|
|
10
|
+
emit
|
|
11
|
+
} from "./chunk-C24MQAPN.js";
|
|
12
|
+
export {
|
|
13
|
+
aipeekPlugin,
|
|
14
|
+
compact,
|
|
15
|
+
compactConsole,
|
|
16
|
+
compactErrors,
|
|
17
|
+
compactNetwork,
|
|
18
|
+
compactState,
|
|
19
|
+
compactUI,
|
|
20
|
+
detail,
|
|
21
|
+
emit
|
|
22
|
+
};
|
package/dist/plugin.cjs
ADDED
package/dist/plugin.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "aipeek",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Gives AI a peek into your running browser app — UI tree, console, network, errors, state",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/nicepkg/aipeek"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"bin": {
|
|
18
|
+
"aipeek": "dist/cli.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsup",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"test:watch": "vitest"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"picocolors": "^1.1.1",
|
|
30
|
+
"quicktype-core": "^23.2.6"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"vite": ">=5.0.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependenciesMeta": {
|
|
36
|
+
"vite": {
|
|
37
|
+
"optional": true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"tsup": "^8.4.0",
|
|
42
|
+
"typescript": "~5.7.2",
|
|
43
|
+
"vitest": "^3.1.2"
|
|
44
|
+
}
|
|
45
|
+
}
|