guap-lab-auto 0.1.0__tar.gz
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.
- guap_lab_auto-0.1.0/.agents/skills/guap-lab-workflow/SKILL.md +113 -0
- guap_lab_auto-0.1.0/.agents/skills/guap-lab-workflow/references/commands.md +39 -0
- guap_lab_auto-0.1.0/.agents/skills/guap-lab-workflow/references/hermes.md +87 -0
- guap_lab_auto-0.1.0/.agents/skills/guap-lab-workflow/references/openclaw.md +72 -0
- guap_lab_auto-0.1.0/AGENTS.md +187 -0
- guap_lab_auto-0.1.0/LICENSE +21 -0
- guap_lab_auto-0.1.0/MANIFEST.in +9 -0
- guap_lab_auto-0.1.0/PKG-INFO +248 -0
- guap_lab_auto-0.1.0/README.md +212 -0
- guap_lab_auto-0.1.0/docs/integrations/README.md +39 -0
- guap_lab_auto-0.1.0/docs/integrations/hermes.md +75 -0
- guap_lab_auto-0.1.0/docs/integrations/openclaw.md +72 -0
- guap_lab_auto-0.1.0/docs/superpowers/plans/2026-05-20-lab-automation-cli.md +1599 -0
- guap_lab_auto-0.1.0/docs/superpowers/specs/2026-05-20-lab-automation-cli-design.md +239 -0
- guap_lab_auto-0.1.0/examples/hermes-skills.example.yaml +10 -0
- guap_lab_auto-0.1.0/examples/openclaw.json.example +20 -0
- guap_lab_auto-0.1.0/pyproject.toml +63 -0
- guap_lab_auto-0.1.0/scripts/capture_guap_fixtures.py +54 -0
- guap_lab_auto-0.1.0/scripts/install-agent-skills.ps1 +31 -0
- guap_lab_auto-0.1.0/scripts/install-agent-skills.sh +31 -0
- guap_lab_auto-0.1.0/setup.cfg +4 -0
- guap_lab_auto-0.1.0/skills/guap-lab-workflow/SKILL.md +113 -0
- guap_lab_auto-0.1.0/skills/guap-lab-workflow/references/commands.md +39 -0
- guap_lab_auto-0.1.0/skills/guap-lab-workflow/references/hermes.md +87 -0
- guap_lab_auto-0.1.0/skills/guap-lab-workflow/references/openclaw.md +72 -0
- guap_lab_auto-0.1.0/src/guap_lab_auto.egg-info/PKG-INFO +248 -0
- guap_lab_auto-0.1.0/src/guap_lab_auto.egg-info/SOURCES.txt +69 -0
- guap_lab_auto-0.1.0/src/guap_lab_auto.egg-info/dependency_links.txt +1 -0
- guap_lab_auto-0.1.0/src/guap_lab_auto.egg-info/entry_points.txt +2 -0
- guap_lab_auto-0.1.0/src/guap_lab_auto.egg-info/requires.txt +11 -0
- guap_lab_auto-0.1.0/src/guap_lab_auto.egg-info/top_level.txt +1 -0
- guap_lab_auto-0.1.0/src/lab_auto/__init__.py +3 -0
- guap_lab_auto-0.1.0/src/lab_auto/archive.py +83 -0
- guap_lab_auto-0.1.0/src/lab_auto/browser.py +187 -0
- guap_lab_auto-0.1.0/src/lab_auto/cli.py +277 -0
- guap_lab_auto-0.1.0/src/lab_auto/config.py +90 -0
- guap_lab_auto-0.1.0/src/lab_auto/context.py +24 -0
- guap_lab_auto-0.1.0/src/lab_auto/convert.py +139 -0
- guap_lab_auto-0.1.0/src/lab_auto/files.py +108 -0
- guap_lab_auto-0.1.0/src/lab_auto/logging.py +38 -0
- guap_lab_auto-0.1.0/src/lab_auto/models.py +263 -0
- guap_lab_auto-0.1.0/src/lab_auto/parsers.py +215 -0
- guap_lab_auto-0.1.0/src/lab_auto/paths.py +185 -0
- guap_lab_auto-0.1.0/src/lab_auto/review.py +49 -0
- guap_lab_auto-0.1.0/src/lab_auto/session_crypto.py +79 -0
- guap_lab_auto-0.1.0/src/lab_auto/session_store.py +99 -0
- guap_lab_auto-0.1.0/src/lab_auto/state.py +214 -0
- guap_lab_auto-0.1.0/src/lab_auto/submit.py +148 -0
- guap_lab_auto-0.1.0/src/lab_auto/sync.py +214 -0
- guap_lab_auto-0.1.0/src/lab_auto/workspace.py +64 -0
- guap_lab_auto-0.1.0/tests/test_archive.py +64 -0
- guap_lab_auto-0.1.0/tests/test_browser.py +47 -0
- guap_lab_auto-0.1.0/tests/test_cli.py +151 -0
- guap_lab_auto-0.1.0/tests/test_config.py +46 -0
- guap_lab_auto-0.1.0/tests/test_convert.py +101 -0
- guap_lab_auto-0.1.0/tests/test_convert_paths.py +70 -0
- guap_lab_auto-0.1.0/tests/test_files.py +109 -0
- guap_lab_auto-0.1.0/tests/test_integration_parsers.py +64 -0
- guap_lab_auto-0.1.0/tests/test_live_playwright.py +33 -0
- guap_lab_auto-0.1.0/tests/test_logging.py +61 -0
- guap_lab_auto-0.1.0/tests/test_merge.py +123 -0
- guap_lab_auto-0.1.0/tests/test_models.py +161 -0
- guap_lab_auto-0.1.0/tests/test_parsers.py +119 -0
- guap_lab_auto-0.1.0/tests/test_paths.py +105 -0
- guap_lab_auto-0.1.0/tests/test_review.py +35 -0
- guap_lab_auto-0.1.0/tests/test_session_crypto.py +27 -0
- guap_lab_auto-0.1.0/tests/test_session_store.py +115 -0
- guap_lab_auto-0.1.0/tests/test_state.py +149 -0
- guap_lab_auto-0.1.0/tests/test_submit.py +145 -0
- guap_lab_auto-0.1.0/tests/test_sync.py +445 -0
- guap_lab_auto-0.1.0/tests/test_workspace.py +39 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: guap-lab-workflow
|
|
3
|
+
description: Sync GUAP student lab tasks with lab-auto, edit reports in local folders, mark REVIEW, convert DOCX to PDF, and submit only after explicit human approval.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platforms: [macos, linux, windows]
|
|
6
|
+
metadata: {"openclaw":{"emoji":"🎓","homepage":"https://github.com/your-org/lab_automation","requires":{"bins":["lab-auto"]}},"hermes":{"emoji":"🎓","tags":["guap","education","labs","cli"],"category":"education","requires_toolsets":["terminal"]}}
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# GUAP lab workflow (`lab-auto`)
|
|
10
|
+
|
|
11
|
+
Use this skill when the user works on **GUAP** (`pro.guap.ru`) student lab tasks via the **`lab-auto`** CLI (PyPI package `guap-lab-auto`).
|
|
12
|
+
|
|
13
|
+
> Unofficial tool — not affiliated with GUAP. Portal HTML changes can break parsers.
|
|
14
|
+
|
|
15
|
+
## When to use
|
|
16
|
+
|
|
17
|
+
- Sync tasks from the GUAP website into local folders
|
|
18
|
+
- Write or update lab reports in the workspace
|
|
19
|
+
- Mark work ready for human review (`[REVIEW]`)
|
|
20
|
+
- Convert DOCX → PDF and submit PDFs **only when the user explicitly requests submission**
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install guap-lab-auto
|
|
26
|
+
playwright install chromium
|
|
27
|
+
lab-auto workspace set /path/to/workspace
|
|
28
|
+
lab-auto auth login # human completes browser login
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Optional: LibreOffice (`soffice`) or Microsoft Word (Windows) for `lab-auto convert`.
|
|
32
|
+
|
|
33
|
+
Environment overrides: `LAB_AUTO_ROOT`, `LAB_AUTO_SESSION_KEY` (advanced).
|
|
34
|
+
|
|
35
|
+
## Source of truth (read first)
|
|
36
|
+
|
|
37
|
+
| Path | Purpose |
|
|
38
|
+
|------|---------|
|
|
39
|
+
| `{workspace}/state/works.yaml` | Canonical records (`work_id`, statuses) |
|
|
40
|
+
| `{workspace}/state/summary.md` | Overview by subject |
|
|
41
|
+
| `{workspace}/state/needs_review.md` | Tasks in `[REVIEW]` |
|
|
42
|
+
| `{workspace}/labs/<subject>/...` | Per-task folders |
|
|
43
|
+
| `{workspace}/logs/[AI] YYYY-MM-DD.md` | Short action log |
|
|
44
|
+
|
|
45
|
+
**IDs:** CLI uses `work_id` like `task-178541`; folders look like `[STATUS] Task title [178541]`.
|
|
46
|
+
|
|
47
|
+
Skip `archived: true` unless the user asks about archived work.
|
|
48
|
+
|
|
49
|
+
## Standard procedure
|
|
50
|
+
|
|
51
|
+
1. `lab-auto sync` — refresh from website (do not run parallel with `submit` on the same task)
|
|
52
|
+
2. Edit report files inside the task folder under `labs/`
|
|
53
|
+
3. `lab-auto review <work-id>` — after AI or user edits the report
|
|
54
|
+
4. `lab-auto convert <work-id> --docx report.docx` — if the deliverable is DOCX
|
|
55
|
+
5. `lab-auto submit <work-id> --file report.pdf` — **only if the user clearly asked to submit**
|
|
56
|
+
6. `lab-auto sync` — reconcile status
|
|
57
|
+
|
|
58
|
+
## Commands (terminal)
|
|
59
|
+
|
|
60
|
+
Use the **terminal** toolset / shell. All commands accept `work-id` (`task-178541`), folder name, or relative folder path.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
lab-auto auth login | check | migrate-session | logout
|
|
64
|
+
lab-auto workspace set | show | unset <path>
|
|
65
|
+
lab-auto sync [--archive]
|
|
66
|
+
lab-auto status [--all]
|
|
67
|
+
lab-auto review <work-id>
|
|
68
|
+
lab-auto convert <work-id> --docx file.docx [--output file.pdf]
|
|
69
|
+
lab-auto submit <work-id> --file file.pdf
|
|
70
|
+
lab-auto archive | unarchive <work-id>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
One-shot workspace: `lab-auto --root /path/to/workspace sync`
|
|
74
|
+
|
|
75
|
+
## Status prefixes
|
|
76
|
+
|
|
77
|
+
| Prefix | Meaning |
|
|
78
|
+
|--------|---------|
|
|
79
|
+
| `[REFACTOR]` | Not accepted on website |
|
|
80
|
+
| `[REVIEW]` | Local — ready for human review |
|
|
81
|
+
| `[SENT]` | Submitted, awaiting teacher |
|
|
82
|
+
| `[SENTFAILED]` | Upload failed — suggest `sync` |
|
|
83
|
+
| `[DONE]` | Accepted |
|
|
84
|
+
| `[UNKNOWN]` | Unrecognized website status |
|
|
85
|
+
|
|
86
|
+
`[REVIEW]`, `[SENT]`, and `[SENTFAILED]` stay sticky until the website shows `ожидает проверки` or `принят`.
|
|
87
|
+
|
|
88
|
+
## Hard rules
|
|
89
|
+
|
|
90
|
+
1. **Never** run `submit` without explicit user approval after review.
|
|
91
|
+
2. **Never** scrape credentials or bypass `lab-auto auth login`.
|
|
92
|
+
3. **Never** delete `state/works.yaml` or session files to “fix” issues.
|
|
93
|
+
4. If `sync` parses **0 tasks**, suggest `lab-auto auth check` — state is unchanged.
|
|
94
|
+
5. Log only brief success/failure lines to `logs/[AI] YYYY-MM-DD.md`.
|
|
95
|
+
|
|
96
|
+
## Pitfalls
|
|
97
|
+
|
|
98
|
+
- **Session:** encrypted at `session/storage_state.json`; key in user config dir. Use `lab-auto auth migrate-session` for legacy files.
|
|
99
|
+
- **Submit lag:** detail page may lag → `[SENTFAILED]`; run `lab-auto sync`.
|
|
100
|
+
- **Concurrency:** avoid `sync` + `submit` on the same task simultaneously.
|
|
101
|
+
|
|
102
|
+
## Verification
|
|
103
|
+
|
|
104
|
+
- `lab-auto status` shows expected prefix and `work_id`
|
|
105
|
+
- Folder name matches `[STATUS] … [site-id]`
|
|
106
|
+
- After submit + sync, website status aligns with `[SENT]` or `[DONE]`
|
|
107
|
+
|
|
108
|
+
## More detail
|
|
109
|
+
|
|
110
|
+
- Repo agent guide: `AGENTS.md`
|
|
111
|
+
- Command reference: `{baseDir}/references/commands.md`
|
|
112
|
+
- OpenClaw setup: `{baseDir}/references/openclaw.md`
|
|
113
|
+
- Hermes setup: `{baseDir}/references/hermes.md`
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# lab-auto command reference
|
|
2
|
+
|
|
3
|
+
Install: `pip install guap-lab-auto` · CLI: `lab-auto` · Python 3.11+
|
|
4
|
+
|
|
5
|
+
## Auth
|
|
6
|
+
|
|
7
|
+
| Command | Description |
|
|
8
|
+
|---------|-------------|
|
|
9
|
+
| `lab-auto auth login` | Interactive GUAP login (stores encrypted session) |
|
|
10
|
+
| `lab-auto auth check` | Validate session; may upgrade encryption |
|
|
11
|
+
| `lab-auto auth migrate-session` | Encrypt legacy session without browser |
|
|
12
|
+
| `lab-auto auth import-cookie <file.json>` | Import Playwright storage or cookie list |
|
|
13
|
+
| `lab-auto auth logout` | Delete workspace session file |
|
|
14
|
+
|
|
15
|
+
## Workspace
|
|
16
|
+
|
|
17
|
+
| Command | Description |
|
|
18
|
+
|---------|-------------|
|
|
19
|
+
| `lab-auto workspace set <path>` | Save default workspace |
|
|
20
|
+
| `lab-auto workspace show` | Show active + saved paths |
|
|
21
|
+
| `lab-auto workspace unset` | Clear saved default |
|
|
22
|
+
|
|
23
|
+
Override: `--root <path>` or `LAB_AUTO_ROOT=<path>`
|
|
24
|
+
|
|
25
|
+
## Workflow
|
|
26
|
+
|
|
27
|
+
| Command | Description |
|
|
28
|
+
|---------|-------------|
|
|
29
|
+
| `lab-auto sync` | Sync tasks from GUAP |
|
|
30
|
+
| `lab-auto sync --archive` | Keep removed tasks as archived |
|
|
31
|
+
| `lab-auto status` | List active works |
|
|
32
|
+
| `lab-auto status --all` | Include archived |
|
|
33
|
+
| `lab-auto review <ref>` | Mark `[REVIEW]` and rename folder |
|
|
34
|
+
| `lab-auto convert <ref> --docx f.docx` | DOCX → PDF in work folder |
|
|
35
|
+
| `lab-auto submit <ref> --file f.pdf` | Upload PDF (after user approval) |
|
|
36
|
+
| `lab-auto archive <ref>` | Archive work |
|
|
37
|
+
| `lab-auto unarchive <ref>` | Restore archived work |
|
|
38
|
+
|
|
39
|
+
`<ref>` = `task-178541`, folder name, or path under workspace.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Hermes Agent integration
|
|
2
|
+
|
|
3
|
+
[Hermes Agent](https://hermes-agent.nousresearch.com/) uses AgentSkills-compatible `SKILL.md` files under `~/.hermes/skills/`.
|
|
4
|
+
|
|
5
|
+
## Install the skill
|
|
6
|
+
|
|
7
|
+
### Option A — Install script (recommended)
|
|
8
|
+
|
|
9
|
+
From the repo root:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Linux / macOS
|
|
13
|
+
./scripts/install-agent-skills.sh
|
|
14
|
+
|
|
15
|
+
# Windows PowerShell
|
|
16
|
+
.\scripts\install-agent-skills.ps1
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Copies `skills/guap-lab-workflow/` → `~/.hermes/skills/guap-lab-workflow/`.
|
|
20
|
+
|
|
21
|
+
### Option B — Manual copy
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
cp -r skills/guap-lab-workflow ~/.hermes/skills/guap-lab-workflow
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Option C — External skill directory (no copy)
|
|
28
|
+
|
|
29
|
+
Add the repo `skills/` folder to `~/.hermes/config.yaml`:
|
|
30
|
+
|
|
31
|
+
```yaml
|
|
32
|
+
skills:
|
|
33
|
+
external_dirs:
|
|
34
|
+
- /path/to/lab_automation/skills
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Local `~/.hermes/skills/guap-lab-workflow` wins if the same name exists in both places.
|
|
38
|
+
|
|
39
|
+
## Use in Hermes
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Slash command
|
|
43
|
+
/guap-lab-workflow sync my labs and list tasks in REVIEW
|
|
44
|
+
|
|
45
|
+
# Preload skill + terminal tools
|
|
46
|
+
hermes chat --toolsets terminal,skills -s guap-lab-workflow -q "Run lab-auto status in my workspace"
|
|
47
|
+
|
|
48
|
+
# TUI
|
|
49
|
+
hermes --tui
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Config
|
|
53
|
+
|
|
54
|
+
Set the default workspace for subprocesses in `~/.hermes/.env` or shell profile:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
export LAB_AUTO_ROOT=/path/to/your/guap-workspace
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Or pass per command:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
lab-auto --root /path/to/workspace sync
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Requirements
|
|
67
|
+
|
|
68
|
+
- Skill metadata: `requires_toolsets: [terminal]` — enable **terminal** in the session.
|
|
69
|
+
- Binaries: `lab-auto` on PATH (`pip install guap-lab-auto`).
|
|
70
|
+
- Run `playwright install chromium` once on the machine.
|
|
71
|
+
- `lab-auto auth login` must be completed by the user (browser).
|
|
72
|
+
|
|
73
|
+
## Bundles (optional)
|
|
74
|
+
|
|
75
|
+
Group with other dev skills:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
hermes bundles create guap-labs \
|
|
79
|
+
--skill guap-lab-workflow \
|
|
80
|
+
-d "GUAP lab sync and report workflow"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Then: `/guap-labs help me finish lab 3`
|
|
84
|
+
|
|
85
|
+
## Human-in-the-loop
|
|
86
|
+
|
|
87
|
+
Hermes must **not** run `lab-auto submit` unless the user explicitly approves submission.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# OpenClaw integration
|
|
2
|
+
|
|
3
|
+
[OpenClaw](https://documentation.openclaw.ai/) loads [AgentSkills](https://agentskills.io/) folders with `SKILL.md`.
|
|
4
|
+
|
|
5
|
+
## Option A — This repo as the agent workspace
|
|
6
|
+
|
|
7
|
+
Clone the repo and use it as the OpenClaw workspace. Skills load from:
|
|
8
|
+
|
|
9
|
+
| Precedence | Path in repo |
|
|
10
|
+
|------------|----------------|
|
|
11
|
+
| Workspace | `skills/guap-lab-workflow/` |
|
|
12
|
+
| Project agent | `.agents/skills/guap-lab-workflow/` |
|
|
13
|
+
|
|
14
|
+
Enable in `openclaw.json`:
|
|
15
|
+
|
|
16
|
+
```json5
|
|
17
|
+
{
|
|
18
|
+
agents: {
|
|
19
|
+
defaults: {
|
|
20
|
+
skills: ["guap-lab-workflow"],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
skills: {
|
|
24
|
+
entries: {
|
|
25
|
+
"guap-lab-workflow": {
|
|
26
|
+
enabled: true,
|
|
27
|
+
env: {
|
|
28
|
+
LAB_AUTO_ROOT: "/path/to/your/guap-workspace",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Slash command: `/guap-lab-workflow` (when `user-invocable` is enabled in frontmatter).
|
|
37
|
+
|
|
38
|
+
## Option B — Install for all local agents
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
openclaw skills install /path/to/lab_automation/skills/guap-lab-workflow --global
|
|
42
|
+
# or from ClawHub when published
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Option C — Extra skill directory
|
|
46
|
+
|
|
47
|
+
```json5
|
|
48
|
+
{
|
|
49
|
+
skills: {
|
|
50
|
+
load: {
|
|
51
|
+
extraDirs: ["/path/to/lab_automation/skills"],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Requirements (gating)
|
|
58
|
+
|
|
59
|
+
The skill declares `metadata.openclaw.requires.bins: ["lab-auto"]`. Install the CLI before enabling:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install guap-lab-auto
|
|
63
|
+
playwright install chromium
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Terminal tools
|
|
67
|
+
|
|
68
|
+
The agent needs shell access to run `lab-auto`. Enable your OpenClaw agent’s terminal/exec toolset alongside this skill.
|
|
69
|
+
|
|
70
|
+
## Human-in-the-loop
|
|
71
|
+
|
|
72
|
+
OpenClaw must **not** auto-run `lab-auto submit` unless the user explicitly requests it in the same conversation.
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# 🤖 Agent guide — guap-lab-auto
|
|
2
|
+
|
|
3
|
+
Instructions for coding agents (Cursor, Claude, Copilot, **OpenClaw**, **Hermes**, etc.) working with this repository or the installed `lab-auto` CLI.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What this project is
|
|
8
|
+
|
|
9
|
+
- **Package name (PyPI):** `guap-lab-auto`
|
|
10
|
+
- **CLI command:** `lab-auto`
|
|
11
|
+
- **Purpose:** Sync GUAP student tasks from `https://pro.guap.ru`, mirror them into local folders, track status in YAML, and submit PDF reports after explicit human approval.
|
|
12
|
+
- **Not official:** GUAP can change HTML anytime; parsers may break.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Install (agent environment)
|
|
17
|
+
|
|
18
|
+
### From PyPI
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install guap-lab-auto
|
|
22
|
+
playwright install chromium
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### From this repo
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install -e ".[dev]"
|
|
29
|
+
playwright install chromium
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Requirements
|
|
33
|
+
|
|
34
|
+
- Python **3.11+**
|
|
35
|
+
- **Chromium** for Playwright (`playwright install chromium`)
|
|
36
|
+
- Network access to `pro.guap.ru` for sync/submit/auth
|
|
37
|
+
- Optional: **LibreOffice** (`soffice`) or **Microsoft Word** (Windows) for `lab-auto convert`
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Workspace setup
|
|
42
|
+
|
|
43
|
+
1. Choose a directory for all user data (not the git clone root unless intended).
|
|
44
|
+
2. Run:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
lab-auto workspace set /path/to/workspace
|
|
48
|
+
lab-auto auth login # human must complete browser login
|
|
49
|
+
lab-auto auth check
|
|
50
|
+
lab-auto sync
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Override for one command: `lab-auto --root /path/to/workspace sync` or env `LAB_AUTO_ROOT`.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Source of truth (read first)
|
|
58
|
+
|
|
59
|
+
| File | Use |
|
|
60
|
+
|------|-----|
|
|
61
|
+
| `state/works.yaml` | Canonical task records (`work_id`, statuses, paths) |
|
|
62
|
+
| `state/summary.md` | Human-readable overview by subject |
|
|
63
|
+
| `state/needs_review.md` | Tasks in `[REVIEW]` |
|
|
64
|
+
| `labs/<subject>/...` | Per-task folders (reports, `task.pdf`) |
|
|
65
|
+
| `logs/[AI] YYYY-MM-DD.md` | Append short action notes |
|
|
66
|
+
|
|
67
|
+
**Skip** `archived: true` rows unless the user asks about archived work.
|
|
68
|
+
|
|
69
|
+
**IDs**
|
|
70
|
+
|
|
71
|
+
- CLI / YAML: `work_id` → `task-178541` (from task URL)
|
|
72
|
+
- `task_site_id` → `178541`
|
|
73
|
+
- Folder name: `[STATUS] Task title [178541]`
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Standard workflow (do not skip review)
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
sync → write report in work folder → review → convert (if DOCX) → submit (only if user asked) → sync
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
| Step | Command | Agent notes |
|
|
84
|
+
|------|---------|-------------|
|
|
85
|
+
| 1 | `lab-auto sync` | Refresh from website; do not run parallel with `submit` on same task |
|
|
86
|
+
| 2 | Edit files in `labs/.../` | Keep artifacts inside the work folder |
|
|
87
|
+
| 3 | `lab-auto review <work-id>` | Required after AI changes report |
|
|
88
|
+
| 4 | `lab-auto convert <id> --docx report.docx` | Only if user has DOCX |
|
|
89
|
+
| 5 | `lab-auto submit <id> --file report.pdf` | **Only when user explicitly requests submission** |
|
|
90
|
+
| 6 | `lab-auto sync` | Reconcile status |
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Hard rules for agents
|
|
95
|
+
|
|
96
|
+
1. **Never run `submit`** unless the user clearly said the report is reviewed and should be uploaded.
|
|
97
|
+
2. **Never automate GUAP login** beyond documented CLI commands (no credential scraping).
|
|
98
|
+
3. **Do not delete** `state/works.yaml` or session files to “fix” issues — use `auth login`, `sync`, or documented repair.
|
|
99
|
+
4. **Prefer CLI** over reimplementing browser/parsing logic in ad-hoc scripts.
|
|
100
|
+
5. **Log briefly** to `logs/[AI] YYYY-MM-DD.md` on success/failure (no verbose step spam).
|
|
101
|
+
6. If `sync` reports **0 tasks**, treat as auth/markup problem — suggest `auth check` or `auth login`; state is left unchanged.
|
|
102
|
+
7. **Archived works** are frozen until `lab-auto unarchive <id>`.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Command quick reference
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
lab-auto auth login | check | migrate-session | logout
|
|
110
|
+
lab-auto workspace set | show | unset
|
|
111
|
+
lab-auto sync [--archive]
|
|
112
|
+
lab-auto status [--all]
|
|
113
|
+
lab-auto review <work-id-or-folder>
|
|
114
|
+
lab-auto convert <work-id-or-folder> --docx file.docx [--output file.pdf]
|
|
115
|
+
lab-auto submit <work-id-or-folder> --file file.pdf
|
|
116
|
+
lab-auto archive | unarchive <work-id-or-folder>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
`work-id-or-folder` can be `task-178541`, folder name, or relative folder path under the workspace.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Status semantics (for merge/sync)
|
|
124
|
+
|
|
125
|
+
- `[REVIEW]`, `[SENT]`, `[SENTFAILED]` are **sticky** until the website shows `ожидает проверки` or `принят`.
|
|
126
|
+
- `[DONE]` is not downgraded to `[REFACTOR]` on a lagging list; resubmit → site `ожидает проверки` → local `[SENT]`.
|
|
127
|
+
- `[SENTFAILED]` after submit: suggest `lab-auto sync` to reconcile.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Development (agents modifying this repo)
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
pip install -e ".[dev]"
|
|
135
|
+
pytest # unit + fixture tests (no network)
|
|
136
|
+
pytest -m live # needs LAB_AUTO_ROOT + valid session
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Layout:
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
src/lab_auto/ # CLI and services
|
|
143
|
+
tests/fixtures/ # captured GUAP HTML
|
|
144
|
+
skills/ # optional Cursor skill for lab workflow
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Key modules: `sync.py`, `submit.py`, `parsers.py`, `state.py`, `paths.py`, `session_store.py`, `browser.py`.
|
|
148
|
+
|
|
149
|
+
When changing parsers, update fixtures via `scripts/capture_guap_fixtures.py` after a real login.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## OpenClaw
|
|
154
|
+
|
|
155
|
+
1. Install skill: `./scripts/install-agent-skills.sh` or use this repo as workspace (`skills/` + `.agents/skills/`).
|
|
156
|
+
2. Enable in `~/.openclaw/openclaw.json` — see `examples/openclaw.json.example`.
|
|
157
|
+
3. Set `LAB_AUTO_ROOT` under `skills.entries.guap-lab-workflow.env`.
|
|
158
|
+
4. Enable **terminal/shell** tools for the agent.
|
|
159
|
+
5. Invoke: `/guap-lab-workflow <request>`.
|
|
160
|
+
|
|
161
|
+
Details: [docs/integrations/openclaw.md](docs/integrations/openclaw.md)
|
|
162
|
+
|
|
163
|
+
## Hermes Agent
|
|
164
|
+
|
|
165
|
+
1. Install skill: `./scripts/install-agent-skills.sh` → `~/.hermes/skills/guap-lab-workflow/`.
|
|
166
|
+
2. Or add `skills.external_dirs` — see `examples/hermes-skills.example.yaml`.
|
|
167
|
+
3. Set `LAB_AUTO_ROOT` in `~/.hermes/.env`.
|
|
168
|
+
4. Run with terminal: `hermes chat --toolsets terminal,skills -s guap-lab-workflow`.
|
|
169
|
+
5. Invoke: `/guap-lab-workflow <request>`.
|
|
170
|
+
|
|
171
|
+
Details: [docs/integrations/hermes.md](docs/integrations/hermes.md)
|
|
172
|
+
|
|
173
|
+
## AgentSkills skill (canonical)
|
|
174
|
+
|
|
175
|
+
| Path | Role |
|
|
176
|
+
|------|------|
|
|
177
|
+
| `skills/guap-lab-workflow/SKILL.md` | Main skill (edit here) |
|
|
178
|
+
| `skills/guap-lab-workflow/references/` | Command + integration refs |
|
|
179
|
+
| `.agents/skills/guap-lab-workflow/` | OpenClaw project-agent copy (re-sync via install script) |
|
|
180
|
+
|
|
181
|
+
After editing the skill, run `scripts/install-agent-skills.sh` to update `~/.hermes/skills` and `~/.openclaw/skills`.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Publishing reminder
|
|
186
|
+
|
|
187
|
+
PyPI distribution name is **`guap-lab-auto`**; entry point remains **`lab-auto`**. See README § Publishing.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 lab-automation contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|