figranium 0.12.1 → 0.12.2

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/html-utils.js CHANGED
@@ -1,24 +1,24 @@
1
- // Simple HTML Formatter (fallback to raw if formatting collapses content)
2
- const formatHTML = (html) => {
3
- let indent = 0;
4
- return html.replace(/<(\/?)([a-z0-9]+)([^>]*?)(\/?)>/gi, (match, slash, tag, attrs, selfClose) => {
5
- if (slash) indent--;
6
- const result = ' '.repeat(Math.max(0, indent)) + match;
7
- if (!slash && !selfClose && !['img', 'br', 'hr', 'input', 'link', 'meta'].includes(tag.toLowerCase())) indent++;
8
- return '\n' + result;
9
- }).trim();
10
- };
11
-
12
- const safeFormatHTML = (html) => {
13
- if (typeof html !== 'string') return '';
14
- try {
15
- const formatted = formatHTML(html);
16
- if (!formatted) return html;
17
- if (formatted.length < Math.max(200, Math.floor(html.length * 0.5))) return html;
18
- return formatted;
19
- } catch {
20
- return html;
21
- }
22
- };
23
-
24
- module.exports = { formatHTML, safeFormatHTML };
1
+ // Simple HTML Formatter (fallback to raw if formatting collapses content)
2
+ const formatHTML = (html) => {
3
+ let indent = 0;
4
+ return html.replace(/<(\/?)([a-z0-9]+)([^>]*?)(\/?)>/gi, (match, slash, tag, attrs, selfClose) => {
5
+ if (slash) indent--;
6
+ const result = ' '.repeat(Math.max(0, indent)) + match;
7
+ if (!slash && !selfClose && !['img', 'br', 'hr', 'input', 'link', 'meta'].includes(tag.toLowerCase())) indent++;
8
+ return '\n' + result;
9
+ }).trim();
10
+ };
11
+
12
+ const safeFormatHTML = (html) => {
13
+ if (typeof html !== 'string') return '';
14
+ try {
15
+ const formatted = formatHTML(html);
16
+ if (!formatted) return html;
17
+ if (formatted.length < Math.max(200, Math.floor(html.length * 0.5))) return html;
18
+ return formatted;
19
+ } catch {
20
+ return html;
21
+ }
22
+ };
23
+
24
+ module.exports = { formatHTML, safeFormatHTML };
package/package.json CHANGED
@@ -1,82 +1,82 @@
1
- {
2
- "name": "figranium",
3
- "version": "0.12.1",
4
- "main": "index.js",
5
- "bin": {
6
- "figranium": "bin/cli.js"
7
- },
8
- "scripts": {
9
- "dev": "vite",
10
- "server": "node server.js",
11
- "start": "node server.js",
12
- "build": "tsc && vite build",
13
- "preview": "vite preview",
14
- "postinstall": "node scripts/postinstall.js",
15
- "test": "npx -y vite-node tests/clipboard.test.ts"
16
- },
17
- "files": [
18
- "bin",
19
- "dist",
20
- "public",
21
- "server.js",
22
- "agent.js",
23
- "headful.js",
24
- "scrape.js",
25
- "common-utils.js",
26
- "html-utils.js",
27
- "url-utils.js",
28
- "user-agent-settings.js",
29
- "proxy-rotation.js",
30
- "proxy-utils.js",
31
- "src/server/cron-parser.js",
32
- "src/server/scheduler.js",
33
- "src/server/routes/schedules.js",
34
- "extraction-worker.js",
35
- "start-vnc.sh",
36
- "scripts/postinstall.js",
37
- "README.md",
38
- "LICENSE",
39
- "!public/captures",
40
- "!dist/captures",
41
- "!public/screenshots",
42
- "!dist/screenshots"
43
- ],
44
- "keywords": [],
45
- "author": "",
46
- "license": "GPL-3.0-only",
47
- "description": "Figranium: Deterministic Control for an Agentic World",
48
- "dependencies": {
49
- "@google/gemini-cli": "^0.29.7",
50
- "bcryptjs": "^3.0.3",
51
- "express": "^5.2.1",
52
- "express-rate-limit": "^8.2.1",
53
- "express-session": "^1.18.2",
54
- "jsdom": "^22.1.0",
55
- "jszip": "^3.10.1",
56
- "pg": "^8.16.3",
57
- "playwright": "^1.57.0",
58
- "playwright-extra": "^4.3.6",
59
- "puppeteer-extra-plugin-stealth": "^2.11.2",
60
- "react": "^19.2.3",
61
- "react-dom": "^19.2.3",
62
- "react-markdown": "^10.1.0",
63
- "react-router-dom": "^7.11.0",
64
- "react-window": "^1.8.8",
65
- "remark-gfm": "^4.0.1",
66
- "session-file-store": "^1.5.0"
67
- },
68
- "devDependencies": {
69
- "@tailwindcss/postcss": "^4.1.18",
70
- "@types/node": "^25.0.3",
71
- "@types/react": "^19.2.7",
72
- "@types/react-dom": "^19.2.3",
73
- "@types/react-window": "^1.8.8",
74
- "@vitejs/plugin-react": "^5.1.2",
75
- "autoprefixer": "^10.4.23",
76
- "cross-env": "^10.1.0",
77
- "postcss": "^8.5.6",
78
- "tailwindcss": "^3.4.19",
79
- "typescript": "^5.9.3",
80
- "vite": "7.3.2"
81
- }
82
- }
1
+ {
2
+ "name": "figranium",
3
+ "version": "0.12.2",
4
+ "main": "index.js",
5
+ "bin": {
6
+ "figranium": "bin/cli.js"
7
+ },
8
+ "scripts": {
9
+ "dev": "vite",
10
+ "server": "node server.js",
11
+ "start": "node server.js",
12
+ "build": "tsc && vite build",
13
+ "preview": "vite preview",
14
+ "postinstall": "node scripts/postinstall.js",
15
+ "test": "npx -y vite-node tests/clipboard.test.ts"
16
+ },
17
+ "files": [
18
+ "bin",
19
+ "dist",
20
+ "public",
21
+ "server.js",
22
+ "agent.js",
23
+ "headful.js",
24
+ "scrape.js",
25
+ "common-utils.js",
26
+ "html-utils.js",
27
+ "url-utils.js",
28
+ "user-agent-settings.js",
29
+ "proxy-rotation.js",
30
+ "proxy-utils.js",
31
+ "src/server/cron-parser.js",
32
+ "src/server/scheduler.js",
33
+ "src/server/routes/schedules.js",
34
+ "extraction-worker.js",
35
+ "start-vnc.sh",
36
+ "scripts/postinstall.js",
37
+ "README.md",
38
+ "LICENSE",
39
+ "!public/captures",
40
+ "!dist/captures",
41
+ "!public/screenshots",
42
+ "!dist/screenshots"
43
+ ],
44
+ "keywords": [],
45
+ "author": "",
46
+ "license": "GPL-3.0-only",
47
+ "description": "Figranium: Deterministic Control for an Agentic World",
48
+ "dependencies": {
49
+ "@google/gemini-cli": "^0.29.7",
50
+ "bcryptjs": "^3.0.3",
51
+ "express": "^5.2.1",
52
+ "express-rate-limit": "^8.2.1",
53
+ "express-session": "^1.18.2",
54
+ "jsdom": "^22.1.0",
55
+ "jszip": "^3.10.1",
56
+ "pg": "^8.16.3",
57
+ "playwright": "^1.57.0",
58
+ "playwright-extra": "^4.3.6",
59
+ "puppeteer-extra-plugin-stealth": "^2.11.2",
60
+ "react": "^19.2.3",
61
+ "react-dom": "^19.2.3",
62
+ "react-markdown": "^10.1.0",
63
+ "react-router-dom": "^7.11.0",
64
+ "react-window": "^1.8.8",
65
+ "remark-gfm": "^4.0.1",
66
+ "session-file-store": "^1.5.0"
67
+ },
68
+ "devDependencies": {
69
+ "@tailwindcss/postcss": "^4.1.18",
70
+ "@types/node": "^25.0.3",
71
+ "@types/react": "^19.2.7",
72
+ "@types/react-dom": "^19.2.3",
73
+ "@types/react-window": "^1.8.8",
74
+ "@vitejs/plugin-react": "^5.1.2",
75
+ "autoprefixer": "^10.4.23",
76
+ "cross-env": "^10.1.0",
77
+ "postcss": "^8.5.6",
78
+ "tailwindcss": "^3.4.19",
79
+ "typescript": "^5.9.3",
80
+ "vite": "7.3.2"
81
+ }
82
+ }