The Conversations page calls aimsight-libredesk's conversations/pulling.py (formerly pompage.py, renamed with that repository's English translation); docs follow (pull.sh, pulling.py)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f0470295fa
commit
cccdeae67e
5 files changed
+15
-15
No files matched your search
+2
-2
@@ -48,7 +48,7 @@ The page opens on `http://127.0.0.1:8770`. Settings by variables: `AIMSIGHT_DATA
|
||||
|
||||
## The Conversations page
|
||||
|
||||
The LibreDesk conversations (`helpdesk.sensima.ch`), every inbox and status, private notes included, pumped **read-only** by `~/aimsight-libredesk` (link `libredesk/`, `conversations/pomper.sh` through `conversations/pompage.py`; the app only calls it, the read key stays in that repository's `.env`) into `labeling/auto/conversations/<reference>/`: `conversation.json`, `messages.json`, `attachments/`, and `transcript.md`, the readable thread.
|
||||
The LibreDesk conversations (`helpdesk.sensima.ch`), every inbox and status, private notes included, pumped **read-only** by `~/aimsight-libredesk` (link `libredesk/`, `conversations/pull.sh` through `conversations/pulling.py`; the app only calls it, the read key stays in that repository's `.env`) into `labeling/auto/conversations/<reference>/`: `conversation.json`, `messages.json`, `attachments/`, and `transcript.md`, the readable thread.
|
||||
|
||||
- **Pump**: without dates, what changed since the last complete pumping (`pumped.json`; the first time, the whole history, at a quiet hour); with dates, the conversations updated in that range (To excluded). One at a time; the end of `out/conversations.log` of that repository read every 2 s. The commit of `auto/conversations/` in `~/aimsight-labeling` is the user's.
|
||||
- **The list**: the pumped conversations, the most recent message first, searched on subject, contact and reference; a click shows the transcript.
|
||||
@@ -60,7 +60,7 @@ The LibreDesk conversations (`helpdesk.sensima.ch`), every inbox and status, pri
|
||||
- `server/station.py`: the data of the Data page; read-only on `data/` (through `tools/scripts/data.py`), writes only in `labeling/{auto,manual}/`.
|
||||
- `server/analysis.py`: the Analysis tab; launches `claude` with the agent `agents:analyst` (Read, Write, Bash allowed without asking); and the optimization, `/optimize` in Optimizer (Read, Write, Edit, Bash, Agent).
|
||||
- `server/support.py`: the Support tab; launches `claude` with the agent `agents:support` (Read, Write, Edit, Bash, Glob, Grep allowed without asking), through `analysis.run`.
|
||||
- `server/conversations.py`: the Conversations page; calls `libredesk/conversations/pompage.py`, lists `labeling/auto/conversations/`, renders a transcript safely.
|
||||
- `server/conversations.py`: the Conversations page; calls `libredesk/conversations/pulling.py`, lists `labeling/auto/conversations/`, renders a transcript safely.
|
||||
- `server/check.py`: checks, without calling claude: `.venv/bin/python app/server/check.py`.
|
||||
- `web/`: React (Vite) and Mantine; `src/App.jsx` (header, sidebar, address), `src/pages/Data.jsx` (the page), `src/pages/Images.jsx` (the images, in Data), `src/common.jsx` (requests, selector), `src/main.jsx` (theme). Plotly, dressed in Mantine's colours, loads only with Data. `dist/` and `node_modules/` outside git.
|
||||
|
||||
|
||||
+3
-3
@@ -415,15 +415,15 @@ def check_conversations():
|
||||
assert "img-src 'self'" in server.conversation_transcript("42").headers["content-security-policy"]
|
||||
refuses(conversations.transcript, "../analyses", False)
|
||||
refuses(server.conversation_file, "42", "../../etc/passwd")
|
||||
if conversations.pompage: # ~/aimsight-libredesk may be on a branch without conversations/ yet
|
||||
if conversations.pulling: # ~/aimsight-libredesk may be on a branch without conversations/ yet
|
||||
assert "From and To" in refuses(conversations.pump, {"start": "2026-11-01"})
|
||||
assert set(conversations.pump_state()) == {"running", "log"}
|
||||
pompage, conversations.pompage = conversations.pompage, None # no libredesk/ link: the app still runs
|
||||
pulling, conversations.pulling = conversations.pulling, None # no libredesk/ link: the app still runs
|
||||
try:
|
||||
assert "libredesk/" in refuses(conversations.pump, {})
|
||||
assert conversations.pump_state()["running"] is False and "libredesk/" in conversations.pump_state()["log"][0]
|
||||
finally:
|
||||
conversations.pompage = pompage
|
||||
conversations.pulling = pulling
|
||||
finally:
|
||||
conversations.FOLDER = before
|
||||
shutil.rmtree(root)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""The Conversations page: the LibreDesk conversations, pumped read-only by ~/aimsight-libredesk (link libredesk/,
|
||||
conversations/pompage.py, called as it is; its key stays in its .env) into labeling/auto/conversations/<reference>/
|
||||
conversations/pulling.py, called as it is; its key stays in its .env) into labeling/auto/conversations/<reference>/
|
||||
(conversation.json, messages.json, attachments/, transcript.md). The app lists them and shows a transcript safely: the text
|
||||
escaped before Markdown (a client's <script> stays text), served with a strict CSP (no script, no remote image), the
|
||||
attachments other than plain images as downloads.
|
||||
@@ -15,25 +15,25 @@ FOLDER = station.LABELS / "auto" / "conversations"
|
||||
LIBREDESK = station.ROOT / "libredesk"
|
||||
sys.path.append(str(LIBREDESK / "conversations"))
|
||||
try:
|
||||
import pompage # noqa: E402
|
||||
import pulling # noqa: E402
|
||||
except ImportError: # the page is not core: without the link, the rest of the app runs
|
||||
pompage = None
|
||||
pulling = None
|
||||
MISSING = "no libredesk/ link to ~/aimsight-libredesk with conversations/ (README)"
|
||||
|
||||
INLINE = {".png", ".jpg", ".jpeg", ".gif", ".webp"} # shown in the page; any other attachment is downloaded
|
||||
|
||||
|
||||
def pump_state():
|
||||
if not pompage:
|
||||
if not pulling:
|
||||
return {"running": False, "log": [MISSING]}
|
||||
return {"running": pompage.running(), "log": pompage.log()}
|
||||
return {"running": pulling.running(), "log": pulling.log()}
|
||||
|
||||
|
||||
def pump(body):
|
||||
if not pompage:
|
||||
if not pulling:
|
||||
raise station.Refusal(MISSING)
|
||||
try:
|
||||
pompage.start(body.get("start") or "", body.get("end") or "", str(FOLDER))
|
||||
pulling.start(body.get("start") or "", body.get("end") or "", str(FOLDER))
|
||||
except ValueError as e:
|
||||
raise station.Refusal(str(e)) from e
|
||||
return pump_state()
|
||||
|
||||
Reference in new issue
Block a user