Commit Graph

26 Commits

Author SHA1 Message Date
木炎
956f0c2b68 feat: add generated scene skill platform hardening 2026-04-21 23:19:06 +08:00
木炎
4215d49f3f fix(analyzer): extract loginPath/mainPath as bootstrap fallback
When HTML/JS contains loginPath or mainPath variables (common in
95598 and similar scenes), extract the domain as expected_domain and
the full URL as target_url. This fixes the bootstrap_resolved gate
failure for scenes that use loginPath/mainPath instead of meta tags
or explicit bootstrap configuration.

🤖 Generated with [Qoder][https://qoder.com]
2026-04-17 19:44:13 +08:00
木炎
56ae03f3f9 feat(llm-client): add post-extraction validation with one-shot retry
After LLM returns scene IR, validate that critical fields (contentType,
responsePath, workflowArchetype) are present. If missing, send one
follow-up prompt to fill gaps. Merges repaired fields without overwriting
valid data from the first extraction.

🤖 Generated with [Qoder][https://qoder.com]
2026-04-17 18:45:15 +08:00
木炎
0fcdfb1787 feat(scene-generator): extract business JS files for LLM analysis
Identify and push js/ directory business logic files (mca.js, sgApi.js,
etc.) to the LLM prompt. Exclude third-party libraries. Capped at 4
fragments to stay within MAX_DEEP_PROMPT_CHARS budget.

🤖 Generated with [Qoder][https://qoder.com]
2026-04-17 18:43:04 +08:00
木炎
f374334f25 feat(llm-client): add mandatory field constraints to DEEP_SYSTEM_PROMPT
Explicitly require LLM to fill contentType, responsePath, and
requestTemplate with detected values or defaults. Reduces empty-field
rate from ~60% to target ~10%.

🤖 Generated with [Qoder][https://qoder.com]
2026-04-17 18:41:03 +08:00
木炎
e6bab40e5b feat(llm-client): auto-wrap single-mode scenes into modes array
When the LLM returns an empty modes array but has apiEndpoints,
automatically create a default mode with the first endpoint,
requestTemplate, responsePath, and normalizeRules. This ensures all
scenes compile through the multi-mode path.

🤖 Generated with [Qoder][https://qoder.com]
2026-04-17 18:38:51 +08:00
木炎
a325add167 fix(llm): add defaults for multi-mode fields in analyzeSceneDeep
🤖 Generated with [Qoder][https://qoder.com]
2026-04-17 13:07:10 +08:00
木炎
d95b8aaf26 feat(llm): enhance DEEP_SYSTEM_PROMPT for multi-mode detection
🤖 Generated with [Qoder][https://qoder.com]
2026-04-17 13:02:36 +08:00
木炎
74c42af717 fix: handle apiEndpoints/columnDefs objects in preview, add string type checks 2026-04-17 10:55:58 +08:00
木炎
bb15d14749 feat(runner): pass sceneInfoJson to Rust CLI for enhanced template rendering 2026-04-17 10:39:36 +08:00
木炎
7289cc5779 feat(ui): add deep extraction preview panel with API/column/static-params display 2026-04-17 10:37:50 +08:00
木炎
2ffb42c181 feat(server): add /analyze-deep endpoint for deep extraction
🤖 Generated with [Qoder][https://qoder.com]
2026-04-17 10:20:04 +08:00
木炎
614e9a3a45 feat(generator-runner): read index.html in readDirectory()
🤖 Generated with [Qoder][https://qoder.com]
2026-04-17 10:16:17 +08:00
木炎
517ac6bf39 feat(llm-client): add deep extraction with apiEndpoints, staticParams, columnDefs
Add analyzeSceneDeep() function that extracts complete SceneInfo from
index.html content including API endpoints, static parameters, column
definitions, and business logic. Also adds http module import to support
non-HTTPS LLM endpoints.

🤖 Generated with [Qoder][https://qoder.com]
2026-04-17 10:13:29 +08:00
木炎
f268668713 feat: add folder picker and target_url input to Web UI
- Add /select-folder and /select-file APIs using PowerShell dialogs
- Add --target-url parameter to CLI for explicit target URL override
- Redesign Web UI with folder browse buttons for all path inputs
- Add target_url optional input field for specifying target page URL
- Auto-fill scene-id from selected folder name

🤖 Generated with [Qoder][https://qoder.com]
2026-04-17 00:23:09 +08:00
木炎
b5131c858a feat: add scene kind dropdown to Web UI
Add scene type selector to the generator form:
- CSS styles for select element matching existing input style
- Dropdown with "报表收集类" (report_collection) and "监测类" (monitoring) options
- Pass sceneKind to /generate API endpoint

🤖 Generated with [Qoder][https://qoder.com]
2026-04-17 00:02:17 +08:00
木炎
2e69fa7239 feat: pass sceneKind from /generate request to generator
🤖 Generated with [Qoder][https://qoder.com]
2026-04-16 23:58:57 +08:00
木炎
f84e11c631 feat: add sceneKind param to generator-runner
Pass sceneKind to sg_scene_generate CLI when specified,
allowing generation of different scene kinds (report_collection,
monitoring, etc.).

🤖 Generated with [Qoder][https://qoder.com]
2026-04-16 23:57:30 +08:00
木炎
f168f9f375 fix: auto-find correct sgclaw_config.json in parent directory
Add parent sgClaw directory to config search candidates so Node.js
server automatically finds the correct config with DeepSeek API
endpoint instead of the test config in claw-new directory.

🤖 Generated with [Qoder][https://qoder.com]
2026-04-16 22:47:39 +08:00
木炎
23845413c5 fix: patch path traversal and baseUrl normalization in scene generator
- server.js: sanitize static file paths to prevent directory traversal
  (GET /../../sgclaw_config.json would expose API key)
- config-loader.js: fix normalizeBaseUrl to strip /v1 before appending,
  preventing double /v1 for non-standard base URLs

🤖 Generated with [Qoder][https://qoder.com]
2026-04-16 22:30:35 +08:00
木炎
6c1865eb1c feat: add serve.sh and serve.cmd startup scripts for Scene Skill Generator
🤖 Generated with [Qoder][https://qoder.com]
2026-04-16 22:25:34 +08:00
木炎
d00086a70b feat: add sg_scene_generator.html with dual-panel UI and settings modal
Add self-contained HTML page for the Scene Skill Generator frontend:
- Dual-column glass-morphism layout matching service-console style
- Left sidebar: status card, sourceDir input with analyze button,
  sceneId/sceneName inputs, settings button, generate button
- Right panel: streaming log display with SSE event rendering
- Settings modal: outputRoot, lessons, llmBaseUrl, llmModel fields
- JavaScript: connects to http://127.0.0.1:3210, implements analyze()
  via fetch POST /analyze, generate() via fetch POST /generate with
  SSE stream reading, settings modal open/close
- Rust test verifying HTML file exists and contains required elements

🤖 Generated with [Qoder][https://qoder.com]
2026-04-16 22:23:33 +08:00
木炎
e7a4179513 feat: add server.js with /health, /analyze, /generate routes 2026-04-16 22:18:32 +08:00
木炎
15d4b0dcc1 feat: add generator-runner.js for cargo subprocess + SSE streaming 2026-04-16 22:15:52 +08:00
木炎
294426ced9 feat: add llm-client.js with prompt builder and JSON extractor
🤖 Generated with [Qoder][https://qoder.com]
2026-04-16 22:13:11 +08:00
木炎
ead9ea76fa feat: add config-loader.js and initial server test
Add config-loader.js module for loading sgclaw_config.json credentials
and resolving project root directory. Add initial Rust source-guard test
to verify server file paths exist.

🤖 Generated with [Qoder][https://qoder.com]
2026-04-16 22:10:48 +08:00